VTK  9.5.20251217
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
43 bool CanReadFile(VTK_FILEPATH const char*);
44
50 const char* GetFileExtensions();
51
53
59
61
68
72 const char* GetDescriptiveName();
73
75
82 vtkSetClampMacro(DownsamplingFactor, float, 0.01, 1.0);
83 vtkGetMacro(DownsamplingFactor, float);
85
87
95 vtkSetMacro(MergeImageVolumes, bool);
96 vtkGetMacro(MergeImageVolumes, bool);
97 vtkBooleanMacro(MergeImageVolumes, bool);
99
101
108 vtkGetMacro(MergePointSets, bool);
109 vtkSetMacro(MergePointSets, bool);
110 vtkBooleanMacro(MergePointSets, bool);
112
114
123 const char* GetGridsSelectionArrayName(int index);
124 int GetGridsSelectionArrayStatus(const char* name);
125 void SetGridsSelectionArrayStatus(const char* name, int status);
127
132 const char* GetGridArrayName(int index);
133
139 int GetGridArrayType(int index);
140
145
150
151protected:
154
155 bool LoadFile();
157
159
160 char* FileName = nullptr;
161
162 bool MergeImageVolumes = false;
163 bool MergePointSets = false;
164
165 bool DataCorrect = true;
166
168
169 constexpr static const char* FILE_EXTENSIONS = ".vdb";
170 constexpr static const char* DESCRIPTIVE_NAME = "OpenVDB volumetric data file format";
171
173 vtkInformationVector* outputVector) override;
174
176 vtkInformationVector* outputVector) override;
177
179 vtkInformationVector* outputVector) override;
180
181private:
182 vtkOpenVDBReader(const vtkOpenVDBReader&) = delete;
183 void operator=(const vtkOpenVDBReader&) = delete;
184
186
187 std::unique_ptr<vtkOpenVDBReaderInternals> Internals;
188};
189
190VTK_ABI_NAMESPACE_END
191#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.
bool CanReadFile(const char *)
Returns whether a file can be read by the reader or not.
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...
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
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:323
#define VTK_FILEPATH