![]() |
TAPs 0.7.7.3
|
00001 /****************************************************************************** 00002 TAPsAdvSimConstraint_VertexIdVsVertexId.cpp 00003 ******************************************************************************/ 00007 /****************************************************************************** 00008 SUKITTI PUNAK (09/17/2010) 00009 UPDATE (10/20/2010) 00010 ******************************************************************************/ 00011 #include "TAPsAdvSimConstraint_VertexIdVsVertexId.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_VertexIdVsVertexId<T>::AdvSimConstraint_VertexIdVsVertexId ( 00022 unsigned int vertexID1, 00023 unsigned int vertexID2, 00024 T forceRatio, 00025 T forceScaleForModel1, 00026 T forceScaleForModel2, 00027 T forceThresholdForModel1 = 1, 00028 T forceThresholdForModel2 = 1, 00029 bool bEnforceVertexOfModel1 = true, 00030 bool bEnforceVertexOfModel2 = true 00031 ) 00032 : AdvSimConstraint_Base_AvsB( forceRatio, forceScaleForModel1, forceScaleForModel2, forceThresholdForModel1, forceThresholdForModel2, bEnforceVertexOfModel1, bEnforceVertexOfModel2 ) 00033 , m_uiVertexID_Model1( vertexID1 ) 00034 , m_uiVertexID_Model2( vertexID2 ) 00035 {} 00036 //----------------------------------------------------------------------------- 00037 template <typename T> 00038 AdvSimConstraint_VertexIdVsVertexId<T>::AdvSimConstraint_VertexIdVsVertexId ( AdvSimConstraint_VertexIdVsVertexId<T> const &orig ) 00039 : AdvSimConstraint_Base_AvsB( orig ) 00040 , m_uiVertexID_Model1( orig.m_uiVertexID_Model1 ) 00041 , m_uiVertexID_Model2( orig.m_uiVertexID_Model2 ) 00042 {} 00043 //----------------------------------------------------------------------------- 00044 template <typename T> 00045 AdvSimConstraint_VertexIdVsVertexId<T>::~AdvSimConstraint_VertexIdVsVertexId () 00046 { 00047 //ClearConstraint(); 00048 } 00049 //----------------------------------------------------------------------------- 00050 template <typename T> 00051 std::string AdvSimConstraint_VertexIdVsVertexId<T>::StrInfo () const 00052 { 00053 std::ostringstream ss; 00054 ss << "AdvSimConstraint_VertexIdVsVertexId<" << typeid(T).name() << ">"; 00055 ss << "\n\tVertex ID from modelA: " << GetVertexIDFromModel_1(); 00056 ss << "\n\tVertex ID from modelB: " << GetVertexIDFromModel_2(); 00057 ss << "\n" << AdvSimConstraint_Base_AvsB<T>::StrInfo(); 00058 return ss.str(); 00059 } 00060 //----------------------------------------------------------------------------- 00061 //============================================================================= 00062 // Assignment Operator 00063 //----------------------------------------------------------------------------- 00064 template <typename T> 00065 AdvSimConstraint_VertexIdVsVertexId<T> & AdvSimConstraint_VertexIdVsVertexId<T>::operator= ( AdvSimConstraint_VertexIdVsVertexId<T> const &orig ) 00066 { 00067 *dynamic_cast< AdvSimConstraint_Base_AvsB<T>* >( this ) = orig; 00068 m_uiVertexID_Model1 = orig.m_uiVertexID_Model1; 00069 m_uiVertexID_Model2 = orig.m_uiVertexID_Model2; 00070 return *this; 00071 } 00072 //----------------------------------------------------------------------------- 00073 00074 //----------------------------------------------------------------------------- 00075 template <typename T> 00076 void AdvSimConstraint_VertexIdVsVertexId<T>::EnforceConstraint () 00077 { 00078 //PrtNotImplementedYet( "EnforceConstraint()" ); 00079 // Can't do enforcing, since the stored data is not enough. 00080 } 00081 //----------------------------------------------------------------------------- 00082 template <typename T> 00083 void AdvSimConstraint_VertexIdVsVertexId<T>::ClearConstraint () 00084 { 00085 //PrtNotImplementedYet( "ClearConstraint()" ); 00086 // No need to clear, since the stored data does not really do any constraint. 00087 } 00088 //----------------------------------------------------------------------------- 00089 00090 00091 //----------------------------------------------------------------------------- 00092 #if defined(__gl_h_) || defined(__GL_H__) 00093 template <typename T> 00094 void AdvSimConstraint_VertexIdVsVertexId<T>::Draw () const 00095 { 00096 // Not enough info for drawing 00097 //Vector3<T> ov; 00098 //glPushAttrib( GL_ALL_ATTRIB_BITS ); 00099 //glDisable( GL_LIGHTING ); 00100 //glColor3f( 1, 0, 0 ); 00101 //glPointSize( 5 ); 00102 //glBegin( GL_POINTS ); 00103 // glVertex3fv( ov.GetDataFloat() ); 00104 //glEnd(); 00105 //glPopAttrib(); 00106 } 00107 #endif 00108 //----------------------------------------------------------------------------- 00109 //============================================================================= 00110 END_NAMESPACE_TAPs 00111 //34567890123456789012345678901234567890123456789012345678901234567890123456789 00112 //--+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----