SOFA API  b3f2f2a4
Open source framework for multi-physics simuation
sofa::component::playback::WriteStateCreator Class Reference

#include <WriteState.h>

Create WriteState component in the graph each time needed. More...

Inheritance diagram for sofa::component::playback::WriteStateCreator:

Detailed Description

Create WriteState component in the graph each time needed.

Protected Attributes

std::string sceneName
 
std::string extension
 
type::vector< double > m_times
 
bool recordX
 
bool recordV
 
bool recordF
 
bool createInMapping
 
int counterWriteState
 
- Protected Attributes inherited from sofa::simulation::Visitor
const sofa::core::ExecParamsparams
 

Public Member Functions

 WriteStateCreator (const core::ExecParams *params)
 
 WriteStateCreator (const core::ExecParams *params, const std::string &n, bool _recordX, bool _recordV, bool _recordF, bool _createInMapping, int c=0)
 
Result processNodeTopDown (simulation::Node *) override
 Callback method called when decending to a new node. Recursion will stop if this method returns RESULT_PRUNE. More...
 
void setSceneName (std::string &n)
 
void setRecordX (bool b)
 
void setRecordV (bool b)
 
void setRecordF (bool b)
 
void setCreateInMapping (bool b)
 
void setCounter (int c)
 
const chargetClassName () const override
 
void setExportTimes (const type::vector< double > times)
 
- Public Member Functions inherited from sofa::simulation::Visitor
 Visitor (const sofa::core::ExecParams *params)
 
virtual ~Visitor ()
 
const sofa::core::ExecParamsexecParams () const
 
virtual void processNodeBottomUp (simulation::Node *)
 Callback method called after child node have been processed and before going back to the parent node. More...
 
virtual bool childOrderReversed (simulation::Node *)
 Return true to reverse the order of traversal of child nodes. More...
 
virtual bool treeTraversal (TreeTraversalRepetition &repeat)
 
virtual const chargetCategoryName () const
 
virtual std::string getInfos () const
 
bool testTags (sofa::core::objectmodel::BaseObject *obj)
 
virtual void execute (sofa::core::objectmodel::BaseContext *node, bool precomputedOrder=false)
 Alias for context->executeVisitor(this) More...
 
virtual ctime_t begin (simulation::Node *node, sofa::core::objectmodel::BaseObject *obj, const std::string &typeInfo=std::string("type"))
 
virtual void end (simulation::Node *node, sofa::core::objectmodel::BaseObject *obj, ctime_t t0)
 
virtual ctime_t begin (simulation::Visitor::VisitorContext *node, sofa::core::objectmodel::BaseObject *obj, const std::string &typeInfo=std::string("type"))
 
virtual void end (simulation::Visitor::VisitorContext *node, sofa::core::objectmodel::BaseObject *obj, ctime_t t0)
 
virtual bool isThreadSafe () const
 Specify whether this visitor can be parallelized. More...
 
virtual Result processNodeTopDown (simulation::Node *node, LocalStorage *)=delete
 
virtual void processNodeBottomUp (simulation::Node *node, LocalStorage *)=delete
 
VisitorsetTags (const TagSet &t)
 
VisitoraddTag (Tag t)
 
VisitorremoveTag (Tag t)
 
template<class VisitorType , class VContext , class Container , typename PointedType >
void for_each (VisitorType *visitor, VContext *ctx, const Container &list, void(VisitorType::*task)(VContext *, PointedType *), const std::string &typeInfo)
 
template<class VisitorType , class VContext , class Container , typename PointedType >
Visitor::Result for_each (VisitorType *visitor, VContext *ctx, const Container &list, Visitor::Result(VisitorType::*task)(VContext *, PointedType *), const std::string &typeInfo)
 

Protected Member Functions

void addWriteState (sofa::core::behavior::BaseMechanicalState *ms, simulation::Node *gnode)
 
- Protected Member Functions inherited from sofa::simulation::Visitor
void debug_write_state_before (sofa::core::objectmodel::BaseObject *obj)
 
void debug_write_state_after (sofa::core::objectmodel::BaseObject *obj)
 
