#include <GLViewer_Geom.h>
Public Member Functions | |
| GLViewer_Poly (const GLViewer_PntList *thePoints) | |
| virtual | ~GLViewer_Poly () |
| void | AddPoint (GLViewer_Pnt &pnt) |
| Adds point to polygon. | |
| int | Count () const |
| Returns number of point. | |
| virtual bool | IsIn (const GLViewer_Pnt &thePnt) const |
| Returns true if a point lies inside this polygon. | |
| virtual bool | IsCovers (const GLViewer_Poly &thePoly) const |
| Returns true if a other polygon covers this polygon. | |
| virtual bool | IsCovers (const GLViewer_Rect &theRect) const |
| Likes the above function. | |
| virtual bool | HasIntersection (const GLViewer_Segment &theSegment) const |
Private Attributes | |
| GLViewer_PntList * | myPoints |
Class GLViewer_Poly Polygon for 2d detection
| GLViewer_Poly::GLViewer_Poly | ( | const GLViewer_PntList * | thePoints | ) |
constructs a closed polygon from the given ordered list of points
| GLViewer_Poly::~GLViewer_Poly | ( | ) | [virtual] |
destructor, <myPoints> mustn't be deleted here!
| void GLViewer_Poly.AddPoint | ( | GLViewer_Pnt & | pnt | ) |
| int GLViewer_Poly.Count | ( | ) | const |
| bool GLViewer_Poly::IsIn | ( | const GLViewer_Pnt & | thePnt | ) | const [virtual] |
References myPoints, and GLViewer_Pnt.y().
| bool GLViewer_Poly::IsCovers | ( | const GLViewer_Poly & | thePoly | ) | const [virtual] |
| bool GLViewer_Poly::IsCovers | ( | const GLViewer_Rect & | theRect | ) | const [virtual] |
References GLViewer_Rect.bottom(), GLViewer_Poly(), IsCovers(), GLViewer_Rect.left(), myPoints, GLViewer_Rect.right(), and GLViewer_Rect.top().
| bool GLViewer_Poly::HasIntersection | ( | const GLViewer_Segment & | theSegment | ) | const [virtual] |
| theSegment | - segment to check intersection |
References GLViewer_Segment.HasIntersection(), and myPoints.
GLViewer_PntList* GLViewer_Poly.myPoints [private] |