Version: 6.3.1
Public Member Functions | Private Attributes

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.
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_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)
int GLViewer_Poly.Count ( ) const
bool GLViewer_Poly::IsIn ( const GLViewer_Pnt thePnt) const [virtual]
Returns:
true if <thePnt> lies within this polygon

References myPoints, and GLViewer_Pnt.y().

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::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.


Field Documentation

Copyright © 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
Copyright © 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS