sofa::component::misc::WriteState Class Reference

Write State vectors to file at a given set of time instants A period can be etablished at the last time instant The DoFs to print can be chosen using DOFsX and DOFsV Stop to write the state if the kinematic energy reach a given threshold (stopAt) The energy will be measured at each period determined by keperiod. More...

#include <WriteState.h>

Inheritance diagram for sofa::component::misc::WriteState:

Inheritance graph
[legend]
Collaboration diagram for sofa::component::misc::WriteState:

Collaboration graph
[legend]

Public Member Functions

 WriteState ()
virtual ~WriteState ()
virtual void init ()
 Initialization method called at graph modification, during bottom-up traversal.
virtual void reset ()
 Reset to initial state.
virtual void handleEvent (sofa::core::objectmodel::Event *event)
 Handle an event.

Static Public Member Functions

template<class T >
static bool canCreate (T *&obj, core::objectmodel::BaseContext *context, core::objectmodel::BaseObjectDescription *arg)
 Pre-construction check method called by ObjectFactory.

Data Fields

Data< std::string > f_filename
Data< bool > f_writeX
Data< bool > f_writeV
Data< double > f_interval
Data< helper::vector< double > > f_time
Data< double > f_period
Data< helper::vector< unsigned
int > > 
f_DOFsX
Data< helper::vector< unsigned
int > > 
f_DOFsV
Data< double > f_stopAt
Data< double > f_keperiod

Protected Attributes

core::componentmodel::behavior::BaseMechanicalState * mmodel
std::ofstream * outfile
unsigned int nextTime
double lastTime
bool kineticEnergyThresholdReached
double timeToTestEnergyIncrease
double savedKineticEnergy

Detailed Description

Write State vectors to file at a given set of time instants A period can be etablished at the last time instant The DoFs to print can be chosen using DOFsX and DOFsV Stop to write the state if the kinematic energy reach a given threshold (stopAt) The energy will be measured at each period determined by keperiod.

Definition at line 54 of file WriteState.h.


Constructor & Destructor Documentation

sofa::component::misc::WriteState::WriteState (  ) 

sofa::component::misc::WriteState::~WriteState (  )  [virtual]

Definition at line 66 of file WriteState.inl.

References outfile.


Member Function Documentation

template<class T >
static bool sofa::component::misc::WriteState::canCreate ( T *&  obj,
core::objectmodel::BaseContext *  context,
core::objectmodel::BaseObjectDescription *  arg 
) [inline, static]

Pre-construction check method called by ObjectFactory.

Check that DataTypes matches the MechanicalState.

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

Definition at line 92 of file WriteState.h.

References sofa::core::objectmodel::BaseContext::getMechanicalState().

void sofa::component::misc::WriteState::handleEvent ( sofa::core::objectmodel::Event *  e  )  [virtual]

void sofa::component::misc::WriteState::init ( void   )  [virtual]

void sofa::component::misc::WriteState::reset ( void   )  [virtual]


Field Documentation

Definition at line 64 of file WriteState.h.

Definition at line 63 of file WriteState.h.

Definition at line 57 of file WriteState.h.

Referenced by sofa::component::misc::WriteStateCreator::addWriteState(), and init().

Definition at line 60 of file WriteState.h.

Definition at line 66 of file WriteState.h.

Referenced by handleEvent(), init(), and reset().

Definition at line 62 of file WriteState.h.

Referenced by handleEvent().

Definition at line 65 of file WriteState.h.

Referenced by handleEvent().

Definition at line 61 of file WriteState.h.

Referenced by handleEvent().

Definition at line 59 of file WriteState.h.

Referenced by handleEvent().

Definition at line 58 of file WriteState.h.

Referenced by handleEvent().

Definition at line 73 of file WriteState.h.

Referenced by handleEvent(), and reset().

Definition at line 72 of file WriteState.h.

Referenced by handleEvent(), and reset().

Definition at line 69 of file WriteState.h.

Referenced by handleEvent(), and init().

Definition at line 71 of file WriteState.h.

Referenced by handleEvent(), and reset().

std::ofstream* sofa::component::misc::WriteState::outfile [protected]

Definition at line 70 of file WriteState.h.

Referenced by handleEvent(), init(), and ~WriteState().

Definition at line 75 of file WriteState.h.

Referenced by handleEvent(), and reset().

Definition at line 74 of file WriteState.h.

Referenced by handleEvent(), init(), and reset().


The documentation for this class was generated from the following files:

Generated on Sun Nov 23 04:21:16 2008 for Sofa by  doxygen 1.5.7.1