看了acoka兄的意见后,不太明白怎么写,我改了一下,可以在线的selectlist里面只能选边线;面的selectlist可以选面,但是选面时得到的名字还是edge。代码如下:
ElementAgent = new CATFeatureImportAgent ("curve");
ElementAgent->SetOrderedElementType("CATIMfMonoDimResult");
ElementAgent->AddOrderedElementType("CATCurve");
ElementAgent->AddOrderedElementType("CATLine");
ElementAgent->SetBehavior ( CATDlgEngWithPrevaluation | CATDlgEngWithCSO | CATDlgEngOneShot );
ElementAgent->SetAgentBehavior ( MfPermanentBody | MfLastFeatureSupport | MfRelimitedFeaturization );
ElementAgent->SetBehavior(CATDlgEngWithPSOHSO | CATDlgEngWithPrevaluation );
AddCSOClient(ElementAgent);
ElementAgent1 = new CATFeatureImportAgent ("curface");
ElementAgent1->SetOrderedElementType("CATIMfBiDimResult");
ElementAgent1->AddOrderedElementType("CATSurface");
ElementAgent1->AddOrderedElementType("CATFace");
ElementAgent1->SetBehavior ( CATDlgEngWithPrevaluation | CATDlgEngWithCSO | CATDlgEngOneShot );
ElementAgent1->SetAgentBehavior ( MfPermanentBody | MfLastFeatureSupport | MfRelimitedFeaturization );
AddCSOClient(ElementAgent1);
ElementAgent1->SetBehavior(CATDlgEngWithPSOHSO |
CATDlgEngWithPrevaluation );
_OKAgent= new CATDialogAgent("OK Agent");
_OKAgent->AcceptOnNotify ( pi, pi->GetDiaOKNotification());
_CancelAgent= new CATDialogAgent("CancelAgent");
_CancelAgent->AcceptOnNotify ( pi, pi->GetDiaCANCELNotification());
CATDialogState * initialState = GetInitialState("line");
initialState -> AddDialogAgent (ElementAgent);
CATDialogState *stState2 = AddDialogState("surface");
stState2 -> AddDialogAgent (ElementAgent1);
CATDialogState *stState3 = AddDialogState("panel");
ElementAgent->InitializeAcquisition();
stState3 -> AddDialogAgent (_OKAgent);
stState3 -> AddDialogAgent (_CancelAgent);
AddTransition( initialState, stState2,
IsOutputSetCondition (ElementAgent),
Action ((ActionMethod) &SimOffsetCurveCmd::SelectCurve));
AddTransition( stState2, stState3,
IsOutputSetCondition (ElementAgent1),
Action ((ActionMethod) &SimOffsetCurveCmd::SelectPlane));
AddTransition( stState3, NULL,
IsOutputSetCondition (_OKAgent),
Action ((ActionMethod) &SimOffsetCurveCmd::OkAction));
AddTransition( stState3, NULL,
IsOutputSetCondition (_CancelAgent),
Action ((ActionMethod) &SimOffsetCurveCmd::ActionCancel)); |