ESyS-Particle  4.0.1
BoundingSphere.h
00001 
00002 //                                                         //
00003 // Copyright (c) 2003-2011 by The University of Queensland //
00004 // Earth Systems Science Computational Centre (ESSCC)      //
00005 // http://www.uq.edu.au/esscc                              //
00006 //                                                         //
00007 // Primary Business: Brisbane, Queensland, Australia       //
00008 // Licensed under the Open Software License version 3.0    //
00009 // http://www.opensource.org/licenses/osl-3.0.php          //
00010 //                                                         //
00012 
00013 
00014 #ifndef ESYS_LSMBOUNDINGSPHERE_H
00015 #define ESYS_LSMBOUNDINGSPHERE_H
00016 
00017 #include "Foundation/vec3.h"
00018 #include "Foundation/BoundingBox.h"
00019 
00020 namespace esys
00021 {
00022   namespace lsm
00023   {
00027     class BoundingSphere
00028     {
00029     public:
00030       inline BoundingSphere();
00031       
00032       inline BoundingSphere(const Vec3 &centre, double radius);
00033 
00034       inline virtual ~BoundingSphere();
00035 
00036       inline const Vec3 &getCentre() const;
00037 
00038       inline double getRadius() const;
00039 
00040       inline BoundingBox getBBox() const;
00041 
00042       inline BoundingBox get2dBBox() const;
00043       
00044       inline bool operator==(const BoundingSphere &bSphere) const;
00045       
00046       inline bool contains(const Vec3 &pt, double tolerance = 0.0) const;
00047 
00048       inline bool contains(
00049         const BoundingSphere &bSphere,
00050         double tolerance = 0.0
00051       ) const;
00052 
00053     private:
00054       Vec3   m_centre;
00055       double m_radius;
00056     };
00057     inline std::ostream &operator<<(std::ostream &oStream, const BoundingSphere &bSphere);
00058   };
00059 };
00060 
00061 #include "Foundation/BoundingSphere.hpp"
00062 
00063 #endif