![]() |
Computer Assited Medical Intervention Tool Kit
version 3.3
|
Class that describes a load to be used in the simulation. More...
#include <Load.h>
Public Member Functions | |
void | addEvent (ValueEvent *ve) |
Insert an event from the particular load the load is set to value v when time is equal to t. More... | |
void | addTarget (std::string currentData) |
add a lots of new targets using a description string (...) More... | |
void | addTarget (unsigned int target) |
add a new target More... | |
void | addValueEvent (const double v, const double d) |
set the valueEvent. More... | |
virtual void | ansysPrint (std::ostream &) const |
Print the load in ansys format (BEWARE: not everything is implemented) More... | |
void | getDirection (double &x, double &y, double &z) const |
Get the direction. More... | |
Direction | getDirection () const |
get direction object (a copy) More... | |
int | getTarget (const unsigned int target) const |
Get a target by index. More... | |
TargetList | getTargetList () const |
get the complete list More... | |
std::string | getType () const |
get the type string, has to be impleted in subclasses More... | |
Unit | getUnit () const |
get the unit More... | |
double | getValue (const double d=0.0) |
The current value at date d (default: d = 0.0). More... | |
ValueEvent * | getValueEvent (const unsigned int i) const |
Get a the ValueEvent. More... | |
bool | isActive (const double t) |
return true if the load is active at time t More... | |
Load () | |
Constructor. More... | |
unsigned int | numberOfTargets () const |
get the number of target More... | |
unsigned int | numberOfValueEvents () const |
get the nr of value event More... | |
void | setAllEvents (std::vector< ValueEvent * > &) |
set all value events More... | |
void | setDirection (const double x, const double y, const double z) |
Set the direction using 3 coordinates. More... | |
void | setDirection (const Direction &) |
Set the direction using another direction. More... | |
void | setTargetList (const TargetList &) |
set the complete list More... | |
void | setUnit (const Unit u) |
set the unit More... | |
void | xmlPrint (std::ostream &) const |
Print to an ostream. More... | |
virtual | ~Load () |
destructor is deleting all the value events (BEWARE!!!) More... | |
Static Public Member Functions | |
static Load * | LoadFactory (std::string type) |
static methode to create a new load using a specific type (return NULL if type is unknown) More... | |
Protected Attributes | |
Direction | dir |
std::string | typeString |
Unit | unit |
Private Member Functions | |
void | deleteEventList () |
delete all the list More... | |
Private Attributes | |
std::vector< ValueEvent * > | eventList |
the list of different events More... | |
TargetList | targetList |
the list of targets More... | |
Friends | |
std::ostream & | operator<< (std::ostream &, Load) |
print to an output stream in XML format. More... | |
Class that describes a load to be used in the simulation.
This load can have different types Translation, Rotation, Force and Pressure. This load can be created by parsing in an XML file or by load library programming A load could be save in XML format as well using the << operator. The load is set automatically when the method setTarget is called.
a Load contains a Type, AppliedTo, 3 Directions x/y/z, a Unit and several ValueEvent (value, date)
All value events that are added to the load are then taking over by the load (i.e. when the load is deleted, it will delete all its value event.
Load::Load | ( | ) |
Constructor.
|
virtual |
destructor is deleting all the value events (BEWARE!!!)
void Load::addEvent | ( | ValueEvent * | ve | ) |
Insert an event from the particular load the load is set to value v when time is equal to t.
ve | the force to add in the list at the correct place |
void Load::addTarget | ( | std::string | currentData | ) |
add a lots of new targets using a description string (...)
void Load::addTarget | ( | unsigned int | target | ) |
add a new target
void Load::addValueEvent | ( | const double | v, |
const double | d | ||
) |
set the valueEvent.
v | the value |
d | the date at which the value is applied |
|
virtual |
Print the load in ansys format (BEWARE: not everything is implemented)
Reimplemented in Force, and Translation.
|
private |
delete all the list
void Load::getDirection | ( | double & | x, |
double & | y, | ||
double & | z | ||
) | const |
Get the direction.
Direction Load::getDirection | ( | ) | const |
get direction object (a copy)
int Load::getTarget | ( | const unsigned int | target | ) | const |
Get a target by index.
target | the target index in the list |
TargetList Load::getTargetList | ( | ) | const |
get the complete list
std::string Load::getType | ( | ) | const |
get the type string, has to be impleted in subclasses
Unit Load::getUnit | ( | ) | const |
get the unit
double Load::getValue | ( | const double | d = 0.0 | ) |
The current value at date d (default: d = 0.0).
eg: if we have :
# | date | value |
0 | 0.5 | 10.0 |
1 | 1.5 | 100.0 |
we want to have:
Schematically:
^ | 100+ * * * * * | * 10+ * | * +-*-*-*-*-+----—+-----—+---—> 0 0.5 1.0 1.5
ValueEvent* Load::getValueEvent | ( | const unsigned int | i | ) | const |
Get a the ValueEvent.
bool Load::isActive | ( | const double | t | ) |
return true if the load is active at time t
|
static |
static methode to create a new load using a specific type (return NULL if type is unknown)
unsigned int Load::numberOfTargets | ( | ) | const |
get the number of target
unsigned int Load::numberOfValueEvents | ( | ) | const |
get the nr of value event
void Load::setAllEvents | ( | std::vector< ValueEvent * > & | ) |
set all value events
void Load::setDirection | ( | const double | x, |
const double | y, | ||
const double | z | ||
) |
Set the direction using 3 coordinates.
void Load::setDirection | ( | const Direction & | ) |
Set the direction using another direction.
void Load::setTargetList | ( | const TargetList & | ) |
set the complete list
void Load::setUnit | ( | const Unit | u | ) |
set the unit
void Load::xmlPrint | ( | std::ostream & | ) | const |
Print to an ostream.
|
friend |
print to an output stream in XML format.
|
protected |
|
private |
the list of different events
|
private |
the list of targets
|
protected |
Referenced by Acceleration::Acceleration(), Pressure::Pressure(), and Rotation::Rotation().
|
protected |
Referenced by Acceleration::Acceleration(), Pressure::Pressure(), and Rotation::Rotation().