VTK  9.2.6
vtkAMRVelodyneReader.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkAMRVelodyneReader.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14  =========================================================================*/
26 #ifndef vtkAMRVelodyneReader_h
27 #define vtkAMRVelodyneReader_h
28 #include "vtkAMRBaseReader.h"
29 #include "vtkIOAMRModule.h" // For export macro
30 #include <string> // for std::string
31 #include <unordered_map> // for std::unordered_map
32 #include <vector> // for std::vector
33 
34 class vtkInformation;
36 class vtkOverlappingAMR;
38 
39 class VTKIOAMR_EXPORT vtkAMRVelodyneReader : public vtkAMRBaseReader
40 {
41 public:
42  static vtkAMRVelodyneReader* New();
44  void PrintSelf(ostream& os, vtkIndent indent) override;
45 
46  int GetNumberOfBlocks() override;
47  int GetNumberOfLevels() override;
48  void SetFileName(VTK_FILEPATH const char* fileName) override;
50 
51 protected:
53  ~vtkAMRVelodyneReader() override;
54 
56  vtkInformationVector* outputVector) override;
57 
58  int RequestData(vtkInformation* vtkNotUsed(request),
59  vtkInformationVector** vtkNotUsed(inputVector), vtkInformationVector* outputVector) override;
60 
64  void ReadMetaData() override;
65 
69  int GetBlockLevel(const int blockIdx) override;
70 
74  int FillMetaData() override;
75 
79  vtkUniformGrid* GetAMRGrid(const int blockIdx) override;
83  void GetAMRGridData(const int blockIdx, vtkUniformGrid* block, const char* field) override;
88  void GetAMRGridPointData(const int vtkNotUsed(blockIdx), vtkUniformGrid* vtkNotUsed(block),
89  const char* vtkNotUsed(field)) override
90  {
91  ;
92  }
93 
97  void SetUpDataArraySelections() override;
98 
99  bool IsReady;
100 
101 private:
103  void operator=(const vtkAMRVelodyneReader&) = delete;
105  void CalculateSpacing(double* dx, int lvl, double* spacing);
106  void CalculateBlockDims(int* bDims, bool isFull, int* curDims);
107  void MarkFileAsRead(char* fN);
108  bool IsFileRead(char* fN);
109  bool IsFileRead(const char* fN);
110  void UpdateFileName(int index);
111  std::vector<vtkOverlappingAMR*> amrVector;
112  std::vector<double> timeList;
113  std::vector<std::string> fileList;
114  std::unordered_map<std::string, bool> LoadedHash;
115  unsigned int currentIndex;
116 };
117 #endif
virtual vtkUniformGrid * GetAMRGrid(const int blockIdx)=0
Loads the block according to the index w.r.t.
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.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
virtual void ReadMetaData()=0
Reads all the metadata from the file.
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.
void GetAMRGridPointData(const int vtkNotUsed(blockIdx), vtkUniformGrid *vtkNotUsed(block), const char *vtkNotUsed(field)) override
See vtkAMRBaseReader::GetAMRGridData.
a simple class to control print indentation
Definition: vtkIndent.h:39
virtual void GetAMRGridData(const int blockIdx, vtkUniformGrid *block, const char *field)=0
Loads the block data.
virtual int GetBlockLevel(const int blockIdx)=0
Returns the block level for the given block.
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.