![]() |
TAPs 0.7.7.3
|
00001 /****************************************************************************** 00002 TAPsOpenWound_TycoEndostitch_V2.hpp 00003 ******************************************************************************/ 00007 /****************************************************************************** 00008 SUKITTI PUNAK (06/15/2010) 00009 UPDATE (03/02/2011) 00010 ******************************************************************************/ 00011 #ifndef TAPs_OPENWOUND_TYCOENDOSTICH_V2_HPP 00012 #define TAPs_OPENWOUND_TYCOENDOSTICH_V2_HPP 00013 00014 #include "../../Model/TAPsModelDefBasedOnFEMHex.hpp" 00015 00016 BEGIN_NAMESPACE_TAPs 00017 //============================================================================= 00018 template <typename T, typename DATA> 00019 class OpenWound_TycoEndostitch_V2 : public /*virtual*/ ModelDefBasedOnFEMHex<T,DATA> { 00020 //============================================================================= 00021 public: 00022 // Member Functions ------------------------------------------------------- 00024 friend std::ostream & operator<< ( std::ostream &output, OpenWound_TycoEndostitch_V2<T,DATA> const &obj ) 00025 { 00026 output << obj.StrInfo(); 00027 return output; 00028 } 00029 //------------------------------------------------------------------------- 00031 OpenWound_TycoEndostitch_V2 (std::string const & modelFile ); 00033 virtual ~OpenWound_TycoEndostitch_V2 (); 00034 //------------------------------------------------------------------------- 00036 virtual std::string StrInfo () const; 00037 00038 //========================================================================= 00039 // Simulation 00040 //------------------------------------------------------------------------- 00041 00043 void ClearAllPunctureInfo (); 00044 00046 unsigned int GetNumOfPointClues () const { return m_SetOfPointClues.size(); } 00048 unsigned int GetNumOfPuncturedPointsOnSurface () const { return m_SetOfPuncturedPoints.size(); } 00049 00051 std::vector< HEVertex<T> * > const & RefToPuncturedPointsOnSurface () const { return m_SetOfPuncturedPoints; } 00052 00054 HEVertex<T> * GetPuncturedPointOnSurface ( unsigned int i ); 00055 00057 unsigned int GetNumOfPuncturedLocationInsideModel () const { return m_SetOfExtraVertices.size(); } 00059 HEVertex<T> * GetPuncturedLocationInsideModel ( unsigned int i ); 00060 00064 void AddPuncturedPoint ( HEVertex<T> * pV ); 00068 void DeleteTheLastPuncturedPoint (); 00070 void ClearAllPuncturedPoints (); 00071 00073 void AddPointClue ( unsigned int vertexNumber ); 00075 void ClearAllPointClues (); 00076 00078 void PairTwoPuncturedPoints ( unsigned int pt1, unsigned int pt2 ); 00079 00081 void AddInterpolatedPuncturedLocations ( 00082 int sutureID, 00083 int suturePa, 00084 int suturePb, 00085 int modelID, 00086 HEVertex<T> * pModelVa, 00087 HEVertex<T> * pModelVb, 00088 int ListOfSuturePts[], 00089 HEVertex<T> * ListOfInterpolatedPuncturedLocations[], 00090 int & numOfPts, 00091 T * pMinIntervalDistance = NULL 00092 ); 00094 void ClearAllPuncturedLocations (); 00095 00096 //------------------------------------------------------------------------- 00097 //========================================================================= 00098 00099 // Data Members ----------------------------------------------------------- 00100 //============================================================================= 00101 protected: 00102 // Member Functions ------------------------------------------------------- 00103 // Data Members ----------------------------------------------------------- 00104 std::vector< HEVertex<T> * > m_SetOfPointClues; 00105 std::vector< HEVertex<T> * > m_SetOfPuncturedPoints; 00106 00108 class PairPuncturedPoints { 00109 public: 00111 PairPuncturedPoints ( unsigned int p1, unsigned int p2 ) 00112 : P1( p1 ), P2( p2 ) {} 00113 unsigned int P1; 00114 unsigned int P2; 00115 }; 00116 std::vector< PairPuncturedPoints > m_SetOfPairPuncturedPoints; 00117 00118 // Puncture locations are designed to be inside the FEM mesh. 00119 // Each puncture location is accompanied by a HexBarycentricCoordsForVertexRef<T,DATA>. 00120 //std::vector< HEVertex<T> * > m_SetOfCreatedPuncturedLocations; //!< the set of puncture locations 00121 //std::vector< HexBarycentricCoordsForVertexRef<T,DATA> * > m_SetOfCreatedPunctureCoords; //!< the set of puncture coordinates 00122 00123 //============================================================================= 00124 private: 00125 // Member Functions ------------------------------------------------------- 00126 // Data Members ----------------------------------------------------------- 00127 //============================================================================= 00128 00129 #if defined(__gl_h_) || defined(__GL_H__) 00130 public: 00132 void Draw ( OpenGL::Enum::DrawMode DM = OpenGL::Enum::POLYGON ); 00133 00135 void DrawAllPuncturedPoints (); 00136 00138 void DrawAllPuncturedLocations (); 00139 00141 void DrawAllPointClues (); 00142 00144 void DrawPointClue ( unsigned int i ); 00145 00147 void DrawASphereOnVertex ( HEVertex<T> * pV ); 00148 00150 void DrawAllPuncturedPointPairs (); 00151 00152 #endif 00153 00154 //============================================================================= 00155 }; // END CLASS OpenWound_TycoEndostitch_V2 00156 //============================================================================= 00157 //----------------------------------------------------------------------------- 00158 //============================================================================= 00159 END_NAMESPACE_TAPs 00160 //----------------------------------------------------------------------------- 00162 #include "TAPsOpenWound_TycoEndostitch_V2.cpp" 00163 00165 // Include definition if TAPs_USE_EXPORT is not defined 00166 //#if !defined( TAPs_USE_EXPORT ) 00167 // #include "TAPsOpenWound_TycoEndostitch_V2.cpp" 00168 //#endif 00169 //----------------------------------------------------------------------------- 00170 #endif 00171 //34567890123456789012345678901234567890123456789012345678901234567890123456789 00172 //--+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----