TAPs 0.7.7.3
TAPsAdvSimConstraint_Base_AvsB.hpp
Go to the documentation of this file.
00001 /******************************************************************************
00002 TAPsAdvSimConstraint_Base_AvsB.hpp
00003 ******************************************************************************/
00007 /******************************************************************************
00008 SUKITTI PUNAK   (04/30/2010)
00009 UPDATE          (09/29/2010)
00010 ******************************************************************************/
00011 #ifndef TAPs_ADV_SIM_CONSTRAINT_BASE_A_VS_B_HPP
00012 #define TAPs_ADV_SIM_CONSTRAINT_BASE_A_VS_B_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 
00031     //-------------------------------------------------------------------------
00033     AdvSimConstraint_Base_AvsB (
00034         T forceRatio = 0.5, 
00035         T forceScaleA = 1,  
00036         T forceScaleB = 1,  
00037         T forceThresholdA = 1,  
00038         T forceThresholdB = 1,  
00039         bool bEnforcePosA = true,   
00040         bool bEnforcePosB = true    
00041     );
00042 
00044     AdvSimConstraint_Base_AvsB ( AdvSimConstraint_Base_AvsB<T> const &orig );
00046     virtual ~AdvSimConstraint_Base_AvsB ();
00047     //-------------------------------------------------------------------------
00049     virtual std::string StrInfo () const;
00050     //-------------------------------------------------------------------------
00052     inline virtual AdvSimConstraint_Base_AvsB<T> & operator= ( AdvSimConstraint_Base_AvsB<T> const &orig );
00053 
00054     //-------------------------------------------------------------------------
00055     // Get/Set Functions
00056 
00058     T   GetForceRatio () const  { return m_ForceRatio; }
00060     void SetForceRatio ( T ratio ) { m_ForceRatio = ratio; }
00061 
00063     T   GetForceScaleA () const { return m_ForceScaleA; }
00065     void SetForceScaleA ( T scale ) { m_ForceScaleA = scale; }
00067     T   GetForceScaleB () const { return m_ForceScaleB; }
00069     void SetForceScaleB ( T scale ) { m_ForceScaleB = scale; }
00070 
00072     T   GetForceThresholdA () const { return m_ForceThresholdA; }
00074     void SetForceThresholdA ( T threshold ) { m_ForceThresholdA = threshold; }
00076     T   GetForceThresholdB () const { return m_ForceThresholdB; }
00078     void SetForceThresholdB ( T threshold ) { m_ForceThresholdB = threshold; }
00079 
00081     bool GetEnforcePositionStatusA () const { return m_bEnforcePositionA; }
00083     void SetEnforcePositionStatusA ( bool b ) { m_bEnforcePositionA = b; }
00085     bool GetEnforcePositionStatusB () const { return m_bEnforcePositionB; }
00087     void SetEnforcePositionStatusB ( bool b ) { m_bEnforcePositionB = b; }
00088 
00090     Vector3<T> & RefToSavedPositionA () { return m_SavedPosA; }
00092     Vector3<T> & RefToSavedPositionB () { return m_SavedPosB; }
00094     Vector3<T> & RefToTargetPositionA ()    { return m_TargetPosA; }
00096     Vector3<T> & RefToTargetPositionB ()    { return m_TargetPosB; }
00097 
00099     //PointForce<T> RefToPointForceA () { return m_PtForceA; }
00101     //PointForce<T> RefToPointForceB () { return m_PtForceB; }
00102 
00103     //-------------------------------------------------------------------------
00104     // Functions for Advanced Simulation
00105 
00107     inline virtual void EnforceConstraint () = 0;
00108 
00110     inline virtual void ClearConstraint () = 0;
00111 
00112     // Data Members -----------------------------------------------------------
00113 //=============================================================================
00114 protected:
00115     // Member Functions -------------------------------------------------------
00116     // Data Members -----------------------------------------------------------
00117     //Vector3<T>    m_Force;    //!< force
00118     T   m_ForceRatio;           
00119     T   m_ForceScaleA;          
00120     T   m_ForceScaleB;          
00121     T   m_ForceThresholdA;      
00122     T   m_ForceThresholdB;      
00123 
00124     Vector3<T>  m_SavedPosA;    
00125     Vector3<T>  m_SavedPosB;    
00126     Vector3<T>  m_TargetPosA;   
00127     Vector3<T>  m_TargetPosB;   
00128 
00129     bool    m_bEnforcePositionA;    
00130     bool    m_bEnforcePositionB;    
00131 
00132 //=============================================================================
00133 private:
00134     // Member Functions -------------------------------------------------------
00135     // Data Members -----------------------------------------------------------
00136 //=============================================================================
00137 
00138 #if defined(__gl_h_) || defined(__GL_H__)
00139 public:
00141     virtual void Draw () const = 0;
00142 #endif
00143 
00144 //=============================================================================
00145 }; // END CLASS AdvSimConstraint_Base_AvsB
00146 //=============================================================================
00147 END_NAMESPACE_TAPs
00148 //-----------------------------------------------------------------------------
00150 #include "TAPsAdvSimConstraint_Base_AvsB.cpp"
00151 
00153 // Include definition if TAPs_USE_EXPORT is not defined
00154 //#if !defined( TAPs_USE_EXPORT )
00155 //  #include "TAPsAdvSimConstraint_Base_AvsB.cpp"
00156 //#endif
00157 //-----------------------------------------------------------------------------
00158 #endif
00159 //34567890123456789012345678901234567890123456789012345678901234567890123456789
00160 //--+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines