Isis 3 Programmer Reference
Isis::Area3D Class Reference

Represents a 3D area (a 3D "cube") More...

#include <Area3D.h>

Collaboration diagram for Isis::Area3D:
Collaboration graph

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...
 
Area3Doperator= (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

Displacementm_startX
 The leftmost X position. Either NULL or a valid displacement. More...
 
Displacementm_startY
 The topmost Y position. Either NULL or a valid displacement. More...
 
Displacementm_startZ
 The frontmost Z position. Either NULL or a valid displacement. More...
 
Displacementm_endX
 The rightmost X position. Either NULL or a valid displacement. More...
 
Displacementm_endY
 The bottommost Y position. Either NULL or a valid displacement. More...
 
Displacementm_endZ
 The backmost Z position. Either NULL or a valid displacement. More...
 

Detailed Description

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).

Author
2011-06-09 Jai Rideout and Steven Lambright
History:
2012-02-24 Steven Lambright - Changed intersection test to be faster on intersection failures.

Definition at line 41 of file Area3D.h.

Constructor & Destructor Documentation

◆ Area3D() [1/4]

Isis::Area3D::Area3D ( )

The empty constructor creates an invalid 3D area.

Definition at line 40 of file Area3D.cpp.

References nullTheData().

Referenced by intersect().

◆ Area3D() [2/4]

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.

Parameters
startXthe leftmost X position
startYthe topmost Y position
startZthe frontmost Z position
widththe width of the X dimension
heightthe height of the Y dimension
depththe depth of the Z dimension

Definition at line 55 of file Area3D.cpp.

References nullTheData(), and setArea().

◆ Area3D() [3/4]

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.

Parameters
startXthe leftmost X position
startYthe topmost Y position
startZthe frontmost Z position
endXthe rightmost X position
endYthe bottommost Y position
endZthe backmost Z position

Definition at line 75 of file Area3D.cpp.

References nullTheData(), and setArea().

◆ Area3D() [4/4]

Isis::Area3D::Area3D ( const Area3D areaToCopy)

The copy constructor.

Parameters
areaToCopythe 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().

◆ ~Area3D()

Isis::Area3D::~Area3D ( )
virtual

The destructor frees allocated memory.

Definition at line 121 of file Area3D.cpp.

References deleteTheData().

Member Function Documentation

◆ deleteTheData()

void Isis::Area3D::deleteTheData ( )
private

Frees all allocated memory used by this 3D area.

Definition at line 678 of file Area3D.cpp.

References m_endX, m_endY, m_endZ, m_startX, m_startY, and m_startZ.

Referenced by operator=(), setArea(), and ~Area3D().

◆ getDepth()

Distance Isis::Area3D::getDepth ( ) const

Returns the depth (in the Z dimension) of the 3D area.

Returns
Displacement 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().

◆ getEndX()

Displacement Isis::Area3D::getEndX ( ) const

Returns the rightmost X position of the 3D area.

Returns
Displacement 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().

◆ getEndY()

Displacement Isis::Area3D::getEndY ( ) const

Returns the bottommost Y position of the 3D area.

Returns
Displacement 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().

◆ getEndZ()

Displacement Isis::Area3D::getEndZ ( ) const

Returns the backmost Z position of the 3D area.

Returns
Displacement 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().

◆ getHeight()

Distance Isis::Area3D::getHeight ( ) const

Returns the height (in the Y dimension) of the 3D area.

Returns
Displacement 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().

◆ getStartX()

Displacement Isis::Area3D::getStartX ( ) const

Returns the leftmost X position of the 3D area.

Returns
Displacement 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().

◆ getStartY()

Displacement Isis::Area3D::getStartY ( ) const

Returns the topmost Y position of the 3D area.

Returns
Displacement 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().

◆ getStartZ()

Displacement Isis::Area3D::getStartZ ( ) const

Returns the frontmost Z position of the 3D area.

Returns
Displacement 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().

◆ getWidth()

Distance Isis::Area3D::getWidth ( ) const

Returns the width (in the X dimension) of the 3D area.

Returns
Displacement 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().

◆ intersect()

