SOFA API  df6198ac
Open source framework for multi-physics simuation
sofa::core::topology::BaseMeshTopology Class Referenceabstract

#include <BaseMeshTopology.h>

Inheritance diagram for sofa::core::topology::BaseMeshTopology:

Protected Attributes

sofa::core::objectmodel::DataFileName fileTopology
 
- Protected Attributes inherited from sofa::core::objectmodel::BaseObject
SingleLink< BaseObject, BaseContext, BaseLink::FLAG_DOUBLELINKl_context
 
LinkSlaves l_slaves
 
SingleLink< BaseObject, BaseObject, BaseLink::FLAG_DOUBLELINKl_master
 
- Protected Attributes inherited from sofa::core::objectmodel::Base
std::map< std::string, sofa::core::DataTrackerCallbackm_internalEngine
 
VecData m_vecData
 List of fields (Data instances) More...
 
MapData m_aliasData
 name -> Data multi-map (includes names and aliases) More...
 
VecLink m_vecLink
 List of links. More...
 
MapLink m_aliasLink
 name -> Link multi-map (includes names and aliases) More...
 

Public Member Functions

 SOFA_ABSTRACT_CLASS (BaseMeshTopology, core::topology::Topology)
 
void init () override
 Initialization method called at graph creation and modification, during top-down traversal. More...
 
virtual bool load (const char *filename)
 
virtual std::string getFilename () const
 
virtual EdgeID getEdgeIndex (PointID v1, PointID v2)
 Returns the index of the edge joining vertex v1 and vertex v2; returns InvalidID if no edge exists. More...
 
virtual TriangleID getTriangleIndex (PointID v1, PointID v2, PointID v3)
 Returns the index of the triangle given three vertex indices; returns InvalidID if no triangle exists. More...
 
virtual QuadID getQuadIndex (PointID v1, PointID v2, PointID v3, PointID v4)
 Returns the index of the quad given four vertex indices; returns InvalidID if no quad exists. More...
 
virtual TetrahedronID getTetrahedronIndex (PointID v1, PointID v2, PointID v3, PointID v4)
 Returns the index of the tetrahedron given four vertex indices; returns InvalidID if no tetrahedron exists. More...
 
virtual HexahedronID getHexahedronIndex (PointID v1, PointID v2, PointID v3, PointID v4, PointID v5, PointID v6, PointID v7, PointID v8)
 Returns the index of the hexahedron given eight vertex indices; returns InvalidID if no hexahedron exists. More...
 
virtual int getVertexIndexInTriangle (const Triangle &t, PointID vertexIndex) const
 
virtual int getEdgeIndexInTriangle (const EdgesInTriangle &t, EdgeID edgeIndex) const
 
virtual int getVertexIndexInQuad (const Quad &t, PointID vertexIndex) const
 
virtual int getEdgeIndexInQuad (const EdgesInQuad &t, EdgeID edgeIndex) const
 
virtual int getVertexIndexInTetrahedron (const Tetra &t, PointID vertexIndex) const
 
virtual int getEdgeIndexInTetrahedron (const EdgesInTetrahedron &t, EdgeID edgeIndex) const
 
virtual int getTriangleIndexInTetrahedron (const TrianglesInTetrahedron &t, TriangleID triangleIndex) const
 
virtual int getVertexIndexInHexahedron (const Hexa &t, PointID vertexIndex) const
 
virtual int getEdgeIndexInHexahedron (const EdgesInHexahedron &t, EdgeID edgeIndex) const
 
virtual int getQuadIndexInHexahedron (const QuadsInHexahedron &t, QuadID quadIndex) const
 
virtual Edge getLocalEdgesInTetrahedron (const PointID i) const
 Returns for each index (between 0 and 5) the two vertex indices that are adjacent to that edge. More...
 
virtual Triangle getLocalTrianglesInTetrahedron (const PointID i) const
 Returns for each index (between 0 and 3) the three local vertices indices that are adjacent to that triangle. More...
 
virtual Edge getLocalEdgesInHexahedron (const PointID i) const
 Returns for each index (between 0 and 12) the two vertex indices that are adjacent to that edge. More...
 
virtual Quad getLocalQuadsInHexahedron (const PointID i) const
 Returns for each index (between 0 and 6) the four vertices indices that are adjacent to that quad. More...
 
virtual int getRevision () const
 
virtual void reOrientateTriangle (TriangleID id)
 Will change order of vertices in triangle: t[1] <=> t[2]. More...
 
virtual const sofa::type::vector< TriangleID > & getTrianglesOnBorder ()
 Returns the set of triangles on the border of the triangulation. More...
 
virtual const sofa::type::vector< EdgeID > & getEdgesOnBorder ()
 Returns the set of edges on the border of the triangulation. More...
 
virtual const sofa::type::vector< PointID > & getPointsOnBorder ()
 Returns the set of points on the border of the triangulation. More...
 
bool insertInNode (objectmodel::BaseNode *node) override
 
bool removeInNode (objectmodel::BaseNode *node) override
 
virtual const SeqEdgesgetEdges ()=0
 
virtual const SeqTrianglesgetTriangles ()=0
 
virtual const SeqQuadsgetQuads ()=0
 
virtual const SeqTetrahedragetTetrahedra ()=0
 
virtual const SeqHexahedragetHexahedra ()=0
 
virtual Size getNbEdges ()
 
virtual Size getNbTriangles ()
 
virtual Size getNbQuads ()
 
virtual Size getNbTetrahedra ()
 
virtual Size getNbHexahedra ()
 
virtual const Edge getEdge (EdgeID i)
 
virtual const Triangle getTriangle (TriangleID i)
 
virtual const Quad getQuad (QuadID i)
 
virtual const Tetra getTetrahedron (TetraID i)
 
virtual const Hexa getHexahedron (HexaID i)
 
virtual sofa::geometry::ElementType getTopologyType () const =0
 Type of higher topology element contains in this container. More...
 
virtual Size getNbTetras ()
 
virtual Size getNbHexas ()
 
virtual Tetra getTetra (TetraID i)
 
virtual Hexa getHexa (HexaID i)
 
virtual const SeqTetrahedragetTetras ()
 
virtual const SeqHexahedragetHexas ()
 
neighbors queries

Returns the set of edges adjacent to a given vertex.

virtual const EdgesAroundVertexgetEdgesAroundVertex (PointID i)
 Returns the set of edges adjacent to a given vertex. More...
 
virtual const EdgesInTrianglegetEdgesInTriangle (TriangleID i)
 Returns the set of edges adjacent to a given triangle. More...
 
virtual const EdgesInQuadgetEdgesInQuad (QuadID i)
 Returns the set of edges adjacent to a given quad. More...
 
virtual const EdgesInTetrahedrongetEdgesInTetrahedron (TetraID i)
 Returns the set of edges adjacent to a given tetrahedron. More...
 
virtual const EdgesInHexahedrongetEdgesInHexahedron (HexaID i)
 Returns the set of edges adjacent to a given hexahedron. More...
 
virtual const TrianglesAroundVertexgetTrianglesAroundVertex (PointID i)
 Returns the set of triangles adjacent to a given vertex. More...
 
virtual const TrianglesAroundEdgegetTrianglesAroundEdge (EdgeID i)
 Returns the set of triangles adjacent to a given edge. More...
 
virtual const TrianglesInTetrahedrongetTrianglesInTetrahedron (TetraID i)
 Returns the set of triangles adjacent to a given tetrahedron. More...
 
virtual const QuadsAroundVertexgetQuadsAroundVertex (PointID i)
 Returns the set of quads adjacent to a given vertex. More...
 
virtual const QuadsAroundEdgegetQuadsAroundEdge (EdgeID i)
 Returns the set of quads adjacent to a given edge. More...
 
virtual const QuadsInHexahedrongetQuadsInHexahedron (HexaID i)
 Returns the set of quads adjacent to a given hexahedron. More...
 
virtual const TetrahedraAroundVertexgetTetrahedraAroundVertex (PointID i)
 Returns the set of tetrahedra adjacent to a given vertex. More...
 
virtual const TetrahedraAroundEdgegetTetrahedraAroundEdge (EdgeID i)
 Returns the set of tetrahedra adjacent to a given edge. More...
 
virtual const TetrahedraAroundTrianglegetTetrahedraAroundTriangle (TriangleID i)
 Returns the set of tetrahedra adjacent to a given triangle. More...
 
virtual const HexahedraAroundVertexgetHexahedraAroundVertex (PointID i)
 Returns the set of hexahedra adjacent to a given vertex. More...
 
virtual const HexahedraAroundEdgegetHexahedraAroundEdge (EdgeID i)
 Returns the set of hexahedra adjacent to a given edge. More...
 
virtual const HexahedraAroundQuadgetHexahedraAroundQuad (QuadID i)
 Returns the set of hexahedra adjacent to a given quad. More...
 
virtual const VerticesAroundVertex getVerticesAroundVertex (PointID i)
 Returns the set of vertices adjacent to a given vertex (i.e. sharing an edge) More...
 
virtual const sofa::type::vector< IndexgetElementAroundElement (Index elem)
 Returns the set of element indices adjacent to a given element (i.e. sharing a link) More...
 
virtual const sofa::type::vector< IndexgetElementAroundElements (sofa::type::vector< Index > elems)
 Returns the set of element indices adjacent to a given list of elements (i.e. sharing a link) More...
 
Deprecated names, for backward-compatibility
const SeqLinesgetLines ()
 
Size getNbLines ()
 
Line getLine (LineID i)
 
Initial points accessors (only available if the topology was loaded from a file containing this information).

Note that this data is only used for initialization and is not maintained afterwards (i.e. topological changes may not be applied)

bool hasPos () const override
 
SReal getPX (Index) const override
 
SReal getPY (Index) const override
 
SReal getPZ (Index) const override
 
virtual void clear ()
 
virtual void addPoint (SReal px, SReal py, SReal pz)
 
virtual void addEdge (Index a, Index b)
 
void addLine (Index a, Index b)
 
virtual void addTriangle (Index a, Index b, Index c)
 
virtual void addQuad (Index a, Index b, Index c, Index d)
 
virtual void addTetra (Index a, Index b, Index c, Index d)
 
virtual void addHexa (Index a, Index b, Index c, Index d, Index e, Index f, Index g, Index h)
 
virtual bool checkConnexity ()
 
virtual bool checkTopology () const
 Checks if the topology is coherent. More...
 
virtual Size getNumberOfConnectedComponent ()
 Returns the number of connected component. More...
 
virtual const sofa::type::vector< IndexgetConnectedElement (Index elem)
 Returns the set of element indices connected to an input one (i.e. which can be reached by topological links) More...
 
virtual std::list< const TopologyChange * >::const_iterator beginChange () const
 Provides an iterator on the first element in the list of TopologyChange objects. More...
 
virtual std::list< const TopologyChange * >::const_iterator endChange () const
 Provides an iterator on the last element in the list of TopologyChange objects. More...
 
virtual std::list< const TopologyChange * >::const_iterator beginStateChange () const
 Provides an iterator on the first element in the list of StateChange objects. More...
 
virtual std::list< const TopologyChange * >::const_iterator endStateChange () const
 Provides an iterator on the last element in the list of StateChange objects. More...
 
- Public Member Functions inherited from sofa::core::topology::Topology
 SOFA_CLASS (Topology, core::objectmodel::BaseObject)
 
bool insertInNode (objectmodel::BaseNode *node) override
 
bool removeInNode (objectmodel::BaseNode *node) override
 
virtual Size getNbPoints () const
 
virtual void setNbPoints (Size)
 
- Public Member Functions inherited from sofa::core::objectmodel::BaseObject
 SOFA_CLASS (BaseObject, Base)
 
virtual void draw (const core::visual::VisualParams *)
 Render internal data of this object, for debugging purposes. More...
 
virtual void computeBBox (const core::ExecParams *, bool=false)
 
void setSrc (const std::string &v, std::vector< std::string > *attributeList=nullptr)
 Sets a source Object and parses it to collect dependent Data. More...
 
void setSrc (const std::string &v, const BaseObject *loader, std::vector< std::string > *attributeList=nullptr)
 
BasefindLinkDestClass (const BaseClass *destType, const std::string &path, const BaseLink *link) override
 
virtual std::string getPathName () const override
 Return the full path name of this object. More...
 
SReal getTime () const
 Current time. More...
 
const BaseContextgetContext () const
 
BaseContextgetContext ()
 
const BaseObjectgetMaster () const
 
BaseObjectgetMaster ()
 
const VecSlavesgetSlaves () const
 
BaseObjectgetSlave (const std::string &name) const
 
virtual void addSlave (BaseObject::SPtr s)
 
virtual void removeSlave (BaseObject::SPtr s)
 
virtual void handleEvent (Event *)
 Handle an event. More...
 
virtual void handleTopologyChange ()
 
virtual void handleTopologyChange (core::topology::Topology *t)
 
void parse (BaseObjectDescription *arg) override
 Parse the given description to assign values to this object's fields and potentially other parameters. More...
 
virtual void bwdInit ()
 Initialization method called at graph creation and modification, during bottom-up traversal. More...
 
virtual void reinit ()
 Update method called when variables used in precomputation are modified. More...
 
void updateInternal ()
 Update method called when variables (used to compute other internal variables) are modified. More...
 
virtual void storeResetState ()
 Save the initial state for later uses in reset() More...
 
virtual void reset ()
 Reset to initial state. More...
 
virtual void cleanup ()
 
- Public Member Functions inherited from sofa::core::objectmodel::Base
virtual const BaseClassgetClass () const
 
void addDeprecatedAttribute (lifecycle::DeprecatedData *attribute)
 
void addUpdateCallback (const std::string &name, std::initializer_list< BaseData * > inputs, std::function< sofa::core::objectmodel::ComponentState(const DataTracker &)> function, std::initializer_list< BaseData * > outputs)
 
void addOutputsToCallback (const std::string &name, std::initializer_list< BaseData * > outputs)
 
const std::string & getName () const
 Accessor to the object name. More...
 
void setName (const std::string &n)
 Set the name of this object. More...
 
void setName (const std::string &n, int counter)
 Set the name of this object, adding an integer counter. More...
 
std::string getTypeName () const
 Get the type name of this object (i.e. class and template types) More...
 
virtual std::string getClassName () const
 Get the class name of this object. More...
 
virtual std::string getTemplateName () const final
 Get the template type names (if any) used to instantiate this object. More...
 
std::string getNameSpaceName () const
 Get the template type names (if any) used to instantiate this object. More...
 
void setDefinitionSourceFileName (const std::string &sourceFileName)
 Set the source filename (where the component is implemented) More...
 
const std::string & getDefinitionSourceFileName () const
 Get the source filename (where the component is implemented) More...
 
void setDefinitionSourceFilePos (const int)
 Set the source location (where the component is implemented) More...
 
int getDefinitionSourceFilePos () const
 Get the source location (where the component is implemented) More...
 
void setInstanciationSourceFileName (const std::string &sourceFileName)
 
const std::string & getInstanciationSourceFileName () const
 
void setInstanciationSourceFilePos (const int)
 
int getInstanciationSourceFilePos () const
 
void addMessage (const sofa::helper::logging::Message &m) const
 
size_t countLoggedMessages (sofa::helper::logging::Message::TypeSet t=sofa::helper::logging::Message::AnyTypes) const
 
const std::deque< sofa::helper::logging::Message > & getLoggedMessages () const
 
const std::string getLoggedMessagesAsString (sofa::helper::logging::Message::TypeSet t=sofa::helper::logging::Message::AnyTypes) const
 
void clearLoggedMessages () const
 
bool notMuted () const
 
const sofa::core::objectmodel::TagSetgetTags () const
 Represents the subsets the object belongs to. More...
 
bool hasTag (Tag t) const
 Return true if the object belong to the given subset. More...
 
void addTag (Tag t)
 Add a subset qualification to the object. More...
 
void removeTag (Tag t)
 Remove a subset qualification to the object. More...
 
ComponentState getComponentState () const
 
bool isComponentStateValid () const
 
virtual bool parseField (const std::string &attribute, const std::string &value)
 Assign one field value (Data or Link) More...
 
virtual bool hasField (const std::string &attribute) const
 Check if a given Data field or Link exists. More...
 
void parseFields (const std::list< std::string > &str)
 Assign the field values stored in the given list of name + value pairs of strings. More...
 
virtual void parseFields (const std::map< std::string, std::string * > &str)
 Assign the field values stored in the given map of name -> value pairs. More...
 
void writeDatas (std::map< std::string, std::string * > &str)
 Write the current field values to the given map of name -> value pairs. More...
 
void writeDatas (std::ostream &out, const std::string &separator=" ")
 
BaseDatafindData (const std::string &name) const
 
std::vector< BaseData * > findGlobalField (const std::string &name) const
 Find data fields given a name: several can be found as we look into the alias map. More...
 
BaseLinkfindLink (const std::string &name) const
 
std::vector< BaseLink * > findLinks (const std::string &name) const
 Find link fields given a name: several can be found as we look into the alias map. More...
 
virtual void updateLinks (bool logErrors=true)
 Update pointers in case the pointed-to objects have appeared. More...
 
template<class T >
BaseData::BaseInitData initData (::sofa::core::objectmodel::Data< T > *field, const char *name, const char *help, ::sofa::core::objectmodel::BaseData::DataFlags dataflags)
 Helper method used to initialize a data field containing a value of type T. More...
 
template<class T >
BaseData::BaseInitData initData (Data< T > *field, const char *name, const char *help, bool isDisplayed=true, bool isReadOnly=false)
 Helper method used to initialize a data field containing a value of type T. More...
 
template<class T >
Data< T >::InitData initData (Data< T > *field, const T &value, const char *name, const char *help, bool isDisplayed=true, bool isReadOnly=false)
 Helper method used to initialize a data field containing a value of type T. More...
 
void addData (BaseData *f, const std::string &name)
 
void addData (BaseData *f)
 
void removeData (BaseData *f)
 Remove a data field. More...
 
void addAlias (BaseData *field, const char *alias)
 Add an alias to a Data. More...
 
void addLink (BaseLink *l)
 Add a link. More...
 
