From fc63402d1024cbbc5c852135e66291d8a2e4d680 Mon Sep 17 00:00:00 2001 From: Janis Born Date: Wed, 3 Apr 2019 15:45:23 +0200 Subject: [PATCH] change PropertyManager::operator* to access the property value for mesh properties --- src/OpenMesh/Core/Utils/PropertyManager.hh | 30 +++++++++++++++++----- 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/src/OpenMesh/Core/Utils/PropertyManager.hh b/src/OpenMesh/Core/Utils/PropertyManager.hh index 5bb6aba1..7ee74f6f 100644 --- a/src/OpenMesh/Core/Utils/PropertyManager.hh +++ b/src/OpenMesh/Core/Utils/PropertyManager.hh @@ -325,17 +325,35 @@ class PropertyManager { } /** - * Access the encapsulated property. + * Access the value of the encapsulated mesh property. + * + * Example: + * @code + * PolyMesh m; + * auto description = getOrMakeProperty(m, "description"); + * *description = "This is a very nice mesh."; + * @endcode + * + * @note This method is only used for mesh properties. */ - inline PROPTYPE &operator* () { - return prop_; + typename PROPTYPE::reference& operator*() { + return mesh_->mproperty(prop_)[0]; } /** - * Access the encapsulated property. + * Access the value of the encapsulated mesh property. + * + * Example: + * @code + * PolyMesh m; + * auto description = getProperty(m, "description"); + * std::cout << *description << std::endl; + * @endcode + * + * @note This method is only used for mesh properties. */ - inline const PROPTYPE &operator* () const { - return prop_; + typename PROPTYPE::const_reference& operator*() const { + return mesh_->mproperty(prop_)[0]; } /**