57#ifndef OPENMESH_BASE_KERNEL_HH
58#define OPENMESH_BASE_KERNEL_HH
64#include <OpenMesh/Core/System/config.h>
71#include <OpenMesh/Core/Utils/PropertyContainer.hh>
149 vprops_.resize(n_vertices());
156 hprops_.resize(n_halfedges());
163 eprops_.resize(n_edges());
170 fprops_.resize(n_faces());
198 template <
typename T>
206 template <
typename T>
214 template <
typename T>
222 template <
typename T>
230 template <
typename T>
260 const std::string& _name)
const
267 const std::string& _name)
const
274 const std::string& _name)
const
281 const std::string& _name)
const
288 const std::string& _name)
const
316 return vprops_.property(_ph);
320 return vprops_.property(_ph);
325 return hprops_.property(_ph);
329 return hprops_.property(_ph);
334 return eprops_.property(_ph);
338 return eprops_.property(_ph);
343 return fprops_.property(_ph);
347 return fprops_.property(_ph);
352 return mprops_.property(_ph);
356 return mprops_.property(_ph);
373 typename VPropHandleT<T>::reference
375 return vprops_.property(_ph)[_vh.
idx()];
379 typename VPropHandleT<T>::const_reference
381 return vprops_.property(_ph)[_vh.
idx()];
386 typename HPropHandleT<T>::reference
388 return hprops_.property(_ph)[_hh.
idx()];
392 typename HPropHandleT<T>::const_reference
394 return hprops_.property(_ph)[_hh.
idx()];
399 typename EPropHandleT<T>::reference
401 return eprops_.property(_ph)[_eh.
idx()];
405 typename EPropHandleT<T>::const_reference
407 return eprops_.property(_ph)[_eh.
idx()];
412 typename FPropHandleT<T>::reference
414 return fprops_.property(_ph)[_fh.
idx()];
418 typename FPropHandleT<T>::const_reference
420 return fprops_.property(_ph)[_fh.
idx()];
425 typename MPropHandleT<T>::reference
427 return mprops_.property(_ph)[0];
431 typename MPropHandleT<T>::const_reference
433 return mprops_.property(_ph)[0];
454 vprops_.property(_ph)[_vh_to.
idx()] = vprops_.property(_ph)[_vh_from.
idx()];
470 hprops_.property(_ph)[_hh_to.
idx()] = hprops_.property(_ph)[_hh_from.
idx()];
486 eprops_.property(_ph)[_eh_to.
idx()] = eprops_.property(_ph)[_eh_from.
idx()];
502 fprops_.property(_ph)[_fh_to.
idx()] = fprops_.property(_ph)[_fh_from.
idx()];
518 for( PropertyContainer::iterator p_it = vprops_.begin();
519 p_it != vprops_.end(); ++p_it) {
523 if ( *p_it && ( _copyBuildIn || (*p_it)->name().substr(0,2) !=
"v:" ) )
524 (*p_it)->copy(_vh_from.
idx(), _vh_to.
idx());
537 for( PropertyContainer::iterator p_it = hprops_.begin();
538 p_it != hprops_.end(); ++p_it) {
542 if ( *p_it && ( _copyBuildIn || (*p_it)->name().substr(0,2) !=
"h:") )
543 (*p_it)->copy(_hh_from.
idx(), _hh_to.
idx());
555 for( PropertyContainer::iterator p_it = eprops_.begin();
556 p_it != eprops_.end(); ++p_it) {
560 if ( *p_it && ( _copyBuildIn || (*p_it)->name().substr(0,2) !=
"e:") )
561 (*p_it)->copy(_eh_from.
idx(), _eh_to.
idx());
575 for( PropertyContainer::iterator p_it = fprops_.begin();
576 p_it != fprops_.end(); ++p_it) {
580 if ( *p_it && ( _copyBuildIn || (*p_it)->name().substr(0,2) !=
"f:") )
581 (*p_it)->copy(_fh_from.
idx(), _fh_to.
idx());
590 size_t n_vprops(
void)
const {
return vprops_.size(); }
592 size_t n_eprops(
void)
const {
return eprops_.size(); }
594 size_t n_hprops(
void)
const {
return hprops_.size(); }
596 size_t n_fprops(
void)
const {
return fprops_.size(); }
598 size_t n_mprops(
void)
const {
return mprops_.size(); }
601 {
return vprops_.property(_name); }
604 {
return eprops_.property(_name); }
607 {
return hprops_.property(_name); }
610 {
return fprops_.property(_name); }
613 {
return mprops_.property(_name); }
616 {
return vprops_.property(_name); }
619 {
return eprops_.property(_name); }
622 {
return hprops_.property(_name); }
625 {
return fprops_.property(_name); }
628 {
return mprops_.property(_name); }
637 {
return vprops_._property( _idx ); }
639 {
return eprops_._property( _idx ); }
641 {
return hprops_._property( _idx ); }
643 {
return fprops_._property( _idx ); }
645 {
return mprops_._property( _idx ); }
656 {
return vprops_._property( _h.
idx() ); }
658 {
return eprops_._property( _h.
idx() ); }
660 {
return hprops_._property( _h.
idx() ); }
662 {
return fprops_._property( _h.
idx() ); }
664 {
return mprops_._property( _h.
idx() ); }
667 {
return vprops_._property( _h.
idx() ); }
669 {
return eprops_._property( _h.
idx() ); }
671 {
return hprops_._property( _h.
idx() ); }
673 {
return fprops_._property( _h.
idx() ); }
675 {
return mprops_._property( _h.
idx() ); }
710 vprops_.swap(_i0, _i1);
719 hprops_.swap(_i0, _i1);
728 eprops_.swap(_i0, _i1);
737 fprops_.swap(_i0, _i1);
748 void property_stats()
const;
749 void property_stats(std::ostream& _ostr)
const;
751 void vprop_stats( std::string& _string )
const;
752 void hprop_stats( std::string& _string )
const;
753 void eprop_stats( std::string& _string )
const;
754 void fprop_stats( std::string& _string )
const;
755 void mprop_stats( std::string& _string )
const;
758 void vprop_stats()
const;
759 void hprop_stats()
const;
760 void eprop_stats()
const;
761 void fprop_stats()
const;
762 void mprop_stats()
const;
764 void vprop_stats(std::ostream& _ostr)
const;
765 void hprop_stats(std::ostream& _ostr)
const;
766 void eprop_stats(std::ostream& _ostr)
const;
767 void fprop_stats(std::ostream& _ostr)
const;
768 void mprop_stats(std::ostream& _ostr)
const;
Contains all the mesh ingredients like the polygonal mesh, the triangle mesh, different mesh kernels ...
Definition MeshItems.hh:64
This class provides low-level property management like adding/removing properties and access to prope...
Definition BaseKernel.hh:103
void vprops_clear()
You should not use this function directly.
Definition BaseKernel.hh:705
BaseProperty & _hprop(BaseHandle _h)
You should not use this function directly.
Definition BaseKernel.hh:659
prop_iterator mprops_begin()
You should not use this function directly.
Definition BaseKernel.hh:795
BaseProperty * _get_eprop(const std::string &_name)
You should not use this function directly.
Definition BaseKernel.hh:603
void hprops_clear()
You should not use this function directly.
Definition BaseKernel.hh:715
virtual size_t n_vertices() const
You should not use this function directly.
Definition BaseKernel.hh:681
void remove_property(EPropHandleT< T > &_ph)
You should not use this function directly.
Definition BaseKernel.hh:215
size_t n_eprops(void) const
You should not use this function directly.
Definition BaseKernel.hh:592
prop_iterator vprops_end()
You should not use this function directly.
Definition BaseKernel.hh:776
bool get_property_handle(HPropHandleT< T > &_ph, const std::string &_name) const
You should not use this function directly.
Definition BaseKernel.hh:266
const BaseProperty & _eprop(size_t _idx) const
You should not use this function directly.
Definition BaseKernel.hh:638
const BaseProperty * _get_mprop(const std::string &_name) const
You should not use this function directly.
Definition BaseKernel.hh:627
const BaseProperty * _get_hprop(const std::string &_name) const
You should not use this function directly.
Definition BaseKernel.hh:621
bool get_property_handle(EPropHandleT< T > &_ph, const std::string &_name) const
You should not use this function directly.
Definition BaseKernel.hh:273
void remove_property(VPropHandleT< T > &_ph)
You should not use this function directly.
Definition BaseKernel.hh:199
BaseProperty & _eprop(BaseHandle _h)
You should not use this function directly.
Definition BaseKernel.hh:657
const BaseProperty * _get_fprop(const std::string &_name) const
You should not use this function directly.
Definition BaseKernel.hh:624
void add_property(MPropHandleT< T > &_ph, const std::string &_name="<mprop>")
You should not use this function directly.
Definition BaseKernel.hh:174
size_t _add_eprop(BaseProperty *_bp)
You should not use this function directly.
Definition BaseKernel.hh:648
prop_iterator vprops_begin()
You should not use this function directly.
Definition BaseKernel.hh:775
const_prop_iterator vprops_begin() const
You should not use this function directly.
Definition BaseKernel.hh:777
void eprops_swap(unsigned int _i0, unsigned int _i1) const
You should not use this function directly.
Definition BaseKernel.hh:727
void vprops_swap(unsigned int _i0, unsigned int _i1) const
You should not use this function directly.
Definition BaseKernel.hh:709
size_t n_mprops(void) const
You should not use this function directly.
Definition BaseKernel.hh:598
prop_iterator hprops_end()
You should not use this function directly.
Definition BaseKernel.hh:786
BaseProperty & _mprop(BaseHandle _h)
You should not use this function directly.
Definition BaseKernel.hh:663
PropertyT< T > & property(FPropHandleT< T > _ph)
In most cases you should use the convenient PropertyManager wrapper and use of this function should n...
Definition BaseKernel.hh:342
BaseProperty * _get_vprop(const std::string &_name)
You should not use this function directly.
Definition BaseKernel.hh:600
const BaseProperty * _get_eprop(const std::string &_name) const
You should not use this function directly.
Definition BaseKernel.hh:618
prop_iterator hprops_begin()
You should not use this function directly.
Definition BaseKernel.hh:785
BaseProperty * _get_fprop(const std::string &_name)
You should not use this function directly.
Definition BaseKernel.hh:609
BaseProperty & _vprop(size_t _idx)
You should not use this function directly.
Definition BaseKernel.hh:630
PropertyT< T > & mproperty(MPropHandleT< T > _ph)
In most cases you should use the convenient PropertyManager wrapper and use of this function should n...
Definition BaseKernel.hh:351
size_t n_vprops(void) const
You should not use this function directly.
Definition BaseKernel.hh:590
const PropertyT< T > & property(VPropHandleT< T > _ph) const
In most cases you should use the convenient PropertyManager wrapper and use of this function should n...
Definition BaseKernel.hh:319
const BaseProperty & _mprop(BaseHandle _h) const
You should not use this function directly.
Definition BaseKernel.hh:674
void copy_property(EPropHandleT< T > _ph, EdgeHandle _eh_from, EdgeHandle _eh_to)
You should not use this function directly.
Definition BaseKernel.hh:484
virtual size_t n_halfedges() const
You should not use this function directly.
Definition BaseKernel.hh:682
const PropertyT< T > & property(EPropHandleT< T > _ph) const
In most cases you should use the convenient PropertyManager wrapper and use of this function should n...
Definition BaseKernel.hh:337
void remove_property(HPropHandleT< T > &_ph)
You should not use this function directly.
Definition BaseKernel.hh:207
const_prop_iterator fprops_end() const
You should not use this function directly.
Definition BaseKernel.hh:793
void hprops_resize(size_t _n) const
You should not use this function directly.
Definition BaseKernel.hh:714
const_prop_iterator vprops_end() const
You should not use this function directly.
Definition BaseKernel.hh:778
BaseProperty & _eprop(size_t _idx)
You should not use this function directly.
Definition BaseKernel.hh:631
const PropertyT< T > & property(FPropHandleT< T > _ph) const
In most cases you should use the convenient PropertyManager wrapper and use of this function should n...
Definition BaseKernel.hh:346
const_prop_iterator eprops_begin() const
You should not use this function directly.
Definition BaseKernel.hh:782
void vprops_resize_if_smaller(size_t _n) const
Same as vprops_resize() but ignores vertex property vectors that have a size larger than _n.
Definition BaseKernel.hh:703
void remove_property(FPropHandleT< T > &_ph)
You should not use this function directly.
Definition BaseKernel.hh:223
BaseProperty & _fprop(size_t _idx)
You should not use this function directly.
Definition BaseKernel.hh:633
void copy_all_properties(EdgeHandle _eh_from, EdgeHandle _eh_to, bool _copyBuildIn=false)
Copies all properties from one mesh element to another (of the same type)
Definition BaseKernel.hh:554
void fprops_clear()
You should not use this function directly.
Definition BaseKernel.hh:733
size_t n_hprops(void) const
You should not use this function directly.
Definition BaseKernel.hh:594
const BaseProperty & _fprop(size_t _idx) const
You should not use this function directly.
Definition BaseKernel.hh:642
const BaseProperty & _hprop(size_t _idx) const
You should not use this function directly.
Definition BaseKernel.hh:640
size_t _add_vprop(BaseProperty *_bp)
You should not use this function directly.
Definition BaseKernel.hh:647
PropertyT< T > & property(HPropHandleT< T > _ph)
In most cases you should use the convenient PropertyManager wrapper and use of this function should n...
Definition BaseKernel.hh:324
FPropHandleT< T >::reference property(FPropHandleT< T > _ph, FaceHandle _fh)
You should not use this function directly.
Definition BaseKernel.hh:413
const_prop_iterator hprops_begin() const
You should not use this function directly.
Definition BaseKernel.hh:787
virtual size_t n_edges() const
You should not use this function directly.
Definition BaseKernel.hh:683
void vprops_reserve(size_t _n) const
Reserves space for _n elements in all vertex property vectors.
Definition BaseKernel.hh:690
const_prop_iterator hprops_end() const
You should not use this function directly.
Definition BaseKernel.hh:788
prop_iterator fprops_begin()
You should not use this function directly.
Definition BaseKernel.hh:790
void copy_all_properties(FaceHandle _fh_from, FaceHandle _fh_to, bool _copyBuildIn=false)
Copies all properties from one mesh element to another (of the same type)
Definition BaseKernel.hh:573
void hprops_swap(unsigned int _i0, unsigned int _i1) const
You should not use this function directly.
Definition BaseKernel.hh:718
bool get_property_handle(MPropHandleT< T > &_ph, const std::string &_name) const
You should not use this function directly.
Definition BaseKernel.hh:287
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
PropertyContainer::iterator prop_iterator
You should not use this function directly.
Definition BaseKernel.hh:772
const_prop_iterator eprops_end() const
You should not use this function directly.
Definition BaseKernel.hh:783
void fprops_resize(size_t _n) const
You should not use this function directly.
Definition BaseKernel.hh:732
size_t _add_hprop(BaseProperty *_bp)
You should not use this function directly.
Definition BaseKernel.hh:649
PropertyT< T > & property(EPropHandleT< T > _ph)
In most cases you should use the convenient PropertyManager wrapper and use of this function should n...
Definition BaseKernel.hh:333
prop_iterator mprops_end()
You should not use this function directly.
Definition BaseKernel.hh:796
BaseProperty & _fprop(BaseHandle _h)
You should not use this function directly.
Definition BaseKernel.hh:661
void add_property(VPropHandleT< T > &_ph, const std::string &_name="<vprop>")
You should not use this function directly.
Definition BaseKernel.hh:146
const_prop_iterator fprops_begin() const
You should not use this function directly.
Definition BaseKernel.hh:792
const BaseProperty & _hprop(BaseHandle _h) const
You should not use this function directly.
Definition BaseKernel.hh:670
const BaseProperty & _vprop(BaseHandle _h) const
You should not use this function directly.
Definition BaseKernel.hh:666
prop_iterator eprops_begin()
You should not use this function directly.
Definition BaseKernel.hh:780
VPropHandleT< T >::reference property(VPropHandleT< T > _ph, VertexHandle _vh)
You should not use this function directly.
Definition BaseKernel.hh:374
MPropHandleT< T >::reference property(MPropHandleT< T > _ph)
You should not use this function directly.
Definition BaseKernel.hh:426
void mprops_clear()
You should not use this function directly.
Definition BaseKernel.hh:741
EPropHandleT< T >::reference property(EPropHandleT< T > _ph, EdgeHandle _eh)
You should not use this function directly.
Definition BaseKernel.hh:400
const_prop_iterator mprops_end() const
You should not use this function directly.
Definition BaseKernel.hh:798
const BaseProperty & _mprop(size_t _idx) const
You should not use this function directly.
Definition BaseKernel.hh:644
void eprops_resize(size_t _n) const
You should not use this function directly.
Definition BaseKernel.hh:723
virtual size_t n_faces() const
You should not use this function directly.
Definition BaseKernel.hh:684
HPropHandleT< T >::reference property(HPropHandleT< T > _ph, HalfedgeHandle _hh)
You should not use this function directly.
Definition BaseKernel.hh:387
void copy_all_properties(VertexHandle _vh_from, VertexHandle _vh_to, bool _copyBuildIn=false)
Copies all properties from one mesh element to another (of the same type)
Definition BaseKernel.hh:516
BaseProperty & _hprop(size_t _idx)
You should not use this function directly.
Definition BaseKernel.hh:632
void fprops_reserve(size_t _n) const
You should not use this function directly.
Definition BaseKernel.hh:731
void copy_all_properties(HalfedgeHandle _hh_from, HalfedgeHandle _hh_to, bool _copyBuildIn=false)
Copies all properties from one mesh element to another (of the same type)
Definition BaseKernel.hh:535
BaseProperty & _vprop(BaseHandle _h)
You should not use this function directly.
Definition BaseKernel.hh:655
void fprops_swap(unsigned int _i0, unsigned int _i1) const
You should not use this function directly.
Definition BaseKernel.hh:736
bool get_property_handle(VPropHandleT< T > &_ph, const std::string &_name) const
You should not use this function directly.
Definition BaseKernel.hh:259
bool get_property_handle(FPropHandleT< T > &_ph, const std::string &_name) const
You should not use this function directly.
Definition BaseKernel.hh:280
prop_iterator eprops_end()
You should not use this function directly.
Definition BaseKernel.hh:781
const BaseProperty & _fprop(BaseHandle _h) const
You should not use this function directly.
Definition BaseKernel.hh:672
void remove_property(MPropHandleT< T > &_ph)
You should not use this function directly.
Definition BaseKernel.hh:231
void eprops_clear()
You should not use this function directly.
Definition BaseKernel.hh:724
PropertyContainer::const_iterator const_prop_iterator
You should not use this function directly.
Definition BaseKernel.hh:773
void mprops_resize(size_t _n) const
You should not use this function directly.
Definition BaseKernel.hh:740
void hprops_reserve(size_t _n) const
You should not use this function directly.
Definition BaseKernel.hh:713
FPropHandleT< T >::const_reference property(FPropHandleT< T > _ph, FaceHandle _fh) const
You should not use this function directly.
Definition BaseKernel.hh:419
size_t _add_mprop(BaseProperty *_bp)
You should not use this function directly.
Definition BaseKernel.hh:651
BaseProperty & _mprop(size_t _idx)
You should not use this function directly.
Definition BaseKernel.hh:634
HPropHandleT< T >::const_reference property(HPropHandleT< T > _ph, HalfedgeHandle _hh) const
You should not use this function directly.
Definition BaseKernel.hh:393
EPropHandleT< T >::const_reference property(EPropHandleT< T > _ph, EdgeHandle _eh) const
You should not use this function directly.
Definition BaseKernel.hh:406
BaseProperty * _get_mprop(const std::string &_name)
You should not use this function directly.
Definition BaseKernel.hh:612
size_t _add_fprop(BaseProperty *_bp)
You should not use this function directly.
Definition BaseKernel.hh:650
void add_property(FPropHandleT< T > &_ph, const std::string &_name="<fprop>")
You should not use this function directly.
Definition BaseKernel.hh:167
void vprops_resize(size_t _n) const
Resizes all vertex property vectors to the specified size.
Definition BaseKernel.hh:693
const BaseProperty * _get_vprop(const std::string &_name) const
You should not use this function directly.
Definition BaseKernel.hh:615
void add_property(HPropHandleT< T > &_ph, const std::string &_name="<hprop>")
You should not use this function directly.
Definition BaseKernel.hh:153
const BaseProperty & _vprop(size_t _idx) const
You should not use this function directly.
Definition BaseKernel.hh:636
const BaseProperty & _eprop(BaseHandle _h) const
You should not use this function directly.
Definition BaseKernel.hh:668
void copy_property(VPropHandleT< T > &_ph, VertexHandle _vh_from, VertexHandle _vh_to)
You should not use this function directly.
Definition BaseKernel.hh:452
void eprops_reserve(size_t _n) const
You should not use this function directly.
Definition BaseKernel.hh:722
const_prop_iterator mprops_begin() const
You should not use this function directly.
Definition BaseKernel.hh:797
MPropHandleT< T >::const_reference property(MPropHandleT< T > _ph) const
You should not use this function directly.
Definition BaseKernel.hh:432
const PropertyT< T > & property(HPropHandleT< T > _ph) const
In most cases you should use the convenient PropertyManager wrapper and use of this function should n...
Definition BaseKernel.hh:328
void copy_property(FPropHandleT< T > _ph, FaceHandle _fh_from, FaceHandle _fh_to)
You should not use this function directly.
Definition BaseKernel.hh:500
void add_property(EPropHandleT< T > &_ph, const std::string &_name="<eprop>")
You should not use this function directly.
Definition BaseKernel.hh:160
BaseProperty * _get_hprop(const std::string &_name)
You should not use this function directly.
Definition BaseKernel.hh:606
const PropertyT< T > & mproperty(MPropHandleT< T > _ph) const
In most cases you should use the convenient PropertyManager wrapper and use of this function should n...
Definition BaseKernel.hh:355
prop_iterator fprops_end()
You should not use this function directly.
Definition BaseKernel.hh:791
void copy_property(HPropHandleT< T > _ph, HalfedgeHandle _hh_from, HalfedgeHandle _hh_to)
You should not use this function directly.
Definition BaseKernel.hh:468
size_t n_fprops(void) const
You should not use this function directly.
Definition BaseKernel.hh:596
VPropHandleT< T >::const_reference property(VPropHandleT< T > _ph, VertexHandle _vh) const
You should not use this function directly.
Definition BaseKernel.hh:380
Base class for all handle types.
Definition Handles.hh:68
bool is_valid() const
The handle is valid iff the index is not equal to -1.
Definition Handles.hh:77
void reset()
reset handle to be invalid
Definition Handles.hh:80
int idx() const
Get the underlying index of this handle.
Definition Handles.hh:74
Handle for a vertex entity.
Definition Handles.hh:126
Handle for a halfedge entity.
Definition Handles.hh:133
Handle for a edge entity.
Definition Handles.hh:140
Handle for a face entity.
Definition Handles.hh:147
Abstract class defining the basic interface of a dynamic property.
Definition BaseProperty.hh:66
Default property class for any type T.
Definition Property.hh:95
Handle representing a vertex property.
Definition Property.hh:488
Handle representing a halfedge property.
Definition Property.hh:502
Handle representing an edge property.
Definition Property.hh:516
Handle representing a face property.
Definition Property.hh:530
Handle representing a mesh property.
Definition Property.hh:544
A a container for properties.
Definition PropertyContainer.hh:68