![]() |
TAPs 0.7.7.3
|
00001 /****************************************************************************** 00002 TAPsAdvSimConstraint_Base_AvsB.hpp 00003 ******************************************************************************/ 00007 /****************************************************************************** 00008 SUKITTI PUNAK (04/30/2010) 00009 UPDATE (08/30/2010) 00010 ******************************************************************************/ 00011 #ifndef TAPs_ADV_SIM_CONSTRAINT_HPP 00012 #define TAPs_ADV_SIM_CONSTRAINT_HPP 00013 00014 #include <TAPs/Physics/TAPsForces.hpp> 00015 #include <TAPs/GeometricDataStructure/HalfEdge/TAPsHalfEdgeDataStructure.hpp> 00016 00017 BEGIN_NAMESPACE_TAPs 00018 //============================================================================= 00019 template <typename T> 00020 class AdvSimConstraint_Base_AvsB { 00021 //============================================================================= 00022 public: 00023 // Member Functions ------------------------------------------------------- 00025 friend std::ostream & operator<< ( std::ostream &output, AdvSimConstraint_Base_AvsB<T> const &obj ) 00026 { 00027 output << obj.StrInfo(); 00028 return output; 00029 } 00030 //------------------------------------------------------------------------- 00032 AdvSimConstraint_Base_AvsB ( 00033 T forceRatio, 00034 T forceScaleA, 00035 T forceScaleB, 00036 T forceThresholdA = 1, 00037 T forceThresholdB = 1 00038 ); 00039 00041 AdvSimConstraint_Base_AvsB ( AdvSimConstraint_Base_AvsB<T> const &orig ); 00043 virtual ~AdvSimConstraint_Base_AvsB (); 00044 //------------------------------------------------------------------------- 00046 virtual std::string StrInfo () const; 00047 //------------------------------------------------------------------------- 00049 inline virtual AdvSimConstraint_Base_AvsB<T> & operator= ( AdvSimConstraint_Base_AvsB<T> const &orig ); 00050 00051 //------------------------------------------------------------------------- 00052 // Get/Set Functions 00053 00055 T GetForceRatio () const { return m_ForceRatio; } 00057 void SetForceRatio ( T ratio ) { m_ForceRatio = ratio; } 00058 00060 T GetForceScaleA () const { return m_ForceScaleA; } 00062 void SetForceScaleA ( T scale ) { m_ForceScaleA = scale; } 00064 T GetForceScaleB () const { return m_ForceScaleB; } 00066 void SetForceScaleB ( T scale ) { m_ForceScaleB = scale; } 00067 00069 T GetForceThresholdA () const { return m_ForceThresholdA; } 00071 void SetForceThresholdA ( T threshold ) { m_ForceThresholdA = threshold; } 00073 T GetForceThresholdB () const { return m_ForceThresholdB; } 00075 void SetForceThresholdB ( T threshold ) { m_ForceThresholdB = threshold; } 00076 00078 Vector3<T> & RefToSavedPositionA () { return m_SavedPosA; } 00080 Vector3<T> & RefToSavedPositionB () { return m_SavedPosB; } 00082 Vector3<T> & RefToTargetPositionA () { return m_TargetPosA; } 00084 Vector3<T> & RefToTargetPositionB () { return m_TargetPosB; } 00085 00087 //PointForce<T> RefToPointForceA () { return m_PtForceA; } 00089 //PointForce<T> RefToPointForceB () { return m_PtForceB; } 00090 00091 //------------------------------------------------------------------------- 00092 // Functions for Advanced Simulation 00093 00095 inline virtual void EnforceConstraint () = 0; 00096 00098 inline virtual void ClearConstraint () = 0; 00099 00100 // Data Members ----------------------------------------------------------- 00101 //============================================================================= 00102 protected: 00103 // Member Functions ------------------------------------------------------- 00104 // Data Members ----------------------------------------------------------- 00105 //Vector3<T> m_Force; //!< force 00106 T m_ForceRatio; 00107 T m_ForceScaleA; 00108 T m_ForceScaleB; 00109 T m_ForceThresholdA; 00110 T m_ForceThresholdB; 00111 00112 Vector3<T> m_SavedPosA; 00113 Vector3<T> m_SavedPosB; 00114 Vector3<T> m_TargetPosA; 00115 Vector3<T> m_TargetPosB; 00116 00117 //PointForce<T> m_PtForceA; //!< point force 00118 //PointForce<T> m_PtForceB; //!< point force 00119 //============================================================================= 00120 private: 00121 // Member Functions ------------------------------------------------------- 00122 // Data Members ----------------------------------------------------------- 00123 //============================================================================= 00124 00125 #if defined(__gl_h_) || defined(__GL_H__) 00126 public: 00128 virtual void Draw () const = 0; 00129 #endif 00130 00131 //============================================================================= 00132 }; // END CLASS AdvSimConstraint_Base_AvsB 00133 //============================================================================= 00134 END_NAMESPACE_TAPs 00135 //----------------------------------------------------------------------------- 00137 #include "TAPsAdvSimConstraint_Base_AvsB.cpp" 00138 00140 // Include definition if TAPs_USE_EXPORT is not defined 00141 //#if !defined( TAPs_USE_EXPORT ) 00142 // #include "TAPsAdvSimConstraint_Base_AvsB.cpp" 00143 //#endif 00144 //----------------------------------------------------------------------------- 00145 #endif 00146 //34567890123456789012345678901234567890123456789012345678901234567890123456789 00147 //--+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----