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

Protected Attributes

Point2D< T > bottomright_
 
Point2D< T > topleft_
 

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

◆ Rectangle() [1/3]

template<class T >
Geom::Rectangle< T >::Rectangle ( l = 0,
t = 0,
r = 0,
b = 0 
)
inline

◆ Rectangle() [2/3]

template<class T >
Geom::Rectangle< T >::Rectangle ( const Point2D< T > &  tl,
const Point2D< T > &  br 
)
inline

◆ Rectangle() [3/3]

template<class T >
Geom::Rectangle< T >::Rectangle ( const Point2D< T > &  tl,
const Size2D< T > &  sz 
)
inline

Member Function Documentation

◆ bottom()

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

◆ bottomLeft()

template<class T >
Point2D< T > Geom::Rectangle< T >::bottomLeft
inline

◆ bottomRight()

template<class T >
Point2D< T > Geom::Rectangle< T >::bottomRight
inline

◆ centre()

template<class T >
Point2D< T > Geom::Rectangle< T >::centre
inline

◆ checkCorners()

template<class T >
bool Geom::Rectangle< T >::checkCorners ( bool  leftislow = true,
bool  topislow = true 
) const
inline

◆ height()

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

◆ include() [1/2]

template<class T >
void Geom::Rectangle< T >::include ( const Point2D< T > &  p)
inline

◆ include() [2/2]

template<class T >
void Geom::Rectangle< T >::include ( const Rectangle< T > &  r)
inline

◆ isDefined()

template<class T >
bool Geom::Rectangle< T >::isDefined
inline

◆ left()

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

◆ limitTo()

template<class T >
void Geom::Rectangle< T >::limitTo ( const Rectangle< T > &  r)
inline

◆ moveInside()

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

◆ operator!=()

template<class T >
bool Geom::Rectangle< T >::operator!= ( const Rectangle< T > &  r) const
inline

◆ operator+=() [1/2]

template<class T >
Rectangle< T > & Geom::Rectangle< T >::operator+= ( const Point2D< T > &  p)
inline

◆ operator+=() [2/2]

template<class T >
Rectangle< T > & Geom::Rectangle< T >::operator+= ( const Size2D< T > &  sz)
inline

◆ operator-=() [1/2]

template<class T >
Rectangle< T > & Geom::Rectangle< T >::operator-= ( const Point2D< T > &  p)
inline

◆ operator-=() [2/2]

template<class T >
Rectangle< T > & Geom::Rectangle< T >::operator-= ( const Size2D< T > &  sz)
inline

◆ operator==()

template<class T >
bool Geom::Rectangle< T >::operator== ( const Rectangle< T > &  r) const
inline

◆ operator>()

template<class T >
bool Geom::Rectangle< T >::operator> ( const Rectangle< T > &  r) const
inline

◆ revX()

template<class T >
bool Geom::Rectangle< T >::revX
inline

◆ revY()

template<class T >
bool Geom::Rectangle< T >::revY
inline

◆ right()

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

◆ setBottom()

template<class T >
void Geom::Rectangle< T >::setBottom ( val)
inline

◆ setBottomLeft()

template<class T >
void Geom::Rectangle< T >::setBottomLeft ( Point2D< T >  tr)
inline

◆ setBottomRight()

template<class T >
void Geom::Rectangle< T >::setBottomRight ( Point2D< T >  br)
inline

◆ setLeft()

template<class T >
void Geom::Rectangle< T >::setLeft ( val)
inline

◆ setLeftRight()

template<class T >
void Geom::Rectangle< T >::setLeftRight ( const Interval< T > &  rg)
inline

◆ setRight()

template<class T >
void Geom::Rectangle< T >::setRight ( val)
inline

◆ setTop()

template<class T >
void Geom::Rectangle< T >::setTop ( val)
inline

◆ setTopBottom()

template<class T >
void Geom::Rectangle< T >::setTopBottom ( const Interval< T > &  rg)
inline

◆ setTopLeft()

template<class T >
void Geom::Rectangle< T >::setTopLeft ( Point2D< T >  tl)
inline

◆ setTopRight()

template<class T >
void Geom::Rectangle< T >::setTopRight ( Point2D< T >  tr)
inline

◆ size()

template<class T >
Size2D< T > Geom::Rectangle< T >::size
inline

◆ sortCorners()

template<class T >
void Geom::Rectangle< T >::sortCorners ( bool  leftislow = true,
bool  topislow = true 
)
inline
Returns
if the corners are consistent

◆ swapHor()

template<class T >
void Geom::Rectangle< T >::swapHor
inline

◆ swapVer()

template<class T >
void Geom::Rectangle< T >::swapVer
inline

◆ top()

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

◆ topLeft()

template<class T >
Point2D< T > Geom::Rectangle< T >::topLeft
inline

◆ topRight()

template<class T >
Point2D< T > Geom::Rectangle< T >::topRight
inline

◆ translate()

template<class T >
void Geom::Rectangle< T >::translate ( const Point2D< T > &  trans)
inline

◆ width()

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

◆ zero()

template<class T >
void Geom::Rectangle< T >::zero
inline

Member Data Documentation

◆ bottomright_

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

◆ topleft_

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

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