OpenSim::ModelScaler Class Reference

A class for scaling a model. More...

#include <ModelScaler.h>

Inheritance diagram for OpenSim::ModelScaler:
OpenSim::Object

List of all members.

Public Member Functions

 ModelScaler ()
 Default constructor.
 ModelScaler (const ModelScaler &aModelScaler)
 Copy constructor.
virtual ~ModelScaler ()
 Destructor.
virtual Objectcopy () const
 Copy this scaling params and return a pointer to the copy.
ModelScaleroperator= (const ModelScaler &aModelScaler)
 Assignment operator.
void copyData (const ModelScaler &aModelScaler)
 Copy data members from one ModelScaler to another.
bool processModel (SimTK::State &s, Model *aModel, const std::string &aPathToSubject="", double aFinalMass=-1.0)
void addMeasurement (Measurement *aMeasurement)
 add a measurement
void addScale (Scale *aScale)
 add a scale factor to current scaleSet
bool getApply () const
void setApply (bool aApply)
MeasurementSetgetMeasurementSet ()
void setMeasurementSet (MeasurementSet &measurementSet)
ScaleSetgetScaleSet ()
void setScaleSetFile (const std::string &aScaleSetFilename)
const Array< double > & getTimeRange () const
void setTimeRange (Array< double > timeRange)
bool getPreserveMassDist () const
void setPreserveMassDist (bool preserveMassDist)
Array< std::string > & getScalingOrder ()
void setScalingOrder (Array< std::string > &scalingOrder)
const std::string & getMarkerFileName () const
void setMarkerFileName (const std::string &aMarkerFileName)
const std::string & getOutputJointFileName () const
void setOutputJointFileName (const std::string &outputJointFileName)
const std::string & getOutputMuscleFileName () const
void setOutputMuscleFileName (const std::string &aOutputMuscleFileName)
const std::string & getOutputModelFileName () const
void setOutputModelFileName (const std::string &aOutputModelFileName)
const std::string & getOutputScaleFileName () const
void setOutputScaleFileName (const std::string &aOutputScaleFileName)
void setPrintResultFiles (bool aToWrite)
double computeMeasurementScaleFactor (const SimTK::State &s, const Model &aModel, const MarkerData &aMarkerData, const Measurement &aMeasurement) const
 For measurement based scaling, we average the scale factors across the different marker pairs used.

Static Public Member Functions

static void registerTypes ()
 Register the types used by this class.

Protected Attributes

PropertyBool _applyProp
bool & _apply
PropertyStrArray _scalingOrderProp
Array< std::string > & _scalingOrder
PropertyObj _measurementSetProp
MeasurementSet_measurementSet
PropertyObj _scaleSetProp
ScaleSet_scaleSet
PropertyStr _markerFileNameProp
std::string & _markerFileName
PropertyDblArray _timeRangeProp
Array< double > & _timeRange
PropertyBool _preserveMassDistProp
bool & _preserveMassDist
PropertyStr _outputJointFileNameProp
std::string & _outputJointFileName
PropertyStr _outputMuscleFileNameProp
std::string & _outputMuscleFileName
PropertyStr _outputModelFileNameProp
std::string & _outputModelFileName
PropertyStr _outputScaleFileNameProp
std::string & _outputScaleFileName
bool _printResultFiles

Detailed Description

A class for scaling a model.

The default method of scaling involves measuring distances between pairs of markers on the model and in a static pose to determine scale factors.

Author:
Peter Loan
Version:
1.0

Constructor & Destructor Documentation

ModelScaler::ModelScaler (  ) 

Default constructor.

ModelScaler::ModelScaler ( const ModelScaler aModelScaler  ) 

Copy constructor.

Parameters:
aModelScaler ModelScaler to be copied.
ModelScaler::~ModelScaler (  )  [virtual]

Destructor.


Member Function Documentation

void OpenSim::ModelScaler::addMeasurement ( Measurement aMeasurement  )  [inline]

add a measurement

void OpenSim::ModelScaler::addScale ( Scale aScale  )  [inline]

