Hello all,
I've just started trying to learn Open Cascade, so I'm completely new to OC and solid modeling for that matter. I'm also learning QT at the same time.
I have a very simple example that just diplays a 3D cube, but am wondering how to implement selection. I have the following 3 objects set up:
Handle(AIS_InteractiveContext) myContext;
Handle(V3d_Viewer) myViewer;
Handle(V3d_View) myView;
I set up the interactive context with:
myContext = new AIS_InteractiveContext(myViewer);
I build a box with:
TopoDS_Shape theBox = BRepPrimAPI_MakeBox (10, 10, 10);
and create an AIS_Shape with:
Handle(AIS_Shape) AISshape = new AIS_Shape(aShape);
I have no problem displaying the box with:
myContext->SetMaterial(AISshape, Graphic3d_NOM_GOLD);
myContext->SetDisplayMode(AISshape, 1, Standard_False);
myContext->Display(AISshape, Standard_False);
myContext->SetCurrentObject(AISshape, Standard_False);
myView->FitAll();
myView->ZFitAll();
myView->Redraw();
but I want to make it selectable, so before the FitAll function I try to load the shape into the interactive context with:
myContext->Load(AISshape, 1, Standard_True);
When I do this, it crashes.
I was wondering if someone could give me a hint how to get started with selection. I read the visulaization guide, and it mentions loading the interactive object into the interactive context, but I'm having trouble getting a simple example working. I think I'm not understanding what it is trying to tell me :)
On another topic, I was wondering if there would be interest in generating a number of very simple examples that demonstrate one concept at a time? I would be willing to help with this. I can build the tutorial example in QT, but I must admit I'm having trouble understanding everything that is going on. The makebottle tutorial and associated function is great, but of course it depends on lots of QT specific stuff, and the Visulaization components. I find it a little bit overwhelming....too much for my little brain to process at one time :)
The OC libraries seem to be excellent, and I'm not surprised that there is a lot to learn.
Thanks in advance for any help,
Garrett.