Jafar
|
00001 /* $Id$ */ 00002 00003 #ifndef _BOUNDING_BOX_HPP_ 00004 #define _BOUNDING_BOX_HPP_ 00005 00006 #include <jmath/jblas.hpp> 00007 00008 namespace jafar { 00009 namespace geom { 00010 template<int dimension> 00011 class Point; 00017 template<int dimension> 00018 class BoundingBox { 00019 typedef boost::numeric::ublas::bounded_vector<double,dimension + 1> HomogenousVec; 00020 public: 00025 BoundingBox(); 00031 BoundingBox(const HomogenousVec& corner1, const HomogenousVec& corner2); 00035 BoundingBox(const BoundingBox& ref); 00039 bool operator==( const BoundingBox& _rhs ) const; 00044 inline const HomogenousVec& corner1() const; 00049 inline const HomogenousVec& corner2() const; 00053 inline bool isDefined() const; 00058 inline void extend(double size); 00063 inline bool contains( const HomogenousVec& _point) const; 00068 inline bool strictContains( const HomogenousVec& _point) const; 00075 inline bool overlap( const BoundingBox<dimension>& _bb) const; 00082 inline bool strictOverlap( const BoundingBox<dimension>& _bb) const; 00083 private: 00088 void normalize(); 00089 private: 00090 HomogenousVec m_corner1, m_corner2; 00091 bool m_defined; 00092 }; 00093 template<int _dimension_> 00094 std::ostream& operator<<(std::ostream& s, const BoundingBox<_dimension_>&); 00095 } 00096 } 00097 00098 #include "geom/BoundingBoxImpl.hpp" 00099 00100 #endif
Generated on Wed Oct 15 2014 00:37:19 for Jafar by doxygen 1.7.6.1 |