Isis 3 Programmer Reference
|
Represents a 3D area (a 3D "cube") More...
#include <Area3D.h>
Public Member Functions | |
Area3D () | |
The empty constructor creates an invalid 3D area. More... | |
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. More... | |
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. More... | |
Area3D (const Area3D &areaToCopy) | |
The copy constructor. More... | |
virtual | ~Area3D () |
The destructor frees allocated memory. More... | |
Displacement | getStartX () const |
Returns the leftmost X position of the 3D area. More... | |
Displacement | getStartY () const |
Returns the topmost Y position of the 3D area. More... | |
Displacement | getStartZ () const |
Returns the frontmost Z position of the 3D area. More... | |
Distance | getWidth () const |
Returns the width (in the X dimension) of the 3D area. More... | |
Distance | getHeight () const |
Returns the height (in the Y dimension) of the 3D area. More... | |
Distance | getDepth () const |
Returns the depth (in the Z dimension) of the 3D area. More... | |
Displacement | getEndX () const |
Returns the rightmost X position of the 3D area. More... | |
Displacement | getEndY () const |
Returns the bottommost Y position of the 3D area. More... | |
Displacement | getEndZ () const |
Returns the backmost Z position of the 3D area. More... | |
void | setStartX (const Displacement &startX) |
Sets the leftmost X position. More... | |
void | setStartY (const Displacement &startY) |
Sets the topmost Y position. More... | |
void | setStartZ (const Displacement &startZ) |
Sets the frontmost Z position. More... | |
void | moveStartX (const Displacement &startX) |
Moves the leftmost X position of the 3D area. More... | |
void | moveStartY (const Displacement &startY) |
Moves the topmost Y position of the 3D area. More... | |
void | moveStartZ (const Displacement &startZ) |
Moves the frontmost Z position of the 3D area. More... | |
void | setWidth (const Distance &width) |
Changes the width of the 3D area. More... | |
void | setHeight (const Distance &height) |
Changes the height of the 3D area. More... | |
void | setDepth (const Distance &depth) |
Changes the depth of the 3D area. More... | |
void | setEndX (const Displacement &endX) |
Sets the rightmost X position. More... | |
void | setEndY (const Displacement &endY) |
Sets the bottommost Y position. More... | |
void | setEndZ (const Displacement &endZ) |
Sets the backmost Z position. More... | |
void | moveEndX (const Displacement &endX) |
Moves the rightmost X position of the 3D area. More... | |
void | moveEndY (const Displacement &endY) |
Moves the bottommost Y position of the 3D area. More... | |
void | moveEndZ (const Displacement &endZ) |
Moves the backmost Z position of the 3D area. More... | |
void | setXDimension (const Displacement &startX, const Distance &width) |
Sets the X dimension of the 3D area. More... | |
void | setYDimension (const Displacement &startY, const Distance &height) |
Sets the Y dimension of the 3D area. More... | |
void | setZDimension (const Displacement &startZ, const Distance &depth) |
Sets the Z dimension of the 3D area. More... | |
Area3D | intersect (const Area3D &otherArea) const |
Returns the intersection of this 3D area with another 3D area. More... | |
bool | isValid () const |
Returns true if all of the positions of the 3D area are valid (i.e. More... | |
bool | operator== (const Area3D &otherArea) const |
Compares two areas with the == operator. More... | |
bool | operator!= (const Area3D &otherArea) const |
Compares two areas with the != operator. More... | |
Area3D & | operator= (const Area3D &areaToCopy) |
Assigns areaToCopy to this. More... | |
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. More... | |
Private Member Functions | |
void | deleteTheData () |
Frees all allocated memory used by this 3D area. More... | |
void | nullTheData () |
Nulls all of the members used by this 3D area. More... | |
Private Attributes | |
Displacement * | m_startX |
The leftmost X position. Either NULL or a valid displacement. More... | |
Displacement * | m_startY |
The topmost Y position. Either NULL or a valid displacement. More... | |
Displacement * | m_startZ |
The frontmost Z position. Either NULL or a valid displacement. More... | |
Displacement * | m_endX |
The rightmost X position. Either NULL or a valid displacement. More... | |
Displacement * | m_endY |
The bottommost Y position. Either NULL or a valid displacement. More... | |
Displacement * | m_endZ |
The backmost Z position. Either NULL or a valid displacement. More... | |
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.
Definition at line 40 of file Area3D.cpp.
References nullTheData().
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 |
Definition at line 55 of file Area3D.cpp.
References nullTheData(), and 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 |
Definition at line 75 of file Area3D.cpp.
References nullTheData(), and setArea().
Isis::Area3D::Area3D | ( | const Area3D & | areaToCopy | ) |
The copy constructor.
areaToCopy | the 3D area to copy into this |
Definition at line 89 of file Area3D.cpp.
References m_endX, m_endY, m_endZ, m_startX, m_startY, m_startZ, and nullTheData().
|
virtual |
The destructor frees allocated memory.
Definition at line 121 of file Area3D.cpp.
References deleteTheData().
|
private |
Distance Isis::Area3D::getDepth | ( | ) | const |
Returns the depth (in the Z dimension) of the 3D area.
Definition at line 200 of file Area3D.cpp.
References getEndZ(), getStartZ(), and Isis::Distance::Meters.
Referenced by Isis::RawCubeChunk::RawCubeChunk().
Displacement Isis::Area3D::getEndX | ( | ) | const |
Returns the rightmost X position of the 3D area.
Definition at line 212 of file Area3D.cpp.
References m_endX.
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.
Definition at line 227 of file Area3D.cpp.
References m_endY.
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.
Definition at line 242 of file Area3D.cpp.
References m_endZ.
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.
Definition at line 188 of file Area3D.cpp.
References getEndY(), getStartY(), and Isis::Distance::Meters.
Referenced by Isis::RawCubeChunk::RawCubeChunk().
Displacement Isis::Area3D::getStartX | ( | ) | const |
Returns the leftmost X position of the 3D area.
Definition at line 131 of file Area3D.cpp.
References m_startX.
Referenced by getWidth(), intersect(), moveEndX(), moveEndY(), moveEndZ(), moveStartX(), moveStartY(), moveStartZ(), operator==(), Isis::RawCubeChunk::RawCubeChunk(), 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.
Definition at line 146 of file Area3D.cpp.
References m_startY.
Referenced by getHeight(), intersect(), moveEndX(), moveEndY(), moveEndZ(), moveStartX(), moveStartY(), moveStartZ(), operator==(), Isis::RawCubeChunk::RawCubeChunk(), 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.
Definition at line 161 of file Area3D.cpp.
References m_startZ.
Referenced by getDepth(), intersect(), moveEndX(), moveEndY(), moveEndZ(), moveStartX(), moveStartY(), moveStartZ(), operator==(), Isis::RawCubeChunk::RawCubeChunk(), 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.
Definition at line 176 of file Area3D.cpp.
References getEndX(), getStartX(), and Isis::Distance::Meters.
Referenced by Isis::RawCubeChunk::RawCubeChunk().
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 |
Definition at line 478 of file Area3D.cpp.
References Area3D(), getEndX(), getEndY(), getEndZ(), getStartX(), getStartY(), getStartZ(), and isValid().
Referenced by Isis::CubeIoHandler::bufferLessThan().
bool Isis::Area3D::isValid | ( | ) | const |
Returns true if all of the positions of the 3D area are valid (i.e.
they are non-NULL).
Definition at line 505 of file Area3D.cpp.
References m_endX, m_endY, m_endZ, m_startX, m_startY, and m_startZ.
Referenced by Isis::CubeIoHandler::bufferLessThan(), and 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 |
Definition at line 399 of file Area3D.cpp.
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 |
Definition at line 411 of file Area3D.cpp.
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 |
Definition at line 423 of file Area3D.cpp.
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 |
Definition at line 294 of file Area3D.cpp.
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 |
Definition at line 306 of file Area3D.cpp.
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 |
Definition at line 318 of file Area3D.cpp.
References getEndX(), getEndY(), getEndZ(), getStartX(), getStartY(), getStartZ(), and setArea().
|
private |
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 |
Definition at line 551 of file Area3D.cpp.
Assigns areaToCopy to this.
areaToCopy is the right hand side of the '='.
areaToCopy | This is the area we're copying from |
Definition at line 562 of file Area3D.cpp.
References deleteTheData(), m_endX, m_endY, m_endZ, m_startX, m_startY, and m_startZ.
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 |
Definition at line 533 of file Area3D.cpp.
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 |
Definition at line 609 of file Area3D.cpp.
References _FILEINFO_, deleteTheData(), Isis::Displacement::isValid(), m_endX, m_endY, m_endZ, m_startX, m_startY, m_startZ, Isis::Displacement::meters(), and Isis::IException::Programmer.
Referenced by 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 |
Definition at line 351 of file Area3D.cpp.
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 |
Definition at line 363 of file Area3D.cpp.
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 |
Definition at line 375 of file Area3D.cpp.
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 |
Definition at line 387 of file Area3D.cpp.
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 |
Definition at line 340 of file Area3D.cpp.
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 |
Definition at line 258 of file Area3D.cpp.
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 |
Definition at line 270 of file Area3D.cpp.
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 |
Definition at line 282 of file Area3D.cpp.
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 |
Definition at line 329 of file Area3D.cpp.
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 |
Definition at line 436 of file Area3D.cpp.
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 |
Definition at line 450 of file Area3D.cpp.
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 |
Definition at line 464 of file Area3D.cpp.
References getEndX(), getEndY(), getStartX(), getStartY(), and setArea().
|
private |
The rightmost X position. Either NULL or a valid displacement.
Definition at line 117 of file Area3D.h.
Referenced by Area3D(), deleteTheData(), getEndX(), isValid(), nullTheData(), operator=(), and setArea().
|
private |
The bottommost Y position. Either NULL or a valid displacement.
Definition at line 119 of file Area3D.h.
Referenced by Area3D(), deleteTheData(), getEndY(), isValid(), nullTheData(), operator=(), and setArea().
|
private |
The backmost Z position. Either NULL or a valid displacement.
Definition at line 121 of file Area3D.h.
Referenced by Area3D(), deleteTheData(), getEndZ(), isValid(), nullTheData(), operator=(), and setArea().
|
private |
The leftmost X position. Either NULL or a valid displacement.
Definition at line 111 of file Area3D.h.
Referenced by Area3D(), deleteTheData(), getStartX(), isValid(), nullTheData(), operator=(), and setArea().
|
private |
The topmost Y position. Either NULL or a valid displacement.
Definition at line 113 of file Area3D.h.
Referenced by Area3D(), deleteTheData(), getStartY(), isValid(), nullTheData(), operator=(), and setArea().
|
private |
The frontmost Z position. Either NULL or a valid displacement.
Definition at line 115 of file Area3D.h.
Referenced by Area3D(), deleteTheData(), getStartZ(), isValid(), nullTheData(), operator=(), and setArea().