Commit Graph

22 Commits

Author SHA1 Message Date
Kenneth Moreland
3e1339f9a7 Remove deprecated features from VTK-m
With the major revision 2.0 of VTK-m, many items previously marked as
deprecated were removed. If updating to a new version of VTK-m, it is
recommended to first update to VTK-m 1.9, which will include the deprecated
features but provide warnings (with the right compiler) that will point to
the replacement code. Once the deprecations have been fixed, updating to
2.0 should be smoother.
2022-11-17 07:12:31 -06:00
Kenneth Moreland
2e918c58dc Move ColorTable mapping to its own header
We would really like to be able to include `vtkm::cont::ColorTable` in
such a way that you don't have to compile device code (unless you are
actually compiling functions for the device). Thus, the `Map` functions
of `ColorTable` were in a special `ColorTable.hxx` that contains the
"implementation" for `ColorTable`.

That is confusing to many users. It is more clear to simply have `.h`
headers that do a specific thing. To achieve these two goals, the `Map`
functionality of `ColorTable` is separated out into its own header file.
So you don't need to be using a device compiler just to use `ColorTable`
(including `ColorTable.h`), but you do need to use a device compiler if
mapping values to colors (including `ColorTableMap.h`).
2020-09-14 16:40:26 -06:00
Kenneth Moreland
38bdfec40a Move ColorTable::Sample methods to vtkm_cont
There is little value to declare them `inline`. Instead, just have them
compiled once in the `vtkm_cont` library.
2020-09-14 16:40:26 -06:00
Kenneth Moreland
11996f133f Remove virtual methods from ColorTable
Virtual methods are being deprecated, so remove their use from the
ColorTable classes. Instead of using a virtual method to look up a value
in the ColorTable, we essentially use a switch statement. This change
also simplified the code quite a bit.

The execution object used to use pointers to handle the virtual objects.
That is no longer necessary, so a simple `vtkm::exec::ColorTable` is
returned for execution objects. (Note that this `ColorTable` contains
pointers that are specific for the particular device.) This is a non-
backward compabible change. However, the only place (outside of the
`ColorTable` implementation itself) was a single worklet for converting
scalars to colors (`vtkm::worklet::colorconversion::TransferFunction`).
This is unlikely to affect anyone.

I also "fixed" some names in enum structs. There has been some
inconsistencies in VTK-m on whether items in an enum struct are
capitolized or camel case. We seem to moving toward camel case, so
deprecate some old names.
2020-09-14 13:26:16 -06:00
Kenneth Moreland
ad0a53af71 Convert execution preparation to use tokens
Marked the old versions of PrepareFor* that do not use tokens as
deprecated and moved all of the code to use the new versions that
require a token. This makes the scope of the execution object more
explicit so that it will be kept while in use and can potentially be
reclaimed afterward.
2020-02-25 09:39:19 -07:00
Robert Maynard
3f02558fc2 correct warnings in color table 2020-01-16 17:33:22 -05:00
Robert Maynard
27739660b9 Add missing constructors/assignment operators
Having a custom assignment operator means that the compiler
isn't required to generate the implicit copy constructor.
This makes sure they are constructed.
2020-01-14 11:18:22 -05:00
Kenneth Moreland
0be50c119d Update VTK-m code to use new Vec aliases
Should make the code easier to read.
2019-07-31 12:55:40 -06:00
nadavi
fbcea82e78 conslidate the license statement 2019-04-17 10:57:13 -06:00
Robert Maynard
18ff6681fb Less vtkm_cont cxx files bring in the cuda device
When you have CUDA enabled we need to make sure that all worklet
launches come from a cuda file otherwise we will generate ODR
violations.
2019-04-01 08:21:07 -04:00
Kenneth Moreland
6ebc3ea761 Fix potential warning in AverageByKey
To get the average, we (of course) divide the sum by the amount of
values, which is returned from valuesIn.GetNumberOfComponents(). To do
this, we need to cast the number of components (returned as a
vtkm::IdComponent) to a FieldType. This is a little more complex than it
first seems because FieldType might be a Vec type. If you just try a
static_cast<FieldType>(), it will use the constructor to FieldType which
might be a Vec constructor expecting the type of the component. This in
turn could cause a warning because the vtkm::IdComponent is implicitly
converted to the Vec's component type.

Get around this problem by first casting to the component type of the
field and then constructing a field value from that.
2018-11-27 09:31:23 -07:00
Kenneth Moreland
70e10459c7 Update presets for ColorTable
The ParaView project went through a rigourous selection process
for a short list of color tables. Let's replicate that for our
presets.
2018-11-09 09:02:10 -07:00
Robert Maynard
169ca722b3 Redesign vtkm::cont::ColorTable to work with separable compilation. 2018-10-31 08:18:08 -04:00
Robert Maynard
554bc3d369 At runtime TryExecute supports a specific deviceId to execute on.
Instead of always using the first enabled device, now TryExecute
can be told which device at runtime to use.
2018-08-07 17:22:18 -04:00
Robert Maynard
6dc06423d8 ColorTable can provide vtkm::exec::Colortable to a specific device
Previously it wasn't possible to get a color table transfered
to a specific device.
2018-07-12 10:28:18 -04:00
luz.paz
940c891886 Misc. typos
Found via `codespell` and `grep`
more typos

includes source typo change and a typo that needs further review
follow-up typos


Follow-up typos


Revert a commit
2018-06-14 16:49:11 -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
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
Robert Maynard
79d922ee49 Add a filter that uses ColorTable to color any field from a dataset. 2018-03-29 22:12:30 -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