MeshKit  1.0
AF2Polygon3D.hpp
Go to the documentation of this file.
00001 /*
00002  * AF2Polygon3D.hpp
00003  *
00004  * \brief An immutable not-necessarily flat polygon whose vertices are
00005  *   AF2Point3D points.
00006  *
00007  * Perhaps a better name would be a closed wire rather than a polygon,
00008  * for the way it is represented here, but the object is defined in
00009  * terms of its vertices and is intended to correspond to a
00010  * two-dimensional element of a mesh.  This is also a close analog
00011  * of the AF2Polygon2D, except that it has three-dimensional vertices.
00012  *
00013  * The vertices are numbered 0 through n - 1, where n is the number of
00014  * polygon vertices.  As the numbers increase, the polygon is traversed
00015  * counterclockwise.  Thus the interior of the polygon is to the left
00016  * of the edge from vertex i to vertex i + 1 modulo n.
00017  *
00018  * This class holds on to its vertices with pointers, but it does not
00019  * manage the memory for its vertices.  It is the reponsibility of the
00020  * context that uses AF2Polygon3D to ensure that pointers to vertices
00021  * remain valid as long as they may be referenced by an AF2Polygon3D instance.
00022  */
00023 #ifndef AF2POLYGON3D_HPP
00024 #define AF2POLYGON3D_HPP
00025 
00026 // C++
00027 #include <list>
00028 
00029 // MeshKit
00030 #include "meshkit/AF2Point3D.hpp"
00031 
00032 class AF2Polygon3D
00033 {
00034   private:
00035 
00036     unsigned int numVertices;
00037     const AF2Point3D** vertices;
00038 
00039   public:
00040 
00059     AF2Polygon3D(std::list<const AF2Point3D*> const & polygonVertices);
00060 
00064     ~AF2Polygon3D();
00065 
00074     AF2Polygon3D(const AF2Polygon3D & toCopy);
00075 
00084     AF2Polygon3D& operator=(const AF2Polygon3D & rhs);
00085 
00091     unsigned int getNumVertices() const;
00092 
00103     const AF2Point3D* getVertex(unsigned int vtxNum) const;
00104 };
00105 
00106 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines