Функция, которая выбирает сначала геометрию(линию) на чертеже, а потом две точки.
- Код: Выделить всё
void CAADrwDimDressupCmd::BuildGraph()
{
_pObjectAgent1 = new CATIndicationAgent("GetFirstPoint");
_pObjectAgent1->SetBehavior(CATDlgEngWithUndo);
_pObjectAgent = new CATPathElementAgent("_pObjectAgent A");
_pObjectAgent ->SetBehavior( CATDlgEngWithPrevaluation |
CATDlgEngMultiAcquisition |
CATDlgEngWithCSO);
_pObjectAgent ->AddElementType("IDMCircle2D");
_pObjectAgent ->AddElementType("IDMLine2D");
_pObjectAgent ->AddElementType("IDMCurve2D");
_pObjectAgent ->AddElementType("IDMEllipse2D");
_pObjectAgent ->AddElementType("IDMPoint2D");
_pObjectAgent ->AddElementType("IDMPolyline2D");
CATDialogState* pState1 = GetInitialState("Select any 2D geometry");
pState1->AddDialogAgent(_pObjectAgent);
CATDialogState *stGetPt1 = AddDialogState("Select First Point");
stGetPt1->AddDialogAgent( _pObjectAgent1);
CATDialogState *stGetPt2 = AddDialogState("Select Second Point");
stGetPt2->AddDialogAgent( _pObjectAgent1);
AddCSOClient(_pObjectAgent);
AddTransition(pState1, stGetPt1, IsOutputSetCondition(_pObjectAgent),
Action((ActionMethod)&CAADrwDimDressupCmd::GetProduct, NULL, NULL));
AddTransition(stGetPt1, stGetPt2, IsOutputSetCondition(_pObjectAgent1),
Action((ActionMethod)&CAADrwDimDressupCmd::GetPoint_1, NULL, NULL));
AddTransition(stGetPt2, NULL, IsOutputSetCondition(_pObjectAgent1),
Action((ActionMethod)&CAADrwDimDressupCmd::GetPoint_2, NULL, NULL));
}
Как бы сделать так, чтобы геометрия выбиралась несколько раз, пока не будет выбрана точка?
Надо бы добавить что-то на подобии такого...
Но Катия падает.
- Код: Выделить всё
AddTransition(pState1, pState1, IsOutputSetCondition(_pObjectAgent),
Action((ActionMethod)&CAADrwDimDressupCmd::GetCheck1, NULL, NULL));
AddTransition(pState1, pState1, IsLastModifiedAgentCondition(_pObjectAgent),
Action((ActionMethod)&CAADrwDimDressupCmd::GetCheck, NULL, NULL));
Традиционная благодарность за любой намек!