Area3D Isis::Area3D::intersect ( const Area3D otherArea) const

Returns the intersection of this 3D area with another 3D area.

If there is no intersection, an invalid 3D area will be returned.

Parameters
otherAreathe area to intersect this 3D area with
Returns
the 3D area that is the intersection

Definition at line 478 of file Area3D.cpp.

References Area3D(), getEndX(), getEndY(), getEndZ(), getStartX(), getStartY(), getStartZ(), and isValid().

Referenced by Isis::CubeIoHandler::bufferLessThan().

◆ 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).

Returns
bool 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().

◆ moveEndX()

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.

Parameters
endXthe new rightmost X position

Definition at line 399 of file Area3D.cpp.

References getEndX(), getEndY(), getEndZ(), getStartX(), getStartY(), getStartZ(), and setArea().

◆ moveEndY()

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.

Parameters
endYthe new bottommost Y position

Definition at line 411 of file Area3D.cpp.

References getEndX(), getEndY(), getEndZ(), getStartX(), getStartY(), getStartZ(), and setArea().

◆ moveEndZ()

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.

Parameters
endZthe new backmost Z position

Definition at line 423 of file Area3D.cpp.

References getEndX(), getEndY(), getEndZ(), getStartX(), getStartY(), getStartZ(), and setArea().

◆ moveStartX()

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.

Parameters
startXthe new leftmost X position

Definition at line 294 of file Area3D.cpp.

References getEndX(), getEndY(), getEndZ(), getStartX(), getStartY(), getStartZ(), and setArea().

◆ moveStartY()

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.

Parameters
startYthe new topmost Y position

Definition at line 306 of file Area3D.cpp.

References getEndX(), getEndY(), getEndZ(), getStartX(), getStartY(), getStartZ(), and setArea().

◆ moveStartZ()

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.

Parameters
startZthe new frontmost Z position

Definition at line 318 of file Area3D.cpp.

References getEndX(), getEndY(), getEndZ(), getStartX(), getStartY(), getStartZ(), and setArea().

◆ nullTheData()

void Isis::Area3D::nullTheData ( )
private

Nulls all of the members used by this 3D area.

Definition at line 714 of file Area3D.cpp.

References m_endX, m_endY, m_endZ, m_startX, m_startY, and m_startZ.

Referenced by Area3D().

◆ operator!=()

bool Isis::Area3D::operator!= ( const Area3D otherArea) const

Compares two areas with the != operator.

Two uninitialized areas are equal to each other.

Parameters
otherAreaThis is the area we're comparing to, i.e. on the right hand side of the operator when used
Returns
True if this area is not the same as the given area

Definition at line 551 of file Area3D.cpp.

◆ operator=()

Area3D & Isis::Area3D::operator= ( const Area3D areaToCopy)

Assigns areaToCopy to this.

areaToCopy is the right hand side of the '='.

Parameters
areaToCopyThis is the area we're copying from
Returns
*this

Definition at line 562 of file Area3D.cpp.

References deleteTheData(), m_endX, m_endY, m_endZ, m_startX, m_startY, and m_startZ.

◆ operator==()

bool Isis::Area3D::operator== ( const Area3D otherArea) const

Compares two areas with the == operator.

Two uninitialized areas are equal to each other.

Parameters
otherAreaThis is the area we're comparing to, i.e. on the right hand side of the operator when used
Returns
True if this area is the same as the given area

Definition at line 533 of file Area3D.cpp.

References getEndX(), getEndY(), getEndZ(), getStartX(), getStartY(), and getStartZ().

◆ setArea()

void Isis::Area3D::setArea ( const Displacement startX,
const Displacement startY,
const Displacement startZ,
const Displacement endX,
const Displacement endY,
const Displacement endZ 
)
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.

Parameters
startXthe new leftmost X position
startYthe new topmost Y position
startZthe new frontmost Z position
endXthe new rightmost X position
endYthe new bottommost Y position
endZthe 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().

◆ setDepth()

void Isis::Area3D::setDepth ( const Distance depth)

Changes the depth of the 3D area.

Parameters
depththe new depth of the 3D area

Definition at line 351 of file Area3D.cpp.

References getEndX(), getEndY(), getStartX(), getStartY(), getStartZ(), and setArea().

◆ setEndX()

void Isis::Area3D::setEndX ( const Displacement endX)

Sets the rightmost X position.

This method may change the width of the 3D area.

Parameters
endXthe new rightmost X position

Definition at line 363 of file Area3D.cpp.

References getEndY(), getEndZ(), getStartX(), getStartY(), getStartZ(), and setArea().

◆ setEndY()

void Isis::Area3D::setEndY ( const Displacement endY)

Sets the bottommost Y position.

This method may change the height of the 3D area.

Parameters
endYthe new bottommost Y position

Definition at line 375 of file Area3D.cpp.

References getEndX(), getEndZ(), getStartX(), getStartY(), getStartZ(), and setArea().

◆ setEndZ()

void Isis::Area3D::setEndZ ( const Displacement endZ)

Sets the backmost Z position.

This method may change the depth of the 3D area.

Parameters
endZthe new backmost Z position

Definition at line 387 of file Area3D.cpp.

References getEndX(), getEndY(), getStartX(), getStartY(), getStartZ(), and setArea().

◆ setHeight()

void Isis::Area3D::setHeight ( const Distance height)

Changes the height of the 3D area.

Parameters
heightthe new height of the 3D area

Definition at line 340 of file Area3D.cpp.

References getEndX(), getEndZ(), getStartX(), getStartY(), getStartZ(), and setArea().

◆ setStartX()

void Isis::Area3D::setStartX ( const Displacement startX)

Sets the leftmost X position.

This method may change the width of the 3D area.

Parameters
startXthe new leftmost X position

Definition at line 258 of file Area3D.cpp.

References getEndX(), getEndY(), getEndZ(), getStartY(), getStartZ(), and setArea().

◆ setStartY()

void Isis::Area3D::setStartY ( const Displacement startY)

Sets the topmost Y position.

This method may change the height of the 3D area.

Parameters
startYthe new topmost Y position

Definition at line 270 of file Area3D.cpp.

References getEndX(), getEndY(), getEndZ(), getStartX(), getStartZ(), and setArea().

◆ setStartZ()

void Isis::Area3D::setStartZ ( const Displacement startZ)

Sets the frontmost Z position.

This method may change the depth of the 3D area.

Parameters
startZthe new frontmost Z position

Definition at line 282 of file Area3D.cpp.

References getEndX(), getEndY(), getEndZ(), getStartX(), getStartY(), and setArea().

◆ setWidth()

void Isis::Area3D::setWidth ( const Distance width)

Changes the width of the 3D area.

Parameters
widththe new width of the 3D area

Definition at line 329 of file Area3D.cpp.

References getEndY(), getEndZ(), getStartX(), getStartY(), getStartZ(), and setArea().

◆ setXDimension()

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.

Parameters
startXthe new leftmost X position
widththe new width of the 3D area

Definition at line 436 of file Area3D.cpp.

References getEndY(), getEndZ(), getStartY(), getStartZ(), and setArea().

◆ setYDimension()

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.

Parameters
startYthe new topmost Y position
heightthe new height of the 3D area

Definition at line 450 of file Area3D.cpp.

References getEndX(), getEndZ(), getStartX(), getStartZ(), and setArea().

◆ setZDimension()

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.

Parameters
startZthe new frontmost Z position
depththe new depth of the 3D area

Definition at line 464 of file Area3D.cpp.

References getEndX(), getEndY(), getStartX(), getStartY(), and setArea().

Member Data Documentation

◆ m_endX

Displacement* Isis::Area3D::m_endX
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().

◆ m_endY

Displacement* Isis::Area3D::m_endY
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().

◆ m_endZ

Displacement* Isis::Area3D::m_endZ
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().

◆ m_startX

Displacement* Isis::Area3D::m_startX
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().

◆ m_startY

Displacement* Isis::Area3D::m_startY
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().

◆ m_startZ

Displacement* Isis::Area3D::m_startZ
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().


The documentation for this class was generated from the following files: