Version: 9.16.0
SMDS_NodeFactory Class Reference

Allocate SMDS_MeshNode's. More...

#include <SMDS_ElementFactory.hxx>

Inheritance diagram for SMDS_NodeFactory:

Public Member Functions

 SMDS_NodeFactory (SMDS_Mesh *mesh)
 Create a factory of nodes in a given mesh. More...
 
 ~SMDS_NodeFactory ()
 Destructor. More...
 
SMDS_MeshNodeNewNode (smIdType id)
 Return a SMDS_MeshNode by ID. NULL if the node with the given ID is already used. More...
 
const SMDS_MeshNodeFindNode (smIdType id)
 Return an used node by ID. NULL if the node with the given ID is not yet used. More...
 
void SetNbShapes (size_t nbShapes)
 Set a total number of sub-shapes in the main shape. More...
 
int GetShapeDim (int shapeID) const
 Return a dimension of a shape. More...
 
void SetShapeDim (int shapeID, int dim)
 Set a dimension of a shape. More...
 
virtual void Clear ()
 De-allocate all nodes. More...
 
virtual void Compact (std::vector< smIdType > &idNodesOldToNew)
 Remove unused nodes located not at the end of the last chunk. More...
 
virtual bool CompactChangePointers ()
 Return true if Compact() will change IDs of node. More...
 
smIdType GetFreeID ()
 Return minimal ID of a non-used element. More...
 
smIdType GetMaxID ()
 Return maximal ID of an used element. More...
 
smIdType GetMinID ()
 Return minimal ID of an used element. More...
 
SMDS_MeshElementNewElement (const smIdType id)
 Return an element by ID. NULL if the element with the given ID is already used. More...
 
SMDS_MeshCellNewCell (const smIdType id)
 Return a SMDS_MeshCell by ID. NULL if the cell with the given ID is already used. More...
 
const SMDS_MeshElementFindElement (const smIdType id) const
 Return an used element by ID. NULL if the element with the given ID is not yet used. More...
 
smIdType NbUsedElements () const
 Return a number of used elements. More...
 
template<class ElemIterator >
boost::shared_ptr< ElemIterator > GetIterator (SMDS_MeshElement::Filter *filter, size_t nbElemsToReturn=-1)
 Return an iterator on all element filtered using a given filter. More...
 
template<class ElemIterator >
boost::shared_ptr< ElemIterator > GetShapeIterator (int shapeID, size_t nbElemsToReturn, const SMDS_MeshElement *sm1stElem)
 Return an iterator on all element assigned to a given shape. More...
 
void SetAllNotMarked ()
 Clear marked flag of all elements. More...
 
void Free (const SMDS_MeshElement *)
 Mark the element as non-used. More...
 
smIdType FromVtkToSmds (vtkIdType vtkID)
 Return an SMDS ID by a Vtk one. More...
 

Static Public Member Functions

static int ChunkSize ()
 Return a number of elements in a chunk. More...
 

Protected Attributes

bool myIsNodal
 
SMDS_MeshmyMesh
 
TChunkVector myChunks
 
TChunkPtrSet myChunksWithUnused
 
std::vector< vtkIdType > myVtkIDs
 
std::vector< smIdType > mySmdsIDs
 
smIdType myNbUsedElements
 

Private Attributes

std::vector< char > myShapeDim
 

Detailed Description

Allocate SMDS_MeshNode's.

Constructor & Destructor Documentation

◆ SMDS_NodeFactory()

SMDS_NodeFactory::SMDS_NodeFactory ( SMDS_Mesh mesh)

Create a factory of nodes in a given mesh.

◆ ~SMDS_NodeFactory()

SMDS_NodeFactory::~SMDS_NodeFactory ( )

Destructor.

References Clear().

Member Function Documentation

◆ ChunkSize()

int SMDS_ElementFactory::ChunkSize ( )
staticinherited

Return a number of elements in a chunk.

Returns
int - chunk size

Referenced by SMDS_ElementFactory::GetShapeIterator(), and _RangeSet< RANGE >::Size().

◆ Clear()

void SMDS_NodeFactory::Clear ( )
virtual

De-allocate all nodes.

Reimplemented from SMDS_ElementFactory.

References SMDS_ElementFactory::Clear().

Referenced by SMDS_Mesh::Clear(), and ~SMDS_NodeFactory().

◆ Compact()

void SMDS_NodeFactory::Compact ( std::vector< smIdType > &  theVtkIDsOldToNew)
virtual

◆ CompactChangePointers()

bool SMDS_NodeFactory::CompactChangePointers ( )
virtual

Return true if Compact() will change IDs of node.

Return true if Compact() will change IDs of elements.

Reimplemented from SMDS_ElementFactory.

References SMDS_ElementFactory::GetMaxID(), and SMDS_ElementFactory::NbUsedElements().

Referenced by SMDS_Mesh::HasNumerationHoles().

◆ FindElement()

const SMDS_MeshElement * SMDS_ElementFactory::FindElement ( const smIdType  id) const
inherited

Return an used element by ID. NULL if the element with the given ID is not yet used.

Return an used element by ID.

NULL if the element with the given ID is not yet used

Parameters
[in]id- element ID
Returns
const SMDS_MeshElement* - element pointer

References SMDS_MeshElement::IsNull(), and SMDS_ElementFactory::myChunks.

Referenced by SMDS_ElementFactory::Compact(), Compact(), SMDS_Mesh::Contains(), SMDS_Mesh::FindElement(), SMDS_Mesh::FindElementVtk(), FindNode(), SMDS_ElementFactory::Free(), and SMDS_Mesh::GetElementType().

◆ FindNode()

◆ Free()

◆ FromVtkToSmds()

smIdType SMDS_ElementFactory::FromVtkToSmds ( vtkIdType  vtkID)
inherited

Return an SMDS ID by a Vtk one.

Parameters
[in]vtkID- Vtk ID
Returns
smIdType - SMDS ID

References SMDS_ElementFactory::mySmdsIDs.

Referenced by SMDS_Mesh::FromVtkToSmds().

◆ GetFreeID()

◆ GetIterator()

template<class ElemIterator >
boost::shared_ptr< ElemIterator > SMDS_ElementFactory::GetIterator ( SMDS_MeshElement::Filter filter,
size_t  nbElemsToReturn = -1 
)
inherited

◆ GetMaxID()

smIdType SMDS_ElementFactory::GetMaxID ( )
inherited

◆ GetMinID()

smIdType SMDS_ElementFactory::GetMinID ( )
inherited

Return minimal ID of an used element.

Returns
smIdType - element ID

References SMDS_ElementFactory::myChunks.

Referenced by SMDS_Mesh::MinElementID(), and SMDS_Mesh::MinNodeID().

◆ GetShapeDim()

int SMDS_NodeFactory::GetShapeDim ( int  shapeID) const

Return a dimension of a shape.

References myShapeDim.

Referenced by Compact().

◆ GetShapeIterator()

template<class ElemIterator >
boost::shared_ptr< ElemIterator > SMDS_ElementFactory::GetShapeIterator ( int  shapeID,
size_t  nbElemsToReturn,
const SMDS_MeshElement sm1stElem 
)
inherited

◆ NbUsedElements()

smIdType SMDS_ElementFactory::NbUsedElements ( ) const
inherited

◆ NewCell()

◆ NewElement()

SMDS_MeshElement * SMDS_ElementFactory::NewElement ( const smIdType  id)
inherited

Return an element by ID. NULL if the element with the given ID is already used.

Return an element by ID.

NULL if the element with the given ID is already used

Parameters
[in]id- element ID
Returns
SMDS_MeshElement* - element pointer

References SMDS_MeshElement::IsNull(), SMDS_ElementFactory::myChunks, SMDS_MeshElement::myHolder, SMDS_ElementFactory::myMesh, SMDS_ElementFactory::myNbUsedElements, SMDS_Mesh::setMyModified(), and SMDS_ElementFactory::SMDS_ElementChunk.

Referenced by SMDS_Mesh::AddBallWithID(), SMDS_ElementFactory::Compact(), Compact(), SMDS_ElementFactory::NewCell(), and NewNode().

◆ NewNode()

SMDS_MeshNode * SMDS_NodeFactory::NewNode ( smIdType  id)

Return a SMDS_MeshNode by ID. NULL if the node with the given ID is already used.

References SMDS_ElementFactory::NewElement().

Referenced by SMDS_Mesh::AddNodeWithID().

◆ SetAllNotMarked()

void SMDS_ElementFactory::SetAllNotMarked ( )
inherited

Clear marked flag of all elements.

References SMDS_ElementFactory::myChunks.

Referenced by SMDS_Mesh::SetAllCellsNotMarked(), and SMDS_Mesh::SetAllNodesNotMarked().

◆ SetNbShapes()

void SMDS_NodeFactory::SetNbShapes ( size_t  nbShapes)

Set a total number of sub-shapes in the main shape.

References myShapeDim.

Referenced by SMDS_Mesh::setNbShapes().

◆ SetShapeDim()

void SMDS_NodeFactory::SetShapeDim ( int  shapeID,
int  dim 
)

Set a dimension of a shape.

References myShapeDim.

Field Documentation

◆ myChunks

◆ myChunksWithUnused

◆ myIsNodal

bool SMDS_ElementFactory::myIsNodal
protectedinherited

◆ myMesh

SMDS_Mesh* SMDS_ElementFactory::myMesh
protectedinherited

◆ myNbUsedElements

smIdType SMDS_ElementFactory::myNbUsedElements
protectedinherited

◆ myShapeDim

std::vector<char> SMDS_NodeFactory::myShapeDim
private

◆ mySmdsIDs

std::vector< smIdType > SMDS_ElementFactory::mySmdsIDs
protectedinherited

◆ myVtkIDs

std::vector< vtkIdType > SMDS_ElementFactory::myVtkIDs
protectedinherited