ReUseX
0.0.5
3D Point Cloud Processing for Building Reuse
Toggle main menu visibility
Loading...
Searching...
No Matches
report_generator.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
// Server-side PDF generation for Ressourcekortlægning (#456).
8
//
9
// The generator assembles material passports, column definitions and thumbnail
10
// blobs from a ProjectDB, writes them to a temporary directory alongside the
11
// embedded Typst template, and invokes `typst compile` as a subprocess. The
12
// resulting PDF bytes are returned so the caller can store them in the DB and
13
// serve them over HTTP.
14
//
15
// Requires `typst` to be present in PATH at runtime. The devshell gains it via
16
// `pkgs.typst` in shell.nix; in production supply it in the process's PATH.
17
18
#include <cstdint>
19
#include <optional>
20
#include <vector>
21
22
namespace
reusex
{
23
24
class
ProjectDB
;
25
43
std::vector<std::uint8_t>
generate_ressourcekortlaegning_pdf
(
44
ProjectDB
&db,
45
std::optional<std::int64_t> resource_template_id = std::nullopt);
46
51
int
report_blocking_types
(
const
ProjectDB
&db);
52
53
}
// namespace reusex
reusex::ProjectDB
Definition
ProjectDB.hpp:45
reusex
Definition
component_record.hpp:12
reusex::report_blocking_types
int report_blocking_types(const ProjectDB &db)
How many survey types keep the report from being complete right now: the length of core::fractions_by...
reusex::generate_ressourcekortlaegning_pdf
std::vector< std::uint8_t > generate_ressourcekortlaegning_pdf(ProjectDB &db, std::optional< std::int64_t > resource_template_id=std::nullopt)
Generate a Ressourcekortlægning PDF for the given project.
libs
reusex
include
core
report_generator.hpp
Generated by
1.18.0