MRPT logo

mrpt::opengl::CPolyhedron Class Reference

An arbitrary polyhedron. More...

#include <mrpt/opengl/CPolyhedron.h>

Inheritance diagram for mrpt::opengl::CPolyhedron:

mrpt::opengl::CRenderizable mrpt::utils::CSerializable

List of all members.

Classes

struct  TPolyhedronEdge
struct  TPolyhedronFace

Public Member Functions

void render () const
 Render.
virtual bool traceRay (const mrpt::poses::CPose3D &o, float &dist) const
 Ray trace.
void getVertices (vector< CPoint3D > &vertices) const
void getEdges (vector< TPolyhedronEdge > &edges) const
void getFaces (vector< TPolyhedronFace > &faces) const
uint32_t getNumberOfVertices () const
uint32_t getNumberOfEdges () const
uint32_t getNumberOfFaces () const
void getEdgesLength (vector< float > &lengths) const
void getFacesArea (vector< float > &areas) const
float getVolume () const
bool isWireframe () const
void setWireframe (bool enabled=true)
float getLineWidth () const
void setLineWidth (float lineWidth)

Static Public Member Functions

static CPolyhedronPtr Create (const vector< CPoint3D > &vertices, const vector< vector< uint32_t > > &faces)
static CPolyhedronPtr Create (const vector< CPoint3D > &vertices, const vector< TPolyhedronFace > &faces)
static CPolyhedronPtr CreateTetrahedron (const float radius)
 Static methods to create frequent polyhedrons.
static CPolyhedronPtr CreateHexahedron (const float radius)
static CPolyhedronPtr CreateOctahedron (const float radius)
static CPolyhedronPtr CreateDodecahedron (const float radius)
static CPolyhedronPtr CreateIcosahedron (const float radius)
static CPolyhedronPtr CreateTruncatedTetrahedron (const float radius)
static CPolyhedronPtr CreateCuboctahedron (const float radius)
static CPolyhedronPtr CreateTruncatedHexahedron (const float radius)
static CPolyhedronPtr CreateTruncatedOctahedron (const float radius)
static CPolyhedronPtr CreateRhombicuboctahedron (const float radius)
static CPolyhedronPtr CreateIcosidodecahedron (const float radius)
static CPolyhedronPtr CreateCubicPrism (const float x1, const float x2, const float y1, const float y2, const float z1, const float z2)
static CPolyhedronPtr CreatePyramid (const vector< CPoint2D > &baseVertices, const float height)
static CPolyhedronPtr CreateDoublePyramid (const vector< CPoint2D > &baseVertices, const float height1, const float height2)
static CPolyhedronPtr CreateTruncatedPyramid (const vector< CPoint2D > &baseVertices, const float height, const float ratio)
static CPolyhedronPtr CreateCustomPrism (const vector< CPoint2D > &baseVertices, const float height)
static CPolyhedronPtr CreateRegularAntiprism (const uint32_t numBaseEdges, const float baseRadius, const float height)
static CPolyhedronPtr CreateRegularPrism (const uint32_t numbaseEdges, const float baseRadius, const float height)
static CPolyhedronPtr CreateCustomAntiprism (const vector< CPoint2D > &bottomBase, const vector< CPoint2D > &topBase, const float height)
static CPolyhedronPtr CreateParallelepiped (const CPoint3D &base, const CPoint3D &v1, const CPoint3D &v2, const CPoint3D &v3)
static CPolyhedronPtr CreateRegularPyramid (const uint32_t numBaseEdges, const float baseRadius, const float height)
static CPolyhedronPtr CreateRegularDoublePyramid (const uint32_t numBaseEdges, const float baseRadius, const float height1, const float height2)
static CPolyhedronPtr CreateArchimedeanRegularPrism (const uint32_t numBaseEdges, const float baseRadius)
static CPolyhedronPtr CreateArchimedeanRegularAntiprism (const uint32_t numBaseEdges, const float baseRadius)
static CPolyhedronPtr CreateRegularTruncatedPyramid (const uint32_t numBaseEdges, const float baseRadius, const float height, const float ratio)

Protected Attributes

vector_serializable< CPoint3DmVertices
vector_serializable
< TPolyhedronEdge
mEdges
vector_serializable
< TPolyhedronFace
mFaces
bool mWireframe
float mLineWidth

Private Member Functions

bool setNormal (TPolyhedronFace &f, bool doCheck=true)
void addEdges (const TPolyhedronFace &e)
 CPolyhedron ()
 CPolyhedron (const vector< CPoint3D > &vertices, const vector< TPolyhedronFace > &faces, bool doCheck=true)
virtual ~CPolyhedron ()

Static Private Member Functions

static bool checkConsistence (const vector< CPoint3D > &vertices, const vector< TPolyhedronFace > &faces)
static CPolyhedronPtr CreateNoCheck (const vector< CPoint3D > &vertices, const vector< TPolyhedronFace > &faces)
static CPolyhedronPtr CreateEmpty ()


Detailed Description

An arbitrary polyhedron.

See also:
opengl::COpenGLScene

Definition at line 51 of file CPolyhedron.h.


Constructor & Destructor Documentation

mrpt::opengl::CPolyhedron::CPolyhedron (  )  [inline, private]

Definition at line 170 of file CPolyhedron.h.

mrpt::opengl::CPolyhedron::CPolyhedron ( const vector< CPoint3D > &  vertices,
const vector< TPolyhedronFace > &  faces,
bool  doCheck = true 
) [inline, private]

Definition at line 171 of file CPolyhedron.h.

virtual mrpt::opengl::CPolyhedron::~CPolyhedron (  )  [inline, private, virtual]

Definition at line 184 of file CPolyhedron.h.


Member Function Documentation

void mrpt::opengl::CPolyhedron::addEdges ( const TPolyhedronFace e  )  [private]

static bool mrpt::opengl::CPolyhedron::checkConsistence ( const vector< CPoint3D > &  vertices,
const vector< TPolyhedronFace > &  faces 
) [static, private]

static CPolyhedronPtr mrpt::opengl::CPolyhedron::Create ( const vector< CPoint3D > &  vertices,
const vector< TPolyhedronFace > &  faces 
) [inline, static]

Definition at line 88 of file CPolyhedron.h.

References mrpt::opengl::CPolyhedron.

static CPolyhedronPtr mrpt::opengl::CPolyhedron::Create ( const vector< CPoint3D > &  vertices,
const vector< vector< uint32_t > > &  faces 
) [inline, static]

static CPolyhedronPtr mrpt::opengl::CPolyhedron::CreateArchimedeanRegularAntiprism ( const uint32_t  numBaseEdges,
const float  baseRadius 
) [static]

static CPolyhedronPtr mrpt::opengl::CPolyhedron::CreateArchimedeanRegularPrism ( const uint32_t  numBaseEdges,
const float  baseRadius 
) [static]

static CPolyhedronPtr mrpt::opengl::CPolyhedron::CreateCubicPrism ( const float  x1,
const float  x2,
const float  y1,
const float  y2,
const float  z1,
const float  z2 
) [static]

static CPolyhedronPtr mrpt::opengl::CPolyhedron::CreateCuboctahedron ( const float  radius  )  [static]

static CPolyhedronPtr mrpt::opengl::CPolyhedron::CreateCustomAntiprism ( const vector< CPoint2D > &  bottomBase,
const vector< CPoint2D > &  topBase,
const float  height 
) [static]

static CPolyhedronPtr mrpt::opengl::CPolyhedron::CreateCustomPrism ( const vector< CPoint2D > &  baseVertices,
const float  height 
) [static]

static CPolyhedronPtr mrpt::opengl::CPolyhedron::CreateDodecahedron ( const float  radius  )  [static]

static CPolyhedronPtr mrpt::opengl::CPolyhedron::CreateDoublePyramid ( const vector< CPoint2D > &  baseVertices,
const float  height1,
const float  height2 
) [static]

static CPolyhedronPtr mrpt::opengl::CPolyhedron::CreateEmpty (  )  [inline, static, private]

Definition at line 181 of file CPolyhedron.h.

References mrpt::opengl::CPolyhedron.

static CPolyhedronPtr mrpt::opengl::CPolyhedron::CreateHexahedron ( const float  radius  )  [static]

static CPolyhedronPtr mrpt::opengl::CPolyhedron::CreateIcosahedron ( const float  radius  )  [static]

static CPolyhedronPtr mrpt::opengl::CPolyhedron::CreateIcosidodecahedron ( const float  radius  )  [static]

static CPolyhedronPtr mrpt::opengl::CPolyhedron::CreateNoCheck ( const vector< CPoint3D > &  vertices,
const vector< TPolyhedronFace > &  faces 
) [inline, static, private]

Definition at line 178 of file CPolyhedron.h.

References mrpt::opengl::CPolyhedron.

static CPolyhedronPtr mrpt::opengl::CPolyhedron::CreateOctahedron ( const float  radius  )  [static]

static CPolyhedronPtr mrpt::opengl::CPolyhedron::CreateParallelepiped ( const CPoint3D base,
const CPoint3D v1,
const CPoint3D v2,
const CPoint3D v3 
) [static]

static CPolyhedronPtr mrpt::opengl::CPolyhedron::CreatePyramid ( const vector< CPoint2D > &  baseVertices,
const float  height 
) [static]

