ReUseX
0.0.5
3D Point Cloud Processing for Building Reuse
Toggle main menu visibility
Loading...
Searching...
No Matches
binary_points.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
// RUXP v1 — the binary point transport served by
8
// `GET /api/v1/clouds/{name}/points?format=binary` (#283).
9
//
10
// The byte layout is normative in docs/gui/binary-points.md; this header is the
11
// C++ side of that contract and must not drift from it. The client side is
12
// apps/rux/frontend/src/viewport/binaryPoints.ts.
13
//
14
// Deliberately framework-free, like the rest of gui/api.hpp: a page of storage
15
// records in, a buffer out.
16
17
// ProjectDB is included rather than forward-declared: the page type this
18
// header takes is the nested ProjectDB::CloudPage, which needs the complete
19
// class. ProjectDB.hpp is itself forward-declaration-disciplined (STANDARDS
20
// §2) — it pulls in the PCL point types and nothing heavier.
21
#include <reusex/core/ProjectDB.hpp>
22
23
#include <cstddef>
24
#include <cstdint>
25
#include <string_view>
26
#include <vector>
27
28
namespace
rux::gui
{
29
32
inline
constexpr
uint16_t
kRuxpVersion
= 1;
33
35
inline
constexpr
size_t
kRuxpHeaderBase
= 40;
37
inline
constexpr
size_t
kRuxpFieldSize
= 16;
38
48
inline
constexpr
uint32_t
kRuxpFlagLod
= 0x1U;
49
52
inline
constexpr
uint32_t
kRuxpKnownFlags
=
kRuxpFlagLod
;
53
55
enum class
RuxpType
: uint8_t {
f32
= 1,
u8
= 2,
u32
= 3 };
56
76
std::vector<uint8_t>
encode_ruxp
(
const
reusex::ProjectDB::CloudPage
&page,
77
uint32_t flags = 0);
78
80
bool
ruxp_supports
(std::string_view point_type);
81
82
}
// namespace rux::gui
rux::gui
Definition
api.hpp:38
rux::gui::kRuxpHeaderBase
constexpr size_t kRuxpHeaderBase
Fixed part of the header, before the field descriptors.
Definition
binary_points.hpp:35
rux::gui::kRuxpKnownFlags
constexpr uint32_t kRuxpKnownFlags
Every flag bit this encoder will emit.
Definition
binary_points.hpp:52
rux::gui::kRuxpFieldSize
constexpr size_t kRuxpFieldSize
Bytes per field descriptor.
Definition
binary_points.hpp:37
rux::gui::ruxp_supports
bool ruxp_supports(std::string_view point_type)
True when type is one encode_ruxp() knows how to lay out.
rux::gui::kRuxpVersion
constexpr uint16_t kRuxpVersion
Format version written into every page.
Definition
binary_points.hpp:32
rux::gui::RuxpType
RuxpType
Field value types, as written into a descriptor's type byte.
Definition
binary_points.hpp:55
rux::gui::RuxpType::u8
@ u8
Definition
binary_points.hpp:55
rux::gui::RuxpType::f32
@ f32
Definition
binary_points.hpp:55
rux::gui::RuxpType::u32
@ u32
Definition
binary_points.hpp:55
rux::gui::encode_ruxp
std::vector< uint8_t > encode_ruxp(const reusex::ProjectDB::CloudPage &page, uint32_t flags=0)
Encode one stored page as a RUXP v1 buffer.
rux::gui::kRuxpFlagLod
constexpr uint32_t kRuxpFlagLod
flags bit 0 — this page is a level-of-detail view of the whole cloud rather than a contiguous window ...
Definition
binary_points.hpp:48
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
apps
rux
include
gui
binary_points.hpp
Generated by
1.17.0