LRECT3D Struct Reference

3D box using INT32 coordinates. More...

#include <mi32/rect.h>

Inheritance diagram for LRECT3D:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 LRECT3D (const LRECT2D &rect, INT32 zmin, INT32 zmax)
 LRECT3D (const LRECT2D &rect)
 LRECT3D (const LPOINT3D &pt1, const LPOINT3D &pt2)
 LRECT3D (const LPOINT3D &pt)
 LRECT3D ()
bool Contains (const LRECT3D &rhs) const
bool Contains (const LPOINT3D &pt) const
void Expand (const INT32 xval, const INT32 yval)
void Expand (const INT32 value)
void Extend (const LPOINT3D &pt)
void Extend (const LPOINT2D &pt)
void Extend (const LRECT3D &rect)
void Extend (const INT32 xval, const INT32 yval, const INT32 zval)
void Extend (const INT32 xval, const INT32 yval)
void GetCenter (DPOINT3D &ret) const
DPOINT3D GetCenter () const
INT32 GetDepth () const
int GetDimension () const
void GetMaximum (LPOINT3D &maximum) const
void GetMinimum (LPOINT3D &minimum) const
void GetSize (LPOINT3D &ret) const
INT32 GetVolume () const
bool IniRead (INIHANDLE IniHandle, const char *IniGroup, const char *IniName)
void IniWrite (INIHANDLE IniHandle, const char *IniGroup, const char *IniName) const
void Intersect (const LRECT3D &rect)
bool IsValid () const
LRECT3Doperator= (const LPOINT3D &pt)
bool Overlaps (const LRECT3D &rhs) const
void Set (INT32 xmin, INT32 ymin, INT32 zmin, INT32 xmax, INT32 ymax, INT32 zmax)
void Set (INT32 x1, INT32 y1, INT32 x2, INT32 y2)
void SetInvalid ()
void SwapBytes ()

Public Attributes

INT32 zinit
INT32 zlast

Detailed Description

3D box using INT32 coordinates.


Constructor & Destructor Documentation

LRECT3D::LRECT3D (  )  [inline]

Initialize to nonexistent area.

LRECT3D::LRECT3D ( const LPOINT3D pt  )  [inline]

Construct from LPOINT3D.

LRECT3D::LRECT3D ( const LPOINT3D pt1,
const LPOINT3D pt2 
) [inline]

Construct from two LPOINT3D's A regular ctor from LPOINT3D and then a call to Extend(LPOINT3D&) would use 9 assignments and 6 comparisons, this uses 3 compares and 6 assignments.

LRECT3D::LRECT3D ( const LRECT2D rect  )  [inline]

Construct from LRECT2D.

LRECT3D::LRECT3D ( const LRECT2D rect,
INT32  zmin,
INT32  zmax 
) [inline]

Construct from LRECT2D and Z min/max.


Member Function Documentation

bool LRECT3D::Contains ( const LRECT3D rhs  )  const [inline]

Check if rectangle is inside.

Reimplemented from LRECT2D.

bool LRECT3D::Contains ( const LPOINT3D pt  )  const [inline]

Check if point is inside.

void LRECT3D::Expand ( const INT32  xval,
const INT32  yval 
) [inline]

Expand rectangle by specified amounts.

Reimplemented from LRECT2D.

void LRECT3D::Expand ( const INT32  value  )  [inline]

Expand rectangle by specified amount.

Reimplemented from LRECT2D.

void LRECT3D::Extend ( const LPOINT3D pt  )  [inline]

Extend to contain specified point.

void LRECT3D::Extend ( const LPOINT2D pt  )  [inline]

Extend to contain specified point.

Reimplemented from LRECT2D.

void LRECT3D::Extend ( const LRECT3D rect  )  [inline]

Union rectangles together, resulting rect is extents of both.

Reimplemented from LRECT2D.

void LRECT3D::Extend ( const INT32  xval,
const INT32  yval,
const INT32  zval 
) [inline]

Extend rectangle to encompass both rectangles.

void LRECT3D::Extend ( const INT32  xval,
const INT32  yval 
) [inline]

Extend rectangle to encompass both rectangles.

Reimplemented from LRECT2D.

void LRECT3D::GetCenter ( DPOINT3D ret  )  const [inline]

Return center of the box.

DPOINT3D LRECT3D::GetCenter (  )  const [inline]

Return center of the box.

Reimplemented from LRECT2D.

INT32 LRECT3D::GetDepth (  )  const [inline]

Return depth of the box (z distance).

int LRECT3D::GetDimension (  )  const [inline]

Compute number of non zero dimensions (0, 1, 2, or 3).

Reimplemented from LRECT2D.

void LRECT3D::GetMaximum ( LPOINT3D maximum  )  const [inline]

Get maximum coordinate.

void LRECT3D::GetMinimum ( LPOINT3D minimum  )  const [inline]

Get minimum coordinate.

void LRECT3D::GetSize ( LPOINT3D ret  )  const [inline]

Get size of box.

INT32 LRECT3D::GetVolume (  )  const [inline]

Compute volume of box.

bool LRECT3D::IniRead ( INIHANDLE  IniHandle,
const char *  IniGroup,
const char *  IniName 
) [inline]

Read rectangle from INI file.

Reimplemented from LRECT2D.

void LRECT3D::IniWrite ( INIHANDLE  IniHandle,
const char *  IniGroup,
const char *  IniName 
) const [inline]

Read rectangle from INI file.

Reimplemented from LRECT2D.

void LRECT3D::Intersect ( const LRECT3D rect  )  [inline]

Intersect two LRECT3D's, may result in an invalid rectangle.

Reimplemented from LRECT2D.

bool LRECT3D::IsValid (  )  const [inline]

Check if rectangle is valid.

Reimplemented from LRECT2D.

LRECT3D& LRECT3D::operator= ( const LPOINT3D pt  )  [inline]

Assignment from LPOINT3D.

bool LRECT3D::Overlaps ( const LRECT3D rhs  )  const [inline]

Check if rectangle overlaps.

Reimplemented from LRECT2D.

void LRECT3D::Set ( INT32  xmin,
INT32  ymin,
INT32  zmin,
INT32  xmax,
INT32  ymax,
INT32  zmax 
) [inline]

Set given (xmin,ymin,zmin), (xmax,ymax,zmax).

void LRECT3D::Set ( INT32  x1,
INT32  y1,
INT32  x2,
INT32  y2 
) [inline]

Set given (x1,y1), (x2,y2).

Reimplemented from LRECT2D.

void LRECT3D::SetInvalid (  )  [inline]

Sets the initial values to the maximum possible and the final values to the minimum possible, thus making the rectangle "invalid".

Setting a rectangle to invalid means that no point will be in it. It also makes it easy to compute the min/max of a bunch of points. You just iterate through all the points and Extend() the rectangle. Normally, you'd have to handle the first point specially.

Reimplemented from LRECT2D.

void LRECT3D::SwapBytes (  )  [inline]

Perform byte-order swapping.

Reimplemented from LRECT2D.


Member Data Documentation


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

Generated on Sun Oct 7 21:33:33 2012 for TNTsdk 2012 by  doxygen 1.6.1