 |
OpenMesh
|
52 #ifndef OPENMESH_BASE_KERNEL_HH
53 #define OPENMESH_BASE_KERNEL_HH
59 #include <OpenMesh/Core/System/config.h>
66 #include <OpenMesh/Core/Utils/PropertyContainer.hh>
144 vprops_.resize(n_vertices());
151 hprops_.resize(n_halfedges());
158 eprops_.resize(n_edges());
165 fprops_.resize(n_faces());
193 template <
typename T>
201 template <
typename T>
209 template <
typename T>
217 template <
typename T>
225 template <
typename T>
255 const std::string& _name)
const
262 const std::string& _name)
const
269 const std::string& _name)
const
276 const std::string& _name)
const
283 const std::string& _name)
const
311 return vprops_.property(_ph);
315 return vprops_.property(_ph);
320 return hprops_.property(_ph);
324 return hprops_.property(_ph);
329 return eprops_.property(_ph);
333 return eprops_.property(_ph);
338 return fprops_.property(_ph);
342 return fprops_.property(_ph);
347 return mprops_.property(_ph);
351 return mprops_.property(_ph);
368 typename VPropHandleT<T>::reference
370 return vprops_.property(_ph)[_vh.
idx()];
374 typename VPropHandleT<T>::const_reference
376 return vprops_.property(_ph)[_vh.
idx()];
381 typename HPropHandleT<T>::reference
383 return hprops_.property(_ph)[_hh.
idx()];
387 typename HPropHandleT<T>::const_reference
389 return hprops_.property(_ph)[_hh.
idx()];
394 typename EPropHandleT<T>::reference
396 return eprops_.property(_ph)[_eh.
idx()];
400 typename EPropHandleT<T>::const_reference
402 return eprops_.property(_ph)[_eh.
idx()];
407 typename FPropHandleT<T>::reference
409 return fprops_.property(_ph)[_fh.
idx()];
413 typename FPropHandleT<T>::const_reference
415 return fprops_.property(_ph)[_fh.
idx()];
420 typename MPropHandleT<T>::reference
422 return mprops_.property(_ph)[0];
426 typename MPropHandleT<T>::const_reference
428 return mprops_.property(_ph)[0];
449 vprops_.property(_ph)[_vh_to.
idx()] = vprops_.property(_ph)[_vh_from.
idx()];
465 hprops_.property(_ph)[_hh_to.
idx()] = hprops_.property(_ph)[_hh_from.
idx()];
481 eprops_.property(_ph)[_eh_to.
idx()] = eprops_.property(_ph)[_eh_from.
idx()];
497 fprops_.property(_ph)[_fh_to.
idx()] = fprops_.property(_ph)[_fh_from.
idx()];
513 for( PropertyContainer::iterator p_it = vprops_.begin();
514 p_it != vprops_.end(); ++p_it) {
518 if ( *p_it && ( _copyBuildIn || (*p_it)->name().substr(0,2) !=
"v:" ) )
519 (*p_it)->copy(_vh_from.
idx(), _vh_to.
idx());
532 for( PropertyContainer::iterator p_it = hprops_.begin();
533 p_it != hprops_.end(); ++p_it) {
537 if ( *p_it && ( _copyBuildIn || (*p_it)->name().substr(0,2) !=
"h:") )
538 (*p_it)->copy(_hh_from.
idx(), _hh_to.
idx());
550 for( PropertyContainer::iterator p_it = eprops_.begin();
551 p_it != eprops_.end(); ++p_it) {
555 if ( *p_it && ( _copyBuildIn || (*p_it)->name().substr(0,2) !=
"e:") )
556 (*p_it)->copy(_eh_from.
idx(), _eh_to.
idx());
570 for( PropertyContainer::iterator p_it = fprops_.begin();
571 p_it != fprops_.end(); ++p_it) {
575 if ( *p_it && ( _copyBuildIn || (*p_it)->name().substr(0,2) !=
"f:") )
576 (*p_it)->copy(_fh_from.
idx(), _fh_to.
idx());
587 this->vprops_ = _other.vprops_;
588 this->eprops_ = _other.eprops_;
589 this->hprops_ = _other.hprops_;
590 this->fprops_ = _other.fprops_;
597 size_t n_vprops(
void)
const {
return vprops_.size(); }
599 size_t n_eprops(
void)
const {
return eprops_.size(); }
601 size_t n_hprops(
void)
const {
return hprops_.size(); }
603 size_t n_fprops(
void)
const {
return fprops_.size(); }
605 size_t n_mprops(
void)
const {
return mprops_.size(); }
608 {
return vprops_.property(_name); }
611 {
return eprops_.property(_name); }
614 {
return hprops_.property(_name); }
617 {
return fprops_.property(_name); }
620 {
return mprops_.property(_name); }
623 {
return vprops_.property(_name); }
626 {
return eprops_.property(_name); }
629 {
return hprops_.property(_name); }
632 {
return fprops_.property(_name); }
635 {
return mprops_.property(_name); }
644 {
return vprops_._property( _idx ); }
646 {
return eprops_._property( _idx ); }
648 {
return hprops_._property( _idx ); }
650 {
return fprops_._property( _idx ); }
652 {
return mprops_._property( _idx ); }
663 {
return vprops_._property( _h.
idx() ); }
665 {
return eprops_._property( _h.
idx() ); }
667 {
return hprops_._property( _h.
idx() ); }
669 {
return fprops_._property( _h.
idx() ); }
671 {
return mprops_._property( _h.
idx() ); }
674 {
return vprops_._property( _h.
idx() ); }
676 {
return eprops_._property( _h.
idx() ); }
678 {
return hprops_._property( _h.
idx() ); }
680 {
return fprops_._property( _h.
idx() ); }
682 {
return mprops_._property( _h.
idx() ); }
717 vprops_.swap(_i0, _i1);
726 hprops_.swap(_i0, _i1);
735 eprops_.swap(_i0, _i1);
744 fprops_.swap(_i0, _i1);
755 void property_stats()
const;
756 void property_stats(std::ostream& _ostr)
const;
758 void vprop_stats( std::string& _string )
const;
759 void hprop_stats( std::string& _string )
const;
760 void eprop_stats( std::string& _string )
const;
761 void fprop_stats( std::string& _string )
const;
762 void mprop_stats( std::string& _string )
const;
765 void vprop_stats()
const;
766 void hprop_stats()
const;
767 void eprop_stats()
const;
768 void fprop_stats()
const;
769 void mprop_stats()
const;
771 void vprop_stats(std::ostream& _ostr)
const;
772 void hprop_stats(std::ostream& _ostr)
const;
773 void eprop_stats(std::ostream& _ostr)
const;
774 void fprop_stats(std::ostream& _ostr)
const;
775 void mprop_stats(std::ostream& _ostr)
const;
820 #endif // OPENMESH_BASE_KERNEL_HH defined
virtual size_t n_vertices() const
You should not use this function directly.
Definition: BaseKernel.hh:688
void fprops_clear()
You should not use this function directly.
Definition: BaseKernel.hh:740
prop_iterator fprops_begin()
You should not use this function directly.
Definition: BaseKernel.hh:797
BaseProperty * _get_eprop(const std::string &_name)
You should not use this function directly.
Definition: BaseKernel.hh:610
HPropHandleT< T >::const_reference property(HPropHandleT< T > _ph, HalfedgeHandle _hh) const
You should not use this function directly.
Definition: BaseKernel.hh:388
int idx() const
Get the underlying index of this handle.
Definition: Handles.hh:69
void mprops_clear()
You should not use this function directly.
Definition: BaseKernel.hh:748
prop_iterator mprops_begin()
You should not use this function directly.
Definition: BaseKernel.hh:802
const BaseProperty & _hprop(BaseHandle _h) const
You should not use this function directly.
Definition: BaseKernel.hh:677
void remove_property(EPropHandleT< T > &_ph)
You should not use this function directly.
Definition: BaseKernel.hh:210
const BaseProperty & _eprop(BaseHandle _h) const
You should not use this function directly.
Definition: BaseKernel.hh:675
size_t _add_hprop(BaseProperty *_bp)
You should not use this function directly.
Definition: BaseKernel.hh:656
const BaseProperty & _vprop(BaseHandle _h) const
You should not use this function directly.
Definition: BaseKernel.hh:673
BaseProperty * _get_vprop(const std::string &_name)
You should not use this function directly.
Definition: BaseKernel.hh:607
void add_property(HPropHandleT< T > &_ph, const std::string &_name="<hprop>")
You should not use this function directly.
Definition: BaseKernel.hh:148
PropertyContainer::const_iterator const_prop_iterator
You should not use this function directly.
Definition: BaseKernel.hh:780
BaseProperty & _vprop(BaseHandle _h)
You should not use this function directly.
Definition: BaseKernel.hh:662
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:314
Handle for a halfedge entity.
Definition: Handles.hh:127
const BaseProperty * _get_hprop(const std::string &_name) const
You should not use this function directly.
Definition: BaseKernel.hh:628
void eprops_reserve(size_t _n) const
You should not use this function directly.
Definition: BaseKernel.hh:729
prop_iterator hprops_end()
You should not use this function directly.
Definition: BaseKernel.hh:793
void remove_property(VPropHandleT< T > &_ph)
You should not use this function directly.
Definition: BaseKernel.hh:194
void copy_property(VPropHandleT< T > &_ph, VertexHandle _vh_from, VertexHandle _vh_to)
You should not use this function directly.
Definition: BaseKernel.hh:447
EPropHandleT< T >::const_reference property(EPropHandleT< T > _ph, EdgeHandle _eh) const
You should not use this function directly.
Definition: BaseKernel.hh:401
void remove_property(FPropHandleT< T > &_ph)
You should not use this function directly.
Definition: BaseKernel.hh:218
const_prop_iterator mprops_begin() const
You should not use this function directly.
Definition: BaseKernel.hh:804
void remove_property(MPropHandleT< T > &_ph)
You should not use this function directly.
Definition: BaseKernel.hh:226
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:337
BaseProperty & _mprop(size_t _idx)
You should not use this function directly.
Definition: BaseKernel.hh:641
void vprops_swap(unsigned int _i0, unsigned int _i1) const
You should not use this function directly.
Definition: BaseKernel.hh:716
size_t _add_mprop(BaseProperty *_bp)
You should not use this function directly.
Definition: BaseKernel.hh:658
prop_iterator fprops_end()
You should not use this function directly.
Definition: BaseKernel.hh:798
void mprops_resize(size_t _n) const
You should not use this function directly.
Definition: BaseKernel.hh:747
void add_property(VPropHandleT< T > &_ph, const std::string &_name="<vprop>")
You should not use this function directly.
Definition: BaseKernel.hh:141
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:319
size_t _add_vprop(BaseProperty *_bp)
You should not use this function directly.
Definition: BaseKernel.hh:654
virtual size_t n_edges() const
You should not use this function directly.
Definition: BaseKernel.hh:690
void hprops_swap(unsigned int _i0, unsigned int _i1) const
You should not use this function directly.
Definition: BaseKernel.hh:725
void copy_property(FPropHandleT< T > _ph, FaceHandle _fh_from, FaceHandle _fh_to)
You should not use this function directly.
Definition: BaseKernel.hh:495
BaseProperty * _get_hprop(const std::string &_name)
You should not use this function directly.
Definition: BaseKernel.hh:613
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:323
size_t _add_eprop(BaseProperty *_bp)
You should not use this function directly.
Definition: BaseKernel.hh:655
void add_property(FPropHandleT< T > &_ph, const std::string &_name="<fprop>")
You should not use this function directly.
Definition: BaseKernel.hh:162
BaseProperty * _get_fprop(const std::string &_name)
You should not use this function directly.
Definition: BaseKernel.hh:616
const_prop_iterator fprops_end() const
You should not use this function directly.
Definition: BaseKernel.hh:800
const_prop_iterator fprops_begin() const
You should not use this function directly.
Definition: BaseKernel.hh:799
void add_property(MPropHandleT< T > &_ph, const std::string &_name="<mprop>")
You should not use this function directly.
Definition: BaseKernel.hh:169
void reset()
reset handle to be invalid
Definition: Handles.hh:75
BaseProperty & _mprop(BaseHandle _h)
You should not use this function directly.
Definition: BaseKernel.hh:670
size_t n_eprops(void) const
You should not use this function directly.
Definition: BaseKernel.hh:599
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:346
FPropHandleT< T >::const_reference property(FPropHandleT< T > _ph, FaceHandle _fh) const
You should not use this function directly.
Definition: BaseKernel.hh:414
prop_iterator vprops_begin()
You should not use this function directly.
Definition: BaseKernel.hh:782
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:511
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:710
MPropHandleT< T >::const_reference property(MPropHandleT< T > _ph) const
You should not use this function directly.
Definition: BaseKernel.hh:427
VPropHandleT< T >::const_reference property(VPropHandleT< T > _ph, VertexHandle _vh) const
You should not use this function directly.
Definition: BaseKernel.hh:375
const BaseProperty * _get_fprop(const std::string &_name) const
You should not use this function directly.
Definition: BaseKernel.hh:631
const_prop_iterator eprops_end() const
You should not use this function directly.
Definition: BaseKernel.hh:790
const_prop_iterator mprops_end() const
You should not use this function directly.
Definition: BaseKernel.hh:805
BaseProperty & _fprop(BaseHandle _h)
You should not use this function directly.
Definition: BaseKernel.hh:668
const BaseProperty & _vprop(size_t _idx) const
You should not use this function directly.
Definition: BaseKernel.hh:643
void fprops_swap(unsigned int _i0, unsigned int _i1) const
You should not use this function directly.
Definition: BaseKernel.hh:743
size_t n_vprops(void) const
You should not use this function directly.
Definition: BaseKernel.hh:597
Handle for a face entity.
Definition: Handles.hh:141
BaseProperty & _vprop(size_t _idx)
You should not use this function directly.
Definition: BaseKernel.hh:637
const_prop_iterator vprops_begin() const
You should not use this function directly.
Definition: BaseKernel.hh:784
Definition: BaseProperty.hh:60
const BaseProperty * _get_vprop(const std::string &_name) const
You should not use this function directly.
Definition: BaseKernel.hh:622
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:568
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:530
VPropHandleT< T >::reference property(VPropHandleT< T > _ph, VertexHandle _vh)
You should not use this function directly.
Definition: BaseKernel.hh:369
const BaseProperty & _fprop(BaseHandle _h) const
You should not use this function directly.
Definition: BaseKernel.hh:679
void vprops_resize(size_t _n) const
Resizes all vertex property vectors to the specified size.
Definition: BaseKernel.hh:700
const BaseProperty & _fprop(size_t _idx) const
You should not use this function directly.
Definition: BaseKernel.hh:649
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:310
prop_iterator mprops_end()
You should not use this function directly.
Definition: BaseKernel.hh:803
void hprops_resize(size_t _n) const
You should not use this function directly.
Definition: BaseKernel.hh:721
void fprops_reserve(size_t _n) const
You should not use this function directly.
Definition: BaseKernel.hh:738
Definition: Property.hh:496
bool get_property_handle(HPropHandleT< T > &_ph, const std::string &_name) const
You should not use this function directly.
Definition: BaseKernel.hh:261
prop_iterator vprops_end()
You should not use this function directly.
Definition: BaseKernel.hh:783
void remove_property(HPropHandleT< T > &_ph)
You should not use this function directly.
Definition: BaseKernel.hh:202
HPropHandleT< T >::reference property(HPropHandleT< T > _ph, HalfedgeHandle _hh)
You should not use this function directly.
Definition: BaseKernel.hh:382
const_prop_iterator hprops_end() const
You should not use this function directly.
Definition: BaseKernel.hh:795
Handle for a edge entity.
Definition: Handles.hh:134
void hprops_clear()
You should not use this function directly.
Definition: BaseKernel.hh:722
void copy_property(EPropHandleT< T > _ph, EdgeHandle _eh_from, EdgeHandle _eh_to)
You should not use this function directly.
Definition: BaseKernel.hh:479
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:328
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:332
void eprops_resize(size_t _n) const
You should not use this function directly.
Definition: BaseKernel.hh:730
size_t n_hprops(void) const
You should not use this function directly.
Definition: BaseKernel.hh:601
const_prop_iterator hprops_begin() const
You should not use this function directly.
Definition: BaseKernel.hh:794
void vprops_reserve(size_t _n) const
Reserves space for _n elements in all vertex property vectors.
Definition: BaseKernel.hh:697
bool get_property_handle(VPropHandleT< T > &_ph, const std::string &_name) const
You should not use this function directly.
Definition: BaseKernel.hh:254
void add_property(EPropHandleT< T > &_ph, const std::string &_name="<eprop>")
You should not use this function directly.
Definition: BaseKernel.hh:155
Default property class for any type T.
Definition: Property.hh:89
BaseProperty & _hprop(BaseHandle _h)
You should not use this function directly.
Definition: BaseKernel.hh:666
const_prop_iterator eprops_begin() const
You should not use this function directly.
Definition: BaseKernel.hh:789
BaseProperty & _eprop(size_t _idx)
You should not use this function directly.
Definition: BaseKernel.hh:638
void eprops_swap(unsigned int _i0, unsigned int _i1) const
You should not use this function directly.
Definition: BaseKernel.hh:734
FPropHandleT< T >::reference property(FPropHandleT< T > _ph, FaceHandle _fh)
You should not use this function directly.
Definition: BaseKernel.hh:408
bool get_property_handle(FPropHandleT< T > &_ph, const std::string &_name) const
You should not use this function directly.
Definition: BaseKernel.hh:275
const BaseProperty & _hprop(size_t _idx) const
You should not use this function directly.
Definition: BaseKernel.hh:647
prop_iterator eprops_begin()
You should not use this function directly.
Definition: BaseKernel.hh:787
void copy_all_kernel_properties(const BaseKernel &_other)
copy_all_kernel_properties uses the = operator to copy all properties from a given other BaseKernel.
Definition: BaseKernel.hh:585
const BaseProperty & _mprop(BaseHandle _h) const
You should not use this function directly.
Definition: BaseKernel.hh:681
const BaseProperty * _get_mprop(const std::string &_name) const
You should not use this function directly.
Definition: BaseKernel.hh:634
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:341
void eprops_clear()
You should not use this function directly.
Definition: BaseKernel.hh:731
bool get_property_handle(MPropHandleT< T > &_ph, const std::string &_name) const
You should not use this function directly.
Definition: BaseKernel.hh:282
bool get_property_handle(EPropHandleT< T > &_ph, const std::string &_name) const
You should not use this function directly.
Definition: BaseKernel.hh:268
A a container for properties.
Definition: PropertyContainer.hh:62
Handle for a vertex entity.
Definition: Handles.hh:120
const BaseProperty * _get_eprop(const std::string &_name) const
You should not use this function directly.
Definition: BaseKernel.hh:625
MPropHandleT< T >::reference property(MPropHandleT< T > _ph)
You should not use this function directly.
Definition: BaseKernel.hh:421
bool is_valid() const
The handle is valid iff the index is not negative.
Definition: Handles.hh:72
const_prop_iterator vprops_end() const
You should not use this function directly.
Definition: BaseKernel.hh:785
size_t n_mprops(void) const
You should not use this function directly.
Definition: BaseKernel.hh:605
EPropHandleT< T >::reference property(EPropHandleT< T > _ph, EdgeHandle _eh)
You should not use this function directly.
Definition: BaseKernel.hh:395
This class provides low-level property management like adding/removing properties and access to prope...
Definition: BaseKernel.hh:97
void copy_property(HPropHandleT< T > _ph, HalfedgeHandle _hh_from, HalfedgeHandle _hh_to)
You should not use this function directly.
Definition: BaseKernel.hh:463
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:549
Definition: Property.hh:524
Definition: Property.hh:482
const BaseProperty & _eprop(size_t _idx) const
You should not use this function directly.
Definition: BaseKernel.hh:645
size_t _add_fprop(BaseProperty *_bp)
You should not use this function directly.
Definition: BaseKernel.hh:657
void fprops_resize(size_t _n) const
You should not use this function directly.
Definition: BaseKernel.hh:739
BaseProperty & _fprop(size_t _idx)
You should not use this function directly.
Definition: BaseKernel.hh:640
virtual size_t n_halfedges() const
You should not use this function directly.
Definition: BaseKernel.hh:689
Definition: Property.hh:538
Base class for all handle types.
Definition: Handles.hh:62
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:350
BaseProperty & _hprop(size_t _idx)
You should not use this function directly.
Definition: BaseKernel.hh:639
BaseProperty * _get_mprop(const std::string &_name)
You should not use this function directly.
Definition: BaseKernel.hh:619
BaseProperty & _eprop(BaseHandle _h)
You should not use this function directly.
Definition: BaseKernel.hh:664
void hprops_reserve(size_t _n) const
You should not use this function directly.
Definition: BaseKernel.hh:720
void vprops_clear()
You should not use this function directly.
Definition: BaseKernel.hh:712
PropertyContainer::iterator prop_iterator
You should not use this function directly.
Definition: BaseKernel.hh:779
prop_iterator hprops_begin()
You should not use this function directly.
Definition: BaseKernel.hh:792
This file contains all code required to use Eigen3 vectors as Mesh vectors.
Definition: MeshItems.hh:59
virtual size_t n_faces() const
You should not use this function directly.
Definition: BaseKernel.hh:691
prop_iterator eprops_end()
You should not use this function directly.
Definition: BaseKernel.hh:788
Definition: Property.hh:510
const BaseProperty & _mprop(size_t _idx) const
You should not use this function directly.
Definition: BaseKernel.hh:651
size_t n_fprops(void) const
You should not use this function directly.
Definition: BaseKernel.hh:603
Project OpenMesh,
© Computer Graphics Group, RWTH Aachen.
Documentation generated using
doxygen
.