OpenMesh
|
00001 /*===========================================================================*\ 00002 * * 00003 * OpenMesh * 00004 * Copyright (C) 2001-2011 by Computer Graphics Group, RWTH Aachen * 00005 * www.openmesh.org * 00006 * * 00007 *---------------------------------------------------------------------------* 00008 * This file is part of OpenMesh. * 00009 * * 00010 * OpenMesh is free software: you can redistribute it and/or modify * 00011 * it under the terms of the GNU Lesser General Public License as * 00012 * published by the Free Software Foundation, either version 3 of * 00013 * the License, or (at your option) any later version with the * 00014 * following exceptions: * 00015 * * 00016 * If other files instantiate templates or use macros * 00017 * or inline functions from this file, or you compile this file and * 00018 * link it with other files to produce an executable, this file does * 00019 * not by itself cause the resulting executable to be covered by the * 00020 * GNU Lesser General Public License. This exception does not however * 00021 * invalidate any other reasons why the executable file might be * 00022 * covered by the GNU Lesser General Public License. * 00023 * * 00024 * OpenMesh is distributed in the hope that it will be useful, * 00025 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00026 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00027 * GNU Lesser General Public License for more details. * 00028 * * 00029 * You should have received a copy of the GNU LesserGeneral Public * 00030 * License along with OpenMesh. If not, * 00031 * see <http://www.gnu.org/licenses/>. * 00032 * * 00033 \*===========================================================================*/ 00034 00035 /*===========================================================================*\ 00036 * * 00037 * $Revision: 517 $ * 00038 * $Date: 2012-01-20 11:48:56 +0100 (Fr, 20 Jan 2012) $ * 00039 * * 00040 \*===========================================================================*/ 00041 00042 #ifndef OPENMESH_ATTRIBKERNEL_HH 00043 #define OPENMESH_ATTRIBKERNEL_HH 00044 00045 00046 //== INCLUDES ================================================================= 00047 00048 #include <OpenMesh/Core/Mesh/Attributes.hh> 00049 #include <OpenMesh/Core/Utils/GenProg.hh> 00050 #include <OpenMesh/Core/Utils/vector_traits.hh> 00051 #include <vector> 00052 #include <algorithm> 00053 00054 //== NAMESPACES =============================================================== 00055 00056 namespace OpenMesh { 00057 00058 00059 //== CLASS DEFINITION ========================================================= 00060 00069 template <class MeshItems, class Connectivity> 00070 class AttribKernelT : public Connectivity 00071 { 00072 public: 00073 00074 //---------------------------------------------------------------- item types 00075 00076 typedef typename Connectivity::Vertex Vertex; 00077 typedef typename Connectivity::Halfedge Halfedge; 00078 typedef typename Connectivity::Edge Edge; 00079 typedef typename Connectivity::Face Face; 00080 00081 typedef typename MeshItems::Point Point; 00082 typedef typename MeshItems::Normal Normal; 00083 typedef typename MeshItems::Color Color; 00084 typedef typename MeshItems::TexCoord1D TexCoord1D; 00085 typedef typename MeshItems::TexCoord2D TexCoord2D; 00086 typedef typename MeshItems::TexCoord3D TexCoord3D; 00087 typedef typename MeshItems::Scalar Scalar; 00088 typedef typename MeshItems::TextureIndex TextureIndex; 00089 00090 typedef typename MeshItems::VertexData VertexData; 00091 typedef typename MeshItems::HalfedgeData HalfedgeData; 00092 typedef typename MeshItems::EdgeData EdgeData; 00093 typedef typename MeshItems::FaceData FaceData; 00094 00095 typedef AttribKernelT<MeshItems,Connectivity> AttribKernel; 00096 00097 enum Attribs { 00098 VAttribs = MeshItems::VAttribs, 00099 HAttribs = MeshItems::HAttribs, 00100 EAttribs = MeshItems::EAttribs, 00101 FAttribs = MeshItems::FAttribs 00102 }; 00103 00104 typedef VPropHandleT<VertexData> DataVPropHandle; 00105 typedef HPropHandleT<HalfedgeData> DataHPropHandle; 00106 typedef EPropHandleT<EdgeData> DataEPropHandle; 00107 typedef FPropHandleT<FaceData> DataFPropHandle; 00108 00109 public: 00110 00111 //-------------------------------------------------- constructor / destructor 00112 00113 AttribKernelT() 00114 : refcount_vnormals_(0), 00115 refcount_vcolors_(0), 00116 refcount_vtexcoords1D_(0), 00117 refcount_vtexcoords2D_(0), 00118 refcount_vtexcoords3D_(0), 00119 refcount_htexcoords1D_(0), 00120 refcount_htexcoords2D_(0), 00121 refcount_htexcoords3D_(0), 00122 refcount_henormals_(0), 00123 refcount_hecolors_(0), 00124 refcount_ecolors_(0), 00125 refcount_fnormals_(0), 00126 refcount_fcolors_(0), 00127 refcount_ftextureIndex_(0) 00128 { 00129 add_property( points_, "v:points" ); 00130 00131 if (VAttribs & Attributes::Normal) 00132 request_vertex_normals(); 00133 00134 if (VAttribs & Attributes::Color) 00135 request_vertex_colors(); 00136 00137 if (VAttribs & Attributes::TexCoord1D) 00138 request_vertex_texcoords1D(); 00139 00140 if (VAttribs & Attributes::TexCoord2D) 00141 request_vertex_texcoords2D(); 00142 00143 if (VAttribs & Attributes::TexCoord3D) 00144 request_vertex_texcoords3D(); 00145 00146 if (HAttribs & Attributes::TexCoord1D) 00147 request_halfedge_texcoords1D(); 00148 00149 if (HAttribs & Attributes::TexCoord2D) 00150 request_halfedge_texcoords2D(); 00151 00152 if (HAttribs & Attributes::TexCoord3D) 00153 request_halfedge_texcoords3D(); 00154 00155 if (HAttribs & Attributes::Color) 00156 request_halfedge_colors(); 00157 00158 if (VAttribs & Attributes::Status) 00159 Connectivity::request_vertex_status(); 00160 00161 if (HAttribs & Attributes::Status) 00162 Connectivity::request_halfedge_status(); 00163 00164 if (HAttribs & Attributes::Normal) 00165 request_halfedge_normals(); 00166 00167 if (EAttribs & Attributes::Status) 00168 Connectivity::request_edge_status(); 00169 00170 if (EAttribs & Attributes::Color) 00171 request_edge_colors(); 00172 00173 if (FAttribs & Attributes::Normal) 00174 request_face_normals(); 00175 00176 if (FAttribs & Attributes::Color) 00177 request_face_colors(); 00178 00179 if (FAttribs & Attributes::Status) 00180 Connectivity::request_face_status(); 00181 00182 if (FAttribs & Attributes::TextureIndex) 00183 request_face_texture_index(); 00184 00185 //FIXME: data properties might actually cost storage even 00186 //if there are no data traits?? 00187 add_property(data_vpph_); 00188 add_property(data_fpph_); 00189 add_property(data_hpph_); 00190 add_property(data_epph_); 00191 } 00192 00193 virtual ~AttribKernelT() 00194 { 00195 // should remove properties, but this will be done in 00196 // BaseKernel's destructor anyway... 00197 } 00198 00199 // Martin: This below does not make any sense, right? 00200 // -------------------------------------------------------- copy & assignment 00201 // AttribKernelT(const AttribKernelT& _rhs) 00202 // : BaseKernel(_rhs) 00203 // { operator=(_rhs); } 00204 // 00205 // AttribKernelT& operator=(const AttribKernelT& _rhs) 00206 // { 00207 // // remove old properties 00208 // remove_property(points_); 00209 // remove_property(vertex_normals_); 00210 // remove_property(vertex_colors_); 00211 // remove_property(vertex_texcoords_); 00212 // remove_property(vertex_status_); 00213 // remove_property(halfedge_status_); 00214 // remove_property(edge_status_); 00215 // remove_property(face_normals_); 00216 // remove_property(face_colors_); 00217 // remove_property(face_status_); 00218 // 00219 // // parent deep-copies properties 00220 // BaseKernel::operator=(_rhs); 00221 // 00222 // // copy property handles 00223 // points_ = _rhs.points_; 00224 // vertex_normals_ = _rhs.vertex_normals_; 00225 // vertex_colors_ = _rhs.vertex_colors_; 00226 // vertex_texcoords_ = _rhs.vertex_texcoords_; 00227 // vertex_status_ = _rhs.vertex_status_; 00228 // halfedge_status_ = _rhs.halfedge_status_; 00229 // edge_status_ = _rhs.edge_status_; 00230 // face_normals_ = _rhs.face_normals_; 00231 // face_colors_ = _rhs.face_colors_; 00232 // face_status_ = _rhs.face_status_; 00233 // 00234 // // copy ref-counts 00235 // refcount_vnormals_ = _rhs.refcount_vnormals_; 00236 // refcount_vcolors_ = _rhs.refcount_vcolors_; 00237 // refcount_vtexcoords_ = _rhs.refcount_vtexcoords_; 00238 // refcount_vstatus_ = _rhs.refcount_vstatus_; 00239 // refcount_hstatus_ = _rhs.refcount_hstatus_; 00240 // refcount_estatus_ = _rhs.refcount_estatus_; 00241 // refcount_fnormals_ = _rhs.refcount_fnormals_; 00242 // refcount_fcolors_ = _rhs.refcount_fcolors_; 00243 // refcount_fstatus_ = _rhs.refcount_fstatus_; 00244 // 00245 // return *this; 00246 // } 00247 00256 template <class _AttribKernel> 00257 void assign(const _AttribKernel& _other) 00258 { 00259 assign_connectivity(_other); 00260 for (typename Connectivity::VertexIter v_it = Connectivity::vertices_begin(); 00261 v_it != Connectivity::vertices_end(); ++v_it) 00262 {//assumes Point constructor supports cast from _AttribKernel::Point 00263 set_point(v_it, (Point)_other.point(v_it)); 00264 } 00265 } 00266 00267 //-------------------------------------------------------------------- points 00268 00269 const Point* points() const 00270 { return property(points_).data(); } 00271 00272 const Point& point(VertexHandle _vh) const 00273 { return property(points_, _vh); } 00274 00275 Point& point(VertexHandle _vh) 00276 { return property(points_, _vh); } 00277 00278 void set_point(VertexHandle _vh, const Point& _p) 00279 { property(points_, _vh) = _p; } 00280 00281 00282 //------------------------------------------------------------ vertex normals 00283 00284 const Normal* vertex_normals() const 00285 { return property(vertex_normals_).data(); } 00286 00287 const Normal& normal(VertexHandle _vh) const 00288 { return property(vertex_normals_, _vh); } 00289 00290 void set_normal(VertexHandle _vh, const Normal& _n) 00291 { property(vertex_normals_, _vh) = _n; } 00292 00293 00294 //------------------------------------------------------------- vertex colors 00295 00296 const Color* vertex_colors() const 00297 { return property(vertex_colors_).data(); } 00298 00299 const Color& color(VertexHandle _vh) const 00300 { return property(vertex_colors_, _vh); } 00301 00302 void set_color(VertexHandle _vh, const Color& _c) 00303 { property(vertex_colors_, _vh) = _c; } 00304 00305 00306 //------------------------------------------------------- vertex 1D texcoords 00307 00308 const TexCoord1D* texcoords1D() const { 00309 return property(vertex_texcoords1D_).data(); 00310 } 00311 00312 const TexCoord1D& texcoord1D(VertexHandle _vh) const { 00313 return property(vertex_texcoords1D_, _vh); 00314 } 00315 00316 void set_texcoord1D(VertexHandle _vh, const TexCoord1D& _t) { 00317 property(vertex_texcoords1D_, _vh) = _t; 00318 } 00319 00320 00321 //------------------------------------------------------- vertex 2D texcoords 00322 00323 const TexCoord2D* texcoords2D() const { 00324 return property(vertex_texcoords2D_).data(); 00325 } 00326 00327 const TexCoord2D& texcoord2D(VertexHandle _vh) const { 00328 return property(vertex_texcoords2D_, _vh); 00329 } 00330 00331 void set_texcoord2D(VertexHandle _vh, const TexCoord2D& _t) { 00332 property(vertex_texcoords2D_, _vh) = _t; 00333 } 00334 00335 00336 //------------------------------------------------------- vertex 3D texcoords 00337 00338 const TexCoord3D* texcoords3D() const { 00339 return property(vertex_texcoords3D_).data(); 00340 } 00341 00342 const TexCoord3D& texcoord3D(VertexHandle _vh) const { 00343 return property(vertex_texcoords3D_, _vh); 00344 } 00345 00346 void set_texcoord3D(VertexHandle _vh, const TexCoord3D& _t) { 00347 property(vertex_texcoords3D_, _vh) = _t; 00348 } 00349 00350 //.------------------------------------------------------ halfedge 1D texcoords 00351 00352 const TexCoord1D* htexcoords1D() const { 00353 return property(halfedge_texcoords1D_).data(); 00354 } 00355 00356 const TexCoord1D& texcoord1D(HalfedgeHandle _heh) const { 00357 return property(halfedge_texcoords1D_, _heh); 00358 } 00359 00360 void set_texcoord1D(HalfedgeHandle _heh, const TexCoord1D& _t) { 00361 property(halfedge_texcoords1D_, _heh) = _t; 00362 } 00363 00364 00365 //------------------------------------------------------- halfedge 2D texcoords 00366 00367 const TexCoord2D* htexcoords2D() const { 00368 return property(halfedge_texcoords2D_).data(); 00369 } 00370 00371 const TexCoord2D& texcoord2D(HalfedgeHandle _heh) const { 00372 return property(halfedge_texcoords2D_, _heh); 00373 } 00374 00375 void set_texcoord2D(HalfedgeHandle _heh, const TexCoord2D& _t) { 00376 property(halfedge_texcoords2D_, _heh) = _t; 00377 } 00378 00379 00380 //------------------------------------------------------- halfedge 3D texcoords 00381 00382 const TexCoord3D* htexcoords3D() const { 00383 return property(halfedge_texcoords3D_).data(); 00384 } 00385 00386 const TexCoord3D& texcoord3D(HalfedgeHandle _heh) const { 00387 return property(halfedge_texcoords3D_, _heh); 00388 } 00389 00390 void set_texcoord3D(HalfedgeHandle _heh, const TexCoord3D& _t) { 00391 property(halfedge_texcoords3D_, _heh) = _t; 00392 } 00393 00394 //------------------------------------------------------------- edge colors 00395 00396 const Color* edge_colors() const 00397 { return property(edge_colors_).data(); } 00398 00399 const Color& color(EdgeHandle _eh) const 00400 { return property(edge_colors_, _eh); } 00401 00402 void set_color(EdgeHandle _eh, const Color& _c) 00403 { property(edge_colors_, _eh) = _c; } 00404 00405 00406 //------------------------------------------------------------- halfedge normals 00407 00408 const Normal& normal(HalfedgeHandle _heh) const 00409 { return property(halfedge_normals_, _heh); } 00410 00411 void set_normal(HalfedgeHandle _heh, const Normal& _n) 00412 { property(halfedge_normals_, _heh) = _n; } 00413 00414 00415 //------------------------------------------------------------- halfedge colors 00416 00417 const Color* halfedge_colors() const 00418 { return property(halfedge_colors_).data(); } 00419 00420 const Color& color(HalfedgeHandle _heh) const 00421 { return property(halfedge_colors_, _heh); } 00422 00423 void set_color(HalfedgeHandle _heh, const Color& _c) 00424 { property(halfedge_colors_, _heh) = _c; } 00425 00426 //-------------------------------------------------------------- face normals 00427 00428 const Normal& normal(FaceHandle _fh) const 00429 { return property(face_normals_, _fh); } 00430 00431 void set_normal(FaceHandle _fh, const Normal& _n) 00432 { property(face_normals_, _fh) = _n; } 00433 00434 //-------------------------------------------------------------- per Face Texture index 00435 00436 const TextureIndex& texture_index(FaceHandle _fh) const 00437 { return property(face_texture_index_, _fh); } 00438 00439 void set_texture_index(FaceHandle _fh, const TextureIndex& _t) 00440 { property(face_texture_index_, _fh) = _t; } 00441 00442 //--------------------------------------------------------------- face colors 00443 00444 const Color& color(FaceHandle _fh) const 00445 { return property(face_colors_, _fh); } 00446 00447 void set_color(FaceHandle _fh, const Color& _c) 00448 { property(face_colors_, _fh) = _c; } 00449 00450 //------------------------------------------------ request / alloc properties 00451 00452 void request_vertex_normals() 00453 { 00454 if (!refcount_vnormals_++) 00455 add_property( vertex_normals_, "v:normals" ); 00456 } 00457 00458 void request_vertex_colors() 00459 { 00460 if (!refcount_vcolors_++) 00461 add_property( vertex_colors_, "v:colors" ); 00462 } 00463 00464 void request_vertex_texcoords1D() 00465 { 00466 if (!refcount_vtexcoords1D_++) 00467 add_property( vertex_texcoords1D_, "v:texcoords1D" ); 00468 } 00469 00470 void request_vertex_texcoords2D() 00471 { 00472 if (!refcount_vtexcoords2D_++) 00473 add_property( vertex_texcoords2D_, "v:texcoords2D" ); 00474 } 00475 00476 void request_vertex_texcoords3D() 00477 { 00478 if (!refcount_vtexcoords3D_++) 00479 add_property( vertex_texcoords3D_, "v:texcoords3D" ); 00480 } 00481 00482 void request_halfedge_texcoords1D() 00483 { 00484 if (!refcount_htexcoords1D_++) 00485 add_property( halfedge_texcoords1D_, "h:texcoords1D" ); 00486 } 00487 00488 void request_halfedge_texcoords2D() 00489 { 00490 if (!refcount_htexcoords2D_++) 00491 add_property( halfedge_texcoords2D_, "h:texcoords2D" ); 00492 } 00493 00494 void request_halfedge_texcoords3D() 00495 { 00496 if (!refcount_htexcoords3D_++) 00497 add_property( halfedge_texcoords3D_, "h:texcoords3D" ); 00498 } 00499 00500 void request_edge_colors() 00501 { 00502 if (!refcount_ecolors_++) 00503 add_property( edge_colors_, "e:colors" ); 00504 } 00505 00506 void request_halfedge_normals() 00507 { 00508 if (!refcount_henormals_++) 00509 add_property( halfedge_normals_, "h:normals" ); 00510 } 00511 00512 void request_halfedge_colors() 00513 { 00514 if (!refcount_hecolors_++) 00515 add_property( halfedge_colors_, "h:colors" ); 00516 } 00517 00518 void request_face_normals() 00519 { 00520 if (!refcount_fnormals_++) 00521 add_property( face_normals_, "f:normals" ); 00522 } 00523 00524 void request_face_colors() 00525 { 00526 if (!refcount_fcolors_++) 00527 add_property( face_colors_, "f:colors" ); 00528 } 00529 00530 void request_face_texture_index() 00531 { 00532 if (!refcount_ftextureIndex_++) 00533 add_property( face_texture_index_, "f:textureindex" ); 00534 } 00535 00536 //------------------------------------------------- release / free properties 00537 00538 void release_vertex_normals() 00539 { 00540 if ((refcount_vnormals_ > 0) && (! --refcount_vnormals_)) 00541 remove_property(vertex_normals_); 00542 } 00543 00544 void release_vertex_colors() 00545 { 00546 if ((refcount_vcolors_ > 0) && (! --refcount_vcolors_)) 00547 remove_property(vertex_colors_); 00548 } 00549 00550 void release_vertex_texcoords1D() { 00551 if ((refcount_vtexcoords1D_ > 0) && (! --refcount_vtexcoords1D_)) 00552 remove_property(vertex_texcoords1D_); 00553 } 00554 00555 void release_vertex_texcoords2D() { 00556 if ((refcount_vtexcoords2D_ > 0) && (! --refcount_vtexcoords2D_)) 00557 remove_property(vertex_texcoords2D_); 00558 } 00559 00560 void release_vertex_texcoords3D() { 00561 if ((refcount_vtexcoords3D_ > 0) && (! --refcount_vtexcoords3D_)) 00562 remove_property(vertex_texcoords3D_); 00563 } 00564 00565 void release_halfedge_texcoords1D() { 00566 if ((refcount_htexcoords1D_ > 0) && (! --refcount_htexcoords1D_)) 00567 remove_property(halfedge_texcoords1D_); 00568 } 00569 00570 void release_halfedge_texcoords2D() { 00571 if ((refcount_htexcoords2D_ > 0) && (! --refcount_htexcoords2D_)) 00572 remove_property(halfedge_texcoords2D_); 00573 } 00574 00575 void release_halfedge_texcoords3D() { 00576 if ((refcount_htexcoords3D_ > 0) && (! --refcount_htexcoords3D_)) 00577 remove_property(halfedge_texcoords3D_); 00578 } 00579 00580 void release_edge_colors() 00581 { 00582 if ((refcount_ecolors_ > 0) && (! --refcount_ecolors_)) 00583 remove_property(edge_colors_); 00584 } 00585 00586 void release_halfedge_normals() 00587 { 00588 if ((refcount_henormals_ > 0) && (! --refcount_henormals_)) 00589 remove_property(halfedge_normals_); 00590 } 00591 00592 void release_halfedge_colors() 00593 { 00594 if ((refcount_hecolors_ > 0) && (! --refcount_hecolors_)) 00595 remove_property(halfedge_colors_); 00596 } 00597 00598 void release_face_normals() 00599 { 00600 if ((refcount_fnormals_ > 0) && (! --refcount_fnormals_)) 00601 remove_property(face_normals_); 00602 } 00603 00604 void release_face_colors() 00605 { 00606 if ((refcount_fcolors_ > 0) && (! --refcount_fcolors_)) 00607 remove_property(face_colors_); 00608 } 00609 00610 void release_face_texture_index() 00611 { 00612 if ((refcount_ftextureIndex_ > 0) && (! --refcount_ftextureIndex_)) 00613 remove_property(face_texture_index_); 00614 } 00615 00616 //---------------------------------------------- dynamic check for properties 00617 00618 bool has_vertex_normals() const { return vertex_normals_.is_valid(); } 00619 bool has_vertex_colors() const { return vertex_colors_.is_valid(); } 00620 bool has_vertex_texcoords1D() const { return vertex_texcoords1D_.is_valid(); } 00621 bool has_vertex_texcoords2D() const { return vertex_texcoords2D_.is_valid(); } 00622 bool has_vertex_texcoords3D() const { return vertex_texcoords3D_.is_valid(); } 00623 bool has_halfedge_texcoords1D() const { return halfedge_texcoords1D_.is_valid();} 00624 bool has_halfedge_texcoords2D() const { return halfedge_texcoords2D_.is_valid();} 00625 bool has_halfedge_texcoords3D() const { return halfedge_texcoords3D_.is_valid();} 00626 bool has_edge_colors() const { return edge_colors_.is_valid(); } 00627 bool has_halfedge_normals() const { return halfedge_normals_.is_valid(); } 00628 bool has_halfedge_colors() const { return halfedge_colors_.is_valid(); } 00629 bool has_face_normals() const { return face_normals_.is_valid(); } 00630 bool has_face_colors() const { return face_colors_.is_valid(); } 00631 bool has_face_texture_index() const { return face_texture_index_.is_valid(); } 00632 00633 public: 00634 00635 typedef VPropHandleT<Point> PointsPropertyHandle; 00636 typedef VPropHandleT<Normal> VertexNormalsPropertyHandle; 00637 typedef VPropHandleT<Color> VertexColorsPropertyHandle; 00638 typedef VPropHandleT<TexCoord1D> VertexTexCoords1DPropertyHandle; 00639 typedef VPropHandleT<TexCoord2D> VertexTexCoords2DPropertyHandle; 00640 typedef VPropHandleT<TexCoord3D> VertexTexCoords3DPropertyHandle; 00641 typedef HPropHandleT<TexCoord1D> HalfedgeTexCoords1DPropertyHandle; 00642 typedef HPropHandleT<TexCoord2D> HalfedgeTexCoords2DPropertyHandle; 00643 typedef HPropHandleT<TexCoord3D> HalfedgeTexCoords3DPropertyHandle; 00644 typedef EPropHandleT<Color> EdgeColorsPropertyHandle; 00645 typedef HPropHandleT<Normal> HalfedgeNormalsPropertyHandle; 00646 typedef HPropHandleT<Color> HalfedgeColorsPropertyHandle; 00647 typedef FPropHandleT<Normal> FaceNormalsPropertyHandle; 00648 typedef FPropHandleT<Color> FaceColorsPropertyHandle; 00649 typedef FPropHandleT<TextureIndex> FaceTextureIndexPropertyHandle; 00650 00651 public: 00652 //standard vertex properties 00653 PointsPropertyHandle points_pph() const 00654 { return points_; } 00655 00656 VertexNormalsPropertyHandle vertex_normals_pph() const 00657 { return vertex_normals_; } 00658 00659 VertexColorsPropertyHandle vertex_colors_pph() const 00660 { return vertex_colors_; } 00661 00662 VertexTexCoords1DPropertyHandle vertex_texcoords1D_pph() const 00663 { return vertex_texcoords1D_; } 00664 00665 VertexTexCoords2DPropertyHandle vertex_texcoords2D_pph() const 00666 { return vertex_texcoords2D_; } 00667 00668 VertexTexCoords3DPropertyHandle vertex_texcoords3D_pph() const 00669 { return vertex_texcoords3D_; } 00670 00671 //standard halfedge properties 00672 HalfedgeTexCoords1DPropertyHandle halfedge_texcoords1D_pph() const 00673 { return halfedge_texcoords1D_; } 00674 00675 HalfedgeTexCoords2DPropertyHandle halfedge_texcoords2D_pph() const 00676 { return halfedge_texcoords2D_; } 00677 00678 HalfedgeTexCoords3DPropertyHandle halfedge_texcoords3D_pph() const 00679 { return halfedge_texcoords3D_; } 00680 00681 // standard edge properties 00682 HalfedgeNormalsPropertyHandle halfedge_normals_pph() const 00683 { return halfedge_normals_; } 00684 00685 00686 // standard edge properties 00687 HalfedgeColorsPropertyHandle halfedge_colors_pph() const 00688 { return halfedge_colors_; } 00689 00690 // standard edge properties 00691 EdgeColorsPropertyHandle edge_colors_pph() const 00692 { return edge_colors_; } 00693 00694 //standard face properties 00695 FaceNormalsPropertyHandle face_normals_pph() const 00696 { return face_normals_; } 00697 00698 FaceColorsPropertyHandle face_colors_pph() const 00699 { return face_colors_; } 00700 00701 FaceTextureIndexPropertyHandle face_texture_index_pph() const 00702 { return face_texture_index_; } 00703 00704 VertexData& data(VertexHandle _vh) 00705 { return property(data_vpph_, _vh); } 00706 00707 const VertexData& data(VertexHandle _vh) const 00708 { return property(data_vpph_, _vh); } 00709 00710 FaceData& data(FaceHandle _fh) 00711 { return property(data_fpph_, _fh); } 00712 00713 const FaceData& data(FaceHandle _fh) const 00714 { return property(data_fpph_, _fh); } 00715 00716 EdgeData& data(EdgeHandle _eh) 00717 { return property(data_epph_, _eh); } 00718 00719 const EdgeData& data(EdgeHandle _eh) const 00720 { return property(data_epph_, _eh); } 00721 00722 HalfedgeData& data(HalfedgeHandle _heh) 00723 { return property(data_hpph_, _heh); } 00724 00725 const HalfedgeData& data(HalfedgeHandle _heh) const 00726 { return property(data_hpph_, _heh); } 00727 00728 private: 00729 //standard vertex properties 00730 PointsPropertyHandle points_; 00731 VertexNormalsPropertyHandle vertex_normals_; 00732 VertexColorsPropertyHandle vertex_colors_; 00733 VertexTexCoords1DPropertyHandle vertex_texcoords1D_; 00734 VertexTexCoords2DPropertyHandle vertex_texcoords2D_; 00735 VertexTexCoords3DPropertyHandle vertex_texcoords3D_; 00736 //standard halfedge properties 00737 HalfedgeTexCoords1DPropertyHandle halfedge_texcoords1D_; 00738 HalfedgeTexCoords2DPropertyHandle halfedge_texcoords2D_; 00739 HalfedgeTexCoords3DPropertyHandle halfedge_texcoords3D_; 00740 HalfedgeNormalsPropertyHandle halfedge_normals_; 00741 HalfedgeColorsPropertyHandle halfedge_colors_; 00742 // standard edge properties 00743 EdgeColorsPropertyHandle edge_colors_; 00744 //standard face properties 00745 FaceNormalsPropertyHandle face_normals_; 00746 FaceColorsPropertyHandle face_colors_; 00747 FaceTextureIndexPropertyHandle face_texture_index_; 00748 //data properties handles 00749 DataVPropHandle data_vpph_; 00750 DataHPropHandle data_hpph_; 00751 DataEPropHandle data_epph_; 00752 DataFPropHandle data_fpph_; 00753 00754 unsigned int refcount_vnormals_; 00755 unsigned int refcount_vcolors_; 00756 unsigned int refcount_vtexcoords1D_; 00757 unsigned int refcount_vtexcoords2D_; 00758 unsigned int refcount_vtexcoords3D_; 00759 unsigned int refcount_htexcoords1D_; 00760 unsigned int refcount_htexcoords2D_; 00761 unsigned int refcount_htexcoords3D_; 00762 unsigned int refcount_henormals_; 00763 unsigned int refcount_hecolors_; 00764 unsigned int refcount_ecolors_; 00765 unsigned int refcount_fnormals_; 00766 unsigned int refcount_fcolors_; 00767 unsigned int refcount_ftextureIndex_; 00768 }; 00769 00770 //============================================================================= 00771 } // namespace OpenMesh 00772 //============================================================================= 00773 #endif // OPENMESH_ATTRIBKERNEL_HH defined 00774 //=============================================================================