Constructor
new Filter(parameters)
This class provides the basic method for adding new processing functionalities to meshlabjs. The main idea is that a filter is a kind of blackbox processing function that take in input meshes (eventually none) parameters and give back processed meshes. When you add a filter to meshlab it will end up in the filter list tab. You have to redefine three functions:
- the constructor
- the _init where you define the parameters
- the _applyTo where you define the behaviour of the function
Parameters:
Name | Type | Description |
---|---|---|
parameters |
Object | The object contains the initialization parameters to create filter plugin
defines its own meshes |
- Source:
Example
(function (plugin, scene) {
var filter = new plugin.Filter({
name: "Refine",
tooltip: "Apply a subdvision surface refinement step, using various approach (midpoint/loop)",
arity: 1
});
var iterWdg;
filter._init = function (builder) {
iterWdg = builder.Integer({
max: 5, min: 1, step: 1, defval: 1,
label: "Step",
tooltip: "How many refinement iterations are applied to the mesh"
});
};
filter._applyTo = function (layer) {
Module.RefineMesh(layer.ptrMesh,iterWdg.getValue());
};
plugin.install(filter);
})(MLJ.core.plugin, MLJ.core.Scene);