vtf-logo

HDSHalfedge.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00008 #if !defined(__HDSHalfedge_h__)
00009 #define __HDSHalfedge_h__
00010 
00011 #include "../defs.h"
00012 
00013 BEGIN_NAMESPACE_ADS
00014 
00016 
00021 template <class HDS>
00022 class HDSHalfedge
00023 {
00024 public:
00025 
00026   //
00027   // Types
00028   //
00029 
00031   typedef typename HDS::Vertex_handle Vertex_handle;
00033   typedef typename HDS::Vertex_const_handle Vertex_const_handle;
00034 
00036   typedef typename HDS::Halfedge_handle Halfedge_handle;
00038   typedef typename HDS::Halfedge_const_handle Halfedge_const_handle;
00039 
00041   typedef typename HDS::Face_handle Face_handle;
00043   typedef typename HDS::Face_const_handle Face_const_handle;
00044 
00045 private:
00046       
00047   //
00048   // Data
00049   //
00050       
00051   Halfedge_handle _opposite, _prev, _next;
00052   Vertex_handle _vertex;
00053   Face_handle _face;
00054 
00055 public:
00056 
00057   //
00058   // Constructors and Destructor
00059   //
00060 
00062   HDSHalfedge()
00063   {}
00064 
00066   HDSHalfedge( const HDSHalfedge& x ) :
00067     _opposite( x._opposite ),
00068     _prev( x._prev ),
00069     _next( x._next ),
00070     _vertex( x._vertex ),
00071     _face( x._face )
00072   {}
00073 
00075   ~HDSHalfedge()
00076   {}
00077 
00078   //
00079   // Assignment operators.
00080   //
00081       
00083   HDSHalfedge& 
00084   operator=( const HDSHalfedge& x )
00085   {
00086     if ( &x != this ) {
00087       _opposite = x._opposite;
00088       _prev = x._prev;
00089       _next = x._next;
00090       _vertex = x._vertex;
00091       _face = x._face;
00092     }
00093     return *this;
00094   }
00095 
00096   //  
00097   // Accessors
00098   //
00099 
00101   Halfedge_const_handle
00102   opposite() const
00103   { 
00104     return _opposite;
00105   }
00106 
00108   Halfedge_const_handle
00109   prev() const
00110   { 
00111     return _prev;
00112   }
00113 
00115   Halfedge_const_handle
00116   next() const
00117   { 
00118     return _next;
00119   }
00120 
00122   Vertex_const_handle
00123   vertex() const
00124   { 
00125     return _vertex;
00126   }
00127 
00129   Face_const_handle
00130   face() const
00131   { 
00132     return _face;
00133   }
00134 
00135   //  
00136   // Manipulators
00137   //
00138 
00140   Halfedge_handle&
00141   opposite()
00142   { 
00143     return _opposite;
00144   }
00145 
00147   Halfedge_handle&
00148   prev()
00149   { 
00150     return _prev;
00151   }
00152 
00154   Halfedge_handle&
00155   next()
00156   { 
00157     return _next;
00158   }
00159 
00161   Vertex_handle&
00162   vertex()
00163   { 
00164     return _vertex;
00165   }
00166 
00168   Face_handle&
00169   face()
00170   { 
00171     return _face;
00172   }
00173 
00174 };
00175 
00176 //
00177 // Equality operators.
00178 //
00179 
00180 /* REMOVE
00182 template <class HDS>
00183 bool 
00184 operator==( const HDSHalfedge<HDS>& a, const HDSHalfedge<HDS>& b )
00185 {
00186 return ( a.index() == b.index() &&
00187 a.opposite()->index() == b.opposite()->index() &&
00188 a.prev()->index() == b.prev()->index() &&
00189 a.next()->index() == b.next()->index() &&
00190 a.vertex()->index() == b.vertex()->index() &&
00191 a.face()->index() == b.face()->index() );
00192 }
00193 
00195 template <class HDS>
00196 bool 
00197 operator!=( const HDSHalfedge<HDS>& a, const HDSHalfedge<HDS>& b )
00198 {
00199   return !(a == b );
00200 }
00201 */
00202 
00203 END_NAMESPACE_ADS
00204 
00205 #endif

Generated on Fri Aug 24 12:55:24 2007 for Algorithms and Data Structures Package by  doxygen 1.4.7