ReUseX
0.0.5
3D Point Cloud Processing for Building Reuse
Toggle main menu visibility
Loading...
Searching...
No Matches
point_lod.hpp
Go to the documentation of this file.
1
// SPDX-FileCopyrightText: 2026 Povl Filip Sonne-Frederiksen
2
//
3
// SPDX-License-Identifier: GPL-3.0-or-later
4
5
#pragma once
6
7
// Voxel LOD for `GET /api/v1/clouds/{name}/points?max_points=N` (#320).
8
//
9
// Paging answers "the first N points of this cloud". A viewport wants "all of
10
// this cloud, coarsely" — those are different questions, and this file answers
11
// the second one. The rationale, the alternatives that were rejected, and the
12
// forward path to a precomputed progressive ordering are in
13
// docs/gui/binary-points.md § "Level of detail".
14
//
15
// Deliberately framework-free, like gui/binary_points.hpp: a ProjectDB and a
16
// budget in, a page of storage records out. The HTTP layer (gui/api.cpp) turns
17
// that page into RUXP or JSON with the same encoders a paged read uses.
18
19
// ProjectDB is included rather than forward-declared: this header returns the
20
// nested ProjectDB::CloudPage by value, which needs the complete class.
21
#include <reusex/core/ProjectDB.hpp>
22
23
#include <cstdint>
24
#include <string_view>
25
#include <vector>
26
27
namespace
rux::gui
{
28
34
inline
constexpr
uint64_t
kLodStreamChunk
= 262144;
35
37
struct
LodSelection
{
44
reusex::ProjectDB::CloudPage
page
;
45
51
std::vector<uint64_t>
indices
;
52
56
bool
subsampled
=
false
;
57
60
double
voxel_size
= 0.0;
61
65
uint64_t
skipped_non_finite
= 0;
66
};
67
72
bool
lod_supports
(std::string_view point_type);
73
100
LodSelection
voxel_lod
(
const
reusex::ProjectDB
&db, std::string_view name,
101
uint64_t max_points);
102
120
reusex::ProjectDB::CloudPage
121
gather_points
(
const
reusex::ProjectDB
&db, std::string_view name,
122
const
std::vector<uint64_t> &indices);
123
124
}
// namespace rux::gui
reusex::ProjectDB
Definition
ProjectDB.hpp:43
rux::gui
Definition
api.hpp:38
rux::gui::lod_supports
bool lod_supports(std::string_view point_type)
True when point_type carries the xyz positions the grid bins.
rux::gui::gather_points
reusex::ProjectDB::CloudPage gather_points(const reusex::ProjectDB &db, std::string_view name, const std::vector< uint64_t > &indices)
Read the records of name at indices, as one page.
rux::gui::kLodStreamChunk
constexpr uint64_t kLodStreamChunk
Points read from storage per streaming step while selecting.
Definition
point_lod.hpp:34
rux::gui::voxel_lod
LodSelection voxel_lod(const reusex::ProjectDB &db, std::string_view name, uint64_t max_points)
Select a spatially representative subset of a whole cloud.
reusex::ProjectDB::CloudPage
A contiguous window of one cloud's stored records, still in storage layout — no PCL type has been inf...
Definition
ProjectDB.hpp:234
rux::gui::LodSelection
The outcome of a voxel selection over one whole cloud.
Definition
point_lod.hpp:37
rux::gui::LodSelection::subsampled
bool subsampled
False when the cloud already fit the budget and every point was returned.
Definition
point_lod.hpp:56
rux::gui::LodSelection::page
reusex::ProjectDB::CloudPage page
The selected records, in storage layout, ascending by point index.
Definition
point_lod.hpp:44
rux::gui::LodSelection::voxel_size
double voxel_size
Edge length of the final voxel, in cloud units (metres for a scan).
Definition
point_lod.hpp:60
rux::gui::LodSelection::skipped_non_finite
uint64_t skipped_non_finite
Points skipped because a coordinate was NaN or infinite.
Definition
point_lod.hpp:65
rux::gui::LodSelection::indices
std::vector< uint64_t > indices
Storage indices of the selected points, ascending and unique.
Definition
point_lod.hpp:51
apps
rux
include
gui
point_lod.hpp
Generated by
1.17.0