Isis 3 Developer Reference
Area3D.h
Go to the documentation of this file.
1 #ifndef Area3D_h
2 #define Area3D_h
3 
23 namespace Isis {
24  class Displacement;
25  class Distance;
26 
41  class Area3D {
42  public:
43  Area3D();
44  Area3D(const Displacement &startX, const Displacement &startY,
45  const Displacement &startZ,
46  const Distance &width, const Distance &height,
47  const Distance &depth);
48  Area3D(const Displacement &startX, const Displacement &startY,
49  const Displacement &startZ,
50  const Displacement &endX, const Displacement &endY,
51  const Displacement &endZ);
52  Area3D(const Area3D &areaToCopy);
53  virtual ~Area3D();
54 
55  Displacement getStartX() const;
56  Displacement getStartY() const;
57  Displacement getStartZ() const;
58 
59  Distance getWidth() const;
60  Distance getHeight() const;
61  Distance getDepth() const;
62 
63  Displacement getEndX() const;
64  Displacement getEndY() const;
65  Displacement getEndZ() const;
66 
67  void setStartX(const Displacement &startX);
68  void setStartY(const Displacement &startY);
69  void setStartZ(const Displacement &startZ);
70 
71  void moveStartX(const Displacement &startX);
72  void moveStartY(const Displacement &startY);
73  void moveStartZ(const Displacement &startZ);
74 
75  void setWidth(const Distance &width);
76  void setHeight(const Distance &height);
77  void setDepth(const Distance &depth);
78 
79  void setEndX(const Displacement &endX);
80  void setEndY(const Displacement &endY);
81  void setEndZ(const Displacement &endZ);
82 
83  void moveEndX(const Displacement &endX);
84  void moveEndY(const Displacement &endY);
85  void moveEndZ(const Displacement &endZ);
86 
87  void setXDimension(const Displacement &startX, const Distance &width);
88  void setYDimension(const Displacement &startY, const Distance &height);
89  void setZDimension(const Displacement &startZ, const Distance &depth);
90 
91  Area3D intersect(const Area3D &otherArea) const;
92 
93  bool isValid() const;
94 
95  bool operator ==(const Area3D &otherArea) const;
96  bool operator !=(const Area3D &otherArea) const;
97 
98  Area3D &operator =(const Area3D &areaToCopy);
99 
100  protected:
101  virtual void setArea(const Displacement &startX,
102  const Displacement &startY, const Displacement &startZ,
103  const Displacement &endX, const Displacement &endY,
104  const Displacement &endZ);
105 
106  private:
107  void deleteTheData();
108  void nullTheData();
109 
111  Displacement *m_startX;
113  Displacement *m_startY;
115  Displacement *m_startZ;
117  Displacement *m_endX;
119  Displacement *m_endY;
121  Displacement *m_endZ;
122  };
123 }
124 
125 #endif
126 
void setStartX(const Displacement &startX)
Sets the leftmost X position.
Definition: Area3D.cpp:258
void moveEndX(const Displacement &endX)
Moves the rightmost X position of the 3D area.
Definition: Area3D.cpp:399
Represents a 3D area (a 3D "cube")
Definition: Area3D.h:41
bool isValid() const
Returns true if all of the positions of the 3D area are valid (i.e.
Definition: Area3D.cpp:505
virtual ~Area3D()
The destructor frees allocated memory.
Definition: Area3D.cpp:121
void setDepth(const Distance &depth)
Changes the depth of the 3D area.
Definition: Area3D.cpp:351
void moveStartY(const Displacement &startY)
Moves the topmost Y position of the 3D area.
Definition: Area3D.cpp:306
void setHeight(const Distance &height)
Changes the height of the 3D area.
Definition: Area3D.cpp:340
Distance getDepth() const
Returns the depth (in the Z dimension) of the 3D area.
Definition: Area3D.cpp:200
Distance measurement, usually in meters.
Definition: Distance.h:47
Displacement getEndY() const
Returns the bottommost Y position of the 3D area.
Definition: Area3D.cpp:227
Displacement getStartX() const
Returns the leftmost X position of the 3D area.
Definition: Area3D.cpp:131
void moveStartX(const Displacement &startX)
Moves the leftmost X position of the 3D area.
Definition: Area3D.cpp:294
bool operator!=(const Area3D &otherArea) const
Compares two areas with the != operator.
Definition: Area3D.cpp:551
void setYDimension(const Displacement &startY, const Distance &height)
Sets the Y dimension of the 3D area.
Definition: Area3D.cpp:450
void setStartZ(const Displacement &startZ)
Sets the frontmost Z position.
Definition: Area3D.cpp:282
void setStartY(const Displacement &startY)
Sets the topmost Y position.
Definition: Area3D.cpp:270
void setZDimension(const Displacement &startZ, const Distance &depth)
Sets the Z dimension of the 3D area.
Definition: Area3D.cpp:464
Distance getWidth() const
Returns the width (in the X dimension) of the 3D area.
Definition: Area3D.cpp:176
Displacement getStartZ() const
Returns the frontmost Z position of the 3D area.
Definition: Area3D.cpp:161
void moveEndZ(const Displacement &endZ)
Moves the backmost Z position of the 3D area.
Definition: Area3D.cpp:423
void setEndZ(const Displacement &endZ)
Sets the backmost Z position.
Definition: Area3D.cpp:387
Displacement getEndZ() const
Returns the backmost Z position of the 3D area.
Definition: Area3D.cpp:242
Distance getHeight() const
Returns the height (in the Y dimension) of the 3D area.
Definition: Area3D.cpp:188
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:609
bool operator==(const Area3D &otherArea) const
Compares two areas with the == operator.
Definition: Area3D.cpp:533
void moveStartZ(const Displacement &startZ)
Moves the frontmost Z position of the 3D area.
Definition: Area3D.cpp:318
void setEndX(const Displacement &endX)
Sets the rightmost X position.
Definition: Area3D.cpp:363
void moveEndY(const Displacement &endY)
Moves the bottommost Y position of the 3D area.
Definition: Area3D.cpp:411
Displacement is a signed length, usually in meters.
Definition: Displacement.h:43
Namespace for ISIS/Bullet specific routines.
Definition: Apollo.h:31
void setXDimension(const Displacement &startX, const Distance &width)
Sets the X dimension of the 3D area.
Definition: Area3D.cpp:436
Area3D intersect(const Area3D &otherArea) const
Returns the intersection of this 3D area with another 3D area.
Definition: Area3D.cpp:478
void setEndY(const Displacement &endY)
Sets the bottommost Y position.
Definition: Area3D.cpp:375
Area3D()
The empty constructor creates an invalid 3D area.
Definition: Area3D.cpp:40
Displacement getEndX() const
Returns the rightmost X position of the 3D area.
Definition: Area3D.cpp:212
void setWidth(const Distance &width)
Changes the width of the 3D area.
Definition: Area3D.cpp:329
Area3D & operator=(const Area3D &areaToCopy)
Assigns areaToCopy to this.
Definition: Area3D.cpp:562
Displacement getStartY() const
Returns the topmost Y position of the 3D area.
Definition: Area3D.cpp:146