OPAL (Object Oriented Parallel Accelerator Library)  2.2.0
OPAL
BoundingBox.h
Go to the documentation of this file.
1 #ifndef MSLANG_BOUNDINGBOX_H
2 #define MSLANG_BOUNDINGBOX_H
3 
4 #include "Algorithms/Vektor.h"
5 
6 #include <iostream>
7 #include <fstream>
8 
9 namespace mslang {
10  struct BoundingBox {
12  double width_m;
13  double height_m;
14 
16  center_m(0.0),
17  width_m(0.0),
18  height_m(0.0)
19  { }
20 
21  BoundingBox(const BoundingBox &right):
22  center_m(right.center_m),
23  width_m(right.width_m),
24  height_m(right.height_m)
25  { }
26 
27  BoundingBox(const Vector_t &llc,
28  const Vector_t &urc):
29  center_m(0.5 * (llc + urc)),
30  width_m(urc[0] - llc[0]),
31  height_m(urc[1] - llc[1])
32  { }
33 
34  bool doesIntersect(const BoundingBox &bb) const;
35  bool isInside(const Vector_t &X) const;
36  bool isInside(const BoundingBox &b) const;
37  virtual void writeGnuplot(std::ostream &out) const;
38  void print(std::ostream &out) const;
39  };
40 
41  std::ostream & operator<< (std::ostream &out, const BoundingBox &bb);
42 }
43 
44 #endif
BoundingBox(const BoundingBox &right)
Definition: BoundingBox.h:21
void print(std::ostream &out) const
Definition: BoundingBox.cpp:42
Definition: rbendmap.h:8
bool isInside(const Vector_t &X) const
Definition: BoundingBox.cpp:11
virtual void writeGnuplot(std::ostream &out) const
Definition: BoundingBox.cpp:26
std::ostream & operator<<(std::ostream &out, const BoundingBox &bb)
Definition: BoundingBox.cpp:50
bool doesIntersect(const BoundingBox &bb) const
Definition: BoundingBox.cpp:4
BoundingBox(const Vector_t &llc, const Vector_t &urc)
Definition: BoundingBox.h:27