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 ); }
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 ); } }
// This function creates an AcDbEllipse object and gets the // jig started acquiring the necessary info to properly fill // it in. // void AsdkEllipseJig::doIt() { mpEllipse = new AcDbEllipse(); mpEllipse->set(mCenterPt, mNormal, mMajorAxis, mRadiusRatio); // Set default parameters for the ellipse. // Get the major axis vector from the user. // // At this time, mPromptCounter == 0 // setDispPrompt(_T("\nEllipse major axis: ")); AcEdJig::DragStatus stat = drag(); // Get the ellipse's radius ratio. // mPromptCounter++; // now == 1 setDispPrompt(_T("\nEllipse minor axis: ")); stat = drag(); // Now add the ellipse to the database's current space. // append(); }
void Jig3d::engage(void) throw(CmdException) { char* prompt = "\nSpecify displacement or [Base point/X/Y/Z/Exit]:"; AcEdJig::DragStatus status; do { setDispPrompt(prompt); status = drag(); switch (status) { case AcEdJig::kKW1: if (m_mode == kMove) acedGetPoint(asDblArray(m_refPoint),"Specify base point:",asDblArray(m_refPoint)); else { apply(); status = AcEdJig::kCancel; } break; case AcEdJig::kKW2: assert(m_mode == kMove); m_mode = kRotateX; prompt = "Specify rotation around X axis or [Exit]:"; break; case AcEdJig::kKW3: assert(m_mode == kMove); m_mode = kRotateY; prompt = "Specify rotation around Y axis [Exit]:"; break; case AcEdJig::kKW4: assert(m_mode == kMove); m_mode = kRotateZ; prompt = "Specify rotation around Z axis [Exit]:"; break; case AcEdJig::kKW5: apply(); status = AcEdJig::kCancel; break; default: m_xform = m_xformTemp*m_xform; if (m_mode == kMove) m_refPoint+=m_xformTemp.translation(); m_mode = kMove; prompt = "\nSpecify displacement or [Base point/X/Y/Z/Exit]:"; break; } } while (status != AcEdJig::kCancel); }
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; }
//----------------------------------------------------------------------------- // This function creates an AcDbPolyline object after the // jig startes and aquires the necessary vertex for the opposite // corner from the drag samples. // void AsdkRectangleJig::doRectangle() { AcEdJig::DragStatus stat; setDispPrompt("\nOther corner: "); // Get the other corner now. // stat = drag(); // Now add the polyline rectangle to the database's current space // if we return a kNormal stat from drag(). If we don't then delete // the polyline. // if (stat == kNormal) append(); else delete m_pLWPoly; }
void AcRectJig::dragIt() { AcEdJig::DragStatus stat; const char* prompt = "\nSpecify other corner point: "; do { setDispPrompt(prompt); stat = drag(); //keywordHandler(stat); } while (stat != AcEdJig::kNormal && stat != AcEdJig::kCancel && stat != AcEdJig::kNull); // Use AcDimJig's append if (stat == AcEdJig::kNormal) { append(); } else { delete mpRect; } }
// This is the main jig method, which acquires the appropriate information to define the smiley // void SmileyJig::start() { char messBuf[80]; if ( jigDataMgr.docData().m_lastRadius > 0.0 ) sprintf( messBuf, "\nRadius <%.4f>: ", jigDataMgr.docData().m_lastRadius ); else sprintf( messBuf, "\nRadius: ", jigDataMgr.docData().m_lastRadius ); setDispPrompt( messBuf ); AcEdJig::DragStatus stat = drag(); if ( kNormal == stat ){ jigDataMgr.docData().m_lastRadius = mradius; append(); } else { delete mpSmiley; } mpSmiley = NULL; }