
Fri, 12/08/2017 - 22:26
I found example to create document and add shapes structure to it:
Handle(XCAFApp_Application) anApp = wxGetApp().GetOCCApp();
Handle(TDocStd_Document) aDoc;
anApp->NewDocument ("XmlXCAF", aDoc);
Handle (XCAFDoc_ShapeTool) myAssembly = XCAFDoc_DocumentTool::ShapeTool(aDoc->Main());
TDF_Label aLabel = myAssembly->NewShape();
myAssembly->SetShape(aLabel,aBottle);
... and so on
now in a different class (say a tree-view class), how do I retrieve the handle to this document?
Handle(XCAFApp_Application) anApp = wxGetApp().GetOCCApp();
Handle(TDocStd_Document) aDoc;
anApp->GetDocument (...aDoc...?); ??
Sat, 12/09/2017 - 00:02
I got it:
anApp->GetDocument(1,aDoc);