How to display an EDGE or a BSPLINE_CURVE in the current viewer


I've obtained a Bspline_Curve and I want to display it. How can I do for displaying it in the current screen.


Kreshnik's picture

Here my code :

// Création d'une BSplineCurve a partir du tableau de points
GeomAPI_PointsToBSpline GeomAPI = GeomAPI_PointsToBSpline(col_array);
Handle(Geom_BSplineCurve) bsCurve = GeomAPI.Curve();

// Construction de la topologie
TopoDS_Edge myEdge = BRepBuilderAPI_MakeEdge(bsCurve);

francisco castillo's picture

You need a Handle to an AIS_InteractiveContext let's call it myContext:

GeomAPI_PointsToBSpline PTBS = GeomAPI_PointsToBSpline(Points);
Handle(Geom_BSplineCurve) SPL1 = PTBS.Curve();
TopoDS_Edge aEdge = BRepBuilderAPI_MakeEdge( SPL1 );
myContext->Display(new AIS_Shape( aEdge ));