diff --git a/Kinetic_surface_reconstruction/doc/Kinetic_surface_reconstruction/Kinetic_surface_reconstruction.txt b/Kinetic_surface_reconstruction/doc/Kinetic_surface_reconstruction/Kinetic_surface_reconstruction.txt index 41a2a08ebb2..259f609f0d1 100644 --- a/Kinetic_surface_reconstruction/doc/Kinetic_surface_reconstruction/Kinetic_surface_reconstruction.txt +++ b/Kinetic_surface_reconstruction/doc/Kinetic_surface_reconstruction/Kinetic_surface_reconstruction.txt @@ -85,18 +85,18 @@ Impact of parameters on the reconstruction of the rotated lans model.\n From lef \subsection ksrBasicExample Basic Example This minimal example shows the import of a simple synthetic point cloud and an reconstruction using mostly default parameters. -\cgalExample{Kinetic_surface_reconstruction/ksr_basic.cpp} +\cgalExample{Kinetic_surface_reconstruction/basic.cpp} \subsection ksrBuildingExample Building Example This example shows the import of an acquired point cloud of a building and a reconstruction using a common choice of parameters for building reconstruction. The input point cloud is reoriented to be axis-aligned and regularization is used to simplify the detected shapes before reconstruction. The actual reconstruction method is actually fast. To avoid running the full shape detection and kinetic partition just to try different values for beta, several reconstructions are performed and exported into ply format. -\cgalExample{Kinetic_surface_reconstruction/ksr_building.cpp} +\cgalExample{Kinetic_surface_reconstruction/building.cpp} \subsection ksrParametersExample Parameters Example This example provides a command line version of the kinetic surface reconstruction allowing to configure the input point cloud filename and most parameters. -\cgalExample{Kinetic_surface_reconstruction/ksr_parameters.cpp} +\cgalExample{Kinetic_surface_reconstruction/parameters.cpp} \section ksrPerformance Performance diff --git a/Kinetic_surface_reconstruction/doc/Kinetic_surface_reconstruction/examples.txt b/Kinetic_surface_reconstruction/doc/Kinetic_surface_reconstruction/examples.txt index 479978fe0ad..bed6421d996 100644 --- a/Kinetic_surface_reconstruction/doc/Kinetic_surface_reconstruction/examples.txt +++ b/Kinetic_surface_reconstruction/doc/Kinetic_surface_reconstruction/examples.txt @@ -1,5 +1,5 @@ /*! -\example Kinetic_surface_reconstruction/ksr_basic.cpp -\example Kinetic_surface_reconstruction/ksr_building.cpp -\example Kinetic_surface_reconstruction/ksr_parameters.cpp -*/ \ No newline at end of file +\example Kinetic_surface_reconstruction/basic.cpp +\example Kinetic_surface_reconstruction/building.cpp +\example Kinetic_surface_reconstruction/parameters.cpp +*/ diff --git a/Kinetic_surface_reconstruction/examples/Kinetic_surface_reconstruction/CMakeLists.txt b/Kinetic_surface_reconstruction/examples/Kinetic_surface_reconstruction/CMakeLists.txt index 26f4ef01c26..38b436b6150 100644 --- a/Kinetic_surface_reconstruction/examples/Kinetic_surface_reconstruction/CMakeLists.txt +++ b/Kinetic_surface_reconstruction/examples/Kinetic_surface_reconstruction/CMakeLists.txt @@ -13,7 +13,7 @@ if(Eigen3_FOUND) message(STATUS "Found Eigen") include(CGAL_Eigen_support) - set(targets ksr_basic ksr_building ksr_parameters) + set(targets basic building parameters) foreach(target ${targets}) create_single_source_cgal_program("${target}.cpp") diff --git a/Kinetic_surface_reconstruction/examples/Kinetic_surface_reconstruction/ksr_basic.cpp b/Kinetic_surface_reconstruction/examples/Kinetic_surface_reconstruction/basic.cpp similarity index 100% rename from Kinetic_surface_reconstruction/examples/Kinetic_surface_reconstruction/ksr_basic.cpp rename to Kinetic_surface_reconstruction/examples/Kinetic_surface_reconstruction/basic.cpp diff --git a/Kinetic_surface_reconstruction/examples/Kinetic_surface_reconstruction/ksr_building.cpp b/Kinetic_surface_reconstruction/examples/Kinetic_surface_reconstruction/building.cpp similarity index 100% rename from Kinetic_surface_reconstruction/examples/Kinetic_surface_reconstruction/ksr_building.cpp rename to Kinetic_surface_reconstruction/examples/Kinetic_surface_reconstruction/building.cpp diff --git a/Kinetic_surface_reconstruction/examples/Kinetic_surface_reconstruction/ksr_parameters.cpp b/Kinetic_surface_reconstruction/examples/Kinetic_surface_reconstruction/parameters.cpp similarity index 98% rename from Kinetic_surface_reconstruction/examples/Kinetic_surface_reconstruction/ksr_parameters.cpp rename to Kinetic_surface_reconstruction/examples/Kinetic_surface_reconstruction/parameters.cpp index 9ef1d7b97ce..8431281b6ac 100644 --- a/Kinetic_surface_reconstruction/examples/Kinetic_surface_reconstruction/ksr_parameters.cpp +++ b/Kinetic_surface_reconstruction/examples/Kinetic_surface_reconstruction/parameters.cpp @@ -135,7 +135,7 @@ int main(const int argc, const char** argv) { } if (parameters.min_region_size == 0) - parameters.min_region_size = static_cast(point_set.size() * 0.01); + parameters.min_region_size = point_set.size() * 0.01; std::cout << std::endl; std::cout << "--- INPUT STATS: " << std::endl; diff --git a/Kinetic_surface_reconstruction/include/CGAL/KSR_3/Graphcut.h b/Kinetic_surface_reconstruction/include/CGAL/KSR_3/Graphcut.h index 4c9453d4cb2..97d91418cc5 100644 --- a/Kinetic_surface_reconstruction/include/CGAL/KSR_3/Graphcut.h +++ b/Kinetic_surface_reconstruction/include/CGAL/KSR_3/Graphcut.h @@ -115,8 +115,8 @@ namespace KSR_3 { std::size_t sum_outside = 0; for (std::size_t i = 6; i < cost_matrix[0].size(); i++) { - sum_inside += static_cast(cost_matrix[0][i]); - sum_outside += static_cast(cost_matrix[1][i]); + sum_inside += cost_matrix[0][i]; + sum_outside += cost_matrix[1][i]; min = (std::min)(cost_matrix[0][i], min); min = (std::min)(cost_matrix[1][i], min); max = (std::max)(cost_matrix[0][i], max); diff --git a/Kinetic_surface_reconstruction/include/CGAL/Kinetic_surface_reconstruction_3.h b/Kinetic_surface_reconstruction/include/CGAL/Kinetic_surface_reconstruction_3.h index eface9ed439..3603890dd64 100644 --- a/Kinetic_surface_reconstruction/include/CGAL/Kinetic_surface_reconstruction_3.h +++ b/Kinetic_surface_reconstruction/include/CGAL/Kinetic_surface_reconstruction_3.h @@ -673,7 +673,7 @@ private: write_face(m_lcc.dart_descriptor(*it), "face_wo_volume.ply"); } - int first = static_cast(m_lcc.template info<3>(m_lcc.dart_descriptor(*it)).volume_id); + int first = m_lcc.template info<3>(m_lcc.dart_descriptor(*it)).volume_id; auto& inf1 = m_lcc.template info<3>(m_lcc.dart_descriptor(*it++)); auto inf2 = inf1; @@ -682,7 +682,7 @@ private: int second; if (n.size() == 2 && it != n.end()) - second = static_cast(m_lcc.template info<3>(m_lcc.dart_descriptor(*it)).volume_id); + second = m_lcc.template info<3>(m_lcc.dart_descriptor(*it)).volume_id; if (n.size() == 2 && it != n.end()) m_face_neighbors_lcc[i] = std::make_pair(first + 6, m_lcc.template info<3>(m_lcc.dart_descriptor(*it)).volume_id + 6); @@ -710,8 +710,8 @@ private: std::size_t max_inside = 0, max_outside = 0; for (std::size_t i = 0; i < m_volumes.size(); i++) { - max_inside = (std::max)(static_cast(m_cost_matrix[0][i + 6]), max_inside); - max_outside = (std::max)(static_cast(m_cost_matrix[1][i + 6]), max_outside); + max_inside = (std::max)(m_cost_matrix[0][i + 6], max_inside); + max_outside = (std::max)(m_cost_matrix[1][i + 6], max_outside); } // Dump volumes colored by votes @@ -1123,7 +1123,7 @@ private: //write_face(cur_fdh, std::to_string(region) + "-inside-" + std::to_string(cur_fa) + ".ply"); - region_index[cur_fa] = static_cast(region); + region_index[cur_fa] = region; Dart_descriptor n = cur_fdh; std::vector f; @@ -1311,16 +1311,16 @@ private: std::size_t num_vertices = 0; - for (int i = 0; i < polygons.size(); i++) { + for (std::size_t i = 0; i < polygons.size(); i++) { num_vertices += polygons[i].size(); - for (int j = 0; j < polygons[i].size(); j++) { - vertices.push_back(cdt.insert(pl.to_2d(m_lcc.point(m_lcc.template dart_of_attribute<0>(polygons[i][j]))))); + for (std::size_t j = 0; j < polygons[i].size(); j++) { + vertices.push_back(cdt.insert(pl.to_2d(m_lcc.point(m_lcc.dart_of_attribute<0>(polygons[i][j]))))); auto it = va2vh.insert(std::make_pair(polygons[i][j], vertices.size() - 1)); CGAL_assertion(it.second); vertices.back()->info().i = i; vertices.back()->info().j = j; - vertices.back()->info().p = pl.to_2d(m_lcc.point(m_lcc.template dart_of_attribute<0>(polygons[i][j]))); + vertices.back()->info().p = pl.to_2d(m_lcc.point(m_lcc.dart_of_attribute<0>(polygons[i][j]))); vertices.back()->info().dh = polygons[i][j]; if (j >= 1) @@ -1417,6 +1417,8 @@ private: Face_attribute& fa = m_lcc.attribute<2>(dh); auto& finfo = m_lcc.info_of_attribute<2>(fa); + From_exact from_exact; + typename LCC::Dart_descriptor dh2 = m_lcc.beta<2>(dh); std::size_t idx = 1; @@ -1446,6 +1448,8 @@ private: void collect_border(typename LCC::Dart_descriptor dh, std::vector& processed, std::vector >& borders) { processed[dh] = true; + From_exact from_exact; + if (!m_labels[m_lcc.info<3>(dh).volume_id + 6] == 1) std::cout << "collect_border called on dart of outside volume, dh " << dh << " volume_id " << m_lcc.info<3>(dh).volume_id << std::endl; @@ -1515,6 +1519,7 @@ private: //borders contains Attribute<0> handles casted to std::size_t std::vector processed(m_lcc.number_of_darts(), false); + From_exact from_exact; borders_per_region.resize(region_index.size()); for (std::size_t i = 0;i::max)(), -(std::numeric_limits::max)(), -(std::numeric_limits::max)() }; for (const auto& p : m_points) { const auto& point = get(m_point_map, p); - for (int i = 0; i < 3; i++) { + for (std::size_t i = 0; i < 3; i++) { bbox_min[i] = (std::min)(point[i], bbox_min[i]); bbox_max[i] = (std::max)(point[i], bbox_max[i]); } @@ -2078,7 +2083,7 @@ private: // 3 ymax // 4 xmin // 5 zmax - const double force = static_cast(m_total_inliers * 3); + const std::size_t force = m_total_inliers * 3; // 0 - cost for labelled as outside cost_matrix[0][0] = 0; cost_matrix[0][1] = 0; @@ -2094,7 +2099,7 @@ private: cost_matrix[1][4] = 0; cost_matrix[1][5] = 0; - if (m_ground_polygon_index != static_cast(-1) && ground) { + if (m_ground_polygon_index != -1 && ground) { if (m_verbose) std::cout << "using estimated ground plane for reconstruction" << std::endl; cost_matrix[0][0] = force; diff --git a/Orthtree/include/CGAL/Orthtree_traits_polygons.h b/Orthtree/include/CGAL/Orthtree_traits_polygons.h index 50173058a4b..f97f0a35322 100644 --- a/Orthtree/include/CGAL/Orthtree_traits_polygons.h +++ b/Orthtree/include/CGAL/Orthtree_traits_polygons.h @@ -73,8 +73,8 @@ struct Orthtree_traits_polygons : public Orthtree_traits_3_base for (const std::pair &p : m_polygons) { const Node_data_element& poly = p.second; - for (int i = 0; i < poly.size(); i++) - for (int d = 0; d < Dimension::value; d++) { + for (std::size_t i = 0; i < poly.size(); i++) + for (std::size_t d = 0; d < Dimension::value; d++) { bbox_min[d] = (std::min)(bbox_min[d], poly[i][d]); bbox_max[d] = (std::max)(bbox_max[d], poly[i][d]); } @@ -106,13 +106,13 @@ struct Orthtree_traits_polygons : public Orthtree_traits_3_base Node_data_element lower, upper; const Node_data_element& poly = p.second; - FT last = poly.back()[static_cast(dimension)]; + FT last = poly.back()[dimension]; bool last_lower = (last <= mid); bool last_upper = (mid <= last); std::size_t last_index = poly.size() - 1; for (std::size_t i = 0; i < poly.size(); i++) { - FT d = poly[i][static_cast(dimension)]; + FT d = poly[i][dimension]; bool clower = d <= mid; bool cupper = mid <= d; diff --git a/Property_map/include/CGAL/Property_container.h b/Property_map/include/CGAL/Property_container.h index 06188c56749..c14e34adb4c 100644 --- a/Property_map/include/CGAL/Property_container.h +++ b/Property_map/include/CGAL/Property_container.h @@ -492,14 +492,14 @@ public: auto unused_end = unused_begin; // Determine if the group fits - if (std::distance(unused_begin, m_active_indices.end()) >= static_cast(n)) + if (std::distance(unused_begin, m_active_indices.end()) >= n) unused_end = std::find_if( unused_begin, (std::min)(unused_begin + n, m_active_indices.end()), [](bool used) { return used; } ); // If the discovered range was large enough - if (std::distance(unused_begin, unused_end) >= static_cast(n)) { + if (std::distance(unused_begin, unused_end) >= n) { // Mark the indices as used, and reset the properties of each of them // todo: it would be better to provide a function to set a range