DATAKIT API  V2025.1
Dtk_Shell Class Reference

Dtk_Shell is a set of faces bounding a volume. Dtk_Shell can be outer or inner. A Dtk_Body contain at least one open_shell or one outer closed shell and 0 or several inner closed shell. More...

+ Inheritance diagram for Dtk_Shell:

Public Member Functions

virtual Dtk_ErrorStatus _Store (void *)
 
Dtk_ErrorStatus AddFace (const Dtk_FacePtr &inFace, Dtk_bool inFaceOrientation, DtkFaceType inFaceType=DtkFaceType_Bounded)
 Add Face to shell. More...
 
Dtk_ErrorStatus AddWire (Dtk_tab< Dtk_CurvePtr > inCurveArray)
 Add Wire entities. More...
 
Dtk_ErrorStatus AddWire (Dtk_tab< Dtk_EdgePtr > inCurveArray)
 
Dtk_ErrorStatus AddWire (Dtk_tab< Dtk_PointPtr > inPointArray)
 Add Wire entities. More...
 
Dtk_ErrorStatus AddWire (Dtk_tab< Dtk_VertexPtr > inPointArray)
 
Dtk_bool CheckIfClosed ()
 Check if Shell is Closed. More...
 
Dtk_ErrorStatus ComputeBoundingBox (Dtk_pnt &outMin, Dtk_pnt &outMax)
 
int DtkDynamicType (const int &inId)
 Get smart pointer type. More...
 
virtual void dump (FILE *file=stdout)
 
Dtk_InfoPtr get_info () const
 
enum type_detk get_type_detk () const
 Return Type of entity. More...
 
Dtk_ErrorStatus GetFace (const Dtk_Size_t &inIndex, Dtk_FacePtr &outFace, Dtk_bool &outOrientation, DtkFaceType inFaceType=DtkFaceType_Bounded) const
 Get Face following Face type. More...
 
Dtk_ErrorStatus GetFace (const Dtk_Size_t &inIndex, Dtk_ID &outFaceId, Dtk_bool &outOrientation, DtkFaceType inFaceType=DtkFaceType_Bounded) const
 
const Dtk_IDGetID () const
 Get Internal UniqueID. More...
 
Dtk_Size_t GetNumFaces (DtkFaceType inFaceType=DtkFaceType_Bounded) const
 Return Number of Faces following Face type. More...
 
Dtk_Size_t GetNumWireSet () const
 Return Number of Wire set of entities equivalent to GetNumFaces with type DtkFaceType_Wire. More...
 
Dtk_ErrorStatus GetParentBody (Dtk_BodyPtr &outParentBody) const
 Get Parent Body. More...
 
Dtk_ErrorStatus GetParentVolume (Dtk_VolumePtr &outParentVolume) const
 Return parent volume of shell. More...
 
virtual Dtk_Size_t GetSize () const
 
Dtk_ID GetTopoID () const
 
Dtk_ErrorStatus GetTopologyStatus () const
 
Dtk_ErrorStatus GetWireSet (const Dtk_Size_t &inIndex, Dtk_tab< Dtk_EntityPtr > &outWire) const
 Get Wire Set. More...
 
Dtk_ErrorStatus GetWireSetTopo (const Dtk_Size_t &inIndex, Dtk_tab< Dtk_EntityPtr > &outWire) const
 
Dtk_ErrorStatus GetWireSetTopo (const Dtk_Size_t &inIndex, Dtk_tab< Dtk_EntityPtr > &outWire, Dtk_tab< Dtk_bool > &outOrientation, Dtk_bool &outLoopOrientation) const
 Get Wire Set. More...
 
Dtk_bool HasWire () const
 Return DTK_TRUE if shell has Wire entities. More...
 
Dtk_InfoPtrinfo ()
 
Dtk_ErrorStatus InverseFaceInShell (const Dtk_FacePtr &inFace)
 
Dtk_bool IsClosed () const
 Return DTK_TRUE if shell is closed. More...
 
Dtk_bool IsOuter () const
 Return DTK_TRUE if shell is outer. More...
 
virtual void PrepareTransfo ()
 
Dtk_ErrorStatus RemoveFaceFromShell (const Dtk_FacePtr &inFace)
 
Dtk_ErrorStatus SetClosedInfo (const Dtk_bool &inClosedInfo)
 Set Closed Info DTK_TRUE if shell is closed. More...
 
Dtk_ErrorStatus SetOuterInfo (const Dtk_bool &inOuterInfo)
 Set Outer Info DTK_TRUE if shell is outer. More...
 
Dtk_ErrorStatus SetParentBody (const Dtk_BodyPtr &inParentBody)
 
Dtk_ErrorStatus SetParentVolume (const Dtk_ID &inParentVolumeId)
 
Dtk_ErrorStatus SetParentVolume (const Dtk_VolumePtr &inParentVolume)
 Set parent volume of shell. More...
 
void SetTopologyStatus (Dtk_ErrorStatus inStatus)
 
virtual Dtk_ErrorStatus Transform (const Dtk_transfo &inTransfo)
 Transform object. More...
 

Static Public Member Functions

static Dtk_ShellPtr Create (const Dtk_BodyPtr &inParentBody)
 Create a shell in a body. More...
 
static Dtk_ShellPtr Create (const Dtk_BodyPtr &inParentBody, Dtk_UInt32 inFacesReserve, Dtk_UInt32 inWireReserve=0)
 Create a shell in a body. More...
 
static Dtk_ShellDtkDynamicCast (Dtk_Object *inObject)
 

Protected Types

enum  { _typeID = DTK_TYPE_TOPOLOGICAL_REPRESENTATION_ITEM }
 
enum  { _typeID = DTK_TYPE_ENTITY }
 
enum  { _typeID = DTK_TYPE_SHELL }
 

Protected Member Functions

void _Clone (Dtk_TopologicalEntityPtr &outTopo, Dtk_Body *_inParentBody)
 
void _copy (const Dtk_Entity &s)
 
void _copy (const Dtk_Object &s)
 
void _Copy (const Dtk_Shell &inTopo, Dtk_Body *inParentBody)
 
void _init ()
 
void _Init ()
 
void _reset ()
 
void _Reset ()
 
virtual Dtk_ObjectClone ()
 
 Dtk_Shell ()
 
 Dtk_Shell (const Dtk_Shell &inTopo, Dtk_Body *inParentBody)
 
Dtk_ErrorStatus SetFace (const Dtk_Size_t &inIndex, const Dtk_FacePtr &inFace, const Dtk_bool &inFaceOrientation)
 
virtual ~Dtk_Shell ()
 

Protected Attributes

Dtk_Handle * _Private
 
unsigned long count_
 

Friends

Dtk_ErrorStatus Dtk_Body::ExtractEdgeBody (Dtk_BodyPtr &outEdgeBody)
 
class Dtk_SmartPtr< Dtk_Shell >
 
class Dtk_TopologicalEntity
 

Detailed Description

Dtk_Shell is a set of faces bounding a volume. Dtk_Shell can be outer or inner. A Dtk_Body contain at least one open_shell or one outer closed shell and 0 or several inner closed shell.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
protectedinherited
Enumerator
_typeID 

◆ anonymous enum

anonymous enum
protectedinherited
Enumerator
_typeID 

◆ anonymous enum

anonymous enum
protected
Enumerator
_typeID 
959 { _typeID = DTK_TYPE_SHELL };

Constructor & Destructor Documentation

◆ Dtk_Shell() [1/2]

Dtk_Shell::Dtk_Shell ( )
protected

◆ Dtk_Shell() [2/2]

Dtk_Shell::Dtk_Shell ( const Dtk_Shell inTopo,
Dtk_Body inParentBody 
)
protected

◆ ~Dtk_Shell()

virtual Dtk_Shell::~Dtk_Shell ( )
protectedvirtual

Member Function Documentation

◆ _Clone()

void Dtk_Shell::_Clone ( Dtk_TopologicalEntityPtr outTopo,
Dtk_Body _inParentBody 
)
protectedvirtual

Implements Dtk_TopologicalEntity.

◆ _copy() [1/2]

void Dtk_Entity::_copy ( const Dtk_Entity s)
protectedinherited

