VTK  9.3.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
18 #ifndef vtkOpenVDBReader_h
19 #define vtkOpenVDBReader_h
20 
21 #include "vtkDataArraySelection.h" // needed for vtkDataArraySelection
22 #include "vtkIOOpenVDBModule.h" //needed for exports
24 #include "vtkSmartPointer.h" // needed for smart pointers
25 
26 VTK_ABI_NAMESPACE_BEGIN
27 class vtkOpenVDBReaderInternals;
28 
30 {
31 public:
32  static vtkOpenVDBReader* New();
34  void PrintSelf(ostream& os, vtkIndent indent) override;
35 
40  bool CanReadFile(VTK_FILEPATH const char*);
41 
47  const char* GetFileExtensions();
48 
50 
53  vtkSetFilePathMacro(FileName);
54  vtkGetFilePathMacro(FileName);
56 
60  const char* GetDescriptiveName();
61 
63 
70  vtkSetClampMacro(DownsamplingFactor, float, 0.01, 1.0);
71  vtkGetMacro(DownsamplingFactor, float);
73 
75 
83  vtkSetMacro(MergeImageVolumes, bool);
84  vtkGetMacro(MergeImageVolumes, bool);
85  vtkBooleanMacro(MergeImageVolumes, bool);
87 
89 
96  vtkGetMacro(MergePointSets, bool);
97  vtkSetMacro(MergePointSets, bool);
98  vtkBooleanMacro(MergePointSets, bool);
100 
102 
109  vtkGetObjectMacro(GridSelection, vtkDataArraySelection);
110  int GetNumberOfGridsSelectionArrays();
111  const char* GetGridsSelectionArrayName(int index);
112  int GetGridsSelectionArrayStatus(const char* name);
113  void SetGridsSelectionArrayStatus(const char* name, int status);
115 
120  const char* GetGridArrayName(int index);
121 
127  int GetGridArrayType(int index);
128 
132  int NumberOfGrids();
133 
134 protected:
136  ~vtkOpenVDBReader() override;
137 
138  bool LoadFile();
139  void InitializeData();
140 
141  float DownsamplingFactor = 1.0;
142 
143  char* FileName = nullptr;
144 
145  bool MergeImageVolumes = false;
146  bool MergePointSets = false;
147 
148  bool DataCorrect = true;
149 
151 
152  constexpr static const char* FILE_EXTENSIONS = ".vdb";
153  constexpr static const char* DESCRIPTIVE_NAME = "OpenVDB volumetric data file format";
154 
155  int RequestInformation(vtkInformation* request, vtkInformationVector** inputVector,
156  vtkInformationVector* outputVector) override;
157 
158  int RequestData(vtkInformation* request, vtkInformationVector** inputVector,
159  vtkInformationVector* outputVector) override;
160 
161  int RequestDataObject(vtkInformation* request, vtkInformationVector** inputVector,
162  vtkInformationVector* outputVector) override;
163 
164 private:
165  vtkOpenVDBReader(const vtkOpenVDBReader&) = delete;
166  void operator=(const vtkOpenVDBReader&) = delete;
167 
168  std::unique_ptr<vtkOpenVDBReaderInternals> Internals;
169 };
170 
171 VTK_ABI_NAMESPACE_END
172 #endif
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
Store vtkAlgorithm input/output information.
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.
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()