Skip to content

Commit

Permalink
Update info output
Browse files Browse the repository at this point in the history
  • Loading branch information
ipadjen committed Aug 14, 2022
1 parent c100da2 commit 3e9ba9a
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 23 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Changelog

## [0.1.0] - 2022-07-22
## [0.1.0] - 2022-08-14
First release
4 changes: 1 addition & 3 deletions src/BoundingRegion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<bool>(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;
Expand Down Expand Up @@ -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"
Expand Down
19 changes: 10 additions & 9 deletions src/Map3d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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()) {
Expand Down Expand Up @@ -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.");
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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() {
Expand Down Expand Up @@ -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();
Expand Down
6 changes: 3 additions & 3 deletions src/PointCloud.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

Expand Down Expand Up @@ -139,7 +139,7 @@ void PointCloud::read_point_clouds() {
IO::read_point_cloud(Config::get().points_xyz, _pointCloudTerrain);
_pointCloudTerrain.add_property_map<bool> ("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. "
Expand All @@ -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;
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/PolyFeature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/Terrain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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<bool>("is_building_point").first;
for (auto& f : features) {
Expand Down
4 changes: 1 addition & 3 deletions src/Top.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@
#include "geomutils.h"

Top::Top(const int outputLayerID)
: Boundary(outputLayerID) {
}
: Boundary(outputLayerID) {}

Top::~Top() = default;

Expand All @@ -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);
}
Expand Down

0 comments on commit 3e9ba9a

Please sign in to comment.