static CPolyhedronPtr mrpt::opengl::CPolyhedron::CreateRegularAntiprism ( const uint32_t  numBaseEdges,
const float  baseRadius,
const float  height 
) [static]

static CPolyhedronPtr mrpt::opengl::CPolyhedron::CreateRegularDoublePyramid ( const uint32_t  numBaseEdges,
const float  baseRadius,
const float  height1,
const float  height2 
) [static]

static CPolyhedronPtr mrpt::opengl::CPolyhedron::CreateRegularPrism ( const uint32_t  numbaseEdges,
const float  baseRadius,
const float  height 
) [static]

static CPolyhedronPtr mrpt::opengl::CPolyhedron::CreateRegularPyramid ( const uint32_t  numBaseEdges,
const float  baseRadius,
const float  height 
) [static]

static CPolyhedronPtr mrpt::opengl::CPolyhedron::CreateRegularTruncatedPyramid ( const uint32_t  numBaseEdges,
const float  baseRadius,
const float  height,
const float  ratio 
) [static]

static CPolyhedronPtr mrpt::opengl::CPolyhedron::CreateRhombicuboctahedron ( const float  radius  )  [static]

static CPolyhedronPtr mrpt::opengl::CPolyhedron::CreateTetrahedron ( const float  radius  )  [static]

Static methods to create frequent polyhedrons.

More bizarre polyhedrons are intended to be added in a near future.

static CPolyhedronPtr mrpt::opengl::CPolyhedron::CreateTruncatedHexahedron ( const float  radius  )  [static]

static CPolyhedronPtr mrpt::opengl::CPolyhedron::CreateTruncatedOctahedron ( const float  radius  )  [static]

static CPolyhedronPtr mrpt::opengl::CPolyhedron::CreateTruncatedPyramid ( const vector< CPoint2D > &  baseVertices,
const float  height,
const float  ratio 
) [static]

static CPolyhedronPtr mrpt::opengl::CPolyhedron::CreateTruncatedTetrahedron ( const float  radius  )  [static]

void mrpt::opengl::CPolyhedron::getEdges ( vector< TPolyhedronEdge > &  edges  )  const [inline]

Definition at line 136 of file CPolyhedron.h.

void mrpt::opengl::CPolyhedron::getEdgesLength ( vector< float > &  lengths  )  const

void mrpt::opengl::CPolyhedron::getFaces ( vector< TPolyhedronFace > &  faces  )  const [inline]

Definition at line 139 of file CPolyhedron.h.

void mrpt::opengl::CPolyhedron::getFacesArea ( vector< float > &  areas  )  const

float mrpt::opengl::CPolyhedron::getLineWidth (  )  const [inline]

Definition at line 160 of file CPolyhedron.h.

uint32_t mrpt::opengl::CPolyhedron::getNumberOfEdges (  )  const [inline]

Definition at line 145 of file CPolyhedron.h.

uint32_t mrpt::opengl::CPolyhedron::getNumberOfFaces (  )  const [inline]

Definition at line 148 of file CPolyhedron.h.

uint32_t mrpt::opengl::CPolyhedron::getNumberOfVertices (  )  const [inline]

Definition at line 142 of file CPolyhedron.h.

void mrpt::opengl::CPolyhedron::getVertices ( vector< CPoint3D > &  vertices  )  const [inline]

Definition at line 133 of file CPolyhedron.h.

float mrpt::opengl::CPolyhedron::getVolume (  )  const

bool mrpt::opengl::CPolyhedron::isWireframe (  )  const [inline]

Definition at line 154 of file CPolyhedron.h.

void mrpt::opengl::CPolyhedron::render (  )  const [virtual]

Render.

Implements mrpt::opengl::CRenderizable.

void mrpt::opengl::CPolyhedron::setLineWidth ( float  lineWidth  )  [inline]

Definition at line 163 of file CPolyhedron.h.

bool mrpt::opengl::CPolyhedron::setNormal ( TPolyhedronFace f,
bool  doCheck = true 
) [private]

void mrpt::opengl::CPolyhedron::setWireframe ( bool  enabled = true  )  [inline]

Definition at line 157 of file CPolyhedron.h.

virtual bool mrpt::opengl::CPolyhedron::traceRay ( const mrpt::poses::CPose3D o,
float &  dist 
) const [virtual]

Ray trace.

Reimplemented from mrpt::opengl::CRenderizable.


Member Data Documentation

Definition at line 74 of file CPolyhedron.h.

Definition at line 75 of file CPolyhedron.h.

Definition at line 77 of file CPolyhedron.h.

Definition at line 73 of file CPolyhedron.h.

Definition at line 76 of file CPolyhedron.h.




Page generated by Doxygen 1.5.9 for MRPT 0.6.5 SVN: at Sun Aug 2 11:41:17 CDT 2009