vtk-m/examples/tetrahedra/Tetrahedralize.cxx
Kenneth Moreland 796ec9638e Document data that comes from VisIt tutorial
Some of the data sets that are included from VTK-m are derived from the
VisIt Tutorial Data (https://www.visitusers.org/index.php?title=Tutorial_Data).
These are covered by the VisIt license, as communicated by Eric Brugger.

Although the license for these data is compatible with VTK-m's license,
we should still attribute the source of the data and make clear the
copyrights. The data are moved into the third_party directory, and
readmes are added to document everything.

The noise.vtk and noise.bov files have been renamed example.vtk and
example_temp.bov to match the name of the file in the VisIt tutorial
data archive. The ucd3d.vtk file, which is similar to the curv3d.silo
data but altered, has been removed. It was not used for any tests. It
was referenced in a couple of example programs, but the reference is
easily changed.
2023-03-14 12:25:21 -06:00

50 lines
1.5 KiB
C++

//============================================================================
// 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.
//============================================================================
#include <vtkm/cont/Initialize.h>
#include <vtkm/io/VTKDataSetReader.h>
#include <vtkm/io/VTKDataSetWriter.h>
#include <vtkm/filter/geometry_refinement/Tetrahedralize.h>
#include <cstdlib>
#include <iostream>
int main(int argc, char* argv[])
{
vtkm::cont::Initialize(argc, argv);
if ((argc < 2) || (argc > 3))
{
std::cerr << "Usage: " << argv[0] << " in_data.vtk [out_data.vtk]\n\n";
std::cerr << "For example, you could use the example.vtk that comes with the VTK-m source:\n\n";
std::cerr << " " << argv[0]
<< " <path-to-vtkm-source>/data/data/third_party/visit/example.vtk\n";
return 1;
}
std::string infilename = argv[1];
std::string outfilename = "out_tets.vtk";
if (argc == 3)
{
outfilename = argv[2];
}
vtkm::io::VTKDataSetReader reader(infilename);
vtkm::cont::DataSet input = reader.ReadDataSet();
vtkm::filter::geometry_refinement::Tetrahedralize tetrahedralizeFilter;
vtkm::cont::DataSet output = tetrahedralizeFilter.Execute(input);
vtkm::io::VTKDataSetWriter writer(outfilename);
writer.WriteDataSet(output);
return 0;
}