TAPs 0.7.7.3
TAPsAdvSimConstraint_ERSutureVsHEVertex.cpp
Go to the documentation of this file.
00001 /******************************************************************************
00002 TAPsAdvSimConstraint_ERSutureVsHEVertex.cpp
00003 ******************************************************************************/
00007 /******************************************************************************
00008 SUKITTI PUNAK   (04/30/2010)
00009 UPDATE          (08/30/2010)
00010 ******************************************************************************/
00011 #include "TAPsAdvSimConstraint_ERSutureVsHEVertex.hpp"
00012 // Using Inclusion Model (i.e. definitions are included in declarations)
00013 //                       (this name.cpp is included in name.hpp)
00014 // Each friend is defined directly inside its declaration.
00015 
00016 BEGIN_NAMESPACE_TAPs
00017 //=============================================================================
00018 // Constructors
00019 //-----------------------------------------------------------------------------
00020 template <typename T>
00021 AdvSimConstraint_ERSutureVsHEVertex<T>::AdvSimConstraint_ERSutureVsHEVertex (
00022         //SutureAdvSimID    S,      //!< suture's advanced simulation ID
00023         unsigned int    SVID,   
00024         //Vector3<T> *  pSV,    //!< pointer to vertex from suture
00025         //ObjectAdvSimID    O,      //!< model's advanced simulation ID
00026         HEVertex<T> *   pOV,    
00027         T forceRatio,           
00028         T forceScaleForSuture,  
00029         T forceScaleForModel,   
00030         T forceThresholdForSuture,  
00031         T forceThresholdForModel    
00032 )
00033     : AdvSimConstraint_Base_AvsB( forceRatio, forceScaleForSuture, forceScaleForModel, forceThresholdForSuture, forceThresholdForModel ),
00034       //m_S( S ),
00035       m_SVID( SVID ),
00036       //m_pSV( pSV ),
00037       //m_O( O ),
00038       m_pOV( pOV )
00039       //, m_bEnforceSuturePosition( true )
00040 {}
00041 //-----------------------------------------------------------------------------
00042 template <typename T>
00043 AdvSimConstraint_ERSutureVsHEVertex<T>::AdvSimConstraint_ERSutureVsHEVertex ( AdvSimConstraint_ERSutureVsHEVertex<T> const &orig )
00044     : AdvSimConstraint_Base_AvsB( orig ),
00045       //m_S( orig.m_S ),
00046       m_SVID( orig.m_SVID ),
00047       //m_pSV( orig.m_pSV ),
00048       //m_O( orig.m_O ),
00049       m_pOV( orig.m_pOV )
00050       //, m_bEnforceSuturePosition( orig.m_bEnforceSuturePosition )
00051 {}
00052 //-----------------------------------------------------------------------------
00053 template <typename T>
00054 AdvSimConstraint_ERSutureVsHEVertex<T>::~AdvSimConstraint_ERSutureVsHEVertex ()
00055 { ClearConstraint(); }
00056 //-----------------------------------------------------------------------------
00057 template <typename T>
00058 std::string AdvSimConstraint_ERSutureVsHEVertex<T>::StrInfo () const
00059 {
00060     std::ostringstream ss;
00061     ss << "AdvSimConstraint_ERSutureVsHEVertex<" << typeid(T).name() << ">";
00062     ss << " has force ratio of " << m_ForceRatio << ".";
00063     return ss.str();
00064 }
00065 //-----------------------------------------------------------------------------
00066 //=============================================================================
00067 // Assignment Operator
00068 //-----------------------------------------------------------------------------
00069 template <typename T>
00070 AdvSimConstraint_ERSutureVsHEVertex<T> & AdvSimConstraint_ERSutureVsHEVertex<T>::operator= ( AdvSimConstraint_ERSutureVsHEVertex<T> const &orig )
00071 {   
00072     *dynamic_cast< AdvSimConstraint<T>* >( this ) = orig;
00073     //m_S = orig.m_S;
00074     //m_O = orig.m_O;
00075     m_SVID = orig.m_SVID;
00076     //m_pSV = orig.m_pSV;
00077     m_pOV = orig.m_pOV;
00078     //m_bEnforceSuturePosition = orig.m_bEnforceSuturePosition;
00079     return *this;
00080 }
00081 //-----------------------------------------------------------------------------
00082 
00083 //-----------------------------------------------------------------------------
00084 template <typename T>
00085 void AdvSimConstraint_ERSutureVsHEVertex<T>::EnforceConstraint ()
00086 {
00087 }
00088 //-----------------------------------------------------------------------------
00089 template <typename T>
00090 void AdvSimConstraint_ERSutureVsHEVertex<T>::ClearConstraint ()
00091 {
00092 }
00093 //-----------------------------------------------------------------------------
00094 
00095 
00096 //-----------------------------------------------------------------------------
00097 #if defined(__gl_h_) || defined(__GL_H__)
00098 template <typename T>
00099 void AdvSimConstraint_ERSutureVsHEVertex<T>::Draw () const
00100 {
00101     Vector3<T> & ov = m_pOV->RefToPosition();
00102     glPushAttrib( GL_ALL_ATTRIB_BITS );
00103     glDisable( GL_LIGHTING );
00104     glColor3f( 1, 0, 0 );
00105     glPointSize( 5 );
00106     glBegin( GL_POINTS );
00107         glVertex3fv( ov.GetDataFloat() );
00108     glEnd();
00109     glPopAttrib();
00110 }
00111 #endif
00112 //-----------------------------------------------------------------------------
00113 //=============================================================================
00114 END_NAMESPACE_TAPs
00115 //34567890123456789012345678901234567890123456789012345678901234567890123456789
00116 //--+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines