SOFA API  99934cbc
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::helper::vector< TriangleID > & getTrianglesOnBorder ()
 Returns the set of triangles on the border of the triangulation. More...
 
virtual const sofa::helper::vector< EdgeID > & getEdgesOnBorder ()
 Returns the set of edges on the border of the triangulation. More...
 
virtual const sofa::helper::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_t getNbEdges ()
 
virtual size_t getNbTriangles ()
 
virtual size_t getNbQuads ()
 
virtual size_t getNbTetrahedra ()
 
virtual size_t 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::core::topology::TopologyObjectType getTopologyType () const =0
 
virtual size_t getNbTetras ()
 
virtual size_t 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::helper::vector< index_typegetElementAroundElement (index_type elem)
 Returns the set of element indices adjacent to a given element (i.e. sharing a link) More...
 
virtual const sofa::helper::vector< index_typegetElementAroundElements (sofa::helper::vector< index_type > 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_t 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_type) const override
 
SReal getPY (index_type) const override
 
SReal getPZ (index_type) const override
 
virtual void clear ()
 
virtual void addPoint (SReal px, SReal py, SReal pz)
 
virtual void addEdge (index_type a, index_type b)
 
void addLine (index_type a, index_type b)
 
virtual void addTriangle (index_type a, index_type b, index_type c)
 
virtual void addQuad (index_type a, index_type b, index_type c, index_type d)
 
virtual void addTetra (index_type a, index_type b, index_type c, index_type d)
 
virtual void addHexa (index_type a, index_type b, index_type c, index_type d, index_type e, index_type f, index_type g, index_type h)
 
virtual bool checkConnexity ()
 
virtual bool checkTopology () const
 Checks if the topology is coherent. More...
 
virtual size_t getNumberOfConnectedComponent ()
 Returns the number of connected component. More...
 
virtual const sofa::helper::vector< index_typegetConnectedElement (index_type 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...
 
virtual void addTopologyEngine (TopologyEngine *_topologyEngine)
 Adds a TopologyEngine to the list. More...
 
virtual std::list< TopologyEngine * >::const_iterator beginTopologyEngine () const
 Provides an iterator on the first element in the list of TopologyEngine objects. More...
 
virtual std::list< TopologyEngine * >::const_iterator endTopologyEngine () const
 Provides an iterator on the last element in the list of TopologyEngine objects. More...
 
- Public Member Functions inherited from sofa::core::topology::Topology
 SOFA_CLASS (Topology, core::objectmodel::BaseObject)
 
virtual std::size_t getNbPoints () const
 
virtual void setNbPoints (std::size_t)
 
bool insertInNode (objectmodel::BaseNode *node) override
 
bool removeInNode (objectmodel::BaseNode *node) override
 
- 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)
 
void * findLinkDestClass (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...
 
template<class T >
T::SPtr searchLocal () const
 Local search of an object of the given type. More...
 
template<class T >
T::SPtr searchUp () const
 Upward search of an object of the given type, starting from the local context. More...
 
template<class T >
T::SPtr searchDown () const
 Downward search of an object of the given type, starting from the local context. More...
 
template<class T >
T::SPtr searchFromRoot () const
 
template<class T >
T::SPtr searchInParents () const
 
template<class T >
helper::vector< typename T::SPtr > searchAllLocal () const
 Local search of all objects of the given type. More...
 
template<class T >
helper::vector< typename T::SPtr > searchAllUp () const
 Upward search of all objects of the given type, starting from the local context. More...
 
template<class T >
helper::vector< typename T::SPtr > searchAllDown () const
 Downward search of all objects of the given type, starting from the local context. More...
 
template<class T >
helper::vector< typename T::SPtr > searchAllFromRoot () const
 Search of all objects of the given type, starting from the root. More...
 
template<class T >
helper::vector< typename T::SPtr > searchAllInParents () const
 
template<class T >
helper::vector< typename T::SPtr > searchAllLocal (const Tag &t) const
 Local search of all objects of the given type with a given Tag. More...
 
template<class T >
helper::vector< typename T::SPtr > searchAllUp (const Tag &t) const
 Upward search of all objects of the given type with a given Tag, starting from the local context. More...
 
template<class T >
helper::vector< typename T::SPtr > searchAllDown (const Tag &t) const
 Downward search of all objects of the given typee with a given Tag, starting from the local context. More...
 
template<class T >
helper::vector< typename T::SPtr > searchAllFromRoot (const Tag &t) const
 Search of all objects of the given typee with a given Tag, starting from the root. More...
 
template<class T >
helper::vector< typename T::SPtr > searchAllInParents (const Tag &t) const
 
template<class T >
helper::vector< typename T::SPtr > searchAllLocal (const TagSet &t) const
 Local search of all objects of the given type with a given TagSet. More...
 
template<class T >
helper::vector< typename T::SPtr > searchAllUp (const TagSet &t) const
 Upward search of all objects of the given type with a given TagSet, starting from the local context. More...
 
template<class T >
helper::vector< typename T::SPtr > searchAllDown (const TagSet &t) const
 Downward search of all objects of the given typee with a given TagSet, starting from the local context. More...
 
template<class T >
helper::vector< typename T::SPtr > searchAllFromRoot (const TagSet &t) const
 Search of all objects of the given typee with a given TagSet, starting from the root. More...
 
template<class T >
helper::vector< typename T::SPtr > searchAllInParents (const TagSet &t) const
 
SReal getTime () const
 Current time. More...
 
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 ()
 
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)
 
- Public Member Functions inherited from sofa::core::objectmodel::Base
virtual const BaseClassgetClass () const
 
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...
 
virtual 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
 Get the template type names (if any) used to instantiate this object. More...
 
virtual 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
 
const std::string getWarnings () const
 
const std::string getOutputs () const
 use getLoggedMessageAsString() or getLoggedMessage instead. More...
 
void clearWarnings ()
 use getLoggedMessageAsString() or getLoggedMessage instead. More...
 
void clearOutputs ()
 use clearLoggedMessages() instead More...
 
void processStream (std::ostream &out)
 use clearLoggedMessages() instead More...
 
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
 
bool IsInheritingFromBase ()
 
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 (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 ()
 
 ~Topology () override
 
- 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::helper::fixed_array< EdgeID, 3 > EdgesInTriangle
 
typedef sofa::helper::fixed_array< EdgeID, 4 > EdgesInQuad
 
typedef sofa::helper::fixed_array< TriangleID, 4 > TrianglesInTetrahedron
 
typedef sofa::helper::fixed_array< EdgeID, 6 > EdgesInTetrahedron
 
typedef sofa::helper::fixed_array< QuadID, 6 > QuadsInHexahedron
 
typedef sofa::helper::fixed_array< EdgeID, 12 > EdgesInHexahedron
 
static EdgesInTriangle InvalidEdgesInTriangles
 
static EdgesInQuad InvalidEdgesInQuad
 
static TrianglesInTetrahedron InvalidTrianglesInTetrahedron
 
static EdgesInTetrahedron InvalidEdgesInTetrahedron
 
static QuadsInHexahedron InvalidQuadsInHexahedron
 
static EdgesInHexahedron InvalidEdgesInHexahedron
 

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
helper::system::SofaOStream< helper::logging::Message::Warningserr
 
helper::system::SofaOStream< helper::logging::Message::Infosout
 
helper::system::SofaEndl< Basesendl
 runs the stream processing More...
 
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::defaulttype::BoundingBoxf_bbox
 this object bounding box More...
 
Data< sofa::core::objectmodel::ComponentStated_componentState
 the object state More...
 
DeprecatedAndRemoved m_componentstate
 
DeprecatedAndRemoved d_componentstate
 
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_type InvalidID = sofa::defaulttype::InvalidID
 
static const sofa::helper::vector< Topology::index_typeInvalidSet
 
static const Edge InvalidEdge
 
static const Triangle InvalidTriangle
 
static const Quad InvalidQuad
 
static const Tetrahedron InvalidTetrahedron
 
static const Pyramid InvalidPyramid
 
static const Pentahedron InvalidPentahedron
 
static const Hexahedron InvalidHexahedron
 
- 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 void dynamicCast (T *&ptr, Base *b)
 
template<class T >
static std::string typeName (const T *ptr=nullptr)
 
template<class T >
static std::string className (const T *ptr=nullptr)
 
template<class T >
static std::string namespaceName (const T *ptr=nullptr)
 
template<class T >
static std::string templateName (const T *ptr=nullptr)
 
template<class T >
static std::string shortName (const T *ptr=nullptr, BaseObjectDescription *=nullptr)
 

Attribute details

sofa::core::objectmodel::DataFileName sofa::core::topology::BaseMeshTopology::fileTopology
protected
BaseMeshTopology::EdgesInHexahedron sofa::core::topology::BaseMeshTopology::InvalidEdgesInHexahedron
static
BaseMeshTopology::EdgesInQuad sofa::core::topology::BaseMeshTopology::InvalidEdgesInQuad
static
BaseMeshTopology::EdgesInTetrahedron sofa::core::topology::BaseMeshTopology::InvalidEdgesInTetrahedron
static
BaseMeshTopology::EdgesInTriangle sofa::core::topology::BaseMeshTopology::InvalidEdgesInTriangles
static
BaseMeshTopology::QuadsInHexahedron sofa::core::topology::BaseMeshTopology::InvalidQuadsInHexahedron
static
BaseMeshTopology::TrianglesInTetrahedron sofa::core::topology::BaseMeshTopology::InvalidTrianglesInTetrahedron
static

Constructor details

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

Function details

void sofa::core::topology::BaseMeshTopology::addEdge ( index_type  a,
index_type  b 
)
virtual
void sofa::core::topology::BaseMeshTopology::addHexa ( index_type  a,
index_type  b,
index_type  c,
index_type  d,
index_type  e,
index_type  f,
index_type  g,
index_type  h 
)
virtual
void sofa::core::topology::BaseMeshTopology::addLine ( index_type  a,
index_type  b 
)
inline
void sofa::core::topology::BaseMeshTopology::addPoint ( SReal  px,
SReal  py,
SReal  pz 
)
virtual
void sofa::core::topology::BaseMeshTopology::addQuad ( index_type  a,
index_type  b,
index_type  c,
index_type  d 
)
virtual
void sofa::core::topology::BaseMeshTopology::addTetra ( index_type  a,
index_type  b,
index_type  c,
index_type  d 
)
virtual
void sofa::core::topology::BaseMeshTopology::addTopologyEngine ( TopologyEngine _topologyEngine)
virtual

Adds a TopologyEngine to the list.

void sofa::core::topology::BaseMeshTopology::addTriangle ( index_type  a,
index_type  b,
index_type  c 
)
virtual
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

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.

std::list< TopologyEngine * >::const_iterator sofa::core::topology::BaseMeshTopology::beginTopologyEngine ( ) const
virtual

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

virtual bool sofa::core::topology::BaseMeshTopology::checkConnexity ( )
inlinevirtual

get information about connexity of the mesh

Checks if the topology has only one connected component.

Returns
Return true if so.

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

virtual bool sofa::core::topology::BaseMeshTopology::checkTopology ( ) const
inlinevirtual

Checks if the topology is coherent.

Returns
true if so. Should be override by child class.
void sofa::core::topology::BaseMeshTopology::clear ( )
virtual

Procedural creation methods

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

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.

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.

std::list< TopologyEngine * >::const_iterator sofa::core::topology::BaseMeshTopology::endTopologyEngine ( ) const
virtual

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

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

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

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

virtual const Edge sofa::core::topology::BaseMeshTopology::getEdge ( EdgeID  i)
inlinevirtual
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::MeshTopology.

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

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::MeshTopology.

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

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::MeshTopology.

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

Complete sequence accessors

Implemented in sofa::component::topology::MeshTopology.

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::MeshTopology.

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

Returns the set of edges adjacent to a given hexahedron.

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

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::MeshTopology.

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

Returns the set of edges adjacent to a given tetrahedron.

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

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

Returns the set of edges adjacent to a given triangle.

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

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

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

const vector< BaseMeshTopology::index_type > sofa::core::topology::BaseMeshTopology::getElementAroundElement ( index_type  elem)
virtual

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

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

const vector< BaseMeshTopology::index_type > sofa::core::topology::BaseMeshTopology::getElementAroundElements ( sofa::helper::vector< index_type 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::MeshTopology.

virtual std::string sofa::core::topology::BaseMeshTopology::getFilename ( ) const
inlinevirtual
virtual Hexa sofa::core::topology::BaseMeshTopology::getHexa ( HexaID  i)
inlinevirtual
virtual const SeqHexahedra& sofa::core::topology::BaseMeshTopology::getHexahedra ( )
pure virtual
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::MeshTopology.

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

Returns the set of hexahedra adjacent to a given quad.

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

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::MeshTopology.

virtual const Hexa sofa::core::topology::BaseMeshTopology::getHexahedron ( HexaID  i)
inlinevirtual
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::MeshTopology.

virtual const SeqHexahedra& sofa::core::topology::BaseMeshTopology::getHexas ( )
inlinevirtual
Line sofa::core::topology::BaseMeshTopology::getLine ( LineID  i)
inline
const SeqLines& sofa::core::topology::BaseMeshTopology::getLines ( )
inline
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::MeshTopology.

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::MeshTopology.

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.

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.

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

Random accessors

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

virtual size_t sofa::core::topology::BaseMeshTopology::getNbHexahedra ( )
inlinevirtual
virtual size_t sofa::core::topology::BaseMeshTopology::getNbHexas ( )
inlinevirtual
size_t sofa::core::topology::BaseMeshTopology::getNbLines ( )
inline
virtual size_t sofa::core::topology::BaseMeshTopology::getNbQuads ( )
inlinevirtual
virtual size_t sofa::core::topology::BaseMeshTopology::getNbTetrahedra ( )
inlinevirtual
virtual size_t sofa::core::topology::BaseMeshTopology::getNbTetras ( )
inlinevirtual

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

virtual size_t sofa::core::topology::BaseMeshTopology::getNbTriangles ( )
inlinevirtual
virtual size_t sofa::core::topology::BaseMeshTopology::getNumberOfConnectedComponent ( )
inlinevirtual

Returns the number of connected component.

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

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

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

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

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

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

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

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

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

virtual const Quad sofa::core::topology::BaseMeshTopology::getQuad ( QuadID  i)
inlinevirtual
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::MeshTopology.

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::MeshTopology.

virtual const SeqQuads& sofa::core::topology::BaseMeshTopology::getQuads ( )
pure virtual
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::MeshTopology.

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::MeshTopology.

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::MeshTopology.

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::component::topology::MeshTopology.

virtual Tetra sofa::core::topology::BaseMeshTopology::getTetra ( TetraID  i)
inlinevirtual
virtual const SeqTetrahedra& sofa::core::topology::BaseMeshTopology::getTetrahedra ( )
pure virtual
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::MeshTopology.

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

Returns the set of tetrahedra adjacent to a given triangle.

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

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::MeshTopology.

virtual const Tetra sofa::core::topology::BaseMeshTopology::getTetrahedron ( TetraID  i)
inlinevirtual
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::MeshTopology.

virtual const SeqTetrahedra& sofa::core::topology::BaseMeshTopology::getTetras ( )
inlinevirtual
virtual sofa::core::topology::TopologyObjectType sofa::core::topology::BaseMeshTopology::getTopologyType ( ) const
pure virtual
virtual const Triangle sofa::core::topology::BaseMeshTopology::getTriangle ( TriangleID  i)
inlinevirtual
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::MeshTopology.

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::MeshTopology.

virtual const SeqTriangles& sofa::core::topology::BaseMeshTopology::getTriangles ( )
pure virtual
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::MeshTopology.

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::MeshTopology.

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::MeshTopology.

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

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

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::MeshTopology.

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::MeshTopology.

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::MeshTopology.

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::MeshTopology.

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)

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

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

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.

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

the component can insert itseft direclty in the right sequence in the Node so the Node does not have to test its type against every known types.

Returns
true iff the component was inserted

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

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).

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

the component can remove itseft direclty in the right sequence in the Node so the Node does not have to test its type against every known types.

Returns
true iff the component was removed

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

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

Will change order of vertices in triangle: t[1] <=> t[2].

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

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