mirror of
https://gitlab.kitware.com/vtk/vtk-m
synced 2024-09-08 13:23:51 +00:00
Merge branch 'master' of https://gitlab.kitware.com/vtk/vtk-m into 2DLocators
This commit is contained in:
commit
2f2230d1f4
@ -140,21 +140,21 @@ struct BenchmarkValueTypeFunctor
|
||||
bool operator()(DeviceAdapter id)
|
||||
{
|
||||
BenchmarkValueType<vtkm::UInt8, DeviceAdapter>(id);
|
||||
BenchmarkValueType<vtkm::Vec<vtkm::UInt8, 2>, DeviceAdapter>(id);
|
||||
BenchmarkValueType<vtkm::Vec<vtkm::UInt8, 3>, DeviceAdapter>(id);
|
||||
BenchmarkValueType<vtkm::Vec<vtkm::UInt8, 4>, DeviceAdapter>(id);
|
||||
BenchmarkValueType<vtkm::Vec2ui_8, DeviceAdapter>(id);
|
||||
BenchmarkValueType<vtkm::Vec3ui_8, DeviceAdapter>(id);
|
||||
BenchmarkValueType<vtkm::Vec4ui_8, DeviceAdapter>(id);
|
||||
|
||||
BenchmarkValueType<vtkm::UInt32, DeviceAdapter>(id);
|
||||
BenchmarkValueType<vtkm::Vec<vtkm::UInt32, 2>, DeviceAdapter>(id);
|
||||
BenchmarkValueType<vtkm::Vec2ui_32, DeviceAdapter>(id);
|
||||
|
||||
BenchmarkValueType<vtkm::UInt64, DeviceAdapter>(id);
|
||||
BenchmarkValueType<vtkm::Vec<vtkm::UInt64, 2>, DeviceAdapter>(id);
|
||||
BenchmarkValueType<vtkm::Vec2ui_64, DeviceAdapter>(id);
|
||||
|
||||
BenchmarkValueType<vtkm::Float32, DeviceAdapter>(id);
|
||||
BenchmarkValueType<vtkm::Vec<vtkm::Float32, 2>, DeviceAdapter>(id);
|
||||
BenchmarkValueType<vtkm::Vec2f_32, DeviceAdapter>(id);
|
||||
|
||||
BenchmarkValueType<vtkm::Float64, DeviceAdapter>(id);
|
||||
BenchmarkValueType<vtkm::Vec<vtkm::Float64, 2>, DeviceAdapter>(id);
|
||||
BenchmarkValueType<vtkm::Vec2f_64, DeviceAdapter>(id);
|
||||
|
||||
BenchmarkValueType<vtkm::Pair<vtkm::UInt32, vtkm::Float32>, DeviceAdapter>(id);
|
||||
BenchmarkValueType<vtkm::Pair<vtkm::UInt32, vtkm::Float64>, DeviceAdapter>(id);
|
||||
|
@ -147,14 +147,14 @@ struct BaseTypes : vtkm::ListTagBase<vtkm::UInt8,
|
||||
vtkm::Int64,
|
||||
vtkm::Pair<vtkm::Id, vtkm::Float32>,
|
||||
vtkm::Float32,
|
||||
vtkm::Vec<vtkm::Float32, 3>,
|
||||
vtkm::Vec3f_32,
|
||||
vtkm::Float64,
|
||||
vtkm::Vec<vtkm::Float64, 3>>
|
||||
vtkm::Vec3f_64>
|
||||
{
|
||||
};
|
||||
|
||||
struct ExtendedTypes : vtkm::ListTagBase<vtkm::UInt8,
|
||||
vtkm::Vec<vtkm::UInt8, 4>,
|
||||
vtkm::Vec4ui_8,
|
||||
vtkm::Int32,
|
||||
vtkm::Int64,
|
||||
vtkm::Pair<vtkm::Int32, vtkm::Float32>,
|
||||
@ -162,9 +162,9 @@ struct ExtendedTypes : vtkm::ListTagBase<vtkm::UInt8,
|
||||
vtkm::Pair<vtkm::Int64, vtkm::Float64>,
|
||||
vtkm::Pair<vtkm::Int64, vtkm::Float64>,
|
||||
vtkm::Float32,
|
||||
vtkm::Vec<vtkm::Float32, 3>,
|
||||
vtkm::Vec3f_32,
|
||||
vtkm::Float64,
|
||||
vtkm::Vec<vtkm::Float64, 3>>
|
||||
vtkm::Vec3f_64>
|
||||
{
|
||||
};
|
||||
|
||||
|
@ -306,12 +306,25 @@ template <typename ArrayHandleType>
|
||||
using ArrayHandlePassThrough =
|
||||
vtkm::cont::ArrayHandleTransform<ArrayHandleType, PassThroughFunctor, PassThroughFunctor>;
|
||||
|
||||
template <typename ValueType, vtkm::IdComponent>
|
||||
struct JunkArrayHandle : vtkm::cont::ArrayHandle<ValueType>
|
||||
{
|
||||
};
|
||||
|
||||
template <typename ArrayHandleType>
|
||||
using BMArrayHandleMultiplexer =
|
||||
vtkm::ListTagApply<vtkm::ListTagAppend<vtkm::cont::internal::ArrayHandleMultiplexerDefaultArrays<
|
||||
typename ArrayHandleType::ValueType>,
|
||||
ArrayHandlePassThrough<ArrayHandleType>>,
|
||||
vtkm::cont::ArrayHandleMultiplexer>;
|
||||
vtkm::cont::ArrayHandleMultiplexer<ArrayHandleType,
|
||||
JunkArrayHandle<typename ArrayHandleType::ValueType, 0>,
|
||||
JunkArrayHandle<typename ArrayHandleType::ValueType, 1>,
|
||||
JunkArrayHandle<typename ArrayHandleType::ValueType, 2>,
|
||||
JunkArrayHandle<typename ArrayHandleType::ValueType, 3>,
|
||||
JunkArrayHandle<typename ArrayHandleType::ValueType, 4>,
|
||||
JunkArrayHandle<typename ArrayHandleType::ValueType, 5>,
|
||||
JunkArrayHandle<typename ArrayHandleType::ValueType, 6>,
|
||||
JunkArrayHandle<typename ArrayHandleType::ValueType, 7>,
|
||||
JunkArrayHandle<typename ArrayHandleType::ValueType, 8>,
|
||||
JunkArrayHandle<typename ArrayHandleType::ValueType, 9>,
|
||||
ArrayHandlePassThrough<ArrayHandleType>>;
|
||||
|
||||
template <typename ArrayHandleType>
|
||||
BMArrayHandleMultiplexer<ArrayHandleType> make_ArrayHandleMultiplexer0(const ArrayHandleType& array)
|
||||
@ -331,7 +344,7 @@ struct ValueTypes : vtkm::ListTagBase<vtkm::Float32, vtkm::Float64>
|
||||
{
|
||||
};
|
||||
|
||||
struct InterpValueTypes : vtkm::ListTagBase<vtkm::Float32, vtkm::Vec<vtkm::Float32, 3>>
|
||||
struct InterpValueTypes : vtkm::ListTagBase<vtkm::Float32, vtkm::Vec3f_32>
|
||||
{
|
||||
};
|
||||
|
||||
@ -863,7 +876,7 @@ private:
|
||||
|
||||
struct ImplicitFunctionBenchData
|
||||
{
|
||||
vtkm::cont::ArrayHandle<vtkm::Vec<vtkm::FloatDefault, 3>> Points;
|
||||
vtkm::cont::ArrayHandle<vtkm::Vec3f> Points;
|
||||
vtkm::cont::ArrayHandle<vtkm::FloatDefault> Result;
|
||||
vtkm::Sphere Sphere1, Sphere2;
|
||||
};
|
||||
|
@ -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::Float32,
|
||||
vtkm::Float64,
|
||||
vtkm::Vec<vtkm::Float32, 3>,
|
||||
vtkm::Vec<vtkm::Float64, 3>>;
|
||||
using FieldTypes = vtkm::ListTagBase<vtkm::Float32, vtkm::Float64, vtkm::Vec3f_32, vtkm::Vec3f_64>;
|
||||
|
||||
using StructuredCellList = vtkm::ListTagBase<vtkm::cont::CellSetStructured<3>>;
|
||||
|
||||
@ -145,7 +142,7 @@ using UnstructuredCellList =
|
||||
|
||||
using AllCellList = vtkm::ListTagJoin<StructuredCellList, UnstructuredCellList>;
|
||||
|
||||
using CoordinateList = vtkm::ListTagBase<vtkm::Vec<vtkm::Float32, 3>, vtkm::Vec<vtkm::Float64, 3>>;
|
||||
using CoordinateList = vtkm::ListTagBase<vtkm::Vec3f_32, vtkm::Vec3f_64>;
|
||||
|
||||
class BenchmarkFilterPolicy : public vtkm::filter::PolicyBase<BenchmarkFilterPolicy>
|
||||
{
|
||||
@ -816,8 +813,8 @@ public:
|
||||
using ExecutionSignature = _2(_1);
|
||||
|
||||
vtkm::Bounds Bounds;
|
||||
vtkm::Vec<vtkm::Float64, 3> Center;
|
||||
vtkm::Vec<vtkm::Float64, 3> 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<T, 3> operator()(vtkm::Vec<T, 3> val) const
|
||||
{
|
||||
using Vec3T = vtkm::Vec<T, 3>;
|
||||
using Vec3F64 = vtkm::Vec<vtkm::Float64, 3>;
|
||||
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<vtkm::Vec<vtkm::FloatDefault, 3>> pvecs;
|
||||
vtkm::cont::ArrayHandle<vtkm::Vec3f> pvecs;
|
||||
|
||||
PointVectorGenerator worklet(bounds);
|
||||
vtkm::worklet::DispatcherMapField<PointVectorGenerator> dispatch(worklet);
|
||||
|
@ -42,7 +42,7 @@ struct BenchRayTracing
|
||||
{
|
||||
vtkm::rendering::raytracing::RayTracer Tracer;
|
||||
vtkm::rendering::raytracing::Camera RayCamera;
|
||||
vtkm::cont::ArrayHandle<vtkm::Vec<vtkm::Id, 4>> Indices;
|
||||
vtkm::cont::ArrayHandle<vtkm::Id4> Indices;
|
||||
vtkm::rendering::raytracing::Ray<Precision> Rays;
|
||||
vtkm::cont::CoordinateSystem Coords;
|
||||
vtkm::cont::DataSet Data;
|
||||
@ -82,11 +82,11 @@ struct BenchRayTracing
|
||||
|
||||
Tracer.SetField(field, range);
|
||||
|
||||
vtkm::cont::ArrayHandle<vtkm::Vec<vtkm::UInt8, 4>> temp;
|
||||
vtkm::cont::ArrayHandle<vtkm::Vec4ui_8> temp;
|
||||
vtkm::cont::ColorTable table("cool to warm");
|
||||
table.Sample(100, temp);
|
||||
|
||||
vtkm::cont::ArrayHandle<vtkm::Vec<vtkm::Float32, 4>> colors;
|
||||
vtkm::cont::ArrayHandle<vtkm::Vec4f_32> 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<vtkm::Float32, 4> 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);
|
||||
}
|
||||
|
||||
|
@ -96,47 +96,6 @@ indices = indicesInMemory;
|
||||
|
||||
All the code that uses `indices` will continue to work.
|
||||
|
||||
If `ArrayHandleMultiplexer` is created with only a single template
|
||||
parameter, then the parameter is interpreted differently. Instead of being
|
||||
interpreted as a type of array, it is interpreted as the `ValueType` of the
|
||||
array. In this case, a default set of arrays will set for you. The basic
|
||||
storage type array will always be part of this list.
|
||||
|
||||
``` cpp
|
||||
vtkm::cont::ArrayHandleMultiplexer<vtkm::FloatDefault> multiplexerArray;
|
||||
|
||||
vtkm::cont::ArrayHandle<vtkm::FloatDefault> basicArray;
|
||||
// Fill basicArray...
|
||||
|
||||
multiplexerArray = basicArray;
|
||||
```
|
||||
|
||||
The default list of arrays includes `ArrayHandleCast` from pretty much any
|
||||
basic type of the same vector length. This allows you to get an
|
||||
`ArrayHandleMultiplexer` of some known type and then use it for other
|
||||
types. For example, you can use an integer-based array in a place where you
|
||||
expect a floating point field.
|
||||
|
||||
``` cpp
|
||||
vtkm::cont::ArrayHandleMultiplexer<vtkm::FloatDefault> multiplexerArray;
|
||||
|
||||
vtkm::cont::ArrayHandle<vtkm::Int32> integerField;
|
||||
// Fill integerField...
|
||||
|
||||
multiplexerArray = vtkm::cont::make_ArrayHandleCast<vtkm::FloatDefault>(integerField);
|
||||
```
|
||||
|
||||
We (as developers) also have the option of putting in special storage types
|
||||
for particular value types. For example, the default list of arrays for a
|
||||
`Vec<FloatDefault,3>` include `ArrayHandleUniformPointCoordinates` (whereas
|
||||
this array cannot be placed in other default lists).
|
||||
|
||||
``` cpp
|
||||
vtkm::cont::ArrayHandleMultiplexer<vtkm::Vec<vtkm::FloatDefault, 3>> multiplexerArray;
|
||||
|
||||
multiplexerArray = vtkm::cont::ArrayHandleUniformPointCoordinates(vtkm::Id3(50));
|
||||
```
|
||||
|
||||
## Variant
|
||||
|
||||
To implement `ArrayHandleMultiplexer`, the class `vtkm::internal::Variant`
|
||||
|
22
docs/changelog/vec-typedefs.md
Normal file
22
docs/changelog/vec-typedefs.md
Normal file
@ -0,0 +1,22 @@
|
||||
# Add aliases for common Vec types
|
||||
|
||||
Specifying `Vec` types can be verbose. For example, to simply express a
|
||||
vector in 3-space, you would need a declaration like this:
|
||||
|
||||
``` cpp
|
||||
vtkm::Vec<vtkm::FloatDefault, 3>
|
||||
```
|
||||
|
||||
This is very verbose and frankly confusing to users. To make things easier,
|
||||
we have introduced several aliases for common `Vec` types. For example, the
|
||||
above type can now be referenced simply with `vtkm::Vec3f`, which is a
|
||||
3-vec of floating point values of the default width. If you want to specify
|
||||
the width, then you can use either `vtkm::Vec3f_32` or `vtkm::Vec3f_64`.
|
||||
|
||||
There are likewise types introduced for integers and unsigned integers
|
||||
(e.g. `vtkm::Vec3i` and `vtkm::Vec3ui`). You can specify the width of these
|
||||
all the way down to 8 bit (e.g. `vtkm::Vec3ui_8`, `vtkm::Vec3ui_16`,
|
||||
`vtkm::Vec3ui_32`, and `vtkm::Vec3ui_64`).
|
||||
|
||||
For completeness, `vtkm::Id4` was added as well as `vtkm::IdComponent2`,
|
||||
`vtkm::IdComponent3`, and `vtkm::IdComponent4`.
|
@ -23,7 +23,7 @@
|
||||
#include <stdexcept>
|
||||
#include <string>
|
||||
|
||||
using FloatVec3 = vtkm::Vec<vtkm::Float32, 3>;
|
||||
using FloatVec3 = vtkm::Vec3f_32;
|
||||
|
||||
namespace
|
||||
{
|
||||
|
@ -84,7 +84,7 @@ int main(int argc, char* argv[])
|
||||
|
||||
camera.ResetToBounds(coordsBounds);
|
||||
|
||||
vtkm::Vec<vtkm::Float32, 3> 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);
|
||||
|
@ -54,7 +54,7 @@
|
||||
|
||||
struct GameOfLifePolicy : public vtkm::filter::PolicyBase<GameOfLifePolicy>
|
||||
{
|
||||
using FieldTypeList = vtkm::ListTagBase<vtkm::UInt8, vtkm::Vec<vtkm::UInt8, 4>>;
|
||||
using FieldTypeList = vtkm::ListTagBase<vtkm::UInt8, vtkm::Vec4ui_8>;
|
||||
};
|
||||
|
||||
struct UpdateLifeState : public vtkm::worklet::WorkletPointNeighborhood
|
||||
@ -71,7 +71,7 @@ struct UpdateLifeState : public vtkm::worklet::WorkletPointNeighborhood
|
||||
template <typename NeighIn>
|
||||
VTKM_EXEC void operator()(const NeighIn& prevstate,
|
||||
vtkm::UInt8& state,
|
||||
vtkm::Vec<vtkm::UInt8, 4>& 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<vtkm::UInt8> state;
|
||||
vtkm::cont::ArrayHandle<vtkm::UInt8> prevstate;
|
||||
vtkm::cont::ArrayHandle<vtkm::Vec<vtkm::UInt8, 4>> colors;
|
||||
vtkm::cont::ArrayHandle<vtkm::Vec4ui_8> 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 <typename DeviceAdapterTag>
|
||||
bool operator()(DeviceAdapterTag device)
|
||||
{
|
||||
vtkm::cont::ArrayHandle<vtkm::Vec<vtkm::UInt8, 4>> colors;
|
||||
vtkm::cont::ArrayHandle<vtkm::Vec4ui_8> colors;
|
||||
this->Colors.GetData().CopyTo(colors);
|
||||
vtkm::interop::TransferToOpenGL(colors, *this->ColorState, device);
|
||||
return true;
|
||||
|
@ -41,7 +41,7 @@
|
||||
template <typename T>
|
||||
struct HelloVTKMInterop
|
||||
{
|
||||
vtkm::Vec<vtkm::Int32, 2> Dims;
|
||||
vtkm::Vec2i_32 Dims;
|
||||
|
||||
GLuint ProgramId;
|
||||
GLuint VAOId;
|
||||
@ -54,7 +54,7 @@ struct HelloVTKMInterop
|
||||
std::vector<vtkm::Vec<T, 3>> InputData;
|
||||
vtkm::cont::ArrayHandle<vtkm::Vec<T, 3>> InHandle;
|
||||
vtkm::cont::ArrayHandle<vtkm::Vec<T, 3>> OutCoords;
|
||||
vtkm::cont::ArrayHandle<vtkm::Vec<vtkm::UInt8, 4>> OutColors;
|
||||
vtkm::cont::ArrayHandle<vtkm::Vec4ui_8> OutColors;
|
||||
|
||||
HelloVTKMInterop(vtkm::Int32 width, vtkm::Int32 height)
|
||||
: Dims(256, 256)
|
||||
@ -82,7 +82,7 @@ struct HelloVTKMInterop
|
||||
}
|
||||
}
|
||||
|
||||
this->Dims = vtkm::Vec<vtkm::Int32, 2>(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<T, 3>& input,
|
||||
vtkm::Vec<T, 3>& output,
|
||||
vtkm::Vec<vtkm::UInt8, 4>& 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);
|
||||
|
@ -34,7 +34,7 @@
|
||||
#include <vector>
|
||||
|
||||
static vtkm::Id3 dims(256, 256, 256);
|
||||
static vtkm::cont::ArrayHandle<vtkm::Vec<vtkm::Float32, 3>> verticesArray, normalsArray;
|
||||
static vtkm::cont::ArrayHandle<vtkm::Vec3f_32> verticesArray, normalsArray;
|
||||
static vtkm::cont::ArrayHandle<vtkm::Float32> 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<vtkm::FloatDefault, 3> origin(0.0f, 0.0f, 0.0f);
|
||||
vtkm::Vec<vtkm::FloatDefault, 3> spacing(1.0f / static_cast<vtkm::FloatDefault>(dims[0]),
|
||||
1.0f / static_cast<vtkm::FloatDefault>(dims[2]),
|
||||
1.0f / static_cast<vtkm::FloatDefault>(dims[1]));
|
||||
vtkm::Vec3f origin(0.0f, 0.0f, 0.0f);
|
||||
vtkm::Vec3f spacing(1.0f / static_cast<vtkm::FloatDefault>(dims[0]),
|
||||
1.0f / static_cast<vtkm::FloatDefault>(dims[2]),
|
||||
1.0f / static_cast<vtkm::FloatDefault>(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<vtkm::Float32, 3> curNormal = normalsArray.GetPortalConstControl().Get(i);
|
||||
vtkm::Vec<vtkm::Float32, 3> 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<vtkm::Vec<vtkm::Float32, 3>>;
|
||||
using VertType = vtkm::cont::ArrayHandle<vtkm::Vec3f_32>;
|
||||
vtkm::cont::CoordinateSystem coords = outputData.GetCoordinateSystem();
|
||||
|
||||
verticesArray = coords.GetData().Cast<VertType>();
|
||||
|
@ -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<vtkm::Float64, 3> ORIGIN(0, 0, 0);
|
||||
vtkm::Vec<vtkm::Float64, 3> 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<vtkm::Vec<vtkm::Float64, 3>> velocityField;
|
||||
vtkm::cont::ArrayHandle<vtkm::Vec3f_64> 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<vtkm::Float64, 3>(vec[0], vec[1], vec[2]));
|
||||
velocityField.GetPortalControl().Set(count, vtkm::Vec3f_64(vec[0], vec[1], vec[2]));
|
||||
count++;
|
||||
}
|
||||
}
|
||||
|
@ -48,7 +48,7 @@ inline vtkm::cont::DataSet Make3DExplicitDataSet()
|
||||
vtkm::cont::DataSet dataSet;
|
||||
vtkm::cont::DataSetBuilderExplicit dsb;
|
||||
|
||||
using CoordType = vtkm::Vec<vtkm::Float64, 3>;
|
||||
using CoordType = vtkm::Vec3f_64;
|
||||
|
||||
std::vector<CoordType> 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 },
|
||||
|
@ -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<vtkm::Vec<vtkm::FloatDefault, 3>> field;
|
||||
vtkm::cont::ArrayHandle<vtkm::Vec3f> field;
|
||||
vtkm::worklet::DispatcherMapField<WaveField> dispatcher;
|
||||
dispatcher.Invoke(ds.GetCoordinateSystem(), field);
|
||||
|
||||
|
@ -62,10 +62,8 @@ template <>
|
||||
class FilterTraits<MultiDeviceGradient>
|
||||
{
|
||||
public:
|
||||
struct TypeListTagGradientInputs : vtkm::ListTagBase<vtkm::Float32,
|
||||
vtkm::Float64,
|
||||
vtkm::Vec<vtkm::Float32, 3>,
|
||||
vtkm::Vec<vtkm::Float64, 3>>
|
||||
struct TypeListTagGradientInputs
|
||||
: vtkm::ListTagBase<vtkm::Float32, vtkm::Float64, vtkm::Vec3f_32, vtkm::Vec3f_64>
|
||||
{
|
||||
};
|
||||
|
||||
|
@ -24,11 +24,10 @@
|
||||
#include <vtkm/rendering/Scene.h>
|
||||
#include <vtkm/rendering/View3D.h>
|
||||
|
||||
vtkm::Vec<vtkm::FloatDefault, 3> ArchimedeanSpiralToCartesian(
|
||||
vtkm::Vec<vtkm::FloatDefault, 3> const& p)
|
||||
vtkm::Vec3f ArchimedeanSpiralToCartesian(vtkm::Vec3f const& p)
|
||||
{
|
||||
// p[0] = r, p[1] = theta, p[2] = z:
|
||||
vtkm::Vec<vtkm::FloatDefault, 3> 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<vtkm::FloatDefault, 3> cylindricalCoordinate{ r, theta, t };
|
||||
vtkm::Vec<vtkm::FloatDefault, 3> 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<vtkm::Vec<vtkm::FloatDefault, 3>> tubePoints;
|
||||
vtkm::cont::ArrayHandle<vtkm::Vec3f> 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<vtkm::Float64, 3> totalExtent(
|
||||
vtkm::Vec3f_64 totalExtent(
|
||||
coordsBounds.X.Length(), coordsBounds.Y.Length(), coordsBounds.Z.Length());
|
||||
vtkm::Float64 mag = vtkm::Magnitude(totalExtent);
|
||||
vtkm::Normalize(totalExtent);
|
||||
|
@ -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<vtkm::Vec<vtkm::Float32, 3>> vertexArray;
|
||||
static vtkm::cont::ArrayHandle<vtkm::Vec3f_32> 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<vtkm::Float32, 3> 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<vtkm::Vec<vtkm::Float32, 3>> field;
|
||||
std::vector<vtkm::Vec3f_32> 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<vtkm::Float32, 3> vecData(x, y, z);
|
||||
vtkm::Vec3f_32 vecData(x, y, z);
|
||||
field.push_back(Normalize(vecData));
|
||||
}
|
||||
vtkm::cont::ArrayHandle<vtkm::Vec<vtkm::Float32, 3>> fieldArray;
|
||||
vtkm::cont::ArrayHandle<vtkm::Vec3f_32> fieldArray;
|
||||
fieldArray = vtkm::cont::make_ArrayHandle(field);
|
||||
|
||||
// Construct the input dataset (uniform) to hold the input and set vector data
|
||||
|
@ -116,10 +116,10 @@ vtkm::cont::DataSet CreateTestDataSet(vtkm::Id3 dims)
|
||||
cellSet.SetPointDimensions(vdims);
|
||||
dataSet.AddCellSet(cellSet);
|
||||
|
||||
vtkm::Vec<vtkm::FloatDefault, 3> origin(0.0f, 0.0f, 0.0f);
|
||||
vtkm::Vec<vtkm::FloatDefault, 3> spacing(1.0f / static_cast<vtkm::FloatDefault>(dims[0]),
|
||||
1.0f / static_cast<vtkm::FloatDefault>(dims[2]),
|
||||
1.0f / static_cast<vtkm::FloatDefault>(dims[1]));
|
||||
vtkm::Vec3f origin(0.0f, 0.0f, 0.0f);
|
||||
vtkm::Vec3f spacing(1.0f / static_cast<vtkm::FloatDefault>(dims[0]),
|
||||
1.0f / static_cast<vtkm::FloatDefault>(dims[2]),
|
||||
1.0f / static_cast<vtkm::FloatDefault>(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 = "<<dims<<std::endl;
|
||||
vtkm::cont::DataSet dataSet = MakeIsosurfaceTestDataSet(dims);
|
||||
|
||||
vtkm::cont::ArrayHandle< vtkm::Vec<vtkm::Float32,3> > result;
|
||||
vtkm::cont::ArrayHandle<vtkm::Vec3f_32> result;
|
||||
|
||||
PointGrad<vtkm::Float32> 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<std::size_t>(nElements), pFile);
|
||||
fclose(pFile);
|
||||
|
||||
std::vector<vtkm::Vec<vtkm::Float32, 3>> field;
|
||||
std::vector<vtkm::Vec3f_32> 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<vtkm::Float32, 3> vecData(x, y, z);
|
||||
vtkm::Vec3f_32 vecData(x, y, z);
|
||||
field.push_back(Normalize(vecData));
|
||||
}
|
||||
|
||||
vtkm::cont::ArrayHandle<vtkm::Vec<vtkm::Float32, 3>> fieldArray;
|
||||
vtkm::cont::ArrayHandle<vtkm::Vec3f_32> fieldArray;
|
||||
fieldArray = vtkm::cont::make_ArrayHandle(field);
|
||||
|
||||
// Construct the input dataset (uniform) to hold the input and set vector data
|
||||
|
@ -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<vtkm::Id, 4> tetIndices;
|
||||
vtkm::Id4 tetIndices;
|
||||
cellSet.GetIndices(tetra, tetIndices);
|
||||
|
||||
// Get the vertex points for this tetrahedron
|
||||
|
@ -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<vtkm::Float32, 3> origin = vtkm::make_Vec(0.0f, 0.0f, 0.0f);
|
||||
const vtkm::Vec<vtkm::Float32, 3> spacing =
|
||||
vtkm::make_Vec(1.0f / static_cast<vtkm::Float32>(dim[0]),
|
||||
1.0f / static_cast<vtkm::Float32>(dim[1]),
|
||||
1.0f / static_cast<vtkm::Float32>(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<vtkm::Float32>(dim[0]),
|
||||
1.0f / static_cast<vtkm::Float32>(dim[1]),
|
||||
1.0f / static_cast<vtkm::Float32>(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<vtkm::Id, 4> tetIndices;
|
||||
vtkm::Id4 tetIndices;
|
||||
cellSet.GetIndices(tetra, tetIndices);
|
||||
|
||||
// Get the vertex points for this tetrahedron
|
||||
|
@ -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<vtkm::Id, 3> triIndices;
|
||||
vtkm::Id3 triIndices;
|
||||
cellSet.GetIndices(triangle, triIndices);
|
||||
|
||||
// Get the vertex points for this triangle
|
||||
vtkm::Vec<vtkm::Float64, 3> pt0 = vertexArray.GetPortalConstControl().Get(triIndices[0]);
|
||||
vtkm::Vec<vtkm::Float64, 3> pt1 = vertexArray.GetPortalConstControl().Get(triIndices[1]);
|
||||
vtkm::Vec<vtkm::Float64, 3> 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);
|
||||
|
@ -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<vtkm::Float32, 3> origin = vtkm::make_Vec(0.0f, 0.0f, 0.0f);
|
||||
const vtkm::Vec<vtkm::Float32, 3> 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<vtkm::Float32>(dim[0]), 1.0f / static_cast<vtkm::Float32>(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<vtkm::Id, 3> triIndices;
|
||||
vtkm::Id3 triIndices;
|
||||
cellSet.GetIndices(triangle, triIndices);
|
||||
|
||||
// Get the vertex points for this triangle
|
||||
vtkm::Vec<vtkm::Float64, 3> pt0 = vertexArray.GetPortalConstControl().Get(triIndices[0]);
|
||||
vtkm::Vec<vtkm::Float64, 3> pt1 = vertexArray.GetPortalConstControl().Get(triIndices[1]);
|
||||
vtkm::Vec<vtkm::Float64, 3> 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);
|
||||
|
@ -108,9 +108,9 @@ struct Bounds
|
||||
/// are empty, the results are undefined.
|
||||
///
|
||||
VTKM_EXEC_CONT
|
||||
vtkm::Vec<vtkm::Float64, 3> Center() const
|
||||
vtkm::Vec3f_64 Center() const
|
||||
{
|
||||
return vtkm::Vec<vtkm::Float64, 3>(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.
|
||||
|
@ -209,7 +209,7 @@ public:
|
||||
vtkm::IdComponent minAxis = 0;
|
||||
Scalar dist = 0.0;
|
||||
Scalar minDist = vtkm::Infinity32();
|
||||
vtkm::Vec<vtkm::IdComponent, 3> location;
|
||||
vtkm::IdComponent3 location;
|
||||
Vector normal(Scalar(0));
|
||||
Vector inside(Scalar(0));
|
||||
Vector outside(Scalar(0));
|
||||
|
@ -62,7 +62,7 @@ struct VTKM_ALWAYS_EXPORT TypeListTagFieldScalar : vtkm::ListTagBase<vtkm::Float
|
||||
/// vectors.
|
||||
///
|
||||
struct VTKM_ALWAYS_EXPORT TypeListTagFieldVec2
|
||||
: vtkm::ListTagBase<vtkm::Vec<vtkm::Float32, 2>, vtkm::Vec<vtkm::Float64, 2>>
|
||||
: vtkm::ListTagBase<vtkm::Vec2f_32, vtkm::Vec2f_64>
|
||||
{
|
||||
};
|
||||
|
||||
@ -70,7 +70,7 @@ struct VTKM_ALWAYS_EXPORT TypeListTagFieldVec2
|
||||
/// vectors.
|
||||
///
|
||||
struct VTKM_ALWAYS_EXPORT TypeListTagFieldVec3
|
||||
: vtkm::ListTagBase<vtkm::Vec<vtkm::Float32, 3>, vtkm::Vec<vtkm::Float64, 3>>
|
||||
: vtkm::ListTagBase<vtkm::Vec3f_32, vtkm::Vec3f_64>
|
||||
{
|
||||
};
|
||||
|
||||
@ -78,7 +78,7 @@ struct VTKM_ALWAYS_EXPORT TypeListTagFieldVec3
|
||||
/// vectors.
|
||||
///
|
||||
struct VTKM_ALWAYS_EXPORT TypeListTagFieldVec4
|
||||
: vtkm::ListTagBase<vtkm::Vec<vtkm::Float32, 4>, vtkm::Vec<vtkm::Float64, 4>>
|
||||
: vtkm::ListTagBase<vtkm::Vec4f_32, vtkm::Vec4f_64>
|
||||
{
|
||||
};
|
||||
|
||||
@ -87,12 +87,12 @@ struct VTKM_ALWAYS_EXPORT TypeListTagFieldVec4
|
||||
/// Scalars are not included.
|
||||
///
|
||||
struct VTKM_ALWAYS_EXPORT TypeListTagFloatVec
|
||||
: vtkm::ListTagBase<vtkm::Vec<vtkm::Float32, 2>,
|
||||
vtkm::Vec<vtkm::Float64, 2>,
|
||||
vtkm::Vec<vtkm::Float32, 3>,
|
||||
vtkm::Vec<vtkm::Float64, 3>,
|
||||
vtkm::Vec<vtkm::Float32, 4>,
|
||||
vtkm::Vec<vtkm::Float64, 4>>
|
||||
: vtkm::ListTagBase<vtkm::Vec2f_32,
|
||||
vtkm::Vec2f_64,
|
||||
vtkm::Vec3f_32,
|
||||
vtkm::Vec3f_64,
|
||||
vtkm::Vec4f_32,
|
||||
vtkm::Vec4f_64>
|
||||
{
|
||||
};
|
||||
|
||||
@ -103,12 +103,12 @@ struct VTKM_ALWAYS_EXPORT TypeListTagFloatVec
|
||||
struct VTKM_ALWAYS_EXPORT TypeListTagField
|
||||
: vtkm::ListTagBase<vtkm::Float32,
|
||||
vtkm::Float64,
|
||||
vtkm::Vec<vtkm::Float32, 2>,
|
||||
vtkm::Vec<vtkm::Float64, 2>,
|
||||
vtkm::Vec<vtkm::Float32, 3>,
|
||||
vtkm::Vec<vtkm::Float64, 3>,
|
||||
vtkm::Vec<vtkm::Float32, 4>,
|
||||
vtkm::Vec<vtkm::Float64, 4>>
|
||||
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::UInt8, 2>,
|
||||
vtkm::Vec<vtkm::Int32, 2>,
|
||||
vtkm::Vec<vtkm::Int64, 2>,
|
||||
vtkm::Vec<vtkm::Float32, 2>,
|
||||
vtkm::Vec<vtkm::Float64, 2>,
|
||||
vtkm::Vec<vtkm::UInt8, 3>,
|
||||
vtkm::Vec<vtkm::Int32, 3>,
|
||||
vtkm::Vec<vtkm::Int64, 3>,
|
||||
vtkm::Vec<vtkm::Float32, 3>,
|
||||
vtkm::Vec<vtkm::Float64, 3>,
|
||||
vtkm::Vec<vtkm::UInt8, 4>,
|
||||
vtkm::Vec<vtkm::Int32, 4>,
|
||||
vtkm::Vec<vtkm::Int64, 4>,
|
||||
vtkm::Vec<vtkm::Float32, 4>,
|
||||
vtkm::Vec<vtkm::Float64, 4>>
|
||||
: vtkm::ListTagBase<vtkm::Vec2ui_8,
|
||||
vtkm::Vec2i_32,
|
||||
vtkm::Vec2i_64,
|
||||
vtkm::Vec2f_32,
|
||||
vtkm::Vec2f_64,
|
||||
vtkm::Vec3ui_8,
|
||||
vtkm::Vec3i_32,
|
||||
vtkm::Vec3i_64,
|
||||
vtkm::Vec3f_32,
|
||||
vtkm::Vec3f_64,
|
||||
vtkm::Vec4ui_8,
|
||||
vtkm::Vec4i_32,
|
||||
vtkm::Vec4i_64,
|
||||
vtkm::Vec4f_32,
|
||||
vtkm::Vec4f_64>
|
||||
{
|
||||
};
|
||||
|
||||
@ -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::Int8, 2>,
|
||||
vtkm::Vec<vtkm::Int16, 2>,
|
||||
vtkm::Vec<vtkm::UInt16, 2>,
|
||||
vtkm::Vec<vtkm::UInt32, 2>,
|
||||
vtkm::Vec<vtkm::UInt64, 2>,
|
||||
vtkm::Vec<vtkm::Int8, 3>,
|
||||
vtkm::Vec<vtkm::Int16, 3>,
|
||||
vtkm::Vec<vtkm::UInt16, 3>,
|
||||
vtkm::Vec<vtkm::UInt32, 3>,
|
||||
vtkm::Vec<vtkm::UInt64, 3>,
|
||||
vtkm::Vec<vtkm::Int8, 4>,
|
||||
vtkm::Vec<vtkm::Int16, 4>,
|
||||
vtkm::Vec<vtkm::UInt16, 4>,
|
||||
vtkm::Vec<vtkm::UInt32, 4>,
|
||||
vtkm::Vec<vtkm::UInt64, 4>>
|
||||
: vtkm::ListTagBase<vtkm::Vec2i_8,
|
||||
vtkm::Vec2i_16,
|
||||
vtkm::Vec2ui_16,
|
||||
vtkm::Vec2ui_32,
|
||||
vtkm::Vec2ui_64,
|
||||
vtkm::Vec3i_8,
|
||||
vtkm::Vec3i_16,
|
||||
vtkm::Vec3ui_16,
|
||||
vtkm::Vec3ui_32,
|
||||
vtkm::Vec3ui_64,
|
||||
vtkm::Vec4i_8,
|
||||
vtkm::Vec4i_16,
|
||||
vtkm::Vec4ui_16,
|
||||
vtkm::Vec4ui_32,
|
||||
vtkm::Vec4ui_64>
|
||||
{
|
||||
};
|
||||
|
||||
@ -206,8 +206,8 @@ struct VTKM_ALWAYS_EXPORT TypeListTagCommon
|
||||
vtkm::Int64,
|
||||
vtkm::Float32,
|
||||
vtkm::Float64,
|
||||
vtkm::Vec<vtkm::Float32, 3>,
|
||||
vtkm::Vec<vtkm::Float64, 3>>
|
||||
vtkm::Vec3f_32,
|
||||
vtkm::Vec3f_64>
|
||||
{
|
||||
};
|
||||
|
||||
|
274
vtkm/Types.h
274
vtkm/Types.h
@ -912,9 +912,97 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
/// Id2 corresponds to a 2-dimensional index
|
||||
/// \brief Id2 corresponds to a 2-dimensional index.
|
||||
///
|
||||
using Id2 = vtkm::Vec<vtkm::Id, 2>;
|
||||
|
||||
/// \brief IdComponent2 corresponds to an index to a local (small) 2-d array or equivalent.
|
||||
///
|
||||
using IdComponent2 = vtkm::Vec<vtkm::IdComponent, 2>;
|
||||
|
||||
/// \brief Vec2f corresponds to a 2-dimensional vector of floating point values.
|
||||
///
|
||||
/// Each floating point value is of the default precision (i.e. vtkm::FloatDefault). It is
|
||||
/// typedef for vtkm::Vec<vtkm::FloatDefault, 2>.
|
||||
///
|
||||
using Vec2f = vtkm::Vec<vtkm::FloatDefault, 2>;
|
||||
|
||||
/// \brief Vec2f_32 corresponds to a 2-dimensional vector of 32-bit floating point values.
|
||||
///
|
||||
/// It is typedef for vtkm::Vec<vtkm::Float32, 2>.
|
||||
///
|
||||
using Vec2f_32 = vtkm::Vec<vtkm::Float32, 2>;
|
||||
|
||||
/// \brief Vec2f_64 corresponds to a 2-dimensional vector of 64-bit floating point values.
|
||||
///
|
||||
/// It is typedef for vtkm::Vec<vtkm::Float64, 2>.
|
||||
///
|
||||
using Vec2f_64 = vtkm::Vec<vtkm::Float64, 2>;
|
||||
|
||||
/// \brief Vec2i corresponds to a 2-dimensional vector of integer values.
|
||||
///
|
||||
/// Each integer value is of the default precision (i.e. vtkm::Id).
|
||||
///
|
||||
using Vec2i = vtkm::Vec<vtkm::Id, 2>;
|
||||
|
||||
/// \brief Vec2i_8 corresponds to a 2-dimensional vector of 8-bit integer values.
|
||||
///
|
||||
/// It is typedef for vtkm::Vec<vtkm::Int32, 2>.
|
||||
///
|
||||
using Vec2i_8 = vtkm::Vec<vtkm::Int8, 2>;
|
||||
|
||||
/// \brief Vec2i_16 corresponds to a 2-dimensional vector of 16-bit integer values.
|
||||
///
|
||||
/// It is typedef for vtkm::Vec<vtkm::Int32, 2>.
|
||||
///
|
||||
using Vec2i_16 = vtkm::Vec<vtkm::Int16, 2>;
|
||||
|
||||
/// \brief Vec2i_32 corresponds to a 2-dimensional vector of 32-bit integer values.
|
||||
///
|
||||
/// It is typedef for vtkm::Vec<vtkm::Int32, 2>.
|
||||
///
|
||||
using Vec2i_32 = vtkm::Vec<vtkm::Int32, 2>;
|
||||
|
||||
/// \brief Vec2i_64 corresponds to a 2-dimensional vector of 64-bit integer values.
|
||||
///
|
||||
/// It is typedef for vtkm::Vec<vtkm::Int64, 2>.
|
||||
///
|
||||
using Vec2i_64 = vtkm::Vec<vtkm::Int64, 2>;
|
||||
|
||||
/// \brief Vec2ui corresponds to a 2-dimensional vector of unsigned integer values.
|
||||
///
|
||||
/// Each integer value is of the default precision (following vtkm::Id).
|
||||
///
|
||||
#ifdef VTKM_USE_64BIT_IDS
|
||||
using Vec2ui = vtkm::Vec<vtkm::UInt64, 2>;
|
||||
#else
|
||||
using Vec2ui = vtkm::Vec<vtkm::UInt32, 2>;
|
||||
#endif
|
||||
|
||||
/// \brief Vec2ui_8 corresponds to a 2-dimensional vector of 8-bit unsigned integer values.
|
||||
///
|
||||
/// It is typedef for vtkm::Vec<vtkm::UInt32, 2>.
|
||||
///
|
||||
using Vec2ui_8 = vtkm::Vec<vtkm::UInt8, 2>;
|
||||
|
||||
/// \brief Vec2ui_16 corresponds to a 2-dimensional vector of 16-bit unsigned integer values.
|
||||
///
|
||||
/// It is typedef for vtkm::Vec<vtkm::UInt32, 2>.
|
||||
///
|
||||
using Vec2ui_16 = vtkm::Vec<vtkm::UInt16, 2>;
|
||||
|
||||
/// \brief Vec2ui_32 corresponds to a 2-dimensional vector of 32-bit unsigned integer values.
|
||||
///
|
||||
/// It is typedef for vtkm::Vec<vtkm::UInt32, 2>.
|
||||
///
|
||||
using Vec2ui_32 = vtkm::Vec<vtkm::UInt32, 2>;
|
||||
|
||||
/// \brief Vec2ui_64 corresponds to a 2-dimensional vector of 64-bit unsigned integer values.
|
||||
///
|
||||
/// It is typedef for vtkm::Vec<vtkm::UInt64, 2>.
|
||||
///
|
||||
using Vec2ui_64 = vtkm::Vec<vtkm::UInt64, 2>;
|
||||
|
||||
template <typename T>
|
||||
class VTKM_ALWAYS_EXPORT Vec<T, 3> : public detail::VecBase<T, 3, Vec<T, 3>>
|
||||
{
|
||||
@ -940,10 +1028,99 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
/// Id3 corresponds to a 3-dimensional index for 3d arrays. Note that
|
||||
/// the precision of each index may be less than vtkm::Id.
|
||||
/// \brief Id3 corresponds to a 3-dimensional index for 3d arrays.
|
||||
///
|
||||
/// Note that the precision of each index may be less than vtkm::Id.
|
||||
///
|
||||
using Id3 = vtkm::Vec<vtkm::Id, 3>;
|
||||
|
||||
/// \brief IdComponent2 corresponds to an index to a local (small) 3-d array or equivalent.
|
||||
///
|
||||
using IdComponent3 = vtkm::Vec<vtkm::IdComponent, 3>;
|
||||
|
||||
/// \brief Vec3f corresponds to a 3-dimensional vector of floating point values.
|
||||
///
|
||||
/// Each floating point value is of the default precision (i.e. vtkm::FloatDefault). It is
|
||||
/// typedef for vtkm::Vec<vtkm::FloatDefault, 3>.
|
||||
///
|
||||
using Vec3f = vtkm::Vec<vtkm::FloatDefault, 3>;
|
||||
|
||||
/// \brief Vec3f_32 corresponds to a 3-dimensional vector of 32-bit floating point values.
|
||||
///
|
||||
/// It is typedef for vtkm::Vec<vtkm::Float32, 3>.
|
||||
///
|
||||
using Vec3f_32 = vtkm::Vec<vtkm::Float32, 3>;
|
||||
|
||||
/// \brief Vec3f_64 corresponds to a 3-dimensional vector of 64-bit floating point values.
|
||||
///
|
||||
/// It is typedef for vtkm::Vec<vtkm::Float64, 3>.
|
||||
///
|
||||
using Vec3f_64 = vtkm::Vec<vtkm::Float64, 3>;
|
||||
|
||||
/// \brief Vec3i corresponds to a 3-dimensional vector of integer values.
|
||||
///
|
||||
/// Each integer value is of the default precision (i.e. vtkm::Id).
|
||||
///
|
||||
using Vec3i = vtkm::Vec<vtkm::Id, 3>;
|
||||
|
||||
/// \brief Vec3i_8 corresponds to a 3-dimensional vector of 8-bit integer values.
|
||||
///
|
||||
/// It is typedef for vtkm::Vec<vtkm::Int32, 3>.
|
||||
///
|
||||
using Vec3i_8 = vtkm::Vec<vtkm::Int8, 3>;
|
||||
|
||||
/// \brief Vec3i_16 corresponds to a 3-dimensional vector of 16-bit integer values.
|
||||
///
|
||||
/// It is typedef for vtkm::Vec<vtkm::Int32, 3>.
|
||||
///
|
||||
using Vec3i_16 = vtkm::Vec<vtkm::Int16, 3>;
|
||||
|
||||
/// \brief Vec3i_32 corresponds to a 3-dimensional vector of 32-bit integer values.
|
||||
///
|
||||
/// It is typedef for vtkm::Vec<vtkm::Int32, 3>.
|
||||
///
|
||||
using Vec3i_32 = vtkm::Vec<vtkm::Int32, 3>;
|
||||
|
||||
/// \brief Vec3i_64 corresponds to a 3-dimensional vector of 64-bit integer values.
|
||||
///
|
||||
/// It is typedef for vtkm::Vec<vtkm::Int64, 3>.
|
||||
///
|
||||
using Vec3i_64 = vtkm::Vec<vtkm::Int64, 3>;
|
||||
|
||||
/// \brief Vec3ui corresponds to a 3-dimensional vector of unsigned integer values.
|
||||
///
|
||||
/// Each integer value is of the default precision (following vtkm::Id).
|
||||
///
|
||||
#ifdef VTKM_USE_64BIT_IDS
|
||||
using Vec3ui = vtkm::Vec<vtkm::UInt64, 3>;
|
||||
#else
|
||||
using Vec3ui = vtkm::Vec<vtkm::UInt32, 3>;
|
||||
#endif
|
||||
|
||||
/// \brief Vec3ui_8 corresponds to a 3-dimensional vector of 8-bit unsigned integer values.
|
||||
///
|
||||
/// It is typedef for vtkm::Vec<vtkm::UInt32, 3>.
|
||||
///
|
||||
using Vec3ui_8 = vtkm::Vec<vtkm::UInt8, 3>;
|
||||
|
||||
/// \brief Vec3ui_16 corresponds to a 3-dimensional vector of 16-bit unsigned integer values.
|
||||
///
|
||||
/// It is typedef for vtkm::Vec<vtkm::UInt32, 3>.
|
||||
///
|
||||
using Vec3ui_16 = vtkm::Vec<vtkm::UInt16, 3>;
|
||||
|
||||
/// \brief Vec3ui_32 corresponds to a 3-dimensional vector of 32-bit unsigned integer values.
|
||||
///
|
||||
/// It is typedef for vtkm::Vec<vtkm::UInt32, 3>.
|
||||
///
|
||||
using Vec3ui_32 = vtkm::Vec<vtkm::UInt32, 3>;
|
||||
|
||||
/// \brief Vec3ui_64 corresponds to a 3-dimensional vector of 64-bit unsigned integer values.
|
||||
///
|
||||
/// It is typedef for vtkm::Vec<vtkm::UInt64, 3>.
|
||||
///
|
||||
using Vec3ui_64 = vtkm::Vec<vtkm::UInt64, 3>;
|
||||
|
||||
template <typename T>
|
||||
class VTKM_ALWAYS_EXPORT Vec<T, 4> : public detail::VecBase<T, 4, Vec<T, 4>>
|
||||
{
|
||||
@ -969,6 +1146,97 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
/// \brief Id4 corresponds to a 4-dimensional index.
|
||||
///
|
||||
using Id4 = vtkm::Vec<vtkm::Id, 4>;
|
||||
|
||||
/// \brief IdComponent4 corresponds to an index to a local (small) 4-d array or equivalent.
|
||||
///
|
||||
using IdComponent4 = vtkm::Vec<vtkm::IdComponent, 4>;
|
||||
|
||||
/// \brief Vec4f corresponds to a 4-dimensional vector of floating point values.
|
||||
///
|
||||
/// Each floating point value is of the default precision (i.e. vtkm::FloatDefault). It is
|
||||
/// typedef for vtkm::Vec<vtkm::FloatDefault, 4>.
|
||||
///
|
||||
using Vec4f = vtkm::Vec<vtkm::FloatDefault, 4>;
|
||||
|
||||
/// \brief Vec4f_32 corresponds to a 4-dimensional vector of 32-bit floating point values.
|
||||
///
|
||||
/// It is typedef for vtkm::Vec<vtkm::Float32, 4>.
|
||||
///
|
||||
using Vec4f_32 = vtkm::Vec<vtkm::Float32, 4>;
|
||||
|
||||
/// \brief Vec4f_64 corresponds to a 4-dimensional vector of 64-bit floating point values.
|
||||
///
|
||||
/// It is typedef for vtkm::Vec<vtkm::Float64, 4>.
|
||||
///
|
||||
using Vec4f_64 = vtkm::Vec<vtkm::Float64, 4>;
|
||||
|
||||
/// \brief Vec4i corresponds to a 4-dimensional vector of integer values.
|
||||
///
|
||||
/// Each integer value is of the default precision (i.e. vtkm::Id).
|
||||
///
|
||||
using Vec4i = vtkm::Vec<vtkm::Id, 4>;
|
||||
|
||||
/// \brief Vec4i_8 corresponds to a 4-dimensional vector of 8-bit integer values.
|
||||
///
|
||||
/// It is typedef for vtkm::Vec<vtkm::Int32, 4>.
|
||||
///
|
||||
using Vec4i_8 = vtkm::Vec<vtkm::Int8, 4>;
|
||||
|
||||
/// \brief Vec4i_16 corresponds to a 4-dimensional vector of 16-bit integer values.
|
||||
///
|
||||
/// It is typedef for vtkm::Vec<vtkm::Int32, 4>.
|
||||
///
|
||||
using Vec4i_16 = vtkm::Vec<vtkm::Int16, 4>;
|
||||
|
||||
/// \brief Vec4i_32 corresponds to a 4-dimensional vector of 32-bit integer values.
|
||||
///
|
||||
/// It is typedef for vtkm::Vec<vtkm::Int32, 4>.
|
||||
///
|
||||
using Vec4i_32 = vtkm::Vec<vtkm::Int32, 4>;
|
||||
|
||||
/// \brief Vec4i_64 corresponds to a 4-dimensional vector of 64-bit integer values.
|
||||
///
|
||||
/// It is typedef for vtkm::Vec<vtkm::Int64, 4>.
|
||||
///
|
||||
using Vec4i_64 = vtkm::Vec<vtkm::Int64, 4>;
|
||||
|
||||
/// \brief Vec4ui corresponds to a 4-dimensional vector of unsigned integer values.
|
||||
///
|
||||
/// Each integer value is of the default precision (following vtkm::Id).
|
||||
///
|
||||
#ifdef VTKM_USE_64BIT_IDS
|
||||
using Vec4ui = vtkm::Vec<vtkm::UInt64, 4>;
|
||||
#else
|
||||
using Vec4ui = vtkm::Vec<vtkm::UInt32, 4>;
|
||||
#endif
|
||||
|
||||
/// \brief Vec4ui_8 corresponds to a 4-dimensional vector of 8-bit unsigned integer values.
|
||||
///
|
||||
/// It is typedef for vtkm::Vec<vtkm::UInt32, 4>.
|
||||
///
|
||||
using Vec4ui_8 = vtkm::Vec<vtkm::UInt8, 4>;
|
||||
|
||||
/// \brief Vec4ui_16 corresponds to a 4-dimensional vector of 16-bit unsigned integer values.
|
||||
///
|
||||
/// It is typedef for vtkm::Vec<vtkm::UInt32, 4>.
|
||||
///
|
||||
using Vec4ui_16 = vtkm::Vec<vtkm::UInt16, 4>;
|
||||
|
||||
/// \brief Vec4ui_32 corresponds to a 4-dimensional vector of 32-bit unsigned integer values.
|
||||
///
|
||||
/// It is typedef for vtkm::Vec<vtkm::UInt32, 4>.
|
||||
///
|
||||
using Vec4ui_32 = vtkm::Vec<vtkm::UInt32, 4>;
|
||||
|
||||
/// \brief Vec4ui_64 corresponds to a 4-dimensional vector of 64-bit unsigned integer values.
|
||||
///
|
||||
/// It is typedef for vtkm::Vec<vtkm::UInt64, 4>.
|
||||
///
|
||||
using Vec4ui_64 = vtkm::Vec<vtkm::UInt64, 4>;
|
||||
|
||||
/// Initializes and returns a Vec containing all the arguments. The arguments should all be the
|
||||
/// same type or compile issues will occur.
|
||||
///
|
||||
|
@ -78,7 +78,7 @@ template <vtkm::IdComponent NumDimensions>
|
||||
class VecAxisAlignedPointCoordinates
|
||||
{
|
||||
public:
|
||||
using ComponentType = vtkm::Vec<vtkm::FloatDefault, 3>;
|
||||
using ComponentType = vtkm::Vec3f;
|
||||
|
||||
static constexpr vtkm::IdComponent NUM_COMPONENTS =
|
||||
detail::VecAxisAlignedPointCoordinatesNumComponents<NumDimensions>::NUM_COMPONENTS;
|
||||
@ -136,8 +136,8 @@ struct TypeTraits<vtkm::VecAxisAlignedPointCoordinates<NumDimensions>>
|
||||
VTKM_EXEC_CONT
|
||||
static vtkm::VecAxisAlignedPointCoordinates<NumDimensions> ZeroInitialization()
|
||||
{
|
||||
return vtkm::VecAxisAlignedPointCoordinates<NumDimensions>(
|
||||
vtkm::Vec<vtkm::FloatDefault, 3>(0, 0, 0), vtkm::Vec<vtkm::FloatDefault, 3>(0, 0, 0));
|
||||
return vtkm::VecAxisAlignedPointCoordinates<NumDimensions>(vtkm::Vec3f(0, 0, 0),
|
||||
vtkm::Vec3f(0, 0, 0));
|
||||
}
|
||||
};
|
||||
|
||||
@ -146,7 +146,7 @@ struct VecTraits<vtkm::VecAxisAlignedPointCoordinates<NumDimensions>>
|
||||
{
|
||||
using VecType = vtkm::VecAxisAlignedPointCoordinates<NumDimensions>;
|
||||
|
||||
using ComponentType = vtkm::Vec<vtkm::FloatDefault, 3>;
|
||||
using ComponentType = vtkm::Vec3f;
|
||||
using HasMultipleComponents = vtkm::VecTraitsTagMultipleComponents;
|
||||
using IsSizeStatic = vtkm::VecTraitsTagSizeStatic;
|
||||
|
||||
|
@ -375,13 +375,18 @@ private:
|
||||
namespace detail
|
||||
{
|
||||
|
||||
template <typename ValueType, typename... ArrayHandleTypes>
|
||||
template <typename... ArrayHandleTypes>
|
||||
struct ArrayHandleMultiplexerTraits
|
||||
{
|
||||
// If there is a compile error in this group of lines, then the list tag given to
|
||||
// ArrayHandleMultiplexer must contain an invalid ArrayHandle. That could mean that
|
||||
// it is not an ArrayHandle type or it could mean that the value type does not match
|
||||
// the appropriate value type.
|
||||
using ArrayHandleType0 =
|
||||
brigand::at<brigand::list<ArrayHandleTypes...>, std::integral_constant<vtkm::IdComponent, 0>>;
|
||||
VTKM_IS_ARRAY_HANDLE(ArrayHandleType0);
|
||||
using ValueType = typename ArrayHandleType0::ValueType;
|
||||
|
||||
// If there is a compile error in this group of lines, then one of the array types given to
|
||||
// ArrayHandleMultiplexer must contain an invalid ArrayHandle. That could mean that it is not an
|
||||
// ArrayHandle type or it could mean that the value type does not match the appropriate value
|
||||
// type.
|
||||
template <typename ArrayHandle>
|
||||
struct CheckArrayHandleTransform
|
||||
{
|
||||
@ -409,154 +414,6 @@ struct ArrayHandleMultiplexerTraits
|
||||
};
|
||||
}
|
||||
|
||||
/// \brief Base implementation of \c ArrayHandleMultiplexer.
|
||||
///
|
||||
/// This behavies the same as \c ArrayHandleMultiplexer, but the template parameters are
|
||||
/// more explicit. The first template parameter must be the \c ValueType of the array.
|
||||
/// The remaining template parameters are the array handles to support.
|
||||
///
|
||||
template <typename ValueType_, typename... ArrayHandleTypes>
|
||||
class ArrayHandleMultiplexerBase
|
||||
: public vtkm::cont::ArrayHandle<
|
||||
ValueType_,
|
||||
typename detail::ArrayHandleMultiplexerTraits<ValueType_, ArrayHandleTypes...>::StorageTag>
|
||||
{
|
||||
using Traits = detail::ArrayHandleMultiplexerTraits<ValueType_, ArrayHandleTypes...>;
|
||||
|
||||
public:
|
||||
VTKM_ARRAY_HANDLE_SUBCLASS(ArrayHandleMultiplexerBase,
|
||||
(ArrayHandleMultiplexerBase<ValueType_, ArrayHandleTypes...>),
|
||||
(vtkm::cont::ArrayHandle<ValueType_, typename Traits::StorageTag>));
|
||||
|
||||
private:
|
||||
using StorageType = vtkm::cont::internal::Storage<ValueType, StorageTag>;
|
||||
|
||||
public:
|
||||
template <typename RealStorageTag>
|
||||
VTKM_CONT ArrayHandleMultiplexerBase(
|
||||
const vtkm::cont::ArrayHandle<ValueType, RealStorageTag>& src)
|
||||
: Superclass(StorageType(src))
|
||||
{
|
||||
}
|
||||
|
||||
template <typename RealStorageTag>
|
||||
VTKM_CONT ArrayHandleMultiplexerBase(vtkm::cont::ArrayHandle<ValueType, RealStorageTag>&& rhs)
|
||||
: Superclass(StorageType(std::move(rhs)))
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
namespace internal
|
||||
{
|
||||
|
||||
namespace detail
|
||||
{
|
||||
|
||||
template <typename ValueType>
|
||||
struct MakeArrayListFromStorage
|
||||
{
|
||||
template <typename S>
|
||||
using Transform = vtkm::cont::ArrayHandle<ValueType, S>;
|
||||
};
|
||||
|
||||
template <typename ValueType>
|
||||
struct SupportedArrays
|
||||
: vtkm::ListTagTransform<vtkm::cont::StorageListTagSupported,
|
||||
MakeArrayListFromStorage<ValueType>::template Transform>
|
||||
{
|
||||
};
|
||||
|
||||
template <typename DestType, typename SrcTypeList>
|
||||
struct MakeCastArrayListImpl
|
||||
{
|
||||
using TypeStoragePairs = vtkm::ListCrossProduct<SrcTypeList, vtkm::cont::StorageListTagSupported>;
|
||||
|
||||
template <typename Pair>
|
||||
struct PairToCastArrayImpl;
|
||||
template <typename T, typename S>
|
||||
struct PairToCastArrayImpl<brigand::list<T, S>>
|
||||
{
|
||||
using Type = vtkm::cont::ArrayHandleCast<DestType, vtkm::cont::ArrayHandle<T, S>>;
|
||||
};
|
||||
template <typename Pair>
|
||||
using PairToCastArray = typename PairToCastArrayImpl<Pair>::Type;
|
||||
|
||||
using Type = vtkm::ListTagTransform<TypeStoragePairs, PairToCastArray>;
|
||||
};
|
||||
|
||||
template <typename DestType>
|
||||
struct MakeCastArrayList
|
||||
{
|
||||
using Type = typename MakeCastArrayListImpl<DestType, vtkm::TypeListTagScalarAll>::Type;
|
||||
};
|
||||
|
||||
template <typename ComponentType, vtkm::IdComponent N>
|
||||
struct MakeCastArrayList<vtkm::Vec<ComponentType, N>>
|
||||
{
|
||||
template <typename T>
|
||||
using ScalarToVec = vtkm::Vec<T, N>;
|
||||
using SourceTypes = vtkm::ListTagTransform<vtkm::TypeListTagScalarAll, ScalarToVec>;
|
||||
|
||||
using Type = typename MakeCastArrayListImpl<vtkm::Vec<ComponentType, N>, SourceTypes>::Type;
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
struct ArrayHandleMultiplexerDefaultArraysBase
|
||||
: vtkm::ListTagJoin<SupportedArrays<T>, typename MakeCastArrayList<T>::Type>
|
||||
{
|
||||
};
|
||||
|
||||
} // namespace detail
|
||||
|
||||
template <typename T>
|
||||
struct ArrayHandleMultiplexerDefaultArrays : detail::ArrayHandleMultiplexerDefaultArraysBase<T>
|
||||
{
|
||||
};
|
||||
|
||||
template <>
|
||||
struct ArrayHandleMultiplexerDefaultArrays<vtkm::Vec<vtkm::FloatDefault, 3>>
|
||||
: vtkm::ListTagJoin<
|
||||
detail::ArrayHandleMultiplexerDefaultArraysBase<vtkm::Vec<vtkm::FloatDefault, 3>>,
|
||||
vtkm::ListTagBase<
|
||||
#if 1
|
||||
vtkm::cont::ArrayHandleCartesianProduct<vtkm::cont::ArrayHandle<vtkm::FloatDefault>,
|
||||
vtkm::cont::ArrayHandle<vtkm::FloatDefault>,
|
||||
vtkm::cont::ArrayHandle<vtkm::FloatDefault>>,
|
||||
#endif
|
||||
vtkm::cont::ArrayHandleUniformPointCoordinates>>
|
||||
{
|
||||
};
|
||||
|
||||
} // namespace internal
|
||||
|
||||
namespace detail
|
||||
{
|
||||
|
||||
template <typename ValueType, typename ListTagArrays>
|
||||
struct ArrayHandleMultiplexerChooseBaseImpl
|
||||
{
|
||||
VTKM_IS_LIST_TAG(ListTagArrays);
|
||||
|
||||
template <typename BrigandListArrays>
|
||||
struct BrigandListArraysToArrayHandleMultiplexerBase;
|
||||
|
||||
template <typename... ArrayHandleTypes>
|
||||
struct BrigandListArraysToArrayHandleMultiplexerBase<brigand::list<ArrayHandleTypes...>>
|
||||
{
|
||||
using Type = vtkm::cont::ArrayHandleMultiplexerBase<ValueType, ArrayHandleTypes...>;
|
||||
};
|
||||
|
||||
using Type = typename BrigandListArraysToArrayHandleMultiplexerBase<
|
||||
vtkm::internal::ListTagAsBrigandList<ListTagArrays>>::Type;
|
||||
};
|
||||
|
||||
template <typename ValueType>
|
||||
using ArrayHandleMultiplexerChooseBase = typename ArrayHandleMultiplexerChooseBaseImpl<
|
||||
ValueType,
|
||||
internal::ArrayHandleMultiplexerDefaultArrays<ValueType>>::Type;
|
||||
|
||||
} // namespace detail
|
||||
|
||||
/// \brief An ArrayHandle that can behave like several other handles.
|
||||
///
|
||||
/// An \c ArrayHandleMultiplexer simply redirects its calls to another \c ArrayHandle. However
|
||||
@ -568,58 +425,41 @@ using ArrayHandleMultiplexerChooseBase = typename ArrayHandleMultiplexerChooseBa
|
||||
/// see which type of array is currently stored in it. It then redirects to the \c ArrayHandle
|
||||
/// of the appropriate type.
|
||||
///
|
||||
/// The \c ArrayHandleMultiplexer template parameters are all the ArrayHandle types it
|
||||
/// should support.
|
||||
///
|
||||
/// If only one template parameter is given, it is assumed to be the \c ValueType of the
|
||||
/// array. A default list of supported arrays is supported (see
|
||||
/// \c vtkm::cont::internal::ArrayHandleMultiplexerDefaultArrays.) If multiple template
|
||||
/// parameters are given, they are all considered possible \c ArrayHandle types.
|
||||
///
|
||||
template <typename... Ts>
|
||||
class ArrayHandleMultiplexer;
|
||||
|
||||
template <typename ValueType_>
|
||||
class ArrayHandleMultiplexer<ValueType_>
|
||||
: public detail::ArrayHandleMultiplexerChooseBase<ValueType_>
|
||||
template <typename... ArrayHandleTypes>
|
||||
class ArrayHandleMultiplexer
|
||||
: public vtkm::cont::ArrayHandle<
|
||||
typename detail::ArrayHandleMultiplexerTraits<ArrayHandleTypes...>::ValueType,
|
||||
typename detail::ArrayHandleMultiplexerTraits<ArrayHandleTypes...>::StorageTag>
|
||||
{
|
||||
using Traits = detail::ArrayHandleMultiplexerTraits<ArrayHandleTypes...>;
|
||||
|
||||
public:
|
||||
VTKM_ARRAY_HANDLE_SUBCLASS(ArrayHandleMultiplexer,
|
||||
(ArrayHandleMultiplexer<ValueType_>),
|
||||
(detail::ArrayHandleMultiplexerChooseBase<ValueType_>));
|
||||
VTKM_ARRAY_HANDLE_SUBCLASS(
|
||||
ArrayHandleMultiplexer,
|
||||
(ArrayHandleMultiplexer<ArrayHandleTypes...>),
|
||||
(vtkm::cont::ArrayHandle<typename Traits::ValueType, typename Traits::StorageTag>));
|
||||
|
||||
template <typename RealT, typename RealStorageTag>
|
||||
VTKM_CONT ArrayHandleMultiplexer(const vtkm::cont::ArrayHandle<RealT, RealStorageTag>& src)
|
||||
: Superclass(src)
|
||||
{
|
||||
}
|
||||
private:
|
||||
using StorageType = vtkm::cont::internal::Storage<ValueType, StorageTag>;
|
||||
|
||||
template <typename RealT, typename RealStorageTag>
|
||||
VTKM_CONT ArrayHandleMultiplexer(vtkm::cont::ArrayHandle<RealT, RealStorageTag>&& rhs)
|
||||
: Superclass(std::move(rhs))
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
template <typename ArrayType0, typename... ArrayTypes>
|
||||
class ArrayHandleMultiplexer<ArrayType0, ArrayTypes...>
|
||||
: public vtkm::cont::ArrayHandleMultiplexerBase<typename ArrayType0::ValueType,
|
||||
ArrayType0,
|
||||
ArrayTypes...>
|
||||
{
|
||||
public:
|
||||
VTKM_ARRAY_HANDLE_SUBCLASS(ArrayHandleMultiplexer,
|
||||
(ArrayHandleMultiplexer<ArrayType0, ArrayTypes...>),
|
||||
(vtkm::cont::ArrayHandleMultiplexerBase<typename ArrayType0::ValueType,
|
||||
ArrayType0,
|
||||
ArrayTypes...>));
|
||||
|
||||
template <typename RealT, typename RealStorageTag>
|
||||
VTKM_CONT ArrayHandleMultiplexer(const vtkm::cont::ArrayHandle<RealT, RealStorageTag>& src)
|
||||
: Superclass(src)
|
||||
template <typename RealStorageTag>
|
||||
VTKM_CONT ArrayHandleMultiplexer(const vtkm::cont::ArrayHandle<ValueType, RealStorageTag>& src)
|
||||
: Superclass(StorageType(src))
|
||||
{
|
||||
}
|
||||
|
||||
template <typename RealT, typename RealStorageTag>
|
||||
VTKM_CONT ArrayHandleMultiplexer(vtkm::cont::ArrayHandle<RealT, RealStorageTag>&& rhs)
|
||||
: Superclass(std::move(rhs))
|
||||
template <typename RealStorageTag>
|
||||
VTKM_CONT ArrayHandleMultiplexer(vtkm::cont::ArrayHandle<ValueType, RealStorageTag>&& rhs)
|
||||
: Superclass(StorageType(std::move(rhs)))
|
||||
{
|
||||
}
|
||||
};
|
||||
|
@ -26,14 +26,14 @@ namespace cont
|
||||
///
|
||||
class VTKM_ALWAYS_EXPORT ArrayHandleUniformPointCoordinates
|
||||
: public vtkm::cont::ArrayHandle<
|
||||
vtkm::Vec<vtkm::FloatDefault, 3>,
|
||||
vtkm::Vec3f,
|
||||
vtkm::cont::StorageTagImplicit<vtkm::internal::ArrayPortalUniformPointCoordinates>>
|
||||
{
|
||||
public:
|
||||
VTKM_ARRAY_HANDLE_SUBCLASS_NT(
|
||||
ArrayHandleUniformPointCoordinates,
|
||||
(vtkm::cont::ArrayHandle<
|
||||
vtkm::Vec<vtkm::FloatDefault, 3>,
|
||||
vtkm::Vec3f,
|
||||
vtkm::cont::StorageTagImplicit<vtkm::internal::ArrayPortalUniformPointCoordinates>>));
|
||||
|
||||
private:
|
||||
@ -67,7 +67,7 @@ struct SerializableTypeString<vtkm::cont::ArrayHandleUniformPointCoordinates>
|
||||
|
||||
template <>
|
||||
struct SerializableTypeString<vtkm::cont::ArrayHandle<
|
||||
vtkm::Vec<vtkm::FloatDefault, 3>,
|
||||
vtkm::Vec3f,
|
||||
vtkm::cont::StorageTagImplicit<vtkm::internal::ArrayPortalUniformPointCoordinates>>>
|
||||
: SerializableTypeString<vtkm::cont::ArrayHandleUniformPointCoordinates>
|
||||
{
|
||||
@ -109,7 +109,7 @@ public:
|
||||
|
||||
template <>
|
||||
struct Serialization<vtkm::cont::ArrayHandle<
|
||||
vtkm::Vec<vtkm::FloatDefault, 3>,
|
||||
vtkm::Vec3f,
|
||||
vtkm::cont::StorageTagImplicit<vtkm::internal::ArrayPortalUniformPointCoordinates>>>
|
||||
: Serialization<vtkm::cont::ArrayHandleUniformPointCoordinates>
|
||||
{
|
||||
|
@ -29,16 +29,15 @@ namespace cont
|
||||
|
||||
/// ArrayHandleVirtualCoordinates is a specialization of ArrayHandle.
|
||||
class VTKM_ALWAYS_EXPORT ArrayHandleVirtualCoordinates final
|
||||
: public vtkm::cont::ArrayHandleVirtual<vtkm::Vec<vtkm::FloatDefault, 3>>
|
||||
: public vtkm::cont::ArrayHandleVirtual<vtkm::Vec3f>
|
||||
{
|
||||
public:
|
||||
VTKM_ARRAY_HANDLE_SUBCLASS_NT(ArrayHandleVirtualCoordinates,
|
||||
(vtkm::cont::ArrayHandleVirtual<vtkm::Vec<vtkm::FloatDefault, 3>>));
|
||||
(vtkm::cont::ArrayHandleVirtual<vtkm::Vec3f>));
|
||||
|
||||
template <typename T, typename S>
|
||||
explicit ArrayHandleVirtualCoordinates(const vtkm::cont::ArrayHandle<T, S>& ah)
|
||||
: vtkm::cont::ArrayHandleVirtual<vtkm::Vec<vtkm::FloatDefault, 3>>(
|
||||
vtkm::cont::make_ArrayHandleCast<ValueType>(ah))
|
||||
: vtkm::cont::ArrayHandleVirtual<vtkm::Vec3f>(vtkm::cont::make_ArrayHandleCast<ValueType>(ah))
|
||||
{
|
||||
}
|
||||
};
|
||||
@ -82,7 +81,7 @@ private:
|
||||
using Type = vtkm::cont::ArrayHandleVirtualCoordinates;
|
||||
using BaseType = vtkm::cont::ArrayHandle<typename Type::ValueType, typename Type::StorageTag>;
|
||||
|
||||
using BasicCoordsType = vtkm::cont::ArrayHandle<vtkm::Vec<vtkm::FloatDefault, 3>>;
|
||||
using BasicCoordsType = vtkm::cont::ArrayHandle<vtkm::Vec3f>;
|
||||
using RectilinearCoordsArrayType =
|
||||
vtkm::cont::ArrayHandleCartesianProduct<vtkm::cont::ArrayHandle<vtkm::FloatDefault>,
|
||||
vtkm::cont::ArrayHandle<vtkm::FloatDefault>,
|
||||
|
@ -73,7 +73,7 @@ VTKM_ARRAY_RANGE_COMPUTE_IMPL_VEC(vtkm::Float64, 4, vtkm::cont::StorageTagBasic)
|
||||
// to determine.
|
||||
VTKM_CONT
|
||||
vtkm::cont::ArrayHandle<vtkm::Range> ArrayRangeCompute(
|
||||
const vtkm::cont::ArrayHandle<vtkm::Vec<vtkm::FloatDefault, 3>,
|
||||
const vtkm::cont::ArrayHandle<vtkm::Vec3f,
|
||||
vtkm::cont::ArrayHandleUniformPointCoordinates::StorageTag>& array,
|
||||
vtkm::cont::DeviceAdapterId)
|
||||
{
|
||||
@ -81,8 +81,8 @@ vtkm::cont::ArrayHandle<vtkm::Range> ArrayRangeCompute(
|
||||
|
||||
// In this portal we know that the min value is the first entry and the
|
||||
// max value is the last entry.
|
||||
vtkm::Vec<vtkm::FloatDefault, 3> minimum = portal.Get(0);
|
||||
vtkm::Vec<vtkm::FloatDefault, 3> maximum = portal.Get(portal.GetNumberOfValues() - 1);
|
||||
vtkm::Vec3f minimum = portal.Get(0);
|
||||
vtkm::Vec3f maximum = portal.Get(portal.GetNumberOfValues() - 1);
|
||||
|
||||
vtkm::cont::ArrayHandle<vtkm::Range> rangeArray;
|
||||
rangeArray.Allocate(3);
|
||||
|
@ -89,11 +89,11 @@ VTKM_ARRAY_RANGE_COMPUTE_EXPORT_VEC(vtkm::Float64, 4, vtkm::cont::StorageTagBasi
|
||||
|
||||
VTKM_CONT
|
||||
vtkm::cont::ArrayHandle<vtkm::Range> ArrayRangeCompute(
|
||||
const vtkm::cont::ArrayHandleVirtual<vtkm::Vec<vtkm::FloatDefault, 3>>& input,
|
||||
const vtkm::cont::ArrayHandleVirtual<vtkm::Vec3f>& input,
|
||||
vtkm::cont::DeviceAdapterId device = vtkm::cont::DeviceAdapterTagAny());
|
||||
|
||||
VTKM_CONT_EXPORT VTKM_CONT vtkm::cont::ArrayHandle<vtkm::Range> ArrayRangeCompute(
|
||||
const vtkm::cont::ArrayHandle<vtkm::Vec<vtkm::FloatDefault, 3>,
|
||||
const vtkm::cont::ArrayHandle<vtkm::Vec3f,
|
||||
vtkm::cont::ArrayHandleUniformPointCoordinates::StorageTag>& array,
|
||||
vtkm::cont::DeviceAdapterId device = vtkm::cont::DeviceAdapterTagAny());
|
||||
|
||||
@ -101,7 +101,7 @@ VTKM_CONT_EXPORT VTKM_CONT vtkm::cont::ArrayHandle<vtkm::Range> ArrayRangeComput
|
||||
VTKM_CONT_EXPORT
|
||||
VTKM_CONT
|
||||
vtkm::cont::ArrayHandle<vtkm::Range> ArrayRangeCompute(
|
||||
const vtkm::cont::ArrayHandle<vtkm::Vec<vtkm::Float32, 3>,
|
||||
const vtkm::cont::ArrayHandle<vtkm::Vec3f_32,
|
||||
typename vtkm::cont::ArrayHandleCompositeVector<
|
||||
vtkm::cont::ArrayHandle<vtkm::Float32>,
|
||||
vtkm::cont::ArrayHandle<vtkm::Float32>,
|
||||
@ -109,7 +109,7 @@ vtkm::cont::ArrayHandle<vtkm::Range> ArrayRangeCompute(
|
||||
vtkm::cont::DeviceAdapterId device = vtkm::cont::DeviceAdapterTagAny());
|
||||
|
||||
VTKM_CONT_EXPORT VTKM_CONT vtkm::cont::ArrayHandle<vtkm::Range> ArrayRangeCompute(
|
||||
const vtkm::cont::ArrayHandle<vtkm::Vec<vtkm::Float64, 3>,
|
||||
const vtkm::cont::ArrayHandle<vtkm::Vec3f_64,
|
||||
typename vtkm::cont::ArrayHandleCompositeVector<
|
||||
vtkm::cont::ArrayHandle<vtkm::Float64>,
|
||||
vtkm::cont::ArrayHandle<vtkm::Float64>,
|
||||
|
@ -96,7 +96,7 @@ inline vtkm::cont::ArrayHandle<vtkm::Range> ArrayRangeComputeImpl(
|
||||
|
||||
VTKM_CONT
|
||||
inline vtkm::cont::ArrayHandle<vtkm::Range> ArrayRangeCompute(
|
||||
const vtkm::cont::ArrayHandleVirtual<vtkm::Vec<vtkm::FloatDefault, 3>>& input,
|
||||
const vtkm::cont::ArrayHandleVirtual<vtkm::Vec3f>& input,
|
||||
vtkm::cont::DeviceAdapterId device)
|
||||
{
|
||||
using UniformHandleType = ArrayHandleUniformPointCoordinates;
|
||||
|
@ -31,7 +31,7 @@ namespace cl_uniform_bins
|
||||
|
||||
using DimensionType = vtkm::Int16;
|
||||
using DimVec3 = vtkm::Vec<DimensionType, 3>;
|
||||
using FloatVec3 = vtkm::Vec<vtkm::FloatDefault, 3>;
|
||||
using FloatVec3 = vtkm::Vec3f;
|
||||
|
||||
struct Grid
|
||||
{
|
||||
|
@ -33,8 +33,8 @@ protected:
|
||||
|
||||
private:
|
||||
vtkm::Bounds Bounds;
|
||||
vtkm::Vec<vtkm::FloatDefault, 3> RangeTransform;
|
||||
vtkm::Vec<vtkm::Id, 3> CellDims;
|
||||
vtkm::Vec3f RangeTransform;
|
||||
vtkm::Id3 CellDims;
|
||||
|
||||
mutable vtkm::cont::VirtualObjectHandle<vtkm::exec::CellLocator> ExecutionObjectHandle;
|
||||
};
|
||||
|
@ -513,14 +513,14 @@ public:
|
||||
/// vtkm::cont::ColorTableSamplesRGBA samples;
|
||||
/// vtkm::cont::ColorTable table("black-body radiation");
|
||||
/// table.Sample(256, samples);
|
||||
/// vtkm::cont::ArrayHandle<vtkm::Vec<vtkm::UInt8, 4>> colors;
|
||||
/// vtkm::cont::ArrayHandle<vtkm::Vec4ui_8> colors;
|
||||
/// table.Map(input, samples, colors);
|
||||
///
|
||||
/// \endcode
|
||||
template <typename T, typename S>
|
||||
inline bool Map(const vtkm::cont::ArrayHandle<T, S>& values,
|
||||
const vtkm::cont::ColorTableSamplesRGBA& samples,
|
||||
vtkm::cont::ArrayHandle<vtkm::Vec<vtkm::UInt8, 4>>& rgbaOut) const;
|
||||
vtkm::cont::ArrayHandle<vtkm::Vec4ui_8>& 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<vtkm::Vec<vtkm::UInt8, 3>> colors;
|
||||
/// vtkm::cont::ArrayHandle<vtkm::Vec3ui_8> colors;
|
||||
/// table.Map(input, samples, colors);
|
||||
///
|
||||
/// \endcode
|
||||
template <typename T, typename S>
|
||||
inline bool Map(const vtkm::cont::ArrayHandle<T, S>& values,
|
||||
const vtkm::cont::ColorTableSamplesRGB& samples,
|
||||
vtkm::cont::ArrayHandle<vtkm::Vec<vtkm::UInt8, 3>>& rgbaOut) const;
|
||||
vtkm::cont::ArrayHandle<vtkm::Vec3ui_8>& rgbaOut) const;
|
||||
|
||||
/// \brief Use magnitude of a vector with a sample table to generate RGBA colors
|
||||
///
|
||||
template <typename T, int N, typename S>
|
||||
inline bool MapMagnitude(const vtkm::cont::ArrayHandle<vtkm::Vec<T, N>, S>& values,
|
||||
const vtkm::cont::ColorTableSamplesRGBA& samples,
|
||||
vtkm::cont::ArrayHandle<vtkm::Vec<vtkm::UInt8, 4>>& rgbaOut) const;
|
||||
vtkm::cont::ArrayHandle<vtkm::Vec4ui_8>& rgbaOut) const;
|
||||
|
||||
/// \brief Use magnitude of a vector with a sample table to generate RGB colors
|
||||
///
|
||||
template <typename T, int N, typename S>
|
||||
inline bool MapMagnitude(const vtkm::cont::ArrayHandle<vtkm::Vec<T, N>, S>& values,
|
||||
const vtkm::cont::ColorTableSamplesRGB& samples,
|
||||
vtkm::cont::ArrayHandle<vtkm::Vec<vtkm::UInt8, 3>>& rgbaOut) const;
|
||||
vtkm::cont::ArrayHandle<vtkm::Vec3ui_8>& 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<vtkm::Vec<T, N>, S>& values,
|
||||
vtkm::IdComponent comp,
|
||||
const vtkm::cont::ColorTableSamplesRGBA& samples,
|
||||
vtkm::cont::ArrayHandle<vtkm::Vec<vtkm::UInt8, 4>>& rgbaOut) const;
|
||||
vtkm::cont::ArrayHandle<vtkm::Vec4ui_8>& 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<vtkm::Vec<T, N>, S>& values,
|
||||
vtkm::IdComponent comp,
|
||||
const vtkm::cont::ColorTableSamplesRGB& samples,
|
||||
vtkm::cont::ArrayHandle<vtkm::Vec<vtkm::UInt8, 3>>& rgbOut) const;
|
||||
vtkm::cont::ArrayHandle<vtkm::Vec3ui_8>& 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 <typename T, typename S>
|
||||
inline bool Map(const vtkm::cont::ArrayHandle<T, S>& values,
|
||||
vtkm::cont::ArrayHandle<vtkm::Vec<vtkm::UInt8, 4>>& rgbaOut) const;
|
||||
vtkm::cont::ArrayHandle<vtkm::Vec4ui_8>& 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 <typename T, typename S>
|
||||
inline bool Map(const vtkm::cont::ArrayHandle<T, S>& values,
|
||||
vtkm::cont::ArrayHandle<vtkm::Vec<vtkm::UInt8, 3>>& rgbOut) const;
|
||||
vtkm::cont::ArrayHandle<vtkm::Vec3ui_8>& rgbOut) const;
|
||||
|
||||
/// \brief Use magnitude of a vector to generate RGBA colors
|
||||
///
|
||||
template <typename T, int N, typename S>
|
||||
inline bool MapMagnitude(const vtkm::cont::ArrayHandle<vtkm::Vec<T, N>, S>& values,
|
||||
vtkm::cont::ArrayHandle<vtkm::Vec<vtkm::UInt8, 4>>& rgbaOut) const;
|
||||
vtkm::cont::ArrayHandle<vtkm::Vec4ui_8>& rgbaOut) const;
|
||||
|
||||
/// \brief Use magnitude of a vector to generate RGB colors
|
||||
///
|
||||
template <typename T, int N, typename S>
|
||||
inline bool MapMagnitude(const vtkm::cont::ArrayHandle<vtkm::Vec<T, N>, S>& values,
|
||||
vtkm::cont::ArrayHandle<vtkm::Vec<vtkm::UInt8, 3>>& rgbOut) const;
|
||||
vtkm::cont::ArrayHandle<vtkm::Vec3ui_8>& rgbOut) const;
|
||||
|
||||
/// \brief Use a single component of a vector to generate RGBA colors
|
||||
///
|
||||
template <typename T, int N, typename S>
|
||||
inline bool MapComponent(const vtkm::cont::ArrayHandle<vtkm::Vec<T, N>, S>& values,
|
||||
vtkm::IdComponent comp,
|
||||
vtkm::cont::ArrayHandle<vtkm::Vec<vtkm::UInt8, 4>>& rgbaOut) const;
|
||||
vtkm::cont::ArrayHandle<vtkm::Vec4ui_8>& rgbaOut) const;
|
||||
|
||||
/// \brief Use a single component of a vector to generate RGB colors
|
||||
///
|
||||
template <typename T, int N, typename S>
|
||||
inline bool MapComponent(const vtkm::cont::ArrayHandle<vtkm::Vec<T, N>, S>& values,
|
||||
vtkm::IdComponent comp,
|
||||
vtkm::cont::ArrayHandle<vtkm::Vec<vtkm::UInt8, 3>>& rgbOut) const;
|
||||
vtkm::cont::ArrayHandle<vtkm::Vec3ui_8>& 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<vtkm::Vec<vtkm::UInt8, 4>>& colors,
|
||||
vtkm::cont::ArrayHandle<vtkm::Vec4ui_8>& 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<vtkm::Vec<vtkm::UInt8, 3>>& colors,
|
||||
vtkm::cont::ArrayHandle<vtkm::Vec3ui_8>& colors,
|
||||
double tolerance = 0.002) const;
|
||||
|
||||
|
||||
|
@ -90,7 +90,7 @@ struct map_color_table
|
||||
template <typename T, typename S>
|
||||
bool ColorTable::Map(const vtkm::cont::ArrayHandle<T, S>& values,
|
||||
const vtkm::cont::ColorTableSamplesRGBA& samples,
|
||||
vtkm::cont::ArrayHandle<vtkm::Vec<vtkm::UInt8, 4>>& rgbaOut) const
|
||||
vtkm::cont::ArrayHandle<vtkm::Vec4ui_8>& rgbaOut) const
|
||||
{
|
||||
if (samples.NumberOfSamples <= 0)
|
||||
{
|
||||
@ -105,7 +105,7 @@ bool ColorTable::Map(const vtkm::cont::ArrayHandle<T, S>& values,
|
||||
template <typename T, typename S>
|
||||
bool ColorTable::Map(const vtkm::cont::ArrayHandle<T, S>& values,
|
||||
const vtkm::cont::ColorTableSamplesRGB& samples,
|
||||
vtkm::cont::ArrayHandle<vtkm::Vec<vtkm::UInt8, 3>>& rgbOut) const
|
||||
vtkm::cont::ArrayHandle<vtkm::Vec3ui_8>& rgbOut) const
|
||||
{
|
||||
if (samples.NumberOfSamples <= 0)
|
||||
{
|
||||
@ -120,7 +120,7 @@ bool ColorTable::Map(const vtkm::cont::ArrayHandle<T, S>& values,
|
||||
template <typename T, int N, typename S>
|
||||
bool ColorTable::MapMagnitude(const vtkm::cont::ArrayHandle<vtkm::Vec<T, N>, S>& values,
|
||||
const vtkm::cont::ColorTableSamplesRGBA& samples,
|
||||
vtkm::cont::ArrayHandle<vtkm::Vec<vtkm::UInt8, 4>>& rgbaOut) const
|
||||
vtkm::cont::ArrayHandle<vtkm::Vec4ui_8>& rgbaOut) const
|
||||
{
|
||||
using namespace vtkm::worklet::colorconversion;
|
||||
return this->Map(
|
||||
@ -131,7 +131,7 @@ bool ColorTable::MapMagnitude(const vtkm::cont::ArrayHandle<vtkm::Vec<T, N>, S>&
|
||||
template <typename T, int N, typename S>
|
||||
bool ColorTable::MapMagnitude(const vtkm::cont::ArrayHandle<vtkm::Vec<T, N>, S>& values,
|
||||
const vtkm::cont::ColorTableSamplesRGB& samples,
|
||||
vtkm::cont::ArrayHandle<vtkm::Vec<vtkm::UInt8, 3>>& rgbOut) const
|
||||
vtkm::cont::ArrayHandle<vtkm::Vec3ui_8>& rgbOut) const
|
||||
{
|
||||
using namespace vtkm::worklet::colorconversion;
|
||||
return this->Map(
|
||||
@ -142,7 +142,7 @@ template <typename T, int N, typename S>
|
||||
bool ColorTable::MapComponent(const vtkm::cont::ArrayHandle<vtkm::Vec<T, N>, S>& values,
|
||||
vtkm::IdComponent comp,
|
||||
const vtkm::cont::ColorTableSamplesRGBA& samples,
|
||||
vtkm::cont::ArrayHandle<vtkm::Vec<vtkm::UInt8, 4>>& rgbaOut) const
|
||||
vtkm::cont::ArrayHandle<vtkm::Vec4ui_8>& rgbaOut) const
|
||||
{
|
||||
using namespace vtkm::worklet::colorconversion;
|
||||
return this->Map(
|
||||
@ -153,7 +153,7 @@ template <typename T, int N, typename S>
|
||||
bool ColorTable::MapComponent(const vtkm::cont::ArrayHandle<vtkm::Vec<T, N>, S>& values,
|
||||
vtkm::IdComponent comp,
|
||||
const vtkm::cont::ColorTableSamplesRGB& samples,
|
||||
vtkm::cont::ArrayHandle<vtkm::Vec<vtkm::UInt8, 3>>& rgbOut) const
|
||||
vtkm::cont::ArrayHandle<vtkm::Vec3ui_8>& rgbOut) const
|
||||
{
|
||||
using namespace vtkm::worklet::colorconversion;
|
||||
return this->Map(
|
||||
@ -163,21 +163,21 @@ bool ColorTable::MapComponent(const vtkm::cont::ArrayHandle<vtkm::Vec<T, N>, S>&
|
||||
//---------------------------------------------------------------------------
|
||||
template <typename T, typename S>
|
||||
bool ColorTable::Map(const vtkm::cont::ArrayHandle<T, S>& values,
|
||||
vtkm::cont::ArrayHandle<vtkm::Vec<vtkm::UInt8, 4>>& rgbaOut) const
|
||||
vtkm::cont::ArrayHandle<vtkm::Vec4ui_8>& rgbaOut) const
|
||||
{
|
||||
return vtkm::cont::TryExecute(detail::map_color_table{}, this, values, rgbaOut);
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
template <typename T, typename S>
|
||||
bool ColorTable::Map(const vtkm::cont::ArrayHandle<T, S>& values,
|
||||
vtkm::cont::ArrayHandle<vtkm::Vec<vtkm::UInt8, 3>>& rgbOut) const
|
||||
vtkm::cont::ArrayHandle<vtkm::Vec3ui_8>& rgbOut) const
|
||||
{
|
||||
return vtkm::cont::TryExecute(detail::map_color_table{}, this, values, rgbOut);
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
template <typename T, int N, typename S>
|
||||
bool ColorTable::MapMagnitude(const vtkm::cont::ArrayHandle<vtkm::Vec<T, N>, S>& values,
|
||||
vtkm::cont::ArrayHandle<vtkm::Vec<vtkm::UInt8, 4>>& rgbaOut) const
|
||||
vtkm::cont::ArrayHandle<vtkm::Vec4ui_8>& 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<vtkm::Vec<T, N>, S>&
|
||||
//---------------------------------------------------------------------------
|
||||
template <typename T, int N, typename S>
|
||||
bool ColorTable::MapMagnitude(const vtkm::cont::ArrayHandle<vtkm::Vec<T, N>, S>& values,
|
||||
vtkm::cont::ArrayHandle<vtkm::Vec<vtkm::UInt8, 3>>& rgbOut) const
|
||||
vtkm::cont::ArrayHandle<vtkm::Vec3ui_8>& 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<vtkm::Vec<T, N>, S>&
|
||||
template <typename T, int N, typename S>
|
||||
bool ColorTable::MapComponent(const vtkm::cont::ArrayHandle<vtkm::Vec<T, N>, S>& values,
|
||||
vtkm::IdComponent comp,
|
||||
vtkm::cont::ArrayHandle<vtkm::Vec<vtkm::UInt8, 4>>& rgbaOut) const
|
||||
vtkm::cont::ArrayHandle<vtkm::Vec4ui_8>& 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<vtkm::Vec<T, N>, S>&
|
||||
template <typename T, int N, typename S>
|
||||
bool ColorTable::MapComponent(const vtkm::cont::ArrayHandle<vtkm::Vec<T, N>, S>& values,
|
||||
vtkm::IdComponent comp,
|
||||
vtkm::cont::ArrayHandle<vtkm::Vec<vtkm::UInt8, 3>>& rgbOut) const
|
||||
vtkm::cont::ArrayHandle<vtkm::Vec3ui_8>& 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<vtkm::Vec<vtkm::UInt8, 4>>& colors,
|
||||
vtkm::cont::ArrayHandle<vtkm::Vec4ui_8>& 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<vtkm::Vec<vtkm::UInt8, 3>>& colors,
|
||||
vtkm::cont::ArrayHandle<vtkm::Vec3ui_8>& colors,
|
||||
double tolerance) const
|
||||
{
|
||||
if (numSamples <= 1)
|
||||
|
@ -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<vtkm::Vec<vtkm::UInt8, 4>> Samples;
|
||||
vtkm::cont::ArrayHandle<vtkm::Vec4ui_8> 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<vtkm::Vec<vtkm::UInt8, 3>> Samples;
|
||||
vtkm::cont::ArrayHandle<vtkm::Vec3ui_8> Samples;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
@ -24,7 +24,7 @@ VTKM_CONT CoordinateSystem::CoordinateSystem()
|
||||
|
||||
VTKM_CONT CoordinateSystem::CoordinateSystem(
|
||||
std::string name,
|
||||
const vtkm::cont::ArrayHandleVirtual<vtkm::Vec<vtkm::FloatDefault, 3>>& data)
|
||||
const vtkm::cont::ArrayHandleVirtual<vtkm::Vec3f>& 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<vtkm::FloatDefault, 3> origin,
|
||||
vtkm::Vec<vtkm::FloatDefault, 3> 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<vtkm::Vec<vtkm::FloatDefault, 3>>& newdata)
|
||||
void CoordinateSystem::SetData(const vtkm::cont::ArrayHandleVirtual<vtkm::Vec3f>& 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::FloatDefault, 3>,
|
||||
vtkm::Vec3f,
|
||||
vtkm::cont::StorageTagImplicit<vtkm::internal::ArrayPortalUniformPointCoordinates>>&);
|
||||
template VTKM_CONT_EXPORT CoordinateSystem::CoordinateSystem(
|
||||
std::string name,
|
||||
const vtkm::cont::ArrayHandle<
|
||||
vtkm::Vec<vtkm::Float32, 3>,
|
||||
vtkm::Vec3f_32,
|
||||
vtkm::cont::internal::StorageTagCartesianProduct<
|
||||
vtkm::cont::ArrayHandle<vtkm::Float32, vtkm::cont::StorageTagBasic>,
|
||||
vtkm::cont::ArrayHandle<vtkm::Float32, vtkm::cont::StorageTagBasic>,
|
||||
@ -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::Float64, 3>,
|
||||
vtkm::Vec3f_64,
|
||||
vtkm::cont::internal::StorageTagCartesianProduct<
|
||||
vtkm::cont::ArrayHandle<vtkm::Float64, vtkm::cont::StorageTagBasic>,
|
||||
vtkm::cont::ArrayHandle<vtkm::Float64, vtkm::cont::StorageTagBasic>,
|
||||
@ -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::Float32, 3>,
|
||||
vtkm::Vec3f_32,
|
||||
typename vtkm::cont::ArrayHandleCompositeVector<
|
||||
vtkm::cont::ArrayHandle<vtkm::Float32, vtkm::cont::StorageTagBasic>,
|
||||
vtkm::cont::ArrayHandle<vtkm::Float32, vtkm::cont::StorageTagBasic>,
|
||||
@ -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::Float64, 3>,
|
||||
vtkm::Vec3f_64,
|
||||
typename vtkm::cont::ArrayHandleCompositeVector<
|
||||
vtkm::cont::ArrayHandle<vtkm::Float64, vtkm::cont::StorageTagBasic>,
|
||||
vtkm::cont::ArrayHandle<vtkm::Float64, vtkm::cont::StorageTagBasic>,
|
||||
|
@ -31,9 +31,8 @@ public:
|
||||
VTKM_CONT
|
||||
CoordinateSystem();
|
||||
|
||||
VTKM_CONT CoordinateSystem(
|
||||
std::string name,
|
||||
const vtkm::cont::ArrayHandleVirtual<vtkm::Vec<vtkm::FloatDefault, 3>>& data);
|
||||
VTKM_CONT CoordinateSystem(std::string name,
|
||||
const vtkm::cont::ArrayHandleVirtual<vtkm::Vec3f>& data);
|
||||
|
||||
template <typename TypeList>
|
||||
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<vtkm::FloatDefault, 3> origin = vtkm::Vec<vtkm::FloatDefault, 3>(0.0f, 0.0f, 0.0f),
|
||||
vtkm::Vec<vtkm::FloatDefault, 3> spacing = vtkm::Vec<vtkm::FloatDefault, 3>(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<vtkm::Vec<vtkm::FloatDefault, 3>>& newdata);
|
||||
VTKM_CONT void SetData(const vtkm::cont::ArrayHandleVirtual<vtkm::Vec3f>& newdata);
|
||||
|
||||
template <typename T, typename Storage>
|
||||
VTKM_CONT void SetData(const vtkm::cont::ArrayHandle<T, Storage>& newdata);
|
||||
|
@ -22,17 +22,15 @@ namespace detail
|
||||
struct MakeArrayHandleVirtualCoordinatesFunctor
|
||||
{
|
||||
template <typename StorageTag>
|
||||
VTKM_CONT void operator()(
|
||||
const vtkm::cont::ArrayHandle<vtkm::Vec<vtkm::Float32, 3>, StorageTag>& array,
|
||||
ArrayHandleVirtualCoordinates& output) const
|
||||
VTKM_CONT void operator()(const vtkm::cont::ArrayHandle<vtkm::Vec3f_32, StorageTag>& array,
|
||||
ArrayHandleVirtualCoordinates& output) const
|
||||
{
|
||||
output = vtkm::cont::ArrayHandleVirtualCoordinates(array);
|
||||
}
|
||||
|
||||
template <typename StorageTag>
|
||||
VTKM_CONT void operator()(
|
||||
const vtkm::cont::ArrayHandle<vtkm::Vec<vtkm::Float64, 3>, StorageTag>& array,
|
||||
ArrayHandleVirtualCoordinates& output) const
|
||||
VTKM_CONT void operator()(const vtkm::cont::ArrayHandle<vtkm::Vec3f_64, StorageTag>& array,
|
||||
ArrayHandleVirtualCoordinates& output) const
|
||||
{
|
||||
output = vtkm::cont::ArrayHandleVirtualCoordinates(array);
|
||||
}
|
||||
|
@ -42,7 +42,7 @@ vtkm::cont::DataSet DataSetBuilderExplicitIterative::Create()
|
||||
}
|
||||
|
||||
VTKM_CONT
|
||||
vtkm::Id DataSetBuilderExplicitIterative::AddPoint(const vtkm::Vec<vtkm::Float32, 3>& pt)
|
||||
vtkm::Id DataSetBuilderExplicitIterative::AddPoint(const vtkm::Vec3f_32& pt)
|
||||
{
|
||||
points.push_back(pt);
|
||||
vtkm::Id id = static_cast<vtkm::Id>(points.size());
|
||||
|
@ -317,7 +317,7 @@ public:
|
||||
vtkm::cont::DataSet Create();
|
||||
|
||||
VTKM_CONT
|
||||
vtkm::Id AddPoint(const vtkm::Vec<vtkm::Float32, 3>& 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 <typename T>
|
||||
VTKM_CONT vtkm::Id AddPoint(const vtkm::Vec<T, 3>& pt)
|
||||
{
|
||||
return AddPoint(static_cast<vtkm::Vec<vtkm::Float32, 3>>(pt));
|
||||
return AddPoint(static_cast<vtkm::Vec3f_32>(pt));
|
||||
}
|
||||
|
||||
//Define cells.
|
||||
@ -351,7 +351,7 @@ public:
|
||||
private:
|
||||
std::string coordNm, cellNm;
|
||||
|
||||
std::vector<vtkm::Vec<vtkm::Float32, 3>> points;
|
||||
std::vector<vtkm::Vec3f_32> points;
|
||||
std::vector<vtkm::UInt8> shapes;
|
||||
std::vector<vtkm::IdComponent> numIdx;
|
||||
std::vector<vtkm::Id> connectivity;
|
||||
|
@ -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<vtkm::FloatDefault, 3>& origin,
|
||||
const vtkm::Vec<vtkm::FloatDefault, 3>& 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;
|
||||
|
@ -20,7 +20,7 @@ namespace cont
|
||||
|
||||
class VTKM_CONT_EXPORT DataSetBuilderUniform
|
||||
{
|
||||
using VecType = vtkm::Vec<vtkm::FloatDefault, 3>;
|
||||
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<vtkm::FloatDefault, 3>& origin,
|
||||
const vtkm::Vec<vtkm::FloatDefault, 3>& spacing,
|
||||
const vtkm::Vec3f& origin,
|
||||
const vtkm::Vec3f& spacing,
|
||||
std::string coordNm,
|
||||
std::string cellNm);
|
||||
};
|
||||
|
@ -35,9 +35,7 @@ public:
|
||||
using ExecutionSignature = void(_1, _2);
|
||||
|
||||
VTKM_CONT
|
||||
BinPointsWorklet(vtkm::Vec<vtkm::FloatDefault, 3> min,
|
||||
vtkm::Vec<vtkm::FloatDefault, 3> max,
|
||||
vtkm::Vec<vtkm::Id, 3> 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 <typename CoordVecType, typename IdType>
|
||||
VTKM_EXEC void operator()(const CoordVecType& coord, IdType& label) const
|
||||
{
|
||||
vtkm::Vec<vtkm::Id, 3> 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<vtkm::FloatDefault, 3> Min;
|
||||
vtkm::Vec<vtkm::Id, 3> Dims;
|
||||
vtkm::Vec<vtkm::FloatDefault, 3> Dxdydz;
|
||||
vtkm::Vec3f Min;
|
||||
vtkm::Id3 Dims;
|
||||
vtkm::Vec3f Dxdydz;
|
||||
};
|
||||
|
||||
} // internal
|
||||
|
@ -135,7 +135,7 @@ inline vtkm::cont::DataSet MakeTestDataSet::Make1DUniformDataSet2()
|
||||
inline vtkm::cont::DataSet MakeTestDataSet::Make1DExplicitDataSet0()
|
||||
{
|
||||
const int nVerts = 5;
|
||||
using CoordType = vtkm::Vec<vtkm::Float32, 3>;
|
||||
using CoordType = vtkm::Vec3f_32;
|
||||
std::vector<CoordType> 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<vtkm::Float32, 3>;
|
||||
using CoordType = vtkm::Vec3f_32;
|
||||
std::vector<CoordType> 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<vtkm::Float32, 3>;
|
||||
using CoordType = vtkm::Vec3f_32;
|
||||
std::vector<CoordType> 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<vtkm::Float32, 3>;
|
||||
using CoordType = vtkm::Vec3f_32;
|
||||
std::vector<CoordType> 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<vtkm::Float32, 3>;
|
||||
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<vtkm::Float32, 3>;
|
||||
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<vtkm::Float32, 3>;
|
||||
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<vtkm::Id, 4> 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<vtkm::Float32, 3>;
|
||||
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<vtkm::Float32, 3>;
|
||||
using CoordType = vtkm::Vec3f_32;
|
||||
std::vector<CoordType> 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<vtkm::Float32, 3>;
|
||||
using CoordType = vtkm::Vec3f_32;
|
||||
|
||||
std::vector<CoordType> coords =
|
||||
|
||||
@ -1288,7 +1288,7 @@ inline vtkm::cont::DataSet MakeTestDataSet::Make3DExplicitDataSet7()
|
||||
const int nVerts = 8;
|
||||
const int nCells = 8;
|
||||
|
||||
using CoordType = vtkm::Vec<vtkm::Float32, 3>;
|
||||
using CoordType = vtkm::Vec3f_32;
|
||||
std::vector<CoordType> 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<vtkm::Float32, 3>;
|
||||
using CoordType = vtkm::Vec3f_32;
|
||||
std::vector<CoordType> 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<vtkm::Float32, 3>;
|
||||
using CoordType = vtkm::Vec3f_32;
|
||||
std::vector<CoordType> 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<vtkm::Float64, 3>;
|
||||
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),
|
||||
|
@ -86,63 +86,7 @@ class TestingArrayHandleMultiplexer
|
||||
CheckArray(multiplexer, array3);
|
||||
}
|
||||
|
||||
static void DefaultScalar()
|
||||
{
|
||||
std::cout << std::endl << "--- Default list for scalars" << std::endl;
|
||||
|
||||
using ValueType = vtkm::FloatDefault;
|
||||
|
||||
vtkm::cont::ArrayHandleMultiplexer<ValueType> multiplexer;
|
||||
|
||||
std::cout << "Basic array type." << std::endl;
|
||||
vtkm::cont::ArrayHandle<ValueType> baseArray;
|
||||
baseArray.Allocate(ARRAY_SIZE);
|
||||
SetPortal(baseArray.GetPortalControl());
|
||||
multiplexer = baseArray;
|
||||
CheckArray(multiplexer, baseArray);
|
||||
|
||||
std::cout << "Cast array type." << std::endl;
|
||||
vtkm::cont::ArrayHandle<vtkm::UInt8> castArray;
|
||||
castArray.Allocate(ARRAY_SIZE);
|
||||
SetPortal(castArray.GetPortalControl());
|
||||
multiplexer = vtkm::cont::make_ArrayHandleCast<ValueType>(castArray);
|
||||
CheckArray(multiplexer, castArray);
|
||||
}
|
||||
|
||||
static void DefaultVec3()
|
||||
{
|
||||
std::cout << std::endl << "--- Default list for Vec3" << std::endl;
|
||||
|
||||
using ValueType = vtkm::Vec<vtkm::FloatDefault, 3>;
|
||||
|
||||
vtkm::cont::ArrayHandleMultiplexer<ValueType> multiplexer;
|
||||
|
||||
std::cout << "Basic array type." << std::endl;
|
||||
vtkm::cont::ArrayHandle<ValueType> baseArray;
|
||||
baseArray.Allocate(ARRAY_SIZE);
|
||||
SetPortal(baseArray.GetPortalControl());
|
||||
multiplexer = baseArray;
|
||||
CheckArray(multiplexer, baseArray);
|
||||
|
||||
std::cout << "Cast array type." << std::endl;
|
||||
vtkm::cont::ArrayHandle<vtkm::Vec<vtkm::UInt8, 3>> castArray;
|
||||
castArray.Allocate(ARRAY_SIZE);
|
||||
SetPortal(castArray.GetPortalControl());
|
||||
multiplexer = vtkm::cont::make_ArrayHandleCast<ValueType>(castArray);
|
||||
CheckArray(multiplexer, castArray);
|
||||
|
||||
std::cout << "Uniform point coordinates" << std::endl;
|
||||
vtkm::cont::ArrayHandleUniformPointCoordinates uniformCoords(vtkm::Id3(3));
|
||||
multiplexer = uniformCoords;
|
||||
CheckArray(multiplexer, uniformCoords);
|
||||
}
|
||||
|
||||
static void TestAll()
|
||||
{
|
||||
BasicSwitch();
|
||||
DefaultScalar();
|
||||
DefaultVec3();
|
||||
}
|
||||
static void TestAll() { BasicSwitch(); }
|
||||
|
||||
public:
|
||||
static int Run(int argc, char* argv[])
|
||||
|
@ -80,7 +80,7 @@ private:
|
||||
|
||||
static void TestAll()
|
||||
{
|
||||
using PointType = vtkm::Vec<vtkm::FloatDefault, 3>;
|
||||
using PointType = vtkm::Vec3f;
|
||||
static constexpr vtkm::Id length = 64;
|
||||
|
||||
vtkm::cont::ArrayHandle<PointType> out;
|
||||
|
@ -35,7 +35,7 @@ public:
|
||||
using RectilinearPortalType =
|
||||
typename RectilinearType::template ExecutionTypes<DeviceAdapter>::PortalConst;
|
||||
|
||||
LocatorWorklet(vtkm::Bounds& bounds, vtkm::Vec<vtkm::Id, 3>& 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<vtkm::Id, 3> 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<vtkm::Id, 3> 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<vtkm::Id, 3> dims =
|
||||
vtkm::Id3 dims =
|
||||
cellSet.Cast<StructuredType>().GetSchedulingRange(vtkm::TopologyElementTagPoint());
|
||||
std::cout << "Dimensions of dataset : " << dims << std::endl;
|
||||
|
||||
// Generate some sample points.
|
||||
using PointType = vtkm::Vec<vtkm::FloatDefault, 3>;
|
||||
using PointType = vtkm::Vec3f;
|
||||
std::vector<PointType> pointsVec;
|
||||
std::default_random_engine dre;
|
||||
std::uniform_real_distribution<vtkm::Float32> xCoords(0.0f, 4.0f);
|
||||
|
@ -33,7 +33,7 @@
|
||||
namespace
|
||||
{
|
||||
|
||||
using PointType = vtkm::Vec<vtkm::FloatDefault, 3>;
|
||||
using PointType = vtkm::Vec3f;
|
||||
|
||||
std::default_random_engine RandomGenerator;
|
||||
|
||||
@ -187,10 +187,10 @@ public:
|
||||
using ExecutionSignature = void(_1, _2, _3, _4);
|
||||
|
||||
template <typename LocatorType>
|
||||
VTKM_EXEC void operator()(const vtkm::Vec<vtkm::FloatDefault, 3>& point,
|
||||
VTKM_EXEC void operator()(const vtkm::Vec3f& point,
|
||||
const LocatorType& locator,
|
||||
vtkm::Id& cellId,
|
||||
vtkm::Vec<vtkm::FloatDefault, 3>& pcoords) const
|
||||
vtkm::Vec3f& pcoords) const
|
||||
{
|
||||
locator->FindCell(point, cellId, pcoords, *this);
|
||||
}
|
||||
|
@ -27,7 +27,7 @@
|
||||
class LocatorWorklet : public vtkm::worklet::WorkletMapField
|
||||
{
|
||||
public:
|
||||
LocatorWorklet(vtkm::Bounds& bounds, vtkm::Vec<vtkm::Id, 3>& 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<vtkm::Id, 3> logical;
|
||||
vtkm::Id3 logical;
|
||||
logical[0] = (point[0] == Bounds.X.Max)
|
||||
? CellDims[0] - 1
|
||||
: static_cast<vtkm::Id>(vtkm::Floor((point[0] / Bounds.X.Length()) *
|
||||
@ -75,7 +75,7 @@ public:
|
||||
|
||||
private:
|
||||
vtkm::Bounds Bounds;
|
||||
vtkm::Vec<vtkm::Id, 3> CellDims;
|
||||
vtkm::Id3 CellDims;
|
||||
};
|
||||
|
||||
template <typename DeviceAdapter>
|
||||
@ -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<vtkm::Id, 3> cellDims =
|
||||
vtkm::Id3 cellDims =
|
||||
cellSet.Cast<StructuredType>().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<vtkm::FloatDefault, 3>;
|
||||
using PointType = vtkm::Vec3f;
|
||||
std::vector<PointType> pointsVec;
|
||||
std::default_random_engine dre;
|
||||
std::uniform_real_distribution<vtkm::Float32> inBounds(0.0f, 4.0f);
|
||||
|
@ -162,12 +162,12 @@ public:
|
||||
constexpr int data[nvals] = { -1, 0, 1, 2 };
|
||||
auto field = vtkm::cont::make_ArrayHandle(data, nvals);
|
||||
|
||||
vtkm::cont::ArrayHandle<vtkm::Vec<vtkm::UInt8, 3>> colors;
|
||||
vtkm::cont::ArrayHandle<vtkm::Vec3ui_8> 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<vtkm::UInt8, 3> 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<vtkm::Vec<vtkm::UInt8, 3>> colors;
|
||||
vtkm::cont::ArrayHandle<vtkm::Vec3ui_8> 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<vtkm::UInt8, 3> 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<float, 3>{ 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<vtkm::UInt8, 3> 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<vtkm::Vec<vtkm::UInt8, 3>> colors;
|
||||
vtkm::cont::ArrayHandle<vtkm::Vec3ui_8> 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<vtkm::UInt8, 3> 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<vtkm::Vec<vtkm::UInt8, 3>> colors;
|
||||
vtkm::cont::ArrayHandle<vtkm::Vec3ui_8> 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<vtkm::UInt8, 3> 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<vtkm::Vec<vtkm::UInt8, 4>> colors;
|
||||
vtkm::cont::ArrayHandle<vtkm::Vec4ui_8> 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<vtkm::UInt8, 4> 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<vtkm::Vec<vtkm::UInt8, 3>> colors;
|
||||
vtkm::cont::ArrayHandle<vtkm::Vec3ui_8> 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<vtkm::UInt8, 3> 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<vtkm::Vec<vtkm::UInt8, 3>> colors_rgb;
|
||||
vtkm::cont::ArrayHandle<vtkm::Vec3ui_8> colors_rgb;
|
||||
table.SetColorSpace(vtkm::cont::ColorSpace::RGB);
|
||||
table.Map(field, colors_rgb);
|
||||
|
||||
const vtkm::Vec<vtkm::UInt8, 3> 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<vtkm::Vec<vtkm::UInt8, 4>> colors;
|
||||
vtkm::cont::ArrayHandle<vtkm::Vec4ui_8> 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<vtkm::UInt8, 4> 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<vtkm::Vec<vtkm::UInt8, 4>> colors;
|
||||
vtkm::cont::ArrayHandle<vtkm::Vec4ui_8> colors;
|
||||
TransferFunction transfer(table.PrepareForExecution(DeviceAdapterTag{}));
|
||||
vtkm::worklet::DispatcherMapField<TransferFunction> dispatcher(transfer);
|
||||
dispatcher.SetDevice(DeviceAdapterTag());
|
||||
dispatcher.Invoke(samples, colors);
|
||||
|
||||
const vtkm::Vec<vtkm::UInt8, 4> 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<vtkm::Vec<vtkm::UInt8, 4>> colors;
|
||||
vtkm::cont::ArrayHandle<vtkm::Vec4ui_8> colors;
|
||||
constexpr vtkm::Id nvals = 3;
|
||||
table.Sample(3, colors);
|
||||
|
||||
const vtkm::Vec<vtkm::UInt8, 4> 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<vtkm::Vec<vtkm::UInt8, 3>> colors;
|
||||
vtkm::cont::ArrayHandle<vtkm::Vec3ui_8> 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<vtkm::UInt8, 3> 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)
|
||||
{
|
||||
|
@ -97,8 +97,8 @@ private:
|
||||
{
|
||||
vtkm::cont::CoordinateSystem field("TestField",
|
||||
vtkm::Id3(10, 20, 5),
|
||||
vtkm::Vec<vtkm::FloatDefault, 3>(0.0f, -5.0f, 4.0f),
|
||||
vtkm::Vec<vtkm::FloatDefault, 3>(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();
|
||||
|
||||
|
@ -140,7 +140,7 @@ private:
|
||||
|
||||
//verify that GetIndices works properly
|
||||
vtkm::Id expectedPointIds[4] = { 2, 1, 3, 4 };
|
||||
vtkm::Vec<vtkm::Id, 4> retrievedPointIds;
|
||||
vtkm::Id4 retrievedPointIds;
|
||||
cellset.GetIndices(1, retrievedPointIds);
|
||||
for (vtkm::IdComponent i = 0; i < 4; i++)
|
||||
{
|
||||
|
@ -58,7 +58,7 @@ private:
|
||||
|
||||
static inline vtkm::cont::DataSet make_SingleTypeDataSet()
|
||||
{
|
||||
using CoordType = vtkm::Vec<vtkm::Float32, 3>;
|
||||
using CoordType = vtkm::Vec3f_32;
|
||||
std::vector<CoordType> coordinates;
|
||||
coordinates.push_back(CoordType(0, 0, 0));
|
||||
coordinates.push_back(CoordType(1, 0, 0));
|
||||
|
@ -556,7 +556,7 @@ private:
|
||||
try
|
||||
{
|
||||
std::cout << "Do array allocation that should fail." << std::endl;
|
||||
vtkm::cont::ArrayHandle<vtkm::Vec<vtkm::Float32, 4>, StorageTagBasic> bigArray;
|
||||
vtkm::cont::ArrayHandle<vtkm::Vec4f_32, StorageTagBasic> 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<FloatDefault, 3>;
|
||||
using Vec3ArrayHandle = vtkm::cont::ArrayHandle<vtkm::Vec<vtkm::FloatDefault, 3>, StorageTag>;
|
||||
using Vec3ArrayHandle = vtkm::cont::ArrayHandle<vtkm::Vec3f, StorageTag>;
|
||||
|
||||
std::vector<vtkm::Id> testKeys(ARRAY_SIZE);
|
||||
std::vector<Vec3> testValues(testKeys.size());
|
||||
@ -1274,8 +1274,7 @@ private:
|
||||
testData[ARRAY_SIZE / 2] = maxValue;
|
||||
|
||||
IdArrayHandle input = vtkm::cont::make_ArrayHandle(testData);
|
||||
vtkm::Vec<vtkm::Id, 2> range =
|
||||
Algorithm::Reduce(input, vtkm::Vec<vtkm::Id, 2>(0, 0), vtkm::MinAndMax<vtkm::Id>());
|
||||
vtkm::Id2 range = Algorithm::Reduce(input, vtkm::Id2(0, 0), vtkm::MinAndMax<vtkm::Id>());
|
||||
|
||||
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<vtkm::Float32, 2> frange = Algorithm::Reduce(
|
||||
farray, vtkm::Vec<vtkm::Float32, 2>(0.0f, 0.0f), CustomMinAndMax<CustomTForReduce>());
|
||||
vtkm::Vec2f_32 frange =
|
||||
Algorithm::Reduce(farray, vtkm::Vec2f_32(0.0f, 0.0f), CustomMinAndMax<CustomTForReduce>());
|
||||
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<vtkm::Float64, 3> 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<vtkm::Float64, 3> 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<vtkm::Vec<vtkm::Float64, 3>, StorageTag> values =
|
||||
vtkm::cont::ArrayHandle<vtkm::Vec3f_64, StorageTag> values =
|
||||
vtkm::cont::make_ArrayHandle(inputValues, inputLength);
|
||||
|
||||
IdArrayHandle keysOut;
|
||||
vtkm::cont::ArrayHandle<vtkm::Vec<vtkm::Float64, 3>, StorageTag> valuesOut;
|
||||
vtkm::cont::ArrayHandle<vtkm::Vec3f_64, StorageTag> 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<vtkm::Float64, 3> 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<Float64, 3>;
|
||||
using Vec3ArrayHandle = vtkm::cont::ArrayHandle<vtkm::Vec<vtkm::Float64, 3>, StorageTag>;
|
||||
using Vec3ArrayHandle = vtkm::cont::ArrayHandle<vtkm::Vec3f_64, StorageTag>;
|
||||
|
||||
std::vector<Vec3> testValues(ARRAY_SIZE);
|
||||
|
||||
@ -1969,7 +1968,7 @@ private:
|
||||
|
||||
{
|
||||
using Vec3 = vtkm::Vec<Float64, 3>;
|
||||
using Vec3ArrayHandle = vtkm::cont::ArrayHandle<vtkm::Vec<vtkm::Float64, 3>, StorageTag>;
|
||||
using Vec3ArrayHandle = vtkm::cont::ArrayHandle<vtkm::Vec3f_64, StorageTag>;
|
||||
|
||||
std::vector<Vec3> testValues(ARRAY_SIZE);
|
||||
|
||||
@ -2282,11 +2281,11 @@ private:
|
||||
{
|
||||
std::cout << "-------------------------------------------------" << std::endl;
|
||||
std::cout << "Testing Copy to same array type" << std::endl;
|
||||
TestCopyArrays<vtkm::Vec<vtkm::Float32, 3>>();
|
||||
TestCopyArrays<vtkm::Vec<vtkm::UInt8, 4>>();
|
||||
TestCopyArrays<vtkm::Vec3f_32>();
|
||||
TestCopyArrays<vtkm::Vec4ui_8>();
|
||||
//
|
||||
TestCopyArrays<vtkm::Pair<vtkm::Id, vtkm::Float32>>();
|
||||
TestCopyArrays<vtkm::Pair<vtkm::Id, vtkm::Vec<vtkm::Float32, 3>>>();
|
||||
TestCopyArrays<vtkm::Pair<vtkm::Id, vtkm::Vec3f_32>>();
|
||||
//
|
||||
TestCopyArrays<vtkm::Float32>();
|
||||
TestCopyArrays<vtkm::Float64>();
|
||||
|
@ -1239,17 +1239,14 @@ private:
|
||||
{
|
||||
};
|
||||
|
||||
struct ZipTypesToTest
|
||||
: vtkm::ListTagBase<vtkm::Pair<vtkm::UInt8, vtkm::Id>,
|
||||
vtkm::Pair<vtkm::Float64, vtkm::Vec<vtkm::UInt8, 4>>,
|
||||
vtkm::Pair<vtkm::Vec<vtkm::Float32, 3>, vtkm::Vec<vtkm::Int8, 4>>>
|
||||
struct ZipTypesToTest : vtkm::ListTagBase<vtkm::Pair<vtkm::UInt8, vtkm::Id>,
|
||||
vtkm::Pair<vtkm::Float64, vtkm::Vec4ui_8>,
|
||||
vtkm::Pair<vtkm::Vec3f_32, vtkm::Vec4i_8>>
|
||||
{
|
||||
};
|
||||
|
||||
struct HandleTypesToTest : vtkm::ListTagBase<vtkm::Id,
|
||||
vtkm::Vec<vtkm::Int32, 2>,
|
||||
vtkm::FloatDefault,
|
||||
vtkm::Vec<vtkm::Float64, 3>>
|
||||
struct HandleTypesToTest
|
||||
: vtkm::ListTagBase<vtkm::Id, vtkm::Vec2i_32, vtkm::FloatDefault, vtkm::Vec3f_64>
|
||||
{
|
||||
};
|
||||
|
||||
|
@ -182,7 +182,7 @@ private:
|
||||
std::cout << "Testing vtkm::Frustum on "
|
||||
<< vtkm::cont::DeviceAdapterTraits<DeviceAdapter>::GetName() << "\n";
|
||||
|
||||
vtkm::Vec<vtkm::FloatDefault, 3> 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
|
||||
|
@ -98,7 +98,7 @@ public:
|
||||
vtkm::Int32 nTrainingPoints = 5;
|
||||
vtkm::Int32 nTestingPoint = 1;
|
||||
|
||||
std::vector<vtkm::Vec<vtkm::Float32, 3>> coordi;
|
||||
std::vector<vtkm::Vec3f_32> coordi;
|
||||
|
||||
///// randomly generate training points/////
|
||||
std::default_random_engine dre;
|
||||
@ -131,7 +131,7 @@ public:
|
||||
locator->Update();
|
||||
|
||||
///// randomly generate testing points/////
|
||||
std::vector<vtkm::Vec<vtkm::Float32, 3>> qcVec;
|
||||
std::vector<vtkm::Vec3f_32> qcVec;
|
||||
for (vtkm::Int32 i = 0; i < nTestingPoint; i++)
|
||||
{
|
||||
qcVec.push_back(vtkm::make_Vec(dr(dre), dr(dre), dr(dre)));
|
||||
|
@ -172,7 +172,7 @@ void TryVector3(vtkm::cont::ArrayHandle<T1, StorageTag> array1,
|
||||
std::cout << " Fourth component from Scalar." << std::endl;
|
||||
TryVector4(array1, array2, array3, MakeInputArray<vtkm::FloatDefault>(3));
|
||||
std::cout << " Fourth component from Vector4." << std::endl;
|
||||
TryVector4(array1, array2, array3, MakeInputArray<vtkm::Vec<vtkm::FloatDefault, 4>>(3));
|
||||
TryVector4(array1, array2, array3, MakeInputArray<vtkm::Vec4f>(3));
|
||||
}
|
||||
|
||||
template <typename T1, typename T2>
|
||||
@ -197,7 +197,7 @@ void TryVector2(vtkm::cont::ArrayHandle<T1, StorageTag> array1,
|
||||
std::cout << " Third component from Scalar." << std::endl;
|
||||
TryVector3(array1, array2, MakeInputArray<vtkm::FloatDefault>(2));
|
||||
std::cout << " Third component from Vector2." << std::endl;
|
||||
TryVector3(array1, array2, MakeInputArray<vtkm::Vec<vtkm::FloatDefault, 2>>(2));
|
||||
TryVector3(array1, array2, MakeInputArray<vtkm::Vec2f>(2));
|
||||
}
|
||||
|
||||
template <typename T1>
|
||||
@ -216,7 +216,7 @@ void TryVector1(vtkm::cont::ArrayHandle<T1, StorageTag> array1)
|
||||
std::cout << " Second component from Scalar." << std::endl;
|
||||
TryVector2(array1, MakeInputArray<vtkm::FloatDefault>(1));
|
||||
std::cout << " Second component from Vector4." << std::endl;
|
||||
TryVector2(array1, MakeInputArray<vtkm::Vec<vtkm::FloatDefault, 4>>(1));
|
||||
TryVector2(array1, MakeInputArray<vtkm::Vec4f>(1));
|
||||
}
|
||||
|
||||
void TryVector()
|
||||
@ -226,7 +226,7 @@ void TryVector()
|
||||
std::cout << " First component from Scalar." << std::endl;
|
||||
TryVector1(MakeInputArray<vtkm::FloatDefault>(0));
|
||||
std::cout << " First component from Vector3." << std::endl;
|
||||
TryVector1(MakeInputArray<vtkm::Vec<vtkm::FloatDefault, 3>>(0));
|
||||
TryVector1(MakeInputArray<vtkm::Vec3f>(0));
|
||||
}
|
||||
|
||||
void TrySpecialArrays()
|
||||
|
@ -317,7 +317,7 @@ void TestArrayHandleSwizzle()
|
||||
|
||||
void TestComponentMapValidator()
|
||||
{
|
||||
vtkm::cont::ArrayHandle<vtkm::Vec<vtkm::Id, 4>> dummy;
|
||||
vtkm::cont::ArrayHandle<vtkm::Id4> dummy;
|
||||
|
||||
// Repeat components:
|
||||
bool error = false;
|
||||
|
@ -15,7 +15,7 @@
|
||||
namespace
|
||||
{
|
||||
|
||||
using Vector3 = vtkm::Vec<vtkm::FloatDefault, 3>;
|
||||
using Vector3 = vtkm::Vec3f;
|
||||
|
||||
const vtkm::Id3 DIMENSIONS(16, 18, 5);
|
||||
const vtkm::Id NUM_POINTS = 1440;
|
||||
|
@ -28,7 +28,7 @@ namespace
|
||||
|
||||
std::default_random_engine RandomGenerator;
|
||||
|
||||
using PointType = vtkm::Vec<vtkm::FloatDefault, 3>;
|
||||
using PointType = vtkm::Vec3f;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
vtkm::cont::DataSet MakeTestDataSetUniform()
|
||||
@ -150,10 +150,10 @@ public:
|
||||
using ExecutionSignature = void(_1, _2, _3, _4);
|
||||
|
||||
template <typename LocatorType>
|
||||
VTKM_EXEC void operator()(const vtkm::Vec<vtkm::FloatDefault, 3>& point,
|
||||
VTKM_EXEC void operator()(const vtkm::Vec3f& point,
|
||||
const LocatorType& locator,
|
||||
vtkm::Id& cellId,
|
||||
vtkm::Vec<vtkm::FloatDefault, 3>& pcoords) const
|
||||
vtkm::Vec3f& pcoords) const
|
||||
{
|
||||
locator->FindCell(point, cellId, pcoords, *this);
|
||||
}
|
||||
|
@ -46,7 +46,7 @@ bool TestArrayHandle(const vtkm::cont::ArrayHandle<T, Storage>& ah,
|
||||
|
||||
inline vtkm::cont::DataSet make_SingleTypeDataSet()
|
||||
{
|
||||
using CoordType = vtkm::Vec<vtkm::Float32, 3>;
|
||||
using CoordType = vtkm::Vec3f_32;
|
||||
std::vector<CoordType> coordinates;
|
||||
coordinates.push_back(CoordType(0, 0, 0));
|
||||
coordinates.push_back(CoordType(1, 0, 0));
|
||||
|
@ -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<vtkm::Id, 4> 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],
|
||||
|
@ -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<vtkm::Id, 4> 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],
|
||||
|
@ -146,12 +146,12 @@ static void TestFieldRangeCompute()
|
||||
|
||||
TryRangeComputeDS<vtkm::Float64>(0, 1000);
|
||||
TryRangeComputeDS<vtkm::Int32>(-1024, 1024);
|
||||
TryRangeComputeDS<vtkm::Vec<vtkm::Float32, 3>>(vtkm::make_Vec(1024, 0, -1024),
|
||||
vtkm::make_Vec(2048, 2048, 2048));
|
||||
TryRangeComputeDS<vtkm::Vec3f_32>(vtkm::make_Vec(1024, 0, -1024),
|
||||
vtkm::make_Vec(2048, 2048, 2048));
|
||||
TryRangeComputeMB<vtkm::Float64>(0, 1000);
|
||||
TryRangeComputeMB<vtkm::Int32>(-1024, 1024);
|
||||
TryRangeComputeMB<vtkm::Vec<vtkm::Float32, 3>>(vtkm::make_Vec(1024, 0, -1024),
|
||||
vtkm::make_Vec(2048, 2048, 2048));
|
||||
TryRangeComputeMB<vtkm::Vec3f_32>(vtkm::make_Vec(1024, 0, -1024),
|
||||
vtkm::make_Vec(2048, 2048, 2048));
|
||||
};
|
||||
|
||||
int UnitTestFieldRangeCompute(int argc, char* argv[])
|
||||
|
@ -193,12 +193,12 @@ static void TestFieldRangeGlobalCompute()
|
||||
|
||||
TryRangeGlobalComputeDS<vtkm::Float64>(0, 1000);
|
||||
TryRangeGlobalComputeDS<vtkm::Int32>(-1024, 1024);
|
||||
TryRangeGlobalComputeDS<vtkm::Vec<vtkm::Float32, 3>>(vtkm::make_Vec(1024, 0, -1024),
|
||||
vtkm::make_Vec(2048, 2048, 2048));
|
||||
TryRangeGlobalComputeDS<vtkm::Vec3f_32>(vtkm::make_Vec(1024, 0, -1024),
|
||||
vtkm::make_Vec(2048, 2048, 2048));
|
||||
TryRangeGlobalComputeMB<vtkm::Float64>(0, 1000);
|
||||
TryRangeGlobalComputeMB<vtkm::Int32>(-1024, 1024);
|
||||
TryRangeGlobalComputeMB<vtkm::Vec<vtkm::Float32, 3>>(vtkm::make_Vec(1024, 0, -1024),
|
||||
vtkm::make_Vec(2048, 2048, 2048));
|
||||
TryRangeGlobalComputeMB<vtkm::Vec3f_32>(vtkm::make_Vec(1024, 0, -1024),
|
||||
vtkm::make_Vec(2048, 2048, 2048));
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -64,8 +64,7 @@ inline void RunTest(const T& obj)
|
||||
//-----------------------------------------------------------------------------
|
||||
constexpr vtkm::Id ArraySize = 10;
|
||||
|
||||
using TestTypesList =
|
||||
vtkm::ListTagBase<vtkm::Int8, vtkm::Id, vtkm::FloatDefault, vtkm::Vec<vtkm::FloatDefault, 3>>;
|
||||
using TestTypesList = vtkm::ListTagBase<vtkm::Int8, vtkm::Id, vtkm::FloatDefault, vtkm::Vec3f>;
|
||||
|
||||
template <typename T, typename S>
|
||||
inline vtkm::cont::VariantArrayHandleBase<vtkm::ListTagAppendUnique<TestTypesList, T>>
|
||||
@ -314,11 +313,10 @@ struct TestArrayHandleSwizzle
|
||||
template <typename T>
|
||||
void operator()(T) const
|
||||
{
|
||||
static const vtkm::Vec<vtkm::IdComponent, 2> map2s[6] = { { 0, 1 }, { 0, 2 }, { 1, 0 },
|
||||
{ 1, 2 }, { 2, 0 }, { 2, 1 } };
|
||||
static const vtkm::Vec<vtkm::IdComponent, 3> 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<vtkm::IdComponent>::Make(2, 3);
|
||||
switch (numOutComps)
|
||||
@ -394,8 +392,8 @@ struct TestArrayHandleTransform
|
||||
vtkm::cont::ArrayHandleUniformPointCoordinates MakeRandomArrayHandleUniformPointCoordinates()
|
||||
{
|
||||
auto dimensions = RandomValue<vtkm::Id3>::Make(1, 3);
|
||||
auto origin = RandomValue<vtkm::Vec<vtkm::FloatDefault, 3>>::Make();
|
||||
auto spacing = RandomValue<vtkm::Vec<vtkm::FloatDefault, 3>>::Make(0.1f, 10.0f);
|
||||
auto origin = RandomValue<vtkm::Vec3f>::Make();
|
||||
auto spacing = RandomValue<vtkm::Vec3f>::Make(0.1f, 10.0f);
|
||||
return vtkm::cont::ArrayHandleUniformPointCoordinates(dimensions, origin, spacing);
|
||||
}
|
||||
|
||||
@ -425,8 +423,8 @@ void TestArrayHandleVirtualCoordinates()
|
||||
RandomArrayHandle<vtkm::FloatDefault>::Make(ArraySize)));
|
||||
break;
|
||||
default:
|
||||
array = vtkm::cont::ArrayHandleVirtualCoordinates(
|
||||
RandomArrayHandle<vtkm::Vec<vtkm::FloatDefault, 3>>::Make(ArraySize));
|
||||
array =
|
||||
vtkm::cont::ArrayHandleVirtualCoordinates(RandomArrayHandle<vtkm::Vec3f>::Make(ArraySize));
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -519,9 +519,9 @@ void TestVariantArrayHandle()
|
||||
std::cout << "*** vtkm::Float64 *****************" << std::endl;
|
||||
TryDefaultType(vtkm::Float64());
|
||||
std::cout << "*** vtkm::Vec<Float32,3> **********" << std::endl;
|
||||
TryDefaultType(vtkm::Vec<vtkm::Float32, 3>());
|
||||
TryDefaultType(vtkm::Vec3f_32());
|
||||
std::cout << "*** vtkm::Vec<Float64,3> **********" << std::endl;
|
||||
TryDefaultType(vtkm::Vec<vtkm::Float64, 3>());
|
||||
TryDefaultType(vtkm::Vec3f_64());
|
||||
|
||||
std::cout << "Try exemplar VTK-m types." << std::endl;
|
||||
vtkm::testing::Testing::TryTypes(TryBasicVTKmType());
|
||||
|
@ -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<vtkm::IdComponent, 3>& 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<vtkm::IdComponent, 3> MinNeighborIndices(vtkm::IdComponent radius) const
|
||||
VTKM_EXEC vtkm::IdComponent3 MinNeighborIndices(vtkm::IdComponent radius) const
|
||||
{
|
||||
VTKM_ASSERT(radius >= 0);
|
||||
vtkm::Vec<vtkm::IdComponent, 3> 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<vtkm::IdComponent, 3> MaxNeighborIndices(vtkm::IdComponent radius) const
|
||||
VTKM_EXEC vtkm::IdComponent3 MaxNeighborIndices(vtkm::IdComponent radius) const
|
||||
{
|
||||
VTKM_ASSERT(radius >= 0);
|
||||
vtkm::Vec<vtkm::IdComponent, 3> 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<vtkm::IdComponent, 3>& 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<vtkm::IdComponent, 3> ClampNeighborIndex(
|
||||
const vtkm::Vec<vtkm::IdComponent, 3>& 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<vtkm::IdComponent, 3>{ clampedFullIndex - this->IJK };
|
||||
return vtkm::IdComponent3{ clampedFullIndex - this->IJK };
|
||||
}
|
||||
|
||||
VTKM_EXEC vtkm::Vec<vtkm::IdComponent, 3> 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<vtkm::IdComponent, 3>& neighbor) const
|
||||
VTKM_EXEC vtkm::Id NeighborIndexToFlatIndexClamp(const vtkm::IdComponent3& neighbor) const
|
||||
{
|
||||
vtkm::Id3 full = this->NeighborIndexToFullIndexClamp(neighbor);
|
||||
|
||||
|
@ -253,7 +253,7 @@ template <typename FieldType, typename LUType, typename ParametricCoordType, typ
|
||||
VTKM_EXEC vtkm::Vec<FieldType, 3> CellDerivativeFor2DCellFinish(
|
||||
const vtkm::Vec<FieldType, 4>& field,
|
||||
const vtkm::Matrix<LUType, 2, 2>& LUFactorization,
|
||||
const vtkm::Vec<vtkm::IdComponent, 2>& LUPermutation,
|
||||
const vtkm::IdComponent2& LUPermutation,
|
||||
const vtkm::Vec<ParametricCoordType, 3>& pcoords,
|
||||
const vtkm::exec::internal::Space2D<LUType>& space,
|
||||
CellShapeTag,
|
||||
@ -274,7 +274,7 @@ template <typename FieldType, typename LUType, typename ParametricCoordType, typ
|
||||
VTKM_EXEC vtkm::Vec<FieldType, 3> CellDerivativeFor2DCellFinish(
|
||||
const vtkm::Vec<FieldType, 4>& field,
|
||||
const vtkm::Matrix<LUType, 2, 2>& LUFactorization,
|
||||
const vtkm::Vec<vtkm::IdComponent, 2>& LUPermutation,
|
||||
const vtkm::IdComponent2& LUPermutation,
|
||||
const vtkm::Vec<ParametricCoordType, 3>& pcoords,
|
||||
const vtkm::exec::internal::Space2D<LUType>& space,
|
||||
CellShapeTag,
|
||||
@ -315,7 +315,7 @@ template <typename FieldType, typename LUType, typename ParametricCoordType, typ
|
||||
VTKM_EXEC vtkm::Vec<FieldType, 3> CellDerivativeFor2DCellFinish(
|
||||
const vtkm::Vec<FieldType, 4>& field,
|
||||
const vtkm::Matrix<LUType, 2, 2>& LUFactorization,
|
||||
const vtkm::Vec<vtkm::IdComponent, 2>& LUPermutation,
|
||||
const vtkm::IdComponent2& LUPermutation,
|
||||
const vtkm::Vec<ParametricCoordType, 3>& pcoords,
|
||||
const vtkm::exec::internal::Space2D<LUType>& space,
|
||||
CellShapeTag,
|
||||
@ -382,7 +382,7 @@ VTKM_EXEC vtkm::Vec<typename FieldVecType::ComponentType, 3> 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<vtkm::IdComponent, 2> 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 <typename ValueType, typename LUType>
|
||||
VTKM_EXEC vtkm::Vec<ValueType, 3> TriangleDerivativeFinish(
|
||||
const vtkm::Vec<ValueType, 3>& field,
|
||||
const vtkm::Matrix<LUType, 3, 3>& LUFactorization,
|
||||
const vtkm::Vec<vtkm::IdComponent, 3>& LUPermutation,
|
||||
const vtkm::IdComponent3& LUPermutation,
|
||||
vtkm::TypeTraitsScalarTag)
|
||||
{
|
||||
// Finish solving linear equation. See TriangleDerivative implementation
|
||||
@ -645,7 +645,7 @@ template <typename ValueType, typename LUType>
|
||||
VTKM_EXEC vtkm::Vec<ValueType, 3> TriangleDerivativeFinish(
|
||||
const vtkm::Vec<ValueType, 3>& field,
|
||||
const vtkm::Matrix<LUType, 3, 3>& LUFactorization,
|
||||
const vtkm::Vec<vtkm::IdComponent, 3>& LUPermutation,
|
||||
const vtkm::IdComponent3& LUPermutation,
|
||||
vtkm::TypeTraitsVectorTag)
|
||||
{
|
||||
using FieldTraits = vtkm::VecTraits<ValueType>;
|
||||
@ -679,7 +679,7 @@ template <typename ValueType, typename LUType>
|
||||
VTKM_EXEC vtkm::Vec<ValueType, 3> TriangleDerivativeFinish(
|
||||
const vtkm::Vec<ValueType, 3>& field,
|
||||
const vtkm::Matrix<LUType, 3, 3>& LUFactorization,
|
||||
const vtkm::Vec<vtkm::IdComponent, 3>& LUPermutation,
|
||||
const vtkm::IdComponent3& LUPermutation,
|
||||
vtkm::TypeTraitsMatrixTag)
|
||||
{
|
||||
return TriangleDerivativeFinish(
|
||||
@ -738,7 +738,7 @@ VTKM_EXEC vtkm::Vec<ValueType, 3> TriangleDerivative(const vtkm::Vec<ValueType,
|
||||
// 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<vtkm::IdComponent, 3> 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 <typename ValueType, typename LUType>
|
||||
VTKM_EXEC vtkm::Vec<ValueType, 3> TetraDerivativeFinish(
|
||||
const vtkm::Vec<ValueType, 4>& field,
|
||||
const vtkm::Matrix<LUType, 3, 3>& LUFactorization,
|
||||
const vtkm::Vec<vtkm::IdComponent, 3>& LUPermutation,
|
||||
const vtkm::IdComponent3& LUPermutation,
|
||||
vtkm::TypeTraitsScalarTag)
|
||||
{
|
||||
// Finish solving linear equation. See TriangleDerivative implementation
|
||||
@ -949,7 +949,7 @@ template <typename ValueType, typename LUType>
|
||||
VTKM_EXEC vtkm::Vec<ValueType, 3> TetraDerivativeFinish(
|
||||
const vtkm::Vec<ValueType, 4>& field,
|
||||
const vtkm::Matrix<LUType, 3, 3>& LUFactorization,
|
||||
const vtkm::Vec<vtkm::IdComponent, 3>& LUPermutation,
|
||||
const vtkm::IdComponent3& LUPermutation,
|
||||
vtkm::TypeTraitsVectorTag)
|
||||
{
|
||||
using FieldTraits = vtkm::VecTraits<ValueType>;
|
||||
@ -984,7 +984,7 @@ template <typename ValueType, typename LUType>
|
||||
VTKM_EXEC vtkm::Vec<ValueType, 3> TetraDerivativeFinish(
|
||||
const vtkm::Vec<ValueType, 4>& field,
|
||||
const vtkm::Matrix<LUType, 3, 3>& LUFactorization,
|
||||
const vtkm::Vec<vtkm::IdComponent, 3>& LUPermutation,
|
||||
const vtkm::IdComponent3& LUPermutation,
|
||||
vtkm::TypeTraitsMatrixTag)
|
||||
{
|
||||
return TetraDerivativeFinish(field, LUFactorization, LUPermutation, vtkm::TypeTraitsVectorTag());
|
||||
@ -1041,7 +1041,7 @@ VTKM_EXEC vtkm::Vec<ValueType, 3> TetraDerivative(const vtkm::Vec<ValueType, 4>&
|
||||
// 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<vtkm::IdComponent, 3> 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.
|
||||
|
@ -182,13 +182,12 @@ VTKM_EXEC typename FieldVecType::ComponentType CellInterpolate(
|
||||
}
|
||||
|
||||
template <typename ParametricCoordType>
|
||||
VTKM_EXEC vtkm::Vec<vtkm::FloatDefault, 3> CellInterpolate(
|
||||
const vtkm::VecAxisAlignedPointCoordinates<1>& field,
|
||||
const vtkm::Vec<ParametricCoordType, 3>& pcoords,
|
||||
vtkm::CellShapeTagLine,
|
||||
const vtkm::exec::FunctorBase&)
|
||||
VTKM_EXEC vtkm::Vec3f CellInterpolate(const vtkm::VecAxisAlignedPointCoordinates<1>& field,
|
||||
const vtkm::Vec<ParametricCoordType, 3>& pcoords,
|
||||
vtkm::CellShapeTagLine,
|
||||
const vtkm::exec::FunctorBase&)
|
||||
{
|
||||
using T = vtkm::Vec<vtkm::FloatDefault, 3>;
|
||||
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 <typename ParametricCoordType>
|
||||
VTKM_EXEC vtkm::Vec<vtkm::FloatDefault, 3> CellInterpolate(
|
||||
const vtkm::VecAxisAlignedPointCoordinates<1>& field,
|
||||
const vtkm::Vec<ParametricCoordType, 3>& pcoords,
|
||||
vtkm::CellShapeTagPolyLine,
|
||||
const vtkm::exec::FunctorBase& worklet)
|
||||
VTKM_EXEC vtkm::Vec3f CellInterpolate(const vtkm::VecAxisAlignedPointCoordinates<1>& field,
|
||||
const vtkm::Vec<ParametricCoordType, 3>& 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<vtkm::FloatDefault, 3> CellInterpolate(
|
||||
return CellInterpolate(field, pcoords, vtkm::CellShapeTagLine(), worklet);
|
||||
}
|
||||
|
||||
using T = vtkm::Vec<vtkm::FloatDefault, 3>;
|
||||
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 <typename ParametricCoordType>
|
||||
VTKM_EXEC vtkm::Vec<vtkm::FloatDefault, 3> CellInterpolate(
|
||||
const vtkm::VecAxisAlignedPointCoordinates<2>& field,
|
||||
const vtkm::Vec<ParametricCoordType, 3>& pcoords,
|
||||
vtkm::CellShapeTagQuad,
|
||||
const vtkm::exec::FunctorBase&)
|
||||
VTKM_EXEC vtkm::Vec3f CellInterpolate(const vtkm::VecAxisAlignedPointCoordinates<2>& field,
|
||||
const vtkm::Vec<ParametricCoordType, 3>& pcoords,
|
||||
vtkm::CellShapeTagQuad,
|
||||
const vtkm::exec::FunctorBase&)
|
||||
{
|
||||
using T = vtkm::Vec<vtkm::FloatDefault, 3>;
|
||||
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 <typename ParametricCoordType>
|
||||
VTKM_EXEC vtkm::Vec<vtkm::FloatDefault, 3> CellInterpolate(
|
||||
const vtkm::VecAxisAlignedPointCoordinates<3>& field,
|
||||
const vtkm::Vec<ParametricCoordType, 3>& pcoords,
|
||||
vtkm::CellShapeTagHexahedron,
|
||||
const vtkm::exec::FunctorBase&)
|
||||
VTKM_EXEC vtkm::Vec3f CellInterpolate(const vtkm::VecAxisAlignedPointCoordinates<3>& field,
|
||||
const vtkm::Vec<ParametricCoordType, 3>& pcoords,
|
||||
vtkm::CellShapeTagHexahedron,
|
||||
const vtkm::exec::FunctorBase&)
|
||||
{
|
||||
vtkm::Vec<vtkm::FloatDefault, 3> pcoordsCast(static_cast<vtkm::FloatDefault>(pcoords[0]),
|
||||
static_cast<vtkm::FloatDefault>(pcoords[1]),
|
||||
static_cast<vtkm::FloatDefault>(pcoords[2]));
|
||||
vtkm::Vec3f pcoordsCast(static_cast<vtkm::FloatDefault>(pcoords[0]),
|
||||
static_cast<vtkm::FloatDefault>(pcoords[1]),
|
||||
static_cast<vtkm::FloatDefault>(pcoords[2]));
|
||||
|
||||
return field.GetOrigin() + pcoordsCast * field.GetSpacing();
|
||||
}
|
||||
|
@ -29,9 +29,9 @@ public:
|
||||
}
|
||||
|
||||
VTKM_EXEC
|
||||
virtual void FindCell(const vtkm::Vec<vtkm::FloatDefault, 3>& point,
|
||||
virtual void FindCell(const vtkm::Vec3f& point,
|
||||
vtkm::Id& cellId,
|
||||
vtkm::Vec<vtkm::FloatDefault, 3>& parametric,
|
||||
vtkm::Vec3f& parametric,
|
||||
const vtkm::exec::FunctorBase& worklet) const = 0;
|
||||
};
|
||||
|
||||
|
@ -84,9 +84,9 @@ public:
|
||||
}
|
||||
|
||||
VTKM_EXEC
|
||||
void FindCell(const vtkm::Vec<vtkm::FloatDefault, 3>& point,
|
||||
void FindCell(const vtkm::Vec3f& point,
|
||||
vtkm::Id& cellId,
|
||||
vtkm::Vec<vtkm::FloatDefault, 3>& 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<vtkm::FloatDefault, 3>& point,
|
||||
const vtkm::Vec3f& point,
|
||||
vtkm::Id& cellId,
|
||||
vtkm::Id nodeIndex,
|
||||
vtkm::Vec<vtkm::FloatDefault, 3>& 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<vtkm::FloatDefault, 3>& 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<vtkm::FloatDefault, 3>& 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<vtkm::FloatDefault, 3>& point,
|
||||
vtkm::Vec<vtkm::FloatDefault, 3>& 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 <typename CoordsType, typename CellShapeTag>
|
||||
VTKM_EXEC static bool IsPointInCell(const vtkm::Vec<vtkm::FloatDefault, 3>& point,
|
||||
vtkm::Vec<vtkm::FloatDefault, 3>& parametric,
|
||||
VTKM_EXEC static bool IsPointInCell(const vtkm::Vec3f& point,
|
||||
vtkm::Vec3f& parametric,
|
||||
CellShapeTag cellShape,
|
||||
const CoordsType& cellPoints,
|
||||
const vtkm::exec::FunctorBase& worklet)
|
||||
|
@ -80,7 +80,7 @@ public:
|
||||
}
|
||||
|
||||
VTKM_EXEC
|
||||
inline bool IsInside(const vtkm::Vec<vtkm::FloatDefault, 3>& point) const
|
||||
inline bool IsInside(const vtkm::Vec3f& point) const
|
||||
{
|
||||
bool inside = true;
|
||||
if (point[0] < this->MinPoint[0] || point[0] > this->MaxPoint[0])
|
||||
@ -95,9 +95,9 @@ public:
|
||||
}
|
||||
|
||||
VTKM_EXEC
|
||||
void FindCell(const vtkm::Vec<vtkm::FloatDefault, 3>& point,
|
||||
void FindCell(const vtkm::Vec3f& point,
|
||||
vtkm::Id& cellId,
|
||||
vtkm::Vec<vtkm::FloatDefault, 3>& parametric,
|
||||
vtkm::Vec3f& parametric,
|
||||
const vtkm::exec::FunctorBase& worklet) const override
|
||||
{
|
||||
if (!IsInside(point))
|
||||
@ -107,8 +107,8 @@ public:
|
||||
}
|
||||
|
||||
// Get the Cell Id from the point.
|
||||
vtkm::Vec<vtkm::Id, 3> logicalCell(0, 0, 0);
|
||||
for (vtkm::Int32 dim = 0; dim < dimensions; ++dim)
|
||||
vtkm::Id3 logicalCell(0, 0, 0);
|
||||
for (vtkm::Int32 dim = 0; dim < 3; ++dim)
|
||||
{
|
||||
//
|
||||
// When searching for points, we consider the max value of the cell
|
||||
@ -171,9 +171,15 @@ private:
|
||||
CellSetPortal CellSet;
|
||||
RectilinearPortalType Coords;
|
||||
AxisPortalType AxisPortals[3];
|
||||
<<<<<<< HEAD
|
||||
vtkm::Vec<vtkm::Id, dimensions> PointDimensions;
|
||||
vtkm::Vec<vtkm::FloatDefault, 3> MinPoint;
|
||||
vtkm::Vec<vtkm::FloatDefault, 3> MaxPoint;
|
||||
=======
|
||||
vtkm::Id3 PointDimensions;
|
||||
vtkm::Vec3f MinPoint;
|
||||
vtkm::Vec3f MaxPoint;
|
||||
>>>>>>> 57440239efe51fbcced830488cdf80b683f3d9ea
|
||||
};
|
||||
} //namespace exec
|
||||
} //namespace vtkm
|
||||
|
@ -42,8 +42,8 @@ private:
|
||||
public:
|
||||
VTKM_CONT
|
||||
CellLocatorUniformGrid(const vtkm::Bounds& bounds,
|
||||
const vtkm::Vec<vtkm::FloatDefault, 3> rangeTransform,
|
||||
const vtkm::Vec<vtkm::Id, 3> 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<vtkm::FloatDefault, 3>& point,
|
||||
void FindCell(const vtkm::Vec3f& point,
|
||||
vtkm::Id& cellId,
|
||||
vtkm::Vec<vtkm::FloatDefault, 3>& 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<vtkm::Id, 3> logicalCell;
|
||||
vtkm::Id3 logicalCell;
|
||||
logicalCell[0] = (point[0] == Bounds.X.Max)
|
||||
? CellDims[0] - 1
|
||||
: static_cast<vtkm::Id>(vtkm::Floor((point[0] - Bounds.X.Min) * RangeTransform[0]));
|
||||
@ -101,8 +101,8 @@ public:
|
||||
|
||||
private:
|
||||
vtkm::Bounds Bounds;
|
||||
vtkm::Vec<vtkm::FloatDefault, 3> RangeTransform;
|
||||
vtkm::Vec<vtkm::Id, 3> CellDims;
|
||||
vtkm::Vec3f RangeTransform;
|
||||
vtkm::Id3 CellDims;
|
||||
vtkm::Id PlaneSize;
|
||||
vtkm::Id RowSize;
|
||||
CellSetPortal CellSet;
|
||||
|
@ -201,7 +201,7 @@ typename ConnectivityExtrude<Device>::IndicesType ConnectivityExtrude<Device>::G
|
||||
vtkm::Id p0 = index[1];
|
||||
vtkm::Id p1 = (p0 < (this->NumberOfPlanes - 1)) ? (p0 + 1) : 0;
|
||||
|
||||
vtkm::Vec<vtkm::Int32, 3> pointIds1, pointIds2;
|
||||
vtkm::Vec3i_32 pointIds1, pointIds2;
|
||||
for (int i = 0; i < 3; ++i)
|
||||
{
|
||||
pointIds1[i] = this->Connectivity.Get((tr * 3) + i);
|
||||
|
@ -83,7 +83,7 @@ struct FieldNeighborhood<vtkm::internal::ArrayPortalUniformPointCoordinates>
|
||||
}
|
||||
|
||||
VTKM_EXEC
|
||||
ValueType Get(const vtkm::Vec<vtkm::IdComponent, 3>& ijk) const
|
||||
ValueType Get(const vtkm::IdComponent3& ijk) const
|
||||
{
|
||||
return Portal.Get(this->Boundary->NeighborIndexToFullIndexClamp(ijk));
|
||||
}
|
||||
|
@ -215,12 +215,12 @@ static inline VTKM_EXEC void ParametricCoordinatesCenter(vtkm::IdComponent numPo
|
||||
/// of points.
|
||||
///
|
||||
template <typename CellShapeTag>
|
||||
static inline VTKM_EXEC vtkm::Vec<vtkm::FloatDefault, 3> ParametricCoordinatesCenter(
|
||||
static inline VTKM_EXEC vtkm::Vec3f ParametricCoordinatesCenter(
|
||||
vtkm::IdComponent numPoints,
|
||||
CellShapeTag shape,
|
||||
const vtkm::exec::FunctorBase& worklet)
|
||||
{
|
||||
vtkm::Vec<vtkm::FloatDefault, 3> 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 <typename CellShapeTag>
|
||||
static inline VTKM_EXEC vtkm::Vec<vtkm::FloatDefault, 3> ParametricCoordinatesPoint(
|
||||
static inline VTKM_EXEC vtkm::Vec3f ParametricCoordinatesPoint(
|
||||
vtkm::IdComponent numPoints,
|
||||
vtkm::IdComponent pointIndex,
|
||||
CellShapeTag shape,
|
||||
const vtkm::exec::FunctorBase& worklet)
|
||||
{
|
||||
vtkm::Vec<vtkm::FloatDefault, 3> 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<vtkm::FloatDefault, 3> WorldCoordinatesToParametricCoordinates(
|
||||
static inline VTKM_EXEC vtkm::Vec3f WorldCoordinatesToParametricCoordinates(
|
||||
const vtkm::VecAxisAlignedPointCoordinates<2>& pointWCoords,
|
||||
const vtkm::Vec<vtkm::FloatDefault, 3>& 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<vtkm::FloatDefault, 3> WorldCoordinatesToParametricCoordinates(
|
||||
static inline VTKM_EXEC vtkm::Vec3f WorldCoordinatesToParametricCoordinates(
|
||||
const vtkm::VecAxisAlignedPointCoordinates<3>& pointWCoords,
|
||||
const vtkm::Vec<vtkm::FloatDefault, 3>& wcoords,
|
||||
const vtkm::Vec3f& wcoords,
|
||||
vtkm::CellShapeTagHexahedron,
|
||||
bool& success,
|
||||
const FunctorBase&)
|
||||
|
@ -26,7 +26,7 @@ public:
|
||||
// troublesome with CUDA __host__ __device__ markup.
|
||||
}
|
||||
|
||||
VTKM_EXEC virtual void FindNearestNeighbor(const vtkm::Vec<vtkm::FloatDefault, 3>& queryPoint,
|
||||
VTKM_EXEC virtual void FindNearestNeighbor(const vtkm::Vec3f& queryPoint,
|
||||
vtkm::Id& pointId,
|
||||
vtkm::FloatDefault& distanceSquared) const = 0;
|
||||
};
|
||||
|
@ -37,9 +37,9 @@ public:
|
||||
|
||||
PointLocatorUniformGrid() = default;
|
||||
|
||||
PointLocatorUniformGrid(const vtkm::Vec<vtkm::FloatDefault, 3>& min,
|
||||
const vtkm::Vec<vtkm::FloatDefault, 3>& max,
|
||||
const vtkm::Vec<vtkm::Id, 3>& 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<vtkm::FloatDefault, 3>& 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<vtkm::FloatDefault, 3> Min;
|
||||
vtkm::Vec<vtkm::Id, 3> Dims;
|
||||
vtkm::Vec<vtkm::FloatDefault, 3> 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<vtkm::FloatDefault, 3>& 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<vtkm::FloatDefault, 3> 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<vtkm::FloatDefault, 3>& 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<vtkm::FloatDefault, 3>& 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<vtkm::FloatDefault, 3>& 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<vtkm::FloatDefault, 3>& 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<vtkm::FloatDefault, 3>& queryPoint,
|
||||
VTKM_EXEC void FindInZPlane(const vtkm::Vec3f& queryPoint,
|
||||
vtkm::Id3 planeCenter,
|
||||
vtkm::Id level,
|
||||
vtkm::Id& nearestNeighborId,
|
||||
|
@ -89,44 +89,42 @@ struct FetchArrayTopologyMapInImplementation
|
||||
};
|
||||
|
||||
static inline VTKM_EXEC vtkm::VecAxisAlignedPointCoordinates<1> make_VecAxisAlignedPointCoordinates(
|
||||
const vtkm::Vec<vtkm::FloatDefault, 3>& origin,
|
||||
const vtkm::Vec<vtkm::FloatDefault, 3>& spacing,
|
||||
const vtkm::Vec3f& origin,
|
||||
const vtkm::Vec3f& spacing,
|
||||
const vtkm::Vec<vtkm::Id, 1>& logicalId)
|
||||
{
|
||||
vtkm::Vec<vtkm::FloatDefault, 3> offsetOrigin(
|
||||
vtkm::Vec3f offsetOrigin(
|
||||
origin[0] + spacing[0] * static_cast<vtkm::FloatDefault>(logicalId[0]), origin[1], origin[2]);
|
||||
return vtkm::VecAxisAlignedPointCoordinates<1>(offsetOrigin, spacing);
|
||||
}
|
||||
|
||||
static inline VTKM_EXEC vtkm::VecAxisAlignedPointCoordinates<1> make_VecAxisAlignedPointCoordinates(
|
||||
const vtkm::Vec<vtkm::FloatDefault, 3>& origin,
|
||||
const vtkm::Vec<vtkm::FloatDefault, 3>& spacing,
|
||||
const vtkm::Vec3f& origin,
|
||||
const vtkm::Vec3f& spacing,
|
||||
vtkm::Id logicalId)
|
||||
{
|
||||
return make_VecAxisAlignedPointCoordinates(origin, spacing, vtkm::Vec<vtkm::Id, 1>(logicalId));
|
||||
}
|
||||
|
||||
static inline VTKM_EXEC vtkm::VecAxisAlignedPointCoordinates<2> make_VecAxisAlignedPointCoordinates(
|
||||
const vtkm::Vec<vtkm::FloatDefault, 3>& origin,
|
||||
const vtkm::Vec<vtkm::FloatDefault, 3>& spacing,
|
||||
const vtkm::Vec<vtkm::Id, 2>& logicalId)
|
||||
const vtkm::Vec3f& origin,
|
||||
const vtkm::Vec3f& spacing,
|
||||
const vtkm::Id2& logicalId)
|
||||
{
|
||||
vtkm::Vec<vtkm::FloatDefault, 3> offsetOrigin(
|
||||
origin[0] + spacing[0] * static_cast<vtkm::FloatDefault>(logicalId[0]),
|
||||
origin[1] + spacing[1] * static_cast<vtkm::FloatDefault>(logicalId[1]),
|
||||
origin[2]);
|
||||
vtkm::Vec3f offsetOrigin(origin[0] + spacing[0] * static_cast<vtkm::FloatDefault>(logicalId[0]),
|
||||
origin[1] + spacing[1] * static_cast<vtkm::FloatDefault>(logicalId[1]),
|
||||
origin[2]);
|
||||
return vtkm::VecAxisAlignedPointCoordinates<2>(offsetOrigin, spacing);
|
||||
}
|
||||
|
||||
static inline VTKM_EXEC vtkm::VecAxisAlignedPointCoordinates<3> make_VecAxisAlignedPointCoordinates(
|
||||
const vtkm::Vec<vtkm::FloatDefault, 3>& origin,
|
||||
const vtkm::Vec<vtkm::FloatDefault, 3>& spacing,
|
||||
const vtkm::Vec<vtkm::Id, 3>& logicalId)
|
||||
const vtkm::Vec3f& origin,
|
||||
const vtkm::Vec3f& spacing,
|
||||
const vtkm::Id3& logicalId)
|
||||
{
|
||||
vtkm::Vec<vtkm::FloatDefault, 3> offsetOrigin(
|
||||
origin[0] + spacing[0] * static_cast<vtkm::FloatDefault>(logicalId[0]),
|
||||
origin[1] + spacing[1] * static_cast<vtkm::FloatDefault>(logicalId[1]),
|
||||
origin[2] + spacing[2] * static_cast<vtkm::FloatDefault>(logicalId[2]));
|
||||
vtkm::Vec3f offsetOrigin(origin[0] + spacing[0] * static_cast<vtkm::FloatDefault>(logicalId[0]),
|
||||
origin[1] + spacing[1] * static_cast<vtkm::FloatDefault>(logicalId[1]),
|
||||
origin[2] + spacing[2] * static_cast<vtkm::FloatDefault>(logicalId[2]));
|
||||
return vtkm::VecAxisAlignedPointCoordinates<3>(offsetOrigin, spacing);
|
||||
}
|
||||
|
||||
|
@ -149,8 +149,8 @@ void TryStructuredPointCoordinatesInvocation(const Invocation& invocation)
|
||||
vtkm::internal::ArrayPortalUniformPointCoordinates>
|
||||
fetch;
|
||||
|
||||
vtkm::Vec<vtkm::FloatDefault, 3> origin = TestValue(0, vtkm::Vec<vtkm::FloatDefault, 3>());
|
||||
vtkm::Vec<vtkm::FloatDefault, 3> spacing = TestValue(1, vtkm::Vec<vtkm::FloatDefault, 3>());
|
||||
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<vtkm::FloatDefault, 3>()),
|
||||
TestValue(1, vtkm::Vec<vtkm::FloatDefault, 3>()));
|
||||
vtkm::Id3(3, 2, 2), TestValue(0, vtkm::Vec3f()), TestValue(1, vtkm::Vec3f()));
|
||||
|
||||
std::cout << "3D" << std::endl;
|
||||
vtkm::internal::ConnectivityStructuredInternals<3> connectivityInternals3d;
|
||||
|
@ -50,40 +50,40 @@ template <> struct UseScalarTextureLoad<const vtkm::Float64> : 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<const vtkm::Vec<vtkm::Int32, 2>> : std::true_type {};
|
||||
template <> struct UseVecTextureLoads<const vtkm::Vec<vtkm::UInt32, 2>> : std::true_type {};
|
||||
template <> struct UseVecTextureLoads<const vtkm::Vec<vtkm::Float32, 2>> : std::true_type {};
|
||||
template <> struct UseVecTextureLoads<const vtkm::Vec<vtkm::Float64, 2>> : std::true_type {};
|
||||
template <> struct UseVecTextureLoads<const vtkm::Vec2i_32> : std::true_type {};
|
||||
template <> struct UseVecTextureLoads<const vtkm::Vec2ui_32> : std::true_type {};
|
||||
template <> struct UseVecTextureLoads<const vtkm::Vec2f_32> : std::true_type {};
|
||||
template <> struct UseVecTextureLoads<const vtkm::Vec2f_64> : std::true_type {};
|
||||
|
||||
template <> struct UseVecTextureLoads<const vtkm::Vec<vtkm::Int32, 4>> : std::true_type {};
|
||||
template <> struct UseVecTextureLoads<const vtkm::Vec<vtkm::UInt32, 4>> : std::true_type {};
|
||||
template <> struct UseVecTextureLoads<const vtkm::Vec<vtkm::Float32, 4>> : std::true_type {};
|
||||
template <> struct UseVecTextureLoads<const vtkm::Vec4i_32> : std::true_type {};
|
||||
template <> struct UseVecTextureLoads<const vtkm::Vec4ui_32> : std::true_type {};
|
||||
template <> struct UseVecTextureLoads<const vtkm::Vec4f_32> : 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<const vtkm::Vec<vtkm::UInt8, 2>> : std::true_type {};
|
||||
template <> struct UseMultipleScalarTextureLoads<const vtkm::Vec<vtkm::Int16, 2>> : std::true_type {};
|
||||
template <> struct UseMultipleScalarTextureLoads<const vtkm::Vec<vtkm::UInt16, 2>> : std::true_type {};
|
||||
template <> struct UseMultipleScalarTextureLoads<const vtkm::Vec<vtkm::Int64, 2>> : std::true_type {};
|
||||
template <> struct UseMultipleScalarTextureLoads<const vtkm::Vec<vtkm::UInt64, 2>> : std::true_type {};
|
||||
template <> struct UseMultipleScalarTextureLoads<const vtkm::Vec2ui_8> : std::true_type {};
|
||||
template <> struct UseMultipleScalarTextureLoads<const vtkm::Vec2i_16> : std::true_type {};
|
||||
template <> struct UseMultipleScalarTextureLoads<const vtkm::Vec2ui_16> : std::true_type {};
|
||||
template <> struct UseMultipleScalarTextureLoads<const vtkm::Vec2i_64> : std::true_type {};
|
||||
template <> struct UseMultipleScalarTextureLoads<const vtkm::Vec2ui_64> : std::true_type {};
|
||||
|
||||
template <> struct UseMultipleScalarTextureLoads<const vtkm::Vec<vtkm::UInt8, 3>> : std::true_type {};
|
||||
template <> struct UseMultipleScalarTextureLoads<const vtkm::Vec<vtkm::Int16, 3>> : std::true_type {};
|
||||
template <> struct UseMultipleScalarTextureLoads<const vtkm::Vec<vtkm::UInt16, 3>> : std::true_type {};
|
||||
template <> struct UseMultipleScalarTextureLoads<const vtkm::Vec<vtkm::Int32, 3>> : std::true_type {};
|
||||
template <> struct UseMultipleScalarTextureLoads<const vtkm::Vec<vtkm::UInt32, 3>> : std::true_type {};
|
||||
template <> struct UseMultipleScalarTextureLoads<const vtkm::Vec<vtkm::Float32, 3>> : std::true_type {};
|
||||
template <> struct UseMultipleScalarTextureLoads<const vtkm::Vec<vtkm::Float64, 3>> : std::true_type {};
|
||||
template <> struct UseMultipleScalarTextureLoads<const vtkm::Vec3ui_8> : std::true_type {};
|
||||
template <> struct UseMultipleScalarTextureLoads<const vtkm::Vec3i_16> : std::true_type {};
|
||||
template <> struct UseMultipleScalarTextureLoads<const vtkm::Vec3ui_16> : std::true_type {};
|
||||
template <> struct UseMultipleScalarTextureLoads<const vtkm::Vec3i_32> : std::true_type {};
|
||||
template <> struct UseMultipleScalarTextureLoads<const vtkm::Vec3ui_32> : std::true_type {};
|
||||
template <> struct UseMultipleScalarTextureLoads<const vtkm::Vec3f_32> : std::true_type {};
|
||||
template <> struct UseMultipleScalarTextureLoads<const vtkm::Vec3f_64> : std::true_type {};
|
||||
|
||||
template <> struct UseMultipleScalarTextureLoads<const vtkm::Vec<vtkm::UInt8, 4>> : std::true_type {};
|
||||
template <> struct UseMultipleScalarTextureLoads<const vtkm::Vec<vtkm::Int16, 4>> : std::true_type {};
|
||||
template <> struct UseMultipleScalarTextureLoads<const vtkm::Vec<vtkm::UInt16, 4>> : std::true_type {};
|
||||
template <> struct UseMultipleScalarTextureLoads<const vtkm::Vec<vtkm::Int64, 4>> : std::true_type {};
|
||||
template <> struct UseMultipleScalarTextureLoads<const vtkm::Vec<vtkm::UInt64, 4>> : std::true_type {};
|
||||
template <> struct UseMultipleScalarTextureLoads<const vtkm::Vec<vtkm::Float64, 4>> : std::true_type {};
|
||||
template <> struct UseMultipleScalarTextureLoads<const vtkm::Vec4ui_8> : std::true_type {};
|
||||
template <> struct UseMultipleScalarTextureLoads<const vtkm::Vec4i_16> : std::true_type {};
|
||||
template <> struct UseMultipleScalarTextureLoads<const vtkm::Vec4ui_16> : std::true_type {};
|
||||
template <> struct UseMultipleScalarTextureLoads<const vtkm::Vec4i_64> : std::true_type {};
|
||||
template <> struct UseMultipleScalarTextureLoads<const vtkm::Vec4ui_64> : std::true_type {};
|
||||
template <> struct UseMultipleScalarTextureLoads<const vtkm::Vec4f_64> : 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<T, typename std::enable_if<UseVecTextureLoads<const
|
||||
#endif
|
||||
}
|
||||
|
||||
__device__ static vtkm::Vec<vtkm::Int32, 2> getAs(const vtkm::Vec<vtkm::Int32, 2>* const data)
|
||||
__device__ static vtkm::Vec2i_32 getAs(const vtkm::Vec2i_32* const data)
|
||||
{
|
||||
const int2 temp = __ldg((const int2*)data);
|
||||
return vtkm::Vec<vtkm::Int32, 2>(temp.x, temp.y);
|
||||
return vtkm::Vec2i_32(temp.x, temp.y);
|
||||
}
|
||||
|
||||
__device__ static vtkm::Vec<vtkm::UInt32, 2> getAs(const vtkm::Vec<vtkm::UInt32, 2>* const data)
|
||||
__device__ static vtkm::Vec2ui_32 getAs(const vtkm::Vec2ui_32* const data)
|
||||
{
|
||||
const uint2 temp = __ldg((const uint2*)data);
|
||||
return vtkm::Vec<vtkm::UInt32, 2>(temp.x, temp.y);
|
||||
return vtkm::Vec2ui_32(temp.x, temp.y);
|
||||
}
|
||||
|
||||
__device__ static vtkm::Vec<vtkm::Int32, 4> getAs(const vtkm::Vec<vtkm::Int32, 4>* const data)
|
||||
__device__ static vtkm::Vec4i_32 getAs(const vtkm::Vec4i_32* const data)
|
||||
{
|
||||
const int4 temp = __ldg((const int4*)data);
|
||||
return vtkm::Vec<vtkm::Int32, 4>(temp.x, temp.y, temp.z, temp.w);
|
||||
return vtkm::Vec4i_32(temp.x, temp.y, temp.z, temp.w);
|
||||
}
|
||||
|
||||
__device__ static vtkm::Vec<vtkm::UInt32, 4> getAs(const vtkm::Vec<vtkm::UInt32, 4>* const data)
|
||||
__device__ static vtkm::Vec4ui_32 getAs(const vtkm::Vec4ui_32* const data)
|
||||
{
|
||||
const uint4 temp = __ldg((const uint4*)data);
|
||||
return vtkm::Vec<vtkm::UInt32, 4>(temp.x, temp.y, temp.z, temp.w);
|
||||
return vtkm::Vec4ui_32(temp.x, temp.y, temp.z, temp.w);
|
||||
}
|
||||
|
||||
__device__ static vtkm::Vec<vtkm::Float32, 2> getAs(const vtkm::Vec<vtkm::Float32, 2>* const data)
|
||||
__device__ static vtkm::Vec2f_32 getAs(const vtkm::Vec2f_32* const data)
|
||||
{
|
||||
const float2 temp = __ldg((const float2*)data);
|
||||
return vtkm::Vec<vtkm::Float32, 2>(temp.x, temp.y);
|
||||
return vtkm::Vec2f_32(temp.x, temp.y);
|
||||
}
|
||||
|
||||
__device__ static vtkm::Vec<vtkm::Float32, 4> getAs(const vtkm::Vec<vtkm::Float32, 4>* const data)
|
||||
__device__ static vtkm::Vec4f_32 getAs(const vtkm::Vec4f_32* const data)
|
||||
{
|
||||
const float4 temp = __ldg((const float4*)data);
|
||||
return vtkm::Vec<vtkm::Float32, 4>(temp.x, temp.y, temp.z, temp.w);
|
||||
return vtkm::Vec4f_32(temp.x, temp.y, temp.z, temp.w);
|
||||
}
|
||||
|
||||
__device__ static vtkm::Vec<vtkm::Float64, 2> getAs(const vtkm::Vec<vtkm::Float64, 2>* const data)
|
||||
__device__ static vtkm::Vec2f_64 getAs(const vtkm::Vec2f_64* const data)
|
||||
{
|
||||
const double2 temp = __ldg((const double2*)data);
|
||||
return vtkm::Vec<vtkm::Float64, 2>(temp.x, temp.y);
|
||||
return vtkm::Vec2f_64(temp.x, temp.y);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -22,7 +22,7 @@ namespace twolevelgrid
|
||||
{
|
||||
using DimensionType = vtkm::Int16;
|
||||
using DimVec3 = vtkm::Vec<DimensionType, 3>;
|
||||
using FloatVec3 = vtkm::Vec<vtkm::FloatDefault, 3>;
|
||||
using FloatVec3 = vtkm::Vec3f;
|
||||
|
||||
struct Grid
|
||||
{
|
||||
|
@ -103,7 +103,7 @@ struct TestDerivativeFunctor
|
||||
vtkm::VecVariable<FieldType, MAX_POINTS> fieldValues;
|
||||
for (vtkm::IdComponent pointIndex = 0; pointIndex < numPoints; pointIndex++)
|
||||
{
|
||||
vtkm::Vec<vtkm::FloatDefault, 3> wcoords = worldCoordinates[pointIndex];
|
||||
vtkm::Vec3f wcoords = worldCoordinates[pointIndex];
|
||||
FieldType value = static_cast<FieldType>(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<vtkm::FloatDefault, 3> pcoords(0);
|
||||
vtkm::Vec3f pcoords(0);
|
||||
vtkm::FloatDefault totalWeight = 0;
|
||||
for (vtkm::IdComponent pointIndex = 0; pointIndex < numPoints; pointIndex++)
|
||||
{
|
||||
vtkm::Vec<vtkm::FloatDefault, 3> 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<vtkm::Vec<vtkm::FloatDefault, 3>, MAX_POINTS> worldCoordinates;
|
||||
vtkm::VecVariable<vtkm::Vec3f, MAX_POINTS> worldCoordinates;
|
||||
for (vtkm::IdComponent pointIndex = 0; pointIndex < numPoints; pointIndex++)
|
||||
{
|
||||
vtkm::Vec<vtkm::FloatDefault, 3> pcoords =
|
||||
vtkm::Vec3f pcoords =
|
||||
vtkm::exec::ParametricCoordinatesPoint(numPoints, pointIndex, shape, workletProxy);
|
||||
VTKM_TEST_ASSERT(!errorMessage.IsErrorRaised(), messageBuffer);
|
||||
vtkm::Vec<vtkm::FloatDefault, 3> 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<vtkm::Float64>());
|
||||
std::cout << "======== Vec<Float32,3> ===================" << std::endl;
|
||||
vtkm::testing::Testing::TryAllCellShapes(TestDerivativeFunctor<vtkm::Vec<vtkm::Float32, 3>>());
|
||||
vtkm::testing::Testing::TryAllCellShapes(TestDerivativeFunctor<vtkm::Vec3f_32>());
|
||||
std::cout << "======== Vec<Float64,3> ===================" << std::endl;
|
||||
vtkm::testing::Testing::TryAllCellShapes(TestDerivativeFunctor<vtkm::Vec<vtkm::Float64, 3>>());
|
||||
vtkm::testing::Testing::TryAllCellShapes(TestDerivativeFunctor<vtkm::Vec3f_64>());
|
||||
|
||||
std::uniform_real_distribution<vtkm::Float64> randomDist(-20.0, 20.0);
|
||||
vtkm::Vec<vtkm::FloatDefault, 3> origin = vtkm::Vec<vtkm::FloatDefault, 3>(0.25f, 0.25f, 0.25f);
|
||||
vtkm::Vec<vtkm::FloatDefault, 3> spacing = vtkm::Vec<vtkm::FloatDefault, 3>(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<vtkm::Float64> scalarField;
|
||||
scalarField.OriginValue = randomDist(g_RandomGenerator);
|
||||
scalarField.Gradient = vtkm::make_Vec(
|
||||
randomDist(g_RandomGenerator), randomDist(g_RandomGenerator), randomDist(g_RandomGenerator));
|
||||
vtkm::Vec<vtkm::Float64, 3> expectedScalarGradient = scalarField.Gradient;
|
||||
vtkm::Vec3f_64 expectedScalarGradient = scalarField.Gradient;
|
||||
|
||||
TestDerivativeFunctor<vtkm::Float64> testFunctorScalar;
|
||||
std::cout << "======== Uniform Point Coordinates 3D =====" << std::endl;
|
||||
@ -315,7 +315,7 @@ void TestDerivative()
|
||||
scalarField,
|
||||
expectedScalarGradient);
|
||||
|
||||
LinearField<vtkm::Vec<vtkm::Float64, 3>> vectorField;
|
||||
LinearField<vtkm::Vec3f_64> 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<vtkm::Vec<vtkm::Float64, 3>, 3> expectedVectorGradient = vectorField.Gradient;
|
||||
vtkm::Vec<vtkm::Vec3f_64, 3> expectedVectorGradient = vectorField.Gradient;
|
||||
|
||||
TestDerivativeFunctor<vtkm::Vec<vtkm::Float64, 3>> testFunctorVector;
|
||||
TestDerivativeFunctor<vtkm::Vec3f_64> 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<vtkm::Float64, 3>(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<vtkm::Float64, 3>(0.0);
|
||||
expectedVectorGradient[1] = vtkm::Vec3f_64(0.0);
|
||||
testFunctorVector.DoTestWithWCoords(vtkm::CellShapeTagLine(),
|
||||
vtkm::VecAxisAlignedPointCoordinates<1>(origin, spacing),
|
||||
vectorField,
|
||||
|
@ -24,7 +24,7 @@
|
||||
namespace
|
||||
{
|
||||
|
||||
using EdgeType = vtkm::Vec<vtkm::IdComponent, 2>;
|
||||
using EdgeType = vtkm::IdComponent2;
|
||||
|
||||
void MakeEdgeCanonical(EdgeType& edge)
|
||||
{
|
||||
|
@ -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<vtkm::FloatDefault, 3> 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<vtkm::FloatDefault, 3> 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<vtkm::Float64>());
|
||||
std::cout << "======== Vec<Float32,3> ===================" << std::endl;
|
||||
vtkm::testing::Testing::TryAllCellShapes(TestInterpolateFunctor<vtkm::Vec<vtkm::Float32, 3>>());
|
||||
vtkm::testing::Testing::TryAllCellShapes(TestInterpolateFunctor<vtkm::Vec3f_32>());
|
||||
std::cout << "======== Vec<Float64,3> ===================" << std::endl;
|
||||
vtkm::testing::Testing::TryAllCellShapes(TestInterpolateFunctor<vtkm::Vec<vtkm::Float64, 3>>());
|
||||
vtkm::testing::Testing::TryAllCellShapes(TestInterpolateFunctor<vtkm::Vec3f_64>());
|
||||
|
||||
TestInterpolateFunctor<vtkm::Vec<vtkm::FloatDefault, 3>> testFunctor;
|
||||
vtkm::Vec<vtkm::FloatDefault, 3> origin = TestValue(0, vtkm::Vec<vtkm::FloatDefault, 3>());
|
||||
vtkm::Vec<vtkm::FloatDefault, 3> spacing = TestValue(1, vtkm::Vec<vtkm::FloatDefault, 3>());
|
||||
TestInterpolateFunctor<vtkm::Vec3f> 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));
|
||||
|
@ -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<vtkm::FloatDefault, 3> pcoords(0);
|
||||
vtkm::Vec3f pcoords(0);
|
||||
vtkm::FloatDefault totalWeight = 0;
|
||||
for (vtkm::IdComponent pointIndex = 0; pointIndex < numPoints; pointIndex++)
|
||||
{
|
||||
vtkm::Vec<vtkm::FloatDefault, 3> 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<vtkm::FloatDefault> randomDist(0.01f, 1.0f);
|
||||
vtkm::Vec<vtkm::FloatDefault, 3> origin(
|
||||
vtkm::Vec3f origin(
|
||||
randomDist(g_RandomGenerator), randomDist(g_RandomGenerator), randomDist(g_RandomGenerator));
|
||||
vtkm::Vec<vtkm::FloatDefault, 3> spacing(
|
||||
vtkm::Vec3f spacing(
|
||||
randomDist(g_RandomGenerator), randomDist(g_RandomGenerator), randomDist(g_RandomGenerator));
|
||||
|
||||
TestPCoords(vtkm::VecAxisAlignedPointCoordinates<3>(origin, spacing),
|
||||
|
@ -164,7 +164,7 @@ inline VTKM_CONT vtkm::cont::DataSet FieldToColors::DoExecute(
|
||||
using IsVec = typename vtkm::VecTraits<T>::HasMultipleComponents;
|
||||
if (this->OutputMode == RGBA)
|
||||
{
|
||||
vtkm::cont::ArrayHandle<vtkm::Vec<vtkm::UInt8, 4>> output;
|
||||
vtkm::cont::ArrayHandle<vtkm::Vec4ui_8> output;
|
||||
|
||||
bool ran = false;
|
||||
switch (this->InputMode)
|
||||
@ -212,7 +212,7 @@ inline VTKM_CONT vtkm::cont::DataSet FieldToColors::DoExecute(
|
||||
}
|
||||
else
|
||||
{
|
||||
vtkm::cont::ArrayHandle<vtkm::Vec<vtkm::UInt8, 3>> output;
|
||||
vtkm::cont::ArrayHandle<vtkm::Vec3ui_8> output;
|
||||
|
||||
bool ran = false;
|
||||
switch (this->InputMode)
|
||||
|
@ -103,8 +103,8 @@ inline VTKM_CONT vtkm::cont::DataSet FilterDataSetWithField<Derived>::PrepareFor
|
||||
|
||||
//determine the field type first
|
||||
using Traits = vtkm::filter::FilterTraits<Derived>;
|
||||
constexpr bool supportsVec3 = vtkm::ListContains<typename Traits::InputFieldTypeList,
|
||||
vtkm::Vec<vtkm::FloatDefault, 3>>::value;
|
||||
constexpr bool supportsVec3 =
|
||||
vtkm::ListContains<typename Traits::InputFieldTypeList, vtkm::Vec3f>::value;
|
||||
using supportsCoordinateSystem = std::integral_constant<bool, supportsVec3>;
|
||||
vtkm::cont::ConditionalCastAndCall(supportsCoordinateSystem(),
|
||||
field,
|
||||
|
@ -101,8 +101,8 @@ inline VTKM_CONT vtkm::cont::DataSet FilterField<Derived>::PrepareForExecution(
|
||||
vtkm::cont::DataSet result;
|
||||
|
||||
using Traits = vtkm::filter::FilterTraits<Derived>;
|
||||
constexpr bool supportsVec3 = vtkm::ListContains<typename Traits::InputFieldTypeList,
|
||||
vtkm::Vec<vtkm::FloatDefault, 3>>::value;
|
||||
constexpr bool supportsVec3 =
|
||||
vtkm::ListContains<typename Traits::InputFieldTypeList, vtkm::Vec3f>::value;
|
||||
|
||||
using supportsCoordinateSystem = std::integral_constant<bool, supportsVec3>;
|
||||
vtkm::cont::ConditionalCastAndCall(supportsCoordinateSystem(),
|
||||
|
@ -55,14 +55,12 @@ private:
|
||||
};
|
||||
|
||||
template <int DIMS>
|
||||
VTKM_EXEC_CONT vtkm::Vec<vtkm::Id, 3> getLogical(const vtkm::Id& index,
|
||||
const vtkm::Vec<vtkm::Id, 3>& cellDims);
|
||||
VTKM_EXEC_CONT vtkm::Id3 getLogical(const vtkm::Id& index, const vtkm::Id3& cellDims);
|
||||
|
||||
template <>
|
||||
VTKM_EXEC_CONT vtkm::Vec<vtkm::Id, 3> getLogical<3>(const vtkm::Id& index,
|
||||
const vtkm::Vec<vtkm::Id, 3>& cellDims)
|
||||
VTKM_EXEC_CONT vtkm::Id3 getLogical<3>(const vtkm::Id& index, const vtkm::Id3& cellDims)
|
||||
{
|
||||
vtkm::Vec<vtkm::Id, 3> 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<vtkm::Id, 3> getLogical<3>(const vtkm::Id& index,
|
||||
}
|
||||
|
||||
template <>
|
||||
VTKM_EXEC_CONT vtkm::Vec<vtkm::Id, 3> getLogical<2>(const vtkm::Id& index,
|
||||
const vtkm::Vec<vtkm::Id, 3>& cellDims)
|
||||
VTKM_EXEC_CONT vtkm::Id3 getLogical<2>(const vtkm::Id& index, const vtkm::Id3& cellDims)
|
||||
{
|
||||
vtkm::Vec<vtkm::Id, 3> 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<vtkm::Id, 3> getLogical<1>(const vtkm::Id& index,
|
||||
const vtkm::Vec<vtkm::Id, 3>&)
|
||||
VTKM_EXEC_CONT vtkm::Id3 getLogical<1>(const vtkm::Id& index, const vtkm::Id3&)
|
||||
{
|
||||
vtkm::Vec<vtkm::Id, 3> 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<vtkm::Id, 3> 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<vtkm::Id, 3> logical = getLogical<DIMS>(index, CellDims);
|
||||
vtkm::Id3 logical = getLogical<DIMS>(index, CellDims);
|
||||
|
||||
Min(atom, logical[0], 0);
|
||||
Min(atom, logical[1], 1);
|
||||
@ -142,26 +138,26 @@ public:
|
||||
}
|
||||
|
||||
private:
|
||||
vtkm::Vec<vtkm::Id, 3> CellDims;
|
||||
vtkm::Id3 CellDims;
|
||||
bool RemoveAllGhost;
|
||||
vtkm::UInt8 RemoveType;
|
||||
};
|
||||
|
||||
template <int DIMS>
|
||||
VTKM_EXEC_CONT bool checkRange(const vtkm::RangeId3& range, const vtkm::Vec<vtkm::Id, 3>& 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<vtkm::Id, 3>& 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<vtkm::Id, 3>& 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<vtkm::Id, 3>& 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<vtkm::Id, 3>& cellDims,
|
||||
Validate(const vtkm::Id3& cellDims,
|
||||
bool removeAllGhost,
|
||||
vtkm::UInt8 removeType,
|
||||
const vtkm::RangeId3& range)
|
||||
@ -200,7 +196,7 @@ public:
|
||||
}
|
||||
|
||||
private:
|
||||
vtkm::Vec<vtkm::Id, 3> CellDims;
|
||||
vtkm::Id3 CellDims;
|
||||
bool RemoveAll;
|
||||
vtkm::UInt8 RemoveVal;
|
||||
vtkm::RangeId3 Range;
|
||||
@ -211,7 +207,7 @@ bool CanStrip(const vtkm::cont::ArrayHandle<T, StorageType>& ghostField,
|
||||
bool removeAllGhost,
|
||||
vtkm::UInt8 removeType,
|
||||
vtkm::RangeId3& range,
|
||||
const vtkm::Vec<vtkm::Id, 3>& cellDims,
|
||||
const vtkm::Id3& cellDims,
|
||||
vtkm::Id size)
|
||||
{
|
||||
vtkm::cont::ArrayHandle<vtkm::Id> minmax;
|
||||
|
@ -109,10 +109,8 @@ template <>
|
||||
class FilterTraits<Gradient>
|
||||
{
|
||||
public:
|
||||
struct TypeListTagGradientInputs : vtkm::ListTagBase<vtkm::Float32,
|
||||
vtkm::Float64,
|
||||
vtkm::Vec<vtkm::Float32, 3>,
|
||||
vtkm::Vec<vtkm::Float64, 3>>
|
||||
struct TypeListTagGradientInputs
|
||||
: vtkm::ListTagBase<vtkm::Float32, vtkm::Float64, vtkm::Vec3f_32, vtkm::Vec3f_64>
|
||||
{
|
||||
};
|
||||
|
||||
|
@ -96,8 +96,7 @@ template <>
|
||||
class FilterTraits<Lagrangian>
|
||||
{
|
||||
public:
|
||||
struct TypeListTagLagrangian
|
||||
: vtkm::ListTagBase<vtkm::Vec<vtkm::Float32, 3>, vtkm::Vec<vtkm::Float64, 3>>
|
||||
struct TypeListTagLagrangian : vtkm::ListTagBase<vtkm::Vec3f_32, vtkm::Vec3f_64>
|
||||
{
|
||||
};
|
||||
using InputFieldTypeList = TypeListTagLagrangian;
|
||||
|
@ -31,8 +31,8 @@
|
||||
#include <string.h>
|
||||
|
||||
static vtkm::Id cycle = 0;
|
||||
static vtkm::cont::ArrayHandle<vtkm::Vec<vtkm::Float64, 3>> BasisParticles;
|
||||
static vtkm::cont::ArrayHandle<vtkm::Vec<vtkm::Float64, 3>> BasisParticlesOriginal;
|
||||
static vtkm::cont::ArrayHandle<vtkm::Vec3f_64> BasisParticles;
|
||||
static vtkm::cont::ArrayHandle<vtkm::Vec3f_64> BasisParticlesOriginal;
|
||||
static vtkm::cont::ArrayHandle<vtkm::Id> 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<vtkm::Float64, 3>(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++;
|
||||
}
|
||||
|
@ -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<vtkm::Vec<vtkm::FloatDefault, 3>>;
|
||||
using Vec3HandleType = vtkm::cont::ArrayHandle<vtkm::Vec3f>;
|
||||
Vec3HandleType vertices;
|
||||
Vec3HandleType normals;
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user