Isis Developer Reference
Area3D.h
Go to the documentation of this file.
1 #ifndef Area3D_h
2 #define Area3D_h
3 
9 /* SPDX-License-Identifier: CC0-1.0 */
10 
11 namespace Isis {
12  class Displacement;
13  class Distance;
14 
29  class Area3D {
30  public:
31  Area3D();
32  Area3D(const Displacement &startX, const Displacement &startY,
33  const Displacement &startZ,
34  const Distance &width, const Distance &height,
35  const Distance &depth);
36  Area3D(const Displacement &startX, const Displacement &startY,
37  const Displacement &startZ,
38  const Displacement &endX, const Displacement &endY,
39  const Displacement &endZ);
40  Area3D(const Area3D &areaToCopy);
41  virtual ~Area3D();
42 
43  Displacement getStartX() const;
44  Displacement getStartY() const;
45  Displacement getStartZ() const;
46 
47  Distance getWidth() const;
48  Distance getHeight() const;
49  Distance getDepth() const;
50 
51  Displacement getEndX() const;
52  Displacement getEndY() const;
53  Displacement getEndZ() const;
54 
55  void setStartX(const Displacement &startX);
56  void setStartY(const Displacement &startY);
57  void setStartZ(const Displacement &startZ);
58 
59  void moveStartX(const Displacement &startX);
60  void moveStartY(const Displacement &startY);
61  void moveStartZ(const Displacement &startZ);
62 
63  void setWidth(const Distance &width);
64  void setHeight(const Distance &height);
65  void setDepth(const Distance &depth);
66 
67  void setEndX(const Displacement &endX);
68  void setEndY(const Displacement &endY);
69  void setEndZ(const Displacement &endZ);
70 
71  void moveEndX(const Displacement &endX);
72  void moveEndY(const Displacement &endY);
73  void moveEndZ(const Displacement &endZ);
74 
75  void setXDimension(const Displacement &startX, const Distance &width);
76  void setYDimension(const Displacement &startY, const Distance &height);
77  void setZDimension(const Displacement &startZ, const Distance &depth);
78 
79  Area3D intersect(const Area3D &otherArea) const;
80 
81  bool isValid() const;
82 
83  bool operator ==(const Area3D &otherArea) const;
84  bool operator !=(const Area3D &otherArea) const;
85 
86  Area3D &operator =(const Area3D &areaToCopy);
87 
88  protected:
89  virtual void setArea(const Displacement &startX,
90  const Displacement &startY, const Displacement &startZ,
91  const Displacement &endX, const Displacement &endY,
92  const Displacement &endZ);
93 
94  private:
95  void deleteTheData();
96  void nullTheData();
97 
99  Displacement *m_startX;
101  Displacement *m_startY;
103  Displacement *m_startZ;
105  Displacement *m_endX;
107  Displacement *m_endY;
109  Displacement *m_endZ;
110  };
111 }
112 
113 #endif
114 
Isis::Area3D::setWidth
void setWidth(const Distance &width)
Changes the width of the 3D area.
Definition: Area3D.cpp:313
Displacement.h
Isis::Area3D::setDepth
void setDepth(const Distance &depth)
Changes the depth of the 3D area.
Definition: Area3D.cpp:335
Isis::Area3D::isValid
bool isValid() const
Returns true if all of the positions of the 3D area are valid (i.e.
Definition: Area3D.cpp:489
Isis::Area3D::operator!=
bool operator!=(const Area3D &otherArea) const
Compares two areas with the != operator.
Definition: Area3D.cpp:535
Isis::Area3D::getDepth
Distance getDepth() const
Returns the depth (in the Z dimension) of the 3D area.
Definition: Area3D.cpp:184
Isis::Area3D::moveStartY
void moveStartY(const Displacement &startY)
Moves the topmost Y position of the 3D area.
Definition: Area3D.cpp:290
Isis::Area3D::setStartZ
void setStartZ(const Displacement &startZ)
Sets the frontmost Z position.
Definition: Area3D.cpp:266
Isis::Area3D::moveStartX
void moveStartX(const Displacement &startX)
Moves the leftmost X position of the 3D area.
Definition: Area3D.cpp:278
Isis::Area3D::setYDimension
void setYDimension(const Displacement &startY, const Distance &height)
Sets the Y dimension of the 3D area.
Definition: Area3D.cpp:434
Isis::Area3D::setStartY
void setStartY(const Displacement &startY)
Sets the topmost Y position.
Definition: Area3D.cpp:254
Isis::Area3D::~Area3D
virtual ~Area3D()
The destructor frees allocated memory.
Definition: Area3D.cpp:105
IString.h
Isis::Area3D::setZDimension
void setZDimension(const Displacement &startZ, const Distance &depth)
Sets the Z dimension of the 3D area.
Definition: Area3D.cpp:448
Isis::Distance
Distance measurement, usually in meters.
Definition: Distance.h:34
Isis::Area3D::setHeight
void setHeight(const Distance &height)
Changes the height of the 3D area.
Definition: Area3D.cpp:324
Isis::Area3D::getStartX
Displacement getStartX() const
Returns the leftmost X position of the 3D area.
Definition: Area3D.cpp:115
Isis::Displacement
Displacement is a signed length, usually in meters.
Definition: Displacement.h:31
Isis::Distance::Meters
@ Meters
The distance is being specified in meters.
Definition: Distance.h:43
Isis::Displacement::meters
double meters() const
Get the displacement in meters.
Definition: Displacement.cpp:73
Isis::Area3D::getStartZ
Displacement getStartZ() const
Returns the frontmost Z position of the 3D area.
Definition: Area3D.cpp:145
Isis::Area3D::getWidth
Distance getWidth() const
Returns the width (in the X dimension) of the 3D area.
Definition: Area3D.cpp:160
Isis::Area3D::getEndY
Displacement getEndY() const
Returns the bottommost Y position of the 3D area.
Definition: Area3D.cpp:211
_FILEINFO_
#define _FILEINFO_
Macro for the filename and line number.
Definition: IException.h:24
Isis::Area3D::getEndZ
Displacement getEndZ() const
Returns the backmost Z position of the 3D area.
Definition: Area3D.cpp:226
Isis::Area3D::setArea
virtual void setArea(const Displacement &startX, const Displacement &startY, const Displacement &startZ, const Displacement &endX, const Displacement &endY, const Displacement &endZ)
Sets the area.
Definition: Area3D.cpp:593
Isis::Area3D::moveEndY
void moveEndY(const Displacement &endY)
Moves the bottommost Y position of the 3D area.
Definition: Area3D.cpp:395
Isis::Area3D::moveEndZ
void moveEndZ(const Displacement &endZ)
Moves the backmost Z position of the 3D area.
Definition: Area3D.cpp:407
Isis::Area3D::moveStartZ
void moveStartZ(const Displacement &startZ)
Moves the frontmost Z position of the 3D area.
Definition: Area3D.cpp:302
Area3D.h
Isis::IException
Isis exception class.
Definition: IException.h:91
Isis::Area3D::getHeight
Distance getHeight() const
Returns the height (in the Y dimension) of the 3D area.
Definition: Area3D.cpp:172
Isis::Area3D::setEndY
void setEndY(const Displacement &endY)
Sets the bottommost Y position.
Definition: Area3D.cpp:359
IException.h
Isis::IException::Programmer
@ Programmer
This error is for when a programmer made an API call that was illegal.
Definition: IException.h:146
Isis::Area3D
Represents a 3D area (a 3D "cube")
Definition: Area3D.h:29
Isis::Area3D::setEndZ
void setEndZ(const Displacement &endZ)
Sets the backmost Z position.
Definition: Area3D.cpp:371
Isis::Displacement::isValid
bool isValid() const
Test if this displacement has been initialized or not.
Definition: Displacement.cpp:141
Isis::Area3D::operator==
bool operator==(const Area3D &otherArea) const
Compares two areas with the == operator.
Definition: Area3D.cpp:517
Isis::Area3D::getEndX
Displacement getEndX() const
Returns the rightmost X position of the 3D area.
Definition: Area3D.cpp:196
Isis::Area3D::setStartX
void setStartX(const Displacement &startX)
Sets the leftmost X position.
Definition: Area3D.cpp:242
Distance.h
Isis::Area3D::setEndX
void setEndX(const Displacement &endX)
Sets the rightmost X position.
Definition: Area3D.cpp:347
Isis::Area3D::intersect
Area3D intersect(const Area3D &otherArea) const
Returns the intersection of this 3D area with another 3D area.
Definition: Area3D.cpp:462
Isis::Area3D::moveEndX
void moveEndX(const Displacement &endX)
Moves the rightmost X position of the 3D area.
Definition: Area3D.cpp:383
Isis::Area3D::operator=
Area3D & operator=(const Area3D &areaToCopy)
Assigns areaToCopy to this.
Definition: Area3D.cpp:546
Isis::Area3D::Area3D
Area3D()
The empty constructor creates an invalid 3D area.
Definition: Area3D.cpp:24
Isis::Area3D::getStartY
Displacement getStartY() const
Returns the topmost Y position of the 3D area.
Definition: Area3D.cpp:130
Isis::Area3D::setXDimension
void setXDimension(const Displacement &startX, const Distance &width)
Sets the X dimension of the 3D area.
Definition: Area3D.cpp:420
Isis
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16