VTK  9.7.1
vtkOpenVDBReader.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
20 #ifndef vtkOpenVDBReader_h
21 #define vtkOpenVDBReader_h
22 
23 #include "vtkDataArraySelection.h" // needed for vtkDataArraySelection
24 #include "vtkIOOpenVDBModule.h" //needed for exports
26 #include "vtkSmartPointer.h" // needed for smart pointers
27 
28 VTK_ABI_NAMESPACE_BEGIN
29 class vtkResourceStream;
30 class vtkOpenVDBReaderInternals;
31 
33 {
34 public:
35  static vtkOpenVDBReader* New();
37  void PrintSelf(ostream& os, vtkIndent indent) override;
38 
40 
48  bool CanReadFile(VTK_FILEPATH const char* name);
49  static bool CanReadFile(vtkResourceStream* stream);
51 
57  const char* GetFileExtensions();
58 
60 
63  vtkSetFilePathMacro(FileName);
64  vtkGetFilePathMacro(FileName);
66 
68 
72  void SetStream(vtkResourceStream* stream);
73  vtkResourceStream* GetStream() const;
75 
79  const char* GetDescriptiveName();
80 
82 
89  vtkSetClampMacro(DownsamplingFactor, float, 0.01, 1.0);
90  vtkGetMacro(DownsamplingFactor, float);
92 
94 
102  vtkSetMacro(MergeImageVolumes, bool);
103  vtkGetMacro(MergeImageVolumes, bool);
104  vtkBooleanMacro(MergeImageVolumes, bool);
106 
108 
115  vtkGetMacro(MergePointSets, bool);
116  vtkSetMacro(MergePointSets, bool);
117  vtkBooleanMacro(MergePointSets, bool);
119 
121 
128  vtkGetObjectMacro(GridSelection, vtkDataArraySelection);
129  int GetNumberOfGridsSelectionArrays();
130  const char* GetGridsSelectionArrayName(int index);
131  int GetGridsSelectionArrayStatus(const char* name);
132  void SetGridsSelectionArrayStatus(const char* name, int status);
134 
139  const char* GetGridArrayName(int index);
140 
146  int GetGridArrayType(int index);
147 
151  int NumberOfGrids();
152 
156  vtkMTimeType GetMTime() override;
157 
158 protected:
160  ~vtkOpenVDBReader() override;
161 
162  bool LoadFile();
163  void InitializeData();
164 
165  float DownsamplingFactor = 1.0;
166 
167  char* FileName = nullptr;
168 
169  bool MergeImageVolumes = false;
170  bool MergePointSets = false;
171 
172  bool DataCorrect = true;
173 
175 
176  constexpr static const char* FILE_EXTENSIONS = ".vdb";
177  constexpr static const char* DESCRIPTIVE_NAME = "OpenVDB volumetric data file format";
178 
179  int RequestInformation(vtkInformation* request, vtkInformationVector** inputVector,
180  vtkInformationVector* outputVector) override;
181 
182  int RequestData(vtkInformation* request, vtkInformationVector** inputVector,
183  vtkInformationVector* outputVector) override;
184 
185  int RequestDataObject(vtkInformation* request, vtkInformationVector** inputVector,
186  vtkInformationVector* outputVector) override;
187 
188 private:
189  vtkOpenVDBReader(const vtkOpenVDBReader&) = delete;
190  void operator=(const vtkOpenVDBReader&) = delete;
191 
193 
194  std::unique_ptr<vtkOpenVDBReaderInternals> Internals;
195 };
196 
197 VTK_ABI_NAMESPACE_END
198 #endif
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
Abstract class used for custom streams.
Store vtkAlgorithm input/output information.
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:318
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
Methods for subclasses to override to handle different pipeline requests.
OpenVDB reader Reader for OpenVDB files.
vtkNew< vtkDataArraySelection > GridSelection
virtual int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
Methods for subclasses to override to handle different pipeline requests.
a simple class to control print indentation
Definition: vtkIndent.h:28
Store on/off settings for data arrays, etc.
virtual vtkMTimeType GetMTime()
Return this object's modified time.
Superclass for algorithms that produce vtkPartitionedDataSetCollectionAlgorithm.
virtual int RequestDataObject(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
Methods for subclasses to override to handle different pipeline requests.
#define VTK_FILEPATH
Store zero or more vtkInformation instances.
static vtkAlgorithm * New()