# Home    # nevrax.com   
Nevrax
Nevrax.org
#News
#Mailing-list
#Documentation
#CVS
#Bugs
#License
Docs
 
Documentation  
Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages   Search  

NLMISC::CRect Class Reference

This class describe an integer 2d rectangle. More...

#include <rect.h>

List of all members.

Public Methods

 CRect ()
 default ctor. More...

 CRect (sint32 x, sint32 y, uint32 width, uint32 height)
 Constructor with a 2d point, a width and a height. More...

 CRect (sint32 x, sint32 y)
 Constructor with a single 2d point. Build a rectangle with width and height = 0. More...

void setWH (sint32 x, sint32 y, uint32 width, uint32 height)
 Set from a 2d point, a width and a height. More...

void set (sint32 x0, sint32 y0, sint32 x1, sint32 y1)
 Set from 2 2d points. More...

void extend (sint32 x, sint32 y)
 Extend the box for including the point which coordinates are passed in parameter. More...

sint32 left () const
 Return the lower X coordinate of the box. More...

sint32 right () const
 Return the higher X coordinate of the box + 1. More...

sint32 top () const
 Return the lower Y coordinate of the box. More...

sint32 bottom () const
 Return the higher Y coordinate of the box + 1. More...

sint32 getXCenter () const
 Compute the x center of the rectangle. More...

sint32 getYCenter () const
 Compute the y center of the rectangle. More...


Public Attributes

sint32 X
 Lower X coordinate of the rect. More...

sint32 Y
 Lower Y coordinate of the rect. More...

uint32 Width
 Width of the rect. More...

uint32 Height
 Height of the rect. More...


Detailed Description

This class describe an integer 2d rectangle.

Author:
Cyril Corvazier , Nevrax France
Date:
2000

Definition at line 43 of file rect.h.


Constructor & Destructor Documentation

NLMISC::CRect::CRect   [inline]
 

default ctor.

Definition at line 47 of file rect.h.

NLMISC::CRect::CRect sint32    x,
sint32    y,
uint32    width,
uint32    height
 

Constructor with a 2d point, a width and a height.

Definition at line 91 of file rect.cpp.

References height, setWH, width, x, and y.

NLMISC::CRect::CRect sint32    x,
sint32    y
[inline]
 

Constructor with a single 2d point. Build a rectangle with width and height = 0.

Definition at line 53 of file rect.h.

References Height, Width, X, x, Y, and y.


Member Function Documentation

sint32 NLMISC::CRect::bottom   const [inline]
 

Return the higher Y coordinate of the box + 1.

Definition at line 89 of file rect.h.

References Height, and Y.

Referenced by NL3D::CDriverGL::clipRect.

void NLMISC::CRect::extend sint32    x,
sint32    y
 

Extend the box for including the point which coordinates are passed in parameter.

Definition at line 35 of file rect.cpp.

References Height, Width, X, x, Y, and y.

sint32 NLMISC::CRect::getXCenter   const [inline]
 

Compute the x center of the rectangle.

Definition at line 95 of file rect.h.

References Width, and X.

sint32 NLMISC::CRect::getYCenter   const [inline]
 

Compute the y center of the rectangle.

Definition at line 101 of file rect.h.

References Height, and Y.

sint32 NLMISC::CRect::left   const [inline]
 

Return the lower X coordinate of the box.

Definition at line 71 of file rect.h.

References X.

sint32 NLMISC::CRect::right   const [inline]
 

Return the higher X coordinate of the box + 1.

Definition at line 77 of file rect.h.

References Width, and X.

Referenced by NL3D::CDriverGL::clipRect.

void NLMISC::CRect::set sint32    x0,
sint32    y0,
sint32    x1,
sint32    y1
 

Set from 2 2d points.

Definition at line 65 of file rect.cpp.

References Height, Width, X, and Y.

void NLMISC::CRect::setWH sint32    x,
sint32    y,
uint32    width,
uint32    height
 

Set from a 2d point, a width and a height.

Definition at line 55 of file rect.cpp.

References Height, height, Width, width, X, x, Y, and y.

Referenced by CRect.

sint32 NLMISC::CRect::top   const [inline]
 

Return the lower Y coordinate of the box.

Definition at line 83 of file rect.h.

References Y.


Member Data Documentation

uint32 NLMISC::CRect::Height
 

Height of the rect.

Definition at line 116 of file rect.h.

Referenced by bottom, NL3D::CDriverGL::clipRect, CRect, extend, NL3D::CDriverGL::getBufferPart, getYCenter, NL3D::CDriverGL::getZBufferPart, set, and setWH.

uint32 NLMISC::CRect::Width
 

Width of the rect.

Definition at line 113 of file rect.h.

Referenced by NL3D::CDriverGL::clipRect, CRect, extend, NL3D::CDriverGL::getBufferPart, getXCenter, NL3D::CDriverGL::getZBufferPart, right, set, and setWH.

sint32 NLMISC::CRect::X
 

Lower X coordinate of the rect.

Definition at line 107 of file rect.h.

Referenced by NL3D::CDriverGL::clipRect, CRect, extend, NL3D::CDriverGL::getBufferPart, getXCenter, NL3D::CDriverGL::getZBufferPart, left, right, set, and setWH.

sint32 NLMISC::CRect::Y
 

Lower Y coordinate of the rect.

Definition at line 110 of file rect.h.

Referenced by bottom, NL3D::CDriverGL::clipRect, CRect, extend, NL3D::CDriverGL::getBufferPart, getYCenter, NL3D::CDriverGL::getZBufferPart, set, setWH, and top.


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