VTK  9.3.1
vtkAMRVelodyneReader.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
14 #ifndef vtkAMRVelodyneReader_h
15 #define vtkAMRVelodyneReader_h
16 #include "vtkAMRBaseReader.h"
17 #include "vtkIOAMRModule.h" // For export macro
18 #include <string> // for std::string
19 #include <unordered_map> // for std::unordered_map
20 #include <vector> // for std::vector
21 
22 VTK_ABI_NAMESPACE_BEGIN
23 class vtkInformation;
25 class vtkOverlappingAMR;
27 
28 class VTKIOAMR_EXPORT vtkAMRVelodyneReader : public vtkAMRBaseReader
29 {
30 public:
31  static vtkAMRVelodyneReader* New();
33  void PrintSelf(ostream& os, vtkIndent indent) override;
34 
35  int GetNumberOfBlocks() override;
36  int GetNumberOfLevels() override;
37  void SetFileName(VTK_FILEPATH const char* fileName) override;
39 
40 protected:
42  ~vtkAMRVelodyneReader() override;
43 
45  vtkInformationVector* outputVector) override;
46 
47  int RequestData(vtkInformation* vtkNotUsed(request),
48  vtkInformationVector** vtkNotUsed(inputVector), vtkInformationVector* outputVector) override;
49 
53  void ReadMetaData() override;
54 
58  int GetBlockLevel(int blockIdx) override;
59 
63  int FillMetaData() override;
64 
68  vtkUniformGrid* GetAMRGrid(int blockIdx) override;
72  void GetAMRGridData(int blockIdx, vtkUniformGrid* block, const char* field) override;
77  void GetAMRGridPointData(int vtkNotUsed(blockIdx), vtkUniformGrid* vtkNotUsed(block),
78  const char* vtkNotUsed(field)) override
79  {
80  }
81 
85  void SetUpDataArraySelections() override;
86 
87  bool IsReady;
88 
89 private:
91  void operator=(const vtkAMRVelodyneReader&) = delete;
93  void CalculateSpacing(double* dx, int lvl, double* spacing);
94  void CalculateBlockDims(int* bDims, bool isFull, int* curDims);
95  void MarkFileAsRead(char* fN);
96  bool IsFileRead(char* fN);
97  bool IsFileRead(const char* fN);
98  void UpdateFileName(int index);
99  std::vector<vtkOverlappingAMR*> amrVector;
100  std::vector<double> timeList;
101  std::vector<std::string> fileList;
102  std::unordered_map<std::string, bool> LoadedHash;
103  unsigned int currentIndex;
104 };
105 VTK_ABI_NAMESPACE_END
106 #endif
Store vtkAlgorithm input/output information.
Consists of the low-level Velodyne Reader used by the vtkAMRVelodyneReader.
virtual int GetNumberOfBlocks()=0
Returns the total number of blocks.
int RequestInformation(vtkInformation *rqst, vtkInformationVector **inputVector, vtkInformationVector *outputVector) override
Standard Pipeline methods, subclasses may override this method if needed.
virtual vtkUniformGrid * GetAMRGrid(int blockIdx)=0
Loads the block according to the index w.r.t.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void GetAMRGridPointData(int vtkNotUsed(blockIdx), vtkUniformGrid *vtkNotUsed(block), const char *vtkNotUsed(field)) override
See vtkAMRBaseReader::GetAMRGridData.
virtual void ReadMetaData()=0
Reads all the metadata from the file.
virtual int GetBlockLevel(int blockIdx)=0
Returns the block level for the given block.
int RequestData(vtkInformation *vtkNotUsed(request), vtkInformationVector **vtkNotUsed(inputVector), vtkInformationVector *outputVector) override
Standard Pipeline methods, subclasses may override this method if needed.
virtual void SetFileName(VTK_FILEPATH const char *fileName)=0
Set/Get the filename.
virtual int GetNumberOfLevels()=0
Returns the total number of levels.
a simple class to control print indentation
Definition: vtkIndent.h:28
virtual void GetAMRGridData(int blockIdx, vtkUniformGrid *block, const char *field)=0
Loads the block data.
A concrete instance of vtkAMRBaseReader that implements functionality for reading Velodyne AMR datase...
image data with blanking
#define VTK_FILEPATH
hierarchical dataset of vtkUniformGrids
Store zero or more vtkInformation instances.
vtkOverlappingAMR * GetOutput()
Get the output data object for a port on this algorithm.
An abstract class that encapsulates common functionality for all AMR readers.
static vtkOverlappingAMRAlgorithm * New()
virtual int FillMetaData()=0
Loads all the AMR metadata & constructs the LevelIdxPair12InternalIdx datastructure which maps (level...
virtual void SetUpDataArraySelections()=0
Initializes the PointDataArraySelection & CellDataArraySelection.