The Parametric Pseudo-Manifold (PPS) Library 1.0
edge.h
Go to the documentation of this file.
00001 
00026 #ifndef EDGE_H
00027 #define EDGE_H
00028 
00029 
00046 namespace dcel {
00047 
00051   template < 
00052              typename VAttrib ,
00053              typename FAttrib ,
00054              typename EAttrib ,
00055              typename HAttrib
00056            >
00057   class Halfedge ;
00058 
00059 
00066   template < 
00067              typename VAttrib ,
00068              typename FAttrib ,
00069              typename EAttrib ,
00070              typename HAttrib
00071            >
00072   class Edge {
00073   public:
00074     // ---------------------------------------------------------------
00075     //
00076     // Type definitions
00077     //
00078     // ---------------------------------------------------------------
00079 
00086     typedef dcel::Halfedge< VAttrib, FAttrib , EAttrib , HAttrib > 
00087       Halfedge ;
00088 
00089 
00090     // ---------------------------------------------------------------
00091     //
00092     // Public methods
00093     //
00094     // ---------------------------------------------------------------
00095 
00104     Edge(
00105          Halfedge* h1 ,
00106          Halfedge* h2
00107         )
00108     {
00109       set_first_halfedge( h1 ) ;
00110       set_second_halfedge( h2 ) ;
00111     }
00112 
00113 
00119     ~Edge()
00120     {
00121       set_first_halfedge( 0 ) ;
00122       set_second_halfedge( 0 ) ;
00123     }
00124 
00125 
00133     Halfedge* get_first_halfedge() const
00134     {
00135       return _h1 ; 
00136     }
00137 
00138 
00146     Halfedge* get_second_halfedge() const
00147     {
00148       return _h2 ; 
00149     }
00150 
00151 
00161     bool is_boundary_edge() const
00162     {
00163       return ( _h1 == 0 ) || ( _h2 == 0 ) ;
00164     }
00165 
00166 
00175     void set_first_halfedge( Halfedge* h ) 
00176     {
00177       _h1 = h ; 
00178     }
00179 
00180 
00189     void set_second_halfedge( Halfedge* h ) 
00190     {
00191       _h2 = h ; 
00192     }
00193 
00194 
00203     EAttrib& get_attributes()
00204     {
00205       return _attributes ; 
00206     }
00207 
00208  
00209 
00210   private:
00211     // ---------------------------------------------------------------
00212     //
00213     // Private data members
00214     //
00215     // ---------------------------------------------------------------
00216 
00217     Halfedge* _h1 ;  
00218 
00219     Halfedge* _h2 ;  
00220 
00221     EAttrib _attributes ;  
00222 
00223   } ;
00224 
00225 }
00226  //end of group class.
00228 
00229 #endif   // EDGE_H