Thu, 04/21/2022 - 16:04
Forums:
I made a selection owner inherited from SelectMgr_EntityOwner.
In its HandleMouseClick() I would like to get the selected AIS_Shape.
However, the selection owner returns only mySelectable which is a SelectMgr_SelectableObject, so how do I get the AIS_Shape?
Thu, 04/21/2022 - 17:24
AIS_Shape is a subclass of SelectMgr_SelectableObject. You need to perform DownCast'ing or dynamic_cast<> to get AIS_Shape.
Fri, 04/22/2022 - 09:10
the downcast returns a null pointer. What would be the reason for it?
Fri, 04/22/2022 - 11:09
Then you are working with the owner of another interactive object. That's the only idea I have.
Sun, 04/24/2022 - 10:54
Yes, I guess that maybe the problem, how do you put SelectMgr_EntityOwner on AIS_InteractiveObject without having to use a copy of the TopoDS_Shape that you create in Compute()?
This is what I have right now, _InnerObject is a TopoDS_Shape that is copied from within Compute() before StdPrs_ShadedShape::Add(thePrs, m_walls1, myDrawer).
Fri, 04/22/2022 - 12:58
The selectable of Owner will be of type MyAIS_InteractiveObject in your case.
Sun, 04/24/2022 - 11:04
Yes, what you said makes sense. the code I wrote is rubbish, now I just inherent from AIS_Shape to save all the pain.