I'm using the XDE framework in OpenCascade 6.6.0 to create STEP files for some 3D models. In particular, I would like to create a hierarchy of labels corresponding to the logical organization of the system (e.g. grouping some parts into components, which are then grouped together by type, which are then part of the whole system). At each level, I would like to save the id of the part, and its color.
I'm having this problem with the AddComponent method of the XCAFDoc_DocumentTool::ShapeTool. Basically, I've tried several methods to create this hierarchy, but it all boils down to one problem: when I use AddComponent to add labels that correspond to assemblies, their name and of everything under them changes and cannot be changed back.
I've tried the method suggested by user Pawel here: http://www.opencascade.org/org/forum/thread_18813/?forum=3 to build everything bottom-up. Once I use AddComponent on an assembly label, the names got lost.
I've tried a top-down approach, by creating a compound of compounds of solids describing my system, adding the shape to the top level, and then finding the labels associated with each shape; tried to change the name of these labels, and nothing happened (I've used ShapeTool::UpdateAssembly).
I've also tried to build the whole document by going top-down, adding compounds/solids and creating labels for them at every level. Still same, once I add a compound, names are lost.
Basically, every time I use AddComponent to add a compound/assembly, the label names change and they cannot be changed to something else. The colors can be changed at will, but not the label names.
Is this how it's supposed to work, or is there a problem? I've seen some posts related to this behavior on the forums, but there was no definitive answer. Or, is it possible that there is something special that needs to be done when dealing with compounds? It seems strange though that names are lost like that and cannot be changed.