From 3e9ba9abdb5b111c5ba63362b7bccbd040b9a91e Mon Sep 17 00:00:00 2001 From: Ivan Paden Date: Sun, 14 Aug 2022 17:11:30 +0200 Subject: [PATCH] Update info output --- CHANGELOG.md | 2 +- src/BoundingRegion.cpp | 4 +--- src/Map3d.cpp | 19 ++++++++++--------- src/PointCloud.cpp | 6 +++--- src/PolyFeature.cpp | 2 +- src/Terrain.cpp | 6 +++--- src/Top.cpp | 4 +--- 7 files changed, 20 insertions(+), 23 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index df851a62..53276a63 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ # Changelog -## [0.1.0] - 2022-07-22 +## [0.1.0] - 2022-08-14 First release diff --git a/src/BoundingRegion.cpp b/src/BoundingRegion.cpp index 3bc369ce..d0c2f17d 100644 --- a/src/BoundingRegion.cpp +++ b/src/BoundingRegion.cpp @@ -49,9 +49,7 @@ void BoundingRegion::operator()(Polygon_2& poly) { void BoundingRegion::calc_influ_region_bpg(const DT& dt, const Point_set_3& pointCloudBuildings, Buildings& buildings) { -#ifndef NDEBUG assert(boost::get(Config::get().influRegionConfig)); -#endif double influRegionRadius; //-- Find building where the point of interest lies in and define radius of interest with BPG bool foundBuilding = false; @@ -123,7 +121,7 @@ void BoundingRegion::calc_bnd_bpg(const Polygon_2& influRegionPoly, // double blockRatio = this->calc_blockage_ratio_from_ashape_alt(buildings, angle, localPoly); // double blockRatio = this->calc_blockage_ratio_from_edges(buildings, angle, localPoly); - std::cout << "\tBlockage ratio is: " << blockRatio << std::endl; + std::cout << " Blockage ratio is: " << blockRatio << std::endl; if (Config::get().bpgBlockageRatioFlag && blockRatio > Config::get().bpgBlockageRatio) { std::cout << "INFO: Blockage ratio is more than " << Config::get().bpgBlockageRatio * 100 << "%. Expanding domain cross section to meet the guideline" diff --git a/src/Map3d.cpp b/src/Map3d.cpp index b09e5f3d..cff1ef4b 100644 --- a/src/Map3d.cpp +++ b/src/Map3d.cpp @@ -147,7 +147,7 @@ void Map3d::set_features() { } if (!_importedBuildings.empty()) { this->clear_inactives(); - std::cout << "\tGeometries imported: " << _importedBuildings.size() << std::endl; + std::cout << " Geometries imported: " << _importedBuildings.size() << std::endl; } //-- Boundaries for (int i = 0; i < Config::get().numSides; ++i) @@ -164,7 +164,7 @@ void Map3d::set_features() { _lsFeatures.push_back(surfacePoly); } } - std::cout << "\tPolygons read: " << _lsFeatures.size() << std::endl; + std::cout << " Polygons read: " << _lsFeatures.size() << std::endl; //-- Set flat terrain or random thin terrain points if (_pointCloud.get_terrain().empty()) { @@ -217,7 +217,7 @@ void Map3d::set_influ_region() { //-- Check if imported and reconstructed buildings are overlapping if (!_importedBuildings.empty()) this->solve_building_conflicts(); - std::cout << "\tNumber of building geometries in the influence region: " << _buildings.size() << std::endl; + std::cout << " Number of building geometries in the influence region: " << _buildings.size() << std::endl; if (_buildings.empty()) { throw std::runtime_error("No buildings were reconstructed in the influence region!" " If using polygons and point cloud, make sure they are aligned."); @@ -283,7 +283,7 @@ void Map3d::reconstruct_terrain() { void Map3d::reconstruct_buildings() { std::cout << "\nReconstructing buildings" << std::endl; if (!_importedBuildings.empty() && _cityjsonInput) { - std::cout << "\tWill try to reconstruct imported buildings in LoD: " << Config::get().importLoD + std::cout << " Will try to reconstruct imported buildings in LoD: " << Config::get().importLoD << ". If I cannot find a geometry with that LoD, I will reconstruct in the highest LoD available" << std::endl; } @@ -313,10 +313,11 @@ void Map3d::reconstruct_buildings() { Config::get().failedBuildings.push_back(f->get_internal_id()); } } - Config::get().logSummary << "Building reconstruction summary: total failed reconstructions : " - << failed << std::endl; - this->clear_inactives(); + Config::get().logSummary << "Building reconstruction summary: successfully reconstructed buildings: " + << _buildings.size() << std::endl; + Config::get().logSummary << " num of failed reconstructions: " + << failed << std::endl; } void Map3d::reconstruct_boundaries() { @@ -428,8 +429,8 @@ void Map3d::output() { assert(Config::get().outputSurfaces.size() == TopoFeature::get_num_output_layers()); fs::current_path(Config::get().outputDir); std::cout << "\nOutputting surface meshes " << std::endl; - std::cout << "\tFolder: " << fs::canonical(fs::current_path()) << std::endl; -// std::cout << "\tFormat: " << Config::get().outputFormat << std::endl; //todo + std::cout << " Folder: " << fs::canonical(fs::current_path()) << std::endl; +// std::cout << " Format: " << Config::get().outputFormat << std::endl; //todo //-- Group all features for output this->prep_feature_output(); diff --git a/src/PointCloud.cpp b/src/PointCloud.cpp index ff8de304..63cb7977 100644 --- a/src/PointCloud.cpp +++ b/src/PointCloud.cpp @@ -42,7 +42,7 @@ void PointCloud::random_thin_pts() { Config::get().terrainThinning), _pointCloudTerrain.end()); _pointCloudTerrain.collect_garbage(); - std::cout << "\tTerrain points after thinning: " << _pointCloudTerrain.size() << std::endl; + std::cout << " Terrain points after thinning: " << _pointCloudTerrain.size() << std::endl; } } @@ -139,7 +139,7 @@ void PointCloud::read_point_clouds() { IO::read_point_cloud(Config::get().points_xyz, _pointCloudTerrain); _pointCloudTerrain.add_property_map ("is_building_point", false); - std::cout << "\tPoints read: " << _pointCloudTerrain.size() << std::endl; + std::cout << " Points read: " << _pointCloudTerrain.size() << std::endl; } else { std::cout << "INFO: Did not find any ground points! Will calculate ground as a flat surface." << std::endl; std::cout << "WARNING: Ground height of buildings can only be approximated. " @@ -152,7 +152,7 @@ void PointCloud::read_point_clouds() { IO::read_point_cloud(Config::get().buildings_xyz, _pointCloudBuildings); if (_pointCloudBuildings.empty()) throw std::invalid_argument("Didn't find any building points!"); - std::cout << "\tPoints read: " << _pointCloudBuildings.size() << std::endl; + std::cout << " Points read: " << _pointCloudBuildings.size() << std::endl; } } diff --git a/src/PolyFeature.cpp b/src/PolyFeature.cpp index 938d9886..bb66ae57 100644 --- a/src/PolyFeature.cpp +++ b/src/PolyFeature.cpp @@ -281,7 +281,7 @@ void PolyFeature::parse_json_poly(const nlohmann::json& poly, const bool checkSi std::cout << "WARNING: Bad building polygon found! This might effect reconstruction quality! " "If you end up having problems, try to fix the dataset with GIS software or 'pprepair'." << std::endl; - std::cout << "\t\tAlternatively, you can use the 'avoid_bad_polys' flag to skip" + std::cout << " Alternatively, you can use the 'avoid_bad_polys' flag to skip" " the import of problematic polygons.\n" << std::endl; } } diff --git a/src/Terrain.cpp b/src/Terrain.cpp index beb05bd0..52d8ac91 100644 --- a/src/Terrain.cpp +++ b/src/Terrain.cpp @@ -54,9 +54,9 @@ void Terrain::set_cdt(const Point_set_3& pointCloud) { ++count; } IO::print_progress_bar(100); std::clog << std::endl; - std::cout << "\tTriangulating..." << std::flush; + std::cout << " Triangulating..." << std::flush; _cdt.insert(pts.begin(), pts.end()); - std::cout << "\r\tTriangulating " << std::endl; + std::cout << "\r Triangulating " << std::endl; /* //-- Smoothing @@ -68,7 +68,7 @@ void Terrain::set_cdt(const Point_set_3& pointCloud) { } void Terrain::prep_constraints(const PolyFeatures& features, Point_set_3& pointCloud) { - std::cout << "\tLifting polygon edges to terrain height" << std::endl; + std::cout << " Lifting polygon edges to terrain height" << std::endl; int countFeatures = 0; auto is_building_pt = pointCloud.property_map("is_building_point").first; for (auto& f : features) { diff --git a/src/Top.cpp b/src/Top.cpp index 95016474..0c4912b0 100644 --- a/src/Top.cpp +++ b/src/Top.cpp @@ -30,8 +30,7 @@ #include "geomutils.h" Top::Top(const int outputLayerID) - : Boundary(outputLayerID) { -} + : Boundary(outputLayerID) {} Top::~Top() = default; @@ -43,7 +42,6 @@ void Top::reconstruct() { for (auto& pt : _outerPts) { cdt_top.insert(ePoint_3(pt.x(), pt.y(), Config::get().topHeight)); } - //-- Add mesh faces for top geomutils::cdt_to_mesh(cdt_top, _mesh); }