ITK Release 4/QuadEdgeMesh Filter/DataProcessing
Depending on the kind of filters, and on data (type, application), data may be processed differently.
Examples
Here, I will take several simple examples to illustrate the problem:
LinearParameterizationfilter
Most of the time, data are copied from the input to the output.
QuadEdgeMeshSmoothingFilter
This filter processes the geometry, i.e. the location of points can be affected by this filter. Some data related to the geometry, e.g. the area, normals, can also be affected.
DelaunayConformingFilter
Edge are flipped during this process. Though the number of triangles would remain the same, out triangles are totally different from input ones. So if data are attached to one particular triangle in input should it be attributed to the triangle with the same id which is non necessarily related to this one? When flipping edges, local neighborhood change and thus data related, e.g. area can also be affected.
Decimation Filter
Edge are contracted during this process. Local geometry, connectivity are modified. So data attached to one particular triangle, or to one particular vertex can be affected too.
Proposals
Here are listed bunch of solutions (feel free to add your solution) to be discussed:
Copy Data from Input to Output
In this case, geometry and connectivity are processed in one filter, data are copied from the input to the output (even though the number of points/cells could be different). Then, follows another filter that will process the data.
Provide Data Processing filter to QuadEdgeMeshFilter
In this case, we could
- create a virtual method to process data to be re-implemented in inherited classes for all kind of types and applications.
- add another template argument to tell filters what to do with data (choose at compilation time)
- provide a functor / class to process data (choose at run-time)