neo::gui::Rect Class Reference

#include <gui/rect.h>

Collaboration diagram for neo::gui::Rect:

Collaboration graph
[legend]
List of all members.

Detailed Description

2D screen-space integer rectangle dimensions. Floating point relative coordinates in [0..1] range are converted using the current render device viewport sizes.

Author:
Mattias Jansson (mattias@realityrift.com)


Public Member Functions

 Rect ()
 Reset to empty rectangle.
 Rect (const Point &origin, const Point &size)
 Set values.
 Rect (int xorigin, int yorigin, int xsize, int ysize)
 Set absolute values.
 Rect (float xorigin, float yorigin, float xsize, float ysize)
 Set relative values.
void set (int xorigin, int yorigin, int xsize, int ysize)
 Set absolute values.
void set (float xorigin, float yorigin, float xsize, float ysize)
 Set relative values.
void set (const Point &origin, const Point &size)
 Set values.
void setOrigin (const Point &origin)
 Set origin.
void setSize (const Point &size)
 Set size.
const PointgetOrigin () const
 Get origin.
const PointgetSize () const
 Get sizes.
bool isEmpty () const
 Query if empty rectangle.

Static Public Attributes

static const Rect ZERO
 Zero rectangle (zero origin, zero size).


Constructor & Destructor Documentation

neo::gui::Rect::Rect (  )  [inline]

Reset to empty rectangle (zero origin, zero size)

neo::gui::Rect::Rect ( const Point origin,
const Point size 
) [inline]

Set values

Parameters:
origin Point of origin
size Size

neo::gui::Rect::Rect ( int  xorigin,
int  yorigin,
int  xsize,
int  ysize 
) [inline]

Set absolute values

Parameters:
xorigin Point of origin, x coordinate
yorigin Point of origin, y coordinate
xsize Size, x direction
ysize Size, y direction

neo::gui::Rect::Rect ( float  xorigin,
float  yorigin,
float  xsize,
float  ysize 
) [inline]

Set relative values in [0..1] range, mapped to current render device viewport size where 0 is the top/left coordinate and 1 is the bottom/right coordinate. If there is no device, the value is undefined.

Parameters:
xorigin Point of origin, x coordinate
yorigin Point of origin, y coordinate
xsize Size, x direction
ysize Size, y direction


Member Function Documentation

void neo::gui::Rect::set ( int  xorigin,
int  yorigin,
int  xsize,
int  ysize 
) [inline]

Set absolute values

Parameters:
xorigin Point of origin, x coordinate
yorigin Point of origin, y coordinate
xsize Size, x direction
ysize Size, y direction

void neo::gui::Rect::set ( float  xorigin,
float  yorigin,
float  xsize,
float  ysize 
) [inline]

Set relative values in [0..1] range, mapped to device window size where 0 is the top/left coordinate and 1 is the bottom/right coordinate. If there is no device, the value is undefined.

Parameters:
xorigin Point of origin, x coordinate
yorigin Point of origin, y coordinate
xsize Size, x direction
ysize Size, y direction

void neo::gui::Rect::set ( const Point origin,
const Point size 
) [inline]

Set values

Parameters:
origin Point of origin
size Size

void neo::gui::Rect::setOrigin ( const Point origin  )  [inline]

Parameters:
origin Point of origin

void neo::gui::Rect::setSize ( const Point size  )  [inline]

Parameters:
size Size

const Point & neo::gui::Rect::getOrigin (  )  const [inline]

Returns:
Point of origin

const Point & neo::gui::Rect::getSize (  )  const [inline]

Returns:
Size

bool neo::gui::Rect::isEmpty (  )  const [inline]

Query if empty rectangle (zero or negative sizes)

Returns:
true if empty, false if non-empty


The documentation for this class was generated from the following file:
Generated on Sat Feb 17 20:51:05 2007 for NeoEngine 2 - Evolution by  doxygen 1.5.1