Commit b5f71644 authored by Sujin Philip's avatar Sujin Philip
Browse files

Add IsType to ArrayHandleVirtualCoordinates

Makes the interface compatible with DynamicArrayHandle.
parent dd390109
......@@ -441,7 +441,7 @@ public:
}
template <typename ArrayHandleType>
bool IsSameType() const
bool IsType() const
{
return this->GetArrayHandleWrapper<ArrayHandleType>() != nullptr;
}
......@@ -488,7 +488,7 @@ void CastAndCall(const vtkm::cont::ArrayHandleVirtualCoordinates& coords,
Functor&& f,
Args&&... args)
{
if (coords.IsSameType<vtkm::cont::ArrayHandleUniformPointCoordinates>())
if (coords.IsType<vtkm::cont::ArrayHandleUniformPointCoordinates>())
{
f(coords.Cast<vtkm::cont::ArrayHandleUniformPointCoordinates>(), std::forward<Args>(args)...);
}
......
......@@ -38,7 +38,7 @@ private:
VTKM_CONT static bool IsUniformGrid(const vtkm::cont::DynamicCellSet& cellset,
const vtkm::cont::CoordinateSystem& coordinates)
{
return coordinates.GetData().IsSameType<vtkm::cont::ArrayHandleUniformPointCoordinates>() &&
return coordinates.GetData().IsType<vtkm::cont::ArrayHandleUniformPointCoordinates>() &&
(cellset.IsType<vtkm::cont::CellSetStructured<1>>() ||
cellset.IsType<vtkm::cont::CellSetStructured<2>>() ||
cellset.IsType<vtkm::cont::CellSetStructured<3>>());
......
......@@ -459,17 +459,17 @@ void MapperGL::RenderCells(const vtkm::cont::DynamicCellSet& cellset,
vtkm::cont::ArrayHandleUniformPointCoordinates uVerts;
vtkm::cont::ArrayHandle<vtkm::Vec<vtkm::Float32, 3>> eVerts;
if (dcoords.IsSameType<vtkm::cont::ArrayHandleUniformPointCoordinates>())
if (dcoords.IsType<vtkm::cont::ArrayHandleUniformPointCoordinates>())
{
uVerts = dcoords.Cast<vtkm::cont::ArrayHandleUniformPointCoordinates>();
RenderTriangles(*this, numTri, uVerts, indices, sf, colorTable, scalarRange, camera);
}
else if (dcoords.IsSameType<vtkm::cont::ArrayHandle<vtkm::Vec<vtkm::Float32, 3>>>())
else if (dcoords.IsType<vtkm::cont::ArrayHandle<vtkm::Vec<vtkm::Float32, 3>>>())
{
eVerts = dcoords.Cast<vtkm::cont::ArrayHandle<vtkm::Vec<vtkm::Float32, 3>>>();
RenderTriangles(*this, numTri, eVerts, indices, sf, colorTable, scalarRange, camera);
}
else if (dcoords.IsSameType<vtkm::cont::ArrayHandleCartesianProduct<
else if (dcoords.IsType<vtkm::cont::ArrayHandleCartesianProduct<
vtkm::cont::ArrayHandle<vtkm::FloatDefault>,
vtkm::cont::ArrayHandle<vtkm::FloatDefault>,
vtkm::cont::ArrayHandle<vtkm::FloatDefault>>>())
......
......@@ -723,7 +723,7 @@ void VolumeRendererStructured::SetData(const vtkm::cont::CoordinateSystem& coord
const vtkm::cont::CellSetStructured<3>& cellset,
const vtkm::Range& scalarRange)
{
if (coords.GetData().IsSameType<CartesianArrayHandle>())
if (coords.GetData().IsType<CartesianArrayHandle>())
IsUniformDataSet = false;
IsSceneDirty = true;
SpatialExtent = coords.GetBounds();
......
......@@ -797,7 +797,7 @@ public:
CartesianArrayHandle;
auto coordData = coord.GetData();
if (coordData.IsSameType<CartesianArrayHandle>())
if (coordData.IsType<CartesianArrayHandle>())
{
auto vertices = coordData.Cast<CartesianArrayHandle>();
......
......@@ -146,7 +146,7 @@ public:
typedef vtkm::cont::ArrayHandleUniformPointCoordinates UniformType;
typedef vtkm::cont::CellSetStructured<3> StructuredType;
if (!coords.GetData().IsSameType<UniformType>())
if (!coords.GetData().IsType<UniformType>())
throw vtkm::cont::ErrorInternal("Coordinates are not uniform.");
if (!cellSet.IsSameType(StructuredType()))
throw vtkm::cont::ErrorInternal("Cells are not 3D structured.");
......@@ -177,7 +177,7 @@ public:
typedef vtkm::cont::ArrayHandleUniformPointCoordinates UniformType;
auto coordArray = ds.GetCoordinateSystem().GetData();
if (!coordArray.IsSameType<UniformType>())
if (!coordArray.IsType<UniformType>())
throw vtkm::cont::ErrorInternal("Given dataset is was not uniform.");
bounds = ds.GetCoordinateSystem(0).GetBounds();
......@@ -321,7 +321,7 @@ public:
{
typedef vtkm::cont::CellSetStructured<3> StructuredType;
if (!coords.GetData().IsSameType<RectilinearType>())
if (!coords.GetData().IsType<RectilinearType>())
throw vtkm::cont::ErrorInternal("Coordinates are not rectilinear.");
if (!cellSet.IsSameType(StructuredType()))
throw vtkm::cont::ErrorInternal("Cells are not 3D structured.");
......@@ -352,7 +352,7 @@ public:
planeSize = dims[0] * dims[1];
rowSize = dims[0];
auto coordArray = dataset.GetCoordinateSystem().GetData();
if (coordArray.IsSameType<RectilinearType>())
if (coordArray.IsType<RectilinearType>())
{
RectilinearType gridPoints = coordArray.Cast<RectilinearType>();
xAxis = gridPoints.GetPortalConstControl().GetFirstPortal();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment