ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
AutomaticReconstructionController.cpp
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - CloudViewer: www.cloudViewer.org -
3 // ----------------------------------------------------------------------------
4 // Copyright (c) 2018-2024 www.cloudViewer.org
5 // SPDX-License-Identifier: MIT
6 // ----------------------------------------------------------------------------
7 
9 
10 #include "base/reconstruction_manager.h"
11 
12 namespace cloudViewer {
13 
14 using namespace colmap;
15 
17  const Options& options,
18  colmap::ReconstructionManager* reconstruction_manager)
20  static_cast<const colmap::AutomaticReconstructionController::
21  Options&>(options),
22  reconstruction_manager),
23  ecv_options_(options) {
24  // app-specific initialization if needed
25 }
26 
28  // Clear app-specific data containers before reconstruction
29  fused_points_.clear();
30  meshing_paths_.clear();
31  textured_paths_.clear();
32  texturing_success_ = false;
33 
34  // Call base class implementation
35  // It will call our hook methods to collect data
36  colmap::AutomaticReconstructionController::RunDenseMapper();
37 }
38 
40  size_t reconstruction_idx,
41  const std::vector<colmap::PlyPoint>& points) {
42  // app-specific: Collect fused points for visualization
43  fused_points_.push_back(points);
44 }
45 
47  size_t reconstruction_idx, const std::string& mesh_path) {
48  // app-specific: Collect mesh path for visualization
49  meshing_paths_.push_back(mesh_path);
50 }
51 
53  size_t reconstruction_idx, const std::string& textured_path) {
54  // app-specific: Collect textured mesh path and mark success
55  textured_paths_.push_back(textured_path);
56  texturing_success_ = true;
57 }
58 
59 } // namespace cloudViewer
int points
void OnTexturedMeshGenerated(size_t reconstruction_idx, const std::string &textured_path) override
void OnMeshGenerated(size_t reconstruction_idx, const std::string &mesh_path) override
void OnFusedPointsGenerated(size_t reconstruction_idx, const std::vector< colmap::PlyPoint > &points) override
AutomaticReconstructionController(const Options &options, colmap::ReconstructionManager *reconstruction_manager)
std::vector< std::vector< colmap::PlyPoint > > fused_points_
Generic file read and write utility for python interface.