OpenMesh.Core.Mesh.BaseKernel
- class
BaseKernel
;
- This class provides the basic property management like adding/removing
properties and access to properties.
All operations provided by %
BaseKernel
need at least a property handle
(VPropHandleT, EPropHandleT, HPropHandleT, FPropHandleT, MPropHandleT).
which keeps the data type of the property, too.
There are two types of properties:
-# Standard properties - mesh data (e.g. vertex normal or face color)
-# Custom properties - user defined data
The differentiation is only semantically, technically both are
equally handled. Therefore the methods provided by the %
BaseKernel
are applicable to both property types.
\attention Since the class PolyMeshT derives from a kernel, hence all public
elements of %
BaseKernel
are usable.
- void
copy
(BaseKernel other);
- Deep
copy
'other' over top top of 'this'
- void
add_property
(T)(ref VPropHandleT!(T) _ph, string _name = "<vprop>");
- \name Add a property to a mesh item
Adds a property
Depending on the property handle type a vertex, (half-)edge, face or
mesh property is added to the mesh. If the action fails the handle
is invalid.
On success the handle must be used to access the property data with
property().
\param ph A property handle defining the data type to bind to mesh.
On success the handle is valid else invalid.
\param name Optional name of property. Following restrictions apply
to the name:
-# Maximum length of name is 256 characters
-# The prefixes matching "^[vhefm]:" are reserved for
internal usage.
-# The expression "^<.*>$" is reserved for internal usage.
\return \c true on success else \c false.
- void
remove_property
(T)(ref VPropHandleT!(T) _ph);
- \name Removing a property from a mesh tiem
Remove a property.
Removes the property represented by the handle from the apropriate
mesh item.
\param ph Property to be removed. The handle is invalid afterwords.
- bool
get_property_handle
(T)(ref VPropHandleT!(T) _ph, string _name);
- \name Get property handle by name
Retrieves the handle to a named property by it's name.
\param ph A property handle. On success the handle is valid else
invalid.
\param name Name of wanted property.
\return \c true if such a named property is available, else \c false.
- PropertyT!(T)
property
(T,int _ = 1)(VPropHandleT!(T) _ph);
- \name Access a
property
Access a
property
This method returns a reference to
property
. The
property
handle
must be valid! The result is unpredictable if the handle is invalid!
\param ph A \em valid (!)
property
handle.
\return The wanted
property
if the handle is valid.
- VPropHandleT!(T).value_type
property
(T)(VPropHandleT!(T) _ph, VertexHandle _vh);
- \name Access a
property
element using a handle to a mesh item
Return value of
property
for an item
|