OpendTect  6.3
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
Geom::Point2D< T > Class Template Reference

2D point or vector class. More...

Inheritance diagram for Geom::Point2D< T >:
[legend]

Public Member Functions

 Point2D (T xx=0, T yy=0)
 
template<class TT >
Point2D< T > & setFrom (const Point2D< TT > &)
 
template<class TT >
void setXY (TT xx, TT yy)
 
void setXY (T xx, T yy)
 
Point2D< T > & zero ()
 
Point2D< T > operator- () const
 
T & operator[] (int idx)
 
operator[] (int idx) const
 
bool operator== (const Point2D< T > &) const
 
bool operator!= (const Point2D< T > &) const
 
Point2D< T > & operator+= (T dist)
 
Point2D< T > & operator*= (T factor)
 
Point2D< T > & operator/= (T den)
 
Point2D< T > & operator+= (const Point2D< T > &)
 
Point2D< T > & operator-= (const Point2D< T > &)
 
Point2D< T > operator+ (const Point2D< T > &) const
 
Point2D< T > operator- (const Point2D< T > &) const
 
Point2D< T > operator* (const T factor) const
 
Point2D< T > operator/ (const T den) const
 
bool operator< (const Point2D< T > &crd) const
 
bool operator> (const Point2D< T > &crd) const
 
void swapXY ()
 
dot (const Point2D< T > &) const
 
bool isDefined () const
 
bool isUdf () const
 
Point2D< T > normalize () const
 
template<class FT >
FT abs () const
 
sqAbs () const
 Squared absolute value. More...
 
template<class FT >
FT distTo (const Point2D< T > &) const
 
sqDistTo (const Point2D< T > &) const
 Squared distance. More...
 
template<class FT >
FT angle (const Point2D< T > &from, const Point2D< T > &to) const
 
template<class FT >
FT cosAngle (const Point2D< T > &from, const Point2D< T > &to) const
 saves the expensive acos() call More...
 
BufferString toString (int nrdec=-1) const
 
BufferString toPrettyString () const
 
bool fromString (const char *)
 
template<>
BufferString toString (int nrdec) const
 
template<>
BufferString toString (int nrdec) const
 
template<>
Point2D< double > normalize () const
 
template<>
Point2D< float > normalize () const
 

Static Public Member Functions

static Point2D< T > udf ()
 

Public Attributes

x_
 
y_
 

Detailed Description

template<class T>
class Geom::Point2D< T >

2D point or vector class.

Constructor & Destructor Documentation

template<class T>
Geom::Point2D< T >::Point2D ( xx = 0,
yy = 0 
)
inline

Member Function Documentation

template<class T >
template<class FT >
FT Geom::Point2D< T >::abs ( ) const
inline
template<class T>
template<class FT >
FT Geom::Point2D< T >::angle ( const Point2D< T > &  from,
const Point2D< T > &  to 
) const
inline
template<class T>
template<class FT >
FT Geom::Point2D< T >::cosAngle ( const Point2D< T > &  from,
const Point2D< T > &  to 
) const
inline

saves the expensive acos() call

template<class T>
template<class FT >
FT Geom::Point2D< T >::distTo ( const Point2D< T > &  pt) const
inline
template<class T>
T Geom::Point2D< T >::dot ( const Point2D< T > &  b) const
inline
template<class T >
bool Geom::Point2D< T >::fromString ( const char *  s)
inline
template<class T >
bool Geom::Point2D< T >::isDefined ( ) const
inline
template<class T>
bool Geom::Point2D< T >::isUdf ( ) const
inline
template<class T >
Point2D< T > Geom::Point2D< T >::normalize ( ) const
inline
template<>
Point2D< double > Geom::Point2D< double >::normalize ( ) const
inline
template<>
Point2D< float > Geom::Point2D< float >::normalize ( ) const
inline
template<class T>
bool Geom::Point2D< T >::operator!= ( const Point2D< T > &  p) const
inline
template<class T>
Point2D< T > Geom::Point2D< T >::operator* ( const T  factor) const
inline
template<class T>
Point2D< T > & Geom::Point2D< T >::operator*= ( factor)
inline
template<class T>
Point2D< T > Geom::Point2D< T >::operator+ ( const Point2D< T > &  p) const
inline
template<class T>
Point2D< T > & Geom::Point2D< T >::operator+= ( dist)
inline
template<class T>
Point2D< T > & Geom::Point2D< T >::operator+= ( const Point2D< T > &  p)
inline
template<class T >
Point2D< T > Geom::Point2D< T >::operator- ( ) const
inline
template<class T>
Point2D< T > Geom::Point2D< T >::operator- ( const Point2D< T > &  p) const
inline
template<class T>
Point2D< T > & Geom::Point2D< T >::operator-= ( const Point2D< T > &  p)
inline
template<class T>
Point2D< T > Geom::Point2D< T >::operator/ ( const T  den) const
inline
template<class T>
Point2D< T > & Geom::Point2D< T >::operator/= ( den)
inline
template<class T>
bool Geom::Point2D< T >::operator< ( const Point2D< T > &  crd) const
inline
template<class T>
bool Geom::Point2D< T >::operator== ( const Point2D< T > &  p) const
inline
template<class T>
bool Geom::Point2D< T >::operator> ( const Point2D< T > &  crd) const
inline
template<class T >
T & Geom::Point2D< T >::operator[] ( int  idx)
inline
template<class T >
T Geom::Point2D< T >::operator[] ( int  idx) const
inline
template<class T >
template<class TT >
Point2D< T > & Geom::Point2D< T >::setFrom ( const Point2D< TT > &  a)
inline
template<class T >
template<class TT >
void Geom::Point2D< T >::setXY ( TT  xx,
TT  yy 
)
inline
template<class T>
void Geom::Point2D< T >::setXY ( xx,
yy 
)
inline
template<class T >
T Geom::Point2D< T >::sqAbs ( ) const
inline

Squared absolute value.

template<class T>
T Geom::Point2D< T >::sqDistTo ( const Point2D< T > &  pt) const
inline

Squared distance.

template<class T >
void Geom::Point2D< T >::swapXY ( )
inline
template<class T>
BufferString Geom::Point2D< T >::toPrettyString ( ) const
inline
template<class T >
BufferString Geom::Point2D< T >::toString ( int  nrdec = -1) const
inline
template<>
BufferString Geom::Point2D< float >::toString ( int  nrdec) const
inline
template<>
BufferString Geom::Point2D< double >::toString ( int  nrdec) const
inline
template<class T>
static Point2D<T> Geom::Point2D< T >::udf ( )
inlinestatic
template<class T >
Point2D< T > & Geom::Point2D< T >::zero ( )
inline

Member Data Documentation

template<class T>
T Geom::Point2D< T >::x_
template<class T>
T Geom::Point2D< T >::y_

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