Core/Utils/PropertyManager: Added createIfNotExists factory method.
git-svn-id: http://www.openmesh.org/svnrepo/OpenMesh/trunk@669 fdac6126-5c0c-442c-9429-916003d36597
This commit is contained in:
@@ -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
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user