LibreOffice Module basegfx (master) 1
Public Types | Public Member Functions | Protected Attributes | List of all members
basegfx::Range2D< TYPE, TRAITS > Class Template Reference

#include <Range2D.hxx>

Inheritance diagram for basegfx::Range2D< TYPE, TRAITS >:
[legend]
Collaboration diagram for basegfx::Range2D< TYPE, TRAITS >:
[legend]

Public Types

typedef TYPE ValueType
 
typedef TRAITS TraitsType
 

Public Member Functions

 Range2D ()=default
 
 Range2D (const Tuple2D< TYPE > &rTuple)
 Create degenerate interval consisting of a single point. More...
 
 Range2D (const Tuple2D< TYPE > &rTuple1, const Tuple2D< TYPE > &rTuple2)
 Create proper interval between the two given points. More...
 
 Range2D (TYPE x1, TYPE y1, TYPE x2, TYPE y2)
 Create proper interval between the two given pairs. More...
 
bool isEmpty () const
 Check if the interval set is empty. More...
 
void reset ()
 reset the object to empty state again, clearing all values More...
 
bool operator== (const Range2D &rRange) const
 
bool operator!= (const Range2D &rRange) const
 
bool equal (const Range2D &rRange) const
 
TYPE getMinX () const
 get lower bound of the set. returns arbitrary values for empty sets. More...
 
TYPE getMinY () const
 get lower bound of the set. returns arbitrary values for empty sets. More...
 
TYPE getMaxX () const
 get upper bound of the set. returns arbitrary values for empty sets. More...
 
TYPE getMaxY () const
 get upper bound of the set. returns arbitrary values for empty sets. More...
 
TYPE getWidth () const
 return difference between upper and lower X value. returns 0 for empty sets. More...
 
TYPE getHeight () const
 return difference between upper and lower Y value. returns 0 for empty sets. More...
 
double getCenterX () const
 return center X value of set. returns 0 for empty sets. More...
 
double getCenterY () const
 return center Y value of set. returns 0 for empty sets. More...
 
bool isInside (const Tuple2D< TYPE > &rTuple) const
 yields true if given point is contained in set More...
 
bool isInside (const Range2D &rRange) const
 yields true if rRange is inside, or equal to set More...
 
bool overlaps (const Range2D &rRange) const
 yields true if rRange at least partly inside set More...
 
bool overlapsMore (const Range2D &rRange) const
 yields true if overlaps(rRange) does, and the overlap is larger than infinitesimal More...
 
void expand (const Tuple2D< TYPE > &rTuple)
 add point to the set, expanding as necessary More...
 
void expand (const Range2D &rRange)
 add rRange to the set, expanding as necessary More...
 
void intersect (const Range2D &rRange)
 calc set intersection More...
 
void grow (TYPE fValue)
 grow set by fValue on all sides More...
 
void grow (const Tuple2D< TYPE > &rTuple)
 grow set by axis aware values from rTuple More...
 
Tuple2D< TYPE > clamp (const Tuple2D< TYPE > &rTuple) const
 clamp value on range More...
 

Protected Attributes

basegfx::BasicRange< TYPE, TRAITS > maRangeX
 
basegfx::BasicRange< TYPE, TRAITS > maRangeY
 

Detailed Description

template<typename TYPE, typename TRAITS>
class basegfx::Range2D< TYPE, TRAITS >

Definition at line 28 of file Range2D.hxx.

Member Typedef Documentation

◆ TraitsType

template<typename TYPE , typename TRAITS >
typedef TRAITS basegfx::Range2D< TYPE, TRAITS >::TraitsType

Definition at line 36 of file Range2D.hxx.

◆ ValueType

template<typename TYPE , typename TRAITS >
typedef TYPE basegfx::Range2D< TYPE, TRAITS >::ValueType

Definition at line 35 of file Range2D.hxx.

Constructor & Destructor Documentation

◆ Range2D() [1/4]

template<typename TYPE , typename TRAITS >
basegfx::Range2D< TYPE, TRAITS >::Range2D ( )
default

◆ Range2D() [2/4]

template<typename TYPE , typename TRAITS >
basegfx::Range2D< TYPE, TRAITS >::Range2D ( const Tuple2D< TYPE > &  rTuple)
inlineexplicit

Create degenerate interval consisting of a single point.

Definition at line 41 of file Range2D.hxx.

◆ Range2D() [3/4]

template<typename TYPE , typename TRAITS >
basegfx::Range2D< TYPE, TRAITS >::Range2D ( const Tuple2D< TYPE > &  rTuple1,
const Tuple2D< TYPE > &  rTuple2 
)
inline

Create proper interval between the two given points.

Definition at line 48 of file Range2D.hxx.

References basegfx::Range2D< TYPE, TRAITS >::expand().

◆ Range2D() [4/4]

template<typename TYPE , typename TRAITS >
basegfx::Range2D< TYPE, TRAITS >::Range2D ( TYPE  x1,
TYPE  y1,
TYPE  x2,
TYPE  y2 
)
inline

Create proper interval between the two given pairs.

Definition at line 56 of file Range2D.hxx.

References basegfx::BasicRange< T, Traits >::expand(), basegfx::Range2D< TYPE, TRAITS >::maRangeX, and basegfx::Range2D< TYPE, TRAITS >::maRangeY.

Member Function Documentation

◆ clamp()

template<typename TYPE , typename TRAITS >
Tuple2D< TYPE > basegfx::Range2D< TYPE, TRAITS >::clamp ( const Tuple2D< TYPE > &  rTuple) const
inline

◆ equal()

template<typename TYPE , typename TRAITS >
bool basegfx::Range2D< TYPE, TRAITS >::equal ( const Range2D< TYPE, TRAITS > &  rRange) const
inline

◆ expand() [1/2]

template<typename TYPE , typename TRAITS >
void basegfx::Range2D< TYPE, TRAITS >::expand ( const Range2D< TYPE, TRAITS > &  rRange)
inline

add rRange to the set, expanding as necessary

Definition at line 149 of file Range2D.hxx.

References basegfx::BasicRange< T, Traits >::expand(), basegfx::Range2D< TYPE, TRAITS >::maRangeX, and basegfx::Range2D< TYPE, TRAITS >::maRangeY.

◆ expand() [2/2]

template<typename TYPE , typename TRAITS >
void basegfx::Range2D< TYPE, TRAITS >::expand ( const Tuple2D< TYPE > &  rTuple)
inline

◆ getCenterX()

template<typename TYPE , typename TRAITS >
double basegfx::Range2D< TYPE, TRAITS >::getCenterX ( ) const
inline

return center X value of set. returns 0 for empty sets.

Definition at line 112 of file Range2D.hxx.

References basegfx::BasicRange< T, Traits >::getCenter(), and basegfx::Range2D< TYPE, TRAITS >::maRangeX.

Referenced by basegfx::utils::createRotateAroundCenterKeepAspectRatioStayInsideRange().

◆ getCenterY()

template<typename TYPE , typename TRAITS >
double basegfx::Range2D< TYPE, TRAITS >::getCenterY ( ) const
inline

return center Y value of set. returns 0 for empty sets.

Definition at line 115 of file Range2D.hxx.

References basegfx::BasicRange< T, Traits >::getCenter(), and basegfx::Range2D< TYPE, TRAITS >::maRangeY.

Referenced by basegfx::utils::createRotateAroundCenterKeepAspectRatioStayInsideRange().

◆ getHeight()

template<typename TYPE , typename TRAITS >
TYPE basegfx::Range2D< TYPE, TRAITS >::getHeight ( ) const
inline

◆ getMaxX()

template<typename TYPE , typename TRAITS >
TYPE basegfx::Range2D< TYPE, TRAITS >::getMaxX ( ) const
inline

◆ getMaxY()

template<typename TYPE , typename TRAITS >
TYPE basegfx::Range2D< TYPE, TRAITS >::getMaxY ( ) const
inline

◆ getMinX()

template<typename TYPE , typename TRAITS >
TYPE basegfx::Range2D< TYPE, TRAITS >::getMinX ( ) const
inline

