Joint Class Reference

#include <Joint.h>

Inheritance diagram for Joint:

Actuator Sensor SimObject SimObject List of all members.

Public Member Functions

 Joint ()
virtual std::string getKind () const
virtual void addToLists (std::vector< Sensorport * > &sensorportList, std::vector< Actuatorport * > &actuatorportList, std::vector< Actuator * > &actuatorList)
virtual void addToDescriptions (std::vector< ObjectDescription > &objectDescriptionTree, int depth)
virtual void setValue (double value, int port)
virtual void computeValue (double &value, int portId)
virtual void act (bool initial)
virtual SimObjectclone () const
void setMaxSpeed (double value)
void setMaxValue (double value)
void setMinValue (double value)
void setInitialValue (double value)
void setJointType (JointType jointType)
void setAxisType (AxisType axisType)
virtual double getMaxValue (int portId) const
virtual double getMinValue (int portId) const

Protected Attributes

JointType jointType
AxisType axisType
double maxValue
double minValue
double maxSpeed
double currentValue
double destValue

Detailed Description

Definition at line 38 of file Joint.h.


Constructor & Destructor Documentation

Joint::Joint (  ) 

Constructor

Definition at line 14 of file Joint.cpp.

References axisType, currentValue, destValue, jointType, maxSpeed, maxValue, minValue, rotationJoint, and xAxis.

Referenced by clone().


Member Function Documentation

void Joint::act ( bool  initial  )  [virtual]

Let the actuator do what it is supposed to do

Parameters:
initial Is this the initial step?

Implements Actuator.

Definition at line 67 of file Joint.cpp.

References axisType, SimObject::childNodes, currentValue, destValue, jointType, Vector3d::normalize(), SimObject::position, Vector3d::rotate(), SimObject::rotation, rotationJoint, Matrix3d::setRotationAroundAxis(), Vector3d::v, xAxis, yAxis, and zAxis.

void Joint::addToDescriptions ( std::vector< ObjectDescription > &  objectDescriptionTree,
int  depth 
) [virtual]

Adds descriptions of the object and its children to a list

Parameters:
objectDescriptionTree The list of descriptions
The depth of the object in the object tree

Reimplemented from SimObject.

Definition at line 37 of file Joint.cpp.

References SimObject::addToDescriptions(), ObjectDescription::depth, SimObject::fullName, ObjectDescription::fullName, ObjectDescription::name, OBJECT_TYPE_ACTUATORPORT, OBJECT_TYPE_SENSORPORT, and ObjectDescription::type.

void Joint::addToLists ( std::vector< Sensorport * > &  sensorportList,
std::vector< Actuatorport * > &  actuatorportList,
std::vector< Actuator * > &  actuatorList 
) [virtual]

Adds the object to some internal lists

Parameters:
sensorportList A list of all sensor ports in the scene
actuatorportList A list of all actuator ports in the scene
actuatorList A list of all actuators in the scene

Reimplemented from SimObject.

Definition at line 25 of file Joint.cpp.

References doubleSensor, maxValue, and minValue.

SimObject * Joint::clone (  )  const [virtual]

Clones the object and its child nodes

Returns:
A pointer to a copy of the object

Reimplemented from SimObject.

Definition at line 125 of file Joint.cpp.

References SimObject::addChildNode(), axisType, SimObject::childNodes, destValue, SimObject::fullName, Joint(), jointType, maxSpeed, maxValue, minValue, SimObject::name, SimObject::position, SimObject::rotation, SimObject::setFullName(), SimObject::setName(), and SimObject::setPosition().

void Joint::computeValue ( double &  value,
int  portId 
) [virtual]

Computes the position of the joint

Parameters:
value The value
portId The id of the sensorport

Reimplemented from Sensor.

Definition at line 120 of file Joint.cpp.

References currentValue, and M_PI.

virtual std::string Joint::getKind (  )  const [inline, virtual]

Returns a string describing the kind of object

Returns:
The kind

Reimplemented from Actuator.

Definition at line 63 of file Joint.h.

virtual double Joint::getMaxValue ( int  portId  )  const [inline, virtual]

Returns the maximum value of a sensor

Parameters:
portId The id of the sensorport
Returns:
The value

Definition at line 137 of file Joint.h.

References maxValue.

virtual double Joint::getMinValue ( int  portId  )  const [inline, virtual]

Returns the minimum value of a sensor

Parameters:
portId The id of the sensorport
Returns:
The value

Definition at line 143 of file Joint.h.

References minValue.

void Joint::setAxisType ( AxisType  axisType  ) 

Sets the axis type

Parameters:
axisType The axis type

Definition at line 205 of file Joint.cpp.

Referenced by SAX2Handler::parseJointAttributes().

void Joint::setInitialValue ( double  value  ) 

Sets the initial value

Parameters:
value The initial value

Definition at line 176 of file Joint.cpp.

References destValue, jointType, M_PI, and rotationJoint.

Referenced by SAX2Handler::parseJointAttributes().

void Joint::setJointType ( JointType  jointType  ) 

Sets the joint type

Parameters:
jointType The joint type

Definition at line 185 of file Joint.cpp.

References M_PI, maxSpeed, maxValue, minValue, and rotationJoint.

Referenced by SAX2Handler::parseJointAttributes().

void Joint::setMaxSpeed ( double  value  ) 

Sets the maximum speed

Parameters:
value The maximum speed

Definition at line 149 of file Joint.cpp.

References jointType, M_PI, maxSpeed, and rotationJoint.

Referenced by SAX2Handler::parseJointAttributes().

void Joint::setMaxValue ( double  value  ) 

Sets the maximum value

Parameters:
value The maximum value

Definition at line 158 of file Joint.cpp.

References maxValue.

Referenced by SAX2Handler::parseJointAttributes().

void Joint::setMinValue ( double  value  ) 

Sets the minimum value

Parameters:
value The minimum value

Definition at line 167 of file Joint.cpp.

References minValue.

Referenced by SAX2Handler::parseJointAttributes().

void Joint::setValue ( double  value,
int  port 
) [virtual]

Sets the value of one actuatorport

Parameters:
value The value
port The port

Implements Actuator.

Definition at line 58 of file Joint.cpp.

References destValue, jointType, M_PI, and rotationJoint.


Member Data Documentation

AxisType Joint::axisType [protected]

The axis of the joint

Definition at line 44 of file Joint.h.

Referenced by act(), clone(), and Joint().

double Joint::currentValue [protected]

The current value of the joint

Definition at line 52 of file Joint.h.

Referenced by act(), computeValue(), and Joint().

double Joint::destValue [protected]

The current destination value

Definition at line 54 of file Joint.h.

Referenced by act(), clone(), Joint(), setInitialValue(), and setValue().

JointType Joint::jointType [protected]

The type of the joint

Definition at line 42 of file Joint.h.

Referenced by act(), clone(), Joint(), setInitialValue(), setMaxSpeed(), and setValue().

double Joint::maxSpeed [protected]

The speed of the joint

Definition at line 50 of file Joint.h.

Referenced by clone(), Joint(), setJointType(), and setMaxSpeed().

double Joint::maxValue [protected]

The maximum value

Definition at line 46 of file Joint.h.

Referenced by addToLists(), clone(), getMaxValue(), Joint(), setJointType(), and setMaxValue().

double Joint::minValue [protected]

The minimum value

Definition at line 48 of file Joint.h.

Referenced by addToLists(), clone(), getMinValue(), Joint(), setJointType(), and setMinValue().


The documentation for this class was generated from the following files:
Generated on Thu Dec 7 01:39:31 2006 for DT2005.panorama by  doxygen 1.4.7