VTK  9.3.0
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 
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);
113  void SetGridsSelectionArrayStatus(const char* name, int status);
115 
120  const char* GetGridArrayName(int index);
121 
128 
133 
134 protected:
136  ~vtkOpenVDBReader() override = default;
137 
138  bool LoadFile();
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 
156  vtkInformationVector* outputVector) override;
157 
158  int RequestData(vtkInformation* request, vtkInformationVector** inputVector,
159  vtkInformationVector* outputVector) override;
160 
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
Store on/off settings for data arrays, etc.
a simple class to control print indentation
Definition: vtkIndent.h:29
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
OpenVDB reader Reader for OpenVDB files.
int NumberOfGrids()
Get the total number of grids available in the file.
vtkNew< vtkDataArraySelection > GridSelection
int RequestDataObject(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) override
Methods for subclasses to override to handle different pipeline requests.
static vtkOpenVDBReader * New()
int RequestInformation(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) override
Methods for subclasses to override to handle different pipeline requests.
void SetGridsSelectionArrayStatus(const char *name, int status)
Standard interface to a vtkDataArraySelection object, allowing the user to choose the grids they want...
vtkGetFilePathMacro(FileName)
Set/get the file name to be opened by the reader.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
int GetGridsSelectionArrayStatus(const char *name)
Standard interface to a vtkDataArraySelection object, allowing the user to choose the grids they want...
int GetNumberOfGridsSelectionArrays()
Standard interface to a vtkDataArraySelection object, allowing the user to choose the grids they want...
const char * GetDescriptiveName()
Return a descriptive name for the file format that might be useful in a GUI.
vtkSetFilePathMacro(FileName)
Set/get the file name to be opened by the reader.
int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) override
Methods for subclasses to override to handle different pipeline requests.
const char * GetFileExtensions()
Get the file extensions for this format.
~vtkOpenVDBReader() override=default
int GetGridArrayType(int index)
Get the VTK object type corresponding to a given grid index.
const char * GetGridArrayName(int index)
Get the name of the grid with the given index in the input.
bool CanReadFile(VTK_FILEPATH const char *)
Returns whether a file can be read by the reader or not.
const char * GetGridsSelectionArrayName(int index)
Standard interface to a vtkDataArraySelection object, allowing the user to choose the grids they want...
Superclass for algorithms that produce vtkPartitionedDataSetCollectionAlgorithm.
@ name
Definition: vtkX3D.h:219
@ index
Definition: vtkX3D.h:246
#define VTK_FILEPATH