![]() |
TAPs 0.7.7.3
|
00001 /****************************************************************************** 00002 TAPsHEHalfEdge.hpp 00003 00004 HE <==> Half-Edge 00005 HEHalfEdge class is a class for 3D half-edge. 00006 It contains: 00007 - originating vertex 00008 - incident face 00009 - pair of this half-edge 00010 - next half-edge (CCW) 00011 - previous half-edge (CW) 00012 00013 Not supposed to be a parent class. 00014 Support only manifold objects. 00015 00016 SUKITTI PUNAK (04/03/2005) 00017 UPDATE (10/26/2010) 00018 ******************************************************************************/ 00019 #ifndef TAPs_HE_HALF_EDGE_HPP 00020 #define TAPs_HE_HALF_EDGE_HPP 00021 00022 #include "../../Core/TAPsLib.hpp" 00023 00024 template <typename T> class HEVertex; 00025 template <typename T> class HEFace; 00026 00027 BEGIN_NAMESPACE_TAPs 00028 //============================================================================= 00029 template <typename T> 00030 class HEHalfEdge { 00031 //============================================================================= 00032 // DATA MEMBERS 00033 //============================================================================= 00034 protected: 00035 HEVertex<T> *nOrigVertex; // originated from vertex 00036 HEFace<T> *nIncidentFace; // incident face -- the face that contains this half-edge 00037 HEHalfEdge<T> *nPrev; // previous half-edge (cw direction) 00038 HEHalfEdge<T> *nNext; // next half-edge (ccw direction) 00039 HEHalfEdge<T> *nPair; // twin or pair of this half-edge 00040 // in a doubly circular linked list 00041 //============================================================================= 00042 // MEMBER FUNCTIONS 00043 //============================================================================= 00044 public: 00045 //------------------------------------------------------------------------- 00046 // Output Operator << 00047 friend std::ostream & operator<< ( std::ostream &output, 00048 HEHalfEdge<T> const &he ) 00049 { 00050 output << "HEHalfEdge: address " << &he 00051 << ", orig vertex " << (he.nOrigVertex) 00052 << ", incident face " << (he.nIncidentFace) 00053 << ", previous " << (he.nPrev) 00054 << ", next " << (he.nNext) 00055 << ", pair " << (he.nPair); 00056 return output; 00057 } 00058 //------------------------------------------------------------------------- 00059 // Constructor(s) and Destructor 00060 HEHalfEdge ( HEVertex<T> * const nOrigVertex = NULL, 00061 HEFace<T> * const nIncidentFace = NULL, 00062 HEHalfEdge<T> * const nPrev = NULL, 00063 HEHalfEdge<T> * const nNext = NULL, 00064 HEHalfEdge<T> * const nPair = NULL ); 00065 HEHalfEdge ( HEHalfEdge<T> const &he ); // copy ctor 00066 virtual ~HEHalfEdge (); // destructor 00067 //------------------------------------------------------------------------- 00068 // Get/Set Fn(s) 00069 00071 inline void Vertex ( HEVertex<T> * const ptrOrigVertex ) { nOrigVertex = ptrOrigVertex; } 00073 inline HEVertex<T> * Vertex () const { return nOrigVertex; } 00075 inline void Face ( HEFace<T> * const ptrIncidentFace ) { nIncidentFace = ptrIncidentFace; } 00077 inline HEFace<T> * Face () const { return nIncidentFace; } 00079 inline void Pair ( HEHalfEdge<T> * const pair ) { nPair = pair; } 00081 inline HEHalfEdge<T> * Pair () const { return nPair; } 00082 00083 //------------------------------------------------------------------------- 00084 // Operations 00085 00087 inline HEHalfEdge<T> * Prev () const { return nPrev; } 00089 inline HEHalfEdge<T> * Next () const { return nNext; } 00091 inline void Prev ( HEHalfEdge<T> * const v ) { nPrev = v; } 00093 inline void Next ( HEHalfEdge<T> * const v ) { nNext = v; } 00094 00095 // Since HalfEdge comes in pair, 00096 // so we disable insert, remove, delete, and splice 00097 /* 00098 HEHalfEdge<T> * Insert ( HEHalfEdge<T> * const n ); 00099 HEHalfEdge<T> * Remove (); 00100 inline void Delete (); 00101 HEHalfEdge<T> * Splice ( HEHalfEdge<T> * const n ); 00102 void ClearExceptItself (); 00103 //*/ 00104 00105 //------------------------------------------------------------------------- 00106 }; // END CLASS HEHalfEdge 00107 //============================================================================= 00108 END_NAMESPACE_TAPs 00109 //----------------------------------------------------------------------------- 00110 // Include definition if TAPs_USE_EXPORT is not defined 00111 //#if !defined( TAPs_USE_EXPORT ) 00112 #include "TAPsHEHalfEdge.cpp" 00113 //#endif 00114 //----------------------------------------------------------------------------- 00115 #endif 00116 //345678901234567890123456789012345678901234567890123456789012345678901234567890 00117 //--+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8