OpenMesh

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AttribKernelT.hh
1 /*===========================================================================*\
2 * *
3 * OpenMesh *
4 * Copyright (C) 2001-2014 by Computer Graphics Group, RWTH Aachen *
5 * www.openmesh.org *
6 * *
7 *---------------------------------------------------------------------------*
8 * This file is part of OpenMesh. *
9 * *
10 * OpenMesh is free software: you can redistribute it and/or modify *
11 * it under the terms of the GNU Lesser General Public License as *
12 * published by the Free Software Foundation, either version 3 of *
13 * the License, or (at your option) any later version with the *
14 * following exceptions: *
15 * *
16 * If other files instantiate templates or use macros *
17 * or inline functions from this file, or you compile this file and *
18 * link it with other files to produce an executable, this file does *
19 * not by itself cause the resulting executable to be covered by the *
20 * GNU Lesser General Public License. This exception does not however *
21 * invalidate any other reasons why the executable file might be *
22 * covered by the GNU Lesser General Public License. *
23 * *
24 * OpenMesh is distributed in the hope that it will be useful, *
25 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
26 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
27 * GNU Lesser General Public License for more details. *
28 * *
29 * You should have received a copy of the GNU LesserGeneral Public *
30 * License along with OpenMesh. If not, *
31 * see <http://www.gnu.org/licenses/>. *
32 * *
33 \*===========================================================================*/
34
35 /*===========================================================================*\
36 * *
37 * $Revision: 990 $ *
38 * $Date: 2014-02-05 10:01:07 +0100 (Mi, 05. Feb 2014) $ *
39 * *
40 \*===========================================================================*/
41
42 #ifndef OPENMESH_ATTRIBKERNEL_HH
43 #define OPENMESH_ATTRIBKERNEL_HH
44
45
46 //== INCLUDES =================================================================
47
48 #include <OpenMesh/Core/Mesh/Attributes.hh>
49 #include <OpenMesh/Core/Utils/GenProg.hh>
50 #include <OpenMesh/Core/Utils/vector_traits.hh>
51 #include <vector>
52 #include <algorithm>
53
54 //== NAMESPACES ===============================================================
55
56 namespace OpenMesh {
57
58
59 //== CLASS DEFINITION =========================================================
60
69 template <class MeshItems, class Connectivity>
70 class AttribKernelT : public Connectivity
71 {
72 public:
73
74 //---------------------------------------------------------------- item types
75
76 typedef MeshItems MeshItemsT;
77 typedef Connectivity ConnectivityT;
78 typedef typename Connectivity::Vertex Vertex;
79 typedef typename Connectivity::Halfedge Halfedge;
80 typedef typename Connectivity::Edge Edge;
81 typedef typename Connectivity::Face Face;
82
83 typedef typename MeshItems::Point Point;
84 typedef typename MeshItems::Normal Normal;
85 typedef typename MeshItems::Color Color;
86 typedef typename MeshItems::TexCoord1D TexCoord1D;
87 typedef typename MeshItems::TexCoord2D TexCoord2D;
88 typedef typename MeshItems::TexCoord3D TexCoord3D;
89 typedef typename MeshItems::Scalar Scalar;
90 typedef typename MeshItems::TextureIndex TextureIndex;
91
92 typedef typename MeshItems::VertexData VertexData;
93 typedef typename MeshItems::HalfedgeData HalfedgeData;
94 typedef typename MeshItems::EdgeData EdgeData;
95 typedef typename MeshItems::FaceData FaceData;
96
97 typedef AttribKernelT<MeshItems,Connectivity> AttribKernel;
98
99 enum Attribs {
100 VAttribs = MeshItems::VAttribs,
101 HAttribs = MeshItems::HAttribs,
102 EAttribs = MeshItems::EAttribs,
103 FAttribs = MeshItems::FAttribs
104 };
105
106 typedef VPropHandleT<VertexData> DataVPropHandle;
107 typedef HPropHandleT<HalfedgeData> DataHPropHandle;
108 typedef EPropHandleT<EdgeData> DataEPropHandle;
109 typedef FPropHandleT<FaceData> DataFPropHandle;
110
111 public:
112
113 //-------------------------------------------------- constructor / destructor
114
115 AttribKernelT()
116 : refcount_vnormals_(0),
117 refcount_vcolors_(0),
118 refcount_vtexcoords1D_(0),
119 refcount_vtexcoords2D_(0),
120 refcount_vtexcoords3D_(0),
121 refcount_htexcoords1D_(0),
122 refcount_htexcoords2D_(0),
123 refcount_htexcoords3D_(0),
124 refcount_henormals_(0),
125 refcount_hecolors_(0),
126 refcount_ecolors_(0),
127 refcount_fnormals_(0),
128 refcount_fcolors_(0),
129 refcount_ftextureIndex_(0)
130 {
131 this->add_property( points_, "v:points" );
132
133 if (VAttribs & Attributes::Normal)
134 request_vertex_normals();
135
136 if (VAttribs & Attributes::Color)
137 request_vertex_colors();
138
139 if (VAttribs & Attributes::TexCoord1D)
140 request_vertex_texcoords1D();
141
142 if (VAttribs & Attributes::TexCoord2D)
143 request_vertex_texcoords2D();
144
145 if (VAttribs & Attributes::TexCoord3D)
146 request_vertex_texcoords3D();
147
148 if (HAttribs & Attributes::TexCoord1D)
149 request_halfedge_texcoords1D();
150
151 if (HAttribs & Attributes::TexCoord2D)
152 request_halfedge_texcoords2D();
153
154 if (HAttribs & Attributes::TexCoord3D)
155 request_halfedge_texcoords3D();
156
157 if (HAttribs & Attributes::Color)
158 request_halfedge_colors();
159
160 if (VAttribs & Attributes::Status)
161 Connectivity::request_vertex_status();
162
163 if (HAttribs & Attributes::Status)
164 Connectivity::request_halfedge_status();
165
166 if (HAttribs & Attributes::Normal)
167 request_halfedge_normals();
168
169 if (EAttribs & Attributes::Status)
170 Connectivity::request_edge_status();
171
172 if (EAttribs & Attributes::Color)
173 request_edge_colors();
174
175 if (FAttribs & Attributes::Normal)
176 request_face_normals();
177
178 if (FAttribs & Attributes::Color)
179 request_face_colors();
180
181 if (FAttribs & Attributes::Status)
182 Connectivity::request_face_status();
183
184 if (FAttribs & Attributes::TextureIndex)
185 request_face_texture_index();
186
187 //FIXME: data properties might actually cost storage even
188 //if there are no data traits??
189 this->add_property(data_vpph_);
190 this->add_property(data_fpph_);
191 this->add_property(data_hpph_);
192 this->add_property(data_epph_);
193 }
194
195 virtual ~AttribKernelT()
196 {
197 // should remove properties, but this will be done in
198 // BaseKernel's destructor anyway...
199 }
200
209 template <class _AttribKernel>
210 void assign(const _AttribKernel& _other)
211 {
212 this->assign_connectivity(_other);
213 for (typename Connectivity::VertexIter v_it = Connectivity::vertices_begin();
214 v_it != Connectivity::vertices_end(); ++v_it)
215 {//assumes Point constructor supports cast from _AttribKernel::Point
216 set_point(*v_it, (Point)_other.point(*v_it));
217 }
218 }
219
220 //-------------------------------------------------------------------- points
221
222 const Point* points() const
223 { return this->property(points_).data(); }
224
225 const Point& point(VertexHandle _vh) const
226 { return this->property(points_, _vh); }
227
228 Point& point(VertexHandle _vh)
229 { return this->property(points_, _vh); }
230
231 void set_point(VertexHandle _vh, const Point& _p)
232 { this->property(points_, _vh) = _p; }
233
234
235 //------------------------------------------------------------ vertex normals
236
237 const Normal* vertex_normals() const
238 { return this->property(vertex_normals_).data(); }
239
240 const Normal& normal(VertexHandle _vh) const
241 { return this->property(vertex_normals_, _vh); }
242
243 void set_normal(VertexHandle _vh, const Normal& _n)
244 { this->property(vertex_normals_, _vh) = _n; }
245
246
247 //------------------------------------------------------------- vertex colors
248
249 const Color* vertex_colors() const
250 { return this->property(vertex_colors_).data(); }
251
252 const Color& color(VertexHandle _vh) const
253 { return this->property(vertex_colors_, _vh); }
254
255 void set_color(VertexHandle _vh, const Color& _c)
256 { this->property(vertex_colors_, _vh) = _c; }
257
258
259 //------------------------------------------------------- vertex 1D texcoords
260
261 const TexCoord1D* texcoords1D() const {
262 return this->property(vertex_texcoords1D_).data();
263 }
264
265 const TexCoord1D& texcoord1D(VertexHandle _vh) const {
266 return this->property(vertex_texcoords1D_, _vh);
267 }
268
269 void set_texcoord1D(VertexHandle _vh, const TexCoord1D& _t) {
270 this->property(vertex_texcoords1D_, _vh) = _t;
271 }
272
273
274 //------------------------------------------------------- vertex 2D texcoords
275
276 const TexCoord2D* texcoords2D() const {
277 return this->property(vertex_texcoords2D_).data();
278 }
279
280 const TexCoord2D& texcoord2D(VertexHandle _vh) const {
281 return this->property(vertex_texcoords2D_, _vh);
282 }
283
284 void set_texcoord2D(VertexHandle _vh, const TexCoord2D& _t) {
285 this->property(vertex_texcoords2D_, _vh) = _t;
286 }
287
288
289 //------------------------------------------------------- vertex 3D texcoords
290
291 const TexCoord3D* texcoords3D() const {
292 return this->property(vertex_texcoords3D_).data();
293 }
294
295 const TexCoord3D& texcoord3D(VertexHandle _vh) const {
296 return this->property(vertex_texcoords3D_, _vh);
297 }
298
299 void set_texcoord3D(VertexHandle _vh, const TexCoord3D& _t) {
300 this->property(vertex_texcoords3D_, _vh) = _t;
301 }
302
303 //.------------------------------------------------------ halfedge 1D texcoords
304
305 const TexCoord1D* htexcoords1D() const {
306 return this->property(halfedge_texcoords1D_).data();
307 }
308
309 const TexCoord1D& texcoord1D(HalfedgeHandle _heh) const {
310 return this->property(halfedge_texcoords1D_, _heh);
311 }
312
313 void set_texcoord1D(HalfedgeHandle _heh, const TexCoord1D& _t) {
314 this->property(halfedge_texcoords1D_, _heh) = _t;
315 }
316
317
318 //------------------------------------------------------- halfedge 2D texcoords
319
320 const TexCoord2D* htexcoords2D() const {
321 return this->property(halfedge_texcoords2D_).data();
322 }
323
324 const TexCoord2D& texcoord2D(HalfedgeHandle _heh) const {
325 return this->property(halfedge_texcoords2D_, _heh);
326 }
327
328 void set_texcoord2D(HalfedgeHandle _heh, const TexCoord2D& _t) {
329 this->property(halfedge_texcoords2D_, _heh) = _t;
330 }
331
332
333 //------------------------------------------------------- halfedge 3D texcoords
334
335 const TexCoord3D* htexcoords3D() const {
336 return this->property(halfedge_texcoords3D_).data();
337 }
338
339 const TexCoord3D& texcoord3D(HalfedgeHandle _heh) const {
340 return this->property(halfedge_texcoords3D_, _heh);
341 }
342
343 void set_texcoord3D(HalfedgeHandle _heh, const TexCoord3D& _t) {
344 this->property(halfedge_texcoords3D_, _heh) = _t;
345 }
346
347 //------------------------------------------------------------- edge colors
348
349 const Color* edge_colors() const
350 { return this->property(edge_colors_).data(); }
351
352 const Color& color(EdgeHandle _eh) const
353 { return this->property(edge_colors_, _eh); }
354
355 void set_color(EdgeHandle _eh, const Color& _c)
356 { this->property(edge_colors_, _eh) = _c; }
357
358
359 //------------------------------------------------------------- halfedge normals
360
361 const Normal& normal(HalfedgeHandle _heh) const
362 { return this->property(halfedge_normals_, _heh); }
363
364 void set_normal(HalfedgeHandle _heh, const Normal& _n)
365 { this->property(halfedge_normals_, _heh) = _n; }
366
367
368 //------------------------------------------------------------- halfedge colors
369
370 const Color* halfedge_colors() const
371 { return this->property(halfedge_colors_).data(); }
372
373 const Color& color(HalfedgeHandle _heh) const
374 { return this->property(halfedge_colors_, _heh); }
375
376 void set_color(HalfedgeHandle _heh, const Color& _c)
377 { this->property(halfedge_colors_, _heh) = _c; }
378
379 //-------------------------------------------------------------- face normals
380
381 const Normal& normal(FaceHandle _fh) const
382 { return this->property(face_normals_, _fh); }
383
384 void set_normal(FaceHandle _fh, const Normal& _n)
385 { this->property(face_normals_, _fh) = _n; }
386
387 //-------------------------------------------------------------- per Face Texture index
388
389 const TextureIndex& texture_index(FaceHandle _fh) const
390 { return this->property(face_texture_index_, _fh); }
391
392 void set_texture_index(FaceHandle _fh, const TextureIndex& _t)
393 { this->property(face_texture_index_, _fh) = _t; }
394
395 //--------------------------------------------------------------- face colors
396
397 const Color& color(FaceHandle _fh) const
398 { return this->property(face_colors_, _fh); }
399
400 void set_color(FaceHandle _fh, const Color& _c)
401 { this->property(face_colors_, _fh) = _c; }
402
403 //------------------------------------------------ request / alloc properties
404
405 void request_vertex_normals()
406 {
407 if (!refcount_vnormals_++)
408 this->add_property( vertex_normals_, "v:normals" );
409 }
410
411 void request_vertex_colors()
412 {
413 if (!refcount_vcolors_++)
414 this->add_property( vertex_colors_, "v:colors" );
415 }
416
417 void request_vertex_texcoords1D()
418 {
419 if (!refcount_vtexcoords1D_++)
420 this->add_property( vertex_texcoords1D_, "v:texcoords1D" );
421 }
422
423 void request_vertex_texcoords2D()
424 {
425 if (!refcount_vtexcoords2D_++)
426 this->add_property( vertex_texcoords2D_, "v:texcoords2D" );
427 }
428
429 void request_vertex_texcoords3D()
430 {
431 if (!refcount_vtexcoords3D_++)
432 this->add_property( vertex_texcoords3D_, "v:texcoords3D" );
433 }
434
435 void request_halfedge_texcoords1D()
436 {
437 if (!refcount_htexcoords1D_++)
438 this->add_property( halfedge_texcoords1D_, "h:texcoords1D" );
439 }
440
441 void request_halfedge_texcoords2D()
442 {
443 if (!refcount_htexcoords2D_++)
444 this->add_property( halfedge_texcoords2D_, "h:texcoords2D" );
445 }
446
447 void request_halfedge_texcoords3D()
448 {
449 if (!refcount_htexcoords3D_++)
450 this->add_property( halfedge_texcoords3D_, "h:texcoords3D" );
451 }
452
453 void request_edge_colors()
454 {
455 if (!refcount_ecolors_++)
456 this->add_property( edge_colors_, "e:colors" );
457 }
458
459 void request_halfedge_normals()
460 {
461 if (!refcount_henormals_++)
462 this->add_property( halfedge_normals_, "h:normals" );
463 }
464
465 void request_halfedge_colors()
466 {
467 if (!refcount_hecolors_++)
468 this->add_property( halfedge_colors_, "h:colors" );
469 }
470
471 void request_face_normals()
472 {
473 if (!refcount_fnormals_++)
474 this->add_property( face_normals_, "f:normals" );
475 }
476
477 void request_face_colors()
478 {
479 if (!refcount_fcolors_++)
480 this->add_property( face_colors_, "f:colors" );
481 }
482
483 void request_face_texture_index()
484 {
485 if (!refcount_ftextureIndex_++)
486 this->add_property( face_texture_index_, "f:textureindex" );
487 }
488
489 //------------------------------------------------- release / free properties
490
491 void release_vertex_normals()
492 {
493 if ((refcount_vnormals_ > 0) && (! --refcount_vnormals_))
494 this->remove_property(vertex_normals_);
495 }
496
497 void release_vertex_colors()
498 {
499 if ((refcount_vcolors_ > 0) && (! --refcount_vcolors_))
500 this->remove_property(vertex_colors_);
501 }
502
503 void release_vertex_texcoords1D() {
504 if ((refcount_vtexcoords1D_ > 0) && (! --refcount_vtexcoords1D_))
505 this->remove_property(vertex_texcoords1D_);
506 }
507
508 void release_vertex_texcoords2D() {
509 if ((refcount_vtexcoords2D_ > 0) && (! --refcount_vtexcoords2D_))
510 this->remove_property(vertex_texcoords2D_);
511 }
512
513 void release_vertex_texcoords3D() {
514 if ((refcount_vtexcoords3D_ > 0) && (! --refcount_vtexcoords3D_))
515 this->remove_property(vertex_texcoords3D_);
516 }
517
518 void release_halfedge_texcoords1D() {
519 if ((refcount_htexcoords1D_ > 0) && (! --refcount_htexcoords1D_))
520 this->remove_property(halfedge_texcoords1D_);
521 }
522
523 void release_halfedge_texcoords2D() {
524 if ((refcount_htexcoords2D_ > 0) && (! --refcount_htexcoords2D_))
525 this->remove_property(halfedge_texcoords2D_);
526 }
527
528 void release_halfedge_texcoords3D() {
529 if ((refcount_htexcoords3D_ > 0) && (! --refcount_htexcoords3D_))
530 this->remove_property(halfedge_texcoords3D_);
531 }
532
533 void release_edge_colors()
534 {
535 if ((refcount_ecolors_ > 0) && (! --refcount_ecolors_))
536 this->remove_property(edge_colors_);
537 }
538
539 void release_halfedge_normals()
540 {
541 if ((refcount_henormals_ > 0) && (! --refcount_henormals_))
542 this->remove_property(halfedge_normals_);
543 }
544
545 void release_halfedge_colors()
546 {
547 if ((refcount_hecolors_ > 0) && (! --refcount_hecolors_))
548 this->remove_property(halfedge_colors_);
549 }
550
551 void release_face_normals()
552 {
553 if ((refcount_fnormals_ > 0) && (! --refcount_fnormals_))
554 this->remove_property(face_normals_);
555 }
556
557 void release_face_colors()
558 {
559 if ((refcount_fcolors_ > 0) && (! --refcount_fcolors_))
560 this->remove_property(face_colors_);
561 }
562
563 void release_face_texture_index()
564 {
565 if ((refcount_ftextureIndex_ > 0) && (! --refcount_ftextureIndex_))
566 this->remove_property(face_texture_index_);
567 }
568
569 //---------------------------------------------- dynamic check for properties
570
571 bool has_vertex_normals() const { return vertex_normals_.is_valid(); }
572 bool has_vertex_colors() const { return vertex_colors_.is_valid(); }
573 bool has_vertex_texcoords1D() const { return vertex_texcoords1D_.is_valid(); }
574 bool has_vertex_texcoords2D() const { return vertex_texcoords2D_.is_valid(); }
575 bool has_vertex_texcoords3D() const { return vertex_texcoords3D_.is_valid(); }
576 bool has_halfedge_texcoords1D() const { return halfedge_texcoords1D_.is_valid();}
577 bool has_halfedge_texcoords2D() const { return halfedge_texcoords2D_.is_valid();}
578 bool has_halfedge_texcoords3D() const { return halfedge_texcoords3D_.is_valid();}
579 bool has_edge_colors() const { return edge_colors_.is_valid(); }
580 bool has_halfedge_normals() const { return halfedge_normals_.is_valid(); }
581 bool has_halfedge_colors() const { return halfedge_colors_.is_valid(); }
582 bool has_face_normals() const { return face_normals_.is_valid(); }
583 bool has_face_colors() const { return face_colors_.is_valid(); }
584 bool has_face_texture_index() const { return face_texture_index_.is_valid(); }
585
586 public:
587
588 typedef VPropHandleT<Point> PointsPropertyHandle;
589 typedef VPropHandleT<Normal> VertexNormalsPropertyHandle;
590 typedef VPropHandleT<Color> VertexColorsPropertyHandle;
591 typedef VPropHandleT<TexCoord1D> VertexTexCoords1DPropertyHandle;
592 typedef VPropHandleT<TexCoord2D> VertexTexCoords2DPropertyHandle;
593 typedef VPropHandleT<TexCoord3D> VertexTexCoords3DPropertyHandle;
594 typedef HPropHandleT<TexCoord1D> HalfedgeTexCoords1DPropertyHandle;
595 typedef HPropHandleT<TexCoord2D> HalfedgeTexCoords2DPropertyHandle;
596 typedef HPropHandleT<TexCoord3D> HalfedgeTexCoords3DPropertyHandle;
597 typedef EPropHandleT<Color> EdgeColorsPropertyHandle;
598 typedef HPropHandleT<Normal> HalfedgeNormalsPropertyHandle;
599 typedef HPropHandleT<Color> HalfedgeColorsPropertyHandle;
600 typedef FPropHandleT<Normal> FaceNormalsPropertyHandle;
601 typedef FPropHandleT<Color> FaceColorsPropertyHandle;
602 typedef FPropHandleT<TextureIndex> FaceTextureIndexPropertyHandle;
603
604 public:
605 //standard vertex properties
606 PointsPropertyHandle points_pph() const
607 { return points_; }
608
609 VertexNormalsPropertyHandle vertex_normals_pph() const
610 { return vertex_normals_; }
611
612 VertexColorsPropertyHandle vertex_colors_pph() const
613 { return vertex_colors_; }
614
615 VertexTexCoords1DPropertyHandle vertex_texcoords1D_pph() const
616 { return vertex_texcoords1D_; }
617
618 VertexTexCoords2DPropertyHandle vertex_texcoords2D_pph() const
619 { return vertex_texcoords2D_; }
620
621 VertexTexCoords3DPropertyHandle vertex_texcoords3D_pph() const
622 { return vertex_texcoords3D_; }
623
624 //standard halfedge properties
625 HalfedgeTexCoords1DPropertyHandle halfedge_texcoords1D_pph() const
626 { return halfedge_texcoords1D_; }
627
628 HalfedgeTexCoords2DPropertyHandle halfedge_texcoords2D_pph() const
629 { return halfedge_texcoords2D_; }
630
631 HalfedgeTexCoords3DPropertyHandle halfedge_texcoords3D_pph() const
632 { return halfedge_texcoords3D_; }
633
634 // standard edge properties
635 HalfedgeNormalsPropertyHandle halfedge_normals_pph() const
636 { return halfedge_normals_; }
637
638
639 // standard edge properties
640 HalfedgeColorsPropertyHandle halfedge_colors_pph() const
641 { return halfedge_colors_; }
642
643 // standard edge properties
644 EdgeColorsPropertyHandle edge_colors_pph() const
645 { return edge_colors_; }
646
647 //standard face properties
648 FaceNormalsPropertyHandle face_normals_pph() const
649 { return face_normals_; }
650
651 FaceColorsPropertyHandle face_colors_pph() const
652 { return face_colors_; }
653
654 FaceTextureIndexPropertyHandle face_texture_index_pph() const
655 { return face_texture_index_; }
656
657 VertexData& data(VertexHandle _vh)
658 { return this->property(data_vpph_, _vh); }
659
660 const VertexData& data(VertexHandle _vh) const
661 { return this->property(data_vpph_, _vh); }
662
663 FaceData& data(FaceHandle _fh)
664 { return this->property(data_fpph_, _fh); }
665
666 const FaceData& data(FaceHandle _fh) const
667 { return this->property(data_fpph_, _fh); }
668
669 EdgeData& data(EdgeHandle _eh)
670 { return this->property(data_epph_, _eh); }
671
672 const EdgeData& data(EdgeHandle _eh) const
673 { return this->property(data_epph_, _eh); }
674
675 HalfedgeData& data(HalfedgeHandle _heh)
676 { return this->property(data_hpph_, _heh); }
677
678 const HalfedgeData& data(HalfedgeHandle _heh) const
679 { return this->property(data_hpph_, _heh); }
680
681 private:
682 //standard vertex properties
683 PointsPropertyHandle points_;
684 VertexNormalsPropertyHandle vertex_normals_;
685 VertexColorsPropertyHandle vertex_colors_;
686 VertexTexCoords1DPropertyHandle vertex_texcoords1D_;
687 VertexTexCoords2DPropertyHandle vertex_texcoords2D_;
688 VertexTexCoords3DPropertyHandle vertex_texcoords3D_;
689 //standard halfedge properties
690 HalfedgeTexCoords1DPropertyHandle halfedge_texcoords1D_;
691 HalfedgeTexCoords2DPropertyHandle halfedge_texcoords2D_;
692 HalfedgeTexCoords3DPropertyHandle halfedge_texcoords3D_;
693 HalfedgeNormalsPropertyHandle halfedge_normals_;
694 HalfedgeColorsPropertyHandle halfedge_colors_;
695 // standard edge properties
696 EdgeColorsPropertyHandle edge_colors_;
697 //standard face properties
698 FaceNormalsPropertyHandle face_normals_;
699 FaceColorsPropertyHandle face_colors_;
700 FaceTextureIndexPropertyHandle face_texture_index_;
701 //data properties handles
702 DataVPropHandle data_vpph_;
703 DataHPropHandle data_hpph_;
704 DataEPropHandle data_epph_;
705 DataFPropHandle data_fpph_;
706
707 unsigned int refcount_vnormals_;
708 unsigned int refcount_vcolors_;
709 unsigned int refcount_vtexcoords1D_;
710 unsigned int refcount_vtexcoords2D_;
711 unsigned int refcount_vtexcoords3D_;
712 unsigned int refcount_htexcoords1D_;
713 unsigned int refcount_htexcoords2D_;
714 unsigned int refcount_htexcoords3D_;
715 unsigned int refcount_henormals_;
716 unsigned int refcount_hecolors_;
717 unsigned int refcount_ecolors_;
718 unsigned int refcount_fnormals_;
719 unsigned int refcount_fcolors_;
720 unsigned int refcount_ftextureIndex_;
721 };
722
723 //=============================================================================
724 } // namespace OpenMesh
725 //=============================================================================
726 #endif // OPENMESH_ATTRIBKERNEL_HH defined
727 //=============================================================================
OpenMesh::BaseHandle::is_valid
bool is_valid() const
The handle is valid iff the index is not equal to -1.
Definition: Handles.hh:70
OpenMesh::FPropHandleT< FaceData >
OpenMesh::Attributes::TexCoord3D
Add 3D texture coordinates (vertices, halfedges)
Definition: Attributes.hh:86
OpenMesh::VPropHandleT< VertexData >
OpenMesh::Attributes::Color
Add colors to mesh item (vertices/faces/edges)
Definition: Attributes.hh:81
OpenMesh::Attributes::Normal
Add normals to mesh item (vertices/faces)
Definition: Attributes.hh:80
OpenMesh::AttribKernelT::assign
void assign(const _AttribKernel &_other)
Assignment from another mesh of another type.
Definition: AttribKernelT.hh:210
OpenMesh::Attributes::TextureIndex
Add texture index (faces)
Definition: Attributes.hh:87
OpenMesh::EPropHandleT< EdgeData >
Attributes.hh
This file provides some macros containing attribute usage.
OpenMesh::Attributes::TexCoord1D
Add 1D texture coordinates (vertices, halfedges)
Definition: Attributes.hh:84
OpenMesh::HPropHandleT< HalfedgeData >
OpenMesh::AttribKernelT
The attribute kernel adds all standard properties to the kernel.
Definition: AttribKernelT.hh:70
OpenMesh::Attributes::TexCoord2D
Add 2D texture coordinates (vertices, halfedges)
Definition: Attributes.hh:85
OpenMesh::Attributes::Status
Add status to mesh item (all items)
Definition: Attributes.hh:83