SOFA API  99934cbc
Open source framework for multi-physics simuation
sofa::component::topology::TetrahedronSetTopologyContainer Class Reference

#include <TetrahedronSetTopologyContainer.h>

Inheritance diagram for sofa::component::topology::TetrahedronSetTopologyContainer:

Detailed Description

a class that stores a set of tetrahedra and provides access with adjacent triangles, edges and vertices

Public Attributes

Data< boold_createTriangleArray
 force the creation of triangles More...
 
Data< sofa::helper::vector< Tetrahedron > > d_tetrahedron
 provides the set of tetrahedra. More...
 
- Public Attributes inherited from sofa::component::topology::TriangleSetTopologyContainer
Data< sofa::helper::vector< Triangle > > d_triangle
 provides the set of triangles. More...
 
- Public Attributes inherited from sofa::component::topology::EdgeSetTopologyContainer
Data< sofa::helper::vector< Edge > > d_edge
 List of edge indices. More...
 
Data< boolm_checkConnexity
 It true, will check the connexity of the mesh. More...
 
- Public Attributes inherited from sofa::component::topology::PointSetTopologyContainer
Data< InitTypes::VecCoordd_initPoints
 Initial position of points. More...
 
Data< boold_checkTopology
 Bool parameter to activate internal topology checks in several methods. More...
 

Protected Attributes

sofa::helper::vector< EdgesInTetrahedronm_edgesInTetrahedron
 provides the set of edges for each tetrahedron. More...
 
sofa::helper::vector< TrianglesInTetrahedronm_trianglesInTetrahedron
 provides the set of triangles for each tetrahedron. More...
 
sofa::helper::vector< TetrahedraAroundVertexm_tetrahedraAroundVertex
 for each vertex provides the set of tetrahedra adjacent to that vertex. More...
 
sofa::helper::vector< TetrahedraAroundEdgem_tetrahedraAroundEdge
 for each edge provides the set of tetrahedra adjacent to that edge. More...
 
sofa::helper::vector< TetrahedronIDm_removedTetraIndex
 removed tetrahedron index More...
 
sofa::helper::vector< TetrahedraAroundTrianglem_tetrahedraAroundTriangle
 for each triangle provides the set of tetrahedra adjacent to that triangle. More...
 
bool m_tetrahedronTopologyDirty
 Boolean used to know if the topology Data of this container is dirty. More...
 
std::list< sofa::core::topology::TopologyEngine * > m_enginesList
 List of engines related to this specific container. More...
 
sofa::helper::vector< sofa::helper::vector< std::string > > m_dataGraph
 variables used to display the graph of Data/DataEngines linked to this Data array. More...
 
sofa::helper::vector< sofa::helper::vector< std::string > > m_enginesGraph
 
- Protected Attributes inherited from sofa::component::topology::TriangleSetTopologyContainer
sofa::helper::vector< EdgesInTrianglem_edgesInTriangle
 provides the 3 edges in each triangle. More...
 
sofa::helper::vector< TrianglesAroundVertexm_trianglesAroundVertex
 for each vertex provides the set of triangles adjacent to that vertex. More...
 
sofa::helper::vector< TrianglesAroundEdgem_trianglesAroundEdge
 for each edge provides the set of triangles adjacent to that edge. More...
 
sofa::helper::vector< TriangleIDm_trianglesOnBorder
 Set of triangle indices on topology border. More...
 
sofa::helper::vector< EdgeIDm_edgesOnBorder
 Set of edge indices on topology border. More...
 
sofa::helper::vector< PointIDm_pointsOnBorder
 Set of point indices on topology border. More...
 
bool m_triangleTopologyDirty
 Boolean used to know if the topology Data of this container is dirty. More...
 
std::list< sofa::core::topology::TopologyEngine * > m_enginesList
 List of engines related to this specific container. More...
 
sofa::helper::vector< sofa::helper::vector< std::string > > m_dataGraph
 variables used to display the graph of Data/DataEngines linked to this Data array. More...
 
sofa::helper::vector< sofa::helper::vector< std::string > > m_enginesGraph
 
- Protected Attributes inherited from sofa::component::topology::EdgeSetTopologyContainer
sofa::helper::vector< EdgesAroundVertexm_edgesAroundVertex
 
bool m_edgeTopologyDirty
 Boolean used to know if the topology Data of this container is dirty. More...
 
std::list< sofa::core::topology::TopologyEngine * > m_enginesList
 List of engines related to this specific container. More...
 
sofa::helper::vector< sofa::helper::vector< std::string > > m_dataGraph
 variables used to display the graph of Data/DataEngines linked to this Data array. More...
 
sofa::helper::vector< sofa::helper::vector< std::string > > m_enginesGraph
 
- Protected Attributes inherited from sofa::component::topology::PointSetTopologyContainer
bool m_pointTopologyDirty
 Boolean used to know if the topology Data of this container is dirty. More...
 
std::list< sofa::core::topology::TopologyEngine * > m_enginesList
 List of engines related to this specific container. More...
 
sofa::helper::vector< sofa::helper::vector< std::string > > m_dataGraph
 variables used to display the graph of Data/DataEngines linked to this Data array. More...
 
sofa::helper::vector< sofa::helper::vector< std::string > > m_enginesGraph
 

Public Member Functions

 SOFA_CLASS (TetrahedronSetTopologyContainer, TriangleSetTopologyContainer)
 
void init () override
 
void addRemovedTetraIndex (sofa::helper::vector< TetrahedronID > &tetrahedra)
 
sofa::helper::vector< TetrahedronID > & getRemovedTetraIndex ()
 
size_t getNumberOfTetrahedra () const
 Returns the number of tetrahedra in this topology. The difference to getNbTetrahedra() is that this method does not generate the tetra array if it does not exist. More...
 
size_t getNumberOfElements () const override
 Returns the number of topological element of the current topology. This function avoids to know which topological container is in used. More...
 
const sofa::helper::vector< Tetrahedron > & getTetrahedronArray ()
 Returns the Tetrahedron array. More...
 
const sofa::helper::vector< EdgesInTetrahedron > & getEdgesInTetrahedronArray ()
 Returns the EdgesInTetrahedron array (i.e. provide the 6 edge indices for each tetrahedron). More...
 
const sofa::helper::vector< TrianglesInTetrahedron > & getTrianglesInTetrahedronArray ()
 Returns the TrianglesInTetrahedron array (i.e. provide the 4 triangle indices for each tetrahedron). More...
 
const sofa::helper::vector< TetrahedraAroundVertex > & getTetrahedraAroundVertexArray ()
 Returns the TetrahedraAroundVertex array (i.e. provide the tetrahedron indices adjacent to each vertex). More...
 
const sofa::helper::vector< TetrahedraAroundEdge > & getTetrahedraAroundEdgeArray ()
 Returns the TetrahedraAroundEdge array (i.e. provide the tetrahedron indices adjacent to each edge). More...
 
const sofa::helper::vector< TetrahedraAroundTriangle > & getTetrahedraAroundTriangleArray ()
 Returns the TetrahedraAroundTriangle array (i.e. provide the tetrahedron indices adjacent to each triangle). More...
 
bool hasTetrahedra () const
 
bool hasEdgesInTetrahedron () const
 
bool hasTrianglesInTetrahedron () const
 
bool hasTetrahedraAroundVertex () const
 
bool hasTetrahedraAroundEdge () const
 
bool hasTetrahedraAroundTriangle () const
 
sofa::core::topology::TopologyObjectType getTopologyType () const override
 Returns the type of the topology. More...
 
void clear () override
 
void addTriangle (index_type, index_type, index_type) override
 
void addTetra (index_type a, index_type b, index_type c, index_type d) override
 
const SeqTetrahedragetTetrahedra () override
 Returns the tetrahedra array. More...
 
Data< sofa::helper::vector< Tetrahedron > > & getTetrahedronDataArray ()
 Returns a reference to the Data of tetrahedra array container. More...
 
const Tetrahedron getTetrahedron (TetraID i) override
 Returns the tetrahedron corresponding to the TetraID i. More...
 
TetrahedronID getTetrahedronIndex (PointID v1, PointID v2, PointID v3, PointID v4) override
 Returns the indices of a tetrahedron given four vertex indices. More...
 
const EdgesInTetrahedrongetEdgesInTetrahedron (TetraID id) override
 Returns the 6 edges adjacent to a given tetrahedron. More...
 
const TrianglesInTetrahedrongetTrianglesInTetrahedron (TetraID id) override
 Returns the 4 triangles adjacent to a given tetrahedron. More...
 
const TetrahedraAroundVertexgetTetrahedraAroundVertex (PointID id) override
 Returns the set of tetrahedra adjacent to a given vertex. More...
 
const TetrahedraAroundEdgegetTetrahedraAroundEdge (EdgeID id) override
 Returns the set of tetrahedra adjacent to a given edge. More...
 
const TetrahedraAroundTrianglegetTetrahedraAroundTriangle (TriangleID id) override
 Returns the set of tetrahedra adjacent to a given triangle. More...
 
int getVertexIndexInTetrahedron (const Tetrahedron &t, PointID vertexIndex) const override
 Returns the index (either 0, 1 ,2 or 3) of the vertex whose global index is vertexIndex. More...
 
int getEdgeIndexInTetrahedron (const EdgesInTetrahedron &t, EdgeID edgeIndex) const override
 Returns the index (either 0, 1 ,2, 3, 4 or 5) of the edge whose global index is edgeIndex. More...
 
int getTriangleIndexInTetrahedron (const TrianglesInTetrahedron &t, TriangleID triangleIndex) const override
 Returns the index (either 0, 1 ,2 or 3) of the triangle whose global index is triangleIndex. More...
 
Edge getLocalEdgesInTetrahedron (const EdgeID i) const override
 Returns for each index (between 0 and 5) the two vertex indices that are adjacent to that edge. More...
 
Triangle getLocalTrianglesInTetrahedron (const TriangleID i) const override
 Returns for each index (between 0 and 3) the three local vertices indices that are adjacent to that triangle. More...
 
void initTopology ()
 Method called by component Init method. Will create all the topology neighboorhood buffers and call. More...
 
bool checkTopology () const override
 Checks if the topology is coherent. More...
 
bool checkConnexity () override
 Checks if the topology has only one connected component. More...
 
size_t getNumberOfConnectedComponent () override
 Returns the number of connected component. More...
 
const VecTetraID getConnectedElement (TetraID elem) override
 Returns the set of element indices connected to an input one (i.e. which can be reached by topological links) More...
 
const VecTetraID getElementAroundElement (TetraID elem) override
 Returns the set of element indices adjacent to a given element (i.e. sharing a link) More...
 
const VecTetraID getElementAroundElements (VecTetraID elems) override
 Returns the set of element indices adjacent to a given list of elements (i.e. sharing a link) More...
 
const VecTetraID getOppositeElement (TetraID elemID)
 Returns the set of element indices adjacent to a given element with direct link from n-1 order element type (i.e triangle for tetrahedron) More...
 
