Geant4 Cross Reference |
1 // Copyright (C) 2010, Guy Barrand. All rights 1 // Copyright (C) 2010, Guy Barrand. All rights reserved. 2 // See the file tools.license for terms. 2 // See the file tools.license for terms. 3 3 4 #ifndef tools_box3f 4 #ifndef tools_box3f 5 #define tools_box3f 5 #define tools_box3f 6 6 7 #include "box3" 7 #include "box3" 8 #include "vec3f" 8 #include "vec3f" 9 #include <cfloat> //FLT_MAX 9 #include <cfloat> //FLT_MAX 10 10 11 namespace tools { 11 namespace tools { 12 12 13 class box3f : public box3<vec3f> { 13 class box3f : public box3<vec3f> { 14 typedef box3<vec3f> parent; 14 typedef box3<vec3f> parent; 15 static float num_max() {return FLT_MAX;} 15 static float num_max() {return FLT_MAX;} 16 public: 16 public: 17 box3f():parent(){make_empty();} 17 box3f():parent(){make_empty();} 18 virtual ~box3f() {} 18 virtual ~box3f() {} 19 public: 19 public: 20 box3f(const box3f& a_from):parent(a_from){} 20 box3f(const box3f& a_from):parent(a_from){} 21 box3f& operator=(const box3f& a_from){ 21 box3f& operator=(const box3f& a_from){ 22 parent::operator=(a_from); 22 parent::operator=(a_from); 23 return *this; 23 return *this; 24 } 24 } 25 public: 25 public: 26 void make_empty(){ 26 void make_empty(){ 27 m_min.set_value( num_max(), num_max(), n 27 m_min.set_value( num_max(), num_max(), num_max()); 28 m_max.set_value(-num_max(), -num_max(), -n 28 m_max.set_value(-num_max(), -num_max(), -num_max()); 29 } 29 } 30 bool get_cube_size(float& a_dx,float& a_dy,f 30 bool get_cube_size(float& a_dx,float& a_dy,float& a_dz) const { 31 return parent::get_cube_size(a_dx,a_dy,a_d 31 return parent::get_cube_size(a_dx,a_dy,a_dz,::sqrtf); 32 } 32 } 33 }; 33 }; 34 34 35 } 35 } 36 36 37 #endif 37 #endif