Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009 #ifndef BOUNDINGBOX_H_
00010 #define BOUNDINGBOX_H_
00011
00012 #include <algorithm>
00013 #include <cmath>
00014 #include <limits>
00015 using std::numeric_limits;
00016
00017 #include "Vertex.hpp"
00018
00019 namespace lssr
00020 {
00021
00025 template<typename VertexT>
00026 class BoundingBox {
00027 public:
00028
00032 BoundingBox();
00033
00041 BoundingBox(VertexT v1, VertexT v2);
00042
00054 BoundingBox(float x_min, float y_min, float z_min,
00055 float x_max, float y_max, float z_max);
00056
00057 virtual ~BoundingBox() {};
00058
00065 inline void expand(VertexT v);
00066
00075 inline void expand(float x, float y, float z);
00076
00083 inline void expand(BoundingBox<VertexT>& bb);
00084
00090 float getRadius();
00091
00096 bool isValid();
00097
00101 VertexT getCentroid(){return m_centroid;};
00102
00106 float getLongestSide();
00107
00111 float getXSize();
00112
00116 float getYSize();
00117
00121 float getZSize();
00122
00123
00127 VertexT getMax() const;
00128
00132 VertexT getMin() const;
00133
00134 private:
00135
00137 VertexT m_min;
00138
00140 VertexT m_max;
00141
00143 VertexT m_centroid;
00144
00146 float m_xSize;
00147
00149 float m_ySize;
00150
00152 float m_zSize;
00153 };
00154
00155 }
00156
00157 #include "BoundingBox.tcc"
00158
00159 #endif