CEDRIC  Revision_backup-2009-02
Public Member Functions | Public Attributes | List of all members
ClipRect Class Reference

Simple rectangle structure (e.g. usefull for saving ortho clipplanes) More...

#include <ClipRect.h>

Public Member Functions

 ClipRect ()
 
 ClipRect (double left_, double right_, double bottom_, double top_)
 
void sort ()
 Swap values such that (left <= right) && (bottom <= top) More...
 
double center_x () const
 Returns horizontal center. More...
 
double center_y () const
 Returns vertical center. More...
 
double width () const
 Returns right-left (absolute value) More...
 
double height () const
 Returns bottom-top (absolute value) More...
 
void scale_x (float s)
 Scale horizontal by extending left and right border equally. More...
 
void scale_y (float s)
 Scale vertical by extending bottom and top border equally. More...
 
double aspect () const
 Returns aspect width()/height() More...
 
void translate (double x, double y)
 Translate center by x and y. More...
 
 ClipRect (osg::Vec2 min, osg::Vec2 max)
 
 ClipRect (const osg::BoundingSphere &bs)
 
void fromBoundingSphere (const osg::BoundingSphere &bs)
 
 ClipRect (const QRect &qr)
 
void fromQRect (const QRect &qr)
 

Public Attributes

double left
 
double right
 
double bottom
 
double top
 

Detailed Description

Simple rectangle structure (e.g. usefull for saving ortho clipplanes)

Constructor & Destructor Documentation

ClipRect::ClipRect ( )
inline
ClipRect::ClipRect ( double  left_,
double  right_,
double  bottom_,
double  top_ 
)
inline
ClipRect::ClipRect ( osg::Vec2  min,
osg::Vec2  max 
)
inline

References bottom, left, right, and top.

ClipRect::ClipRect ( const osg::BoundingSphere &  bs)
inline

References fromBoundingSphere().

ClipRect::ClipRect ( const QRect &  qr)
inline

References fromQRect().

Member Function Documentation

double ClipRect::aspect ( ) const
inline

Returns aspect width()/height()

References height(), and width().

double ClipRect::center_x ( ) const
inline

Returns horizontal center.

References left, and right.

Referenced by scale_x(), and translate().

double ClipRect::center_y ( ) const
inline

Returns vertical center.

References bottom, and top.

Referenced by scale_y(), and translate().

void ClipRect::fromBoundingSphere ( const osg::BoundingSphere &  bs)
inline

References bottom, left, right, and top.

Referenced by ClipRect().

void ClipRect::fromQRect ( const QRect &  qr)
inline

References bottom, left, right, and top.

Referenced by ClipRect().

double ClipRect::height ( ) const
inline

Returns bottom-top (absolute value)

References bottom, and top.

Referenced by aspect().

void ClipRect::scale_x ( float  s)
inline

Scale horizontal by extending left and right border equally.

References center_x(), left, and right.

void ClipRect::scale_y ( float  s)
inline

Scale vertical by extending bottom and top border equally.

References bottom, center_y(), and top.

void ClipRect::sort ( )
inline

Swap values such that (left <= right) && (bottom <= top)

References bottom, left, right, and top.

Referenced by MyCameraWidget::mouseReleaseEvent(), and MyCameraWidget::paintGL().

void ClipRect::translate ( double  x,
double  y 
)
inline

Translate center by x and y.

References bottom, center_x(), center_y(), left, right, and top.

double ClipRect::width ( ) const
inline

Returns right-left (absolute value)

References left, and right.

Referenced by aspect().

Member Data Documentation

double ClipRect::bottom
double ClipRect::left
double ClipRect::right
double ClipRect::top