OGRE  1.8
Object-Oriented Graphics Rendering Engine
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Ogre::Polygon Class Reference

The class represents a polygon in 3D space. More...

#include <OgrePolygon.h>

+ Collaboration diagram for Ogre::Polygon:

Public Types

typedef std::pair< Vector3,
Vector3
Edge
 
typedef multimap< Vector3,
Vector3 >::type 
EdgeMap
 
typedef vector< Vector3 >::type VertexList
 

Public Member Functions

 Polygon ()
 
 Polygon (const Polygon &cpy)
 
 ~Polygon ()
 
void deleteVertex (size_t vertex)
 Deletes a specific vertex. More...
 
const Vector3getNormal (void) const
 Returns the polygon normal. More...
 
const Vector3getVertex (size_t vertex) const
 Returns a vertex. More...
 
size_t getVertexCount (void) const
 Vertex count. More...
 
void insertVertex (const Vector3 &vdata, size_t vertexIndex)
 Inserts a vertex at a specific position. More...
 
void insertVertex (const Vector3 &vdata)
 Inserts a vertex at the end of the polygon. More...
 
bool isPointInside (const Vector3 &point) const
 Determines if a point is inside the polygon. More...
 
bool operator!= (const Polygon &rhs) const
 Determines if the current object is not equal to the compared one. More...
 
bool operator== (const Polygon &rhs) const
 Determines if the current object is equal to the compared one. More...
 
void removeDuplicates (void)
 Removes duplicate vertices from a polygon. More...
 
void reset (void)
 Resets the object. More...
 
void setVertex (const Vector3 &vdata, size_t vertexIndex)
 Sets a specific vertex of a polygon. More...
 
void storeEdges (EdgeMap *edgeMap) const
 Stores the edges of the polygon in ccw order. More...
 

Protected Member Functions

void updateNormal (void) const
 Updates the normal. More...
 

Protected Attributes

bool mIsNormalSet
 
Vector3 mNormal
 
VertexList mVertexList
 

Friends

_OgreExport friend std::ostream & operator<< (std::ostream &strm, const Polygon &poly)
 Prints out the polygon data. More...
 

Detailed Description

The class represents a polygon in 3D space.

Remarks
It is made up of 3 or more vertices in a single plane, listed in counter-clockwise order.

Definition at line 52 of file OgrePolygon.h.

Member Typedef Documentation

typedef std::pair< Vector3, Vector3> Ogre::Polygon::Edge

Definition at line 59 of file OgrePolygon.h.

Definition at line 58 of file OgrePolygon.h.

Definition at line 56 of file OgrePolygon.h.

Constructor & Destructor Documentation

Ogre::Polygon::Polygon ( )
Ogre::Polygon::~Polygon ( )
Ogre::Polygon::Polygon ( const Polygon cpy)

Member Function Documentation

void Ogre::Polygon::deleteVertex ( size_t  vertex)

Deletes a specific vertex.

const Vector3& Ogre::Polygon::getNormal ( void  ) const

Returns the polygon normal.

const Vector3& Ogre::Polygon::getVertex ( size_t  vertex) const

Returns a vertex.

size_t Ogre::Polygon::getVertexCount ( void  ) const

Vertex count.

void Ogre::Polygon::insertVertex ( const Vector3 vdata,
size_t  vertexIndex 
)

Inserts a vertex at a specific position.

Note
Vertices must be coplanar.
void Ogre::Polygon::insertVertex ( const Vector3 vdata)

Inserts a vertex at the end of the polygon.

Note
Vertices must be coplanar.
bool Ogre::Polygon::isPointInside ( const Vector3 point) const

Determines if a point is inside the polygon.

Remarks
A point is inside a polygon if it is both on the polygon's plane, and within the polygon's bounds. Polygons are assumed to be convex and planar.
bool Ogre::Polygon::operator!= ( const Polygon rhs) const
inline

Determines if the current object is not equal to the compared one.

Definition at line 133 of file OgrePolygon.h.

bool Ogre::Polygon::operator== ( const Polygon rhs) const

Determines if the current object is equal to the compared one.

void Ogre::Polygon::removeDuplicates ( void  )

Removes duplicate vertices from a polygon.

void Ogre::Polygon::reset ( void  )

Resets the object.

void Ogre::Polygon::setVertex ( const Vector3 vdata,
size_t  vertexIndex 
)

Sets a specific vertex of a polygon.

Note
Vertices must be coplanar.
void Ogre::Polygon::storeEdges ( EdgeMap edgeMap) const

Stores the edges of the polygon in ccw order.

The vertices are copied so the user has to take the deletion into account.

void Ogre::Polygon::updateNormal ( void  ) const
protected

Updates the normal.

Friends And Related Function Documentation

_OgreExport friend std::ostream& operator<< ( std::ostream &  strm,
const Polygon poly 
)
friend

Prints out the polygon data.

Member Data Documentation

bool Ogre::Polygon::mIsNormalSet
mutableprotected

Definition at line 64 of file OgrePolygon.h.

Vector3 Ogre::Polygon::mNormal
mutableprotected

Definition at line 63 of file OgrePolygon.h.

VertexList Ogre::Polygon::mVertexList
protected

Definition at line 62 of file OgrePolygon.h.


The documentation for this class was generated from the following file: