Space Comps
 All Classes Files Functions Variables
boundingbox.h
1 #ifndef BOUNDINGBOX_H
2 #define BOUNDINGBOX_H
3 #include "particle.h"
4 #include "constants.h"
5 
6 
15 {
16 public:
26 
27  ~BoundingBox();
28 
34 
42  void update();
43 
53  double getMax(int dimension);
54 
64  double getMin(int dimension);
65 
70  double getXMin();
71 
76  double getXMax();
77 
82  double getYMin();
83 
88  double getYMax();
89 
94  double getZMin();
95 
100  double getZMax();
101 
111  bool pointContained3D(double point[3]);
112 
123  bool boxOverlap3D(BoundingBox* other);
124 
134  bool pointContained2D(double point[2]);
135 
146  bool boxOverlap2D(BoundingBox* other);
147 
148 private:
149  Particle* particle;
150  double xMin;
151  double xMax;
152  double yMin;
153  double yMax;
154  double zMin;
155  double zMax;
156  double radius;
157 };
158 
159 #endif // BOUNDINGBOX_H
The BoundingBox class represents a square or cube that fits perfectly around a particle.
Definition: boundingbox.h:14
double getZMax()
Returns the maximum z dimension coordinate of this BouningBox.
Definition: boundingbox.cpp:92
double getZMin()
Returns the minimum z dimension coordinate of this BoundingBox.
Definition: boundingbox.cpp:88
double getXMin()
Returns the minimum x dimension coordinate of this BoundingBox.
Definition: boundingbox.cpp:72
double getYMax()
Returns the maximum y dimension coordinate of this BouningBox.
Definition: boundingbox.cpp:84
void update()
Updates the position of the BouningBox to reflect the Particle.
Definition: boundingbox.cpp:26
BoundingBox(Particle *p)
Constructs a BoundingBox around the given Particle.
Definition: boundingbox.cpp:3
Particle * getParticle()
Returns the Particle this BouningBox is tracks the endpoints of.
Definition: boundingbox.cpp:21
bool boxOverlap2D(BoundingBox *other)
Returns whether or not 2 bouning boxes overlap (in 3-space)
Definition: boundingbox.cpp:201
Definition: particle.h:12
double getMax(int dimension)
Returns the minimum of the desired dimension.
Definition: boundingbox.cpp:40
double getYMin()
Returns the minimum y dimension coordinate of this BoundingBox.
Definition: boundingbox.cpp:80
double getMin(int dimension)
Returns the maximum of the desired dimension.
Definition: boundingbox.cpp:56
bool boxOverlap3D(BoundingBox *other)
Returns whether or not 2 bouning boxes overlap (in 3-space)
Definition: boundingbox.cpp:114
double getXMax()
Returns the maximum x dimension coordinate of this BouningBox.
Definition: boundingbox.cpp:76
bool pointContained3D(double point[3])
Returns whether a point in 3-space falls within this BoundingBox.
Definition: boundingbox.cpp:96
bool pointContained2D(double point[2])
Returns whether a point in 2-space falls within this BoundingBox.
Definition: boundingbox.cpp:105