void addAlias (BaseLink *link, const char *alias)
 Add an alias to a Link. More...
 
const VecDatagetDataFields () const
 Accessor to the vector containing all the fields of this object. More...
 
const MapDatagetDataAliases () const
 Accessor to the map containing all the aliases of this object. More...
 
const VecLinkgetLinks () const
 Accessor to the vector containing all the fields of this object. More...
 
const MapLinkgetLinkAliases () const
 Accessor to the map containing all the aliases of this object. More...
 
virtual bool findDataLinkDest (BaseData *&ptr, const std::string &path, const BaseLink *link)
 
template<class T >
bool findLinkDest (T *&ptr, const std::string &path, const BaseLink *link)
 

Protected Member Functions

 BaseMeshTopology ()
 
- Protected Member Functions inherited from sofa::core::topology::Topology
 Topology ()
 
virtual ~Topology ()
 
- Protected Member Functions inherited from sofa::core::objectmodel::BaseObject
 BaseObject ()
 
 ~BaseObject () override
 
virtual void doUpdateInternal ()
 Implementation of the internal update. More...
 
void changeContextLink (BaseContext *before, BaseContext *&after)
 
void changeSlavesLink (BaseObject::SPtr ptr, std::size_t, bool add)
 This method insures that slaves objects have master and context links set correctly. More...
 
void trackInternalData (const BaseData &data)
 Method called to add the Data to the DataTracker (listing the Data to track) More...
 
void cleanTracker ()
 
bool hasDataChanged (const BaseData &data)
 Method called to know if a tracked Data has changed. More...
 
- Protected Member Functions inherited from sofa::core::objectmodel::Base
 Base ()
 
virtual ~Base ()
 
void initData0 (BaseData *field, BaseData::BaseInitData &res, const char *name, const char *help, bool isDisplayed=true, bool isReadOnly=false)
 Helper method used by initData() More...
 
void initData0 (BaseData *field, BaseData::BaseInitData &res, const char *name, const char *help, BaseData::DataFlags dataFlags)
 Helper method used by initData() More...
 
template<class T >
void initData0 (Data< T > *field, typename Data< T >::InitData &res, const T &value, const char *name, const char *help, bool isDisplayed=true, bool isReadOnly=false)
 Helper method used by initData() More...
 
typedef sofa::type::fixed_array< EdgeID, 3 > EdgesInTriangle
 
typedef sofa::type::fixed_array< EdgeID, 4 > EdgesInQuad
 
typedef sofa::type::fixed_array< TriangleID, 4 > TrianglesInTetrahedron
 
typedef sofa::type::fixed_array< EdgeID, 6 > EdgesInTetrahedron
 
typedef sofa::type::fixed_array< QuadID, 6 > QuadsInHexahedron
 
typedef sofa::type::fixed_array< EdgeID, 12 > EdgesInHexahedron
 
static constexpr EdgesInTriangle InvalidEdgesInTriangles = type::makeHomogeneousArray<EdgesInTriangle>(sofa::InvalidID)
 
static constexpr EdgesInQuad InvalidEdgesInQuad = type::makeHomogeneousArray<EdgesInQuad>(sofa::InvalidID)
 
static constexpr TrianglesInTetrahedron InvalidTrianglesInTetrahedron = type::makeHomogeneousArray<TrianglesInTetrahedron>(sofa::InvalidID)
 
static constexpr EdgesInTetrahedron InvalidEdgesInTetrahedron = type::makeHomogeneousArray<EdgesInTetrahedron>(sofa::InvalidID)
 
static constexpr QuadsInHexahedron InvalidQuadsInHexahedron = type::makeHomogeneousArray<QuadsInHexahedron>(sofa::InvalidID)
 
static constexpr EdgesInHexahedron InvalidEdgesInHexahedron = type::makeHomogeneousArray<EdgesInHexahedron>(sofa::InvalidID)
 

Additional Inherited Members

- Public Attributes inherited from sofa::core::objectmodel::BaseObject
Data< boolf_listening
 if true, handle the events, otherwise ignore the events More...
 
- Public Attributes inherited from sofa::core::objectmodel::Base
std::vector< lifecycle::DeprecatedData * > m_oldAttributes
 
Data< int > d_messageLogCount
 
Data< std::string > name
 Name of the object. More...
 
Data< boolf_printLog
 if true, emits extra messages at runtime. More...
 
Data< sofa::core::objectmodel::TagSetf_tags
 list of the subsets the objet belongs to More...
 
Data< sofa::type::BoundingBoxf_bbox
 this object bounding box More...
 
Data< sofa::core::objectmodel::ComponentStated_componentState
 the object state More...
 
std::string m_definitionSourceFileName {""}
 
int m_definitionSourceFilePos {-1}
 
std::string m_instanciationSourceFileName {""}
 
int m_instanciationSourceFilePos {-1}
 
- Static Public Attributes inherited from sofa::core::topology::Topology
static constexpr Index InvalidID = sofa::InvalidID
 
static const auto InvalidSet = sofa::topology::InvalidSet
 
static constexpr auto InvalidEdge = sofa::topology::InvalidEdge
 
static constexpr auto InvalidTriangle = sofa::topology::InvalidTriangle
 
static constexpr auto InvalidQuad = sofa::topology::InvalidQuad
 
static constexpr auto InvalidTetrahedron = sofa::topology::InvalidTetrahedron
 
static constexpr auto InvalidPentahedron = sofa::topology::InvalidPentahedron
 
static constexpr auto InvalidHexahedron = sofa::topology::InvalidHexahedron
 
static constexpr auto InvalidPyramid = sofa::topology::InvalidPyramid
 
- Static Public Member Functions inherited from sofa::core::objectmodel::BaseObject
template<class T >
static bool canCreate (T *, BaseContext *, BaseObjectDescription *)
 Pre-construction check method called by ObjectFactory. More...
 
template<class T >
static T::SPtr create (T *, BaseContext *context, BaseObjectDescription *arg)
 Construction method called by ObjectFactory. More...
 
- Static Public Member Functions inherited from sofa::core::objectmodel::Base
static const BaseClassGetClass ()
 
