vtk-m/vtkm/rendering
Kenneth Moreland d1a4aecc59 Improvements to moving data into ArrayHandle
We have made several improvements to adding data into an `ArrayHandle`.

## Moving data from an `std::vector`

For numerous reasons, it is convenient to define data in a `std::vector`
and then wrap that into an `ArrayHandle`. It is often the case that an
`std::vector` is filled and then becomes unused once it is converted to an
`ArrayHandle`. In this case, what we really want is to pass the data off to
the `ArrayHandle` so that the `ArrayHandle` is now managing the data and
not the `std::vector`.

C++11 has a mechanism to do this: move semantics. You can now pass
variables to functions as an "rvalue" (right-hand value). When something is
passed as an rvalue, it can pull state out of that variable and move it
somewhere else. `std::vector` implements this movement so that an rvalue
can be moved to another `std::vector` without actually copying the data.
`make_ArrayHandle` now also takes advantage of this feature to move rvalue
`std::vector`s.

There is a special form of `make_ArrayHandle` named `make_ArrayHandleMove`
that takes an rvalue. There is also a special overload of
`make_ArrayHandle` itself that handles an rvalue `vector`. (However, using
the explicit move version is better if you want to make sure the data is
actually moved.)

## Make `ArrayHandle` from initalizer list

A common use case for using `std::vector` (particularly in our unit tests)
is to quickly add an initalizer list into an `ArrayHandle`. Now you can
by simply passing an initializer list to `make_ArrayHandle`.

## Deprecated `make_ArrayHandle` with default shallow copy

For historical reasons, passing an `std::vector` or a pointer to
`make_ArrayHandle` does a shallow copy (i.e. `CopyFlag` defaults to `Off`).
Although more efficient, this mode is inherintly unsafe, and making it the
default is asking for trouble.

To combat this, calling `make_ArrayHandle` without a copy flag is
deprecated. In this way, if you wish to do the faster but more unsafe
creation of an `ArrayHandle` you should explicitly express that.

This requried quite a few changes through the VTK-m source (particularly in
the tests).

## Similar changes to `Field`

`vtkm::cont::Field` has a `make_Field` helper function that is similar to
`make_ArrayHandle`. It also features the ability to create fields from
`std::vector`s and C arrays. It also likewise had the same unsafe behavior
by default of not copying from the source of the arrays.

That behavior has similarly been depreciated. You now have to specify a
copy flag.

The ability to construct a `Field` from an initializer list of values has
also been added.
2020-07-23 10:53:38 -06:00
..
internal Update VTK-m code to use new Vec aliases 2019-07-31 12:55:40 -06:00
raytracing Reverse Invoker, Dispatcher and Worklet dependency 2020-07-21 17:25:43 -06:00
testing Deprecate Camera::Activate() and Camera::Finish() 2020-06-14 11:04:06 -04:00
Actor.cxx conslidate the license statement 2019-04-17 10:57:13 -06:00
Actor.h conslidate the license statement 2019-04-17 10:57:13 -06:00
AxisAnnotation2D.cxx Update VTK-m code to use new Vec aliases 2019-07-31 12:55:40 -06:00
AxisAnnotation2D.h conslidate the license statement 2019-04-17 10:57:13 -06:00
AxisAnnotation3D.cxx Update VTK-m code to use new Vec aliases 2019-07-31 12:55:40 -06:00
AxisAnnotation3D.h Update VTK-m code to use new Vec aliases 2019-07-31 12:55:40 -06:00
AxisAnnotation.cxx conslidate the license statement 2019-04-17 10:57:13 -06:00
AxisAnnotation.h For VTK-m libs all includes of DeviceAdapterTagCuda happen from cuda files 2019-04-22 10:39:54 -04:00
BitmapFont.cxx conslidate the license statement 2019-04-17 10:57:13 -06:00
BitmapFont.h conslidate the license statement 2019-04-17 10:57:13 -06:00
BitmapFontFactory.cxx conslidate the license statement 2019-04-17 10:57:13 -06:00
BitmapFontFactory.h conslidate the license statement 2019-04-17 10:57:13 -06:00
BoundingBoxAnnotation.cxx conslidate the license statement 2019-04-17 10:57:13 -06:00
BoundingBoxAnnotation.h conslidate the license statement 2019-04-17 10:57:13 -06:00
Camera.cxx Update VTK-m code to use new Vec aliases 2019-07-31 12:55:40 -06:00
Camera.h Update VTK-m code to use new Vec aliases 2019-07-31 12:55:40 -06:00
Canvas.cxx Improvements to moving data into ArrayHandle 2020-07-23 10:53:38 -06:00
Canvas.h Deprecate Camera::Activate() and Camera::Finish() 2020-06-14 11:04:06 -04:00
CanvasRayTracer.cxx fix bug that zero'd color buffers 2020-06-10 16:02:21 -07:00
CanvasRayTracer.h conslidate the license statement 2019-04-17 10:57:13 -06:00
CMakeLists.txt removed classes related to OpenGL/OSMESA/EGL 2020-04-30 18:24:01 -04:00
Color.cxx conslidate the license statement 2019-04-17 10:57:13 -06:00
Color.h Update VTK-m code to use new Vec aliases 2019-07-31 12:55:40 -06:00
ColorBarAnnotation.cxx Update VTK-m code to use new Vec aliases 2019-07-31 12:55:40 -06:00
ColorBarAnnotation.h conslidate the license statement 2019-04-17 10:57:13 -06:00
ColorLegendAnnotation.cxx Update VTK-m code to use new Vec aliases 2019-07-31 12:55:40 -06:00
ColorLegendAnnotation.h conslidate the license statement 2019-04-17 10:57:13 -06:00
ConnectivityProxy.cxx Merge topic 'scalar_renderer' 2020-03-21 10:28:12 -04:00
ConnectivityProxy.h Longer fixed message 2020-03-06 09:25:50 -08:00
Cylinderizer.h Fix gaps in type support 2020-03-19 17:07:11 -06:00
DecodePNG.h Deprecate writer/ directory. 2020-04-29 11:11:02 -04:00
EncodePNG.h Deprecate writer/ directory. 2020-04-29 11:11:02 -04:00
LineRenderer.cxx Use new ways to get array portal in control environment 2020-02-26 13:10:46 -07:00
LineRenderer.h Update VTK-m code to use new Vec aliases 2019-07-31 12:55:40 -06:00
Mapper.cxx Use new ways to get array portal in control environment 2020-02-26 13:10:46 -07:00
Mapper.h Fix warnings about overriding deprecated methods 2020-06-17 17:58:07 -06:00
MapperConnectivity.cxx Deprecate StartScene() and EndScene() 2020-06-14 11:27:45 -04:00
MapperConnectivity.h Fix warnings about overriding deprecated methods 2020-06-17 17:58:07 -06:00
MapperCylinder.cxx Deprecate StartScene() and EndScene() 2020-06-14 11:27:45 -04:00
MapperCylinder.h Fix warnings about overriding deprecated methods 2020-06-17 17:58:07 -06:00
MapperPoint.cxx Deprecate StartScene() and EndScene() 2020-06-14 11:27:45 -04:00
MapperPoint.h Fix warnings about overriding deprecated methods 2020-06-17 17:58:07 -06:00
MapperQuad.cxx Deprecate StartScene() and EndScene() 2020-06-14 11:27:45 -04:00
MapperQuad.h Fix warnings about overriding deprecated methods 2020-06-17 17:58:07 -06:00
MapperRayTracer.cxx Deprecate StartScene() and EndScene() 2020-06-14 11:27:45 -04:00
MapperRayTracer.h Fix warnings about overriding deprecated methods 2020-06-17 17:58:07 -06:00
MapperVolume.cxx Deprecate StartScene() and EndScene() 2020-06-14 11:27:45 -04:00
MapperVolume.h Fix warnings about overriding deprecated methods 2020-06-17 17:58:07 -06:00
MapperWireframer.cxx Merge topic 'deprecate_startscene' 2020-06-17 12:48:40 -04:00
MapperWireframer.h Fix warnings about overriding deprecated methods 2020-06-17 17:58:07 -06:00
MatrixHelpers.h Update VTK-m code to use new Vec aliases 2019-07-31 12:55:40 -06:00
Quadralizer.h Fix gaps in type support 2020-03-19 17:07:11 -06:00
ScalarRenderer.cxx fix scalar renderer portal warning 2020-03-21 08:29:19 -07:00
ScalarRenderer.h alter interface of scalar renderer result 2020-02-18 09:45:31 -08:00
Scene.cxx Deprecate StartScene() and EndScene() 2020-06-14 11:27:45 -04:00
Scene.h conslidate the license statement 2019-04-17 10:57:13 -06:00
TextAnnotation.cxx Update VTK-m code to use new Vec aliases 2019-07-31 12:55:40 -06:00
TextAnnotation.h Update VTK-m code to use new Vec aliases 2019-07-31 12:55:40 -06:00
TextAnnotationBillboard.cxx Update VTK-m code to use new Vec aliases 2019-07-31 12:55:40 -06:00
TextAnnotationBillboard.h Update VTK-m code to use new Vec aliases 2019-07-31 12:55:40 -06:00
TextAnnotationScreen.cxx Update VTK-m code to use new Vec aliases 2019-07-31 12:55:40 -06:00
TextAnnotationScreen.h Update VTK-m code to use new Vec aliases 2019-07-31 12:55:40 -06:00
TextRenderer.cxx Fix deadlock in rendering 2020-02-26 13:10:49 -07:00
TextRenderer.h Update VTK-m code to use new Vec aliases 2019-07-31 12:55:40 -06:00
Texture2D.h Convert execution preparation to use tokens 2020-02-25 09:39:19 -07:00
Triangulator.h Trivial typo fix. 2020-05-08 10:59:09 -04:00
View1D.cxx Deprecate Camera::Activate() and Camera::Finish() 2020-06-14 11:04:06 -04:00
View1D.h conslidate the license statement 2019-04-17 10:57:13 -06:00
View2D.cxx Add option to enable/disable world annotations. 2020-07-09 14:38:39 -04:00
View2D.h conslidate the license statement 2019-04-17 10:57:13 -06:00
View3D.cxx Add option to enable/disable world annotations. 2020-07-09 14:38:39 -04:00
View3D.h conslidate the license statement 2019-04-17 10:57:13 -06:00
View.cxx Remove Initialize() boilerplate. 2020-06-05 13:38:18 -04:00
View.h Add option to enable/disable world annotations. 2020-07-09 14:38:39 -04:00
Wireframer.h Convert execution preparation to use tokens 2020-02-25 09:39:19 -07:00
WorldAnnotator.cxx Update VTK-m code to use new Vec aliases 2019-07-31 12:55:40 -06:00
WorldAnnotator.h Update VTK-m code to use new Vec aliases 2019-07-31 12:55:40 -06:00