再问一下这个问题,还没有解决。我手工把基类改成了CATMMUIPanelStateCmd,编译也没有问题,可是 BuildGraph()写的还是不能满足我的要求,如下:
void pointCmd::BuildGraph()
{
pi=new pointBox();
pi->Build();
pi->SetVisibility(CATDlgShow);
_daPathElement = new CATPathElementAgent("GetSurface");
_daPathElement->AddElementType("CATSurface");
_daPathElement2 = new CATPathElementAgent("GetCurve");
_daPathElement2->AddElementType("CATSurface");
_daPathElement3 = new CATPathElementAgent("GetSurface");
_daPathElement3->AddElementType("CATCurve");
_daPathElement->SetBehavior(CATDlgEngWithPSOHSO |
CATDlgEngWithPrevaluation);
_daPathElement2->SetBehavior(CATDlgEngWithPSOHSO |
CATDlgEngWithPrevaluation);
_daPathElement3->SetBehavior(CATDlgEngWithPSOHSO |
CATDlgEngWithPrevaluation);
CATDialogState *MainState = GetInitialState("stPointId");
MainState->AddDialogAgent(_daPathElement);
MainState->AddDialogAgent(_daPathElement2);
MainState->AddDialogAgent(_daPathElement3);
_daPathElement->InitializeAcquisition();
_daPathElement2->InitializeAcquisition();
_daPathElement3->InitializeAcquisition();
CATDialogTransition *pThirdTransition =AddTransition
(
MainState,
MainState,
IsOutputSetCondition(_daPathElement),
Action((ActionMethod) & pointCmd::GetpointCoordination)
) ;
CATDialogTransition *p4thTransition =AddTransition
(
MainState,
MainState,
IsOutputSetCondition(_daPathElement2),
Action((ActionMethod) & pointCmd::Action2)
) ;
CATDialogTransition *p5thTransition =AddTransition
(
MainState,
MainState,
IsOutputSetCondition(_daPathElement3),
Action((ActionMethod) & pointCmd::Action3)
) ;
}
改成了只有一个MainState,3个agnet,3个Transition。目的是要这个对话框接收3个输入:两个曲面,1个曲线。运行以后发现只能选第1个曲面和曲线,第2个曲面选择不了,在对话框中表示曲面选择的CATDlgEditor上点了也不行。对话框的定义和布局(见图3)如下:
//CAA2 WIZARD WIDGET DECLARATION SECTION
CATDlgLabel* _Label001;
CATDlgEditor* _Editor002;
CATDlgLabel* _Label002;
CATDlgEditor* _Editor004;
CATDlgLabel* _Label005;
CATDlgEditor* _Editor006;
//END CAA2 WIZARD WIDGET DECLARATION SECTION
请高手们继续指点,多谢了。 |