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

How to add user defined data?

°×ÏþÁÁ(Bai Xiaoliang)'s picture
Forums: 

Hi,
I want to add user defined data to OCC Shapes, i.e. TopoDS_Vertex, TopoDS_Edge, TopoDS_Face, TopoDS_Solid, et, al. But I don't known how to do it without change definition of corresponding classes. It sames OCC provided the mechanism for user defined datas. Could anyone give me some advice for how to do it.

Regard

白晓亮(Bai Xiaoliang)
2005.8.21

°×ÏþÁÁ(Bai Xiaoliang)'s picture

Hi,
No answers! Is it impossible?

Regard

°×ÏþÁÁ(Bai Xiaoliang)

QbProg's picture

I think that you should derive your TopoDS_ classes, ... but I don't know how :)

Bearloga's picture

Hi,
Why don't you associate a data with shapes using some container, like data map?
I think it is the most feasible way.
Cordially

°×ÏþÁÁ(Bai Xiaoliang)'s picture

Hi,
Thanks, It is a useful tip. But How?

Could instance of TopoDS_Vertex, TopoDS_Edge...... be treated as intelligent pointers, and be used as keys of a map. In other words, Is TopoDS_XXX only maintain an pointer of topo and geo data?

Regards

°×ÏþÁÁ(Bai Xiaoliang)

Bearloga's picture

See the package TopTools, it contains the typical instantiations of the generic class TCollection_DataMap. You can instantiate your own class from the template NCollection_DataMap. Two mandatory global functions must be accesible are HashCode and IsEqual, you can define them inline using the methods of TopoDS_Shape.

°×ÏþÁÁ(Bai Xiaoliang)'s picture

Hi,
Thanks.

°×ÏþÁÁ(Bai Xiaoliang)

Contact us

Attention: DO NOT use this form for all kind of request for the removal of your personal data. Please follow this link for such cases.