![]() |
TAPs 0.7.7.3
|
00001 /****************************************************************************** 00002 TAPsInteractionPoint.hpp 00003 ******************************************************************************/ 00011 /****************************************************************************** 00012 SUKITTI PUNAK (07/23/2010) 00013 UPDATE (09/22/2010) 00014 ******************************************************************************/ 00015 #ifndef TAPs_INTERACTION_POINT_HPP 00016 #define TAPs_INTERACTION_POINT_HPP 00017 00018 #include "../Core/TAPsCGMath.hpp" 00019 #include "../Physics/TAPsPointMassDynamicWithQuaternionRotation.hpp" 00020 #include "../DataStructure/TAPsSimulationFlags.hpp" 00021 00022 BEGIN_NAMESPACE_TAPs 00023 //============================================================================= 00024 template <typename T> 00025 class InteractionPoint { 00026 //============================================================================= 00027 public: 00028 00029 // Member Functions ------------------------------------------------------- 00031 friend std::ostream & operator<< ( std::ostream &output, InteractionPoint<T> const &obj ) 00032 { 00033 output << obj.StrInfo(); 00034 return output; 00035 } 00036 //------------------------------------------------------------------------- 00038 InteractionPoint ( typename PointMass<T>::Type typeOfPointMass = PointMass<T>::TYPE_STATIC, unsigned int id = 0 ); 00040 InteractionPoint ( Vector3<T> const &location, typename PointMass<T>::Type typeOfPointMass = PointMass<T>::TYPE_STATIC, unsigned int id = 0 ); 00042 InteractionPoint ( T const location[3], typename PointMass<T>::Type typeOfPointMass = PointMass<T>::TYPE_STATIC, unsigned int id = 0 ); 00044 InteractionPoint ( T locX, T locY, T locZ, typename PointMass<T>::Type typeOfPointMass = PointMass<T>::TYPE_STATIC, unsigned int id = 0 ); 00046 InteractionPoint ( InteractionPoint<T> const &orig ); 00048 virtual ~InteractionPoint (); 00049 //------------------------------------------------------------------------- 00051 virtual std::string StrInfo () const; 00052 //------------------------------------------------------------------------- 00054 inline InteractionPoint<T> & operator= ( InteractionPoint<T> const &orig ); 00055 //------------------------------------------------------------------------- 00056 // Get/Set & Operations 00057 00059 inline unsigned int GetID () const; 00061 inline void SetID ( unsigned int id ); 00062 00064 inline Vector3<T> const & GetPosition () const; 00066 inline Vector3<T> & GetPosition (); 00068 inline void SetPosition ( Vector3<T> const & position ); 00069 00071 inline T GetSize () const; 00073 inline T GetRadius () const { return GetSize(); } 00075 inline void SetSize ( T size ); 00077 inline void SetRadius ( T radius ) { SetSize( radius ); } 00078 00080 inline T GetMass () const; 00082 inline void SetMass ( T mass ); 00083 00084 // Get simulation flags 00085 inline DS::SimulationFlags const & GetSimFlags () const; 00086 // Get simulation flags 00087 inline DS::SimulationFlags & GetSimFlags (); 00088 00090 inline PointMass<T> const * PtrToPointMass () const; 00092 inline PointMass<T> * PtrToPointMass (); 00093 00094 //------------------------------------------------------------------------- 00096 static inline bool CompareDistanceFromOriginPos_LessThan ( InteractionPoint<T> A, InteractionPoint<T> B ); 00098 static inline bool CompareDistanceFromOriginPos_GreaterThan ( InteractionPoint<T> A, InteractionPoint<T> B ); 00099 00100 // Data Members ----------------------------------------------------------- 00101 //============================================================================= 00102 protected: 00103 // Member Functions ------------------------------------------------------- 00104 // Data Members ----------------------------------------------------------- 00105 PointMass<T> * m_pPointMass; 00106 unsigned int m_id; 00107 //============================================================================= 00108 private: 00109 // Member Functions ------------------------------------------------------- 00110 00112 void CreatePointMass ( typename PointMass<T>::Type typeOfPointMass ); 00113 00115 void DeletePointMass (); 00116 00117 // Data Members ----------------------------------------------------------- 00118 //============================================================================= 00119 00120 #if defined(__gl_h_) || defined(__GL_H__) 00121 #endif 00122 00123 //============================================================================= 00124 }; // END CLASS InteractionPoint 00125 //============================================================================= 00126 END_NAMESPACE_TAPs 00127 //----------------------------------------------------------------------------- 00129 #include "TAPsInteractionPoint.cpp" 00130 00132 // Include definition if TAPs_USE_EXPORT is not defined 00133 //#if !defined( TAPs_USE_EXPORT ) 00134 // #include "TAPsInteractionPoint.cpp" 00135 //#endif 00136 //----------------------------------------------------------------------------- 00137 #endif 00138 //34567890123456789012345678901234567890123456789012345678901234567890123456789 00139 //--+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----