DATAKIT API  V2025.1
Dtk_Body Class Reference

A Dtk_Body Dtk_Body is the highest level topological entity. It allow you to handle manifold and non-manifold object , open skin or surfacic model and wire entities. More...

+ Inheritance diagram for Dtk_Body:

Public Member Functions

Dtk_ErrorStatus _Store (void *)
 
Dtk_ErrorStatus AddLump (const Dtk_LumpPtr &inLump)
 
Dtk_ErrorStatus AddOpenShell (const Dtk_ShellPtr &inShell)
 Add Open Shell in first volume of first lump (created if none) More...
 
Dtk_ErrorStatus AddOpenShell2 (const Dtk_ShellPtr &inShell, Dtk_VolumePtr &volume)
 
Dtk_ID AddPtr (const Dtk_TopologicalEntityPtr &outEntityPtr)
 
void AddStream (Dtk_StreamPtr inStream)
 
Dtk_ErrorStatus AddUnboundedFace (Dtk_SurfacePtr inSurface)
 Add Open Shell with a one Unbounded Surface. More...
 
Dtk_ErrorStatus AddWireShell (const Dtk_ShellPtr &inShell)
 Add Wire Shell. More...
 
Dtk_ErrorStatus ComputeBoundingBox (Dtk_pnt &outMin, Dtk_pnt &outMax)
 
 Dtk_Body ()
 
int DtkDynamicType (const int &inId)
 
virtual void dump (FILE *file=stdout)
 
Dtk_ErrorStatus ExtractEdgeBody (Dtk_BodyPtr &outEdgeBody)
 
Dtk_InfoPtr get_info () const
 
enum type_detk get_type_detk () const
 
Dtk_ErrorStatus GetBodyStatus () const
 
Dtk_ErrorStatus GetEntities (const Dtk_ID &inInfoId, Dtk_tab< Dtk_EntityPtr > &outTab) const
 Get entities with Info->GetId() == inInfoId. More...
 
Dtk_EntityPtr GetEntity (const Dtk_ID &inInfoId) const
 Get entity with Info->GetId() == inInfoId. More...
 
const Dtk_IDGetID () const
 Get Internal UniqueID. More...
 
Dtk_ErrorStatus GetLump (const Dtk_Size_t &inIndex, Dtk_ID &outLumpId) const
 
Dtk_ErrorStatus GetLump (const Dtk_Size_t &inIndex, Dtk_LumpPtr &outLump) const
 
Dtk_Size_t GetNumLumps () const
 
Dtk_Size_t GetNumOpenShells () const
 Return Number of Open Shell. More...
 
Dtk_Size_t GetNumStream () const
 
Dtk_Size_t GetNumTopologicalEntities (type_detk inType)
 Get Num entities. More...
 
Dtk_ErrorStatus GetOpenShell (Dtk_Size_t inIndex, Dtk_ShellPtr &outShell) const
 Return Open Shell
More...
 
Dtk_TopologicalEntityPtr GetPtr (const Dtk_ID &inId) const
 
virtual Dtk_Size_t GetSize () const
 
Dtk_StreamPtr GetStream (Dtk_Size_t inStreamIndex) const
 
Dtk_ErrorStatus GetTolerance (Dtk_Double64 &outTolerance)
 Get Tolerance. More...
 
Dtk_ErrorStatus GetTopologyStatus () const
 
Dtk_ErrorStatus GetVertexBound (Dtk_pnt &pmin, Dtk_pnt &pmax)
 
Dtk_ErrorStatus GetVertexGravity (Dtk_pnt &pcenter)
 
int GetWireCurves (Dtk_tab< Dtk_CurvePtr > &curves)
 
int GetWireEntities (Dtk_tab< Dtk_CurvePtr > &curves, Dtk_tab< Dtk_PointPtr > &points)
 
Dtk_bool HasFaces ()
 Returns DTK_TRUE if Body contains faces with surfaces. More...
 
Dtk_bool HasMeshSurface ()
 Returns DTK_TRUE if Body contains mesh surfaces. More...
 
Dtk_bool HasPeriodicSurface ()
 Returns DTK_TRUE if Body contains periodic surfaces. More...
 
Dtk_bool HasWire ()
 Returns DTK_TRUE if Body contains wireframe. More...
 
Dtk_InfoPtrinfo ()
 
