#include <PointToPointSpring.h>
Public Member Functions | |
PointToPointSpring () | |
Default constructor. | |
PointToPointSpring (std::string body1Name, SimTK::Vec3 point1, std::string body2Name, SimTK::Vec3 point2, double stiffness, double restlength) | |
PointToPointSpring (const PointToPointSpring &aPointToPointSpring) | |
Copy constructor. | |
virtual | ~PointToPointSpring () |
Destructor. | |
virtual Object * | copy () const |
Copy this force and return a pointer to the copy. | |
void | copyData (const PointToPointSpring &aPointToPointSpring) |
Copy the member data of the specified force. | |
virtual VisibleObject * | getDisplayer () const |
Get the visible object used to represent the spring. | |
virtual void | updateDisplayer (const SimTK::State &s) |
In case the ModelCompoenent has a visual representation, override this method to update the representation, typically this's done by recomputing anchor points and positions based on transforms obtained from current state. | |
virtual void | updateGeometry (const SimTK::State &s) |
PointToPointSpring & | operator= (const PointToPointSpring &aGenForce) |
Assignment operator. | |
void | setBody1Name (std::string body1Name) |
Spring end point bodies. | |
void | setBody2Name (std::string body2Name) |
std::string | getBody1Name () const |
std::string | getBody2Name () const |
void | setPoint1 (SimTK::Vec3 aPosition) |
Spring end points. | |
SimTK::Vec3 | getPoint1 () const |
void | setPoint2 (SimTK::Vec3 aPosition) |
SimTK::Vec3 | getPoint2 () const |
void | setStiffness (double stiffness) |
Spring stiffness. | |
double | getStiffness () const |
void | setRestlength (double restLength) |
Spring rest length. | |
double | getRestlength () const |
void | setup (Model &model) |
Subclasses should override these methods appropriately. | |
void | createSystem (SimTK::MultibodySystem &system) const |
Default is to create a ForceAdapter which is a SimTK::Force::Custom as the udnerlying computational component. | |
virtual OpenSim::Array < std::string > | getRecordLabels () const |
Provide name(s) of the quantities (column labels) of the force value(s) to be reported. | |
virtual OpenSim::Array< double > | getRecordValues (const SimTK::State &state) const |
Provide the value(s) to be reported that correspond to the labels. | |
OPENSIM_DECLARE_DERIVED (PointToPointSpring, Force) | |
Protected Attributes | |
PropertyStr | _propBody1Name |
Name of Body to which 1 end of the spring is attached. | |
PropertyStr | _propBody2Name |
Name of Body to which the 2nd end of the spring is attached. | |
PropertyDblVec3 | _propPoint1 |
Point of spring application on each body. | |
PropertyDblVec3 | _propPoint2 |
PropertyDbl | _propStiffness |
Spring stiffness property. | |
PropertyDbl | _propRestlength |
Spring rest length property. | |
std::string & | _body1Name |
Names of bodies to which ends of the spring are attached. | |
std::string & | _body2Name |
SimTK::Vec3 & | _point1 |
Points of application on each body. | |
SimTK::Vec3 & | _point2 |
double & | _stiffness |
Spring stiffness. | |
double & | _restLength |
Spring rest length. | |
VisibleObject | _displayer |
how to display the Spring |
PointToPointSpring::PointToPointSpring | ( | ) |
Default constructor.
OpenSim::PointToPointSpring::PointToPointSpring | ( | std::string | body1Name, | |
SimTK::Vec3 | point1, | |||
std::string | body2Name, | |||
SimTK::Vec3 | point2, | |||
double | stiffness, | |||
double | restlength | |||
) |
PointToPointSpring::PointToPointSpring | ( | const PointToPointSpring & | aForce | ) |
Copy constructor.
aForce | force to be copied. |
PointToPointSpring::~PointToPointSpring | ( | ) | [virtual] |
Destructor.
Object * PointToPointSpring::copy | ( | ) | const [virtual] |
Copy this force and return a pointer to the copy.
The copy constructor for this class is used.
Implements OpenSim::Force.
void PointToPointSpring::copyData | ( | const PointToPointSpring & | aPointToPointSpring | ) |
Copy the member data of the specified force.
aPointToPointSpring | PointToPointSpring providing the data to be copied |
Reimplemented from OpenSim::Force.
void PointToPointSpring::createSystem | ( | SimTK::MultibodySystem & | system | ) | const [virtual] |
Default is to create a ForceAdapter which is a SimTK::Force::Custom as the udnerlying computational component.
Create an underlying SimTK::Force to represent the OpenSim::Force in the computational system.
Subclasses override to employ other SimTK::Forces.
Create a SimTK::Force::Custom by default.
Reimplemented from OpenSim::Force.
std::string OpenSim::PointToPointSpring::getBody1Name | ( | ) | const [inline] |
std::string OpenSim::PointToPointSpring::getBody2Name | ( | ) | const [inline] |
VisibleObject * PointToPointSpring::getDisplayer | ( | ) | const [virtual] |
Get the visible object used to represent the spring.
Reimplemented from OpenSim::Object.
SimTK::Vec3 OpenSim::PointToPointSpring::getPoint1 | ( | ) | const [inline] |
SimTK::Vec3 OpenSim::PointToPointSpring::getPoint2 | ( | ) | const [inline] |
OpenSim::Array< std::string > PointToPointSpring::getRecordLabels | ( | ) | const [virtual] |
Provide name(s) of the quantities (column labels) of the force value(s) to be reported.
Provide names of the quantities (column labels) of the force value(s) reported.
Reimplemented from OpenSim::Force.
OpenSim::Array< double > PointToPointSpring::getRecordValues | ( | const SimTK::State & | state | ) | const [virtual] |
Provide the value(s) to be reported that correspond to the labels.
Reimplemented from OpenSim::Force.
double OpenSim::PointToPointSpring::getRestlength | ( | ) | const [inline] |
double OpenSim::PointToPointSpring::getStiffness | ( | ) | const [inline] |
OpenSim::PointToPointSpring::OPENSIM_DECLARE_DERIVED | ( | PointToPointSpring | , | |
Force | ||||
) |
PointToPointSpring & PointToPointSpring::operator= | ( | const PointToPointSpring & | aPointToPointSpring | ) |
Assignment operator.
Reimplemented from OpenSim::Force.
void OpenSim::PointToPointSpring::setBody1Name | ( | std::string | body1Name | ) | [inline] |
Spring end point bodies.
std::string | bodyName<1/2> |
void OpenSim::PointToPointSpring::setBody2Name | ( | std::string | body2Name | ) | [inline] |
void OpenSim::PointToPointSpring::setPoint1 | ( | SimTK::Vec3 | aPosition | ) | [inline] |
Spring end points.
Vec3 | point<1/2> |
void OpenSim::PointToPointSpring::setPoint2 | ( | SimTK::Vec3 | aPosition | ) | [inline] |
void OpenSim::PointToPointSpring::setRestlength | ( | double | restLength | ) | [inline] |
Spring rest length.
restLength |
void OpenSim::PointToPointSpring::setStiffness | ( | double | stiffness | ) | [inline] |
Spring stiffness.
stiffness |
void PointToPointSpring::setup | ( | Model & | model | ) | [virtual] |
Subclasses should override these methods appropriately.
Reimplemented from OpenSim::Force.
void PointToPointSpring::updateDisplayer | ( | const SimTK::State & | s | ) | [virtual] |
In case the ModelCompoenent has a visual representation, override this method to update the representation, typically this's done by recomputing anchor points and positions based on transforms obtained from current state.
Reimplemented from OpenSim::ModelComponent.
void PointToPointSpring::updateGeometry | ( | const SimTK::State & | s | ) | [virtual] |
std::string& OpenSim::PointToPointSpring::_body1Name [protected] |
Names of bodies to which ends of the spring are attached.
std::string& OpenSim::PointToPointSpring::_body2Name [protected] |
VisibleObject OpenSim::PointToPointSpring::_displayer [protected] |
how to display the Spring
SimTK::Vec3& OpenSim::PointToPointSpring::_point1 [protected] |
Points of application on each body.
SimTK::Vec3& OpenSim::PointToPointSpring::_point2 [protected] |
Name of Body to which 1 end of the spring is attached.
Name of Body to which the 2nd end of the spring is attached.
Point of spring application on each body.
Spring rest length property.
Spring stiffness property.
double& OpenSim::PointToPointSpring::_restLength [protected] |
Spring rest length.
double& OpenSim::PointToPointSpring::_stiffness [protected] |
Spring stiffness.