Recovering key co-ordinate info from user selected objects

Hi all,

A simple trimmed line object 1.]created as a topological edge using BRepBuilderAPI_MakeEdge
2.] next it is used to create an AIS object using Handle(AIS_Shape)
3.]finally it is displayed in the viewer using myAISContext->Display().

Now, when the user selects the line object with the mouse, I would like to obtain the end co-ordinates of the line.

Although this is a simple example, I need to be able to apply the philosophy to general CAD entities. Can someone please help me out on this.

Using AIS_InteractiveContext::SelectedShape it returns a TopoDS_Shape object, I have not been able to extract information from the object.

And using GeomLProp_CLProps, it's possible to extract all required information, however I can do this only within the scope of the function in which the geometric object was created, that is, I cannot use this function with an object selected by the mouse pointer. I seem to be missing how to do it, could somone please guide me on this.


angel's picture

Maybe you can use the way as following,
TopoDS_Edge aEdge=TopoDS::Edge(object);
Standard_Real First,Last;
gp_Pnt StPnt,EndPnt;
Handle(Geom_Curve) aCurve=BRep_Tool::Curve(aEdge,First,Last);

Good Luck