Isis Developer Reference
|
Represents a 3D area (a 3D "cube") More...
#include <Area3D.h>
Public Member Functions | |
Area3D () | |
The empty constructor creates an invalid 3D area. | |
Area3D (const Displacement &startX, const Displacement &startY, const Displacement &startZ, const Distance &width, const Distance &height, const Distance &depth) | |
Creates a 3D area based on the supplied dimensions. | |
Area3D (const Displacement &startX, const Displacement &startY, const Displacement &startZ, const Displacement &endX, const Displacement &endY, const Displacement &endZ) | |
Creates a 3D area based on the supplied start and end points. | |
Area3D (const Area3D &areaToCopy) | |
The copy constructor. | |
virtual | ~Area3D () |
The destructor frees allocated memory. | |
Displacement | getStartX () const |
Returns the leftmost X position of the 3D area. | |
Displacement | getStartY () const |
Returns the topmost Y position of the 3D area. | |
Displacement | getStartZ () const |
Returns the frontmost Z position of the 3D area. | |
Distance | getWidth () const |
Returns the width (in the X dimension) of the 3D area. | |
Distance | getHeight () const |
Returns the height (in the Y dimension) of the 3D area. | |
Distance | getDepth () const |
Returns the depth (in the Z dimension) of the 3D area. | |
Displacement | getEndX () const |
Returns the rightmost X position of the 3D area. | |
Displacement | getEndY () const |
Returns the bottommost Y position of the 3D area. | |
Displacement | getEndZ () const |
Returns the backmost Z position of the 3D area. | |
void | setStartX (const Displacement &startX) |
Sets the leftmost X position. | |
void | setStartY (const Displacement &startY) |
Sets the topmost Y position. | |
void | setStartZ (const Displacement &startZ) |
Sets the frontmost Z position. | |
void | moveStartX (const Displacement &startX) |
Moves the leftmost X position of the 3D area. | |
void | moveStartY (const Displacement &startY) |
Moves the topmost Y position of the 3D area. | |
void | moveStartZ (const Displacement &startZ) |
Moves the frontmost Z position of the 3D area. | |
void | setWidth (const Distance &width) |
Changes the width of the 3D area. | |
void | setHeight (const Distance &height) |
Changes the height of the 3D area. | |
void | setDepth (const Distance &depth) |
Changes the depth of the 3D area. | |
void | setEndX (const Displacement &endX) |
Sets the rightmost X position. | |
void | setEndY (const Displacement &endY) |
Sets the bottommost Y position. | |
void | setEndZ (const Displacement &endZ) |
Sets the backmost Z position. | |
void | moveEndX (const Displacement &endX) |
Moves the rightmost X position of the 3D area. | |
void | moveEndY (const Displacement &endY) |
Moves the bottommost Y position of the 3D area. | |
void | moveEndZ (const Displacement &endZ) |
Moves the backmost Z position of the 3D area. | |
void | setXDimension (const Displacement &startX, const Distance &width) |
Sets the X dimension of the 3D area. | |
void | setYDimension (const Displacement &startY, const Distance &height) |
Sets the Y dimension of the 3D area. | |
void | setZDimension (const Displacement &startZ, const Distance &depth) |
Sets the Z dimension of the 3D area. | |
Area3D | intersect (const Area3D &otherArea) const |
Returns the intersection of this 3D area with another 3D area. | |
bool | isValid () const |
Returns true if all of the positions of the 3D area are valid (i.e. | |
bool | operator== (const Area3D &otherArea) const |
Compares two areas with the == operator. | |
bool | operator!= (const Area3D &otherArea) const |
Compares two areas with the != operator. | |
Area3D & | operator= (const Area3D &areaToCopy) |
Assigns areaToCopy to this. | |
Protected Member Functions | |
virtual void | setArea (const Displacement &startX, const Displacement &startY, const Displacement &startZ, const Displacement &endX, const Displacement &endY, const Displacement &endZ) |
Sets the area. | |
Represents a 3D area (a 3D "cube")
This class is designed to encapsulate the concept of a 3D area (i.e. Cube but not a Cube file).
Isis::Area3D::Area3D | ( | ) |
The empty constructor creates an invalid 3D area.
Referenced by intersect().
Isis::Area3D::Area3D | ( | const Displacement & | startX, |
const Displacement & | startY, | ||
const Displacement & | startZ, | ||
const Distance & | width, | ||
const Distance & | height, | ||
const Distance & | depth ) |
Creates a 3D area based on the supplied dimensions.
startX | the leftmost X position |
startY | the topmost Y position |
startZ | the frontmost Z position |
width | the width of the X dimension |
height | the height of the Y dimension |
depth | the depth of the Z dimension |
References setArea().
Isis::Area3D::Area3D | ( | const Displacement & | startX, |
const Displacement & | startY, | ||
const Displacement & | startZ, | ||
const Displacement & | endX, | ||
const Displacement & | endY, | ||
const Displacement & | endZ ) |
Creates a 3D area based on the supplied start and end points.
startX | the leftmost X position |
startY | the topmost Y position |
startZ | the frontmost Z position |
endX | the rightmost X position |
endY | the bottommost Y position |
endZ | the backmost Z position |
References setArea().
Isis::Area3D::Area3D | ( | const Area3D & | areaToCopy | ) |
The copy constructor.
areaToCopy | the 3D area to copy into this |
|
virtual |
The destructor frees allocated memory.
Distance Isis::Area3D::getDepth | ( | ) | const |
Returns the depth (in the Z dimension) of the 3D area.
References getEndZ(), getStartZ(), and Isis::Distance::Meters.
Displacement Isis::Area3D::getEndX | ( | ) | const |
Returns the rightmost X position of the 3D area.
Referenced by getWidth(), intersect(), moveEndX(), moveEndY(), moveEndZ(), moveStartX(), moveStartY(), moveStartZ(), operator==(), setDepth(), setEndY(), setEndZ(), setHeight(), setStartX(), setStartY(), setStartZ(), setYDimension(), and setZDimension().
Displacement Isis::Area3D::getEndY | ( | ) | const |
Returns the bottommost Y position of the 3D area.
Referenced by getHeight(), intersect(), moveEndX(), moveEndY(), moveEndZ(), moveStartX(), moveStartY(), moveStartZ(), operator==(), setDepth(), setEndX(), setEndZ(), setStartX(), setStartY(), setStartZ(), setWidth(), setXDimension(), and setZDimension().
Displacement Isis::Area3D::getEndZ | ( | ) | const |
Returns the backmost Z position of the 3D area.
Referenced by getDepth(), intersect(), moveEndX(), moveEndY(), moveEndZ(), moveStartX(), moveStartY(), moveStartZ(), operator==(), setEndX(), setEndY(), setHeight(), setStartX(), setStartY(), setStartZ(), setWidth(), setXDimension(), and setYDimension().
Distance Isis::Area3D::getHeight | ( | ) | const |
Returns the height (in the Y dimension) of the 3D area.
References getEndY(), getStartY(), and Isis::Distance::Meters.
Displacement Isis::Area3D::getStartX | ( | ) | const |
Returns the leftmost X position of the 3D area.
Referenced by getWidth(), intersect(), moveEndX(), moveEndY(), moveEndZ(), moveStartX(), moveStartY(), moveStartZ(), operator==(), setDepth(), setEndX(), setEndY(), setEndZ(), setHeight(), setStartY(), setStartZ(), setWidth(), setYDimension(), and setZDimension().
Displacement Isis::Area3D::getStartY | ( | ) | const |
Returns the topmost Y position of the 3D area.
Referenced by getHeight(), intersect(), moveEndX(), moveEndY(), moveEndZ(), moveStartX(), moveStartY(), moveStartZ(), operator==(), setDepth(), setEndX(), setEndY(), setEndZ(), setHeight(), setStartX(), setStartZ(), setWidth(), setXDimension(), and setZDimension().
Displacement Isis::Area3D::getStartZ | ( | ) | const |
Returns the frontmost Z position of the 3D area.
Referenced by getDepth(), intersect(), moveEndX(), moveEndY(), moveEndZ(), moveStartX(), moveStartY(), moveStartZ(), operator==(), setDepth(), setEndX(), setEndY(), setEndZ(), setHeight(), setStartX(), setStartY(), setWidth(), setXDimension(), and setYDimension().
Distance Isis::Area3D::getWidth | ( | ) | const |
Returns the width (in the X dimension) of the 3D area.
References getEndX(), getStartX(), and Isis::Distance::Meters.
Returns the intersection of this 3D area with another 3D area.
If there is no intersection, an invalid 3D area will be returned.
otherArea | the area to intersect this 3D area with |
References Area3D(), getEndX(), getEndY(), getEndZ(), getStartX(), getStartY(), getStartZ(), and isValid().
bool Isis::Area3D::isValid | ( | ) | const |
Returns true if all of the positions of the 3D area are valid (i.e.
they are non-NULL).
Referenced by intersect().
void Isis::Area3D::moveEndX | ( | const Displacement & | endX | ) |
Moves the rightmost X position of the 3D area.
This method will not change the width of the 3D area.
endX | the new rightmost X position |
References getEndX(), getEndY(), getEndZ(), getStartX(), getStartY(), getStartZ(), and setArea().
void Isis::Area3D::moveEndY | ( | const Displacement & | endY | ) |
Moves the bottommost Y position of the 3D area.
This method will not change the height of the 3D area.
endY | the new bottommost Y position |
References getEndX(), getEndY(), getEndZ(), getStartX(), getStartY(), getStartZ(), and setArea().
void Isis::Area3D::moveEndZ | ( | const Displacement & | endZ | ) |
Moves the backmost Z position of the 3D area.
This method will not change the depth of the 3D area.
endZ | the new backmost Z position |
References getEndX(), getEndY(), getEndZ(), getStartX(), getStartY(), getStartZ(), and setArea().
void Isis::Area3D::moveStartX | ( | const Displacement & | startX | ) |
Moves the leftmost X position of the 3D area.
This method will not change the width of the 3D area.
startX | the new leftmost X position |
References getEndX(), getEndY(), getEndZ(), getStartX(), getStartY(), getStartZ(), and setArea().
void Isis::Area3D::moveStartY | ( | const Displacement & | startY | ) |
Moves the topmost Y position of the 3D area.
This method will not change the height of the 3D area.
startY | the new topmost Y position |
References getEndX(), getEndY(), getEndZ(), getStartX(), getStartY(), getStartZ(), and setArea().
void Isis::Area3D::moveStartZ | ( | const Displacement & | startZ | ) |
Moves the frontmost Z position of the 3D area.
This method will not change the depth of the 3D area.
startZ | the new frontmost Z position |
References getEndX(), getEndY(), getEndZ(), getStartX(), getStartY(), getStartZ(), and setArea().
bool Isis::Area3D::operator!= | ( | const Area3D & | otherArea | ) | const |
Compares two areas with the != operator.
Two uninitialized areas are equal to each other.
otherArea | This is the area we're comparing to, i.e. on the right hand side of the operator when used |
Assigns areaToCopy to this.
areaToCopy is the right hand side of the '='.
areaToCopy | This is the area we're copying from |
bool Isis::Area3D::operator== | ( | const Area3D & | otherArea | ) | const |
Compares two areas with the == operator.
Two uninitialized areas are equal to each other.
otherArea | This is the area we're comparing to, i.e. on the right hand side of the operator when used |
References getEndX(), getEndY(), getEndZ(), getStartX(), getStartY(), and getStartZ().
|
protectedvirtual |
Sets the area.
This method may be overridden in child classes if more control is needed when setting 3D area members to reflect the new area. All other setter methods call this method to change members of this class.
This method throws an exception if inverted coordinates are given, and it makes this 3D area invalid if invalid coordinates are given.
startX | the new leftmost X position |
startY | the new topmost Y position |
startZ | the new frontmost Z position |
endX | the new rightmost X position |
endY | the new bottommost Y position |
endZ | the new backmost Z position |
References _FILEINFO_, and Isis::IException::Programmer.
Referenced by Area3D(), Area3D(), moveEndX(), moveEndY(), moveEndZ(), moveStartX(), moveStartY(), moveStartZ(), setDepth(), setEndX(), setEndY(), setEndZ(), setHeight(), setStartX(), setStartY(), setStartZ(), setWidth(), setXDimension(), setYDimension(), and setZDimension().
void Isis::Area3D::setDepth | ( | const Distance & | depth | ) |
Changes the depth of the 3D area.
depth | the new depth of the 3D area |
References getEndX(), getEndY(), getStartX(), getStartY(), getStartZ(), and setArea().
void Isis::Area3D::setEndX | ( | const Displacement & | endX | ) |
Sets the rightmost X position.
This method may change the width of the 3D area.
endX | the new rightmost X position |
References getEndY(), getEndZ(), getStartX(), getStartY(), getStartZ(), and setArea().
void Isis::Area3D::setEndY | ( | const Displacement & | endY | ) |
Sets the bottommost Y position.
This method may change the height of the 3D area.
endY | the new bottommost Y position |
References getEndX(), getEndZ(), getStartX(), getStartY(), getStartZ(), and setArea().
void Isis::Area3D::setEndZ | ( | const Displacement & | endZ | ) |
Sets the backmost Z position.
This method may change the depth of the 3D area.
endZ | the new backmost Z position |
References getEndX(), getEndY(), getStartX(), getStartY(), getStartZ(), and setArea().
void Isis::Area3D::setHeight | ( | const Distance & | height | ) |
Changes the height of the 3D area.
height | the new height of the 3D area |
References getEndX(), getEndZ(), getStartX(), getStartY(), getStartZ(), and setArea().
void Isis::Area3D::setStartX | ( | const Displacement & | startX | ) |
Sets the leftmost X position.
This method may change the width of the 3D area.
startX | the new leftmost X position |
References getEndX(), getEndY(), getEndZ(), getStartY(), getStartZ(), and setArea().
void Isis::Area3D::setStartY | ( | const Displacement & | startY | ) |
Sets the topmost Y position.
This method may change the height of the 3D area.
startY | the new topmost Y position |
References getEndX(), getEndY(), getEndZ(), getStartX(), getStartZ(), and setArea().
void Isis::Area3D::setStartZ | ( | const Displacement & | startZ | ) |
Sets the frontmost Z position.
This method may change the depth of the 3D area.
startZ | the new frontmost Z position |
References getEndX(), getEndY(), getEndZ(), getStartX(), getStartY(), and setArea().
void Isis::Area3D::setWidth | ( | const Distance & | width | ) |
Changes the width of the 3D area.
width | the new width of the 3D area |
References getEndY(), getEndZ(), getStartX(), getStartY(), getStartZ(), and setArea().
void Isis::Area3D::setXDimension | ( | const Displacement & | startX, |
const Distance & | width ) |
Sets the X dimension of the 3D area.
This method may change the X positions and the width of the 3D area.
startX | the new leftmost X position |
width | the new width of the 3D area |
References getEndY(), getEndZ(), getStartY(), getStartZ(), and setArea().
void Isis::Area3D::setYDimension | ( | const Displacement & | startY, |
const Distance & | height ) |
Sets the Y dimension of the 3D area.
This method may change the Y positions and the height of the 3D area.
startY | the new topmost Y position |
height | the new height of the 3D area |
References getEndX(), getEndZ(), getStartX(), getStartZ(), and setArea().
void Isis::Area3D::setZDimension | ( | const Displacement & | startZ, |
const Distance & | depth ) |
Sets the Z dimension of the 3D area.
This method may change the Z positions and the depth of the 3D area.
startZ | the new frontmost Z position |
depth | the new depth of the 3D area |
References getEndX(), getEndY(), getStartX(), getStartY(), and setArea().