Developer Documentation

Classes | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Private Types | Private Member Functions | Private Attributes | Related Functions | List of all members
OpenMesh::PropertyManager< PROPTYPE, MeshT > Class Template Reference

`#include <OpenFlipper/libs_required/OpenMesh/src/OpenMesh/Core/Utils/PropertyManager.hh>`

## Classes
struct | StorageT
struct | StorageT< PropertyManager2, MPropHandleT< Value > >

## Public Types
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

## Public Member Functions
| OM_DEPRECATED ("Use the constructor without parameter 'existing' instead. Check for existance with hasProperty") PropertyManager(PolyConnectivity &mesh
const char bool | retain_ (existing)
const char bool | name_ (propname)
| PropertyManager (PolyConnectivity &mesh, const char *propname)
| PropertyManager (const Value &initial_value, PolyConnectivity &mesh, const char *propname)
| PropertyManager (const PolyConnectivity &mesh)
| PropertyManager (const Value &initial_value, const PolyConnectivity &mesh)
| PropertyManager (PolyConnectivity &mesh, PROPTYPE property_handle)
| PropertyManager (const PropertyManager &rhs)
PropertyManager & | operator= (const PropertyManager &rhs)
void | swap (PropertyManager &rhs)
bool | isValid () const
| operator bool () const
const PROPTYPE & | getRawProperty () const
const std::string & | getName () const
PROPTYPE::reference & | operator* ()
PROPTYPE::const_reference & | operator* () const
PROPTYPE::reference | operator[] (Handle handle)
PROPTYPE::const_reference | operator[] (const Handle &handle) const
PROPTYPE::reference | operator() (const Handle &handle=Handle())
PROPTYPE::const_reference | operator() (const Handle &handle=Handle()) const
template<typename HandleTypeIterator , typename PROP_VALUE >
void | set_range (HandleTypeIterator begin, HandleTypeIterator end, const PROP_VALUE &value)
template<typename HandleTypeIterator , typename PROPTYPE_2 , typename HandleTypeIterator_2 >
void | copy_to (HandleTypeIterator begin, HandleTypeIterator end, PropertyManager< PROPTYPE_2 > &dst_propmanager, HandleTypeIterator_2 dst_begin, HandleTypeIterator_2 dst_end) const
template<typename RangeType , typename PROPTYPE_2 , typename RangeType_2 >
void | copy_to (const RangeType &range, PropertyManager< PROPTYPE_2 > &dst_propmanager, const RangeType_2 &dst_range) const

## Static Public Member Functions
static bool | propertyExists (PolyConnectivity &mesh, const char *propname)
template<typename RangeType , typename RangeType_2 >
static void | copy (const char *prop_name, PolyConnectivity &src_mesh, const RangeType &src_range, PolyConnectivity &dst_mesh, const RangeType_2 &dst_range)

## Public Attributes
const char * | propname
const char bool | existing: mesh_(mesh)

## Private Types
using | Storage = StorageT< Self, PROPTYPE >

## Private Member Functions
void | deleteProperty ()
PolyConnectivity & | mesh () const

## Private Attributes
const PolyConnectivity & | mesh_
PROPTYPE | prop_
bool | retain_
std::string | name_

## Related Functions
(Note that these are not member functions.)
template<typename ElementT , typename T >
PropertyManager< typename HandleToPropHandle< ElementT, T >::type > | makeTemporaryProperty (PolyConnectivity &mesh, const char *propname)
template<typename ElementT , typename T >
PropertyManager< typename HandleToPropHandle< ElementT, T >::type > | makeTemporaryProperty (PolyConnectivity &mesh)
template<typename ElementT , typename T >
bool | hasProperty (const PolyConnectivity &mesh, const char *propname)
template<typename ElementT , typename T >
PropertyManager< typename HandleToPropHandle< ElementT, T >::type > | getProperty (PolyConnectivity &mesh, const char *propname)
template<typename ElementT , typename T >
PropertyManager< typename HandleToPropHandle< ElementT, T >::type > | getOrMakeProperty (PolyConnectivity &mesh, const char *propname)
template<typename PROPTYPE >
PropertyManager< PROPTYPE > | makePropertyManagerFromNew (PolyConnectivity &mesh, const char *propname)
template<typename PROPTYPE , typename MeshT = int>
PropertyManager< PROPTYPE, MeshT > | makePropertyManagerFromExisting (PolyConnectivity &mesh, const char *propname)
template<typename PROPTYPE , typename MeshT = int>
PropertyManager< PROPTYPE, MeshT > | makePropertyManagerFromExistingOrNew (PolyConnectivity &mesh, const char *propname)
template<typename PROPTYPE , typename ITERATOR_TYPE , typename PROP_VALUE >
PropertyManager< PROPTYPE > | makePropertyManagerFromExistingOrNew (PolyConnectivity &mesh, const char *propname, const ITERATOR_TYPE &begin, const ITERATOR_TYPE &end, const PROP_VALUE &init_value)
template<typename PROPTYPE , typename ITERATOR_RANGE , typename PROP_VALUE >
PropertyManager< PROPTYPE > | makePropertyManagerFromExistingOrNew (PolyConnectivity &mesh, const char *propname, const ITERATOR_RANGE &range, const PROP_VALUE &init_value)
template<typename MeshT >
PropertyManager< OpenMesh::VPropHandleT< typename MeshT::Point > > | getPointsProperty (MeshT &mesh)
template<typename MeshT >
ConstPropertyViewer< OpenMesh::VPropHandleT< typename MeshT::Point > > | getPointsProperty (const MeshT &mesh)

## Detailed Description

### template<typename PROPTYPE, typename MeshT = int>
class OpenMesh::PropertyManager< PROPTYPE, MeshT >

This class is intended to manage the lifecycle of properties. It also defines convenience operators to access the encapsulated property's value.

It is recommended to use the factory functions makeTemporaryProperty(), getProperty(), and getOrMakeProperty() to construct a PropertyManager, e.g.

Note that the second template parameter is depcretated.

{
TriMesh mesh;
auto visited = makeTemporaryProperty<VertexHandle, bool>(mesh);
for (auto vh : mesh.vertices()) {
if (!visited[vh]) {
visitComponent(mesh, vh, visited);
}
}
// The property is automatically removed at the end of the scope
}

Definition at line 80 of file PropertyManager.hh.

## Constructor & Destructor Documentation

## ◆ PropertyManager() [1/5]

template<typename PROPTYPE, typename MeshT = int>

OpenMesh::PropertyManager< PROPTYPE, MeshT >::PropertyManager | ( | PolyConnectivity & | mesh,
|  | const char * | propname
| ) |  |
| inline

Constructor.

Asks for a property with name propname and creates one if none exists. Lifetime is not managed.

Parameters

  mesh | The mesh on which to create the property.
  propname | The name of the property.

Definition at line 178 of file PropertyManager.hh.

## ◆ PropertyManager() [2/5]

template<typename PROPTYPE, typename MeshT = int>

OpenMesh::PropertyManager< PROPTYPE, MeshT >::PropertyManager | ( | const Value & | initial_value,
|  | PolyConnectivity & | mesh,
|  | const char * | propname
| ) |  |
| inline

Constructor.

Asks for a property with name propname and creates one if none exists. Lifetime is not managed.

Parameters

  initial_value | If the proeprty is newly created, it will be initialized with initial_value. If the property already existed, nothing is changes.
  mesh | The mesh on which to create the property.
  propname | The name of the property.

Definition at line 194 of file PropertyManager.hh.

## ◆ PropertyManager() [3/5]

template<typename PROPTYPE, typename MeshT = int>

OpenMesh::PropertyManager< PROPTYPE, MeshT >::PropertyManager | ( | const PolyConnectivity & | mesh | ) |
| inline

Constructor.

Create an anonymous property. Lifetime is managed.

Parameters

  mesh | The mesh on which to create the property.

Definition at line 208 of file PropertyManager.hh.

## ◆ PropertyManager() [4/5]

template<typename PROPTYPE, typename MeshT = int>

OpenMesh::PropertyManager< PROPTYPE, MeshT >::PropertyManager | ( | const Value & | initial_value,
|  | const PolyConnectivity & | mesh
| ) |  |
| inline

Constructor.

Create an anonymous property. Lifetime is managed.

Parameters

  initial_value | The property will be initialized with initial_value.
  mesh | The mesh on which to create the property.

Definition at line 220 of file PropertyManager.hh.

## ◆ PropertyManager() [5/5]

template<typename PROPTYPE, typename MeshT = int>

OpenMesh::PropertyManager< PROPTYPE, MeshT >::PropertyManager | ( | PolyConnectivity & | mesh,
|  | PROPTYPE | property_handle
| ) |  |
| inline

Constructor.

Create a wrapper around an existing property. Lifetime is not managed.

Parameters

  mesh | The mesh on which to create the property.
  property_handle | Handle to an existing property that should be wrapped.

Definition at line 233 of file PropertyManager.hh.

## Member Function Documentation

## ◆ copy()

template<typename PROPTYPE, typename MeshT = int>
template<typename RangeType , typename RangeType_2 >

static void OpenMesh::PropertyManager< PROPTYPE, MeshT >::copy | ( | const char * | prop_name,
|  | PolyConnectivity & | src_mesh,
|  | const RangeType & | src_range,
|  | PolyConnectivity & | dst_mesh,
|  | const RangeType_2 & | dst_range
| ) |  |
| inline static

Copy the values of a property from a source range to a target range. The source range must not be smaller than the target range.

Parameters

  prop_name | Name of the property to copy. Must exist on the source mesh. Will be created on the target mesh if it doesn't exist.
  src_mesh | Source mesh from which to copy.
  src_range | Source range which to copy. Must not be smaller than dst_range.
  dst_mesh | Destination mesh on which to copy.
  dst_range | Destination range.

Definition at line 568 of file PropertyManager.hh.

## ◆ copy_to()

template<typename PROPTYPE, typename MeshT = int>
template<typename HandleTypeIterator , typename PROPTYPE_2 , typename HandleTypeIterator_2 >

void OpenMesh::PropertyManager< PROPTYPE, MeshT >::copy_to | ( | HandleTypeIterator | begin,
|  | HandleTypeIterator | end,
|  | PropertyManager< PROPTYPE_2 > & | dst_propmanager,
|  | HandleTypeIterator_2 | dst_begin,
|  | HandleTypeIterator_2 | dst_end
| ) |  | const
| inline

Conveniently transfer the values managed by one property manager onto the values managed by a different property manager.

Parameters

  begin | Start iterator. Needs to dereference to HandleType. Will be used with this property manager.
  end | End iterator. (Exclusive.) Will be used with this property manager.
  dst_propmanager | The destination property manager.
  dst_begin | Start iterator. Needs to dereference to the HandleType of dst_propmanager. Will be used with dst_propmanager.
  dst_end | End iterator. (Exclusive.) Will be used with dst_propmanager. Used to double check the bounds.

Definition at line 534 of file PropertyManager.hh.

## ◆ OM_DEPRECATED()

template<typename PROPTYPE, typename MeshT = int>

OpenMesh::PropertyManager< PROPTYPE, MeshT >::OM_DEPRECATED | ( | "Use the constructor without parameter 'existing' instead. Check for existance with hasProperty" |  | ) | &

Deprecated:
  Use a constructor without `existing` and check existance with hasProperty() instead.

Constructor.

Throws an `std::runtime_error` if `existing` is true and no property named `propname` of the appropriate property type exists.

Parameters

  mesh | The mesh on which to create the property.
  propname | The name of the property.
  existing | If false, a new property is created and its lifecycle is managed (i.e. the property is deleted upon destruction of the PropertyManager instance). If true, the instance merely acts as a convenience wrapper around an existing property with no lifecycle management whatsoever.

See also
  PropertyManager::getOrMakeProperty, PropertyManager::getProperty, PropertyManager::makeTemporaryProperty

## ◆ operator()() [1/2]

template<typename PROPTYPE, typename MeshT = int>

PROPTYPE::reference OpenMesh::PropertyManager< PROPTYPE, MeshT >::operator() | ( | const Handle & | handle = `Handle()` | ) |
| inline

Enables convenient access to the encapsulated property.

For a usage example see this class' documentation.

Parameters

  handle | A handle of the appropriate handle type. (I.e. `VertexHandle` for `VPropHandleT`, etc.)

Definition at line 462 of file PropertyManager.hh.

## ◆ operator()() [2/2]

template<typename PROPTYPE, typename MeshT = int>

PROPTYPE::const_reference OpenMesh::PropertyManager< PROPTYPE, MeshT >::operator() | ( | const Handle & | handle = `Handle()` | ) | const
| inline

Enables convenient access to the encapsulated property.

For a usage example see this class' documentation.

Parameters

  handle | A handle of the appropriate handle type. (I.e. `VertexHandle` for `VPropHandleT`, etc.)

Definition at line 474 of file PropertyManager.hh.

## ◆ operator*() [1/2]

template<typename PROPTYPE, typename MeshT = int>

PROPTYPE::reference& OpenMesh::PropertyManager< PROPTYPE, MeshT >::operator* | ( |  | ) |
| inline

Get the mesh corresponding to the property.

If you use PropertyManager without second template parameter (recommended) you need to specify the actual mesh type when using this function, e.g.:

{
TriMesh mesh;
auto visited = VProp<bool>(mesh);
TriMesh& mesh_ref = visited.getMesh<TriMesh>();
}
/
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);
}

