Commit Graph

3402 Commits

Author SHA1 Message Date
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
dcc8b8ae63 Merge topic 'template-sources-with-config'
0d2309ab Add template sources to built library

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !1132
2018-04-02 16:59:59 -04:00
Utkarsh Ayachit
60a8ea67b4 Add Algorithm::Transform
Adding Algorithm::Transform API to match API provided by
`DeviceAdatorAlgorithm`.
2018-04-02 15:59:28 -04: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
0f5ba79b3f fix warning in MakeTestDataSet 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
Utkarsh Ayachit
60f4936d54 cleanup diy usage in MultiBlock.
This fixes several issues with how DIY was used in MultiBlock.

Instead of using `diy::RegularSwapPartners` using
`diy::RegularMergePartners` to reduce data to block(gid=0) and then
broadcast out to all ranks (and not blocks) using
`diy::RegularBroadcastPartners`. Old code that used RegularSwapPartners
ended up building reduced result on all blocks, which was not only
unnecessary, but expensive since we would generally have more blocks
than ranks.

Remove `DecomposerMultiBlock`. This class was needed due to my
misunderstanding of how the decomposer works.
`diy::RegularDecomposer<diy::DiscreteBounds>` provides all the necessary
functionality provided by `DecomposerMultiBlock`.
2018-03-31 11:34:33 -04:00
Robert Maynard
83213fcb6b Merge topic 'correct_windows_compile_issues'
82163375 Correct windows compile issues with ColorTable

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1128
2018-03-30 02:19:53 -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
9bc821bdd7 Merge topic 'correct_64bit_floatdefault_missing_symbols'
c9026870 CoordinateSystem now links with FloatDefault == 64

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1127
2018-03-30 01:16:06 -04:00
Robert Maynard
82163375f3 Correct windows compile issues with ColorTable 2018-03-30 01:14:30 -04:00
Robert Maynard
c9026870da CoordinateSystem now links with FloatDefault == 64 2018-03-30 00:07:13 -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
Kenneth Moreland
0efb1dc064 Merge topic 'color-table-length-fix'
90b925ba Fix off-by-one-overrun of color table map array

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !1125
2018-03-29 19:04:48 -04:00
Kenneth Moreland
90b925ba6d Fix off-by-one-overrun of color table map array
The display of a color bar in an OpenGL canvas had an array overrun.
This method first used ColorTable to create an array of colors. It then
used the array to look up values for polygons that make up the color
bar. However, each polygon used indices i and i+1, and on the last value
the i+1 looked pass the end of the array. This fixes the problem by
adding one more value to the color array generated.
2018-03-29 14:19:22 -06:00
Utkarsh Ayachit
396f70edf2 remove shadow methods (fixes #210) 2018-03-29 09:29:21 -04:00
Robert Maynard
944bc3c0d6 Introduce vtkm::cont::ColorTable replacing vtkm::rendering::ColorTable
The new and improved vtkm::cont::ColorTable provides a more feature complete
color table implementation that is modeled after
vtkDiscretizableColorTransferFunction. This class therefore supports different
color spaces ( rgb, lab, hsv, diverging ) and supports execution across all
device adapters.
2018-03-28 16:11:23 -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
f359f6f15f Merge topic 'local-face-indices'
1fe78692 Resurrect function to get face indices

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !1120
2018-03-23 11:39:26 -04:00
Robert Maynard
906f4c0d8d Merge topic 'make_cuda_virtuals_use_cuda_streams'
2bfbf0a9 Transfer of virtuals to the CUDA device now properly uses streams

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Sujin Philip <sujin.philip@kitware.com>
Merge-request: !1114
2018-03-23 08:51:32 -04:00
Kenneth Moreland
1fe7869211 Resurrect function to get face indices
Due to recent changes to remove static arrays that are not supported on
some devices, the function to return all the local point indices on a
face was removed. That left no way to get the structure of cell faces
short of pulling an internal data structure.

This change resurrects a function to get point indices for a face. The
interface for this method has necessarily changed, so I also changed the
corresponding function for getting edge indices.
2018-03-22 22:37:33 -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
a4aa42c012 Avoid "weird" arrays in fields
In some of the tests there was a field that was using a counting array.
This uses an integer as the value type and has a special implicit
storage type. Currently, this is likely to cause problems whenever it
runs into a cast and call of a dynamic array. For now, let's avoid
these.

In the near future we should have expanded virtual method capabilities
that will make it possible to support these atypical arrays.
2018-03-21 13:35:02 -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
Kenneth Moreland
117ce0be92 Add const correctness to MultiBlock method arguments
Several MultiBlock methods take references as arguments. Generally that
is good as some of the arguments take larger data structures like
DataSet and std::vector that can be passed much faster as a reference.
However, the references were not declared const, which means that you
could not use rvalues. This is now fixed.
2018-03-20 16:33:40 -06:00
Robert Maynard
2bfbf0a902 Transfer of virtuals to the CUDA device now properly uses streams
This way when multiple threads are using VTK-m they all won't block while
one transfer a class with virtuals to the device.
2018-03-20 17:04:41 -04: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
e35eec4a92 Merge topic 'virtual_coordinate_system_workarounds'
cbadd3e6 Make CoordinateSystem not fail on CUDA

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <kmorel@sandia.gov>
Acked-by: Matt Larsen <mlarsen@cs.uoregon.edu>
Merge-request: !1108
2018-03-13 08:31:53 -04:00
Utkarsh Ayachit
cdb62c5b5c Merge branch 'fix-diy-warnings' into 'master'
Fix diy warnings

See merge request vtk/vtk-m!1110
2018-03-12 11:17:27 -04:00
Robert Maynard
cbadd3e67e Make CoordinateSystem not fail on CUDA 2018-03-10 16:38:41 -05:00
Robert Maynard
9eca9be724 Merge topic 'prefer_constexpr_over_const'
7c54125b Switch over from static const to static constexpr where possible.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1097
2018-03-10 16:14:50 -05:00
Robert Maynard
1bd7441384 Merge topic 'more_efficient_dynamicarrayhandle_cast_call'
c026d14b DynamicArrayHandle prunes invalid Value/Storage set before cast and call

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <kmorel@sandia.gov>
Merge-request: !1109
2018-03-10 13:54:33 -05: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
Utkarsh Ayachit
66fcf2a7fd Merge branch 'upstream-diy' into fix-diy-warnings
* upstream-diy:
  diy 2018-03-10 (08f19c67)
2018-03-10 09:24:19 -05:00
Matt Larsen
0d671bcb22 adding inverted clip unit tests 2018-03-09 13:51:28 -08:00
Robert Maynard
c026d14b97 DynamicArrayHandle prunes invalid Value/Storage set before cast and call
By pruning the invalid combinations first we reduce the amount of work
the compiler has to do. Additionally it makes for smaller callstacks when
the compiler errors out during a CastAndCall.
2018-03-09 16:14:27 -05:00
Matt Larsen
2daba82188 adding the ability to invert clips 2018-03-08 18:28:08 -08:00