From 0be50c119d3a52f7153bf8017e2bad0d0022cb02 Mon Sep 17 00:00:00 2001 From: Kenneth Moreland Date: Wed, 31 Jul 2019 10:20:38 -0600 Subject: [PATCH] Update VTK-m code to use new Vec aliases Should make the code easier to read. --- benchmarking/BenchmarkCopySpeeds.cxx | 14 +- benchmarking/BenchmarkDeviceAdapter.cxx | 10 +- benchmarking/BenchmarkFieldAlgorithms.cxx | 4 +- benchmarking/BenchmarkFilters.cxx | 15 +- benchmarking/BenchmarkRayTracing.cxx | 14 +- examples/clipping/Clipping.cxx | 2 +- examples/demo/Demo.cxx | 2 +- examples/game_of_life/GameOfLife.cxx | 8 +- examples/hello_world/HelloWorld.cxx | 8 +- examples/isosurface/IsosurfaceUniformGrid.cxx | 16 +- examples/lagrangian/lagrangian.cxx | 9 +- examples/mesh_quality/MeshQuality.cxx | 2 +- examples/multi_backend/IOGenerator.cxx | 2 +- examples/multi_backend/MultiDeviceGradient.h | 6 +- .../PolyLineArchimedeanHelix.cxx | 14 +- examples/streamline/StreamLineUniformGrid.cxx | 10 +- examples/tau_timing/TauTiming.cxx | 16 +- .../tetrahedra/TetrahedralizeExplicitGrid.cxx | 2 +- .../tetrahedra/TetrahedralizeUniformGrid.cxx | 11 +- .../tetrahedra/TriangulateExplicitGrid.cxx | 8 +- .../tetrahedra/TriangulateUniformGrid.cxx | 12 +- vtkm/Bounds.h | 4 +- vtkm/ImplicitFunction.h | 2 +- vtkm/TypeListTag.h | 94 ++++----- vtkm/VecAxisAlignedPointCoordinates.h | 8 +- .../cont/ArrayHandleUniformPointCoordinates.h | 8 +- vtkm/cont/ArrayHandleVirtualCoordinates.h | 9 +- vtkm/cont/ArrayRangeCompute.cxx | 6 +- vtkm/cont/ArrayRangeCompute.h | 8 +- vtkm/cont/ArrayRangeCompute.hxx | 2 +- vtkm/cont/CellLocatorRectilinearGrid.cxx | 2 +- vtkm/cont/CellLocatorUniformBins.h | 2 +- vtkm/cont/CellLocatorUniformGrid.h | 4 +- vtkm/cont/ColorTable.h | 32 ++-- vtkm/cont/ColorTable.hxx | 28 +-- vtkm/cont/ColorTableSamples.h | 4 +- vtkm/cont/CoordinateSystem.cxx | 19 +- vtkm/cont/CoordinateSystem.h | 17 +- vtkm/cont/CoordinateSystem.hxx | 10 +- vtkm/cont/DataSetBuilderExplicit.cxx | 2 +- vtkm/cont/DataSetBuilderExplicit.h | 6 +- vtkm/cont/DataSetBuilderUniform.cxx | 11 +- vtkm/cont/DataSetBuilderUniform.h | 6 +- vtkm/cont/PointLocatorUniformGrid.cxx | 12 +- vtkm/cont/testing/MakeTestDataSet.h | 30 +-- .../TestingArrayHandleVirtualCoordinates.h | 2 +- .../TestingCellLocatorRectilinearGrid.h | 10 +- .../testing/TestingCellLocatorUniformBins.h | 6 +- .../testing/TestingCellLocatorUniformGrid.h | 10 +- vtkm/cont/testing/TestingColorTable.h | 82 ++++---- vtkm/cont/testing/TestingComputeRange.h | 4 +- vtkm/cont/testing/TestingDataSetExplicit.h | 2 +- vtkm/cont/testing/TestingDataSetSingleType.h | 2 +- vtkm/cont/testing/TestingDeviceAdapter.h | 31 ++- vtkm/cont/testing/TestingFancyArrayHandles.h | 13 +- vtkm/cont/testing/TestingImplicitFunction.h | 2 +- .../testing/TestingPointLocatorUniformGrid.h | 4 +- .../UnitTestArrayHandleCompositeVector.cxx | 8 +- .../testing/UnitTestArrayHandleSwizzle.cxx | 2 +- ...TestArrayHandleUniformPointCoordinates.cxx | 2 +- .../testing/UnitTestCellLocatorGeneral.cxx | 6 +- .../testing/UnitTestDataSetPermutation.cxx | 2 +- .../testing/UnitTestDataSetRectilinear.cxx | 3 +- vtkm/cont/testing/UnitTestDataSetUniform.cxx | 3 +- .../testing/UnitTestFieldRangeCompute.cxx | 8 +- .../UnitTestFieldRangeGlobalCompute.cxx | 8 +- .../UnitTestSerializationArrayHandle.cxx | 20 +- .../testing/UnitTestVariantArrayHandle.cxx | 4 +- vtkm/exec/BoundaryState.h | 27 ++- vtkm/exec/CellDerivative.h | 24 +-- vtkm/exec/CellInterpolate.h | 48 +++-- vtkm/exec/CellLocator.h | 4 +- ...CellLocatorBoundingIntervalHierarchyExec.h | 24 +-- vtkm/exec/CellLocatorRectilinearGrid.h | 12 +- vtkm/exec/CellLocatorUniformGrid.h | 14 +- vtkm/exec/ConnectivityExtrude.h | 2 +- vtkm/exec/FieldNeighborhood.h | 2 +- vtkm/exec/ParametricCoordinates.h | 16 +- vtkm/exec/PointLocator.h | 2 +- vtkm/exec/PointLocatorUniformGrid.h | 28 +-- vtkm/exec/arg/FetchTagArrayTopologyMapIn.h | 36 ++-- .../UnitTestFetchArrayTopologyMapIn.cxx | 8 +- .../cuda/internal/ArrayPortalFromThrust.h | 78 ++++---- .../TwoLevelUniformGridExecutionObject.h | 2 +- vtkm/exec/testing/UnitTestCellDerivative.cxx | 32 ++-- vtkm/exec/testing/UnitTestCellEdgeFace.cxx | 2 +- vtkm/exec/testing/UnitTestCellInterpolate.cxx | 15 +- .../testing/UnitTestParametricCoordinates.cxx | 8 +- vtkm/filter/FieldToColors.hxx | 4 +- vtkm/filter/FilterDataSetWithField.hxx | 4 +- vtkm/filter/FilterField.hxx | 4 +- vtkm/filter/GhostCellRemove.hxx | 38 ++-- vtkm/filter/Gradient.h | 6 +- vtkm/filter/Lagrangian.h | 3 +- vtkm/filter/Lagrangian.hxx | 10 +- vtkm/filter/MarchingCubes.hxx | 2 +- vtkm/filter/Pathline.h | 7 +- vtkm/filter/Pathline.hxx | 3 +- vtkm/filter/SplitSharpEdges.hxx | 2 +- vtkm/filter/Streamline.h | 7 +- vtkm/filter/Streamline.hxx | 3 +- vtkm/filter/SurfaceNormals.hxx | 4 +- .../testing/UnitTestCellAverageFilter.cxx | 6 +- .../UnitTestCellSetConnectivityFilter.cxx | 8 +- vtkm/filter/testing/UnitTestCleanGrid.cxx | 6 +- .../testing/UnitTestClipWithFieldFilter.cxx | 2 +- ...UnitTestClipWithImplicitFunctionFilter.cxx | 6 +- .../UnitTestCoordinateSystemTransform.cxx | 6 +- .../testing/UnitTestCrossProductFilter.cxx | 19 +- .../testing/UnitTestDotProductFilter.cxx | 12 +- vtkm/filter/testing/UnitTestEntropyFilter.cxx | 8 +- .../testing/UnitTestExtractGeometryFilter.cxx | 16 +- .../testing/UnitTestExtractPointsFilter.cxx | 18 +- vtkm/filter/testing/UnitTestFieldToColors.cxx | 14 +- .../testing/UnitTestGhostCellRemove.cxx | 6 +- vtkm/filter/testing/UnitTestGradient.cxx | 36 ++-- .../testing/UnitTestLagrangianFilter.cxx | 8 +- .../testing/UnitTestMarchingCubesFilter.cxx | 26 +-- .../testing/UnitTestMeshQualityFilter.cxx | 2 +- .../testing/UnitTestPointElevationFilter.cxx | 2 +- .../filter/testing/UnitTestPointTransform.cxx | 56 +++--- vtkm/filter/testing/UnitTestProbe.cxx | 2 +- .../testing/UnitTestSplitSharpEdgesFilter.cxx | 8 +- .../testing/UnitTestStreamlineFilter.cxx | 31 ++- .../testing/UnitTestSurfaceNormalsFilter.cxx | 23 +-- .../testing/UnitTestVectorMagnitudeFilter.cxx | 4 +- .../UnitTestVertexClusteringFilter.cxx | 2 +- .../testing/UnitTestWarpScalarFilter.cxx | 2 +- .../testing/UnitTestWarpVectorFilter.cxx | 4 +- .../ArrayPortalUniformPointCoordinates.h | 2 +- vtkm/internal/IndicesExtrude.h | 6 +- .../UnitTestArrayPortalValueReference.cxx | 3 +- .../testing/UnitTestFunctionInterface.cxx | 2 +- .../testing/TestingTransferFancyHandles.h | 9 +- vtkm/io/reader/BOVDataSetReader.h | 8 +- vtkm/io/reader/VTKStructuredPointsReader.h | 2 +- vtkm/rendering/AxisAnnotation2D.cxx | 2 +- vtkm/rendering/AxisAnnotation3D.cxx | 35 ++-- vtkm/rendering/AxisAnnotation3D.h | 7 +- vtkm/rendering/Camera.cxx | 19 +- vtkm/rendering/Camera.h | 36 ++-- vtkm/rendering/Canvas.cxx | 60 +++--- vtkm/rendering/Canvas.h | 20 +- vtkm/rendering/CanvasGL.cxx | 20 +- vtkm/rendering/CanvasGL.h | 20 +- vtkm/rendering/CanvasOSMesa.cxx | 2 +- vtkm/rendering/CanvasRayTracer.cxx | 8 +- vtkm/rendering/Color.h | 4 +- vtkm/rendering/ColorBarAnnotation.cxx | 2 +- vtkm/rendering/ColorLegendAnnotation.cxx | 2 +- vtkm/rendering/ConnectivityProxy.cxx | 6 +- vtkm/rendering/ConnectivityProxy.h | 2 +- vtkm/rendering/Cylinderizer.h | 4 +- vtkm/rendering/LineRenderer.cxx | 31 ++- vtkm/rendering/LineRenderer.h | 10 +- vtkm/rendering/Mapper.cxx | 10 +- vtkm/rendering/Mapper.h | 2 +- vtkm/rendering/MapperCylinder.cxx | 4 +- vtkm/rendering/MapperGL.cxx | 30 +-- vtkm/rendering/MapperWireframer.cxx | 8 +- vtkm/rendering/MatrixHelpers.h | 30 ++- vtkm/rendering/Quadralizer.h | 4 +- vtkm/rendering/TextAnnotation.cxx | 2 +- vtkm/rendering/TextAnnotation.h | 4 +- vtkm/rendering/TextAnnotationBillboard.cxx | 6 +- vtkm/rendering/TextAnnotationBillboard.h | 6 +- vtkm/rendering/TextAnnotationScreen.cxx | 4 +- vtkm/rendering/TextAnnotationScreen.h | 6 +- vtkm/rendering/TextRenderer.cxx | 46 ++--- vtkm/rendering/TextRenderer.h | 14 +- vtkm/rendering/Triangulator.h | 22 +-- vtkm/rendering/View3D.cxx | 4 +- vtkm/rendering/Wireframer.h | 32 ++-- vtkm/rendering/WorldAnnotator.cxx | 14 +- vtkm/rendering/WorldAnnotator.h | 12 +- vtkm/rendering/WorldAnnotatorGL.cxx | 14 +- vtkm/rendering/WorldAnnotatorGL.h | 12 +- vtkm/rendering/internal/RunTriangulator.cxx | 2 +- vtkm/rendering/internal/RunTriangulator.h | 2 +- vtkm/rendering/raytracing/BVHTraverser.h | 9 +- .../raytracing/BoundingVolumeHierarchy.cxx | 41 ++-- .../raytracing/BoundingVolumeHierarchy.h | 2 +- vtkm/rendering/raytracing/Camera.cxx | 103 +++++----- vtkm/rendering/raytracing/Camera.h | 26 +-- vtkm/rendering/raytracing/CellIntersector.h | 8 +- .../raytracing/ConnectivityTracer.cxx | 27 ++- .../rendering/raytracing/ConnectivityTracer.h | 8 +- .../raytracing/CylinderIntersector.cxx | 14 +- .../raytracing/MeshConnectivityBase.h | 2 +- .../raytracing/MeshConnectivityBuilder.cxx | 75 ++++---- .../raytracing/MeshConnectivityBuilder.h | 6 +- .../raytracing/MeshConnectivityContainers.h | 8 +- vtkm/rendering/raytracing/MortonCodes.h | 26 ++- vtkm/rendering/raytracing/QuadIntersector.cxx | 10 +- vtkm/rendering/raytracing/RayOperations.h | 8 +- vtkm/rendering/raytracing/RayTracer.cxx | 26 +-- vtkm/rendering/raytracing/RayTracer.h | 4 +- .../rendering/raytracing/RayTracingTypeDefs.h | 8 +- vtkm/rendering/raytracing/Sampler.h | 17 +- .../raytracing/SphereIntersector.cxx | 8 +- .../raytracing/TriangleExtractor.cxx | 2 +- vtkm/rendering/raytracing/TriangleExtractor.h | 4 +- .../raytracing/TriangleIntersections.h | 19 +- .../raytracing/TriangleIntersector.cxx | 24 +-- .../raytracing/TriangleIntersector.h | 6 +- .../raytracing/VolumeRendererStructured.cxx | 93 +++++---- .../raytracing/VolumeRendererStructured.h | 4 +- vtkm/rendering/testing/RenderTest.h | 23 +-- .../testing/UnitTestMapperWireframer.cxx | 6 +- vtkm/testing/Testing.h | 2 +- vtkm/testing/UnitTestBounds.cxx | 2 +- vtkm/testing/UnitTestHash.cxx | 4 +- vtkm/testing/UnitTestPair.cxx | 11 +- vtkm/testing/UnitTestTypeListTag.cxx | 178 +++++++++--------- vtkm/testing/UnitTestTypes.cxx | 8 +- ...UnitTestVecAxisAlignedPointCoordinates.cxx | 6 +- vtkm/testing/UnitTestVecTraits.cxx | 4 +- vtkm/worklet/ExternalFaces.h | 23 ++- vtkm/worklet/ExtractPoints.h | 3 +- vtkm/worklet/KernelSplatter.h | 28 +-- vtkm/worklet/OscillatorSource.h | 10 +- vtkm/worklet/PointElevation.h | 10 +- vtkm/worklet/PointMerge.h | 21 +-- vtkm/worklet/Probe.h | 6 +- vtkm/worklet/ScalarsToColors.h | 12 +- vtkm/worklet/ScalarsToColors.hxx | 20 +- vtkm/worklet/SplitSharpEdges.h | 3 +- vtkm/worklet/StreamSurface.h | 4 +- vtkm/worklet/Tube.h | 14 +- vtkm/worklet/VertexClustering.h | 8 +- vtkm/worklet/WarpScalar.h | 6 +- vtkm/worklet/WarpVector.h | 4 +- vtkm/worklet/WaveletGenerator.h | 4 +- vtkm/worklet/clip/ClipTables.h | 2 +- vtkm/worklet/colorconversion/Conversions.h | 6 +- vtkm/worklet/colorconversion/ConvertToRGB.h | 10 +- vtkm/worklet/colorconversion/ConvertToRGBA.h | 8 +- vtkm/worklet/colorconversion/LookupTable.h | 6 +- .../worklet/colorconversion/ShiftScaleToRGB.h | 20 +- .../colorconversion/ShiftScaleToRGBA.h | 42 ++--- .../colorconversion/TransferFunction.h | 4 +- vtkm/worklet/gradient/CellGradient.h | 3 +- vtkm/worklet/gradient/Divergence.h | 4 +- vtkm/worklet/gradient/GradientOutput.h | 10 +- vtkm/worklet/gradient/PointGradient.h | 2 +- vtkm/worklet/gradient/QCriterion.h | 4 +- vtkm/worklet/gradient/Vorticity.h | 4 +- vtkm/worklet/internal/TriangulateTables.h | 10 +- .../particleadvection/GridEvaluators.h | 5 +- .../TemporalGridEvaluators.h | 3 +- .../BoundingIntervalHierarchy.h | 4 +- vtkm/worklet/splatkernels/KernelBase.h | 2 +- .../UnitTestBoundingIntervalHierarchy.cxx | 7 +- vtkm/worklet/testing/UnitTestCellDeepCopy.cxx | 4 +- vtkm/worklet/testing/UnitTestCellGradient.cxx | 46 ++--- .../testing/UnitTestCellSetConnectivity.cxx | 8 +- vtkm/worklet/testing/UnitTestClipping.cxx | 6 +- .../UnitTestCoordinateSystemTransform.cxx | 25 ++- vtkm/worklet/testing/UnitTestCosmoTools.cxx | 4 +- .../worklet/testing/UnitTestExternalFaces.cxx | 2 +- .../testing/UnitTestExtractGeometry.cxx | 10 +- .../worklet/testing/UnitTestExtractPoints.cxx | 18 +- .../testing/UnitTestKdTreeBuildNNS.cxx | 4 +- vtkm/worklet/testing/UnitTestMagnitude.cxx | 2 +- .../worklet/testing/UnitTestMarchingCubes.cxx | 24 +-- .../testing/UnitTestParticleAdvection.cxx | 2 +- .../testing/UnitTestPointElevation.cxx | 2 +- .../worklet/testing/UnitTestPointGradient.cxx | 35 ++-- .../testing/UnitTestPointTransform.cxx | 62 +++--- vtkm/worklet/testing/UnitTestProbe.cxx | 2 +- .../testing/UnitTestRemoveUnusedPoints.cxx | 4 +- .../testing/UnitTestScalarsToColors.cxx | 72 ++++--- vtkm/worklet/testing/UnitTestSplatKernels.cxx | 2 +- .../testing/UnitTestSplitSharpEdges.cxx | 10 +- .../testing/UnitTestStreamLineUniformGrid.cxx | 6 +- .../worklet/testing/UnitTestStreamSurface.cxx | 10 +- .../testing/UnitTestSurfaceNormals.cxx | 21 +-- vtkm/worklet/testing/UnitTestTube.cxx | 16 +- .../testing/UnitTestVertexClustering.cxx | 2 +- vtkm/worklet/testing/UnitTestWarpScalar.cxx | 2 +- vtkm/worklet/testing/UnitTestWarpVector.cxx | 2 +- .../tetrahedralize/TetrahedralizeExplicit.h | 2 +- .../worklet/triangulate/TriangulateExplicit.h | 2 +- 283 files changed, 1795 insertions(+), 1947 deletions(-) diff --git a/benchmarking/BenchmarkCopySpeeds.cxx b/benchmarking/BenchmarkCopySpeeds.cxx index 6dfe4da51..16028297a 100644 --- a/benchmarking/BenchmarkCopySpeeds.cxx +++ b/benchmarking/BenchmarkCopySpeeds.cxx @@ -140,21 +140,21 @@ struct BenchmarkValueTypeFunctor bool operator()(DeviceAdapter id) { BenchmarkValueType(id); - BenchmarkValueType, DeviceAdapter>(id); - BenchmarkValueType, DeviceAdapter>(id); - BenchmarkValueType, DeviceAdapter>(id); + BenchmarkValueType(id); + BenchmarkValueType(id); + BenchmarkValueType(id); BenchmarkValueType(id); - BenchmarkValueType, DeviceAdapter>(id); + BenchmarkValueType(id); BenchmarkValueType(id); - BenchmarkValueType, DeviceAdapter>(id); + BenchmarkValueType(id); BenchmarkValueType(id); - BenchmarkValueType, DeviceAdapter>(id); + BenchmarkValueType(id); BenchmarkValueType(id); - BenchmarkValueType, DeviceAdapter>(id); + BenchmarkValueType(id); BenchmarkValueType, DeviceAdapter>(id); BenchmarkValueType, DeviceAdapter>(id); diff --git a/benchmarking/BenchmarkDeviceAdapter.cxx b/benchmarking/BenchmarkDeviceAdapter.cxx index 942b6210d..2491723e7 100644 --- a/benchmarking/BenchmarkDeviceAdapter.cxx +++ b/benchmarking/BenchmarkDeviceAdapter.cxx @@ -147,14 +147,14 @@ struct BaseTypes : vtkm::ListTagBase, vtkm::Float32, - vtkm::Vec, + vtkm::Vec3f_32, vtkm::Float64, - vtkm::Vec> + vtkm::Vec3f_64> { }; struct ExtendedTypes : vtkm::ListTagBase, + vtkm::Vec4ui_8, vtkm::Int32, vtkm::Int64, vtkm::Pair, @@ -162,9 +162,9 @@ struct ExtendedTypes : vtkm::ListTagBase, vtkm::Pair, vtkm::Float32, - vtkm::Vec, + vtkm::Vec3f_32, vtkm::Float64, - vtkm::Vec> + vtkm::Vec3f_64> { }; diff --git a/benchmarking/BenchmarkFieldAlgorithms.cxx b/benchmarking/BenchmarkFieldAlgorithms.cxx index 8a7bc4480..79b50eebd 100644 --- a/benchmarking/BenchmarkFieldAlgorithms.cxx +++ b/benchmarking/BenchmarkFieldAlgorithms.cxx @@ -344,7 +344,7 @@ struct ValueTypes : vtkm::ListTagBase { }; -struct InterpValueTypes : vtkm::ListTagBase> +struct InterpValueTypes : vtkm::ListTagBase { }; @@ -876,7 +876,7 @@ private: struct ImplicitFunctionBenchData { - vtkm::cont::ArrayHandle> Points; + vtkm::cont::ArrayHandle Points; vtkm::cont::ArrayHandle Result; vtkm::Sphere Sphere1, Sphere2; }; diff --git a/benchmarking/BenchmarkFilters.cxx b/benchmarking/BenchmarkFilters.cxx index 6b8684c35..58b429d8d 100644 --- a/benchmarking/BenchmarkFilters.cxx +++ b/benchmarking/BenchmarkFilters.cxx @@ -133,10 +133,7 @@ static bool ReducedOptions; // Limit the filter executions to only consider the following types, otherwise // compile times and binary sizes are nuts. -using FieldTypes = vtkm::ListTagBase, - vtkm::Vec>; +using FieldTypes = vtkm::ListTagBase; using StructuredCellList = vtkm::ListTagBase>; @@ -145,7 +142,7 @@ using UnstructuredCellList = using AllCellList = vtkm::ListTagJoin; -using CoordinateList = vtkm::ListTagBase, vtkm::Vec>; +using CoordinateList = vtkm::ListTagBase; class BenchmarkFilterPolicy : public vtkm::filter::PolicyBase { @@ -816,8 +813,8 @@ public: using ExecutionSignature = _2(_1); vtkm::Bounds Bounds; - vtkm::Vec Center; - vtkm::Vec Scale; + vtkm::Vec3f_64 Center; + vtkm::Vec3f_64 Scale; VTKM_CONT PointVectorGenerator(const vtkm::Bounds& bounds) @@ -833,7 +830,7 @@ public: VTKM_EXEC vtkm::Vec operator()(vtkm::Vec val) const { using Vec3T = vtkm::Vec; - using Vec3F64 = vtkm::Vec; + using Vec3F64 = vtkm::Vec3f_64; Vec3F64 valF64{ val }; Vec3F64 periodic = (valF64 - this->Center) * this->Scale; @@ -933,7 +930,7 @@ void CreateFields(bool needPointScalars, bool needCellScalars, bool needPointVec auto coords = InputDataSet.GetCoordinateSystem(); auto bounds = coords.GetBounds(); auto points = coords.GetData(); - vtkm::cont::ArrayHandle> pvecs; + vtkm::cont::ArrayHandle pvecs; PointVectorGenerator worklet(bounds); vtkm::worklet::DispatcherMapField dispatch(worklet); diff --git a/benchmarking/BenchmarkRayTracing.cxx b/benchmarking/BenchmarkRayTracing.cxx index 993abf59a..96cf60baf 100644 --- a/benchmarking/BenchmarkRayTracing.cxx +++ b/benchmarking/BenchmarkRayTracing.cxx @@ -42,7 +42,7 @@ struct BenchRayTracing { vtkm::rendering::raytracing::RayTracer Tracer; vtkm::rendering::raytracing::Camera RayCamera; - vtkm::cont::ArrayHandle> Indices; + vtkm::cont::ArrayHandle Indices; vtkm::rendering::raytracing::Ray Rays; vtkm::cont::CoordinateSystem Coords; vtkm::cont::DataSet Data; @@ -82,11 +82,11 @@ struct BenchRayTracing Tracer.SetField(field, range); - vtkm::cont::ArrayHandle> temp; + vtkm::cont::ArrayHandle temp; vtkm::cont::ColorTable table("cool to warm"); table.Sample(100, temp); - vtkm::cont::ArrayHandle> colors; + vtkm::cont::ArrayHandle colors; colors.Allocate(100); auto portal = colors.GetPortalControl(); auto colorPortal = temp.GetPortalConstControl(); @@ -94,10 +94,10 @@ struct BenchRayTracing for (vtkm::Id i = 0; i < 100; ++i) { auto color = colorPortal.Get(i); - vtkm::Vec t(color[0] * conversionToFloatSpace, - color[1] * conversionToFloatSpace, - color[2] * conversionToFloatSpace, - color[3] * conversionToFloatSpace); + vtkm::Vec4f_32 t(color[0] * conversionToFloatSpace, + color[1] * conversionToFloatSpace, + color[2] * conversionToFloatSpace, + color[3] * conversionToFloatSpace); portal.Set(i, t); } diff --git a/examples/clipping/Clipping.cxx b/examples/clipping/Clipping.cxx index 951ccebb6..898888673 100644 --- a/examples/clipping/Clipping.cxx +++ b/examples/clipping/Clipping.cxx @@ -23,7 +23,7 @@ #include #include -using FloatVec3 = vtkm::Vec; +using FloatVec3 = vtkm::Vec3f_32; namespace { diff --git a/examples/demo/Demo.cxx b/examples/demo/Demo.cxx index 3934fe519..a90254f0a 100644 --- a/examples/demo/Demo.cxx +++ b/examples/demo/Demo.cxx @@ -84,7 +84,7 @@ int main(int argc, char* argv[]) camera.ResetToBounds(coordsBounds); - vtkm::Vec totalExtent; + vtkm::Vec3f_32 totalExtent; totalExtent[0] = vtkm::Float32(coordsBounds.X.Max - coordsBounds.X.Min); totalExtent[1] = vtkm::Float32(coordsBounds.Y.Max - coordsBounds.Y.Min); totalExtent[2] = vtkm::Float32(coordsBounds.Z.Max - coordsBounds.Z.Min); diff --git a/examples/game_of_life/GameOfLife.cxx b/examples/game_of_life/GameOfLife.cxx index 0540a6036..985c6deb6 100644 --- a/examples/game_of_life/GameOfLife.cxx +++ b/examples/game_of_life/GameOfLife.cxx @@ -54,7 +54,7 @@ struct GameOfLifePolicy : public vtkm::filter::PolicyBase { - using FieldTypeList = vtkm::ListTagBase>; + using FieldTypeList = vtkm::ListTagBase; }; struct UpdateLifeState : public vtkm::worklet::WorkletPointNeighborhood @@ -71,7 +71,7 @@ struct UpdateLifeState : public vtkm::worklet::WorkletPointNeighborhood template VTKM_EXEC void operator()(const NeighIn& prevstate, vtkm::UInt8& state, - vtkm::Vec& color) const + vtkm::Vec4ui_8& color) const { // Any live cell with fewer than two live neighbors dies, as if caused by under-population. // Any live cell with two or three live neighbors lives on to the next generation. @@ -116,7 +116,7 @@ public: vtkm::cont::ArrayHandle state; vtkm::cont::ArrayHandle prevstate; - vtkm::cont::ArrayHandle> colors; + vtkm::cont::ArrayHandle colors; //get the coordinate system we are using for the 2D area const vtkm::cont::DynamicCellSet& cells = input.GetCellSet(this->GetActiveCellSetIndex()); @@ -165,7 +165,7 @@ struct UploadData template bool operator()(DeviceAdapterTag device) { - vtkm::cont::ArrayHandle> colors; + vtkm::cont::ArrayHandle colors; this->Colors.GetData().CopyTo(colors); vtkm::interop::TransferToOpenGL(colors, *this->ColorState, device); return true; diff --git a/examples/hello_world/HelloWorld.cxx b/examples/hello_world/HelloWorld.cxx index bbff38c60..c95054b48 100644 --- a/examples/hello_world/HelloWorld.cxx +++ b/examples/hello_world/HelloWorld.cxx @@ -41,7 +41,7 @@ template struct HelloVTKMInterop { - vtkm::Vec Dims; + vtkm::Vec2i_32 Dims; GLuint ProgramId; GLuint VAOId; @@ -54,7 +54,7 @@ struct HelloVTKMInterop std::vector> InputData; vtkm::cont::ArrayHandle> InHandle; vtkm::cont::ArrayHandle> OutCoords; - vtkm::cont::ArrayHandle> OutColors; + vtkm::cont::ArrayHandle OutColors; HelloVTKMInterop(vtkm::Int32 width, vtkm::Int32 height) : Dims(256, 256) @@ -82,7 +82,7 @@ struct HelloVTKMInterop } } - this->Dims = vtkm::Vec(dim, dim); + this->Dims = vtkm::Vec2i_32(dim, dim); this->InHandle = vtkm::cont::make_ArrayHandle(this->InputData); glGenVertexArrays(1, &this->VAOId); @@ -136,7 +136,7 @@ struct HelloVTKMInterop VTKM_EXEC void operator()(const vtkm::Vec& input, vtkm::Vec& output, - vtkm::Vec& color) const + vtkm::Vec4ui_8& color) const { output[0] = input[0]; output[1] = 0.25f * vtkm::Sin(input[0] * 10.f + t) * vtkm::Cos(input[2] * 10.f + t); diff --git a/examples/isosurface/IsosurfaceUniformGrid.cxx b/examples/isosurface/IsosurfaceUniformGrid.cxx index df83c1548..4bbba02b9 100644 --- a/examples/isosurface/IsosurfaceUniformGrid.cxx +++ b/examples/isosurface/IsosurfaceUniformGrid.cxx @@ -34,7 +34,7 @@ #include static vtkm::Id3 dims(256, 256, 256); -static vtkm::cont::ArrayHandle> verticesArray, normalsArray; +static vtkm::cont::ArrayHandle verticesArray, normalsArray; static vtkm::cont::ArrayHandle scalarsArray; static Quaternion qrot; static int lastx, lasty; @@ -107,10 +107,10 @@ vtkm::cont::DataSet MakeIsosurfaceTestDataSet(vtkm::Id3 dims) TangleField(vdims, mins, maxs)); tangleFieldDispatcher.Invoke(vertexCountImplicitArray, fieldArray); - vtkm::Vec origin(0.0f, 0.0f, 0.0f); - vtkm::Vec spacing(1.0f / static_cast(dims[0]), - 1.0f / static_cast(dims[2]), - 1.0f / static_cast(dims[1])); + vtkm::Vec3f origin(0.0f, 0.0f, 0.0f); + vtkm::Vec3f spacing(1.0f / static_cast(dims[0]), + 1.0f / static_cast(dims[2]), + 1.0f / static_cast(dims[1])); vtkm::cont::ArrayHandleUniformPointCoordinates coordinates(vdims, origin, spacing); dataSet.AddCoordinateSystem(vtkm::cont::CoordinateSystem("coordinates", coordinates)); @@ -177,8 +177,8 @@ void displayCall() glBegin(GL_TRIANGLES); for (vtkm::IdComponent i = 0; i < verticesArray.GetNumberOfValues(); i++) { - vtkm::Vec curNormal = normalsArray.GetPortalConstControl().Get(i); - vtkm::Vec curVertex = verticesArray.GetPortalConstControl().Get(i); + vtkm::Vec3f_32 curNormal = normalsArray.GetPortalConstControl().Get(i); + vtkm::Vec3f_32 curVertex = verticesArray.GetPortalConstControl().Get(i); glNormal3f(curNormal[0], curNormal[1], curNormal[2]); glVertex3f(curVertex[0], curVertex[1], curVertex[2]); } @@ -242,7 +242,7 @@ int main(int argc, char* argv[]) vtkm::cont::DataSet outputData = filter.Execute(dataSet); //need to extract vertices, normals, and scalars - using VertType = vtkm::cont::ArrayHandle>; + using VertType = vtkm::cont::ArrayHandle; vtkm::cont::CoordinateSystem coords = outputData.GetCoordinateSystem(); verticesArray = coords.GetData().Cast(); diff --git a/examples/lagrangian/lagrangian.cxx b/examples/lagrangian/lagrangian.cxx index 2a4de8349..cd670bcf1 100644 --- a/examples/lagrangian/lagrangian.cxx +++ b/examples/lagrangian/lagrangian.cxx @@ -44,15 +44,15 @@ vtkm::cont::DataSet make3DRectilinearDataSet(double time) double zdiff = (zmax - zmin) / (dims[2] - 1); vtkm::Id3 DIMS(dims[0], dims[1], dims[2]); - vtkm::Vec ORIGIN(0, 0, 0); - vtkm::Vec SPACING(xdiff, ydiff, zdiff); + vtkm::Vec3f_64 ORIGIN(0, 0, 0); + vtkm::Vec3f_64 SPACING(xdiff, ydiff, zdiff); vtkm::cont::DataSet dataset = dsb.Create(DIMS, ORIGIN, SPACING); vtkm::cont::DataSetFieldAdd dsf; int numPoints = dims[0] * dims[1] * dims[2]; - vtkm::cont::ArrayHandle> velocityField; + vtkm::cont::ArrayHandle velocityField; velocityField.Allocate(numPoints); int count = 0; @@ -65,8 +65,7 @@ vtkm::cont::DataSet make3DRectilinearDataSet(double time) double vec[3]; double loc[3] = { i * xdiff + xmin, j * ydiff + ymax, k * zdiff + zmin }; field.calculateVelocity(loc, time, vec); - velocityField.GetPortalControl().Set(count, - vtkm::Vec(vec[0], vec[1], vec[2])); + velocityField.GetPortalControl().Set(count, vtkm::Vec3f_64(vec[0], vec[1], vec[2])); count++; } } diff --git a/examples/mesh_quality/MeshQuality.cxx b/examples/mesh_quality/MeshQuality.cxx index f67178a76..e3b0223ca 100644 --- a/examples/mesh_quality/MeshQuality.cxx +++ b/examples/mesh_quality/MeshQuality.cxx @@ -48,7 +48,7 @@ inline vtkm::cont::DataSet Make3DExplicitDataSet() vtkm::cont::DataSet dataSet; vtkm::cont::DataSetBuilderExplicit dsb; - using CoordType = vtkm::Vec; + using CoordType = vtkm::Vec3f_64; std::vector coords = { { 0.00, 0.00, 0.00 }, { 1.00, 0.00, 0.00 }, { 2.00, 0.00, 0.00 }, { 0.00, 0.00, 1.00 }, diff --git a/examples/multi_backend/IOGenerator.cxx b/examples/multi_backend/IOGenerator.cxx index 0c00421e7..5b751a56f 100644 --- a/examples/multi_backend/IOGenerator.cxx +++ b/examples/multi_backend/IOGenerator.cxx @@ -42,7 +42,7 @@ vtkm::cont::DataSet make_test3DImageData(vtkm::Id3 dims) using FieldAdd = vtkm::cont::DataSetFieldAdd; vtkm::cont::DataSet ds = Builder::Create(dims); - vtkm::cont::ArrayHandle> field; + vtkm::cont::ArrayHandle field; vtkm::worklet::DispatcherMapField dispatcher; dispatcher.Invoke(ds.GetCoordinateSystem(), field); diff --git a/examples/multi_backend/MultiDeviceGradient.h b/examples/multi_backend/MultiDeviceGradient.h index 86bf24eef..6b7581cf5 100644 --- a/examples/multi_backend/MultiDeviceGradient.h +++ b/examples/multi_backend/MultiDeviceGradient.h @@ -62,10 +62,8 @@ template <> class FilterTraits { public: - struct TypeListTagGradientInputs : vtkm::ListTagBase, - vtkm::Vec> + struct TypeListTagGradientInputs + : vtkm::ListTagBase { }; diff --git a/examples/polyline_archimedean_helix/PolyLineArchimedeanHelix.cxx b/examples/polyline_archimedean_helix/PolyLineArchimedeanHelix.cxx index ee31039bf..b9c9eb569 100644 --- a/examples/polyline_archimedean_helix/PolyLineArchimedeanHelix.cxx +++ b/examples/polyline_archimedean_helix/PolyLineArchimedeanHelix.cxx @@ -24,11 +24,10 @@ #include #include -vtkm::Vec ArchimedeanSpiralToCartesian( - vtkm::Vec const& p) +vtkm::Vec3f ArchimedeanSpiralToCartesian(vtkm::Vec3f const& p) { // p[0] = r, p[1] = theta, p[2] = z: - vtkm::Vec xyz; + vtkm::Vec3f xyz; auto c = std::polar(p[0], p[1]); xyz[0] = c.real(); xyz[1] = c.imag(); @@ -51,9 +50,8 @@ void TubeThatSpiral(vtkm::FloatDefault radius, vtkm::Id numLineSegments, vtkm::I numLineSegments; // roughly two spins around. Doesn't need to be perfect. vtkm::FloatDefault r = a + b * t; vtkm::FloatDefault theta = t; - vtkm::Vec cylindricalCoordinate{ r, theta, t }; - vtkm::Vec spiralSample = - ArchimedeanSpiralToCartesian(cylindricalCoordinate); + vtkm::Vec3f cylindricalCoordinate{ r, theta, t }; + vtkm::Vec3f spiralSample = ArchimedeanSpiralToCartesian(cylindricalCoordinate); vtkm::Id pid = dsb.AddPoint(spiralSample); ids.push_back(pid); } @@ -68,7 +66,7 @@ void TubeThatSpiral(vtkm::FloatDefault radius, vtkm::Id numLineSegments, vtkm::I // You added lines, but you need to extend it to a tube. // This generates a new pointset, and new cell set. - vtkm::cont::ArrayHandle> tubePoints; + vtkm::cont::ArrayHandle tubePoints; vtkm::cont::CellSetSingleType<> tubeCells; tubeWorklet.Run(ds.GetCoordinateSystem(0), ds.GetCellSet(0), tubePoints, tubeCells); @@ -78,7 +76,7 @@ void TubeThatSpiral(vtkm::FloatDefault radius, vtkm::Id numLineSegments, vtkm::I vtkm::Bounds coordsBounds = tubeDataset.GetCoordinateSystem().GetBounds(); - vtkm::Vec totalExtent( + vtkm::Vec3f_64 totalExtent( coordsBounds.X.Length(), coordsBounds.Y.Length(), coordsBounds.Z.Length()); vtkm::Float64 mag = vtkm::Magnitude(totalExtent); vtkm::Normalize(totalExtent); diff --git a/examples/streamline/StreamLineUniformGrid.cxx b/examples/streamline/StreamLineUniformGrid.cxx index 5c5bd2cfb..0ccfc3533 100644 --- a/examples/streamline/StreamLineUniformGrid.cxx +++ b/examples/streamline/StreamLineUniformGrid.cxx @@ -48,7 +48,7 @@ const vtkm::Float32 tStep = 0.5f; const vtkm::Id direction = vtkm::worklet::streamline::BOTH; // Point location of vertices from a CastAndCall but needs a static cast eventually -static vtkm::cont::ArrayHandle> vertexArray; +static vtkm::cont::ArrayHandle vertexArray; // OpenGL display variables Quaternion qrot; @@ -124,7 +124,7 @@ void displayCall() glBegin(GL_LINE_STRIP); for (vtkm::IdComponent i = 0; i < numIndices; i++) { - vtkm::Vec pt = vertexArray.GetPortalConstControl().Get(polylineIndices[i]); + vtkm::Vec3f_32 pt = vertexArray.GetPortalConstControl().Get(polylineIndices[i]); glVertex3f(pt[0], pt[1], pt[2]); } glEnd(); @@ -229,16 +229,16 @@ int main(int argc, char* argv[]) //We are done with the file now, so release the file descriptor fclose(pFile); - std::vector> field; + std::vector field; for (vtkm::Id i = 0; i < nElements; i++) { vtkm::Float32 x = data[i]; vtkm::Float32 y = data[++i]; vtkm::Float32 z = data[++i]; - vtkm::Vec vecData(x, y, z); + vtkm::Vec3f_32 vecData(x, y, z); field.push_back(Normalize(vecData)); } - vtkm::cont::ArrayHandle> fieldArray; + vtkm::cont::ArrayHandle fieldArray; fieldArray = vtkm::cont::make_ArrayHandle(field); // Construct the input dataset (uniform) to hold the input and set vector data diff --git a/examples/tau_timing/TauTiming.cxx b/examples/tau_timing/TauTiming.cxx index 2b88c190d..d4394b8fd 100644 --- a/examples/tau_timing/TauTiming.cxx +++ b/examples/tau_timing/TauTiming.cxx @@ -116,10 +116,10 @@ vtkm::cont::DataSet CreateTestDataSet(vtkm::Id3 dims) cellSet.SetPointDimensions(vdims); dataSet.AddCellSet(cellSet); - vtkm::Vec origin(0.0f, 0.0f, 0.0f); - vtkm::Vec spacing(1.0f / static_cast(dims[0]), - 1.0f / static_cast(dims[2]), - 1.0f / static_cast(dims[1])); + vtkm::Vec3f origin(0.0f, 0.0f, 0.0f); + vtkm::Vec3f spacing(1.0f / static_cast(dims[0]), + 1.0f / static_cast(dims[2]), + 1.0f / static_cast(dims[1])); vtkm::cont::ArrayHandleUniformPointCoordinates coordinates(vdims, origin, spacing); dataSet.AddCoordinateSystem(vtkm::cont::CoordinateSystem("coordinates", coordinates)); @@ -175,7 +175,7 @@ void TestStreamlineUniformGrid(int d) std::cout<<"Streamline with gridsize = "< > result; + vtkm::cont::ArrayHandle result; PointGrad func(dataSet, "nodevar", result); vtkm::cont::CastAndCall(dataSet.GetCellSet(), func); @@ -417,17 +417,17 @@ int main(int argc, char** argv) ret_code = fread(data, sizeof(float), static_cast(nElements), pFile); fclose(pFile); - std::vector> field; + std::vector field; for (vtkm::Id i = 0; i < nElements; i++) { vtkm::Float32 x = data[i]; vtkm::Float32 y = data[++i]; vtkm::Float32 z = data[++i]; - vtkm::Vec vecData(x, y, z); + vtkm::Vec3f_32 vecData(x, y, z); field.push_back(Normalize(vecData)); } - vtkm::cont::ArrayHandle> fieldArray; + vtkm::cont::ArrayHandle fieldArray; fieldArray = vtkm::cont::make_ArrayHandle(field); // Construct the input dataset (uniform) to hold the input and set vector data diff --git a/examples/tetrahedra/TetrahedralizeExplicitGrid.cxx b/examples/tetrahedra/TetrahedralizeExplicitGrid.cxx index 8b02ef718..b5fdf5d1b 100644 --- a/examples/tetrahedra/TetrahedralizeExplicitGrid.cxx +++ b/examples/tetrahedra/TetrahedralizeExplicitGrid.cxx @@ -172,7 +172,7 @@ void displayCall() glColor3f(color[indx][0], color[indx][1], color[indx][2]); // Get the indices of the vertices that make up this tetrahedron - vtkm::Vec tetIndices; + vtkm::Id4 tetIndices; cellSet.GetIndices(tetra, tetIndices); // Get the vertex points for this tetrahedron diff --git a/examples/tetrahedra/TetrahedralizeUniformGrid.cxx b/examples/tetrahedra/TetrahedralizeUniformGrid.cxx index edd942f86..d922e2778 100644 --- a/examples/tetrahedra/TetrahedralizeUniformGrid.cxx +++ b/examples/tetrahedra/TetrahedralizeUniformGrid.cxx @@ -49,11 +49,10 @@ vtkm::cont::DataSet MakeTetrahedralizeTestDataSet(vtkm::Id3 dim) // Place uniform grid on a set physical space so OpenGL drawing is easier const vtkm::Id3 vdims(dim[0] + 1, dim[1] + 1, dim[2] + 1); - const vtkm::Vec origin = vtkm::make_Vec(0.0f, 0.0f, 0.0f); - const vtkm::Vec spacing = - vtkm::make_Vec(1.0f / static_cast(dim[0]), - 1.0f / static_cast(dim[1]), - 1.0f / static_cast(dim[2])); + const vtkm::Vec3f_32 origin = vtkm::make_Vec(0.0f, 0.0f, 0.0f); + const vtkm::Vec3f_32 spacing = vtkm::make_Vec(1.0f / static_cast(dim[0]), + 1.0f / static_cast(dim[1]), + 1.0f / static_cast(dim[2])); // Generate coordinate system vtkm::cont::ArrayHandleUniformPointCoordinates coordinates(vdims, origin, spacing); @@ -139,7 +138,7 @@ void displayCall() glColor3f(color[indx][0], color[indx][1], color[indx][2]); // Get the indices of the vertices that make up this tetrahedron - vtkm::Vec tetIndices; + vtkm::Id4 tetIndices; cellSet.GetIndices(tetra, tetIndices); // Get the vertex points for this tetrahedron diff --git a/examples/tetrahedra/TriangulateExplicitGrid.cxx b/examples/tetrahedra/TriangulateExplicitGrid.cxx index b5ad8bdf4..198a39768 100644 --- a/examples/tetrahedra/TriangulateExplicitGrid.cxx +++ b/examples/tetrahedra/TriangulateExplicitGrid.cxx @@ -143,13 +143,13 @@ void displayCall() glColor3f(color[indx][0], color[indx][1], color[indx][2]); // Get the indices of the vertices that make up this triangle - vtkm::Vec triIndices; + vtkm::Id3 triIndices; cellSet.GetIndices(triangle, triIndices); // Get the vertex points for this triangle - vtkm::Vec pt0 = vertexArray.GetPortalConstControl().Get(triIndices[0]); - vtkm::Vec pt1 = vertexArray.GetPortalConstControl().Get(triIndices[1]); - vtkm::Vec pt2 = vertexArray.GetPortalConstControl().Get(triIndices[2]); + vtkm::Vec3f_64 pt0 = vertexArray.GetPortalConstControl().Get(triIndices[0]); + vtkm::Vec3f_64 pt1 = vertexArray.GetPortalConstControl().Get(triIndices[1]); + vtkm::Vec3f_64 pt2 = vertexArray.GetPortalConstControl().Get(triIndices[2]); // Draw the triangle filled with alternating colors glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); diff --git a/examples/tetrahedra/TriangulateUniformGrid.cxx b/examples/tetrahedra/TriangulateUniformGrid.cxx index 55dda8f07..ee7971bc6 100644 --- a/examples/tetrahedra/TriangulateUniformGrid.cxx +++ b/examples/tetrahedra/TriangulateUniformGrid.cxx @@ -43,8 +43,8 @@ vtkm::cont::DataSet MakeTriangulateTestDataSet(vtkm::Id2 dim) // Place uniform grid on a set physical space so OpenGL drawing is easier const vtkm::Id3 vdims(dim[0] + 1, dim[1] + 1, 1); - const vtkm::Vec origin = vtkm::make_Vec(0.0f, 0.0f, 0.0f); - const vtkm::Vec spacing = vtkm::make_Vec( + const vtkm::Vec3f_32 origin = vtkm::make_Vec(0.0f, 0.0f, 0.0f); + const vtkm::Vec3f_32 spacing = vtkm::make_Vec( 1.0f / static_cast(dim[0]), 1.0f / static_cast(dim[1]), 0.0f); // Generate coordinate system @@ -98,13 +98,13 @@ void displayCall() glColor3f(color[indx][0], color[indx][1], color[indx][2]); // Get the indices of the vertices that make up this triangle - vtkm::Vec triIndices; + vtkm::Id3 triIndices; cellSet.GetIndices(triangle, triIndices); // Get the vertex points for this triangle - vtkm::Vec pt0 = vertexArray.GetPortalConstControl().Get(triIndices[0]); - vtkm::Vec pt1 = vertexArray.GetPortalConstControl().Get(triIndices[1]); - vtkm::Vec pt2 = vertexArray.GetPortalConstControl().Get(triIndices[2]); + vtkm::Vec3f_64 pt0 = vertexArray.GetPortalConstControl().Get(triIndices[0]); + vtkm::Vec3f_64 pt1 = vertexArray.GetPortalConstControl().Get(triIndices[1]); + vtkm::Vec3f_64 pt2 = vertexArray.GetPortalConstControl().Get(triIndices[2]); // Draw the triangle filled with alternating colors glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); diff --git a/vtkm/Bounds.h b/vtkm/Bounds.h index 9ef8de7c6..b72547e8d 100644 --- a/vtkm/Bounds.h +++ b/vtkm/Bounds.h @@ -108,9 +108,9 @@ struct Bounds /// are empty, the results are undefined. /// VTKM_EXEC_CONT - vtkm::Vec Center() const + vtkm::Vec3f_64 Center() const { - return vtkm::Vec(this->X.Center(), this->Y.Center(), this->Z.Center()); + return vtkm::Vec3f_64(this->X.Center(), this->Y.Center(), this->Z.Center()); } /// \b Expand bounds to include a point. diff --git a/vtkm/ImplicitFunction.h b/vtkm/ImplicitFunction.h index c76fd0b12..0fe048dc3 100644 --- a/vtkm/ImplicitFunction.h +++ b/vtkm/ImplicitFunction.h @@ -209,7 +209,7 @@ public: vtkm::IdComponent minAxis = 0; Scalar dist = 0.0; Scalar minDist = vtkm::Infinity32(); - vtkm::Vec location; + vtkm::IdComponent3 location; Vector normal(Scalar(0)); Vector inside(Scalar(0)); Vector outside(Scalar(0)); diff --git a/vtkm/TypeListTag.h b/vtkm/TypeListTag.h index 1c4c47e35..40d5293db 100644 --- a/vtkm/TypeListTag.h +++ b/vtkm/TypeListTag.h @@ -62,7 +62,7 @@ struct VTKM_ALWAYS_EXPORT TypeListTagFieldScalar : vtkm::ListTagBase, vtkm::Vec> + : vtkm::ListTagBase { }; @@ -70,7 +70,7 @@ struct VTKM_ALWAYS_EXPORT TypeListTagFieldVec2 /// vectors. /// struct VTKM_ALWAYS_EXPORT TypeListTagFieldVec3 - : vtkm::ListTagBase, vtkm::Vec> + : vtkm::ListTagBase { }; @@ -78,7 +78,7 @@ struct VTKM_ALWAYS_EXPORT TypeListTagFieldVec3 /// vectors. /// struct VTKM_ALWAYS_EXPORT TypeListTagFieldVec4 - : vtkm::ListTagBase, vtkm::Vec> + : vtkm::ListTagBase { }; @@ -87,12 +87,12 @@ struct VTKM_ALWAYS_EXPORT TypeListTagFieldVec4 /// Scalars are not included. /// struct VTKM_ALWAYS_EXPORT TypeListTagFloatVec - : vtkm::ListTagBase, - vtkm::Vec, - vtkm::Vec, - vtkm::Vec, - vtkm::Vec, - vtkm::Vec> + : vtkm::ListTagBase { }; @@ -103,12 +103,12 @@ struct VTKM_ALWAYS_EXPORT TypeListTagFloatVec struct VTKM_ALWAYS_EXPORT TypeListTagField : vtkm::ListTagBase, - vtkm::Vec, - vtkm::Vec, - vtkm::Vec, - vtkm::Vec, - vtkm::Vec> + vtkm::Vec2f_32, + vtkm::Vec2f_64, + vtkm::Vec3f_32, + vtkm::Vec3f_64, + vtkm::Vec4f_32, + vtkm::Vec4f_64> { }; @@ -134,21 +134,21 @@ struct VTKM_ALWAYS_EXPORT TypeListTagScalarAll /// integers of 32 or 64 bits, or floating point values of 32 or 64 bits. /// struct VTKM_ALWAYS_EXPORT TypeListTagVecCommon - : vtkm::ListTagBase, - vtkm::Vec, - vtkm::Vec, - vtkm::Vec, - vtkm::Vec, - vtkm::Vec, - vtkm::Vec, - vtkm::Vec, - vtkm::Vec, - vtkm::Vec, - vtkm::Vec, - vtkm::Vec, - vtkm::Vec, - vtkm::Vec, - vtkm::Vec> + : vtkm::ListTagBase { }; @@ -160,21 +160,21 @@ namespace internal /// to get a list of all vectors up to size 4. /// struct VTKM_ALWAYS_EXPORT TypeListTagVecUncommon - : vtkm::ListTagBase, - vtkm::Vec, - vtkm::Vec, - vtkm::Vec, - vtkm::Vec, - vtkm::Vec, - vtkm::Vec, - vtkm::Vec, - vtkm::Vec, - vtkm::Vec, - vtkm::Vec, - vtkm::Vec, - vtkm::Vec, - vtkm::Vec, - vtkm::Vec> + : vtkm::ListTagBase { }; @@ -206,8 +206,8 @@ struct VTKM_ALWAYS_EXPORT TypeListTagCommon vtkm::Int64, vtkm::Float32, vtkm::Float64, - vtkm::Vec, - vtkm::Vec> + vtkm::Vec3f_32, + vtkm::Vec3f_64> { }; diff --git a/vtkm/VecAxisAlignedPointCoordinates.h b/vtkm/VecAxisAlignedPointCoordinates.h index 867758187..7b980ef4a 100644 --- a/vtkm/VecAxisAlignedPointCoordinates.h +++ b/vtkm/VecAxisAlignedPointCoordinates.h @@ -78,7 +78,7 @@ template class VecAxisAlignedPointCoordinates { public: - using ComponentType = vtkm::Vec; + using ComponentType = vtkm::Vec3f; static constexpr vtkm::IdComponent NUM_COMPONENTS = detail::VecAxisAlignedPointCoordinatesNumComponents::NUM_COMPONENTS; @@ -136,8 +136,8 @@ struct TypeTraits> VTKM_EXEC_CONT static vtkm::VecAxisAlignedPointCoordinates ZeroInitialization() { - return vtkm::VecAxisAlignedPointCoordinates( - vtkm::Vec(0, 0, 0), vtkm::Vec(0, 0, 0)); + return vtkm::VecAxisAlignedPointCoordinates(vtkm::Vec3f(0, 0, 0), + vtkm::Vec3f(0, 0, 0)); } }; @@ -146,7 +146,7 @@ struct VecTraits> { using VecType = vtkm::VecAxisAlignedPointCoordinates; - using ComponentType = vtkm::Vec; + using ComponentType = vtkm::Vec3f; using HasMultipleComponents = vtkm::VecTraitsTagMultipleComponents; using IsSizeStatic = vtkm::VecTraitsTagSizeStatic; diff --git a/vtkm/cont/ArrayHandleUniformPointCoordinates.h b/vtkm/cont/ArrayHandleUniformPointCoordinates.h index f0b1deaeb..946a7e033 100644 --- a/vtkm/cont/ArrayHandleUniformPointCoordinates.h +++ b/vtkm/cont/ArrayHandleUniformPointCoordinates.h @@ -26,14 +26,14 @@ namespace cont /// class VTKM_ALWAYS_EXPORT ArrayHandleUniformPointCoordinates : public vtkm::cont::ArrayHandle< - vtkm::Vec, + vtkm::Vec3f, vtkm::cont::StorageTagImplicit> { public: VTKM_ARRAY_HANDLE_SUBCLASS_NT( ArrayHandleUniformPointCoordinates, (vtkm::cont::ArrayHandle< - vtkm::Vec, + vtkm::Vec3f, vtkm::cont::StorageTagImplicit>)); private: @@ -67,7 +67,7 @@ struct SerializableTypeString template <> struct SerializableTypeString, + vtkm::Vec3f, vtkm::cont::StorageTagImplicit>> : SerializableTypeString { @@ -109,7 +109,7 @@ public: template <> struct Serialization, + vtkm::Vec3f, vtkm::cont::StorageTagImplicit>> : Serialization { diff --git a/vtkm/cont/ArrayHandleVirtualCoordinates.h b/vtkm/cont/ArrayHandleVirtualCoordinates.h index f3a281a43..4270fd9d1 100644 --- a/vtkm/cont/ArrayHandleVirtualCoordinates.h +++ b/vtkm/cont/ArrayHandleVirtualCoordinates.h @@ -29,16 +29,15 @@ namespace cont /// ArrayHandleVirtualCoordinates is a specialization of ArrayHandle. class VTKM_ALWAYS_EXPORT ArrayHandleVirtualCoordinates final - : public vtkm::cont::ArrayHandleVirtual> + : public vtkm::cont::ArrayHandleVirtual { public: VTKM_ARRAY_HANDLE_SUBCLASS_NT(ArrayHandleVirtualCoordinates, - (vtkm::cont::ArrayHandleVirtual>)); + (vtkm::cont::ArrayHandleVirtual)); template explicit ArrayHandleVirtualCoordinates(const vtkm::cont::ArrayHandle& ah) - : vtkm::cont::ArrayHandleVirtual>( - vtkm::cont::make_ArrayHandleCast(ah)) + : vtkm::cont::ArrayHandleVirtual(vtkm::cont::make_ArrayHandleCast(ah)) { } }; @@ -82,7 +81,7 @@ private: using Type = vtkm::cont::ArrayHandleVirtualCoordinates; using BaseType = vtkm::cont::ArrayHandle; - using BasicCoordsType = vtkm::cont::ArrayHandle>; + using BasicCoordsType = vtkm::cont::ArrayHandle; using RectilinearCoordsArrayType = vtkm::cont::ArrayHandleCartesianProduct, vtkm::cont::ArrayHandle, diff --git a/vtkm/cont/ArrayRangeCompute.cxx b/vtkm/cont/ArrayRangeCompute.cxx index 5f15b5daa..b4d178c14 100644 --- a/vtkm/cont/ArrayRangeCompute.cxx +++ b/vtkm/cont/ArrayRangeCompute.cxx @@ -73,7 +73,7 @@ VTKM_ARRAY_RANGE_COMPUTE_IMPL_VEC(vtkm::Float64, 4, vtkm::cont::StorageTagBasic) // to determine. VTKM_CONT vtkm::cont::ArrayHandle ArrayRangeCompute( - const vtkm::cont::ArrayHandle, + const vtkm::cont::ArrayHandle& array, vtkm::cont::DeviceAdapterId) { @@ -81,8 +81,8 @@ vtkm::cont::ArrayHandle ArrayRangeCompute( // In this portal we know that the min value is the first entry and the // max value is the last entry. - vtkm::Vec minimum = portal.Get(0); - vtkm::Vec maximum = portal.Get(portal.GetNumberOfValues() - 1); + vtkm::Vec3f minimum = portal.Get(0); + vtkm::Vec3f maximum = portal.Get(portal.GetNumberOfValues() - 1); vtkm::cont::ArrayHandle rangeArray; rangeArray.Allocate(3); diff --git a/vtkm/cont/ArrayRangeCompute.h b/vtkm/cont/ArrayRangeCompute.h index c825eb1fa..5be7f48f9 100644 --- a/vtkm/cont/ArrayRangeCompute.h +++ b/vtkm/cont/ArrayRangeCompute.h @@ -89,11 +89,11 @@ VTKM_ARRAY_RANGE_COMPUTE_EXPORT_VEC(vtkm::Float64, 4, vtkm::cont::StorageTagBasi VTKM_CONT vtkm::cont::ArrayHandle ArrayRangeCompute( - const vtkm::cont::ArrayHandleVirtual>& input, + const vtkm::cont::ArrayHandleVirtual& input, vtkm::cont::DeviceAdapterId device = vtkm::cont::DeviceAdapterTagAny()); VTKM_CONT_EXPORT VTKM_CONT vtkm::cont::ArrayHandle ArrayRangeCompute( - const vtkm::cont::ArrayHandle, + const vtkm::cont::ArrayHandle& array, vtkm::cont::DeviceAdapterId device = vtkm::cont::DeviceAdapterTagAny()); @@ -101,7 +101,7 @@ VTKM_CONT_EXPORT VTKM_CONT vtkm::cont::ArrayHandle ArrayRangeComput VTKM_CONT_EXPORT VTKM_CONT vtkm::cont::ArrayHandle ArrayRangeCompute( - const vtkm::cont::ArrayHandle, + const vtkm::cont::ArrayHandle, vtkm::cont::ArrayHandle, @@ -109,7 +109,7 @@ vtkm::cont::ArrayHandle ArrayRangeCompute( vtkm::cont::DeviceAdapterId device = vtkm::cont::DeviceAdapterTagAny()); VTKM_CONT_EXPORT VTKM_CONT vtkm::cont::ArrayHandle ArrayRangeCompute( - const vtkm::cont::ArrayHandle, + const vtkm::cont::ArrayHandle, vtkm::cont::ArrayHandle, diff --git a/vtkm/cont/ArrayRangeCompute.hxx b/vtkm/cont/ArrayRangeCompute.hxx index d0b188dbc..7c653b172 100644 --- a/vtkm/cont/ArrayRangeCompute.hxx +++ b/vtkm/cont/ArrayRangeCompute.hxx @@ -96,7 +96,7 @@ inline vtkm::cont::ArrayHandle ArrayRangeComputeImpl( VTKM_CONT inline vtkm::cont::ArrayHandle ArrayRangeCompute( - const vtkm::cont::ArrayHandleVirtual>& input, + const vtkm::cont::ArrayHandleVirtual& input, vtkm::cont::DeviceAdapterId device) { using UniformHandleType = ArrayHandleUniformPointCoordinates; diff --git a/vtkm/cont/CellLocatorRectilinearGrid.cxx b/vtkm/cont/CellLocatorRectilinearGrid.cxx index 921c6bd6c..20aeaa103 100644 --- a/vtkm/cont/CellLocatorRectilinearGrid.cxx +++ b/vtkm/cont/CellLocatorRectilinearGrid.cxx @@ -38,7 +38,7 @@ void CellLocatorRectilinearGrid::Build() if (!cellSet.IsSameType(StructuredType())) throw vtkm::cont::ErrorInternal("Cells are not 3D structured."); - vtkm::Vec celldims = + vtkm::Id3 celldims = cellSet.Cast().GetSchedulingRange(vtkm::TopologyElementTagCell()); this->PlaneSize = celldims[0] * celldims[1]; diff --git a/vtkm/cont/CellLocatorUniformBins.h b/vtkm/cont/CellLocatorUniformBins.h index a1480c20b..04c7359cd 100644 --- a/vtkm/cont/CellLocatorUniformBins.h +++ b/vtkm/cont/CellLocatorUniformBins.h @@ -31,7 +31,7 @@ namespace cl_uniform_bins using DimensionType = vtkm::Int16; using DimVec3 = vtkm::Vec; -using FloatVec3 = vtkm::Vec; +using FloatVec3 = vtkm::Vec3f; struct Grid { diff --git a/vtkm/cont/CellLocatorUniformGrid.h b/vtkm/cont/CellLocatorUniformGrid.h index 1bc13e7d0..698f61f57 100644 --- a/vtkm/cont/CellLocatorUniformGrid.h +++ b/vtkm/cont/CellLocatorUniformGrid.h @@ -33,8 +33,8 @@ protected: private: vtkm::Bounds Bounds; - vtkm::Vec RangeTransform; - vtkm::Vec CellDims; + vtkm::Vec3f RangeTransform; + vtkm::Id3 CellDims; mutable vtkm::cont::VirtualObjectHandle ExecutionObjectHandle; }; diff --git a/vtkm/cont/ColorTable.h b/vtkm/cont/ColorTable.h index 1e499d3f2..ae3a980bf 100644 --- a/vtkm/cont/ColorTable.h +++ b/vtkm/cont/ColorTable.h @@ -513,14 +513,14 @@ public: /// vtkm::cont::ColorTableSamplesRGBA samples; /// vtkm::cont::ColorTable table("black-body radiation"); /// table.Sample(256, samples); - /// vtkm::cont::ArrayHandle> colors; + /// vtkm::cont::ArrayHandle colors; /// table.Map(input, samples, colors); /// /// \endcode template inline bool Map(const vtkm::cont::ArrayHandle& values, const vtkm::cont::ColorTableSamplesRGBA& samples, - vtkm::cont::ArrayHandle>& rgbaOut) const; + vtkm::cont::ArrayHandle& rgbaOut) const; /// \brief Sample each value through an intermediate lookup/sample table to generate RGB colors /// @@ -534,28 +534,28 @@ public: /// vtkm::cont::ColorTableSamplesRGB samples; /// vtkm::cont::ColorTable table("black-body radiation"); /// table.Sample(256, samples); - /// vtkm::cont::ArrayHandle> colors; + /// vtkm::cont::ArrayHandle colors; /// table.Map(input, samples, colors); /// /// \endcode template inline bool Map(const vtkm::cont::ArrayHandle& values, const vtkm::cont::ColorTableSamplesRGB& samples, - vtkm::cont::ArrayHandle>& rgbaOut) const; + vtkm::cont::ArrayHandle& rgbaOut) const; /// \brief Use magnitude of a vector with a sample table to generate RGBA colors /// template inline bool MapMagnitude(const vtkm::cont::ArrayHandle, S>& values, const vtkm::cont::ColorTableSamplesRGBA& samples, - vtkm::cont::ArrayHandle>& rgbaOut) const; + vtkm::cont::ArrayHandle& rgbaOut) const; /// \brief Use magnitude of a vector with a sample table to generate RGB colors /// template inline bool MapMagnitude(const vtkm::cont::ArrayHandle, S>& values, const vtkm::cont::ColorTableSamplesRGB& samples, - vtkm::cont::ArrayHandle>& rgbaOut) const; + vtkm::cont::ArrayHandle& rgbaOut) const; /// \brief Use a single component of a vector with a sample table to generate RGBA colors /// @@ -563,7 +563,7 @@ public: inline bool MapComponent(const vtkm::cont::ArrayHandle, S>& values, vtkm::IdComponent comp, const vtkm::cont::ColorTableSamplesRGBA& samples, - vtkm::cont::ArrayHandle>& rgbaOut) const; + vtkm::cont::ArrayHandle& rgbaOut) const; /// \brief Use a single component of a vector with a sample table to generate RGB colors /// @@ -571,7 +571,7 @@ public: inline bool MapComponent(const vtkm::cont::ArrayHandle, S>& values, vtkm::IdComponent comp, const vtkm::cont::ColorTableSamplesRGB& samples, - vtkm::cont::ArrayHandle>& rgbOut) const; + vtkm::cont::ArrayHandle& rgbOut) const; /// \brief Interpolate each value through the color table to generate RGBA colors @@ -582,7 +582,7 @@ public: /// Note: This is more costly than using Sample/Map with the generated intermediate lookup table template inline bool Map(const vtkm::cont::ArrayHandle& values, - vtkm::cont::ArrayHandle>& rgbaOut) const; + vtkm::cont::ArrayHandle& rgbaOut) const; /// \brief Interpolate each value through the color table to generate RGB colors /// @@ -592,33 +592,33 @@ public: /// Note: This is more costly than using Sample/Map with the generated intermediate lookup table template inline bool Map(const vtkm::cont::ArrayHandle& values, - vtkm::cont::ArrayHandle>& rgbOut) const; + vtkm::cont::ArrayHandle& rgbOut) const; /// \brief Use magnitude of a vector to generate RGBA colors /// template inline bool MapMagnitude(const vtkm::cont::ArrayHandle, S>& values, - vtkm::cont::ArrayHandle>& rgbaOut) const; + vtkm::cont::ArrayHandle& rgbaOut) const; /// \brief Use magnitude of a vector to generate RGB colors /// template inline bool MapMagnitude(const vtkm::cont::ArrayHandle, S>& values, - vtkm::cont::ArrayHandle>& rgbOut) const; + vtkm::cont::ArrayHandle& rgbOut) const; /// \brief Use a single component of a vector to generate RGBA colors /// template inline bool MapComponent(const vtkm::cont::ArrayHandle, S>& values, vtkm::IdComponent comp, - vtkm::cont::ArrayHandle>& rgbaOut) const; + vtkm::cont::ArrayHandle& rgbaOut) const; /// \brief Use a single component of a vector to generate RGB colors /// template inline bool MapComponent(const vtkm::cont::ArrayHandle, S>& values, vtkm::IdComponent comp, - vtkm::cont::ArrayHandle>& rgbOut) const; + vtkm::cont::ArrayHandle& rgbOut) const; /// \brief generate RGB colors using regular spaced samples along the range. @@ -663,7 +663,7 @@ public: /// /// Note: This will return false if the number of samples is less than 2 inline bool Sample(vtkm::Int32 numSamples, - vtkm::cont::ArrayHandle>& colors, + vtkm::cont::ArrayHandle& colors, double tolerance = 0.002) const; /// \brief generate RGB colors using regular spaced samples along the range. @@ -678,7 +678,7 @@ public: /// /// Note: This will return false if the number of samples is less than 2 inline bool Sample(vtkm::Int32 numSamples, - vtkm::cont::ArrayHandle>& colors, + vtkm::cont::ArrayHandle& colors, double tolerance = 0.002) const; diff --git a/vtkm/cont/ColorTable.hxx b/vtkm/cont/ColorTable.hxx index 61eff27e0..2de46aa5d 100644 --- a/vtkm/cont/ColorTable.hxx +++ b/vtkm/cont/ColorTable.hxx @@ -90,7 +90,7 @@ struct map_color_table template bool ColorTable::Map(const vtkm::cont::ArrayHandle& values, const vtkm::cont::ColorTableSamplesRGBA& samples, - vtkm::cont::ArrayHandle>& rgbaOut) const + vtkm::cont::ArrayHandle& rgbaOut) const { if (samples.NumberOfSamples <= 0) { @@ -105,7 +105,7 @@ bool ColorTable::Map(const vtkm::cont::ArrayHandle& values, template bool ColorTable::Map(const vtkm::cont::ArrayHandle& values, const vtkm::cont::ColorTableSamplesRGB& samples, - vtkm::cont::ArrayHandle>& rgbOut) const + vtkm::cont::ArrayHandle& rgbOut) const { if (samples.NumberOfSamples <= 0) { @@ -120,7 +120,7 @@ bool ColorTable::Map(const vtkm::cont::ArrayHandle& values, template bool ColorTable::MapMagnitude(const vtkm::cont::ArrayHandle, S>& values, const vtkm::cont::ColorTableSamplesRGBA& samples, - vtkm::cont::ArrayHandle>& rgbaOut) const + vtkm::cont::ArrayHandle& rgbaOut) const { using namespace vtkm::worklet::colorconversion; return this->Map( @@ -131,7 +131,7 @@ bool ColorTable::MapMagnitude(const vtkm::cont::ArrayHandle, S>& template bool ColorTable::MapMagnitude(const vtkm::cont::ArrayHandle, S>& values, const vtkm::cont::ColorTableSamplesRGB& samples, - vtkm::cont::ArrayHandle>& rgbOut) const + vtkm::cont::ArrayHandle& rgbOut) const { using namespace vtkm::worklet::colorconversion; return this->Map( @@ -142,7 +142,7 @@ template bool ColorTable::MapComponent(const vtkm::cont::ArrayHandle, S>& values, vtkm::IdComponent comp, const vtkm::cont::ColorTableSamplesRGBA& samples, - vtkm::cont::ArrayHandle>& rgbaOut) const + vtkm::cont::ArrayHandle& rgbaOut) const { using namespace vtkm::worklet::colorconversion; return this->Map( @@ -153,7 +153,7 @@ template bool ColorTable::MapComponent(const vtkm::cont::ArrayHandle, S>& values, vtkm::IdComponent comp, const vtkm::cont::ColorTableSamplesRGB& samples, - vtkm::cont::ArrayHandle>& rgbOut) const + vtkm::cont::ArrayHandle& rgbOut) const { using namespace vtkm::worklet::colorconversion; return this->Map( @@ -163,21 +163,21 @@ bool ColorTable::MapComponent(const vtkm::cont::ArrayHandle, S>& //--------------------------------------------------------------------------- template bool ColorTable::Map(const vtkm::cont::ArrayHandle& values, - vtkm::cont::ArrayHandle>& rgbaOut) const + vtkm::cont::ArrayHandle& rgbaOut) const { return vtkm::cont::TryExecute(detail::map_color_table{}, this, values, rgbaOut); } //--------------------------------------------------------------------------- template bool ColorTable::Map(const vtkm::cont::ArrayHandle& values, - vtkm::cont::ArrayHandle>& rgbOut) const + vtkm::cont::ArrayHandle& rgbOut) const { return vtkm::cont::TryExecute(detail::map_color_table{}, this, values, rgbOut); } //--------------------------------------------------------------------------- template bool ColorTable::MapMagnitude(const vtkm::cont::ArrayHandle, S>& values, - vtkm::cont::ArrayHandle>& rgbaOut) const + vtkm::cont::ArrayHandle& rgbaOut) const { using namespace vtkm::worklet::colorconversion; return this->Map(vtkm::cont::make_ArrayHandleTransform(values, MagnitudePortal()), rgbaOut); @@ -185,7 +185,7 @@ bool ColorTable::MapMagnitude(const vtkm::cont::ArrayHandle, S>& //--------------------------------------------------------------------------- template bool ColorTable::MapMagnitude(const vtkm::cont::ArrayHandle, S>& values, - vtkm::cont::ArrayHandle>& rgbOut) const + vtkm::cont::ArrayHandle& rgbOut) const { using namespace vtkm::worklet::colorconversion; return this->Map(vtkm::cont::make_ArrayHandleTransform(values, MagnitudePortal()), rgbOut); @@ -194,7 +194,7 @@ bool ColorTable::MapMagnitude(const vtkm::cont::ArrayHandle, S>& template bool ColorTable::MapComponent(const vtkm::cont::ArrayHandle, S>& values, vtkm::IdComponent comp, - vtkm::cont::ArrayHandle>& rgbaOut) const + vtkm::cont::ArrayHandle& rgbaOut) const { using namespace vtkm::worklet::colorconversion; return this->Map(vtkm::cont::make_ArrayHandleTransform(values, ComponentPortal(comp)), rgbaOut); @@ -203,7 +203,7 @@ bool ColorTable::MapComponent(const vtkm::cont::ArrayHandle, S>& template bool ColorTable::MapComponent(const vtkm::cont::ArrayHandle, S>& values, vtkm::IdComponent comp, - vtkm::cont::ArrayHandle>& rgbOut) const + vtkm::cont::ArrayHandle& rgbOut) const { using namespace vtkm::worklet::colorconversion; return this->Map(vtkm::cont::make_ArrayHandleTransform(values, ComponentPortal(comp)), rgbOut); @@ -324,7 +324,7 @@ bool ColorTable::Sample(vtkm::Int32 numSamples, //--------------------------------------------------------------------------- bool ColorTable::Sample(vtkm::Int32 numSamples, - vtkm::cont::ArrayHandle>& colors, + vtkm::cont::ArrayHandle& colors, double tolerance) const { if (numSamples <= 1) @@ -336,7 +336,7 @@ bool ColorTable::Sample(vtkm::Int32 numSamples, //--------------------------------------------------------------------------- bool ColorTable::Sample(vtkm::Int32 numSamples, - vtkm::cont::ArrayHandle>& colors, + vtkm::cont::ArrayHandle& colors, double tolerance) const { if (numSamples <= 1) diff --git a/vtkm/cont/ColorTableSamples.h b/vtkm/cont/ColorTableSamples.h index 2e07e4ad0..237d720f1 100644 --- a/vtkm/cont/ColorTableSamples.h +++ b/vtkm/cont/ColorTableSamples.h @@ -34,7 +34,7 @@ class ColorTableSamplesRGBA public: vtkm::Range SampleRange = { 1.0, 0.0 }; vtkm::Int32 NumberOfSamples = 0; // this will not include end padding, NaN, Below or Above Range - vtkm::cont::ArrayHandle> Samples; + vtkm::cont::ArrayHandle Samples; }; /// \brief Color Sample Table used with vtkm::cont::ColorTable for fast coloring @@ -53,7 +53,7 @@ class ColorTableSamplesRGB public: vtkm::Range SampleRange = { 1.0, 0.0 }; vtkm::Int32 NumberOfSamples = 0; // this will not include end padding, NaN, Below or Above Range - vtkm::cont::ArrayHandle> Samples; + vtkm::cont::ArrayHandle Samples; }; } } diff --git a/vtkm/cont/CoordinateSystem.cxx b/vtkm/cont/CoordinateSystem.cxx index 85f67f055..e54a1b683 100644 --- a/vtkm/cont/CoordinateSystem.cxx +++ b/vtkm/cont/CoordinateSystem.cxx @@ -24,7 +24,7 @@ VTKM_CONT CoordinateSystem::CoordinateSystem() VTKM_CONT CoordinateSystem::CoordinateSystem( std::string name, - const vtkm::cont::ArrayHandleVirtual>& data) + const vtkm::cont::ArrayHandleVirtual& data) : Superclass(name, Association::POINTS, data) { } @@ -34,8 +34,8 @@ VTKM_CONT CoordinateSystem::CoordinateSystem( VTKM_CONT CoordinateSystem::CoordinateSystem(std::string name, vtkm::Id3 dimensions, - vtkm::Vec origin, - vtkm::Vec spacing) + vtkm::Vec3f origin, + vtkm::Vec3f spacing) : Superclass(name, Association::POINTS, vtkm::cont::ArrayHandleVirtualCoordinates( @@ -50,8 +50,7 @@ vtkm::cont::ArrayHandleVirtualCoordinates CoordinateSystem::GetData() const } VTKM_CONT -void CoordinateSystem::SetData( - const vtkm::cont::ArrayHandleVirtual>& newdata) +void CoordinateSystem::SetData(const vtkm::cont::ArrayHandleVirtual& newdata) { this->Superclass::SetData(newdata); } @@ -72,12 +71,12 @@ template VTKM_CONT_EXPORT CoordinateSystem::CoordinateSystem( template VTKM_CONT_EXPORT CoordinateSystem::CoordinateSystem( std::string name, const vtkm::cont::ArrayHandle< - vtkm::Vec, + vtkm::Vec3f, vtkm::cont::StorageTagImplicit>&); template VTKM_CONT_EXPORT CoordinateSystem::CoordinateSystem( std::string name, const vtkm::cont::ArrayHandle< - vtkm::Vec, + vtkm::Vec3f_32, vtkm::cont::internal::StorageTagCartesianProduct< vtkm::cont::ArrayHandle, vtkm::cont::ArrayHandle, @@ -85,7 +84,7 @@ template VTKM_CONT_EXPORT CoordinateSystem::CoordinateSystem( template VTKM_CONT_EXPORT CoordinateSystem::CoordinateSystem( std::string name, const vtkm::cont::ArrayHandle< - vtkm::Vec, + vtkm::Vec3f_64, vtkm::cont::internal::StorageTagCartesianProduct< vtkm::cont::ArrayHandle, vtkm::cont::ArrayHandle, @@ -93,7 +92,7 @@ template VTKM_CONT_EXPORT CoordinateSystem::CoordinateSystem( template VTKM_CONT_EXPORT CoordinateSystem::CoordinateSystem( std::string name, const vtkm::cont::ArrayHandle< - vtkm::Vec, + vtkm::Vec3f_32, typename vtkm::cont::ArrayHandleCompositeVector< vtkm::cont::ArrayHandle, vtkm::cont::ArrayHandle, @@ -101,7 +100,7 @@ template VTKM_CONT_EXPORT CoordinateSystem::CoordinateSystem( template VTKM_CONT_EXPORT CoordinateSystem::CoordinateSystem( std::string name, const vtkm::cont::ArrayHandle< - vtkm::Vec, + vtkm::Vec3f_64, typename vtkm::cont::ArrayHandleCompositeVector< vtkm::cont::ArrayHandle, vtkm::cont::ArrayHandle, diff --git a/vtkm/cont/CoordinateSystem.h b/vtkm/cont/CoordinateSystem.h index 38477839b..6335f58fa 100644 --- a/vtkm/cont/CoordinateSystem.h +++ b/vtkm/cont/CoordinateSystem.h @@ -31,9 +31,8 @@ public: VTKM_CONT CoordinateSystem(); - VTKM_CONT CoordinateSystem( - std::string name, - const vtkm::cont::ArrayHandleVirtual>& data); + VTKM_CONT CoordinateSystem(std::string name, + const vtkm::cont::ArrayHandleVirtual& data); template VTKM_CONT CoordinateSystem(std::string name, @@ -45,11 +44,10 @@ public: /// This constructor of coordinate system sets up a regular grid of points. /// VTKM_CONT - CoordinateSystem( - std::string name, - vtkm::Id3 dimensions, - vtkm::Vec origin = vtkm::Vec(0.0f, 0.0f, 0.0f), - vtkm::Vec spacing = vtkm::Vec(1.0f, 1.0f, 1.0f)); + CoordinateSystem(std::string name, + vtkm::Id3 dimensions, + vtkm::Vec3f origin = vtkm::Vec3f(0.0f, 0.0f, 0.0f), + vtkm::Vec3f spacing = vtkm::Vec3f(1.0f, 1.0f, 1.0f)); VTKM_CONT vtkm::Id GetNumberOfPoints() const { return this->GetNumberOfValues(); } @@ -57,8 +55,7 @@ public: VTKM_CONT vtkm::cont::ArrayHandleVirtualCoordinates GetData() const; - VTKM_CONT void SetData( - const vtkm::cont::ArrayHandleVirtual>& newdata); + VTKM_CONT void SetData(const vtkm::cont::ArrayHandleVirtual& newdata); template VTKM_CONT void SetData(const vtkm::cont::ArrayHandle& newdata); diff --git a/vtkm/cont/CoordinateSystem.hxx b/vtkm/cont/CoordinateSystem.hxx index d710d07b4..b1597820f 100644 --- a/vtkm/cont/CoordinateSystem.hxx +++ b/vtkm/cont/CoordinateSystem.hxx @@ -22,17 +22,15 @@ namespace detail struct MakeArrayHandleVirtualCoordinatesFunctor { template - VTKM_CONT void operator()( - const vtkm::cont::ArrayHandle, StorageTag>& array, - ArrayHandleVirtualCoordinates& output) const + VTKM_CONT void operator()(const vtkm::cont::ArrayHandle& array, + ArrayHandleVirtualCoordinates& output) const { output = vtkm::cont::ArrayHandleVirtualCoordinates(array); } template - VTKM_CONT void operator()( - const vtkm::cont::ArrayHandle, StorageTag>& array, - ArrayHandleVirtualCoordinates& output) const + VTKM_CONT void operator()(const vtkm::cont::ArrayHandle& array, + ArrayHandleVirtualCoordinates& output) const { output = vtkm::cont::ArrayHandleVirtualCoordinates(array); } diff --git a/vtkm/cont/DataSetBuilderExplicit.cxx b/vtkm/cont/DataSetBuilderExplicit.cxx index a2656b167..d04f8ccc7 100644 --- a/vtkm/cont/DataSetBuilderExplicit.cxx +++ b/vtkm/cont/DataSetBuilderExplicit.cxx @@ -42,7 +42,7 @@ vtkm::cont::DataSet DataSetBuilderExplicitIterative::Create() } VTKM_CONT -vtkm::Id DataSetBuilderExplicitIterative::AddPoint(const vtkm::Vec& pt) +vtkm::Id DataSetBuilderExplicitIterative::AddPoint(const vtkm::Vec3f_32& pt) { points.push_back(pt); vtkm::Id id = static_cast(points.size()); diff --git a/vtkm/cont/DataSetBuilderExplicit.h b/vtkm/cont/DataSetBuilderExplicit.h index c62c771f3..dc892f49e 100644 --- a/vtkm/cont/DataSetBuilderExplicit.h +++ b/vtkm/cont/DataSetBuilderExplicit.h @@ -317,7 +317,7 @@ public: vtkm::cont::DataSet Create(); VTKM_CONT - vtkm::Id AddPoint(const vtkm::Vec& pt); + vtkm::Id AddPoint(const vtkm::Vec3f_32& pt); VTKM_CONT vtkm::Id AddPoint(const vtkm::Float32& x, const vtkm::Float32& y, const vtkm::Float32& z = 0); @@ -332,7 +332,7 @@ public: template VTKM_CONT vtkm::Id AddPoint(const vtkm::Vec& pt) { - return AddPoint(static_cast>(pt)); + return AddPoint(static_cast(pt)); } //Define cells. @@ -351,7 +351,7 @@ public: private: std::string coordNm, cellNm; - std::vector> points; + std::vector points; std::vector shapes; std::vector numIdx; std::vector connectivity; diff --git a/vtkm/cont/DataSetBuilderUniform.cxx b/vtkm/cont/DataSetBuilderUniform.cxx index 18604e88a..1663430ba 100644 --- a/vtkm/cont/DataSetBuilderUniform.cxx +++ b/vtkm/cont/DataSetBuilderUniform.cxx @@ -50,12 +50,11 @@ vtkm::cont::DataSet DataSetBuilderUniform::Create(const vtkm::Id3& dimensions, } VTKM_CONT -vtkm::cont::DataSet DataSetBuilderUniform::CreateDataSet( - const vtkm::Id3& dimensions, - const vtkm::Vec& origin, - const vtkm::Vec& spacing, - std::string coordNm, - std::string cellNm) +vtkm::cont::DataSet DataSetBuilderUniform::CreateDataSet(const vtkm::Id3& dimensions, + const vtkm::Vec3f& origin, + const vtkm::Vec3f& spacing, + std::string coordNm, + std::string cellNm) { vtkm::Id dims[3] = { 1, 1, 1 }; int ndims = 0; diff --git a/vtkm/cont/DataSetBuilderUniform.h b/vtkm/cont/DataSetBuilderUniform.h index b8a7749e7..0b1b8ecea 100644 --- a/vtkm/cont/DataSetBuilderUniform.h +++ b/vtkm/cont/DataSetBuilderUniform.h @@ -20,7 +20,7 @@ namespace cont class VTKM_CONT_EXPORT DataSetBuilderUniform { - using VecType = vtkm::Vec; + using VecType = vtkm::Vec3f; public: VTKM_CONT @@ -99,8 +99,8 @@ public: private: VTKM_CONT static vtkm::cont::DataSet CreateDataSet(const vtkm::Id3& dimensions, - const vtkm::Vec& origin, - const vtkm::Vec& spacing, + const vtkm::Vec3f& origin, + const vtkm::Vec3f& spacing, std::string coordNm, std::string cellNm); }; diff --git a/vtkm/cont/PointLocatorUniformGrid.cxx b/vtkm/cont/PointLocatorUniformGrid.cxx index 524f5e63c..85bb430e6 100644 --- a/vtkm/cont/PointLocatorUniformGrid.cxx +++ b/vtkm/cont/PointLocatorUniformGrid.cxx @@ -35,9 +35,7 @@ public: using ExecutionSignature = void(_1, _2); VTKM_CONT - BinPointsWorklet(vtkm::Vec min, - vtkm::Vec max, - vtkm::Vec dims) + BinPointsWorklet(vtkm::Vec3f min, vtkm::Vec3f max, vtkm::Id3 dims) : Min(min) , Dims(dims) , Dxdydz((max - Min) / Dims) @@ -47,16 +45,16 @@ public: template VTKM_EXEC void operator()(const CoordVecType& coord, IdType& label) const { - vtkm::Vec ijk = (coord - Min) / Dxdydz; + vtkm::Id3 ijk = (coord - Min) / Dxdydz; ijk = vtkm::Max(ijk, vtkm::Id3(0)); ijk = vtkm::Min(ijk, this->Dims - vtkm::Id3(1)); label = ijk[0] + ijk[1] * Dims[0] + ijk[2] * Dims[0] * Dims[1]; } private: - vtkm::Vec Min; - vtkm::Vec Dims; - vtkm::Vec Dxdydz; + vtkm::Vec3f Min; + vtkm::Id3 Dims; + vtkm::Vec3f Dxdydz; }; } // internal diff --git a/vtkm/cont/testing/MakeTestDataSet.h b/vtkm/cont/testing/MakeTestDataSet.h index f2e7b5977..5eaff5ed9 100644 --- a/vtkm/cont/testing/MakeTestDataSet.h +++ b/vtkm/cont/testing/MakeTestDataSet.h @@ -135,7 +135,7 @@ inline vtkm::cont::DataSet MakeTestDataSet::Make1DUniformDataSet2() inline vtkm::cont::DataSet MakeTestDataSet::Make1DExplicitDataSet0() { const int nVerts = 5; - using CoordType = vtkm::Vec; + using CoordType = vtkm::Vec3f_32; std::vector coords(nVerts); coords[0] = CoordType(0.0f, 0.f, 0.f); coords[1] = CoordType(1.0f, 0.f, 0.f); @@ -505,7 +505,7 @@ inline vtkm::cont::DataSet MakeTestDataSet::Make2DExplicitDataSet0() // Coordinates const int nVerts = 16; const int nCells = 7; - using CoordType = vtkm::Vec; + using CoordType = vtkm::Vec3f_32; std::vector coords(nVerts); coords[0] = CoordType(0, 0, 0); @@ -597,7 +597,7 @@ inline vtkm::cont::DataSet MakeTestDataSet::Make3DExplicitDataSet0() vtkm::cont::DataSetBuilderExplicit dsb; const int nVerts = 5; - using CoordType = vtkm::Vec; + using CoordType = vtkm::Vec3f_32; std::vector coords(nVerts); coords[0] = CoordType(0, 0, 0); coords[1] = CoordType(1, 0, 0); @@ -678,7 +678,7 @@ inline vtkm::cont::DataSet MakeTestDataSet::Make3DExplicitDataSet1() vtkm::cont::DataSetBuilderExplicit dsb; const int nVerts = 5; - using CoordType = vtkm::Vec; + using CoordType = vtkm::Vec3f_32; std::vector coords(nVerts); coords[0] = CoordType(0, 0, 0); @@ -719,7 +719,7 @@ inline vtkm::cont::DataSet MakeTestDataSet::Make3DExplicitDataSet2() vtkm::cont::DataSet dataSet; const int nVerts = 8; - using CoordType = vtkm::Vec; + using CoordType = vtkm::Vec3f_32; CoordType coordinates[nVerts] = { CoordType(0, 0, 0), // 0 CoordType(1, 0, 0), // 1 @@ -770,7 +770,7 @@ inline vtkm::cont::DataSet MakeTestDataSet::Make3DExplicitDataSet4() vtkm::cont::DataSet dataSet; const int nVerts = 12; - using CoordType = vtkm::Vec; + using CoordType = vtkm::Vec3f_32; CoordType coordinates[nVerts] = { CoordType(0, 0, 0), //0 CoordType(1, 0, 0), //1 @@ -835,7 +835,7 @@ inline vtkm::cont::DataSet MakeTestDataSet::Make3DExplicitDataSet3() vtkm::cont::DataSet dataSet; const int nVerts = 4; - using CoordType = vtkm::Vec; + using CoordType = vtkm::Vec3f_32; CoordType coordinates[nVerts] = { CoordType(0, 0, 0), CoordType(1, 0, 0), CoordType(1, 0, 1), CoordType(0, 1, 0) }; @@ -854,7 +854,7 @@ inline vtkm::cont::DataSet MakeTestDataSet::Make3DExplicitDataSet3() "cellvar", vtkm::cont::Field::Association::CELL_SET, "cells", cellvar, 1, vtkm::CopyFlag::On)); vtkm::cont::CellSetExplicit<> cellSet("cells"); - vtkm::Vec ids; + vtkm::Id4 ids; ids[0] = 0; ids[1] = 1; ids[2] = 2; @@ -875,7 +875,7 @@ inline vtkm::cont::DataSet MakeTestDataSet::Make3DExplicitDataSet5() vtkm::cont::DataSet dataSet; const int nVerts = 11; - using CoordType = vtkm::Vec; + using CoordType = vtkm::Vec3f_32; CoordType coordinates[nVerts] = { CoordType(0, 0, 0), //0 CoordType(1, 0, 0), //1 @@ -962,7 +962,7 @@ inline vtkm::cont::DataSet MakeTestDataSet::Make3DExplicitDataSet6() // Coordinates const int nVerts = 8; const int nCells = 8; - using CoordType = vtkm::Vec; + using CoordType = vtkm::Vec3f_32; std::vector coords = { { -0.707f, -0.354f, -0.354f }, { 0.000f, -0.854f, 0.146f }, { 0.000f, -0.146f, 0.854f }, { -0.707f, 0.354f, 0.354f }, { 10.0f, 10.0f, 10.0f }, { 5.0f, 5.0f, 5.0f }, @@ -1039,7 +1039,7 @@ inline vtkm::cont::DataSet MakeTestDataSet::Make3DExplicitDataSetZoo() // Coordinates constexpr int nVerts = 30; constexpr int nCells = 25; - using CoordType = vtkm::Vec; + using CoordType = vtkm::Vec3f_32; std::vector coords = @@ -1288,7 +1288,7 @@ inline vtkm::cont::DataSet MakeTestDataSet::Make3DExplicitDataSet7() const int nVerts = 8; const int nCells = 8; - using CoordType = vtkm::Vec; + using CoordType = vtkm::Vec3f_32; std::vector coords = { { -0.707f, -0.354f, -0.354f }, { 0.000f, -0.854f, 0.146f }, { 0.000f, -0.146f, 0.854f }, { -0.707f, 0.354f, 0.354f }, { 10.0f, 10.0f, 10.0f }, { 5.0f, 5.0f, 5.0f }, @@ -1354,7 +1354,7 @@ inline vtkm::cont::DataSet MakeTestDataSet::Make3DExplicitDataSet8() // Coordinates const int nVerts = 8; const int nCells = 10; - using CoordType = vtkm::Vec; + using CoordType = vtkm::Vec3f_32; std::vector coords = { { -0.707f, -0.354f, -0.354f }, { 0.000f, -0.854f, 0.146f }, { 0.000f, -0.146f, 0.854f }, { -0.707f, 0.354f, 0.354f }, { 10.0f, 10.0f, 10.0f }, { 5.0f, 5.0f, 5.0f }, @@ -1433,7 +1433,7 @@ inline vtkm::cont::DataSet MakeTestDataSet::Make3DExplicitDataSetPolygonal() // Coordinates const int nVerts = 8; const int nCells = 8; - using CoordType = vtkm::Vec; + using CoordType = vtkm::Vec3f_32; std::vector coords = { { -0.707f, -0.354f, -0.354f }, { 0.000f, -0.854f, 0.146f }, { 0.000f, -0.146f, 0.854f }, { -0.707f, 0.354f, 0.354f }, { 0.000f, 0.146f, -0.854f }, { 0.000f, 0.854f, -0.146f }, @@ -1512,7 +1512,7 @@ inline vtkm::cont::DataSet MakeTestDataSet::Make3DExplicitDataSetCowNose() { // prepare data array const int nVerts = 17; - using CoordType = vtkm::Vec; + using CoordType = vtkm::Vec3f_64; CoordType coordinates[nVerts] = { CoordType(0.0480879, 0.151874, 0.107334), CoordType(0.0293568, 0.245532, 0.125337), CoordType(0.0224398, 0.246495, 0.1351), CoordType(0.0180085, 0.20436, 0.145316), diff --git a/vtkm/cont/testing/TestingArrayHandleVirtualCoordinates.h b/vtkm/cont/testing/TestingArrayHandleVirtualCoordinates.h index 7c71c033e..1365664d1 100644 --- a/vtkm/cont/testing/TestingArrayHandleVirtualCoordinates.h +++ b/vtkm/cont/testing/TestingArrayHandleVirtualCoordinates.h @@ -80,7 +80,7 @@ private: static void TestAll() { - using PointType = vtkm::Vec; + using PointType = vtkm::Vec3f; static constexpr vtkm::Id length = 64; vtkm::cont::ArrayHandle out; diff --git a/vtkm/cont/testing/TestingCellLocatorRectilinearGrid.h b/vtkm/cont/testing/TestingCellLocatorRectilinearGrid.h index 86b6c3ef0..985225010 100644 --- a/vtkm/cont/testing/TestingCellLocatorRectilinearGrid.h +++ b/vtkm/cont/testing/TestingCellLocatorRectilinearGrid.h @@ -35,7 +35,7 @@ public: using RectilinearPortalType = typename RectilinearType::template ExecutionTypes::PortalConst; - LocatorWorklet(vtkm::Bounds& bounds, vtkm::Vec& dims, const RectilinearType& coords) + LocatorWorklet(vtkm::Bounds& bounds, vtkm::Id3& dims, const RectilinearType& coords) : Bounds(bounds) , Dims(dims) { @@ -55,7 +55,7 @@ public: { if (!Bounds.Contains(point)) return -1; - vtkm::Vec logical(-1, -1, -1); + vtkm::Id3 logical(-1, -1, -1); // Linear search in the coordinates. vtkm::Id index; /*Get floor X location*/ @@ -98,7 +98,7 @@ public: private: vtkm::Bounds Bounds; - vtkm::Vec Dims; + vtkm::Id3 Dims; AxisPortalType xAxis; AxisPortalType yAxis; AxisPortalType zAxis; @@ -139,12 +139,12 @@ public: std::cout << "X bounds : " << bounds.X.Min << " to " << bounds.X.Max << std::endl; std::cout << "Y bounds : " << bounds.Y.Min << " to " << bounds.Y.Max << std::endl; std::cout << "Z bounds : " << bounds.Z.Min << " to " << bounds.Z.Max << std::endl; - vtkm::Vec dims = + vtkm::Id3 dims = cellSet.Cast().GetSchedulingRange(vtkm::TopologyElementTagPoint()); std::cout << "Dimensions of dataset : " << dims << std::endl; // Generate some sample points. - using PointType = vtkm::Vec; + using PointType = vtkm::Vec3f; std::vector pointsVec; std::default_random_engine dre; std::uniform_real_distribution xCoords(0.0f, 4.0f); diff --git a/vtkm/cont/testing/TestingCellLocatorUniformBins.h b/vtkm/cont/testing/TestingCellLocatorUniformBins.h index 281f8858f..9c64668d6 100644 --- a/vtkm/cont/testing/TestingCellLocatorUniformBins.h +++ b/vtkm/cont/testing/TestingCellLocatorUniformBins.h @@ -33,7 +33,7 @@ namespace { -using PointType = vtkm::Vec; +using PointType = vtkm::Vec3f; std::default_random_engine RandomGenerator; @@ -187,10 +187,10 @@ public: using ExecutionSignature = void(_1, _2, _3, _4); template - VTKM_EXEC void operator()(const vtkm::Vec& point, + VTKM_EXEC void operator()(const vtkm::Vec3f& point, const LocatorType& locator, vtkm::Id& cellId, - vtkm::Vec& pcoords) const + vtkm::Vec3f& pcoords) const { locator->FindCell(point, cellId, pcoords, *this); } diff --git a/vtkm/cont/testing/TestingCellLocatorUniformGrid.h b/vtkm/cont/testing/TestingCellLocatorUniformGrid.h index c9f65ad1f..8a5af462d 100644 --- a/vtkm/cont/testing/TestingCellLocatorUniformGrid.h +++ b/vtkm/cont/testing/TestingCellLocatorUniformGrid.h @@ -27,7 +27,7 @@ class LocatorWorklet : public vtkm::worklet::WorkletMapField { public: - LocatorWorklet(vtkm::Bounds& bounds, vtkm::Vec& cellDims) + LocatorWorklet(vtkm::Bounds& bounds, vtkm::Id3& cellDims) : Bounds(bounds) , CellDims(cellDims) { @@ -44,7 +44,7 @@ public: if (!Bounds.Contains(point)) return -1; - vtkm::Vec logical; + vtkm::Id3 logical; logical[0] = (point[0] == Bounds.X.Max) ? CellDims[0] - 1 : static_cast(vtkm::Floor((point[0] / Bounds.X.Length()) * @@ -75,7 +75,7 @@ public: private: vtkm::Bounds Bounds; - vtkm::Vec CellDims; + vtkm::Id3 CellDims; }; template @@ -96,7 +96,7 @@ public: std::cout << "Z bounds : " << bounds.Z.Min << " to " << bounds.Z.Max << std::endl; using StructuredType = vtkm::cont::CellSetStructured<3>; - vtkm::Vec cellDims = + vtkm::Id3 cellDims = cellSet.Cast().GetSchedulingRange(vtkm::TopologyElementTagCell()); std::cout << "Dimensions of dataset : " << cellDims << std::endl; @@ -107,7 +107,7 @@ public: locator.Update(); // Generate some sample points. - using PointType = vtkm::Vec; + using PointType = vtkm::Vec3f; std::vector pointsVec; std::default_random_engine dre; std::uniform_real_distribution inBounds(0.0f, 4.0f); diff --git a/vtkm/cont/testing/TestingColorTable.h b/vtkm/cont/testing/TestingColorTable.h index 1e6c726bf..a464b5c5c 100644 --- a/vtkm/cont/testing/TestingColorTable.h +++ b/vtkm/cont/testing/TestingColorTable.h @@ -162,12 +162,12 @@ public: constexpr int data[nvals] = { -1, 0, 1, 2 }; auto field = vtkm::cont::make_ArrayHandle(data, nvals); - vtkm::cont::ArrayHandle> colors; + vtkm::cont::ArrayHandle colors; const bool ran = table.Map(field, colors); VTKM_TEST_ASSERT(ran, "color table failed to execute"); //verify that we clamp the values to the expected range - const vtkm::Vec correct[nvals] = { + const vtkm::Vec3ui_8 correct[nvals] = { { 0, 255, 0 }, { 0, 255, 0 }, { 255, 0, 255 }, { 255, 0, 255 } }; auto portal = colors.GetPortalConstControl(); @@ -193,13 +193,13 @@ public: constexpr int data[nvals] = { -2, -1, 2, 3 }; auto field = vtkm::cont::make_ArrayHandle(data, nvals); - vtkm::cont::ArrayHandle> colors; + vtkm::cont::ArrayHandle colors; const bool ran = table.Map(field, colors); VTKM_TEST_ASSERT(ran, "color table failed to execute"); //verify that both the above and below range colors are used, //and that the default value of both is 0,0,0 - const vtkm::Vec correct_range_defaults[nvals] = { + const vtkm::Vec3ui_8 correct_range_defaults[nvals] = { { 0, 0, 0 }, { 0, 255, 0 }, { 255, 0, 255 }, { 0, 0, 0 } }; auto portal = colors.GetPortalConstControl(); @@ -216,7 +216,7 @@ public: table.SetBelowRangeColor(vtkm::Vec{ 0.0f, 0.0f, 1.0f }); //green const bool ran2 = table.Map(field, colors); VTKM_TEST_ASSERT(ran2, "color table failed to execute"); - const vtkm::Vec correct_custom_range_colors[nvals] = { + const vtkm::Vec3ui_8 correct_custom_range_colors[nvals] = { { 0, 0, 255 }, { 0, 255, 0 }, { 255, 0, 255 }, { 255, 0, 0 } }; portal = colors.GetPortalConstControl(); @@ -256,15 +256,14 @@ public: constexpr int data[nvals] = { 0, 10, 20, 30, 40, 50 }; auto field = vtkm::cont::make_ArrayHandle(data, nvals); - vtkm::cont::ArrayHandle> colors; + vtkm::cont::ArrayHandle colors; const bool ran = newTable.Map(field, colors); VTKM_TEST_ASSERT(ran, "color table failed to execute"); //values confirmed with ParaView 5.4 - const vtkm::Vec correct_lab_values[nvals] = { - { 0, 0, 255 }, { 105, 69, 204 }, { 126, 109, 153 }, - { 156, 151, 117 }, { 207, 202, 87 }, { 255, 255, 0 } - }; + const vtkm::Vec3ui_8 correct_lab_values[nvals] = { { 0, 0, 255 }, { 105, 69, 204 }, + { 126, 109, 153 }, { 156, 151, 117 }, + { 207, 202, 87 }, { 255, 255, 0 } }; auto portal = colors.GetPortalConstControl(); for (std::size_t i = 0; i < nvals; ++i) { @@ -292,14 +291,14 @@ public: constexpr vtkm::Id nvals = 3; constexpr float data[nvals] = { 10.0f, -5.0f, -15.0f }; - vtkm::cont::ArrayHandle> colors; + vtkm::cont::ArrayHandle colors; auto field = vtkm::cont::make_ArrayHandle(data, nvals); const bool ran = table.Map(field, colors); VTKM_TEST_ASSERT(ran, "color table failed to execute"); - const vtkm::Vec correct_rgb_values[nvals] = { { 0, 0, 128 }, - { 0, 128, 255 }, - { 128, 255, 255 } }; + const vtkm::Vec3ui_8 correct_rgb_values[nvals] = { { 0, 0, 128 }, + { 0, 128, 255 }, + { 128, 255, 255 } }; auto portal = colors.GetPortalConstControl(); for (std::size_t i = 0; i < nvals; ++i) { @@ -337,13 +336,13 @@ public: constexpr vtkm::Id nvals = 6; constexpr int data[nvals] = { 0, 10, 20, 30, 40, 50 }; - vtkm::cont::ArrayHandle> colors; + vtkm::cont::ArrayHandle colors; auto field = vtkm::cont::make_ArrayHandle(data, nvals); const bool ran = table.Map(field, colors); VTKM_TEST_ASSERT(ran, "color table failed to execute"); //values confirmed with ParaView 5.4 - const vtkm::Vec correct_diverging_values[nvals] = { + const vtkm::Vec4ui_8 correct_diverging_values[nvals] = { { 59, 76, 192, 0 }, { 124, 159, 249, 51 }, { 192, 212, 245, 102 }, { 242, 203, 183, 153 }, { 238, 133, 104, 204 }, { 180, 4, 38, 255 } }; @@ -383,15 +382,15 @@ public: constexpr vtkm::Id nvals = 6; constexpr float data[nvals] = { 0.0f, 10.0f, 20.0f, 30.0f, 40.0f, 50.0f }; - vtkm::cont::ArrayHandle> colors; + vtkm::cont::ArrayHandle colors; auto field = vtkm::cont::make_ArrayHandle(data, nvals); const bool ran = table.Map(field, colors); VTKM_TEST_ASSERT(ran, "color table failed to execute"); //values confirmed with ParaView 5.4 - const vtkm::Vec correct_hsv_values[nvals] = { { 0, 0, 255 }, { 0, 204, 255 }, - { 0, 255, 102 }, { 102, 255, 0 }, - { 255, 204, 0 }, { 255, 0, 0 } }; + const vtkm::Vec3ui_8 correct_hsv_values[nvals] = { { 0, 0, 255 }, { 0, 204, 255 }, + { 0, 255, 102 }, { 102, 255, 0 }, + { 255, 204, 0 }, { 255, 0, 0 } }; auto portal = colors.GetPortalConstControl(); for (std::size_t i = 0; i < nvals; ++i) { @@ -400,13 +399,13 @@ public: "incorrect value when interpolating between values"); } - vtkm::cont::ArrayHandle> colors_rgb; + vtkm::cont::ArrayHandle colors_rgb; table.SetColorSpace(vtkm::cont::ColorSpace::RGB); table.Map(field, colors_rgb); - const vtkm::Vec correct_rgb_values[nvals] = { { 0, 0, 255 }, { 51, 0, 204 }, - { 102, 0, 153 }, { 153, 0, 102 }, - { 204, 0, 51 }, { 255, 0, 0 } }; + const vtkm::Vec3ui_8 correct_rgb_values[nvals] = { { 0, 0, 255 }, { 51, 0, 204 }, + { 102, 0, 153 }, { 153, 0, 102 }, + { 204, 0, 51 }, { 255, 0, 0 } }; auto rgb_portal = colors_rgb.GetPortalConstControl(); for (std::size_t i = 0; i < nvals; ++i) { @@ -444,16 +443,15 @@ public: constexpr vtkm::Id nvals = 6; constexpr float data[nvals] = { 0.0f, 10.0f, 20.0f, 30.0f, 40.0f, 50.0f }; - vtkm::cont::ArrayHandle> colors; + vtkm::cont::ArrayHandle colors; auto field = vtkm::cont::make_ArrayHandle(data, nvals); const bool ran = table.Map(field, colors); VTKM_TEST_ASSERT(ran, "color table failed to execute"); //values confirmed with ParaView 5.4 - const vtkm::Vec correct_opacity_values[nvals] = { - { 0, 0, 0, 0 }, { 0, 0, 0, 1 }, { 0, 0, 0, 11 }, - { 0, 0, 0, 52 }, { 0, 0, 0, 203 }, { 0, 0, 0, 255 } - }; + const vtkm::Vec4ui_8 correct_opacity_values[nvals] = { { 0, 0, 0, 0 }, { 0, 0, 0, 1 }, + { 0, 0, 0, 11 }, { 0, 0, 0, 52 }, + { 0, 0, 0, 203 }, { 0, 0, 0, 255 } }; auto portal = colors.GetPortalConstControl(); for (std::size_t i = 0; i < nvals; ++i) { @@ -477,15 +475,15 @@ public: constexpr double data[3] = { 0.0, 0.5, 1.0 }; auto samples = vtkm::cont::make_ArrayHandle(data, nvals); - vtkm::cont::ArrayHandle> colors; + vtkm::cont::ArrayHandle colors; TransferFunction transfer(table.PrepareForExecution(DeviceAdapterTag{})); vtkm::worklet::DispatcherMapField dispatcher(transfer); dispatcher.SetDevice(DeviceAdapterTag()); dispatcher.Invoke(samples, colors); - const vtkm::Vec correct_sampling_points[nvals] = { { 14, 28, 31, 255 }, - { 21, 150, 21, 255 }, - { 255, 251, 230, 255 } }; + const vtkm::Vec4ui_8 correct_sampling_points[nvals] = { { 14, 28, 31, 255 }, + { 21, 150, 21, 255 }, + { 255, 251, 230, 255 } }; auto portal = colors.GetPortalConstControl(); for (std::size_t i = 0; i < nvals; ++i) @@ -505,13 +503,13 @@ public: VTKM_TEST_ASSERT((table.GetNumberOfPoints() == 21), "loading linear green table failed with number of control points"); - vtkm::cont::ArrayHandle> colors; + vtkm::cont::ArrayHandle colors; constexpr vtkm::Id nvals = 3; table.Sample(3, colors); - const vtkm::Vec correct_sampling_points[nvals] = { { 14, 28, 31, 255 }, - { 21, 150, 21, 255 }, - { 255, 251, 230, 255 } }; + const vtkm::Vec4ui_8 correct_sampling_points[nvals] = { { 14, 28, 31, 255 }, + { 21, 150, 21, 255 }, + { 255, 251, 230, 255 } }; auto portal = colors.GetPortalConstControl(); for (std::size_t i = 0; i < nvals; ++i) { @@ -538,16 +536,16 @@ public: constexpr vtkm::Id nvals = 8; constexpr int data[nvals] = { -1, 0, 10, 20, 30, 40, 50, 60 }; - vtkm::cont::ArrayHandle> colors; + vtkm::cont::ArrayHandle colors; auto field = vtkm::cont::make_ArrayHandle(data, nvals); const bool ran = table.Map(field, samples, colors); VTKM_TEST_ASSERT(ran, "color table failed to execute"); //values confirmed with ParaView 5.4 - const vtkm::Vec correct_diverging_values[nvals] = { - { 0, 0, 255 }, { 59, 76, 192 }, { 122, 157, 248 }, { 191, 211, 246 }, - { 241, 204, 184 }, { 238, 134, 105 }, { 180, 4, 38 }, { 255, 0, 0 } - }; + const vtkm::Vec3ui_8 correct_diverging_values[nvals] = { { 0, 0, 255 }, { 59, 76, 192 }, + { 122, 157, 248 }, { 191, 211, 246 }, + { 241, 204, 184 }, { 238, 134, 105 }, + { 180, 4, 38 }, { 255, 0, 0 } }; auto portal = colors.GetPortalConstControl(); for (std::size_t i = 0; i < nvals; ++i) { diff --git a/vtkm/cont/testing/TestingComputeRange.h b/vtkm/cont/testing/TestingComputeRange.h index e66b8d4aa..c39a132cc 100644 --- a/vtkm/cont/testing/TestingComputeRange.h +++ b/vtkm/cont/testing/TestingComputeRange.h @@ -97,8 +97,8 @@ private: { vtkm::cont::CoordinateSystem field("TestField", vtkm::Id3(10, 20, 5), - vtkm::Vec(0.0f, -5.0f, 4.0f), - vtkm::Vec(1.0f, 0.5f, 2.0f)); + vtkm::Vec3f(0.0f, -5.0f, 4.0f), + vtkm::Vec3f(1.0f, 0.5f, 2.0f)); vtkm::Bounds result = field.GetBounds(); diff --git a/vtkm/cont/testing/TestingDataSetExplicit.h b/vtkm/cont/testing/TestingDataSetExplicit.h index db31698a1..11cf59f87 100644 --- a/vtkm/cont/testing/TestingDataSetExplicit.h +++ b/vtkm/cont/testing/TestingDataSetExplicit.h @@ -140,7 +140,7 @@ private: //verify that GetIndices works properly vtkm::Id expectedPointIds[4] = { 2, 1, 3, 4 }; - vtkm::Vec retrievedPointIds; + vtkm::Id4 retrievedPointIds; cellset.GetIndices(1, retrievedPointIds); for (vtkm::IdComponent i = 0; i < 4; i++) { diff --git a/vtkm/cont/testing/TestingDataSetSingleType.h b/vtkm/cont/testing/TestingDataSetSingleType.h index 842c8b6ef..99a72b12b 100644 --- a/vtkm/cont/testing/TestingDataSetSingleType.h +++ b/vtkm/cont/testing/TestingDataSetSingleType.h @@ -58,7 +58,7 @@ private: static inline vtkm::cont::DataSet make_SingleTypeDataSet() { - using CoordType = vtkm::Vec; + using CoordType = vtkm::Vec3f_32; std::vector coordinates; coordinates.push_back(CoordType(0, 0, 0)); coordinates.push_back(CoordType(1, 0, 0)); diff --git a/vtkm/cont/testing/TestingDeviceAdapter.h b/vtkm/cont/testing/TestingDeviceAdapter.h index c64f0bfd2..e6d12ebc5 100644 --- a/vtkm/cont/testing/TestingDeviceAdapter.h +++ b/vtkm/cont/testing/TestingDeviceAdapter.h @@ -556,7 +556,7 @@ private: try { std::cout << "Do array allocation that should fail." << std::endl; - vtkm::cont::ArrayHandle, StorageTagBasic> bigArray; + vtkm::cont::ArrayHandle bigArray; const vtkm::Id bigSize = 0x7FFFFFFFFFFFFFFFLL; bigArray.PrepareForOutput(bigSize, DeviceAdapterTag{}); // It does not seem reasonable to get here. The previous call should fail. @@ -1070,7 +1070,7 @@ private: std::cout << "Sort by keys" << std::endl; using Vec3 = vtkm::Vec; - using Vec3ArrayHandle = vtkm::cont::ArrayHandle, StorageTag>; + using Vec3ArrayHandle = vtkm::cont::ArrayHandle; std::vector testKeys(ARRAY_SIZE); std::vector testValues(testKeys.size()); @@ -1274,8 +1274,7 @@ private: testData[ARRAY_SIZE / 2] = maxValue; IdArrayHandle input = vtkm::cont::make_ArrayHandle(testData); - vtkm::Vec range = - Algorithm::Reduce(input, vtkm::Vec(0, 0), vtkm::MinAndMax()); + vtkm::Id2 range = Algorithm::Reduce(input, vtkm::Id2(0, 0), vtkm::MinAndMax()); VTKM_TEST_ASSERT(maxValue == range[1], "Got bad value from Reduce with comparison object"); VTKM_TEST_ASSERT(0 == range[0], "Got bad value from Reduce with comparison object"); @@ -1317,8 +1316,8 @@ private: 13.1f, -2.1f, -1.0f, 13.1f, -2.1f, -1.0f, 13.1f, -2.1f, -1.0f, 113.1f, -2.1f, -1.0f }; auto farray = vtkm::cont::make_ArrayHandle(inputFValues, inputLength); - vtkm::Vec frange = Algorithm::Reduce( - farray, vtkm::Vec(0.0f, 0.0f), CustomMinAndMax()); + vtkm::Vec2f_32 frange = + Algorithm::Reduce(farray, vtkm::Vec2f_32(0.0f, 0.0f), CustomMinAndMax()); VTKM_TEST_ASSERT(-211.1f == frange[0], "Got bad float value from Reduce with comparison object"); VTKM_TEST_ASSERT(413.1f == frange[1], "Got bad float value from Reduce with comparison object"); @@ -1420,21 +1419,21 @@ private: const vtkm::Id inputLength = 3; const vtkm::Id expectedLength = 1; vtkm::Id inputKeys[inputLength] = { 0, 0, 0 }; // input keys - vtkm::Vec inputValues[inputLength]; + vtkm::Vec3f_64 inputValues[inputLength]; inputValues[0] = vtkm::make_Vec(13.1, 13.3, 13.5); inputValues[1] = vtkm::make_Vec(-2.1, -2.3, -2.5); inputValues[2] = vtkm::make_Vec(-1.0, -1.0, 1.0); // input keys vtkm::Id expectedKeys[expectedLength] = { 0 }; - vtkm::Vec expectedValues[expectedLength]; + vtkm::Vec3f_64 expectedValues[expectedLength]; expectedValues[0] = vtkm::make_Vec(27.51, 30.59, -33.75); IdArrayHandle keys = vtkm::cont::make_ArrayHandle(inputKeys, inputLength); - vtkm::cont::ArrayHandle, StorageTag> values = + vtkm::cont::ArrayHandle values = vtkm::cont::make_ArrayHandle(inputValues, inputLength); IdArrayHandle keysOut; - vtkm::cont::ArrayHandle, StorageTag> valuesOut; + vtkm::cont::ArrayHandle valuesOut; Algorithm::ReduceByKey(keys, values, keysOut, valuesOut, vtkm::Multiply()); VTKM_TEST_ASSERT(keysOut.GetNumberOfValues() == expectedLength, @@ -1446,7 +1445,7 @@ private: for (vtkm::Id i = 0; i < expectedLength; ++i) { const vtkm::Id k = keysOut.GetPortalConstControl().Get(i); - const vtkm::Vec v = valuesOut.GetPortalConstControl().Get(i); + const vtkm::Vec3f_64 v = valuesOut.GetPortalConstControl().Get(i); VTKM_TEST_ASSERT(expectedKeys[i] == k, "Incorrect reduced key"); VTKM_TEST_ASSERT(expectedValues[i] == v, "Incorrect reduced vale"); } @@ -1832,7 +1831,7 @@ private: { using Vec3 = vtkm::Vec; - using Vec3ArrayHandle = vtkm::cont::ArrayHandle, StorageTag>; + using Vec3ArrayHandle = vtkm::cont::ArrayHandle; std::vector testValues(ARRAY_SIZE); @@ -1969,7 +1968,7 @@ private: { using Vec3 = vtkm::Vec; - using Vec3ArrayHandle = vtkm::cont::ArrayHandle, StorageTag>; + using Vec3ArrayHandle = vtkm::cont::ArrayHandle; std::vector testValues(ARRAY_SIZE); @@ -2282,11 +2281,11 @@ private: { std::cout << "-------------------------------------------------" << std::endl; std::cout << "Testing Copy to same array type" << std::endl; - TestCopyArrays>(); - TestCopyArrays>(); + TestCopyArrays(); + TestCopyArrays(); // TestCopyArrays>(); - TestCopyArrays>>(); + TestCopyArrays>(); // TestCopyArrays(); TestCopyArrays(); diff --git a/vtkm/cont/testing/TestingFancyArrayHandles.h b/vtkm/cont/testing/TestingFancyArrayHandles.h index 400a8732c..eeb8de8f4 100644 --- a/vtkm/cont/testing/TestingFancyArrayHandles.h +++ b/vtkm/cont/testing/TestingFancyArrayHandles.h @@ -1239,17 +1239,14 @@ private: { }; - struct ZipTypesToTest - : vtkm::ListTagBase, - vtkm::Pair>, - vtkm::Pair, vtkm::Vec>> + struct ZipTypesToTest : vtkm::ListTagBase, + vtkm::Pair, + vtkm::Pair> { }; - struct HandleTypesToTest : vtkm::ListTagBase, - vtkm::FloatDefault, - vtkm::Vec> + struct HandleTypesToTest + : vtkm::ListTagBase { }; diff --git a/vtkm/cont/testing/TestingImplicitFunction.h b/vtkm/cont/testing/TestingImplicitFunction.h index 1632d24c3..8663f468b 100644 --- a/vtkm/cont/testing/TestingImplicitFunction.h +++ b/vtkm/cont/testing/TestingImplicitFunction.h @@ -182,7 +182,7 @@ private: std::cout << "Testing vtkm::Frustum on " << vtkm::cont::DeviceAdapterTraits::GetName() << "\n"; - vtkm::Vec points[8] = { + vtkm::Vec3f points[8] = { { 0.0f, 0.0f, 0.0f }, // 0 { 1.0f, 0.0f, 0.0f }, // 1 { 1.0f, 0.0f, 1.0f }, // 2 diff --git a/vtkm/cont/testing/TestingPointLocatorUniformGrid.h b/vtkm/cont/testing/TestingPointLocatorUniformGrid.h index 7a647c9e4..5954cc625 100644 --- a/vtkm/cont/testing/TestingPointLocatorUniformGrid.h +++ b/vtkm/cont/testing/TestingPointLocatorUniformGrid.h @@ -98,7 +98,7 @@ public: vtkm::Int32 nTrainingPoints = 5; vtkm::Int32 nTestingPoint = 1; - std::vector> coordi; + std::vector coordi; ///// randomly generate training points///// std::default_random_engine dre; @@ -131,7 +131,7 @@ public: locator->Update(); ///// randomly generate testing points///// - std::vector> qcVec; + std::vector qcVec; for (vtkm::Int32 i = 0; i < nTestingPoint; i++) { qcVec.push_back(vtkm::make_Vec(dr(dre), dr(dre), dr(dre))); diff --git a/vtkm/cont/testing/UnitTestArrayHandleCompositeVector.cxx b/vtkm/cont/testing/UnitTestArrayHandleCompositeVector.cxx index a08f9cf20..09a1073ef 100644 --- a/vtkm/cont/testing/UnitTestArrayHandleCompositeVector.cxx +++ b/vtkm/cont/testing/UnitTestArrayHandleCompositeVector.cxx @@ -172,7 +172,7 @@ void TryVector3(vtkm::cont::ArrayHandle array1, std::cout << " Fourth component from Scalar." << std::endl; TryVector4(array1, array2, array3, MakeInputArray(3)); std::cout << " Fourth component from Vector4." << std::endl; - TryVector4(array1, array2, array3, MakeInputArray>(3)); + TryVector4(array1, array2, array3, MakeInputArray(3)); } template @@ -197,7 +197,7 @@ void TryVector2(vtkm::cont::ArrayHandle array1, std::cout << " Third component from Scalar." << std::endl; TryVector3(array1, array2, MakeInputArray(2)); std::cout << " Third component from Vector2." << std::endl; - TryVector3(array1, array2, MakeInputArray>(2)); + TryVector3(array1, array2, MakeInputArray(2)); } template @@ -216,7 +216,7 @@ void TryVector1(vtkm::cont::ArrayHandle array1) std::cout << " Second component from Scalar." << std::endl; TryVector2(array1, MakeInputArray(1)); std::cout << " Second component from Vector4." << std::endl; - TryVector2(array1, MakeInputArray>(1)); + TryVector2(array1, MakeInputArray(1)); } void TryVector() @@ -226,7 +226,7 @@ void TryVector() std::cout << " First component from Scalar." << std::endl; TryVector1(MakeInputArray(0)); std::cout << " First component from Vector3." << std::endl; - TryVector1(MakeInputArray>(0)); + TryVector1(MakeInputArray(0)); } void TrySpecialArrays() diff --git a/vtkm/cont/testing/UnitTestArrayHandleSwizzle.cxx b/vtkm/cont/testing/UnitTestArrayHandleSwizzle.cxx index 04dd4e42a..de4747881 100644 --- a/vtkm/cont/testing/UnitTestArrayHandleSwizzle.cxx +++ b/vtkm/cont/testing/UnitTestArrayHandleSwizzle.cxx @@ -317,7 +317,7 @@ void TestArrayHandleSwizzle() void TestComponentMapValidator() { - vtkm::cont::ArrayHandle> dummy; + vtkm::cont::ArrayHandle dummy; // Repeat components: bool error = false; diff --git a/vtkm/cont/testing/UnitTestArrayHandleUniformPointCoordinates.cxx b/vtkm/cont/testing/UnitTestArrayHandleUniformPointCoordinates.cxx index 4d4078216..a93da2b18 100644 --- a/vtkm/cont/testing/UnitTestArrayHandleUniformPointCoordinates.cxx +++ b/vtkm/cont/testing/UnitTestArrayHandleUniformPointCoordinates.cxx @@ -15,7 +15,7 @@ namespace { -using Vector3 = vtkm::Vec; +using Vector3 = vtkm::Vec3f; const vtkm::Id3 DIMENSIONS(16, 18, 5); const vtkm::Id NUM_POINTS = 1440; diff --git a/vtkm/cont/testing/UnitTestCellLocatorGeneral.cxx b/vtkm/cont/testing/UnitTestCellLocatorGeneral.cxx index d21be875c..fa3d8a896 100644 --- a/vtkm/cont/testing/UnitTestCellLocatorGeneral.cxx +++ b/vtkm/cont/testing/UnitTestCellLocatorGeneral.cxx @@ -28,7 +28,7 @@ namespace std::default_random_engine RandomGenerator; -using PointType = vtkm::Vec; +using PointType = vtkm::Vec3f; //----------------------------------------------------------------------------- vtkm::cont::DataSet MakeTestDataSetUniform() @@ -150,10 +150,10 @@ public: using ExecutionSignature = void(_1, _2, _3, _4); template - VTKM_EXEC void operator()(const vtkm::Vec& point, + VTKM_EXEC void operator()(const vtkm::Vec3f& point, const LocatorType& locator, vtkm::Id& cellId, - vtkm::Vec& pcoords) const + vtkm::Vec3f& pcoords) const { locator->FindCell(point, cellId, pcoords, *this); } diff --git a/vtkm/cont/testing/UnitTestDataSetPermutation.cxx b/vtkm/cont/testing/UnitTestDataSetPermutation.cxx index e3d9f3049..14b73973f 100644 --- a/vtkm/cont/testing/UnitTestDataSetPermutation.cxx +++ b/vtkm/cont/testing/UnitTestDataSetPermutation.cxx @@ -46,7 +46,7 @@ bool TestArrayHandle(const vtkm::cont::ArrayHandle& ah, inline vtkm::cont::DataSet make_SingleTypeDataSet() { - using CoordType = vtkm::Vec; + using CoordType = vtkm::Vec3f_32; std::vector coordinates; coordinates.push_back(CoordType(0, 0, 0)); coordinates.push_back(CoordType(1, 0, 0)); diff --git a/vtkm/cont/testing/UnitTestDataSetRectilinear.cxx b/vtkm/cont/testing/UnitTestDataSetRectilinear.cxx index 38203fbdb..8bafd262f 100644 --- a/vtkm/cont/testing/UnitTestDataSetRectilinear.cxx +++ b/vtkm/cont/testing/UnitTestDataSetRectilinear.cxx @@ -89,8 +89,7 @@ static void TwoDimRectilinearTest() vtkm::Id cells[2][4] = { { 0, 1, 4, 3 }, { 1, 2, 5, 4 } }; for (vtkm::Id cellIndex = 0; cellIndex < 2; cellIndex++) { - vtkm::Vec pointIds = - pointToCell.GetIndices(pointToCell.FlatToLogicalToIndex(cellIndex)); + vtkm::Id4 pointIds = pointToCell.GetIndices(pointToCell.FlatToLogicalToIndex(cellIndex)); for (vtkm::IdComponent localPointIndex = 0; localPointIndex < 4; localPointIndex++) { VTKM_TEST_ASSERT(pointIds[localPointIndex] == cells[cellIndex][localPointIndex], diff --git a/vtkm/cont/testing/UnitTestDataSetUniform.cxx b/vtkm/cont/testing/UnitTestDataSetUniform.cxx index 047c6d490..96dfd437c 100644 --- a/vtkm/cont/testing/UnitTestDataSetUniform.cxx +++ b/vtkm/cont/testing/UnitTestDataSetUniform.cxx @@ -92,8 +92,7 @@ static void TwoDimUniformTest() vtkm::Id cells[2][4] = { { 0, 1, 4, 3 }, { 1, 2, 5, 4 } }; for (vtkm::Id cellIndex = 0; cellIndex < 2; cellIndex++) { - vtkm::Vec pointIds = - pointToCell.GetIndices(pointToCell.FlatToLogicalToIndex(cellIndex)); + vtkm::Id4 pointIds = pointToCell.GetIndices(pointToCell.FlatToLogicalToIndex(cellIndex)); for (vtkm::IdComponent localPointIndex = 0; localPointIndex < 4; localPointIndex++) { VTKM_TEST_ASSERT(pointIds[localPointIndex] == cells[cellIndex][localPointIndex], diff --git a/vtkm/cont/testing/UnitTestFieldRangeCompute.cxx b/vtkm/cont/testing/UnitTestFieldRangeCompute.cxx index 439257a0a..76a5b4cf6 100644 --- a/vtkm/cont/testing/UnitTestFieldRangeCompute.cxx +++ b/vtkm/cont/testing/UnitTestFieldRangeCompute.cxx @@ -146,12 +146,12 @@ static void TestFieldRangeCompute() TryRangeComputeDS(0, 1000); TryRangeComputeDS(-1024, 1024); - TryRangeComputeDS>(vtkm::make_Vec(1024, 0, -1024), - vtkm::make_Vec(2048, 2048, 2048)); + TryRangeComputeDS(vtkm::make_Vec(1024, 0, -1024), + vtkm::make_Vec(2048, 2048, 2048)); TryRangeComputeMB(0, 1000); TryRangeComputeMB(-1024, 1024); - TryRangeComputeMB>(vtkm::make_Vec(1024, 0, -1024), - vtkm::make_Vec(2048, 2048, 2048)); + TryRangeComputeMB(vtkm::make_Vec(1024, 0, -1024), + vtkm::make_Vec(2048, 2048, 2048)); }; int UnitTestFieldRangeCompute(int argc, char* argv[]) diff --git a/vtkm/cont/testing/UnitTestFieldRangeGlobalCompute.cxx b/vtkm/cont/testing/UnitTestFieldRangeGlobalCompute.cxx index c2c63ee3b..93340b2f7 100644 --- a/vtkm/cont/testing/UnitTestFieldRangeGlobalCompute.cxx +++ b/vtkm/cont/testing/UnitTestFieldRangeGlobalCompute.cxx @@ -193,12 +193,12 @@ static void TestFieldRangeGlobalCompute() TryRangeGlobalComputeDS(0, 1000); TryRangeGlobalComputeDS(-1024, 1024); - TryRangeGlobalComputeDS>(vtkm::make_Vec(1024, 0, -1024), - vtkm::make_Vec(2048, 2048, 2048)); + TryRangeGlobalComputeDS(vtkm::make_Vec(1024, 0, -1024), + vtkm::make_Vec(2048, 2048, 2048)); TryRangeGlobalComputeMB(0, 1000); TryRangeGlobalComputeMB(-1024, 1024); - TryRangeGlobalComputeMB>(vtkm::make_Vec(1024, 0, -1024), - vtkm::make_Vec(2048, 2048, 2048)); + TryRangeGlobalComputeMB(vtkm::make_Vec(1024, 0, -1024), + vtkm::make_Vec(2048, 2048, 2048)); }; } diff --git a/vtkm/cont/testing/UnitTestSerializationArrayHandle.cxx b/vtkm/cont/testing/UnitTestSerializationArrayHandle.cxx index 28d24679d..55763fc1e 100644 --- a/vtkm/cont/testing/UnitTestSerializationArrayHandle.cxx +++ b/vtkm/cont/testing/UnitTestSerializationArrayHandle.cxx @@ -64,8 +64,7 @@ inline void RunTest(const T& obj) //----------------------------------------------------------------------------- constexpr vtkm::Id ArraySize = 10; -using TestTypesList = - vtkm::ListTagBase>; +using TestTypesList = vtkm::ListTagBase; template inline vtkm::cont::VariantArrayHandleBase> @@ -314,11 +313,10 @@ struct TestArrayHandleSwizzle template void operator()(T) const { - static const vtkm::Vec map2s[6] = { { 0, 1 }, { 0, 2 }, { 1, 0 }, - { 1, 2 }, { 2, 0 }, { 2, 1 } }; - static const vtkm::Vec map3s[6] = { - { 0, 1, 2 }, { 0, 2, 1 }, { 1, 0, 2 }, { 1, 2, 0 }, { 2, 0, 1 }, { 2, 1, 0 } - }; + static const vtkm::IdComponent2 map2s[6] = { { 0, 1 }, { 0, 2 }, { 1, 0 }, + { 1, 2 }, { 2, 0 }, { 2, 1 } }; + static const vtkm::IdComponent3 map3s[6] = { { 0, 1, 2 }, { 0, 2, 1 }, { 1, 0, 2 }, + { 1, 2, 0 }, { 2, 0, 1 }, { 2, 1, 0 } }; auto numOutComps = RandomValue::Make(2, 3); switch (numOutComps) @@ -394,8 +392,8 @@ struct TestArrayHandleTransform vtkm::cont::ArrayHandleUniformPointCoordinates MakeRandomArrayHandleUniformPointCoordinates() { auto dimensions = RandomValue::Make(1, 3); - auto origin = RandomValue>::Make(); - auto spacing = RandomValue>::Make(0.1f, 10.0f); + auto origin = RandomValue::Make(); + auto spacing = RandomValue::Make(0.1f, 10.0f); return vtkm::cont::ArrayHandleUniformPointCoordinates(dimensions, origin, spacing); } @@ -425,8 +423,8 @@ void TestArrayHandleVirtualCoordinates() RandomArrayHandle::Make(ArraySize))); break; default: - array = vtkm::cont::ArrayHandleVirtualCoordinates( - RandomArrayHandle>::Make(ArraySize)); + array = + vtkm::cont::ArrayHandleVirtualCoordinates(RandomArrayHandle::Make(ArraySize)); break; } diff --git a/vtkm/cont/testing/UnitTestVariantArrayHandle.cxx b/vtkm/cont/testing/UnitTestVariantArrayHandle.cxx index 049c1f105..35e13c7a5 100644 --- a/vtkm/cont/testing/UnitTestVariantArrayHandle.cxx +++ b/vtkm/cont/testing/UnitTestVariantArrayHandle.cxx @@ -519,9 +519,9 @@ void TestVariantArrayHandle() std::cout << "*** vtkm::Float64 *****************" << std::endl; TryDefaultType(vtkm::Float64()); std::cout << "*** vtkm::Vec **********" << std::endl; - TryDefaultType(vtkm::Vec()); + TryDefaultType(vtkm::Vec3f_32()); std::cout << "*** vtkm::Vec **********" << std::endl; - TryDefaultType(vtkm::Vec()); + TryDefaultType(vtkm::Vec3f_64()); std::cout << "Try exemplar VTK-m types." << std::endl; vtkm::testing::Testing::TryTypes(TryBasicVTKmType()); diff --git a/vtkm/exec/BoundaryState.h b/vtkm/exec/BoundaryState.h index e6f3c5c7c..599202186 100644 --- a/vtkm/exec/BoundaryState.h +++ b/vtkm/exec/BoundaryState.h @@ -103,7 +103,7 @@ struct BoundaryState /// within the bounds of the cell set. Returns false if the neighbor falls /// outside of the boundary of the data. /// - VTKM_EXEC bool IsNeighborInBoundary(const vtkm::Vec& neighbor) const + VTKM_EXEC bool IsNeighborInBoundary(const vtkm::IdComponent3& neighbor) const { return this->IsNeighborInXBoundary(neighbor[0]) && this->IsNeighborInYBoundary(neighbor[1]) && this->IsNeighborInZBoundary(neighbor[2]); @@ -111,10 +111,10 @@ struct BoundaryState /// Returns the minimum neighborhood indices that are within the bounds of the data. /// - VTKM_EXEC vtkm::Vec MinNeighborIndices(vtkm::IdComponent radius) const + VTKM_EXEC vtkm::IdComponent3 MinNeighborIndices(vtkm::IdComponent radius) const { VTKM_ASSERT(radius >= 0); - vtkm::Vec minIndices; + vtkm::IdComponent3 minIndices; for (vtkm::IdComponent component = 0; component < 3; ++component) { @@ -133,10 +133,10 @@ struct BoundaryState /// Returns the minimum neighborhood indices that are within the bounds of the data. /// - VTKM_EXEC vtkm::Vec MaxNeighborIndices(vtkm::IdComponent radius) const + VTKM_EXEC vtkm::IdComponent3 MaxNeighborIndices(vtkm::IdComponent radius) const { VTKM_ASSERT(radius >= 0); - vtkm::Vec maxIndices; + vtkm::IdComponent3 maxIndices; for (vtkm::IdComponent component = 0; component < 3; ++component) { @@ -161,8 +161,7 @@ struct BoundaryState /// index that is past the minimum x range of the data, the index at the minimum x boundary is /// returned. /// - VTKM_EXEC vtkm::Id3 NeighborIndexToFullIndexClamp( - const vtkm::Vec& neighbor) const + VTKM_EXEC vtkm::Id3 NeighborIndexToFullIndexClamp(const vtkm::IdComponent3& neighbor) const { vtkm::Id3 fullIndex = this->IJK + neighbor; @@ -184,18 +183,17 @@ struct BoundaryState /// the minimum x range of the data, the neighbor index of the minimum x /// boundary is returned. /// - VTKM_EXEC vtkm::Vec ClampNeighborIndex( - const vtkm::Vec& neighbor) const + VTKM_EXEC vtkm::IdComponent3 ClampNeighborIndex(const vtkm::IdComponent3& neighbor) const { const vtkm::Id3 fullIndex = this->IJK + neighbor; const vtkm::Id3 clampedFullIndex = vtkm::Max(vtkm::Id3(0), vtkm::Min(this->PointDimensions - vtkm::Id3(1), fullIndex)); - return vtkm::Vec{ clampedFullIndex - this->IJK }; + return vtkm::IdComponent3{ clampedFullIndex - this->IJK }; } - VTKM_EXEC vtkm::Vec ClampNeighborIndex(vtkm::IdComponent neighborI, - vtkm::IdComponent neighborJ, - vtkm::IdComponent neighborK) const + VTKM_EXEC vtkm::IdComponent3 ClampNeighborIndex(vtkm::IdComponent neighborI, + vtkm::IdComponent neighborJ, + vtkm::IdComponent neighborK) const { return this->ClampNeighborIndex(vtkm::make_Vec(neighborI, neighborJ, neighborK)); } @@ -208,8 +206,7 @@ struct BoundaryState /// neighbor index that is past the minimum x range of the data, the index at the minimum x /// boundary is returned. /// - VTKM_EXEC vtkm::Id NeighborIndexToFlatIndexClamp( - const vtkm::Vec& neighbor) const + VTKM_EXEC vtkm::Id NeighborIndexToFlatIndexClamp(const vtkm::IdComponent3& neighbor) const { vtkm::Id3 full = this->NeighborIndexToFullIndexClamp(neighbor); diff --git a/vtkm/exec/CellDerivative.h b/vtkm/exec/CellDerivative.h index 575ecb484..cdc52b1a7 100644 --- a/vtkm/exec/CellDerivative.h +++ b/vtkm/exec/CellDerivative.h @@ -253,7 +253,7 @@ template CellDerivativeFor2DCellFinish( const vtkm::Vec& field, const vtkm::Matrix& LUFactorization, - const vtkm::Vec& LUPermutation, + const vtkm::IdComponent2& LUPermutation, const vtkm::Vec& pcoords, const vtkm::exec::internal::Space2D& space, CellShapeTag, @@ -274,7 +274,7 @@ template CellDerivativeFor2DCellFinish( const vtkm::Vec& field, const vtkm::Matrix& LUFactorization, - const vtkm::Vec& LUPermutation, + const vtkm::IdComponent2& LUPermutation, const vtkm::Vec& pcoords, const vtkm::exec::internal::Space2D& space, CellShapeTag, @@ -315,7 +315,7 @@ template CellDerivativeFor2DCellFinish( const vtkm::Vec& field, const vtkm::Matrix& LUFactorization, - const vtkm::Vec& LUPermutation, + const vtkm::IdComponent2& LUPermutation, const vtkm::Vec& pcoords, const vtkm::exec::internal::Space2D& space, CellShapeTag, @@ -382,7 +382,7 @@ VTKM_EXEC vtkm::Vec CellDerivativeFor2D // field, the factorization can be reused for each component of the vector // field. Thus, we are going to call the internals of SolveLinearSystem // ourselves to do the factorization and then apply it to all components. - vtkm::Vec permutation; + vtkm::IdComponent2 permutation; BaseFieldType inversionParity; // Unused vtkm::detail::MatrixLUPFactor(jacobianTranspose, permutation, inversionParity, valid); // MatrixLUPFactor does in place factorization. jacobianTranspose is now the @@ -631,7 +631,7 @@ template VTKM_EXEC vtkm::Vec TriangleDerivativeFinish( const vtkm::Vec& field, const vtkm::Matrix& LUFactorization, - const vtkm::Vec& LUPermutation, + const vtkm::IdComponent3& LUPermutation, vtkm::TypeTraitsScalarTag) { // Finish solving linear equation. See TriangleDerivative implementation @@ -645,7 +645,7 @@ template VTKM_EXEC vtkm::Vec TriangleDerivativeFinish( const vtkm::Vec& field, const vtkm::Matrix& LUFactorization, - const vtkm::Vec& LUPermutation, + const vtkm::IdComponent3& LUPermutation, vtkm::TypeTraitsVectorTag) { using FieldTraits = vtkm::VecTraits; @@ -679,7 +679,7 @@ template VTKM_EXEC vtkm::Vec TriangleDerivativeFinish( const vtkm::Vec& field, const vtkm::Matrix& LUFactorization, - const vtkm::Vec& LUPermutation, + const vtkm::IdComponent3& LUPermutation, vtkm::TypeTraitsMatrixTag) { return TriangleDerivativeFinish( @@ -738,7 +738,7 @@ VTKM_EXEC vtkm::Vec TriangleDerivative(const vtkm::Vec permutation; + vtkm::IdComponent3 permutation; BaseComponentType inversionParity; // Unused vtkm::detail::MatrixLUPFactor(A, permutation, inversionParity, valid); // MatrixLUPFactor does in place factorization. A is now the LU factorization. @@ -935,7 +935,7 @@ template VTKM_EXEC vtkm::Vec TetraDerivativeFinish( const vtkm::Vec& field, const vtkm::Matrix& LUFactorization, - const vtkm::Vec& LUPermutation, + const vtkm::IdComponent3& LUPermutation, vtkm::TypeTraitsScalarTag) { // Finish solving linear equation. See TriangleDerivative implementation @@ -949,7 +949,7 @@ template VTKM_EXEC vtkm::Vec TetraDerivativeFinish( const vtkm::Vec& field, const vtkm::Matrix& LUFactorization, - const vtkm::Vec& LUPermutation, + const vtkm::IdComponent3& LUPermutation, vtkm::TypeTraitsVectorTag) { using FieldTraits = vtkm::VecTraits; @@ -984,7 +984,7 @@ template VTKM_EXEC vtkm::Vec TetraDerivativeFinish( const vtkm::Vec& field, const vtkm::Matrix& LUFactorization, - const vtkm::Vec& LUPermutation, + const vtkm::IdComponent3& LUPermutation, vtkm::TypeTraitsMatrixTag) { return TetraDerivativeFinish(field, LUFactorization, LUPermutation, vtkm::TypeTraitsVectorTag()); @@ -1041,7 +1041,7 @@ VTKM_EXEC vtkm::Vec TetraDerivative(const vtkm::Vec& // field, the factorization can be reused for each component of the vector // field. Thus, we are going to call the internals of SolveLinearSystem // ourselves to do the factorization and then apply it to all components. - vtkm::Vec permutation; + vtkm::IdComponent3 permutation; BaseComponentType inversionParity; // Unused vtkm::detail::MatrixLUPFactor(A, permutation, inversionParity, valid); // MatrixLUPFactor does in place factorization. A is now the LU factorization. diff --git a/vtkm/exec/CellInterpolate.h b/vtkm/exec/CellInterpolate.h index 45eb5f58d..35bfa4bf9 100644 --- a/vtkm/exec/CellInterpolate.h +++ b/vtkm/exec/CellInterpolate.h @@ -182,13 +182,12 @@ VTKM_EXEC typename FieldVecType::ComponentType CellInterpolate( } template -VTKM_EXEC vtkm::Vec CellInterpolate( - const vtkm::VecAxisAlignedPointCoordinates<1>& field, - const vtkm::Vec& pcoords, - vtkm::CellShapeTagLine, - const vtkm::exec::FunctorBase&) +VTKM_EXEC vtkm::Vec3f CellInterpolate(const vtkm::VecAxisAlignedPointCoordinates<1>& field, + const vtkm::Vec& pcoords, + vtkm::CellShapeTagLine, + const vtkm::exec::FunctorBase&) { - using T = vtkm::Vec; + using T = vtkm::Vec3f; const T& origin = field.GetOrigin(); const T& spacing = field.GetSpacing(); @@ -229,11 +228,10 @@ VTKM_EXEC typename FieldVecType::ComponentType CellInterpolate( } template -VTKM_EXEC vtkm::Vec CellInterpolate( - const vtkm::VecAxisAlignedPointCoordinates<1>& field, - const vtkm::Vec& pcoords, - vtkm::CellShapeTagPolyLine, - const vtkm::exec::FunctorBase& worklet) +VTKM_EXEC vtkm::Vec3f CellInterpolate(const vtkm::VecAxisAlignedPointCoordinates<1>& field, + const vtkm::Vec& pcoords, + vtkm::CellShapeTagPolyLine, + const vtkm::exec::FunctorBase& worklet) { const vtkm::IdComponent numPoints = field.GetNumberOfComponents(); VTKM_ASSERT(numPoints >= 1); @@ -246,7 +244,7 @@ VTKM_EXEC vtkm::Vec CellInterpolate( return CellInterpolate(field, pcoords, vtkm::CellShapeTagLine(), worklet); } - using T = vtkm::Vec; + using T = vtkm::Vec3f; const T& origin = field.GetOrigin(); const T& spacing = field.GetSpacing(); @@ -381,13 +379,12 @@ VTKM_EXEC typename FieldVecType::ComponentType CellInterpolate( } template -VTKM_EXEC vtkm::Vec CellInterpolate( - const vtkm::VecAxisAlignedPointCoordinates<2>& field, - const vtkm::Vec& pcoords, - vtkm::CellShapeTagQuad, - const vtkm::exec::FunctorBase&) +VTKM_EXEC vtkm::Vec3f CellInterpolate(const vtkm::VecAxisAlignedPointCoordinates<2>& field, + const vtkm::Vec& pcoords, + vtkm::CellShapeTagQuad, + const vtkm::exec::FunctorBase&) { - using T = vtkm::Vec; + using T = vtkm::Vec3f; const T& origin = field.GetOrigin(); const T& spacing = field.GetSpacing(); @@ -436,15 +433,14 @@ VTKM_EXEC typename FieldVecType::ComponentType CellInterpolate( } template -VTKM_EXEC vtkm::Vec CellInterpolate( - const vtkm::VecAxisAlignedPointCoordinates<3>& field, - const vtkm::Vec& pcoords, - vtkm::CellShapeTagHexahedron, - const vtkm::exec::FunctorBase&) +VTKM_EXEC vtkm::Vec3f CellInterpolate(const vtkm::VecAxisAlignedPointCoordinates<3>& field, + const vtkm::Vec& pcoords, + vtkm::CellShapeTagHexahedron, + const vtkm::exec::FunctorBase&) { - vtkm::Vec pcoordsCast(static_cast(pcoords[0]), - static_cast(pcoords[1]), - static_cast(pcoords[2])); + vtkm::Vec3f pcoordsCast(static_cast(pcoords[0]), + static_cast(pcoords[1]), + static_cast(pcoords[2])); return field.GetOrigin() + pcoordsCast * field.GetSpacing(); } diff --git a/vtkm/exec/CellLocator.h b/vtkm/exec/CellLocator.h index a5872773d..0eda282cf 100644 --- a/vtkm/exec/CellLocator.h +++ b/vtkm/exec/CellLocator.h @@ -29,9 +29,9 @@ public: } VTKM_EXEC - virtual void FindCell(const vtkm::Vec& point, + virtual void FindCell(const vtkm::Vec3f& point, vtkm::Id& cellId, - vtkm::Vec& parametric, + vtkm::Vec3f& parametric, const vtkm::exec::FunctorBase& worklet) const = 0; }; diff --git a/vtkm/exec/CellLocatorBoundingIntervalHierarchyExec.h b/vtkm/exec/CellLocatorBoundingIntervalHierarchyExec.h index 21376de5d..8597d080a 100644 --- a/vtkm/exec/CellLocatorBoundingIntervalHierarchyExec.h +++ b/vtkm/exec/CellLocatorBoundingIntervalHierarchyExec.h @@ -84,9 +84,9 @@ public: } VTKM_EXEC - void FindCell(const vtkm::Vec& point, + void FindCell(const vtkm::Vec3f& point, vtkm::Id& cellId, - vtkm::Vec& parametric, + vtkm::Vec3f& parametric, const vtkm::exec::FunctorBase& worklet) const override { cellId = -1; @@ -124,10 +124,10 @@ private: VTKM_EXEC void EnterNode(FindCellState& state, - const vtkm::Vec& point, + const vtkm::Vec3f& point, vtkm::Id& cellId, vtkm::Id nodeIndex, - vtkm::Vec& parametric, + vtkm::Vec3f& parametric, const vtkm::exec::FunctorBase& worklet) const { VTKM_ASSERT(state == FindCellState::EnterNode); @@ -171,9 +171,7 @@ private: } VTKM_EXEC - void DescendLeftChild(FindCellState& state, - const vtkm::Vec& point, - vtkm::Id& nodeIndex) const + void DescendLeftChild(FindCellState& state, const vtkm::Vec3f& point, vtkm::Id& nodeIndex) const { VTKM_ASSERT(state == FindCellState::DescendLeftChild); @@ -193,9 +191,7 @@ private: } VTKM_EXEC - void DescendRightChild(FindCellState& state, - const vtkm::Vec& point, - vtkm::Id& nodeIndex) const + void DescendRightChild(FindCellState& state, const vtkm::Vec3f& point, vtkm::Id& nodeIndex) const { VTKM_ASSERT(state == FindCellState::DescendRightChild); @@ -214,8 +210,8 @@ private: } } - VTKM_EXEC vtkm::Id FindInLeaf(const vtkm::Vec& point, - vtkm::Vec& parametric, + VTKM_EXEC vtkm::Id FindInLeaf(const vtkm::Vec3f& point, + vtkm::Vec3f& parametric, const vtkm::exec::CellLocatorBoundingIntervalHierarchyNode& node, const vtkm::exec::FunctorBase& worklet) const { @@ -235,8 +231,8 @@ private: } template - VTKM_EXEC static bool IsPointInCell(const vtkm::Vec& point, - vtkm::Vec& parametric, + VTKM_EXEC static bool IsPointInCell(const vtkm::Vec3f& point, + vtkm::Vec3f& parametric, CellShapeTag cellShape, const CoordsType& cellPoints, const vtkm::exec::FunctorBase& worklet) diff --git a/vtkm/exec/CellLocatorRectilinearGrid.h b/vtkm/exec/CellLocatorRectilinearGrid.h index 8a3296ca9..d14146d5d 100644 --- a/vtkm/exec/CellLocatorRectilinearGrid.h +++ b/vtkm/exec/CellLocatorRectilinearGrid.h @@ -78,7 +78,7 @@ public: } VTKM_EXEC - inline bool IsInside(const vtkm::Vec& point) const + inline bool IsInside(const vtkm::Vec3f& point) const { bool inside = true; if (point[0] < this->MinPoint[0] || point[0] > this->MaxPoint[0]) @@ -91,9 +91,9 @@ public: } VTKM_EXEC - void FindCell(const vtkm::Vec& point, + void FindCell(const vtkm::Vec3f& point, vtkm::Id& cellId, - vtkm::Vec& parametric, + vtkm::Vec3f& parametric, const vtkm::exec::FunctorBase& worklet) const override { if (!IsInside(point)) @@ -103,7 +103,7 @@ public: } // Get the Cell Id from the point. - vtkm::Vec logicalCell(0, 0, 0); + vtkm::Id3 logicalCell(0, 0, 0); for (vtkm::Int32 dim = 0; dim < 3; ++dim) { // @@ -168,8 +168,8 @@ private: RectilinearPortalType Coords; AxisPortalType AxisPortals[3]; vtkm::Id3 PointDimensions; - vtkm::Vec MinPoint; - vtkm::Vec MaxPoint; + vtkm::Vec3f MinPoint; + vtkm::Vec3f MaxPoint; }; } //namespace exec } //namespace vtkm diff --git a/vtkm/exec/CellLocatorUniformGrid.h b/vtkm/exec/CellLocatorUniformGrid.h index c3e2caed8..5fda04d39 100644 --- a/vtkm/exec/CellLocatorUniformGrid.h +++ b/vtkm/exec/CellLocatorUniformGrid.h @@ -42,8 +42,8 @@ private: public: VTKM_CONT CellLocatorUniformGrid(const vtkm::Bounds& bounds, - const vtkm::Vec rangeTransform, - const vtkm::Vec cellDims, + const vtkm::Vec3f rangeTransform, + const vtkm::Id3 cellDims, const vtkm::cont::CellSetStructured<3>& cellSet, const vtkm::cont::ArrayHandleVirtualCoordinates& coords, DeviceAdapter) @@ -64,9 +64,9 @@ public: } VTKM_EXEC - void FindCell(const vtkm::Vec& point, + void FindCell(const vtkm::Vec3f& point, vtkm::Id& cellId, - vtkm::Vec& parametric, + vtkm::Vec3f& parametric, const vtkm::exec::FunctorBase& worklet) const override { if (!Bounds.Contains(point)) @@ -75,7 +75,7 @@ public: return; } // Get the Cell Id from the point. - vtkm::Vec logicalCell; + vtkm::Id3 logicalCell; logicalCell[0] = (point[0] == Bounds.X.Max) ? CellDims[0] - 1 : static_cast(vtkm::Floor((point[0] - Bounds.X.Min) * RangeTransform[0])); @@ -101,8 +101,8 @@ public: private: vtkm::Bounds Bounds; - vtkm::Vec RangeTransform; - vtkm::Vec CellDims; + vtkm::Vec3f RangeTransform; + vtkm::Id3 CellDims; vtkm::Id PlaneSize; vtkm::Id RowSize; CellSetPortal CellSet; diff --git a/vtkm/exec/ConnectivityExtrude.h b/vtkm/exec/ConnectivityExtrude.h index 7b76f4037..0910c63a4 100644 --- a/vtkm/exec/ConnectivityExtrude.h +++ b/vtkm/exec/ConnectivityExtrude.h @@ -201,7 +201,7 @@ typename ConnectivityExtrude::IndicesType ConnectivityExtrude::G vtkm::Id p0 = index[1]; vtkm::Id p1 = (p0 < (this->NumberOfPlanes - 1)) ? (p0 + 1) : 0; - vtkm::Vec pointIds1, pointIds2; + vtkm::Vec3i_32 pointIds1, pointIds2; for (int i = 0; i < 3; ++i) { pointIds1[i] = this->Connectivity.Get((tr * 3) + i); diff --git a/vtkm/exec/FieldNeighborhood.h b/vtkm/exec/FieldNeighborhood.h index b424a5203..b472493df 100644 --- a/vtkm/exec/FieldNeighborhood.h +++ b/vtkm/exec/FieldNeighborhood.h @@ -83,7 +83,7 @@ struct FieldNeighborhood } VTKM_EXEC - ValueType Get(const vtkm::Vec& ijk) const + ValueType Get(const vtkm::IdComponent3& ijk) const { return Portal.Get(this->Boundary->NeighborIndexToFullIndexClamp(ijk)); } diff --git a/vtkm/exec/ParametricCoordinates.h b/vtkm/exec/ParametricCoordinates.h index 8a58c3d85..f90285cfb 100644 --- a/vtkm/exec/ParametricCoordinates.h +++ b/vtkm/exec/ParametricCoordinates.h @@ -215,12 +215,12 @@ static inline VTKM_EXEC void ParametricCoordinatesCenter(vtkm::IdComponent numPo /// of points. /// template -static inline VTKM_EXEC vtkm::Vec ParametricCoordinatesCenter( +static inline VTKM_EXEC vtkm::Vec3f ParametricCoordinatesCenter( vtkm::IdComponent numPoints, CellShapeTag shape, const vtkm::exec::FunctorBase& worklet) { - vtkm::Vec pcoords; + vtkm::Vec3f pcoords; ParametricCoordinatesCenter(numPoints, pcoords, shape, worklet); return pcoords; } @@ -597,13 +597,13 @@ static inline VTKM_EXEC void ParametricCoordinatesPoint(vtkm::IdComponent numPoi /// the given number of points. /// template -static inline VTKM_EXEC vtkm::Vec ParametricCoordinatesPoint( +static inline VTKM_EXEC vtkm::Vec3f ParametricCoordinatesPoint( vtkm::IdComponent numPoints, vtkm::IdComponent pointIndex, CellShapeTag shape, const vtkm::exec::FunctorBase& worklet) { - vtkm::Vec pcoords; + vtkm::Vec3f pcoords; ParametricCoordinatesPoint(numPoints, pointIndex, pcoords, shape, worklet); return pcoords; } @@ -855,9 +855,9 @@ WorldCoordinatesToParametricCoordinatesQuad(const WorldCoordVector& pointWCoords } } // namespace detail -static inline VTKM_EXEC vtkm::Vec WorldCoordinatesToParametricCoordinates( +static inline VTKM_EXEC vtkm::Vec3f WorldCoordinatesToParametricCoordinates( const vtkm::VecAxisAlignedPointCoordinates<2>& pointWCoords, - const vtkm::Vec& wcoords, + const vtkm::Vec3f& wcoords, vtkm::CellShapeTagQuad, bool& success, const FunctorBase&) @@ -1141,9 +1141,9 @@ WorldCoordinatesToParametricCoordinates3D(const WorldCoordVector& pointWCoords, } } // detail -static inline VTKM_EXEC vtkm::Vec WorldCoordinatesToParametricCoordinates( +static inline VTKM_EXEC vtkm::Vec3f WorldCoordinatesToParametricCoordinates( const vtkm::VecAxisAlignedPointCoordinates<3>& pointWCoords, - const vtkm::Vec& wcoords, + const vtkm::Vec3f& wcoords, vtkm::CellShapeTagHexahedron, bool& success, const FunctorBase&) diff --git a/vtkm/exec/PointLocator.h b/vtkm/exec/PointLocator.h index f416772f5..4e67619d9 100644 --- a/vtkm/exec/PointLocator.h +++ b/vtkm/exec/PointLocator.h @@ -26,7 +26,7 @@ public: // troublesome with CUDA __host__ __device__ markup. } - VTKM_EXEC virtual void FindNearestNeighbor(const vtkm::Vec& queryPoint, + VTKM_EXEC virtual void FindNearestNeighbor(const vtkm::Vec3f& queryPoint, vtkm::Id& pointId, vtkm::FloatDefault& distanceSquared) const = 0; }; diff --git a/vtkm/exec/PointLocatorUniformGrid.h b/vtkm/exec/PointLocatorUniformGrid.h index ec28d3568..8cd22af38 100644 --- a/vtkm/exec/PointLocatorUniformGrid.h +++ b/vtkm/exec/PointLocatorUniformGrid.h @@ -37,9 +37,9 @@ public: PointLocatorUniformGrid() = default; - PointLocatorUniformGrid(const vtkm::Vec& min, - const vtkm::Vec& max, - const vtkm::Vec& dims, + PointLocatorUniformGrid(const vtkm::Vec3f& min, + const vtkm::Vec3f& max, + const vtkm::Id3& dims, const CoordPortalType& coords, const IdPortalType& pointIds, const IdPortalType& cellLower, @@ -64,7 +64,7 @@ public: /// \param nearestNeighborId Neareast neighbor in the training dataset for each points in /// the test set /// \param distance2 Squared distance between query points and their nearest neighbors. - VTKM_EXEC virtual void FindNearestNeighbor(const vtkm::Vec& queryPoint, + VTKM_EXEC virtual void FindNearestNeighbor(const vtkm::Vec3f& queryPoint, vtkm::Id& nearestNeighborId, vtkm::FloatDefault& distance2) const override { @@ -93,9 +93,9 @@ public: } private: - vtkm::Vec Min; - vtkm::Vec Dims; - vtkm::Vec Dxdydz; + vtkm::Vec3f Min; + vtkm::Id3 Dims; + vtkm::Vec3f Dxdydz; CoordPortalType Coords; @@ -103,7 +103,7 @@ private: IdPortalType CellLower; IdPortalType CellUpper; - VTKM_EXEC void FindInCell(const vtkm::Vec& queryPoint, + VTKM_EXEC void FindInCell(const vtkm::Vec3f& queryPoint, const vtkm::Id3& ijk, vtkm::Id& nearestNeighborId, vtkm::FloatDefault& nearestDistance2) const @@ -114,7 +114,7 @@ private: for (vtkm::Id index = lower; index < upper; index++) { vtkm::Id pointid = this->PointIds.Get(index); - vtkm::Vec point = this->Coords.Get(pointid); + vtkm::Vec3f point = this->Coords.Get(pointid); vtkm::FloatDefault distance2 = vtkm::MagnitudeSquared(point - queryPoint); if (distance2 < nearestDistance2) { @@ -124,7 +124,7 @@ private: } } - VTKM_EXEC void FindInBox(const vtkm::Vec& queryPoint, + VTKM_EXEC void FindInBox(const vtkm::Vec3f& queryPoint, const vtkm::Id3& boxCenter, vtkm::Id level, vtkm::Id& nearestNeighborId, @@ -164,7 +164,7 @@ private: } } - VTKM_EXEC void FindInPlane(const vtkm::Vec& queryPoint, + VTKM_EXEC void FindInPlane(const vtkm::Vec3f& queryPoint, const vtkm::Id3& planeCenter, const vtkm::Id3& div, const vtkm::Id3& mod, @@ -185,7 +185,7 @@ private: } } - VTKM_EXEC void FindInXPlane(const vtkm::Vec& queryPoint, + VTKM_EXEC void FindInXPlane(const vtkm::Vec3f& queryPoint, const vtkm::Id3& planeCenter, vtkm::Id level, vtkm::Id& nearestNeighborId, @@ -201,7 +201,7 @@ private: queryPoint, planeCenter, div, mod, origin, numInPlane, nearestNeighborId, nearestDistance2); } - VTKM_EXEC void FindInYPlane(const vtkm::Vec& queryPoint, + VTKM_EXEC void FindInYPlane(const vtkm::Vec3f& queryPoint, vtkm::Id3 planeCenter, vtkm::Id level, vtkm::Id& nearestNeighborId, @@ -217,7 +217,7 @@ private: queryPoint, planeCenter, div, mod, origin, numInPlane, nearestNeighborId, nearestDistance2); } - VTKM_EXEC void FindInZPlane(const vtkm::Vec& queryPoint, + VTKM_EXEC void FindInZPlane(const vtkm::Vec3f& queryPoint, vtkm::Id3 planeCenter, vtkm::Id level, vtkm::Id& nearestNeighborId, diff --git a/vtkm/exec/arg/FetchTagArrayTopologyMapIn.h b/vtkm/exec/arg/FetchTagArrayTopologyMapIn.h index 46e820aeb..ad456e83a 100644 --- a/vtkm/exec/arg/FetchTagArrayTopologyMapIn.h +++ b/vtkm/exec/arg/FetchTagArrayTopologyMapIn.h @@ -89,44 +89,42 @@ struct FetchArrayTopologyMapInImplementation }; static inline VTKM_EXEC vtkm::VecAxisAlignedPointCoordinates<1> make_VecAxisAlignedPointCoordinates( - const vtkm::Vec& origin, - const vtkm::Vec& spacing, + const vtkm::Vec3f& origin, + const vtkm::Vec3f& spacing, const vtkm::Vec& logicalId) { - vtkm::Vec offsetOrigin( + vtkm::Vec3f offsetOrigin( origin[0] + spacing[0] * static_cast(logicalId[0]), origin[1], origin[2]); return vtkm::VecAxisAlignedPointCoordinates<1>(offsetOrigin, spacing); } static inline VTKM_EXEC vtkm::VecAxisAlignedPointCoordinates<1> make_VecAxisAlignedPointCoordinates( - const vtkm::Vec& origin, - const vtkm::Vec& spacing, + const vtkm::Vec3f& origin, + const vtkm::Vec3f& spacing, vtkm::Id logicalId) { return make_VecAxisAlignedPointCoordinates(origin, spacing, vtkm::Vec(logicalId)); } static inline VTKM_EXEC vtkm::VecAxisAlignedPointCoordinates<2> make_VecAxisAlignedPointCoordinates( - const vtkm::Vec& origin, - const vtkm::Vec& spacing, - const vtkm::Vec& logicalId) + const vtkm::Vec3f& origin, + const vtkm::Vec3f& spacing, + const vtkm::Id2& logicalId) { - vtkm::Vec offsetOrigin( - origin[0] + spacing[0] * static_cast(logicalId[0]), - origin[1] + spacing[1] * static_cast(logicalId[1]), - origin[2]); + vtkm::Vec3f offsetOrigin(origin[0] + spacing[0] * static_cast(logicalId[0]), + origin[1] + spacing[1] * static_cast(logicalId[1]), + origin[2]); return vtkm::VecAxisAlignedPointCoordinates<2>(offsetOrigin, spacing); } static inline VTKM_EXEC vtkm::VecAxisAlignedPointCoordinates<3> make_VecAxisAlignedPointCoordinates( - const vtkm::Vec& origin, - const vtkm::Vec& spacing, - const vtkm::Vec& logicalId) + const vtkm::Vec3f& origin, + const vtkm::Vec3f& spacing, + const vtkm::Id3& logicalId) { - vtkm::Vec offsetOrigin( - origin[0] + spacing[0] * static_cast(logicalId[0]), - origin[1] + spacing[1] * static_cast(logicalId[1]), - origin[2] + spacing[2] * static_cast(logicalId[2])); + vtkm::Vec3f offsetOrigin(origin[0] + spacing[0] * static_cast(logicalId[0]), + origin[1] + spacing[1] * static_cast(logicalId[1]), + origin[2] + spacing[2] * static_cast(logicalId[2])); return vtkm::VecAxisAlignedPointCoordinates<3>(offsetOrigin, spacing); } diff --git a/vtkm/exec/arg/testing/UnitTestFetchArrayTopologyMapIn.cxx b/vtkm/exec/arg/testing/UnitTestFetchArrayTopologyMapIn.cxx index 441bf4e02..89435d060 100644 --- a/vtkm/exec/arg/testing/UnitTestFetchArrayTopologyMapIn.cxx +++ b/vtkm/exec/arg/testing/UnitTestFetchArrayTopologyMapIn.cxx @@ -149,8 +149,8 @@ void TryStructuredPointCoordinatesInvocation(const Invocation& invocation) vtkm::internal::ArrayPortalUniformPointCoordinates> fetch; - vtkm::Vec origin = TestValue(0, vtkm::Vec()); - vtkm::Vec spacing = TestValue(1, vtkm::Vec()); + vtkm::Vec3f origin = TestValue(0, vtkm::Vec3f()); + vtkm::Vec3f spacing = TestValue(1, vtkm::Vec3f()); { const vtkm::Id threadIndex = 0; @@ -216,9 +216,7 @@ void TryStructuredPointCoordinates() std::cout << "*** Fetching special case of uniform point coordinates. *****" << std::endl; vtkm::internal::ArrayPortalUniformPointCoordinates coordinates( - vtkm::Id3(3, 2, 2), - TestValue(0, vtkm::Vec()), - TestValue(1, vtkm::Vec())); + vtkm::Id3(3, 2, 2), TestValue(0, vtkm::Vec3f()), TestValue(1, vtkm::Vec3f())); std::cout << "3D" << std::endl; vtkm::internal::ConnectivityStructuredInternals<3> connectivityInternals3d; diff --git a/vtkm/exec/cuda/internal/ArrayPortalFromThrust.h b/vtkm/exec/cuda/internal/ArrayPortalFromThrust.h index d5c2a0e4b..7d6269300 100644 --- a/vtkm/exec/cuda/internal/ArrayPortalFromThrust.h +++ b/vtkm/exec/cuda/internal/ArrayPortalFromThrust.h @@ -50,40 +50,40 @@ template <> struct UseScalarTextureLoad : std::true_type {} //CUDA needs vec types converted to CUDA types ( float2, uint2), so we have a special //case for these vec texture loads. -template <> struct UseVecTextureLoads> : std::true_type {}; -template <> struct UseVecTextureLoads> : std::true_type {}; -template <> struct UseVecTextureLoads> : std::true_type {}; -template <> struct UseVecTextureLoads> : std::true_type {}; +template <> struct UseVecTextureLoads : std::true_type {}; +template <> struct UseVecTextureLoads : std::true_type {}; +template <> struct UseVecTextureLoads : std::true_type {}; +template <> struct UseVecTextureLoads : std::true_type {}; -template <> struct UseVecTextureLoads> : std::true_type {}; -template <> struct UseVecTextureLoads> : std::true_type {}; -template <> struct UseVecTextureLoads> : std::true_type {}; +template <> struct UseVecTextureLoads : std::true_type {}; +template <> struct UseVecTextureLoads : std::true_type {}; +template <> struct UseVecTextureLoads : std::true_type {}; //CUDA doesn't support loading 3 wide values through a texture unit by default, //so instead we fetch through texture three times and store the result //currently CUDA doesn't support texture loading of signed char's so that is why //you don't see vtkm::Int8 in any of the lists. -template <> struct UseMultipleScalarTextureLoads> : std::true_type {}; -template <> struct UseMultipleScalarTextureLoads> : std::true_type {}; -template <> struct UseMultipleScalarTextureLoads> : std::true_type {}; -template <> struct UseMultipleScalarTextureLoads> : std::true_type {}; -template <> struct UseMultipleScalarTextureLoads> : std::true_type {}; +template <> struct UseMultipleScalarTextureLoads : std::true_type {}; +template <> struct UseMultipleScalarTextureLoads : std::true_type {}; +template <> struct UseMultipleScalarTextureLoads : std::true_type {}; +template <> struct UseMultipleScalarTextureLoads : std::true_type {}; +template <> struct UseMultipleScalarTextureLoads : std::true_type {}; -template <> struct UseMultipleScalarTextureLoads> : std::true_type {}; -template <> struct UseMultipleScalarTextureLoads> : std::true_type {}; -template <> struct UseMultipleScalarTextureLoads> : std::true_type {}; -template <> struct UseMultipleScalarTextureLoads> : std::true_type {}; -template <> struct UseMultipleScalarTextureLoads> : std::true_type {}; -template <> struct UseMultipleScalarTextureLoads> : std::true_type {}; -template <> struct UseMultipleScalarTextureLoads> : std::true_type {}; +template <> struct UseMultipleScalarTextureLoads : std::true_type {}; +template <> struct UseMultipleScalarTextureLoads : std::true_type {}; +template <> struct UseMultipleScalarTextureLoads : std::true_type {}; +template <> struct UseMultipleScalarTextureLoads : std::true_type {}; +template <> struct UseMultipleScalarTextureLoads : std::true_type {}; +template <> struct UseMultipleScalarTextureLoads : std::true_type {}; +template <> struct UseMultipleScalarTextureLoads : std::true_type {}; -template <> struct UseMultipleScalarTextureLoads> : std::true_type {}; -template <> struct UseMultipleScalarTextureLoads> : std::true_type {}; -template <> struct UseMultipleScalarTextureLoads> : std::true_type {}; -template <> struct UseMultipleScalarTextureLoads> : std::true_type {}; -template <> struct UseMultipleScalarTextureLoads> : std::true_type {}; -template <> struct UseMultipleScalarTextureLoads> : std::true_type {}; +template <> struct UseMultipleScalarTextureLoads : std::true_type {}; +template <> struct UseMultipleScalarTextureLoads : std::true_type {}; +template <> struct UseMultipleScalarTextureLoads : std::true_type {}; +template <> struct UseMultipleScalarTextureLoads : std::true_type {}; +template <> struct UseMultipleScalarTextureLoads : std::true_type {}; +template <> struct UseMultipleScalarTextureLoads : std::true_type {}; // clang-format on //this T type is not one that is valid to be loaded through texture memory @@ -131,46 +131,46 @@ struct load_through_texture getAs(const vtkm::Vec* const data) + __device__ static vtkm::Vec2i_32 getAs(const vtkm::Vec2i_32* const data) { const int2 temp = __ldg((const int2*)data); - return vtkm::Vec(temp.x, temp.y); + return vtkm::Vec2i_32(temp.x, temp.y); } - __device__ static vtkm::Vec getAs(const vtkm::Vec* const data) + __device__ static vtkm::Vec2ui_32 getAs(const vtkm::Vec2ui_32* const data) { const uint2 temp = __ldg((const uint2*)data); - return vtkm::Vec(temp.x, temp.y); + return vtkm::Vec2ui_32(temp.x, temp.y); } - __device__ static vtkm::Vec getAs(const vtkm::Vec* const data) + __device__ static vtkm::Vec4i_32 getAs(const vtkm::Vec4i_32* const data) { const int4 temp = __ldg((const int4*)data); - return vtkm::Vec(temp.x, temp.y, temp.z, temp.w); + return vtkm::Vec4i_32(temp.x, temp.y, temp.z, temp.w); } - __device__ static vtkm::Vec getAs(const vtkm::Vec* const data) + __device__ static vtkm::Vec4ui_32 getAs(const vtkm::Vec4ui_32* const data) { const uint4 temp = __ldg((const uint4*)data); - return vtkm::Vec(temp.x, temp.y, temp.z, temp.w); + return vtkm::Vec4ui_32(temp.x, temp.y, temp.z, temp.w); } - __device__ static vtkm::Vec getAs(const vtkm::Vec* const data) + __device__ static vtkm::Vec2f_32 getAs(const vtkm::Vec2f_32* const data) { const float2 temp = __ldg((const float2*)data); - return vtkm::Vec(temp.x, temp.y); + return vtkm::Vec2f_32(temp.x, temp.y); } - __device__ static vtkm::Vec getAs(const vtkm::Vec* const data) + __device__ static vtkm::Vec4f_32 getAs(const vtkm::Vec4f_32* const data) { const float4 temp = __ldg((const float4*)data); - return vtkm::Vec(temp.x, temp.y, temp.z, temp.w); + return vtkm::Vec4f_32(temp.x, temp.y, temp.z, temp.w); } - __device__ static vtkm::Vec getAs(const vtkm::Vec* const data) + __device__ static vtkm::Vec2f_64 getAs(const vtkm::Vec2f_64* const data) { const double2 temp = __ldg((const double2*)data); - return vtkm::Vec(temp.x, temp.y); + return vtkm::Vec2f_64(temp.x, temp.y); } }; diff --git a/vtkm/exec/internal/TwoLevelUniformGridExecutionObject.h b/vtkm/exec/internal/TwoLevelUniformGridExecutionObject.h index 86319a84c..06515bf17 100644 --- a/vtkm/exec/internal/TwoLevelUniformGridExecutionObject.h +++ b/vtkm/exec/internal/TwoLevelUniformGridExecutionObject.h @@ -22,7 +22,7 @@ namespace twolevelgrid { using DimensionType = vtkm::Int16; using DimVec3 = vtkm::Vec; -using FloatVec3 = vtkm::Vec; +using FloatVec3 = vtkm::Vec3f; struct Grid { diff --git a/vtkm/exec/testing/UnitTestCellDerivative.cxx b/vtkm/exec/testing/UnitTestCellDerivative.cxx index e38fe473a..bcd927759 100644 --- a/vtkm/exec/testing/UnitTestCellDerivative.cxx +++ b/vtkm/exec/testing/UnitTestCellDerivative.cxx @@ -103,7 +103,7 @@ struct TestDerivativeFunctor vtkm::VecVariable fieldValues; for (vtkm::IdComponent pointIndex = 0; pointIndex < numPoints; pointIndex++) { - vtkm::Vec wcoords = worldCoordinates[pointIndex]; + vtkm::Vec3f wcoords = worldCoordinates[pointIndex]; FieldType value = static_cast(field.GetValue(wcoords)); fieldValues.Append(value); } @@ -115,11 +115,11 @@ struct TestDerivativeFunctor for (vtkm::IdComponent trial = 0; trial < 5; trial++) { // Generate a random pcoords that we know is in the cell. - vtkm::Vec pcoords(0); + vtkm::Vec3f pcoords(0); vtkm::FloatDefault totalWeight = 0; for (vtkm::IdComponent pointIndex = 0; pointIndex < numPoints; pointIndex++) { - vtkm::Vec pointPcoords = + vtkm::Vec3f pointPcoords = vtkm::exec::ParametricCoordinatesPoint(numPoints, pointIndex, shape, workletProxy); VTKM_TEST_ASSERT(!errorMessage.IsErrorRaised(), messageBuffer); vtkm::FloatDefault weight = randomDist(g_RandomGenerator); @@ -156,13 +156,13 @@ struct TestDerivativeFunctor vtkm::exec::FunctorBase workletProxy; workletProxy.SetErrorMessageBuffer(errorMessage); - vtkm::VecVariable, MAX_POINTS> worldCoordinates; + vtkm::VecVariable worldCoordinates; for (vtkm::IdComponent pointIndex = 0; pointIndex < numPoints; pointIndex++) { - vtkm::Vec pcoords = + vtkm::Vec3f pcoords = vtkm::exec::ParametricCoordinatesPoint(numPoints, pointIndex, shape, workletProxy); VTKM_TEST_ASSERT(!errorMessage.IsErrorRaised(), messageBuffer); - vtkm::Vec wcoords = ParametricToWorld(pcoords); + vtkm::Vec3f wcoords = ParametricToWorld(pcoords); VTKM_TEST_ASSERT(test_equal(pcoords, WorldToParametric(wcoords)), "Test world/parametric conversion broken."); worldCoordinates.Append(wcoords); @@ -282,19 +282,19 @@ void TestDerivative() std::cout << "======== Float64 ==========================" << std::endl; vtkm::testing::Testing::TryAllCellShapes(TestDerivativeFunctor()); std::cout << "======== Vec ===================" << std::endl; - vtkm::testing::Testing::TryAllCellShapes(TestDerivativeFunctor>()); + vtkm::testing::Testing::TryAllCellShapes(TestDerivativeFunctor()); std::cout << "======== Vec ===================" << std::endl; - vtkm::testing::Testing::TryAllCellShapes(TestDerivativeFunctor>()); + vtkm::testing::Testing::TryAllCellShapes(TestDerivativeFunctor()); std::uniform_real_distribution randomDist(-20.0, 20.0); - vtkm::Vec origin = vtkm::Vec(0.25f, 0.25f, 0.25f); - vtkm::Vec spacing = vtkm::Vec(2.0f, 2.0f, 2.0f); + vtkm::Vec3f origin = vtkm::Vec3f(0.25f, 0.25f, 0.25f); + vtkm::Vec3f spacing = vtkm::Vec3f(2.0f, 2.0f, 2.0f); LinearField scalarField; scalarField.OriginValue = randomDist(g_RandomGenerator); scalarField.Gradient = vtkm::make_Vec( randomDist(g_RandomGenerator), randomDist(g_RandomGenerator), randomDist(g_RandomGenerator)); - vtkm::Vec expectedScalarGradient = scalarField.Gradient; + vtkm::Vec3f_64 expectedScalarGradient = scalarField.Gradient; TestDerivativeFunctor testFunctorScalar; std::cout << "======== Uniform Point Coordinates 3D =====" << std::endl; @@ -315,7 +315,7 @@ void TestDerivative() scalarField, expectedScalarGradient); - LinearField> vectorField; + LinearField vectorField; vectorField.OriginValue = vtkm::make_Vec( randomDist(g_RandomGenerator), randomDist(g_RandomGenerator), randomDist(g_RandomGenerator)); vectorField.Gradient = vtkm::make_Vec( @@ -325,22 +325,22 @@ void TestDerivative() randomDist(g_RandomGenerator), randomDist(g_RandomGenerator), randomDist(g_RandomGenerator)), vtkm::make_Vec( randomDist(g_RandomGenerator), randomDist(g_RandomGenerator), randomDist(g_RandomGenerator))); - vtkm::Vec, 3> expectedVectorGradient = vectorField.Gradient; + vtkm::Vec expectedVectorGradient = vectorField.Gradient; - TestDerivativeFunctor> testFunctorVector; + TestDerivativeFunctor testFunctorVector; std::cout << "======== Uniform Point Coordinates 3D =====" << std::endl; testFunctorVector.DoTestWithWCoords(vtkm::CellShapeTagHexahedron(), vtkm::VecAxisAlignedPointCoordinates<3>(origin, spacing), vectorField, expectedVectorGradient); std::cout << "======== Uniform Point Coordinates 2D =====" << std::endl; - expectedVectorGradient[2] = vtkm::Vec(0.0); + expectedVectorGradient[2] = vtkm::Vec3f_64(0.0); testFunctorVector.DoTestWithWCoords(vtkm::CellShapeTagQuad(), vtkm::VecAxisAlignedPointCoordinates<2>(origin, spacing), vectorField, expectedVectorGradient); std::cout << "======== Uniform Point Coordinates 1D =====" << std::endl; - expectedVectorGradient[1] = vtkm::Vec(0.0); + expectedVectorGradient[1] = vtkm::Vec3f_64(0.0); testFunctorVector.DoTestWithWCoords(vtkm::CellShapeTagLine(), vtkm::VecAxisAlignedPointCoordinates<1>(origin, spacing), vectorField, diff --git a/vtkm/exec/testing/UnitTestCellEdgeFace.cxx b/vtkm/exec/testing/UnitTestCellEdgeFace.cxx index 928eb2199..fd8ffb942 100644 --- a/vtkm/exec/testing/UnitTestCellEdgeFace.cxx +++ b/vtkm/exec/testing/UnitTestCellEdgeFace.cxx @@ -24,7 +24,7 @@ namespace { -using EdgeType = vtkm::Vec; +using EdgeType = vtkm::IdComponent2; void MakeEdgeCanonical(EdgeType& edge) { diff --git a/vtkm/exec/testing/UnitTestCellInterpolate.cxx b/vtkm/exec/testing/UnitTestCellInterpolate.cxx index 39852270a..6d2830ce6 100644 --- a/vtkm/exec/testing/UnitTestCellInterpolate.cxx +++ b/vtkm/exec/testing/UnitTestCellInterpolate.cxx @@ -73,7 +73,7 @@ struct TestInterpolateFunctor std::cout << " Test interpolated value at each cell node." << std::endl; for (vtkm::IdComponent pointIndex = 0; pointIndex < numPoints; pointIndex++) { - vtkm::Vec pcoord = + vtkm::Vec3f pcoord = vtkm::exec::ParametricCoordinatesPoint(numPoints, pointIndex, shape, workletProxy); VTKM_TEST_ASSERT(!errorMessage.IsErrorRaised(), messageBuffer); FieldType interpolatedValue = @@ -87,8 +87,7 @@ struct TestInterpolateFunctor if (numPoints > 0) { std::cout << " Test interpolated value at cell center." << std::endl; - vtkm::Vec pcoord = - vtkm::exec::ParametricCoordinatesCenter(numPoints, shape, workletProxy); + vtkm::Vec3f pcoord = vtkm::exec::ParametricCoordinatesCenter(numPoints, shape, workletProxy); VTKM_TEST_ASSERT(!errorMessage.IsErrorRaised(), messageBuffer); FieldType interpolatedValue = vtkm::exec::CellInterpolate(fieldValues, pcoord, shape, workletProxy); @@ -145,13 +144,13 @@ void TestInterpolate() std::cout << "======== Float64 ==========================" << std::endl; vtkm::testing::Testing::TryAllCellShapes(TestInterpolateFunctor()); std::cout << "======== Vec ===================" << std::endl; - vtkm::testing::Testing::TryAllCellShapes(TestInterpolateFunctor>()); + vtkm::testing::Testing::TryAllCellShapes(TestInterpolateFunctor()); std::cout << "======== Vec ===================" << std::endl; - vtkm::testing::Testing::TryAllCellShapes(TestInterpolateFunctor>()); + vtkm::testing::Testing::TryAllCellShapes(TestInterpolateFunctor()); - TestInterpolateFunctor> testFunctor; - vtkm::Vec origin = TestValue(0, vtkm::Vec()); - vtkm::Vec spacing = TestValue(1, vtkm::Vec()); + TestInterpolateFunctor testFunctor; + vtkm::Vec3f origin = TestValue(0, vtkm::Vec3f()); + vtkm::Vec3f spacing = TestValue(1, vtkm::Vec3f()); std::cout << "======== Uniform Point Coordinates 1D =====" << std::endl; testFunctor.DoTestWithField(vtkm::CellShapeTagLine(), vtkm::VecAxisAlignedPointCoordinates<1>(origin, spacing)); diff --git a/vtkm/exec/testing/UnitTestParametricCoordinates.cxx b/vtkm/exec/testing/UnitTestParametricCoordinates.cxx index 6952c7d6b..c1e7caf8b 100644 --- a/vtkm/exec/testing/UnitTestParametricCoordinates.cxx +++ b/vtkm/exec/testing/UnitTestParametricCoordinates.cxx @@ -137,11 +137,11 @@ void TestPCoordsSample(const PointWCoordsType& pointWCoords, CellShapeTag shape) for (vtkm::IdComponent trial = 0; trial < 5; trial++) { // Generate a random pcoords that we know is in the cell. - vtkm::Vec pcoords(0); + vtkm::Vec3f pcoords(0); vtkm::FloatDefault totalWeight = 0; for (vtkm::IdComponent pointIndex = 0; pointIndex < numPoints; pointIndex++) { - vtkm::Vec pointPcoords = + vtkm::Vec3f pointPcoords = vtkm::exec::ParametricCoordinatesPoint(numPoints, pointIndex, shape, workletProxy); VTKM_TEST_ASSERT(!errorMessage.IsErrorRaised(), messageBuffer); vtkm::FloatDefault weight = randomDist(g_RandomGenerator); @@ -250,9 +250,9 @@ void TestAllPCoords() std::cout << "======== Rectilinear Shapes ===============" << std::endl; std::uniform_real_distribution randomDist(0.01f, 1.0f); - vtkm::Vec origin( + vtkm::Vec3f origin( randomDist(g_RandomGenerator), randomDist(g_RandomGenerator), randomDist(g_RandomGenerator)); - vtkm::Vec spacing( + vtkm::Vec3f spacing( randomDist(g_RandomGenerator), randomDist(g_RandomGenerator), randomDist(g_RandomGenerator)); TestPCoords(vtkm::VecAxisAlignedPointCoordinates<3>(origin, spacing), diff --git a/vtkm/filter/FieldToColors.hxx b/vtkm/filter/FieldToColors.hxx index 0abcb099b..0201c8f57 100644 --- a/vtkm/filter/FieldToColors.hxx +++ b/vtkm/filter/FieldToColors.hxx @@ -164,7 +164,7 @@ inline VTKM_CONT vtkm::cont::DataSet FieldToColors::DoExecute( using IsVec = typename vtkm::VecTraits::HasMultipleComponents; if (this->OutputMode == RGBA) { - vtkm::cont::ArrayHandle> output; + vtkm::cont::ArrayHandle output; bool ran = false; switch (this->InputMode) @@ -212,7 +212,7 @@ inline VTKM_CONT vtkm::cont::DataSet FieldToColors::DoExecute( } else { - vtkm::cont::ArrayHandle> output; + vtkm::cont::ArrayHandle output; bool ran = false; switch (this->InputMode) diff --git a/vtkm/filter/FilterDataSetWithField.hxx b/vtkm/filter/FilterDataSetWithField.hxx index 84fc5b164..7eb528716 100644 --- a/vtkm/filter/FilterDataSetWithField.hxx +++ b/vtkm/filter/FilterDataSetWithField.hxx @@ -103,8 +103,8 @@ inline VTKM_CONT vtkm::cont::DataSet FilterDataSetWithField::PrepareFor //determine the field type first using Traits = vtkm::filter::FilterTraits; - constexpr bool supportsVec3 = vtkm::ListContains>::value; + constexpr bool supportsVec3 = + vtkm::ListContains::value; using supportsCoordinateSystem = std::integral_constant; vtkm::cont::ConditionalCastAndCall(supportsCoordinateSystem(), field, diff --git a/vtkm/filter/FilterField.hxx b/vtkm/filter/FilterField.hxx index 5cd321794..d4fa3f821 100644 --- a/vtkm/filter/FilterField.hxx +++ b/vtkm/filter/FilterField.hxx @@ -101,8 +101,8 @@ inline VTKM_CONT vtkm::cont::DataSet FilterField::PrepareForExecution( vtkm::cont::DataSet result; using Traits = vtkm::filter::FilterTraits; - constexpr bool supportsVec3 = vtkm::ListContains>::value; + constexpr bool supportsVec3 = + vtkm::ListContains::value; using supportsCoordinateSystem = std::integral_constant; vtkm::cont::ConditionalCastAndCall(supportsCoordinateSystem(), diff --git a/vtkm/filter/GhostCellRemove.hxx b/vtkm/filter/GhostCellRemove.hxx index ec3bd770b..ee74613f6 100644 --- a/vtkm/filter/GhostCellRemove.hxx +++ b/vtkm/filter/GhostCellRemove.hxx @@ -55,14 +55,12 @@ private: }; template -VTKM_EXEC_CONT vtkm::Vec getLogical(const vtkm::Id& index, - const vtkm::Vec& cellDims); +VTKM_EXEC_CONT vtkm::Id3 getLogical(const vtkm::Id& index, const vtkm::Id3& cellDims); template <> -VTKM_EXEC_CONT vtkm::Vec getLogical<3>(const vtkm::Id& index, - const vtkm::Vec& cellDims) +VTKM_EXEC_CONT vtkm::Id3 getLogical<3>(const vtkm::Id& index, const vtkm::Id3& cellDims) { - vtkm::Vec res(0, 0, 0); + vtkm::Id3 res(0, 0, 0); res[0] = index % cellDims[0]; res[1] = (index / (cellDims[0])) % (cellDims[1]); res[2] = index / ((cellDims[0]) * (cellDims[1])); @@ -70,20 +68,18 @@ VTKM_EXEC_CONT vtkm::Vec getLogical<3>(const vtkm::Id& index, } template <> -VTKM_EXEC_CONT vtkm::Vec getLogical<2>(const vtkm::Id& index, - const vtkm::Vec& cellDims) +VTKM_EXEC_CONT vtkm::Id3 getLogical<2>(const vtkm::Id& index, const vtkm::Id3& cellDims) { - vtkm::Vec res(0, 0, 0); + vtkm::Id3 res(0, 0, 0); res[0] = index % cellDims[0]; res[1] = index / cellDims[0]; return res; } template <> -VTKM_EXEC_CONT vtkm::Vec getLogical<1>(const vtkm::Id& index, - const vtkm::Vec&) +VTKM_EXEC_CONT vtkm::Id3 getLogical<1>(const vtkm::Id& index, const vtkm::Id3&) { - vtkm::Vec res(0, 0, 0); + vtkm::Id3 res(0, 0, 0); res[0] = index; return res; } @@ -93,7 +89,7 @@ class RealMinMax : public vtkm::worklet::WorkletMapField { public: VTKM_CONT - RealMinMax(vtkm::Vec cellDims, bool removeAllGhost, vtkm::UInt8 removeType) + RealMinMax(vtkm::Id3 cellDims, bool removeAllGhost, vtkm::UInt8 removeType) : CellDims(cellDims) , RemoveAllGhost(removeAllGhost) , RemoveType(removeType) @@ -130,7 +126,7 @@ public: if ((RemoveAllGhost && value != 0) || (!RemoveAllGhost && (value != 0 && value | RemoveType))) return; - vtkm::Vec logical = getLogical(index, CellDims); + vtkm::Id3 logical = getLogical(index, CellDims); Min(atom, logical[0], 0); Min(atom, logical[1], 1); @@ -142,26 +138,26 @@ public: } private: - vtkm::Vec CellDims; + vtkm::Id3 CellDims; bool RemoveAllGhost; vtkm::UInt8 RemoveType; }; template -VTKM_EXEC_CONT bool checkRange(const vtkm::RangeId3& range, const vtkm::Vec& p); +VTKM_EXEC_CONT bool checkRange(const vtkm::RangeId3& range, const vtkm::Id3& p); template <> -VTKM_EXEC_CONT bool checkRange<1>(const vtkm::RangeId3& range, const vtkm::Vec& p) +VTKM_EXEC_CONT bool checkRange<1>(const vtkm::RangeId3& range, const vtkm::Id3& p) { return p[0] >= range.X.Min && p[0] <= range.X.Max; } template <> -VTKM_EXEC_CONT bool checkRange<2>(const vtkm::RangeId3& range, const vtkm::Vec& p) +VTKM_EXEC_CONT bool checkRange<2>(const vtkm::RangeId3& range, const vtkm::Id3& p) { return p[0] >= range.X.Min && p[0] <= range.X.Max && p[1] >= range.Y.Min && p[1] <= range.Y.Max; } template <> -VTKM_EXEC_CONT bool checkRange<3>(const vtkm::RangeId3& range, const vtkm::Vec& p) +VTKM_EXEC_CONT bool checkRange<3>(const vtkm::RangeId3& range, const vtkm::Id3& p) { return p[0] >= range.X.Min && p[0] <= range.X.Max && p[1] >= range.Y.Min && p[1] <= range.Y.Max && p[2] >= range.Z.Min && p[2] <= range.Z.Max; @@ -172,7 +168,7 @@ class Validate : public vtkm::worklet::WorkletMapField { public: VTKM_CONT - Validate(const vtkm::Vec& cellDims, + Validate(const vtkm::Id3& cellDims, bool removeAllGhost, vtkm::UInt8 removeType, const vtkm::RangeId3& range) @@ -200,7 +196,7 @@ public: } private: - vtkm::Vec CellDims; + vtkm::Id3 CellDims; bool RemoveAll; vtkm::UInt8 RemoveVal; vtkm::RangeId3 Range; @@ -211,7 +207,7 @@ bool CanStrip(const vtkm::cont::ArrayHandle& ghostField, bool removeAllGhost, vtkm::UInt8 removeType, vtkm::RangeId3& range, - const vtkm::Vec& cellDims, + const vtkm::Id3& cellDims, vtkm::Id size) { vtkm::cont::ArrayHandle minmax; diff --git a/vtkm/filter/Gradient.h b/vtkm/filter/Gradient.h index 40ebf2048..6fb4034e7 100644 --- a/vtkm/filter/Gradient.h +++ b/vtkm/filter/Gradient.h @@ -109,10 +109,8 @@ template <> class FilterTraits { public: - struct TypeListTagGradientInputs : vtkm::ListTagBase, - vtkm::Vec> + struct TypeListTagGradientInputs + : vtkm::ListTagBase { }; diff --git a/vtkm/filter/Lagrangian.h b/vtkm/filter/Lagrangian.h index be0256558..baaf188cc 100644 --- a/vtkm/filter/Lagrangian.h +++ b/vtkm/filter/Lagrangian.h @@ -96,8 +96,7 @@ template <> class FilterTraits { public: - struct TypeListTagLagrangian - : vtkm::ListTagBase, vtkm::Vec> + struct TypeListTagLagrangian : vtkm::ListTagBase { }; using InputFieldTypeList = TypeListTagLagrangian; diff --git a/vtkm/filter/Lagrangian.hxx b/vtkm/filter/Lagrangian.hxx index 257b2f7ef..fc079b5d7 100644 --- a/vtkm/filter/Lagrangian.hxx +++ b/vtkm/filter/Lagrangian.hxx @@ -31,8 +31,8 @@ #include static vtkm::Id cycle = 0; -static vtkm::cont::ArrayHandle> BasisParticles; -static vtkm::cont::ArrayHandle> BasisParticlesOriginal; +static vtkm::cont::ArrayHandle BasisParticles; +static vtkm::cont::ArrayHandle BasisParticlesOriginal; static vtkm::cont::ArrayHandle BasisParticlesValidity; class ValidityCheck : public vtkm::worklet::WorkletMapField @@ -181,9 +181,9 @@ inline void Lagrangian::InitializeUniformSeeds(const vtkm::cont::DataSet& input) for (int z = 0; z < this->SeedRes[2]; z++) { portal1.Set(count, - vtkm::Vec(bounds.X.Min + (x * x_spacing), - bounds.Y.Min + (y * y_spacing), - bounds.Z.Min + (z * z_spacing))); + vtkm::Vec3f_64(bounds.X.Min + (x * x_spacing), + bounds.Y.Min + (y * y_spacing), + bounds.Z.Min + (z * z_spacing))); portal2.Set(count, 1); count++; } diff --git a/vtkm/filter/MarchingCubes.hxx b/vtkm/filter/MarchingCubes.hxx index 86e78d3f6..a25ddb782 100644 --- a/vtkm/filter/MarchingCubes.hxx +++ b/vtkm/filter/MarchingCubes.hxx @@ -128,7 +128,7 @@ inline VTKM_CONT vtkm::cont::DataSet MarchingCubes::DoExecute( const vtkm::cont::CoordinateSystem& coords = input.GetCoordinateSystem(this->GetActiveCoordinateSystemIndex()); - using Vec3HandleType = vtkm::cont::ArrayHandle>; + using Vec3HandleType = vtkm::cont::ArrayHandle; Vec3HandleType vertices; Vec3HandleType normals; diff --git a/vtkm/filter/Pathline.h b/vtkm/filter/Pathline.h index 9c02f8730..2771fe51c 100644 --- a/vtkm/filter/Pathline.h +++ b/vtkm/filter/Pathline.h @@ -45,7 +45,7 @@ public: void SetNumberOfSteps(vtkm::Id n) { this->NumberOfSteps = n; } VTKM_CONT - void SetSeeds(vtkm::cont::ArrayHandle>& seeds); + void SetSeeds(vtkm::cont::ArrayHandle& seeds); template VTKM_CONT vtkm::cont::DataSet DoExecute( @@ -69,15 +69,14 @@ private: vtkm::worklet::particleadvection::ScalarType NextTime; vtkm::cont::DataSet NextDataSet; vtkm::Id NumberOfSteps; - vtkm::cont::ArrayHandle> Seeds; + vtkm::cont::ArrayHandle Seeds; }; template <> class FilterTraits { public: - struct TypeListTagPathline - : vtkm::ListTagBase, vtkm::Vec> + struct TypeListTagPathline : vtkm::ListTagBase { }; using InputFieldTypeList = TypeListTagPathline; diff --git a/vtkm/filter/Pathline.hxx b/vtkm/filter/Pathline.hxx index a439ae1b7..1bbb4a945 100644 --- a/vtkm/filter/Pathline.hxx +++ b/vtkm/filter/Pathline.hxx @@ -29,8 +29,7 @@ inline VTKM_CONT Pathline::Pathline() } //----------------------------------------------------------------------------- -inline VTKM_CONT void Pathline::SetSeeds( - vtkm::cont::ArrayHandle>& seeds) +inline VTKM_CONT void Pathline::SetSeeds(vtkm::cont::ArrayHandle& seeds) { this->Seeds = seeds; } diff --git a/vtkm/filter/SplitSharpEdges.hxx b/vtkm/filter/SplitSharpEdges.hxx index 7dfd1a911..d93152038 100644 --- a/vtkm/filter/SplitSharpEdges.hxx +++ b/vtkm/filter/SplitSharpEdges.hxx @@ -37,7 +37,7 @@ inline VTKM_CONT vtkm::cont::DataSet SplitSharpEdges::DoExecute( { // Get the cells and coordinates of the dataset const vtkm::cont::DynamicCellSet& cells = input.GetCellSet(this->GetActiveCellSetIndex()); - vtkm::cont::ArrayHandle> newCoords; + vtkm::cont::ArrayHandle newCoords; vtkm::cont::CellSetExplicit<> newCellset; this->Worklet.Run(vtkm::filter::ApplyPolicy(cells, policy), diff --git a/vtkm/filter/Streamline.h b/vtkm/filter/Streamline.h index a7b6d221a..fc4014a8a 100644 --- a/vtkm/filter/Streamline.h +++ b/vtkm/filter/Streamline.h @@ -37,7 +37,7 @@ public: void SetNumberOfSteps(vtkm::Id n) { this->NumberOfSteps = n; } VTKM_CONT - void SetSeeds(vtkm::cont::ArrayHandle>& seeds); + void SetSeeds(vtkm::cont::ArrayHandle& seeds); template VTKM_CONT vtkm::cont::DataSet DoExecute( @@ -58,15 +58,14 @@ private: vtkm::worklet::Streamline Worklet; vtkm::worklet::particleadvection::ScalarType StepSize; vtkm::Id NumberOfSteps; - vtkm::cont::ArrayHandle> Seeds; + vtkm::cont::ArrayHandle Seeds; }; template <> class FilterTraits { public: - struct TypeListTagStreamline - : vtkm::ListTagBase, vtkm::Vec> + struct TypeListTagStreamline : vtkm::ListTagBase { }; using InputFieldTypeList = TypeListTagStreamline; diff --git a/vtkm/filter/Streamline.hxx b/vtkm/filter/Streamline.hxx index b40de10f5..7e8f63047 100644 --- a/vtkm/filter/Streamline.hxx +++ b/vtkm/filter/Streamline.hxx @@ -28,8 +28,7 @@ inline VTKM_CONT Streamline::Streamline() } //----------------------------------------------------------------------------- -inline VTKM_CONT void Streamline::SetSeeds( - vtkm::cont::ArrayHandle>& seeds) +inline VTKM_CONT void Streamline::SetSeeds(vtkm::cont::ArrayHandle& seeds) { this->Seeds = seeds; } diff --git a/vtkm/filter/SurfaceNormals.hxx b/vtkm/filter/SurfaceNormals.hxx index 16697f606..4d703247d 100644 --- a/vtkm/filter/SurfaceNormals.hxx +++ b/vtkm/filter/SurfaceNormals.hxx @@ -78,7 +78,7 @@ inline vtkm::cont::DataSet SurfaceNormals::DoExecute( const auto& cellset = input.GetCellSet(this->GetActiveCellSetIndex()); - vtkm::cont::ArrayHandle> faceNormals; + vtkm::cont::ArrayHandle faceNormals; vtkm::worklet::FacetedSurfaceNormals faceted; faceted.SetNormalize(this->NormalizeCellNormals); faceted.Run(vtkm::filter::ApplyPolicy(cellset, policy), points, faceNormals); @@ -86,7 +86,7 @@ inline vtkm::cont::DataSet SurfaceNormals::DoExecute( vtkm::cont::DataSet result; if (this->GeneratePointNormals) { - vtkm::cont::ArrayHandle> pointNormals; + vtkm::cont::ArrayHandle pointNormals; vtkm::worklet::SmoothSurfaceNormals smooth; smooth.Run(vtkm::filter::ApplyPolicy(cellset, policy), faceNormals, pointNormals); diff --git a/vtkm/filter/testing/UnitTestCellAverageFilter.cxx b/vtkm/filter/testing/UnitTestCellAverageFilter.cxx index a96166a5f..e2143260a 100644 --- a/vtkm/filter/testing/UnitTestCellAverageFilter.cxx +++ b/vtkm/filter/testing/UnitTestCellAverageFilter.cxx @@ -51,7 +51,7 @@ void TestCellAverageRegular3D() VTKM_TEST_ASSERT(result.HasField("avgpos", vtkm::cont::Field::Association::CELL_SET), "Result field not present."); - vtkm::cont::ArrayHandle> resultPointArray; + vtkm::cont::ArrayHandle resultPointArray; vtkm::cont::Field resultPointField = result.GetField("avgpos", vtkm::cont::Field::Association::CELL_SET); resultPointField.GetData().CopyTo(resultPointArray); @@ -61,8 +61,8 @@ void TestCellAverageRegular3D() }; for (vtkm::Id i = 0; i < 4; ++i) { - vtkm::Vec expectedVec(expected[i][0], expected[i][1], expected[i][2]); - vtkm::Vec computedVec(resultPointArray.GetPortalConstControl().Get(i)); + vtkm::Vec3f expectedVec(expected[i][0], expected[i][1], expected[i][2]); + vtkm::Vec3f computedVec(resultPointArray.GetPortalConstControl().Get(i)); VTKM_TEST_ASSERT(test_equal(computedVec, expectedVec), "Wrong result for CellAverage worklet on 3D regular data"); } diff --git a/vtkm/filter/testing/UnitTestCellSetConnectivityFilter.cxx b/vtkm/filter/testing/UnitTestCellSetConnectivityFilter.cxx index 18f1720c9..285990216 100644 --- a/vtkm/filter/testing/UnitTestCellSetConnectivityFilter.cxx +++ b/vtkm/filter/testing/UnitTestCellSetConnectivityFilter.cxx @@ -90,10 +90,10 @@ vtkm::cont::DataSet MakeIsosurfaceTestDataSet(vtkm::Id3 dims) vtkm::cont::ArrayCopy(vtkm::cont::make_ArrayHandleCounting(0, 1, numCells), cellFieldArray); - vtkm::Vec origin(0.0f, 0.0f, 0.0f); - vtkm::Vec spacing(1.0f / static_cast(dims[0]), - 1.0f / static_cast(dims[2]), - 1.0f / static_cast(dims[1])); + vtkm::Vec3f origin(0.0f, 0.0f, 0.0f); + vtkm::Vec3f spacing(1.0f / static_cast(dims[0]), + 1.0f / static_cast(dims[2]), + 1.0f / static_cast(dims[1])); vtkm::cont::ArrayHandleUniformPointCoordinates coordinates(vdims, origin, spacing); dataSet.AddCoordinateSystem(vtkm::cont::CoordinateSystem("coordinates", coordinates)); diff --git a/vtkm/filter/testing/UnitTestCleanGrid.cxx b/vtkm/filter/testing/UnitTestCleanGrid.cxx index ca62d83b8..39452f033 100644 --- a/vtkm/filter/testing/UnitTestCleanGrid.cxx +++ b/vtkm/filter/testing/UnitTestCleanGrid.cxx @@ -38,11 +38,11 @@ void TestUniformGrid(vtkm::filter::CleanGrid clean) outCellSet.GetNumberOfPoints()); VTKM_TEST_ASSERT( outCellSet.GetNumberOfCells() == 2, "Wrong number of cells: ", outCellSet.GetNumberOfCells()); - vtkm::Vec cellIds; + vtkm::Id4 cellIds; outCellSet.GetIndices(0, cellIds); - VTKM_TEST_ASSERT((cellIds == vtkm::Vec(0, 1, 4, 3)), "Bad cell ids: ", cellIds); + VTKM_TEST_ASSERT((cellIds == vtkm::Id4(0, 1, 4, 3)), "Bad cell ids: ", cellIds); outCellSet.GetIndices(1, cellIds); - VTKM_TEST_ASSERT((cellIds == vtkm::Vec(1, 2, 5, 4)), "Bad cell ids: ", cellIds); + VTKM_TEST_ASSERT((cellIds == vtkm::Id4(1, 2, 5, 4)), "Bad cell ids: ", cellIds); vtkm::cont::ArrayHandle outPointField; outData.GetField("pointvar").GetData().CopyTo(outPointField); diff --git a/vtkm/filter/testing/UnitTestClipWithFieldFilter.cxx b/vtkm/filter/testing/UnitTestClipWithFieldFilter.cxx index ab389f602..5024de3ce 100644 --- a/vtkm/filter/testing/UnitTestClipWithFieldFilter.cxx +++ b/vtkm/filter/testing/UnitTestClipWithFieldFilter.cxx @@ -16,7 +16,7 @@ namespace { -using Coord3D = vtkm::Vec; +using Coord3D = vtkm::Vec3f; vtkm::cont::DataSet MakeTestDatasetExplicit() { diff --git a/vtkm/filter/testing/UnitTestClipWithImplicitFunctionFilter.cxx b/vtkm/filter/testing/UnitTestClipWithImplicitFunctionFilter.cxx index 8485f1d67..67716ca80 100644 --- a/vtkm/filter/testing/UnitTestClipWithImplicitFunctionFilter.cxx +++ b/vtkm/filter/testing/UnitTestClipWithImplicitFunctionFilter.cxx @@ -16,7 +16,7 @@ namespace { -using Coord3D = vtkm::Vec; +using Coord3D = vtkm::Vec3f; vtkm::cont::DataSet MakeTestDatasetStructured() { @@ -47,7 +47,7 @@ void TestClipStructured() vtkm::cont::DataSet ds = MakeTestDatasetStructured(); - vtkm::Vec center(1, 1, 0); + vtkm::Vec3f center(1, 1, 0); vtkm::FloatDefault radius(0.5); vtkm::filter::ClipWithImplicitFunction clip; @@ -86,7 +86,7 @@ void TestClipStructuredInverted() vtkm::cont::DataSet ds = MakeTestDatasetStructured(); - vtkm::Vec center(1, 1, 0); + vtkm::Vec3f center(1, 1, 0); vtkm::FloatDefault radius(0.5); vtkm::filter::ClipWithImplicitFunction clip; diff --git a/vtkm/filter/testing/UnitTestCoordinateSystemTransform.cxx b/vtkm/filter/testing/UnitTestCoordinateSystemTransform.cxx index 6eca0656c..b30b01490 100644 --- a/vtkm/filter/testing/UnitTestCoordinateSystemTransform.cxx +++ b/vtkm/filter/testing/UnitTestCoordinateSystemTransform.cxx @@ -28,7 +28,7 @@ vtkm::cont::DataSet MakeTestDataSet(const CoordinateType& cType) { vtkm::cont::DataSet dataSet; - std::vector> coordinates; + std::vector coordinates; const vtkm::Id dim = 5; if (cType == CART) { @@ -112,8 +112,8 @@ void ValidateCoordTransform(const vtkm::cont::DataSet& ds, for (vtkm::Id i = 0; i < points.GetNumberOfValues(); i++) { - vtkm::Vec p = pointsPortal.Get(i); - vtkm::Vec r = pointsTrnPortal.Get(i); + vtkm::Vec3f p = pointsPortal.Get(i); + vtkm::Vec3f r = pointsTrnPortal.Get(i); bool isEqual = true; for (vtkm::IdComponent j = 0; j < 3; j++) { diff --git a/vtkm/filter/testing/UnitTestCrossProductFilter.cxx b/vtkm/filter/testing/UnitTestCrossProductFilter.cxx index 9e1446dd5..54d35cb83 100644 --- a/vtkm/filter/testing/UnitTestCrossProductFilter.cxx +++ b/vtkm/filter/testing/UnitTestCrossProductFilter.cxx @@ -73,14 +73,14 @@ void createVectors(std::size_t numPts, } } -void CheckResult(const vtkm::cont::ArrayHandle>& field1, - const vtkm::cont::ArrayHandle>& field2, +void CheckResult(const vtkm::cont::ArrayHandle& field1, + const vtkm::cont::ArrayHandle& field2, const vtkm::cont::DataSet& result) { VTKM_TEST_ASSERT(result.HasField("crossproduct", vtkm::cont::Field::Association::POINTS), "Output field is missing."); - vtkm::cont::ArrayHandle> outputArray; + vtkm::cont::ArrayHandle outputArray; result.GetField("crossproduct", vtkm::cont::Field::Association::POINTS) .GetData() .CopyTo(outputArray); @@ -96,13 +96,12 @@ void CheckResult(const vtkm::cont::ArrayHandle> for (vtkm::Id j = 0; j < outputArray.GetNumberOfValues(); j++) { - vtkm::Vec v1 = v1Portal.Get(j); - vtkm::Vec v2 = v2Portal.Get(j); - vtkm::Vec res = outPortal.Get(j); + vtkm::Vec3f v1 = v1Portal.Get(j); + vtkm::Vec3f v2 = v2Portal.Get(j); + vtkm::Vec3f res = outPortal.Get(j); //Make sure result is orthogonal each input vector. Need to normalize to compare with zero. - vtkm::Vec v1N(vtkm::Normal(v1)), v2N(vtkm::Normal(v1)), - resN(vtkm::Normal(res)); + vtkm::Vec3f v1N(vtkm::Normal(v1)), v2N(vtkm::Normal(v1)), resN(vtkm::Normal(res)); VTKM_TEST_ASSERT(test_equal(vtkm::Dot(resN, v1N), vtkm::FloatDefault(0.0)), "Wrong result for cross product"); VTKM_TEST_ASSERT(test_equal(vtkm::Dot(resN, v2N), vtkm::FloatDefault(0.0)), @@ -130,10 +129,10 @@ void TestCrossProduct() vtkm::cont::DataSet dataSet = testDataSet.Make3DUniformDataSet0(); vtkm::Id nVerts = dataSet.GetCoordinateSystem(0).GetNumberOfPoints(); - std::vector> vecs1, vecs2; + std::vector vecs1, vecs2; createVectors(static_cast(nVerts), i, vecs1, vecs2); - vtkm::cont::ArrayHandle> field1, field2; + vtkm::cont::ArrayHandle field1, field2; field1 = vtkm::cont::make_ArrayHandle(vecs1); field2 = vtkm::cont::make_ArrayHandle(vecs2); diff --git a/vtkm/filter/testing/UnitTestDotProductFilter.cxx b/vtkm/filter/testing/UnitTestDotProductFilter.cxx index b0d1ec8e0..ed33bb176 100644 --- a/vtkm/filter/testing/UnitTestDotProductFilter.cxx +++ b/vtkm/filter/testing/UnitTestDotProductFilter.cxx @@ -73,8 +73,8 @@ void createVectors(std::size_t numPts, } } -void CheckResult(const vtkm::cont::ArrayHandle>& field1, - const vtkm::cont::ArrayHandle>& field2, +void CheckResult(const vtkm::cont::ArrayHandle& field1, + const vtkm::cont::ArrayHandle& field2, const vtkm::cont::DataSet& result) { VTKM_TEST_ASSERT(result.HasField("dotproduct", vtkm::cont::Field::Association::POINTS), @@ -96,8 +96,8 @@ void CheckResult(const vtkm::cont::ArrayHandle> for (vtkm::Id j = 0; j < outputArray.GetNumberOfValues(); j++) { - vtkm::Vec v1 = v1Portal.Get(j); - vtkm::Vec v2 = v2Portal.Get(j); + vtkm::Vec3f v1 = v1Portal.Get(j); + vtkm::Vec3f v2 = v2Portal.Get(j); vtkm::FloatDefault res = outPortal.Get(j); VTKM_TEST_ASSERT(test_equal(vtkm::Dot(v1, v2), res), "Wrong result for dot product"); @@ -118,10 +118,10 @@ void TestDotProduct() vtkm::cont::DataSet dataSet = testDataSet.Make3DUniformDataSet0(); vtkm::Id nVerts = dataSet.GetCoordinateSystem(0).GetNumberOfPoints(); - std::vector> vecs1, vecs2; + std::vector vecs1, vecs2; createVectors(static_cast(nVerts), i, vecs1, vecs2); - vtkm::cont::ArrayHandle> field1, field2; + vtkm::cont::ArrayHandle field1, field2; field1 = vtkm::cont::make_ArrayHandle(vecs1); field2 = vtkm::cont::make_ArrayHandle(vecs2); diff --git a/vtkm/filter/testing/UnitTestEntropyFilter.cxx b/vtkm/filter/testing/UnitTestEntropyFilter.cxx index d6e13abfe..5b5cbe74a 100644 --- a/vtkm/filter/testing/UnitTestEntropyFilter.cxx +++ b/vtkm/filter/testing/UnitTestEntropyFilter.cxx @@ -82,10 +82,10 @@ vtkm::cont::DataSet MakeIsosurfaceTestDataSet(vtkm::Id3 dims) TangleField(vdims, mins, maxs)); tangleFieldDispatcher.Invoke(vertexCountImplicitArray, fieldArray); - vtkm::Vec origin(0.0f, 0.0f, 0.0f); - vtkm::Vec spacing(1.0f / static_cast(dims[0]), - 1.0f / static_cast(dims[2]), - 1.0f / static_cast(dims[1])); + vtkm::Vec3f origin(0.0f, 0.0f, 0.0f); + vtkm::Vec3f spacing(1.0f / static_cast(dims[0]), + 1.0f / static_cast(dims[2]), + 1.0f / static_cast(dims[1])); vtkm::cont::ArrayHandleUniformPointCoordinates coordinates(vdims, origin, spacing); dataSet.AddCoordinateSystem(vtkm::cont::CoordinateSystem("coordinates", coordinates)); diff --git a/vtkm/filter/testing/UnitTestExtractGeometryFilter.cxx b/vtkm/filter/testing/UnitTestExtractGeometryFilter.cxx index 264e43df0..b7a624c83 100644 --- a/vtkm/filter/testing/UnitTestExtractGeometryFilter.cxx +++ b/vtkm/filter/testing/UnitTestExtractGeometryFilter.cxx @@ -27,8 +27,8 @@ public: vtkm::cont::DataSet dataset = MakeTestDataSet().Make3DUniformDataSet1(); // Implicit function - vtkm::Vec minPoint(1.f, 1.f, 1.f); - vtkm::Vec maxPoint(3.f, 3.f, 3.f); + vtkm::Vec3f minPoint(1.f, 1.f, 1.f); + vtkm::Vec3f maxPoint(3.f, 3.f, 3.f); auto box = vtkm::cont::make_ImplicitFunctionHandle(minPoint, maxPoint); // Setup and run filter to extract by volume of interest @@ -55,8 +55,8 @@ public: vtkm::cont::DataSet dataset = MakeTestDataSet().Make3DUniformDataSet1(); // Implicit function - vtkm::Vec minPoint(1.f, 1.f, 1.f); - vtkm::Vec maxPoint(3.f, 3.f, 3.f); + vtkm::Vec3f minPoint(1.f, 1.f, 1.f); + vtkm::Vec3f maxPoint(3.f, 3.f, 3.f); auto box = vtkm::cont::make_ImplicitFunctionHandle(minPoint, maxPoint); // Setup and run filter to extract by volume of interest @@ -83,8 +83,8 @@ public: vtkm::cont::DataSet dataset = MakeTestDataSet().Make3DUniformDataSet1(); // Implicit function - vtkm::Vec minPoint(0.5f, 0.5f, 0.5f); - vtkm::Vec maxPoint(3.5f, 3.5f, 3.5f); + vtkm::Vec3f minPoint(0.5f, 0.5f, 0.5f); + vtkm::Vec3f maxPoint(3.5f, 3.5f, 3.5f); auto box = vtkm::cont::make_ImplicitFunctionHandle(minPoint, maxPoint); // Setup and run filter to extract by volume of interest @@ -110,8 +110,8 @@ public: vtkm::cont::DataSet dataset = MakeTestDataSet().Make3DUniformDataSet1(); // Implicit function - vtkm::Vec minPoint(0.5f, 0.5f, 0.5f); - vtkm::Vec maxPoint(3.5f, 3.5f, 3.5f); + vtkm::Vec3f minPoint(0.5f, 0.5f, 0.5f); + vtkm::Vec3f maxPoint(3.5f, 3.5f, 3.5f); auto box = vtkm::cont::make_ImplicitFunctionHandle(minPoint, maxPoint); // Setup and run filter to extract by volume of interest diff --git a/vtkm/filter/testing/UnitTestExtractPointsFilter.cxx b/vtkm/filter/testing/UnitTestExtractPointsFilter.cxx index 2119e1fb7..a768f8d5d 100644 --- a/vtkm/filter/testing/UnitTestExtractPointsFilter.cxx +++ b/vtkm/filter/testing/UnitTestExtractPointsFilter.cxx @@ -27,8 +27,8 @@ public: vtkm::cont::DataSet dataset = MakeTestDataSet().Make3DUniformDataSet1(); // Implicit function - vtkm::Vec minPoint(1.f, 1.f, 1.f); - vtkm::Vec maxPoint(3.f, 3.f, 3.f); + vtkm::Vec3f minPoint(1.f, 1.f, 1.f); + vtkm::Vec3f maxPoint(3.f, 3.f, 3.f); auto box = vtkm::cont::make_ImplicitFunctionHandle(minPoint, maxPoint); // Setup and run filter to extract by volume of interest @@ -60,8 +60,8 @@ public: vtkm::cont::DataSet dataset = MakeTestDataSet().Make3DUniformDataSet1(); // Implicit function - vtkm::Vec minPoint(1.f, 1.f, 1.f); - vtkm::Vec maxPoint(3.f, 3.f, 3.f); + vtkm::Vec3f minPoint(1.f, 1.f, 1.f); + vtkm::Vec3f maxPoint(3.f, 3.f, 3.f); auto box = vtkm::cont::make_ImplicitFunctionHandle(minPoint, maxPoint); // Setup and run filter to extract by volume of interest @@ -94,7 +94,7 @@ public: vtkm::cont::DataSet dataset = MakeTestDataSet().Make3DUniformDataSet1(); // Implicit function - vtkm::Vec center(2.f, 2.f, 2.f); + vtkm::Vec3f center(2.f, 2.f, 2.f); vtkm::FloatDefault radius(1.8f); auto sphere = vtkm::cont::make_ImplicitFunctionHandle(center, radius); @@ -114,8 +114,8 @@ public: vtkm::cont::DataSet dataset = MakeTestDataSet().Make3DExplicitDataSet5(); // Implicit function - vtkm::Vec minPoint(0.f, 0.f, 0.f); - vtkm::Vec maxPoint(1.f, 1.f, 1.f); + vtkm::Vec3f minPoint(0.f, 0.f, 0.f); + vtkm::Vec3f maxPoint(1.f, 1.f, 1.f); auto box = vtkm::cont::make_ImplicitFunctionHandle(minPoint, maxPoint); // Setup and run filter to extract by volume of interest @@ -134,8 +134,8 @@ public: vtkm::cont::DataSet dataset = MakeTestDataSet().Make3DExplicitDataSet5(); // Implicit function - vtkm::Vec minPoint(0.f, 0.f, 0.f); - vtkm::Vec maxPoint(1.f, 1.f, 1.f); + vtkm::Vec3f minPoint(0.f, 0.f, 0.f); + vtkm::Vec3f maxPoint(1.f, 1.f, 1.f); auto box = vtkm::cont::make_ImplicitFunctionHandle(minPoint, maxPoint); // Setup and run filter to extract by volume of interest diff --git a/vtkm/filter/testing/UnitTestFieldToColors.cxx b/vtkm/filter/testing/UnitTestFieldToColors.cxx index 65e6332bd..3959d332e 100644 --- a/vtkm/filter/testing/UnitTestFieldToColors.cxx +++ b/vtkm/filter/testing/UnitTestFieldToColors.cxx @@ -41,11 +41,11 @@ void TestFieldToColors() VTKM_TEST_ASSERT(rgbaResult.HasField("colors", vtkm::cont::Field::Association::POINTS), "Field missing."); vtkm::cont::Field Result = rgbaResult.GetField("colors", vtkm::cont::Field::Association::POINTS); - vtkm::cont::ArrayHandle> resultRGBAHandle; + vtkm::cont::ArrayHandle resultRGBAHandle; Result.GetData().CopyTo(resultRGBAHandle); //values confirmed with ParaView 5.4 - const vtkm::Vec correct_diverging_rgba_values[nvals] = { + const vtkm::Vec4ui_8 correct_diverging_rgba_values[nvals] = { { 0, 0, 255, 255 }, { 59, 76, 192, 255 }, { 122, 157, 248, 255 }, { 191, 211, 246, 255 }, { 241, 204, 184, 255 }, { 238, 134, 105, 255 }, { 180, 4, 38, 255 }, { 255, 0, 0, 255 } }; @@ -63,14 +63,14 @@ void TestFieldToColors() VTKM_TEST_ASSERT(rgbResult.HasField("colors", vtkm::cont::Field::Association::POINTS), "Field missing."); Result = rgbResult.GetField("colors", vtkm::cont::Field::Association::POINTS); - vtkm::cont::ArrayHandle> resultRGBHandle; + vtkm::cont::ArrayHandle resultRGBHandle; Result.GetData().CopyTo(resultRGBHandle); //values confirmed with ParaView 5.4 - const vtkm::Vec correct_diverging_rgb_values[nvals] = { - { 0, 0, 255 }, { 59, 76, 192 }, { 122, 157, 248 }, { 191, 211, 246 }, - { 241, 204, 184 }, { 238, 134, 105 }, { 180, 4, 38 }, { 255, 0, 0 } - }; + const vtkm::Vec3ui_8 correct_diverging_rgb_values[nvals] = { { 0, 0, 255 }, { 59, 76, 192 }, + { 122, 157, 248 }, { 191, 211, 246 }, + { 241, 204, 184 }, { 238, 134, 105 }, + { 180, 4, 38 }, { 255, 0, 0 } }; auto portalRGB = resultRGBHandle.GetPortalConstControl(); for (std::size_t i = 0; i < nvals; ++i) { diff --git a/vtkm/filter/testing/UnitTestGhostCellRemove.cxx b/vtkm/filter/testing/UnitTestGhostCellRemove.cxx index 527d2f39c..77c51a53c 100644 --- a/vtkm/filter/testing/UnitTestGhostCellRemove.cxx +++ b/vtkm/filter/testing/UnitTestGhostCellRemove.cxx @@ -175,7 +175,7 @@ static void MakeExplicitCells(const CellSetType& cellSet, static vtkm::cont::DataSet MakeExplicit(vtkm::Id numI, vtkm::Id numJ, vtkm::Id numK, int numLayers) { - using CoordType = vtkm::Vec; + using CoordType = vtkm::Vec3f_32; vtkm::cont::DataSet dsUniform = MakeUniform(numI, numJ, numK, numLayers); @@ -198,14 +198,14 @@ static vtkm::cont::DataSet MakeExplicit(vtkm::Id numI, vtkm::Id numJ, vtkm::Id n if (cellSet.IsType>()) { - vtkm::Vec dims(numI, numJ); + vtkm::Id2 dims(numI, numJ); MakeExplicitCells( cellSet.Cast>(), dims, numIndices, shapes, conn); ds = dsb.Create(explCoords, vtkm::CellShapeTagQuad(), 4, conn, "coordinates", "cells"); } else if (cellSet.IsType>()) { - vtkm::Vec dims(numI, numJ, numK); + vtkm::Id3 dims(numI, numJ, numK); MakeExplicitCells( cellSet.Cast>(), dims, numIndices, shapes, conn); ds = dsb.Create(explCoords, vtkm::CellShapeTagHexahedron(), 8, conn, "coordinates", "cells"); diff --git a/vtkm/filter/testing/UnitTestGradient.cxx b/vtkm/filter/testing/UnitTestGradient.cxx index a9c41d2f7..c9f9f0429 100644 --- a/vtkm/filter/testing/UnitTestGradient.cxx +++ b/vtkm/filter/testing/UnitTestGradient.cxx @@ -42,9 +42,9 @@ void TestCellGradientUniform3D() VTKM_TEST_ASSERT(result.HasField("QCriterion") == false, "scalar gradients can't generate qcriterion"); - vtkm::cont::ArrayHandle> resultArrayHandle; + vtkm::cont::ArrayHandle resultArrayHandle; result.GetField("Gradient").GetData().CopyTo(resultArrayHandle); - vtkm::Vec expected[4] = { + vtkm::Vec3f_64 expected[4] = { { 10.025, 30.075, 60.125 }, { 10.025, 30.075, 60.125 }, { 10.025, 30.075, 60.175 }, @@ -67,12 +67,12 @@ void TestCellGradientUniform3DWithVectorField() const int nVerts = 18; vtkm::Float64 vars[nVerts] = { 10.1, 20.1, 30.1, 40.1, 50.2, 60.2, 70.2, 80.2, 90.3, 100.3, 110.3, 120.3, 130.4, 140.4, 150.4, 160.4, 170.5, 180.5 }; - std::vector> vec(nVerts); + std::vector vec(nVerts); for (std::size_t i = 0; i < vec.size(); ++i) { vec[i] = vtkm::make_Vec(vars[i], vars[i], vars[i]); } - vtkm::cont::ArrayHandle> input = vtkm::cont::make_ArrayHandle(vec); + vtkm::cont::ArrayHandle input = vtkm::cont::make_ArrayHandle(vec); vtkm::cont::DataSetFieldAdd::AddPointField(dataSet, "vec_pointvar", input); //we need to add Vec3 array to the dataset @@ -92,11 +92,11 @@ void TestCellGradientUniform3DWithVectorField() VTKM_TEST_ASSERT(result.HasField("QCriterion") == true, "vec gradients should generate qcriterion"); - vtkm::cont::ArrayHandle, 3>> resultArrayHandle; + vtkm::cont::ArrayHandle> resultArrayHandle; result.GetField("vec_gradient", vtkm::cont::Field::Association::CELL_SET) .GetData() .CopyTo(resultArrayHandle); - vtkm::Vec, 3> expected[4] = { + vtkm::Vec expected[4] = { { { 10.025, 10.025, 10.025 }, { 30.075, 30.075, 30.075 }, { 60.125, 60.125, 60.125 } }, { { 10.025, 10.025, 10.025 }, { 30.075, 30.075, 30.075 }, { 60.125, 60.125, 60.125 } }, { { 10.025, 10.025, 10.025 }, { 30.075, 30.075, 30.075 }, { 60.175, 60.175, 60.175 } }, @@ -104,8 +104,8 @@ void TestCellGradientUniform3DWithVectorField() }; for (int i = 0; i < 4; ++i) { - vtkm::Vec, 3> e = expected[i]; - vtkm::Vec, 3> r = resultArrayHandle.GetPortalConstControl().Get(i); + vtkm::Vec e = expected[i]; + vtkm::Vec r = resultArrayHandle.GetPortalConstControl().Get(i); VTKM_TEST_ASSERT(test_equal(e[0], r[0]), "Wrong result for vec field CellGradient filter on 3D uniform data"); @@ -132,11 +132,11 @@ void TestCellGradientExplicit() VTKM_TEST_ASSERT(result.HasField("gradient", vtkm::cont::Field::Association::CELL_SET), "Result field missing."); - vtkm::cont::ArrayHandle> resultArrayHandle; + vtkm::cont::ArrayHandle resultArrayHandle; result.GetField("gradient", vtkm::cont::Field::Association::CELL_SET) .GetData() .CopyTo(resultArrayHandle); - vtkm::Vec expected[2] = { { 10.f, 10.1f, 0.0f }, { 10.f, 10.1f, -0.0f } }; + vtkm::Vec3f_32 expected[2] = { { 10.f, 10.1f, 0.0f }, { 10.f, 10.1f, -0.0f } }; for (int i = 0; i < 2; ++i) { VTKM_TEST_ASSERT(test_equal(resultArrayHandle.GetPortalConstControl().Get(i), expected[i]), @@ -155,12 +155,12 @@ void TestPointGradientUniform3DWithVectorField() const int nVerts = 18; vtkm::Float64 vars[nVerts] = { 10.1, 20.1, 30.1, 40.1, 50.2, 60.2, 70.2, 80.2, 90.3, 100.3, 110.3, 120.3, 130.4, 140.4, 150.4, 160.4, 170.5, 180.5 }; - std::vector> vec(nVerts); + std::vector vec(nVerts); for (std::size_t i = 0; i < vec.size(); ++i) { vec[i] = vtkm::make_Vec(vars[i], vars[i], vars[i]); } - vtkm::cont::ArrayHandle> input = vtkm::cont::make_ArrayHandle(vec); + vtkm::cont::ArrayHandle input = vtkm::cont::make_ArrayHandle(vec); vtkm::cont::DataSetFieldAdd::AddPointField(dataSet, "vec_pointvar", input); //we need to add Vec3 array to the dataset @@ -173,11 +173,11 @@ void TestPointGradientUniform3DWithVectorField() VTKM_TEST_ASSERT(result.HasField("vec_gradient", vtkm::cont::Field::Association::POINTS), "Result field missing."); - vtkm::cont::ArrayHandle, 3>> resultArrayHandle; + vtkm::cont::ArrayHandle> resultArrayHandle; result.GetField("vec_gradient", vtkm::cont::Field::Association::POINTS) .GetData() .CopyTo(resultArrayHandle); - vtkm::Vec, 3> expected[4] = { + vtkm::Vec expected[4] = { { { 10.0, 10.0, 10.0 }, { 30.0, 30.0, 30.0 }, { 60.1, 60.1, 60.1 } }, { { 10.0, 10.0, 10.0 }, { 30.1, 30.1, 30.1 }, { 60.1, 60.1, 60.1 } }, { { 10.0, 10.0, 10.0 }, { 30.1, 30.1, 30.1 }, { 60.2, 60.2, 60.2 } }, @@ -185,8 +185,8 @@ void TestPointGradientUniform3DWithVectorField() }; for (int i = 0; i < 4; ++i) { - vtkm::Vec, 3> e = expected[i]; - vtkm::Vec, 3> r = resultArrayHandle.GetPortalConstControl().Get(i); + vtkm::Vec e = expected[i]; + vtkm::Vec r = resultArrayHandle.GetPortalConstControl().Get(i); VTKM_TEST_ASSERT(test_equal(e[0], r[0]), "Wrong result for vec field CellGradient filter on 3D uniform data"); @@ -214,12 +214,12 @@ void TestPointGradientExplicit() VTKM_TEST_ASSERT(result.HasField("gradient", vtkm::cont::Field::Association::POINTS), "Result field missing."); - vtkm::cont::ArrayHandle> resultArrayHandle; + vtkm::cont::ArrayHandle resultArrayHandle; result.GetField("gradient", vtkm::cont::Field::Association::POINTS) .GetData() .CopyTo(resultArrayHandle); - vtkm::Vec expected[2] = { { 10.f, 10.1f, 0.0f }, { 10.f, 10.1f, 0.0f } }; + vtkm::Vec3f_32 expected[2] = { { 10.f, 10.1f, 0.0f }, { 10.f, 10.1f, 0.0f } }; for (int i = 0; i < 2; ++i) { VTKM_TEST_ASSERT(test_equal(resultArrayHandle.GetPortalConstControl().Get(i), expected[i]), diff --git a/vtkm/filter/testing/UnitTestLagrangianFilter.cxx b/vtkm/filter/testing/UnitTestLagrangianFilter.cxx index 1baf28186..78f18a917 100644 --- a/vtkm/filter/testing/UnitTestLagrangianFilter.cxx +++ b/vtkm/filter/testing/UnitTestLagrangianFilter.cxx @@ -35,15 +35,15 @@ vtkm::cont::DataSet MakeTestUniformDataSet() vtkm::Float64 ydiff = (ymax - ymin) / (static_cast(DIMS[1] - 1)); vtkm::Float64 zdiff = (zmax - zmin) / (static_cast(DIMS[2] - 1)); - vtkm::Vec ORIGIN(0, 0, 0); - vtkm::Vec SPACING(xdiff, ydiff, zdiff); + vtkm::Vec3f_64 ORIGIN(0, 0, 0); + vtkm::Vec3f_64 SPACING(xdiff, ydiff, zdiff); vtkm::cont::DataSet dataset = dsb.Create(DIMS, ORIGIN, SPACING); vtkm::cont::DataSetFieldAdd dsf; vtkm::Id numPoints = DIMS[0] * DIMS[1] * DIMS[2]; - vtkm::cont::ArrayHandle> velocityField; + vtkm::cont::ArrayHandle velocityField; velocityField.Allocate(numPoints); vtkm::Id count = 0; @@ -53,7 +53,7 @@ vtkm::cont::DataSet MakeTestUniformDataSet() { for (vtkm::Id k = 0; k < DIMS[2]; k++) { - velocityField.GetPortalControl().Set(count, vtkm::Vec(0.1, 0.1, 0.1)); + velocityField.GetPortalControl().Set(count, vtkm::Vec3f_64(0.1, 0.1, 0.1)); count++; } } diff --git a/vtkm/filter/testing/UnitTestMarchingCubesFilter.cxx b/vtkm/filter/testing/UnitTestMarchingCubesFilter.cxx index 83b3f796a..08650c644 100644 --- a/vtkm/filter/testing/UnitTestMarchingCubesFilter.cxx +++ b/vtkm/filter/testing/UnitTestMarchingCubesFilter.cxx @@ -89,10 +89,10 @@ vtkm::cont::DataSet MakeIsosurfaceTestDataSet(vtkm::Id3 dims) TangleField(vdims, mins, maxs)); tangleFieldDispatcher.Invoke(vertexCountImplicitArray, fieldArray); - vtkm::Vec origin(0.0f, 0.0f, 0.0f); - vtkm::Vec spacing(1.0f / static_cast(dims[0]), - 1.0f / static_cast(dims[2]), - 1.0f / static_cast(dims[1])); + vtkm::Vec3f origin(0.0f, 0.0f, 0.0f); + vtkm::Vec3f spacing(1.0f / static_cast(dims[0]), + 1.0f / static_cast(dims[2]), + 1.0f / static_cast(dims[1])); vtkm::cont::ArrayHandleUniformPointCoordinates coordinates(vdims, origin, spacing); dataSet.AddCoordinateSystem(vtkm::cont::CoordinateSystem("coordinates", coordinates)); @@ -117,21 +117,21 @@ public: { } VTKM_EXEC_CONT - EuclideanNorm(vtkm::Vec reference) + EuclideanNorm(vtkm::Vec3f_32 reference) : Reference(reference) { } VTKM_EXEC_CONT - vtkm::Float32 operator()(vtkm::Vec v) const + vtkm::Float32 operator()(vtkm::Vec3f_32 v) const { - vtkm::Vec d( + vtkm::Vec3f_32 d( v[0] - this->Reference[0], v[1] - this->Reference[1], v[2] - this->Reference[2]); return vtkm::Magnitude(d); } private: - vtkm::Vec Reference; + vtkm::Vec3f_32 Reference; }; class CubeGridConnectivity @@ -236,7 +236,7 @@ inline vtkm::cont::DataSet MakeRadiantDataSet::Make3DRadiantDataSet(vtkm::IdComp using HexTag = vtkm::CellShapeTagHexahedron; using HexTraits = vtkm::CellTraits; - using CoordType = vtkm::Vec; + using CoordType = vtkm::Vec3f_32; const vtkm::IdComponent nCells = dim * dim * dim; @@ -398,7 +398,7 @@ void TestNormals(const vtkm::cont::DataSet& dataset, bool structured) const vtkm::Id numVerts = 16; //Calculated using PointGradient - const vtkm::Vec hq_ug[numVerts] = { + const vtkm::Vec3f hq_ug[numVerts] = { { 0.1510f, 0.6268f, 0.7644f }, { 0.1333f, -0.3974f, 0.9079f }, { 0.1626f, 0.7642f, 0.6242f }, { 0.3853f, 0.6643f, 0.6405f }, { -0.1337f, 0.7136f, 0.6876f }, { 0.7705f, -0.4212f, 0.4784f }, @@ -410,7 +410,7 @@ void TestNormals(const vtkm::cont::DataSet& dataset, bool structured) }; //Calculated using StructuredPointGradient - const vtkm::Vec hq_sg[numVerts] = { + const vtkm::Vec3f hq_sg[numVerts] = { { 0.151008f, 0.626778f, 0.764425f }, { 0.133328f, -0.397444f, 0.907889f }, { 0.162649f, 0.764163f, 0.624180f }, { 0.385327f, 0.664323f, 0.640467f }, { -0.133720f, 0.713645f, 0.687626f }, { 0.770536f, -0.421248f, 0.478356f }, @@ -422,7 +422,7 @@ void TestNormals(const vtkm::cont::DataSet& dataset, bool structured) }; //Calculated using normals of the output triangles - const vtkm::Vec fast[numVerts] = { + const vtkm::Vec3f fast[numVerts] = { { -0.1351f, 0.4377f, 0.8889f }, { 0.2863f, -0.1721f, 0.9426f }, { 0.3629f, 0.8155f, 0.4509f }, { 0.8486f, 0.3560f, 0.3914f }, { -0.8315f, 0.4727f, 0.2917f }, { 0.9395f, -0.2530f, 0.2311f }, @@ -433,7 +433,7 @@ void TestNormals(const vtkm::cont::DataSet& dataset, bool structured) { 0.2164f, -0.9401f, -0.2635f }, { -0.1589f, -0.1642f, -0.9735f } }; - vtkm::cont::ArrayHandle> normals; + vtkm::cont::ArrayHandle normals; vtkm::filter::MarchingCubes mc; mc.SetIsoValue(0, 200); diff --git a/vtkm/filter/testing/UnitTestMeshQualityFilter.cxx b/vtkm/filter/testing/UnitTestMeshQualityFilter.cxx index 373c55b7a..2c295ad3c 100644 --- a/vtkm/filter/testing/UnitTestMeshQualityFilter.cxx +++ b/vtkm/filter/testing/UnitTestMeshQualityFilter.cxx @@ -36,7 +36,7 @@ inline vtkm::cont::DataSet Make3DExplicitDataSet() vtkm::cont::DataSet dataSet; vtkm::cont::DataSetBuilderExplicit dsb; - using CoordType = vtkm::Vec; + using CoordType = vtkm::Vec3f_64; std::vector coords = { { 0.00, 0.00, 0.00 }, { 1.00, 0.00, 0.00 }, { 2.00, 0.00, 0.00 }, { 0.00, 0.00, 1.00 }, diff --git a/vtkm/filter/testing/UnitTestPointElevationFilter.cxx b/vtkm/filter/testing/UnitTestPointElevationFilter.cxx index ff4528c4b..e52a07977 100644 --- a/vtkm/filter/testing/UnitTestPointElevationFilter.cxx +++ b/vtkm/filter/testing/UnitTestPointElevationFilter.cxx @@ -20,7 +20,7 @@ vtkm::cont::DataSet MakePointElevationTestDataSet() { vtkm::cont::DataSet dataSet; - std::vector> coordinates; + std::vector coordinates; const vtkm::Id dim = 5; for (vtkm::Id j = 0; j < dim; ++j) { diff --git a/vtkm/filter/testing/UnitTestPointTransform.cxx b/vtkm/filter/testing/UnitTestPointTransform.cxx index e2d0cb371..761236a0e 100644 --- a/vtkm/filter/testing/UnitTestPointTransform.cxx +++ b/vtkm/filter/testing/UnitTestPointTransform.cxx @@ -23,7 +23,7 @@ vtkm::cont::DataSet MakePointTransformTestDataSet() { vtkm::cont::DataSet dataSet; - std::vector> coordinates; + std::vector coordinates; const vtkm::Id dim = 5; for (vtkm::Id j = 0; j < dim; ++j) { @@ -69,7 +69,7 @@ void ValidatePointTransform(const vtkm::cont::CoordinateSystem& coords, VTKM_TEST_ASSERT(result.HasField(fieldName, vtkm::cont::Field::Association::POINTS), "Output field missing."); - vtkm::cont::ArrayHandle> resultArrayHandle; + vtkm::cont::ArrayHandle resultArrayHandle; result.GetField(fieldName, vtkm::cont::Field::Association::POINTS) .GetData() .CopyTo(resultArrayHandle); @@ -88,8 +88,7 @@ void ValidatePointTransform(const vtkm::cont::CoordinateSystem& coords, } -void TestPointTransformTranslation(const vtkm::cont::DataSet& ds, - const vtkm::Vec& trans) +void TestPointTransformTranslation(const vtkm::cont::DataSet& ds, const vtkm::Vec3f& trans) { vtkm::filter::PointTransform filter; @@ -102,8 +101,7 @@ void TestPointTransformTranslation(const vtkm::cont::DataSet& ds, ds.GetCoordinateSystem(), "translation", result, Transform3DTranslate(trans)); } -void TestPointTransformScale(const vtkm::cont::DataSet& ds, - const vtkm::Vec& scale) +void TestPointTransformScale(const vtkm::cont::DataSet& ds, const vtkm::Vec3f& scale) { vtkm::filter::PointTransform filter; @@ -117,7 +115,7 @@ void TestPointTransformScale(const vtkm::cont::DataSet& ds, void TestPointTransformRotation(const vtkm::cont::DataSet& ds, const vtkm::FloatDefault& angle, - const vtkm::Vec& axis) + const vtkm::Vec3f& axis) { vtkm::filter::PointTransform filter; @@ -139,31 +137,29 @@ void TestPointTransform() int N = 41; //Test translation - TestPointTransformTranslation(ds, vtkm::Vec(0, 0, 0)); - TestPointTransformTranslation(ds, vtkm::Vec(1, 1, 1)); - TestPointTransformTranslation(ds, vtkm::Vec(-1, -1, -1)); + TestPointTransformTranslation(ds, vtkm::Vec3f(0, 0, 0)); + TestPointTransformTranslation(ds, vtkm::Vec3f(1, 1, 1)); + TestPointTransformTranslation(ds, vtkm::Vec3f(-1, -1, -1)); std::uniform_real_distribution transDist(-100, 100); for (int i = 0; i < N; i++) - TestPointTransformTranslation(ds, - vtkm::Vec(transDist(randGenerator), - transDist(randGenerator), - transDist(randGenerator))); + TestPointTransformTranslation( + ds, + vtkm::Vec3f(transDist(randGenerator), transDist(randGenerator), transDist(randGenerator))); //Test scaling - TestPointTransformScale(ds, vtkm::Vec(1, 1, 1)); - TestPointTransformScale(ds, vtkm::Vec(.23f, .23f, .23f)); - TestPointTransformScale(ds, vtkm::Vec(1, 2, 3)); - TestPointTransformScale(ds, vtkm::Vec(3.23f, 9.23f, 4.23f)); + TestPointTransformScale(ds, vtkm::Vec3f(1, 1, 1)); + TestPointTransformScale(ds, vtkm::Vec3f(.23f, .23f, .23f)); + TestPointTransformScale(ds, vtkm::Vec3f(1, 2, 3)); + TestPointTransformScale(ds, vtkm::Vec3f(3.23f, 9.23f, 4.23f)); std::uniform_real_distribution scaleDist(0.0001f, 100); for (int i = 0; i < N; i++) { - TestPointTransformScale(ds, vtkm::Vec(scaleDist(randGenerator))); - TestPointTransformScale(ds, - vtkm::Vec(scaleDist(randGenerator), - scaleDist(randGenerator), - scaleDist(randGenerator))); + TestPointTransformScale(ds, vtkm::Vec3f(scaleDist(randGenerator))); + TestPointTransformScale( + ds, + vtkm::Vec3f(scaleDist(randGenerator), scaleDist(randGenerator), scaleDist(randGenerator))); } //Test rotation @@ -172,11 +168,11 @@ void TestPointTransform() for (int i = 0; i < N; i++) angles.push_back(angleDist(randGenerator)); - std::vector> axes; - axes.push_back(vtkm::Vec(1, 0, 0)); - axes.push_back(vtkm::Vec(0, 1, 0)); - axes.push_back(vtkm::Vec(0, 0, 1)); - axes.push_back(vtkm::Vec(1, 1, 1)); + std::vector axes; + axes.push_back(vtkm::Vec3f(1, 0, 0)); + axes.push_back(vtkm::Vec3f(0, 1, 0)); + axes.push_back(vtkm::Vec3f(0, 0, 1)); + axes.push_back(vtkm::Vec3f(1, 1, 1)); axes.push_back(-axes[0]); axes.push_back(-axes[1]); axes.push_back(-axes[2]); @@ -184,8 +180,8 @@ void TestPointTransform() std::uniform_real_distribution axisDist(-1, 1); for (int i = 0; i < N; i++) - axes.push_back(vtkm::Vec( - axisDist(randGenerator), axisDist(randGenerator), axisDist(randGenerator))); + axes.push_back( + vtkm::Vec3f(axisDist(randGenerator), axisDist(randGenerator), axisDist(randGenerator))); for (std::size_t i = 0; i < angles.size(); i++) for (std::size_t j = 0; j < axes.size(); j++) diff --git a/vtkm/filter/testing/UnitTestProbe.cxx b/vtkm/filter/testing/UnitTestProbe.cxx index a68a328ea..d0ca7217c 100644 --- a/vtkm/filter/testing/UnitTestProbe.cxx +++ b/vtkm/filter/testing/UnitTestProbe.cxx @@ -52,7 +52,7 @@ vtkm::cont::DataSet ConvertDataSetUniformToExplicit(const vtkm::cont::DataSet& u vtkm::worklet::CellDeepCopy::Run(uds.GetCellSet(), cs); eds.AddCellSet(cs); - vtkm::cont::ArrayHandle> points; + vtkm::cont::ArrayHandle points; vtkm::cont::ArrayCopy(uds.GetCoordinateSystem().GetData(), points); eds.AddCoordinateSystem( vtkm::cont::CoordinateSystem(uds.GetCoordinateSystem().GetName(), points)); diff --git a/vtkm/filter/testing/UnitTestSplitSharpEdgesFilter.cxx b/vtkm/filter/testing/UnitTestSplitSharpEdgesFilter.cxx index 7aacad798..ae821128c 100644 --- a/vtkm/filter/testing/UnitTestSplitSharpEdgesFilter.cxx +++ b/vtkm/filter/testing/UnitTestSplitSharpEdgesFilter.cxx @@ -21,9 +21,9 @@ namespace { -using NormalsArrayHandle = vtkm::cont::ArrayHandle>; +using NormalsArrayHandle = vtkm::cont::ArrayHandle; -const vtkm::Vec expectedCoords[24] = { +const vtkm::Vec3f expectedCoords[24] = { { 0.0, 0.0, 0.0 }, { 1.0, 0.0, 0.0 }, { 1.0, 0.0, 1.0 }, { 0.0, 0.0, 1.0 }, { 0.0, 1.0, 0.0 }, { 1.0, 1.0, 0.0 }, { 1.0, 1.0, 1.0 }, { 0.0, 1.0, 1.0 }, { 0.0, 0.0, 0.0 }, { 0.0, 0.0, 0.0 }, { 1.0, 0.0, 0.0 }, { 1.0, 0.0, 0.0 }, { 1.0, 0.0, 1.0 }, { 1.0, 0.0, 1.0 }, { 0.0, 0.0, 1.0 }, @@ -46,7 +46,7 @@ vtkm::cont::DataSet Make3DExplicitSimpleCube() const int nVerts = 8; const int nCells = 6; - using CoordType = vtkm::Vec; + using CoordType = vtkm::Vec3f; std::vector coords = { CoordType(0, 0, 0), // 0 CoordType(1, 0, 0), // 1 @@ -229,7 +229,7 @@ struct SplitSharpTestPolicy : public vtkm::filter::PolicyBase>; using UnstructuredCellSetList = vtkm::ListTagBase>; using AllCellSetList = vtkm::ListTagJoin; - using FieldTypeList = vtkm::ListTagBase>; + using FieldTypeList = vtkm::ListTagBase; }; diff --git a/vtkm/filter/testing/UnitTestStreamlineFilter.cxx b/vtkm/filter/testing/UnitTestStreamlineFilter.cxx index 0901e704a..9ffbc6d36 100644 --- a/vtkm/filter/testing/UnitTestStreamlineFilter.cxx +++ b/vtkm/filter/testing/UnitTestStreamlineFilter.cxx @@ -16,12 +16,11 @@ namespace { -vtkm::cont::DataSet CreateDataSet(const vtkm::Id3& dims, - const vtkm::Vec& vec) +vtkm::cont::DataSet CreateDataSet(const vtkm::Id3& dims, const vtkm::Vec3f& vec) { vtkm::Id numPoints = dims[0] * dims[1] * dims[2]; - std::vector> vectorField(static_cast(numPoints)); + std::vector vectorField(static_cast(numPoints)); for (std::size_t i = 0; i < static_cast(numPoints); i++) vectorField[i] = vec; @@ -37,14 +36,14 @@ vtkm::cont::DataSet CreateDataSet(const vtkm::Id3& dims, void TestStreamline() { const vtkm::Id3 dims(5, 5, 5); - const vtkm::Vec vecX(1, 0, 0); + const vtkm::Vec3f vecX(1, 0, 0); vtkm::cont::DataSet ds = CreateDataSet(dims, vecX); - vtkm::cont::ArrayHandle> seedArray; - std::vector> seeds(3); - seeds[0] = vtkm::Vec(.2f, 1.0f, .2f); - seeds[1] = vtkm::Vec(.2f, 2.0f, .2f); - seeds[2] = vtkm::Vec(.2f, 3.0f, .2f); + vtkm::cont::ArrayHandle seedArray; + std::vector seeds(3); + seeds[0] = vtkm::Vec3f(.2f, 1.0f, .2f); + seeds[1] = vtkm::Vec3f(.2f, 2.0f, .2f); + seeds[2] = vtkm::Vec3f(.2f, 3.0f, .2f); seedArray = vtkm::cont::make_ArrayHandle(seeds); @@ -73,17 +72,17 @@ void TestStreamline() void TestPathline() { const vtkm::Id3 dims(5, 5, 5); - const vtkm::Vec vecX(1, 0, 0); - const vtkm::Vec vecY(0, 1, 0); + const vtkm::Vec3f vecX(1, 0, 0); + const vtkm::Vec3f vecY(0, 1, 0); vtkm::cont::DataSet ds1 = CreateDataSet(dims, vecX); vtkm::cont::DataSet ds2 = CreateDataSet(dims, vecY); - vtkm::cont::ArrayHandle> seedArray; - std::vector> seeds(3); - seeds[0] = vtkm::Vec(.2f, 1.0f, .2f); - seeds[1] = vtkm::Vec(.2f, 2.0f, .2f); - seeds[2] = vtkm::Vec(.2f, 3.0f, .2f); + vtkm::cont::ArrayHandle seedArray; + std::vector seeds(3); + seeds[0] = vtkm::Vec3f(.2f, 1.0f, .2f); + seeds[1] = vtkm::Vec3f(.2f, 2.0f, .2f); + seeds[2] = vtkm::Vec3f(.2f, 3.0f, .2f); seedArray = vtkm::cont::make_ArrayHandle(seeds); diff --git a/vtkm/filter/testing/UnitTestSurfaceNormalsFilter.cxx b/vtkm/filter/testing/UnitTestSurfaceNormalsFilter.cxx index 681a27e43..9a9c62057 100644 --- a/vtkm/filter/testing/UnitTestSurfaceNormalsFilter.cxx +++ b/vtkm/filter/testing/UnitTestSurfaceNormalsFilter.cxx @@ -17,14 +17,13 @@ namespace void VerifyCellNormalValues(const vtkm::cont::DataSet& ds) { - vtkm::cont::ArrayHandle> normals; + vtkm::cont::ArrayHandle normals; ds.GetField("Normals", vtkm::cont::Field::Association::CELL_SET).GetData().CopyTo(normals); - vtkm::Vec expected[8] = { - { -0.707f, -0.500f, 0.500f }, { -0.707f, -0.500f, 0.500f }, { 0.707f, 0.500f, -0.500f }, - { 0.000f, -0.707f, -0.707f }, { 0.000f, -0.707f, -0.707f }, { 0.000f, 0.707f, 0.707f }, - { -0.707f, 0.500f, -0.500f }, { 0.707f, -0.500f, 0.500f } - }; + vtkm::Vec3f expected[8] = { { -0.707f, -0.500f, 0.500f }, { -0.707f, -0.500f, 0.500f }, + { 0.707f, 0.500f, -0.500f }, { 0.000f, -0.707f, -0.707f }, + { 0.000f, -0.707f, -0.707f }, { 0.000f, 0.707f, 0.707f }, + { -0.707f, 0.500f, -0.500f }, { 0.707f, -0.500f, 0.500f } }; auto portal = normals.GetPortalConstControl(); VTKM_TEST_ASSERT(portal.GetNumberOfValues() == 8, "incorrect normals array length"); @@ -37,15 +36,13 @@ void VerifyCellNormalValues(const vtkm::cont::DataSet& ds) void VerifyPointNormalValues(const vtkm::cont::DataSet& ds) { - vtkm::cont::ArrayHandle> normals; + vtkm::cont::ArrayHandle normals; ds.GetField("Normals", vtkm::cont::Field::Association::POINTS).GetData().CopyTo(normals); - vtkm::Vec expected[8] = { - { -0.8165f, -0.4082f, -0.4082f }, { -0.2357f, -0.9714f, 0.0286f }, - { 0.0000f, -0.1691f, 0.9856f }, { -0.8660f, 0.0846f, 0.4928f }, - { 0.0000f, -0.1691f, -0.9856f }, { 0.0000f, 0.9856f, -0.1691f }, - { 0.8165f, 0.4082f, 0.4082f }, { 0.8165f, -0.4082f, -0.4082f } - }; + vtkm::Vec3f expected[8] = { { -0.8165f, -0.4082f, -0.4082f }, { -0.2357f, -0.9714f, 0.0286f }, + { 0.0000f, -0.1691f, 0.9856f }, { -0.8660f, 0.0846f, 0.4928f }, + { 0.0000f, -0.1691f, -0.9856f }, { 0.0000f, 0.9856f, -0.1691f }, + { 0.8165f, 0.4082f, 0.4082f }, { 0.8165f, -0.4082f, -0.4082f } }; auto portal = normals.GetPortalConstControl(); VTKM_TEST_ASSERT(portal.GetNumberOfValues() == 8, "incorrect normals array length"); diff --git a/vtkm/filter/testing/UnitTestVectorMagnitudeFilter.cxx b/vtkm/filter/testing/UnitTestVectorMagnitudeFilter.cxx index 581e5b589..134dc5aa6 100644 --- a/vtkm/filter/testing/UnitTestVectorMagnitudeFilter.cxx +++ b/vtkm/filter/testing/UnitTestVectorMagnitudeFilter.cxx @@ -28,12 +28,12 @@ void TestVectorMagnitude() vtkm::Float64 fvars[nVerts] = { 10.1, 20.1, 30.1, 40.1, 50.2, 60.2, 70.2, 80.2, 90.3, 100.3, 110.3, 120.3, 130.4, 140.4, 150.4, 160.4, 170.5, 180.5 }; - std::vector> fvec(nVerts); + std::vector fvec(nVerts); for (std::size_t i = 0; i < fvec.size(); ++i) { fvec[i] = vtkm::make_Vec(fvars[i], fvars[i], fvars[i]); } - vtkm::cont::ArrayHandle> finput = vtkm::cont::make_ArrayHandle(fvec); + vtkm::cont::ArrayHandle finput = vtkm::cont::make_ArrayHandle(fvec); vtkm::cont::DataSetFieldAdd::AddPointField(dataSet, "double_vec_pointvar", finput); diff --git a/vtkm/filter/testing/UnitTestVertexClusteringFilter.cxx b/vtkm/filter/testing/UnitTestVertexClusteringFilter.cxx index 4d8387f2d..5b4a915a9 100644 --- a/vtkm/filter/testing/UnitTestVertexClusteringFilter.cxx +++ b/vtkm/filter/testing/UnitTestVertexClusteringFilter.cxx @@ -69,7 +69,7 @@ void TestVertexClustering() vtkm::cont::printSummary_ArrayHandle(pointvar, std::cerr, true); vtkm::cont::printSummary_ArrayHandle(cellvar, std::cerr, true); - using PointType = vtkm::Vec; + using PointType = vtkm::Vec3f_64; auto pointArray = output.GetCoordinateSystem(0).GetData(); VTKM_TEST_ASSERT(pointArray.GetNumberOfValues() == output_points, "Number of output points mismatch"); diff --git a/vtkm/filter/testing/UnitTestWarpScalarFilter.cxx b/vtkm/filter/testing/UnitTestWarpScalarFilter.cxx index 19ac75414..8de9525ba 100644 --- a/vtkm/filter/testing/UnitTestWarpScalarFilter.cxx +++ b/vtkm/filter/testing/UnitTestWarpScalarFilter.cxx @@ -58,7 +58,7 @@ void CheckResult(const vtkm::filter::WarpScalar& filter, const vtkm::cont::DataS { VTKM_TEST_ASSERT(result.HasField("warpscalar", vtkm::cont::Field::Association::POINTS), "Output filed warpscalar is missing"); - using vecType = vtkm::Vec; + using vecType = vtkm::Vec3f; vtkm::cont::ArrayHandle outputArray; result.GetField("warpscalar", vtkm::cont::Field::Association::POINTS) .GetData() diff --git a/vtkm/filter/testing/UnitTestWarpVectorFilter.cxx b/vtkm/filter/testing/UnitTestWarpVectorFilter.cxx index 54404b53c..ebcac9b66 100644 --- a/vtkm/filter/testing/UnitTestWarpVectorFilter.cxx +++ b/vtkm/filter/testing/UnitTestWarpVectorFilter.cxx @@ -54,7 +54,7 @@ vtkm::cont::DataSet MakeWarpVectorTestDataSet() class PolicyWarpVector : public vtkm::filter::PolicyBase { public: - using vecType = vtkm::Vec; + using vecType = vtkm::Vec3f; struct TypeListTagWarpVectorTags : vtkm::ListTagBase::StorageTag, vtkm::cont::ArrayHandle::StorageTag> @@ -67,7 +67,7 @@ void CheckResult(const vtkm::filter::WarpVector& filter, const vtkm::cont::DataS { VTKM_TEST_ASSERT(result.HasField("warpvector", vtkm::cont::Field::Association::POINTS), "Output filed WarpVector is missing"); - using vecType = vtkm::Vec; + using vecType = vtkm::Vec3f; vtkm::cont::ArrayHandle outputArray; result.GetField("warpvector", vtkm::cont::Field::Association::POINTS) .GetData() diff --git a/vtkm/internal/ArrayPortalUniformPointCoordinates.h b/vtkm/internal/ArrayPortalUniformPointCoordinates.h index 7a5f4bea7..ef4f2010d 100644 --- a/vtkm/internal/ArrayPortalUniformPointCoordinates.h +++ b/vtkm/internal/ArrayPortalUniformPointCoordinates.h @@ -23,7 +23,7 @@ namespace internal class VTKM_ALWAYS_EXPORT ArrayPortalUniformPointCoordinates { public: - using ValueType = vtkm::Vec; + using ValueType = vtkm::Vec3f; VTKM_EXEC_CONT ArrayPortalUniformPointCoordinates() diff --git a/vtkm/internal/IndicesExtrude.h b/vtkm/internal/IndicesExtrude.h index 0e34e257a..b665adf23 100644 --- a/vtkm/internal/IndicesExtrude.h +++ b/vtkm/internal/IndicesExtrude.h @@ -23,9 +23,9 @@ struct IndicesExtrude IndicesExtrude() = default; VTKM_EXEC - IndicesExtrude(vtkm::Vec pointIds1, + IndicesExtrude(vtkm::Vec3i_32 pointIds1, vtkm::Int32 plane1, - vtkm::Vec pointIds2, + vtkm::Vec3i_32 pointIds2, vtkm::Int32 plane2, vtkm::Int32 numberOfPointsPerPlane) : PointIds{ pointIds1, pointIds2 } @@ -62,7 +62,7 @@ struct IndicesExtrude } } - vtkm::Vec PointIds[2]; + vtkm::Vec3i_32 PointIds[2]; vtkm::Int32 Planes[2]; vtkm::Int32 NumberOfPointsPerPlane; }; diff --git a/vtkm/internal/testing/UnitTestArrayPortalValueReference.cxx b/vtkm/internal/testing/UnitTestArrayPortalValueReference.cxx index a1ea891b9..c96221079 100644 --- a/vtkm/internal/testing/UnitTestArrayPortalValueReference.cxx +++ b/vtkm/internal/testing/UnitTestArrayPortalValueReference.cxx @@ -294,8 +294,7 @@ void DoTest() // on some compilers. Since we want to test these operators, just remove the short types from // the list to avoid the warning. vtkm::testing::Testing::TryTypes( - DoTestForType(), - vtkm::ListTagBase>()); + DoTestForType(), vtkm::ListTagBase()); } } // anonymous namespace diff --git a/vtkm/internal/testing/UnitTestFunctionInterface.cxx b/vtkm/internal/testing/UnitTestFunctionInterface.cxx index 4c42e0a8b..88da0af18 100644 --- a/vtkm/internal/testing/UnitTestFunctionInterface.cxx +++ b/vtkm/internal/testing/UnitTestFunctionInterface.cxx @@ -33,7 +33,7 @@ const Type2 Arg2 = 5678.125; using Type3 = std::string; const Type3 Arg3("Third argument"); -using Type4 = vtkm::Vec; +using Type4 = vtkm::Vec3f_32; const Type4 Arg4(1.2f, 3.4f, 5.6f); using Type5 = vtkm::Id3; diff --git a/vtkm/interop/testing/TestingTransferFancyHandles.h b/vtkm/interop/testing/TestingTransferFancyHandles.h index 7610fed94..16962a4a5 100644 --- a/vtkm/interop/testing/TestingTransferFancyHandles.h +++ b/vtkm/interop/testing/TestingTransferFancyHandles.h @@ -150,9 +150,8 @@ void test_ArrayHandleCartesianProduct() void test_ArrayHandleCast() { - vtkm::cont::ArrayHandle> handle = - makeArray(100000, vtkm::Vec()); - auto castArray = vtkm::cont::make_ArrayHandleCast(handle, vtkm::Vec()); + vtkm::cont::ArrayHandle handle = makeArray(100000, vtkm::Vec3f_64()); + auto castArray = vtkm::cont::make_ArrayHandleCast(handle, vtkm::Vec3f_32()); vtkm::interop::BufferState state; vtkm::interop::TransferToOpenGL(castArray, state); @@ -161,8 +160,8 @@ void test_ArrayHandleCast() validate(castArray, state); //resize down - handle = makeArray(1000, vtkm::Vec()); - castArray = vtkm::cont::make_ArrayHandleCast(handle, vtkm::Vec()); + handle = makeArray(1000, vtkm::Vec3f_64()); + castArray = vtkm::cont::make_ArrayHandleCast(handle, vtkm::Vec3f_32()); vtkm::interop::TransferToOpenGL(castArray, state); validate(castArray, state); } diff --git a/vtkm/io/reader/BOVDataSetReader.h b/vtkm/io/reader/BOVDataSetReader.h index 7577f5c58..cc06fad66 100644 --- a/vtkm/io/reader/BOVDataSetReader.h +++ b/vtkm/io/reader/BOVDataSetReader.h @@ -69,8 +69,8 @@ private: std::string bovFile, line, token, options, variableName; vtkm::Id numComponents = 1; vtkm::Id3 dim; - vtkm::Vec origin(0, 0, 0); - vtkm::Vec spacing(1, 1, 1); + vtkm::Vec3f origin(0, 0, 0); + vtkm::Vec3f spacing(1, 1, 1); bool spacingSet = false; while (stream.good()) @@ -210,13 +210,13 @@ private: { if (dataFormat == FloatData) { - vtkm::cont::ArrayHandle> var; + vtkm::cont::ArrayHandle var; ReadVector(fullPathDataFile, numTuples, var); dsf.AddPointField(this->DataSet, variableName, var); } else if (dataFormat == DoubleData) { - vtkm::cont::ArrayHandle> var; + vtkm::cont::ArrayHandle var; ReadVector(fullPathDataFile, numTuples, var); dsf.AddPointField(this->DataSet, variableName, var); } diff --git a/vtkm/io/reader/VTKStructuredPointsReader.h b/vtkm/io/reader/VTKStructuredPointsReader.h index b3f003c2d..80ad6cc85 100644 --- a/vtkm/io/reader/VTKStructuredPointsReader.h +++ b/vtkm/io/reader/VTKStructuredPointsReader.h @@ -41,7 +41,7 @@ private: // Read structured points specific meta-data vtkm::Id3 dim; - vtkm::Vec origin, spacing; + vtkm::Vec3f_32 origin, spacing; //Two ways the file can describe the dimensions. The proper way is by //using the DIMENSIONS keyword, but VisIt written VTK files spicify data diff --git a/vtkm/rendering/AxisAnnotation2D.cxx b/vtkm/rendering/AxisAnnotation2D.cxx index 8b08359d2..e302bfda9 100644 --- a/vtkm/rendering/AxisAnnotation2D.cxx +++ b/vtkm/rendering/AxisAnnotation2D.cxx @@ -91,7 +91,7 @@ void AxisAnnotation2D::Render(const vtkm::rendering::Camera& camera, { this->Labels.push_back( std::unique_ptr(new vtkm::rendering::TextAnnotationScreen( - "test", this->Color, this->FontScale, vtkm::Vec(0, 0), 0))); + "test", this->Color, this->FontScale, vtkm::Vec2f_32(0, 0), 0))); } std::stringstream numberToString; diff --git a/vtkm/rendering/AxisAnnotation3D.cxx b/vtkm/rendering/AxisAnnotation3D.cxx index 6c0e35fbd..a5a29d5ba 100644 --- a/vtkm/rendering/AxisAnnotation3D.cxx +++ b/vtkm/rendering/AxisAnnotation3D.cxx @@ -70,22 +70,18 @@ void AxisAnnotation3D::Render(const Camera& camera, unsigned int nmajor = (unsigned int)proportions.size(); while (this->Labels.size() < nmajor) { - this->Labels.push_back(std::unique_ptr( - new vtkm::rendering::TextAnnotationBillboard("test", - this->Color, - vtkm::Float32(this->FontScale), - vtkm::Vec(0, 0, 0), - 0))); + this->Labels.push_back( + std::unique_ptr(new vtkm::rendering::TextAnnotationBillboard( + "test", this->Color, vtkm::Float32(this->FontScale), vtkm::Vec3f_32(0, 0, 0), 0))); } std::stringstream numberToString; for (unsigned int i = 0; i < nmajor; ++i) { - vtkm::Vec tickPos = - proportions[i] * (this->Point1 - this->Point0) + this->Point0; + vtkm::Vec3f_64 tickPos = proportions[i] * (this->Point1 - this->Point0) + this->Point0; for (int pass = 0; pass <= 1; pass++) { - vtkm::Vec tickSize(0); + vtkm::Vec3f_64 tickSize(0); if (pass == 0) { switch (this->Axis) @@ -117,13 +113,13 @@ void AxisAnnotation3D::Render(const Camera& camera, } } tickSize = tickSize * this->Invert; - vtkm::Vec start = tickPos - tickSize * this->TickMajorOffset; - vtkm::Vec end = tickPos - tickSize * (1.0 - this->TickMajorOffset); + vtkm::Vec3f_64 start = tickPos - tickSize * this->TickMajorOffset; + vtkm::Vec3f_64 end = tickPos - tickSize * (1.0 - this->TickMajorOffset); worldAnnotator.AddLine(start, end, this->LineWidth, this->Color, infront); } - vtkm::Vec tickSize(0); + vtkm::Vec3f_32 tickSize(0); vtkm::Float32 s = 0.4f * this->FontOffset; switch (this->Axis) { @@ -150,9 +146,9 @@ void AxisAnnotation3D::Render(const Camera& camera, this->Labels[i]->SetPosition(vtkm::Float32(tickPos[0] - tickSize[0]), vtkm::Float32(tickPos[1] - tickSize[1]), vtkm::Float32(tickPos[2] - tickSize[2])); - vtkm::Vec pp(vtkm::Float32(tickPos[0] - tickSize[0]), - vtkm::Float32(tickPos[1] - tickSize[1]), - vtkm::Float32(tickPos[2] - tickSize[2])); + vtkm::Vec3f_32 pp(vtkm::Float32(tickPos[0] - tickSize[0]), + vtkm::Float32(tickPos[1] - tickSize[1]), + vtkm::Float32(tickPos[2] - tickSize[2])); this->Labels[i]->SetAlignment(TextAnnotation::HCenter, TextAnnotation::VCenter); } @@ -161,11 +157,10 @@ void AxisAnnotation3D::Render(const Camera& camera, unsigned int nminor = (unsigned int)proportions.size(); for (unsigned int i = 0; i < nminor; ++i) { - vtkm::Vec tickPos = - proportions[i] * (this->Point1 - this->Point0) + this->Point0; + vtkm::Vec3f_64 tickPos = proportions[i] * (this->Point1 - this->Point0) + this->Point0; for (int pass = 0; pass <= 1; pass++) { - vtkm::Vec tickSize(0); + vtkm::Vec3f_64 tickSize(0); if (pass == 0) { switch (this->Axis) @@ -197,8 +192,8 @@ void AxisAnnotation3D::Render(const Camera& camera, } } tickSize = tickSize * this->Invert; - vtkm::Vec start = tickPos - tickSize * this->TickMinorOffset; - vtkm::Vec end = tickPos - tickSize * (1.0 - this->TickMinorOffset); + vtkm::Vec3f_64 start = tickPos - tickSize * this->TickMinorOffset; + vtkm::Vec3f_64 end = tickPos - tickSize * (1.0 - this->TickMinorOffset); worldAnnotator.AddLine(start, end, this->LineWidth, this->Color, infront); } diff --git a/vtkm/rendering/AxisAnnotation3D.h b/vtkm/rendering/AxisAnnotation3D.h index 078036dfc..71d8884e0 100644 --- a/vtkm/rendering/AxisAnnotation3D.h +++ b/vtkm/rendering/AxisAnnotation3D.h @@ -36,8 +36,8 @@ protected: vtkm::Float64 TickMajorSize, TickMajorOffset; vtkm::Float64 TickMinorSize, TickMinorOffset; int Axis; - vtkm::Vec Invert; - vtkm::Vec Point0, Point1; + vtkm::Vec3f_32 Invert; + vtkm::Vec3f_64 Point0, Point1; vtkm::Range Range; vtkm::Float64 FontScale; vtkm::Float32 FontOffset; @@ -83,8 +83,7 @@ public: } VTKM_CONT - void SetWorldPosition(const vtkm::Vec& point0, - const vtkm::Vec& point1) + void SetWorldPosition(const vtkm::Vec3f_64& point0, const vtkm::Vec3f_64& point1) { this->Point0 = point0; this->Point1 = point1; diff --git a/vtkm/rendering/Camera.cxx b/vtkm/rendering/Camera.cxx index c5cc96935..c1ac84c1c 100644 --- a/vtkm/rendering/Camera.cxx +++ b/vtkm/rendering/Camera.cxx @@ -58,11 +58,10 @@ vtkm::Matrix Camera::Camera3DStruct::CreateProjectionMatrix vtkm::Matrix Camera::Camera2DStruct::CreateViewMatrix() const { - vtkm::Vec lookAt( - (this->Left + this->Right) / 2.f, (this->Top + this->Bottom) / 2.f, 0.f); - vtkm::Vec position = lookAt; + vtkm::Vec3f_32 lookAt((this->Left + this->Right) / 2.f, (this->Top + this->Bottom) / 2.f, 0.f); + vtkm::Vec3f_32 position = lookAt; position[2] = 1.f; - vtkm::Vec up(0, 1, 0); + vtkm::Vec3f_32 up(0, 1, 0); vtkm::Matrix V = MatrixHelpers::ViewMatrix(position, lookAt, up); vtkm::Matrix scaleMatrix = MatrixHelpers::CreateScale(this->XScale, 1, 1); V = vtkm::MatrixMultiply(scaleMatrix, V); @@ -274,13 +273,13 @@ void Camera::ResetToBounds(const vtkm::Bounds& dataBounds, db.Z.Min -= viewPadAmount; // Reset for 3D camera - vtkm::Vec directionOfProjection = this->GetPosition() - this->GetLookAt(); + vtkm::Vec3f_32 directionOfProjection = this->GetPosition() - this->GetLookAt(); vtkm::Normalize(directionOfProjection); - vtkm::Vec center = db.Center(); + vtkm::Vec3f_32 center = db.Center(); this->SetLookAt(center); - vtkm::Vec totalExtent; + vtkm::Vec3f_32 totalExtent; totalExtent[0] = vtkm::Float32(db.X.Length()); totalExtent[1] = vtkm::Float32(db.Y.Length()); totalExtent[2] = vtkm::Float32(db.Z.Length()); @@ -317,7 +316,7 @@ void Camera::ResetToBounds(const vtkm::Bounds& dataBounds) void Camera::Roll(vtkm::Float32 angleDegrees) { - vtkm::Vec directionOfProjection = this->GetLookAt() - this->GetPosition(); + vtkm::Vec3f_32 directionOfProjection = this->GetLookAt() - this->GetPosition(); vtkm::Matrix rotateTransform = vtkm::Transform3DRotate(angleDegrees, directionOfProjection); @@ -338,7 +337,7 @@ void Camera::Azimuth(vtkm::Float32 angleDegrees) void Camera::Elevation(vtkm::Float32 angleDegrees) { - vtkm::Vec axisOfRotation = + vtkm::Vec3f_32 axisOfRotation = vtkm::Cross(this->GetPosition() - this->GetLookAt(), this->GetViewUp()); // Translate to the focal point (LookAt), rotate about the defined axis, @@ -358,7 +357,7 @@ void Camera::Dolly(vtkm::Float32 value) return; } - vtkm::Vec lookAtToPos = this->GetPosition() - this->GetLookAt(); + vtkm::Vec3f_32 lookAtToPos = this->GetPosition() - this->GetLookAt(); this->SetPosition(this->GetLookAt() + (1.0f / value) * lookAtToPos); } diff --git a/vtkm/rendering/Camera.h b/vtkm/rendering/Camera.h index be3564cd0..51c535a66 100644 --- a/vtkm/rendering/Camera.h +++ b/vtkm/rendering/Camera.h @@ -49,9 +49,9 @@ class VTKM_RENDERING_EXPORT Camera vtkm::Float32 nearPlane, vtkm::Float32 farPlane) const; - vtkm::Vec LookAt; - vtkm::Vec Position; - vtkm::Vec ViewUp; + vtkm::Vec3f_32 LookAt; + vtkm::Vec3f_32 Position; + vtkm::Vec3f_32 ViewUp; vtkm::Float32 FieldOfView; vtkm::Float32 XPan; vtkm::Float32 YPan; @@ -234,9 +234,9 @@ public: /// position. If \c LookAt is set, the mode is changed to 3D mode. /// VTKM_CONT - const vtkm::Vec& GetLookAt() const { return this->Camera3D.LookAt; } + const vtkm::Vec3f_32& GetLookAt() const { return this->Camera3D.LookAt; } VTKM_CONT - void SetLookAt(const vtkm::Vec& lookAt) + void SetLookAt(const vtkm::Vec3f_32& lookAt) { this->SetModeTo3D(); this->Camera3D.LookAt = lookAt; @@ -253,18 +253,15 @@ public: /// \c Position is set, the mode is changed to 3D mode. /// VTKM_CONT - const vtkm::Vec& GetPosition() const { return this->Camera3D.Position; } + const vtkm::Vec3f_32& GetPosition() const { return this->Camera3D.Position; } VTKM_CONT - void SetPosition(const vtkm::Vec& position) + void SetPosition(const vtkm::Vec3f_32& position) { this->SetModeTo3D(); this->Camera3D.Position = position; } VTKM_CONT - void SetPosition(const vtkm::Vec& position) - { - this->SetPosition(vtkm::Vec(position)); - } + void SetPosition(const vtkm::Vec3f_64& position) { this->SetPosition(vtkm::Vec3f_32(position)); } /// \brief The up orientation of the camera in 3D mode /// @@ -274,18 +271,15 @@ public: /// view up. If \c ViewUp is set, the mode is changed to 3D mode. /// VTKM_CONT - const vtkm::Vec& GetViewUp() const { return this->Camera3D.ViewUp; } + const vtkm::Vec3f_32& GetViewUp() const { return this->Camera3D.ViewUp; } VTKM_CONT - void SetViewUp(const vtkm::Vec& viewUp) + void SetViewUp(const vtkm::Vec3f_32& viewUp) { this->SetModeTo3D(); this->Camera3D.ViewUp = viewUp; } VTKM_CONT - void SetViewUp(const vtkm::Vec& viewUp) - { - this->SetViewUp(vtkm::Vec(viewUp)); - } + void SetViewUp(const vtkm::Vec3f_64& viewUp) { this->SetViewUp(vtkm::Vec3f_32(viewUp)); } /// \brief The xscale of the camera /// @@ -334,15 +328,15 @@ public: this->Pan(static_cast(dx), static_cast(dy)); } VTKM_CONT - void Pan(vtkm::Vec direction) { this->Pan(direction[0], direction[1]); } + void Pan(vtkm::Vec2f_32 direction) { this->Pan(direction[0], direction[1]); } VTKM_CONT - void Pan(vtkm::Vec direction) { this->Pan(direction[0], direction[1]); } + void Pan(vtkm::Vec2f_64 direction) { this->Pan(direction[0], direction[1]); } VTKM_CONT - vtkm::Vec GetPan() const + vtkm::Vec2f_32 GetPan() const { - vtkm::Vec pan; + vtkm::Vec2f_32 pan; pan[0] = this->Camera3D.XPan; pan[1] = this->Camera3D.YPan; return pan; diff --git a/vtkm/rendering/Canvas.cxx b/vtkm/rendering/Canvas.cxx index 7bc725cb2..3ef31494d 100644 --- a/vtkm/rendering/Canvas.cxx +++ b/vtkm/rendering/Canvas.cxx @@ -41,7 +41,7 @@ struct ClearBuffers : public vtkm::worklet::WorkletMapField ClearBuffers() {} VTKM_EXEC - void operator()(vtkm::Vec& color, vtkm::Float32& depth) const + void operator()(vtkm::Vec4f_32& color, vtkm::Float32& depth) const { color[0] = 0.f; color[1] = 0.f; @@ -55,10 +55,10 @@ struct ClearBuffers : public vtkm::worklet::WorkletMapField struct BlendBackground : public vtkm::worklet::WorkletMapField { - vtkm::Vec BackgroundColor; + vtkm::Vec4f_32 BackgroundColor; VTKM_CONT - BlendBackground(const vtkm::Vec& backgroundColor) + BlendBackground(const vtkm::Vec4f_32& backgroundColor) : BackgroundColor(backgroundColor) { } @@ -66,7 +66,7 @@ struct BlendBackground : public vtkm::worklet::WorkletMapField using ControlSignature = void(FieldInOut); using ExecutionSignature = void(_1); - VTKM_EXEC void operator()(vtkm::Vec& color) const + VTKM_EXEC void operator()(vtkm::Vec4f_32& color) const { if (color[3] >= 1.f) return; @@ -85,10 +85,7 @@ struct DrawColorSwatch : public vtkm::worklet::WorkletMapField using ExecutionSignature = void(_1, _2); VTKM_CONT - DrawColorSwatch(vtkm::Id2 dims, - vtkm::Id2 xBounds, - vtkm::Id2 yBounds, - const vtkm::Vec color) + DrawColorSwatch(vtkm::Id2 dims, vtkm::Id2 xBounds, vtkm::Id2 yBounds, const vtkm::Vec4f_32 color) : Color(color) { ImageWidth = dims[0]; @@ -119,7 +116,7 @@ struct DrawColorSwatch : public vtkm::worklet::WorkletMapField vtkm::Id2 SwatchBottomLeft; vtkm::Id SwatchWidth; vtkm::Id SwatchHeight; - const vtkm::Vec Color; + const vtkm::Vec4f_32 Color; }; // struct DrawColorSwatch struct DrawColorBar : public vtkm::worklet::WorkletMapField @@ -150,7 +147,7 @@ struct DrawColorBar : public vtkm::worklet::WorkletMapField vtkm::Id sample = Horizontal ? x : y; - const vtkm::Vec color = colorMap.Get(sample); + const vtkm::Vec4ui_8 color = colorMap.Get(sample); vtkm::Float32 normalizedHeight = Horizontal ? static_cast(y) / static_cast(BarHeight) @@ -170,20 +167,19 @@ struct DrawColorBar : public vtkm::worklet::WorkletMapField constexpr vtkm::Float32 intensity = 0.4f; constexpr vtkm::Float32 inverseIntensity = (1.0f - intensity); alpha *= inverseIntensity; - vtkm::Vec blendedColor( - 1.0f * intensity + (color[0] * conversionToFloatSpace) * alpha, - 1.0f * intensity + (color[1] * conversionToFloatSpace) * alpha, - 1.0f * intensity + (color[2] * conversionToFloatSpace) * alpha, - 1.0f); + vtkm::Vec4f_32 blendedColor(1.0f * intensity + (color[0] * conversionToFloatSpace) * alpha, + 1.0f * intensity + (color[1] * conversionToFloatSpace) * alpha, + 1.0f * intensity + (color[2] * conversionToFloatSpace) * alpha, + 1.0f); frameBuffer.Set(offset, blendedColor); } else { // make sure this is opaque - vtkm::Vec fColor((color[0] * conversionToFloatSpace), - (color[1] * conversionToFloatSpace), - (color[2] * conversionToFloatSpace), - 1.0f); + vtkm::Vec4f_32 fColor((color[0] * conversionToFloatSpace), + (color[1] * conversionToFloatSpace), + (color[2] * conversionToFloatSpace), + 1.0f); frameBuffer.Set(offset, fColor); } } @@ -340,10 +336,10 @@ void Canvas::ResizeBuffers(vtkm::Id width, vtkm::Id height) Internals->Height = height; } -void Canvas::AddColorSwatch(const vtkm::Vec& point0, - const vtkm::Vec& vtkmNotUsed(point1), - const vtkm::Vec& point2, - const vtkm::Vec& vtkmNotUsed(point3), +void Canvas::AddColorSwatch(const vtkm::Vec2f_64& point0, + const vtkm::Vec2f_64& vtkmNotUsed(point1), + const vtkm::Vec2f_64& point2, + const vtkm::Vec2f_64& vtkmNotUsed(point3), const vtkm::rendering::Color& color) const { vtkm::Float64 width = static_cast(this->GetWidth()); @@ -381,8 +377,8 @@ void Canvas::AddColorSwatch(const vtkm::Float64 x0, color); } -void Canvas::AddLine(const vtkm::Vec& point0, - const vtkm::Vec& point1, +void Canvas::AddLine(const vtkm::Vec2f_64& point0, + const vtkm::Vec2f_64& point1, vtkm::Float32 linewidth, const vtkm::rendering::Color& color) const { @@ -417,7 +413,7 @@ void Canvas::AddColorBar(const vtkm::Bounds& bounds, vtkm::Id barHeight = y[1] - y[0]; vtkm::Id numSamples = horizontal ? barWidth : barHeight; - vtkm::cont::ArrayHandle> colorMap; + vtkm::cont::ArrayHandle colorMap; { vtkm::cont::ScopedRuntimeDeviceTracker tracker(vtkm::cont::DeviceAdapterTagSerial{}); @@ -451,7 +447,7 @@ vtkm::Id2 Canvas::GetScreenPoint(vtkm::Float32 x, vtkm::Float32 z, const vtkm::Matrix& transform) const { - vtkm::Vec point(x, y, z, 1.0f); + vtkm::Vec4f_32 point(x, y, z, 1.0f); point = vtkm::MatrixMultiply(transform, point); vtkm::Id2 pixelPos; @@ -464,7 +460,7 @@ vtkm::Id2 Canvas::GetScreenPoint(vtkm::Float32 x, void Canvas::AddText(const vtkm::Matrix& transform, vtkm::Float32 scale, - const vtkm::Vec& anchor, + const vtkm::Vec2f_32& anchor, const vtkm::rendering::Color& color, const std::string& text, const vtkm::Float32& depth) const @@ -482,18 +478,18 @@ void Canvas::AddText(const vtkm::Matrix& transform, fontRenderer.RenderText(transform, scale, anchor, color, text, depth); } -void Canvas::AddText(const vtkm::Vec& position, +void Canvas::AddText(const vtkm::Vec2f_32& position, vtkm::Float32 scale, vtkm::Float32 angle, vtkm::Float32 windowAspect, - const vtkm::Vec& anchor, + const vtkm::Vec2f_32& anchor, const vtkm::rendering::Color& color, const std::string& text) const { vtkm::Matrix translationMatrix = Transform3DTranslate(position[0], position[1], 0.f); vtkm::Matrix scaleMatrix = Transform3DScale(1.0f / windowAspect, 1.0f, 1.0f); - vtkm::Vec rotationAxis(0.0f, 0.0f, 1.0f); + vtkm::Vec3f_32 rotationAxis(0.0f, 0.0f, 1.0f); vtkm::Matrix rotationMatrix = Transform3DRotate(angle, rotationAxis); vtkm::Matrix transform = vtkm::MatrixMultiply(translationMatrix, vtkm::MatrixMultiply(scaleMatrix, rotationMatrix)); @@ -581,7 +577,7 @@ void Canvas::SaveAs(const std::string& fileName) const { for (vtkm::Id xIndex = 0; xIndex < width; xIndex++) { - vtkm::Vec tuple = colorPortal.Get(yIndex * width + xIndex); + vtkm::Vec4f_32 tuple = colorPortal.Get(yIndex * width + xIndex); of << (unsigned char)(tuple[0] * 255); of << (unsigned char)(tuple[1] * 255); of << (unsigned char)(tuple[2] * 255); diff --git a/vtkm/rendering/Canvas.h b/vtkm/rendering/Canvas.h index 3ea8b0c72..0929e0052 100644 --- a/vtkm/rendering/Canvas.h +++ b/vtkm/rendering/Canvas.h @@ -33,7 +33,7 @@ class WorldAnnotator; class VTKM_RENDERING_EXPORT Canvas { public: - using ColorBufferType = vtkm::cont::ArrayHandle>; + using ColorBufferType = vtkm::cont::ArrayHandle; using DepthBufferType = vtkm::cont::ArrayHandle; using FontTextureType = vtkm::rendering::Texture2D<1>; @@ -112,10 +112,10 @@ public: virtual vtkm::rendering::WorldAnnotator* CreateWorldAnnotator() const; VTKM_CONT - virtual void AddColorSwatch(const vtkm::Vec& point0, - const vtkm::Vec& point1, - const vtkm::Vec& point2, - const vtkm::Vec& point3, + virtual void AddColorSwatch(const vtkm::Vec2f_64& point0, + const vtkm::Vec2f_64& point1, + const vtkm::Vec2f_64& point2, + const vtkm::Vec2f_64& point3, const vtkm::rendering::Color& color) const; VTKM_CONT @@ -130,8 +130,8 @@ public: const vtkm::rendering::Color& color) const; VTKM_CONT - virtual void AddLine(const vtkm::Vec& point0, - const vtkm::Vec& point1, + virtual void AddLine(const vtkm::Vec2f_64& point0, + const vtkm::Vec2f_64& point1, vtkm::Float32 linewidth, const vtkm::rendering::Color& color) const; @@ -156,11 +156,11 @@ public: const vtkm::cont::ColorTable& colorTable, bool horizontal) const; - virtual void AddText(const vtkm::Vec& position, + virtual void AddText(const vtkm::Vec2f_32& position, vtkm::Float32 scale, vtkm::Float32 angle, vtkm::Float32 windowAspect, - const vtkm::Vec& anchor, + const vtkm::Vec2f_32& anchor, const vtkm::rendering::Color& color, const std::string& text) const; @@ -178,7 +178,7 @@ public: VTKM_CONT void AddText(const vtkm::Matrix& transform, vtkm::Float32 scale, - const vtkm::Vec& anchor, + const vtkm::Vec2f_32& anchor, const vtkm::rendering::Color& color, const std::string& text, const vtkm::Float32& depth = 0) const; diff --git a/vtkm/rendering/CanvasGL.cxx b/vtkm/rendering/CanvasGL.cxx index e75f32ed6..e9fe3d190 100644 --- a/vtkm/rendering/CanvasGL.cxx +++ b/vtkm/rendering/CanvasGL.cxx @@ -163,10 +163,10 @@ void CanvasGL::RefreshDepthBuffer() const const_cast(this->GetDepthBuffer().GetStorage().GetArray())); } -void CanvasGL::AddColorSwatch(const vtkm::Vec& point0, - const vtkm::Vec& point1, - const vtkm::Vec& point2, - const vtkm::Vec& point3, +void CanvasGL::AddColorSwatch(const vtkm::Vec2f_64& point0, + const vtkm::Vec2f_64& point1, + const vtkm::Vec2f_64& point2, + const vtkm::Vec2f_64& point3, const vtkm::rendering::Color& color) const { glDisable(GL_DEPTH_TEST); @@ -184,8 +184,8 @@ void CanvasGL::AddColorSwatch(const vtkm::Vec& point0, glEnd(); } -void CanvasGL::AddLine(const vtkm::Vec& point0, - const vtkm::Vec& point1, +void CanvasGL::AddLine(const vtkm::Vec2f_64& point0, + const vtkm::Vec2f_64& point1, vtkm::Float32 linewidth, const vtkm::rendering::Color& color) const { @@ -207,7 +207,7 @@ void CanvasGL::AddColorBar(const vtkm::Bounds& bounds, { const int n = 256; //map through the color table for our 256 + 1 points as the first step - vtkm::cont::ArrayHandle> colors; + vtkm::cont::ArrayHandle colors; colorTable.Sample(n + 1, colors); vtkm::Float32 startX = static_cast(bounds.X.Min); @@ -256,11 +256,11 @@ void CanvasGL::AddColorBar(const vtkm::Bounds& bounds, glEnd(); } -void CanvasGL::AddText(const vtkm::Vec& position, +void CanvasGL::AddText(const vtkm::Vec2f_32& position, vtkm::Float32 scale, vtkm::Float32 angle, vtkm::Float32 windowAspect, - const vtkm::Vec& anchor, + const vtkm::Vec2f_32& anchor, const vtkm::rendering::Color& color, const std::string& text) const { @@ -279,7 +279,7 @@ vtkm::rendering::WorldAnnotator* CanvasGL::CreateWorldAnnotator() const } void CanvasGL::RenderText(vtkm::Float32 scale, - const vtkm::Vec& anchor, + const vtkm::Vec2f_32& anchor, const std::string& text) const { if (!this->FontTexture.Valid()) diff --git a/vtkm/rendering/CanvasGL.h b/vtkm/rendering/CanvasGL.h index 7c82edbb6..93f9504dc 100644 --- a/vtkm/rendering/CanvasGL.h +++ b/vtkm/rendering/CanvasGL.h @@ -51,8 +51,8 @@ public: vtkm::rendering::WorldAnnotator* CreateWorldAnnotator() const override; protected: - void AddLine(const vtkm::Vec& point0, - const vtkm::Vec& point1, + void AddLine(const vtkm::Vec2f_64& point0, + const vtkm::Vec2f_64& point1, vtkm::Float32 linewidth, const vtkm::rendering::Color& color) const override; @@ -60,17 +60,17 @@ protected: const vtkm::cont::ColorTable& colorTable, bool horizontal) const override; - void AddColorSwatch(const vtkm::Vec& point0, - const vtkm::Vec& point1, - const vtkm::Vec& point2, - const vtkm::Vec& point3, + void AddColorSwatch(const vtkm::Vec2f_64& point0, + const vtkm::Vec2f_64& point1, + const vtkm::Vec2f_64& point2, + const vtkm::Vec2f_64& point3, const vtkm::rendering::Color& color) const override; - void AddText(const vtkm::Vec& position, + void AddText(const vtkm::Vec2f_32& position, vtkm::Float32 scale, vtkm::Float32 angle, vtkm::Float32 windowAspect, - const vtkm::Vec& anchor, + const vtkm::Vec2f_32& anchor, const vtkm::rendering::Color& color, const std::string& text) const override; @@ -78,9 +78,7 @@ private: vtkm::rendering::BitmapFont Font; vtkm::rendering::TextureGL FontTexture; - void RenderText(vtkm::Float32 scale, - const vtkm::Vec& anchor, - const std::string& text) const; + void RenderText(vtkm::Float32 scale, const vtkm::Vec2f_32& anchor, const std::string& text) const; }; } } //namespace vtkm::rendering diff --git a/vtkm/rendering/CanvasOSMesa.cxx b/vtkm/rendering/CanvasOSMesa.cxx index 8431d2051..767677a98 100644 --- a/vtkm/rendering/CanvasOSMesa.cxx +++ b/vtkm/rendering/CanvasOSMesa.cxx @@ -62,7 +62,7 @@ void CanvasOSMesa::Initialize() { throw vtkm::cont::ErrorBadValue("OSMesa context creation failed."); } - vtkm::Vec* colorBuffer = this->GetColorBuffer().GetStorage().GetArray(); + vtkm::Vec4f_32* colorBuffer = this->GetColorBuffer().GetStorage().GetArray(); if (!OSMesaMakeCurrent(this->Internals->Context, reinterpret_cast(colorBuffer), GL_FLOAT, diff --git a/vtkm/rendering/CanvasRayTracer.cxx b/vtkm/rendering/CanvasRayTracer.cxx index 49a5a272c..480c4a47c 100644 --- a/vtkm/rendering/CanvasRayTracer.cxx +++ b/vtkm/rendering/CanvasRayTracer.cxx @@ -52,13 +52,13 @@ public: const vtkm::Id& index) const { vtkm::Vec intersection = origin + inDepth * dir; - vtkm::Vec point; + vtkm::Vec4f_32 point; point[0] = static_cast(intersection[0]); point[1] = static_cast(intersection[1]); point[2] = static_cast(intersection[2]); point[3] = 1.f; - vtkm::Vec newpoint; + vtkm::Vec4f_32 newpoint; newpoint = vtkm::MatrixMultiply(this->ViewProjMat, point); newpoint[0] = newpoint[0] / newpoint[3]; newpoint[1] = newpoint[1] / newpoint[3]; @@ -67,13 +67,13 @@ public: vtkm::Float32 depth = newpoint[2]; depth = 0.5f * (depth) + 0.5f; - vtkm::Vec color; + vtkm::Vec4f_32 color; color[0] = static_cast(colorBufferIn.Get(index * 4 + 0)); color[1] = static_cast(colorBufferIn.Get(index * 4 + 1)); color[2] = static_cast(colorBufferIn.Get(index * 4 + 2)); color[3] = static_cast(colorBufferIn.Get(index * 4 + 3)); // blend the mapped color with existing canvas color - vtkm::Vec inColor = colorBuffer.Get(pixelIndex); + vtkm::Vec4f_32 inColor = colorBuffer.Get(pixelIndex); // if transparency exists, all alphas have been pre-multiplied vtkm::Float32 alpha = (1.f - color[3]); diff --git a/vtkm/rendering/Color.h b/vtkm/rendering/Color.h index ef77b063a..54bcd4afa 100644 --- a/vtkm/rendering/Color.h +++ b/vtkm/rendering/Color.h @@ -28,7 +28,7 @@ namespace rendering class Color { public: - vtkm::Vec Components; + vtkm::Vec4f_32 Components; VTKM_EXEC_CONT Color() @@ -43,7 +43,7 @@ public: } VTKM_EXEC_CONT - Color(const vtkm::Vec& components) + Color(const vtkm::Vec4f_32& components) : Components(components) { } diff --git a/vtkm/rendering/ColorBarAnnotation.cxx b/vtkm/rendering/ColorBarAnnotation.cxx index 259f2790d..c3924d68b 100644 --- a/vtkm/rendering/ColorBarAnnotation.cxx +++ b/vtkm/rendering/ColorBarAnnotation.cxx @@ -87,7 +87,7 @@ void ColorBarAnnotation::Render(const vtkm::rendering::Camera& camera, if (FieldName != "") { - vtkm::Vec labelPos; + vtkm::Vec2f_32 labelPos; if (Horizontal) { labelPos[0] = vtkm::Float32(Position.X.Min); diff --git a/vtkm/rendering/ColorLegendAnnotation.cxx b/vtkm/rendering/ColorLegendAnnotation.cxx index e3850d550..024eb7c8a 100644 --- a/vtkm/rendering/ColorLegendAnnotation.cxx +++ b/vtkm/rendering/ColorLegendAnnotation.cxx @@ -61,7 +61,7 @@ void ColorLegendAnnotation::Render(const vtkm::rendering::Camera& camera, { this->Annot.push_back( std::unique_ptr(new vtkm::rendering::TextAnnotationScreen( - "test", this->LabelColor, this->FontScale, vtkm::Vec(0, 0), 0))); + "test", this->LabelColor, this->FontScale, vtkm::Vec2f_32(0, 0), 0))); } for (unsigned int i = 0; i < this->Annot.size(); ++i) diff --git a/vtkm/rendering/ConnectivityProxy.cxx b/vtkm/rendering/ConnectivityProxy.cxx index 9000c38b2..efb0c3271 100644 --- a/vtkm/rendering/ConnectivityProxy.cxx +++ b/vtkm/rendering/ConnectivityProxy.cxx @@ -23,7 +23,7 @@ namespace rendering struct ConnectivityProxy::InternalsType { protected: - using ColorMapType = vtkm::cont::ArrayHandle>; + using ColorMapType = vtkm::cont::ArrayHandle; using TracerType = vtkm::rendering::raytracing::ConnectivityTracer; TracerType Tracer; @@ -86,7 +86,7 @@ public: } VTKM_CONT - void SetColorMap(vtkm::cont::ArrayHandle>& colormap) + void SetColorMap(vtkm::cont::ArrayHandle& colormap) { Tracer.SetColorMap(colormap); } @@ -285,7 +285,7 @@ void ConnectivityProxy::SetScalarField(const std::string& fieldName) } VTKM_CONT -void ConnectivityProxy::SetColorMap(vtkm::cont::ArrayHandle>& colormap) +void ConnectivityProxy::SetColorMap(vtkm::cont::ArrayHandle& colormap) { Internals->SetColorMap(colormap); } diff --git a/vtkm/rendering/ConnectivityProxy.h b/vtkm/rendering/ConnectivityProxy.h index 0d8f869a7..618ad356f 100644 --- a/vtkm/rendering/ConnectivityProxy.h +++ b/vtkm/rendering/ConnectivityProxy.h @@ -48,7 +48,7 @@ public: void SetEmissionField(const std::string& fieldName); void SetCamera(const vtkm::rendering::Camera& camera); void SetScalarRange(const vtkm::Range& range); - void SetColorMap(vtkm::cont::ArrayHandle>& colormap); + void SetColorMap(vtkm::cont::ArrayHandle& colormap); void SetCompositeBackground(bool on); void SetDebugPrints(bool on); void SetUnitScalar(vtkm::Float32 unitScalar); diff --git a/vtkm/rendering/Cylinderizer.h b/vtkm/rendering/Cylinderizer.h index 8cbec958e..c78652de3 100644 --- a/vtkm/rendering/Cylinderizer.h +++ b/vtkm/rendering/Cylinderizer.h @@ -126,7 +126,7 @@ public: else if (DIM == 3) { vtkm::Id offset = cellIndex * TRI_PER_CSS * SEG_PER_TRI; - vtkm::Vec segment; + vtkm::Id3 segment; segment[0] = cellIndex; vtkm::Id3 idx; idx[0] = 0; @@ -409,7 +409,7 @@ public: VTKM_CONT void Run(const vtkm::cont::DynamicCellSet& cellset, - vtkm::cont::ArrayHandle>& outputIndices, + vtkm::cont::ArrayHandle& outputIndices, vtkm::Id& output) { if (cellset.IsSameType(vtkm::cont::CellSetStructured<3>())) diff --git a/vtkm/rendering/LineRenderer.cxx b/vtkm/rendering/LineRenderer.cxx index fb8c95068..208bfef19 100644 --- a/vtkm/rendering/LineRenderer.cxx +++ b/vtkm/rendering/LineRenderer.cxx @@ -27,8 +27,8 @@ LineRenderer::LineRenderer(const vtkm::rendering::Canvas* canvas, { } -void LineRenderer::RenderLine(const vtkm::Vec& point0, - const vtkm::Vec& point1, +void LineRenderer::RenderLine(const vtkm::Vec2f_64& point0, + const vtkm::Vec2f_64& point1, vtkm::Float32 lineWidth, const vtkm::rendering::Color& color) { @@ -38,13 +38,13 @@ void LineRenderer::RenderLine(const vtkm::Vec& point0, color); } -void LineRenderer::RenderLine(const vtkm::Vec& point0, - const vtkm::Vec& point1, +void LineRenderer::RenderLine(const vtkm::Vec3f_64& point0, + const vtkm::Vec3f_64& point1, vtkm::Float32 vtkmNotUsed(lineWidth), const vtkm::rendering::Color& color) { - vtkm::Vec p0 = TransformPoint(point0); - vtkm::Vec p1 = TransformPoint(point1); + vtkm::Vec3f_32 p0 = TransformPoint(point0); + vtkm::Vec3f_32 p1 = TransformPoint(point1); vtkm::Id x0 = static_cast(vtkm::Round(p0[0])); vtkm::Id y0 = static_cast(vtkm::Round(p0[1])); @@ -59,7 +59,7 @@ void LineRenderer::RenderLine(const vtkm::Vec& point0, vtkm::rendering::Canvas::ColorBufferType(Canvas->GetColorBuffer()).GetPortalControl(); auto depthPortal = vtkm::rendering::Canvas::DepthBufferType(Canvas->GetDepthBuffer()).GetPortalControl(); - vtkm::Vec colorC = color.Components; + vtkm::Vec4f_32 colorC = color.Components; while (x0 >= 0 && x0 < Canvas->GetWidth() && y0 >= 0 && y0 < Canvas->GetHeight()) { @@ -67,12 +67,12 @@ void LineRenderer::RenderLine(const vtkm::Vec& point0, t = vtkm::Min(1.f, vtkm::Max(0.f, t)); vtkm::Float32 z = vtkm::Lerp(z0, z1, t); vtkm::Id index = y0 * Canvas->GetWidth() + x0; - vtkm::Vec currentColor = colorPortal.Get(index); + vtkm::Vec4f_32 currentColor = colorPortal.Get(index); vtkm::Float32 currentZ = depthPortal.Get(index); bool blend = currentColor[3] < 1.f && z > currentZ; if (currentZ > z || blend) { - vtkm::Vec writeColor = colorC; + vtkm::Vec4f_32 writeColor = colorC; vtkm::Float32 depth = z; if (blend) @@ -110,15 +110,14 @@ void LineRenderer::RenderLine(const vtkm::Vec& point0, } } -vtkm::Vec LineRenderer::TransformPoint( - const vtkm::Vec& point) const +vtkm::Vec3f_32 LineRenderer::TransformPoint(const vtkm::Vec3f_64& point) const { - vtkm::Vec temp(static_cast(point[0]), - static_cast(point[1]), - static_cast(point[2]), - 1.0f); + vtkm::Vec4f_32 temp(static_cast(point[0]), + static_cast(point[1]), + static_cast(point[2]), + 1.0f); temp = vtkm::MatrixMultiply(Transform, temp); - vtkm::Vec p; + vtkm::Vec3f_32 p; for (vtkm::IdComponent i = 0; i < 3; ++i) { p[i] = static_cast(temp[i] / temp[3]); diff --git a/vtkm/rendering/LineRenderer.h b/vtkm/rendering/LineRenderer.h index 1a3ce30dd..a3b1d9994 100644 --- a/vtkm/rendering/LineRenderer.h +++ b/vtkm/rendering/LineRenderer.h @@ -28,20 +28,20 @@ public: LineRenderer(const vtkm::rendering::Canvas* canvas, vtkm::Matrix transform); VTKM_CONT - void RenderLine(const vtkm::Vec& point0, - const vtkm::Vec& point1, + void RenderLine(const vtkm::Vec2f_64& point0, + const vtkm::Vec2f_64& point1, vtkm::Float32 lineWidth, const vtkm::rendering::Color& color); VTKM_CONT - void RenderLine(const vtkm::Vec& point0, - const vtkm::Vec& point1, + void RenderLine(const vtkm::Vec3f_64& point0, + const vtkm::Vec3f_64& point1, vtkm::Float32 lineWidth, const vtkm::rendering::Color& color); private: VTKM_CONT - vtkm::Vec TransformPoint(const vtkm::Vec& point) const; + vtkm::Vec3f_32 TransformPoint(const vtkm::Vec3f_64& point) const; const vtkm::rendering::Canvas* Canvas; vtkm::Matrix Transform; diff --git a/vtkm/rendering/Mapper.cxx b/vtkm/rendering/Mapper.cxx index 20c93b9dc..90583eee8 100644 --- a/vtkm/rendering/Mapper.cxx +++ b/vtkm/rendering/Mapper.cxx @@ -26,7 +26,7 @@ void Mapper::SetActiveColorTable(const vtkm::cont::ColorTable& colorTable) constexpr vtkm::Float32 conversionToFloatSpace = (1.0f / 255.0f); - vtkm::cont::ArrayHandle> temp; + vtkm::cont::ArrayHandle temp; { vtkm::cont::ScopedRuntimeDeviceTracker tracker(vtkm::cont::DeviceAdapterTagSerial{}); @@ -39,10 +39,10 @@ void Mapper::SetActiveColorTable(const vtkm::cont::ColorTable& colorTable) for (vtkm::Id i = 0; i < 1024; ++i) { auto color = colorPortal.Get(i); - vtkm::Vec t(color[0] * conversionToFloatSpace, - color[1] * conversionToFloatSpace, - color[2] * conversionToFloatSpace, - color[3] * conversionToFloatSpace); + vtkm::Vec4f_32 t(color[0] * conversionToFloatSpace, + color[1] * conversionToFloatSpace, + color[2] * conversionToFloatSpace, + color[3] * conversionToFloatSpace); portal.Set(i, t); } } diff --git a/vtkm/rendering/Mapper.h b/vtkm/rendering/Mapper.h index befaa7a1c..7aa92004a 100644 --- a/vtkm/rendering/Mapper.h +++ b/vtkm/rendering/Mapper.h @@ -49,7 +49,7 @@ public: virtual void SetLogarithmY(bool l); protected: - vtkm::cont::ArrayHandle> ColorMap; + vtkm::cont::ArrayHandle ColorMap; bool LogarithmX = false; bool LogarithmY = false; }; diff --git a/vtkm/rendering/MapperCylinder.cxx b/vtkm/rendering/MapperCylinder.cxx index 16d698331..dfbbc7e5e 100644 --- a/vtkm/rendering/MapperCylinder.cxx +++ b/vtkm/rendering/MapperCylinder.cxx @@ -32,7 +32,7 @@ class CalcDistance : public vtkm::worklet::WorkletMapField { public: VTKM_CONT - CalcDistance(const vtkm::Vec& _eye_pos) + CalcDistance(const vtkm::Vec3f_32& _eye_pos) : eye_pos(_eye_pos) { } @@ -45,7 +45,7 @@ public: out = static_cast(vtkm::Sqrt(vtkm::dot(tmp, tmp))); } - const vtkm::Vec eye_pos; + const vtkm::Vec3f_32 eye_pos; }; //class CalcDistance struct MapperCylinder::InternalsType diff --git a/vtkm/rendering/MapperGL.cxx b/vtkm/rendering/MapperGL.cxx index 57828bdb1..20274cf51 100644 --- a/vtkm/rendering/MapperGL.cxx +++ b/vtkm/rendering/MapperGL.cxx @@ -68,14 +68,14 @@ public: OutputArrayPortalType& c_array, OutputArrayPortalType& v_array) const { - vtkm::Vec idx = indices.Get(i); + vtkm::Id4 idx = indices.Get(i); vtkm::Id i1 = idx[1]; vtkm::Id i2 = idx[2]; vtkm::Id i3 = idx[3]; - vtkm::Vec p1 = verts.Get(idx[1]); - vtkm::Vec p2 = verts.Get(idx[2]); - vtkm::Vec p3 = verts.Get(idx[3]); + vtkm::Vec3f_32 p1 = verts.Get(idx[1]); + vtkm::Vec3f_32 p2 = verts.Get(idx[2]); + vtkm::Vec3f_32 p3 = verts.Get(idx[3]); vtkm::Float32 s; vtkm::Vec color1; @@ -132,7 +132,7 @@ public: template struct MapColorAndVerticesInvokeFunctor { - vtkm::cont::ArrayHandle> TriangleIndices; + vtkm::cont::ArrayHandle TriangleIndices; vtkm::cont::ColorTable ColorTable; const vtkm::cont::ArrayHandle Scalar; const vtkm::Range ScalarRange; @@ -143,7 +143,7 @@ struct MapColorAndVerticesInvokeFunctor vtkm::cont::ArrayHandle OutVertices; VTKM_CONT - MapColorAndVerticesInvokeFunctor(const vtkm::cont::ArrayHandle>& indices, + MapColorAndVerticesInvokeFunctor(const vtkm::cont::ArrayHandle& indices, const vtkm::cont::ColorTable& colorTable, const vtkm::cont::ArrayHandle& scalar, const vtkm::Range& scalarRange, @@ -212,7 +212,7 @@ VTKM_CONT void RenderStructuredLineSegments(vtkm::Id numVerts, glBegin(GL_LINE_STRIP); for (int i = 0; i < numVerts; i++) { - vtkm::Vec pt = verts.GetPortalConstControl().Get(i); + vtkm::Vec3f_32 pt = verts.GetPortalConstControl().Get(i); vtkm::Float32 s = scalar.GetPortalConstControl().Get(i); if (logY) s = vtkm::Float32(log10(s)); @@ -247,7 +247,7 @@ VTKM_CONT void RenderExplicitLineSegments(vtkm::Id numVerts, glBegin(GL_LINE_STRIP); for (int i = 0; i < numVerts; i++) { - vtkm::Vec pt = verts.GetPortalConstControl().Get(i); + vtkm::Vec3f_32 pt = verts.GetPortalConstControl().Get(i); vtkm::Float32 s = scalar.GetPortalConstControl().Get(i); if (logY) s = vtkm::Float32(log10(s)); @@ -260,7 +260,7 @@ template VTKM_CONT void RenderTriangles(MapperGL& mapper, vtkm::Id numTri, const PtType& verts, - const vtkm::cont::ArrayHandle>& indices, + const vtkm::cont::ArrayHandle& indices, const vtkm::cont::ArrayHandle& scalar, const vtkm::cont::ColorTable& ct, const vtkm::Range& scalarRange, @@ -460,27 +460,27 @@ void MapperGL::RenderCells(const vtkm::cont::DynamicCellSet& cellset, cellset.Cast>().GetCellShapeAsId() == vtkm::CELL_SHAPE_LINE) { - vtkm::cont::ArrayHandle> verts; - verts = dcoords.Cast>>(); + vtkm::cont::ArrayHandle verts; + verts = dcoords.Cast>(); RenderExplicitLineSegments(numVerts, verts, sf, colorTable, this->LogarithmY); } else { - vtkm::cont::ArrayHandle> indices; + vtkm::cont::ArrayHandle indices; vtkm::Id numTri; vtkm::rendering::internal::RunTriangulator(cellset, indices, numTri); vtkm::cont::ArrayHandleUniformPointCoordinates uVerts; - vtkm::cont::ArrayHandle> eVerts; + vtkm::cont::ArrayHandle eVerts; if (dcoords.IsType()) { uVerts = dcoords.Cast(); RenderTriangles(*this, numTri, uVerts, indices, sf, colorTable, scalarRange, camera); } - else if (dcoords.IsType>>()) + else if (dcoords.IsType>()) { - eVerts = dcoords.Cast>>(); + eVerts = dcoords.Cast>(); RenderTriangles(*this, numTri, eVerts, indices, sf, colorTable, scalarRange, camera); } else if (dcoords.IsType - VTKM_EXEC void operator()(const vtkm::Vec& inCoord, + VTKM_EXEC void operator()(const vtkm::Vec3f_32& inCoord, const ScalarType& scalar, - vtkm::Vec& outCoord, + vtkm::Vec3f_32& outCoord, vtkm::Float32& fieldOut) const { // @@ -260,7 +260,7 @@ void MapperWireframer::RenderCells(const vtkm::cont::DynamicCellSet& inCellSet, throw vtkm::cont::ErrorBadValue( "WireFramer: field must be associated with points for 1D cell set"); } - vtkm::cont::ArrayHandle> newCoords; + vtkm::cont::ArrayHandle newCoords; vtkm::cont::ArrayHandle newScalars; // // Convert the cell set into something we can draw @@ -316,7 +316,7 @@ void MapperWireframer::RenderCells(const vtkm::cont::DynamicCellSet& inCellSet, // Extract unique edges from the cell set. vtkm::cont::ArrayHandle counts; - vtkm::cont::ArrayHandle> edgeIndices; + vtkm::cont::ArrayHandle edgeIndices; vtkm::worklet::DispatcherMapTopology().Invoke(cellSet, counts); vtkm::worklet::DispatcherMapTopology extractDispatcher( EdgesExtracter::MakeScatter(counts)); diff --git a/vtkm/rendering/MatrixHelpers.h b/vtkm/rendering/MatrixHelpers.h index a3b4fc626..7b2b495fc 100644 --- a/vtkm/rendering/MatrixHelpers.h +++ b/vtkm/rendering/MatrixHelpers.h @@ -41,14 +41,13 @@ struct MatrixHelpers oglM[15] = mtx[3][3]; } - static VTKM_CONT vtkm::Matrix ViewMatrix( - const vtkm::Vec& position, - const vtkm::Vec& lookAt, - const vtkm::Vec& up) + static VTKM_CONT vtkm::Matrix ViewMatrix(const vtkm::Vec3f_32& position, + const vtkm::Vec3f_32& lookAt, + const vtkm::Vec3f_32& up) { - vtkm::Vec viewDir = position - lookAt; - vtkm::Vec right = vtkm::Cross(up, viewDir); - vtkm::Vec ru = vtkm::Cross(viewDir, right); + vtkm::Vec3f_32 viewDir = position - lookAt; + vtkm::Vec3f_32 right = vtkm::Cross(up, viewDir); + vtkm::Vec3f_32 ru = vtkm::Cross(viewDir, right); vtkm::Normalize(viewDir); vtkm::Normalize(right); @@ -74,11 +73,10 @@ struct MatrixHelpers return matrix; } - static VTKM_CONT vtkm::Matrix WorldMatrix( - const vtkm::Vec& neworigin, - const vtkm::Vec& newx, - const vtkm::Vec& newy, - const vtkm::Vec& newz) + static VTKM_CONT vtkm::Matrix WorldMatrix(const vtkm::Vec3f_32& neworigin, + const vtkm::Vec3f_32& newx, + const vtkm::Vec3f_32& newy, + const vtkm::Vec3f_32& newz) { vtkm::Matrix matrix; vtkm::MatrixIdentity(matrix); @@ -130,11 +128,11 @@ struct MatrixHelpers return matrix; } - vtkm::Vec p1(p1x, p1y, AR3 / ((p1x * p1x + p1y * p1y) * COMPRESSION + AR3)); - vtkm::Vec p2(p2x, p2y, AR3 / ((p2x * p2x + p2y * p2y) * COMPRESSION + AR3)); - vtkm::Vec axis = vtkm::Normal(vtkm::Cross(p2, p1)); + vtkm::Vec3f_32 p1(p1x, p1y, AR3 / ((p1x * p1x + p1y * p1y) * COMPRESSION + AR3)); + vtkm::Vec3f_32 p2(p2x, p2y, AR3 / ((p2x * p2x + p2y * p2y) * COMPRESSION + AR3)); + vtkm::Vec3f_32 axis = vtkm::Normal(vtkm::Cross(p2, p1)); - vtkm::Vec p2_p1(p2[0] - p1[0], p2[1] - p1[1], p2[2] - p1[2]); + vtkm::Vec3f_32 p2_p1(p2[0] - p1[0], p2[1] - p1[1], p2[2] - p1[2]); vtkm::Float32 t = vtkm::Magnitude(p2_p1); t = vtkm::Min(vtkm::Max(t, -1.0f), 1.0f); vtkm::Float32 phi = static_cast(-2.0f * asin(t / (2.0f * RADIUS))); diff --git a/vtkm/rendering/Quadralizer.h b/vtkm/rendering/Quadralizer.h index 9ec9d26fd..ab058f5f1 100644 --- a/vtkm/rendering/Quadralizer.h +++ b/vtkm/rendering/Quadralizer.h @@ -92,7 +92,7 @@ public: #pragma warning(disable : 4127) //conditional expression is constant #endif template - VTKM_EXEC void cell2quad(vtkm::Vec idx, + VTKM_EXEC void cell2quad(vtkm::Id4 idx, vtkm::Vec& quad, const vtkm::Id offset, const CellNodeVecType& cellIndices, @@ -120,7 +120,7 @@ public: vtkm::Id offset = cellIndex * QUAD_PER_CSS; vtkm::Vec quad; quad[0] = cellIndex; - vtkm::Vec idx; + vtkm::Id4 idx; idx[0] = 0; idx[1] = 1; idx[2] = 5, idx[3] = 4; diff --git a/vtkm/rendering/TextAnnotation.cxx b/vtkm/rendering/TextAnnotation.cxx index 222ed5913..2b9475dd6 100644 --- a/vtkm/rendering/TextAnnotation.cxx +++ b/vtkm/rendering/TextAnnotation.cxx @@ -39,7 +39,7 @@ const std::string& TextAnnotation::GetText() const return this->Text; } -void TextAnnotation::SetRawAnchor(const vtkm::Vec& anchor) +void TextAnnotation::SetRawAnchor(const vtkm::Vec2f_32& anchor) { this->Anchor = anchor; } diff --git a/vtkm/rendering/TextAnnotation.h b/vtkm/rendering/TextAnnotation.h index 465094b27..46a9776bb 100644 --- a/vtkm/rendering/TextAnnotation.h +++ b/vtkm/rendering/TextAnnotation.h @@ -41,7 +41,7 @@ protected: std::string Text; Color TextColor; vtkm::Float32 Scale; - vtkm::Vec Anchor; + vtkm::Vec2f_32 Anchor; public: TextAnnotation(const std::string& text, @@ -58,7 +58,7 @@ public: /// is scaled in both directions to the range [-1,1] with -1 at the lower /// left and 1 at the upper right. /// - void SetRawAnchor(const vtkm::Vec& anchor); + void SetRawAnchor(const vtkm::Vec2f_32& anchor); void SetRawAnchor(vtkm::Float32 h, vtkm::Float32 v); diff --git a/vtkm/rendering/TextAnnotationBillboard.cxx b/vtkm/rendering/TextAnnotationBillboard.cxx index af829c5ca..416c8588d 100644 --- a/vtkm/rendering/TextAnnotationBillboard.cxx +++ b/vtkm/rendering/TextAnnotationBillboard.cxx @@ -20,7 +20,7 @@ namespace rendering TextAnnotationBillboard::TextAnnotationBillboard(const std::string& text, const vtkm::rendering::Color& color, vtkm::Float32 scalar, - const vtkm::Vec& position, + const vtkm::Vec3f_32& position, vtkm::Float32 angleDegrees) : TextAnnotation(text, color, scalar) , Position(position) @@ -32,7 +32,7 @@ TextAnnotationBillboard::~TextAnnotationBillboard() { } -void TextAnnotationBillboard::SetPosition(const vtkm::Vec& position) +void TextAnnotationBillboard::SetPosition(const vtkm::Vec3f_32& position) { this->Position = position; } @@ -49,7 +49,7 @@ void TextAnnotationBillboard::Render(const vtkm::rendering::Camera& camera, vtkm::rendering::Canvas& canvas) const { using MatrixType = vtkm::Matrix; - using VectorType = vtkm::Vec; + using VectorType = vtkm::Vec3f_32; MatrixType viewMatrix = camera.CreateViewMatrix(); MatrixType projectionMatrix = diff --git a/vtkm/rendering/TextAnnotationBillboard.h b/vtkm/rendering/TextAnnotationBillboard.h index b46b511db..7b8b5f834 100644 --- a/vtkm/rendering/TextAnnotationBillboard.h +++ b/vtkm/rendering/TextAnnotationBillboard.h @@ -20,19 +20,19 @@ namespace rendering class VTKM_RENDERING_EXPORT TextAnnotationBillboard : public TextAnnotation { protected: - vtkm::Vec Position; + vtkm::Vec3f_32 Position; vtkm::Float32 Angle; public: TextAnnotationBillboard(const std::string& text, const vtkm::rendering::Color& color, vtkm::Float32 scalar, - const vtkm::Vec& position, + const vtkm::Vec3f_32& position, vtkm::Float32 angleDegrees = 0); ~TextAnnotationBillboard(); - void SetPosition(const vtkm::Vec& position); + void SetPosition(const vtkm::Vec3f_32& position); void SetPosition(vtkm::Float32 posx, vtkm::Float32 posy, vtkm::Float32 posz); diff --git a/vtkm/rendering/TextAnnotationScreen.cxx b/vtkm/rendering/TextAnnotationScreen.cxx index ddf89eb0f..990e00cdd 100644 --- a/vtkm/rendering/TextAnnotationScreen.cxx +++ b/vtkm/rendering/TextAnnotationScreen.cxx @@ -18,7 +18,7 @@ namespace rendering TextAnnotationScreen::TextAnnotationScreen(const std::string& text, const vtkm::rendering::Color& color, vtkm::Float32 scale, - const vtkm::Vec& position, + const vtkm::Vec2f_32& position, vtkm::Float32 angleDegrees) : TextAnnotation(text, color, scale) , Position(position) @@ -30,7 +30,7 @@ TextAnnotationScreen::~TextAnnotationScreen() { } -void TextAnnotationScreen::SetPosition(const vtkm::Vec& position) +void TextAnnotationScreen::SetPosition(const vtkm::Vec2f_32& position) { this->Position = position; } diff --git a/vtkm/rendering/TextAnnotationScreen.h b/vtkm/rendering/TextAnnotationScreen.h index 6420e5cb4..8bd50659f 100644 --- a/vtkm/rendering/TextAnnotationScreen.h +++ b/vtkm/rendering/TextAnnotationScreen.h @@ -20,19 +20,19 @@ namespace rendering class VTKM_RENDERING_EXPORT TextAnnotationScreen : public TextAnnotation { protected: - vtkm::Vec Position; + vtkm::Vec2f_32 Position; vtkm::Float32 Angle; public: TextAnnotationScreen(const std::string& text, const vtkm::rendering::Color& color, vtkm::Float32 scale, - const vtkm::Vec& position, + const vtkm::Vec2f_32& position, vtkm::Float32 angleDegrees = 0); ~TextAnnotationScreen(); - void SetPosition(const vtkm::Vec& position); + void SetPosition(const vtkm::Vec2f_32& position); void SetPosition(vtkm::Float32 posx, vtkm::Float32 posy); diff --git a/vtkm/rendering/TextRenderer.cxx b/vtkm/rendering/TextRenderer.cxx index e400800f0..e8d3b705b 100644 --- a/vtkm/rendering/TextRenderer.cxx +++ b/vtkm/rendering/TextRenderer.cxx @@ -36,7 +36,7 @@ struct RenderBitmapFont : public vtkm::worklet::WorkletMapField RenderBitmapFont() {} VTKM_CONT - RenderBitmapFont(const vtkm::Vec& color, + RenderBitmapFont(const vtkm::Vec4f_32& color, vtkm::Id width, vtkm::Id height, vtkm::Float32 depth) @@ -48,8 +48,8 @@ struct RenderBitmapFont : public vtkm::worklet::WorkletMapField } template - VTKM_EXEC void operator()(const vtkm::Vec& screenCoords, - const vtkm::Vec& textureCoords, + VTKM_EXEC void operator()(const vtkm::Vec4f_32& screenCoords, + const vtkm::Vec4f_32& textureCoords, const FontTexture& fontTexture, ColorBufferPortal& colorBuffer, DepthBufferPortal& depthBuffer) const @@ -84,15 +84,15 @@ struct RenderBitmapFont : public vtkm::worklet::WorkletMapField { vtkm::Id index = static_cast(vtkm::Round(y)) * Width + static_cast(vtkm::Round(x)); - vtkm::Vec srcColor = colorBuffer.Get(index); + vtkm::Vec4f_32 srcColor = colorBuffer.Get(index); vtkm::Float32 currentDepth = depthBuffer.Get(index); bool swap = Depth > currentDepth; intensity = intensity * Color[3]; - vtkm::Vec color = intensity * Color; + vtkm::Vec4f_32 color = intensity * Color; color[3] = intensity; - vtkm::Vec front = color; - vtkm::Vec back = srcColor; + vtkm::Vec4f_32 front = color; + vtkm::Vec4f_32 back = srcColor; if (swap) { @@ -100,7 +100,7 @@ struct RenderBitmapFont : public vtkm::worklet::WorkletMapField back = color; } - vtkm::Vec blendedColor; + vtkm::Vec4f_32 blendedColor; vtkm::Float32 alpha = (1.f - front[3]); blendedColor[0] = front[0] + back[0] * alpha; blendedColor[1] = front[1] + back[1] * alpha; @@ -116,7 +116,7 @@ struct RenderBitmapFont : public vtkm::worklet::WorkletMapField return vtkm::Min(vtkm::Max(v, min), max); } - vtkm::Vec Color; + vtkm::Vec4f_32 Color; vtkm::Id Width; vtkm::Id Height; vtkm::Float32 Depth; @@ -127,14 +127,14 @@ struct RenderBitmapFontExecutor using ColorBufferType = vtkm::rendering::Canvas::ColorBufferType; using DepthBufferType = vtkm::rendering::Canvas::DepthBufferType; using FontTextureType = vtkm::rendering::Canvas::FontTextureType; - using ScreenCoordsArrayHandle = vtkm::cont::ArrayHandle>; - using TextureCoordsArrayHandle = vtkm::cont::ArrayHandle>; + using ScreenCoordsArrayHandle = vtkm::cont::ArrayHandle; + using TextureCoordsArrayHandle = vtkm::cont::ArrayHandle; VTKM_CONT RenderBitmapFontExecutor(const ScreenCoordsArrayHandle& screenCoords, const TextureCoordsArrayHandle& textureCoords, const FontTextureType& fontTexture, - const vtkm::Vec& color, + const vtkm::Vec4f_32& color, const ColorBufferType& colorBuffer, const DepthBufferType& depthBuffer, vtkm::Id width, @@ -179,33 +179,33 @@ TextRenderer::TextRenderer(const vtkm::rendering::Canvas* canvas, { } -void TextRenderer::RenderText(const vtkm::Vec& position, +void TextRenderer::RenderText(const vtkm::Vec2f_32& position, vtkm::Float32 scale, vtkm::Float32 angle, vtkm::Float32 windowAspect, - const vtkm::Vec& anchor, + const vtkm::Vec2f_32& anchor, const vtkm::rendering::Color& color, const std::string& text) { vtkm::Matrix translationMatrix = Transform3DTranslate(position[0], position[1], 0.f); vtkm::Matrix scaleMatrix = Transform3DScale(1.0f / windowAspect, 1.0f, 1.0f); - vtkm::Vec rotationAxis(0.0f, 0.0f, 1.0f); + vtkm::Vec3f_32 rotationAxis(0.0f, 0.0f, 1.0f); vtkm::Matrix rotationMatrix = Transform3DRotate(angle, rotationAxis); vtkm::Matrix transform = vtkm::MatrixMultiply(translationMatrix, vtkm::MatrixMultiply(scaleMatrix, rotationMatrix)); RenderText(transform, scale, anchor, color, text); } -void TextRenderer::RenderText(const vtkm::Vec& origin, - const vtkm::Vec& right, - const vtkm::Vec& up, +void TextRenderer::RenderText(const vtkm::Vec3f_32& origin, + const vtkm::Vec3f_32& right, + const vtkm::Vec3f_32& up, vtkm::Float32 scale, - const vtkm::Vec& anchor, + const vtkm::Vec2f_32& anchor, const vtkm::rendering::Color& color, const std::string& text) { - vtkm::Vec n = vtkm::Cross(right, up); + vtkm::Vec3f_32 n = vtkm::Cross(right, up); vtkm::Normalize(n); vtkm::Matrix transform = MatrixHelpers::WorldMatrix(origin, right, up, n); @@ -216,7 +216,7 @@ void TextRenderer::RenderText(const vtkm::Vec& origin, void TextRenderer::RenderText(const vtkm::Matrix& transform, vtkm::Float32 scale, - const vtkm::Vec& anchor, + const vtkm::Vec2f_32& anchor, const vtkm::rendering::Color& color, const std::string& text, const vtkm::Float32& depth) @@ -234,7 +234,7 @@ void TextRenderer::RenderText(const vtkm::Matrix& transform textureCoords.Allocate(static_cast(text.length())); ScreenCoordsArrayHandle::PortalControl screenCoordsPortal = screenCoords.GetPortalControl(); TextureCoordsArrayHandle::PortalControl textureCoordsPortal = textureCoords.GetPortalControl(); - vtkm::Vec charVertices, charUVs, charCoords; + vtkm::Vec4f_32 charVertices, charUVs, charCoords; for (std::size_t i = 0; i < text.length(); ++i) { char c = text[i]; @@ -254,7 +254,7 @@ void TextRenderer::RenderText(const vtkm::Matrix& transform charVertices = charVertices * scale; vtkm::Id2 p0 = Canvas->GetScreenPoint(charVertices[0], charVertices[3], fz, transform); vtkm::Id2 p1 = Canvas->GetScreenPoint(charVertices[2], charVertices[1], fz, transform); - charCoords = vtkm::Vec(p0[0], p1[1], p1[0], p0[1]); + charCoords = vtkm::Id4(p0[0], p1[1], p1[0], p0[1]); screenCoordsPortal.Set(static_cast(i), charCoords); textureCoordsPortal.Set(static_cast(i), charUVs); } diff --git a/vtkm/rendering/TextRenderer.h b/vtkm/rendering/TextRenderer.h index 8b895d728..05f44ca6e 100644 --- a/vtkm/rendering/TextRenderer.h +++ b/vtkm/rendering/TextRenderer.h @@ -32,27 +32,27 @@ public: const vtkm::rendering::Canvas::FontTextureType& fontTexture); VTKM_CONT - void RenderText(const vtkm::Vec& position, + void RenderText(const vtkm::Vec2f_32& position, vtkm::Float32 scale, vtkm::Float32 angle, vtkm::Float32 windowAspect, - const vtkm::Vec& anchor, + const vtkm::Vec2f_32& anchor, const vtkm::rendering::Color& color, const std::string& text); VTKM_CONT - void RenderText(const vtkm::Vec& origin, - const vtkm::Vec& right, - const vtkm::Vec& up, + void RenderText(const vtkm::Vec3f_32& origin, + const vtkm::Vec3f_32& right, + const vtkm::Vec3f_32& up, vtkm::Float32 scale, - const vtkm::Vec& anchor, + const vtkm::Vec2f_32& anchor, const vtkm::rendering::Color& color, const std::string& text); VTKM_CONT void RenderText(const vtkm::Matrix& transform, vtkm::Float32 scale, - const vtkm::Vec& anchor, + const vtkm::Vec2f_32& anchor, const vtkm::rendering::Color& color, const std::string& text, const vtkm::Float32& depth = 0.f); diff --git a/vtkm/rendering/Triangulator.h b/vtkm/rendering/Triangulator.h index 6cfe32ef0..fad4c41cf 100644 --- a/vtkm/rendering/Triangulator.h +++ b/vtkm/rendering/Triangulator.h @@ -97,7 +97,7 @@ public: const vtkm::Id& cellIndex, OutIndicesPortal& outputIndices) const { - vtkm::Vec triangle; + vtkm::Id4 triangle; if (DIM == 2) { const vtkm::Id triangleOffset = cellIndex * 2; @@ -191,7 +191,7 @@ public: using ControlSignature = void(FieldInOut); using ExecutionSignature = void(_1); VTKM_EXEC - void operator()(vtkm::Vec& triangleIndices) const + void operator()(vtkm::Id4& triangleIndices) const { // first field contains the id of the cell the // trianlge belongs to @@ -220,7 +220,7 @@ public: struct IndicesLessThan { VTKM_EXEC_CONT - bool operator()(const vtkm::Vec& a, const vtkm::Vec& b) const + bool operator()(const vtkm::Id4& a, const vtkm::Id4& b) const { if (a[1] < b[1]) return true; @@ -246,7 +246,7 @@ public: using ExecutionSignature = void(_1, _2, WorkIndex); VTKM_EXEC - bool IsTwin(const vtkm::Vec& a, const vtkm::Vec& b) const + bool IsTwin(const vtkm::Id4& a, const vtkm::Id4& b) const { return (a[1] == b[1] && a[2] == b[2] && a[3] == b[3]); } @@ -283,7 +283,7 @@ public: const vtkm::Id& cellId, OutputPortal& outputIndices) const { - vtkm::Vec triangle; + vtkm::Id4 triangle; triangle[1] = cellIndices[0]; triangle[2] = cellIndices[1]; @@ -333,7 +333,7 @@ public: const vtkm::Id& cellId, OutputPortal& outputIndices) const { - vtkm::Vec triangle; + vtkm::Id4 triangle; triangle[1] = cellIndices[0]; @@ -353,7 +353,7 @@ public: const vtkm::Id& cellId, OutputPortal& outputIndices) const { - vtkm::Vec triangle; + vtkm::Id4 triangle; triangle[1] = cellIndices[0]; triangle[2] = cellIndices[1]; @@ -424,7 +424,7 @@ public: const vtkm::Id& cellId, OutputPortal& outputIndices) const { - vtkm::Vec triangle; + vtkm::Id4 triangle; if (shapeType.Id == vtkm::CELL_SHAPE_TRIANGLE) { @@ -617,7 +617,7 @@ public: Triangulator() {} VTKM_CONT - void ExternalTrianlges(vtkm::cont::ArrayHandle>& outputIndices, + void ExternalTrianlges(vtkm::cont::ArrayHandle& outputIndices, vtkm::Id& outputTriangles) { //Eliminate unseen triangles @@ -633,7 +633,7 @@ public: //Unique triangles will have a flag = 1 vtkm::worklet::DispatcherMapField().Invoke(outputIndices, flags); - vtkm::cont::ArrayHandle> subset; + vtkm::cont::ArrayHandle subset; vtkm::cont::Algorithm::CopyIf(outputIndices, flags, subset); outputIndices = subset; outputTriangles = subset.GetNumberOfValues(); @@ -641,7 +641,7 @@ public: VTKM_CONT void Run(const vtkm::cont::DynamicCellSet& cellset, - vtkm::cont::ArrayHandle>& outputIndices, + vtkm::cont::ArrayHandle& outputIndices, vtkm::Id& outputTriangles) { bool fastPath = false; diff --git a/vtkm/rendering/View3D.cxx b/vtkm/rendering/View3D.cxx index 1ceedaec1..b8bde08cd 100644 --- a/vtkm/rendering/View3D.cxx +++ b/vtkm/rendering/View3D.cxx @@ -80,8 +80,8 @@ void View3D::RenderWorldAnnotations() this->BoxAnnotation.SetExtents(this->GetScene().GetSpatialBounds()); this->BoxAnnotation.Render(this->GetCamera(), this->GetWorldAnnotator()); - vtkm::Vec lookAt = this->GetCamera().GetLookAt(); - vtkm::Vec position = this->GetCamera().GetPosition(); + vtkm::Vec3f_32 lookAt = this->GetCamera().GetLookAt(); + vtkm::Vec3f_32 position = this->GetCamera().GetPosition(); bool xtest = lookAt[0] > position[0]; bool ytest = lookAt[1] > position[1]; bool ztest = lookAt[2] > position[2]; diff --git a/vtkm/rendering/Wireframer.h b/vtkm/rendering/Wireframer.h index e6a7e8790..bf1d6b2a4 100644 --- a/vtkm/rendering/Wireframer.h +++ b/vtkm/rendering/Wireframer.h @@ -30,8 +30,8 @@ namespace rendering namespace { -using ColorMapHandle = vtkm::cont::ArrayHandle>; -using IndicesHandle = vtkm::cont::ArrayHandle>; +using ColorMapHandle = vtkm::cont::ArrayHandle; +using IndicesHandle = vtkm::cont::ArrayHandle; using PackedFrameBufferHandle = vtkm::cont::ArrayHandle; // Depth value of 1.0f @@ -68,7 +68,7 @@ VTKM_EXEC_CONT vtkm::UInt32 PackColor(vtkm::Float32 r, vtkm::Float32 g, vtkm::Float32 b, vtkm::Float32 a); VTKM_EXEC_CONT -vtkm::UInt32 PackColor(const vtkm::Vec& color) +vtkm::UInt32 PackColor(const vtkm::Vec4f_32& color) { return PackColor(color[0], color[1], color[2], color[3]); } @@ -91,7 +91,7 @@ void UnpackColor(vtkm::UInt32 color, vtkm::Float32& a); VTKM_EXEC_CONT -void UnpackColor(vtkm::UInt32 packedColor, vtkm::Vec& color) +void UnpackColor(vtkm::UInt32 packedColor, vtkm::Vec4f_32& color) { UnpackColor(packedColor, color[0], color[1], color[2], color[3]); } @@ -132,7 +132,7 @@ struct CopyIntoFrameBuffer : public vtkm::worklet::WorkletMapField CopyIntoFrameBuffer() {} VTKM_EXEC - void operator()(const vtkm::Vec& color, + void operator()(const vtkm::Vec4f_32& color, const vtkm::Float32& depth, vtkm::Int64& outValue) const { @@ -186,15 +186,15 @@ public: } template - VTKM_EXEC void operator()(const vtkm::Vec& edgeIndices, + VTKM_EXEC void operator()(const vtkm::Id2& edgeIndices, const CoordinatesPortalType& coordsPortal, const ScalarFieldPortalType& fieldPortal) const { vtkm::Id point1Idx = edgeIndices[0]; vtkm::Id point2Idx = edgeIndices[1]; - vtkm::Vec point1 = coordsPortal.Get(edgeIndices[0]); - vtkm::Vec point2 = coordsPortal.Get(edgeIndices[1]); + vtkm::Vec3f_32 point1 = coordsPortal.Get(edgeIndices[0]); + vtkm::Vec3f_32 point2 = coordsPortal.Get(edgeIndices[1]); TransformWorldToViewport(point1); TransformWorldToViewport(point2); @@ -244,7 +244,7 @@ public: } // Plot first endpoint - vtkm::Vec color = GetColor(point1Field); + vtkm::Vec4f_32 color = GetColor(point1Field); if (transposed) { Plot(yPxl1, xPxl1, zPxl1, color, 1.0f); @@ -306,9 +306,9 @@ private: using ColorMapPortalConst = typename ColorMapHandle::ExecutionTypes::PortalConst; VTKM_EXEC - void TransformWorldToViewport(vtkm::Vec& point) const + void TransformWorldToViewport(vtkm::Vec3f_32& point) const { - vtkm::Vec temp(point[0], point[1], point[2], 1.0f); + vtkm::Vec4f_32 temp(point[0], point[1], point[2], 1.0f); temp = vtkm::MatrixMultiply(WorldToProjection, temp); for (vtkm::IdComponent i = 0; i < 3; ++i) { @@ -325,7 +325,7 @@ private: point[2] -= Offset; } - VTKM_EXEC vtkm::Vec GetColor(vtkm::Float64 fieldValue) const + VTKM_EXEC vtkm::Vec4f_32 GetColor(vtkm::Float64 fieldValue) const { vtkm::Int32 colorIdx = vtkm::Int32((vtkm::Float32(fieldValue) - FieldMin) * ColorMapSize * InverseFieldDelta); @@ -337,7 +337,7 @@ private: void Plot(vtkm::Float32 x, vtkm::Float32 y, vtkm::Float32 depth, - const vtkm::Vec& color, + const vtkm::Vec4f_32& color, vtkm::Float32 intensity) const { vtkm::Id xi = static_cast(x), yi = static_cast(y); @@ -349,8 +349,8 @@ private: PackedValue current, next; current.Raw = ClearValue; next.Floats.Depth = depth; - vtkm::Vec blendedColor; - vtkm::Vec srcColor; + vtkm::Vec4f_32 blendedColor; + vtkm::Vec4f_32 srcColor; do { UnpackColor(current.Ints.Color, srcColor); @@ -401,7 +401,7 @@ public: float depth = packed.Floats.Depth; if (depth <= depthBuffer.Get(index)) { - vtkm::Vec color; + vtkm::Vec4f_32 color; UnpackColor(packed.Ints.Color, color); colorBuffer.Set(index, color); depthBuffer.Set(index, depth); diff --git a/vtkm/rendering/WorldAnnotator.cxx b/vtkm/rendering/WorldAnnotator.cxx index 99f4a9586..17d3dd0c2 100644 --- a/vtkm/rendering/WorldAnnotator.cxx +++ b/vtkm/rendering/WorldAnnotator.cxx @@ -26,8 +26,8 @@ WorldAnnotator::~WorldAnnotator() { } -void WorldAnnotator::AddLine(const vtkm::Vec& point0, - const vtkm::Vec& point1, +void WorldAnnotator::AddLine(const vtkm::Vec3f_64& point0, + const vtkm::Vec3f_64& point1, vtkm::Float32 lineWidth, const vtkm::rendering::Color& color, bool vtkmNotUsed(inFront)) const @@ -38,16 +38,16 @@ void WorldAnnotator::AddLine(const vtkm::Vec& point0, renderer.RenderLine(point0, point1, lineWidth, color); } -void WorldAnnotator::AddText(const vtkm::Vec& origin, - const vtkm::Vec& right, - const vtkm::Vec& up, +void WorldAnnotator::AddText(const vtkm::Vec3f_32& origin, + const vtkm::Vec3f_32& right, + const vtkm::Vec3f_32& up, vtkm::Float32 scale, - const vtkm::Vec& anchor, + const vtkm::Vec2f_32& anchor, const vtkm::rendering::Color& color, const std::string& text, const vtkm::Float32 depth) const { - vtkm::Vec n = vtkm::Cross(right, up); + vtkm::Vec3f_32 n = vtkm::Cross(right, up); vtkm::Normalize(n); vtkm::Matrix transform = MatrixHelpers::WorldMatrix(origin, right, up, n); diff --git a/vtkm/rendering/WorldAnnotator.h b/vtkm/rendering/WorldAnnotator.h index e30020a75..5d20bf87a 100644 --- a/vtkm/rendering/WorldAnnotator.h +++ b/vtkm/rendering/WorldAnnotator.h @@ -30,8 +30,8 @@ public: virtual ~WorldAnnotator(); - virtual void AddLine(const vtkm::Vec& point0, - const vtkm::Vec& point1, + virtual void AddLine(const vtkm::Vec3f_64& point0, + const vtkm::Vec3f_64& point1, vtkm::Float32 lineWidth, const vtkm::rendering::Color& color, bool inFront = false) const; @@ -51,11 +51,11 @@ public: vtkm::make_Vec(x0, y0, z0), vtkm::make_Vec(x1, y1, z1), lineWidth, color, inFront); } - virtual void AddText(const vtkm::Vec& origin, - const vtkm::Vec& right, - const vtkm::Vec& up, + virtual void AddText(const vtkm::Vec3f_32& origin, + const vtkm::Vec3f_32& right, + const vtkm::Vec3f_32& up, vtkm::Float32 scale, - const vtkm::Vec& anchor, + const vtkm::Vec2f_32& anchor, const vtkm::rendering::Color& color, const std::string& text, const vtkm::Float32 depth = 0.f) const; diff --git a/vtkm/rendering/WorldAnnotatorGL.cxx b/vtkm/rendering/WorldAnnotatorGL.cxx index ac37c72ae..0993743cc 100644 --- a/vtkm/rendering/WorldAnnotatorGL.cxx +++ b/vtkm/rendering/WorldAnnotatorGL.cxx @@ -33,8 +33,8 @@ WorldAnnotatorGL::~WorldAnnotatorGL() { } -void WorldAnnotatorGL::AddLine(const vtkm::Vec& point0, - const vtkm::Vec& point1, +void WorldAnnotatorGL::AddLine(const vtkm::Vec3f_64& point0, + const vtkm::Vec3f_64& point1, vtkm::Float32 lineWidth, const vtkm::rendering::Color& color, bool inFront) const @@ -62,17 +62,17 @@ void WorldAnnotatorGL::AddLine(const vtkm::Vec& point0, } } -void WorldAnnotatorGL::AddText(const vtkm::Vec& origin, - const vtkm::Vec& right, - const vtkm::Vec& up, +void WorldAnnotatorGL::AddText(const vtkm::Vec3f_32& origin, + const vtkm::Vec3f_32& right, + const vtkm::Vec3f_32& up, vtkm::Float32 scale, - const vtkm::Vec& anchor, + const vtkm::Vec2f_32& anchor, const vtkm::rendering::Color& color, const std::string& text, const vtkm::Float32 vtkmNotUsed(depth)) const { - vtkm::Vec n = vtkm::Cross(right, up); + vtkm::Vec3f_32 n = vtkm::Cross(right, up); vtkm::Normalize(n); vtkm::Matrix m; diff --git a/vtkm/rendering/WorldAnnotatorGL.h b/vtkm/rendering/WorldAnnotatorGL.h index 2b72d3885..f027d914a 100644 --- a/vtkm/rendering/WorldAnnotatorGL.h +++ b/vtkm/rendering/WorldAnnotatorGL.h @@ -28,17 +28,17 @@ public: ~WorldAnnotatorGL(); - void AddLine(const vtkm::Vec& point0, - const vtkm::Vec& point1, + void AddLine(const vtkm::Vec3f_64& point0, + const vtkm::Vec3f_64& point1, vtkm::Float32 lineWidth, const vtkm::rendering::Color& color, bool inFront) const override; - void AddText(const vtkm::Vec& origin, - const vtkm::Vec& right, - const vtkm::Vec& up, + void AddText(const vtkm::Vec3f_32& origin, + const vtkm::Vec3f_32& right, + const vtkm::Vec3f_32& up, vtkm::Float32 scale, - const vtkm::Vec& anchor, + const vtkm::Vec2f_32& anchor, const vtkm::rendering::Color& color, const std::string& text, const vtkm::Float32 depth = 0.f) const override; diff --git a/vtkm/rendering/internal/RunTriangulator.cxx b/vtkm/rendering/internal/RunTriangulator.cxx index cc27358f1..b27588eb6 100644 --- a/vtkm/rendering/internal/RunTriangulator.cxx +++ b/vtkm/rendering/internal/RunTriangulator.cxx @@ -21,7 +21,7 @@ namespace internal { void RunTriangulator(const vtkm::cont::DynamicCellSet& cellSet, - vtkm::cont::ArrayHandle>& indices, + vtkm::cont::ArrayHandle& indices, vtkm::Id& numberOfTriangles) { vtkm::rendering::Triangulator triangulator; diff --git a/vtkm/rendering/internal/RunTriangulator.h b/vtkm/rendering/internal/RunTriangulator.h index 438866b4f..b328ece3d 100644 --- a/vtkm/rendering/internal/RunTriangulator.h +++ b/vtkm/rendering/internal/RunTriangulator.h @@ -30,7 +30,7 @@ namespace internal /// VTKM_RENDERING_EXPORT void RunTriangulator(const vtkm::cont::DynamicCellSet& cellSet, - vtkm::cont::ArrayHandle>& indices, + vtkm::cont::ArrayHandle& indices, vtkm::Id& numberOfTriangles); } } diff --git a/vtkm/rendering/raytracing/BVHTraverser.h b/vtkm/rendering/raytracing/BVHTraverser.h index 9bdc2faf2..ee9b2c393 100644 --- a/vtkm/rendering/raytracing/BVHTraverser.h +++ b/vtkm/rendering/raytracing/BVHTraverser.h @@ -35,9 +35,9 @@ VTKM_EXEC inline bool IntersectAABB(const BVHPortalType& bvh, bool& hitRightChild, const Precision& minDistance) //Find hit after this distance { - vtkm::Vec first4 = bvh.Get(currentNode); - vtkm::Vec second4 = bvh.Get(currentNode + 1); - vtkm::Vec third4 = bvh.Get(currentNode + 2); + vtkm::Vec4f_32 first4 = bvh.Get(currentNode); + vtkm::Vec4f_32 second4 = bvh.Get(currentNode + 1); + vtkm::Vec4f_32 third4 = bvh.Get(currentNode + 2); Precision xmin0 = first4[0] * invDir[0] - originDir[0]; Precision ymin0 = first4[1] * invDir[1] - originDir[1]; @@ -170,8 +170,7 @@ public: } else { - vtkm::Vec children = - flatBVH.Get(currentNode + 3); //Children.Get(currentNode); + vtkm::Vec4f_32 children = flatBVH.Get(currentNode + 3); //Children.Get(currentNode); vtkm::Int32 leftChild; memcpy(&leftChild, &children[0], 4); vtkm::Int32 rightChild; diff --git a/vtkm/rendering/raytracing/BoundingVolumeHierarchy.cxx b/vtkm/rendering/raytracing/BoundingVolumeHierarchy.cxx index 31648cdcf..a196aa8f0 100644 --- a/vtkm/rendering/raytracing/BoundingVolumeHierarchy.cxx +++ b/vtkm/rendering/raytracing/BoundingVolumeHierarchy.cxx @@ -122,8 +122,8 @@ template class LinearBVHBuilder::GatherVecCast : public vtkm::worklet::WorkletMapField { private: - using Vec4IdArrayHandle = typename vtkm::cont::ArrayHandle>; - using Vec4IntArrayHandle = typename vtkm::cont::ArrayHandle>; + using Vec4IdArrayHandle = typename vtkm::cont::ArrayHandle; + using Vec4IntArrayHandle = typename vtkm::cont::ArrayHandle; using PortalConst = typename Vec4IdArrayHandle::ExecutionTypes::PortalConst; using Portal = typename Vec4IntArrayHandle::ExecutionTypes::Portal; @@ -239,7 +239,7 @@ public: { //move up into the inner nodes vtkm::Id currentNode = LeafCount - 1 + workIndex; - vtkm::Vec childVector; + vtkm::Id2 childVector; while (currentNode != 0) { currentNode = parents.Get(currentNode); @@ -257,8 +257,7 @@ public: //and set it in the current node childVector[0] = childVector[0] - LeafCount + 1; - vtkm::Vec - first4Vec; // = FlatBVH.Get(currentNode); only this one needs effects this + vtkm::Vec4f_32 first4Vec; // = FlatBVH.Get(currentNode); only this one needs effects this first4Vec[0] = xmin.Get(childVector[0]); first4Vec[1] = ymin.Get(childVector[0]); @@ -266,7 +265,7 @@ public: first4Vec[3] = xmax.Get(childVector[0]); flatBVH.Set(currentNodeOffset, first4Vec); - vtkm::Vec second4Vec = flatBVH.Get(currentNodeOffset + 1); + vtkm::Vec4f_32 second4Vec = flatBVH.Get(currentNodeOffset + 1); second4Vec[0] = ymax.Get(childVector[0]); second4Vec[1] = zmax.Get(childVector[0]); flatBVH.Set(currentNodeOffset + 1, second4Vec); @@ -281,9 +280,9 @@ public: //the current node left AABB. vtkm::Id child = childVector[0] * 4; - vtkm::Vec cFirst4Vec = flatBVH.Get(child); - vtkm::Vec cSecond4Vec = flatBVH.Get(child + 1); - vtkm::Vec cThird4Vec = flatBVH.Get(child + 2); + vtkm::Vec4f_32 cFirst4Vec = flatBVH.Get(child); + vtkm::Vec4f_32 cSecond4Vec = flatBVH.Get(child + 1); + vtkm::Vec4f_32 cThird4Vec = flatBVH.Get(child + 2); cFirst4Vec[0] = vtkm::Min(cFirst4Vec[0], cSecond4Vec[2]); cFirst4Vec[1] = vtkm::Min(cFirst4Vec[1], cSecond4Vec[3]); @@ -291,7 +290,7 @@ public: cFirst4Vec[3] = vtkm::Max(cFirst4Vec[3], cThird4Vec[1]); flatBVH.Set(currentNodeOffset, cFirst4Vec); - vtkm::Vec second4Vec = flatBVH.Get(currentNodeOffset + 1); + vtkm::Vec4f_32 second4Vec = flatBVH.Get(currentNodeOffset + 1); second4Vec[0] = vtkm::Max(cSecond4Vec[0], cThird4Vec[2]); second4Vec[1] = vtkm::Max(cSecond4Vec[1], cThird4Vec[3]); @@ -305,13 +304,13 @@ public: childVector[1] = childVector[1] - LeafCount + 1; - vtkm::Vec second4Vec = flatBVH.Get(currentNodeOffset + 1); + vtkm::Vec4f_32 second4Vec = flatBVH.Get(currentNodeOffset + 1); second4Vec[2] = xmin.Get(childVector[1]); second4Vec[3] = ymin.Get(childVector[1]); flatBVH.Set(currentNodeOffset + 1, second4Vec); - vtkm::Vec third4Vec; + vtkm::Vec4f_32 third4Vec; third4Vec[0] = zmin.Get(childVector[1]); third4Vec[1] = xmax.Get(childVector[1]); third4Vec[2] = ymax.Get(childVector[1]); @@ -329,11 +328,11 @@ public: //the current node left AABB. vtkm::Id child = childVector[1] * 4; - vtkm::Vec cFirst4Vec = flatBVH.Get(child); - vtkm::Vec cSecond4Vec = flatBVH.Get(child + 1); - vtkm::Vec cThird4Vec = flatBVH.Get(child + 2); + vtkm::Vec4f_32 cFirst4Vec = flatBVH.Get(child); + vtkm::Vec4f_32 cSecond4Vec = flatBVH.Get(child + 1); + vtkm::Vec4f_32 cThird4Vec = flatBVH.Get(child + 2); - vtkm::Vec second4Vec = flatBVH.Get(currentNodeOffset + 1); + vtkm::Vec4f_32 second4Vec = flatBVH.Get(currentNodeOffset + 1); second4Vec[2] = vtkm::Min(cFirst4Vec[0], cSecond4Vec[2]); second4Vec[3] = vtkm::Min(cFirst4Vec[1], cSecond4Vec[3]); flatBVH.Set(currentNodeOffset + 1, second4Vec); @@ -344,7 +343,7 @@ public: cThird4Vec[3] = vtkm::Max(cSecond4Vec[1], cThird4Vec[3]); flatBVH.Set(currentNodeOffset + 2, cThird4Vec); } - vtkm::Vec fourth4Vec; + vtkm::Vec4f_32 fourth4Vec; vtkm::Int32 leftChild = static_cast((childVector[0] >= 0) ? childVector[0] * 4 : childVector[0]); memcpy(&fourth4Vec[0], &leftChild, 4); @@ -628,8 +627,8 @@ VTKM_CONT void LinearBVHBuilder::Build(LinearBVH& linearBVH) // Find the extent of all bounding boxes to generate normalization for morton codes - vtkm::Vec minExtent(vtkm::Infinity32(), vtkm::Infinity32(), vtkm::Infinity32()); - vtkm::Vec maxExtent( + vtkm::Vec3f_32 minExtent(vtkm::Infinity32(), vtkm::Infinity32(), vtkm::Infinity32()); + vtkm::Vec3f_32 maxExtent( vtkm::NegativeInfinity32(), vtkm::NegativeInfinity32(), vtkm::NegativeInfinity32()); maxExtent[0] = vtkm::cont::Algorithm::Reduce(bvh.AABB.xmaxs, maxExtent[0], MaxValue()); maxExtent[1] = vtkm::cont::Algorithm::Reduce(bvh.AABB.ymaxs, maxExtent[1], MaxValue()); @@ -645,8 +644,8 @@ VTKM_CONT void LinearBVHBuilder::Build(LinearBVH& linearBVH) linearBVH.TotalBounds.Z.Min = minExtent[2]; linearBVH.TotalBounds.Z.Max = maxExtent[2]; - vtkm::Vec deltaExtent = maxExtent - minExtent; - vtkm::Vec inverseExtent; + vtkm::Vec3f_32 deltaExtent = maxExtent - minExtent; + vtkm::Vec3f_32 inverseExtent; for (int i = 0; i < 3; ++i) { inverseExtent[i] = (deltaExtent[i] == 0.f) ? 0 : 1.f / deltaExtent[i]; diff --git a/vtkm/rendering/raytracing/BoundingVolumeHierarchy.h b/vtkm/rendering/raytracing/BoundingVolumeHierarchy.h index 03bd2d6db..0b20dccb8 100644 --- a/vtkm/rendering/raytracing/BoundingVolumeHierarchy.h +++ b/vtkm/rendering/raytracing/BoundingVolumeHierarchy.h @@ -37,7 +37,7 @@ struct AABBs class VTKM_RENDERING_EXPORT LinearBVH { public: - using InnerNodesHandle = vtkm::cont::ArrayHandle>; + using InnerNodesHandle = vtkm::cont::ArrayHandle; using LeafNodesHandle = vtkm::cont::ArrayHandle; AABBs AABB; InnerNodesHandle FlatBVH; diff --git a/vtkm/rendering/raytracing/Camera.cxx b/vtkm/rendering/raytracing/Camera.cxx index 40f92d7f4..34a30ec90 100644 --- a/vtkm/rendering/raytracing/Camera.cxx +++ b/vtkm/rendering/raytracing/Camera.cxx @@ -42,23 +42,23 @@ public: vtkm::Int32 Minx; vtkm::Int32 Miny; vtkm::Int32 SubsetWidth; - vtkm::Vec nlook; // normalized look - vtkm::Vec delta_x; - vtkm::Vec delta_y; - vtkm::Vec Origin; + vtkm::Vec3f_32 nlook; // normalized look + vtkm::Vec3f_32 delta_x; + vtkm::Vec3f_32 delta_y; + vtkm::Vec3f_32 Origin; vtkm::Bounds BoundingBox; VTKM_CONT PixelData(vtkm::Int32 width, vtkm::Int32 height, vtkm::Float32 fovX, vtkm::Float32 fovY, - vtkm::Vec look, - vtkm::Vec up, + vtkm::Vec3f_32 look, + vtkm::Vec3f_32 up, vtkm::Float32 _zoom, vtkm::Int32 subsetWidth, vtkm::Int32 minx, vtkm::Int32 miny, - vtkm::Vec origin, + vtkm::Vec3f_32 origin, vtkm::Bounds boundingBox) : w(width) , h(height) @@ -70,10 +70,10 @@ public: { vtkm::Float32 thx = tanf((fovX * vtkm::Pi_180f()) * .5f); vtkm::Float32 thy = tanf((fovY * vtkm::Pi_180f()) * .5f); - vtkm::Vec ru = vtkm::Cross(look, up); + vtkm::Vec3f_32 ru = vtkm::Cross(look, up); vtkm::Normalize(ru); - vtkm::Vec rv = vtkm::Cross(ru, look); + vtkm::Vec3f_32 rv = vtkm::Cross(ru, look); vtkm::Normalize(rv); delta_x = ru * (2 * thx / (float)w); delta_y = rv * (2 * thy / (float)h); @@ -104,7 +104,7 @@ public: VTKM_EXEC void operator()(const vtkm::Id idx, vtkm::Int32& hit, vtkm::Float32& distance) const { - vtkm::Vec ray_dir; + vtkm::Vec3f_32 ray_dir; int i = vtkm::Int32(idx) % SubsetWidth; int j = vtkm::Int32(idx) / SubsetWidth; i += Minx; @@ -158,17 +158,17 @@ class PerspectiveRayGenJitter : public vtkm::worklet::WorkletMapField public: vtkm::Int32 w; vtkm::Int32 h; - vtkm::Vec nlook; // normalized look - vtkm::Vec delta_x; - vtkm::Vec delta_y; + vtkm::Vec3f_32 nlook; // normalized look + vtkm::Vec3f_32 delta_x; + vtkm::Vec3f_32 delta_y; vtkm::Int32 CurrentSample; VTKM_CONT_EXPORT PerspectiveRayGenJitter(vtkm::Int32 width, vtkm::Int32 height, vtkm::Float32 fovX, vtkm::Float32 fovY, - vtkm::Vec look, - vtkm::Vec up, + vtkm::Vec3f_32 look, + vtkm::Vec3f_32 up, vtkm::Float32 _zoom, vtkm::Int32 currentSample) : w(width) @@ -176,10 +176,10 @@ public: { vtkm::Float32 thx = tanf((fovX * 3.1415926f / 180.f) * .5f); vtkm::Float32 thy = tanf((fovY * 3.1415926f / 180.f) * .5f); - vtkm::Vec ru = vtkm::Cross(up, look); + vtkm::Vec3f_32 ru = vtkm::Cross(up, look); vtkm::Normalize(ru); - vtkm::Vec rv = vtkm::Cross(ru, look); + vtkm::Vec3f_32 rv = vtkm::Cross(ru, look); vtkm::Normalize(rv); delta_x = ru * (2 * thx / (float)w); @@ -209,12 +209,12 @@ public: vtkm::Float32& rayDirZ, const vtkm::Int32& seed) const { - vtkm::Vec xy; + vtkm::Vec2f_32 xy; Halton2D<3>(CurrentSample + seed, xy); xy[0] -= .5f; xy[1] -= .5f; - vtkm::Vec ray_dir(rayDirX, rayDirY, rayDirZ); + vtkm::Vec3f_32 ray_dir(rayDirX, rayDirY, rayDirZ); vtkm::Float32 i = static_cast(vtkm::Int32(idx) % w); vtkm::Float32 j = static_cast(vtkm::Int32(idx) / w); i += xy[0]; @@ -237,10 +237,10 @@ public: vtkm::Int32 Minx; vtkm::Int32 Miny; vtkm::Int32 SubsetWidth; - vtkm::Vec nlook; // normalized look - vtkm::Vec PixelDelta; - vtkm::Vec delta_y; - vtkm::Vec StartOffset; + vtkm::Vec3f_32 nlook; // normalized look + vtkm::Vec3f_32 PixelDelta; + vtkm::Vec3f_32 delta_y; + vtkm::Vec3f_32 StartOffset; VTKM_CONT Ortho2DRayGen(vtkm::Int32 width, @@ -263,9 +263,9 @@ public: camera.GetRealViewport(width, height, vl, vr, vb, vt); vtkm::Float32 _w = static_cast(width) * (vr - vl) / 2.f; vtkm::Float32 _h = static_cast(height) * (vt - vb) / 2.f; - vtkm::Vec minPoint(left, bottom); - vtkm::Vec maxPoint(right, top); - vtkm::Vec delta = maxPoint - minPoint; + vtkm::Vec2f_32 minPoint(left, bottom); + vtkm::Vec2f_32 maxPoint(right, top); + vtkm::Vec2f_32 delta = maxPoint - minPoint; //delta[0] /= vtkm::Float32(width); //delta[1] /= vtkm::Float32(height); delta[0] /= vtkm::Float32(_w); @@ -274,7 +274,7 @@ public: PixelDelta[1] = delta[1]; PixelDelta[2] = 0.f; - vtkm::Vec startOffset = minPoint + delta / 2.f; + vtkm::Vec2f_32 startOffset = minPoint + delta / 2.f; StartOffset[0] = startOffset[0]; StartOffset[1] = startOffset[1]; // always push the rays back from the origin @@ -310,11 +310,11 @@ public: int i = vtkm::Int32(idx) % SubsetWidth; int j = vtkm::Int32(idx) / SubsetWidth; - vtkm::Vec pos; + vtkm::Vec3f_32 pos; pos[0] = vtkm::Float32(i); pos[1] = vtkm::Float32(j); pos[2] = 0.f; - vtkm::Vec origin = StartOffset + pos * PixelDelta; + vtkm::Vec3f_32 origin = StartOffset + pos * PixelDelta; rayOriginX = origin[0]; rayOriginY = origin[1]; rayOriginZ = origin[2]; @@ -333,16 +333,16 @@ public: vtkm::Int32 Minx; vtkm::Int32 Miny; vtkm::Int32 SubsetWidth; - vtkm::Vec nlook; // normalized look - vtkm::Vec delta_x; - vtkm::Vec delta_y; + vtkm::Vec3f_32 nlook; // normalized look + vtkm::Vec3f_32 delta_x; + vtkm::Vec3f_32 delta_y; VTKM_CONT PerspectiveRayGen(vtkm::Int32 width, vtkm::Int32 height, vtkm::Float32 fovX, vtkm::Float32 fovY, - vtkm::Vec look, - vtkm::Vec up, + vtkm::Vec3f_32 look, + vtkm::Vec3f_32 up, vtkm::Float32 _zoom, vtkm::Int32 subsetWidth, vtkm::Int32 minx, @@ -355,10 +355,10 @@ public: { vtkm::Float32 thx = tanf((fovX * vtkm::Pi_180f()) * .5f); vtkm::Float32 thy = tanf((fovY * vtkm::Pi_180f()) * .5f); - vtkm::Vec ru = vtkm::Cross(look, up); + vtkm::Vec3f_32 ru = vtkm::Cross(look, up); vtkm::Normalize(ru); - vtkm::Vec rv = vtkm::Cross(ru, look); + vtkm::Vec3f_32 rv = vtkm::Cross(ru, look); vtkm::Normalize(rv); delta_x = ru * (2 * thx / (float)w); delta_y = rv * (2 * thy / (float)h); @@ -638,7 +638,7 @@ vtkm::Float32 Camera::GetFieldOfView() const } VTKM_CONT -void Camera::SetUp(const vtkm::Vec& up) +void Camera::SetUp(const vtkm::Vec3f_32& up) { if (this->Up != up) { @@ -649,13 +649,13 @@ void Camera::SetUp(const vtkm::Vec& up) } VTKM_CONT -vtkm::Vec Camera::GetUp() const +vtkm::Vec3f_32 Camera::GetUp() const { return this->Up; } VTKM_CONT -void Camera::SetLookAt(const vtkm::Vec& lookAt) +void Camera::SetLookAt(const vtkm::Vec3f_32& lookAt) { if (this->LookAt != lookAt) { @@ -665,13 +665,13 @@ void Camera::SetLookAt(const vtkm::Vec& lookAt) } VTKM_CONT -vtkm::Vec Camera::GetLookAt() const +vtkm::Vec3f_32 Camera::GetLookAt() const { return this->LookAt; } VTKM_CONT -void Camera::SetPosition(const vtkm::Vec& position) +void Camera::SetPosition(const vtkm::Vec3f_32& position) { if (this->Position != position) { @@ -681,7 +681,7 @@ void Camera::SetPosition(const vtkm::Vec& position) } VTKM_CONT -vtkm::Vec Camera::GetPosition() const +vtkm::Vec3f_32 Camera::GetPosition() const { return this->Position; } @@ -860,7 +860,7 @@ void Camera::FindSubset(const vtkm::Bounds& bounds) xmax = vtkm::NegativeInfinity32(); ymax = vtkm::NegativeInfinity32(); zmax = vtkm::NegativeInfinity32(); - vtkm::Vec extentPoint; + vtkm::Vec4f_32 extentPoint; for (vtkm::Int32 i = 0; i < 2; ++i) for (vtkm::Int32 j = 0; j < 2; ++j) for (vtkm::Int32 k = 0; k < 2; ++k) @@ -869,8 +869,7 @@ void Camera::FindSubset(const vtkm::Bounds& bounds) extentPoint[1] = y[j]; extentPoint[2] = z[k]; extentPoint[3] = 1.f; - vtkm::Vec transformed = - vtkm::MatrixMultiply(this->ViewProjectionMat, extentPoint); + vtkm::Vec4f_32 transformed = vtkm::MatrixMultiply(this->ViewProjectionMat, extentPoint); // perform the perspective divide for (vtkm::Int32 a = 0; a < 3; ++a) { @@ -996,18 +995,18 @@ VTKM_CONT void Camera::UpdateDimensions(Ray& rays, } } -void Camera::CreateDebugRay(vtkm::Vec pixel, Ray& rays) +void Camera::CreateDebugRay(vtkm::Vec2i_32 pixel, Ray& rays) { CreateDebugRayImp(pixel, rays); } -void Camera::CreateDebugRay(vtkm::Vec pixel, Ray& rays) +void Camera::CreateDebugRay(vtkm::Vec2i_32 pixel, Ray& rays) { CreateDebugRayImp(pixel, rays); } template -void Camera::CreateDebugRayImp(vtkm::Vec pixel, Ray& rays) +void Camera::CreateDebugRayImp(vtkm::Vec2i_32 pixel, Ray& rays) { RayOperations::Resize(rays, 1, vtkm::cont::DeviceAdapterTagSerial()); vtkm::Int32 pixelIndex = this->Width * (this->Height - pixel[1]) + pixel[0]; @@ -1026,11 +1025,11 @@ void Camera::CreateDebugRayImp(vtkm::Vec pixel, Ray& vtkm::Float32 thx = tanf((this->FovX * vtkm::Pi_180f()) * .5f); vtkm::Float32 thy = tanf((this->FovY * vtkm::Pi_180f()) * .5f); - vtkm::Vec ru = vtkm::Cross(this->Look, this->Up); + vtkm::Vec3f_32 ru = vtkm::Cross(this->Look, this->Up); vtkm::Normalize(ru); - vtkm::Vec rv = vtkm::Cross(ru, this->Look); - vtkm::Vec delta_x, delta_y; + vtkm::Vec3f_32 rv = vtkm::Cross(ru, this->Look); + vtkm::Vec3f_32 delta_x, delta_y; vtkm::Normalize(rv); delta_x = ru * (2 * thx / (float)this->Width); delta_y = rv * (2 * thy / (float)this->Height); @@ -1045,7 +1044,7 @@ void Camera::CreateDebugRayImp(vtkm::Vec pixel, Ray& delta_y[1] = delta_y[1] / _zoom; delta_y[2] = delta_y[2] / _zoom; } - vtkm::Vec nlook = this->Look; + vtkm::Vec3f_32 nlook = this->Look; vtkm::Normalize(nlook); vtkm::Vec ray_dir; diff --git a/vtkm/rendering/raytracing/Camera.h b/vtkm/rendering/raytracing/Camera.h index c3cae3dc5..7fca702d2 100644 --- a/vtkm/rendering/raytracing/Camera.h +++ b/vtkm/rendering/raytracing/Camera.h @@ -39,10 +39,10 @@ private: vtkm::Float32 Zoom; bool IsViewDirty; - vtkm::Vec Look; - vtkm::Vec Up; - vtkm::Vec LookAt; - vtkm::Vec Position; + vtkm::Vec3f_32 Look; + vtkm::Vec3f_32 Up; + vtkm::Vec3f_32 LookAt; + vtkm::Vec3f_32 Position; vtkm::rendering::Camera CameraView; vtkm::Matrix ViewProjectionMat; @@ -98,22 +98,22 @@ public: vtkm::Float32 GetFieldOfView() const; VTKM_CONT - void SetUp(const vtkm::Vec& up); + void SetUp(const vtkm::Vec3f_32& up); VTKM_CONT - void SetPosition(const vtkm::Vec& position); + void SetPosition(const vtkm::Vec3f_32& position); VTKM_CONT - vtkm::Vec GetPosition() const; + vtkm::Vec3f_32 GetPosition() const; VTKM_CONT - vtkm::Vec GetUp() const; + vtkm::Vec3f_32 GetUp() const; VTKM_CONT - void SetLookAt(const vtkm::Vec& lookAt); + void SetLookAt(const vtkm::Vec3f_32& lookAt); VTKM_CONT - vtkm::Vec GetLookAt() const; + vtkm::Vec3f_32 GetLookAt() const; VTKM_CONT void ResetIsViewDirty(); @@ -135,15 +135,15 @@ public: template VTKM_CONT void CreateRaysImpl(Ray& rays, const vtkm::Bounds boundingBox); - void CreateDebugRay(vtkm::Vec pixel, Ray& rays); + void CreateDebugRay(vtkm::Vec2i_32 pixel, Ray& rays); - void CreateDebugRay(vtkm::Vec pixel, Ray& rays); + void CreateDebugRay(vtkm::Vec2i_32 pixel, Ray& rays); bool operator==(const Camera& other) const; private: template - void CreateDebugRayImp(vtkm::Vec pixel, Ray& rays); + void CreateDebugRayImp(vtkm::Vec2i_32 pixel, Ray& rays); VTKM_CONT void FindSubset(const vtkm::Bounds& bounds); diff --git a/vtkm/rendering/raytracing/CellIntersector.h b/vtkm/rendering/raytracing/CellIntersector.h index 0c1c4498b..f1a4c5248 100644 --- a/vtkm/rendering/raytracing/CellIntersector.h +++ b/vtkm/rendering/raytracing/CellIntersector.h @@ -35,7 +35,7 @@ VTKM_EXEC_CONT inline void IntersectZoo(T xpoints[8], { // Some precalc for water tight intersections vtkm::Vec s; - vtkm::Vec k; + vtkm::Vec3i_32 k; WaterTight intersector; intersector.FindDir(dir, s, k); CellTables tables; @@ -82,7 +82,7 @@ VTKM_EXEC_CONT inline void IntersectHex(T xpoints[8], { // Some precalc for water tight intersections vtkm::Vec s; - vtkm::Vec k; + vtkm::Vec3i_32 k; WaterTight intersector; intersector.FindDir(dir, s, k); @@ -137,7 +137,7 @@ VTKM_EXEC_CONT inline void IntersectTet(T xpoints[8], { // Some precalc for water tight intersections vtkm::Vec s; - vtkm::Vec k; + vtkm::Vec3i_32 k; WaterTight intersector; intersector.FindDir(dir, s, k); @@ -180,7 +180,7 @@ VTKM_EXEC_CONT inline void IntersectWedge(T xpoints[8], { // Some precalc for water tight intersections vtkm::Vec s; - vtkm::Vec k; + vtkm::Vec3i_32 k; WaterTight intersector; intersector.FindDir(dir, s, k); // TODO: try two sepate loops to see performance impact diff --git a/vtkm/rendering/raytracing/ConnectivityTracer.cxx b/vtkm/rendering/raytracing/ConnectivityTracer.cxx index 696445d8f..3e1d74a31 100644 --- a/vtkm/rendering/raytracing/ConnectivityTracer.cxx +++ b/vtkm/rendering/raytracing/ConnectivityTracer.cxx @@ -170,7 +170,7 @@ void ConnectivityTracer::Init() BackgroundColor[3] = 1.f; const vtkm::Float32 defaultSampleRate = 200.f; // We need to set some default sample distance - vtkm::Vec extent; + vtkm::Vec3f_32 extent; extent[0] = BoundingBox[1] - BoundingBox[0]; extent[1] = BoundingBox[3] - BoundingBox[2]; extent[2] = BoundingBox[5] - BoundingBox[4]; @@ -183,8 +183,7 @@ vtkm::Id ConnectivityTracer::GetNumberOfMeshCells() const return CellSet.GetNumberOfCells(); } -void ConnectivityTracer::SetColorMap( - const vtkm::cont::ArrayHandle>& colorMap) +void ConnectivityTracer::SetColorMap(const vtkm::cont::ArrayHandle& colorMap) { ColorMap = colorMap; } @@ -282,7 +281,7 @@ void ConnectivityTracer::SetEnergyData(const vtkm::cont::Field& absorption, MeshContainer = builder.BuildConnectivity(cellSet, coords); } -void ConnectivityTracer::SetBackgroundColor(const vtkm::Vec& backgroundColor) +void ConnectivityTracer::SetBackgroundColor(const vtkm::Vec4f_32& backgroundColor) { BackgroundColor = backgroundColor; } @@ -786,10 +785,8 @@ class IdentifyMissedRay : public vtkm::worklet::WorkletMapField public: vtkm::Id Width; vtkm::Id Height; - vtkm::Vec BGColor; - IdentifyMissedRay(const vtkm::Id width, - const vtkm::Id height, - vtkm::Vec bgcolor) + vtkm::Vec4f_32 BGColor; + IdentifyMissedRay(const vtkm::Id width, const vtkm::Id height, vtkm::Vec4f_32 bgcolor) : Width(width) , Height(height) , BGColor(bgcolor) @@ -799,7 +796,7 @@ public: using ExecutionSignature = void(_1, _2); - VTKM_EXEC inline bool IsBGColor(const vtkm::Vec color) const + VTKM_EXEC inline bool IsBGColor(const vtkm::Vec4f_32 color) const { bool isBG = false; @@ -820,7 +817,7 @@ public: return; if (x >= Width - 1 || y >= Height - 1) return; - vtkm::Vec pixel; + vtkm::Vec4f_32 pixel; pixel[0] = static_cast(buffer.Get(pixelId * 4 + 0)); pixel[1] = static_cast(buffer.Get(pixelId * 4 + 1)); pixel[2] = static_cast(buffer.Get(pixelId * 4 + 2)); @@ -905,7 +902,7 @@ public: if (rayStatus != RAY_ACTIVE) return; - vtkm::Vec color; + vtkm::Vec4f_32 color; BOUNDS_CHECK(frameBuffer, pixelIndex * 4 + 0); color[0] = static_cast(frameBuffer.Get(pixelIndex * 4 + 0)); BOUNDS_CHECK(frameBuffer, pixelIndex * 4 + 1); @@ -936,7 +933,7 @@ public: if (colorIndex >= colorMapSize) colorIndex = colorMapSize - 1; BOUNDS_CHECK(colorMap, colorIndex); - vtkm::Vec sampleColor = colorMap.Get(colorIndex); + vtkm::Vec4f_32 sampleColor = colorMap.Get(colorIndex); while (enterDistance <= currentDistance && currentDistance <= exitDistance) { @@ -1010,7 +1007,7 @@ public: const FloatType& enterDistance, const FloatType& exitDistance, FloatType& currentDistance, - const vtkm::Vec& dir, + const vtkm::Vec3f_32& dir, vtkm::UInt8& rayStatus, const vtkm::Id& pixelIndex, const vtkm::Vec& origin, @@ -1022,7 +1019,7 @@ public: if (rayStatus != RAY_ACTIVE) return; - vtkm::Vec color; + vtkm::Vec4f_32 color; BOUNDS_CHECK(frameBuffer, pixelIndex * 4 + 0); color[0] = static_cast(frameBuffer.Get(pixelIndex * 4 + 0)); BOUNDS_CHECK(frameBuffer, pixelIndex * 4 + 1); @@ -1093,7 +1090,7 @@ public: colorIndex = vtkm::Min(vtkm::Max(colorIndex, vtkm::Id(0)), colorMapSize - 1); BOUNDS_CHECK(colorMap, colorIndex); - vtkm::Vec sampleColor = colorMap.Get(colorIndex); + vtkm::Vec4f_32 sampleColor = colorMap.Get(colorIndex); //composite sampleColor[3] *= (1.f - color[3]); color[0] = color[0] + sampleColor[0] * sampleColor[3]; diff --git a/vtkm/rendering/raytracing/ConnectivityTracer.h b/vtkm/rendering/raytracing/ConnectivityTracer.h index dfbb9fc36..a79fe50b9 100644 --- a/vtkm/rendering/raytracing/ConnectivityTracer.h +++ b/vtkm/rendering/raytracing/ConnectivityTracer.h @@ -102,9 +102,9 @@ public: const vtkm::cont::CoordinateSystem& coords, const vtkm::cont::Field& emission); - void SetBackgroundColor(const vtkm::Vec& backgroundColor); + void SetBackgroundColor(const vtkm::Vec4f_32& backgroundColor); void SetSampleDistance(const vtkm::Float32& distance); - void SetColorMap(const vtkm::cont::ArrayHandle>& colorMap); + void SetColorMap(const vtkm::cont::ArrayHandle& colorMap); MeshConnContainer* GetMeshContainer() { return MeshContainer; } @@ -183,9 +183,9 @@ protected: vtkm::Range ScalarBounds; vtkm::Float32 BoundingBox[6]; - vtkm::cont::ArrayHandle> ColorMap; + vtkm::cont::ArrayHandle ColorMap; - vtkm::Vec BackgroundColor; + vtkm::Vec4f_32 BackgroundColor; vtkm::Float32 SampleDistance; vtkm::Id RaysLost; IntegrationMode Integrator; diff --git a/vtkm/rendering/raytracing/CylinderIntersector.cxx b/vtkm/rendering/raytracing/CylinderIntersector.cxx index 43bf4ece0..b6a876d1f 100644 --- a/vtkm/rendering/raytracing/CylinderIntersector.cxx +++ b/vtkm/rendering/raytracing/CylinderIntersector.cxx @@ -51,11 +51,11 @@ public: const PointPortalType& points) const { // cast to Float32 - vtkm::Vec point1, point2; - vtkm::Vec temp; + vtkm::Vec3f_32 point1, point2; + vtkm::Vec3f_32 temp; - point1 = static_cast>(points.Get(cylId[1])); - point2 = static_cast>(points.Get(cylId[2])); + point1 = static_cast(points.Get(cylId[1])); + point2 = static_cast(points.Get(cylId[2])); temp[0] = radius; temp[1] = 0.0f; @@ -70,7 +70,7 @@ public: Bounds(point2, radius, xmin, ymin, zmin, xmax, ymax, zmax); } - VTKM_EXEC void Bounds(const vtkm::Vec& point, + VTKM_EXEC void Bounds(const vtkm::Vec3f_32& point, const vtkm::Float32& radius, vtkm::Float32& xmin, vtkm::Float32& ymin, @@ -79,7 +79,7 @@ public: vtkm::Float32& ymax, vtkm::Float32& zmax) const { - vtkm::Vec temp, p; + vtkm::Vec3f_32 temp, p; temp[0] = radius; temp[1] = 0.0f; temp[2] = 0.0f; @@ -277,7 +277,7 @@ public: bottom = vtkm::Vec(points.Get(pointIndex[1])); top = vtkm::Vec(points.Get(pointIndex[2])); - vtkm::Vec ret; + vtkm::Vec3f_32 ret; ret = cylinder(origin, dir, bottom, top, radius); if (ret[0] > 0) { diff --git a/vtkm/rendering/raytracing/MeshConnectivityBase.h b/vtkm/rendering/raytracing/MeshConnectivityBase.h index f50786097..2a63e9460 100644 --- a/vtkm/rendering/raytracing/MeshConnectivityBase.h +++ b/vtkm/rendering/raytracing/MeshConnectivityBase.h @@ -76,7 +76,7 @@ public: class VTKM_ALWAYS_EXPORT MeshConnStructured : public MeshConnectivityBase { protected: - typedef typename vtkm::cont::ArrayHandle> Id4Handle; + typedef typename vtkm::cont::ArrayHandle Id4Handle; vtkm::Id3 CellDims; vtkm::Id3 PointDims; diff --git a/vtkm/rendering/raytracing/MeshConnectivityBuilder.cxx b/vtkm/rendering/raytracing/MeshConnectivityBuilder.cxx index 24b61266d..22ab5296e 100644 --- a/vtkm/rendering/raytracing/MeshConnectivityBuilder.cxx +++ b/vtkm/rendering/raytracing/MeshConnectivityBuilder.cxx @@ -118,7 +118,7 @@ public: VTKM_EXEC inline bool IsIn(const vtkm::Id& needle, - const vtkm::Vec& heystack, + const vtkm::Id4& heystack, const vtkm::Int32& numIndices) const { bool isIn = false; @@ -188,8 +188,8 @@ public: //TODO: we can do better than this - vtkm::Vec indices1; - vtkm::Vec indices2; + vtkm::Id4 indices1; + vtkm::Id4 indices2; const auto faceLength = tables.ShapesFaceList(shape1Offset, 0); for (vtkm::Int32 i = 1; i <= faceLength; ++i) @@ -230,7 +230,7 @@ public: if (isInternal) { BOUNDS_CHECK(faceIdPairs, index); - vtkm::Vec facePair = faceIdPairs.Get(index); + vtkm::Id3 facePair = faceIdPairs.Get(index); vtkm::Id myCell = facePair[0]; facePair[2] = connectedCell; BOUNDS_CHECK(faceIdPairs, index); @@ -265,7 +265,7 @@ public: typename InIndicesPortalType, typename OutIndicesPortalType, typename ShapeOffsetsPortal> - VTKM_EXEC inline void operator()(const vtkm::Vec& faceIdPair, + VTKM_EXEC inline void operator()(const vtkm::Id3& faceIdPair, const ShapePortalType& shapes, const ShapeOffsetsPortal& shapeOffsets, const InIndicesPortalType& indices, @@ -286,7 +286,7 @@ public: return; } - vtkm::Vec faceIndices(-1, -1, -1, -1); + vtkm::Id4 faceIndices(-1, -1, -1, -1); vtkm::Int32 tableIndex = static_cast(shapesFaceOffset + faceIdPair[1]); const vtkm::Int32 numIndices = tables.ShapesFaceList(tableIndex, 0); @@ -295,7 +295,7 @@ public: BOUNDS_CHECK(indices, offset + tables.ShapesFaceList(tableIndex, i)); faceIndices[i - 1] = indices.Get(offset + tables.ShapesFaceList(tableIndex, i)); } - vtkm::Vec triangle; + vtkm::Id4 triangle; triangle[0] = cellId; triangle[1] = faceIndices[0]; triangle[2] = faceIndices[1]; @@ -328,7 +328,7 @@ public: WriteFaceConn() {} template - VTKM_EXEC inline void operator()(const vtkm::Vec& faceIdPair, + VTKM_EXEC inline void operator()(const vtkm::Id3& faceIdPair, const FaceOffsetsPortalType& faceOffsets, FaceConnectivityPortalType& faceConn) const { @@ -448,7 +448,7 @@ public: vtkm::Int32 shapesFaceOffset = tables.FaceLookUp(tables.CellTypeLookUp(CELL_SHAPE_HEXAHEDRON), 0); - vtkm::Vec faceIndices; + vtkm::Id4 faceIndices; vtkm::Int32 tableIndex = shapesFaceOffset + cellFace; // Load the face @@ -457,7 +457,7 @@ public: faceIndices[i - 1] = cellIndices[tables.ShapesFaceList(tableIndex, i)]; } const vtkm::Id outputOffset = index * 2; - vtkm::Vec triangle; + vtkm::Id4 triangle; triangle[0] = cellId; triangle[1] = faceIndices[0]; triangle[2] = faceIndices[1]; @@ -482,7 +482,7 @@ public: using ControlSignature = void(FieldIn, WholeArrayIn, FieldOut); using ExecutionSignature = void(_1, _2, _3); template - VTKM_EXEC inline void operator()(const vtkm::Vec& faceIdPair, + VTKM_EXEC inline void operator()(const vtkm::Id3& faceIdPair, const ShapePortalType& shapes, vtkm::Id& triangleCount) const { @@ -510,17 +510,16 @@ template -VTKM_CONT void GenerateFaceConnnectivity( - const CellSetType cellSet, - const ShapeHandleType shapes, - const ConnHandleType conn, - const OffsetsHandleType shapeOffsets, - const vtkm::cont::ArrayHandleVirtualCoordinates& coords, - vtkm::cont::ArrayHandle& faceConnectivity, - vtkm::cont::ArrayHandle>& cellFaceId, - vtkm::Float32 BoundingBox[6], - vtkm::cont::ArrayHandle& faceOffsets, - vtkm::cont::ArrayHandle& uniqueFaces) +VTKM_CONT void GenerateFaceConnnectivity(const CellSetType cellSet, + const ShapeHandleType shapes, + const ConnHandleType conn, + const OffsetsHandleType shapeOffsets, + const vtkm::cont::ArrayHandleVirtualCoordinates& coords, + vtkm::cont::ArrayHandle& faceConnectivity, + vtkm::cont::ArrayHandle& cellFaceId, + vtkm::Float32 BoundingBox[6], + vtkm::cont::ArrayHandle& faceOffsets, + vtkm::cont::ArrayHandle& uniqueFaces) { vtkm::cont::Timer timer{ vtkm::cont::DeviceAdapterTagSerial() }; @@ -528,7 +527,7 @@ VTKM_CONT void GenerateFaceConnnectivity( vtkm::Id numCells = shapes.GetNumberOfValues(); - vtkm::cont::ArrayHandle> coordinates; + vtkm::cont::ArrayHandle coordinates; vtkm::cont::Algorithm::Copy(coords, coordinates); /*-----------------------------------------------------------------*/ @@ -560,11 +559,11 @@ VTKM_CONT void GenerateFaceConnnectivity( // to the same morton code. We check for this. // set up everything we need to gen morton codes - vtkm::Vec inverseExtent; + vtkm::Vec3f_32 inverseExtent; inverseExtent[0] = 1.f / (BoundingBox[1] - BoundingBox[0]); inverseExtent[1] = 1.f / (BoundingBox[3] - BoundingBox[2]); inverseExtent[2] = 1.f / (BoundingBox[5] - BoundingBox[4]); - vtkm::Vec minPoint; + vtkm::Vec3f_32 minPoint; minPoint[0] = BoundingBox[0]; minPoint[1] = BoundingBox[2]; minPoint[2] = BoundingBox[4]; @@ -605,8 +604,7 @@ VTKM_CONT void GenerateFaceConnnectivity( template VTKM_CONT vtkm::cont::ArrayHandle> ExtractFaces( - vtkm::cont::ArrayHandle> - cellFaceId, // Map of cell, face, and connecting cell + vtkm::cont::ArrayHandle cellFaceId, // Map of cell, face, and connecting cell vtkm::cont::ArrayHandle uniqueFaces, // -1 if the face is unique const ShapeHandleType& shapes, const ConnHandleType& conn, @@ -615,7 +613,7 @@ VTKM_CONT vtkm::cont::ArrayHandle> ExtractFaces( vtkm::cont::Timer timer{ vtkm::cont::DeviceAdapterTagSerial() }; timer.Start(); - vtkm::cont::ArrayHandle> externalFacePairs; + vtkm::cont::ArrayHandle externalFacePairs; vtkm::cont::Algorithm::CopyIf(cellFaceId, uniqueFaces, externalFacePairs, IsUnique()); // We need to count the number of triangle per external face @@ -638,7 +636,7 @@ VTKM_CONT vtkm::cont::ArrayHandle> ExtractFaces( vtkm::Id totalExternalTriangles; totalExternalTriangles = vtkm::cont::Algorithm::Reduce(trianglesPerExternalFace, vtkm::Id(0)); - vtkm::cont::ArrayHandle> externalTriangles; + vtkm::cont::ArrayHandle externalTriangles; //externalTriangles.PrepareForOutput(totalExternalTriangles, DeviceAdapter()); externalTriangles.Allocate(totalExternalTriangles); //count the number triangles in the external faces @@ -692,7 +690,7 @@ void MeshConnectivityBuilder::BuildConnectivity( vtkm::TopologyElementTagCell()); vtkm::cont::ArrayHandle faceConnectivity; - vtkm::cont::ArrayHandle> cellFaceId; + vtkm::cont::ArrayHandle cellFaceId; vtkm::cont::ArrayHandle uniqueFaces; GenerateFaceConnnectivity(cellSetUnstructured, @@ -706,7 +704,7 @@ void MeshConnectivityBuilder::BuildConnectivity( FaceOffsets, uniqueFaces); - vtkm::cont::ArrayHandle> triangles; + vtkm::cont::ArrayHandle triangles; //Faces triangles = ExtractFaces(cellFaceId, uniqueFaces, shapes, conn, shapeOffsets); @@ -752,7 +750,7 @@ void MeshConnectivityBuilder::BuildConnectivity( vtkm::TopologyElementTagPoint(), vtkm::TopologyElementTagCell()); vtkm::cont::ArrayHandle faceConnectivity; - vtkm::cont::ArrayHandle> cellFaceId; + vtkm::cont::ArrayHandle cellFaceId; vtkm::cont::ArrayHandle uniqueFaces; GenerateFaceConnnectivity(cellSetUnstructured, @@ -766,7 +764,7 @@ void MeshConnectivityBuilder::BuildConnectivity( FaceOffsets, uniqueFaces); - vtkm::cont::ArrayHandle> triangles; + vtkm::cont::ArrayHandle triangles; // //Faces triangles = ExtractFaces(cellFaceId, uniqueFaces, shapes, conn, shapeOffsets); @@ -787,7 +785,7 @@ struct StructuredTrianglesFunctor template VTKM_CONT bool operator()(Device, vtkm::cont::ArrayHandleCounting& counting, - vtkm::cont::ArrayHandle>& triangles, + vtkm::cont::ArrayHandle& triangles, vtkm::cont::CellSetStructured<3>& cellSet) const { VTKM_IS_DEVICE_ADAPTER_TAG(Device); @@ -803,9 +801,8 @@ struct StructuredTrianglesFunctor // Should we just make this name BuildConnectivity? VTKM_CONT -vtkm::cont::ArrayHandle> - MeshConnectivityBuilder::ExternalTrianglesStructured( - vtkm::cont::CellSetStructured<3>& cellSetStructured) +vtkm::cont::ArrayHandle MeshConnectivityBuilder::ExternalTrianglesStructured( + vtkm::cont::CellSetStructured<3>& cellSetStructured) { vtkm::cont::Timer timer{ vtkm::cont::DeviceAdapterTagSerial() }; timer.Start(); @@ -814,7 +811,7 @@ vtkm::cont::ArrayHandle> vtkm::Id numFaces = cellDims[0] * cellDims[1] * 2 + cellDims[1] * cellDims[2] * 2 + cellDims[2] * cellDims[0] * 2; - vtkm::cont::ArrayHandle> triangles; + vtkm::cont::ArrayHandle triangles; triangles.Allocate(numFaces * 2); vtkm::cont::ArrayHandleCounting counting(0, 1, numFaces); @@ -836,7 +833,7 @@ vtkm::cont::ArrayHandle MeshConnectivityBuilder::GetFaceOffsets() return FaceOffsets; } -vtkm::cont::ArrayHandle> MeshConnectivityBuilder::GetTriangles() +vtkm::cont::ArrayHandle MeshConnectivityBuilder::GetTriangles() { return Triangles; } diff --git a/vtkm/rendering/raytracing/MeshConnectivityBuilder.h b/vtkm/rendering/raytracing/MeshConnectivityBuilder.h index 24fff77b5..0b24cb112 100644 --- a/vtkm/rendering/raytracing/MeshConnectivityBuilder.h +++ b/vtkm/rendering/raytracing/MeshConnectivityBuilder.h @@ -31,14 +31,14 @@ public: const vtkm::cont::CoordinateSystem& coordinates); VTKM_CONT - vtkm::cont::ArrayHandle> ExternalTrianglesStructured( + vtkm::cont::ArrayHandle ExternalTrianglesStructured( vtkm::cont::CellSetStructured<3>& cellSetStructured); vtkm::cont::ArrayHandle GetFaceConnectivity(); vtkm::cont::ArrayHandle GetFaceOffsets(); - vtkm::cont::ArrayHandle> GetTriangles(); + vtkm::cont::ArrayHandle GetTriangles(); protected: VTKM_CONT @@ -53,7 +53,7 @@ protected: vtkm::cont::ArrayHandle FaceConnectivity; vtkm::cont::ArrayHandle FaceOffsets; - vtkm::cont::ArrayHandle> Triangles; + vtkm::cont::ArrayHandle Triangles; }; } } diff --git a/vtkm/rendering/raytracing/MeshConnectivityContainers.h b/vtkm/rendering/raytracing/MeshConnectivityContainers.h index 87d916211..f0bbd63a5 100644 --- a/vtkm/rendering/raytracing/MeshConnectivityContainers.h +++ b/vtkm/rendering/raytracing/MeshConnectivityContainers.h @@ -39,7 +39,7 @@ public: void FindEntry(Ray& rays); protected: - using Id4Handle = typename vtkm::cont::ArrayHandle>; + using Id4Handle = typename vtkm::cont::ArrayHandle; // Mesh Boundary Id4Handle Triangles; TriangleIntersector Intersector; @@ -50,7 +50,7 @@ class UnstructuredContainer : public MeshConnContainer { public: typedef vtkm::cont::ArrayHandle IdHandle; - typedef vtkm::cont::ArrayHandle> Id4Handle; + typedef vtkm::cont::ArrayHandle Id4Handle; typedef vtkm::cont::ArrayHandle UCharHandle; // Control Environment Handles // FaceConn @@ -85,7 +85,7 @@ public: class StructuredContainer : public MeshConnContainer { protected: - typedef vtkm::cont::ArrayHandle> Id4Handle; + typedef vtkm::cont::ArrayHandle Id4Handle; vtkm::Id3 CellDims; vtkm::Id3 PointDims; vtkm::Bounds CoordinateBounds; @@ -110,7 +110,7 @@ class UnstructuredSingleContainer : public MeshConnContainer { public: typedef vtkm::cont::ArrayHandle IdHandle; - typedef vtkm::cont::ArrayHandle> Id4Handle; + typedef vtkm::cont::ArrayHandle Id4Handle; typedef vtkm::cont::ArrayHandleCounting CountingHandle; typedef vtkm::cont::ArrayHandleConstant ShapesHandle; typedef vtkm::cont::ArrayHandleConstant NumIndicesHandle; diff --git a/vtkm/rendering/raytracing/MortonCodes.h b/vtkm/rendering/raytracing/MortonCodes.h index 57708d33f..771c8fb8c 100644 --- a/vtkm/rendering/raytracing/MortonCodes.h +++ b/vtkm/rendering/raytracing/MortonCodes.h @@ -89,15 +89,15 @@ class MortonCodeFace : public vtkm::worklet::WorkletMapPointToCell { private: // (1.f / dx),(1.f / dy), (1.f, / dz) - vtkm::Vec InverseExtent; - vtkm::Vec MinCoordinate; + vtkm::Vec3f_32 InverseExtent; + vtkm::Vec3f_32 MinCoordinate; - VTKM_EXEC inline void Normalize(vtkm::Vec& point) const + VTKM_EXEC inline void Normalize(vtkm::Vec3f_32& point) const { point = (point - MinCoordinate) * InverseExtent; } - VTKM_EXEC inline void Sort4(vtkm::Vec& indices) const + VTKM_EXEC inline void Sort4(vtkm::Id4& indices) const { if (indices[0] < indices[1]) { @@ -133,8 +133,7 @@ private: public: VTKM_CONT - MortonCodeFace(const vtkm::Vec& inverseExtent, - const vtkm::Vec& minCoordinate) + MortonCodeFace(const vtkm::Vec3f_32& inverseExtent, const vtkm::Vec3f_32& minCoordinate) : InverseExtent(inverseExtent) , MinCoordinate(minCoordinate) { @@ -191,9 +190,9 @@ public: //calc the morton code at the center of each face for (vtkm::Int32 i = 0; i < faceCount; ++i) { - vtkm::Vec center; + vtkm::Vec3f_32 center; vtkm::UInt32 code; - vtkm::Vec cellFace; + vtkm::Id3 cellFace; cellFace[0] = cellId; // We must be sure that this calculation is the same for all faces. If we didn't @@ -201,7 +200,7 @@ public: // the wonders of floating point math. This is bad. If we calculate in the same order // for all faces, then at worst, two different faces can enter the same bucket, which // we currently check for. - vtkm::Vec faceIndices(-1); + vtkm::Id4 faceIndices(-1); //Number of indices this face has const vtkm::Int32 indiceCount = tables.ShapesFaceList(tableOffset + i, 0); for (vtkm::Int32 j = 1; j <= indiceCount; j++) @@ -240,13 +239,12 @@ class MortonCodeAABB : public vtkm::worklet::WorkletMapField { private: // (1.f / dx),(1.f / dy), (1.f, / dz) - vtkm::Vec InverseExtent; - vtkm::Vec MinCoordinate; + vtkm::Vec3f_32 InverseExtent; + vtkm::Vec3f_32 MinCoordinate; public: VTKM_CONT - MortonCodeAABB(const vtkm::Vec& inverseExtent, - const vtkm::Vec& minCoordinate) + MortonCodeAABB(const vtkm::Vec3f_32& inverseExtent, const vtkm::Vec3f_32& minCoordinate) : InverseExtent(inverseExtent) , MinCoordinate(minCoordinate) { @@ -265,7 +263,7 @@ public: const vtkm::Float32& zmax, vtkm::UInt32& mortonCode) const { - vtkm::Vec direction(xmax - xmin, ymax - ymin, zmax - zmin); + vtkm::Vec3f_32 direction(xmax - xmin, ymax - ymin, zmax - zmin); vtkm::Float32 halfDistance = sqrtf(vtkm::Dot(direction, direction)) * 0.5f; vtkm::Normalize(direction); vtkm::Float32 centroidx = xmin + halfDistance * direction[0] - MinCoordinate[0]; diff --git a/vtkm/rendering/raytracing/QuadIntersector.cxx b/vtkm/rendering/raytracing/QuadIntersector.cxx index 587944ae0..4845c56aa 100644 --- a/vtkm/rendering/raytracing/QuadIntersector.cxx +++ b/vtkm/rendering/raytracing/QuadIntersector.cxx @@ -50,12 +50,12 @@ public: const PointPortalType& points) const { // cast to Float32 - vtkm::Vec q, r, s, t; + vtkm::Vec3f_32 q, r, s, t; - q = static_cast>(points.Get(quadId[1])); - r = static_cast>(points.Get(quadId[2])); - s = static_cast>(points.Get(quadId[3])); - t = static_cast>(points.Get(quadId[4])); + q = static_cast(points.Get(quadId[1])); + r = static_cast(points.Get(quadId[2])); + s = static_cast(points.Get(quadId[3])); + t = static_cast(points.Get(quadId[4])); xmin = q[0]; ymin = q[1]; diff --git a/vtkm/rendering/raytracing/RayOperations.h b/vtkm/rendering/raytracing/RayOperations.h index add028e92..1f1a23fc3 100644 --- a/vtkm/rendering/raytracing/RayOperations.h +++ b/vtkm/rendering/raytracing/RayOperations.h @@ -51,14 +51,14 @@ protected: vtkm::Id Width; vtkm::Float32 DoubleInvHeight; vtkm::Float32 DoubleInvWidth; - vtkm::Vec Origin; + vtkm::Vec3f_32 Origin; public: VTKM_CONT RayMapCanvas(const vtkm::Matrix& inverseProjView, const vtkm::Id width, const vtkm::Id height, - const vtkm::Vec& origin) + const vtkm::Vec3f_32& origin) : InverseProjView(inverseProjView) , Width(width) , Origin(origin) @@ -77,7 +77,7 @@ public: Precision& maxDistance, const DepthPortalType& depths) const { - vtkm::Vec position; + vtkm::Vec4f_32 position; position[0] = static_cast(pixelId % Width); position[1] = static_cast(pixelId / Width); position[2] = static_cast(depths.Get(pixelId)); @@ -89,7 +89,7 @@ public: // offset so we don't go all the way to the same point position[2] -= 0.00001f; position = vtkm::MatrixMultiply(InverseProjView, position); - vtkm::Vec p; + vtkm::Vec3f_32 p; p[0] = position[0] / position[3]; p[1] = position[1] / position[3]; p[2] = position[2] / position[3]; diff --git a/vtkm/rendering/raytracing/RayTracer.cxx b/vtkm/rendering/raytracing/RayTracer.cxx index 21478fb55..c02859c1e 100644 --- a/vtkm/rendering/raytracing/RayTracer.cxx +++ b/vtkm/rendering/raytracing/RayTracer.cxx @@ -38,19 +38,19 @@ public: class Shade : public vtkm::worklet::WorkletMapField { private: - vtkm::Vec LightPosition; - vtkm::Vec LightAbmient; - vtkm::Vec LightDiffuse; - vtkm::Vec LightSpecular; + vtkm::Vec3f_32 LightPosition; + vtkm::Vec3f_32 LightAbmient; + vtkm::Vec3f_32 LightDiffuse; + vtkm::Vec3f_32 LightSpecular; vtkm::Float32 SpecularExponent; - vtkm::Vec CameraPosition; - vtkm::Vec LookAt; + vtkm::Vec3f_32 CameraPosition; + vtkm::Vec3f_32 LookAt; public: VTKM_CONT - Shade(const vtkm::Vec& lightPosition, - const vtkm::Vec& cameraPosition, - const vtkm::Vec& lookAt) + Shade(const vtkm::Vec3f_32& lightPosition, + const vtkm::Vec3f_32& cameraPosition, + const vtkm::Vec3f_32& lookAt) : LightPosition(lightPosition) , CameraPosition(cameraPosition) , LookAt(lookAt) @@ -176,15 +176,15 @@ public: template VTKM_CONT void run(Ray& rays, - vtkm::cont::ArrayHandle>& colorMap, + vtkm::cont::ArrayHandle& colorMap, const vtkm::rendering::raytracing::Camera& camera, bool shade) { if (shade) { // TODO: support light positions - vtkm::Vec scale(2, 2, 2); - vtkm::Vec lightPosition = camera.GetPosition() + scale * camera.GetUp(); + vtkm::Vec3f_32 scale(2, 2, 2); + vtkm::Vec3f_32 lightPosition = camera.GetPosition() + scale * camera.GetUp(); vtkm::worklet::DispatcherMapField( Shade(lightPosition, camera.GetPosition(), camera.GetLookAt())) .Invoke(rays.HitIdx, @@ -233,7 +233,7 @@ void RayTracer::SetField(const vtkm::cont::Field& scalarField, const vtkm::Range ScalarRange = scalarRange; } -void RayTracer::SetColorMap(const vtkm::cont::ArrayHandle>& colorMap) +void RayTracer::SetColorMap(const vtkm::cont::ArrayHandle& colorMap) { ColorMap = colorMap; } diff --git a/vtkm/rendering/raytracing/RayTracer.h b/vtkm/rendering/raytracing/RayTracer.h index 97b0964c7..b7923ff33 100644 --- a/vtkm/rendering/raytracing/RayTracer.h +++ b/vtkm/rendering/raytracing/RayTracer.h @@ -32,7 +32,7 @@ protected: vtkm::cont::Field ScalarField; vtkm::cont::ArrayHandle Scalars; vtkm::Id NumberOfShapes; - vtkm::cont::ArrayHandle> ColorMap; + vtkm::cont::ArrayHandle ColorMap; vtkm::Range ScalarRange; bool Shade; @@ -55,7 +55,7 @@ public: void SetField(const vtkm::cont::Field& scalarField, const vtkm::Range& scalarRange); VTKM_CONT - void SetColorMap(const vtkm::cont::ArrayHandle>& colorMap); + void SetColorMap(const vtkm::cont::ArrayHandle& colorMap); VTKM_CONT void SetShadingOn(bool on); diff --git a/vtkm/rendering/raytracing/RayTracingTypeDefs.h b/vtkm/rendering/raytracing/RayTracingTypeDefs.h index ee1625309..d33e98a47 100644 --- a/vtkm/rendering/raytracing/RayTracingTypeDefs.h +++ b/vtkm/rendering/raytracing/RayTracingTypeDefs.h @@ -116,14 +116,14 @@ inline std::string GetDeviceString() return functor.result; } -using ColorBuffer4f = vtkm::cont::ArrayHandle>; -using ColorBuffer4b = vtkm::cont::ArrayHandle>; +using ColorBuffer4f = vtkm::cont::ArrayHandle; +using ColorBuffer4b = vtkm::cont::ArrayHandle; //Defining types supported by the rendering //vec3s -using Vec3F = vtkm::Vec; -using Vec3D = vtkm::Vec; +using Vec3F = vtkm::Vec3f_32; +using Vec3D = vtkm::Vec3f_64; struct Vec3RenderingTypes : vtkm::ListTagBase { }; diff --git a/vtkm/rendering/raytracing/Sampler.h b/vtkm/rendering/raytracing/Sampler.h index 88e5697d6..8a76607c7 100644 --- a/vtkm/rendering/raytracing/Sampler.h +++ b/vtkm/rendering/raytracing/Sampler.h @@ -19,7 +19,7 @@ namespace raytracing { template -VTKM_EXEC void Halton2D(const vtkm::Int32& sampleNum, vtkm::Vec& coord) +VTKM_EXEC void Halton2D(const vtkm::Int32& sampleNum, vtkm::Vec2f_32& coord) { //generate base2 halton vtkm::Float32 x = 0.0f; @@ -48,8 +48,7 @@ VTKM_EXEC void Halton2D(const vtkm::Int32& sampleNum, vtkm::Vec CosineWeightedHemisphere(const vtkm::Int32& sampleNum, - const vtkm::Vec& normal) +vtkm::Vec3f_32 CosineWeightedHemisphere(const vtkm::Int32& sampleNum, const vtkm::Vec3f_32& normal) { //generate orthoganal basis about normal int kz = 0; @@ -67,28 +66,28 @@ vtkm::Vec CosineWeightedHemisphere(const vtkm::Int32& sampleNu else kz = 2; } - vtkm::Vec notNormal; + vtkm::Vec3f_32 notNormal; notNormal[0] = 0.f; notNormal[1] = 0.f; notNormal[2] = 0.f; notNormal[kz] = 1.f; - vtkm::Vec xAxis = vtkm::Cross(normal, notNormal); + vtkm::Vec3f_32 xAxis = vtkm::Cross(normal, notNormal); vtkm::Normalize(xAxis); - vtkm::Vec yAxis = vtkm::Cross(normal, xAxis); + vtkm::Vec3f_32 yAxis = vtkm::Cross(normal, xAxis); vtkm::Normalize(yAxis); - vtkm::Vec xy; + vtkm::Vec2f_32 xy; Halton2D<3>(sampleNum, xy); const vtkm::Float32 r = Sqrt(xy[0]); const vtkm::Float32 theta = 2 * static_cast(vtkm::Pi()) * xy[1]; - vtkm::Vec direction(0.f, 0.f, 0.f); + vtkm::Vec3f_32 direction(0.f, 0.f, 0.f); direction[0] = r * vtkm::Cos(theta); direction[1] = r * vtkm::Sin(theta); direction[2] = vtkm::Sqrt(vtkm::Max(0.0f, 1.f - xy[0])); - vtkm::Vec sampleDir; + vtkm::Vec3f_32 sampleDir; sampleDir[0] = vtkm::dot(direction, xAxis); sampleDir[1] = vtkm::dot(direction, yAxis); sampleDir[2] = vtkm::dot(direction, normal); diff --git a/vtkm/rendering/raytracing/SphereIntersector.cxx b/vtkm/rendering/raytracing/SphereIntersector.cxx index ba405ea36..42e5a0fa0 100644 --- a/vtkm/rendering/raytracing/SphereIntersector.cxx +++ b/vtkm/rendering/raytracing/SphereIntersector.cxx @@ -53,15 +53,15 @@ public: const PointPortalType& points) const { // cast to Float32 - vtkm::Vec point; - vtkm::Vec temp; - point = static_cast>(points.Get(pointId)); + vtkm::Vec3f_32 point; + vtkm::Vec3f_32 temp; + point = static_cast(points.Get(pointId)); temp[0] = radius; temp[1] = 0.f; temp[2] = 0.f; - vtkm::Vec p = point + temp; + vtkm::Vec3f_32 p = point + temp; //set first point to max and min xmin = p[0]; xmax = p[0]; diff --git a/vtkm/rendering/raytracing/TriangleExtractor.cxx b/vtkm/rendering/raytracing/TriangleExtractor.cxx index 882653977..c52ed6718 100644 --- a/vtkm/rendering/raytracing/TriangleExtractor.cxx +++ b/vtkm/rendering/raytracing/TriangleExtractor.cxx @@ -24,7 +24,7 @@ void TriangleExtractor::ExtractCells(const vtkm::cont::DynamicCellSet& cells) vtkm::rendering::internal::RunTriangulator(cells, this->Triangles, numberOfTriangles); } -vtkm::cont::ArrayHandle> TriangleExtractor::GetTriangles() +vtkm::cont::ArrayHandle TriangleExtractor::GetTriangles() { return this->Triangles; } diff --git a/vtkm/rendering/raytracing/TriangleExtractor.h b/vtkm/rendering/raytracing/TriangleExtractor.h index 58062af6f..3ae55f8f7 100644 --- a/vtkm/rendering/raytracing/TriangleExtractor.h +++ b/vtkm/rendering/raytracing/TriangleExtractor.h @@ -23,11 +23,11 @@ namespace raytracing class VTKM_RENDERING_EXPORT TriangleExtractor { protected: - vtkm::cont::ArrayHandle> Triangles; // (cellid, v0, v1, v2) + vtkm::cont::ArrayHandle Triangles; // (cellid, v0, v1, v2) public: void ExtractCells(const vtkm::cont::DynamicCellSet& cells); - vtkm::cont::ArrayHandle> GetTriangles(); + vtkm::cont::ArrayHandle GetTriangles(); vtkm::Id GetNumberOfTriangles() const; }; // class TriangleExtractor } diff --git a/vtkm/rendering/raytracing/TriangleIntersections.h b/vtkm/rendering/raytracing/TriangleIntersections.h index 39de1efe9..b66975f7e 100644 --- a/vtkm/rendering/raytracing/TriangleIntersections.h +++ b/vtkm/rendering/raytracing/TriangleIntersections.h @@ -291,15 +291,14 @@ public: }; //WaterTight template <> -VTKM_EXEC inline void WaterTight::IntersectTri( - const vtkm::Vec& a, - const vtkm::Vec& b, - const vtkm::Vec& c, - const vtkm::Vec& dir, - vtkm::Float64& distance, - vtkm::Float64& u, - vtkm::Float64& v, - const vtkm::Vec& origin) const +VTKM_EXEC inline void WaterTight::IntersectTri(const vtkm::Vec3f_64& a, + const vtkm::Vec3f_64& b, + const vtkm::Vec3f_64& c, + const vtkm::Vec3f_64& dir, + vtkm::Float64& distance, + vtkm::Float64& u, + vtkm::Float64& v, + const vtkm::Vec3f_64& origin) const { //Find max ray direction int kz = 0; @@ -338,7 +337,7 @@ VTKM_EXEC inline void WaterTight::IntersectTri( - vtkm::Vec A, B, C; + vtkm::Vec3f_64 A, B, C; A = a - origin; B = b - origin; C = c - origin; diff --git a/vtkm/rendering/raytracing/TriangleIntersector.cxx b/vtkm/rendering/raytracing/TriangleIntersector.cxx index df1782f5b..0490b4ae2 100644 --- a/vtkm/rendering/raytracing/TriangleIntersector.cxx +++ b/vtkm/rendering/raytracing/TriangleIntersector.cxx @@ -33,7 +33,7 @@ template class WaterTightLeafIntersector { public: - using Id4Handle = vtkm::cont::ArrayHandle>; + using Id4Handle = vtkm::cont::ArrayHandle; using Id4ArrayPortal = typename Id4Handle::ExecutionTypes::PortalConst; Id4ArrayPortal Triangles; @@ -86,7 +86,7 @@ class MollerTriLeafIntersector { //protected: public: - using Id4Handle = vtkm::cont::ArrayHandle>; + using Id4Handle = vtkm::cont::ArrayHandle; using Id4ArrayPortal = typename Id4Handle::ExecutionTypes::PortalConst; Id4ArrayPortal Triangles; @@ -138,7 +138,7 @@ public: class MollerExecWrapper : public vtkm::cont::ExecutionObjectBase { protected: - using Id4Handle = vtkm::cont::ArrayHandle>; + using Id4Handle = vtkm::cont::ArrayHandle; Id4Handle Triangles; public: @@ -157,7 +157,7 @@ public: class WaterTightExecWrapper : public vtkm::cont::ExecutionObjectBase { protected: - using Id4Handle = vtkm::cont::ArrayHandle>; + using Id4Handle = vtkm::cont::ArrayHandle; Id4Handle Triangles; public: @@ -328,7 +328,7 @@ public: template VTKM_CONT void Run(Ray& rays, - vtkm::cont::ArrayHandle> triangles, + vtkm::cont::ArrayHandle triangles, vtkm::cont::CoordinateSystem coordsHandle, const vtkm::cont::Field scalarField, const vtkm::Range& scalarRange) @@ -386,7 +386,7 @@ public: WholeArrayIn); typedef void ExecutionSignature(_1, _2, _3, _4, _5, _6, _7, _8); template - VTKM_EXEC void operator()(const vtkm::Vec indices, + VTKM_EXEC void operator()(const vtkm::Id4 indices, vtkm::Float32& xmin, vtkm::Float32& ymin, vtkm::Float32& zmin, @@ -396,22 +396,22 @@ public: const PointPortalType& points) const { // cast to Float32 - vtkm::Vec point; - point = static_cast>(points.Get(indices[1])); + vtkm::Vec3f_32 point; + point = static_cast(points.Get(indices[1])); xmin = point[0]; ymin = point[1]; zmin = point[2]; xmax = xmin; ymax = ymin; zmax = zmin; - point = static_cast>(points.Get(indices[2])); + point = static_cast(points.Get(indices[2])); xmin = vtkm::Min(xmin, point[0]); ymin = vtkm::Min(ymin, point[1]); zmin = vtkm::Min(zmin, point[2]); xmax = vtkm::Max(xmax, point[0]); ymax = vtkm::Max(ymax, point[1]); zmax = vtkm::Max(zmax, point[2]); - point = static_cast>(points.Get(indices[3])); + point = static_cast(points.Get(indices[3])); xmin = vtkm::Min(xmin, point[0]); ymin = vtkm::Min(ymin, point[1]); zmin = vtkm::Min(zmin, point[2]); @@ -449,7 +449,7 @@ void TriangleIntersector::SetUseWaterTight(bool useIt) } void TriangleIntersector::SetData(const vtkm::cont::CoordinateSystem& coords, - vtkm::cont::ArrayHandle> triangles) + vtkm::cont::ArrayHandle triangles) { CoordsHandle = coords; @@ -469,7 +469,7 @@ void TriangleIntersector::SetData(const vtkm::cont::CoordinateSystem& coords, this->SetAABBs(AABB); } -vtkm::cont::ArrayHandle> TriangleIntersector::GetTriangles() +vtkm::cont::ArrayHandle TriangleIntersector::GetTriangles() { return Triangles; } diff --git a/vtkm/rendering/raytracing/TriangleIntersector.h b/vtkm/rendering/raytracing/TriangleIntersector.h index 135c79184..73c397905 100644 --- a/vtkm/rendering/raytracing/TriangleIntersector.h +++ b/vtkm/rendering/raytracing/TriangleIntersector.h @@ -25,7 +25,7 @@ namespace raytracing class VTKM_RENDERING_EXPORT TriangleIntersector : public ShapeIntersector { protected: - vtkm::cont::ArrayHandle> Triangles; + vtkm::cont::ArrayHandle Triangles; bool UseWaterTight; public: @@ -34,9 +34,9 @@ public: void SetUseWaterTight(bool useIt); void SetData(const vtkm::cont::CoordinateSystem& coords, - vtkm::cont::ArrayHandle> triangles); + vtkm::cont::ArrayHandle triangles); - vtkm::cont::ArrayHandle> GetTriangles(); + vtkm::cont::ArrayHandle GetTriangles(); vtkm::Id GetNumberOfShapes() const override; diff --git a/vtkm/rendering/raytracing/VolumeRendererStructured.cxx b/vtkm/rendering/raytracing/VolumeRendererStructured.cxx index 98ab627e9..3c895345a 100644 --- a/vtkm/rendering/raytracing/VolumeRendererStructured.cxx +++ b/vtkm/rendering/raytracing/VolumeRendererStructured.cxx @@ -52,8 +52,8 @@ protected: vtkm::exec::ConnectivityStructured Conn; vtkm::Id3 PointDimensions; - vtkm::Vec MinPoint; - vtkm::Vec MaxPoint; + vtkm::Vec3f_32 MinPoint; + vtkm::Vec3f_32 MaxPoint; public: RectilinearLocator(const CartesianArrayHandle& coordinates, @@ -83,7 +83,7 @@ public: } VTKM_EXEC - inline bool IsInside(const vtkm::Vec& point) const + inline bool IsInside(const vtkm::Vec3f_32& point) const { bool inside = true; if (point[0] < MinPoint[0] || point[0] > MaxPoint[0]) @@ -96,8 +96,7 @@ public: } VTKM_EXEC - inline void GetCellIndices(const vtkm::Vec& cell, - vtkm::Vec& cellIndices) const + inline void GetCellIndices(const vtkm::Id3& cell, vtkm::Vec& cellIndices) const { cellIndices[0] = (cell[2] * PointDimensions[1] + cell[1]) * PointDimensions[0] + cell[0]; cellIndices[1] = cellIndices[0] + 1; @@ -113,9 +112,9 @@ public: // Assumes point inside the data set // VTKM_EXEC - inline void LocateCell(vtkm::Vec& cell, - const vtkm::Vec& point, - vtkm::Vec& invSpacing) const + inline void LocateCell(vtkm::Id3& cell, + const vtkm::Vec3f_32& point, + vtkm::Vec3f_32& invSpacing) const { for (vtkm::Int32 dim = 0; dim < 3; ++dim) { @@ -163,21 +162,20 @@ public: } // LocateCell VTKM_EXEC - inline vtkm::Id GetCellIndex(const vtkm::Vec& cell) const + inline vtkm::Id GetCellIndex(const vtkm::Id3& cell) const { return (cell[2] * (PointDimensions[1] - 1) + cell[1]) * (PointDimensions[0] - 1) + cell[0]; } VTKM_EXEC - inline void GetPoint(const vtkm::Id& index, vtkm::Vec& point) const + inline void GetPoint(const vtkm::Id& index, vtkm::Vec3f_32& point) const { BOUNDS_CHECK(Coordinates, index); point = Coordinates.Get(index); } VTKM_EXEC - inline void GetMinPoint(const vtkm::Vec& cell, - vtkm::Vec& point) const + inline void GetMinPoint(const vtkm::Id3& cell, vtkm::Vec3f_32& point) const { const vtkm::Id pointIndex = (cell[2] * PointDimensions[1] + cell[1]) * PointDimensions[0] + cell[0]; @@ -193,9 +191,9 @@ protected: using UniformConstPortal = typename UniformArrayHandle::ExecutionTypes::PortalConst; vtkm::Id3 PointDimensions; - vtkm::Vec Origin; - vtkm::Vec InvSpacing; - vtkm::Vec MaxPoint; + vtkm::Vec3f_32 Origin; + vtkm::Vec3f_32 InvSpacing; + vtkm::Vec3f_32 MaxPoint; UniformConstPortal Coordinates; vtkm::exec::ConnectivityStructured Conn; @@ -209,9 +207,9 @@ public: { Origin = Coordinates.GetOrigin(); PointDimensions = Conn.GetPointDimensions(); - vtkm::Vec spacing = Coordinates.GetSpacing(); + vtkm::Vec3f_32 spacing = Coordinates.GetSpacing(); - vtkm::Vec unitLength; + vtkm::Vec3f_32 unitLength; unitLength[0] = static_cast(PointDimensions[0] - 1); unitLength[1] = static_cast(PointDimensions[1] - 1); unitLength[2] = static_cast(PointDimensions[2] - 1); @@ -222,7 +220,7 @@ public: } VTKM_EXEC - inline bool IsInside(const vtkm::Vec& point) const + inline bool IsInside(const vtkm::Vec3f_32& point) const { bool inside = true; if (point[0] < Origin[0] || point[0] > MaxPoint[0]) @@ -235,8 +233,7 @@ public: } VTKM_EXEC - inline void GetCellIndices(const vtkm::Vec& cell, - vtkm::Vec& cellIndices) const + inline void GetCellIndices(const vtkm::Id3& cell, vtkm::Vec& cellIndices) const { cellIndices[0] = (cell[2] * PointDimensions[1] + cell[1]) * PointDimensions[0] + cell[0]; cellIndices[1] = cellIndices[0] + 1; @@ -249,17 +246,17 @@ public: } // GetCellIndices VTKM_EXEC - inline vtkm::Id GetCellIndex(const vtkm::Vec& cell) const + inline vtkm::Id GetCellIndex(const vtkm::Id3& cell) const { return (cell[2] * (PointDimensions[1] - 1) + cell[1]) * (PointDimensions[0] - 1) + cell[0]; } VTKM_EXEC - inline void LocateCell(vtkm::Vec& cell, - const vtkm::Vec& point, - vtkm::Vec& invSpacing) const + inline void LocateCell(vtkm::Id3& cell, + const vtkm::Vec3f_32& point, + vtkm::Vec3f_32& invSpacing) const { - vtkm::Vec temp = point; + vtkm::Vec3f_32 temp = point; temp = temp - Origin; temp = temp * InvSpacing; //make sure that if we border the upper edge, we sample the correct cell @@ -274,15 +271,14 @@ public: } VTKM_EXEC - inline void GetPoint(const vtkm::Id& index, vtkm::Vec& point) const + inline void GetPoint(const vtkm::Id& index, vtkm::Vec3f_32& point) const { BOUNDS_CHECK(Coordinates, index); point = Coordinates.Get(index); } VTKM_EXEC - inline void GetMinPoint(const vtkm::Vec& cell, - vtkm::Vec& point) const + inline void GetMinPoint(const vtkm::Id3& cell, vtkm::Vec3f_32& point) const { const vtkm::Id pointIndex = (cell[2] * PointDimensions[1] + cell[1]) * PointDimensions[0] + cell[0]; @@ -299,7 +295,7 @@ template class Sampler : public vtkm::worklet::WorkletMapField { private: - using ColorArrayHandle = typename vtkm::cont::ArrayHandle>; + using ColorArrayHandle = typename vtkm::cont::ArrayHandle; using ColorArrayPortal = typename ColorArrayHandle::ExecutionTypes::PortalConst; ColorArrayPortal ColorMap; vtkm::Id ColorMapSize; @@ -332,15 +328,15 @@ public: using ExecutionSignature = void(_1, _2, _3, _4, _5, _6, WorkIndex); template - VTKM_EXEC void operator()(const vtkm::Vec& rayDir, - const vtkm::Vec& rayOrigin, + VTKM_EXEC void operator()(const vtkm::Vec3f_32& rayDir, + const vtkm::Vec3f_32& rayOrigin, const vtkm::Float32& minDistance, const vtkm::Float32& maxDistance, ColorBufferType& colorBuffer, ScalarPortalType& scalars, const vtkm::Id& pixelIndex) const { - vtkm::Vec color; + vtkm::Vec4f_32 color; BOUNDS_CHECK(colorBuffer, pixelIndex * 4 + 0); color[0] = colorBuffer.Get(pixelIndex * 4 + 0); BOUNDS_CHECK(colorBuffer, pixelIndex * 4 + 1); @@ -355,7 +351,7 @@ public: return; //TODO: Compact? or just image subset... } //get the initial sample position; - vtkm::Vec sampleLocation; + vtkm::Vec3f_32 sampleLocation; // find the distance to the first sample vtkm::Float32 distance = minDistance + 0.0001f; sampleLocation = rayOrigin + distance * rayDir; @@ -376,7 +372,7 @@ public: |/ |/ |/ 0----------1 |__ x */ - vtkm::Vec bottomLeft(0, 0, 0); + vtkm::Vec3f_32 bottomLeft(0, 0, 0); bool newCell = true; //check to see if we left the cell vtkm::Float32 tx = 0.f; @@ -391,8 +387,8 @@ public: vtkm::Float32 scalar6minus7 = 0.f; vtkm::Float32 scalar7 = 0.f; - vtkm::Vec cell(0, 0, 0); - vtkm::Vec invSpacing(0.f, 0.f, 0.f); + vtkm::Id3 cell(0, 0, 0); + vtkm::Vec3f_32 invSpacing(0.f, 0.f, 0.f); while (Locator.IsInside(sampleLocation) && distance < maxDistance) @@ -451,7 +447,7 @@ public: if (colorIndex > ColorMapSize) colorIndex = ColorMapSize; - vtkm::Vec sampleColor = ColorMap.Get(colorIndex); + vtkm::Vec4f_32 sampleColor = ColorMap.Get(colorIndex); //composite sampleColor[3] *= (1.f - color[3]); @@ -492,7 +488,7 @@ template class SamplerCellAssoc : public vtkm::worklet::WorkletMapField { private: - using ColorArrayHandle = typename vtkm::cont::ArrayHandle>; + using ColorArrayHandle = typename vtkm::cont::ArrayHandle; using ColorArrayPortal = typename ColorArrayHandle::ExecutionTypes::PortalConst; ColorArrayPortal ColorMap; vtkm::Id ColorMapSize; @@ -524,15 +520,15 @@ public: using ExecutionSignature = void(_1, _2, _3, _4, _5, _6, WorkIndex); template - VTKM_EXEC void operator()(const vtkm::Vec& rayDir, - const vtkm::Vec& rayOrigin, + VTKM_EXEC void operator()(const vtkm::Vec3f_32& rayDir, + const vtkm::Vec3f_32& rayOrigin, const vtkm::Float32& minDistance, const vtkm::Float32& maxDistance, ColorBufferType& colorBuffer, const ScalarPortalType& scalars, const vtkm::Id& pixelIndex) const { - vtkm::Vec color; + vtkm::Vec4f_32 color; BOUNDS_CHECK(colorBuffer, pixelIndex * 4 + 0); color[0] = colorBuffer.Get(pixelIndex * 4 + 0); BOUNDS_CHECK(colorBuffer, pixelIndex * 4 + 1); @@ -545,7 +541,7 @@ public: if (minDistance == -1.f) return; //TODO: Compact? or just image subset... //get the initial sample position; - vtkm::Vec sampleLocation; + vtkm::Vec3f_32 sampleLocation; // find the distance to the first sample vtkm::Float32 distance = minDistance + 0.0001f; sampleLocation = rayOrigin + distance * rayDir; @@ -572,10 +568,10 @@ public: vtkm::Float32 ty = 2.f; vtkm::Float32 tz = 2.f; vtkm::Float32 scalar0 = 0.f; - vtkm::Vec sampleColor(0.f, 0.f, 0.f, 0.f); - vtkm::Vec bottomLeft(0.f, 0.f, 0.f); - vtkm::Vec invSpacing(0.f, 0.f, 0.f); - vtkm::Vec cell(0, 0, 0); + vtkm::Vec4f_32 sampleColor(0.f, 0.f, 0.f, 0.f); + vtkm::Vec3f_32 bottomLeft(0.f, 0.f, 0.f); + vtkm::Vec3f_32 invSpacing(0.f, 0.f, 0.f); + vtkm::Id3 cell(0, 0, 0); while (Locator.IsInside(sampleLocation) && distance < maxDistance) { vtkm::Float32 mint = vtkm::Min(tx, vtkm::Min(ty, tz)); @@ -718,8 +714,7 @@ VolumeRendererStructured::VolumeRendererStructured() SampleDistance = -1.f; } -void VolumeRendererStructured::SetColorMap( - const vtkm::cont::ArrayHandle>& colorMap) +void VolumeRendererStructured::SetColorMap(const vtkm::cont::ArrayHandle& colorMap) { ColorMap = colorMap; } @@ -789,7 +784,7 @@ void VolumeRendererStructured::RenderOnDevice(vtkm::rendering::raytracing::Ray

extent; + vtkm::Vec3f_32 extent; extent[0] = static_cast(this->SpatialExtent.X.Length()); extent[1] = static_cast(this->SpatialExtent.Y.Length()); extent[2] = static_cast(this->SpatialExtent.Z.Length()); diff --git a/vtkm/rendering/raytracing/VolumeRendererStructured.h b/vtkm/rendering/raytracing/VolumeRendererStructured.h index 05b829848..e58158e64 100644 --- a/vtkm/rendering/raytracing/VolumeRendererStructured.h +++ b/vtkm/rendering/raytracing/VolumeRendererStructured.h @@ -38,7 +38,7 @@ public: void DisableCompositeBackground(); VTKM_CONT - void SetColorMap(const vtkm::cont::ArrayHandle>& colorMap); + void SetColorMap(const vtkm::cont::ArrayHandle& colorMap); VTKM_CONT void SetData(const vtkm::cont::CoordinateSystem& coords, @@ -68,7 +68,7 @@ protected: vtkm::cont::ArrayHandleVirtualCoordinates Coordinates; vtkm::cont::CellSetStructured<3> Cellset; const vtkm::cont::Field* ScalarField; - vtkm::cont::ArrayHandle> ColorMap; + vtkm::cont::ArrayHandle ColorMap; vtkm::Float32 SampleDistance; vtkm::Range ScalarRange; }; diff --git a/vtkm/rendering/testing/RenderTest.h b/vtkm/rendering/testing/RenderTest.h index 117cb1df7..e3a40ab30 100644 --- a/vtkm/rendering/testing/RenderTest.h +++ b/vtkm/rendering/testing/RenderTest.h @@ -110,11 +110,8 @@ void Render(const vtkm::cont::DataSet& ds, // Print the title std::unique_ptr titleAnnotation( - new vtkm::rendering::TextAnnotationScreen("Test Plot", - vtkm::rendering::Color(1, 1, 1, 1), - .075f, - vtkm::Vec(-.11f, .92f), - 0.f)); + new vtkm::rendering::TextAnnotationScreen( + "Test Plot", vtkm::rendering::Color(1, 1, 1, 1), .075f, vtkm::Vec2f_32(-.11f, .92f), 0.f)); view.AddAnnotation(std::move(titleAnnotation)); Render(view, outputFile); } @@ -140,11 +137,8 @@ void Render(MapperType& mapper, // Print the title std::unique_ptr titleAnnotation( - new vtkm::rendering::TextAnnotationScreen("Test Plot", - vtkm::rendering::Color(1, 1, 1, 1), - .075f, - vtkm::Vec(-.11f, .92f), - 0.f)); + new vtkm::rendering::TextAnnotationScreen( + "Test Plot", vtkm::rendering::Color(1, 1, 1, 1), .075f, vtkm::Vec2f_32(-.11f, .92f), 0.f)); view.AddAnnotation(std::move(titleAnnotation)); Render(view, outputFile); } @@ -175,11 +169,8 @@ void Render(const vtkm::cont::DataSet& ds, // Print the title std::unique_ptr titleAnnotation( - new vtkm::rendering::TextAnnotationScreen("Test Plot", - vtkm::rendering::Color(1, 1, 1, 1), - .075f, - vtkm::Vec(-.11f, .92f), - 0.f)); + new vtkm::rendering::TextAnnotationScreen( + "Test Plot", vtkm::rendering::Color(1, 1, 1, 1), .075f, vtkm::Vec2f_32(-.11f, .92f), 0.f)); view.AddAnnotation(std::move(titleAnnotation)); Render(view, outputFile); } @@ -208,7 +199,7 @@ void Render(const vtkm::cont::DataSet& ds, // Print the title std::unique_ptr titleAnnotation( new vtkm::rendering::TextAnnotationScreen( - "1D Test Plot", foreground, .1f, vtkm::Vec(-.27f, .87f), 0.f)); + "1D Test Plot", foreground, .1f, vtkm::Vec2f_32(-.27f, .87f), 0.f)); view.AddAnnotation(std::move(titleAnnotation)); view.SetLogY(logY); Render(view, outputFile); diff --git a/vtkm/rendering/testing/UnitTestMapperWireframer.cxx b/vtkm/rendering/testing/UnitTestMapperWireframer.cxx index 67c7620de..b05b382e9 100644 --- a/vtkm/rendering/testing/UnitTestMapperWireframer.cxx +++ b/vtkm/rendering/testing/UnitTestMapperWireframer.cxx @@ -25,8 +25,8 @@ vtkm::cont::DataSet Make3DUniformDataSet(vtkm::Id size = 64) vtkm::Float32 center = static_cast(-size) / 2.0f; vtkm::cont::DataSetBuilderUniform builder; vtkm::cont::DataSet dataSet = builder.Create(vtkm::Id3(size, size, size), - vtkm::Vec(center, center, center), - vtkm::Vec(1.0f, 1.0f, 1.0f)); + vtkm::Vec3f_32(center, center, center), + vtkm::Vec3f_32(1.0f, 1.0f, 1.0f)); const char* fieldName = "pointvar"; vtkm::Id numValues = dataSet.GetCoordinateSystem().GetNumberOfPoints(); vtkm::cont::ArrayHandleCounting fieldValues( @@ -42,7 +42,7 @@ vtkm::cont::DataSet Make2DExplicitDataSet() vtkm::cont::DataSet dataSet; vtkm::cont::DataSetBuilderExplicit dsb; const int nVerts = 5; - using CoordType = vtkm::Vec; + using CoordType = vtkm::Vec3f_32; std::vector coords(nVerts); CoordType coordinates[nVerts] = { CoordType(0.f, 0.f, 0.f), CoordType(1.f, .5f, 0.f), diff --git a/vtkm/testing/Testing.h b/vtkm/testing/Testing.h index 4f8a177af..0aaf2c481 100644 --- a/vtkm/testing/Testing.h +++ b/vtkm/testing/Testing.h @@ -371,7 +371,7 @@ public: } struct TypeListTagExemplarTypes - : vtkm::ListTagBase> + : vtkm::ListTagBase { }; diff --git a/vtkm/testing/UnitTestBounds.cxx b/vtkm/testing/UnitTestBounds.cxx index 36d29b7fd..cba905a1d 100644 --- a/vtkm/testing/UnitTestBounds.cxx +++ b/vtkm/testing/UnitTestBounds.cxx @@ -17,7 +17,7 @@ namespace void TestBounds() { - using Vec3 = vtkm::Vec; + using Vec3 = vtkm::Vec3f_64; std::cout << "Empty bounds." << std::endl; vtkm::Bounds emptyBounds; diff --git a/vtkm/testing/UnitTestHash.cxx b/vtkm/testing/UnitTestHash.cxx index 5215eccde..a35d93b94 100644 --- a/vtkm/testing/UnitTestHash.cxx +++ b/vtkm/testing/UnitTestHash.cxx @@ -64,8 +64,8 @@ static void TestHash() DoHashTest(vtkm::Id2()); DoHashTest(vtkm::Id3()); DoHashTest(vtkm::Vec()); - DoHashTest(vtkm::Vec()); - DoHashTest(vtkm::Vec()); + DoHashTest(vtkm::IdComponent2()); + DoHashTest(vtkm::IdComponent3()); DoHashTest(vtkm::Vec()); } diff --git a/vtkm/testing/UnitTestPair.cxx b/vtkm/testing/UnitTestPair.cxx index a58e5d3c6..e9ab0327e 100644 --- a/vtkm/testing/UnitTestPair.cxx +++ b/vtkm/testing/UnitTestPair.cxx @@ -147,12 +147,11 @@ void PairTest() PairTestOrdering(); } -struct PairTypesToTry - : vtkm::ListTagBase, vtkm::Int64> // Recursive Pairs - > +struct PairTypesToTry : vtkm::ListTagBase // Recursive Pairs + > { }; diff --git a/vtkm/testing/UnitTestTypeListTag.cxx b/vtkm/testing/UnitTestTypeListTag.cxx index 9c45dcbc1..6c797b6a1 100644 --- a/vtkm/testing/UnitTestTypeListTag.cxx +++ b/vtkm/testing/UnitTestTypeListTag.cxx @@ -116,32 +116,32 @@ void TestLists() std::cout << "TypeListTagFieldVec2" << std::endl; TypeSet vec2; - vec2.AddExpected(vtkm::Vec()); - vec2.AddExpected(vtkm::Vec()); + vec2.AddExpected(vtkm::Vec2f_32()); + vec2.AddExpected(vtkm::Vec2f_64()); TryList(vec2, vtkm::TypeListTagFieldVec2()); std::cout << "TypeListTagFieldVec3" << std::endl; TypeSet vec3; - vec3.AddExpected(vtkm::Vec()); - vec3.AddExpected(vtkm::Vec()); + vec3.AddExpected(vtkm::Vec3f_32()); + vec3.AddExpected(vtkm::Vec3f_64()); TryList(vec3, vtkm::TypeListTagFieldVec3()); std::cout << "TypeListTagFieldVec4" << std::endl; TypeSet vec4; - vec4.AddExpected(vtkm::Vec()); - vec4.AddExpected(vtkm::Vec()); + vec4.AddExpected(vtkm::Vec4f_32()); + vec4.AddExpected(vtkm::Vec4f_64()); TryList(vec4, vtkm::TypeListTagFieldVec4()); std::cout << "TypeListTagField" << std::endl; TypeSet field; field.AddExpected(vtkm::Float32()); field.AddExpected(vtkm::Float64()); - field.AddExpected(vtkm::Vec()); - field.AddExpected(vtkm::Vec()); - field.AddExpected(vtkm::Vec()); - field.AddExpected(vtkm::Vec()); - field.AddExpected(vtkm::Vec()); - field.AddExpected(vtkm::Vec()); + field.AddExpected(vtkm::Vec2f_32()); + field.AddExpected(vtkm::Vec2f_64()); + field.AddExpected(vtkm::Vec3f_32()); + field.AddExpected(vtkm::Vec3f_64()); + field.AddExpected(vtkm::Vec4f_32()); + field.AddExpected(vtkm::Vec4f_64()); TryList(field, vtkm::TypeListTagField()); std::cout << "TypeListTagCommon" << std::endl; @@ -151,8 +151,8 @@ void TestLists() common.AddExpected(vtkm::UInt8()); common.AddExpected(vtkm::Int32()); common.AddExpected(vtkm::Int64()); - common.AddExpected(vtkm::Vec()); - common.AddExpected(vtkm::Vec()); + common.AddExpected(vtkm::Vec3f_32()); + common.AddExpected(vtkm::Vec3f_64()); TryList(common, vtkm::TypeListTagCommon()); std::cout << "TypeListTagScalarAll" << std::endl; @@ -171,55 +171,55 @@ void TestLists() std::cout << "TypeListTagVecCommon" << std::endl; TypeSet vecCommon; - vecCommon.AddExpected(vtkm::Vec()); - vecCommon.AddExpected(vtkm::Vec()); - vecCommon.AddExpected(vtkm::Vec()); - vecCommon.AddExpected(vtkm::Vec()); - vecCommon.AddExpected(vtkm::Vec()); - vecCommon.AddExpected(vtkm::Vec()); - vecCommon.AddExpected(vtkm::Vec()); - vecCommon.AddExpected(vtkm::Vec()); - vecCommon.AddExpected(vtkm::Vec()); - vecCommon.AddExpected(vtkm::Vec()); - vecCommon.AddExpected(vtkm::Vec()); - vecCommon.AddExpected(vtkm::Vec()); - vecCommon.AddExpected(vtkm::Vec()); - vecCommon.AddExpected(vtkm::Vec()); - vecCommon.AddExpected(vtkm::Vec()); + vecCommon.AddExpected(vtkm::Vec2f_32()); + vecCommon.AddExpected(vtkm::Vec2f_64()); + vecCommon.AddExpected(vtkm::Vec2ui_8()); + vecCommon.AddExpected(vtkm::Vec2i_32()); + vecCommon.AddExpected(vtkm::Vec2i_64()); + vecCommon.AddExpected(vtkm::Vec3f_32()); + vecCommon.AddExpected(vtkm::Vec3f_64()); + vecCommon.AddExpected(vtkm::Vec3ui_8()); + vecCommon.AddExpected(vtkm::Vec3i_32()); + vecCommon.AddExpected(vtkm::Vec3i_64()); + vecCommon.AddExpected(vtkm::Vec4f_32()); + vecCommon.AddExpected(vtkm::Vec4f_64()); + vecCommon.AddExpected(vtkm::Vec4ui_8()); + vecCommon.AddExpected(vtkm::Vec4i_32()); + vecCommon.AddExpected(vtkm::Vec4i_64()); TryList(vecCommon, vtkm::TypeListTagVecCommon()); std::cout << "TypeListTagVecAll" << std::endl; TypeSet vecAll; - vecAll.AddExpected(vtkm::Vec()); - vecAll.AddExpected(vtkm::Vec()); - vecAll.AddExpected(vtkm::Vec()); - vecAll.AddExpected(vtkm::Vec()); - vecAll.AddExpected(vtkm::Vec()); - vecAll.AddExpected(vtkm::Vec()); - vecAll.AddExpected(vtkm::Vec()); - vecAll.AddExpected(vtkm::Vec()); - vecAll.AddExpected(vtkm::Vec()); - vecAll.AddExpected(vtkm::Vec()); - vecAll.AddExpected(vtkm::Vec()); - vecAll.AddExpected(vtkm::Vec()); - vecAll.AddExpected(vtkm::Vec()); - vecAll.AddExpected(vtkm::Vec()); - vecAll.AddExpected(vtkm::Vec()); - vecAll.AddExpected(vtkm::Vec()); - vecAll.AddExpected(vtkm::Vec()); - vecAll.AddExpected(vtkm::Vec()); - vecAll.AddExpected(vtkm::Vec()); - vecAll.AddExpected(vtkm::Vec()); - vecAll.AddExpected(vtkm::Vec()); - vecAll.AddExpected(vtkm::Vec()); - vecAll.AddExpected(vtkm::Vec()); - vecAll.AddExpected(vtkm::Vec()); - vecAll.AddExpected(vtkm::Vec()); - vecAll.AddExpected(vtkm::Vec()); - vecAll.AddExpected(vtkm::Vec()); - vecAll.AddExpected(vtkm::Vec()); - vecAll.AddExpected(vtkm::Vec()); - vecAll.AddExpected(vtkm::Vec()); + vecAll.AddExpected(vtkm::Vec2f_32()); + vecAll.AddExpected(vtkm::Vec2f_64()); + vecAll.AddExpected(vtkm::Vec2i_8()); + vecAll.AddExpected(vtkm::Vec2i_16()); + vecAll.AddExpected(vtkm::Vec2i_32()); + vecAll.AddExpected(vtkm::Vec2i_64()); + vecAll.AddExpected(vtkm::Vec2ui_8()); + vecAll.AddExpected(vtkm::Vec2ui_16()); + vecAll.AddExpected(vtkm::Vec2ui_32()); + vecAll.AddExpected(vtkm::Vec2ui_64()); + vecAll.AddExpected(vtkm::Vec3f_32()); + vecAll.AddExpected(vtkm::Vec3f_64()); + vecAll.AddExpected(vtkm::Vec3i_8()); + vecAll.AddExpected(vtkm::Vec3i_16()); + vecAll.AddExpected(vtkm::Vec3i_32()); + vecAll.AddExpected(vtkm::Vec3i_64()); + vecAll.AddExpected(vtkm::Vec3ui_8()); + vecAll.AddExpected(vtkm::Vec3ui_16()); + vecAll.AddExpected(vtkm::Vec3ui_32()); + vecAll.AddExpected(vtkm::Vec3ui_64()); + vecAll.AddExpected(vtkm::Vec4f_32()); + vecAll.AddExpected(vtkm::Vec4f_64()); + vecAll.AddExpected(vtkm::Vec4i_8()); + vecAll.AddExpected(vtkm::Vec4i_16()); + vecAll.AddExpected(vtkm::Vec4i_32()); + vecAll.AddExpected(vtkm::Vec4i_64()); + vecAll.AddExpected(vtkm::Vec4ui_8()); + vecAll.AddExpected(vtkm::Vec4ui_16()); + vecAll.AddExpected(vtkm::Vec4ui_32()); + vecAll.AddExpected(vtkm::Vec4ui_64()); TryList(vecAll, vtkm::TypeListTagVecAll()); std::cout << "TypeListTagAll" << std::endl; @@ -234,36 +234,36 @@ void TestLists() all.AddExpected(vtkm::UInt32()); all.AddExpected(vtkm::Int64()); all.AddExpected(vtkm::UInt64()); - all.AddExpected(vtkm::Vec()); - all.AddExpected(vtkm::Vec()); - all.AddExpected(vtkm::Vec()); - all.AddExpected(vtkm::Vec()); - all.AddExpected(vtkm::Vec()); - all.AddExpected(vtkm::Vec()); - all.AddExpected(vtkm::Vec()); - all.AddExpected(vtkm::Vec()); - all.AddExpected(vtkm::Vec()); - all.AddExpected(vtkm::Vec()); - all.AddExpected(vtkm::Vec()); - all.AddExpected(vtkm::Vec()); - all.AddExpected(vtkm::Vec()); - all.AddExpected(vtkm::Vec()); - all.AddExpected(vtkm::Vec()); - all.AddExpected(vtkm::Vec()); - all.AddExpected(vtkm::Vec()); - all.AddExpected(vtkm::Vec()); - all.AddExpected(vtkm::Vec()); - all.AddExpected(vtkm::Vec()); - all.AddExpected(vtkm::Vec()); - all.AddExpected(vtkm::Vec()); - all.AddExpected(vtkm::Vec()); - all.AddExpected(vtkm::Vec()); - all.AddExpected(vtkm::Vec()); - all.AddExpected(vtkm::Vec()); - all.AddExpected(vtkm::Vec()); - all.AddExpected(vtkm::Vec()); - all.AddExpected(vtkm::Vec()); - all.AddExpected(vtkm::Vec()); + all.AddExpected(vtkm::Vec2f_32()); + all.AddExpected(vtkm::Vec2f_64()); + all.AddExpected(vtkm::Vec2i_8()); + all.AddExpected(vtkm::Vec2i_16()); + all.AddExpected(vtkm::Vec2i_32()); + all.AddExpected(vtkm::Vec2i_64()); + all.AddExpected(vtkm::Vec2ui_8()); + all.AddExpected(vtkm::Vec2ui_16()); + all.AddExpected(vtkm::Vec2ui_32()); + all.AddExpected(vtkm::Vec2ui_64()); + all.AddExpected(vtkm::Vec3f_32()); + all.AddExpected(vtkm::Vec3f_64()); + all.AddExpected(vtkm::Vec3i_8()); + all.AddExpected(vtkm::Vec3i_16()); + all.AddExpected(vtkm::Vec3i_32()); + all.AddExpected(vtkm::Vec3i_64()); + all.AddExpected(vtkm::Vec3ui_8()); + all.AddExpected(vtkm::Vec3ui_16()); + all.AddExpected(vtkm::Vec3ui_32()); + all.AddExpected(vtkm::Vec3ui_64()); + all.AddExpected(vtkm::Vec4f_32()); + all.AddExpected(vtkm::Vec4f_64()); + all.AddExpected(vtkm::Vec4i_8()); + all.AddExpected(vtkm::Vec4i_16()); + all.AddExpected(vtkm::Vec4i_32()); + all.AddExpected(vtkm::Vec4i_64()); + all.AddExpected(vtkm::Vec4ui_8()); + all.AddExpected(vtkm::Vec4ui_16()); + all.AddExpected(vtkm::Vec4ui_32()); + all.AddExpected(vtkm::Vec4ui_64()); TryList(all, vtkm::TypeListTagAll()); } diff --git a/vtkm/testing/UnitTestTypes.cxx b/vtkm/testing/UnitTestTypes.cxx index 665eab8fc..40e0eac0a 100644 --- a/vtkm/testing/UnitTestTypes.cxx +++ b/vtkm/testing/UnitTestTypes.cxx @@ -862,14 +862,14 @@ struct TypeTestFunctor struct TypesToTest : vtkm::ListTagJoin, - vtkm::Vec, + vtkm::Id4, vtkm::Vec, vtkm::Vec, - vtkm::Vec, + vtkm::Id2, vtkm::Vec, vtkm::Vec, - vtkm::Vec, 3>, - vtkm::Vec, 5>>> + vtkm::Vec, + vtkm::Vec>> { }; diff --git a/vtkm/testing/UnitTestVecAxisAlignedPointCoordinates.cxx b/vtkm/testing/UnitTestVecAxisAlignedPointCoordinates.cxx index 81857d568..21b59aecc 100644 --- a/vtkm/testing/UnitTestVecAxisAlignedPointCoordinates.cxx +++ b/vtkm/testing/UnitTestVecAxisAlignedPointCoordinates.cxx @@ -15,7 +15,7 @@ namespace { -using Vec3 = vtkm::Vec; +using Vec3 = vtkm::Vec3f; static const Vec3 g_Origin = Vec3(1.0f, 2.0f, 3.0f); static const Vec3 g_Spacing = Vec3(4.0f, 5.0f, 6.0f); @@ -90,11 +90,11 @@ void TryVecAxisAlignedPointCoordinates( CheckCoordsValues(coords); std::cout << "Check CopyInto." << std::endl; - vtkm::Vec, VecCoordsType::NUM_COMPONENTS> copy1; + vtkm::Vec copy1; coords.CopyInto(copy1); CheckCoordsValues(copy1); - vtkm::Vec, VecCoordsType::NUM_COMPONENTS> copy2; + vtkm::Vec copy2; VTraits::CopyInto(coords, copy2); CheckCoordsValues(copy2); diff --git a/vtkm/testing/UnitTestVecTraits.cxx b/vtkm/testing/UnitTestVecTraits.cxx index f7838bfc0..d1dddd535 100644 --- a/vtkm/testing/UnitTestVecTraits.cxx +++ b/vtkm/testing/UnitTestVecTraits.cxx @@ -67,8 +67,8 @@ void TestVecTraits() ExpectFalseType(vtkm::HasVecTraits()); vtkm::testing::TestVecComponentsTag(); - vtkm::testing::TestVecComponentsTag>(); - vtkm::testing::TestVecComponentsTag>(); + vtkm::testing::TestVecComponentsTag(); + vtkm::testing::TestVecComponentsTag(); vtkm::testing::TestVecComponentsTag>(); vtkm::testing::TestVecComponentsTag>(); vtkm::testing::TestScalarComponentsTag(); diff --git a/vtkm/worklet/ExternalFaces.h b/vtkm/worklet/ExternalFaces.h index 8726a401f..1aea6a77a 100644 --- a/vtkm/worklet/ExternalFaces.h +++ b/vtkm/worklet/ExternalFaces.h @@ -56,8 +56,8 @@ struct ExternalFaces using InputDomain = _1; VTKM_CONT - NumExternalFacesPerStructuredCell(const vtkm::Vec& min_point, - const vtkm::Vec& max_point) + NumExternalFacesPerStructuredCell(const vtkm::Vec3f_64& min_point, + const vtkm::Vec3f_64& max_point) : MinPoint(min_point) , MaxPoint(max_point) { @@ -112,8 +112,8 @@ struct ExternalFaces } private: - vtkm::Vec MinPoint; - vtkm::Vec MaxPoint; + vtkm::Vec3f_64 MinPoint; + vtkm::Vec3f_64 MaxPoint; }; @@ -140,8 +140,7 @@ struct ExternalFaces } VTKM_CONT - BuildConnectivityStructured(const vtkm::Vec& min_point, - const vtkm::Vec& max_point) + BuildConnectivityStructured(const vtkm::Vec3f_64& min_point, const vtkm::Vec3f_64& max_point) : MinPoint(min_point) , MaxPoint(max_point) { @@ -304,8 +303,8 @@ struct ExternalFaces } private: - vtkm::Vec MinPoint; - vtkm::Vec MaxPoint; + vtkm::Vec3f_64 MinPoint; + vtkm::Vec3f_64 MaxPoint; }; //Worklet that returns the number of faces for each cell/shape @@ -679,8 +678,8 @@ public: ConnectivityStorage, OffsetsStorage>& outCellSet) { - vtkm::Vec MinPoint; - vtkm::Vec MaxPoint; + vtkm::Vec3f_64 MinPoint; + vtkm::Vec3f_64 MaxPoint; vtkm::Id3 PointDimensions = inCellSet.GetPointDimensions(); @@ -713,9 +712,9 @@ public: auto Coordinates = vertices.GetPortalConstControl(); MinPoint = Coordinates.GetOrigin(); - vtkm::Vec spacing = Coordinates.GetSpacing(); + vtkm::Vec3f_64 spacing = Coordinates.GetSpacing(); - vtkm::Vec unitLength; + vtkm::Vec3f_64 unitLength; unitLength[0] = static_cast(PointDimensions[0] - 1); unitLength[1] = static_cast(PointDimensions[1] - 1); unitLength[2] = static_cast(PointDimensions[2] - 1); diff --git a/vtkm/worklet/ExtractPoints.h b/vtkm/worklet/ExtractPoints.h index cc87af59f..ec3a1dca4 100644 --- a/vtkm/worklet/ExtractPoints.h +++ b/vtkm/worklet/ExtractPoints.h @@ -51,8 +51,7 @@ public: } VTKM_EXEC - bool operator()(const vtkm::Vec& coordinate, - const vtkm::ImplicitFunction* function) const + bool operator()(const vtkm::Vec3f_64& coordinate, const vtkm::ImplicitFunction* function) const { bool pass = passValue; vtkm::Float64 value = function->Value(coordinate); diff --git a/vtkm/worklet/KernelSplatter.h b/vtkm/worklet/KernelSplatter.h index 2e62473bd..66c47cf39 100644 --- a/vtkm/worklet/KernelSplatter.h +++ b/vtkm/worklet/KernelSplatter.h @@ -142,8 +142,8 @@ struct KernelSplatterFilterUniformGrid using VecHandleType = vtkm::cont::ArrayHandle; using IdHandleType = vtkm::cont::ArrayHandle; // - using FloatVec = vtkm::Vec; - using PointType = vtkm::Vec; + using FloatVec = vtkm::Vec3f_32; + using PointType = vtkm::Vec3f_64; using PointHandleType = vtkm::cont::ArrayHandle; // using VecPermType = vtkm::cont::ArrayHandlePermutation; @@ -183,8 +183,8 @@ struct KernelSplatterFilterUniformGrid class GetFootprint : public vtkm::worklet::WorkletMapField { private: - vtkm::Vec origin_; - vtkm::Vec spacing_; + vtkm::Vec3f_64 origin_; + vtkm::Vec3f_64 spacing_; vtkm::Id3 VolumeDimensions; Kernel kernel_; @@ -194,8 +194,8 @@ struct KernelSplatterFilterUniformGrid using ExecutionSignature = void(_1, _2, _3, _4, _5, _6, _7, _8); VTKM_CONT - GetFootprint(const vtkm::Vec& o, - const vtkm::Vec& s, + GetFootprint(const vtkm::Vec3f_64& o, + const vtkm::Vec3f_64& s, const vtkm::Id3& dim, const Kernel& kernel) : origin_(o) @@ -210,13 +210,13 @@ struct KernelSplatterFilterUniformGrid const T& y, const T& z, const T2& h, - vtkm::Vec& splatPoint, + vtkm::Vec3f_64& splatPoint, vtkm::Id3& minFootprint, vtkm::Id3& maxFootprint, vtkm::Id& footprintSize) const { PointType splat, min, max; - vtkm::Vec sample = vtkm::make_Vec(x, y, z); + vtkm::Vec3f_64 sample = vtkm::make_Vec(x, y, z); vtkm::Id size = 1; double cutoff = kernel_.maxDistance(h); for (int i = 0; i < 3; i++) @@ -272,8 +272,8 @@ struct KernelSplatterFilterUniformGrid class GetSplatValue : public vtkm::worklet::WorkletMapField { private: - vtkm::Vec spacing_; - vtkm::Vec origin_; + vtkm::Vec3f_64 spacing_; + vtkm::Vec3f_64 origin_; vtkm::Id3 VolumeDim; vtkm::Float64 Radius2; vtkm::Float64 ExponentFactor; @@ -286,8 +286,8 @@ struct KernelSplatterFilterUniformGrid using ExecutionSignature = void(_1, _2, _3, _4, _5, _6, _7, _8); VTKM_CONT - GetSplatValue(const vtkm::Vec& orig, - const vtkm::Vec& s, + GetSplatValue(const vtkm::Vec3f_64& orig, + const vtkm::Vec3f_64& s, const vtkm::Id3& dim, const Kernel& k) : spacing_(s) @@ -362,8 +362,8 @@ struct KernelSplatterFilterUniformGrid // instead of requiring them to be passed as parameters. //----------------------------------------------------------------------- KernelSplatterFilterUniformGrid(const vtkm::Id3& dims, - vtkm::Vec origin, - vtkm::Vec spacing, + vtkm::Vec3f origin, + vtkm::Vec3f spacing, const vtkm::cont::DataSet& dataset, const Kernel& kernel) : dims_(dims) diff --git a/vtkm/worklet/OscillatorSource.h b/vtkm/worklet/OscillatorSource.h index 2eeb3582d..f3c0ca11e 100644 --- a/vtkm/worklet/OscillatorSource.h +++ b/vtkm/worklet/OscillatorSource.h @@ -39,7 +39,7 @@ struct Oscillator this->Zeta = zeta; } - vtkm::Vec Center; + vtkm::Vec3f_64 Center; vtkm::Float64 Radius; vtkm::Float64 Omega; vtkm::Float64 Zeta; @@ -109,7 +109,7 @@ public: void SetTime(vtkm::Float64 time) { this->Time = time; } VTKM_EXEC - vtkm::Float64 operator()(const vtkm::Vec& vec) const + vtkm::Float64 operator()(const vtkm::Vec3f_64& vec) const { vtkm::UInt8 oIdx; vtkm::Float64 t0, t, result = 0; @@ -123,7 +123,7 @@ public: { oscillator = &this->DampedOscillators[oIdx]; - vtkm::Vec delta = oscillator->Center - vec; + vtkm::Vec3f_64 delta = oscillator->Center - vec; vtkm::Float64 dist2 = dot(delta, delta); vtkm::Float64 dist_damp = vtkm::Exp(-dist2 / (2 * oscillator->Radius * oscillator->Radius)); vtkm::Float64 phi = vtkm::ACos(oscillator->Zeta); @@ -140,7 +140,7 @@ public: { oscillator = &this->DecayingOscillators[oIdx]; t = t0 + 1 / oscillator->Omega; - vtkm::Vec delta = oscillator->Center - vec; + vtkm::Vec3f_64 delta = oscillator->Center - vec; vtkm::Float64 dist2 = dot(delta, delta); vtkm::Float64 dist_damp = vtkm::Exp(-dist2 / (2 * oscillator->Radius * oscillator->Radius)); vtkm::Float64 val = vtkm::Sin(t / oscillator->Omega) / (oscillator->Omega * t); @@ -152,7 +152,7 @@ public: { oscillator = &this->PeriodicOscillators[oIdx]; t = t0 + 1 / oscillator->Omega; - vtkm::Vec delta = oscillator->Center - vec; + vtkm::Vec3f_64 delta = oscillator->Center - vec; vtkm::Float64 dist2 = dot(delta, delta); vtkm::Float64 dist_damp = vtkm::Exp(-dist2 / (2 * oscillator->Radius * oscillator->Radius)); vtkm::Float64 val = vtkm::Sin(t / oscillator->Omega); diff --git a/vtkm/worklet/PointElevation.h b/vtkm/worklet/PointElevation.h index 01b323b88..f44f6fa42 100644 --- a/vtkm/worklet/PointElevation.h +++ b/vtkm/worklet/PointElevation.h @@ -46,10 +46,10 @@ public: } VTKM_CONT - void SetLowPoint(const vtkm::Vec& point) { this->LowPoint = point; } + void SetLowPoint(const vtkm::Vec3f_64& point) { this->LowPoint = point; } VTKM_CONT - void SetHighPoint(const vtkm::Vec& point) { this->HighPoint = point; } + void SetHighPoint(const vtkm::Vec3f_64& point) { this->HighPoint = point; } VTKM_CONT void SetRange(vtkm::Float64 low, vtkm::Float64 high) @@ -59,9 +59,9 @@ public: } VTKM_EXEC - vtkm::Float64 operator()(const vtkm::Vec& vec) const + vtkm::Float64 operator()(const vtkm::Vec3f_64& vec) const { - vtkm::Vec direction = this->HighPoint - this->LowPoint; + vtkm::Vec3f_64 direction = this->HighPoint - this->LowPoint; vtkm::Float64 lengthSqr = vtkm::Dot(direction, direction); vtkm::Float64 rangeLength = this->RangeHigh - this->RangeLow; vtkm::Float64 s = vtkm::Dot(vec - this->LowPoint, direction) / lengthSqr; @@ -78,7 +78,7 @@ public: } private: - vtkm::Vec LowPoint, HighPoint; + vtkm::Vec3f_64 LowPoint, HighPoint; vtkm::Float64 RangeLow, RangeHigh; }; } diff --git a/vtkm/worklet/PointMerge.h b/vtkm/worklet/PointMerge.h index a269b92b5..1c0492af1 100644 --- a/vtkm/worklet/PointMerge.h +++ b/vtkm/worklet/PointMerge.h @@ -42,8 +42,8 @@ public: // This class can take point worldCoords as inputs and return the bin index of the enclosing bin. class BinLocator : public vtkm::cont::ExecutionAndControlObjectBase { - vtkm::Vec Offset; - vtkm::Vec Scale; + vtkm::Vec3f_64 Offset; + vtkm::Vec3f_64 Scale; #ifdef VTKM_USE_64BIT_IDS // IEEE double precision floating point as 53 bits for the significand, so it would not be @@ -64,12 +64,11 @@ public: } VTKM_CONT - static vtkm::Vec ComputeBinWidths(const vtkm::Bounds& bounds, - vtkm::Float64 delta) + static vtkm::Vec3f_64 ComputeBinWidths(const vtkm::Bounds& bounds, vtkm::Float64 delta) { - const vtkm::Vec boundLengths( + const vtkm::Vec3f_64 boundLengths( bounds.X.Length() + delta, bounds.Y.Length() + delta, bounds.Z.Length() + delta); - vtkm::Vec binWidths; + vtkm::Vec3f_64 binWidths; for (vtkm::IdComponent dimIndex = 0; dimIndex < 3; ++dimIndex) { if (boundLengths[dimIndex] > vtkm::Epsilon64()) @@ -104,8 +103,8 @@ public: BinLocator(const vtkm::Bounds& bounds, vtkm::Float64 delta = 0.0) : Offset(bounds.X.Min, bounds.Y.Min, bounds.Z.Min) { - const vtkm::Vec binWidths = ComputeBinWidths(bounds, delta); - this->Scale = vtkm::Vec(1.0) / binWidths; + const vtkm::Vec3f_64 binWidths = ComputeBinWidths(bounds, delta); + this->Scale = vtkm::Vec3f_64(1.0) / binWidths; } // Shifts the grid by delta in the specified directions. This will allow the bins to cover @@ -115,7 +114,7 @@ public: vtkm::Float64 delta, const vtkm::Vec& directions) { - const vtkm::Vec binWidths = ComputeBinWidths(bounds, delta); + const vtkm::Vec3f_64 binWidths = ComputeBinWidths(bounds, delta); BinLocator shiftedLocator(*this); for (vtkm::IdComponent dimIndex = 0; dimIndex < 3; ++dimIndex) { @@ -130,7 +129,7 @@ public: template VTKM_EXEC_CONT vtkm::Id3 FindBin(const vtkm::Vec& worldCoords) const { - vtkm::Vec relativeCoords = (worldCoords - this->Offset) * this->Scale; + vtkm::Vec3f_64 relativeCoords = (worldCoords - this->Offset) * this->Scale; return vtkm::Id3(vtkm::Floor(relativeCoords)); } @@ -428,7 +427,7 @@ public: vtkm::cont::ArrayHandleVirtualCoordinates& points) // coordinates, modified to merge close { // Get a cast to a concrete set of point coordiantes so that it can be modified in place - vtkm::cont::ArrayHandle> concretePoints; + vtkm::cont::ArrayHandle concretePoints; if (points.IsType()) { concretePoints = points.Cast(); diff --git a/vtkm/worklet/Probe.h b/vtkm/worklet/Probe.h index 51832f03d..e89339ba6 100644 --- a/vtkm/worklet/Probe.h +++ b/vtkm/worklet/Probe.h @@ -43,10 +43,10 @@ public: using ExecutionSignature = void(_1, _2, _3, _4); template - VTKM_EXEC void operator()(const vtkm::Vec& point, + VTKM_EXEC void operator()(const vtkm::Vec3f& point, const LocatorType& locator, vtkm::Id& cellId, - vtkm::Vec& pcoords) const + vtkm::Vec3f& pcoords) const { locator->FindCell(point, cellId, pcoords, *this); } @@ -315,7 +315,7 @@ private: static constexpr vtkm::UInt8 HIDDEN = 2; // from vtk vtkm::cont::ArrayHandle CellIds; - vtkm::cont::ArrayHandle> ParametricCoordinates; + vtkm::cont::ArrayHandle ParametricCoordinates; vtkm::cont::DynamicCellSet InputCellSet; }; } diff --git a/vtkm/worklet/ScalarsToColors.h b/vtkm/worklet/ScalarsToColors.h index 8efca465b..34bd877dd 100644 --- a/vtkm/worklet/ScalarsToColors.h +++ b/vtkm/worklet/ScalarsToColors.h @@ -83,40 +83,40 @@ public: /// template void Run(const vtkm::cont::ArrayHandle& values, - vtkm::cont::ArrayHandle>& rgbaOut) const; + vtkm::cont::ArrayHandle& rgbaOut) const; /// \brief Use each component to generate RGB colors /// template void Run(const vtkm::cont::ArrayHandle& values, - vtkm::cont::ArrayHandle>& rgbOut) const; + vtkm::cont::ArrayHandle& rgbOut) const; /// \brief Use magnitude of a vector to generate RGBA colors /// template void RunMagnitude(const vtkm::cont::ArrayHandle, S>& values, - vtkm::cont::ArrayHandle>& rgbaOut) const; + vtkm::cont::ArrayHandle& rgbaOut) const; /// \brief Use magnitude of a vector to generate RGB colors /// template void RunMagnitude(const vtkm::cont::ArrayHandle, S>& values, - vtkm::cont::ArrayHandle>& rgbOut) const; + vtkm::cont::ArrayHandle& rgbOut) const; /// \brief Use a single component of a vector to generate RGBA colors /// template void RunComponent(const vtkm::cont::ArrayHandle, S>& values, vtkm::IdComponent comp, - vtkm::cont::ArrayHandle>& rgbaOut) const; + vtkm::cont::ArrayHandle& rgbaOut) const; /// \brief Use a single component of a vector to generate RGB colors /// template void RunComponent(const vtkm::cont::ArrayHandle, S>& values, vtkm::IdComponent comp, - vtkm::cont::ArrayHandle>& rgbOut) const; + vtkm::cont::ArrayHandle& rgbOut) const; }; } } diff --git a/vtkm/worklet/ScalarsToColors.hxx b/vtkm/worklet/ScalarsToColors.hxx index cefd35326..67991f7c0 100644 --- a/vtkm/worklet/ScalarsToColors.hxx +++ b/vtkm/worklet/ScalarsToColors.hxx @@ -50,7 +50,7 @@ inline bool needShiftScale(T, vtkm::Float32, vtkm::Float32) /// template void ScalarsToColors::Run(const vtkm::cont::ArrayHandle& values, - vtkm::cont::ArrayHandle>& rgbaOut) const + vtkm::cont::ArrayHandle& rgbaOut) const { using namespace vtkm::worklet::colorconversion; //If our shift is 0 and our scale == 1 no need to apply them @@ -73,7 +73,7 @@ void ScalarsToColors::Run(const vtkm::cont::ArrayHandle& values, /// template void ScalarsToColors::Run(const vtkm::cont::ArrayHandle& values, - vtkm::cont::ArrayHandle>& rgbOut) const + vtkm::cont::ArrayHandle& rgbOut) const { using namespace vtkm::worklet::colorconversion; using BaseT = typename vtkm::BaseComponent::Type; @@ -94,9 +94,8 @@ void ScalarsToColors::Run(const vtkm::cont::ArrayHandle& values, /// \brief Use magnitude of a vector to generate RGBA colors /// template -void ScalarsToColors::RunMagnitude( - const vtkm::cont::ArrayHandle, S>& values, - vtkm::cont::ArrayHandle>& rgbaOut) const +void ScalarsToColors::RunMagnitude(const vtkm::cont::ArrayHandle, S>& values, + vtkm::cont::ArrayHandle& rgbaOut) const { //magnitude is a complex situation. the default scale factor is incorrect // @@ -123,7 +122,7 @@ void ScalarsToColors::RunMagnitude( /// template void ScalarsToColors::RunMagnitude(const vtkm::cont::ArrayHandle, S>& values, - vtkm::cont::ArrayHandle>& rgbOut) const + vtkm::cont::ArrayHandle& rgbOut) const { using namespace vtkm::worklet::colorconversion; @@ -147,10 +146,9 @@ void ScalarsToColors::RunMagnitude(const vtkm::cont::ArrayHandle /// \brief Use a single component of a vector to generate RGBA colors /// template -void ScalarsToColors::RunComponent( - const vtkm::cont::ArrayHandle, S>& values, - vtkm::IdComponent comp, - vtkm::cont::ArrayHandle>& rgbaOut) const +void ScalarsToColors::RunComponent(const vtkm::cont::ArrayHandle, S>& values, + vtkm::IdComponent comp, + vtkm::cont::ArrayHandle& rgbaOut) const { this->Run(vtkm::cont::make_ArrayHandleTransform(values, colorconversion::ComponentPortal(comp)), rgbaOut); @@ -161,7 +159,7 @@ void ScalarsToColors::RunComponent( template void ScalarsToColors::RunComponent(const vtkm::cont::ArrayHandle, S>& values, vtkm::IdComponent comp, - vtkm::cont::ArrayHandle>& rgbOut) const + vtkm::cont::ArrayHandle& rgbOut) const { this->Run(vtkm::cont::make_ArrayHandleTransform(values, colorconversion::ComponentPortal(comp)), rgbOut); diff --git a/vtkm/worklet/SplitSharpEdges.h b/vtkm/worklet/SplitSharpEdges.h index 81dbbde64..ad6b98b7f 100644 --- a/vtkm/worklet/SplitSharpEdges.h +++ b/vtkm/worklet/SplitSharpEdges.h @@ -373,8 +373,7 @@ public: NumberOfOldPoints + newPointStartingIndex + visitedCellsRegionIndex[i] - 1; vtkm::Id globalCellId = incidentCells[static_cast(i)]; // (cellGlobalIndex, oldPointId, replacementPointId) - vtkm::Vec tuple = - vtkm::make_Vec(globalCellId, pointIndex, replacementPointId); + vtkm::Id3 tuple = vtkm::make_Vec(globalCellId, pointIndex, replacementPointId); cellTopologyUpdateTuples.Set(cellTopologyUpdateTuplesIndex, tuple); cellTopologyUpdateTuplesIndex++; } diff --git a/vtkm/worklet/StreamSurface.h b/vtkm/worklet/StreamSurface.h index ddb4d59fb..1be9bad28 100644 --- a/vtkm/worklet/StreamSurface.h +++ b/vtkm/worklet/StreamSurface.h @@ -215,10 +215,10 @@ public: VTKM_CONT void Run(const vtkm::cont::CoordinateSystem& coords, const vtkm::cont::DynamicCellSet& cellset, - vtkm::cont::ArrayHandle>& newPoints, + vtkm::cont::ArrayHandle& newPoints, vtkm::cont::CellSetSingleType<>& newCells) { - using ExplCoordsType = vtkm::cont::ArrayHandle>; + using ExplCoordsType = vtkm::cont::ArrayHandle; if (!(coords.GetData().IsType() && (cellset.IsSameType(vtkm::cont::CellSetExplicit<>()) || diff --git a/vtkm/worklet/Tube.h b/vtkm/worklet/Tube.h index 2c39efe2b..0c7288124 100644 --- a/vtkm/worklet/Tube.h +++ b/vtkm/worklet/Tube.h @@ -148,7 +148,7 @@ public: { //The following follows the VTK implementation in: //vtkPolyLine::GenerateSlidingNormals - vtkm::Vec sPrev, sNext, normal, p0, p1; + vtkm::Vec3f sPrev, sNext, normal, p0, p1; vtkm::IdComponent sNextId = FindValidSegment(inPts, ptIndices, numPoints, 0); if (sNextId != numPoints) // at least one valid segment @@ -245,7 +245,7 @@ public: } private: - vtkm::Vec DefaultNorm; + vtkm::Vec3f DefaultNorm; }; //Helper worklet to generate the tube points @@ -295,7 +295,7 @@ public: return; else { - vtkm::Vec n, p, pNext, sNext, sPrev; + vtkm::Vec3f n, p, pNext, sNext, sPrev; vtkm::Id outIdx = tubePointOffsets; for (vtkm::IdComponent j = 0; j < numPoints; j++) { @@ -348,7 +348,7 @@ public: } //this only implements the 'sides share vertices' line 476 - vtkm::Vec normal; + vtkm::Vec3f normal; for (vtkm::IdComponent k = 0; k < this->NumSides; k++) { vtkm::FloatDefault angle = static_cast(k) * this->Theta; @@ -476,11 +476,11 @@ public: VTKM_CONT void Run(const vtkm::cont::CoordinateSystem& coords, const vtkm::cont::DynamicCellSet& cellset, - vtkm::cont::ArrayHandle>& newPoints, + vtkm::cont::ArrayHandle& newPoints, vtkm::cont::CellSetSingleType<>& newCells) { - using ExplCoordsType = vtkm::cont::ArrayHandle>; - using NormalsType = vtkm::cont::ArrayHandle>; + using ExplCoordsType = vtkm::cont::ArrayHandle; + using NormalsType = vtkm::cont::ArrayHandle; if (!(coords.GetData().IsType() && (cellset.IsSameType(vtkm::cont::CellSetExplicit<>()) || diff --git a/vtkm/worklet/VertexClustering.h b/vtkm/worklet/VertexClustering.h index 45f8b80c5..4575aff5b 100644 --- a/vtkm/worklet/VertexClustering.h +++ b/vtkm/worklet/VertexClustering.h @@ -127,10 +127,10 @@ struct VertexClustering struct GridInfo { - vtkm::Vec dim; - vtkm::Vec origin; - vtkm::Vec bin_size; - vtkm::Vec inv_bin_size; + vtkm::Id3 dim; + vtkm::Vec3f_64 origin; + vtkm::Vec3f_64 bin_size; + vtkm::Vec3f_64 inv_bin_size; }; // input: points output: cid of the points diff --git a/vtkm/worklet/WarpScalar.h b/vtkm/worklet/WarpScalar.h index 45a567487..bae6e863b 100644 --- a/vtkm/worklet/WarpScalar.h +++ b/vtkm/worklet/WarpScalar.h @@ -41,10 +41,10 @@ public: } VTKM_EXEC - void operator()(const vtkm::Vec& point, - const vtkm::Vec& normal, + void operator()(const vtkm::Vec3f& point, + const vtkm::Vec3f& normal, const vtkm::FloatDefault& scaleFactor, - vtkm::Vec& result) const + vtkm::Vec3f& result) const { result = point + this->ScaleAmount * scaleFactor * normal; } diff --git a/vtkm/worklet/WarpVector.h b/vtkm/worklet/WarpVector.h index 2ce1f7af2..06c7d60d4 100644 --- a/vtkm/worklet/WarpVector.h +++ b/vtkm/worklet/WarpVector.h @@ -42,9 +42,7 @@ public: } VTKM_EXEC - vtkm::Vec operator()( - const vtkm::Vec& point, - const vtkm::Vec& vector) const + vtkm::Vec3f operator()(const vtkm::Vec3f& point, const vtkm::Vec3f& vector) const { return point + this->Scale * vector; } diff --git a/vtkm/worklet/WaveletGenerator.h b/vtkm/worklet/WaveletGenerator.h index 794783d8d..6983dd3db 100644 --- a/vtkm/worklet/WaveletGenerator.h +++ b/vtkm/worklet/WaveletGenerator.h @@ -37,7 +37,7 @@ struct Worker : public vtkm::exec::FunctorBase { using OutputHandleType = vtkm::cont::ArrayHandle; using OutputPortalType = decltype(std::declval().PrepareForOutput(0, Device())); - using Vec3F = vtkm::Vec; + using Vec3F = vtkm::Vec3f; Vec3F Center; Vec3F Spacing; @@ -158,7 +158,7 @@ struct runWorker */ class WaveletGenerator { - using Vec3F = vtkm::Vec; + using Vec3F = vtkm::Vec3f; Vec3F Center; Vec3F Spacing; diff --git a/vtkm/worklet/clip/ClipTables.h b/vtkm/worklet/clip/ClipTables.h index 631e0f3d1..851b77e26 100644 --- a/vtkm/worklet/clip/ClipTables.h +++ b/vtkm/worklet/clip/ClipTables.h @@ -2466,7 +2466,7 @@ VTKM_STATIC_CONSTEXPR_ARRAY vtkm::UInt8 CellEdges[CELL_EDGES_SIZE] = { class ClipTables : public vtkm::cont::ExecutionObjectBase { public: - using EdgeVec = vtkm::Vec; + using EdgeVec = vtkm::IdComponent2; template class DevicePortal diff --git a/vtkm/worklet/colorconversion/Conversions.h b/vtkm/worklet/colorconversion/Conversions.h index 799c177d7..d48dec971 100644 --- a/vtkm/worklet/colorconversion/Conversions.h +++ b/vtkm/worklet/colorconversion/Conversions.h @@ -40,18 +40,18 @@ VTKM_EXEC inline void Clamp(vtkm::Float32& val) { val = vtkm::Min(255.0f, vtkm::Max(0.0f, val)); } -VTKM_EXEC inline void Clamp(vtkm::Vec& val) +VTKM_EXEC inline void Clamp(vtkm::Vec2f_32& val) { val[0] = vtkm::Min(255.0f, vtkm::Max(0.0f, val[0])); val[1] = vtkm::Min(255.0f, vtkm::Max(0.0f, val[1])); } -VTKM_EXEC inline void Clamp(vtkm::Vec& val) +VTKM_EXEC inline void Clamp(vtkm::Vec3f_32& val) { val[0] = vtkm::Min(255.0f, vtkm::Max(0.0f, val[0])); val[1] = vtkm::Min(255.0f, vtkm::Max(0.0f, val[1])); val[2] = vtkm::Min(255.0f, vtkm::Max(0.0f, val[2])); } -VTKM_EXEC inline void Clamp(vtkm::Vec& val) +VTKM_EXEC inline void Clamp(vtkm::Vec4f_32& val) { val[0] = vtkm::Min(255.0f, vtkm::Max(0.0f, val[0])); val[1] = vtkm::Min(255.0f, vtkm::Max(0.0f, val[1])); diff --git a/vtkm/worklet/colorconversion/ConvertToRGB.h b/vtkm/worklet/colorconversion/ConvertToRGB.h index c652d373b..6e2ac657a 100644 --- a/vtkm/worklet/colorconversion/ConvertToRGB.h +++ b/vtkm/worklet/colorconversion/ConvertToRGB.h @@ -25,33 +25,33 @@ struct ConvertToRGB : public vtkm::worklet::WorkletMapField using ExecutionSignature = _2(_1); template - VTKM_EXEC vtkm::Vec operator()(const T& in) const + VTKM_EXEC vtkm::Vec3ui_8 operator()(const T& in) const { //vtkScalarsToColorsLuminanceToRGB const vtkm::UInt8 la = colorconversion::ColorToUChar(in); return vtkm::Vec(la, la, la); } template - VTKM_EXEC vtkm::Vec operator()(const vtkm::Vec& in) const + VTKM_EXEC vtkm::Vec3ui_8 operator()(const vtkm::Vec& in) const { //vtkScalarsToColorsLuminanceAlphaToRGB (which actually doesn't exist in vtk) return this->operator()(in[0]); } template - VTKM_EXEC vtkm::Vec operator()(const vtkm::Vec& in) const + VTKM_EXEC vtkm::Vec3ui_8 operator()(const vtkm::Vec& in) const { //vtkScalarsToColorsRGBToRGB return vtkm::Vec(colorconversion::ColorToUChar(in[0]), colorconversion::ColorToUChar(in[1]), colorconversion::ColorToUChar(in[2])); } - VTKM_EXEC vtkm::Vec operator()(const vtkm::Vec& in) const + VTKM_EXEC vtkm::Vec3ui_8 operator()(const vtkm::Vec3ui_8& in) const { //vtkScalarsToColorsRGBToRGB return in; } template - VTKM_EXEC vtkm::Vec operator()(const vtkm::Vec& in) const + VTKM_EXEC vtkm::Vec3ui_8 operator()(const vtkm::Vec& in) const { //vtkScalarsToColorsRGBAToRGB return vtkm::Vec(colorconversion::ColorToUChar(in[0]), colorconversion::ColorToUChar(in[1]), diff --git a/vtkm/worklet/colorconversion/ConvertToRGBA.h b/vtkm/worklet/colorconversion/ConvertToRGBA.h index 59c1dc3f1..6eab0c051 100644 --- a/vtkm/worklet/colorconversion/ConvertToRGBA.h +++ b/vtkm/worklet/colorconversion/ConvertToRGBA.h @@ -30,14 +30,14 @@ struct ConvertToRGBA : public vtkm::worklet::WorkletMapField } template - VTKM_EXEC vtkm::Vec operator()(const T& in) const + VTKM_EXEC vtkm::Vec4ui_8 operator()(const T& in) const { //vtkScalarsToColorsLuminanceToRGBA const vtkm::UInt8 l = colorconversion::ColorToUChar(in); return vtkm::Vec(l, l, l, colorconversion::ColorToUChar(this->Alpha)); } template - VTKM_EXEC vtkm::Vec operator()(const vtkm::Vec& in) const + VTKM_EXEC vtkm::Vec4ui_8 operator()(const vtkm::Vec& in) const { //vtkScalarsToColorsLuminanceAlphaToRGBA const vtkm::UInt8 l = colorconversion::ColorToUChar(in[0]); const vtkm::UInt8 a = colorconversion::ColorToUChar(in[1]); @@ -45,7 +45,7 @@ struct ConvertToRGBA : public vtkm::worklet::WorkletMapField } template - VTKM_EXEC vtkm::Vec operator()(const vtkm::Vec& in) const + VTKM_EXEC vtkm::Vec4ui_8 operator()(const vtkm::Vec& in) const { //vtkScalarsToColorsRGBToRGBA return vtkm::Vec(colorconversion::ColorToUChar(in[0]), colorconversion::ColorToUChar(in[1]), @@ -54,7 +54,7 @@ struct ConvertToRGBA : public vtkm::worklet::WorkletMapField } template - VTKM_EXEC vtkm::Vec operator()(const vtkm::Vec& in) const + VTKM_EXEC vtkm::Vec4ui_8 operator()(const vtkm::Vec& in) const { //vtkScalarsToColorsRGBAToRGBA const vtkm::UInt8 a = colorconversion::ColorToUChar(in[3]); return vtkm::Vec(colorconversion::ColorToUChar(in[0]), diff --git a/vtkm/worklet/colorconversion/LookupTable.h b/vtkm/worklet/colorconversion/LookupTable.h index 1448b00a4..f0d42c1f6 100644 --- a/vtkm/worklet/colorconversion/LookupTable.h +++ b/vtkm/worklet/colorconversion/LookupTable.h @@ -25,10 +25,8 @@ namespace worklet namespace colorconversion { -struct LookupTableTypes : vtkm::ListTagBase, - vtkm::Vec, - vtkm::Vec, - vtkm::Vec> +struct LookupTableTypes + : vtkm::ListTagBase { }; diff --git a/vtkm/worklet/colorconversion/ShiftScaleToRGB.h b/vtkm/worklet/colorconversion/ShiftScaleToRGB.h index 27ae316f0..0d216dab8 100644 --- a/vtkm/worklet/colorconversion/ShiftScaleToRGB.h +++ b/vtkm/worklet/colorconversion/ShiftScaleToRGB.h @@ -33,32 +33,32 @@ struct ShiftScaleToRGB : public vtkm::worklet::WorkletMapField } template - VTKM_EXEC vtkm::Vec operator()(const T& in) const + VTKM_EXEC vtkm::Vec3ui_8 operator()(const T& in) const { //vtkScalarsToColorsLuminanceToRGB vtkm::Float32 l = (static_cast(in) + this->Shift) * this->Scale; colorconversion::Clamp(l); - return vtkm::Vec{ static_cast(l + 0.5f) }; + return vtkm::Vec3ui_8{ static_cast(l + 0.5f) }; } template - VTKM_EXEC vtkm::Vec operator()(const vtkm::Vec& in) const + VTKM_EXEC vtkm::Vec3ui_8 operator()(const vtkm::Vec& in) const { //vtkScalarsToColorsLuminanceAlphaToRGB (which actually doesn't exist in vtk) return this->operator()(in[0]); } template - VTKM_EXEC vtkm::Vec operator()(const vtkm::Vec& in) const + VTKM_EXEC vtkm::Vec3ui_8 operator()(const vtkm::Vec& in) const { //vtkScalarsToColorsRGBToRGB - vtkm::Vec rgb(in); - rgb = (rgb + vtkm::Vec(this->Shift)) * this->Scale; + vtkm::Vec3f_32 rgb(in); + rgb = (rgb + vtkm::Vec3f_32(this->Shift)) * this->Scale; colorconversion::Clamp(rgb); - return vtkm::Vec{ static_cast(rgb[0] + 0.5f), - static_cast(rgb[1] + 0.5f), - static_cast(rgb[2] + 0.5f) }; + return vtkm::Vec3ui_8{ static_cast(rgb[0] + 0.5f), + static_cast(rgb[1] + 0.5f), + static_cast(rgb[2] + 0.5f) }; } template - VTKM_EXEC vtkm::Vec operator()(const vtkm::Vec& in) const + VTKM_EXEC vtkm::Vec3ui_8 operator()(const vtkm::Vec& in) const { //vtkScalarsToColorsRGBAToRGB return this->operator()(vtkm::Vec{ in[0], in[1], in[2] }); } diff --git a/vtkm/worklet/colorconversion/ShiftScaleToRGBA.h b/vtkm/worklet/colorconversion/ShiftScaleToRGBA.h index f75ca7348..313257c3a 100644 --- a/vtkm/worklet/colorconversion/ShiftScaleToRGBA.h +++ b/vtkm/worklet/colorconversion/ShiftScaleToRGBA.h @@ -40,51 +40,49 @@ struct ShiftScaleToRGBA : public vtkm::worklet::WorkletMapField } template - VTKM_EXEC vtkm::Vec operator()(const T& in) const + VTKM_EXEC vtkm::Vec4ui_8 operator()(const T& in) const { //vtkScalarsToColorsLuminanceToRGBA vtkm::Float32 l = (static_cast(in) + this->Shift) * this->Scale; colorconversion::Clamp(l); const vtkm::UInt8 lc = static_cast(l + 0.5); - return vtkm::Vec{ lc, lc, lc, colorconversion::ColorToUChar(this->Alpha) }; + return vtkm::Vec4ui_8{ lc, lc, lc, colorconversion::ColorToUChar(this->Alpha) }; } template - VTKM_EXEC vtkm::Vec operator()(const vtkm::Vec& in) const + VTKM_EXEC vtkm::Vec4ui_8 operator()(const vtkm::Vec& in) const { //vtkScalarsToColorsLuminanceAlphaToRGBA - vtkm::Vec la(in); - la = (la + vtkm::Vec(this->Shift)) * this->Scale; + vtkm::Vec2f_32 la(in); + la = (la + vtkm::Vec2f_32(this->Shift)) * this->Scale; colorconversion::Clamp(la); const vtkm::UInt8 lc = static_cast(la[0] + 0.5f); - return vtkm::Vec{ - lc, lc, lc, static_cast((la[1] * this->Alpha) + 0.5f) - }; + return vtkm::Vec4ui_8{ lc, lc, lc, static_cast((la[1] * this->Alpha) + 0.5f) }; } template - VTKM_EXEC vtkm::Vec operator()(const vtkm::Vec& in) const + VTKM_EXEC vtkm::Vec4ui_8 operator()(const vtkm::Vec& in) const { //vtkScalarsToColorsRGBToRGBA - vtkm::Vec rgb(in); - rgb = (rgb + vtkm::Vec(this->Shift)) * this->Scale; + vtkm::Vec3f_32 rgb(in); + rgb = (rgb + vtkm::Vec3f_32(this->Shift)) * this->Scale; colorconversion::Clamp(rgb); - return vtkm::Vec{ static_cast(rgb[0] + 0.5f), - static_cast(rgb[1] + 0.5f), - static_cast(rgb[2] + 0.5f), - colorconversion::ColorToUChar(this->Alpha) }; + return vtkm::Vec4ui_8{ static_cast(rgb[0] + 0.5f), + static_cast(rgb[1] + 0.5f), + static_cast(rgb[2] + 0.5f), + colorconversion::ColorToUChar(this->Alpha) }; } template - VTKM_EXEC vtkm::Vec operator()(const vtkm::Vec& in) const + VTKM_EXEC vtkm::Vec4ui_8 operator()(const vtkm::Vec& in) const { //vtkScalarsToColorsRGBAToRGBA - vtkm::Vec rgba(in); - rgba = (rgba + vtkm::Vec(this->Shift)) * this->Scale; + vtkm::Vec4f_32 rgba(in); + rgba = (rgba + vtkm::Vec4f_32(this->Shift)) * this->Scale; colorconversion::Clamp(rgba); rgba[3] *= this->Alpha; - return vtkm::Vec{ static_cast(rgba[0] + 0.5f), - static_cast(rgba[1] + 0.5f), - static_cast(rgba[2] + 0.5f), - static_cast(rgba[3] + 0.5f) }; + return vtkm::Vec4ui_8{ static_cast(rgba[0] + 0.5f), + static_cast(rgba[1] + 0.5f), + static_cast(rgba[2] + 0.5f), + static_cast(rgba[3] + 0.5f) }; } }; } diff --git a/vtkm/worklet/colorconversion/TransferFunction.h b/vtkm/worklet/colorconversion/TransferFunction.h index a78b2cd58..fa9d1deed 100644 --- a/vtkm/worklet/colorconversion/TransferFunction.h +++ b/vtkm/worklet/colorconversion/TransferFunction.h @@ -32,7 +32,7 @@ struct TransferFunction : public vtkm::worklet::WorkletMapField using ExecutionSignature = void(_1, _2); template - VTKM_EXEC void operator()(const T& in, vtkm::Vec& output) const + VTKM_EXEC void operator()(const T& in, vtkm::Vec3ui_8& output) const { vtkm::Vec rgb = this->ColorTable->MapThroughColorSpace(static_cast(in)); output[0] = colorconversion::ColorToUChar(rgb[0]); @@ -41,7 +41,7 @@ struct TransferFunction : public vtkm::worklet::WorkletMapField } template - VTKM_EXEC void operator()(const T& in, vtkm::Vec& output) const + VTKM_EXEC void operator()(const T& in, vtkm::Vec4ui_8& output) const { vtkm::Vec rgb = this->ColorTable->MapThroughColorSpace(static_cast(in)); float alpha = this->ColorTable->MapThroughOpacitySpace(static_cast(in)); diff --git a/vtkm/worklet/gradient/CellGradient.h b/vtkm/worklet/gradient/CellGradient.h index 38088aea9..7a3bd8165 100644 --- a/vtkm/worklet/gradient/CellGradient.h +++ b/vtkm/worklet/gradient/CellGradient.h @@ -50,8 +50,7 @@ struct CellGradient : vtkm::worklet::WorkletMapPointToCell const FieldInVecType& field, GradientOutType& outputGradient) const { - vtkm::Vec center = - vtkm::exec::ParametricCoordinatesCenter(pointCount, shape, *this); + vtkm::Vec3f center = vtkm::exec::ParametricCoordinatesCenter(pointCount, shape, *this); outputGradient = vtkm::exec::CellDerivative(field, wCoords, center, shape, *this); } diff --git a/vtkm/worklet/gradient/Divergence.h b/vtkm/worklet/gradient/Divergence.h index 9a8eac361..7b8b5a0af 100644 --- a/vtkm/worklet/gradient/Divergence.h +++ b/vtkm/worklet/gradient/Divergence.h @@ -20,8 +20,8 @@ namespace worklet namespace gradient { -struct DivergenceTypes : vtkm::ListTagBase, 3>, - vtkm::Vec, 3>> +struct DivergenceTypes + : vtkm::ListTagBase, vtkm::Vec> { }; diff --git a/vtkm/worklet/gradient/GradientOutput.h b/vtkm/worklet/gradient/GradientOutput.h index 81ec2e032..2808154fd 100644 --- a/vtkm/worklet/gradient/GradientOutput.h +++ b/vtkm/worklet/gradient/GradientOutput.h @@ -243,17 +243,15 @@ struct GradientOutput : public GradientScalarOutput }; template <> -struct GradientOutput> - : public GradientVecOutput> +struct GradientOutput : public GradientVecOutput { - using GradientVecOutput>::GradientVecOutput; + using GradientVecOutput::GradientVecOutput; }; template <> -struct GradientOutput> - : public GradientVecOutput> +struct GradientOutput : public GradientVecOutput { - using GradientVecOutput>::GradientVecOutput; + using GradientVecOutput::GradientVecOutput; }; } } // namespace vtkm::exec diff --git a/vtkm/worklet/gradient/PointGradient.h b/vtkm/worklet/gradient/PointGradient.h index 2b347f8a6..0c80d30c6 100644 --- a/vtkm/worklet/gradient/PointGradient.h +++ b/vtkm/worklet/gradient/PointGradient.h @@ -100,7 +100,7 @@ private: const FieldInVecType& field, vtkm::Vec& gradient) const { - vtkm::Vec pCoords; + vtkm::Vec3f pCoords; vtkm::exec::ParametricCoordinatesPoint( wCoords.GetNumberOfComponents(), pointIndexForCell, pCoords, cellShape, *this); diff --git a/vtkm/worklet/gradient/QCriterion.h b/vtkm/worklet/gradient/QCriterion.h index ae044be72..f3e9017a1 100644 --- a/vtkm/worklet/gradient/QCriterion.h +++ b/vtkm/worklet/gradient/QCriterion.h @@ -20,8 +20,8 @@ namespace worklet namespace gradient { -struct QCriterionTypes : vtkm::ListTagBase, 3>, - vtkm::Vec, 3>> +struct QCriterionTypes + : vtkm::ListTagBase, vtkm::Vec> { }; diff --git a/vtkm/worklet/gradient/Vorticity.h b/vtkm/worklet/gradient/Vorticity.h index dd383a689..1d6b343bc 100644 --- a/vtkm/worklet/gradient/Vorticity.h +++ b/vtkm/worklet/gradient/Vorticity.h @@ -20,8 +20,8 @@ namespace worklet namespace gradient { -struct VorticityTypes : vtkm::ListTagBase, 3>, - vtkm::Vec, 3>> +struct VorticityTypes + : vtkm::ListTagBase, vtkm::Vec> { }; diff --git a/vtkm/worklet/internal/TriangulateTables.h b/vtkm/worklet/internal/TriangulateTables.h index 4dabf708f..ba1621e98 100644 --- a/vtkm/worklet/internal/TriangulateTables.h +++ b/vtkm/worklet/internal/TriangulateTables.h @@ -111,10 +111,9 @@ public: } template - VTKM_EXEC vtkm::Vec GetIndices(CellShape shape, - vtkm::IdComponent triangleIndex) const + VTKM_EXEC vtkm::IdComponent3 GetIndices(CellShape shape, vtkm::IdComponent triangleIndex) const { - vtkm::Vec triIndices; + vtkm::IdComponent3 triIndices; if (shape.Id == vtkm::CELL_SHAPE_POLYGON) { triIndices[0] = 0; @@ -316,10 +315,9 @@ public: } template - VTKM_EXEC vtkm::Vec GetIndices(CellShape shape, - vtkm::IdComponent tetrahedronIndex) const + VTKM_EXEC vtkm::IdComponent4 GetIndices(CellShape shape, vtkm::IdComponent tetrahedronIndex) const { - vtkm::Vec tetIndices; + vtkm::IdComponent4 tetIndices; vtkm::IdComponent offset = 4 * (this->Offsets.Get(shape.Id) + tetrahedronIndex); tetIndices[0] = this->Indices.Get(offset + 0); tetIndices[1] = this->Indices.Get(offset + 1); diff --git a/vtkm/worklet/particleadvection/GridEvaluators.h b/vtkm/worklet/particleadvection/GridEvaluators.h index 9f460ee10..a1ae180d7 100644 --- a/vtkm/worklet/particleadvection/GridEvaluators.h +++ b/vtkm/worklet/particleadvection/GridEvaluators.h @@ -67,8 +67,7 @@ public: VTKM_EXEC bool IsWithinTemporalBoundary(const vtkm::FloatDefault vtkmNotUsed(time)) const { return true; } VTKM_EXEC - void GetSpatialBoundary(vtkm::Vec& dir, - vtkm::Vec& boundary) const + void GetSpatialBoundary(vtkm::Vec3f& dir, vtkm::Vec& boundary) const { // Based on the direction of the velocity we need to be able to tell where // the particle will exit the domain from to actually push it out of domain. @@ -102,7 +101,7 @@ public: vtkm::UInt8 cellShape; vtkm::IdComponent nVerts; vtkm::VecVariable ptIndices; - vtkm::VecVariable, 8> fieldValues; + vtkm::VecVariable fieldValues; InterpolationHelper->GetCellInfo(cellId, cellShape, nVerts, ptIndices); for (vtkm::IdComponent i = 0; i < nVerts; i++) diff --git a/vtkm/worklet/particleadvection/TemporalGridEvaluators.h b/vtkm/worklet/particleadvection/TemporalGridEvaluators.h index 7f620cb66..a8ec2e768 100644 --- a/vtkm/worklet/particleadvection/TemporalGridEvaluators.h +++ b/vtkm/worklet/particleadvection/TemporalGridEvaluators.h @@ -59,8 +59,7 @@ public: } VTKM_EXEC - void GetSpatialBoundary(vtkm::Vec& dir, - vtkm::Vec& boundary) const + void GetSpatialBoundary(vtkm::Vec3f& dir, vtkm::Vec& boundary) const { // Based on the direction of the velocity we need to be able to tell where // the particle will exit the domain from to actually push it out of domain. diff --git a/vtkm/worklet/spatialstructure/BoundingIntervalHierarchy.h b/vtkm/worklet/spatialstructure/BoundingIntervalHierarchy.h index d97660588..1c5907c48 100644 --- a/vtkm/worklet/spatialstructure/BoundingIntervalHierarchy.h +++ b/vtkm/worklet/spatialstructure/BoundingIntervalHierarchy.h @@ -105,7 +105,7 @@ struct CellRangesExtracter : public vtkm::worklet::WorkletMapPointToCell rangeX = bounds.X; rangeY = bounds.Y; rangeZ = bounds.Z; - vtkm::Vec center = bounds.Center(); + vtkm::Vec3f center = bounds.Center(); centerX = center[0]; centerY = center[1]; centerZ = center[2]; @@ -374,7 +374,7 @@ struct CalculateSplitDirectionFlag : public vtkm::worklet::WorkletMapField { if (split.Dimension >= 0) { - const vtkm::Vec point(x, y, z); + const vtkm::Vec3f point(x, y, z); const vtkm::FloatDefault& c = point[split.Dimension]; // We use 0 to signify left child, 1 for right child flag = 1 - static_cast(c <= plane); diff --git a/vtkm/worklet/splatkernels/KernelBase.h b/vtkm/worklet/splatkernels/KernelBase.h index 559121092..8cdb3d18e 100644 --- a/vtkm/worklet/splatkernels/KernelBase.h +++ b/vtkm/worklet/splatkernels/KernelBase.h @@ -21,7 +21,7 @@ namespace splatkernels { // Vector class used in the kernels -using vector_type = vtkm::Vec; +using vector_type = vtkm::Vec3f_64; // Pi compatibility #ifndef M_PI #define M_PI vtkm::Pi() diff --git a/vtkm/worklet/testing/UnitTestBoundingIntervalHierarchy.cxx b/vtkm/worklet/testing/UnitTestBoundingIntervalHierarchy.cxx index 50ba66555..6ab040b55 100644 --- a/vtkm/worklet/testing/UnitTestBoundingIntervalHierarchy.cxx +++ b/vtkm/worklet/testing/UnitTestBoundingIntervalHierarchy.cxx @@ -32,8 +32,7 @@ struct CellCentroidCalculator : public vtkm::worklet::WorkletMapPointToCell vtkm::IdComponent numPoints, const InputPointField& inputPointField) const { - vtkm::Vec parametricCenter = - vtkm::exec::ParametricCoordinatesCenter(numPoints, shape, *this); + vtkm::Vec3f parametricCenter = vtkm::exec::ParametricCoordinatesCenter(numPoints, shape, *this); return vtkm::exec::CellInterpolate(inputPointField, parametricCenter, shape, *this); } }; // struct CellCentroidCalculator @@ -48,7 +47,7 @@ struct BoundingIntervalHierarchyTester : public vtkm::worklet::WorkletMapField const BoundingIntervalHierarchyExecObject& bih, const vtkm::Id expectedId) const { - vtkm::Vec parametric; + vtkm::Vec3f parametric; vtkm::Id cellId; bih->FindCell(point, cellId, parametric, *this); return (1 - static_cast(expectedId == cellId)); @@ -78,7 +77,7 @@ void TestBoundingIntervalHierarchy(vtkm::cont::DataSet dataSet, vtkm::IdComponen Timer centroidsTimer; centroidsTimer.Start(); - vtkm::cont::ArrayHandle> centroids; + vtkm::cont::ArrayHandle centroids; vtkm::worklet::DispatcherMapTopology().Invoke( cellSet, vertices, centroids); centroidsTimer.Stop(); diff --git a/vtkm/worklet/testing/UnitTestCellDeepCopy.cxx b/vtkm/worklet/testing/UnitTestCellDeepCopy.cxx index eef3e7704..882d7f4af 100644 --- a/vtkm/worklet/testing/UnitTestCellDeepCopy.cxx +++ b/vtkm/worklet/testing/UnitTestCellDeepCopy.cxx @@ -72,9 +72,9 @@ void CheckOutput(const vtkm::cont::CellSetExplicit<>& copiedCells) "Bad number of points in cell"); // Only checking 3 points. All cells should have at least 3 - vtkm::Vec cellPoints; + vtkm::Id3 cellPoints; copiedCells.GetIndices(cellIndex, cellPoints); - vtkm::Vec oCellPoints; + vtkm::Id3 oCellPoints; originalCells.GetIndices(oCellIndex, oCellPoints); VTKM_TEST_ASSERT(cellPoints == oCellPoints, "Point indices not copied correctly"); } diff --git a/vtkm/worklet/testing/UnitTestCellGradient.cxx b/vtkm/worklet/testing/UnitTestCellGradient.cxx index 24131b7a2..f97630354 100644 --- a/vtkm/worklet/testing/UnitTestCellGradient.cxx +++ b/vtkm/worklet/testing/UnitTestCellGradient.cxx @@ -24,14 +24,14 @@ void TestCellGradientUniform2D() vtkm::cont::DataSet dataSet = testDataSet.Make2DUniformDataSet0(); vtkm::cont::ArrayHandle input; - vtkm::cont::ArrayHandle> result; + vtkm::cont::ArrayHandle result; dataSet.GetField("pointvar").GetData().CopyTo(input); vtkm::worklet::CellGradient gradient; result = gradient.Run(dataSet.GetCellSet(), dataSet.GetCoordinateSystem(), input); - vtkm::Vec expected[2] = { { 10, 30, 0 }, { 10, 30, 0 } }; + vtkm::Vec3f_32 expected[2] = { { 10, 30, 0 }, { 10, 30, 0 } }; for (int i = 0; i < 2; ++i) { VTKM_TEST_ASSERT(test_equal(result.GetPortalConstControl().Get(i), expected[i]), @@ -47,14 +47,14 @@ void TestCellGradientUniform3D() vtkm::cont::DataSet dataSet = testDataSet.Make3DUniformDataSet0(); vtkm::cont::ArrayHandle input; - vtkm::cont::ArrayHandle> result; + vtkm::cont::ArrayHandle result; dataSet.GetField("pointvar").GetData().CopyTo(input); vtkm::worklet::CellGradient gradient; result = gradient.Run(dataSet.GetCellSet(), dataSet.GetCoordinateSystem(), input); - vtkm::Vec expected[4] = { + vtkm::Vec3f_32 expected[4] = { { 10.025f, 30.075f, 60.125f }, { 10.025f, 30.075f, 60.125f }, { 10.025f, 30.075f, 60.175f }, @@ -79,17 +79,17 @@ void TestCellGradientUniform3DWithVectorField() const int nVerts = 18; vtkm::Float64 vars[nVerts] = { 10.1, 20.1, 30.1, 40.1, 50.2, 60.2, 70.2, 80.2, 90.3, 100.3, 110.3, 120.3, 130.4, 140.4, 150.4, 160.4, 170.5, 180.5 }; - std::vector> vec(18); + std::vector vec(18); for (std::size_t i = 0; i < vec.size(); ++i) { vec[i] = vtkm::make_Vec(vars[i], vars[i], vars[i]); } - vtkm::cont::ArrayHandle> input = vtkm::cont::make_ArrayHandle(vec); + vtkm::cont::ArrayHandle input = vtkm::cont::make_ArrayHandle(vec); //we need to add Vec3 array to the dataset - vtkm::cont::ArrayHandle, 3>> result; + vtkm::cont::ArrayHandle> result; - vtkm::worklet::GradientOutputFields> extraOutput; + vtkm::worklet::GradientOutputFields extraOutput; extraOutput.SetComputeDivergence(false); extraOutput.SetComputeVorticity(false); extraOutput.SetComputeQCriterion(true); @@ -106,7 +106,7 @@ void TestCellGradientUniform3DWithVectorField() VTKM_TEST_ASSERT((extraOutput.QCriterion.GetNumberOfValues() == 4), "QCriterion field should be generated"); - vtkm::Vec, 3> expected[4] = { + vtkm::Vec expected[4] = { { { 10.025, 10.025, 10.025 }, { 30.075, 30.075, 30.075 }, { 60.125, 60.125, 60.125 } }, { { 10.025, 10.025, 10.025 }, { 30.075, 30.075, 30.075 }, { 60.125, 60.125, 60.125 } }, { { 10.025, 10.025, 10.025 }, { 30.075, 30.075, 30.075 }, { 60.175, 60.175, 60.175 } }, @@ -114,8 +114,8 @@ void TestCellGradientUniform3DWithVectorField() }; for (int i = 0; i < 4; ++i) { - vtkm::Vec, 3> e = expected[i]; - vtkm::Vec, 3> r = result.GetPortalConstControl().Get(i); + vtkm::Vec e = expected[i]; + vtkm::Vec r = result.GetPortalConstControl().Get(i); VTKM_TEST_ASSERT(test_equal(e[0], r[0]), "Wrong result for vec field CellGradient worklet on 3D uniform data"); @@ -124,9 +124,9 @@ void TestCellGradientUniform3DWithVectorField() VTKM_TEST_ASSERT(test_equal(e[2], r[2]), "Wrong result for vec field CellGradient worklet on 3D uniform data"); - const vtkm::Vec v(e[1][2] - e[2][1], e[2][0] - e[0][2], e[0][1] - e[1][0]); - const vtkm::Vec s(e[1][2] + e[2][1], e[2][0] + e[0][2], e[0][1] + e[1][0]); - const vtkm::Vec d(e[0][0], e[1][1], e[2][2]); + const vtkm::Vec3f_64 v(e[1][2] - e[2][1], e[2][0] - e[0][2], e[0][1] - e[1][0]); + const vtkm::Vec3f_64 s(e[1][2] + e[2][1], e[2][0] + e[0][2], e[0][1] + e[1][0]); + const vtkm::Vec3f_64 d(e[0][0], e[1][1], e[2][2]); //compute QCriterion vtkm::Float64 qcriterion = @@ -154,14 +154,14 @@ void TestCellGradientUniform3DWithVectorField2() const int nVerts = 18; vtkm::Float64 vars[nVerts] = { 10.1, 20.1, 30.1, 40.1, 50.2, 60.2, 70.2, 80.2, 90.3, 100.3, 110.3, 120.3, 130.4, 140.4, 150.4, 160.4, 170.5, 180.5 }; - std::vector> vec(18); + std::vector vec(18); for (std::size_t i = 0; i < vec.size(); ++i) { vec[i] = vtkm::make_Vec(vars[i], vars[i], vars[i]); } - vtkm::cont::ArrayHandle> input = vtkm::cont::make_ArrayHandle(vec); + vtkm::cont::ArrayHandle input = vtkm::cont::make_ArrayHandle(vec); - vtkm::worklet::GradientOutputFields> extraOutput; + vtkm::worklet::GradientOutputFields extraOutput; extraOutput.SetComputeGradient(false); extraOutput.SetComputeDivergence(true); extraOutput.SetComputeVorticity(true); @@ -184,7 +184,7 @@ void TestCellGradientUniform3DWithVectorField2() "QCriterion field shouldn't be generated"); //Verify the contents of the other arrays - vtkm::Vec, 3> expected_gradients[4] = { + vtkm::Vec expected_gradients[4] = { { { 10.025, 10.025, 10.025 }, { 30.075, 30.075, 30.075 }, { 60.125, 60.125, 60.125 } }, { { 10.025, 10.025, 10.025 }, { 30.075, 30.075, 30.075 }, { 60.125, 60.125, 60.125 } }, { { 10.025, 10.025, 10.025 }, { 30.075, 30.075, 30.075 }, { 60.175, 60.175, 60.175 } }, @@ -193,14 +193,14 @@ void TestCellGradientUniform3DWithVectorField2() for (int i = 0; i < 4; ++i) { - vtkm::Vec, 3> eg = expected_gradients[i]; + vtkm::Vec eg = expected_gradients[i]; vtkm::Float64 d = extraOutput.Divergence.GetPortalConstControl().Get(i); VTKM_TEST_ASSERT(test_equal((eg[0][0] + eg[1][1] + eg[2][2]), d), "Wrong result for Divergence on 3D uniform data"); - vtkm::Vec ev(eg[1][2] - eg[2][1], eg[2][0] - eg[0][2], eg[0][1] - eg[1][0]); - vtkm::Vec v = extraOutput.Vorticity.GetPortalConstControl().Get(i); + vtkm::Vec3f_64 ev(eg[1][2] - eg[2][1], eg[2][0] - eg[0][2], eg[0][1] - eg[1][0]); + vtkm::Vec3f_64 v = extraOutput.Vorticity.GetPortalConstControl().Get(i); VTKM_TEST_ASSERT(test_equal(ev, v), "Wrong result for Vorticity on 3D uniform data"); } } @@ -213,13 +213,13 @@ void TestCellGradientExplicit() vtkm::cont::DataSet dataSet = testDataSet.Make3DExplicitDataSet0(); vtkm::cont::ArrayHandle input; - vtkm::cont::ArrayHandle> result; + vtkm::cont::ArrayHandle result; dataSet.GetField("pointvar").GetData().CopyTo(input); vtkm::worklet::CellGradient gradient; result = gradient.Run(dataSet.GetCellSet(), dataSet.GetCoordinateSystem(), input); - vtkm::Vec expected[2] = { { 10.f, 10.1f, 0.0f }, { 10.f, 10.1f, -0.0f } }; + vtkm::Vec3f_32 expected[2] = { { 10.f, 10.1f, 0.0f }, { 10.f, 10.1f, -0.0f } }; for (int i = 0; i < 2; ++i) { VTKM_TEST_ASSERT(test_equal(result.GetPortalConstControl().Get(i), expected[i]), diff --git a/vtkm/worklet/testing/UnitTestCellSetConnectivity.cxx b/vtkm/worklet/testing/UnitTestCellSetConnectivity.cxx index 8b38b4dc5..4ad8ccec9 100644 --- a/vtkm/worklet/testing/UnitTestCellSetConnectivity.cxx +++ b/vtkm/worklet/testing/UnitTestCellSetConnectivity.cxx @@ -89,10 +89,10 @@ static vtkm::cont::DataSet MakeIsosurfaceTestDataSet(vtkm::Id3 dims) vtkm::cont::ArrayCopy(vtkm::cont::make_ArrayHandleCounting(0, 1, numCells), cellFieldArray); - vtkm::Vec origin(0.0f, 0.0f, 0.0f); - vtkm::Vec spacing(1.0f / static_cast(dims[0]), - 1.0f / static_cast(dims[2]), - 1.0f / static_cast(dims[1])); + vtkm::Vec3f origin(0.0f, 0.0f, 0.0f); + vtkm::Vec3f spacing(1.0f / static_cast(dims[0]), + 1.0f / static_cast(dims[2]), + 1.0f / static_cast(dims[1])); vtkm::cont::ArrayHandleUniformPointCoordinates coordinates(vdims, origin, spacing); dataSet.AddCoordinateSystem(vtkm::cont::CoordinateSystem("coordinates", coordinates)); diff --git a/vtkm/worklet/testing/UnitTestClipping.cxx b/vtkm/worklet/testing/UnitTestClipping.cxx index fe375e55e..cc56702ec 100644 --- a/vtkm/worklet/testing/UnitTestClipping.cxx +++ b/vtkm/worklet/testing/UnitTestClipping.cxx @@ -24,7 +24,7 @@ #include -using Coord3D = vtkm::Vec; +using Coord3D = vtkm::Vec3f; const vtkm::Float32 clipValue = 0.5; @@ -228,7 +228,7 @@ void TestClippingStructured() void TestClippingWithImplicitFunction() { - vtkm::Vec center(1, 1, 0); + vtkm::Vec3f center(1, 1, 0); vtkm::FloatDefault radius(0.5); vtkm::cont::DataSet ds = MakeTestDatasetStructured(); @@ -287,7 +287,7 @@ void TestClippingWithImplicitFunction() void TestClippingWithImplicitFunctionInverted() { - vtkm::Vec center(1, 1, 0); + vtkm::Vec3f center(1, 1, 0); vtkm::FloatDefault radius(0.5); vtkm::cont::DataSet ds = MakeTestDatasetStructured(); diff --git a/vtkm/worklet/testing/UnitTestCoordinateSystemTransform.cxx b/vtkm/worklet/testing/UnitTestCoordinateSystemTransform.cxx index cb882694f..33c026b16 100644 --- a/vtkm/worklet/testing/UnitTestCoordinateSystemTransform.cxx +++ b/vtkm/worklet/testing/UnitTestCoordinateSystemTransform.cxx @@ -32,7 +32,7 @@ vtkm::cont::DataSet MakeTestDataSet(const CoordinateType& cType) { vtkm::cont::DataSet dataSet; - std::vector> coordinates; + std::vector coordinates; const vtkm::Id dim = 5; if (cType == CART) { @@ -102,11 +102,10 @@ vtkm::cont::DataSet MakeTestDataSet(const CoordinateType& cType) return dataSet; } -void ValidateCoordTransform( - const vtkm::cont::CoordinateSystem& coords, - const vtkm::cont::ArrayHandle>& transform, - const vtkm::cont::ArrayHandle>& doubleTransform, - const std::vector& isAngle) +void ValidateCoordTransform(const vtkm::cont::CoordinateSystem& coords, + const vtkm::cont::ArrayHandle& transform, + const vtkm::cont::ArrayHandle& doubleTransform, + const std::vector& isAngle) { auto points = coords.GetData(); VTKM_TEST_ASSERT(points.GetNumberOfValues() == transform.GetNumberOfValues() && @@ -119,8 +118,8 @@ void ValidateCoordTransform( for (vtkm::Id i = 0; i < points.GetNumberOfValues(); i++) { - vtkm::Vec p = pointsPortal.Get(i); - vtkm::Vec r = resultsPortal.Get(i); + vtkm::Vec3f p = pointsPortal.Get(i); + vtkm::Vec3f r = resultsPortal.Get(i); bool isEqual = true; for (vtkm::IdComponent j = 0; j < 3; j++) { @@ -143,8 +142,8 @@ void TestCoordinateSystemTransform() vtkm::cont::DataSet dsCart = MakeTestDataSet(CART); vtkm::worklet::CylindricalCoordinateTransform cylTrn; - vtkm::cont::ArrayHandle> carToCylPts; - vtkm::cont::ArrayHandle> revResult; + vtkm::cont::ArrayHandle carToCylPts; + vtkm::cont::ArrayHandle revResult; cylTrn.SetCartesianToCylindrical(); cylTrn.Run(dsCart.GetCoordinateSystem(), carToCylPts); @@ -156,7 +155,7 @@ void TestCoordinateSystemTransform() //Test cylindrical to cartesian vtkm::cont::DataSet dsCyl = MakeTestDataSet(CYL); - vtkm::cont::ArrayHandle> cylToCarPts; + vtkm::cont::ArrayHandle cylToCarPts; cylTrn.SetCylindricalToCartesian(); cylTrn.Run(dsCyl.GetCoordinateSystem(), cylToCarPts); @@ -168,7 +167,7 @@ void TestCoordinateSystemTransform() //Spherical transform //Test cartesian to sph vtkm::worklet::SphericalCoordinateTransform sphTrn; - vtkm::cont::ArrayHandle> carToSphPts; + vtkm::cont::ArrayHandle carToSphPts; sphTrn.SetCartesianToSpherical(); sphTrn.Run(dsCart.GetCoordinateSystem(), carToSphPts); @@ -179,7 +178,7 @@ void TestCoordinateSystemTransform() dsCart.GetCoordinateSystem(), carToSphPts, revResult, { false, true, true }); //Test spherical to cartesian - vtkm::cont::ArrayHandle> sphToCarPts; + vtkm::cont::ArrayHandle sphToCarPts; vtkm::cont::DataSet dsSph = MakeTestDataSet(SPH); sphTrn.SetSphericalToCartesian(); diff --git a/vtkm/worklet/testing/UnitTestCosmoTools.cxx b/vtkm/worklet/testing/UnitTestCosmoTools.cxx index 5ce416036..6633b6895 100644 --- a/vtkm/worklet/testing/UnitTestCosmoTools.cxx +++ b/vtkm/worklet/testing/UnitTestCosmoTools.cxx @@ -58,7 +58,7 @@ vtkm::cont::DataSet MakeCosmo_2DDataSet_0() // Coordinates const int nVerts = 17; const int nCells = 17; - using CoordType = vtkm::Vec; + using CoordType = vtkm::Vec3f_32; std::vector coords(nVerts); coords[0] = CoordType(1, 1, 0); @@ -120,7 +120,7 @@ vtkm::cont::DataSet MakeCosmo_3DDataSet_0() // Coordinates const int nVerts = 14; const int nCells = 14; - using CoordType = vtkm::Vec; + using CoordType = vtkm::Vec3f_32; std::vector coords(nVerts); coords[0] = CoordType(20.8125f, 10.8864f, 0.309784f); diff --git a/vtkm/worklet/testing/UnitTestExternalFaces.cxx b/vtkm/worklet/testing/UnitTestExternalFaces.cxx index 6d9790844..d903a75e8 100644 --- a/vtkm/worklet/testing/UnitTestExternalFaces.cxx +++ b/vtkm/worklet/testing/UnitTestExternalFaces.cxx @@ -59,7 +59,7 @@ void TestExternalFaces1() //--------------Construct a VTK-m Test Dataset---------------- const int nVerts = 8; //A cube that is tetrahedralized - using CoordType = vtkm::Vec; + using CoordType = vtkm::Vec3f_32; vtkm::cont::ArrayHandle coordinates; coordinates.Allocate(nVerts); coordinates.GetPortalControl().Set(0, CoordType(0.0f, 0.0f, 0.0f)); diff --git a/vtkm/worklet/testing/UnitTestExtractGeometry.cxx b/vtkm/worklet/testing/UnitTestExtractGeometry.cxx index 272a4af4a..ae1612ae7 100644 --- a/vtkm/worklet/testing/UnitTestExtractGeometry.cxx +++ b/vtkm/worklet/testing/UnitTestExtractGeometry.cxx @@ -64,8 +64,8 @@ public: dataset.GetCellSet(0).CopyTo(cellSet); // Implicit function - vtkm::Vec minPoint(0.5f, 0.0f, 0.0f); - vtkm::Vec maxPoint(2.0f, 2.0f, 2.0f); + vtkm::Vec3f minPoint(0.5f, 0.0f, 0.0f); + vtkm::Vec3f maxPoint(2.0f, 2.0f, 2.0f); bool extractInside = true; bool extractBoundaryCells = false; @@ -172,8 +172,8 @@ public: dataset.GetCellSet(0).CopyTo(cellSet); // Implicit function - vtkm::Vec minPoint(1.0f, 1.0f, 1.0f); - vtkm::Vec maxPoint(3.0f, 3.0f, 3.0f); + vtkm::Vec3f minPoint(1.0f, 1.0f, 1.0f); + vtkm::Vec3f maxPoint(3.0f, 3.0f, 3.0f); bool extractInside = true; bool extractBoundaryCells = false; @@ -212,7 +212,7 @@ public: dataset.GetCellSet(0).CopyTo(cellSet); // Implicit function - vtkm::Vec center(2.f, 2.f, 2.f); + vtkm::Vec3f center(2.f, 2.f, 2.f); vtkm::FloatDefault radius(1.8f); bool extractInside = true; diff --git a/vtkm/worklet/testing/UnitTestExtractPoints.cxx b/vtkm/worklet/testing/UnitTestExtractPoints.cxx index 53c204e9d..bb3cdbf62 100644 --- a/vtkm/worklet/testing/UnitTestExtractPoints.cxx +++ b/vtkm/worklet/testing/UnitTestExtractPoints.cxx @@ -55,8 +55,8 @@ public: vtkm::cont::DataSet dataset = MakeTestDataSet().Make3DUniformDataSet1(); // Implicit function - vtkm::Vec minPoint(1.f, 1.f, 1.f); - vtkm::Vec maxPoint(3.f, 3.f, 3.f); + vtkm::Vec3f minPoint(1.f, 1.f, 1.f); + vtkm::Vec3f maxPoint(3.f, 3.f, 3.f); bool extractInside = true; // Output dataset contains input coordinate system and point data @@ -86,8 +86,8 @@ public: vtkm::cont::DataSet dataset = MakeTestDataSet().Make3DUniformDataSet1(); // Implicit function - vtkm::Vec minPoint(1.f, 1.f, 1.f); - vtkm::Vec maxPoint(3.f, 3.f, 3.f); + vtkm::Vec3f minPoint(1.f, 1.f, 1.f); + vtkm::Vec3f maxPoint(3.f, 3.f, 3.f); bool extractInside = false; // Output dataset contains input coordinate system and point data @@ -117,7 +117,7 @@ public: vtkm::cont::DataSet dataset = MakeTestDataSet().Make3DUniformDataSet1(); // Implicit function - vtkm::Vec center(2.f, 2.f, 2.f); + vtkm::Vec3f center(2.f, 2.f, 2.f); vtkm::FloatDefault radius(1.8f); bool extractInside = true; @@ -148,8 +148,8 @@ public: vtkm::cont::DataSet dataset = MakeTestDataSet().Make3DExplicitDataSet5(); // Implicit function - vtkm::Vec minPoint(0.f, 0.f, 0.f); - vtkm::Vec maxPoint(1.f, 1.f, 1.f); + vtkm::Vec3f minPoint(0.f, 0.f, 0.f); + vtkm::Vec3f maxPoint(1.f, 1.f, 1.f); bool extractInside = true; // Output dataset contains input coordinate system and point data @@ -179,8 +179,8 @@ public: vtkm::cont::DataSet dataset = MakeTestDataSet().Make3DExplicitDataSet5(); // Implicit function - vtkm::Vec minPoint(0.f, 0.f, 0.f); - vtkm::Vec maxPoint(1.f, 1.f, 1.f); + vtkm::Vec3f minPoint(0.f, 0.f, 0.f); + vtkm::Vec3f maxPoint(1.f, 1.f, 1.f); bool extractInside = false; // Output dataset contains input coordinate system and point data diff --git a/vtkm/worklet/testing/UnitTestKdTreeBuildNNS.cxx b/vtkm/worklet/testing/UnitTestKdTreeBuildNNS.cxx index 8b27d219e..2230b9235 100644 --- a/vtkm/worklet/testing/UnitTestKdTreeBuildNNS.cxx +++ b/vtkm/worklet/testing/UnitTestKdTreeBuildNNS.cxx @@ -70,7 +70,7 @@ void TestKdTreeBuildNNS(vtkm::cont::DeviceAdapterId deviceId) vtkm::Int32 nTrainingPoints = 1000; vtkm::Int32 nTestingPoint = 1000; - std::vector> coordi; + std::vector coordi; ///// randomly generate training points///// std::default_random_engine dre; @@ -90,7 +90,7 @@ void TestKdTreeBuildNNS(vtkm::cont::DeviceAdapterId deviceId) //Nearest Neighbor worklet Testing /// randomly generate testing points ///// - std::vector> qcVec; + std::vector qcVec; for (vtkm::Int32 i = 0; i < nTestingPoint; i++) { qcVec.push_back(vtkm::make_Vec(dr(dre), dr(dre), dr(dre))); diff --git a/vtkm/worklet/testing/UnitTestMagnitude.cxx b/vtkm/worklet/testing/UnitTestMagnitude.cxx index 45e107bf1..524f6fb1a 100644 --- a/vtkm/worklet/testing/UnitTestMagnitude.cxx +++ b/vtkm/worklet/testing/UnitTestMagnitude.cxx @@ -23,7 +23,7 @@ void TestMagnitude() vtkm::worklet::Magnitude magnitudeWorklet; using ArrayReturnType = vtkm::cont::ArrayHandle; - using ArrayVectorType = vtkm::cont::ArrayHandle>; + using ArrayVectorType = vtkm::cont::ArrayHandle; using PortalType = ArrayVectorType::PortalControl; ArrayVectorType pythagoreanTriples; diff --git a/vtkm/worklet/testing/UnitTestMarchingCubes.cxx b/vtkm/worklet/testing/UnitTestMarchingCubes.cxx index 2e2a7e757..1b6a70db6 100644 --- a/vtkm/worklet/testing/UnitTestMarchingCubes.cxx +++ b/vtkm/worklet/testing/UnitTestMarchingCubes.cxx @@ -94,10 +94,10 @@ vtkm::cont::DataSet MakeIsosurfaceTestDataSet(vtkm::Id3 dims) vtkm::cont::ArrayCopy(vtkm::cont::make_ArrayHandleCounting(0, 1, numCells), cellFieldArray); - vtkm::Vec origin(0.0f, 0.0f, 0.0f); - vtkm::Vec spacing(1.0f / static_cast(dims[0]), - 1.0f / static_cast(dims[2]), - 1.0f / static_cast(dims[1])); + vtkm::Vec3f origin(0.0f, 0.0f, 0.0f); + vtkm::Vec3f spacing(1.0f / static_cast(dims[0]), + 1.0f / static_cast(dims[2]), + 1.0f / static_cast(dims[1])); vtkm::cont::ArrayHandleUniformPointCoordinates coordinates(vdims, origin, spacing); dataSet.AddCoordinateSystem(vtkm::cont::CoordinateSystem("coordinates", coordinates)); @@ -124,21 +124,21 @@ public: { } VTKM_EXEC_CONT - EuclideanNorm(vtkm::Vec reference) + EuclideanNorm(vtkm::Vec3f_32 reference) : Reference(reference) { } VTKM_EXEC_CONT - vtkm::Float32 operator()(vtkm::Vec v) const + vtkm::Float32 operator()(vtkm::Vec3f_32 v) const { - vtkm::Vec d( + vtkm::Vec3f_32 d( v[0] - this->Reference[0], v[1] - this->Reference[1], v[2] - this->Reference[2]); return vtkm::Magnitude(d); } private: - vtkm::Vec Reference; + vtkm::Vec3f_32 Reference; }; class CubeGridConnectivity @@ -232,7 +232,7 @@ inline vtkm::cont::DataSet MakeRadiantDataSet::Make3DRadiantDataSet(vtkm::IdComp using HexTag = vtkm::CellShapeTagHexahedron; using HexTraits = vtkm::CellTraits; - using CoordType = vtkm::Vec; + using CoordType = vtkm::Vec3f_32; const vtkm::IdComponent nCells = dim * dim * dim; @@ -292,8 +292,8 @@ void TestMarchingCubesUniformGrid() isosurfaceFilter.SetMergeDuplicatePoints(false); vtkm::Float32 contourValue = 0.5f; - vtkm::cont::ArrayHandle> verticesArray; - vtkm::cont::ArrayHandle> normalsArray; + vtkm::cont::ArrayHandle verticesArray; + vtkm::cont::ArrayHandle normalsArray; vtkm::cont::ArrayHandle scalarsArray; auto result = isosurfaceFilter.Run(&contourValue, @@ -334,7 +334,7 @@ void TestMarchingCubesExplicit() std::cout << "Testing MarchingCubes worklet on explicit data" << std::endl; using DataSetGenerator = vtkm_ut_mc_worklet::MakeRadiantDataSet; - using Vec3Handle = vtkm::cont::ArrayHandle>; + using Vec3Handle = vtkm::cont::ArrayHandle; using DataHandle = vtkm::cont::ArrayHandle; DataSetGenerator dataSetGenerator; diff --git a/vtkm/worklet/testing/UnitTestParticleAdvection.cxx b/vtkm/worklet/testing/UnitTestParticleAdvection.cxx index 924a83e15..38ebb9394 100644 --- a/vtkm/worklet/testing/UnitTestParticleAdvection.cxx +++ b/vtkm/worklet/testing/UnitTestParticleAdvection.cxx @@ -474,7 +474,7 @@ void TestParticleWorklets() const vtkm::Id3 dims(5, 5, 5); vtkm::Id nElements = dims[0] * dims[1] * dims[2] * 3; - std::vector> field; + std::vector field; for (vtkm::Id i = 0; i < nElements; i++) { ScalarType x = vecData[i]; diff --git a/vtkm/worklet/testing/UnitTestPointElevation.cxx b/vtkm/worklet/testing/UnitTestPointElevation.cxx index f8389e11b..60c599fea 100644 --- a/vtkm/worklet/testing/UnitTestPointElevation.cxx +++ b/vtkm/worklet/testing/UnitTestPointElevation.cxx @@ -25,7 +25,7 @@ vtkm::cont::DataSet MakePointElevationTestDataSet() { vtkm::cont::DataSet dataSet; - std::vector> coordinates; + std::vector coordinates; const vtkm::Id dim = 5; for (vtkm::Id j = 0; j < dim; ++j) { diff --git a/vtkm/worklet/testing/UnitTestPointGradient.cxx b/vtkm/worklet/testing/UnitTestPointGradient.cxx index 80be1167a..88be96ed2 100644 --- a/vtkm/worklet/testing/UnitTestPointGradient.cxx +++ b/vtkm/worklet/testing/UnitTestPointGradient.cxx @@ -30,7 +30,7 @@ void TestPointGradientUniform2D() vtkm::worklet::PointGradient gradient; auto result = gradient.Run(dataSet.GetCellSet(), dataSet.GetCoordinateSystem(), fieldArray); - vtkm::Vec expected[2] = { { 10, 30, 0 }, { 10, 30, 0 } }; + vtkm::Vec3f_32 expected[2] = { { 10, 30, 0 }, { 10, 30, 0 } }; for (int i = 0; i < 2; ++i) { VTKM_TEST_ASSERT(test_equal(result.GetPortalConstControl().Get(i), expected[i]), @@ -51,7 +51,7 @@ void TestPointGradientUniform3D() vtkm::worklet::PointGradient gradient; auto result = gradient.Run(dataSet.GetCellSet(), dataSet.GetCoordinateSystem(), fieldArray); - vtkm::Vec expected[4] = { + vtkm::Vec3f_32 expected[4] = { { 10.0f, 30.f, 60.1f }, { 10.0f, 30.1f, 60.1f }, { 10.0f, 30.1f, 60.2f }, @@ -75,18 +75,18 @@ void TestPointGradientUniform3DWithVectorField() const int nVerts = 18; vtkm::Float64 vars[nVerts] = { 10.1, 20.1, 30.1, 40.1, 50.2, 60.2, 70.2, 80.2, 90.3, 100.3, 110.3, 120.3, 130.4, 140.4, 150.4, 160.4, 170.5, 180.5 }; - std::vector> vec(18); + std::vector vec(18); for (std::size_t i = 0; i < vec.size(); ++i) { vec[i] = vtkm::make_Vec(vars[i], vars[i], vars[i]); } - vtkm::cont::ArrayHandle> input = vtkm::cont::make_ArrayHandle(vec); + vtkm::cont::ArrayHandle input = vtkm::cont::make_ArrayHandle(vec); vtkm::worklet::PointGradient gradient; auto result = gradient.Run(dataSet.GetCellSet(), dataSet.GetCoordinateSystem(), input); - vtkm::Vec, 3> expected[4] = { + vtkm::Vec expected[4] = { { { 10.0, 10.0, 10.0 }, { 30.0, 30.0, 30.0 }, { 60.1, 60.1, 60.1 } }, { { 10.0, 10.0, 10.0 }, { 30.1, 30.1, 30.1 }, { 60.1, 60.1, 60.1 } }, { { 10.0, 10.0, 10.0 }, { 30.1, 30.1, 30.1 }, { 60.2, 60.2, 60.2 } }, @@ -94,8 +94,8 @@ void TestPointGradientUniform3DWithVectorField() }; for (int i = 0; i < 4; ++i) { - vtkm::Vec, 3> e = expected[i]; - vtkm::Vec, 3> r = result.GetPortalConstControl().Get(i); + vtkm::Vec e = expected[i]; + vtkm::Vec r = result.GetPortalConstControl().Get(i); VTKM_TEST_ASSERT(test_equal(e[0], r[0]), "Wrong result for vec field PointGradient worklet on 3D uniform data"); @@ -119,14 +119,14 @@ void TestPointGradientUniform3DWithVectorField2() const int nVerts = 18; vtkm::Float64 vars[nVerts] = { 10.1, 20.1, 30.1, 40.1, 50.2, 60.2, 70.2, 80.2, 90.3, 100.3, 110.3, 120.3, 130.4, 140.4, 150.4, 160.4, 170.5, 180.5 }; - std::vector> vec(18); + std::vector vec(18); for (std::size_t i = 0; i < vec.size(); ++i) { vec[i] = vtkm::make_Vec(vars[i], vars[i], vars[i]); } - vtkm::cont::ArrayHandle> input = vtkm::cont::make_ArrayHandle(vec); + vtkm::cont::ArrayHandle input = vtkm::cont::make_ArrayHandle(vec); - vtkm::worklet::GradientOutputFields> extraOutput; + vtkm::worklet::GradientOutputFields extraOutput; extraOutput.SetComputeGradient(false); extraOutput.SetComputeDivergence(true); extraOutput.SetComputeVorticity(true); @@ -148,7 +148,7 @@ void TestPointGradientUniform3DWithVectorField2() VTKM_TEST_ASSERT((extraOutput.QCriterion.GetNumberOfValues() == nVerts), "QCriterion field should be generated"); - vtkm::Vec, 3> expected_gradients[4] = { + vtkm::Vec expected_gradients[4] = { { { 10.0, 10.0, 10.0 }, { 30.0, 30.0, 30.0 }, { 60.1, 60.1, 60.1 } }, { { 10.0, 10.0, 10.0 }, { 30.1, 30.1, 30.1 }, { 60.1, 60.1, 60.1 } }, { { 10.0, 10.0, 10.0 }, { 30.1, 30.1, 30.1 }, { 60.2, 60.2, 60.2 } }, @@ -156,20 +156,19 @@ void TestPointGradientUniform3DWithVectorField2() }; for (int i = 0; i < 4; ++i) { - vtkm::Vec, 3> eg = expected_gradients[i]; + vtkm::Vec eg = expected_gradients[i]; vtkm::Float64 d = extraOutput.Divergence.GetPortalConstControl().Get(i); VTKM_TEST_ASSERT(test_equal((eg[0][0] + eg[1][1] + eg[2][2]), d), "Wrong result for Divergence on 3D uniform data"); - vtkm::Vec ev(eg[1][2] - eg[2][1], eg[2][0] - eg[0][2], eg[0][1] - eg[1][0]); - vtkm::Vec v = extraOutput.Vorticity.GetPortalConstControl().Get(i); + vtkm::Vec3f_64 ev(eg[1][2] - eg[2][1], eg[2][0] - eg[0][2], eg[0][1] - eg[1][0]); + vtkm::Vec3f_64 v = extraOutput.Vorticity.GetPortalConstControl().Get(i); VTKM_TEST_ASSERT(test_equal(ev, v), "Wrong result for Vorticity on 3D uniform data"); - const vtkm::Vec es( - eg[1][2] + eg[2][1], eg[2][0] + eg[0][2], eg[0][1] + eg[1][0]); - const vtkm::Vec ed(eg[0][0], eg[1][1], eg[2][2]); + const vtkm::Vec3f_64 es(eg[1][2] + eg[2][1], eg[2][0] + eg[0][2], eg[0][1] + eg[1][0]); + const vtkm::Vec3f_64 ed(eg[0][0], eg[1][1], eg[2][2]); //compute QCriterion vtkm::Float64 qcriterion = @@ -196,7 +195,7 @@ void TestPointGradientExplicit() vtkm::worklet::PointGradient gradient; auto result = gradient.Run(dataSet.GetCellSet(), dataSet.GetCoordinateSystem(), fieldArray); - vtkm::Vec expected[2] = { { 10.f, 10.1f, 0.0f }, { 10.f, 10.1f, 0.0f } }; + vtkm::Vec3f_32 expected[2] = { { 10.f, 10.1f, 0.0f }, { 10.f, 10.1f, 0.0f } }; for (int i = 0; i < 2; ++i) { VTKM_TEST_ASSERT(test_equal(result.GetPortalConstControl().Get(i), expected[i]), diff --git a/vtkm/worklet/testing/UnitTestPointTransform.cxx b/vtkm/worklet/testing/UnitTestPointTransform.cxx index 804472ed3..e14d96e18 100644 --- a/vtkm/worklet/testing/UnitTestPointTransform.cxx +++ b/vtkm/worklet/testing/UnitTestPointTransform.cxx @@ -25,7 +25,7 @@ vtkm::cont::DataSet MakePointTransformTestDataSet() { vtkm::cont::DataSet dataSet; - std::vector> coordinates; + std::vector coordinates; const vtkm::Id dim = 5; for (vtkm::Id j = 0; j < dim; ++j) { @@ -63,7 +63,7 @@ vtkm::cont::DataSet MakePointTransformTestDataSet() } void ValidatePointTransform(const vtkm::cont::CoordinateSystem& coords, - const vtkm::cont::ArrayHandle>& result, + const vtkm::cont::ArrayHandle& result, const vtkm::Matrix& matrix) { auto points = coords.GetData(); @@ -80,10 +80,9 @@ void ValidatePointTransform(const vtkm::cont::CoordinateSystem& coords, } -void TestPointTransformTranslation(const vtkm::cont::DataSet& ds, - const vtkm::Vec& trans) +void TestPointTransformTranslation(const vtkm::cont::DataSet& ds, const vtkm::Vec3f& trans) { - vtkm::cont::ArrayHandle> result; + vtkm::cont::ArrayHandle result; vtkm::worklet::PointTransform worklet; worklet.SetTranslation(trans); @@ -94,10 +93,9 @@ void TestPointTransformTranslation(const vtkm::cont::DataSet& ds, ValidatePointTransform(ds.GetCoordinateSystem(), result, Transform3DTranslate(trans)); } -void TestPointTransformScale(const vtkm::cont::DataSet& ds, - const vtkm::Vec& scale) +void TestPointTransformScale(const vtkm::cont::DataSet& ds, const vtkm::Vec3f& scale) { - vtkm::cont::ArrayHandle> result; + vtkm::cont::ArrayHandle result; vtkm::worklet::PointTransform worklet; worklet.SetScale(scale); @@ -110,9 +108,9 @@ void TestPointTransformScale(const vtkm::cont::DataSet& ds, void TestPointTransformRotation(const vtkm::cont::DataSet& ds, const vtkm::FloatDefault& angle, - const vtkm::Vec& axis) + const vtkm::Vec3f& axis) { - vtkm::cont::ArrayHandle> result; + vtkm::cont::ArrayHandle result; vtkm::worklet::PointTransform worklet; worklet.SetRotation(angle, axis); @@ -132,31 +130,29 @@ void TestPointTransform() int N = 41; //Test translation - TestPointTransformTranslation(ds, vtkm::Vec(0, 0, 0)); - TestPointTransformTranslation(ds, vtkm::Vec(1, 1, 1)); - TestPointTransformTranslation(ds, vtkm::Vec(-1, -1, -1)); + TestPointTransformTranslation(ds, vtkm::Vec3f(0, 0, 0)); + TestPointTransformTranslation(ds, vtkm::Vec3f(1, 1, 1)); + TestPointTransformTranslation(ds, vtkm::Vec3f(-1, -1, -1)); std::uniform_real_distribution transDist(-100, 100); for (int i = 0; i < N; i++) - TestPointTransformTranslation(ds, - vtkm::Vec(transDist(randGenerator), - transDist(randGenerator), - transDist(randGenerator))); + TestPointTransformTranslation( + ds, + vtkm::Vec3f(transDist(randGenerator), transDist(randGenerator), transDist(randGenerator))); //Test scaling - TestPointTransformScale(ds, vtkm::Vec(1, 1, 1)); - TestPointTransformScale(ds, vtkm::Vec(.23f, .23f, .23f)); - TestPointTransformScale(ds, vtkm::Vec(1, 2, 3)); - TestPointTransformScale(ds, vtkm::Vec(3.23f, 9.23f, 4.23f)); + TestPointTransformScale(ds, vtkm::Vec3f(1, 1, 1)); + TestPointTransformScale(ds, vtkm::Vec3f(.23f, .23f, .23f)); + TestPointTransformScale(ds, vtkm::Vec3f(1, 2, 3)); + TestPointTransformScale(ds, vtkm::Vec3f(3.23f, 9.23f, 4.23f)); std::uniform_real_distribution scaleDist(0.0001f, 100); for (int i = 0; i < N; i++) { - TestPointTransformScale(ds, vtkm::Vec(scaleDist(randGenerator))); - TestPointTransformScale(ds, - vtkm::Vec(scaleDist(randGenerator), - scaleDist(randGenerator), - scaleDist(randGenerator))); + TestPointTransformScale(ds, vtkm::Vec3f(scaleDist(randGenerator))); + TestPointTransformScale( + ds, + vtkm::Vec3f(scaleDist(randGenerator), scaleDist(randGenerator), scaleDist(randGenerator))); } //Test rotation @@ -165,11 +161,11 @@ void TestPointTransform() for (int i = 0; i < N; i++) angles.push_back(angleDist(randGenerator)); - std::vector> axes; - axes.push_back(vtkm::Vec(1, 0, 0)); - axes.push_back(vtkm::Vec(0, 1, 0)); - axes.push_back(vtkm::Vec(0, 0, 1)); - axes.push_back(vtkm::Vec(1, 1, 1)); + std::vector axes; + axes.push_back(vtkm::Vec3f(1, 0, 0)); + axes.push_back(vtkm::Vec3f(0, 1, 0)); + axes.push_back(vtkm::Vec3f(0, 0, 1)); + axes.push_back(vtkm::Vec3f(1, 1, 1)); axes.push_back(-axes[0]); axes.push_back(-axes[1]); axes.push_back(-axes[2]); @@ -177,8 +173,8 @@ void TestPointTransform() std::uniform_real_distribution axisDist(-1, 1); for (int i = 0; i < N; i++) - axes.push_back(vtkm::Vec( - axisDist(randGenerator), axisDist(randGenerator), axisDist(randGenerator))); + axes.push_back( + vtkm::Vec3f(axisDist(randGenerator), axisDist(randGenerator), axisDist(randGenerator))); for (std::size_t i = 0; i < angles.size(); i++) for (std::size_t j = 0; j < axes.size(); j++) diff --git a/vtkm/worklet/testing/UnitTestProbe.cxx b/vtkm/worklet/testing/UnitTestProbe.cxx index 03d4d09d0..5967430c2 100644 --- a/vtkm/worklet/testing/UnitTestProbe.cxx +++ b/vtkm/worklet/testing/UnitTestProbe.cxx @@ -46,7 +46,7 @@ vtkm::cont::DataSet ConvertDataSetUniformToExplicit(const vtkm::cont::DataSet& u vtkm::worklet::CellDeepCopy::Run(uds.GetCellSet(), cs); eds.AddCellSet(cs); - vtkm::cont::ArrayHandle> points; + vtkm::cont::ArrayHandle points; vtkm::cont::ArrayCopy(uds.GetCoordinateSystem().GetData(), points); eds.AddCoordinateSystem( vtkm::cont::CoordinateSystem(uds.GetCoordinateSystem().GetName(), points)); diff --git a/vtkm/worklet/testing/UnitTestRemoveUnusedPoints.cxx b/vtkm/worklet/testing/UnitTestRemoveUnusedPoints.cxx index 2298ba070..5c6fb5123 100644 --- a/vtkm/worklet/testing/UnitTestRemoveUnusedPoints.cxx +++ b/vtkm/worklet/testing/UnitTestRemoveUnusedPoints.cxx @@ -37,13 +37,13 @@ void CheckOutputCellSet(const vtkm::cont::CellSetExplicit<>& cellSet, VTKM_TEST_ASSERT(cellSet.GetNumberOfPointsInCell(0) == 3, "Wrong num points"); VTKM_TEST_ASSERT(cellSet.GetNumberOfPointsInCell(1) == 4, "Wrong num points"); - vtkm::Vec pointIds3; + vtkm::Id3 pointIds3; cellSet.GetIndices(0, pointIds3); VTKM_TEST_ASSERT(pointIds3[0] == 0, "Wrong point id for cell"); VTKM_TEST_ASSERT(pointIds3[1] == 1, "Wrong point id for cell"); VTKM_TEST_ASSERT(pointIds3[2] == 2, "Wrong point id for cell"); - vtkm::Vec pointIds4; + vtkm::Id4 pointIds4; cellSet.GetIndices(1, pointIds4); VTKM_TEST_ASSERT(pointIds4[0] == 2, "Wrong point id for cell"); VTKM_TEST_ASSERT(pointIds4[1] == 1, "Wrong point id for cell"); diff --git a/vtkm/worklet/testing/UnitTestScalarsToColors.cxx b/vtkm/worklet/testing/UnitTestScalarsToColors.cxx index 520b382d9..af0ab9545 100644 --- a/vtkm/worklet/testing/UnitTestScalarsToColors.cxx +++ b/vtkm/worklet/testing/UnitTestScalarsToColors.cxx @@ -17,7 +17,7 @@ namespace // data we want are valid values between 0 and 1 that represent the fraction // of the range we want to map into. std::vector test_values = { 0.0f, 0.125f, 0.25f, 0.5f, 0.625, 0.75f, 1.0f }; -std::vector> rgb_result = { +std::vector rgb_result = { { 0, 0, 0 }, { 32, 32, 32 }, { 64, 64, 64 }, { 128, 128, 128 }, { 159, 159, 159 }, { 191, 191, 191 }, { 255, 255, 255 }, }; @@ -35,49 +35,45 @@ vtkm::UInt8 as_color(vtkm::Float32 v, vtkm::Float32) } template <> -vtkm::Vec as_color>(vtkm::Float32 v, - vtkm::Float32 alpha) +vtkm::Vec2f_32 as_color(vtkm::Float32 v, vtkm::Float32 alpha) { //generate luminance+alpha values - return vtkm::Vec(v, alpha); + return vtkm::Vec2f_32(v, alpha); } template <> -vtkm::Vec as_color>(vtkm::Float32 v, - vtkm::Float32 alpha) +vtkm::Vec2f_64 as_color(vtkm::Float32 v, vtkm::Float32 alpha) { //generate luminance+alpha values - return vtkm::Vec(v, alpha); + return vtkm::Vec2f_64(v, alpha); } template <> -vtkm::Vec as_color>(vtkm::Float32 v, vtkm::Float32 alpha) +vtkm::Vec2ui_8 as_color(vtkm::Float32 v, vtkm::Float32 alpha) { //generate luminance+alpha values - return vtkm::Vec(static_cast(v * 255.0f + 0.5f), - static_cast(alpha * 255.0f + 0.5f)); + return vtkm::Vec2ui_8(static_cast(v * 255.0f + 0.5f), + static_cast(alpha * 255.0f + 0.5f)); } template <> -vtkm::Vec as_color>(vtkm::Float32 v, vtkm::Float32) +vtkm::Vec3ui_8 as_color(vtkm::Float32 v, vtkm::Float32) { //vec 3 are always rgb - return vtkm::Vec(static_cast(v * 255.0f + 0.5f)); + return vtkm::Vec3ui_8(static_cast(v * 255.0f + 0.5f)); } template <> -vtkm::Vec as_color>(vtkm::Float32 v, - vtkm::Float32 alpha) +vtkm::Vec4f_32 as_color(vtkm::Float32 v, vtkm::Float32 alpha) { //generate rgba - return vtkm::Vec(v, v, v, alpha); + return vtkm::Vec4f_32(v, v, v, alpha); } template <> -vtkm::Vec as_color>(vtkm::Float32 v, - vtkm::Float32 alpha) +vtkm::Vec4f_64 as_color(vtkm::Float32 v, vtkm::Float32 alpha) { //generate rgba - return vtkm::Vec(v, v, v, alpha); + return vtkm::Vec4f_64(v, v, v, alpha); } template <> -vtkm::Vec as_color>(vtkm::Float32 v, vtkm::Float32 alpha) +vtkm::Vec4ui_8 as_color(vtkm::Float32 v, vtkm::Float32 alpha) { //generate rgba - return vtkm::Vec(static_cast(v * 255.0f + 0.5f), - static_cast(v * 255.0f + 0.5f), - static_cast(v * 255.0f + 0.5f), - static_cast(alpha * 255.0f + 0.5f)); + return vtkm::Vec4ui_8(static_cast(v * 255.0f + 0.5f), + static_cast(v * 255.0f + 0.5f), + static_cast(v * 255.0f + 0.5f), + static_cast(alpha * 255.0f + 0.5f)); } @@ -121,7 +117,7 @@ vtkm::cont::ArrayHandle make_data(const vtkm::Range& r) return handle; } -bool verify(vtkm::cont::ArrayHandle> output) +bool verify(vtkm::cont::ArrayHandle output) { auto portal = output.GetPortalConstControl(); vtkm::Id index = 0; @@ -141,7 +137,7 @@ bool verify(vtkm::cont::ArrayHandle> output) return valid; } -bool verify(vtkm::Float32 alpha, vtkm::cont::ArrayHandle> output) +bool verify(vtkm::Float32 alpha, vtkm::cont::ArrayHandle output) { const vtkm::UInt8 a = vtkm::worklet::colorconversion::ColorToUChar(alpha); auto portal = output.GetPortalConstControl(); @@ -186,7 +182,7 @@ struct TestToRGB VTKM_CONT void operator()(T) const { //use each component to generate the output - vtkm::cont::ArrayHandle> output; + vtkm::cont::ArrayHandle output; this->Worklet.Run(make_data(this->Worklet.GetRange()), output); bool valid = verify(output); VTKM_TEST_ASSERT(valid, "scalar RGB failed"); @@ -199,7 +195,7 @@ struct TestToRGB using T = vtkm::Vec; auto input = make_data(this->Worklet.GetRange()); - vtkm::cont::ArrayHandle> output; + vtkm::cont::ArrayHandle output; //use all components to generate the output this->Worklet.Run(input, output); @@ -270,7 +266,7 @@ struct TestToRGBA VTKM_CONT void operator()(T) const { //use each component to generate the output - vtkm::cont::ArrayHandle> output; + vtkm::cont::ArrayHandle output; this->Worklet.Run(make_data(this->Worklet.GetRange()), output); bool valid = verify(this->Worklet.GetAlpha(), output); @@ -282,7 +278,7 @@ struct TestToRGBA { bool valid = false; using T = vtkm::Vec; - vtkm::cont::ArrayHandle> output; + vtkm::cont::ArrayHandle output; auto input = make_data(this->Worklet.GetRange()); // vtkm::cont::printSummary_ArrayHandle(input, std::cout, true); @@ -345,19 +341,17 @@ struct TestToRGBA struct TypeListTagScalarColorTypes : vtkm::ListTagBase, - vtkm::Vec, - vtkm::Vec, - vtkm::Vec, - vtkm::Vec, - vtkm::Vec> + vtkm::Vec2f_32, + vtkm::Vec2f_64, + vtkm::Vec3f_32, + vtkm::Vec3f_64, + vtkm::Vec4f_32, + vtkm::Vec4f_64> { }; -struct TypeListTagUIntColorTypes : vtkm::ListTagBase, - vtkm::Vec, - vtkm::Vec> +struct TypeListTagUIntColorTypes + : vtkm::ListTagBase { }; diff --git a/vtkm/worklet/testing/UnitTestSplatKernels.cxx b/vtkm/worklet/testing/UnitTestSplatKernels.cxx index 9bcc57c89..c135516f0 100644 --- a/vtkm/worklet/testing/UnitTestSplatKernels.cxx +++ b/vtkm/worklet/testing/UnitTestSplatKernels.cxx @@ -15,7 +15,7 @@ #include -using Vector = vtkm::Vec; +using Vector = vtkm::Vec3f_64; // Simpson integradion rule double SimpsonIntegration(const std::vector& y, const std::vector& x) diff --git a/vtkm/worklet/testing/UnitTestSplitSharpEdges.cxx b/vtkm/worklet/testing/UnitTestSplitSharpEdges.cxx index cdfb9588c..46cee6859 100644 --- a/vtkm/worklet/testing/UnitTestSplitSharpEdges.cxx +++ b/vtkm/worklet/testing/UnitTestSplitSharpEdges.cxx @@ -17,9 +17,9 @@ namespace { -using NormalsArrayHandle = vtkm::cont::ArrayHandle>; +using NormalsArrayHandle = vtkm::cont::ArrayHandle; -const vtkm::Vec expectedCoords[24] = { +const vtkm::Vec3f expectedCoords[24] = { { 0.0, 0.0, 0.0 }, { 1.0, 0.0, 0.0 }, { 1.0, 0.0, 1.0 }, { 0.0, 0.0, 1.0 }, { 0.0, 1.0, 0.0 }, { 1.0, 1.0, 0.0 }, { 1.0, 1.0, 1.0 }, { 0.0, 1.0, 1.0 }, { 0.0, 0.0, 0.0 }, { 0.0, 0.0, 0.0 }, { 1.0, 0.0, 0.0 }, { 1.0, 0.0, 0.0 }, { 1.0, 0.0, 1.0 }, { 1.0, 0.0, 1.0 }, { 0.0, 0.0, 1.0 }, @@ -42,7 +42,7 @@ vtkm::cont::DataSet Make3DExplicitSimpleCube() const int nVerts = 8; const int nCells = 6; - using CoordType = vtkm::Vec; + using CoordType = vtkm::Vec3f; std::vector coords = { CoordType(0, 0, 0), // 0 CoordType(1, 0, 0), // 1 @@ -116,7 +116,7 @@ void TestSplitSharpEdgesSplitEveryEdge(vtkm::cont::DataSet& simpleCube, { // Split every edge vtkm::FloatDefault featureAngle = 89.0; - vtkm::cont::ArrayHandle> newCoords; + vtkm::cont::ArrayHandle newCoords; vtkm::cont::CellSetExplicit<> newCellset; splitSharpEdges.Run(simpleCube.GetCellSet(), @@ -161,7 +161,7 @@ void TestSplitSharpEdgesNoSplit(vtkm::cont::DataSet& simpleCube, { // Do nothing vtkm::FloatDefault featureAngle = 91.0; - vtkm::cont::ArrayHandle> newCoords; + vtkm::cont::ArrayHandle newCoords; vtkm::cont::CellSetExplicit<> newCellset; splitSharpEdges.Run(simpleCube.GetCellSet(), diff --git a/vtkm/worklet/testing/UnitTestStreamLineUniformGrid.cxx b/vtkm/worklet/testing/UnitTestStreamLineUniformGrid.cxx index 6b983ce57..2fab43e8e 100644 --- a/vtkm/worklet/testing/UnitTestStreamLineUniformGrid.cxx +++ b/vtkm/worklet/testing/UnitTestStreamLineUniformGrid.cxx @@ -114,16 +114,16 @@ void TestStreamLineUniformGrid() // Read vector data at each point of the uniform grid and store vtkm::Id nElements = vdims[0] * vdims[1] * vdims[2] * 3; - std::vector> field; + std::vector field; for (vtkm::Id i = 0; i < nElements; i++) { vtkm::Float32 x = data[i]; vtkm::Float32 y = data[++i]; vtkm::Float32 z = data[++i]; - vtkm::Vec vecData(x, y, z); + vtkm::Vec3f_32 vecData(x, y, z); field.push_back(Normalize(vecData)); } - vtkm::cont::ArrayHandle> fieldArray; + vtkm::cont::ArrayHandle fieldArray; fieldArray = vtkm::cont::make_ArrayHandle(&field[0], nElements); // Construct the input dataset (uniform) to hold the input and set vector data diff --git a/vtkm/worklet/testing/UnitTestStreamSurface.cxx b/vtkm/worklet/testing/UnitTestStreamSurface.cxx index f334ba002..c7afb8ea2 100644 --- a/vtkm/worklet/testing/UnitTestStreamSurface.cxx +++ b/vtkm/worklet/testing/UnitTestStreamSurface.cxx @@ -17,7 +17,7 @@ namespace { void appendPts(vtkm::cont::DataSetBuilderExplicitIterative& dsb, - const vtkm::Vec& pt, + const vtkm::Vec3f& pt, std::vector& ids) { vtkm::Id pid = dsb.AddPoint(pt); @@ -26,7 +26,7 @@ void appendPts(vtkm::cont::DataSetBuilderExplicitIterative& dsb, void TestSameNumPolylines() { - using VecType = vtkm::Vec; + using VecType = vtkm::Vec3f; vtkm::cont::DataSetBuilderExplicitIterative dsb; std::vector ids; @@ -54,7 +54,7 @@ void TestSameNumPolylines() vtkm::cont::DataSet ds = dsb.Create(); vtkm::worklet::StreamSurface streamSurfaceWorklet; - vtkm::cont::ArrayHandle> newPoints; + vtkm::cont::ArrayHandle newPoints; vtkm::cont::CellSetSingleType<> newCells; streamSurfaceWorklet.Run(ds.GetCoordinateSystem(0), ds.GetCellSet(0), newPoints, newCells); @@ -73,7 +73,7 @@ void TestSameNumPolylines() void TestUnequalNumPolylines(int unequalType) { - using VecType = vtkm::Vec; + using VecType = vtkm::Vec3f; vtkm::cont::DataSetBuilderExplicitIterative dsb; std::vector ids; @@ -119,7 +119,7 @@ void TestUnequalNumPolylines(int unequalType) vtkm::cont::DataSet ds = dsb.Create(); vtkm::worklet::StreamSurface streamSurfaceWorklet; - vtkm::cont::ArrayHandle> newPoints; + vtkm::cont::ArrayHandle newPoints; vtkm::cont::CellSetSingleType<> newCells; streamSurfaceWorklet.Run(ds.GetCoordinateSystem(0), ds.GetCellSet(0), newPoints, newCells); diff --git a/vtkm/worklet/testing/UnitTestSurfaceNormals.cxx b/vtkm/worklet/testing/UnitTestSurfaceNormals.cxx index c5571e7b2..a7997d0f5 100644 --- a/vtkm/worklet/testing/UnitTestSurfaceNormals.cxx +++ b/vtkm/worklet/testing/UnitTestSurfaceNormals.cxx @@ -16,7 +16,7 @@ namespace { -using NormalsArrayHandle = vtkm::cont::ArrayHandle>; +using NormalsArrayHandle = vtkm::cont::ArrayHandle; void TestFacetedSurfaceNormals(const vtkm::cont::DataSet& dataset, NormalsArrayHandle& normals) { @@ -25,11 +25,10 @@ void TestFacetedSurfaceNormals(const vtkm::cont::DataSet& dataset, NormalsArrayH vtkm::worklet::FacetedSurfaceNormals faceted; faceted.Run(dataset.GetCellSet(), dataset.GetCoordinateSystem().GetData(), normals); - vtkm::Vec expected[8] = { - { -0.707f, -0.500f, 0.500f }, { -0.707f, -0.500f, 0.500f }, { 0.707f, 0.500f, -0.500f }, - { 0.000f, -0.707f, -0.707f }, { 0.000f, -0.707f, -0.707f }, { 0.000f, 0.707f, 0.707f }, - { -0.707f, 0.500f, -0.500f }, { 0.707f, -0.500f, 0.500f } - }; + vtkm::Vec3f expected[8] = { { -0.707f, -0.500f, 0.500f }, { -0.707f, -0.500f, 0.500f }, + { 0.707f, 0.500f, -0.500f }, { 0.000f, -0.707f, -0.707f }, + { 0.000f, -0.707f, -0.707f }, { 0.000f, 0.707f, 0.707f }, + { -0.707f, 0.500f, -0.500f }, { 0.707f, -0.500f, 0.500f } }; auto portal = normals.GetPortalConstControl(); VTKM_TEST_ASSERT(portal.GetNumberOfValues() == 8, "incorrect faceNormals array length"); for (vtkm::Id i = 0; i < 8; ++i) @@ -48,12 +47,10 @@ void TestSmoothSurfaceNormals(const vtkm::cont::DataSet& dataset, vtkm::worklet::SmoothSurfaceNormals smooth; smooth.Run(dataset.GetCellSet(), faceNormals, pointNormals); - vtkm::Vec expected[8] = { - { -0.8165f, -0.4082f, -0.4082f }, { -0.2357f, -0.9714f, 0.0286f }, - { 0.0000f, -0.1691f, 0.9856f }, { -0.8660f, 0.0846f, 0.4928f }, - { 0.0000f, -0.1691f, -0.9856f }, { 0.0000f, 0.9856f, -0.1691f }, - { 0.8165f, 0.4082f, 0.4082f }, { 0.8165f, -0.4082f, -0.4082f } - }; + vtkm::Vec3f expected[8] = { { -0.8165f, -0.4082f, -0.4082f }, { -0.2357f, -0.9714f, 0.0286f }, + { 0.0000f, -0.1691f, 0.9856f }, { -0.8660f, 0.0846f, 0.4928f }, + { 0.0000f, -0.1691f, -0.9856f }, { 0.0000f, 0.9856f, -0.1691f }, + { 0.8165f, 0.4082f, 0.4082f }, { 0.8165f, -0.4082f, -0.4082f } }; auto portal = pointNormals.GetPortalConstControl(); VTKM_TEST_ASSERT(portal.GetNumberOfValues() == 8, "incorrect pointNormals array length"); for (vtkm::Id i = 0; i < 8; ++i) diff --git a/vtkm/worklet/testing/UnitTestTube.cxx b/vtkm/worklet/testing/UnitTestTube.cxx index 6b076986f..a8c24c81b 100644 --- a/vtkm/worklet/testing/UnitTestTube.cxx +++ b/vtkm/worklet/testing/UnitTestTube.cxx @@ -17,7 +17,7 @@ namespace { void appendPts(vtkm::cont::DataSetBuilderExplicitIterative& dsb, - const vtkm::Vec& pt, + const vtkm::Vec3f& pt, std::vector& ids) { vtkm::Id pid = dsb.AddPoint(pt); @@ -29,9 +29,9 @@ void createNonPoly(vtkm::cont::DataSetBuilderExplicitIterative& dsb) { std::vector ids; - appendPts(dsb, vtkm::Vec(0, 0, 0), ids); - appendPts(dsb, vtkm::Vec(1, 0, 0), ids); - appendPts(dsb, vtkm::Vec(1, 1, 0), ids); + appendPts(dsb, vtkm::Vec3f(0, 0, 0), ids); + appendPts(dsb, vtkm::Vec3f(1, 0, 0), ids); + appendPts(dsb, vtkm::Vec3f(1, 1, 0), ids); dsb.AddCell(vtkm::CELL_SHAPE_TRIANGLE, ids); } @@ -51,7 +51,7 @@ vtkm::Id calcNumCells(const std::size_t& numPtIds, const vtkm::Id& numSides, con void TestTube(bool capEnds, vtkm::FloatDefault radius, vtkm::Id numSides, vtkm::Id insertNonPolyPos) { - using VecType = vtkm::Vec; + using VecType = vtkm::Vec3f; vtkm::cont::DataSetBuilderExplicitIterative dsb; std::vector ids; @@ -118,7 +118,7 @@ void TestTube(bool capEnds, vtkm::FloatDefault radius, vtkm::Id numSides, vtkm:: vtkm::cont::DataSet ds = dsb.Create(); vtkm::worklet::Tube tubeWorklet(capEnds, numSides, radius); - vtkm::cont::ArrayHandle> newPoints; + vtkm::cont::ArrayHandle newPoints; vtkm::cont::CellSetSingleType<> newCells; tubeWorklet.Run(ds.GetCoordinateSystem(0), ds.GetCellSet(0), newPoints, newCells); @@ -131,7 +131,7 @@ void TestTube(bool capEnds, vtkm::FloatDefault radius, vtkm::Id numSides, vtkm:: void TestLinearPolylines() { - using VecType = vtkm::Vec; + using VecType = vtkm::Vec3f; //Create a number of linear polylines along a set of directions. //We check that the tubes are all copacetic (proper number of cells, points), @@ -173,7 +173,7 @@ void TestLinearPolylines() vtkm::Id reqNumCells = calcNumCells(ids.size(), numSides, capEnds); vtkm::worklet::Tube tubeWorklet(capEnds, numSides, radius); - vtkm::cont::ArrayHandle> newPoints; + vtkm::cont::ArrayHandle newPoints; vtkm::cont::CellSetSingleType<> newCells; tubeWorklet.Run(ds.GetCoordinateSystem(0), ds.GetCellSet(0), newPoints, newCells); diff --git a/vtkm/worklet/testing/UnitTestVertexClustering.cxx b/vtkm/worklet/testing/UnitTestVertexClustering.cxx index e798e4688..8cc06e4fb 100644 --- a/vtkm/worklet/testing/UnitTestVertexClustering.cxx +++ b/vtkm/worklet/testing/UnitTestVertexClustering.cxx @@ -77,7 +77,7 @@ void TestVertexClustering() VTKM_TEST_ASSERT(outDataSet.GetNumberOfCoordinateSystems() == 1, "Number of output coordinate systems mismatch"); - using PointType = vtkm::Vec; + using PointType = vtkm::Vec3f_64; auto pointArray = outDataSet.GetCoordinateSystem(0).GetData(); VTKM_TEST_ASSERT(pointArray.GetNumberOfValues() == output_points, "Number of output points mismatch"); diff --git a/vtkm/worklet/testing/UnitTestWarpScalar.cxx b/vtkm/worklet/testing/UnitTestWarpScalar.cxx index ff196a2df..1783a0d98 100644 --- a/vtkm/worklet/testing/UnitTestWarpScalar.cxx +++ b/vtkm/worklet/testing/UnitTestWarpScalar.cxx @@ -51,7 +51,7 @@ vtkm::cont::DataSet MakeWarpScalarTestDataSet() void TestWarpScalar() { std::cout << "Testing WarpScalar Worklet" << std::endl; - using vecType = vtkm::Vec; + using vecType = vtkm::Vec3f; vtkm::cont::DataSet ds = MakeWarpScalarTestDataSet(); diff --git a/vtkm/worklet/testing/UnitTestWarpVector.cxx b/vtkm/worklet/testing/UnitTestWarpVector.cxx index 220231650..5216ec3ed 100644 --- a/vtkm/worklet/testing/UnitTestWarpVector.cxx +++ b/vtkm/worklet/testing/UnitTestWarpVector.cxx @@ -63,7 +63,7 @@ vtkm::cont::DataSet MakeWarpVectorTestDataSet() void TestWarpVector() { std::cout << "Testing WarpVector Worklet" << std::endl; - using vecType = vtkm::Vec; + using vecType = vtkm::Vec3f; vtkm::cont::DataSet ds = MakeWarpVectorTestDataSet(); vtkm::cont::ArrayHandle result; diff --git a/vtkm/worklet/tetrahedralize/TetrahedralizeExplicit.h b/vtkm/worklet/tetrahedralize/TetrahedralizeExplicit.h index 6d721fa2f..35448a29a 100644 --- a/vtkm/worklet/tetrahedralize/TetrahedralizeExplicit.h +++ b/vtkm/worklet/tetrahedralize/TetrahedralizeExplicit.h @@ -93,7 +93,7 @@ public: ConnectivityOutVec& connectivityOut, vtkm::IdComponent visitIndex) const { - vtkm::Vec tetIndices = tables.GetIndices(shape, visitIndex); + vtkm::IdComponent4 tetIndices = tables.GetIndices(shape, visitIndex); connectivityOut[0] = connectivityIn[tetIndices[0]]; connectivityOut[1] = connectivityIn[tetIndices[1]]; connectivityOut[2] = connectivityIn[tetIndices[2]]; diff --git a/vtkm/worklet/triangulate/TriangulateExplicit.h b/vtkm/worklet/triangulate/TriangulateExplicit.h index 5095c1f10..253e18e75 100644 --- a/vtkm/worklet/triangulate/TriangulateExplicit.h +++ b/vtkm/worklet/triangulate/TriangulateExplicit.h @@ -95,7 +95,7 @@ public: ConnectivityOutVec& connectivityOut, vtkm::IdComponent visitIndex) const { - vtkm::Vec triIndices = tables.GetIndices(shape, visitIndex); + vtkm::IdComponent3 triIndices = tables.GetIndices(shape, visitIndex); connectivityOut[0] = connectivityIn[triIndices[0]]; connectivityOut[1] = connectivityIn[triIndices[1]]; connectivityOut[2] = connectivityIn[triIndices[2]];