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

OSCAR::SkeletalPrimitive Class Reference
[ObstacleAvoidance]

Base for skeletal geometric primitives. More...

#include <SkeletalPrimitive.hpp>

Inheritance diagram for OSCAR::SkeletalPrimitive:

Inheritance graph
[legend]
List of all members.

Public Methods

 SkeletalPrimitive (double rad=0.0)
bool SetProperties (const vector< Vector3 > &pts, double rd)
virtual ~SkeletalPrimitive ()
virtual SkeletalPrimitive * Clone () const=0
double GetRadius () const
bool SetRadius (double rd)
unsigned int Size () const
 SkeletalPrimitive (const SkeletalPrimitive &arg)
SkeletalPrimitive & operator= (const SkeletalPrimitive &rhs)
virtual bool SetPoint (unsigned int index, const Vector3 &pt)
bool SetPoints (const vector< Vector3 > pts)
const Vector3GetPoint (unsigned int index, ReferenceFrame globalOrLocal=Global) const
virtual bool Update (const Xform &transform)
const vector< Vector3 > & GetPoints (ReferenceFrame globalOrLocal=Global) const
unsigned int AddPoint (const Vector3 &newPt)
bool Clear ()

Protected Methods

virtual bool updateInternalParameters ()

Protected Attributes

double radius
vector< Vector3point [2]

Detailed Description

Skeletal primitives are made up of skeletons consisting of one (sphere), two (cylispheres), or three points (plane, with an implicit fourth point) and the surfaces that are at a distance r (radius) from the skeleton.


Constructor & Destructor Documentation

OSCAR::SkeletalPrimitive::SkeletalPrimitive double    rad = 0.0
 

Constructor Used to create arrays of SkeletalPrimitive objects. Note: SetProperties(...) must be called before any other function.

virtual OSCAR::SkeletalPrimitive::~SkeletalPrimitive   [inline, virtual]
 

Destructor.

OSCAR::SkeletalPrimitive::SkeletalPrimitive const SkeletalPrimitive &    arg
 


Member Function Documentation

unsigned int OSCAR::SkeletalPrimitive::AddPoint const Vector3   newPt
 

Used to add a point to the skeletal primtive. This function is legacy code, contained only currently in the in the old non-xml parser, and should not under normal circumstances be used.

Parameters:
Vector3 newPt The new point to be added to the skeleton of the primitive
Returns:
unsigned int The new number of points in the skeleton of the primitive.

bool OSCAR::SkeletalPrimitive::Clear   [inline]
 

Resizes the primitive to size zero (no internal points) and sets the radius to zero. This function is legacy code, contained only in the non-xml parser, and should not under normal circumstances be used.

Returns:
true under all circumstances

virtual SkeletalPrimitive* OSCAR::SkeletalPrimitive::Clone   const [pure virtual]
 

Clone this object. Every derived class must implement this method.

Returns:
A pointer to the cloned object which MUST be deleted or there will be memory leak.

Implements OSCAR::Primitive.

Implemented in OSCAR::Cylisphere, OSCAR::Plane, and OSCAR::Sphere.

const Vector3* OSCAR::SkeletalPrimitive::GetPoint unsigned int    index,
ReferenceFrame    globalOrLocal = Global
const
 

Get the location of a single point in the skeletal primitive.

Parameters:
unsigned int index The index of the point which the user would like returned.
ReferenceFrame globalOrLocal Indicates if the returned location is w.r.t. the local or the global frame. Defaults to global.
Returns:
A pointer to the location of the point of interest. This pointer will be NULL if the given index is out of range for the particular primitive (greater than 0 for sphere, greater than 1 for cylisphere, greater than 3 for plane)

const vector<Vector3>& OSCAR::SkeletalPrimitive::GetPoints ReferenceFrame    globalOrLocal = Global const [inline]
 

Get the set of points that make up the skeleton of the primitive.

Parameters:
globalOrLocal Indicates if the points returned are w.r.t. the local or the global frame. Defaults to Global
Returns:
A const vector of Vector3s. Represents the skeletal points of the primitive.

double OSCAR::SkeletalPrimitive::GetRadius   const [inline]
 

Get the skeletal radius.

Returns:
radius of the primitive Use to query current radius of the primitive

SkeletalPrimitive& OSCAR::SkeletalPrimitive::operator= const SkeletalPrimitive &    rhs
 

virtual bool OSCAR::SkeletalPrimitive::SetPoint unsigned int    index,
const Vector3   pt
[virtual]
 

Update location (w.r.t. the local reference frame) of one point of the primtive. Update() is automatically called with the last Xform Update() was called with (identity if the function hasn't been called).

Parameters:
index Index of desired point
pt The new position (w.r.t. the local reference frame) of one point of the primitive
Returns:
False if index > number of points allowed in object

bool OSCAR::SkeletalPrimitive::SetPoints const vector< Vector3   pts
 

Update the location (w.r.t. the local reference frame) of all points in the primitive. Update() is automatically called with the last Xform Update() was called with (identitify if the function hasn't been called).

Parameters:
pts A vector of new point locations (w.r.t. the local reference frame) for the primitive
Returns:
false if size of the pts vector does not match the current size of the primitive. True otherwise

bool OSCAR::SkeletalPrimitive::SetProperties const vector< Vector3 > &    pts,
double    rd
 

Update private members of the primitive (position of points in the local reference frame, radius). Automatically calls the Update() function with the Xform which was last used (identity matrix if Update() has not been called).

Parameters:
pts New location of the skeletal points, w.r.t. the primitive's local reference frame
New radius of the obstacle
Returns:
true if successful, false if not (if the vector of Vector3s doesn't match the size of the primitive)

bool OSCAR::SkeletalPrimitive::SetRadius double    rd
 

Change skeletal radius.

Returns:
true
Parameters:
rd Radius of the skeleton Use to change size of the skeleton

unsigned int OSCAR::SkeletalPrimitive::Size   const
 

Gives the length of the vector containing the points which represent the skeletal primitive (IE 1 for sphere, 2 for cylisphere, 4 for plane).

Returns:
unsigned integer representing the size of the points vector

virtual bool OSCAR::SkeletalPrimitive::Update const Xform   transform [virtual]
 

Transform the local points to the global points using a user specified Xform.

Parameters:
transform The Xform that will be used to transform the local points to the global frame
Returns:
True upon completion

Reimplemented from OSCAR::Primitive.

virtual bool OSCAR::SkeletalPrimitive::updateInternalParameters   [inline, protected, virtual]
 

Reimplemented in OSCAR::Plane.


Member Data Documentation

vector<Vector3> OSCAR::SkeletalPrimitive::point[2] [protected]
 

double OSCAR::SkeletalPrimitive::radius [protected]
 


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