SOFA API  6a688117
Open source framework for multi-physics simuation
sofa::component::topology::PointSetTopologyContainer Class Reference

#include <PointSetTopologyContainer.h>

Inheritance diagram for sofa::component::topology::PointSetTopologyContainer:

Detailed Description

The container class that stores a set of points and provides access to each point. This set of point may be a subset of the DOF of the mechanical model

Public Attributes

Data< InitTypes::VecCoordd_initPoints
 Initial position of points. More...
 
Data< boold_checkTopology
 Bool parameter to activate internal topology checks in several methods. More...
 

Protected Attributes

bool m_pointTopologyDirty
 Boolean used to know if the topology Data of this container is dirty. More...
 
std::list< sofa::core::topology::TopologyEngine * > m_enginesList
 List of engines related to this specific container. More...
 
sofa::helper::vector< sofa::helper::vector< std::string > > m_dataGraph
 variables used to display the graph of Data/DataEngines linked to this Data array. More...
 
sofa::helper::vector< sofa::helper::vector< std::string > > m_enginesGraph
 

Public Member Functions

 SOFA_CLASS (PointSetTopologyContainer, core::topology::TopologyContainer)
 
void init () override
 
const sofa::helper::vector< PointID > & getPoints () const
 
void clear () override
 
void addPoint (double px, double py, double pz) override
 
std::size_t getNbPoints () const override
 Returns the number of vertices in this topology. More...
 
virtual size_t getNumberOfElements () const
 Returns the number of topological element of the current topology. This function avoids to know which topological container is in used. More...
 
Data< InitTypes::VecCoord > & getPointDataArray ()
 Returns a reference to the Data of points array container. More...
 
void setNbPoints (std::size_t n) override
 Set the number of vertices in this topology. More...
 
bool hasPos () const override
 check if vertices in this topology have positions. More...
 
SReal getPX (index_type i) const override
 Returns the X coordinate of the ith DOF. More...
 
SReal getPY (index_type i) const override
 Returns the Y coordinate of the ith DOF. More...
 
SReal getPZ (index_type i) const override
 Returns the Z coordinate of the ith DOF. More...
 
sofa::core::topology::TopologyObjectType getTopologyType () const override
 Returns the type of the topology. More...
 
bool checkTopology () const override
 Checks if the Topology is coherent. More...
 
void addPoint ()
 add one DOF in this topology (simply increment the number of DOF) More...
 
void addPoints (const std::size_t nPoints)
 add a number of DOFs in this topology (simply increase the number of DOF according to this parameter) More...
 
void removePoint ()
 remove one DOF in this topology (simply decrement the number of DOF) More...
 
void removePoints (const std::size_t nPoints)
 remove a number of DOFs in this topology (simply decrease the number of DOF according to this parameter) More...
 

Protected Member Functions

 PointSetTopologyContainer (std::size_t nPoints=0)
 
 ~PointSetTopologyContainer () override
 
void updateTopologyEngineGraph () override
 Function creating the data graph linked to d_point. More...
 
virtual void updateDataEngineGraph (sofa::core::objectmodel::BaseData &my_Data, std::list< sofa::core::topology::TopologyEngine * > &my_enginesList)
 functions to really update the graph of Data/DataEngines linked to the different Data array, using member variable. More...
 
void setPointTopologyToDirty ()
 
void cleanPointTopologyFromDirty ()
 
const boolisPointTopologyDirty ()
 
void addEngineToList (sofa::core::topology::TopologyEngine *_engine)
 function to add a topologyEngine to the current list of engines. More...
 
virtual void displayDataGraph (sofa::core::objectmodel::BaseData &my_Data)
 functions to display the graph of Data/DataEngines linked to the different Data array, using member variable. More...
 

Friends

class PointSetTopologyModifier
 
std::ostream & operator<< (std::ostream &out, const PointSetTopologyContainer &)
 
std::istream & operator>> (std::istream &in, PointSetTopologyContainer &)
 

Attribute details

Data<bool> sofa::component::topology::PointSetTopologyContainer::d_checkTopology

Bool parameter to activate internal topology checks in several methods.

Data<InitTypes::VecCoord> sofa::component::topology::PointSetTopologyContainer::d_initPoints

Initial position of points.

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

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

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

List of engines related to this specific container.

bool sofa::component::topology::PointSetTopologyContainer::m_pointTopologyDirty
protected

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

Constructor details

sofa::component::topology::PointSetTopologyContainer::PointSetTopologyContainer ( std::size_t  nPoints = 0)
protected
sofa::component::topology::PointSetTopologyContainer::~PointSetTopologyContainer ( )
inlineoverrideprotected

Function details

void sofa::component::topology::PointSetTopologyContainer::addEngineToList ( sofa::core::topology::TopologyEngine _engine)
protected

function to add a topologyEngine to the current list of engines.

void sofa::component::topology::PointSetTopologyContainer::addPoint ( double  px,
double  py,
double  pz 
)
override
void sofa::component::topology::PointSetTopologyContainer::addPoint ( )

add one DOF in this topology (simply increment the number of DOF)

void sofa::component::topology::PointSetTopologyContainer::addPoints ( const std::size_t  nPoints)

add a number of DOFs in this topology (simply increase the number of DOF according to this parameter)

Parameters
Thenumber of point to add.
bool sofa::component::topology::PointSetTopologyContainer::checkTopology ( ) const
override

Checks if the Topology is coherent.

Dynamic Topology API

void sofa::component::topology::PointSetTopologyContainer::cleanPointTopologyFromDirty ( )
protected
void sofa::component::topology::PointSetTopologyContainer::clear ( )
override

Procedural creation methods

void sofa::component::topology::PointSetTopologyContainer::displayDataGraph ( sofa::core::objectmodel::BaseData my_Data)
protectedvirtual

functions to display the graph of Data/DataEngines linked to the different Data array, using member variable.

std::size_t sofa::component::topology::PointSetTopologyContainer::getNbPoints ( ) const
inlineoverride

Returns the number of vertices in this topology.

BaseMeshTopology API

size_t sofa::component::topology::PointSetTopologyContainer::getNumberOfElements ( ) const
virtual
Data<InitTypes::VecCoord>& sofa::component::topology::PointSetTopologyContainer::getPointDataArray ( )
inline

Returns a reference to the Data of points array container.

const sofa::helper::vector< PointSetTopologyContainer::PointID > & sofa::component::topology::PointSetTopologyContainer::getPoints ( ) const
SReal sofa::component::topology::PointSetTopologyContainer::getPX ( index_type  i) const
override

Returns the X coordinate of the ith DOF.

SReal sofa::component::topology::PointSetTopologyContainer::getPY ( index_type  i) const
override

Returns the Y coordinate of the ith DOF.

SReal sofa::component::topology::PointSetTopologyContainer::getPZ ( index_type  i) const
override

Returns the Z coordinate of the ith DOF.

sofa::core::topology::TopologyObjectType sofa::component::topology::PointSetTopologyContainer::getTopologyType ( ) const
inlineoverride

Returns the type of the topology.

bool sofa::component::topology::PointSetTopologyContainer::hasPos ( ) const
override

check if vertices in this topology have positions.

void sofa::component::topology::PointSetTopologyContainer::init ( void  )
override
const bool& sofa::component::topology::PointSetTopologyContainer::isPointTopologyDirty ( )
inlineprotected
void sofa::component::topology::PointSetTopologyContainer::removePoint ( )

remove one DOF in this topology (simply decrement the number of DOF)

void sofa::component::topology::PointSetTopologyContainer::removePoints ( const std::size_t  nPoints)

remove a number of DOFs in this topology (simply decrease the number of DOF according to this parameter)

Parameters
Thenumber of point to remove.
void sofa::component::topology::PointSetTopologyContainer::setNbPoints ( std::size_t  n)
override

Set the number of vertices in this topology.

void sofa::component::topology::PointSetTopologyContainer::setPointTopologyToDirty ( )
protected

Use a specific boolean

See also
m_pointTopologyDirty in order to know if topology Data is dirty or not. Set/Get function access to this boolean
sofa::component::topology::PointSetTopologyContainer::SOFA_CLASS ( PointSetTopologyContainer  ,
core::topology::TopologyContainer   
)
void sofa::component::topology::PointSetTopologyContainer::updateDataEngineGraph ( sofa::core::objectmodel::BaseData my_Data,
std::list< sofa::core::topology::TopologyEngine * > &  my_enginesList 
)
protectedvirtual

functions to really update the graph of Data/DataEngines linked to the different Data array, using member variable.

void sofa::component::topology::PointSetTopologyContainer::updateTopologyEngineGraph ( )
overrideprotected

Function creating the data graph linked to d_point.

Related details

std::ostream& operator<< ( std::ostream &  out,
const PointSetTopologyContainer  
)
friend
std::istream& operator>> ( std::istream &  in,
PointSetTopologyContainer  
)
friend
friend class PointSetTopologyModifier
friend