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

OSCAR::Polytope Class Reference
[ObstacleAvoidance]

Class for STL based polytope obstacle models Currently an empty class which can be instantiated but can not be used for anything useful. More...

#include <Polytope.h>

Inheritance diagram for OSCAR::Polytope:

Inheritance graph
[legend]
List of all members.

Public Methods

 Polytope (const String &stlfilepath, double tolerance=0.0001)
 Polytope ()
 Polytope (const Polytope &arg)
virtual ~Polytope ()
Polytope & operator= (const Polytope &rhs)
const StringGetSTLFileName () const
virtual Polytope * Clone () const
virtual bool createSolid ()
virtual bool Update (const Xform &transform)
void SetPosition (OSCAR::Vector3 position)
void SetOrientation (OSCAR::Quaternion orientation)
void SetPose (OSCAR::Xform transform)
OSCAR::Vector3 GetPosition ()
OSCAR::Quaternion GetOrientation ()
OSCAR::Xform GetPose ()
std::pair< OSCAR::Vector3,
OSCAR::Vector3
GetBoundingBox ()
void SetMargin (float margin)
float GetMargin ()
int GetVertCount ()
int GetTriCount ()
void SetTolerance (double tolerance)
double GetTolerance ()
bool SetVertexArray (MT_Point3 *newVertArray, int arraySize)
MT_Point3 * GetVertexArray ()
void SetScene (DT_SceneHandle scene)
void RemoveScene ()

Private Methods

bool setSTLShape ()
bool readSTLFile (vector< MT_Point3 > &verts, vector< MT_UInt3 > &tris)
int findVertex (vector< MT_Point3 > &verts, float x, float y, float z)
MT_UInt3 orientCCW (vector< MT_Point3 > &verts, unsigned int v1, unsigned int v2, unsigned int v3, float nx, float ny, float nz)

Private Attributes

String filePath
double tol
MT_Point3 * vert_array
DT_VertexBaseHandle base_h
DT_SceneHandle sceneHandle
MT_Vector3 pos_s
MT_Quaternion orn_s
OSCAR::Vector3 pos_o
OSCAR::Quaternion orn_o
MT_Vector3 bbmin
MT_Vector3 bbmax
float marg
int sizeverts
int sizetris

Detailed Description

Author:
Andrew Spencer


Constructor & Destructor Documentation

OSCAR::Polytope::Polytope const String   stlfilepath,
double    tolerance = 0.0001
 

Constructor. Used to create a Polytope object from an STL file.

Parameters:
String stlFileName The name of the file to be used
double tol The tolerance used to determine whether vertices are the same. Default value is 0.0001.

OSCAR::Polytope::Polytope  
 

Default constructor. Used to create arrays of polytope.

OSCAR::Polytope::Polytope const Polytope &    arg
 

Copy constructor. Create a polytope from an existing polytope.

Parameters:
arg The polytope to copy

virtual OSCAR::Polytope::~Polytope   [virtual]
 

Destructor.


Member Function Documentation

virtual Polytope* OSCAR::Polytope::Clone   const [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.

virtual bool OSCAR::Polytope::createSolid   [virtual]
 

Reimplemented from OSCAR::Primitive.

int OSCAR::Polytope::findVertex vector< MT_Point3 > &    verts,
float    x,
float    y,
float    z
[private]
 

std::pair<OSCAR::Vector3,OSCAR::Vector3> OSCAR::Polytope::GetBoundingBox  
 

float OSCAR::Polytope::GetMargin   [inline]
 

OSCAR::Quaternion OSCAR::Polytope::GetOrientation  
 

OSCAR::Xform OSCAR::Polytope::GetPose  
 

OSCAR::Vector3 OSCAR::Polytope::GetPosition  
 

const String& OSCAR::Polytope::GetSTLFileName   const [inline]
 

double OSCAR::Polytope::GetTolerance   [inline]
 

int OSCAR::Polytope::GetTriCount   [inline]
 

int OSCAR::Polytope::GetVertCount   [inline]
 

MT_Point3* OSCAR::Polytope::GetVertexArray   [inline]
 

Polytope& OSCAR::Polytope::operator= const Polytope &    rhs
 

Assignment operator.

MT_UInt3 OSCAR::Polytope::orientCCW vector< MT_Point3 > &    verts,
unsigned int    v1,
unsigned int    v2,
unsigned int    v3,
float    nx,
float    ny,
float    nz
[private]
 

bool OSCAR::Polytope::readSTLFile vector< MT_Point3 > &    verts,
vector< MT_UInt3 > &    tris
[private]
 

void OSCAR::Polytope::RemoveScene   [inline]
 

void OSCAR::Polytope::SetMargin float    margin [inline]
 

void OSCAR::Polytope::SetOrientation OSCAR::Quaternion    orientation
 

void OSCAR::Polytope::SetPose OSCAR::Xform    transform
 

void OSCAR::Polytope::SetPosition OSCAR::Vector3    position
 

void OSCAR::Polytope::SetScene DT_SceneHandle    scene [inline]
 

bool OSCAR::Polytope::setSTLShape   [private]
 

void OSCAR::Polytope::SetTolerance double    tolerance [inline]
 

bool OSCAR::Polytope::SetVertexArray MT_Point3 *    newVertArray,
int    arraySize
 

virtual bool OSCAR::Polytope::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, false if unimplemented for the class

Reimplemented from OSCAR::Primitive.


Member Data Documentation

DT_VertexBaseHandle OSCAR::Polytope::base_h [private]
 

MT_Vector3 OSCAR::Polytope::bbmax [private]
 

MT_Vector3 OSCAR::Polytope::bbmin [private]
 

String OSCAR::Polytope::filePath [private]
 

float OSCAR::Polytope::marg [private]
 

OSCAR::Quaternion OSCAR::Polytope::orn_o [private]
 

MT_Quaternion OSCAR::Polytope::orn_s [private]
 

OSCAR::Vector3 OSCAR::Polytope::pos_o [private]
 

MT_Vector3 OSCAR::Polytope::pos_s [private]
 

DT_SceneHandle OSCAR::Polytope::sceneHandle [private]
 

int OSCAR::Polytope::sizetris [private]
 

int OSCAR::Polytope::sizeverts [private]
 

double OSCAR::Polytope::tol [private]
 

MT_Point3* OSCAR::Polytope::vert_array [private]
 


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