iflTile3D(3)
iflTile3D - defines a simple 3-D rectangle
As shipped in IRIX 6.5.5. Unchanged since IRIX 6.5.
NAME iflTile3D - defines a simple 3-D rectangle INHERITS FROM This is a base class and therefore has no inheritance. HEADER FILE #include <ifl/iflTile.h> DESCRIPTION This class is used to describe rectangles (tiles). It is mostly used to group together the six 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, to construct a 3D integer tile use iflTile3D<int>, 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. CLASS MEMBER FUNCTION SUMMARY Constructors iflTile3D<type>() iflTile3D<type>(type X, type Y, type Z, type nX, type nY, type nZ) iflTile3D<type>(const iflTile3D& that) iflTile3D<type>(const iflTile2D<type>& that, type z=0, type nz=1) iflTile3D<type>(const iflTile3D<type>& a, const iflTile3D<type>& b) iflTile3D<type>(const iflTile3D<type>& a, const iflTile3D<type>& b, const iflTile3D<type>& c) Initialization iflTile3D<type>& init(type X, type Y, type Z, type Nx, type Ny, type Nz) iflTile3D<type>& init(const iflTile3D<type>& tile) iflTile3D<type>& init(const iflTile2D<type>& tile, type Z=0, type Nz=1) Intersection iflTile3D<type>& intersect(const iflTile3D<type>& a, const iflTile3D<type>& b) iflTile3D<type>& intersect(const iflTile3D<type>& a, const iflTile3D<type>& b, const iflTile3D<type>& c) Bounding box iflTile3D<type>& boundingBox(const iflTile3D<type>& a, const iflTile3D<type>& b) iflTile3D<type>& boundingBox(const iflTile3D<type>& a, const iflTile3D<type>& b, const iflTile3D<type>& c) Checking for containment int contains(type X, type Y, type Z) const int contains(const iflTile3D<type>& tile) const int contains(const iflTile3D<type>& tile, type xMax, type yMax, type zMax) const Equality operators int operator==(const iflTile3D<type>& tile) const int operator!=(const iflTile3D<type>& tile) const Grow/shrink and offset operations 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 iflXY<tileType>& delta) void grow(const iflXYZ<tileType>& delta) void shrink(const iflXY<tileType>& delta) void shrink(const iflXYZ<tileType>& delta) Assignment operators iflTile3D<type>& operator=(const iflTile2D<type>& tile) iflTile3D<type>& operator=(const iflTile3D<type>& tile) FUNCTION DESCRIPTIONS iflTile3D() iflTile3D<type>() iflTile3D<type>(type X, type Y, type Z, type nX, type nY, type nZ) iflTile3D<type>(const iflTile3D& that) iflTile3D<type>(const iflTile2D<type>& that, type Z=0, type nZ=1) iflTile3D<type>(const iflTile3D<type>& a, const iflTile3D<type>& b) iflTile3D<type>(const iflTile3D<type>& a, const iflTile3D<type>& b, const iflTile3D<type>& c) The first version with no arguments constructs an uninitialized iflTile3D. The second version constructs an iflTile3D 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 3D 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<type>& boundingBox(const iflTile3D<type>& a, const iflTile3D<type>& b) iflTile3D<type>& boundingBox(const iflTile3D<type>& a, const iflTile3D<type>& b, const iflTile3D<type>& 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(type X, type Y, type Z) const int contains(const iflTile3D<type>& tile) const int contains(const iflTile3D<type>& tile, type xMax, type yMax, type 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. init() iflTile3D<type>& init(type X, type Y, type Z, type nX, type nY, type nZ) iflTile3D<type>& init(const iflTile3D<type>& tile) iflTile3D<type>& init(const iflTile2D<type>& tile, type Z=0, type 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 3D tile and fills in the z attributes Z and nZ. grow() void grow(const iflXY<tileType>& delta) void grow(const iflXYZ<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. intersect() iflTile3D<type>& intersect(const iflTile3D<type>& a, const iflTile3D<type>& b) iflTile3D<type>& intersect(const iflTile3D<type>& a, const iflTile3D<type>& b, const iflTile3D<type>& 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=() iflTile3D<type>& operator=(const iflTile2D<type>& tile) iflTile3D<type>& operator=(const iflTile3D<type>& 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<type>& tile) const Returns TRUE if tile is the same as 'this' tile, FALSE otherwise. operator!=() int operator!=(const iflTile3D<type>& 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) These methods subtract an offset from the origin of this tile. The amount to be subtracted is indicated by the x, y, and, for the second form, z, members of offset. 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. SEE ALSO iflTile2D