![]() |
Vault
4.1
|
VPolygonT defines a polygon or series of points. More...
#include <vgeometry.h>
Public Member Functions | |
| VPolygonT (const std::vector< VPointT< T > > &points) | |
| VPolygonT (VBinaryIOStream &stream) | |
| VPolygonT (const VRectT< T > &rect) | |
| void | readFromStream (VBinaryIOStream &stream) |
| void | writeToStream (VBinaryIOStream &stream) const |
| void | add (VPointT< T > p) |
| void | insert (int beforeIndex, VPointT< T > p) |
| int | getNumPoints () const |
| size_t | size () const |
| const std::vector< VPointT< T > > & | getPoints () const |
| VPointT< T > | getPoint (int index) const |
| void | setPoint (int index, VPointT< T > p) |
| VPointT< T > & | operator[] (int index) |
| VPointT< T > | operator[] (int index) const |
| VRectT< T > | getBounds () const |
| void | remove (int index) |
| void | eraseAll () |
| void | translate (VPointT< T > offset) |
| VLineT< T > | getSide (int index) const |
| int | getNearestVertex (const VPointT< T > &testPoint) const |
| Returns the index of the vertex of the polygon nearest to the supplied point. | |
| int | getNearestSide (const VPointT< T > &testPoint) const |
| Returns the index of the side of the polygon that is nearest to the supplied point. | |
| int | getNearestSide (const VPointT< T > &testPoint, VPoint &nearestPoint) const |
| Returns the index of the side of the polygon that is nearest to the supplied point. | |
Static Public Member Functions | |
| static bool | equal (const VPolygonT< T > &p1, const VPolygonT< T > &p2) |
| static bool | notEqual (const VPolygonT< T > &p1, const VPolygonT< T > &p2) |
Friends | |
| bool | operator== (const VPolygonT< T > &p1, const VPolygonT< T > &p2) |
| bool | operator!= (const VPolygonT< T > &p1, const VPolygonT< T > &p2) |
VPolygonT defines a polygon or series of points.
VPolygon uses VDouble coordinates; VIPolygon uses int coordinates.
Definition at line 710 of file vgeometry.h.
| int VPolygonT< T >::getNearestVertex | ( | const VPointT< T > & | testPoint | ) | const [inline] |
Returns the index of the vertex of the polygon nearest to the supplied point.
| testPoint | a point to test proximity |
Definition at line 808 of file vgeometry.h.
| int VPolygonT< T >::getNearestSide | ( | const VPointT< T > & | testPoint | ) | const [inline] |
Returns the index of the side of the polygon that is nearest to the supplied point.
If the test point is in a "dead zone" where the nearest point on a side is a vertex, there is currently no guarantee which of the two candidate sides will be returned.
| testPoint | a point to test proximity |
Definition at line 831 of file vgeometry.h.
| int VPolygonT< T >::getNearestSide | ( | const VPointT< T > & | testPoint, |
| VPoint & | nearestPoint | ||
| ) | const [inline] |
Returns the index of the side of the polygon that is nearest to the supplied point.
If the test point is in a "dead zone" where the nearest point on a side is a vertex, there is currently no guarantee which of the two candidate sides will be returned, and the returned nearestPoint will a vertex (shared by the two possible sides).
| testPoint | a point to test proximity |
| nearestPoint | returned value, the point (on the side) that is nearest to the test point |
Definition at line 847 of file vgeometry.h.