TECA
teca_cartesian_mesh_writer.h
1 #ifndef teca_cartesian_mesh_writer_h
2 #define teca_cartesian_mesh_writer_h
3 
4 #include "teca_shared_object.h"
5 #include "teca_algorithm.h"
6 #include "teca_metadata.h"
7 
8 #include <vector>
9 #include <string>
10 
11 TECA_SHARED_OBJECT_FORWARD_DECL(teca_cartesian_mesh_writer)
12 
13 
20 {
21 public:
22  TECA_ALGORITHM_STATIC_NEW(teca_cartesian_mesh_writer)
23  TECA_ALGORITHM_DELETE_COPY_ASSIGN(teca_cartesian_mesh_writer)
24  TECA_ALGORITHM_CLASS_NAME(teca_cartesian_mesh_writer)
26 
27  // report/initialize to/from Boost program options
28  // objects.
29  TECA_GET_ALGORITHM_PROPERTIES_DESCRIPTION()
30  TECA_SET_ALGORITHM_PROPERTIES()
31 
32  // set the output filename. for time series the substring
33  // %t% is replaced with the current time step.
34  TECA_ALGORITHM_PROPERTY(std::string, file_name)
35 
36  // set the output type. can be binary or ascii.
37  TECA_ALGORITHM_PROPERTY(int, binary)
38 
39  // Select the output file format. 0:bin, 1:vtr, 2:vtk, 3:auto
40  // the default is bin.
41  enum {format_bin, format_vtk, format_vtr, format_auto};
42  TECA_ALGORITHM_PROPERTY(int, output_format)
43  void set_output_format_bin(){ this->set_output_format(format_bin); }
44  void set_output_format_vtk(){ this->set_output_format(format_vtk); }
45  void set_output_format_vtr(){ this->set_output_format(format_vtr); }
46  void set_output_format_auto(){ this->set_output_format(format_auto); }
47 
48 protected:
50 
51 private:
52  const_p_teca_dataset execute(unsigned int port,
53  const std::vector<const_p_teca_dataset> &input_data,
54  const teca_metadata &request) override;
55 
56 private:
57  std::string file_name;
58  int binary;
59  int output_format;
60 };
61 
62 #endif
teca_cartesian_mesh_writer
Definition: teca_cartesian_mesh_writer.h:20
teca_metadata
Definition: teca_metadata.h:17
teca_algorithm
Definition: teca_algorithm.h:25