Commit ac76fe16 authored by Kitware Robot's avatar Kitware Robot Committed by Ben Boeckel
Browse files

clang-format: reformat using clang-format-8

Run the `clang-format.bash` script to update all our C and C++ code to a
new style defined by `.clang-format`.  Use `clang-format` version 8.0.

* If you reached this commit for a line in `git blame`, re-run the blame
  operation starting at the parent of this commit to see older history
  for the content.

* See the parent commit for instructions to rebase a change across this
  style transition commit.
parent 8118ae5c

Too many changes to show.

To preserve performance only 1000 of 1000+ files are displayed.
......@@ -25,8 +25,7 @@
#include "vtkRenderWindowInteractor.h"
#include "vtkRenderer.h"
int TestVTKMCleanGrid(int argc, char *argv[])
int TestVTKMCleanGrid(int argc, char* argv[])
{
vtkNew<vtkRTAnalyticSource> wavelet;
wavelet->SetWholeExtent(-10, 10, -10, 10, -10, 10);
......
......@@ -32,10 +32,11 @@
#include "vtkSphereSource.h"
#include "vtkUnstructuredGrid.h"
namespace {
namespace
{
template <typename DataSetT>
void GenerateScalars(DataSetT *dataset, bool negate)
void GenerateScalars(DataSetT* dataset, bool negate)
{
vtkIdType numPoints = dataset->GetNumberOfPoints();
......@@ -48,8 +49,7 @@ void GenerateScalars(DataSetT *dataset, bool negate)
for (vtkIdType i = 0; i < numPoints; ++i)
{
dataset->GetPoint(i, point);
scalars->SetTypedComponent(i, 0, (negate ?-point[0] - point[1]
: point[0] + point[1]));
scalars->SetTypedComponent(i, 0, (negate ? -point[0] - point[1] : point[0] + point[1]));
}
dataset->GetPointData()->SetScalars(scalars);
}
......@@ -66,7 +66,7 @@ int TestVTKMClip(int, char*[])
sphereSource->SetThetaResolution(50);
sphereSource->SetPhiResolution(50);
sphereSource->Update();
vtkPolyData *sphere = sphereSource->GetOutput();
vtkPolyData* sphere = sphereSource->GetOutput();
GenerateScalars(sphere, false);
// Clip at zero:
......@@ -104,7 +104,7 @@ int TestVTKMClip(int, char*[])
vtkNew<vtkDelaunay3D> tetrahedralizer;
tetrahedralizer->SetInputConnection(imageToPoints->GetOutputPort());
tetrahedralizer->Update();
vtkUnstructuredGrid *tets = tetrahedralizer->GetOutput();
vtkUnstructuredGrid* tets = tetrahedralizer->GetOutput();
GenerateScalars(tets, true);
// Clip at zero:
......@@ -129,7 +129,7 @@ int TestVTKMClip(int, char*[])
renderer->AddActor(tetActor);
// Third dataset tests imagedata. This should produce an unstructured grid:
vtkImageData *image = imageSource->GetOutput();
vtkImageData* image = imageSource->GetOutput();
GenerateScalars(image, false);
vtkNew<vtkmClip> imageClipper;
......@@ -159,10 +159,10 @@ int TestVTKMClip(int, char*[])
iren->SetRenderWindow(renWin);
renWin->AddRenderer(renderer);
renWin->SetSize(500,500);
renderer->GetActiveCamera()->SetPosition(0,0,1);
renderer->GetActiveCamera()->SetFocalPoint(0,0,0);
renderer->GetActiveCamera()->SetViewUp(0,1,0);
renWin->SetSize(500, 500);
renderer->GetActiveCamera()->SetPosition(0, 0, 1);
renderer->GetActiveCamera()->SetFocalPoint(0, 0, 0);
renderer->GetActiveCamera()->SetViewUp(0, 1, 0);
renderer->ResetCamera();
renWin->Render();
......
......@@ -28,7 +28,6 @@
#include "vtkRenderer.h"
#include "vtkSphere.h"
int TestVTKMClipWithImplicitFunction(int argc, char* argv[])
{
vtkNew<vtkRTAnalyticSource> wavelet;
......
......@@ -19,7 +19,8 @@
#include "vtkPolyData.h"
#include "vtkSmartPointer.h"
namespace {
namespace
{
const double pi = 3.14159265358979323846264338327950288;
const double twoPi = 6.28318530717958647692528676655900576;
const int dim = 5;
......@@ -28,20 +29,20 @@ const double tolerance = 0.0001;
bool ArePointsWithinTolerance(double v1, double v2)
{
if(v1 == v2 || fabs(v1)+fabs(v2) < tolerance)
if (v1 == v2 || fabs(v1) + fabs(v2) < tolerance)
{
return true;
}
if(v1 == 0.0)
if (v1 == 0.0)
{
if(fabs(v2) < tolerance)
if (fabs(v2) < tolerance)
{
return true;
}
return false;
}
if(fabs(fabs(v1) - fabs(v2)) < tolerance)
if (fabs(fabs(v1) - fabs(v2)) < tolerance)
{
return true;
}
......@@ -65,14 +66,12 @@ void MakeTestDataSet(vtkPolyData* pd, const CoordinateType& coordType)
{
for (vtkIdType i = 0; i < dim; ++i)
{
double z =
static_cast<double>(i) / static_cast<double>(dim - 1);
double z = static_cast<double>(i) / static_cast<double>(dim - 1);
for (vtkIdType j = 0; j < dim; ++j)
{
double x =
static_cast<double>(j) / static_cast<double>(dim - 1);
double x = static_cast<double>(j) / static_cast<double>(dim - 1);
double y = (x * x + z * z) / 2.0f;
pcoords->SetTuple3(i*dim + j,x + 0, y + 0, z + 0);
pcoords->SetTuple3(i * dim + j, x + 0, y + 0, z + 0);
}
}
}
......@@ -81,49 +80,42 @@ void MakeTestDataSet(vtkPolyData* pd, const CoordinateType& coordType)
double R = 1.0f;
for (vtkIdType i = 0; i < dim; i++)
{
double Z =
static_cast<double>(i) / static_cast<double>(dim - 1);
double Z = static_cast<double>(i) / static_cast<double>(dim - 1);
for (vtkIdType j = 0; j < dim; j++)
{
double Theta = twoPi *
(static_cast<double>(j) / static_cast<double>(dim - 1));
pcoords->SetTuple3(i*dim + j, R, Theta, Z);
double Theta = twoPi * (static_cast<double>(j) / static_cast<double>(dim - 1));
pcoords->SetTuple3(i * dim + j, R, Theta, Z);
}
}
}
else if (coordType == CoordinateType::SPH)
{
//Spherical coordinates have some degenerate cases, so provide some good cases.
// Spherical coordinates have some degenerate cases, so provide some good cases.
double R = 1.0f;
std::vector<double> Thetas = {
eps, pi / 4, pi / 3, pi / 2, pi - eps
};
std::vector<double> Phis = {
eps, twoPi / 4, twoPi / 3, twoPi / 2, twoPi - eps
};
std::vector<double> Thetas = { eps, pi / 4, pi / 3, pi / 2, pi - eps };
std::vector<double> Phis = { eps, twoPi / 4, twoPi / 3, twoPi / 2, twoPi - eps };
for (std::size_t i = 0; i < Thetas.size(); i++)
{
for (std::size_t j = 0; j < Phis.size(); j++)
{
pcoords->SetTuple3(static_cast<vtkIdType>(i*dim + j), R, Thetas[i], Phis[j]);
pcoords->SetTuple3(static_cast<vtkIdType>(i * dim + j), R, Thetas[i], Phis[j]);
}
}
}
pd->GetPoints()->SetData(pcoords);
}
void ValidateCoordTransform(vtkPolyData* pd, vtkPolyData* pdTrans,
const std::vector<bool>& isAngle)
void ValidateCoordTransform(vtkPolyData* pd, vtkPolyData* pdTrans, const std::vector<bool>& isAngle)
{
vtkPoints* pdPoints = pd->GetPoints();
vtkPoints* pdTransPoints = pdTrans->GetPoints();
assert(pdPoints->GetNumberOfPoints() == pdTransPoints->GetNumberOfPoints());
for (vtkIdType i=0; i < pdPoints->GetNumberOfPoints(); i++)
for (vtkIdType i = 0; i < pdPoints->GetNumberOfPoints(); i++)
{
double* point = pdPoints->GetPoint(i);
double* pointTrans = pdTransPoints->GetPoint(i);
bool isEqual = true;
for (size_t j=0; j <3; j++)
for (size_t j = 0; j < 3; j++)
{
if (isAngle[j])
{
......@@ -135,13 +127,13 @@ void ValidateCoordTransform(vtkPolyData* pd, vtkPolyData* pdTrans,
{
isEqual &= ArePointsWithinTolerance(point[j], pointTrans[j]);
}
if (isEqual==false)
if (isEqual == false)
{
std::cerr << "i=" << i << " is wrong! result value=" << pointTrans[j] <<
" target value=" << point[j] <<std::endl;
std::cerr << "i=" << i << " is wrong! result value=" << pointTrans[j]
<< " target value=" << point[j] << std::endl;
}
}
assert (isEqual == true);
assert(isEqual == true);
}
}
}
......@@ -168,7 +160,7 @@ int TestVTKMCoordinateSystemTransform(int, char*[])
cstFilter->SetCylindricalToCartesian();
cstFilter->Update();
vtkPolyData* pdCylToCar = vtkPolyData::SafeDownCast(cstFilter->GetOutput());
ValidateCoordTransform(pdCart, pdCylToCar, {false, false, false});
ValidateCoordTransform(pdCart, pdCylToCar, { false, false, false });
}
// Test cylindrical to cartesian
......@@ -189,7 +181,7 @@ int TestVTKMCoordinateSystemTransform(int, char*[])
cstFilter->SetCartesianToCylindrical();
cstFilter->Update();
vtkPolyData* pdCarToCyl = vtkPolyData::SafeDownCast(cstFilter->GetOutput());
ValidateCoordTransform(pdCyl, pdCarToCyl, {true, true, false});
ValidateCoordTransform(pdCyl, pdCarToCyl, { true, true, false });
}
// Test cartesian to spherical
......@@ -205,7 +197,7 @@ int TestVTKMCoordinateSystemTransform(int, char*[])
cstFilter->SetSphericalToCartesian();
cstFilter->Update();
vtkPolyData* pdSphToCar = vtkPolyData::SafeDownCast(cstFilter->GetOutput());
ValidateCoordTransform(pdCart, pdSphToCar, {false, false, false});
ValidateCoordTransform(pdCart, pdSphToCar, { false, false, false });
}
// Test spherical to cartesian
......@@ -225,7 +217,7 @@ int TestVTKMCoordinateSystemTransform(int, char*[])
cstFilter->SetCartesianToSpherical();
cstFilter->Update();
vtkPolyData* pdCarToSph = vtkPolyData::SafeDownCast(cstFilter->GetOutput());
ValidateCoordTransform(pdSph, pdCarToSph, {false, true, true});
ValidateCoordTransform(pdSph, pdCarToSph, { false, true, true });
}
return 0;
}
......@@ -15,7 +15,8 @@ class TestError
{
public:
TestError(const std::string& message, int line)
: Message(message), Line(line)
: Message(message)
, Line(line)
{
}
......@@ -31,7 +32,9 @@ private:
#define RAISE_TEST_ERROR(msg) throw TestError((msg), __LINE__)
#define TEST_VERIFY(cond, msg) if (!(cond)) RAISE_TEST_ERROR((msg))
#define TEST_VERIFY(cond, msg) \
if (!(cond)) \
RAISE_TEST_ERROR((msg))
inline bool IsEqualFloat(double a, double b, double e = 1e-6f)
{
......@@ -53,9 +56,9 @@ void TestWithArrayHandle(const ArrayHandleType& vtkmArray)
int numberOfComponents = vtkArray->GetNumberOfComponents();
std::cout << "Number of components: " << numberOfComponents << "\n";
TEST_VERIFY(
numberOfComponents ==
internal::FlattenVec<typename ArrayHandleType::ValueType>::GetNumberOfComponents(vtkmPortal.Get(0)),
TEST_VERIFY(numberOfComponents ==
internal::FlattenVec<typename ArrayHandleType::ValueType>::GetNumberOfComponents(
vtkmPortal.Get(0)),
"Number of components don't match");
for (vtkIdType i = 0; i < length; ++i)
......@@ -66,8 +69,8 @@ void TestWithArrayHandle(const ArrayHandleType& vtkmArray)
for (int j = 0; j < numberOfComponents; ++j)
{
auto comp = internal::FlattenVec<typename ArrayHandleType::ValueType>::GetComponent(val, j);
TEST_VERIFY (IsEqualFloat(tuple[j], static_cast<double>(comp)), "values don't match");
TEST_VERIFY (IsEqualFloat(vtkArray->GetComponent(i, j), static_cast<double>(comp)),
TEST_VERIFY(IsEqualFloat(tuple[j], static_cast<double>(comp)), "values don't match");
TEST_VERIFY(IsEqualFloat(vtkArray->GetComponent(i, j), static_cast<double>(comp)),
"values don't match");
}
}
......@@ -86,11 +89,12 @@ try
std::cout << "Passed\n";
std::cout << "Testing with ArrayHandleConstant\n";
TestWithArrayHandle(vtkm::cont::make_ArrayHandleConstant(vtkm::Vec<vtkm::Vec<float, 3>, 3>{{1.0f, 2.0f, 3.0f}}, 10));
TestWithArrayHandle(vtkm::cont::make_ArrayHandleConstant(
vtkm::Vec<vtkm::Vec<float, 3>, 3>{ { 1.0f, 2.0f, 3.0f } }, 10));
std::cout << "Passed\n";
std::cout << "Testing with ArrayHandleUniformPointCoordinates\n";
TestWithArrayHandle(vtkm::cont::ArrayHandleUniformPointCoordinates(vtkm::Id3{3}));
TestWithArrayHandle(vtkm::cont::ArrayHandleUniformPointCoordinates(vtkm::Id3{ 3 }));
std::cout << "Passed\n";
return EXIT_SUCCESS;
......
......@@ -32,7 +32,8 @@ class TestError
{
public:
TestError(const std::string& message, int line)
: Message(message), Line(line)
: Message(message)
, Line(line)
{
}
......@@ -48,7 +49,9 @@ private:
#define RAISE_TEST_ERROR(msg) throw TestError((msg), __LINE__)
#define TEST_VERIFY(cond, msg) if (!(cond)) RAISE_TEST_ERROR((msg))
#define TEST_VERIFY(cond, msg) \
if (!(cond)) \
RAISE_TEST_ERROR((msg))
inline bool IsEqualFloat(double a, double b, double e = 1e-6f)
{
......@@ -68,12 +71,10 @@ inline void TestEqualCells(vtkCell* c1, vtkCell* c2)
inline void TestEqualVtkArrays(vtkAbstractArray* a1, vtkAbstractArray* a2)
{
TEST_VERIFY(std::string(a1->GetName()) == std::string(a2->GetName()),
"Array names don't match");
TEST_VERIFY(a1->GetDataType() == a2->GetDataType(),
"Array data-types don't match");
TEST_VERIFY(a1->GetNumberOfTuples() == a2->GetNumberOfTuples(),
"Array number of tuples don't match");
TEST_VERIFY(std::string(a1->GetName()) == std::string(a2->GetName()), "Array names don't match");
TEST_VERIFY(a1->GetDataType() == a2->GetDataType(), "Array data-types don't match");
TEST_VERIFY(
a1->GetNumberOfTuples() == a2->GetNumberOfTuples(), "Array number of tuples don't match");
TEST_VERIFY(a1->GetNumberOfComponents() == a2->GetNumberOfComponents(),
"Array number of components don't match");
......@@ -92,10 +93,10 @@ inline void TestEqualVtkArrays(vtkAbstractArray* a1, vtkAbstractArray* a2)
void TestDataSets(vtkDataSet* dsVtk, vtkDataSet* dsVtkm)
{
TEST_VERIFY(dsVtk->GetNumberOfPoints() == dsVtkm->GetNumberOfPoints(),
"Number of points don't match");
TEST_VERIFY(dsVtk->GetNumberOfCells() == dsVtkm->GetNumberOfCells(),
"Number of cells don't match");
TEST_VERIFY(
dsVtk->GetNumberOfPoints() == dsVtkm->GetNumberOfPoints(), "Number of points don't match");
TEST_VERIFY(
dsVtk->GetNumberOfCells() == dsVtkm->GetNumberOfCells(), "Number of cells don't match");
double bounds1[6], bounds2[6];
dsVtk->GetBounds(bounds1);
dsVtkm->GetBounds(bounds2);
......@@ -110,9 +111,8 @@ void TestDataSets(vtkDataSet* dsVtk, vtkDataSet* dsVtkm)
double x1[3], x2[3];
dsVtk->GetPoint(i, x1);
dsVtkm->GetPoint(i, x2);
TEST_VERIFY(IsEqualFloat(x1[0], x2[0]) &&
IsEqualFloat(x1[1], x2[1]) &&
IsEqualFloat(x1[2], x2[2]),
TEST_VERIFY(
IsEqualFloat(x1[0], x2[0]) && IsEqualFloat(x1[1], x2[1]) && IsEqualFloat(x1[2], x2[2]),
"'GetPoint` results don't match");
vtkNew<vtkIdList> cellIds1, cellIds2;
......@@ -124,8 +124,7 @@ void TestDataSets(vtkDataSet* dsVtk, vtkDataSet* dsVtkm)
"`GetPointCells` results don't match");
for (vtkIdType j = 0; j < cellIds1->GetNumberOfIds(); ++j)
{
TEST_VERIFY(cellIds1->GetId(j) == cellIds2->GetId(j),
"`GetPointCells` results don't match");
TEST_VERIFY(cellIds1->GetId(j) == cellIds2->GetId(j), "`GetPointCells` results don't match");
}
}
......@@ -147,22 +146,19 @@ void TestDataSets(vtkDataSet* dsVtk, vtkDataSet* dsVtkm)
IsEqualFloat(bds1[4], bds2[4]) && IsEqualFloat(bds1[5], bds2[5]),
"Cell bounds don't match");
TEST_VERIFY(dsVtk->GetCellType(i) == dsVtkm->GetCellType(i),
"Cell types don't match");
TEST_VERIFY(dsVtk->GetCellType(i) == dsVtkm->GetCellType(i), "Cell types don't match");
vtkNew<vtkIdList> ptIds1, ptIds2;
dsVtk->GetCellPoints(i, ptIds1);
dsVtkm->GetCellPoints(i, ptIds2);
for (vtkIdType j = 0; j < ptIds1->GetNumberOfIds(); ++j)
{
TEST_VERIFY(ptIds1->GetId(j) == ptIds2->GetId(j),
"`GetCellPoints` results don't match");
TEST_VERIFY(ptIds1->GetId(j) == ptIds2->GetId(j), "`GetCellPoints` results don't match");
}
}
std::default_random_engine engine;
std::uniform_real_distribution<double> d1(bounds1[0], bounds1[1]),
d2(bounds1[2], bounds1[3]),
std::uniform_real_distribution<double> d1(bounds1[0], bounds1[1]), d2(bounds1[2], bounds1[3]),
d3(bounds1[4], bounds1[5]);
static constexpr int numSamples = 100;
for (int i = 0; i < numSamples; ++i)
......@@ -177,8 +173,8 @@ void TestDataSets(vtkDataSet* dsVtk, vtkDataSet* dsVtkm)
double x1[3], x2[3];
dsVtk->GetPoint(pid1, x1);
dsVtkm->GetPoint(pid1, x2);
TEST_VERIFY(IsEqualFloat(vtkMath::Distance2BetweenPoints(x, x1),
vtkMath::Distance2BetweenPoints(x, x2)),
TEST_VERIFY(IsEqualFloat(
vtkMath::Distance2BetweenPoints(x, x1), vtkMath::Distance2BetweenPoints(x, x2)),
"`FindPoint` results don't match");
}
......@@ -192,7 +188,7 @@ void TestDataSets(vtkDataSet* dsVtk, vtkDataSet* dsVtkm)
// the boundary of those cells
if (cid1 != cid2)
{
if ( cid2 >= 0 )
if (cid2 >= 0)
{
// check if the point is inside or close to the vtkmDataSet found cell
vtkCell* cell = dsVtk->GetCell(cid2);
......@@ -211,14 +207,12 @@ void TestDataSets(vtkDataSet* dsVtk, vtkDataSet* dsVtkm)
else
{
TEST_VERIFY(IsEqualFloat(pcoords1[0], pcoords2[0]) &&
IsEqualFloat(pcoords1[1], pcoords2[1]) &&
IsEqualFloat(pcoords1[2], pcoords2[2]),
IsEqualFloat(pcoords1[1], pcoords2[1]) && IsEqualFloat(pcoords1[2], pcoords2[2]),
"`FindCell` pcoords don't match");
int count = dsVtk->GetCell(cid1)->GetNumberOfPoints();
for (int j = 0; j < count; ++j)
{
TEST_VERIFY(IsEqualFloat(weights1[j], weights2[j]),
"`FindCell` weights don't match");
TEST_VERIFY(IsEqualFloat(weights1[j], weights2[j]), "`FindCell` weights don't match");
}
}
}
......@@ -229,8 +223,7 @@ void TestDataSets(vtkDataSet* dsVtk, vtkDataSet* dsVtkm)
"Number of point-fields don't match");
for (int i = 0; i < numPointFields; ++i)
{
TestEqualVtkArrays(dsVtk->GetPointData()->GetArray(i),
dsVtkm->GetPointData()->GetArray(i));
TestEqualVtkArrays(dsVtk->GetPointData()->GetArray(i), dsVtkm->GetPointData()->GetArray(i));
}
int numCellFields = dsVtk->GetCellData()->GetNumberOfArrays();
......@@ -238,14 +231,12 @@ void TestDataSets(vtkDataSet* dsVtk, vtkDataSet* dsVtkm)
"Number of cell-fields don't match");
for (int i = 0; i < numCellFields; ++i)
{
TestEqualVtkArrays(dsVtk->GetCellData()->GetArray(i),
dsVtkm->GetCellData()->GetArray(i));
TestEqualVtkArrays(dsVtk->GetCellData()->GetArray(i), dsVtkm->GetCellData()->GetArray(i));
}
}
//-----------------------------------------------------------------------------
inline void CoordsCopy(const vtkm::cont::CoordinateSystem& coords,
vtkPoints* points)
inline void CoordsCopy(const vtkm::cont::CoordinateSystem& coords, vtkPoints* points)
{
auto ptsPortal = coords.GetData().GetPortalConstControl();
auto numPoints = coords.GetNumberOfPoints();
......@@ -261,9 +252,8 @@ inline void CoordsCopy(const vtkm::cont::CoordinateSystem& coords,
}
}
inline void FieldCopy(const vtkm::cont::ArrayHandle<float>& src,
const char* name,
vtkFloatArray* dst)
inline void FieldCopy(
const vtkm::cont::ArrayHandle<float>& src, const char* name, vtkFloatArray* dst)
{
auto portal = src.GetPortalConstControl();
vtkm::Id length = portal.GetNumberOfValues();
......@@ -291,12 +281,10 @@ void TestUniformDataSet()
auto spacing = portal.GetSpacing();
vtkNew<vtkFloatArray> pointField, cellField;
FieldCopy(dataset.GetField("pointvar").GetData().Cast<vtkm::cont::ArrayHandle<float>>(),
"pointvar",
pointField);
FieldCopy(dataset.GetField("cellvar").GetData().Cast<vtkm::cont::ArrayHandle<float>>(),
"cellvar",
cellField);
FieldCopy(dataset.GetField("pointvar").GetData().Cast<vtkm::cont::ArrayHandle<float> >(),
"pointvar", pointField);
FieldCopy(dataset.GetField("cellvar").GetData().Cast<vtkm::cont::ArrayHandle<float> >(),
"cellvar", cellField);
vtkNew<vtkImageData> imageData;
imageData->SetDimensions(dims[0], dims[1], dims[2]);
......@@ -320,18 +308,16 @@ void TestUniformDataSet()
void TestCurvilinearDataSet()
{
auto dataset = Maker.Make3DRegularDataSet0();
auto dims = dataset.GetCellSet().Cast<vtkm::cont::CellSetStructured<3>>().GetPointDimensions();
auto dims = dataset.GetCellSet().Cast<vtkm::cont::CellSetStructured<3> >().GetPointDimensions();
vtkNew<vtkPoints> points;
CoordsCopy(dataset.GetCoordinateSystem(), points);
vtkNew<vtkFloatArray> pointField, cellField;
FieldCopy(dataset.GetField("pointvar").GetData().Cast<vtkm::cont::ArrayHandle<float>>(),
"pointvar",
pointField);
FieldCopy(dataset.GetField("cellvar").GetData().Cast<vtkm::cont::ArrayHandle<float>>(),
"cellvar",
cellField);
FieldCopy(dataset.GetField("pointvar").GetData().Cast<vtkm::cont::ArrayHandle<float> >(),
"pointvar", pointField);
FieldCopy(dataset.GetField("cellvar").GetData().Cast<vtkm::cont::ArrayHandle<float> >(),
"cellvar", cellField);
vtkNew<vtkStructuredGrid> dsVtk;
dsVtk->SetDimensions(dims[0], dims[1], dims[2]);
......@@ -370,12 +356,10 @@ void TestExplicitDataSet()
}
vtkNew<vtkFloatArray> pointField, cellField;
FieldCopy(dataset.GetField("pointvar").GetData().Cast<vtkm::cont::ArrayHandle<float>>(),
"pointvar",
pointField);
FieldCopy(dataset.GetField("cellvar").GetData().Cast<vtkm::cont::ArrayHandle<float>>(),
"cellvar",
cellField);
FieldCopy(dataset.GetField("pointvar").GetData().Cast<vtkm::cont::ArrayHandle<float> >(),
"pointvar", pointField);
FieldCopy(dataset.GetField("cellvar").GetData().Cast<vtkm::cont::ArrayHandle<float> >(),
"cellvar", cellField);
vtkNew<vtkUnstructuredGrid> dsVtk;
dsVtk->SetPoints(points);
......
......@@ -37,11 +37,10 @@
#include "vtkDataArray.h"
#include "vtkPointData.h"
namespace
{
namespace {
bool Convert2DUnstructuredGridToPolyData(vtkUnstructuredGrid *in,
vtkPolyData *out)
bool Convert2DUnstructuredGridToPolyData(vtkUnstructuredGrid* in, vtkPolyData* out)
{
vtkIdType numCells = in->GetNumberOfCells();
out->AllocateEstimate(numCells, 1);
......@@ -49,11 +48,10 @@ bool Convert2DUnstructuredGridToPolyData(vtkUnstructuredGrid *in,
for (vtkIdType i = 0; i < numCells; ++i)
{