- Public Member Functions inherited from sofa::component::topology::TriangleSetTopologyContainer
 SOFA_CLASS (TriangleSetTopologyContainer, EdgeSetTopologyContainer)
 
void init () override
 
void reinit () override
 
bool hasTriangles () const
 
bool hasEdgesInTriangle () const
 
bool hasTrianglesAroundVertex () const
 
bool hasTrianglesAroundEdge () const
 
bool hasBorderElementLists () const
 
void createElementsOnBorder ()
 : Create element lists which are on topology border: More...
 
void reOrientateTriangle (TriangleID id) override
 Will change order of vertices in triangle: t[1] <=> t[2]. More...
 
void clear () override
 
void addEdge (index_type, index_type) override
 
void addTriangle (index_type a, index_type b, index_type c) override
 
const SeqTrianglesgetTriangles () override
 Returns the quad array. More...
 
Data< sofa::helper::vector< Triangle > > & getTriangleDataArray ()
 Returns a reference to the Data of triangles array container. More...
 
const Triangle getTriangle (TriangleID i) override
 Returns the triangle corresponding to the TriangleID i. More...
 
TriangleID getTriangleIndex (PointID v1, PointID v2, PointID v3) override
 
const EdgesInTrianglegetEdgesInTriangle (TriangleID id) override
 Returns the 3 edges adjacent to a given triangle. More...
 
const TrianglesAroundVertexgetTrianglesAroundVertex (PointID id) override
 Returns the set of triangles adjacent to a given vertex. More...
 
const TrianglesAroundEdgegetTrianglesAroundEdge (EdgeID id) override
 Returns the set of triangles adjacent to a given edge. More...
 
int getVertexIndexInTriangle (const Triangle &t, PointID vertexIndex) const override
 Returns the index (either 0, 1 ,2) of the vertex whose global index is vertexIndex. More...
 
int getEdgeIndexInTriangle (const EdgesInTriangle &t, EdgeID edgeIndex) const override
 Returns the index (either 0, 1 ,2) of the edge whose global index is edgeIndex. More...
 
void initTopology ()
 
bool checkTopology () const override
 Checks if the topology is coherent. More...
 
size_t getNumberOfTriangles () const
 Returns the number of triangles in this topology. The difference to getNbTriangles() is that this method does not generate the triangle array if it does not exist. More...
 
size_t getNumberOfElements () const override
 Returns the number of topological element of the current topology. This function avoids to know which topological container is in used. More...
 
const sofa::helper::vector< Triangle > & getTriangleArray ()
 Returns the Triangle array. More...
 
const sofa::helper::vector< EdgesInTriangle > & getEdgesInTriangleArray ()
 Returns the EdgesInTriangle array (i.e. provide the 3 edge indices for each triangle). More...
 
const sofa::helper::vector< TrianglesAroundVertex > & getTrianglesAroundVertexArray ()
 Returns the TrianglesAroundVertex array (i.e. provide the triangles indices adjacent to each vertex). More...
 
const sofa::helper::vector< TrianglesAroundEdge > & getTrianglesAroundEdgeArray ()
 Returns the TrianglesAroundEdge array (i.e. provide the triangles indices adjacent to each edge). More...
 
const sofa::helper::vector< TriangleID > & getTrianglesOnBorder () override
 : Return a list of TriangleID which are on a border. More...
 
const sofa::helper::vector< EdgeID > & getEdgesOnBorder () override
 : Return a list of EdgeID which are on a border. More...
 
const sofa::helper::vector< PointID > & getPointsOnBorder () override
 : Return a vector of PointID which are on a border. More...
 
bool checkConnexity () override
 Checks if the topology has only one connected component. More...
 
size_t getNumberOfConnectedComponent () override
 Returns the number of connected component. More...
 
const VecTriangleID getConnectedElement (TriangleID elem) override
 Returns the set of element indices connected to an input one (i.e. which can be reached by topological links) More...
 
const VecTriangleID getElementAroundElement (TriangleID elem) override
 Returns the set of element indices adjacent to a given element (i.e. sharing a link) More...
 
const VecTriangleID getElementAroundElements (VecTriangleID elems) override
 Returns the set of element indices adjacent to a given list of elements (i.e. sharing a link) More...
 
- Public Member Functions inherited from sofa::component::topology::EdgeSetTopologyContainer
 SOFA_CLASS (EdgeSetTopologyContainer, PointSetTopologyContainer)
 
void init () override
 
void reinit () override
 
sofa::core::topology::TopologyObjectType getTopologyType () const override
 Returns the type of the topology. More...
 
void clear () override
 
void addEdge (index_type a, index_type b) override
 
const SeqEdgesgetEdges () override
 Returns the edge array. More...
 
const Edge getEdge (EdgeID i) override
 Get an Edge from its ID. More...
 
EdgeID getEdgeIndex (PointID v1, PointID v2) override
 Get the index of the edge joining two vertices. More...
 
const EdgesAroundVertexgetEdgesAroundVertex (PointID id) override
 Get the indices of the edges around a vertex. More...
 
void initTopology ()
 
bool checkTopology () const override
 Checks if the topology is coherent. More...
 
size_t getNumberOfEdges () const
 Returns the number of edges in this topology. More...
 
virtual int getNumberConnectedComponents (sofa::helper::vector< EdgeID > &components)
 Returns the number of connected components from the graph containing all edges and give, for each vertex, which component it belongs to (use BOOST GRAPH LIBRAIRY) More...
 
virtual const sofa::helper::vector< Edge > & getEdgeArray ()
 Returns the Edge array. More...
 
Data< sofa::helper::vector< Edge > > & getEdgeDataArray ()
 Returns a reference to the Data of edges array container. More...
 
virtual const sofa::helper::vector< sofa::helper::vector< EdgeID > > & getEdgesAroundVertexArray ()
 Returns the list of Edge indices around each DOF. More...
 
bool hasEdges () const
 
bool hasEdgesAroundVertex () const
 
bool checkConnexity () override
 Checks if the topology has only one connected component. More...
 
size_t getNumberOfConnectedComponent () override
 Returns the number of connected component. More...
 
const VecEdgeID getConnectedElement (EdgeID elem) override
 Returns the set of element indices connected to an input one (i.e. which can be reached by topological links) More...
 
const VecEdgeID getElementAroundElement (EdgeID elem) override
 Returns the set of element indices adjacent to a given element (i.e. sharing a link) More...
 
const VecEdgeID getElementAroundElements (VecEdgeID elems) override
 Returns the set of element indices adjacent to a given list of elements (i.e. sharing a link) More...
 
- Public Member Functions inherited from sofa::component::topology::PointSetTopologyContainer
 SOFA_CLASS (PointSetTopologyContainer, core::topology::TopologyContainer)
 
void init () override
 
const sofa::helper::vector< PointID > & getPoints () const
 
void clear () override
 
void addPoint (double px, double py, double pz) override
 
std::size_t getNbPoints () const override
 Returns the number of vertices in this topology. More...
 
Data< InitTypes::VecCoord > & getPointDataArray ()
 Returns a reference to the Data of points array container. More...
 
void setNbPoints (std::size_t n) override
 Set the number of vertices in this topology. More...
 
bool hasPos () const override
 check if vertices in this topology have positions. More...
 
SReal getPX (index_type i) const override
 Returns the X coordinate of the ith DOF. More...
 
SReal getPY (index_type i) const override
 Returns the Y coordinate of the ith DOF. More...
 
SReal getPZ (index_type i) const override
 Returns the Z coordinate of the ith DOF. More...
 
sofa::core::topology::TopologyObjectType getTopologyType () const override
 Returns the type of the topology. More...
 
bool checkTopology () const override
 Checks if the Topology is coherent. More...
 
void addPoint ()
 add one DOF in this topology (simply increment the number of DOF) More...
 
void addPoints (const std::size_t nPoints)
 add a number of DOFs in this topology (simply increase the number of DOF according to this parameter) More...
 
void removePoint ()
 remove one DOF in this topology (simply decrement the number of DOF) More...
 
void removePoints (const std::size_t nPoints)
 remove a number of DOFs in this topology (simply decrease the number of DOF according to this parameter) More...
 

Protected Member Functions

 TetrahedronSetTopologyContainer ()
 convention triangles in tetra (orientation interior) More...
 
 ~TetrahedronSetTopologyContainer () override
 
void createEdgeSetArray () override
 Creates the EdgeSet array. More...
 
void createTriangleSetArray () override
 Creates the TriangleSet array. More...
 
virtual void createTetrahedronSetArray ()
 Creates the TetrahedronSet array. More...
 
virtual void createEdgesInTetrahedronArray ()
 Creates the array of edge indices for each tetrahedron. More...
 
virtual void createTrianglesInTetrahedronArray ()
 Creates the array of triangle indices for each tetrahedron. More...
 
virtual void createTetrahedraAroundVertexArray ()
 Creates the TetrahedraAroundVertex Array. More...
 
virtual void createTetrahedraAroundEdgeArray ()
 Creates the TetrahedraAroundEdge Array. More...
 
virtual void createTetrahedraAroundTriangleArray ()
 Creates the TetrahedraAroundTriangle Array. More...
 
void clearTetrahedra ()
 
void clearEdgesInTetrahedron ()
 
void clearTrianglesInTetrahedron ()
 
void clearTetrahedraAroundVertex ()
 
void clearTetrahedraAroundEdge ()
 
void clearTetrahedraAroundTriangle ()
 
virtual TetrahedraAroundVertexgetTetrahedraAroundVertexForModification (const PointID vertexIndex)
 Returns a non-const list of tetrahedron indices around a given DOF for subsequent modification. More...
 
virtual TetrahedraAroundEdgegetTetrahedraAroundEdgeForModification (const EdgeID edgeIndex)
 Returns a non-const list of tetrahedron indices around a given edge for subsequent modification. More...
 
virtual TetrahedraAroundTrianglegetTetrahedraAroundTriangleForModification (const TriangleID triangleIndex)
 Returns a non-const list of tetrahedron indices around a given triangle for subsequent modification. More...
 
void updateTopologyEngineGraph () override
 Function creating the data graph linked to d_tetrahedron. More...
 
void setTetrahedronTopologyToDirty ()
 
void cleanTetrahedronTopologyFromDirty ()
 
const boolisTetrahedronTopologyDirty ()
 
- Protected Member Functions inherited from sofa::component::topology::TriangleSetTopologyContainer
 TriangleSetTopologyContainer ()
 
 ~TriangleSetTopologyContainer () override
 
void createEdgeSetArray () override
 Creates the EdgeSet array. More...
 
virtual void createEdgesInTriangleArray ()
 Creates the array of edge indices for each triangle. More...
 
virtual void createTrianglesAroundVertexArray ()
 Creates the TrianglesAroundVertex Array. More...
 
virtual void createTrianglesAroundEdgeArray ()
 Creates the TrianglesAroundEdge Array. More...
 
void clearTriangles ()
 
void clearEdgesInTriangle ()
 
void clearTrianglesAroundVertex ()
 
void clearTrianglesAroundEdge ()
 
void clearBorderElementLists ()
 
virtual TrianglesAroundVertexgetTrianglesAroundVertexForModification (const PointID vertexIndex)
 Returns a non-const list of triangle indices around a given DOF for subsequent modification. More...
 
virtual TrianglesAroundEdgegetTrianglesAroundEdgeForModification (const EdgeID edgeIndex)
 Returns a non-const list of triangle indices around a given edge for subsequent modification. More...
 
void updateTopologyEngineGraph () override
 Function creating the data graph linked to d_triangle. More...
 
void setTriangleTopologyToDirty ()
 
void cleanTriangleTopologyFromDirty ()
 
const boolisTriangleTopologyDirty ()
 
- Protected Member Functions inherited from sofa::component::topology::EdgeSetTopologyContainer
 EdgeSetTopologyContainer ()
 
 ~EdgeSetTopologyContainer () override
 
virtual void createEdgesAroundVertexArray ()
 Creates the EdgesAroundVertex array. More...
 
void clearEdges ()
 
void clearEdgesAroundVertex ()
 
void updateTopologyEngineGraph () override
 Function creating the data graph linked to d_triangle. More...
 
void setEdgeTopologyToDirty ()
 
void cleanEdgeTopologyFromDirty ()
 
const boolisEdgeTopologyDirty ()
 
virtual EdgesAroundVertexgetEdgesAroundVertexForModification (const PointID i)
 Returns a non-const list of Edge indices around the ith DOF for subsequent modification. More...
 
- Protected Member Functions inherited from sofa::component::topology::PointSetTopologyContainer
 PointSetTopologyContainer (std::size_t nPoints=0)
 
 ~PointSetTopologyContainer () override
 
void updateTopologyEngineGraph () override
 Function creating the data graph linked to d_point. More...
 
virtual void updateDataEngineGraph (sofa::core::objectmodel::BaseData &my_Data, std::list< sofa::core::topology::TopologyEngine * > &my_enginesList)
 functions to really update the graph of Data/DataEngines linked to the different Data array, using member variable. More...
 
void setPointTopologyToDirty ()
 
void cleanPointTopologyFromDirty ()
 
const boolisPointTopologyDirty ()
 
void addEngineToList (sofa::core::topology::TopologyEngine *_engine)
 function to add a topologyEngine to the current list of engines. More...
 
virtual void displayDataGraph (sofa::core::objectmodel::BaseData &my_Data)
 functions to display the graph of Data/DataEngines linked to the different Data array, using member variable. More...
 

Friends

class TetrahedronSetTopologyModifier
 
std::ostream & operator<< (std::ostream &out, const TetrahedronSetTopologyContainer &t)
 
std::istream & operator>> (std::istream &in, TetrahedronSetTopologyContainer &t)
 

Attribute details

Data<bool> sofa::component::topology::TetrahedronSetTopologyContainer::d_createTriangleArray

force the creation of triangles

Data< sofa::helper::vector<Tetrahedron> > sofa::component::topology::TetrahedronSetTopologyContainer::d_tetrahedron

provides the set of tetrahedra.

sofa::helper::vector< sofa::helper::vector <std::string> > sofa::component::topology::TetrahedronSetTopologyContainer::m_dataGraph
protected

variables used to display the graph of Data/DataEngines linked to this Data array.

sofa::helper::vector<EdgesInTetrahedron> sofa::component::topology::TetrahedronSetTopologyContainer::m_edgesInTetrahedron
protected

provides the set of edges for each tetrahedron.

sofa::helper::vector< sofa::helper::vector <std::string> > sofa::component::topology::TetrahedronSetTopologyContainer::m_enginesGraph
protected
std::list<sofa::core::topology::TopologyEngine *> sofa::component::topology::TetrahedronSetTopologyContainer::m_enginesList
protected

List of engines related to this specific container.

sofa::helper::vector<TetrahedronID> sofa::component::topology::TetrahedronSetTopologyContainer::m_removedTetraIndex
protected

removed tetrahedron index

sofa::helper::vector< TetrahedraAroundEdge > sofa::component::topology::TetrahedronSetTopologyContainer::m_tetrahedraAroundEdge
protected

for each edge provides the set of tetrahedra adjacent to that edge.

sofa::helper::vector< TetrahedraAroundTriangle > sofa::component::topology::TetrahedronSetTopologyContainer::m_tetrahedraAroundTriangle
protected

for each triangle provides the set of tetrahedra adjacent to that triangle.

sofa::helper::vector< TetrahedraAroundVertex > sofa::component::topology::TetrahedronSetTopologyContainer::m_tetrahedraAroundVertex
protected

for each vertex provides the set of tetrahedra adjacent to that vertex.

bool sofa::component::topology::TetrahedronSetTopologyContainer::m_tetrahedronTopologyDirty
protected

Boolean used to know if the topology Data of this container is dirty.

sofa::helper::vector<TrianglesInTetrahedron> sofa::component::topology::TetrahedronSetTopologyContainer::m_trianglesInTetrahedron
protected

provides the set of triangles for each tetrahedron.

Constructor details

sofa::component::topology::TetrahedronSetTopologyContainer::TetrahedronSetTopologyContainer ( )
protected

convention triangles in tetra (orientation interior)

sofa::component::topology::TetrahedronSetTopologyContainer::~TetrahedronSetTopologyContainer ( )
inlineoverrideprotected

Function details

void sofa::component::topology::TetrahedronSetTopologyContainer::addRemovedTetraIndex ( sofa::helper::vector< TetrahedronID > &  tetrahedra)
void sofa::component::topology::TetrahedronSetTopologyContainer::addTetra ( index_type  a,
index_type  b,
index_type  c,
index_type  d 
)
override
void sofa::component::topology::TetrahedronSetTopologyContainer::addTriangle ( index_type  ,
index_type  ,
index_type   
)
inlineoverride
bool sofa::component::topology::TetrahedronSetTopologyContainer::checkConnexity ( )
override

Checks if the topology has only one connected component.

Get information about connexity of the mesh

Returns
true if only one connected component

Get information about connexity of the mesh

bool sofa::component::topology::TetrahedronSetTopologyContainer::checkTopology ( ) const
override

Checks if the topology is coherent.

Check if the shell arrays are coherent

See also
m_tetrahedron
m_edgesInTetrahedron
m_trianglesInTetrahedron
m_tetrahedraAroundVertex
m_tetrahedraAroundEdge
m_tetrahedraAroundTriangle
void sofa::component::topology::TetrahedronSetTopologyContainer::cleanTetrahedronTopologyFromDirty ( )
protected
void sofa::component::topology::TetrahedronSetTopologyContainer::clear ( )
override

Procedural creation methods

void sofa::component::topology::TetrahedronSetTopologyContainer::clearEdgesInTetrahedron ( )
protected
void sofa::component::topology::TetrahedronSetTopologyContainer::clearTetrahedra ( )
protected
void sofa::component::topology::TetrahedronSetTopologyContainer::clearTetrahedraAroundEdge ( )
protected
void sofa::component::topology::TetrahedronSetTopologyContainer::clearTetrahedraAroundTriangle ( )
protected
void sofa::component::topology::TetrahedronSetTopologyContainer::clearTetrahedraAroundVertex ( )
protected
void sofa::component::topology::TetrahedronSetTopologyContainer::clearTrianglesInTetrahedron ( )
protected
void sofa::component::topology::TetrahedronSetTopologyContainer::createEdgeSetArray ( )
overrideprotectedvirtual

Creates the EdgeSet array.

Create the set of edges when needed.

Reimplemented from sofa::component::topology::EdgeSetTopologyContainer.

void sofa::component::topology::TetrahedronSetTopologyContainer::createEdgesInTetrahedronArray ( )
protectedvirtual

Creates the array of edge indices for each tetrahedron.

This function is only called if the EdgesInTetrahedrone array is required. m_edgesInTetrahedron[i] contains the 6 indices of the 6 edges of each tetrahedron The number of each edge is the following : edge 0 links vertex 0 and 1, edge 1 links vertex 0 and 2, edge 2 links vertex 0 and 3, edge 3 links vertex 1 and 2, edge 4 links vertex 1 and 3, edge 5 links vertex 2 and 3

void sofa::component::topology::TetrahedronSetTopologyContainer::createTetrahedraAroundEdgeArray ( )
protectedvirtual

Creates the TetrahedraAroundEdge Array.

This function is only called if the TetrahedraAroundEdge array is required. m_tetrahedraAroundEdge[i] contains the indices of all tetrahedra adjacent to the ith edge.

void sofa::component::topology::TetrahedronSetTopologyContainer::createTetrahedraAroundTriangleArray ( )
protectedvirtual

Creates the TetrahedraAroundTriangle Array.

This function is only called if the TetrahedraAroundTriangle array is required. m_tetrahedraAroundTriangle[i] contains the indices of all tetrahedra adjacent to the ith triangle.

void sofa::component::topology::TetrahedronSetTopologyContainer::createTetrahedraAroundVertexArray ( )
protectedvirtual

Creates the TetrahedraAroundVertex Array.

This function is only called if the TetrahedraAroundVertex array is required. m_tetrahedraAroundVertex[i] contains the indices of all tetrahedra adjacent to the ith vertex.

void sofa::component::topology::TetrahedronSetTopologyContainer::createTetrahedronSetArray ( )
protectedvirtual

Creates the TetrahedronSet array.

This function must be implemented by derived classes to create a list of tetrahedron.

void sofa::component::topology::TetrahedronSetTopologyContainer::createTriangleSetArray ( )
overrideprotectedvirtual

Creates the TriangleSet array.

Create the array of Triangles

Reimplemented from sofa::component::topology::TriangleSetTopologyContainer.

void sofa::component::topology::TetrahedronSetTopologyContainer::createTrianglesInTetrahedronArray ( )
protectedvirtual

Creates the array of triangle indices for each tetrahedron.

This function is only called if the TrianglesInTetrahedron array is required. m_trianglesInTetrahedron[i] contains the 4 indices of the 4 triangles composing the ith tetrahedron.

const TetrahedronSetTopologyContainer::VecTetraID sofa::component::topology::TetrahedronSetTopologyContainer::getConnectedElement ( TetraID  elem)
override

Returns the set of element indices connected to an input one (i.e. which can be reached by topological links)

int sofa::component::topology::TetrahedronSetTopologyContainer::getEdgeIndexInTetrahedron ( const EdgesInTetrahedron t,
EdgeID  edgeIndex 
) const
override

Returns the index (either 0, 1 ,2, 3, 4 or 5) of the edge whose global index is edgeIndex.

Parameters
Refto an EdgesInTetrahedron.
Idof an edge.
Returns
the position of this edge in the tetrahedron (i.e. either 0, 1, 2, 3, 4 or 5).
-1 if none.
const TetrahedronSetTopologyContainer::EdgesInTetrahedron & sofa::component::topology::TetrahedronSetTopologyContainer::getEdgesInTetrahedron ( TetraID  id)
override

Returns the 6 edges adjacent to a given tetrahedron.

