VIPER REFERENCE MANUAL


NAME
iflTile3D - defines a simple 3-D rectangle

INHERITS FROM
iflTile2D

HEADER FILE
#include <ifl/iflTile.h>

PUBLIC METHOD SUMMARY

   Constructors
template<class tileType> iflTile3D (  );
template<class tileType> iflTile3D ( tileType x, tileType y, tileType z, tileType nx, tileType ny, tileType nz);
template<class tileType> iflTile3D ( const iflTile3D& that);
template<class tileType> iflTile3D ( const iflTile2D<tileType>& that, tileType z=0, tileType nz=1);
template<class tileType> iflTile3D ( const iflTile3D& a, const iflTile3D& b);
template<class tileType> iflTile3D ( const iflTile3D& a, const iflTile3D& b, const iflTile3D& c);

   Initialization
iflTile3D& init ( tileType X, tileType Y, tileType Z, tileType Nx, tileType Ny, tileType Nz);
iflTile3D& init ( const iflTile3D& tile);
iflTile3D& init ( const iflTile2D<tileType>& tile, tileType Z=0, tileType Nz=1);

   Intersection
iflTile3D& intersect ( const iflTile3D& a, const iflTile3D& b);
iflTile3D& intersect ( const iflTile3D& a, const iflTile3D& b, const iflTile3D& c);

   Bounding box
iflTile3D& boundingBox ( const iflTile3D& a, const iflTile3D& b);
iflTile3D& boundingBox ( const iflTile3D& a, const iflTile3D& b, const iflTile3D& c);

   Checking for containment
int contains ( tileType X, tileType Y, tileType Z) const;
int contains ( const iflTile3D& tile) const;
int contains ( const iflTile3D& tile, tileType xMax, tileType yMax, tileType zMax) const;

   Comparison operators
int operator== ( const iflTile3D& tile) const;
int operator!= ( const iflTile3D& tile) const;

   Offsetting and growing
void operator+= ( const iflXY<tileType>& offset);
void operator+= ( const iflXYZ<tileType>& offset);
void operator-= ( const iflXY<tileType>& offset);
void operator-= ( const iflXYZ<tileType>& offset);
void grow ( const iflXYZ<tileType>& delta);
void grow ( const iflXY<tileType>& delta);
void shrink ( const iflXY<tileType>& delta);
void shrink ( const iflXYZ<tileType>& delta);

   Copying
iflTile3D& operator= ( const iflTile2D<tileType>& tile);
iflTile3D& operator= ( const iflTile3D& tile);

   Indexed member access
tileType& origin ( iflAxis axis);
tileType& size ( iflAxis axis);

PUBLIC MEMBER SUMMARY
tileType z;
tileType nz;

INHERITED PUBLIC METHODS

   Inherited from iflTile2D
iflTile2D& boundingBox ( const iflTile2D& a, const iflTile2D& b);
iflTile2D& boundingBox ( const iflTile2D& a, const iflTile2D& b, const iflTile2D& c);
int contains ( tileType X, tileType Y) const;
int contains ( const iflTile2D& tile) const;
int contains ( const iflTile2D& tile, tileType xMax, tileType yMax) const;
void grow ( const iflXY<tileType>& delta);
iflTile2D& init ( tileType X, tileType Y, tileType Nx, tileType Ny);
iflTile2D& init ( const iflTile2D& tile);
iflTile2D& intersect ( const iflTile2D& a, const iflTile2D& b);
iflTile2D& intersect ( const iflTile2D& a, const iflTile2D& b, const iflTile2D& c);
int operator!= ( const iflTile2D& tile) const;
void operator+= ( const iflXY<tileType>& offset);
void operator-= ( const iflXY<tileType>& offset);
int operator== ( const iflTile2D& tile) const;
tileType& origin ( iflAxis axis);
void shrink ( const iflXY<tileType>& delta);
tileType& size ( iflAxis axis);

CLASS DESCRIPTION
This class is used to describe rectangles (tiles). It is mostly used to group together the four values describing the origin (x,y,z) and size (nx,ny,nz) of a rectangle in a convenient way.

This is a template class that can be used with any scalar data type; e.g, use iflTile3D<int>() to construct a 3D integer tile and iflTile3D<float>() for a 3D-float tile.

The following is an example on how to use a 3D integer tile. iflTile object can be declared in the following way:
    // unitialized
    iflTile3D<int> tile;

    // initialized
    iflTile3D<int> tile(xStart, yStart, zStart, 
                        xSize, ySize, zSize);
    iflTile3D<int> tile(tileA, tileB);
A useful function, contains(), is provided that can be used to determine if this tile fully contains another. An overloaded version allows maximum (x,y,z) bounds to be specified that are use to clip the other tile; this version is used where a page might extend beyond the edge of an image. Also two operators == and != are provided to find out whether or not two tiles are the same.

A 2D version of this object is provided by iflTile2D.

