I'm trying to visualize a BSpline I've generated using OCCT.
My code is:
/// Displaying OCCT BSpline
Standard_Integer num_coordinates = 97; // Number of coordinates
Hydrofoil f(fileName, num_coordinates, 5, CLOCKWISE_LE);
TopoDS_Edge bspline = BRepBuilderAPI_MakeEdge(f.getCurve());
Handle(AIS_Shape) anEdge = new AIS_Shape(bspline);
const TCollection_AsciiString displayName("m:0.0");
Standard_ExtString dname= 0;
const Handle(Aspect_DisplayConnection) aDisplayConnection = new Aspect_DisplayConnection();
Handle(Graphic3d_GraphicDriver) driver3d = new OpenGl_GraphicDriver(aDisplayConnection);
Handle(V3d_Viewer) viewer; // = new V3d_Viewer(driver3d, dname);
// Create V3dViewer and V3d_View
viewer = new V3d_Viewer(driver3d, (short* const)"viewer");
view = viewer->CreateView();
// Create AISInteractiveContext
Handle(AIS_InteractiveContext) aContext = new AIS_InteractiveContext(viewer);
aContext = new AIS_InteractiveContext(viewer);
// Set up lights etc
// view->TriedronDisplay(Aspect_TOTP_LEFT_LOWER, Quantity_NOC_GOLD, 0.08, V3d_ZBUFFER);
// Handle(V3d_Viewer) aViewer = ...;
aContext -> Display(anEdge);
//Display the presentable object in the 3d viewer.
This does not create a window or widget to display. Could anybody kindly provide sample code which'll help me build a simple visualiser for the geometries I build. It should allow for viewing in different planes and rotation. Your help would be much appreciated.