Commit 626c8067 authored by Kenneth Moreland's avatar Kenneth Moreland Committed by Kitware Robot
Browse files

Merge topic 'fix-mc-merge'

b544b8e0

 Fix point merge for Marching Cubes with multiple isosurfaces

Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Acked-by: Mark Bolstad's avatarMark Bolstad <mbolsta@sandia.gov>
Merge-request: !2741
parents e1e3d4af b544b8e0
data/baseline/filter/contour-uniform.png

129 Bytes | W: | H:

data/baseline/filter/contour-uniform.png

130 Bytes | W: | H:

data/baseline/filter/contour-uniform.png
data/baseline/filter/contour-uniform.png
data/baseline/filter/contour-uniform.png
data/baseline/filter/contour-uniform.png
  • 2-up
  • Swipe
  • Onion skin
data/baseline/filter/contour-wedge.png

129 Bytes | W: | H:

data/baseline/filter/contour-wedge.png

130 Bytes | W: | H:

data/baseline/filter/contour-wedge.png
data/baseline/filter/contour-wedge.png
data/baseline/filter/contour-wedge.png
data/baseline/filter/contour-wedge.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -33,18 +33,15 @@ void TestContourFilterWedge()
vtkm::cont::DataSet dataSet = reader.ReadDataSet();
vtkm::filter::contour::Contour contour;
contour.SetIsoValue(0, 1);
contour.SetIsoValues({ -1, 0, 1 });
contour.SetActiveField("gyroid");
contour.SetFieldsToPass({ "gyroid", "cellvar" });
contour.SetMergeDuplicatePoints(false);
contour.SetMergeDuplicatePoints(true);
auto result = contour.Execute(dataSet);
result.PrintSummary(std::cout);
vtkm::rendering::testing::RenderTestOptions testOptions;
testOptions.Colors = { { 0.20f, 0.80f, 0.20f } };
testOptions.EnableAnnotations = false;
testOptions.DataViewPadding = 0.08;
vtkm::rendering::testing::RenderTest(result, "gyroid", "filter/contour-wedge.png", testOptions);
}
......@@ -60,7 +57,7 @@ void TestContourFilterUniform()
vtkm::filter::contour::Contour contour;
contour.SetGenerateNormals(false);
contour.SetMergeDuplicatePoints(true);
contour.SetIsoValue(0, 100.0);
contour.SetIsoValues({ 50, 100, 150 });
contour.SetActiveField(fieldName);
contour.SetFieldsToPass(fieldName);
vtkm::cont::DataSet result = contour.Execute(inputData);
......@@ -69,8 +66,6 @@ void TestContourFilterUniform()
//Y axis Flying Edge algorithm has subtle differences at a couple of boundaries
vtkm::rendering::testing::RenderTestOptions testOptions;
testOptions.Colors = { { 0.20f, 0.80f, 0.20f } };
testOptions.EnableAnnotations = false;
vtkm::rendering::testing::RenderTest(
result, "pointvar", "filter/contour-uniform.png", testOptions);
}
......
......@@ -18,6 +18,7 @@
#include <vtkm/exec/ParametricCoordinates.h>
#include <vtkm/cont/ArrayCopy.h>
#include <vtkm/cont/ArrayCopyDevice.h>
#include <vtkm/cont/ArrayHandle.h>
#include <vtkm/cont/ArrayHandleIndex.h>
#include <vtkm/cont/ArrayHandleTransform.h>
......@@ -360,7 +361,7 @@ void MergeDuplicates(const vtkm::cont::Invoker& invoker,
vtkm::cont::ArrayHandle<vtkm::Id>& connectivity)
{
vtkm::cont::ArrayHandle<KeyType> input_keys;
vtkm::cont::ArrayCopy(original_keys, input_keys);
vtkm::cont::ArrayCopyDevice(original_keys, input_keys);
vtkm::worklet::Keys<KeyType> keys(input_keys);
input_keys.ReleaseResources();
......
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