42 #ifndef OPENMESH_AutoPropertyHandleT_HH
43 #define OPENMESH_AutoPropertyHandleT_HH
55 template <
class Mesh_,
class PropertyHandle_>
60 typedef PropertyHandle_ PropertyHandle;
61 typedef PropertyHandle Base;
62 typedef typename PropertyHandle::Value Value;
71 : m_(NULL), own_property_(
false)
75 : Base(_other.idx()), m_(_other.m_), own_property_(
false)
79 { add_property(_m, _pp_name); }
82 : Base(_pph.idx()), m_(&_m), own_property_(
false)
89 m_->remove_property(*
this);
93 inline void add_property(Mesh& _m,
const std::string& _pp_name = std::string())
97 own_property_ = _pp_name.empty() || !m_->get_property_handle(*
this, _pp_name);
100 m_->add_property(*
this, _pp_name);
104 inline void remove_property()
106 assert(own_property_);
107 m_->remove_property(*
this);
108 own_property_ =
false;
112 template <
class _Handle>
113 inline Value& operator [] (_Handle _hnd)
114 {
return m_->property(*
this, _hnd); }
116 template <
class _Handle>
117 inline const Value& operator [] (_Handle _hnd)
const
118 {
return m_->property(*
this, _hnd); }
120 inline bool own_property()
const
121 {
return own_property_; }
123 inline void free_property()
124 { own_property_ =
false; }
130 #endif // OPENMESH_AutoPropertyHandleT_HH defined
Definition: AutoPropertyHandleT.hh:56
Contains all the mesh ingredients like the polygonal mesh, the triangle mesh, different mesh kernels ...
Definition: MeshItems.hh:56