METHOD DESCRIPTIONS

   iflTile3D()
template<class tileType> iflTile3D (  );
template<class tileType> iflTile3D ( tileType x, tileType y, tileType z, tileType nx, tileType ny, tileType nz);
template<class tileType> iflTile3D ( const iflTile3D& that);
template<class tileType> iflTile3D ( const iflTile2D<tileType>& that, tileType z=0, tileType nz=1);
template<class tileType> iflTile3D ( const iflTile3D& a, const iflTile3D& b);
template<class tileType> iflTile3D ( const iflTile3D& a, const iflTile3D& b, const iflTile3D& c);

The first version with no arguments constructs an uninitialized iflTile2D. The second version constructs an iflTile2D with the origin set to (x,y,z) and the size set to (nx,ny,nz). The third version constructs a copy of another 3D tile. The fourth version constructs a copy of another 2D tile and fills in the z attributes z and nz. The fifth version constructs an iflTile3D whose origin and size are set to the intersection of the tiles specified by a and b. The final version constructs an iflTile3D whose origin and size are set to the intersection of the tiles specified by a, b and c.

   boundingBox()
iflTile3D& boundingBox ( const iflTile3D& a, const iflTile3D& b);
iflTile3D& boundingBox ( const iflTile3D& a, const iflTile3D& b, const iflTile3D& c);

The first version sets this object's origin and size to the intersection of the tiles specified by a and b. The second version sets this object's origin and size to the intersection of the tiles specified by a, b and c. The returned value is a reference to this object.

   contains()
int contains ( tileType X, tileType Y, tileType Z) const;
int contains ( const iflTile3D& tile) const;
int contains ( const iflTile3D& tile, tileType xMax, tileType yMax, tileType zMax) const;

This function returns TRUE if this object contains the point specified by (X,Y,Z). The second version returns TRUE if this object completely contains the iflTile3D specified by tile. The third version allows tile to be first clipped by the maximum bounds specified by xMax yMax and zMax before checking for containment.

   grow()
void grow ( const iflXYZ<tileType>& delta);
void grow ( const iflXY<tileType>& delta);

These methods grow the dimensions of this tile the amount indicated by the x, y, and, for the second form, z, members of delta.

   init()
iflTile3D& init ( tileType X, tileType Y, tileType Z, tileType Nx, tileType Ny, tileType Nz);
iflTile3D& init ( const iflTile3D& tile);
iflTile3D& init ( const iflTile2D<tileType>& tile, tileType Z=0, tileType Nz=1);

The first version initializes this object with the origin set to (X,Y,Z) and the size set to (Nx,Ny,Nz). The second version initializes this object with a copy of the 3D tile specified by tile. The third version initializes this object with a copy of another 2D tile and fills in the z attributes Z and Nz.

   intersect()
iflTile3D& intersect ( const iflTile3D& a, const iflTile3D& b);
iflTile3D& intersect ( const iflTile3D& a, const iflTile3D& b, const iflTile3D& c);

The first version initializes this object with the origin and size set to the intersection of the tiles specified by a and b. The second version initializes this object with the origin and size set to the intersection of the tiles specified by a, b and c.

   operator!=()
int operator!= ( const iflTile3D& tile) const;

Returns TRUE if tile is not the same as 'this' tile, FALSE otherwise.

   operator+=()
void operator+= ( const iflXY<tileType>& offset);
void operator+= ( const iflXYZ<tileType>& offset);

These methods add an offset to the origin of this tile. The amount to be added is indicated by the x, y, and, for the second form, z, members of offset.

   operator-=()
void operator-= ( const iflXY<tileType>& offset);
void operator-= ( const iflXYZ<tileType>& offset);

Shift the origin of the tile by subtracting from it the amount specified in offset.

   operator=()
iflTile3D& operator= ( const iflTile2D<tileType>& tile);
iflTile3D& operator= ( const iflTile3D& tile);

The first assingment operator copies the values from the 2D tile specified by tile and defaults z and nz to 0 and 1, respectively. The second version simply does the normal memberwise assignment operation.

   operator==()
int operator== ( const iflTile3D& tile) const;

Returns TRUE if tile is the same as 'this' tile, FALSE otherwise.

   origin()
tileType& origin ( iflAxis axis);

Return the x, y or z origin depening on whether axis is iflX, iflY or iflZ respectively.

   shrink()
void shrink ( const iflXY<tileType>& delta);
void shrink ( const iflXYZ<tileType>& delta);

These methods shrink the dimensions of this tile the amount indicated by the x, y, and, for the second form, z, members of delta.

   size()
tileType& size ( iflAxis axis);

Return the x, y or z size depening on whether axis is iflX, iflY or iflZ respectively.

MEMBER DESCRIPTIONS

   nz
tileType nz;

The size of tile (in z).

   
z
tileType z;

The origin of tile (in z).

SEE ALSO
iflTile2D