diff --git a/Surface_mesh_topology/include/CGAL/Path_on_surface.h b/Surface_mesh_topology/include/CGAL/Path_on_surface.h index 2d62b408a36..e7f4d0df433 100644 --- a/Surface_mesh_topology/include/CGAL/Path_on_surface.h +++ b/Surface_mesh_topology/include/CGAL/Path_on_surface.h @@ -135,20 +135,20 @@ public: { return get_ith_dart(i); } /// @return the dart before the ith dart of the path, - /// NULL if such a dart does not exist. + /// nullptr if such a dart does not exist. Dart_const_handle get_prev_dart(std::size_t i) const { CGAL_assertion(i& edge_label_to_dart) { - if (dart_same_label!=NULL && dart_opposite_label!=NULL) + if (dart_same_label!=nullptr && dart_opposite_label!=nullptr) { std::cerr<<"Polygonal_schema ERROR: "<<"both labels "<(prev_dart, res); } - if (dart_opposite_label!=NULL) + if (dart_opposite_label!=nullptr) { cmap.template link_beta<2>(res, dart_opposite_label); } return res; @@ -99,7 +99,7 @@ namespace Surface_mesh_topology { std::string get_label(CMap& cmap, Dart_handle dh) const { - CGAL_assertion(cmap.info(dh).m_label!=NULL); + CGAL_assertion(cmap.info(dh).m_label!=nullptr); return std::string(cmap.info(dh).m_label); } }; @@ -117,12 +117,12 @@ namespace Surface_mesh_topology { Dart_handle dart_opposite_label, std::unordered_map& edge_label_to_dart) { - if (dart_same_label!=NULL && dart_opposite_label!=NULL) + if (dart_same_label!=nullptr && dart_opposite_label!=nullptr) { std::cerr<<"Polygonal_schema ERROR: "<<"both labels "<(res, gmap.template alpha<0>(prev_dart)); } - if (dart_same_label!=NULL) - { // Here dart_same_label!=NULL + if (dart_same_label!=nullptr) + { // Here dart_same_label!=nullptr std::string s2=internal::opposite_label(s); edge_label_to_dart[s2]=dh2; gmap.info(dh2).m_label=new char[s2.size()+1]; @@ -142,12 +142,12 @@ namespace Surface_mesh_topology { gmap.template sew<2>(res, dart_same_label); } else - { // Here either dart_opposite_label!=NULL, or both are NULL + { // Here either dart_opposite_label!=nullptr, or both are nullptr edge_label_to_dart[s]=res; gmap.info(res).m_label=new char[s.size()+1]; strncpy(gmap.info(res).m_label, s.c_str(), s.size()+1); // +1 to copy also the \0 char - if (dart_opposite_label!=NULL) + if (dart_opposite_label!=nullptr) { std::string s2=internal::opposite_label(s); edge_label_to_dart[s2]=res; @@ -165,7 +165,7 @@ namespace Surface_mesh_topology { { char* label=gmap.info(dh).m_label; - if (label==NULL) + if (label==nullptr) { if (!gmap.is_free<2>(dh)) { label=gmap.info(gmap.template alpha<2>(dh)).m_label; } @@ -175,7 +175,7 @@ namespace Surface_mesh_topology { (std::string(gmap.info(gmap.template alpha<0>(dh)))); } } - CGAL_assertion(label!=NULL); + CGAL_assertion(label!=nullptr); return std::string(label); } }; @@ -206,10 +206,10 @@ namespace Surface_mesh_topology { { for (auto it=this->darts().begin(), itend=this->darts().end(); it!=itend; ++it) { - if (this->info(it).m_label!=NULL) + if (this->info(it).m_label!=nullptr) { delete []this->info(it).m_label; - this->info(it).m_label=NULL; + this->info(it).m_label=nullptr; } } } @@ -320,7 +320,7 @@ namespace Surface_mesh_topology { std::cerr<<"Polygonal_schema ERROR: " <<"you try to end a facet" <<" but the facet is not yet started."<null_handle && prev_dart!=this->null_handle ); this->set_next(prev_dart, first_dart); @@ -329,12 +329,12 @@ namespace Surface_mesh_topology { return first_dart; } - /// @return dart with the given label, NULL if this dart does not exist. + /// @return dart with the given label, nullptr if this dart does not exist. Dart_handle get_dart_labeled(const std::string & s) const { auto ite=edge_label_to_dart.find(s); if (ite==edge_label_to_dart.end()) - { return NULL; } + { return nullptr; } return ite->second; } diff --git a/Surface_mesh_topology/include/CGAL/Polygonal_schema_min_items.h b/Surface_mesh_topology/include/CGAL/Polygonal_schema_min_items.h index 157d4fb13b8..032480eaf08 100644 --- a/Surface_mesh_topology/include/CGAL/Polygonal_schema_min_items.h +++ b/Surface_mesh_topology/include/CGAL/Polygonal_schema_min_items.h @@ -45,7 +45,7 @@ namespace Surface_mesh_topology { { char* m_label; - Info_for_darts() : m_label(NULL) + Info_for_darts() : m_label(nullptr) {} }; diff --git a/Surface_mesh_topology/include/CGAL/Surface_mesh_topology/internal/Minimal_quadrangulation.h b/Surface_mesh_topology/include/CGAL/Surface_mesh_topology/internal/Minimal_quadrangulation.h index 7553f38713e..709309f2030 100644 --- a/Surface_mesh_topology/include/CGAL/Surface_mesh_topology/internal/Minimal_quadrangulation.h +++ b/Surface_mesh_topology/include/CGAL/Surface_mesh_topology/internal/Minimal_quadrangulation.h @@ -834,8 +834,8 @@ protected: if (m_map.is_dart_used(it) && m_map.is_marked(it, toremove)) { erase_edge_from_associative_arrays(it, origin_to_copy, copy_to_origin); - // TODO LATER (?) OPTIMIZE AND REPLACE THE REMOVE_CELL CALL BY THE MODIFICATION BY HAND - // OR DEVELOP A SPECIALIZED VERSION OF REMOVE_CELL + // TODO later (?) optimize and replace the remove_cell call by the modification by hand + // or develop a specialized version of remove_cell m_map.template remove_cell<1>(it); } } diff --git a/Surface_mesh_topology/include/CGAL/Surface_mesh_topology/internal/Path_on_surface_with_rle.h b/Surface_mesh_topology/include/CGAL/Surface_mesh_topology/internal/Path_on_surface_with_rle.h index 05f2e125d31..b6e7fcad8ca 100644 --- a/Surface_mesh_topology/include/CGAL/Surface_mesh_topology/internal/Path_on_surface_with_rle.h +++ b/Surface_mesh_topology/include/CGAL/Surface_mesh_topology/internal/Path_on_surface_with_rle.h @@ -88,7 +88,7 @@ public: typedef CFlat Flat; typedef std::list List_of_flats; typedef typename List_of_flats::iterator List_iterator; - // TODO typedef typename List_of_dart_length::const_iterator List_const_iterator; + // TODO? typedef typename List_of_dart_length::const_iterator List_const_iterator; struct List_iterator_hash { @@ -153,9 +153,6 @@ public: if (apath.is_closed()) { - /// Tempo pour debug - // i=get_default_random().get_int(0, apath.length()); - /// END Tempo pour debug if (!use_only_negative && apath.next_positive_turn(i)==2) { positive_flat=true; negative_flat=false; } else if (!use_only_positive && apath.next_negative_turn(i)==2) @@ -327,10 +324,10 @@ public: if (is_empty()) { return !is_closed(); } // an empty past is not closed unsigned int nbdarts=0,i=0; - Dart_const_handle prev=(is_closed()?back():NULL); // Last dart of the path + Dart_const_handle prev=(is_closed()?back():nullptr); // Last dart of the path for (auto it=m_path.begin(); it!=m_path.end(); ++it) { - if (prev!=NULL && !m_map.template belong_to_same_cell<0> + if (prev!=nullptr && !m_map.template belong_to_same_cell<0> (m_map.template beta<1>(prev), begin_of_flat(it))) { std::cerr<<"ERROR: The path is not valid: flat in position "<(*this).display_pos_and_neg_turns(); std::cout<(dh1)), - get_dart_id(dh2)); - // std::cout<<"toto1="< pbefore(*this); - List_iterator it2=next_iterator(it); set_flat_length(it, flat_length(it)+flat_length(it2)+ (positive2?1:-1)); @@ -983,9 +910,6 @@ public: if (modified_flats.count(it2)==1) modified_flats.erase(it2); - //Path_on_surface pafter(*this); - //CGAL_assertion(pbefore==pafter); - // CGAL_assertion(is_flat_valid(it)); return true; } @@ -1030,31 +954,15 @@ public: CGAL_assertion(is_spur(it)); Set_of_it modified_flats; - - //std::cout<<"*********************************** "; - /* static int TOTO=0; - std::cout<<"remove_spur "<(*this).display_pos_and_neg_turns(); std::cout<0); @@ -1439,13 +1347,6 @@ public: // CGAL_assertion(is_valid()); Set_of_it modified_flats; - /* static int TOTO=0; - std::cout<<"right_push_l_shape "< pbefore(*this); - if (m_path.size()==1) { if (next_negative_turn(it1)==2) @@ -1486,7 +1387,7 @@ public: else { // Here we have only one flat, with some -2 - // Is this case possible ?? + // This case is not supposed possible. CGAL_assertion(false); return; } @@ -1514,9 +1415,6 @@ public: flat_modified(it2, modified_flats); } - //Path_on_surface pafter(*this); - //CGAL_assertion(pbefore==pafter); - // CGAL_assertion(is_valid(false)); // CGAL_assertion(is_l_shape(it1)); @@ -1572,8 +1470,7 @@ public: set_begin_of_flat(it1, dh1); set_end_of_flat(it1, dh1); set_begin_of_flat(it2, dh2); - set_end_of_flat(it2, dh6); // TODO WHY THIS DOES NOT WORK ???? - //set_end_of_flat(it2, m_map.template beta<1, 2, 1>(dh3)); // TODO VERY STRANGE + set_end_of_flat(it2, dh6); set_flat_length(it2, -flat_length(it1)); set_flat_length(it1, 0); @@ -1588,13 +1485,6 @@ public: } // General case, with two flats with non zero length - -/* List_iterator it_insert1=m_path.insert(it, std::make_pair - (first_dart_toinsert, 0)); - List_iterator it_insert2=m_path.insert(next_iterator(it3), - std::make_pair - (second_dart_toinsert, 0)); */ - if (next_iterator(it2)!=it1 || next_negative_turn(it2)!=3) { // 1) Add the first dart before flat 'it' @@ -1734,7 +1624,9 @@ public: protected: const typename Get_map::storage_type m_map; // The underlying map - List_of_flats m_path; // The sequence of flats (a flat part is a pair of darts with positive or negative turn == 2). If negative value k, -k is the length of the flat part, for negative turns (-2). + List_of_flats m_path; // The sequence of flats (a flat part is a pair of darts + // with positive or negative turn == 2). If negative value k, -k is the + // length of the flat part, for negative turns (-2). bool m_is_closed; // True iff the path is a cycle std::size_t m_length; bool m_use_only_positive; diff --git a/Surface_mesh_topology/include/CGAL/draw_face_graph_with_paths.h b/Surface_mesh_topology/include/CGAL/draw_face_graph_with_paths.h index 966ed8a023d..731d6f3be30 100644 --- a/Surface_mesh_topology/include/CGAL/draw_face_graph_with_paths.h +++ b/Surface_mesh_topology/include/CGAL/draw_face_graph_with_paths.h @@ -102,7 +102,7 @@ public: /// usefull for very big object where this time could be long) Face_graph_with_path_viewer(QWidget* parent, const Mesh& amesh, - const std::vector >* paths=NULL, + const std::vector >* paths=nullptr, std::size_t amark=LCC::INVALID_MARK, const char* title="", bool anofaces=false, const DrawingFunctorLCC& drawing_functor=DrawingFunctorLCC()) :