OpenMesh.Tools.Decimater.ModBaseT
- struct
ModHandleT
(Module);
- Handle for mesh decimation modules
\internal
- bool
is_valid
();
- Check handle status
\return \c true, if handle is valid, else \c false.
- template
DECIMATER_MODNAME
(char[] _mod_name)
- Macro that sets up the name() function
\internal
- template
DECIMATING_MODULE
(alias DecimaterT,char[] Name)
- Convenience macro, to be used in derived modules
The macro defines the types
- \c Handle, type of the module's handle.
- \c Base, type of ModBaseT<>.
- \c Mesh, type of the associated mesh passed by the decimater type.
- \c CollapseInfo, to your convenience
and uses DECIMATER_MODNAME() to define the name of the module.
\param Classname The name of the derived class.
\param DecimaterT Pass here the decimater type, which is the
template parameter passed to ModBaseT.
\param Name Give the module a name.
- class
ModBaseT
(DecimaterType);
- Base class for all decimation modules.
Each module has to implement this interface.
To build your own module you have to
-# derive from this class.
-# create the basic settings with DECIMATING_MODULE().
-# override collapse_priority(), if necessary.
-# override initialize(), if necessary.
-# override postprocess_collapse(), if necessary.
A module has two major working modes:
-# binary mode
-# non-binary mode
In the binary mode collapse_priority() checks a constraint and
returns LEGAL_COLLAPSE or ILLEGAL_COLLAPSE.
In the non-binary mode the module computes a float error value in
the range [0, inf
and returns it. In the case a constraint has
been set, e.g. the error must be lower than a upper bound, and the
constraint is violated, collapse_priority() must return
ILLEGAL_COLLAPSE.
See Also:
collapse_priority()
\todo "Tutorial on building a custom decimation module."
-
ILLEGAL_COLLAPSE
- < indicates an illegal collapse
-
LEGAL_COLLAPSE
- < indicates a legal collapse
- this(ref DecimaterType _dec, bool _is_binary);
- Default constructor
See Also:
\ref decimater_docu
- bool
is_binary
();
- Returns true if criteria returns a binary value.
- void
set_binary
(bool _b);
- Set whether module is binary or not.
- void
initialize
();
- Initialize module-internal stuff
- float
collapse_priority
(ref CollapseInfoT!(Mesh) _ci);
- Return collapse priority.
In the binary mode
collapse_priority
() checks a constraint and
returns LEGAL_COLLAPSE or ILLEGAL_COLLAPSE.
In the non-binary mode the module computes a float error value in
the range [0, inf
and returns it. In the case a constraint has
been set, e.g. the error must be lower than a upper bound, and the
constraint is violated,
collapse_priority
() must return
ILLEGAL_COLLAPSE.
\return Collapse priority in the range [0,inf,
\c LEGAL_COLLAPSE or \c ILLEGAL_COLLAPSE.
void
postprocess_collapse
(ref CollapseInfoT!(Mesh) _ci);
After from_vh has been collapsed into to_vh, this method
will be called.
Mesh
mesh
();
Access the
mesh
associated with the decimater.
)
)
)
|