Note
  This method is only used for mesh properties.

Definition at line 413 of file PropertyManager.hh.

## ◆ operator*() [2/2]

template<typename PROPTYPE, typename MeshT = int>

PROPTYPE::const_reference& OpenMesh::PropertyManager< PROPTYPE, MeshT >::operator* | ( |  | ) | const
| inline

Access the value of the encapsulated mesh property.

Example:

PolyMesh m;
auto description = getProperty<void, std::string>(m, "description");
std::cout << *description << std::endl;

Note
  This method is only used for mesh properties.

Definition at line 429 of file PropertyManager.hh.

## ◆ operator[]() [1/2]

template<typename PROPTYPE, typename MeshT = int>

PROPTYPE::reference OpenMesh::PropertyManager< PROPTYPE, MeshT >::operator[] | ( | Handle | handle | ) |
| inline

Enables convenient access to the encapsulated property.

For a usage example see this class' documentation.

Parameters

  handle | A handle of the appropriate handle type. (I.e. `VertexHandle` for `VPropHandleT`, etc.)

Definition at line 440 of file PropertyManager.hh.

## ◆ operator[]() [2/2]

template<typename PROPTYPE, typename MeshT = int>

PROPTYPE::const_reference OpenMesh::PropertyManager< PROPTYPE, MeshT >::operator[] | ( | const Handle & | handle | ) | const
| inline

