OgrePolygon.h
Go to the documentation of this file.
/*
-----------------------------------------------------------------------------
This source file is part of OGRE
(Object-oriented Graphics Rendering Engine)
For the latest info, see http://www.ogre3d.org/
Copyright (c) 2000-2013 Torus Knot Software Ltd
Copyright (c) 2006 Matthias Fink, netAllied GmbH <matthias.fink@web.de>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
-----------------------------------------------------------------------------
*/
#ifndef __Polygon_H__
#define __Polygon_H__
#include "OgrePrerequisites.h"
#include "OgreVector3.h"
#include "OgreHeaderPrefix.h"
namespace Ogre
{
class _OgreExport Polygon
{
public:
typedef vector<Vector3>::type VertexList;
typedef multimap<Vector3, Vector3>::type EdgeMap;
typedef std::pair< Vector3, Vector3> Edge;
protected:
VertexList mVertexList;
mutable Vector3 mNormal;
mutable bool mIsNormalSet;
void updateNormal(void) const;
public:
Polygon();
~Polygon();
Polygon( const Polygon& cpy );
void insertVertex(const Vector3& vdata, size_t vertexIndex);
void insertVertex(const Vector3& vdata);
const Vector3& getVertex(size_t vertex) const;
void setVertex(const Vector3& vdata, size_t vertexIndex);
void removeDuplicates(void);
size_t getVertexCount(void) const;
const Vector3& getNormal(void) const;
void deleteVertex(size_t vertex);
bool isPointInside(const Vector3& point) const;
void storeEdges(EdgeMap *edgeMap) const;
void reset(void);
bool operator == (const Polygon& rhs) const;
bool operator != (const Polygon& rhs) const
{ return !( *this == rhs ); }
_OgreExport friend std::ostream& operator<< ( std::ostream& strm, const Polygon& poly );
};
}
#include "OgreHeaderSuffix.h"
#endif
OgreVector3.h
_OgreExport
#define _OgreExport
Definition: OgrePlatform.h:257
Ogre::Polygon
The class represents a polygon in 3D space.
Definition: OgrePolygon.h:52
Ogre::Polygon::mNormal
Vector3 mNormal
Definition: OgrePolygon.h:63
Ogre::Polygon::Edge
std::pair< Vector3, Vector3 > Edge
Definition: OgrePolygon.h:59
Ogre::Vector3
Standard 3-dimensional vector.
Definition: OgreVector3.h:51
OgrePrerequisites.h
Ogre::Polygon::mIsNormalSet
bool mIsNormalSet
Definition: OgrePolygon.h:64
Ogre::Polygon::mVertexList
VertexList mVertexList
Definition: OgrePolygon.h:62
Ogre::Polygon::VertexList
vector< Vector3 >::type VertexList
Definition: OgrePolygon.h:56
Ogre::operator<<
std::ostream & operator<<(std::ostream &o, const TRect< T > &r)
Definition: OgreCommon.h:636
Ogre::operator!=
bool operator!=(STLAllocator< T, P > const &, STLAllocator< T2, P > const &)
determine equality, can memory from another allocator be released by this allocator, (ISO C++)
Definition: OgreMemorySTLAllocator.h:202
OgreHeaderSuffix.h
Ogre::multimap::type
std::multimap< K, V, P, A > type
Definition: OgrePrerequisites.h:550
Ogre
Definition: OgreAndroidLogListener.h:34
Ogre::vector
Definition: OgrePrerequisites.h:491
OgreHeaderPrefix.h
Ogre::operator==
bool operator==(STLAllocator< T, P > const &, STLAllocator< T2, P > const &)
determine equality, can memory from another allocator be released by this allocator, (ISO C++)
Definition: OgreMemorySTLAllocator.h:184
Ogre::Polygon::EdgeMap
multimap< Vector3, Vector3 >::type EdgeMap
Definition: OgrePolygon.h:58

Copyright © 2012 Torus Knot Software Ltd
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.