MeshKit
1.0
|
#include <AF2Polygon2D.hpp>
Public Member Functions | |
AF2Polygon2D (std::list< const AF2Point2D * > const &polygonVertices) | |
Constructor. | |
~AF2Polygon2D () | |
Destructor. | |
AF2Polygon2D (const AF2Polygon2D &toCopy) | |
Copy constructor. | |
AF2Polygon2D & | operator= (const AF2Polygon2D &rhs) |
Copy assignment. | |
unsigned int | getNumVertices () const |
Get the number of vertices that this polygon has. | |
const AF2Point2D * | getVertex (unsigned int vtxNum) const |
Get a vertex of this polygon. | |
Private Attributes | |
unsigned int | numVertices |
const AF2Point2D ** | vertices |
Definition at line 25 of file AF2Polygon2D.hpp.
AF2Polygon2D | ( | std::list< const AF2Point2D * > const & | polygonVertices | ) |
Constructor.
The vertices passed into the constructor are pointers to polygon vertices. The order of the polygon vertices within the list must be counterclockwise. In other words, the interior of the polygon must be to the left of the edge from each vertex to the next vertex in the list.
polygonVertices | a list of AF2Point2D* pointing to the vertices of the polygon traversed in counterclockwise order |
Definition at line 4 of file AF2Polygon2D.cpp.
~AF2Polygon2D | ( | ) |
Destructor.
Definition at line 34 of file AF2Polygon2D.cpp.
AF2Polygon2D | ( | const AF2Polygon2D & | toCopy | ) |
Copy constructor.
This is the standard copy constructor.
toCopy | an AF2Polygon2D that should be copied to construct a new AF2Polygon2D |
Definition at line 39 of file AF2Polygon2D.cpp.
unsigned int getNumVertices | ( | ) | const |
Get the number of vertices that this polygon has.
Definition at line 73 of file AF2Polygon2D.cpp.
const AF2Point2D * getVertex | ( | unsigned int | vtxNum | ) | const |
Get a vertex of this polygon.
The numbering of the vertices of the polygon begins with 0, so the valid arguments to this method are 0 through n - 1, where n is the value returned from getNumVertices().
When pointers returned from this method point to vertices that belong to an AF2RuleApplication, i.e., new vertices that are created as part of applying a rule, the user should be aware that copying the AF2RuleApplication creates new instances of the vertices, and the pointers will not reference the instances in the copy.
vtxNum | the number of the vertex to return |
Definition at line 78 of file AF2Polygon2D.cpp.
AF2Polygon2D & operator= | ( | const AF2Polygon2D & | rhs | ) |
Copy assignment.
This is the standard copy assignment operator.
rhs | an AF2Polygon2D that should be assigned to this AF2Polygon2D, overwriting (and destructing) whatever may be in this AF2Polygon2D |
Definition at line 49 of file AF2Polygon2D.cpp.
unsigned int numVertices [private] |
Definition at line 29 of file AF2Polygon2D.hpp.
const AF2Point2D** vertices [private] |
Definition at line 30 of file AF2Polygon2D.hpp.