diff --git a/code/Example/main.cpp b/code/Example/main.cpp index 82d20e55..135a772e 100644 --- a/code/Example/main.cpp +++ b/code/Example/main.cpp @@ -34,9 +34,9 @@ int main(int argc, char **argv) Logger::initialize(); // input point cloud file name - const std::string input_file = std::string(POLYFIT_CODE_DIR) + "/../data/toy_data.bvg"; + const std::string input_file = (argc > 1) ? argv[1] : std::string(POLYFIT_CODE_DIR) + "/../data/toy_data.bvg"; // output mesh file name - const std::string output_file = std::string(POLYFIT_CODE_DIR) + "/../data/toy_data-result.obj"; + const std::string output_file = (argc > 2) ? argv[2] : std::string(POLYFIT_CODE_DIR) + "/../data/toy_data-result.obj"; // below are the default parameters (change these when necessary) Method::lambda_data_fitting = 0.43; diff --git a/code/method/alpha_shape_CGAL4.10_and_earlier.h b/code/method/alpha_shape_CGAL4.10_and_earlier.h index 256fab08..013571dc 100644 --- a/code/method/alpha_shape_CGAL4.10_and_earlier.h +++ b/code/method/alpha_shape_CGAL4.10_and_earlier.h @@ -74,8 +74,8 @@ class Alpha_shape_2 : public Dt typedef typename internal::Alpha_nt_selector_2::Type_of_alpha Type_of_alpha; //check simplices are correctly instantiated - CGAL_static_assertion( (boost::is_same::value) ); - CGAL_static_assertion( (boost::is_same::value) ); + static_assert( (boost::is_same::value) ); + static_assert( (boost::is_same::value) ); typedef Type_of_alpha NT; typedef Type_of_alpha FT; @@ -851,7 +851,7 @@ Alpha_shape_2::initialize_interval_edge_map() { // both faces are infinite by definition unattached // the edge is finite by construction - CGAL_triangulation_precondition((is_infinite(pNeighbor) + CGAL_precondition((is_infinite(pNeighbor) && is_infinite(pFace))); interval = make_triple(squared_radius(pFace, i), Infinity, @@ -861,7 +861,7 @@ Alpha_shape_2::initialize_interval_edge_map() else { // is_infinite(pNeighbor) - CGAL_triangulation_precondition((is_infinite(pNeighbor) + CGAL_precondition((is_infinite(pNeighbor) && !is_infinite(pFace))); if (is_attached(pFace, i)) interval = make_triple(UNDEFINED, @@ -1111,7 +1111,7 @@ Alpha_shape_2::update_alpha_shape_vertex_list()const { // which might be infinity // write the vertex v = (*vertex_alpha_it).second; - CGAL_triangulation_assertion((classify(v) == REGULAR)); + CGAL_assertion((classify(v) == REGULAR)); Alpha_shape_vertices_list.push_back(v); } } @@ -1124,7 +1124,7 @@ Alpha_shape_2::update_alpha_shape_vertex_list()const { ++vertex_alpha_it) { v = (*vertex_alpha_it).second; - CGAL_triangulation_assertion((classify(v) == SINGULAR)); + CGAL_assertion((classify(v) == SINGULAR)); Alpha_shape_vertices_list.push_back(v); } @@ -1161,7 +1161,7 @@ Alpha_shape_2::update_alpha_shape_edges_list() const { pInterval = &(*edge_alpha_it).first; - CGAL_triangulation_assertion(pInterval->second != Infinity); + CGAL_assertion(pInterval->second != Infinity); // since this happens only for convex hull of dimension 2 // thus singular @@ -1173,7 +1173,7 @@ Alpha_shape_2::update_alpha_shape_edges_list() const // and alpha is smaller than the upper boundary // which might be infinity // visualize the boundary - CGAL_triangulation_assertion((classify((*edge_alpha_it).second.first, + CGAL_assertion((classify((*edge_alpha_it).second.first, (*edge_alpha_it).second.second) == REGULAR)); Alpha_shape_edges_list.push_back(Edge((*edge_alpha_it).second.first, @@ -1193,7 +1193,7 @@ Alpha_shape_2::update_alpha_shape_edges_list() const if (pInterval->first == UNDEFINED) { - CGAL_triangulation_assertion(pInterval->second != Infinity); + CGAL_assertion(pInterval->second != Infinity); // since this happens only for convex hull of dimension 2 // thus singular @@ -1205,7 +1205,7 @@ Alpha_shape_2::update_alpha_shape_edges_list() const // and alpha is smaller than the upper boundary // which might be infinity // visualize the boundary - CGAL_triangulation_assertion((classify((*edge_alpha_it).second.first, + CGAL_assertion((classify((*edge_alpha_it).second.first, (*edge_alpha_it).second.second) == REGULAR)); Alpha_shape_edges_list.push_back(Edge((*edge_alpha_it).second.first, @@ -1221,7 +1221,7 @@ Alpha_shape_2::update_alpha_shape_edges_list() const // if alpha is smaller than the upper boundary // which might be infinity // visualize the boundary - CGAL_triangulation_assertion(((classify((*edge_alpha_it).second.first, + CGAL_assertion(((classify((*edge_alpha_it).second.first, (*edge_alpha_it).second.second) == REGULAR) || (classify((*edge_alpha_it).second.first, @@ -1326,7 +1326,7 @@ Alpha_shape_2::number_of_solid_components(const Type_of_alpha& alpha) c ++face_it) { Face_handle pFace = face_it; - CGAL_triangulation_postcondition( pFace != NULL); + CGAL_postcondition( pFace != NULL); if (classify(pFace, alpha) == INTERIOR){ Data& data = marked_face_set[pFace]; @@ -1360,7 +1360,7 @@ Alpha_shape_2::traverse(const Face_handle& pFace, for (int i=0; i<3; i++) { pNeighbor = fh->neighbor(i); - CGAL_triangulation_assertion(pNeighbor != NULL); + CGAL_assertion(pNeighbor != NULL); if (classify(pNeighbor, alpha) == INTERIOR){ Data& data = marked_face_set[pNeighbor]; if(data == false){ @@ -1587,7 +1587,7 @@ Alpha_shape_2::op_ostream(std::ostream& os) const // write the vertex v = (*vertex_alpha_it).second; - CGAL_triangulation_assertion((classify(v) == + CGAL_assertion((classify(v) == Alpha_shape_2::REGULAR)); // if we used Edelsbrunner and Muecke's definition // regular means incident to a higher-dimensional face @@ -1610,7 +1610,7 @@ Alpha_shape_2::op_ostream(std::ostream& os) const pInterval = &(*edge_alpha_it).first; - CGAL_triangulation_assertion(pInterval->second != Infinity); + CGAL_assertion(pInterval->second != Infinity); // since this happens only for convex hull of dimension 1 // thus singular @@ -1638,10 +1638,10 @@ Alpha_shape_2::op_ostream(std::ostream& os) const f = pNeighbor; } - CGAL_triangulation_assertion((classify(f) == + CGAL_assertion((classify(f) == Alpha_shape_2::INTERIOR)); - CGAL_triangulation_assertion((classify(f, i) == + CGAL_assertion((classify(f, i) == Alpha_shape_2::REGULAR)); os << V[f->vertex(f->ccw(i))] << ' ' @@ -1673,7 +1673,7 @@ Alpha_shape_2::op_ostream(std::ostream& os) const // write the vertex v = (*vertex_alpha_it).second; - CGAL_triangulation_assertion((classify(v) == + CGAL_assertion((classify(v) == Alpha_shape_2::REGULAR)); V[v] = number_of_vertices++; os << v->point() << std::endl; @@ -1687,7 +1687,7 @@ Alpha_shape_2::op_ostream(std::ostream& os) const { v = (*vertex_alpha_it).second; - CGAL_triangulation_assertion((classify(v) == + CGAL_assertion((classify(v) == Alpha_shape_2::SINGULAR)); V[v] = number_of_vertices++; @@ -1734,7 +1734,7 @@ Alpha_shape_2::op_ostream(std::ostream& os) const pInterval->second <= get_alpha()) { - CGAL_triangulation_assertion((classify(f, i) == + CGAL_assertion((classify(f, i) == Alpha_shape_2::REGULAR)); // assure that all vertices are in ccw order if (classify(f) == Alpha_shape_2::EXTERIOR) @@ -1748,7 +1748,7 @@ Alpha_shape_2::op_ostream(std::ostream& os) const f = pNeighbor; } - CGAL_triangulation_assertion((classify(f) == + CGAL_assertion((classify(f) == Alpha_shape_2::INTERIOR)); os << V[f->vertex(f->ccw(i))] << ' ' @@ -1764,7 +1764,7 @@ Alpha_shape_2::op_ostream(std::ostream& os) const // write the singular edges if (pInterval->first != UNDEFINED) { - CGAL_triangulation_assertion((classify(f, i) == + CGAL_assertion((classify(f, i) == Alpha_shape_2::SINGULAR)); os << V[f->vertex(f->ccw(i))] << ' ' << V[f->vertex(f->cw(i))] << std::endl; @@ -1830,7 +1830,7 @@ Alpha_shape_2::Output () // which might be infinity // visualize the boundary - CGAL_triangulation_assertion((classify((*edge_alpha_it).second.first, + CGAL_assertion((classify((*edge_alpha_it).second.first, (*edge_alpha_it).second.second) == REGULAR)); @@ -1861,7 +1861,7 @@ Alpha_shape_2::Output () if (pInterval->first == UNDEFINED) { - CGAL_triangulation_assertion(pInterval->second != Infinity); + CGAL_assertion(pInterval->second != Infinity); // since this happens only for convex hull of dimension 1 // thus singular @@ -1874,7 +1874,7 @@ Alpha_shape_2::Output () // which might be infinity // visualize the boundary - CGAL_triangulation_assertion((classify((*edge_alpha_it).second.first, + CGAL_assertion((classify((*edge_alpha_it).second.first, (*edge_alpha_it).second.second) == REGULAR)); L.push_back((segment((*edge_alpha_it).second.first, @@ -1895,7 +1895,7 @@ Alpha_shape_2::Output () // which might be infinity // visualize the boundary - CGAL_triangulation_assertion(((classify((*edge_alpha_it).second.first, + CGAL_assertion(((classify((*edge_alpha_it).second.first, (*edge_alpha_it).second.second) == REGULAR) || (classify((*edge_alpha_it).second.first, diff --git a/code/method/alpha_shape_CGAL4.11_and_later.h b/code/method/alpha_shape_CGAL4.11_and_later.h index cb9f5726..550ae656 100644 --- a/code/method/alpha_shape_CGAL4.11_and_later.h +++ b/code/method/alpha_shape_CGAL4.11_and_later.h @@ -80,8 +80,8 @@ class Alpha_shape_2 : public Dt typedef Type_of_alpha FT; //check simplices are correctly instantiated - CGAL_static_assertion( (boost::is_same::value) ); - CGAL_static_assertion( (boost::is_same::value) ); + static_assert( (boost::is_same::value) ); + static_assert( (boost::is_same::value) ); typedef typename Dt::Point Point;