iCAx开思工具箱
标题:
CAA中怎么过滤鼠标选择的对象
[打印本页]
作者:
liuruixiao205
时间:
2006-1-17 17:35
标题:
CAA中怎么过滤鼠标选择的对象
我的一个命令要同时用到面的某边线和面,我做了一个Agent.
ElementAgent->SetOrderedElementType("CATIMfMonoDimResult");
ElementAgent->AddOrderedElementType("CATCurve");
ElementAgent->AddOrderedElementType("CATLine");
ElementAgent->AddOrderedElementType("CATIMfBiDimResult");
ElementAgent->AddOrderedElementType("CATSurface");
ElementAgent->AddOrderedElementType("CATFace");
ElementAgent->SetBehavior ( CATDlgEngWithPrevaluation | CATDlgEngWithCSO | CATDlgEngOneShot );
ElementAgent->SetAgentBehavior ( MfPermanentBody | MfLastFeatureSupport | MfRelimitedFeaturization );
可是每次选择得到的都是edge。请问如何让它第一次得到线第二次得到面呢?
作者:
acoka
时间:
2006-1-17 23:02
通常catia的command会做2个agent, 选的东西也会写入panel的2个selectorlist里
严格来说还应该用multi-state,选好第一个对象后state应该自动迁移到第2个去选面
点击穿panel的不同的selectorlist的时候,也应该实现state的迁移和highlight的变化
作者:
bright1206
时间:
2006-1-18 16:02
呵呵,我的做法跟acoka兄一样啊
作者:
liuruixiao205
时间:
2006-1-18 17:31
谢谢两位,我看了看,可以知道什么时候点击panel的不同的selectorlist,但我没找到state转移的接口,两位大哥能说的具体一点吗,把那几句程序贴一下就好:)。
作者:
bright1206
时间:
2006-1-19 11:50
// Axis selection state
CATDialogState *WaitForAxisState= GetInitialPanelState("Select a Axis or another input field");
WaitForAxisState -> AddDialogAgent ( _pAxisAgent );
WaitForAxisState -> AddDialogAgent ( _pFaceFieldAgent );
WaitForAxisState -> AddDialogAgent ( _pAxisFieldAgent );
// Face selection state
CATDialogState *WaitForFaceState= AddPanelState("Select a Face or another input field");
WaitForFaceState -> AddDialogAgent ( _pFaceAgent );
WaitForFaceState -> AddDialogAgent ( _pAxisFieldAgent );
WaitForFaceState -> AddDialogAgent ( _pFaceFieldAgent );
作者:
flyerfang
时间:
2006-1-19 13:40
那_pFaceFieldAgent 和 _pFaceFieldAgent 是如何设置的?field 多谢
作者:
liuruixiao205
时间:
2006-1-19 15:14
看了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));
作者:
liuruixiao205
时间:
2006-1-19 17:59
名字是edge,可是能作为面用,搞不懂了
欢迎光临 iCAx开思工具箱 (https://t.icax.org/)
Powered by Discuz! X3.3