Hosted by: BerliOS Developer Logo

OpenMBV C++ Interface

BerliOS Project Page
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes
OpenMBV::CoilSpring Class Reference

A coil spring. More...

#include <coilspring.h>

Inheritance diagram for OpenMBV::CoilSpring:
OpenMBV::DynamicColoredBody OpenMBV::Body OpenMBV::Object

List of all members.

Public Types

enum  Type { tube, scaledTube, polyline }

Public Member Functions

 CoilSpring ()
 Default Constructor.
std::string getClassName ()
 Retrun the class name.
void append (const std::vector< double > &row)
 Pure virtual function to append a vector<double> row to the data.
int getRows ()
 Get the number of rows of the default data.
std::vector< double > getRow (int i)
 Get row number i of the default data.
void setSpringRadius (double radius)
double getSpringRadius ()
void setCrossSectionRadius (double radius)
 The radius of the coil spring cross-section if type=tube or type=scaledTube.
double getCrossSectionRadius ()
void setScaleFactor (double scale)
double getScaleFactor ()
void setNumberOfCoils (double nr)
double getNumberOfCoils ()
void setNominalLength (double l)
 Set the nominal length of the coil spring.
double getNominalLength ()
void setType (Type t)
 The type of the coil spring.
Type getType ()
virtual void initializeUsingXML (xercesc::DOMElement *element)
 Initializes the time invariant part of the object using a XML node.
xercesc::DOMElement * writeXMLFile (xercesc::DOMNode *parent)

Protected Member Functions

void createHDF5File ()
void openHDF5File ()
virtual ~CoilSpring ()
 Destructor.

Protected Attributes

H5::VectorSerie< double > * data
double springRadius
double crossSectionRadius
double scaleFactor
double numberOfCoils
double nominalLength
Type type

Detailed Description

A coil spring.

HDF5-Dataset: The HDF5 dataset of this object is a 2D array of double precision values. Each row represents one dataset in time. A row consists of the following columns in order given in world frame: time, "from" point x, "from" point y, "from" point z, "to" point x, "to" point y, "to" point z, color


Member Function Documentation

void OpenMBV::CoilSpring::append ( const std::vector< double > &  row) [inline, virtual]

Pure virtual function to append a vector<double> row to the data.

NOTE that this is an convinience function, because most OpenMBV data is of this type. If you do not need this spezial type, simple define this function with empty body and create your own spezific append function

Implements OpenMBV::Body.

std::vector<double> OpenMBV::CoilSpring::getRow ( int  i) [inline, virtual]

Get row number i of the default data.

NOTE: see also append()

Implements OpenMBV::Body.

int OpenMBV::CoilSpring::getRows ( ) [inline, virtual]

Get the number of rows of the default data.

Returns -1, if no default data is avaliable. NOTE: see also append()

Implements OpenMBV::Body.

void OpenMBV::CoilSpring::setCrossSectionRadius ( double  radius) [inline]

The radius of the coil spring cross-section if type=tube or type=scaledTube.

If type=polyline this parameter defines the point size of the polyline. If crossSectionRadius is less then 0, the cross-section radius is choosen automatically.

void OpenMBV::CoilSpring::setNominalLength ( double  l) [inline]

Set the nominal length of the coil spring.

This parameter is only usefull, if type=scaledTube: in this case the cross-section of the coil is an exact circle if the spring length is nominalLength. In all other cases the cross-section scales with the spring length and is getting a ellipse. If nominalLength is less than 0, the nominalLength is choosen automatically.

void OpenMBV::CoilSpring::setType ( Type  t) [inline]

The type of the coil spring.

"tube": The coil spring geometry is an extrusion of a circle along the spring center line; "scaledTube": The coil spring geometry is an extrusion of a circle along the spring center line with a spring length of nominalLength. This geometry is scaled as a whole for each other spring length. This type is much faster than "tube"; "polyline": The coil spring geometry is a polyline representing the the spring center line. this is the faster spring visualisation;


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