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

OSCAR::Box Class Reference
[ObstacleAvoidance]

A box obstacle used for modeling of objects in workcells. More...

#include <Box.hpp>

Inheritance diagram for OSCAR::Box:

Inheritance graph
[legend]
List of all members.

Public Methods

 Box (const double xDimen, const double yDimen, const double zDimen, const Xform &pose)
 Box (const Box &arg)
 Box ()
virtual Box * Clone () const
const vector< Plane > & GetPlanes () const
const vector< unsigned int > & GetAdjacentVertices (unsigned int index) const
const vector< unsigned int > & GetAdjacentPlanes (unsigned int index) const
const vector< Vector3 > & GetPoints (ReferenceFrame globalOrLocal=Global) const
bool SetProperties (const double xDimen, const double yDimen, const double zDimen, const Xform &pose)
bool SetXDim (const double xDimen)
bool SetYDim (const double yDimen)
bool SetZDim (const double zDimen)
bool SetLocalTransform (const Xform &inFrameTransform)
double GetXDim () const
double GetYDim () const
double GetZDim () const
const XformGetLocalTransform () const
virtual bool Update (const Xform &transform)
Box & operator= (const Box &rhs)
XformGetCompleteXform ()

Protected Methods

bool populatePoints ()
bool updatePlanes ()
bool populateMaps ()
bool TransformInternalToLocal ()
virtual bool createSolid ()

Protected Attributes

double xDim
double yDim
double zDim
Xform localTransform
Xform fullTransform
std::vector< Planeplanes
std::vector< Vector3internalPoint
std::vector< Vector3point [2]
unsigned int vertexMap [8][3]
unsigned int planeMap [8][3]

Detailed Description

The full box is specified by 8 corner points, which form 3 pairs of parallel, zero radius planes.
Author:
Andrew Spencer


Constructor & Destructor Documentation

OSCAR::Box::Box const double    xDimen,
const double    yDimen,
const double    zDimen,
const Xform   pose
 

Constructor Constructs a Box from the 3 dimensions of the box and an inFrameTransformation Xform. This Xform positions the box from it's default position (with a center at (0,0,0)) to it's actual position w.r.t. the local frame. This local frame can then be moved around using the Update() function. All global positions and points for the box are automatically populated using an identity transformation.

Parameters:
xDimen The dimension of the box in the x direction
yDimen The dimension of the box in the y direction
zDimen The dimension of the box in the z direction
pose An Xform which specifies the pose of the box in w.r.t. its local frame. This Xform is in the local frame.

OSCAR::Box::Box const Box &    arg [inline]
 

Copy Constructor.

Parameters:
arg The box obstacle to copy

OSCAR::Box::Box  
 

Constructor Use to make arrays of Box objects. Note: SetProperties(...) must be called before any other function, and that the local transform defaults to the identity matrix.


Member Function Documentation

virtual Box* OSCAR::Box::Clone   const [virtual]
 

Clone this object.

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

Implements OSCAR::Primitive.

virtual bool OSCAR::Box::createSolid   [protected, virtual]
 

Reimplemented from OSCAR::Primitive.

const vector<unsigned int>& OSCAR::Box::GetAdjacentPlanes unsigned int    index const
 

Gives the plane adjacency information for the Box. Given the index (from the vector of Vector3s returned by GetPoints()) of a vertex of the box, this function will return the indices (from the vector of Planes returned by the GetPlanes() function) of the three planes which contain the vertex specified by the inputted index.

Parameters:
unsigned int index The index (from the vector of Vector3s returned by GetPoints()) of the point of interest
Returns:
A const vector of unsigned ints of length three. These unsigned integers correspond to indices of the vector of Planes returned by the GetPlanes() function

const vector<unsigned int>& OSCAR::Box::GetAdjacentVertices unsigned int    index const
 

Gives the edge adjacency information for the Box. Given the index (from the vector of Vector3s returned by GetPoints()) of a vertex of the box, this function will return the indices of the three points which form edges with the point corresponding to the given index.

Parameters:
unsigned int index The index (from the vector of Vector3s returned by GetPoints()) of the point of interest
Returns:
A const vector of unsigned ints of length three. These unsigned integers correspond to indices of the vector of Vector3s returned by the GetPoints() function.

Xform& OSCAR::Box::GetCompleteXform  
 

const Xform& OSCAR::Box::GetLocalTransform   const [inline]
 

Get the local frame transformation for the box.

Returns:
A reference to a const Xform which is the local frame transformation

const vector<Plane>& OSCAR::Box::GetPlanes   const [inline]
 

Get a reference to the vector that holds the six planes that make up the box. How these planes relate to the 8 points obtained from the GetPoints() function (IE which planes contain which points) can be obtained through the GetPlaneMap() function.

Returns:
A reference to the planes vector

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

Get the eight corner points of the box, in either the local or the global frame. The relationship of these eight points (IE which points are directly connected by edges) can be obtained by using the "GetVertexMap()" function.

Parameters:
Reference localOrGlobal Which frame you would like the points in. Defaults to global.
Returns:
A reference to the corner points

double OSCAR::Box::GetXDim   const [inline]
 

Get the x dimension of the box.

Returns:
The x dimension of the box

double OSCAR::Box::GetYDim   const [inline]
 

Get the y dimension of the box.

Returns:
The y dimension of the box

double OSCAR::Box::GetZDim   const [inline]
 

Get the z dimension of the box.

Returns:
The z dimension of the box

Box& OSCAR::Box::operator= const Box &    rhs
 

bool OSCAR::Box::populateMaps   [protected]
 

bool OSCAR::Box::populatePoints   [protected]
 

bool OSCAR::Box::SetLocalTransform const Xform   inFrameTransform
 

Set the local frame transform of the box. Update() is automatically called using the last Xform Update() was called with (Identity if Update() has not been called).

Parameters:
inFrameTransform The new local frame transform (Xform) for the box
Returns:
true

bool OSCAR::Box::SetProperties const double    xDimen,
const double    yDimen,
const double    zDimen,
const Xform   pose
 

Update location and size of the box. Update() is automatically called using the last Xform Update() was called with (an Xform of identity is used if Update() has not been called).

Parameters:
xDimen The dimension of the box in the x direction
yDimen The dimension of the box in the y direction
zDimen The dimension of the box in the z direction
pose An Xform which specifies the pose of the box in w.r.t. its local frame. This Xform is in the local frame.
Returns:
true

bool OSCAR::Box::SetXDim const double    xDimen
 

Update the x dimension of the box.

Parameters:
xDimen The new dimension of the box in the x direction
Returns:
true

bool OSCAR::Box::SetYDim const double    yDimen
 

Update the y dimension of the box.

Parameters:
yDimen The new dimension of the box in the y direction
Returns:
true

bool OSCAR::Box::SetZDim const double    zDimen
 

Update the z dimension of the box.

Parameters:
zDimen The new dimension of the box in the z direction
Returns:
true

bool OSCAR::Box::TransformInternalToLocal   [protected]
 

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

Transform the points from the local frame to the global frame.

Parameters:
transform The Xform to use for the transformation
Returns:
true upon completion

Reimplemented from OSCAR::Primitive.

bool OSCAR::Box::updatePlanes   [protected]
 


Member Data Documentation

Xform OSCAR::Box::fullTransform [protected]
 

std::vector<Vector3> OSCAR::Box::internalPoint [protected]
 

Xform OSCAR::Box::localTransform [protected]
 

unsigned int OSCAR::Box::planeMap[8][3] [protected]
 

std::vector<Plane> OSCAR::Box::planes [protected]
 

std::vector<Vector3> OSCAR::Box::point[2] [protected]
 

unsigned int OSCAR::Box::vertexMap[8][3] [protected]
 

double OSCAR::Box::xDim [protected]
 

double OSCAR::Box::yDim [protected]
 

double OSCAR::Box::zDim [protected]
 


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