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

Private Member Functions

void deleteTheData ()
 Frees all allocated memory used by this 3D area.
 
void nullTheData ()
 Nulls all of the members used by this 3D area.
 

Private Attributes

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

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 29 of file Area3D.h.

Constructor & Destructor Documentation

◆ Area3D() [1/4]

Isis::Area3D::Area3D ( )

The empty constructor creates an invalid 3D area.

Definition at line 24 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 39 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 59 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 73 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 105 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 662 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 184 of file Area3D.cpp.

References getEndZ(), getStartZ(), and Isis::Distance::Meters.

◆ 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 196 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 211 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 226 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 172 of file Area3D.cpp.

References getEndY(), getStartY(), and Isis::Distance::Meters.

◆ 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 115 of file Area3D.cpp.

References m_startX.

Referenced by getWidth(), intersect(), moveEndX(), moveEndY(), moveEndZ(), moveStartX(), moveStartY(), moveStartZ(), operator==(), 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 130 of file Area3D.cpp.

References m_startY.

Referenced by getHeight(), intersect(), moveEndX(), moveEndY(), moveEndZ(), moveStartX(), moveStartY(), moveStartZ(), operator==(), 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 145 of file Area3D.cpp.

References m_startZ.

Referenced by getDepth(), intersect(), moveEndX(), moveEndY(), moveEndZ(), moveStartX(), moveStartY(), moveStartZ(), operator==(), 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 160 of file Area3D.cpp.

References getEndX(), getStartX(), and Isis::Distance::Meters.

◆ 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 462 of file Area3D.cpp.

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

◆ 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 489 of file Area3D.cpp.

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

Referenced by 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 383 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 395 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 407 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 278 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 290 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 302 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 698 of file Area3D.cpp.

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

Referenced by Area3D(), Area3D(), Area3D(), and 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 535 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 546 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 517 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 593 of file Area3D.cpp.

References deleteTheData(), m_endX, m_endY, m_endZ, m_startX, m_startY, m_startZ, 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().

◆ 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 335 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 347 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 359 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 371 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 324 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 242 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 254 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 266 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 313 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 420 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 434 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 448 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 105 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 107 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 109 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 99 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 101 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 103 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: