Developer Documentation
|
#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 | clone () |
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 PropertyManager2 , typename HandleTypeIterator2 > | |
void | copy_to (HandleTypeIterator begin, HandleTypeIterator end, PropertyManager2 &dst_propmanager, HandleTypeIterator2 dst_begin, HandleTypeIterator2 dst_end) const |
template<typename RangeType , typename PropertyManager2 , typename RangeType2 > | |
void | copy_to (const RangeType &range, PropertyManager2 &dst_propmanager, const RangeType2 &dst_range) const |
void | set_persistent (bool _persistence=true) |
Static Public Member Functions | |
static bool | propertyExists (PolyConnectivity &mesh, const char *propname) |
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) |
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) |
This class is intended to manage the lifecycle of properties. It also defines convenience operators to access the encapsulated property's value.
Note that the second template parameter is depcretated.
Definition at line 76 of file PropertyManager.hh.
|
inline |
Constructor.
Asks for a property with name propname and creates one if none exists. Lifetime is not managed.
mesh | The mesh on which to create the property. |
propname | The name of the property. |
Definition at line 180 of file PropertyManager.hh.
|
inline |
Constructor.
Asks for a property with name propname and creates one if none exists. Lifetime is not managed.
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 196 of file PropertyManager.hh.
|
inline |
Constructor.
Create an anonymous property. Lifetime is managed.
mesh | The mesh on which to create the property. |
Definition at line 210 of file PropertyManager.hh.
|
inline |
Constructor.
Create an anonymous property. Lifetime is managed.
initial_value | The property will be initialized with initial_value. |
mesh | The mesh on which to create the property. |
Definition at line 222 of file PropertyManager.hh.
|
inline |
Constructor.
Create a wrapper around an existing property. Lifetime is not managed.
mesh | The mesh on which to create the property. |
property_handle | Handle to an existing property that should be wrapped. |
Definition at line 235 of file PropertyManager.hh.
|
inline |
Create property manager referring to a copy of the current property. This can be used to explicitely create a copy of a named property. The cloned property will be unnamed.
Definition at line 264 of file PropertyManager.hh.
|
inlinestatic |
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.
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 583 of file PropertyManager.hh.
|
inline |
Conveniently transfer the values managed by one property manager onto the values managed by a different property manager.
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 549 of file PropertyManager.hh.
OpenMesh::PropertyManager< PROPTYPE, MeshT >::OM_DEPRECATED | ( | "Use the constructor without parameter 'existing' instead. Check for existance with hasProperty" | ) | & |
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.
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. |
|
inline |
Enables convenient access to the encapsulated property.
For a usage example see this class' documentation.
handle | A handle of the appropriate handle type. (I.e. VertexHandle for VPropHandleT , etc.) |
Definition at line 477 of file PropertyManager.hh.
|
inline |
Enables convenient access to the encapsulated property.
For a usage example see this class' documentation.
handle | A handle of the appropriate handle type. (I.e. VertexHandle for VPropHandleT , etc.) |
Definition at line 489 of file PropertyManager.hh.
|
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.:
Definition at line 428 of file PropertyManager.hh.
|
inline |
Access the value of the encapsulated mesh property.
Example:
Definition at line 444 of file PropertyManager.hh.
|
inline |
Enables convenient access to the encapsulated property.
For a usage example see this class' documentation.
handle | A handle of the appropriate handle type. (I.e. VertexHandle for VPropHandleT , etc.) |
Definition at line 455 of file PropertyManager.hh.
|
inline |
Enables convenient access to the encapsulated property.
For a usage example see this class' documentation.
handle | A handle of the appropriate handle type. (I.e. VertexHandle for VPropHandleT , etc.) |
Definition at line 466 of file PropertyManager.hh.
|
inline |
Mark whether this property should be stored when mesh is written to a file
_persistence | Property will be stored iff _persistence is true |
Definition at line 602 of file PropertyManager.hh.
|
inline |
Conveniently set the property for an entire range of values.
Examples:
or
begin | Start iterator. Needs to dereference to HandleType. |
end | End iterator. (Exclusive.) |
value | The value the range will be set to. |
Definition at line 519 of file PropertyManager.hh.
|
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:
mesh | The mesh on which the property is created |
propname | The name of the created property |
ElementT | Element type of the created property, e.g. VertexHandle, HalfedgeHandle, etc. |
T | Value type of the created property, e.g., double , int , etc. |
Definition at line 817 of file PropertyManager.hh.
|
related |
Returns a convenience wrapper around the points property of a mesh.
Definition at line 921 of file PropertyManager.hh.
|
related |
Returns a convenience wrapper around the points property of a mesh that only allows const access.
Definition at line 930 of file PropertyManager.hh.
|
related |
Obtains a handle to a named property.
Example:
propname
of matching type exists. std::runtime_error | if no property with the name propname of matching type exists. |
mesh | The mesh on which the property is created |
propname | The name of the created property |
ElementT | Element type of the created property, e.g. VertexHandle, HalfedgeHandle, etc. |
T | Value type of the created property, e.g., double , int , etc. |
Definition at line 776 of file PropertyManager.hh.
|
related |
Tests whether a property with the given element type, value type, and name is present on the given mesh.
mesh | The mesh in question |
propname | The property name of the expected property |
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 742 of file PropertyManager.hh.
|
related |
Creates a non-owning wrapper for an existing mesh property (no lifecycle management).
Intended for convenient access.
propname
of matching type exists. std::runtime_error | if no property with the name propname of matching type exists. |
Definition at line 851 of file PropertyManager.hh.
|
related |
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 866 of file PropertyManager.hh.
|
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 885 of file PropertyManager.hh.
|
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 907 of file PropertyManager.hh.
|
related |
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 832 of file PropertyManager.hh.
|
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:
mesh | The mesh on which the property is created |
propname | (optional) The name of the created property |
ElementT | Element type of the created property, e.g. VertexHandle, HalfedgeHandle, etc. |
T | Value type of the created property, e.g., double , int , etc. |
Definition at line 684 of file PropertyManager.hh.
|
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:
mesh | The mesh on which the property is created |
ElementT | Element type of the created property, e.g. VertexHandle, HalfedgeHandle, etc. |
T | Value type of the created property, e.g., double , int , etc. |
Definition at line 714 of file PropertyManager.hh.