VTK  9.7.1
vtkNanoVDBWriter.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
16 #ifndef vtkNanoVDBWriter_h
17 #define vtkNanoVDBWriter_h
18 
19 #include "vtkIONanoVDBModule.h" // needed for exports
20 #include "vtkWriter.h"
21 
22 VTK_ABI_NAMESPACE_BEGIN
23 class vtkImageData;
24 class vtkInformation;
26 
27 class VTKIONANOVDB_EXPORT vtkNanoVDBWriter : public vtkWriter
28 {
29 public:
30  static vtkNanoVDBWriter* New();
31  vtkTypeMacro(vtkNanoVDBWriter, vtkWriter);
32  void PrintSelf(ostream& os, vtkIndent indent) override;
33 
35 
38  vtkSetFilePathMacro(FileName);
39  vtkGetFilePathMacro(FileName);
41 
43 
47  vtkSetMacro(WriteAllTimeSteps, bool);
48  vtkGetMacro(WriteAllTimeSteps, bool);
50 
52 
56  void SetController(vtkMultiProcessController*);
57  vtkGetObjectMacro(Controller, vtkMultiProcessController);
59 
60 protected:
62  ~vtkNanoVDBWriter() override;
63 
64  bool WriteDataAndReturn() override;
65 
66  // This writer only accepts vtkImageData input.
68 
69  // Needed so we can request pieces and time steps.
70  int ProcessRequest(vtkInformation* request, vtkInformationVector** inputVector,
71  vtkInformationVector* outputVector) override;
72 
73 private:
74  vtkNanoVDBWriter(const vtkNanoVDBWriter&) = delete;
75  void operator=(const vtkNanoVDBWriter&) = delete;
76 
77  bool WriteImageData(vtkImageData* imageData);
78 
80  char* FileName = nullptr;
81  bool WriteAllTimeSteps = false;
82 
83  // The controller for the writer to work in parallel.
84  vtkMultiProcessController* Controller = nullptr;
85 
87  int CurrentTimeIndex = 0;
88  int NumberOfTimeSteps = 1;
89 };
90 
91 VTK_ABI_NAMESPACE_END
92 #endif
Store vtkAlgorithm input/output information.
abstract class to write data to file(s)
Definition: vtkWriter.h:35
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
NanoVDB writer for vtkImageData.
a simple class to control print indentation
Definition: vtkIndent.h:28
topologically and geometrically regular array of data
Definition: vtkImageData.h:45
virtual int FillInputPortInformation(int port, vtkInformation *info)
Fill the input port information objects for this algorithm.
Store zero or more vtkInformation instances.
static vtkAlgorithm * New()
virtual bool WriteDataAndReturn()
vtkTypeBool ProcessRequest(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) override
Upstream/Downstream requests form the generalized interface through which executives invoke a algorit...
Multiprocessing communication superclass.