OpenMesh: OpenMesh/Tools/Kernel_OSG/AttribKernelT.hh Source File

| OpenMesh

AttribKernelT.hh
1 /* ========================================================================= *
2 * *
3 * OpenMesh *
4 * Copyright (c) 2001-2015, RWTH-Aachen University *
5 * Department of Computer Graphics and Multimedia *
6 * All rights reserved. *
7 * www.openmesh.org *
8 * *
9 *---------------------------------------------------------------------------*
10 * This file is part of OpenMesh. *
11 *---------------------------------------------------------------------------*
12 * *
13 * Redistribution and use in source and binary forms, with or without *
14 * modification, are permitted provided that the following conditions *
15 * are met: *
16 * *
17 * 1. Redistributions of source code must retain the above copyright notice, *
18 * this list of conditions and the following disclaimer. *
19 * *
20 * 2. Redistributions in binary form must reproduce the above copyright *
21 * notice, this list of conditions and the following disclaimer in the *
22 * documentation and/or other materials provided with the distribution. *
23 * *
24 * 3. Neither the name of the copyright holder nor the names of its *
25 * contributors may be used to endorse or promote products derived from *
26 * this software without specific prior written permission. *
27 * *
28 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS *
29 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED *
30 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A *
31 * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER *
32 * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, *
33 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, *
34 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR *
35 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF *
36 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING *
37 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
38 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
39 * *
40 * ========================================================================= */
41
42 /*===========================================================================*\
43 * *
44 * $Revision$ *
45 * $Date$ *
46 * *
47 \*===========================================================================*/
48
49 #ifndef OPENMESH_KERNEL_OSG_ATTRIBKERNEL_HH
50 #define OPENMESH_KENREL_OSG_ATTRIBKERNEL_HH
51
52
53 //== INCLUDES =================================================================
54
55 #include <OpenMesh/Core/Utils/GenProg.hh>
56 #include <OpenMesh/Core/Mesh/Attributes.hh>
57 // --------------------
58 #include <OpenMesh/Tools/Kernel_OSG/PropertyT.hh>
59 #include <OpenMesh/Tools/Kernel_OSG/PropertyKernel.hh>
60 // --------------------
61 #include <osg/Geometry>
62
63
64 //== NAMESPACES ===============================================================
65
66 namespace OpenMesh {
67 namespace Kernel_OSG {
68
69 //== CLASS DEFINITION =========================================================
70
71
72
74 template <class MeshItems>
75 class AttribKernelT
76 : public PropertyKernel< typename MeshItems::Face::IsTriangle >
77 {
78 protected:
79
80 typedef typename MeshItems::Face::IsTriangle IsTriMesh;
81 typedef PropertyKernel< IsTriMesh > Base;
82
83 typedef typename Base::FPTypesHandle FPTypesHandle;
84 typedef typename Base::FPLengthsHandle FPLengthsHandle;
85 typedef typename Base::FIndicesHandle FIndicesHandle;
86
87 public:
88
89 //---------------------------------------------------------------- item types
90
91 typedef typename MeshItems::Vertex Vertex;
92 typedef typename MeshItems::Halfedge Halfedge;
93 typedef typename MeshItems::Edge Edge;
94 typedef typename MeshItems::Face Face;
95
96 typedef typename MeshItems::Point Point;
97 typedef typename MeshItems::Normal Normal;
98 typedef typename MeshItems::Color Color;
99 typedef typename MeshItems::TexCoord TexCoord;
100
101 typedef typename MeshItems::Scalar Scalar;
102
103 typedef Attributes::StatusInfo StatusInfo;
104
105
106 enum Attribs {
107 VAttribs = MeshItems::VAttribs,
108 HAttribs = MeshItems::HAttribs,
109 EAttribs = MeshItems::EAttribs,
110 FAttribs = MeshItems::FAttribs,
111 };
112
113 typedef GenProg::Bool2Type<(bool)(HAttribs & Attributes::PrevHalfedge)>
114 HasPrevHalfedge;
115
116 //
117
118 typedef typename _t2vp< Point >::prop GeoPositions;
119 typedef typename _t2vn< Normal >::prop GeoNormals;
120 typedef typename _t2vc< Color >::prop GeoColors;
121 typedef typename _t2vtc< TexCoord >::prop GeoTexCoords;
122
123 // typedef typename Base::GeoPTypes GeoPTypes;
124 // typedef typename Base::GeoPLengths GeoPLengths;
125 // typedef typename Base::GeoIndices GeoIndices;
126
127 //-------------------------------------------------- constructor / destructor
128
129 AttribKernelT() :
130
131 refcount_vnormals_(0),
132 refcount_vcolors_(0),
133 refcount_vtexcoords_(0),
134 refcount_vstatus_(0),
135 refcount_estatus_(0),
136 refcount_ecolors_(0),
137 refcount_hstatus_(0),
138 refcount_fnormals_(0),
139 refcount_fcolors_(0),
140 refcount_fstatus_(0)
141
142 {
143 points_ = add_vpositions( Point(), "v:points" );
144
145 face_types_ = add_fptypes();
146 face_lengths_ = add_fplengths();
147 face_indices_ = add_findices( face_types_, face_lengths_);
148
149 if (VAttribs & Attributes::Normal)
150 request_vertex_normals();
151
152 if (VAttribs & Attributes::Color)
153 request_vertex_colors();
154
155 if (VAttribs & Attributes::TexCoord)
156 request_vertex_texcoords();
157
158 if (VAttribs & Attributes::Status)
159 request_vertex_status();
160
161 if (EAttribs & Attributes::Status)
162 request_edge_status();
163
164 if (EAttribs & Attributes::Color)
165 request_edge_colors();
166
167 if (FAttribs & Attributes::Normal)
168 request_face_normals();
169
170 if (FAttribs & Attributes::Color)
171 request_face_colors();
172
173 if (FAttribs & Attributes::Status)
174 request_face_status();
175 }
176
177 ~AttribKernelT()
178 {
179 // should remove properties, but this will be done in
180 // BaseKernel's destructor anyway...
181 }
182
183
184 // ------------------------------------------------------- copy & assignement
185
186 AttribKernelT( const AttribKernelT& _rhs )
187 : Base( _rhs )
188 {
189 operator=(_rhs);
190 }
191
192 AttribKernelT& operator = ( const AttribKernelT& _rhs )
193 {
194 // remove old properties
195 remove_property(points_);
196 remove_property(vertex_normals_);
197 remove_property(vertex_colors_);
198 remove_property(vertex_texcoords_);
199 remove_property(vertex_status_);
200 remove_property(halfedge_status_);
201 remove_property(edge_status_);
202 remove_property(edge_colors_);
203 remove_property(face_normals_);
204 remove_property(face_colors_);
205 remove_property(face_status_);
206
207 // parent deep-copies properties
208 BaseKernel::operator=(_rhs);
209
210 // copy property handles
211 points_ = _rhs.points_;
212 vertex_normals_ = _rhs.vertex_normals_;
213 vertex_colors_ = _rhs.vertex_colors_;
214 vertex_texcoords_ = _rhs.vertex_texcoords_;
215 vertex_status_ = _rhs.vertex_status_;
216 halfedge_status_ = _rhs.halfedge_status_;
217 edge_status_ = _rhs.edge_status_;
218 edge_colors_ = _rhs.edge_colors_;
219 face_normals_ = _rhs.face_normals_;
220 face_colors_ = _rhs.face_colors_;
221 face_status_ = _rhs.face_status_;
222
223 // copy ref-counts
224 refcount_vnormals_ = _rhs.refcount_vnormals_;
225 refcount_vcolors_ = _rhs.refcount_vcolors_;
226 refcount_vtexcoords_ = _rhs.refcount_vtexcoords_;
227 refcount_vstatus_ = _rhs.refcount_vstatus_;
228 refcount_hstatus_ = _rhs.refcount_hstatus_;
229 refcount_estatus_ = _rhs.refcount_estatus_;
230 refcount_ecolors_ = _rhs.refcount_ecolors_;
231 refcount_fnormals_ = _rhs.refcount_fnormals_;
232 refcount_fcolors_ = _rhs.refcount_fcolors_;
233 refcount_fstatus_ = _rhs.refcount_fstatus_;
234
235 return *this;
236 }
237
238 //------------------------------------------------------------ osg properties
239
240 //------------------------------ vertex property
241
242 typename GeoPositions::property_ptr_t osg_vpositions()
243 { return vpositions(points_).osg_ptr(); }
244
245 typename GeoNormals::property_ptr_t osg_vnormals()
246 { return vnormals(vertex_normals_).osg_ptr(); }
247
248 typename GeoColors::property_ptr_t osg_vcolors()
249 { return vcolors(vertex_colors_).osg_ptr(); }
250
251 typename GeoTexCoords::property_ptr_t osg_vtexcoords()
252 { return vtexcoords(vertex_texcoords_).osg_ptr(); }
253
254 //------------------------------ edge property
255
256 typename GeoColors::property_ptr_t osg_ecolors()
257 { return ecolors(edge_colors_).osg_ptr(); }
258
259 //------------------------------ face property
260
261 GeoPTypes::property_ptr_t osg_ptypes()
262 { return fptypes( face_types_ ).osg_ptr(); }
263
264 GeoPLengths::property_ptr_t osg_plengths()
265 { return fplengths( face_lengths_ ).osg_ptr(); }
266
267 typename GeoIndices::property_ptr_t osg_indices()
268 { return findices( face_indices_ ).osg_ptr(); }
269
270
271 //---------------------------------------- set osg geo property
272
273 //------------------------------ face property
274
275 void set_face_types( FaceHandle _fh, GeoPTypes::value_type _t)
276 { fptypes( face_types_, _fh ) = _t; }
277
278 void set_face_lengths( FaceHandle _fh, GeoPLengths::value_type _l)
279 { fplengths( face_lengths_, _fh ) = _l; }
280
281 void set_face_indices( FaceHandle _fh,
282 typename GeoIndices::value_type _i)
283 { findices( face_indices_, _fh ) = _i; }
284
285 //--------------------------------------------------------- set/get properties
286
287 //---------------------------------------- points
288
289 const Point* points() const
290 { return vpositions( points_ ).data(); }
291
292 const Point& point(VertexHandle _vh) const
293 { return vpositions( points_, _vh); }
294
295 void set_point(VertexHandle _vh, const Point& _p)
296 { vpositions( points_, _vh ) = _p; }
297
298
299 //---------------------------------------- vertex normals
300
301 const Normal* vertex_normals() const {
302 return vnormals(vertex_normals_).data();
303 }
304
305 const Normal& normal(VertexHandle _vh) const {
306 return vnormals(vertex_normals_, _vh);
307 }
308
309 void set_normal(VertexHandle _vh, const Normal& _n) {
310 vnormals(vertex_normals_, _vh) = _n;
311 }
312
313
314 //---------------------------------------- vertex colors
315
316 const Color* vertex_colors() const {
317 return vcolors(vertex_colors_).data();
318 }
319
320 const Color& color(VertexHandle _vh) const {
321 return vcolors(vertex_colors_, _vh);
322 }
323
324 void set_color(VertexHandle _vh, const Color& _c) {
325 vcolors(vertex_colors_, _vh) = _c;
326 }
327
328
329 //---------------------------------------- vertex texcoords
330
331 const TexCoord* texcoords() const {
332 return vtexcoords(vertex_texcoords_).data();
333 }
334
335 const TexCoord& texcoord(VertexHandle _vh) const {
336 return vtexcoords(vertex_texcoords_, _vh);
337 }
338
339 void set_texcoord(VertexHandle _vh, const TexCoord& _t) {
340 vtexcoords(vertex_texcoords_, _vh) = _t;
341 }
342
343
344 //---------------------------------------- vertex status
345
346 const StatusInfo& status(VertexHandle _vh) const {
347 return property(vertex_status_, _vh);
348 }
349
350 StatusInfo& status(VertexHandle _vh) {
351 return property(vertex_status_, _vh);
352 }
353
354
355 //---------------------------------------- halfedge status
356
357 const StatusInfo& status(HalfedgeHandle _eh) const {
358 return property(halfedge_status_, _eh);
359 }
360
361 StatusInfo& status(HalfedgeHandle _eh) {
362 return property(halfedge_status_, _eh);
363 }
364
365
366 //---------------------------------------- edge status
367
368 const StatusInfo& status(EdgeHandle _eh) const {
369 return property(edge_status_, _eh);
370 }
371
372 StatusInfo& status(EdgeHandle _eh) {
373 return property(edge_status_, _eh);
374 }
375
376 //---------------------------------------- edge colors
377
378 const Color* edge_colors() const {
379 return ecolors(edge_colors_).data();
380 }
381
382 const Color& color(EdgeHandle _eh) const {
383 return ecolors(edge_colors_, _eh);
384 }
385
386 void set_color(EdgeHandle _eh, const Color& _c) {
387 ecolors(edge_colors_, _eh) = _c;
388 }
389
390
391 //---------------------------------------- face status
392
393 const StatusInfo& status(FaceHandle _fh) const {
394 return property(face_status_, _fh);
395 }
396
397 StatusInfo& status(FaceHandle _fh) {
398 return property(face_status_, _fh);
399 }
400
401
402 //---------------------------------------- face normals
403
404 const Normal& normal(FaceHandle _fh) const {
405 return property(face_normals_, _fh);
406 }
407
408 void set_normal(FaceHandle _fh, const Normal& _n) {
409 property(face_normals_, _fh) = _n;
410 }
411
412
413 //---------------------------------------- face colors
414
415 const Color& color(FaceHandle _fh) const {
416 return property(face_colors_, _fh);
417 }
418
419 void set_color(FaceHandle _fh, const Color& _c) {
420 property(face_colors_, _fh) = _c;
421 }
422
423
424
425 //------------------------------------------------ request / alloc properties
426
427 void request_vertex_normals() {
428 if (!refcount_vnormals_++)
429 vertex_normals_ = add_vnormals( Normal(), "v:normals" );
430 }
431
432 void request_vertex_colors() {
433 if (!refcount_vcolors_++)
434 vertex_colors_ = add_vcolors( Color(), "v:colors" );
435 }
436
437 void request_vertex_texcoords() {
438 if (!refcount_vtexcoords_++)
439 vertex_texcoords_ = add_vtexcoords( TexCoord(), "v:texcoords" );
440 }
441
442 void request_vertex_status() {
443 if (!refcount_vstatus_++)
444 add_property( vertex_status_, "v:status" );
445 }
446
447 void request_halfedge_status() {
448 if (!refcount_hstatus_++)
449 add_property( halfedge_status_, "h:status" );
450 }
451
452 void request_edge_status() {
453 if (!refcount_estatus_++)
454 add_property( edge_status_, "e:status" );
455 }
456
457 void request_edge_colors() {
458 if (!refcount_ecolors_++)
459 edge_colors_ = add_ecolors( Color(), "e:colors" );
460 }
461
462 void request_face_normals() {
463 if (!refcount_fnormals_++)
464 add_property( face_normals_, "f:normals" );
465 }
466
467 void request_face_colors() {
468 if (!refcount_fcolors_++)
469 add_property( face_colors_, "f:colors" );
470 }
471
472 void request_face_status() {
473 if (!refcount_fstatus_++)
474 add_property( face_status_, "f:status" );
475 }
476
477
478
479 //------------------------------------------------- release / free properties
480
481 void release_vertex_normals() {
482 if ((refcount_vnormals_ > 0) && (! --refcount_vnormals_))
483 remove_property(vertex_normals_);
484 }
485
486 void release_vertex_colors() {
487 if ((refcount_vcolors_ > 0) && (! --refcount_vcolors_))
488 remove_property(vertex_colors_);
489 }
490
491 void release_vertex_texcoords() {
492 if ((refcount_vtexcoords_ > 0) && (! --refcount_vtexcoords_))
493 remove_property(vertex_texcoords_);
494 }
495
496 void release_vertex_status() {
497 if ((refcount_vstatus_ > 0) && (! --refcount_vstatus_))
498 remove_property(vertex_status_);
499 }
500
501 void release_halfedge_status() {
502 if ((refcount_hstatus_ > 0) && (! --refcount_hstatus_))
503 remove_property(halfedge_status_);
504 }
505
506 void release_edge_status() {
507 if ((refcount_estatus_ > 0) && (! --refcount_estatus_))
508 remove_property(edge_status_);
509 }
510
511 void release_edge_colors() {
512 if ((refcount_ecolors_ > 0) && (! --refcount_ecolors_))
513 remove_property(edge_colors_);
514 }
515
516 void release_face_normals() {
517 if ((refcount_fnormals_ > 0) && (! --refcount_fnormals_))
518 remove_property(face_normals_);
519 }
520
521 void release_face_colors() {
522 if ((refcount_fcolors_ > 0) && (! --refcount_fcolors_))
523 remove_property(face_colors_);
524 }
525
526 void release_face_status() {
527 if ((refcount_fstatus_ > 0) && (! --refcount_fstatus_))
528 remove_property(face_status_);
529 }
530
531
532 //----------------------------------------------- static check for properties
533
534 typedef
535 GenProg::Bool2Type<(bool)(VAttribs & Attributes::Normal)>
536 HasVertexNormals;
537
538 typedef
539 GenProg::Bool2Type<(bool)(VAttribs & Attributes::Color)>
540 HasVertexColors;
541
542 typedef
543 GenProg::Bool2Type<(bool)(VAttribs & Attributes::TexCoord)>
544 HasVertexTexCoords;
545
546 typedef
547 GenProg::Bool2Type<(bool)(VAttribs & Attributes::Status)>
548 HasVertexStatus;
549
550
551 typedef
552 GenProg::Bool2Type<(bool)(HAttribs & Attributes::PrevHalfedge)>
553 HasPrevHalfedge;
554
555 typedef
556 GenProg::Bool2Type<(bool)(HAttribs & Attributes::Status)>
557 HasHalfedgeStatus;
558
559
560 typedef
561 GenProg::Bool2Type<(bool)(EAttribs & Attributes::Status)>
562 HasEdgeStatus;
563
564 typedef
565 GenProg::Bool2Type<(bool)(EAttribs & Attributes::Color)>
566 HasEdgeColors;
567
568
569 typedef
570 GenProg::Bool2Type<(bool)(FAttribs & Attributes::Normal)>
571 HasFaceNormals;
572
573 typedef
574 GenProg::Bool2Type<(bool)(FAttribs & Attributes::Color)>
575 HasFaceColors;
576
577 typedef
578 GenProg::Bool2Type<(bool)(FAttribs & Attributes::Status)>
579 HasFaceStatus;
580
581
582 //---------------------------------------------- dynamic check for properties
583
584 bool has_vertex_normals() const { return vertex_normals_.is_valid(); }
585 bool has_vertex_colors() const { return vertex_colors_.is_valid(); }
586 bool has_vertex_texcoords() const { return vertex_texcoords_.is_valid(); }
587 bool has_vertex_status() const { return vertex_status_.is_valid(); }
588 bool has_edge_status() const { return edge_status_.is_valid(); }
589 bool has_halfedge_status() const { return halfedge_status_.is_valid(); }
590 bool has_edge_colors() const { return edge_colors_.is_valid(); }
591 bool has_face_normals() const { return face_normals_.is_valid(); }
592 bool has_face_colors() const { return face_colors_.is_valid(); }
593 bool has_face_status() const { return face_status_.is_valid(); }
594
595 static bool has_prev_halfedge() {
596 return (HAttribs & Attributes::PrevHalfedge);
597 }
598
599
600 public:
601
602 osg::GeometryPtr createGeometryPtr()
603 {
604 using namespace osg;
605 GeometryPtr geo=Geometry::create();
606 return bind(geo) ? geo : NullFC;
607 }
608
609 // create new geometry core from mesh
610 bool bind( osg::GeometryPtr& _geo )
611 {
612 using namespace osg;
613
614 int Mask =
615 Geometry::TypesFieldMask |
616 Geometry::LengthsFieldMask |
617 Geometry::IndicesFieldMask |
618 Geometry::PositionsFieldMask;
619
620 if ( has_vertex_colors() )
621 Mask |= Geometry::ColorsFieldMask;
622 if ( has_vertex_normals() )
623 Mask |= Geometry::NormalsFieldMask;
624 if ( has_vertex_texcoords() )
625 Mask |= Geometry::TexCoordsFieldMask;
626
627 // std::clog << "#ptypes : " << osg_ptypes()->getSize() << std::endl;
628 // std::clog << "#plengths : " << osg_plengths()->getSize() << std::endl;
629 // std::clog << "#indices : " << osg_indices()->getSize() << std::endl;
630 // std::clog << "#points : " << osg_vpositions()->getSize() << std::endl;
631
632 beginEditCP( _geo, Mask );
633 {
634 addRefCP( osg_ptypes() );
635 _geo->setTypes ( osg_ptypes() );
636 addRefCP( osg_plengths() );
637 _geo->setLengths ( osg_plengths() );
638 addRefCP( osg_indices() );
639 _geo->setIndices ( osg_indices() );
640 addRefCP( osg_vpositions() );
641 _geo->setPositions( osg_vpositions() );
642
643 if ( has_vertex_colors() )
644 {
645 addRefCP( osg_vcolors() );
646 _geo->setColors ( osg_vcolors() );
647 }
648 if ( has_vertex_normals() )
649 {
650 addRefCP( osg_vnormals() );
651 _geo->setNormals ( osg_vnormals() );
652 }
653 if ( has_vertex_texcoords() )
654 {
655 addRefCP( osg_vtexcoords() );
656 _geo->setTexCoords( osg_vtexcoords() );
657 }
658 }
659 endEditCP (_geo, Mask);
660
661 return true;
662 }
663
664 private:
665
666 VPropHandleT<Point> points_;
667 VPropHandleT<Normal> vertex_normals_;
668 VPropHandleT<Color> vertex_colors_;
669 VPropHandleT<TexCoord> vertex_texcoords_;
670 VPropHandleT<StatusInfo> vertex_status_;
671
672 FPTypesHandle face_types_;
673 FPLengthsHandle face_lengths_;
674 FIndicesHandle face_indices_;
675
676 EPropHandleT<StatusInfo> edge_status_;
677 EPropHandleT<StatusInfo> edge_colors_;
678 HPropHandleT<StatusInfo> halfedge_status_;
679
680 FPropHandleT<Normal> face_normals_;
681 FPropHandleT<Color> face_colors_;
682 FPropHandleT<StatusInfo> face_status_;
683
684 unsigned int refcount_vnormals_;
685 unsigned int refcount_vcolors_;
686 unsigned int refcount_vtexcoords_;
687 unsigned int refcount_vstatus_;
688 unsigned int refcount_estatus_;
689 unsigned int refcount_ecolors_;
690 unsigned int refcount_hstatus_;
691 unsigned int refcount_fnormals_;
692 unsigned int refcount_fcolors_;
693 unsigned int refcount_fstatus_;
694
695 };
696
697
698 //=============================================================================
699 } // namespace Kernel_OSG
700 } // namespace OpenMesh
701 //=============================================================================
702 #endif // OPENMESH_KERNEL_OSG_ATTRIBKERNEL_HH defined
703 //=============================================================================
704
OpenMesh::HalfedgeHandle
Handle for a halfedge entity.
Definition: Handles.hh:132
OpenMesh::Attributes::StatusInfo
Add status information to a base class.
Definition: Status.hh:99
OpenMesh::FaceHandle
Handle for a face entity.
Definition: Handles.hh:146
OpenMesh::Kernel_OSG::bind
bool bind(osg::GeometryPtr &_geo, Mesh &_mesh)
Bind a OpenSG geometry to a mesh.
Definition: bindT.hh:106
Attributes.hh
This file provides some macros containing attribute usage.
OpenMesh::BaseHandle::is_valid
bool is_valid() const
The handle is valid iff the index is not negative.
Definition: Handles.hh:77
OpenMesh
Contains all the mesh ingredients like the polygonal mesh, the triangle mesh, different mesh kernels ...
Definition: MeshItems.hh:64
OpenMesh::FPropHandleT
Handle representing a face property.
Definition: Property.hh:529
OpenMesh::BaseKernel::remove_property
void remove_property(VPropHandleT< T > &_ph)
You should not use this function directly.
Definition: BaseKernel.hh:199
OpenMesh::VPropHandleT< Point >
OpenMesh::VertexHandle
Handle for a vertex entity.
Definition: Handles.hh:125
OpenMesh::BaseKernel::property
PropertyT< T > & property(VPropHandleT< T > _ph)
In most cases you should use the convenient PropertyManager wrapper and use of this function should n...
Definition: BaseKernel.hh:315
OpenMesh::Attributes::Normal
Add normals to mesh item (vertices/faces)
Definition: Attributes.hh:87
OpenMesh::EPropHandleT< StatusInfo >
OpenMesh::Attributes::Color
Add colors to mesh item (vertices/faces/edges)
Definition: Attributes.hh:88
OpenMesh::Kernel_OSG::PropertyKernel
Helper class, extending functionaliy of OpenMesh::BaseKernel to OpenSG specific property adaptors...
Definition: PropertyKernel.hh:73
OpenMesh::Attributes::Status
Add status to mesh item (all items)
Definition: Attributes.hh:90
OpenMesh::BaseKernel::add_property
void add_property(VPropHandleT< T > &_ph, const std::string &_name="<vprop>")
You should not use this function directly.
Definition: BaseKernel.hh:146
OpenMesh::Kernel_OSG::AttribKernelT
This class adds the standard properties to the mesh type.
Definition: AttribKernelT.hh:75
OpenMesh::HPropHandleT< StatusInfo >
OpenMesh::EdgeHandle
Handle for a edge entity.
Definition: Handles.hh:139
OpenMesh::Attributes::PrevHalfedge
Add storage for previous halfedge (halfedges). The bit is set by default in the DefaultTraits.
Definition: Attributes.hh:89