|
ReUseX
0.0.5
3D Point Cloud Processing for Building Reuse
|
#include <ProjectDB.hpp>
Classes | |
| struct | PanoramicImage |
| struct | PipelineLogEntry |
| struct | ProjectSummary |
| struct | ProjectMetadata |
Public Member Functions | |
| ProjectDB (std::filesystem::path dbPath, bool readOnly=false) | |
| Opens a ReUseX project database and validates its schema. | |
| ~ProjectDB () | |
| Destructor closes database connection. | |
| ProjectDB (const ProjectDB &)=delete | |
| ProjectDB & | operator= (const ProjectDB &)=delete |
| ProjectDB (ProjectDB &&) noexcept | |
| ProjectDB & | operator= (ProjectDB &&) noexcept |
| bool | is_open () const noexcept |
| const std::filesystem::path & | path () const noexcept |
| int | schema_version () const |
| void | validate_schema () const |
| void | save_sensor_frame (int nodeId, const cv::Mat &colorImage) |
| void | save_sensor_frame (int nodeId, const cv::Mat &color, const cv::Mat &depth, const cv::Mat &confidence, const std::array< double, 16 > &worldPose, const core::SensorIntrinsics &intrinsics, double timestamp=-1.0) |
| std::vector< int > | sensor_frame_ids () const |
| cv::Mat | sensor_frame_image (int nodeId) const |
| cv::Mat | sensor_frame_depth (int nodeId) const |
| cv::Mat | sensor_frame_confidence (int nodeId) const |
| std::array< double, 16 > | sensor_frame_pose (int nodeId) const |
| core::SensorIntrinsics | sensor_frame_intrinsics (int nodeId) const |
| bool | has_sensor_frame (int nodeId) const |
| double | sensor_frame_timestamp (int nodeId) const |
| Get the timestamp (epoch seconds) of a sensor frame. Returns -1.0 if not set. | |
| int | nearest_sensor_frame_by_timestamp (double timestamp) const |
| Find the sensor frame with the closest timestamp to the given value. | |
| void | save_panoramic_image (const std::string &filename, const std::vector< uint8_t > &jpeg_data, double timestamp=-1.0, int nodeId=-1) |
| cv::Mat | panoramic_image (int id) const |
| cv::Mat | panoramic_image (std::string_view filename) const |
| bool | has_panoramic_image (std::string_view filename) const |
| void | delete_panoramic_image (int id) |
| void | delete_panoramic_image (std::string_view filename) |
| std::vector< PanoramicImage > | list_panoramic_images () const |
| int | panoramic_image_count () const |
| bool | has_segmentation_image (int nodeId) const |
| cv::Mat | segmentation_image (int nodeId) const |
| void | save_segmentation_image (int nodeId, const cv::Mat &labels) |
| void | save_segmentation_images (const std::vector< int > &nodeIds, const std::vector< cv::Mat > &labels) |
| void | save_point_cloud (std::string_view name, const Cloud &cloud, std::string_view stage="", std::string_view paramsJson="") |
| void | save_point_cloud (std::string_view name, const CloudN &cloud, std::string_view stage="", std::string_view paramsJson="") |
| void | save_point_cloud (std::string_view name, const CloudL &cloud, std::string_view stage="", std::string_view paramsJson="") |
| void | save_point_cloud (std::string_view name, const pcl::PointCloud< pcl::PointXYZ > &cloud, std::string_view stage="", std::string_view paramsJson="") |
| CloudPtr | point_cloud_xyzrgb (std::string_view name) const |
| CloudNPtr | point_cloud_normal (std::string_view name) const |
| CloudLPtr | point_cloud_label (std::string_view name) const |
| pcl::PointCloud< pcl::PointXYZ >::Ptr | point_cloud_xyz (std::string_view name) const |
| bool | has_point_cloud (std::string_view name) const |
| void | delete_point_cloud (std::string_view name) |
| std::vector< std::string > | list_point_clouds () const |
| std::string | point_cloud_type (std::string_view name) const |
| void | save_label_definitions (std::string_view cloudName, const std::map< int, std::string > &labelMap) |
| std::map< int, std::string > | label_definitions (std::string_view cloudName) const |
| void | save_mesh (std::string_view name, const pcl::PolygonMesh &mesh, std::string_view stage="", std::string_view paramsJson="") |
| void | save_mesh (std::string_view name, const pcl::TextureMesh &mesh, std::string_view stage="", std::string_view paramsJson="") |
| pcl::PolygonMesh::Ptr | mesh (std::string_view name) const |
| pcl::TextureMesh::Ptr | texture_mesh (std::string_view name) const |
| bool | has_mesh (std::string_view name) const |
| std::vector< std::string > | list_meshes () const |
| void | save_building_component (const geometry::BuildingComponent &component) |
| geometry::BuildingComponent | building_component (std::string_view name) const |
| bool | has_building_component (std::string_view name) const |
| void | delete_building_component (std::string_view name) |
| std::vector< std::string > | list_building_components () const |
| std::vector< std::string > | list_building_components (geometry::ComponentType type) const |
| int | building_component_count () const |
| int | log_pipeline_start (std::string_view stage, std::string_view paramsJson="") |
| void | log_pipeline_end (int logId, bool success, std::string_view errorMsg="") |
| std::vector< PipelineLogEntry > | pipeline_log (int limit=0) const |
| ProjectSummary | project_summary () const |
| core::MaterialPassport | material_passport (std::string_view documentGuid) const |
| std::vector< core::MaterialPassport > | all_material_passports () const |
| void | add_material_passport (const core::MaterialPassport &passport, std::string_view projectId) |
| void | add_material_passport (const core::MaterialPassport &passport, std::string_view projectId, std::string_view id) |
| Add a material passport with a custom row ID. | |
| void | delete_material_passport (std::string_view documentGuid) |
| Delete a material passport by GUID. | |
| std::vector< std::string > | list_passport_guids () const |
| List document GUIDs ordered by created_at. | |
| std::map< std::string, std::string > | passport_stored_properties (std::string_view documentGuid) const |
| Get stored property field_name→string pairs for a passport. | |
| std::string | passport_property_value (std::string_view documentGuid, std::string_view fieldName) const |
| Get a single passport property value by field name. | |
| core::MaterialPassportMetadata | passport_metadata (std::string_view documentGuid) const |
| Get passport metadata without loading all properties. | |
| void | set_passport_metadata_field (std::string_view documentGuid, std::string_view column, std::string_view value) |
| Set a metadata column on a material passport. | |
| void | set_passport_property (std::string_view documentGuid, std::string_view fieldName, std::string_view value) |
| Set a single property value by field name (upsert). | |
| void | delete_passport_property (std::string_view documentGuid, std::string_view fieldName) |
| Delete a single property value by field name. | |
| ProjectMetadata | get_project_metadata (std::string_view projectId) const |
| Get project metadata by project ID. | |
| void | update_project_metadata (const ProjectMetadata &metadata) |
| Update project metadata. | |
| std::vector< std::string > | list_project_ids () const |
| List all project IDs in the database. | |
Definition at line 30 of file ProjectDB.hpp.
|
explicit |
Opens a ReUseX project database and validates its schema.
Creates the following tables if they don't exist (write mode only):
| dbPath | Path to the database file |
| readOnly | If true, opens database in read-only mode |
| std::runtime_error | if database cannot be opened or schema is invalid |
Referenced by operator=(), operator=(), ProjectDB(), and ProjectDB().
| reusex::ProjectDB::~ProjectDB | ( | ) |
Destructor closes database connection.
|
delete |
References ProjectDB().
|
noexcept |
References ProjectDB().
| void reusex::ProjectDB::add_material_passport | ( | const core::MaterialPassport & | passport, |
| std::string_view | projectId ) |
| void reusex::ProjectDB::add_material_passport | ( | const core::MaterialPassport & | passport, |
| std::string_view | projectId, | ||
| std::string_view | id ) |
Add a material passport with a custom row ID.
The id parameter overrides the material_passports.id column value (normally set to document_guid). Use this to link a passport to a sensor frame by setting id to the frame's node_id.
| passport | Material passport data |
| projectId | Project identifier (may be empty) |
| id | Custom row ID for the material_passports.id column |
| std::vector< core::MaterialPassport > reusex::ProjectDB::all_material_passports | ( | ) | const |
| geometry::BuildingComponent reusex::ProjectDB::building_component | ( | std::string_view | name | ) | const |
| int reusex::ProjectDB::building_component_count | ( | ) | const |
| void reusex::ProjectDB::delete_building_component | ( | std::string_view | name | ) |
| void reusex::ProjectDB::delete_material_passport | ( | std::string_view | documentGuid | ) |
Delete a material passport by GUID.
| documentGuid | Document GUID to delete |
| std::runtime_error | if passport does not exist |
| void reusex::ProjectDB::delete_panoramic_image | ( | int | id | ) |
| void reusex::ProjectDB::delete_panoramic_image | ( | std::string_view | filename | ) |
| void reusex::ProjectDB::delete_passport_property | ( | std::string_view | documentGuid, |
| std::string_view | fieldName ) |
Delete a single property value by field name.
| documentGuid | Document GUID |
| fieldName | Property field name (name_en) |
| std::runtime_error | if passport or property not found |
| void reusex::ProjectDB::delete_point_cloud | ( | std::string_view | name | ) |
| ProjectMetadata reusex::ProjectDB::get_project_metadata | ( | std::string_view | projectId | ) | const |
Get project metadata by project ID.
| projectId | Project identifier |
| std::runtime_error | if project does not exist |
| bool reusex::ProjectDB::has_building_component | ( | std::string_view | name | ) | const |
| bool reusex::ProjectDB::has_mesh | ( | std::string_view | name | ) | const |
| bool reusex::ProjectDB::has_panoramic_image | ( | std::string_view | filename | ) | const |
| bool reusex::ProjectDB::has_point_cloud | ( | std::string_view | name | ) | const |
| bool reusex::ProjectDB::has_segmentation_image | ( | int | nodeId | ) | const |
| bool reusex::ProjectDB::has_sensor_frame | ( | int | nodeId | ) | const |
References has_sensor_frame().
Referenced by has_sensor_frame().
| std::map< int, std::string > reusex::ProjectDB::label_definitions | ( | std::string_view | cloudName | ) | const |
| std::vector< std::string > reusex::ProjectDB::list_building_components | ( | ) | const |
| std::vector< std::string > reusex::ProjectDB::list_building_components | ( | geometry::ComponentType | type | ) | const |
| std::vector< std::string > reusex::ProjectDB::list_meshes | ( | ) | const |
| std::vector< PanoramicImage > reusex::ProjectDB::list_panoramic_images | ( | ) | const |
| std::vector< std::string > reusex::ProjectDB::list_passport_guids | ( | ) | const |
List document GUIDs ordered by created_at.
| std::vector< std::string > reusex::ProjectDB::list_point_clouds | ( | ) | const |
| std::vector< std::string > reusex::ProjectDB::list_project_ids | ( | ) | const |
List all project IDs in the database.
| void reusex::ProjectDB::log_pipeline_end | ( | int | logId, |
| bool | success, | ||
| std::string_view | errorMsg = "" ) |
| int reusex::ProjectDB::log_pipeline_start | ( | std::string_view | stage, |
| std::string_view | paramsJson = "" ) |
| core::MaterialPassport reusex::ProjectDB::material_passport | ( | std::string_view | documentGuid | ) | const |
| pcl::PolygonMesh::Ptr reusex::ProjectDB::mesh | ( | std::string_view | name | ) | const |
Referenced by save_mesh(), and save_mesh().
| int reusex::ProjectDB::nearest_sensor_frame_by_timestamp | ( | double | timestamp | ) | const |
Find the sensor frame with the closest timestamp to the given value.
Returns -1 if no sensor frames have timestamps.
References nearest_sensor_frame_by_timestamp().
Referenced by nearest_sensor_frame_by_timestamp().
References ProjectDB().
References ProjectDB().
| cv::Mat reusex::ProjectDB::panoramic_image | ( | int | id | ) | const |
| cv::Mat reusex::ProjectDB::panoramic_image | ( | std::string_view | filename | ) | const |
| int reusex::ProjectDB::panoramic_image_count | ( | ) | const |
| core::MaterialPassportMetadata reusex::ProjectDB::passport_metadata | ( | std::string_view | documentGuid | ) | const |
Get passport metadata without loading all properties.
| documentGuid | Document GUID |
| std::runtime_error | if passport not found |
| std::string reusex::ProjectDB::passport_property_value | ( | std::string_view | documentGuid, |
| std::string_view | fieldName ) const |
Get a single passport property value by field name.
| documentGuid | Document GUID |
| fieldName | Property field name (name_en in property_definitions) |
| std::runtime_error | if passport or property not found |
| std::map< std::string, std::string > reusex::ProjectDB::passport_stored_properties | ( | std::string_view | documentGuid | ) | const |
Get stored property field_name→string pairs for a passport.
Only includes properties that actually have rows in passport_property_values. Values are returned as human-readable strings (BLOB decoded via as_string()).
| documentGuid | Document GUID |
| std::runtime_error | if passport does not exist |
|
noexcept |
| std::vector< PipelineLogEntry > reusex::ProjectDB::pipeline_log | ( | int | limit = 0 | ) | const |
| CloudLPtr reusex::ProjectDB::point_cloud_label | ( | std::string_view | name | ) | const |
| CloudNPtr reusex::ProjectDB::point_cloud_normal | ( | std::string_view | name | ) | const |
| std::string reusex::ProjectDB::point_cloud_type | ( | std::string_view | name | ) | const |
| pcl::PointCloud< pcl::PointXYZ >::Ptr reusex::ProjectDB::point_cloud_xyz | ( | std::string_view | name | ) | const |
| CloudPtr reusex::ProjectDB::point_cloud_xyzrgb | ( | std::string_view | name | ) | const |
| ProjectSummary reusex::ProjectDB::project_summary | ( | ) | const |
| void reusex::ProjectDB::save_building_component | ( | const geometry::BuildingComponent & | component | ) |
| void reusex::ProjectDB::save_label_definitions | ( | std::string_view | cloudName, |
| const std::map< int, std::string > & | labelMap ) |
| void reusex::ProjectDB::save_mesh | ( | std::string_view | name, |
| const pcl::PolygonMesh & | mesh, | ||
| std::string_view | stage = "", | ||
| std::string_view | paramsJson = "" ) |
References mesh().
| void reusex::ProjectDB::save_mesh | ( | std::string_view | name, |
| const pcl::TextureMesh & | mesh, | ||
| std::string_view | stage = "", | ||
| std::string_view | paramsJson = "" ) |
References mesh().
| void reusex::ProjectDB::save_panoramic_image | ( | const std::string & | filename, |
| const std::vector< uint8_t > & | jpeg_data, | ||
| double | timestamp = -1.0, | ||
| int | nodeId = -1 ) |
| void reusex::ProjectDB::save_point_cloud | ( | std::string_view | name, |
| const Cloud & | cloud, | ||
| std::string_view | stage = "", | ||
| std::string_view | paramsJson = "" ) |
| void reusex::ProjectDB::save_point_cloud | ( | std::string_view | name, |
| const CloudL & | cloud, | ||
| std::string_view | stage = "", | ||
| std::string_view | paramsJson = "" ) |
| void reusex::ProjectDB::save_point_cloud | ( | std::string_view | name, |
| const CloudN & | cloud, | ||
| std::string_view | stage = "", | ||
| std::string_view | paramsJson = "" ) |
| void reusex::ProjectDB::save_point_cloud | ( | std::string_view | name, |
| const pcl::PointCloud< pcl::PointXYZ > & | cloud, | ||
| std::string_view | stage = "", | ||
| std::string_view | paramsJson = "" ) |
| void reusex::ProjectDB::save_segmentation_image | ( | int | nodeId, |
| const cv::Mat & | labels ) |
| void reusex::ProjectDB::save_segmentation_images | ( | const std::vector< int > & | nodeIds, |
| const std::vector< cv::Mat > & | labels ) |
| void reusex::ProjectDB::save_sensor_frame | ( | int | nodeId, |
| const cv::Mat & | color, | ||
| const cv::Mat & | depth, | ||
| const cv::Mat & | confidence, | ||
| const std::array< double, 16 > & | worldPose, | ||
| const core::SensorIntrinsics & | intrinsics, | ||
| double | timestamp = -1.0 ) |
References save_sensor_frame().
| void reusex::ProjectDB::save_sensor_frame | ( | int | nodeId, |
| const cv::Mat & | colorImage ) |
References save_sensor_frame().
Referenced by save_sensor_frame(), and save_sensor_frame().
| int reusex::ProjectDB::schema_version | ( | ) | const |
References schema_version().
Referenced by schema_version().
| cv::Mat reusex::ProjectDB::segmentation_image | ( | int | nodeId | ) | const |
| cv::Mat reusex::ProjectDB::sensor_frame_confidence | ( | int | nodeId | ) | const |
References sensor_frame_confidence().
Referenced by sensor_frame_confidence().
| cv::Mat reusex::ProjectDB::sensor_frame_depth | ( | int | nodeId | ) | const |
References sensor_frame_depth().
Referenced by sensor_frame_depth().
| std::vector< int > reusex::ProjectDB::sensor_frame_ids | ( | ) | const |
References sensor_frame_ids().
Referenced by sensor_frame_ids().
| cv::Mat reusex::ProjectDB::sensor_frame_image | ( | int | nodeId | ) | const |
References sensor_frame_image().
Referenced by sensor_frame_image().
| core::SensorIntrinsics reusex::ProjectDB::sensor_frame_intrinsics | ( | int | nodeId | ) | const |
References sensor_frame_intrinsics().
Referenced by sensor_frame_intrinsics().
| std::array< double, 16 > reusex::ProjectDB::sensor_frame_pose | ( | int | nodeId | ) | const |
References sensor_frame_pose().
Referenced by sensor_frame_pose().
| double reusex::ProjectDB::sensor_frame_timestamp | ( | int | nodeId | ) | const |
Get the timestamp (epoch seconds) of a sensor frame. Returns -1.0 if not set.
References sensor_frame_timestamp().
Referenced by sensor_frame_timestamp().
| void reusex::ProjectDB::set_passport_metadata_field | ( | std::string_view | documentGuid, |
| std::string_view | column, | ||
| std::string_view | value ) |
Set a metadata column on a material passport.
Supported columns: created_at, revised_at, version_number, version_date. document_guid cannot be changed (it is the primary key).
| documentGuid | Document GUID (must exist) |
| column | Metadata column name |
| value | New value |
| std::runtime_error | if passport not found or column not allowed |
| void reusex::ProjectDB::set_passport_property | ( | std::string_view | documentGuid, |
| std::string_view | fieldName, | ||
| std::string_view | value ) |
Set a single property value by field name (upsert).
Looks up the property_definitions entry by name_en, then upserts into passport_property_values. Creates property_definitions entry if needed.
| documentGuid | Document GUID (must exist) |
| fieldName | Property field name (name_en) |
| value | String value to store |
| std::runtime_error | if passport does not exist |
| pcl::TextureMesh::Ptr reusex::ProjectDB::texture_mesh | ( | std::string_view | name | ) | const |
| void reusex::ProjectDB::update_project_metadata | ( | const ProjectMetadata & | metadata | ) |
Update project metadata.
| metadata | Project metadata to update Creates project if it doesn't exist |
| void reusex::ProjectDB::validate_schema | ( | ) | const |
References validate_schema().
Referenced by validate_schema().