template<class T >
static std::string shortName (const T *ptr=nullptr, BaseObjectDescription *=nullptr)
 

Attribute details

◆ fileTopology

sofa::core::objectmodel::DataFileName sofa::core::topology::BaseMeshTopology::fileTopology
protected

◆ InvalidEdgesInHexahedron

constexpr EdgesInHexahedron sofa::core::topology::BaseMeshTopology::InvalidEdgesInHexahedron = type::makeHomogeneousArray<EdgesInHexahedron>(sofa::InvalidID)
staticconstexpr

◆ InvalidEdgesInQuad

constexpr EdgesInQuad sofa::core::topology::BaseMeshTopology::InvalidEdgesInQuad = type::makeHomogeneousArray<EdgesInQuad>(sofa::InvalidID)
staticconstexpr

◆ InvalidEdgesInTetrahedron

constexpr EdgesInTetrahedron sofa::core::topology::BaseMeshTopology::InvalidEdgesInTetrahedron = type::makeHomogeneousArray<EdgesInTetrahedron>(sofa::InvalidID)
staticconstexpr

◆ InvalidEdgesInTriangles

constexpr EdgesInTriangle sofa::core::topology::BaseMeshTopology::InvalidEdgesInTriangles = type::makeHomogeneousArray<EdgesInTriangle>(sofa::InvalidID)
staticconstexpr

◆ InvalidQuadsInHexahedron

constexpr QuadsInHexahedron sofa::core::topology::BaseMeshTopology::InvalidQuadsInHexahedron = type::makeHomogeneousArray<QuadsInHexahedron>(sofa::InvalidID)
staticconstexpr

◆ InvalidTrianglesInTetrahedron

constexpr TrianglesInTetrahedron sofa::core::topology::BaseMeshTopology::InvalidTrianglesInTetrahedron = type::makeHomogeneousArray<TrianglesInTetrahedron>(sofa::InvalidID)
staticconstexpr

Constructor details

◆ BaseMeshTopology()

sofa::core::topology::BaseMeshTopology::BaseMeshTopology ( )
protected

Function details

◆ addEdge()

◆ addHexa()

void sofa::core::topology::BaseMeshTopology::addHexa ( Index  a,
Index  b,
Index  c,
Index  d,
Index  e,
Index  f,
Index  g,
Index  h 
)
virtual

◆ addLine()

void sofa::core::topology::BaseMeshTopology::addLine ( Index  a,
Index  b 
)
inline

◆ addPoint()

void sofa::core::topology::BaseMeshTopology::addPoint ( SReal  px,
SReal  py,
SReal  pz 
)
virtual

◆ addQuad()

void sofa::core::topology::BaseMeshTopology::addQuad ( Index  a,
Index  b,
Index  c,
Index  d 
)
virtual

◆ addTetra()

void sofa::core::topology::BaseMeshTopology::addTetra ( Index  a,
Index  b,
Index  c,
Index  d 
)
virtual

◆ addTriangle()

◆ beginChange()

std::list< const TopologyChange * >::const_iterator sofa::core::topology::BaseMeshTopology::beginChange ( ) const
virtual

Provides an iterator on the first element in the list of TopologyChange objects.

Management of topological changes and state changes

Reimplemented in sofa::core::topology::TopologyContainer.

◆ beginStateChange()

std::list< const TopologyChange * >::const_iterator sofa::core::topology::BaseMeshTopology::beginStateChange ( ) const
virtual

Provides an iterator on the first element in the list of StateChange objects.

Reimplemented in sofa::core::topology::TopologyContainer.

◆ checkConnexity()

◆ checkTopology()

◆ clear()

◆ endChange()

std::list< const TopologyChange * >::const_iterator sofa::core::topology::BaseMeshTopology::endChange ( ) const
virtual

Provides an iterator on the last element in the list of TopologyChange objects.

Reimplemented in sofa::core::topology::TopologyContainer.

◆ endStateChange()

std::list< const TopologyChange * >::const_iterator sofa::core::topology::BaseMeshTopology::endStateChange ( ) const
virtual

Provides an iterator on the last element in the list of StateChange objects.

Reimplemented in sofa::core::topology::TopologyContainer.

◆ getConnectedElement()

const vector< BaseMeshTopology::Index > sofa::core::topology::BaseMeshTopology::getConnectedElement ( Index  elem)
virtual

◆ getEdge()

virtual const Edge sofa::core::topology::BaseMeshTopology::getEdge ( EdgeID  i)
inlinevirtual

◆ getEdgeIndex()

Topology::EdgeID sofa::core::topology::BaseMeshTopology::getEdgeIndex ( PointID  v1,
PointID  v2 
)
virtual

Returns the index of the edge joining vertex v1 and vertex v2; returns InvalidID if no edge exists.

Reimplemented in sofa::component::topology::container::constant::MeshTopology.

◆ getEdgeIndexInHexahedron()

int sofa::core::topology::BaseMeshTopology::getEdgeIndexInHexahedron ( const EdgesInHexahedron t,
EdgeID  edgeIndex 
) const
virtual

returns the index (either 0, 1 ,2 ,3, 4, 5, 6, 7, 8, 9, 10, 11) of the edge whose global index is edgeIndex. Returns -1 if none

Reimplemented in sofa::component::topology::container::constant::MeshTopology.

◆ getEdgeIndexInQuad()

int sofa::core::topology::BaseMeshTopology::getEdgeIndexInQuad ( const EdgesInQuad t,
EdgeID  edgeIndex 
) const
virtual

returns the index (either 0, 1 ,2, 3) of the edge whose global index is edgeIndex. Returns -1 if none

Reimplemented in sofa::component::topology::container::constant::MeshTopology.

◆ getEdgeIndexInTetrahedron()

int sofa::core::topology::BaseMeshTopology::getEdgeIndexInTetrahedron ( const EdgesInTetrahedron t,
EdgeID  edgeIndex 
) const
virtual

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

Reimplemented in sofa::component::topology::container::constant::MeshTopology.

◆ getEdgeIndexInTriangle()

int sofa::core::topology::BaseMeshTopology::getEdgeIndexInTriangle ( const EdgesInTriangle t,
EdgeID  edgeIndex 
) const
virtual

returns the index (either 0, 1 ,2) of the edge whose global index is edgeIndex. Returns -1 if none

Reimplemented in sofa::component::topology::container::dynamic::TriangleSetTopologyContainer, and sofa::component::topology::container::constant::MeshTopology.

◆ getEdges()

virtual const SeqEdges& sofa::core::topology::BaseMeshTopology::getEdges ( )
pure virtual

◆ getEdgesAroundVertex()

const BaseMeshTopology::EdgesAroundVertex & sofa::core::topology::BaseMeshTopology::getEdgesAroundVertex ( PointID  i)
virtual

Returns the set of edges adjacent to a given vertex.

Reimplemented in sofa::component::topology::container::constant::MeshTopology.

◆ getEdgesInHexahedron()

const BaseMeshTopology::EdgesInHexahedron & sofa::core::topology::BaseMeshTopology::getEdgesInHexahedron ( HexaID  i)
virtual

◆ getEdgesInQuad()

const BaseMeshTopology::EdgesInQuad & sofa::core::topology::BaseMeshTopology::getEdgesInQuad ( QuadID  i)
virtual

Returns the set of edges adjacent to a given quad.

Reimplemented in sofa::component::topology::container::constant::MeshTopology.

◆ getEdgesInTetrahedron()

const BaseMeshTopology::EdgesInTetrahedron & sofa::core::topology::BaseMeshTopology::getEdgesInTetrahedron ( TetraID  i)
virtual

◆ getEdgesInTriangle()

const BaseMeshTopology::EdgesInTriangle & sofa::core::topology::BaseMeshTopology::getEdgesInTriangle ( TriangleID  i)
virtual

◆ getEdgesOnBorder()

const sofa::type::vector< BaseMeshTopology::EdgeID > & sofa::core::topology::BaseMeshTopology::getEdgesOnBorder ( )
virtual

Returns the set of edges on the border of the triangulation.

Reimplemented in sofa::component::topology::container::dynamic::TriangleSetTopologyContainer.

◆ getElementAroundElement()

◆ getElementAroundElements()

const vector< BaseMeshTopology::Index > sofa::core::topology::BaseMeshTopology::getElementAroundElements ( sofa::type::vector< Index elems)
virtual

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

Reimplemented in sofa::component::topology::container::constant::MeshTopology.

◆ getFilename()

virtual std::string sofa::core::topology::BaseMeshTopology::getFilename ( ) const
inlinevirtual

◆ getHexa()

virtual Hexa sofa::core::topology::BaseMeshTopology::getHexa ( HexaID  i)
inlinevirtual

◆ getHexahedra()

◆ getHexahedraAroundEdge()

const BaseMeshTopology::HexahedraAroundEdge & sofa::core::topology::BaseMeshTopology::getHexahedraAroundEdge ( EdgeID  i)
virtual

Returns the set of hexahedra adjacent to a given edge.

Reimplemented in sofa::component::topology::container::constant::MeshTopology.

◆ getHexahedraAroundQuad()

const BaseMeshTopology::HexahedraAroundQuad & sofa::core::topology::BaseMeshTopology::getHexahedraAroundQuad ( QuadID  i)
virtual

◆ getHexahedraAroundVertex()

const BaseMeshTopology::HexahedraAroundVertex & sofa::core::topology::BaseMeshTopology::getHexahedraAroundVertex ( PointID  i)
virtual

Returns the set of hexahedra adjacent to a given vertex.

Reimplemented in sofa::component::topology::container::constant::MeshTopology.

◆ getHexahedron()

virtual const Hexa sofa::core::topology::BaseMeshTopology::getHexahedron ( HexaID  i)
inlinevirtual

◆ getHexahedronIndex()

Topology::HexahedronID sofa::core::topology::BaseMeshTopology::getHexahedronIndex ( PointID  v1,
PointID  v2,
PointID  v3,
PointID  v4,
PointID  v5,
PointID  v6,
PointID  v7,
PointID  v8 
)
virtual

Returns the index of the hexahedron given eight vertex indices; returns InvalidID if no hexahedron exists.

Reimplemented in sofa::component::topology::container::constant::MeshTopology.

◆ getHexas()

virtual const SeqHexahedra& sofa::core::topology::BaseMeshTopology::getHexas ( )
inlinevirtual

◆ getLine()

Line sofa::core::topology::BaseMeshTopology::getLine ( LineID  i)
inline

◆ getLines()

const SeqLines& sofa::core::topology::BaseMeshTopology::getLines ( )
inline

◆ getLocalEdgesInHexahedron()

BaseMeshTopology::Edge sofa::core::topology::BaseMeshTopology::getLocalEdgesInHexahedron ( const PointID  i) const
virtual

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

Reimplemented in sofa::component::topology::container::constant::MeshTopology.

◆ getLocalEdgesInTetrahedron()

BaseMeshTopology::Edge sofa::core::topology::BaseMeshTopology::getLocalEdgesInTetrahedron ( const PointID  i) const
virtual

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

Reimplemented in sofa::component::topology::container::constant::MeshTopology.

◆ getLocalQuadsInHexahedron()

BaseMeshTopology::Quad sofa::core::topology::BaseMeshTopology::getLocalQuadsInHexahedron ( const PointID  i) const
virtual

Returns for each index (between 0 and 6) the four vertices indices that are adjacent to that quad.

Reimplemented in sofa::component::topology::container::dynamic::HexahedronSetTopologyContainer.

◆ getLocalTrianglesInTetrahedron()

BaseMeshTopology::Triangle sofa::core::topology::BaseMeshTopology::getLocalTrianglesInTetrahedron ( const PointID  i) const
virtual

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

Reimplemented in sofa::component::topology::container::dynamic::TetrahedronSetTopologyContainer.

◆ getNbEdges()

virtual Size sofa::core::topology::BaseMeshTopology::getNbEdges ( )
inlinevirtual

◆ getNbHexahedra()

◆ getNbHexas()

virtual Size sofa::core::topology::BaseMeshTopology::getNbHexas ( )
inlinevirtual

◆ getNbLines()

Size sofa::core::topology::BaseMeshTopology::getNbLines ( )
inline

◆ getNbQuads()

virtual Size sofa::core::topology::BaseMeshTopology::getNbQuads ( )
inlinevirtual

◆ getNbTetrahedra()

virtual Size sofa::core::topology::BaseMeshTopology::getNbTetrahedra ( )
inlinevirtual

◆ getNbTetras()

virtual Size sofa::core::topology::BaseMeshTopology::getNbTetras ( )
inlinevirtual

Bridge from old functions (using Tetra/Tetras and Hexa/Hexas) to new ones

◆ getNbTriangles()

virtual Size sofa::core::topology::BaseMeshTopology::getNbTriangles ( )
inlinevirtual

◆ getNumberOfConnectedComponent()

◆ getPointsOnBorder()

const sofa::type::vector< BaseMeshTopology::PointID > & sofa::core::topology::BaseMeshTopology::getPointsOnBorder ( )
virtual

Returns the set of points on the border of the triangulation.

Reimplemented in sofa::component::topology::container::dynamic::TriangleSetTopologyContainer.

◆ getPX()

SReal sofa::core::topology::BaseMeshTopology::getPX ( Index  ) const
inlineoverridevirtual

Reimplemented from sofa::core::topology::Topology.

◆ getPY()

SReal sofa::core::topology::BaseMeshTopology::getPY ( Index  ) const
inlineoverridevirtual

Reimplemented from sofa::core::topology::Topology.

◆ getPZ()

SReal sofa::core::topology::BaseMeshTopology::getPZ ( Index  ) const
inlineoverridevirtual

Reimplemented from sofa::core::topology::Topology.

◆ getQuad()

virtual const Quad sofa::core::topology::BaseMeshTopology::getQuad ( QuadID  i)
inlinevirtual

◆ getQuadIndex()

Topology::QuadID sofa::core::topology::BaseMeshTopology::getQuadIndex ( PointID  v1,
PointID  v2,
PointID  v3,
PointID  v4 
)
virtual

Returns the index of the quad given four vertex indices; returns InvalidID if no quad exists.

Reimplemented in sofa::component::topology::container::constant::MeshTopology.

◆ getQuadIndexInHexahedron()

int sofa::core::topology::BaseMeshTopology::getQuadIndexInHexahedron ( const QuadsInHexahedron t,
QuadID  quadIndex 
) const
virtual

returns the index (either 0, 1 ,2 ,3, 4, 5) of the quad whose global index is quadIndex. Returns -1 if none

Reimplemented in sofa::component::topology::container::dynamic::HexahedronSetTopologyContainer, and sofa::component::topology::container::constant::MeshTopology.

◆ getQuads()

◆ getQuadsAroundEdge()

const BaseMeshTopology::QuadsAroundEdge & sofa::core::topology::BaseMeshTopology::getQuadsAroundEdge ( EdgeID  i)
virtual

Returns the set of quads adjacent to a given edge.

Returns the set of quad adjacent to a given edge.

Reimplemented in sofa::component::topology::container::constant::MeshTopology.

◆ getQuadsAroundVertex()

const BaseMeshTopology::QuadsAroundVertex & sofa::core::topology::BaseMeshTopology::getQuadsAroundVertex ( PointID  i)
virtual

Returns the set of quads adjacent to a given vertex.

Returns the set of quad adjacent to a given vertex.

Reimplemented in sofa::component::topology::container::constant::MeshTopology.

◆ getQuadsInHexahedron()

const BaseMeshTopology::QuadsInHexahedron & sofa::core::topology::BaseMeshTopology::getQuadsInHexahedron ( HexaID  i)
virtual

Returns the set of quads adjacent to a given hexahedron.

Returns the set of quad adjacent to a given hexahedron.

Reimplemented in sofa::component::topology::container::dynamic::HexahedronSetTopologyContainer, and sofa::component::topology::container::constant::MeshTopology.

◆ getRevision()

virtual int sofa::core::topology::BaseMeshTopology::getRevision ( ) const
inlinevirtual

Get the current revision of this mesh. This can be used to detect changes, however topological changes event should be used whenever possible.

Reimplemented in sofa::core::topology::TopologyContainer, and sofa::component::topology::container::constant::MeshTopology.

◆ getTetra()

virtual Tetra sofa::core::topology::BaseMeshTopology::getTetra ( TetraID  i)
inlinevirtual

◆ getTetrahedra()

◆ getTetrahedraAroundEdge()

const BaseMeshTopology::TetrahedraAroundEdge & sofa::core::topology::BaseMeshTopology::getTetrahedraAroundEdge ( EdgeID  i)
virtual

Returns the set of tetrahedra adjacent to a given edge.

Reimplemented in sofa::component::topology::container::constant::MeshTopology.

◆ getTetrahedraAroundTriangle()

const BaseMeshTopology::TetrahedraAroundTriangle & sofa::core::topology::BaseMeshTopology::getTetrahedraAroundTriangle ( TriangleID  i)
virtual

◆ getTetrahedraAroundVertex()

const BaseMeshTopology::TetrahedraAroundVertex & sofa::core::topology::BaseMeshTopology::getTetrahedraAroundVertex ( PointID  i)
virtual

Returns the set of tetrahedra adjacent to a given vertex.

Reimplemented in sofa::component::topology::container::constant::MeshTopology.

◆ getTetrahedron()

virtual const Tetra sofa::core::topology::BaseMeshTopology::getTetrahedron ( TetraID  i)
inlinevirtual

◆ getTetrahedronIndex()

Topology::TetrahedronID sofa::core::topology::BaseMeshTopology::getTetrahedronIndex ( PointID  v1,
PointID  v2,
PointID  v3,
PointID  v4 
)
virtual

Returns the index of the tetrahedron given four vertex indices; returns InvalidID if no tetrahedron exists.

Reimplemented in sofa::component::topology::container::constant::MeshTopology.

◆ getTetras()

virtual const SeqTetrahedra& sofa::core::topology::BaseMeshTopology::getTetras ( )
inlinevirtual

◆ getTopologyType()

◆ getTriangle()

virtual const Triangle sofa::core::topology::BaseMeshTopology::getTriangle ( TriangleID  i)
inlinevirtual

◆ getTriangleIndex()