◆ _copy() [2/2]

void Dtk_Object::_copy ( const Dtk_Object s)
protectedinherited

◆ _Copy()

void Dtk_Shell::_Copy ( const Dtk_Shell inTopo,
Dtk_Body inParentBody 
)
protected

◆ _init()

void Dtk_Entity::_init ( )
protectedinherited

◆ _Init()

void Dtk_Shell::_Init ( )
protected

◆ _reset()

void Dtk_Entity::_reset ( )
protectedinherited

◆ _Reset()

void Dtk_Shell::_Reset ( )
protected

◆ _Store()

virtual Dtk_ErrorStatus Dtk_Shell::_Store ( void *  )
virtual

Reimplemented from Dtk_Entity.

◆ AddFace()

Dtk_ErrorStatus Dtk_Shell::AddFace ( const Dtk_FacePtr inFace,
Dtk_bool  inFaceOrientation,
DtkFaceType  inFaceType = DtkFaceType_Bounded 
)

Add Face to shell.

Parameters
[in]inFace: Face
[in]inOrientation: Face orientation relative to shell (DTK_TRUE if face material and shell material are on same side)
[in]inFaceType: Type of face ( DtkFaceType_Bounded = topological face or DtkFaceType_Wire = Face used to store wire entities)
Returns
Dtk_ErrorStatus: dtkNoError if OK

◆ AddWire() [1/4]

Dtk_ErrorStatus Dtk_Shell::AddWire ( Dtk_tab< Dtk_CurvePtr inCurveArray)

Add Wire entities.

Parameters
[in]inWireArray: Array of Dtk_Curves
Returns
Dtk_ErrorStatus: dtkNoError if OK

◆ AddWire() [2/4]

Dtk_ErrorStatus Dtk_Shell::AddWire ( Dtk_tab< Dtk_EdgePtr inCurveArray)

◆ AddWire() [3/4]

Dtk_ErrorStatus Dtk_Shell::AddWire ( Dtk_tab< Dtk_PointPtr inPointArray)

Add Wire entities.

Parameters
[in]inPointArray: Array of 3D Points
Returns
Dtk_ErrorStatus: dtkNoError if OK

◆ AddWire() [4/4]

Dtk_ErrorStatus Dtk_Shell::AddWire ( Dtk_tab< Dtk_VertexPtr inPointArray)

◆ CheckIfClosed()

Dtk_bool Dtk_Shell::CheckIfClosed ( )

Check if Shell is Closed.

Returns
DTK_TRUE if closed

◆ Clone()

virtual Dtk_Object* Dtk_TopologicalEntity::Clone ( )
protectedvirtualinherited

Implements Dtk_Entity.

37 {return NULL;}

◆ ComputeBoundingBox()

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

◆ Create() [1/2]

static Dtk_ShellPtr Dtk_Shell::Create ( const Dtk_BodyPtr inParentBody)
static

Create a shell in a body.

Parameters
[in]inParentBody: parent body
Returns
static Dtk_ShellPtr

◆ Create() [2/2]

static Dtk_ShellPtr Dtk_Shell::Create ( const Dtk_BodyPtr inParentBody,
Dtk_UInt32  inFacesReserve,
Dtk_UInt32  inWireReserve = 0 
)
static

Create a shell in a body.

Parameters
[in]inParentBody: parent body
[in]inFacesReserve: Faces size to reserve
[in]inWireReserve: Wire size to reserve
Returns
static Dtk_ShellPtr

◆ DtkDynamicCast()

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

◆ DtkDynamicType()

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

Get smart pointer type.

Parameters
[in]inId:
Returns
int

Reimplemented from Dtk_TopologicalEntity.

◆ dump()

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

◆ get_info()

Dtk_InfoPtr Dtk_Entity::get_info ( ) const
inherited

◆ get_type_detk()

enum type_detk Dtk_Shell::get_type_detk ( ) const
virtual

Return Type of entity.

Returns
enum type_detk

Reimplemented from Dtk_TopologicalEntity.

◆ GetFace() [1/2]

Dtk_ErrorStatus Dtk_Shell::GetFace ( const Dtk_Size_t inIndex,
Dtk_FacePtr outFace,
Dtk_bool outOrientation,
DtkFaceType  inFaceType = DtkFaceType_Bounded 
) const

Get Face following Face type.

Parameters
[in]inIndex: index of face
[out]outFace: Face
[out]outOrientation: Face orientation relative to shell
[in]inFaceType: Type of face ( DtkFaceType_Bounded = topological face / DtkFaceType_All = All Faces / DtkFaceType_Wire = Face used to store wire entities)
Returns
Dtk_ErrorStatus: dtkNoError if OK

◆ GetFace() [2/2]

Dtk_ErrorStatus Dtk_Shell::GetFace ( const Dtk_Size_t inIndex,
Dtk_ID outFaceId,
Dtk_bool outOrientation,
DtkFaceType  inFaceType = DtkFaceType_Bounded 
) const

◆ GetID()

const Dtk_ID& Dtk_Entity::GetID ( ) const
inherited

Get Internal UniqueID.

Returns
InternalID

◆ GetNumFaces()

Dtk_Size_t Dtk_Shell::GetNumFaces ( DtkFaceType  inFaceType = DtkFaceType_Bounded) const

Return Number of Faces following Face type.

Parameters
[in]inFaceType: Type of face you want to count ( DtkFaceType_Bounded = topological face / DtkFaceType_All = All Faces / DtkFaceType_Wire = Face used to store wire entities)
Returns
number of face following Face type

◆ GetNumWireSet()

Dtk_Size_t Dtk_Shell::GetNumWireSet ( ) const

Return Number of Wire set of entities equivalent to GetNumFaces with type DtkFaceType_Wire.

Returns
number of Wire set of entities

◆ GetParentBody()

Dtk_ErrorStatus Dtk_Shell::GetParentBody ( Dtk_BodyPtr outParentBody) const

Get Parent Body.

Parameters
[out]outParentBody: parent body
Returns
Dtk_ErrorStatus: dtkNoError if OK

◆ GetParentVolume()

Dtk_ErrorStatus Dtk_Shell::GetParentVolume ( Dtk_VolumePtr outParentVolume) const

Return parent volume of shell.

Parameters
[out]outParentVolume: pointer of parent volume
Returns
Dtk_ErrorStatus: dtkNoError if OK

◆ GetSize()

virtual Dtk_Size_t Dtk_Shell::GetSize ( ) const
virtual

Reimplemented from Dtk_Entity.

◆ GetTopoID()

Dtk_ID Dtk_Shell::GetTopoID ( ) const
virtual

Reimplemented from Dtk_TopologicalEntity.

◆ GetTopologyStatus()

Dtk_ErrorStatus Dtk_Shell::GetTopologyStatus ( ) const

◆ GetWireSet()

Dtk_ErrorStatus Dtk_Shell::GetWireSet ( const Dtk_Size_t inIndex,
Dtk_tab< Dtk_EntityPtr > &  outWire 
) const

Get Wire Set.

Parameters
[in]inIndex: index of wire set
[out]outWire: array of Dtk_Entity (must be Dtk_PointPtr or Dtk_CurvePtr )
Returns
Dtk_ErrorStatus: dtkNoError if OK

◆ GetWireSetTopo() [1/2]

Dtk_ErrorStatus Dtk_Shell::GetWireSetTopo ( const Dtk_Size_t inIndex,
Dtk_tab< Dtk_EntityPtr > &  outWire 
) const

◆ GetWireSetTopo() [2/2]

Dtk_ErrorStatus Dtk_Shell::GetWireSetTopo ( const Dtk_Size_t inIndex,
Dtk_tab< Dtk_EntityPtr > &  outWire,
Dtk_tab< Dtk_bool > &  outOrientation,
Dtk_bool outLoopOrientation 
) const

Get Wire Set.

Parameters
[in]inIndex: index of wire set
[out]outWire: array of Dtk_Entity (must be Dtk_VertexPtr or Dtk_EdgePtr )
[out]outOrientation: array of bool for edge orientation
Returns
Dtk_ErrorStatus: dtkNoError if OK

◆ HasWire()

Dtk_bool Dtk_Shell::HasWire ( ) const

Return DTK_TRUE if shell has Wire entities.

◆ info()

Dtk_InfoPtr& Dtk_Entity::info ( )
inherited

◆ InverseFaceInShell()

Dtk_ErrorStatus Dtk_Shell::InverseFaceInShell ( const Dtk_FacePtr inFace)

◆ IsClosed()

Dtk_bool Dtk_Shell::IsClosed ( ) const

Return DTK_TRUE if shell is closed.

◆ IsOuter()

Dtk_bool Dtk_Shell::IsOuter ( ) const

Return DTK_TRUE if shell is outer.

◆ PrepareTransfo()

virtual void Dtk_Entity::PrepareTransfo ( )
virtualinherited

Reimplemented in Dtk_OffsetSurface.

◆ RemoveFaceFromShell()

Dtk_ErrorStatus Dtk_Shell::RemoveFaceFromShell ( const Dtk_FacePtr inFace)

◆ SetClosedInfo()

Dtk_ErrorStatus Dtk_Shell::SetClosedInfo ( const Dtk_bool inClosedInfo)

Set Closed Info DTK_TRUE if shell is closed.

Returns
Dtk_ErrorStatus: dtkNoError if OK

◆ SetFace()

Dtk_ErrorStatus Dtk_Shell::SetFace ( const Dtk_Size_t inIndex,
const Dtk_FacePtr inFace,
const Dtk_bool inFaceOrientation 
)
protected

◆ SetOuterInfo()

Dtk_ErrorStatus Dtk_Shell::SetOuterInfo ( const Dtk_bool inOuterInfo)

Set Outer Info DTK_TRUE if shell is outer.

Returns
Dtk_ErrorStatus: dtkNoError if OK

◆ SetParentBody()

Dtk_ErrorStatus Dtk_Shell::SetParentBody ( const Dtk_BodyPtr inParentBody)
virtual

Reimplemented from Dtk_TopologicalEntity.

◆ SetParentVolume() [1/2]

Dtk_ErrorStatus Dtk_Shell::SetParentVolume ( const Dtk_ID inParentVolumeId)

◆ SetParentVolume() [2/2]

Dtk_ErrorStatus Dtk_Shell::SetParentVolume ( const Dtk_VolumePtr inParentVolume)

Set parent volume of shell.

Parameters
[in]inParentVolume: pointer of parent volume
Returns
Dtk_ErrorStatus: dtkNoError if OK

◆ SetTopologyStatus()

void Dtk_Shell::SetTopologyStatus ( Dtk_ErrorStatus  inStatus)

◆ Transform()

virtual Dtk_ErrorStatus Dtk_TopologicalEntity::Transform ( const Dtk_transfo inTransfo)
virtualinherited

Transform object.

Parameters
[in]inTransfo: matrix to apply
Returns
Dtk_ErrorStatus

Implements Dtk_Entity.

Friends And Related Function Documentation

◆ Dtk_Body::ExtractEdgeBody

◆ Dtk_SmartPtr< Dtk_Shell >

friend class Dtk_SmartPtr< Dtk_Shell >
friend

◆ Dtk_TopologicalEntity

friend class Dtk_TopologicalEntity
friend

Field Documentation

◆ _Private

Dtk_Handle* Dtk_Shell::_Private
protected

◆ count_

unsigned long Dtk_Object::count_
protectedinherited
DTK_TYPE_ENTITY
@ DTK_TYPE_ENTITY
Definition: define.h:466
Dtk_TopologicalEntity::_typeID
@ _typeID
Definition: util_topology_dtk.hpp:29
Dtk_Shell::_typeID
@ _typeID
Definition: util_topology_dtk.hpp:959
Dtk_Entity::_typeID
@ _typeID
Definition: util_ent_dtk.hpp:333
DTK_TYPE_TOPOLOGICAL_REPRESENTATION_ITEM
@ DTK_TYPE_TOPOLOGICAL_REPRESENTATION_ITEM
Definition: define.h:167
DTK_TYPE_SHELL
@ DTK_TYPE_SHELL
Definition: define.h:153