58class AutoPropertyHandleT :
public PropertyHandle_
62 typedef PropertyHandle_ PropertyHandle;
63 typedef PropertyHandle Base;
64 typedef typename PropertyHandle::Value Value;
65 typedef AutoPropertyHandleT<Mesh, PropertyHandle>
73 : m_(
nullptr), own_property_(
false)
76 AutoPropertyHandleT(
const Self& _other)
77 : Base(_other.idx()), m_(_other.m_), own_property_(
false)
80 explicit AutoPropertyHandleT(Mesh& _m,
const std::string& _pp_name = std::string())
81 { add_property(_m, _pp_name); }
83 AutoPropertyHandleT(Mesh& _m, PropertyHandle _pph)
84 : Base(_pph.idx()), m_(&_m), own_property_(
false)
87 ~AutoPropertyHandleT()
91 m_->remove_property(*
this);
95 inline void add_property(Mesh& _m,
const std::string& _pp_name = std::string())
99 own_property_ = _pp_name.empty() || !m_->get_property_handle(*
this, _pp_name);
102 m_->add_property(*
this, _pp_name);
106 inline void remove_property()
108 assert(own_property_);
109 m_->remove_property(*
this);
110 own_property_ =
false;
114 template <
class _Handle>
115 inline Value& operator [] (_Handle _hnd)
116 {
return m_->property(*
this, _hnd); }
118 template <
class _Handle>
119 inline const Value& operator [] (_Handle _hnd)
const
120 {
return m_->property(*
this, _hnd); }
122 inline bool own_property()
const
123 {
return own_property_; }
125 inline void free_property()
126 { own_property_ =
false; }
Contains all the mesh ingredients like the polygonal mesh, the triangle mesh, different mesh kernels ...
Definition MeshItems.hh:59