Enables convenient access to the encapsulated property.

For a usage example see this class' documentation.

Parameters

  handle | A handle of the appropriate handle type. (I.e. `VertexHandle` for `VPropHandleT`, etc.)

Definition at line 451 of file PropertyManager.hh.

## ◆ set_range()

template<typename PROPTYPE, typename MeshT = int>
template<typename HandleTypeIterator , typename PROP_VALUE >

void OpenMesh::PropertyManager< PROPTYPE, MeshT >::set_range | ( | HandleTypeIterator | begin,
|  | HandleTypeIterator | end,
|  | const PROP_VALUE & | value
| ) |  |
| inline

Conveniently set the property for an entire range of values.

Examples:

MeshT mesh;
PropertyManager<VPropHandleT<double>> distance(
mesh, "distance.plugin-example.i8.informatik.rwth-aachen.de");
distance.set_range(
mesh.vertices_begin(), mesh.vertices_end(),
std::numeric_limits<double>::infinity());

or

MeshT::VertexHandle vh;
distance.set_range(
mesh.vv_begin(vh), mesh.vv_end(vh),
std::numeric_limits<double>::infinity());

Parameters

  begin | Start iterator. Needs to dereference to HandleType.
  end | End iterator. (Exclusive.)
  value | The value the range will be set to.

