Retrive TopoDS & Geom from an unique ID

HELLO;

if I'don't whirlwind. OCC doesn't put some ID on their entities "TopoDS & Geom" like for example STEP, ACIS...etc (#100# advanced_face...)

my Question is how to set an ID(name or integer refere to Entitees Topology & Geometry) in the first time, and to send this ID to OCC in the second time, and finally get him, to retrive the shape and Geometry OCC.

ANY IDEA MAY BE VERY HAPPY. please Help
THINK YOU

DeleDivaneeh's picture

In OpenCascade, there are classes which enables the user to set an ID to the shapes,return the shapes from this ID and etc.

There are some useful classes like that:

TopTools_DataMapOfShapeInteger
TopTools_DataMapOfIntegerShape
TopTools_DataMapIteratorOfDataMapOfShapeInteger
TopTools_DataMapIteratorOfDataMapOfIntegerShape

Take it easy..

stifan's picture

Think your replay:

can you give me an example how to set ID to TopoDS_Face for example (explorer from a shape ):
//****like this:
when i open OCC_File ("file.brep"), i'explore all the face from shape, now how to set ID for accurrent face and retrive him from this ID.

Think you

DeleDivaneeh's picture

In TopTools_DataMapOfIntegerShape class,there is :

Standard_EXPORT Standard_Boolean Bind (const Standard_Integer &K, const TopoDS_Shape &I) method that you can set an ID for a TopoDS_Shape class and all his derivatives.You can set ID for a face too.

Standard_EXPORT const TopoDS_Shape & Find (const Standard_Integer &K) const method that you can get the shape,face,edge or vertex by its ID.const Standard_Integer &K is the ID.

In TopTools_DataMapOfShapeInteger class,there is also :

Standard_EXPORT Standard_Boolean Bind (const TopoDS_Shape &K, const Standard_Integer &I) method that you can set an ID for a TopoDS_Shape class and all its derivatives.

Standard_EXPORT const Standard_Integer & Find (const TopoDS_Shape &K) const method that you can get the ID of the shape,face,edge or vertex.

stifan's picture

hello;

think you for your replay
how can i set id to OCC_Geom " like Geom_Curve or Geom_Surface" and retrive him from id

think you