◆ getMinY()

template<typename TYPE , typename TRAITS >
TYPE basegfx::Range2D< TYPE, TRAITS >::getMinY ( ) const
inline

◆ getWidth()

template<typename TYPE , typename TRAITS >
TYPE basegfx::Range2D< TYPE, TRAITS >::getWidth ( ) const
inline

◆ grow() [1/2]

template<typename TYPE , typename TRAITS >
void basegfx::Range2D< TYPE, TRAITS >::grow ( const Tuple2D< TYPE > &  rTuple)
inline

◆ grow() [2/2]

template<typename TYPE , typename TRAITS >
void basegfx::Range2D< TYPE, TRAITS >::grow ( TYPE  fValue)
inline

◆ intersect()

template<typename TYPE , typename TRAITS >
void basegfx::Range2D< TYPE, TRAITS >::intersect ( const Range2D< TYPE, TRAITS > &  rRange)
inline

◆ isEmpty()

template<typename TYPE , typename TRAITS >
bool basegfx::Range2D< TYPE, TRAITS >::isEmpty ( ) const
inline

◆ isInside() [1/2]

template<typename TYPE , typename TRAITS >
bool basegfx::Range2D< TYPE, TRAITS >::isInside ( const Range2D< TYPE, TRAITS > &  rRange) const
inline

yields true if rRange is inside, or equal to set

Definition at line 124 of file Range2D.hxx.

References basegfx::BasicRange< T, Traits >::isInside(), basegfx::Range2D< TYPE, TRAITS >::maRangeX, and basegfx::Range2D< TYPE, TRAITS >::maRangeY.

◆ isInside() [2/2]

template<typename TYPE , typename TRAITS >
bool basegfx::Range2D< TYPE, TRAITS >::isInside ( const Tuple2D< TYPE > &  rTuple) const
inline

◆ operator!=()

template<typename TYPE , typename TRAITS >
bool basegfx::Range2D< TYPE, TRAITS >::operator!= ( const Range2D< TYPE, TRAITS > &  rRange) const
inline

◆ operator==()

template<typename TYPE , typename TRAITS >
bool basegfx::Range2D< TYPE, TRAITS >::operator== ( const Range2D< TYPE, TRAITS > &  rRange) const
inline

◆ overlaps()

template<typename TYPE , typename TRAITS >
bool basegfx::Range2D< TYPE, TRAITS >::overlaps ( const Range2D< TYPE, TRAITS > &  rRange) const
inline

◆ overlapsMore()

template<typename TYPE , typename TRAITS >
bool basegfx::Range2D< TYPE, TRAITS >::overlapsMore ( const Range2D< TYPE, TRAITS > &  rRange) const
inline

yields true if overlaps(rRange) does, and the overlap is larger than infinitesimal

Definition at line 136 of file Range2D.hxx.

References basegfx::Range2D< TYPE, TRAITS >::maRangeX, basegfx::Range2D< TYPE, TRAITS >::maRangeY, and basegfx::BasicRange< T, Traits >::overlapsMore().

◆ reset()

template<typename TYPE , typename TRAITS >
void basegfx::Range2D< TYPE, TRAITS >::reset ( )
inline

reset the object to empty state again, clearing all values

Definition at line 72 of file Range2D.hxx.

References basegfx::Range2D< TYPE, TRAITS >::maRangeX, basegfx::Range2D< TYPE, TRAITS >::maRangeY, and basegfx::BasicRange< T, Traits >::reset().

Referenced by basegfx::ImplB2DPolyRange::clear().

Member Data Documentation

◆ maRangeX

template<typename TYPE , typename TRAITS >
basegfx::BasicRange<TYPE, TRAITS> basegfx::Range2D< TYPE, TRAITS >::maRangeX
protected

◆ maRangeY

template<typename TYPE , typename TRAITS >
basegfx::BasicRange<TYPE, TRAITS> basegfx::Range2D< TYPE, TRAITS >::maRangeY
protected

The documentation for this class was generated from the following file: