Commit Graph

294 Commits

Author SHA1 Message Date
Allison Vacanti
93506d25e2 Change function signatures to use 'using' aliases.
Also cleaned up some lingering type typedefs.
2018-05-25 17:18:41 -04:00
Haocheng LIU
5c797169ec Use the strong typed enums for vtkm::cont::Field
Since Field association is used either when creating or working
with 'vtkm::cont::Field', it's put in the class itself.
2018-05-22 11:44:51 -04:00
David Thompson
52a1495859 Fix cell measure when using double precision as default. 2018-05-18 14:05:06 -04:00
David Thompson
00c7905afb Rename vtkm::dot() to vtkm::Dot().
This keeps the old name around but prepares it for removal
in the next release.
2018-05-17 08:51:01 -04:00
David Thompson
dd7c17f776 Compute cell measures (arc length, area, volume).
This commit adds a worklet and a filter to compute
signed integral measures of cells.

It also begins the practic of adding a markdown
changelog entry in `doc/changelog`. See the
changelog entry for details.
2018-05-17 08:50:56 -04:00
Robert Maynard
d0fc332cc0 Correct conversion warnings in the streamline filter.
The strealine filter was incorrectly converting all inputs to
vtkm::FloatDefault which can cause a warning when FloatDefault is double
2018-05-08 13:25:49 -04:00
Robert Maynard
7ac4ae1507 Marching Cubes test doesn't abuse fall through case statements 2018-05-04 15:19:11 -04:00
Utkarsh Ayachit
cb7cbdbcf9 fixes #220: pass only requested fields.
Adding API to DataSet to `CopyStructure` from another dataset. This
copies the cellsets and coordinate systems while leaving the fields
unchanged.

CreateResult no longer copies all input fields to the output dataset
created.

Furthermore, if a Filter subclass doesn't provide `MapFieldOntoOutput`,
then the default implementation simply copies only the selected fields
to the output dataset.
2018-04-20 14:22:47 -04:00
Utkarsh Ayachit
89041e4f8e Compute correct histogram for distributed multiblock cases.
Histogram filter now correctly computes the histogram for multiblock
input or when operating in a distributed environment. It employs
reduction to reduce local/per block results to generate the final
output.
2018-04-12 16:40:19 -04:00
Utkarsh Ayachit
0af0271f59 Filter API enhancements.
This revamps Filter API to improve support for multiblock dataset and
distributed use-cases. Filters now operate on MultiBlock alone thus
`Filter::Execute(MultiBlock&)` is the primary method.
`Filter::Execute(DataSet*)` is only provided as an convenience that
internally puts the dataset into a MultiBlock and calls the primary
method.

Subclasses can provides PreExecute and PostExecute overrides to handle
init/reduction operations for filters with operating on multiple blocks.
Since blocks can be distributed, filters are expected to handle that as
well.

Subclasses can provide `PrepareForExecution(MultiBlock*..)` to customize
behavior for handling multiblock inputs. Default is to simply loop
over blocks.
2018-04-12 16:40:19 -04:00
Utkarsh Ayachit
3da8b5be66 Remove vtkm::filter::Result
This commit removes `vtkm::filter::Result`. All methods that used
`vtkm::filter::Result` simply change to use `vtkm::cont::Dataset` instead.
The utility API on `Result` that was used to add fields to the resulting
dataset is now available via `vtkm::filter::internal::CreateResult`.
2018-04-03 16:55:03 -04:00
Kenneth Moreland
eca65146b3 Merge topic 'simplify-field-to-colors-interface'
3a812b04 Make default ColorTable preset
3391e5d2 Basic interface changes to FieldToColors
a3b2c393 Remove default constructor for ColorTable
cb8a05c7 Add a preset enum to ColorTable
97a24559 Make LAB the default color space

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !1133
2018-04-02 18:24:05 -04:00
Kenneth Moreland
3a812b044e Make default ColorTable preset
Changed the "default" ColorTable preset from "cool to warm" to
"viridis." Also made a default constructor for ColorTable that sets it
to this default preset.

The main reason to change to viridis for the default is that it is in
LAB space. We are concerned that having the default ColorTable preset
being Diverging space could lead to users using that color space
inappropriately.
2018-04-02 15:32:23 -06:00
Kenneth Moreland
3391e5d2cd Basic interface changes to FieldToColors
Provides a default constructor and the ability to set/get the color
table.
2018-04-02 11:44:18 -06:00
Kenneth Moreland
a3b2c3931d Remove default constructor for ColorTable
The problem is that there is no good "default" constructor for
ColorTable. The previous default constructor created an empty color
table, but that would be confusing if someone actually tried to use it.
We could set ot to the default preset, but the default preset uses the
diverging color map, which could foul people up if they actually want to
edit or create their own color map. Instead, force the declaration of
ColorTable to indicate what you plan to do with it.
2018-04-02 11:44:17 -06:00
Kenneth Moreland
cb8a05c71b Add a preset enum to ColorTable
You can still select presets through strings (and we leave ourselves
open to add more presets through strings than enumerating with the
enum), but this provides a way to select a preset that is verified by
the compiler.
2018-04-02 11:44:16 -06:00
Kenneth Moreland
97a245597f Make LAB the default color space
Interpolations in LAB are perceptually uniform, which generally makes it
a better choice as the color space.
2018-04-02 11:44:16 -06:00
Kenneth Moreland
0d2309aba3 Add template sources to built library
Previously there was a special build for the template source files
(.hxx) that installed them but did not create the test builds (because
they cannot be built outside of their enclosing .h file). It also added
an entry into the IDE that let them show up on the file list. However,
because they were not explicitly built as part of something actually
compiled, they did not have an compile options associated with them.
This caused confusion in some IDEs where it could not find the header
files it included, which made it more frustrating to edit them.
2018-04-02 10:11:06 -06:00
Utkarsh Ayachit
a3eacce786 doc: fix typos 2018-04-02 09:30:58 -04:00
Utkarsh Ayachit
eda68a6fec Make MapFieldOntoOutput private API.
MapFieldOntoOutput is no longer public API. Since `vtkm::cont::Filter`
invokes it when appropriate, we no longer need to keep it public.

Also removes the overload of MapFieldOntoOutput that doesn't take
policy. That is no longer needed since vtkm::cont::Filter always can
provide the current policy being used.
2018-04-02 09:30:58 -04:00
Utkarsh Ayachit
dc474eb475 fix Derived type propagation in filter inheritance.
Filter subclasses were not passing the true derived type up the
hierarchy. Fixed that.
2018-04-02 09:30:57 -04:00
Robert Maynard
68a8a60dfa Merge topic 'add_fieldtocolor_filter'
79d922ee Add a filter that uses ColorTable to color any field from a dataset.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1124
2018-03-30 01:16:28 -04:00
Robert Maynard
79d922ee49 Add a filter that uses ColorTable to color any field from a dataset. 2018-03-29 22:12:30 -04:00
Utkarsh Ayachit
396f70edf2 remove shadow methods (fixes #210) 2018-03-29 09:29:21 -04:00
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