OpendTect-6_4  6.4
Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
ODPolygon< T > Class Template Reference

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

Inheritance diagram for ODPolygon< T >:
[legend]

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 ()
 
void keepBendPoints (float eps)
 
double area () const
 
bool clockwise () const
 
bool anticlockwise () const
 
void reverse ()
 
double distTo (const Geom::Point2D< T > &refpt, int *segmentidxptr=0, double *fractionptr=0) const
 
double maxDistToBorderEstimate (double maxrelerr=0.001) const
 
bool operator== (const ODPolygon< T > &) const
 
bool operator> (const ODPolygon< T > &plg) const
 

Protected Member Functions

template<class ST >
ST sgnArea2 () 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=mDefEps)
 
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>
double 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 
)
inlinestaticprotected
template<class T>
bool ODPolygon< T >::doCoincide ( const Geom::Point2D< T > &  point1,
const Geom::Point2D< T > &  point2,
eps = mDefEps 
)
inlinestaticprotected
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 
)
inlinestaticprotected
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 
)
inlinestaticprotected
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 
)
inlinestaticprotected
template<class T>
bool ODPolygon< T >::isOnLine ( const Geom::Point2D< T > &  point,
const Geom::Point2D< T > &  dirvec,
const Geom::Point2D< T > &  posvec,
eps 
)
inlinestaticprotected
template<class T>
bool ODPolygon< T >::isOnSegment ( const Geom::Point2D< T > &  pt,
const Geom::Point2D< T > &  pt0,
const Geom::Point2D< T > &  pt1,
eps 
)
inlinestaticprotected
template<class T>
bool ODPolygon< T >::isRightOfLine ( const Geom::Point2D< T > &  point,
const Geom::Point2D< T > &  dirvec,
const Geom::Point2D< T > &  posvec 
)
inlinestaticprotected
template<class T >
bool ODPolygon< T >::isSelfIntersecting ( ) const
inline
template<class T >
bool ODPolygon< T >::isUTurn ( int  idx) const
inline
template<class T >
void ODPolygon< T >::keepBendPoints ( float  eps)
inline
template<class T >
double ODPolygon< T >::maxDistToBorderEstimate ( double  maxrelerr = 0.001) 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>
bool ODPolygon< T >::operator> ( const ODPolygon< T > &  plg) 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 >
template<class ST >
ST ODPolygon< T >::sgnArea2 ( ) const
inlineprotected
template<class T>
double ODPolygon< T >::sgnDistToLine ( const Geom::Point2D< T > &  point,
const Geom::Point2D< T > &  dirvec,
const Geom::Point2D< T > &  posvec 
)
inlinestaticprotected
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_
mutableprotected
template<class T>
Interval<T> ODPolygon< T >::yrg_
mutableprotected

Generated at for the OpendTect seismic interpretation project. Copyright (C): dGB Beheer B. V. 2019