![]() |
TAPs 0.7.7.3
|
00001 /****************************************************************************** 00002 TAPsImplicitObject_Sphere.hpp 00003 ******************************************************************************/ 00015 /****************************************************************************** 00016 SUKITTI PUNAK (10/14/2009) 00017 UPDATE (10/14/2009) 00018 ******************************************************************************/ 00019 #ifndef TAPs_IMPLICIT_OBJECT_SPHERE_HPP 00020 #define TAPs_IMPLICIT_OBJECT_SPHERE_HPP 00021 00022 #include "TAPsImplicitObject.hpp" 00023 00024 BEGIN_NAMESPACE_TAPs 00025 //============================================================================= 00026 template <typename T> 00027 class ImplicitObject_Sphere : public /*virtual*/ ImplicitObject<T> { 00028 //============================================================================= 00029 public: 00030 // Member Functions ------------------------------------------------------- 00032 friend std::ostream & operator<< ( std::ostream &output, ImplicitObject_Sphere<T> const &obj ) 00033 { 00034 output << obj.StrInfo(); 00035 return output; 00036 } 00037 //------------------------------------------------------------------------- 00039 ImplicitObject_Sphere ( T radius = 0.5, std::string & name = std::string("") ); 00041 ImplicitObject_Sphere ( ImplicitObject_Sphere<T> const &orig ); 00043 virtual ~ImplicitObject_Sphere (); 00044 //------------------------------------------------------------------------- 00046 virtual std::string StrInfo () const; 00047 //------------------------------------------------------------------------- 00049 inline ImplicitObject_Sphere<T> & operator= ( ImplicitObject_Sphere<T> const &orig ); 00050 00052 inline T GetTransformedRadius () const; 00054 T GetRadius () const { return m_Radius; } 00056 void SetRadius ( T r ) { m_Radius = r; } 00057 00059 virtual void BuildBVHTree ( int detail_level = 0, Enum::CD treeType = Enum::BVH_TREE_BINARY_SPHERE ); 00060 00061 // Data Members ----------------------------------------------------------- 00062 //============================================================================= 00063 protected: 00064 // Member Functions ------------------------------------------------------- 00065 // Data Members ----------------------------------------------------------- 00066 T m_Radius; 00067 //============================================================================= 00068 private: 00069 // Member Functions ------------------------------------------------------- 00070 // Data Members ----------------------------------------------------------- 00071 //============================================================================= 00072 00073 #if defined(__gl_h_) || defined(__GL_H__) 00074 public: 00078 virtual void Draw ( GLenum mode = GL_TRIANGLES, GLint slices = 16, GLint stacks = 16 ); 00079 #endif 00080 00081 //============================================================================= 00082 }; // END CLASS ImplicitObject_Sphere 00083 //============================================================================= 00084 //----------------------------------------------------------------------------- 00086 typedef ImplicitObject_Sphere<int> ImplicitObject_Spherei; 00087 typedef ImplicitObject_Sphere<float> ImplicitObject_Spheref; 00088 typedef ImplicitObject_Sphere<double> ImplicitObject_Sphered; 00089 //============================================================================= 00090 END_NAMESPACE_TAPs 00091 //----------------------------------------------------------------------------- 00093 #include "TAPsImplicitObject_Sphere.cpp" 00094 00096 // Include definition if TAPs_USE_EXPORT is not defined 00097 //#if !defined( TAPs_USE_EXPORT ) 00098 // #include "TAPsImplicitObject_Sphere.cpp" 00099 //#endif 00100 //----------------------------------------------------------------------------- 00101 #endif 00102 //34567890123456789012345678901234567890123456789012345678901234567890123456789 00103 //--+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----