Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes

ODPolygon< T > Class Template Reference

(Closed) sequence of connected 2-D coordinates More...

List of all members.

Public Member Functions

 ODPolygon ()
 ODPolygon (const TypeSet< Geom::Point2D< T > > &plg)
void erase ()
bool isEmpty () const
int size () const
bool validIdx (int idx) const
void setEmpty ()
void add (const Geom::Point2D< T > &vtx)
void remove (int idx)
void insert (int idx, const Geom::Point2D< T > &vtx)
bool isInside (const Geom::Point2D< T > &, bool inclborder, T eps) const
int isInside (const ODPolygon &testpoly, T eps=0) const
bool segmentMeetsBorder (const Geom::Point2D< T > &pt1, const Geom::Point2D< T > &pt2, T eps) const
bool windowOverlaps (const Interval< T > &xrange, const Interval< T > &yrange, T eps) const
const Geom::Point2D< T > & getVertex (int idx) const
const Geom::Point2D< T > & nextVertex (int idx) const
const Geom::Point2D< T > & prevVertex (int idx) const
void setClosed (bool yn)
bool isClosed () const
void setUdf (Geom::Point2D< T > pt)
Geom::Point2D< T > getUdf () const
const TypeSet< Geom::Point2D
< T > > & 
data () const
Interval< T > getRange (bool of_x) const
void getData (bool of_x, TypeSet< T > &) const
void removeZeroLengths ()
bool isUTurn (int idx) const
bool isSelfIntersecting () const
void convexHull ()
float area () const
bool clockwise () const
bool anticlockwise () const
void reverse ()
double distTo (const Geom::Point2D< T > &refpt, int *segmentidxptr=0, double *fractionptr=0) const
bool operator== (const ODPolygon< T > &) const

Protected Member Functions

float sgnArea () const

Static Protected Member Functions

static int doSegmentsMeet (const Geom::Point2D< T > &p1, const Geom::Point2D< T > &p2, const Geom::Point2D< T > &q1, const Geom::Point2D< T > &q2, T eps)
static bool isOnSegment (const Geom::Point2D< T > &pt, const Geom::Point2D< T > &pt0, const Geom::Point2D< T > &pt1, T eps)
static bool isOnHalfLine (const Geom::Point2D< T > &point, const Geom::Point2D< T > &dirvec, const Geom::Point2D< T > &endvec, T eps)
static bool isEdgeCrossing (const Geom::Point2D< T > &raydir, const Geom::Point2D< T > &raysrc, const Geom::Point2D< T > &vtx1, const Geom::Point2D< T > &vtx2)
static bool isOnLine (const Geom::Point2D< T > &point, const Geom::Point2D< T > &dirvec, const Geom::Point2D< T > &posvec, T eps)
static bool isRightOfLine (const Geom::Point2D< T > &point, const Geom::Point2D< T > &dirvec, const Geom::Point2D< T > &posvec)
static bool doCoincide (const Geom::Point2D< T > &point1, const Geom::Point2D< T > &point2, T eps)
static double sgnDistToLine (const Geom::Point2D< T > &point, const Geom::Point2D< T > &dirvec, const Geom::Point2D< T > &posvec)
static double distToSegment (const Geom::Point2D< T > &p1, const Geom::Point2D< T > &p2, const Geom::Point2D< T > &refpt, double *fractionptr=0)

Protected Attributes

TypeSet< Geom::Point2D< T > > poly_
bool closed_
Geom::Point2D< T > udf_
Interval< T > xrg_
Interval< T > yrg_

Detailed Description

template<class T>
class ODPolygon< T >

(Closed) sequence of connected 2-D coordinates


Constructor & Destructor Documentation

template<class T>
ODPolygon< T >::ODPolygon (  )  [inline]
template<class T>
ODPolygon< T >::ODPolygon ( const TypeSet< Geom::Point2D< T > > &  plg  )  [inline]

Member Function Documentation

