Save multiple class member of same type under one label

rye033

Looking around for some CAD
Hello all,
I am starting with opencascade and i need to save custom class to ocaf. My class has many data members of the same type. What is the correct way to persist these members. Should i create attribute with unique id for every member, or should I use sublabels? Thanks a lot
 

Quaoar

Administrator
Staff member
The design choice is up to you. Just a couple of tips here:

1. Custom attributes are usually much simpler to manipulate. A drawback here is that you'll have to provide your custom storage and retrieval logic, if you need any. At the same time, custom attributes would save you a little bit of memory.
2. By design, one label may contain only one attribute with a specific GUID. Therefore, you might want to create as many labels as there are objects of a specific type you're going to have. I.e., one root label for a type, then multiple sublabels for objects.
 

rye033

Looking around for some CAD
Thank you for explanation.
I am trying to create my own attribute and drivers. Is there some basic example on how to proceed? It seems a little confusing. For example which GUID is free? Or how to to extent OCAF drivers with my custom driver?
 

Quaoar

Administrator
Staff member

rye033

Looking around for some CAD
I am using code::blocks, but now i think I know how to go about this. I look into the link, and I am starting to understand the principle.
Thank you very much for the suggestions.
 
Top