Shape labels using non-Ocaf document

Hi,

I am developing a program which has been extended from the Open CASCADE 3dViewer sample, I am currently trying to get the labels that are attached to the shapes from an imported STEP file but having some trouble as the 3dViewer is not an OCAF document as far as I know and I can't easily change the structure as it is being used by other functions of the program.

I know I have to use XDE and have started with the following code:

Handle(TDocStd_Document) doc;
Handle(XCAFDoc_ShapeTool) myAssembly = XCAFDoc_DocumentTool::ShapeTool(doc->Main());
TDF_Label aLabel = myAssembly->NewShape();
TDF_LabelSequence frshapes;
myAssembly->GetShapes(frshapes);

I have already set up the import of a STEP file and converted it to a BREP to display in the 3dViewer, basically what I now want to do is output a list of the shapes that are in the STEP file.

Has anyone done this before, have any ideas that could point me in the right direction?

Thanks,

Neil

Jerome Robert's picture

See STEPControl_Reader.getLabel(TopoDS_Shape) line 96:
https://github.com/jeromerobert/jCAE/blob/master/occjava/src/XSControl.i

Jerome

Neil Martin's picture

That looks like it might be useful thanks.

Is it Java based, just wondering as I'm using visual c++ so will have to try and convert it if it is?