|
| PropertyManager (MeshT &mesh, const char *propname, bool existing=false) |
| Constructor. More...
|
|
void | swap (PropertyManager &rhs) |
|
bool | isValid () const |
|
| operator bool () const |
|
const PROPTYPE & | getRawProperty () const |
|
const std::string & | getName () const |
|
MeshT & | getMesh () const |
|
| operator Proxy () |
|
Proxy | move () |
|
| PropertyManager (Proxy p) |
|
PropertyManager & | operator= (Proxy p) |
|
Proxy | duplicate (const char *clone_name) |
|
void | retain (bool doRetain=true) |
| Disable lifecycle management for this property. More...
|
|
PROPTYPE & | operator* () |
| Access the encapsulated property.
|
|
const PROPTYPE & | operator* () const |
| Access the encapsulated property.
|
|
template<typename HandleType > |
PROPTYPE::reference | operator[] (const HandleType &handle) |
| Enables convenient access to the encapsulated property. More...
|
|
template<typename HandleType > |
PROPTYPE::const_reference | operator[] (const HandleType &handle) const |
| Enables convenient access to the encapsulated property. More...
|
|
template<typename HandleTypeIterator , typename PROP_VALUE > |
void | set_range (HandleTypeIterator begin, HandleTypeIterator end, const PROP_VALUE &value) |
| Conveniently set the property for an entire range of values. More...
|
|
template<typename HandleTypeIterator , typename PROPTYPE_2 , typename MeshT_2 , typename HandleTypeIterator_2 > |
void | copy_to (HandleTypeIterator begin, HandleTypeIterator end, PropertyManager< PROPTYPE_2, MeshT_2 > &dst_propmanager, HandleTypeIterator_2 dst_begin, HandleTypeIterator_2 dst_end) const |
| Conveniently transfer the values managed by one property manager onto the values managed by a different property manager. More...
|
|
template<typename RangeType , typename PROPTYPE_2 , typename MeshT_2 , typename RangeType_2 > |
void | copy_to (const RangeType &range, PropertyManager< PROPTYPE_2, MeshT_2 > &dst_propmanager, const RangeType_2 &dst_range) const |
|
|
static bool | propertyExists (MeshT &mesh, const char *propname) |
|
static Proxy | createIfNotExists (MeshT &mesh, const char *propname) |
| Create a property manager for the supplied property and mesh. More...
|
|
template<typename PROP_VALUE , typename ITERATOR_TYPE > |
static Proxy | createIfNotExists (MeshT &mesh, const char *propname, const ITERATOR_TYPE &begin, const ITERATOR_TYPE &end, const PROP_VALUE &init_value) |
| Like createIfNotExists() with two parameters except, if the property doesn't exist, it is initialized with the supplied value over the supplied range after creation. More...
|
|
template<typename RangeType , typename MeshT_2 , typename RangeType_2 > |
static void | copy (const char *prop_name, MeshT &src_mesh, const RangeType &src_range, MeshT_2 &dst_mesh, const RangeType_2 &dst_range) |
| Copy the values of a property from a source range to a target range. More...
|
|
|
(Note that these are not member functions.)
|
template<typename PROPTYPE , typename MeshT > |
PropertyManager< PROPTYPE, MeshT > | makePropertyManagerFromNew (MeshT &mesh, const char *propname) |
|
template<typename PROPTYPE , typename MeshT > |
PropertyManager< PROPTYPE, MeshT > | makePropertyManagerFromExisting (MeshT &mesh, const char *propname) |
|
template<typename PROPTYPE , typename MeshT > |
PropertyManager< PROPTYPE, MeshT > | makePropertyManagerFromExistingOrNew (MeshT &mesh, const char *propname) |
|
template<typename PROPTYPE , typename MeshT , typename ITERATOR_TYPE , typename PROP_VALUE > |
PropertyManager< PROPTYPE, MeshT > | makePropertyManagerFromExistingOrNew (MeshT &mesh, const char *propname, const ITERATOR_TYPE &begin, const ITERATOR_TYPE &end, const PROP_VALUE &init_value) |
|
template<typename PROPTYPE , typename MeshT , typename ITERATOR_RANGE , typename PROP_VALUE > |
PropertyManager< PROPTYPE, MeshT > | makePropertyManagerFromExistingOrNew (MeshT &mesh, const char *propname, const ITERATOR_RANGE &range, const PROP_VALUE &init_value) |
|
template<typename PROPTYPE, typename MeshT>
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.
For C++11, it is recommended to use the factory functions makePropertyManagerFromNew, makePropertyManagerFromExisting, makePropertyManagerFromExistingOrNew to construct a PropertyManager, e.g.
TriMesh mesh;
auto visited = makePropertyManagerFromNew<VPropHandleT<bool>>(mesh, "visited.plugin-example.i8.informatik.rwth-aachen.de");
for (auto vh : mesh.vertices()) {
if (!visited[vh]) {
visitComponent(mesh, vh, visited);
}
}
For C++98, it is usually more convenient to use the constructor explicitly, i.e.
TriMesh mesh;
PropertyManager<VPropHandleT<bool>, TriMesh> visited(mesh, "visited.plugin-example.i8.informatik.rwth-aachen.de");
for (TriMesh::VertexIter vh_it = mesh.begin(); ... ; ...) {
if (!visited[*vh_it]) {
visitComponent(mesh, *vh_it, visited);
}
}
template<typename PROPTYPE, typename MeshT>
template<typename PROP_VALUE , typename ITERATOR_TYPE >
static Proxy OpenMesh::PropertyManager< PROPTYPE, MeshT >::createIfNotExists |
( |
MeshT & |
mesh, |
|
|
const char * |
propname, |
|
|
const ITERATOR_TYPE & |
begin, |
|
|
const ITERATOR_TYPE & |
end, |
|
|
const PROP_VALUE & |
init_value |
|
) |
| |
|
inlinestatic |
Like createIfNotExists() with two parameters except, if the property doesn't exist, it is initialized with the supplied value over the supplied range after creation.
If the property already exists, this method has the exact same effect as the two parameter version. Lifecycle management is disabled in any case.
- See also
- makePropertyManagerFromExistingOrNew
template<typename PROPTYPE , typename MeshT , typename ITERATOR_TYPE , typename PROP_VALUE >
PropertyManager< PROPTYPE, MeshT > makePropertyManagerFromExistingOrNew |
( |
MeshT & |
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.
template<typename PROPTYPE , typename MeshT , typename ITERATOR_RANGE , typename PROP_VALUE >
PropertyManager< PROPTYPE, MeshT > makePropertyManagerFromExistingOrNew |
( |
MeshT & |
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.