I notice that with Qt Opencascade you can select Shapes. I have been trying to change it by adding filters so it will only select Faces or Edges when set to the correct mode, but so far I have had no luck at getting it to select anything but whole solid shapes. My current attempt have been trying to follow the examples given in Visualization tutorial (around page 42). Here is a piece of it for a plane:
Handle(StdSelect_FaceFilter) Fil2= new StdSelect_FaceFilter(StdSelect_Plane);
myContext->AddFilter(Fil2);
So any help with selection or selecting in different modes would be very helpful. Thanks.
Discussion
3 archived replies
Posts are displayed in their archived order.
01Commenter-1
Hi Robert,
try this:
void SelectTool::setLocalContext(TopAbs_ShapeEnum which)
{
if (stWs->activeWindow())
{
Handle(AIS_InteractiveContext) ctx =
((MDIWindow*)stWs->activeWindow())->getDocument()->getCo
ntext();
if (ctx)
{
ctx->CloseAllContexts();
if (which != TopAbs_SHAPE)
{
ctx->OpenLocalContext();
ctx->ActivateStandardMode(which);
}
}
}
}
02Author
I'm sorry, can I get some explanation behind your code, I'm a little lost.