Commit 09383ceb authored by Robert Maynard's avatar Robert Maynard

Update vtkm/rendering to work with vtkm::cont::ArrayHandleVariant

parent 39929d5a
......@@ -28,7 +28,6 @@
#include <vtkm/VectorAnalysis.h>
#include <vtkm/cont/ArrayHandle.h>
#include <vtkm/cont/AtomicArray.h>
#include <vtkm/cont/DynamicArrayHandle.h>
#include <vtkm/rendering/MatrixHelpers.h>
#include <vtkm/rendering/Triangulator.h>
#include <vtkm/worklet/DispatcherMapField.h>
......
......@@ -27,8 +27,8 @@
#include <vtkm/cont/ArrayHandleCartesianProduct.h>
#include <vtkm/cont/ArrayHandleCompositeVector.h>
#include <vtkm/cont/ArrayHandleUniformPointCoordinates.h>
#include <vtkm/cont/ArrayHandleVariant.h>
#include <vtkm/cont/DeviceAdapterListTag.h>
#include <vtkm/cont/DynamicArrayHandle.h>
#include <vtkm/cont/TryExecute.h>
namespace vtkm
......@@ -149,73 +149,6 @@ struct RayStatusType : vtkm::ListTagBase<vtkm::UInt8>
struct ScalarRenderingTypes : vtkm::ListTagBase<ScalarF, ScalarD>
{
};
//Restrict Coordinate types to explicit for volume renderer
namespace detail
{
using ArrayHandleCompositeVectorFloat32_3Default =
vtkm::cont::ArrayHandleCompositeVector<vtkm::cont::ArrayHandle<vtkm::Float32>,
vtkm::cont::ArrayHandle<vtkm::Float32>,
vtkm::cont::ArrayHandle<vtkm::Float32>>;
using ArrayHandleCompositeVectorFloat64_3Default =
vtkm::cont::ArrayHandleCompositeVector<vtkm::cont::ArrayHandle<vtkm::Float64>,
vtkm::cont::ArrayHandle<vtkm::Float64>,
vtkm::cont::ArrayHandle<vtkm::Float64>>;
struct StructuredStorageListTagCoordinateSystem
: vtkm::ListTagBase<vtkm::cont::ArrayHandleUniformPointCoordinates::StorageTag,
vtkm::cont::ArrayHandleCartesianProduct<
vtkm::cont::ArrayHandle<vtkm::FloatDefault>,
vtkm::cont::ArrayHandle<vtkm::FloatDefault>,
vtkm::cont::ArrayHandle<vtkm::FloatDefault>>::StorageTag>
{
};
/*
* This would be for support of curvilinear meshes
struct StructuredStorageListTagCoordinateSystem
: vtkm::ListTagJoin<
VTKM_DEFAULT_STORAGE_LIST_TAG,
vtkm::ListTagBase<vtkm::cont::ArrayHandleUniformPointCoordinates::StorageTag,
vtkm::cont::ArrayHandleCartesianProduct<
vtkm::cont::ArrayHandle<vtkm::FloatDefault>,
vtkm::cont::ArrayHandle<vtkm::FloatDefault>,
vtkm::cont::ArrayHandle<vtkm::FloatDefault> >::StorageTag > >
{ };*/
} // namespace detail
/*
* This is a less restrictive type list for Explicit meshes
struct ExplicitCoordinatesType : vtkm::ListTagBase<vtkm::Vec<vtkm::Float32,3>,
vtkm::Vec<vtkm::Float64,3> > {};
struct StorageListTagExplicitCoordinateSystem
: vtkm::ListTagBase<vtkm::cont::StorageTagBasic,
detail::ArrayHandleCompositeVectorFloat32_3Default::StorageTag,
detail::ArrayHandleCompositeVectorFloat64_3Default::StorageTag >{ };
*/
//Super restrictive
struct ExplicitCoordinatesType
: vtkm::ListTagBase<vtkm::Vec<vtkm::Float32, 3>, vtkm::Vec<vtkm::Float64, 3>>
{
};
struct StorageListTagExplicitCoordinateSystem : vtkm::ListTagBase<vtkm::cont::StorageTagBasic>
{
};
using StructuredStorage = detail::StructuredStorageListTagCoordinateSystem;
using DynamicArrayHandleStructuredCoordinateSystem =
vtkm::cont::DynamicArrayHandleBase<ExplicitCoordinatesType, StructuredStorage>;
using DynamicArrayHandleExplicitCoordinateSystem =
vtkm::cont::DynamicArrayHandleBase<ExplicitCoordinatesType,
StorageListTagExplicitCoordinateSystem>;
}
}
} //namespace vtkm::rendering::raytracing
......
......@@ -751,8 +751,7 @@ void VolumeRendererStructured::SetData(const vtkm::cont::CoordinateSystem& coord
const vtkm::cont::CellSetStructured<3>& cellset,
const vtkm::Range& scalarRange)
{
if (coords.GetData().IsSameType(CartesianArrayHandle()))
IsUniformDataSet = false;
IsUniformDataSet = !coords.GetData().IsType<CartesianArrayHandle>();
IsSceneDirty = true;
SpatialExtent = coords.GetBounds();
Coordinates = coords.GetData();
......
......@@ -48,5 +48,6 @@ void RenderTests()
int UnitTestCanvas(int, char* [])
{
vtkm::cont::GetGlobalRuntimeDeviceTracker().ForceDevice(VTKM_DEFAULT_DEVICE_ADAPTER_TAG());
return vtkm::cont::testing::Testing::Run(RenderTests);
}
......@@ -61,5 +61,6 @@ void RenderTests()
int UnitTestMapperConnectivity(int, char* [])
{
vtkm::cont::GetGlobalRuntimeDeviceTracker().ForceDevice(VTKM_DEFAULT_DEVICE_ADAPTER_TAG());
return vtkm::cont::testing::Testing::Run(RenderTests);
}
......@@ -79,5 +79,6 @@ void RenderTests()
int UnitTestMapperCylinders(int, char* [])
{
vtkm::cont::GetGlobalRuntimeDeviceTracker().ForceDevice(VTKM_DEFAULT_DEVICE_ADAPTER_TAG());
return vtkm::cont::testing::Testing::Run(RenderTests);
}
......@@ -64,5 +64,6 @@ void RenderTests()
int UnitTestMapperPoints(int, char* [])
{
vtkm::cont::GetGlobalRuntimeDeviceTracker().ForceDevice(VTKM_DEFAULT_DEVICE_ADAPTER_TAG());
return vtkm::cont::testing::Testing::Run(RenderTests);
}
......@@ -60,5 +60,6 @@ void RenderTests()
int UnitTestMapperQuads(int, char* [])
{
vtkm::cont::GetGlobalRuntimeDeviceTracker().ForceDevice(VTKM_DEFAULT_DEVICE_ADAPTER_TAG());
return vtkm::cont::testing::Testing::Run(RenderTests);
}
......@@ -59,5 +59,6 @@ void RenderTests()
int UnitTestMapperRayTracer(int, char* [])
{
vtkm::cont::GetGlobalRuntimeDeviceTracker().ForceDevice(VTKM_DEFAULT_DEVICE_ADAPTER_TAG());
return vtkm::cont::testing::Testing::Run(RenderTests);
}
......@@ -53,5 +53,6 @@ void RenderTests()
int UnitTestMapperVolume(int, char* [])
{
vtkm::cont::GetGlobalRuntimeDeviceTracker().ForceDevice(VTKM_DEFAULT_DEVICE_ADAPTER_TAG());
return vtkm::cont::testing::Testing::Run(RenderTests);
}
......@@ -141,5 +141,6 @@ void RenderTests()
int UnitTestMapperWireframer(int, char* [])
{
vtkm::cont::GetGlobalRuntimeDeviceTracker().ForceDevice(VTKM_DEFAULT_DEVICE_ADAPTER_TAG());
return vtkm::cont::testing::Testing::Run(RenderTests);
}
......@@ -72,5 +72,6 @@ void RenderTests()
int UnitTestMultiMapper(int, char* [])
{
vtkm::cont::GetGlobalRuntimeDeviceTracker().ForceDevice(VTKM_DEFAULT_DEVICE_ADAPTER_TAG());
return vtkm::cont::testing::Testing::Run(RenderTests);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment