63class AutoPropertyHandleT :
public PropertyHandle_
67 typedef PropertyHandle_ PropertyHandle;
68 typedef PropertyHandle Base;
69 typedef typename PropertyHandle::Value Value;
70 typedef AutoPropertyHandleT<Mesh, PropertyHandle>
78 : m_(NULL), own_property_(
false)
81 AutoPropertyHandleT(
const Self& _other)
82 : Base(_other.idx()), m_(_other.m_), own_property_(
false)
85 explicit AutoPropertyHandleT(Mesh& _m,
const std::string& _pp_name = std::string())
86 { add_property(_m, _pp_name); }
88 AutoPropertyHandleT(Mesh& _m, PropertyHandle _pph)
89 : Base(_pph.idx()), m_(&_m), own_property_(
false)
92 ~AutoPropertyHandleT()
96 m_->remove_property(*
this);
100 inline void add_property(Mesh& _m,
const std::string& _pp_name = std::string())
104 own_property_ = _pp_name.empty() || !m_->get_property_handle(*
this, _pp_name);
107 m_->add_property(*
this, _pp_name);
111 inline void remove_property()
113 assert(own_property_);
114 m_->remove_property(*
this);
115 own_property_ =
false;
119 template <
class _Handle>
120 inline Value& operator [] (_Handle _hnd)
121 {
return m_->property(*
this, _hnd); }
123 template <
class _Handle>
124 inline const Value& operator [] (_Handle _hnd)
const
125 {
return m_->property(*
this, _hnd); }
127 inline bool own_property()
const
128 {
return own_property_; }
130 inline void free_property()
131 { own_property_ =
false; }
Contains all the mesh ingredients like the polygonal mesh, the triangle mesh, different mesh kernels ...
Definition MeshItems.hh:64