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

Basic 2D rectangle class. More...

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

Public Member Functions

 Rectangle (T l=0, T t=0, T r=0, T b=0)
 
 Rectangle (const Point2D< T > &tl, const Point2D< T > &br)
 
 Rectangle (const Point2D< T > &tl, const Size2D< T > &sz)
 
bool operator== (const Rectangle< T > &) const
 
bool operator!= (const Rectangle< T > &) const
 
Point2D< T > topLeft () const
 
Point2D< T > topRight () const
 
Point2D< T > bottomLeft () const
 
Point2D< T > bottomRight () const
 
Point2D< T > centre () const
 
void setTopLeft (Point2D< T >)
 
void setBottomRight (Point2D< T >)
 
void setTopRight (Point2D< T >)
 
void setBottomLeft (Point2D< T >)
 
void setTopBottom (const Interval< T > &)
 
void setLeftRight (const Interval< T > &)
 
Point2D< T > moveInside (const Point2D< T > &) const
 
void include (const Rectangle< T > &)
 
void include (const Point2D< T > &)
 
void limitTo (const Rectangle< T > &)
 
void translate (const Point2D< T > &)
 
bool operator> (const Rectangle< T > &) const
 
width () const
 
height () const
 
left () const
 
top () const
 
right () const
 
bottom () const
 
void setLeft (T val)
 
void setTop (T val)
 
void setRight (T val)
 
void setBottom (T val)
 
bool checkCorners (bool leftislow=true, bool topislow=true) const
 
void sortCorners (bool leftislow=true, bool topislow=true)
 
Size2D< T > size () const
 
void zero ()
 
bool isDefined () const
 
Rectangle< T > & operator+= (const Point2D< T > &)
 
Rectangle< T > & operator-= (const Point2D< T > &)
 
Rectangle< T > & operator+= (const Size2D< T > &)
 
Rectangle< T > & operator-= (const Size2D< T > &)
 
void swapHor ()
 
void swapVer ()
 
bool revX () const
 
bool revY () const
 

Protected Attributes

Point2D< T > topleft_
 
Point2D< T > bottomright_
 

Detailed Description

template<class T>
class Geom::Rectangle< T >

Basic 2D rectangle class.

This class is a bit more complicated than would be expected at first sight. This is caused by the problem of coordinate system sign. For example, in user interfaces, top is a lower number than bottom. But for normal coordinates, this is (of course) not the case. Still, also for floating point types, reverse axes are common.

Constructor & Destructor Documentation

template<class T>
Geom::Rectangle< T >::Rectangle ( l = 0,
t = 0,
r = 0,
b = 0 
)
inline
template<class T>
Geom::Rectangle< T >::Rectangle ( const Point2D< T > &  tl,
const Point2D< T > &  br 
)
inline
template<class T>
Geom::Rectangle< T >::Rectangle ( const Point2D< T > &  tl,
const Size2D< T > &  sz 
)
inline

Member Function Documentation

template<class T >
T Geom::Rectangle< T >::bottom ( ) const
inline
template<class T >
Point2D< T > Geom::Rectangle< T >::bottomLeft ( ) const
inline
template<class T >
Point2D< T > Geom::Rectangle< T >::bottomRight ( ) const
inline
template<class T >
Point2D< T > Geom::Rectangle< T >::centre ( ) const
inline
template<class T >
bool Geom::Rectangle< T >::checkCorners ( bool  leftislow = true,
bool  topislow = true 
) const
inline
template<class T >
T Geom::Rectangle< T >::height ( ) const
inline
template<class T>
void Geom::Rectangle< T >::include ( const Rectangle< T > &  r)
inline
template<class T>
void Geom::Rectangle< T >::include ( const Point2D< T > &  p)
inline
template<class T >
bool Geom::Rectangle< T >::isDefined ( ) const
inline
template<class T >
T Geom::Rectangle< T >::left ( ) const
inline
template<class T>
void Geom::Rectangle< T >::limitTo ( const Rectangle< T > &  r)
inline
template<class T>
Point2D< T > Geom::Rectangle< T >::moveInside ( const Point2D< T > &  pt) const
inline
template<class T>
bool Geom::Rectangle< T >::operator!= ( const Rectangle< T > &  r) const
inline
template<class T>
Rectangle< T > & Geom::Rectangle< T >::operator+= ( const Point2D< T > &  p)
inline
template<class T>
Rectangle< T > & Geom::Rectangle< T >::operator+= ( const Size2D< T > &  sz)
inline
template<class T>
Rectangle< T > & Geom::Rectangle< T >::operator-= ( const Point2D< T > &  p)
inline
template<class T>
Rectangle< T > & Geom::Rectangle< T >::operator-= ( const Size2D< T > &  sz)
inline
template<class T>
bool Geom::Rectangle< T >::operator== ( const Rectangle< T > &  r) const
inline
template<class T>
bool Geom::Rectangle< T >::operator> ( const Rectangle< T > &  r) const
inline
template<class T >
bool Geom::Rectangle< T >::revX ( ) const
inline
template<class T >
bool Geom::Rectangle< T >::revY ( ) const
inline
template<class T >
T Geom::Rectangle< T >::right ( ) const
inline
template<class T>
void Geom::Rectangle< T >::setBottom ( val)
inline
template<class T>
void Geom::Rectangle< T >::setBottomLeft ( Point2D< T >  tr)
inline
template<class T>
void Geom::Rectangle< T >::setBottomRight ( Point2D< T >  br)
inline
template<class T>
void Geom::Rectangle< T >::setLeft ( val)
inline
template<class T>
void Geom::Rectangle< T >::setLeftRight ( const Interval< T > &  rg)
inline
template<class T>
void Geom::Rectangle< T >::setRight ( val)
inline
template<class T>
void Geom::Rectangle< T >::setTop ( val)
inline
template<class T>
void Geom::Rectangle< T >::setTopBottom ( const Interval< T > &  rg)
inline
template<class T>
void Geom::Rectangle< T >::setTopLeft ( Point2D< T >  tl)
inline
template<class T>
void Geom::Rectangle< T >::setTopRight ( Point2D< T >  tr)
inline
template<class T >
Size2D< T > Geom::Rectangle< T >::size ( ) const
inline
template<class T >
void Geom::Rectangle< T >::sortCorners ( bool  leftislow = true,
bool  topislow = true 
)
inline
Returns
if the corners are consistent
template<class T >
void Geom::Rectangle< T >::swapHor ( )
inline
template<class T >
void Geom::Rectangle< T >::swapVer ( )
inline
template<class T >
T Geom::Rectangle< T >::top ( ) const
inline
template<class T >
Point2D< T > Geom::Rectangle< T >::topLeft ( ) const
inline
template<class T >
Point2D< T > Geom::Rectangle< T >::topRight ( ) const
inline
template<class T>
void Geom::Rectangle< T >::translate ( const Point2D< T > &  trans)
inline
template<class T >
T Geom::Rectangle< T >::width ( ) const
inline
template<class T >
void Geom::Rectangle< T >::zero ( )
inline

Member Data Documentation

template<class T>
Point2D<T> Geom::Rectangle< T >::bottomright_
protected
template<class T>
Point2D<T> Geom::Rectangle< T >::topleft_
protected

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