Commit 92e083cc authored by Abhishek Yenpure's avatar Abhishek Yenpure Committed by Kitware Robot

Merge topic 'clip_segfault_fix'

7ee51f65 Adding clipping test for volumetric data
f0a342e4 Adding fix for Clip failure
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Acked-by: Matt Larsen's avatarMatt Larsen <mlarsen@cs.uoregon.edu>
Merge-request: !1495
parents c4bf46ec 7ee51f65
......@@ -91,10 +91,31 @@ void TestClipExplicit()
}
}
// Adding for testing cases like Bug #329
// Other tests cover the specific cases of clipping, this test
// is to execute the clipping filter for a larger dataset.
// In this case the output is not verified against a sample.
void TestClipVolume()
{
std::cout << "Testing Clip Filter on volumetric data" << std::endl;
vtkm::Id3 dims(10, 10, 10);
vtkm::cont::testing::MakeTestDataSet maker;
vtkm::cont::DataSet ds = maker.Make3DUniformDataSet3(dims);
vtkm::filter::ClipWithField clip;
clip.SetClipValue(0.0);
clip.SetActiveField("pointvar");
clip.SetFieldsToPass("pointvar", vtkm::cont::Field::Association::POINTS);
const vtkm::cont::DataSet outputData = clip.Execute(ds);
}
void TestClip()
{
//todo: add more clip tests
TestClipExplicit();
TestClipVolume();
}
}
......
......@@ -394,7 +394,6 @@ public:
{
(void)shape;
vtkm::Id clipIndex = clipDataIndex;
// Start index for the cells of this case.
vtkm::Id cellIndex = clipStats.NumberOfCells;
// Start index to store connevtivity of this case.
......@@ -636,15 +635,13 @@ public:
vtkm::cont::ArrayHandle<vtkm::Id> cellPointReverseConnectivity;
cellPointReverseConnectivity.Allocate(total.NumberOfInCellIndices);
vtkm::cont::ArrayHandle<vtkm::Id> cellPointInterpolationKeys;
cellPointInterpolationKeys.Allocate(total.NumberOfInCellInterpPoints);
vtkm::cont::ArrayHandle<vtkm::Id> cellPointInterpolationInfo;
cellPointInterpolationInfo.Allocate(total.NumberOfInCellInterpPoints);
vtkm::cont::ArrayHandle<vtkm::Id> cellPointEdgeReverseConnectivity;
cellPointEdgeReverseConnectivity.Allocate(total.NumberOfInCellEdgeIndices);
vtkm::cont::ArrayHandle<EdgeInterpolation> cellPointEdgeInterpolation;
cellPointEdgeInterpolation.Allocate(total.NumberOfInCellEdgeIndices);
this->InCellInterpolationKeys.Allocate(total.NumberOfInCellInterpPoints);
this->InCellInterpolationInfo.Allocate(total.NumberOfInCellInterpPoints);
this->CellMapOutputToInput.Allocate(total.NumberOfCells);
GenerateCellSet cellSetWorklet(value);
......@@ -667,8 +664,7 @@ public:
// Get unique EdgeInterpolation : unique edge points.
// LowerBound for edgeInterpolation : get index into new edge points array.
// LowerBound for cellPoitnEdgeInterpolation : get index into new edge points array.
//vtkm::cont::ArrayHandle<clipping::EdgeInterpolation> uniqueEdgeInterpolations;
// LowerBound for cellPointEdgeInterpolation : get index into new edge points array.
vtkm::cont::Algorithm::SortByKey(
edgeInterpolation, edgePointReverseConnectivity, EdgeInterpolation::LessThanOp());
vtkm::cont::Algorithm::Copy(edgeInterpolation, this->EdgePointsInterpolation);
......@@ -697,9 +693,10 @@ public:
scatterEdgePointConnectivity);
scatterEdgeDispatcher.Invoke(
edgeInterpolationIndexToUnique, edgePointReverseConnectivity, connectivity);
scatterEdgeDispatcher.Invoke(
cellInterpolationIndexToUnique, cellPointEdgeReverseConnectivity, cellPointInterpolationInfo);
//Add offset in connectivity of all new in-cell points.
scatterEdgeDispatcher.Invoke(cellInterpolationIndexToUnique,
cellPointEdgeReverseConnectivity,
this->InCellInterpolationInfo);
// Add offset in connectivity of all new in-cell points.
ScatterInCellConnectivity scatterInCellPointConnectivity(this->InCellPointsOffset);
vtkm::worklet::DispatcherMapField<ScatterInCellConnectivity> scatterInCellDispatcher(
scatterInCellPointConnectivity);
......
Markdown is supported
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