Beispiel #1
0
// This function is called by the drag function in order to
// aquire a sample input
//
AcEdJig::DragStatus AcRectJig::sampler()
{
    DragStatus stat;

    setUserInputControls((UserInputControls)
                         (AcEdJig::kAccept3dCoordinates
                          | AcEdJig::kGovernedByOrthoMode
                          | AcEdJig::kAcceptOtherInputString
                          | AcEdJig::kNoNegativeResponseAccepted
                          | AcEdJig::kNullResponseAccepted
                          | AcEdJig::kNoZeroResponseAccepted));

    //const char* keyWord = "Horz Vert All None";
    //setKeywordList(keyWord);

    AcGePoint3d pnt;
    stat = acquirePoint(pnt);
    if (stat == kNormal) {
        if (pnt == mWcsPt2)   {
            return AcEdJig::kNoChange;
        } else {
            mWcsPt2 = pnt;
        }
    }

    return stat;
}
Beispiel #2
0
//-----------------------------------------------------------------------------
// This function is called by the drag function in order to
// aquire a sample input
//
AcEdJig::DragStatus AsdkRectangleJig::sampler()
{
    DragStatus stat = kNormal;

    setUserInputControls((UserInputControls)
        (   AcEdJig::kNoNegativeResponseAccepted
         |  AcEdJig::kNoZeroResponseAccepted)
        );
   
    setSpecialCursorType(kCrosshair);

    stat = acquirePoint(m_BottomRightCorner, plineInfo.m_topLeftCorner);  

    // Now project the point at the crosshairs to the ECS of the 
    // polyline being drawn.
    //
    AcGePlane planeParallelToUCS(m_TopLeftCorner, m_vecUnitZ);    
    m_BottomRightCorner = m_BottomRightCorner.project(planeParallelToUCS, m_vecUnitZ);

    // If the newly acquired point is the same as it was
    // in the last sample, then we return kNoChange so that
    // AsdkRectangleJig::update() will not be called and the
    // last update call will be able to finish thus allowing
    // the polyline to fully elaborate.
    //
    if (samplerCorner != m_BottomRightCorner) {
        // m_BottomRightCorner will be used to update the remaining corners
        // in AsdkRectangleJig::update() below.
        //
        samplerCorner = m_BottomRightCorner;        
    } else if (stat == AcEdJig::kNormal)
        return AcEdJig::kNoChange;

    return stat;
}
Beispiel #3
0
AcEdJig::DragStatus
SmileyJig::sampler()
{
    double dist;

    setUserInputControls( ( UserInputControls )
        ( kNullResponseAccepted | kAccept3dCoordinates |
          kGovernedByOrthoMode  | kDontUpdateLastPoint ));

    DragStatus stat = acquireDist( dist, mpSmiley->center() );
    if ( kNull == stat ){
        mradius = jigDataMgr.docData().m_lastRadius;
        stat = kNormal;
    }
    else if ( kNormal == stat ) {
        if (0.0 >= dist)
            stat = kOther;
        else {
            // save new radius for later update of our entity
            if ( dist != mradius )
                mradius = dist;
            else
                stat = kNoChange;
        }
    }
    return stat;
}
Beispiel #4
0
AcEdJig::DragStatus
MaterialJig::sampler()
{
    double dist;

    setUserInputControls( ( UserInputControls )
        ( kNullResponseAccepted | kAccept3dCoordinates |
          kGovernedByOrthoMode  | kDontUpdateLastPoint ));

    DragStatus stat = acquireDist( dist, mpMaterialEnt->center() );

    switch (stat) {

    case kNull:
        mWidth = jigDataMgr.docData().m_lastWidth;
        stat = kNormal;
        break;

    case kNormal:
        if (dist <= 0.0)
            stat = kOther;
        else {
            // save new width for later update of our entity
            if ( dist != mWidth )
                mWidth = dist;
            else
                stat = kNoChange;
        }
        break;
    }

    return stat;
}
// This function is called by the drag function to
// acquire a sample input.
//
AcEdJig::DragStatus
AsdkEllipseJig::sampler()
{
    DragStatus stat;

    setUserInputControls((UserInputControls)
        (AcEdJig::kAccept3dCoordinates
         | AcEdJig::kNoNegativeResponseAccepted
         | AcEdJig::kNoZeroResponseAccepted));

    if (mPromptCounter == 0) {

        // Aquire the major axis endpoint.
        //
        // If the newly acquired point is the same as it was
        // in the last sample, then we return kNoChange so the
        // AsdkEllipseJig::update() function will not be called and the
        // last update call will be able to finish, thus allowing
        // the ellipse to fully elaborate.
        //
        static AcGePoint3d axisPointTemp;
        stat = acquirePoint(mAxisPt, mCenterPt);
        if (axisPointTemp != mAxisPt)
            axisPointTemp = mAxisPt;
        else if (stat == AcEdJig::kNormal)
            return AcEdJig::kNoChange;
    }
    else if (mPromptCounter == 1) {

        // Aquire the distance from ellipse center to minor
        // axis endpoint. This will be used to calculate the
        // radius ratio.
        //
        // If the newly acquired distance is the same as it was
        // in the last sample, then we return kNoChange so the
        // AsdkEllipseJig::update() function will not be called and the
        // last update call will be able to finish, thus allowing
        // the ellipse to fully elaborate.
        //
        static double radiusRatioTemp = -1;
        stat = acquireDist(mRadiusRatio, mCenterPt);
        if (radiusRatioTemp != mRadiusRatio)
            radiusRatioTemp = mRadiusRatio;
        else if (stat == AcEdJig::kNormal)
            return AcEdJig::kNoChange;
    }
    return stat;
}
Beispiel #6
0
Acad::ErrorStatus
AcRectJig::acquireDefPoints()
{
    setUserInputControls((UserInputControls)
                         (AcEdJig::kAccept3dCoordinates
                          | AcEdJig::kGovernedByOrthoMode
                          | AcEdJig::kNoNegativeResponseAccepted
                          | AcEdJig::kNullResponseAccepted
                          | AcEdJig::kNoZeroResponseAccepted));

    setPlane();
    const char* prompt = "\nSpecify first corner point: ";
    setDispPrompt(prompt);

    int stat = acquirePoint(mWcsPt1);
    return (stat == AcEdJig::kNormal) ? Acad::eOk : Acad::eInvalidInput;
}
Adesk::Boolean DoubleWorkSurfaceDraw_Jig::doJig( MineGEDraw* pMineGEDraw )
{
    // 转换成特定效果的draw指针对象
    m_pDraw = DoubleWorkSurfaceDraw::cast( pMineGEDraw );

    setUserInputControls( ( UserInputControls )( kAcceptMouseUpAsPoint | kDontUpdateLastPoint ) );

    setDispPrompt( _T( "\n请选择工作面起点坐标: " ) );
    AcGePoint3d pt;
    DragStatus stat = acquirePoint( pt );
    if ( stat != kNormal ) return Adesk::kFalse;

    m_pDraw->m_startPt = pt;

    setDispPrompt( _T( "\n请选择工作面末点坐标: " ) );
    stat = drag();

    return ( stat == kNormal );
}
Beispiel #8
0
AcEdJig::DragStatus GoafDragJig::sampler()
{

    setUserInputControls( ( UserInputControls )
                          ( AcEdJig::kAccept3dCoordinates
                            | AcEdJig::kNoNegativeResponseAccepted
                            | AcEdJig::kNoZeroResponseAccepted ) );

    static AcGePoint3d tempPoint;

    DragStatus stat = acquirePoint( curPt, basePt );
    if( tempPoint != curPt )
    {
        tempPoint = curPt;
    }
    else if( stat == AcEdJig::kNormal )
    {
        return AcEdJig::kNoChange;
    }
    return stat;
}