Developer Documentation
BaseKernel.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 
45 //=============================================================================
46 //
47 // CLASS BaseKernel
48 //
49 //=============================================================================
50 
51 
52 #ifndef OPENMESH_BASE_KERNEL_HH
53 #define OPENMESH_BASE_KERNEL_HH
54 
55 
56 //== INCLUDES =================================================================
57 
58 
60 // --------------------
61 #include <vector>
62 #include <string>
63 #include <algorithm>
64 #include <iosfwd>
65 // --------------------
66 #include <OpenMesh/Core/Utils/PropertyContainer.hh>
67 
68 
69 //== NAMESPACES ===============================================================
70 
71 
72 namespace OpenMesh {
73 
74 
75 //== CLASS DEFINITION =========================================================
76 
96 
97 class OPENMESHDLLEXPORT BaseKernel
98 {
99 public: //-------------------------------------------- constructor / destructor
100 
101  BaseKernel() {}
102  virtual ~BaseKernel() {
103  vprops_.clear();
104  eprops_.clear();
105  hprops_.clear();
106  fprops_.clear();
107  }
108 
109 
110 public: //-------------------------------------------------- add new properties
111 
113 
115 
140  template <class T>
141  void add_property( VPropHandleT<T>& _ph, const std::string& _name="<vprop>")
142  {
143  _ph = VPropHandleT<T>( vprops_.add(T(), _name) );
144  vprops_.resize(n_vertices());
145  }
146 
147  template <class T>
148  void add_property( HPropHandleT<T>& _ph, const std::string& _name="<hprop>")
149  {
150  _ph = HPropHandleT<T>( hprops_.add(T(), _name) );
151  hprops_.resize(n_halfedges());
152  }
153 
154  template <class T>
155  void add_property( EPropHandleT<T>& _ph, const std::string& _name="<eprop>")
156  {
157  _ph = EPropHandleT<T>( eprops_.add(T(), _name) );
158  eprops_.resize(n_edges());
159  }
160 
161  template <class T>
162  void add_property( FPropHandleT<T>& _ph, const std::string& _name="<fprop>")
163  {
164  _ph = FPropHandleT<T>( fprops_.add(T(), _name) );
165  fprops_.resize(n_faces());
166  }
167 
168  template <class T>
169  void add_property( MPropHandleT<T>& _ph, const std::string& _name="<mprop>")
170  {
171  _ph = MPropHandleT<T>( mprops_.add(T(), _name) );
172  mprops_.resize(1);
173  }
174 
176 
177 
178 public: //--------------------------------------------------- remove properties
179 
181 
182 
193  template <typename T>
195  {
196  if (_ph.is_valid())
197  vprops_.remove(_ph);
198  _ph.reset();
199  }
200 
201  template <typename T>
203  {
204  if (_ph.is_valid())
205  hprops_.remove(_ph);
206  _ph.reset();
207  }
208 
209  template <typename T>
211  {
212  if (_ph.is_valid())
213  eprops_.remove(_ph);
214  _ph.reset();
215  }
216 
217  template <typename T>
219  {
220  if (_ph.is_valid())
221  fprops_.remove(_ph);
222  _ph.reset();
223  }
224 
225  template <typename T>
227  {
228  if (_ph.is_valid())
229  mprops_.remove(_ph);
230  _ph.reset();
231  }
232 
234 
235 public: //------------------------------------------------ get handle from name
236 
238 
239 
253  template <class T>
255  const std::string& _name) const
256  {
257  return (_ph = VPropHandleT<T>(vprops_.handle(T(), _name))).is_valid();
258  }
259 
260  template <class T>
262  const std::string& _name) const
263  {
264  return (_ph = HPropHandleT<T>(hprops_.handle(T(), _name))).is_valid();
265  }
266 
267  template <class T>
269  const std::string& _name) const
270  {
271  return (_ph = EPropHandleT<T>(eprops_.handle(T(), _name))).is_valid();
272  }
273 
274  template <class T>
276  const std::string& _name) const
277  {
278  return (_ph = FPropHandleT<T>(fprops_.handle(T(), _name))).is_valid();
279  }
280 
281  template <class T>
283  const std::string& _name) const
284  {
285  return (_ph = MPropHandleT<T>(mprops_.handle(T(), _name))).is_valid();
286  }
287 
289 
290 public: //--------------------------------------------------- access properties
291 
293 
294 
309  template <class T>
311  return vprops_.property(_ph);
312  }
313  template <class T>
315  return vprops_.property(_ph);
316  }
317 
318  template <class T>
320  return hprops_.property(_ph);
321  }
322  template <class T>
324  return hprops_.property(_ph);
325  }
326 
327  template <class T>
329  return eprops_.property(_ph);
330  }
331  template <class T>
333  return eprops_.property(_ph);
334  }
335 
336  template <class T>
338  return fprops_.property(_ph);
339  }
340  template <class T>
342  return fprops_.property(_ph);
343  }
344 
345  template <class T>
347  return mprops_.property(_ph);
348  }
349  template <class T>
351  return mprops_.property(_ph);
352  }
353 
355 
356 public: //-------------------------------------------- access property elements
357 
359 
360 
367  template <class T>
368  typename VPropHandleT<T>::reference
370  return vprops_.property(_ph)[_vh.idx()];
371  }
372 
373  template <class T>
374  typename VPropHandleT<T>::const_reference
376  return vprops_.property(_ph)[_vh.idx()];
377  }
378 
379 
380  template <class T>
381  typename HPropHandleT<T>::reference
383  return hprops_.property(_ph)[_hh.idx()];
384  }
385 
386  template <class T>
387  typename HPropHandleT<T>::const_reference
389  return hprops_.property(_ph)[_hh.idx()];
390  }
391 
392 
393  template <class T>
394  typename EPropHandleT<T>::reference
396  return eprops_.property(_ph)[_eh.idx()];
397  }
398 
399  template <class T>
400  typename EPropHandleT<T>::const_reference
402  return eprops_.property(_ph)[_eh.idx()];
403  }
404 
405 
406  template <class T>
407  typename FPropHandleT<T>::reference
409  return fprops_.property(_ph)[_fh.idx()];
410  }
411 
412  template <class T>
413  typename FPropHandleT<T>::const_reference
415  return fprops_.property(_ph)[_fh.idx()];
416  }
417 
418 
419  template <class T>
420  typename MPropHandleT<T>::reference
422  return mprops_.property(_ph)[0];
423  }
424 
425  template <class T>
426  typename MPropHandleT<T>::const_reference
428  return mprops_.property(_ph)[0];
429  }
430 
432 
433 
434 public: //------------------------------------------------ copy property
435 
446  template <class T>
448  if(_vh_from.is_valid() && _vh_to.is_valid())
449  vprops_.property(_ph)[_vh_to.idx()] = vprops_.property(_ph)[_vh_from.idx()];
450  }
451 
462  template <class T>
464  if(_hh_from.is_valid() && _hh_to.is_valid())
465  hprops_.property(_ph)[_hh_to.idx()] = hprops_.property(_ph)[_hh_from.idx()];
466  }
467 
478  template <class T>
479  void copy_property(EPropHandleT<T> _ph, EdgeHandle _eh_from, EdgeHandle _eh_to) {
480  if(_eh_from.is_valid() && _eh_to.is_valid())
481  eprops_.property(_ph)[_eh_to.idx()] = eprops_.property(_ph)[_eh_from.idx()];
482  }
483 
494  template <class T>
495  void copy_property(FPropHandleT<T> _ph, FaceHandle _fh_from, FaceHandle _fh_to) {
496  if(_fh_from.is_valid() && _fh_to.is_valid())
497  fprops_.property(_ph)[_fh_to.idx()] = fprops_.property(_ph)[_fh_from.idx()];
498  }
499 
500 
501 public:
502  //------------------------------------------------ copy all properties
503 
511  void copy_all_properties(VertexHandle _vh_from, VertexHandle _vh_to, bool _copyBuildIn = false) {
512 
513  for( PropertyContainer::iterator p_it = vprops_.begin();
514  p_it != vprops_.end(); ++p_it) {
515 
516  // Copy all properties, if build in is true
517  // Otherwise, copy only properties without build in specifier
518  if ( *p_it && ( _copyBuildIn || (*p_it)->name().substr(0,2) != "v:" ) )
519  (*p_it)->copy(_vh_from.idx(), _vh_to.idx());
520 
521  }
522  }
523 
530  void copy_all_properties(HalfedgeHandle _hh_from, HalfedgeHandle _hh_to, bool _copyBuildIn = false) {
531 
532  for( PropertyContainer::iterator p_it = hprops_.begin();
533  p_it != hprops_.end(); ++p_it) {
534 
535  // Copy all properties, if build in is true
536  // Otherwise, copy only properties without build in specifier
537  if ( *p_it && ( _copyBuildIn || (*p_it)->name().substr(0,2) != "h:") )
538  (*p_it)->copy(_hh_from.idx(), _hh_to.idx());
539 
540  }
541  }
542 
549  void copy_all_properties(EdgeHandle _eh_from, EdgeHandle _eh_to, bool _copyBuildIn = false) {
550  for( PropertyContainer::iterator p_it = eprops_.begin();
551  p_it != eprops_.end(); ++p_it) {
552 
553  // Copy all properties, if build in is true
554  // Otherwise, copy only properties without build in specifier
555  if ( *p_it && ( _copyBuildIn || (*p_it)->name().substr(0,2) != "e:") )
556  (*p_it)->copy(_eh_from.idx(), _eh_to.idx());
557 
558  }
559  }
560 
568  void copy_all_properties(FaceHandle _fh_from, FaceHandle _fh_to, bool _copyBuildIn = false) {
569 
570  for( PropertyContainer::iterator p_it = fprops_.begin();
571  p_it != fprops_.end(); ++p_it) {
572 
573  // Copy all properties, if build in is true
574  // Otherwise, copy only properties without build in specifier
575  if ( *p_it && ( _copyBuildIn || (*p_it)->name().substr(0,2) != "f:") )
576  (*p_it)->copy(_fh_from.idx(), _fh_to.idx());
577  }
578 
579  }
580 
586  {
587  this->vprops_ = _other.vprops_;
588  this->eprops_ = _other.eprops_;
589  this->hprops_ = _other.hprops_;
590  this->fprops_ = _other.fprops_;
591  }
592 
593 protected: //------------------------------------------------- low-level access
594 
595 public: // used by non-native kernel and MeshIO, should be protected
596 
597  size_t n_vprops(void) const { return vprops_.size(); }
598 
599  size_t n_eprops(void) const { return eprops_.size(); }
600 
601  size_t n_hprops(void) const { return hprops_.size(); }
602 
603  size_t n_fprops(void) const { return fprops_.size(); }
604 
605  size_t n_mprops(void) const { return mprops_.size(); }
606 
607  BaseProperty* _get_vprop( const std::string& _name)
608  { return vprops_.property(_name); }
609 
610  BaseProperty* _get_eprop( const std::string& _name)
611  { return eprops_.property(_name); }
612 
613  BaseProperty* _get_hprop( const std::string& _name)
614  { return hprops_.property(_name); }
615 
616  BaseProperty* _get_fprop( const std::string& _name)
617  { return fprops_.property(_name); }
618 
619  BaseProperty* _get_mprop( const std::string& _name)
620  { return mprops_.property(_name); }
621 
622  const BaseProperty* _get_vprop( const std::string& _name) const
623  { return vprops_.property(_name); }
624 
625  const BaseProperty* _get_eprop( const std::string& _name) const
626  { return eprops_.property(_name); }
627 
628  const BaseProperty* _get_hprop( const std::string& _name) const
629  { return hprops_.property(_name); }
630 
631  const BaseProperty* _get_fprop( const std::string& _name) const
632  { return fprops_.property(_name); }
633 
634  const BaseProperty* _get_mprop( const std::string& _name) const
635  { return mprops_.property(_name); }
636 
637  BaseProperty& _vprop( size_t _idx ) { return vprops_._property( _idx ); }
638  BaseProperty& _eprop( size_t _idx ) { return eprops_._property( _idx ); }
639  BaseProperty& _hprop( size_t _idx ) { return hprops_._property( _idx ); }
640  BaseProperty& _fprop( size_t _idx ) { return fprops_._property( _idx ); }
641  BaseProperty& _mprop( size_t _idx ) { return mprops_._property( _idx ); }
642 
643  const BaseProperty& _vprop( size_t _idx ) const
644  { return vprops_._property( _idx ); }
645  const BaseProperty& _eprop( size_t _idx ) const
646  { return eprops_._property( _idx ); }
647  const BaseProperty& _hprop( size_t _idx ) const
648  { return hprops_._property( _idx ); }
649  const BaseProperty& _fprop( size_t _idx ) const
650  { return fprops_._property( _idx ); }
651  const BaseProperty& _mprop( size_t _idx ) const
652  { return mprops_._property( _idx ); }
653 
654  size_t _add_vprop( BaseProperty* _bp ) { return vprops_._add( _bp ); }
655  size_t _add_eprop( BaseProperty* _bp ) { return eprops_._add( _bp ); }
656  size_t _add_hprop( BaseProperty* _bp ) { return hprops_._add( _bp ); }
657  size_t _add_fprop( BaseProperty* _bp ) { return fprops_._add( _bp ); }
658  size_t _add_mprop( BaseProperty* _bp ) { return mprops_._add( _bp ); }
659 
660 protected: // low-level access non-public
661 
662  BaseProperty& _vprop( BaseHandle _h )
663  { return vprops_._property( _h.idx() ); }
664  BaseProperty& _eprop( BaseHandle _h )
665  { return eprops_._property( _h.idx() ); }
666  BaseProperty& _hprop( BaseHandle _h )
667  { return hprops_._property( _h.idx() ); }
668  BaseProperty& _fprop( BaseHandle _h )
669  { return fprops_._property( _h.idx() ); }
670  BaseProperty& _mprop( BaseHandle _h )
671  { return mprops_._property( _h.idx() ); }
672 
673  const BaseProperty& _vprop( BaseHandle _h ) const
674  { return vprops_._property( _h.idx() ); }
675  const BaseProperty& _eprop( BaseHandle _h ) const
676  { return eprops_._property( _h.idx() ); }
677  const BaseProperty& _hprop( BaseHandle _h ) const
678  { return hprops_._property( _h.idx() ); }
679  const BaseProperty& _fprop( BaseHandle _h ) const
680  { return fprops_._property( _h.idx() ); }
681  const BaseProperty& _mprop( BaseHandle _h ) const
682  { return mprops_._property( _h.idx() ); }
683 
684 
685 public: //----------------------------------------------------- element numbers
686 
687 
688  virtual size_t n_vertices() const { return 0; }
689  virtual size_t n_halfedges() const { return 0; }
690  virtual size_t n_edges() const { return 0; }
691  virtual size_t n_faces() const { return 0; }
692 
693 
694 protected: //------------------------------------------- synchronize properties
695 
697  void vprops_reserve(size_t _n) const { vprops_.reserve(_n); }
698 
700  void vprops_resize(size_t _n) const { vprops_.resize(_n); }
701 
710  void vprops_resize_if_smaller(size_t _n) const { vprops_.resize_if_smaller(_n); }
711 
712  void vprops_clear() {
713  vprops_.clear();
714  }
715 
716  void vprops_swap(unsigned int _i0, unsigned int _i1) const {
717  vprops_.swap(_i0, _i1);
718  }
719 
720  void hprops_reserve(size_t _n) const { hprops_.reserve(_n); }
721  void hprops_resize(size_t _n) const { hprops_.resize(_n); }
722  void hprops_clear() {
723  hprops_.clear();
724  }
725  void hprops_swap(unsigned int _i0, unsigned int _i1) const {
726  hprops_.swap(_i0, _i1);
727  }
728 
729  void eprops_reserve(size_t _n) const { eprops_.reserve(_n); }
730  void eprops_resize(size_t _n) const { eprops_.resize(_n); }
731  void eprops_clear() {
732  eprops_.clear();
733  }
734  void eprops_swap(unsigned int _i0, unsigned int _i1) const {
735  eprops_.swap(_i0, _i1);
736  }
737 
738  void fprops_reserve(size_t _n) const { fprops_.reserve(_n); }
739  void fprops_resize(size_t _n) const { fprops_.resize(_n); }
740  void fprops_clear() {
741  fprops_.clear();
742  }
743  void fprops_swap(unsigned int _i0, unsigned int _i1) const {
744  fprops_.swap(_i0, _i1);
745  }
746 
747  void mprops_resize(size_t _n) const { mprops_.resize(_n); }
748  void mprops_clear() {
749  mprops_.clear();
750  }
751 
752 public:
753 
754  // uses std::clog as output stream
755  void property_stats() const;
756  void property_stats(std::ostream& _ostr) const;
757 
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;
763 
764  // uses std::clog as output stream
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;
770 
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;
776 
777 public:
778 
779  typedef PropertyContainer::iterator prop_iterator;
780  typedef PropertyContainer::const_iterator const_prop_iterator;
781 
782  prop_iterator vprops_begin() { return vprops_.begin(); }
783  prop_iterator vprops_end() { return vprops_.end(); }
784  const_prop_iterator vprops_begin() const { return vprops_.begin(); }
785  const_prop_iterator vprops_end() const { return vprops_.end(); }
786 
787  prop_iterator eprops_begin() { return eprops_.begin(); }
788  prop_iterator eprops_end() { return eprops_.end(); }
789  const_prop_iterator eprops_begin() const { return eprops_.begin(); }
790  const_prop_iterator eprops_end() const { return eprops_.end(); }
791 
792  prop_iterator hprops_begin() { return hprops_.begin(); }
793  prop_iterator hprops_end() { return hprops_.end(); }
794  const_prop_iterator hprops_begin() const { return hprops_.begin(); }
795  const_prop_iterator hprops_end() const { return hprops_.end(); }
796 
797  prop_iterator fprops_begin() { return fprops_.begin(); }
798  prop_iterator fprops_end() { return fprops_.end(); }
799  const_prop_iterator fprops_begin() const { return fprops_.begin(); }
800  const_prop_iterator fprops_end() const { return fprops_.end(); }
801 
802  prop_iterator mprops_begin() { return mprops_.begin(); }
803  prop_iterator mprops_end() { return mprops_.end(); }
804  const_prop_iterator mprops_begin() const { return mprops_.begin(); }
805  const_prop_iterator mprops_end() const { return mprops_.end(); }
806 
807 private:
808 
809  PropertyContainer vprops_;
810  PropertyContainer hprops_;
811  PropertyContainer eprops_;
812  PropertyContainer fprops_;
813  PropertyContainer mprops_;
814 };
815 
816 
817 //=============================================================================
818 } // namespace OpenMesh
819 //=============================================================================
820 #endif // OPENMESH_BASE_KERNEL_HH defined
821 //=============================================================================
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
EPropHandleT< T >::const_reference property(EPropHandleT< T > _ph, EdgeHandle _eh) const
Definition: BaseKernel.hh:401
bool get_property_handle(MPropHandleT< T > &_ph, const std::string &_name) const
Definition: BaseKernel.hh:282
A a container for properties.
Handle for a vertex entity.
Definition: Handles.hh:120
void remove_property(HPropHandleT< T > &_ph)
Definition: BaseKernel.hh:202
FPropHandleT< T >::const_reference property(FPropHandleT< T > _ph, FaceHandle _fh) const
Definition: BaseKernel.hh:414
PropertyT< T > & mproperty(MPropHandleT< T > _ph)
Definition: BaseKernel.hh:346
void copy_property(FPropHandleT< T > _ph, FaceHandle _fh_from, FaceHandle _fh_to)
Definition: BaseKernel.hh:495
void remove_property(MPropHandleT< T > &_ph)
Definition: BaseKernel.hh:226
MPropHandleT< T >::const_reference property(MPropHandleT< T > _ph) const
Definition: BaseKernel.hh:427
void copy_all_properties(HalfedgeHandle _hh_from, HalfedgeHandle _hh_to, bool _copyBuildIn=false)
Definition: BaseKernel.hh:530
void add_property(EPropHandleT< T > &_ph, const std::string &_name="<eprop>")
Definition: BaseKernel.hh:155
bool get_property_handle(FPropHandleT< T > &_ph, const std::string &_name) const
Definition: BaseKernel.hh:275
void copy_all_properties(FaceHandle _fh_from, FaceHandle _fh_to, bool _copyBuildIn=false)
Definition: BaseKernel.hh:568
void copy_all_properties(EdgeHandle _eh_from, EdgeHandle _eh_to, bool _copyBuildIn=false)
Definition: BaseKernel.hh:549
const PropertyT< T > & property(EPropHandleT< T > _ph) const
Definition: BaseKernel.hh:332
Handle for a halfedge entity.
Definition: Handles.hh:127
PropertyT< T > & property(EPropHandleT< T > _ph)
Definition: BaseKernel.hh:328
bool get_property_handle(EPropHandleT< T > &_ph, const std::string &_name) const
Definition: BaseKernel.hh:268
void remove_property(FPropHandleT< T > &_ph)
Definition: BaseKernel.hh:218
VPropHandleT< T >::reference property(VPropHandleT< T > _ph, VertexHandle _vh)
Definition: BaseKernel.hh:369
HPropHandleT< T >::reference property(HPropHandleT< T > _ph, HalfedgeHandle _hh)
Definition: BaseKernel.hh:382
EPropHandleT< T >::reference property(EPropHandleT< T > _ph, EdgeHandle _eh)
Definition: BaseKernel.hh:395
void vprops_reserve(size_t _n) const
Reserves space for _n elements in all vertex property vectors.
Definition: BaseKernel.hh:697
VPropHandleT< T >::const_reference property(VPropHandleT< T > _ph, VertexHandle _vh) const
Definition: BaseKernel.hh:375
void copy_all_properties(VertexHandle _vh_from, VertexHandle _vh_to, bool _copyBuildIn=false)
Definition: BaseKernel.hh:511
void vprops_resize(size_t _n) const
Resizes all vertex property vectors to the specified size.
Definition: BaseKernel.hh:700
void add_property(VPropHandleT< T > &_ph, const std::string &_name="<vprop>")
Definition: BaseKernel.hh:141
void copy_property(VPropHandleT< T > &_ph, VertexHandle _vh_from, VertexHandle _vh_to)
Definition: BaseKernel.hh:447
PropertyT< T > & property(VPropHandleT< T > _ph)
Definition: BaseKernel.hh:310
FPropHandleT< T >::reference property(FPropHandleT< T > _ph, FaceHandle _fh)
Definition: BaseKernel.hh:408
const PropertyT< T > & property(FPropHandleT< T > _ph) const
Definition: BaseKernel.hh:341
bool get_property_handle(VPropHandleT< T > &_ph, const std::string &_name) const
Definition: BaseKernel.hh:254
Handle for a face entity.
Definition: Handles.hh:141
void vprops_resize_if_smaller(size_t _n) const
Definition: BaseKernel.hh:710
Default property class for any type T.
Definition: Property.hh:89
const PropertyT< T > & property(VPropHandleT< T > _ph) const
Definition: BaseKernel.hh:314
void copy_property(HPropHandleT< T > _ph, HalfedgeHandle _hh_from, HalfedgeHandle _hh_to)
Definition: BaseKernel.hh:463
void remove_property(VPropHandleT< T > &_ph)
Definition: BaseKernel.hh:194
Base class for all handle types.
Definition: Handles.hh:62
PropertyT< T > & property(FPropHandleT< T > _ph)
Definition: BaseKernel.hh:337
Handle for a edge entity.
Definition: Handles.hh:134
int idx() const
Get the underlying index of this handle.
Definition: Handles.hh:69
void add_property(MPropHandleT< T > &_ph, const std::string &_name="<mprop>")
Definition: BaseKernel.hh:169
void add_property(FPropHandleT< T > &_ph, const std::string &_name="<fprop>")
Definition: BaseKernel.hh:162
bool is_valid() const
The handle is valid iff the index is not negative.
Definition: Handles.hh:72
void remove_property(EPropHandleT< T > &_ph)
Definition: BaseKernel.hh:210
HPropHandleT< T >::const_reference property(HPropHandleT< T > _ph, HalfedgeHandle _hh) const
Definition: BaseKernel.hh:388
void copy_property(EPropHandleT< T > _ph, EdgeHandle _eh_from, EdgeHandle _eh_to)
Definition: BaseKernel.hh:479
const PropertyT< T > & property(HPropHandleT< T > _ph) const
Definition: BaseKernel.hh:323
MPropHandleT< T >::reference property(MPropHandleT< T > _ph)
Definition: BaseKernel.hh:421
const PropertyT< T > & mproperty(MPropHandleT< T > _ph) const
Definition: BaseKernel.hh:350
PropertyT< T > & property(HPropHandleT< T > _ph)
Definition: BaseKernel.hh:319
void reset()
reset handle to be invalid
Definition: Handles.hh:75
void add_property(HPropHandleT< T > &_ph, const std::string &_name="<hprop>")
Definition: BaseKernel.hh:148
bool get_property_handle(HPropHandleT< T > &_ph, const std::string &_name) const
Definition: BaseKernel.hh:261