Definition at line 504 of file PropertyManager.hh.

## Friends And Related Function Documentation

## ◆ getOrMakeProperty()

template<typename ElementT , typename T >

PropertyManager< typename HandleToPropHandle< ElementT, T >::type > getOrMakeProperty | ( | PolyConnectivity & | mesh,
|  | const char * | propname
| ) |  |
| related

Obtains a handle to a named property if it exists or creates a new one otherwise.

Used for creating or accessing permanent properties.

Example:

PolyMesh m;
{
auto is_quad = getOrMakeProperty<FaceHandle, bool>(m, "is_quad");
for (auto& fh : m.faces()) {
is_quad[fh] = (m.valence(fh) == 4);
}
// The property remains on the mesh after the end of the scope.
}
{
// Retrieve the property from the previous scope.
auto is_quad = getOrMakeProperty<FaceHandle, bool>(m, "is_quad");
// Use is_quad here.
}

Parameters

  mesh | The mesh on which the property is created
  propname | The name of the created property

Template Parameters

  ElementT | Element type of the created property, e.g. VertexHandle, HalfedgeHandle, etc.
  T | Value type of the created property, e.g., `double`, `int`, etc.

Returns
  A PropertyManager wrapping the property

Definition at line 791 of file PropertyManager.hh.

## ◆ getPointsProperty() [1/2]

