-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathvtkLASReader.h
104 lines (85 loc) · 2.77 KB
/
vtkLASReader.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
#ifndef __vtkLASReader_h
#define __vtkLASReader_h
// VTK Includes
#include <vtkPolyDataAlgorithm.h>
#include <vtkPolyData.h>
#include <vtkCellArray.h>
#include <vtkPoints.h>
#include <vtkPointData.h>
#include <vtkVertexGlyphFilter.h>
#include <vtkInformation.h>
#include <vtkInformationVector.h>
#include <vtkObjectFactory.h>
//libLAS Includes
#include <liblas/liblas.hpp>
// C++ includes
#include <fstream>
#include <iostream>
class vtkLASReader: public vtkPolyDataAlgorithm
{
public:
static vtkLASReader* New();
vtkTypeMacro(vtkLASReader,vtkPolyDataAlgorithm)
virtual void PrintSelf(ostream &os, vtkIndent indent);
// Decription:
// All the Visualisation Types have been listed here
enum VisualisationTypeConstants {
None = 0,
Color,
Classification
};
// Description:
// All the Classification Types according to LAS spec are listed here
enum ClassificationType {
Created_NotClassified = 0,
Unclassified, // 1
Ground, // 2
LowVegetation, // 3
MediumVegetation, // 4
HighVegetation, // 5
Building, // 6
LowPoint, // 7
ModelKeyPoint, // 8
Water // 9
};
// Decription:
// Accessor for name of the file that will be opened
vtkSetStringMacro(FileName)
vtkGetStringMacro(FileName)
// Decription:
// Accessor for Visualisation Type
vtkSetMacro(VisualisationType, VisualisationTypeConstants)
vtkGetMacro(VisualisationType, VisualisationTypeConstants)
// Decription:
// Accessor for the LAS Header file
vtkGetMacro(Header, liblas::Header *)
// Description:
// Set User specified color values in the Classification Color Map instead of the default values
void SetClassificationColor(ClassificationType type, unsigned char color[3]);
void SetClassificationColor(ClassificationType type, unsigned char red, unsigned char green, unsigned char blue);
protected:
vtkLASReader();
virtual ~vtkLASReader();
// Decription:
// Core implementation of the data set reader
int RequestData(vtkInformation* request, vtkInformationVector** inputVector,
vtkInformationVector* outputVector);
// Description:
// Read point record data i.e. position and visualisation data
void ReadPointRecordData(liblas::Reader &reader, vtkPolyData* pointsPolyData);
// Description:
// Map from Class Number to Corresponding Color
static unsigned char ClassificationColorMap[10][3];
int pointRecordsCount;
VisualisationTypeConstants VisualisationType;
liblas::Header* Header;
char* FileName;
private:
vtkLASReader(const vtkLASReader&); // Not implemented
void operator=(const vtkLASReader&); // Not implemented
};
// To Do:
// Look for better Visualisation Methods if possible?
// Ex: Converting it to a Polygon mesh?
//
#endif // __vtkLASReader_h