sofa::component::misc::ReadState Class Reference

Read State vectors from file at each timestep. More...

#include <ReadState.h>

Inheritance diagram for sofa::component::misc::ReadState:

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

Collaboration graph
[legend]

Public Member Functions

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

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< double > f_interval
Data< double > f_shift

Protected Attributes

core::componentmodel::behavior::BaseMechanicalState * mmodel
std::ifstream * infile
double nextTime
double lastTime

Detailed Description

Read State vectors from file at each timestep.

Definition at line 49 of file ReadState.h.


Constructor & Destructor Documentation

sofa::component::misc::ReadState::ReadState (  ) 

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

Definition at line 54 of file ReadState.inl.

References infile.


Member Function Documentation

template<class T >
static bool sofa::component::misc::ReadState::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.

Reimplemented in sofa::component::misc::CompareState.

Definition at line 81 of file ReadState.h.

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

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

Handle an event.

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

Reimplemented in sofa::component::misc::CompareState.

Definition at line 85 of file ReadState.inl.

References processReadState().

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

Initialization method called at graph modification, during bottom-up traversal.

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

Definition at line 60 of file ReadState.inl.

References reset().

Referenced by sofa::component::misc::CompareStateCreator::addCompareState(), and sofa::component::misc::ReadStateCreator::addReadState().

void sofa::component::misc::ReadState::processReadState ( double  time  ) 

Definition at line 103 of file ReadState.inl.

References lastTime, processReadState(), and setTime().

void sofa::component::misc::ReadState::processReadState (  ) 

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

void sofa::component::misc::ReadState::setTime ( double  time  ) 

Definition at line 98 of file ReadState.inl.

References nextTime, and reset().

Referenced by processReadState().


Field Documentation

Definition at line 54 of file ReadState.h.

std::ifstream* sofa::component::misc::ReadState::infile [protected]


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