omegalib  13.1
omicron::Rect_T< Type > Struct Template Reference

Stores a rectangular region in integer units. More...

#include <Math.h>

Public Types

typedef Eigen::Matrix< Type, 2, 1 > VectorType
 

Public Member Functions

 Rect_T ()
 
 Rect_T (const VectorType &vmin, const VectorType &vmax)
 
 Rect_T (Type x, Type y, Type width, Type height)
 
Type width () const
 
Type height () const
 
VectorType size () const
 
Type x () const
 
Type y () const
 
bool intersects (const Rect_T< Type > &other) const
 
std::pair< bool, Rect_T< Type > > getIntersection (const Rect_T< Type > &other)
 Computes the intersection between this rect and other. More...
 
std::pair< bool, Rect_T< Type > > subtract (const Rect_T< Type > &other)
 Computex the convex subtraction between this rect & other, i.e The rectangle generated by subtracting other from this rect. More...
 
bool operator!= (const Rect_T< Type > &other)
 
bool operator== (const Rect_T< Type > &other)
 

Public Attributes

VectorType min
 
VectorType max
 

Detailed Description

template<class Type>
struct omicron::Rect_T< Type >

Stores a rectangular region in integer units.

Useful for storing viewports and other pixel-space regions.

Member Typedef Documentation

template<class Type>
typedef Eigen::Matrix<Type, 2, 1> omicron::Rect_T< Type >::VectorType

Constructor & Destructor Documentation

template<class Type>
omicron::Rect_T< Type >::Rect_T ( )
inline
template<class Type>
omicron::Rect_T< Type >::Rect_T ( const VectorType vmin,
const VectorType vmax 
)
inline
template<class Type>
omicron::Rect_T< Type >::Rect_T ( Type  x,
Type  y,
Type  width,
Type  height 
)
inline

Member Function Documentation

template<class Type>
std::pair<bool, Rect_T<Type> > omicron::Rect_T< Type >::getIntersection ( const Rect_T< Type > &  other)
inline

Computes the intersection between this rect and other.

Returns a pair containing a boolean set to true if an intersection exists, and the resulting rect.

template<class Type>
Type omicron::Rect_T< Type >::height ( ) const
inline
template<class Type>
bool omicron::Rect_T< Type >::intersects ( const Rect_T< Type > &  other) const
inline
template<class Type>
bool omicron::Rect_T< Type >::operator!= ( const Rect_T< Type > &  other)
inline
template<class Type>
bool omicron::Rect_T< Type >::operator== ( const Rect_T< Type > &  other)
inline
template<class Type>
VectorType omicron::Rect_T< Type >::size ( ) const
inline
template<class Type>
std::pair<bool, Rect_T<Type> > omicron::Rect_T< Type >::subtract ( const Rect_T< Type > &  other)
inline

Computex the convex subtraction between this rect & other, i.e The rectangle generated by subtracting other from this rect.

template<class Type>
Type omicron::Rect_T< Type >::width ( ) const
inline
template<class Type>
Type omicron::Rect_T< Type >::x ( ) const
inline
template<class Type>
Type omicron::Rect_T< Type >::y ( ) const
inline

Member Data Documentation

template<class Type>
VectorType omicron::Rect_T< Type >::max
template<class Type>
VectorType omicron::Rect_T< Type >::min

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