![]() |
TAPs 0.7.7.3
|
00001 /****************************************************************************** 00002 TAPsDatabaseDowkerNotation.hpp 00003 00005 00006 SUKITTI PUNAK (04/25/2008) 00007 UPDATE (12/09/2010) 00008 ******************************************************************************/ 00009 #ifndef TAPs_DATABASE_DOWKER_NOTATION_HPP 00010 #define TAPs_DATABASE_DOWKER_NOTATION_HPP 00011 00012 #include "../Core/TAPsStdLib.hpp" 00013 00014 BEGIN_NAMESPACE_TAPs__Data 00015 //============================================================================= 00016 class DatabaseDowkerNotation { 00017 //============================================================================= 00018 public: 00019 // Member Functions ------------------------------------------------------- 00021 friend std::ostream & operator<< ( std::ostream &output, DatabaseDowkerNotation const &data ) 00022 { 00023 output << "DatabaseDowkerNotation contains:"; 00024 for ( unsigned int i = 0; i < LIST_SIZE; ++i ) { 00025 if ( i % 8 == 0 ) output << "\n\t"; 00026 else output << " "; 00027 output << KnotNames[i]; 00028 } 00029 output << "\n"; 00030 return output; 00031 } 00032 00034 static const int * GetEntry ( unsigned int i ) 00035 { 00036 if ( i >= DATA_LIST_SIZE ) return EntryAccess[DATA_LIST_SIZE]; 00037 return EntryAccess[i]; 00038 } 00039 00041 static std::string const & GetKnotName ( unsigned int i ) 00042 { 00043 if ( i >= LIST_SIZE ) return KnotNames[LIST_SIZE]; 00044 return KnotNames[i]; 00045 } 00046 00048 static std::string GetStrEntry ( unsigned int ); 00049 00058 static int FindKnotOfDowkerNotation ( 00059 unsigned int numPairs, int * dowkerNotation, 00060 std::string * knotName = NULL 00061 ); 00062 00063 //------------------------------------------------------------------------- 00064 // Data Members ----------------------------------------------------------- 00069 enum KNOT { 00070 UNDEFINED = -1, 00071 HALF_NEG = 0, HALF_POS, 00072 DOUBLE_NEG, DOUBLE_POS, 00073 SQUARE_NEG, SQUARE_POS, 00074 SURGEONS_NEG, SURGEONS_POS, 00075 00076 HALF_NEG_WITH_A_CROSS_NEG, 00077 HALF_NEG_WITH_A_CROSS_POS, 00078 HALF_POS_WITH_A_CROSS_NEG, 00079 HALF_POS_WITH_A_CROSS_POS, 00080 00081 // For fixing/forming the knot shape -- do not include in knot checking 00082 HALF_NEG_FOLLOWED_BY_HALF_NEG, 00083 HALF_NEG_FOLLOWED_BY_HALF_POS, // same as SQUARE_NEG 00084 HALF_POS_FOLLOWED_BY_HALF_NEG, // same as SQUARE_POS 00085 HALF_POS_FOLLOWED_BY_HALF_POS, 00086 DOUBLE_NEG_FOLLOWED_BY_HALF_NEG, 00087 DOUBLE_NEG_FOLLOWED_BY_HALF_POS, // same as SURGEON_NEG 00088 DOUBLE_POS_FOLLOWED_BY_HALF_NEG, // same as SURGEON_POS 00089 DOUBLE_POS_FOLLOWED_BY_HALF_POS, 00090 }; 00091 //------------------------------------------------------------------------- 00092 //============================================================================= 00093 protected: 00094 // Member Functions ------------------------------------------------------- 00095 //------------------------------------------------------------------------- 00096 // Data Members ----------------------------------------------------------- 00097 //------------------------------------------------------------------------- 00098 //============================================================================= 00099 private: 00100 // Member Functions ------------------------------------------------------- 00101 //------------------------------------------------------------------------- 00102 // Data Members ----------------------------------------------------------- 00111 static const std::string KnotNames[]; 00112 static const unsigned int LIST_SIZE; 00113 static const unsigned int DATA_LIST_SIZE; 00114 static const int HalfNeg[]; 00115 static const int HalfPos[]; 00116 static const int DoubleNeg[]; 00117 static const int DoublePos[]; 00118 static const int SquareNeg[]; 00119 static const int SquarePos[]; 00120 static const int SurgeonsKnotNeg[]; 00121 static const int SurgeonsKnotPos[]; 00122 00123 static const int HalfNeg_WithA_CrossNeg[]; 00124 static const int HalfNeg_WithA_CrossPos[]; 00125 static const int HalfPos_WithA_CrossNeg[]; 00126 static const int HalfPos_WithA_CrossPos[]; 00127 00128 static const int UndefinedData[]; 00129 00130 //static int DN_#_Pos_#[] = { #, ..., # }; 00131 00132 static int const * const EntryAccess[]; 00133 //------------------------------------------------------------------------- 00134 //============================================================================= 00135 }; // END CLASS Skeleton 00136 //============================================================================= 00137 //============================================================================= 00138 END_NAMESPACE_TAPs__Data 00139 //----------------------------------------------------------------------------- 00140 // Include definition if TAPs_USE_EXPORT is not defined 00141 #if !defined( TAPs_USE_EXPORT ) 00142 #include "TAPsDatabaseDowkerNotation.cpp" 00143 #endif 00144 //----------------------------------------------------------------------------- 00145 #endif 00146 //34567890123456789012345678901234567890123456789012345678901234567890123456789 00147 //--+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----