ReUseX  0.0.5
3D Point Cloud Processing for Building Reuse
Loading...
Searching...
No Matches
MaterialPassport.hpp
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2025 Povl Filip Sonne-Frederiksen
2//
3// SPDX-License-Identifier: GPL-3.0-or-later
4
5#pragma once
6
9
10#include <fmt/format.h>
11
12#include <string>
13#include <vector>
14
15namespace reusex::core {
16
26
29 std::string guid;
30
33 std::string edited_by;
34
37 std::string edited_date;
38
41 std::string old_value;
42
45 std::string new_value;
46};
47
54 std::string document_guid;
55
58 std::string creation_date;
59
62 std::string revision_date;
63
66 std::string version_number;
67
70 std::string version_date;
71};
72
119
120} // namespace reusex::core
121
122// ===========================================================================
123// fmt formatters
124// ===========================================================================
125
126template <>
127struct fmt::formatter<reusex::core::Material> : fmt::formatter<std::string_view> {
128 auto format(reusex::core::Material value, format_context &ctx) const
129 -> format_context::iterator {
130 return fmt::formatter<std::string_view>::format(
131 reusex::core::to_string(value), ctx);
132 }
133};
134
135template <>
136struct fmt::formatter<reusex::core::TriState>
137 : fmt::formatter<std::string_view> {
138 auto format(reusex::core::TriState value, format_context &ctx) const
139 -> format_context::iterator {
140 return fmt::formatter<std::string_view>::format(
141 reusex::core::to_string(value), ctx);
142 }
143};
144
145template <>
146struct fmt::formatter<reusex::core::EmissionQuantityType>
147 : fmt::formatter<std::string_view> {
149 format_context &ctx) const -> format_context::iterator {
150 return fmt::formatter<std::string_view>::format(
151 reusex::core::to_string(value), ctx);
152 }
153};
154
155template <>
156struct fmt::formatter<reusex::core::SubstanceContentMethod>
157 : fmt::formatter<std::string_view> {
159 format_context &ctx) const -> format_context::iterator {
160 return fmt::formatter<std::string_view>::format(
161 reusex::core::to_string(value), ctx);
162 }
163};
164
165template <>
166struct fmt::formatter<reusex::core::TransactionType>
167 : fmt::formatter<std::string_view> {
168 auto format(reusex::core::TransactionType value, format_context &ctx) const
169 -> format_context::iterator {
170 return fmt::formatter<std::string_view>::format(
171 reusex::core::to_string(value), ctx);
172 }
173};
174
175template <>
176struct fmt::formatter<reusex::core::MaterialPassport>
177 : fmt::formatter<std::string_view> {
179 format_context &ctx) const -> format_context::iterator {
180 return fmt::format_to(
181 ctx.out(),
182 "MaterialPassport(designation='{}', materials={}, version='{}')",
183 mp.description.designation, mp.description.materials.size(),
184 mp.metadata.version_number);
185 }
186};
Material
Material types from the Danish material passport standard (v1.0).
auto to_string(Material value) -> std::string_view
Convert Material enum to its string identifier.
EmissionQuantityType
Emission quantity type.
TriState
Tri-state value for Yes/No/Unknown fields.
TransactionType
Transaction log entry type.
@ property
Change to a property value.
SubstanceContentMethod
Method used to determine substance content.
auto format(reusex::core::EmissionQuantityType value, format_context &ctx) const -> format_context::iterator
auto format(const reusex::core::MaterialPassport &mp, format_context &ctx) const -> format_context::iterator
auto format(reusex::core::Material value, format_context &ctx) const -> format_context::iterator
auto format(reusex::core::SubstanceContentMethod value, format_context &ctx) const -> format_context::iterator
auto format(reusex::core::TransactionType value, format_context &ctx) const -> format_context::iterator
auto format(reusex::core::TriState value, format_context &ctx) const -> format_context::iterator
Certifications, approvals and declarations for the item.
Condition assessment of the construction item.
Description of the reused construction item.
Physical dimensions and geometry of the construction item.
Environmental and resource potential for sustainable utilization.
Fire-related properties of the construction item.
Historical usage information for the construction item.
Document-level metadata for the material passport.
std::string version_number
Version number (semver, e.g.
std::string creation_date
Date the document was created (ISO 8601).
std::string version_date
Date of the version specification (ISO 8601).
std::string revision_date
Date of last revision (ISO 8601).
std::string document_guid
Unique document identifier (GUID).
A complete material passport for a reused building material.
EnvironmentalPotential environmental
Section 8: Environmental and resource potential.
std::vector< TransactionLogEntry > transaction_log
Transaction log recording all changes.
Dimensions dimensions
Section 5: Dimensions and geometry.
ConstructionItemDescription description
Section 2: Construction item description.
Condition condition
Section 6: Condition assessment.
ProductInformation product
Section 3: Product information.
Pollution pollution
Section 7: Pollution - content and emissions.
MaterialPassportMetadata metadata
Document metadata.
FireProperties fire
Section 9: Fire properties.
Owner owner
Section 1: Owner information.
Certifications certifications
Section 4: Certifications, approvals and declarations.
History history
Section 10: History.
Owner contact information for the material passport.
Pollution, content and emission information.
Original product information.
A single entry in the material passport transaction log.
std::string guid
GUID of the changed document or property.
std::string edited_date
Date of the change (ISO 8601).
std::string new_value
New value after the change.
TransactionType type
Type of transaction (document or property change).
std::string old_value
Previous value before the change.
std::string edited_by
Who made the change.