Using OCAF as part of a bigger Application

I am working on an application of which one part is CAD modeling. For this part I need to use OCAF to make use of function driver mechanism, saving Topological objects, undo/redo etc.
When I save my application, OCAF application part will save the data within its data tree. What about the data that is not related to OCAF? Do I implement saving them through the overall application? In that case do I end up with two files on disk (one of overall doc and one for OCAF doc) when I save a case? I don't think it makes any sense to integrate all the data (which has nothing to do with CAD model) in to OCAF tree.
Thanks for the input.

Sharjith Naramparambath's picture

How will it work when you open the document back? Your code will have to identify the corresponding partial (non-cad data) file and load it too. In fact, it doesn't make sense to fragment data in this way. Saving the entire thing in one document file will be the best option.

I don't know what application you are writing, but if your application has something that has to do some operation on the cad model, like FEM/FEA, then it makes sense to have a different workbench and document format for that part of the application and save it independently with embedded links to the cad document.

Chanaka Mallikarachchi's picture

I am not sure how it will work when I open the document. But according to what you are saying the standard way is to put all the data in to OCAF tree, whether they are related to the CAD modeling part or not.

Forum supervisor's picture

Dear Chanaka,
OCCT persistence mechanism is enough flexible and allows you both, to use the standard approach, as wel as to define your own approach based on OCAF or without it. Application data may be put in one single document, as well as in a set of linked documents managed by the main document.
Regards