2020-04-29 15:11:02 +00:00
|
|
|
//============================================================================
|
|
|
|
// 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.
|
|
|
|
//============================================================================
|
|
|
|
#ifndef vtk_m_io_DataSetWriter_h
|
|
|
|
#define vtk_m_io_DataSetWriter_h
|
|
|
|
|
|
|
|
#include <vtkm/cont/DataSet.h>
|
|
|
|
|
2020-05-19 19:29:04 +00:00
|
|
|
#include <vtkm/io/vtkm_io_export.h>
|
2020-04-29 15:11:02 +00:00
|
|
|
|
|
|
|
namespace vtkm
|
|
|
|
{
|
|
|
|
namespace io
|
|
|
|
{
|
|
|
|
|
2021-10-11 18:41:30 +00:00
|
|
|
// Might want to place this somewhere else.
|
|
|
|
enum struct FileType
|
|
|
|
{
|
|
|
|
ASCII,
|
|
|
|
BINARY
|
|
|
|
};
|
|
|
|
|
2020-05-19 19:29:04 +00:00
|
|
|
struct VTKM_IO_EXPORT VTKDataSetWriter
|
2020-04-29 15:11:02 +00:00
|
|
|
{
|
|
|
|
public:
|
2020-05-19 19:29:04 +00:00
|
|
|
VTKM_CONT VTKDataSetWriter(const char* fileName);
|
|
|
|
VTKM_CONT VTKDataSetWriter(const std::string& fileName);
|
2020-04-29 15:11:02 +00:00
|
|
|
|
2020-07-24 19:42:39 +00:00
|
|
|
VTKM_CONT void WriteDataSet(const vtkm::cont::DataSet& dataSet) const;
|
2020-04-29 15:11:02 +00:00
|
|
|
|
2021-10-11 18:41:30 +00:00
|
|
|
/// \brief Get whether the file will be written in ASCII or binary format.
|
|
|
|
///
|
|
|
|
VTKM_CONT vtkm::io::FileType GetFileType() const;
|
|
|
|
|
|
|
|
/// \{
|
|
|
|
/// \brief Set whether the file will be written in ASCII or binary format.
|
|
|
|
VTKM_CONT void SetFileType(vtkm::io::FileType type);
|
|
|
|
VTKM_CONT void SetFileTypeToAscii() { this->SetFileType(vtkm::io::FileType::ASCII); }
|
|
|
|
VTKM_CONT void SetFileTypeToBinary() { this->SetFileType(vtkm::io::FileType::BINARY); }
|
|
|
|
/// \}
|
|
|
|
|
2020-04-29 15:11:02 +00:00
|
|
|
private:
|
|
|
|
std::string FileName;
|
2021-10-11 18:41:30 +00:00
|
|
|
vtkm::io::FileType FileType = vtkm::io::FileType::ASCII;
|
2020-04-29 15:11:02 +00:00
|
|
|
|
|
|
|
}; //struct VTKDataSetWriter
|
|
|
|
}
|
|
|
|
} //namespace vtkm::io
|
|
|
|
|
|
|
|
#endif //vtk_m_io_DataSetWriter_h
|