VTK  9.4.20241221
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
26VTK_ABI_NAMESPACE_BEGIN
27class vtkOpenVDBReaderInternals;
28
30{
31public:
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);
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
133
134protected:
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
159 vtkInformationVector* outputVector) override;
160
162 vtkInformationVector* outputVector) override;
163
164private:
165 vtkOpenVDBReader(const vtkOpenVDBReader&) = delete;
166 void operator=(const vtkOpenVDBReader&) = delete;
167
168 std::unique_ptr<vtkOpenVDBReaderInternals> Internals;
169};
170
171VTK_ABI_NAMESPACE_END
172#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
OpenVDB reader Reader for OpenVDB files.
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...
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.
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.
~vtkOpenVDBReader() override
Superclass for algorithms that produce vtkPartitionedDataSetCollectionAlgorithm.
#define VTK_FILEPATH