RDB 2
graphNode.hpp
Go to the documentation of this file.
1 /*
2  *******************************************************************************
3  *
4  * Copyright 2021 RIEGL Laser Measurement Systems
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  *
18  * SPDX-License-Identifier: Apache-2.0
19  *
20  *******************************************************************************
21  */
22 /*!
23  *******************************************************************************
24  *
25  * \file graphNode.hpp
26  * \author RIEGL LMS GmbH, Austria
27  * \brief Index graph node
28  * \version 2015-10-14/AW: Initial version
29  * \version 2018-07-05/AW: Add ID conversion operator function
30  *
31  *******************************************************************************
32  */
33 
34 #ifndef RIEGL_RDB_POINTCLOUD_GRAPHNODE_HPP
35 #define RIEGL_RDB_POINTCLOUD_GRAPHNODE_HPP
36 
37 //---< INCLUDES >---------------------------------------------------------------
38 
39 #include <vector>
40 #include <cstdint>
42 
43 //---< NAMESPACE >--------------------------------------------------------------
44 
45 namespace riegl {
46 namespace rdb {
47 namespace pointcloud {
48 
49 //---< CLASS GraphNode >--------------------------------------------------------
50 /*!
51  * \brief Graph Node
52  *
53  * This class represents an index graph node. The index structure is
54  * used to organize the point cloud and consists of at least one node.
55  *
56  * The index space is given by the primary point attribute defined
57  * during point cloud database creation (see class CreateSettings).
58  *
59  * Each graph node covers a certain range of the index space and
60  * has a number of sub-nodes (aka. "child nodes"). All child nodes
61  * lie within the range of the parent node whereas they are usually
62  * smaller. A node without child nodes is called a leaf node. Note
63  * that any nodes may overlap in index space as well as all other
64  * point dimensions (attributes).
65  *
66  * This documentation uses the term "branch" for a node and all
67  * children and grandchildren up to and including the leaf nodes.
68  *
69  * \see riegl::rdb::Pointcloud::stat()
70  */
71 class GraphNode
72 {
73 public:
74  typedef uint32_t ID;
75  typedef uint64_t PointCount;
76 
77  ID id; //!< unique node identifier (zero is invalid)
78  Transaction::ID revision; //!< ID of last transaction that has modified any attribute of this branch
79  std::vector<GraphNode> children; //!< list of child nodes (without grandchildren)
80  PointCount pointCountTotal; //!< total number of points in all leaf nodes of the branch
81  PointCount pointCountNode; //!< number of points in this node (see notes about LOD)
82 
83  //! \brief return node identifier
84  operator ID() const { return id; }
85 
86 public:
87  GraphNode();
88 };
89 
90 }}} // namespace riegl::rdb::pointcloud
91 
92 #endif // RIEGL_RDB_POINTCLOUD_GRAPHNODE_HPP
ID id
unique node identifier (zero is invalid)
Definition: graphNode.hpp:77
PointCount pointCountNode
number of points in this node (see notes about LOD)
Definition: graphNode.hpp:81
Point cloud transaction.
RIEGL Laser Measurement Systems GmbH, Austria.
Definition: context.hpp:48
std::vector< GraphNode > children
list of child nodes (without grandchildren)
Definition: graphNode.hpp:79
PointCount pointCountTotal
total number of points in all leaf nodes of the branch
Definition: graphNode.hpp:80
Transaction::ID revision
ID of last transaction that has modified any attribute of this branch.
Definition: graphNode.hpp:78