template<typename MeshT >

PropertyManager< OpenMesh::VPropHandleT< typename MeshT::Point > > getPointsProperty | ( | MeshT & | mesh | ) |
| related

Returns a convenience wrapper around the points property of a mesh.

Definition at line 895 of file PropertyManager.hh.

## ◆ getPointsProperty() [2/2]

template<typename MeshT >

ConstPropertyViewer< OpenMesh::VPropHandleT< typename MeshT::Point > > getPointsProperty | ( | const MeshT & | mesh | ) |
| related

Returns a convenience wrapper around the points property of a mesh that only allows const access.

Definition at line 904 of file PropertyManager.hh.

## ◆ getProperty()

template<typename ElementT , typename T >

PropertyManager< typename HandleToPropHandle< ElementT, T >::type > getProperty | ( | PolyConnectivity & | mesh,
|  | const char * | propname
| ) |  |
| related

Obtains a handle to a named property.

Example:

PolyMesh m;
{
try {
auto is_quad = getProperty<FaceHandle, bool>(m, "is_quad");
// Use is_quad here.
}
catch (const std::runtime_error& e) {
// There is no is_quad face property on the mesh.
}
}

Precondition
  Property with the name `propname` of matching type exists.

Exceptions

  std::runtime_error | if no property with the name `propname` of matching type exists.

Parameters

  mesh | The mesh on which the property is created
  propname | The name of the created property

Template Parameters

  ElementT | Element type of the created property, e.g. VertexHandle, HalfedgeHandle, etc.
  T | Value type of the created property, e.g., `double`, `int`, etc.

Returns
  A PropertyManager wrapping the property

Definition at line 750 of file PropertyManager.hh.

## ◆ hasProperty()

template<typename ElementT , typename T >

bool hasProperty | ( | const PolyConnectivity & | mesh,
|  | const char * | propname
| ) |  |
| related

Tests whether a property with the given element type, value type, and name is present on the given mesh.

- Example:
  PolyMesh m;
  if (hasProperty<FaceHandle, bool>(m, "is_quad")) {
  // We now know the property exists: getProperty won't throw.
  auto is_quad = getProperty<FaceHandle, bool>(m, "is_quad");
  // Use is_quad here.
  }

Parameters

  mesh | The mesh in question
  propname | The property name of the expected property

Template Parameters

  ElementT | Element type of the expected property, e.g. VertexHandle, HalfedgeHandle, etc.
  T | Value type of the expected property, e.g., `double`, `int`, etc.
  MeshT | Type of the mesh. Can often be inferred from `mesh`

Definition at line 716 of file PropertyManager.hh.

## ◆ makePropertyManagerFromExisting()

template<typename PROPTYPE , typename MeshT = int>

PropertyManager< PROPTYPE, MeshT > makePropertyManagerFromExisting | ( | PolyConnectivity & | mesh,
|  | const char * | propname
| ) |  |
| related

Deprecated:
  Use getProperty() instead.

Creates a non-owning wrapper for an existing mesh property (no lifecycle management).

Intended for convenient access.

Precondition
  Property with the name `propname` of matching type exists.

Exceptions

  std::runtime_error | if no property with the name `propname` of matching type exists.

Definition at line 825 of file PropertyManager.hh.

## ◆ makePropertyManagerFromExistingOrNew() [1/3]

template<typename PROPTYPE , typename MeshT = int>

PropertyManager< PROPTYPE, MeshT > makePropertyManagerFromExistingOrNew | ( | PolyConnectivity & | mesh,
|  | const char * | propname
| ) |  |
| related

Deprecated:
  Use getOrMakeProperty() instead.

Creates a non-owning wrapper for a mesh property (no lifecycle management). If the given property does not exist, it is created.

Intended for creating or accessing persistent properties.

Definition at line 840 of file PropertyManager.hh.

## ◆ makePropertyManagerFromExistingOrNew() [2/3]

template<typename PROPTYPE , typename ITERATOR_TYPE , typename PROP_VALUE >

