DiscussionsIssue archiveData Exchange and Application Framework

Archived discussion

XCAFApp_Application with an existing document

Data Exchange and Application FrameworkFri, 12/08/2017 - 22:261 reply

Browse this forum
QuestionAuthor

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...?); ??

Discussion

1 archived reply

Posts are displayed in their archived order.

01Commenter-1

I got it:

anApp->GetDocument(1,aDoc);