Loading...
Searching...
No Matches
PropertyManager.hh
/* ========================================================================= *
* *
* OpenMesh *
* Copyright (c) 2001-2025, RWTH-Aachen University *
* Department of Computer Graphics and Multimedia *
* All rights reserved. *
* www.openmesh.org *
* *
*---------------------------------------------------------------------------*
* This file is part of OpenMesh. *
*---------------------------------------------------------------------------*
* *
* Redistribution and use in source and binary forms, with or without *
* modification, are permitted provided that the following conditions *
* are met: *
* *
* 1. Redistributions of source code must retain the above copyright notice, *
* this list of conditions and the following disclaimer. *
* *
* 2. Redistributions in binary form must reproduce the above copyright *
* notice, this list of conditions and the following disclaimer in the *
* documentation and/or other materials provided with the distribution. *
* *
* 3. Neither the name of the copyright holder nor the names of its *
* contributors may be used to endorse or promote products derived from *
* this software without specific prior written permission. *
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS *
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED *
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A *
* PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER *
* OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, *
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, *
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR *
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF *
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING *
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
* *
* ========================================================================= */
#ifndef PROPERTYMANAGER_HH_
#define PROPERTYMANAGER_HH_
#include <OpenMesh/Core/System/config.h>
#include <OpenMesh/Core/Utils/HandleToPropHandle.hh>
#include <OpenMesh/Core/Mesh/PolyConnectivity.hh>
#include <sstream>
#include <stdexcept>
#include <string>
namespace OpenMesh {
template<typename PROPTYPE, typename MeshT = int>
class PropertyManager {
public:
using Value = typename PROPTYPE::Value;
using value_type = typename PROPTYPE::value_type;
using Handle = typename PROPTYPE::Handle;
using Self = PropertyManager<PROPTYPE, MeshT>;
using Reference = typename PROPTYPE::reference;
using ConstReference = typename PROPTYPE::const_reference;
private:
// Mesh properties (MPropHandleT<...>) are stored differently than the other properties.
// This class implements different behavior when initializing a property or when
// copying or swapping data from one property manager to a another one.
template <typename PropertyManager2, typename PropHandleT>
struct StorageT;
// specialization for Mesh Properties
template <typename PropertyManager2>
struct StorageT<PropertyManager2, MPropHandleT<Value>> {
static void initialize(PropertyManager<PROPTYPE, MeshT>& pm, const Value& initial_value ) {
pm() = initial_value;
}
static void copy(const PropertyManager<PROPTYPE, MeshT>& from, PropertyManager2& to) {
*to = *from;
}
static void swap(PropertyManager<PROPTYPE, MeshT>& from, PropertyManager2& to) {
std::swap(*to, *from);
}
static ConstReference access_property_const(PolyConnectivity& mesh, const PROPTYPE& prop_handle, const Handle&) {
return mesh.property(prop_handle);
}
static Reference access_property(PolyConnectivity& mesh, const PROPTYPE& prop_handle, const Handle&) {
return mesh.property(prop_handle);
}
};
// definition for other Mesh Properties
template <typename PropertyManager2, typename PropHandleT>
struct StorageT {
static void initialize(PropertyManager<PROPTYPE, MeshT>& pm, const Value& initial_value ) {
pm.set_range(pm.mesh_.template all_elements<Handle>(), initial_value);
}
static void copy(const PropertyManager& from, PropertyManager2& to) {
from.copy_to(from.mesh_.template all_elements<Handle>(), to, to.mesh_.template all_elements<Handle>());
}
static void swap(PropertyManager& lhs, PropertyManager2& rhs) {
std::swap(lhs.mesh().property(lhs.prop_).data_vector(), rhs.mesh().property(rhs.prop_).data_vector());
// resize the property to the correct size
lhs.mesh().property(lhs.prop_).resize(lhs.mesh().template n_elements<Handle>());
rhs.mesh().property(rhs.prop_).resize(rhs.mesh().template n_elements<Handle>());
}
static ConstReference access_property_const(PolyConnectivity& mesh, const PROPTYPE& prop_handle, const Handle& handle) {
return mesh.property(prop_handle, handle);
}
static Reference access_property(PolyConnectivity& mesh, const PROPTYPE& prop_handle, const Handle& handle) {
return mesh.property(prop_handle, handle);
}
};
using Storage = StorageT<Self, PROPTYPE>;
public:
OM_DEPRECATED("Use the constructor without parameter 'existing' instead. Check for existance with hasProperty") // As long as this overload exists, initial value must be first parameter due to ambiguity for properties of type bool
PropertyManager(PolyConnectivity& mesh, const char *propname, bool existing) : mesh_(mesh), retain_(existing), name_(propname) {
if (existing) {
if (!PropertyManager::mesh().get_property_handle(prop_, propname)) {
std::ostringstream oss;
oss << "Requested property handle \"" << propname << "\" does not exist.";
throw std::runtime_error(oss.str());
}
} else {
PropertyManager::mesh().add_property(prop_, propname);
}
}
PropertyManager(PolyConnectivity& mesh, const char *propname) : mesh_(mesh), retain_(true), name_(propname) {
if (!PropertyManager::mesh().get_property_handle(prop_, propname)) {
PropertyManager::mesh().add_property(prop_, propname);
}
}
PropertyManager(const Value& initial_value, PolyConnectivity& mesh, const char *propname) : mesh_(mesh), retain_(true), name_(propname) {
if (!mesh_.get_property_handle(prop_, propname)) {
PropertyManager::mesh().add_property(prop_, propname);
Storage::initialize(*this, initial_value);
}
}
explicit PropertyManager(const PolyConnectivity& mesh) : mesh_(mesh), retain_(false), name_("") {
PropertyManager::mesh().add_property(prop_, name_);
}
PropertyManager(const Value& initial_value, const PolyConnectivity& mesh) : mesh_(mesh), retain_(false), name_("") {
PropertyManager::mesh().add_property(prop_, name_);
Storage::initialize(*this, initial_value);
}
PropertyManager(PolyConnectivity& mesh, PROPTYPE property_handle) : mesh_(mesh), prop_(property_handle), retain_(true), name_() {
}
PropertyManager() = delete;
PropertyManager(const PropertyManager& rhs)
:
mesh_(rhs.mesh_),
prop_(),
retain_(rhs.retain_),
name_(rhs.name_)
{
if (rhs.retain_) // named property -> create a property manager referring to the same
{
prop_ = rhs.prop_;
}
else // unnamed property -> create a property manager refering to a new property and copy the contents
{
PropertyManager::mesh().add_property(prop_, name_);
Storage::copy(rhs, *this);
}
}
PropertyManager clone()
{
PropertyManager result(this->mesh());
Storage::copy(*this, result);
return result;
}
PropertyManager& operator=(const PropertyManager& rhs)
{
if (&mesh_ == &rhs.mesh_ && prop_ == rhs.prop_)
; // nothing to do
else
Storage::copy(rhs, *this);
return *this;
}
~PropertyManager() {
deleteProperty();
}
void swap(PropertyManager &rhs) {
// swap the data stored in the properties
Storage::swap(rhs, *this);
}
static bool propertyExists(const PolyConnectivity &mesh, const char *propname) {
PROPTYPE dummy;
return mesh.get_property_handle(dummy, propname);
}
bool isValid() const { return prop_.is_valid(); }
operator bool() const { return isValid(); }
const PROPTYPE &getRawProperty() const { return prop_; }
const std::string &getName() const { return name_; }
template <typename MeshType >
const MeshType& getMesh() const { return dynamic_cast<const MeshType&>(mesh_); }
const MeshT& getMesh() const { return dynamic_cast<const MeshT&>(mesh_); }
OM_DEPRECATED("retain no longer has any effect. Instead, named properties are always retained, while unnamed ones are not.")
void retain(bool = true) {}
PropertyManager(PropertyManager &&rhs)
:
mesh_(rhs.mesh_),
prop_(rhs.prop_),
retain_(rhs.retain_),
name_(rhs.name_)
{
if (!rhs.retain_)
rhs.prop_.invalidate(); // only invalidate unnamed properties
}
PropertyManager& operator=(PropertyManager&& rhs)
{
if ((&mesh_ != &rhs.mesh_) || (prop_ != rhs.prop_))
{
if (rhs.retain_)
{
// retained properties cannot be invalidated. Copy instead
Storage::copy(rhs, *this);
}
else
{
// swap the data stored in the properties
Storage::swap(rhs, *this);
// remove the property from rhs
rhs.mesh().remove_property(rhs.prop_);
// invalidate prop_
rhs.prop_.invalidate();
}
}
return *this;
}
static PropertyManager createIfNotExists(PolyConnectivity &mesh, const char *propname) {
return PropertyManager(mesh, propname);
}
template<typename PROP_VALUE, typename ITERATOR_TYPE>
static PropertyManager createIfNotExists(PolyConnectivity &mesh, const char *propname,
const ITERATOR_TYPE &begin, const ITERATOR_TYPE &end,
const PROP_VALUE &init_value) {
const bool exists = propertyExists(mesh, propname);
PropertyManager pm(mesh, propname, exists);
pm.retain();
if (!exists)
pm.set_range(begin, end, init_value);
return std::move(pm);
}
template<typename PROP_VALUE, typename ITERATOR_RANGE>
static PropertyManager createIfNotExists(PolyConnectivity &mesh, const char *propname,
const ITERATOR_RANGE &range, const PROP_VALUE &init_value) {
return createIfNotExists(
mesh, propname, range.begin(), range.end(), init_value);
}
typename PROPTYPE::reference& operator*() {
return mesh().mproperty(prop_)[0];
}
typename PROPTYPE::const_reference& operator*() const {
return mesh().mproperty(prop_)[0];
}
inline typename PROPTYPE::reference operator[] (Handle handle) {
return mesh().property(prop_, handle);
}
inline typename PROPTYPE::const_reference operator[] (const Handle& handle) const {
return mesh().property(prop_, handle);
}
inline typename PROPTYPE::reference operator() (const Handle& handle = Handle()) {
// return mesh().property(prop_, handle);
return Storage::access_property(mesh(), prop_, handle);
}
inline typename PROPTYPE::const_reference operator() (const Handle& handle = Handle()) const {
// return mesh().property(prop_, handle);
return Storage::access_property_const(mesh(), prop_, handle);
}
template<typename HandleTypeIterator, typename PROP_VALUE>
void set_range(HandleTypeIterator begin, HandleTypeIterator end,
const PROP_VALUE &value) {
for (; begin != end; ++begin)
(*this)[*begin] = value;
}
#if (defined(_MSC_VER) && (_MSC_VER >= 1800)) || __cplusplus > 199711L || defined(__GXX_EXPERIMENTAL_CXX0X__)
template<typename HandleTypeIteratorRange, typename PROP_VALUE>
void set_range(const HandleTypeIteratorRange &range,
const PROP_VALUE &value) {
set_range(range.begin(), range.end(), value);
}
#endif
template<typename HandleTypeIterator, typename PropertyManager2,
typename HandleTypeIterator2>
void copy_to(HandleTypeIterator begin, HandleTypeIterator end,
PropertyManager2 &dst_propmanager,
HandleTypeIterator2 dst_begin, HandleTypeIterator2 dst_end) const {
for (; begin != end && dst_begin != dst_end; ++begin, ++dst_begin) {
dst_propmanager[*dst_begin] = (*this)[*begin];
}
}
template<typename RangeType, typename PropertyManager2,
typename RangeType2>
void copy_to(const RangeType &range,
PropertyManager2 &dst_propmanager,
const RangeType2 &dst_range) const {
copy_to(range.begin(), range.end(), dst_propmanager,
dst_range.begin(), dst_range.end());
}
template<typename RangeType, typename RangeType2>
static void copy(const char *prop_name,
PolyConnectivity &src_mesh, const RangeType &src_range,
PolyConnectivity &dst_mesh, const RangeType2 &dst_range) {
typedef OpenMesh::PropertyManager<PROPTYPE> DstPM;
DstPM dst(DstPM::createIfNotExists(dst_mesh, prop_name));
typedef OpenMesh::PropertyManager<PROPTYPE> SrcPM;
SrcPM src(src_mesh, prop_name, true);
src.copy_to(src_range, dst, dst_range);
}
void set_persistent(bool _persistence = true)
{
mesh().property(getRawProperty()).set_persistent(_persistence);
}
private:
void deleteProperty() {
if (!retain_ && prop_.is_valid())
mesh().remove_property(prop_);
}
PolyConnectivity& mesh() const
{
return const_cast<PolyConnectivity&>(mesh_);
}
private:
const PolyConnectivity& mesh_;
PROPTYPE prop_;
bool retain_;
std::string name_;
};
template <typename PropertyT>
class ConstPropertyViewer
{
public:
using Value = typename PropertyT::Value;
using value_type = typename PropertyT::value_type;
using Handle = typename PropertyT::Handle;
ConstPropertyViewer(const PolyConnectivity& mesh, const PropertyT& property_handle)
:
mesh_(mesh),
prop_(property_handle)
{}
inline const typename PropertyT::const_reference operator() (const Handle& handle)
{
return mesh_.property(prop_, handle);
}
inline const typename PropertyT::const_reference operator[] (const Handle& handle)
{
return mesh_.property(prop_, handle);
}
private:
const PolyConnectivity& mesh_;
PropertyT prop_;
};
template<typename ElementT, typename T>
PropertyManager<typename HandleToPropHandle<ElementT, T>::type>
OM_DEPRECATED("Named temporary properties are deprecated. Either create a temporary without name or a non-temporary with name")
makeTemporaryProperty(PolyConnectivity &mesh, const char *propname) {
return PropertyManager<typename HandleToPropHandle<ElementT, T>::type>(mesh, propname, false);
}
template<typename ElementT, typename T>
PropertyManager<typename HandleToPropHandle<ElementT, T>::type>
makeTemporaryProperty(PolyConnectivity &mesh) {
return PropertyManager<typename HandleToPropHandle<ElementT, T>::type>(mesh);
}
template<typename ElementT, typename T>
bool
hasProperty(const PolyConnectivity &mesh, const char *propname) {
typename HandleToPropHandle<ElementT, T>::type ph;
return mesh.get_property_handle(ph, propname);
}
template<typename ElementT, typename T>
PropertyManager<typename HandleToPropHandle<ElementT, T>::type>
getProperty(PolyConnectivity &mesh, const char *propname) {
if (!hasProperty<ElementT, T>(mesh, propname))
{
std::ostringstream oss;
oss << "Requested property handle \"" << propname << "\" does not exist.";
throw std::runtime_error(oss.str());
}
return PropertyManager<typename HandleToPropHandle<ElementT, T>::type>(mesh, propname);
}
template<typename ElementT, typename T>
PropertyManager<typename HandleToPropHandle<ElementT, T>::type>
getOrMakeProperty(PolyConnectivity &mesh, const char *propname) {
return PropertyManager<typename HandleToPropHandle<ElementT, T>::type>::createIfNotExists(mesh, propname);
}
template<typename PROPTYPE>
OM_DEPRECATED("Use makeTemporaryProperty instead.")
PropertyManager<PROPTYPE> makePropertyManagerFromNew(PolyConnectivity &mesh, const char *propname)
{
return PropertyManager<PROPTYPE>(mesh, propname, false);
}
template<typename PROPTYPE, typename MeshT = int>
OM_DEPRECATED("Use getProperty instead.")
PropertyManager<PROPTYPE, MeshT> makePropertyManagerFromExisting(PolyConnectivity &mesh, const char *propname)
{
return PropertyManager<PROPTYPE, MeshT>(mesh, propname, true);
}
template<typename PROPTYPE, typename MeshT = int>
OM_DEPRECATED("Use getOrMakeProperty instead.")
PropertyManager<PROPTYPE, MeshT> makePropertyManagerFromExistingOrNew(PolyConnectivity &mesh, const char *propname)
{
return PropertyManager<PROPTYPE, MeshT>::createIfNotExists(mesh, propname);
}
template<typename PROPTYPE,
typename ITERATOR_TYPE, typename PROP_VALUE>
OM_DEPRECATED("Use getOrMakeProperty instead.")
PropertyManager<PROPTYPE> makePropertyManagerFromExistingOrNew(
PolyConnectivity &mesh, const char *propname,
const ITERATOR_TYPE &begin, const ITERATOR_TYPE &end,
const PROP_VALUE &init_value) {
return PropertyManager<PROPTYPE>::createIfNotExists(
mesh, propname, begin, end, init_value);
}
template<typename PROPTYPE,
typename ITERATOR_RANGE, typename PROP_VALUE>
OM_DEPRECATED("Use getOrMakeProperty instead.")
PropertyManager<PROPTYPE> makePropertyManagerFromExistingOrNew(
PolyConnectivity &mesh, const char *propname,
const ITERATOR_RANGE &range,
const PROP_VALUE &init_value) {
return makePropertyManagerFromExistingOrNew<PROPTYPE>(
mesh, propname, range.begin(), range.end(), init_value);
}
template<typename MeshT>
PropertyManager<OpenMesh::VPropHandleT<typename MeshT::Point>>
getPointsProperty(MeshT &mesh) {
return PropertyManager<OpenMesh::VPropHandleT<typename MeshT::Point>>(mesh, mesh.points_property_handle());
}
template<typename MeshT>
ConstPropertyViewer<OpenMesh::VPropHandleT<typename MeshT::Point>>
getPointsProperty(const MeshT &mesh) {
using PropType = OpenMesh::VPropHandleT<typename MeshT::Point>;
return ConstPropertyViewer<PropType>(mesh, mesh.points_property_handle());
}
template <typename HandleT, typename T>
using Prop = PropertyManager<typename PropHandle<HandleT>::template type<T>>;
template <typename T>
using VProp = PropertyManager<OpenMesh::VPropHandleT<T>>;
template <typename T>
using HProp = PropertyManager<OpenMesh::HPropHandleT<T>>;
template <typename T>
using EProp = PropertyManager<OpenMesh::EPropHandleT<T>>;
template <typename T>
using FProp = PropertyManager<OpenMesh::FPropHandleT<T>>;
template <typename T>
using MProp = PropertyManager<OpenMesh::MPropHandleT<T>>;
} /* namespace OpenMesh */
#endif /* PROPERTYMANAGER_HH_ */
OpenMesh
Contains all the mesh ingredients like the polygonal mesh, the triangle mesh, different mesh kernels ...
Definition MeshItems.hh:59
OpenMesh::BaseKernel::remove_property
void remove_property(VPropHandleT< T > &_ph)
You should not use this function directly.
Definition BaseKernel.hh:194
OpenMesh::BaseKernel::property
PropertyT< T > & property(VPropHandleT< T > _ph)
In most cases you should use the convenient PropertyManager wrapper and use of this function should n...
Definition BaseKernel.hh:310
OpenMesh::PolyConnectivity
Connectivity Class for polygonal meshes.
Definition PolyConnectivity.hh:115
OpenMesh::HandleToPropHandle
Definition HandleToPropHandle.hh:10
OpenMesh::PropertyT
Default property class for any type T.
Definition Property.hh:93
OpenMesh::VPropHandleT
Handle representing a vertex property.
Definition Property.hh:417
OpenMesh::MPropHandleT
Handle representing a mesh property.
Definition Property.hh:477
OpenMesh::PropertyManager
This class is intended to manage the lifecycle of properties.
Definition PropertyManager.hh:76
OpenMesh::PropertyManager< PROPTYPE, MeshT >::makePropertyManagerFromNew
PropertyManager< PROPTYPE > makePropertyManagerFromNew(PolyConnectivity &mesh, const char *propname)
Definition PropertyManager.hh:832
OpenMesh::PropertyManager::copy
static void copy(const char *prop_name, PolyConnectivity &src_mesh, const RangeType &src_range, PolyConnectivity &dst_mesh, const RangeType2 &dst_range)
Copy the values of a property from a source range to a target range.
Definition PropertyManager.hh:583
OpenMesh::PropertyManager::set_range
void set_range(HandleTypeIterator begin, HandleTypeIterator end, const PROP_VALUE &value)
Conveniently set the property for an entire range of values.
Definition PropertyManager.hh:519
OpenMesh::PropertyManager::PropertyManager
PropertyManager(const Value &initial_value, PolyConnectivity &mesh, const char *propname)
Constructor.
Definition PropertyManager.hh:196
OpenMesh::PropertyManager::getPointsProperty
ConstPropertyViewer< OpenMesh::VPropHandleT< typename MeshT::Point > > getPointsProperty(const MeshT &mesh)
Returns a convenience wrapper around the points property of a mesh that only allows const access.
Definition PropertyManager.hh:930
OpenMesh::PropertyManager::PropertyManager
PropertyManager(PolyConnectivity &mesh, const char *propname, bool existing)
Definition PropertyManager.hh:160
OpenMesh::PropertyManager::makeTemporaryProperty
PropertyManager< typename HandleToPropHandle< ElementT, T >::type > makeTemporaryProperty(PolyConnectivity &mesh)
Creates a new property whose lifetime is limited to the current scope.
Definition PropertyManager.hh:714
OpenMesh::PropertyManager::operator[]
PROPTYPE::reference operator[](Handle handle)
Enables convenient access to the encapsulated property.
Definition PropertyManager.hh:455
OpenMesh::PropertyManager::hasProperty
bool hasProperty(const PolyConnectivity &mesh, const char *propname)
Tests whether a property with the given element type, value type, and name is present on the given me...
Definition PropertyManager.hh:742
OpenMesh::PropertyManager::copy_to
void copy_to(HandleTypeIterator begin, HandleTypeIterator end, PropertyManager2 &dst_propmanager, HandleTypeIterator2 dst_begin, HandleTypeIterator2 dst_end) const
Conveniently transfer the values managed by one property manager onto the values managed by a differe...
Definition PropertyManager.hh:549
OpenMesh::PropertyManager::operator*
PROPTYPE::reference & operator*()
Get the mesh corresponding to the property.
Definition PropertyManager.hh:428
OpenMesh::PropertyManager::getPointsProperty
PropertyManager< OpenMesh::VPropHandleT< typename MeshT::Point > > getPointsProperty(MeshT &mesh)
Returns a convenience wrapper around the points property of a mesh.
Definition PropertyManager.hh:921
OpenMesh::PropertyManager< PROPTYPE, MeshT >::makePropertyManagerFromExisting
PropertyManager< PROPTYPE, MeshT > makePropertyManagerFromExisting(PolyConnectivity &mesh, const char *propname)
Definition PropertyManager.hh:851
OpenMesh::PropertyManager< PROPTYPE, MeshT >::makeTemporaryProperty
PropertyManager< typename HandleToPropHandle< ElementT, T >::type > makeTemporaryProperty(PolyConnectivity &mesh, const char *propname)
Definition PropertyManager.hh:684
OpenMesh::PropertyManager::set_persistent
void set_persistent(bool _persistence=true)
Mark whether this property should be stored when mesh is written to a file.
Definition PropertyManager.hh:602
OpenMesh::PropertyManager::PropertyManager
PropertyManager(const PolyConnectivity &mesh)
Constructor.
Definition PropertyManager.hh:210
OpenMesh::PropertyManager::PropertyManager
PropertyManager(const Value &initial_value, const PolyConnectivity &mesh)
Constructor.
Definition PropertyManager.hh:222
OpenMesh::PropertyManager::getProperty
PropertyManager< typename HandleToPropHandle< ElementT, T >::type > getProperty(PolyConnectivity &mesh, const char *propname)
Obtains a handle to a named property.
Definition PropertyManager.hh:776
OpenMesh::PropertyManager::clone
PropertyManager clone()
Create property manager referring to a copy of the current property.
Definition PropertyManager.hh:264
OpenMesh::PropertyManager::PropertyManager
PropertyManager(PolyConnectivity &mesh, PROPTYPE property_handle)
Constructor.
Definition PropertyManager.hh:235
OpenMesh::PropertyManager::operator()
PROPTYPE::reference operator()(const Handle &handle=Handle())
Enables convenient access to the encapsulated property.
Definition PropertyManager.hh:477
OpenMesh::PropertyManager< PROPTYPE, MeshT >::makePropertyManagerFromExistingOrNew
PropertyManager< PROPTYPE, MeshT > makePropertyManagerFromExistingOrNew(PolyConnectivity &mesh, const char *propname)
Definition PropertyManager.hh:866
OpenMesh::PropertyManager::getOrMakeProperty
PropertyManager< typename HandleToPropHandle< ElementT, T >::type > getOrMakeProperty(PolyConnectivity &mesh, const char *propname)
Obtains a handle to a named property if it exists or creates a new one otherwise.
Definition PropertyManager.hh:817
OpenMesh::PropertyManager::operator*
PROPTYPE::const_reference & operator*() const
Access the value of the encapsulated mesh property.
Definition PropertyManager.hh:444
OpenMesh::PropertyManager::PropertyManager
PropertyManager(PolyConnectivity &mesh, const char *propname)
Constructor.
Definition PropertyManager.hh:180
OpenMesh::ConstPropertyViewer
Definition PropertyManager.hh:627