add a scale factor to current scaleSet

double ModelScaler::computeMeasurementScaleFactor ( const SimTK::State &  s,
const Model aModel,
const MarkerData aMarkerData,
const Measurement aMeasurement 
) const

For measurement based scaling, we average the scale factors across the different marker pairs used.

For each marker pair, the scale factor is computed by dividing the average distance between the pair in the experimental marker data by the distance between the pair on the model.

Object * ModelScaler::copy (  )  const [virtual]

Copy this scaling params and return a pointer to the copy.

The copy constructor for this class is used.

Returns:
Pointer to a copy of this ModelScaler.

Reimplemented from OpenSim::Object.

void ModelScaler::copyData ( const ModelScaler aModelScaler  ) 

Copy data members from one ModelScaler to another.

Parameters:
aModelScaler ModelScaler to be copied.
bool OpenSim::ModelScaler::getApply (  )  const [inline]
const std::string& OpenSim::ModelScaler::getMarkerFileName (  )  const [inline]
MeasurementSet& OpenSim::ModelScaler::getMeasurementSet (  )  [inline]
const std::string& OpenSim::ModelScaler::getOutputJointFileName (  )  const [inline]
const std::string& OpenSim::ModelScaler::getOutputModelFileName (  )  const [inline]
const std::string& OpenSim::ModelScaler::getOutputMuscleFileName (  )  const [inline]
const std::string& OpenSim::ModelScaler::getOutputScaleFileName (  )  const [inline]
bool OpenSim::ModelScaler::getPreserveMassDist (  )  const [inline]
ScaleSet& OpenSim::ModelScaler::getScaleSet (  )  [inline]
Array<std::string>& OpenSim::ModelScaler::getScalingOrder (  )  [inline]
const Array<double>& OpenSim::ModelScaler::getTimeRange (  )  const [inline]
ModelScaler & ModelScaler::operator= ( const ModelScaler aModelScaler  ) 

Assignment operator.

Returns:
Reference to this object.

Reimplemented from OpenSim::Object.

bool OpenSim::ModelScaler::processModel ( SimTK::State &  s,
Model aModel,
const std::string &  aPathToSubject = "",
double  aFinalMass = -1.0 
)
void ModelScaler::registerTypes (  )  [static]

Register the types used by this class.

void OpenSim::ModelScaler::setApply ( bool  aApply  )  [inline]
void OpenSim::ModelScaler::setMarkerFileName ( const std::string &  aMarkerFileName  )  [inline]
void OpenSim::ModelScaler::setMeasurementSet ( MeasurementSet measurementSet  )  [inline]
void OpenSim::ModelScaler::setOutputJointFileName ( const std::string &  outputJointFileName  )  [inline]
void OpenSim::ModelScaler::setOutputModelFileName ( const std::string &  aOutputModelFileName  )  [inline]
void OpenSim::ModelScaler::setOutputMuscleFileName ( const std::string &  aOutputMuscleFileName  )  [inline]
void OpenSim::ModelScaler::setOutputScaleFileName ( const std::string &  aOutputScaleFileName  )  [inline]
void OpenSim::ModelScaler::setPreserveMassDist ( bool  preserveMassDist  )  [inline]
void OpenSim::ModelScaler::setPrintResultFiles ( bool  aToWrite  )  [inline]
void OpenSim::ModelScaler::setScaleSetFile ( const std::string &  aScaleSetFilename  )  [inline]
void OpenSim::ModelScaler::setScalingOrder ( Array< std::string > &  scalingOrder  )  [inline]
void OpenSim::ModelScaler::setTimeRange ( Array< double >  timeRange  )  [inline]

Member Data Documentation

bool& OpenSim::ModelScaler::_apply [protected]
std::string& OpenSim::ModelScaler::_markerFileName [protected]
Array<std::string>& OpenSim::ModelScaler::_scalingOrder [protected]

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

Generated on Wed Dec 16 15:03:50 2009 for OpenSim by  doxygen 1.6.1