PropertyManager< PROPTYPE > makePropertyManagerFromExistingOrNew | ( | PolyConnectivity & | mesh,
|  | const char * | propname,
|  | const ITERATOR_TYPE & | begin,
|  | const ITERATOR_TYPE & | end,
|  | const PROP_VALUE & | init_value
| ) |  |
| related

Like the two parameter version of makePropertyManagerFromExistingOrNew() except it initializes the property with the specified value over the specified range if it needs to be created. If the property already exists, this function has the exact same effect as the two parameter version.

Creates a non-owning wrapper for a mesh property (no lifecycle management). If the given property does not exist, it is created.

Intended for creating or accessing persistent properties.

Definition at line 859 of file PropertyManager.hh.

## ◆ makePropertyManagerFromExistingOrNew() [3/3]

template<typename PROPTYPE , typename ITERATOR_RANGE , typename PROP_VALUE >

PropertyManager< PROPTYPE > makePropertyManagerFromExistingOrNew | ( | PolyConnectivity & | mesh,
|  | const char * | propname,
|  | const ITERATOR_RANGE & | range,
|  | const PROP_VALUE & | init_value
| ) |  |
| related

Like the two parameter version of makePropertyManagerFromExistingOrNew() except it initializes the property with the specified value over the specified range if it needs to be created. If the property already exists, this function has the exact same effect as the two parameter version.

Creates a non-owning wrapper for a mesh property (no lifecycle management). If the given property does not exist, it is created.

Intended for creating or accessing persistent properties.

Definition at line 881 of file PropertyManager.hh.

## ◆ makePropertyManagerFromNew()

template<typename PROPTYPE >

PropertyManager< PROPTYPE > makePropertyManagerFromNew | ( | PolyConnectivity & | mesh,
|  | const char * | propname
| ) |  |
| related

Deprecated:
  Use makeTemporaryProperty() instead.

Creates a new property whose lifecycle is managed by the returned PropertyManager.

Intended for temporary properties. Shadows any existing properties of matching name and type.

Definition at line 806 of file PropertyManager.hh.

## ◆ makeTemporaryProperty() [1/2]

template<typename ElementT , typename T >

PropertyManager< typename HandleToPropHandle< ElementT, T >::type > makeTemporaryProperty | ( | PolyConnectivity & | mesh,
|  | const char * | propname
| ) |  |
| related

Deprecated:
  Temporary properties should not have a name.

Creates a new property whose lifetime is limited to the current scope.

Used for temporary properties. Shadows any existing properties of matching name and type.

Example:

PolyMesh m;
{
auto is_quad = makeTemporaryProperty<FaceHandle, bool>(m);
for (auto& fh : m.faces()) {
is_quad[fh] = (m.valence(fh) == 4);
}
// The property is automatically removed from the mesh at the end of the scope.
}

Parameters

  mesh | The mesh on which the property is created
  propname | (optional) The name of the created property

Template Parameters

  ElementT | Element type of the created property, e.g. VertexHandle, HalfedgeHandle, etc.
  T | Value type of the created property, e.g., `double`, `int`, etc.

Returns
  A PropertyManager handling the lifecycle of the property

Definition at line 658 of file PropertyManager.hh.

## ◆ makeTemporaryProperty() [2/2]

template<typename ElementT , typename T >

PropertyManager< typename HandleToPropHandle< ElementT, T >::type > makeTemporaryProperty | ( | PolyConnectivity & | mesh | ) |
| related

Creates a new property whose lifetime is limited to the current scope.

Used for temporary properties. Shadows any existing properties of matching name and type.

Example:

PolyMesh m;
{
auto is_quad = makeTemporaryProperty<FaceHandle, bool>(m);
for (auto& fh : m.faces()) {
is_quad[fh] = (m.valence(fh) == 4);
}
// The property is automatically removed from the mesh at the end of the scope.
}

Parameters

  mesh | The mesh on which the property is created

Template Parameters

  ElementT | Element type of the created property, e.g. VertexHandle, HalfedgeHandle, etc.
  T | Value type of the created property, e.g., `double`, `int`, etc.

Returns
  A PropertyManager handling the lifecycle of the property

Definition at line 688 of file PropertyManager.hh.

The documentation for this class was generated from the following file:

- OpenFlipper/libs_required/OpenMesh/src/OpenMesh/Core/Utils/PropertyManager.hh