mirror of
https://gitlab.kitware.com/vtk/vtk-m
synced 2024-09-16 17:22:55 +00:00
Merge topic 'visit_clipping'
977d0cdb2 Removing redundant code line 33a04c34c Fixing variable name according to standard 2b4801239 Moving ClipTables d1d495d43 Fixing warnings e340cdf88 Fixing warnings d0cf80bdd Updating tests for the new Clip tables 831914f31 Fising warnings 1ca02af98 Removing whitespaces ... Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Kenneth Moreland <kmorel@sandia.gov> Acked-by: Sujin Philip <sujin.philip@kitware.com> Merge-request: !1476
This commit is contained in:
commit
80fffd1d64
@ -73,7 +73,7 @@ void TestClipStructured()
|
||||
"Wrong number of coordinate systems in the output dataset");
|
||||
VTKM_TEST_ASSERT(outputData.GetNumberOfFields() == 1,
|
||||
"Wrong number of fields in the output dataset");
|
||||
VTKM_TEST_ASSERT(outputData.GetCellSet().GetNumberOfCells() == 12,
|
||||
VTKM_TEST_ASSERT(outputData.GetCellSet().GetNumberOfCells() == 8,
|
||||
"Wrong number of cells in the output dataset");
|
||||
|
||||
vtkm::cont::DynamicArrayHandle temp = outputData.GetField("scalars").GetData();
|
||||
@ -106,6 +106,7 @@ void TestClipStructuredInverted()
|
||||
clip.SetInvertClip(invert);
|
||||
clip.SetFieldsToPass("scalars");
|
||||
auto outputData = clip.Execute(ds);
|
||||
|
||||
VTKM_TEST_ASSERT(outputData.GetNumberOfCellSets() == 1,
|
||||
"Wrong number of cellsets in the output dataset");
|
||||
VTKM_TEST_ASSERT(outputData.GetNumberOfCoordinateSystems() == 1,
|
||||
|
@ -100,6 +100,7 @@ set(header_impls
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
add_subdirectory(internal)
|
||||
add_subdirectory(clip)
|
||||
add_subdirectory(colorconversion)
|
||||
add_subdirectory(contour)
|
||||
add_subdirectory(contourtree)
|
||||
|
File diff suppressed because it is too large
Load Diff
25
vtkm/worklet/clip/CMakeLists.txt
Normal file
25
vtkm/worklet/clip/CMakeLists.txt
Normal file
@ -0,0 +1,25 @@
|
||||
##============================================================================
|
||||
## Copyright (c) Kitware, Inc.
|
||||
## All rights reserved.
|
||||
## See LICENSE.txt for details.
|
||||
## This software is distributed WITHOUT ANY WARRANTY; without even
|
||||
## the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
## PURPOSE. See the above copyright notice for more information.
|
||||
##
|
||||
## Copyright 2018 National Technology & Engineering Solutions of Sandia, LLC (NTESS).
|
||||
## Copyright 2018 UT-Battelle, LLC.
|
||||
## Copyright 2018 Los Alamos National Security.
|
||||
##
|
||||
## Under the terms of Contract DE-NA0003525 with NTESS,
|
||||
## the U.S. Government retains certain rights in this software.
|
||||
##
|
||||
## Under the terms of Contract DE-AC52-06NA25396 with Los Alamos National
|
||||
## Laboratory (LANL), the U.S. Government retains certain rights in
|
||||
## this software.
|
||||
##============================================================================
|
||||
|
||||
set(headers
|
||||
ClipTables.h
|
||||
)
|
||||
|
||||
vtkm_declare_headers(${headers})
|
2561
vtkm/worklet/clip/ClipTables.h
Normal file
2561
vtkm/worklet/clip/ClipTables.h
Normal file
File diff suppressed because it is too large
Load Diff
@ -19,7 +19,6 @@
|
||||
##============================================================================
|
||||
|
||||
set(headers
|
||||
ClipTables.h
|
||||
DispatcherBase.h
|
||||
TriangulateTables.h
|
||||
WorkletBase.h
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -125,7 +125,6 @@ vtkm::cont::DataSet MakeTestDatasetStructured()
|
||||
void TestClippingExplicit()
|
||||
{
|
||||
vtkm::cont::DataSet ds = MakeTestDatasetExplicit();
|
||||
|
||||
vtkm::worklet::Clip clip;
|
||||
bool invertClip = false;
|
||||
vtkm::cont::CellSetExplicit<> outputCellSet =
|
||||
@ -142,16 +141,16 @@ void TestClippingExplicit()
|
||||
ds.GetField("cellvar").GetData().CopyTo(cellvarIn);
|
||||
vtkm::cont::ArrayHandle<vtkm::Float32> cellvar = clip.ProcessCellField(cellvarIn);
|
||||
|
||||
vtkm::Id connectivitySize = 12;
|
||||
vtkm::Id connectivitySize = 8;
|
||||
vtkm::Id fieldSize = 7;
|
||||
vtkm::Id expectedConnectivity[] = { 5, 4, 0, 5, 0, 1, 5, 1, 6, 6, 1, 2 };
|
||||
vtkm::Id expectedConnectivity[] = { 0, 1, 5, 4, 1, 2, 6, 5 };
|
||||
Coord3D expectedCoords[] = {
|
||||
Coord3D(0.00f, 0.00f, 0.0f), Coord3D(1.00f, 0.00f, 0.0f), Coord3D(1.00f, 1.00f, 0.0f),
|
||||
Coord3D(0.00f, 1.00f, 0.0f), Coord3D(0.00f, 0.50f, 0.0f), Coord3D(0.25f, 0.75f, 0.0f),
|
||||
Coord3D(0.50f, 1.00f, 0.0f),
|
||||
};
|
||||
vtkm::Float32 expectedScalars[] = { 1, 2, 1, 0, 0.5, 0.5, 0.5 };
|
||||
std::vector<vtkm::Float32> expectedCellvar = { 100.f, 100.f, -100.f, -100.f };
|
||||
std::vector<vtkm::Float32> expectedCellvar = { 100.f, -100.f };
|
||||
|
||||
VTKM_TEST_ASSERT(outputCellSet.GetNumberOfPoints() == fieldSize,
|
||||
"Wrong number of points in cell set.");
|
||||
@ -196,11 +195,11 @@ void TestClippingStructured()
|
||||
vtkm::cont::ArrayHandle<vtkm::Float32> cellvar = clip.ProcessCellField(cellvarIn);
|
||||
|
||||
|
||||
vtkm::Id connectivitySize = 36;
|
||||
vtkm::Id connectivitySize = 28;
|
||||
vtkm::Id fieldSize = 13;
|
||||
vtkm::Id expectedConnectivity[] = { 0, 1, 9, 0, 9, 10, 0, 10, 3, 1, 2, 9,
|
||||
2, 11, 9, 2, 5, 11, 3, 10, 6, 10, 12, 6,
|
||||
12, 7, 6, 11, 5, 8, 11, 8, 12, 8, 7, 12 };
|
||||
vtkm::Id expectedConnectivity[] = { 9, 10, 3, 1, 1, 3, 0, 11, 9, 1, 5, 5, 1, 2,
|
||||
10, 12, 7, 3, 3, 7, 6, 12, 11, 5, 7, 7, 5, 8 };
|
||||
|
||||
Coord3D expectedCoords[] = {
|
||||
Coord3D(0.0f, 0.0f, 0.0f), Coord3D(1.0f, 0.0f, 0.0f), Coord3D(2.0f, 0.0f, 0.0f),
|
||||
Coord3D(0.0f, 1.0f, 0.0f), Coord3D(1.0f, 1.0f, 0.0f), Coord3D(2.0f, 1.0f, 0.0f),
|
||||
@ -209,8 +208,8 @@ void TestClippingStructured()
|
||||
Coord3D(1.0f, 1.5f, 0.0f),
|
||||
};
|
||||
vtkm::Float32 expectedScalars[] = { 1, 1, 1, 1, 0, 1, 1, 1, 1, 0.5, 0.5, 0.5, 0.5 };
|
||||
std::vector<vtkm::Float32> expectedCellvar = { -100.f, -100.f, -100.f, 100.f, 100.f, 100.f,
|
||||
30.f, 30.f, 30.f, -30.f, -30.f, -30.f };
|
||||
std::vector<vtkm::Float32> expectedCellvar = { -100.f, -100.f, 100.f, 100.f,
|
||||
30.f, 30.f, -30.f, -30.f };
|
||||
|
||||
VTKM_TEST_ASSERT(outputCellSet.GetNumberOfPoints() == fieldSize,
|
||||
"Wrong number of points in cell set.");
|
||||
@ -237,6 +236,7 @@ void TestClippingWithImplicitFunction()
|
||||
vtkm::FloatDefault radius(0.5);
|
||||
|
||||
vtkm::cont::DataSet ds = MakeTestDatasetStructured();
|
||||
|
||||
bool invertClip = false;
|
||||
vtkm::worklet::Clip clip;
|
||||
vtkm::cont::CellSetExplicit<> outputCellSet =
|
||||
@ -256,11 +256,12 @@ void TestClippingWithImplicitFunction()
|
||||
ds.GetField("cellvar").GetData().CopyTo(cellvarIn);
|
||||
vtkm::cont::ArrayHandle<vtkm::Float32> cellvar = clip.ProcessCellField(cellvarIn);
|
||||
|
||||
vtkm::Id connectivitySize = 36;
|
||||
vtkm::Id connectivitySize = 28;
|
||||
vtkm::Id fieldSize = 13;
|
||||
vtkm::Id expectedConnectivity[] = { 0, 1, 9, 0, 9, 10, 0, 10, 3, 1, 2, 9,
|
||||
2, 11, 9, 2, 5, 11, 3, 10, 6, 10, 12, 6,
|
||||
12, 7, 6, 11, 5, 8, 11, 8, 12, 8, 7, 12 };
|
||||
|
||||
vtkm::Id expectedConnectivity[] = { 9, 10, 3, 1, 1, 3, 0, 11, 9, 1, 5, 5, 1, 2,
|
||||
10, 12, 7, 3, 3, 7, 6, 12, 11, 5, 7, 7, 5, 8 };
|
||||
|
||||
Coord3D expectedCoords[] = {
|
||||
Coord3D(0.0f, 0.0f, 0.0f), Coord3D(1.0f, 0.0f, 0.0f), Coord3D(2.0f, 0.0f, 0.0f),
|
||||
Coord3D(0.0f, 1.0f, 0.0f), Coord3D(1.0f, 1.0f, 0.0f), Coord3D(2.0f, 1.0f, 0.0f),
|
||||
@ -269,9 +270,8 @@ void TestClippingWithImplicitFunction()
|
||||
Coord3D(1.0f, 1.25f, 0.0f),
|
||||
};
|
||||
vtkm::Float32 expectedScalars[] = { 1, 1, 1, 1, 0, 1, 1, 1, 1, 0.25, 0.25, 0.25, 0.25 };
|
||||
std::vector<vtkm::Float32> expectedCellvar = { -100.f, -100.f, -100.f, 100.f, 100.f, 100.f,
|
||||
30.f, 30.f, 30.f, -30.f, -30.f, -30.f };
|
||||
|
||||
std::vector<vtkm::Float32> expectedCellvar = { -100.f, -100.f, 100.f, 100.f,
|
||||
30.f, 30.f, -30.f, -30.f };
|
||||
|
||||
VTKM_TEST_ASSERT(
|
||||
TestArrayHandle(outputCellSet.GetConnectivityArray(vtkm::TopologyElementTagPoint(),
|
||||
@ -295,6 +295,7 @@ void TestClippingWithImplicitFunctionInverted()
|
||||
vtkm::FloatDefault radius(0.5);
|
||||
|
||||
vtkm::cont::DataSet ds = MakeTestDatasetStructured();
|
||||
|
||||
bool invertClip = true;
|
||||
vtkm::worklet::Clip clip;
|
||||
vtkm::cont::CellSetExplicit<> outputCellSet =
|
||||
@ -316,7 +317,7 @@ void TestClippingWithImplicitFunctionInverted()
|
||||
|
||||
vtkm::Id connectivitySize = 12;
|
||||
vtkm::Id fieldSize = 13;
|
||||
vtkm::Id expectedConnectivity[] = { 4, 10, 9, 4, 9, 11, 4, 12, 10, 4, 11, 12 };
|
||||
vtkm::Id expectedConnectivity[] = { 10, 9, 4, 9, 11, 4, 12, 10, 4, 11, 12, 4 };
|
||||
Coord3D expectedCoords[] = {
|
||||
Coord3D(0.0f, 0.0f, 0.0f), Coord3D(1.0f, 0.0f, 0.0f), Coord3D(2.0f, 0.0f, 0.0f),
|
||||
Coord3D(0.0f, 1.0f, 0.0f), Coord3D(1.0f, 1.0f, 0.0f), Coord3D(2.0f, 1.0f, 0.0f),
|
||||
|
Loading…
Reference in New Issue
Block a user