Commit Graph

270 Commits

Author SHA1 Message Date
Kenneth Moreland
fa84272507 Enable using coordinates for dot/cross product filters
Also better supporting policies on secondary field.
2018-03-25 19:34:43 -06:00
Kenneth Moreland
707eccd3d5 Make dot/cross filter interface more consistent
Both the dot product filter and the cross product filter require 2
fields to be selected as their input. Previously, you used the
superclass' SetActiveField for the primary field and
SetSecondaryFieldName for the secondary field. This changes adds a
SetPrimaryField method to make the selection more clear. I also changed
SetSecondaryFieldName to SetSecondaryField that optionally takes an
association to make it more consistent.
2018-03-25 10:43:49 -06:00
Kenneth Moreland
86f6ecbfa5 Add some convenience methods for Filter::SetFieldsToPass
The first convenience method takes a FieldSelection and a mode. The mode
given will override the mode in the FieldSelection. The intention is to
make it easy to give the constructor argument for FieldSelection and the
mode. For example, if you wanted to pass all variables _except_
"stopfield", you could say

field.SetFieldsToPass("stopfield",
                      vtkm::filter::FieldSelection::MODE_EXCLUDE);

I also added a convenience method that takes the name of a field and an
association.

field.SetFieldsToPass("pointfield",
                      vtkm::cont::Field::ASSOC_POINTS);

