VTK  9.1.0
vtkAMRVelodyneReaderInternal.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkAMRVelodyneReaderInternal.hpp
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 =========================================================================*/
25 #ifndef vtkAMRVelodyneReaderInternal_h
26 #define vtkAMRVelodyneReaderInternal_h
27 
28 #include <cassert>
29 #include <cstring>
30 #include <map>
31 #include <string>
32 #include <unordered_map>
33 #include <vector>
34 
35 #include "vtkByteSwap.h"
36 #include "vtkCellData.h"
37 #include "vtkDataArray.h"
38 #include "vtkDoubleArray.h"
39 #include "vtkIntArray.h"
40 #include "vtkObject.h"
41 #include "vtkSetGet.h"
42 #include "vtkUniformGrid.h"
43 
44 #define H5_USE_16_API
45 #include "vtk_hdf5.h"
46 //#include "hdf5.h"
47 
48 //================================================================================
49 // INTERNAL VELODYNE READER
50 //================================================================================
52 {
53  double Time;
54  int CycleTime;
56 
57 typedef struct tagBlock
58 {
59  int Index;
60  int dSetLoc;
61  int Level;
62  double Origin[3];
63  bool isFull;
64  bool isLeaf;
67 {
68 public:
71  void SetFileName(VTK_FILEPATH char* fileName);
72  void ReadMetaData();
73  void GetBlockAttribute(const char* attribute, int blockIdx, vtkUniformGrid* pDataSet);
74 
75  hid_t file_id;
76  std::vector<Block> Blocks;
77  std::vector<std::string> AttributeNames;
78  std::vector<int> blockDims;
79 
80  std::vector<int> blocksPerLevel;
81  std::vector<double> globalOrigin;
82  std::vector<double> rootDX;
83  double dataTime;
84  int nBlocks;
85  int nLevels;
86 
87 private:
88  void Init();
89  void ReadBlocks();
90  void AttachScalarToGrid(int, const char*, int, vtkUniformGrid*);
91  void AttachVectorToGrid(int, const char*, int, vtkUniformGrid*);
92  void AttachTensor6ToGrid(int, const char*, int, vtkUniformGrid*);
93  void AttachTensorToGrid(int, const char*, int, vtkUniformGrid*);
94  int ReadLevelsAndX0(hid_t grp_id, std::vector<int>& levels, std::vector<double>& X0);
95  herr_t CloseFile(hid_t& fid);
96  vtkDataArray* GetTypeAndArray(const int, hid_t&);
97 
98  char* FileName;
99  int nLeaves;
100  int nFullLeaves;
101  int nNodes;
102  std::unordered_map<std::string, int> typeMap;
103  std::unordered_map<std::string, int> arrayMap;
104 };
105 #endif
106 // 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)
std::vector< std::string > AttributeNames
void SetFileName(VTK_FILEPATH char *fileName)
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:50
image data with blanking
struct tagVelodyneSimParameters VelodneSimParameters
struct tagBlock Block
#define VTK_FILEPATH