Fri, 09/30/2016 - 07:14
I am successful in reading in a step file, however, the number of roots and shapes is always 1. What is the reason for only getting 1 root or 1 shape? Attached is my stp file.
Code:
STEPCAFControl_Reader aReader;
Handle(TopTools_HSequenceOfShape)aHSequenceOfShape = new TopTools_HSequenceOfShape();
Handle(TDocStd_Document) aDoc;
Handle(XCAFDoc_ShapeTool) shapeTool;
Handle(XCAFApp_Application)anApp = XCAFApp_Application::GetApplication();
anApp->NewDocument("MDTV-XCAF", aDoc);
VrmlData_Scene scene;
char* path = "mycami2.stp";
IFSelect_ReturnStatus status =aReader.ReadFile("../mycami2.stp");
if(status != IFSelect_RetDone)
{
printf("Step file could not be read");
return;
}
aReader.Transfer(aDoc);
shapeTool = XCAFDoc_DocumentTool::ShapeTool(aDoc->Main());
TDF_LabelSequence myShapes;
shapeTool->GetShapes(myShapes);
int lll = myShapes.Length(); // always shows up as one
Thank you,
-Jim
Mon, 10/03/2016 - 05:37
GetShapes will return high level shapes. for example a file that has a solid containing a shell, containing various faces, GetShapes will return 1, refering to the solid. This file does seem to have a single a solid.