ReUseX  0.0.5
3D Point Cloud Processing for Building Reuse
Loading...
Searching...
No Matches
reusex::core Namespace Reference

Namespaces

namespace  json_export
namespace  json_import
namespace  serialization
namespace  traits

Classes

class  AndNode
 AND combinator: expr1 && expr2. More...
struct  Artifact
 One named cloud / table / mesh the pipeline traffics in. More...
struct  Certifications
 Certifications, approvals and declarations for the item. More...
class  CloudReferenceNode
 Cloud reference: a label cloud loaded from ProjectDB by name. More...
class  CompareNode
 Comparison operators: <cloud> >= value, etc. More...
struct  ComponentRecord
 Core-owned persistence contract for a row of the building_components table (#227). More...
struct  Condition
 Condition assessment of the construction item. More...
struct  ConstructionItemDescription
 Description of the reused construction item. More...
struct  DangerousSubstance
 Dangerous substance analysis record. More...
struct  Dimensions
 Physical dimensions and geometry of the construction item. More...
struct  Emission
 Emission measurement record. More...
struct  EnvironmentalPotential
 Environmental and resource potential for sustainable utilization. More...
class  EqualNode
 Equality: <cloud> == value. More...
struct  FilterExpression
 Parsed filter expression with resolved label cloud references. More...
class  FilterNode
 Base AST node for filter expressions. More...
struct  FireProperties
 Fire-related properties of the construction item. More...
struct  GaussianSplatHeader
 What the PLY header of an INRIA 3D Gaussian Splatting file says. More...
struct  History
 Historical usage information for the construction item. More...
class  InNode
 In-set: <cloud> in [v1, v2, v3]. More...
class  IObserver
class  IProgressObserver
class  IVisualObserver
struct  MaterialPassport
 A complete material passport for a reused building material. More...
 Document-level metadata for the material passport. More...
class  NotEqualNode
 Not equal: <cloud> != value. More...
class  OrNode
 OR combinator: expr1 || expr2. More...
struct  Owner
 Owner contact information for the material passport. More...
struct  Pollution
 Pollution, content and emission information. More...
struct  ProductInformation
 Original product information. More...
class  ProgressObserver
struct  SensorIntrinsics
 Lightweight camera intrinsics replacing rtabmap::CameraModel in downstream code. More...
struct  StageContract
 The full input/output contract of one pipeline stage. More...
struct  StageInput
 One prerequisite of a stage. More...
class  stopwatch
struct  TransactionLogEntry
 A single entry in the material passport transaction log. More...
struct  ValidationIssue
 One problem discovered by a validation check. More...
struct  ValidationReport
 Aggregate result of running all validation checks over a project. More...

Typedefs

using LogHandler
using ArtifactOverrides = std::map<std::string, std::string, std::less<>>
 Runtime substitutions for artifact names, for the flags that let a stage be pointed at a differently-named cloud (rux create instances --semantic-cloud foo).

Enumerations

enum class  LogLevel {
  trace = 0 , debug = 1 , info = 2 , warn = 3 ,
  error = 4 , critical = 5 , off = 6
}
enum class  Material {
  natural_stone , lime_mortar , concrete , terrazzo ,
  cement_mortar , aerated_concrete , lightweight_clinker_concrete , plaster ,
  brick , glazed_tile , metal_general , iron ,
  steel , stainless_steel , aluminum , copper ,
  zinc , lead , construction_wood , wood_unclassified ,
  precious_wood , laminated_wood , veneer , wood_fibers ,
  wood_fiber_boards , wood_shavings , chipboards , paper ,
  corrugated_cardboard , impregnated_cardboard , wood_concrete_cement_fibers , mineral_wool ,
  asphalt , fibers , lining_paper , linoleum ,
  rubber , plastic , foam_plastic , glass ,
  natural_filling_aggregate , painting_supplies , other
}
 Material types from the Danish material passport standard (v1.0). More...
enum class  TriState { yes , no , unknown }
 Tri-state value for Yes/No/Unknown fields. More...
enum class  EmissionQuantityType { exact , minimum , maximum , interval }
 Emission quantity type. More...
enum class  SubstanceContentMethod { assumed , measured_surface , measured_material }
 Method used to determine substance content. More...
enum class  TransactionType { document , property }
 Transaction log entry type. More...
enum class  EventType { process , progress , visualization }
enum class  PipelineStage {
  import , optimize , clouds , annotate ,
  project , planes , rooms , instances ,
  mesh , texture , windows , gsplat
}
 Pipeline stages that have an input contract. More...
enum class  ArtifactKind { point_cloud , mesh , gaussian_splat , table }
 What kind of thing a named artifact is inside a .rux project. More...
enum class  Alignment { none , per_point , per_plane }
 Which index-alignment class an artifact belongs to. More...
enum class  Stage {
  idle , mesh_generation , importing_data , assembling_cloud ,
  creating_material , retrieving_textures , computing_face_coverage , computing_room_probabilities ,
  processing_batch , annotating_batches , projecting_labels , ray_tracing ,
  region_growing , instance_clustering , creating_windows , room_segmentation ,
  dense_reconstruction
}
enum class  ValidationSeverity { warning , error }
 Severity of a single validation finding. More...

Functions

int32_t cloud_label_at (const std::vector< CloudReferenceNode > &clouds, size_t cloud_idx, size_t point_idx)
 Helper for leaf nodes: read the label for point_idx from cloud cloud_idx, returning -1 if the index is out of range.
auto parse_filter_expression (const std::string &expression, ProjectDB &db) -> std::unique_ptr< FilterExpression >
 Parse filter expression and resolve label cloud references from ProjectDB.
auto evaluate_filter (const FilterExpression &expr, size_t cloud_size) -> IndicesPtr
 Evaluate filter expression against all points, generate Indices.
auto evaluate_filter_expression (const std::string &filter_expr, ProjectDB &db, size_t expected_size) -> IndicesPtr
 Parse and evaluate a filter expression against a project in one step.
GaussianSplatHeader parse_gaussian_splat_ply_header (std::string_view head)
 Parse the PLY header in head and verify it is an INRIA splat file.
std::string generate_guid ()
 Generate a fresh UUID-v4-like identifier (36-char, hyphenated hex).
constexpr bool is_valid_label (uint32_t label) noexcept
size_t label_to_index (uint32_t label)
 Convert a point label to a zero-based vector index, replacing the error-prone bare label - 1 idiom used to index parallel arrays such as plane_normals.
uint32_t api_to_point_label (int api_label)
 API (CV_32S, -1 = background) → point label (uint32_t, 0 = unlabeled).
int point_label_to_api (uint32_t point_label)
 Point label (uint32_t, 0 = unlabeled) → API (CV_32S, -1 = background).
uint16_t api_to_storage (int api_label)
 API label (CV_32S, -1 = background) → storage value (CV_16U, 0 = bg, label + 1).
int storage_to_api (uint16_t storage_value)
 Storage value (CV_16U, 0 = bg, label + 1) → API label (CV_32S, -1 = background).
cv::Mat storage_mat_to_api (const cv::Mat &storage)
 Convert a storage label image (CV_16U, 0 = bg) to an API label image (CV_32S, -1 = background) by subtracting the +1 offset.
cv::Mat api_mat_to_storage (const cv::Mat &api)
 Convert an API label image (CV_32S, -1 = background) to a storage label image (CV_16U, 0 = bg) by adding the +1 offset.
void set_log_handler (LogHandler handler)
void reset_log_handler ()
void set_log_level (LogLevel level)
auto get_log_level () -> LogLevel
auto should_log (LogLevel level) -> bool
void log_message (LogLevel level, std::string_view message)
template<typename... Args>
void log (LogLevel level, fmt::format_string< Args... > format, Args &&...args)
void log (LogLevel level, std::string_view message)
template<typename... Args>
void trace (fmt::format_string< Args... > format, Args &&...args)
void trace (std::string_view message)
template<typename... Args>
void debug (fmt::format_string< Args... > format, Args &&...args)
void debug (std::string_view message)
template<typename... Args>
void info (fmt::format_string< Args... > format, Args &&...args)
void info (std::string_view message)
template<typename... Args>
void warn (fmt::format_string< Args... > format, Args &&...args)
void warn (std::string_view message)
template<typename... Args>
void error (fmt::format_string< Args... > format, Args &&...args)
void error (std::string_view message)
template<typename... Args>
void critical (fmt::format_string< Args... > format, Args &&...args)
void critical (std::string_view message)
auto to_string (Material value) -> std::string_view
 Convert Material enum to its string identifier.
auto material_from_string (std::string_view str) -> std::optional< Material >
 Parse a Material from its string identifier.
auto to_string (TriState value) -> std::string_view
 Convert TriState enum to its string identifier.
auto tri_state_from_string (std::string_view str) -> std::optional< TriState >
 Parse a TriState from its string identifier.
auto to_string (EmissionQuantityType value) -> std::string_view
 Convert EmissionQuantityType enum to its string identifier.
auto emission_quantity_type_from_string (std::string_view str) -> std::optional< EmissionQuantityType >
 Parse an EmissionQuantityType from its string identifier.
auto to_string (SubstanceContentMethod value) -> std::string_view
 Convert SubstanceContentMethod enum to its string identifier.
auto substance_content_method_from_string (std::string_view str) -> std::optional< SubstanceContentMethod >
 Parse a SubstanceContentMethod from its string identifier.
auto to_string (TransactionType value) -> std::string_view
 Convert TransactionType enum to its string identifier.
auto transaction_type_from_string (std::string_view str) -> std::optional< TransactionType >
 Parse a TransactionType from its string identifier.
void set_visual_observer (IVisualObserver *observer)
void set_progress_observer (IProgressObserver *observer)
void reset_visual_observer ()
void reset_progress_observer ()
auto get_visual_observer () -> IVisualObserver *
auto get_progress_observer () -> IProgressObserver *
const std::vector< StageContract > & stage_contracts ()
 Every stage contract, in pipeline order.
const StageContractstage_contract (PipelineStage stage)
 The contract of one stage.
const std::vector< Artifact > & pipeline_artifacts ()
 Every artifact the contracts refer to.
const Artifactfind_artifact (std::string_view name)
 Look up an artifact by name, or nullptr when it is not a pipeline artifact.
std::optional< PipelineStageproducing_stage (std::string_view artifact)
 The earliest stage that writes artifact, or nullopt when nothing does (an externally sourced artifact).
std::optional< PipelineStageparse_pipeline_stage (std::string_view name)
 Parse a stage name (e.g.
std::string_view to_string (PipelineStage stage)
 Canonical lower-case name of a stage (the primary CLI token).
std::vector< std::string > pipeline_stage_names ()
 All stage names accepted by parse_pipeline_stage(), for help text.
std::string_view to_string (Stage stage)
void check_orphaned_passports (const ProjectDB &db, std::vector< ValidationIssue > &out)
 Material passports not referenced by any instance_materials link.
void check_dangling_instance_materials (const ProjectDB &db, std::vector< ValidationIssue > &out)
 instance_materials rows whose instance row or passport is missing.
void check_instances_without_label_defs (const ProjectDB &db, std::vector< ValidationIssue > &out)
 instances rows with no corresponding label_definitions entry.
void check_sibling_cloud_sizes (const ProjectDB &db, std::vector< ValidationIssue > &out)
 Parallel/sibling clouds (cloud, labels, normals, planes, rooms, instances) whose point counts disagree — they are supposed to be index-aligned.
ValidationReport validate_project (const ProjectDB &db)
 Run every check and aggregate the findings.
void check_stage_inputs (const ProjectDB &db, PipelineStage stage, std::vector< ValidationIssue > &out, const ArtifactOverrides &overrides={})
 Assert that stage's input clouds/tables exist in db and are index-aligned, per the contract in core/stage_contract.hpp.
ValidationReport validate_stage (const ProjectDB &db, PipelineStage stage, const ArtifactOverrides &overrides={})
 Run check_stage_inputs for a single stage and aggregate the findings.

Variables

constexpr std::size_t kGaussianSplatHeaderProbeBytes = 64 * 1024
 How many bytes from the head of a file are enough to find end_header.
constexpr uint32_t kUnlabeled = 0
 Point-cloud convention: 0 means "unlabeled" in every CloudL (labels, planes, rooms, instances).
constexpr int kBackgroundApi = -1
 ProjectDB segmentation API convention: -1 marks background/unlabeled in the CV_32S label images returned by ProjectDB.
constexpr uint16_t kMaxStorableLabel = 65534
 Largest label that can be stored in the CV_16U PNG layer.

Typedef Documentation

◆ ArtifactOverrides

using reusex::core::ArtifactOverrides = std::map<std::string, std::string, std::less<>>

Runtime substitutions for artifact names, for the flags that let a stage be pointed at a differently-named cloud (rux create instances --semantic-cloud foo).

Maps the contract's declared name to the name to actually look for; when any member of an any_of input is overridden, the input collapses to the override so the check is exact rather than lenient.

Definition at line 98 of file validate.hpp.

◆ LogHandler

Initial value:
std::function<void(LogLevel level, std::string_view message)>

Definition at line 27 of file logging.hpp.

Enumeration Type Documentation

◆ Alignment

enum class reusex::core::Alignment
strong

Which index-alignment class an artifact belongs to.

This is a property of the ARTIFACT, not of the stage that consumes it, so no stage can accidentally declare the per-plane plane_centroids to be index-aligned with the per-point cloud (STANDARDS §3.2).

Enumerator
none 

not index-aligned with anything (tables, meshes)

per_point 

one entry per point of cloud

per_plane 

one entry per detected plane

Definition at line 70 of file stage_contract.hpp.

◆ ArtifactKind

enum class reusex::core::ArtifactKind
strong

What kind of thing a named artifact is inside a .rux project.

Enumerator
point_cloud 

a named ProjectDB point cloud

mesh 

a row in the meshes table

gaussian_splat 

a row in the gaussian_splats table

table 

a relational table (sensor_frames, …)

Definition at line 58 of file stage_contract.hpp.

◆ EmissionQuantityType

Emission quantity type.

Note
Danish: 'Emissionsmængdetype'
Enumerator
exact 

Exact measured value.

Note
Danish: 'Eksakt'
minimum 

Minimum value.

Note
Danish: 'Minimum'
maximum 

Maximum value.

Note
Danish: 'Maksimum'
interval 

Interval (use lower/upper interval fields).

Note
Danish: 'Interval'

Definition at line 170 of file materialepas_enums.hpp.

◆ EventType

enum class reusex::core::EventType
strong
Enumerator
process 
progress 
visualization 

Definition at line 24 of file processing_observer.hpp.

◆ LogLevel

enum class reusex::core::LogLevel
strong
Enumerator
trace 
debug 
info 
warn 
error 
critical 
off 

Definition at line 17 of file logging.hpp.

◆ Material

enum class reusex::core::Material
strong

Material types from the Danish material passport standard (v1.0).

Closed value list with 43 entries. Each value corresponds to a building material category defined in the "Materialepas for genbrugte byggevarer" specification.

Enumerator
natural_stone 

Natural stone.

Note
Danish: 'Natursten'
lime_mortar 

Lime mortar.

Note
Danish: 'Kalkmørtel'
concrete 

Concrete.

Note
Danish: 'Beton'
terrazzo 

Terrazzo.

Note
Danish: 'Terrazzo'
cement_mortar 

Cement mortar.

Note
Danish: 'Cementmørtel'
aerated_concrete 

Aerated concrete.

Note
Danish: 'Porebeton'
lightweight_clinker_concrete 

Lightweight clinker concrete.

Note
Danish: 'Letklinkerbeton'
plaster 

Plaster.

Note
Danish: 'Puds'
brick 

Brick.

Note
Danish: 'Mursten/tegl'
glazed_tile 

Glazed tile.

Note
Danish: 'Glaseret tegl'
metal_general 

Metal (general).

Note
Danish: 'Metal (generelt)'
iron 

Iron.

Note
Danish: 'Jern'
steel 

Steel.

Note
Danish: 'Stål'
stainless_steel 

Stainless steel.

Note
Danish: 'Rustfrit stål'
aluminum 

Aluminum.

Note
Danish: 'Aluminium'
copper 

Copper.

Note
Danish: 'Kobber'
zinc 

Zinc.

Note
Danish: 'Zink'
lead 

Lead.

Note
Danish: 'Bly'
construction_wood 

Construction wood.

Note
Danish: 'Konstruktionstræ'
wood_unclassified 

Wood (unclassified).

Note
Danish: 'Træ (uklassificeret)'
precious_wood 

Precious wood.

Note
Danish: 'Ædeltræ'
laminated_wood 

Laminated wood.

Note
Danish: 'Lamineret træ'
veneer 

Veneer.

Note
Danish: 'Finer'
wood_fibers 

Wood fibers.

Note
Danish: 'Træfibre'
wood_fiber_boards 

Wood fiber boards.

Note
Danish: 'Træfiberplader'
wood_shavings 

Wood shavings.

Note
Danish: 'Træspåner'
chipboards 

Chipboards.

Note
Danish: 'Spånplader'
paper 

Paper.

Note
Danish: 'Papir'
corrugated_cardboard 

Corrugated cardboard.

Note
Danish: 'Bølgepap'
impregnated_cardboard 

Impregnated cardboard.

Note
Danish: 'Imprægneret pap'
wood_concrete_cement_fibers 

Wood concrete / cement fibers.

Note
Danish: 'Træbeton/cementfibre'
mineral_wool 

Mineral wool.

Note
Danish: 'Mineraluld'
asphalt 

Asphalt.

Note
Danish: 'Asfalt'
fibers 

Fibers.

Note
Danish: 'Fibre'
lining_paper 

Lining paper.

Note
Danish: 'Vægbeklædningspapir'
linoleum 

Linoleum.

Note
Danish: 'Linoleum'
rubber 

Rubber.

Note
Danish: 'Gummi'
plastic 

Plastic.

Note
Danish: 'Plast'
foam_plastic 

Foam plastic.

Note
Danish: 'Skumplast'
glass 

Glass.

Note
Danish: 'Glas'
natural_filling_aggregate 

Natural filling / aggregate.

Note
Danish: 'Naturligt fyld/tilslag'
painting_supplies 

Painting supplies.

Note
Danish: 'Malerartikler'
other 

Other.

Note
Danish: 'Andet'

Definition at line 18 of file materialepas_enums.hpp.

◆ PipelineStage

enum class reusex::core::PipelineStage
strong

Pipeline stages that have an input contract.

Declared in pipeline order: a stage's inputs may only be produced by a strictly earlier stage, which is asserted by tests/unit/core/test_stage_contract.cpp.

Enumerator
import 

extract raw sensor frames from a scan

optimize 

refine per-frame sensor poses (a.k.a. register)

clouds 

back-project sensor frames into "cloud" + "normals"

annotate 

ML semantic labelling of the stored frames.

project 

project 2D semantic labels onto the 3D cloud

planes 

detect planar surfaces

rooms 

partition into rooms

instances 

separate semantic labels into spatial instances

mesh 

generate the reconstructed mesh

texture 

texture-map the reconstructed mesh

windows 

derive window building components

gsplat 

train a 3D Gaussian splat and store it in the project

Definition at line 37 of file stage_contract.hpp.

◆ Stage

enum class reusex::core::Stage
strong
Enumerator
idle 
mesh_generation 
importing_data 
assembling_cloud 
creating_material 
retrieving_textures 
computing_face_coverage 
computing_room_probabilities 
processing_batch 
annotating_batches 
projecting_labels 
ray_tracing 
region_growing 
instance_clustering 
creating_windows 
room_segmentation 
dense_reconstruction 

Definition at line 11 of file stages.hpp.

◆ SubstanceContentMethod

Method used to determine substance content.

Note
Danish: 'Indhold af farlige stoffer (metode)'
Enumerator
assumed 

Assumed based on knowledge or documentation.

Note
Danish: 'Antaget'
measured_surface 

Measured on the surface of the material.

Note
Danish: 'Målt (overflade)'
measured_material 

Measured in the material itself.

Note
Danish: 'Målt (materiale)'

Definition at line 188 of file materialepas_enums.hpp.

◆ TransactionType

enum class reusex::core::TransactionType
strong

Transaction log entry type.

Note
Danish: 'Type'
Enumerator
document 

Change to the document itself (metadata).

Note
Danish: 'Dokument'
property 

Change to a property value.

Note
Danish: 'Egenskab'

Definition at line 203 of file materialepas_enums.hpp.

◆ TriState

enum class reusex::core::TriState
strong

Tri-state value for Yes/No/Unknown fields.

Used where the standard defines three possible states, as distinct from std::optional<bool> which represents present-or-absent.

Enumerator
yes 

Yes / true.

Note
Danish: 'Ja'
no 

No / false.

Note
Danish: 'Nej'
unknown 

Unknown / not determined.

Note
Danish: 'Ukendt'

Definition at line 155 of file materialepas_enums.hpp.

◆ ValidationSeverity

Severity of a single validation finding.

Enumerator
warning 
error 

Definition at line 21 of file validate.hpp.

Function Documentation

◆ api_mat_to_storage()

cv::Mat reusex::core::api_mat_to_storage ( const cv::Mat & api)
inline

Convert an API label image (CV_32S, -1 = background) to a storage label image (CV_16U, 0 = bg) by adding the +1 offset.

Exceptions
std::invalid_argumentif api is not CV_32S.
std::out_of_rangeif any label is < -1 or > kMaxStorableLabel (would wrap the CV_16U storage layer).

Definition at line 140 of file label_semantics.hpp.

References kBackgroundApi, and kMaxStorableLabel.

◆ api_to_point_label()

uint32_t reusex::core::api_to_point_label ( int api_label)
inline

API (CV_32S, -1 = background) → point label (uint32_t, 0 = unlabeled).

Background (kBackgroundApi) maps to kUnlabeled. Valid class ids pass through unchanged (the semantic-class layer keeps its own numbering; only the background sentinel is translated).

Exceptions
std::out_of_rangeif api_label is negative but not the background sentinel.

Definition at line 73 of file label_semantics.hpp.

References kBackgroundApi, and kUnlabeled.

◆ api_to_storage()

uint16_t reusex::core::api_to_storage ( int api_label)
inline

API label (CV_32S, -1 = background) → storage value (CV_16U, 0 = bg, label + 1).

Exceptions
std::out_of_rangeif api_label < -1, or if api_label exceeds kMaxStorableLabel (would wrap the 16-bit storage layer).

Definition at line 96 of file label_semantics.hpp.

References kBackgroundApi, and kMaxStorableLabel.

◆ check_dangling_instance_materials()

void reusex::core::check_dangling_instance_materials ( const ProjectDB & db,
std::vector< ValidationIssue > & out )

instance_materials rows whose instance row or passport is missing.

◆ check_instances_without_label_defs()

void reusex::core::check_instances_without_label_defs ( const ProjectDB & db,
std::vector< ValidationIssue > & out )

instances rows with no corresponding label_definitions entry.

◆ check_orphaned_passports()

void reusex::core::check_orphaned_passports ( const ProjectDB & db,
std::vector< ValidationIssue > & out )

Material passports not referenced by any instance_materials link.

Reported as warnings (an unused passport is not necessarily a bug).

◆ check_sibling_cloud_sizes()

void reusex::core::check_sibling_cloud_sizes ( const ProjectDB & db,
std::vector< ValidationIssue > & out )

Parallel/sibling clouds (cloud, labels, normals, planes, rooms, instances) whose point counts disagree — they are supposed to be index-aligned.

◆ check_stage_inputs()

void reusex::core::check_stage_inputs ( const ProjectDB & db,
PipelineStage stage,
std::vector< ValidationIssue > & out,
const ArtifactOverrides & overrides = {} )

Assert that stage's input clouds/tables exist in db and are index-aligned, per the contract in core/stage_contract.hpp.

Appends an issue per missing input or size mismatch, each carrying a derived resolution hint.

◆ cloud_label_at()

int32_t reusex::core::cloud_label_at ( const std::vector< CloudReferenceNode > & clouds,
size_t cloud_idx,
size_t point_idx )
inline

Helper for leaf nodes: read the label for point_idx from cloud cloud_idx, returning -1 if the index is out of range.

Definition at line 53 of file filter_expression.hpp.

References clouds.

Referenced by reusex::core::CompareNode::evaluate(), reusex::core::EqualNode::evaluate(), reusex::core::InNode::evaluate(), and reusex::core::NotEqualNode::evaluate().

◆ critical() [1/2]

template<typename... Args>
void reusex::core::critical ( fmt::format_string< Args... > format,
Args &&... args )
inline

Definition at line 107 of file logging.hpp.

References critical, and log().

◆ critical() [2/2]

void reusex::core::critical ( std::string_view message)
inline

Definition at line 111 of file logging.hpp.

References critical, and log().

◆ debug() [1/2]

template<typename... Args>
void reusex::core::debug ( fmt::format_string< Args... > format,
Args &&... args )
inline

Definition at line 79 of file logging.hpp.

References debug, and log().

◆ debug() [2/2]

void reusex::core::debug ( std::string_view message)
inline

Definition at line 83 of file logging.hpp.

References debug, and log().

◆ emission_quantity_type_from_string()

auto reusex::core::emission_quantity_type_from_string ( std::string_view str) -> std::optional< EmissionQuantityType >
nodiscard

Parse an EmissionQuantityType from its string identifier.

◆ error() [1/2]

template<typename... Args>
void reusex::core::error ( fmt::format_string< Args... > format,
Args &&... args )
inline

Definition at line 100 of file logging.hpp.

References error, and log().

◆ error() [2/2]

void reusex::core::error ( std::string_view message)
inline

Definition at line 104 of file logging.hpp.

References error, and log().

◆ evaluate_filter()

auto reusex::core::evaluate_filter ( const FilterExpression & expr,
size_t cloud_size ) -> IndicesPtr

Evaluate filter expression against all points, generate Indices.

Parameters
exprParsed filter expression
cloud_sizeNumber of points to evaluate
Returns
Indices of points matching filter

◆ evaluate_filter_expression()

auto reusex::core::evaluate_filter_expression ( const std::string & filter_expr,
ProjectDB & db,
size_t expected_size ) -> IndicesPtr

Parse and evaluate a filter expression against a project in one step.

The whole "resolve the named label clouds, check they line up with the cloud being filtered, evaluate, and say how much survived" sequence, which every caller needs and which used to be duplicated in the app layer. It lives here so rux and the pipeline stage runners filter identically (#284).

Parameters
filter_exprExpression string; an empty string yields nullptr, i.e. "no filter", so callers can pass an unset option straight through.
dbProject to resolve the referenced label clouds from.
expected_sizePoint count of the cloud the indices will index into.
Returns
Indices of matching points, or nullptr for an empty expression.
Exceptions
std::runtime_erroron a parse error, a missing cloud, or a referenced cloud whose size disagrees with expected_size.

◆ find_artifact()

const Artifact * reusex::core::find_artifact ( std::string_view name)

Look up an artifact by name, or nullptr when it is not a pipeline artifact.

◆ generate_guid()

std::string reusex::core::generate_guid ( )

Generate a fresh UUID-v4-like identifier (36-char, hyphenated hex).

Used for stable entity identity (material passports, building components, instances). Non-deterministic by design: each call yields a new value from a random_device-seeded generator. Do not use where reproducibility across runs is required.

◆ get_log_level()

auto reusex::core::get_log_level ( ) -> LogLevel

◆ get_progress_observer()

auto reusex::core::get_progress_observer ( ) -> IProgressObserver *

◆ get_visual_observer()

auto reusex::core::get_visual_observer ( ) -> IVisualObserver *

◆ info() [1/2]

template<typename... Args>
void reusex::core::info ( fmt::format_string< Args... > format,
Args &&... args )
inline

Definition at line 86 of file logging.hpp.

References info, and log().

◆ info() [2/2]

void reusex::core::info ( std::string_view message)
inline

Definition at line 90 of file logging.hpp.

References info, and log().

◆ is_valid_label()

bool reusex::core::is_valid_label ( uint32_t label)
inlineconstexprnoexcept
Returns
true if label denotes a valid (non-unlabeled) point label.

Definition at line 46 of file label_semantics.hpp.

References kUnlabeled.

Referenced by reusex::geometry::CellComplex::compute_room_probabilities(), and label_to_index().

◆ label_to_index()

size_t reusex::core::label_to_index ( uint32_t label)
inline

Convert a point label to a zero-based vector index, replacing the error-prone bare label - 1 idiom used to index parallel arrays such as plane_normals.

Exceptions
std::out_of_rangeif label is kUnlabeled (0), which has no associated index.

Definition at line 56 of file label_semantics.hpp.

References is_valid_label().

◆ log() [1/2]

template<typename... Args>
void reusex::core::log ( LogLevel level,
fmt::format_string< Args... > format,
Args &&... args )
inline

Definition at line 55 of file logging.hpp.

References log_message(), and should_log().

Referenced by critical(), critical(), debug(), debug(), error(), error(), info(), info(), trace(), trace(), warn(), and warn().

◆ log() [2/2]

void reusex::core::log ( LogLevel level,
std::string_view message )
inline

Definition at line 64 of file logging.hpp.

References log_message(), and should_log().

◆ log_message()

void reusex::core::log_message ( LogLevel level,
std::string_view message )

Referenced by log(), and log().

◆ material_from_string()

auto reusex::core::material_from_string ( std::string_view str) -> std::optional< Material >
nodiscard

Parse a Material from its string identifier.

Returns
The matching Material, or std::nullopt if not found.

◆ parse_filter_expression()

auto reusex::core::parse_filter_expression ( const std::string & expression,
ProjectDB & db ) -> std::unique_ptr< FilterExpression >

Parse filter expression and resolve label cloud references from ProjectDB.

Parameters
expressionFilter expression string (e.g., "planes in [1, 2]")
dbProjectDB to load label clouds from
Returns
Parsed expression with resolved cloud references
Exceptions
std::runtime_errorif syntax invalid or cloud not found

◆ parse_gaussian_splat_ply_header()

GaussianSplatHeader reusex::core::parse_gaussian_splat_ply_header ( std::string_view head)

Parse the PLY header in head and verify it is an INRIA splat file.

Parameters
headThe first bytes of the file, at least up to end_header (see kGaussianSplatHeaderProbeBytes).
Exceptions
std::runtime_errorwhen head is not a PLY, is truncated before end_header, is binary_big_endian, or is a PLY without the Gaussian properties — the last being the interesting case, since rux export ply writes a perfectly valid PLY that no splat renderer can draw. The message is user-facing: it names what is missing and which command produces the right file.

◆ parse_pipeline_stage()

std::optional< PipelineStage > reusex::core::parse_pipeline_stage ( std::string_view name)

Parse a stage name (e.g.

"mesh", "register") to a PipelineStage. Returns std::nullopt for an unknown name.

◆ pipeline_artifacts()

const std::vector< Artifact > & reusex::core::pipeline_artifacts ( )

Every artifact the contracts refer to.

◆ pipeline_stage_names()

std::vector< std::string > reusex::core::pipeline_stage_names ( )

All stage names accepted by parse_pipeline_stage(), for help text.

◆ point_label_to_api()

int reusex::core::point_label_to_api ( uint32_t point_label)
inline

Point label (uint32_t, 0 = unlabeled) → API (CV_32S, -1 = background).

Inverse of api_to_point_label(): kUnlabeled maps to kBackgroundApi.

Definition at line 85 of file label_semantics.hpp.

References kBackgroundApi, and kUnlabeled.

◆ producing_stage()

std::optional< PipelineStage > reusex::core::producing_stage ( std::string_view artifact)

The earliest stage that writes artifact, or nullopt when nothing does (an externally sourced artifact).

optimize rewrites sensor_frames in place, so the earliest producer — import — is the one reported.

◆ reset_log_handler()

void reusex::core::reset_log_handler ( )

◆ reset_progress_observer()

void reusex::core::reset_progress_observer ( )

◆ reset_visual_observer()

void reusex::core::reset_visual_observer ( )

◆ set_log_handler()

void reusex::core::set_log_handler ( LogHandler handler)

◆ set_log_level()

void reusex::core::set_log_level ( LogLevel level)

◆ set_progress_observer()

void reusex::core::set_progress_observer ( IProgressObserver * observer)

◆ set_visual_observer()

void reusex::core::set_visual_observer ( IVisualObserver * observer)

◆ should_log()

auto reusex::core::should_log ( LogLevel level) -> bool

Referenced by log(), and log().

◆ stage_contract()

const StageContract & reusex::core::stage_contract ( PipelineStage stage)

The contract of one stage.

Throws std::logic_error for an enumerator with no table row — a programming error, never a runtime condition.

◆ stage_contracts()

const std::vector< StageContract > & reusex::core::stage_contracts ( )

Every stage contract, in pipeline order.

◆ storage_mat_to_api()

cv::Mat reusex::core::storage_mat_to_api ( const cv::Mat & storage)
inline

Convert a storage label image (CV_16U, 0 = bg) to an API label image (CV_32S, -1 = background) by subtracting the +1 offset.

Exceptions
std::invalid_argumentif storage is not CV_16U (empty is passed through as empty).

Definition at line 122 of file label_semantics.hpp.

◆ storage_to_api()

int reusex::core::storage_to_api ( uint16_t storage_value)
inline

Storage value (CV_16U, 0 = bg, label + 1) → API label (CV_32S, -1 = background).

Definition at line 111 of file label_semantics.hpp.

◆ substance_content_method_from_string()

auto reusex::core::substance_content_method_from_string ( std::string_view str) -> std::optional< SubstanceContentMethod >
nodiscard

Parse a SubstanceContentMethod from its string identifier.

◆ to_string() [1/7]

auto reusex::core::to_string ( EmissionQuantityType value) -> std::string_view
nodiscard

Convert EmissionQuantityType enum to its string identifier.

◆ to_string() [2/7]

◆ to_string() [3/7]

std::string_view reusex::core::to_string ( PipelineStage stage)

Canonical lower-case name of a stage (the primary CLI token).

◆ to_string() [4/7]

std::string_view reusex::core::to_string ( Stage stage)

◆ to_string() [5/7]

auto reusex::core::to_string ( SubstanceContentMethod value) -> std::string_view
nodiscard

Convert SubstanceContentMethod enum to its string identifier.

◆ to_string() [6/7]

auto reusex::core::to_string ( TransactionType value) -> std::string_view
nodiscard

Convert TransactionType enum to its string identifier.

◆ to_string() [7/7]

auto reusex::core::to_string ( TriState value) -> std::string_view
nodiscard

Convert TriState enum to its string identifier.

◆ trace() [1/2]

template<typename... Args>
void reusex::core::trace ( fmt::format_string< Args... > format,
Args &&... args )
inline

Definition at line 72 of file logging.hpp.

References log(), and trace.

◆ trace() [2/2]

void reusex::core::trace ( std::string_view message)
inline

Definition at line 76 of file logging.hpp.

References log(), and trace.

◆ transaction_type_from_string()

auto reusex::core::transaction_type_from_string ( std::string_view str) -> std::optional< TransactionType >
nodiscard

Parse a TransactionType from its string identifier.

◆ tri_state_from_string()

auto reusex::core::tri_state_from_string ( std::string_view str) -> std::optional< TriState >
nodiscard

Parse a TriState from its string identifier.

◆ validate_project()

ValidationReport reusex::core::validate_project ( const ProjectDB & db)

Run every check and aggregate the findings.

◆ validate_stage()

ValidationReport reusex::core::validate_stage ( const ProjectDB & db,
PipelineStage stage,
const ArtifactOverrides & overrides = {} )

Run check_stage_inputs for a single stage and aggregate the findings.

◆ warn() [1/2]

template<typename... Args>
void reusex::core::warn ( fmt::format_string< Args... > format,
Args &&... args )
inline

Definition at line 93 of file logging.hpp.

References log(), and warn.

◆ warn() [2/2]

void reusex::core::warn ( std::string_view message)
inline

Definition at line 97 of file logging.hpp.

References log(), and warn.

Variable Documentation

◆ kBackgroundApi

int reusex::core::kBackgroundApi = -1
inlineconstexpr

ProjectDB segmentation API convention: -1 marks background/unlabeled in the CV_32S label images returned by ProjectDB.

Definition at line 38 of file label_semantics.hpp.

Referenced by api_mat_to_storage(), api_to_point_label(), api_to_storage(), and point_label_to_api().

◆ kGaussianSplatHeaderProbeBytes

std::size_t reusex::core::kGaussianSplatHeaderProbeBytes = 64 * 1024
inlineconstexpr

How many bytes from the head of a file are enough to find end_header.

An INRIA header is ~1.5 KiB (62 properties at degree 3). 64 KiB is room for an implementation with comments and then some, while bounding the read of a file that turns out not to be a PLY at all.

Definition at line 42 of file gaussian_splat.hpp.

◆ kMaxStorableLabel

uint16_t reusex::core::kMaxStorableLabel = 65534
inlineconstexpr

Largest label that can be stored in the CV_16U PNG layer.

Storage encodes label + 1, so the maximum encodable value before wrapping 16 bits is 65535 - 1 = 65534.

Definition at line 43 of file label_semantics.hpp.

Referenced by api_mat_to_storage(), and api_to_storage().

◆ kUnlabeled

uint32_t reusex::core::kUnlabeled = 0
inlineconstexpr

Point-cloud convention: 0 means "unlabeled" in every CloudL (labels, planes, rooms, instances).

Valid point labels start at 1.

Definition at line 34 of file label_semantics.hpp.

Referenced by api_to_point_label(), is_valid_label(), and point_label_to_api().