Version: 8.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
GLViewer_Poly Class Reference

#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. More...
 
int Count () const
 Returns number of point. More...
 
virtual bool IsIn (const GLViewer_Pnt &thePnt) const
 Returns true if a point lies inside this polygon. More...
 
virtual bool IsCovers (const GLViewer_Poly &thePoly) const
 Returns true if a other polygon covers this polygon. More...
 
virtual bool IsCovers (const GLViewer_Rect &theRect) const
 Likes the above function. More...
 
virtual bool HasIntersection (const GLViewer_Segment &theSegment) const
 

Private Attributes

GLViewer_PntListmyPoints
 

Detailed Description

Class GLViewer_Poly Polygon for 2d detection

Constructor & Destructor Documentation

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!

Member Function Documentation

void GLViewer_Poly::AddPoint ( GLViewer_Pnt pnt)
inline
int GLViewer_Poly::Count ( ) const
inline
bool GLViewer_Poly::HasIntersection ( const GLViewer_Segment theSegment) const
virtual
Returns
true if polygon has intersection with segment or ray
Parameters
theSegment- segment to check intersection

References GLViewer_Segment::HasIntersection(), and myPoints.

bool GLViewer_Poly::IsCovers ( const GLViewer_Poly thePoly) const
virtual
Returns
true if <thePnt> lies within this polygon
true if <thePoly> covers this polygon

References Count(), IsIn(), and myPoints.

bool GLViewer_Poly::IsCovers ( const GLViewer_Rect theRect) const
virtual
bool GLViewer_Poly::IsIn ( const GLViewer_Pnt thePnt) const
virtual
Returns
true if <thePnt> lies within this polygon

References myPoints, and GLViewer_Pnt::y().

Member Data Documentation

GLViewer_PntList* GLViewer_Poly::myPoints
private

The documentation for this class was generated from the following files: