DATAKIT API  V2025.3
DKOC_Body2OCCBRep Class Reference

Class DKOC_Body2OCCBRep This class allow the conversion from a Dtk_BodyPtr to a set of TopoDS_Shape based on linked version The links between the Dtk_Entity IDs and the TopoDS_Shape are given as a map It allows a unique definition of the TopoDS_Shape items (by a positive integer) And it gives access to the original ID in the Dtk_Body it is the ID of the Dtk_Info(therefore of the original CAD) More...

Public Member Functions

void _Init ()
 
void _Reset ()
 
Dtk_ErrorStatus ConvertBody (const Dtk_BodyPtr &inBody)
 Convert a Dtk_Body to set of TopoDS_Shape representing all topological entities. More...
 
 DKOC_Body2OCCBRep ()
 
int GetDtkID (const int inShapeID) const
 Get Dtk_ID from a ShapeID. More...
 
TopoDS_Shape GetMainShape () const
 Get the highest level TopoDS_Shape shape. More...
 
int GetMapSize ()
 Get Max ID of the map. More...
 
const TopoDS_Shape GetShapeFromShapeID (const int inID) const
 Get Shape from Map ID
More...
 
int GetShapeID (const TopoDS_Shape &inShape) const
 Get ID from Shape. More...
 
 SetAsDeprecated ("2025.3", "Use GetDtkID") int StartID(const int inID) const
 
 SetAsDeprecated ("2025.3", "Use GetMainShape") TopoDS_Shape RootShape() const
 
 SetAsDeprecated ("2025.3", "Use GetMapSize") int MaxID()
 
 SetAsDeprecated ("2025.3", "Use GetShapeFromShapeID") const TopoDS_Shape IDShape(const int inID) const
 
 SetAsDeprecated ("2025.3", "Use GetShapeID") int ShapeID(const TopoDS_Shape &inShape) const
 
 SetAsDeprecated ("2025.3", "Use SetConfigShapeFix") void SetShapeFix(const int inMode)
 
 SetAsDeprecated ("2025.3", "Use ShapeFromDtkID") TopoDS_Shape ShapeFromStartID(const int inDtkID) const
 
void SetConfigKeepPcurves (const Dtk_bool inMode)
 Option to keep existing pcurves or not (activated by default) More...
 
void SetConfigShapeFix (const Dtk_bool inMode)
 Option to activate ShapeFix or not (activated by default) More...
 
TopoDS_Shape ShapeFromDtkID (const int inDtkID) const
 Get Shape with inDtkID stored in Dtk_Entity->getinfo()->GetID() More...
 
 ~DKOC_Body2OCCBRep ()
 

Protected Attributes

Dtk_Handle * _Private
 

Detailed Description

Class DKOC_Body2OCCBRep This class allow the conversion from a Dtk_BodyPtr to a set of TopoDS_Shape based on linked version The links between the Dtk_Entity IDs and the TopoDS_Shape are given as a map It allows a unique definition of the TopoDS_Shape items (by a positive integer) And it gives access to the original ID in the Dtk_Body it is the ID of the Dtk_Info(therefore of the original CAD)

Constructor & Destructor Documentation

◆ DKOC_Body2OCCBRep()

DKOC_Body2OCCBRep::DKOC_Body2OCCBRep ( )

◆ ~DKOC_Body2OCCBRep()

DKOC_Body2OCCBRep::~DKOC_Body2OCCBRep ( )

Member Function Documentation

◆ _Init()

void DKOC_Body2OCCBRep::_Init ( )

◆ _Reset()

void DKOC_Body2OCCBRep::_Reset ( )

◆ ConvertBody()

Dtk_ErrorStatus DKOC_Body2OCCBRep::ConvertBody ( const Dtk_BodyPtr inBody)

Convert a Dtk_Body to set of TopoDS_Shape representing all topological entities.

Parameters
[in]inBody: Body to convert
Returns
dtkNoError if success

◆ GetDtkID()

int DKOC_Body2OCCBRep::GetDtkID ( const int  inShapeID) const

Get Dtk_ID from a ShapeID.

Parameters
[in]inShapeID: ShapeID
Returns
Dtk_ID

◆ GetMainShape()

TopoDS_Shape DKOC_Body2OCCBRep::GetMainShape ( ) const

Get the highest level TopoDS_Shape shape.

Returns
TopoDS_Shape for Body - If the body is closed TopoDS_Shape has type TopAbs_SOLID

◆ GetMapSize()

int DKOC_Body2OCCBRep::GetMapSize ( )

Get Max ID of the map.

Returns
MaxID

◆ GetShapeFromShapeID()

const TopoDS_Shape DKOC_Body2OCCBRep::GetShapeFromShapeID ( const int  inID) const

Get Shape from Map ID

Parameters
[in]inID: ShapeID
Returns
Shape with ID

◆ GetShapeID()

int DKOC_Body2OCCBRep::GetShapeID ( const TopoDS_Shape &  inShape) const

Get ID from Shape.

Parameters
[in]inShapeShape
Returns
Shape id in map if finded, 0 if not

◆ SetAsDeprecated() [1/7]

DKOC_Body2OCCBRep::SetAsDeprecated ( "2025.3"  ,
"Use GetDtkID  
) const

◆ SetAsDeprecated() [2/7]

DKOC_Body2OCCBRep::SetAsDeprecated ( "2025.3"  ,
"Use GetMainShape  
) const

◆ SetAsDeprecated() [3/7]

DKOC_Body2OCCBRep::SetAsDeprecated ( "2025.3"  ,
"Use GetMapSize  
)

◆ SetAsDeprecated() [4/7]

DKOC_Body2OCCBRep::SetAsDeprecated ( "2025.3"  ,
"Use GetShapeFromShapeID  
) const

◆ SetAsDeprecated() [5/7]

DKOC_Body2OCCBRep::SetAsDeprecated ( "2025.3"  ,
"Use GetShapeID  
) const &

◆ SetAsDeprecated() [6/7]

DKOC_Body2OCCBRep::SetAsDeprecated ( "2025.3"  ,
"Use SetConfigShapeFix  
) const

◆ SetAsDeprecated() [7/7]

DKOC_Body2OCCBRep::SetAsDeprecated ( "2025.3"  ,
"Use ShapeFromDtkID  
) const

◆ SetConfigKeepPcurves()

void DKOC_Body2OCCBRep::SetConfigKeepPcurves ( const Dtk_bool  inMode)

Option to keep existing pcurves or not (activated by default)

Remarks
If you ignore pcurves, you need to call SetConfigShapeFix(DTK_TRUE) to let occ compute them
Parameters
[in]inMode: DTK_FALSE to ignore pcurves, DTK_TRUE use existing pcurves

◆ SetConfigShapeFix()

void DKOC_Body2OCCBRep::SetConfigShapeFix ( const Dtk_bool  inMode)

Option to activate ShapeFix or not (activated by default)

Parameters
[in]inMode: DTK_FALSE to switch off ShapeFix, DTK_TRUE to switch on

◆ ShapeFromDtkID()

TopoDS_Shape DKOC_Body2OCCBRep::ShapeFromDtkID ( const int  inDtkID) const

Get Shape with inDtkID stored in Dtk_Entity->getinfo()->GetID()

Parameters
[in]inDtkIDto find
Returns
Shape with inDtkID

Field Documentation

◆ _Private

Dtk_Handle* DKOC_Body2OCCBRep::_Private
protected