For all issues regarding the Forums use, please, refer to the Forum Rules.

Our Solutions

Need professional assistance?
Consider our:

Support Offerings


Need to speed up your development?
Have a look at our:

Samples & Tools


Need some functionality extending standard OCCT capabilities?
Check out our:

Adv. Components

Related pages

XCAFDoc_ShapeTool NewShape does not generate a random tag

Mimosa Olive's picture

When adding a shape to the XCAFDoc_ShapeTool using NewShape, the newly created label has a Tag of 0. How can I have a generated tag for this label? Or is there another way to identify this label, so I can retrieve it later? (say the shapes name are populating a tree view, normally I need to store some identification feature, like a unique integer, so when the user click on an item in the tree, I can retrieve the shape by knowing the tag that I would store in the tree item as a simple integer).

Mimosa Olive's picture

Got it, added that TDF_TagSource::NewChild line:

TDF_Label aLabel = myAssembly->NewShape();

now the aLabel.Tag(); has a unique integer.