Skip to content
Snippets Groups Projects
Commit 848fccf0 authored by Cory Quammen's avatar Cory Quammen
Browse files

Change algorithm for computing selections

Previously, the vtkExtractSelection filter iterated over blocks in a
composite dataset and evaluated a vtkSelection block by
block. Unfortunately, this did not make it easy to write selection
operator subclasses that need to operate on an entire composite
dataset, and required some code contortions to enable block selection.

With this change, the selection algorithm is modified to iterate over
each vtkSelectionNode in the vtkSelection and create an insidedness
array associated with the attribute specified by the selection. Only
after each of these arrays is created do we iterate over blocks and
evaluate the selection expression, ultimately extracting the selected
elements.

This is accomplished by changing the query selector API's member
function ComputeSelectedElements() that takes two arguments, an input
vtkDataObject and an output vtkDataObject that will contain an
insidedness array after the function is executed. Two additional
protected pure virtual member functions have been added to the
protected API that separately handle composite data objects
(ComputeSelectedElementsForDataObject()) and non-composite data
objects (ComputeSelectedElementsForBlock()). The
ComputeSelectedElements() function invokes these functions to compute
the insidedness array for composite and non-composite data
sets, respectively. Subclasses are required to implement
ComputeSelectedElementsForBlock(). The default implementation for
ComputeSelectedElementsForDataObject() is to call
ComputeSelectedElementsForBlock().

vtkExtractSelection has been reorganized to implement the new
algorithm. The functionality in the internal evaluator classes has
been moved to the selectors themselves, and the evaluators have been
removed. These changes make it easier to extend the selection types
available. For example, block selection is now supported with a new
vtkBlockSelector object.
parent 96f882fd
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment