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>
128 : fmt::formatter<std::string_view> {
129 auto format(reusex::core::Material value, format_context &ctx) const
130 -> format_context::iterator {
131 return fmt::formatter<std::string_view>::format(
132 reusex::core::to_string(value), ctx);
133 }
134};
135
136template <>
137struct fmt::formatter<reusex::core::TriState>
138 : fmt::formatter<std::string_view> {
139 auto format(reusex::core::TriState value, format_context &ctx) const
140 -> format_context::iterator {
141 return fmt::formatter<std::string_view>::format(
142 reusex::core::to_string(value), ctx);
143 }
144};
145
146template <>
147struct fmt::formatter<reusex::core::EmissionQuantityType>
148 : fmt::formatter<std::string_view> {
150 format_context &ctx) const -> format_context::iterator {
151 return fmt::formatter<std::string_view>::format(
152 reusex::core::to_string(value), ctx);
153 }
154};
155
156template <>
157struct fmt::formatter<reusex::core::SubstanceContentMethod>
158 : fmt::formatter<std::string_view> {
160 format_context &ctx) const -> format_context::iterator {
161 return fmt::formatter<std::string_view>::format(
162 reusex::core::to_string(value), ctx);
163 }
164};
165
166template <>
167struct fmt::formatter<reusex::core::TransactionType>
168 : fmt::formatter<std::string_view> {
169 auto format(reusex::core::TransactionType value, format_context &ctx) const
170 -> format_context::iterator {
171 return fmt::formatter<std::string_view>::format(
172 reusex::core::to_string(value), ctx);
173 }
174};
175
176template <>
177struct fmt::formatter<reusex::core::MaterialPassport>
178 : fmt::formatter<std::string_view> {
180 format_context &ctx) const -> format_context::iterator {
181 return fmt::format_to(
182 ctx.out(),
183 "MaterialPassport(designation='{}', materials={}, version='{}')",
184 mp.description.designation, mp.description.materials.size(),
185 mp.metadata.version_number);
186 }
187};
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.