SOFA API  1df67014
Open source framework for multi-physics simuation
sofa::component::topology::container::dynamic::TriangleSetTopologyModifier Class Reference

#include <TriangleSetTopologyModifier.h>

Inheritance diagram for sofa::component::topology::container::dynamic::TriangleSetTopologyModifier:

Detailed Description

A class that modifies the topology by adding and removing triangles

Protected Attributes

Data< sofa::type::vector< TriangleID > > list_Out
 triangles with at least one null values. More...
 
- Protected Attributes inherited from sofa::core::topology::TopologyModifier
TopologyContainerm_topologyContainer
 Contains the actual topology data and give acces to it (nature of these data heavily depends on the kind of topology). More...
 
- 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_CLASS (TriangleSetTopologyModifier, EdgeSetTopologyModifier)
 
void init () override
 Initialization method called at graph creation and modification, during top-down traversal. More...
 
void reinit () override
 Update method called when variables used in precomputation are modified. More...
 
virtual void addTriangles (const sofa::type::vector< Triangle > &triangles)
 add a set of triangles More...
 
virtual void addTriangles (const sofa::type::vector< Triangle > &triangles, const sofa::type::vector< sofa::type::vector< TriangleID > > &ancestors, const sofa::type::vector< sofa::type::vector< SReal > > &baryCoefs)
 add a set of triangles More...
 
void addTriangleProcess (Triangle t)
 Effectively add a triangle to the topology. More...
 
void removeItems (const sofa::type::vector< TriangleID > &items) override
 Generic method to remove a list of items. More...
 
virtual void removeTriangles (const sofa::type::vector< TriangleID > &triangleIds, const bool removeIsolatedEdges, const bool removeIsolatedPoints)
 Remove a set of triangles. More...
 
virtual void addRemoveTriangles (const sofa::Size nTri2Add, const sofa::type::vector< Triangle > &triangles2Add, const sofa::type::vector< TriangleID > &trianglesIndex2Add, const sofa::type::vector< sofa::type::vector< TriangleID > > &ancestors, const sofa::type::vector< sofa::type::vector< SReal > > &baryCoefs, sofa::type::vector< TriangleID > &trianglesIndex2remove)
 Add and remove a subset of triangles. Eventually remove isolated edges and vertices. More...
 
virtual int InciseAlongEdge (EdgeID edge, int *createdPoints=nullptr)
 Duplicates the given edge. Only works if at least one of its points is adjacent to a border. More...
 
- Public Member Functions inherited from sofa::component::topology::container::dynamic::EdgeSetTopologyModifier
 SOFA_CLASS (EdgeSetTopologyModifier, PointSetTopologyModifier)
 
virtual void addEdges (const sofa::type::vector< Edge > &edges)
 add a set of edges More...
 
virtual void addEdges (const sofa::type::vector< Edge > &edges, const sofa::type::vector< sofa::type::vector< EdgeID > > &ancestors, const sofa::type::vector< sofa::type::vector< SReal > > &baryCoefs)
 add a set of edges More...
 
virtual void addEdges (const sofa::type::vector< Edge > &edges, const sofa::type::vector< core::topology::EdgeAncestorElem > &ancestorElems)
 add a set of edges More...
 
void addEdgeProcess (Edge e)
 Effectively add an edge. More...
 
virtual void swapEdgesProcess (const sofa::type::vector< sofa::type::vector< EdgeID > > &edgesPairs)
 Swap the edges. More...
 
virtual void fuseEdgesProcess (const sofa::type::vector< sofa::type::vector< EdgeID > > &edgesPairs, const bool removeIsolatedPoints=true)
 Fuse the edges. More...
 
virtual void splitEdgesProcess (sofa::type::vector< EdgeID > &indices, const bool removeIsolatedPoints=true)
 Split the edges. More...
 
virtual void splitEdgesProcess (sofa::type::vector< EdgeID > &indices, const sofa::type::vector< sofa::type::vector< SReal > > &baryCoefs, const bool removeIsolatedPoints=true)
 Split the edges. More...
 
virtual void removeEdges (const sofa::type::vector< EdgeID > &edgeIds, const bool removeIsolatedPoints=true)
 Remove a set of edges. More...
 
virtual void swapEdges (const sofa::type::vector< sofa::type::vector< EdgeID > > &edgesPairs)
 Swap a list of pair edges, replacing each edge pair ((p11, p12), (p21, p22)) by the edge pair ((p11, p21), (p12, p22)) More...
 
virtual void fuseEdges (const sofa::type::vector< sofa::type::vector< EdgeID > > &edgesPairs, const bool removeIsolatedPoints=true)
 Fuse a list of pair edges, replacing each edge pair ((p11, p12), (p21, p22)) by one edge (p11, p22) More...
 
virtual void splitEdges (sofa::type::vector< EdgeID > &indices, const bool removeIsolatedPoints=true)
 Split an array of edges, replacing each edge (p1, p2) by two edges (p1, p3) and (p3, p2) where p3 is the new vertex On each edge, a vertex is created based on its barycentric coordinates. More...
 
virtual void splitEdges (sofa::type::vector< EdgeID > &indices, const sofa::type::vector< sofa::type::vector< SReal > > &baryCoefs, const bool removeIsolatedPoints=true)
 Split an array of edges, replacing each edge (p1, p2) by two edges (p1, p3) and (p3, p2) where p3 is the new vertex On each edge, a vertex is created based on its barycentric coordinates. More...
 
virtual void resortCuthillMckee (sofa::type::vector< int > &inverse_permutation)
 Gives the optimal vertex permutation according to the Reverse CuthillMckee algorithm (use BOOST GRAPH LIBRAIRY) More...
 
virtual bool removeConnectedComponents (EdgeID elemID)
 Given an element indice, it will remove all the connected component in which this element belongs to. Warning: if there is only one connected component in the model. All the object will be removed. More...
 
virtual bool removeConnectedElements (EdgeID elemID)
 Given an element indice, it will remove all elements directly connected to the input one. More...
 
virtual bool removeIsolatedElements ()
 If several connected components are detected, it will keep only the biggest one and remove all the rest. Warning: if two connected components have the same number of element and are the biggest. It will keep the first one. More...
 
virtual bool removeIsolatedElements (sofa::Size scaleElem)
 If several connected components are detected, it will remove all connected component with less than a given number of elements. More...
 
- Public Member Functions inherited from sofa::component::topology::container::dynamic::PointSetTopologyModifier
 SOFA_CLASS (PointSetTopologyModifier, core::topology::TopologyModifier)
 
virtual void swapPoints (const Index i1, const Index i2)
 Swap points i1 and i2. More...
 
virtual void renumberPoints (const sofa::type::vector< PointID > &index, const sofa::type::vector< PointID > &inv_index, const bool renumberDOF=true)
 Generic method for points renumbering. More...
 
virtual void addPoints (const sofa::Size nPoints, const bool addDOF=true)
 Add a set of points. More...
 
virtual void addPoints (const sofa::Size nPoints, const sofa::type::vector< sofa::type::vector< PointID > > &ancestors, const sofa::type::vector< sofa::type::vector< SReal > > &coefs, const bool addDOF=true)
 Add a set of points. More...
 
virtual void addPoints (const sofa::Size nPoints, const sofa::type::vector< core::topology::PointAncestorElem > &ancestorElems, const bool addDOF=true)
 Add a set of points according to their ancestors topology elements. More...
 
virtual void removePoints (sofa::type::vector< PointID > &indices, const bool removeDOF=true)
 Generic method to remove a list of point. More...
 
void propagateStateChanges () override
 Called by a topology to warn the Mechanical Object component that points have been added or will be removed. More...
 
void notifyEndingEvent () override
 
- Public Member Functions inherited from sofa::core::topology::TopologyModifier
 SOFA_CLASS (TopologyModifier, BaseTopologyObject)
 
void init () override
 Initialization method called at graph creation and modification, during top-down traversal. More...
 
- Public Member Functions inherited from sofa::core::topology::BaseTopologyObject
 SOFA_CLASS (BaseTopologyObject, core::objectmodel::BaseObject)
 
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)
 
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...
 
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

 TriangleSetTopologyModifier ()
 
 ~TriangleSetTopologyModifier () override
 
void addTrianglesWarning (const sofa::Size nTriangles, const sofa::type::vector< Triangle > &trianglesList, const sofa::type::vector< TriangleID > &trianglesIndexList)
 Sends a message to warn that some triangles were added in this topology. More...
 
void addTrianglesWarning (const sofa::Size nTriangles, const sofa::type::vector< Triangle > &trianglesList, const sofa::type::vector< TriangleID > &trianglesIndexList, const sofa::type::vector< sofa::type::vector< TriangleID > > &ancestors, const sofa::type::vector< sofa::type::vector< SReal > > &baryCoefs)
 Sends a message to warn that some triangles were added in this topology. More...
 
virtual void addTrianglesProcess (const sofa::type::vector< Triangle > &triangles)
 Effectively Add some triangles. Test precondition and apply: More...
 
virtual void removeTrianglesWarning (sofa::type::vector< TriangleID > &triangles)
 Sends a message to warn that some triangles are about to be deleted. More...
 
virtual void removeTrianglesProcess (const sofa::type::vector< TriangleID > &indices, const bool removeIsolatedEdges=false, const bool removeIsolatedPoints=false)
 Remove a subset of triangles. Eventually remove isolated edges and vertices. More...
 
void addEdgesWarning (const sofa::Size nEdges, const sofa::type::vector< Edge > &edgesList, const sofa::type::vector< EdgeID > &edgesIndexList) override
 Sends a message to warn that some edges were added in this topology. More...
 
void addEdgesWarning (const sofa::Size nEdges, const sofa::type::vector< Edge > &edgesList, const sofa::type::vector< EdgeID > &edgesIndexList, const sofa::type::vector< sofa::type::vector< EdgeID > > &ancestors, const sofa::type::vector< sofa::type::vector< SReal > > &baryCoefs) override
 Sends a message to warn that some edges were added in this topology. More...
 
void addEdgesProcess (const sofa::type::vector< Edge > &edges) override
 Add some edges to this topology. More...
 
void removeEdgesProcess (const sofa::type::vector< EdgeID > &indices, const bool removeIsolatedItems=false) override
 Remove a subset of edges. More...
 
void addPointsProcess (const sofa::Size nPoints) override
 Add some points to this topology. More...
 
void removePointsProcess (const sofa::type::vector< PointID > &indices, const bool removeDOF=true) override
 Remove a subset of points. More...
 
void movePointsProcess (const sofa::type::vector< PointID > &id, const sofa::type::vector< sofa::type::vector< PointID > > &ancestors, const sofa::type::vector< sofa::type::vector< SReal > > &coefs, const bool moveDOF=true) override
 Move input points indices to input new coords. Also propagate event and update edgesAroundVertex and trianglesAroundVertex for data handling. More...
 
void renumberPointsProcess (const sofa::type::vector< PointID > &index, const sofa::type::vector< PointID > &inv_index, const bool renumberDOF=true) override
 Reorder this topology. More...
 
void propagateTopologicalEngineChanges () override
 function to propagate topological change events by parsing the list of TopologyHandlers linked to this topology. More...
 
virtual bool removeTrianglesPreconditions (const sofa::type::vector< TriangleID > &items)
 Precondition to fulfill before removing triangles. No preconditions are needed in this class. This function should be inplemented in children classes. More...
 
virtual void removeTrianglesPostProcessing (const sofa::type::vector< TriangleID > &edgeToBeRemoved, const sofa::type::vector< TriangleID > &vertexToBeRemoved)
 : Postprocessing to apply to topology triangles. Nothing to do in this class. This function should be inplemented in children classes. More...
 
virtual bool addTrianglesPreconditions (const sofa::type::vector< Triangle > &triangles)
 Precondition to fulfill before adding triangles. No preconditions are needed in this class. This function should be inplemented in children classes. More...
 
virtual void addTrianglesPostProcessing (const sofa::type::vector< Triangle > &triangles)
 : Postprocessing to apply to topology triangles. Nothing to do in this class. This function should be inplemented in children classes. More...
 
- Protected Member Functions inherited from sofa::component::topology::container::dynamic::EdgeSetTopologyModifier
 EdgeSetTopologyModifier ()
 
 ~EdgeSetTopologyModifier () override
 
virtual void addEdgesWarning (const sofa::Size nEdges)
 Sends a message to warn that some edges were added in this topology. More...
 
virtual void addEdgesWarning (const sofa::Size nEdges, const sofa::type::vector< Edge > &edgesList, const sofa::type::vector< EdgeID > &edgesIndexList, const sofa::type::vector< sofa::type::vector< EdgeID > > &ancestors)
 Sends a message to warn that some edges were added in this topology. More...
 
virtual void addEdgesWarning (const sofa::Size nEdges, const sofa::type::vector< Edge > &edgesList, const sofa::type::vector< EdgeID > &edgesIndexList, const sofa::type::vector< core::topology::EdgeAncestorElem > &ancestorElems)
 Sends a message to warn that some edges were added in this topology. More...
 
virtual void removeEdgesWarning (sofa::type::vector< EdgeID > &edges)
 Sends a message to warn that some edges are about to be deleted. More...
 
- Protected Member Functions inherited from sofa::component::topology::container::dynamic::PointSetTopologyModifier
 PointSetTopologyModifier ()
 
 ~PointSetTopologyModifier () override
 
void addPointsWarning (const sofa::Size nPoints, const bool addDOF=true)
 Sends a message to warn that some points were added in this topology. More...
 
void addPointsWarning (const sofa::Size nPoints, const sofa::type::vector< sofa::type::vector< PointID > > &ancestors, const sofa::type::vector< sofa::type::vector< SReal > > &coefs, const bool addDOF=true)
 Sends a message to warn that some points were added in this topology. More...
 
void addPointsWarning (const sofa::Size nPoints, const sofa::type::vector< core::topology::PointAncestorElem > &ancestorElems, const bool addDOF=true)
 Sends a message to warn that some points were added in this topology. More...
 
void removePointsWarning (sofa::type::vector< PointID > &indices, const bool removeDOF=true)
 Sends a message to warn that some points are about to be deleted. More...
 
void renumberPointsWarning (const sofa::type::vector< PointID > &index, const sofa::type::vector< PointID > &inv_index, const bool renumberDOF=true)
 Sends a message to warn that points are about to be reordered. More...
 
void propagateTopologicalChanges () override
 Called by a topology to warn specific topologies linked to it that TopologyChange objects happened. More...
 
- Protected Member Functions inherited from sofa::core::topology::TopologyModifier
 TopologyModifier ()
 Constructor. More...
 
 ~TopologyModifier () override
 Destructor. More...
 
void addTopologyChange (const TopologyChange *topologyChange)
 Adds a TopologyChange object to the list of the topology this object describes. More...
 
void addStateChange (const TopologyChange *topologyChange)
 Adds a StateChange object to the list of the topology this object describes. More...
 
- Protected Member Functions inherited from sofa::core::topology::BaseTopologyObject
 BaseTopologyObject ()
 
 ~BaseTopologyObject () 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...
 

Friends

template<class DataTypes >
class TriangleSetGeometryAlgorithms
 

Additional Inherited Members

- Public Attributes inherited from sofa::component::topology::container::dynamic::PointSetTopologyModifier
Data< boold_propagateToDOF
 propagate changes to Mechanical object DOFs More...
 
- 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 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

◆ list_Out

Data<sofa::type::vector<TriangleID> > sofa::component::topology::container::dynamic::TriangleSetTopologyModifier::list_Out
protected

triangles with at least one null values.

Constructor details

◆ TriangleSetTopologyModifier()

sofa::component::topology::container::dynamic::TriangleSetTopologyModifier::TriangleSetTopologyModifier ( )
inlineprotected

◆ ~TriangleSetTopologyModifier()

sofa::component::topology::container::dynamic::TriangleSetTopologyModifier::~TriangleSetTopologyModifier ( )
inlineoverrideprotected

Function details

◆ addEdgesProcess()

void sofa::component::topology::container::dynamic::TriangleSetTopologyModifier::addEdgesProcess ( const sofa::type::vector< Edge > &  edges)
overrideprotectedvirtual

Add some edges to this topology.

See also
addEdgesWarning

Reimplemented from sofa::component::topology::container::dynamic::EdgeSetTopologyModifier.

◆ addEdgesWarning() [1/2]

void sofa::component::topology::container::dynamic::TriangleSetTopologyModifier::addEdgesWarning ( const sofa::Size  nEdges,
const sofa::type::vector< Edge > &  edgesList,
const sofa::type::vector< EdgeID > &  edgesIndexList 
)
inlineoverrideprotectedvirtual

Sends a message to warn that some edges were added in this topology.

See also
addEdgesProcess

Reimplemented from sofa::component::topology::container::dynamic::EdgeSetTopologyModifier.

◆ addEdgesWarning() [2/2]

void sofa::component::topology::container::dynamic::TriangleSetTopologyModifier::addEdgesWarning ( const sofa::Size  nEdges,
const sofa::type::vector< Edge > &  edgesList,
const sofa::type::vector< EdgeID > &  edgesIndexList,
const sofa::type::vector< sofa::type::vector< EdgeID > > &  ancestors,
const sofa::type::vector< sofa::type::vector< SReal > > &  baryCoefs 
)
inlineoverrideprotectedvirtual

Sends a message to warn that some edges were added in this topology.

See also
addEdgesProcess

Reimplemented from sofa::component::topology::container::dynamic::EdgeSetTopologyModifier.

◆ addPointsProcess()

void sofa::component::topology::container::dynamic::TriangleSetTopologyModifier::addPointsProcess ( const sofa::Size  nPoints)
overrideprotectedvirtual

Add some points to this topology.

See also
addPointsWarning

Reimplemented from sofa::component::topology::container::dynamic::EdgeSetTopologyModifier.

◆ addRemoveTriangles()

void sofa::component::topology::container::dynamic::TriangleSetTopologyModifier::addRemoveTriangles ( const sofa::Size  nTri2Add,
const sofa::type::vector< Triangle > &  triangles2Add,
const sofa::type::vector< TriangleID > &  trianglesIndex2Add,
const sofa::type::vector< sofa::type::vector< TriangleID > > &  ancestors,
const sofa::type::vector< sofa::type::vector< SReal > > &  baryCoefs,
sofa::type::vector< TriangleID > &  trianglesIndex2remove 
)
virtual

Add and remove a subset of triangles. Eventually remove isolated edges and vertices.

This function is a complete workflow using differents methods of this class:

See also
removeTrianglesWarning
removeTrianglesProcess
addTrianglesProcess
addTrianglesWarning
Parameters
nTri2Add- number of triangles to add.
triangles2Add- list of Triangle to add.
trianglesIndexList- List of their index.
ancestors- list of ancestors to these new triangles.
baryCoefs- their barycoefs related to these ancestors.
trianglesIndex2remove- List of triangle indices to remove.

◆ addTriangleProcess()

void sofa::component::topology::container::dynamic::TriangleSetTopologyModifier::addTriangleProcess ( Triangle  t)

Effectively add a triangle to the topology.

◆ addTriangles() [1/2]

void sofa::component::topology::container::dynamic::TriangleSetTopologyModifier::addTriangles ( const sofa::type::vector< Triangle > &  triangles)
virtual

add a set of triangles

Parameters
trianglesan array of vertex indices describing the triangles to be created Test precondition and apply: TriangleSetTopologyModifier::addTrianglesProcess TriangleSetTopologyModifier::addTrianglesPostProcessing

◆ addTriangles() [2/2]

void sofa::component::topology::container::dynamic::TriangleSetTopologyModifier::addTriangles ( const sofa::type::vector< Triangle > &  triangles,
const sofa::type::vector< sofa::type::vector< TriangleID > > &  ancestors,
const sofa::type::vector< sofa::type::vector< SReal > > &  baryCoefs 
)
virtual

add a set of triangles

Parameters
trianglesan array of vertex indices describing the triangles to be created
ancestorsfor each triangle to be created provides an array of triangle ancestors (optional)
baryCoefsfor each triangle provides the barycentric coordinates (sum to 1) associated with each ancestor (optional)

◆ addTrianglesPostProcessing()

void sofa::component::topology::container::dynamic::TriangleSetTopologyModifier::addTrianglesPostProcessing ( const sofa::type::vector< Triangle > &  triangles)
protectedvirtual

: Postprocessing to apply to topology triangles. Nothing to do in this class. This function should be inplemented in children classes.

◆ addTrianglesPreconditions()

bool sofa::component::topology::container::dynamic::TriangleSetTopologyModifier::addTrianglesPreconditions ( const sofa::type::vector< Triangle > &  triangles)
protectedvirtual

Precondition to fulfill before adding triangles. No preconditions are needed in this class. This function should be inplemented in children classes.

◆ addTrianglesProcess()

void sofa::component::topology::container::dynamic::TriangleSetTopologyModifier::addTrianglesProcess ( const sofa::type::vector< Triangle > &  triangles)
protectedvirtual

Effectively Add some triangles. Test precondition and apply:

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

◆ addTrianglesWarning() [1/2]

void sofa::component::topology::container::dynamic::TriangleSetTopologyModifier::addTrianglesWarning ( const sofa::Size  nTriangles,
const sofa::type::vector< Triangle > &  trianglesList,
const sofa::type::vector< TriangleID > &  trianglesIndexList 
)
protected

Sends a message to warn that some triangles were added in this topology.

See also
addTrianglesProcess

◆ addTrianglesWarning() [2/2]

void sofa::component::topology::container::dynamic::TriangleSetTopologyModifier::addTrianglesWarning ( const sofa::Size  nTriangles,
const sofa::type::vector< Triangle > &  trianglesList,
const sofa::type::vector< TriangleID > &  trianglesIndexList,
const sofa::type::vector< sofa::type::vector< TriangleID > > &  ancestors,
const sofa::type::vector< sofa::type::vector< SReal > > &  baryCoefs 
)
protected

Sends a message to warn that some triangles were added in this topology.

See also
addTrianglesProcess

◆ InciseAlongEdge()

int sofa::component::topology::container::dynamic::TriangleSetTopologyModifier::InciseAlongEdge ( EdgeID  edge,
int *  createdPoints = nullptr 
)
virtual

Duplicates the given edge. Only works if at least one of its points is adjacent to a border.

Returns
the number of newly created points, or -1 if the incision failed.

◆ init()

void sofa::component::topology::container::dynamic::TriangleSetTopologyModifier::init ( void  )
overridevirtual

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

Reimplemented from sofa::component::topology::container::dynamic::EdgeSetTopologyModifier.

◆ movePointsProcess()

void sofa::component::topology::container::dynamic::TriangleSetTopologyModifier::movePointsProcess ( const sofa::type::vector< PointID > &  id,
const sofa::type::vector< sofa::type::vector< PointID > > &  ancestors,
const sofa::type::vector< sofa::type::vector< SReal > > &  coefs,
const bool  moveDOF = true 
)
overrideprotectedvirtual

Move input points indices to input new coords. Also propagate event and update edgesAroundVertex and trianglesAroundVertex for data handling.

Parameters
id: list of indices to move
ancestors list of ancestors to define relative new position
coefs: barycoef to locate new coord relatively to ancestors. @moveDOF bool allowing the move (default true)

Reimplemented from sofa::component::topology::container::dynamic::EdgeSetTopologyModifier.

◆ propagateTopologicalEngineChanges()

void sofa::component::topology::container::dynamic::TriangleSetTopologyModifier::propagateTopologicalEngineChanges ( )
overrideprotectedvirtual

function to propagate topological change events by parsing the list of TopologyHandlers linked to this topology.

Reimplemented from sofa::component::topology::container::dynamic::EdgeSetTopologyModifier.

◆ reinit()

void sofa::component::topology::container::dynamic::TriangleSetTopologyModifier::reinit ( )
overridevirtual

Update method called when variables used in precomputation are modified.

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

◆ removeEdgesProcess()

void sofa::component::topology::container::dynamic::TriangleSetTopologyModifier::removeEdgesProcess ( const sofa::type::vector< EdgeID > &  indices,
const bool  removeIsolatedItems = false 
)
overrideprotectedvirtual

Remove a subset of edges.

Important : some structures might need to be warned BEFORE the points are actually deleted, so always use method removeEdgesWarning before calling removeEdgesProcess.

See also
removeEdgesWarning
Parameters
removeIsolatedItemsif true isolated vertices are also removed Important : parameter indices is not const because it is actually sorted from the highest index to the lowest one.

Reimplemented from sofa::component::topology::container::dynamic::EdgeSetTopologyModifier.

◆ removeItems()

void sofa::component::topology::container::dynamic::TriangleSetTopologyModifier::removeItems ( const sofa::type::vector< TriangleID > &  items)
overridevirtual

Generic method to remove a list of items.

Reimplemented from sofa::component::topology::container::dynamic::EdgeSetTopologyModifier.

◆ removePointsProcess()

void sofa::component::topology::container::dynamic::TriangleSetTopologyModifier::removePointsProcess ( const sofa::type::vector< PointID > &  indices,
const bool  removeDOF = true 
)
overrideprotectedvirtual

Remove a subset of points.

Elements corresponding to these points are removed from the mechanical object's state vectors.

Important : some structures might need to be warned BEFORE the points are actually deleted, so always use method removePointsWarning before calling removePointsProcess.

See also
removePointsWarning Important : the points are actually deleted from the mechanical object's state vectors iff (removeDOF == true)

Reimplemented from sofa::component::topology::container::dynamic::EdgeSetTopologyModifier.

◆ removeTriangles()

void sofa::component::topology::container::dynamic::TriangleSetTopologyModifier::removeTriangles ( const sofa::type::vector< TriangleID > &  triangleIds,
const bool  removeIsolatedEdges,
const bool  removeIsolatedPoints 
)
virtual

Remove a set of triangles.

Parameters
trianglesan array of triangle indices to be removed (note that the array is not const since it needs to be sorted)
removeIsolatedEdgesif true isolated edges are also removed
removeIsolatedPointsif true isolated vertices are also removed

◆ removeTrianglesPostProcessing()

void sofa::component::topology::container::dynamic::TriangleSetTopologyModifier::removeTrianglesPostProcessing ( const sofa::type::vector< TriangleID > &  edgeToBeRemoved,
const sofa::type::vector< TriangleID > &  vertexToBeRemoved 
)
protectedvirtual

: Postprocessing to apply to topology triangles. Nothing to do in this class. This function should be inplemented in children classes.

◆ removeTrianglesPreconditions()

bool sofa::component::topology::container::dynamic::TriangleSetTopologyModifier::removeTrianglesPreconditions ( const sofa::type::vector< TriangleID > &  items)
protectedvirtual

Precondition to fulfill before removing triangles. No preconditions are needed in this class. This function should be inplemented in children classes.

◆ removeTrianglesProcess()

void sofa::component::topology::container::dynamic::TriangleSetTopologyModifier::removeTrianglesProcess ( const sofa::type::vector< TriangleID > &  indices,
const bool  removeIsolatedEdges = false,
const bool  removeIsolatedPoints = false 
)
protectedvirtual

Remove a subset of triangles. Eventually remove isolated edges and vertices.

Important : some structures might need to be warned BEFORE the points are actually deleted, so always use method removeEdgesWarning before calling removeEdgesProcess.

See also
removeTrianglesWarning
Parameters
removeIsolatedEdgesif true isolated edges are also removed
removeIsolatedPointsif true isolated vertices are also removed

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

◆ removeTrianglesWarning()

void sofa::component::topology::container::dynamic::TriangleSetTopologyModifier::removeTrianglesWarning ( sofa::type::vector< TriangleID > &  triangles)
protectedvirtual

Sends a message to warn that some triangles are about to be deleted.

See also
removeTrianglesProcess

Important : parameter indices is not const because it is actually sorted from the highest index to the lowest one.

◆ renumberPointsProcess()

void sofa::component::topology::container::dynamic::TriangleSetTopologyModifier::renumberPointsProcess ( const sofa::type::vector< PointID > &  index,
const sofa::type::vector< PointID > &  inv_index,
const bool  renumberDOF = true 
)
overrideprotectedvirtual

Reorder this topology.

Important : the points are actually renumbered in the mechanical object's state vectors iff (renumberDOF == true)

See also
MechanicalObject::renumberValues

Reimplemented from sofa::component::topology::container::dynamic::EdgeSetTopologyModifier.

◆ SOFA_CLASS()

sofa::component::topology::container::dynamic::TriangleSetTopologyModifier::SOFA_CLASS ( TriangleSetTopologyModifier  ,
EdgeSetTopologyModifier   
)

Related details

◆ TriangleSetGeometryAlgorithms

template<class DataTypes >
friend class TriangleSetGeometryAlgorithms
friend