Dtk_bool LimitInfinitEntities (Dtk_Double64 lenFoundMin, Dtk_Double64 lenNew=1.0)
 
Dtk_ErrorStatus MergeVertices (Dtk_VertexPtr inVertexToKeep, Dtk_VertexPtr inVertexToRemove)
 Removes all references to inVertexToRemove and replace it by inVertexToKeep. More...
 
Dtk_ErrorStatus Normalize (Dtk_bool updateEdgeGeometry=DTK_TRUE)
 
virtual void PrepareTransfo ()
 
Dtk_ErrorStatus RevolToStandardRevol ()
 
 SetAsDeprecated ("2022.1", "GetTolerance(Dtk_Double64 &outTolerance) method instead.") Dtk_Double64 GetTolerance()
 Get Tolerance. More...
 
 SetAsDeprecated ("2025.1", "Use Dtk_Body::AddOpenShell, Dtk_Volume::AddOuterShell or Dtk_Volume::AddInnerShell to get valid topology") Dtk_ErrorStatus AddShell(const Dtk_ShellPtr &inShell
 Add Shell in Body in first volume of first lump (created if none) More...
 
Dtk_ErrorStatus SetBodyStatus (Dtk_ErrorStatus inBodyStatus)
 
void SetTolerance (Dtk_Double64 inTol)
 Set Tolerance. More...
 
void SetTopologyStatus (Dtk_ErrorStatus inStatus)
 
Dtk_ErrorStatus Store (const Dtk_string &inFile, Dtk_Size_t inIo=1)
 
Dtk_ErrorStatus Store (FILE *inFile, Dtk_Size_t inIo=1)
 
Dtk_ErrorStatus ToNurbs (Dtk_bool inRemoveTrimmedCurve=0)
 Transforms all curves and surfaces in the body into NURBS. More...
 
Dtk_ErrorStatus TorusWithNegativeMaxRadiusToRevol ()
 
Dtk_ErrorStatus Transform (const Dtk_transfo &inTransfo)
 
Dtk_ErrorStatus TrimUnlimitedFaces ()
 

Static Public Member Functions

static Dtk_BodyPtr Create ()
 Create a body. More...
 
static Dtk_BodyDtkDynamicCast (Dtk_Object *inObject)
 

Data Fields

const Dtk_bool const Dtk_boolinClosedInfo
 
const Dtk_boolinOuterInfo
 

Protected Types

enum  { _typeID = DTK_TYPE_OBJECT }
 
enum  { _typeID = DTK_TYPE_ENTITY }
 
enum  { _typeID = DTK_TYPE_BODY }
 

Protected Member Functions

void _Copy (const Dtk_Body &inBodyToCopy)
 
void _copy (const Dtk_Entity &s)
 
void _copy (const Dtk_Object &s)
 
void _init ()
 
void _Init ()
 
void _reset ()
 
void _Reset ()
 
virtual Dtk_ObjectClone ()
 
 Dtk_Body (const Dtk_Body &inBodyToCopy)
 
virtual ~Dtk_Body ()
 

Protected Attributes

Dtk_Handle * _Private
 
unsigned long count_
 

Friends

class Dtk_SmartPtr< Dtk_Body >
 

Detailed Description

A Dtk_Body Dtk_Body is the highest level topological entity. It allow you to handle manifold and non-manifold object , open skin or surfacic model and wire entities.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
protectedinherited
Enumerator
_typeID 

◆ anonymous enum

anonymous enum
protectedinherited
Enumerator
_typeID 

◆ anonymous enum

anonymous enum
protected
Enumerator
_typeID 
805 { _typeID = DTK_TYPE_BODY };

Constructor & Destructor Documentation

◆ Dtk_Body() [1/2]

Dtk_Body::Dtk_Body ( const Dtk_Body inBodyToCopy)
protected

◆ ~Dtk_Body()

virtual Dtk_Body::~Dtk_Body ( )
protectedvirtual

◆ Dtk_Body() [2/2]

Dtk_Body::Dtk_Body ( )

Member Function Documentation

◆ _Copy()

void Dtk_Body::_Copy ( const Dtk_Body inBodyToCopy)
protected

◆ _copy() [1/2]

void Dtk_Entity::_copy ( const Dtk_Entity s)
protectedinherited

◆ _copy() [2/2]

void Dtk_Object::_copy ( const Dtk_Object s)
protectedinherited

◆ _init()

void Dtk_Entity::_init ( )
protectedinherited

◆ _Init()

void Dtk_Body::_Init ( )
protected

◆ _reset()

void Dtk_Entity::_reset ( )
protectedinherited

◆ _Reset()

void Dtk_Body::_Reset ( )
protected

◆ _Store()

Dtk_ErrorStatus Dtk_Body::_Store ( void *  )
virtual

Reimplemented from Dtk_Entity.

◆ AddLump()

Dtk_ErrorStatus Dtk_Body::AddLump ( const Dtk_LumpPtr inLump)

◆ AddOpenShell()

Dtk_ErrorStatus Dtk_Body::AddOpenShell ( const Dtk_ShellPtr inShell)

Add Open Shell in first volume of first lump (created if none)

Parameters
[in]inShell: pointer on outer open shell
Returns
Dtk_ErrorStatus: dtkNoError if OK error if body has already a closed (inner or outer )shell

◆ AddOpenShell2()

Dtk_ErrorStatus Dtk_Body::AddOpenShell2 ( const Dtk_ShellPtr inShell,
Dtk_VolumePtr volume 
)

◆ AddPtr()

Dtk_ID Dtk_Body::AddPtr ( const Dtk_TopologicalEntityPtr outEntityPtr)

◆ AddStream()

void Dtk_Body::AddStream ( Dtk_StreamPtr  inStream)

◆ AddUnboundedFace()

Dtk_ErrorStatus Dtk_Body::AddUnboundedFace ( Dtk_SurfacePtr  inSurface)

Add Open Shell with a one Unbounded Surface.

Parameters
[in]inSurface: pointer on surface
Returns
Dtk_ErrorStatus: dtkNoError if OK error if body has already a shell

◆ AddWireShell()

Dtk_ErrorStatus Dtk_Body::AddWireShell ( const Dtk_ShellPtr inShell)

Add Wire Shell.

Parameters
[in]inShell: pointer on wire shell
Returns
Dtk_ErrorStatus: dtkNoError if OK

◆ Clone()

virtual Dtk_Object* Dtk_Body::Clone ( )
protectedvirtual

Implements Dtk_Entity.

813 { return new Dtk_Body(*this); }

◆ ComputeBoundingBox()

Dtk_ErrorStatus Dtk_Body::ComputeBoundingBox ( Dtk_pnt outMin,
Dtk_pnt outMax 
)

◆ Create()

static Dtk_BodyPtr Dtk_Body::Create ( )
static

Create a body.

Returns
static Dtk_BodyPtr

◆ DtkDynamicCast()

static Dtk_Body* Dtk_Body::DtkDynamicCast ( Dtk_Object inObject)
static

◆ DtkDynamicType()

int Dtk_Body::DtkDynamicType ( const int &  inId)
virtual

Reimplemented from Dtk_Entity.

◆ dump()

virtual void Dtk_Object::dump ( FILE *  file = stdout)
virtualinherited

◆ ExtractEdgeBody()

Dtk_ErrorStatus Dtk_Body::ExtractEdgeBody ( Dtk_BodyPtr outEdgeBody)

◆ get_info()

Dtk_InfoPtr Dtk_Entity::get_info ( ) const
inherited

◆ get_type_detk()

enum type_detk Dtk_Body::get_type_detk ( ) const
virtual

Implements Dtk_Entity.

◆ GetBodyStatus()

Dtk_ErrorStatus Dtk_Body::GetBodyStatus ( ) const

◆ GetEntities()

Dtk_ErrorStatus Dtk_Body::GetEntities ( const Dtk_ID inInfoId,
Dtk_tab< Dtk_EntityPtr > &  outTab 
) const

Get entities with Info->GetId() == inInfoId.

Parameters
[in]inInfoId: Info->GetId() of entities to be found
Remarks
: several entities can have same identifiers (e.g. splitted entities....)

◆ GetEntity()

Dtk_EntityPtr Dtk_Body::GetEntity ( const Dtk_ID inInfoId) const

Get entity with Info->GetId() == inInfoId.

Parameters
[in]inInfoId: Info->GetId() of entity to be found
Deprecated:
See also
Dtk_Body::GetEntities(const Dtk_ID& inInfoId, Dtk_tab<Dtk_EntityPtr> &outTab)

◆ GetID()

const Dtk_ID& Dtk_Entity::GetID ( ) const
inherited

Get Internal UniqueID.

Returns
InternalID

◆ GetLump() [1/2]

Dtk_ErrorStatus Dtk_Body::GetLump ( const Dtk_Size_t inIndex,
Dtk_ID outLumpId 
) const

◆ GetLump() [2/2]

Dtk_ErrorStatus Dtk_Body::GetLump ( const Dtk_Size_t inIndex,
Dtk_LumpPtr outLump 
) const

◆ GetNumLumps()

Dtk_Size_t Dtk_Body::GetNumLumps ( ) const

◆ GetNumOpenShells()

Dtk_Size_t Dtk_Body::GetNumOpenShells ( ) const

Return Number of Open Shell.

Returns
Dtk_Size_t

◆ GetNumStream()

Dtk_Size_t Dtk_Body::GetNumStream ( ) const

◆ GetNumTopologicalEntities()

Dtk_Size_t Dtk_Body::GetNumTopologicalEntities ( type_detk  inType)

Get Num entities.

Parameters
[in]inType: Type of entities to count

◆ GetOpenShell()

Dtk_ErrorStatus Dtk_Body::GetOpenShell ( Dtk_Size_t  inIndex,
Dtk_ShellPtr outShell 
) const

Return Open Shell

Parameters
[in]inIndex: index of Open Shell
[out]outShell: pointer on open shell
Returns
Dtk_ErrorStatus: dtkNoError if OK

◆ GetPtr()

Dtk_TopologicalEntityPtr Dtk_Body::GetPtr ( const Dtk_ID inId) const

◆ GetSize()

virtual Dtk_Size_t Dtk_Body::GetSize ( ) const
virtual

Reimplemented from Dtk_Entity.

◆ GetStream()

Dtk_StreamPtr Dtk_Body::GetStream ( Dtk_Size_t  inStreamIndex) const

◆ GetTolerance()

Dtk_ErrorStatus Dtk_Body::GetTolerance ( Dtk_Double64 outTolerance)

Get Tolerance.

Parameters
[out]outTolerance: body tolerance
Returns
dtkNoError if value set or dtkWarningDefaultValue if default

◆ GetTopologyStatus()

Dtk_ErrorStatus Dtk_Body::GetTopologyStatus ( ) const

◆ GetVertexBound()

Dtk_ErrorStatus Dtk_Body::GetVertexBound ( Dtk_pnt pmin,
Dtk_pnt pmax 
)

◆ GetVertexGravity()

Dtk_ErrorStatus Dtk_Body::GetVertexGravity ( Dtk_pnt pcenter)

◆ GetWireCurves()

int Dtk_Body::GetWireCurves ( Dtk_tab< Dtk_CurvePtr > &  curves)

◆ GetWireEntities()

int Dtk_Body::GetWireEntities ( Dtk_tab< Dtk_CurvePtr > &  curves,
Dtk_tab< Dtk_PointPtr > &  points 
)

◆ HasFaces()

Dtk_bool Dtk_Body::HasFaces ( )

Returns DTK_TRUE if Body contains faces with surfaces.

◆ HasMeshSurface()

Dtk_bool Dtk_Body::HasMeshSurface ( )

Returns DTK_TRUE if Body contains mesh surfaces.

◆ HasPeriodicSurface()

Dtk_bool Dtk_Body::HasPeriodicSurface ( )

Returns DTK_TRUE if Body contains periodic surfaces.

◆ HasWire()

Dtk_bool Dtk_Body::HasWire ( )

Returns DTK_TRUE if Body contains wireframe.

◆ info()

Dtk_InfoPtr& Dtk_Entity::info ( )
inherited

◆ LimitInfinitEntities()

Dtk_bool Dtk_Body::LimitInfinitEntities ( Dtk_Double64  lenFoundMin,
Dtk_Double64  lenNew = 1.0 
)

◆ MergeVertices()

Dtk_ErrorStatus Dtk_Body::MergeVertices ( Dtk_VertexPtr  inVertexToKeep,
Dtk_VertexPtr  inVertexToRemove 
)

Removes all references to inVertexToRemove and replace it by inVertexToKeep.

Parameters
[in]inVertexToKeep: Vertex to use
[in]inVertexToRemove: Vertex to remove
Returns
Dtk_ErrorStatus: dtkNoError if OK

◆ Normalize()

Dtk_ErrorStatus Dtk_Body::Normalize ( Dtk_bool  updateEdgeGeometry = DTK_TRUE)

◆ PrepareTransfo()

virtual void Dtk_Entity::PrepareTransfo ( )
virtualinherited

Reimplemented in Dtk_OffsetSurface.

◆ RevolToStandardRevol()

Dtk_ErrorStatus Dtk_Body::RevolToStandardRevol ( )

◆ SetAsDeprecated() [1/2]

Dtk_Body::SetAsDeprecated ( "2022.1"  ,
"GetTolerance(Dtk_Double64 &outTolerance) method instead."   
)

Get Tolerance.

Deprecated:
Returns
double Tolerance

◆ SetAsDeprecated() [2/2]

Dtk_Body::SetAsDeprecated ( "2025.1"  ,
"Use Dtk_Body::AddOpenShell  ,
Dtk_Volume::AddOuterShell or Dtk_Volume::AddInnerShell to get valid topology"   
) const &

Add Shell in Body in first volume of first lump (created if none)

Parameters
[in]inShell: pointer on inner shell
[in]inOuterInfo: DTK_TRUE if outer - DTK_FALSE if inner not yet supported -
[in]inClosedInfo: DTK_TRUE if closed DTK_FALSE if open
Returns
Dtk_ErrorStatus: dtkNoError if OK error if body has 2 open shell or 2 outer shell or dtkWarningTopologyIncomplete if inOuterInfo == DTK_FALSE
Deprecated:
Use Dtk_Body::AddOpenShell, Dtk_Volume::AddOuterShell or Dtk_Volume::AddInnerShell to get valid topology

◆ SetBodyStatus()

Dtk_ErrorStatus Dtk_Body::SetBodyStatus ( Dtk_ErrorStatus  inBodyStatus)

◆ SetTolerance()

void Dtk_Body::SetTolerance ( Dtk_Double64  inTol)

Set Tolerance.

Parameters
[in]inTol: Tolerance

◆ SetTopologyStatus()

void Dtk_Body::SetTopologyStatus ( Dtk_ErrorStatus  inStatus)

◆ Store() [1/2]

Dtk_ErrorStatus Dtk_Body::Store ( const Dtk_string inFile,
Dtk_Size_t  inIo = 1 
)

◆ Store() [2/2]

Dtk_ErrorStatus Dtk_Body::Store ( FILE *  inFile,
Dtk_Size_t  inIo = 1 
)

◆ ToNurbs()

Dtk_ErrorStatus Dtk_Body::ToNurbs ( Dtk_bool  inRemoveTrimmedCurve = 0)

Transforms all curves and surfaces in the body into NURBS.

Parameters
[in]inRemoveTrimmedCurve: Convert Trimmed Nurbs into Nurbs
Returns
Dtk_ErrorStatus: dtkNoError if OK

◆ TorusWithNegativeMaxRadiusToRevol()

Dtk_ErrorStatus Dtk_Body::TorusWithNegativeMaxRadiusToRevol ( )

◆ Transform()

Dtk_ErrorStatus Dtk_Body::Transform ( const Dtk_transfo inTransfo)
virtual

Implements Dtk_Entity.

◆ TrimUnlimitedFaces()

Dtk_ErrorStatus Dtk_Body::TrimUnlimitedFaces ( )

Friends And Related Function Documentation

◆ Dtk_SmartPtr< Dtk_Body >

friend class Dtk_SmartPtr< Dtk_Body >
friend

Field Documentation

◆ _Private

Dtk_Handle* Dtk_Body::_Private
protected

◆ count_

unsigned long Dtk_Object::count_
protectedinherited

◆ inClosedInfo

const Dtk_bool const Dtk_bool& Dtk_Body::inClosedInfo

◆ inOuterInfo

const Dtk_bool& Dtk_Body::inOuterInfo
DTK_TYPE_ENTITY
@ DTK_TYPE_ENTITY
Definition: define.h:466
DTK_TYPE_OBJECT
@ DTK_TYPE_OBJECT
Definition: define.h:464
DTK_TYPE_BODY
@ DTK_TYPE_BODY
Definition: define.h:490
Dtk_Body::Dtk_Body
Dtk_Body()
Dtk_Entity::_typeID
@ _typeID
Definition: util_ent_dtk.hpp:333
Dtk_Object::_typeID
@ _typeID
Definition: dtk_object.hpp:13
Dtk_Body::_typeID
@ _typeID
Definition: util_topology_dtk.hpp:805