Commit 1d292521 authored by Hans-Christian Ebke's avatar Hans-Christian Ebke
Browse files

Core/Utils/PropertyManager: Added createIfNotExists factory method.

git-svn-id: http://www.openmesh.org/svnrepo/OpenMesh/trunk@669 fdac6126-5c0c-442c-9429-916003d36597
parent 3bd89949
...@@ -131,6 +131,18 @@ class PropertyManager { ...@@ -131,6 +131,18 @@ class PropertyManager {
return *this; return *this;
} }
/**
* Create a property manager for the supplied property and mesh.
* If the property doesn't exist, it is created. In any case,
* lifecycle management is disabled.
*/
static PropertyManager createIfNotExists(MeshT &mesh, const char *propname) {
PROPTYPE dummy_prop;
PropertyManager pm(mesh, propname, mesh.get_property_handle(dummy_prop, propname));
pm.retain();
return std::move(pm);
}
#endif #endif
/** /**
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment