VTK  9.6.20260206
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
19
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
28VTK_ABI_NAMESPACE_BEGIN
30class vtkOpenVDBReaderInternals;
31
33{
34public:
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
66
68
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
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
152
157
158protected:
161
162 bool LoadFile();
164
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
180 vtkInformationVector* outputVector) override;
181
183 vtkInformationVector* outputVector) override;
184
186 vtkInformationVector* outputVector) override;
187
188private:
189 vtkOpenVDBReader(const vtkOpenVDBReader&) = delete;
190 void operator=(const vtkOpenVDBReader&) = delete;
191
193
194 std::unique_ptr<vtkOpenVDBReaderInternals> Internals;
195};
196
197VTK_ABI_NAMESPACE_END
198#endif
Store on/off settings for data arrays, etc.
a simple class to control print indentation
Definition vtkIndent.h:108
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
Allocate and hold a VTK object.
Definition vtkNew.h:167
const char * GetFileExtensions()
Get the file extensions for this format.
int NumberOfGrids()
Get the total number of grids available in the file.
const char * GetGridsSelectionArrayName(int index)
Standard interface to a vtkDataArraySelection object, allowing the user to choose the grids they want...
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...
static constexpr const char * DESCRIPTIVE_NAME
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...
bool CanReadFile(const char *name)
Return true if, after a quick check of file header, it looks like the provided file or stream can be ...
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 * GetDescriptiveName()
Return a descriptive name for the file format that might be useful in a GUI.
static constexpr const char * FILE_EXTENSIONS
static bool CanReadFile(vtkResourceStream *stream)
Return true if, after a quick check of file header, it looks like the provided file or stream can be ...
vtkResourceStream * GetStream() const
Specify stream to read from When both Stream and Filename are set, stream is used.
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.
void SetStream(vtkResourceStream *stream)
Specify stream to read from When both Stream and Filename are set, stream is used.
~vtkOpenVDBReader() override
vtkMTimeType GetMTime() override
Overridden to take into account mtime from the internal vtkResourceStream.
Abstract class used for custom streams.
Hold a reference to a vtkObjectBase instance.
vtkTypeUInt32 vtkMTimeType
Definition vtkType.h:309
#define VTK_FILEPATH