OpenMesh
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  * $Revision$ *
45  * $Date$ *
46  * *
47 \*===========================================================================*/
48 
49 
50 //=============================================================================
51 //
52 // CLASS BaseKernel
53 //
54 //=============================================================================
55 
56 
57 #ifndef OPENMESH_BASE_KERNEL_HH
58 #define OPENMESH_BASE_KERNEL_HH
59 
60 
61 //== INCLUDES =================================================================
62 
63 
64 #include <OpenMesh/Core/System/config.h>
65 // --------------------
66 #include <vector>
67 #include <string>
68 #include <algorithm>
69 #include <iosfwd>
70 // --------------------
71 #include <OpenMesh/Core/Utils/PropertyContainer.hh>
72 
73 
74 //== NAMESPACES ===============================================================
75 
76 
77 namespace OpenMesh {
78 
79 
80 //== CLASS DEFINITION =========================================================
81 
101 
102 class OPENMESHDLLEXPORT BaseKernel
103 {
104 public: //-------------------------------------------- constructor / destructor
105 
106  BaseKernel() {}
107  virtual ~BaseKernel() {
108  vprops_.clear();
109  eprops_.clear();
110  hprops_.clear();
111  fprops_.clear();
112  }
113 
114 
115 public: //-------------------------------------------------- add new properties
116 
118 
120 
145  template <class T>
146  void add_property( VPropHandleT<T>& _ph, const std::string& _name="<vprop>")
147  {
148  _ph = VPropHandleT<T>( vprops_.add(T(), _name) );
149  vprops_.resize(n_vertices());
150  }
151 
152  template <class T>
153  void add_property( HPropHandleT<T>& _ph, const std::string& _name="<hprop>")
154  {
155  _ph = HPropHandleT<T>( hprops_.add(T(), _name) );
156  hprops_.resize(n_halfedges());
157  }
158 
159  template <class T>
160  void add_property( EPropHandleT<T>& _ph, const std::string& _name="<eprop>")
161  {
162  _ph = EPropHandleT<T>( eprops_.add(T(), _name) );
163  eprops_.resize(n_edges());
164  }
165 
166  template <class T>
167  void add_property( FPropHandleT<T>& _ph, const std::string& _name="<fprop>")
168  {
169  _ph = FPropHandleT<T>( fprops_.add(T(), _name) );
170  fprops_.resize(n_faces());
171  }
172 
173  template <class T>
174  void add_property( MPropHandleT<T>& _ph, const std::string& _name="<mprop>")
175  {
176  _ph = MPropHandleT<T>( mprops_.add(T(), _name) );
177  mprops_.resize(1);
178  }
179 
181 
182 
183 public: //--------------------------------------------------- remove properties
184 
186 
187 
198  template <typename T>
200  {
201  if (_ph.is_valid())
202  vprops_.remove(_ph);
203  _ph.reset();
204  }
205 
206  template <typename T>
208  {
209  if (_ph.is_valid())
210  hprops_.remove(_ph);
211  _ph.reset();
212  }
213 
214  template <typename T>
216  {
217  if (_ph.is_valid())
218  eprops_.remove(_ph);
219  _ph.reset();
220  }
221 
222  template <typename T>
224  {
225  if (_ph.is_valid())
226  fprops_.remove(_ph);
227  _ph.reset();
228  }
229 
230  template <typename T>
232  {
233  if (_ph.is_valid())
234  mprops_.remove(_ph);
235  _ph.reset();
236  }
237 
239 
240 public: //------------------------------------------------ get handle from name
241 
243 
244 
258  template <class T>
260  const std::string& _name) const
261  {
262  return (_ph = VPropHandleT<T>(vprops_.handle(T(), _name))).is_valid();
263  }
264 
265  template <class T>
267  const std::string& _name) const
268  {
269  return (_ph = HPropHandleT<T>(hprops_.handle(T(), _name))).is_valid();
270  }
271 
272  template <class T>
274  const std::string& _name) const
275  {
276  return (_ph = EPropHandleT<T>(eprops_.handle(T(), _name))).is_valid();
277  }
278 
279  template <class T>
281  const std::string& _name) const
282  {
283  return (_ph = FPropHandleT<T>(fprops_.handle(T(), _name))).is_valid();
284  }
285 
286  template <class T>
288  const std::string& _name) const
289  {
290  return (_ph = MPropHandleT<T>(mprops_.handle(T(), _name))).is_valid();
291  }
292 
294 
295 public: //--------------------------------------------------- access properties
296 
298 
299 
314  template <class T>
316  return vprops_.property(_ph);
317  }
318  template <class T>
320  return vprops_.property(_ph);
321  }
322 
323  template <class T>
325  return hprops_.property(_ph);
326  }
327  template <class T>
329  return hprops_.property(_ph);
330  }
331 
332  template <class T>
334  return eprops_.property(_ph);
335  }
336  template <class T>
338  return eprops_.property(_ph);
339  }
340 
341  template <class T>
343  return fprops_.property(_ph);
344  }
345  template <class T>
347  return fprops_.property(_ph);
348  }
349 
350  template <class T>
352  return mprops_.property(_ph);
353  }
354  template <class T>
356  return mprops_.property(_ph);
357  }
358 
360 
361 public: //-------------------------------------------- access property elements
362 
364 
365 
372  template <class T>
373  typename VPropHandleT<T>::reference
375  return vprops_.property(_ph)[_vh.idx()];
376  }
377 
378  template <class T>
379  typename VPropHandleT<T>::const_reference
381  return vprops_.property(_ph)[_vh.idx()];
382  }
383 
384 
385  template <class T>
386  typename HPropHandleT<T>::reference
388  return hprops_.property(_ph)[_hh.idx()];
389  }
390 
391  template <class T>
392  typename HPropHandleT<T>::const_reference
394  return hprops_.property(_ph)[_hh.idx()];
395  }
396 
397 
398  template <class T>
399  typename EPropHandleT<T>::reference
401  return eprops_.property(_ph)[_eh.idx()];
402  }
403 
404  template <class T>
405  typename EPropHandleT<T>::const_reference
407  return eprops_.property(_ph)[_eh.idx()];
408  }
409 
410 
411  template <class T>
412  typename FPropHandleT<T>::reference
414  return fprops_.property(_ph)[_fh.idx()];
415  }
416 
417  template <class T>
418  typename FPropHandleT<T>::const_reference
420  return fprops_.property(_ph)[_fh.idx()];
421  }
422 
423 
424  template <class T>
425  typename MPropHandleT<T>::reference
427  return mprops_.property(_ph)[0];
428  }
429 
430  template <class T>
431  typename MPropHandleT<T>::const_reference
433  return mprops_.property(_ph)[0];
434  }
435 
437 
438 
439 public: //------------------------------------------------ copy property
440 
451  template <class T>
453  if(_vh_from.is_valid() && _vh_to.is_valid())
454  vprops_.property(_ph)[_vh_to.idx()] = vprops_.property(_ph)[_vh_from.idx()];
455  }
456 
467  template <class T>
469  if(_hh_from.is_valid() && _hh_to.is_valid())
470  hprops_.property(_ph)[_hh_to.idx()] = hprops_.property(_ph)[_hh_from.idx()];
471  }
472 
483  template <class T>
484  void copy_property(EPropHandleT<T> _ph, EdgeHandle _eh_from, EdgeHandle _eh_to) {
485  if(_eh_from.is_valid() && _eh_to.is_valid())
486  eprops_.property(_ph)[_eh_to.idx()] = eprops_.property(_ph)[_eh_from.idx()];
487  }
488 
499  template <class T>
500  void copy_property(FPropHandleT<T> _ph, FaceHandle _fh_from, FaceHandle _fh_to) {
501  if(_fh_from.is_valid() && _fh_to.is_valid())
502  fprops_.property(_ph)[_fh_to.idx()] = fprops_.property(_ph)[_fh_from.idx()];
503  }
504 
505 
506 public:
507  //------------------------------------------------ copy all properties
508 
516  void copy_all_properties(VertexHandle _vh_from, VertexHandle _vh_to, bool _copyBuildIn = false) {
517 
518  for( PropertyContainer::iterator p_it = vprops_.begin();
519  p_it != vprops_.end(); ++p_it) {
520 
521  // Copy all properties, if build in is true
522  // Otherwise, copy only properties without build in specifier
523  if ( *p_it && ( _copyBuildIn || (*p_it)->name().substr(0,2) != "v:" ) )
524  (*p_it)->copy(_vh_from.idx(), _vh_to.idx());
525 
526  }
527  }
528 
535  void copy_all_properties(HalfedgeHandle _hh_from, HalfedgeHandle _hh_to, bool _copyBuildIn = false) {
536 
537  for( PropertyContainer::iterator p_it = hprops_.begin();
538  p_it != hprops_.end(); ++p_it) {
539 
540  // Copy all properties, if build in is true
541  // Otherwise, copy only properties without build in specifier
542  if ( *p_it && ( _copyBuildIn || (*p_it)->name().substr(0,2) != "h:") )
543  (*p_it)->copy(_hh_from.idx(), _hh_to.idx());
544 
545  }
546  }
547 
554  void copy_all_properties(EdgeHandle _eh_from, EdgeHandle _eh_to, bool _copyBuildIn = false) {
555  for( PropertyContainer::iterator p_it = eprops_.begin();
556  p_it != eprops_.end(); ++p_it) {
557 
558  // Copy all properties, if build in is true
559  // Otherwise, copy only properties without build in specifier
560  if ( *p_it && ( _copyBuildIn || (*p_it)->name().substr(0,2) != "e:") )
561  (*p_it)->copy(_eh_from.idx(), _eh_to.idx());
562 
563  }
564  }
565 
573  void copy_all_properties(FaceHandle _fh_from, FaceHandle _fh_to, bool _copyBuildIn = false) {
574 
575  for( PropertyContainer::iterator p_it = fprops_.begin();
576  p_it != fprops_.end(); ++p_it) {
577 
578  // Copy all properties, if build in is true
579  // Otherwise, copy only properties without build in specifier
580  if ( *p_it && ( _copyBuildIn || (*p_it)->name().substr(0,2) != "f:") )
581  (*p_it)->copy(_fh_from.idx(), _fh_to.idx());
582  }
583 
584  }
585 
591  {
592  this->vprops_ = _other.vprops_;
593  this->eprops_ = _other.eprops_;
594  this->hprops_ = _other.hprops_;
595  this->fprops_ = _other.fprops_;
596  }
597 
598 protected: //------------------------------------------------- low-level access
599 
600 public: // used by non-native kernel and MeshIO, should be protected
601 
602  size_t n_vprops(void) const { return vprops_.size(); }
603 
604  size_t n_eprops(void) const { return eprops_.size(); }
605 
606  size_t n_hprops(void) const { return hprops_.size(); }
607 
608  size_t n_fprops(void) const { return fprops_.size(); }
609 
610  size_t n_mprops(void) const { return mprops_.size(); }
611 
612  BaseProperty* _get_vprop( const std::string& _name)
613  { return vprops_.property(_name); }
614 
615  BaseProperty* _get_eprop( const std::string& _name)
616  { return eprops_.property(_name); }
617 
618  BaseProperty* _get_hprop( const std::string& _name)
619  { return hprops_.property(_name); }
620 
621  BaseProperty* _get_fprop( const std::string& _name)
622  { return fprops_.property(_name); }
623 
624  BaseProperty* _get_mprop( const std::string& _name)
625  { return mprops_.property(_name); }
626 
627  const BaseProperty* _get_vprop( const std::string& _name) const
628  { return vprops_.property(_name); }
629 
630  const BaseProperty* _get_eprop( const std::string& _name) const
631  { return eprops_.property(_name); }
632 
633  const BaseProperty* _get_hprop( const std::string& _name) const
634  { return hprops_.property(_name); }
635 
636  const BaseProperty* _get_fprop( const std::string& _name) const
637  { return fprops_.property(_name); }
638 
639  const BaseProperty* _get_mprop( const std::string& _name) const
640  { return mprops_.property(_name); }
641 
642  BaseProperty& _vprop( size_t _idx ) { return vprops_._property( _idx ); }
643  BaseProperty& _eprop( size_t _idx ) { return eprops_._property( _idx ); }
644  BaseProperty& _hprop( size_t _idx ) { return hprops_._property( _idx ); }
645  BaseProperty& _fprop( size_t _idx ) { return fprops_._property( _idx ); }
646  BaseProperty& _mprop( size_t _idx ) { return mprops_._property( _idx ); }
647 
648  const BaseProperty& _vprop( size_t _idx ) const
649  { return vprops_._property( _idx ); }
650  const BaseProperty& _eprop( size_t _idx ) const
651  { return eprops_._property( _idx ); }
652  const BaseProperty& _hprop( size_t _idx ) const
653  { return hprops_._property( _idx ); }
654  const BaseProperty& _fprop( size_t _idx ) const
655  { return fprops_._property( _idx ); }
656  const BaseProperty& _mprop( size_t _idx ) const
657  { return mprops_._property( _idx ); }
658 
659  size_t _add_vprop( BaseProperty* _bp ) { return vprops_._add( _bp ); }
660  size_t _add_eprop( BaseProperty* _bp ) { return eprops_._add( _bp ); }
661  size_t _add_hprop( BaseProperty* _bp ) { return hprops_._add( _bp ); }
662  size_t _add_fprop( BaseProperty* _bp ) { return fprops_._add( _bp ); }
663  size_t _add_mprop( BaseProperty* _bp ) { return mprops_._add( _bp ); }
664 
665 protected: // low-level access non-public
666 
667  BaseProperty& _vprop( BaseHandle _h )
668  { return vprops_._property( _h.idx() ); }
669  BaseProperty& _eprop( BaseHandle _h )
670  { return eprops_._property( _h.idx() ); }
671  BaseProperty& _hprop( BaseHandle _h )
672  { return hprops_._property( _h.idx() ); }
673  BaseProperty& _fprop( BaseHandle _h )
674  { return fprops_._property( _h.idx() ); }
675  BaseProperty& _mprop( BaseHandle _h )
676  { return mprops_._property( _h.idx() ); }
677 
678  const BaseProperty& _vprop( BaseHandle _h ) const
679  { return vprops_._property( _h.idx() ); }
680  const BaseProperty& _eprop( BaseHandle _h ) const
681  { return eprops_._property( _h.idx() ); }
682  const BaseProperty& _hprop( BaseHandle _h ) const
683  { return hprops_._property( _h.idx() ); }
684  const BaseProperty& _fprop( BaseHandle _h ) const
685  { return fprops_._property( _h.idx() ); }
686  const BaseProperty& _mprop( BaseHandle _h ) const
687  { return mprops_._property( _h.idx() ); }
688 
689 
690 public: //----------------------------------------------------- element numbers
691 
692 
693  virtual size_t n_vertices() const { return 0; }
694  virtual size_t n_halfedges() const { return 0; }
695  virtual size_t n_edges() const { return 0; }
696  virtual size_t n_faces() const { return 0; }
697 
698 
699 protected: //------------------------------------------- synchronize properties
700 
702  void vprops_reserve(size_t _n) const { vprops_.reserve(_n); }
703 
705  void vprops_resize(size_t _n) const { vprops_.resize(_n); }
706 
715  void vprops_resize_if_smaller(size_t _n) const { vprops_.resize_if_smaller(_n); }
716 
717  void vprops_clear() {
718  vprops_.clear();
719  }
720 
721  void vprops_swap(unsigned int _i0, unsigned int _i1) const {
722  vprops_.swap(_i0, _i1);
723  }
724 
725  void hprops_reserve(size_t _n) const { hprops_.reserve(_n); }
726  void hprops_resize(size_t _n) const { hprops_.resize(_n); }
727  void hprops_clear() {
728  hprops_.clear();
729  }
730  void hprops_swap(unsigned int _i0, unsigned int _i1) const {
731  hprops_.swap(_i0, _i1);
732  }
733 
734  void eprops_reserve(size_t _n) const { eprops_.reserve(_n); }
735  void eprops_resize(size_t _n) const { eprops_.resize(_n); }
736  void eprops_clear() {
737  eprops_.clear();
738  }
739  void eprops_swap(unsigned int _i0, unsigned int _i1) const {
740  eprops_.swap(_i0, _i1);
741  }
742 
743  void fprops_reserve(size_t _n) const { fprops_.reserve(_n); }
744  void fprops_resize(size_t _n) const { fprops_.resize(_n); }
745  void fprops_clear() {
746  fprops_.clear();
747  }
748  void fprops_swap(unsigned int _i0, unsigned int _i1) const {
749  fprops_.swap(_i0, _i1);
750  }
751 
752  void mprops_resize(size_t _n) const { mprops_.resize(_n); }
753  void mprops_clear() {
754  mprops_.clear();
755  }
756 
757 public:
758 
759  // uses std::clog as output stream
760  void property_stats() const;
761  void property_stats(std::ostream& _ostr) const;
762 
763  void vprop_stats( std::string& _string ) const;
764  void hprop_stats( std::string& _string ) const;
765  void eprop_stats( std::string& _string ) const;
766  void fprop_stats( std::string& _string ) const;
767  void mprop_stats( std::string& _string ) const;
768 
769  // uses std::clog as output stream
770  void vprop_stats() const;
771  void hprop_stats() const;
772  void eprop_stats() const;
773  void fprop_stats() const;
774  void mprop_stats() const;
775 
776  void vprop_stats(std::ostream& _ostr) const;
777  void hprop_stats(std::ostream& _ostr) const;
778  void eprop_stats(std::ostream& _ostr) const;
779  void fprop_stats(std::ostream& _ostr) const;
780  void mprop_stats(std::ostream& _ostr) const;
781 
782 public:
783 
784  typedef PropertyContainer::iterator prop_iterator;
785  typedef PropertyContainer::const_iterator const_prop_iterator;
786 
787  prop_iterator vprops_begin() { return vprops_.begin(); }
788  prop_iterator vprops_end() { return vprops_.end(); }
789  const_prop_iterator vprops_begin() const { return vprops_.begin(); }
790  const_prop_iterator vprops_end() const { return vprops_.end(); }
791 
792  prop_iterator eprops_begin() { return eprops_.begin(); }
793  prop_iterator eprops_end() { return eprops_.end(); }
794  const_prop_iterator eprops_begin() const { return eprops_.begin(); }
795  const_prop_iterator eprops_end() const { return eprops_.end(); }
796 
797  prop_iterator hprops_begin() { return hprops_.begin(); }
798  prop_iterator hprops_end() { return hprops_.end(); }
799  const_prop_iterator hprops_begin() const { return hprops_.begin(); }
800  const_prop_iterator hprops_end() const { return hprops_.end(); }
801 
802  prop_iterator fprops_begin() { return fprops_.begin(); }
803  prop_iterator fprops_end() { return fprops_.end(); }
804  const_prop_iterator fprops_begin() const { return fprops_.begin(); }
805  const_prop_iterator fprops_end() const { return fprops_.end(); }
806 
807  prop_iterator mprops_begin() { return mprops_.begin(); }
808  prop_iterator mprops_end() { return mprops_.end(); }
809  const_prop_iterator mprops_begin() const { return mprops_.begin(); }
810  const_prop_iterator mprops_end() const { return mprops_.end(); }
811 
812 private:
813 
814  PropertyContainer vprops_;
815  PropertyContainer hprops_;
816  PropertyContainer eprops_;
817  PropertyContainer fprops_;
818  PropertyContainer mprops_;
819 };
820 
821 
822 //=============================================================================
823 } // namespace OpenMesh
824 //=============================================================================
825 #endif // OPENMESH_BASE_KERNEL_HH defined
826 //=============================================================================
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
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 remove_property(EPropHandleT< T > &_ph)
You should not use this function directly.
Definition: BaseKernel.hh:215
FPropHandleT< T >::reference property(FPropHandleT< T > _ph, FaceHandle _fh)
You should not use this function directly.
Definition: BaseKernel.hh:413
void copy_property(HPropHandleT< T > _ph, HalfedgeHandle _hh_from, HalfedgeHandle _hh_to)
You should not use this function directly.
Definition: BaseKernel.hh:468
Contains all the mesh ingredients like the polygonal mesh, the triangle mesh, different mesh kernels ...
Definition: MeshItems.hh:64
FPropHandleT< T >::const_reference property(FPropHandleT< T > _ph, FaceHandle _fh) const
You should not use this function directly.
Definition: BaseKernel.hh:419
void copy_property(VPropHandleT< T > &_ph, VertexHandle _vh_from, VertexHandle _vh_to)
You should not use this function directly.
Definition: BaseKernel.hh:452
void remove_property(FPropHandleT< T > &_ph)
You should not use this function directly.
Definition: BaseKernel.hh:223
int idx() const
Get the underlying index of this handle.
Definition: Handles.hh:74
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
Handle representing a mesh property.
Definition: Property.hh:543
void remove_property(HPropHandleT< T > &_ph)
You should not use this function directly.
Definition: BaseKernel.hh:207
Handle representing a halfedge property.
Definition: Property.hh:501
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
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 remove_property(MPropHandleT< T > &_ph)
You should not use this function directly.
Definition: BaseKernel.hh:231
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
bool get_property_handle(FPropHandleT< T > &_ph, const std::string &_name) const
You should not use this function directly.
Definition: BaseKernel.hh:280
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:590
void add_property(VPropHandleT< T > &_ph, const std::string &_name="<vprop>")
You should not use this function directly.
Definition: BaseKernel.hh:146
void reset()
reset handle to be invalid
Definition: Handles.hh:80
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
void copy_property(FPropHandleT< T > _ph, FaceHandle _fh_from, FaceHandle _fh_to)
You should not use this function directly.
Definition: BaseKernel.hh:500
MPropHandleT< T >::const_reference property(MPropHandleT< T > _ph) const
You should not use this function directly.
Definition: BaseKernel.hh:432
Handle for a halfedge entity.
Definition: Handles.hh:132
This class provides low-level property management like adding/removing properties and access to prope...
Definition: BaseKernel.hh:102
bool get_property_handle(EPropHandleT< T > &_ph, const std::string &_name) const
You should not use this function directly.
Definition: BaseKernel.hh:273
VPropHandleT< T >::const_reference property(VPropHandleT< T > _ph, VertexHandle _vh) const
You should not use this function directly.
Definition: BaseKernel.hh:380
MPropHandleT< T >::reference property(MPropHandleT< T > _ph)
You should not use this function directly.
Definition: BaseKernel.hh:426
void vprops_resize(size_t _n) const
Resizes all vertex property vectors to the specified size.
Definition: BaseKernel.hh:705
Handle representing a face property.
Definition: Property.hh:529
Handle for a face entity.
Definition: Handles.hh:146
HPropHandleT< T >::const_reference property(HPropHandleT< T > _ph, HalfedgeHandle _hh) const
You should not use this function directly.
Definition: BaseKernel.hh:393
Handle representing a vertex property.
Definition: Property.hh:487
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:715
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
HPropHandleT< T >::reference property(HPropHandleT< T > _ph, HalfedgeHandle _hh)
You should not use this function directly.
Definition: BaseKernel.hh:387
bool get_property_handle(HPropHandleT< T > &_ph, const std::string &_name) const
You should not use this function directly.
Definition: BaseKernel.hh:266
Default property class for any type T.
Definition: Property.hh:94
A a container for properties.
Definition: PropertyContainer.hh:67
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
Handle representing an edge property.
Definition: Property.hh:515
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
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
Handle for a vertex entity.
Definition: Handles.hh:125
bool is_valid() const
The handle is valid iff the index is not negative.
Definition: Handles.hh:77
EPropHandleT< T >::const_reference property(EPropHandleT< T > _ph, EdgeHandle _eh) const
You should not use this function directly.
Definition: BaseKernel.hh:406
void vprops_reserve(size_t _n) const
Reserves space for _n elements in all vertex property vectors.
Definition: BaseKernel.hh:702
Abstract class defining the basic interface of a dynamic property.
Definition: BaseProperty.hh:65
void add_property(HPropHandleT< T > &_ph, const std::string &_name="<hprop>")
You should not use this function directly.
Definition: BaseKernel.hh:153
void add_property(FPropHandleT< T > &_ph, const std::string &_name="<fprop>")
You should not use this function directly.
Definition: BaseKernel.hh:167
bool get_property_handle(MPropHandleT< T > &_ph, const std::string &_name) const
You should not use this function directly.
Definition: BaseKernel.hh:287
Handle for a edge entity.
Definition: Handles.hh:139
Base class for all handle types.
Definition: Handles.hh:67
void add_property(EPropHandleT< T > &_ph, const std::string &_name="<eprop>")
You should not use this function directly.
Definition: BaseKernel.hh:160
void add_property(MPropHandleT< T > &_ph, const std::string &_name="<mprop>")
You should not use this function directly.
Definition: BaseKernel.hh:174
VPropHandleT< T >::reference property(VPropHandleT< T > _ph, VertexHandle _vh)
You should not use this function directly.
Definition: BaseKernel.hh:374
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
void remove_property(VPropHandleT< T > &_ph)
You should not use this function directly.
Definition: BaseKernel.hh:199
EPropHandleT< T >::reference property(EPropHandleT< T > _ph, EdgeHandle _eh)
You should not use this function directly.
Definition: BaseKernel.hh:400
bool get_property_handle(VPropHandleT< T > &_ph, const std::string &_name) const
You should not use this function directly.
Definition: BaseKernel.hh:259
void copy_property(EPropHandleT< T > _ph, EdgeHandle _eh_from, EdgeHandle _eh_to)
You should not use this function directly.
Definition: BaseKernel.hh:484
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
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

Project OpenMesh, ©  Computer Graphics Group, RWTH Aachen. Documentation generated using doxygen .