Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

OSCAR::CoordinateVector Class Reference
[Math]

Create a vector that has coordinate space information. More...

#include <CoordinateVector.h>

Inheritance diagram for OSCAR::CoordinateVector:

Inheritance graph
[legend]
List of all members.

Public Methods

 CoordinateVector (unsigned int size, const double *array=0)
 CoordinateVector (unsigned int size, const CoordinateStatusArray &statArray, OSCARError &err=DUMMY_ERROR(noError))
 CoordinateVector (unsigned int size, const CoordinateStatusArray &statArray, const double *array, OSCARError &err=DUMMY_ERROR(noError))
 CoordinateVector (const CoordinateVector &rhs)
virtual ~CoordinateVector ()
CoordinateVector & operator= (const CoordinateVector &rhs)
CoordinateVector & operator= (const Vector &rhs)
CoordinateVector & operator= (const double rhs)
bool Grow (unsigned int growth)

Detailed Description

Author:
Chetan Kapoor
Create a vector that has coordinate space information. CoordinateVector is multiply derived from Vector and CoordinateSpace. This is done because a coordinate vector not only contains values for each vector element, but can also contain other properties for each coordinate. These properties are inherited from CoordinateSpace. Basically, the Vector in CoordinateVector is used to store the coordinate parameters, whereas the CoordinateSpace provides the functionality to set a particular joint as Active/Inactive. When using CoordinateVector, all the functionality of Vector will apply as is to the CoordinateVector. For example, when you call the GetSum() method defined in Vector, it will only act on the Vector part of CoordinateVector. The constructors and the operator= methods are redefined below though.


Constructor & Destructor Documentation

OSCAR::CoordinateVector::CoordinateVector unsigned int    size,
const double *    array = 0
[explicit]
 

Constructor.

This is the constructor for an object of type CoordinateVector. Use this to construct an CoordinateVector object of length 'size', and a pointer to an array of type double. By default, the array pointer is null, and the status of all joints is set to Active.

Parameters:
size The size of the CoordinateVector. This should be > 0.
array A pointer to an array (of type double) whose size should be equal to the value of the first argument 'size'. Values from this array will be used to initialize the CoordinateVector values. This function will abort if the size of the array is not equal to 'size', or if size = 0.
See also:
CoordinateVector(unsigned int size, const RRCoordinateStatusArray& statArray, OSCARError& err = OSCARError(noError))

CoordinateVector(unsigned int size, const RRCoordinateStatusArray& statArray, const double* array, OSCARError& err = OSCARError(noError))

OSCAR::CoordinateVector::CoordinateVector unsigned int    size,
const CoordinateStatusArray   statArray,
OSCARError   err = DUMMY_ERROR(noError)
 

Constructor.

This is the constructor for an object of type CoordinateVector. Use this to construct an CoordinateVector object of length 'size', and intialize the status of each joint (whether Active or Inactive) according to the contents of the statArray. An error occurs when the argument size is not equal to the size of statArray. This function will crash if size = 0. Call GetError() for more information.

Parameters:
size The size of the CoordinateVector. This should be > 0.
statArray The RRCoordinateStatus Array whose size should be equal to that specified in the first argument 'size'. Values from statArray will be used to set the intial status (Active or Inactive) of each joint.
err Upon return, this will contain the error status of the constructor call.
Exceptions:
arraySizeMismatch arraySizeMismatch
See also:
CoordinateVector(unsigned int size, const double* array = 0)

CoordinateVector(unsigned int size, const RRCoordinateStatusArray& statArray, const double* array, OSCARError& err = OSCARError(noError))

OSCAR::CoordinateVector::CoordinateVector unsigned int    size,
const CoordinateStatusArray   statArray,
const double *    array,
OSCARError   err = DUMMY_ERROR(noError)
 

Constructor.

This is the constructor for an object of type CoordinateVector. Use this to construct an CoordinateVector object of length 'size', a pointer to an array of type double, and intialize the status of each joint (whether Active or Inactive) according to the contents of the statArray. An error occurs when the argument size is not equal to the size of statArray. This function will crash if size = 0. Call GetError() for more information.

Parameters:
size The size of the CoordinateVector. This should be > 0
statArray The RRCoordinateStatus Array whose size should be equal to that specified in the first argument 'size'. Values from statArray will be used to set the intial status (Active or Inactive) of each joint.
array A pointer to an array (of type double) whose size should be equal to the value of the first argument 'size'. Values from this array will be used to initialize the CoordinateVector values. This function will abort if the size of the array is not equal to 'size', or if size = 0.
err Upon return, this will contain the error status of the constructor call.
Exceptions:
arraySizeMismatch arraySizeMismatch
See also:
CoordinateVector(unsigned int size, const double* array = 0)

CoordinateVector(unsigned int size, const RRCoordinateStatusArray& statArray, OSCARError& err = OSCARError(noError))

OSCAR::CoordinateVector::CoordinateVector const CoordinateVector &    rhs
 

Copy Constructor.

This is the Copy Constructor for an object of type CoordinateVector. Use this to create an CoordinateVector object from an existing CoordinateVector object.

Parameters:
rhs A CoordinateSpace object that is used to create the new object.

virtual OSCAR::CoordinateVector::~CoordinateVector   [virtual]
 

Destructor.

This is the destructor for an object of type CoordinateVector.


Member Function Documentation

bool OSCAR::CoordinateVector::Grow unsigned int    growth
 

Increase the length of a Coordinate Vector. New elements CoordinateStatus is set to Active and the values of the new elements to 0.0 This method is used to increase the size(number of elements) in an CoordinateVector object.

Parameters:
growth The number of elements by which the CoordinateVector should grow.
Returns:
true if successful and false if not.

Reimplemented from OSCAR::CoordinateSpace.

CoordinateVector& OSCAR::CoordinateVector::operator= const double    rhs [inline]
 

Assignment Operator.

Sets all of the numerical values to the argument.

Parameters:
rhs A double
Returns:
A reference to the object on the left hand side of the = operator.

Reimplemented in OSCAR::JointVector.

CoordinateVector& OSCAR::CoordinateVector::operator= const Vector   rhs
 

Assignment Operator.

Copies the first 6 numerical values from the rhs into the current object. If the size of rhs is <6, this method does nothing.

Parameters:
rhs An Vector object that goes on the right hand side of the = operator.
Returns:
A reference to the object on the left hand side of the = operator.

Reimplemented in OSCAR::HandPose, and OSCAR::JointVector.

CoordinateVector& OSCAR::CoordinateVector::operator= const CoordinateVector &    rhs
 

Assignment Operator.

Copies one CoordinateVector object into another. If the size of the objects does not match, then the object being copied into the LHS is modified to match the RHS.

Parameters:
rhs A CoordinateVector object that goes on the right hand side of the = operator.
Returns:
A reference to the object on the left hand side of the = operator.


The documentation for this class was generated from the following file:
RRG Homepage OSCAR Overview OSCAR Tutorials Simulations