How to make 2d text selectable in 3d viewer

I refered example of of OCC and used ISession_Text.h/cpp classes directly into my code. Its showing the text but i couldnt able to select it.
If i zoomin/zoomout the view its size will not change..

I want to select this text, and do drag operation on it.

Pls give some suggetions...

Thank u

Venugopal Gudimetla's picture

Hi Nitin,

I am not 100% sure but did you try overloading ComputeSelection(const Handle(SelectMgr_Selection)& aSelection,const Standard_Integer aMode) function?

see AIS_Axis.cxx for example, I defined my own axis after deriving my class from AIS_Axis. I was unable to select the axis till I overloaded ComputeSelection function.


nitinmsrit's picture

Hi Venu,

I tried to overload ComputeSelection method. In that StdSelect_BRepSelectionTool::Load(...) method needs TopoDS_Shape object, My Isession_Text class is derived from AIS_InteractiveObject not from TopoDS_Shape.

Can you pls suggest me how can i overload that method, Currently that method is blank in my code.

- Nitin

Venugopal Gudimetla's picture

Hi Nitin,

I myself didn't implement selectable text though I am able to draw text. Pl take a look at this thread, not sure if you already have seen this. If you get it to work, please let me know.