VTK  9.1.0
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  =========================================================================*/
23 #ifndef vtkAMRVelodyneReader_h
24 #define vtkAMRVelodyneReader_h
25 #include "vtkAMRBaseReader.h"
26 #include "vtkIOAMRModule.h" // For export macro
27 #include <string> // for std::string
28 #include <unordered_map> // for std::unordered_map
29 #include <vector> // for std::vector
30 
31 class vtkInformation;
33 class vtkOverlappingAMR;
35 
36 class VTKIOAMR_EXPORT vtkAMRVelodyneReader : public vtkAMRBaseReader
37 {
38 public:
41  void PrintSelf(ostream& os, vtkIndent indent) override;
42 
43  int GetNumberOfBlocks() override;
44  int GetNumberOfLevels() override;
45  void SetFileName(VTK_FILEPATH const char* fileName) override;
47 
48 protected:
51 
53  vtkInformationVector* outputVector) override;
54 
55  int RequestData(vtkInformation* vtkNotUsed(request),
56  vtkInformationVector** vtkNotUsed(inputVector), vtkInformationVector* outputVector) override;
57 
61  void ReadMetaData() override;
62 
66  int GetBlockLevel(const int blockIdx) override;
67 
71  int FillMetaData() override;
72 
76  vtkUniformGrid* GetAMRGrid(const int blockIdx) override;
80  void GetAMRGridData(const int blockIdx, vtkUniformGrid* block, const char* field) override;
85  void GetAMRGridPointData(const int vtkNotUsed(blockIdx), vtkUniformGrid* vtkNotUsed(block),
86  const char* vtkNotUsed(field)) override
87  {
88  ;
89  }
90 
94  void SetUpDataArraySelections() override;
95 
96  bool IsReady;
97 
98 private:
100  void operator=(const vtkAMRVelodyneReader&) = delete;
102  void CalculateSpacing(double* dx, int lvl, double* spacing);
103  void CalculateBlockDims(int* bDims, bool isFull, int* curDims);
104  void MarkFileAsRead(char* fN);
105  bool IsFileRead(char* fN);
106  bool IsFileRead(const char* fN);
107  void UpdateFileName(int index);
108  std::vector<vtkOverlappingAMR*> amrVector;
109  std::vector<double> timeList;
110  std::vector<std::string> fileList;
111  std::unordered_map<std::string, bool> LoadedHash;
112  unsigned int currentIndex;
113 };
114 #endif
vtkAMRVelodyneReader::vtkAMRVelodyneReader
vtkAMRVelodyneReader()
vtkAMRVelodyneReader::GetAMRGridData
void GetAMRGridData(const int blockIdx, vtkUniformGrid *block, const char *field) override
See vtkAMRBaseReader::GetAMRGridData.
VTK_FILEPATH
#define VTK_FILEPATH
Definition: vtkWrappingHints.h:46
vtkAMRVelodyneReader::New
static vtkAMRVelodyneReader * New()
vtkAMRVelodyneReader
A concrete instance of vtkAMRBaseReader that implements functionality for reading Velodyne AMR datase...
Definition: vtkAMRVelodyneReader.h:37
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:145
vtkAMRVelodyneReader::GetAMRGrid
vtkUniformGrid * GetAMRGrid(const int blockIdx) override
See vtkAMRBaseReader::GetAMRGrid.
vtkUniformGrid
image data with blanking
Definition: vtkUniformGrid.h:74
vtkAMRVelodyneReader::RequestData
int RequestData(vtkInformation *vtkNotUsed(request), vtkInformationVector **vtkNotUsed(inputVector), vtkInformationVector *outputVector) override
vtkAMRVelodyneReaderInternal
Consists of the low-level Velodyne Reader used by the vtkAMRVelodyneReader.
Definition: vtkAMRVelodyneReaderInternal.h:67
vtkAMRVelodyneReader::~vtkAMRVelodyneReader
~vtkAMRVelodyneReader() override
vtkAMRVelodyneReader::GetAMRGridPointData
void GetAMRGridPointData(const int vtkNotUsed(blockIdx), vtkUniformGrid *vtkNotUsed(block), const char *vtkNotUsed(field)) override
See vtkAMRBaseReader::GetAMRGridData.
Definition: vtkAMRVelodyneReader.h:85
vtkAMRVelodyneReader::GetNumberOfBlocks
int GetNumberOfBlocks() override
Returns the total number of blocks.
vtkAMRVelodyneReader::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkAMRBaseReader
An abstract class that encapsulates common functionality for all AMR readers.
Definition: vtkAMRBaseReader.h:40
vtkAMRVelodyneReader::ReadMetaData
void ReadMetaData() override
See vtkAMRBaseReader::ReadMetaData.
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:113
vtkX3D::field
@ field
Definition: vtkX3D.h:183
vtkAMRVelodyneReader::RequestInformation
int RequestInformation(vtkInformation *rqst, vtkInformationVector **inputVector, vtkInformationVector *outputVector) override
Standard Pipeline methods, subclasses may override this method if needed.
vtkAMRVelodyneReader::SetFileName
void SetFileName(VTK_FILEPATH const char *fileName) override
Set/Get the filename.
vtkOverlappingAMR
hierarchical dataset of vtkUniformGrids
Definition: vtkOverlappingAMR.h:80
vtkAMRVelodyneReader::GetBlockLevel
int GetBlockLevel(const int blockIdx) override
See vtkAMRBaseReader::GetBlockLevel.
vtkX3D::spacing
@ spacing
Definition: vtkX3D.h:487
vtkAMRVelodyneReader::GetOutput
vtkOverlappingAMR * GetOutput()
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:183
vtkAMRVelodyneReader::GetNumberOfLevels
int GetNumberOfLevels() override
Returns the total number of levels.
vtkAMRVelodyneReader::FillMetaData
int FillMetaData() override
See vtkAMRBaseReader::FillMetaData.
vtkAMRVelodyneReader::SetUpDataArraySelections
void SetUpDataArraySelections() override
See vtkAMRBaseReader::SetUpDataArraySelections.
vtkAMRVelodyneReader::IsReady
bool IsReady
Definition: vtkAMRVelodyneReader.h:96
vtkX3D::index
@ index
Definition: vtkX3D.h:252
vtkAMRBaseReader.h