TAPs 0.7.7.3
TAPsModelTissueHiatusHernia01.cpp
Go to the documentation of this file.
00001 /******************************************************************************
00002 TAPsModelTissueHiatusHernia01.cpp
00003 
00004 ModelTissueHiatusHernia01 class (cpp file).
00005 
00006 SUKITTI PUNAK   (05/28/2009)
00007 ******************************************************************************/
00008 #include "TAPsModelTissueHiatusHernia01.hpp"
00009 // Using Inclusion Model (i.e. definitions are included in declarations)
00010 //                       (this name.cpp is included in name.hpp)
00011 // Each friend is defined directly inside its declaration.
00012 
00013 BEGIN_NAMESPACE_TAPs
00014 //=============================================================================
00015 //-----------------------------------------------------------------------------
00016 template <typename T>
00017 ModelTissueHiatusHernia01<T>::ModelTissueHiatusHernia01 (
00018         std::string data_location       
00019 )
00020     : ModelForSurgery<T>( data_location, TISSUE_HIATUS_HERNIA_01 )
00021 {
00022     Init( rigidity );
00023 }
00024 
00025 //-----------------------------------------------------------------------------
00026 template <typename T>
00027 ModelTissueHiatusHernia01<T>::ModelTissueHiatusHernia01 (
00028         std::string data_location,      
00029         T Kpointmass,                   
00030         T Kstiffness,                   
00031         T Kdamper,                      
00032         T HomeKstiffness,               
00033         T HomeKdamper,                  
00034         int rigidity,                   
00035         T predefinedTimeStep,           
00036         int numSimSubSteps              
00037 )
00038     : ModelForSurgery<T>( data_location, TISSUE_HIATUS_HERNIA_01, Kpointmass, Kstiffness, Kdamper, HomeKstiffness, HomeKdamper, predefinedTimeStep, numSimSubSteps )
00039 {
00040     Init( rigidity );
00041 }
00042 
00043 //-----------------------------------------------------------------------------
00044 template <typename T>
00045 ModelTissueHiatusHernia01<T>::~ModelTissueHiatusHernia01 ()
00046 {}
00047 
00048 //-----------------------------------------------------------------------------
00049 template <typename T>
00050 std::string ModelTissueHiatusHernia01<T>::StrInfo () const
00051 {
00052     std::ostringstream ss;
00053     ss << "ModelTissueHiatusHernia01<" << typeid(T).name() << ">";
00054     return ss.str();
00055 }
00056 
00057 //-----------------------------------------------------------------------------
00058 template <typename T>
00059 bool ModelTissueHiatusHernia01<T>::Init ( int rigidity )
00060 {
00061     std::string fileModel( m_strDataLocation + "/TissueHiatusHernia01.ASE" );
00062 
00063     #if defined(__gl_h_) || defined(__GL_H__)
00064     OpenGL::OpenGLHETriMeshOneModelMultiParts<T> * pModel = new OpenGL::OpenGLHETriMeshOneModelMultiParts<T>();
00065     #endif
00066 
00067     if ( !ReadModels<T>::readFile( fileModel.c_str(), pModel ) ) {
00068         std::cout << "ERROR: In Reading File (" << fileModel << ")!" << std::endl;
00069         exit ( EXIT_FAILURE );
00070         return false;
00071     }
00072     else {
00073         #ifdef  TAPs_DEBUG_MODE
00074         #endif//TAPs_DEBUG_MODE
00075 
00076         //pModel->GetTransform().ApplyTranslation( vLeftCenter );
00077         //pModel->GetTransform().ApplyRotationAxisAndAngle( Vector3<T>(0,1,0), vLeftRotationAngle[1] );
00078         //pModel->GetTransform().ApplyScale( vLeftScale );
00079         //pModel->ApplyAndResetTransform();
00080 
00081         pModel->BuildBVHTree( TAPs::Enum::BVH_TREE_BINARY_SPHERE );
00082         pModel->CalAndSetNormals();
00083         pModel->CreateMeshSprings( m_tPtMass, m_tKStiffness, m_tKDamper, m_tHomeKStiffness, m_tHomeKDamper, rigidity, m_tPredefinedTimeStep, m_iNumSimSubSteps );
00084 
00085         m_Parts.push_back( pModel );
00086 
00087         //---------------------------------------
00088         //MemorizeOriginalVertices( leftTube, originalLeftBloodVesselVertices );
00089         return true;
00090     }
00091 }
00092 
00093 //-----------------------------------------------------------------------------
00094 //=============================================================================
00095 END_NAMESPACE_TAPs
00096 //34567890123456789012345678901234567890123456789012345678901234567890123456789
00097 //--+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines