@@ -82,18 +82,12 @@ using ::copysign;
8282
8383#include < vtkm/Version.h>
8484#include < vtkm/cont/DataSetBuilderUniform.h>
85- #include < vtkm/filter/Contour.h>
85+ #include < vtkm/filter/Contour/Contour .h>
8686
8787#include < cassert>
8888#include < set>
8989#include < vector>
9090
91- #if VTKM_VERSION_MINOR < 6 && VTKM_VERSION_PATCH > 0
92- // 1.5.1
93- #define ReadPortal GetPortalConstControl
94- #define make_ArrayHandleMove (v ) make_ArrayHandle(v, vtkm::CopyFlag::Off)
95- #endif
96-
9791/* *
9892 * Make a copy of a field (with operator()) and expose an array-like data access
9993 * API (operator[], empty(), size()).
@@ -342,13 +336,21 @@ static int ContourSurfVolumeVtkm(PyMOLGlobals* G, Isofield* field, float level,
342336 }
343337 }
344338
345- auto dataSet = vtkm::cont::DataSetBuilderUniform ().Create (pointDimensions);
346- dataSet.GetCoordinateSystem ().SetData (
347- vtkm::cont::make_ArrayHandleMove (std::move (coorddata)));
348- dataSet.AddField (vtkm::cont::make_Field (pointFieldName,
349- vtkm::cont::Field::Association::POINTS, pointdata, vtkm::CopyFlag::Off));
339+ vtkm::cont::CellSetStructured<3 > cellSet;
340+ cellSet.SetPointDimensions (pointDimensions);
341+
342+ vtkm::cont::DataSet dataSet;
343+ dataSet.SetCellSet (cellSet);
344+
345+ vtkm::cont::CoordinateSystem coordinateSystem (
346+ " coordinates" , vtkm::cont::make_ArrayHandleMove (std::move (coorddata)));
347+
348+ dataSet.AddCoordinateSystem (coordinateSystem);
349+
350+ dataSet.AddField (vtkm::cont::make_Field (pointFieldName,
351+ vtkm::cont::Field::Association::Points, pointdata, vtkm::CopyFlag::Off));
350352
351- vtkm::filter::Contour filter;
353+ vtkm::filter::contour:: Contour filter;
352354 filter.SetIsoValue (level);
353355 filter.SetActiveField (pointFieldName);
354356 filter.SetGenerateNormals (mode == cIsosurfaceMode::triangles_grad_normals ||
@@ -362,12 +364,12 @@ static int ContourSurfVolumeVtkm(PyMOLGlobals* G, Isofield* field, float level,
362364 if (filter.GetGenerateNormals ()) {
363365 outputData.GetPointField (filter.GetNormalArrayName ())
364366 .GetData ()
365- .CastAndCall (normalscopy);
367+ .CastAndCallForTypes <vtkm::TypeListAll, VTKM_DEFAULT_STORAGE_LIST> (normalscopy);
366368 }
367369
368370 auto const & vertices = outputData.GetCoordinateSystem ();
369371 auto const & cellsetsingletype =
370- outputData.GetCellSet ().Cast <vtkm::cont::CellSetSingleType<>>();
372+ outputData.GetCellSet ().AsCellSet <vtkm::cont::CellSetSingleType<>>();
371373
372374 side = get_adjusted_side (level, side);
373375
0 commit comments