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;
}
Exemple #2
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;
}
// 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;
}