Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef __BOUNDINGBOX_HXX__
00021 #define __BOUNDINGBOX_HXX__
00022
00023 #include "INTERPKERNELDefines.hxx"
00024 #include <iostream>
00025
00026 namespace INTERP_KERNEL
00027 {
00028
00033 class INTERPKERNEL_EXPORT BoundingBox
00034 {
00035 public:
00036
00038 enum BoxCoord { XMIN = 0, YMIN = 1, ZMIN = 2, XMAX = 3, YMAX = 4, ZMAX = 5 };
00039
00040 BoundingBox(const double** pts, const unsigned numPts);
00041
00042 BoundingBox(const BoundingBox& box1, const BoundingBox& box2);
00043
00044 ~BoundingBox();
00045
00046 bool isDisjointWith(const BoundingBox& box) const;
00047
00048 inline void setCoordinate(const BoxCoord coord, double value);
00049
00050 inline double getCoordinate(const BoxCoord coord) const;
00051
00052 void updateWithPoint(const double* pt);
00053
00054 inline void dumpCoords() const;
00055
00056 private:
00057
00058 bool isValid() const;
00059
00061 BoundingBox(const BoundingBox& box);
00062
00064 BoundingBox& operator=(const BoundingBox& box);
00065
00068 double* _coords;
00069
00070 };
00071
00079 inline void BoundingBox::setCoordinate(const BoxCoord coord, double value)
00080 {
00081 _coords[coord] = value;
00082 }
00083
00091 inline double BoundingBox::getCoordinate(const BoxCoord coord) const
00092 {
00093 return _coords[coord];
00094 }
00095
00100 inline void BoundingBox::dumpCoords() const
00101 {
00102 std::cout << "[xmin, xmax] = [" << _coords[XMIN] << ", " << _coords[XMAX] << "]" << " | ";
00103 std::cout << "[ymin, ymax] = [" << _coords[YMIN] << ", " << _coords[YMAX] << "]" << " | ";
00104 std::cout << "[zmin, zmax] = [" << _coords[ZMIN] << ", " << _coords[ZMAX] << "]";
00105 std::cout << std::endl;
00106 }
00107
00108 }
00109
00110 #endif