New Filter Input Visibility

From ParaQ Wiki
Jump to navigationJump to search

When a new filter is added to a visible object, a decision has to be made concerning whether the visibility of the original object should be turned off. The choice is actually quite unclear. This paper outlines the ParaView 2 approach, where it goes bad, and how we can fix it.

The ParaView 2 Choice

ParaView 2 changes the visibility of the input object based on the type of filter added. For example, when adding a "Calculator" filter, the new geometry is the same as the old geometry. Thus, the input object's visibility is turned off so that it does not interfere with the rendering of the new object. When adding a "Contour" filter, the new geometry is significantly different than the old geometry. It is helpful to see the contours in relation to the original geometry, so the original geometry is left on.

Under many circumstances, the behavior of Contour makes sense. Contour is often applied to 3D rectilinear grids, and these grids are usually represented by their outline. The contour is clearly visible within the input's bounds. However, what if the input is represented by an opaque surface? In this case, the contour is invariably hidden by the surface. At best, the user has to unclick the input's visibility, which is annoying. Novice users usually think that the contour operation has failed (which it has, but not in the way users think).

A better strategy

The problem with the above approach is that it only takes into account the type of filter being adding, and it does not make an intelligent decision about whether the new data will be obscured by the old data. Thus, there is a set of filter types that should turn off the visibility of their input based on the representation of the data. If the input has a representation that will obscure the output, its visibility should be turned off.

ParaView 2 partitions its filters into two parts: those that always turn off the visibility of their inputs and those that always leave the input's visibility on. We can fix the shortcomings by adding a third partition: filters that conditionally turn off the input visibility. Descriptions of the three partitions, their behaviors, and the types of filters that go in them are described below.

Always Leave the Input Visibility On

There is a set of filters that should always leave the visibility of their input on. These filters fall into the following categories.

Output has no geometry
If a filter has no visible geometry, or if the geometry is not important, then the input should remain visible. This condition is met by data extraction type filters whose output is meant for a different type of view such as histogram, probing, plotting, and picking filters.
Annotation
Some filters "annotate" their input. That is, they add geometry that gives more information about the original geometry without modifying it. Furthermore, at least some of the annotation is (almost) always outside of the original geometry. Example of filters that give annotation are Glyph, Label, and Outline.

Always Turn the Input Visibility Off

Many filters should always turn off the visibility of their input. These are the filters whose output is meant to replace the input. The following types of filters fall into this partition.

Only attributes change
Any filter that simply adds or replaces an array of data falls into this category such as Curvature, Elevation, Gradient, Mesh Quality, Normals, and Process Ids.
No connectivity change
Really just a generalization of the above, if a filter does not change its connectivity, that is indicitive that the filter is simply creating a new representation of the old data (perhaps in a new location or with displacements applied). Example filters are Warp, Transformation, Shrink, Reflection, and Calculator (which can now change point locations).
Grouping
Some filters like the Append and Group filters pass data from multiple sources. The output data is really just a repeat of the input.
Refine/decimate
Some filters make the data courser or finer. Again, this is just a different representation of the same data. Examples of this type of filter are Decimate, Quadric Clustering, Smooth, Subdivide, and Tessellate.
Cell type conversion
Some filters simply take cells (or groups of cells) and convert them to another type of cell. The data is the same with a slightly different interpolation. Examples of this type of filter are Tetrahedralize, Triangulate, and Triangle Strips.
Redistribution
Some filters such as D3 simply move data amongst processes. Aggregated, all the data is still there.
New representation
Some filters take data and convert it into a different representation that is easier to understand. Examples include Cell Centers, Extract *, Tube, and Ribbon.
Cleanup
There are a few filters that are meant to neither add nor remove data, but rather simply clean it up. For example, the Clean filter removes duplicate points. The similar Clean to UGrid also converts to an unstructured grid.

Conditionally Turn the Input Visibility Off

We are left with a set of filters that takes data and creates a completely new type of data. This data is usually contained within the volume (or surface, line, or points) of the input. The output data is distinct from the input, but also related. Example filters are Cut, Clip, Stream Tracer, and Threshold.

For these filters, we want to leave the input visible if it does not completely obscure the output. That latter case generally only occurs if the input's representation is an opaque surface. So, when a filter of this type is added, it should turn off the visibility of the input if its Representation is Surface and its Opacity is 1. The input should remain visible otherwise (i.e. its Representation is Outline, Wireframe, Points, or Volume Render or its Opacity is less than 1).