mirror of
https://gitlab.kitware.com/vtk/vtk-m
synced 2024-09-08 13:23:51 +00:00
Add test whether GlobalPointDimensions are preserved
This commit is contained in:
parent
84e719ae17
commit
523c8f3f21
@ -29,7 +29,9 @@ public:
|
||||
// Change point index start from 0, 0 to 10, 14
|
||||
vtkm::cont::CellSetStructured<2> cellSet;
|
||||
dataset.GetCellSet().AsCellSet(cellSet);
|
||||
cellSet.SetGlobalPointDimensions(vtkm::Id2{ 15, 19 });
|
||||
cellSet.SetGlobalPointIndexStart(vtkm::Id2{ 10, 14 });
|
||||
//cellSet.SetGlobalPointIndexStart(vtkm::Id2{ 0, 0 });
|
||||
dataset.SetCellSet(cellSet);
|
||||
dataset.PrintSummary(std::cout);
|
||||
|
||||
@ -39,6 +41,7 @@ public:
|
||||
vtkm::filter::entity_extraction::ExtractStructured extract;
|
||||
extract.SetVOI(range);
|
||||
extract.SetSampleRate(sample);
|
||||
//extract.SetVOIIsGlobal(true);
|
||||
|
||||
extract.SetFieldsToPass({ "pointvar", "cellvar" });
|
||||
vtkm::cont::DataSet output = extract.Execute(dataset);
|
||||
@ -53,6 +56,11 @@ public:
|
||||
"Wrong result for ExtractStructured PointIndexStart");
|
||||
VTKM_TEST_ASSERT(test_equal(outputCellSet.GetGlobalPointIndexStart()[1], 15),
|
||||
"Wrong result for ExtractStructured PointIndexStart");
|
||||
VTKM_TEST_ASSERT(test_equal(outputCellSet.GetGlobalPointDimensions()[0], 15),
|
||||
"Wrong result for ExtractStructured GlobalPointDimensions");
|
||||
VTKM_TEST_ASSERT(test_equal(outputCellSet.GetGlobalPointDimensions()[1], 19),
|
||||
"Wrong result for ExtractStructured GlobalPointDimensions");
|
||||
|
||||
|
||||
vtkm::cont::ArrayHandle<vtkm::Float32> outPointData;
|
||||
output.GetField("pointvar").GetData().AsArrayHandle(outPointData);
|
||||
|
Loading…
Reference in New Issue
Block a user