Topology::TriangleID sofa::core::topology::BaseMeshTopology::getTriangleIndex ( PointID  v1,
PointID  v2,
PointID  v3 
)
virtual

Returns the index of the triangle given three vertex indices; returns InvalidID if no triangle exists.

Reimplemented in sofa::component::topology::container::dynamic::TriangleSetTopologyContainer, and sofa::component::topology::container::constant::MeshTopology.

◆ getTriangleIndexInTetrahedron()

int sofa::core::topology::BaseMeshTopology::getTriangleIndexInTetrahedron ( const TrianglesInTetrahedron t,
TriangleID  triangleIndex 
) const
virtual

returns the index (either 0, 1 ,2 ,3) of the triangle whose global index is triangleIndex. Returns -1 if none

Reimplemented in sofa::component::topology::container::dynamic::TetrahedronSetTopologyContainer, and sofa::component::topology::container::constant::MeshTopology.

◆ getTriangles()

◆ getTrianglesAroundEdge()

const BaseMeshTopology::TrianglesAroundEdge & sofa::core::topology::BaseMeshTopology::getTrianglesAroundEdge ( EdgeID  i)
virtual

Returns the set of triangles adjacent to a given edge.

Returns the set of triangle adjacent to a given edge.

Reimplemented in sofa::component::topology::container::dynamic::TriangleSetTopologyContainer, and sofa::component::topology::container::constant::MeshTopology.

◆ getTrianglesAroundVertex()

const BaseMeshTopology::TrianglesAroundVertex & sofa::core::topology::BaseMeshTopology::getTrianglesAroundVertex ( PointID  i)
virtual

Returns the set of triangles adjacent to a given vertex.

Returns the set of triangle adjacent to a given vertex.

Reimplemented in sofa::component::topology::container::dynamic::TriangleSetTopologyContainer, and sofa::component::topology::container::constant::MeshTopology.

◆ getTrianglesInTetrahedron()

const BaseMeshTopology::TrianglesInTetrahedron & sofa::core::topology::BaseMeshTopology::getTrianglesInTetrahedron ( TetraID  i)
virtual

Returns the set of triangles adjacent to a given tetrahedron.

Returns the set of triangle adjacent to a given tetrahedron.

Reimplemented in sofa::component::topology::container::dynamic::TetrahedronSetTopologyContainer, and sofa::component::topology::container::constant::MeshTopology.

◆ getTrianglesOnBorder()

const sofa::type::vector< BaseMeshTopology::TriangleID > & sofa::core::topology::BaseMeshTopology::getTrianglesOnBorder ( )
virtual

Returns the set of triangles on the border of the triangulation.

Reimplemented in sofa::component::topology::container::dynamic::TriangleSetTopologyContainer.

◆ getVertexIndexInHexahedron()

int sofa::core::topology::BaseMeshTopology::getVertexIndexInHexahedron ( const Hexa t,
PointID  vertexIndex 
) const
virtual

returns the index (either 0, 1 ,2, 3, 4, 5, 6, or 7) of the vertex whose global index is vertexIndex. Returns -1 if none

Reimplemented in sofa::component::topology::container::constant::MeshTopology.

◆ getVertexIndexInQuad()

int sofa::core::topology::BaseMeshTopology::getVertexIndexInQuad ( const Quad t,
PointID  vertexIndex 
) const
virtual

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

Reimplemented in sofa::component::topology::container::constant::MeshTopology.

◆ getVertexIndexInTetrahedron()

int sofa::core::topology::BaseMeshTopology::getVertexIndexInTetrahedron ( const Tetra t,
PointID  vertexIndex 
) const
virtual

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

Reimplemented in sofa::component::topology::container::constant::MeshTopology.

◆ getVertexIndexInTriangle()

int sofa::core::topology::BaseMeshTopology::getVertexIndexInTriangle ( const Triangle t,
PointID  vertexIndex 
) const
virtual

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

Reimplemented in sofa::component::topology::container::dynamic::TriangleSetTopologyContainer, and sofa::component::topology::container::constant::MeshTopology.

◆ getVerticesAroundVertex()

const BaseMeshTopology::VerticesAroundVertex sofa::core::topology::BaseMeshTopology::getVerticesAroundVertex ( PointID  i)
virtual

Returns the set of vertices adjacent to a given vertex (i.e. sharing an edge)

◆ hasPos()

bool sofa::core::topology::BaseMeshTopology::hasPos ( ) const
inlineoverridevirtual

Reimplemented from sofa::core::topology::Topology.

◆ init()

void sofa::core::topology::BaseMeshTopology::init ( void  )
overridevirtual

Initialization method called at graph creation and modification, during top-down traversal.

Reimplemented from sofa::core::objectmodel::BaseObject.

Reimplemented in sofa::core::topology::TopologyContainer.

◆ insertInNode()

bool sofa::core::topology::BaseMeshTopology::insertInNode ( objectmodel::BaseNode )
overridevirtual

the component can insert itself directly in the right sequence in the Node so the Node does not have to test its type against all known types

Returns
true if the component was inserted

Reimplemented from sofa::core::objectmodel::BaseObject.

Reimplemented in sofa::core::topology::TopologyContainer.

◆ load()

bool sofa::core::topology::BaseMeshTopology::load ( const char filename)
virtual

Load the topology from a file.

The default implementation supports the following formats: obj, gmsh, mesh (custom simple text file), xs3 (deprecated description of mass-springs networks).

◆ removeInNode()

bool sofa::core::topology::BaseMeshTopology::removeInNode ( objectmodel::BaseNode )
overridevirtual

the component can remove itself directly in the right sequence in the Node so the Node does not have to test its type against all known types

Returns
true if the component was removed

Reimplemented from sofa::core::objectmodel::BaseObject.

Reimplemented in sofa::core::topology::TopologyContainer.

◆ reOrientateTriangle()

void sofa::core::topology::BaseMeshTopology::reOrientateTriangle ( TriangleID  id)
virtual

◆ SOFA_ABSTRACT_CLASS()

sofa::core::topology::BaseMeshTopology::SOFA_ABSTRACT_CLASS ( BaseMeshTopology  ,
core::topology::Topology   
)