Granted, you could get the same effect by wrapping this arguments in
initializer braces, but this is a bit more clear.
2018-03-22 10:47:04 -06:00
Kenneth Moreland
f8237a9d3a Make selection of fields to pass a field member variable
Previously you passed a FieldSelection to Filter::Execute to specify
which fields to pass from input to output. There is no real reason for
this as other information about input and output fields are member
variables to Filter. This moves field selection as a member variable as
well. (This should also help confusion when updating old code to new to
prevent users from mistaking field passing with input fields.

Also added a few convenience constructors to FieldSelection so that you
can call Field::SetFieldsToPass() with just the string of what you want
to pass.
2018-03-22 10:25:09 -06:00
Kenneth Moreland
d74b96ba5f Support FieldSelection initialization with vtkm::Pair initializer list
It already supported initializer lists of std::pair. It seems weird we
would not also support our own version of pair.
2018-03-21 14:12:22 -06:00
Kenneth Moreland
8e312f816d Add MODE_EXCLUDE to FieldSelection
This allows you to turn off the selection of fields rather than turn
them on. It could be helpful, for example, if you were isosurfacing on a
single isovalue and didn't want to pass the field you are contouring on
(because it's all the same value).
2018-03-21 14:06:12 -06:00
Kenneth Moreland
9c51de8db2 Add MODE_NONE to FieldSelection
This mode forces the selection to be empty. Although there is no
practical difference between having MODE_NONE and having MODE_SELECTED
with nothing selected (which is the default), this is a semantically
nicer way to say you don't want any fields.

Since we have changed the default behavior of Filter::Execute to be
MODE_ALL, this is a nice addition so that you can clearly specify you
don't want to pass any fields by adding
vtkm::filter::FieldSelection::MODE_NONE as the second argument. (Making
it MODE_SELECTED is not clear that you want none.)
2018-03-21 13:43:15 -06:00
Kenneth Moreland
6a6ac7cd82 Change filter to pass all fields by default
You can still select independent fields with a FieldSelection object if
desired.
2018-03-21 12:43:11 -06:00
Utkarsh Ayachit
9cf5be2f8e Make Result constructor as explicit.
This avoid accidental conversions from DataSet to Result in return
values. This exposed several issues with filters and their tests. Fixed
those as well.
2018-03-13 13:54:21 -04:00
Robert Maynard
7c54125b66 Switch over from static const to static constexpr where possible. 2018-03-10 11:39:58 -05:00
Utkarsh Ayachit
66e356f7d9 Merge topic 'add-filters'
86bd81de streamline: handle different storage types for fields.
de4e840e enhance filter API
c255c0eb add `vtkm::cont::ConditionalCastAndCall`
54c2d234 Make it easier to iterator over blocks.
d1a59aad Fixes for CrossProduct and DotProduct.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !1100
2018-03-10 09:24:35 -05:00
Matt Larsen
0d671bcb22 adding inverted clip unit tests 2018-03-09 13:51:28 -08:00
Matt Larsen
2daba82188 adding the ability to invert clips 2018-03-08 18:28:08 -08:00
Utkarsh Ayachit
86bd81de3f streamline: handle different storage types for fields.
this is required now that, in theory, streaminlines filter can be
executed treating the coordinate system as the vector field.
2018-03-07 13:42:23 -05:00
Utkarsh Ayachit
de4e840eae enhance filter API
Filters now support executing on a dataset to produce a result dataset
with automatic mapping of fields to the output dataset. Fields to map
can be selected using `vtkm::filter::FieldSelection` class, which provides
constructors to map all or no fields, along with a selection of fields.

This updates all tests to use the new filter API.
2018-03-07 13:42:23 -05:00
Utkarsh Ayachit
d1a59aad20 Fixes for CrossProduct and DotProduct. 2018-03-06 15:54:46 -05:00
Dave Pugmire
da2b518e63 fix compiler warning 2018-02-27 13:35:35 -05:00
Dave Pugmire
1a0dfaa760 Add mapfield method. 2018-02-27 13:24:30 -05:00
Dave Pugmire
daf1171382 Filters to compute the cross and dot product of vector fields. 2018-02-27 09:24:46 -05:00
Robert Maynard
dde7c76a9f Worklets can't be in anonymous namespace as CUDA 7.5 doesn't support those. 2018-02-26 16:42:00 -05:00
Robert Maynard
ee69c7a4b7 Remove VS2013 workarounds from VTK-m. 2018-02-23 15:39:39 -05:00
Robert Maynard
182f4707e7 vtkm prefers 'using' over typedef. 2018-02-23 10:47:20 -05:00
Sujin Philip
9e466f8cd2 Merge topic 'add-probe'
34bae569 Add Probe worklet and filter
4cd306ea Fix a bug in CellLocator
cf1957ca Add make_VecFromPortalPermute

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !1064
2018-01-30 15:08:49 -05:00
Sujin Philip
34bae5690d Add Probe worklet and filter 2018-01-30 10:43:18 -05:00
luz.paz
80b11afa24 Misc. typos
Found via `codespell -q 3` via downstream VTK
2018-01-30 06:51:47 -05:00
Sujin Philip
70fcd1d1cc Update CoordinateSystem to use the Virtual Array 2018-01-10 10:19:19 -05:00
Sujin Philip
334262db16 Fix Field constructors
1. Add option to copy user supplied array in make_ArrayHandle.
2. Replace Field constructors that take user supplied arrays with make_Field.
3. Replace CoordinateSystem constructors that take user supplied arrays with
   make_CoordinateSystem.
2017-12-21 12:48:15 -05:00
Robert Maynard
203205a171 TryExecute RuntimeDeviceTracker can't be a const ref anymore.
Previously we allowed a const ref as we would make a copy, this only works
as it relies on  RuntimeDeviceTracker implementing state through a shared_ptr.
Instead if we require modifiable types only we can make TryExecute more
efficient and clearer on what it does.
2017-11-10 10:02:45 -05:00
Sujin Philip
8c242cef91 Switch from faux to true virtuals 2017-11-06 15:25:29 -05:00
Allison Vacanti
8fabece187 Use median point from cluster as representative vertex.
Also uses the recently added StableSortIndices worklet to produce the
cell map.
2017-10-10 10:28:51 -04:00
Allison Vacanti
3f4e17e2a2 Add field mapping to VertexClustering. 2017-10-10 10:28:51 -04:00
Robert Maynard
fe028d828a Merge topic 'marching_cubes_faster_structured_normals'
1147edb1 MarchingCubes now uses Gradient fast paths when possible.
d7d5da4f More changes to Neighborhood code to make it more easy to use.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Sujin Philip <sujin.philip@kitware.com>
Merge-request: !916
2017-10-03 15:44:16 -04:00
Dave Pugmire
d6edab8e50 Fix comment for streamline filter. 2017-09-28 08:09:57 -04:00
Dave Pugmire
f303c52f20 fix copyright. 2017-09-28 07:30:38 -04:00
Dave Pugmire
3f4a31f43a copyright changes. 2017-09-28 07:23:43 -04:00
Dave Pugmire
4b74c4d506 Fix copyright statement. 2017-09-28 07:09:05 -04:00
Dave Pugmire
78d7f5ba72 Fix return value to reflect that no mapping was done. 2017-09-27 21:38:38 -04:00
Dave Pugmire
f089598280 compiler warning. 2017-09-27 21:38:38 -04:00
Dave Pugmire
ca5507e6f3 compile warning. 2017-09-27 21:38:38 -04:00
Dave Pugmire
33e25c7aa9 Ken inspired fix for compiler errors. 2017-09-27 21:38:38 -04:00
Dave Pugmire
0a0ee460d3 Formating. 2017-09-27 21:38:38 -04:00
Dave Pugmire
ca57343a9b compiler warnings. 2017-09-27 21:38:37 -04:00
Dave Pugmire
99672d75a2 format warnings. 2017-09-27 21:38:37 -04:00
Dave Pugmire
ee9c158449 Compiler errors and warnings. 2017-09-27 21:38:37 -04:00
Dave Pugmire
e7fac3d873 Wrap the streamline functionality with a filter. 2017-09-27 21:38:37 -04:00
Robert Maynard
1147edb192 MarchingCubes now uses Gradient fast paths when possible.
When running on image data we now use central differences to compute the point
gradient
2017-09-25 14:25:28 -04:00
Kenneth Moreland
c3a3184d51 Update copyright for Sandia
Sandia National Laboratories recently changed management from the
Sandia Corporation to the National Technology & Engineering Solutions
of Sandia, LLC (NTESS). The copyright statements need to be updated
accordingly.
2017-09-20 15:33:44 -06:00
Kenneth Moreland
2fa3a868bd Merge topic 'dynamic-threshold-call-to-worklet'
bd742fc6 Allow Threshold::Run to work on dynamic cell sets

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Sujin Philip <sujin.philip@kitware.com>
Merge-request: !925
2017-09-19 10:53:53 -04:00
Li-Ta Lo
de5f9d1c97 Merge topic 'NDHistogram'
bc1096d8 Update new interface to NDHistogram, NDEntropy worklet and filter
317cff0d Merge branch 'master' of https://gitlab.kitware.com/vtk/vtk-m into NDHistogram
fd30187d Add 'N-dimensional histogram, histogram marginalization and entropy calculation worklets and filters'

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !847
2017-09-14 10:42:30 -04:00
Kenneth Moreland
bd742fc6d4 Allow Threshold::Run to work on dynamic cell sets
Added an overloaded version of vtkm::worklet::Threshold::Run that takes
a dynamic cell set instead of a concrete cell set type. This is
implemented by basically moving the CastAndCall from the Threshold
filter to the worklet class. This allows other filters (that might have
similar operations with different predicates) to use the same code. (It
also happens to grately simplify an example for the User's Guide I am
working on.)

Once cell sets use virtual methods, we should be able to collapse code
like this quite a bit anyway.
2017-09-13 15:58:25 -06:00