SOFA API  7352f41a
Open source framework for multi-physics simuation
sofa::component::io::mesh::MeshXspLoadDataHook Class Reference
Inheritance diagram for sofa::component::io::mesh::MeshXspLoadDataHook:

Public Attributes

MeshXspLoaderm_data
 
WriteOnlyAccessor< decltype(m_data->d_positions)> m_positions
 
WriteOnlyAccessor< decltype(m_data->d_edges)> m_edges
 

Public Member Functions

 MeshXspLoadDataHook (MeshXspLoader *data)
 
 ~MeshXspLoadDataHook () override
 
void setNumMasses (size_t n) override
 Called by the XspLoader to specify before loading the number of masses. More...
 
void setNumSprings (size_t n) override
 Called by the XspLoader to specify before loading the number of springs. More...
 
void finalizeLoading (bool isOk) override
 Called by the XspLoader when the loading is done. More...
 
void addMass (SReal px, SReal py, SReal pz, SReal, SReal, SReal, SReal, SReal, bool, bool) override
 Add a new mass. More...
 
void addSpring (size_t index1, size_t index2, SReal, SReal, SReal) override
 Add a new spring. More...
 
void addVectorSpring (size_t m1, size_t m2, SReal ks, SReal kd, SReal initpos, SReal, SReal, SReal) override
 Add an extended spring. More...
 
- Public Member Functions inherited from sofa::helper::io::XspLoaderDataHook
virtual ~XspLoaderDataHook ()
 Destructor, does nothing special. More...
 
virtual void setGravity (SReal, SReal, SReal)
 Called by the XspLoader to specify the directional gravity. More...
 
virtual void setViscosity (SReal)
 Called by the XspLoader to specify the viscosity. More...
 

Attribute details

◆ m_data

MeshXspLoader* sofa::component::io::mesh::MeshXspLoadDataHook::m_data

◆ m_edges

WriteOnlyAccessor<decltype(m_data->d_edges)> sofa::component::io::mesh::MeshXspLoadDataHook::m_edges

◆ m_positions

WriteOnlyAccessor<decltype(m_data->d_positions)> sofa::component::io::mesh::MeshXspLoadDataHook::m_positions

Constructor details

◆ MeshXspLoadDataHook()

sofa::component::io::mesh::MeshXspLoadDataHook::MeshXspLoadDataHook ( MeshXspLoader data)

◆ ~MeshXspLoadDataHook()

sofa::component::io::mesh::MeshXspLoadDataHook::~MeshXspLoadDataHook ( )
override

Function details

◆ addMass()

void sofa::component::io::mesh::MeshXspLoadDataHook::addMass ( SReal  ,
SReal  ,
SReal  ,
SReal  ,
SReal  ,
SReal  ,
SReal  ,
SReal  ,
bool  ,
bool   
)
inlineoverridevirtual

Add a new mass.

Parameters
px,py,pz3D position.
vx,vz,vz3D velocity.
mass.
elasticproperty.
fixedboolean indicates that the mass is "static".
surfaceindicates that the mass is on the surface.

Reimplemented from sofa::helper::io::XspLoaderDataHook.

◆ addSpring()

void sofa::component::io::mesh::MeshXspLoadDataHook::addSpring ( size_t  ,
size_t  ,
SReal  ,
SReal  ,
SReal   
)
inlineoverridevirtual

Add a new spring.

Reimplemented from sofa::helper::io::XspLoaderDataHook.

◆ addVectorSpring()

void sofa::component::io::mesh::MeshXspLoadDataHook::addVectorSpring ( size_t  m1,
size_t  m2,
SReal  ks,
SReal  kd,
SReal  initpos,
SReal  ,
SReal  ,
SReal   
)
inlineoverridevirtual

Add an extended spring.

Reimplemented from sofa::helper::io::XspLoaderDataHook.

◆ finalizeLoading()

void sofa::component::io::mesh::MeshXspLoadDataHook::finalizeLoading ( bool  isOk)
inlineoverridevirtual

Called by the XspLoader when the loading is done.

This method is called by the XspLoader when the loading is done. Overriding this method allows client-code to implement post-loading checking.

Parameters
isOkis set to false this means that the loading code detected a problem and that the loaded informations are invalid and should be removed from the container.

Reimplemented from sofa::helper::io::XspLoaderDataHook.

◆ setNumMasses()

void sofa::component::io::mesh::MeshXspLoadDataHook::setNumMasses ( size_t  )
inlineoverridevirtual

Called by the XspLoader to specify before loading the number of masses.

Parameters
nnumber of massses.

Reimplemented from sofa::helper::io::XspLoaderDataHook.

◆ setNumSprings()

void sofa::component::io::mesh::MeshXspLoadDataHook::setNumSprings ( size_t  )
inlineoverridevirtual

Called by the XspLoader to specify before loading the number of springs.

Parameters
nnumber of springs.

Reimplemented from sofa::helper::io::XspLoaderDataHook.