VTK  9.3.20240419
vtkAMRVelodyneReaderInternal.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
13 #ifndef vtkAMRVelodyneReaderInternal_h
14 #define vtkAMRVelodyneReaderInternal_h
15 
16 #include <cassert>
17 #include <cstring>
18 #include <map>
19 #include <string>
20 #include <unordered_map>
21 #include <vector>
22 
23 #include "vtkABINamespace.h"
24 #include "vtkByteSwap.h"
25 #include "vtkCellData.h"
26 #include "vtkDataArray.h"
27 #include "vtkDoubleArray.h"
28 #include "vtkIntArray.h"
29 #include "vtkObject.h"
30 #include "vtkSetGet.h"
31 #include "vtkUniformGrid.h"
32 
33 #define H5_USE_16_API
34 #include "vtk_hdf5.h"
35 //#include "hdf5.h"
36 
37 //================================================================================
38 // INTERNAL VELODYNE READER
39 //================================================================================
40 VTK_ABI_NAMESPACE_BEGIN
41 
43 {
44 public:
45  typedef struct tagVelodyneBlock
46  {
47  int Index;
48  int dSetLoc;
49  int Level;
50  double Origin[3];
51  bool isFull;
52  bool isLeaf;
53  } Block;
54 
57  void SetFileName(VTK_FILEPATH VTK_FUTURE_CONST char* fileName);
58  void ReadMetaData();
59  void GetBlockAttribute(const char* attribute, int blockIdx, vtkUniformGrid* pDataSet);
60 
62  std::vector<Block> Blocks;
63  std::vector<std::string> AttributeNames;
64  std::vector<int> blockDims;
65 
66  std::vector<int> blocksPerLevel;
67  std::vector<double> globalOrigin;
68  std::vector<double> rootDX;
69  double dataTime;
70  int nBlocks;
71  int nLevels;
72 
73 private:
74  void Init();
75  void ReadBlocks();
76  void AttachScalarToGrid(int, const char*, int, vtkUniformGrid*);
77  void AttachVectorToGrid(int, const char*, int, vtkUniformGrid*);
78  void AttachTensor6ToGrid(int, const char*, int, vtkUniformGrid*);
79  void AttachTensorToGrid(int, const char*, int, vtkUniformGrid*);
80  int ReadLevelsAndX0(hid_t grp_id, std::vector<int>& levels, std::vector<double>& X0);
81  herr_t CloseFile(hid_t& fid);
82  vtkDataArray* GetTypeAndArray(int, hid_t&);
83 
84  std::string FileName;
85  int nLeaves;
86  int nFullLeaves;
87  int nNodes;
88  std::unordered_map<std::string, int> typeMap;
89  std::unordered_map<std::string, int> arrayMap;
90 };
91 VTK_ABI_NAMESPACE_END
92 #endif
93 // VTK-HeaderTest-Exclude: vtkAMRVelodyneReaderInternal.h
Consists of the low-level Velodyne Reader used by the vtkAMRVelodyneReader.
void GetBlockAttribute(const char *attribute, int blockIdx, vtkUniformGrid *pDataSet)
void SetFileName(VTK_FILEPATH VTK_FUTURE_CONST char *fileName)
std::vector< std::string > AttributeNames
struct vtkAMRVelodyneReaderInternal::tagVelodyneBlock Block
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:155
image data with blanking
@ string
Definition: vtkX3D.h:490
int64_t hid_t
Definition: vtkHDFWriter.h:30
#define VTK_FILEPATH