
Sun, 03/27/2022 - 11:42
Hello OCCT Community,
I've used "Selection Mode" with my AIS_InteractiveContext and when I assign "TopAbs_FACE" to the SelectionMode method (it can be seen below code block and the image of TopAbs_FACE), I am able to acquire the faces of my mesh object:
ais_interactive_context_->Display (XCAF_Prs_AIS_object_, AIS_Shaded, 0, true);
ais_interactive_context_->Activate(ais_shape, ais_shape->SelectionMode( TopAbs_FACE));
Similarly, when I assign "TopAbs_EDGE" to the "SelectionMode" method (it can be also seen below code block and the image of TopAbs_EDGE), I could acquire the edges of my mesh:
object.ais_interactive_context_->Display (XCAF_Prs_AIS_object_, AIS_Shaded, 0, true);
ais_interactive_context_->Activate(ais_shape, ais_shape->SelectionMode( TopAbs_EDGE));
However, I am not able to using them (i.e. TopAbs_EDGE & TopAbs_FACE altogether) into the "SelectionMode" method. How can I handle this issue? My intention is that when navigating with the mouse, the edges are selectable if I'm on the edges, and the surfaces are selectable if I'm on the surface.
Thank you in advance!
Sun, 03/27/2022 - 19:35
Selection mode passed to AIS_InteractiveContext::Activate() is a single mode, not a bitmask. To activate multiple modes at once you need calling the method multiple times.
If you would like activating only single mode at a time, you need deactivating previously activated modes or to use AIS_SelectionModesConcurrency_Single for AIS_InteractiveContext::SetSelectionModeActive().
Not every combination of selection modes would work as expected.
Mon, 03/28/2022 - 10:27
You can create a global SELECTION_MODE variable. You can update this global variable with the toolbar or the button you want to add wherever you want. You can activate the selection mode of the objects displayed after each update with the signal-slot relationship.
Example:
Sat, 07/29/2023 - 18:13
Did you solve this problem?
Mon, 07/31/2023 - 15:25
Hello Tim,
Yes, I had solve this problem thanks to Kirill's advice:
Regards,
Nezihe