![]() |
TAPs 0.7.7.3
|
00001 /****************************************************************************** 00002 TAPsHEFaceList.hpp 00003 00004 Class HEFaceList is a doubly linked list for HEFace (half-edge node). 00005 00006 SUKITTI PUNAK (04/05/2005) 00007 UPDATE (04/10/2005) 00008 ******************************************************************************/ 00009 #ifndef TAPs_HE_FACE_LIST_HPP 00010 #define TAPs_HE_FACE_LIST_HPP 00011 00012 #include "TAPsHEFace.hpp" 00013 00014 BEGIN_NAMESPACE_TAPs 00015 //============================================================================= 00016 template <typename T> 00017 class HEFaceList { 00018 //============================================================================= 00019 // DATA MEMBERS 00020 //============================================================================= 00021 protected: 00022 int m_iLength; // number of nodes in the list 00023 HEFace<T> * pHead; // ptr to header node 00024 HEFace<T> * pTail; // ptr to tail node 00025 HEFace<T> * pCurrent; // ptr to a (current) node in the list 00026 //============================================================================= 00027 // MEMBER FUNCTIONS 00028 //============================================================================= 00029 public: 00030 //------------------------------------------------------------------------- 00031 // Constructor(s) and Destructor 00032 HEFaceList (); 00033 virtual ~HEFaceList (); 00034 //------------------------------------------------------------------------- 00035 // Operations 00036 inline int Length () const { return m_iLength; } 00037 inline int Size () const { return m_iLength; } 00038 inline bool IsEmpty () const { return pHead == NULL ? true : false; } 00039 //inline HEFace<T> * Head () const { return pHead; } 00040 //inline HEFace<T> * Tail () const { return pTail; } 00041 inline HEFace<T> * Current () const { return pCurrent; } 00042 inline void Current ( HEFace<T> * const n ) { pCurrent = n; } 00043 inline HEFace<T> * Head () { pCurrent = pHead; return pCurrent; } 00044 inline HEFace<T> * Tail () { pCurrent = pTail; return pCurrent; } 00045 inline HEFace<T> * NextCurrent () { pCurrent = pCurrent->Next(); return pCurrent; } 00046 inline HEFace<T> * PrevCurrent () { pCurrent = pCurrent->Prev(); return pCurrent; } 00047 inline bool IsHead () const { return pHead == pCurrent ? true : false; } 00048 inline bool IsTail () const { return pTail == pCurrent ? true : false; } 00049 void InsertBefore ( HEFace<T> * const n ); // insert before pCurrent 00050 void InsertAfter ( HEFace<T> * const n ); // insert after pCurrent 00051 void Prepend ( HEFace<T> * const n ); // insert at head 00052 void Append ( HEFace<T> * const n ); // insert at tail 00053 //------------------------------------------- 00054 // Caution pVertex must be from this list, 00055 // otherwise run time error will surely occur! 00056 inline HEFace<T> * Remove (); // remove at pCurrent 00057 HEFace<T> * Remove ( HEFace<T> * pFace ); // remove pFace 00058 inline void Delete ( HEFace<T> * pFace ); // delete pFace 00059 //------------------------------------------------------------------------- 00060 }; // END CLASS HEFaceList 00061 //============================================================================= 00062 END_NAMESPACE_TAPs 00063 //----------------------------------------------------------------------------- 00064 // Include definition if TAPs_USE_EXPORT is not defined 00065 //#if !defined( TAPs_USE_EXPORT ) 00066 #include "TAPsHEFaceList.cpp" 00067 //#endif 00068 //----------------------------------------------------------------------------- 00069 #endif 00070 //345678901234567890123456789012345678901234567890123456789012345678901234567890 00071 //--+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8