ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
LasMetadata.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - CloudViewer: www.cloudViewer.org -
3 // ----------------------------------------------------------------------------
4 // Copyright (c) 2018-2024 www.cloudViewer.org
5 // SPDX-License-Identifier: MIT
6 // ----------------------------------------------------------------------------
7 
8 #pragma once
9 
10 // ##########################################################################
11 // # #
12 // # CloudViewer PLUGIN: LAS-IO Plugin #
13 // # #
14 // # This program is free software; you can redistribute it and/or modify #
15 // # it under the terms of the GNU General Public License as published by #
16 // # the Free Software Foundation; version 2 of the License. #
17 // # #
18 // # This program is distributed in the hope that it will be useful, #
19 // # but WITHOUT ANY WARRANTY; without even the implied warranty of #
20 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
21 // # GNU General Public License for more details. #
22 // # #
23 // # COPYRIGHT: Thomas Montaigu #
24 // # #
25 // ##########################################################################
26 
27 struct laszip_header;
28 class ccPointCloud;
29 
30 #include "LasDetails.h"
31 #include "LasExtraScalarField.h"
32 #include "LasVlr.h"
33 
34 // CORE
35 #include <CVGeom.h>
36 // LASzip
37 #include <laszip/laszip_api.h>
38 
39 namespace LasMetadata
40 {
41  constexpr const char X_SCALE[] = "LAS.scale.x";
42  constexpr const char Y_SCALE[] = "LAS.scale.y";
43  constexpr const char Z_SCALE[] = "LAS.scale.z";
44  constexpr const char X_OFFSET[] = "LAS.offset.x";
45  constexpr const char Y_OFFSET[] = "LAS.offset.y";
46  constexpr const char Z_OFFSET[] = "LAS.offset.z";
47  constexpr const char VERSION_MAJOR[] = "LAS.version.major";
48  constexpr const char VERSION_MINOR[] = "LAS.version.minor";
49  constexpr const char POINT_FORMAT[] = "LAS.point_format";
50  constexpr const char GLOBAL_ENCODING[] = "LAS.global_encoding";
51  constexpr const char PROJECT_UUID[] = "LAS.project_uuid";
52  constexpr const char SYSTEM_IDENTIFIER[] = "LAS.system_identifier";
53  constexpr const char VLRS[] = "LAS.vlrs";
54  constexpr const char EXTRA_FIELDS[] = "LAS.extra_fields";
55 
56  void SaveMetadataInto(const laszip_header& header, ccPointCloud& pointCloud, const std::vector<LasExtraScalarField>& extraScalarFields);
57  bool LoadVlrs(const ccPointCloud& pointCloud, LasVlr& vlr);
58  bool LoadScaleFrom(const ccPointCloud& pointCloud, CCVector3d& scale);
59  bool LoadOffsetFrom(const ccPointCloud& pointCloud, CCVector3d& offset);
61  bool LoadGlobalEncoding(const ccPointCloud& pointCloud, uint16_t& outGlobalEncoding);
62  bool LoadProjectUUID(const ccPointCloud& pointCloud, laszip_header& header);
63 } // namespace LasMetadata
std::string version
int offset
A 3D cloud and its associated features (color, normals, scalar fields, etc.)
constexpr const char Y_OFFSET[]
Definition: LasMetadata.h:45
constexpr const char EXTRA_FIELDS[]
Definition: LasMetadata.h:54
bool LoadOffsetFrom(const ccPointCloud &pointCloud, CCVector3d &offset)
constexpr const char X_SCALE[]
Definition: LasMetadata.h:41
void SaveMetadataInto(const laszip_header &header, ccPointCloud &pointCloud, const std::vector< LasExtraScalarField > &extraScalarFields)
Definition: LasMetadata.cpp:56
constexpr const char Z_OFFSET[]
Definition: LasMetadata.h:46
bool LoadGlobalEncoding(const ccPointCloud &pointCloud, uint16_t &outGlobalEncoding)
constexpr const char VERSION_MINOR[]
Definition: LasMetadata.h:48
constexpr const char GLOBAL_ENCODING[]
Definition: LasMetadata.h:50
bool LoadScaleFrom(const ccPointCloud &pointCloud, CCVector3d &scale)
bool LoadProjectUUID(const ccPointCloud &pointCloud, laszip_header &header)
constexpr const char SYSTEM_IDENTIFIER[]
Definition: LasMetadata.h:52
constexpr const char Y_SCALE[]
Definition: LasMetadata.h:42
constexpr const char VLRS[]
Definition: LasMetadata.h:53
constexpr const char PROJECT_UUID[]
Definition: LasMetadata.h:51
constexpr const char POINT_FORMAT[]
Definition: LasMetadata.h:49
constexpr const char VERSION_MAJOR[]
Definition: LasMetadata.h:47
bool LoadVlrs(const ccPointCloud &pointCloud, LasVlr &vlr)
bool LoadLasVersionFrom(const ccPointCloud &pointCloud, LasDetails::LasVersion &version)
constexpr const char Z_SCALE[]
Definition: LasMetadata.h:43
constexpr const char X_OFFSET[]
Definition: LasMetadata.h:44
See SelectBestVersion
Definition: LasDetails.h:178
Definition: LasVlr.h:38