template<class T>
void ODPolygon< T >::add ( const Geom::Point2D< T > &  vtx  )  [inline]
template<class T>
bool ODPolygon< T >::anticlockwise (  )  const [inline]
template<class T>
float ODPolygon< T >::area (  )  const [inline]
template<class T>
bool ODPolygon< T >::clockwise (  )  const [inline]
template<class T >
void ODPolygon< T >::convexHull (  )  [inline]
template<class T>
const TypeSet<Geom::Point2D<T> >& ODPolygon< T >::data (  )  const [inline]
template<class T>
double ODPolygon< T >::distTo ( const Geom::Point2D< T > &  refpt,
int *  segmentidxptr = 0,
double *  fractionptr = 0 
) const [inline]
template<class T>
double ODPolygon< T >::distToSegment ( const Geom::Point2D< T > &  p1,
const Geom::Point2D< T > &  p2,
const Geom::Point2D< T > &  refpt,
double *  fractionptr = 0 
) [inline, static, protected]
template<class T>
bool ODPolygon< T >::doCoincide ( const Geom::Point2D< T > &  point1,
const Geom::Point2D< T > &  point2,
eps = mDefEps 
) [inline, static, protected]
template<class T>
int ODPolygon< T >::doSegmentsMeet ( const Geom::Point2D< T > &  p1,
const Geom::Point2D< T > &  p2,
const Geom::Point2D< T > &  q1,
const Geom::Point2D< T > &  q2,
eps 
) [inline, static, protected]
template<class T >
void ODPolygon< T >::erase (  )  [inline]
template<class T>
void ODPolygon< T >::getData ( bool  of_x,
TypeSet< T > &  ts 
) const [inline]
template<class T >
Interval< T > ODPolygon< T >::getRange ( bool  of_x  )  const [inline]
template<class T>
Geom::Point2D<T> ODPolygon< T >::getUdf (  )  const [inline]
template<class T >
const Geom::Point2D< T > & ODPolygon< T >::getVertex ( int  idx  )  const [inline]
template<class T>
void ODPolygon< T >::insert ( int  idx,
const Geom::Point2D< T > &  vtx 
) [inline]
template<class T>
bool ODPolygon< T >::isClosed (  )  const [inline]
template<class T>
bool ODPolygon< T >::isEdgeCrossing ( const Geom::Point2D< T > &  raydir,
const Geom::Point2D< T > &  raysrc,
const Geom::Point2D< T > &  vtx1,
const Geom::Point2D< T > &  vtx2 
) [inline, static, protected]
template<class T>
bool ODPolygon< T >::isEmpty (  )  const [inline]
template<class T>
bool ODPolygon< T >::isInside ( const Geom::Point2D< T > &  point,
bool  inclborder,
eps 
) const [inline]
template<class T>
int ODPolygon< T >::isInside ( const ODPolygon< T > &  testpoly,
eps = 0 
) const [inline]
template<class T>
bool ODPolygon< T >::isOnHalfLine ( const Geom::Point2D< T > &  point,
const Geom::Point2D< T > &  dirvec,
const Geom::Point2D< T > &  endvec,
eps 
) [inline, static, protected]
template<class T>
bool ODPolygon< T >::isOnLine ( const Geom::Point2D< T > &  point,
const Geom::Point2D< T > &  dirvec,
const Geom::Point2D< T > &  posvec,
eps 
) [inline, static, protected]
template<class T>
bool ODPolygon< T >::isOnSegment ( const Geom::Point2D< T > &  pt,
const Geom::Point2D< T > &  pt0,
const Geom::Point2D< T > &  pt1,
eps 
) [inline, static, protected]
template<class T>
bool ODPolygon< T >::isRightOfLine ( const Geom::Point2D< T > &  point,
const Geom::Point2D< T > &  dirvec,
const Geom::Point2D< T > &  posvec 
) [inline, static, protected]
template<class T >
bool ODPolygon< T >::isSelfIntersecting (  )  const [inline]
template<class T >
bool ODPolygon< T >::isUTurn ( int  idx  )  const [inline]
template<class T >
const Geom::Point2D< T > & ODPolygon< T >::nextVertex ( int  idx  )  const [inline]
template<class T>
bool ODPolygon< T >::operator== ( const ODPolygon< T > &  poly  )  const [inline]
template<class T >
const Geom::Point2D< T > & ODPolygon< T >::prevVertex ( int  idx  )  const [inline]
template<class T >
void ODPolygon< T >::remove ( int  idx  )  [inline]
template<class T >
void ODPolygon< T >::removeZeroLengths (  )  [inline]
template<class T >
void ODPolygon< T >::reverse (  )  [inline]
template<class T>
bool ODPolygon< T >::segmentMeetsBorder ( const Geom::Point2D< T > &  pt1,
const Geom::Point2D< T > &  pt2,
eps 
) const [inline]
template<class T>
void ODPolygon< T >::setClosed ( bool  yn  )  [inline]
template<class T>
void ODPolygon< T >::setEmpty (  )  [inline]
template<class T>
void ODPolygon< T >::setUdf ( Geom::Point2D< T >  pt  )  [inline]
template<class T >
float ODPolygon< T >::sgnArea (  )  const [inline, protected]
template<class T>
double ODPolygon< T >::sgnDistToLine ( const Geom::Point2D< T > &  point,
const Geom::Point2D< T > &  dirvec,
const Geom::Point2D< T > &  posvec 
) [inline, static, protected]
template<class T>
int ODPolygon< T >::size (  )  const [inline]
template<class T>
bool ODPolygon< T >::validIdx ( int  idx  )  const [inline]
template<class T>
bool ODPolygon< T >::windowOverlaps ( const Interval< T > &  xrange,
const Interval< T > &  yrange,
eps 
) const [inline]

Member Data Documentation

template<class T>
bool ODPolygon< T >::closed_ [protected]
template<class T>
TypeSet<Geom::Point2D<T> > ODPolygon< T >::poly_ [protected]
template<class T>
Geom::Point2D<T> ODPolygon< T >::udf_ [protected]
template<class T>
Interval<T> ODPolygon< T >::xrg_ [mutable, protected]
template<class T>
Interval<T> ODPolygon< T >::yrg_ [mutable, protected]