TAPs 0.7.7.3
TAPsKnotTrackingConstraint.cpp
Go to the documentation of this file.
00001 /******************************************************************************
00002 TAPsKnotTrackingConstraint.cpp
00003 ******************************************************************************/
00007 /******************************************************************************
00008 SUKITTI PUNAK   (11/05/2010)
00009 UPDATE          (11/10/2010)
00010 ******************************************************************************/
00011 #include "TAPsKnotTrackingConstraint.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__Data
00017 //=============================================================================
00018 // Constructors
00019 //-----------------------------------------------------------------------------
00020 template <typename T>
00021 KnotTrackingConstraint<T>::KnotTrackingConstraint ( enum DatabaseDowkerNotation::KNOT knot )
00022 {
00023     SetTrackedKnotType( knot );
00024 }
00025 //-----------------------------------------------------------------------------
00026 template <typename T>
00027 KnotTrackingConstraint<T>::~KnotTrackingConstraint ()
00028 {}
00029 //-----------------------------------------------------------------------------
00030 template <typename T>
00031 std::string KnotTrackingConstraint<T>::StrInfo () const
00032 {
00033     std::ostringstream ss;
00034     ss << "KnotTrackingConstraint<" << typeid(T).name() << ">";
00035     return ss.str();
00036 }
00037 //-----------------------------------------------------------------------------
00038 template <typename T>
00039 void KnotTrackingConstraint<T>::SetTrackedKnotType ( enum DatabaseDowkerNotation::KNOT knot )
00040 {
00041     switch ( m_Knot ) {
00042     case DatabaseDowkerNotation::HALF_NEG:
00043         m_LoHiPairs.resize( 3 );
00044         break;
00045     case DatabaseDowkerNotation::HALF_POS:
00046         m_LoHiPairs.resize( 3 );
00047         break;
00048     case DatabaseDowkerNotation::DOUBLE_NEG:
00049         m_LoHiPairs.resize( 5 );
00050         break;
00051     case DatabaseDowkerNotation::DOUBLE_POS:
00052         m_LoHiPairs.resize( 5 );
00053         break;
00054     default:
00055         #ifdef  TAPs_USE_WXWIDGETS
00056         {
00057             std::stringstream ss;
00058             ss << "Tracking knot type (" << knot << ") is not supported!";
00059             wxMessageDialog( NULL, ss.str(), "Info", wxOK );
00060         }
00061         #else //TAPs_USE_WXWIDGETS
00062             std::cout << "Tracking knot type (" << knot << ") is not supported!";
00063         #endif//TAPs_USE_WXWIDGETS
00064         break;
00065     }
00066 }
00067 //-----------------------------------------------------------------------------
00068 template <typename T>
00069 void KnotTrackingConstraint<T>::AddPair ( int low, int high )
00070 {
00071     m_LoHiPairs.push_back( LoHiPair( low, high ) );
00072 }
00073 //-----------------------------------------------------------------------------
00074 template <typename T>
00075 void KnotTrackingConstraint<T>::InsertPair ( int low, int high )
00076 {
00077     m_LoHiPairs.insert( m_LoHiPairs.begin(), LoHiPair( low, high ) );
00078 }
00079 //-----------------------------------------------------------------------------
00080 //=============================================================================
00081 
00082 
00083 //=============================================================================
00084 // OpenGL
00085 #if defined(__gl_h_) || defined(__GL_H__)
00086 template <typename T>
00087 void KnotTrackingConstraint<T>::Draw () const
00088 {
00089 }
00090 //-----------------------------------------------------------------------------
00091 #endif  // OpenGL
00092 //=============================================================================
00093 
00094 
00095 //=============================================================================
00096 END_NAMESPACE_TAPs__Data
00097 //34567890123456789012345678901234567890123456789012345678901234567890123456789
00098 //--+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines