SOFA API  73d8bb95
Open source framework for multi-physics simuation
sofa::component::loader::MeshXspLoadDataHook Class Reference
Inheritance diagram for sofa::component::loader::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

MeshXspLoader* sofa::component::loader::MeshXspLoadDataHook::m_data
WriteOnlyAccessor<decltype(m_data->d_edges)> sofa::component::loader::MeshXspLoadDataHook::m_edges
WriteOnlyAccessor<decltype(m_data->d_positions)> sofa::component::loader::MeshXspLoadDataHook::m_positions

Constructor details

sofa::component::loader::MeshXspLoadDataHook::MeshXspLoadDataHook ( MeshXspLoader data)
sofa::component::loader::MeshXspLoadDataHook::~MeshXspLoadDataHook ( )
override

Function details

void sofa::component::loader::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.

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

Add a new spring.

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

void sofa::component::loader::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.

void sofa::component::loader::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.

void sofa::component::loader::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.

void sofa::component::loader::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.