vtk-m/tutorial/contour_two_fields.cxx

38 lines
1.3 KiB
C++
Raw Normal View History

//============================================================================
// 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.
//============================================================================
2022-01-05 20:30:40 +00:00
// Example 3: do a contour (but only evaluate two fields), write it out.
//
#include <vtkm/cont/Initialize.h>
#include <vtkm/filter/contour/Contour.h>
#include <vtkm/io/VTKDataSetReader.h>
#include <vtkm/io/VTKDataSetWriter.h>
2022-01-05 20:30:40 +00:00
int main(int argc, char** argv)
{
vtkm::cont::Initialize(argc, argv);
2022-01-05 20:30:40 +00:00
vtkm::io::VTKDataSetReader reader("data/kitchen.vtk");
vtkm::cont::DataSet ds_from_file = reader.ReadDataSet();
vtkm::filter::contour::Contour contour;
2022-01-05 20:30:40 +00:00
contour.SetActiveField("c1");
contour.SetFieldsToPass({ "c1", "ke" });
contour.SetNumberOfIsoValues(3);
contour.SetIsoValue(0, 0.05);
contour.SetIsoValue(1, 0.10);
contour.SetIsoValue(2, 0.15);
vtkm::cont::DataSet ds_from_contour = contour.Execute(ds_from_file);
2022-01-05 20:30:40 +00:00
vtkm::io::VTKDataSetWriter writer("out_mc_2fields.vtk");
writer.WriteDataSet(ds_from_contour);
2022-01-05 20:30:40 +00:00
return 0;
}