The Parametric Pseudo-Manifold (PPS) Library 1.0
|
00001 00026 #ifndef VERTEX_H 00027 #define VERTEX_H 00028 00029 00045 namespace dcel { 00046 00050 template < 00051 typename VAttrib , 00052 typename FAttrib , 00053 typename EAttrib , 00054 typename HAttrib 00055 > 00056 class Halfedge ; 00057 00058 00066 template < 00067 typename VAttrib , 00068 typename FAttrib , 00069 typename EAttrib , 00070 typename HAttrib 00071 > 00072 class Vertex { 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 00108 Vertex( 00109 double x , 00110 double y , 00111 double z , 00112 Halfedge* h 00113 ) 00114 { 00115 set_x_coord( x ) ; 00116 set_y_coord( y ) ; 00117 set_z_coord( z ) ; 00118 set_halfedge( h ) ; 00119 } 00120 00121 00128 ~Vertex() 00129 { 00130 set_halfedge( 0 ) ; 00131 } 00132 00133 00143 double x() const 00144 { 00145 return _x ; 00146 } 00147 00148 00158 void set_x_coord( double x ) 00159 { 00160 _x = x ; 00161 } 00162 00163 00173 double y() const 00174 { 00175 return _y ; 00176 } 00177 00178 00188 void set_y_coord( double y ) 00189 { 00190 _y = y ; 00191 } 00192 00193 00203 double z() const 00204 { 00205 return _z ; 00206 } 00207 00208 00218 void set_z_coord( double z ) 00219 { 00220 _z = z ; 00221 } 00222 00223 00233 Halfedge* get_halfedge() const 00234 { 00235 return _halfedge ; 00236 } 00237 00238 00246 void set_halfedge( Halfedge* h ) 00247 { 00248 _halfedge = h ; 00249 } 00250 00251 00261 VAttrib& get_attributes() 00262 { 00263 return _attributes ; 00264 } 00265 00266 00267 00268 private: 00269 // --------------------------------------------------------------- 00270 // 00271 // Private data members 00272 // 00273 // --------------------------------------------------------------- 00274 00275 double _x ; 00276 double _y ; 00277 double _z ; 00278 00279 Halfedge* _halfedge ; 00280 00281 VAttrib _attributes ; 00282 00283 } ; 00284 00285 } 00286 //end of group class. 00288 00289 #endif // VERTEX_H