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

OSCAR::CoordinateSpace Class Reference
[Math]

Specifies the properties of a coordinate space. More...

#include <CoordinateSpace.h>

Inheritance diagram for OSCAR::CoordinateSpace:

Inheritance graph
[legend]
List of all members.

Public Methods

 CoordinateSpace (unsigned int spaceDim, OSCARError &err=DUMMY_ERROR(noError))
 CoordinateSpace (const CoordinateStatusArray &coordinateStatus)
 CoordinateSpace (const CoordinateSpace &rhs)
virtual ~CoordinateSpace ()
CoordinateSpace & operator= (const CoordinateSpace &rhs)
unsigned int GetActiveDimensionSize () const
unsigned int GetDimensionSize () const
bool SetCoordinateStatus (unsigned int coordNo, CoordinateStatus status)
bool SetCoordinateStatus (const CoordinateStatusArray &statusArray)
void SetAllCoordinateStatus (const CoordinateStatus &status)
bool GetCoordinateStatus (unsigned int coordNo, CoordinateStatus &status)
CoordinateStatus GetCoordinateStatus (unsigned int coordNo) const
bool GetCoordinateStatus (CoordinateStatusArray &statusArray)
const CoordinateStatusArrayGetCoordinateStatus () const
bool Grow (unsigned int growth)

Protected Methods

void updateActiveDimSize ()

Protected Attributes

CoordinateStatusArraycoordinateStatus
unsigned int activeSpaceDim

Detailed Description

Author:
Chetan Kapoor
Specifies the properties of a coordinate space, such as DOF, ActiveDOF, status of a DOF, etc. Use this class as a base class for any other class that represents a coordinate space. Examples of coordinate spaces are joint space, effector space, task space, etc. This class only works for an 'n' dimensional space.


Constructor & Destructor Documentation

OSCAR::CoordinateSpace::CoordinateSpace unsigned int    spaceDim,
OSCARError   err = DUMMY_ERROR(noError)
 

Constructor.

Constructs an CoordinateSpace of size 'spaceDim' with Active coordinates. being Active.

Parameters:
spaceDim Defines the size of the space. An error is set if spaceDim==0. Call GetError() for more information.
err A reference to an object of type OSCARError
Exceptions:
invalidArraySize invalidArraySize

OSCAR::CoordinateSpace::CoordinateSpace const CoordinateStatusArray   coordinateStatus
 

Constructor.

Constructs CoordinateSpace the same size as the RRCoordinateStatusArray with coordinate statuses initialized by the RRCoordinateStatusArray.

Parameters:
coordinateStatus An array of CoordinateSpace's.

OSCAR::CoordinateSpace::CoordinateSpace const CoordinateSpace &    rhs
 

Copy Constructor.

Constructs an CoordinateSpace object from an existing CoordinateSpace object.

Parameters:
rhs An CoordinateSpace object that will be used to initialize this new object.

virtual OSCAR::CoordinateSpace::~CoordinateSpace   [virtual]
 

Virtual Destructor.

This is the Destructor for an object of type CoordinateSpace.


Member Function Documentation

unsigned int OSCAR::CoordinateSpace::GetActiveDimensionSize   const
 

Get the number of active dimensions.

Return the number of the coordinates that are set to Active.

Returns:
The size of the active dimension space.

const CoordinateStatusArray& OSCAR::CoordinateSpace::GetCoordinateStatus   const
 

Get the RRCoordinateStatusArray of a coordinate space.

Returns a const reference to the RRCoordinateStatusArray for this CoordinateSpace

Returns:
A constant reference to the RRCoordinateStatusArray for this CoordinateSpace.

bool OSCAR::CoordinateSpace::GetCoordinateStatus CoordinateStatusArray   statusArray
 

Get the RRCoordinateStatusArray of a coordinate space.

Copy the Active/Inactive status of each coordinate into argument which must be of size GetDimensionSize() or an error will be set.

Parameters:
statusArray RRCoordinateStatusArray to copy into.
Returns:
True if no errors. False if error. Call GetError() for more information.
Exceptions:
arraySizeMismatch arraySizeMismatch

CoordinateStatus OSCAR::CoordinateSpace::GetCoordinateStatus unsigned int    coordNo const
 

Get the status of a particular coordinate.

Gets the status of a particular coordinate without range check and is faster than GetCStatus(coordNo, status), but behavior is undefined for invalid coordinates. Valid coordinates are 0 to GetDimensionSize()-1.

Parameters:
coordNo Coordinate of interest.
Returns:
The RRCoordinateStatus of the coordinate.

bool OSCAR::CoordinateSpace::GetCoordinateStatus unsigned int    coordNo,
CoordinateStatus   status
 

Get the status of a particular coordinate.

Get the status of a particular coordinate. This method checks for range errors and is slower than GotCStatus(coordNo).

Parameters:
coordNo The coordinate of interest, an error set if not less than the size of the coordinate space.
status The RRCoordinateStatus value of Active or Inactive for the coordinate.
Returns:
True if no errors. False if there is an error. Call GetError() for more information.
Exceptions:
outOfRange outOfRange

unsigned int OSCAR::CoordinateSpace::GetDimensionSize   const
 

Get the number of dimensions in the coordinate space.

Get the number of dimensions in a CoordinateSpace.

Returns:
The size of the coordinate space.

bool OSCAR::CoordinateSpace::Grow unsigned int    growth
 

Increase the length of a Coordinate Space. New elements are set to Active.

This method is used to increase the size(number of elements) in an CoordinateSpace object.

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

Reimplemented in OSCAR::CoordinateVector.

CoordinateSpace& OSCAR::CoordinateSpace::operator= const CoordinateSpace &    rhs
 

Assignment operator.

Assignment operator for CoordinateSpace which will resize the calling object if the array being copied is not of the same size.

Parameters:
rhs An CoordinateSpace 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.

void OSCAR::CoordinateSpace::SetAllCoordinateStatus const CoordinateStatus   status
 

Set the status of all coordinates.

Sets all coordinate statuses to Active or Inactive.

Parameters:
status A RRCoordinateStatus value of Active or Inactive.

bool OSCAR::CoordinateSpace::SetCoordinateStatus const CoordinateStatusArray   statusArray
 

Set the RRCoordinateStatusArray of a coordinate space.

Set the the Active/Inactive status of each coordinate.

Parameters:
statusArray Array of desired status. An error is set if the size is not equal to the size of this coordinate space.
Returns:
True if no errors. False if there is an error. Call GetError() for more information.
Exceptions:
arraySizeMismatch arraySizeMismatch

bool OSCAR::CoordinateSpace::SetCoordinateStatus unsigned int    coordNo,
CoordinateStatus    status
 

Set the status of a particular coordinate.

Set the Active/Inactive status of a particular coordinate.

Parameters:
coordNo The coordinate for which you want to set the status. This should be less than the size of the coordinate space.
status A RRCoordinateStatus value of Active or Inactive.
Returns:
True if no errors. False if there is an error. Call GetError() for more information
Exceptions:
outOfRange outOfRange

void OSCAR::CoordinateSpace::updateActiveDimSize   [protected]
 

Update the number of dimensions that are active.

This method is used to update the variable activeSpaceDim. This variable keeps track of how many dimensions are active at a given time.


Member Data Documentation

unsigned int OSCAR::CoordinateSpace::activeSpaceDim [protected]
 

CoordinateStatusArray* OSCAR::CoordinateSpace::coordinateStatus [protected]
 


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