// 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; }
//----------------------------------------------------------------------------- // 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; }
AcEdJig::DragStatus Jig3d::sampler() { setSpecialCursorType(AcEdJig::kRubberBand); AcGePoint3d pt; AcEdJig::DragStatus status; double angle; if (m_mode == kMove){ setKeywordList("Base X Y Z Exit"); status = acquirePoint(pt,m_refPoint); } else { setKeywordList("Exit"); //acquireAngle seems to have a defect //I'm applying the following temporary //workaround: status = acquirePoint(pt,m_refPoint); angle = acutAngle(asDblArray(pt),asDblArray(m_refPoint)); } if (pt == m_LastPoint) // if there is no work to be done, return status; // exit early! m_LastPoint = pt; if (status == AcEdJig::kNormal){ switch (m_mode) { case kMove: m_xformTemp = AcGeMatrix3d::translation(pt-m_refPoint); m_int.setTransform(m_xformTemp*m_xform); break; case kRotateX: m_xformTemp = AcGeMatrix3d::rotation(angle,AcGeVector3d::kXAxis,m_refPoint); m_int.setTransform(m_xformTemp*m_xform); break; case kRotateY: m_xformTemp = AcGeMatrix3d::rotation(angle,AcGeVector3d::kYAxis,m_refPoint); m_int.setTransform(m_xformTemp*m_xform); break; case kRotateZ: m_xformTemp = AcGeMatrix3d::rotation(angle,AcGeVector3d::kZAxis,m_refPoint); m_int.setTransform(m_xformTemp*m_xform); break; } m_pModel->onModified(&m_int, m_MSBObjectID.asOldId()); } return status; }
void GoafDragJig::doIt() { setDispPrompt( _T( "\nÖ¸¶¨»ùµã£º" ) ); if( kNormal != acquirePoint( basePt ) ) return; if( kNormal == drag() ) { CopyBack( m_pGoaf, m_objId ); } }
void TunnelDragJig::doIt() { setDispPrompt( _T( "\n指定基点:" ) ); if( kNormal != acquirePoint( basePt ) ) return; if( kNormal == drag() ) { CopyBack( m_pWS, m_objId ); } }
AcEdJig::DragStatus CCurveTextJig::sampler() { DragStatus stat; stat = acquirePoint(m_point); if(stat == AcEdJig::kCancel) return stat; if(m_dist == m_InputPoint.getDistanceOnCurve()) return AcEdJig::kNoChange; else m_dist = m_InputPoint.getDistanceOnCurve(); 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; }
AcEdJig::DragStatus DoubleWorkSurfaceDraw_Jig::getEndPoint() { AcGePoint3d pt; AcEdJig::DragStatus stat = acquirePoint( pt, m_pDraw->m_startPt ); if( stat != kNormal ) return stat; if( pt == m_pDraw->m_startPt ) { stat = kNoChange; } else { m_pDraw->m_endPt = pt; } return stat; }
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 ); }
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; }