Parameters
IDof a tetrahedron.
Returns
EdgesInTetrahedron list composing the input tetrahedron.
const sofa::helper::vector< TetrahedronSetTopologyContainer::EdgesInTetrahedron > & sofa::component::topology::TetrahedronSetTopologyContainer::getEdgesInTetrahedronArray ( )

Returns the EdgesInTetrahedron array (i.e. provide the 6 edge indices for each tetrahedron).

const TetrahedronSetTopologyContainer::VecTetraID sofa::component::topology::TetrahedronSetTopologyContainer::getElementAroundElement ( TetraID  elem)
override

Returns the set of element indices adjacent to a given element (i.e. sharing a link)

const TetrahedronSetTopologyContainer::VecTetraID sofa::component::topology::TetrahedronSetTopologyContainer::getElementAroundElements ( VecTetraID  elems)
override

Returns the set of element indices adjacent to a given list of elements (i.e. sharing a link)

TetrahedronSetTopologyContainer::Edge sofa::component::topology::TetrahedronSetTopologyContainer::getLocalEdgesInTetrahedron ( const EdgeID  i) const
override

Returns for each index (between 0 and 5) the two vertex indices that are adjacent to that edge.

TetrahedronSetTopologyContainer::Triangle sofa::component::topology::TetrahedronSetTopologyContainer::getLocalTrianglesInTetrahedron ( const TriangleID  i) const
override

Returns for each index (between 0 and 3) the three local vertices indices that are adjacent to that triangle.

size_t sofa::component::topology::TetrahedronSetTopologyContainer::getNumberOfConnectedComponent ( )
override

Returns the number of connected component.

size_t sofa::component::topology::TetrahedronSetTopologyContainer::getNumberOfElements ( ) const
overridevirtual

Returns the number of topological element of the current topology. This function avoids to know which topological container is in used.

Reimplemented from sofa::component::topology::EdgeSetTopologyContainer.

size_t sofa::component::topology::TetrahedronSetTopologyContainer::getNumberOfTetrahedra ( ) const

Returns the number of tetrahedra in this topology. The difference to getNbTetrahedra() is that this method does not generate the tetra array if it does not exist.

const TetrahedronSetTopologyContainer::VecTetraID sofa::component::topology::TetrahedronSetTopologyContainer::getOppositeElement ( TetraID  elemID)

Returns the set of element indices adjacent to a given element with direct link from n-1 order element type (i.e triangle for tetrahedron)

sofa::helper::vector< TetrahedronSetTopologyContainer::TetrahedronID > & sofa::component::topology::TetrahedronSetTopologyContainer::getRemovedTetraIndex ( )
const SeqTetrahedra& sofa::component::topology::TetrahedronSetTopologyContainer::getTetrahedra ( )
inlineoverride

Returns the tetrahedra array.

BaseMeshTopology API

const TetrahedronSetTopologyContainer::TetrahedraAroundEdge & sofa::component::topology::TetrahedronSetTopologyContainer::getTetrahedraAroundEdge ( EdgeID  id)
override

Returns the set of tetrahedra adjacent to a given edge.

Parameters
IDof an edge.
Returns
TetrahedraAroundVertex list around the input edge.
const sofa::helper::vector< TetrahedronSetTopologyContainer::TetrahedraAroundEdge > & sofa::component::topology::TetrahedronSetTopologyContainer::getTetrahedraAroundEdgeArray ( )

Returns the TetrahedraAroundEdge array (i.e. provide the tetrahedron indices adjacent to each edge).

TetrahedronSetTopologyContainer::TetrahedraAroundEdge & sofa::component::topology::TetrahedronSetTopologyContainer::getTetrahedraAroundEdgeForModification ( const EdgeID  edgeIndex)
protectedvirtual

Returns a non-const list of tetrahedron indices around a given edge for subsequent modification.

Returns
TetrahedraAroundEdge lists in non-const.
See also
getTetrahedraAroundEdge()
const TetrahedronSetTopologyContainer::TetrahedraAroundTriangle & sofa::component::topology::TetrahedronSetTopologyContainer::getTetrahedraAroundTriangle ( TriangleID  id)
override

Returns the set of tetrahedra adjacent to a given triangle.

Parameters
IDof a triangle.
Returns
TetrahedraAroundVertex list around the input triangle.
const sofa::helper::vector< TetrahedronSetTopologyContainer::TetrahedraAroundTriangle > & sofa::component::topology::TetrahedronSetTopologyContainer::getTetrahedraAroundTriangleArray ( )

Returns the TetrahedraAroundTriangle array (i.e. provide the tetrahedron indices adjacent to each triangle).

TetrahedronSetTopologyContainer::TetrahedraAroundTriangle & sofa::component::topology::TetrahedronSetTopologyContainer::getTetrahedraAroundTriangleForModification ( const TriangleID  triangleIndex)
protectedvirtual

Returns a non-const list of tetrahedron indices around a given triangle for subsequent modification.

Returns
TetrahedraAroundTriangle lists in non-const.
See also
getTetrahedraAroundTriangle()
const TetrahedronSetTopologyContainer::TetrahedraAroundVertex & sofa::component::topology::TetrahedronSetTopologyContainer::getTetrahedraAroundVertex ( PointID  id)
override

Returns the set of tetrahedra adjacent to a given vertex.

Parameters
IDof a vertex.
Returns
TetrahedraAroundVertex list around the input vertex.
const sofa::helper::vector< TetrahedronSetTopologyContainer::TetrahedraAroundVertex > & sofa::component::topology::TetrahedronSetTopologyContainer::getTetrahedraAroundVertexArray ( )

Returns the TetrahedraAroundVertex array (i.e. provide the tetrahedron indices adjacent to each vertex).

TetrahedronSetTopologyContainer::TetrahedraAroundVertex & sofa::component::topology::TetrahedronSetTopologyContainer::getTetrahedraAroundVertexForModification ( const PointID  vertexIndex)
protectedvirtual

Returns a non-const list of tetrahedron indices around a given DOF for subsequent modification.

Returns
TetrahedraAroundVertex lists in non-const.
See also
getTetrahedraAroundVertex()
const TetrahedronSetTopologyContainer::Tetrahedron sofa::component::topology::TetrahedronSetTopologyContainer::getTetrahedron ( TetraID  i)
override

Returns the tetrahedron corresponding to the TetraID i.

Parameters
IDof a tetrahedron.
Returns
The corresponding tetrahderon.
const sofa::helper::vector< TetrahedronSetTopologyContainer::Tetrahedron > & sofa::component::topology::TetrahedronSetTopologyContainer::getTetrahedronArray ( )

Returns the Tetrahedron array.

Data< sofa::helper::vector<Tetrahedron> >& sofa::component::topology::TetrahedronSetTopologyContainer::getTetrahedronDataArray ( )
inline

Returns a reference to the Data of tetrahedra array container.

TetrahedronSetTopologyContainer::TetrahedronID sofa::component::topology::TetrahedronSetTopologyContainer::getTetrahedronIndex ( PointID  v1,
PointID  v2,
PointID  v3,
PointID  v4 
)
override

Returns the indices of a tetrahedron given four vertex indices.

Parameters
thefour vertex indices.
Returns
the ID of the corresponding tetrahedron.
InvalidID if none
sofa::core::topology::TopologyObjectType sofa::component::topology::TetrahedronSetTopologyContainer::getTopologyType ( ) const
inlineoverride

Returns the type of the topology.

int sofa::component::topology::TetrahedronSetTopologyContainer::getTriangleIndexInTetrahedron ( const TrianglesInTetrahedron t,
TriangleID  triangleIndex 
) const
override

Returns the index (either 0, 1 ,2 or 3) of the triangle whose global index is triangleIndex.

Parameters
Refto a TrianglesInTetrahedron.
Idof a triangle.
Returns
the position of this triangle in the tetrahedron (i.e. either 0, 1, 2 or 3).
-1 if none.
const TetrahedronSetTopologyContainer::TrianglesInTetrahedron & sofa::component::topology::TetrahedronSetTopologyContainer::getTrianglesInTetrahedron ( TetraID  id)
override

Returns the 4 triangles adjacent to a given tetrahedron.

Parameters
IDof a tetrahedron.
Returns
TrianglesInTetrahedron list composing the input tetrahedron.
const sofa::helper::vector< TetrahedronSetTopologyContainer::TrianglesInTetrahedron > & sofa::component::topology::TetrahedronSetTopologyContainer::getTrianglesInTetrahedronArray ( )

Returns the TrianglesInTetrahedron array (i.e. provide the 4 triangle indices for each tetrahedron).

int sofa::component::topology::TetrahedronSetTopologyContainer::getVertexIndexInTetrahedron ( const Tetrahedron t,
PointID  vertexIndex 
) const
override

Returns the index (either 0, 1 ,2 or 3) of the vertex whose global index is vertexIndex.

Parameters
Refto a Tetrahedron.
Idof a vertex.
Returns
the position of this vertex in the tetrahedron (i.e. either 0, 1, 2 or 3).
-1 if none.
bool sofa::component::topology::TetrahedronSetTopologyContainer::hasEdgesInTetrahedron ( ) const
bool sofa::component::topology::TetrahedronSetTopologyContainer::hasTetrahedra ( ) const
bool sofa::component::topology::TetrahedronSetTopologyContainer::hasTetrahedraAroundEdge ( ) const
bool sofa::component::topology::TetrahedronSetTopologyContainer::hasTetrahedraAroundTriangle ( ) const
bool sofa::component::topology::TetrahedronSetTopologyContainer::hasTetrahedraAroundVertex ( ) const
bool sofa::component::topology::TetrahedronSetTopologyContainer::hasTrianglesInTetrahedron ( ) const
void sofa::component::topology::TetrahedronSetTopologyContainer::init ( void  )
override
void sofa::component::topology::TetrahedronSetTopologyContainer::initTopology ( )

Method called by component Init method. Will create all the topology neighboorhood buffers and call.

Dynamic Topology API

See also
TriangleSetTopologyContainer::initTopology()
const bool& sofa::component::topology::TetrahedronSetTopologyContainer::isTetrahedronTopologyDirty ( )
inlineprotected
void sofa::component::topology::TetrahedronSetTopologyContainer::setTetrahedronTopologyToDirty ( )
protected

Use a specific boolean

See also
m_tetrahedronTopologyDirty in order to know if topology Data is dirty or not. Set/Get function access to this boolean
sofa::component::topology::TetrahedronSetTopologyContainer::SOFA_CLASS ( TetrahedronSetTopologyContainer  ,
TriangleSetTopologyContainer   
)
void sofa::component::topology::TetrahedronSetTopologyContainer::updateTopologyEngineGraph ( )
overrideprotected

Function creating the data graph linked to d_tetrahedron.

Related details

std::ostream& operator<< ( std::ostream &  out,
const TetrahedronSetTopologyContainer t 
)
friend
std::istream& operator>> ( std::istream &  in,
TetrahedronSetTopologyContainer t 
)
friend
friend class TetrahedronSetTopologyModifier
friend