pub struct vtkCellGridEvaluator(/* private fields */);Expand description
Evaluate a field (vtkCellAttribute) at some points inside cells.
This class is a cell-grid query whose purpose is to determine the value a vtkCellAttribute takes on at one or more points inside the domain of a vtkCellGrid.
This class performs its work in two phases:
- Classification. Input points are classified by the type and index of cell in the grid in which they lie.
- Attribute/field interpolation. Each cell is asked to interpolate the value of a cell-attribute at each point classified to it.
As an example, consider a cell-grid holding 10 triangles and 20 quads and a query that is provided 5 points. The first phase will identify which of the 5 points are insides triangles, which lie in quadrilaterals, and which lie in neither. Say that 2 lie inside triangles, 2 inside quadrilaterals, and 1 is outside the domain. Furthermore, the first phase will identify which particular triangles or quadrilaterals contain the input points. The two points which lie in triangles will report a number in [0,10[ while the two points which lie in quadrilaterals will report a number in [0, 20[. Finally, for cells which have a reference element, the parametric coordinates of each input point are computed.
The second phase additionally interpolates a cell-attribute (let’s say “Velocity” in our example) at each input point.
You may configure the query to skip either phase (classification or interpolation). If you skip classification, you must provide the the classification information for the input points. The method you call (ClassifyPoints, InterpolatePoints, or InterpolateCellParameters) determines which phase(s) are applied during evaluation.
When running in InterpolatePoints mode (both classification and interpolation phases are performed), the output from our example is reported like so:
GetClassifierCellTypes()– returns an array with a cell-type hash for each type of cell containing an input point. The hash value can be used to construct a vtkStringToken. Our example would return an array with 3 values which might be ordered: “vtkDGTri”_hash, “vtkDGQuad”_hash, and 0 (an “invalid” hash).GetClassifierCellOffsets()– returns an array with the same number of values as the call above. Each value specifies the start of reporting for points contained in the corresponding cell type. Our example would return [0, 2, 4] to match the values above.GetClassifierPointIDs()– returns an array whose length matches the number of input points. Each value is the index of an input point. Input points do not have their order preserved so that all the points contained in a single cell can be reported together. Our example might return [4, 2, 1, 0, 3]. This will always be a permutation of the counting integers and, for our example, always hold integers in [0, 5[.GetClassifierCellIndices()– returns an array whose length matches the number of input points. Each value is the index into cells of the corresponding type, indicating which cell contains the input point. For our example, the first two numbers will be in [0, 10[, the second two will be in [0, 20[, and the last will be -1. (This is because we have two points inside 10 triangles, two points inside 20 quads, and one un-classifiable input point.)GetClassifierPointParameters()– returns an array whose length matches the number of input points. Each value is a 3-tuple of reference-cell coordinates (or indeterminate if the cell type does not provide a reference cell).GetInterpolatedValues()– returns an array whose number of tuples matches the number of input points and whose number of components matches the number of components of the requested cell-attribute. For our example, an array with 5 tuples of 3 components each would be returned; it would be named “Velocity” (matching the cell-attribute’s name).
Note that because you can pass in the arrays above (except the interpolated values) to short-circuit classification, it is possible to evaluate multiple cell-attributes without duplicating the classification work.
In InterpolateCellParameters mode, calling the methods above which begin
with GetClassifier… will simply return the input arrays you passed to
configure the query.
§Warnings
The output arrays above generally match the number of input points, but will sometimes exceed the number of input points. This will occur when multiple cells contain an input point (either on a shared boundary or because the cells overlap).
Note that the output should never have fewer points than the input as even points outside the cells will be classified as such.
Currently, this class is limited to evaluating numeric attributes; string or variant arrays are not supported.
Implementations§
Source§impl vtkCellGridEvaluator
impl vtkCellGridEvaluator
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a new vtkCellGridEvaluator wrapped inside vtkNew