
Tue, 02/18/2025 - 03:02
Forums:
Using AIS_InteractiveContext & V3d_View, i would like to be able to do 2 types of box selection (right/left): one includes all elements touching the selection square, and the other selects whats completely insde the selection square. On top of it, i would love to have feedback (highligt/detection) over this box movement to help the user understand what is he selecting.
Is there an already implemented way of doing so? Else i will very much appreciate some pointers on how to be able to develop this.
Tue, 02/18/2025 - 10:11
There is a property
SelectMgr_ViewerSelector::AllowOverlapDetection()
that switched between these two modes.AIS_ViewController
setup this flag based on the rubberband rectangle direction - from left to right or from right to left. There is no visual feedback indicating within mode is active, though.Wed, 02/19/2025 - 00:27
Great info thanks!
I tried this (based on the CSharp_D3D project and your reccommendation):
To kindof simulate a box MoveTo behaviour to hilight items while im dragging the selection box, but it does not hilight or select anything... i guess i am missing something plus i am unsure if pick will work as hilight or select (apparently none).
How could i achieve the effect i am describing?
Wed, 02/19/2025 - 09:40
Highlighting is handled by
AIS_InteractiveContext
, notSelectMgr_ViewerSelector
. You need to call something likeAIS_InteractiveContext::SelectRectangle()
instead ofSelectMgr_ViewerSelector::Pick()
(AIS_InteractiveContext
will callPick()
internally).Wed, 02/19/2025 - 13:16
Oh, i see now! Thanks!
As a clarification, i want to do Highlight of the detected elements, not drawing the box (that i do with a 2d canvas rectangle), attach a vid example of this behaviour done in SpaceClaim.
Checking the code of AIS_InteractiveContext for MoveTo i came with this:
But seeing how moveTo works, i see that AIS_InteractiveContext is only prepared to have one picked element at a time and not several, right?
I will try to extend it to be able to handle several picked elements (and probably secondary selection).
As well, how to display c++ code in this forum? [CODE] dont show c++
And one more question, is there a way to display hidden lines (surface edges without depth test) in picking(highlight) and selection?