VTK  9.3.1
vtkOpenVDBWriter.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
12 #ifndef vtkOpenVDBWriter_h
13 #define vtkOpenVDBWriter_h
14 
15 #include "vtkIOOpenVDBModule.h" //needed for exports
16 #include "vtkSmartPointer.h" // For protected ivars
17 #include "vtkWriter.h"
18 
19 VTK_ABI_NAMESPACE_BEGIN
21 class vtkImageData;
23 class vtkOpenVDBWriterInternals;
24 class vtkPointSet;
25 class vtkScalarsToColors;
27 
28 class VTKIOOPENVDB_EXPORT vtkOpenVDBWriter : public vtkWriter
29 {
30 public:
31  static vtkOpenVDBWriter* New();
32  vtkTypeMacro(vtkOpenVDBWriter, vtkWriter);
33  void PrintSelf(ostream& os, vtkIndent indent) override;
34 
36 
39  vtkSetFilePathMacro(FileName);
40  vtkGetFilePathMacro(FileName);
42 
44 
49  vtkSetMacro(WriteAllTimeSteps, bool);
50  vtkGetMacro(WriteAllTimeSteps, bool);
52 
54 
58  virtual void SetLookupTable(vtkScalarsToColors*);
59  vtkGetObjectMacro(LookupTable, vtkScalarsToColors);
61 
63 
67  vtkSetMacro(EnableColoring, bool);
68  vtkGetMacro(EnableColoring, bool);
70 
72 
76  vtkSetMacro(EnableAlpha, bool);
77  vtkGetMacro(EnableAlpha, bool);
79 
81 
85  void SetController(vtkMultiProcessController*);
86  vtkGetObjectMacro(Controller, vtkMultiProcessController);
88 
89 protected:
91  ~vtkOpenVDBWriter() override;
92 
93  void WriteData() override;
94 
95  void WriteImageData(vtkImageData* imageData);
96  void WritePointSet(vtkPointSet* pointSet);
97 
98  // see algorithm for more info.
99  // This writer takes in vtkTable, vtkDataSet or vtkCompositeDataSet.
100  int FillInputPortInformation(int port, vtkInformation* info) override;
101 
102  // see algorithm for more info. needed here so we can request pieces.
103  int ProcessRequest(vtkInformation* request, vtkInformationVector** inputVector,
104  vtkInformationVector* outputVector) override;
105 
106  void SetRGBA(vtkIdType num, vtkUnsignedCharArray* rgba, vtkDataSetAttributes* attributes);
107 
108  char* FileName;
109 
111 
117 
119 
127 
128 private:
129  vtkOpenVDBWriter(const vtkOpenVDBWriter&) = delete;
130  void operator=(const vtkOpenVDBWriter&) = delete;
131 
133 
136  vtkMultiProcessController* Controller;
138 
139  vtkOpenVDBWriterInternals* Internals;
140  friend class vtkOpenVDBWriterInternals;
141 };
142 
143 VTK_ABI_NAMESPACE_END
144 #endif
bool EnableAlpha
For outputting the Lookup Table in the VDB file.
Store vtkAlgorithm input/output information.
vtkScalarsToColors * LookupTable
For outputting the Lookup Table in the VDB file.
concrete class for storing a set of points
Definition: vtkPointSet.h:58
int vtkIdType
Definition: vtkType.h:315
Superclass for mapping scalar values to colors.
abstract class to write data to file(s)
Definition: vtkWriter.h:34
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
bool WriteAllTimeSteps
Whether or not to write out all time steps.
a simple class to control print indentation
Definition: vtkIndent.h:28
topologically and geometrically regular array of data
Definition: vtkImageData.h:42
represent and manipulate attribute data in a dataset
bool EnableColoring
For outputting the Lookup Table in the VDB file.
virtual int FillInputPortInformation(int port, vtkInformation *info)
Fill the input port information objects for this algorithm.
dynamic, self-adjusting array of unsigned char
OpenVDB writer for vtkImageData or vtkPointSet Writes a vtkImageData or vtkPointSet as a VDB file...
Store zero or more vtkInformation instances.
static vtkAlgorithm * New()
virtual void WriteData()=0
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.