Could you help me? Dynamic Selection problem.


I make AIS_Shape(TopoDS_Shape& aShape) object and then, draw it using AIS_InteractiveContext method display()

in my case, I defind type which aShape is edge. So as you know, Edge is made of 2 Vertex and 1 line segment.

I want to make another edge which is shared Vertex on first edge.

I effort to select the vertex on first edge, But i can't

please help me and explain details.

Yeon Cheol

me_dulanga's picture

Hi Yeon

An edge can be a line, curve etc
First and the last points can be easily retrieved using the following code

TopoDS_Edge aCurrentEdge; // your edge

TopLoc_Location edgeloc;
Standard_Real First;Standard_Real Last;

Handle(Geom_Curve) myCurve = BRep_Tool::Curve( aCurrentEdge, edgeloc, First,Last );

GeomAdaptor_Curve adaptedCurve(myCurve);

gp_Pnt pnt1,pnt2;

adaptedCurve.D0(First, pnt1);
adaptedCurve.D0(Last, pnt2);

pnt1 will have the first point (first vertex)
pnt2 will have the last point (other vertex)

hope thats answers ur prob

shudolf's picture

Hi Dulanga

Thanks to apply!!! I Got it !!

Have a nice day