用了RequestDelayedDestruction()了,还是不行。
命令的基类是CATStateCommand,BuildGraph()里面没有设好到NULL的transition,不知道该怎么写,请acoka指教。我的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 CATPathElementAgen("GetSurface");
_daPathElement3->AddElementType("CATCurve");
_daPathElement->SetBehavior(CATDlgEngWithPSOHSO |
CATDlgEngWithPrevaluation);
_daPathElement2->SetBehavior(CATDlgEngWithPSOHSO |
CATDlgEngWithPrevaluation);
_daPathElement3->SetBehavior(CATDlgEngWithPSOHSO |
CATDlgEngWithPrevaluation);
CATDialogState *stStartState = GetInitialState("stPointId");
CATDialogState *stSecondState =AddDialogState("stSecondPointId");
CATDialogState *stThirdState =AddDialogState("stThirdPointId");
stStartState->AddDialogAgent(_daPathElement);
stSecondState->AddDialogAgent(_daPathElement2);
stThirdState->AddDialogAgent(_daPathElement3);
_daPathElement->InitializeAcquisition();
_daPathElement2->InitializeAcquisition();
_daPathElement3->InitializeAcquisition();
CATDialogTransition *pThirdTransition =AddTransition
(
stStartState,
stSecondState,
IsOutputSetCondition(_daPathElement),
Action((ActionMethod) & pointCmd::GetpointCoordination)
) ;
CATDialogTransition *p4thTransition =AddTransition
(
stSecondState,
stThirdState,
IsOutputSetCondition(_daPathElement2),
Action((ActionMethod) & pointCmd::Action2)
) ;
CATDialogTransition *p5thTransition =AddTransition
(
stThirdState,
stThirdState,
IsOutputSetCondition(_daPathElement3),
Action((ActionMethod) & pointCmd::Action3)
) ;
}
CATDialogTransition *p5thTransition =AddTransition
(
stThirdState,
stThirdState,
IsOutputSetCondition(_daPathElement3),
Action((ActionMethod) & pointCmd::Action3)
) ;
}
请问下来应该怎样写才能达到我的要求? |