template<class VisitorType , class VContext , class ObjectType >
void runVisitorTask (VisitorType *visitor, VContext *ctx, void(VisitorType::*task)(VContext *, ObjectType *), ObjectType *ptr, const std::string &typeInfo=std::string("type"))
 
template<class VisitorType , class VContext , class ObjectType >
Result runVisitorTask (VisitorType *visitor, VContext *ctx, Result(VisitorType::*task)(VContext *, ObjectType *), ObjectType *ptr, const std::string &typeInfo=std::string("type"))
 
template<class Visit , class VContext , class Container , typename PointedType = typename Container::pointed_type>
void for_each (Visit *visitor, VContext *ctx, const Container &list, void(Visit::*task)(VContext *, PointedType *), const std::string &typeInfo=std::string("type"))
 
template<class Visit , class VContext , class Container , typename PointedType = typename Container::pointed_type>
Visitor::Result for_each (Visit *visitor, VContext *ctx, const Container &list, Visitor::Result(Visit::*task)(VContext *, PointedType *), const std::string &typeInfo=std::string("type"))
 

Additional Inherited Members

- Public Attributes inherited from sofa::simulation::Visitor
TagSet subsetsToManage
 list of the subsets More...
 
bool canAccessSleepingNode
 Can the visitor access sleeping nodes? More...
 

Attribute details

◆ counterWriteState

int sofa::component::playback::WriteStateCreator::counterWriteState
protected

◆ createInMapping

bool sofa::component::playback::WriteStateCreator::createInMapping
protected

◆ extension

std::string sofa::component::playback::WriteStateCreator::extension
protected

◆ m_times

type::vector<double> sofa::component::playback::WriteStateCreator::m_times
protected

◆ recordF

bool sofa::component::playback::WriteStateCreator::recordF
protected

◆ recordV

bool sofa::component::playback::WriteStateCreator::recordV
protected

◆ recordX

bool sofa::component::playback::WriteStateCreator::recordX
protected

◆ sceneName

std::string sofa::component::playback::WriteStateCreator::sceneName
protected

Constructor details

◆ WriteStateCreator() [1/2]

sofa::component::playback::WriteStateCreator::WriteStateCreator ( const core::ExecParams params)

◆ WriteStateCreator() [2/2]

sofa::component::playback::WriteStateCreator::WriteStateCreator ( const core::ExecParams params,
const std::string &  n,
bool  _recordX,
bool  _recordV,
bool  _recordF,
bool  _createInMapping,
int  c = 0 
)

Function details

◆ addWriteState()

void sofa::component::playback::WriteStateCreator::addWriteState ( sofa::core::behavior::BaseMechanicalState ms,
simulation::Node gnode 
)
protected

◆ getClassName()

const char* sofa::component::playback::WriteStateCreator::getClassName ( ) const
inlineoverridevirtual

Return a class name for this visitor Only used for debugging / profiling purposes

Reimplemented from sofa::simulation::Visitor.

◆ processNodeTopDown()

simulation::Visitor::Result sofa::component::playback::WriteStateCreator::processNodeTopDown ( simulation::Node )
overridevirtual

Callback method called when decending to a new node. Recursion will stop if this method returns RESULT_PRUNE.

Reimplemented from sofa::simulation::Visitor.

◆ setCounter()

void sofa::component::playback::WriteStateCreator::setCounter ( int  c)
inline

◆ setCreateInMapping()

void sofa::component::playback::WriteStateCreator::setCreateInMapping ( bool  b)
inline

◆ setExportTimes()

void sofa::component::playback::WriteStateCreator::setExportTimes ( const type::vector< double >  times)
inline

◆ setRecordF()

void sofa::component::playback::WriteStateCreator::setRecordF ( bool  b)
inline

◆ setRecordV()

void sofa::component::playback::WriteStateCreator::setRecordV ( bool  b)
inline

◆ setRecordX()

void sofa::component::playback::WriteStateCreator::setRecordX ( bool  b)
inline

◆ setSceneName()

void sofa::component::playback::WriteStateCreator::setSceneName ( std::string &  n)
inline