Fri, 05/14/2004 - 16:46
Forums:
Handle (TDocStd_Document) doc = new TDocStd_Document("qwe");
TopoDS_Solid box= BRepPrimAPI_MakeBox(10, 10, 40);
TDF_Label aLabel = STool->AddShape(box, true);
TCollection_ExtendedString aName = "JustBox";
TDataStd_Name::Set(aLabel, aName);
TopoDS_Solid box2= BRepPrimAPI_MakeBox(120, 10, 40);
TDF_Label aLabel2 = STool->AddSubShape(aLabel, box2); //return NULL, why?
TCollection_ExtendedString aName2 = "JustSubBox";
TDataStd_Name::Set(aLabel2, aName2);
So I was unable to add sub shape, could somebody suggest how to do it in right way?
Fri, 05/14/2004 - 16:53
Hi,
I think STool should be the XDE ShapeTool? If so you tried adding a TopoDS_Solid as a child of another TopoDS_Solid? I think you should use TopoDS_Compounds for building SubShapes!
HTH,
Patrik
Fri, 05/14/2004 - 17:00
Thank you for answer,
>I think STool should be the XDE ShapeTool?
yes:
Handle (XCAFDoc_ShapeTool) STool = XCAFDoc_DocumentTool::ShapeTool (doc->Main());
>If so you tried adding a TopoDS_Solid as a child of another TopoDS_Solid?
yes
>I think you should use TopoDS_Compounds for building SubShapes!
but how to do it? (if there is any example?)
Mon, 05/17/2004 - 14:37
Hi Peter,
there are some simple examples in the XDE pdf.
HTH,
Patrik