VTK  9.2.6
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=========================================================================*/
24
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//================================================================================
51
53{
54public:
55 typedef struct tagVelodyneBlock
56 {
57 int Index;
59 int Level;
60 double Origin[3];
61 bool isFull;
62 bool isLeaf;
64
67 void SetFileName(VTK_FILEPATH VTK_FUTURE_CONST char* fileName);
69 void GetBlockAttribute(const char* attribute, int blockIdx, vtkUniformGrid* pDataSet);
70
71 hid_t file_id;
72 std::vector<Block> Blocks;
73 std::vector<std::string> AttributeNames;
74 std::vector<int> blockDims;
75
76 std::vector<int> blocksPerLevel;
77 std::vector<double> globalOrigin;
78 std::vector<double> rootDX;
79 double dataTime;
82
83private:
84 void Init();
85 void ReadBlocks();
86 void AttachScalarToGrid(int, const char*, int, vtkUniformGrid*);
87 void AttachVectorToGrid(int, const char*, int, vtkUniformGrid*);
88 void AttachTensor6ToGrid(int, const char*, int, vtkUniformGrid*);
89 void AttachTensorToGrid(int, const char*, int, vtkUniformGrid*);
90 int ReadLevelsAndX0(hid_t grp_id, std::vector<int>& levels, std::vector<double>& X0);
91 herr_t CloseFile(hid_t& fid);
92 vtkDataArray* GetTypeAndArray(const int, hid_t&);
93
94 std::string FileName;
95 int nLeaves;
96 int nFullLeaves;
97 int nNodes;
98 std::unordered_map<std::string, int> typeMap;
99 std::unordered_map<std::string, int> arrayMap;
100};
101#endif
102// VTK-HeaderTest-Exclude: vtkAMRVelodyneReaderInternal.h
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
image data with blanking
#define vtkDataArray
#define VTK_FILEPATH