MeshKit
1.0
|
00001 /* 00002 * AF2Polygon2D.hpp 00003 * 00004 * An immutable 2-dimensional polygon whose vertices are AF2Point2D points. 00005 * 00006 * The vertices are numbered 0 through n - 1, where n is the number of 00007 * polygon vertices. As the numbers increase, the polygon is traversed 00008 * counterclockwise. Thus the interior of the polygon is to the left 00009 * of the edge from vertex i to vertex i + 1 modulo n. 00010 * 00011 * This class holds on to its vertices with pointers, but it does not 00012 * manage the memory for its vertices. It is the reponsibility of the 00013 * context that uses AF2Polygon2D to ensure that pointers to vertices 00014 * remain valid as long as they may be referenced by an AF2Polygon2D instance. 00015 */ 00016 #ifndef AF2POLYGON2D_HPP 00017 #define AF2POLYGON2D_HPP 00018 00019 // C++ 00020 #include <list> 00021 00022 // MeshKit 00023 #include "meshkit/AF2Point2D.hpp" 00024 00025 class AF2Polygon2D 00026 { 00027 private: 00028 00029 unsigned int numVertices; 00030 const AF2Point2D** vertices; 00031 00032 public: 00033 00046 AF2Polygon2D(std::list<const AF2Point2D*> const & polygonVertices); 00047 00051 ~AF2Polygon2D(); 00052 00061 AF2Polygon2D(const AF2Polygon2D & toCopy); 00062 00071 AF2Polygon2D& operator=(const AF2Polygon2D & rhs); 00072 00078 unsigned int getNumVertices() const; 00079 00097 const AF2Point2D* getVertex(unsigned int vtxNum) const; 00098 }; 00099 00100 #endif