Is there any way to add an Id Field to TopoDS_Shape?

Dear all, we need an Id member for TopoDS_Shape, which is unique. We try to add a member varble in the sourcecode of TopoDS_Shape.hxx, by using WOK. But after compiling, the .exe is crashed while running.

Is that possible to do such modification in OCC package?

Thanks in advance.

Forum supervisor's picture

Dear dukeyan,
If you are using WOK you should add your modifications in corresponding *.cdl file (TopoDS_Shape.cdl). See corresponding guide 'CDL (Component Description Language)
User’s Guide".
At the same time you may consider the alternative way of shape binding with an unique ID,
i.e. using OCCT OCAF component which uses reference key-driven approach. See for details
"Application Framework White Paper" and "Application Framework User’s Guide".

dukeyan's picture

Dear supervisor, thanks for your reply.

we use C# to build the software framework and using C++ wrapper of OCC objects, so we haven't consider to use OCAF yet, because we thought it's MFC based. Is that possible to use OCAF component for id-binding while not depending on OCAF frame?

And we will try to modify *.cdl to generate modified files.

Thanks & regards.

Forum supervisor's picture

Dear dukeyan,
Probably you are referring to standard samples based on MFC.
OCAF component does't depend on MFC by definition. It is pure C++ library.
MFC in the sample is used only as GUI framework. You can choose any GUI framework
which is compatible with C++ libs.