diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 1ed109f66d6..90ae1832604 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -9,6 +9,6 @@ _Describe what your pull request changes to CGAL (this can be skipped if it solv * Affected package(s): * Issue(s) solved (if any): fix #0000, fix #0000,... * Feature/Small Feature (if any): -* Link to compiled documentation (obligatory for small feature) [link](https://mydoc/Manual/Pkg) +* Link to compiled documentation (obligatory for small feature) [*wrong link name to be changed*](httpssss://wrong_URL_to_be_changed/Manual/Pkg) * License and copyright ownership: diff --git a/AABB_tree/doc/AABB_tree/PackageDescription.txt b/AABB_tree/doc/AABB_tree/PackageDescription.txt index eebd2bd7a0b..c70c2ab611a 100644 --- a/AABB_tree/doc/AABB_tree/PackageDescription.txt +++ b/AABB_tree/doc/AABB_tree/PackageDescription.txt @@ -36,6 +36,6 @@ - `CGAL::AABB_triangle_primitive` - `CGAL::AABB_segment_primitive` - `CGAL::AABB_primitive` -- `CGAL::AABB_halfedge_graph_segment_primitive` -- `CGAL::AABB_face_graph_triangle_primitive` +- `CGAL::AABB_halfedge_graph_segment_primitive` +- `CGAL::AABB_face_graph_triangle_primitive` */ diff --git a/AABB_tree/include/CGAL/AABB_traits.h b/AABB_tree/include/CGAL/AABB_traits.h index 92c42070c4c..027d50fde91 100644 --- a/AABB_tree/include/CGAL/AABB_traits.h +++ b/AABB_tree/include/CGAL/AABB_traits.h @@ -149,6 +149,7 @@ struct AABB_traits_base_2{ template< typename AABBTraits> class AABB_tree; + /// This traits class handles any type of 3D geometric /// primitives provided that the proper intersection tests and /// constructions are implemented. It handles points, rays, lines and @@ -325,7 +326,9 @@ public: Compute_bbox compute_bbox_object() const {return Compute_bbox(*this);} - + /// \brief Function object using `GeomTraits::Do_intersect`. + /// In the case the query is a `CGAL::AABB_tree`, the `do_intersect()` + /// function of this tree is used. class Do_intersect { const AABB_traits& m_traits; public: @@ -360,6 +363,7 @@ public: Do_intersect do_intersect_object() const {return Do_intersect(*this);} + class Intersection { const AABB_traits& m_traits; public: diff --git a/AABB_tree/include/CGAL/AABB_tree.h b/AABB_tree/include/CGAL/AABB_tree.h index b57f0260a05..9a05e1068a4 100644 --- a/AABB_tree/include/CGAL/AABB_tree.h +++ b/AABB_tree/include/CGAL/AABB_tree.h @@ -487,7 +487,7 @@ public: if( size() > 1 ) { delete [] m_p_root_node; } - m_p_root_node = NULL; + m_p_root_node = nullptr; } // clears internal KD tree @@ -495,9 +495,9 @@ public: { if ( m_search_tree_constructed ) { - CGAL_assertion( m_p_search_tree!=NULL ); + CGAL_assertion( m_p_search_tree!=nullptr ); delete m_p_search_tree; - m_p_search_tree = NULL; + m_p_search_tree = nullptr; m_search_tree_constructed = false; } } @@ -607,8 +607,8 @@ public: AABB_tree::AABB_tree(const Tr& traits) : m_traits(traits) , m_primitives() - , m_p_root_node(NULL) - , m_p_search_tree(NULL) + , m_p_root_node(nullptr) + , m_p_search_tree(nullptr) , m_search_tree_constructed(false) , m_default_search_tree_constructed(false) , m_need_build(false) @@ -621,8 +621,8 @@ public: T&& ... t) : m_traits() , m_primitives() - , m_p_root_node(NULL) - , m_p_search_tree(NULL) + , m_p_root_node(nullptr) + , m_p_search_tree(nullptr) , m_search_tree_constructed(false) , m_default_search_tree_constructed(false) , m_need_build(false) @@ -687,10 +687,10 @@ public: // allocates tree nodes m_p_root_node = new Node[m_primitives.size()-1](); - if(m_p_root_node == NULL) + if(m_p_root_node == nullptr) { std::cerr << "Unable to allocate memory for AABB tree" << std::endl; - CGAL_assertion(m_p_root_node != NULL); + CGAL_assertion(m_p_root_node != nullptr); m_primitives.clear(); clear(); } @@ -738,7 +738,7 @@ public: { m_p_search_tree = new Search_tree(first, beyond); m_default_search_tree_constructed = true; - if(m_p_search_tree != NULL) + if(m_p_search_tree != nullptr) { m_search_tree_constructed = true; return true; diff --git a/AABB_tree/include/CGAL/internal/AABB_tree/AABB_node.h b/AABB_tree/include/CGAL/internal/AABB_tree/AABB_node.h index 5d0cf5ce4d2..c8f85e6505a 100644 --- a/AABB_tree/include/CGAL/internal/AABB_tree/AABB_node.h +++ b/AABB_tree/include/CGAL/internal/AABB_tree/AABB_node.h @@ -47,8 +47,8 @@ public: /// Constructor AABB_node() : m_bbox() - , m_p_left_child(NULL) - , m_p_right_child(NULL) { }; + , m_p_left_child(nullptr) + , m_p_right_child(nullptr) { }; /// Non virtual Destructor /// Do not delete children because the tree hosts and delete them diff --git a/AABB_tree/include/CGAL/internal/AABB_tree/AABB_search_tree.h b/AABB_tree/include/CGAL/internal/AABB_tree/AABB_search_tree.h index 214a8d2644a..09e9ec8a058 100644 --- a/AABB_tree/include/CGAL/internal/AABB_tree/AABB_search_tree.h +++ b/AABB_tree/include/CGAL/internal/AABB_tree/AABB_search_tree.h @@ -107,7 +107,7 @@ namespace CGAL public: template AABB_search_tree(ConstPointIterator begin, ConstPointIterator beyond) - : m_p_tree(NULL) + : m_p_tree(nullptr) { typedef typename Add_decorated_point::Point_3 Decorated_point; std::vector points; @@ -117,7 +117,7 @@ namespace CGAL ++begin; } m_p_tree = new Tree(points.begin(), points.end()); - if(m_p_tree != NULL) + if(m_p_tree != nullptr) m_p_tree->build(); else std::cerr << "unable to build the search tree!" << std::endl; diff --git a/AABB_tree/include/CGAL/internal/AABB_tree/Has_nested_type_Shared_data.h b/AABB_tree/include/CGAL/internal/AABB_tree/Has_nested_type_Shared_data.h index 0c4641b64d8..1096d248244 100644 --- a/AABB_tree/include/CGAL/internal/AABB_tree/Has_nested_type_Shared_data.h +++ b/AABB_tree/include/CGAL/internal/AABB_tree/Has_nested_type_Shared_data.h @@ -66,13 +66,13 @@ struct Cstr_shared_data static Shared_data construct_shared_data(Graph&, VertexPmap) { - return NULL; + return nullptr; } }; diff --git a/AABB_tree/test/AABB_tree/aabb_test_all_intersected_primitives_tree.cpp b/AABB_tree/test/AABB_tree/aabb_test_all_intersected_primitives_tree.cpp new file mode 100644 index 00000000000..14229091af2 --- /dev/null +++ b/AABB_tree/test/AABB_tree/aabb_test_all_intersected_primitives_tree.cpp @@ -0,0 +1,79 @@ +#include +#include + +#include + +#include + +#include +#include +#include +#include +#include +#include + +typedef CGAL::Epick K; +typedef K::FT FT; +typedef K::Point_3 Point; +typedef K::Vector_3 Vector; +typedef K::Segment_3 Segment; +typedef K::Ray_3 Ray; +typedef CGAL::Surface_mesh > Mesh; +typedef CGAL::AABB_halfedge_graph_segment_primitive S_Primitive; +typedef CGAL::AABB_face_graph_triangle_primitive T_Primitive; +typedef CGAL::AABB_traits T_Traits; +typedef CGAL::AABB_traits S_Traits; +typedef CGAL::AABB_tree T_Tree; +typedef CGAL::AABB_tree S_Tree; +typedef T_Tree::Primitive_id T_Primitive_id; +typedef S_Tree::Primitive_id S_Primitive_id; + +int main() +{ + CGAL::Surface_mesh > m1, m2; + std::ifstream in("data/cube.off"); + if(in) + in >> m1; + else{ + std::cout << "error reading cube" << std::endl; + return 1; + } + in.close(); + in.open("data/tetrahedron.off"); + if(in) + in >> m2; + else{ + std::cout << "error reading tetrahedron" << std::endl; + return 1; + } + in.close(); + T_Tree cube_tree(faces(m1).first, faces(m1).second, m1); + S_Tree tet_tree(edges(m2).first, edges(m2).second, m2); + cube_tree.build(); + tet_tree.build(); + + std::list t_primitives; + std::list s_primitives; + cube_tree.all_intersected_primitives(tet_tree,std::back_inserter(t_primitives)); + CGAL_assertion(t_primitives.size() == 6); + tet_tree.all_intersected_primitives(cube_tree,std::back_inserter(s_primitives)); + CGAL_assertion(s_primitives.size() == 6); + CGAL_assertion(tet_tree.do_intersect(cube_tree)); + CGAL_assertion(cube_tree.do_intersect(tet_tree)); + + std::vector all_primitives; + cube_tree.all_intersected_primitives(tet_tree, std::back_inserter(all_primitives)); + bool found_f5 = false; + for(auto prim : all_primitives) + { + if((int)prim.first == 5) + found_f5 = true; + } + CGAL_assertion(found_f5); + CGAL_USE(found_f5); + return 0; +} diff --git a/Advancing_front_surface_reconstruction/include/CGAL/Advancing_front_surface_reconstruction.h b/Advancing_front_surface_reconstruction/include/CGAL/Advancing_front_surface_reconstruction.h index 926c95c41b1..aec4398cdfd 100644 --- a/Advancing_front_surface_reconstruction/include/CGAL/Advancing_front_surface_reconstruction.h +++ b/Advancing_front_surface_reconstruction/include/CGAL/Advancing_front_surface_reconstruction.h @@ -88,7 +88,7 @@ namespace CGAL { } Advancing_front_surface_reconstruction_boundary_iterator(const Surface& S_) - : S(S_), pos(NULL) + : S(S_), pos(nullptr) {} Advancing_front_surface_reconstruction_boundary_iterator(const Self& s) @@ -108,7 +108,7 @@ namespace CGAL { Self operator++() { - if(pos == NULL) { + if(pos == nullptr) { return *this; } if(first){ @@ -134,7 +134,7 @@ namespace CGAL { void advance_on_boundary() { - if(pos == NULL) { + if(pos == nullptr) { return; } pos = pos->first_incident()->first; @@ -143,7 +143,7 @@ namespace CGAL { void advance_to_next_boundary() { - if(pos == NULL) { + if(pos == nullptr) { return; } do { @@ -157,7 +157,7 @@ namespace CGAL { CGAL_assertion(pos->is_on_border()); } else { - pos = NULL; + pos = nullptr; } } }; @@ -400,18 +400,18 @@ namespace CGAL { Intern_successors_type* ret = &ist_pool.back(); - ret->first->first = NULL; - ret->second->first = NULL; + ret->first->first = nullptr; + ret->second->first = nullptr; return ret; } inline bool is_on_border(Vertex_handle vh, const int& i) const { - if (vh->m_incident_border == NULL) return false; //vh is interior - if (vh->m_incident_border->first->first != NULL) + if (vh->m_incident_border == nullptr) return false; //vh is interior + if (vh->m_incident_border->first->first != nullptr) { - if (vh->m_incident_border->second->first != NULL) + if (vh->m_incident_border->second->first != nullptr) return ((vh->m_incident_border->first->second.second == i)|| (vh->m_incident_border->second->second.second == i)); return (vh->m_incident_border->first->second.second == i); @@ -422,28 +422,28 @@ namespace CGAL { void remove_border_edge(Vertex_handle w, Vertex_handle v) { - if (w->m_incident_border != NULL) + if (w->m_incident_border != nullptr) { if (w->m_incident_border->second->first == v) { - w->m_incident_border->second->first = NULL; + w->m_incident_border->second->first = nullptr; set_interior_edge(w,v); return; } if (w->m_incident_border->first->first == v) { - if (w->m_incident_border->second->first != NULL) + if (w->m_incident_border->second->first != nullptr) { Next_border_elt* tmp = w->m_incident_border->first; w->m_incident_border->first = w->m_incident_border->second; w->m_incident_border->second = tmp; - w->m_incident_border->second->first = NULL; + w->m_incident_border->second->first = nullptr; set_interior_edge(w,v); return; } else { - w->m_incident_border->first->first = NULL; + w->m_incident_border->first->first = nullptr; set_interior_edge(w,v); return; } @@ -571,7 +571,7 @@ namespace CGAL { void re_init(Vertex_handle w) { - if (w->m_incident_border != NULL) + if (w->m_incident_border != nullptr) { w->delete_border(); } @@ -629,7 +629,7 @@ namespace CGAL { void clear_vertex(Vertex_handle w) { - if (w->m_incident_border != NULL) + if (w->m_incident_border != nullptr) { w->delete_border(); } @@ -956,14 +956,14 @@ namespace CGAL { bool is_border_elt(Edge_like& key, Border_elt& result) const { Next_border_elt* it12 = border_elt(key.first, key.second); - if (it12 != NULL) + if (it12 != nullptr) { result = it12->second; return true; } Next_border_elt* it21 = border_elt(key.second, key.first); - if (it21 != NULL) + if (it21 != nullptr) { result = it21->second; std::swap(key.first, key.second); @@ -975,13 +975,13 @@ namespace CGAL { //--------------------------------------------------------------------- bool is_border_elt(Edge_like& key) const { Next_border_elt* it12 = border_elt(key.first, key.second); - if (it12 != NULL) + if (it12 != nullptr) { return true; } Next_border_elt* it21 = border_elt(key.second, key.first); - if (it21 != NULL) + if (it21 != nullptr) { std::swap(key.first, key.second); return true; @@ -993,7 +993,7 @@ namespace CGAL { bool is_ordered_border_elt(const Edge_like& key, Border_elt& result) const { Next_border_elt* it12 = border_elt(key.first, key.second); - if (it12 != NULL) + if (it12 != nullptr) { result = it12->second; return true; @@ -1015,7 +1015,7 @@ namespace CGAL { Vertex_handle v1 = e.first; Next_border_elt* it12 = border_elt(v1, e.second); - if (it12 != NULL) + if (it12 != nullptr) { ptr = &it12->second.first.second; return true; @@ -1047,7 +1047,7 @@ namespace CGAL { coord_type lazy_squared_radius(const Cell_handle& c) { - if (c->lazy_squared_radius() != NULL) + if (c->lazy_squared_radius() != nullptr) return *(c->lazy_squared_radius()); c->set_lazy_squared_radius @@ -1060,7 +1060,7 @@ namespace CGAL { Point lazy_circumcenter(const Cell_handle& c) { - if (c->lazy_circumcenter() != NULL) + if (c->lazy_circumcenter() != nullptr) return *(c->lazy_circumcenter()); c->set_lazy_circumcenter diff --git a/Advancing_front_surface_reconstruction/include/CGAL/Advancing_front_surface_reconstruction_cell_base_3.h b/Advancing_front_surface_reconstruction/include/CGAL/Advancing_front_surface_reconstruction_cell_base_3.h index eac9e519d77..1422a55e0fc 100644 --- a/Advancing_front_surface_reconstruction/include/CGAL/Advancing_front_surface_reconstruction_cell_base_3.h +++ b/Advancing_front_surface_reconstruction/include/CGAL/Advancing_front_surface_reconstruction_cell_base_3.h @@ -75,9 +75,9 @@ namespace CGAL { Advancing_front_surface_reconstruction_cell_base_3() : Cb(), - _smallest_radius_facet_tab(NULL), selected_facet(0) + _smallest_radius_facet_tab(nullptr), selected_facet(0) #ifdef AFSR_LAZY - , _circumcenter(NULL), _squared_radius(NULL) + , _circumcenter(nullptr), _squared_radius(nullptr) #endif { #ifdef AFSR_FACET_NUMBER @@ -89,9 +89,9 @@ namespace CGAL { Advancing_front_surface_reconstruction_cell_base_3(Vertex_handle v0, Vertex_handle v1, Vertex_handle v2, Vertex_handle v3) : Cb( v0, v1, v2, v3), - _smallest_radius_facet_tab(NULL), selected_facet(0) + _smallest_radius_facet_tab(nullptr), selected_facet(0) #ifdef AFSR_LAZY - , _circumcenter(NULL), _squared_radius(NULL) + , _circumcenter(nullptr), _squared_radius(nullptr) #endif { #ifdef FACET_NUMBER @@ -105,9 +105,9 @@ namespace CGAL { Cell_handle n0, Cell_handle n1, Cell_handle n2, Cell_handle n3) : Cb(v0, v1, v2, v3, n0, n1, n2, n3), - _smallest_radius_facet_tab(NULL), selected_facet(0) + _smallest_radius_facet_tab(nullptr), selected_facet(0) #ifdef AFSR_LAZY - , _circumcenter(NULL), _squared_radius(NULL) + , _circumcenter(nullptr), _squared_radius(nullptr) #endif { #ifdef AFSR_FACET_NUMBER @@ -121,12 +121,12 @@ namespace CGAL { inline ~Advancing_front_surface_reconstruction_cell_base_3() { - if (_smallest_radius_facet_tab != NULL) + if (_smallest_radius_facet_tab != nullptr) delete[] _smallest_radius_facet_tab; #ifdef AFSR_LAZY - if (_circumcenter != NULL) + if (_circumcenter != nullptr) delete _circumcenter; - if (_squared_radius != NULL) + if (_squared_radius != nullptr) delete _squared_radius; #endif } @@ -136,31 +136,31 @@ namespace CGAL { inline void clear() { - if (_smallest_radius_facet_tab != NULL) + if (_smallest_radius_facet_tab != nullptr) delete[] _smallest_radius_facet_tab; - _smallest_radius_facet_tab = NULL; + _smallest_radius_facet_tab = nullptr; selected_facet = 0; #ifdef AFSR_LAZY - if (_circumcenter != NULL) + if (_circumcenter != nullptr) delete _circumcenter; - _circumcenter = NULL; - if (_squared_radius != NULL) + _circumcenter = nullptr; + if (_squared_radius != nullptr) delete _squared_radius; - _squared_radius = NULL; + _squared_radius = nullptr; #endif } //------------------------------------------------------------------- inline coord_type smallest_radius(const int& i) { - if (_smallest_radius_facet_tab == NULL) + if (_smallest_radius_facet_tab == nullptr) return -1; return _smallest_radius_facet_tab[i]; } inline void set_smallest_radius(const int& i, const coord_type& c) { - if (_smallest_radius_facet_tab == NULL) + if (_smallest_radius_facet_tab == nullptr) { _smallest_radius_facet_tab = new coord_type[4]; for(int i = 0; i < 4; i++) @@ -172,7 +172,7 @@ namespace CGAL { // pour un controle de l'allocation memoire... utile??? inline bool alloc_smallest_radius_tab(coord_type* ptr) { - if (_smallest_radius_facet_tab==NULL) + if (_smallest_radius_facet_tab==nullptr) { _smallest_radius_facet_tab = ptr; return true; diff --git a/Advancing_front_surface_reconstruction/include/CGAL/Advancing_front_surface_reconstruction_vertex_base_3.h b/Advancing_front_surface_reconstruction/include/CGAL/Advancing_front_surface_reconstruction_vertex_base_3.h index 050e14036fd..2a1f05a69e2 100644 --- a/Advancing_front_surface_reconstruction/include/CGAL/Advancing_front_surface_reconstruction_vertex_base_3.h +++ b/Advancing_front_surface_reconstruction/include/CGAL/Advancing_front_surface_reconstruction_vertex_base_3.h @@ -174,20 +174,20 @@ namespace CGAL { void delete_border() { - m_incident_border = NULL; + m_incident_border = nullptr; } inline Next_border_elt* next_on_border(const int& i) const { - if (m_incident_border == NULL) return NULL; //vh is interior - if (m_incident_border->first->first != NULL) + if (m_incident_border == nullptr) return nullptr; //vh is interior + if (m_incident_border->first->first != nullptr) if (m_incident_border->first->second.second == i) return m_incident_border->first; - if (m_incident_border->second->first != NULL) + if (m_incident_border->second->first != nullptr) if (m_incident_border->second->second.second == i) return m_incident_border->second; - return NULL; + return nullptr; } @@ -195,40 +195,40 @@ namespace CGAL { inline bool is_border_edge(Vertex_handle v) const { - if (m_incident_border == NULL) return false; + if (m_incident_border == nullptr) return false; return ((m_incident_border->first->first == v)|| (m_incident_border->second->first == v)); } inline Next_border_elt* border_elt(Vertex_handle v) const { - if (m_incident_border == NULL) return NULL; + if (m_incident_border == nullptr) return nullptr; if (m_incident_border->first->first == v) return m_incident_border->first; if (m_incident_border->second->first == v) return m_incident_border->second; - return NULL; + return nullptr; } public: inline Next_border_elt* first_incident() const { - if (m_incident_border == NULL) return NULL; + if (m_incident_border == nullptr) return nullptr; return m_incident_border->first; } private: inline Next_border_elt* second_incident() const { - if (m_incident_border == NULL) return NULL; + if (m_incident_border == nullptr) return nullptr; return m_incident_border->second; } inline void set_next_border_elt(const Next_border_elt& elt) { - if (m_incident_border->first->first == NULL) + if (m_incident_border->first->first == nullptr) *m_incident_border->first = elt; else { - if (m_incident_border->second->first != NULL) + if (m_incident_border->second->first != nullptr) std::cerr << "+++probleme de MAJ du bord " << std::endl; *m_incident_border->second = elt; } diff --git a/Algebraic_foundations/include/CGAL/Test/_test_algebraic_structure.h b/Algebraic_foundations/include/CGAL/Test/_test_algebraic_structure.h index 1a7649fe88f..f0d48f20bca 100644 --- a/Algebraic_foundations/include/CGAL/Test/_test_algebraic_structure.h +++ b/Algebraic_foundations/include/CGAL/Test/_test_algebraic_structure.h @@ -417,7 +417,7 @@ void test_algebraic_structure_intern( assert( a != AS (0)); assert( b != AS (0)); assert( c != AS (0)); - // AS (0) == NULL of IntegralDomain + // AS (0) == nullptr of IntegralDomain assert(a* AS (0)== AS (0)); assert(a+ AS (0)==a); assert(b* AS (0)== AS (0)); diff --git a/Alpha_shapes_2/include/CGAL/Alpha_shape_2.h b/Alpha_shapes_2/include/CGAL/Alpha_shape_2.h index d465a331f13..26299bad3d1 100644 --- a/Alpha_shapes_2/include/CGAL/Alpha_shape_2.h +++ b/Alpha_shapes_2/include/CGAL/Alpha_shape_2.h @@ -1333,7 +1333,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_triangulation_postcondition( pFace != nullptr); if (classify(pFace, alpha) == INTERIOR){ Data& data = marked_face_set[pFace]; @@ -1367,7 +1367,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_triangulation_assertion(pNeighbor != nullptr); if (classify(pNeighbor, alpha) == INTERIOR){ Data& data = marked_face_set[pNeighbor]; if(data == false){ diff --git a/Alpha_shapes_2/include/CGAL/internal/Lazy_alpha_nt_2.h b/Alpha_shapes_2/include/CGAL/internal/Lazy_alpha_nt_2.h index eb2aabbf0d6..a00fc3d1197 100644 --- a/Alpha_shapes_2/include/CGAL/internal/Lazy_alpha_nt_2.h +++ b/Alpha_shapes_2/include/CGAL/internal/Lazy_alpha_nt_2.h @@ -260,26 +260,26 @@ public: : exact_(Exact_nt(0)), approx_(0) { data().nbpts=0; - data().p0=NULL; - data().p1=NULL; - data().p2=NULL; + data().p0=nullptr; + data().p1=nullptr; + data().p2=nullptr; } Lazy_alpha_nt_2(double d) : exact_(Exact_nt(d)), approx_(d) { data().nbpts=0; - data().p0=NULL; - data().p1=NULL; - data().p2=NULL; + data().p0=nullptr; + data().p1=nullptr; + data().p2=nullptr; } Lazy_alpha_nt_2(const Input_point& wp0) { data().nbpts=1; data().p0=&wp0; - data().p1=NULL; - data().p2=NULL; + data().p1=nullptr; + data().p2=nullptr; set_approx(); } @@ -289,7 +289,7 @@ public: data().nbpts=2; data().p0=&wp0; data().p1=&wp1; - data().p2=NULL; + data().p2=nullptr; set_approx(); } diff --git a/Alpha_shapes_3/include/CGAL/Alpha_shape_3.h b/Alpha_shapes_3/include/CGAL/Alpha_shape_3.h index a2d5dc0df3d..0a5aff40030 100644 --- a/Alpha_shapes_3/include/CGAL/Alpha_shape_3.h +++ b/Alpha_shapes_3/include/CGAL/Alpha_shape_3.h @@ -1731,7 +1731,7 @@ Alpha_shape_3::number_of_solid_components(const NT& alpha) const for( cell_it = finite_cells_begin(); cell_it != done; ++cell_it) { Cell_handle pCell = cell_it; - CGAL_triangulation_assertion(pCell != NULL); + CGAL_triangulation_assertion(pCell != nullptr); if (classify(pCell, alpha) == INTERIOR){ Data& data = marked_cell_set[pCell]; @@ -1763,7 +1763,7 @@ void Alpha_shape_3::traverse(Cell_handle pCell, for (int i=0; i<=3; i++) { pNeighbor = pCell->neighbor(i); - CGAL_triangulation_assertion(pNeighbor != NULL); + CGAL_triangulation_assertion(pNeighbor != nullptr); if (classify(pNeighbor, alpha) == INTERIOR){ Data& data = marked_cell_set[pNeighbor]; if(data == false){ diff --git a/Alpha_shapes_3/include/CGAL/internal/Lazy_alpha_nt_3.h b/Alpha_shapes_3/include/CGAL/internal/Lazy_alpha_nt_3.h index 3a0ffedc88e..33bfa44384d 100644 --- a/Alpha_shapes_3/include/CGAL/internal/Lazy_alpha_nt_3.h +++ b/Alpha_shapes_3/include/CGAL/internal/Lazy_alpha_nt_3.h @@ -253,29 +253,29 @@ public: : exact_(Exact_nt(0)),approx_(0) { data().nbpts=0; - data().p0=NULL; - data().p1=NULL; - data().p2=NULL; - data().p3=NULL; + data().p0=nullptr; + data().p1=nullptr; + data().p2=nullptr; + data().p3=nullptr; } Lazy_alpha_nt_3(double d) : exact_(Exact_nt(d)),approx_(d) { data().nbpts=0; - data().p0=NULL; - data().p1=NULL; - data().p2=NULL; - data().p3=NULL; + data().p0=nullptr; + data().p1=nullptr; + data().p2=nullptr; + data().p3=nullptr; } Lazy_alpha_nt_3(const Input_point& wp1) { data().nbpts=1; data().p0=&wp1; - data().p1=NULL; - data().p2=NULL; - data().p3=NULL; + data().p1=nullptr; + data().p2=nullptr; + data().p3=nullptr; set_approx(); } @@ -285,8 +285,8 @@ public: data().nbpts=2; data().p0=&wp1; data().p1=&wp2; - data().p2=NULL; - data().p3=NULL; + data().p2=nullptr; + data().p3=nullptr; set_approx(); } @@ -298,7 +298,7 @@ public: data().p0=&wp1; data().p1=&wp2; data().p2=&wp3; - data().p3=NULL; + data().p3=nullptr; set_approx(); } diff --git a/Apollonius_graph_2/doc/Apollonius_graph_2/CGAL/Apollonius_graph_2.h b/Apollonius_graph_2/doc/Apollonius_graph_2/CGAL/Apollonius_graph_2.h index 6716e9095da..91df4a31e7c 100644 --- a/Apollonius_graph_2/doc/Apollonius_graph_2/CGAL/Apollonius_graph_2.h +++ b/Apollonius_graph_2/doc/Apollonius_graph_2/CGAL/Apollonius_graph_2.h @@ -542,7 +542,7 @@ unsigned int insert(Input_iterator first, Input_iterator beyond); Inserts the site `s` in the Apollonius graph. If `s` is visible then the vertex handle of `s` is returned, otherwise -`Vertex_handle(NULL)` is returned. +`Vertex_handle(nullptr)` is returned. */ Vertex_handle insert(Site_2 s); @@ -550,7 +550,7 @@ Vertex_handle insert(Site_2 s); Inserts `s` in the Apollonius graph using the site associated with `vnear` as an estimate for the nearest neighbor of the center of `s`. If `s` is visible then the vertex handle of -`s` is returned, otherwise `Vertex_handle(NULL)` is +`s` is returned, otherwise `Vertex_handle(nullptr)` is returned. */ Vertex_handle insert(Site_2 s, Vertex_handle @@ -579,7 +579,7 @@ Finds the nearest neighbor of the point `p`. In other words it finds the site whose Apollonius cell contains `p`. Ties are broken arbitrarily and one of the nearest neighbors of `p` is returned. If there are no visible sites in the Apollonius diagram -`Vertex_handle(NULL)` is returned. +`Vertex_handle(nullptr)` is returned. */ Vertex_handle nearest_neighbor(Point_2 p); @@ -589,7 +589,7 @@ Finds the nearest neighbor of the point estimate for the nearest neighbor of `p`. Ties are broken arbitrarily and one of the nearest neighbors of `p` is returned. If there are no visible sites in the Apollonius diagram -`Vertex_handle(NULL)` is returned. +`Vertex_handle(nullptr)` is returned. */ Vertex_handle nearest_neighbor(Point_2 p, Vertex_handle vnear); diff --git a/Apollonius_graph_2/doc/Apollonius_graph_2/CGAL/Apollonius_graph_hierarchy_2.h b/Apollonius_graph_2/doc/Apollonius_graph_2/CGAL/Apollonius_graph_hierarchy_2.h index 6456ef59549..4dbe28f8278 100644 --- a/Apollonius_graph_2/doc/Apollonius_graph_2/CGAL/Apollonius_graph_hierarchy_2.h +++ b/Apollonius_graph_2/doc/Apollonius_graph_2/CGAL/Apollonius_graph_hierarchy_2.h @@ -110,7 +110,7 @@ unsigned int insert(Input_iterator first, Input_iterator beyond); Inserts the site `s` in the Apollonius graph hierarchy. If `s` is visible then the vertex handle of `s` is returned, otherwise -`Vertex_handle(NULL)` is returned. +`Vertex_handle(nullptr)` is returned. */ Vertex_handle insert(Site_2 s); @@ -119,7 +119,7 @@ Inserts `s` in the Apollonius graph hierarchy using the site associated with `vnear` as an estimate for the nearest neighbor of the center of `s`. If `s` is visible then the vertex handle of `s` is -returned, otherwise `Vertex_handle(NULL)` is returned. +returned, otherwise `Vertex_handle(nullptr)` is returned. A call to this method is equivalent to `agh.insert(s);` and it has been added for the sake of conformity with the interface of the `Apollonius_graph_2` class. @@ -150,14 +150,14 @@ Finds the nearest neighbor of the point `p`. In other words it finds the site whose Apollonius cell contains `p`. Ties are broken arbitrarily and one of the nearest neighbors of `p` is returned. If there are no visible sites in the Apollonius diagram -`Vertex_handle(NULL)` is returned. +`Vertex_handle(nullptr)` is returned. */ Vertex_handle nearest_neighbor(Point p); /*! Finds the nearest neighbor of the point `p`. If there are no visible sites in the Apollonius diagram -`Vertex_handle(NULL)` is returned. +`Vertex_handle(nullptr)` is returned. A call to this method is equivalent to `agh.nearest_neighbor(p);` and it has been added for the sake of conformity with the interface of the diff --git a/Apollonius_graph_2/doc/Apollonius_graph_2/Concepts/ApolloniusGraphHierarchyVertexBase_2.h b/Apollonius_graph_2/doc/Apollonius_graph_2/Concepts/ApolloniusGraphHierarchyVertexBase_2.h index 06edc249596..2d769d3d9e8 100644 --- a/Apollonius_graph_2/doc/Apollonius_graph_2/Concepts/ApolloniusGraphHierarchyVertexBase_2.h +++ b/Apollonius_graph_2/doc/Apollonius_graph_2/Concepts/ApolloniusGraphHierarchyVertexBase_2.h @@ -63,7 +63,7 @@ ApolloniusGraphHierarchyVertexBase_2(Site_2 s, Face_handle f).; /*! Returns a handle to the corresponding vertex of the next level Apollonius graph. If such a vertex does not -exist `Vertex_handle(NULL)` is returned. +exist `Vertex_handle(nullptr)` is returned. */ Vertex_handle up(); diff --git a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Apollonius_graph_2_impl.h b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Apollonius_graph_2_impl.h index a1be16f6372..1e1352c4014 100644 --- a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Apollonius_graph_2_impl.h +++ b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Apollonius_graph_2_impl.h @@ -689,7 +689,7 @@ insert(const Site_2& p, Vertex_handle vnear) // LIST OF FLIPPED EDGES AND WHAT IS DOES IS INITIALIZE THE CONFLICT // REGION AND EXPANDS THE CONFLICT REGION. initialize_conflict_region(start_f, l); - expand_conflict_region(start_f, p, l, fm, vm, NULL); + expand_conflict_region(start_f, p, l, fm, vm, nullptr); // retriangulate_conflict_region(v, l, fm, vm); Vertex_handle v = retriangulate_conflict_region(p, l, fm, vm); @@ -867,7 +867,7 @@ expand_conflict_region(const Face_handle& f, const Site_2& p, } l.remove(e); - if ( fe != NULL ) { + if ( fe != nullptr ) { Vh_triple* vhq = new Vh_triple[1]; (*vhq)[0] = Vertex_handle(); diff --git a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Apollonius_graph_hierarchy_2_impl.h b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Apollonius_graph_hierarchy_2_impl.h index 6fcf1e144e8..8734740023b 100644 --- a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Apollonius_graph_hierarchy_2_impl.h +++ b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Apollonius_graph_hierarchy_2_impl.h @@ -269,7 +269,7 @@ insert(const Site_2 &p) } initialize_conflict_region(start_f, l); - expand_conflict_region(start_f, p, l, fm, v_hidden, NULL); + expand_conflict_region(start_f, p, l, fm, v_hidden, nullptr); n_hidden = v_hidden.size(); if ( n_hidden != 0 ) { diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementDcelFace.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementDcelFace.h index c8a8b03197b..f39f30562d7 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementDcelFace.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementDcelFace.h @@ -72,7 +72,7 @@ bool is_unbounded() const; /*! returns an incident halfedge along the outer boundary of the face. -If `f` has no outer boundary, the function returns `NULL`. +If `f` has no outer boundary, the function returns `nullptr`. */ Halfedge* halfedge(); diff --git a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementInputFormatter.h b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementInputFormatter.h index 5ca8cb4460c..e39ee8c95e5 100644 --- a/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementInputFormatter.h +++ b/Arrangement_on_surface_2/doc/Arrangement_on_surface_2/Concepts/ArrangementInputFormatter.h @@ -102,7 +102,7 @@ void read_arrangement_end (); /*! reads a size value, which is supposed to be preceded by the given label. */ -Size read_size (const char *label = NULL); +Size read_size (const char *label = nullptr); /*! reads a message indicating the beginning of the vertex records. diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_Bezier_curve_traits_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_Bezier_curve_traits_2.h index 8372ecb4e6c..849c408572d 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_Bezier_curve_traits_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_Bezier_curve_traits_2.h @@ -167,8 +167,8 @@ public: delete p_cache; delete p_inter_map; } - p_cache = NULL; - p_inter_map = NULL; + p_cache = nullptr; + p_inter_map = nullptr; } //@} diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_accessor.h b/Arrangement_on_surface_2/include/CGAL/Arr_accessor.h index 376219eb76e..b58fac48103 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_accessor.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_accessor.h @@ -167,7 +167,7 @@ public: DHalfedge* he = p_arr->_locate_around_vertex(p_arr->_vertex (vh), cv, ind); - CGAL_assertion(he != NULL); + CGAL_assertion(he != nullptr); return (p_arr->_handle_for (he)); } @@ -198,7 +198,7 @@ public: DHalfedge* he = p_arr->topology_traits()-> locate_around_boundary_vertex(p_arr->_vertex (vh), cv, ind, ps_x, ps_y); - CGAL_assertion(he != NULL); + CGAL_assertion(he != nullptr); return (p_arr->_handle_for (he)); } @@ -219,10 +219,10 @@ public: if (he1 == he2) return (0); - const DInner_ccb* ic1 = (he1->is_on_inner_ccb()) ? he1->inner_ccb() : NULL; - const DOuter_ccb* oc1 = (ic1 == NULL) ? he1->outer_ccb() : NULL; - const DInner_ccb* ic2 = (he2->is_on_inner_ccb()) ? he2->inner_ccb() : NULL; - const DOuter_ccb* oc2 = (ic2 == NULL) ? he2->outer_ccb() : NULL; + const DInner_ccb* ic1 = (he1->is_on_inner_ccb()) ? he1->inner_ccb() : nullptr; + const DOuter_ccb* oc1 = (ic1 == nullptr) ? he1->outer_ccb() : nullptr; + const DInner_ccb* ic2 = (he2->is_on_inner_ccb()) ? he2->inner_ccb() : nullptr; + const DOuter_ccb* oc2 = (ic2 == nullptr) ? he2->outer_ccb() : nullptr; if ((oc1 != oc2) || (ic1 != ic2)) return (-1); @@ -305,7 +305,7 @@ public: Vertex_handle create_vertex(const Point_2& p) { DVertex* v = p_arr->_create_vertex (p); - CGAL_assertion(v != NULL); + CGAL_assertion(v != nullptr); return (p_arr->_handle_for (v)); } @@ -328,7 +328,7 @@ public: { DVertex* v = p_arr->_create_boundary_vertex (cv, ind, ps_x, ps_y); - CGAL_assertion(v != NULL); + CGAL_assertion(v != nullptr); // Notify the topology traits on the creation of the boundary vertex. if (notify) @@ -359,7 +359,7 @@ public: DVertex* v = p_arr->_place_and_set_curve_end(p_arr->_face (f), cv, ind, ps_x, ps_y, &pred); - if (pred == NULL) + if (pred == nullptr) // No predecessor halfedge, return just the vertex: return (std::make_pair(p_arr->_handle_for(v), Halfedge_handle())); @@ -401,7 +401,7 @@ public: new_face, swapped_predecessors, allow_swap_of_predecessors); - CGAL_assertion(he != NULL); + CGAL_assertion(he != nullptr); return (p_arr->_handle_for(he)); } @@ -438,7 +438,7 @@ public: DHalfedge* he = p_arr->_insert_from_vertex(p_arr->_halfedge(he_to), cv, cv_dir, p_v); - CGAL_assertion(he != NULL); + CGAL_assertion(he != nullptr); return (p_arr->_handle_for (he)); } @@ -485,7 +485,7 @@ public: DHalfedge* he = p_arr->_insert_in_face_interior(p_arr->_face (f), cv, cv_dir, p_v1, p_v2); - CGAL_assertion(he != NULL); + CGAL_assertion(he != nullptr); return (p_arr->_handle_for (he)); } @@ -613,7 +613,7 @@ public: { DHalfedge* he = p_arr->_split_edge (p_arr->_halfedge(e), p, cv1, cv2); - CGAL_assertion(he != NULL); + CGAL_assertion(he != nullptr); return (p_arr->_handle_for(he)); } @@ -636,7 +636,7 @@ public: DHalfedge* he = p_arr->_split_edge(p_arr->_halfedge(e), p_arr->_vertex(v), cv1, cv2); - CGAL_assertion (he != NULL); + CGAL_assertion (he != nullptr); return (p_arr->_handle_for(he)); } @@ -673,7 +673,7 @@ public: { DFace* f = p_arr->_remove_edge(p_arr->_halfedge (e), remove_source, remove_target); - CGAL_assertion(f != NULL); + CGAL_assertion(f != nullptr); return (p_arr->_handle_for(f)); } @@ -687,9 +687,9 @@ public: { DHalfedge* he1 = p_arr->_halfedge(e1); DHalfedge* he2 = p_arr->_halfedge(e2); - const DInner_ccb* ic1 = (he1->is_on_inner_ccb()) ? he1->inner_ccb() : NULL; - if (ic1 == NULL) return (false); - const DInner_ccb* ic2 = (he2->is_on_inner_ccb()) ? he2->inner_ccb() : NULL; + const DInner_ccb* ic1 = (he1->is_on_inner_ccb()) ? he1->inner_ccb() : nullptr; + if (ic1 == nullptr) return (false); + const DInner_ccb* ic2 = (he2->is_on_inner_ccb()) ? he2->inner_ccb() : nullptr; return (ic1 == ic2); } @@ -703,9 +703,9 @@ public: { DHalfedge* he1 = p_arr->_halfedge(e1); DHalfedge* he2 = p_arr->_halfedge(e2); - const DOuter_ccb* oc1 = (he1->is_on_outer_ccb()) ? he1->outer_ccb() : NULL; - if (oc1 == NULL) return (false); - const DOuter_ccb* oc2 = (he2->is_on_outer_ccb()) ? he2->outer_ccb() : NULL; + const DOuter_ccb* oc1 = (he1->is_on_outer_ccb()) ? he1->outer_ccb() : nullptr; + if (oc1 == nullptr) return (false); + const DOuter_ccb* oc2 = (he2->is_on_outer_ccb()) ? he2->outer_ccb() : nullptr; return (oc1 == oc2); } //@} @@ -797,7 +797,7 @@ public: /*! * Create a new vertex. - * \param p A pointer to the point (may be NULL in case of a vertex at + * \param p A pointer to the point (may be nullptr in case of a vertex at * infinity). * \param ps_x The boundary condition at x. * \param ps_y The boundary condition at y. @@ -807,14 +807,14 @@ public: Arr_parameter_space ps_x, Arr_parameter_space ps_y) { Dcel_vertex* new_v = p_arr->_dcel().new_vertex(); - if (p != NULL) { + if (p != nullptr) { typename Dcel::Vertex::Point* p_pt = p_arr->_new_point(*p); new_v->set_point(p_pt); } else { CGAL_precondition (p_arr->is_open(ps_x, ps_y)); - new_v->set_point (NULL); + new_v->set_point (nullptr); } new_v->set_boundary (ps_x, ps_y); @@ -823,7 +823,7 @@ public: /*! * Create a new edge (halfedge pair), associated with the given curve. - * \param cv A pointer to the x-monotone curve (may be NULL in case of + * \param cv A pointer to the x-monotone curve (may be nullptr in case of * a fictitious edge). * \return A pointer to one of the created DCEL halfedge. */ @@ -831,11 +831,11 @@ public: { Dcel_halfedge* new_he = p_arr->_dcel().new_edge(); - if (cv != NULL) { + if (cv != nullptr) { typename Dcel::Halfedge::X_monotone_curve* p_cv = p_arr->_new_curve(*cv); new_he->set_curve(p_cv); } - else new_he->set_curve(NULL); + else new_he->set_curve(nullptr); return new_he; } diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_bounded_planar_topology_traits_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_bounded_planar_topology_traits_2.h index b48363c2913..447c74f1b52 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_bounded_planar_topology_traits_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_bounded_planar_topology_traits_2.h @@ -132,13 +132,13 @@ public: /*! Default constructor. */ Arr_bounded_planar_topology_traits_2() : Base(), - unb_face(NULL) + unb_face(nullptr) {} /*! Constructor from a geometry-traits object. */ Arr_bounded_planar_topology_traits_2(const Gt2* traits) : Base(traits), - unb_face(NULL) + unb_face(nullptr) {} /*! Assign the contents of another topology-traits class. */ @@ -347,7 +347,7 @@ public: Arr_parameter_space /* ps_y */) const { CGAL_error(); - return NULL; + return nullptr; } /*! Locate a DCEL feature that contains the given curve end. @@ -379,7 +379,7 @@ public: { // This function should never be called: CGAL_error(); - return NULL; + return nullptr; } /*! Determine whether the given face is unbounded. @@ -406,7 +406,7 @@ public: { // This function should never be called: CGAL_error(); - return NULL; + return nullptr; } //! reference_face (const version). diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_curve_data_traits_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_curve_data_traits_2.h index 8ad09f033b8..fac702a13fc 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_curve_data_traits_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_curve_data_traits_2.h @@ -137,13 +137,13 @@ public: base_objects.begin(); it != base_objects.end(); ++it) { base_x_curve = object_cast(&(*it)); - if (base_x_curve != NULL) { + if (base_x_curve != nullptr) { // Current object is an x-monotone curve: Attach data to it. *oi++ = make_object(X_monotone_curve_2(*base_x_curve, xdata)); } else { // Current object is an isolated point: Leave it as is. - CGAL_assertion(object_cast(&(*it)) != NULL); + CGAL_assertion(object_cast(&(*it)) != nullptr); *oi++ = *it; } } @@ -219,7 +219,7 @@ public: for (typename std::list::const_iterator it = base_objects.begin(); it != base_objects.end(); ++it) { - if ((base_cv = object_cast(&(*it))) != NULL) { + if ((base_cv = object_cast(&(*it))) != nullptr) { // The current intersection object is an overlapping x-monotone // curve: Merge the data fields of both intersecting curves and // associate the result with the overlapping curve. diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_dcel_base.h b/Arrangement_on_surface_2/include/CGAL/Arr_dcel_base.h index 41adeb99168..ffd43ec6bbf 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_dcel_base.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_dcel_base.h @@ -92,31 +92,31 @@ protected: public: /*! Default constructor. */ Arr_vertex_base() : - p_inc(NULL), - p_pt(NULL) + p_inc(nullptr), + p_pt(nullptr) { pss[0] = pss[1] = static_cast(CGAL::ARR_INTERIOR); } /*! Destructor. */ virtual ~Arr_vertex_base() {} - /*! Check if the point pointer is NULL. */ - bool has_null_point() const { return (p_pt == NULL); } + /*! Check if the point pointer is nullptr. */ + bool has_null_point() const { return (p_pt == nullptr); } /*! Get the point (const version). */ const Point& point() const { - CGAL_assertion(p_pt != NULL); + CGAL_assertion(p_pt != nullptr); return (*p_pt); } /*! Get the point (non-const version). */ Point& point() { - CGAL_assertion(p_pt != NULL); + CGAL_assertion(p_pt != nullptr); return (*p_pt); } - /*! Set the point (may be a NULL point). */ + /*! Set the point (may be a nullptr point). */ void set_point(Point* p) { p_pt = p; } /*! Get the boundary type in x. */ @@ -175,31 +175,31 @@ protected: public: /*! Default constructor */ Arr_halfedge_base() : - p_opp(NULL), - p_prev(NULL), - p_next(NULL), - p_v(NULL), - p_comp(NULL), - p_cv(NULL) + p_opp(nullptr), + p_prev(nullptr), + p_next(nullptr), + p_v(nullptr), + p_comp(nullptr), + p_cv(nullptr) {} /*! Destructor. */ virtual ~Arr_halfedge_base() {} - /*! Check if the curve pointer is NULL. */ - bool has_null_curve() const { return (p_cv == NULL); } + /*! Check if the curve pointer is nullptr. */ + bool has_null_curve() const { return (p_cv == nullptr); } /*! Get the x-monotone curve (const version). */ const X_monotone_curve& curve() const { - CGAL_precondition(p_cv != NULL); + CGAL_precondition(p_cv != nullptr); return (*p_cv); } /*! Get the x-monotone curve (non-const version). */ X_monotone_curve& curve() { - CGAL_precondition(p_cv != NULL); + CGAL_precondition(p_cv != nullptr); return (*p_cv); } @@ -712,7 +712,7 @@ private: public: /*! Default constructor. */ - Arr_outer_ccb() : p_f(NULL), iter_is_not_singular(false) {} + Arr_outer_ccb() : p_f(nullptr), iter_is_not_singular(false) {} /*! Copy constructor. */ Arr_outer_ccb(const Arr_outer_ccb& other) : @@ -778,7 +778,7 @@ private: public: /*! Default constructor. */ - Arr_inner_ccb() : p_f(NULL), iter_is_not_singular(false) {} + Arr_inner_ccb() : p_f(nullptr), iter_is_not_singular(false) {} /*! Copy constructor. */ Arr_inner_ccb(const Arr_inner_ccb& other) : @@ -843,7 +843,7 @@ private: public: /*! Default constructor. */ - Arr_isolated_vertex() : p_f(NULL), iter_is_not_singular(false) {} + Arr_isolated_vertex() : p_f(nullptr), iter_is_not_singular(false) {} /*! Copy constructor. */ Arr_isolated_vertex(const Arr_isolated_vertex& other) : diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Bezier_curve_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Bezier_curve_2.h index 178274c81d6..21914ce4c63 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Bezier_curve_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Bezier_curve_2.h @@ -117,10 +117,10 @@ public: /*! Default constructor. */ _Bezier_curve_2_rep () : _no_self_inter (true), - p_polyX(NULL), - p_normX(NULL), - p_polyY(NULL), - p_normY(NULL) + p_polyX(nullptr), + p_normX(nullptr), + p_polyY(nullptr), + p_normY(nullptr) {} /*! Copy constructor (isn't really used). */ @@ -128,18 +128,18 @@ public: _ctrl_pts(other._ctrl_pts), _bbox(other._bbox), _no_self_inter(other._no_self_inter), - p_polyX(NULL), - p_normX(NULL), - p_polyY(NULL), - p_normY(NULL) + p_polyX(nullptr), + p_normX(nullptr), + p_polyY(nullptr), + p_normY(nullptr) { - if (other.p_polyX != NULL) + if (other.p_polyX != nullptr) p_polyX = new Polynomial(*(other.p_polyX)); - if (other.p_polyY != NULL) + if (other.p_polyY != nullptr) p_polyY = new Polynomial(*(other.p_polyY)); - if (other.p_normX != NULL) + if (other.p_normX != nullptr) p_normX = new Integer(*(other.p_normX)); - if (other.p_normY != NULL) + if (other.p_normY != nullptr) p_normY = new Integer(*(other.p_normY)); } @@ -152,10 +152,10 @@ public: */ template _Bezier_curve_2_rep (InputIterator pts_begin, InputIterator pts_end) : - p_polyX(NULL), - p_normX(NULL), - p_polyY(NULL), - p_normY(NULL) + p_polyX(nullptr), + p_normX(nullptr), + p_polyY(nullptr), + p_normY(nullptr) { // Copy the control points and compute their bounding box. const int pts_size = static_cast(std::distance (pts_begin, pts_end)); @@ -218,13 +218,13 @@ public: /*! Destructor. */ ~_Bezier_curve_2_rep () { - if (p_polyX != NULL) + if (p_polyX != nullptr) delete p_polyX; - if (p_normX != NULL) + if (p_normX != nullptr) delete p_normX; - if (p_polyY != NULL) + if (p_polyY != nullptr) delete p_polyY; - if (p_normY != NULL) + if (p_normY != nullptr) delete p_normY; } @@ -234,14 +234,14 @@ public: /*! Check if the polynomials are already constructed. */ bool has_polynomials () const { - return (p_polyX != NULL && p_normX != NULL && - p_polyY != NULL && p_normY != NULL); + return (p_polyX != nullptr && p_normX != nullptr && + p_polyY != nullptr && p_normY != nullptr); } /*! Get the polynomial X(t). */ const Polynomial& x_polynomial () const { - if (p_polyX == NULL) + if (p_polyX == nullptr) _construct_polynomials (); return (*p_polyX); @@ -250,7 +250,7 @@ public: /*! Get the normalizing factor for X(t). */ const Integer& x_norm () const { - if (p_normX == NULL) + if (p_normX == nullptr) _construct_polynomials (); return (*p_normX); @@ -259,7 +259,7 @@ public: /*! Get the polynomial Y(t). */ const Polynomial& y_polynomial () const { - if (p_polyY == NULL) + if (p_polyY == nullptr) _construct_polynomials (); return (*p_polyY); @@ -268,7 +268,7 @@ public: /*! Get the normalizing factor for Y(t). */ const Integer& y_norm () const { - if (p_normY == NULL) + if (p_normY == nullptr) _construct_polynomials (); return (*p_normY); diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Bezier_point_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Bezier_point_2.h index 668dac17b34..c17e8650e6a 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Bezier_point_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Bezier_point_2.h @@ -108,7 +108,7 @@ private: Originator (const Curve_2& c, const Algebraic& t) : _curve (c), _xid (0), - p_t (NULL) + p_t (nullptr) { set_parameter (t); } @@ -118,7 +118,7 @@ private: const Algebraic& t) : _curve (c), _xid (xid), - p_t (NULL) + p_t (nullptr) { set_parameter (t); } @@ -128,7 +128,7 @@ private: _curve (c), _xid (0), _bpb (bpb), - p_t (NULL) + p_t (nullptr) {} /*! Constructor with bounding information and no exact representation. */ @@ -137,7 +137,7 @@ private: _curve (c), _xid (xid), _bpb (bpb), - p_t (NULL) + p_t (nullptr) {} /*! Copy constructor. */ @@ -145,17 +145,17 @@ private: _curve (other._curve), _xid (other._xid), _bpb (other._bpb), - p_t (NULL) + p_t (nullptr) { // Deep copy of lazy instantiation - if (other.p_t != NULL) + if (other.p_t != nullptr) p_t = new Algebraic (*(other.p_t)); } /*! Destructor. */ ~Originator() { - if (p_t != NULL) + if (p_t != nullptr) delete p_t; } @@ -167,9 +167,9 @@ private: return (*this); // Free memory, if necessary. - if (p_t != NULL) + if (p_t != nullptr) delete p_t; - p_t = NULL; + p_t = nullptr; // Copy the data members. _curve = other._curve; @@ -177,7 +177,7 @@ private: _bpb = other._bpb; // Deep copy of lazy instantiation - if (other.p_t != NULL) + if (other.p_t != nullptr) p_t = new Algebraic (*(other.p_t)); return (*this); @@ -211,7 +211,7 @@ private: /*! Check if the algberaic parameter is available. */ bool has_parameter () const { - return (p_t != NULL); + return (p_t != nullptr); } /*! @@ -220,7 +220,7 @@ private: */ const Algebraic& parameter () const { - CGAL_precondition (p_t != NULL); + CGAL_precondition (p_t != nullptr); return (*p_t); } @@ -230,7 +230,7 @@ private: */ void set_parameter (const Algebraic& t) { - CGAL_precondition (p_t == NULL); + CGAL_precondition (p_t == nullptr); p_t = new Algebraic (t); @@ -305,28 +305,28 @@ public: /*! Default constructor. */ _Bezier_point_2_rep () : - p_alg_x (NULL), - p_rat_x (NULL), - p_alg_y (NULL), - p_rat_y (NULL) + p_alg_x (nullptr), + p_rat_x (nullptr), + p_alg_y (nullptr), + p_rat_y (nullptr) {} /*! Copy constructor. */ _Bezier_point_2_rep (const Self& pt) : - p_alg_x (NULL), - p_rat_x (NULL), - p_alg_y (NULL), - p_rat_y (NULL), + p_alg_x (nullptr), + p_rat_x (nullptr), + p_alg_y (nullptr), + p_rat_y (nullptr), _origs (pt._origs), _bbox (pt._bbox) { - if (pt.p_alg_x != NULL) + if (pt.p_alg_x != nullptr) p_alg_x = new Algebraic (*(pt.p_alg_x)); - if (pt.p_rat_x != NULL) + if (pt.p_rat_x != nullptr) p_rat_x = new Rational (*(pt.p_rat_x)); - if (pt.p_alg_y != NULL) + if (pt.p_alg_y != nullptr) p_alg_y = new Algebraic (*(pt.p_alg_y)); - if (pt.p_rat_y != NULL) + if (pt.p_rat_y != nullptr) p_rat_y = new Rational (*(pt.p_rat_y)); } @@ -336,8 +336,8 @@ public: * \param y The exact y-coordinate. */ _Bezier_point_2_rep (const Algebraic& x, const Algebraic& y, bool) : - p_rat_x (NULL), - p_rat_y (NULL) + p_rat_x (nullptr), + p_rat_y (nullptr) { p_alg_x = new Algebraic (x); p_alg_y = new Algebraic (y); @@ -407,13 +407,13 @@ public: /*! Destructor. */ ~_Bezier_point_2_rep () { - if (p_rat_x != NULL) + if (p_rat_x != nullptr) delete p_rat_x; - if (p_alg_x != NULL) + if (p_alg_x != nullptr) delete p_alg_x; - if (p_rat_y != NULL) + if (p_rat_y != nullptr) delete p_rat_y; - if (p_alg_y != NULL) + if (p_alg_y != nullptr) delete p_alg_y; } @@ -423,24 +423,24 @@ public: if (this == &pt) return (*this); - if (p_rat_x != NULL) + if (p_rat_x != nullptr) delete p_rat_x; - if (p_alg_x != NULL) + if (p_alg_x != nullptr) delete p_alg_x; - if (p_rat_y != NULL) + if (p_rat_y != nullptr) delete p_rat_y; - if (p_alg_y != NULL) + if (p_alg_y != nullptr) delete p_alg_y; - p_alg_x = p_rat_x = p_alg_y = p_rat_y = NULL; + p_alg_x = p_rat_x = p_alg_y = p_rat_y = nullptr; - if (pt.p_alg_x != NULL) + if (pt.p_alg_x != nullptr) p_alg_x = new Algebraic (*(pt.p_alg_x)); - if (pt.p_rat_x != NULL) + if (pt.p_rat_x != nullptr) p_rat_x = new Rational (*(pt.p_rat_x)); - if (pt.p_alg_y != NULL) + if (pt.p_alg_y != nullptr) p_alg_y = new Algebraic (*(pt.p_alg_y)); - if (pt.p_rat_y != NULL) + if (pt.p_rat_y != nullptr) p_rat_y = new Rational (*(pt.p_rat_y)); _origs = pt._origs; @@ -452,13 +452,13 @@ public: /*! Check if the point is exactly computed. */ inline bool is_exact () const { - return (p_alg_x != NULL && p_alg_y != NULL); + return (p_alg_x != nullptr && p_alg_y != nullptr); } /*! Check if the point has rational coordinates. */ inline bool is_rational () const { - return (p_rat_x != NULL && p_rat_y != NULL); + return (p_rat_x != nullptr && p_rat_y != nullptr); } /*! @@ -1060,8 +1060,8 @@ _Bezier_point_2_rep::_Bezier_point_2_rep template _Bezier_point_2_rep::_Bezier_point_2_rep (const Curve_2& B, const Algebraic& t0) : - p_rat_x (NULL), - p_rat_y (NULL) + p_rat_x (nullptr), + p_rat_y (nullptr) { // Create the originator pair . // Note that this constructor also takes care of the Bez_bound @@ -1095,8 +1095,8 @@ template _Bezier_point_2_rep::_Bezier_point_2_rep (const Curve_2& B, unsigned int xid, const Algebraic& t0) : - p_rat_x (NULL), - p_rat_y (NULL) + p_rat_x (nullptr), + p_rat_y (nullptr) { // Create the originator pair . // Note that this constructor also takes care of the Bez_bound diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Circle_segment_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Circle_segment_2.h index 8b4d0602224..a2b6d69e40d 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Circle_segment_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Circle_segment_2.h @@ -1187,7 +1187,7 @@ public: */ template OutputIterator intersect (const Self& cv, OutputIterator oi, - Intersection_map *inter_map = NULL) const + Intersection_map *inter_map = nullptr) const { // First check whether the two arcs have the same supporting curve. if (has_same_supporting_curve (cv)) @@ -1232,7 +1232,7 @@ public: Intersection_list inter_list; bool invalid_ids = false; - if (inter_map != NULL && _index() != 0 && cv._index() != 0) + if (inter_map != nullptr && _index() != 0 && cv._index() != 0) { if (_index() < cv._index()) id_pair = Curve_id_pair (_index(), cv._index()); @@ -1245,12 +1245,12 @@ public: { // In case one of the IDs is invalid, we do not look in the map neither // we cache the results. - if (inter_map != NULL) + if (inter_map != nullptr) map_iter = inter_map->end(); invalid_ids = true; } - if (inter_map == NULL || map_iter == inter_map->end()) + if (inter_map == nullptr || map_iter == inter_map->end()) { // Compute the intersections points between the two supporting curves. if (is_linear()) diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Conic_arc_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Conic_arc_2.h index 87b6e5c17b6..baf1919e254 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Conic_arc_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Conic_arc_2.h @@ -114,7 +114,7 @@ protected: }; Extra_data *_extra_data_P; // The extra data stored with the arc - // (may be NULL). + // (may be nullptr). public: @@ -128,7 +128,7 @@ public: _r(0), _s(0), _t(0), _u(0), _v(0), _w(0), _orient (COLLINEAR), _info (0), - _extra_data_P (NULL) + _extra_data_P (nullptr) {} /*! @@ -142,10 +142,10 @@ public: _source(arc._source), _target(arc._target) { - if (arc._extra_data_P != NULL) + if (arc._extra_data_P != nullptr) _extra_data_P = new Extra_data (*(arc._extra_data_P)); else - _extra_data_P = NULL; + _extra_data_P = nullptr; } /*! @@ -155,7 +155,7 @@ public: */ _Conic_arc_2 (const Rational& r, const Rational& s, const Rational& t, const Rational& u, const Rational& v, const Rational& w) : - _extra_data_P (NULL) + _extra_data_P (nullptr) { // Make sure the given curve is an ellipse (4rs - t^2 should be positive). CGAL_precondition (CGAL::sign (4*r*s - t*t) == POSITIVE); @@ -189,7 +189,7 @@ public: _orient (orient), _source (source), _target (target), - _extra_data_P (NULL) + _extra_data_P (nullptr) { // Make sure that the source and the taget are not the same. CGAL_precondition (Alg_kernel().compare_xy_2_object() (source, @@ -214,7 +214,7 @@ public: */ _Conic_arc_2 (const Rat_segment_2& seg) : _orient (COLLINEAR), - _extra_data_P (NULL) + _extra_data_P (nullptr) { // Set the source and target. Rat_kernel ker; @@ -271,7 +271,7 @@ public: */ _Conic_arc_2 (const Rat_circle_2& circ) : _orient (CLOCKWISE), - _extra_data_P (NULL) + _extra_data_P (nullptr) { // Get the circle properties. Rat_kernel ker; @@ -316,7 +316,7 @@ public: _orient(orient), _source(source), _target(target), - _extra_data_P (NULL) + _extra_data_P (nullptr) { // Make sure that the source and the taget are not the same. CGAL_precondition (Alg_kernel().compare_xy_2_object() (source, @@ -378,7 +378,7 @@ public: _Conic_arc_2 (const Rat_point_2& p1, const Rat_point_2& p2, const Rat_point_2& p3): - _extra_data_P (NULL) + _extra_data_P (nullptr) { // Set the source and target. Rational x1 = p1.x(); @@ -467,7 +467,7 @@ public: const Rat_point_2& p3, const Rat_point_2& p4, const Rat_point_2& p5) : - _extra_data_P(NULL) + _extra_data_P(nullptr) { // Make sure that no three points are collinear. Rat_kernel ker; @@ -574,7 +574,7 @@ public: const Rational& r_2, const Rational& s_2, const Rational& t_2, const Rational& u_2, const Rational& v_2, const Rational& w_2): _orient(orient), - _extra_data_P(NULL) + _extra_data_P(nullptr) { // Create the integer coefficients of the base conic. Rational rat_coeffs [6]; @@ -753,7 +753,7 @@ public: */ virtual ~_Conic_arc_2 () { - if (_extra_data_P != NULL) + if (_extra_data_P != nullptr) delete _extra_data_P; } @@ -767,7 +767,7 @@ public: return (*this); // Free any existing data. - if (_extra_data_P != NULL) + if (_extra_data_P != nullptr) delete _extra_data_P; // Copy the arc's attributes. @@ -784,10 +784,10 @@ public: _target = arc._target; // Duplicate the extra data, if necessary. - if (arc._extra_data_P != NULL) + if (arc._extra_data_P != nullptr) _extra_data_P = new Extra_data (*(arc._extra_data_P)); else - _extra_data_P = NULL; + _extra_data_P = nullptr; return (*this); } @@ -1204,7 +1204,7 @@ private: return; } - _extra_data_P = NULL; + _extra_data_P = nullptr; // Check whether we have a degree 2 curve. if ((CGAL::sign (_r) != ZERO || @@ -1339,7 +1339,7 @@ private: CGAL_assertion (is_ellipse); // We do not have to store any extra data with the arc. - _extra_data_P = NULL; + _extra_data_P = nullptr; // Mark that this arc is a full conic curve. if (is_ellipse) @@ -1470,9 +1470,9 @@ protected: Sign _sign_of_extra_data (const Algebraic& px, const Algebraic& py) const { - CGAL_assertion (_extra_data_P != NULL); + CGAL_assertion (_extra_data_P != nullptr); - if (_extra_data_P == NULL) + if (_extra_data_P == nullptr) return (ZERO); Algebraic val = (_extra_data_P->a*px + _extra_data_P->b*py + @@ -1542,7 +1542,7 @@ protected: return (true); // Check if we have extra data available. - if (_extra_data_P != NULL) + if (_extra_data_P != nullptr) { if (_extra_data_P->side != ZERO) { diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Conic_x_monotone_arc_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Conic_x_monotone_arc_2.h index a3a2826f01a..167acd65096 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Conic_x_monotone_arc_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Conic_x_monotone_arc_2.h @@ -522,7 +522,7 @@ public: } else if (this->_orient == COLLINEAR) { - CGAL_assertion (this->_extra_data_P != NULL); + CGAL_assertion (this->_extra_data_P != nullptr); // In this case the equation of the supporting line is given by the // extra data structure. diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Polycurve_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Polycurve_2.h index 7d27f2d260f..d4dbd24e525 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Polycurve_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Polycurve_2.h @@ -235,7 +235,7 @@ public: m_cvP(cvP), m_index(index) { - m_num_pts = (m_cvP == NULL) ? 0 : + m_num_pts = (m_cvP == nullptr) ? 0 : ((m_cvP->number_of_subcurves() == 0) ? 0 : (m_cvP->number_of_subcurves() + 1)); } @@ -246,7 +246,7 @@ public: public: /*! Default constructor. */ Point_const_iterator() : - m_cvP(NULL), + m_cvP(nullptr), m_num_pts(0), m_index(std::numeric_limits::max BOOST_PREVENT_MACRO_SUBSTITUTION ()) {} @@ -256,7 +256,7 @@ public: */ const Point_type_2& operator*() const { - CGAL_assertion(m_cvP != NULL); + CGAL_assertion(m_cvP != nullptr); CGAL_assertion((is_index_valid()) && (m_index < m_num_pts)); // First point is the source of the first subcurve. @@ -273,28 +273,28 @@ public: /*! Increment operators. */ Point_const_iterator& operator++() { - if ((m_cvP != NULL) && (m_index < m_num_pts)) ++m_index; + if ((m_cvP != nullptr) && (m_index < m_num_pts)) ++m_index; return (*this); } Point_const_iterator operator++(int) { Point_const_iterator temp = *this; - if ((m_cvP != NULL) && (m_index < m_num_pts)) ++m_index; + if ((m_cvP != nullptr) && (m_index < m_num_pts)) ++m_index; return temp; } /*! Decrement operators. */ Point_const_iterator& operator--() { - if ((m_cvP != NULL) && (is_index_valid())) --m_index; + if ((m_cvP != nullptr) && (is_index_valid())) --m_index; return (*this); } Point_const_iterator operator--(int) { Point_const_iterator temp = *this; - if ((m_cvP != NULL) && (is_index_valid())) --m_index; + if ((m_cvP != nullptr) && (is_index_valid())) --m_index; return temp; } diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_landmarks_point_location.h b/Arrangement_on_surface_2/include/CGAL/Arr_landmarks_point_location.h index 6a38a2474b2..153c968e9d2 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_landmarks_point_location.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_landmarks_point_location.h @@ -114,9 +114,9 @@ protected: public: /*! Default constructor. */ Arr_landmarks_point_location() : - p_arr(NULL), - m_traits(NULL), - lm_gen(NULL), + p_arr(nullptr), + m_traits(nullptr), + lm_gen(nullptr), own_gen(false) {} @@ -141,25 +141,25 @@ public: { if (own_gen) { delete lm_gen; - lm_gen = NULL; + lm_gen = nullptr; } } /*! Attach an arrangement object (and a generator, if supplied). */ - void attach(const Arrangement_2& arr, Generator* gen = NULL) + void attach(const Arrangement_2& arr, Generator* gen = nullptr) { // Keep a pointer to the associated arrangement. p_arr = &arr; m_traits = static_cast(p_arr->geometry_traits()); // Update the landmarks generator. - if (gen != NULL) { + if (gen != nullptr) { // In case a generator is given, keep a pointer to it. - CGAL_assertion(lm_gen == NULL); + CGAL_assertion(lm_gen == nullptr); lm_gen = gen; own_gen = false; } - else if (lm_gen != NULL) { + else if (lm_gen != nullptr) { // In case a generator exists internally, make sure it is attached to // the given arrangement. Arrangement_2& non_const_arr = const_cast(*p_arr); @@ -175,10 +175,10 @@ public: /*! Detach the instance from the arrangement object. */ void detach() { - p_arr = NULL; - m_traits = NULL; + p_arr = nullptr; + m_traits = nullptr; - CGAL_assertion(lm_gen != NULL); + CGAL_assertion(lm_gen != nullptr); if (lm_gen) lm_gen->detach(); } diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_linear_traits_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_linear_traits_2.h index ecb5c98a70b..47f3f59bb65 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_linear_traits_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_linear_traits_2.h @@ -1519,7 +1519,7 @@ public: // Check whether we have a single intersection point. const Point_2 *ip = object_cast (&obj); - if (ip != NULL) + if (ip != nullptr) { // Check whether the intersection point ip lies on both segments. const bool ip_on_cv1 = cv1.is_vertical() ? cv1.is_in_y_range(*ip) : diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_naive_point_location.h b/Arrangement_on_surface_2/include/CGAL/Arr_naive_point_location.h index f7b4b665bb3..3abb2ed91b1 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_naive_point_location.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_naive_point_location.h @@ -78,9 +78,9 @@ protected: public: /*! Default constructor. */ Arr_naive_point_location() : - p_arr(NULL), - geom_traits(NULL), - top_traits(NULL) + p_arr(nullptr), + geom_traits(nullptr), + top_traits(nullptr) {} /*! Constructor given an arrangement. */ @@ -101,9 +101,9 @@ public: /*! Detach from the current arrangement object. */ void detach() { - p_arr = NULL; - geom_traits = NULL; - top_traits = NULL; + p_arr = nullptr; + geom_traits = nullptr; + top_traits = nullptr; } /*! diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_non_caching_segment_traits_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_non_caching_segment_traits_2.h index 8c0d0475475..0863bc5c7eb 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_non_caching_segment_traits_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_non_caching_segment_traits_2.h @@ -241,7 +241,7 @@ public: // Chack if the intersection is a point: const Point_2 *ip; - if ((ip = object_cast (&res)) != NULL) + if ((ip = object_cast (&res)) != nullptr) { // Create a pair representing the point with its multiplicity, // which is always 1 for line segments for all practical purposes. @@ -257,7 +257,7 @@ public: // The intersection is a segment. const X_monotone_curve_2 *ov = object_cast(&res); - CGAL_assertion (ov != NULL); + CGAL_assertion (ov != nullptr); Self self; Comparison_result cmp1 = self.compare_endpoints_xy_2_object()(cv1); diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_observer.h b/Arrangement_on_surface_2/include/CGAL/Arr_observer.h index 1f2492da4f0..f17b7691d41 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_observer.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_observer.h @@ -72,7 +72,7 @@ public: /*! Default constructor. */ Arr_observer () : - p_arr (NULL) + p_arr (nullptr) {} /*! Constructor with an associated arrangement. */ @@ -87,7 +87,7 @@ public: virtual ~Arr_observer () { // Unregister the observer object from the arrangement. - if (p_arr != NULL) + if (p_arr != nullptr) p_arr->_unregister_observer (this); } //@} @@ -118,9 +118,9 @@ public: return; // The observer is not already attached to an arrangement. - CGAL_precondition (p_arr == NULL); + CGAL_precondition (p_arr == nullptr); - if (p_arr != NULL) + if (p_arr != nullptr) return; // Notify the concrete oberver (the sub-class) about the attachment. @@ -139,7 +139,7 @@ public: /*! Detach the observer from the arrangement. */ void detach () { - if (p_arr == NULL) + if (p_arr == nullptr) return; // Notify the concrete oberver (the sub-class) about the detachment. @@ -148,7 +148,7 @@ public: // Unregister the observer object from the current arrangement, and mark // that the oberver is not attached to an arrangement. p_arr->_unregister_observer (this); - p_arr = NULL; + p_arr = nullptr; // Notify the concrete oberver that the detachment took place. after_detach(); diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_landmarks_pl_impl.h b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_landmarks_pl_impl.h index cffef3904fa..54fec0daef3 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_landmarks_pl_impl.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_landmarks_pl_impl.h @@ -169,7 +169,7 @@ _walk_from_vertex(Vertex_const_handle nearest_vertex, // We found a vertex closer to p; Continue using this vertex. const Vertex_const_handle* p_vh = Result().template assign(obj); - CGAL_assertion(p_vh != NULL); + CGAL_assertion(p_vh != nullptr); vh = *p_vh; continue; } @@ -504,7 +504,7 @@ _walk_from_face(Face_const_handle face, do { // Check whether p lies inside the current face (including its holes): - if (p_arr->topology_traits()->is_in_face(&(*face), p, NULL)) + if (p_arr->topology_traits()->is_in_face(&(*face), p, nullptr)) { // We know that p is located inside the current face, and we check // whether it lies inside one of its holes (or on the boundary of diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_lm_nearest_neighbor.h b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_lm_nearest_neighbor.h index 5c97ae275dd..bd4128490a4 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_lm_nearest_neighbor.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_lm_nearest_neighbor.h @@ -161,7 +161,7 @@ private: public: /*! Default constructor. */ Arr_landmarks_nearest_neighbor () : - m_tree(NULL), + m_tree(nullptr), m_is_empty(true) {} @@ -177,7 +177,7 @@ public: template void init(InputIterator begin, InputIterator end) { - CGAL_precondition_msg(m_tree == NULL, + CGAL_precondition_msg(m_tree == nullptr, "The search tree is already initialized."); if (begin != end) { @@ -193,9 +193,9 @@ public: /*! Clear the search tree. */ void clear() { - if (m_tree != NULL) + if (m_tree != nullptr) delete m_tree; - m_tree = NULL; + m_tree = nullptr; m_is_empty = true; } @@ -209,7 +209,7 @@ public: */ Point_2 find_nearest_neighbor(const Point_2& q, PL_result_type &obj) const { - CGAL_precondition_msg(m_tree != NULL && ! m_is_empty, + CGAL_precondition_msg(m_tree != nullptr && ! m_is_empty, "The search tree is not initialized."); // Create an NN_Point_2 object from the query point and use it to diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_naive_point_location_impl.h b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_naive_point_location_impl.h index fb12b853287..ab194ac8361 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_naive_point_location_impl.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_naive_point_location_impl.h @@ -79,7 +79,7 @@ Arr_naive_point_location::locate(const Point_2& p) const for (fit = p_arr->faces_begin(); fit != p_arr->faces_end(); ++fit) { fh = fit; - if (top_traits->is_in_face(&(*fh), p, NULL)) { + if (top_traits->is_in_face(&(*fh), p, nullptr)) { // The current face contains p in its interior. if (f_inner == invalid_f || f_inner->is_unbounded() || @@ -102,7 +102,7 @@ Arr_naive_point_location::locate(const Point_2& p) const fh->outer_ccbs_begin(); Vertex_const_handle v = (*it)->source(); - if (top_traits->is_in_face(&(*f_inner), v->point(), NULL)) + if (top_traits->is_in_face(&(*f_inner), v->point(), nullptr)) f_inner = fh; } } diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_simple_point_location_impl.h b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_simple_point_location_impl.h index ef1fa8cdfbb..675d90cd7c5 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_simple_point_location_impl.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_simple_point_location_impl.h @@ -135,9 +135,9 @@ _base_vertical_ray_shoot(const Point_2& p, bool shoot_up) const Comparison_result res = EQUAL; Comparison_result y_res; bool in_x_range; - const typename Dcel::Halfedge* closest_he = NULL; // The closest so far. - const typename Dcel::Vertex* cl_vs = NULL; // Its source. - const typename Dcel::Vertex* cl_vt = NULL; // Its target. + const typename Dcel::Halfedge* closest_he = nullptr; // The closest so far. + const typename Dcel::Vertex* cl_vs = nullptr; // Its source. + const typename Dcel::Vertex* cl_vt = nullptr; // Its target. while (eit != e_end) { // Get the current edge and its source and target vertices. @@ -158,7 +158,7 @@ _base_vertical_ray_shoot(const Point_2& p, bool shoot_up) const res = m_topol_traits->compare_y_at_x(p, he); if (in_x_range && (res == point_above_under)) { - if (closest_he == NULL) { + if (closest_he == nullptr) { // If no other x-monotone curve containing p in its x-range has been // found yet, take the current one as the vertically closest to p. closest_he = he; @@ -242,7 +242,7 @@ _base_vertical_ray_shoot(const Point_2& p, bool shoot_up) const } // If we did not locate a closest halfedge, return an empty object. - if (closest_he == NULL) + if (closest_he == nullptr) return make_optional_result(); // If we found a fictitious edge, return it now. @@ -305,7 +305,7 @@ Arr_simple_point_location::_vertical_ray_shoot(const Point_2& p, else { const Halfedge_const_handle* p_hh = Result().template assign(obj); - CGAL_assertion(p_hh != NULL); + CGAL_assertion(p_hh != nullptr); found_halfedge = true; closest_he = *p_hh; } diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_trapezoid_ric_pl_impl.h b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_trapezoid_ric_pl_impl.h index cd5506271fb..14833c9ba15 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_trapezoid_ric_pl_impl.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Arr_trapezoid_ric_pl_impl.h @@ -193,7 +193,7 @@ _get_unbounded_face(const Td_map_item& item,const Point_2& p, Td_map_item& left_v_item = td.locate(tr.left(),td_lt); CGAL_assertion(td_lt == TD::POINT); Halfedge_const_handle he; - if (boost::get(&left_v_item) != NULL) { + if (boost::get(&left_v_item) != nullptr) { Td_active_vertex v(boost::get(left_v_item)); he = v.cw_he(); } @@ -225,7 +225,7 @@ _get_unbounded_face(const Td_map_item& item,const Point_2& p, Td_map_item& right_v_item = td.locate(tr.right(),td_lt); CGAL_assertion(td_lt == TD::POINT); Halfedge_const_handle he; - if (boost::get(&right_v_item)!= NULL) { + if (boost::get(&right_v_item)!= nullptr) { Td_active_vertex v(boost::get(right_v_item)); he = v.cw_he(); } diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_X_trapezoid.h b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_X_trapezoid.h index 39a2d5d3cb9..1fc1332a99b 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_X_trapezoid.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_X_trapezoid.h @@ -248,7 +248,7 @@ public: Curve_end v_ce(left()->curve_end()); ptr()->e2 = (boost::shared_ptr)(new X_monotone_curve_2(v_ce.cv())); - //CGAL_assertion(boost::get>( &(ptr()->e2)) != NULL); + //CGAL_assertion(boost::get>( &(ptr()->e2)) != nullptr); ptr()->e1 = (v_ce.ce() == ARR_MIN_END ) ? CGAL_TD_CV_MIN_END : CGAL_TD_CV_MAX_END; @@ -452,7 +452,7 @@ public: CGAL_TD_INLINE Vertex_const_handle left_unsafe() const { CGAL_precondition(is_active()); - CGAL_assertion(boost::get(&(ptr()->e0)) != NULL); + CGAL_assertion(boost::get(&(ptr()->e0)) != nullptr); return boost::get(ptr()->e0); } @@ -475,7 +475,7 @@ public: CGAL_TD_INLINE Vertex_const_handle right_unsafe() const { CGAL_precondition(is_active()); - CGAL_assertion(boost::get(&(ptr()->e1)) != NULL); + CGAL_assertion(boost::get(&(ptr()->e1)) != nullptr); return boost::get(ptr()->e1); } @@ -498,7 +498,7 @@ public: CGAL_TD_INLINE Halfedge_const_handle bottom_unsafe () const { CGAL_precondition(is_active()); - CGAL_assertion(boost::get(&(ptr()->e2)) != NULL); + CGAL_assertion(boost::get(&(ptr()->e2)) != nullptr); return boost::get(ptr()->e2); } @@ -535,7 +535,7 @@ public: CGAL_precondition(type() == TD_VERTEX); CGAL_precondition(!is_on_boundaries()); - CGAL_assertion(boost::get( &(ptr()->e0)) != NULL); + CGAL_assertion(boost::get( &(ptr()->e0)) != nullptr); return boost::get( ptr()->e0 ); } @@ -545,10 +545,10 @@ public: CGAL_precondition(type() == TD_VERTEX); CGAL_precondition(is_on_boundaries()); - CGAL_assertion(boost::get( &(ptr()->e1)) != NULL); - CGAL_assertion(boost::get >(&(ptr()->e2)) != NULL); + CGAL_assertion(boost::get( &(ptr()->e1)) != nullptr); + CGAL_assertion(boost::get >(&(ptr()->e2)) != nullptr); X_monotone_curve_2* cv_ptr = (boost::get >(ptr()->e2)).get(); - CGAL_assertion(cv_ptr != NULL); + CGAL_assertion(cv_ptr != nullptr); Arr_curve_end ce = (boost::get(ptr()->e1) == CGAL_TD_CV_MIN_END) ? @@ -563,10 +563,10 @@ public: CGAL_precondition(type() == TD_VERTEX); CGAL_precondition(is_on_boundaries()); - CGAL_assertion(boost::get( &(ptr()->e1)) != NULL); - CGAL_assertion(boost::get >(&(ptr()->e2)) != NULL); + CGAL_assertion(boost::get( &(ptr()->e1)) != nullptr); + CGAL_assertion(boost::get >(&(ptr()->e2)) != nullptr); X_monotone_curve_2* cv_ptr = (boost::get >(ptr()->e2)).get(); - CGAL_assertion(cv_ptr != NULL); + CGAL_assertion(cv_ptr != nullptr); Arr_curve_end ce = (boost::get(ptr()->e1) == CGAL_TD_CV_MIN_END) ? @@ -580,10 +580,10 @@ public: CGAL_precondition(!is_active()); CGAL_precondition(type() == TD_VERTEX); - CGAL_assertion(boost::get( &(ptr()->e1)) != NULL); - CGAL_assertion(boost::get >(&(ptr()->e2)) != NULL); + CGAL_assertion(boost::get( &(ptr()->e1)) != nullptr); + CGAL_assertion(boost::get >(&(ptr()->e2)) != nullptr); X_monotone_curve_2* cv_ptr = (boost::get >(ptr()->e2)).get(); - CGAL_assertion(cv_ptr != NULL); + CGAL_assertion(cv_ptr != nullptr); Arr_curve_end ce = (boost::get(ptr()->e1) == CGAL_TD_CV_MIN_END) ? @@ -596,9 +596,9 @@ public: { CGAL_precondition(!is_active() && type() == TD_EDGE); - CGAL_assertion(boost::get >(&(ptr()->e2)) != NULL); + CGAL_assertion(boost::get >(&(ptr()->e2)) != nullptr); X_monotone_curve_2* cv_ptr = (boost::get >(ptr()->e2)).get(); - CGAL_assertion(cv_ptr != NULL); + CGAL_assertion(cv_ptr != nullptr); return *cv_ptr; } diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_active_edge.h b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_active_edge.h index 2a62c0b8635..abb8fbb0942 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_active_edge.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_active_edge.h @@ -200,8 +200,8 @@ public: { PTR = new Data - (Traits::empty_he_handle(), Td_map_item(0), NULL); - //m_dag_node = NULL; + (Traits::empty_he_handle(), Td_map_item(0), nullptr); + //m_dag_node = nullptr; } /*! Constructor given Vertex & Halfedge handles. */ Td_active_edge (Halfedge_const_handle he , diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_active_fictitious_vertex.h b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_active_fictitious_vertex.h index 457d955a7d8..e8c7d64fc9d 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_active_fictitious_vertex.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_active_fictitious_vertex.h @@ -189,7 +189,7 @@ public: Td_active_fictitious_vertex() { - PTR = new Data(Traits::empty_vtx_handle(), Traits::empty_he_handle(), NULL); + PTR = new Data(Traits::empty_vtx_handle(), Traits::empty_he_handle(), nullptr); } /*! Constructor given Vertex & Halfedge handles. */ diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_active_trapezoid.h b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_active_trapezoid.h index 1468e0b61aa..4ef7826fc53 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_active_trapezoid.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_active_trapezoid.h @@ -261,7 +261,7 @@ public: Traits::empty_vtx_handle(), Traits::empty_he_handle(), Traits::empty_he_handle(), - Td_map_item(0), Td_map_item(0) , Td_map_item(0) , Td_map_item(0), NULL); + Td_map_item(0), Td_map_item(0) , Td_map_item(0) , Td_map_item(0), nullptr); //m_dag_node = 0; } diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_active_vertex.h b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_active_vertex.h index d912cf09daa..47d4f78c5b0 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_active_vertex.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_active_vertex.h @@ -191,7 +191,7 @@ public: Td_active_vertex() { - PTR = new Data(Traits::empty_vtx_handle(), Traits::empty_he_handle(), NULL); + PTR = new Data(Traits::empty_vtx_handle(), Traits::empty_he_handle(), nullptr); } /*! Constructor given Vertex & Halfedge handles. */ diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_inactive_edge.h b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_inactive_edge.h index 72ecbde372d..96b5afde8e9 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_inactive_edge.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_inactive_edge.h @@ -168,7 +168,7 @@ public: //@{ /*! Constructor given Vertex & Halfedge handles. */ - Td_inactive_edge (boost::shared_ptr& cv, Dag_node* node = NULL) + Td_inactive_edge (boost::shared_ptr& cv, Dag_node* node = nullptr) { PTR = new Data(cv,node); } @@ -230,7 +230,7 @@ public: inline X_monotone_curve_2& curve() const { X_monotone_curve_2* cv_ptr = (ptr()->cv).get(); - CGAL_assertion(cv_ptr != NULL); + CGAL_assertion(cv_ptr != nullptr); return *cv_ptr; } diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_inactive_fictitious_vertex.h b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_inactive_fictitious_vertex.h index 60fee1f9668..0208d5915ad 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_inactive_fictitious_vertex.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_inactive_fictitious_vertex.h @@ -190,7 +190,7 @@ public: //@{ /*! Constructor given Vertex & Halfedge handles. */ - Td_inactive_fictitious_vertex (Vertex_const_handle v_before_rem, Dag_node* node = NULL) + Td_inactive_fictitious_vertex (Vertex_const_handle v_before_rem, Dag_node* node = nullptr) { Curve_end v_ce(vtx_to_ce(v_before_rem)); diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_inactive_vertex.h b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_inactive_vertex.h index 83188f90631..ae92b825c0e 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_inactive_vertex.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Td_inactive_vertex.h @@ -169,7 +169,7 @@ public: //@{ /*! Constructor given Vertex & Halfedge handles. */ - Td_inactive_vertex (Vertex_const_handle v_before_rem, Dag_node* node = NULL) + Td_inactive_vertex (Vertex_const_handle v_before_rem, Dag_node* node = nullptr) { PTR = new Data(v_before_rem->point(), node); } diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Trapezoidal_decomposition_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Trapezoidal_decomposition_2.h index 02f099b8b54..3dc5e4c26d5 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Trapezoidal_decomposition_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Trapezoidal_decomposition_2.h @@ -266,7 +266,7 @@ public: m_sep doesn't intersect any existing edges except possibly on common end points. postconditions: - if the rightmost trapezoid was traversed m_cur_item is set to NULL. + if the rightmost trapezoid was traversed m_cur_item is set to nullptr. remark: if the seperator is vertical, using the precondition assumptions it follows that there is exactly one trapezoid to travel. @@ -277,9 +277,9 @@ public: return *this;// end reached, do nothing! #ifndef CGAL_TD_DEBUG - CGAL_warning(traits != NULL); + CGAL_warning(traits != nullptr); #else - CGAL_assertion(traits != NULL); + CGAL_assertion(traits != nullptr); CGAL_assertion(traits->is_active(m_cur_item)); //m_cur_item should be a trapezoid or an edge CGAL_assertion(!traits->is_td_vertex(m_cur_item)); @@ -342,7 +342,7 @@ public: Td_active_edge e (boost::get(m_cur_item)); CGAL_assertion_code(Dag_node* tt = e.dag_node();) - CGAL_assertion(tt != NULL); + CGAL_assertion(tt != nullptr); CGAL_assertion(tt->is_inner_node()); //go to next() of the current edge. @@ -654,12 +654,12 @@ public: Dag_node* operator()(Td_nothing& /* t */) const { CGAL_assertion(false); - return NULL; + return nullptr; } Dag_node* operator()(Td_inactive_trapezoid& /* t */) const { CGAL_assertion(false); - return NULL; + return nullptr; } template < typename T > @@ -985,7 +985,7 @@ protected: const X_monotone_curve_2& cv, Comparison_result cres) const { - CGAL_assertion(traits != NULL); + CGAL_assertion(traits != nullptr); Td_map_item& item = left_cv_end_node.get_data(); CGAL_precondition(traits->is_td_vertex(item)); CGAL_precondition (are_equal_end_points(Curve_end(cv,ARR_MIN_END), @@ -1359,13 +1359,13 @@ public: // const Dag_node* child; // CGAL_assertion(tr_copy); // tr_copy->set_rt(cur->rt() ? - // htr.find(cur->rt())->second : NULL); + // htr.find(cur->rt())->second : nullptr); // tr_copy->set_rb(cur->rb() ? - // htr.find(cur->rb())->second : NULL); + // htr.find(cur->rb())->second : nullptr); // tr_copy->set_lt(cur->lt() ? - // htr.find(cur->lt())->second : NULL); + // htr.find(cur->lt())->second : nullptr); // tr_copy->set_lb(cur->lb() ? - // htr.find(cur->lb())->second : NULL); + // htr.find(cur->lb())->second : nullptr); // if (cur->dag_node()->is_inner_node()) // { @@ -1391,7 +1391,7 @@ public: */ virtual ~Trapezoidal_decomposition_2() { - CGAL_warning(m_dag_root != NULL); + CGAL_warning(m_dag_root != nullptr); if (!m_dag_root) return; delete m_dag_root; @@ -1616,7 +1616,7 @@ public: //the actual locate. curr is the DAG root, the traits, //the end point to locate, - //and NULL as cv ptr - indicates point location + //and nullptr as cv ptr - indicates point location lt = search_using_dag (curr, traits, ce, Halfedge_const_handle()); #ifdef CGAL_TD_DEBUG @@ -1646,7 +1646,7 @@ public: // locate call may change the class Td_map_item& locate( Vertex_const_handle v, Locate_type& lt) const { - CGAL_precondition(traits != NULL); + CGAL_precondition(traits != nullptr); return locate(traits->vtx_to_ce(v), lt); } diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Trapezoidal_decomposition_2_impl.h b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Trapezoidal_decomposition_2_impl.h index b85c6fa5dc5..715a9e74d7e 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Trapezoidal_decomposition_2_impl.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_point_location/Trapezoidal_decomposition_2_impl.h @@ -278,7 +278,7 @@ split_trapezoid_by_halfedge(Dag_node& split_node, Td_map_item& prev_top_tr, Halfedge_const_handle he) { - CGAL_warning(traits != NULL); + CGAL_warning(traits != nullptr); CGAL_precondition(traits->is_active(split_node.get_data())); CGAL_precondition(traits->is_td_trapezoid(split_node.get_data())); @@ -397,7 +397,7 @@ update_vtx_with_new_edge(Halfedge_const_handle he, const Locate_type& CGAL_precondition_code(lt)) { - CGAL_assertion(traits != NULL); + CGAL_assertion(traits != nullptr); CGAL_precondition(lt == POINT); CGAL_precondition(traits->is_active(vtx_item)); @@ -441,7 +441,7 @@ insert_curve_at_vtx_using_dag(Halfedge_const_handle he, Dag_node* node = boost::apply_visitor(dag_node_visitor(), item); - CGAL_assertion(node != NULL); + CGAL_assertion(node != nullptr); CGAL_assertion(he != m_empty_he_handle); @@ -998,7 +998,7 @@ search_using_dag(Dag_node& curr_node, Comparison_result up /*=EQUAL*/) const { if (he == m_empty_he_handle) - return search_using_dag_with_cv(curr_node,traits,ce,NULL, up); + return search_using_dag_with_cv(curr_node,traits,ce,nullptr, up); else return search_using_dag_with_cv(curr_node,traits,ce,&he->curve(), up); } @@ -1377,7 +1377,7 @@ typename Trapezoidal_decomposition_2::Dag_node Trapezoidal_decomposition_2:: container2dag(Nodes_map& ar, int left, int right, int& num_of_new_nodes) const { - CGAL_warning(traits != NULL); + CGAL_warning(traits != nullptr); if (right > left) { int d = (int)std::floor((double(right+left))/2); @@ -1414,7 +1414,7 @@ container2dag(Nodes_map& ar, int left, int right, int& num_of_new_nodes) const //curr_node.right_child()->set_dag_node(&curr_node.right_child()); //curr_node->set_dag_node(&curr_node);// fake temporary node deactivate_vertex(curr_node); //curr_node->remove(); // mark as deleted - boost::apply_visitor(set_dag_node_visitor((Dag_node*)NULL), + boost::apply_visitor(set_dag_node_visitor((Dag_node*)nullptr), curr_node.get_data());//curr_node->set_dag_node(0); return curr_node; @@ -1462,7 +1462,7 @@ Trapezoidal_decomposition_2::insert(Halfedge_const_handle he) // locate the input Halfedge end points in the Td_map_item Dag - CGAL_assertion(traits != NULL); + CGAL_assertion(traits != nullptr); //get the two vertices of the halfedge Vertex_const_handle v1 = @@ -1565,7 +1565,7 @@ Trapezoidal_decomposition_2::insert(Halfedge_const_handle he) } first_time = false; - CGAL_assertion(node != NULL); + CGAL_assertion(node != nullptr); split_trapezoid_by_halfedge(*node, old_e, old_bottom_tr, old_top_tr, he); if (node->is_inner_node()) { @@ -1644,7 +1644,7 @@ void Trapezoidal_decomposition_2::remove(Halfedge_const_handle he) locate_opt_empty(); #endif - CGAL_warning(traits != NULL); + CGAL_warning(traits != nullptr); //calculating leftmost and rightmost curve ends of he const Curve_end leftmost(he, ARR_MIN_END); @@ -1663,8 +1663,8 @@ void Trapezoidal_decomposition_2::remove(Halfedge_const_handle he) if (lt1 != POINT || lt2 != POINT) return; - CGAL_warning(boost::apply_visitor(dag_node_visitor(), p1_item) != NULL); - CGAL_warning(boost::apply_visitor(dag_node_visitor(), p2_item) != NULL); + CGAL_warning(boost::apply_visitor(dag_node_visitor(), p1_item) != nullptr); + CGAL_warning(boost::apply_visitor(dag_node_visitor(), p2_item) != nullptr); //retrieve the Dag_nodes of the two point-degenerate trapezoid Dag_node& p1_node = *(boost::apply_visitor(dag_node_visitor(), p1_item)); @@ -1883,7 +1883,7 @@ void Trapezoidal_decomposition_2::remove(Halfedge_const_handle he) removed_cv_ptr(new X_monotone_curve_2(he->curve())); Base_map_item_iterator last_edge_fragment_it = mid_it; //Base_trapezoid_iterator last_mid = mid_it; - Dag_node* e_node = NULL; + Dag_node* e_node = nullptr; while (!!++mid_it) { e_node = boost::apply_visitor(dag_node_visitor(),*last_edge_fragment_it); deactivate_edge(removed_cv_ptr,*e_node); //last_mid->remove(); @@ -2023,7 +2023,7 @@ vertical_ray_shoot(const Point & p,Locate_type & lt, // // if (!traits) // { -// CGAL_warning(traits != NULL); +// CGAL_warning(traits != nullptr); // return; // } // if (!traits->are_mergeable_2_object()(cv1,cv2)) @@ -2040,7 +2040,7 @@ vertical_ray_shoot(const Point & p,Locate_type & lt, // std::cerr << "\ncv1 " << cv1; // std::cerr << "\ncv1 " << cv2 << std::endl; // } -// CGAL_precondition(traits != NULL); +// CGAL_precondition(traits != nullptr); // CGAL_precondition(traits->are_mergeable_2_object()(cv1,cv2)); // //#endif @@ -2101,8 +2101,8 @@ vertical_ray_shoot(const Point & p,Locate_type & lt, // // CGAL_precondition(lt1==POINT && lt2==POINT); // CGAL_precondition(t1.is_active() && t2.is_active()); -// CGAL_warning(t1.dag_node() != NULL); -// CGAL_warning(t2.dag_node() != NULL); +// CGAL_warning(t1.dag_node() != nullptr); +// CGAL_warning(t2.dag_node() != nullptr); // //#endif // m_before_split.m_cv_before_split = cv; @@ -2221,8 +2221,8 @@ vertical_ray_shoot(const Point & p,Locate_type & lt, // // //define the left halfedge and the right halfedge, according // // to the splitting point -// //Halfedge_const_handle* p_left_he = NULL; -// //Halfedge_const_handle* p_right_he = NULL; +// //Halfedge_const_handle* p_left_he = nullptr; +// //Halfedge_const_handle* p_right_he = nullptr; // Halfedge_const_handle left_he = he2; // Halfedge_const_handle right_he = he1; // @@ -2592,7 +2592,7 @@ merge_edge(Halfedge_const_handle he1, const X_monotone_curve_2& cv2 = he2->curve(); if (!traits) { - CGAL_warning(traits != NULL); + CGAL_warning(traits != nullptr); return; } if (!traits->are_mergeable_2_object() (cv1, cv2)) { @@ -2645,10 +2645,10 @@ merge_edge(Halfedge_const_handle he1, Td_map_item rightp_item = locate(rightmost, lt2); Td_map_item mrgp_item = locate(ce, lt); - //varifying that all trapezoids are not NULL and are of type POINT - CGAL_warning(boost::apply_visitor(dag_node_visitor(), leftp_item) != NULL); - CGAL_warning(boost::apply_visitor(dag_node_visitor(), rightp_item)!= NULL); - CGAL_warning(boost::apply_visitor(dag_node_visitor(), mrgp_item) != NULL); + //varifying that all trapezoids are not nullptr and are of type POINT + CGAL_warning(boost::apply_visitor(dag_node_visitor(), leftp_item) != nullptr); + CGAL_warning(boost::apply_visitor(dag_node_visitor(), rightp_item)!= nullptr); + CGAL_warning(boost::apply_visitor(dag_node_visitor(), mrgp_item) != nullptr); //define the left curve and the right curve, according // to the common point (that is merged) @@ -2832,7 +2832,7 @@ longest_query_path_length_rec(bool minus_inf, Dag_node& min_node, bool plus_inf, Dag_node& max_node, Dag_node& node) { - //if NULL + //if nullptr if (node.is_null()) return 0; //if not valid range or empty return 0 diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_polycurve_traits_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_polycurve_traits_2.h index ba5c3a9b30b..21601f4605a 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_polycurve_traits_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_polycurve_traits_2.h @@ -849,7 +849,7 @@ public: for (size_t i = 0; i < int_seg.size(); ++i) { const X_monotone_subcurve_2* x_seg = CGAL::object_cast (&(int_seg[i])); - if (x_seg != NULL) { + if (x_seg != nullptr) { X_monotone_subcurve_2 seg = *x_seg; // If for some reason the subcurve intersection @@ -861,7 +861,7 @@ public: const Point_2_pair* p_ptr = CGAL::object_cast(&(int_seg[i])); - if (p_ptr != NULL) { + if (p_ptr != nullptr) { // Any point that is not equal to the max_vertex of the // subcurve should be inserted into oi. // The max_vertex of the current subcurve (if intersecting) diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_rat_arc/Cache.h b/Arrangement_on_surface_2/include/CGAL/Arr_rat_arc/Cache.h index aec75ad25f8..ab22374915e 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_rat_arc/Cache.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_rat_arc/Cache.h @@ -108,7 +108,7 @@ public: public: Cache() : - _rat_func_map_watermark(128), _rat_pair_map_watermark(128), _ak_ptr(NULL){}; + _rat_func_map_watermark(128), _rat_pair_map_watermark(128), _ak_ptr(nullptr){}; void initialize(Algebraic_kernel_d_1* ak_ptr) { @@ -165,7 +165,7 @@ public: const Rational_function& get_rational_function(const Polynomial_1& numer, const Polynomial_1& denom) const { - CGAL_precondition (_ak_ptr != NULL); + CGAL_precondition (_ak_ptr != nullptr); Rational_function_key key = get_key(numer,denom); //look if element exists in cache already @@ -204,7 +204,7 @@ public: const Rational_function_pair get_rational_pair(const Rational_function& f, const Rational_function& g) const { - CGAL_precondition (_ak_ptr != NULL); + CGAL_precondition (_ak_ptr != nullptr); CGAL_precondition(!(f==g)); Rational_function_canonicalized_pair_key key = get_key(f,g); bool is_opposite = (f.id() < g.id()) ? false : true ; diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_rat_arc/Rational_function.h b/Arrangement_on_surface_2/include/CGAL/Arr_rat_arc/Rational_function.h index 96e57b266bf..a28df2d8d6d 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_rat_arc/Rational_function.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_rat_arc/Rational_function.h @@ -47,7 +47,7 @@ public: typedef typename Base::Solve_1 Solve_1; public: - Rational_function_rep() : _ak_ptr(NULL){} + Rational_function_rep() : _ak_ptr(nullptr){} Rational_function_rep(const Polynomial_1& numer, const Polynomial_1& denom, Algebraic_kernel_d_1* ak_ptr): @@ -117,7 +117,7 @@ public: private: void initialize() { - CGAL_precondition(_ak_ptr != NULL); + CGAL_precondition(_ak_ptr != nullptr); CGAL_precondition(CGAL::is_zero(_denom) == false); if (CGAL::is_zero(_numer)) { diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_rat_arc/Rational_function_canonicalized_pair.h b/Arrangement_on_surface_2/include/CGAL/Arr_rat_arc/Rational_function_canonicalized_pair.h index 4610f48ef75..e4a4a261646 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_rat_arc/Rational_function_canonicalized_pair.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_rat_arc/Rational_function_canonicalized_pair.h @@ -59,7 +59,7 @@ public: Algebraic_kernel_d_1* ak_ptr) :_f(f),_g(g),_ak_ptr(ak_ptr) { - CGAL_precondition(_ak_ptr != NULL); + CGAL_precondition(_ak_ptr != nullptr); //canonicalized representation if ( !(f.id() < g.id()) ) std::swap(_f,_g); diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_rat_arc/Singleton.h b/Arrangement_on_surface_2/include/CGAL/Arr_rat_arc/Singleton.h index dbbb0d264ff..ceb4e38defe 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_rat_arc/Singleton.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_rat_arc/Singleton.h @@ -39,14 +39,14 @@ public: { if(!m_pInstance) m_pInstance = new T; - CGAL_assertion(m_pInstance !=NULL); + CGAL_assertion(m_pInstance !=nullptr); return m_pInstance; } static void DestroyInstance() { delete m_pInstance; - m_pInstance = NULL; + m_pInstance = nullptr; }; private: Singleton(); // ctor hidden @@ -55,7 +55,7 @@ private: static T* m_pInstance; }; -template T* Singleton::m_pInstance=NULL; +template T* Singleton::m_pInstance=nullptr; } // namespace Arr_rational_arc } //namespace CGAL { diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_segment_traits_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_segment_traits_2.h index a2d3eab19c7..9fd2aaa6da1 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_segment_traits_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_segment_traits_2.h @@ -766,7 +766,7 @@ public: // Check if we have a single intersection point. const Point_2 *ip = object_cast (&obj); - if (ip != NULL) { + if (ip != nullptr) { // Check if the intersection point ip lies on both segments. const bool ip_on_cv1 = cv1.is_vertical() ? cv1.is_in_y_range(*ip) : cv1.is_in_x_range(*ip); diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_simple_point_location.h b/Arrangement_on_surface_2/include/CGAL/Arr_simple_point_location.h index b6dfc3ecc52..5e9b6c9b43c 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_simple_point_location.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_simple_point_location.h @@ -96,9 +96,9 @@ protected: public: /*! Default constructor. */ Arr_simple_point_location() : - m_arr(NULL), - m_geom_traits(NULL), - m_topol_traits(NULL) + m_arr(nullptr), + m_geom_traits(nullptr), + m_topol_traits(nullptr) {} /*! Constructor given an arrangement. */ @@ -122,9 +122,9 @@ public: /*! Detach from the current arrangement object. */ void detach() { - m_arr = NULL; - m_geom_traits = NULL; - m_topol_traits = NULL; + m_arr = nullptr; + m_geom_traits = nullptr; + m_topol_traits = nullptr; } /*! diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_spherical_gaussian_map_3/Arr_polyhedral_sgm.h b/Arrangement_on_surface_2/include/CGAL/Arr_spherical_gaussian_map_3/Arr_polyhedral_sgm.h index 8a57cd28808..2989d7c98f9 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_spherical_gaussian_map_3/Arr_polyhedral_sgm.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_spherical_gaussian_map_3/Arr_polyhedral_sgm.h @@ -524,7 +524,7 @@ public: /*! Constructor */ Arr_polyhedral_sgm_initializer(PolyhedralSgm& sgm) : Base(sgm), - m_visitor(NULL), + m_visitor(nullptr), m_marked_vertex_index(0), m_marked_edge_index(0), m_marked_facet_index(0) @@ -538,7 +538,7 @@ public: * \param visitor * \pre The polyhedron polyhedron does not have coplanar facets. */ - void operator()(Polyhedron& polyhedron, Visitor* visitor = NULL) + void operator()(Polyhedron& polyhedron, Visitor* visitor = nullptr) { #if 0 std::copy(polyhedron.points_begin(), polyhedron.points_end(), @@ -568,7 +568,7 @@ public: const CoordIndexIter indices_begin, const CoordIndexIter indices_end, size_type num_facets, - Visitor* visitor = NULL) + Visitor* visitor = nullptr) { m_visitor = visitor; diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_spherical_gaussian_map_3/Arr_polyhedral_sgm_polyhedron_3.h b/Arrangement_on_surface_2/include/CGAL/Arr_spherical_gaussian_map_3/Arr_polyhedral_sgm_polyhedron_3.h index a9935abc1b3..699197c835d 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_spherical_gaussian_map_3/Arr_polyhedral_sgm_polyhedron_3.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_spherical_gaussian_map_3/Arr_polyhedral_sgm_polyhedron_3.h @@ -148,7 +148,7 @@ public: typedef typename Base::Plane Plane; /*! Constructor */ - Arr_polyhedral_sgm_polyhedron_3_face() : m_vertex(NULL), m_marked(false) {} + Arr_polyhedral_sgm_polyhedron_3_face() : m_vertex(nullptr), m_marked(false) {} /*! Obtain the mutable plane. Delegate */ Plane & plane() { return Base::plane(); } diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_spherical_gaussian_map_3/Arr_transform_on_sphere.h b/Arrangement_on_surface_2/include/CGAL/Arr_spherical_gaussian_map_3/Arr_transform_on_sphere.h index cf1825652c4..80cb65464f6 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_spherical_gaussian_map_3/Arr_transform_on_sphere.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_spherical_gaussian_map_3/Arr_transform_on_sphere.h @@ -213,7 +213,7 @@ void Arr_transform_on_sphere(Arrangement & arr, ind = ARR_MAX_END; // Check if it was already added. - if (topol_traits->discontinuity_vertex(havc->curve(), ind)== NULL && + if (topol_traits->discontinuity_vertex(havc->curve(), ind)== nullptr && topol_traits->south_pole() != &(*havc->target()) && topol_traits->north_pole() != &(*havc->target()) ) { diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_spherical_topology_traits_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_spherical_topology_traits_2.h index bf6412cab20..76025250e23 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_spherical_topology_traits_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_spherical_topology_traits_2.h @@ -139,7 +139,7 @@ private: //! A container of boundary vertices. struct Vertex_key_comparer { /*! Construct default */ - Vertex_key_comparer() : m_geom_traits(NULL) {} + Vertex_key_comparer() : m_geom_traits(nullptr) {} /*! Construct */ Vertex_key_comparer(const Gt_adaptor_2* geom_traits) : @@ -297,7 +297,7 @@ public: Vertex* north_pole() { return m_north_pole; } /*! Obtain a vertex on the line of discontinuity that corresponds to - * the given curve-end (or return NULL if no such vertex exists). + * the given curve-end (or return nullptr if no such vertex exists). */ Vertex* discontinuity_vertex(const X_monotone_curve_2 xc, Arr_curve_end ind) { @@ -305,7 +305,7 @@ public: m_geom_traits->construct_min_vertex_2_object()(xc) : m_geom_traits->construct_max_vertex_2_object()(xc); typename Vertex_map::iterator it = m_boundary_vertices.find(key); - return (it != m_boundary_vertices.end()) ? it->second : NULL; + return (it != m_boundary_vertices.end()) ? it->second : nullptr; } //@} @@ -546,7 +546,7 @@ public: { // There are no fictitious halfedges: CGAL_error(); - return NULL; + return nullptr; } /*! Determine whether the given face is unbounded. diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_topology_traits/Arr_bounded_planar_topology_traits_2_impl.h b/Arrangement_on_surface_2/include/CGAL/Arr_topology_traits/Arr_bounded_planar_topology_traits_2_impl.h index 3e8444062e9..84092ea4e4a 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_topology_traits/Arr_bounded_planar_topology_traits_2_impl.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_topology_traits/Arr_bounded_planar_topology_traits_2_impl.h @@ -71,7 +71,7 @@ void Arr_bounded_planar_topology_traits_2:: dcel_updated() { // Go over the DCEL faces and locate the unbounded face. - unb_face = NULL; + unb_face = nullptr; typename Dcel::Face_iterator fit = this->m_dcel.faces_begin(); for (; fit != this->m_dcel.faces_end(); ++fit) { if (fit->is_unbounded()) { @@ -79,7 +79,7 @@ dcel_updated() break; } } - CGAL_assertion(unb_face != NULL); + CGAL_assertion(unb_face != nullptr); } } // namespace CGAL diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_topology_traits/Arr_inc_insertion_zone_visitor.h b/Arrangement_on_surface_2/include/CGAL/Arr_topology_traits/Arr_inc_insertion_zone_visitor.h index 7125850b128..4d47b66e9c5 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_topology_traits/Arr_inc_insertion_zone_visitor.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_topology_traits/Arr_inc_insertion_zone_visitor.h @@ -79,8 +79,8 @@ public: /*! Constructor. */ Arr_inc_insertion_zone_visitor () : - p_arr (NULL), - geom_traits (NULL), + p_arr (nullptr), + geom_traits (nullptr), invalid_v (), invalid_he () {} diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_topology_traits/Arr_planar_topology_traits_base_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_topology_traits/Arr_planar_topology_traits_base_2.h index 59e3db12daa..dbaa6eefb1e 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_topology_traits/Arr_planar_topology_traits_base_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_topology_traits/Arr_planar_topology_traits_base_2.h @@ -110,9 +110,9 @@ public: // Clear the DCEL. m_dcel.delete_all(); - if (m_own_geom_traits && (m_geom_traits != NULL)) { + if (m_own_geom_traits && (m_geom_traits != nullptr)) { delete m_geom_traits; - m_geom_traits = NULL; + m_geom_traits = nullptr; } } //@} @@ -247,9 +247,9 @@ Arr_planar_topology_traits_base_2::assign(const Self& other) m_dcel.assign(other.m_dcel); // Take care of the traits object. - if (m_own_geom_traits && (m_geom_traits != NULL)) { + if (m_own_geom_traits && (m_geom_traits != nullptr)) { delete m_geom_traits; - m_geom_traits = NULL; + m_geom_traits = nullptr; } if (other.m_own_geom_traits) m_geom_traits = new Traits_adaptor_2; @@ -265,8 +265,8 @@ template bool Arr_planar_topology_traits_base_2:: is_in_face(const Face* f, const Point_2& p, const Vertex* v) const { - CGAL_precondition((v == NULL) || ! v->has_null_point()); - CGAL_precondition((v == NULL) || + CGAL_precondition((v == nullptr) || ! v->has_null_point()); + CGAL_precondition((v == nullptr) || m_geom_traits->equal_2_object()(p, v->point())); // In case the face is unbounded and has no outer ccbs, this is the single @@ -310,7 +310,7 @@ is_in_face(const Face* f, const Point_2& p, const Vertex* v) const do { // Compare p to the target vertex of the current halfedge. - // If the vertex v associated with p (if v is given and is not NULL) + // If the vertex v associated with p (if v is given and is not nullptr) // on the boundary of the component, p is obviously not in the interior // the component. if (curr->vertex() == v) return false; diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_topology_traits/Arr_spherical_construction_helper.h b/Arrangement_on_surface_2/include/CGAL/Arr_topology_traits/Arr_spherical_construction_helper.h index edab3a79727..943730b4ef7 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_topology_traits/Arr_spherical_construction_helper.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_topology_traits/Arr_spherical_construction_helper.h @@ -114,7 +114,7 @@ public: Arr_spherical_construction_helper(Arrangement_2* arr) : m_top_traits(arr->topology_traits()), m_arr_access(*arr), - m_he_ind_map_p(NULL) + m_he_ind_map_p(nullptr) {} /*! Destructor. */ @@ -172,7 +172,7 @@ public: */ void splice_indices_list(Halfedge_handle he) { - CGAL_assertion(m_he_ind_map_p != NULL); + CGAL_assertion(m_he_ind_map_p != nullptr); Indices_list& list_ref = (*m_he_ind_map_p)[he]; list_ref.splice(list_ref.end(), m_subcurves_at_nf); } diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_topology_traits/Arr_spherical_topology_traits_2_impl.h b/Arrangement_on_surface_2/include/CGAL/Arr_topology_traits/Arr_spherical_topology_traits_2_impl.h index 3fbba7dd92b..5e6f978fb94 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_topology_traits/Arr_spherical_topology_traits_2_impl.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_topology_traits/Arr_spherical_topology_traits_2_impl.h @@ -36,9 +36,9 @@ namespace CGAL { template Arr_spherical_topology_traits_2:: Arr_spherical_topology_traits_2() : - m_spherical_face(NULL), - m_north_pole(NULL), - m_south_pole(NULL), + m_spherical_face(nullptr), + m_north_pole(nullptr), + m_south_pole(nullptr), m_own_geom_traits(true) { m_geom_traits = new Gt_adaptor_2; @@ -49,9 +49,9 @@ Arr_spherical_topology_traits_2() : template Arr_spherical_topology_traits_2:: Arr_spherical_topology_traits_2(const Geometry_traits_2* traits) : - m_spherical_face(NULL), - m_north_pole(NULL), - m_south_pole(NULL), + m_spherical_face(nullptr), + m_north_pole(nullptr), + m_south_pole(nullptr), m_own_geom_traits(false) { m_geom_traits = static_cast(traits); @@ -66,9 +66,9 @@ Arr_spherical_topology_traits_2:: // Clear the DCEL. m_dcel.delete_all(); - if (m_own_geom_traits && (m_geom_traits != NULL)) { + if (m_own_geom_traits && (m_geom_traits != nullptr)) { delete m_geom_traits; - m_geom_traits = NULL; + m_geom_traits = nullptr; } } @@ -82,9 +82,9 @@ assign(const Self& other) m_dcel.assign(other.m_dcel); // Take care of the traits object. - if (m_own_geom_traits && m_geom_traits != NULL) { + if (m_own_geom_traits && m_geom_traits != nullptr) { delete m_geom_traits; - m_geom_traits = NULL; + m_geom_traits = nullptr; } if (other.m_own_geom_traits) { @@ -109,8 +109,8 @@ void Arr_spherical_topology_traits_2::dcel_updated() // Go over the DCEL vertices and locate the south and north pole (if any) // and any other vertex on the line of discontinuity. - m_north_pole = NULL; - m_south_pole = NULL; + m_north_pole = nullptr; + m_south_pole = nullptr; m_boundary_vertices.clear(); typename Dcel::Vertex_iterator vit = this->m_dcel.vertices_begin(); @@ -129,17 +129,17 @@ void Arr_spherical_topology_traits_2::dcel_updated() // Go over the DCEL faces and locate the spherical face, which is the only // face with no outer CCB. - m_spherical_face = NULL; + m_spherical_face = nullptr; typename Dcel::Face_iterator fit = this->m_dcel.faces_begin(); for (; fit != this->m_dcel.faces_end(); ++fit) { if (fit->number_of_outer_ccbs() == 0) { - CGAL_assertion(m_spherical_face == NULL); + CGAL_assertion(m_spherical_face == nullptr); m_spherical_face = &(*fit); break; } } - CGAL_assertion(m_spherical_face != NULL); + CGAL_assertion(m_spherical_face != nullptr); } /*! \brief initializes an empty DCEL structure. */ @@ -156,8 +156,8 @@ void Arr_spherical_topology_traits_2::init_dcel() m_spherical_face->set_unbounded(false); m_spherical_face->set_fictitious(false); - m_north_pole = NULL; - m_south_pole = NULL; + m_north_pole = nullptr; + m_south_pole = nullptr; } /*! \brief determines whether a point lies in the interior of a given face. */ @@ -166,8 +166,8 @@ bool Arr_spherical_topology_traits_2:: is_in_face(const Face* f, const Point_2& p, const Vertex* v) const { // std::cout << "is_in_face()" << std::endl; - CGAL_precondition((v == NULL) || !v->has_null_point()); - CGAL_precondition((v == NULL) || + CGAL_precondition((v == nullptr) || !v->has_null_point()); + CGAL_precondition((v == nullptr) || m_geom_traits->equal_2_object()(p, v->point())); /* There is always one face that contains everything else. It has no @@ -183,12 +183,12 @@ is_in_face(const Face* f, const Point_2& p, const Vertex* v) const << std::endl; #endif if (f->number_of_outer_ccbs() == 0) return true; - if (((v != NULL) && (v->parameter_space_in_y() == ARR_TOP_BOUNDARY)) || + if (((v != nullptr) && (v->parameter_space_in_y() == ARR_TOP_BOUNDARY)) || (m_geom_traits->parameter_space_in_y_2_object()(p) == ARR_TOP_BOUNDARY)) return false; /*! \todo a temporary test - * if (((v != NULL) && (v->parameter_space_in_y() == ARR_BOTTOM_BOUNDARY)) || + * if (((v != nullptr) && (v->parameter_space_in_y() == ARR_BOTTOM_BOUNDARY)) || * (p.is_min_boundary())) * return false; */ @@ -536,12 +536,12 @@ place_boundary_vertex(Face* /* f */, { // std::cout << "place_boundary_vertex()" << std::endl; if (ps_y == ARR_BOTTOM_BOUNDARY) { - if (m_south_pole == NULL) return Object(); + if (m_south_pole == nullptr) return Object(); return CGAL::make_object(m_south_pole); } if (ps_y == ARR_TOP_BOUNDARY) { - if (m_north_pole == NULL) return Object(); + if (m_north_pole == nullptr) return Object(); return CGAL::make_object(m_north_pole); } @@ -608,18 +608,18 @@ locate_curve_end(const X_monotone_curve_2& xc, Arr_curve_end ind, // In case the curve end coincides with the north pole, return the vertex // representing the north pole, if one exists. Otherwise, return the face // containing this pole (the spherical face). - if (m_north_pole != NULL) return CGAL::make_object(m_north_pole); + if (m_north_pole != nullptr) return CGAL::make_object(m_north_pole); return CGAL::make_object(m_spherical_face); } typename Vertex_map::iterator it; - Vertex* v = NULL; + Vertex* v = nullptr; if (ps_y == ARR_BOTTOM_BOUNDARY) { // In case the curve end coincides with the south pole, return the vertex // representing the south pole, if one exists. Otherwise, search for the // face containing this pole. - if (m_south_pole != NULL) return CGAL::make_object(m_south_pole); + if (m_south_pole != nullptr) return CGAL::make_object(m_south_pole); it = m_boundary_vertices.begin(); } else { @@ -655,7 +655,7 @@ locate_curve_end(const X_monotone_curve_2& xc, Arr_curve_end ind, template bool Arr_spherical_topology_traits_2:: is_redundant(const Vertex* v) const -{ return (v->halfedge() == NULL); } +{ return (v->halfedge() == nullptr); } /* \brief erases a given redundant vertex */ template @@ -665,17 +665,17 @@ erase_redundant_vertex(Vertex* v) { const Arr_parameter_space ps_y = v->parameter_space_in_y(); if (ps_y == ARR_BOTTOM_BOUNDARY) { - m_south_pole = NULL; - return NULL; + m_south_pole = nullptr; + return nullptr; } if (ps_y == ARR_TOP_BOUNDARY) { - m_north_pole = NULL; - return NULL; + m_north_pole = nullptr; + return nullptr; } CGAL_assertion_code(Arr_parameter_space ps_x = v->parameter_space_in_x()); CGAL_assertion(ps_x != ARR_INTERIOR); m_boundary_vertices.erase(v->point()); - return NULL; + return nullptr; } /*! \brief obtains the curve associated with a boundary vertex */ @@ -703,12 +703,12 @@ _locate_around_vertex_on_discontinuity(Vertex* v, Arr_curve_end ind) const { // If the vertex is isolated, there is no predecssor halfedge. - if (v->is_isolated()) return NULL; + if (v->is_isolated()) return nullptr; // Get the first incident halfedge around v and the next halfedge. Halfedge* first = v->halfedge(); Halfedge* curr = first; - CGAL_assertion(curr != NULL); + CGAL_assertion(curr != nullptr); Halfedge* next = curr->next()->opposite(); // If is only one halfedge incident to v, return this halfedge as xc's @@ -756,12 +756,12 @@ _locate_around_pole(Vertex* v, // std::cout << "locate_around_pole() " << ind << std::endl; // If the vertex is isolated, return a null halfedge: - if (v->is_isolated()) return NULL; + if (v->is_isolated()) return nullptr; // Get the first incident halfedge around v and the next halfedge: Halfedge* first = v->halfedge(); Halfedge* curr = first; - CGAL_assertion(curr != NULL); + CGAL_assertion(curr != nullptr); Halfedge* next = curr->next()->opposite(); // If there is only one halfedge, it is the predecessor, return it: @@ -809,7 +809,7 @@ _locate_around_pole(Vertex* v, // We sould never reach here: CGAL_error(); - return NULL; + return nullptr; } /*! \brief Return the face that lies below the given vertex, which lies @@ -826,7 +826,7 @@ _face_below_vertex_on_discontinuity(Vertex* v) const // Get the first incident halfedge around v and the next halfedge. Halfedge* first = v->halfedge(); Halfedge* curr = first; - CGAL_assertion(curr != NULL); + CGAL_assertion(curr != nullptr); Halfedge* next = curr->next()->opposite(); // If there is only one halfedge incident to v, return its incident face. @@ -842,8 +842,8 @@ _face_below_vertex_on_discontinuity(Vertex* v) const typename Gt_adaptor_2::Compare_y_at_x_left_2 cmp_y_at_x_op_left = m_geom_traits->compare_y_at_x_left_2_object(); - Halfedge* lowest_left = NULL; - Halfedge* top_right = NULL; + Halfedge* lowest_left = nullptr; + Halfedge* top_right = nullptr; do { // Check whether the current halfedge is defined to the left or to the @@ -851,7 +851,7 @@ _face_below_vertex_on_discontinuity(Vertex* v) const if (curr->direction() == ARR_LEFT_TO_RIGHT) { // The curve associated with the current halfedge is defined to the left // of v. - if (lowest_left == NULL || + if (lowest_left == nullptr || cmp_y_at_x_op_left(curr->curve(), lowest_left->curve(), v->point()) == SMALLER) { @@ -861,7 +861,7 @@ _face_below_vertex_on_discontinuity(Vertex* v) const else { // The curve associated with the current halfedge is defined to the right // of v. - if (top_right == NULL || + if (top_right == nullptr || cmp_y_at_x_op_right(curr->curve(), top_right->curve(), v->point()) == LARGER) { @@ -878,7 +878,7 @@ _face_below_vertex_on_discontinuity(Vertex* v) const // right. Note that as the halfedge we located has v as its target, we now // have to return its twin. first = - (lowest_left != NULL) ? lowest_left->opposite() : top_right->opposite(); + (lowest_left != nullptr) ? lowest_left->opposite() : top_right->opposite(); // std::cout << "first: " << first->opposite()->vertex()->point() << " => " // << first->vertex()->point() << std::endl; diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_topology_traits/Arr_spherical_vert_decomp_helper.h b/Arrangement_on_surface_2/include/CGAL/Arr_topology_traits/Arr_spherical_vert_decomp_helper.h index a4c3067172d..849f6ba9935 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_topology_traits/Arr_spherical_vert_decomp_helper.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_topology_traits/Arr_spherical_vert_decomp_helper.h @@ -114,14 +114,14 @@ public: void Arr_spherical_vert_decomp_helper::before_sweep() { // Get the north pole and the face that intially contains it. - m_valid_north_pole = (m_top_traits->north_pole() != NULL); + m_valid_north_pole = (m_top_traits->north_pole() != nullptr); if (m_valid_north_pole) m_north_pole = Vertex_const_handle (m_top_traits->north_pole()); m_north_face = Face_const_handle (m_top_traits->spherical_face()); // Get the south pole and the face that intially contains it. - m_valid_south_pole = (m_top_traits->south_pole() != NULL); + m_valid_south_pole = (m_top_traits->south_pole() != nullptr); if (m_valid_south_pole) m_south_pole = Vertex_const_handle (m_top_traits->south_pole()); diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_topology_traits/Arr_unb_planar_construction_helper.h b/Arrangement_on_surface_2/include/CGAL/Arr_topology_traits/Arr_unb_planar_construction_helper.h index d544d8ab8ef..6212260a673 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_topology_traits/Arr_unb_planar_construction_helper.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_topology_traits/Arr_unb_planar_construction_helper.h @@ -116,9 +116,9 @@ public: Arr_unb_planar_construction_helper(Arrangement_2* arr) : m_top_traits(arr->topology_traits()), m_arr_access(*arr), - m_prev_minus_inf_x_event(NULL), - m_prev_plus_inf_y_event(NULL), - m_he_ind_map_p(NULL) + m_prev_minus_inf_x_event(nullptr), + m_prev_plus_inf_y_event(nullptr), + m_he_ind_map_p(nullptr) {} /*! Destructor. */ @@ -155,7 +155,7 @@ public: // The last event at y = +oo may be deallocated if it has no incident // right subcurves, so we should not keep a pointer to it. if (event == m_prev_plus_inf_y_event) - m_prev_plus_inf_y_event = NULL; + m_prev_plus_inf_y_event = nullptr; } //@} @@ -278,7 +278,7 @@ before_handle_event(Event* event) // Update the incident halfedge of the previous vertex at x = -oo // (m_lh used to be incident to it, but now we have split it). - if (m_prev_minus_inf_x_event != NULL) + if (m_prev_minus_inf_x_event != nullptr) m_prev_minus_inf_x_event->set_halfedge_handle(m_lh->next()); m_prev_minus_inf_x_event = event; return; @@ -311,13 +311,13 @@ before_handle_event(Event* event) // Update the incident halfedge of the previous vertex at y = +oo // (m_th used to be incident to it, but now we have split it). - if (m_prev_plus_inf_y_event != NULL) + if (m_prev_plus_inf_y_event != nullptr) m_prev_plus_inf_y_event->set_halfedge_handle(m_th->next()); m_prev_plus_inf_y_event = event; // Associate all curve indices of subcurves that "see" m_th from // below with the left portion of the split halfedge (m_th->next()). - if (m_he_ind_map_p != NULL) + if (m_he_ind_map_p != nullptr) { Indices_list& list_ref = (*m_he_ind_map_p)[m_th->next()]; list_ref.clear(); diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_topology_traits/Arr_unb_planar_insertion_helper.h b/Arrangement_on_surface_2/include/CGAL/Arr_topology_traits/Arr_unb_planar_insertion_helper.h index 0e39819d2dd..529e4e3bed5 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_topology_traits/Arr_unb_planar_insertion_helper.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_topology_traits/Arr_unb_planar_insertion_helper.h @@ -187,7 +187,7 @@ before_handle_event(Event* event) if (ps_x == ARR_LEFT_BOUNDARY) { // The event lies on the left fictitious halfedge. this->m_lh = this->m_lh->twin()->next()->twin(); - this->m_prev_minus_inf_x_event = NULL; + this->m_prev_minus_inf_x_event = nullptr; } else if (ps_x == ARR_RIGHT_BOUNDARY) { // The event lies on the right fictitious halfedge. @@ -204,7 +204,7 @@ before_handle_event(Event* event) // The event lies on the top fictitious halfedge. CGAL_assertion (ps_y == ARR_TOP_BOUNDARY); this->m_th = this->m_th->twin()->next()->twin(); - this->m_prev_plus_inf_y_event = NULL; + this->m_prev_plus_inf_y_event = nullptr; } } } diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_topology_traits/Arr_unb_planar_topology_traits_2_impl.h b/Arrangement_on_surface_2/include/CGAL/Arr_topology_traits/Arr_unb_planar_topology_traits_2_impl.h index caa5a6dc9e6..e0baac1bd89 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_topology_traits/Arr_unb_planar_topology_traits_2_impl.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_topology_traits/Arr_unb_planar_topology_traits_2_impl.h @@ -40,12 +40,12 @@ template Arr_unb_planar_topology_traits_2:: Arr_unb_planar_topology_traits_2(): Base(), - v_bl(NULL), - v_tl(NULL), - v_br(NULL), - v_tr(NULL), + v_bl(nullptr), + v_tl(nullptr), + v_br(nullptr), + v_tr(nullptr), n_inf_verts(0), - fict_face(NULL) + fict_face(nullptr) {} //----------------------------------------------------------------------------- @@ -55,12 +55,12 @@ template Arr_unb_planar_topology_traits_2:: Arr_unb_planar_topology_traits_2 (const Geometry_traits_2 * geom_traits) : Base (geom_traits), - v_bl (NULL), - v_tl (NULL), - v_br (NULL), - v_tr (NULL), + v_bl (nullptr), + v_tl (nullptr), + v_br (nullptr), + v_tr (nullptr), n_inf_verts (0), - fict_face (NULL) + fict_face (nullptr) {} //----------------------------------------------------------------------------- @@ -89,7 +89,7 @@ void Arr_unb_planar_topology_traits_2::dcel_updated () typename Dcel::Vertex_iterator vit; Halfedge *first_he, *next_he; - v_bl = v_tl = v_br = v_tr = NULL; + v_bl = v_tl = v_br = v_tr = nullptr; n_inf_verts = 0; for (vit = this->m_dcel.vertices_begin(); vit != this->m_dcel.vertices_end(); ++vit) @@ -123,23 +123,23 @@ void Arr_unb_planar_topology_traits_2::dcel_updated () CGAL_error(); } } - CGAL_assertion(v_bl != NULL && v_tl != NULL && v_br != NULL && v_tr != NULL); + CGAL_assertion(v_bl != nullptr && v_tl != nullptr && v_br != nullptr && v_tr != nullptr); // Go over the DCEL faces and locate the fictitious face. typename Dcel::Face_iterator fit; - fict_face = NULL; + fict_face = nullptr; for (fit = this->m_dcel.faces_begin(); fit != this->m_dcel.faces_end(); ++fit) { if (fit->is_fictitious()) { - CGAL_assertion (fict_face == NULL); + CGAL_assertion (fict_face == nullptr); fict_face = &(*fit); } } - CGAL_assertion (fict_face != NULL); + CGAL_assertion (fict_face != nullptr); return; } @@ -200,10 +200,10 @@ void Arr_unb_planar_topology_traits_2::init_dcel () Inner_ccb *ic = this->m_dcel.new_inner_ccb(); Face *in_f = this->m_dcel.new_face(); - he1->set_curve (NULL); - he2->set_curve (NULL); - he3->set_curve (NULL); - he4->set_curve (NULL); + he1->set_curve (nullptr); + he2->set_curve (nullptr); + he3->set_curve (nullptr); + he4->set_curve (nullptr); he1->set_next (he2); he1_t->set_next (he4_t); he2->set_next (he3); he4_t->set_next (he3_t); @@ -272,7 +272,7 @@ are_equal(const Vertex *v, Arr_curve_end v_ind; const X_monotone_curve_2 *v_cv = _curve (v, v_ind); - if (v_cv == NULL) + if (v_cv == nullptr) return (v->parameter_space_in_x() == ps_x && v->parameter_space_in_y() == ps_y); @@ -287,7 +287,7 @@ are_equal(const Vertex *v, Arr_curve_end v_ind; const X_monotone_curve_2 *v_cv = _curve (v, v_ind); - if (v_cv == NULL) + if (v_cv == nullptr) return (v->parameter_space_in_x() == ARR_INTERIOR && v->parameter_space_in_y() == ps_y); @@ -555,23 +555,23 @@ erase_redundant_vertex (Vertex *v) // Keep pointers to the components that contain two halfedges he3 and he2, // pointing at the end vertices of the merged halfedge. - Inner_ccb *ic1 = (he3->is_on_inner_ccb()) ? he3->inner_ccb() : NULL; - Outer_ccb *oc1 = (ic1 == NULL) ? he3->outer_ccb() : NULL; - Inner_ccb *ic2 = (he4->is_on_inner_ccb()) ? he4->inner_ccb() : NULL; - Outer_ccb *oc2 = (ic2 == NULL) ? he4->outer_ccb() : NULL; + Inner_ccb *ic1 = (he3->is_on_inner_ccb()) ? he3->inner_ccb() : nullptr; + Outer_ccb *oc1 = (ic1 == nullptr) ? he3->outer_ccb() : nullptr; + Inner_ccb *ic2 = (he4->is_on_inner_ccb()) ? he4->inner_ccb() : nullptr; + Outer_ccb *oc2 = (ic2 == nullptr) ? he4->outer_ccb() : nullptr; // As he1 and he2 will evetually represent the merged edge, while he3 and he4 // will be deleted, check if the deleted halfedges are represantatives of a // face boundary or a hole inside these faces. If so, replace he3 by he1 and // he4 by he2. - if (ic1 != NULL && ic1->halfedge() == he3) + if (ic1 != nullptr && ic1->halfedge() == he3) ic1->set_halfedge (he1); - else if (oc1 != NULL && oc1->halfedge() == he3) + else if (oc1 != nullptr && oc1->halfedge() == he3) oc1->set_halfedge (he1); - if (ic2 != NULL && ic2->halfedge() == he4) + if (ic2 != nullptr && ic2->halfedge() == he4) ic2->set_halfedge (he2); - else if (oc2 != NULL && oc2->halfedge() == he4) + else if (oc2 != nullptr && oc2->halfedge() == he4) oc2->set_halfedge (he2); // If he3 is the incident halfedge to its target, replace it by he1. @@ -625,7 +625,7 @@ compare_x (const Point_2& p, const Vertex* v) const Arr_curve_end v_ind = ARR_MIN_END; const X_monotone_curve_2* v_cv = _curve (v, v_ind); - CGAL_assertion(v_cv != NULL); + CGAL_assertion(v_cv != nullptr); return (this->m_geom_traits->compare_x_point_curve_end_2_object()(p, *v_cv, v_ind)); @@ -659,7 +659,7 @@ compare_xy (const Point_2& p, const Vertex* v) const Arr_curve_end v_ind = ARR_MIN_END; const X_monotone_curve_2* v_cv = _curve (v, v_ind); - CGAL_assertion (v_cv != NULL); + CGAL_assertion (v_cv != nullptr); Comparison_result res = this->m_geom_traits->compare_x_point_curve_end_2_object() (p, *v_cv, @@ -724,7 +724,7 @@ _curve (const Vertex* v, Arr_curve_end& ind) const he = he->next()->opposite(); // No incident curve were found: - if (he == v->halfedge()) return (NULL); + if (he == v->halfedge()) return (nullptr); } // The halfedge he is directed toward v, so if it is directed from left to @@ -844,7 +844,7 @@ _is_on_fictitious_edge(const X_monotone_curve_2& cv, Arr_curve_end ind, // arrangement, but it hasn't been associated with a valid halfedge // yet, as the insertion process is still ongoing. // The comparison result in this case is trivial. - if (v_cv1 != NULL) { + if (v_cv1 != nullptr) { res1 = this->m_geom_traits->compare_x_curve_ends_2_object()(cv, ind, *v_cv1, v_ind); @@ -878,7 +878,7 @@ _is_on_fictitious_edge(const X_monotone_curve_2& cv, Arr_curve_end ind, // arrangement, but it hasn't been associated with a valid halfedge // yet, as the insertion process is still ongoing. // The comparison result in this case is trivial. - if (v_cv2 != NULL) { + if (v_cv2 != nullptr) { res2 = this->m_geom_traits->compare_x_curve_ends_2_object()(cv, ind, *v_cv2, v_ind); diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_trapezoid_ric_point_location.h b/Arrangement_on_surface_2/include/CGAL/Arr_trapezoid_ric_point_location.h index 8fcd8f42684..594e3fb0733 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_trapezoid_ric_point_location.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_trapezoid_ric_point_location.h @@ -148,7 +148,7 @@ public: Arr_trapezoid_ric_point_location (bool with_guarantees = true, double depth_thrs = CGAL_TD_DEFAULT_DEPTH_THRESHOLD, double size_thrs = CGAL_TD_DEFAULT_SIZE_THRESHOLD) - : m_traits (NULL), m_with_guarantees(with_guarantees) + : m_traits (nullptr), m_with_guarantees(with_guarantees) { td.set_with_guarantees(with_guarantees); td.depth_threshold(depth_thrs); diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_triangulation_point_location.h b/Arrangement_on_surface_2/include/CGAL/Arr_triangulation_point_location.h index 6a606cdc2ae..fa3db1291c4 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_triangulation_point_location.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_triangulation_point_location.h @@ -129,7 +129,7 @@ protected: public: /*! Default constructor. */ Arr_triangulation_point_location() : - m_traits(NULL), + m_traits(nullptr), m_ignore_notifications(false), m_ignore_remove_edge(false) {} diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_unb_planar_topology_traits_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_unb_planar_topology_traits_2.h index df288fae935..943351941ef 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_unb_planar_topology_traits_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_unb_planar_topology_traits_2.h @@ -342,7 +342,7 @@ public: Arr_parameter_space /* ps_y */) const { CGAL_error(); - return (NULL); + return (nullptr); } /*! Locate a DCEL feature that contains the given unbounded curve end. @@ -492,7 +492,7 @@ protected: * \param ind Output: ARR_MIN_END if the vertex is induced by the minimal end; * ARR_MAX_END if it is induced by the curve's maximal end. * \pre v is a valid (not fictitious) boundary. - * \return The curve that induces v, or NULL if v has no incident curves yet. + * \return The curve that induces v, or nullptr if v has no incident curves yet. */ const X_monotone_curve_2* _curve(const Vertex* v, Arr_curve_end& ind) const; diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_walk_along_line_point_location.h b/Arrangement_on_surface_2/include/CGAL/Arr_walk_along_line_point_location.h index 4f5ccf3f8eb..0e636df9252 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_walk_along_line_point_location.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_walk_along_line_point_location.h @@ -87,9 +87,9 @@ protected: public: /*! Default constructor. */ Arr_walk_along_line_point_location() : - p_arr(NULL), - geom_traits(NULL), - top_traits(NULL) + p_arr(nullptr), + geom_traits(nullptr), + top_traits(nullptr) {} /*! Constructor given an arrangement. */ @@ -113,9 +113,9 @@ public: /*! Detach from the current arrangement object. */ void detach() { - p_arr = NULL; - geom_traits = NULL; - top_traits = NULL; + p_arr = nullptr; + geom_traits = nullptr; + top_traits = nullptr; } /*! diff --git a/Arrangement_on_surface_2/include/CGAL/Arrangement_2/Arrangement_on_surface_2_global.h b/Arrangement_on_surface_2/include/CGAL/Arrangement_2/Arrangement_on_surface_2_global.h index c686a0f553c..69b9327e335 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arrangement_2/Arrangement_on_surface_2_global.h +++ b/Arrangement_on_surface_2/include/CGAL/Arrangement_2/Arrangement_on_surface_2_global.h @@ -110,7 +110,7 @@ void insert(Arrangement_on_surface_2& arr, // Act according to the type of the current object. x_curve = object_cast(&(*obj_iter)); - if (x_curve != NULL) { + if (x_curve != nullptr) { // Inserting an x-monotone curve: // Initialize the zone-computation object with the given curve. arr_zone.init(*x_curve, pl); @@ -128,7 +128,7 @@ void insert(Arrangement_on_surface_2& arr, } else { iso_p = object_cast(&(*obj_iter)); - CGAL_assertion(iso_p != NULL); + CGAL_assertion(iso_p != nullptr); // Inserting a point into the arrangement: insert_point(arr, *iso_p, pl); @@ -680,7 +680,7 @@ insert_non_intersecting_curve const Arr_parameter_space by1 = geom_traits->parameter_space_in_y_2_object()(c, ARR_MIN_END); CGAL::Object obj1; - const Vertex_const_handle* vh1 = NULL; + const Vertex_const_handle* vh1 = nullptr; if ((bx1 == ARR_INTERIOR) && (by1 == ARR_INTERIOR)) { // We have a normal left endpoint with no boundary conditions: @@ -690,7 +690,7 @@ insert_non_intersecting_curve // The endpoint must not lie on an existing edge, but may coincide with // and existing vertex vh1. CGAL_precondition_msg - (object_cast(&obj1) == NULL, + (object_cast(&obj1) == nullptr, "The curve must not intersect an existing edge."); vh1 = object_cast(&obj1); @@ -701,7 +701,7 @@ insert_non_intersecting_curve obj1 = arr_access.locate_curve_end(c, ARR_MIN_END, bx1, by1); CGAL_precondition_msg - (object_cast(&obj1) == NULL, + (object_cast(&obj1) == nullptr, "The curve must not overlap an existing edge."); vh1 = object_cast(&obj1); @@ -714,7 +714,7 @@ insert_non_intersecting_curve const Arr_parameter_space by2 = geom_traits->parameter_space_in_y_2_object()(c, ARR_MAX_END); CGAL::Object obj2; - const Vertex_const_handle* vh2 = NULL; + const Vertex_const_handle* vh2 = nullptr; if ((bx2 == ARR_INTERIOR) && (by2 == ARR_INTERIOR)) { // We have a normal right endpoint with no boundary conditions: @@ -724,7 +724,7 @@ insert_non_intersecting_curve // The endpoint must not lie on an existing edge, but may coincide with // and existing vertex vh2. CGAL_precondition_msg - (object_cast(&obj2) == NULL, + (object_cast(&obj2) == nullptr, "The curve must not intersect an existing edge."); vh2 = object_cast(&obj2); @@ -739,7 +739,7 @@ insert_non_intersecting_curve obj2 = arr_access.locate_curve_end(c, ARR_MAX_END, bx2, by2); CGAL_precondition_msg - (object_cast(&obj2) == NULL, + (object_cast(&obj2) == nullptr, "The curve must not overlap an existing edge."); vh2 = object_cast(&obj2); @@ -754,8 +754,8 @@ insert_non_intersecting_curve // accordingly. typename Arr::Halfedge_handle new_he; - if (vh1 != NULL) { - if (vh2 != NULL) { + if (vh1 != nullptr) { + if (vh2 != nullptr) { // Both endpoints are associated with a existing vertices. // In this case insert_at_vertices() already returns a halfedge // directed from left to right. @@ -772,7 +772,7 @@ insert_non_intersecting_curve } } else { - if (vh2 != NULL) { + if (vh2 != nullptr) { // Only the right endpoint is associated with an existing vertex. // In this case insert_from_left_vertex() returns a halfedge directed // to the new vertex it creates, so it is directed from right to left @@ -797,10 +797,10 @@ insert_non_intersecting_curve // << (*fh2)->number_of_outer_ccbs() << std::endl; CGAL_assertion_msg - ((fh1 != NULL) && (fh2 != NULL) && ((*fh1) == (*fh2)), + ((fh1 != nullptr) && (fh2 != nullptr) && ((*fh1) == (*fh2)), "The curve intersects the interior of existing edges."); - if ((fh1 != NULL) && (fh2 != NULL) && (*fh1 == *fh2)) { + if ((fh1 != nullptr) && (fh2 != nullptr) && (*fh1 == *fh2)) { new_he = arr.insert_in_face_interior(c, arr.non_const_handle (*fh1)); } } @@ -1164,13 +1164,13 @@ insert_point(Arrangement_on_surface_2& arr, arr_access.notify_before_global_change(); - if ((fh = object_cast(&obj)) != NULL) { + if ((fh = object_cast(&obj)) != nullptr) { // p lies inside a face: Insert it as an isolated vertex it the interior of // this face. vh_for_p = arr.insert_in_face_interior(p, arr.non_const_handle (*fh)); } else if ((hh = object_cast(&obj)) != - NULL) + nullptr) { // p lies in the interior of an edge: Split this edge to create a new // vertex associated with p. @@ -1189,7 +1189,7 @@ insert_point(Arrangement_on_surface_2& arr, // In this case p lies on an existing vertex, so we just update this // vertex. vh = object_cast(&obj); - CGAL_assertion (vh != NULL); + CGAL_assertion (vh != nullptr); vh_for_p = arr.modify_vertex (arr.non_const_handle (*vh), p); } @@ -1634,20 +1634,20 @@ do_intersect(Arrangement_on_surface_2& arr, for (obj_iter = x_objects.begin(); obj_iter != x_objects.end(); ++obj_iter) { // Act according to the type of the current object. x_curve = object_cast(&(*obj_iter)); - if (x_curve != NULL) { + if (x_curve != nullptr) { // Check if the x-monotone subcurve intersects the arrangement. if (do_intersect(arr, *x_curve, pl) == true) return true; } else { iso_p = object_cast(&(*obj_iter)); - CGAL_assertion(iso_p != NULL); + CGAL_assertion(iso_p != nullptr); // Check whether the isolated point lies inside a face (otherwise, // it conincides with a vertex or an edge). CGAL::Object obj = pl.locate (*iso_p); - return (object_cast(&obj) != NULL); + return (object_cast(&obj) != nullptr); } } diff --git a/Arrangement_on_surface_2/include/CGAL/Arrangement_2/Arrangement_on_surface_2_impl.h b/Arrangement_on_surface_2/include/CGAL/Arrangement_2/Arrangement_on_surface_2_impl.h index 4dfa5df1734..d18d5ea3756 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arrangement_2/Arrangement_on_surface_2_impl.h +++ b/Arrangement_on_surface_2/include/CGAL/Arrangement_2/Arrangement_on_surface_2_impl.h @@ -96,7 +96,7 @@ Arrangement_on_surface_2::Arrangement_on_surface_2() : template Arrangement_on_surface_2:: Arrangement_on_surface_2(const Self& arr) : - m_geom_traits(NULL), + m_geom_traits(nullptr), m_own_traits(false) { assign(arr); @@ -206,9 +206,9 @@ void Arrangement_on_surface_2::assign(const Self& arr) } // Take care of the traits object. - if (m_own_traits && (m_geom_traits != NULL)) { + if (m_own_traits && (m_geom_traits != nullptr)) { delete m_geom_traits; - m_geom_traits = NULL; + m_geom_traits = nullptr; } m_geom_traits = (arr.m_own_traits) ? new Traits_adaptor_2 : arr.m_geom_traits; @@ -237,9 +237,9 @@ Arrangement_on_surface_2::~Arrangement_on_surface_2() _delete_curve(eit->curve()); // Free the traits object, if necessary. - if (m_own_traits && (m_geom_traits != NULL)) { + if (m_own_traits && (m_geom_traits != nullptr)) { delete m_geom_traits; - m_geom_traits = NULL; + m_geom_traits = nullptr; } // Detach all observers still attached to the arrangement. @@ -333,7 +333,7 @@ insert_in_face_interior(const X_monotone_curve_2& cv, Face_handle f) m_geom_traits->parameter_space_in_x_2_object()(cv, ARR_MIN_END); const Arr_parameter_space ps_y1 = m_geom_traits->parameter_space_in_y_2_object()(cv, ARR_MIN_END); - DHalfedge* fict_prev1 = NULL; + DHalfedge* fict_prev1 = nullptr; DVertex* v1 = ((ps_x1 == ARR_INTERIOR) && (ps_y1 == ARR_INTERIOR)) ? // The curve has a valid left endpoint: Create a new vertex associated @@ -349,7 +349,7 @@ insert_in_face_interior(const X_monotone_curve_2& cv, Face_handle f) m_geom_traits->parameter_space_in_x_2_object()(cv, ARR_MAX_END); const Arr_parameter_space ps_y2 = m_geom_traits->parameter_space_in_y_2_object()(cv, ARR_MAX_END); - DHalfedge* fict_prev2 = NULL; + DHalfedge* fict_prev2 = nullptr; DVertex* v2 = ((ps_x2 == ARR_INTERIOR) && (ps_y2 == ARR_INTERIOR)) ? // The curve has a valid right endpoint: Create a new vertex associated @@ -363,15 +363,15 @@ insert_in_face_interior(const X_monotone_curve_2& cv, Face_handle f) // lexicographically smaller than v2). DHalfedge* new_he; - if ((fict_prev1 == NULL) && (fict_prev2 == NULL)) + if ((fict_prev1 == nullptr) && (fict_prev2 == nullptr)) // Both vertices represent valid points. new_he = _insert_in_face_interior(p_f, cv, ARR_LEFT_TO_RIGHT, v1, v2); - else if ((fict_prev1 == NULL) && (fict_prev2 != NULL)) { + else if ((fict_prev1 == nullptr) && (fict_prev2 != nullptr)) { // v1 represents a valid point and v2 is inserted using its predecessor. new_he = _insert_from_vertex(fict_prev2, cv, ARR_RIGHT_TO_LEFT, v1); new_he = new_he->opposite(); } - else if ((fict_prev1 != NULL) && (fict_prev2 == NULL)) + else if ((fict_prev1 != nullptr) && (fict_prev2 == nullptr)) // v1 is inserted using its predecessor and v2 represents a valid point. new_he = _insert_from_vertex(fict_prev1, cv, ARR_LEFT_TO_RIGHT, v2); else { @@ -455,8 +455,8 @@ insert_from_left_vertex(const X_monotone_curve_2& cv, m_geom_traits->parameter_space_in_x_2_object()(cv, ARR_MAX_END); const Arr_parameter_space ps_y2 = m_geom_traits->parameter_space_in_y_2_object()(cv, ARR_MAX_END); - DVertex* v2 = NULL; - DHalfedge* fict_prev2 = NULL; + DVertex* v2 = nullptr; + DHalfedge* fict_prev2 = nullptr; if ((ps_x2 == ARR_INTERIOR) && (ps_y2 == ARR_INTERIOR)) // The curve has a valid right endpoint: Create a new vertex associated @@ -469,8 +469,8 @@ insert_from_left_vertex(const X_monotone_curve_2& cv, // The given vertex is an isolated one: We should in fact insert the curve // in the interior of the face containing this vertex. DVertex* v1 = _vertex(v); - DIso_vertex* iv = NULL; - DFace* p_f = NULL; + DIso_vertex* iv = nullptr; + DFace* p_f = nullptr; if (v->is_isolated()) { // Obtain the face from the isolated vertex. @@ -485,13 +485,13 @@ insert_from_left_vertex(const X_monotone_curve_2& cv, // If the vertex that corresponds to cv's right end has boundary // conditions, create it now. - if (v2 == NULL) + if (v2 == nullptr) // Locate the DCEL features that will be used for inserting the curve's // right end. v2 = _place_and_set_curve_end(p_f, cv, ARR_MAX_END, ps_x2, ps_y2, &fict_prev2); - if (iv != NULL) { + if (iv != nullptr) { // Remove the isolated vertex v1, as it will not be isolated any more. p_f->erase_isolated_vertex(iv); _dcel().delete_isolated_vertex(iv); @@ -500,7 +500,7 @@ insert_from_left_vertex(const X_monotone_curve_2& cv, // Create the edge connecting the two vertices (note that we know that // v1 is smaller than v2). DHalfedge* new_he; - if (fict_prev2 == NULL) + if (fict_prev2 == nullptr) new_he = _insert_in_face_interior(p_f, cv, ARR_LEFT_TO_RIGHT, v1, v2); else { new_he = _insert_from_vertex(fict_prev2, cv, ARR_RIGHT_TO_LEFT, v1); @@ -516,7 +516,7 @@ insert_from_left_vertex(const X_monotone_curve_2& cv, // which the new curve should be inserted. DHalfedge* prev1 = _locate_around_vertex(_vertex(v), cv, ARR_MIN_END); CGAL_assertion_msg - (prev1 != NULL, + (prev1 != nullptr, "The inserted curve cannot be located in the arrangement."); DFace* f1 = prev1->is_on_inner_ccb() ? prev1->inner_ccb()->face() : @@ -524,7 +524,7 @@ insert_from_left_vertex(const X_monotone_curve_2& cv, // If the vertex that corresponds to cv's right end has boundary conditions, // create it now. - if (v2 == NULL) + if (v2 == nullptr) // Locate the DCEL features that will be used for inserting the curve's // right end. v2 = @@ -534,7 +534,7 @@ insert_from_left_vertex(const X_monotone_curve_2& cv, // than v2). DHalfedge* new_he; - if (fict_prev2 == NULL) + if (fict_prev2 == nullptr) // Insert the halfedge given the predecessor halfedge of v1. new_he = _insert_from_vertex(prev1, cv, ARR_LEFT_TO_RIGHT, v2); else { @@ -617,7 +617,7 @@ insert_from_left_vertex(const X_monotone_curve_2& cv, Halfedge_handle prev) m_geom_traits->parameter_space_in_x_2_object()(cv, ARR_MAX_END); const Arr_parameter_space ps_y2 = m_geom_traits->parameter_space_in_y_2_object()(cv, ARR_MAX_END); - DHalfedge* fict_prev2 = NULL; + DHalfedge* fict_prev2 = nullptr; DVertex* v2 = ((ps_x2 == ARR_INTERIOR) && (ps_y2 == ARR_INTERIOR)) ? // The curve has a valid right endpoint: Create a new vertex associated @@ -631,7 +631,7 @@ insert_from_left_vertex(const X_monotone_curve_2& cv, Halfedge_handle prev) // than v2). DHalfedge* new_he; - if (fict_prev2 == NULL) + if (fict_prev2 == nullptr) // Insert the halfedge given the predecessor halfedge of the left vertex. new_he = _insert_from_vertex(prev1, cv, ARR_LEFT_TO_RIGHT, v2); else { @@ -693,8 +693,8 @@ insert_from_right_vertex(const X_monotone_curve_2& cv, m_geom_traits->parameter_space_in_x_2_object()(cv, ARR_MIN_END); const Arr_parameter_space ps_y1 = m_geom_traits->parameter_space_in_y_2_object()(cv, ARR_MIN_END); - DVertex* v1 = NULL; - DHalfedge* fict_prev1 = NULL; + DVertex* v1 = nullptr; + DHalfedge* fict_prev1 = nullptr; if ((ps_x1 == ARR_INTERIOR) && (ps_y1 == ARR_INTERIOR)) // The curve has a valid left endpoint: Create a new vertex associated @@ -707,8 +707,8 @@ insert_from_right_vertex(const X_monotone_curve_2& cv, // The given vertex is an isolated one: We should in fact insert the curve // in the interior of the face containing this vertex. DVertex* v2 = _vertex(v); - DIso_vertex* iv = NULL; - DFace* p_f = NULL; + DIso_vertex* iv = nullptr; + DFace* p_f = nullptr; if (v->is_isolated()) { // Obtain the face from the isolated vertex. @@ -723,13 +723,13 @@ insert_from_right_vertex(const X_monotone_curve_2& cv, // If the vertex that corresponds to cv's left end has boundary // conditions, create it now. - if (v1 == NULL) + if (v1 == nullptr) // Locate the DCEL features that will be used for inserting the curve's // left end. v1 = _place_and_set_curve_end(p_f, cv, ARR_MIN_END, ps_x1, ps_y1, &fict_prev1); - if (iv != NULL) { + if (iv != nullptr) { // Remove the isolated vertex v2, as it will not be isolated any more. p_f->erase_isolated_vertex(iv); _dcel().delete_isolated_vertex(iv); @@ -737,7 +737,7 @@ insert_from_right_vertex(const X_monotone_curve_2& cv, // Create the edge connecting the two vertices (note that we know that // v1 is smaller than v2). - DHalfedge* new_he = (fict_prev1 == NULL) ? + DHalfedge* new_he = (fict_prev1 == nullptr) ? _insert_in_face_interior(p_f, cv, ARR_LEFT_TO_RIGHT, v1, v2) : _insert_from_vertex(fict_prev1, cv, ARR_LEFT_TO_RIGHT, v2); @@ -750,14 +750,14 @@ insert_from_right_vertex(const X_monotone_curve_2& cv, // which the new curve should be inserted. DHalfedge* prev2 = _locate_around_vertex(_vertex(v), cv, ARR_MAX_END); CGAL_assertion_msg - (prev2 != NULL, "The inserted curve cannot be located in the arrangement."); + (prev2 != nullptr, "The inserted curve cannot be located in the arrangement."); DFace* f2 = prev2->is_on_inner_ccb() ? prev2->inner_ccb()->face() : prev2->outer_ccb()->face(); // If the vertex that corresponds to cv's left end has boundary conditions, // create it now. - if (v1 == NULL) + if (v1 == nullptr) // Locate the DCEL features that will be used for inserting the curve's // left end. v1 = @@ -767,7 +767,7 @@ insert_from_right_vertex(const X_monotone_curve_2& cv, // than v1). DHalfedge* new_he; - if (fict_prev1 == NULL) + if (fict_prev1 == nullptr) // Insert the halfedge given the predecessor halfedge of v2. new_he = _insert_from_vertex(prev2, cv, ARR_RIGHT_TO_LEFT, v1); else { @@ -852,7 +852,7 @@ insert_from_right_vertex(const X_monotone_curve_2& cv, m_geom_traits->parameter_space_in_x_2_object()(cv, ARR_MIN_END); const Arr_parameter_space ps_y1 = m_geom_traits->parameter_space_in_y_2_object()(cv, ARR_MIN_END); - DHalfedge* fict_prev1 = NULL; + DHalfedge* fict_prev1 = nullptr; DVertex* v1 = ((ps_x1 == ARR_INTERIOR) && (ps_y1 == ARR_INTERIOR)) ? // The curve has a valid left endpoint: Create a new vertex associated @@ -866,7 +866,7 @@ insert_from_right_vertex(const X_monotone_curve_2& cv, // than v1). DHalfedge* new_he; - if (fict_prev1 == NULL) + if (fict_prev1 == nullptr) // Insert the halfedge given the predecessor halfedge of the right vertex. new_he = _insert_from_vertex(prev2, cv, ARR_RIGHT_TO_LEFT, v1); else { @@ -1023,8 +1023,8 @@ insert_at_vertices(const X_monotone_curve_2& cv, if (v1->degree() == 0) { // Get the face containing the isolated vertex v1. DVertex* p_v1 = _vertex(v1); - DIso_vertex* iv1 = NULL; - DFace* f1 = NULL; + DIso_vertex* iv1 = nullptr; + DFace* f1 = nullptr; if (p_v1->is_isolated()) { // Obtain the containing face from the isolated vertex record. @@ -1041,8 +1041,8 @@ insert_at_vertices(const X_monotone_curve_2& cv, // Both end-vertices are isolated. Make sure they are contained inside // the same face. DVertex* p_v2 = _vertex(v2); - DIso_vertex* iv2 = NULL; - DFace* f2 = NULL; + DIso_vertex* iv2 = nullptr; + DFace* f2 = nullptr; if (p_v2->is_isolated()) { // Obtain the containing face from the isolated vertex record. @@ -1050,14 +1050,14 @@ insert_at_vertices(const X_monotone_curve_2& cv, f2 = iv2->face(); CGAL_assertion_msg - ((f1 == NULL) || (f1 == f2), + ((f1 == nullptr) || (f1 == f2), "The two isolated vertices must be located inside the same face."); // Remove the isolated vertex v2, as it will not be isolated any more. f2->erase_isolated_vertex(iv2); _dcel().delete_isolated_vertex(iv2); } - else if (f1 == NULL) + else if (f1 == nullptr) // In this case the containing face must be given by the user. CGAL_precondition(f != Face_handle()); @@ -1073,7 +1073,7 @@ insert_at_vertices(const X_monotone_curve_2& cv, // which the new curve should be inserted. DHalfedge* prev2 = _locate_around_vertex(_vertex(v2), cv, ind2); CGAL_assertion_msg - (prev2 != NULL, + (prev2 != nullptr, "The inserted curve cannot be located in the arrangement."); CGAL_assertion_code @@ -1081,7 +1081,7 @@ insert_at_vertices(const X_monotone_curve_2& cv, prev2->outer_ccb()->face()); CGAL_assertion_msg - ((f1 == NULL) || (f1 == f2), + ((f1 == nullptr) || (f1 == f2), "The inserted curve should not intersect the existing arrangement."); // Perform the insertion. Note that the returned halfedge is directed @@ -1095,8 +1095,8 @@ insert_at_vertices(const X_monotone_curve_2& cv, else if (v2->degree() == 0) { // Get the face containing the isolated vertex v2. DVertex* p_v2 = _vertex(v2); - DIso_vertex* iv2 = NULL; - DFace* f2 = NULL; + DIso_vertex* iv2 = nullptr; + DFace* f2 = nullptr; if (v2->is_isolated()) { // Obtain the containing face from the isolated vertex record. @@ -1112,7 +1112,7 @@ insert_at_vertices(const X_monotone_curve_2& cv, // which the new curve should be inserted. DHalfedge* prev1 = _locate_around_vertex(_vertex(v1), cv, ind1); CGAL_assertion_msg - (prev1 != NULL, + (prev1 != nullptr, "The inserted curve cannot be located in the arrangement."); CGAL_assertion_code @@ -1120,7 +1120,7 @@ insert_at_vertices(const X_monotone_curve_2& cv, prev1->outer_ccb()->face()); CGAL_assertion_msg - ((f2 == NULL) || (f2 == f1), + ((f2 == nullptr) || (f2 == f1), "The inserted curve should not intersect the existing arrangement."); // Perform the insertion. @@ -1137,7 +1137,7 @@ insert_at_vertices(const X_monotone_curve_2& cv, DHalfedge* prev2 = _locate_around_vertex(_vertex(v2), cv, ind2); CGAL_assertion_msg - (((prev1 != NULL) && (prev2 != NULL)), + (((prev1 != nullptr) && (prev2 != nullptr)), "The inserted curve cannot be located in the arrangement."); // Perform the insertion. @@ -1259,8 +1259,8 @@ insert_at_vertices(const X_monotone_curve_2& cv, if (v2->degree() == 0) { // Get the face containing the isolated vertex v2. DVertex* p_v2 = _vertex(v2); - DIso_vertex* iv2 = NULL; - DFace* f2 = NULL; + DIso_vertex* iv2 = nullptr; + DFace* f2 = nullptr; if (v2->is_isolated()) { iv2 = p_v2->isolated_vertex(); @@ -1287,7 +1287,7 @@ insert_at_vertices(const X_monotone_curve_2& cv, // which the new curve should be inserted. DHalfedge* prev2 = _locate_around_vertex(_vertex(v2), cv, ind2); CGAL_assertion_msg - (prev2 != NULL, "The inserted curve cannot be located in the arrangement."); + (prev2 != nullptr, "The inserted curve cannot be located in the arrangement."); // Perform the insertion. return (insert_at_vertices(cv, prev1, Halfedge_handle(prev2))); @@ -1652,10 +1652,10 @@ merge_edge(Halfedge_handle e1, Halfedge_handle e2, // DHalfedge* _e1 = _halfedge(e1); DHalfedge* _e2 = _halfedge(e2); - DHalfedge* he1 = NULL; - DHalfedge* he2 = NULL; - DHalfedge* he3 = NULL; - DHalfedge* he4 = NULL; + DHalfedge* he1 = nullptr; + DHalfedge* he2 = nullptr; + DHalfedge* he3 = nullptr; + DHalfedge* he4 = nullptr; if (_e1->vertex() == _e2->opposite()->vertex()) { he1 = _e1; @@ -1709,11 +1709,11 @@ merge_edge(Halfedge_handle e1, Halfedge_handle e2, // Keep pointers to the components that contain two halfedges he3 and he2, // pointing at the end vertices of the merged halfedge. - DInner_ccb* ic1 = (he3->is_on_inner_ccb()) ? he3->inner_ccb() : NULL; - DOuter_ccb* oc1 = (ic1 == NULL) ? he3->outer_ccb() : NULL; + DInner_ccb* ic1 = (he3->is_on_inner_ccb()) ? he3->inner_ccb() : nullptr; + DOuter_ccb* oc1 = (ic1 == nullptr) ? he3->outer_ccb() : nullptr; - DInner_ccb* ic2 = (he4->is_on_inner_ccb()) ? he4->inner_ccb() : NULL; - DOuter_ccb* oc2 = (ic2 == NULL) ? he4->outer_ccb() : NULL; + DInner_ccb* ic2 = (he4->is_on_inner_ccb()) ? he4->inner_ccb() : nullptr; + DOuter_ccb* oc2 = (ic2 == nullptr) ? he4->outer_ccb() : nullptr; // Notify the observers that we are about to merge an edge. _notify_before_merge_edge(e1, e2, cv); @@ -1723,14 +1723,14 @@ merge_edge(Halfedge_handle e1, Halfedge_handle e2, // the CCBs they belong to. If so, replace he3 by he1 and he4 by he2. Note // that as we just change the component representatives, we do not have to // notify the observers on the change. - if (oc1 != NULL && oc1->halfedge() == he3) + if (oc1 != nullptr && oc1->halfedge() == he3) oc1->set_halfedge(he1); - else if (ic1 != NULL && ic1->halfedge() == he3) + else if (ic1 != nullptr && ic1->halfedge() == he3) ic1->set_halfedge(he1); - if (oc2 != NULL && oc2->halfedge() == he4) + if (oc2 != nullptr && oc2->halfedge() == he4) oc2->set_halfedge(he2); - else if (ic2 != NULL && ic2->halfedge() == he4) + else if (ic2 != nullptr && ic2->halfedge() == he4) ic2->set_halfedge(he2); // If he3 is the incident halfedge to its target, replace it by he1. @@ -1832,7 +1832,7 @@ _locate_around_vertex(DVertex* v, DHalfedge* first = v->halfedge(); DHalfedge* curr = first; - if (curr == NULL) return NULL; + if (curr == nullptr) return nullptr; DHalfedge* next = curr->next()->opposite(); @@ -1854,7 +1854,7 @@ _locate_around_vertex(DVertex* v, { // If cv equals one of the curves associated with the halfedges, it is // an illegal input curve, as it already exists in the arrangement. - if (eq_curr || eq_next) return NULL; + if (eq_curr || eq_next) return nullptr; // Move to the next pair of incident halfedges. curr = next; @@ -1862,7 +1862,7 @@ _locate_around_vertex(DVertex* v, // If we completed a full traversal around v without locating the // place for cv, it follows that cv overlaps and existing curve. - if (curr == first) return NULL; + if (curr == first) return nullptr; } // Return the halfedge we have located. @@ -2173,7 +2173,7 @@ _create_boundary_vertex(const X_monotone_curve_2& cv, Arr_curve_end ind, if (is_open(ps_x, ps_y)) // The curve-end lies on open boundary so the vertex is not associated // with a valid point. - v->set_point(NULL); + v->set_point(nullptr); else { // Create a boundary vertex associated with a valid point. Point_2* p_p = (ind == ARR_MIN_END) ? @@ -2244,7 +2244,7 @@ _place_and_set_curve_end(DFace* f, m_topol_traits.notify_on_boundary_vertex_creation(v, cv, ind, ps_x, ps_y); // There are no edges incident to v, therefore no predecessor halfedge. - *p_pred = NULL; + *p_pred = nullptr; } // Return the vertex that represents the curve end. @@ -2353,8 +2353,8 @@ _insert_from_vertex(DHalfedge* he_to, const X_monotone_curve_2& cv, // Get the incident face of the previous halfedge. Note that this will also // be the incident face of the two new halfedges we are about to create. - DInner_ccb* ic = (he_to->is_on_inner_ccb()) ? he_to->inner_ccb() : NULL; - DOuter_ccb* oc = (ic == NULL) ? he_to->outer_ccb() : NULL; + DInner_ccb* ic = (he_to->is_on_inner_ccb()) ? he_to->inner_ccb() : nullptr; + DOuter_ccb* oc = (ic == nullptr) ? he_to->outer_ccb() : nullptr; // The first vertex is the one that the he_to halfedge points to. // The second vertex is given by v. @@ -2376,7 +2376,7 @@ _insert_from_vertex(DHalfedge* he_to, const X_monotone_curve_2& cv, he2->set_vertex(v2); // Set the component for the new halfedge pair. - if (oc != NULL) { + if (oc != nullptr) { // On an outer component: he1->set_outer_ccb(oc); he2->set_outer_ccb(oc); @@ -2459,8 +2459,8 @@ _insert_at_vertices(DHalfedge* he_to, he_away->outer_ccb()->face()) << std::endl; #endif - CGAL_precondition(he_to != NULL); - CGAL_precondition(he_away != NULL); + CGAL_precondition(he_to != nullptr); + CGAL_precondition(he_away != nullptr); // TODO EBEB 2012-10-21 rewrite the code in terms of he_to and he_away instead of prev1 and prev2 // the remainder of the function we deal with this situation adds he1 and @@ -2471,8 +2471,8 @@ _insert_at_vertices(DHalfedge* he_to, DHalfedge* prev1 = he_to; DHalfedge* prev2 = he_away->prev(); - CGAL_precondition(prev1 != NULL); - CGAL_precondition(prev2 != NULL); + CGAL_precondition(prev1 != nullptr); + CGAL_precondition(prev2 != nullptr); CGAL_precondition(prev1 != prev2); // in general we do not swap ... @@ -2491,10 +2491,10 @@ _insert_at_vertices(DHalfedge* he_to, // Comment EBEB 2012-08-05 hole1/hole2 appear later as ic1/ic2, but we keep // them here, as the usage is rather local to decide swapping - DInner_ccb* hole1 = (prev1->is_on_inner_ccb()) ? prev1->inner_ccb() : NULL; - DInner_ccb* hole2 = (prev2->is_on_inner_ccb()) ? prev2->inner_ccb() : NULL; + DInner_ccb* hole1 = (prev1->is_on_inner_ccb()) ? prev1->inner_ccb() : nullptr; + DInner_ccb* hole2 = (prev2->is_on_inner_ccb()) ? prev2->inner_ccb() : nullptr; - if ((hole1 == hole2) && (hole1 != NULL)) { + if ((hole1 == hole2) && (hole1 != nullptr)) { // .. only in this special case, we have to check whether swapping should // take place @@ -2605,13 +2605,13 @@ _insert_at_vertices(DHalfedge* he_to, // Get the components containing the two previous halfedges and the incident // face (which should be the same for the two components). - DInner_ccb* ic1 = (prev1->is_on_inner_ccb()) ? prev1->inner_ccb() : NULL; - DOuter_ccb* oc1 = (ic1 == NULL) ? prev1->outer_ccb() : NULL; - DFace* f = (ic1 != NULL) ? ic1->face() : oc1->face(); - DInner_ccb* ic2 = (prev2->is_on_inner_ccb()) ? prev2->inner_ccb() : NULL; - DOuter_ccb* oc2 = (ic2 == NULL) ? prev2->outer_ccb() : NULL; + DInner_ccb* ic1 = (prev1->is_on_inner_ccb()) ? prev1->inner_ccb() : nullptr; + DOuter_ccb* oc1 = (ic1 == nullptr) ? prev1->outer_ccb() : nullptr; + DFace* f = (ic1 != nullptr) ? ic1->face() : oc1->face(); + DInner_ccb* ic2 = (prev2->is_on_inner_ccb()) ? prev2->inner_ccb() : nullptr; + DOuter_ccb* oc2 = (ic2 == nullptr) ? prev2->outer_ccb() : nullptr; - CGAL_precondition_code(DFace* f2 = (ic2 != NULL) ? ic2->face() : oc2->face()); + CGAL_precondition_code(DFace* f2 = (ic2 != nullptr) ? ic2->face() : oc2->face()); #if CGAL_ARRANGEMENT_ON_SURFACE_INSERT_VERBOSE std::cout << "ic1: " << ic1 << std::endl; @@ -2672,7 +2672,7 @@ _insert_at_vertices(DHalfedge* he_to, bool split_new_face = true; bool is_split_face_contained = false; - if ((ic1 != NULL) && (ic1 == ic2)) { + if ((ic1 != nullptr) && (ic1 == ic2)) { // EBEB 2012-08-06: // This is new code. It relies on the (computed) signs and replaces to @@ -2722,7 +2722,7 @@ _insert_at_vertices(DHalfedge* he_to, // Check the various cases of insertion (in the design document: the // various sub-cases of case 3 in the insertion procedure). - if (((ic1 != NULL) || (ic2 != NULL)) && (ic1 != ic2)) { + if (((ic1 != nullptr) || (ic2 != nullptr)) && (ic1 != ic2)) { // In case we have to connect two disconnected components, no new face // is created. new_face = false; @@ -2732,7 +2732,7 @@ _insert_at_vertices(DHalfedge* he_to, // of the face. Face_handle fh(f); - if ((ic1 != NULL) && (ic2 != NULL)) { + if ((ic1 != nullptr) && (ic2 != nullptr)) { // In this case (3.1) we have to connect to inner CCBs (holes) inside f. // Notify the observers that we are about to merge two holes in the face. _notify_before_merge_inner_ccb(fh, @@ -2769,7 +2769,7 @@ _insert_at_vertices(DHalfedge* he_to, DHalfedge* ccb_first; DHalfedge* ccb_last; - if (ic1 != NULL) { + if (ic1 != nullptr) { // We remove the inner CCB ic1 and merge in with the outer CCB oc2. del_ic = ic1; oc = oc2; @@ -2809,7 +2809,7 @@ _insert_at_vertices(DHalfedge* he_to, } else if (! split_new_face) { // RWRW: NEW! - CGAL_assertion((ic1 == ic2) && (ic1 != NULL)); + CGAL_assertion((ic1 == ic2) && (ic1 != nullptr)); // Handle the special case where we close an inner CCB, such that // we form two outer CCBs of the same face. @@ -2920,7 +2920,7 @@ _insert_at_vertices(DHalfedge* he_to, // or on the same outer CCB (distinguish case 3.3 and case 3.4). bool is_hole; - if (ic1 != NULL) { + if (ic1 != nullptr) { // In this case (3.3) we have two distinguish two sub-cases. if (is_split_face_contained) { // Comment: This is true for all non-identification topologies @@ -3079,7 +3079,7 @@ _insert_at_vertices(DHalfedge* he_to, _notify_after_split_face(fh, Face_handle(new_f), is_hole); } else { - CGAL_assertion((oc1 != NULL) && (oc2 != NULL) && (oc1 != oc2)); + CGAL_assertion((oc1 != nullptr) && (oc2 != nullptr) && (oc1 != oc2)); // In case prev1 and prev2 belong to different outer CCBs of the same // face f (case 3.5), we have to merge this ccbs into one. Note that we @@ -3122,12 +3122,12 @@ _insert_at_vertices(DHalfedge* he_to, #if 0 { DHalfedge* he1 = he2->opposite(); - DInner_ccb* ic1 = (he1->is_on_inner_ccb()) ? he1->inner_ccb() : NULL; - DOuter_ccb* oc1 = (ic1 == NULL) ? he1->outer_ccb() : NULL; - DFace* f1 = (ic1 != NULL) ? ic1->face() : oc1->face(); - DInner_ccb* ic2 = (he2->is_on_inner_ccb()) ? he2->inner_ccb() : NULL; - DOuter_ccb* oc2 = (ic2 == NULL) ? he2->outer_ccb() : NULL; - DFace* f2 = (ic2 != NULL) ? ic2->face() : oc2->face(); + DInner_ccb* ic1 = (he1->is_on_inner_ccb()) ? he1->inner_ccb() : nullptr; + DOuter_ccb* oc1 = (ic1 == nullptr) ? he1->outer_ccb() : nullptr; + DFace* f1 = (ic1 != nullptr) ? ic1->face() : oc1->face(); + DInner_ccb* ic2 = (he2->is_on_inner_ccb()) ? he2->inner_ccb() : nullptr; + DOuter_ccb* oc2 = (ic2 == nullptr) ? he2->outer_ccb() : nullptr; + DFace* f2 = (ic2 != nullptr) ? ic2->face() : oc2->face(); CGAL_postcondition((ic1 != ic2) || (f1 == f2)); } #endif @@ -3337,10 +3337,10 @@ _split_edge(DHalfedge* e, DVertex* v, // Get the split halfedge and its twin, its source and target. DHalfedge* he1 = e; DHalfedge* he2 = he1->opposite(); - DInner_ccb* ic1 = (he1->is_on_inner_ccb()) ? he1->inner_ccb() : NULL; - DOuter_ccb* oc1 = (ic1 == NULL) ? he1->outer_ccb() : NULL; - DInner_ccb* ic2 = (he2->is_on_inner_ccb()) ? he2->inner_ccb() : NULL; - DOuter_ccb* oc2 = (ic2 == NULL) ? he2->outer_ccb() : NULL; + DInner_ccb* ic1 = (he1->is_on_inner_ccb()) ? he1->inner_ccb() : nullptr; + DOuter_ccb* oc1 = (ic1 == nullptr) ? he1->outer_ccb() : nullptr; + DInner_ccb* ic2 = (he2->is_on_inner_ccb()) ? he2->inner_ccb() : nullptr; + DOuter_ccb* oc2 = (ic2 == nullptr) ? he2->outer_ccb() : nullptr; // Notify the observers that we are about to split an edge. _notify_before_split_edge(Halfedge_handle(e), Vertex_handle(v), cv1, cv2); @@ -3370,7 +3370,7 @@ _split_edge(DHalfedge* e, DVertex* v, // he1 and he2 form an "antenna", so he4 becomes he3's successor. he3->set_next(he4); - if (oc1 != NULL) + if (oc1 != nullptr) he3->set_outer_ccb(oc1); else he3->set_inner_ccb(ic1); @@ -3379,7 +3379,7 @@ _split_edge(DHalfedge* e, DVertex* v, he4->set_vertex(v); he4->set_next(he2); - if (oc2 != NULL) + if (oc2 != nullptr) he4->set_outer_ccb(oc2); else he4->set_inner_ccb(ic2); @@ -3472,8 +3472,8 @@ _compute_indices(Arr_parameter_space ps_x_curr, Arr_parameter_space ps_y_curr, // Precondition The OutputIterator must be a back inserter. // Precondition The traveresed ccb is an inner ccb; thus, it cannot be // on an open boundary. -// Postcondition If NULL is a local minimum, it is inserted first. -// No other local minima can be NULL. +// Postcondition If nullptr is a local minimum, it is inserted first. +// No other local minima can be nullptr. template template std::pair @@ -3553,7 +3553,7 @@ _compute_signs_and_local_minima(const DHalfedge* he_to, if ((cv_dir == ARR_RIGHT_TO_LEFT) && (he_away->direction() == ARR_LEFT_TO_RIGHT)) { - const DHalfedge* null_he = NULL; + const DHalfedge* null_he = nullptr; *local_mins_it++ = std::make_pair(null_he, x_index); } @@ -3712,7 +3712,7 @@ _compute_signs_and_min(const DHalfedge* he_anchor, int& index_min) const { // Initialize - const DHalfedge* he_min = NULL; + const DHalfedge* he_min = nullptr; ps_x_min = ARR_INTERIOR; ps_y_min = ARR_INTERIOR; index_min = 0; @@ -3795,7 +3795,7 @@ _compute_signs_and_min(const DHalfedge* he_anchor, // Test the halfedge incident to the leftmost vertex. // Note that we may visit the same vertex several times. - if ((he_min == NULL) || + if ((he_min == nullptr) || (index_curr < index_min) || ((index_curr == index_min) && ((he_curr->vertex() != he_min->vertex()) && @@ -4023,9 +4023,9 @@ _defines_outer_ccb_of_new_face(const DHalfedge* he_to, int index_min = lm_it->second; const DHalfedge* he_min = lm_it->first; const DVertex* v_min = - (he_min == NULL) ? he_away->opposite()->vertex() : he_min->vertex(); + (he_min == nullptr) ? he_away->opposite()->vertex() : he_min->vertex(); const X_monotone_curve_2* cv_min = - (he_min == NULL) ? &cv : &(he_min->curve()); + (he_min == nullptr) ? &cv : &(he_min->curve()); Arr_parameter_space ps_x_min = parameter_space_in_x(*cv_min, ARR_MIN_END); Arr_parameter_space ps_y_min = parameter_space_in_y(*cv_min, ARR_MIN_END); @@ -4077,7 +4077,7 @@ _defines_outer_ccb_of_new_face(const DHalfedge* he_to, } } - CGAL_assertion(v_min != NULL); + CGAL_assertion(v_min != nullptr); CGAL_assertion(!v_min->has_null_point()); #if CGAL_ARRANGEMENT_ON_SURFACE_INSERT_VERBOSE @@ -4086,7 +4086,7 @@ _defines_outer_ccb_of_new_face(const DHalfedge* he_to, if (he_min) std::cout << he_min->opposite()->vertex()->point() << " => " << he_min->vertex()->point(); - else std::cout << "NULL"; + else std::cout << "nullptr"; std::cout << std::endl; #endif @@ -4096,7 +4096,7 @@ _defines_outer_ccb_of_new_face(const DHalfedge* he_to, // to the right of the leftmost vertex. We compare them to the right of this // point to determine whether he_to (the curve) and he_away are incident to // the hole to be created or not. - const X_monotone_curve_2& cv_next = (he_min == NULL) ? + const X_monotone_curve_2& cv_next = (he_min == nullptr) ? he_away->curve() : ((he_min == he_to) ? cv : he_min->next()->curve()); return _is_above(*cv_min, cv_next, v_min->point(), ps_y_min, Top_or_bottom_sides_category()); @@ -4202,12 +4202,12 @@ _remove_edge(DHalfedge* e, bool remove_source, bool remove_target) // belong to and their incident faces. DHalfedge* he1 = e; DHalfedge* he2 = e->opposite(); - DInner_ccb* ic1 = (he1->is_on_inner_ccb()) ? he1->inner_ccb() : NULL; - DOuter_ccb* oc1 = (ic1 == NULL) ? he1->outer_ccb() : NULL; - DFace* f1 = (oc1 != NULL) ? oc1->face() : ic1->face(); - DInner_ccb* ic2 = (he2->is_on_inner_ccb()) ? he2->inner_ccb() : NULL; - DOuter_ccb* oc2 = (ic2 == NULL) ? he2->outer_ccb() : NULL; - DFace* f2 = (oc2 != NULL) ? oc2->face() : ic2->face(); + DInner_ccb* ic1 = (he1->is_on_inner_ccb()) ? he1->inner_ccb() : nullptr; + DOuter_ccb* oc1 = (ic1 == nullptr) ? he1->outer_ccb() : nullptr; + DFace* f1 = (oc1 != nullptr) ? oc1->face() : ic1->face(); + DInner_ccb* ic2 = (he2->is_on_inner_ccb()) ? he2->inner_ccb() : nullptr; + DOuter_ccb* oc2 = (ic2 == nullptr) ? he2->outer_ccb() : nullptr; + DFace* f2 = (oc2 != nullptr) ? oc2->face() : ic2->face(); #if CGAL_ARRANGEMENT_ON_SURFACE_INSERT_VERBOSE #if 0 @@ -4419,8 +4419,8 @@ _remove_edge(DHalfedge* e, bool remove_source, bool remove_target) #endif // Now the real removal starts. - DHalfedge* prev1 = NULL; - DHalfedge* prev2 = NULL; + DHalfedge* prev1 = nullptr; + DHalfedge* prev2 = nullptr; // Notify the observers that we are about to remove an edge. Halfedge_handle hh(e); @@ -4432,7 +4432,7 @@ _remove_edge(DHalfedge* e, bool remove_source, bool remove_target) if (f1 == f2) { // Check whether the two halfedges are successors along the face boundary. if ((he1->next() == he2) && (he2->next() == he1)) { - CGAL_assertion((ic1 != NULL) && (ic1 == ic2)); + CGAL_assertion((ic1 != nullptr) && (ic1 == ic2)); // The two halfedges form a "singleton" hole inside the incident face // (case 1 of the removal procedure, as detailed in the design document), @@ -4463,7 +4463,7 @@ _remove_edge(DHalfedge* e, bool remove_source, bool remove_target) if ((v1->parameter_space_in_x() != ARR_INTERIOR) || (v1->parameter_space_in_y() != ARR_INTERIOR)) { - v1->set_halfedge(NULL); // disconnect the end vertex + v1->set_halfedge(nullptr); // disconnect the end vertex _remove_vertex_if_redundant(v1, f1); } else { @@ -4485,7 +4485,7 @@ _remove_edge(DHalfedge* e, bool remove_source, bool remove_target) if ((v2->parameter_space_in_x() != ARR_INTERIOR) || (v2->parameter_space_in_y() != ARR_INTERIOR)) { - v2->set_halfedge(NULL); // disconnect the end vertex + v2->set_halfedge(nullptr); // disconnect the end vertex _remove_vertex_if_redundant(v2, f1); } else { @@ -4533,10 +4533,10 @@ _remove_edge(DHalfedge* e, bool remove_source, bool remove_target) // In case the halfedges to be deleted are represantatives of their // CCB (note that noth should belong to the same CCB, be it an outer // CCB or an inner one), make prev1 the components representative. - if ((oc1 != NULL) && + if ((oc1 != nullptr) && ((oc1->halfedge() == he1) || (oc1->halfedge() == he2))) oc1->set_halfedge(prev1); - else if ((ic1 != NULL) && + else if ((ic1 != nullptr) && ((ic1->halfedge() == he1) || (ic1->halfedge() == he2))) ic1->set_halfedge(prev1); @@ -4565,7 +4565,7 @@ _remove_edge(DHalfedge* e, bool remove_source, bool remove_target) if ((v1->parameter_space_in_x() != ARR_INTERIOR) || (v1->parameter_space_in_y() != ARR_INTERIOR)) { - v1->set_halfedge(NULL); // disconnect the end vertex + v1->set_halfedge(nullptr); // disconnect the end vertex _remove_vertex_if_redundant(v1, f1); } else { @@ -4598,7 +4598,7 @@ _remove_edge(DHalfedge* e, bool remove_source, bool remove_target) prev1 = he1->prev(); prev2 = he2->prev(); - if ((ic1 != NULL) && (ic1 == ic2)) { + if ((ic1 != nullptr) && (ic1 == ic2)) { // If both halfedges lie on the same inner component (hole) inside the // face (case 3.1), we have to split this component into two holes. @@ -4639,7 +4639,7 @@ _remove_edge(DHalfedge* e, bool remove_source, bool remove_target) } else if (oc1 != oc2) { // RWRW: NEW! - CGAL_assertion((oc1 != NULL) && (oc2 != NULL)); + CGAL_assertion((oc1 != nullptr) && (oc2 != nullptr)); // In case both halfegdes he1 and he2 are incident to the same face // but lie on different outer CCBs of this face, removing this pair of @@ -4665,7 +4665,7 @@ _remove_edge(DHalfedge* e, bool remove_source, bool remove_target) add_inner_ccb = true; } else { - CGAL_assertion((oc1 != NULL) && (oc1 == oc2)); + CGAL_assertion((oc1 != nullptr) && (oc1 == oc2)); // If both halfedges are incident to the same outer CCB of their // face (case 3.2), we have to distinguish two sub-cases: @@ -4851,9 +4851,9 @@ _remove_edge(DHalfedge* e, bool remove_source, bool remove_target) prev1 = he1->prev(); prev2 = he2->prev(); - CGAL_assertion((ic1 == NULL) || (ic2 == NULL)); + CGAL_assertion((ic1 == nullptr) || (ic2 == nullptr)); - if ((ic1 == NULL) && (ic2 == NULL)) { + if ((ic1 == nullptr) && (ic2 == nullptr)) { bool add_inner_ccb = false; // Comment EFEF 2013-05-31: if we ever find the need to use signs1 and @@ -5017,15 +5017,15 @@ _remove_edge(DHalfedge* e, bool remove_source, bool remove_target) // inside it (case 3.3). We first make sure that f1 contains the hole f2, so // we can merge f2 with it (we swap roles between the halfedges if // necessary). - if (ic2 != NULL) { + if (ic2 != nullptr) { he1 = he2; he2 = he1->opposite(); ic1 = ic2; - ic2 = NULL; + ic2 = nullptr; oc2 = oc1; - oc1 = NULL; + oc1 = nullptr; DFace* tf = f1; f1 = f2; @@ -5139,7 +5139,7 @@ _remove_vertex_if_redundant(DVertex* v, DFace* f) // In case the vertex has no incident halfedges, remove it if it is // redundant. Otherwise, make it an isolated vertex. - if (v->halfedge() == NULL) { + if (v->halfedge() == nullptr) { if (m_topol_traits.is_redundant(v)) { // Remove the vertex and notify the observers on doing so. _notify_before_remove_vertex(Vertex_handle(v)); diff --git a/Arrangement_on_surface_2/include/CGAL/Arrangement_2/Arrangement_zone_2_impl.h b/Arrangement_on_surface_2/include/CGAL/Arrangement_2/Arrangement_zone_2_impl.h index 254a16364c0..483c8905ac0 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arrangement_2/Arrangement_zone_2_impl.h +++ b/Arrangement_on_surface_2/include/CGAL/Arrangement_2/Arrangement_zone_2_impl.h @@ -106,7 +106,7 @@ void Arrangement_zone_2::compute_zone() const Halfedge_const_handle* hh; const Face_const_handle* fh; - if ((vh = object_cast(&m_obj)) != NULL) { + if ((vh = object_cast(&m_obj)) != nullptr) { CGAL_assertion(m_has_left_pt); // The left endpoint coincides with an existing vertex: @@ -128,7 +128,7 @@ void Arrangement_zone_2::compute_zone() #endif } - else if ((hh = object_cast(&m_obj)) != NULL) { + else if ((hh = object_cast(&m_obj)) != nullptr) { if (m_has_left_pt) { // Obtain the right halfedge from the halfedge-pair containing m_left_pt // in their interior. @@ -171,7 +171,7 @@ void Arrangement_zone_2::compute_zone() // The left endpoint lies inside a face. fh = object_cast(&m_obj); - CGAL_assertion_msg(fh != NULL, + CGAL_assertion_msg(fh != nullptr, "Invalid object returned by the point-location query."); // Compute the zone of the curve at the interior of the face. @@ -843,7 +843,7 @@ _compute_next_intersection(Halfedge_handle he, // valid, as they lie to its right. valid_intersection = true; } - else if (ip != NULL) { + else if (ip != nullptr) { if (m_has_right_pt && m_right_on_boundary && m_geom_traits->equal_2_object()(ip->first, m_right_pt)) { @@ -861,7 +861,7 @@ _compute_next_intersection(Halfedge_handle he, else { // We have an overlapping subcurve. icv = object_cast(&(inter_list.front())); - CGAL_assertion(icv != NULL); + CGAL_assertion(icv != nullptr); if (m_geom_traits->is_closed_2_object()(*icv, ARR_MIN_END)) { // The curve has a valid left point - make sure it lies to the @@ -905,7 +905,7 @@ _compute_next_intersection(Halfedge_handle he, // Compare that current object with m_left_pt (if exists). ip = object_cast(&(inter_list.front())); - if (ip != NULL) { + if (ip != nullptr) { // We have a simple intersection point - if we don't have to skip it, // make sure it lies to the right of m_left_pt (if m_left_pt is on the // left boundary, all points lie to it right). @@ -930,7 +930,7 @@ _compute_next_intersection(Halfedge_handle he, else { // We have an overlapping subcurve. icv = object_cast(&(inter_list.front())); - CGAL_assertion(icv != NULL); + CGAL_assertion(icv != nullptr); if (m_geom_traits->is_closed_2_object()(*icv, ARR_MIN_END)) { // The curve has a valid left point - make sure it lies to the @@ -1122,7 +1122,7 @@ _leftmost_intersection(Ccb_halfedge_circulator he_curr, bool on_boundary, // We have found an intersection (either a simple point or an // overlapping x-monotone curve). const Intersect_point_2* int_p = object_cast(&iobj); - if (int_p != NULL) { + if (int_p != nullptr) { Point_2 ip = int_p->first; // Found a simple intersection point. Check if it is the leftmost @@ -1144,7 +1144,7 @@ _leftmost_intersection(Ccb_halfedge_circulator he_curr, bool on_boundary, // We have located an overlapping curve. Assign ip as its left // endpoint. const X_monotone_curve_2* icv = object_cast(&iobj); - CGAL_assertion(icv != NULL); + CGAL_assertion(icv != nullptr); Point_2 ip = min_vertex(*icv); // Check if this endpoint it is the leftmost intersection point so far. @@ -1301,7 +1301,7 @@ _zone_in_face(Face_handle face, bool on_boundary) m_cv = m_sub_cv2; } - const X_monotone_curve_2*p_orig_curve = NULL; + const X_monotone_curve_2*p_orig_curve = nullptr; if (! m_found_iso_vert) { // Check whether m_intersect_p coincides with one of the end-vertices of the @@ -1364,8 +1364,8 @@ _zone_in_face(Face_handle face, bool on_boundary) // subcurves that result from splitting m_intersect_he->curve() at the // intersection point we have just detected, one extends to the left // and one to the right of this split point. - const X_monotone_curve_2* p_left_subcurve = NULL; - const X_monotone_curve_2* p_right_subcurve = NULL; + const X_monotone_curve_2* p_left_subcurve = nullptr; + const X_monotone_curve_2* p_right_subcurve = nullptr; if (inserted_he->next()->direction() == ARR_LEFT_TO_RIGHT) { // The next halfedge extends to the right of the split point: diff --git a/Arrangement_on_surface_2/include/CGAL/Arrangement_2/graph_traits_dual.h b/Arrangement_on_surface_2/include/CGAL/Arrangement_2/graph_traits_dual.h index 6be8db37bfe..f3c26b4e865 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arrangement_2/graph_traits_dual.h +++ b/Arrangement_on_surface_2/include/CGAL/Arrangement_2/graph_traits_dual.h @@ -247,7 +247,7 @@ public: typedef Face_neighbor_iterator Incident_edge_iterator; /*! Default constructor. */ - Dual_arrangement_on_surface() : p_arr(NULL) {} + Dual_arrangement_on_surface() : p_arr(nullptr) {} /*! Constructor from an arrangement. */ Dual_arrangement_on_surface(const Arrangement& arr) : diff --git a/Arrangement_on_surface_2/include/CGAL/Arrangement_on_surface_2.h b/Arrangement_on_surface_2/include/CGAL/Arrangement_on_surface_2.h index 7d51cc94b18..649b96b51a5 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arrangement_on_surface_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arrangement_on_surface_2.h @@ -165,7 +165,7 @@ protected: const Topology_traits* m_topol_traits; public: - _Is_concrete_vertex() : m_topol_traits(NULL) {} + _Is_concrete_vertex() : m_topol_traits(nullptr) {} _Is_concrete_vertex(const Topology_traits* topol_traits) : m_topol_traits(topol_traits) @@ -173,7 +173,7 @@ protected: bool operator()(const DVertex& v) const { - if (m_topol_traits == NULL) + if (m_topol_traits == nullptr) return true; return (m_topol_traits->is_concrete_vertex(&v)); @@ -188,7 +188,7 @@ protected: const Topology_traits* m_topol_traits; public: - _Is_valid_vertex() : m_topol_traits(NULL) {} + _Is_valid_vertex() : m_topol_traits(nullptr) {} _Is_valid_vertex(const Topology_traits* topol_traits) : m_topol_traits(topol_traits) @@ -196,7 +196,7 @@ protected: bool operator()(const DVertex& v) const { - if (m_topol_traits == NULL) + if (m_topol_traits == nullptr) return true; return (m_topol_traits->is_valid_vertex(&v)); @@ -211,7 +211,7 @@ protected: const Topology_traits* m_topol_traits; public: - _Is_valid_halfedge() : m_topol_traits(NULL) {} + _Is_valid_halfedge() : m_topol_traits(nullptr) {} _Is_valid_halfedge(const Topology_traits* topol_traits) : m_topol_traits(topol_traits) @@ -219,7 +219,7 @@ protected: bool operator()(const DHalfedge& he) const { - if (m_topol_traits == NULL) + if (m_topol_traits == nullptr) return true; return (m_topol_traits->is_valid_halfedge(&he)); @@ -234,7 +234,7 @@ protected: const Topology_traits* m_topol_traits; public: - _Is_valid_face() : m_topol_traits(NULL) {} + _Is_valid_face() : m_topol_traits(nullptr) {} _Is_valid_face(const Topology_traits* topol_traits) : m_topol_traits(topol_traits) @@ -242,7 +242,7 @@ protected: bool operator()(const DFace& f) const { - if (m_topol_traits == NULL) + if (m_topol_traits == nullptr) return true; return (m_topol_traits->is_valid_face(&f)); @@ -257,7 +257,7 @@ protected: const Topology_traits* m_topol_traits; public: - _Is_unbounded_face() : m_topol_traits(NULL) {} + _Is_unbounded_face() : m_topol_traits(nullptr) {} _Is_unbounded_face(const Topology_traits* topol_traits) : m_topol_traits(topol_traits) @@ -587,7 +587,7 @@ public: const DHalfedge* he_curr = he_first; Size n = 0; - if (he_curr != NULL) { + if (he_curr != nullptr) { do { ++n; he_curr = he_curr->next()->opposite(); @@ -1777,7 +1777,7 @@ protected: * \return A pointer to a halfedge whose target is v, where cv should be * inserted between this halfedge and the next halfedge around this * vertex (in a clockwise order). - * A NULL return value indicates a precondition violation. + * A nullptr return value indicates a precondition violation. */ DHalfedge* _locate_around_vertex(DVertex* v, const X_monotone_curve_2& cv, Arr_curve_end ind) const; @@ -2031,7 +2031,7 @@ protected: * \param bx The boundary condition at the x-coordinate. * \param by The boundary condition at the y-coordinate. * \param p_pred Output: The predecessor halfedge around this vertex - * (may be NULL, if no such halfedge exists). + * (may be nullptr, if no such halfedge exists). * \return The vertex that corresponds to the curve end. */ DVertex* _place_and_set_curve_end(DFace* f, diff --git a/Arrangement_on_surface_2/include/CGAL/Arrangement_zone_2.h b/Arrangement_on_surface_2/include/CGAL/Arrangement_zone_2.h index 4dfb2d7964b..99f2892b396 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arrangement_zone_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arrangement_zone_2.h @@ -186,7 +186,7 @@ public: m_invalid_he() { m_geom_traits = static_cast(arr.geometry_traits()); - CGAL_assertion(visitor != NULL); + CGAL_assertion(visitor != nullptr); // Initialize the visitor. visitor->init(&arr); diff --git a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Arc_2.h b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Arc_2.h index 52a0d51a6eb..bf6cf638809 100644 --- a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Arc_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Arc_2.h @@ -960,9 +960,9 @@ public: CGAL_CKvA_2_GRAB_CK_FUNCTOR_FOR_ARC(Compare_x_at_limit_2, compare_x_at_limit_2) - // compare with NULL, in order to avoid a performance warning with VC++ + // compare with nullptr, in order to avoid a performance warning with VC++ CGAL_precondition(Kernel_arc_2_equals_Arc_2 || - dynamic_cast< const Kernel_arc_2* >(this) != NULL); + dynamic_cast< const Kernel_arc_2* >(this) != nullptr); return compare_x_at_limit_2( p, *dynamic_cast< const Kernel_arc_2* >(this), ce ); @@ -990,7 +990,7 @@ public: CGAL_CKvA_2_GRAB_CK_FUNCTOR_FOR_ARC(Compare_x_at_limit_2, compare_x_at_limit_2) CGAL_precondition(Kernel_arc_2_equals_Arc_2 || - dynamic_cast< const Kernel_arc_2* >(this) != NULL); + dynamic_cast< const Kernel_arc_2* >(this) != nullptr); return compare_x_at_limit_2( *dynamic_cast< const Kernel_arc_2* >(this), ce1, cv2, ce2 ); @@ -1017,7 +1017,7 @@ public: CGAL_CKvA_2_GRAB_CK_FUNCTOR_FOR_ARC(Compare_x_near_limit_2, compare_x_near_limit_2) CGAL_precondition(Kernel_arc_2_equals_Arc_2 || - dynamic_cast< const Kernel_arc_2* >(this) != NULL); + dynamic_cast< const Kernel_arc_2* >(this) != nullptr); return compare_x_near_limit_2( p, *dynamic_cast< const Kernel_arc_2* >(this), ce ); @@ -1043,7 +1043,7 @@ public: CGAL_CKvA_2_GRAB_CK_FUNCTOR_FOR_ARC(Compare_x_near_limit_2, compare_x_near_limit_2) CGAL_precondition(Kernel_arc_2_equals_Arc_2 || - dynamic_cast< const Kernel_arc_2* >(this) != NULL); + dynamic_cast< const Kernel_arc_2* >(this) != nullptr); return compare_x_near_limit_2(*dynamic_cast< const Kernel_arc_2* >(this), cv2, ce); } @@ -1068,7 +1068,7 @@ public: CGAL_CKvA_2_GRAB_CK_FUNCTOR_FOR_ARC(Compare_y_near_boundary_2, compare_y_near_boundary_2) CGAL_precondition(Kernel_arc_2_equals_Arc_2 || - dynamic_cast< const Kernel_arc_2* >(this) != NULL); + dynamic_cast< const Kernel_arc_2* >(this) != nullptr); return compare_y_near_boundary_2( *dynamic_cast< const Kernel_arc_2* >(this), cv2, ce ); @@ -1090,7 +1090,7 @@ public: CGAL_CKvA_2_GRAB_CK_FUNCTOR_FOR_ARC(Compare_y_at_x_2, compare_y_at_x_2) CGAL_precondition(Kernel_arc_2_equals_Arc_2 || - dynamic_cast< const Kernel_arc_2* >(this) != NULL); + dynamic_cast< const Kernel_arc_2* >(this) != nullptr); return compare_y_at_x_2(p, *dynamic_cast< const Kernel_arc_2* >(this)); } @@ -1116,7 +1116,7 @@ public: CGAL_CKvA_2_GRAB_CK_FUNCTOR_FOR_ARC(Compare_y_at_x_left_2, compare_y_at_x_left_2) CGAL_precondition(Kernel_arc_2_equals_Arc_2 || - dynamic_cast< const Kernel_arc_2* >(this) != NULL); + dynamic_cast< const Kernel_arc_2* >(this) != nullptr); return compare_y_at_x_left_2( *dynamic_cast< const Kernel_arc_2* >(this), cv2, p ); @@ -1144,7 +1144,7 @@ public: CGAL_CKvA_2_GRAB_CK_FUNCTOR_FOR_ARC(Compare_y_at_x_right_2, compare_y_at_x_right_2) CGAL_precondition(Kernel_arc_2_equals_Arc_2 || - dynamic_cast< const Kernel_arc_2* >(this) != NULL); + dynamic_cast< const Kernel_arc_2* >(this) != nullptr); return compare_y_at_x_right_2( *dynamic_cast< const Kernel_arc_2* >(this), cv2, p ); @@ -1161,18 +1161,18 @@ public: * \return \c true, if p.x() is in x-range of arc, \c false otherwise */ bool is_in_x_range(const Coordinate_1& x, - bool *eq_min = NULL, bool *eq_max = NULL) const { + bool *eq_min = nullptr, bool *eq_max = nullptr) const { - if (eq_min != NULL && eq_max != NULL) { + if (eq_min != nullptr && eq_max != nullptr) { *eq_min = *eq_max = false; } if (is_vertical()) { if (x == this->x()) { - if (eq_min != NULL) { + if (eq_min != nullptr) { *eq_min = true; } - if (eq_max != NULL) { + if (eq_max != nullptr) { *eq_max = true; } return true; @@ -1191,7 +1191,7 @@ public: if (min_has_x) { resmin = Curved_kernel_via_analysis_2::instance(). kernel().compare_1_object()(x, _minpoint().x()); - if (eq_min != NULL) { // TODO asymptotic end in x-range? + if (eq_min != nullptr) { // TODO asymptotic end in x-range? *eq_min = (resmin == CGAL::EQUAL); } } @@ -1206,7 +1206,7 @@ public: if (max_has_x) { resmax = Curved_kernel_via_analysis_2::instance(). kernel().compare_1_object()(x, _maxpoint().x()); - if (eq_max != NULL) { // TODO asymptotic end in x-range? + if (eq_max != nullptr) { // TODO asymptotic end in x-range? *eq_max = (resmax == CGAL::EQUAL); } } @@ -1246,7 +1246,7 @@ public: equal_2) CGAL_precondition(Kernel_arc_2_equals_Arc_2 || - dynamic_cast< const Kernel_arc_2* >(this) != NULL); + dynamic_cast< const Kernel_arc_2* >(this) != nullptr); return equal_2(*dynamic_cast< const Kernel_arc_2* >(this), cv2); } @@ -1262,7 +1262,7 @@ public: CGAL_CKvA_2_GRAB_CK_FUNCTOR_FOR_ARC(Do_overlap_2, do_overlap_2) CGAL_precondition(Kernel_arc_2_equals_Arc_2 || - dynamic_cast< const Kernel_arc_2* >(this) != NULL); + dynamic_cast< const Kernel_arc_2* >(this) != nullptr); return do_overlap_2(*dynamic_cast< const Kernel_arc_2* >(this), cv2); } @@ -1345,7 +1345,7 @@ public: intersect_2) CGAL_precondition(Kernel_arc_2_equals_Arc_2 || - dynamic_cast< const Kernel_arc_2* >(this) != NULL); + dynamic_cast< const Kernel_arc_2* >(this) != nullptr); return intersect_2( *dynamic_cast< const Kernel_arc_2* >(this), cv2, oi ); @@ -1449,7 +1449,7 @@ public: CGAL_CKvA_2_GRAB_CK_FUNCTOR_FOR_ARC(Trim_2, trim_2) CGAL_precondition(Kernel_arc_2_equals_Arc_2 || - dynamic_cast< const Kernel_arc_2* >(this) != NULL); + dynamic_cast< const Kernel_arc_2* >(this) != nullptr); return trim_2(*dynamic_cast< const Kernel_arc_2* >(this), p, q); } @@ -1467,7 +1467,7 @@ public: CGAL_CKvA_2_GRAB_CK_FUNCTOR_FOR_ARC(Split_2, split_2) CGAL_precondition(Kernel_arc_2_equals_Arc_2 || - dynamic_cast< const Kernel_arc_2* >(this) != NULL); + dynamic_cast< const Kernel_arc_2* >(this) != nullptr); split_2(*dynamic_cast< const Kernel_arc_2* >(this), p, s1, s2); } @@ -1483,7 +1483,7 @@ public: CGAL_CKvA_2_GRAB_CK_FUNCTOR_FOR_ARC(Are_mergeable_2, are_mergeable_2) CGAL_precondition(Kernel_arc_2_equals_Arc_2 || - dynamic_cast< const Kernel_arc_2* >(this) != NULL); + dynamic_cast< const Kernel_arc_2* >(this) != nullptr); return are_mergeable_2( *dynamic_cast< const Kernel_arc_2* >(this), cv2 ); @@ -1503,7 +1503,7 @@ public: CGAL_CKvA_2_GRAB_CK_FUNCTOR_FOR_ARC(Merge_2, merge_2) Kernel_arc_2 tmp; CGAL_precondition(Kernel_arc_2_equals_Arc_2 || - dynamic_cast< const Kernel_arc_2* >(this) != NULL); + dynamic_cast< const Kernel_arc_2* >(this) != nullptr); merge_2(*dynamic_cast< const Kernel_arc_2* >(this), cv2, tmp); return tmp; } @@ -1653,7 +1653,7 @@ public: Kernel_arc_2& trimmed2) const { CGAL_precondition(Kernel_arc_2_equals_Arc_2 || - dynamic_cast< const Kernel_arc_2* >(this) != NULL); + dynamic_cast< const Kernel_arc_2* >(this) != nullptr); const Kernel_arc_2& cv1 = static_cast< const Kernel_arc_2& >(*this); @@ -1956,7 +1956,7 @@ protected: CGAL_precondition(!is_on_bottom_top(where)); CGAL_assertion(Kernel_arc_2_equals_Arc_2 || - dynamic_cast< const Kernel_arc_2*>(this) != NULL); + dynamic_cast< const Kernel_arc_2*>(this) != nullptr); Kernel_arc_2::simplify(*dynamic_cast< const Kernel_arc_2*>(this), cv2); if(curve().is_identical(cv2.curve())) return CGAL::sign(arcno() - cv2.arcno()); diff --git a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Curve_renderer_facade.h b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Curve_renderer_facade.h index a48e518c08c..5336bfb358a 100644 --- a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Curve_renderer_facade.h +++ b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Curve_renderer_facade.h @@ -262,8 +262,8 @@ public: class Allocator > inline void draw(const Arc_2& arc, Container< std::vector< Coord_2 >, Allocator >& pts, - boost::optional< Coord_2 > *end_pt1 = NULL, - boost::optional< Coord_2 > *end_pt2 = NULL) { + boost::optional< Coord_2 > *end_pt1 = nullptr, + boost::optional< Coord_2 > *end_pt2 = nullptr) { #ifndef CGAL_CKVA_DUMMY_RENDERER Bbox_2 bbox; diff --git a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Curved_kernel_via_analysis_2_functors.h b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Curved_kernel_via_analysis_2_functors.h index 9520105d9be..dbbfdada53d 100644 --- a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Curved_kernel_via_analysis_2_functors.h +++ b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Curved_kernel_via_analysis_2_functors.h @@ -93,7 +93,7 @@ public: Curved_kernel_via_analysis_2_functor_base( Curved_kernel_via_analysis_2 *kernel) : _m_curved_kernel(kernel) { - CGAL_precondition(kernel != NULL); + CGAL_precondition(kernel != nullptr); } //!@} diff --git a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Make_x_monotone_2.h b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Make_x_monotone_2.h index 1e2b630628d..73e3654d2c1 100644 --- a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Make_x_monotone_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Make_x_monotone_2.h @@ -108,7 +108,7 @@ struct Make_x_monotone_2 : */ Make_x_monotone_2(Curved_kernel_via_analysis_2 *kernel) : _m_curved_kernel(kernel) { - CGAL_assertion(kernel != NULL); + CGAL_assertion(kernel != nullptr); } //!@} diff --git a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Point_2.h b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Point_2.h index d00859f803f..20e37bd5af3 100644 --- a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Point_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Point_2.h @@ -504,7 +504,7 @@ public: CGAL_CKvA_2_GRAB_CK_FUNCTOR_FOR_POINT(Compare_x_2, compare_x_2) CGAL_precondition(Kernel_point_2_equals_Point_2 || - dynamic_cast< const Kernel_point_2* >(this) != NULL); + dynamic_cast< const Kernel_point_2* >(this) != nullptr); return compare_x_2(*dynamic_cast< const Kernel_point_2* >(this), q); } @@ -527,7 +527,7 @@ public: CGAL_CKvA_2_GRAB_CK_FUNCTOR_FOR_POINT(Compare_xy_2, compare_xy_2) CGAL_precondition(Kernel_point_2_equals_Point_2 || - dynamic_cast< const Kernel_point_2* >(this) != NULL); + dynamic_cast< const Kernel_point_2* >(this) != nullptr); return compare_xy_2( *dynamic_cast< const Kernel_point_2* >(this), q, equal_x ); @@ -547,7 +547,7 @@ public: CGAL_CKvA_2_GRAB_CK_FUNCTOR_FOR_POINT(Is_on_2, is_on_2) CGAL_precondition(Kernel_point_2_equals_Point_2 || - dynamic_cast< const Kernel_point_2* >(this) != NULL); + dynamic_cast< const Kernel_point_2* >(this) != nullptr); return is_on_2(*dynamic_cast< const Kernel_point_2* >(this), curve); } diff --git a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Sweep_curves_adapter_2.h b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Sweep_curves_adapter_2.h index 57cc08578ce..6538627d3e7 100644 --- a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Sweep_curves_adapter_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/Sweep_curves_adapter_2.h @@ -66,7 +66,7 @@ public: //! standard constructor Compare_xy_2(SweepCurvesAdapter_2 *adapter) : _m_adapter(adapter) { - CGAL_assertion(adapter != NULL); + CGAL_assertion(adapter != nullptr); } result_type operator()(const Point_2& p1, const Point_2& p2) const { @@ -170,7 +170,7 @@ public: //! standard constructor Less_xy_2(SweepCurvesAdapter_2 *adapter) : _m_adapter(adapter) { - CGAL_assertion(adapter != NULL); + CGAL_assertion(adapter != nullptr); } /*! @@ -196,7 +196,7 @@ public: //! standard constructor Compare_y_at_x_2(SweepCurvesAdapter_2 *adapter) : _m_adapter(adapter) { - CGAL_assertion(adapter != NULL); + CGAL_assertion(adapter != nullptr); } result_type operator()(const Arc_2& cv, const Point_2& p) const { @@ -322,7 +322,7 @@ public: //! standard constructor Equal_y_at_x_2(SweepCurvesAdapter_2 *adapter) : _m_adapter(adapter) { - CGAL_assertion(adapter != NULL); + CGAL_assertion(adapter != nullptr); } /*! @@ -425,7 +425,7 @@ public: //! standard constructor Source_2(SweepCurvesAdapter_2 *adapter) : _m_adapter(adapter) { - CGAL_assertion(adapter != NULL); + CGAL_assertion(adapter != nullptr); } /*! @@ -452,7 +452,7 @@ public: //! standard constructor Target_2(SweepCurvesAdapter_2 *adapter) : _m_adapter(adapter) { - CGAL_assertion(adapter != NULL); + CGAL_assertion(adapter != nullptr); } /*! @@ -548,7 +548,7 @@ public: //! standard constructor New_endpoints_2(SweepCurvesAdapter_2 *adapter) : _m_adapter(adapter) { - CGAL_assertion(adapter != NULL); + CGAL_assertion(adapter != nullptr); } /*!\brief @@ -646,7 +646,7 @@ public: //! standard constructor Intersect_right_of_point_2(SweepCurvesAdapter_2 *adapter) : _m_adapter(adapter) { - CGAL_assertion(adapter != NULL); + CGAL_assertion(adapter != nullptr); } /*!\brief @@ -699,7 +699,7 @@ public: //! standard constructor Make_x_monotone_2(SweepCurvesAdapter_2 *adapter) : _m_adapter(adapter) { - CGAL_assertion(adapter != NULL); + CGAL_assertion(adapter != nullptr); } /*! diff --git a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/gfx/Curve_renderer_2.h b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/gfx/Curve_renderer_2.h index 1a1172b9ce6..e425f5f71b0 100644 --- a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/gfx/Curve_renderer_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/gfx/Curve_renderer_2.h @@ -288,7 +288,7 @@ public: //! \brief returns the drawing window and resolution void get_setup_parameters(CGAL::Bbox_2 *pbox, int& res_w_, int& res_h_) const { - if(pbox != NULL) + if(pbox != nullptr) *pbox = engine.window; res_w_ = engine.res_w; res_h_ = engine.res_h; @@ -332,7 +332,7 @@ private: //! computes pixel coordinates from rational point void get_pixel_coords(const Rational& x, const Rational& y, - Pixel_2& pix, Rational *ppix_x=NULL, Rational *ppix_y=NULL) + Pixel_2& pix, Rational *ppix_x=nullptr, Rational *ppix_y=nullptr) { Rational p_x = (x - engine.x_min_r) / engine.pixel_w_r, p_y = (y - engine.y_min_r) / engine.pixel_h_r; @@ -344,7 +344,7 @@ private: pix.x = static_cast(std::floor(CGAL::to_double(p_x))); pix.y = static_cast(std::floor(CGAL::to_double(p_y))); - if(ppix_x != NULL && ppix_y != NULL) { + if(ppix_x != nullptr && ppix_y != nullptr) { *ppix_x = p_x; *ppix_y = p_y; } @@ -428,8 +428,8 @@ template < class Coord_2, template < class, class > class Container, class Allocator > void draw(const Arc_2& arc, Container< std::vector< Coord_2 >, Allocator >& points, - boost::optional< Coord_2 > *end_pt1 = NULL, - boost::optional< Coord_2 > *end_pt2 = NULL) { + boost::optional< Coord_2 > *end_pt1 = nullptr, + boost::optional< Coord_2 > *end_pt2 = nullptr) { #ifdef CGAL_CKVA_CR_TIMING refine_timer.start(); @@ -616,7 +616,7 @@ void draw(const Arc_2& arc, #endif #ifdef CGAL_CKVA_RENDER_WITH_REFINEMENT - if(end_pt1 != NULL && loc_p1 == CGAL::ARR_INTERIOR && + if(end_pt1 != nullptr && loc_p1 == CGAL::ARR_INTERIOR && (clip_src || y_lower < engine.y_min_r || y_lower > engine.y_max_r)) { y_lower0 = (clip_src ? get_endpoint_y(arc, lower0, CGAL::ARR_MIN_END, false, @@ -626,7 +626,7 @@ void draw(const Arc_2& arc, *end_pt1 = Coord_2(CGAL::to_double(lower0), CGAL::to_double(y_lower0)); } - if(end_pt2 != NULL && loc_p2 == CGAL::ARR_INTERIOR && + if(end_pt2 != nullptr && loc_p2 == CGAL::ARR_INTERIOR && (clip_tgt || y_upper < engine.y_min_r || y_upper > engine.y_max_r)) { y_upper0 = (clip_tgt ? get_endpoint_y(arc, upper0, CGAL::ARR_MAX_END, false, @@ -650,9 +650,9 @@ void draw(const Arc_2& arc, get_pixel_coords(upper, y_upper, pix_2); #ifndef CGAL_CKVA_RENDER_WITH_REFINEMENT - if(end_pt1 != NULL) + if(end_pt1 != nullptr) *end_pt1 = Coord_2(pix_1.x, pix_1.y); - if(end_pt2 != NULL) + if(end_pt2 != nullptr) *end_pt2 = Coord_2(pix_2.x, pix_2.y); #endif diff --git a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/gfx/Curve_renderer_internals.h b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/gfx/Curve_renderer_internals.h index d2ac06551ed..034bb2a93ca 100644 --- a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/gfx/Curve_renderer_internals.h +++ b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/gfx/Curve_renderer_internals.h @@ -321,11 +321,11 @@ public: //! \brief evalutates a polynomial at certain x-coordinate static NT evaluate(const Poly_1& poly, const NT& x, - bool *error_bounds_ = NULL) + bool *error_bounds_ = nullptr) { typename Renderer_traits::Extract_eval extract; int n = poly.degree()+1, m = (n-1)>>1, odd = n&1; - if(error_bounds_ != NULL) + if(error_bounds_ != nullptr) *error_bounds_ = false; if(n == 1) return extract(poly.lcoeff(), error_bounds_); @@ -479,7 +479,7 @@ bool setup(const CGAL::Bbox_2& box_, int res_w_, int res_h_) pixel_w = (x_max - x_min) / res_w; pixel_h = (y_max - y_min) / res_h; - //srand(time(NULL)); + //srand(time(nullptr)); // from 0.1 to 0.5 double rmin = 0.1, rmax = 0.5; NT sx = pixel_w * static_cast(rmin + diff --git a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/gfx/Curve_renderer_traits.h b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/gfx/Curve_renderer_traits.h index 74f77e57d7d..6718122f035 100644 --- a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/gfx/Curve_renderer_traits.h +++ b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/gfx/Curve_renderer_traits.h @@ -223,8 +223,8 @@ struct Curve_renderer_traits_base typedef Coeff result_type; Coeff operator()(const Coeff& x, - bool *error_bounds = NULL) const { - if(error_bounds != NULL) + bool *error_bounds = nullptr) const { + if(error_bounds != nullptr) *error_bounds = false; return x; } @@ -309,13 +309,13 @@ struct Curve_renderer_traits, CORE::BigRat > : typedef Float result_type; Float operator()(const Coeff& x, - bool *error_bounds = NULL) const { + bool *error_bounds = nullptr) const { bool err_bnd; // err_bnd = (CGAL_ABS(l) < 1E-15 || CGAL_ABS(u) < 1E-15) || // ((l <= 0 && u >= 0)); Float l = x.inf(), u = x.sup(), mid = (l+u)/2; err_bnd = ((l < 0 && u > 0)||(l == 0 && u == 0)); - if(error_bounds != NULL) + if(error_bounds != nullptr) *error_bounds = err_bnd; //! ATTENTION!!! if smth is screwed up try to uncomment the line below //! this is very crucial for performance & stability @@ -456,13 +456,13 @@ struct Curve_renderer_traits, leda::rational > : typedef Float result_type; Float operator()(const Coeff& x, - bool *error_bounds = NULL) const { + bool *error_bounds = nullptr) const { bool err_bnd; // err_bnd = (CGAL_ABS(l) < 1E-15 || CGAL_ABS(u) < 1E-15) || // ((l <= 0 && u >= 0)); Float l = x.inf(), u = x.sup(), mid = (l+u)/2; err_bnd = ((l < 0 && u > 0)||(l == 0 && u == 0)); - if(error_bounds != NULL) + if(error_bounds != nullptr) *error_bounds = err_bnd; //! ATTENTION!!! if smth is screwed up try to uncomment the line below //! this is very crucial for performance & stability diff --git a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/gfx/Subdivision_2.h b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/gfx/Subdivision_2.h index 6f743a2ba77..5ebac8a1222 100644 --- a/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/gfx/Subdivision_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Curved_kernel_via_analysis_2/gfx/Subdivision_2.h @@ -243,7 +243,7 @@ private: template void Subdivision_2::draw(QPainter *painter_) { - if(!initialized||!polynomial_set||painter_==NULL) + if(!initialized||!polynomial_set||painter_==nullptr) return; painter = painter_; //std::cout << " P(x(y)): " << coeffs_x << std::endl; diff --git a/Arrangement_on_surface_2/include/CGAL/IO/Arr_text_formatter.h b/Arrangement_on_surface_2/include/CGAL/IO/Arr_text_formatter.h index e12efb4987a..51be06dd29e 100644 --- a/Arrangement_on_surface_2/include/CGAL/IO/Arr_text_formatter.h +++ b/Arrangement_on_surface_2/include/CGAL/IO/Arr_text_formatter.h @@ -76,19 +76,19 @@ public: /*! Default constructor.*/ Arr_text_formatter(): - m_out(NULL), - m_in(NULL) + m_out(nullptr), + m_in(nullptr) {} /*! Construct an output formatter. */ Arr_text_formatter(std::ostream& os) : m_out(&os), - m_in(NULL) + m_in(nullptr) {} /*! Construct an input formatter. */ Arr_text_formatter(std::istream& is) : - m_out(NULL), + m_out(nullptr), m_in(&is) {} @@ -111,14 +111,14 @@ public: /*! Get the output stream. */ inline std::ostream& out() { - CGAL_assertion(m_out != NULL); + CGAL_assertion(m_out != nullptr); return (*m_out); } /*! Get the input stream. */ inline std::istream& in() { - CGAL_assertion(m_in != NULL); + CGAL_assertion(m_in != nullptr); return (*m_in); } @@ -128,7 +128,7 @@ public: /*! Write a begin-arrangement comment. */ void write_arrangement_begin() { - CGAL_assertion(m_out != NULL); + CGAL_assertion(m_out != nullptr); m_old_out_mode = get_mode(*m_out); set_ascii_mode(*m_out); _write_comment("BEGIN ARRANGEMENT"); @@ -285,7 +285,7 @@ public: /*! Start reading an arrangement. */ void read_arrangement_begin() { - CGAL_assertion(m_in != NULL); + CGAL_assertion(m_in != nullptr); m_old_in_mode = get_mode(*m_in); set_ascii_mode(*m_in); _skip_comments(); @@ -299,7 +299,7 @@ public: } /*! Read a size value (with a label comment line before it). */ - Size read_size(const char* /* title */ = NULL) + Size read_size(const char* /* title */ = nullptr) { std::size_t val; @@ -448,7 +448,7 @@ protected: /*! Skip until end of line. */ void _skip_until_EOL() { - CGAL_assertion(m_in != NULL); + CGAL_assertion(m_in != nullptr); int c; while ((c = m_in->get()) != EOF && c != '\n') {}; @@ -457,7 +457,7 @@ protected: /*! Skip comment lines. */ void _skip_comments() { - CGAL_assertion(m_in != NULL); + CGAL_assertion(m_in != nullptr); int c = m_in->get(); if (c == ' ') diff --git a/Arrangement_on_surface_2/include/CGAL/IO/Arrangement_2_reader.h b/Arrangement_on_surface_2/include/CGAL/IO/Arrangement_2_reader.h index f54b55599eb..503dbfc365c 100644 --- a/Arrangement_on_surface_2/include/CGAL/IO/Arrangement_2_reader.h +++ b/Arrangement_on_surface_2/include/CGAL/IO/Arrangement_2_reader.h @@ -124,7 +124,7 @@ namespace CGAL { formatter.read_vertices_end(); // Read the DCEL halfedges and store them in the halfedges vector. - DHalfedge* he = NULL; + DHalfedge* he = nullptr; formatter.read_edges_begin(); m_halfedges.resize(number_of_halfedges); @@ -179,7 +179,7 @@ namespace CGAL { else { // Allocate a vertex at infinity. - new_v = m_arr_access.new_vertex(NULL, ps_x, ps_y); + new_v = m_arr_access.new_vertex(nullptr, ps_x, ps_y); } formatter.read_vertex_end(); @@ -213,7 +213,7 @@ namespace CGAL { else { // Allocate a new fictitious edge. - new_he = m_arr_access.new_edge(NULL); + new_he = m_arr_access.new_edge(nullptr); } // Set the cross pointers between the twin halfedges and the end vertices. @@ -276,7 +276,7 @@ namespace CGAL { // Read the current outer CCB. n = formatter.read_size("halfedges_on_outer_ccb"); - he = _read_ccb(formatter, n, new_occb, NULL); + he = _read_ccb(formatter, n, new_occb, nullptr); new_f->add_outer_ccb(new_occb, he); } formatter.read_outer_ccbs_end(); @@ -293,7 +293,7 @@ namespace CGAL { // Read the current inner CCB. n = formatter.read_size("halfedges_on_inner_ccb"); - he = _read_ccb(formatter, n, NULL, new_iccb); + he = _read_ccb(formatter, n, nullptr, new_iccb); new_f->add_inner_ccb(new_iccb, he); } formatter.read_inner_ccbs_end(); @@ -331,7 +331,7 @@ namespace CGAL { * \param boundary_size The number of halfedges along the boundary. * \param p_outer The outer CCB. * \param p_inner The inner CCB. - * \pre p_outer is valid and p_inner is NULL, or vice versa. + * \pre p_outer is valid and p_inner is nullptr, or vice versa. * \return A pointer to the first halfedge read. */ template @@ -340,8 +340,8 @@ namespace CGAL { DOuter_ccb* p_outer, DInner_ccb* p_inner) { - CGAL_assertion((p_outer != NULL && p_inner == NULL) || - (p_outer == NULL && p_inner != NULL)); + CGAL_assertion((p_outer != nullptr && p_inner == nullptr) || + (p_outer == nullptr && p_inner != nullptr)); formatter.read_ccb_halfedges_begin(); @@ -349,7 +349,7 @@ namespace CGAL { std::size_t first_idx = formatter.read_halfedge_index(); DHalfedge* first_he = m_halfedges [first_idx]; - if (p_outer != NULL) + if (p_outer != nullptr) first_he->set_outer_ccb(p_outer); else first_he->set_inner_ccb(p_inner); @@ -369,7 +369,7 @@ namespace CGAL { prev_he->set_next(curr_he); // Set the CCB. - if (p_outer != NULL) + if (p_outer != nullptr) curr_he->set_outer_ccb(p_outer); else curr_he->set_inner_ccb(p_inner); diff --git a/Arrangement_on_surface_2/include/CGAL/IO/Arrangement_2_writer.h b/Arrangement_on_surface_2/include/CGAL/IO/Arrangement_2_writer.h index e6948ad97d9..0b9713ea34a 100644 --- a/Arrangement_on_surface_2/include/CGAL/IO/Arrangement_2_writer.h +++ b/Arrangement_on_surface_2/include/CGAL/IO/Arrangement_2_writer.h @@ -91,7 +91,7 @@ namespace CGAL { /*! Constructor. */ Arrangement_2_writer(const Arrangement_2& arr) : m_arr(arr), - m_dcel(NULL), + m_dcel(nullptr), m_curr_v(0), m_curr_he(0) { @@ -328,7 +328,7 @@ namespace CGAL { /*! Get the number of edges along a given CCB. */ std::size_t _circulator_size(const DHalfedge* ccb) const { - CGAL_assertion(ccb != NULL); + CGAL_assertion(ccb != nullptr); std::size_t n = 0; const DHalfedge* curr = ccb; diff --git a/Arrangement_on_surface_2/include/CGAL/IO/Fig_stream.h b/Arrangement_on_surface_2/include/CGAL/IO/Fig_stream.h index 32d878ee56e..e8a02c683bd 100644 --- a/Arrangement_on_surface_2/include/CGAL/IO/Fig_stream.h +++ b/Arrangement_on_surface_2/include/CGAL/IO/Fig_stream.h @@ -1128,7 +1128,7 @@ public: { CGAL_precondition (_ofile.is_open()); - if (text == NULL || strlen(text) == 0) + if (text == nullptr || strlen(text) == 0) return; _write_text (pos, diff --git a/Arrangement_on_surface_2/include/CGAL/Surface_sweep_2/Arr_insertion_ss_visitor.h b/Arrangement_on_surface_2/include/CGAL/Surface_sweep_2/Arr_insertion_ss_visitor.h index a3de06274e4..45838d6d45d 100644 --- a/Arrangement_on_surface_2/include/CGAL/Surface_sweep_2/Arr_insertion_ss_visitor.h +++ b/Arrangement_on_surface_2/include/CGAL/Surface_sweep_2/Arr_insertion_ss_visitor.h @@ -116,7 +116,7 @@ template bool Arr_insertion_ss_visitor:: is_split_event(Subcurve* sc, Event* event) { - if (sc->last_curve().halfedge_handle() == Halfedge_handle(NULL)) return false; + if (sc->last_curve().halfedge_handle() == Halfedge_handle(nullptr)) return false; if (! sc->originating_subcurve1()) return (sc->left_event() != this->current_event()); diff --git a/Arrangement_on_surface_2/include/CGAL/Surface_sweep_2/Arr_insertion_traits_2.h b/Arrangement_on_surface_2/include/CGAL/Surface_sweep_2/Arr_insertion_traits_2.h index e98849b8aa9..7f91512dc88 100644 --- a/Arrangement_on_surface_2/include/CGAL/Surface_sweep_2/Arr_insertion_traits_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Surface_sweep_2/Arr_insertion_traits_2.h @@ -127,7 +127,7 @@ public: // X_monotone_curve_2 for(; oi != oi_end; ++oi) { base_overlap_cv = object_cast(&(*oi)); - if (base_overlap_cv != NULL) { + if (base_overlap_cv != nullptr) { // Add halfedge handles to the resulting curve. Halfedge_handle he; @@ -144,7 +144,7 @@ public: intersect_p = object_cast >(&(*oi)); - CGAL_assertion (intersect_p != NULL); + CGAL_assertion (intersect_p != nullptr); *oi = make_object(std::make_pair(Point_2(intersect_p->first), intersect_p->second)); diff --git a/Arrangement_on_surface_2/include/CGAL/Surface_sweep_2/Arr_overlay_ss_visitor.h b/Arrangement_on_surface_2/include/CGAL/Surface_sweep_2/Arr_overlay_ss_visitor.h index fc688892496..21a52219915 100644 --- a/Arrangement_on_surface_2/include/CGAL/Surface_sweep_2/Arr_overlay_ss_visitor.h +++ b/Arrangement_on_surface_2/include/CGAL/Surface_sweep_2/Arr_overlay_ss_visitor.h @@ -457,19 +457,19 @@ after_handle_event(Event* event, Status_line_iterator iter, bool flag) // point, we update the top fictitious halfedges for all subcurves incident // to this event. Event_subcurve_reverse_iterator rev_iter = event->right_curves_rbegin(); - Subcurve* sc_above = NULL; + Subcurve* sc_above = nullptr; if (iter != this->status_line_end()) sc_above = (*iter); - if (sc_above == NULL) { + if (sc_above == nullptr) { if (rev_iter != event->right_curves_rend()) { if ((*rev_iter)->color() == Gt2::BLUE) (*rev_iter)->set_red_top_face(m_overlay_helper.red_top_face()); else if ((*rev_iter)->color() == Gt2::RED) (*rev_iter)->set_blue_top_face(m_overlay_helper.blue_top_face()); - (*rev_iter)->set_subcurve_above(NULL); + (*rev_iter)->set_subcurve_above(nullptr); sc_above = *rev_iter; ++rev_iter; } @@ -484,7 +484,7 @@ after_handle_event(Event* event, Status_line_iterator iter, bool flag) if (! curr_sc->has_same_color(sc_above)) curr_sc->set_subcurve_above(sc_above); else { - if (sc_above->subcurve_above() != NULL) + if (sc_above->subcurve_above() != nullptr) curr_sc->set_subcurve_above(sc_above->subcurve_above()); else curr_sc->set_top_face(sc_above); @@ -771,7 +771,7 @@ insert_at_vertices(const X_monotone_curve_2& cv, // face. We have to find the identity of this containing blue face. Subcurve* sc_above = sc->subcurve_above(); red_face = red_he->face(); - blue_face = (sc_above != NULL) ? + blue_face = (sc_above != nullptr) ? sc_above->blue_halfedge_handle()->face() : sc->blue_top_face(); } else { @@ -781,7 +781,7 @@ insert_at_vertices(const X_monotone_curve_2& cv, // face. We have to find the identity of this containing red face. Subcurve* sc_above = sc->subcurve_above(); blue_face = blue_he->face(); - red_face = (sc_above != NULL) ? + red_face = (sc_above != nullptr) ? sc_above->red_halfedge_handle()->face() : sc->red_top_face(); } @@ -835,7 +835,7 @@ insert_isolated_vertex(const Point_2& pt, // sufficient to go at most two steps up. // There is nothing above the vertex - use the current red top face. Subcurve* sc_above = *iter; - if (sc_above == NULL) { + if (sc_above == nullptr) { red_face = m_overlay_helper.red_top_face(); } else { @@ -844,7 +844,7 @@ insert_isolated_vertex(const Point_2& pt, } else { sc_above = sc_above->subcurve_above(); - red_face = (sc_above != NULL) ? + red_face = (sc_above != nullptr) ? sc_above->red_halfedge_handle()->face() : m_overlay_helper.red_top_face(); } @@ -871,7 +871,7 @@ insert_isolated_vertex(const Point_2& pt, // sufficient to go at most two steps up. // If we do not find a blue halfedge, we use the current red top face. Subcurve* sc_above = *iter; - if (sc_above == NULL) { + if (sc_above == nullptr) { blue_face = m_overlay_helper.blue_top_face(); } else { @@ -880,7 +880,7 @@ insert_isolated_vertex(const Point_2& pt, } else { sc_above = sc_above->subcurve_above(); - blue_face = (sc_above != NULL) ? + blue_face = (sc_above != nullptr) ? sc_above->blue_halfedge_handle()->face() : m_overlay_helper.blue_top_face(); } @@ -991,20 +991,20 @@ _create_vertex(Event* event, (event->parameter_space_in_y() != ARR_INTERIOR)) { if (!red_handle) { - CGAL_assertion(blue_handle != NULL); + CGAL_assertion(blue_handle != nullptr); // Obtain the red face by looking for a subcurve above. const Subcurve* sc_above = sc->subcurve_above(); - Face_handle_red red_f = (sc_above != NULL) ? + Face_handle_red red_f = (sc_above != nullptr) ? sc_above->red_halfedge_handle()->face() : sc->red_top_face(); Handle_info info = std::make_pair(Cell_handle_red(red_f), *blue_handle); m_vertices_map[new_v] = info; return; } if (!blue_handle) { - CGAL_assertion(red_handle != NULL); + CGAL_assertion(red_handle != nullptr); // Obtain the blue face by looking for a subcurve above. const Subcurve* sc_above = sc->subcurve_above(); - Face_handle_blue blue_f = (sc_above != NULL) ? + Face_handle_blue blue_f = (sc_above != nullptr) ? sc_above->blue_halfedge_handle()->face() : sc->blue_top_face(); Handle_info info = std::make_pair(*red_handle, Cell_handle_blue(blue_f)); m_vertices_map[new_v] = info; @@ -1034,10 +1034,10 @@ _create_vertex(Event* event, // A blue vertex is located inside a red face. Obtain the red face // by looking for a subcurve above. const Subcurve* sc_above = sc->subcurve_above(); - Face_handle_red red_f = (sc_above != NULL) ? + Face_handle_red red_f = (sc_above != nullptr) ? sc_above->red_halfedge_handle()->face() : sc->red_top_face(); - CGAL_assertion(blue_handle != NULL); + CGAL_assertion(blue_handle != nullptr); const Vertex_handle_blue& blue_v = boost::get(*blue_handle); m_overlay_traits->create_vertex(red_f, blue_v, new_v); @@ -1048,10 +1048,10 @@ _create_vertex(Event* event, // A red vertex is located inside a blue face. Obtain the blue face // by looking for a subcurve above. const Subcurve* sc_above = sc->subcurve_above(); - Face_handle_blue blue_f = (sc_above != NULL) ? + Face_handle_blue blue_f = (sc_above != nullptr) ? sc_above->blue_halfedge_handle()->face() : sc->blue_top_face(); - CGAL_assertion(red_handle != NULL); + CGAL_assertion(red_handle != nullptr); const Vertex_handle_red& red_v = boost::get(*red_handle); m_overlay_traits->create_vertex(red_v, blue_f, new_v); @@ -1088,7 +1088,7 @@ _create_edge(Subcurve* sc, // We have a red edge on a blue face. Halfedge_handle_red red_he = sc->red_halfedge_handle(); Subcurve* sc_above = sc->subcurve_above(); - Face_handle_blue blue_f = (sc_above != NULL) ? + Face_handle_blue blue_f = (sc_above != nullptr) ? sc_above->blue_halfedge_handle()->face() : sc->blue_top_face(); m_overlay_traits->create_edge(red_he, blue_f, new_he); } @@ -1098,7 +1098,7 @@ _create_edge(Subcurve* sc, // We have a blue edge on a red face. Halfedge_handle_blue blue_he = sc->blue_halfedge_handle(); Subcurve* sc_above = sc->subcurve_above(); - Face_handle_red red_f = (sc_above != NULL) ? + Face_handle_red red_f = (sc_above != nullptr) ? sc_above->red_halfedge_handle()->face() : sc->red_top_face(); m_overlay_traits->create_edge(red_f, blue_he, new_he); } diff --git a/Arrangement_on_surface_2/include/CGAL/Surface_sweep_2/Arr_overlay_subcurve.h b/Arrangement_on_surface_2/include/CGAL/Surface_sweep_2/Arr_overlay_subcurve.h index 07db8cba4d9..8453be6a7d8 100644 --- a/Arrangement_on_surface_2/include/CGAL/Surface_sweep_2/Arr_overlay_subcurve.h +++ b/Arrangement_on_surface_2/include/CGAL/Surface_sweep_2/Arr_overlay_subcurve.h @@ -94,7 +94,7 @@ protected: union { const Face_red* red; const Face_blue* blue; - } m_top_face; // If m_above is NULL, points the top face in + } m_top_face; // If m_above is nullptr, points the top face in // the arrangement of the opposite color that // contains the subcurve. @@ -102,14 +102,14 @@ public: /*! Constructor. */ Arr_overlay_subcurve() : Base(), - m_above(NULL) - { m_top_face.red = NULL; } + m_above(nullptr) + { m_top_face.red = nullptr; } /*! constructor given a curve. */ Arr_overlay_subcurve(const X_monotone_curve_2& curve) : Base(curve), - m_above(NULL) - { m_top_face.red = NULL; } + m_above(nullptr) + { m_top_face.red = nullptr; } /*! Get the subcurve lying above above this subcurve in the status line. */ Self* subcurve_above() const { return m_above; } @@ -149,10 +149,10 @@ public: /*! Copy the top face from the given subcurve. */ void set_top_face(const Self* sc) { - CGAL_precondition(sc->m_above == NULL); + CGAL_precondition(sc->m_above == nullptr); // Mark there is no curve above and copy the face pointer. - m_above = NULL; + m_above = nullptr; m_top_face.red = sc->m_top_face.red; } }; diff --git a/Arrangement_on_surface_2/include/CGAL/Surface_sweep_2/Arr_overlay_traits_2.h b/Arrangement_on_surface_2/include/CGAL/Surface_sweep_2/Arr_overlay_traits_2.h index 6df312301ba..e189ccf9761 100644 --- a/Arrangement_on_surface_2/include/CGAL/Surface_sweep_2/Arr_overlay_traits_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Surface_sweep_2/Arr_overlay_traits_2.h @@ -314,25 +314,25 @@ public: void set_blue_cell(const Optional_cell_blue& cell_blue) { m_blue_cell = cell_blue; } - /*! Obtain the red cell handle or NULL if it doesn't exist. */ + /*! Obtain the red cell handle or nullptr if it doesn't exist. */ const Cell_handle_red* red_cell_handle() const - { return m_red_cell ? &(*m_red_cell) : NULL; } + { return m_red_cell ? &(*m_red_cell) : nullptr; } - /*! Obtain the blue cell handle or NULL if it doesn't exist. */ + /*! Obtain the blue cell handle or nullptr if it doesn't exist. */ const Cell_handle_blue* blue_cell_handle() const - { return m_blue_cell ? &(*m_blue_cell) : NULL; } + { return m_blue_cell ? &(*m_blue_cell) : nullptr; } - /*! Obtain the red vertex handle or NULL if it doesn't exist. */ + /*! Obtain the red vertex handle or nullptr if it doesn't exist. */ const Vertex_handle_red* red_vertex_handle() const { - return m_red_cell ? boost::get(&(*m_red_cell)) : NULL; + return m_red_cell ? boost::get(&(*m_red_cell)) : nullptr; } - /*! Obtain the blue vertex handle or NULL if it doesn't exist. */ + /*! Obtain the blue vertex handle or nullptr if it doesn't exist. */ const Vertex_handle_blue* blue_vertex_handle() const { return - m_blue_cell ? boost::get(&(*m_blue_cell)) : NULL; + m_blue_cell ? boost::get(&(*m_blue_cell)) : nullptr; } }; @@ -437,7 +437,7 @@ public: while (oi != oi_end) { base_ipt = object_cast >(&(*oi)); - if (base_ipt != NULL) { + if (base_ipt != nullptr) { // We have a red-blue intersection point, so we attach the // intersecting red and blue halfedges to it. Optional_cell_red red_cell; @@ -464,7 +464,7 @@ public: } else { overlap_xcv = object_cast(&(*oi)); - CGAL_assertion(overlap_xcv != NULL); + CGAL_assertion(overlap_xcv != nullptr); // We have a red-blue overlap, so we mark the curve accordingly. Halfedge_handle_red red_he; diff --git a/BGL/doc/BGL/graph_traits.txt b/BGL/doc/BGL/graph_traits.txt index b16313ed534..1413197ecc6 100644 --- a/BGL/doc/BGL/graph_traits.txt +++ b/BGL/doc/BGL/graph_traits.txt @@ -116,7 +116,7 @@ For convenience, the type `edge_descriptor` is hashable using the functor `CGAL:
  • The item class used by `CGAL::Linear_cell_complex_for_combinatorial_map` must have both 0-attributes and 2-attributes enabled.
  • -
  • No dart is 1-free, nor 2-free. Holes in a mesh are represented by using the same convention than for `CGAL::Polyhedron_3` and `CGAL::Surface_mesh`: a dart d belongs to a border if the 2-attribute of beta<2>(d) is NULL.
  • +
  • No dart is 1-free, nor 2-free. Holes in a mesh are represented by using the same convention than for `CGAL::Polyhedron_3` and `CGAL::Surface_mesh`: a dart d belongs to a border if the 2-attribute of beta<2>(d) is nullptr.
  • All darts of the linear cell complexes must be associated with a 2-attribute, except darts that represent holes.
  • diff --git a/BGL/include/CGAL/boost/graph/Face_filtered_graph.h b/BGL/include/CGAL/boost/graph/Face_filtered_graph.h index 8cf3c7884eb..6f0e29428a1 100644 --- a/BGL/include/CGAL/boost/graph/Face_filtered_graph.h +++ b/BGL/include/CGAL/boost/graph/Face_filtered_graph.h @@ -370,12 +370,12 @@ struct Face_filtered_graph {} Is_simplex_valid() - :adapter(NULL) + :adapter(nullptr) {} template bool operator()(Simplex s) { - CGAL_assertion(adapter!=NULL); + CGAL_assertion(adapter!=nullptr); return (adapter->is_in_cc(s)); } const Self* adapter; diff --git a/BGL/include/CGAL/boost/graph/Graph_with_descriptor_with_graph.h b/BGL/include/CGAL/boost/graph/Graph_with_descriptor_with_graph.h index 7c515e3a608..28ec04e99ec 100644 --- a/BGL/include/CGAL/boost/graph/Graph_with_descriptor_with_graph.h +++ b/BGL/include/CGAL/boost/graph/Graph_with_descriptor_with_graph.h @@ -44,11 +44,11 @@ public: Descriptor descriptor; Gwdwg_descriptor() - : graph(NULL), descriptor() + : graph(nullptr), descriptor() {} Gwdwg_descriptor(Descriptor descriptor) - : graph(NULL), descriptor(descriptor) + : graph(nullptr), descriptor(descriptor) {} Gwdwg_descriptor(Descriptor descriptor, Graph& graph) @@ -60,7 +60,7 @@ template bool operator==(const Gwdwg_descriptor& lhs, const Gwdwg_descriptor& rhs) { - CGAL_assertion( lhs.graph == rhs.graph || rhs.graph==NULL || lhs.graph==NULL); + CGAL_assertion( lhs.graph == rhs.graph || rhs.graph==nullptr || lhs.graph==nullptr); return lhs.descriptor == rhs.descriptor; } @@ -75,7 +75,7 @@ template bool operator<(const Gwdwg_descriptor& lhs, const Gwdwg_descriptor& rhs) { - CGAL_assertion( lhs.graph == rhs.graph || rhs.graph==NULL || lhs.graph==NULL); + CGAL_assertion( lhs.graph == rhs.graph || rhs.graph==nullptr || lhs.graph==nullptr); return lhs.descriptor < rhs.descriptor; } @@ -83,7 +83,7 @@ template bool operator>(const Gwdwg_descriptor& lhs, const Gwdwg_descriptor& rhs) { - CGAL_assertion( lhs.graph == rhs.graph || rhs.graph==NULL || lhs.graph==NULL); + CGAL_assertion( lhs.graph == rhs.graph || rhs.graph==nullptr || lhs.graph==nullptr); return lhs.descriptor > rhs.descriptor; } @@ -91,7 +91,7 @@ template bool operator<=(const Gwdwg_descriptor& lhs, const Gwdwg_descriptor& rhs) { - CGAL_assertion( lhs.graph == rhs.graph || rhs.graph==NULL || lhs.graph==NULL); + CGAL_assertion( lhs.graph == rhs.graph || rhs.graph==nullptr || lhs.graph==nullptr); return lhs.descriptor <= rhs.descriptor; } @@ -99,7 +99,7 @@ template bool operator>=(const Gwdwg_descriptor& lhs, const Gwdwg_descriptor& rhs) { - CGAL_assertion( lhs.graph == rhs.graph || rhs.graph==NULL || lhs.graph==NULL); + CGAL_assertion( lhs.graph == rhs.graph || rhs.graph==nullptr || lhs.graph==nullptr); return lhs.descriptor >= rhs.descriptor; } @@ -142,7 +142,7 @@ struct Graph_with_descriptor_with_graph typedef Gwdwg_descriptor face_descriptor; Graph_with_descriptor_with_graph() - : graph(NULL) + : graph(nullptr) {} Graph_with_descriptor_with_graph(Graph& graph) @@ -156,7 +156,7 @@ struct Descriptor2Descriptor: public CGAL::cpp98::unary_function& gpm, const Descriptor& d) { - CGAL_assertion(gpm.graph!=NULL); + CGAL_assertion(gpm.graph!=nullptr); CGAL_assertion(d.graph == gpm.graph); return get(gpm.pm, d.descriptor); } @@ -738,7 +738,7 @@ struct Graph_with_descriptor_with_graph_property_map { void put(const Graph_with_descriptor_with_graph_property_map& gpm, const Descriptor& d, const value_type& v) { - CGAL_assertion(gpm.graph!=NULL); + CGAL_assertion(gpm.graph!=nullptr); CGAL_assertion(d.graph == gpm.graph); put(gpm.pm, d.descriptor, v); } @@ -762,7 +762,7 @@ struct Graph_with_descriptor_with_graph_property_map& gpm, const Descriptor& d) { - CGAL_assertion(gpm.graph!=NULL); + CGAL_assertion(gpm.graph!=nullptr); CGAL_assertion(d.graph == gpm.graph); return get(gpm.pm, d.descriptor); } @@ -784,7 +784,7 @@ struct Graph_with_descriptor_with_graph_property_map& gpm, const Descriptor& d, const value_type& v) { - CGAL_assertion(gpm.graph!=NULL); + CGAL_assertion(gpm.graph!=nullptr); CGAL_assertion(d.graph == gpm.graph); put(gpm.pm, d.descriptor, v); } diff --git a/BGL/include/CGAL/boost/graph/METIS/partition_dual_graph.h b/BGL/include/CGAL/boost/graph/METIS/partition_dual_graph.h index 7e2a15870a7..16b3a781025 100644 --- a/BGL/include/CGAL/boost/graph/METIS/partition_dual_graph.h +++ b/BGL/include/CGAL/boost/graph/METIS/partition_dual_graph.h @@ -97,11 +97,11 @@ void partition_dual_graph(const TriangleMesh& tm, // partition info for the nodes idx_t* npart = (idx_t*) calloc(num_vertices(tm), sizeof(idx_t)); - CGAL_assertion(npart != NULL); + CGAL_assertion(npart != nullptr); // partition info for the elements idx_t* epart = (idx_t*) calloc(num_faces(tm), sizeof(idx_t)); - CGAL_assertion(epart != NULL); + CGAL_assertion(epart != nullptr); // do not support Fortran-style arrays CGAL_assertion((*options)[METIS_OPTION_NUMBERING] == -1 || // default initialization is '-1' @@ -109,9 +109,9 @@ void partition_dual_graph(const TriangleMesh& tm, CGAL_assertion_code(int ret =) METIS_PartMeshDual(&ne, &nn, eptr, eind, - NULL /* elements weights*/, NULL /*elements sizes*/, + nullptr /* elements weights*/, nullptr /*elements sizes*/, &ncommon, &nparts, - NULL /* partitions weights */, + nullptr /* partitions weights */, *options, &objval, epart, npart); diff --git a/BGL/include/CGAL/boost/graph/METIS/partition_graph.h b/BGL/include/CGAL/boost/graph/METIS/partition_graph.h index d0f3e56b759..b63586b3bcb 100644 --- a/BGL/include/CGAL/boost/graph/METIS/partition_graph.h +++ b/BGL/include/CGAL/boost/graph/METIS/partition_graph.h @@ -129,11 +129,11 @@ void partition_graph(const TriangleMesh& tm, // partition info for the nodes idx_t* npart = (idx_t*) calloc(num_vertices(tm), sizeof(idx_t)); - CGAL_assertion(npart != NULL); + CGAL_assertion(npart != nullptr); // partition info for the elements idx_t* epart = (idx_t*) calloc(num_faces(tm), sizeof(idx_t)); - CGAL_assertion(epart != NULL); + CGAL_assertion(epart != nullptr); // do not support Fortran-style arrays CGAL_assertion((*options)[METIS_OPTION_NUMBERING] == -1 || // default initialization is '-1' @@ -141,9 +141,9 @@ void partition_graph(const TriangleMesh& tm, CGAL_assertion_code(int ret =) METIS_PartMeshNodal(&ne, &nn, eptr, eind, - NULL /* nodes weights */, NULL /* nodes sizes */, + nullptr /* nodes weights */, nullptr /* nodes sizes */, &nparts, - NULL /* partitions weights */, + nullptr /* partitions weights */, *options, &objval, epart, npart); diff --git a/BGL/include/CGAL/boost/graph/Seam_mesh.h b/BGL/include/CGAL/boost/graph/Seam_mesh.h index 73e35ae949e..2a85852d4ff 100644 --- a/BGL/include/CGAL/boost/graph/Seam_mesh.h +++ b/BGL/include/CGAL/boost/graph/Seam_mesh.h @@ -236,7 +236,7 @@ public: bool seam; const Self* mesh_; - halfedge_iterator() : hd(), end(), seam(false), mesh_(NULL) { } + halfedge_iterator() : hd(), end(), seam(false), mesh_(nullptr) { } halfedge_iterator(const Iterator_range& ir, const Self* m) : hd(ir.first), end(ir.second), seam(false), mesh_(m) @@ -349,7 +349,7 @@ public: public: /// Constructors - vertex_iterator() : hd(), end(), mesh_(NULL) { } + vertex_iterator() : hd(), end(), mesh_(nullptr) { } vertex_iterator(const Iterator_range& ir, const Self* m) : hd(ir.first), end(ir.second), mesh_(m) @@ -432,7 +432,7 @@ public: #endif edge_descriptor() - : mesh_(NULL) + : mesh_(nullptr) {} edge_descriptor(const halfedge_descriptor& hd, const Self* m) @@ -469,7 +469,7 @@ public: const Self* mesh_; public: - edge_iterator() : hd(), end(), seam(false), mesh_(NULL) { } + edge_iterator() : hd(), end(), seam(false), mesh_(nullptr) { } edge_iterator(const Iterator_range& ir, const Self* m) : hd(ir.first), end(ir.second), seam(false), mesh_(m) diff --git a/BGL/include/CGAL/boost/graph/internal/OM_iterator_from_circulator.h b/BGL/include/CGAL/boost/graph/internal/OM_iterator_from_circulator.h index b30f1e9bd13..20db9db7b48 100644 --- a/BGL/include/CGAL/boost/graph/internal/OM_iterator_from_circulator.h +++ b/BGL/include/CGAL/boost/graph/internal/OM_iterator_from_circulator.h @@ -161,7 +161,7 @@ public: } bool operator<( const Self& i) const { - CGAL_assertion( m_anchor != NULL); + CGAL_assertion( m_anchor != nullptr); CGAL_assertion( m_anchor == i.m_anchor); return ( (m_winding < i.m_winding) || ( (m_winding == i.m_winding) diff --git a/BGL/include/CGAL/boost/graph/iterator.h b/BGL/include/CGAL/boost/graph/iterator.h index 83b3c001d71..c952e8f54a7 100644 --- a/BGL/include/CGAL/boost/graph/iterator.h +++ b/BGL/include/CGAL/boost/graph/iterator.h @@ -42,7 +42,7 @@ struct Edge { const G* g; Edge() - : g(NULL) + : g(nullptr) {} Edge(const G& g) @@ -63,7 +63,7 @@ struct Opposite_edge { const G* g; Opposite_edge() - : g(NULL) + : g(nullptr) {} Opposite_edge(const G& g) @@ -84,7 +84,7 @@ struct Opposite_halfedge { const G* g; Opposite_halfedge() - : g(NULL) + : g(nullptr) {} Opposite_halfedge(const G& g) @@ -105,7 +105,7 @@ struct Target { const G* g; Target() - : g(NULL) + : g(nullptr) {} Target(const G& g) @@ -126,7 +126,7 @@ struct Source { const G* g; Source() - : g(NULL) + : g(nullptr) {} Source(const G& g) @@ -147,7 +147,7 @@ struct Face { const G* g; Face() - : g(NULL) + : g(nullptr) {} Face(const G& g) @@ -167,7 +167,7 @@ struct Opposite_face { const G* g; Opposite_face() - : g(NULL) + : g(nullptr) {} Opposite_face(const G& g) @@ -230,7 +230,7 @@ public: operator bool_type() const { - return (! (this->base() == NULL)) ? + return (! (this->base() == nullptr)) ? &Halfedge_around_source_iterator::this_type_does_not_support_comparisons : 0; } @@ -245,7 +245,7 @@ public: bool operator== (void* ) const { - return g == NULL; + return g == nullptr; } reference operator*() const @@ -330,7 +330,7 @@ public: operator bool_type() const { - return (! (this->base() == NULL)) ? + return (! (this->base() == nullptr)) ? &Halfedge_around_target_iterator::this_type_does_not_support_comparisons : 0; } @@ -345,7 +345,7 @@ public: bool operator== (void* ) const { - return g == NULL; + return g == nullptr; } reference operator*() const @@ -429,7 +429,7 @@ public: operator bool_type() const { - return (! (this->base() == NULL)) ? + return (! (this->base() == nullptr)) ? &Halfedge_around_face_iterator::this_type_does_not_support_comparisons : 0; } @@ -444,7 +444,7 @@ public: Self& operator++() { - CGAL_assertion(g != NULL); + CGAL_assertion(g != nullptr); pos = next(pos,*g); if ( pos == anchor) ++winding; @@ -453,7 +453,7 @@ public: Self operator++(int) { - CGAL_assertion(g != NULL); + CGAL_assertion(g != nullptr); Self tmp = *this; ++*this; return tmp; @@ -461,7 +461,7 @@ public: Self& operator--() { - CGAL_assertion(g != NULL); + CGAL_assertion(g != nullptr); if ( pos == anchor) --winding; @@ -471,7 +471,7 @@ public: Self operator--(int) { - CGAL_assertion(g != NULL); + CGAL_assertion(g != nullptr); Self tmp = *this; --*this; return tmp; @@ -539,13 +539,13 @@ public: operator bool_type() const { - return (! (this->base_reference() == NULL)) ? + return (! (this->base_reference() == nullptr)) ? &Halfedge_around_source_circulator::this_type_does_not_support_comparisons : 0; } bool operator== (void*) const { - return this->base_reference() == NULL; + return this->base_reference() == nullptr; } private: @@ -597,13 +597,13 @@ public: operator bool_type() const { - return (! (this->base_reference() == NULL)) ? + return (! (this->base_reference() == nullptr)) ? &Face_around_target_circulator::this_type_does_not_support_comparisons : 0; } bool operator== (void*) const { - return this->base_reference() == NULL; + return this->base_reference() == nullptr; } @@ -672,27 +672,27 @@ public: operator bool_type() const { - return (! (g == NULL)) ? + return (! (g == nullptr)) ? &Halfedge_around_target_circulator::this_type_does_not_support_comparisons : 0; } bool operator== (void* ) const { - return g == NULL; + return g == nullptr; } Self& operator++() { - CGAL_assertion(g != NULL); + CGAL_assertion(g != nullptr); pos = opposite(next(pos,*g),*g); return *this; } Self operator++(int) { - CGAL_assertion(g != NULL); + CGAL_assertion(g != nullptr); Self tmp = *this; ++*this; return tmp; @@ -700,14 +700,14 @@ public: Self& operator--() { - CGAL_assertion(g != NULL); + CGAL_assertion(g != nullptr); pos = prev(opposite(pos,*g),*g); return *this; } Self operator--(int) { - CGAL_assertion(g != NULL); + CGAL_assertion(g != nullptr); Self tmp = *this; --*this; return tmp; @@ -769,25 +769,25 @@ public: operator bool_type() const { - return (! (g == NULL)) ? + return (! (g == nullptr)) ? &Halfedge_around_face_circulator::this_type_does_not_support_comparisons : 0; } bool operator== (void* ) const { - return g == NULL; + return g == nullptr; } Self& operator++() { - CGAL_assertion(g != NULL); + CGAL_assertion(g != nullptr); pos = next(pos,*g); return *this; } Self operator++(int) { - CGAL_assertion(g != NULL); + CGAL_assertion(g != nullptr); Self tmp = *this; ++*this; return tmp; @@ -795,14 +795,14 @@ public: Self& operator--() { - CGAL_assertion(g != NULL); + CGAL_assertion(g != nullptr); pos = prev(pos,*g); return *this; } Self operator--(int) { - CGAL_assertion(g != NULL); + CGAL_assertion(g != nullptr); Self tmp = *this; --*this; return tmp; @@ -1025,13 +1025,13 @@ public: operator bool_type() const { - return (! (this->base_reference() == NULL)) ? + return (! (this->base_reference() == nullptr)) ? &Vertex_around_face_circulator::this_type_does_not_support_comparisons : 0; } bool operator== (void*) const { - return this->base_reference()== NULL; + return this->base_reference()== nullptr; } private: friend class boost::iterator_core_access; @@ -1079,13 +1079,13 @@ public: operator bool_type() const { - return (! (this->base_reference() == NULL)) ? + return (! (this->base_reference() == nullptr)) ? &Vertex_around_face_iterator::this_type_does_not_support_comparisons : 0; } bool operator== (void*) const { - return this->base_reference()== NULL; + return this->base_reference()== nullptr; } private: friend class boost::iterator_core_access; @@ -1209,13 +1209,13 @@ public: operator bool_type() const { - return (! (this->base_reference() == NULL)) ? + return (! (this->base_reference() == nullptr)) ? &Vertex_around_target_circulator::this_type_does_not_support_comparisons : 0; } bool operator== (void*) const { - return this->base_reference()== NULL; + return this->base_reference()== nullptr; } private: @@ -1267,7 +1267,7 @@ public: operator bool_type() const { - return (! (this->base_reference() == NULL)) ? + return (! (this->base_reference() == nullptr)) ? &Vertex_around_target_iterator::this_type_does_not_support_comparisons : 0; } private: @@ -1354,7 +1354,7 @@ public: operator bool_type() const { - return (! (this->base_reference() == NULL)) ? + return (! (this->base_reference() == nullptr)) ? &Out_edge_iterator::this_type_does_not_support_comparisons : 0; } @@ -1396,7 +1396,7 @@ public: operator bool_type() const { - return (! (this->base_reference() == NULL)) ? + return (! (this->base_reference() == nullptr)) ? &In_edge_iterator::this_type_does_not_support_comparisons : 0; } diff --git a/BGL/include/CGAL/boost/graph/properties_OpenMesh.h b/BGL/include/CGAL/boost/graph/properties_OpenMesh.h index 4a2569c348a..300f1b8644e 100644 --- a/BGL/include/CGAL/boost/graph/properties_OpenMesh.h +++ b/BGL/include/CGAL/boost/graph/properties_OpenMesh.h @@ -197,7 +197,7 @@ public: typedef typename boost::graph_traits::vertex_descriptor key_type; OM_point_pmap() - : sm_(NULL) + : sm_(nullptr) {} OM_point_pmap(const OpenMesh& sm) @@ -213,7 +213,7 @@ public: #if defined(CGAL_USE_OM_POINTS) return sm_->point(v); #else - CGAL_assertion(sm_!=NULL); + CGAL_assertion(sm_!=nullptr); typename OpenMesh::Point const& omp = sm_->point(v); return value_type(omp[0], omp[1], omp[2]); #endif @@ -221,11 +221,11 @@ public: inline friend reference get(const OM_point_pmap& pm, key_type v) { - CGAL_precondition(pm.sm_!=NULL); + CGAL_precondition(pm.sm_!=nullptr); #if defined(CGAL_USE_OM_POINTS) return pm.sm_->point(v); #else - CGAL_assertion(pm.sm_!=NULL); + CGAL_assertion(pm.sm_!=nullptr); typename OpenMesh::Point const& omp = pm.sm_->point(v); return value_type(omp[0], omp[1], omp[2]); #endif @@ -233,7 +233,7 @@ public: inline friend void put(const OM_point_pmap& pm, key_type v, const value_type& p) { - CGAL_precondition(pm.sm_!=NULL); + CGAL_precondition(pm.sm_!=nullptr); #if defined(CGAL_USE_OM_POINTS) const_cast(*pm.sm_).set_point(v,p); #else diff --git a/BGL/include/CGAL/boost/graph/property_maps.h b/BGL/include/CGAL/boost/graph/property_maps.h index fb6c8b486da..3df966fa436 100644 --- a/BGL/include/CGAL/boost/graph/property_maps.h +++ b/BGL/include/CGAL/boost/graph/property_maps.h @@ -38,7 +38,7 @@ struct Triangle_from_face_descriptor_map{ VertexPointMap m_vpm; Triangle_from_face_descriptor_map() - : m_tm(NULL) + : m_tm(nullptr) {} Triangle_from_face_descriptor_map(TriangleMesh const* tm) @@ -93,7 +93,7 @@ template < class PolygonMesh, struct Segment_from_edge_descriptor_map{ Segment_from_edge_descriptor_map() - : m_pm(NULL) + : m_pm(nullptr) {} Segment_from_edge_descriptor_map(PolygonMesh const * pm) @@ -143,7 +143,7 @@ template ::type > struct One_point_from_face_descriptor_map{ One_point_from_face_descriptor_map() - : m_pm(NULL) + : m_pm(nullptr) {} One_point_from_face_descriptor_map(PolygonMesh const * g) @@ -187,7 +187,7 @@ struct One_point_from_face_descriptor_map{ template < class PolygonMesh, class VertexPointMap = typename boost::property_map::type > struct Source_point_from_edge_descriptor_map{ - Source_point_from_edge_descriptor_map() : m_pm(NULL) + Source_point_from_edge_descriptor_map() : m_pm(nullptr) {} Source_point_from_edge_descriptor_map(PolygonMesh const * g) diff --git a/BGL/include/CGAL/boost/graph/split_graph_into_polylines.h b/BGL/include/CGAL/boost/graph/split_graph_into_polylines.h index ae78df3ce8c..f6af9843234 100644 --- a/BGL/include/CGAL/boost/graph/split_graph_into_polylines.h +++ b/BGL/include/CGAL/boost/graph/split_graph_into_polylines.h @@ -201,7 +201,16 @@ void duplicate_terminal_vertices(Graph& graph, } // namespace internal - +template +void +split_graph_into_polylines(const Graph& graph, + Visitor& polyline_visitor, + IsTerminal is_terminal, + LessForVertexDescriptors less); + /*! \ingroup PkgBGLRef splits into polylines the graph `g` at vertices of degree greater than 2 diff --git a/Boolean_set_operations_2/archive/demo/Boolean_set_operations_2_GraphicsView/CMakeLists.txt b/Boolean_set_operations_2/archive/demo/Boolean_set_operations_2_GraphicsView/CMakeLists.txt index 142cc80dda3..d7246839fe3 100644 --- a/Boolean_set_operations_2/archive/demo/Boolean_set_operations_2_GraphicsView/CMakeLists.txt +++ b/Boolean_set_operations_2/archive/demo/Boolean_set_operations_2_GraphicsView/CMakeLists.txt @@ -30,9 +30,8 @@ set(CMAKE_AUTOMOC ON) # The executable itself. add_executable ( boolean_operations_2 ${CMAKE_CURRENT_SOURCE_DIR}/boolean_operations_2.cpp ${CGAL_Qt5_MOC_FILES} ${CDT_UI_FILES} ${CGAL_Qt5_RESOURCE_FILES} ) - qt5_use_modules(boolean_operations_2 Widgets Script Svg) # Link with Qt libraries - target_link_libraries( boolean_operations_2 ${QT_LIBRARIES} ) + target_link_libraries( boolean_operations_2 Qt5::Widgets Qt5::Script Qt5::Svg ) # Link with CGAL target_link_libraries( boolean_operations_2 ${CGAL_LIBRARIES} ${CGAL_3RD_PARTY_LIBRARIES}) diff --git a/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_agg_meta_traits.h b/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_agg_meta_traits.h index c14ad00b0c8..2ab4df37c96 100644 --- a/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_agg_meta_traits.h +++ b/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_agg_meta_traits.h @@ -50,7 +50,7 @@ protected: public: Gps_agg_curve_data() : Base(), - m_arr(NULL), + m_arr(nullptr), m_bc(0), m_twin_bc(0) {} @@ -195,7 +195,7 @@ public: for (; oi != oi_end; ++oi) { base_pt = object_cast >(&(*oi)); - if (base_pt != NULL) { + if (base_pt != nullptr) { Point_2 point_plus(base_pt->first); // the extended point *oi = CGAL::make_object(std::make_pair(point_plus, base_pt->second)); @@ -203,7 +203,7 @@ public: else { overlap_cv = object_cast(&(*oi)); - if (overlap_cv != NULL) { + if (overlap_cv != nullptr) { unsigned int ov_bc; unsigned int ov_twin_bc; if (m_base_cmp_endpoints(cv1) == m_base_cmp_endpoints(cv2)) { diff --git a/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_on_surface_base_2.h b/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_on_surface_base_2.h index a603269074d..8a57762d8c9 100644 --- a/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_on_surface_base_2.h +++ b/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_on_surface_base_2.h @@ -1211,6 +1211,7 @@ protected: for (Halfedge_iterator itr = arr->halfedges_begin(); itr != arr->halfedges_end(); ++itr) { Halfedge_handle h = itr; + CGAL_assertion(h->face() != Face_handle()); if (h->face()->id_not_set()) continue; CGAL_assertion(h->flag()!=NOT_VISITED); @@ -1249,10 +1250,17 @@ protected: inner_ccb_and_new_face_pairs.push_back( std::make_pair(inner_ccb, f) ); } else{ - // we never create more outer ccb than what was available - CGAL_assertion(!outer_ccbs_to_remove.empty()); - typename Aos_2::Dcel::Outer_ccb* outer_ccb = outer_ccbs_to_remove.back(); - outer_ccbs_to_remove.pop_back(); + // create a new outer ccb if none is available + typename Aos_2::Dcel::Outer_ccb* outer_ccb; + if (!outer_ccbs_to_remove.empty()) + { + outer_ccb = outer_ccbs_to_remove.back(); + outer_ccbs_to_remove.pop_back(); + } + else{ + outer_ccb = accessor.new_outer_ccb(); + outer_ccb->set_face(f); + } Halfedge_handle hstart=h; do{ _halfedge(h)->set_outer_ccb(outer_ccb); diff --git a/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_polygon_simplifier.h b/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_polygon_simplifier.h index 562a381c35f..81c998ea5ed 100644 --- a/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_polygon_simplifier.h +++ b/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_polygon_simplifier.h @@ -115,9 +115,9 @@ public: /*! Destructor. */ ~Gps_polygon_simplifier() { - if (m_own_traits && (m_traits != NULL)) { + if (m_own_traits && (m_traits != nullptr)) { delete m_traits; - m_traits = NULL; + m_traits = nullptr; } } diff --git a/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_simplifier_traits.h b/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_simplifier_traits.h index 08a972a5c3f..9d835327bfc 100644 --- a/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_simplifier_traits.h +++ b/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_simplifier_traits.h @@ -233,7 +233,7 @@ public: { base_pt = object_cast >(&(*oi)); - if (base_pt != NULL) + if (base_pt != nullptr) { Point_data pt_data(m_self_tr->invalid_index()); Point_2 point_plus (base_pt->first, pt_data); // the extended point @@ -244,7 +244,7 @@ public: { overlap_cv = object_cast (&(*oi)); - if (overlap_cv != NULL) + if (overlap_cv != nullptr) { unsigned int ov_bc; unsigned int ov_twin_bc; diff --git a/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_traits_decorator.h b/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_traits_decorator.h index a38e9b81fe6..7ed21d63289 100644 --- a/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_traits_decorator.h +++ b/Boolean_set_operations_2/include/CGAL/Boolean_set_operations_2/Gps_traits_decorator.h @@ -483,7 +483,7 @@ public: { base_pt = object_cast >(&(*oi)); - if (base_pt != NULL) + if (base_pt != nullptr) { Point_2 point_plus (base_pt->first); // the extended point *oi = CGAL::make_object(std::make_pair(point_plus, @@ -492,7 +492,7 @@ public: else { overlap_cv = object_cast (&(*oi)); - CGAL_assertion(overlap_cv != NULL); + CGAL_assertion(overlap_cv != nullptr); *oi = CGAL::make_object (X_monotone_curve_2 (*overlap_cv)); } } diff --git a/Boolean_set_operations_2/test/Boolean_set_operations_2/bug_3989.cpp b/Boolean_set_operations_2/test/Boolean_set_operations_2/bug_3989.cpp new file mode 100644 index 00000000000..36c1354c549 --- /dev/null +++ b/Boolean_set_operations_2/test/Boolean_set_operations_2/bug_3989.cpp @@ -0,0 +1,48 @@ +#include +#include +#include +#include + +typedef CGAL::Exact_predicates_exact_constructions_kernel K; + + +int main() +{ + CGAL::Polygon_2 ob; + ob.push_back(CGAL::Point_2(1, 1)); + ob.push_back(CGAL::Point_2(1, 0)); + ob.push_back(CGAL::Point_2(6, 0)); + ob.push_back(CGAL::Point_2(6, 7)); + ob.push_back(CGAL::Point_2(0, 7)); + ob.push_back(CGAL::Point_2(0, 1)); + + CGAL::Polygon_2 h; + h.push_back(CGAL::Point_2(2, 1)); + h.push_back(CGAL::Point_2(2, 2)); + h.push_back(CGAL::Point_2(3, 2)); + h.push_back(CGAL::Point_2(3, 3)); + h.push_back(CGAL::Point_2(2, 3)); + h.push_back(CGAL::Point_2(2, 4)); + h.push_back(CGAL::Point_2(3, 4)); + h.push_back(CGAL::Point_2(3, 5)); + h.push_back(CGAL::Point_2(4, 5)); + h.push_back(CGAL::Point_2(4, 1)); + + CGAL::Polygon_with_holes_2 ob_with_holes(ob); + ob_with_holes.add_hole(h); + CGAL::Polygon_set_2 inter(ob_with_holes); + + CGAL::Polygon_2 new_poly; + new_poly.push_back(CGAL::Point_2(1, 1)); + new_poly.push_back(CGAL::Point_2(2, 1)); + new_poly.push_back(CGAL::Point_2(2, 2)); + new_poly.push_back(CGAL::Point_2(2, 3)); + new_poly.push_back(CGAL::Point_2(2, 4)); + new_poly.push_back(CGAL::Point_2(2, 5)); + new_poly.push_back(CGAL::Point_2(3, 5)); + new_poly.push_back(CGAL::Point_2(4, 5)); + new_poly.push_back(CGAL::Point_2(4, 6)); + new_poly.push_back(CGAL::Point_2(1, 6)); + + inter.difference(new_poly); +} \ No newline at end of file diff --git a/CGAL_Core/include/CGAL/CORE/BigFloatRep.h b/CGAL_Core/include/CGAL/CORE/BigFloatRep.h index 74f0de011ae..dc92338bd70 100644 --- a/CGAL_Core/include/CGAL/CORE/BigFloatRep.h +++ b/CGAL_Core/include/CGAL/CORE/BigFloatRep.h @@ -422,7 +422,7 @@ inline std::ostream& BigFloatRep::operator<<(std::ostream& o) const { /* Returns a std::string with precision and format specified Works as cout << with the exception that if the output - contains any error it returns a NULL + contains any error it returns a nullptr Joaquin Grech 31/5/03 */ inline std::string BigFloatRep::toString(long prec, bool sci) const { @@ -434,7 +434,7 @@ inline std::string BigFloatRep::toString(long prec, bool sci) const { else return r.rep; } - return NULL; + return nullptr; } inline void BigFloatRep::dump() const { diff --git a/CGAL_Core/include/CGAL/CORE/BigFloat_impl.h b/CGAL_Core/include/CGAL/CORE/BigFloat_impl.h index cf5a7007b9c..8812c482cf2 100644 --- a/CGAL_Core/include/CGAL/CORE/BigFloat_impl.h +++ b/CGAL_Core/include/CGAL/CORE/BigFloat_impl.h @@ -1017,7 +1017,7 @@ void BigFloatRep :: fromString(const char *str, extLong prec ) { const char *e = strchr(str, 'e'); int dot = 0; long e10 = 0; - if (e != NULL) + if (e != nullptr) e10 = atol(e+1); // e10 is decimal precision of the input string // i.e., input is A/10^{e10}. else { diff --git a/CGAL_Core/include/CGAL/CORE/CoreIO_impl.h b/CGAL_Core/include/CGAL/CORE/CoreIO_impl.h index ace587c3f7c..29a299b2ff1 100644 --- a/CGAL_Core/include/CGAL/CORE/CoreIO_impl.h +++ b/CGAL_Core/include/CGAL/CORE/CoreIO_impl.h @@ -55,7 +55,7 @@ void core_io_error_handler(const char *f, const char *m) { CGAL_INLINE_FUNCTION void core_io_memory_handler(char *t, const char *f, const char *m) { - if (t == NULL) { + if (t == nullptr) { std::cout << "\n memory_handler"; std::cout << "::" << f << "::" << m; std::cout << "memory exhausted\n"; @@ -70,7 +70,7 @@ void allocate (char * &s, int old_size, int new_size) { if (old_size > new_size) old_size = new_size; - if (s == NULL) + if (s == nullptr) old_size = 0; char *t = new char[new_size]; diff --git a/CGAL_Core/include/CGAL/CORE/Expr.h b/CGAL_Core/include/CGAL/CORE/Expr.h index 19f87ecbef2..f14db82e49b 100644 --- a/CGAL_Core/include/CGAL/CORE/Expr.h +++ b/CGAL_Core/include/CGAL/CORE/Expr.h @@ -80,7 +80,7 @@ public: * (or, for that matter, as a binary fraction of any finite length). * The value is the closest double value determined by the compiler. */ - Expr(float f) : RCExpr(NULL) { // check for valid numbers + Expr(float f) : RCExpr(nullptr) { // check for valid numbers // (i.e., not infinite and not NaN) if (! CGAL_CORE_finite(f)) { core_error(" ERROR : constructed an invalid float! ", __FILE__, __LINE__, false); @@ -91,7 +91,7 @@ public: rep = new ConstDoubleRep(f); } /// constructor for double - Expr(double d) : RCExpr(NULL) { // check for valid numbers + Expr(double d) : RCExpr(nullptr) { // check for valid numbers // (i.e., not infinite and not NaN) if (! CGAL_CORE_finite(d)) { core_error(" ERROR : constructed an invalid double! ", __FILE__, __LINE__, false); diff --git a/CGAL_Core/include/CGAL/CORE/ExprRep.h b/CGAL_Core/include/CGAL/CORE/ExprRep.h index c74c4fd7374..77026f580c5 100644 --- a/CGAL_Core/include/CGAL/CORE/ExprRep.h +++ b/CGAL_Core/include/CGAL/CORE/ExprRep.h @@ -168,7 +168,7 @@ public: ExprRep(); /// virtual destructor for this base class virtual ~ExprRep() { - if (nodeInfo != NULL) // This check is only for optimization. + if (nodeInfo != nullptr) // This check is only for optimization. delete nodeInfo; } //@} diff --git a/CGAL_Core/include/CGAL/CORE/Expr_impl.h b/CGAL_Core/include/CGAL/CORE/Expr_impl.h index 7be40c324c7..ac4e0366b65 100644 --- a/CGAL_Core/include/CGAL/CORE/Expr_impl.h +++ b/CGAL_Core/include/CGAL/CORE/Expr_impl.h @@ -181,14 +181,14 @@ NodeInfo::NodeInfo() : appValue(CORE_REAL_ZERO), appComputed(false), v2p(EXTLONG_ZERO), v2m(EXTLONG_ZERO), v5p(EXTLONG_ZERO), v5m(EXTLONG_ZERO), u25(EXTLONG_ZERO), l25(EXTLONG_ZERO), - ratFlag(0), ratValue(NULL) { } + ratFlag(0), ratValue(nullptr) { } /******************************************************** * class ExprRep ********************************************************/ // constructor CGAL_INLINE_FUNCTION -ExprRep::ExprRep() : refCount(1), nodeInfo(NULL), ffVal(0.0) { } +ExprRep::ExprRep() : refCount(1), nodeInfo(nullptr), ffVal(0.0) { } // Computes the root bit bound of the expression. // In effect, computeBound() returns the current value of low. @@ -312,7 +312,7 @@ void ExprRep::reduceToBigRat(const BigRat& rat) { lc() = l_e; tc() = u_e; - if (ratValue() == NULL) + if (ratValue() == nullptr) ratValue() = new BigRat(rat); else *(ratValue()) = rat; @@ -377,9 +377,9 @@ void ExprRep::reduceTo(const ExprRep *e) { if (get_static_rationalReduceFlag()) { ratFlag() = e->ratFlag(); - if (e->ratFlag() > 0 && e->ratValue() != NULL) { + if (e->ratFlag() > 0 && e->ratValue() != nullptr) { ratFlag() ++; - if (ratValue() == NULL) + if (ratValue() == nullptr) ratValue() = new BigRat(*(e->ratValue())); else *(ratValue()) = *(e->ratValue()); @@ -417,7 +417,7 @@ void ExprRep::reduceToZero() { if (get_static_rationalReduceFlag()) { if (ratFlag() > 0) { ratFlag() ++; - if (ratValue() == NULL) + if (ratValue() == nullptr) ratValue() = new BigRat(0); else *(ratValue()) = 0; @@ -465,7 +465,7 @@ void ExprRep::approx(const extLong& relPrec = get_static_defRelPrec(), // to avoid huge lMSB which would cause long time and problems. // if it is a rational node - if (get_static_rationalReduceFlag() && ratFlag() > 0 && ratValue() != NULL) + if (get_static_rationalReduceFlag() && ratFlag() > 0 && ratValue() != nullptr) appValue() = Real(*(ratValue())).approx(relPrec, absPrec); //< shouldn't // this case be done by computeApproxValue()? else @@ -556,15 +556,15 @@ void ConstRep::initNodeInfo() { } CGAL_INLINE_FUNCTION void UnaryOpRep::initNodeInfo() { - if (child->nodeInfo == NULL) + if (child->nodeInfo == nullptr) child->initNodeInfo(); nodeInfo = new NodeInfo(); } CGAL_INLINE_FUNCTION void BinOpRep::initNodeInfo() { - if (first->nodeInfo == NULL) + if (first->nodeInfo == nullptr) first->initNodeInfo(); - if (second->nodeInfo == NULL) + if (second->nodeInfo == nullptr) second->initNodeInfo(); nodeInfo = new NodeInfo(); } @@ -780,7 +780,7 @@ void NegRep::computeExactFlags() { } if (get_static_rationalReduceFlag()) { - if (child->ratFlag()>0 && child->ratValue() != NULL) { + if (child->ratFlag()>0 && child->ratValue() != nullptr) { BigRat val = -(*(child->ratValue())); reduceToBigRat(val); ratFlag() = child->ratFlag()+1; diff --git a/CGAL_Core/include/CGAL/CORE/MemoryPool.h b/CGAL_Core/include/CGAL/CORE/MemoryPool.h index e7b87e5cc79..0f015768f99 100644 --- a/CGAL_Core/include/CGAL/CORE/MemoryPool.h +++ b/CGAL_Core/include/CGAL/CORE/MemoryPool.h @@ -93,7 +93,7 @@ public: // Access the corresponding static global allocator. static MemoryPool& global_allocator() { #if CGAL_STATIC_THREAD_LOCAL_USE_BOOST || (defined(CGAL_HAS_THREADS) && BOOST_GCC) - if(memPool_ptr.get() == NULL) {memPool_ptr.reset(new Self());} + if(memPool_ptr.get() == nullptr) {memPool_ptr.reset(new Self());} Self& memPool = * memPool_ptr.get(); #endif return memPool; diff --git a/CGAL_Core/include/CGAL/CORE/Real.h b/CGAL_Core/include/CGAL/CORE/Real.h index e6792debb8a..3640dce6f17 100644 --- a/CGAL_Core/include/CGAL/CORE/Real.h +++ b/CGAL_Core/include/CGAL/CORE/Real.h @@ -46,11 +46,11 @@ typedef RCImpl RCReal; class Real : public RCReal { public: Real(int i=0) : RCReal(new RealLong(i)) {} - Real(unsigned int ui) : RCReal(NULL) { + Real(unsigned int ui) : RCReal(nullptr) { (ui<=INT_MAX) ? (rep=new RealLong(static_cast(ui))) : (rep=new RealBigInt(ui)); } Real(long l) : RCReal(new RealLong(l)) {} - Real(unsigned long ul) : RCReal(NULL) { + Real(unsigned long ul) : RCReal(nullptr) { (ul<=LONG_MAX) ? (rep=new RealLong(static_cast(ul))) : (rep=new RealBigInt(ul)); } Real(float f) : RCReal(new RealDouble(f)) {} @@ -58,10 +58,10 @@ public: Real(const BigInt& I) : RCReal(new RealBigInt(I)) {} Real(const BigRat& R) : RCReal(new RealBigRat(R)) {} Real(const BigFloat& F) : RCReal(new RealBigFloat(F)) {} - Real(const char* s, const extLong& prec=get_static_defInputDigits()) : RCReal(NULL) { + Real(const char* s, const extLong& prec=get_static_defInputDigits()) : RCReal(nullptr) { constructFromString(s, prec); } - Real(const std::string& s, const extLong& prec=get_static_defInputDigits()) : RCReal(NULL){ + Real(const std::string& s, const extLong& prec=get_static_defInputDigits()) : RCReal(nullptr){ constructFromString(s.c_str(), prec); } diff --git a/CGAL_Core/include/CGAL/CORE/Real_impl.h b/CGAL_Core/include/CGAL/CORE/Real_impl.h index 77ad9123fe8..3346e862f7b 100644 --- a/CGAL_Core/include/CGAL/CORE/Real_impl.h +++ b/CGAL_Core/include/CGAL/CORE/Real_impl.h @@ -134,7 +134,7 @@ void Real::constructFromString(const char *str, const extLong& prec ) // Moreover, the value of prec is ignored (basically // assumed to be infinity). - if (std::strchr(str, '/') != NULL) { // this is a rational number + if (std::strchr(str, '/') != nullptr) { // this is a rational number rep = new RealBigRat(BigRat(str)); return; } @@ -142,7 +142,7 @@ void Real::constructFromString(const char *str, const extLong& prec ) const char *e = std::strchr(str, 'e'); int dot = 0; long e10 = 0; - if (e != NULL) + if (e != nullptr) e10 = std::atol(e+1); // e10 is decimal precision of the input string // i.e., input is A/10^{e10}. else { diff --git a/CGAL_Core/include/CGAL/CORE/poly/Poly.h b/CGAL_Core/include/CGAL/CORE/poly/Poly.h index 913c4773c7a..29a11e6ef82 100644 --- a/CGAL_Core/include/CGAL/CORE/poly/Poly.h +++ b/CGAL_Core/include/CGAL/CORE/poly/Poly.h @@ -179,7 +179,7 @@ public: const NT & getTailCoeff() const; // get last non-zero coefficient NT** getCoeffs() ; // get all coefficients const NT& getCoeff(int i) const; // Get single coefficient of X^i - // NULL pointer if invalid i + // nullptr pointer if invalid i // Set functions bool setCoeff(int i, const NT & cc); // Make cc the coefficient of X^i // Return FALSE if invalid i @@ -408,7 +408,7 @@ NT** Polynomial::getCoeffs() { template < class NT > CORE_INLINE const NT& Polynomial::getCoeff(int i) const { - //if (i > degree) return NULL; + //if (i > degree) return nullptr; CGAL_assertion(i <= degree); return coeff[i]; } diff --git a/CGAL_ImageIO/include/CGAL/ImageIO.h b/CGAL_ImageIO/include/CGAL/ImageIO.h index 1ec9ca750fb..e4fed7772f1 100644 --- a/CGAL_ImageIO/include/CGAL/ImageIO.h +++ b/CGAL_ImageIO/include/CGAL/ImageIO.h @@ -324,9 +324,9 @@ CGAL_IMAGEIO_EXPORT _image *_createImage(int x, int y, int z, int v, WORD_KIND wk, SIGN sgn); -/** Reads an image from a file and returns an image descriptor or NULL if
    +/** Reads an image from a file and returns an image descriptor or nullptr if
    reading failed.
    - Reads from stdin if image name is NULL. + Reads from stdin if image name is nullptr. The image data field points to a xdim * ydim * zdim * vdim buffer containing voxels in order: (Z1, Y1, X1, V1) (Z1, Y1, X1, V2), ... , (Z1, Y1, X1, Vt), @@ -354,12 +354,12 @@ CGAL_IMAGEIO_EXPORT _image *_createImage(int x, int y, int z, int v, http://www.gzip.org/zlib/ - @param name image file name or NULL for stdin */ + @param name image file name or nullptr for stdin */ CGAL_IMAGEIO_EXPORT _image* _readImage(const char *name); -/** Reads an image from a file and returns an image descriptor or NULL if
    +/** Reads an image from a file and returns an image descriptor or nullptr if
    reading failed.
    - Reads from stdin if image name is NULL. + Reads from stdin if image name is nullptr. If the image is vectorial, it is uninterlaced, i.e. the image data field points to a xdim * ydim * zdim * vdim buffer containing voxels in order: @@ -372,7 +372,7 @@ CGAL_IMAGEIO_EXPORT _image* _readImage(const char *name); (V2, Z1, Y1, X1) ... ... , (V2, Z1, Y1, Xn), ... ... ... , (Vt, Zl, Ym, Xn) - @param name image file name or NULL */ + @param name image file name or nullptr */ CGAL_IMAGEIO_EXPORT _image* _readNonInterlacedImage(const char *name); /** Read an image from a file. The word type is supposed to be unsigned @@ -393,15 +393,15 @@ CGAL_IMAGEIO_EXPORT _image* _readImage_raw(const char *name, /** Writes given image in file 'name'.
    If name ends with '.gz', file is gzipped.
    - If name is NULL, image is sent to stdout. + If name is nullptr, image is sent to stdout. @param im image descriptor - @param name file name to store image or NULL */ + @param name file name to store image or nullptr */ CGAL_IMAGEIO_EXPORT int _writeImage(_image *im, const char *name); /** Read one slice of given image whose header has already been read.
    File descriptor is let at the beginning of next slice and closed
    when end of file is encountered.
    - If data buffer is NULL, it is allocated for one slice only.
    + If data buffer is nullptr, it is allocated for one slice only.
    This funtion is dedicated to read huge inrimages. @param im image descriptor */ CGAL_IMAGEIO_EXPORT void _getNextSlice(_image *im); @@ -420,8 +420,8 @@ CGAL_IMAGEIO_EXPORT PTRIMAGE_FORMAT firstImageFormat(); /** Reads header from an image file
    If file is an inrimage, only header is read. Otherwise, whole image
    is read and image file descriptor is closed.
    - If name is NULL, header is read from STDIN - @param name image file name or NULL */ + If name is nullptr, header is read from STDIN + @param name image file name or nullptr */ CGAL_IMAGEIO_EXPORT _image* _readImageHeader(const char *name); CGAL_IMAGEIO_EXPORT _image *_readImageHeaderAndGetError( const char *name, int *error ); @@ -445,13 +445,13 @@ CGAL_IMAGEIO_EXPORT int _readNonInterlacedFileData(_image *im); /** given an initialized file descriptor and a file name, open file - from stdout (if name == NULL), a gziped pipe (if file is gziped) + from stdout (if name == nullptr), a gziped pipe (if file is gziped) or a standard file otherwise. @param im initialized image descriptor @param name image file name */ CGAL_IMAGEIO_EXPORT void _openWriteImage(_image* im, const char *name) ; -/** open an image file from stdin (if name == NULL), from a pipe +/** open an image file from stdin (if name == nullptr), from a pipe (piped with gzip if image was compressed) or from a standard file @param im initialized image descriptor @param name image file name */ diff --git a/CGAL_ImageIO/include/CGAL/ImageIO/analyze_impl.h b/CGAL_ImageIO/include/CGAL/ImageIO/analyze_impl.h index 88a3a086562..581d716fef2 100644 --- a/CGAL_ImageIO/include/CGAL/ImageIO/analyze_impl.h +++ b/CGAL_ImageIO/include/CGAL/ImageIO/analyze_impl.h @@ -249,7 +249,7 @@ int writeAnalyze( char *name, _image* im) { _openWriteImage(im, outputName); if( !im->fd ) { fprintf(stderr, "writeAnalyze: error: unable to open file \'%s\'\n", outputName); - if ( outputName != NULL ) ImageIO_free( outputName ); + if ( outputName != nullptr ) ImageIO_free( outputName ); return ImageIO_OPENING; } @@ -257,9 +257,9 @@ int writeAnalyze( char *name, _image* im) { if ( res < 0 ) { fprintf(stderr, "writeAnalyze: error: unable to write header of \'%s\'\n", outputName); - if ( outputName != NULL ) ImageIO_free( outputName ); + if ( outputName != nullptr ) ImageIO_free( outputName ); ImageIO_close( im ); - im->fd = NULL; + im->fd = nullptr; im->openMode = OM_CLOSE; return( res ); } @@ -278,7 +278,7 @@ int writeAnalyze( char *name, _image* im) { if( !im->fd ) { fprintf(stderr, "writeAnalyze: error: unable to open file \'%s\'\n", outputName); - if ( outputName != NULL ) ImageIO_free( outputName ); + if ( outputName != nullptr ) ImageIO_free( outputName ); return ImageIO_OPENING; } @@ -287,14 +287,14 @@ int writeAnalyze( char *name, _image* im) { fprintf(stderr, "writeAnalyze: error: unable to write data in \'%s\'\n", outputName ); ImageIO_close( im ); - im->fd = NULL; + im->fd = nullptr; im->openMode = OM_CLOSE; return( res ); } - if ( outputName != NULL ) ImageIO_free( outputName ); + if ( outputName != nullptr ) ImageIO_free( outputName ); ImageIO_close( im ); - im->fd = NULL; + im->fd = nullptr; im->openMode = OM_CLOSE; return ( res ); @@ -469,7 +469,7 @@ int _readAnalyzeHeader( _image* im, const char* name, */ im->nuser = 1 + 17 ; im->user = (char **) ImageIO_alloc(im->nuser * sizeof(char *)); - for ( i=0; inuser; i++ ) im->user[i] = NULL; + for ( i=0; inuser; i++ ) im->user[i] = nullptr; i = 0 ; im->user[i] = (char *) ImageIO_alloc((strlen("Data lost in the Analyze -> ImageIO conversion:") + 1)); @@ -529,7 +529,7 @@ int _readAnalyzeHeader( _image* im, const char* name, /* header is read. close header file and open data file. */ - if( name != NULL ) { + if( name != nullptr ) { std::size_t length = strlen(name) ; char* data_filename = (char *) ImageIO_alloc(length+4) ; @@ -841,7 +841,7 @@ int printAnalyzeHeader( const char* name ) ImageIO_close(im); - im->fd = NULL; + im->fd = nullptr; im->openMode = OM_CLOSE; _freeImage(im); return( 1 ); diff --git a/CGAL_ImageIO/include/CGAL/ImageIO/bmp_impl.h b/CGAL_ImageIO/include/CGAL/ImageIO/bmp_impl.h index cf58cb98cbe..8068ce94f28 100644 --- a/CGAL_ImageIO/include/CGAL/ImageIO/bmp_impl.h +++ b/CGAL_ImageIO/include/CGAL/ImageIO/bmp_impl.h @@ -84,7 +84,7 @@ int readBmpImage( const char *name,_image *im) int dimx, dimy, dimv; im->data = _readBmpImage( name, &dimx, &dimy, &dimv ); - if ( im->data == NULL ) { + if ( im->data == nullptr ) { fprintf( stderr, "readBmpImage: unable to read \'%s\'\n", name ); return( -1 ); } @@ -109,23 +109,23 @@ void *_readBmpImage( const char *name, int *dimx, int *dimy, int *dimz ) { const char *proc="_readBmpImage"; - void *buf = (void*)NULL; - unsigned char *myBuf = NULL; + void *buf = (void*)nullptr; + unsigned char *myBuf = nullptr; - FILE *fp = NULL; - RGB **argbs = NULL; - char **xorMasks = NULL, **andMasks = NULL; - CGAL_UINT32 *heights = NULL, *widths = NULL, row = 0, col = 0; + FILE *fp = nullptr; + RGB **argbs = nullptr; + char **xorMasks = nullptr, **andMasks = nullptr; + CGAL_UINT32 *heights = nullptr, *widths = nullptr, row = 0, col = 0; CGAL_UINT16 fileType = 0; long filePos = 0; int numImages = 0, i = 0; int rc = 0; fp = fopen(name, "rb"); - if (fp == NULL) { + if (fp == nullptr) { if ( get_static_verbose_bmp() ) fprintf( stderr, "%s: error in opening %s\n", proc, name ); - return( (void*)NULL ); + return( (void*)nullptr ); } @@ -139,7 +139,7 @@ void *_readBmpImage( const char *name, fclose(fp); if ( get_static_verbose_bmp() ) fprintf( stderr, "%s: error in getting file type %s\n", proc, name ); - return( (void*)NULL ); + return( (void*)nullptr ); } fseek(fp, filePos, SEEK_SET); @@ -168,20 +168,20 @@ void *_readBmpImage( const char *name, * those arrays. */ argbs = (RGB **)calloc(1, sizeof(RGB *)); - if (argbs == NULL) + if (argbs == nullptr) { rc = 1005; break; } xorMasks = (char **)calloc(1, sizeof(char *)); - if (xorMasks == NULL) + if (xorMasks == nullptr) { free(argbs); rc = 1005; break; } andMasks = (char **)calloc(1, sizeof(char *)); - if (andMasks == NULL) + if (andMasks == nullptr) { free(argbs); free(xorMasks); @@ -189,7 +189,7 @@ void *_readBmpImage( const char *name, break; } heights = (CGAL_UINT32 *)calloc(1, sizeof(CGAL_UINT32)); - if (heights == NULL) + if (heights == nullptr) { free(argbs); free(xorMasks); @@ -198,7 +198,7 @@ void *_readBmpImage( const char *name, break; } widths = (CGAL_UINT32 *)calloc(1, sizeof(CGAL_UINT32)); - if (widths == NULL) + if (widths == nullptr) { free(argbs); free(xorMasks); @@ -278,11 +278,11 @@ void *_readBmpImage( const char *name, { for (i=0; i 0) && - (argbs[0] != NULL) ) { + (argbs[0] != nullptr) ) { buf = (void*)malloc( widths[0]*heights[0]*3 * sizeof( unsigned char ) ); - if ( buf == (void*)NULL ) { + if ( buf == (void*)nullptr ) { if ( get_static_verbose_bmp() ) fprintf( stderr, "%s: error in allocating data buffer for %s\n", proc, name ); for (i=0; i 0 && str[l-1] == '\n') str[l-1] = '\0'; diff --git a/CGAL_ImageIO/include/CGAL/ImageIO/gif_impl.h b/CGAL_ImageIO/include/CGAL/ImageIO/gif_impl.h index 7e9e81c3dfe..91845111980 100644 --- a/CGAL_ImageIO/include/CGAL/ImageIO/gif_impl.h +++ b/CGAL_ImageIO/include/CGAL/ImageIO/gif_impl.h @@ -88,11 +88,11 @@ static int ReadCode(); static void DoInterlace(byte); static int GifError(const char *); -CGAL_GLOBAL_STATE_VAR(byte *, Raster, NULL) /* The raster data stream, unblocked */ -CGAL_GLOBAL_STATE_VAR(byte *, RawGIF, NULL) -CGAL_GLOBAL_STATE_VAR(byte *, r, NULL) -CGAL_GLOBAL_STATE_VAR(byte *, g, NULL) -CGAL_GLOBAL_STATE_VAR(byte *, b, NULL) /* The colormap */ +CGAL_GLOBAL_STATE_VAR(byte *, Raster, nullptr) /* The raster data stream, unblocked */ +CGAL_GLOBAL_STATE_VAR(byte *, RawGIF, nullptr) +CGAL_GLOBAL_STATE_VAR(byte *, r, nullptr) +CGAL_GLOBAL_STATE_VAR(byte *, g, nullptr) +CGAL_GLOBAL_STATE_VAR(byte *, b, nullptr) /* The colormap */ CGAL_GLOBAL_STATE_VAR(int, BitOffset, 0) /* Bit Offset of next code */ CGAL_GLOBAL_STATE_VAR(int, XC, 0) CGAL_GLOBAL_STATE_VAR(int, YC, 0) /* Output X and Y coords of current pixel */ @@ -101,8 +101,8 @@ CGAL_GLOBAL_STATE_VAR(int, ReadMask, 0) /* Code AND mask for current code si CGAL_GLOBAL_STATE_VAR(int, Pass, 0) /* Used by output routine if interlaced pic */ CGAL_GLOBAL_STATE_VAR(int, Width, 0) CGAL_GLOBAL_STATE_VAR(int, Height, 0) /* image dimensions */ -CGAL_GLOBAL_STATE_VAR(unsigned char *, org, NULL) -CGAL_GLOBAL_STATE_VAR(unsigned char *, buf, NULL) +CGAL_GLOBAL_STATE_VAR(unsigned char *, org, nullptr) +CGAL_GLOBAL_STATE_VAR(unsigned char *, buf, nullptr) CGAL_INLINE_FUNCTION int testGifHeader(char *magic,const char *) { @@ -173,7 +173,7 @@ int gif89 = 0; OutCount = npixels = maxpixels = 0; - get_static_RawGIF() = get_static_Raster() = NULL; + get_static_RawGIF() = get_static_Raster() = nullptr; gif89 = 0; #ifdef WIN32 @@ -465,7 +465,7 @@ int gif89 = 0; break; } } while(ch1); - ImageIO_free(get_static_RawGIF()); get_static_RawGIF() = NULL; + ImageIO_free(get_static_RawGIF()); get_static_RawGIF() = nullptr; if (DEBUG) { @@ -597,7 +597,7 @@ int gif89 = 0; Code = ReadCode(); if (npixels >= maxpixels) break; } - ImageIO_free(get_static_Raster()); get_static_Raster() = NULL; + ImageIO_free(get_static_Raster()); get_static_Raster() = nullptr; if (npixels != maxpixels) { /* SetISTR(ISTR_WARNING,"This GIF file seems to be truncated. Winging it.");*/ @@ -637,7 +637,7 @@ static int ReadCode() /***************************/ CGAL_INLINE_FUNCTION static void DoInterlace(byte Index) { - static byte *ptr = NULL; + static byte *ptr = nullptr; static int oldYC = -1; if (oldYC != get_static_YC()) { @@ -693,8 +693,8 @@ CGAL_INLINE_FUNCTION static int GifError(const char *st) { fprintf(stderr,"readGifImage: error: %s\n",st); - if (get_static_RawGIF() != NULL) ImageIO_free(get_static_RawGIF()); - if (get_static_Raster() != NULL) ImageIO_free(get_static_Raster()); + if (get_static_RawGIF() != nullptr) ImageIO_free(get_static_RawGIF()); + if (get_static_Raster() != nullptr) ImageIO_free(get_static_Raster()); return -1; } diff --git a/CGAL_ImageIO/include/CGAL/ImageIO/gis_impl.h b/CGAL_ImageIO/include/CGAL/ImageIO/gis_impl.h index 1b5b81f43b8..4fd5714cfed 100644 --- a/CGAL_ImageIO/include/CGAL/ImageIO/gis_impl.h +++ b/CGAL_ImageIO/include/CGAL/ImageIO/gis_impl.h @@ -78,16 +78,16 @@ int writeGis( char *name, _image* im) { _openWriteImage(im, outputName); if( !im->fd ) { fprintf(stderr, "writeGis: error: unable to open file \'%s\'\n", outputName); - if ( outputName != NULL ) ImageIO_free( outputName ); + if ( outputName != nullptr ) ImageIO_free( outputName ); return ImageIO_OPENING; } if ( !writeGisHeader(im) ) { fprintf(stderr, "writeGis: error: unable to write header of \'%s\'\n", outputName); - if ( outputName != NULL ) ImageIO_free( outputName ); + if ( outputName != nullptr ) ImageIO_free( outputName ); ImageIO_close( im ); - im->fd = NULL; + im->fd = nullptr; im->openMode = OM_CLOSE; return -1; } @@ -106,7 +106,7 @@ int writeGis( char *name, _image* im) { if( !im->fd ) { fprintf(stderr, "writeGis: error: unable to open file \'%s\'\n", outputName); - if ( outputName != NULL ) ImageIO_free( outputName ); + if ( outputName != nullptr ) ImageIO_free( outputName ); return ImageIO_OPENING; } @@ -120,19 +120,19 @@ int writeGis( char *name, _image* im) { switch( im->wordKind ) { default : fprintf(stderr, "writeGis: such word kind not handled in ascii mode for file \'%s\'\n", outputName); - if ( outputName != NULL ) ImageIO_free( outputName ); + if ( outputName != nullptr ) ImageIO_free( outputName ); return( -3 ); case WK_FIXED : switch ( im->wdim ) { default : fprintf(stderr, "writeGis: such word dim not handled in ascii mode for file \'%s\'\n", outputName); - if ( outputName != NULL ) ImageIO_free( outputName ); + if ( outputName != nullptr ) ImageIO_free( outputName ); return( -3 ); case 1 : switch ( im->sign ) { default : fprintf(stderr, "writeGis: such sign not handled in ascii mode for file \'%s\'\n", outputName); - if ( outputName != NULL ) ImageIO_free( outputName ); + if ( outputName != nullptr ) ImageIO_free( outputName ); return( -3 ); case SGN_UNSIGNED : { @@ -148,7 +148,7 @@ int writeGis( char *name, _image* im) { res = (done == strlen( str )) ? int(done) : -1; if ( res <= 0 ) { fprintf(stderr, "writeGis: error when writing data in \'%s\'\n", outputName); - if ( outputName != NULL ) ImageIO_free( outputName ); + if ( outputName != nullptr ) ImageIO_free( outputName ); return( -3 ); } } while ( i < size ); @@ -168,7 +168,7 @@ int writeGis( char *name, _image* im) { res = (done == strlen( str )) ? int(done) : -1; if ( res <= 0 ) { fprintf(stderr, "writeGis: error when writing data in \'%s\'\n", outputName); - if ( outputName != NULL ) ImageIO_free( outputName ); + if ( outputName != nullptr ) ImageIO_free( outputName ); return( -3 ); } } while ( i < size ); @@ -180,7 +180,7 @@ int writeGis( char *name, _image* im) { switch ( im->sign ) { default : fprintf(stderr, "writeGis: such sign not handled in ascii mode for file \'%s\'\n", outputName); - if ( outputName != NULL ) ImageIO_free( outputName ); + if ( outputName != nullptr ) ImageIO_free( outputName ); return( -3 ); case SGN_UNSIGNED : { @@ -196,7 +196,7 @@ int writeGis( char *name, _image* im) { res = (done == strlen( str )) ? int(done) : -1; if ( res <= 0 ) { fprintf(stderr, "writeGis: error when writing data in \'%s\'\n", outputName); - if ( outputName != NULL ) ImageIO_free( outputName ); + if ( outputName != nullptr ) ImageIO_free( outputName ); return( -3 ); } } while ( i < size ); @@ -216,7 +216,7 @@ int writeGis( char *name, _image* im) { res = (done == strlen( str )) ? int(done) : -1; if ( res <= 0 ) { fprintf(stderr, "writeGis: error when writing data in \'%s\'\n", outputName); - if ( outputName != NULL ) ImageIO_free( outputName ); + if ( outputName != nullptr ) ImageIO_free( outputName ); return( -3 ); } } while ( i < size ); @@ -228,12 +228,12 @@ int writeGis( char *name, _image* im) { } /* end of switch( im->wordKind ) */ ImageIO_free( str ); - if (outputName != NULL) ImageIO_free(outputName); + if (outputName != nullptr) ImageIO_free(outputName); return static_cast(res); } else { bool ret = _writeInrimageData(im); - if (outputName != NULL) ImageIO_free(outputName); + if (outputName != nullptr) ImageIO_free(outputName); return (ret ? 1 : -1); } } @@ -254,7 +254,7 @@ int testGisHeader(char *,const char *name) { CGAL_INLINE_FUNCTION int readGisHeader( const char* name,_image* im) { - char *s, *str = NULL; + char *s, *str = nullptr; int status; int n=0, nusermax = 20; @@ -286,7 +286,7 @@ int readGisHeader( const char* name,_image* im) #define ADD_USER_STRING { \ if ( n == 0 ) { \ im->user = (char**)ImageIO_alloc( nusermax * sizeof( char*) ); \ - for ( n=0; nuser[n] = NULL; \ + for ( n=0; nuser[n] = nullptr; \ n = 0; \ } \ im->user[n] = (char*)ImageIO_alloc( 1+strlen( s ) ); \ @@ -472,7 +472,7 @@ int readGisHeader( const char* name,_image* im) /* header is read. close header file and open data file. */ - if( name != NULL ) { + if( name != nullptr ) { std::size_t length = strlen(name) ; char* data_filename = (char *) ImageIO_alloc(length+4) ; @@ -554,14 +554,14 @@ int readGisHeader( const char* name,_image* im) ret = sscanf( tmp, "%d", &iv ); break; default : - ImageIO_free( im->data ); im->data = NULL; + ImageIO_free( im->data ); im->data = nullptr; ImageIO_free( str ); return -1; } if ( ret != 1 ) { fprintf( stderr, "readGisHeader: error in reading ascii data\n" ); - ImageIO_free( im->data ); im->data = NULL; + ImageIO_free( im->data ); im->data = nullptr; ImageIO_free( str ); return -1; } @@ -607,7 +607,7 @@ int readGisHeader( const char* name,_image* im) n ++; } else { - ImageIO_free( im->data ); im->data = NULL; + ImageIO_free( im->data ); im->data = nullptr; ImageIO_free( str ); return -1; } diff --git a/CGAL_ImageIO/include/CGAL/ImageIO/inr_impl.h b/CGAL_ImageIO/include/CGAL/ImageIO/inr_impl.h index c7f410d24e3..168d8b0ff46 100644 --- a/CGAL_ImageIO/include/CGAL/ImageIO/inr_impl.h +++ b/CGAL_ImageIO/include/CGAL/ImageIO/inr_impl.h @@ -164,9 +164,9 @@ int _writeInrimageHeader(const _image *im, ENDIANNESS end) { /* write user strings */ - if ( im->user != NULL ) { + if ( im->user != nullptr ) { for(i = 0; i < im->nuser; i++) { - if ( im->user[i] == NULL ) continue; + if ( im->user[i] == nullptr ) continue; pos += strlen(im->user[i]) + 2; if(ImageIO_write(im, "#", 1) == 0) return -1; if(ImageIO_write(im, im->user[i], strlen(im->user[i])) == 0) return -1; @@ -236,7 +236,7 @@ CGAL_INLINE_FUNCTION int readInrimageHeader(const char *,_image *im) { char str[257]; int n, nusr; - stringListHead strl = { NULL, NULL }; + stringListHead strl = { nullptr, nullptr }; stringListElement *oel, *el; Set_numeric_locale num_locale("C"); @@ -412,8 +412,8 @@ int readInrimageHeader(const char *,_image *im) { if(nusr > 0) { im->nuser = nusr; im->user = (char **) ImageIO_alloc(im->nuser * sizeof(char *)); - oel = NULL; - for(el = strl.begin, n = 0; el != NULL; el = oel, n++) { + oel = nullptr; + for(el = strl.begin, n = 0; el != nullptr; el = oel, n++) { im->user[n] = el->string; oel = el->next; ImageIO_free(el); @@ -437,8 +437,8 @@ static void addStringElement(stringListHead *strhead, const char *str) { /* was strdup(str); */ el->string = (char*)ImageIO_alloc( strlen(str)+1); memcpy(el->string, str, strlen(str)+1); - el->next = NULL; - if(strhead->begin == NULL) + el->next = nullptr; + if(strhead->begin == nullptr) strhead->begin = strhead->end = el; else { strhead->end->next = el; @@ -481,7 +481,7 @@ int writeInrimage(char *name,_image *im) { fprintf(stderr, "writeInrimage: error: unable to write header of \'%s\'\n", name); ImageIO_close( im ); - im->fd = NULL; + im->fd = nullptr; im->openMode = OM_CLOSE; return( res ); } @@ -490,13 +490,13 @@ int writeInrimage(char *name,_image *im) { fprintf(stderr, "writeInrimage: error: unable to write data of \'%s\'\n", name); ImageIO_close( im ); - im->fd = NULL; + im->fd = nullptr; im->openMode = OM_CLOSE; return -1; } ImageIO_close( im ); - im->fd = NULL; + im->fd = nullptr; im->openMode = OM_CLOSE; return ( res ); diff --git a/CGAL_ImageIO/include/CGAL/ImageIO/iris_impl.h b/CGAL_ImageIO/include/CGAL/ImageIO/iris_impl.h index 7b711d84725..10d88dc35c3 100644 --- a/CGAL_ImageIO/include/CGAL/ImageIO/iris_impl.h +++ b/CGAL_ImageIO/include/CGAL/ImageIO/iris_impl.h @@ -357,7 +357,7 @@ static byte *getimagedata(const _image *im, unsigned short type, int xsize, int int zsize) { /* read in a B/W RGB or RGBA iris image file and return a - pointer to an array of 4-byte pixels, arranged ABGR, NULL on error */ + pointer to an array of 4-byte pixels, arranged ABGR, nullptr on error */ byte *base, *lptr; byte *verdat; @@ -372,7 +372,7 @@ static byte *getimagedata(const _image *im, unsigned short type, int xsize, int bpp = BPP(type); if (bpp != 1) { - return (byte *) NULL; + return (byte *) nullptr; } if (rle) { @@ -392,7 +392,7 @@ static byte *getimagedata(const _image *im, unsigned short type, int xsize, int if ( ImageIO_error(im) ) { ImageIO_free(starttab); ImageIO_free(lengthtab); ImageIO_free(rledat); - return (byte *) NULL; + return (byte *) nullptr; } @@ -427,7 +427,7 @@ static byte *getimagedata(const _image *im, unsigned short type, int xsize, int if (lengthtab[y+z*ysize]>(unsigned long)rlebuflen) { ImageIO_free(starttab); ImageIO_free(lengthtab); ImageIO_free(rledat); ImageIO_free(base); - return (byte *) NULL; + return (byte *) nullptr; } ImageIO_read(im, rledat, (size_t) lengthtab[y+z*ysize]); cur += lengthtab[y+z*ysize]; diff --git a/CGAL_ImageIO/include/CGAL/ImageIO/mincio_impl.h b/CGAL_ImageIO/include/CGAL/ImageIO/mincio_impl.h index 72026b5df3a..60bc76ec70d 100644 --- a/CGAL_ImageIO/include/CGAL/ImageIO/mincio_impl.h +++ b/CGAL_ImageIO/include/CGAL/ImageIO/mincio_impl.h @@ -65,7 +65,7 @@ int readMincHeader(_image *im, const char* filename, /* get number of dimensions and type */ id = ncvarid(fin, MIimage); - (void) ncvarinq(fin, id, NULL, &type, &ndims, dim, NULL); + (void) ncvarinq(fin, id, nullptr, &type, &ndims, dim, nullptr); if(ndims != 3) { fprintf(stderr, "unsupported %i dimensional minc file\n", ndims); return 0; @@ -73,7 +73,7 @@ int readMincHeader(_image *im, const char* filename, /* get sign */ if ((miattgetstr(fin, id, MIsigntype, MI_MAX_ATTSTR_LEN, sign_type) - == NULL) || ((strcmp(sign_type, MI_UNSIGNED)!=0) && + == nullptr) || ((strcmp(sign_type, MI_UNSIGNED)!=0) && (strcmp(sign_type, MI_SIGNED)!=0))) { if (type == NC_BYTE) (void) strcpy(sign_type, MI_UNSIGNED); @@ -252,9 +252,9 @@ int readMincHeader(_image *im, const char* filename, ImageIO_closeImage(im); /* order data in ZYX */ - (void) ncdiminq(fin, dim[0], name, NULL); + (void) ncdiminq(fin, dim[0], name, nullptr); if(!strcmp(name, MIzspace)) { - (void) ncdiminq(fin, dim[1], name, NULL); + (void) ncdiminq(fin, dim[1], name, nullptr); /* file is ZYX */ if(!strcmp(name, MIyspace)) { miclose(fin); @@ -262,7 +262,7 @@ int readMincHeader(_image *im, const char* filename, } } - (void) ncdiminq(fin, dim[0], name, NULL); + (void) ncdiminq(fin, dim[0], name, nullptr); /* file is ZXY */ if(!strcmp(name, MIzspace)) { shift[0] = 0; @@ -275,7 +275,7 @@ int readMincHeader(_image *im, const char* filename, else if(!strcmp(name, MIyspace)) { shift[0] = 1; plane2 = im->xdim * im->zdim; - (void) ncdiminq(fin, dim[1], name, NULL); + (void) ncdiminq(fin, dim[1], name, nullptr); /* file is YXZ */ if(!strcmp(name, MIxspace)) { shift[1] = 2; @@ -293,7 +293,7 @@ int readMincHeader(_image *im, const char* filename, else { shift[0] = 2; plane2 = im->ydim * im->zdim; - (void) ncdiminq(fin, dim[1], name, NULL); + (void) ncdiminq(fin, dim[1], name, nullptr); /* file is XYZ */ if(!strcmp(name, MIyspace)) { shift[1] = 1; @@ -398,7 +398,7 @@ int writeMincFile( const _image* im, const char *filename, for(i = 0; i < 3; i++ ) { dim_ids[i] = micreate_std_variable( cdfid, dim_names[i], NC_DOUBLE, - 0, NULL); + 0, nullptr); if( dim_ids[i] < 0 ) return -1; (void) miattputdbl( cdfid, dim_ids[i], MIstep, vx[i]); (void) miattputdbl( cdfid, dim_ids[i], MIstart, start[i]); diff --git a/CGAL_ImageIO/include/CGAL/ImageIO/pnm_impl.h b/CGAL_ImageIO/include/CGAL/ImageIO/pnm_impl.h index 41835232be7..bc5563718e5 100644 --- a/CGAL_ImageIO/include/CGAL/ImageIO/pnm_impl.h +++ b/CGAL_ImageIO/include/CGAL/ImageIO/pnm_impl.h @@ -263,7 +263,7 @@ int writePpmImage( char *name,_image *im ) */ unsigned short *buf = (unsigned short *)im->data; unsigned char *tmp = (unsigned char *)ImageIO_alloc( im->xdim*im->ydim*3 ); - if ( tmp == NULL ) { + if ( tmp == nullptr ) { fprintf( stderr, "writePpmImage: unable to allocate auxiliary buffer\n" ); return -1; } @@ -377,12 +377,12 @@ int readPgmAsciiImage(const char *name,_image *im) case WK_FIXED : if ( sscanf( tmp, "%d", &iv ) != 1 ) { fprintf( stderr, "readAsciiPgmImage: error in reading ascii data\n" ); - ImageIO_free( im->data ); im->data = NULL; + ImageIO_free( im->data ); im->data = nullptr; return 0; } break; default : - ImageIO_free( im->data ); im->data = NULL; + ImageIO_free( im->data ); im->data = nullptr; return 0; } @@ -404,7 +404,7 @@ int readPgmAsciiImage(const char *name,_image *im) } else { fprintf( stderr, "readAsciiPgmImage: word im not handled\n" ); - ImageIO_free( im->data ); im->data = NULL; + ImageIO_free( im->data ); im->data = nullptr; return 0; } @@ -624,7 +624,7 @@ int writePgmImage(char *name,_image *im ) */ unsigned short *buf = (unsigned short *)im->data; unsigned char *tmp = (unsigned char *)ImageIO_alloc( im->xdim*im->ydim ); - if ( tmp == NULL ) { + if ( tmp == nullptr ) { fprintf( stderr, "writePgmImage: unable to allocate auxiliary buffer\n" ); return -1; } diff --git a/CGAL_ImageIO/include/CGAL/ImageIO/recbuffer_impl.h b/CGAL_ImageIO/include/CGAL/ImageIO/recbuffer_impl.h index ef2866787be..8b910aa2eba 100644 --- a/CGAL_ImageIO/include/CGAL/ImageIO/recbuffer_impl.h +++ b/CGAL_ImageIO/include/CGAL/ImageIO/recbuffer_impl.h @@ -99,8 +99,8 @@ int GradientModulus( void *bufferIn, recursiveFilterType filterType ) { const char *proc = "GradientModulus"; - float *auxBuf = NULL; - float *tmpBuf = NULL, *grdBuf = NULL; + float *auxBuf = nullptr; + float *tmpBuf = nullptr, *grdBuf = nullptr; int sizeAuxBuf = 0; derivativeOrder derivatives[3]; int i; @@ -114,7 +114,7 @@ int GradientModulus( void *bufferIn, /* allocation des buffers de calcul */ auxBuf = (float*)malloc( sizeAuxBuf * sizeof(float) ); - if ( auxBuf == NULL ) { + if ( auxBuf == nullptr ) { if ( _VERBOSE_ > 0 ) fprintf( stderr, "%s: unable to allocate auxiliary buffer\n", proc ); return( EXIT_ON_FAILURE ); @@ -265,15 +265,15 @@ int Laplacian_2D ( void *bufferIn, recursiveFilterType filterType ) { const char *proc = "Laplacian_2D"; - float *theXX = NULL; - float *theYY = NULL; + float *theXX = nullptr; + float *theYY = nullptr; derivativeOrder XXderiv[3] = { DERIVATIVE_2, SMOOTHING, NODERIVATIVE }; derivativeOrder YYderiv[3] = { SMOOTHING, DERIVATIVE_2, NODERIVATIVE }; int sliceDims[3]; int z, i, dimxXdimy; - void *sliceOut = NULL; + void *sliceOut = nullptr; @@ -312,7 +312,7 @@ int Laplacian_2D ( void *bufferIn, theXX = (float*)malloc( 2 * dimxXdimy * sizeof( float ) ); } - if ( theXX == NULL ) { + if ( theXX == nullptr ) { if ( _VERBOSE_ > 0 ) { fprintf( stderr, " Fatal error in %s:", proc ); fprintf( stderr, " unable to allocate auxiliary buffer.\n" ); @@ -407,9 +407,9 @@ int Laplacian ( void *bufferIn, recursiveFilterType filterType ) { const char *proc = "Laplacian"; - float *theSL = NULL; - float *theZZ = NULL; - float *theZ0 = NULL; + float *theSL = nullptr; + float *theZZ = nullptr; + float *theZ0 = nullptr; derivativeOrder XXderiv[3] = { DERIVATIVE_2, SMOOTHING, NODERIVATIVE }; @@ -466,7 +466,7 @@ int Laplacian ( void *bufferIn, - if ( theSL == NULL ) { + if ( theSL == nullptr ) { if ( _VERBOSE_ > 0 ) { fprintf( stderr, " Fatal error in %s:", proc ); fprintf( stderr, " unable to allocate auxiliary buffer.\n" ); @@ -610,11 +610,11 @@ int GradientHessianGradient_2D ( void *bufferIn, recursiveFilterType filterType ) { const char *proc = "GradientHessianGradient_2D"; - float *theXX = NULL; - float *theYY = NULL; - float *theXY = NULL; - float *theX = NULL; - float *theY = NULL; + float *theXX = nullptr; + float *theYY = nullptr; + float *theXY = nullptr; + float *theX = nullptr; + float *theY = nullptr; derivativeOrder Xsmooth[3] = { SMOOTHING, NODERIVATIVE, NODERIVATIVE }; derivativeOrder Yderiv[3] = { NODERIVATIVE, DERIVATIVE_1_EDGES, NODERIVATIVE }; @@ -629,8 +629,8 @@ int GradientHessianGradient_2D ( void *bufferIn, int sliceDims[3]; int z, i, dimxXdimy; - void *sliceIn = NULL; - void *sliceOut = NULL; + void *sliceIn = nullptr; + void *sliceOut = nullptr; double gx, gy, g; @@ -669,7 +669,7 @@ int GradientHessianGradient_2D ( void *bufferIn, theXX = (float*)malloc( 5 * dimxXdimy * sizeof( float ) ); } - if ( theXX == NULL ) { + if ( theXX == nullptr ) { if ( _VERBOSE_ > 0 ) { fprintf( stderr, " Fatal error in %s:", proc ); fprintf( stderr, " unable to allocate auxiliary buffer.\n" ); @@ -872,20 +872,20 @@ int GradientHessianGradient ( void *bufferIn, - float *theZZ = NULL; - float *theZ = NULL; - float *theZ1 = NULL; - float *theZ0 = NULL; + float *theZZ = nullptr; + float *theZ = nullptr; + float *theZ1 = nullptr; + float *theZ0 = nullptr; - float *theXZ = NULL; - float *theYZ = NULL; + float *theXZ = nullptr; + float *theYZ = nullptr; - float *theXX = NULL; - float *theYY = NULL; - float *theXY = NULL; + float *theXX = nullptr; + float *theYY = nullptr; + float *theXY = nullptr; - float *theX = NULL; - float *theY = NULL; + float *theX = nullptr; + float *theY = nullptr; derivativeOrder ZZderiv[3] = { SMOOTHING, SMOOTHING, DERIVATIVE_2 }; @@ -949,7 +949,7 @@ int GradientHessianGradient ( void *bufferIn, } - if ( theX == NULL ) { + if ( theX == nullptr ) { if ( _VERBOSE_ > 0 ) { fprintf( stderr, " Fatal error in %s:", proc ); fprintf( stderr, " unable to allocate auxiliary buffer.\n" ); @@ -1228,9 +1228,9 @@ int RecursiveFilterOnBuffer( void *bufferIn, * we allocate an auxiliary buffer if the output buffer * is not of type float or double. */ - void *bufferToBeProcessed = (void*)NULL; + void *bufferToBeProcessed = (void*)nullptr; bufferType typeToBeProcessed = TYPE_UNKNOWN; - void *bufferResult = (void*)NULL; + void *bufferResult = (void*)nullptr; bufferType typeResult = TYPE_UNKNOWN; /* * lines' lengths @@ -1245,28 +1245,28 @@ int RecursiveFilterOnBuffer( void *bufferIn, /* * 1D arrays for computations. */ - double *theLine = (double*)NULL; - double *resLine = (double*)NULL; - double *tmpLine = (double*)NULL; + double *theLine = (double*)nullptr; + double *resLine = (double*)nullptr; + double *tmpLine = (double*)nullptr; /* * pointers for computations; */ - r32 *r32firstPoint = (r32*)NULL; - r64 *r64firstPoint = (r64*)NULL; - r32 *r32_pt = (r32*)NULL; - r64 *r64_pt = (r64*)NULL; - double *dbl_pt1 = (double*)NULL; - double *dbl_pt2 = (double*)NULL; + r32 *r32firstPoint = (r32*)nullptr; + r64 *r64firstPoint = (r64*)nullptr; + r32 *r32_pt = (r32*)nullptr; + r64 *r64_pt = (r64*)nullptr; + double *dbl_pt1 = (double*)nullptr; + double *dbl_pt2 = (double*)nullptr; double dbl_first = 0.0; double dbl_last = 0.0; int offsetLastPoint = 0; int offsetNextFirstPoint = 0; - r32 *r32firstPointResult = (r32*)NULL; - r64 *r64firstPointResult = (r64*)NULL; - double *theLinePlusBorder = (double*)NULL; - double *resLinePlusBorder = (double*)NULL; + r32 *r32firstPointResult = (r32*)nullptr; + r64 *r64firstPointResult = (r64*)nullptr; + double *theLinePlusBorder = (double*)nullptr; + double *resLinePlusBorder = (double*)nullptr; - RFcoefficientType *RFC = NULL; + RFcoefficientType *RFC = nullptr; /* * We check the buffers' dimensions. @@ -1281,9 +1281,9 @@ int RecursiveFilterOnBuffer( void *bufferIn, /* * We check the pointers. */ - if ( (bufferIn == (void*)NULL) || (bufferOut == (void*)NULL) ) { + if ( (bufferIn == (void*)nullptr) || (bufferOut == (void*)nullptr) ) { if ( _VERBOSE_ > 0 ) - fprintf( stderr, " Fatal error in %s: NULL pointer on buffer.\n", proc ); + fprintf( stderr, " Fatal error in %s: nullptr pointer on buffer.\n", proc ); return( EXIT_ON_FAILURE ); } @@ -1297,7 +1297,7 @@ int RecursiveFilterOnBuffer( void *bufferIn, typeResult = typeOut; } else { bufferResult = (void*)malloc( (dimx*dimy*dimz) * sizeof(r32) ); - if ( bufferResult == (void*)NULL ) { + if ( bufferResult == (void*)nullptr ) { if ( _VERBOSE_ > 0 ) fprintf( stderr, " Fatal error in %s: unable to allocate auxiliary buffer.\n", proc ); return( EXIT_ON_FAILURE ); @@ -1323,7 +1323,7 @@ int RecursiveFilterOnBuffer( void *bufferIn, /* * Estimation of the lines' length along each direction. */ - if ( borderLengths != NULL ) { + if ( borderLengths != nullptr ) { borderXlength = borderLengths[0]; borderYlength = borderLengths[1]; borderZlength = borderLengths[2]; @@ -1354,7 +1354,7 @@ int RecursiveFilterOnBuffer( void *bufferIn, * We will use them to process each line. */ theLine = (double*)malloc( 3 * maxLengthline * sizeof(double) ); - if ( theLine == (double*)NULL ) { + if ( theLine == (double*)nullptr ) { if ( _VERBOSE_ > 0 ) fprintf( stderr, " Fatal error in %s: unable to allocate auxiliary work arrays.\n", proc ); if ( (typeOut != CGAL_FLOAT) && (typeOut != CGAL_DOUBLE) ) @@ -1383,7 +1383,7 @@ int RecursiveFilterOnBuffer( void *bufferIn, RFC = InitRecursiveCoefficients( (double)filterCoefs[0], filterType, derivatives[0] ); - if ( RFC == NULL ) { + if ( RFC == nullptr ) { if ( _VERBOSE_ != 0 ) fprintf( stderr, " %s: unable to allocate coefficients\n", proc ); if ( (typeOut != CGAL_FLOAT) && (typeOut != CGAL_DOUBLE) ) @@ -1466,7 +1466,7 @@ int RecursiveFilterOnBuffer( void *bufferIn, typeToBeProcessed = typeResult; free( RFC ); - RFC = NULL; + RFC = nullptr; } /* end of Processing along X. */ @@ -1482,7 +1482,7 @@ int RecursiveFilterOnBuffer( void *bufferIn, RFC = InitRecursiveCoefficients( (double)filterCoefs[1], filterType, derivatives[1] ); - if ( RFC == NULL ) { + if ( RFC == nullptr ) { if ( _VERBOSE_ != 0 ) fprintf( stderr, " %s: unable to allocate coefficients\n", proc ); if ( (typeOut != CGAL_FLOAT) && (typeOut != CGAL_DOUBLE) ) @@ -1601,7 +1601,7 @@ int RecursiveFilterOnBuffer( void *bufferIn, typeToBeProcessed = typeResult; free( RFC ); - RFC = NULL; + RFC = nullptr; } /* end of Processing along Y. */ @@ -1618,7 +1618,7 @@ int RecursiveFilterOnBuffer( void *bufferIn, RFC = InitRecursiveCoefficients( (double)filterCoefs[2], filterType, derivatives[2] ); - if ( RFC == NULL ) { + if ( RFC == nullptr ) { if ( _VERBOSE_ != 0 ) fprintf( stderr, " %s: unable to allocate coefficients\n", proc ); if ( (typeOut != CGAL_FLOAT) && (typeOut != CGAL_DOUBLE) ) @@ -1707,7 +1707,7 @@ int RecursiveFilterOnBuffer( void *bufferIn, } free( RFC ); - RFC = NULL; + RFC = nullptr; } /* end of Processing along Z. */ diff --git a/CGAL_ImageIO/include/CGAL/ImageIO/recline_impl.h b/CGAL_ImageIO/include/CGAL/ImageIO/recline_impl.h index 34f4917a4bd..cf5a9fe2865 100644 --- a/CGAL_ImageIO/include/CGAL/ImageIO/recline_impl.h +++ b/CGAL_ImageIO/include/CGAL/ImageIO/recline_impl.h @@ -105,12 +105,12 @@ RFcoefficientType * InitRecursiveCoefficients( double x, double cos0, sin0, cos1, sin1; double sumA=0.0, sumC=0.0, aux; - RFcoefficientType *RFC = NULL; + RFcoefficientType *RFC = nullptr; RFC = (RFcoefficientType *)malloc( sizeof(RFcoefficientType) ); - if ( RFC == NULL ) { + if ( RFC == nullptr ) { if ( get_static_verbose_recline() != 0 ) fprintf( stderr, "%s: allocation failed\n", proc ); - return( NULL ); + return( nullptr ); } RFC->sd1 = RFC->sd2 = RFC->sd3 = RFC->sd4 = 0.0; @@ -137,7 +137,7 @@ RFcoefficientType * InitRecursiveCoefficients( double x, fprintf( stderr, "%s: improper value of coefficient (should be >= 0.1).\n", proc ); } free( RFC ); - return( NULL ); + return( nullptr ); } switch ( derivative ) { @@ -146,7 +146,7 @@ RFcoefficientType * InitRecursiveCoefficients( double x, fprintf( stderr, "%s: improper value of derivative order.\n", proc ); } free( RFC ); - return( NULL ); + return( nullptr ); case DERIVATIVE_0 : a0 = 0.6570033214 / x; a1 = 1.978946687 / x; @@ -217,7 +217,7 @@ RFcoefficientType * InitRecursiveCoefficients( double x, fprintf( stderr, "%s: improper value of derivative order.\n", proc ); } free( RFC ); - return( NULL ); + return( nullptr ); case DERIVATIVE_0 : case DERIVATIVE_2 : RFC->sn1 = RFC->sp1 - RFC->sd1 * RFC->sp0; @@ -245,7 +245,7 @@ RFcoefficientType * InitRecursiveCoefficients( double x, fprintf( stderr, "%s: improper value of coefficient (should be >= 0.1).\n", proc ); } free( RFC ); - return( NULL ); + return( nullptr ); } switch ( derivative ) { @@ -444,7 +444,7 @@ RFcoefficientType * InitRecursiveCoefficients( double x, fprintf( stderr, "%s: improper value of coefficient (should be >= 0.1 and <= 1.9).\n", proc ); } free( RFC ); - return( NULL ); + return( nullptr ); } ex = exp( (-x) ); diff --git a/CGAL_ImageIO/include/CGAL/ImageIO_impl.h b/CGAL_ImageIO/include/CGAL/ImageIO_impl.h index 70581bbc45c..c91d700a254 100644 --- a/CGAL_ImageIO/include/CGAL/ImageIO_impl.h +++ b/CGAL_ImageIO/include/CGAL/ImageIO_impl.h @@ -80,13 +80,13 @@ struct Remove_supported_file_format { inline PTRIMAGE_FORMAT & get_static_firstFormat() { - static PTRIMAGE_FORMAT firstFormat = NULL; + static PTRIMAGE_FORMAT firstFormat = nullptr; return firstFormat; } inline PTRIMAGE_FORMAT & get_static_inrimageFormat() { - static PTRIMAGE_FORMAT inrimageFormat = NULL; + static PTRIMAGE_FORMAT inrimageFormat = nullptr; return inrimageFormat; } @@ -102,14 +102,14 @@ CGAL_UNUSED static Remove_supported_file_format &rsff_dummy_ref = get_static_rsf #else // not header-only /** the first file format is initialized to null */ -static PTRIMAGE_FORMAT firstFormat = NULL; +static PTRIMAGE_FORMAT firstFormat = nullptr; inline PTRIMAGE_FORMAT & get_static_firstFormat() { return firstFormat; } /** the Inrimage file format (default format) is initialized to null */ -static PTRIMAGE_FORMAT InrimageFormat = NULL; +static PTRIMAGE_FORMAT InrimageFormat = nullptr; inline PTRIMAGE_FORMAT & get_static_inrimageFormat() { return InrimageFormat; @@ -294,11 +294,11 @@ size_t ImageIO_read(const _image *im, void *buf, size_t len) CGAL_INLINE_FUNCTION char *ImageIO_gets( const _image *im, char *str, int size ) { - char *ret = NULL; + char *ret = nullptr; switch(im->openMode) { default : case OM_CLOSE : - return NULL; + return nullptr; case OM_STD : #ifdef CGAL_USE_ZLIB ret = (char *) gzgets(im->fd, str, size ); @@ -401,7 +401,7 @@ int ImageIO_close( _image* im ) #endif } - im->fd = NULL; + im->fd = nullptr; im->openMode = OM_CLOSE; return ret; @@ -414,7 +414,7 @@ int ImageIO_close( _image* im ) /* given an initialized file descriptor and a file name, - open file from stdin (if name == NULL, or name == "-", or name == "<"), + open file from stdin (if name == nullptr, or name == "-", or name == "<"), or a standard/gzipped file otherwise (gzipped files are handled assuming that it is compiled and linked with zlib). openMode will have one of the following value: @@ -426,7 +426,7 @@ void _openReadImage(_image* im, const char *name) { if(im->openMode == OM_CLOSE) { /* open from stdin */ - if( name == NULL || name[0] == '\0' + if( name == nullptr || name[0] == '\0' || (name[0] == '-' && name[1] == '\0') || (name[0] == '<' && name[1] == '\0') ) { #ifdef CGAL_USE_ZLIB @@ -456,7 +456,7 @@ void _openReadImage(_image* im, const char *name) { /* given an initialized file descriptor and a file name, - open file from stdout (if name == NULL, or name == "-", or name == ">"), + open file from stdout (if name == nullptr, or name == "-", or name == ">"), a gzipped pipe (if name got the extension ".gz") or a standard file otherwise. openMode will have one of the following value: @@ -469,7 +469,7 @@ void _openWriteImage(_image* im, const char *name) { im->openMode = OM_CLOSE; - if( name == NULL || name[0] == '\0' + if( name == nullptr || name[0] == '\0' || (name[0] == '-' && name[1] == '\0') || (name[0] == '>' && name[1] == '\0') ) { @@ -529,8 +529,8 @@ void _openWriteImage(_image* im, const char *name) CGAL_INLINE_FUNCTION void setImageIOAllocationRoutines(ALLOCATION_FUNCTION alloc, DEALLOCATION_FUNCTION del) { - if(alloc != NULL) allocRoutine = alloc; - if(del != NULL) deleteRoutine = del; + if(alloc != nullptr) allocRoutine = alloc; + if(del != nullptr) deleteRoutine = del; } @@ -575,7 +575,7 @@ _image *_initImage() { _image *im; im = (_image *) ImageIO_alloc(sizeof(_image)); - if ( im == NULL ) return( im ); + if ( im == nullptr ) return( im ); /* default image size is 1*1*1 */ im->xdim = im->ydim = im->zdim = im->vdim = 1; @@ -592,10 +592,10 @@ _image *_initImage() { im->rx = im->ry = im->rz = 0.0; /* no data yet */ - im->data = NULL; + im->data = nullptr; /* no file associated to image */ - im->fd = NULL; + im->fd = nullptr; im->openMode = OM_CLOSE; im->endianness = END_UNKNOWN; @@ -605,7 +605,7 @@ _image *_initImage() { im->dataMode = DM_BINARY; /* no user string */ - im->user = NULL; + im->user = nullptr; im->nuser = 0; /* unknown word kind */ @@ -613,10 +613,10 @@ _image *_initImage() { im->wordKind = WK_UNKNOWN; im->vectMode = VM_SCALAR; im->sign = SGN_UNKNOWN; - im->imageFormat = NULL; + im->imageFormat = nullptr; /** eventually initializes the supported file formats */ - if (get_static_firstFormat()==NULL) + if (get_static_firstFormat()==nullptr) initSupportedFileFormat(); /* return image descriptor */ return im; @@ -630,7 +630,7 @@ _image *_createImage(int x, int y, int z, int v, _image *im; im = (_image *) ImageIO_alloc(sizeof(_image)); - if ( im == NULL ) return( im ); + if ( im == nullptr ) return( im ); im->xdim = x; im->ydim = y; @@ -653,7 +653,7 @@ _image *_createImage(int x, int y, int z, int v, im->data = ImageIO_alloc(std::size_t(x)*std::size_t(y)*std::size_t(z)*std::size_t(v)*std::size_t(w)); /* no file associated to image */ - im->fd = NULL; + im->fd = nullptr; im->openMode = OM_CLOSE; im->endianness = END_UNKNOWN; @@ -663,7 +663,7 @@ _image *_createImage(int x, int y, int z, int v, im->dataMode = DM_BINARY; /* no user string */ - im->user = NULL; + im->user = nullptr; im->nuser = 0; /* unknown word kind */ @@ -671,10 +671,10 @@ _image *_createImage(int x, int y, int z, int v, im->wordKind = wk; im->vectMode = VM_SCALAR; im->sign = sgn; - im->imageFormat = NULL; + im->imageFormat = nullptr; /** eventually initializes the supported file formats */ - if (get_static_firstFormat()==NULL) + if (get_static_firstFormat()==nullptr) initSupportedFileFormat(); /* return image descriptor */ return im; @@ -698,23 +698,23 @@ CGAL_INLINE_FUNCTION void _freeImage(_image *im) { unsigned int i; - if ( im == NULL ) return; + if ( im == nullptr ) return; /* close image if opened */ if(im->openMode != OM_CLOSE) ImageIO_close(im); /* free data if any */ - if(im->data != NULL) ImageIO_free(im->data); - im->data = NULL; + if(im->data != nullptr) ImageIO_free(im->data); + im->data = nullptr; /* free user string array if any */ - if( (im->nuser > 0) && (im->user != NULL) ) { + if( (im->nuser > 0) && (im->user != nullptr) ) { for(i = 0; i < im->nuser; i++) - if ( im->user[i] != NULL ) ImageIO_free(im->user[i]); + if ( im->user[i] != nullptr ) ImageIO_free(im->user[i]); ImageIO_free(im->user); } im->nuser = 0; - im->user = NULL; + im->user = nullptr; /* free given descriptor */ ImageIO_free(im); @@ -724,9 +724,9 @@ void _freeImage(_image *im) { -/* Reads an image from a file and returns an image descriptor or NULL if +/* Reads an image from a file and returns an image descriptor or nullptr if reading failed. - Reads from stdin if image name is NULL. */ + Reads from stdin if image name is nullptr. */ CGAL_INLINE_FUNCTION _image* _readImage(const char *name) { _image *im; @@ -735,13 +735,13 @@ _image* _readImage(const char *name) { /* read header */ im = _readImageHeader( name ); - if(im != NULL && im->openMode != OM_CLOSE) { + if(im != nullptr && im->openMode != OM_CLOSE) { /* read body */ if(_readImageData(im) < 0) { fprintf(stderr, "_readImage: error: invalid data encountered in \'%s\'\n", name); _freeImage(im); - return NULL; + return nullptr; } ImageIO_close(im); } @@ -764,10 +764,10 @@ _image* _readImage_raw(const char *name, SIGN sgned ) { - _image *im = NULL; + _image *im = nullptr; im = (_image *) ImageIO_alloc(sizeof(_image)); - if ( im == NULL ) - return NULL; + if ( im == nullptr ) + return nullptr; im->xdim = rx; im->ydim = ry; @@ -787,14 +787,14 @@ _image* _readImage_raw(const char *name, im->rx = im->ry = im->rz = 0.0; - im->fd = NULL; + im->fd = nullptr; im->openMode = OM_CLOSE; im->endianness = END_UNKNOWN; im->dataMode = DM_BINARY; // no user string - im->user = NULL; + im->user = nullptr; im->nuser = 0; // word type (unsigned byte) @@ -802,14 +802,14 @@ _image* _readImage_raw(const char *name, im->wordKind = wk; im->vectMode = VM_SCALAR; im->sign = sgned; - im->imageFormat = NULL; + im->imageFormat = nullptr; // read file ::_openReadImage(im, name); if(!im->fd) { fprintf(stderr, "_readImage_raw: error: unable to open file \'%s\'\n", name); _freeImage(im); - return NULL; + return nullptr; } // read offset @@ -820,8 +820,8 @@ _image* _readImage_raw(const char *name, } // allocate memory im->data = ImageIO_alloc(rx*ry*rz*wdim); - if(im->data == NULL) - return NULL; + if(im->data == nullptr) + return nullptr; // read ImageIO_read(im, im->data, rx*ry*rz*wdim); @@ -844,9 +844,9 @@ _image* _readImage_raw(const char *name, return im; } -/* Reads an image from a file and returns an image descriptor or NULL if
    +/* Reads an image from a file and returns an image descriptor or nullptr if
    reading failed.
    - Reads from stdin if image name is NULL. + Reads from stdin if image name is nullptr. If the image is vectorial, it is uninterlaced. */ CGAL_INLINE_FUNCTION _image* _readNonInterlacedImage(const char *name) { @@ -862,7 +862,7 @@ _image* _readNonInterlacedImage(const char *name) { fprintf(stderr, "_readImage: error: invalid data encountered in \'%s\'\n", name); _freeImage(im); - return NULL; + return nullptr; } } /* read vectorial image body */ @@ -872,7 +872,7 @@ _image* _readNonInterlacedImage(const char *name) { fprintf(stderr, "_readImage: error: invalid data encountered in \'%s\'\n", name); _freeImage(im); - return NULL; + return nullptr; } } ImageIO_close(im); @@ -893,23 +893,23 @@ _image* _readNonInterlacedImage(const char *name) { /* Write inrimage given in inr in file name. If file name's suffix is .gz, the image is gziped. If file name's suffix is .hdr, the image - is written in ANALYZE format. If file name is NULL, image is written + is written in ANALYZE format. If file name is nullptr, image is written on stdout */ CGAL_INLINE_FUNCTION int _writeImage(_image *im, const char *name_to_be_written ) { int r = ImageIO_NO_ERROR; std::size_t length = 0; - char *name = NULL; - char *baseName = NULL; + char *name = nullptr; + char *baseName = nullptr; - if ( im == NULL ) return -1; + if ( im == nullptr ) return -1; /* different conventions for the standard input */ - if ( name_to_be_written == NULL || name_to_be_written[0] == '\0' + if ( name_to_be_written == nullptr || name_to_be_written[0] == '\0' || (name_to_be_written[0] == '-' && name_to_be_written[1] == '\0') || (name_to_be_written[0] == '>' && name_to_be_written[1] == '\0') ) { - name = NULL; + name = nullptr; } else { name = strdup( name_to_be_written ); @@ -919,7 +919,7 @@ int _writeImage(_image *im, const char *name_to_be_written ) { /* what is the wanted format */ - if ( name == NULL ) { + if ( name == nullptr ) { im->imageFormat = get_static_inrimageFormat(); } else { std::size_t i,extLength; @@ -929,10 +929,10 @@ int _writeImage(_image *im, const char *name_to_be_written ) { /* scan all formats; */ - im->imageFormat=NULL; + im->imageFormat=nullptr; length=strlen(name); - for(f=get_static_firstFormat();(f!=NULL)&& (im->imageFormat==NULL);f=f->next) { + for(f=get_static_firstFormat();(f!=nullptr)&& (im->imageFormat==nullptr);f=f->next) { /* scan all extensions for that format */ ptr=&f->fileExtension[0]; @@ -960,7 +960,7 @@ int _writeImage(_image *im, const char *name_to_be_written ) { baseName[i]='\0'; } - } while (((*ptr)!='\0') && (im->imageFormat==NULL)); + } while (((*ptr)!='\0') && (im->imageFormat==nullptr)); } if (!im->imageFormat) { @@ -978,15 +978,15 @@ int _writeImage(_image *im, const char *name_to_be_written ) { if(!im->fd) { fprintf(stderr, "_writeImage: error: open failed\n"); - if ( name != NULL ) free( name ); - if ( baseName != NULL ) free( baseName ); + if ( name != nullptr ) free( name ); + if ( baseName != nullptr ) free( baseName ); return ImageIO_OPENING; } */ if (im->imageFormat) { - if (im->imageFormat->writeImage==NULL) { + if (im->imageFormat->writeImage==nullptr) { im->imageFormat=get_static_inrimageFormat(); } @@ -1008,11 +1008,11 @@ int _writeImage(_image *im, const char *name_to_be_written ) { /* close file descriptor */ ImageIO_close( im ); - im->fd = NULL; + im->fd = nullptr; im->openMode = OM_CLOSE; - if ( baseName != NULL ) free( baseName ); - if ( name != NULL ) free( name ); + if ( baseName != nullptr ) free( baseName ); + if ( name != nullptr ) free( name ); return r; } @@ -1058,7 +1058,7 @@ _image *_readImageHeaderAndGetError( const char *name_to_be_read, int *error ) { _image *im; char magic[5]; - char *name = NULL; + char *name = nullptr; PTRIMAGE_FORMAT f; int res; @@ -1066,10 +1066,10 @@ _image *_readImageHeaderAndGetError( const char *name_to_be_read, int *error ) /* open image file */ im = _initImage(); - if ( name_to_be_read == NULL || name_to_be_read[0] == '\0' + if ( name_to_be_read == nullptr || name_to_be_read[0] == '\0' || (name_to_be_read[0] == '-' && name_to_be_read[1] == '\0') || (name_to_be_read[0] == '<' && name_to_be_read[1] == '\0') ) { - name = NULL; + name = nullptr; } else { name = strdup( name_to_be_read ); @@ -1079,15 +1079,15 @@ _image *_readImageHeaderAndGetError( const char *name_to_be_read, int *error ) _openReadImage(im, name); if(!im->fd) { - if(name == NULL) { - fprintf(stderr, "_readImageHeaderAndGetError: error: NULL file name\n"); + if(name == nullptr) { + fprintf(stderr, "_readImageHeaderAndGetError: error: nullptr file name\n"); } else { fprintf(stderr, "_readImageHeaderAndGetError: error: unable to open file \'%s\'\n", name); } _freeImage(im); *error = ImageIO_OPENING; - if ( name != NULL ) free( name ); - return NULL; + if ( name != nullptr ) free( name ); + return nullptr; } initSupportedFileFormat(); @@ -1105,7 +1105,7 @@ _image *_readImageHeaderAndGetError( const char *name_to_be_read, int *error ) magic[4] = '\0'; ImageIO_seek(im, 0L, SEEK_SET); /** test each format */ - for(f=get_static_firstFormat();(f!=NULL)&& (im->imageFormat==NULL);f=f->next) { + for(f=get_static_firstFormat();(f!=nullptr)&& (im->imageFormat==nullptr);f=f->next) { /* test if it is the correct format based on magic and file extension */ if (((*f->testImageFormat)(magic, name)) >=0) { im->imageFormat=f; @@ -1113,13 +1113,13 @@ _image *_readImageHeaderAndGetError( const char *name_to_be_read, int *error ) } } - if ( im->imageFormat == NULL ) { + if ( im->imageFormat == nullptr ) { fprintf(stderr, "_readImageHeaderAndGetError: does not find image format for \'%s\'\n", name); ImageIO_close( im ); _freeImage(im); *error = ImageIO_UNKNOWN_TYPE; - if ( name != NULL ) free( name ); - return NULL; + if ( name != nullptr ) free( name ); + return nullptr; } /* now tests if the header can be read correctly */ @@ -1127,19 +1127,19 @@ _image *_readImageHeaderAndGetError( const char *name_to_be_read, int *error ) res=(*(im->imageFormat)->readImageHeader)(name,im); /* could read header only */ if (res == 0) { - if ( name != NULL ) free( name ); + if ( name != nullptr ) free( name ); return( im ); } /* could read header and data */ else if ( res > 0 ) { ImageIO_close(im); - if ( name != NULL ) free( name ); + if ( name != nullptr ) free( name ); return im; } /* could not read error : throw error */ fprintf(stderr, "_readImageHeaderAndGetError: an error occurs when reading image\n" ); - if ( name == NULL || im->openMode == OM_STD) { + if ( name == nullptr || im->openMode == OM_STD) { fprintf(stderr, "\t from \'standard input\'" ); } else { @@ -1149,8 +1149,8 @@ _image *_readImageHeaderAndGetError( const char *name_to_be_read, int *error ) ImageIO_close( im ); _freeImage(im); *error = ImageIO_READING_HEADER; - if ( name != NULL ) free( name ); - return NULL; + if ( name != nullptr ) free( name ); + return nullptr; } @@ -1243,7 +1243,7 @@ static void _swapImageData( _image *im ) /* Read data of an inrimage. - If im->data is not NULL, assume that the buffer was previously allocated + If im->data is not nullptr, assume that the buffer was previously allocated Swap bytes depending on the endianness and the current architecture */ CGAL_INLINE_FUNCTION int _readImageData(_image *im) { @@ -1280,7 +1280,7 @@ int _readImageData(_image *im) { /* Read data of a vectorial inrimage, making the resulting buffer non- inerlaced. - If im->data is not NULL, assume that the buffer was previously allocated + If im->data is not nullptr, assume that the buffer was previously allocated Swap bytes depending on the endianness and the current architecture. */ CGAL_INLINE_FUNCTION int _readNonInterlacedImageData(_image *im) { @@ -1472,7 +1472,7 @@ PTRIMAGE_FORMAT imageType(const char *fileName) { #endif } - if(!f) return NULL; + if(!f) return nullptr; #ifdef CGAL_USE_ZLIB gzread( f, (void *) magic, 4); @@ -1489,10 +1489,10 @@ PTRIMAGE_FORMAT imageType(const char *fileName) { if(fileName) fclose( f ); #endif - if (get_static_firstFormat()==NULL) + if (get_static_firstFormat()==nullptr) initSupportedFileFormat(); - for(format=get_static_firstFormat();(format!=NULL);format=format->next) { + for(format=get_static_firstFormat();(format!=nullptr);format=format->next) { /* test if it is the correct header based on magic and file extension */ if (((*format->testImageFormat)(magic,fileName)) >=0) { return format; @@ -1550,13 +1550,13 @@ int addImageFormatAtEnd( PTRIMAGE_FORMAT format) (strlen(format->fileExtension)>0) && (strlen(format->realName)>0) ) { - format->next = NULL; + format->next = nullptr; - if (get_static_firstFormat() == NULL) { + if (get_static_firstFormat() == nullptr) { get_static_firstFormat()=format; } else { - for(f=get_static_firstFormat();(f->next!=NULL);f=f->next) + for(f=get_static_firstFormat();(f->next!=nullptr);f=f->next) ; f->next=format; } @@ -1577,7 +1577,7 @@ CGAL_INLINE_FUNCTION void initSupportedFileFormat() { PTRIMAGE_FORMAT f; - if ( get_static_inrimageFormat() == NULL ) { + if ( get_static_inrimageFormat() == nullptr ) { f = createAnalyzeFormat(); addImageFormatAtEnd( f ); f = createBMPFormat(); @@ -1616,7 +1616,7 @@ void printSupportedFileFormat() { initSupportedFileFormat(); - for(i=0, f=get_static_firstFormat();(f!=NULL);i++, f=f->next) { + for(i=0, f=get_static_firstFormat();(f!=nullptr);i++, f=f->next) { if ( (f->testImageFormat) && (f->readImageHeader) && (strlen(f->fileExtension)>0) && @@ -1638,12 +1638,12 @@ CGAL_INLINE_FUNCTION void removeSupportedFileFormat() { PTRIMAGE_FORMAT f=get_static_firstFormat(); - while( f != NULL) { + while( f != nullptr) { PTRIMAGE_FORMAT f_old = f; f = f->next; ImageIO_free( f_old); } - get_static_inrimageFormat()=NULL; + get_static_inrimageFormat()=nullptr; } @@ -1727,7 +1727,7 @@ void convertImageTypeToFloat(_image* image){ const std::size_t dimz = image->zdim; float * array = (float*)ImageIO_alloc (dimx * dimy * dimz *sizeof(float)); - if (array == NULL ) { + if (array == nullptr ) { fprintf ( stderr, "allocation error\n" ); return; } diff --git a/CGAL_ImageIO/include/CGAL/SEP_to_ImageIO.h b/CGAL_ImageIO/include/CGAL/SEP_to_ImageIO.h index 9b1eeaff285..f7875901b4e 100644 --- a/CGAL_ImageIO/include/CGAL/SEP_to_ImageIO.h +++ b/CGAL_ImageIO/include/CGAL/SEP_to_ImageIO.h @@ -122,7 +122,7 @@ protected : // image rotation _im->rx = _im->ry = _im->rz = 0.0; - _im->fd = NULL; + _im->fd = nullptr; _im->openMode = OM_CLOSE; if(string_field("data_format") == "native_float" || string_field("data_format") == "\"native_float\"") @@ -135,7 +135,7 @@ protected : _im->dataMode = DM_BINARY; // no user string - _im->user = NULL; + _im->user = nullptr; _im->nuser = 0; // word type (unsigned byte) @@ -143,7 +143,7 @@ protected : _im->wordKind = WK_FLOAT; _im->vectMode = VM_SCALAR; _im->sign = SGN_SIGNED; - _im->imageFormat = NULL; + _im->imageFormat = nullptr; ::_openReadImage(_im, dataFilename.c_str()); if(!_im->fd) return false; diff --git a/CGAL_ipelets/include/CGAL/CGAL_Ipelet_base_v6.h b/CGAL_ipelets/include/CGAL/CGAL_Ipelet_base_v6.h index 027a83bc6c0..94d844cd645 100644 --- a/CGAL_ipelets/include/CGAL/CGAL_Ipelet_base_v6.h +++ b/CGAL_ipelets/include/CGAL/CGAL_Ipelet_base_v6.h @@ -71,7 +71,7 @@ namespace CGAL{ Ipelet_base(const std::string NameS,const std::string SubLabS[],const std::string HMsgS[]) - :SubLab(&SubLabS[0]),HMsg(&HMsgS[0]),Name(NameS),_page(NULL),_helper(NULL){}; + :SubLab(&SubLabS[0]),HMsg(&HMsgS[0]),Name(NameS),_page(nullptr),_helper(nullptr){}; IpePage* get_IpePage() const {return _page;} @@ -89,7 +89,7 @@ namespace CGAL{ protected_run(i); } catch(...){ - helper->MessageBox("Error : Save your page in a file and submit it to \n https://www.cgal.org/bug_report.html","OK",NULL,NULL); + helper->MessageBox("Error : Save your page in a file and submit it to \n https://www.cgal.org/bug_report.html","OK",nullptr,nullptr); } }; @@ -112,7 +112,7 @@ namespace CGAL{ hmsg=hmsg+"
  • "+SubLab[i]+": "+HMsg[i]+"
  • "; else hmsg=hmsg+"
  • "+HMsg[0]+"
  • "; - _helper->MessageBox(&hmsg[0],"OK",NULL,NULL); + _helper->MessageBox(&hmsg[0],"OK",nullptr,nullptr); return; } @@ -338,7 +338,7 @@ public: SSP_ipe->SetClosed(true); return SSP_ipe; } - return NULL; + return nullptr; } @@ -352,10 +352,10 @@ public: typename std::iterator_traits::value_type, Point_2 > - >::type* =NULL) const + >::type* =nullptr) const { IpeSegmentSubPath* SSP_ipe=create_polyline(first,last,setclose); - if (SSP_ipe!=NULL){ + if (SSP_ipe!=nullptr){ IpePath* obj_ipe = new IpePath(_helper->Attributes()); obj_ipe->AddSubPath(SSP_ipe); if (blackfill) @@ -364,7 +364,7 @@ public: if (deselect_all) (--_page->end())->SetSelect(IpePgObject::ENone); return obj_ipe; } - return NULL; + return nullptr; } void draw_in_ipe(const Circle_2& C,bool deselect_all=false) const { @@ -651,7 +651,7 @@ public: boost::mpl::or_< boost::is_same::value_type,Circular_arc_2> , boost::is_same::value_type,Polygon_2> > > > > - >::type* = NULL) const + >::type* = nullptr) const { for (iterator it=begin;it!=end;++it) draw_in_ipe(*it,bbox); diff --git a/CGAL_ipelets/include/CGAL/CGAL_Ipelet_base_v7.h b/CGAL_ipelets/include/CGAL/CGAL_Ipelet_base_v7.h index 22ec39cbff4..f9145de5d41 100644 --- a/CGAL_ipelets/include/CGAL/CGAL_Ipelet_base_v7.h +++ b/CGAL_ipelets/include/CGAL/CGAL_Ipelet_base_v7.h @@ -107,7 +107,7 @@ namespace CGAL{ Ipelet_base(const std::string NameS,const std::string SubLabS[],const std::string HMsgS[]) - :SubLab(&SubLabS[0]),HMsg(&HMsgS[0]),Name(NameS),data_(NULL),helper_(NULL){}; + :SubLab(&SubLabS[0]),HMsg(&HMsgS[0]),Name(NameS),data_(nullptr),helper_(nullptr){}; ipe::Page* get_IpePage() const {return data_->iPage;} @@ -127,7 +127,7 @@ namespace CGAL{ return true; } catch(...){ - helper->messageBox("Error : Save your page in a file and submit it to \n https://www.cgal.org/bug_report.html",NULL,ipe::IpeletHelper::EOkCancelButtons); + helper->messageBox("Error : Save your page in a file and submit it to \n https://www.cgal.org/bug_report.html",nullptr,ipe::IpeletHelper::EOkCancelButtons); return false; } }; @@ -142,7 +142,7 @@ namespace CGAL{ hmsg=hmsg+"
  • "+SubLab[i]+": "+HMsg[i]+"
  • "; else hmsg=hmsg+"
  • "+HMsg[0]+"
  • "; - get_IpeletHelper()->messageBox(&hmsg[0],NULL,ipe::IpeletHelper::EOkCancelButtons); + get_IpeletHelper()->messageBox(&hmsg[0],nullptr,ipe::IpeletHelper::EOkCancelButtons); return; } @@ -350,7 +350,7 @@ public: SSP_ipe->setClosed(true); return SSP_ipe; } - return NULL; + return nullptr; } @@ -364,10 +364,10 @@ public: typename std::iterator_traits::value_type, Point_2 > - >::type* =NULL) const + >::type* =nullptr) const { ipe::Curve* SSP_ipe=create_polyline(first,last,setclose); - if (SSP_ipe!=NULL){ + if (SSP_ipe!=nullptr){ ipe::Shape shape; shape.appendSubPath(SSP_ipe); ipe::Path* obj_ipe=new ipe::Path(CURRENTATTRIBUTES,shape); @@ -378,7 +378,7 @@ public: get_IpePage()->append( (deselect_all?ipe::ENotSelected:get_selection_type()),CURRENTLAYER,obj_ipe); return obj_ipe; } - return NULL; + return nullptr; } void draw_in_ipe(const Circle_2& C,bool deselect_all=false) const { @@ -660,7 +660,7 @@ public: boost::mpl::or_< boost::is_same::value_type,Circular_arc_2> , boost::is_same::value_type,Polygon_2> > > > > - >::type* = NULL) const + >::type* = nullptr) const { for (iterator it=begin;it!=end;++it) draw_in_ipe(*it,bbox); diff --git a/Cartesian_kernel/include/CGAL/Cartesian/Circle_3.h b/Cartesian_kernel/include/CGAL/Cartesian/Circle_3.h index d2ed2fc5362..15299d4c387 100644 --- a/Cartesian_kernel/include/CGAL/Cartesian/Circle_3.h +++ b/Cartesian_kernel/include/CGAL/Cartesian/Circle_3.h @@ -91,11 +91,11 @@ public: // s1,s2 must intersect CGAL_kernel_precondition(!(obj.is_empty())); const typename R::Circle_3* circle_ptr=object_cast(&obj); - if(circle_ptr!=NULL) + if(circle_ptr!=nullptr) base = Rep(circle_ptr->diametral_sphere(), circle_ptr->supporting_plane()); else { const typename R::Point_3* point=object_cast(&obj); - CGAL_kernel_precondition(point!=NULL); + CGAL_kernel_precondition(point!=nullptr); CircleC3 circle = CircleC3(*point, FT(0), Vector_3(FT(1),FT(0),FT(0))); base = Rep(circle.diametral_sphere(), circle.supporting_plane()); } @@ -108,11 +108,11 @@ public: // s1,s2 must intersect CGAL_kernel_precondition(!(obj.is_empty())); const typename R::Circle_3* circle_ptr=object_cast(&obj); - if(circle_ptr!=NULL) + if(circle_ptr!=nullptr) base = Rep(circle_ptr->diametral_sphere(), circle_ptr->supporting_plane()); else { const typename R::Point_3* point=object_cast(&obj); - CGAL_kernel_precondition(point!=NULL); + CGAL_kernel_precondition(point!=nullptr); CircleC3 circle = CircleC3(*point, FT(0), Vector_3(FT(1),FT(0),FT(0))); base = Rep(circle.diametral_sphere(), circle.supporting_plane()); } diff --git a/Circular_kernel_2/include/CGAL/Circular_kernel_2/Circular_arc_2.h b/Circular_kernel_2/include/CGAL/Circular_kernel_2/Circular_arc_2.h index a1ee4abbb5c..c8b1d2ec9a3 100644 --- a/Circular_kernel_2/include/CGAL/Circular_kernel_2/Circular_arc_2.h +++ b/Circular_kernel_2/include/CGAL/Circular_kernel_2/Circular_arc_2.h @@ -745,49 +745,49 @@ class Filtered_bbox_circular_arc_2_base : public Base_CK::Circular_arc_2 public: ///////////Construction///////////// - Filtered_bbox_circular_arc_2_base() : P_arc(), bb(NULL) {} + Filtered_bbox_circular_arc_2_base() : P_arc(), bb(nullptr) {} - Filtered_bbox_circular_arc_2_base(const P_arc& arc) : P_arc(arc), bb(NULL) {} + Filtered_bbox_circular_arc_2_base(const P_arc& arc) : P_arc(arc), bb(nullptr) {} // otherwise it will lead to ambiguos definitions explicit Filtered_bbox_circular_arc_2_base(const Circle_2 &c) - : P_arc(c),bb(NULL) + : P_arc(c),bb(nullptr) {} Filtered_bbox_circular_arc_2_base(const Circle_2 &support, const Line_2 &l1, const bool b_l1, const Line_2 &l2, const bool b_l2) - : P_arc(support,l1,b_l1,l2,b_l2),bb(NULL) + : P_arc(support,l1,b_l1,l2,b_l2),bb(nullptr) {} Filtered_bbox_circular_arc_2_base(const Circle_2 &c, const Circle_2 &c1, const bool b_1, const Circle_2 &c2, const bool b_2) - : P_arc(c,c1,b_1,c2,b_2),bb(NULL) + : P_arc(c,c1,b_1,c2,b_2),bb(nullptr) {} Filtered_bbox_circular_arc_2_base(const Point_2 &start, const Point_2 &middle, const Point_2 &end) - : P_arc(start, middle, end),bb(NULL) + : P_arc(start, middle, end),bb(nullptr) {} Filtered_bbox_circular_arc_2_base(const Point_2 &begin, const Point_2 &end, const FT &bulge) - : P_arc(begin, end, bulge),bb(NULL) + : P_arc(begin, end, bulge),bb(nullptr) {} Filtered_bbox_circular_arc_2_base(const Circle_2 &support, const Circular_arc_point_2 &begin, const Circular_arc_point_2 &end) - : P_arc(support, begin, end),bb(NULL) + : P_arc(support, begin, end),bb(nullptr) {} Filtered_bbox_circular_arc_2_base(const Self &c) - : P_arc(c), bb(c.bb ? new Bbox_2(*(c.bb)) : NULL) + : P_arc(c), bb(c.bb ? new Bbox_2(*(c.bb)) : nullptr) {} Filtered_bbox_circular_arc_2_base& operator=(const Self& c) @@ -795,10 +795,10 @@ public: if(this != &c) { this->P_arc::operator=(c); - if (bb != NULL){ + if (bb != nullptr){ delete bb; } - bb = c.bb ? new Bbox_2(*(c.bb)) : NULL; + bb = c.bb ? new Bbox_2(*(c.bb)) : nullptr; } return *this; } @@ -807,7 +807,7 @@ public: Bbox_2 bbox() const { - if(bb==NULL) + if(bb==nullptr) bb=new Bbox_2(CGAL::CircularFunctors::circular_arc_bbox(*this)); return *bb; } @@ -815,7 +815,7 @@ public: ///Specific check used for bbox construction/// bool has_no_bbox() const - { return (bb==NULL);} + { return (bb==nullptr);} private: mutable Bbox_2 *bb; diff --git a/Circular_kernel_2/include/CGAL/Circular_kernel_2/Circular_arc_point_2.h b/Circular_kernel_2/include/CGAL/Circular_kernel_2/Circular_arc_point_2.h index 117e247d5d0..483dd58c822 100644 --- a/Circular_kernel_2/include/CGAL/Circular_kernel_2/Circular_arc_point_2.h +++ b/Circular_kernel_2/include/CGAL/Circular_kernel_2/Circular_arc_point_2.h @@ -105,23 +105,23 @@ public: ////Construction///// Filtered_bbox_circular_arc_point_2_base() - : P_point(), bb(NULL) + : P_point(), bb(nullptr) {} Filtered_bbox_circular_arc_point_2_base(const P_point& pt) - : P_point(pt), bb(NULL) + : P_point(pt), bb(nullptr) {} explicit Filtered_bbox_circular_arc_point_2_base(const Root_for_circles_2_2 & np) - : P_point(np), bb(NULL) + : P_point(np), bb(nullptr) {} explicit Filtered_bbox_circular_arc_point_2_base(const Point_2 & p) - : P_point(p), bb(NULL) + : P_point(p), bb(nullptr) {} Filtered_bbox_circular_arc_point_2_base(const Self &c) - : P_point(c), bb(c.bb ? new Bbox_2(*(c.bb)) : NULL) + : P_point(c), bb(c.bb ? new Bbox_2(*(c.bb)) : nullptr) {} Filtered_bbox_circular_arc_point_2_base& @@ -130,10 +130,10 @@ public: { this->P_point::operator=(c); - if (bb != NULL){ + if (bb != nullptr){ delete bb; } - bb = c.bb ? new Bbox_2(*(c.bb)) : NULL; + bb = c.bb ? new Bbox_2(*(c.bb)) : nullptr; } return *this; } @@ -148,7 +148,7 @@ public: ////Bbox related accessors//// bool has_no_bbox() const - { return (bb==NULL);} + { return (bb==nullptr);} Bbox_2 bbox() const { diff --git a/Circular_kernel_2/include/CGAL/Circular_kernel_2/Line_arc_2.h b/Circular_kernel_2/include/CGAL/Circular_kernel_2/Line_arc_2.h index 1ee97d42289..29b1c20fafd 100644 --- a/Circular_kernel_2/include/CGAL/Circular_kernel_2/Line_arc_2.h +++ b/Circular_kernel_2/include/CGAL/Circular_kernel_2/Line_arc_2.h @@ -140,11 +140,11 @@ public: CGAL_assertion(bool(v)); const Point_2 *pt = CGAL::Intersections::internal::intersect_get(v); - CGAL_assertion(pt != NULL); + CGAL_assertion(pt != nullptr); _begin = Circular_arc_point_2(*pt); v = CGAL::Intersections::internal::intersection(support, l2, CK()); const Point_2 *pt2 = CGAL::Intersections::internal::intersect_get(v); - CGAL_assertion(pt2 != NULL); + CGAL_assertion(pt2 != nullptr); _end = Circular_arc_point_2(*pt2); reset_flags(); } @@ -289,43 +289,43 @@ public: typedef typename CB::Circle_2 Circle_2; typedef typename CB::Circular_arc_point_2 Circular_arc_point_2; - Filtered_bbox_line_arc_2_base() : P_arc(), bb(NULL) {} + Filtered_bbox_line_arc_2_base() : P_arc(), bb(nullptr) {} - Filtered_bbox_line_arc_2_base(const P_arc& arc) : P_arc(arc), bb(NULL) {} + Filtered_bbox_line_arc_2_base(const P_arc& arc) : P_arc(arc), bb(nullptr) {} Filtered_bbox_line_arc_2_base(const Line_2 &support, const Circle_2 &l1, const bool b_l1, const Circle_2 &l2, const bool b_l2) - : P_arc(support,l1,b_l1,l2,b_l2), bb(NULL) + : P_arc(support,l1,b_l1,l2,b_l2), bb(nullptr) {} Filtered_bbox_line_arc_2_base(const Line_2 &support, const Line_2 &l1, const Line_2 &l2) - : P_arc(support,l1,l2), bb(NULL) + : P_arc(support,l1,l2), bb(nullptr) {} Filtered_bbox_line_arc_2_base(const Line_2 &support, const Circular_arc_point_2 &begin, const Circular_arc_point_2 &end) - : P_arc(support, begin, end) , bb(NULL) + : P_arc(support, begin, end) , bb(nullptr) {} Filtered_bbox_line_arc_2_base(const Segment_2 &s) - : P_arc(s) , bb(NULL) + : P_arc(s) , bb(nullptr) {} Filtered_bbox_line_arc_2_base(const Point_2 &p1, const Point_2 &p2) - : P_arc(p1,p2) , bb(NULL) + : P_arc(p1,p2) , bb(nullptr) {} Filtered_bbox_line_arc_2_base(const Filtered_bbox_line_arc_2_base &c) - : P_arc(c), bb(c.bb ? new Bbox_2(*(c.bb)) : NULL) + : P_arc(c), bb(c.bb ? new Bbox_2(*(c.bb)) : nullptr) {} Filtered_bbox_line_arc_2_base& operator=(const Self& c) @@ -334,10 +334,10 @@ public: { this->P_arc::operator=(c); - if (bb != NULL){ + if (bb != nullptr){ delete bb; } - bb = c.bb ? new Bbox_2(*(c.bb)) : NULL; + bb = c.bb ? new Bbox_2(*(c.bb)) : nullptr; } return *this; } @@ -346,13 +346,13 @@ public: Bbox_2 bbox() const { - if(bb==NULL) + if(bb==nullptr) bb=new Bbox_2(P_arc::bbox()); return *bb; } bool has_no_bbox() const - { return (bb==NULL);} + { return (bb==nullptr);} private: diff --git a/Circular_kernel_2/include/CGAL/Circular_kernel_2/internal_functions_on_line_arc_2.h b/Circular_kernel_2/include/CGAL/Circular_kernel_2/internal_functions_on_line_arc_2.h index 49045e1c728..19a33ead2bf 100644 --- a/Circular_kernel_2/include/CGAL/Circular_kernel_2/internal_functions_on_line_arc_2.h +++ b/Circular_kernel_2/include/CGAL/Circular_kernel_2/internal_functions_on_line_arc_2.h @@ -492,7 +492,7 @@ namespace CircularFunctors { if(!v) return res; const Point_2 *pt = CGAL::Intersections::internal::intersect_get(v); - if(pt == NULL) return res; + if(pt == nullptr) return res; Circular_arc_point_2 intersect_point = Circular_arc_point_2(*pt); // (Root_for_circles_2_2(Root_of_2(pt->x()),Root_of_2(pt->y()))); @@ -767,7 +767,7 @@ namespace CircularFunctors { if(!v) return res; const Point_2 *pt = boost::get(&*v); - if(pt == NULL) return res; + if(pt == nullptr) return res; Circular_arc_point_2 intersect_point = Circular_arc_point_2(*pt); diff --git a/Circular_kernel_3/include/CGAL/Circular_kernel_3/Circular_arc_point_3.h b/Circular_kernel_3/include/CGAL/Circular_kernel_3/Circular_arc_point_3.h index ca2aecd1520..0aaef763b8d 100644 --- a/Circular_kernel_3/include/CGAL/Circular_kernel_3/Circular_arc_point_3.h +++ b/Circular_kernel_3/include/CGAL/Circular_kernel_3/Circular_arc_point_3.h @@ -91,13 +91,13 @@ public: // the intersection must be a point const std::pair* pair= boost::get >(&sols[0]); - CGAL_kernel_precondition(pair!=NULL); + CGAL_kernel_precondition(pair!=nullptr); *this = pair->first.rep(); } else { // the intersections must be a point const std::pair* pair= boost::get >(&sols[less_xyz?0:1]); - CGAL_kernel_precondition(pair!=NULL); + CGAL_kernel_precondition(pair!=nullptr); *this = pair->first.rep(); } } @@ -114,13 +114,13 @@ public: // the intersection must be a point const std::pair* pair= boost::get >(&sols[0]); - CGAL_kernel_precondition(pair!=NULL); + CGAL_kernel_precondition(pair!=nullptr); *this = pair->first.rep(); } else { // the intersections must be a point const std::pair* pair= boost::get >(&sols[less_xyz?0:1]); - CGAL_kernel_precondition(pair!=NULL); + CGAL_kernel_precondition(pair!=nullptr); *this = pair->first.rep(); } } @@ -137,13 +137,13 @@ public: // the intersection must be a point const std::pair* pair= boost::get >(&sols[0]); - CGAL_kernel_precondition(pair!=NULL); + CGAL_kernel_precondition(pair!=nullptr); *this = pair->first.rep(); } else { // the intersections must be a point const std::pair* pair= boost::get >(&sols[less_xyz?0:1]); - CGAL_kernel_precondition(pair!=NULL); + CGAL_kernel_precondition(pair!=nullptr); *this = pair->first.rep(); } } @@ -159,13 +159,13 @@ public: // the intersection must be a point const std::pair* pair= boost::get >(&sols[0]); - CGAL_kernel_precondition(pair!=NULL); + CGAL_kernel_precondition(pair!=nullptr); *this = pair->first.rep(); } else { // the intersections must be a point const std::pair* pair= boost::get >(&sols[less_xyz?0:1]); - CGAL_kernel_precondition(pair!=NULL); + CGAL_kernel_precondition(pair!=nullptr); *this = pair->first.rep(); } } @@ -181,13 +181,13 @@ public: // the intersection must be a point const std::pair* pair= boost::get >(&sols[0]); - CGAL_kernel_precondition(pair!=NULL); + CGAL_kernel_precondition(pair!=nullptr); *this = pair->first.rep(); } else { // the intersections must be a point const std::pair* pair= boost::get >(&sols[less_xyz?0:1]); - CGAL_kernel_precondition(pair!=NULL); + CGAL_kernel_precondition(pair!=nullptr); *this = pair->first.rep(); } } @@ -203,13 +203,13 @@ public: // the intersection must be a point const std::pair* pair= boost::get >(&sols[0]); - CGAL_kernel_precondition(pair!=NULL); + CGAL_kernel_precondition(pair!=nullptr); *this = pair->first.rep(); } else { // the intersections must be a point const std::pair* pair= boost::get >(&sols[less_xyz?0:1]); - CGAL_kernel_precondition(pair!=NULL); + CGAL_kernel_precondition(pair!=nullptr); *this = pair->first.rep(); } } diff --git a/Circular_kernel_3/include/CGAL/Circular_kernel_3/Line_arc_3.h b/Circular_kernel_3/include/CGAL/Circular_kernel_3/Line_arc_3.h index 62624fe565b..7d431bc5c1c 100644 --- a/Circular_kernel_3/include/CGAL/Circular_kernel_3/Line_arc_3.h +++ b/Circular_kernel_3/include/CGAL/Circular_kernel_3/Line_arc_3.h @@ -145,8 +145,8 @@ namespace CGAL { Intersection i2 = SK().intersect_3_object()(l, p2); const typename SK::Point_3* point1=boost::get( & *i1 ); const typename SK::Point_3* point2=boost::get( & *i2 ); - CGAL_assertion(point1!=NULL); - CGAL_assertion(point2!=NULL); + CGAL_assertion(point1!=nullptr); + CGAL_assertion(point2!=nullptr); // the source and target must be different CGAL_kernel_precondition(*point1 != *point2); *this = Line_arc_3(l, *point1, *point2); diff --git a/Circular_kernel_3/include/CGAL/Circular_kernel_3/internal_functions_on_circle_3.h b/Circular_kernel_3/include/CGAL/Circular_kernel_3/internal_functions_on_circle_3.h index 295877da4e6..aca3a38617a 100644 --- a/Circular_kernel_3/include/CGAL/Circular_kernel_3/internal_functions_on_circle_3.h +++ b/Circular_kernel_3/include/CGAL/Circular_kernel_3/internal_functions_on_circle_3.h @@ -129,11 +129,11 @@ namespace CGAL { intersect_3(circle,plane,std::back_inserter(inters)); CGAL_kernel_precondition(inters.size()==2); - const std::pair* pt[2]={NULL,NULL}; + const std::pair* pt[2]={nullptr,nullptr}; pt[0]=CGAL::Intersections::internal::intersect_get >(inters[0]); pt[1]=CGAL::Intersections::internal::intersect_get >(inters[1]); - CGAL_kernel_precondition(pt[0]!=NULL); - CGAL_kernel_precondition(pt[1]!=NULL); + CGAL_kernel_precondition(pt[0]!=nullptr); + CGAL_kernel_precondition(pt[1]!=nullptr); if ( compare_theta_of_pts(pt[0]->first,pt[1]->first,sphere) == SMALLER){ *out_it++=pt[0]->first; diff --git a/Circular_kernel_3/include/CGAL/Circular_kernel_3/internal_functions_on_circular_arc_3.h b/Circular_kernel_3/include/CGAL/Circular_kernel_3/internal_functions_on_circular_arc_3.h index 5ec837de728..29a73543e6c 100644 --- a/Circular_kernel_3/include/CGAL/Circular_kernel_3/internal_functions_on_circular_arc_3.h +++ b/Circular_kernel_3/include/CGAL/Circular_kernel_3/internal_functions_on_circular_arc_3.h @@ -480,11 +480,11 @@ namespace CGAL { //one endpoint is extremal: just split the arc if (nb_extrem==1){ - const std::pair* pt[2]={NULL,NULL}; + const std::pair* pt[2]={nullptr,nullptr}; pt[0]=CGAL::Intersections::internal::intersect_get >(inters[0]); pt[1]=CGAL::Intersections::internal::intersect_get >(inters[1]); - CGAL_kernel_precondition(pt[0]!=NULL); - CGAL_kernel_precondition(pt[1]!=NULL); + CGAL_kernel_precondition(pt[0]!=nullptr); + CGAL_kernel_precondition(pt[1]!=nullptr); const typename SK::Circular_arc_point_3& midpt=(arc.source()==pt[0]->first || arc.target()==pt[0]->first)?pt[1]->first:pt[0]->first; *out_it++=typename SK::Circular_arc_3(arc.supporting_circle(),arc.source(),midpt); *out_it++=typename SK::Circular_arc_3(arc.supporting_circle(),midpt,arc.target()); @@ -495,20 +495,20 @@ namespace CGAL { //only one intersection points if (inters.size()==1){ - const std::pair* midpt=NULL; + const std::pair* midpt=nullptr; midpt=CGAL::Intersections::internal::intersect_get >(inters[0]); - CGAL_kernel_precondition(midpt!=NULL); + CGAL_kernel_precondition(midpt!=nullptr); *out_it++=typename SK::Circular_arc_3(arc.supporting_circle(),arc.source(),midpt->first); *out_it++=typename SK::Circular_arc_3(arc.supporting_circle(),midpt->first,arc.target()); break; } //three arcs are defined by two intersection points - const std::pair* pt[2]={NULL,NULL}; + const std::pair* pt[2]={nullptr,nullptr}; pt[0]=CGAL::Intersections::internal::intersect_get >(inters[0]); pt[1]=CGAL::Intersections::internal::intersect_get >(inters[1]); - CGAL_kernel_precondition(pt[0]!=NULL); - CGAL_kernel_precondition(pt[1]!=NULL); + CGAL_kernel_precondition(pt[0]!=nullptr); + CGAL_kernel_precondition(pt[1]!=nullptr); typename SK::Circular_arc_3 arc1=typename SK::Circular_arc_3(arc.supporting_circle(),arc.source(),pt[0]->first); typename SK::Circular_arc_3 arc2=typename SK::Circular_arc_3(arc.supporting_circle(),pt[0]->first,arc.target()); diff --git a/Circulator/doc/Circulator/CGAL/circulator.h b/Circulator/doc/Circulator/CGAL/circulator.h index 7a8cb8551ba..1511b255fc7 100644 --- a/Circulator/doc/Circulator/CGAL/circulator.h +++ b/Circulator/doc/Circulator/CGAL/circulator.h @@ -543,7 +543,7 @@ is `true` if the range `[i, j)` is empty, `false` otherwise. In order to write algorithms that work with iterator ranges as well as with circulator ranges we have to consider the difference of representing an empty range. For iterators this is the range `[i,i)`, -while for circulators it would be `c == NULL`, the empty sequence test. +while for circulators it would be `c == nullptr`, the empty sequence test. The function `is_empty_range()` provides the necessary generic test which accepts an iterator range or a circulator range and says whether the range is empty or not. @@ -640,7 +640,7 @@ Circulator_tag query_circulator_or_iterator( const C& c); In order to write algorithms that work with iterator ranges as well as with circulator ranges we have to consider the difference of representing an empty range. For iterators this is the range `[i,i)`, -while for circulators it would be `c == NULL`, the empty sequence test. +while for circulators it would be `c == nullptr`, the empty sequence test. The function `is_empty_range()` provides the necessary generic test which accepts an iterator range or a circulator range and says whether the range is empty or not. diff --git a/Circulator/doc/Circulator/Circulator.txt b/Circulator/doc/Circulator/Circulator.txt index 7c84203be63..5688bcf400e 100644 --- a/Circulator/doc/Circulator/Circulator.txt +++ b/Circulator/doc/Circulator/Circulator.txt @@ -94,9 +94,9 @@ range definition as for iterators. The difference lies in the use of an iterator `i` the range `[i,i)` denotes the empty range. As long as `c != d` the range `[c,d)` behaves like an iterator range and could be used in \stl algorithms. For circulators however, -an additional test `c == NULL` is required that returns true if +an additional test `c == nullptr` is required that returns true if and only if the circular sequence is empty. As for -\cpp, we recommend the use of 0 instead of `NULL`. +\cpp, we recommend the use of 0 instead of `nullptr`. Besides the conceptual cleanness, the main reason for inventing a new concept with a similar intent as iterators is efficiency. An iterator diff --git a/Circulator/doc/Circulator/Concepts/Circulator.h b/Circulator/doc/Circulator/Concepts/Circulator.h index ea46df78ae5..c5f183b0582 100644 --- a/Circulator/doc/Circulator/Concepts/Circulator.h +++ b/Circulator/doc/Circulator/Concepts/Circulator.h @@ -22,9 +22,9 @@ differs from the semantic of an iterator range. For a circulator `c` the range `[c, c)` denotes the sequence of all elements in the data structure. For iterators, this range defines the empty sequence. A separate test for an empty sequence has been added -to the circulator requirements: A comparison `c == NULL` +to the circulator requirements: A comparison `c == nullptr` for a circulator `c` is true for an empty sequence. As for \cpp, -we recommend the use of 0 instead of `NULL`. +we recommend the use of 0 instead of `nullptr`. \subsection circulatorConceptsCirculators Circulators Similar to \stl iterators, we distinguish between forward, @@ -44,7 +44,7 @@ anyway, there is no need to allow singular values for them. An un-initalized circulator does not have a singular value, but is supposed to refer to an empty sequence.} -Empty sequence: The comparison `c == NULL` (or `c == 0`) +Empty sequence: The comparison `c == nullptr` (or `c == 0`) for a circulator `c` is `true` if `c` denotes an empty sequence, and `false` otherwise. @@ -109,36 +109,36 @@ In the following, we assume that a and b are circulators of type C, r is of type C& (is assignable), and T denotes the value type of C. Let D be the distance type of C. As for \cpp, we -recommend the use of 0 instead of NULL. +recommend the use of 0 instead of nullptr. ::AABB_tree_with_join(const Tr& traits) : m_traits(traits) , m_primitives() - , m_p_root_node(NULL) - , m_p_search_tree(NULL) + , m_p_root_node(nullptr) + , m_p_search_tree(nullptr) , m_search_tree_constructed(false) , m_default_search_tree_constructed(false) , m_need_build(false) @@ -568,8 +568,8 @@ public: T ... t) : m_traits() , m_primitives() - , m_p_root_node(NULL) - , m_p_search_tree(NULL) + , m_p_root_node(nullptr) + , m_p_search_tree(nullptr) , m_search_tree_constructed(false) , m_default_search_tree_constructed(false) , m_need_build(false) @@ -626,10 +626,10 @@ public: // allocates tree nodes m_p_root_node = new Node[m_primitives.size()-1](); - if(m_p_root_node == NULL) + if(m_p_root_node == nullptr) { std::cerr << "Unable to allocate memory for AABB tree" << std::endl; - CGAL_assertion(m_p_root_node != NULL); + CGAL_assertion(m_p_root_node != nullptr); m_primitives.clear(); clear(); } @@ -657,7 +657,7 @@ public: ConstPointIterator beyond) const { m_p_search_tree = new Search_tree(first, beyond); - if(m_p_search_tree != NULL) + if(m_p_search_tree != nullptr) { m_search_tree_constructed = true; return true; diff --git a/Minkowski_sum_2/include/CGAL/Minkowski_sum_2/Arr_labeled_traits_2.h b/Minkowski_sum_2/include/CGAL/Minkowski_sum_2/Arr_labeled_traits_2.h index 519f74ffdbc..5a393db45a9 100644 --- a/Minkowski_sum_2/include/CGAL/Minkowski_sum_2/Arr_labeled_traits_2.h +++ b/Minkowski_sum_2/include/CGAL/Minkowski_sum_2/Arr_labeled_traits_2.h @@ -388,7 +388,7 @@ public: base_pt = object_cast > (&(*obj_it)); - if (base_pt != NULL) + if (base_pt != nullptr) { // Attach an invalid label to an itersection point. *oi = CGAL::make_object @@ -398,7 +398,7 @@ public: else { base_xcv = object_cast (&(*obj_it)); - CGAL_assertion (base_xcv != NULL); + CGAL_assertion (base_xcv != nullptr); // Attach a merged label to the overlapping curve. *oi = CGAL::make_object diff --git a/Minkowski_sum_2/include/CGAL/Minkowski_sum_2/Decomposition_strategy_adapter.h b/Minkowski_sum_2/include/CGAL/Minkowski_sum_2/Decomposition_strategy_adapter.h index dc0968edb6f..96ff864cf40 100644 --- a/Minkowski_sum_2/include/CGAL/Minkowski_sum_2/Decomposition_strategy_adapter.h +++ b/Minkowski_sum_2/include/CGAL/Minkowski_sum_2/Decomposition_strategy_adapter.h @@ -62,7 +62,7 @@ protected: public: /*! Default constructor. */ Polygon_decomposition_strategy_adapter() : - m_traits(NULL), + m_traits(nullptr), m_own_traits(false) { init(); } @@ -76,9 +76,9 @@ public: ~Polygon_decomposition_strategy_adapter() { if (m_own_traits) { - if (m_traits != NULL) { + if (m_traits != nullptr) { delete m_traits; - m_traits = NULL; + m_traits = nullptr; } m_own_traits = false; } @@ -88,7 +88,7 @@ public: void init() { // Allocate the traits if not provided. - if (m_traits == NULL) { + if (m_traits == nullptr) { m_traits = new Traits_2; m_own_traits = true; } diff --git a/Minkowski_sum_2/include/CGAL/Minkowski_sum_2/Minkowski_sum_conv_2.h b/Minkowski_sum_2/include/CGAL/Minkowski_sum_2/Minkowski_sum_conv_2.h index ce2513a81e4..e320760440f 100644 --- a/Minkowski_sum_2/include/CGAL/Minkowski_sum_2/Minkowski_sum_conv_2.h +++ b/Minkowski_sum_2/include/CGAL/Minkowski_sum_2/Minkowski_sum_conv_2.h @@ -142,9 +142,9 @@ public: ~Minkowski_sum_by_convolution_2() { if (m_own_kernel) { - if (m_kernel != NULL) { + if (m_kernel != nullptr) { delete m_kernel; - m_kernel = NULL; + m_kernel = nullptr; } m_own_kernel = false; } diff --git a/Minkowski_sum_2/include/CGAL/Minkowski_sum_2/Minkowski_sum_decomp_2.h b/Minkowski_sum_2/include/CGAL/Minkowski_sum_2/Minkowski_sum_decomp_2.h index 4f8be099f63..c51bddb0c89 100644 --- a/Minkowski_sum_2/include/CGAL/Minkowski_sum_2/Minkowski_sum_decomp_2.h +++ b/Minkowski_sum_2/include/CGAL/Minkowski_sum_2/Minkowski_sum_decomp_2.h @@ -101,11 +101,11 @@ private: public: //! Default constructor. Minkowski_sum_by_decomposition_2() : - m_decomposition_strategy1(NULL), - m_decomposition_strategy2(NULL), + m_decomposition_strategy1(nullptr), + m_decomposition_strategy2(nullptr), m_own_strategy1(false), m_own_strategy2(false), - m_traits(NULL), + m_traits(nullptr), m_own_traits(false) { init(); } @@ -128,14 +128,14 @@ public: m_decomposition_strategy2(&strategy2), m_own_strategy1(false), m_own_strategy2(false), - m_traits(NULL), + m_traits(nullptr), m_own_traits(false) { init(); } //! Constructor. Minkowski_sum_by_decomposition_2(const Traits_2& traits) : - m_decomposition_strategy1(NULL), - m_decomposition_strategy2(NULL), + m_decomposition_strategy1(nullptr), + m_decomposition_strategy2(nullptr), m_own_strategy1(false), m_own_strategy2(false), m_traits(&traits), @@ -146,25 +146,25 @@ public: ~Minkowski_sum_by_decomposition_2() { if (m_own_traits) { - if (m_traits != NULL) { + if (m_traits != nullptr) { delete m_traits; - m_traits = NULL; + m_traits = nullptr; } m_own_traits = false; } if (m_own_strategy1) { - if (m_decomposition_strategy1 != NULL) { + if (m_decomposition_strategy1 != nullptr) { delete m_decomposition_strategy1; - m_decomposition_strategy1 = NULL; + m_decomposition_strategy1 = nullptr; } m_own_strategy1 = false; } if (m_own_strategy2) { - if (m_decomposition_strategy2 != NULL) { + if (m_decomposition_strategy2 != nullptr) { delete m_decomposition_strategy2; - m_decomposition_strategy2 = NULL; + m_decomposition_strategy2 = nullptr; } m_own_strategy2 = false; } @@ -174,16 +174,16 @@ public: void init() { // Allocate the traits if not provided. - if (m_traits == NULL) { + if (m_traits == nullptr) { m_traits = new Traits_2; m_own_traits = true; } // Allocate the strategy if not provided. - if (m_decomposition_strategy1 == NULL) { + if (m_decomposition_strategy1 == nullptr) { m_decomposition_strategy1 = new Decomposition_strategy1; m_own_strategy1 = true; } - if (m_decomposition_strategy2 == NULL) { + if (m_decomposition_strategy2 == nullptr) { m_decomposition_strategy2 = new Decomposition_strategy2; m_own_strategy2 = true; } diff --git a/Minkowski_sum_2/include/CGAL/Polygon_vertical_decomposition_2.h b/Minkowski_sum_2/include/CGAL/Polygon_vertical_decomposition_2.h index 61d04b20d57..fc10cfc9e2d 100644 --- a/Minkowski_sum_2/include/CGAL/Polygon_vertical_decomposition_2.h +++ b/Minkowski_sum_2/include/CGAL/Polygon_vertical_decomposition_2.h @@ -111,7 +111,7 @@ private: public: /*! Default constructor. */ Polygon_vertical_decomposition_2() : - m_traits(NULL), + m_traits(nullptr), m_own_traits(false) { init(); } @@ -125,7 +125,7 @@ public: void init() { // Allocate the traits if not provided. - if (m_traits == NULL) { + if (m_traits == nullptr) { m_traits = new Traits_2; m_own_traits = true; } @@ -143,7 +143,7 @@ public: if (m_own_traits) { if (m_traits) { delete m_traits; - m_traits = NULL; + m_traits = nullptr; } m_own_traits = false; } diff --git a/Minkowski_sum_2/include/CGAL/Small_side_angle_bisector_decomposition_2.h b/Minkowski_sum_2/include/CGAL/Small_side_angle_bisector_decomposition_2.h index 1d84adca135..734497f2db8 100644 --- a/Minkowski_sum_2/include/CGAL/Small_side_angle_bisector_decomposition_2.h +++ b/Minkowski_sum_2/include/CGAL/Small_side_angle_bisector_decomposition_2.h @@ -131,9 +131,9 @@ public: ~Small_side_angle_bisector_decomposition_2() { if (m_own_kernel) { - if (m_kernel != NULL) { + if (m_kernel != nullptr) { delete m_kernel; - m_kernel = NULL; + m_kernel = nullptr; } m_own_kernel = false; } diff --git a/Minkowski_sum_3/include/CGAL/Minkowski_sum_3/Gaussian_map.h b/Minkowski_sum_3/include/CGAL/Minkowski_sum_3/Gaussian_map.h index 119b5d9dc76..2152c7b9240 100644 --- a/Minkowski_sum_3/include/CGAL/Minkowski_sum_3/Gaussian_map.h +++ b/Minkowski_sum_3/include/CGAL/Minkowski_sum_3/Gaussian_map.h @@ -1022,7 +1022,7 @@ class Gaussian_map : CGAL_NEF_TRACEN("simplify"); typedef typename CGAL::Union_find::handle Union_find_handle; - CGAL::Unique_hash_map< SFace_handle, Union_find_handle> Pitem(NULL); + CGAL::Unique_hash_map< SFace_handle, Union_find_handle> Pitem(nullptr); CGAL::Union_find< SFace_handle> UF; SFace_iterator f; diff --git a/Nef_2/include/CGAL/Nef_2/PM_point_locator.h b/Nef_2/include/CGAL/Nef_2/PM_point_locator.h index 33d33e12047..0b696b7589b 100644 --- a/Nef_2/include/CGAL/Nef_2/PM_point_locator.h +++ b/Nef_2/include/CGAL/Nef_2/PM_point_locator.h @@ -302,7 +302,7 @@ public: |bool operator() (const Vertex_/Halfedge_/Face_const_handle&)|.\\ The object returned is intersected by the segment |s| and has minimal distance to |s.source()| and |M(h)| holds on the converted - object. The operation returns the null handle |NULL| if the ray shoot + object. The operation returns the null handle |nullptr| if the ray shoot along |s| does not hit any object |h| of |P| with |M(h)|.}*/ { CGAL_NEF_TRACEN("naive ray_shoot "< { { // CGAL_NEF_SETDTHREAD(23); CGAL_assertion( this->sncp()->is_empty()); - CGAL_assertion( pl1 != NULL && pl2 != NULL); + CGAL_assertion( pl1 != nullptr && pl2 != nullptr); // CGAL_NEF_SETDTHREAD(19*13*43*37); #ifdef CGAL_NEF3_TIMER_BINARY_OPERATION diff --git a/Nef_3/include/CGAL/Nef_3/Halfedge.h b/Nef_3/include/CGAL/Nef_3/Halfedge.h index c972929d25f..5bb8219efb7 100644 --- a/Nef_3/include/CGAL/Nef_3/Halfedge.h +++ b/Nef_3/include/CGAL/Nef_3/Halfedge.h @@ -159,16 +159,16 @@ class Halfedge_base verr << "begin CGAL::SNC_items<...>::Halfedge_base::is_valid( verb=true, " "level = " << level << "):" << std::endl; - bool valid = (center_vertex_ != NULL && center_vertex_ != Vertex_handle()); - valid = valid && (twin_ != NULL && twin_ != SVertex_handle() && + bool valid = (center_vertex_ != nullptr && center_vertex_ != Vertex_handle()); + valid = valid && (twin_ != nullptr && twin_ != SVertex_handle() && twin_ != SVertex_handle()); - // valid = valid && (out_sedge_ != NULL); + // valid = valid && (out_sedge_ != nullptr); // valid = valid && (incident_sface_ != SFace_handle()); - // valid = valid &&((out_sedge_ != NULL && incident_sface_ == NULL) || - // (out_sedge_ == NULL && incident_sface_ != NULL)); + // valid = valid &&((out_sedge_ != nullptr && incident_sface_ == nullptr) || + // (out_sedge_ == nullptr && incident_sface_ != nullptr)); - valid = valid && (out_sedge_ != NULL || incident_sface_ != NULL); + valid = valid && (out_sedge_ != nullptr || incident_sface_ != nullptr); verr << "end of CGAL::SNC_items<...>::Halfedge_base::is_valid(): structure is " << ( valid ? "valid." : "NOT VALID.") << std::endl; diff --git a/Nef_3/include/CGAL/Nef_3/Halffacet.h b/Nef_3/include/CGAL/Nef_3/Halffacet.h index 14a31b788fc..2324b8e9e8b 100644 --- a/Nef_3/include/CGAL/Nef_3/Halffacet.h +++ b/Nef_3/include/CGAL/Nef_3/Halffacet.h @@ -123,8 +123,8 @@ class Halffacet_base { verr << "begin CGAL::SNC_items<...>::Halffacet_base::is_valid( verb=true, " "level = " << level << "):" << std::endl; - bool valid = (twin_ != NULL && twin_ != Halffacet_handle()); - valid = valid && (volume_ != NULL && volume_ != Volume_handle()); + bool valid = (twin_ != nullptr && twin_ != Halffacet_handle()); + valid = valid && (volume_ != nullptr && volume_ != Volume_handle()); valid = valid && (supporting_plane_.a() != 0 || supporting_plane_.b() != 0 || diff --git a/Nef_3/include/CGAL/Nef_3/K3_tree.h b/Nef_3/include/CGAL/Nef_3/K3_tree.h index aa8515f7a3f..bf211011575 100644 --- a/Nef_3/include/CGAL/Nef_3/K3_tree.h +++ b/Nef_3/include/CGAL/Nef_3/K3_tree.h @@ -589,7 +589,7 @@ else { inline const Node* get_child_by_side( const Node* node, Oriented_side side) { - CGAL_assertion( node != NULL); + CGAL_assertion( node != nullptr); CGAL_assertion( side != ON_ORIENTED_BOUNDARY); if( side == ON_NEGATIVE_SIDE) { return node->left(); @@ -756,7 +756,7 @@ class Objects_around_box { inline const Node* get_child_by_side( const Node* node, Oriented_side side) { - CGAL_assertion( node != NULL); + CGAL_assertion( node != nullptr); CGAL_assertion( side != ON_ORIENTED_BOUNDARY); if( side == ON_NEGATIVE_SIDE) { return node->left(); @@ -787,7 +787,7 @@ public: typedef typename SNC_structure::Halfedge_iterator Halfedge_iterator; typedef typename SNC_structure::Halffacet_iterator Halffacet_iterator; - CGAL_assertion( W != NULL); + CGAL_assertion( W != nullptr); Object_list objects; Vertex_iterator v; Halfedge_iterator e; diff --git a/Nef_3/include/CGAL/Nef_3/SFace.h b/Nef_3/include/CGAL/Nef_3/SFace.h index 6e520f1ad3d..bac2725b7ef 100644 --- a/Nef_3/include/CGAL/Nef_3/SFace.h +++ b/Nef_3/include/CGAL/Nef_3/SFace.h @@ -125,9 +125,9 @@ class SFace_base { verr << "begin CGAL::SNC_items<...>::SFace_base::is_valid( verb=true, " "level = " << level << "):" << std::endl; - bool valid =(center_vertex_ != Vertex_handle() && center_vertex_ != NULL); + bool valid =(center_vertex_ != Vertex_handle() && center_vertex_ != nullptr); valid = valid && (volume_ != Volume_handle() && - volume_ != NULL); + volume_ != nullptr); if(boundary_entry_objects_.empty()) { valid = valid && diff --git a/Nef_3/include/CGAL/Nef_3/SHalfedge.h b/Nef_3/include/CGAL/Nef_3/SHalfedge.h index b09aa9d7d33..cfed190aa20 100644 --- a/Nef_3/include/CGAL/Nef_3/SHalfedge.h +++ b/Nef_3/include/CGAL/Nef_3/SHalfedge.h @@ -228,18 +228,18 @@ class SHalfedge_base { "level = " << level << "):" << std::endl; bool valid = (source_ != SVertex_handle() && - source_ != NULL && + source_ != nullptr && source_ != Halfedge_handle()); - valid = valid && (twin_ != SHalfedge_handle() && twin_ != NULL); - valid = valid && (sprev_ != SHalfedge_handle() && sprev_ != NULL); - valid = valid && (snext_ != SHalfedge_handle() && snext_ != NULL); - valid = valid && (prev_ != SHalfedge_handle() && prev_ != NULL); - valid = valid && (next_ != SHalfedge_handle() && next_ != NULL); + valid = valid && (twin_ != SHalfedge_handle() && twin_ != nullptr); + valid = valid && (sprev_ != SHalfedge_handle() && sprev_ != nullptr); + valid = valid && (snext_ != SHalfedge_handle() && snext_ != nullptr); + valid = valid && (prev_ != SHalfedge_handle() && prev_ != nullptr); + valid = valid && (next_ != SHalfedge_handle() && next_ != nullptr); valid = valid && (incident_sface_ != SFace_handle() && - incident_sface_ != NULL); + incident_sface_ != nullptr); valid = valid && (facet_ != Halffacet_handle() && - facet_ != NULL); + facet_ != nullptr); valid = valid && (circle_.d() == 0); valid = valid && (circle_.a() != 0 || circle_.b() != 0 || circle_.c() !=0); diff --git a/Nef_3/include/CGAL/Nef_3/SHalfloop.h b/Nef_3/include/CGAL/Nef_3/SHalfloop.h index 2cc59acffb3..d0aadb30abb 100644 --- a/Nef_3/include/CGAL/Nef_3/SHalfloop.h +++ b/Nef_3/include/CGAL/Nef_3/SHalfloop.h @@ -115,11 +115,11 @@ class SHalfloop_base { verr << "begin CGAL::SNC_items<...>::SHalfloop_base::is_valid( verb=true, " "level = " << level << "):" << std::endl; - bool valid = (twin_ != SHalfloop_handle() && twin_ != NULL); + bool valid = (twin_ != SHalfloop_handle() && twin_ != nullptr); valid = valid && (incident_sface_ != SFace_handle() && - incident_sface_ != NULL); + incident_sface_ != nullptr); valid = valid && (facet_ != Halffacet_handle() && - facet_ != NULL); + facet_ != nullptr); valid = valid && (circle_.d() == 0); valid = valid && (circle_.a() != 0 || circle_.b() != 0 || circle_.c() !=0); diff --git a/Nef_3/include/CGAL/Nef_3/SNC_SM_overlayer.h b/Nef_3/include/CGAL/Nef_3/SNC_SM_overlayer.h index ae78a1da0b1..ee8422af596 100644 --- a/Nef_3/include/CGAL/Nef_3/SNC_SM_overlayer.h +++ b/Nef_3/include/CGAL/Nef_3/SNC_SM_overlayer.h @@ -100,8 +100,8 @@ public: CGAL_NEF_TRACEN("simplifying"); typedef typename CGAL::Union_find::handle Union_find_handle; - CGAL::Unique_hash_map< SFace_handle, Union_find_handle> Pitem(NULL); - CGAL::Unique_hash_map< SVertex_handle, Union_find_handle> Vitem(NULL); + CGAL::Unique_hash_map< SFace_handle, Union_find_handle> Pitem(nullptr); + CGAL::Unique_hash_map< SVertex_handle, Union_find_handle> Vitem(nullptr); CGAL::Union_find< SFace_handle> UF; SFace_iterator f; @@ -164,7 +164,7 @@ public: for(v = this->svertices_begin(); v != this->svertices_end(); v=vn) { vn=v; ++vn; if ( is_isolated(v) ) { - if(Vitem[v] != NULL) { + if(Vitem[v] != nullptr) { set_face(v,*(UF.find(Vitem[v]))); CGAL_NEF_TRACEN("incident face of " << PH(v) << " set to " << &*(v->incident_sface())); } @@ -367,8 +367,8 @@ class SNC_SM_overlayer CGAL_NEF_TRACEN("simplifying"); typedef typename CGAL::Union_find::handle Union_find_handle; - CGAL::Unique_hash_map< SFace_handle, Union_find_handle> Pitem(NULL); - CGAL::Unique_hash_map< SVertex_handle, Union_find_handle> Vitem(NULL); + CGAL::Unique_hash_map< SFace_handle, Union_find_handle> Pitem(nullptr); + CGAL::Unique_hash_map< SVertex_handle, Union_find_handle> Vitem(nullptr); CGAL::Union_find< SFace_handle> UF; SFace_iterator f; @@ -431,7 +431,7 @@ class SNC_SM_overlayer for(v = this->svertices_begin(); v != this->svertices_end(); v=vn) { vn=v; ++vn; if ( is_isolated(v) ) { - if(Vitem[v] != NULL) { + if(Vitem[v] != nullptr) { set_face(v,*(UF.find(Vitem[v]))); CGAL_NEF_TRACEN("incident face of " << PH(v) << " set to " << &*(v->incident_sface())); } diff --git a/Nef_3/include/CGAL/Nef_3/SNC_decorator.h b/Nef_3/include/CGAL/Nef_3/SNC_decorator.h index a27684200c2..74ee8cfaeee 100644 --- a/Nef_3/include/CGAL/Nef_3/SNC_decorator.h +++ b/Nef_3/include/CGAL/Nef_3/SNC_decorator.h @@ -176,7 +176,7 @@ class SNC_decorator : public SNC_const_decorator { : Base(*(S.sncp_)), sncp_(S.sncp_) {} SNC_structure* sncp() const { - CGAL_assertion( sncp_ != NULL); + CGAL_assertion( sncp_ != nullptr); return sncp_; } @@ -705,7 +705,7 @@ class SNC_decorator : public SNC_const_decorator { SM_decorator S2(&*he->twin()->source()); SHalfedge_handle se1(S1.first_out_edge(he)); SHalfedge_handle se2(S2.first_out_edge(he->twin())); - if(se1 != NULL && se2 != NULL) { + if(se1 != nullptr && se2 != nullptr) { SHalfedge_handle start1(se1); SHalfedge_handle start2(se2->twin()->snext()); while(se1->facet() != se2->twin()->facet() && se2 != start2) @@ -777,7 +777,7 @@ class SNC_decorator : public SNC_const_decorator { CGAL_forall_shells_of(si,voli) { // valid = valid && (si != Shell_entry_iterator() && valid = valid && (SFace_handle(si) != SFace_handle() && - SFace_handle(si) != NULL); + SFace_handle(si) != nullptr); valid = valid && (++count <= max); } valid = valid && (++count <= max); diff --git a/Nef_3/include/CGAL/Nef_3/SNC_external_structure.h b/Nef_3/include/CGAL/Nef_3/SNC_external_structure.h index 9df9f44c0c6..b64a2610f33 100644 --- a/Nef_3/include/CGAL/Nef_3/SNC_external_structure.h +++ b/Nef_3/include/CGAL/Nef_3/SNC_external_structure.h @@ -319,7 +319,7 @@ public: } }; - SNC_external_structure_base( SNC_structure& W, SNC_point_locator* spl = NULL) + SNC_external_structure_base( SNC_structure& W, SNC_point_locator* spl = nullptr) : SNC_decorator(W), pl(spl) {} /*{\Mcreate makes |\Mvar| a decorator of |W|.}*/ @@ -843,7 +843,7 @@ public: Closed[ShellF[hf->twin()]] = true; } - CGAL_assertion( pl != NULL); + CGAL_assertion( pl != nullptr); #ifdef CGAL_NEF3_TIMER_INITIALIZE_KDTREE CGAL::Timer timer_initialize_kdtree; @@ -1080,7 +1080,7 @@ class SNC_external_structure : public SNC_external_structure_base SNC_point_locator; public: - SNC_external_structure( SNC_structure_& W, SNC_point_locator* spl = NULL) + SNC_external_structure( SNC_structure_& W, SNC_point_locator* spl = nullptr) : SNC_external_structure_base(W, spl) {} }; @@ -1124,7 +1124,7 @@ public: using Base::link_as_inner_shell; - SNC_external_structure( SNC_structure& W, SNC_point_locator* spl = NULL) + SNC_external_structure( SNC_structure& W, SNC_point_locator* spl = nullptr) : Base(W, spl) {} /*{\Mcreate makes |\Mvar| a decorator of |W|.}*/ diff --git a/Nef_3/include/CGAL/Nef_3/SNC_point_locator.h b/Nef_3/include/CGAL/Nef_3/SNC_point_locator.h index f97586698b4..3babbc24689 100644 --- a/Nef_3/include/CGAL/Nef_3/SNC_point_locator.h +++ b/Nef_3/include/CGAL/Nef_3/SNC_point_locator.h @@ -314,7 +314,7 @@ public: #else CGAL_NEF_CLOG(version()); #endif - CGAL_assertion( W != NULL); + CGAL_assertion( W != nullptr); // (Base) *this = SNC_decorator(*W); this->set_snc(*W); Object_list objects; @@ -1277,7 +1277,7 @@ public: CGAL_NEF_TIMER(ct_t.start()); this->version_ = std::string("Naive Point Locator (tm)"); CGAL_NEF_CLOG(version()); - CGAL_assertion( W != NULL); + CGAL_assertion( W != nullptr); Base::initialize(W); initialized = true; CGAL_NEF_TIMER(ct_t.stop()); diff --git a/Nef_3/include/CGAL/Nef_3/Vertex.h b/Nef_3/include/CGAL/Nef_3/Vertex.h index ad607a015e9..cb6091af1ce 100644 --- a/Nef_3/include/CGAL/Nef_3/Vertex.h +++ b/Nef_3/include/CGAL/Nef_3/Vertex.h @@ -343,14 +343,14 @@ class Vertex_base { verr << "begin CGAL::SNC_items<...>::Vertex_base::is_valid( verb=true, " "level = " << level << "):" << std::endl; - bool valid = (sncp_ != NULL); - valid = valid && (svertices_begin_ != NULL && svertices_begin_ != SVertex_iterator()); - valid = valid && (svertices_last_ != NULL && svertices_last_ != SVertex_iterator()); - valid = valid && (shalfedges_begin_ != NULL && shalfedges_begin_ != SHalfedge_iterator()); - valid = valid && (shalfedges_last_ != NULL && shalfedges_last_ != SHalfedge_iterator()); - valid = valid && (sfaces_begin_ != NULL && sfaces_begin_ != SFace_iterator()); - valid = valid && (sfaces_last_ != NULL && sfaces_last_ != SFace_iterator()); - valid = valid && (shalfloop_ != NULL && shalfloop_ != SHalfloop_iterator()); + bool valid = (sncp_ != nullptr); + valid = valid && (svertices_begin_ != nullptr && svertices_begin_ != SVertex_iterator()); + valid = valid && (svertices_last_ != nullptr && svertices_last_ != SVertex_iterator()); + valid = valid && (shalfedges_begin_ != nullptr && shalfedges_begin_ != SHalfedge_iterator()); + valid = valid && (shalfedges_last_ != nullptr && shalfedges_last_ != SHalfedge_iterator()); + valid = valid && (sfaces_begin_ != nullptr && sfaces_begin_ != SFace_iterator()); + valid = valid && (sfaces_last_ != nullptr && sfaces_last_ != SFace_iterator()); + valid = valid && (shalfloop_ != nullptr && shalfloop_ != SHalfloop_iterator()); if(shalfedges_begin_ == sncp()->shalfedges_end()) { // point in volume or on plane, which is either isolated or has one outgoing edge if(shalfloop_ != sncp()->shalfloops_end()) diff --git a/Nef_3/include/CGAL/Nef_polyhedron_3.h b/Nef_3/include/CGAL/Nef_polyhedron_3.h index 2ec57194bc1..edad2a9a178 100644 --- a/Nef_3/include/CGAL/Nef_polyhedron_3.h +++ b/Nef_3/include/CGAL/Nef_polyhedron_3.h @@ -637,7 +637,7 @@ protected: const FaceIndexMap& fim, typename boost::disable_if < boost::is_same - >::type* = NULL // disambiguate with another constructor + >::type* = nullptr // disambiguate with another constructor ) { CGAL_NEF_TRACEN("construction from PolygonMesh"); @@ -1952,7 +1952,7 @@ protected: interior. The point |p| is contained in the set represented by |\Mvar| if |\Mvar.contains(h)| is true.}*/ { CGAL_NEF_TRACEN( "locating point..."); - CGAL_assertion( pl() != NULL); + CGAL_assertion( pl() != nullptr); Object_handle o = pl()->locate(p); diff --git a/Nef_S2/include/CGAL/Nef_S2/SM_overlayer.h b/Nef_S2/include/CGAL/Nef_S2/SM_overlayer.h index c7f97ca12b3..bd5b63e7045 100644 --- a/Nef_S2/include/CGAL/Nef_S2/SM_overlayer.h +++ b/Nef_S2/include/CGAL/Nef_S2/SM_overlayer.h @@ -2313,8 +2313,8 @@ void SM_overlayer::simplify() CGAL_NEF_TRACEN("simplifying"); typedef typename CGAL::Union_find::handle Union_find_handle; - CGAL::Unique_hash_map< SFace_handle, Union_find_handle> Pitem(NULL); - CGAL::Unique_hash_map< SVertex_handle, Union_find_handle> Vitem(NULL); + CGAL::Unique_hash_map< SFace_handle, Union_find_handle> Pitem(nullptr); + CGAL::Unique_hash_map< SVertex_handle, Union_find_handle> Vitem(nullptr); CGAL::Union_find< SFace_handle> UF; SFace_iterator f; @@ -2376,7 +2376,7 @@ void SM_overlayer::simplify() vn=v; ++vn; if ( is_isolated(v) ) { - if(Vitem[v] != NULL) { + if(Vitem[v] != nullptr) { set_face(v,*(UF.find(Vitem[v]))); CGAL_NEF_TRACEN("incident face of " << PH(v) << " set to " << &*(v->incident_sface())); } diff --git a/Nef_S2/include/CGAL/Nef_S2/SM_point_locator.h b/Nef_S2/include/CGAL/Nef_S2/SM_point_locator.h index 96a34049df4..4f52e6ae2a6 100644 --- a/Nef_S2/include/CGAL/Nef_S2/SM_point_locator.h +++ b/Nef_S2/include/CGAL/Nef_S2/SM_point_locator.h @@ -341,7 +341,7 @@ public: SVertex_/SHalfedge_/SHalfloop_/SFace_handle&)|.\\ The object returned is intersected by |d.circle()|, has minimal distance to |p|, and |M(h)| holds on the converted object. The operation returns - the null handle |NULL| if the ray shoot along |s| does not hit any + the null handle |nullptr| if the ray shoot along |s| does not hit any object |h| of |M| with |M(h)|.}*/ { Sphere_circle c(d.circle()); diff --git a/Nef_S2/include/CGAL/Nef_S2/SM_triangulator.h b/Nef_S2/include/CGAL/Nef_S2/SM_triangulator.h index 7a98e93d94d..ab6c78821b5 100644 --- a/Nef_S2/include/CGAL/Nef_S2/SM_triangulator.h +++ b/Nef_S2/include/CGAL/Nef_S2/SM_triangulator.h @@ -83,18 +83,18 @@ void halfedge_below(Vertex_handle v, Halfedge_handle e) const { T.halfedge_below(v) = e; } /* the following operation associates segment support with - halfedges, we only update if non-NULL; this prevents - artificial sphere subdivision segments that have NULL - support to overwrite non-NULL support */ + halfedges, we only update if non-nullptr; this prevents + artificial sphere subdivision segments that have nullptr + support to overwrite non-nullptr support */ void supporting_segment(Halfedge_handle e, IT it) const { T.is_forward(e) = true; if ( ! M[it].empty() ) T.support(e) = M[it]; } /* the following operation associate segment support with - vertices, we only update if non-NULL; this prevents - artificial segments that have NULL support to overwrite - non-NULL support */ + vertices, we only update if non-nullptr; this prevents + artificial segments that have nullptr support to overwrite + non-nullptr support */ void trivial_segment(Vertex_handle v, IT it) const { if ( ! M[it].empty() ) T.support(v) = M[it]; } diff --git a/Nef_S2/include/CGAL/Nef_polyhedron_S2.h b/Nef_S2/include/CGAL/Nef_polyhedron_S2.h index c980fabd6f3..34d89c3f7e0 100644 --- a/Nef_S2/include/CGAL/Nef_polyhedron_S2.h +++ b/Nef_S2/include/CGAL/Nef_polyhedron_S2.h @@ -617,7 +617,7 @@ public: converted to a |SVertex_/SHalfedge_/SFace_const_handle| as described above. The object returned is intersected by the ray starting in |p| with direction |d| and has minimal distance to |p|. The operation - returns the null handle |NULL| if the ray shoot along |d| does not hit + returns the null handle |nullptr| if the ray shoot along |d| does not hit any object |h| of |\Mvar| with |\Mvar.contains(h)|.}*/ { Locator PL(&sphere_map()); @@ -637,7 +637,7 @@ public: |SVertex_/SHalfedge_const_handle| as described above. The object returned is part of the $1$-skeleton of |\Mvar|, intersected by the ray starting in |p| with direction |d| and has minimal distance to - |p|. The operation returns the null handle |NULL| if the ray shoot + |p|. The operation returns the null handle |nullptr| if the ray shoot along |d| does not hit any $1$-skeleton object |h| of |\Mvar|. The location mode flag |m| allows one to choose between different point location strategies.}*/ diff --git a/Number_types/include/CGAL/GMP/Gmpfi_type.h b/Number_types/include/CGAL/GMP/Gmpfi_type.h index 7d16a8041e1..652662cf15c 100644 --- a/Number_types/include/CGAL/GMP/Gmpfi_type.h +++ b/Number_types/include/CGAL/GMP/Gmpfi_type.h @@ -791,7 +791,7 @@ std::pair Gmpfi::to_interval()const{ inline std::pair Gmpfi::to_double_exp()const{ mpfr_t middle; - long *e=NULL; + long *e=nullptr; mpfr_init2(middle,53); mpfi_get_fr(middle,mpfi()); double d=mpfr_get_d_2exp(e,middle,mpfr_get_default_rounding_mode()); @@ -801,7 +801,7 @@ std::pair Gmpfi::to_double_exp()const{ inline std::pair,long> Gmpfi::to_interval_exp()const{ - long *e1=NULL,*e2=NULL; + long *e1=nullptr,*e2=nullptr; double d_low=mpfr_get_d_2exp(e1,left_mpfr(),GMP_RNDD); double d_upp=mpfr_get_d_2exp(e2,right_mpfr(),GMP_RNDU); if(e1set_sample(NULL); + vertex->set_sample(nullptr); } void collect_all_samples(Sample_vector& samples) const { @@ -400,7 +400,7 @@ public: } for (Finite_vertices_iterator vi = Base::finite_vertices_begin(); vi != Base::finite_vertices_end(); ++vi) { - vi->set_sample(NULL); + vi->set_sample(nullptr); } } diff --git a/Optimal_transportation_reconstruction_2/include/CGAL/OTR_2/Reconstruction_vertex_base_2.h b/Optimal_transportation_reconstruction_2/include/CGAL/OTR_2/Reconstruction_vertex_base_2.h index efc4f1c2329..c889160ad80 100644 --- a/Optimal_transportation_reconstruction_2/include/CGAL/OTR_2/Reconstruction_vertex_base_2.h +++ b/Optimal_transportation_reconstruction_2/include/CGAL/OTR_2/Reconstruction_vertex_base_2.h @@ -69,7 +69,7 @@ public: : Base(), m_id(-1), m_pinned(false), - m_sample(NULL), + m_sample(nullptr), m_relevance(0) { } @@ -78,7 +78,7 @@ public: : Base(p), m_id(-1), m_pinned(false), - m_sample(NULL), + m_sample(nullptr), m_relevance(0) { } @@ -87,7 +87,7 @@ public: : Base(f), m_id(-1), m_pinned(false), - m_sample(NULL), + m_sample(nullptr), m_relevance(0) { } @@ -96,7 +96,7 @@ public: : Base(p, f), m_id(-1), m_pinned(false), - m_sample(NULL), + m_sample(nullptr), m_relevance(0) { } @@ -118,7 +118,7 @@ public: const Point& relocated() const { return m_relocated; } Point& relocated() { return m_relocated; } - bool has_sample_assigned() const { return sample() != NULL; } + bool has_sample_assigned() const { return sample() != nullptr; } }; //---------------STRUCT LESS VERTEX_HANDLE--------------------- template diff --git a/Optimal_transportation_reconstruction_2/include/CGAL/Optimal_transportation_reconstruction_2.h b/Optimal_transportation_reconstruction_2/include/CGAL/Optimal_transportation_reconstruction_2.h index 4ef7e163a56..512de2679c6 100644 --- a/Optimal_transportation_reconstruction_2/include/CGAL/Optimal_transportation_reconstruction_2.h +++ b/Optimal_transportation_reconstruction_2/include/CGAL/Optimal_transportation_reconstruction_2.h @@ -1098,7 +1098,7 @@ public: m_dt.collect_samples_from_edge(twin, samples); copy_twin.first->samples(copy_twin.second) = samples; } - copy_vertex->set_sample(NULL); + copy_vertex->set_sample(nullptr); } Edge get_copy_edge( diff --git a/Partition_2/include/CGAL/Partition_2/Vertex_visibility_graph_2.h b/Partition_2/include/CGAL/Partition_2/Vertex_visibility_graph_2.h index c04757505b6..ff2f3c4f8f7 100644 --- a/Partition_2/include/CGAL/Partition_2/Vertex_visibility_graph_2.h +++ b/Partition_2/include/CGAL/Partition_2/Vertex_visibility_graph_2.h @@ -160,7 +160,7 @@ public: if (p != tree.end()) std::cout << "p = " << *p << std::endl; else - std::cout << "p == NULL" << std::endl; + std::cout << "p == nullptr" << std::endl; #endif stack.pop(); p_r = tree.right_sibling(p); @@ -168,14 +168,14 @@ public: if (p_r != tree.end()) std::cout << "p_r = " << *p_r << std::endl; else - std::cout << "p_r == NULL" << std::endl; + std::cout << "p_r == nullptr" << std::endl; #endif q = tree.parent(p); #ifdef CGAL_VISIBILITY_GRAPH_DEBUG if (q != tree.end()) std::cout << "q = " << *q << std::endl; else - std::cout << "q == NULL" << std::endl; + std::cout << "q == nullptr" << std::endl; #endif if (!tree.parent_is_p_minus_infinity(p)) { @@ -189,7 +189,7 @@ public: if (z != tree.end()) std::cout << "z = " << *z << std::endl; else - std::cout << "z == NULL" << std::endl; + std::cout << "z == nullptr" << std::endl; std::cout << "erasing " << *p << " from tree " << std::endl; #endif tree.erase(p); diff --git a/Periodic_2_triangulation_2/include/CGAL/Periodic_2_Delaunay_triangulation_2.h b/Periodic_2_triangulation_2/include/CGAL/Periodic_2_Delaunay_triangulation_2.h index 98c5d48bc92..09f403c1cbc 100644 --- a/Periodic_2_triangulation_2/include/CGAL/Periodic_2_Delaunay_triangulation_2.h +++ b/Periodic_2_triangulation_2/include/CGAL/Periodic_2_Delaunay_triangulation_2.h @@ -220,7 +220,7 @@ public: boost::is_convertible < typename std::iterator_traits::value_type, Point - > >::type* = NULL) + > >::type* = nullptr) #else template < class InputIterator > std::ptrdiff_t @@ -432,7 +432,7 @@ public: boost::is_convertible < typename std::iterator_traits::value_type, std::pair::type> - > >::type* = NULL + > >::type* = nullptr ) { return insert_with_info< std::pair::type> >(first, last, is_large_point_set); @@ -447,7 +447,7 @@ public: boost::mpl::and_ < boost::is_convertible< typename std::iterator_traits::value_type, Point >, boost::is_convertible< typename std::iterator_traits::value_type, typename internal::Info_check::type > - > >::type* = NULL) + > >::type* = nullptr) { return insert_with_info< boost::tuple::type> >(first, last, is_large_point_set); } @@ -5240,7 +5240,7 @@ void Periodic_2_Delaunay_triangulation_2::fill_hole_delaunay(std::list< typename Hole::iterator cut_after(hit); // if tested vertex is c with respect to the vertex opposite - // to NULL neighbor, + // to nullptr neighbor, // stop at the before last face; hdone--; while( hit != hdone) @@ -5416,7 +5416,7 @@ void Periodic_2_Delaunay_triangulation_2::fill_hole_delaunay( typename Hole::iterator cut_after(hit); // if tested vertex is c with respect to the vertex opposite - // to NULL neighbor, + // to nullptr neighbor, // stop at the before last face; hdone--; while( hit != hdone) diff --git a/Periodic_2_triangulation_2/include/CGAL/Periodic_2_triangulation_hierarchy_2.h b/Periodic_2_triangulation_2/include/CGAL/Periodic_2_triangulation_hierarchy_2.h index 8a347a99d1e..48f19c99706 100644 --- a/Periodic_2_triangulation_2/include/CGAL/Periodic_2_triangulation_hierarchy_2.h +++ b/Periodic_2_triangulation_2/include/CGAL/Periodic_2_triangulation_hierarchy_2.h @@ -299,7 +299,7 @@ clear() { for(int i = 0; i < m_maxlevel; ++i) { - CGAL_assertion(hierarchy[i] != NULL); + CGAL_assertion(hierarchy[i] != nullptr); hierarchy[i]->clear(); } } @@ -604,7 +604,7 @@ locate_in_all(const Point& p, { nearest = position->vertex(1); } - // compare to vertex 2, but only if the triangulation is 2D, because otherwise vertex(2) is NULL + // compare to vertex 2, but only if the triangulation is 2D, because otherwise vertex(2) is nullptr if ( (hierarchy[level]->dimension() == 2) && (! hierarchy[level]->is_infinite(position->vertex(2)))) { if ( closer( p, diff --git a/Periodic_2_triangulation_2/include/CGAL/Periodic_2_triangulation_iterators_2.h b/Periodic_2_triangulation_2/include/CGAL/Periodic_2_triangulation_iterators_2.h index 0e93bb5c98d..4ee8e9857a7 100644 --- a/Periodic_2_triangulation_2/include/CGAL/Periodic_2_triangulation_iterators_2.h +++ b/Periodic_2_triangulation_2/include/CGAL/Periodic_2_triangulation_iterators_2.h @@ -67,7 +67,7 @@ public: typedef typename T::Iterator_type Iterator_type; Periodic_2_triangulation_triangle_iterator_2(Iterator_type it = T::STORED) - : _t(NULL), _it(it), _off(0) {} + : _t(nullptr), _it(it), _off(0) {} Periodic_2_triangulation_triangle_iterator_2(const T * t, Iterator_type it = T::STORED) @@ -386,7 +386,7 @@ public: typedef typename T::Iterator_type Iterator_type; Periodic_2_triangulation_segment_iterator_2(Iterator_type it = T::STORED) - : _t(NULL), _it(it), _off(0) {} + : _t(nullptr), _it(it), _off(0) {} Periodic_2_triangulation_segment_iterator_2(const T * t, Iterator_type it = T::STORED) @@ -682,7 +682,7 @@ public: typedef typename T::Iterator_type Iterator_type; Periodic_2_triangulation_point_iterator_2(Iterator_type it = T::STORED) - : _t(NULL), _it(it) {} + : _t(nullptr), _it(it) {} Periodic_2_triangulation_point_iterator_2(const T * t, Iterator_type it = T::STORED) diff --git a/Periodic_3_mesh_3/include/CGAL/Periodic_3_mesh_3/Protect_edges_sizing_field.h b/Periodic_3_mesh_3/include/CGAL/Periodic_3_mesh_3/Protect_edges_sizing_field.h index 19b7cad9bd5..c58a10b9332 100644 --- a/Periodic_3_mesh_3/include/CGAL/Periodic_3_mesh_3/Protect_edges_sizing_field.h +++ b/Periodic_3_mesh_3/include/CGAL/Periodic_3_mesh_3/Protect_edges_sizing_field.h @@ -486,7 +486,7 @@ private: void insert_in_correspondence_map(const Vertex_handle v, const Bare_point& p, const Curve_index_container& curve_indices, - typename Curve_index_container::const_iterator* /*sfinae*/ = NULL); + typename Curve_index_container::const_iterator* /*sfinae*/ = nullptr); void insert_in_correspondence_map(const Vertex_handle v, const Bare_point& p, diff --git a/Periodic_3_mesh_3/include/CGAL/Periodic_3_mesh_triangulation_3.h b/Periodic_3_mesh_3/include/CGAL/Periodic_3_mesh_triangulation_3.h index ee8d0d30952..09f893de7a0 100644 --- a/Periodic_3_mesh_3/include/CGAL/Periodic_3_mesh_triangulation_3.h +++ b/Periodic_3_mesh_3/include/CGAL/Periodic_3_mesh_triangulation_3.h @@ -616,17 +616,17 @@ public: Cell_handle locate(const Weighted_point& p, Cell_handle start = Cell_handle(), - bool* CGAL_assertion_code(could_lock_zone) = NULL) const + bool* CGAL_assertion_code(could_lock_zone) = nullptr) const { - CGAL_assertion(could_lock_zone == NULL); + CGAL_assertion(could_lock_zone == nullptr); return Base::locate(canonicalize_point(p), start); } Cell_handle locate(const Weighted_point& p, Vertex_handle hint, - bool* CGAL_assertion_code(could_lock_zone) = NULL) const + bool* CGAL_assertion_code(could_lock_zone) = nullptr) const { - CGAL_assertion(could_lock_zone == NULL); + CGAL_assertion(could_lock_zone == nullptr); // Compared to the non-periodic version in T3, the infinite cell cannot // be used as default hint, so `Cell_handle()` is used instead. return Base::locate(canonicalize_point(p), @@ -636,18 +636,18 @@ public: Cell_handle locate(const Weighted_point& p, Locate_type& l, int& i, int& j, Cell_handle start = Cell_handle(), - bool* CGAL_assertion_code(could_lock_zone) = NULL) const + bool* CGAL_assertion_code(could_lock_zone) = nullptr) const { - CGAL_assertion(could_lock_zone == NULL); + CGAL_assertion(could_lock_zone == nullptr); return Base::locate(canonicalize_point(p), l, i, j, start); } Cell_handle locate(const Weighted_point& p, Locate_type& l, int& i, int& j, Vertex_handle hint, - bool* CGAL_assertion_code(could_lock_zone) = NULL) const + bool* CGAL_assertion_code(could_lock_zone) = nullptr) const { - CGAL_assertion(could_lock_zone == NULL); + CGAL_assertion(could_lock_zone == nullptr); return Base::locate(canonicalize_point(p), l, i, j, hint == Vertex_handle() ? Cell_handle() : hint->cell()); } @@ -678,11 +678,11 @@ public: OutputIteratorBoundaryFacets bfit, OutputIteratorCells cit, OutputIteratorInternalFacets ifit, - bool* CGAL_assertion_code(could_lock_zone) = NULL, - const Facet* /* this_facet_must_be_in_the_cz */ = NULL, - bool* /* the_facet_is_in_its_cz */ = NULL) const + bool* CGAL_assertion_code(could_lock_zone) = nullptr, + const Facet* /* this_facet_must_be_in_the_cz */ = nullptr, + bool* /* the_facet_is_in_its_cz */ = nullptr) const { - CGAL_triangulation_precondition(could_lock_zone == NULL); + CGAL_triangulation_precondition(could_lock_zone == nullptr); CGAL_triangulation_precondition(number_of_vertices() != 0); clear_v_offsets(); @@ -729,9 +729,9 @@ public: find_conflicts(const Weighted_point &p, Cell_handle c, OutputIteratorBoundaryFacets bfit, OutputIteratorCells cit, - bool* could_lock_zone = NULL) const + bool* could_lock_zone = nullptr) const { - CGAL_assertion(could_lock_zone == NULL); + CGAL_assertion(could_lock_zone == nullptr); Tripleis_1_cover()); // do not ever allow cover change return b; diff --git a/Periodic_3_triangulation_3/include/CGAL/internal/Periodic_3_triangulation_iterators_3.h b/Periodic_3_triangulation_3/include/CGAL/internal/Periodic_3_triangulation_iterators_3.h index 46dae36b64c..c6922161bfd 100644 --- a/Periodic_3_triangulation_3/include/CGAL/internal/Periodic_3_triangulation_iterators_3.h +++ b/Periodic_3_triangulation_3/include/CGAL/internal/Periodic_3_triangulation_iterators_3.h @@ -66,7 +66,7 @@ public: typedef typename T::Iterator_type Iterator_type; Periodic_3_triangulation_tetrahedron_iterator_3(Iterator_type it = T::STORED) - : _t(NULL), _it(it), _off(0) {} + : _t(nullptr), _it(it), _off(0) {} Periodic_3_triangulation_tetrahedron_iterator_3(const T * t, Iterator_type it = T::STORED) @@ -372,7 +372,7 @@ public: typedef typename T::Iterator_type Iterator_type; Periodic_3_triangulation_triangle_iterator_3(Iterator_type it = T::STORED) - : _t(NULL), _it(it), _off(0) {} + : _t(nullptr), _it(it), _off(0) {} Periodic_3_triangulation_triangle_iterator_3(const T * t, Iterator_type it = T::STORED) @@ -662,7 +662,7 @@ public: typedef typename T::Iterator_type Iterator_type; Periodic_3_triangulation_segment_iterator_3(Iterator_type it = T::STORED) - : _t(NULL), _it(it), _off(0) {} + : _t(nullptr), _it(it), _off(0) {} Periodic_3_triangulation_segment_iterator_3(const T * t, Iterator_type it = T::STORED) @@ -921,7 +921,7 @@ public: typedef typename T::Iterator_type Iterator_type; Periodic_3_triangulation_point_iterator_3(Iterator_type it = T::STORED) - : _t(NULL), _it(it) {} + : _t(nullptr), _it(it) {} Periodic_3_triangulation_point_iterator_3(const T * t, Iterator_type it = T::STORED) diff --git a/Periodic_4_hyperbolic_triangulation_2/demo/Periodic_4_hyperbolic_triangulation_2/CMakeLists.txt b/Periodic_4_hyperbolic_triangulation_2/demo/Periodic_4_hyperbolic_triangulation_2/CMakeLists.txt index c5cdc06409a..ee07f1a1066 100644 --- a/Periodic_4_hyperbolic_triangulation_2/demo/Periodic_4_hyperbolic_triangulation_2/CMakeLists.txt +++ b/Periodic_4_hyperbolic_triangulation_2/demo/Periodic_4_hyperbolic_triangulation_2/CMakeLists.txt @@ -1,5 +1,4 @@ -# Created by the script cgal_create_cmake_script -# This is the CMake script for compiling a CGAL application. +cmake_minimum_required(VERSION 3.1...3.13) project (Periodic_4_hyperbolic_triangulation_2_Demo) @@ -10,12 +9,6 @@ include_directories( ${CMAKE_BINARY_DIR} ) # Instruct CMake to run moc automatically when needed. set(CMAKE_AUTOMOC ON) -cmake_minimum_required(VERSION 3.1...3.13) - -if(POLICY CMP0071) - cmake_policy(SET CMP0071 NEW) -endif() - find_package(CGAL QUIET COMPONENTS Core Qt5) include(${CGAL_USE_FILE}) @@ -24,8 +17,6 @@ find_package(LEDA QUIET) find_package(Qt5 QUIET COMPONENTS Widgets) if(CGAL_FOUND AND (CGAL_Core_FOUND OR LEDA_FOUND) AND Qt5_FOUND AND CGAL_Qt5_FOUND) - find_package( Boost REQUIRED ) - include_directories (BEFORE include ) # ui files, created with Qt Designer @@ -35,19 +26,19 @@ if(CGAL_FOUND AND (CGAL_Core_FOUND OR LEDA_FOUND) AND Qt5_FOUND AND CGAL_Qt5_FOU qt5_add_resources ( RESOURCE_FILES Main_resources.qrc ) # cpp files - add_executable ( P4HDT2 P4HDT2.cpp ${RESOURCE_FILES} ${UIS}) - #add_executable ( Periodic_4_hyperbolic_billiards_demo - #Periodic_4_hyperbolic_billiards_demo.cpp ${RESOURCE_FILES} ) - - qt5_use_modules( P4HDT2 Widgets ) - #qt5_use_modules( Periodic_4_hyperbolic_billiards_demo Widgets ) - - target_link_libraries( P4HDT2 ${CGAL_LIBRARIES} ${CGAL_3RD_PARTY_LIBRARIES} ${Boost_LIBRARIES} ) - - #target_link_libraries( Periodic_4_hyperbolic_billiards_demo ${CGAL_LIBRARIES} ${CGAL_3RD_PARTY_LIBRARIES} ${Boost_LIBRARIES} ) + target_link_libraries( P4HDT2 PRIVATE + CGAL::CGAL + CGAL::CGAL_Qt5 + Qt5::Widgets ) + if(TARGET CGAL::CGAL_Core) + target_link_libraries( P4HDT2 PRIVATE CGAL::CGAL_Core ) + endif() + if(LEDA_FOUND) + target_link_libraries( P4HDT2 PRIVATE ${LEDA_LIBRARIES} ) + endif() else() message(STATUS "NOTICE: This demo requires Qt5 and will not be compiled.") endif() diff --git a/Point_set_2/include/CGAL/Point_set_2.h b/Point_set_2/include/CGAL/Point_set_2.h index 3386ddc2a29..df20128a18b 100644 --- a/Point_set_2/include/CGAL/Point_set_2.h +++ b/Point_set_2/include/CGAL/Point_set_2.h @@ -126,7 +126,7 @@ public: Vertex_handle lookup(Point p) const { - if (number_of_vertices() == 0) return NULL; + if (number_of_vertices() == 0) return nullptr; // locate ... Locate_type lt; @@ -137,20 +137,20 @@ public: Face f = *fh; return f.vertex(li); } - else return NULL; + else return nullptr; } Vertex_handle nearest_neighbor(Point p) { - if (number_of_vertices() == 0) return NULL; + if (number_of_vertices() == 0) return nullptr; return nearest_vertex(p); } Vertex_handle nearest_neighbor(Vertex_handle v) const { - if (number_of_vertices() <= 1) return NULL; + if (number_of_vertices() <= 1) return nullptr; Point p = v->point(); Vertex_circulator vc = incident_vertices(v); @@ -196,7 +196,7 @@ public: bool old_node = true; // we have to add a new vertex ... - if (vh == NULL){ + if (vh == nullptr){ vh = insert(p); old_node = false; k++; @@ -379,7 +379,7 @@ public: Vertex_handle v = lookup(p); bool new_v = false; - if ( v == NULL ) + if ( v == nullptr ) { new_v = true; v = insert(p); diff --git a/Point_set_2/include/CGAL/nearest_neighbor_delaunay_2.h b/Point_set_2/include/CGAL/nearest_neighbor_delaunay_2.h index 4b17cfacead..18e7328e200 100644 --- a/Point_set_2/include/CGAL/nearest_neighbor_delaunay_2.h +++ b/Point_set_2/include/CGAL/nearest_neighbor_delaunay_2.h @@ -49,7 +49,7 @@ typename Dt::Vertex_handle nearest_neighbor(const Dt& delau, typename Dt::Verte typedef typename Dt::Vertex_handle Vertex_handle; typedef typename Gt::Compare_distance_2 Compare_dist_2; - if (delau.number_of_vertices() <= 1) return NULL; + if (delau.number_of_vertices() <= 1) return nullptr; Point p = v->point(); Vertex_circulator vc = delau.incident_vertices(v); @@ -85,7 +85,7 @@ typename Dt::Vertex_handle lookup(const Dt& delau, const typename Dt::Point& p) typedef typename Dt::Locate_type Locate_type; typedef typename Dt::Face_handle Face_handle; - if (delau.number_of_vertices() == 0) return NULL; + if (delau.number_of_vertices() == 0) return nullptr; // locate ... Locate_type lt; @@ -96,7 +96,7 @@ typename Dt::Vertex_handle lookup(const Dt& delau, const typename Dt::Point& p) Face f = *fh; return f.vertex(li); } - else return NULL; + else return nullptr; } @@ -124,7 +124,7 @@ OutputIterator nearest_neighbors(Dt& delau, const typename Dt::Point& p, std:: bool old_node = true; // we have to add a new vertex ... - if (vh == NULL){ + if (vh == nullptr){ vh = delau.insert(p); old_node = false; k++; diff --git a/Point_set_2/include/CGAL/range_search_delaunay_2.h b/Point_set_2/include/CGAL/range_search_delaunay_2.h index 49d936d646c..d2a2f183017 100644 --- a/Point_set_2/include/CGAL/range_search_delaunay_2.h +++ b/Point_set_2/include/CGAL/range_search_delaunay_2.h @@ -186,7 +186,7 @@ OutputIterator range_search(Dt& delau, bool new_v = false; // we have to insert the center ... - if ( v == NULL ) + if ( v == nullptr ) { new_v = true; v = delau.insert(p); @@ -337,7 +337,7 @@ OutputIterator range_search(Dt& delau, bool new_v = false; // we have to insert the center ... - if ( v == NULL ) + if ( v == nullptr ) { new_v = true; v = delau.insert(p); diff --git a/Point_set_3/include/CGAL/Point_set_3.h b/Point_set_3/include/CGAL/Point_set_3.h index df0ea714daf..931f3b8c646 100644 --- a/Point_set_3/include/CGAL/Point_set_3.h +++ b/Point_set_3/include/CGAL/Point_set_3.h @@ -1109,8 +1109,8 @@ public: Property* prop; mutable Index ind; - Push_property_map(Point_set* ps = NULL, - Property* prop = NULL, + Push_property_map(Point_set* ps = nullptr, + Property* prop = nullptr, Index ind=Index()) : ps(ps), prop(prop), ind(ind) {} diff --git a/Point_set_processing_3/include/CGAL/Point_set_processing_3/internal/Parallel_callback.h b/Point_set_processing_3/include/CGAL/Point_set_processing_3/internal/Parallel_callback.h index 2d47709f78a..ac9ade33f7c 100644 --- a/Point_set_processing_3/include/CGAL/Point_set_processing_3/internal/Parallel_callback.h +++ b/Point_set_processing_3/include/CGAL/Point_set_processing_3/internal/Parallel_callback.h @@ -56,7 +56,7 @@ public: , m_interrupted (new cpp11::atomic()) , m_size (size) , m_creator (true) - , m_thread (NULL) + , m_thread (nullptr) { // cpp11::atomic only has default constructor, initialization done in two steps *m_advancement = advancement; @@ -71,7 +71,7 @@ public: , m_interrupted (other.m_interrupted) , m_size (other.m_size) , m_creator (false) - , m_thread (NULL) + , m_thread (nullptr) { } @@ -84,7 +84,7 @@ public: delete m_advancement; delete m_interrupted; } - if (m_thread != NULL) + if (m_thread != nullptr) delete m_thread; } @@ -92,7 +92,7 @@ public: cpp11::atomic& interrupted() { return *m_interrupted; } void join() { - if (m_thread != NULL) + if (m_thread != nullptr) m_thread->join(); } diff --git a/Point_set_processing_3/include/CGAL/Point_set_processing_3/internal/Search_traits_vertex_handle_3.h b/Point_set_processing_3/include/CGAL/Point_set_processing_3/internal/Search_traits_vertex_handle_3.h index 64bf268a660..909026a1e2f 100644 --- a/Point_set_processing_3/include/CGAL/Point_set_processing_3/internal/Search_traits_vertex_handle_3.h +++ b/Point_set_processing_3/include/CGAL/Point_set_processing_3/internal/Search_traits_vertex_handle_3.h @@ -53,11 +53,11 @@ public: m_coord[0] = m_coord[1] = m_coord[2] = 0; - //m_vertex_handle = NULL; + //m_vertex_handle = nullptr; } Point_vertex_handle_3(double x, double y, double z, - Vertex_handle vertex_handle) ///< NULL for query points + Vertex_handle vertex_handle) ///< nullptr for query points { m_coord[0] = x; m_coord[1] = y; diff --git a/Poisson_surface_reconstruction_3/include/CGAL/Lightweight_vector_3.h b/Poisson_surface_reconstruction_3/include/CGAL/Lightweight_vector_3.h index 3cd9f716988..eebcb3b7581 100644 --- a/Poisson_surface_reconstruction_3/include/CGAL/Lightweight_vector_3.h +++ b/Poisson_surface_reconstruction_3/include/CGAL/Lightweight_vector_3.h @@ -56,7 +56,7 @@ public: /// Vector is (0,0,0) by default. Lightweight_vector_3(Null_vector = NULL_VECTOR) { - m_pVector = NULL; + m_pVector = nullptr; } Lightweight_vector_3(const Vector& vector) { @@ -74,25 +74,25 @@ public: /// Copy constructor Lightweight_vector_3(const Lightweight_vector_3& that) { - m_pVector = (that.m_pVector == NULL) ? NULL : new Vector(*that.m_pVector); + m_pVector = (that.m_pVector == nullptr) ? nullptr : new Vector(*that.m_pVector); } template Lightweight_vector_3(const Lightweight_vector_3& that) { Vector vector = that.get_vector(); - m_pVector = (vector == NULL_VECTOR) ? NULL : new Vector(vector); + m_pVector = (vector == NULL_VECTOR) ? nullptr : new Vector(vector); } /// Operator =() Lightweight_vector_3& operator=(const Lightweight_vector_3& that) { - if (m_pVector != NULL && that.m_pVector != NULL) + if (m_pVector != nullptr && that.m_pVector != nullptr) { *m_pVector = *that.m_pVector; } else { delete m_pVector; - m_pVector = (that.m_pVector == NULL) ? NULL : new Vector(*that.m_pVector); + m_pVector = (that.m_pVector == nullptr) ? nullptr : new Vector(*that.m_pVector); } return *this; } @@ -100,7 +100,7 @@ public: /// Destructor ~Lightweight_vector_3() { - delete m_pVector; m_pVector = NULL; + delete m_pVector; m_pVector = nullptr; } /// Compare vectors @@ -116,7 +116,7 @@ public: /// Gets (a copy of) the actual vector. operator Vector() const { - if (m_pVector != NULL) + if (m_pVector != nullptr) return *m_pVector; else return NULL_VECTOR; @@ -126,25 +126,25 @@ public: return *this; } - FT x() const { return (m_pVector != NULL) ? m_pVector->x() : 0; } - FT y() const { return (m_pVector != NULL) ? m_pVector->y() : 0; } - FT z() const { return (m_pVector != NULL) ? m_pVector->z() : 0; } + FT x() const { return (m_pVector != nullptr) ? m_pVector->x() : 0; } + FT y() const { return (m_pVector != nullptr) ? m_pVector->y() : 0; } + FT z() const { return (m_pVector != nullptr) ? m_pVector->z() : 0; } - RT hx() const { return (m_pVector != NULL) ? m_pVector->hx() : 0; } - RT hy() const { return (m_pVector != NULL) ? m_pVector->hy() : 0; } - RT hz() const { return (m_pVector != NULL) ? m_pVector->hz() : 0; } - RT hw() const { return (m_pVector != NULL) ? m_pVector->hw() : 1; } + RT hx() const { return (m_pVector != nullptr) ? m_pVector->hx() : 0; } + RT hy() const { return (m_pVector != nullptr) ? m_pVector->hy() : 0; } + RT hz() const { return (m_pVector != nullptr) ? m_pVector->hz() : 0; } + RT hw() const { return (m_pVector != nullptr) ? m_pVector->hw() : 1; } FT cartesian(int i) const { - if (m_pVector != NULL) + if (m_pVector != nullptr) return m_pVector->cartesian(i); else return 0; } FT operator[](int i) const { - if (m_pVector != NULL) + if (m_pVector != nullptr) return (*m_pVector)[i]; else if (i != 3) return 0; @@ -153,7 +153,7 @@ public: } RT homogeneous(int i) const { - if (m_pVector != NULL) + if (m_pVector != nullptr) return m_pVector->homogeneous(); else if (i != 3) return 0; @@ -177,21 +177,21 @@ public: } Vector operator-() const { - if (m_pVector != NULL) + if (m_pVector != nullptr) return -(*m_pVector); else return NULL_VECTOR; } Vector operator/(RT c) const { - if (m_pVector != NULL) + if (m_pVector != nullptr) return (*m_pVector) / c; else return NULL_VECTOR; } Vector operator*(FT c) const { - if (m_pVector != NULL) + if (m_pVector != nullptr) return (*m_pVector) * c; else return NULL_VECTOR; @@ -203,7 +203,7 @@ public: FT squared_length() const { - if (m_pVector != NULL) + if (m_pVector != nullptr) return m_pVector->squared_length(); else return 0; diff --git a/Polygon/include/CGAL/Polygon_2/Polygon_2_edge_circulator.h b/Polygon/include/CGAL/Polygon_2/Polygon_2_edge_circulator.h index 2262eedb83b..c6f6b453cb8 100644 --- a/Polygon/include/CGAL/Polygon_2/Polygon_2_edge_circulator.h +++ b/Polygon/include/CGAL/Polygon_2/Polygon_2_edge_circulator.h @@ -65,12 +65,12 @@ class Polygon_2_const_edge_circulator { Polygon_2_const_edge_circulator(Vertex_const_circulator f) : first_vertex(f) {} - bool operator==( Nullptr_t CGAL_assertion_code(p) ) const { + bool operator==( std::nullptr_t CGAL_assertion_code(p) ) const { CGAL_polygon_assertion( p == 0); return (first_vertex == 0); } - bool operator!=( Nullptr_t p ) const + bool operator!=( std::nullptr_t p ) const { return !(*this == p); } diff --git a/Polygon/include/CGAL/Polygon_2/Polygon_2_vertex_circulator.h b/Polygon/include/CGAL/Polygon_2/Polygon_2_vertex_circulator.h index b631984c6c7..7d4e8087299 100644 --- a/Polygon/include/CGAL/Polygon_2/Polygon_2_vertex_circulator.h +++ b/Polygon/include/CGAL/Polygon_2/Polygon_2_vertex_circulator.h @@ -56,7 +56,7 @@ private: public: // CREATION - Polygon_circulator() : ctnr(NULL) {} + Polygon_circulator() : ctnr(nullptr) {} Polygon_circulator( const Ctnr* c) : ctnr(c), i(c->begin()) {} Polygon_circulator( const Ctnr* c, iterator j) @@ -68,15 +68,15 @@ public: // OPERATIONS - bool operator==( Nullptr_t CGAL_assertion_code(p)) const { - CGAL_assertion( p == NULL); - return (ctnr == NULL) || (ctnr->begin() == ctnr->end()); + bool operator==( std::nullptr_t CGAL_assertion_code(p)) const { + CGAL_assertion( p == nullptr); + return (ctnr == nullptr) || (ctnr->begin() == ctnr->end()); } - bool operator!=( Nullptr_t p) const { return !(*this == p); } + bool operator!=( std::nullptr_t p) const { return !(*this == p); } bool operator==( const Self& c) const { return i == c.i; } bool operator!=( const Self& c) const { return !(*this == c); } reference operator*() const { - CGAL_assertion( ctnr != NULL); + CGAL_assertion( ctnr != nullptr); CGAL_assertion( current_iterator() != ctnr->end()); return *i; } @@ -91,12 +91,12 @@ private: public: pointer operator->() const { - CGAL_assertion( ctnr != NULL); + CGAL_assertion( ctnr != nullptr); CGAL_assertion( current_iterator() != ctnr->end()); return deref(i); } Self& operator++() { - CGAL_assertion( ctnr != NULL); + CGAL_assertion( ctnr != nullptr); CGAL_assertion( current_iterator() != ctnr->end()); ++i; if ( current_iterator() == ctnr->end()) @@ -109,7 +109,7 @@ public: return tmp; } Self& operator--() { - CGAL_assertion( ctnr != NULL); + CGAL_assertion( ctnr != nullptr); CGAL_assertion( current_iterator() != ctnr->end()); if ( current_iterator() == ctnr->begin()) i = const_cast(ctnr)->end(); @@ -122,7 +122,7 @@ public: return tmp; } Self& operator+=( difference_type n) { - CGAL_assertion( ctnr != NULL); + CGAL_assertion( ctnr != nullptr); CGAL_assertion( current_iterator() != ctnr->end()); typename Ctnr::difference_type j = current_iterator() - ctnr->begin(); typename Ctnr::difference_type size = ctnr->size(); @@ -144,8 +144,8 @@ public: return tmp += -n; } difference_type operator-( const Self& c) const { - CGAL_assertion( ctnr != NULL); - CGAL_assertion( c.ctnr != NULL); + CGAL_assertion( ctnr != nullptr); + CGAL_assertion( c.ctnr != nullptr); return i - c.i; } reference operator[]( difference_type n) const { diff --git a/Polygon_mesh_processing/doc/Polygon_mesh_processing/NamedParameters.txt b/Polygon_mesh_processing/doc/Polygon_mesh_processing/NamedParameters.txt index 4d34f30d8b3..ec9ccba1d8a 100644 --- a/Polygon_mesh_processing/doc/Polygon_mesh_processing/NamedParameters.txt +++ b/Polygon_mesh_processing/doc/Polygon_mesh_processing/NamedParameters.txt @@ -191,7 +191,9 @@ a more isotropic mesh.\n \cgalNPEnd \cgalNPBegin{use_delaunay_triangulation} \anchor PMP_use_delaunay_triangulation -enables the use of the Delaunay triangulation facet search space for hole filling functions.\n +enables the use of the Delaunay triangulation facet search space for hole filling functions. +If no valid triangulation can be found in this search space, the algorithm falls back to the +non-Delaunay triangulations search space to find a solution.\n Type: `bool` \n Default: `true` \cgalNPEnd diff --git a/Polygon_mesh_processing/doc/Polygon_mesh_processing/PackageDescription.txt b/Polygon_mesh_processing/doc/Polygon_mesh_processing/PackageDescription.txt index 032167d48e0..3193cbf966b 100644 --- a/Polygon_mesh_processing/doc/Polygon_mesh_processing/PackageDescription.txt +++ b/Polygon_mesh_processing/doc/Polygon_mesh_processing/PackageDescription.txt @@ -133,6 +133,8 @@ and provides a list of the parameters that are used in this package. - `CGAL::Polygon_mesh_processing::merge_duplicate_polygons_in_polygon_soup()` - `CGAL::Polygon_mesh_processing::remove_isolated_points_in_polygon_soup()` - `CGAL::Polygon_mesh_processing::repair_polygon_soup()` +- `CGAL::Polygon_mesh_processing::stitch_boundary_cycle()` +- `CGAL::Polygon_mesh_processing::stitch_boundary_cycles()` - `CGAL::Polygon_mesh_processing::stitch_borders()` - `CGAL::Polygon_mesh_processing::is_polygon_soup_a_polygon_mesh()` - `CGAL::Polygon_mesh_processing::polygon_soup_to_polygon_mesh()` diff --git a/Polygon_mesh_processing/doc/Polygon_mesh_processing/Polygon_mesh_processing.txt b/Polygon_mesh_processing/doc/Polygon_mesh_processing/Polygon_mesh_processing.txt index 7c2bf8ab4e2..273d19e04f4 100644 --- a/Polygon_mesh_processing/doc/Polygon_mesh_processing/Polygon_mesh_processing.txt +++ b/Polygon_mesh_processing/doc/Polygon_mesh_processing/Polygon_mesh_processing.txt @@ -547,17 +547,20 @@ to obtain an as-clean-as-possible polygon soup. \subsection Stitching -It happens that a polygon mesh has several edges and vertices that are duplicated. +When handling polygon meshes, it might happen that a mesh has several edges and vertices that are duplicated. For those edges and vertices, the connectivity of the mesh is incomplete, if not considered incorrect. -Stitching the borders of such a polygon mesh consists in two main steps. -First, border edges that are similar but duplicated are detected and paired. -Then, they are "stitched" together so that the edges and vertices duplicates are removed -from the mesh, and each of these remaining edges is incident to exactly two faces. +Stitching the borders of a polygon mesh can be done to fix some of the duplication. +It consists in two main steps. First, border edges that are geometrically identical but duplicated +are detected and paired. Then, they are "stitched" together so that edges and vertices duplicates +are removed from the mesh, and each of these remaining edges is incident to exactly two faces. -The function \link PMP_repairing_grp `CGAL::Polygon_mesh_processing::stitch_borders()` \endlink - performs such repairing operation. The input mesh should be manifold. -Otherwise, stitching is not guaranteed to succeed. +The functions `CGAL::Polygon_mesh_processing::stitch_boundary_cycle()`, `CGAL::Polygon_mesh_processing::stitch_boundary_cycles()`, +and `CGAL::Polygon_mesh_processing::stitch_borders()` can perform such repairing operations: the first two +functions can be used to stitch halfedges that are part of the same boundary(ies), whereas the third +function is more generic and can also stitch halfedges that live on different borders. + +The input mesh should be manifold; otherwise, stitching is not guaranteed to succeed. \subsubsection StitchingExample Stitching Example diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/AABB_traversal_traits_with_transformation.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/AABB_traversal_traits_with_transformation.h index 818b9c038d8..8ded3a54f94 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/AABB_traversal_traits_with_transformation.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/AABB_traversal_traits_with_transformation.h @@ -141,7 +141,7 @@ class Do_intersect_traversal_traits_with_transformation public: Do_intersect_traversal_traits_with_transformation(): - m_traits_ptr(NULL) + m_traits_ptr(nullptr) {} Do_intersect_traversal_traits_with_transformation(const AABBTraits& traits) diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Corefinement/intersection_impl.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Corefinement/intersection_impl.h index bb7374dfb80..5d47cfc840a 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Corefinement/intersection_impl.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Corefinement/intersection_impl.h @@ -416,14 +416,14 @@ class Intersection_of_triangle_meshes { face_descriptor f_2 = face(edge_intersected, tm2); add_intersection_point_to_face_and_all_edge_incident_faces(f_2,e_1,tm2,tm1,node_id); - if (fset!=NULL) fset->erase(f_2); + if (fset!=nullptr) fset->erase(f_2); } edge_intersected = opposite(edge_intersected, tm2); if (!is_border(edge_intersected, tm2)) { face_descriptor f_2 = face(edge_intersected, tm2); add_intersection_point_to_face_and_all_edge_incident_faces(f_2,e_1,tm2,tm1,node_id); - if (fset!=NULL) fset->erase(f_2); + if (fset!=nullptr) fset->erase(f_2); } //associate the intersection point to all faces incident to edge using the intersected edge @@ -507,7 +507,7 @@ class Intersection_of_triangle_meshes halfedges_around_target(v_1,tm1)) { typename Edge_to_faces::iterator it_ets=tm1_edge_to_tm2_faces.find(edge(h_1,tm1)); - Face_set* fset = (it_ets!=tm1_edge_to_tm2_faces.end())?&(it_ets->second):NULL; + Face_set* fset = (it_ets!=tm1_edge_to_tm2_faces.end())?&(it_ets->second):nullptr; cip_handle_case_edge(node_id,fset,h_1,e_2,tm1,tm2); } } @@ -530,7 +530,7 @@ class Intersection_of_triangle_meshes halfedges_around_target(v_1,tm1)) { typename Edge_to_faces::iterator it_ets=tm1_edge_to_tm2_faces.find(edge(h_1,tm1)); - Face_set* fset = (it_ets!=tm1_edge_to_tm2_faces.end())?&(it_ets->second):NULL; + Face_set* fset = (it_ets!=tm1_edge_to_tm2_faces.end())?&(it_ets->second):nullptr; cip_handle_case_vertex(node_id,fset,h_1,v_2,tm1,tm2); } } @@ -605,7 +605,7 @@ class Intersection_of_triangle_meshes if(is_new_node) visitor.new_node_added(node_id,ON_EDGE,ipt.info_1,ipt.info_2,tm1,tm2,false,false); typename Edge_to_faces::iterator it_ets=stm_edge_to_ltm_faces.find(edge(ipt.info_1,tm1)); - Face_set* fset = (it_ets!=stm_edge_to_ltm_faces.end())?&(it_ets->second):NULL; + Face_set* fset = (it_ets!=stm_edge_to_ltm_faces.end())?&(it_ets->second):nullptr; cip_handle_case_edge(node_id,fset,ipt.info_1,ipt.info_2,tm1,tm2); } break; @@ -658,7 +658,7 @@ class Intersection_of_triangle_meshes if ( std::get<3>(inter_res) ) // is edge target in triangle plane nodes.add_new_node(get(vpm1, target(h_1,tm1))); else{ - if (std::get<3>(inter_res)) // is edge source in triangle plane + if (std::get<2>(inter_res)) // is edge source in triangle plane nodes.add_new_node(get(vpm1, source(h_1,tm1))); else nodes.add_new_node(h_1,f_2,tm1,tm2,vpm1,vpm2); @@ -754,7 +754,7 @@ class Intersection_of_triangle_meshes for (;it_edge!=all_edges.end();++it_edge){ if ( it_edge!=all_edges.begin() ){ typename Edge_to_faces::iterator it_ets=tm1_edge_to_tm2_faces.find(edge(*it_edge,tm1)); - Face_set* fset_bis = (it_ets!=tm1_edge_to_tm2_faces.end())?&(it_ets->second):NULL; + Face_set* fset_bis = (it_ets!=tm1_edge_to_tm2_faces.end())?&(it_ets->second):nullptr; cip_handle_case_edge(node_id,fset_bis,*it_edge,h_2,tm1,tm2); } else @@ -773,7 +773,7 @@ class Intersection_of_triangle_meshes for (;it_edge!=all_edges.end();++it_edge){ if ( it_edge!=all_edges.begin() ){ typename Edge_to_faces::iterator it_ets=tm1_edge_to_tm2_faces.find(edge(*it_edge,tm1)); - Face_set* fset_bis = (it_ets!=tm1_edge_to_tm2_faces.end())?&(it_ets->second):NULL; + Face_set* fset_bis = (it_ets!=tm1_edge_to_tm2_faces.end())?&(it_ets->second):nullptr; cip_handle_case_vertex(node_id,fset_bis,*it_edge,h_2,tm1,tm2); } else diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Corefinement/intersection_nodes.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Corefinement/intersection_nodes.h index 3dc0623edf3..49162e70a44 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Corefinement/intersection_nodes.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Corefinement/intersection_nodes.h @@ -262,7 +262,7 @@ public: CGAL_assertion(inter_res != boost::none); const Exact_kernel::Point_3* pt = boost::get(&(*inter_res)); - CGAL_assertion(pt!=NULL); + CGAL_assertion(pt!=nullptr); add_new_node(*pt); } @@ -379,7 +379,7 @@ public: CGAL_assertion(inter_res != boost::none); const Point_3* pt = boost::get(&(*inter_res)); - CGAL_assertion(pt!=NULL); + CGAL_assertion(pt!=nullptr); add_new_node(*pt); } diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Hole_filling/Triangulate_hole_polyline.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Hole_filling/Triangulate_hole_polyline.h index 3cc8910c252..251edc2f640 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Hole_filling/Triangulate_hole_polyline.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Hole_filling/Triangulate_hole_polyline.h @@ -42,6 +42,7 @@ #include #include +#include #include namespace CGAL { @@ -1106,9 +1107,10 @@ private: if(W.get(0, n-1) == Weight::NOT_VALID()) { #ifndef CGAL_TEST_SUITE - CGAL_warning(!"Returning no output. Filling hole with extra triangles is not successful!"); + CGAL_warning(!"Returning no output using Delaunay triangulation.\n Falling back to the general Triangulation framework."); #else - std::cerr << "W: Returning no output. Filling hole with extra triangles is not successful!\n"; + std::cerr << "W: Returning no output using Delaunay triangulation.\n" + << "Falling back to the general Triangulation framework.\n"; #endif return Weight::NOT_VALID(); } @@ -1242,6 +1244,13 @@ triangulate_hole_polyline(const PointRange1& points, use_delaunay_triangulation ? Fill_DT().operator()(P,Q,tracer,WC) : #endif Fill().operator()(P,Q,tracer,WC); + +#ifndef CGAL_HOLE_FILLING_DO_NOT_USE_DT3 + if (use_delaunay_triangulation + && w == WeightCalculator::Weight::NOT_VALID()) + w = Fill().operator()(P, Q, tracer, WC); +#endif + #ifdef CGAL_PMP_HOLE_FILLING_DEBUG std::cerr << w << std::endl; #endif diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Isotropic_remeshing/remesh_impl.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Isotropic_remeshing/remesh_impl.h index 87370ea3cb8..e2e70c66398 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Isotropic_remeshing/remesh_impl.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Isotropic_remeshing/remesh_impl.h @@ -108,7 +108,7 @@ namespace internal { Border_constraint_pmap() : border_edges_ptr(new std::set() ) - , pmesh_ptr_(NULL) + , pmesh_ptr_(nullptr) {} template @@ -129,7 +129,7 @@ namespace internal { friend bool get(const Border_constraint_pmap& map, const edge_descriptor& e) { - CGAL_assertion(map.pmesh_ptr_!=NULL); + CGAL_assertion(map.pmesh_ptr_!=nullptr); return map.border_edges_ptr->count(e)!=0; } @@ -137,7 +137,7 @@ namespace internal { const edge_descriptor& e, const bool is) { - CGAL_assertion(map.pmesh_ptr_ != NULL); + CGAL_assertion(map.pmesh_ptr_ != nullptr); if (is) map.border_edges_ptr->insert(e); else @@ -1142,7 +1142,7 @@ private: const Self* remesher_ptr_; Patch_id_property_map() - : remesher_ptr_(NULL) {} + : remesher_ptr_(nullptr) {} Patch_id_property_map(const Self& remesher) : remesher_ptr_(&remesher) {} diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/intersection.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/intersection.h index 3d6cca8ddfe..4029676a33c 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/intersection.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/intersection.h @@ -1471,7 +1471,7 @@ struct Mesh_callback report_overlap(report_overlap), nps(nps), gt(gt) { std::size_t size = std::distance(meshes.begin(), meshes.end()); - trees = std::vector(size, NULL); + trees = std::vector(size, nullptr); points_of_interest.resize(size); } diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/repair_polygon_soup.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/repair_polygon_soup.h index 27892d27aaa..a36a29733ba 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/repair_polygon_soup.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/repair_polygon_soup.h @@ -422,24 +422,46 @@ std::size_t remove_isolated_points_in_polygon_soup(PointRange& points, } // Move all the unused points to the end - std::size_t swap_position = ini_points_size - 1; - for(std::size_t i=0; i= first_unused_pos) + break; + if(!visited[i]) { + std::size_t swap_position = first_unused_pos - 1; + CGAL_assertion(swap_position < ini_points_size); + #ifdef CGAL_PMP_REPAIR_POLYGON_SOUP_VERBOSE_PP std::cout << "points[" << i << "] = " << points[i] << " is isolated" << std::endl; + std::cout << " swapping it to pos: " << swap_position << std::endl; #endif std::swap(points[swap_position], points[i]); + + // Swap manually because MSVC is unhappy with std::swap(v[i], v[j]) and a vector, + // and Apple Clang is unhappy with v.swap(v[i], v[j])... + const bool tmp = visited[swap_position]; + visited[swap_position] = visited[i]; + visited[i] = tmp; + id_remapping[swap_position] = i; - --swap_position; + --first_unused_pos; + } + else + { + ++i; } } // Actually remove the unused points - ++swap_position; // 'swap_position' points at the first element to remove - const std::size_t removed_points_n = ini_points_size - swap_position; - points.erase(points.begin() + swap_position, points.end()); + const std::size_t removed_points_n = ini_points_size - first_unused_pos; + + // Pointless to remap everything if nothing has changed, so early exit + if(removed_points_n == 0) + return removed_points_n; + + points.erase(points.begin() + first_unused_pos, points.end()); // Renumber the polygons for(P_ID polygon_index=0, end=polygons.size(); polygon_index!=end; ++polygon_index) @@ -917,6 +939,18 @@ std::size_t merge_duplicate_polygons_in_polygon_soup(const PointRange& points, const std::size_t init_polygons_n = polygons.size(); std::size_t swap_position = init_polygons_n - 1; + std::vector treated(init_polygons_n, false); + + // PID_to_pos is to go from a polygon ID to its position in the polygons vector, and pos_to_PID + // is to move the other way + std::vector PID_to_pos(init_polygons_n); + std::vector pos_to_PID(init_polygons_n); + for(std::size_t i=0, ps=polygons.size(); i& duplicate_polygons = all_duplicate_polygons.back(); @@ -925,10 +959,30 @@ std::size_t merge_duplicate_polygons_in_polygon_soup(const PointRange& points, std::size_t i = erase_all_duplicates ? 0 : 1; for(; i -std::size_t stitch_boundary_cycles(PolygonMesh& pm, - const NamedParameters& np) +std::size_t stitch_boundary_cycle(const typename boost::graph_traits::halfedge_descriptor h, + PolygonMesh& pm, + const NamedParameters& np) { using boost::choose_param; using boost::get_param; @@ -558,9 +570,6 @@ std::size_t stitch_boundary_cycles(PolygonMesh& pm, VPMap vpm = choose_param(get_param(np, internal_np::vertex_point), get_const_property_map(vertex_point, pm)); - std::vector boundary_cycles; - extract_boundary_cycles(pm, std::back_inserter(boundary_cycles)); - std::size_t stitched_boundary_cycles_n = 0; // A boundary cycle might need to be stitched starting from different extremities @@ -573,62 +582,121 @@ std::size_t stitch_boundary_cycles(PolygonMesh& pm, // so we mark which edges have been stitched std::unordered_set stitched_hedges; - for(halfedge_descriptor h : boundary_cycles) + std::vector stitching_starting_points; + halfedge_descriptor hn = next(h, pm); + while(hn != h) { - std::vector stitching_starting_points; + if((get(vpm, source(hn, pm)) == get(vpm, target(next(hn, pm), pm))) && + (get(vpm, source(hn, pm)) != get(vpm, target(hn, pm)))) // ignore degenerate edges + stitching_starting_points.push_back(hn); + + hn = next(hn, pm); + } + + for(std::size_t i=0, end=stitching_starting_points.size(); i 0) // already treated + continue; + + std::vector > hedges_to_stitch; + halfedge_descriptor hn = next(h, pm); - while(hn != h) + bool do_stitching = true; + do { - if(get(vpm, source(hn, pm)) == get(vpm, target(next(hn, pm), pm))) - stitching_starting_points.push_back(hn); + // Don't want to create an invalid polygon mesh, even if the geometry allows it + if(face(opposite(h, pm), pm) == face(opposite(hn, pm), pm)) + break; + hedges_to_stitch.push_back(std::make_pair(h, hn)); + +#ifdef CGAL_PMP_STITCHING_DEBUG + std::cout << "Stitch halfegdes: " + << h << "(" << get(vpm, source(h, pm)) << ") - (" << get(vpm, target(h, pm)) << ") and " + << hn << "(" << get(vpm, source(hn, pm)) << ") - (" << get(vpm, target(hn, pm)) << ")" << std::endl; +#endif + + stitched_hedges.insert(h); + stitched_hedges.insert(hn); + + if(next(hn, pm) == h) + break; + + h = prev(h, pm); hn = next(hn, pm); + + if((get(vpm, source(h, pm)) != get(vpm, target(hn, pm))) || + (get(vpm, source(hn, pm)) == get(vpm, target(hn, pm)))) // ignore degenerate edges + do_stitching = false; } + while(do_stitching); - for(std::size_t i=0, end=stitching_starting_points.size(); i 0) // already treated - continue; - - std::vector > hedges_to_stitch; - - halfedge_descriptor hn = next(h, pm); - bool do_stitching = true; - do - { - hedges_to_stitch.push_back(std::make_pair(h, hn)); - stitched_hedges.insert(h); - stitched_hedges.insert(hn); - - if(next(hn, pm) == h) - break; - - h = prev(h, pm); - hn = next(hn, pm); - - if(get(vpm, source(h, pm)) != get(vpm, target(hn, pm))) - do_stitching = false; - } - while(do_stitching); - internal::stitch_borders_impl(pm, hedges_to_stitch); - ++stitched_boundary_cycles_n; + stitched_boundary_cycles_n += hedges_to_stitch.size(); } } return stitched_boundary_cycles_n; } +template +std::size_t stitch_boundary_cycle(const typename boost::graph_traits::halfedge_descriptor h, + PolygonMesh& pm) +{ + return stitch_boundary_cycle(h, pm, CGAL::parameters::all_default()); +} + +/// \ingroup PMP_repairing_grp +/// +/// Stitches together, whenever possible, two halfedges belonging to the same boundary cycle. +/// Two border halfedges `h1` and `h2` can be stitched +/// if the points associated to the source and target vertices of `h1` are +/// the same as those of the target and source vertices of `h2` respectively. +/// +/// \tparam PolygonMesh a model of `MutableFaceGraph` +/// \tparam NamedParameters a sequence of \ref pmp_namedparameters "Named Parameters" +/// +/// \param pm the polygon mesh to be stitched +/// \param np optional sequence of \ref pmp_namedparameters "Named Parameters" among the ones listed below +/// +/// \cgalNamedParamsBegin +/// \cgalParamBegin{vertex_point_map} the property map with the points associated to the vertices of `pmesh`. +/// If this parameter is omitted, an internal property map for `CGAL::vertex_point_t` must be available in `PolygonMesh`. +/// \cgalParamEnd +/// \cgalNamedParamsEnd +/// +/// \returns the number of pairs of halfedges that were stitched. +/// +/// \sa `stitch_boundary_cycle()` +/// \sa `stitch_borders()` +/// +template +std::size_t stitch_boundary_cycles(PolygonMesh& pm, + const NamedParameters& np) +{ + typedef typename boost::graph_traits::halfedge_descriptor halfedge_descriptor; + + std::vector boundary_cycles; + extract_boundary_cycles(pm, std::back_inserter(boundary_cycles)); + + std::size_t stitched_boundary_cycles_n = 0; + + for(halfedge_descriptor h : boundary_cycles) + stitched_boundary_cycles_n += stitch_boundary_cycle(h, pm, np); + + return stitched_boundary_cycles_n; +} + template std::size_t stitch_boundary_cycles(PolygonMesh& pm) { return stitch_boundary_cycles(pm, CGAL::parameters::all_default()); } -} //end of namespace internal - /*! * \ingroup PMP_repairing_grp * Stitches together border halfedges in a polygon mesh. @@ -636,7 +704,7 @@ std::size_t stitch_boundary_cycles(PolygonMesh& pm) * For each pair `p` in this vector, `p.second` and its opposite will be removed * from `pmesh`. * -* @tparam PolygonMesh a model of `FaceListGraph` and `MutableFaceGraph` +* @tparam PolygonMesh a model of `MutableFaceGraph` * @tparam HalfedgePairsRange a range of * `std::pair::%halfedge_descriptor, * boost::graph_traits::%halfedge_descriptor>`, @@ -683,7 +751,10 @@ void stitch_borders(PolygonMesh& pmesh, /// Default value is `false`.\cgalParamEnd /// \cgalParamBegin{face_index_map} a property map containing the index of each face of `pmesh` \cgalParamEnd /// \cgalNamedParamsEnd - +/// +/// @sa `stitch_boundary_cycle()` +/// @sa `stitch_boundary_cycles()` +/// template void stitch_borders(PolygonMesh& pmesh, const CGAL_PMP_NP_CLASS& np) { @@ -698,7 +769,7 @@ void stitch_borders(PolygonMesh& pmesh, const CGAL_PMP_NP_CLASS& np) VPMap vpm = choose_param(get_param(np, internal_np::vertex_point), get_const_property_map(vertex_point, pmesh)); - internal::stitch_boundary_cycles(pmesh, np); + stitch_boundary_cycles(pmesh, np); internal::collect_duplicated_stitchable_boundary_edges(pmesh, std::back_inserter(hedge_pairs_to_stitch), @@ -706,7 +777,7 @@ void stitch_borders(PolygonMesh& pmesh, const CGAL_PMP_NP_CLASS& np) vpm, np); stitch_borders(pmesh, hedge_pairs_to_stitch); - internal::stitch_boundary_cycles(pmesh, np); + stitch_boundary_cycles(pmesh, np); } diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/triangulate_hole.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/triangulate_hole.h index 3d0e89414fe..0fe379626c1 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/triangulate_hole.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/triangulate_hole.h @@ -65,7 +65,9 @@ namespace Polygon_mesh_processing { \cgalParamBegin{vertex_point_map} the property map with the points associated to the vertices of `pmesh`. If this parameter is omitted, an internal property map for `CGAL::vertex_point_t` must be available in `PolygonMesh`\cgalParamEnd - \cgalParamBegin{use_delaunay_triangulation} if `true`, use the Delaunay triangulation facet search space \cgalParamEnd + \cgalParamBegin{use_delaunay_triangulation} if `true`, use the Delaunay triangulation facet search space. + If no valid triangulation can be found in this search space, the algorithm falls back to the + non-Delaunay triangulations search space to find a solution \cgalParamEnd \cgalParamBegin{geom_traits} a geometric traits class instance \cgalParamEnd \cgalNamedParamsEnd @@ -156,8 +158,11 @@ namespace Polygon_mesh_processing { \cgalParamBegin{vertex_point_map} the property map with the points associated to the vertices of `pmesh`. If this parameter is omitted, an internal property map for `CGAL::vertex_point_t` should be available in `PolygonMesh`\cgalParamEnd - \cgalParamBegin{density_control_factor} factor to control density of the ouput mesh, where larger values cause denser refinements, as in `refine()` \cgalParamEnd - \cgalParamBegin{use_delaunay_triangulation} if `true`, use the Delaunay triangulation facet search space \cgalParamEnd + \cgalParamBegin{density_control_factor} factor to control density of the ouput mesh, where larger values + cause denser refinements, as in `refine()` \cgalParamEnd + \cgalParamBegin{use_delaunay_triangulation} if `true`, use the Delaunay triangulation facet search space. + If no valid triangulation can be found in this search space, the algorithm falls back to the + non-Delaunay triangulations search space to find a solution \cgalParamEnd \cgalParamBegin{geom_traits} a geometric traits class instance \cgalParamEnd \cgalNamedParamsEnd @@ -224,8 +229,11 @@ namespace Polygon_mesh_processing { If this parameter is omitted, an internal property map for `CGAL::vertex_point_t` should be available in `PolygonMesh` \cgalParamEnd - \cgalParamBegin{use_delaunay_triangulation} if `true`, use the Delaunay triangulation facet search space \cgalParamEnd - \cgalParamBegin{density_control_factor} factor to control density of the ouput mesh, where larger values cause denser refinements, as in `refine()` \cgalParamEnd + \cgalParamBegin{use_delaunay_triangulation} if `true`, use the Delaunay triangulation facet search space. + If no valid triangulation can be found in this search space, the algorithm falls back to the + non-Delaunay triangulations search space to find a solution \cgalParamEnd + \cgalParamBegin{density_control_factor} factor to control density of the ouput mesh, where larger values + cause denser refinements, as in `refine()` \cgalParamEnd \cgalParamBegin{fairing_continuity} tangential continuity of the output surface patch \cgalParamEnd \cgalParamBegin{sparse_linear_solver} an instance of the sparse linear solver used for fairing \cgalParamEnd \cgalParamBegin{geom_traits} a geometric traits class instance \cgalParamEnd @@ -317,7 +325,9 @@ namespace Polygon_mesh_processing { @param np optional sequence of \ref pmp_namedparameters "Named Parameters" among the ones listed below \cgalNamedParamsBegin - \cgalParamBegin{use_delaunay_triangulation} if `true`, use the Delaunay triangulation facet search space \cgalParamEnd + \cgalParamBegin{use_delaunay_triangulation} if `true`, use the Delaunay triangulation facet search space. + If no valid triangulation can be found in this search space, the algorithm falls back to the + non-Delaunay triangulations search space to find a solution \cgalParamEnd \cgalParamBegin{geom_traits} a geometric traits class instance \cgalParamEnd \cgalNamedParamsEnd diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_slicer.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_slicer.h index 095a2d5e8ab..9517669d729 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_slicer.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_slicer.h @@ -38,6 +38,8 @@ #include #include +#include +#include #include #include @@ -85,7 +87,13 @@ template::type, class AABBTree = AABB_tree< AABB_traits > >, + AABB_halfedge_graph_segment_primitive::type >::type, + Default, + VertexPointMap>::type> > >, bool UseParallelPlaneOptimization=true> class Polygon_mesh_slicer { @@ -392,6 +400,9 @@ class Polygon_mesh_slicer public: + /// the AABB-tree type used internally + typedef AABBTree AABB_tree; + /** * Constructor using `edges(tmesh)` to initialize the * internal `AABB_tree`. diff --git a/Polygon_mesh_processing/include/CGAL/Rigid_triangle_mesh_collision_detection.h b/Polygon_mesh_processing/include/CGAL/Rigid_triangle_mesh_collision_detection.h index 1ee981abfdb..c8b84fe38ca 100644 --- a/Polygon_mesh_processing/include/CGAL/Rigid_triangle_mesh_collision_detection.h +++ b/Polygon_mesh_processing/include/CGAL/Rigid_triangle_mesh_collision_detection.h @@ -117,7 +117,7 @@ class Rigid_triangle_mesh_collision_detection m_id_pool.push_back(m_free_id); ++m_free_id; m_own_aabb_trees.resize(m_free_id); - m_aabb_trees.resize(m_free_id, NULL); + m_aabb_trees.resize(m_free_id, nullptr); m_is_closed.resize(m_free_id); m_points_per_cc.resize(m_free_id); m_traversal_traits.resize(m_free_id); @@ -238,7 +238,7 @@ public: get_const_property_map(boost::vertex_point, tm) ); // now add the mesh std::size_t id = get_id_for_new_mesh(); - CGAL_assertion( m_aabb_trees[id] == NULL ); + CGAL_assertion( m_aabb_trees[id] == nullptr ); m_is_closed[id] = is_closed(tm); m_own_aabb_trees[id] = true; Tree* t = new Tree(boost::begin(faces(tm)), boost::end(faces(tm)), tm, vpm); @@ -282,7 +282,7 @@ public: std::size_t add_mesh(const AABB_tree& tree, const TriangleMesh& tm, const NamedParameters& np) { std::size_t id = get_id_for_new_mesh(); - CGAL_assertion( m_aabb_trees[id] == NULL ); + CGAL_assertion( m_aabb_trees[id] == nullptr ); m_is_closed[id] = is_closed(tm); m_own_aabb_trees[id] = false ; m_aabb_trees[id] = const_cast(&tree); @@ -296,7 +296,7 @@ public: */ void set_transformation(std::size_t mesh_id, const Aff_transformation_3& aff_trans) { - CGAL_assertion(m_aabb_trees[mesh_id] != NULL); + CGAL_assertion(m_aabb_trees[mesh_id] != nullptr); m_traversal_traits[mesh_id].set_transformation(aff_trans); #if CGAL_RMCD_CACHE_BOXES m_bboxes_is_invalid.set(mesh_id); @@ -327,7 +327,7 @@ public: std::vector get_all_intersections(std::size_t mesh_id, const MeshIdRange& ids) const { - CGAL_assertion(m_aabb_trees[mesh_id] != NULL); + CGAL_assertion(m_aabb_trees[mesh_id] != nullptr); CGAL::Interval_nt_advanced::Protector protector; #if CGAL_RMCD_CACHE_BOXES update_bboxes(); @@ -337,7 +337,7 @@ public: // TODO: use a non-naive version for(std::size_t k : ids) { - CGAL_assertion(m_aabb_trees[k] != NULL); + CGAL_assertion(m_aabb_trees[k] != nullptr); if(k==mesh_id) continue; if (does_A_intersect_B(mesh_id, k)) @@ -381,7 +381,7 @@ public: std::vector > get_all_intersections_and_inclusions(std::size_t mesh_id, const MeshIdRange& ids) const { - CGAL_assertion(m_aabb_trees[mesh_id] != NULL); + CGAL_assertion(m_aabb_trees[mesh_id] != nullptr); CGAL::Interval_nt_advanced::Protector protector; #if CGAL_RMCD_CACHE_BOXES update_bboxes(); @@ -391,7 +391,7 @@ public: // TODO: use a non-naive version for(std::size_t k : ids) { - CGAL_assertion(m_aabb_trees[k] != NULL); + CGAL_assertion(m_aabb_trees[k] != nullptr); if(k==mesh_id) continue; if (does_A_intersect_B(mesh_id, k)) @@ -457,7 +457,7 @@ public: if (m_own_aabb_trees[mesh_id]) delete m_aabb_trees[mesh_id]; m_points_per_cc[mesh_id].clear(); - m_aabb_trees[mesh_id] = NULL; + m_aabb_trees[mesh_id] = nullptr; if (m_id_pool[m_free_id-1]!=mesh_id) std::swap(m_id_pool[m_free_id-1], *itf); --m_free_id; @@ -487,7 +487,7 @@ public: bool is_valid_index(std::size_t mesh_id) { if (mesh_id >= m_id_pool.size()) return false; - return m_aabb_trees[mesh_id] != NULL; + return m_aabb_trees[mesh_id] != nullptr; } /// \name Helper Static Function @@ -601,7 +601,7 @@ public: const std::vector& points_per_cc) { std::size_t id = get_id_for_new_mesh(); - CGAL_assertion( m_aabb_trees[id] == NULL ); + CGAL_assertion( m_aabb_trees[id] == nullptr ); m_is_closed[id] = is_closed; m_own_aabb_trees[id] = false ; m_aabb_trees[id] = const_cast(&tree); diff --git a/Polygon_mesh_processing/test/Polygon_mesh_processing/test_stitching.cpp b/Polygon_mesh_processing/test/Polygon_mesh_processing/test_stitching.cpp index f2cdf958b64..cee1afbba01 100644 --- a/Polygon_mesh_processing/test/Polygon_mesh_processing/test_stitching.cpp +++ b/Polygon_mesh_processing/test/Polygon_mesh_processing/test_stitching.cpp @@ -18,7 +18,8 @@ namespace params = CGAL::parameters; typedef CGAL::Exact_predicates_inexact_constructions_kernel EPICK; typedef CGAL::Exact_predicates_exact_constructions_kernel EPECK; -void test_stitch_boundary_cycles(const char* fname) +void test_stitch_boundary_cycles(const char* fname, + const std::size_t expected_n) { typedef CGAL::Surface_mesh Mesh; @@ -29,8 +30,8 @@ void test_stitch_boundary_cycles(const char* fname) return; } - std::size_t res = PMP::internal::stitch_boundary_cycles(mesh); - assert(res > 0); + std::size_t res = PMP::stitch_boundary_cycles(mesh); + assert(res == expected_n); assert(is_valid(mesh)); } @@ -134,8 +135,8 @@ void bug_test() int main() { - test_stitch_boundary_cycles("data_stitching/boundary_cycle.off"); - test_stitch_boundary_cycles("data_stitching/boundary_cycle_2.off"); + test_stitch_boundary_cycles("data_stitching/boundary_cycle.off", 5); + test_stitch_boundary_cycles("data_stitching/boundary_cycle_2.off", 2); test_polyhedron("data_stitching/full_border.off"); test_polyhedron("data_stitching/full_border.off"); diff --git a/Polyhedron/demo/Polyhedron/CMakeLists.txt b/Polyhedron/demo/Polyhedron/CMakeLists.txt index aaf8abd3c1a..7b4a38c2349 100644 --- a/Polyhedron/demo/Polyhedron/CMakeLists.txt +++ b/Polyhedron/demo/Polyhedron/CMakeLists.txt @@ -68,9 +68,6 @@ find_package(Qt5 COMPONENTS OpenGL Script OPTIONAL_COMPONENTS ScriptTools) -# Find OpenGL -find_package(OpenGL) - if(Qt5_FOUND) add_definitions(-DQT_NO_KEYWORDS) @@ -128,7 +125,7 @@ endif() -if(CGAL_Qt5_FOUND AND Qt5_FOUND AND OPENGL_FOUND ) +if(CGAL_Qt5_FOUND AND Qt5_FOUND) include(${CGAL_USE_FILE}) qt5_wrap_ui( MainWindowUI_files MainWindow.ui) @@ -395,7 +392,7 @@ add_to_cached_list( CGAL_EXECUTABLE_TARGETS CGAL_Classification ) configure_file(CGAL_polyhedron_demoConfig.cmake.in CGAL_polyhedron_demoConfig.cmake) #TO DO script the activation of all the plugins. -else (CGAL_Qt5_FOUND AND Qt5_FOUND AND OPENGL_FOUND ) +else (CGAL_Qt5_FOUND AND Qt5_FOUND) set(POLYHEDRON_MISSING_DEPS "") @@ -407,11 +404,7 @@ else (CGAL_Qt5_FOUND AND Qt5_FOUND AND OPENGL_FOUND ) set(POLYHEDRON_MISSING_DEPS "Qt5, ${POLYHEDRON_MISSING_DEPS}") endif() - if(NOT OPENGL_FOUND) - set(POLYHEDRON_MISSING_DEPS "OpenGL, ${POLYHEDRON_MISSING_DEPS}") - endif() - message(STATUS "NOTICE: This demo requires ${POLYHEDRON_MISSING_DEPS}and will not be compiled.") -endif (CGAL_Qt5_FOUND AND Qt5_FOUND AND OPENGL_FOUND ) +endif (CGAL_Qt5_FOUND AND Qt5_FOUND) diff --git a/Polyhedron/demo/Polyhedron/Plugins/Classification/Cluster_classification.cpp b/Polyhedron/demo/Polyhedron/Plugins/Classification/Cluster_classification.cpp index 516c56bbed4..d962e2f491d 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Classification/Cluster_classification.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Classification/Cluster_classification.cpp @@ -276,8 +276,8 @@ Cluster_classification::Cluster_classification(Scene_points_with_normal_item* po for (std::set >::iterator it = adjacencies.begin(); it != adjacencies.end(); ++ it) { - m_clusters[std::size_t(it->first)].neighbors.push_back (std::size_t(it->second)); - m_clusters[std::size_t(it->second)].neighbors.push_back (std::size_t(it->first)); + m_clusters[std::size_t(it->first)].neighbors->push_back (std::size_t(it->second)); + m_clusters[std::size_t(it->second)].neighbors->push_back (std::size_t(it->first)); } } diff --git a/Polyhedron/demo/Polyhedron/Plugins/PMP/CMakeLists.txt b/Polyhedron/demo/Polyhedron/Plugins/PMP/CMakeLists.txt index 5779ff7f6c4..2adca3ebe78 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PMP/CMakeLists.txt +++ b/Polyhedron/demo/Polyhedron/Plugins/PMP/CMakeLists.txt @@ -64,7 +64,7 @@ polyhedron_demo_plugin(polyhedron_stitching_plugin Polyhedron_stitching_plugin) target_link_libraries(polyhedron_stitching_plugin PUBLIC scene_surface_mesh_item scene_polylines_item) qt5_wrap_ui( selectionUI_FILES Selection_widget.ui) -polyhedron_demo_plugin(selection_plugin Selection_plugin ${selectionUI_FILES} KEYWORDS PolygonMesh IO Classification) +polyhedron_demo_plugin(selection_plugin Selection_plugin ${selectionUI_FILES} KEYWORDS PolygonMesh IO Classification Mesh_3) target_link_libraries(selection_plugin PUBLIC scene_selection_item scene_points_with_normal_item scene_polylines_item) polyhedron_demo_plugin(self_intersection_plugin Self_intersection_plugin) @@ -97,7 +97,7 @@ if(TBB_FOUND) endif() -polyhedron_demo_plugin(detect_sharp_edges_plugin Detect_sharp_edges_plugin) +polyhedron_demo_plugin(detect_sharp_edges_plugin Detect_sharp_edges_plugin KEYWORDS IO Mesh_3) target_link_libraries(detect_sharp_edges_plugin PUBLIC scene_surface_mesh_item) diff --git a/Polyhedron/include/CGAL/Polyhedron_copy_3.h b/Polyhedron/include/CGAL/Polyhedron_copy_3.h index f3a640d8fda..138780c75a0 100644 --- a/Polyhedron/include/CGAL/Polyhedron_copy_3.h +++ b/Polyhedron/include/CGAL/Polyhedron_copy_3.h @@ -83,7 +83,7 @@ Polyhedron_copy_3::operator()(HDS& target) { Halfedge_around_facet_const_circulator; Halfedge_around_facet_const_circulator hc = fi->facet_begin(); Halfedge_around_facet_const_circulator hc_end = hc; - CGAL_assertion( hc != NULL); + CGAL_assertion( hc != nullptr); do { B.add_vertex_to_facet( index[ hc->vertex()]); ++hc; diff --git a/Polyhedron/include/CGAL/Polyhedron_incremental_builder_3.h b/Polyhedron/include/CGAL/Polyhedron_incremental_builder_3.h index ef71376a8ca..eb62f75b8a1 100644 --- a/Polyhedron/include/CGAL/Polyhedron_incremental_builder_3.h +++ b/Polyhedron/include/CGAL/Polyhedron_incremental_builder_3.h @@ -362,7 +362,7 @@ protected: } size_type find_vertex( Vertex_handle v) { - // Returns 0 if v == NULL. + // Returns 0 if v == nullptr. if ( v == Vertex_handle() ) return 0; size_type n = 0; @@ -377,7 +377,7 @@ protected: } size_type find_facet( Face_handle f) { - // Returns 0 if f == NULL. + // Returns 0 if f == nullptr. if ( f == Face_handle()) return 0; size_type n = 0; diff --git a/Polyhedron_IO/include/CGAL/IO/PLY_writer.h b/Polyhedron_IO/include/CGAL/IO/PLY_writer.h index 1807899a040..052c6d196a9 100644 --- a/Polyhedron_IO/include/CGAL/IO/PLY_writer.h +++ b/Polyhedron_IO/include/CGAL/IO/PLY_writer.h @@ -142,7 +142,7 @@ namespace CGAL{ if(has_texture) { - BOOST_FOREACH(halfedge_descriptor hd, halfedges(mesh)) + for(halfedge_descriptor hd : halfedges(mesh)) { typedef std::tuple Super_tuple; Super_tuple t = diff --git a/Polyhedron_IO/include/CGAL/IO/reader_helpers.h b/Polyhedron_IO/include/CGAL/IO/reader_helpers.h index 7e6ebeb89ad..62e465a7e07 100644 --- a/Polyhedron_IO/include/CGAL/IO/reader_helpers.h +++ b/Polyhedron_IO/include/CGAL/IO/reader_helpers.h @@ -39,7 +39,7 @@ CGAL_GENERATE_MEMBER_DETECTOR(resize); // Typical container template void resize(Container& c, std::size_t size, - typename boost::enable_if_c::value>::type* = NULL) + typename boost::enable_if_c::value>::type* = nullptr) { c.resize(size); } @@ -50,7 +50,7 @@ void resize(Container& CGAL_assertion_code(array), std::size_t CGAL_assertion_co typename boost::enable_if< boost::mpl::and_< boost::mpl::not_ >, - has_size > >::type* = NULL) + has_size > >::type* = nullptr) { CGAL_assertion(array.size() == size); } @@ -60,7 +60,7 @@ template void resize(Container&, std::size_t, typename boost::disable_if< boost::mpl::or_, - has_size > >::type* = NULL) + has_size > >::type* = nullptr) { } diff --git a/Principal_component_analysis/include/CGAL/linear_least_squares_fitting_2.h b/Principal_component_analysis/include/CGAL/linear_least_squares_fitting_2.h index 202205d28e7..c4807719f85 100644 --- a/Principal_component_analysis/include/CGAL/linear_least_squares_fitting_2.h +++ b/Principal_component_analysis/include/CGAL/linear_least_squares_fitting_2.h @@ -54,7 +54,7 @@ linear_least_squares_fitting_2(InputIterator first, { typedef typename std::iterator_traits::value_type Value_type; return internal::linear_least_squares_fitting_2(first, beyond, line, - centroid,(Value_type*)NULL,kernel,tag, + centroid,(Value_type*)nullptr,kernel,tag, diagonalize_traits); } diff --git a/Principal_component_analysis/include/CGAL/linear_least_squares_fitting_3.h b/Principal_component_analysis/include/CGAL/linear_least_squares_fitting_3.h index b2bb157785d..ced32335f95 100644 --- a/Principal_component_analysis/include/CGAL/linear_least_squares_fitting_3.h +++ b/Principal_component_analysis/include/CGAL/linear_least_squares_fitting_3.h @@ -60,7 +60,7 @@ linear_least_squares_fitting_3(InputIterator first, { typedef typename std::iterator_traits::value_type Value_type; return internal::linear_least_squares_fitting_3(first, beyond, object, - centroid, (Value_type*) NULL, kernel, tag, + centroid, (Value_type*) nullptr, kernel, tag, diagonalize_traits); } diff --git a/Principal_component_analysis/include/CGAL/linear_least_squares_fitting_cuboids_3.h b/Principal_component_analysis/include/CGAL/linear_least_squares_fitting_cuboids_3.h index 5391e076d6e..07f832ca2b9 100644 --- a/Principal_component_analysis/include/CGAL/linear_least_squares_fitting_cuboids_3.h +++ b/Principal_component_analysis/include/CGAL/linear_least_squares_fitting_cuboids_3.h @@ -61,7 +61,7 @@ linear_least_squares_fitting_3(InputIterator first, // assemble covariance matrix typename DiagonalizeTraits::Covariance_matrix covariance = {{ 0., 0., 0., 0., 0., 0. }}; - assemble_covariance_matrix_3(first,beyond,covariance,c,k,(Iso_cuboid*) NULL,tag, diagonalize_traits); + assemble_covariance_matrix_3(first,beyond,covariance,c,k,(Iso_cuboid*) nullptr,tag, diagonalize_traits); // compute fitting plane return fitting_plane_3(covariance,c,plane,k,diagonalize_traits); @@ -93,7 +93,7 @@ linear_least_squares_fitting_3(InputIterator first, // assemble covariance matrix typename DiagonalizeTraits::Covariance_matrix covariance = {{ 0., 0., 0., 0., 0., 0. }}; - assemble_covariance_matrix_3(first,beyond,covariance,c,k,(Iso_cuboid*) NULL,tag,diagonalize_traits); + assemble_covariance_matrix_3(first,beyond,covariance,c,k,(Iso_cuboid*) nullptr,tag,diagonalize_traits); // compute fitting plane return fitting_plane_3(covariance,c,plane,k,diagonalize_traits); @@ -142,7 +142,7 @@ linear_least_squares_fitting_3(InputIterator first, } // compute fitting plane - return linear_least_squares_fitting_3(segments.begin(),segments.end(),plane,c,(Segment*)NULL,k,tag, + return linear_least_squares_fitting_3(segments.begin(),segments.end(),plane,c,(Segment*)nullptr,k,tag, diagonalize_traits); } // end linear_least_squares_fitting_cuboids_3 @@ -184,7 +184,7 @@ linear_least_squares_fitting_3(InputIterator first, } // compute fitting plane - return linear_least_squares_fitting_3(points.begin(),points.end(),plane,c,(Point*)NULL,k,tag, + return linear_least_squares_fitting_3(points.begin(),points.end(),plane,c,(Point*)nullptr,k,tag, diagonalize_traits); } // end linear_least_squares_fitting_cuboids_3 @@ -213,7 +213,7 @@ linear_least_squares_fitting_3(InputIterator first, // assemble covariance matrix typename DiagonalizeTraits::Covariance_matrix covariance = {{ 0., 0., 0., 0., 0., 0. }}; - assemble_covariance_matrix_3(first,beyond,covariance,c,k,(Iso_cuboid*) NULL,tag,diagonalize_traits); + assemble_covariance_matrix_3(first,beyond,covariance,c,k,(Iso_cuboid*) nullptr,tag,diagonalize_traits); // compute fitting line return fitting_line_3(covariance,c,line,k,diagonalize_traits); @@ -244,7 +244,7 @@ linear_least_squares_fitting_3(InputIterator first, // assemble covariance matrix typename DiagonalizeTraits::Covariance_matrix covariance = {{ 0., 0., 0., 0., 0., 0. }}; - assemble_covariance_matrix_3(first,beyond,covariance,c,k,(Iso_cuboid*) NULL,tag, diagonalize_traits); + assemble_covariance_matrix_3(first,beyond,covariance,c,k,(Iso_cuboid*) nullptr,tag, diagonalize_traits); // compute fitting line return fitting_line_3(covariance,c,line,k,diagonalize_traits); @@ -293,7 +293,7 @@ linear_least_squares_fitting_3(InputIterator first, } // compute fitting line - return linear_least_squares_fitting_3(segments.begin(),segments.end(),line,c,(Segment*)NULL,k,tag, + return linear_least_squares_fitting_3(segments.begin(),segments.end(),line,c,(Segment*)nullptr,k,tag, diagonalize_traits); } // end linear_least_squares_fitting_cuboids_3 @@ -335,7 +335,7 @@ linear_least_squares_fitting_3(InputIterator first, } // compute fitting line - return linear_least_squares_fitting_3(points.begin(),points.end(),line,c,(Point*)NULL,k,tag, + return linear_least_squares_fitting_3(points.begin(),points.end(),line,c,(Point*)nullptr,k,tag, diagonalize_traits); } // end linear_least_squares_fitting_cuboids_3 diff --git a/Principal_component_analysis/include/CGAL/linear_least_squares_fitting_points_3.h b/Principal_component_analysis/include/CGAL/linear_least_squares_fitting_points_3.h index a8a3cc283d9..2a69ba40b52 100644 --- a/Principal_component_analysis/include/CGAL/linear_least_squares_fitting_points_3.h +++ b/Principal_component_analysis/include/CGAL/linear_least_squares_fitting_points_3.h @@ -60,7 +60,7 @@ linear_least_squares_fitting_3(InputIterator first, // assemble covariance matrix typename DiagonalizeTraits::Covariance_matrix covariance = {{ 0., 0., 0., 0., 0., 0. }}; - assemble_covariance_matrix_3(first,beyond,covariance,c,k,(Point*) NULL,tag, diagonalize_traits); + assemble_covariance_matrix_3(first,beyond,covariance,c,k,(Point*) nullptr,tag, diagonalize_traits); // compute fitting plane return fitting_plane_3(covariance,c,plane,k,diagonalize_traits); @@ -93,7 +93,7 @@ linear_least_squares_fitting_3(InputIterator first, // assemble covariance matrix typename DiagonalizeTraits::Covariance_matrix covariance = {{ 0., 0., 0., 0., 0., 0. }}; - assemble_covariance_matrix_3(first,beyond,covariance,c,k,(Point*) NULL,tag, diagonalize_traits); + assemble_covariance_matrix_3(first,beyond,covariance,c,k,(Point*) nullptr,tag, diagonalize_traits); // compute fitting line return fitting_line_3(covariance,c,line,k,diagonalize_traits); diff --git a/Principal_component_analysis/include/CGAL/linear_least_squares_fitting_segments_2.h b/Principal_component_analysis/include/CGAL/linear_least_squares_fitting_segments_2.h index 80b830a1195..853911261cc 100644 --- a/Principal_component_analysis/include/CGAL/linear_least_squares_fitting_segments_2.h +++ b/Principal_component_analysis/include/CGAL/linear_least_squares_fitting_segments_2.h @@ -165,7 +165,7 @@ linear_least_squares_fitting_2(InputIterator first, points.push_back(s[0]); points.push_back(s[1]); } - return linear_least_squares_fitting_2(points.begin(),points.end(),line,c,k,(Point*)NULL,tag, + return linear_least_squares_fitting_2(points.begin(),points.end(),line,c,k,(Point*)nullptr,tag, diagonalize_traits); } // end linear_least_squares_fitting_2 for segment set with 1D tag diff --git a/Principal_component_analysis/include/CGAL/linear_least_squares_fitting_segments_3.h b/Principal_component_analysis/include/CGAL/linear_least_squares_fitting_segments_3.h index a70c2575198..3e153b6033f 100644 --- a/Principal_component_analysis/include/CGAL/linear_least_squares_fitting_segments_3.h +++ b/Principal_component_analysis/include/CGAL/linear_least_squares_fitting_segments_3.h @@ -60,7 +60,7 @@ linear_least_squares_fitting_3(InputIterator first, // assemble covariance matrix typename DiagonalizeTraits::Covariance_matrix covariance = {{ 0., 0., 0., 0., 0., 0. }}; - assemble_covariance_matrix_3(first,beyond,covariance,c,k,(Segment*) NULL,tag, diagonalize_traits); + assemble_covariance_matrix_3(first,beyond,covariance,c,k,(Segment*) nullptr,tag, diagonalize_traits); // compute fitting plane return fitting_plane_3(covariance,c,plane,k,diagonalize_traits); @@ -98,7 +98,7 @@ linear_least_squares_fitting_3(InputIterator first, } // compute fitting plane - return linear_least_squares_fitting_3(points.begin(),points.end(),plane,c,(Point*)NULL,k,tag, + return linear_least_squares_fitting_3(points.begin(),points.end(),plane,c,(Point*)nullptr,k,tag, diagonalize_traits); } // end linear_least_squares_fitting_segments_3 @@ -127,7 +127,7 @@ linear_least_squares_fitting_3(InputIterator first, // assemble covariance matrix typename DiagonalizeTraits::Covariance_matrix covariance = {{ 0., 0., 0., 0., 0., 0. }}; - assemble_covariance_matrix_3(first,beyond,covariance,c,k,(Segment*) NULL,tag, diagonalize_traits); + assemble_covariance_matrix_3(first,beyond,covariance,c,k,(Segment*) nullptr,tag, diagonalize_traits); // compute fitting line return fitting_line_3(covariance,c,line,k,diagonalize_traits); @@ -165,7 +165,7 @@ linear_least_squares_fitting_3(InputIterator first, } // compute fitting plane - return linear_least_squares_fitting_3(points.begin(),points.end(),line,c,(Point*)NULL,k,tag, + return linear_least_squares_fitting_3(points.begin(),points.end(),line,c,(Point*)nullptr,k,tag, diagonalize_traits); } // end linear_least_squares_fitting_segments_3 diff --git a/Principal_component_analysis/include/CGAL/linear_least_squares_fitting_spheres_3.h b/Principal_component_analysis/include/CGAL/linear_least_squares_fitting_spheres_3.h index c9a6f7192fc..5782b62923a 100644 --- a/Principal_component_analysis/include/CGAL/linear_least_squares_fitting_spheres_3.h +++ b/Principal_component_analysis/include/CGAL/linear_least_squares_fitting_spheres_3.h @@ -58,7 +58,7 @@ linear_least_squares_fitting_3(InputIterator first, // assemble covariance matrix typename DiagonalizeTraits::Covariance_matrix covariance = {{ 0., 0., 0., 0., 0., 0. }}; - assemble_covariance_matrix_3(first,beyond,covariance,c,k,(Sphere*) NULL,tag, diagonalize_traits); + assemble_covariance_matrix_3(first,beyond,covariance,c,k,(Sphere*) nullptr,tag, diagonalize_traits); // compute fitting plane return fitting_plane_3(covariance,c,plane,k,diagonalize_traits); @@ -89,7 +89,7 @@ linear_least_squares_fitting_3(InputIterator first, // assemble covariance matrix typename DiagonalizeTraits::Covariance_matrix covariance = {{ 0., 0., 0., 0., 0., 0. }}; - assemble_covariance_matrix_3(first,beyond,covariance,c,k,(Sphere*) NULL,tag, diagonalize_traits); + assemble_covariance_matrix_3(first,beyond,covariance,c,k,(Sphere*) nullptr,tag, diagonalize_traits); // compute fitting plane return fitting_plane_3(covariance,c,plane,k,diagonalize_traits); @@ -121,7 +121,7 @@ linear_least_squares_fitting_3(InputIterator first, // assemble covariance matrix typename DiagonalizeTraits::Covariance_matrix covariance = {{ 0., 0., 0., 0., 0., 0. }}; - assemble_covariance_matrix_3(first,beyond,covariance,c,k,(Sphere*) NULL,tag, diagonalize_traits); + assemble_covariance_matrix_3(first,beyond,covariance,c,k,(Sphere*) nullptr,tag, diagonalize_traits); // compute fitting line @@ -153,7 +153,7 @@ linear_least_squares_fitting_3(InputIterator first, // assemble covariance matrix typename DiagonalizeTraits::Covariance_matrix covariance = {{ 0., 0., 0., 0., 0., 0. }}; - assemble_covariance_matrix_3(first,beyond,covariance,c,k,(Sphere*) NULL,tag, diagonalize_traits); + assemble_covariance_matrix_3(first,beyond,covariance,c,k,(Sphere*) nullptr,tag, diagonalize_traits); // compute fitting line return fitting_line_3(covariance,c,line,k,diagonalize_traits); diff --git a/Principal_component_analysis/include/CGAL/linear_least_squares_fitting_tetrahedra_3.h b/Principal_component_analysis/include/CGAL/linear_least_squares_fitting_tetrahedra_3.h index 004782b7273..d6f237e29a9 100644 --- a/Principal_component_analysis/include/CGAL/linear_least_squares_fitting_tetrahedra_3.h +++ b/Principal_component_analysis/include/CGAL/linear_least_squares_fitting_tetrahedra_3.h @@ -62,7 +62,7 @@ linear_least_squares_fitting_3(InputIterator first, // assemble covariance matrix typename DiagonalizeTraits::Covariance_matrix covariance = {{ 0., 0., 0., 0., 0., 0. }}; - assemble_covariance_matrix_3(first,beyond,covariance,c,k,(Tetrahedron*) NULL,tag, diagonalize_traits); + assemble_covariance_matrix_3(first,beyond,covariance,c,k,(Tetrahedron*) nullptr,tag, diagonalize_traits); // compute fitting plane return fitting_plane_3(covariance,c,plane,k,diagonalize_traits); @@ -101,7 +101,7 @@ linear_least_squares_fitting_3(InputIterator first, } // compute fitting plane - return linear_least_squares_fitting_3(triangles.begin(),triangles.end(),plane,c,(Triangle*)NULL,k,tag, + return linear_least_squares_fitting_3(triangles.begin(),triangles.end(),plane,c,(Triangle*)nullptr,k,tag, diagonalize_traits); } // end linear_least_squares_fitting_tetrahedrons_3 @@ -142,7 +142,7 @@ linear_least_squares_fitting_3(InputIterator first, } // compute fitting plane - return linear_least_squares_fitting_3(segments.begin(),segments.end(),plane,c,(Segment*)NULL,k,tag, + return linear_least_squares_fitting_3(segments.begin(),segments.end(),plane,c,(Segment*)nullptr,k,tag, diagonalize_traits); } // end linear_least_squares_fitting_tetrahedrons_3 @@ -180,7 +180,7 @@ linear_least_squares_fitting_3(InputIterator first, } // compute fitting plane - return linear_least_squares_fitting_3(points.begin(),points.end(),plane,c,(Point*)NULL,k,tag, + return linear_least_squares_fitting_3(points.begin(),points.end(),plane,c,(Point*)nullptr,k,tag, diagonalize_traits); } // end linear_least_squares_fitting_tetrahedrons_3 @@ -209,7 +209,7 @@ linear_least_squares_fitting_3(InputIterator first, // assemble covariance matrix typename DiagonalizeTraits::Covariance_matrix covariance = {{ 0., 0., 0., 0., 0., 0. }}; - assemble_covariance_matrix_3(first,beyond,covariance,c,k,(Tetrahedron*) NULL,tag, diagonalize_traits); + assemble_covariance_matrix_3(first,beyond,covariance,c,k,(Tetrahedron*) nullptr,tag, diagonalize_traits); // compute fitting line return fitting_line_3(covariance,c,line,k,diagonalize_traits); @@ -249,7 +249,7 @@ linear_least_squares_fitting_3(InputIterator first, } // compute fitting line - return linear_least_squares_fitting_3(triangles.begin(),triangles.end(),line,c,(Triangle*)NULL,k,tag, + return linear_least_squares_fitting_3(triangles.begin(),triangles.end(),line,c,(Triangle*)nullptr,k,tag, diagonalize_traits); } // end linear_least_squares_fitting_tetrahedrons_3 @@ -289,7 +289,7 @@ linear_least_squares_fitting_3(InputIterator first, } // compute fitting line - return linear_least_squares_fitting_3(segments.begin(),segments.end(),line,c,(Segment*)NULL,k,tag, + return linear_least_squares_fitting_3(segments.begin(),segments.end(),line,c,(Segment*)nullptr,k,tag, diagonalize_traits); } // end linear_least_squares_fitting_tetrahedrons_3 @@ -327,7 +327,7 @@ linear_least_squares_fitting_3(InputIterator first, } // compute fitting line - return linear_least_squares_fitting_3(points.begin(),points.end(),line,c,(Point*)NULL,k,tag, + return linear_least_squares_fitting_3(points.begin(),points.end(),line,c,(Point*)nullptr,k,tag, diagonalize_traits); } // end linear_least_squares_fitting_tetrahedra_3 diff --git a/Principal_component_analysis/include/CGAL/linear_least_squares_fitting_triangles_3.h b/Principal_component_analysis/include/CGAL/linear_least_squares_fitting_triangles_3.h index e5d00c480bb..66bd98b8851 100644 --- a/Principal_component_analysis/include/CGAL/linear_least_squares_fitting_triangles_3.h +++ b/Principal_component_analysis/include/CGAL/linear_least_squares_fitting_triangles_3.h @@ -59,7 +59,7 @@ linear_least_squares_fitting_3(InputIterator first, // assemble covariance matrix typename DiagonalizeTraits::Covariance_matrix covariance = {{ 0., 0., 0., 0., 0., 0. }}; - assemble_covariance_matrix_3(first,beyond,covariance,c,k,(Triangle*) NULL,tag, diagonalize_traits); + assemble_covariance_matrix_3(first,beyond,covariance,c,k,(Triangle*) nullptr,tag, diagonalize_traits); // compute fitting plane return fitting_plane_3(covariance,c,plane,k,diagonalize_traits); @@ -98,7 +98,7 @@ linear_least_squares_fitting_3(InputIterator first, } // compute fitting plane - return linear_least_squares_fitting_3(segments.begin(),segments.end(),plane,c,(Segment*)NULL,k,tag, + return linear_least_squares_fitting_3(segments.begin(),segments.end(),plane,c,(Segment*)nullptr,k,tag, diagonalize_traits); } // end linear_least_squares_fitting_triangles_3 @@ -134,7 +134,7 @@ linear_least_squares_fitting_3(InputIterator first, } // compute fitting plane - return linear_least_squares_fitting_3(points.begin(),points.end(),plane,c,(Point*)NULL,k,tag, + return linear_least_squares_fitting_3(points.begin(),points.end(),plane,c,(Point*)nullptr,k,tag, diagonalize_traits); } // end linear_least_squares_fitting_triangles_3 @@ -163,7 +163,7 @@ linear_least_squares_fitting_3(InputIterator first, // assemble covariance matrix typename DiagonalizeTraits::Covariance_matrix covariance = {{ 0., 0., 0., 0., 0., 0. }}; - assemble_covariance_matrix_3(first,beyond,covariance,c,k,(Triangle*) NULL,tag, diagonalize_traits); + assemble_covariance_matrix_3(first,beyond,covariance,c,k,(Triangle*) nullptr,tag, diagonalize_traits); // compute fitting line return fitting_line_3(covariance,c,line,k,diagonalize_traits); @@ -202,7 +202,7 @@ linear_least_squares_fitting_3(InputIterator first, } // compute fitting line - return linear_least_squares_fitting_3(segments.begin(),segments.end(),line,c,(Segment*)NULL,k,tag, + return linear_least_squares_fitting_3(segments.begin(),segments.end(),line,c,(Segment*)nullptr,k,tag, diagonalize_traits); } // end linear_least_squares_fitting_triangles_3 @@ -238,7 +238,7 @@ linear_least_squares_fitting_3(InputIterator first, } // compute fitting line - return linear_least_squares_fitting_3(points.begin(),points.end(),line,c,(Point*)NULL,k,tag, + return linear_least_squares_fitting_3(points.begin(),points.end(),line,c,(Point*)nullptr,k,tag, diagonalize_traits); } // end linear_least_squares_fitting_triangles_3 diff --git a/Principal_component_analysis_LGPL/include/CGAL/centroid.h b/Principal_component_analysis_LGPL/include/CGAL/centroid.h index aba3ed3148b..19a23e67b28 100644 --- a/Principal_component_analysis_LGPL/include/CGAL/centroid.h +++ b/Principal_component_analysis_LGPL/include/CGAL/centroid.h @@ -102,7 +102,7 @@ centroid(InputIterator begin, points.push_back(s[0]); points.push_back(s[1]); } - return centroid(points.begin(),points.end(),k,(Point*)NULL,tag); + return centroid(points.begin(),points.end(),k,(Point*)nullptr,tag); }// end centroid for 2D segment set with 0D tag // centroid for 2D segment set with 1D tag @@ -166,7 +166,7 @@ centroid(InputIterator begin, points.push_back(triangle[1]); points.push_back(triangle[2]); } - return centroid(points.begin(),points.end(),k,(Point*)NULL,tag); + return centroid(points.begin(),points.end(),k,(Point*)nullptr,tag); } // end centroid of a 2D triangle set with 0D tag @@ -195,7 +195,7 @@ centroid(InputIterator begin, segments.push_back(triangle[1],triangle[2]); segments.push_back(triangle[2],triangle[0]); } - return centroid(segments.begin(),segments.end(),k,(Segment*)NULL,tag); + return centroid(segments.begin(),segments.end(),k,(Segment*)nullptr,tag); } // end centroid of a 2D triangle set with 1D tag @@ -330,7 +330,7 @@ centroid(InputIterator begin, points.push_back(r[2]); points.push_back(r[3]); } - return centroid(points.begin(),points.end(),k,(Point*)NULL,tag); + return centroid(points.begin(),points.end(),k,(Point*)nullptr,tag); } // end centroid of a 2D rectangle set with 0D tag @@ -360,7 +360,7 @@ centroid(InputIterator begin, segments.push_back(r[2],r[3]); segments.push_back(r[3],r[0]); } - return centroid(segments.begin(),segments.end(),k,(Segment*)NULL,tag); + return centroid(segments.begin(),segments.end(),k,(Segment*)nullptr,tag); } // end centroid of a 2D rectangle set with 1D tag @@ -488,7 +488,7 @@ centroid(InputIterator begin, points.push_back(triangle[1]); points.push_back(triangle[2]); } - return centroid(points.begin(),points.end(),k,(Point*)NULL,tag); + return centroid(points.begin(),points.end(),k,(Point*)nullptr,tag); } // end centroid of a 3D triangle set with 0D tag @@ -517,7 +517,7 @@ centroid(InputIterator begin, segments.push_back(triangle[1],triangle[2]); segments.push_back(triangle[2],triangle[0]); } - return centroid(segments.begin(),segments.end(),k,(Segment*)NULL,tag); + return centroid(segments.begin(),segments.end(),k,(Segment*)nullptr,tag); } // end centroid of a 3D triangle set with 1D tag @@ -656,7 +656,7 @@ centroid(InputIterator begin, points.push_back(cuboid[6]); points.push_back(cuboid[7]); } - return centroid(points.begin(),points.end(),k,(Point*)NULL,tag); + return centroid(points.begin(),points.end(),k,(Point*)nullptr,tag); } // end centroid of a 3D cuboid set with 0D tag @@ -694,7 +694,7 @@ centroid(InputIterator begin, segments.push_back(cuboid[4],cuboid[7]); segments.push_back(cuboid[5],cuboid[6]); } - return centroid(segments.begin(),segments.end(),k,(Segment*)NULL,tag); + return centroid(segments.begin(),segments.end(),k,(Segment*)nullptr,tag); } // end centroid of a 3D cuboid set with 1D tag @@ -823,7 +823,7 @@ struct Dispatch_centroid_3 result_type operator()(InputIterator begin, InputIterator end, const K& k, Dim_tag tag) const { typedef typename std::iterator_traits::value_type Value_type; - return centroid(begin, end, k,(Value_type*) NULL, tag); + return centroid(begin, end, k,(Value_type*) nullptr, tag); } }; diff --git a/Profiling_tools/include/CGAL/Real_timer_impl.h b/Profiling_tools/include/CGAL/Real_timer_impl.h index 39bd529ed4b..690041710a4 100644 --- a/Profiling_tools/include/CGAL/Real_timer_impl.h +++ b/Profiling_tools/include/CGAL/Real_timer_impl.h @@ -66,7 +66,7 @@ double Real_timer::get_real_time() const { return double(t.time) + double(t.millitm) / 1000.0; #else // ! _MSC_VER && ! __MINGW32__// struct timeval t; - int ret = gettimeofday( &t, NULL); + int ret = gettimeofday( &t, nullptr); CGAL_warning_msg( ret == 0, "Call to gettimeofday() in class " "CGAL::Real_timer failed - timings will be 0."); if ( ret == 0) { diff --git a/Property_map/include/CGAL/property_map.h b/Property_map/include/CGAL/property_map.h index 0a039d9d868..443e642884a 100644 --- a/Property_map/include/CGAL/property_map.h +++ b/Property_map/include/CGAL/property_map.h @@ -425,7 +425,7 @@ typename Pointer_property_map::type make_property_map(std::vector& v) { if(v.empty()){ - return make_property_map(static_cast(NULL)); + return make_property_map(static_cast(nullptr)); } return make_property_map(&v[0]); } @@ -498,17 +498,17 @@ struct Boolean_property_map /// Constructor taking a copy of the set. Note that `set_` must be valid /// while the property map is in use. Boolean_property_map(Set& set_) : set_ptr(&set_) {} - Boolean_property_map() : set_ptr(NULL) {} + Boolean_property_map() : set_ptr(nullptr) {} friend bool get(const Boolean_property_map& pm, const key_type& k) { - CGAL_assertion(pm.set_ptr!=NULL); + CGAL_assertion(pm.set_ptr!=nullptr); return pm.set_ptr->count(k) != 0; } friend void put(Boolean_property_map& pm, const key_type& k, bool v) { - CGAL_assertion(pm.set_ptr!=NULL); + CGAL_assertion(pm.set_ptr!=nullptr); if (v) pm.set_ptr->insert(k); else diff --git a/STL_Extension/doc/STL_Extension/CGAL/Compact_container.h b/STL_Extension/doc/STL_Extension/CGAL/Compact_container.h index 44f11c8d70f..f43daacc0bd 100644 --- a/STL_Extension/doc/STL_Extension/CGAL/Compact_container.h +++ b/STL_Extension/doc/STL_Extension/CGAL/Compact_container.h @@ -92,7 +92,7 @@ The iterators themselves can be used as `T`, they provide the necessary functions to be used by `Compact_container_traits`. Moreover, they also provide a default constructor value which is not singular: it is copyable, comparable, and guaranteed to be unique under comparison -(like `NULL` for pointers). This makes them suitable for use in +(like `nullptr` for pointers). This makes them suitable for use in geometric graphs like handles to vertices in triangulations. In addition, in a way inspired from the Boost.Intrusive containers, it is diff --git a/STL_Extension/doc/STL_Extension/CGAL/assertions_behaviour.h b/STL_Extension/doc/STL_Extension/CGAL/assertions_behaviour.h index f014c455347..365ce3e593a 100644 --- a/STL_Extension/doc/STL_Extension/CGAL/assertions_behaviour.h +++ b/STL_Extension/doc/STL_Extension/CGAL/assertions_behaviour.h @@ -18,7 +18,7 @@ enum Failure_behaviour { ABORT, EXIT, EXIT_WITH_SUCCESS, CONTINUE, \param type is a string that contains one of the words precondition, postcondition, assertion or warning. \param expression contains the expression that was violated. \param file, line contain the place where the check was made. -\param explanation contains an explanation of what was checked. It can be `NULL`, in which case the expression is thought to be descriptive enough. +\param explanation contains an explanation of what was checked. It can be `null_ptr`, in which case the expression is thought to be descriptive enough. */ diff --git a/STL_Extension/include/CGAL/Circulator_identity.h b/STL_Extension/include/CGAL/Circulator_identity.h index 18f9b1bc520..14a35bc5a99 100644 --- a/STL_Extension/include/CGAL/Circulator_identity.h +++ b/STL_Extension/include/CGAL/Circulator_identity.h @@ -60,12 +60,12 @@ public: Circulator current_circulator() const { return nt;} - bool operator==( Nullptr_t p) const { + bool operator==( std::nullptr_t p) const { CGAL_assertion( p == 0); CGAL_USE(p); return ( nt == 0); //###// } - bool operator!=( Nullptr_t p) const { + bool operator!=( std::nullptr_t p) const { return !(*this == p); } bool operator==( const Self& i) const { diff --git a/STL_Extension/include/CGAL/Circulator_on_node.h b/STL_Extension/include/CGAL/Circulator_on_node.h index deaf9c0ab1c..e4cd8a85b27 100644 --- a/STL_Extension/include/CGAL/Circulator_on_node.h +++ b/STL_Extension/include/CGAL/Circulator_on_node.h @@ -62,12 +62,12 @@ public: Ptr ptr() const { return nt;} - bool operator==( Nullptr_t p) const { + bool operator==( std::nullptr_t p) const { CGAL_assertion( p == 0); CGAL_USE(p); return ( nt == 0); } - bool operator!=( Nullptr_t p) const { return !(*this == p); } + bool operator!=( std::nullptr_t p) const { return !(*this == p); } bool operator==( const Self& i) const { return ( nt == i.nt); } bool operator!=( const Self& i) const { return !(*this == i); } Ref operator*() const { return *nt; } diff --git a/STL_Extension/include/CGAL/Circulator_project.h b/STL_Extension/include/CGAL/Circulator_project.h index e704db7e52e..08a510cdc84 100644 --- a/STL_Extension/include/CGAL/Circulator_project.h +++ b/STL_Extension/include/CGAL/Circulator_project.h @@ -65,11 +65,11 @@ public: return &(fct(*nt)); } - bool operator==( Nullptr_t CGAL_assertion_code(p) ) const { + bool operator==( std::nullptr_t CGAL_assertion_code(p) ) const { CGAL_assertion( p == 0); return ( nt == 0); } - bool operator!=( Nullptr_t p) const { return !(*this == p); } + bool operator!=( std::nullptr_t p) const { return !(*this == p); } bool operator==( const Self& i) const { return ( nt == i.nt); } bool operator!=( const Self& i) const { return !(*this == i); } Ref operator*() const { return *ptr(); } diff --git a/STL_Extension/include/CGAL/Compact_container.h b/STL_Extension/include/CGAL/Compact_container.h index 48263271f2c..faa73ea8d4a 100644 --- a/STL_Extension/include/CGAL/Compact_container.h +++ b/STL_Extension/include/CGAL/Compact_container.h @@ -172,7 +172,7 @@ class Compact_container_base void * p; public: Compact_container_base() - : p(NULL) {} + : p(nullptr) {} void * for_compact_container() const { return p; } void * & for_compact_container() { return p; } }; @@ -408,7 +408,7 @@ public: iterator emplace(const Args&... args) { - if (free_list == NULL) + if (free_list == nullptr) allocate_new_block(); pointer ret = free_list; @@ -422,7 +422,7 @@ public: iterator insert(const T &t) { - if (free_list == NULL) + if (free_list == nullptr) allocate_new_block(); pointer ret = free_list; @@ -598,11 +598,11 @@ public: all_items.push_back(std::make_pair(new_block, block_size + 2)); capacity_ += block_size; // We insert this new block at the end. - if (last_item == NULL) // First time + if (last_item == nullptr) // First time { first_item = new_block; last_item = new_block + block_size + 1; - set_type(first_item, NULL, START_END); + set_type(first_item, nullptr, START_END); } else { @@ -610,7 +610,7 @@ public: set_type(new_block, last_item, BLOCK_BOUNDARY); last_item = new_block + block_size + 1; } - set_type(last_item, NULL, START_END); + set_type(last_item, nullptr, START_END); // Increase the block_size for the next time. Increment_policy::increase_size(*this); } @@ -647,15 +647,15 @@ private: // // value of the last 2 bits as "Type" // pointer part 0 1 2 3 - // NULL user elt unused free_list end start/end - // != NULL user elt block boundary free elt unused + // nullptr user elt unused free_list end start/end + // != nullptr user elt block boundary free elt unused // // meaning of ptr : user stuff next/prev block free_list unused enum Type { USED = 0, BLOCK_BOUNDARY = 1, FREE = 2, START_END = 3 }; // The bit squatting is implemented by casting pointers to (char *), then - // subtracting to NULL, doing bit manipulations on the resulting integer, + // subtracting to nullptr, doing bit manipulations on the resulting integer, // and converting back. static char * clean_pointer(char * p) @@ -708,9 +708,9 @@ public: block_size = Increment_policy::first_block_size; capacity_ = 0; size_ = 0; - free_list = NULL; - first_item = NULL; - last_item = NULL; + free_list = nullptr; + first_item = nullptr; + last_item = nullptr; all_items = All_items(); time_stamper->reset(); } @@ -738,19 +738,19 @@ void Compact_container::merge(Self CGAL_precondition(get_allocator() == d.get_allocator()); // Concatenate the free_lists. - if (free_list == NULL) { + if (free_list == nullptr) { free_list = d.free_list; - } else if (d.free_list != NULL) { + } else if (d.free_list != nullptr) { pointer p = free_list; - while (clean_pointee(p) != NULL) + while (clean_pointee(p) != nullptr) p = clean_pointee(p); set_type(p, d.free_list, FREE); } // Concatenate the blocks. - if (last_item == NULL) { // empty... + if (last_item == nullptr) { // empty... first_item = d.first_item; last_item = d.last_item; - } else if (d.last_item != NULL) { + } else if (d.last_item != nullptr) { set_type(last_item, d.first_item, BLOCK_BOUNDARY); set_type(d.first_item, last_item, BLOCK_BOUNDARY); last_item = d.last_item; @@ -781,7 +781,7 @@ void Compact_container::clear() #else alloc.destroy(pp); #endif - set_type(pp, NULL, FREE); + set_type(pp, nullptr, FREE); } } alloc.deallocate(p, s); @@ -808,11 +808,11 @@ void Compact_container::allocate_ne put_on_free_list(new_block + i); } // We insert this new block at the end. - if (last_item == NULL) // First time + if (last_item == nullptr) // First time { first_item = new_block; last_item = new_block + block_size + 1; - set_type(first_item, NULL, START_END); + set_type(first_item, nullptr, START_END); } else { @@ -820,7 +820,7 @@ void Compact_container::allocate_ne set_type(new_block, last_item, BLOCK_BOUNDARY); last_item = new_block + block_size + 1; } - set_type(last_item, NULL, START_END); + set_type(last_item, nullptr, START_END); // Increase the block_size for the next time. Increment_policy::increase_size(*this); } @@ -897,13 +897,13 @@ namespace internal { value_type&>::type reference; typedef std::bidirectional_iterator_tag iterator_category; - // the initialization with NULL is required by our Handle concept. + // the initialization with nullptr is required by our Handle concept. CC_iterator() #ifdef CGAL_COMPACT_CONTAINER_DEBUG_TIME_STAMP : ts(0) #endif { - m_ptr.p = NULL; + m_ptr.p = nullptr; } // Either a harmless copy-ctor, @@ -926,14 +926,14 @@ namespace internal { return *this; } - // Construction from NULL - CC_iterator (Nullptr_t CGAL_assertion_code(n)) + // Construction from nullptr + CC_iterator (std::nullptr_t CGAL_assertion_code(n)) #ifdef CGAL_COMPACT_CONTAINER_DEBUG_TIME_STAMP : ts(0) #endif { - CGAL_assertion (n == NULL); - m_ptr.p = NULL; + CGAL_assertion (n == nullptr); + m_ptr.p = nullptr; } private: @@ -962,7 +962,7 @@ namespace internal { #endif { m_ptr.p = ptr; - if (m_ptr.p == NULL) // empty container. + if (m_ptr.p == nullptr) // empty container. return; ++(m_ptr.p); // if not empty, p = start @@ -982,17 +982,17 @@ namespace internal { { m_ptr.p = ptr; #ifdef CGAL_COMPACT_CONTAINER_DEBUG_TIME_STAMP - if(ptr != NULL){ + if(ptr != nullptr){ ts = Time_stamper_impl::time_stamp(m_ptr.p); } #endif // end CGAL_COMPACT_CONTAINER_DEBUG_TIME_STAMP } - // NB : in case empty container, begin == end == NULL. + // NB : in case empty container, begin == end == nullptr. void increment() { // It's either pointing to end(), or valid. - CGAL_assertion_msg(m_ptr.p != NULL, + CGAL_assertion_msg(m_ptr.p != nullptr, "Incrementing a singular iterator or an empty container iterator ?"); CGAL_assertion_msg(DSC::type(m_ptr.p) != DSC::START_END, "Incrementing end() ?"); @@ -1016,7 +1016,7 @@ namespace internal { void decrement() { // It's either pointing to end(), or valid. - CGAL_assertion_msg(m_ptr.p != NULL, + CGAL_assertion_msg(m_ptr.p != nullptr, "Decrementing a singular iterator or an empty container iterator ?"); CGAL_assertion_msg(DSC::type(m_ptr.p - 1) != DSC::START_END, "Decrementing begin() ?"); @@ -1042,7 +1042,7 @@ namespace internal { Self & operator++() { - CGAL_assertion_msg(m_ptr.p != NULL, + CGAL_assertion_msg(m_ptr.p != nullptr, "Incrementing a singular iterator or an empty container iterator ?"); /* CGAL_assertion_msg(DSC::type(m_ptr.p) == DSC::USED, "Incrementing an invalid iterator."); */ @@ -1052,7 +1052,7 @@ namespace internal { Self & operator--() { - CGAL_assertion_msg(m_ptr.p != NULL, + CGAL_assertion_msg(m_ptr.p != nullptr, "Decrementing a singular iterator or an empty container iterator ?"); /*CGAL_assertion_msg(DSC::type(m_ptr.p) == DSC::USED || DSC::type(m_ptr.p) == DSC::START_END, @@ -1131,23 +1131,23 @@ namespace internal { return rhs.operator->() != lhs.operator->(); } - // Comparisons with NULL are part of CGAL's Handle concept... + // Comparisons with nullptr are part of CGAL's Handle concept... template < class DSC, bool Const > inline bool operator==(const CC_iterator &rhs, - Nullptr_t CGAL_assertion_code(n)) + std::nullptr_t CGAL_assertion_code(n)) { - CGAL_assertion( n == NULL); - return rhs.operator->() == NULL; + CGAL_assertion( n == nullptr); + return rhs.operator->() == nullptr; } template < class DSC, bool Const > inline bool operator!=(const CC_iterator &rhs, - Nullptr_t CGAL_assertion_code(n)) + std::nullptr_t CGAL_assertion_code(n)) { - CGAL_assertion( n == NULL); - return rhs.operator->() != NULL; + CGAL_assertion( n == nullptr); + return rhs.operator->() != nullptr; } template diff --git a/STL_Extension/include/CGAL/Concurrent_compact_container.h b/STL_Extension/include/CGAL/Concurrent_compact_container.h index 1618db7647d..3499e867641 100644 --- a/STL_Extension/include/CGAL/Concurrent_compact_container.h +++ b/STL_Extension/include/CGAL/Concurrent_compact_container.h @@ -124,9 +124,9 @@ namespace CCC_internal { template< typename pointer, typename size_type, typename CCC > class Free_list { public: - Free_list() : m_head(NULL), m_size(0) {} + Free_list() : m_head(nullptr), m_size(0) {} - void init() { m_head = NULL; m_size = 0; } + void init() { m_head = nullptr; m_size = 0; } pointer head() const { return m_head; } void set_head(pointer p) { m_head = p; } size_type size() const { return m_size; } @@ -144,13 +144,13 @@ public: void merge(Free_list &other) { - if (m_head == NULL) { + if (m_head == nullptr) { *this = other; } else if (!other.empty()) { pointer p = m_head; - while (CCC::clean_pointee(p) != NULL) + while (CCC::clean_pointee(p) != nullptr) p = CCC::clean_pointee(p); CCC::set_type(p, other.m_head, CCC::FREE); m_size += other.m_size; @@ -487,7 +487,7 @@ private: pointer init_insert(FreeList * fl) { pointer fl2 = fl->head(); - if (fl2 == NULL) { + if (fl2 == nullptr) { allocate_new_block(fl); fl2 = fl->head(); } @@ -523,15 +523,15 @@ private: // // value of the last 2 bits as "Type" // pointer part 0 1 2 3 - // NULL user elt unused free_list end start/end - // != NULL user elt block boundary free elt unused + // nullptr user elt unused free_list end start/end + // != nullptr user elt block boundary free elt unused // // meaning of ptr : user stuff next/prev block free_list unused enum Type { USED = 0, BLOCK_BOUNDARY = 1, FREE = 2, START_END = 3 }; // The bit squatting is implemented by casting pointers to (char *), then - // subtracting to NULL, doing bit manipulations on the resulting integer, + // subtracting to nullptr, doing bit manipulations on the resulting integer, // and converting back. static char * clean_pointer(char * p) @@ -592,8 +592,8 @@ private: it_free_list->set_head(0); it_free_list->set_size(0); } - m_first_item = NULL; - m_last_item = NULL; + m_first_item = nullptr; + m_last_item = nullptr; m_all_items = All_items(); m_size = 0; m_time_stamper->reset(); @@ -650,10 +650,10 @@ void Concurrent_compact_container::merge(Self &d) it_free_list->merge(*it_free_list_d); } // Concatenate the blocks. - if (m_last_item == NULL) { // empty... + if (m_last_item == nullptr) { // empty... m_first_item = d.m_first_item; m_last_item = d.m_last_item; - } else if (d.m_last_item != NULL) { + } else if (d.m_last_item != nullptr) { set_type(m_last_item, d.m_first_item, BLOCK_BOUNDARY); set_type(d.m_first_item, m_last_item, BLOCK_BOUNDARY); m_last_item = d.m_last_item; @@ -701,11 +701,11 @@ void Concurrent_compact_container:: m_capacity += old_block_size; // We insert this new block at the end. - if (m_last_item == NULL) // First time + if (m_last_item == nullptr) // First time { m_first_item = new_block; m_last_item = new_block + old_block_size + 1; - set_type(m_first_item, NULL, START_END); + set_type(m_first_item, nullptr, START_END); } else { @@ -713,7 +713,7 @@ void Concurrent_compact_container:: set_type(new_block, m_last_item, BLOCK_BOUNDARY); m_last_item = new_block + old_block_size + 1; } - set_type(m_last_item, NULL, START_END); + set_type(m_last_item, nullptr, START_END); // Increase the m_block_size for the next time. m_block_size += CGAL_INCREMENT_CONCURRENT_COMPACT_CONTAINER_BLOCK_SIZE; } diff --git a/STL_Extension/include/CGAL/Handle_for.h b/STL_Extension/include/CGAL/Handle_for.h index 484a45dd87b..04f06e01e73 100644 --- a/STL_Extension/include/CGAL/Handle_for.h +++ b/STL_Extension/include/CGAL/Handle_for.h @@ -143,7 +143,7 @@ public: } // Note : I don't see a way to make a useful move constructor, apart - // from e.g. using NULL as a ptr value, but this is drastic. + // from e.g. using nullptr as a ptr value, but this is drastic. Handle_for& operator=(Handle_for && h) diff --git a/STL_Extension/include/CGAL/Handle_for_virtual.h b/STL_Extension/include/CGAL/Handle_for_virtual.h index 6df81110a78..92d81d9b57c 100644 --- a/STL_Extension/include/CGAL/Handle_for_virtual.h +++ b/STL_Extension/include/CGAL/Handle_for_virtual.h @@ -48,7 +48,7 @@ class Ref_counted_virtual { return typeid(void); } virtual const void * object_ptr() const - { return NULL; } + { return nullptr; } virtual ~Ref_counted_virtual() {} @@ -77,7 +77,7 @@ class Handle_for_virtual Handle_for_virtual() { - ptr = NULL; + ptr = nullptr; } Handle_for_virtual( const Handle_for_virtual& h) diff --git a/STL_Extension/include/CGAL/In_place_list.h b/STL_Extension/include/CGAL/In_place_list.h index 25c8aed4c57..fe4f58a371d 100644 --- a/STL_Extension/include/CGAL/In_place_list.h +++ b/STL_Extension/include/CGAL/In_place_list.h @@ -59,7 +59,7 @@ template < class T > class In_place_list_base { public: In_place_list_base() - : next_link(NULL), prev_link(NULL) + : next_link(nullptr), prev_link(nullptr) {} T* next_link; // forward pointer diff --git a/STL_Extension/include/CGAL/Multiset.h b/STL_Extension/include/CGAL/Multiset.h index 13e92cb45d0..8929ebc3c26 100644 --- a/STL_Extension/include/CGAL/Multiset.h +++ b/STL_Extension/include/CGAL/Multiset.h @@ -106,9 +106,9 @@ protected: /*! Default constructor. */ Node() : - parentP(NULL), - rightP(NULL), - leftP(NULL) + parentP(nullptr), + rightP(nullptr), + leftP(nullptr) {} /*! @@ -119,9 +119,9 @@ protected: Node (const Type& _object, Node_color _color) : object(_object), color(_color), - parentP(NULL), - rightP(NULL), - leftP(NULL) + parentP(nullptr), + rightP(nullptr), + leftP(nullptr) {} /*! @@ -174,12 +174,12 @@ protected: Node *predP; - if (leftP != NULL) + if (leftP != nullptr) { // If there is a left child, the predecessor is the maximal object in // the sub-tree spanned by this child. predP = leftP; - while (predP->rightP != NULL) + while (predP->rightP != nullptr) predP = predP->rightP; } else @@ -189,7 +189,7 @@ protected: const Node *prevP = this; predP = parentP; - while (predP != NULL && prevP == predP->leftP) + while (predP != nullptr && prevP == predP->leftP) { prevP = predP; predP = predP->parentP; @@ -209,12 +209,12 @@ protected: Node *succP; - if (rightP != NULL) + if (rightP != nullptr) { // If there is a right child, the successor is the minimal object in // the sub-tree spanned by this child. succP = rightP; - while (succP->leftP != NULL) + while (succP->leftP != nullptr) succP = succP->leftP; } else @@ -224,7 +224,7 @@ protected: const Node *prevP = this; succP = parentP; - while (succP != NULL && prevP == succP->rightP) + while (succP != nullptr && prevP == succP->rightP) { prevP = succP; succP = succP->parentP; @@ -282,7 +282,7 @@ public: /*! Deafult constructor. */ iterator () : - nodeP (NULL) + nodeP (nullptr) {} /*! Equality operator. */ @@ -300,7 +300,7 @@ public: /*! Increment operator (prefix notation). */ iterator& operator++ () { - CGAL_multiset_precondition (nodeP != NULL); + CGAL_multiset_precondition (nodeP != nullptr); nodeP = nodeP->successor(); return (*this); @@ -309,7 +309,7 @@ public: /*! Increment operator (postfix notation). */ iterator operator++ (int ) { - CGAL_multiset_precondition (nodeP != NULL); + CGAL_multiset_precondition (nodeP != nullptr); iterator temp = *this; @@ -320,7 +320,7 @@ public: /*! Decrement operator (prefix notation). */ iterator& operator-- () { - CGAL_multiset_precondition (nodeP != NULL); + CGAL_multiset_precondition (nodeP != nullptr); nodeP = nodeP->predecessor(); return (*this); @@ -329,7 +329,7 @@ public: /*! Decrement operator (postfix notation). */ iterator operator-- (int ) { - CGAL_multiset_precondition (nodeP != NULL); + CGAL_multiset_precondition (nodeP != nullptr); iterator temp = *this; @@ -342,7 +342,7 @@ public: */ reference operator* () const { - CGAL_multiset_precondition (nodeP != NULL && nodeP->is_valid()); + CGAL_multiset_precondition (nodeP != nullptr && nodeP->is_valid()); return (nodeP->object); } @@ -352,7 +352,7 @@ public: */ pointer operator-> () const { - CGAL_multiset_precondition (nodeP != NULL && nodeP->is_valid()); + CGAL_multiset_precondition (nodeP != nullptr && nodeP->is_valid()); return (&(nodeP->object)); } @@ -392,7 +392,7 @@ public: /*! Deafult constructor. */ const_iterator () : - nodeP (NULL) + nodeP (nullptr) {} /*! Constructor from a mutable iterator. */ @@ -415,7 +415,7 @@ public: /*! Increment operator (prefix notation). */ const_iterator& operator++ () { - CGAL_multiset_precondition (nodeP != NULL); + CGAL_multiset_precondition (nodeP != nullptr); nodeP = nodeP->successor(); return (*this); @@ -424,7 +424,7 @@ public: /*! Increment operator (postfix notation). */ const_iterator operator++ (int ) { - CGAL_multiset_precondition (nodeP != NULL); + CGAL_multiset_precondition (nodeP != nullptr); const_iterator temp = *this; @@ -435,7 +435,7 @@ public: /*! Decrement operator (prefix notation). */ const_iterator& operator-- () { - CGAL_multiset_precondition (nodeP != NULL); + CGAL_multiset_precondition (nodeP != nullptr); nodeP = nodeP->predecessor(); return (*this); @@ -444,7 +444,7 @@ public: /*! Decrement operator (postfix notation). */ const_iterator operator-- (int ) { - CGAL_multiset_precondition (nodeP != NULL); + CGAL_multiset_precondition (nodeP != nullptr); const_iterator temp = *this; @@ -457,7 +457,7 @@ public: */ reference operator* () const { - CGAL_multiset_precondition (nodeP != NULL && nodeP->is_valid()); + CGAL_multiset_precondition (nodeP != nullptr && nodeP->is_valid()); return (nodeP->object); } @@ -467,7 +467,7 @@ public: */ pointer operator-> () const { - CGAL_multiset_precondition (nodeP != NULL && nodeP->is_valid()); + CGAL_multiset_precondition (nodeP != nullptr && nodeP->is_valid()); return (&(nodeP->object)); } @@ -524,7 +524,7 @@ public: template Multiset (InputIterator first, InputIterator last, const Compare& comp = Compare()) : - rootP (NULL), + rootP (nullptr), iSize (0), iBlackHeight (0), comp_f (comp) @@ -658,7 +658,7 @@ public: */ inline bool empty () const { - return (rootP == NULL); + return (rootP == nullptr); } /*! @@ -1219,20 +1219,20 @@ protected: /*! Check whether a node is valid. */ inline bool _is_valid (const Node *nodeP) const { - return (nodeP != NULL && nodeP->is_valid()); + return (nodeP != nullptr && nodeP->is_valid()); } /*! Check whether a node is red. */ inline bool _is_red (const Node *nodeP) const { - return (nodeP != NULL && nodeP->color == Node::RED); + return (nodeP != nullptr && nodeP->color == Node::RED); } /*! Check whether a node is black. */ inline bool _is_black (const Node *nodeP) const { // Note that invalid nodes are considered ro be black as well. - return (nodeP == NULL || nodeP->color != Node::RED); + return (nodeP == nullptr || nodeP->color != Node::RED); } //@} @@ -1264,7 +1264,7 @@ protected: * \return A node that contains the first object that is not less than the * given key (if type is LOWER_BOUND), or anode that contains the * first object that is greater than the given key (if type is - * UPPER_BOUND) - or a NULL node if no such nodes exist. + * UPPER_BOUND) - or a nullptr node if no such nodes exist. */ enum Bound_type {LOWER_BOUND, UPPER_BOUND}; @@ -1277,9 +1277,9 @@ protected: // Initially mark that the key is not found in the tree. is_equal = false; - if (rootP == NULL) + if (rootP == nullptr) // The tree is empty: - return (NULL); + return (nullptr); Node *currentP = rootP; Node *prevP = currentP; @@ -1431,8 +1431,8 @@ protected: /*! * Fix-up the red-black tree properties after a removal operation. * \param nodeP The child of the node that has just been removed from - * the tree (may be a NULL node). - * \param parentP The parent node of nodeP (as nodeP may be a NULL node, + * the tree (may be a nullptr node). + * \param parentP The parent node of nodeP (as nodeP may be a nullptr node, * we have to specify its parent explicitly). */ void _remove_fixup (Node* nodeP, Node* parentP); @@ -1476,7 +1476,7 @@ protected: // template Multiset::Multiset () : - rootP (NULL), + rootP (nullptr), iSize (0), iBlackHeight (0), comp_f () @@ -1491,7 +1491,7 @@ Multiset::Multiset () : // template Multiset::Multiset (const Compare& comp) : - rootP (NULL), + rootP (nullptr), iSize (0), iBlackHeight (0), comp_f (comp) @@ -1506,7 +1506,7 @@ Multiset::Multiset (const Compare& comp) : // template Multiset::Multiset (const Self& tree) : - rootP (NULL), + rootP (nullptr), iSize (tree.iSize), iBlackHeight (tree.iBlackHeight), comp_f (tree.comp_f) @@ -1516,7 +1516,7 @@ Multiset::Multiset (const Self& tree) : endNode.color = Node::DUMMY_END; // Copy all the copied tree's nodes recursively. - if (tree.rootP != NULL) + if (tree.rootP != nullptr) { rootP = _duplicate (tree.rootP); @@ -1528,8 +1528,8 @@ Multiset::Multiset (const Self& tree) : } else { - beginNode.parentP = NULL; - endNode.parentP = NULL; + beginNode.parentP = nullptr; + endNode.parentP = nullptr; } } @@ -1540,12 +1540,12 @@ template Multiset::~Multiset () { // Delete the entire tree recursively. - if (rootP != NULL) + if (rootP != nullptr) _destroy (rootP); - rootP = NULL; - beginNode.parentP = NULL; - endNode.parentP = NULL; + rootP = nullptr; + beginNode.parentP = nullptr; + endNode.parentP = nullptr; } //--------------------------------------------------------- @@ -1567,7 +1567,7 @@ Multiset::operator= (const Self& tree) iBlackHeight = tree.iBlackHeight; // Copy all the copied tree's nodes recursively. - if (tree.rootP != NULL) + if (tree.rootP != nullptr) { rootP = _duplicate (tree.rootP); @@ -1579,8 +1579,8 @@ Multiset::operator= (const Self& tree) } else { - beginNode.parentP = NULL; - endNode.parentP = NULL; + beginNode.parentP = nullptr; + endNode.parentP = nullptr; } return (*this); @@ -1612,18 +1612,18 @@ void Multiset::swap (Self& tree) // Update the fictitious begin and end nodes. tempP = beginNode.parentP; beginNode.parentP = tree.beginNode.parentP; - if (beginNode.parentP != NULL) + if (beginNode.parentP != nullptr) beginNode.parentP->leftP = &beginNode; tree.beginNode.parentP = tempP; - if (tree.beginNode.parentP != NULL) + if (tree.beginNode.parentP != nullptr) tree.beginNode.parentP->leftP = &(tree.beginNode); tempP = endNode.parentP; endNode.parentP = tree.endNode.parentP; - if (endNode.parentP != NULL) + if (endNode.parentP != nullptr) endNode.parentP->rightP = &endNode; tree.endNode.parentP = tempP; - if (tree.endNode.parentP != NULL) + if (tree.endNode.parentP != nullptr) tree.endNode.parentP->rightP = &(tree.endNode); return; @@ -1703,7 +1703,7 @@ template inline typename Multiset::iterator Multiset::begin () { - if (beginNode.parentP != NULL) + if (beginNode.parentP != nullptr) return (iterator (beginNode.parentP)); else return (iterator (&endNode)); @@ -1726,7 +1726,7 @@ template inline typename Multiset::const_iterator Multiset::begin () const { - if (beginNode.parentP != NULL) + if (beginNode.parentP != nullptr) return (const_iterator (beginNode.parentP)); else return (const_iterator (&endNode)); @@ -1790,7 +1790,7 @@ Multiset::rend () const template size_t Multiset::size () const { - if (rootP == NULL) + if (rootP == nullptr) // The tree is empty: return (0); else if (iSize > 0) @@ -1821,7 +1821,7 @@ template typename Multiset::iterator Multiset::insert (const Type& object) { - if (rootP == NULL) + if (rootP == nullptr) { // In case the tree is empty, assign a new rootP. // Notice that the root is always black. @@ -1862,7 +1862,7 @@ Multiset::insert (const Type& object) // Insert the new leaf as the left child of the current node. currentP->leftP = newNodeP; newNodeP->parentP = currentP; - currentP = NULL; // In order to terminate the while loop. + currentP = nullptr; // In order to terminate the while loop. if (is_leftmost) { @@ -1886,7 +1886,7 @@ Multiset::insert (const Type& object) // Insert the new leaf as the right child of the current node. currentP->rightP = newNodeP; newNodeP->parentP = currentP; - currentP = NULL; // In order to terminate the while loop. + currentP = nullptr; // In order to terminate the while loop. if (is_rightmost) { @@ -1999,17 +1999,17 @@ Multiset::insert_after (iterator position, { Node *nodeP = position.nodeP; - // In case we are given a NULL node, object should be the tree minimum. + // In case we are given a nullptr node, object should be the tree minimum. CGAL_multiset_assertion (nodeP != &endNode); if (nodeP == &beginNode) - nodeP = NULL; + nodeP = nullptr; - if (rootP == NULL) + if (rootP == nullptr) { // In case the tree is empty, make sure that we did not receive a valid // iterator. - CGAL_multiset_precondition (nodeP == NULL); + CGAL_multiset_precondition (nodeP == nullptr); // Assign a new root node. Notice that the root is always black. rootP = _allocate_node (object, Node::BLACK); @@ -2031,7 +2031,7 @@ Multiset::insert_after (iterator position, Node *parentP; Node *newNodeP = _allocate_node (object, Node::RED); - if (nodeP == NULL) + if (nodeP == nullptr) { // The new node should become the tree minimum: Place is as the left // child of the current minimal leaf. @@ -2097,17 +2097,17 @@ Multiset::insert_before (iterator position, { Node *nodeP = position.nodeP; - // In case we are given a NULL node, object should be the tree maximum. + // In case we are given a nullptr node, object should be the tree maximum. CGAL_multiset_assertion (nodeP != &beginNode); if (nodeP == &endNode) - nodeP = NULL; + nodeP = nullptr; - if (rootP == NULL) + if (rootP == nullptr) { // In case the tree is empty, make sure that we did not receive a valid // iterator. - CGAL_multiset_precondition (nodeP == NULL); + CGAL_multiset_precondition (nodeP == nullptr); // Assign a new root node. Notice that the root is always black. rootP = _allocate_node(object, Node::BLACK); @@ -2129,7 +2129,7 @@ Multiset::insert_before (iterator position, Node *parentP; Node *newNodeP = _allocate_node (object, Node::RED); - if (nodeP == NULL) + if (nodeP == nullptr) { // The new node should become the tree maximum: Place is as the right // child of the current maximal leaf. @@ -2238,12 +2238,12 @@ template void Multiset::clear () { // Delete all the tree nodes recursively. - if (rootP != NULL) + if (rootP != nullptr) _destroy (rootP); - rootP = NULL; - beginNode.parentP = NULL; - endNode.parentP = NULL; + rootP = nullptr; + beginNode.parentP = nullptr; + endNode.parentP = nullptr; // Mark that there are no more objects in the tree. iSize = 0; @@ -2265,12 +2265,12 @@ void Multiset::replace (iterator position, // Make sure the replacement does not violate the tree order. CGAL_multiset_precondition_code (Node *_succP = nodeP->successor()); - CGAL_multiset_precondition (_succP == NULL || + CGAL_multiset_precondition (_succP == nullptr || _succP->color == Node::DUMMY_END || comp_f(object, _succP->object) != LARGER); CGAL_multiset_precondition_code (Node *_predP = nodeP->predecessor()); - CGAL_multiset_precondition (_predP == NULL || + CGAL_multiset_precondition (_predP == nullptr || _predP->color == Node::DUMMY_BEGIN || comp_f(object, _predP->object) != SMALLER); @@ -2332,23 +2332,23 @@ void Multiset::swap (iterator pos1, template bool Multiset::is_valid () const { - if (rootP == NULL) + if (rootP == nullptr) { // If there is no root, make sure that the tree is empty. if (iSize != 0 || iBlackHeight != 0) return (false); - if (beginNode.parentP != NULL || endNode.parentP != NULL) + if (beginNode.parentP != nullptr || endNode.parentP != nullptr) return (false); return (true); } // Check the validity of the fictitious nodes. - if (beginNode.parentP == NULL || beginNode.parentP->leftP != &beginNode) + if (beginNode.parentP == nullptr || beginNode.parentP->leftP != &beginNode) return (false); - if (endNode.parentP == NULL || endNode.parentP->rightP != &endNode) + if (endNode.parentP == nullptr || endNode.parentP->rightP != &endNode) return (false); // Check recursively whether the tree is valid. @@ -2384,7 +2384,7 @@ bool Multiset::is_valid () const template size_t Multiset::height () const { - if (rootP == NULL) + if (rootP == nullptr) // Empty tree. return (0); @@ -2402,16 +2402,16 @@ void Multiset::catenate (Self& tree) Node *max1_P = endNode.parentP; Node *min2_P = tree.beginNode.parentP; - if (min2_P == NULL) + if (min2_P == nullptr) { // The other tree is empty - nothing to do. - CGAL_multiset_assertion (tree.rootP == NULL); + CGAL_multiset_assertion (tree.rootP == nullptr); return; } - else if (max1_P == NULL) + else if (max1_P == nullptr) { // Our tree is empty: Copy all other tree properties to our tree. - CGAL_multiset_assertion (rootP == NULL); + CGAL_multiset_assertion (rootP == nullptr); _shallow_assign (tree); return; @@ -2427,7 +2427,7 @@ void Multiset::catenate (Self& tree) CGAL_multiset_assertion (_is_black (tree.rootP)); // Splice max1_P (or min2_P) from its tree, but without deleting it. - Node* auxP = NULL; + Node* auxP = nullptr; if (max1_P != rootP) { @@ -2450,7 +2450,7 @@ void Multiset::catenate (Self& tree) // Splice min2_P from its current poisition in the other tree. // We know it is has no left child, so we just have to connect its // right child with its parent. - if (min2_P->parentP != NULL) + if (min2_P->parentP != nullptr) { min2_P->parentP->leftP = min2_P->rightP; @@ -2471,7 +2471,7 @@ void Multiset::catenate (Self& tree) rootP->rightP = min2_P; min2_P->parentP = rootP; min2_P->color = Node::RED; - min2_P->leftP = NULL; + min2_P->leftP = nullptr; if (! _is_valid (min2_P->rightP)) { @@ -2500,12 +2500,12 @@ void Multiset::catenate (Self& tree) } // Mark that the maximal node in our tree is no longer the maximum. - if (endNode.parentP != NULL) - endNode.parentP->rightP = NULL; + if (endNode.parentP != nullptr) + endNode.parentP->rightP = nullptr; // Mark that the minimal node in the other tree is no longer the minimum. - if (tree.beginNode.parentP != NULL) - tree.beginNode.parentP->leftP = NULL; + if (tree.beginNode.parentP != nullptr) + tree.beginNode.parentP->leftP = nullptr; // Locate node1_P along the rightmost path in our tree and node2_P along the // leftmost path in the other tree, both having the same black-height. @@ -2549,7 +2549,7 @@ void Multiset::catenate (Self& tree) } // Check which one of the tree roots have we reached. - Node *newRootP = NULL; + Node *newRootP = nullptr; Node *parentP; if (node1_P == rootP) @@ -2560,7 +2560,7 @@ void Multiset::catenate (Self& tree) // auxP to be their parent. parentP = node2_P->parentP; - if (parentP == NULL) + if (parentP == nullptr) { // Make auxP the root of the catenated tree. newRootP = auxP; @@ -2582,7 +2582,7 @@ void Multiset::catenate (Self& tree) // moving auxP to be their parent. parentP = node1_P->parentP; - CGAL_multiset_assertion (parentP != NULL); + CGAL_multiset_assertion (parentP != nullptr); // The catenated tree will be rooted at the current root of our tree. newRootP = rootP; @@ -2665,7 +2665,7 @@ void Multiset::split (iterator position, int depth = 0; path[depth] = EQUAL; - while (currP->parentP != NULL) + while (currP->parentP != nullptr) { depth++; if (currP == currP->parentP->leftP) @@ -2682,14 +2682,14 @@ void Multiset::split (iterator position, size_t iCurrBHeight = iBlackHeight; Self leftTree; size_t iLeftBHeight = 0; - Node *spineLeftP = NULL; - Node *auxLeftP = NULL; + Node *spineLeftP = nullptr; + Node *auxLeftP = nullptr; Self rightTree; size_t iRightBHeight = 0; - Node *spineRightP = NULL; - Node *auxRightP = NULL; - Node *childP = NULL; - Node *nextP = NULL; + Node *spineRightP = nullptr; + Node *auxRightP = nullptr; + Node *childP = nullptr; + Node *nextP = nullptr; while (depth >= 0) { @@ -2715,14 +2715,14 @@ void Multiset::split (iterator position, childP = currP->rightP; nextP = currP->leftP; - if (_is_valid (childP) && rightTree.rootP == NULL) + if (_is_valid (childP) && rightTree.rootP == nullptr) { // Assing T_r to rightTree. rightTree.rootP = childP; rightTree.iBlackHeight = iCurrBHeight; // Make sure the root of rightTree is black. - rightTree.rootP->parentP = NULL; + rightTree.rootP->parentP = nullptr; if (_is_red (rightTree.rootP)) { rightTree.rootP->color = Node::BLACK; @@ -2773,7 +2773,7 @@ void Multiset::split (iterator position, auxRightP->leftP = childP; auxRightP->rightP = spineRightP; - if (auxRightP->parentP != NULL) + if (auxRightP->parentP != nullptr) auxRightP->parentP->leftP = auxRightP; else rightTree.rootP = auxRightP; @@ -2783,7 +2783,7 @@ void Multiset::split (iterator position, // Perform a fixup on the right tree. rightTree._insert_fixup (auxRightP); - auxRightP = NULL; + auxRightP = nullptr; // Note that childP is now located on the leftmost spine of // rightTree and its black-height is exactly iCurrRightBHeight. @@ -2793,9 +2793,9 @@ void Multiset::split (iterator position, // In case we have an auxiliary right node that has not been inserted // into the right tree, insert it now. - if (auxRightP != NULL) + if (auxRightP != nullptr) { - if (rightTree.rootP != NULL) + if (rightTree.rootP != nullptr) { // The right tree is not empty. Traverse its leftmost spine to // locate the parent of auxRightP. @@ -2804,8 +2804,8 @@ void Multiset::split (iterator position, auxRightP->parentP = spineRightP; auxRightP->color = Node::RED; - auxRightP->rightP = NULL; - auxRightP->leftP = NULL; + auxRightP->rightP = nullptr; + auxRightP->leftP = nullptr; spineRightP->leftP = auxRightP; @@ -2819,16 +2819,16 @@ void Multiset::split (iterator position, rightTree.rootP = auxRightP; rightTree.iBlackHeight = 1; - auxRightP->parentP = NULL; + auxRightP->parentP = nullptr; auxRightP->color = Node::BLACK; - auxRightP->rightP = NULL; - auxRightP->leftP = NULL; + auxRightP->rightP = nullptr; + auxRightP->leftP = nullptr; } // Assign spineRightP to be the auxiliary node. spineRightP = auxRightP; iRightBHeight = (_is_black (spineRightP)) ? 1 : 0; - auxRightP = NULL; + auxRightP = nullptr; } // Mark currP as the auxiliary right node. @@ -2850,14 +2850,14 @@ void Multiset::split (iterator position, childP = currP->leftP; nextP = currP->rightP; - if (_is_valid (childP) && leftTree.rootP == NULL) + if (_is_valid (childP) && leftTree.rootP == nullptr) { // Assing T_l to leftTree. leftTree.rootP = childP; leftTree.iBlackHeight = iCurrBHeight; // Make sure the root of leftTree is black. - leftTree.rootP->parentP = NULL; + leftTree.rootP->parentP = nullptr; if (_is_red (leftTree.rootP)) { leftTree.rootP->color = Node::BLACK; @@ -2908,7 +2908,7 @@ void Multiset::split (iterator position, auxLeftP->leftP = spineLeftP; auxLeftP->rightP = childP; - if (auxLeftP->parentP != NULL) + if (auxLeftP->parentP != nullptr) auxLeftP->parentP->rightP = auxLeftP; else leftTree.rootP = auxLeftP; @@ -2918,7 +2918,7 @@ void Multiset::split (iterator position, // Perform a fixup on the left tree. leftTree._insert_fixup (auxLeftP); - auxLeftP = NULL; + auxLeftP = nullptr; // Note that childP is now located on the rightmost spine of // leftTree and its black-height is exactly iCurrLeftBHeight. @@ -2928,9 +2928,9 @@ void Multiset::split (iterator position, // In case we have an auxiliary left node that has not been inserted // into the left tree, insert it now. - if (auxLeftP != NULL) + if (auxLeftP != nullptr) { - if (leftTree.rootP != NULL) + if (leftTree.rootP != nullptr) { // The left tree is not empty. Traverse its rightmost spine to // locate the parent of auxLeftP. @@ -2939,8 +2939,8 @@ void Multiset::split (iterator position, auxLeftP->parentP = spineLeftP; auxLeftP->color = Node::RED; - auxLeftP->rightP = NULL; - auxLeftP->leftP = NULL; + auxLeftP->rightP = nullptr; + auxLeftP->leftP = nullptr; spineLeftP->rightP = auxLeftP; @@ -2954,16 +2954,16 @@ void Multiset::split (iterator position, leftTree.rootP = auxLeftP; leftTree.iBlackHeight = 1; - auxLeftP->parentP = NULL; + auxLeftP->parentP = nullptr; auxLeftP->color = Node::BLACK; - auxLeftP->rightP = NULL; - auxLeftP->leftP = NULL; + auxLeftP->rightP = nullptr; + auxLeftP->leftP = nullptr; } // Assign spineLeftP to be the auxiliary node. spineLeftP = auxLeftP; iLeftBHeight = (_is_black (spineLeftP)) ? 1 : 0; - auxLeftP = NULL; + auxLeftP = nullptr; } // Mark currP as the auxiliary right node. @@ -2979,7 +2979,7 @@ void Multiset::split (iterator position, // It is now possible to free the path. delete[] path; - CGAL_multiset_assertion (auxLeftP == NULL && auxRightP == nodeP); + CGAL_multiset_assertion (auxLeftP == nullptr && auxRightP == nodeP); // Fix the properties of the left tree: We know its minimal node is the // same as the current minimum. @@ -3002,15 +3002,15 @@ void Multiset::split (iterator position, // We still have to insert the split node as the minimum node of the right // tree (we can traverse its leftmost path to find its parent). - if (rightTree.rootP != NULL) + if (rightTree.rootP != nullptr) { while (_is_valid (spineRightP->leftP)) spineRightP = spineRightP->leftP; nodeP->parentP = spineRightP; nodeP->color = Node::RED; - nodeP->rightP = NULL; - nodeP->leftP = NULL; + nodeP->rightP = nullptr; + nodeP->leftP = nullptr; spineRightP->leftP = nodeP; @@ -3024,10 +3024,10 @@ void Multiset::split (iterator position, rightTree.rootP = nodeP; rightTree.iBlackHeight = 1; - nodeP->parentP = NULL; + nodeP->parentP = nullptr; nodeP->color = Node::BLACK; - nodeP->rightP = NULL; - nodeP->leftP = NULL; + nodeP->rightP = nullptr; + nodeP->leftP = nullptr; // In this case we also know the tree sizes: leftTree.iSize = iSize - 1; @@ -3062,12 +3062,12 @@ void Multiset::_shallow_assign (Self& tree) // Properly mark the minimal and maximal tree nodes. beginNode.parentP = tree.beginNode.parentP; - if (beginNode.parentP != NULL) + if (beginNode.parentP != nullptr) beginNode.parentP->leftP = &beginNode; endNode.parentP = tree.endNode.parentP; - if (endNode.parentP != NULL) + if (endNode.parentP != nullptr) endNode.parentP->rightP = &endNode; // Clear the other tree (without actually deallocating the nodes). @@ -3082,11 +3082,11 @@ void Multiset::_shallow_assign (Self& tree) template void Multiset::_shallow_clear () { - rootP = NULL; + rootP = nullptr; iSize = 0; iBlackHeight = 0; - beginNode.parentP = NULL; - endNode.parentP = NULL; + beginNode.parentP = nullptr; + endNode.parentP = nullptr; return; } @@ -3106,9 +3106,9 @@ void Multiset::_remove_at (Node* nodeP) // thus emptying the tree. _deallocate_node (rootP); - rootP = NULL; - beginNode.parentP = NULL; - endNode.parentP = NULL; + rootP = nullptr; + beginNode.parentP = nullptr; + endNode.parentP = nullptr; iSize = 0; iBlackHeight = 0; @@ -3132,7 +3132,7 @@ void Multiset::_remove_at (Node* nodeP) } // At this stage, the node we are going to remove has at most one child. - Node *childP = NULL; + Node *childP = nullptr; if (_is_valid (nodeP->leftP)) { @@ -3149,7 +3149,7 @@ void Multiset::_remove_at (Node* nodeP) if (_is_valid (childP)) childP->parentP = nodeP->parentP; - if (nodeP->parentP == NULL) + if (nodeP->parentP == nullptr) { // If we are deleting the root, make the child the new tree node. rootP = childP; @@ -3185,7 +3185,7 @@ void Multiset::_remove_at (Node* nodeP) if (_is_valid (beginNode.parentP)) beginNode.parentP->leftP = &beginNode; else - beginNode.parentP = NULL; + beginNode.parentP = nullptr; } else if (nodeP == endNode.parentP) { @@ -3194,7 +3194,7 @@ void Multiset::_remove_at (Node* nodeP) if (_is_valid (endNode.parentP)) endNode.parentP->rightP = &endNode; else - endNode.parentP = NULL; + endNode.parentP = nullptr; } // Delete the unnecessary node. @@ -3228,7 +3228,7 @@ void Multiset::_swap (Node* node1_P, if (node1_P != node2_P->parentP) { - if (node2_P->parentP == NULL) + if (node2_P->parentP == nullptr) { rootP = node1_P; } @@ -3276,7 +3276,7 @@ void Multiset::_swap (Node* node1_P, if (node2_P != parent1_P) { - if (parent1_P == NULL) + if (parent1_P == nullptr) { rootP = node2_P; } @@ -3462,7 +3462,7 @@ bool Multiset::_sub_is_valid return (false); // If the node is red, make sure that both it children are black (note that - // NULL nodes are also considered to be black). + // nullptr nodes are also considered to be black). if (_is_red (nodeP) && (! _is_black (nodeP->rightP) || ! _is_black (nodeP->leftP))) { @@ -3572,7 +3572,7 @@ void Multiset::_rotate_left (Node* xNodeP) // Assign x's parent to be y's parent. yNodeP->parentP = xNodeP->parentP; - if (xNodeP->parentP == NULL) + if (xNodeP->parentP == nullptr) { // Make y the new tree root. rootP = yNodeP; @@ -3618,7 +3618,7 @@ void Multiset::_rotate_right (Node* yNodeP) // Assign y's parent to be x's parent. xNodeP->parentP = yNodeP->parentP; - if (yNodeP->parentP == NULL) + if (yNodeP->parentP == nullptr) { // Make x the new tree root. rootP = xNodeP; @@ -3683,11 +3683,11 @@ void Multiset::_destroy (Node* nodeP) // Destroy the children recursively. if (_is_valid (nodeP->rightP)) _destroy (nodeP->rightP); - nodeP->rightP = NULL; + nodeP->rightP = nullptr; if (_is_valid (nodeP->leftP)) _destroy (nodeP->leftP); - nodeP->leftP = NULL; + nodeP->leftP = nullptr; // Free the subtree root node. _deallocate_node (nodeP); @@ -3715,7 +3715,7 @@ void Multiset::_insert_fixup (Node* nodeP) // Get a pointer to the current node's grandparent (notice the root is // always black, so the red parent must have a parent). grandparentP = currP->parentP->parentP; - CGAL_multiset_precondition (grandparentP != NULL); + CGAL_multiset_precondition (grandparentP != nullptr); if (currP->parentP == grandparentP->leftP) { @@ -3727,7 +3727,7 @@ void Multiset::_insert_fixup (Node* nodeP) { // If both parent and uncle are red, color them black and color the // grandparent red. - // In case of a NULL uncle, we treat it as a black node. + // In case of a nullptr uncle, we treat it as a black node. currP->parentP->color = Node::BLACK; uncleP->color = Node::BLACK; grandparentP->color = Node::RED; @@ -3765,7 +3765,7 @@ void Multiset::_insert_fixup (Node* nodeP) { // If both parent and uncle are red, color them black and color the // grandparent red. - // In case of a NULL uncle, we treat it as a black node. + // In case of a nullptr uncle, we treat it as a black node. currP->parentP->color = Node::BLACK; uncleP->color = Node::BLACK; grandparentP->color = Node::RED; @@ -3828,7 +3828,7 @@ void Multiset::_remove_fixup (Node* nodeP, // child of the parent. siblingP = currParentP->rightP; - // Check the sibling's color. Notice that NULL nodes are treated + // Check the sibling's color. Notice that nullptr nodes are treated // as if they are colored black. if (_is_red (siblingP)) { @@ -3856,7 +3856,7 @@ void Multiset::_remove_fixup (Node* nodeP, // the black height of the entire tree. if (currP == rootP) { - CGAL_multiset_assertion (currParentP == NULL); + CGAL_multiset_assertion (currParentP == nullptr); iBlackHeight--; } } @@ -3892,7 +3892,7 @@ void Multiset::_remove_fixup (Node* nodeP, // child of the parent. siblingP = currParentP->leftP; - // Check the sibling's color. Notice that NULL nodes are treated + // Check the sibling's color. Notice that nullptr nodes are treated // as if they are colored black. if (_is_red (siblingP)) { @@ -3921,7 +3921,7 @@ void Multiset::_remove_fixup (Node* nodeP, // the black height of the entire tree. if (currP == rootP) { - CGAL_multiset_assertion (currParentP == NULL); + CGAL_multiset_assertion (currParentP == nullptr); iBlackHeight--; } } diff --git a/STL_Extension/include/CGAL/Object.h b/STL_Extension/include/CGAL/Object.h index f04f5ec04ce..176aa8ce9b9 100644 --- a/STL_Extension/include/CGAL/Object.h +++ b/STL_Extension/include/CGAL/Object.h @@ -74,7 +74,7 @@ class Object // implicit constructor from optionals containing variants template Object(const boost::optional< boost::variant >& t) - : obj( t ? boost::apply_visitor(Any_from_variant(), *t) : NULL) { } + : obj( t ? boost::apply_visitor(Any_from_variant(), *t) : nullptr) { } // implicit constructor from variants template @@ -140,10 +140,10 @@ class Object } #ifndef CGAL_NO_DEPRECATED_CODE - // The comparisons with NULL are only there for Nef... - bool operator==(Nullptr_t CGAL_assertion_code(n)) const + // The comparisons with nullptr are only there for Nef... + bool operator==(std::nullptr_t CGAL_assertion_code(n)) const { CGAL_assertion(n == 0); return empty(); } - bool operator!=(Nullptr_t CGAL_assertion_code(n)) const + bool operator!=(std::nullptr_t CGAL_assertion_code(n)) const { CGAL_assertion(n == 0); return !empty(); } #endif // CGAL_NO_DEPRECATED_CODE @@ -185,7 +185,7 @@ const T * object_cast(const Object * o) if(o->obj) return boost::any_cast((o->obj).get()); else - return NULL; + return nullptr; } template diff --git a/STL_Extension/include/CGAL/Time_stamper.h b/STL_Extension/include/CGAL/Time_stamper.h index 904c82b6c98..1be5bdfbd59 100644 --- a/STL_Extension/include/CGAL/Time_stamper.h +++ b/STL_Extension/include/CGAL/Time_stamper.h @@ -76,22 +76,22 @@ struct Time_stamper static std::size_t time_stamp(const T* pt) { - if(pt == NULL){ + if(pt == nullptr){ return std::size_t(-1); } return pt->time_stamp(); } static std::size_t hash_value(const T* p) { - if(NULL == p) + if(nullptr == p) return std::size_t(-1); else return p->time_stamp(); } static bool less(const T* p_t1, const T* p_t2) { - if(p_t1 == NULL) return (p_t2 != NULL); - else if(p_t2 == NULL) return false; + if(p_t1 == nullptr) return (p_t2 != nullptr); + else if(p_t2 == nullptr) return false; else { CGAL_assertion((p_t1 == p_t2) == (time_stamp(p_t1) == time_stamp(p_t2))); return time_stamp(p_t1) < time_stamp(p_t2); diff --git a/STL_Extension/include/CGAL/iterator.h b/STL_Extension/include/CGAL/iterator.h index 08b31d48a65..e01cc96a36c 100644 --- a/STL_Extension/include/CGAL/iterator.h +++ b/STL_Extension/include/CGAL/iterator.h @@ -386,12 +386,12 @@ public: Circulator current_circulator() const { return nt;} Iterator current_iterator() const { return nt;} - bool operator==( Nullptr_t p) const { + bool operator==( std::nullptr_t p) const { CGAL_USE(p); CGAL_assertion( p == 0); return empty; } - bool operator!=( Nullptr_t p) const { return !(*this == p); } + bool operator!=( std::nullptr_t p) const { return !(*this == p); } bool operator==( const Self& i) const { return (empty && i.empty) ||( nt == i.nt); } bool operator!=( const Self& i) const { return !(*this == i); } reference operator*() const { return *nt; } diff --git a/Scale_space_reconstruction_3/include/CGAL/Scale_space_reconstruction_3/Alpha_shape_mesher.h b/Scale_space_reconstruction_3/include/CGAL/Scale_space_reconstruction_3/Alpha_shape_mesher.h index e418c39257f..1f465a0b48d 100644 --- a/Scale_space_reconstruction_3/include/CGAL/Scale_space_reconstruction_3/Alpha_shape_mesher.h +++ b/Scale_space_reconstruction_3/include/CGAL/Scale_space_reconstruction_3/Alpha_shape_mesher.h @@ -185,7 +185,7 @@ public: : _separate_shells (separate_shells), _force_manifold (force_manifold), _border_angle (border_angle), - _shape (NULL), + _shape (nullptr), _squared_radius (squared_radius) { @@ -333,10 +333,10 @@ private: void deinit_shape() { - if (_shape != NULL) + if (_shape != nullptr) { delete _shape; - _shape = NULL; + _shape = nullptr; } } diff --git a/Scale_space_reconstruction_3/include/CGAL/Scale_space_reconstruction_3/Shape_construction_3.h b/Scale_space_reconstruction_3/include/CGAL/Scale_space_reconstruction_3/Shape_construction_3.h index 7520f6815f7..ecae12c9fd1 100644 --- a/Scale_space_reconstruction_3/include/CGAL/Scale_space_reconstruction_3/Shape_construction_3.h +++ b/Scale_space_reconstruction_3/include/CGAL/Scale_space_reconstruction_3/Shape_construction_3.h @@ -114,7 +114,7 @@ public: * the object after use. * * \param shape points to the shape to base the new shape on. - * If `shape` is NULL, the new shape will not contain any vertices. + * If `shape` is nullptr, the new shape will not contain any vertices. * Otherwise, the new shape will clone the vertices. * \param squared_radius is the squared scale parameter of the shape. * \return a pointer to the new shape. @@ -148,10 +148,10 @@ public: * * \param shape points to the shape to adjust. * \param squared_radius is the new squared scale parameter of the shape. - * \pre `shape` is not NULL. + * \pre `shape` is not nullptr. */ void change_scale( Shape* shape, const FT& squared_radius ) const { - CGAL_assertion( shape != NULL ); + CGAL_assertion( shape != nullptr ); shape->set_alpha( squared_radius ); } /// \} @@ -207,7 +207,7 @@ public: * replace it by a new shape. */ void change_scale( Shape*& shape, const FT& squared_radius ) const { - CGAL_assertion( shape != NULL ); + CGAL_assertion( shape != nullptr ); Shape* tmp = construct( shape, squared_radius ); delete shape; shape = tmp; diff --git a/Scripts/developer_scripts/tag_pr_per_release.sh b/Scripts/developer_scripts/tag_pr_per_release.sh new file mode 100644 index 00000000000..af182a31c83 --- /dev/null +++ b/Scripts/developer_scripts/tag_pr_per_release.sh @@ -0,0 +1,40 @@ +#!/bin/bash + +# this script requires ghi: https://github.com/stephencelis/ghi +# example calls within a git repo +# bash tag_pr_per_release.sh 4.12 4.12.1 +# bash tag_pr_per_release.sh 4.12 4.13 +# bash tag_pr_per_release.sh 4.13 4.13.1 +# +# After the release of CGAL-5.0 the release manager needs to call: +# bash tag_pr_per_release.sh 4.14 5.0 +# +# After the release of CGAL-4.14.1 the release manager needs to call: +# bash tag_pr_per_release.sh 4.14 4.14.1 +# +# After the release of CGAL-4.14.2 the release manager needs to call: +# bash tag_pr_per_release.sh 4.14 4.14.2 +# + + +PREVIOUS_MAJOR_RELEASE=$1 +CURRENT_RELEASE=$2 + +PR_LIST=`git log releases/CGAL-${PREVIOUS_MAJOR_RELEASE}..releases/CGAL-${CURRENT_RELEASE} --merges | grep "Merge pull request" | sort -u | awk '{print $4}' | sed 's/#//'` +for i in ${PR_LIST}; do + echo ghi label $i -a Merged_in_${CURRENT_RELEASE} -- CGAL/cgal +done + +read -p "Please confirm operation by typing YES? " -n 4 -r +echo # (optional) move to a new line +if [[ $REPLY =~ ^YES$ ]]; then + + for i in ${PR_LIST}; do + ghi label $i -a Merged_in_${CURRENT_RELEASE} -- CGAL/cgal + done + +else + + echo "Abort" + +fi diff --git a/Scripts/scripts/cgal_create_CMakeLists b/Scripts/scripts/cgal_create_CMakeLists index 1492eccb72c..6e4e7dbfcb9 100755 --- a/Scripts/scripts/cgal_create_CMakeLists +++ b/Scripts/scripts/cgal_create_CMakeLists @@ -53,8 +53,6 @@ create_cmake_script_with_options() { - qt4='n' - # parse options file if [ -e "$OPTIONS_FILE" ]; then @@ -99,7 +97,7 @@ create_cmake_script_with_options() # Created by the script cgal_create_CMakeLists # This is the CMake script for compiling a set of CGAL applications. -cmake_minimum_required(VERSION 3.1...3.13) +cmake_minimum_required(VERSION 3.1...3.14) EOF #--------------------------------------------------------------------------- @@ -112,20 +110,15 @@ EOF #vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv cat << 'EOF' - # CGAL and its components EOF -if [ -n "$ENABLE_CTEST" ]; then - echo "enable_testing()" -fi #--------------------------------------------------------------------------- # echo "CGAL_COMPONENTS: $CGAL_COMPONENTS" if [ ! -z "$CGAL_COMPONENTS" ]; then # ensure capitalization - # CGAL: Core, Qt4, PDB, ImageIO + # CGAL: Core, PDB, ImageIO CGAL_COMPONENTS=${CGAL_COMPONENTS//[c|C][o|O][r|R][e|E]/Core} - CGAL_COMPONENTS=${CGAL_COMPONENTS//[q|Q][t|T]4/Qt4} CGAL_COMPONENTS=${CGAL_COMPONENTS//[i|I][m|M][a|A][g|G][e|E][i|I][o|O]/ImageIO} # external libs @@ -161,120 +154,35 @@ fi IFS=':' for cgal_component in $CGAL_COMPONENTS; do COMPONENT=`echo $cgal_component | tr '[:upper:]' '[:lower:]'` - - # for qtmoc - if [ "$COMPONENT" = "qt4" ]; then - qt4='y' - fi - done IFS=$OLDIFS - fi - echo "find_package( CGAL REQUIRED QUIET OPTIONAL_COMPONENTS ${CGAL_COMPONENTS//:/ } )" - + if [ -n "${CGAL_COMPONENTS}" ]; then + echo "find_package( CGAL REQUIRED OPTIONAL_COMPONENTS ${CGAL_COMPONENTS//:/ } )" + else + echo "find_package( CGAL REQUIRED )" + fi #vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv - cat << 'EOF' -if ( NOT CGAL_FOUND ) - - message(STATUS "This project requires the CGAL library, and will not be compiled.") - return() - -endif() - -EOF - #--------------------------------------------------------------------------- - - #vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv - cat << 'EOF' + if [ ! -z "$BOOST_COMPONENTS" ]; then + cat << 'EOF' # Boost and its components EOF - #--------------------------------------------------------------------------- - - if [ ! -z "$BOOST_COMPONENTS" ]; then - - echo "find_package( Boost REQUIRED COMPONENTS ${BOOST_COMPONENTS//:/ } )" - - else - - echo "find_package( Boost REQUIRED )" + echo "find_package( Boost REQUIRED OPTIONAL_COMPONENTS ${BOOST_COMPONENTS//:/ } )" fi # additional Boost components - - #vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv - cat << 'EOF' - -if ( NOT Boost_FOUND ) - - message(STATUS "This project requires the Boost library, and will not be compiled.") - - return() - -endif() -EOF - #--------------------------------------------------------------------------- - - - #vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv - cat << 'EOF' - -# include for local directory -EOF #--------------------------------------------------------------------------- if [ -d include ] ; then + cat << 'EOF' + +# include for local directory +EOF echo 'include_directories( BEFORE include )' fi - #vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv - cat << 'EOF' - -# include for local package -EOF - #--------------------------------------------------------------------------- - - # includes for local package - if [ -d ../include ] ; then - echo 'include_directories( BEFORE ../include )' - fi - - if [ ! -z "$PACKAGES" ]; then - #vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv - cat << 'EOF' - -# include of additional packages -EOF - #------------------------------------------------------------------------- - fi - - # Qt4 - if [ "$qt4" = "y" ]; then - - #vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv - cat << 'EOF' - -# Qt4 -set( QT_USE_QTXML true ) -set( QT_USE_QTMAIN true ) -set( QT_USE_QTSCRIPT true ) -set( QT_USE_QTOPENGL true ) - -find_package(Qt4) - -if ( NOT QT_FOUND ) - - message(STATUS "This project requires the Qt4 library, and will not be compiled.") - return() - -endif() -EOF - #------------------------------------------------------------------------- - - fi #qt4 - if [ ! -z "$BOOST_COMPONENTS" ]; then #vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv cat << 'EOF' @@ -288,7 +196,7 @@ EOF for boost_component in $BOOST_COMPONENTS; do BOOST_COMPONENT=`echo $boost_component | tr '[:lower:]' '[:upper:]'` echo "add_definitions( \"-DCGAL_USE_BOOST_${BOOST_COMPONENT}\" )" - echo "list(APPEND CGAL_3RD_PARTY_LIBRARIES \${Boost_${BOOST_COMPONENT}_LIBRARY} )" + echo "list(APPEND CGAL_3RD_PARTY_LIBRARIES Boost::${boost_component} )" done IFS=$OLDIFS @@ -306,33 +214,12 @@ EOF #vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv cat << 'EOF' - # Creating entries for all C++ files with "main" routine # ########################################################## - EOF #------------------------------------------------------------------------- - # add a new line - echo - - # Qt4 - if [ "$qt4" = "y" ]; then - #vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv - cat << 'EOF' - -if ( CGAL_Qt4_FOUND AND QT_FOUND ) - - include( ${QT_USE_FILE} ) - include_directories( ${QT_INCLUDE_DIR} ) - -endif() - -EOF - #----------------------------------------------------------------------- - fi # qt4 - for file in `ls *.cc *.cp *.cxx *.cpp *.CPP *.c++ *.C 2> /dev/null | sort` ; do # Create an executable for each cpp that contains a function "main()" BASE=`basename $file .cc` @@ -344,32 +231,8 @@ EOF BASE=`basename $BASE .C` egrep '\bmain[ \t]*\(' $file >/dev/null 2>&1 if [ $? -eq 0 ]; then - if [ "$qt4" = "y" ]; then - echo "create_single_source_cgal_program_qt4( \"$file\" )" - else - echo "create_single_source_cgal_program( \"$file\" )" - fi - if [ -n "$ENABLE_CTEST" ]; then - if [ -f "$BASE.cin" ] ; then - CIN=" < $BASE.cin" - else - CIN= - fi - cat < /dev/null | sort`; do - echo " qt4_wrap_ui( DT_UI_FILES $file )" - done - echo - echo " # qrc files (resources files, that contain icons, at least)" - for file in `ls *.qrc 2> /dev/null | sort`; do - echo " qt4_add_resources ( DT_RESOURCE_FILES ./$file )" - done - echo - MOC_FILES="" - echo " # use the Qt MOC preprocessor on classes that derives from QObject" - for file in `ls include/*.h 2> /dev/null | sort`; do - BASE=`basename $file .h` - egrep 'Q_OBJECT' $file >/dev/null 2>&1 - if [ $? -eq 0 ]; then - echo " qt4_generate_moc( include/${BASE}.h ${BASE}.moc )" - MOC_FILES="${BASE}.moc $MOC_FILES" - fi - done - for file in `ls *.h 2> /dev/null | sort`; do - BASE=`basename $file .h` - egrep 'Q_OBJECT' $file >/dev/null 2>&1 - if [ $? -eq 0 ]; then - echo " qt4_generate_moc( ${BASE}.h ${BASE}.moc )" - MOC_FILES="${BASE}.moc $MOC_FILES" - fi - done - for file in `ls *.cc *.cp *.cxx *.cpp *.CPP *.c++ *.C 2> /dev/null | sort` ; do - BASE=`basename $file .cc` - BASE=`basename $BASE .cp` - BASE=`basename $BASE .cxx` - BASE=`basename $BASE .cpp` - BASE=`basename $BASE .CPP` - BASE=`basename $BASE .c++` - BASE=`basename $BASE .C` - egrep 'Q_OBJECT' $file >/dev/null 2>&1 - if [ $? -eq 0 ]; then - echo " qt4_generate_moc( ${BASE}.cpp ${BASE}.moc )" - MOC_FILES="${BASE}.moc $MOC_FILES" - fi - done - - #vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv - cat << 'EOF' - -endif() -EOF - #----------------------------------------------------------------------- - - all="${all} ${MOC_FILES} \${DT_UI_FILES} \${DT_RESOURCE_FILES}" - - fi # qt4 - # no 'cat' here, as variable substitution required echo echo "add_executable( ${target_name} ${all} )" @@ -468,21 +264,11 @@ EOF echo echo "# Link the executable to CGAL and third-party libraries" LIBS="" - if [ "$qt4" = "y" ]; then - LIBS="\${QT_LIBRARIES}" - fi LIBS=$LIBS" \${CGAL_LIBRARIES} \${CGAL_3RD_PARTY_LIBRARIES}" echo "target_link_libraries(${target_name} $LIBS )" fi # single source or all files #=========================================== - #vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv - cat << 'EOF' -EOF - #--------------------------------------------------------------------------- - -echo - } usage() @@ -490,9 +276,9 @@ usage() echo "Usage: `basename $0` [-s source] [-c cgal-component1:cgal-component2:...] [-b boost-component1:boost-component2:...] [-p] [-o options_file='`pwd`/cgal_cmake_options:$HOME/.cgal_cmake_options_rc'] [-v] [-h]" >&2 echo >&2 echo " -s source If this parameter is given the script will create one single executable for 'source' with all source files; otherwise it creates one executable for each main'ed source." >&2 - echo " cgal_componentX - must be a valid cgal component, examples are 'Core','ImageIO','Qt4' ('benchmark', 'symbolic')." >&2 + echo " cgal_componentX - must be a valid cgal component, examples are 'Core','ImageIO'." >&2 echo " boost_componentX - must be a valid boost component, like 'filesystem', 'program_options'." >&2 - echo " -o options_file - file with PACKAGE, DIRECTORY, CGAL_COMPONENT, and BOOST_COMPONENT directives" >&2 + echo " -o options_file - file with CGAL_COMPONENT, and BOOST_COMPONENT directives" >&2 echo " -v the version" >&2 echo " -h this info screen" >&2 echo >&2 @@ -577,8 +363,6 @@ while getopts s:c:b:o:phvt OPT; do exit 1 fi ;; - t) ENABLE_CTEST='y' - ;; h) usage exit 0 ;; diff --git a/Scripts/scripts/cgal_create_cmake_script b/Scripts/scripts/cgal_create_cmake_script index 79002e65b60..99165f76b67 100755 --- a/Scripts/scripts/cgal_create_cmake_script +++ b/Scripts/scripts/cgal_create_cmake_script @@ -40,20 +40,11 @@ create_cmake_script() # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -cmake_minimum_required(VERSION 3.1...3.13) -project( ${PROJECT}_${TYPE} ) -EOF - cat <<'EOF' +cmake_minimum_required(VERSION 3.1...3.14) +project( ${PROJECT}${TYPE} ) -set(CMAKE_CXX_STANDARD 14) - -EOF - - cat <<'EOF' find_package(CGAL REQUIRED QUIET OPTIONAL_COMPONENTS Core ) -if ( CGAL_FOUND ) - EOF if [ -d "${SOURCE_DIR}" ] ; then echo " set(CGAL_CURRENT_SOURCE_DIR \"${SOURCE_DIR}\")" @@ -79,20 +70,10 @@ EOF BASE=`basename $BASE .C` egrep '\bmain[ \t]*\(' $file >/dev/null 2>&1 if [ $? -eq 0 ]; then - echo " create_single_source_cgal_program( \"$file\" )" + echo "create_single_source_cgal_program( \"$file\" )" echo "Adding a target ${BASE}..." >&3 fi done - - cat <<'EOF' - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() -EOF - echo } @@ -119,13 +100,13 @@ while [ $1 ]; do usage; exit ;; example) - if [ -z "$TYPE" ]; then TYPE=$1; shift; else usage; exit 1; fi + if [ -z "$TYPE" ]; then TYPE=_Examples; shift; else usage; exit 1; fi ;; demo) - if [ -z "$TYPE" ]; then TYPE=$1; shift; else usage; exit 1; fi + if [ -z "$TYPE" ]; then TYPE=_Demo; shift; else usage; exit 1; fi ;; test) - if [ -z "$TYPE" ]; then TYPE=$1; shift; else usage; exit 1; fi + if [ -z "$TYPE" ]; then TYPE=; shift; else usage; exit 1; fi ;; --source_dir) if [ -d "$2" ]; then diff --git a/SearchStructures/include/CGAL/Segment_tree_d.h b/SearchStructures/include/CGAL/Segment_tree_d.h index 625050bd1c5..0343b020842 100644 --- a/SearchStructures/include/CGAL/Segment_tree_d.h +++ b/SearchStructures/include/CGAL/Segment_tree_d.h @@ -159,7 +159,7 @@ protected: { if ((is_less_equal(m_interface.get_left(element), v->left_key) && is_less_equal(v->right_key, m_interface.get_right(element))) - || left(v)==CGAL_TREE_BASE_NULL) + || left(v)==CGAL_TREE_BASE_nullptr) v->objects.push_back( element); else { @@ -174,7 +174,7 @@ protected: // elements is created. void build_next_dimension(link_type v) { - if(left(v)!=CGAL_TREE_BASE_NULL) + if(left(v)!=CGAL_TREE_BASE_nullptr) { build_next_dimension(left(v)); build_next_dimension(right(v)); @@ -261,7 +261,7 @@ protected: leftchild = vleft; rightchild = vright; prevchild = vparent; - if(leftmostlink == CGAL_TREE_BASE_NULL) + if(leftmostlink == CGAL_TREE_BASE_nullptr) leftmostlink = leftchild; } else @@ -288,7 +288,7 @@ protected: build_segment_tree(n - (int)n/2, leftchild, rightchild, prevchild, leftmostlink, index, last, keys); link_type vparent = new_Segment_tree_node_t - (prevchild, CGAL_TREE_BASE_NULL, prevchild->left_key, prevchild->left_key); + (prevchild, CGAL_TREE_BASE_nullptr, prevchild->left_key, prevchild->left_key); prevchild->parent_link = vparent; build_segment_tree((int)n/2, leftchild, rightchild, prevchild, leftmostlink, index, last, keys); @@ -301,7 +301,7 @@ protected: void delete_tree(link_type v) { - if(v->left_link!=CGAL_TREE_BASE_NULL) + if(v->left_link!=CGAL_TREE_BASE_nullptr) { delete_tree(left(v)); delete_tree(right(v)); @@ -455,7 +455,7 @@ protected: if(! T->is_valid()) return false; } - if(left(v)!=CGAL_TREE_BASE_NULL) + if(left(v)!=CGAL_TREE_BASE_nullptr) { if(!is_valid(left(v))) return false; @@ -491,19 +491,19 @@ public: // construction of a tree Segment_tree_d(Segment_tree_d const &sub_tree, bool): - sublayer_tree(sub_tree.sublayer_tree->clone()), is_built(false), header(CGAL_TREE_BASE_NULL) + sublayer_tree(sub_tree.sublayer_tree->clone()), is_built(false), header(CGAL_TREE_BASE_nullptr) {} // construction of a tree, definition of the prototype of sublayer tree Segment_tree_d(Tree_base const &sub_tree): - sublayer_tree(sub_tree.clone()), is_built(false), header(CGAL_TREE_BASE_NULL) + sublayer_tree(sub_tree.clone()), is_built(false), header(CGAL_TREE_BASE_nullptr) {} // destruction ~Segment_tree_d() { link_type v=root(); - if(v!=CGAL_TREE_BASE_NULL) + if(v!=CGAL_TREE_BASE_nullptr) delete_tree(v); if (header!=0) delete_node(header); @@ -587,7 +587,7 @@ public: link_type leftchild; link_type rightchild; link_type prevchild; - link_type leftmostlink = CGAL_TREE_BASE_NULL; + link_type leftmostlink = CGAL_TREE_BASE_nullptr; int start = 0; build_segment_tree(num-1, leftchild, rightchild, prevchild, @@ -658,7 +658,7 @@ public: return result; } link_type v = root(); - if(v!=CGAL_TREE_BASE_NULL) + if(v!=CGAL_TREE_BASE_nullptr) return window_query(win, result, v); return result; } @@ -711,7 +711,7 @@ public: return result; } link_type v = root(); - if(v!=CGAL_TREE_BASE_NULL) + if(v!=CGAL_TREE_BASE_nullptr) return enclosing_query(win, result, v); return result; } @@ -719,7 +719,7 @@ public: bool is_valid() const { link_type v= root(); - if(v!=CGAL_TREE_BASE_NULL) + if(v!=CGAL_TREE_BASE_nullptr) return is_valid(v); return true; } diff --git a/SearchStructures/include/CGAL/Tree_base.h b/SearchStructures/include/CGAL/Tree_base.h index 94716ff51d1..e27e112db93 100644 --- a/SearchStructures/include/CGAL/Tree_base.h +++ b/SearchStructures/include/CGAL/Tree_base.h @@ -33,8 +33,8 @@ #include #include -#ifndef CGAL_TREE_BASE_NULL -#define CGAL_TREE_BASE_NULL 0 +#ifndef CGAL_TREE_BASE_nullptr +#define CGAL_TREE_BASE_nullptr 0 #endif #define stlvector diff --git a/Segment_Delaunay_graph_2/doc/Segment_Delaunay_graph_2/CGAL/Segment_Delaunay_graph_filtered_traits_2.h b/Segment_Delaunay_graph_2/doc/Segment_Delaunay_graph_2/CGAL/Segment_Delaunay_graph_filtered_traits_2.h index eabca2b1001..69764b24fd5 100644 --- a/Segment_Delaunay_graph_2/doc/Segment_Delaunay_graph_2/CGAL/Segment_Delaunay_graph_filtered_traits_2.h +++ b/Segment_Delaunay_graph_2/doc/Segment_Delaunay_graph_2/CGAL/Segment_Delaunay_graph_filtered_traits_2.h @@ -20,13 +20,13 @@ This class has six template parameters. \tparam CK is the construction kernel and it is the kernel that will be used for constructions. \tparam CM must be `Field_with_sqrt_tag` or `Field_tag` +\tparam EK is the exact kernel; this kernel will be used for computing the predicates if +the filtering kernel fails to produce an answer. +\tparam EM must be `Field_with_sqrt_tag` or `Field_tag` \tparam FK is the filtering kernel; this kernel will be used for performing the arithmetic filtering for the predicates involved in the computation of the segment Delaunay graph. \tparam FM must be `Field_with_sqrt_tag` or `Field_tag` -\tparam EK is the exact kernel; this kernel will be used for computing the predicates if -the filtering kernel fails to produce an answer. -\tparam EM must be `Field_with_sqrt_tag` or `Field_tag` The first, third and fifth template parameters must be models of the `Kernel` concept. The second, fourth and sixth template parameters correspond to how @@ -170,14 +170,14 @@ This class has six template parameters. \tparam CK is the construction kernel and it is the kernel that will be used for constructions. \tparam CM must be `Field_with_sqrt_tag` or `Field_tag` +\tparam EK is the exact kernel; this kernel will be used for computing the predicates if +the filtering kernel fails to produce an answer. +\tparam EM must be `Field_with_sqrt_tag` or `Field_tag` \tparam FK is the filtering kernel; this kernel will be used for performing the arithmetic filtering for the predicates involved in the computation of the segment Delaunay graph. \tparam FM must be `Field_with_sqrt_tag` or `Field_tag` -\tparam EK is the exact kernel; this kernel will be used for computing the predicates if -the filtering kernel fails to produce an answer. -\tparam EM must be `Field_with_sqrt_tag` or `Field_tag` The first, third and fifth template parameters must be a models of the `Kernel` concept. @@ -191,7 +191,7 @@ whereas the second requires the exact evaluation of signs of ring-type expressions, i.e., expressions involving only additions, subtractions and multiplications. Finally, in order to get exact constructions `CM` must be set to `Field_with_sqrt_tag` and the number type -in `CK` must support operations involing divisions and square +in `CK` must support operations involving divisions and square roots (as well as the other three basic operations of course). The way the predicates are evaluated is discussed in \cgalCite{b-ecvdl-96} and \cgalCite{cgal:k-reisv-04} (the geometric filtering diff --git a/Segment_Delaunay_graph_2/doc/Segment_Delaunay_graph_2/Segment_Delaunay_graph_2.txt b/Segment_Delaunay_graph_2/doc/Segment_Delaunay_graph_2/Segment_Delaunay_graph_2.txt index d16811be5e6..93176e528b4 100644 --- a/Segment_Delaunay_graph_2/doc/Segment_Delaunay_graph_2/Segment_Delaunay_graph_2.txt +++ b/Segment_Delaunay_graph_2/doc/Segment_Delaunay_graph_2/Segment_Delaunay_graph_2.txt @@ -409,10 +409,8 @@ mechanisms. Presently, there two ways of performing arithmetic filtering for the predicates involved in the computation of segment Delaunay graphs:
      -
    1. The user can define his/her kernel using as number type, a -number type of the form `Filtered_exact`. Then this -kernel can be entered as the first template parameter in the -`Segment_Delaunay_graph_2`. +
    2. The user can use a kernel with a filtered number type +as the first template parameter in the `Segment_Delaunay_graph_traits_2`.
    3. The user can define up to three different kernels `CK`, `FK` and `EK` (default values are provided for most parameters). The first kernel `CK` is used only for @@ -429,9 +427,10 @@ classes, which have been implemented using the Our experience so far has shown that for all reasonable and valid values of the template parameters, the second method for arithmetic filtering is more efficient among the two. +This approach is also used in the examples. Let's consider once more the class -`Segment_Delaunay_graph_2`. +`Segment_Delaunay_graph_traits_2`. The template parameter `MTag` provides another degree of freedom to the user, who can indicate the type of arithmetic operations to be used in the evaluation of the predicates. More specifically, @@ -518,8 +517,8 @@ site-related quantities. If you have a rather large input, you better use an insertion function that uses the spatial sorting of your input (end) points. Note that the functions -\link CGAL::Segment_Delaunay_graph_2::insert_points `insert_points` \endlink or -\link CGAL::Segment_Delaunay_graph_2::insert_segments `insert_segments` \endlink +\link CGAL::Segment_Delaunay_graph_2::insert_points `insert_points()` \endlink or +\link CGAL::Segment_Delaunay_graph_2::insert_segments `insert_segments()` \endlink can be used if your input is only composed of points or segments. \cgalExample{Segment_Delaunay_graph_2/sdg-fast-sp.cpp} diff --git a/Segment_Delaunay_graph_2/include/CGAL/Segment_Delaunay_graph_2.h b/Segment_Delaunay_graph_2/include/CGAL/Segment_Delaunay_graph_2.h index 24aa1ed5478..6c5d6712a5e 100644 --- a/Segment_Delaunay_graph_2/include/CGAL/Segment_Delaunay_graph_2.h +++ b/Segment_Delaunay_graph_2/include/CGAL/Segment_Delaunay_graph_2.h @@ -343,7 +343,7 @@ private: } void setup_if_intersecting_pointer_with_tag(Tag_false) { - insert_point_on_segment_ptr = NULL; + insert_point_on_segment_ptr = nullptr; } void setup_if_intersecting_pointer_with_tag(Tag_true) { diff --git a/Segment_Delaunay_graph_2/include/CGAL/Segment_Delaunay_graph_2/Finite_edge_interior_conflict_C2.h b/Segment_Delaunay_graph_2/include/CGAL/Segment_Delaunay_graph_2/Finite_edge_interior_conflict_C2.h index 053db7a9f8e..66d60f086b2 100644 --- a/Segment_Delaunay_graph_2/include/CGAL/Segment_Delaunay_graph_2/Finite_edge_interior_conflict_C2.h +++ b/Segment_Delaunay_graph_2/include/CGAL/Segment_Delaunay_graph_2/Finite_edge_interior_conflict_C2.h @@ -423,12 +423,17 @@ private: #if 1 CGAL_assertion( p.is_segment() || q.is_segment() ); - Voronoi_vertex_2 vpqr(p, q, r); - Voronoi_vertex_2 vqps(q, p, s); - - if ( vpqr.incircle_no_easy(s) == ZERO && - vqps.incircle_no_easy(r) == ZERO ) { - return false; + if ( !(r.is_point() && s.is_point() && r.point()==s.point() ) && + !(r.is_segment() && s.is_segment() && r.source_of_supporting_site()==s.source_of_supporting_site() + && r.target_of_supporting_site()==s.target_of_supporting_site() ) ) + { + Voronoi_vertex_2 vpqr(p, q, r); + Voronoi_vertex_2 vqps(q, p, s); + //check if the edge is degenerate + if ( vpqr.incircle_no_easy(s) == ZERO && + vqps.incircle_no_easy(r) == ZERO ) { + return false; + } } if ( p.is_segment() && q.is_segment() ) { diff --git a/Segment_Delaunay_graph_2/include/CGAL/Segment_Delaunay_graph_2/Segment_Delaunay_graph_2_impl.h b/Segment_Delaunay_graph_2/include/CGAL/Segment_Delaunay_graph_2/Segment_Delaunay_graph_2_impl.h index bdd4d43e1a7..099499c7f20 100644 --- a/Segment_Delaunay_graph_2/include/CGAL/Segment_Delaunay_graph_2/Segment_Delaunay_graph_2_impl.h +++ b/Segment_Delaunay_graph_2/include/CGAL/Segment_Delaunay_graph_2/Segment_Delaunay_graph_2_impl.h @@ -2212,7 +2212,7 @@ nearest_neighbor(const Site_2& p, start_vertex = finite_vertex(); } - // if ( start_vertex == NULL ) { return start_vertex; } + // if ( start_vertex == nullptr ) { return start_vertex; } Vertex_handle vclosest; Vertex_handle v = start_vertex; diff --git a/Segment_Delaunay_graph_2/include/CGAL/Segment_Delaunay_graph_2/Segment_Delaunay_graph_hierarchy_2_impl.h b/Segment_Delaunay_graph_2/include/CGAL/Segment_Delaunay_graph_2/Segment_Delaunay_graph_hierarchy_2_impl.h index a5f635f1a37..f96d359e955 100644 --- a/Segment_Delaunay_graph_2/include/CGAL/Segment_Delaunay_graph_2/Segment_Delaunay_graph_hierarchy_2_impl.h +++ b/Segment_Delaunay_graph_2/include/CGAL/Segment_Delaunay_graph_2/Segment_Delaunay_graph_hierarchy_2_impl.h @@ -180,7 +180,7 @@ insert_point(const Point_2& p, const Storage_site_2& ss, int level, CGAL_assertion( vertex != Vertex_handle() ); - if ( vertices != NULL ) { vertices[0] = vertex; } + if ( vertices != nullptr ) { vertices[0] = vertex; } // insert at other levels Vertex_handle previous = vertex; @@ -237,7 +237,7 @@ insert_point(const Point_2& p, const Storage_site_2& ss, int level, CGAL_assertion( vertex != Vertex_handle() ); - if ( vertices != NULL ) { vertices[k] = vertex; } + if ( vertices != nullptr ) { vertices[k] = vertex; } vertex->set_down(previous); // link with other levels previous->set_up(vertex); @@ -298,7 +298,7 @@ insert_point(const Site_2& t, const Storage_site_2& ss, CGAL_assertion( vertex != Vertex_handle() ); - if ( vertices != NULL ) { vertices[k] = vertex; } + if ( vertices != nullptr ) { vertices[k] = vertex; } vertex->set_down(previous); // link with other levels previous->set_up(vertex); @@ -522,7 +522,7 @@ insert_segment_in_upper_levels(const Site_2& t, const Storage_site_2& ss, const Vertex_handle* vertices, int level, Tag_true /* stag */) { - CGAL_precondition( vertices != NULL ); + CGAL_precondition( vertices != nullptr ); CGAL_precondition( vbelow != Vertex_handle() ); // insert at all upper levels diff --git a/Segment_Delaunay_graph_2/include/CGAL/Segment_Delaunay_graph_2/Voronoi_vertex_sqrt_field_C2.h b/Segment_Delaunay_graph_2/include/CGAL/Segment_Delaunay_graph_2/Voronoi_vertex_sqrt_field_C2.h index 3c4b5004da3..00eb705965e 100644 --- a/Segment_Delaunay_graph_2/include/CGAL/Segment_Delaunay_graph_2/Voronoi_vertex_sqrt_field_C2.h +++ b/Segment_Delaunay_graph_2/include/CGAL/Segment_Delaunay_graph_2/Voronoi_vertex_sqrt_field_C2.h @@ -876,7 +876,7 @@ private: #ifndef CGAL_DISABLE_AM_CODE // code added by Andreas + Monique -- start if(v_type == PPP){ - Site_2 const *p1 = NULL; + Site_2 const *p1 = nullptr; if(is_endpoint_of(p_, t)){ p1 = &p_; } else if(is_endpoint_of(q_, t)){ @@ -884,7 +884,7 @@ private: } else if(is_endpoint_of(r_, t)){ p1 = &r_; } - if(p1 != NULL){ + if(p1 != nullptr){ // As the Voronoi circle and the segment t touch in p1, // it is enough to check that the center and the non-touching point of the segment // are not in the same halfspace defined by the tangent line through p1 diff --git a/Segment_Delaunay_graph_2/include/CGAL/Segment_Delaunay_graph_2/Voronoi_vertex_sqrt_field_new_C2.h b/Segment_Delaunay_graph_2/include/CGAL/Segment_Delaunay_graph_2/Voronoi_vertex_sqrt_field_new_C2.h index d5eaf5abac4..ca1c10765f3 100644 --- a/Segment_Delaunay_graph_2/include/CGAL/Segment_Delaunay_graph_2/Voronoi_vertex_sqrt_field_new_C2.h +++ b/Segment_Delaunay_graph_2/include/CGAL/Segment_Delaunay_graph_2/Voronoi_vertex_sqrt_field_new_C2.h @@ -983,11 +983,11 @@ private: #ifndef CGAL_DISABLE_AM_CODE // code added in previous version by Andreas + Monique -- start - Site_2 const *pp1 = NULL; + Site_2 const *pp1 = nullptr; if ( end_pt ) pp1 = &p; else if ( end_qt ) pp1 = &q; else if ( end_rt ) pp1 = &r; - if ( pp1 != NULL ) { + if ( pp1 != nullptr ) { // As the Voronoi circle and the segment t touch in p1, // it is enough to check that the center and the non-touching // point of the segment diff --git a/Segment_Delaunay_graph_2/include/CGAL/Segment_Delaunay_graph_filtered_traits_2.h b/Segment_Delaunay_graph_2/include/CGAL/Segment_Delaunay_graph_filtered_traits_2.h index 39e97db27ff..68852621d44 100644 --- a/Segment_Delaunay_graph_2/include/CGAL/Segment_Delaunay_graph_filtered_traits_2.h +++ b/Segment_Delaunay_graph_2/include/CGAL/Segment_Delaunay_graph_filtered_traits_2.h @@ -28,6 +28,8 @@ #include +#include + #include #include diff --git a/Segment_Delaunay_graph_2/test/Segment_Delaunay_graph_2/sdg_br_case1.cpp b/Segment_Delaunay_graph_2/test/Segment_Delaunay_graph_2/sdg_br_case1.cpp new file mode 100644 index 00000000000..60962b91009 --- /dev/null +++ b/Segment_Delaunay_graph_2/test/Segment_Delaunay_graph_2/sdg_br_case1.cpp @@ -0,0 +1,105 @@ +#include +#include +#include +#include + +#include +#include + +typedef CGAL::Simple_cartesian K; +typedef K::Point_2 Point_2; +typedef K::Segment_2 Segment_2; + +typedef CGAL::Segment_Delaunay_graph_traits_2 Gt; +typedef CGAL::Segment_Delaunay_graph_2 SDG; + +void case1() +{ + SDG sdg; + + SDG::Vertex_handle v0=sdg.insert(Point_2(144, 736)); + SDG::Vertex_handle v1=sdg.insert(Point_2(368, 736)); + SDG::Vertex_handle v2=sdg.insert(Point_2(144 , 672)); + SDG::Vertex_handle v3=sdg.insert(Point_2(368 , 672)); + + sdg.insert(v0,v1); + sdg.insert(v2,v3); + + sdg.insert(Point_2(192, 704)); + sdg.insert(Point_2(320, 704)); + sdg.insert(Point_2(256, 704)); + + assert(sdg.is_valid()); +} + +void case2() +{ + SDG sdg; + + SDG::Vertex_handle v0=sdg.insert(Point_2(-118.4357272, 34.2007906)); + SDG::Vertex_handle v1=sdg.insert(Point_2(-118.4357272, 34.2010248)); + SDG::Vertex_handle v2=sdg.insert(Point_2(-118.436231 , 34.2010248)); + SDG::Vertex_handle v3=sdg.insert(Point_2(-118.436231 , 34.2007906)); + + sdg.insert(v0,v1); + sdg.insert(v1,v2); + sdg.insert(v2,v3); + sdg.insert(v3,v0); + + sdg.insert(Point_2(-118.4359811, 34.2008934)); + sdg.insert(Point_2(-118.4359811, 34.200922)); + + sdg.insert(Point_2(-118.4358769, 34.200922)); + sdg.insert(Point_2(-118.4358769, 34.2008934)); + + assert(sdg.is_valid()); +} + +void case3() +{ + SDG sdg; + + SDG::Vertex_handle v0=sdg.insert(Point_2(96, 544)); + SDG::Vertex_handle v1=sdg.insert(Point_2(416,544 )); + SDG::Vertex_handle v2=sdg.insert(Point_2(416, 384)); + SDG::Vertex_handle v3=sdg.insert(Point_2(96, 384)); + + sdg.insert(v0,v1); + sdg.insert(v1,v2); + sdg.insert(v2,v3); + sdg.insert(v3,v0); + + sdg.insert(Point_2(256, 464)); + sdg.insert(Point_2(272, 416)); + + assert(sdg.is_valid()); +} + +void case4() +{ + SDG sdg; + + SDG::Vertex_handle v2=sdg.insert(Point_2(416, 384)); + SDG::Vertex_handle v3=sdg.insert(Point_2(96, 384)); + sdg.insert(v2,v3); + + sdg.insert(Point_2(416, 464)); + sdg.insert(Point_2(96, 464)); + + sdg.insert(Point_2(176, 544)); + sdg.insert(Point_2(336, 544)); + sdg.insert(Point_2(256, 464)); + sdg.insert(Point_2(272, 416)); + + assert(sdg.is_valid()); +} + +// missing test case: is_interior_in_conflict_touch, s!=r, vpqr!=ZERO and p or q a point + +int main() +{ + case1(); + case2(); + case3(); + case4(); +} diff --git a/Segment_Delaunay_graph_Linf_2/include/CGAL/Segment_Delaunay_graph_Linf_2.h b/Segment_Delaunay_graph_Linf_2/include/CGAL/Segment_Delaunay_graph_Linf_2.h index 1836e4c8742..ec1b79a1c3e 100644 --- a/Segment_Delaunay_graph_Linf_2/include/CGAL/Segment_Delaunay_graph_Linf_2.h +++ b/Segment_Delaunay_graph_Linf_2/include/CGAL/Segment_Delaunay_graph_Linf_2.h @@ -157,7 +157,7 @@ private: } void setup_if_intersecting_pointer_with_tag(Tag_false) { - Base::insert_point_on_segment_ptr = NULL; + Base::insert_point_on_segment_ptr = nullptr; } void setup_if_intersecting_pointer_with_tag(Tag_true) { diff --git a/Segment_Delaunay_graph_Linf_2/include/CGAL/Segment_Delaunay_graph_Linf_2/Segment_Delaunay_graph_Linf_hierarchy_2_impl.h b/Segment_Delaunay_graph_Linf_2/include/CGAL/Segment_Delaunay_graph_Linf_2/Segment_Delaunay_graph_Linf_hierarchy_2_impl.h index 218909e0213..c7cadcbe37a 100644 --- a/Segment_Delaunay_graph_Linf_2/include/CGAL/Segment_Delaunay_graph_Linf_2/Segment_Delaunay_graph_Linf_hierarchy_2_impl.h +++ b/Segment_Delaunay_graph_Linf_2/include/CGAL/Segment_Delaunay_graph_Linf_2/Segment_Delaunay_graph_Linf_hierarchy_2_impl.h @@ -183,7 +183,7 @@ insert_point(const Point_2& p, const Storage_site_2& ss, int level, CGAL_assertion( vertex != Vertex_handle() ); - if ( vertices != NULL ) { vertices[0] = vertex; } + if ( vertices != nullptr ) { vertices[0] = vertex; } // insert at other levels Vertex_handle previous = vertex; @@ -240,7 +240,7 @@ insert_point(const Point_2& p, const Storage_site_2& ss, int level, CGAL_assertion( vertex != Vertex_handle() ); - if ( vertices != NULL ) { vertices[k] = vertex; } + if ( vertices != nullptr ) { vertices[k] = vertex; } vertex->set_down(previous); // link with other levels previous->set_up(vertex); @@ -301,7 +301,7 @@ insert_point(const Site_2& t, const Storage_site_2& ss, CGAL_assertion( vertex != Vertex_handle() ); - if ( vertices != NULL ) { vertices[k] = vertex; } + if ( vertices != nullptr ) { vertices[k] = vertex; } vertex->set_down(previous); // link with other levels previous->set_up(vertex); @@ -565,7 +565,7 @@ insert_segment_in_upper_levels(const Site_2& t, const Storage_site_2& ss, const Vertex_handle* vertices, int level, Tag_true /* stag */) { - CGAL_precondition( vertices != NULL ); + CGAL_precondition( vertices != nullptr ); CGAL_precondition( vbelow != Vertex_handle() ); // insert at all upper levels diff --git a/Segment_Delaunay_graph_Linf_2/include/CGAL/Segment_Delaunay_graph_Linf_2/Voronoi_vertex_sqrt_field_new_C2.h b/Segment_Delaunay_graph_Linf_2/include/CGAL/Segment_Delaunay_graph_Linf_2/Voronoi_vertex_sqrt_field_new_C2.h index 5c0e63916ef..4166ef230a6 100644 --- a/Segment_Delaunay_graph_Linf_2/include/CGAL/Segment_Delaunay_graph_Linf_2/Voronoi_vertex_sqrt_field_new_C2.h +++ b/Segment_Delaunay_graph_Linf_2/include/CGAL/Segment_Delaunay_graph_Linf_2/Voronoi_vertex_sqrt_field_new_C2.h @@ -4056,11 +4056,11 @@ private: /* #ifndef CGAL_DISABLE_AM_CODE // code added in previous version by Andreas + Monique -- start - Site_2 const *pp1 = NULL; + Site_2 const *pp1 = nullptr; if ( end_pt ) pp1 = &p; else if ( end_qt ) pp1 = &q; else if ( end_rt ) pp1 = &r; - if ( pp1 != NULL ) { + if ( pp1 != nullptr ) { // As the Voronoi circle and the segment t touch in p1, // it is enough to check that the center and the non-touching // point of the segment diff --git a/Segment_Delaunay_graph_Linf_2/include/CGAL/Side_of_bounded_square_2.h b/Segment_Delaunay_graph_Linf_2/include/CGAL/Side_of_bounded_square_2.h index e888f4941e8..0a89c84d0d9 100644 --- a/Segment_Delaunay_graph_Linf_2/include/CGAL/Side_of_bounded_square_2.h +++ b/Segment_Delaunay_graph_Linf_2/include/CGAL/Side_of_bounded_square_2.h @@ -65,8 +65,8 @@ namespace CGAL { const Point_2 &pt_p, const Point_2 &pt_q, const Point_2 &pt_r) const { - FT const * min_p (NULL); - FT const * max_p (NULL); + FT const * min_p (nullptr); + FT const * max_p (nullptr); bool samepq = false; bool samepr = false; bool sameqr = false; @@ -156,8 +156,8 @@ namespace CGAL { } } } - CGAL_assertion(min_p != NULL); - CGAL_assertion(max_p != NULL); + CGAL_assertion(min_p != nullptr); + CGAL_assertion(max_p != nullptr); Point_2 const * pt_min_p = (min_p == &p)? &pt_p : (min_p == &q)? &pt_q : &pt_r; Point_2 const * pt_max_p = @@ -219,8 +219,8 @@ namespace CGAL { const bool samex_pq = std::get<2>(tupx); const bool samex_pr = std::get<3>(tupx); const bool samex_qr = std::get<4>(tupx); - CGAL_assertion(lft_p != NULL); - CGAL_assertion(rgt_p != NULL); + CGAL_assertion(lft_p != nullptr); + CGAL_assertion(rgt_p != nullptr); //compute the minimum y and maximum y const FT py (p.y()), qy (q.y()), ry (r.y()); @@ -230,8 +230,8 @@ namespace CGAL { const bool samey_pq = std::get<2>(tupy); const bool samey_pr = std::get<3>(tupy); const bool samey_qr = std::get<4>(tupy); - CGAL_assertion(bot_p != NULL); - CGAL_assertion(top_p != NULL); + CGAL_assertion(bot_p != nullptr); + CGAL_assertion(top_p != nullptr); CGAL_SDG_DEBUG(std::cout << "debug bs before mirror" << " lft=" << *lft_p << " rgt=" << *rgt_p @@ -250,9 +250,9 @@ namespace CGAL { FT dymirror; if (exist_two_with_same_x != exist_two_with_same_y) { if (exist_two_with_same_x) { - FT const *s1 = NULL; - FT const *s2 = NULL; - FT const *dx = NULL; + FT const *s1 = nullptr; + FT const *s2 = nullptr; + FT const *dx = nullptr; if (samex_pq) { s1 = &py; s2 = &qy; @@ -290,9 +290,9 @@ namespace CGAL { } } else { CGAL_assertion( exist_two_with_same_y ); - FT const *s1 = NULL; - FT const *s2 = NULL; - FT const *dy = NULL; + FT const *s1 = nullptr; + FT const *s2 = nullptr; + FT const *dy = nullptr; if (samey_pq) { s1 = &px; s2 = &qx; @@ -308,7 +308,7 @@ namespace CGAL { s2 = ℞ dy = &px; } - CGAL_assertion( dy != NULL ); + CGAL_assertion( dy != nullptr ); CGAL_SDG_DEBUG(std::cout << "debug Side_of_bs two same y" << std::endl;); if ( (lft_p == dy) || (rgt_p == dy) ) { @@ -373,9 +373,9 @@ namespace CGAL { else { CGAL_assertion( is_bot_input && is_top_input ); Point_2 const * const pt_lft_p = - (is_lft_input)? std::get<5>(tupx) : NULL; + (is_lft_input)? std::get<5>(tupx) : nullptr; Point_2 const * const pt_rgt_p = - (is_rgt_input)? std::get<6>(tupx) : NULL; + (is_rgt_input)? std::get<6>(tupx) : nullptr; Point_2 const * const pt_top_p = std::get<6>(tupy); if ((pt_top_p != pt_lft_p) && (pt_top_p != pt_rgt_p)) { // lower the bottom side @@ -422,9 +422,9 @@ namespace CGAL { CGAL_assertion( is_lft_input && is_rgt_input ); Point_2 const * const pt_lft_p = std::get<5>(tupx); Point_2 const * const pt_bot_p = - (is_bot_input) ? std::get<5>(tupy) : NULL; + (is_bot_input) ? std::get<5>(tupy) : nullptr; Point_2 const * const pt_top_p = - (is_top_input) ? std::get<6>(tupy) : NULL; + (is_top_input) ? std::get<6>(tupy) : nullptr; // find the movable side or sides of the rectangle if ((pt_lft_p != pt_bot_p) && (pt_lft_p != pt_top_p)) { // augment the right side diff --git a/Shape_detection/include/CGAL/Shape_detection/Efficient_RANSAC/Efficient_RANSAC.h b/Shape_detection/include/CGAL/Shape_detection/Efficient_RANSAC/Efficient_RANSAC.h index 5b16eb8e45f..f25b9a1ffa0 100644 --- a/Shape_detection/include/CGAL/Shape_detection/Efficient_RANSAC/Efficient_RANSAC.h +++ b/Shape_detection/include/CGAL/Shape_detection/Efficient_RANSAC/Efficient_RANSAC.h @@ -202,8 +202,8 @@ namespace CGAL { */ Efficient_RANSAC(Traits t = Traits()) : m_traits(t) - , m_direct_octrees(NULL) - , m_global_octree(NULL) + , m_direct_octrees(nullptr) + , m_global_octree(nullptr) , m_num_subsets(0) , m_num_available_points(0) , m_num_total_points(0) @@ -380,7 +380,7 @@ namespace CGAL { if (m_global_octree) { delete m_global_octree; - m_global_octree = NULL; + m_global_octree = nullptr; } if (m_direct_octrees) { @@ -388,7 +388,7 @@ namespace CGAL { delete m_direct_octrees[i]; delete [] m_direct_octrees; - m_direct_octrees = NULL; + m_direct_octrees = nullptr; } m_num_subsets = 0; @@ -650,13 +650,13 @@ namespace CGAL { for (std::size_t i = 0;i < candidates.size() - 1;i++) { if (best_candidate->is_same(candidates[i])) { delete candidates[i]; - candidates[i] = NULL; + candidates[i] = nullptr; } } - candidates.back() = NULL; + candidates.back() = nullptr; delete best_candidate; - best_candidate = NULL; + best_candidate = nullptr; if (callback && !callback(num_invalid / double(m_num_total_points))) return false; @@ -678,7 +678,7 @@ namespace CGAL { if (occupied >= candidates.size()) break; candidates[empty] = candidates[occupied]; - candidates[occupied] = NULL; + candidates[occupied] = nullptr; empty++; occupied++; } @@ -696,7 +696,7 @@ namespace CGAL { <= m_options.probability) { // Remove candidate from list - candidates.back() = NULL; + candidates.back() = nullptr; //1. add best candidate to final result. m_extracted_shapes->push_back( @@ -759,7 +759,7 @@ namespace CGAL { if (candidates[i]->max_bound() < m_options.min_points) { delete candidates[i]; - candidates[i] = NULL; + candidates[i] = nullptr; } else { best_expected = (candidates[i]->expected_value() > best_expected) ? @@ -777,7 +777,7 @@ namespace CGAL { while (!candidates[end] && start < end) end--; if (!candidates[start] && candidates[end] && start < end) { candidates[start] = candidates[end]; - candidates[end] = NULL; + candidates[end] = nullptr; start++; end--; } diff --git a/Shape_detection/include/CGAL/Shape_detection/Efficient_RANSAC/Octree.h b/Shape_detection/include/CGAL/Shape_detection/Efficient_RANSAC/Octree.h index 8fbd75960d0..400f4aafb68 100644 --- a/Shape_detection/include/CGAL/Shape_detection/Efficient_RANSAC/Octree.h +++ b/Shape_detection/include/CGAL/Shape_detection/Efficient_RANSAC/Octree.h @@ -233,7 +233,7 @@ namespace CGAL { public: Octree(Sd_traits const& traits) - : m_traits(traits), m_bucket_size(20), m_set_max_level(10), m_root(NULL) {} + : m_traits(traits), m_bucket_size(20), m_set_max_level(10), m_root(nullptr) {} Octree(Sd_traits const& traits, const Input_iterator &first, const Input_iterator &beyond, @@ -244,7 +244,7 @@ namespace CGAL { std::size_t maxLevel = 10) : PointAccessor(first, beyond, offset), m_traits(traits), - m_root(NULL), + m_root(nullptr), m_bucket_size(bucketSize), m_set_max_level(maxLevel), m_point_pmap (point_pmap), diff --git a/Shape_detection/include/CGAL/Shape_detection/Region_growing/Region_growing_on_polygon_mesh/Least_squares_plane_fit_region.h b/Shape_detection/include/CGAL/Shape_detection/Region_growing/Region_growing_on_polygon_mesh/Least_squares_plane_fit_region.h index f2829f060a6..9cbb3ae1a0e 100644 --- a/Shape_detection/include/CGAL/Shape_detection/Region_growing/Region_growing_on_polygon_mesh/Least_squares_plane_fit_region.h +++ b/Shape_detection/include/CGAL/Shape_detection/Region_growing/Region_growing_on_polygon_mesh/Least_squares_plane_fit_region.h @@ -392,7 +392,7 @@ namespace Polygon_mesh { m_sqrt(m_squared_distance_3(point, m_plane_of_best_fit)); max_face_distance = - CGAL::max(distance, max_face_distance); + (CGAL::max)(distance, max_face_distance); } CGAL_postcondition(max_face_distance != -FT(1)); diff --git a/Shape_detection/include/CGAL/Shape_detection/deprecated/Region_growing.h b/Shape_detection/include/CGAL/Shape_detection/deprecated/Region_growing.h index ed3262db52f..39b48bb511d 100644 --- a/Shape_detection/include/CGAL/Shape_detection/deprecated/Region_growing.h +++ b/Shape_detection/include/CGAL/Shape_detection/deprecated/Region_growing.h @@ -336,8 +336,8 @@ namespace Shape_detection { , m_num_available_points(0) , m_num_total_points(0) , m_valid_iterators(false) - , m_tree (NULL) - { } + , m_tree (nullptr) + {} /*! Releases all memory allocated by this instances including shapes. @@ -466,10 +466,10 @@ namespace Shape_detection { if (!m_valid_iterators) return; - if (m_tree != NULL) + if (m_tree != nullptr) { delete m_tree; - m_tree = NULL; + m_tree = nullptr; } std::vector().swap(m_shape_index); diff --git a/Skin_surface_3/include/CGAL/Skin_surface_polyhedral_items_3.h b/Skin_surface_3/include/CGAL/Skin_surface_polyhedral_items_3.h index 45cbb5da5a0..22a4cd9e2cb 100644 --- a/Skin_surface_3/include/CGAL/Skin_surface_polyhedral_items_3.h +++ b/Skin_surface_3/include/CGAL/Skin_surface_polyhedral_items_3.h @@ -39,7 +39,7 @@ struct Skin_Surface_polyhedral_face: public CGAL::HalfedgeDS_face_base typename SkinSurface3::Simplex containing_simplex() { - CGAL_assertion(tmc_ch != NULL); + CGAL_assertion(tmc_ch != nullptr); return tmc_ch->info().first; } diff --git a/Skin_surface_3/include/CGAL/Triangulation_incremental_builder_3.h b/Skin_surface_3/include/CGAL/Triangulation_incremental_builder_3.h index 5e2afd46384..0fc5adb8a32 100644 --- a/Skin_surface_3/include/CGAL/Triangulation_incremental_builder_3.h +++ b/Skin_surface_3/include/CGAL/Triangulation_incremental_builder_3.h @@ -122,13 +122,13 @@ typename Triangulation_incremental_builder_3< TDS_ >::Cell_handle Triangulation_incremental_builder_3< TDS_ >::add_cell( Vertex_handle vh0, Vertex_handle vh1, Vertex_handle vh2, Vertex_handle vh3) { - CGAL_assertion(vh0 != NULL); CGAL_assertion(vh1 != NULL); - CGAL_assertion(vh2 != NULL); CGAL_assertion(vh3 != NULL); + CGAL_assertion(vh0 != nullptr); CGAL_assertion(vh1 != nullptr); + CGAL_assertion(vh2 != nullptr); CGAL_assertion(vh3 != nullptr); CGAL_assertion(vh0 != vh1); CGAL_assertion(vh0 != vh2); CGAL_assertion(vh0 != vh3); CGAL_assertion(vh1 != vh2); CGAL_assertion(vh1 != vh3); CGAL_assertion(vh2 != vh3); Cell_handle ch = t.tds().create_cell(vh0, vh1, vh2, vh3); - // Neighbors are by default set to NULL + // Neighbors are by default set to nullptr vh0->set_cell(ch); vh1->set_cell(ch); vh2->set_cell(ch); vh3->set_cell(ch); @@ -143,10 +143,10 @@ Triangulation_incremental_builder_3< TDS_ >::add_cell( Facet f = (*neighbIt).second; glue_cells(f.first, f.second, ch, i); facets.erase(neighbIt); - CGAL_assertion(f.first->neighbor(f.second) != NULL); - CGAL_assertion(ch->neighbor(i) != NULL); + CGAL_assertion(f.first->neighbor(f.second) != nullptr); + CGAL_assertion(ch->neighbor(i) != nullptr); } else { - CGAL_assertion(ch->neighbor(i) == NULL); + CGAL_assertion(ch->neighbor(i) == nullptr); } } @@ -158,14 +158,14 @@ typename Triangulation_incremental_builder_3< TDS_ >::Cell_handle Triangulation_incremental_builder_3< TDS_ >::add_infinite_cell( Cell_handle ch0, int i) { - CGAL_assertion(ch0->neighbor(i) == NULL); + CGAL_assertion(ch0->neighbor(i) == nullptr); Vertex_handle vh[4]; vh[i] = t.infinite_vertex(); vh[(i+1)&3] = ch0->vertex((i+1)&3); vh[(i+2)&3] = ch0->vertex((i+3)&3); vh[(i+3)&3] = ch0->vertex((i+2)&3); Cell_handle ch1 = t.tds().create_cell(vh[0], vh[1], vh[2], vh[3]); - // Neighbors are set to NULL + // Neighbors are set to nullptr // Do not set points to the infinite cell. All finite vertices point to // finite cells. vh[i]->set_cell(ch1); @@ -216,8 +216,8 @@ Triangulation_incremental_builder_3< TDS_ >::construct_infinite_cells() int ind0 = ch_facet.second; Cell_handle ch1 = add_infinite_cell(ch0, ind0); // Index of ch1 is also ind0 - CGAL_assertion(ch0->neighbor(ind0) != NULL); - CGAL_assertion(ch1->neighbor(ind0) != NULL); + CGAL_assertion(ch0->neighbor(ind0) != nullptr); + CGAL_assertion(ch1->neighbor(ind0) != nullptr); for (int i=1; i<4; i++) { int i1 = (i==1?2:1); @@ -234,11 +234,11 @@ Triangulation_incremental_builder_3< TDS_ >::construct_infinite_cells() Facet f_opp = (*ch_edge_it).second; glue_cells(f_opp.first, f_opp.second, ch1, (ind0+i)&3); ch_edges.erase(ch_edge_it); - CGAL_assertion(f_opp.first->neighbor(f_opp.second) != NULL); - CGAL_assertion(ch1->neighbor((ind0+i)&3) != NULL); + CGAL_assertion(f_opp.first->neighbor(f_opp.second) != nullptr); + CGAL_assertion(ch1->neighbor((ind0+i)&3) != nullptr); } else { ch_edges[Vpair(vh1,vh2)] = Facet(ch1, (ind0+i)&3); - CGAL_assertion(ch1->neighbor((ind0+i)&3) == NULL); + CGAL_assertion(ch1->neighbor((ind0+i)&3) == nullptr); } } } diff --git a/Skin_surface_3/include/CGAL/marching_tetrahedra_3.h b/Skin_surface_3/include/CGAL/marching_tetrahedra_3.h index 0a1e48e4709..99125462974 100644 --- a/Skin_surface_3/include/CGAL/marching_tetrahedra_3.h +++ b/Skin_surface_3/include/CGAL/marching_tetrahedra_3.h @@ -49,8 +49,11 @@ private: typedef Vertex_iterator T_Vertex_iterator; typedef Cell_iterator T_Cell_iterator; typedef typename T_Cell_iterator::value_type T_Cell; - typedef typename T_Cell::Vertex_handle T_Vertex_handle; typedef typename T_Vertex_iterator::value_type T_Vertex; + + typedef typename T_Vertex::Cell_handle T_Cell_handle; + typedef typename T_Cell::Vertex_handle T_Vertex_handle; + typedef typename T_Vertex_iterator::value_type * T_Vertex_pointer; typedef typename T_Cell_iterator::value_type * T_Cell_pointer; @@ -138,7 +141,7 @@ public: bool is_inside(T_Cell_iterator ch, int i) { - CGAL_assertion(&*ch != NULL); + CGAL_assertion(ch.operator->() != nullptr); //return (traits.sign(ch,i) == POSITIVE); T_vertex_map_it it = triang_vertex_signs.find((ch->vertex(i))); @@ -146,7 +149,7 @@ public: bool side = (traits.sign(ch,i) == POSITIVE); CGAL_assertion(triang_vertex_signs.find((ch->vertex(i))) == triang_vertex_signs.end()); - CGAL_assertion(&*ch != NULL); + CGAL_assertion(ch.operator->() != nullptr); triang_vertex_signs[(ch->vertex(i))] = side; CGAL_assertion(triang_vertex_signs.find((ch->vertex(i))) != triang_vertex_signs.end()); diff --git a/Snap_rounding_2/include/CGAL/Snap_rounding_2.h b/Snap_rounding_2/include/CGAL/Snap_rounding_2.h index 21fb0574375..c4c2a8e6ed6 100644 --- a/Snap_rounding_2/include/CGAL/Snap_rounding_2.h +++ b/Snap_rounding_2/include/CGAL/Snap_rounding_2.h @@ -766,7 +766,7 @@ void snap_rounding_2(InputIterator begin, typedef std::list Segment_data_list; Segment_data_list seg_list; - Multiple_kd_tree * mul_kd_tree = NULL; + Multiple_kd_tree * mul_kd_tree = nullptr; output_container.clear(); // copy segments list diff --git a/Solver_interface/include/CGAL/Eigen_solver_traits.h b/Solver_interface/include/CGAL/Eigen_solver_traits.h index 836167f6e25..6219fc96e74 100644 --- a/Solver_interface/include/CGAL/Eigen_solver_traits.h +++ b/Solver_interface/include/CGAL/Eigen_solver_traits.h @@ -135,7 +135,7 @@ public: // Public operations public: /// Constructor - Eigen_solver_traits() : m_mat(NULL), m_solver_sptr(new EigenSolverT) { } + Eigen_solver_traits() : m_mat(nullptr), m_solver_sptr(new EigenSolverT) { } /// \name Operations /// @{ @@ -184,7 +184,7 @@ public: /// \return `true` if the solver is successful and `false` otherwise. bool linear_solver(const Vector& B, Vector& X) { - CGAL_precondition(m_mat != NULL); // factor should have been called first + CGAL_precondition(m_mat != nullptr); // factor should have been called first X = solver().solve(B); return solver().info() == Eigen::Success; } @@ -194,7 +194,7 @@ public: /// \return `true` if the solver is successful and `false` otherwise. bool linear_solver(const Matrix& B, Vector& X) { - CGAL_precondition(m_mat != NULL); // factor should have been called first + CGAL_precondition(m_mat != nullptr); // factor should have been called first X = solver().solve(B.eigen_object()); return solver().info() == Eigen::Success; } @@ -218,7 +218,7 @@ public: /// \return `true` if the solver is successful and `false` otherwise. bool normal_equation_solver(const Vector& B, Vector& X) { - CGAL_precondition(m_mat != NULL); // non_symmetric_factor should have been called first + CGAL_precondition(m_mat != nullptr); // non_symmetric_factor should have been called first typename Vector::EigenType AtB = m_mat->transpose() * B.eigen_object(); X = solver().solve(AtB); return solver().info() == Eigen::Success; diff --git a/Spatial_searching/include/CGAL/Kd_tree_rectangle.h b/Spatial_searching/include/CGAL/Kd_tree_rectangle.h index 70fb742160c..071170b507e 100644 --- a/Spatial_searching/include/CGAL/Kd_tree_rectangle.h +++ b/Spatial_searching/include/CGAL/Kd_tree_rectangle.h @@ -352,7 +352,7 @@ namespace CGAL { inline FT min_coord(int i) const { - CGAL_assertion(coords_ != NULL); + CGAL_assertion(coords_ != nullptr); return lower()[i]; } diff --git a/Spatial_searching/include/CGAL/internal/K_neighbor_search.h b/Spatial_searching/include/CGAL/internal/K_neighbor_search.h index 4cbfe31707f..66d10d53bae 100644 --- a/Spatial_searching/include/CGAL/internal/K_neighbor_search.h +++ b/Spatial_searching/include/CGAL/internal/K_neighbor_search.h @@ -90,7 +90,7 @@ protected: typedef Point_with_transformed_distance result_type; result_type operator()(const Point_ptr_with_transformed_distance& pair) const { - CGAL_precondition(pair.first!=NULL); + CGAL_precondition(pair.first!=nullptr); return std::make_pair(*(pair.first),pair.second); } }; diff --git a/Straight_skeleton_2/include/CGAL/Straight_skeleton_2.h b/Straight_skeleton_2/include/CGAL/Straight_skeleton_2.h index 5e409f866ac..ad5f067141b 100644 --- a/Straight_skeleton_2/include/CGAL/Straight_skeleton_2.h +++ b/Straight_skeleton_2/include/CGAL/Straight_skeleton_2.h @@ -145,13 +145,13 @@ public : valid = valid && ( begin->next() != Halfedge_const_handle()); if ( ! valid) { - CGAL_STSKEL_VALIDITY_TRACE("ERROR: he["<next() == NULL!"); + CGAL_STSKEL_VALIDITY_TRACE("ERROR: he["<next() == nullptr!"); break; } valid = valid && ( begin->opposite() != Halfedge_const_handle()); if ( ! valid) { - CGAL_STSKEL_VALIDITY_TRACE("ERROR: he["<opposite() == NULL!"); + CGAL_STSKEL_VALIDITY_TRACE("ERROR: he["<opposite() == nullptr!"); break; } // opposite integrity. @@ -182,7 +182,7 @@ public : valid = valid && begin->vertex() != Vertex_const_handle(); if ( ! valid) { - CGAL_STSKEL_VALIDITY_TRACE("ERROR: he["<vertex() == NULL!"); + CGAL_STSKEL_VALIDITY_TRACE("ERROR: he["<vertex() == nullptr!"); break; } if ( ! begin->vertex()->has_infinite_time() ) @@ -202,7 +202,7 @@ public : valid = valid && ( begin->is_border() || begin->face() != Face_const_handle() ); if ( ! valid) { - CGAL_STSKEL_VALIDITY_TRACE("ERROR: he["<face() == NULL."); + CGAL_STSKEL_VALIDITY_TRACE("ERROR: he["<face() == nullptr."); break; } valid = valid && ( begin->face() == begin->next()->face()); @@ -242,7 +242,7 @@ public : valid = valid && vbegin->halfedge() != Halfedge_const_handle() ; if ( ! valid) { - CGAL_STSKEL_VALIDITY_TRACE("ERROR: v["<< id(vbegin) <<"]->halfedge() == NULL."); + CGAL_STSKEL_VALIDITY_TRACE("ERROR: v["<< id(vbegin) <<"]->halfedge() == nullptr."); break; } @@ -312,7 +312,7 @@ public : valid = valid && ( begin->is_border() || fbegin->halfedge() != Halfedge_const_handle() ); if ( ! valid) { - CGAL_STSKEL_VALIDITY_TRACE("ERROR: f["<halfedge() == NULL." ); + CGAL_STSKEL_VALIDITY_TRACE("ERROR: f["<halfedge() == nullptr." ); break; } diff --git a/Straight_skeleton_2/include/CGAL/Straight_skeleton_2/debug.h b/Straight_skeleton_2/include/CGAL/Straight_skeleton_2/debug.h index aad0871b9fb..68ac3304ce1 100644 --- a/Straight_skeleton_2/include/CGAL/Straight_skeleton_2/debug.h +++ b/Straight_skeleton_2/include/CGAL/Straight_skeleton_2/debug.h @@ -68,7 +68,7 @@ inline std::string ptr2str( boost::intrusive_ptr const& ptr ) std::ostringstream ss ; ss << std::setprecision(19) ; if ( ptr ) ss << *ptr ; - else ss << "·NULL·" ; + else ss << "·nullptr·" ; return ss.str(); } diff --git a/Straight_skeleton_2/include/CGAL/Straight_skeleton_vertex_base_2.h b/Straight_skeleton_2/include/CGAL/Straight_skeleton_vertex_base_2.h index a9658002fc4..0952100487b 100644 --- a/Straight_skeleton_2/include/CGAL/Straight_skeleton_vertex_base_2.h +++ b/Straight_skeleton_2/include/CGAL/Straight_skeleton_vertex_base_2.h @@ -83,14 +83,14 @@ protected : ( Halfedge_circulator_base const& aOther ) : mHandle(aOther.mHandle) {} - bool operator==( Nullptr_t p ) const + bool operator==( std::nullptr_t p ) const { - CGAL_assertion( p == NULL ); + CGAL_assertion( p == nullptr ); HalfedgeHandle null ; return mHandle == null ; } - bool operator!=( Nullptr_t p ) const { return !(*this == p); } + bool operator!=( std::nullptr_t p ) const { return !(*this == p); } private : diff --git a/Straight_skeleton_2/include/CGAL/arrange_offset_polygons_2.h b/Straight_skeleton_2/include/CGAL/arrange_offset_polygons_2.h index 31a456c7aac..bf47d912126 100644 --- a/Straight_skeleton_2/include/CGAL/arrange_offset_polygons_2.h +++ b/Straight_skeleton_2/include/CGAL/arrange_offset_polygons_2.h @@ -95,7 +95,7 @@ bool arrange_offset_polygons_2 ( InputPolygonPtrIterator aBegin lParent = lOuter ; } - if (lParent == NULL) + if (lParent == nullptr) return false; lParent->add_hole(*lPoly); diff --git a/Stream_lines_2/include/CGAL/Stream_lines_2.h b/Stream_lines_2/include/CGAL/Stream_lines_2.h index 5bbc3eaa9a2..9b0c4f1781d 100644 --- a/Stream_lines_2/include/CGAL/Stream_lines_2.h +++ b/Stream_lines_2/include/CGAL/Stream_lines_2.h @@ -647,7 +647,7 @@ insert_streamline(const Vector_field_2 & vector_field_2, stl_vertices) { stl_container.push_back(stl); - Vertex_handle m_Vertex_handle = NULL; + Vertex_handle m_Vertex_handle = nullptr; int i = 1; unsigned int size_ = (int) (stl_vertices.size()); ir = il = 0; diff --git a/Stream_support/include/CGAL/IO/PLY.h b/Stream_support/include/CGAL/IO/PLY.h index 80117459e41..2bb6ed0bbbe 100644 --- a/Stream_support/include/CGAL/IO/PLY.h +++ b/Stream_support/include/CGAL/IO/PLY.h @@ -343,7 +343,7 @@ public: { for (std::size_t i = 0; i < number_of_properties(); ++ i) if (m_properties[i]->name () == tag) - return (dynamic_cast*>(m_properties[i]) != NULL); + return (dynamic_cast*>(m_properties[i]) != nullptr); return false; } @@ -352,15 +352,15 @@ public: { for (std::size_t i = 0; i < number_of_properties(); ++ i) if (m_properties[i]->name () == tag) - return (dynamic_cast*>(m_properties[i]) != NULL); + return (dynamic_cast*>(m_properties[i]) != nullptr); return false; } bool has_property (const char* tag, double) { for (std::size_t i = 0; i < number_of_properties(); ++ i) if (m_properties[i]->name () == tag) - return (dynamic_cast*>(m_properties[i]) != NULL - || dynamic_cast*>(m_properties[i]) != NULL); + return (dynamic_cast*>(m_properties[i]) != nullptr + || dynamic_cast*>(m_properties[i]) != nullptr); return false; } @@ -373,7 +373,7 @@ public: { PLY_read_typed_number* property = dynamic_cast*>(m_properties[i]); - CGAL_assertion (property != NULL); + CGAL_assertion (property != nullptr); t = property->buffer(); return; } @@ -387,7 +387,7 @@ public: { PLY_read_typed_list* property = dynamic_cast*>(m_properties[i]); - CGAL_assertion (property != NULL); + CGAL_assertion (property != nullptr); t = property->buffer(); return; } @@ -400,11 +400,11 @@ public: { PLY_read_typed_number* property_double = dynamic_cast*>(m_properties[i]); - if (property_double == NULL) + if (property_double == nullptr) { PLY_read_typed_number* property_float = dynamic_cast*>(m_properties[i]); - CGAL_assertion (property_float != NULL); + CGAL_assertion (property_float != nullptr); t = property_float->buffer(); } else diff --git a/Stream_support/include/CGAL/IO/Scanner_OFF.h b/Stream_support/include/CGAL/IO/Scanner_OFF.h index 9a64ff82314..6a7550829fe 100644 --- a/Stream_support/include/CGAL/IO/Scanner_OFF.h +++ b/Stream_support/include/CGAL/IO/Scanner_OFF.h @@ -54,7 +54,7 @@ private: Pt m_point; void next_vertex() { - CGAL_assertion( m_scan != NULL); + CGAL_assertion( m_scan != nullptr); if ( m_cnt < m_scan->size_of_vertices()) { file_scan_vertex( *m_scan, m_point); m_scan->skip_to_next_vertex( m_cnt); @@ -86,7 +86,7 @@ public: return tmp; } const Point& operator*() const { - CGAL_assertion( m_scan != NULL); + CGAL_assertion( m_scan != nullptr); return m_point; } const Point* operator->() const { return & operator*(); } @@ -113,7 +113,7 @@ private: void next() { - CGAL_assertion( m_scan != NULL); + CGAL_assertion( m_scan != nullptr); if ( m_cnt < m_scan->size_of_vertices()) { file_scan_vertex( *m_scan, m_current.first); if ( m_scan->has_normals()) @@ -145,7 +145,7 @@ public: return tmp; } reference operator*() const { - CGAL_assertion( m_scan != NULL); + CGAL_assertion( m_scan != nullptr); return m_current; } pointer operator->() const { return & operator*(); } @@ -165,7 +165,7 @@ private: value_type m_indices; void next_facet() { - CGAL_assertion( m_scan != NULL); + CGAL_assertion( m_scan != nullptr); if ( m_cnt < m_scan->size_of_facets()) { m_indices.erase( m_indices.begin(), m_indices.end()); std::size_t no; @@ -211,11 +211,11 @@ public: return tmp; } value_type& operator*() { - CGAL_assertion( m_scan != NULL); + CGAL_assertion( m_scan != nullptr); return m_indices; } const value_type& operator*() const { - CGAL_assertion( m_scan != NULL); + CGAL_assertion( m_scan != nullptr); return m_indices; } value_type* operator->() { return & operator*(); } diff --git a/Stream_support/include/CGAL/IO/WKT.h b/Stream_support/include/CGAL/IO/WKT.h index b9dcce70eb1..536a4386d19 100644 --- a/Stream_support/include/CGAL/IO/WKT.h +++ b/Stream_support/include/CGAL/IO/WKT.h @@ -33,8 +33,6 @@ #include #include -#include - #include #include @@ -157,7 +155,7 @@ read_multi_linestring_WKT( std::istream& in, break; } } - BOOST_FOREACH(LineString& ls, gc) + for(LineString& ls : gc) { mls.push_back(*ls.range); } @@ -312,7 +310,7 @@ write_multi_linestring_WKT( std::ostream& out, typedef typename MultiLineString::value_type PointRange; typedef internal::Geometry_container LineString; std::vector pr_range; - BOOST_FOREACH(PointRange& pr, mls) + for(PointRange& pr : mls) { LineString ls(pr); pr_range.push_back(ls); @@ -374,21 +372,21 @@ read_WKT( std::istream& input, { MultiPoint mp; CGAL::read_multi_point_WKT(input, mp); - BOOST_FOREACH(const Point& point, mp) + for(const Point& point : mp) points.push_back(point); } else if(type == "MULTILINESTRING") { MultiLineString mls; CGAL::read_multi_linestring_WKT(input, mls); - BOOST_FOREACH(const LineString& ls, mls) + for(const LineString& ls : mls) polylines.push_back(ls); } else if(type == "MULTIPOLYGON") { MultiPolygon mp; CGAL::read_multi_polygon_WKT(input, mp); - BOOST_FOREACH(const Polygon& poly, mp) + for(const Polygon& poly : mp) polygons.push_back(poly); } }while(input.good() && !input.eof()); diff --git a/Surface_mesh/include/CGAL/Surface_mesh/Properties.h b/Surface_mesh/include/CGAL/Surface_mesh/Properties.h index 98d4f69184c..c975f23d1d6 100644 --- a/Surface_mesh/include/CGAL/Surface_mesh/Properties.h +++ b/Surface_mesh/include/CGAL/Surface_mesh/Properties.h @@ -143,7 +143,7 @@ public: // virtual interface of Base_property_array bool transfer(const Base_property_array& other) { const Property_array* pa = dynamic_cast(&other); - if(pa != NULL){ + if(pa != nullptr){ std::copy((*pa).data_.begin(), (*pa).data_.end(), data_.end()-(*pa).data_.size()); return true; } @@ -153,7 +153,7 @@ public: // virtual interface of Base_property_array bool transfer(const Base_property_array& other, std::size_t from, std::size_t to) { const Property_array* pa = dynamic_cast(&other); - if (pa != NULL) + if (pa != nullptr) { data_[to] = (*pa)[from]; return true; @@ -542,11 +542,11 @@ public: public: /// @cond CGAL_DOCUMENT_INTERNALS - Property_map_base(Property_array* p=NULL) : parray_(p) {} + Property_map_base(Property_array* p=nullptr) : parray_(p) {} void reset() { - parray_ = NULL; + parray_ = nullptr; } /// @endcond @@ -559,21 +559,21 @@ public: operator bool () const; #else operator bool_type() const { - return parray_ != NULL ? + return parray_ != nullptr ? &Property_map_base::this_type_does_not_support_comparisons : 0; } #endif /// Access the property associated with the key \c i. reference operator[](const I& i) { - CGAL_assertion(parray_ != NULL); + CGAL_assertion(parray_ != nullptr); return (*parray_)[i]; } /// Access the property associated with the key \c i. reference operator[](const I& i) const { - CGAL_assertion(parray_ != NULL); + CGAL_assertion(parray_ != nullptr); return (*parray_)[i]; } @@ -600,7 +600,7 @@ public: /// \returns a pointer to the underlying storage of the property. const T* data() const { - CGAL_assertion(parray_ != NULL); + CGAL_assertion(parray_ != nullptr); return parray_->data(); } @@ -609,13 +609,13 @@ private: Property_array& array() { - CGAL_assertion(parray_ != NULL); + CGAL_assertion(parray_ != nullptr); return *parray_; } const Property_array& array() const { - CGAL_assertion(parray_ != NULL); + CGAL_assertion(parray_ != nullptr); return *parray_; } diff --git a/Surface_mesh/include/CGAL/Surface_mesh/Surface_mesh.h b/Surface_mesh/include/CGAL/Surface_mesh/Surface_mesh.h index f2c03be9a76..8985f14dc6d 100644 --- a/Surface_mesh/include/CGAL/Surface_mesh/Surface_mesh.h +++ b/Surface_mesh/include/CGAL/Surface_mesh/Surface_mesh.h @@ -477,7 +477,7 @@ private: //------------------------------------------------------ iterator types std::random_access_iterator_tag > Facade; public: - Index_iterator() : hnd_(), mesh_(NULL) {} + Index_iterator() : hnd_(), mesh_(nullptr) {} Index_iterator(const Index_& h, const Surface_mesh* m) : hnd_(h), mesh_(m) { if (mesh_ && mesh_->has_garbage()){ @@ -489,7 +489,7 @@ private: //------------------------------------------------------ iterator types void increment() { ++hnd_; - CGAL_assertion(mesh_ != NULL); + CGAL_assertion(mesh_ != nullptr); if(mesh_->has_garbage()) while ( mesh_->has_valid_index(hnd_) && mesh_->is_removed(hnd_)) ++hnd_; @@ -498,14 +498,14 @@ private: //------------------------------------------------------ iterator types void decrement() { --hnd_; - CGAL_assertion(mesh_ != NULL); + CGAL_assertion(mesh_ != nullptr); if(mesh_->has_garbage()) while ( mesh_->has_valid_index(hnd_) && mesh_->is_removed(hnd_)) --hnd_; } void advance(std::ptrdiff_t n) { - CGAL_assertion(mesh_ != NULL); + CGAL_assertion(mesh_ != nullptr); if (mesh_->has_garbage()) { @@ -1025,7 +1025,6 @@ public: /// adjusting anything. void remove_vertex(Vertex_index v) { - vremoved_ = add_property_map("v:removed", false).first; vremoved_[v] = true; ++removed_vertices_; garbage_ = true; vconn_[v].halfedge_ = Halfedge_index(vertices_freelist_); vertices_freelist_ = (size_type)v; @@ -1035,7 +1034,6 @@ public: /// adjusting anything. void remove_edge(Edge_index e) { - eremoved_ = add_property_map("e:removed", false).first; eremoved_[e] = true; ++removed_edges_; garbage_ = true; hconn_[Halfedge_index((size_type)e << 1)].next_halfedge_ = Halfedge_index(edges_freelist_ ); edges_freelist_ = ((size_type)e << 1); @@ -1046,7 +1044,6 @@ public: void remove_face(Face_index f) { - fremoved_ = add_property_map("f:removed", false).first; fremoved_[f] = true; ++removed_faces_; garbage_ = true; fconn_[f].halfedge_ = Halfedge_index(faces_freelist_); faces_freelist_ = (size_type)f; @@ -2235,7 +2232,7 @@ private: //------------------------------------------------------- private data os << "end_header" << std::endl; - BOOST_FOREACH(VIndex vi, sm.vertices()) + for(VIndex vi : sm.vertices()) { for (std::size_t i = 0; i < vprinters.size(); ++ i) { @@ -2249,11 +2246,11 @@ private: //------------------------------------------------------- private data std::vector polygon; - BOOST_FOREACH(FIndex fi, sm.faces()) + for(FIndex fi : sm.faces()) { // Get list of vertex indices polygon.clear(); - BOOST_FOREACH(HIndex hi, halfedges_around_face(halfedge(fi, sm), sm)) + for(HIndex hi : halfedges_around_face(halfedge(fi, sm), sm)) polygon.push_back (sm.target(hi)); if (get_mode (os) == IO::ASCII) @@ -2286,7 +2283,7 @@ private: //------------------------------------------------------- private data if (!eprinters.empty()) { - BOOST_FOREACH(EIndex ei, sm.edges()) + for(EIndex ei : sm.edges()) { if (get_mode (os) == IO::ASCII) os << int(sm.vertex(ei,0)) << " " << int(sm.vertex(ei,1)) << " "; @@ -2312,7 +2309,7 @@ private: //------------------------------------------------------- private data if (!hprinters.empty()) { - BOOST_FOREACH(HIndex hi, sm.halfedges()) + for(HIndex hi : sm.halfedges()) { if (get_mode (os) == IO::ASCII) os << int(sm.source(hi)) << " " << int(sm.target(hi)) << " "; diff --git a/Surface_mesh_deformation/examples/Surface_mesh_deformation/custom_weight_for_edges_example.cpp b/Surface_mesh_deformation/examples/Surface_mesh_deformation/custom_weight_for_edges_example.cpp index b6542507702..67da548e787 100644 --- a/Surface_mesh_deformation/examples/Surface_mesh_deformation/custom_weight_for_edges_example.cpp +++ b/Surface_mesh_deformation/examples/Surface_mesh_deformation/custom_weight_for_edges_example.cpp @@ -47,10 +47,9 @@ int main() std::map weight_map; // Store all the weights - halfedge_iterator eb, ee; - for(boost::tie(eb, ee) = halfedges(mesh); eb != ee; ++eb) + for(halfedge_descriptor h : halfedges(mesh)) { - weight_map[*eb] = 1.0; // store some precomputed weights + weight_map[h] = 1.0; // store some precomputed weights } // Create and initialize the vertex index map @@ -58,16 +57,16 @@ int main() Vertex_index_map vertex_index_map(internal_vertex_index_map); vertex_iterator vb, ve; std::size_t counter = 0; - for(boost::tie(vb, ve) = vertices(mesh); vb != ve; ++vb, ++counter) { - put(vertex_index_map, *vb, counter); + for(vertex_descriptor v : vertices(mesh)) { + put(vertex_index_map, v, counter++); } // Create and initialize the halfedge index map Internal_hedge_map internal_hedge_index_map; Hedge_index_map hedge_index_map(internal_hedge_index_map); counter = 0; - for(boost::tie(eb, ee) = halfedges(mesh); eb != ee; ++eb, ++counter) { - put(hedge_index_map, *eb, counter); + for(halfedge_descriptor h : halfedges(mesh)) { + put(hedge_index_map, h, counter++); } Surface_mesh_deformation deform_mesh(mesh, vertex_index_map, diff --git a/Surface_mesh_deformation/examples/Surface_mesh_deformation/deform_polyhedron_with_custom_pmap_example.cpp b/Surface_mesh_deformation/examples/Surface_mesh_deformation/deform_polyhedron_with_custom_pmap_example.cpp index b5195b4e83c..919e1677ba3 100644 --- a/Surface_mesh_deformation/examples/Surface_mesh_deformation/deform_polyhedron_with_custom_pmap_example.cpp +++ b/Surface_mesh_deformation/examples/Surface_mesh_deformation/deform_polyhedron_with_custom_pmap_example.cpp @@ -35,17 +35,15 @@ int main() // Init the indices of the vertices from 0 to num_vertices(mesh)-1 Vertex_id_map vertex_index_map; - vertex_iterator vb, ve; std::size_t counter = 0; - for(boost::tie(vb, ve) = vertices(mesh); vb != ve; ++vb, ++counter) - vertex_index_map[*vb]=counter; + for(vertex_descriptor v : vertices(mesh)) + vertex_index_map[v]=counter++; // Init the indices of the halfedges from 0 to 2*num_edges(mesh)-1 Hedge_id_map hedge_index_map; counter = 0; - halfedge_iterator eb, ee; - for(boost::tie(eb, ee) = halfedges(mesh); eb != ee; ++eb, ++counter) - hedge_index_map[*eb]=counter; + for(halfedge_descriptor h : halfedges(mesh)) + hedge_index_map[h]=counter++; Surface_mesh_deformation deform_mesh( mesh, Vertex_id_pmap(vertex_index_map), diff --git a/Surface_mesh_deformation/examples/Surface_mesh_deformation/k_ring_roi_translate_rotate_Surface_mesh.cpp b/Surface_mesh_deformation/examples/Surface_mesh_deformation/k_ring_roi_translate_rotate_Surface_mesh.cpp index a4abd913dd6..31a1f949269 100644 --- a/Surface_mesh_deformation/examples/Surface_mesh_deformation/k_ring_roi_translate_rotate_Surface_mesh.cpp +++ b/Surface_mesh_deformation/examples/Surface_mesh_deformation/k_ring_roi_translate_rotate_Surface_mesh.cpp @@ -10,10 +10,11 @@ typedef CGAL::Simple_cartesian Kernel; typedef Kernel::Point_3 Point_3; typedef CGAL::Surface_mesh Mesh; -typedef boost::graph_traits::vertex_descriptor vertex_descriptor; -typedef boost::graph_traits::vertex_iterator vertex_iterator; +typedef boost::graph_traits::vertex_descriptor vertex_descriptor; +typedef boost::graph_traits::vertex_iterator vertex_iterator; typedef boost::graph_traits::halfedge_descriptor halfedge_descriptor; -typedef boost::graph_traits::out_edge_iterator out_edge_iterator; +typedef boost::graph_traits::edge_descriptor edge_descriptor; + typedef Eigen::Vector3d Vector3d; @@ -32,10 +33,9 @@ std::vector extract_k_ring(const Mesh &P, vertex_descriptor v while( current_index < Q.size() && (dist_v = D[ Q[current_index] ]) < k ) { v = Q[current_index++]; - out_edge_iterator e, e_end; - for(boost::tie(e, e_end) = out_edges(v, P); e != e_end; e++) + for(edge_descriptor e : out_edges(v, P)) { - halfedge_descriptor he = halfedge(*e, P); + halfedge_descriptor he = halfedge(e, P); vertex_descriptor new_v = target(he, P); if(D.insert(std::make_pair(new_v, dist_v + 1)).second) { Q.push_back(new_v); diff --git a/Surface_mesh_deformation/examples/Surface_mesh_deformation/k_ring_roi_translate_rotate_example.cpp b/Surface_mesh_deformation/examples/Surface_mesh_deformation/k_ring_roi_translate_rotate_example.cpp index 00a34aeafb5..97550f1672f 100644 --- a/Surface_mesh_deformation/examples/Surface_mesh_deformation/k_ring_roi_translate_rotate_example.cpp +++ b/Surface_mesh_deformation/examples/Surface_mesh_deformation/k_ring_roi_translate_rotate_example.cpp @@ -12,10 +12,11 @@ typedef CGAL::Simple_cartesian Kernel; typedef CGAL::Polyhedron_3 Polyhedron; -typedef boost::graph_traits::vertex_descriptor vertex_descriptor; -typedef boost::graph_traits::vertex_iterator vertex_iterator; +typedef boost::graph_traits::vertex_descriptor vertex_descriptor; +typedef boost::graph_traits::vertex_iterator vertex_iterator; typedef boost::graph_traits::halfedge_descriptor halfedge_descriptor; -typedef boost::graph_traits::out_edge_iterator out_edge_iterator; +typedef boost::graph_traits::edge_descriptor edge_descriptor; + typedef Eigen::Vector3d Vector3d; @@ -34,10 +35,9 @@ std::vector extract_k_ring(const Polyhedron &P, vertex_descri while( current_index < Q.size() && (dist_v = D[ Q[current_index] ]) < k ) { v = Q[current_index++]; - out_edge_iterator e, e_end; - for(boost::tie(e, e_end) = out_edges(v, P); e != e_end; e++) + for(edge_descriptor e : out_edges(v, P)) { - halfedge_descriptor he = halfedge(*e, P); + halfedge_descriptor he = halfedge(e, P); vertex_descriptor new_v = target(he, P); if(D.insert(std::make_pair(new_v, dist_v + 1)).second) { Q.push_back(new_v); diff --git a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/internal/Containers_filler.h b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/internal/Containers_filler.h index a0d9715a32c..44ff8f6fe3b 100644 --- a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/internal/Containers_filler.h +++ b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/internal/Containers_filler.h @@ -62,7 +62,7 @@ public: Containers_filler(const TriangleMesh& mesh_, Vertex_set& vertices_) - : mesh(mesh_), vertices(vertices_), faces(NULL) + : mesh(mesh_), vertices(vertices_), faces(nullptr) { } void operator()(face_descriptor fd) @@ -72,7 +72,7 @@ public: vertices.insert(vd); } - if(faces != NULL) + if(faces != nullptr) faces->push_back(fd); } }; diff --git a/Surface_mesh_segmentation/examples/Surface_mesh_segmentation/sdf_values_example.cpp b/Surface_mesh_segmentation/examples/Surface_mesh_segmentation/sdf_values_example.cpp index be60e37163e..ba1c59def41 100644 --- a/Surface_mesh_segmentation/examples/Surface_mesh_segmentation/sdf_values_example.cpp +++ b/Surface_mesh_segmentation/examples/Surface_mesh_segmentation/sdf_values_example.cpp @@ -9,6 +9,7 @@ typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel; typedef CGAL::Polyhedron_3 Polyhedron; +typedef boost::graph_traits::face_descriptor face_descriptor; int main() { @@ -21,9 +22,9 @@ int main() } // create a property-map - typedef std::map Facet_double_map; - Facet_double_map internal_map; - boost::associative_property_map sdf_property_map(internal_map); + typedef std::map Face_double_map; + Face_double_map internal_map; + boost::associative_property_map sdf_property_map(internal_map); // compute SDF values std::pair min_max_sdf = CGAL::sdf_values(mesh, sdf_property_map); @@ -31,7 +32,7 @@ int main() // It is possible to compute the raw SDF values and post-process them using // the following lines: - // const std::size_t number_of_rays = 25; // cast 25 rays per facet + // const std::size_t number_of_rays = 25; // cast 25 rays per face // const double cone_angle = 2.0 / 3.0 * CGAL_PI; // set cone opening-angle // CGAL::sdf_values(mesh, sdf_property_map, cone_angle, number_of_rays, false); // std::pair min_max_sdf = @@ -42,9 +43,8 @@ int main() << " maximum SDF: " << min_max_sdf.second << std::endl; // print SDF values - for(Polyhedron::Facet_const_iterator facet_it = mesh.facets_begin(); - facet_it != mesh.facets_end(); ++facet_it) { - std::cout << sdf_property_map[facet_it] << " "; + for(face_descriptor f : faces(mesh)) { + std::cout << sdf_property_map[f] << " "; } std::cout << std::endl; return EXIT_SUCCESS; diff --git a/Surface_mesh_segmentation/examples/Surface_mesh_segmentation/segmentation_from_sdf_values_OpenMesh_example.cpp b/Surface_mesh_segmentation/examples/Surface_mesh_segmentation/segmentation_from_sdf_values_OpenMesh_example.cpp index 726e7f80f64..63fae635355 100644 --- a/Surface_mesh_segmentation/examples/Surface_mesh_segmentation/segmentation_from_sdf_values_OpenMesh_example.cpp +++ b/Surface_mesh_segmentation/examples/Surface_mesh_segmentation/segmentation_from_sdf_values_OpenMesh_example.cpp @@ -18,7 +18,6 @@ typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel; typedef OpenMesh::PolyMesh_ArrayKernelT Mesh; typedef boost::graph_traits::face_descriptor face_descriptor; -typedef boost::graph_traits::face_iterator face_iterator; int main(int argc, char** argv ) { @@ -55,11 +54,10 @@ int main(int argc, char** argv ) std::cout << "Number of segments: " << number_of_segments << std::endl; // print segment-ids - face_iterator facet_it, fend; - for(boost::tie(facet_it,fend) = faces(mesh); - facet_it != fend; ++facet_it) { + + for(face_descriptor f : faces(mesh)) { // ids are between [0, number_of_segments -1] - std::cout << segment_property_map[*facet_it] << " "; + std::cout << segment_property_map[f] << " "; } std::cout << std::endl; diff --git a/Surface_mesh_segmentation/examples/Surface_mesh_segmentation/segmentation_from_sdf_values_SM_example.cpp b/Surface_mesh_segmentation/examples/Surface_mesh_segmentation/segmentation_from_sdf_values_SM_example.cpp index ae508a23171..090ae7bd253 100644 --- a/Surface_mesh_segmentation/examples/Surface_mesh_segmentation/segmentation_from_sdf_values_SM_example.cpp +++ b/Surface_mesh_segmentation/examples/Surface_mesh_segmentation/segmentation_from_sdf_values_SM_example.cpp @@ -13,7 +13,6 @@ typedef CGAL::Surface_mesh Mesh; typedef boost::graph_traits::vertex_descriptor vertex_descriptor; typedef boost::graph_traits::face_descriptor face_descriptor; -typedef boost::graph_traits::face_iterator face_iterator; int main(int argc, char** argv ) { @@ -49,7 +48,7 @@ int main(int argc, char** argv ) std::cout << "Number of segments: " << number_of_segments << std::endl; // print segment-ids - face_iterator facet_it, fend; + for(face_descriptor fd : faces(mesh)){ // ids are between [0, number_of_segments -1] std::cout << segment_property_map[fd] << " "; diff --git a/Surface_mesh_segmentation/examples/Surface_mesh_segmentation/segmentation_from_sdf_values_example.cpp b/Surface_mesh_segmentation/examples/Surface_mesh_segmentation/segmentation_from_sdf_values_example.cpp index 871bdf16bef..c84eb49b149 100644 --- a/Surface_mesh_segmentation/examples/Surface_mesh_segmentation/segmentation_from_sdf_values_example.cpp +++ b/Surface_mesh_segmentation/examples/Surface_mesh_segmentation/segmentation_from_sdf_values_example.cpp @@ -9,6 +9,7 @@ typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel; typedef CGAL::Polyhedron_3 Polyhedron; +typedef boost::graph_traits::face_descriptor face_descriptor; int main() { @@ -21,7 +22,7 @@ int main() } // create a property-map for SDF values - typedef std::map Facet_double_map; + typedef std::map Facet_double_map; Facet_double_map internal_sdf_map; boost::associative_property_map sdf_property_map(internal_sdf_map); @@ -29,7 +30,7 @@ int main() CGAL::sdf_values(mesh, sdf_property_map); // create a property-map for segment-ids - typedef std::map Facet_int_map; + typedef std::map Facet_int_map; Facet_int_map internal_segment_map; boost::associative_property_map segment_property_map(internal_segment_map); @@ -39,10 +40,9 @@ int main() std::cout << "Number of segments: " << number_of_segments << std::endl; // print segment-ids - for(Polyhedron::Facet_const_iterator facet_it = mesh.facets_begin(); - facet_it != mesh.facets_end(); ++facet_it) { + for(face_descriptor f : faces(mesh)) { // ids are between [0, number_of_segments -1] - std::cout << segment_property_map[facet_it] << " "; + std::cout << segment_property_map[f] << " "; } std::cout << std::endl; diff --git a/Surface_mesh_segmentation/examples/Surface_mesh_segmentation/segmentation_via_sdf_values_example.cpp b/Surface_mesh_segmentation/examples/Surface_mesh_segmentation/segmentation_via_sdf_values_example.cpp index a1d847c5ed1..41fbb550d55 100644 --- a/Surface_mesh_segmentation/examples/Surface_mesh_segmentation/segmentation_via_sdf_values_example.cpp +++ b/Surface_mesh_segmentation/examples/Surface_mesh_segmentation/segmentation_via_sdf_values_example.cpp @@ -9,6 +9,7 @@ typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel; typedef CGAL::Polyhedron_3 Polyhedron; +typedef boost::graph_traits::face_descriptor face_descriptor; int main() { @@ -21,9 +22,9 @@ int main() } // create a property-map for segment-ids - typedef std::map Facet_int_map; - Facet_int_map internal_segment_map; - boost::associative_property_map segment_property_map(internal_segment_map); + typedef std::map Face_int_map; + Face_int_map internal_segment_map; + boost::associative_property_map segment_property_map(internal_segment_map); // calculate SDF values and segment the mesh using default parameters. std::size_t number_of_segments = CGAL::segmentation_via_sdf_values(mesh, segment_property_map); @@ -31,9 +32,8 @@ int main() std::cout << "Number of segments: " << number_of_segments << std::endl; // print segment-ids - for(Polyhedron::Facet_const_iterator facet_it = mesh.facets_begin(); - facet_it != mesh.facets_end(); ++facet_it) { - std::cout << segment_property_map[facet_it] << " "; + for(face_descriptor f : faces(mesh) ) { + std::cout << segment_property_map[f] << " "; } std::cout << std::endl; return EXIT_SUCCESS; diff --git a/Surface_mesh_segmentation/examples/Surface_mesh_segmentation/segmentation_with_facet_ids_example.cpp b/Surface_mesh_segmentation/examples/Surface_mesh_segmentation/segmentation_with_facet_ids_example.cpp index 9984d5756a0..e8e5ae4dcba 100644 --- a/Surface_mesh_segmentation/examples/Surface_mesh_segmentation/segmentation_with_facet_ids_example.cpp +++ b/Surface_mesh_segmentation/examples/Surface_mesh_segmentation/segmentation_with_facet_ids_example.cpp @@ -10,20 +10,21 @@ typedef CGAL::Exact_predicates_inexact_constructions_kernel K; typedef CGAL::Polyhedron_3 Polyhedron; +typedef boost::graph_traits::face_descriptor face_descriptor; -// Property map associating a facet with an integer as id to an +// Property map associating a face with an integer as id to an // element in a vector stored internally template -struct Facet_with_id_pmap +struct Face_with_id_pmap : public boost::put_get_helper > + Face_with_id_pmap > { - typedef Polyhedron::Facet_const_handle key_type; + typedef face_descriptor key_type; typedef ValueType value_type; typedef value_type& reference; typedef boost::lvalue_property_map_tag category; - Facet_with_id_pmap( + Face_with_id_pmap( std::vector& internal_vector ) : internal_vector(internal_vector) { } @@ -43,36 +44,33 @@ int main() return EXIT_FAILURE; } - // assign id field for each facet - std::size_t facet_id = 0; - for(Polyhedron::Facet_iterator facet_it = mesh.facets_begin(); - facet_it != mesh.facets_end(); ++facet_it, ++facet_id) { - facet_it->id() = facet_id; + // assign id field for each face + std::size_t face_id = 0; + for(face_descriptor f : faces( mesh) ) { + f->id() = face_id++; } // create a property-map for SDF values - std::vector sdf_values(mesh.size_of_facets()); - Facet_with_id_pmap sdf_property_map(sdf_values); + std::vector sdf_values(num_faces(mesh)); + Face_with_id_pmap sdf_property_map(sdf_values); CGAL::sdf_values(mesh, sdf_property_map); // access SDF values (with constant-complexity) - for(Polyhedron::Facet_const_iterator facet_it = mesh.facets_begin(); - facet_it != mesh.facets_end(); ++facet_it) { - std::cout << sdf_property_map[facet_it] << " "; + for(face_descriptor f : faces(mesh)) { + std::cout << sdf_property_map[f] << " "; } std::cout << std::endl; // create a property-map for segment-ids - std::vector segment_ids(mesh.size_of_facets()); - Facet_with_id_pmap segment_property_map(segment_ids); + std::vector segment_ids(num_faces(mesh)); + Face_with_id_pmap segment_property_map(segment_ids); CGAL::segmentation_from_sdf_values(mesh, sdf_property_map, segment_property_map); // access segment-ids (with constant-complexity) - for(Polyhedron::Facet_const_iterator facet_it = mesh.facets_begin(); - facet_it != mesh.facets_end(); ++facet_it) { - std::cout << segment_property_map[facet_it] << " "; + for(face_descriptor f : faces(mesh)) { + std::cout << segment_property_map[f] << " "; } std::cout << std::endl; return EXIT_SUCCESS; diff --git a/Surface_mesh_segmentation/include/CGAL/internal/auxiliary/graph.h b/Surface_mesh_segmentation/include/CGAL/internal/auxiliary/graph.h index 2974d44e121..b8f8d96e5f3 100644 --- a/Surface_mesh_segmentation/include/CGAL/internal/auxiliary/graph.h +++ b/Surface_mesh_segmentation/include/CGAL/internal/auxiliary/graph.h @@ -267,8 +267,8 @@ public: (optionally) the pointer to the function which will be called if allocation failed; the message passed to this function is "Not enough memory!" */ - Block(int size, void (*err_function)(const char *) = NULL) { - first = last = NULL; + Block(int size, void (*err_function)(const char *) = nullptr) { + first = last = nullptr; block_size = size; error_function = err_function; } @@ -301,7 +301,7 @@ public: last = next; last -> current = & ( last -> data[0] ); last -> last = last -> current + block_size; - last -> next = NULL; + last -> next = nullptr; } } @@ -310,7 +310,7 @@ public: return t; } - /* Returns the first item (or NULL, if no items were added) */ + /* Returns the first item (or nullptr, if no items were added) */ Type *ScanFirst() { for (scan_current_block=first; scan_current_block; scan_current_block = scan_current_block->next) { @@ -318,16 +318,16 @@ public: if (scan_current_data < scan_current_block -> current) return scan_current_data ++; } - return NULL; + return nullptr; } - /* Returns the next item (or NULL, if all items have been read) + /* Returns the next item (or nullptr, if all items have been read) Can be called only if previous ScanFirst() or ScanNext() - call returned not NULL. */ + call returned not nullptr. */ Type *ScanNext() { while (scan_current_data >= scan_current_block -> current) { scan_current_block = scan_current_block -> next; - if (!scan_current_block) return NULL; + if (!scan_current_block) return nullptr; scan_current_data = & ( scan_current_block -> data[0] ); } return scan_current_data ++; @@ -375,9 +375,9 @@ public: (optionally) the pointer to the function which will be called if allocation failed; the message passed to this function is "Not enough memory!" */ - DBlock(int size, void (*err_function)(const char *) = NULL) { - first = NULL; - first_free = NULL; + DBlock(int size, void (*err_function)(const char *) = nullptr) { + first = nullptr; + first_free = nullptr; block_size = size; error_function = err_function; } @@ -405,7 +405,7 @@ public: first_free = & (first -> data[0] ); for (item=first_free; item next_free = item + 1; - item -> next_free = NULL; + item -> next_free = nullptr; first -> next = next; } @@ -522,7 +522,7 @@ public: function which will be called if an error occurs; an error message is passed to this function. If this argument is omitted, exit(1) will be called. */ - Graph(void (*err_function)(const char *) = NULL); + Graph(void (*err_function)(const char *) = nullptr); /* Destructor */ ~Graph(); @@ -668,7 +668,7 @@ private: void (*error_function)(const char *); /* this function is called if a error occurs, with a corresponding error message - (or exit(1) is called if it's NULL) */ + (or exit(1) is called if it's nullptr) */ flowtype flow; /* total flow */ @@ -700,11 +700,11 @@ private: inline Graph::Graph(void (*err_function)(const char *)) { error_function = err_function; - node_block_first = NULL; - arc_for_block_first = NULL; - arc_rev_block_first = NULL; - orphan_first = NULL; - orphan_last = NULL; + node_block_first = nullptr; + arc_for_block_first = nullptr; + arc_rev_block_first = nullptr; + orphan_first = nullptr; + orphan_last = nullptr; flow = 0; } @@ -850,10 +850,10 @@ inline void Graph::prepare_graph() } /* FIRST STAGE */ - a_rev_tmp->sister = NULL; + a_rev_tmp->sister = nullptr; for (a_rev=arc_rev_block_first->current; a_rev<&arc_rev_block_first->arcs_rev[MF_ARC_BLOCK_SIZE]; a_rev++) { - a_rev -> sister = NULL; + a_rev -> sister = nullptr; } ab_for = ab_for_first = arc_for_block_first; @@ -870,12 +870,12 @@ inline void Graph::prepare_graph() if (error_function) (*error_function)("# of arcs per node exceeds block size!"); exit(1); } - if (for_flag) ab_for = NULL; + if (for_flag) ab_for = nullptr; else { ab_for = ab_for -> next; ab_rev_scan = ab_rev_scan -> next; } - if (ab_for == NULL) { + if (ab_for == nullptr) { arc_for_block *next = arc_for_block_first; char *ptr = new char[sizeof(arc_for_block)+1]; if (!ptr) { @@ -907,9 +907,9 @@ inline void Graph::prepare_graph() if (error_function) (*error_function)("# of arcs per node exceeds block size!"); exit(1); } - if (rev_flag) ab_rev = NULL; + if (rev_flag) ab_rev = nullptr; else ab_rev = ab_rev -> next; - if (ab_rev == NULL) { + if (ab_rev == nullptr) { arc_rev_block *next = arc_rev_block_first; char *ptr = new char[sizeof(arc_rev_block)+1]; if (!ptr) { @@ -957,7 +957,7 @@ inline void Graph::prepare_graph() ar = a_rev; do { - ar -> sister = NULL; + ar -> sister = nullptr; shift_new = ((char *)(af->shift)) - (char *)from; r_cap_new = af -> r_cap; @@ -1044,7 +1044,7 @@ inline void Graph::prepare_graph() Functions for processing active list. i->next points to the next node in the list (or to i, if i is the last node in the list). - If i->next is NULL iff i is not in the list. + If i->next is nullptr iff i is not in the list. There are two queues. Active nodes are added to the end of the second queue and read from @@ -1077,15 +1077,15 @@ inline Graph::node * Graph::next_active() if (!(i=queue_first[0])) { queue_first[0] = i = queue_first[1]; queue_last[0] = queue_last[1]; - queue_first[1] = NULL; - queue_last[1] = NULL; - if (!i) return NULL; + queue_first[1] = nullptr; + queue_last[1] = nullptr; + if (!i) return nullptr; } /* remove it from the active list */ - if (i->next == i) queue_first[0] = queue_last[0] = NULL; + if (i->next == i) queue_first[0] = queue_last[0] = nullptr; else queue_first[0] = i -> next; - i -> next = NULL; + i -> next = nullptr; /* a node in the list is active iff it has a parent */ if (i->parent) return i; @@ -1099,13 +1099,13 @@ inline void Graph::maxflow_init() node *i; node_block *nb; - queue_first[0] = queue_last[0] = NULL; - queue_first[1] = queue_last[1] = NULL; - orphan_first = NULL; + queue_first[0] = queue_last[0] = nullptr; + queue_first[1] = queue_last[1] = nullptr; + orphan_first = nullptr; for (nb=node_block_first; nb; nb=nb->next) for (i=&nb->nodes[0]; icurrent; i++) { - i -> next = NULL; + i -> next = nullptr; i -> TS = 0; if (i->tr_cap > 0) { /* i is connected to the source */ @@ -1122,7 +1122,7 @@ inline void Graph::maxflow_init() i -> TS = 0; i -> DIST = 1; } else { - i -> parent = NULL; + i -> parent = nullptr; } } TIME = 0; @@ -1266,7 +1266,7 @@ inline void Graph::process_source_orphan(node *i) node *j; arc_forward *a0_for, *a0_for_first, *a0_for_last; arc_reverse *a0_rev, *a0_rev_first, *a0_rev_last; - arc_forward *a0_min = NULL, *a; + arc_forward *a0_min = nullptr, *a; nodeptr *np; int d, d_min = MF_INFINITE_D; @@ -1397,7 +1397,7 @@ inline void Graph::process_source_orphan(node *i) if (orphan_last) orphan_last -> next = np; else orphan_first = np; orphan_last = np; - np -> next = NULL; + np -> next = nullptr; } } } @@ -1414,7 +1414,7 @@ inline void Graph::process_source_orphan(node *i) if (orphan_last) orphan_last -> next = np; else orphan_first = np; orphan_last = np; - np -> next = NULL; + np -> next = nullptr; } } } @@ -1426,7 +1426,7 @@ inline void Graph::process_sink_orphan(node *i) node *j; arc_forward *a0_for, *a0_for_first, *a0_for_last; arc_reverse *a0_rev, *a0_rev_first, *a0_rev_last; - arc_forward *a0_min = NULL, *a; + arc_forward *a0_min = nullptr, *a; nodeptr *np; int d, d_min = MF_INFINITE_D; @@ -1557,7 +1557,7 @@ inline void Graph::process_sink_orphan(node *i) if (orphan_last) orphan_last -> next = np; else orphan_first = np; orphan_last = np; - np -> next = NULL; + np -> next = nullptr; } } } @@ -1574,7 +1574,7 @@ inline void Graph::process_sink_orphan(node *i) if (orphan_last) orphan_last -> next = np; else orphan_first = np; orphan_last = np; - np -> next = NULL; + np -> next = nullptr; } } } @@ -1585,8 +1585,8 @@ inline void Graph::process_sink_orphan(node *i) inline Graph::flowtype Graph::maxflow() { - node *i, *j, *current_node = NULL, *s_start, *t_start=NULL; - captype *cap_middle=NULL, *rev_cap_middle=NULL; + node *i, *j, *current_node = nullptr, *s_start, *t_start=nullptr; + captype *cap_middle=nullptr, *rev_cap_middle=nullptr; arc_forward *a_for, *a_for_first, *a_for_last; arc_reverse *a_rev, *a_rev_first, *a_rev_last; nodeptr *np, *np_next; @@ -1597,15 +1597,15 @@ inline Graph::flowtype Graph::maxflow() while ( 1 ) { if ( (i=current_node) ) { - i -> next = NULL; /* remove active flag */ - if (!i->parent) i = NULL; + i -> next = nullptr; /* remove active flag */ + if (!i->parent) i = nullptr; } if (!i) { if (!(i = next_active())) break; } /* growth */ - s_start = NULL; + s_start = nullptr; a_for_first = i -> first_out; if (MF_IS_ODD(a_for_first)) { @@ -1734,13 +1734,13 @@ inline Graph::flowtype Graph::maxflow() /* adoption */ while ( (np=orphan_first) ) { np_next = np -> next; - np -> next = NULL; + np -> next = nullptr; while ( (np=orphan_first) ) { orphan_first = np -> next; i = np -> ptr; nodeptr_block -> Delete(np); - if (!orphan_first) orphan_last = NULL; + if (!orphan_first) orphan_last = nullptr; if (i->is_sink) process_sink_orphan(i); else process_source_orphan(i); } @@ -1748,7 +1748,7 @@ inline Graph::flowtype Graph::maxflow() orphan_first = np_next; } /* adoption end */ - } else current_node = NULL; + } else current_node = nullptr; } delete nodeptr_block; diff --git a/Surface_mesh_shortest_path/include/CGAL/Surface_mesh_shortest_path/Surface_mesh_shortest_path.h b/Surface_mesh_shortest_path/include/CGAL/Surface_mesh_shortest_path/Surface_mesh_shortest_path.h index ec6f44e5a28..3e713c23161 100644 --- a/Surface_mesh_shortest_path/include/CGAL/Surface_mesh_shortest_path/Surface_mesh_shortest_path.h +++ b/Surface_mesh_shortest_path/include/CGAL/Surface_mesh_shortest_path/Surface_mesh_shortest_path.h @@ -560,9 +560,9 @@ private: d2 = v2Distance.second; d3 = v3Distance.second; - bool hasD1 = v1Distance.first != NULL && v1Distance.first != cone->parent(); - bool hasD2 = v2Distance.first != NULL && v2Distance.first != cone->parent(); - bool hasD3 = v3Distance.first != NULL && v3Distance.first != cone->parent(); + bool hasD1 = v1Distance.first != nullptr && v1Distance.first != cone->parent(); + bool hasD2 = v2Distance.first != nullptr && v2Distance.first != cone->parent(); + bool hasD3 = v3Distance.first != nullptr && v3Distance.first != cone->parent(); if (hasD1 && (d + CGAL::internal::select_sqrt(csd2(I, B)) > d1 + CGAL::internal::select_sqrt(csd2(v1, B)))) { @@ -621,9 +621,9 @@ private: typename Traits::Construct_vertex_2 cv2(m_traits.construct_vertex_2_object()); typename Traits::Construct_triangle_3_along_segment_2_flattening ft3as2(m_traits.construct_triangle_3_along_segment_2_flattening_object()); - CGAL_assertion(cone->m_pendingLeftSubtree != NULL); + CGAL_assertion(cone->m_pendingLeftSubtree != nullptr); - cone->m_pendingLeftSubtree = NULL; + cone->m_pendingLeftSubtree = nullptr; if (window_distance_filter(cone, windowSegment, false)) { @@ -648,9 +648,9 @@ private: typename Traits::Construct_vertex_2 cv2(m_traits.construct_vertex_2_object()); typename Traits::Construct_triangle_3_along_segment_2_flattening ft3as2(m_traits.construct_triangle_3_along_segment_2_flattening_object()); - CGAL_assertion(cone->m_pendingRightSubtree != NULL); + CGAL_assertion(cone->m_pendingRightSubtree != nullptr); - cone->m_pendingRightSubtree = NULL; + cone->m_pendingRightSubtree = nullptr; if (window_distance_filter(cone, windowSegment, true)) { @@ -835,7 +835,7 @@ private: typename Traits::Construct_triangle_3_to_triangle_2_projection pt3t2(m_traits.construct_triangle_3_to_triangle_2_projection_object()); typename Traits::Construct_vertex_2 cv2(m_traits.construct_vertex_2_object()); - parent->m_pendingMiddleSubtree = NULL; + parent->m_pendingMiddleSubtree = nullptr; vertex_descriptor expansionVertex = parent->target_vertex(); @@ -1110,7 +1110,7 @@ private: std::cout << "\t Target vertex = " << get(m_vertexIndexMap, node->target_vertex()) << std::endl; } - if (currentOccupier.first != NULL) + if (currentOccupier.first != nullptr) { if (node->is_vertex_node()) { @@ -1148,7 +1148,7 @@ private: std::cout << "\t New Distance = " << currentNodeDistance << std::endl; } - if (currentOccupier.first == NULL || currentOccupier.second > currentNodeDistance) + if (currentOccupier.first == nullptr || currentOccupier.second > currentNodeDistance) { if (m_debugOutput) { @@ -1175,7 +1175,7 @@ private: } } - if (currentOccupier.first != NULL) + if (currentOccupier.first != nullptr) { if (isLeftOfCurrent) { @@ -1183,10 +1183,10 @@ private: { delete_node(currentOccupier.first->remove_left_child()); } - else if (currentOccupier.first->m_pendingLeftSubtree != NULL) + else if (currentOccupier.first->m_pendingLeftSubtree != nullptr) { currentOccupier.first->m_pendingLeftSubtree->m_cancelled = true; - currentOccupier.first->m_pendingLeftSubtree = NULL; + currentOccupier.first->m_pendingLeftSubtree = nullptr; } } else @@ -1195,10 +1195,10 @@ private: { delete_node(currentOccupier.first->remove_right_child()); } - else if (currentOccupier.first->m_pendingRightSubtree != NULL) + else if (currentOccupier.first->m_pendingRightSubtree != nullptr) { currentOccupier.first->m_pendingRightSubtree->m_cancelled = true; - currentOccupier.first->m_pendingRightSubtree = NULL; + currentOccupier.first->m_pendingRightSubtree = nullptr; } } } @@ -1208,12 +1208,12 @@ private: // Check if this is now the absolute closest node, and replace the current closest as appropriate Node_distance_pair currentClosest = m_closestToVertices[targetVertexIndex]; - if (m_debugOutput && currentClosest.first != NULL) + if (m_debugOutput && currentClosest.first != nullptr) { std::cout << "\t Current Closest Distance = " << currentClosest.second << std::endl; } - if (currentClosest.first == NULL || currentClosest.second > currentNodeDistance) + if (currentClosest.first == nullptr || currentClosest.second > currentNodeDistance) { if (m_debugOutput) { @@ -1223,17 +1223,17 @@ private: // if this is a saddle vertex, then evict previous closest vertex if (m_vertexIsPseudoSource[targetVertexIndex]) { - if (currentClosest.first != NULL) + if (currentClosest.first != nullptr) { if (m_debugOutput) { std::cout << "\tEvicting old pseudo-source: " << currentClosest.first << std::endl; } - if (currentClosest.first->m_pendingMiddleSubtree != NULL) + if (currentClosest.first->m_pendingMiddleSubtree != nullptr) { currentClosest.first->m_pendingMiddleSubtree->m_cancelled = true; - currentClosest.first->m_pendingMiddleSubtree = NULL; + currentClosest.first->m_pendingMiddleSubtree = nullptr; } while (currentClosest.first->has_middle_children()) @@ -1387,20 +1387,20 @@ private: void delete_node(Cone_tree_node* node, bool destruction = false) { - if (node != NULL) + if (node != nullptr) { if (m_debugOutput) { std::cout << "Deleting node " << node << std::endl; } - if (node->m_pendingLeftSubtree != NULL) + if (node->m_pendingLeftSubtree != nullptr) { node->m_pendingLeftSubtree->m_cancelled = true; - node->m_pendingLeftSubtree = NULL; + node->m_pendingLeftSubtree = nullptr; } - if (node->get_left_child() != NULL) + if (node->get_left_child() != nullptr) { if (m_debugOutput) { @@ -1410,13 +1410,13 @@ private: delete_node(node->remove_left_child(), destruction); } - if (node->m_pendingRightSubtree != NULL) + if (node->m_pendingRightSubtree != nullptr) { node->m_pendingRightSubtree->m_cancelled = true; - node->m_pendingRightSubtree = NULL; + node->m_pendingRightSubtree = nullptr; } - if (node->get_right_child() != NULL) + if (node->get_right_child() != nullptr) { if (m_debugOutput) { @@ -1426,10 +1426,10 @@ private: delete_node(node->remove_right_child(), destruction); } - if (node->m_pendingMiddleSubtree != NULL) + if (node->m_pendingMiddleSubtree != nullptr) { node->m_pendingMiddleSubtree->m_cancelled = true; - node->m_pendingMiddleSubtree = NULL; + node->m_pendingMiddleSubtree = nullptr; } if (node->has_middle_children() && m_debugOutput) @@ -1450,13 +1450,13 @@ private: if (m_vertexOccupiers[entryEdgeIndex].first == node) { - m_vertexOccupiers[entryEdgeIndex].first = NULL; + m_vertexOccupiers[entryEdgeIndex].first = nullptr; std::size_t targetVertexIndex = get(m_vertexIndexMap, node->target_vertex()); if (m_closestToVertices[targetVertexIndex].first == node) { - m_closestToVertices[targetVertexIndex].first = NULL; + m_closestToVertices[targetVertexIndex].first = nullptr; } } } @@ -1520,7 +1520,7 @@ private: void reset_algorithm(bool clearFaceLocations = true) { - Cone_tree_node* null_value=NULL; + Cone_tree_node* null_value=nullptr; m_closestToVertices.resize(num_vertices(m_graph)); std::fill(m_closestToVertices.begin(), m_closestToVertices.end(), Node_distance_pair(null_value, FT(0.0))); m_vertexOccupiers.resize(num_halfedges(m_graph)); @@ -1643,12 +1643,12 @@ private: m_faceOccupiers[faceIndex].push_back(node); } - if (node->get_left_child() != NULL) + if (node->get_left_child() != nullptr) { add_to_face_list(node->get_left_child()); } - if (node->get_right_child() != NULL) + if (node->get_right_child() != nullptr) { add_to_face_list(node->get_right_child()); } @@ -1682,7 +1682,7 @@ private: std::size_t faceIndex = get(m_faceIndexMap, f); - Cone_tree_node* closest = NULL; + Cone_tree_node* closest = nullptr; FT closestDistance = 0; std::vector& currentFaceList = m_faceOccupiers[faceIndex]; @@ -1691,7 +1691,7 @@ private: { Cone_tree_node* current = currentFaceList[i]; - if (closest != NULL && current->distance_from_source_to_root() >= closestDistance) + if (closest != nullptr && current->distance_from_source_to_root() >= closestDistance) { continue; } @@ -1702,7 +1702,7 @@ private: { FT currentDistance = current->distance_to_root(locationInContext); - if (closest == NULL || currentDistance < closestDistance) + if (closest == nullptr || currentDistance < closestDistance) { closest = current; closestDistance = currentDistance; @@ -1716,7 +1716,7 @@ private: } else { - return std::make_pair(Node_distance_pair((Cone_tree_node*)NULL, FT(0.0)), cbc(FT(0.0), FT(0.0), FT(0.0))); + return std::make_pair(Node_distance_pair((Cone_tree_node*)nullptr, FT(0.0)), cbc(FT(0.0), FT(0.0), FT(0.0))); } } @@ -1755,11 +1755,11 @@ private: Barycentric_coordinates oppositeLocation(cbc(oppositeLocationCoords[0], oppositeLocationCoords[1], oppositeLocationCoords[2])); std::pair otherFace = nearest_on_face(face(oppositeHalfedge, m_graph), oppositeLocation); - if (mainFace.first.first == NULL) + if (mainFace.first.first == nullptr) { return otherFace; } - else if (otherFace.first.first == NULL) + else if (otherFace.first.first == nullptr) { return mainFace; } diff --git a/Surface_mesh_shortest_path/include/CGAL/Surface_mesh_shortest_path/internal/Cone_tree.h b/Surface_mesh_shortest_path/include/CGAL/Surface_mesh_shortest_path/internal/Cone_tree.h index 68da56952b5..0915c896775 100644 --- a/Surface_mesh_shortest_path/include/CGAL/Surface_mesh_shortest_path/internal/Cone_tree.h +++ b/Surface_mesh_shortest_path/include/CGAL/Surface_mesh_shortest_path/internal/Cone_tree.h @@ -107,11 +107,11 @@ public: , m_level(0) , m_treeId(treeId) , m_nodeType(ROOT) - , m_leftChild(NULL) - , m_rightChild(NULL) - , m_pendingLeftSubtree(NULL) - , m_pendingRightSubtree(NULL) - , m_pendingMiddleSubtree(NULL) + , m_leftChild(nullptr) + , m_rightChild(nullptr) + , m_pendingLeftSubtree(nullptr) + , m_pendingRightSubtree(nullptr) + , m_pendingMiddleSubtree(nullptr) { } @@ -125,11 +125,11 @@ public: , m_level(0) , m_treeId(treeId) , m_nodeType(ROOT) - , m_leftChild(NULL) - , m_rightChild(NULL) - , m_pendingLeftSubtree(NULL) - , m_pendingRightSubtree(NULL) - , m_pendingMiddleSubtree(NULL) + , m_leftChild(nullptr) + , m_rightChild(nullptr) + , m_pendingLeftSubtree(nullptr) + , m_pendingRightSubtree(nullptr) + , m_pendingMiddleSubtree(nullptr) { } @@ -143,11 +143,11 @@ public: , m_windowLeft(windowLeft) , m_windowRight(windowRight) , m_nodeType(nodeType) - , m_leftChild(NULL) - , m_rightChild(NULL) - , m_pendingLeftSubtree(NULL) - , m_pendingRightSubtree(NULL) - , m_pendingMiddleSubtree(NULL) + , m_leftChild(nullptr) + , m_rightChild(nullptr) + , m_pendingLeftSubtree(nullptr) + , m_pendingRightSubtree(nullptr) + , m_pendingMiddleSubtree(nullptr) { } @@ -347,10 +347,10 @@ public: void push_middle_child(Cone_tree_node* child) { - if (m_pendingMiddleSubtree != NULL) + if (m_pendingMiddleSubtree != nullptr) { m_pendingMiddleSubtree->m_cancelled = true; - m_pendingMiddleSubtree = NULL; + m_pendingMiddleSubtree = nullptr; } m_middleChildren.push_back(child); @@ -366,10 +366,10 @@ public: void set_left_child(Cone_tree_node* child) { - if (m_pendingLeftSubtree != NULL) + if (m_pendingLeftSubtree != nullptr) { m_pendingLeftSubtree->m_cancelled = true; - m_pendingLeftSubtree = NULL; + m_pendingLeftSubtree = nullptr; } m_leftChild = child; @@ -384,16 +384,16 @@ public: Cone_tree_node* remove_left_child() { Cone_tree_node* temp = m_leftChild; - m_leftChild = NULL; + m_leftChild = nullptr; return temp; } void set_right_child(Cone_tree_node* child) { - if (m_pendingRightSubtree != NULL) + if (m_pendingRightSubtree != nullptr) { m_pendingRightSubtree->m_cancelled = true; - m_pendingRightSubtree = NULL; + m_pendingRightSubtree = nullptr; } m_rightChild = child; @@ -408,7 +408,7 @@ public: Cone_tree_node* remove_right_child() { Cone_tree_node* temp = m_rightChild; - m_rightChild = NULL; + m_rightChild = nullptr; return temp; } @@ -419,12 +419,12 @@ public: bool is_left_child() const { - return m_parent != NULL && m_parent->m_leftChild == this; + return m_parent != nullptr && m_parent->m_leftChild == this; } bool is_right_child() const { - return m_parent != NULL && m_parent->m_rightChild == this; + return m_parent != nullptr && m_parent->m_rightChild == this; } public: diff --git a/Surface_sweep_2/include/CGAL/No_intersection_surface_sweep_2.h b/Surface_sweep_2/include/CGAL/No_intersection_surface_sweep_2.h index 5e91785fbd1..86cb20d5189 100644 --- a/Surface_sweep_2/include/CGAL/No_intersection_surface_sweep_2.h +++ b/Surface_sweep_2/include/CGAL/No_intersection_surface_sweep_2.h @@ -500,7 +500,7 @@ protected: std::pair _push_event(const Point_2& pt, Attribute type, Arr_parameter_space ps_x, Arr_parameter_space ps_y, - Subcurve* sc = NULL); + Subcurve* sc = nullptr); /*! Push an event point associated with a curve end into the event queue. * \param cv The x-monotone curve. @@ -518,7 +518,7 @@ protected: Attribute type, Arr_parameter_space ps_x, Arr_parameter_space ps_y, - Subcurve* sc = NULL); + Subcurve* sc = nullptr); void _update_event_at_open_boundary(Event* e, const X_monotone_curve_2& cv, diff --git a/Surface_sweep_2/include/CGAL/Surface_sweep_2.h b/Surface_sweep_2/include/CGAL/Surface_sweep_2.h index bdcd91b5874..cca624c3fee 100644 --- a/Surface_sweep_2/include/CGAL/Surface_sweep_2.h +++ b/Surface_sweep_2/include/CGAL/Surface_sweep_2.h @@ -208,7 +208,7 @@ protected: * \param curve1 The first curve. * \param curve2 The second curve. */ - void _intersect(Subcurve* c1, Subcurve* c2, Event* event_for_overlap = NULL); + void _intersect(Subcurve* c1, Subcurve* c2, Event* event_for_overlap = nullptr); /*! When a curve is removed from the status line for good, its top and * bottom neighbors become neighbors. This method finds these cases and diff --git a/Surface_sweep_2/include/CGAL/Surface_sweep_2/Default_subcurve.h b/Surface_sweep_2/include/CGAL/Surface_sweep_2/Default_subcurve.h index 5a3d8360116..c174e4280fe 100644 --- a/Surface_sweep_2/include/CGAL/Surface_sweep_2/Default_subcurve.h +++ b/Surface_sweep_2/include/CGAL/Surface_sweep_2/Default_subcurve.h @@ -67,7 +67,7 @@ namespace Surface_sweep_2 { * * The information contained in this class is: * - two pointers to subcurves that are the originating subcurves in case of - * an overlap, otherwise thay are both NULL. + * an overlap, otherwise thay are both nullptr. */ template @@ -89,16 +89,16 @@ public: /*! Construct default. */ Default_subcurve_base() : - m_orig_subcurve1(NULL), - m_orig_subcurve2(NULL) + m_orig_subcurve1(nullptr), + m_orig_subcurve2(nullptr) {} /*! Construct from a curve. */ Default_subcurve_base(const X_monotone_curve_2& curve) : Base(curve), - m_orig_subcurve1(NULL), - m_orig_subcurve2(NULL) + m_orig_subcurve1(nullptr), + m_orig_subcurve2(nullptr) {} protected: @@ -126,7 +126,7 @@ public: template OutputIterator all_leaves(OutputIterator oi) { - if (m_orig_subcurve1 == NULL) { + if (m_orig_subcurve1 == nullptr) { *oi++ = reinterpret_cast(this); return oi; } @@ -141,7 +141,7 @@ public: bool is_inner_node(Subcurve* s) { if (this == s) return true; - if (m_orig_subcurve1 == NULL) return false; + if (m_orig_subcurve1 == nullptr) return false; return (m_orig_subcurve1->is_inner_node(s) || m_orig_subcurve2->is_inner_node(s)); } @@ -150,7 +150,7 @@ public: */ bool is_leaf(Subcurve* s) { - if (m_orig_subcurve1 == NULL) return (this == s); + if (m_orig_subcurve1 == nullptr) return (this == s); return (m_orig_subcurve1->is_leaf(s) || m_orig_subcurve2->is_leaf(s)); } @@ -249,7 +249,7 @@ public: template OutputIterator distinct_nodes(Subcurve* s, OutputIterator oi) { - if (m_orig_subcurve1 == NULL) { + if (m_orig_subcurve1 == nullptr) { Subcurve* subcurve = reinterpret_cast(this); if (s->is_leaf(subcurve)) *oi++ = subcurve; return oi; @@ -267,7 +267,7 @@ public: /*! Get the depth of the overlap hierarchy. */ unsigned int overlap_depth() { - if (m_orig_subcurve1 == NULL) return (1); + if (m_orig_subcurve1 == nullptr) return (1); unsigned int depth1 = m_orig_subcurve1->overlap_depth(); unsigned int depth2 = m_orig_subcurve2->overlap_depth(); @@ -278,7 +278,7 @@ public: /*! Get the number of input curves contributing to the subcurve */ unsigned int number_of_original_curves() const { - if (m_orig_subcurve1 == NULL) return 1; + if (m_orig_subcurve1 == nullptr) return 1; unsigned int d1 = m_orig_subcurve1->number_of_original_curves(); unsigned int d2 = m_orig_subcurve2->number_of_original_curves(); return d1+d2; diff --git a/Surface_sweep_2/include/CGAL/Surface_sweep_2/Default_visitor_base.h b/Surface_sweep_2/include/CGAL/Surface_sweep_2/Default_visitor_base.h index 6d70510e9a8..0c8123c3f82 100644 --- a/Surface_sweep_2/include/CGAL/Surface_sweep_2/Default_visitor_base.h +++ b/Surface_sweep_2/include/CGAL/Surface_sweep_2/Default_visitor_base.h @@ -88,7 +88,7 @@ protected: public: /*! Constructor. */ - Default_visitor_base () : m_surface_sweep(NULL) {} + Default_visitor_base () : m_surface_sweep(nullptr) {} /*! Destructor */ virtual ~Default_visitor_base() {} diff --git a/Surface_sweep_2/include/CGAL/Surface_sweep_2/No_intersection_surface_sweep_2_impl.h b/Surface_sweep_2/include/CGAL/Surface_sweep_2/No_intersection_surface_sweep_2_impl.h index 209e6e4be1d..f06091a4f17 100644 --- a/Surface_sweep_2/include/CGAL/Surface_sweep_2/No_intersection_surface_sweep_2_impl.h +++ b/Surface_sweep_2/include/CGAL/Surface_sweep_2/No_intersection_surface_sweep_2_impl.h @@ -777,7 +777,7 @@ template void No_intersection_surface_sweep_2::_add_curve(Event* e, Subcurve* sc, Attribute type) { - if (sc == NULL) return; + if (sc == nullptr) return; if (type == Event::LEFT_END) { sc->set_left_event(e); diff --git a/Surface_sweep_2/include/CGAL/Surface_sweep_2/Surface_sweep_2_impl.h b/Surface_sweep_2/include/CGAL/Surface_sweep_2/Surface_sweep_2_impl.h index 229be666185..d1085b6f083 100644 --- a/Surface_sweep_2/include/CGAL/Surface_sweep_2/Surface_sweep_2_impl.h +++ b/Surface_sweep_2/include/CGAL/Surface_sweep_2/Surface_sweep_2_impl.h @@ -223,7 +223,7 @@ void Surface_sweep_2::_handle_right_curves() cit_end = this->m_currentEvent->right_curves_end(); cit!=cit_end; ++cit) { - if ( (*cit)->originating_subcurve1()!=NULL && + if ( (*cit)->originating_subcurve1()!=nullptr && (Event*)(*cit)->left_event()!=this->m_currentEvent ) { // split the subcurve. @@ -424,8 +424,8 @@ template // handle overlapping curves with common ancesters Subcurve_vector all_leaves_diff; - Subcurve* first_parent=NULL; - if (c1->originating_subcurve1()!=NULL || c2->originating_subcurve2()!=NULL) + Subcurve* first_parent=nullptr; + if (c1->originating_subcurve1()!=nullptr || c2->originating_subcurve2()!=nullptr) { // get the subcurve leaves of c1 and of c2. Then extract from the smallest set // the subcurves leaves that are not in the other one. If empty, it means that @@ -515,7 +515,7 @@ template (*sc_it)->last_curve(), vector_inserter(inter_res)); CGAL_assertion(inter_res.size()==1); - CGAL_assertion( CGAL::object_cast< X_monotone_curve_2 >(&inter_res.front())!=NULL ); + CGAL_assertion( CGAL::object_cast< X_monotone_curve_2 >(&inter_res.front())!=nullptr ); xc = *CGAL::object_cast< X_monotone_curve_2 >(&inter_res.front()); } _create_overlapping_curve(xc, c1 , c2, all_leaves_diff, first_parent, event_for_overlap); @@ -557,7 +557,7 @@ template this->m_traits->is_closed_2_object()(c1->last_curve(), ARR_MIN_END) && this->m_traits->is_closed_2_object()(c2->last_curve(), ARR_MIN_END)) { - if ( object_cast >(&(*vi)) != NULL + if ( object_cast >(&(*vi)) != nullptr && this->m_traits->equal_2_object() (this->m_traits->construct_min_vertex_2_object()(c1->last_curve()), this->m_traits->construct_min_vertex_2_object()(c2->last_curve()))) @@ -576,7 +576,7 @@ template vector_inserter vi_last = vi_end; --vi_last; - if (object_cast >(&(*vi_last)) != NULL) { + if (object_cast >(&(*vi_last)) != nullptr) { CGAL_SS_PRINT_TEXT("Skipping common right endpoint..."); CGAL_SS_PRINT_EOL(); --vi_end; @@ -611,7 +611,7 @@ template vector_inserter vi_last = vi_end; --vi_last; - if (object_cast >(&(*vi_last)) != NULL) + if (object_cast >(&(*vi_last)) != nullptr) { CGAL_SS_PRINT_TEXT("Skipping common right endpoint on boundary..."); CGAL_SS_PRINT_EOL(); @@ -626,7 +626,7 @@ template // Efi: why not skipping in a loop?check only one (that is, why not in a loop)? if (vi != vi_end) { xp_point = object_cast >(&(*vi)); - if (xp_point != NULL) { + if (xp_point != nullptr) { // Skip the intersection point if it is not larger than the current // event. if (this->m_queueEventLess(xp_point->first, this->m_currentEvent) != @@ -642,7 +642,7 @@ template unsigned int multiplicity = 0; xp_point = object_cast >(&(*vi)); - if (xp_point != NULL) { + if (xp_point != nullptr) { Point_2 xp = xp_point->first; multiplicity = xp_point->second; CGAL_SS_PRINT_TEXT("Found an intersection point"); @@ -651,7 +651,7 @@ template } else { icv = object_cast(&(*vi)); - CGAL_assertion(icv != NULL); + CGAL_assertion(icv != nullptr); CGAL_SS_PRINT_TEXT("Found an overlap"); CGAL_SS_PRINT_EOL(); _create_overlapping_curve(*icv, c1 , c2, all_leaves_diff, first_parent, event_for_overlap); @@ -783,7 +783,7 @@ void Surface_sweep_2::_fix_overlap_subcurves() // we check if the subcurve store overlap and current event is its // right end point. if ((Event*)leftCurve->right_event() == this->m_currentEvent) { - if (leftCurve->originating_subcurve1() != NULL) { + if (leftCurve->originating_subcurve1() != nullptr) { Subcurve* orig_sc_1 = leftCurve->originating_subcurve1(); Subcurve* orig_sc_2 = leftCurve->originating_subcurve2(); @@ -860,7 +860,7 @@ _create_overlapping_curve(const X_monotone_curve_2& overlap_cv, left_event->remove_curve_from_right(c2); // Allocate the new Subcurve for the overlap - Subcurve* overlap_sc=NULL; + Subcurve* overlap_sc=nullptr; if (all_leaves_diff.empty()) { // first check that an equivalent curve is not already in left_event @@ -877,7 +877,7 @@ _create_overlapping_curve(const X_monotone_curve_2& overlap_cv, } } - if (overlap_sc==NULL) + if (overlap_sc==nullptr) { CGAL_SS_PRINT_TEXT("Allocate a new subcurve for the overlap (no common subcurves)"); CGAL_SS_PRINT_EOL(); @@ -957,7 +957,7 @@ _create_overlapping_curve(const X_monotone_curve_2& overlap_cv, if (right_event->is_right_curve_bigger(c1, c2, this->m_traits)) std::swap(c1, c2); - if (event_on_overlap != NULL && event_on_overlap!=left_event) + if (event_on_overlap != nullptr && event_on_overlap!=left_event) { // first check that event_on_overlap is in that overlapping curve as it // can be on another overlapping part of the generating curves @@ -986,7 +986,7 @@ void Surface_sweep_2::_fix_finished_overlap_subcurve(Subcurve* sc) CGAL_SS_PRINT_CURVE(sc); CGAL_SS_PRINT_EOL(); - CGAL_assertion(sc != NULL); + CGAL_assertion(sc != nullptr); // split 'sc' if necessary and update to event as weak intersection if ((Event*)sc->right_event() != this->m_currentEvent) { @@ -1026,7 +1026,7 @@ void Surface_sweep_2::_fix_finished_overlap_subcurve(Subcurve* sc) template void Surface_sweep_2::_add_curve(Event* e, Subcurve* sc, Attribute type) { - if (sc == NULL) return; + if (sc == nullptr) return; if (type == Event::LEFT_END) { sc->set_left_event(e); diff --git a/Surface_sweep_2/include/CGAL/Surface_sweep_2/Surface_sweep_2_utils.h b/Surface_sweep_2/include/CGAL/Surface_sweep_2/Surface_sweep_2_utils.h index a8565c7ba73..9f2196e88bc 100644 --- a/Surface_sweep_2/include/CGAL/Surface_sweep_2/Surface_sweep_2_utils.h +++ b/Surface_sweep_2/include/CGAL/Surface_sweep_2/Surface_sweep_2_utils.h @@ -79,7 +79,7 @@ void make_x_monotone(CurveInputIter begin, CurveInputIter end, for (i = 0 ; i < object_vec.size() ; ++i) { xcv = object_cast (&(object_vec[i])); - if (xcv != NULL) { + if (xcv != nullptr) { // The object is an x-monotone curve. *x_curves = *xcv; ++x_curves; @@ -87,7 +87,7 @@ void make_x_monotone(CurveInputIter begin, CurveInputIter end, else { // The object is an isolated point. pt = object_cast (&(object_vec[i])); - CGAL_assertion (pt != NULL); + CGAL_assertion (pt != nullptr); *iso_points = *pt; ++iso_points; diff --git a/TDS_2/include/CGAL/Triangulation_data_structure_2.h b/TDS_2/include/CGAL/Triangulation_data_structure_2.h index ef05a3bb57e..746f88dee5c 100644 --- a/TDS_2/include/CGAL/Triangulation_data_structure_2.h +++ b/TDS_2/include/CGAL/Triangulation_data_structure_2.h @@ -1000,7 +1000,7 @@ insert_dim_up(Vertex_handle w, bool orient) // a vertex v which is outside the affine hull of Tds // The triangulation will be starred from v and w // ( geometrically w= // the infinite vertex ) - // w=NULL for first and second insertions + // w=nullptr for first and second insertions // orient governs the orientation of the resulting triangulation Vertex_handle v = create_vertex(); @@ -2074,7 +2074,7 @@ Triangulation_data_structure_2:: file_output( std::ostream& os, Vertex_handle v, bool skip_first) const { // ouput to a file - // if non NULL, v is the vertex to be output first + // if non nullptr, v is the vertex to be output first // if skip_first is true, the point in the first vertex is not output // (it may be for instance the infinite vertex of the triangulation) @@ -2211,7 +2211,7 @@ vrml_output( std::ostream& os, Vertex_handle v, bool skip_infinite) const { // ouput to a vrml file style // Point are assumed to be 3d points with a stream oprator << - // if non NULL, v is the vertex to be output first + // if non nullptr, v is the vertex to be output first // if skip_inf is true, the point in the first vertex is not output // and the faces incident to v are not output // (it may be for instance the infinite vertex of the terrain) diff --git a/TDS_2/include/CGAL/Triangulation_ds_circulators_2.h b/TDS_2/include/CGAL/Triangulation_ds_circulators_2.h index 1dcd56d45db..05b0df957c9 100644 --- a/TDS_2/include/CGAL/Triangulation_ds_circulators_2.h +++ b/TDS_2/include/CGAL/Triangulation_ds_circulators_2.h @@ -80,8 +80,8 @@ public: bool operator!=(const Face_handle &fh) const { return pos != fh; } bool is_empty() const; - bool operator==(Nullptr_t CGAL_triangulation_assertion_code(n)) const; - bool operator!=(Nullptr_t CGAL_triangulation_assertion_code(n)) const; + bool operator==(std::nullptr_t CGAL_triangulation_assertion_code(n)) const; + bool operator!=(std::nullptr_t CGAL_triangulation_assertion_code(n)) const; Face& operator*() const @@ -161,8 +161,8 @@ public: { return pos->vertex(_ri) != vh; } bool is_empty() const; - bool operator==(Nullptr_t CGAL_triangulation_assertion_code(n)) const; - bool operator!=(Nullptr_t CGAL_triangulation_assertion_code(n)) const; + bool operator==(std::nullptr_t CGAL_triangulation_assertion_code(n)) const; + bool operator!=(std::nullptr_t CGAL_triangulation_assertion_code(n)) const; Vertex& operator*() const @@ -240,8 +240,8 @@ public: bool operator==(const Edge_circulator &vc) const; bool operator!=(const Edge_circulator &vc) const; bool is_empty() const; - bool operator==(Nullptr_t CGAL_triangulation_assertion_code(n)) const; - bool operator!=(Nullptr_t CGAL_triangulation_assertion_code(n)) const; + bool operator==(std::nullptr_t CGAL_triangulation_assertion_code(n)) const; + bool operator!=(std::nullptr_t CGAL_triangulation_assertion_code(n)) const; Edge* operator->() const { edge.first=pos; @@ -347,19 +347,19 @@ return (_v == Vertex_handle() || pos == Face_handle() ); template < class Tds > inline bool Triangulation_ds_face_circulator_2 :: -operator==(Nullptr_t CGAL_triangulation_assertion_code(n)) const +operator==(std::nullptr_t CGAL_triangulation_assertion_code(n)) const { - CGAL_triangulation_assertion( n == NULL); + CGAL_triangulation_assertion( n == nullptr); return (_v == Vertex_handle() || pos == Face_handle() ); } template < class Tds > inline bool Triangulation_ds_face_circulator_2 :: -operator!=(Nullptr_t CGAL_triangulation_assertion_code(n)) const +operator!=(std::nullptr_t CGAL_triangulation_assertion_code(n)) const { - CGAL_triangulation_assertion( n == NULL); - return ! (*this == NULL); + CGAL_triangulation_assertion( n == nullptr); + return ! (*this == nullptr); } template < class Tds > @@ -471,19 +471,19 @@ is_empty() const template < class Tds > inline bool Triangulation_ds_vertex_circulator_2 :: -operator==(Nullptr_t CGAL_triangulation_assertion_code(n)) const +operator==(std::nullptr_t CGAL_triangulation_assertion_code(n)) const { - CGAL_triangulation_assertion( n == NULL); + CGAL_triangulation_assertion( n == nullptr); return (_v == Vertex_handle() || pos == Face_handle()); } template < class Tds > inline bool Triangulation_ds_vertex_circulator_2 :: -operator!=(Nullptr_t CGAL_triangulation_assertion_code(n)) const +operator!=(std::nullptr_t CGAL_triangulation_assertion_code(n)) const { - CGAL_triangulation_assertion( n == NULL); - return !(*this == NULL); + CGAL_triangulation_assertion( n == nullptr); + return !(*this == nullptr); } @@ -593,19 +593,19 @@ is_empty() const template < class Tds > inline bool Triangulation_ds_edge_circulator_2 :: -operator==(Nullptr_t CGAL_triangulation_assertion_code(n)) const +operator==(std::nullptr_t CGAL_triangulation_assertion_code(n)) const { - CGAL_triangulation_assertion( n == NULL); + CGAL_triangulation_assertion( n == nullptr); return (_v == Vertex_handle() || pos == Face_handle()); } template < class Tds > inline bool Triangulation_ds_edge_circulator_2 :: -operator!=(Nullptr_t CGAL_triangulation_assertion_code(n)) const +operator!=(std::nullptr_t CGAL_triangulation_assertion_code(n)) const { - CGAL_triangulation_assertion( n == NULL); - return !(*this == NULL); + CGAL_triangulation_assertion( n == nullptr); + return !(*this == nullptr); } diff --git a/TDS_2/include/CGAL/Triangulation_ds_vertex_2.h b/TDS_2/include/CGAL/Triangulation_ds_vertex_2.h index ea6c3c0d883..496bd345ba8 100644 --- a/TDS_2/include/CGAL/Triangulation_ds_vertex_2.h +++ b/TDS_2/include/CGAL/Triangulation_ds_vertex_2.h @@ -115,7 +115,7 @@ is_valid(bool verbose, int level) { bool result = Vb::is_valid(verbose, level); CGAL_triangulation_assertion(result); - if (this->face() != Face_handle()) { // face==NULL if dim <0 + if (this->face() != Face_handle()) { // face==nullptr if dim <0 result = result && ( &*this->face()->vertex(0) == this || &*this->face()->vertex(1) == this || &*this->face()->vertex(2) == this ); diff --git a/TDS_2/include/CGAL/internal/TDS_2/edge_list.h b/TDS_2/include/CGAL/internal/TDS_2/edge_list.h index 4134da35181..26416430bbb 100644 --- a/TDS_2/include/CGAL/internal/TDS_2/edge_list.h +++ b/TDS_2/include/CGAL/internal/TDS_2/edge_list.h @@ -132,7 +132,7 @@ namespace internal { public: Edge_list_circulator() - : l_(NULL), c_(List_item::sentinel_edge()) {} + : l_(nullptr), c_(List_item::sentinel_edge()) {} Edge_list_circulator(const List* l, const Edge& c) : l_(l), c_(/*const_cast(*/c/*)*/) {} @@ -147,14 +147,14 @@ namespace internal { } Self& operator++() { - CGAL_precondition( l_ != NULL ); + CGAL_precondition( l_ != nullptr ); // c_ = const_cast(l_->next(c_)); c_ = l_->next(c_); return *this; } Self& operator--() { - CGAL_precondition( l_ != NULL ); + CGAL_precondition( l_ != nullptr ); // c_ = const_cast(l_->previous(c_)); c_ = l_->previous(c_); return *this; diff --git a/TDS_3/include/CGAL/Triangulation_data_structure_3.h b/TDS_3/include/CGAL/Triangulation_data_structure_3.h index 7e46fbf377e..260eb3b8a5f 100644 --- a/TDS_3/include/CGAL/Triangulation_data_structure_3.h +++ b/TDS_3/include/CGAL/Triangulation_data_structure_3.h @@ -461,7 +461,7 @@ public: Vertex_handle newv) { CGAL_triangulation_precondition(begin != Cell_handle()); - // if begin == NULL (default arg), we could compute one by walking in + // if begin == nullptr (default arg), we could compute one by walking in // CellIt. At the moment, the functionality is not available, you have // to specify a starting facet. @@ -2781,7 +2781,7 @@ insert_increase_dimension(Vertex_handle star) // star = vertex from which we triangulate the facet of the // incremented dimension // ( geometrically : star = infinite vertex ) - // = NULL only used to insert the 1st vertex (dimension -2 to dimension -1) + // = nullptr only used to insert the 1st vertex (dimension -2 to dimension -1) // changes the dimension { CGAL_triangulation_precondition( dimension() < 3); @@ -3496,14 +3496,14 @@ is_valid(Cell_handle c, bool verbose, int level) const { if ( c->vertex(0) == Vertex_handle() ) { if (verbose) - std::cerr << "vertex 0 NULL" << std::endl; + std::cerr << "vertex 0 nullptr" << std::endl; CGAL_triangulation_assertion(false); return false; } is_valid(c->vertex(0),verbose,level); if ( c->vertex(1) != Vertex_handle() || c->vertex(2) != Vertex_handle()) { if (verbose) - std::cerr << "vertex 1 or 2 != NULL" << std::endl; + std::cerr << "vertex 1 or 2 != nullptr" << std::endl; CGAL_triangulation_assertion(false); return false; } @@ -3511,7 +3511,7 @@ is_valid(Cell_handle c, bool verbose, int level) const c->neighbor(1) != Cell_handle() || c->neighbor(2) != Cell_handle()) { if (verbose) - std::cerr << "one neighbor != NULL" << std::endl; + std::cerr << "one neighbor != nullptr" << std::endl; CGAL_triangulation_assertion(false); return false; } @@ -3522,28 +3522,28 @@ is_valid(Cell_handle c, bool verbose, int level) const { if ( c->vertex(0) == Vertex_handle() ) { if (verbose) - std::cerr << "vertex 0 NULL" << std::endl; + std::cerr << "vertex 0 nullptr" << std::endl; CGAL_triangulation_assertion(false); return false; } is_valid(c->vertex(0),verbose,level); if ( c->neighbor (0) == Cell_handle() ) { if (verbose) - std::cerr << "neighbor 0 NULL" << std::endl; + std::cerr << "neighbor 0 nullptr" << std::endl; CGAL_triangulation_assertion(false); return false; } if ( c->vertex(1) != Vertex_handle() || c->vertex(2) != Vertex_handle() ) { if (verbose) - std::cerr << "vertex 1 or 2 != NULL" << std::endl; + std::cerr << "vertex 1 or 2 != nullptr" << std::endl; CGAL_triangulation_assertion(false); return false; } if ( c->neighbor(1) != Cell_handle() || c->neighbor(2) != Cell_handle() ) { if (verbose) - std::cerr << "neighbor 1 or 2 != NULL" << std::endl; + std::cerr << "neighbor 1 or 2 != nullptr" << std::endl; CGAL_triangulation_assertion(false); return false; } @@ -3566,7 +3566,7 @@ is_valid(Cell_handle c, bool verbose, int level) const if ( v0 == Vertex_handle() || v1 == Vertex_handle() ) { if (verbose) - std::cerr << "vertex 0 or 1 NULL" << std::endl; + std::cerr << "vertex 0 or 1 nullptr" << std::endl; CGAL_triangulation_assertion(false); return false; } @@ -3574,7 +3574,7 @@ is_valid(Cell_handle c, bool verbose, int level) const is_valid(c->vertex(1),verbose,level); if ( n0 == Cell_handle() || n1 == Cell_handle() ) { if (verbose) - std::cerr << "neighbor 0 or 1 NULL" << std::endl; + std::cerr << "neighbor 0 or 1 nullptr" << std::endl; CGAL_triangulation_assertion(false); return false; } @@ -3618,7 +3618,7 @@ is_valid(Cell_handle c, bool verbose, int level) const c->vertex(1) == Vertex_handle() || c->vertex(2) == Vertex_handle() ) { if (verbose) - std::cerr << "vertex 0, 1, or 2 NULL" << std::endl; + std::cerr << "vertex 0, 1, or 2 nullptr" << std::endl; CGAL_triangulation_assertion(false); return false; } @@ -3631,7 +3631,7 @@ is_valid(Cell_handle c, bool verbose, int level) const n = c->neighbor(i); if ( n == Cell_handle() ) { if (verbose) - std::cerr << "neighbor " << i << " NULL" << std::endl; + std::cerr << "neighbor " << i << " nullptr" << std::endl; CGAL_triangulation_assertion(false); return false; } @@ -3669,7 +3669,7 @@ is_valid(Cell_handle c, bool verbose, int level) const for(i = 0; i < 4; i++) { if ( c->vertex(i) == Vertex_handle() ) { if (verbose) - std::cerr << "vertex " << i << " NULL" << std::endl; + std::cerr << "vertex " << i << " nullptr" << std::endl; CGAL_triangulation_assertion(false); return false; } @@ -3680,7 +3680,7 @@ is_valid(Cell_handle c, bool verbose, int level) const Cell_handle n = c->neighbor(i); if ( n == Cell_handle() ) { if (verbose) - std::cerr << "neighbor " << i << " NULL" << std::endl; + std::cerr << "neighbor " << i << " nullptr" << std::endl; CGAL_triangulation_assertion(false); return false; } diff --git a/TDS_3/include/CGAL/internal/Triangulation_ds_circulators_3.h b/TDS_3/include/CGAL/internal/Triangulation_ds_circulators_3.h index 25597d98531..f4579f5d408 100644 --- a/TDS_3/include/CGAL/internal/Triangulation_ds_circulators_3.h +++ b/TDS_3/include/CGAL/internal/Triangulation_ds_circulators_3.h @@ -149,13 +149,13 @@ public: return ch != pos; } - bool operator==(Nullptr_t CGAL_triangulation_assertion_code(n)) const + bool operator==(std::nullptr_t CGAL_triangulation_assertion_code(n)) const { - CGAL_triangulation_assertion( n == NULL); + CGAL_triangulation_assertion( n == nullptr); return pos == Cell_handle(); } - bool operator!=(Nullptr_t n) const + bool operator!=(std::nullptr_t n) const { return ! (*this == n); } @@ -368,13 +368,13 @@ public: return ! (*this == ccir); } - bool operator==(Nullptr_t CGAL_triangulation_assertion_code(c)) const + bool operator==(std::nullptr_t CGAL_triangulation_assertion_code(c)) const { - CGAL_triangulation_assertion(c == NULL); + CGAL_triangulation_assertion(c == nullptr); return pos == Cell_handle(); } - bool operator!=(Nullptr_t c) const + bool operator!=(std::nullptr_t c) const { return ! (*this == c); } @@ -468,13 +468,13 @@ public: return ! (*this == ccir); } - bool operator==(Nullptr_t CGAL_triangulation_assertion_code(c)) const + bool operator==(std::nullptr_t CGAL_triangulation_assertion_code(c)) const { - CGAL_triangulation_assertion(c == NULL); + CGAL_triangulation_assertion(c == nullptr); return pos == Cell_handle(); } - bool operator!=(Nullptr_t c) const + bool operator!=(std::nullptr_t c) const { return ! (*this == c); } diff --git a/TDS_3/include/CGAL/internal/Triangulation_ds_iterators_3.h b/TDS_3/include/CGAL/internal/Triangulation_ds_iterators_3.h index b33b383f1b4..28354e47977 100644 --- a/TDS_3/include/CGAL/internal/Triangulation_ds_iterators_3.h +++ b/TDS_3/include/CGAL/internal/Triangulation_ds_iterators_3.h @@ -203,7 +203,7 @@ public: typedef internal::Triangulation_ds_cell_circulator_3 Cell_circulator; Triangulation_ds_edge_iterator_3() - : _tds(NULL) + : _tds(nullptr) { edge.second = 0; edge.third = 1; diff --git a/Testsuite/test/post_process_ctest_results.py b/Testsuite/test/post_process_ctest_results.py index ff81668fb35..77998c21ef8 100644 --- a/Testsuite/test/post_process_ctest_results.py +++ b/Testsuite/test/post_process_ctest_results.py @@ -49,8 +49,6 @@ with open(report_file, "rt") as test_report: name="libCGALimageIO_shared" elif name == "libCGAL_Qt5": name="libCGALQt5_shared" - elif name == "Mesh_3_implicit_functions": - name="Polyhedron_Demo" if name=="incomplete": is_writing=False is_ignored=False diff --git a/Three/doc/Three/Three.txt b/Three/doc/Three/Three.txt index 8c615392b71..a5bfa676015 100644 --- a/Three/doc/Three/Three.txt +++ b/Three/doc/Three/Three.txt @@ -284,7 +284,7 @@ CGAL::Three::Scene_item* load(QFileInfo fileinfo) { Scene_trivial_item* item = new Scene_trivial_item(); if(!item->load(fileinfo.filePath().toStdString())) { delete item; - return NULL; + return nullptr; } return item; } @@ -299,7 +299,7 @@ bool canSave(const CGAL::Three::Scene_item* scene_item) { ~~~~~~~~~~~~~{.cpp} bool save(const CGAL::Three::Scene_item* scene_item, QFileInfo fileinfo) { const Scene_trivial_item* item = qobject_cast(scene_item); - if(item == NULL) { return false; } + if(item == nullptr) { return false; } return item->save(fileinfo.filePath().toStdString()); } @@ -335,6 +335,7 @@ You will probably have to fetch the libraries exported by the Polyhedron_demo, l ) include( ${CGAL_POLYHEDRON_DEMO_USE_FILE} ) +Be careful, the polyhedron_demo build directory must contain a build of the demo that comes from the same CGAL version than the one of your CGAL_DIR. Finally, you can declare your plugin polyhedron_demo_plugin(example_plugin Example_plugin) diff --git a/Three/include/CGAL/Three/Polyhedron_demo_plugin_helper.h b/Three/include/CGAL/Three/Polyhedron_demo_plugin_helper.h index 7fc30b0e8a6..65fe84cd40c 100644 --- a/Three/include/CGAL/Three/Polyhedron_demo_plugin_helper.h +++ b/Three/include/CGAL/Three/Polyhedron_demo_plugin_helper.h @@ -53,14 +53,14 @@ public: /*! \brief Gets an item of the templated type. * \returns The currently selected `SceneType` item * \returns the first `SceneType` item found in the scene's list of items if the selected item is not a `SceneType` - * \returns NULL if there is no `SceneType` in the list. + * \returns nullptr if there is no `SceneType` in the list. */ template SceneType* getSelectedItem() const{ int item_id = scene->mainSelectionIndex(); SceneType* scene_item = qobject_cast(scene->item(item_id)); if(!scene_item) { - // no selected SceneType - if there is only one in list return it, otherwise NULL + // no selected SceneType - if there is only one in list return it, otherwise nullptr int counter = 0; int last_selected = 0; for(CGAL::Three::Scene_interface::Item_id i = 0, end = scene->numberOfEntries(); i < end && counter < 2; ++i) { @@ -70,7 +70,7 @@ public: last_selected=i; } } - if(counter != 1) { return NULL; } + if(counter != 1) { return nullptr; } scene->setSelectedItem(last_selected); } return scene_item; diff --git a/Three/include/CGAL/Three/Three.h b/Three/include/CGAL/Three/Three.h index 2b1e8a01742..71cd9847f1e 100644 --- a/Three/include/CGAL/Three/Three.h +++ b/Three/include/CGAL/Three/Three.h @@ -70,7 +70,7 @@ public: /*! \brief Gets an item of the templated type. * \returns the first `SceneType` item found in the scene's list of currently selected * items; - * \returns NULL if there is no `SceneType` in the list. + * \returns nullptr if there is no `SceneType` in the list. */ template static SceneType* getSelectedItem(); diff --git a/Three/include/CGAL/Three/Viewer_interface.h b/Three/include/CGAL/Three/Viewer_interface.h index 52c7da0847a..4f00e5782e7 100644 --- a/Three/include/CGAL/Three/Viewer_interface.h +++ b/Three/include/CGAL/Three/Viewer_interface.h @@ -274,7 +274,7 @@ public: //! Gives acces to recent openGL(4.3) features, allowing use of things like //! Geometry Shaders or Depth Textures. //! @returns a pointer to an initialized QOpenGLFunctions_4_3_Core if `isOpenGL_4_3()` is `true` - //! @returns NULL if `isOpenGL_4_3()` is `false` + //! @returns nullptr if `isOpenGL_4_3()` is `false` virtual QOpenGLFunctions_4_3_Core* openGL_4_3_functions() = 0; //! getter for point size under old openGL context; virtual const GLfloat& getGlPointSize()const = 0; diff --git a/Triangulation/include/CGAL/Delaunay_triangulation.h b/Triangulation/include/CGAL/Delaunay_triangulation.h index dfcd51604cb..d5a932d014b 100644 --- a/Triangulation/include/CGAL/Delaunay_triangulation.h +++ b/Triangulation/include/CGAL/Delaunay_triangulation.h @@ -425,7 +425,7 @@ Delaunay_triangulation maximal_dimension(), flat_orientation_ ? std::pair(current_dimension(), flat_orientation_.get_ptr()) - : std::pair((std::numeric_limits::max)(), (Flat_orientation_d*) NULL) ); + : std::pair((std::numeric_limits::max)(), (Flat_orientation_d*) nullptr) ); Dark_s_handle dark_s; Dark_v_handle dark_v; diff --git a/Triangulation/include/CGAL/Regular_triangulation.h b/Triangulation/include/CGAL/Regular_triangulation.h index 82331e3a133..d8af4fe9d20 100644 --- a/Triangulation/include/CGAL/Regular_triangulation.h +++ b/Triangulation/include/CGAL/Regular_triangulation.h @@ -555,7 +555,7 @@ Regular_triangulation maximal_dimension(), flat_orientation_ ? std::pair(current_dimension(), flat_orientation_.get_ptr()) - : std::pair((std::numeric_limits::max)(), NULL) ); + : std::pair((std::numeric_limits::max)(), nullptr) ); Dark_s_handle dark_s; Dark_v_handle dark_v; diff --git a/Triangulation/include/CGAL/Triangulation.h b/Triangulation/include/CGAL/Triangulation.h index ccb4249bc8d..2c6b6263f1f 100644 --- a/Triangulation/include/CGAL/Triangulation.h +++ b/Triangulation/include/CGAL/Triangulation.h @@ -121,7 +121,7 @@ protected: { if (current_dimension() == preset_flat_orientation_.first) { - CGAL_assertion(preset_flat_orientation_.second != NULL); + CGAL_assertion(preset_flat_orientation_.second != nullptr); flat_orientation_ = *preset_flat_orientation_.second; } else @@ -274,7 +274,7 @@ public: , kernel_(k) , infinity_() , preset_flat_orientation_((std::numeric_limits::max)(), - (Flat_orientation_d*) NULL) + (Flat_orientation_d*) nullptr) , rng_((long)0) #ifdef CGAL_TRIANGULATION_STATISTICS ,walk_size_(0) @@ -309,7 +309,7 @@ public: , kernel_(t2.kernel_) , infinity_() , preset_flat_orientation_((std::numeric_limits::max)(), - (Flat_orientation_d*) NULL) + (Flat_orientation_d*) nullptr) , rng_(t2.rng_) #ifdef CGAL_TRIANGULATION_STATISTICS ,walk_size_(t2.walk_size_) diff --git a/Triangulation/include/CGAL/Triangulation_data_structure.h b/Triangulation/include/CGAL/Triangulation_data_structure.h index 3dc06340604..ced5c2a32eb 100644 --- a/Triangulation/include/CGAL/Triangulation_data_structure.h +++ b/Triangulation/include/CGAL/Triangulation_data_structure.h @@ -1285,7 +1285,7 @@ bool Triangulation_data_structure } else { - if( verbose ) CGAL_warning_msg(false, "full_cell has a NULL neighbor"); + if( verbose ) CGAL_warning_msg(false, "full_cell has a nullptr neighbor"); return false; } } diff --git a/Triangulation/include/CGAL/internal/Static_or_dynamic_array.h b/Triangulation/include/CGAL/internal/Static_or_dynamic_array.h index 2230afa37ae..ff9480bfbbb 100644 --- a/Triangulation/include/CGAL/internal/Static_or_dynamic_array.h +++ b/Triangulation/include/CGAL/internal/Static_or_dynamic_array.h @@ -103,10 +103,10 @@ struct S_or_D_array< Containee, Dynamic_dimension_tag, true > { typedef std::vector Base; S_or_D_array(const int d) - : Base(d), fcc_(NULL) + : Base(d), fcc_(nullptr) {} S_or_D_array(const int d, const Containee & c) - : Base(d, c), fcc_(NULL) + : Base(d, c), fcc_(nullptr) {} void* fcc_; void* for_compact_container() const { return fcc_; } diff --git a/Triangulation_2/doc/Triangulation_2/CGAL/Triangulation_2.h b/Triangulation_2/doc/Triangulation_2/CGAL/Triangulation_2.h index 4892b65eea3..b03d077e11a 100644 --- a/Triangulation_2/doc/Triangulation_2/CGAL/Triangulation_2.h +++ b/Triangulation_2/doc/Triangulation_2/CGAL/Triangulation_2.h @@ -548,11 +548,11 @@ such that (the rest of the triangulation lying to the right of this line). - for a degenerate one dimensional triangulation it is the (degenerate -one dimensional) face \f$ (\infty, p, NULL)\f$ such that `query` +one dimensional) face \f$ (\infty, p, nullptr)\f$ such that `query` and the triangulation lie on either side of `p`. If the point `query` lies outside the affine hull, -the returned `Face_handle` is `NULL`. +the returned `Face_handle` is `nullptr`. The optional `Face_handle` argument, if provided, is used as a hint of where the locate process has to start its search. @@ -971,7 +971,7 @@ traversed finite face then through the first finite traversed face again. \pre The triangulation must have dimension 2. \pre Points `p` and `q` must be different points. -\pre If `f != NULL`, it must point to a finite face and the point `p` must be inside or on the boundary of `f`. +\pre If `f != nullptr`, it must point to a finite face and the point `p` must be inside or on the boundary of `f`. */ Line_face_circulator line_walk(const Point& p, const Point& q, Face_handle f = Face_handle()) const; diff --git a/Triangulation_2/include/CGAL/Constrained_Delaunay_triangulation_2.h b/Triangulation_2/include/CGAL/Constrained_Delaunay_triangulation_2.h index dbf425e8d2c..c0e56b5cd3d 100644 --- a/Triangulation_2/include/CGAL/Constrained_Delaunay_triangulation_2.h +++ b/Triangulation_2/include/CGAL/Constrained_Delaunay_triangulation_2.h @@ -276,7 +276,7 @@ public: typename internal::Get_iterator_value_type< InputIterator >::type, Point > - >::type* = NULL + >::type* = nullptr ) #else #if defined(_MSC_VER) @@ -358,7 +358,7 @@ public: typename internal::Get_iterator_value_type< InputIterator >::type, std::pair::type> > - >::type* =NULL + >::type* =nullptr ) { return insert_with_info< std::pair::type> >(first,last); @@ -373,7 +373,7 @@ public: boost::is_convertible< typename std::iterator_traits::value_type, Point >, boost::is_convertible< typename std::iterator_traits::value_type, typename internal::Info_check::type > > - >::type* =NULL + >::type* =nullptr ) { return insert_with_info< boost::tuple::type> >(first,last); diff --git a/Triangulation_2/include/CGAL/Constrained_triangulation_plus_2.h b/Triangulation_2/include/CGAL/Constrained_triangulation_plus_2.h index 7f19c173511..72740d52736 100644 --- a/Triangulation_2/include/CGAL/Constrained_triangulation_plus_2.h +++ b/Triangulation_2/include/CGAL/Constrained_triangulation_plus_2.h @@ -277,11 +277,11 @@ public: { // protects against inserting a zero length constraint if(va == vb){ - return Constraint_id(NULL); + return Constraint_id(nullptr); } // protects against inserting twice the same constraint Constraint_id cid = hierarchy.insert_constraint_old_API(va, vb); - if (va != vb && (cid != Constraint_id(NULL)) ) insert_subconstraint(va,vb); + if (va != vb && (cid != Constraint_id(nullptr)) ) insert_subconstraint(va,vb); return cid; } @@ -541,7 +541,7 @@ public: } int n = vertices.size(); if(n == 1){ - return NULL; + return nullptr; } Constraint_id ca = hierarchy.insert_constraint(vertices[0],vertices[1]); insert_subconstraint(vertices[0],vertices[1], std::back_inserter(fc)); @@ -586,7 +586,7 @@ private: std::size_t n = vertices.size(); if(n == 1){ - return NULL; + return nullptr; } CGAL_assertion(n >= 2); @@ -668,11 +668,11 @@ public: { // protects against inserting a zero length constraint if(va == vb){ - return Constraint_id(NULL); + return Constraint_id(nullptr); } // protects against inserting twice the same constraint Constraint_id cid = hierarchy.insert_constraint(va, vb); - if (va != vb && (cid != NULL) ) insert_subconstraint(va,vb,out); + if (va != vb && (cid != nullptr) ) insert_subconstraint(va,vb,out); for(Vertices_in_constraint_iterator vcit = vertices_in_constraint_begin(cid); vcit != vertices_in_constraint_end(cid); diff --git a/Triangulation_2/include/CGAL/Delaunay_triangulation_2.h b/Triangulation_2/include/CGAL/Delaunay_triangulation_2.h index 2bbc6255474..0fa7451e149 100644 --- a/Triangulation_2/include/CGAL/Delaunay_triangulation_2.h +++ b/Triangulation_2/include/CGAL/Delaunay_triangulation_2.h @@ -309,7 +309,7 @@ public: typename std::iterator_traits::value_type, Point > - >::type* = NULL) + >::type* = nullptr) #else template < class InputIterator > std::ptrdiff_t @@ -381,7 +381,7 @@ public: boost::is_convertible< typename std::iterator_traits::value_type, std::pair::type> - > >::type* = NULL) + > >::type* = nullptr) { return insert_with_info< std::pair::type> >(first,last); } @@ -395,7 +395,7 @@ public: boost::is_convertible< typename std::iterator_traits::value_type, Point >, boost::is_convertible< typename std::iterator_traits::value_type, typename internal::Info_check::type > > - >::type* = NULL) + >::type* = nullptr) { return insert_with_info< boost::tuple::type> >(first,last); } diff --git a/Triangulation_2/include/CGAL/Regular_triangulation_2.h b/Triangulation_2/include/CGAL/Regular_triangulation_2.h index 0f2a30c720e..49dcde0219e 100644 --- a/Triangulation_2/include/CGAL/Regular_triangulation_2.h +++ b/Triangulation_2/include/CGAL/Regular_triangulation_2.h @@ -398,7 +398,7 @@ public: typename std::iterator_traits::value_type, Weighted_point > - >::type* = NULL + >::type* = nullptr ) #else template < class InputIterator > @@ -519,7 +519,7 @@ public: typename std::iterator_traits::value_type, std::pair::type> > - >::type* = NULL + >::type* = nullptr ) {return insert_with_info< std::pair::type> >(first,last);} @@ -532,7 +532,7 @@ public: typename boost::is_convertible< typename std::iterator_traits::value_type, Weighted_point >, typename boost::is_convertible< typename std::iterator_traits::value_type, typename internal::Info_check::type > > - >::type* =NULL + >::type* =nullptr ) {return insert_with_info< boost::tuple::type> >(first,last);} #endif //CGAL_TRIANGULATION_2_DONT_INSERT_RANGE_OF_POINTS_WITH_INFO @@ -1276,7 +1276,7 @@ insert(const Weighted_point &p, Locate_type lt, Face_handle loc, int li) { CGAL_precondition(dimension() >= 0); if(dimension() == 0) { - // in this case locate() oddly returns loc = NULL and li = 4, + // in this case locate() oddly returns loc = nullptr and li = 4, // so we work around it. loc = finite_vertex()->face(); li = 0; @@ -1703,7 +1703,7 @@ fill_hole_regular(std::list & first_hole) typename Hole::iterator cut_after(hit); // if tested vertex is c with respect to the vertex opposite - // to NULL neighbor, + // to nullptr neighbor, // stop at the before last face; hdone--; while(hit != hdone) diff --git a/Triangulation_2/include/CGAL/Triangulation_2.h b/Triangulation_2/include/CGAL/Triangulation_2.h index 99b8c66486f..fc751ab2e52 100644 --- a/Triangulation_2/include/CGAL/Triangulation_2.h +++ b/Triangulation_2/include/CGAL/Triangulation_2.h @@ -1962,7 +1962,7 @@ fill_hole_delaunay(std::list & first_hole) typename Hole::iterator cut_after(hit); // if tested vertex is c with respect to the vertex opposite - // to NULL neighbor, + // to nullptr neighbor, // stop at the before last face; hdone--; while( hit != hdone) { diff --git a/Triangulation_2/include/CGAL/Triangulation_2/internal/Constraint_hierarchy_2.h b/Triangulation_2/include/CGAL/Triangulation_2/internal/Constraint_hierarchy_2.h index 8ad5384d474..b6336ac1736 100644 --- a/Triangulation_2/include/CGAL/Triangulation_2/internal/Constraint_hierarchy_2.h +++ b/Triangulation_2/include/CGAL/Triangulation_2/internal/Constraint_hierarchy_2.h @@ -364,7 +364,7 @@ Constraint_hierarchy_2:: number_of_enclosing_constraints(T va, T vb) { H_context_list* hcl = get_contexts(va, vb); - CGAL_triangulation_assertion(hcl != NULL); + CGAL_triangulation_assertion(hcl != nullptr); return hcl->size(); } @@ -433,7 +433,7 @@ insert_constraint(T va, T vb){ // pointer to its fathers list. If the sub-constraint he is new, // std::make_pair(he, 0) is inserted in the map (that is what does // map::operator[]), 'fathers' will be a default-constructed pointer - // (that is the NULL pointer), and it will re-assigned to a newly + // (that is the nullptr pointer), and it will re-assigned to a newly // created context list. As 'father' is a reference (to a pointer), // there is no need to modify the map after that. H_context_list*& fathers = sc_to_c_map[he]; @@ -573,9 +573,9 @@ remove_Steiner(T v, T va, T vb) CGAL_precondition(!is_constrained_vertex(v)); H_context_list* hcl1 = get_contexts(va, v); - CGAL_triangulation_assertion(hcl1 != NULL); + CGAL_triangulation_assertion(hcl1 != nullptr); H_context_list* hcl2 = get_contexts(v, vb); - CGAL_triangulation_assertion(hcl2 != NULL); + CGAL_triangulation_assertion(hcl2 != nullptr); H_vertex_it pos; for(H_context_iterator ctit=hcl1->begin(); ctit != hcl1->end(); ctit++){ @@ -609,7 +609,7 @@ void Constraint_hierarchy_2:: add_Steiner(T va, T vb, T vc){ H_context_list* hcl = get_contexts(va, vb); - CGAL_triangulation_assertion(hcl != NULL); + CGAL_triangulation_assertion(hcl != nullptr); H_context_list* hcl2 = new H_context_list; @@ -672,7 +672,7 @@ get_contexts(T va, T vb) const { H_sc_iterator sc_iter = sc_to_c_map.find(make_edge(va,vb)); if ( sc_iter == sc_to_c_map.end() ) - return NULL; + return nullptr; return (*sc_iter).second; } diff --git a/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h b/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h index e40da6fa737..d2c65cff37f 100644 --- a/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h +++ b/Triangulation_2/include/CGAL/Triangulation_2/internal/Polyline_constraint_hierarchy_2.h @@ -109,7 +109,7 @@ public: struct Constraint_id { Vertex_list* second; - Constraint_id(): second(NULL) {} + Constraint_id(): second(nullptr) {} Constraint_id(Vertex_list* vl) : second(vl) @@ -119,7 +119,7 @@ public: operator std::pair,Vertex_list*>() { - if (second!=NULL){ + if (second!=nullptr){ return std::make_pair(std::make_pair(second->front().vertex(), second->back().vertex()),second); } @@ -164,7 +164,7 @@ public: Vertex_list* enclosing; Vertex_it pos; public: - Context() : enclosing(NULL) {} + Context() : enclosing(nullptr) {} Context(const Context& hc) : enclosing(hc.enclosing), pos(hc.pos) @@ -470,7 +470,7 @@ std::size_t Polyline_constraint_hierarchy_2:: number_of_enclosing_constraints(T va, T vb) const { - Context_list* hcl = NULL; + Context_list* hcl = nullptr; CGAL_triangulation_assertion_code( bool found = ) get_contexts(va,vb,hcl); CGAL_triangulation_assertion(found); return hcl->size(); @@ -1021,7 +1021,7 @@ template void Polyline_constraint_hierarchy_2:: add_Steiner(T va, T vb, T vc){ - Context_list* hcl=NULL; + Context_list* hcl=nullptr; if(!get_contexts(va,vb,hcl)) CGAL_triangulation_assertion(false); Context_list* hcl2 = new Context_list; diff --git a/Triangulation_2/include/CGAL/Triangulation_2/internal/Triangulation_line_face_circulator_2.h b/Triangulation_2/include/CGAL/Triangulation_2/internal/Triangulation_line_face_circulator_2.h index 2572e4fdbc2..7cf0dee65d7 100644 --- a/Triangulation_2/include/CGAL/Triangulation_2/internal/Triangulation_line_face_circulator_2.h +++ b/Triangulation_2/include/CGAL/Triangulation_2/internal/Triangulation_line_face_circulator_2.h @@ -71,7 +71,7 @@ private: public: Triangulation_line_face_circulator_2() - : pos(), _tr(NULL), s(undefined), i(-1) + : pos(), _tr(nullptr), s(undefined), i(-1) {} Triangulation_line_face_circulator_2(Vertex_handle v, @@ -101,8 +101,8 @@ public: bool operator==(const Face_handle& fh) const { return fh == pos; } bool operator!=(const Face_handle& fh) const { return fh != pos; } - bool operator==(Nullptr_t CGAL_triangulation_assertion_code(n)) const; - bool operator!=(Nullptr_t n) const; + bool operator==(std::nullptr_t CGAL_triangulation_assertion_code(n)) const; + bool operator!=(std::nullptr_t n) const; bool is_empty() const; bool collinear_outside() const; bool locate(const Point& t, Locate_type <, int &li); @@ -179,7 +179,7 @@ Triangulation_line_face_circulator_2(Vertex_handle v, ++fc; ic = fc->index(v); vt= fc->vertex(cw(ic)); - if (fc == done) { _tr=NULL; return;} + if (fc == done) { _tr=nullptr; return;} } // now vt is finite and to the left of pq @@ -214,7 +214,7 @@ Triangulation_line_face_circulator_2(Vertex_handle v, i = ic; break; case LEFT_TURN: - _tr = NULL; + _tr = nullptr; break; } } @@ -643,7 +643,7 @@ operator==(const Line_face_circulator& lfc) const { CGAL_triangulation_precondition( pos != Face_handle() && lfc.pos != Face_handle()); - return ( _tr == lfc._tr && ( _tr==NULL || + return ( _tr == lfc._tr && ( _tr==nullptr || (pos == lfc.pos && s== lfc.s && p==lfc.p && q==lfc.q) ) ); } @@ -666,18 +666,18 @@ is_empty() const template < class Triangulation > inline bool Triangulation_line_face_circulator_2:: -operator==(Nullptr_t CGAL_triangulation_assertion_code(n)) const +operator==(std::nullptr_t CGAL_triangulation_assertion_code(n)) const { - CGAL_triangulation_assertion( n == NULL); + CGAL_triangulation_assertion( n == nullptr); return pos == Face_handle(); } template < class Triangulation > inline bool Triangulation_line_face_circulator_2:: -operator!=(Nullptr_t n) const +operator!=(std::nullptr_t n) const { - CGAL_triangulation_assertion( n == NULL); + CGAL_triangulation_assertion( n == nullptr); return !(*this == n); } diff --git a/Triangulation_2/include/CGAL/Triangulation_2_to_lcc.h b/Triangulation_2/include/CGAL/Triangulation_2_to_lcc.h index 43283e84403..a89f9e5369a 100644 --- a/Triangulation_2/include/CGAL/Triangulation_2_to_lcc.h +++ b/Triangulation_2/include/CGAL/Triangulation_2_to_lcc.h @@ -31,14 +31,14 @@ namespace CGAL { * @param alcc the used linear cell complex. * @param atr the Triangulation_2. * @param aface_to_dart a pointer to a std::map associating to each - * triangle of atr a corresponding dart in alcc. Not used if NULL. + * triangle of atr a corresponding dart in alcc. Not used if nullptr. * @return A dart incident to the infinite vertex. */ template < class LCC, class Triangulation > typename LCC::Dart_handle import_from_triangulation_2 (LCC& alcc, const Triangulation &atr, std::map* aface_to_dart=NULL) + typename LCC::Dart_handle >* aface_to_dart=nullptr) { CGAL_static_assertion( LCC::dimension>=2 && LCC::ambient_dimension==2 ); @@ -70,7 +70,7 @@ namespace CGAL { std::map TC; std::map* - mytc = (aface_to_dart==NULL?&TC:aface_to_dart); + mytc = (aface_to_dart==nullptr?&TC:aface_to_dart); itmap_tcell maptcell_it; diff --git a/Triangulation_2/include/CGAL/Triangulation_hierarchy_2.h b/Triangulation_2/include/CGAL/Triangulation_hierarchy_2.h index 3ab4f62c28f..aa536a5e11c 100644 --- a/Triangulation_2/include/CGAL/Triangulation_hierarchy_2.h +++ b/Triangulation_2/include/CGAL/Triangulation_hierarchy_2.h @@ -753,7 +753,7 @@ locate_in_all(const Point& p, else{ nearest = position->vertex(1); } - // compare to vertex 2, but only if the triangulation is 2D, because otherwise vertex(2) is NULL + // compare to vertex 2, but only if the triangulation is 2D, because otherwise vertex(2) is nullptr if ( (hierarchy[level]->dimension()==2) && (! hierarchy[level]->is_infinite(position->vertex(2)))){ if ( closer( construct_point(p), construct_point(position->vertex(2)->point()), diff --git a/Triangulation_2/include/CGAL/apply_to_range.h b/Triangulation_2/include/CGAL/apply_to_range.h index a8dd424509c..467b7bcd2d9 100644 --- a/Triangulation_2/include/CGAL/apply_to_range.h +++ b/Triangulation_2/include/CGAL/apply_to_range.h @@ -66,8 +66,8 @@ void apply_to_range(const Tr &t, l4 = t.line_walk(POINT(xr_left, yr_bottom), POINT(xr_left, yr_top), hface4); //test if everything is inside or outside - if( (l1 == (Nullptr_t) NULL) && (l2 == (Nullptr_t) NULL) && - (l3 == (Nullptr_t) NULL) && (l4 == (Nullptr_t) NULL)) + if( (l1 == nullptr) && (l2 == nullptr) && + (l3 == nullptr) && (l4 == nullptr)) { FVI v = t.finite_vertices_begin(); if((*v).point().x() < xr_left || (*v).point().x() > xr_right || @@ -87,7 +87,7 @@ void apply_to_range(const Tr &t, //if we are here, then a part of the triangulation is inside, the other is outside //put all the faces on the boundaries in the stack and the map - if(l1 != (Nullptr_t) NULL) //found at least one face that intersect the TOP segment + if(l1 != nullptr) //found at least one face that intersect the TOP segment { while (t.is_infinite(l1)) l1++; //we should start with a finite face do{ //put all of them in the stack; @@ -97,7 +97,7 @@ void apply_to_range(const Tr &t, }while(!t.is_infinite(l1) && t.triangle(l1).has_on_unbounded_side(POINT(xr_right, yr_top))); } - if(l2 != (Nullptr_t) NULL) //found at least one face that intersect the RIGHT segment + if(l2 != nullptr) //found at least one face that intersect the RIGHT segment { while (t.is_infinite(l2)) l2++; //we should start with a finite face do{ //put all of them in the stack; @@ -109,7 +109,7 @@ void apply_to_range(const Tr &t, }while(!t.is_infinite(l2) && t.triangle(l2).has_on_unbounded_side(POINT(xr_right, yr_bottom))); } - if(l3 != (Nullptr_t) NULL) //found at least one face that intersect the BOTTOM segment + if(l3 != nullptr) //found at least one face that intersect the BOTTOM segment { while (t.is_infinite(l3)) l3++; //we should start with a finite face do{ //put all of them in the stack; @@ -121,7 +121,7 @@ void apply_to_range(const Tr &t, }while(!t.is_infinite(l3) && t.triangle(l3).has_on_unbounded_side(POINT(xr_left, yr_bottom))); } - if(l4 != (Nullptr_t) NULL) //found at least one face that intersect the LEFT segment + if(l4 != nullptr) //found at least one face that intersect the LEFT segment { while (t.is_infinite(l4)) l4++; //we should start with a finite face do{ //put all of them in the stack; diff --git a/Triangulation_3/doc/Triangulation_3/CGAL/Delaunay_triangulation_3.h b/Triangulation_3/doc/Triangulation_3/CGAL/Delaunay_triangulation_3.h index ac4b39c6085..75f7fdcda1f 100644 --- a/Triangulation_3/doc/Triangulation_3/CGAL/Delaunay_triangulation_3.h +++ b/Triangulation_3/doc/Triangulation_3/CGAL/Delaunay_triangulation_3.h @@ -128,7 +128,7 @@ Creates an empty Delaunay triangulation, possibly specifying a traits class must be provided if concurrency is enabled. */ Delaunay_triangulation_3(const Geom_traits& traits = Geom_traits(), - Lock_data_structure *lock_ds = NULL); + Lock_data_structure *lock_ds = nullptr); /*! Copy constructor. @@ -145,7 +145,7 @@ If parallelism is enabled, the points will be inserted in parallel. template < class InputIterator > Delaunay_triangulation_3 (InputIterator first, InputIterator last, const Geom_traits& traits = Geom_traits(), - Lock_data_structure *lock_ds = NULL); + Lock_data_structure *lock_ds = nullptr); /*! Same as before, with last two parameters in reverse order. @@ -176,13 +176,13 @@ is true, otherwise it is false and the return value is Vertex_handle() function, leaving this choice to the user. */ Vertex_handle insert(const Point & p, -Cell_handle start = Cell_handle(), bool *could_lock_zone = NULL); +Cell_handle start = Cell_handle(), bool *could_lock_zone = nullptr); /*! Same as above but uses `hint` as a starting place for the search. */ Vertex_handle insert(const Point & p, Vertex_handle hint, - bool *could_lock_zone = NULL); + bool *could_lock_zone = nullptr); /*! Inserts the point `p` in the triangulation and returns the corresponding @@ -192,7 +192,7 @@ parameter the return values of a previous location query. See description of */ Vertex_handle insert(const Point & p, Locate_type lt, Cell_handle loc, int li, int lj, -bool *could_lock_zone = NULL); +bool *could_lock_zone = nullptr); /*! Inserts the points in the iterator range `[first,last)`. Returns the number of inserted points. @@ -446,7 +446,7 @@ class OutputIteratorCells> std::pair find_conflicts(const Point& p, Cell_handle c, OutputIteratorBoundaryFacets bfit, - OutputIteratorCells cit, bool *could_lock_zone = NULL); + OutputIteratorCells cit, bool *could_lock_zone = nullptr); /*! Same as the other `find_conflicts()` function, except that it also @@ -485,7 +485,7 @@ find_conflicts(const Point& p, Cell_handle c, OutputIteratorBoundaryFacets bfit, OutputIteratorCells cit, OutputIteratorInternalFacets ifit, - bool *could_lock_zone = NULL); + bool *could_lock_zone = nullptr); /*! \deprecated This function is renamed `vertices_on_conflict_zone_boundary` since CGAL-3.8. diff --git a/Triangulation_3/doc/Triangulation_3/CGAL/Regular_triangulation_3.h b/Triangulation_3/doc/Triangulation_3/CGAL/Regular_triangulation_3.h index fe74964e03a..8a26b0094df 100644 --- a/Triangulation_3/doc/Triangulation_3/CGAL/Regular_triangulation_3.h +++ b/Triangulation_3/doc/Triangulation_3/CGAL/Regular_triangulation_3.h @@ -90,7 +90,7 @@ Creates an empty regular triangulation, possibly specifying a traits class must be provided if concurrency is enabled. */ Regular_triangulation_3(const Traits & traits = Traits(), - Lock_data_structure *lock_ds = NULL); + Lock_data_structure *lock_ds = nullptr); /*! Copy constructor. @@ -108,7 +108,7 @@ If parallelism is enabled, the points will be inserted in parallel. template < class InputIterator > Regular_triangulation_3 (InputIterator first, InputIterator last, const Traits& traits = Traits(), - Lock_data_structure *lock_ds = NULL); + Lock_data_structure *lock_ds = nullptr); /*! Same as before, with last two parameters in reverse order. @@ -151,12 +151,12 @@ is true, otherwise it is false (and the point is not inserted). In any case, the locked cells are not unlocked by the function, leaving this choice to the user. */ Vertex_handle insert(const Weighted_point & p, -Cell_handle start = Cell_handle(), bool *could_lock_zone = NULL); +Cell_handle start = Cell_handle(), bool *could_lock_zone = nullptr); /*! Same as above but uses `hint` as a starting place for the search. */ -Vertex_handle insert(const Weighted_point & p, Vertex_handle hint, bool *could_lock_zone = NULL); +Vertex_handle insert(const Weighted_point & p, Vertex_handle hint, bool *could_lock_zone = nullptr); /*! Inserts the weighted point `p` in the triangulation and returns the corresponding @@ -165,7 +165,7 @@ parameter the return values of a previous location query. See description of `Triangulation_3::locate()`. */ Vertex_handle insert(const Weighted_point & p, Locate_type lt, -Cell_handle loc, int li, int lj, bool *could_lock_zone = NULL); +Cell_handle loc, int li, int lj, bool *could_lock_zone = nullptr); /*! Inserts the weighted points in the range `[first,last)`. @@ -477,9 +477,9 @@ find_conflicts(const Weighted_point p, Cell_handle c, OutputIteratorBoundaryFacets bfit, OutputIteratorCells cit, OutputIteratorInternalFacets ifit, -bool *could_lock_zone = NULL, -const Facet *this_facet_must_be_in_the_cz = NULL, -bool *the_facet_is_in_its_cz = NULL); +bool *could_lock_zone = nullptr, +const Facet *this_facet_must_be_in_the_cz = nullptr, +bool *the_facet_is_in_its_cz = nullptr); /*! \deprecated This function is renamed `vertices_on_conflict_zone_boundary` since CGAL-3.8. diff --git a/Triangulation_3/doc/Triangulation_3/CGAL/Triangulation_3.h b/Triangulation_3/doc/Triangulation_3/CGAL/Triangulation_3.h index 3629e39b9ce..23fefcdf2ec 100644 --- a/Triangulation_3/doc/Triangulation_3/CGAL/Triangulation_3.h +++ b/Triangulation_3/doc/Triangulation_3/CGAL/Triangulation_3.h @@ -233,12 +233,12 @@ infinite vertex. must be provided if concurrency is enabled. */ Triangulation_3(const Geom_traits & traits = Geom_traits(), - Lock_data_structure *lock_ds = NULL); + Lock_data_structure *lock_ds = nullptr); /*! Same as the previous one, but with parameters in reverse order. */ -Triangulation_3(Lock_data_structure *lock_ds = NULL, +Triangulation_3(Lock_data_structure *lock_ds = nullptr, const Geom_traits & traits = Geom_traits()); /*! @@ -255,7 +255,7 @@ traits class argument and calling `insert(first,last)`. template < class InputIterator> Triangulation_3 (InputIterator first, InputIterator last, const Geom_traits & traits = Geom_traits(), - Lock_data_structure *lock_ds = NULL); + Lock_data_structure *lock_ds = nullptr); /// @} @@ -630,14 +630,14 @@ unlocked by `locate`, leaving this choice to the user. */ Cell_handle locate(const Point & query, Cell_handle start = Cell_handle(), - bool *could_lock_zone = NULL) const; + bool *could_lock_zone = nullptr) const; /*! Same as above but uses `hint` as the starting place for the search. */ Cell_handle locate(const Point & query, Vertex_handle hint, - bool *could_lock_zone = NULL) const; + bool *could_lock_zone = nullptr) const; /*! Same as `locate()` but uses inexact predicates. @@ -683,7 +683,7 @@ unlocked by `locate`, leaving this choice to the user. Cell_handle locate(const Point & query, Locate_type & lt, int & li, int & lj, Cell_handle start = Cell_handle(), -bool *could_lock_zone = NULL ) const; +bool *could_lock_zone = nullptr ) const; /*! Same as above but uses `hint` as the starting place for the search. @@ -691,7 +691,7 @@ Same as above but uses `hint` as the starting place for the search. Cell_handle locate(const Point & query, Locate_type & lt, int & li, int & lj, Vertex_handle hint, -bool *could_lock_zone = NULL) const; +bool *could_lock_zone = nullptr) const; /*! diff --git a/Triangulation_3/include/CGAL/Delaunay_triangulation_3.h b/Triangulation_3/include/CGAL/Delaunay_triangulation_3.h index 4376d3ff548..1b664ab2bbd 100644 --- a/Triangulation_3/include/CGAL/Delaunay_triangulation_3.h +++ b/Triangulation_3/include/CGAL/Delaunay_triangulation_3.h @@ -232,7 +232,7 @@ protected: } public: - Delaunay_triangulation_3(const Gt& gt = Gt(), Lock_data_structure *lock_ds = NULL) + Delaunay_triangulation_3(const Gt& gt = Gt(), Lock_data_structure *lock_ds = nullptr) : Tr_Base(gt, lock_ds) {} @@ -245,13 +245,13 @@ public: Delaunay_triangulation_3(const Point& p0, const Point& p1, const Point& p2, const Point& p3, const Gt& gt = Gt(), - Lock_data_structure *lock_ds = NULL) + Lock_data_structure *lock_ds = nullptr) : Tr_Base(p0, p1, p2, p3, gt, lock_ds) {} template < typename InputIterator > Delaunay_triangulation_3(InputIterator first, InputIterator last, - const Gt& gt = Gt(), Lock_data_structure *lock_ds = NULL) + const Gt& gt = Gt(), Lock_data_structure *lock_ds = nullptr) : Tr_Base(gt, lock_ds) { insert(first, last); @@ -346,7 +346,7 @@ public: typename std::iterator_traits::value_type, Point > - >::type* = NULL) + >::type* = nullptr) #else template < class InputIterator > std::ptrdiff_t insert(InputIterator first, InputIterator last) @@ -492,7 +492,7 @@ public: typename std::iterator_traits::value_type, std::pair::type> - > >::type* =NULL) + > >::type* =nullptr) { return insert_with_info< std::pair::type> >(first,last); } @@ -506,25 +506,25 @@ public: boost::is_convertible< typename std::iterator_traits::value_type, Point >, boost::is_convertible< typename std::iterator_traits::value_type, typename internal::Info_check::type > > - >::type* =NULL) + >::type* =nullptr) { return insert_with_info< boost::tuple::type> >(first,last); } #endif //CGAL_TRIANGULATION_3_DONT_INSERT_RANGE_OF_POINTS_WITH_INFO - Vertex_handle insert(const Point& p, Vertex_handle hint, bool *could_lock_zone = NULL) + Vertex_handle insert(const Point& p, Vertex_handle hint, bool *could_lock_zone = nullptr) { return insert(p, hint == Vertex_handle() ? this->infinite_cell() : hint->cell(), could_lock_zone); } Vertex_handle insert(const Point& p, Cell_handle start = Cell_handle(), - bool *could_lock_zone = NULL); + bool *could_lock_zone = nullptr); Vertex_handle insert(const Point& p, Locate_type lt, Cell_handle c, int li, int, - bool *could_lock_zone = NULL); + bool *could_lock_zone = nullptr); public: // internal methods template @@ -554,7 +554,7 @@ public: OutputIteratorBoundaryFacets bfit, OutputIteratorCells cit, OutputIteratorInternalFacets ifit, - bool *could_lock_zone = NULL) const + bool *could_lock_zone = nullptr) const { CGAL_triangulation_precondition(dimension() >= 2); @@ -603,7 +603,7 @@ public: find_conflicts(const Point& p, Cell_handle c, OutputIteratorBoundaryFacets bfit, OutputIteratorCells cit, - bool *could_lock_zone = NULL) const + bool *could_lock_zone = nullptr) const { Triple::Vertex_remover typedef DelaunayTriangulation_3 Delaunay; public: - typedef Nullptr_t Hidden_points_iterator; + typedef std::nullptr_t Hidden_points_iterator; Vertex_remover(Delaunay &tmp_) : tmp(tmp_) {} Delaunay &tmp; void add_hidden_points(Cell_handle) {} - Hidden_points_iterator hidden_points_begin() { return NULL; } - Hidden_points_iterator hidden_points_end() { return NULL; } + Hidden_points_iterator hidden_points_begin() { return nullptr; } + Hidden_points_iterator hidden_points_end() { return nullptr; } Bounded_side side_of_bounded_circle(const Point& p, const Point& q, const Point& r, const Point& s, @@ -1291,15 +1291,15 @@ class Delaunay_triangulation_3::Vertex_inserter typedef DelaunayTriangulation_3 Delaunay; public: - typedef Nullptr_t Hidden_points_iterator; + typedef std::nullptr_t Hidden_points_iterator; Vertex_inserter(Delaunay &tmp_) : tmp(tmp_) {} Delaunay &tmp; void add_hidden_points(Cell_handle) {} - Hidden_points_iterator hidden_points_begin() { return NULL; } - Hidden_points_iterator hidden_points_end() { return NULL; } + Hidden_points_iterator hidden_points_begin() { return nullptr; } + Hidden_points_iterator hidden_points_end() { return nullptr; } Vertex_handle insert(const Point& p, Locate_type lt, Cell_handle c, int li, int lj) { diff --git a/Triangulation_3/include/CGAL/Delaunay_triangulation_cell_base_with_circumcenter_3.h b/Triangulation_3/include/CGAL/Delaunay_triangulation_cell_base_with_circumcenter_3.h index 0ab0d2d2a65..40dee88cf37 100644 --- a/Triangulation_3/include/CGAL/Delaunay_triangulation_cell_base_with_circumcenter_3.h +++ b/Triangulation_3/include/CGAL/Delaunay_triangulation_cell_base_with_circumcenter_3.h @@ -48,7 +48,7 @@ public: { if (circumcenter_) { delete circumcenter_; - circumcenter_ = NULL; + circumcenter_ = nullptr; } } @@ -65,11 +65,11 @@ public: }; Delaunay_triangulation_cell_base_with_circumcenter_3() - : Cb(), circumcenter_(NULL) {} + : Cb(), circumcenter_(nullptr) {} Delaunay_triangulation_cell_base_with_circumcenter_3 (const Delaunay_triangulation_cell_base_with_circumcenter_3 &c) - : Cb(c), circumcenter_(c.circumcenter_ != NULL ? new Point(*(c.circumcenter_)) : NULL) + : Cb(c), circumcenter_(c.circumcenter_ != nullptr ? new Point(*(c.circumcenter_)) : nullptr) {} Delaunay_triangulation_cell_base_with_circumcenter_3& @@ -83,14 +83,14 @@ public: Delaunay_triangulation_cell_base_with_circumcenter_3( Vertex_handle v0, Vertex_handle v1, Vertex_handle v2, Vertex_handle v3) - : Cb(v0, v1, v2, v3), circumcenter_(NULL) {} + : Cb(v0, v1, v2, v3), circumcenter_(nullptr) {} Delaunay_triangulation_cell_base_with_circumcenter_3( Vertex_handle v0, Vertex_handle v1, Vertex_handle v2, Vertex_handle v3, Cell_handle n0, Cell_handle n1, Cell_handle n2, Cell_handle n3) - : Cb(v0, v1, v2, v3, n0, n1, n2, n3), circumcenter_(NULL) {} + : Cb(v0, v1, v2, v3, n0, n1, n2, n3), circumcenter_(nullptr) {} ~Delaunay_triangulation_cell_base_with_circumcenter_3() { @@ -121,7 +121,7 @@ public: const Point& circumcenter(const Geom_traits& gt = Geom_traits()) const { - if (circumcenter_ == NULL) { + if (circumcenter_ == nullptr) { circumcenter_ = new Point(this->Cb::circumcenter(gt)); } else { CGAL_expensive_assertion( diff --git a/Triangulation_3/include/CGAL/Regular_triangulation_3.h b/Triangulation_3/include/CGAL/Regular_triangulation_3.h index 231e5d6dc52..bfb1e3eb9b7 100644 --- a/Triangulation_3/include/CGAL/Regular_triangulation_3.h +++ b/Triangulation_3/include/CGAL/Regular_triangulation_3.h @@ -188,7 +188,7 @@ public: using Tr_Base::tds; using Tr_Base::vertex_triple_index; - Regular_triangulation_3(const Gt& gt = Gt(), Lock_data_structure *lock_ds = NULL) + Regular_triangulation_3(const Gt& gt = Gt(), Lock_data_structure *lock_ds = nullptr) : Tr_Base(gt, lock_ds), hidden_point_visitor(this) { } @@ -223,7 +223,7 @@ public: //insertion template < typename InputIterator > Regular_triangulation_3(InputIterator first, InputIterator last, - const Gt& gt = Gt(), Lock_data_structure *lock_ds = NULL) + const Gt& gt = Gt(), Lock_data_structure *lock_ds = nullptr) : Tr_Base(gt, lock_ds), hidden_point_visitor(this) { insert(first, last); @@ -326,7 +326,7 @@ public: typename boost::enable_if< boost::is_convertible< typename std::iterator_traits::value_type, - Weighted_point> >::type* = NULL) + Weighted_point> >::type* = nullptr) #else template < class InputIterator > std::ptrdiff_t insert(InputIterator first, InputIterator last) @@ -567,7 +567,7 @@ public: typename std::iterator_traits::value_type, std::pair::type> > - >::type* = NULL) + >::type* = nullptr) { return insert_with_info< std::pair::value_type, Weighted_point >, typename boost::is_convertible< typename std::iterator_traits::value_type, typename internal::Info_check::type > - > >::type* =NULL) + > >::type* =nullptr) { return insert_with_info< boost::tupleinfinite_cell() : hint->cell(), @@ -604,10 +604,10 @@ public: } Vertex_handle insert(const Weighted_point& p, - Cell_handle start = Cell_handle(), bool *could_lock_zone = NULL); + Cell_handle start = Cell_handle(), bool *could_lock_zone = nullptr); Vertex_handle insert(const Weighted_point& p, Locate_type lt, - Cell_handle c, int li, int, bool *could_lock_zone = NULL); + Cell_handle c, int li, int, bool *could_lock_zone = nullptr); template Vertex_handle insert_in_hole(const Weighted_point& p, @@ -629,9 +629,9 @@ public: OutputIteratorBoundaryFacets bfit, OutputIteratorCells cit, OutputIteratorInternalFacets ifit, - bool *could_lock_zone = NULL, - const Facet *this_facet_must_be_in_the_cz = NULL, - bool *the_facet_is_in_its_cz = NULL) const + bool *could_lock_zone = nullptr, + const Facet *this_facet_must_be_in_the_cz = nullptr, + bool *the_facet_is_in_its_cz = nullptr) const { CGAL_triangulation_precondition(dimension() >= 2); @@ -692,7 +692,7 @@ public: find_conflicts(const Weighted_point& p, Cell_handle c, OutputIteratorBoundaryFacets bfit, OutputIteratorCells cit, - bool *could_lock_zone = NULL) const + bool *could_lock_zone = nullptr) const { Triple::Vertex_inserter typedef RegularTriangulation_3 Regular; public: - typedef Nullptr_t Hidden_points_iterator; + typedef std::nullptr_t Hidden_points_iterator; Vertex_inserter(Regular &tmp_) : tmp(tmp_) {} Regular& tmp; void add_hidden_points(Cell_handle) {} - Hidden_points_iterator hidden_points_begin() { return NULL; } - Hidden_points_iterator hidden_points_end() { return NULL; } + Hidden_points_iterator hidden_points_begin() { return nullptr; } + Hidden_points_iterator hidden_points_end() { return nullptr; } Vertex_handle insert(const Weighted_point& p, Locate_type lt, Cell_handle c, int li, int lj) diff --git a/Triangulation_3/include/CGAL/Regular_triangulation_cell_base_3.h b/Triangulation_3/include/CGAL/Regular_triangulation_cell_base_3.h index 73849f4dc97..9ec6c688b5d 100644 --- a/Triangulation_3/include/CGAL/Regular_triangulation_cell_base_3.h +++ b/Triangulation_3/include/CGAL/Regular_triangulation_cell_base_3.h @@ -105,47 +105,47 @@ public: // Memory_policy is Tag_true ------------------------------------------------- template - Point_iterator hidden_points_begin_internal(typename boost::enable_if_c::type* = NULL) + Point_iterator hidden_points_begin_internal(typename boost::enable_if_c::type* = nullptr) { return _hidden.begin(); } template - Point_iterator hidden_points_end_internal(typename boost::enable_if_c::type* = NULL) + Point_iterator hidden_points_end_internal(typename boost::enable_if_c::type* = nullptr) { return _hidden.end(); } template - Point_const_iterator hidden_points_begin_internal(typename boost::enable_if_c::type* = NULL) const + Point_const_iterator hidden_points_begin_internal(typename boost::enable_if_c::type* = nullptr) const { return _hidden.begin(); } template - Point_const_iterator hidden_points_end_internal(typename boost::enable_if_c::type* = NULL) const + Point_const_iterator hidden_points_end_internal(typename boost::enable_if_c::type* = nullptr) const { return _hidden.end(); } template - void hide_point_internal(const Point& p, typename boost::enable_if_c::type* = NULL) + void hide_point_internal(const Point& p, typename boost::enable_if_c::type* = nullptr) { _hidden.push_back(p); } template - void unhide_point_internal(const Point_iterator pit, typename boost::enable_if_c::type* = NULL) + void unhide_point_internal(const Point_iterator pit, typename boost::enable_if_c::type* = nullptr) { _hidden.erase(pit); } // Memory_policy is Tag_false ------------------------------------------------ template - Point_iterator hidden_points_begin_internal(typename boost::disable_if_c::type* = NULL) + Point_iterator hidden_points_begin_internal(typename boost::disable_if_c::type* = nullptr) { return hidden_points_end(); } template - Point_iterator hidden_points_end_internal(typename boost::disable_if_c::type* = NULL) + Point_iterator hidden_points_end_internal(typename boost::disable_if_c::type* = nullptr) { return _hidden.end(); } // const versions template - Point_const_iterator hidden_points_begin_internal(typename boost::disable_if_c::type* = NULL) const + Point_const_iterator hidden_points_begin_internal(typename boost::disable_if_c::type* = nullptr) const { return hidden_points_end(); } template - Point_const_iterator hidden_points_end_internal(typename boost::disable_if_c::type* = NULL) const + Point_const_iterator hidden_points_end_internal(typename boost::disable_if_c::type* = nullptr) const { return _hidden.end(); } template - void hide_point_internal(const Point&, typename boost::disable_if_c::type* = NULL) + void hide_point_internal(const Point&, typename boost::disable_if_c::type* = nullptr) { } template - void unhide_point_internal(const Point_iterator, typename boost::disable_if_c::type* = NULL) + void unhide_point_internal(const Point_iterator, typename boost::disable_if_c::type* = nullptr) { } template diff --git a/Triangulation_3/include/CGAL/Regular_triangulation_cell_base_with_weighted_circumcenter_3.h b/Triangulation_3/include/CGAL/Regular_triangulation_cell_base_with_weighted_circumcenter_3.h index 610d8e55ade..c58d30450bd 100644 --- a/Triangulation_3/include/CGAL/Regular_triangulation_cell_base_with_weighted_circumcenter_3.h +++ b/Triangulation_3/include/CGAL/Regular_triangulation_cell_base_with_weighted_circumcenter_3.h @@ -50,7 +50,7 @@ public: { if (weighted_circumcenter_) { delete weighted_circumcenter_; - weighted_circumcenter_ = NULL; + weighted_circumcenter_ = nullptr; } } @@ -69,14 +69,14 @@ public: }; Regular_triangulation_cell_base_with_weighted_circumcenter_3() - : Cb(), weighted_circumcenter_(NULL) {} + : Cb(), weighted_circumcenter_(nullptr) {} Regular_triangulation_cell_base_with_weighted_circumcenter_3 (const Regular_triangulation_cell_base_with_weighted_circumcenter_3 &c) : Cb(c), - weighted_circumcenter_(c.weighted_circumcenter_ != NULL ? + weighted_circumcenter_(c.weighted_circumcenter_ != nullptr ? new Point_3(*(c.weighted_circumcenter_)) : - NULL) + nullptr) {} Regular_triangulation_cell_base_with_weighted_circumcenter_3& @@ -91,14 +91,14 @@ public: Regular_triangulation_cell_base_with_weighted_circumcenter_3( Vertex_handle v0, Vertex_handle v1, Vertex_handle v2, Vertex_handle v3) - : Cb(v0, v1, v2, v3), weighted_circumcenter_(NULL) {} + : Cb(v0, v1, v2, v3), weighted_circumcenter_(nullptr) {} Regular_triangulation_cell_base_with_weighted_circumcenter_3( Vertex_handle v0, Vertex_handle v1, Vertex_handle v2, Vertex_handle v3, Cell_handle n0, Cell_handle n1, Cell_handle n2, Cell_handle n3) - : Cb(v0, v1, v2, v3, n0, n1, n2, n3), weighted_circumcenter_(NULL) {} + : Cb(v0, v1, v2, v3, n0, n1, n2, n3), weighted_circumcenter_(nullptr) {} ~Regular_triangulation_cell_base_with_weighted_circumcenter_3() { @@ -130,7 +130,7 @@ public: const Point_3 & weighted_circumcenter(const Geom_traits& gt = Geom_traits()) const { - if (weighted_circumcenter_ == NULL) { + if (weighted_circumcenter_ == nullptr) { weighted_circumcenter_ = new Point_3(this->Cb::weighted_circumcenter(gt)); } else { diff --git a/Triangulation_3/include/CGAL/Triangulation_3.h b/Triangulation_3/include/CGAL/Triangulation_3.h index 891becdcabf..02796b07b26 100644 --- a/Triangulation_3/include/CGAL/Triangulation_3.h +++ b/Triangulation_3/include/CGAL/Triangulation_3.h @@ -196,7 +196,7 @@ public: const Bbox_3 *get_bbox() const { - return NULL; + return nullptr; } }; @@ -701,7 +701,7 @@ public: public: // CONSTRUCTORS - Triangulation_3(const GT& gt = GT(), Lock_data_structure *lock_ds = NULL) + Triangulation_3(const GT& gt = GT(), Lock_data_structure *lock_ds = nullptr) : Base(lock_ds), _tds(), _gt(gt) { init_tds(); @@ -723,7 +723,7 @@ public: template < typename InputIterator > Triangulation_3(InputIterator first, InputIterator last, - const GT& gt = GT(), Lock_data_structure *lock_ds = NULL) + const GT& gt = GT(), Lock_data_structure *lock_ds = nullptr) : Base(lock_ds), _gt(gt) { init_tds(); @@ -734,7 +734,7 @@ public: // Precondition: p0, p1, p3 and p4 MUST BE positively oriented Triangulation_3(const Point& p0, const Point& p1, const Point& p3, const Point& p4, - const GT& gt = GT(), Lock_data_structure *lock_ds = NULL) + const GT& gt = GT(), Lock_data_structure *lock_ds = nullptr) : Base(lock_ds), _gt(gt) { CGAL_triangulation_precondition(orientation(p0, p1, p3, p4) == POSITIVE); @@ -900,7 +900,7 @@ public: locate(const Point& p, Locate_type& lt, int& li, int& lj, Cell_handle start = Cell_handle(), - bool *could_lock_zone = NULL) const; + bool *could_lock_zone = nullptr) const; #else // no CGAL_NO_STRUCTURAL_FILTERING # ifndef CGAL_T3_STRUCTURAL_FILTERING_MAX_VISITED_CELLS # define CGAL_T3_STRUCTURAL_FILTERING_MAX_VISITED_CELLS 2500 @@ -910,20 +910,20 @@ public: Cell_handle inexact_locate(const Point& p, Cell_handle start = Cell_handle(), int max_num_cells = CGAL_T3_STRUCTURAL_FILTERING_MAX_VISITED_CELLS, - bool *could_lock_zone = NULL) const; + bool *could_lock_zone = nullptr) const; protected: Cell_handle exact_locate(const Point& p, Locate_type& lt, int& li, int& lj, Cell_handle start, - bool *could_lock_zone = NULL) const; + bool *could_lock_zone = nullptr) const; Cell_handle generic_locate(const Point& p, Locate_type& lt, int& li, int& lj, Cell_handle start, internal::Structural_filtering_3_tag, - bool *could_lock_zone = NULL) const + bool *could_lock_zone = nullptr) const { Cell_handle ch = inexact_locate( p, start, CGAL_T3_STRUCTURAL_FILTERING_MAX_VISITED_CELLS, could_lock_zone); @@ -938,7 +938,7 @@ protected: int& li, int& lj, Cell_handle start, internal::No_structural_filtering_3_tag, - bool *could_lock_zone = NULL) const + bool *could_lock_zone = nullptr) const { return exact_locate(p, lt, li, lj, start, could_lock_zone); } @@ -987,7 +987,7 @@ public: Cell_handle locate(const Point& p, Locate_type& lt, int& li, int& lj, Cell_handle start = Cell_handle(), - bool *could_lock_zone = NULL) const + bool *could_lock_zone = nullptr) const { typedef Triangulation_structural_filtering_traits TSFT; typedef typename internal::Structural_filtering_selector_3< @@ -999,7 +999,7 @@ public: Cell_handle locate(const Point& p, Cell_handle start = Cell_handle(), - bool *could_lock_zone = NULL) const + bool *could_lock_zone = nullptr) const { Locate_type lt; int li, lj; @@ -1008,14 +1008,14 @@ public: Cell_handle locate(const Point& p, Locate_type& lt, int& li, int& lj, Vertex_handle hint, - bool *could_lock_zone = NULL) const + bool *could_lock_zone = nullptr) const { return locate(p, lt, li, lj, hint == Vertex_handle() ? infinite_cell() : hint->cell(), could_lock_zone); } - Cell_handle locate(const Point& p, Vertex_handle hint, bool *could_lock_zone = NULL) const + Cell_handle locate(const Point& p, Vertex_handle hint, bool *could_lock_zone = nullptr) const { return locate(p, hint == Vertex_handle() ? infinite_cell() : hint->cell(), could_lock_zone); @@ -1118,7 +1118,7 @@ public: Cell_handle c, int li, int lj, const Conflict_tester& tester, Hidden_points_visitor& hider, - bool *could_lock_zone = NULL); + bool *could_lock_zone = nullptr); #ifndef CGAL_TRIANGULATION_3_DONT_INSERT_RANGE_OF_POINTS_WITH_INFO @@ -1293,9 +1293,9 @@ protected: Triple it, - bool *could_lock_zone = NULL, - const Facet *this_facet_must_be_in_the_cz = NULL, - bool *the_facet_is_in_its_cz = NULL) const + bool *could_lock_zone = nullptr, + const Facet *this_facet_must_be_in_the_cz = nullptr, + bool *the_facet_is_in_its_cz = nullptr) const { CGAL_triangulation_precondition(dimension()>=2); @@ -1481,7 +1481,7 @@ protected: bool test_dim_down_using_incident_cells_3(Vertex_handle v, std::vector& incident_cells, std::vector& adj_vertices, - bool *could_lock_zone = NULL) const; + bool *could_lock_zone = nullptr) const; // REMOVAL template < class VertexRemover > @@ -4433,13 +4433,13 @@ fill_hole_2D(std::list& first_hole, VertexRemover& remover) Vertex_handle v2 = infinite_vertex(); const Point& p0 = v0->point(); const Point& p1 = v1->point(); - const Point *p2 = NULL; // Initialize to NULL to avoid warning. + const Point *p2 = nullptr; // Initialize to nullptr to avoid warning. typename Hole::iterator hdone = hole.end(); typename Hole::iterator hit = hole.begin(); typename Hole::iterator cut_after(hit); - // If tested vertex is c with respect to the vertex opposite to NULL neighbor, + // If tested vertex is c with respect to the vertex opposite to nullptr neighbor, // stop at the before last face; hdone--; for(; hit != hdone; ++hit) @@ -4583,14 +4583,14 @@ fill_hole_2D(std::list& first_hole, VertexRemover& remover, OutputItCel Vertex_handle v2 = infinite_vertex(); const Point& p0 = v0->point(); const Point& p1 = v1->point(); - const Point *p2 = NULL; // Initialize to NULL to avoid warning. + const Point *p2 = nullptr; // Initialize to nullptr to avoid warning. typename Hole::iterator hdone = hole.end(); typename Hole::iterator hit = hole.begin(); typename Hole::iterator cut_after(hit); // if tested vertex is c with respect to the vertex opposite - // to NULL neighbor, + // to nullptr neighbor, // stop at the before last face; hdone--; for(; hit != hdone; ++hit) diff --git a/Triangulation_3/include/CGAL/Triangulation_3_to_lcc.h b/Triangulation_3/include/CGAL/Triangulation_3_to_lcc.h index f0933531702..492d8d1c79f 100644 --- a/Triangulation_3/include/CGAL/Triangulation_3_to_lcc.h +++ b/Triangulation_3/include/CGAL/Triangulation_3_to_lcc.h @@ -31,14 +31,14 @@ namespace CGAL { * @param alcc the used linear cell complex. * @param atr the Triangulation_3. * @param avol_to_dart a pointer to a std::map associating to each - * tetrahedron of atr a corresponding dart in alcc. Not used if NULL. + * tetrahedron of atr a corresponding dart in alcc. Not used if nullptr. * @return A dart incident to the infinite vertex. */ template < class LCC, class Triangulation > typename LCC::Dart_handle import_from_triangulation_3 (LCC& alcc, const Triangulation &atr, std::map* avol_to_dart=NULL) + typename LCC::Dart_handle >* avol_to_dart=nullptr) { CGAL_static_assertion( LCC::dimension>=3 && LCC::ambient_dimension==3 ); @@ -70,7 +70,7 @@ namespace CGAL { std::map TC; std::map* - mytc = (avol_to_dart==NULL?&TC:avol_to_dart); + mytc = (avol_to_dart==nullptr?&TC:avol_to_dart); itmap_tcell maptcell_it; diff --git a/Triangulation_3/include/CGAL/Triangulation_hierarchy_3.h b/Triangulation_3/include/CGAL/Triangulation_hierarchy_3.h index 26d215222d2..37b44e1cd7d 100644 --- a/Triangulation_3/include/CGAL/Triangulation_hierarchy_3.h +++ b/Triangulation_3/include/CGAL/Triangulation_hierarchy_3.h @@ -163,7 +163,7 @@ public: typename std::iterator_traits::value_type, Point > - >::type* = NULL + >::type* = nullptr ) #else template < class InputIterator > @@ -299,7 +299,7 @@ public: boost::is_convertible< typename std::iterator_traits::value_type, std::pair::type> - > >::type* =NULL + > >::type* =nullptr ) { return insert_with_info< std::pair::type> >(first,last); @@ -314,7 +314,7 @@ public: boost::is_convertible< typename std::iterator_traits::value_type, Point >, boost::is_convertible< typename std::iterator_traits::value_type, typename internal::Info_check::type > > - >::type* =NULL + >::type* =nullptr ) { return insert_with_info< boost::tuple::type> >(first,last); diff --git a/Triangulation_3/include/CGAL/draw_triangulation_3.h b/Triangulation_3/include/CGAL/draw_triangulation_3.h index 8de53e720f0..065eba016a3 100644 --- a/Triangulation_3/include/CGAL/draw_triangulation_3.h +++ b/Triangulation_3/include/CGAL/draw_triangulation_3.h @@ -38,7 +38,7 @@ struct DefaultColorFunctorT3 static CGAL::Color run(const T3&, const typename T3::Finite_facets_iterator* fh) { - if (fh==NULL) // use to get the mono color + if (fh==nullptr) // use to get the mono color return CGAL::Color(100, 125, 200); // R G B between 0-255 CGAL::Random random((unsigned int)((std::size_t)(&*((*fh)->first))+ diff --git a/Visibility_2/include/CGAL/Rotational_sweep_visibility_2.h b/Visibility_2/include/CGAL/Rotational_sweep_visibility_2.h index 0426427d580..0a2cefd170c 100644 --- a/Visibility_2/include/CGAL/Rotational_sweep_visibility_2.h +++ b/Visibility_2/include/CGAL/Rotational_sweep_visibility_2.h @@ -289,7 +289,7 @@ private: //visibility_cone is greater than pi. public: - Rotational_sweep_visibility_2(): p_arr(NULL), geom_traits(NULL) {} + Rotational_sweep_visibility_2(): p_arr(nullptr), geom_traits(nullptr) {} Rotational_sweep_visibility_2(const Arrangement_2& arr): p_arr(&arr) { geom_traits = p_arr->geometry_traits(); } @@ -429,7 +429,7 @@ public: } bool is_attached() const { - return (p_arr != NULL); + return (p_arr != nullptr); } void attach(const Arrangement_2& arr) { @@ -438,8 +438,8 @@ void attach(const Arrangement_2& arr) { } void detach() { - p_arr = NULL; - geom_traits = NULL; + p_arr = nullptr; + geom_traits = nullptr; } const Arrangement_2& arrangement_2() const { diff --git a/Visibility_2/include/CGAL/Simple_polygon_visibility_2.h b/Visibility_2/include/CGAL/Simple_polygon_visibility_2.h index 8cd0807cad3..c875db68dc4 100644 --- a/Visibility_2/include/CGAL/Simple_polygon_visibility_2.h +++ b/Visibility_2/include/CGAL/Simple_polygon_visibility_2.h @@ -73,7 +73,7 @@ namespace CGAL { typedef CGAL::Tag_false Supports_general_polygon_category; typedef CGAL::Tag_true Supports_simple_polygon_category; - Simple_polygon_visibility_2() : p_arr(NULL), traits(NULL) {} + Simple_polygon_visibility_2() : p_arr(nullptr), traits(nullptr) {} /*! Constructor given an arrangement and the Regularization tag. */ Simple_polygon_visibility_2(const Arrangement_2& arr): @@ -91,7 +91,7 @@ namespace CGAL { /*! Method to check if the visibility object is attached or not to an arrangement*/ bool is_attached() const { - return (p_arr != NULL); + return (p_arr != nullptr); } /*! Attaches the visibility object to the 'arr' arrangement */ @@ -108,8 +108,8 @@ namespace CGAL { attached to*/ void detach() { point_location.detach(); - p_arr = NULL; - traits = NULL; + p_arr = nullptr; + traits = nullptr; vertices.clear(); query_pt_is_vertex = false; query_pt_is_on_halfedge = false; @@ -409,7 +409,7 @@ namespace CGAL { if (Object_2 result = Intersect_2()(seg, ray_origin) ) { const Point_2 * ipoint = object_cast(&result); - CGAL_assertion( ipoint != NULL ); + CGAL_assertion( ipoint != nullptr ); s_t = *ipoint; upcase = SCANB; } @@ -492,7 +492,7 @@ namespace CGAL { Object_2 result = Intersect_2()( seg, seg2 ); if(result) { const Point_2 * ipoint = object_cast(&result); - CGAL_assertion( ipoint != NULL ); + CGAL_assertion( ipoint != nullptr ); u = *ipoint; mode = 2; break; @@ -525,7 +525,7 @@ namespace CGAL { Object_2 result = Intersect_2()( seg, ray ); const Point_2 * ipoint = object_cast(&result); - CGAL_assertion( ipoint != NULL ); + CGAL_assertion( ipoint != nullptr ); u = *ipoint; if ( stack.top() != u ) { @@ -544,7 +544,7 @@ namespace CGAL { Object_2 result = Intersect_2()( seg, ray ); const Point_2 * ipoint = object_cast(&result); - CGAL_assertion( ipoint != NULL ); + CGAL_assertion( ipoint != nullptr ); u = *ipoint; if ( stack.top() != u ) { diff --git a/Visibility_2/include/CGAL/Triangular_expansion_visibility_2.h b/Visibility_2/include/CGAL/Triangular_expansion_visibility_2.h index f391ac0a075..a878bd2b96f 100644 --- a/Visibility_2/include/CGAL/Triangular_expansion_visibility_2.h +++ b/Visibility_2/include/CGAL/Triangular_expansion_visibility_2.h @@ -169,7 +169,7 @@ private: public: - Triangular_expansion_visibility_2() : p_arr(NULL){} + Triangular_expansion_visibility_2() : p_arr(nullptr){} /*! Constructor given an arrangement. */ Triangular_expansion_visibility_2 (const Arrangement_2& arr) @@ -183,7 +183,7 @@ public: bool is_attached() const { //std::cout << "is_attached" << std::endl; - return (p_arr != NULL); + return (p_arr != nullptr); } void attach(const Arrangement_2& arr) { @@ -199,7 +199,7 @@ public: void detach() { //std::cout << "detach" << std::endl; observer.detach(); - p_arr = NULL; + p_arr = nullptr; p_cdt.reset(); } diff --git a/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Default_site_inserters.h b/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Default_site_inserters.h index 3a8df83a288..621d7f8efb8 100644 --- a/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Default_site_inserters.h +++ b/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Default_site_inserters.h @@ -75,7 +75,7 @@ public: typedef typename Delaunay_graph::Vertex_handle result_type; public: - Default_caching_site_inserter(const Adaptation_traits* at = NULL) : at_(at) {} + Default_caching_site_inserter(const Adaptation_traits* at = nullptr) : at_(at) {} result_type operator()(Delaunay_graph& dg, const Site_2& t) const { diff --git a/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Default_site_removers.h b/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Default_site_removers.h index 5d388ba668b..85e00479afc 100644 --- a/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Default_site_removers.h +++ b/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Default_site_removers.h @@ -69,7 +69,7 @@ public: typedef typename Site_remover::result_type result_type; public: - Default_caching_site_remover(const Adaptation_traits* at = NULL) : at_(at) {} + Default_caching_site_remover(const Adaptation_traits* at = nullptr) : at_(at) {} result_type operator()(Delaunay_graph& dg, const Vertex_handle& v) const { diff --git a/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Degeneracy_tester_binders.h b/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Degeneracy_tester_binders.h index 62047306e66..4a735753974 100644 --- a/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Degeneracy_tester_binders.h +++ b/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Degeneracy_tester_binders.h @@ -42,11 +42,11 @@ private: public: typedef typename ER::result_type result_type; - Edge_rejector_binder(const VDA* vda = NULL) : vda_(vda) {} + Edge_rejector_binder(const VDA* vda = nullptr) : vda_(vda) {} template bool operator()(const A& a) const { - CGAL_precondition( vda_ != NULL ); + CGAL_precondition( vda_ != nullptr ); return vda_->edge_rejector()(vda_->dual(), a); } @@ -65,11 +65,11 @@ private: public: typedef typename FR::result_type result_type; - Face_rejector_binder(const VDA* vda = NULL) : vda_(vda) {} + Face_rejector_binder(const VDA* vda = nullptr) : vda_(vda) {} template bool operator()(const A& a) const { - CGAL_precondition( vda_ != NULL ); + CGAL_precondition( vda_ != nullptr ); return vda_->face_rejector()(vda_->dual(), a); } diff --git a/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Face.h b/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Face.h index 336bb24a05d..215a31b16c6 100644 --- a/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Face.h +++ b/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Face.h @@ -62,7 +62,7 @@ class Face // CONSTRUCTORS //------------- - Face(const VDA* vda = NULL) : vda_(vda) {} + Face(const VDA* vda = nullptr) : vda_(vda) {} Face(const VDA* vda, Delaunay_vertex_handle v) : vda_(vda), v_(v) { // CGAL_precondition( !vda_->face_rejector()(v_) ); @@ -152,7 +152,7 @@ class Face // VALIDITY TESTING //----------------- bool is_valid() const { - if ( vda_ == NULL ) { return true; } + if ( vda_ == nullptr ) { return true; } if ( vda_->dual().dimension() < 1 ) { return true; } @@ -175,8 +175,8 @@ class Face // COMPARISON OPERATORS //--------------------- bool operator==(const Self& other) const { - if ( vda_ == NULL ) { return other.vda_ == NULL; } - if ( other.vda_ == NULL ) { return vda_ == NULL; } + if ( vda_ == nullptr ) { return other.vda_ == nullptr; } + if ( other.vda_ == nullptr ) { return vda_ == nullptr; } return ( vda_ == other.vda_ && v_ == other.v_ ); } @@ -185,8 +185,8 @@ class Face } bool operator<(const Self& other) const { - if ( vda_ == NULL ) { return other.vda_ != NULL; } - if ( other.vda_ == NULL ) { return false; } + if ( vda_ == nullptr ) { return other.vda_ != nullptr; } + if ( other.vda_ == nullptr ) { return false; } if ( vda_ != other.vda_ ) { return vda_ < other.vda_; } return v_ < other.v_; } diff --git a/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Halfedge.h b/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Halfedge.h index 6017cdeb3ee..2cc6b257378 100644 --- a/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Halfedge.h +++ b/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Halfedge.h @@ -81,7 +81,7 @@ public: // CONSTRUCTORS //------------- - Halfedge(const VDA* vda = NULL) + Halfedge(const VDA* vda = nullptr) : vda_(vda), f_(Delaunay_face_handle()), i_(-1), v1_(Delaunay_vertex_handle()), v2_(Delaunay_vertex_handle()) {} Halfedge(const VDA* vda, Delaunay_face_handle f, int i) @@ -272,7 +272,7 @@ public: // VALIDITY TESTING //----------------- bool is_valid() const { - if ( vda_ == NULL ) { return true; } + if ( vda_ == nullptr ) { return true; } bool valid = true; @@ -309,8 +309,8 @@ public: // COMPARISON OPERATORS //--------------------- bool operator==(const Self& other) const { - if ( vda_ == NULL ) { return other.vda_ == NULL; } - if ( other.vda_ == NULL ) { return vda_ == NULL; } + if ( vda_ == nullptr ) { return other.vda_ == nullptr; } + if ( other.vda_ == nullptr ) { return vda_ == nullptr; } if ( vda_->dual().dimension() == 1 ) { return ( vda_ == other.vda_ && v1_ == other.v1_ && v2_ == other.v2_ ); @@ -324,8 +324,8 @@ public: } bool operator<(const Self& other) const { - if ( vda_ == NULL ) { return other.vda_ != NULL; } - if ( other.vda_ == NULL ) { return false; } + if ( vda_ == nullptr ) { return other.vda_ != nullptr; } + if ( other.vda_ == nullptr ) { return false; } if ( vda_ != other.vda_ ) { return vda_ < other.vda_; } if ( vda_->dual().dimension() == 1 ) { diff --git a/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Iterator_adaptors.h b/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Iterator_adaptors.h index 4b8d48a24af..dc3c49e0b61 100644 --- a/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Iterator_adaptors.h +++ b/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Iterator_adaptors.h @@ -48,7 +48,7 @@ class Iterator_adaptor_base typedef typename Base_iterator::difference_type difference_type; typedef typename Base_iterator::iterator_category iterator_category; - Iterator_adaptor_base(const VDA* vda = NULL) : vda_(vda), value_() {} + Iterator_adaptor_base(const VDA* vda = nullptr) : vda_(vda), value_() {} Iterator_adaptor_base(const VDA* vda, const Base_iterator& cur) : vda_(vda), value_(), cur_(cur) {} Iterator_adaptor_base(const Self& other) { copy_from(other); } @@ -95,8 +95,8 @@ class Iterator_adaptor_base } bool operator==(const Iterator& other) const { - if ( vda_ == NULL ) { return other.vda_ == NULL; } - if ( other.vda_ == NULL ) { return vda_ == NULL; } + if ( vda_ == nullptr ) { return other.vda_ == nullptr; } + if ( other.vda_ == nullptr ) { return vda_ == nullptr; } return ( vda_ == other.vda_ && cur_ == other.cur_ ); } @@ -108,7 +108,7 @@ class Iterator_adaptor_base void copy_from(const Self& other) { vda_ = other.vda_; value_ = other.value_; - if ( vda_ != NULL ) { + if ( vda_ != nullptr ) { cur_ = other.cur_; } } @@ -146,7 +146,7 @@ class Edge_iterator_adaptor friend class Iterator_adaptor_base; public: - Edge_iterator_adaptor(const VDA* vda = NULL) : Base(vda) {} + Edge_iterator_adaptor(const VDA* vda = nullptr) : Base(vda) {} Edge_iterator_adaptor(const VDA* vda, const Base_iterator& cur) : Base(vda, cur) {} @@ -227,7 +227,7 @@ private: friend class Iterator_adaptor_base; public: - Halfedge_iterator_adaptor(const VDA* vda = NULL) : Base(vda) {} + Halfedge_iterator_adaptor(const VDA* vda = nullptr) : Base(vda) {} Halfedge_iterator_adaptor(const VDA* vda, Base_iterator cur) : Base(vda, cur), is_first_(true) {} @@ -293,7 +293,7 @@ private: this->vda_ = other.vda_; this->value_ = other.value_; is_first_ = other.is_first_; - if ( this->vda_ != NULL ) { + if ( this->vda_ != nullptr ) { this->cur_ = other.cur_; } } @@ -327,7 +327,7 @@ class Face_iterator_adaptor friend class Iterator_adaptor_base; public: - Face_iterator_adaptor(const VDA* vda = NULL) : Base(vda) {} + Face_iterator_adaptor(const VDA* vda = nullptr) : Base(vda) {} Face_iterator_adaptor(const VDA* vda, const Base_iterator& cur) @@ -376,7 +376,7 @@ class Vertex_iterator_adaptor : friend class Iterator_adaptor_base; public: - Vertex_iterator_adaptor(const VDA* vda = NULL) : Base(vda) {} + Vertex_iterator_adaptor(const VDA* vda = nullptr) : Base(vda) {} Vertex_iterator_adaptor(const VDA* vda, const Base_iterator& cur) : Base(vda, cur) {} diff --git a/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Unbounded_edges.h b/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Unbounded_edges.h index 93dd9fe8dd6..f4e5262e3b0 100644 --- a/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Unbounded_edges.h +++ b/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Unbounded_edges.h @@ -46,7 +46,7 @@ class Bounded_edge_tester typedef typename VDA::Delaunay_graph::Face_handle Delaunay_face_handle; public: - Bounded_edge_tester(const VDA* vda = NULL) : vda_(vda) {} + Bounded_edge_tester(const VDA* vda = nullptr) : vda_(vda) {} bool operator()(const Base_iterator& it) const { if ( vda_->dual().dimension() < 2 ) { return false; } @@ -77,7 +77,7 @@ class Unbounded_edge_tester typedef typename VDA::Delaunay_graph::Face_handle Delaunay_face_handle; public: - Unbounded_edge_tester(const VDA* vda = NULL) : vda_(vda) {} + Unbounded_edge_tester(const VDA* vda = nullptr) : vda_(vda) {} bool operator()(const Base_iterator& it) const { if ( vda_->dual().dimension() < 2 ) { return true; } diff --git a/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Unbounded_faces.h b/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Unbounded_faces.h index f02a70ffef5..f1eb66ec66e 100644 --- a/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Unbounded_faces.h +++ b/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Unbounded_faces.h @@ -47,7 +47,7 @@ class Bounded_face_tester Delaunay_vertex_circulator; public: - Bounded_face_tester(const VDA* vda = NULL) : vda_(vda) {} + Bounded_face_tester(const VDA* vda = nullptr) : vda_(vda) {} bool operator()(const Base_iterator& it) const { if ( vda_->dual().dimension() < 2 ) { return false; } @@ -83,7 +83,7 @@ class Unbounded_face_tester Delaunay_vertex_circulator; public: - Unbounded_face_tester(const VDA* vda = NULL) : vda_(vda) {} + Unbounded_face_tester(const VDA* vda = nullptr) : vda_(vda) {} bool operator()(const Base_iterator& it) const { if ( vda_->dual().dimension() < 2 ) { return true; } diff --git a/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Validity_testers.h b/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Validity_testers.h index 659f991168b..42724034c7a 100644 --- a/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Validity_testers.h +++ b/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Validity_testers.h @@ -54,7 +54,7 @@ class Edge_validity_tester typedef typename VDA::Delaunay_graph::Vertex_handle Delaunay_vertex_handle; public: - Edge_validity_tester(const VDA* vda = NULL) : vda_(vda) {} + Edge_validity_tester(const VDA* vda = nullptr) : vda_(vda) {} bool operator()(const Edges_iterator_base& eit) const { CGAL_assertion( !vda_->edge_rejector()(vda_->dual(), eit->dual()) ); @@ -96,7 +96,7 @@ class Vertex_validity_tester Delaunay_faces_iterator; public: - Vertex_validity_tester(const VDA* vda = NULL) : vda_(vda) {} + Vertex_validity_tester(const VDA* vda = nullptr) : vda_(vda) {} bool operator()(const Delaunay_faces_iterator& fit) const { Delaunay_face_handle f(fit); diff --git a/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Vertex.h b/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Vertex.h index a9505086285..901d84b21e4 100644 --- a/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Vertex.h +++ b/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Vertex.h @@ -66,7 +66,7 @@ class Vertex // CONSTRUCTORS //------------- - Vertex(const VDA* vda = NULL) : vda_(vda) {} + Vertex(const VDA* vda = nullptr) : vda_(vda) {} Vertex(const VDA* vda, Delaunay_face_handle f) : vda_(vda), f_(f) { CGAL_precondition( !vda_->dual().is_infinite(f_) ); } @@ -183,7 +183,7 @@ class Vertex // VALIDITY TESTING //----------------- bool is_valid() const { - if ( vda_ == NULL ) { return true; } + if ( vda_ == nullptr ) { return true; } bool valid = !vda_->dual().is_infinite(f_); @@ -218,8 +218,8 @@ class Vertex // COMPARISON OPERATORS //--------------------- bool operator==(const Self& other) const { - if ( vda_ == NULL ) { return other.vda_ == NULL; } - if ( other.vda_ == NULL ) { return vda_ == NULL; } + if ( vda_ == nullptr ) { return other.vda_ == nullptr; } + if ( other.vda_ == nullptr ) { return vda_ == nullptr; } return ( vda_ == other.vda_ && f_ == other.f_ ); } @@ -228,8 +228,8 @@ class Vertex } bool operator<(const Self& other) const { - if ( vda_ == NULL ) { return other.vda_ != NULL; } - if ( other.vda_ == NULL ) { return false; } + if ( vda_ == nullptr ) { return other.vda_ != nullptr; } + if ( other.vda_ == nullptr ) { return false; } if ( vda_ != other.vda_ ) { return vda_ < other.vda_; } return f_ < other.f_; }
    C() -a circulator equal to `NULL` denoting an +a circulator equal to `nullptr` denoting an empty sequence.
    -a == NULL +a == nullptr Returns true if a denotes an empty sequence, false otherwise.
    -For simplicity, NULL == a is not required. The +For simplicity, nullptr == a is not required. The
    behavior for comparisons with pointer-like -values different than NULL +values different than nullptr
    is undefined. A runtime assertion is recommended.
    -a != NULL +a != nullptr -Returns !(a == NULL). +Returns !(a == nullptr).
    ++r diff --git a/Circulator/include/CGAL/Circulator/Circulator_adapters.h b/Circulator/include/CGAL/Circulator/Circulator_adapters.h index e3b6f3a0532..f4bd260d02b 100644 --- a/Circulator/include/CGAL/Circulator/Circulator_adapters.h +++ b/Circulator/include/CGAL/Circulator/Circulator_adapters.h @@ -68,12 +68,12 @@ public: // OPERATIONS - bool operator==( Nullptr_t p) const { - CGAL_assertion( p == NULL); + bool operator==( std::nullptr_t p) const { + CGAL_assertion( p == nullptr); CGAL_USE(p); - return this->_ptr == NULL; + return this->_ptr == nullptr; } - bool operator!=( Nullptr_t p) const { return !(*this == p); } + bool operator!=( std::nullptr_t p) const { return !(*this == p); } bool operator==( const Self& c) const { return this->_ptr == c._ptr; } bool operator!=( const Self& c) const { return !(*this == c); } reference operator*() const { return *(S*)this->_ptr;} @@ -112,12 +112,12 @@ public: // OPERATIONS - bool operator==( Nullptr_t p) const { - CGAL_assertion( p == NULL); + bool operator==( std::nullptr_t p) const { + CGAL_assertion( p == nullptr); CGAL_USE(p); - return this->_ptr == NULL; + return this->_ptr == nullptr; } - bool operator!=( Nullptr_t p) const { return !(*this == p); } + bool operator!=( std::nullptr_t p) const { return !(*this == p); } bool operator==( const Self& c) const { return this->_ptr == c._ptr; } bool operator!=( const Self& c) const { return !(*this == c); } reference operator*() const { return *(const S*)this->_ptr;} @@ -160,12 +160,12 @@ public: // OPERATIONS - bool operator==( Nullptr_t p) const { - CGAL_assertion( p == NULL); + bool operator==( std::nullptr_t p) const { + CGAL_assertion( p == nullptr); CGAL_USE(p); - return this->_ptr == NULL; + return this->_ptr == nullptr; } - bool operator!=( Nullptr_t p) const { return !(*this == p); } + bool operator!=( std::nullptr_t p) const { return !(*this == p); } bool operator==( const Self& c) const { return this->_ptr == c._ptr; } bool operator!=( const Self& c) const { return !(*this == c); } reference operator*() const { return *(S*)this->_ptr;} @@ -213,12 +213,12 @@ public: // OPERATIONS - bool operator==( Nullptr_t p) const { - CGAL_assertion( p == NULL); + bool operator==( std::nullptr_t p) const { + CGAL_assertion( p == nullptr); CGAL_USE(p); - return this->_ptr == NULL; + return this->_ptr == nullptr; } - bool operator!=( Nullptr_t p) const { return !(*this == p); } + bool operator!=( std::nullptr_t p) const { return !(*this == p); } bool operator==( const Self& c) const { return this->_ptr == c._ptr; } bool operator!=( const Self& c) const { return !(*this == c); } reference operator*() const { return *(const S*)this->_ptr;} @@ -273,12 +273,12 @@ public: // // OPERATIONS - bool operator==( Nullptr_t p) const { - CGAL_assertion( p == NULL); + bool operator==( std::nullptr_t p) const { + CGAL_assertion( p == nullptr); CGAL_USE(p); - return this->_ptr == NULL; + return this->_ptr == nullptr; } - bool operator!=( Nullptr_t p) const { return !(*this == p); } + bool operator!=( std::nullptr_t p) const { return !(*this == p); } bool operator==( const Self& c) const { return this->_ptr == c._ptr; } bool operator!=( const Self& c) const { return !(*this == c); } C& operator*() const { return *(C*)this->_ptr;} @@ -312,12 +312,12 @@ public: // OPERATIONS - bool operator==( Nullptr_t p) const { - CGAL_assertion( p == NULL); + bool operator==( std::nullptr_t p) const { + CGAL_assertion( p == nullptr); CGAL_USE(p); - return this->_ptr == NULL; + return this->_ptr == nullptr; } - bool operator!=( Nullptr_t p) const { return !(*this == p); } + bool operator!=( std::nullptr_t p) const { return !(*this == p); } bool operator==( const Self& c) const { return this->_ptr == c._ptr; } bool operator!=( const Self& c) const { return !(*this == c); } const C& operator*() const { return *(C*)this->_ptr;} @@ -350,12 +350,12 @@ public: // // OPERATIONS - bool operator==( Nullptr_t p) const { - CGAL_assertion( p == NULL); + bool operator==( std::nullptr_t p) const { + CGAL_assertion( p == nullptr); CGAL_USE(p); - return this->_ptr == NULL; + return this->_ptr == nullptr; } - bool operator!=( Nullptr_t p) const { return !(*this == p); } + bool operator!=( std::nullptr_t p) const { return !(*this == p); } bool operator==( const Self& c) const { return this->_ptr == c._ptr; } bool operator!=( const Self& c) const { return !(*this == c); } C& operator*() const { return *(C*)this->_ptr;} @@ -400,12 +400,12 @@ public: // // OPERATIONS - bool operator==( Nullptr_t p) const { - CGAL_assertion( p == NULL); + bool operator==( std::nullptr_t p) const { + CGAL_assertion( p == nullptr); CGAL_USE(p); - return this->_ptr == NULL; + return this->_ptr == nullptr; } - bool operator!=( Nullptr_t p) const { return !(*this == p); } + bool operator!=( std::nullptr_t p) const { return !(*this == p); } bool operator==( const Self& c) const { return this->_ptr == c._ptr; } bool operator!=( const Self& c) const { return !(*this == c); } const C& operator*() const { return *(C*)this->_ptr;} @@ -473,12 +473,12 @@ public: // OPERATIONS - bool operator==( Nullptr_t p) const { - CGAL_assertion( p == NULL); + bool operator==( std::nullptr_t p) const { + CGAL_assertion( p == nullptr); CGAL_USE(p); return _i >= _size; } - bool operator!=( Nullptr_t p) const { return !(*this == p); } + bool operator!=( std::nullptr_t p) const { return !(*this == p); } bool operator==( const Self& c) const { CGAL_assertion( this->_ptr == c._ptr); // belong to the same array? CGAL_assertion( _size == c._size); // same size when instantiated ? @@ -486,17 +486,17 @@ public: } bool operator!=( const Self& c) const { return !(*this == c); } T& operator*() const { - CGAL_assertion( this->_ptr != NULL); + CGAL_assertion( this->_ptr != nullptr); CGAL_assertion( _i < _size); return ((A*)this->_ptr)->operator[](_i); } T* operator->() const { - CGAL_assertion( this->_ptr != NULL); + CGAL_assertion( this->_ptr != nullptr); CGAL_assertion( _i < _size); return &(((A*)this->_ptr)->operator[](_i)); } Self& operator++() { - CGAL_assertion( this->_ptr != NULL); + CGAL_assertion( this->_ptr != nullptr); CGAL_assertion( _i < _size); ++ _i; if ( _i >= _size) @@ -509,7 +509,7 @@ public: return tmp; } Self& operator--() { - CGAL_assertion( this->_ptr != NULL); + CGAL_assertion( this->_ptr != nullptr); CGAL_assertion( _i < _size); if ( _i <= 0) _i = _size - 1; @@ -560,7 +560,7 @@ template < class A, class T, class U, class I> Circulator_over_array< A, T, U, I>& Circulator_over_array< A, T, U, I>:: operator+=( I n) { - CGAL_assertion( this->_ptr != NULL); + CGAL_assertion( this->_ptr != nullptr); CGAL_assertion( _i < _size); _i = non_negative_mod( (I)(_i) + n, _size); CGAL_assertion( _i < _size); @@ -598,12 +598,12 @@ public: // // OPERATIONS - bool operator==( Nullptr_t p) const { - CGAL_assertion( p == NULL); + bool operator==( std::nullptr_t p) const { + CGAL_assertion( p == nullptr); CGAL_USE(p); return _i >= _size; } - bool operator!=( Nullptr_t p) const { return !(*this == p); } + bool operator!=( std::nullptr_t p) const { return !(*this == p); } bool operator==( const Self& c) const { CGAL_assertion( this->_ptr == c._ptr); // belong to the same array? CGAL_assertion( _size == c._size); // same size when instantiated ? @@ -611,17 +611,17 @@ public: } bool operator!=( const Self& c) const { return !(*this == c); } const T& operator*() const { - CGAL_assertion( this->_ptr != NULL); + CGAL_assertion( this->_ptr != nullptr); CGAL_assertion( _i < _size); return ((const A*)this->_ptr)->operator[](_i); } const T* operator->() const { - CGAL_assertion( this->_ptr != NULL); + CGAL_assertion( this->_ptr != nullptr); CGAL_assertion( _i < _size); return &(((const A*)this->_ptr)->operator[](_i)); } Self& operator++() { - CGAL_assertion( this->_ptr != NULL); + CGAL_assertion( this->_ptr != nullptr); CGAL_assertion( _i < _size); ++ _i; if ( _i >= _size) @@ -634,7 +634,7 @@ public: return tmp; } Self& operator--() { - CGAL_assertion( this->_ptr != NULL); + CGAL_assertion( this->_ptr != nullptr); CGAL_assertion( _i < _size); if ( _i <= 0) _i = _size - 1; @@ -689,7 +689,7 @@ template < class A, class T, class U, class I> Const_circulator_over_array< A, T, U, I>& Const_circulator_over_array< A, T, U, I>:: operator+=( I n) { - CGAL_assertion( this->_ptr != NULL); + CGAL_assertion( this->_ptr != nullptr); CGAL_assertion( _i < _size); _i = non_negative_mod( (I)(_i) + n, _size); CGAL_assertion( _i < _size); diff --git a/Circulator/include/CGAL/Circulator/Circulator_concepts.h b/Circulator/include/CGAL/Circulator/Circulator_concepts.h index 59e4aeb5884..10b603e1c7c 100644 --- a/Circulator/include/CGAL/Circulator/Circulator_concepts.h +++ b/Circulator/include/CGAL/Circulator/Circulator_concepts.h @@ -72,8 +72,8 @@ struct ForwardCirculator BOOST_CONCEPT_ASSERT((boost::SignedInteger)) CGAL_UNUSED; BOOST_CONCEPT_ASSERT((boost::Convertible)) CGAL_UNUSED; - boost::require_boolean_expr(a == NULL); - boost::require_boolean_expr(a != NULL); + boost::require_boolean_expr(a == nullptr); + boost::require_boolean_expr(a != nullptr); ++a; a++; (void)*a; // suppress unused warning, don't check the return type diff --git a/Circulator/include/CGAL/Circulator/Safe_circulator_from_iterator.h b/Circulator/include/CGAL/Circulator/Safe_circulator_from_iterator.h index f349c6026b8..15bab0b4fc2 100644 --- a/Circulator/include/CGAL/Circulator/Safe_circulator_from_iterator.h +++ b/Circulator/include/CGAL/Circulator/Safe_circulator_from_iterator.h @@ -95,11 +95,11 @@ public: // // OPERATIONS - bool operator==( Nullptr_t p) const { - CGAL_assertion( p == NULL); + bool operator==( std::nullptr_t p) const { + CGAL_assertion( p == nullptr); return m_empty; } - bool operator!=( Nullptr_t p) const { return !(*this == p); } + bool operator!=( std::nullptr_t p) const { return !(*this == p); } bool operator==( const Self& c) const { diff --git a/Circulator/include/CGAL/circulator.h b/Circulator/include/CGAL/circulator.h index aa70e9785ed..3ccf53b5efe 100644 --- a/Circulator/include/CGAL/circulator.h +++ b/Circulator/include/CGAL/circulator.h @@ -312,7 +312,7 @@ void Assert_is_at_least_random_access_category( const IC& /*ic*/) { template< class C> inline bool I_is_empty_range( const C& c1, const C&, Circulator_tag){ - return c1 == NULL; + return c1 == nullptr; } template< class I> inline @@ -369,7 +369,7 @@ I_min_circulator_size( const C& c) { Assert_random_access_category(c); typedef typename C::size_type size_type; size_type n = 0; - if ( c != NULL) { + if ( c != nullptr) { n = (c-1) - c + 1; CGAL_assertion(n > 0); } @@ -380,7 +380,7 @@ template typename C::size_type I_circulator_size( const C& c, Forward_circulator_tag) { // Simply count. - if ( c == NULL) + if ( c == nullptr) return 0; typedef typename C::size_type size_type; size_type n = 0; @@ -413,7 +413,7 @@ template typename C::difference_type I_circulator_distance( C c, const C& d, Forward_circulator_tag) { // Simply count. - if ( c == NULL) + if ( c == nullptr) return 0; typedef typename C::difference_type difference_type; difference_type n = 0; @@ -552,18 +552,18 @@ public: return !(*this == i); } Ref operator*() const { - CGAL_assertion( m_anchor != NULL); - CGAL_assertion( current != NULL); + CGAL_assertion( m_anchor != nullptr); + CGAL_assertion( current != nullptr); return Ref(*current); } Ptr operator->() const { - CGAL_assertion( m_anchor != NULL); - CGAL_assertion( current != NULL); + CGAL_assertion( m_anchor != nullptr); + CGAL_assertion( current != nullptr); return Ptr(current.operator->()); } Self& operator++() { - CGAL_assertion( m_anchor != NULL); - CGAL_assertion( current != NULL); + CGAL_assertion( m_anchor != nullptr); + CGAL_assertion( current != nullptr); ++current; if ( current == *m_anchor) ++m_winding; @@ -575,8 +575,8 @@ public: return tmp; } Self& operator--() { - CGAL_assertion( m_anchor != NULL); - CGAL_assertion( current != NULL); + CGAL_assertion( m_anchor != nullptr); + CGAL_assertion( current != nullptr); if ( current == *m_anchor) --m_winding; --current; @@ -588,8 +588,8 @@ public: return tmp; } Self& operator+=( difference_type n) { - CGAL_assertion( m_anchor != NULL); - CGAL_assertion( current != NULL); + CGAL_assertion( m_anchor != nullptr); + CGAL_assertion( current != nullptr); if ( n < 0 && current == *m_anchor) // We are leaving the anchor. --m_winding; current += n; @@ -609,8 +609,8 @@ public: return tmp += -n; } difference_type operator-( const Self& i) const { - CGAL_assertion( m_anchor != NULL); - CGAL_assertion( current != NULL); + CGAL_assertion( m_anchor != nullptr); + CGAL_assertion( current != nullptr); CGAL_assertion( m_anchor == i.m_anchor); if ( m_winding != i.m_winding) { difference_type s = I_min_circulator_size( *m_anchor); @@ -626,8 +626,8 @@ public: return tmp.operator*(); } bool operator<( const Self& i) const { - CGAL_assertion( m_anchor != NULL); - CGAL_assertion( current != NULL); + CGAL_assertion( m_anchor != nullptr); + CGAL_assertion( current != nullptr); CGAL_assertion( m_anchor == i.m_anchor); return ( (m_winding < i.m_winding) || ( (m_winding == i.m_winding) @@ -698,12 +698,12 @@ typedef Iterator_from_circulator< C, const_reference, const_pointer> } iterator end() { // the past-the-end iterator. - return anchor == NULL ? iterator( &anchor, 0) + return anchor == nullptr ? iterator( &anchor, 0) : iterator( &anchor, 1); } const_iterator end() const { // the past-the-end const iterator. - return anchor == NULL ? const_iterator( &anchor, 0) + return anchor == nullptr ? const_iterator( &anchor, 0) : const_iterator( &anchor, 1); } }; @@ -730,32 +730,32 @@ private: public: // CREATION - Circulator_from_container() : ctnr(NULL) {} + Circulator_from_container() : ctnr(nullptr) {} Circulator_from_container( Container* c) : ctnr(c), i(c->begin()) {} Circulator_from_container( Container* c, iterator j) : ctnr(c), i(j) {} // OPERATIONS - bool operator==( Nullptr_t p) const { + bool operator==( std::nullptr_t p) const { CGAL_USE(p); - CGAL_assertion( p == NULL); - return (ctnr == NULL) || (ctnr->begin() == ctnr->end()); + CGAL_assertion( p == nullptr); + return (ctnr == nullptr) || (ctnr->begin() == ctnr->end()); } - bool operator!=( Nullptr_t p) const { return !(*this == p); } + bool operator!=( std::nullptr_t p) const { return !(*this == p); } bool operator==( const Self& c) const { return i == c.i; } bool operator!=( const Self& c) const { return !(*this == c); } reference operator*() const { - CGAL_assertion( ctnr != NULL); + CGAL_assertion( ctnr != nullptr); CGAL_assertion( i != ctnr->end()); return *i; } pointer operator->() const { - CGAL_assertion( ctnr != NULL); + CGAL_assertion( ctnr != nullptr); CGAL_assertion( i != ctnr->end()); return i.operator->(); } Self& operator++() { - CGAL_assertion( ctnr != NULL); + CGAL_assertion( ctnr != nullptr); CGAL_assertion( i != ctnr->end()); ++i; if ( i == ctnr->end()) @@ -768,7 +768,7 @@ public: return tmp; } Self& operator--() { - CGAL_assertion( ctnr != NULL); + CGAL_assertion( ctnr != nullptr); CGAL_assertion( i != ctnr->end()); if ( i == ctnr->begin()) i = ctnr->end(); @@ -781,7 +781,7 @@ public: return tmp; } Self& operator+=( difference_type n) { - CGAL_assertion( ctnr != NULL); + CGAL_assertion( ctnr != nullptr); CGAL_assertion( i != ctnr->end()); typename Container::difference_type j = i - ctnr->begin(); typename Container::difference_type size = ctnr->size(); @@ -803,8 +803,8 @@ public: return tmp += -n; } difference_type operator-( const Self& c) const { - CGAL_assertion( ctnr != NULL); - CGAL_assertion( c.ctnr != NULL); + CGAL_assertion( ctnr != nullptr); + CGAL_assertion( c.ctnr != nullptr); return i - c.i; } reference operator[]( difference_type n) const { @@ -853,7 +853,7 @@ private: public: // CREATION - Const_circulator_from_container() : ctnr(NULL) {} + Const_circulator_from_container() : ctnr(nullptr) {} Const_circulator_from_container( const Ctnr* c) : ctnr(c), i(c->begin()) {} Const_circulator_from_container( const Ctnr* c, const_iterator j) @@ -863,26 +863,26 @@ public: // OPERATIONS - bool operator==( Nullptr_t p) const { + bool operator==( std::nullptr_t p) const { CGAL_USE(p); - CGAL_assertion( p == NULL); - return (ctnr == NULL) || (ctnr->begin() == ctnr->end()); + CGAL_assertion( p == nullptr); + return (ctnr == nullptr) || (ctnr->begin() == ctnr->end()); } - bool operator!=( Nullptr_t p) const { return !(*this == p); } + bool operator!=( std::nullptr_t p) const { return !(*this == p); } bool operator==( const Self& c) const { return i == c.i; } bool operator!=( const Self& c) const { return !(*this == c); } reference operator*() const { - CGAL_assertion( ctnr != NULL); + CGAL_assertion( ctnr != nullptr); CGAL_assertion( i != ctnr->end()); return *i; } pointer operator->() const { - CGAL_assertion( ctnr != NULL); + CGAL_assertion( ctnr != nullptr); CGAL_assertion( i != ctnr->end()); return i.operator->(); } Self& operator++() { - CGAL_assertion( ctnr != NULL); + CGAL_assertion( ctnr != nullptr); CGAL_assertion( i != ctnr->end()); ++i; if ( i == ctnr->end()) @@ -895,7 +895,7 @@ public: return tmp; } Self& operator--() { - CGAL_assertion( ctnr != NULL); + CGAL_assertion( ctnr != nullptr); CGAL_assertion( i != ctnr->end()); if ( i == ctnr->begin()) i = ctnr->end(); @@ -908,7 +908,7 @@ public: return tmp; } Self& operator+=( difference_type n) { - CGAL_assertion( ctnr != NULL); + CGAL_assertion( ctnr != nullptr); CGAL_assertion( i != ctnr->end()); typename Ctnr::difference_type j = i - ctnr->begin(); typename Ctnr::difference_type size = ctnr->size(); @@ -930,8 +930,8 @@ public: return tmp += -n; } difference_type operator-( const Self& c) const { - CGAL_assertion( ctnr != NULL); - CGAL_assertion( c.ctnr != NULL); + CGAL_assertion( ctnr != nullptr); + CGAL_assertion( c.ctnr != nullptr); return i - c.i; } reference operator[]( difference_type n) const { @@ -1016,12 +1016,12 @@ public: // // OPERATIONS - bool operator==( Nullptr_t p) const { + bool operator==( std::nullptr_t p) const { CGAL_USE(p); - CGAL_assertion( p == NULL); + CGAL_assertion( p == nullptr); return empty; } - bool operator!=( Nullptr_t p) const { return !(*this == p); } + bool operator!=( std::nullptr_t p) const { return !(*this == p); } bool operator==( const Self& c) const { return current == c.current;} bool operator!=( const Self& c) const { return !(*this == c); } reference operator*() const { diff --git a/Circulator/include/CGAL/circulator_bases.h b/Circulator/include/CGAL/circulator_bases.h index ea1722e2d92..caf0f93f856 100644 --- a/Circulator/include/CGAL/circulator_bases.h +++ b/Circulator/include/CGAL/circulator_bases.h @@ -95,7 +95,7 @@ class Forward_circulator_ptrbase // forward circulator. typedef Size size_type; typedef T* pointer; typedef T& reference; - Forward_circulator_ptrbase() : _ptr(NULL) {} + Forward_circulator_ptrbase() : _ptr(nullptr) {} Forward_circulator_ptrbase(void* p) : _ptr(p) {} }; template @@ -110,7 +110,7 @@ class Bidirectional_circulator_ptrbase // bidirectional circulator. typedef Size size_type; typedef T* pointer; typedef T& reference; - Bidirectional_circulator_ptrbase() : _ptr(NULL) {} + Bidirectional_circulator_ptrbase() : _ptr(nullptr) {} Bidirectional_circulator_ptrbase(void* p) : _ptr(p) {} }; template @@ -125,7 +125,7 @@ class Random_access_circulator_ptrbase // random access circulator. typedef Size size_type; typedef T* pointer; typedef T& reference; - Random_access_circulator_ptrbase() : _ptr(NULL) {} + Random_access_circulator_ptrbase() : _ptr(nullptr) {} Random_access_circulator_ptrbase(void* p) : _ptr(p) {} }; diff --git a/Classification/include/CGAL/Classification/Cluster.h b/Classification/include/CGAL/Classification/Cluster.h index 046412885b5..46d0d49857b 100644 --- a/Classification/include/CGAL/Classification/Cluster.h +++ b/Classification/include/CGAL/Classification/Cluster.h @@ -63,17 +63,17 @@ public: template OutputIterator operator() (const Cluster& cluster, OutputIterator output) const { - return std::copy (cluster.neighbors.begin(), cluster.neighbors.end(), output); + return std::copy (cluster.neighbors->begin(), cluster.neighbors->end(), output); } }; - std::vector neighbors; + std::shared_ptr > neighbors; /// \endcond private: const ItemRange* m_range; ItemMap m_item_map; - std::vector m_inliers; + std::shared_ptr > m_inliers; mutable CGAL::Bbox_3 m_bounding_box; int m_training; int m_label; @@ -92,7 +92,9 @@ public: \param item_map property map to access the input items. */ Cluster (const ItemRange& range, ItemMap item_map) - : m_range (&range), m_item_map (item_map) + : neighbors (new std::vector()) + , m_range (&range), m_item_map (item_map) + , m_inliers (new std::vector()) , m_training(-1), m_label(-1) { } @@ -104,12 +106,12 @@ public: /*! \brief Clears the cluster. */ - void clear () { m_inliers.clear(); } + void clear () { m_inliers->clear(); } /*! \brief Inserts element of index `idx` in the cluster. */ - void insert (std::size_t idx) { m_inliers.push_back (idx); } + void insert (std::size_t idx) { m_inliers->push_back (idx); } /// @} @@ -119,35 +121,33 @@ public: /*! \brief Returns the number of items in the cluster. */ - std::size_t size() const { return m_inliers.size(); } + std::size_t size() const { return m_inliers->size(); } /*! \brief Returns the index (in the input range) of the i^{th} element of the cluster. */ - std::size_t index (std::size_t i) const { return m_inliers[i]; } + std::size_t index (std::size_t i) const { return (*m_inliers)[i]; } /*! \brief Returns the i^{th} item of the cluster. */ const Item& operator[] (std::size_t i) const - { return get (m_item_map, *(m_range->begin() + m_inliers[i])); } + { return get (m_item_map, *(m_range->begin() + (*m_inliers)[i])); } /*! \brief Returns the bounding box of the cluster. */ - CGAL::Bbox_3 bbox() const + const CGAL::Bbox_3& bbox() const { + auto transform = [&](const std::size_t& idx) -> typename ItemMap::reference + { + return get (m_item_map, *(m_range->begin() + idx)); + }; + if (m_bounding_box == CGAL::Bbox_3()) - { - m_bounding_box - = CGAL::bbox_3 (boost::make_transform_iterator - (m_range->begin(), - CGAL::Property_map_to_unary_function(m_item_map)), - boost::make_transform_iterator - (m_range->end(), - CGAL::Property_map_to_unary_function(m_item_map))); + m_bounding_box = CGAL::bbox_3 (boost::make_transform_iterator (m_inliers->begin(), transform), + boost::make_transform_iterator (m_inliers->end(), transform)); - } return m_bounding_box; } @@ -219,7 +219,11 @@ std::size_t create_clusters_from_indices (const ItemRange& range, if (c == -1) continue; if (std::size_t(c) >= clusters.size()) - clusters.resize (c + 1, Cluster(range, item_map)); + { + clusters.reserve (c + 1); + for (std::size_t i = clusters.size(); i <= std::size_t(c); ++ i) + clusters.push_back (Cluster(range, item_map)); + } clusters[std::size_t(c)].insert (idx); } diff --git a/Classification/include/CGAL/Classification/ETHZ/Random_forest_classifier.h b/Classification/include/CGAL/Classification/ETHZ/Random_forest_classifier.h index e0910e57275..b1a7797db4a 100644 --- a/Classification/include/CGAL/Classification/ETHZ/Random_forest_classifier.h +++ b/Classification/include/CGAL/Classification/ETHZ/Random_forest_classifier.h @@ -93,7 +93,7 @@ public: */ Random_forest_classifier (const Label_set& labels, const Feature_set& features) - : m_labels (labels), m_features (features), m_rfc (NULL) + : m_labels (labels), m_features (features), m_rfc (nullptr) { } /*! @@ -109,7 +109,7 @@ public: */ Random_forest_classifier (const Random_forest_classifier& other, const Feature_set& features) - : m_labels (other.m_labels), m_features (features), m_rfc (NULL) + : m_labels (other.m_labels), m_features (features), m_rfc (nullptr) { std::stringstream stream; other.save_configuration(stream); @@ -119,7 +119,7 @@ public: /// \cond SKIP_IN_MANUAL ~Random_forest_classifier () { - if (m_rfc != NULL) + if (m_rfc != nullptr) delete m_rfc; } /// \endcond @@ -209,13 +209,13 @@ public: CGAL::internal::liblearning::DataView2D label_vector (&(gt[0]), gt.size(), 1); CGAL::internal::liblearning::DataView2D feature_vector(&(ft[0]), gt.size(), ft.size() / gt.size()); - if (m_rfc != NULL && reset_trees) + if (m_rfc != nullptr && reset_trees) { delete m_rfc; - m_rfc = NULL; + m_rfc = nullptr; } - if (m_rfc == NULL) + if (m_rfc == nullptr) m_rfc = new Forest (params); CGAL::internal::liblearning::RandomForest::AxisAlignedRandomSplitGenerator generator; @@ -314,7 +314,7 @@ public: void load_configuration (std::istream& input) { CGAL::internal::liblearning::RandomForest::ForestParams params; - if (m_rfc != NULL) + if (m_rfc != nullptr) delete m_rfc; m_rfc = new Forest (params); diff --git a/Classification/include/CGAL/Classification/ETHZ/internal/random-forest/forest.hpp b/Classification/include/CGAL/Classification/ETHZ/internal/random-forest/forest.hpp index db51011e714..ce6695b8624 100644 --- a/Classification/include/CGAL/Classification/ETHZ/internal/random-forest/forest.hpp +++ b/Classification/include/CGAL/Classification/ETHZ/internal/random-forest/forest.hpp @@ -45,7 +45,7 @@ #include #endif -#include +#include #include @@ -113,7 +113,7 @@ public: std::vector in_bag_samples = sample_idxes; // Bagging: draw random sample indexes used for this tree - std::random_shuffle (in_bag_samples.begin(),in_bag_samples.end()); + CGAL::cpp98::random_shuffle (in_bag_samples.begin(),in_bag_samples.end()); // Train the tree trees[i_tree].train(samples, labels, &in_bag_samples[0], n_in_bag_samples, split_generator, gen); diff --git a/Classification/include/CGAL/Classification/Feature/Verticality.h b/Classification/include/CGAL/Classification/Feature/Verticality.h index ee9e2cb16b6..8bfb13297bf 100644 --- a/Classification/include/CGAL/Classification/Feature/Verticality.h +++ b/Classification/include/CGAL/Classification/Feature/Verticality.h @@ -87,7 +87,7 @@ public: template Verticality (const PointRange& input, VectorMap normal_map) - : vertical (0., 0., 1.), eigen(NULL) + : vertical (0., 0., 1.), eigen(nullptr) { this->set_name ("verticality"); for (std::size_t i = 0; i < input.size(); i++) @@ -102,7 +102,7 @@ public: /// \cond SKIP_IN_MANUAL virtual float value (std::size_t pt_index) { - if (eigen != NULL) + if (eigen != nullptr) { typename GeomTraits::Vector_3 normal = eigen->normal_vector(pt_index); normal = normal / CGAL::sqrt (normal * normal); diff --git a/Classification/include/CGAL/Classification/Feature_set.h b/Classification/include/CGAL/Classification/Feature_set.h index 1aa73fabdf2..f473f593a27 100644 --- a/Classification/include/CGAL/Classification/Feature_set.h +++ b/Classification/include/CGAL/Classification/Feature_set.h @@ -76,7 +76,7 @@ public: */ Feature_set() #ifdef CGAL_LINKED_WITH_TBB - : m_tasks(NULL) + : m_tasks(nullptr) #endif { } @@ -86,7 +86,7 @@ public: virtual ~Feature_set() { #ifdef CGAL_LINKED_WITH_TBB - if (m_tasks != NULL) + if (m_tasks != nullptr) delete m_tasks; for (std::size_t i = 0; i < m_adders.size(); ++ i) delete m_adders[i]; @@ -122,7 +122,7 @@ public: Feature_handle add (T&& ... t) { #ifdef CGAL_LINKED_WITH_TBB - if (m_tasks != NULL) + if (m_tasks != nullptr) { m_features.push_back (Feature_handle()); @@ -145,7 +145,7 @@ public: Feature_handle add_with_scale_id (std::size_t i, T&& ... t) { #ifdef CGAL_LINKED_WITH_TBB - if (m_tasks != NULL) + if (m_tasks != nullptr) { m_features.push_back (Feature_handle()); @@ -241,7 +241,7 @@ public: { m_tasks->wait(); delete m_tasks; - m_tasks = NULL; + m_tasks = nullptr; for (std::size_t i = 0; i < m_adders.size(); ++ i) delete m_adders[i]; diff --git a/Classification/include/CGAL/Classification/Image.h b/Classification/include/CGAL/Classification/Image.h index ffaf0796081..9f4a5c493fd 100644 --- a/Classification/include/CGAL/Classification/Image.h +++ b/Classification/include/CGAL/Classification/Image.h @@ -54,7 +54,7 @@ class Image public: - Image () : m_width(0), m_height(0), m_depth(0), m_raw (NULL) + Image () : m_width(0), m_height(0), m_depth(0), m_raw (nullptr) { } diff --git a/Classification/include/CGAL/Classification/Local_eigen_analysis.h b/Classification/include/CGAL/Classification/Local_eigen_analysis.h index 17b4cd85f30..a35a22cf43d 100644 --- a/Classification/include/CGAL/Classification/Local_eigen_analysis.h +++ b/Classification/include/CGAL/Classification/Local_eigen_analysis.h @@ -632,7 +632,7 @@ private: triangles.end(), Kernel(), CGAL::Dimension_tag<2>()); CGAL::internal::assemble_covariance_matrix_3 (triangles.begin(), triangles.end(), covariance, - c, Kernel(), (Triangle*)NULL, CGAL::Dimension_tag<2>(), + c, Kernel(), (Triangle*)nullptr, CGAL::Dimension_tag<2>(), DiagonalizeTraits()); m_content->centroids[get(get(CGAL::face_index,g), query)] = {{ float(c.x()), float(c.y()), float(c.z()) }}; diff --git a/Classification/include/CGAL/Classification/Mesh_feature_generator.h b/Classification/include/CGAL/Classification/Mesh_feature_generator.h index 6212b4d0aff..26dc017ed60 100644 --- a/Classification/include/CGAL/Classification/Mesh_feature_generator.h +++ b/Classification/include/CGAL/Classification/Mesh_feature_generator.h @@ -168,7 +168,7 @@ private: PointMap point_map, const Iso_cuboid_3& bbox, float voxel_size, std::size_t nb_scale, - Planimetric_grid* lower_grid = NULL) + Planimetric_grid* lower_grid = nullptr) : voxel_size (voxel_size) { CGAL::Real_timer t; @@ -194,7 +194,7 @@ private: t.reset(); t.start(); - if (lower_grid == NULL) + if (lower_grid == nullptr) grid = new Planimetric_grid (range, point_map, bbox, this->voxel_size); else grid = new Planimetric_grid(lower_grid); @@ -204,9 +204,9 @@ private: } ~Scale() { - if (neighborhood != NULL) + if (neighborhood != nullptr) delete neighborhood; - if (grid != NULL) + if (grid != nullptr) delete grid; delete eigen; } @@ -214,11 +214,11 @@ private: void reduce_memory_footprint(bool delete_neighborhood) { delete grid; - grid = NULL; + grid = nullptr; if (delete_neighborhood) { delete neighborhood; - neighborhood = NULL; + neighborhood = nullptr; } } diff --git a/Classification/include/CGAL/Classification/Mesh_neighborhood.h b/Classification/include/CGAL/Classification/Mesh_neighborhood.h index cc0bdd3d029..86ba83dcc74 100644 --- a/Classification/include/CGAL/Classification/Mesh_neighborhood.h +++ b/Classification/include/CGAL/Classification/Mesh_neighborhood.h @@ -69,7 +69,7 @@ private: Set* m_set; public: - Is_face_selected(Set* set = NULL) : m_set (set) { } + Is_face_selected(Set* set = nullptr) : m_set (set) { } inline friend value_type get (const Is_face_selected& pm, const key_type& k) { diff --git a/Classification/include/CGAL/Classification/OpenCV/Random_forest_classifier.h b/Classification/include/CGAL/Classification/OpenCV/Random_forest_classifier.h index b68173e1b14..816c039aa1b 100644 --- a/Classification/include/CGAL/Classification/OpenCV/Random_forest_classifier.h +++ b/Classification/include/CGAL/Classification/OpenCV/Random_forest_classifier.h @@ -95,7 +95,7 @@ public: m_max_number_of_trees_in_the_forest (max_number_of_trees_in_the_forest), m_forest_accuracy (forest_accuracy) #if (CV_MAJOR_VERSION < 3) - , rtree (NULL) + , rtree (nullptr) #endif { } @@ -103,7 +103,7 @@ public: ~Random_forest_classifier () { #if (CV_MAJOR_VERSION < 3) - if (rtree != NULL) + if (rtree != nullptr) delete rtree; #endif } @@ -147,7 +147,7 @@ public: void train (const LabelIndexRange& ground_truth) { #if (CV_MAJOR_VERSION < 3) - if (rtree != NULL) + if (rtree != nullptr) delete rtree; #endif @@ -286,7 +286,7 @@ public: void load_configuration (const char* filename) { #if (CV_MAJOR_VERSION < 3) - if (rtree != NULL) + if (rtree != nullptr) delete rtree; rtree = new CvRTrees; rtree->load(filename); diff --git a/Classification/include/CGAL/Classification/Planimetric_grid.h b/Classification/include/CGAL/Classification/Planimetric_grid.h index 33e0d141928..52eece96ae9 100644 --- a/Classification/include/CGAL/Classification/Planimetric_grid.h +++ b/Classification/include/CGAL/Classification/Planimetric_grid.h @@ -215,7 +215,7 @@ public: const Iso_cuboid_3& bbox, float grid_resolution) : m_points (&input), m_point_map (point_map) - , m_bbox (bbox), m_resolution (grid_resolution), m_lower_scale(NULL), m_current_scale(0) + , m_bbox (bbox), m_resolution (grid_resolution), m_lower_scale(nullptr), m_current_scale(0) { m_width = (std::size_t)((bbox.xmax() - bbox.xmin()) / grid_resolution) + 1; m_height = (std::size_t)((bbox.ymax() - bbox.ymin()) / grid_resolution) + 1; @@ -349,7 +349,7 @@ public: */ std::size_t x(std::size_t index) const { - if (m_lower_scale == NULL) + if (m_lower_scale == nullptr) { const Point_3& p = get(m_point_map, *(m_points->begin()+index)); return (std::size_t)((p.x() - m_bbox.xmin()) / m_resolution); @@ -363,7 +363,7 @@ public: */ std::size_t y(std::size_t index) const { - if (m_lower_scale == NULL) + if (m_lower_scale == nullptr) { const Point_3& p = get(m_point_map, *(m_points->begin()+index)); return (std::size_t)((p.y() - m_bbox.ymin()) / m_resolution); diff --git a/Classification/include/CGAL/Classification/Point_set_feature_generator.h b/Classification/include/CGAL/Classification/Point_set_feature_generator.h index 478de14227e..8459886021e 100644 --- a/Classification/include/CGAL/Classification/Point_set_feature_generator.h +++ b/Classification/include/CGAL/Classification/Point_set_feature_generator.h @@ -166,18 +166,18 @@ private: Scale (const PointRange& input, PointMap point_map, const Iso_cuboid_3& bbox, float voxel_size, - Planimetric_grid* lower_grid = NULL) + Planimetric_grid* lower_grid = nullptr) : voxel_size (voxel_size) { CGAL::Real_timer t; t.start(); - if (lower_grid == NULL) + if (lower_grid == nullptr) neighborhood = new Neighborhood (input, point_map); else neighborhood = new Neighborhood (input, point_map, voxel_size); t.stop(); - if (lower_grid == NULL) + if (lower_grid == nullptr) CGAL_CLASSIFICATION_CERR << "Neighborhood computed in " << t.time() << " second(s)" << std::endl; else CGAL_CLASSIFICATION_CERR << "Neighborhood with voxel size " << voxel_size @@ -198,7 +198,7 @@ private: t.reset(); t.start(); - if (lower_grid == NULL) + if (lower_grid == nullptr) grid = new Planimetric_grid (input, point_map, bbox, this->voxel_size); else grid = new Planimetric_grid(lower_grid); @@ -208,9 +208,9 @@ private: } ~Scale() { - if (neighborhood != NULL) + if (neighborhood != nullptr) delete neighborhood; - if (grid != NULL) + if (grid != nullptr) delete grid; delete eigen; } @@ -218,11 +218,11 @@ private: void reduce_memory_footprint(bool delete_neighborhood) { delete grid; - grid = NULL; + grid = nullptr; if (delete_neighborhood) { delete neighborhood; - neighborhood = NULL; + neighborhood = nullptr; } } diff --git a/Classification/include/CGAL/Classification/Point_set_neighborhood.h b/Classification/include/CGAL/Classification/Point_set_neighborhood.h index 6e1bb77ac3b..a69fd8bbe40 100644 --- a/Classification/include/CGAL/Classification/Point_set_neighborhood.h +++ b/Classification/include/CGAL/Classification/Point_set_neighborhood.h @@ -173,7 +173,7 @@ public: friend class K_neighbor_query; friend class Sphere_neighbor_query; - Point_set_neighborhood () : m_tree (NULL) { } + Point_set_neighborhood () : m_tree (nullptr) { } /// \endcond /// \name Constructors @@ -187,7 +187,7 @@ public: */ Point_set_neighborhood (const PointRange& input, PointMap point_map) - : m_tree (NULL) + : m_tree (nullptr) { My_point_property_map pmap (&input, point_map); m_tree = new Tree (boost::counting_iterator (0), @@ -213,7 +213,7 @@ public: Point_set_neighborhood (const PointRange& input, PointMap point_map, float voxel_size) - : m_tree (NULL) + : m_tree (nullptr) { // First, simplify std::vector indices; @@ -232,7 +232,7 @@ public: /// \cond SKIP_IN_MANUAL ~Point_set_neighborhood () { - if (m_tree != NULL) + if (m_tree != nullptr) delete m_tree; } /// \endcond @@ -263,7 +263,7 @@ private: template void sphere_neighbors (const Point& query, const FT radius_neighbors, OutputIterator output) const { - CGAL_assertion (m_tree != NULL); + CGAL_assertion (m_tree != nullptr); Sphere fs (query, radius_neighbors, 0, m_tree->traits()); m_tree->search (output, fs); } @@ -271,7 +271,7 @@ private: template void k_neighbors (const Point& query, const unsigned int k, OutputIterator output) const { - CGAL_assertion (m_tree != NULL); + CGAL_assertion (m_tree != nullptr); Knn search (*m_tree, query, k, 0, true, m_distance); for (typename Knn::iterator it = search.begin(); it != search.end(); ++ it) *(output ++) = it->first; diff --git a/Classification/include/CGAL/Classification/TensorFlow/Neural_network_classifier.h b/Classification/include/CGAL/Classification/TensorFlow/Neural_network_classifier.h index 2627251b3bd..e9649d5b801 100644 --- a/Classification/include/CGAL/Classification/TensorFlow/Neural_network_classifier.h +++ b/Classification/include/CGAL/Classification/TensorFlow/Neural_network_classifier.h @@ -128,7 +128,7 @@ public: Neural_network_classifier (const Label_set& labels, const Feature_set& features) : m_verbose (true), m_labels (labels), m_features (features) - , m_root (NULL), m_ph_ft (NULL), m_ph_gt (NULL), m_loss(NULL), m_session (NULL) + , m_root (nullptr), m_ph_ft (nullptr), m_ph_gt (nullptr), m_loss(nullptr), m_session (nullptr) { } /// \cond SKIP_IN_MANUAL @@ -137,7 +137,7 @@ public: clear(); } - bool initialized() const { return (m_root != NULL); } + bool initialized() const { return (m_root != nullptr); } bool& verbose() { return m_verbose; } @@ -157,9 +157,9 @@ public: template void clear (T* t) { - if (t != NULL) + if (t != nullptr) delete t; - t = NULL; + t = nullptr; } void compute_normalization_coefficients (const std::vector& indices) diff --git a/Classification/include/CGAL/Classification/property_maps.h b/Classification/include/CGAL/Classification/property_maps.h index 16a437dcd9a..60b07ceafe6 100644 --- a/Classification/include/CGAL/Classification/property_maps.h +++ b/Classification/include/CGAL/Classification/property_maps.h @@ -69,7 +69,7 @@ private: public: Face_descriptor_to_center_of_mass_map () - : m_mesh (NULL) { } + : m_mesh (nullptr) { } Face_descriptor_to_center_of_mass_map (const FaceGraph* mesh) : m_mesh (mesh), m_vpm (get (vertex_point, *m_mesh)) { } Face_descriptor_to_center_of_mass_map (const FaceGraph* mesh, VertexPointMap vpm) @@ -141,7 +141,7 @@ private: public: Face_descriptor_to_face_descriptor_with_bbox_map () - : m_mesh (NULL) { } + : m_mesh (nullptr) { } Face_descriptor_to_face_descriptor_with_bbox_map (const FaceGraph* mesh) : m_mesh (mesh), m_vpm (get (vertex_point, *m_mesh)) { } Face_descriptor_to_face_descriptor_with_bbox_map (const FaceGraph* mesh, VertexPointMap vpm) diff --git a/Combinatorial_map/doc/Combinatorial_map/Combinatorial_map.txt b/Combinatorial_map/doc/Combinatorial_map/Combinatorial_map.txt index 31a7ba36d91..b10320e57c0 100644 --- a/Combinatorial_map/doc/Combinatorial_map/Combinatorial_map.txt +++ b/Combinatorial_map/doc/Combinatorial_map/Combinatorial_map.txt @@ -315,14 +315,14 @@ Linking two darts d1 and d2 by \f$ \beta_i\f$, with 2 \f$ \leq \f$ Reciprocally, unlinking a given dart d0 by \f$ \beta_i\f$, with 2 \f$ \leq \f$ i \f$ \leq \f$ d, consists in modifying two \f$ \beta_i\f$ pointers such that \f$ \beta_i\f$(\f$ \beta_i\f$(d0))=\f$ \varnothing\f$ and \f$ \beta_i\f$(d0)=\f$ \varnothing\f$. For i=1, the modification is \f$ \beta_1\f$(d0)=\f$ \varnothing\f$ (and thus \f$ \beta_0\f$(\f$ \beta_1\f$(d0))=\f$ \varnothing\f$ by definition of \f$ \beta_0\f$). Note that is it possible to unlink a given dart for \f$ \beta_i\f$ only if it is not i-free. \cgalFigureBegin{fig_cmap_example_3d_sew,cmap_example_3d_sew.svg} -Example of 3-sew operation. Left: A 3D combinatorial map containing two volumes that are not connected, with 2-attributes. Each attribute contains a color in RGB format, and there are four 2-cells associated with attributes. Associations between darts and attributes are drawn with red segments. Right: The 3D combinatorial map obtained as result of \link CombinatorialMap::sew `sew<3>(1,5)`\endlink (or \link CombinatorialMap::sew `sew<3>(2,8)`\endlink, or \link CombinatorialMap::sew `sew<3>(3,7)`\endlink, or \link CombinatorialMap::sew `sew<3>(4,6)`\endlink). Darts (1,5), (2,8), (3,7) and (4,6) are linked together by \f$ \beta_3\f$. The two 2-cells c1={1,2,3,4} and c2={5,6,7,8} are merged after the sew into the 2-cell {1,2,3,4,5,6,7,8}. We are in the case where the two attributes are non NULL, thus the first one is kept, and all the darts of c2 are associated with the first attribute. +Example of 3-sew operation. Left: A 3D combinatorial map containing two volumes that are not connected, with 2-attributes. Each attribute contains a color in RGB format, and there are four 2-cells associated with attributes. Associations between darts and attributes are drawn with red segments. Right: The 3D combinatorial map obtained as result of \link CombinatorialMap::sew `sew<3>(1,5)`\endlink (or \link CombinatorialMap::sew `sew<3>(2,8)`\endlink, or \link CombinatorialMap::sew `sew<3>(3,7)`\endlink, or \link CombinatorialMap::sew `sew<3>(4,6)`\endlink). Darts (1,5), (2,8), (3,7) and (4,6) are linked together by \f$ \beta_3\f$. The two 2-cells c1={1,2,3,4} and c2={5,6,7,8} are merged after the sew into the 2-cell {1,2,3,4,5,6,7,8}. We are in the case where the two attributes are non `nullptr`, thus the first one is kept, and all the darts of c2 are associated with the first attribute. \cgalFigureEnd The \link CombinatorialMap::sew `sew(dh1,dh2)`\endlink method consists mainly to link two by two several darts by \f$ \beta_i\f$. This operation is possible only if there is a bijection f between all the darts of the orbit D1=\f$ \langle{}\f$\f$ \beta_1\f$,...,\f$ \beta_{i-2}\f$,\f$ \beta_{i+2}\f$,...,\f$ \beta_d\f$\f$ \rangle{}\f$(d1) and D2=\f$ \langle{}\f$\f$ \beta_1\f$,...,\f$ \beta_{i-2}\f$,\f$ \beta_{i+2}\f$,..., \f$ \beta_d\f$\f$ \rangle{}\f$(d2) satisfying: f(d1)=d2, and for all e\f$ \in \f$ D1, for all j\f$ \in \f${1,..., i-2,i+2,...,d}, f(\f$ \beta_j\f$(e))=\f$ \beta_j^{-1}\f$(f(e)). Intuitively, this condition ensures the validity of the combinatorial map by verifying that condition discussed in Section \ref sseccombimapvalidity "Combinatorial Map Properties" will be satisfied after the operation. This condition can be tested by using the method \link CombinatorialMap::is_sewable `is_sewable(dh1,dh2)`\endlink. For example, the function \link CombinatorialMap::is_sewable `is_sewable<3>`\endlink would return `false` if we tried to 3-sew a triangular facet with a quad facet. Note that given two darts d1 and d2, if there is such a bijection, it is uniquely defined. So giving the two darts as arguments of the \link CombinatorialMap::sew `sew`\endlink is enough to retrieve all the pairs of darts to link. If such a bijection exists, the \link CombinatorialMap::sew `sew(dh1,dh2)`\endlink operation consists only in linking by \f$ \beta_i\f$ each couple of darts d3 and d4 such that d3=f(d4). -In addition, the sew operation updates the associations between darts and non void attributes in order to guarantee that all the darts belonging to a given cell are associated with the same attribute (which is a condition of combinatorial map validity). For each couple of j-cells c1 and c2 that are merged into one j-cell during the sew, we have to update the two associated attributes attr1 and attr2. If both are NULL, there is nothing to do. If one is NULL and the other not, we only associate the non NULL attribute to all the darts of the resulting cell. When the two attributes are non NULL, we first apply functor \link CellAttribute::On_merge `On_merge`\endlink on the two attributes attr1 and attr2 (see Section \ref ssecattributes "Cell Attributes"). Then, we associate the attribute attr1 to all darts of the resulting j-cell. Finally, attribute attr2 is removed from the combinatorial map. +In addition, the sew operation updates the associations between darts and non void attributes in order to guarantee that all the darts belonging to a given cell are associated with the same attribute (which is a condition of combinatorial map validity). For each couple of j-cells c1 and c2 that are merged into one j-cell during the sew, we have to update the two associated attributes attr1 and attr2. If both are `nullptr`, there is nothing to do. If one is `nullptr` and the other not, we only associate the non `nullptr` attribute to all the darts of the resulting cell. When the two attributes are non `nullptr`, we first apply functor \link CellAttribute::On_merge `On_merge`\endlink on the two attributes attr1 and attr2 (see Section \ref ssecattributes "Cell Attributes"). Then, we associate the attribute attr1 to all darts of the resulting j-cell. Finally, attribute attr2 is removed from the combinatorial map. -Note that when the two attributes are non NULL, the first one is kept. But user can customize this behavior in order to update the information contained in the attributes according to its needs. For that, we can define a specific functor, and use it as template argument for \link CellAttribute::On_merge `On_merge`\endlink parameter of the `Cell_attribute` definition. This functor can for example copy the information of the second attribute in the information of the first one to make as if the second attribute is kept. +Note that when the two attributes are non `nullptr`, the first one is kept. But user can customize this behavior in order to update the information contained in the attributes according to its needs. For that, we can define a specific functor, and use it as template argument for \link CellAttribute::On_merge `On_merge`\endlink parameter of the `Cell_attribute` definition. This functor can for example copy the information of the second attribute in the information of the first one to make as if the second attribute is kept. For example, in \cgalFigureRef{fig_cmap_example_3d_sew}, we want to 3-sew the two initial volumes. \link CombinatorialMap::sew `sew<3>(1,5)`\endlink links by \f$ \beta_3\f$ the pairs of darts (1,5), (2,8), (3,7) and (4,6), thus the combinatorial map obtained is valid. 2-attributes are updated so that all the darts belonging to the 2-cell containing dart 1 become associated to the same 2-attribute after the operation. diff --git a/Combinatorial_map/doc/Combinatorial_map/Concepts/CellAttribute.h b/Combinatorial_map/doc/Combinatorial_map/Concepts/CellAttribute.h index 60f652996dd..f1fe0e64b7c 100644 --- a/Combinatorial_map/doc/Combinatorial_map/Concepts/CellAttribute.h +++ b/Combinatorial_map/doc/Combinatorial_map/Concepts/CellAttribute.h @@ -69,12 +69,12 @@ Cell_attribute(const Info& info); /// @{ /*! -Returns one dart of the cell associated to this attribute. `NULL` if \link Supports_cell_dart `Supports_cell_dart`\endlink is equal to \link CGAL::Tag_false `Tag_false`\endlink. +Returns one dart of the cell associated to this attribute. `nullptr` if \link Supports_cell_dart `Supports_cell_dart`\endlink is equal to \link CGAL::Tag_false `Tag_false`\endlink. */ Dart_handle dart(); /*! -Returns one dart of the cell associated to this attribute, when it is const. `NULL` if \link Supports_cell_dart `Supports_cell_dart`\endlink is equal to \link CGAL::Tag_false `Tag_false`\endlink. +Returns one dart of the cell associated to this attribute, when it is const. `nullptr` if \link Supports_cell_dart `Supports_cell_dart`\endlink is equal to \link CGAL::Tag_false `Tag_false`\endlink. */ Dart_const_handle dart() const; diff --git a/Combinatorial_map/doc/Combinatorial_map/Concepts/CombinatorialMap.h b/Combinatorial_map/doc/Combinatorial_map/Concepts/CombinatorialMap.h index 8af7ff8bab4..93d8b4a7942 100644 --- a/Combinatorial_map/doc/Combinatorial_map/Concepts/CombinatorialMap.h +++ b/Combinatorial_map/doc/Combinatorial_map/Concepts/CombinatorialMap.h @@ -73,12 +73,12 @@ template Dart_const_handle beta(Dart_const_handle dh) const; /*! -Returns a handle to a dart belonging to the same edge than dart `*dh`, and not to the same vertex. `NULL` if such a dart does not exist. +Returns a handle to a dart belonging to the same edge than dart `*dh`, and not to the same vertex. `nullptr` if such a dart does not exist. */ Dart_handle opposite(Dart_handle dh); /*! -Returns a const handle to a dart belonging to the same edge than dart `*dh`, and not to the same vertex, when the dart is const. `NULL` if such a dart does not exist. +Returns a const handle to a dart belonging to the same edge than dart `*dh`, and not to the same vertex, when the dart is const. `nullptr` if such a dart does not exist. */ Dart_const_handle opposite(Dart_const_handle dh) const; @@ -146,7 +146,7 @@ template bool is_sewable(Dart_const_handle dh1, Dart_const_hand Links by \f$ \beta_i \f$ two by two all the darts of the orbit D1=\f$ \langle{}\f$\f$ \beta_1\f$,\f$ \ldots\f$,\f$ \beta_{i-2}\f$,\f$ \beta_{i+2}\f$,\f$ \ldots\f$,\f$ \beta_d\f$\f$ \rangle{}\f$(`*dh1`) and D2=\f$ \langle{}\f$\f$ \beta_0\f$,\f$ \beta_2\f$,\f$ \ldots\f$,\f$ \beta_{i-2}\f$,\f$ \beta_{i+2}\f$,\f$ \ldots\f$,\f$ \beta_d\f$\f$ \rangle{}\f$(`*dh2`) such that d2=f(d1), where f is the bijection between D1 and D2 satisfying: f(*dh1)=*dh2, and for all e \f$ \in \f$ D1, for all j \f$ \in \f$ {1,\f$ \ldots\f$,i-2,i+2,\f$ \ldots\f$,d}, f(\f$ \beta_j\f$(e))=\f$ \beta_j^{-1}\f$(f(e)). -If \link GenericMap::are_attributes_automatically_managed `are_attributes_automatically_managed()`\endlink`==true`, when necessary, non void attributes are updated to ensure the validity of the generic map: for each j-cells c1 and c2 which are merged into one j-cell during the sew, the two associated attributes attr1 and attr2 are considered. If one attribute is NULL and the other not, the non NULL attribute is associated to all the darts of the resulting cell. When the two attributes are non NULL, functor \link CellAttribute::On_merge `Attribute_type::type::On_merge`\endlink is called on the two attributes attr1 and attr2. If set, the dynamic onmerge function of i-attributes is also called on attr1 and attr2. Then, the attribute attr1 is associated to all darts of the resulting j-cell. Finally, attribute attr2 is removed from the generic map. +If \link GenericMap::are_attributes_automatically_managed `are_attributes_automatically_managed()`\endlink`==true`, when necessary, non void attributes are updated to ensure the validity of the generic map: for each j-cells c1 and c2 which are merged into one j-cell during the sew, the two associated attributes attr1 and attr2 are considered. If one attribute is `nullptr` and the other not, the non `nullptr` attribute is associated to all the darts of the resulting cell. When the two attributes are non `nullptr`, functor \link CellAttribute::On_merge `Attribute_type::type::On_merge`\endlink is called on the two attributes attr1 and attr2. If set, the dynamic onmerge function of i-attributes is also called on attr1 and attr2. Then, the attribute attr1 is associated to all darts of the resulting j-cell. Finally, attribute attr2 is removed from the generic map. \pre \link CombinatorialMap::is_sewable `is_sewable(dh1,dh2)`\endlink. \cgalAdvancedBegin diff --git a/Combinatorial_map/doc/Combinatorial_map/Concepts/GenericMap.h b/Combinatorial_map/doc/Combinatorial_map/Concepts/GenericMap.h index 382514419ff..ed4ea6a97a8 100644 --- a/Combinatorial_map/doc/Combinatorial_map/Concepts/GenericMap.h +++ b/Combinatorial_map/doc/Combinatorial_map/Concepts/GenericMap.h @@ -315,12 +315,12 @@ Returns the highest dimension i such that dart `*dh` is not i-free int highest_nonfree_dimension(Dart_const_handle dh) const; /*! -Returns a handle to a dart belonging to the other vertex of the edge containing dart `*dh` (but not necessarily to the same edge). `NULL` if such a dart does not exist. +Returns a handle to a dart belonging to the other vertex of the edge containing dart `*dh` (but not necessarily to the same edge). `nullptr` if such a dart does not exist. */ Dart_handle other_extremity(Dart_handle dh); /*! -Returns a const handle to a dart belonging to the other vertex of the edge containing dart `*dh`, when the dart is const (but not necessarily to the same edge). `NULL` if such a dart does not exist. +Returns a const handle to a dart belonging to the other vertex of the edge containing dart `*dh`, when the dart is const (but not necessarily to the same edge). `nullptr` if such a dart does not exist. */ Dart_const_handle other_extremity(Dart_const_handle dh) const; @@ -403,16 +403,16 @@ Attribute_const_handle::type attribute(Dart_const_handle dh) const; /*! Returns one dart of the cell associated to the i-attribute `*ah`. -`NULL` if \link CellAttribute::Supports_cell_dart `Supports_cell_dart`\endlink of i-attributes is equal to \link CGAL::Tag_false `Tag_false`\endlink. -\pre 0 \f$ \leq \f$ i \f$ \leq \f$ \link GenericMap::dimension `dimension`\endlink, i-attributes are non `void` and `ah`!=NULL. +`nullptr` if \link CellAttribute::Supports_cell_dart `Supports_cell_dart`\endlink of i-attributes is equal to \link CGAL::Tag_false `Tag_false`\endlink. +\pre 0 \f$ \leq \f$ i \f$ \leq \f$ \link GenericMap::dimension `dimension`\endlink, i-attributes are non `void` and `ah`!=nullptr. */ template Dart_handle dart_of_attribute(typename Attribute_handle::type ah); /*! Returns one dart of the cell associated to the const i-attribute `*ah`. -`NULL` if \link CellAttribute::Supports_cell_dart `Supports_cell_dart`\endlink of i-attributes is equal to \link CGAL::Tag_false `Tag_false`\endlink. -\pre 0 \f$ \leq \f$ i \f$ \leq \f$ \link GenericMap::dimension `dimension`\endlink, i-attributes are non `void` and `ah`!=NULL. +`nullptr` if \link CellAttribute::Supports_cell_dart `Supports_cell_dart`\endlink of i-attributes is equal to \link CGAL::Tag_false `Tag_false`\endlink. +\pre 0 \f$ \leq \f$ i \f$ \leq \f$ \link GenericMap::dimension `dimension`\endlink, i-attributes are non `void` and `ah`!=nullptr. */ template Dart_const_handle dart_of_attribute(typename Attribute_const_handle::type ah) const; @@ -420,7 +420,7 @@ Dart_const_handle dart_of_attribute(typename Attribute_const_handle::type ah) /*! Returns the information of the i-attribute `*ah`. Defined only if \link CellAttribute::Info `Info`\endlink of i-attributes is not `void`. -\pre 0 \f$ \leq \f$ i \f$ \leq \f$ \link GenericMap::dimension `dimension`\endlink, i-attributes are non `void` and `ah`!=NULL. +\pre 0 \f$ \leq \f$ i \f$ \leq \f$ \link GenericMap::dimension `dimension`\endlink, i-attributes are non `void` and `ah`!=nullptr. */ template Attribute_type::type::Info& info_of_attribute(typename Attribute_handle::type ah); @@ -428,35 +428,35 @@ Attribute_type::type::Info& info_of_attribute(typename Attribute_handle::t /*! Returns the information of the const i-attribute `*ah`. Defined only if \link CellAttribute::Info `Info`\endlink of i-attributes is not `void`. -\pre 0 \f$ \leq \f$ i \f$ \leq \f$ \link GenericMap::dimension `dimension`\endlink, i-attributes are non `void` and `ah`!=NULL. +\pre 0 \f$ \leq \f$ i \f$ \leq \f$ \link GenericMap::dimension `dimension`\endlink, i-attributes are non `void` and `ah`!=nullptr. */ template const Attribute_type::type::Info& info_of_attribute(typename Attribute_const_handle::type ah) const; /*! A shorcut for \link GenericMap::info_of_attribute `info_of_attribute`\endlink`(`\link GenericMap::attribute `attribute`\endlink`(adart))`. -\pre \link GenericMap::attribute `attribute`\endlink`(adart)!=NULL`. +\pre \link GenericMap::attribute `attribute`\endlink`(adart)!=nullptr`. */ template typename Attribute_type::type::Info & info(Dart_handle adart); /*! A shorcut for \link GenericMap::info_of_attribute(typename Attribute_const_handle::type)const `info_of_attribute`\endlink`(`\link GenericMap::attribute(Dart_const_handle)const `attribute`\endlink`(adart))` for const handle. -\pre \link GenericMap::attribute(Dart_const_handle)const `attribute`\endlink`(adart)!=NULL`. +\pre \link GenericMap::attribute(Dart_const_handle)const `attribute`\endlink`(adart)!=nullptr`. */ template const typename Attribute_type::type::Info & info(Dart_const_handle adart) const; /*! A shorcut for \link GenericMap::dart_of_attribute `dart_of_attribute`\endlink`(`\link GenericMap::attribute `attribute`\endlink`(adart))`. -\pre `attribute(adart)!=NULL`. +\pre `attribute(adart)!=nullptr`. */ template Dart_handle & dart(Dart_handle adart); /*! A shorcut for \link GenericMap::dart_of_attribute(typename Attribute_const_handle::type)const `dart_of_attribute`\endlink`(`\link GenericMap::attribute(Dart_const_handle)const `attribute`\endlink`(adart))` for const handle. -\pre `attribute(adart)!=NULL`. +\pre `attribute(adart)!=nullptr`. */ template Dart_const_handle dart(Dart_const_handle adart) const; diff --git a/Combinatorial_map/include/CGAL/Cell_attribute.h b/Combinatorial_map/include/CGAL/Cell_attribute.h index f00bc6aa43a..9769e87178d 100644 --- a/Combinatorial_map/include/CGAL/Cell_attribute.h +++ b/Combinatorial_map/include/CGAL/Cell_attribute.h @@ -278,7 +278,7 @@ namespace CGAL { void set_dart(Dart_handle adart) { mdart = adart; } /// Test if the cell is valid. - /// A cell is valid if its dart is not NULL. + /// A cell is valid if its dart is not nullptr. bool is_valid() const { return mdart!=Refs::null_handle; } diff --git a/Combinatorial_map/include/CGAL/Combinatorial_map.h b/Combinatorial_map/include/CGAL/Combinatorial_map.h index 7b594d2ad16..d84402b54de 100644 --- a/Combinatorial_map/include/CGAL/Combinatorial_map.h +++ b/Combinatorial_map/include/CGAL/Combinatorial_map.h @@ -218,7 +218,7 @@ namespace CGAL { void copy(const CMap2& amap, const Converters& converters, const DartInfoConverter& dartinfoconverter, const PointConverter& pointconverter, - boost::unordered_map* dart_mapping=NULL) + boost::unordered_map* dart_mapping=nullptr) { this->clear(); @@ -242,7 +242,7 @@ namespace CGAL { // (here we cannot use CGAL::Unique_hash_map because it does not provide // iterators... boost::unordered_map local_dartmap; - if (dart_mapping==NULL) + if (dart_mapping==nullptr) { dart_mapping=&local_dartmap; } for (typename CMap2::Dart_const_range::const_iterator @@ -291,7 +291,7 @@ namespace CGAL { template void copy(const CMap2& amap, - boost::unordered_map* dart_mapping=NULL) + boost::unordered_map* dart_mapping=nullptr) { std::tuple<> converters; @@ -302,7 +302,7 @@ namespace CGAL { template void copy(const CMap2& amap, const Converters& converters, - boost::unordered_map* dart_mapping=NULL) + boost::unordered_map* dart_mapping=nullptr) { Default_converter_cmap_0attributes_with_point pointconverter; Default_converter_dart_info dartinfoconverter; @@ -312,7 +312,7 @@ namespace CGAL { template void copy(const CMap2& amap, const Converters& converters, const DartInfoConverter& dartinfoconverter, - boost::unordered_map* dart_mapping=NULL) + boost::unordered_map* dart_mapping=nullptr) { Default_converter_cmap_0attributes_with_point pointconverter; copy(amap, converters, dartinfoconverter, pointconverter, dart_mapping); @@ -521,7 +521,7 @@ namespace CGAL { } /** Return a dart belonging to the same edge and to the second vertex - * of the current edge (NULL if such a dart does not exist). + * of the current edge (nullptr if such a dart does not exist). * @return An handle to the opposite dart. */ Dart_handle opposite(Dart_handle dh) @@ -539,7 +539,7 @@ namespace CGAL { /** Return a dart incident to the other extremity of the current edge, * but contrary to opposite, non necessary to the same edge - * (NULL if such a dart does not exist). + * (nullptr if such a dart does not exist). * @return An handle to the opposite dart. */ Dart_handle other_extremity(Dart_handle dh) @@ -1530,10 +1530,10 @@ namespace CGAL { else basic_link_beta_for_involution(adart1, adart2, i); } - /** Double link two darts, and update the NULL attributes. + /** Double link two darts, and update the nullptr attributes. * \em adart1 is 0-linked to \em adart2 and \em adart2 is 1-linked - * with \em adart1. The NULL attributes of \em adart1 are updated to - * non NULL attributes associated to \em adart2, and vice-versa. + * with \em adart1. The nullptr attributes of \em adart1 are updated to + * non nullptr attributes associated to \em adart2, and vice-versa. * If both darts have an attribute, the attribute of adart1 is * associated to adart2. * We can obtain a non-valid map with darts belonging to a same cell @@ -1550,10 +1550,10 @@ namespace CGAL { this->template dart_link_beta<1>(adart2, adart1); } - /** Double link two darts, and update the NULL attributes. + /** Double link two darts, and update the nullptr attributes. * \em adart1 is 1-linked to \em adart2 and \em adart2 is 0-linked - * with \em adart1. The NULL attributes of \em adart1 are updated to - * non NULL attributes associated to \em adart2, and vice-versa. + * with \em adart1. The nullptr attributes of \em adart1 are updated to + * non nullptr attributes associated to \em adart2, and vice-versa. * If both darts have an attribute, the attribute of adart1 is * associated to adart2. * We can obtain a non-valid map with darts belonging to a same cell @@ -1570,10 +1570,10 @@ namespace CGAL { this->template dart_link_beta<0>(adart2, adart1); } - /** Double link two darts, and update the NULL attributes. + /** Double link two darts, and update the nullptr attributes. * \em adart1 is i-linked to \em adart2 and \em adart2 is i^-1-linked - * with \em adart1. The NULL attributes of \em adart1 are updated to - * non NULL attributes associated to \em adart2, and vice-versa. + * with \em adart1. The nullptr attributes of \em adart1 are updated to + * non nullptr attributes associated to \em adart2, and vice-versa. * If both darts have an attribute, the attribute of adart1 is * associated to adart2. * We can obtain a non-valid map with darts belonging to a same cell @@ -1594,10 +1594,10 @@ namespace CGAL { this->template dart_link_beta(adart2, adart1); } - /** Double link two darts, and update the NULL attributes. + /** Double link two darts, and update the nullptr attributes. * \em adart1 is i-linked to \em adart2 and \em adart2 is i^-1-linked - * with \em adart1. The NULL attributes of \em adart1 are updated to - * non NULL attributes associated to \em adart2, and vice-versa. + * with \em adart1. The nullptr attributes of \em adart1 are updated to + * non nullptr attributes associated to \em adart2, and vice-versa. * If both darts have an attribute, the attribute of adart1 is * associated to adart2. * We can obtain a non-valid map with darts belonging to a same cell @@ -1619,8 +1619,8 @@ namespace CGAL { /** Double link a dart with betai to a second dart. * \em adart1 is i-linked to \em adart2 and \em adart2 is i^-1-linked - * with \em adart1. The NULL attributes of \em adart1 are updated to - * non NULL attributes associated to \em adart2, and vice-versa, + * with \em adart1. The nullptr attributes of \em adart1 are updated to + * non nullptr attributes associated to \em adart2, and vice-versa, * if both darts have an attribute, the attribute of adart1 is * associated to adart2 (only if update_attributes==true). * @param adart1 a first dart. @@ -3014,8 +3014,8 @@ namespace CGAL { /** Compute the dual of a Combinatorial_map. * @param amap the cmap in which we build the dual of this map. - * @param adart a dart of the initial map, NULL by default. - * @return adart of the dual map, the dual of adart if adart!=NULL, + * @param adart a dart of the initial map, nullptr by default. + * @return adart of the dual map, the dual of adart if adart!=nullptr, * any dart otherwise. * As soon as we don't modify this map and amap map, we can iterate * simultaneously through all the darts of the two maps and we have @@ -3707,7 +3707,7 @@ namespace CGAL { } /** Insert a vertex in a given edge. - * @param adart a dart of the edge (!=NULL && !=null_dart_handle). + * @param adart a dart of the edge (!=nullptr && !=null_dart_handle). * @param update_attributes a boolean to update the enabled attributes * @return a dart of the new vertex. */ @@ -3953,7 +3953,7 @@ namespace CGAL { } /** Insert a dangling edge in a 2-cell between given by a dart. - * @param adart1 a first dart of the facet (!=NULL && !=null_dart_handle). + * @param adart1 a first dart of the facet (!=nullptr && !=null_dart_handle). * @param update_attributes a boolean to update the enabled attributes * @return a dart of the new edge, not incident to the vertex of adart1. */ @@ -4023,7 +4023,7 @@ namespace CGAL { } } if (are_attributes_automatically_managed() && - update_attributes && ah!=NULL) + update_attributes && ah!=nullptr) { internal::Set_i_attribute_of_dart_functor::run(*this, d1, ah); } @@ -4069,8 +4069,8 @@ namespace CGAL { } /** Insert an edge in a 2-cell between two given darts. - * @param adart1 a first dart of the facet (!=NULL && !=null_dart_handle). - * @param adart2 a second dart of the facet. If NULL insert a dangling edge. + * @param adart1 a first dart of the facet (!=nullptr && !=null_dart_handle). + * @param adart2 a second dart of the facet. If nullptr insert a dangling edge. * @param update_attributes a boolean to update the enabled attributes * @return a dart of the new edge, and not incident to the * same vertex than adart1. diff --git a/Combinatorial_map/include/CGAL/Combinatorial_map_basic_operations.h b/Combinatorial_map/include/CGAL/Combinatorial_map_basic_operations.h index 8dfcf60debd..07283aff7ee 100644 --- a/Combinatorial_map/include/CGAL/Combinatorial_map_basic_operations.h +++ b/Combinatorial_map/include/CGAL/Combinatorial_map_basic_operations.h @@ -268,7 +268,7 @@ namespace CGAL typename Map::size_type degree(const Map & amap, typename Map::Dart_const_handle adart) { - CGAL_assertion(adart != NULL); + CGAL_assertion(adart != nullptr); typename Map::size_type nbIncident = 0; typename Map::size_type mark; @@ -317,7 +317,7 @@ namespace CGAL typename Map::size_type codegree(const Map & amap, typename Map::Dart_const_handle adart) { - CGAL_assertion(adart != NULL); + CGAL_assertion(adart != nullptr); typename Map::size_type nbIncident = 0; typename Map::size_type mark; diff --git a/Combinatorial_map/include/CGAL/Combinatorial_map_functors.h b/Combinatorial_map/include/CGAL/Combinatorial_map_functors.h index d92658b7cf5..384cfdb7b5d 100644 --- a/Combinatorial_map/include/CGAL/Combinatorial_map_functors.h +++ b/Combinatorial_map/include/CGAL/Combinatorial_map_functors.h @@ -81,8 +81,8 @@ struct Display_attribute_functor static void run(const CMap& amap, typename CMap::Dart_const_handle adart) { - if ( amap.template attribute(adart)==NULL ) - std::cout<<"NULL"; + if ( amap.template attribute(adart)==nullptr ) + std::cout<<"nullptr"; else amap.template display_attribute(amap.template attribute(adart)); } diff --git a/Combinatorial_map/include/CGAL/Combinatorial_map_insertions.h b/Combinatorial_map/include/CGAL/Combinatorial_map_insertions.h index 32a2fb8973e..9a6d4fc4af9 100644 --- a/Combinatorial_map/include/CGAL/Combinatorial_map_insertions.h +++ b/Combinatorial_map/include/CGAL/Combinatorial_map_insertions.h @@ -33,7 +33,7 @@ namespace CGAL /** Insert a vertex in a given edge. * @param amap the used combinatorial map. - * @param adart a dart of the edge (!=NULL && !=null_dart_handle). + * @param adart a dart of the edge (!=nullptr && !=null_dart_handle). * @param update_attributes a boolean to update the enabled attributes * (deprecated, now we use are_attributes_automatically_managed()) * @return a dart of the new vertex. @@ -67,7 +67,7 @@ insert_cell_0_in_cell_2( CMap& amap, typename CMap::Dart_handle adart, } /** Insert a dangling edge in a 2-cell between given by a dart. * @param amap the used combinatorial map. - * @param adart1 a first dart of the facet (!=NULL && !=null_dart_handle). + * @param adart1 a first dart of the facet (!=nullptr && !=null_dart_handle). * @param update_attributes a boolean to update the enabled attributes * (deprecated, now we use are_attributes_automatically_managed()) * @return a dart of the new edge, not incident to the vertex of adart1. @@ -100,8 +100,8 @@ CGAL_DEPRECATED bool is_insertable_cell_1_in_cell_2 /** Insert an edge in a 2-cell between two given darts. * @param amap the used combinatorial map. - * @param adart1 a first dart of the facet (!=NULL && !=null_dart_handle). - * @param adart2 a second dart of the facet. If NULL insert a dangling edge. + * @param adart1 a first dart of the facet (!=nullptr && !=null_dart_handle). + * @param adart2 a second dart of the facet. If nullptr insert a dangling edge. * @param update_attributes a boolean to update the enabled attributes * (deprecated, now we use are_attributes_automatically_managed()) * @return a dart of the new edge, and not incident to the diff --git a/Combinatorial_map/include/CGAL/Combinatorial_map_save_load.h b/Combinatorial_map/include/CGAL/Combinatorial_map_save_load.h index 884e2bb059a..e0858b9ca22 100644 --- a/Combinatorial_map/include/CGAL/Combinatorial_map_save_load.h +++ b/Combinatorial_map/include/CGAL/Combinatorial_map_save_load.h @@ -564,7 +564,7 @@ namespace CGAL { if( type==type_map && v2.first == "v" ) { if (amap.template attribute(myDarts[id_dart_cellule]) - ==NULL ) + ==nullptr ) amap.template set_attribute (myDarts[id_dart_cellule], amap.template create_attribute()); @@ -575,7 +575,7 @@ namespace CGAL { if( ptype==ptype_map && v2.first == "p" ) { if (amap.template attribute(myDarts[id_dart_cellule]) - ==NULL ) + ==nullptr ) amap.template set_attribute (myDarts[id_dart_cellule], amap.template create_attribute()); @@ -635,7 +635,7 @@ namespace CGAL { if( v2.first == "p" ) { if (amap.template attribute - (myDarts[id_dart_cellule])==NULL ) + (myDarts[id_dart_cellule])==nullptr ) amap.template set_attribute (myDarts[id_dart_cellule], amap.template create_attribute()); @@ -696,7 +696,7 @@ namespace CGAL { if( v2.first == "v" ) { if (amap.template attribute - (myDarts[id_dart_cellule])==NULL) + (myDarts[id_dart_cellule])==nullptr) amap.template set_attribute (myDarts[id_dart_cellule], amap.template create_attribute()); @@ -740,7 +740,7 @@ namespace CGAL { { id_dart_cellule=v1.second.get("d")-1; - if (amap.template attribute(myDarts[id_dart_cellule])==NULL) + if (amap.template attribute(myDarts[id_dart_cellule])==nullptr) amap.template set_attribute (myDarts[id_dart_cellule], amap.template create_attribute()); diff --git a/Combinatorial_map/include/CGAL/Combinatorial_map_storages.h b/Combinatorial_map/include/CGAL/Combinatorial_map_storages.h index 5b37734b84f..b3133776729 100644 --- a/Combinatorial_map/include/CGAL/Combinatorial_map_storages.h +++ b/Combinatorial_map/include/CGAL/Combinatorial_map_storages.h @@ -76,7 +76,7 @@ namespace CGAL { typedef typename Dart_container::const_iterator Dart_const_handle; typedef typename Dart_container::size_type size_type; - typedef CGAL::Void* Null_handle_type; + typedef std::nullptr_t Null_handle_type; static const Null_handle_type null_handle; typedef Items_ Items; @@ -132,18 +132,18 @@ namespace CGAL { /** Return if this dart is free for adimension. * @param dh a dart handle * @param i the dimension. - * @return true iff dh is linked with NULL for \em adimension. + * @return true iff dh is linked with nullptr for \em adimension. */ template bool is_free(Dart_const_handle dh) const { - CGAL_assertion( dh!=NULL ); + CGAL_assertion( dh!=nullptr ); CGAL_assertion(i <= dimension); return dh->mf[i]==null_dart_handle; } bool is_free(Dart_const_handle dh, unsigned int i) const { - CGAL_assertion( dh!=NULL ); + CGAL_assertion( dh!=nullptr ); CGAL_assertion(i <= dimension); return dh->mf[i]==null_dart_handle; } @@ -152,57 +152,57 @@ namespace CGAL { void set_dart_marks(Dart_const_handle ADart, const std::bitset& amarks) const { - CGAL_assertion( ADart!=NULL ); + CGAL_assertion( ADart!=nullptr ); ADart->set_marks(amarks); } /// Return all the marks of a dart. std::bitset get_dart_marks(Dart_const_handle ADart) const { - CGAL_assertion( ADart!=NULL ); + CGAL_assertion( ADart!=nullptr ); return ADart->get_marks(); } /// Return the mark value of dart a given mark number. bool get_dart_mark(Dart_const_handle ADart, size_type amark) const { - CGAL_assertion( ADart!=NULL ); + CGAL_assertion( ADart!=nullptr ); return ADart->get_mark(amark); } /// Set the mark of a given mark number to a given value. void set_dart_mark(Dart_const_handle ADart, size_type amark, bool avalue) const { - CGAL_assertion( ADart!=NULL ); + CGAL_assertion( ADart!=nullptr ); ADart->set_mark(amark, avalue); } /// Flip the mark of a given mark number to a given value. void flip_dart_mark(Dart_const_handle ADart, size_type amark) const { - CGAL_assertion( ADart!=NULL ); + CGAL_assertion( ADart!=nullptr ); ADart->flip_mark(amark); } // Access to beta maps Dart_handle get_beta(Dart_handle ADart, int B1) { - CGAL_assertion(ADart!=NULL && B1>=0 && B1<=(int)dimension); + CGAL_assertion(ADart!=nullptr && B1>=0 && B1<=(int)dimension); return ADart->mf[B1]; } Dart_const_handle get_beta(Dart_const_handle ADart, int B1) const { - CGAL_assertion(ADart!=NULL && B1>=0 && B1<=(int)dimension); + CGAL_assertion(ADart!=nullptr && B1>=0 && B1<=(int)dimension); return ADart->mf[B1]; } template Dart_handle get_beta(Dart_handle ADart) { - CGAL_assertion(ADart!=NULL && B1>=0 && B1<=(int)dimension); + CGAL_assertion(ADart!=nullptr && B1>=0 && B1<=(int)dimension); return ADart->mf[B1]; } template Dart_const_handle get_beta(Dart_const_handle ADart) const { - CGAL_assertion(ADart!=NULL && B1>=0 && B1<=(int)dimension); + CGAL_assertion(ADart!=nullptr && B1>=0 && B1<=(int)dimension); return ADart->mf[B1]; } @@ -243,7 +243,7 @@ namespace CGAL { template bool is_valid_attribute(typename Attribute_const_handle::type ah) const { - CGAL_assertion( ah!=NULL ); + CGAL_assertion( ah!=nullptr ); return ah->is_valid(); } @@ -252,25 +252,25 @@ namespace CGAL { std::size_t get_attribute_ref_counting (typename Attribute_const_handle::type ah) const { - CGAL_assertion( ah!=NULL ); + CGAL_assertion( ah!=nullptr ); return ah->get_nb_refs(); } template void init_attribute_ref_counting(typename Attribute_handle::type ah) { - CGAL_assertion( ah!=NULL ); + CGAL_assertion( ah!=nullptr ); ah->mrefcounting=0; } template void inc_attribute_ref_counting(typename Attribute_handle::type ah) { - CGAL_assertion( ah!=NULL ); + CGAL_assertion( ah!=nullptr ); ah->inc_nb_refs(); } template void dec_attribute_ref_counting(typename Attribute_handle::type ah) { - CGAL_assertion( ah!=NULL ); + CGAL_assertion( ah!=nullptr ); ah->dec_nb_refs(); } @@ -279,14 +279,14 @@ namespace CGAL { typename Attribute_type::type& get_attribute(typename Attribute_handle::type ah) { - CGAL_assertion( ah!=NULL ); + CGAL_assertion( ah!=nullptr ); return *ah; } template const typename Attribute_type::type& get_attribute(typename Attribute_const_handle::type ah) const { - CGAL_assertion( ah!=NULL ); + CGAL_assertion( ah!=nullptr ); return *ah; } @@ -294,14 +294,14 @@ namespace CGAL { template Dart_handle dart_of_attribute(typename Attribute_handle::type ah) { - CGAL_assertion( ah!=NULL ); + CGAL_assertion( ah!=nullptr ); return ah->dart(); } template Dart_const_handle dart_of_attribute(typename Attribute_const_handle::type ah) const { - CGAL_assertion( ah!=NULL ); + CGAL_assertion( ah!=nullptr ); return ah->dart(); } @@ -310,7 +310,7 @@ namespace CGAL { void set_dart_of_attribute(typename Attribute_handle::type ah, Dart_handle adart) { - CGAL_assertion( ah!=NULL ); + CGAL_assertion( ah!=nullptr ); ah->set_dart(adart); } @@ -327,14 +327,14 @@ namespace CGAL { typename Attribute_type::type::Info & info_of_attribute(typename Attribute_handle::type ah) { - CGAL_assertion( ah!=NULL ); + CGAL_assertion( ah!=nullptr ); return ah->info(); } template const typename Attribute_type::type::Info & info_of_attribute(typename Attribute_const_handle::type ah) const { - CGAL_assertion( ah!=NULL ); + CGAL_assertion( ah!=nullptr ); return ah->info(); } @@ -342,16 +342,16 @@ namespace CGAL { template typename Attribute_type::type::Info & info(Dart_handle adart) { - CGAL_assertion( adart!=NULL ); - CGAL_assertion( attribute(adart)!=NULL ); + CGAL_assertion( adart!=nullptr ); + CGAL_assertion( attribute(adart)!=nullptr ); return info_of_attribute(attribute(adart)); } template const typename Attribute_type::type::Info & info(Dart_const_handle adart) const { - CGAL_assertion( adart!=NULL ); - CGAL_assertion( attribute(adart)!=NULL ); + CGAL_assertion( adart!=nullptr ); + CGAL_assertion( attribute(adart)!=nullptr ); return info_of_attribute(attribute(adart)); } @@ -359,15 +359,15 @@ namespace CGAL { template Dart_handle dart(Dart_handle adart) { - CGAL_assertion( adart!=NULL ); - CGAL_assertion( attribute(adart)!=NULL ); + CGAL_assertion( adart!=nullptr ); + CGAL_assertion( attribute(adart)!=nullptr ); return dart_of_attribute(attribute(adart)); } template Dart_const_handle dart(Dart_const_handle adart) const { - CGAL_assertion( adart!=NULL ); - CGAL_assertion( attribute(adart)!=NULL ); + CGAL_assertion( adart!=nullptr ); + CGAL_assertion( attribute(adart)!=nullptr ); return dart_of_attribute(attribute(adart)); } @@ -399,14 +399,14 @@ namespace CGAL { void dart_link_beta(Dart_handle adart, Dart_handle adart2) { CGAL_assertion(i <= dimension); - CGAL_assertion(adart!=NULL && adart2!=NULL); + CGAL_assertion(adart!=nullptr && adart2!=nullptr); CGAL_assertion(adart!=null_dart_handle); adart->mf[i] = adart2; } void dart_link_beta(Dart_handle adart, Dart_handle adart2, unsigned int i) { CGAL_assertion(i <= dimension); - CGAL_assertion(adart!=NULL && adart2!=NULL); + CGAL_assertion(adart!=nullptr && adart2!=nullptr); CGAL_assertion(adart!=null_dart_handle); adart->mf[i] = adart2; } @@ -418,12 +418,12 @@ namespace CGAL { template void dart_unlink_beta(Dart_handle adart) { - CGAL_assertion(adart!=NULL && i <= dimension); + CGAL_assertion(adart!=nullptr && i <= dimension); adart->mf[i] = null_dart_handle; } void dart_unlink_beta(Dart_handle adart, unsigned int i) { - CGAL_assertion(adart!=NULL && i <= dimension); + CGAL_assertion(adart!=nullptr && i <= dimension); adart->mf[i] = null_dart_handle; } @@ -445,7 +445,7 @@ namespace CGAL { /// null_handle template < unsigned int d_, class Items_, class Alloc_ > const typename Combinatorial_map_storage_1::Null_handle_type - Combinatorial_map_storage_1::null_handle = NULL; + Combinatorial_map_storage_1::null_handle = nullptr; } // namespace CGAL diff --git a/Combinatorial_map/include/CGAL/internal/Combinatorial_map_group_functors.h b/Combinatorial_map/include/CGAL/internal/Combinatorial_map_group_functors.h index ea130ea28a4..d67ab093303 100644 --- a/Combinatorial_map/include/CGAL/internal/Combinatorial_map_group_functors.h +++ b/Combinatorial_map/include/CGAL/internal/Combinatorial_map_group_functors.h @@ -40,9 +40,9 @@ * given in the struct to enable specialization. * * Group_attribute_functor to group the -attributes of two - * given i-cells (except for j-adim). If one i-attribute is NULL, we set the + * given i-cells (except for j-adim). If one i-attribute is nullptr, we set the * darts of its i-cell to the second attribute. If both i-attributes are - * non NULL, we overide all the i-attribute of the second i-cell to the + * non nullptr, we overide all the i-attribute of the second i-cell to the * first i-attribute. * * Degroup_attribute_functor_run to degroup one i-attributes in two @@ -264,8 +264,8 @@ struct Group_nonvoid_attribute_functor_run typename CMap::Dart_handle toSet = amap.null_handle; - // If the attribute associated to adart1 is NULL, set it with - // the attribute associated to adart2 (necessarily != NULL) + // If the attribute associated to adart1 is nullptr, set it with + // the attribute associated to adart2 (necessarily != nullptr) if (a1 == CMap::null_handle) { toSet = adart1; a1 = a2; } else diff --git a/Combinatorial_map/include/CGAL/internal/Combinatorial_map_internal_functors.h b/Combinatorial_map/include/CGAL/internal/Combinatorial_map_internal_functors.h index 4392a284012..9c5af271950 100644 --- a/Combinatorial_map/include/CGAL/internal/Combinatorial_map_internal_functors.h +++ b/Combinatorial_map/include/CGAL/internal/Combinatorial_map_internal_functors.h @@ -84,7 +84,7 @@ * internal::Reverse_orientation_of_connected_component_functor to reverse * the orientation of a connected component in a cmap * - * internal::Init_attribute_functor to initialize all attributes to NULL. + * internal::Init_attribute_functor to initialize all attributes to nullptr. * * internal::Correct_invalid_attributes_functor to correct the i-attribute * associated with a given i-cell @@ -283,14 +283,14 @@ struct Test_is_valid_attribute_functor if ( !amap.template is_valid_attribute(a) ) { std::cout<<"ERROR: the dart associated with an "<(a)!=amap.null_handle && !found_dart ) { - std::cout<<"ERROR: the non NULL dart of an "< struct Init_attribute_functor { @@ -791,9 +791,9 @@ struct Reverse_orientation_of_map_functor CGAL_precondition(amap.is_whole_map_unmarked(mymark)); CGAL_precondition(amap.is_valid()); - typename CMap::Dart_handle first=NULL, current=NULL, prev=NULL, next=NULL; + typename CMap::Dart_handle first=nullptr, current=nullptr, prev=nullptr, next=nullptr; typename CMap::Helper::template Attribute_handle<0>::type - first_attribute=NULL, next_attribute=NULL; + first_attribute=nullptr, next_attribute=nullptr; for (typename CMap::Dart_range::iterator current_dart=amap.darts().begin(), last_dart = amap.darts().end(); current_dart!=last_dart; @@ -885,9 +885,9 @@ struct Reverse_orientation_of_connected_component_functor typename CMap::size_type mymark = (amark==CMap::INVALID_MARK?amap.get_new_mark():amark); - typename CMap::Dart_handle first=NULL, current=NULL, prev=NULL, next=NULL; + typename CMap::Dart_handle first=nullptr, current=nullptr, prev=nullptr, next=nullptr; typename CMap::Helper::template Attribute_handle<0>::type - first_attribute=NULL, next_attribute=NULL; + first_attribute=nullptr, next_attribute=nullptr; for (typename CMap::template Dart_of_cell_range::iterator current_dart=amap.template darts_of_cell diff --git a/Cone_spanners_2/include/CGAL/Cone_spanners_2/Plane_scan_tree.h b/Cone_spanners_2/include/CGAL/Cone_spanners_2/Plane_scan_tree.h index 9da6f7d9e8d..265054e7fa5 100644 --- a/Cone_spanners_2/include/CGAL/Cone_spanners_2/Plane_scan_tree.h +++ b/Cone_spanners_2/include/CGAL/Cone_spanners_2/Plane_scan_tree.h @@ -98,16 +98,16 @@ public: /* Explicit Constructor. */ explicit Plane_scan_tree (const key_compare& comp = key_compare(), const value_compare& vcomp = value_compare()) - : less (comp), vless (vcomp), root (NULL), m_min (NULL), - m_max (NULL), _size (0) {} + : less (comp), vless (vcomp), root (nullptr), m_min (nullptr), + m_max (nullptr), _size (0) {} /* Constructor */ template Plane_scan_tree (InputIterator first, InputIterator last, const key_compare& comp = key_compare(), const value_compare& vcomp = value_compare()) - : less (comp), vless (vcomp), root (NULL), m_min (NULL), - m_max (NULL), _size (0) + : less (comp), vless (vcomp), root (nullptr), m_min (nullptr), + m_max (nullptr), _size (0) { // buids the tree /* Note: a more efficient algorithm building the tree bottom up may be @@ -121,9 +121,9 @@ public: */ ~Plane_scan_tree () { delete root; - root = NULL; - m_min = NULL; - m_max = NULL; + root = nullptr; + m_min = nullptr; + m_max = nullptr; _size = 0;; } @@ -141,7 +141,7 @@ public: * @param v The value */ void add (const key_type& k, const mapped_type& v) { - if (NULL == root) { + if (nullptr == root) { m_min = new _leaf_type (less, vless, this); m_max = m_min; root = m_min; @@ -170,7 +170,7 @@ public: * @return The minimum value whose key is strictly greater than x. */ const mapped_type* minAbove (const key_type& x) const { - if (NULL == root) return NULL; + if (nullptr == root) return nullptr; return root->minAbove(x); } diff --git a/Cone_spanners_2/include/CGAL/Cone_spanners_2/Plane_scan_tree_impl.h b/Cone_spanners_2/include/CGAL/Cone_spanners_2/Plane_scan_tree_impl.h index cb4a031a6ab..283b4d0fcde 100644 --- a/Cone_spanners_2/include/CGAL/Cone_spanners_2/Plane_scan_tree_impl.h +++ b/Cone_spanners_2/include/CGAL/Cone_spanners_2/Plane_scan_tree_impl.h @@ -76,7 +76,7 @@ public: /* Constructor */ _Node(const key_compare& less, const value_compare& vless, tree_type *const t) - : parent(NULL), less(less), vless(vless), tree(t) {} + : parent(nullptr), less(less), vless(vless), tree(t) {} /* Destructor */ virtual ~_Node() {} @@ -141,8 +141,8 @@ public: typedef typename _node_type::tree_type tree_type; _Leaf (const key_compare& less, const value_compare& vless, tree_type *const t, - _leaf_type *const prev = NULL, - _leaf_type *const next = NULL) + _leaf_type *const prev = nullptr, + _leaf_type *const next = nullptr) : _node_type (less, vless, t), prev (prev), next (next) { std::memset (values, 0, 2*sizeof(value_type*)); } @@ -156,10 +156,10 @@ public: virtual ~_Leaf() { delete values[0]; delete values[1]; - values[0] = NULL; - values[1] = NULL; - prev = NULL; - next = NULL; + values[0] = nullptr; + values[1] = nullptr; + prev = nullptr; + next = nullptr; } virtual bool isLeaf() const { @@ -171,10 +171,10 @@ public: } void add(const key_type& k, const mapped_type& v) { - if (NULL == values[0]) { + if (nullptr == values[0]) { // empty values[0] = new value_type(k, v); - } else if (NULL == values[1]) { + } else if (nullptr == values[1]) { // Not full; if (this->less(k, values[0]->first)) { values[1] = values[0]; @@ -189,30 +189,30 @@ public: } else { _leaf_type* split = new _leaf_type(this->less, this->vless, this->tree, this, next); - if (NULL != next) next->prev = split; + if (nullptr != next) next->prev = split; next = split; if (this->less(k, values[0]->first)) { // k, [0], [1] split->values[0] = values[0]; split->values[1] = values[1]; values[0] = new value_type(k, v); - values[1] = NULL; + values[1] = nullptr; } else if (this->less(k, values[1]->first)) { // [0], k, [1] split->values[0] = new value_type(k, v); split->values[1] = values[1]; - values[1] = NULL; + values[1] = nullptr; } else { split->values[0] = values[1]; split->values[1] = new value_type(k, v); - values[1] = NULL; + values[1] = nullptr; } // Update pointer to max leaf (for reverse iterator) if (this->tree->m_max == this) this->tree->m_max = split; // Create new parent node current node is not root - if (NULL == this->parent) { + if (nullptr == this->parent) { this->setParent(new _internal_type(this->less, this->vless, this->tree)); this->tree->root = this->parent; } @@ -223,14 +223,14 @@ public: virtual const mapped_type* minAbove(const key_type& x) const { if ( !this->less(x, values[0]->first) && !this->less(values[0]->first, x) // equals - && NULL != values[1]) { + && nullptr != values[1]) { return &values[1]->second; } - return NULL; + return nullptr; } virtual const mapped_type* minV() const { - return (NULL == values[1]) ? &values[0]->second : &(std::min)(values[0]->second, values[1]->second, this->vless); + return (nullptr == values[1]) ? &values[0]->second : &(std::min)(values[0]->second, values[1]->second, this->vless); } protected: @@ -239,7 +239,7 @@ protected: os << "\t" << "{rank=same; \"" << &(values[0]->first) << "\"--\"" << &(values[0]->second) << "\" [style=dotted];}" << std::endl; os << "\t\"" << &(values[0]->first) << "\"--\"" << values[0]->first << "\";" << std::endl; os << "\t\"" << &(values[0]->second) << "\"--\"" << values[0]->second << "\";" << std::endl; - if (NULL != values[1]) { + if (nullptr != values[1]) { os << "\t\"" << this << "\"--\"" << &(values[1]->first) << "\" [style=bold];" << std::endl; os << "\t" << "{rank=same; \"" << &(values[1]->first) << "\"--\"" << &(values[1]->second) << "\" [style=dotted];}" << std::endl; os << "\t" << "{rank=same; \"" << &(values[0]->second) << "\"--\"" << &(values[1]->first) << "\" [color=white]; rankdir=LR;}" << std::endl; @@ -284,19 +284,19 @@ public: } virtual ~_Internal() { - keys[0] = NULL; - keys[1] = NULL; + keys[0] = nullptr; + keys[1] = nullptr; delete children[0]; - children[0] = NULL; + children[0] = nullptr; delete children[1]; - children[1] = NULL; + children[1] = nullptr; delete children[2]; - children[2] = NULL; + children[2] = nullptr; - vMin[0] = NULL; - vMin[1] = NULL; - vMin[2] = NULL; + vMin[0] = nullptr; + vMin[1] = nullptr; + vMin[2] = nullptr; } virtual bool isLeaf() const { @@ -305,7 +305,7 @@ public: virtual _leaf_type* leafNode(const key_type& k) { int i = 0; - for (i = 0; (i < 2) && (NULL != keys[i]); i++) { + for (i = 0; (i < 2) && (nullptr != keys[i]); i++) { if (this->less(k, *(keys[i]))) return children[i]->leafNode(k); } return children[i]->leafNode(k); @@ -340,7 +340,7 @@ public: void splitMe(const key_type *const k, _node_type *const left, _node_type *const right) { - if (keys[0] == NULL) { + if (keys[0] == nullptr) { // New root keys[0] = k; children[0] = left; @@ -349,7 +349,7 @@ public: children[1] = right; right->setParent(this); vMin[1] = right->minV(); - } else if (keys[1] == NULL) { + } else if (keys[1] == nullptr) { // not full if (left == children[0]) { // split 0th @@ -383,7 +383,7 @@ public: // Split 0th split->keys[0] = keys[1]; toPromote = keys[0]; - keys[1] = NULL; + keys[1] = nullptr; keys[0] = k; split->children[1] = children[2]; @@ -400,13 +400,13 @@ public: vMin[0] = children[0]->minV(); - children[2] = NULL; - vMin[2] = NULL; + children[2] = nullptr; + vMin[2] = nullptr; } else if (left == children[1]) { // Split 1st split->keys[0] = keys[1]; toPromote = k; - keys[1] = NULL; + keys[1] = nullptr; split->children[1] = children[2]; split->vMin[1] = split->children[1]->minV(); @@ -418,13 +418,13 @@ public: vMin[1] = children[1]->minV(); - children[2] = NULL; - vMin[2] = NULL; + children[2] = nullptr; + vMin[2] = nullptr; } else { // Split last split->keys[0] = k; toPromote = keys[1]; - keys[1] = NULL; + keys[1] = nullptr; split->children[1] = right; split->vMin[1] = split->children[1]->minV(); @@ -434,11 +434,11 @@ public: split->vMin[0] = split->children[0]->minV(); split->children[0]->setParent(split); - children[2] = NULL; - vMin[2] = NULL; + children[2] = nullptr; + vMin[2] = nullptr; } - if (NULL == this->parent) { + if (nullptr == this->parent) { this->setParent(new _internal_type(this->less, this->vless, this->tree)); this->tree->root = this->parent; } @@ -452,18 +452,18 @@ public: // x in left tree const mapped_type* minFromCh = children[0]->minAbove(x); const mapped_type* res = - (NULL == minFromCh) ? + (nullptr == minFromCh) ? vMin[1] : &(std::min) (*children[0]->minAbove(x), *vMin[1], this->vless); - if (vMin[2] != NULL) + if (vMin[2] != nullptr) res = &(std::min) (*res, *vMin[2], this->vless); return res; - } else if (NULL == keys[1] || this->less(x, *keys[1])) { + } else if (nullptr == keys[1] || this->less(x, *keys[1])) { // x in middle const mapped_type* res = children[1]->minAbove(x); - if (NULL == res) return vMin[2]; + if (nullptr == res) return vMin[2]; - if (vMin[2] != NULL) + if (vMin[2] != nullptr) res = &(std::min) (*res, *vMin[2], this->vless); return res; } else { @@ -473,7 +473,7 @@ public: virtual const mapped_type* minV() const { const mapped_type* res = &(std::min)(*vMin[0], *vMin[1], this->vless); - if (NULL != children[2]) + if (nullptr != children[2]) res = &(std::min)(*res, *vMin[2], this->vless); return res; } @@ -482,21 +482,21 @@ protected: virtual void print(std::ostream& os, const size_t level) const { os << "\t\"" << this << "\"--\"" << children[0] << "\";" << std::endl; os << "\t\"" << this << "\"--\"" << children[1] << "\";" << std::endl; - if (NULL != children[2]) + if (nullptr != children[2]) os << "\t\"" << this << "\"--\"" << children[2] << "\";" << std::endl; children[0]->print(os, level+1); children[1]->print(os, level+1); - if (NULL != children[2]) + if (nullptr != children[2]) children[2]->print(os, level+1); os << "\t\"" << this << "\"--\"" << vMin[0] << "\" [style=dashed,label=vMin0];" << std::endl; os << "\t\"" << this << "\"--\"" << vMin[1] << "\" [style=dashed,label=vMin1];" << std::endl; - if (NULL != vMin[2]) + if (nullptr != vMin[2]) os << "\t\"" << this << "\"--\"" << vMin[2] << "\" [style=dashed,label=vMin2];" << std::endl; os << "\t\"" << this << "\"--\"" << keys[0] << "\" [style=dotted,label=keys0];" << std::endl; - if (NULL != keys[1]) + if (nullptr != keys[1]) os << "\t\"" << this << "\"--\"" << keys[1] << "\" [style=dotted,label=keys1];" << std::endl; } @@ -514,18 +514,18 @@ public: typedef typename leaf_type::value_type value_type; typedef _Iterator iterator_type; - _Iterator(leaf_type* start = NULL) : cell (0), leaf(start) {} + _Iterator(leaf_type* start = nullptr) : cell (0), leaf(start) {} _Iterator(leaf_type* start, const Key& key) : cell(0), leaf(start) { if (start->values[0]->first != key) { if (!start->values[1] || start->values[1]->first != key) - leaf = NULL; + leaf = nullptr; else cell = 1; } } ~_Iterator() { cell = 0; - leaf = NULL; + leaf = nullptr; } value_type& operator*() const { @@ -538,9 +538,9 @@ public: iterator_type& operator++() { cell++; - if (NULL == leaf) return *this; + if (nullptr == leaf) return *this; - if (cell > 1 || NULL == leaf->values[cell]) { + if (cell > 1 || nullptr == leaf->values[cell]) { cell = 0; leaf = leaf->next; } @@ -576,18 +576,18 @@ public: typedef typename leaf_type::value_type value_type; typedef _RIterator iterator_type; - _RIterator(_Leaf* start = NULL) : cell (1), leaf(start) { - if (NULL == start) return; + _RIterator(_Leaf* start = nullptr) : cell (1), leaf(start) { + if (nullptr == start) return; - if (NULL == leaf->values[cell]) { + if (nullptr == leaf->values[cell]) { cell--; - if (NULL == leaf->values[cell]) leaf = NULL; + if (nullptr == leaf->values[cell]) leaf = nullptr; } } ~_RIterator() { cell = 0; - leaf = NULL; + leaf = nullptr; } value_type& operator*() const { @@ -599,15 +599,15 @@ public: } iterator_type& operator++() { - if (NULL == leaf) return *this; + if (nullptr == leaf) return *this; if (cell == 1) { cell--; } else if (cell == 0) { cell = 1; leaf = leaf->prev; - if (NULL == leaf) return *this; + if (nullptr == leaf) return *this; - if (NULL == leaf->values[cell]) cell--; + if (nullptr == leaf->values[cell]) cell--; } return *this; } diff --git a/Cone_spanners_2/include/CGAL/Construct_theta_graph_2.h b/Cone_spanners_2/include/CGAL/Construct_theta_graph_2.h index fa220690234..fe0da5c50fb 100644 --- a/Cone_spanners_2/include/CGAL/Construct_theta_graph_2.h +++ b/Cone_spanners_2/include/CGAL/Construct_theta_graph_2.h @@ -223,7 +223,7 @@ protected: it = S.begin(); it != S.end(); ++it) { pst.add(*it, *it); const typename Graph_::vertex_descriptor *const ri = pst.minAbove(*it); - if ( ri != NULL ) { + if ( ri != nullptr ) { typename Graph_::edge_descriptor existing_e; bool existing; // check whether the edge already exists diff --git a/Convex_hull_3/include/CGAL/Convex_hull_3/dual/halfspace_intersection_3.h b/Convex_hull_3/include/CGAL/Convex_hull_3/dual/halfspace_intersection_3.h index d1bcf055c62..b0bc8c62235 100644 --- a/Convex_hull_3/include/CGAL/Convex_hull_3/dual/halfspace_intersection_3.h +++ b/Convex_hull_3/include/CGAL/Convex_hull_3/dual/halfspace_intersection_3.h @@ -107,7 +107,7 @@ namespace CGAL result_inter result = CGAL::intersection(pp1, pp2, pp3); CGAL_assertion_msg(bool(result), "halfspace_intersection_3: no intersection"); - CGAL_assertion_msg(boost::get(& *result) != NULL, + CGAL_assertion_msg(boost::get(& *result) != nullptr, "halfspace_intersection_3: intersection is not a point"); const Point_3* pp = boost::get(& *result); diff --git a/Convex_hull_3/include/CGAL/convex_hull_3.h b/Convex_hull_3/include/CGAL/convex_hull_3.h index 63dbb592b43..14ddc9354ef 100644 --- a/Convex_hull_3/include/CGAL/convex_hull_3.h +++ b/Convex_hull_3/include/CGAL/convex_hull_3.h @@ -292,7 +292,7 @@ public: typedef typename Interval_nt_advanced::Protector Protector; Is_on_positive_side_of_plane_3(const Traits&,const Point_3& p_,const Point_3& q_,const Point_3& r_) - :p(p_),q(q_),r(r_),ck_plane(NULL),pk_plane(NULL) + :p(p_),q(q_),r(r_),ck_plane(nullptr),pk_plane(nullptr) { double pqx = q.x() - p.x(); double pqy = q.y() - p.y(); @@ -319,8 +319,8 @@ public: } ~Is_on_positive_side_of_plane_3(){ - if (ck_plane!=NULL) delete ck_plane; - if (pk_plane!=NULL) delete pk_plane; + if (ck_plane!=nullptr) delete ck_plane; + if (pk_plane!=nullptr) delete pk_plane; } bool operator() (const Point_3& s) const @@ -334,12 +334,12 @@ public: return static_res == 1; try{ - if (ck_plane==NULL) + if (ck_plane==nullptr) ck_plane=new typename CK::Plane_3(to_CK(p),to_CK(q),to_CK(r)); return ck_plane->has_on_positive_side(to_CK(s)); } catch (Uncertain_conversion_exception&){ - if (pk_plane==NULL) + if (pk_plane==nullptr) pk_plane=new typename PK::Plane_3(to_PK(p),to_PK(q),to_PK(r)); return pk_plane->has_on_positive_side(to_PK(s)); } diff --git a/Convex_hull_d/include/CGAL/Regular_complex_d.h b/Convex_hull_d/include/CGAL/Regular_complex_d.h index 0343e48d186..d46f0b54d7d 100644 --- a/Convex_hull_d/include/CGAL/Regular_complex_d.h +++ b/Convex_hull_d/include/CGAL/Regular_complex_d.h @@ -85,8 +85,8 @@ class RC_vertex_d public: RC_vertex_d(Simplex_handle s, int i, const Point_d& p) : s_(s), index_(i), point_(p) {} - RC_vertex_d(const Point_d& p) : point_(p), pp(NULL) {} - RC_vertex_d() : s_(), pp(NULL) {} + RC_vertex_d(const Point_d& p) : point_(p), pp(nullptr) {} + RC_vertex_d() : s_(), pp(nullptr) {} // beware that ass_point was initialized here by nil_point ~RC_vertex_d() {} @@ -213,9 +213,9 @@ public: #endif - RC_simplex_d() : pp(NULL) {} + RC_simplex_d() : pp(nullptr) {} RC_simplex_d(int dmax) : - vertices(dmax+1), neighbors(dmax+1), opposite_vertices(dmax+1), pp(NULL) + vertices(dmax+1), neighbors(dmax+1), opposite_vertices(dmax+1), pp(nullptr) { for (int i = 0; i <= dmax; i++) { neighbors[i] = Simplex_handle(); vertices[i] = Vertex_handle(); diff --git a/Documentation/doc/Documentation/Installation.txt b/Documentation/doc/Documentation/Installation.txt index 6b28949f8bd..aff9f17a02c 100644 --- a/Documentation/doc/Documentation/Installation.txt +++ b/Documentation/doc/Documentation/Installation.txt @@ -297,8 +297,8 @@ We next list the libraries and essential 3rd party software | :-------- | :------------- | :------------ | :----------- | | `%CGAL` | none | Main library | \sc{Gmp}, \sc{Mpfr}, \sc{Boost} (headers), Boost.Thread and Boost.System (library) for compilers not supporting the keywords `thread_local` and the class `std::mutex` | | `CGAL_Core` | `WITH_CGAL_Core` | The CORE library for algebraic numbers.\cgalFootnote{CGAL_Core is not part of \cgal, but a custom version of the \sc{Core} library distributed by \cgal for the user convenience and it has it's own license.} | \sc{Gmp} and \sc{Mpfr} | -| `CGAL_ImageIO` | `WITH_CGAL_ImageIO` | Utilities to read and write image files | \sc{OpenGL}, \sc{zlib}, \sc{Vtk}(optional) | -| `CGAL_Qt5` | `WITH_CGAL_Qt5` | `QGraphicsView` support for \sc{Qt}5-based demos | \sc{Qt}5 and \sc{OpenGL} | +| `CGAL_ImageIO` | `WITH_CGAL_ImageIO` | Utilities to read and write image files | \sc{zlib}, \sc{Vtk}(optional) | +| `CGAL_Qt5` | `WITH_CGAL_Qt5` | `QGraphicsView` support for \sc{Qt}5-based demos | \sc{Qt}5 | \subsection installation_debug Debug vs. Release @@ -444,17 +444,6 @@ In \cgal this library is used in the examples of the \ref PkgSurfaceMesher3Ref p If it is not already on your system, for instance, on Windows, you can download it from `http://www.zlib.net/`. -\subsection thirdpartyOpenGL OpenGL - -\sc{OpenGL} (Open Graphics Library) provides an API for applications that -produce 2D and 3D computer graphics. - -In \cgal the library is essential for the component -libCGAL_Qt5, as well as libCGAL_ImageIO and for various demos. - -Typically, \sc{OpenGL} is preinstalled on systems; if not, it can be -downloaded from `http://www.opengl.org/`. - \subsection thirdpartyQt Qt5 Qt is a cross-platform application and UI framework. @@ -478,8 +467,8 @@ the \cgal libraries, unless you set the variables `WITH_examples=ON` and/or `WIT Nevertheless, even when configured with \cgal, they are not automatically built along with the libraries. You must build the `examples` or `demos` targets (or IDE projects) explicitly. -If you do not plan to compile any demos, you might skip some of the essential libraries (as \sc{Qt} or -\sc{OpenGL}), as the corresponding \cgal-libraries are not linked. But for +If you do not plan to compile any demos, you might skip some of the essential libraries (as \sc{Qt}), +as the corresponding \cgal-libraries are not linked. But for your own demos you might need these \cgal-libraries. \section secoptional3rdpartysoftware Optional Third Party Libraries @@ -488,11 +477,6 @@ Optional 3rd party software can be used by \cgal for various reasons: Usually certain optional libraries are required to build examples and demos shipped with \cgal or to build your own project using \cgal. Another reason is to speed up basic tasks. -In order to support these goals, all optional libraries can be prepared to be -used with \cgal while configuring \cgal, just in the same way as -essential libraries are configured. Whenever building an example or a -demo (or your own executable), these preconfigured libraries -are available when using \cgal. \subsection thirdpartyLeda LEDA @@ -860,8 +844,7 @@ If the parameter is not given, the script creates one executable for each giv source file.
    `-c com1:com2:...`
    Lists components ("com1", "com2") of \cgal to which the executable(s) should be linked. Valid components are \cgal's -libraries (i.e.\ "Core", "ImageIO", and "Qt5") and all -preconfigured 3rd party software, such as "MPFI", "RS3"). An example is `-c Core:GMP:RS3:MPFI` +libraries (i.e.\ "Core", "ImageIO", and "Qt5"). An example is `-c Core`.
    `-b boost1:boost2:...`
    Lists components ("boost1", "boost2") of \sc{Boost} to which the executable(s) should be diff --git a/Envelope_2/include/CGAL/Envelope_2/Env_divide_and_conquer_2_impl.h b/Envelope_2/include/CGAL/Envelope_2/Env_divide_and_conquer_2_impl.h index 2acab99affd..395f38d2f6d 100644 --- a/Envelope_2/include/CGAL/Envelope_2/Env_divide_and_conquer_2_impl.h +++ b/Envelope_2/include/CGAL/Envelope_2/Env_divide_and_conquer_2_impl.h @@ -669,7 +669,7 @@ _merge_two_intervals(Edge_const_handle e1, bool is_leftmost1, objects.pop_front(); if ((intersection_point = CGAL::object_cast(&obj)) != - NULL) + nullptr) { // We have a simple intersection point. bool is_in_x_range = true; // true if the intersection point is to the @@ -751,7 +751,7 @@ _merge_two_intervals(Edge_const_handle e1, bool is_leftmost1, // curves. intersection_curve = CGAL::object_cast(&obj); - if (intersection_curve == NULL) + if (intersection_curve == nullptr) CGAL_error_msg("unrecognized intersection object."); // Get the endpoints of the overlapping curves. diff --git a/Envelope_2/include/CGAL/Envelope_diagram_1.h b/Envelope_2/include/CGAL/Envelope_diagram_1.h index e027392d407..39f13b879ee 100644 --- a/Envelope_2/include/CGAL/Envelope_diagram_1.h +++ b/Envelope_2/include/CGAL/Envelope_diagram_1.h @@ -62,15 +62,15 @@ public: public: /*! Constructor. */ Vertex () : - _leftP(NULL), - _rightP(NULL) + _leftP(nullptr), + _rightP(nullptr) {} /*! Constructor with a point. */ Vertex (const Point_2& p) : _p(p), - _leftP(NULL), - _rightP(NULL) + _leftP(nullptr), + _rightP(nullptr) {} /*! Get the point. */ @@ -175,8 +175,8 @@ public: public: /*! Constructor. */ Edge () : - _leftP(NULL), - _rightP(NULL) + _leftP(nullptr), + _rightP(nullptr) {} /*! Check if the edge represents an empty interval. */ @@ -435,14 +435,14 @@ private: Vertex* v; Edge* e = _leftmostP; - while (e != NULL) { + while (e != nullptr) { // Get a pointer to the next vertex. v = e->right(); // Free the edge and update it to be the next one after v. delete_edge (e); - if (v != NULL) { + if (v != nullptr) { e = v->right(); // Free the current vertex. @@ -450,12 +450,12 @@ private: } else { - e = NULL; + e = nullptr; } } - _leftmostP = NULL; - _rightmostP = NULL; + _leftmostP = nullptr; + _rightmostP = nullptr; } }; diff --git a/Envelope_3/include/CGAL/Envelope_3/Envelope_divide_and_conquer_3.h b/Envelope_3/include/CGAL/Envelope_3/Envelope_divide_and_conquer_3.h index 025d8d4b4ad..e1f27556183 100644 --- a/Envelope_3/include/CGAL/Envelope_3/Envelope_divide_and_conquer_3.h +++ b/Envelope_3/include/CGAL/Envelope_3/Envelope_divide_and_conquer_3.h @@ -1640,7 +1640,7 @@ protected: Self* b) : Md_observer(arr), base(b) { - CGAL_assertion(base != NULL); + CGAL_assertion(base != nullptr); } /* virtual void before_split_edge (Halfedge_handle e, @@ -1785,7 +1785,7 @@ protected: faces(f), base(b) { - CGAL_assertion(base != NULL); + CGAL_assertion(base != nullptr); } // Write the discover time for a given vertex. diff --git a/Envelope_3/include/CGAL/Envelope_3/Envelope_element_visitor_3.h b/Envelope_3/include/CGAL/Envelope_3/Envelope_element_visitor_3.h index d9b979dd2a9..318872cde28 100644 --- a/Envelope_3/include/CGAL/Envelope_3/Envelope_element_visitor_3.h +++ b/Envelope_3/include/CGAL/Envelope_3/Envelope_element_visitor_3.h @@ -566,14 +566,14 @@ public: for (; inter_it != intersections_list.end(); ++inter_it) { ip = object_cast(&(*inter_it)); - if (ip != NULL) + if (ip != nullptr) { split_points.push_back(Point_2_with_info(ip->first, false, false)); } else { icv = object_cast(&(*inter_it)); - CGAL_assertion(icv != NULL); + CGAL_assertion(icv != nullptr); // we will add the *icv end points to the split_points, unless // but we should be carefull with infinite curves. @@ -804,11 +804,11 @@ protected: visitor.init(&arr); if ((fh = object_cast(&obj)) - != NULL) + != nullptr) { vh_for_p = visitor.found_point_in_face(p, arr.non_const_handle(*fh)); } - else if ((hh = object_cast(&obj)) != NULL) + else if ((hh = object_cast(&obj)) != nullptr) { vh_for_p = visitor.found_point_on_edge(p , arr.non_const_handle(*hh)); } @@ -817,7 +817,7 @@ protected: // In this case p lies on an existing vertex, so we just update this // vertex. vh = object_cast(&obj); - CGAL_assertion(vh != NULL); + CGAL_assertion(vh != nullptr); vh_for_p = visitor.found_point_on_vertex(p, arr.non_const_handle(*vh)); } @@ -838,9 +838,9 @@ protected: // In either case, we try to copy decision from an incident face, is possible // before asking the geometric question Comparison_result resolve_minimal_face(Face_handle face, - Halfedge_handle* he = NULL) + Halfedge_handle* he = nullptr) { - CGAL_precondition(he == NULL || (*he)->face() == face); + CGAL_precondition(he == nullptr || (*he)->face() == face); Comparison_result res = EQUAL; bool success = false; @@ -855,7 +855,7 @@ protected: const Xy_monotone_surface_3& surf2 = get_aux_surface(face, 1); Ccb_halfedge_circulator hec; - if (he == NULL) + if (he == nullptr) { // compare the surfaces over arbitrary edge bool found_edge = false; @@ -2640,7 +2640,7 @@ protected: if (vi->is_isolated()) { CGAL_assertion(vi->face() == copied_face); - copied_vertices_to_halfedges[vi] = Halfedge_handle(NULL); + copied_vertices_to_halfedges[vi] = Halfedge_handle(nullptr); } else CGAL_assertion(copied_vertices_to_halfedges.is_defined(vi)); @@ -2740,7 +2740,7 @@ protected: Vertex_handle cur_t = new_he->target(); CGAL_assertion(copied_vertices_to_halfedges.is_defined(cur_t)); Halfedge_handle copied_b_he = copied_vertices_to_halfedges[cur_t]; - if (copied_b_he == Halfedge_handle(NULL)) + if (copied_b_he == Halfedge_handle(nullptr)) { // this was an isolated vertex, which we touch // since we have in the new edge aux sources as in the face, @@ -2802,7 +2802,7 @@ protected: Vertex_handle cur_t = new_he->source(); CGAL_assertion(copied_vertices_to_halfedges.is_defined(cur_t)); Halfedge_handle copied_b_he = copied_vertices_to_halfedges[cur_t]; - if (copied_b_he == Halfedge_handle(NULL)) + if (copied_b_he == Halfedge_handle(nullptr)) { // this was an isolated vertex, which we touch // since we have in the new edge aux sources as in the face, @@ -2862,12 +2862,12 @@ protected: { // we don't insert the subcurve, but it might touch a vertex of the // face's boundary - we need to check it and identify special vertices - if (left_v != Vertex_handle(NULL) && + if (left_v != Vertex_handle(nullptr) && copied_arr_orig_vertices.is_defined(left_v)) copied_arr_special_vertices[left_v] = copied_arr_special_vertices.default_value(); - if (right_v != Vertex_handle(NULL) && + if (right_v != Vertex_handle(nullptr) && copied_arr_orig_vertices.is_defined(right_v)) copied_arr_special_vertices[right_v] = copied_arr_special_vertices.default_value(); diff --git a/Filtered_kernel/include/CGAL/Filtered_kernel/Cartesian_coordinate_iterator_2.h b/Filtered_kernel/include/CGAL/Filtered_kernel/Cartesian_coordinate_iterator_2.h index 54e77dbe76a..609ddbb443e 100644 --- a/Filtered_kernel/include/CGAL/Filtered_kernel/Cartesian_coordinate_iterator_2.h +++ b/Filtered_kernel/include/CGAL/Filtered_kernel/Cartesian_coordinate_iterator_2.h @@ -55,7 +55,7 @@ public: typedef const value_type* pointer; Cartesian_coordinate_iterator_2() - : var((const P*) NULL), index(0) {} + : var((const P*) nullptr), index(0) {} Cartesian_coordinate_iterator_2(const P * const p, int _index = 0) : var(p), index(_index) {} diff --git a/Filtered_kernel/include/CGAL/Filtered_kernel/Cartesian_coordinate_iterator_3.h b/Filtered_kernel/include/CGAL/Filtered_kernel/Cartesian_coordinate_iterator_3.h index ead7f47de7b..f54e4c3b1c8 100644 --- a/Filtered_kernel/include/CGAL/Filtered_kernel/Cartesian_coordinate_iterator_3.h +++ b/Filtered_kernel/include/CGAL/Filtered_kernel/Cartesian_coordinate_iterator_3.h @@ -53,7 +53,7 @@ public: typedef const value_type* pointer; Cartesian_coordinate_iterator_3() - : var((const P*) NULL), index(0) {} + : var((const P*) nullptr), index(0) {} Cartesian_coordinate_iterator_3(const P *const p, int _index = 0) : var(p), index(_index) {} diff --git a/Filtered_kernel/include/CGAL/Lazy.h b/Filtered_kernel/include/CGAL/Lazy.h index c54296e8767..47e7dbbaf77 100644 --- a/Filtered_kernel/include/CGAL/Lazy.h +++ b/Filtered_kernel/include/CGAL/Lazy.h @@ -245,10 +245,10 @@ public: mutable ET *et; Lazy_rep () - : at(), et(NULL){} + : at(), et(nullptr){} Lazy_rep (const AT& a) - : at(a), et(NULL){} + : at(a), et(nullptr){} Lazy_rep (const AT& a, const ET& e) : at(a), et(new ET(e)) {} @@ -265,14 +265,14 @@ public: const ET & exact() const { - if (et==NULL) + if (et==nullptr) update_exact(); return *et; } ET & exact() { - if (et==NULL) + if (et==nullptr) update_exact(); return *et; } @@ -305,7 +305,7 @@ public: virtual void print_dag(std::ostream& os, int level) const {} #endif - bool is_lazy() const { return et == NULL; } + bool is_lazy() const { return et == nullptr; } virtual void update_exact() const = 0; virtual ~Lazy_rep() { delete et; } }; @@ -541,7 +541,7 @@ public: this->et = new ET(); //this->et->reserve(this->at.size()); ec()(CGAL::exact(l1_), std::back_inserter(*(this->et))); - if(this->et==NULL) + if(this->et==nullptr) E2A()(*(this->et)); this->at = E2A()(*(this->et)); // Prune lazy tree diff --git a/Generalized_map/doc/Generalized_map/Concepts/GeneralizedMap.h b/Generalized_map/doc/Generalized_map/Concepts/GeneralizedMap.h index 736a9b9f9e7..8aa5c11cf0e 100644 --- a/Generalized_map/doc/Generalized_map/Concepts/GeneralizedMap.h +++ b/Generalized_map/doc/Generalized_map/Concepts/GeneralizedMap.h @@ -110,7 +110,7 @@ template bool is_sewable(Dart_const_handle dh1, Dart_const_hand Links by \f$ \alpha_i\f$ two by two all the darts of the orbit D1=\f$ \langle{}\f$\f$ \alpha_0\f$,\f$ \ldots\f$,\f$ \alpha_{i-2}\f$,\f$ \alpha_{i+2}\f$,\f$ \ldots\f$,\f$ \alpha_d\f$\f$ \rangle{}\f$(`*dh1`) and D2=\f$ \langle{}\f$\f$ \alpha_0\f$,\f$ \alpha_2\f$,\f$ \ldots\f$,\f$ \alpha_{i-2}\f$,\f$ \alpha_{i+2}\f$,\f$ \ldots\f$,\f$ \alpha_d\f$\f$ \rangle{}\f$(`*dh2`) such that d2=f(d1), where f is the bijection between D1 and D2 satisfying: f(*dh1)=*dh2, and for all e\f$ \in\f$ D1, for all j\f$ \in\f$ {1,\f$ \ldots\f$,i-2,i+2,\f$ \ldots\f$,d}, f(\f$ \alpha_j\f$(e))=\f$ \alpha_j\f$(f(e)). -If \link GenericMap::are_attributes_automatically_managed `are_attributes_automatically_managed()`\endlink`==true`, when necessary, non void attributes are updated to ensure the validity of the generic map: for each j-cells c1 and c2 which are merged into one j-cell during the sew, the two associated attributes attr1 and attr2 are considered. If one attribute is NULL and the other not, the non NULL attribute is associated to all the darts of the resulting cell. When the two attributes are non NULL, functor \link CellAttribute::On_merge `Attribute_type::type::On_merge`\endlink is called on the two attributes attr1 and attr2. If set, the dynamic onmerge function of i-attributes is also called on attr1 and attr2. Then, the attribute attr1 is associated to all darts of the resulting j-cell. Finally, attribute attr2 is removed from the generic map. +If \link GenericMap::are_attributes_automatically_managed `are_attributes_automatically_managed()`\endlink`==true`, when necessary, non void attributes are updated to ensure the validity of the generic map: for each j-cells c1 and c2 which are merged into one j-cell during the sew, the two associated attributes attr1 and attr2 are considered. If one attribute is `nullptr` and the other not, the non `nullptr` attribute is associated to all the darts of the resulting cell. When the two attributes are non `nullptr`, functor \link CellAttribute::On_merge `Attribute_type::type::On_merge`\endlink is called on the two attributes attr1 and attr2. If set, the dynamic onmerge function of i-attributes is also called on attr1 and attr2. Then, the attribute attr1 is associated to all darts of the resulting j-cell. Finally, attribute attr2 is removed from the generic map. \pre \link GeneralizedMap::is_sewable `is_sewable(dh1,dh2)`\endlink. \cgalAdvancedBegin diff --git a/Generalized_map/doc/Generalized_map/Generalized_map.txt b/Generalized_map/doc/Generalized_map/Generalized_map.txt index 64fe82176bd..73790670fd0 100644 --- a/Generalized_map/doc/Generalized_map/Generalized_map.txt +++ b/Generalized_map/doc/Generalized_map/Generalized_map.txt @@ -314,14 +314,14 @@ Linking two darts d1 and d2 by \f$ \alpha_i\f$, with 0 \f$ \leq \f Reciprocally, unlinking a given dart d0 by \f$ \alpha_i\f$, with 0 \f$ \leq \f$ i \f$ \leq \f$ d, consists in modifying two \f$ \alpha_i\f$ pointers such that \f$ \alpha_i\f$(\f$ \alpha_i\f$(d0))=\f$ \alpha_i\f$(d0) and \f$ \alpha_i\f$(d0)=d0. Note that is it possible to unlink a given dart for \f$ \alpha_i\f$ only if it is not i-free. \cgalFigureBegin{fig_gmap_example_3d_sew,gmap_example_3d_sew.svg} -Example of 3-sew operation. Left: A 3D generalized map containing two volumes that are not connected, with 2-attributes. Each attribute contains a color in RGB format, and there are four 2-cells associated with attributes. Associations between darts and attributes are drawn with red segments. Right: The 3D generalized map obtained as result of \link GeneralizedMap::sew `sew<3>(1,a)`\endlink (or \link GeneralizedMap::sew `sew<3>(2,b)`\endlink ... or \link GeneralizedMap::sew `sew<3>(8,h)`\endlink). Darts (1,a), ..., (8,h) are linked together by \f$ \alpha_3\f$. The two 2-cells c1={1,...,8} and c2={a,...,h} are merged after the sew into the 2-cell {1,...,8,a,...,h}. We are in the case where the two attributes are non NULL, thus the first one is kept, and all the darts of c2 are associated with the first attribute. +Example of 3-sew operation. Left: A 3D generalized map containing two volumes that are not connected, with 2-attributes. Each attribute contains a color in RGB format, and there are four 2-cells associated with attributes. Associations between darts and attributes are drawn with red segments. Right: The 3D generalized map obtained as result of \link GeneralizedMap::sew `sew<3>(1,a)`\endlink (or \link GeneralizedMap::sew `sew<3>(2,b)`\endlink ... or \link GeneralizedMap::sew `sew<3>(8,h)`\endlink). Darts (1,a), ..., (8,h) are linked together by \f$ \alpha_3\f$. The two 2-cells c1={1,...,8} and c2={a,...,h} are merged after the sew into the 2-cell {1,...,8,a,...,h}. We are in the case where the two attributes are non `nullptr`, thus the first one is kept, and all the darts of c2 are associated with the first attribute. \cgalFigureEnd The \link GeneralizedMap::sew `sew(dh1,dh2)`\endlink method consists mainly to link two by two several darts by \f$ \alpha_i\f$. This operation is possible only if there is a bijection f between all the darts of the orbit D1=\f$ \langle{}\f$\f$ \alpha_1\f$,...,\f$ \alpha_{i-2}\f$,\f$ \alpha_{i+2}\f$,...,\f$ \alpha_d\f$\f$ \rangle{}\f$(d1) and D2=\f$ \langle{}\f$\f$ \alpha_1\f$,...,\f$ \alpha_{i-2}\f$,\f$ \alpha_{i+2}\f$,..., \f$ \alpha_d\f$\f$ \rangle{}\f$(d2) satisfying: f(d1)=d2, and for all e \f$ \in \f$ D1, for all j \f$ \in \f$ {1,..., i-2,i+2,...,d}, f(\f$ \alpha_j\f$(e))=\f$ \alpha_j^{-1}\f$(f(e)). Intuitively, this condition ensures the validity of the generalized map by verifying that condition discussed in Section \ref ssecgenmapvalidity "Generalized Map Properties" will be satisfied after the operation. This condition can be tested by using the method \link GeneralizedMap::is_sewable `is_sewable(dh1,dh2)`\endlink. For example, the function \link GeneralizedMap::is_sewable `is_sewable<3>`\endlink would return `false` if we tried to 3-sew a triangular facet with a quad facet. Note that given two darts d1 and d2, if there is such a bijection, it is uniquely defined. So giving the two darts as arguments of the \link GeneralizedMap::sew `sew`\endlink is enough to retrieve all the pairs of darts to link. If such a bijection exists, the \link GeneralizedMap::sew `sew(dh1,dh2)`\endlink operation consists only in linking by \f$ \alpha_i\f$ each couple of darts d3 and d4 such that d3=f(d4). -In addition, the sew operation updates the associations between darts and non void attributes in order to guarantee that all the darts belonging to a given cell are associated with the same attribute (which is a condition of generalized map validity). For each couple of j-cells c1 and c2 that are merged into one j-cell during the sew, we have to update the two associated attributes attr1 and attr2. If both are NULL, there is nothing to do. If one is NULL and the other not, we only associate the non NULL attribute to all the darts of the resulting cell. When the two attributes are non NULL, we first apply functor \link CellAttribute::On_merge `On_merge`\endlink on the two attributes attr1 and attr2 (see Section \ref ssecattributesgmap "Cell Attributes"). Then, we associate the attribute attr1 to all darts of the resulting j-cell. Finally, attribute attr2 is removed from the generalized map. +In addition, the sew operation updates the associations between darts and non void attributes in order to guarantee that all the darts belonging to a given cell are associated with the same attribute (which is a condition of generalized map validity). For each couple of j-cells c1 and c2 that are merged into one j-cell during the sew, we have to update the two associated attributes attr1 and attr2. If both are `nullptr`, there is nothing to do. If one is `nullptr` and the other not, we only associate the non `nullptr` attribute to all the darts of the resulting cell. When the two attributes are non `nullptr`, we first apply functor \link CellAttribute::On_merge `On_merge`\endlink on the two attributes attr1 and attr2 (see Section \ref ssecattributesgmap "Cell Attributes"). Then, we associate the attribute attr1 to all darts of the resulting j-cell. Finally, attribute attr2 is removed from the generalized map. -Note that when the two attributes are non NULL, the first one is kept. But user can customize this behavior in order to update the information contained in the attributes according to its needs. For that, we can define a specific functor, and use it as template argument for \link CellAttribute::On_merge `On_merge`\endlink parameter of the `Cell_attribute` definition. This functor can for example copy the information of the second attribute in the information of the first one to make as if the second attribute is kept. +Note that when the two attributes are non `nullptr`, the first one is kept. But user can customize this behavior in order to update the information contained in the attributes according to its needs. For that, we can define a specific functor, and use it as template argument for \link CellAttribute::On_merge `On_merge`\endlink parameter of the `Cell_attribute` definition. This functor can for example copy the information of the second attribute in the information of the first one to make as if the second attribute is kept. For example, in \cgalFigureRef{fig_gmap_example_3d_sew}, we want to 3-sew the two initial volumes. \link GeneralizedMap::sew `sew<3>(1,a)`\endlink links by \f$ \alpha_3\f$ the pairs of darts (1,a), ..., (8,g), thus the generalized map obtained is valid. 2-attributes are updated so that all the darts belonging to the 2-cell containing dart 1 become associated to the same 2-attribute after the operation. diff --git a/Generalized_map/include/CGAL/Generalized_map.h b/Generalized_map/include/CGAL/Generalized_map.h index 7ab7f4eadda..604b9b4eb06 100644 --- a/Generalized_map/include/CGAL/Generalized_map.h +++ b/Generalized_map/include/CGAL/Generalized_map.h @@ -195,7 +195,7 @@ namespace CGAL { void copy(const GMap2& amap, const Converters& converters, const DartInfoConverter& dartinfoconverter, const PointConverter& pointconverter, - boost::unordered_map* dart_mapping=NULL) + boost::unordered_map* dart_mapping=nullptr) { this->clear(); @@ -217,7 +217,7 @@ namespace CGAL { // (here we cannot use CGAL::Unique_hash_map because it does not provide // iterators... boost::unordered_map local_dartmap; - if (dart_mapping==NULL) + if (dart_mapping==nullptr) { dart_mapping=&local_dartmap; } @@ -267,7 +267,7 @@ namespace CGAL { template void copy(const GMap2& amap, - boost::unordered_map* dart_mapping=NULL) + boost::unordered_map* dart_mapping=nullptr) { std::tuple<> converters; Default_converter_dart_info dartinfoconverter; @@ -277,7 +277,7 @@ namespace CGAL { template void copy(const GMap2& amap, const Converters& converters, - boost::unordered_map* dart_mapping=NULL) + boost::unordered_map* dart_mapping=nullptr) { Default_converter_cmap_0attributes_with_point pointconverter; Default_converter_dart_info dartinfoconverter; @@ -287,7 +287,7 @@ namespace CGAL { template void copy(const GMap2& amap, const Converters& converters, const DartInfoConverter& dartinfoconverter, - boost::unordered_map* dart_mapping=NULL) + boost::unordered_map* dart_mapping=nullptr) { Default_converter_cmap_0attributes_with_point pointconverter; copy(amap, converters, dartinfoconverter, pointconverter, dart_mapping); @@ -472,7 +472,7 @@ namespace CGAL { } /** Return a dart belonging to the same edge and to the second vertex - * of the current edge (NULL if such a dart does not exist). + * of the current edge (nullptr if such a dart does not exist). * @return An handle to a dart belonging to the other extremity. */ Dart_handle other_extremity(Dart_handle dh) @@ -1299,10 +1299,10 @@ namespace CGAL { dart_link_alpha(dart2, dart1, i); } - /** Double link two darts, and update the NULL attributes. + /** Double link two darts, and update the nullptr attributes. * \em adart1 is i-linked to \em adart2 and \em adart2 is i-linked - * with \em adart1. The NULL attributes of \em adart1 are updated to - * non NULL attributes associated to \em adart2, and vice-versa. + * with \em adart1. The nullptr attributes of \em adart1 are updated to + * non nullptr attributes associated to \em adart2, and vice-versa. * If both darts have an attribute, the attribute of adart1 is * associated to adart2. * We can obtain a non-valid map with darts belonging to a same cell @@ -1325,8 +1325,8 @@ namespace CGAL { /** Double link a dart with alphai to a second dart. * \em adart1 is i-linked to \em adart2 and \em adart2 is i^-1-linked - * with \em adart1. The NULL attributes of \em adart1 are updated to - * non NULL attributes associated to \em adart2, and vice-versa, + * with \em adart1. The nullptr attributes of \em adart1 are updated to + * non nullptr attributes associated to \em adart2, and vice-versa, * if both darts have an attribute, the attribute of adart1 is * associated to adart2 (only if update_attributes==true). * @param adart1 a first dart. @@ -2120,8 +2120,8 @@ namespace CGAL { /** Compute the dual of a Generalized_map. * @param amap the gmap in which we build the dual of this map. - * @param adart a dart of the initial map, NULL by default. - * @return adart of the dual map, the dual of adart if adart!=NULL, + * @param adart a dart of the initial map, nullptr by default. + * @return adart of the dual map, the dual of adart if adart!=nullptr, * any dart otherwise. * As soon as we don't modify this map and amap map, we can iterate * simultaneously through all the darts of the two maps and we have @@ -2943,7 +2943,7 @@ namespace CGAL { } /** Insert a vertex in a given edge. - * @param adart a dart of the edge (!=NULL). + * @param adart a dart of the edge (!=nullptr). * @return a dart of the new vertex. */ Dart_handle insert_cell_0_in_cell_1( Dart_handle adart, @@ -3168,8 +3168,8 @@ namespace CGAL { } /** Insert an edge in a 2-cell between two given darts. - * @param adart1 a first dart of the facet (!=NULL && !=null_dart_handle). - * @param adart2 a second dart of the facet. If NULL insert a dangling edge. + * @param adart1 a first dart of the facet (!=nullptr && !=null_dart_handle). + * @param adart2 a second dart of the facet. If nullptr insert a dangling edge. * @return a dart of the new edge, and not incident to the * same vertex than adart1. */ @@ -3252,7 +3252,7 @@ namespace CGAL { else { if (are_attributes_automatically_managed() && - update_attributes && ah!=NULL) + update_attributes && ah!=nullptr) { internal::Set_i_attribute_of_dart_functor::run(*this, d2, ah); if (!isfree1) @@ -3310,7 +3310,7 @@ namespace CGAL { } /** Insert a dangling edge in a 2-cell between given by a dart. - * @param adart1 a first dart of the facet (!=NULL && !=null_dart_handle). + * @param adart1 a first dart of the facet (!=nullptr && !=null_dart_handle). * @param update_attributes a boolean to update the enabled attributes * @return a dart of the new edge, not incident to the vertex of adart1. */ @@ -3318,7 +3318,7 @@ namespace CGAL { typename Attribute_handle<0>:: type ah=null_handle, bool update_attributes=true ) - { return insert_cell_1_in_cell_2(adart1, NULL, update_attributes, ah); } + { return insert_cell_1_in_cell_2(adart1, nullptr, update_attributes, ah); } /** Test if a 2-cell can be inserted onto a given 3-cell along * a path of edges. @@ -3440,7 +3440,7 @@ namespace CGAL { basic_link_alpha<2>(alpha<0>(oldb2), alpha<0>(dd)); } else - oldb2=NULL; + oldb2=nullptr; basic_link_alpha<2>(*it, d); basic_link_alpha<2>(alpha<0>(*it), alpha<0>(d)); @@ -3478,7 +3478,7 @@ namespace CGAL { basic_link_alpha(dd, dddd, dim); basic_link_alpha(alpha<0>(dd), d0, dim); - if (oldb2!=NULL) + if (oldb2!=nullptr) { basic_link_alpha<2>(alpha(oldb2, dim), dddd); basic_link_alpha<2>(alpha(oldb2, 0, dim), d0); diff --git a/Generalized_map/include/CGAL/Generalized_map_storages.h b/Generalized_map/include/CGAL/Generalized_map_storages.h index bc68b8c2898..b928399b251 100644 --- a/Generalized_map/include/CGAL/Generalized_map_storages.h +++ b/Generalized_map/include/CGAL/Generalized_map_storages.h @@ -74,7 +74,7 @@ namespace CGAL { typedef typename Dart_container::const_iterator Dart_const_handle; typedef typename Dart_container::size_type size_type; - typedef CGAL::Void* Null_handle_type; + typedef std::nullptr_t Null_handle_type; static const Null_handle_type null_handle; typedef Items_ Items; @@ -128,18 +128,18 @@ namespace CGAL { /** Return if this dart is free for adimension. * @param dh a dart handle * @param i the dimension. - * @return true iff dh is linked with NULL for \em adimension. + * @return true iff dh is linked with nullptr for \em adimension. */ template bool is_free(Dart_const_handle dh) const { - CGAL_assertion( dh!=NULL ); + CGAL_assertion( dh!=nullptr ); CGAL_assertion(i <= dimension); return dh->mf[i]==dh; } bool is_free(Dart_const_handle dh, unsigned int i) const { - CGAL_assertion( dh!=NULL ); + CGAL_assertion( dh!=nullptr ); CGAL_assertion(i <= dimension); return dh->mf[i]==dh; } @@ -148,57 +148,57 @@ namespace CGAL { void set_dart_marks(Dart_const_handle ADart, const std::bitset& amarks) const { - CGAL_assertion( ADart!=NULL ); + CGAL_assertion( ADart!=nullptr ); ADart->set_marks(amarks); } /// Return all the marks of a dart. std::bitset get_dart_marks(Dart_const_handle ADart) const { - CGAL_assertion( ADart!=NULL ); + CGAL_assertion( ADart!=nullptr ); return ADart->get_marks(); } /// Return the mark value of dart a given mark number. bool get_dart_mark(Dart_const_handle ADart, size_type amark) const { - CGAL_assertion( ADart!=NULL ); + CGAL_assertion( ADart!=nullptr ); return ADart->get_mark(amark); } /// Set the mark of a given mark number to a given value. void set_dart_mark(Dart_const_handle ADart, size_type amark, bool avalue) const { - CGAL_assertion( ADart!=NULL ); + CGAL_assertion( ADart!=nullptr ); ADart->set_mark(amark, avalue); } /// Flip the mark of a given mark number to a given value. void flip_dart_mark(Dart_const_handle ADart, size_type amark) const { - CGAL_assertion( ADart!=NULL ); + CGAL_assertion( ADart!=nullptr ); ADart->flip_mark(amark); } // Access to alpha maps Dart_handle get_alpha(Dart_handle ADart, int B1) { - CGAL_assertion(ADart!=NULL && B1>=0 && B1<=(int)dimension); + CGAL_assertion(ADart!=nullptr && B1>=0 && B1<=(int)dimension); return ADart->mf[B1]; } Dart_const_handle get_alpha(Dart_const_handle ADart, int B1) const { - CGAL_assertion(ADart!=NULL && B1>=0 && B1<=(int)dimension); + CGAL_assertion(ADart!=nullptr && B1>=0 && B1<=(int)dimension); return ADart->mf[B1]; } template Dart_handle get_alpha(Dart_handle ADart) { - CGAL_assertion(ADart!=NULL && B1>=0 && B1<=(int)dimension); + CGAL_assertion(ADart!=nullptr && B1>=0 && B1<=(int)dimension); return ADart->mf[B1]; } template Dart_const_handle get_alpha(Dart_const_handle ADart) const { - CGAL_assertion(ADart!=NULL && B1>=0 && B1<=(int)dimension); + CGAL_assertion(ADart!=nullptr && B1>=0 && B1<=(int)dimension); return ADart->mf[B1]; } @@ -239,7 +239,7 @@ namespace CGAL { template bool is_valid_attribute(typename Attribute_const_handle::type ah) const { - CGAL_assertion( ah!=NULL ); + CGAL_assertion( ah!=nullptr ); return ah->is_valid(); } @@ -248,25 +248,25 @@ namespace CGAL { std::size_t get_attribute_ref_counting (typename Attribute_const_handle::type ah) const { - CGAL_assertion( ah!=NULL ); + CGAL_assertion( ah!=nullptr ); return ah->get_nb_refs(); } template void init_attribute_ref_counting(typename Attribute_handle::type ah) { - CGAL_assertion( ah!=NULL ); + CGAL_assertion( ah!=nullptr ); ah->mrefcounting=0; } template void inc_attribute_ref_counting(typename Attribute_handle::type ah) { - CGAL_assertion( ah!=NULL ); + CGAL_assertion( ah!=nullptr ); ah->inc_nb_refs(); } template void dec_attribute_ref_counting(typename Attribute_handle::type ah) { - CGAL_assertion( ah!=NULL ); + CGAL_assertion( ah!=nullptr ); ah->dec_nb_refs(); } @@ -275,14 +275,14 @@ namespace CGAL { typename Attribute_type::type& get_attribute(typename Attribute_handle::type ah) { - CGAL_assertion( ah!=NULL ); + CGAL_assertion( ah!=nullptr ); return *ah; } template const typename Attribute_type::type& get_attribute(typename Attribute_const_handle::type ah) const { - CGAL_assertion( ah!=NULL ); + CGAL_assertion( ah!=nullptr ); return *ah; } @@ -290,14 +290,14 @@ namespace CGAL { template Dart_handle dart_of_attribute(typename Attribute_handle::type ah) { - CGAL_assertion( ah!=NULL ); + CGAL_assertion( ah!=nullptr ); return ah->dart(); } template Dart_const_handle dart_of_attribute(typename Attribute_const_handle::type ah) const { - CGAL_assertion( ah!=NULL ); + CGAL_assertion( ah!=nullptr ); return ah->dart(); } @@ -306,7 +306,7 @@ namespace CGAL { void set_dart_of_attribute(typename Attribute_handle::type ah, Dart_handle adart) { - CGAL_assertion( ah!=NULL ); + CGAL_assertion( ah!=nullptr ); ah->set_dart(adart); } @@ -321,14 +321,14 @@ namespace CGAL { typename Attribute_type::type::Info & info_of_attribute(typename Attribute_handle::type ah) { - CGAL_assertion( ah!=NULL ); + CGAL_assertion( ah!=nullptr ); return ah->info(); } template const typename Attribute_type::type::Info & info_of_attribute(typename Attribute_const_handle::type ah) const { - CGAL_assertion( ah!=NULL ); + CGAL_assertion( ah!=nullptr ); return ah->info(); } @@ -336,16 +336,16 @@ namespace CGAL { template typename Attribute_type::type::Info & info(Dart_handle adart) { - CGAL_assertion( adart!=NULL ); - CGAL_assertion( attribute(adart)!=NULL ); + CGAL_assertion( adart!=nullptr ); + CGAL_assertion( attribute(adart)!=nullptr ); return info_of_attribute(attribute(adart)); } template const typename Attribute_type::type::Info & info(Dart_const_handle adart) const { - CGAL_assertion( adart!=NULL ); - CGAL_assertion( attribute(adart)!=NULL ); + CGAL_assertion( adart!=nullptr ); + CGAL_assertion( attribute(adart)!=nullptr ); return info_of_attribute(attribute(adart)); } @@ -353,15 +353,15 @@ namespace CGAL { template Dart_handle dart(Dart_handle adart) { - CGAL_assertion( adart!=NULL ); - CGAL_assertion( attribute(adart)!=NULL ); + CGAL_assertion( adart!=nullptr ); + CGAL_assertion( attribute(adart)!=nullptr ); return dart_of_attribute(attribute(adart)); } template Dart_const_handle dart(Dart_const_handle adart) const { - CGAL_assertion( adart!=NULL ); - CGAL_assertion( attribute(adart)!=NULL ); + CGAL_assertion( adart!=nullptr ); + CGAL_assertion( attribute(adart)!=nullptr ); return dart_of_attribute(attribute(adart)); } @@ -393,13 +393,13 @@ namespace CGAL { void dart_link_alpha(Dart_handle adart, Dart_handle adart2) { CGAL_assertion(i <= dimension); - CGAL_assertion(adart!=NULL && adart2!=NULL); + CGAL_assertion(adart!=nullptr && adart2!=nullptr); adart->mf[i] = adart2; } void dart_link_alpha(Dart_handle adart, Dart_handle adart2, unsigned int i) { CGAL_assertion(i <= dimension); - CGAL_assertion(adart!=NULL && adart2!=NULL); + CGAL_assertion(adart!=nullptr && adart2!=nullptr); adart->mf[i] = adart2; } @@ -410,12 +410,12 @@ namespace CGAL { template void dart_unlink_alpha(Dart_handle adart) { - CGAL_assertion(adart!=NULL && i <= dimension); + CGAL_assertion(adart!=nullptr && i <= dimension); adart->mf[i] = adart; } void dart_unlink_alpha(Dart_handle adart, unsigned int i) { - CGAL_assertion(adart!=NULL && i <= dimension); + CGAL_assertion(adart!=nullptr && i <= dimension); adart->mf[i] = adart; } @@ -430,7 +430,7 @@ namespace CGAL { /// null_handle template < unsigned int d_, class Items_, class Alloc_ > const typename Generalized_map_storage_1::Null_handle_type - Generalized_map_storage_1::null_handle = NULL; + Generalized_map_storage_1::null_handle = nullptr; } // namespace CGAL diff --git a/Generalized_map/include/CGAL/internal/Generalized_map_group_functors.h b/Generalized_map/include/CGAL/internal/Generalized_map_group_functors.h index 2344934a624..17524f46ed3 100644 --- a/Generalized_map/include/CGAL/internal/Generalized_map_group_functors.h +++ b/Generalized_map/include/CGAL/internal/Generalized_map_group_functors.h @@ -41,9 +41,9 @@ * given in the struct to enable specialization. * * GMap_group_attribute_functor to group the -attributes of two - * given i-cells (except for j-adim). If one i-attribute is NULL, we set the + * given i-cells (except for j-adim). If one i-attribute is nullptr, we set the * darts of its i-cell to the second attribute. If both i-attributes are - * non NULL, we overide all the i-attribute of the second i-cell to the + * non nullptr, we overide all the i-attribute of the second i-cell to the * first i-attribute. * * GMap_degroup_attribute_functor_run to degroup one i-attributes in two @@ -158,8 +158,8 @@ struct GMap_group_attribute_functor_run typename GMap::Dart_handle toSet = amap.null_handle; - // If the attribute associated to adart1 is NULL, set it with - // the attribute associated to adart2 (necessarily != NULL) + // If the attribute associated to adart1 is nullptr, set it with + // the attribute associated to adart2 (necessarily != nullptr) if (a1 == GMap::null_handle) { toSet = adart1; a1 = a2; } else diff --git a/Geomview/doc/Geomview/CGAL/IO/Geomview_stream.h b/Geomview/doc/Geomview/CGAL/IO/Geomview_stream.h index a93f3b86950..a44f933e059 100644 --- a/Geomview/doc/Geomview/CGAL/IO/Geomview_stream.h +++ b/Geomview/doc/Geomview/CGAL/IO/Geomview_stream.h @@ -34,13 +34,13 @@ public: /*! Introduces a Geomview stream `gs` with a camera that sees the bounding box. The command `geomview` must be in the user's `PATH`. - If `machine` and `login` are not `NULL`, + If `machine` and `login` are not `nullptr`, Geomview is started on the remote machine using `rsh`. */ Geomview_stream(const Bbox_3 &bbox = Bbox_3(0,0,0, 1,1,1), - const char *machine = NULL, - const char *login = NULL); + const char *machine = nullptr, + const char *login = nullptr); /// @} diff --git a/Geomview/include/CGAL/IO/Geomview_stream.h b/Geomview/include/CGAL/IO/Geomview_stream.h index 09843d6d947..dc963092db5 100644 --- a/Geomview/include/CGAL/IO/Geomview_stream.h +++ b/Geomview/include/CGAL/IO/Geomview_stream.h @@ -49,8 +49,8 @@ namespace CGAL { class CGAL_EXPORT Geomview_stream { public: Geomview_stream(const Bbox_3 &bbox = Bbox_3(0,0,0, 1,1,1), - const char *machine = NULL, - const char *login = NULL); + const char *machine = nullptr, + const char *login = nullptr); ~Geomview_stream(); diff --git a/Geomview/include/CGAL/IO/Geomview_stream_impl.h b/Geomview/include/CGAL/IO/Geomview_stream_impl.h index 2f69d81cb44..1e9b92f9365 100644 --- a/Geomview/include/CGAL/IO/Geomview_stream_impl.h +++ b/Geomview/include/CGAL/IO/Geomview_stream_impl.h @@ -100,10 +100,10 @@ void Geomview_stream::setup_geomview(const char *machine, const char *login) s += machine; s += ":0.0"; execlp("rsh", "rsh", machine, "-l", login, s.data(), - static_cast(NULL)); // cast to stop gcc warning + static_cast(nullptr)); // cast to stop gcc warning } else { execlp("geomview", "geomview", "-c", "-", - static_cast(NULL)); // cast to stop gcc warning + static_cast(nullptr)); // cast to stop gcc warning } // if we get to this point something went wrong. diff --git a/GraphicsView/include/CGAL/Buffer_for_vao.h b/GraphicsView/include/CGAL/Buffer_for_vao.h index a0148cd4c0b..c6790f79c9f 100644 --- a/GraphicsView/include/CGAL/Buffer_for_vao.h +++ b/GraphicsView/include/CGAL/Buffer_for_vao.h @@ -149,12 +149,12 @@ template class Buffer_for_vao { public: - Buffer_for_vao(std::vector* pos=NULL, - std::vector* indices=NULL, - CGAL::Bbox_3* bbox=NULL, - std::vector* color=NULL, - std::vector* flat_normal=NULL, - std::vector* gouraud_normal=NULL) : + Buffer_for_vao(std::vector* pos=nullptr, + std::vector* indices=nullptr, + CGAL::Bbox_3* bbox=nullptr, + std::vector* color=nullptr, + std::vector* flat_normal=nullptr, + std::vector* gouraud_normal=nullptr) : m_pos_buffer(pos), m_index_buffer(indices), m_color_buffer(color), @@ -166,37 +166,37 @@ public: void clear() { - if (m_pos_buffer!=NULL) { m_pos_buffer->clear(); } - if (m_color_buffer!=NULL) { m_color_buffer->clear(); } - if (m_index_buffer!=NULL) { m_index_buffer->clear(); } - if (m_flat_normal_buffer!=NULL) { m_flat_normal_buffer->clear(); } - if (m_gouraud_normal_buffer!=NULL) { m_gouraud_normal_buffer->clear(); } + if (m_pos_buffer!=nullptr) { m_pos_buffer->clear(); } + if (m_color_buffer!=nullptr) { m_color_buffer->clear(); } + if (m_index_buffer!=nullptr) { m_index_buffer->clear(); } + if (m_flat_normal_buffer!=nullptr) { m_flat_normal_buffer->clear(); } + if (m_gouraud_normal_buffer!=nullptr) { m_gouraud_normal_buffer->clear(); } } bool is_empty() const { return - (m_pos_buffer!=NULL && m_pos_buffer->empty()) && - (m_color_buffer!=NULL || m_color_buffer->empty()) && - (m_flat_normal_buffer!=NULL || m_flat_normal_buffer->empty()) && - (m_gouraud_normal_buffer!=NULL || m_gouraud_normal_buffer->empty()) && - (m_index_buffer!=NULL || m_index_buffer->empty()); + (m_pos_buffer!=nullptr && m_pos_buffer->empty()) && + (m_color_buffer!=nullptr || m_color_buffer->empty()) && + (m_flat_normal_buffer!=nullptr || m_flat_normal_buffer->empty()) && + (m_gouraud_normal_buffer!=nullptr || m_gouraud_normal_buffer->empty()) && + (m_index_buffer!=nullptr || m_index_buffer->empty()); } bool has_position() const - { return m_pos_buffer!=NULL; } + { return m_pos_buffer!=nullptr; } bool has_indices() const - { return m_index_buffer!=NULL; } + { return m_index_buffer!=nullptr; } bool has_color() const - { return m_color_buffer!=NULL; } + { return m_color_buffer!=nullptr; } bool has_flat_normal() const - { return m_flat_normal_buffer!=NULL; } + { return m_flat_normal_buffer!=nullptr; } bool has_gouraud_normal() const - { return m_gouraud_normal_buffer!=NULL; } + { return m_gouraud_normal_buffer!=nullptr; } // 1.1) Add a point, without color. Return the index of the added point. template @@ -207,7 +207,7 @@ public: Local_point p=internal::get_local_point(kp); add_point_in_buffer(p, *m_pos_buffer); - if (m_bb!=NULL) + if (m_bb!=nullptr) { (*m_bb)=(*m_bb)+p.bbox(); } return m_pos_buffer->size()-3; @@ -609,11 +609,11 @@ protected: bool with_vertex_normal=(m_vertex_normals_for_face.size()==m_points_of_face.size()); // (1) We insert all the edges as contraint in the CDT. - typename CDT::Vertex_handle previous=NULL, first=NULL; + typename CDT::Vertex_handle previous=nullptr, first=nullptr; for (unsigned int i=0; i0) { vh->info().index=m_indices_of_points_of_face[i]; } - if(previous!=NULL && previous!=vh) + if(previous!=nullptr && previous!=vh) { cdt.insert_constraint(previous, vh); } previous=vh; } - if (previous!=NULL && previous!=first) + if (previous!=nullptr && previous!=first) { cdt.insert_constraint(previous, first); } // (2) We mark all external triangles @@ -642,8 +642,8 @@ protected: } // (2.2) We check if the facet is external or internal std::queue face_queue; - typename CDT::Face_handle face_internal = NULL; - if (cdt.infinite_vertex()->face()!=NULL) + typename CDT::Face_handle face_internal = nullptr; + if (cdt.infinite_vertex()->face()!=nullptr) { face_queue.push(cdt.infinite_vertex()->face()); } while(!face_queue.empty()) { @@ -656,10 +656,10 @@ protected: { if(!cdt.is_constrained(std::make_pair(fh, i))) { - if (fh->neighbor(i)!=NULL) + if (fh->neighbor(i)!=nullptr) { face_queue.push(fh->neighbor(i)); } } - else if (face_internal==NULL) + else if (face_internal==nullptr) { face_internal = fh->neighbor(i); } @@ -667,7 +667,7 @@ protected: } } - if ( face_internal!=NULL ) + if ( face_internal!=nullptr ) { face_queue.push(face_internal); } while(!face_queue.empty()) @@ -682,7 +682,7 @@ protected: { if(!cdt.is_constrained(std::make_pair(fh, i))) { - if (fh->neighbor(i)!=NULL) + if (fh->neighbor(i)!=nullptr) { face_queue.push(fh->neighbor(i)); } } } @@ -733,21 +733,21 @@ protected: void add_color(const CGAL::Color& acolor) { - if (m_color_buffer!=NULL) + if (m_color_buffer!=nullptr) { add_color_in_buffer(acolor, *m_color_buffer); } } template void add_flat_normal(const KVector& kv) { - if(m_flat_normal_buffer != NULL) + if(m_flat_normal_buffer != nullptr) { add_normal_in_buffer(kv, *m_flat_normal_buffer); } } template void add_gouraud_normal(const KVector& kv) { - if(m_gouraud_normal_buffer != NULL) + if(m_gouraud_normal_buffer != nullptr) { add_normal_in_buffer(kv, *m_gouraud_normal_buffer); } } diff --git a/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h b/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h index 2799c1c5790..e4ae0184c19 100644 --- a/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h +++ b/GraphicsView/include/CGAL/Qt/Basic_viewer_qt.h @@ -185,31 +185,31 @@ public: m_ambient_color(0.6f, 0.5f, 0.5f, 0.5f), m_are_buffers_initialized(false), m_buffer_for_mono_points(&arrays[POS_MONO_POINTS], - NULL, + nullptr, &m_bounding_box, - NULL, NULL, NULL), + nullptr, nullptr, nullptr), m_buffer_for_colored_points(&arrays[POS_COLORED_POINTS], - NULL, + nullptr, &m_bounding_box, &arrays[COLOR_POINTS], - NULL, NULL), + nullptr, nullptr), m_buffer_for_mono_segments(&arrays[POS_MONO_SEGMENTS], - NULL, + nullptr, &m_bounding_box, - NULL, NULL, NULL), + nullptr, nullptr, nullptr), m_buffer_for_colored_segments(&arrays[POS_COLORED_SEGMENTS], - NULL, + nullptr, &m_bounding_box, &arrays[COLOR_SEGMENTS], - NULL, NULL), + nullptr, nullptr), m_buffer_for_mono_faces(&arrays[POS_MONO_FACES], - NULL, + nullptr, &m_bounding_box, - NULL, + nullptr, &arrays[FLAT_NORMAL_MONO_FACES], &arrays[SMOOTH_NORMAL_MONO_FACES]), m_buffer_for_colored_faces(&arrays[POS_COLORED_FACES], - NULL, + nullptr, &m_bounding_box, &arrays[COLOR_FACES], &arrays[FLAT_NORMAL_COLORED_FACES], diff --git a/GraphicsView/include/CGAL/Qt/DemosMainWindow_impl.h b/GraphicsView/include/CGAL/Qt/DemosMainWindow_impl.h index 96403ac859b..ce302aea060 100644 --- a/GraphicsView/include/CGAL/Qt/DemosMainWindow_impl.h +++ b/GraphicsView/include/CGAL/Qt/DemosMainWindow_impl.h @@ -239,7 +239,7 @@ CGAL_INLINE_FUNCTION QMenu* DemosMainWindow::getMenu(QString objectName, QString title) { - QMenu* menu = NULL; + QMenu* menu = nullptr; QString title2 = title; title2.remove('&'); @@ -257,7 +257,7 @@ DemosMainWindow::getMenu(QString objectName, QString title) } } } - return NULL; + return nullptr; } CGAL_INLINE_FUNCTION diff --git a/GraphicsView/include/CGAL/Qt/GraphicsViewNavigation_impl.h b/GraphicsView/include/CGAL/Qt/GraphicsViewNavigation_impl.h index 1d3bcef0287..c4a863c1e22 100644 --- a/GraphicsView/include/CGAL/Qt/GraphicsViewNavigation_impl.h +++ b/GraphicsView/include/CGAL/Qt/GraphicsViewNavigation_impl.h @@ -72,13 +72,13 @@ namespace Qt { GraphicsViewNavigation::eventFilter(QObject *obj, QEvent *event) { QGraphicsView* v = qobject_cast(obj); - if(v == NULL) { + if(v == nullptr) { QWidget* viewport = qobject_cast(obj); - if(viewport == NULL) { + if(viewport == nullptr) { return false; } v = qobject_cast(viewport->parent()); - if(v == NULL) { + if(v == nullptr) { return false; } } diff --git a/GraphicsView/include/CGAL/Qt/GraphicsViewPolylineInput_impl.h b/GraphicsView/include/CGAL/Qt/GraphicsViewPolylineInput_impl.h index c833110130b..f39ebab7b0b 100644 --- a/GraphicsView/include/CGAL/Qt/GraphicsViewPolylineInput_impl.h +++ b/GraphicsView/include/CGAL/Qt/GraphicsViewPolylineInput_impl.h @@ -48,7 +48,7 @@ GraphicsViewPolylineInput_non_templated_base(QObject* parent, QGraphicsScene* s, int n, bool closed) - : GraphicsViewInput(parent), closed_(closed), path_item(NULL), b(NULL), e(NULL), n_(n), scene_(s) + : GraphicsViewInput(parent), closed_(closed), path_item(nullptr), b(nullptr), e(nullptr), n_(n), scene_(s) {} @@ -67,7 +67,7 @@ GraphicsViewPolylineInput_non_templated_base::mousePressEvent(QGraphicsSceneMous if(path_item){ scene_->removeItem(path_item); delete path_item; - path_item = NULL; + path_item = nullptr; } if( (event->button() == ::Qt::RightButton) || (polygon.size() == n_) ){ // call the virtual function generate_polygon(), that emit a @@ -77,12 +77,12 @@ GraphicsViewPolylineInput_non_templated_base::mousePressEvent(QGraphicsSceneMous if(b){ scene_->removeItem(b); delete b; - b = NULL; + b = nullptr; } if(e){ scene_->removeItem(e); delete e; - e = NULL; + e = nullptr; } return true; } @@ -157,19 +157,19 @@ GraphicsViewPolylineInput_non_templated_base::keyPressEvent ( QKeyEvent * event if(b){ scene_->removeItem(b); delete b; - b = NULL; + b = nullptr; } if(e){ scene_->removeItem(e); delete e; - e = NULL; + e = nullptr; } return true; } if(path_item){ scene_->removeItem(path_item); delete path_item; - path_item = NULL; + path_item = nullptr; } QPainterPath qpp; qpp.addPolygon(polygon); diff --git a/GraphicsView/include/CGAL/Qt/camera.h b/GraphicsView/include/CGAL/Qt/camera.h index 293c1abb52c..39f8f30f53e 100644 --- a/GraphicsView/include/CGAL/Qt/camera.h +++ b/GraphicsView/include/CGAL/Qt/camera.h @@ -415,12 +415,12 @@ public: /*! @name 2D screen to 3D world coordinate systems conversions */ //@{ public: - Vec projectedCoordinatesOf(const Vec &src, const Frame *frame = NULL) const; - Vec unprojectedCoordinatesOf(const Vec &src, const Frame *frame = NULL) const; + Vec projectedCoordinatesOf(const Vec &src, const Frame *frame = nullptr) const; + Vec unprojectedCoordinatesOf(const Vec &src, const Frame *frame = nullptr) const; void getProjectedCoordinatesOf(const qreal src[3], qreal res[3], - const Frame *frame = NULL) const; + const Frame *frame = nullptr) const; void getUnprojectedCoordinatesOf(const qreal src[3], qreal res[3], - const Frame *frame = NULL) const; + const Frame *frame = nullptr) const; void convertClickToLine(const QPoint &pixel, Vec &orig, Vec &dir) const; Vec pointUnderPixel(const QPoint &pixel, bool &found) const; //@} diff --git a/GraphicsView/include/CGAL/Qt/camera_impl.h b/GraphicsView/include/CGAL/Qt/camera_impl.h index 0352d541744..10532ae5ba8 100644 --- a/GraphicsView/include/CGAL/Qt/camera_impl.h +++ b/GraphicsView/include/CGAL/Qt/camera_impl.h @@ -44,7 +44,7 @@ namespace qglviewer{ focusDistance(). */ CGAL_INLINE_FUNCTION Camera::Camera(QObject *parent) - : frame_(NULL), fieldOfView_(CGAL_PI / 4.0), modelViewMatrixIsUpToDate_(false), + : frame_(nullptr), fieldOfView_(CGAL_PI / 4.0), modelViewMatrixIsUpToDate_(false), projectionMatrixIsUpToDate_(false) { setParent(parent); // #CONNECTION# Camera copy constructor @@ -101,7 +101,7 @@ Camera::~Camera() { /*! Copy constructor. Performs a deep copy using operator=(). */ CGAL_INLINE_FUNCTION -Camera::Camera(const Camera &camera) : QObject(), frame_(NULL) { +Camera::Camera(const Camera &camera) : QObject(), frame_(nullptr) { // #CONNECTION# Camera constructor interpolationKfi_ = new KeyFrameInterpolator; // Requires the interpolationKfi_ @@ -144,7 +144,7 @@ Camera &Camera::operator=(const Camera &camera) { projectionMatrixIsUpToDate_ = false; // frame_ and interpolationKfi_ pointers are not shared. - frame_->setReferenceFrame(NULL); + frame_->setReferenceFrame(nullptr); frame_->setPosition(camera.position()); frame_->setOrientation(camera.orientation()); @@ -291,7 +291,7 @@ either. Use addKeyFrameToPath() and playPath() instead. This method is actually mainly useful if you derive the ManipulatedCameraFrame class and want to use an instance of your new class to move the Camera. -A \c NULL \p mcf pointer will silently be ignored. The calling method is +A \c nullptr \p mcf pointer will silently be ignored. The calling method is responsible for deleting the previous frame() pointer if needed in order to prevent memory leaks. */ CGAL_INLINE_FUNCTION @@ -1763,7 +1763,7 @@ int unProject(GLdouble winx, GLdouble winy, GLdouble winz, GLdouble *modelview, /*! Returns the screen projected coordinates of a point \p src defined in the \p frame coordinate system. - When \p frame in \c NULL (default), \p src is expressed in the world coordinate system. + When \p frame in \c nullptr (default), \p src is expressed in the world coordinate system. The x and y coordinates of the returned Vec are expressed in pixel, (0,0) being the \e upper left corner of the window. The z coordinate ranges between 0.0 (near plane) and 1.0 (excluded, far plane). See the \c gluProject man page for details. @@ -1847,7 +1847,7 @@ Vec Camera::projectedCoordinatesOf(const Vec& src, const Frame* frame) const /endcode Where z is the distance from the point you project to the camera, along the viewDirection(). See the \c gluUnProject man page for details. - The result is expressed in the \p frame coordinate system. When \p frame is \c NULL (default), the + The result is expressed in the \p frame coordinate system. When \p frame is \c nullptr (default), the result is expressed in the world coordinates system. The possible \p frame Frame::referenceFrame() are taken into account. projectedCoordinatesOf() performs the inverse transformation. @@ -1899,14 +1899,14 @@ void Camera::getUnprojectedCoordinatesOf(const qreal src[3], qreal res[3], /*! Returns the KeyFrameInterpolator that defines the Camera path number \p i. -If path \p i is not defined for this index, the method returns a \c NULL +If path \p i is not defined for this index, the method returns a \c nullptr pointer. */ CGAL_INLINE_FUNCTION KeyFrameInterpolator *Camera::keyFrameInterpolator(unsigned int i) const { if (kfi_.contains(i)) return kfi_[i]; else - return NULL; + return nullptr; } /*! Sets the KeyFrameInterpolator that defines the Camera path of index \p i. diff --git a/GraphicsView/include/CGAL/Qt/constraint.h b/GraphicsView/include/CGAL/Qt/constraint.h index 842ea58efb7..dd79ff00302 100644 --- a/GraphicsView/include/CGAL/Qt/constraint.h +++ b/GraphicsView/include/CGAL/Qt/constraint.h @@ -33,7 +33,7 @@ class Camera; This class defines the interface for the Constraints that can be applied to a Frame to limit its motion. Use Frame::setConstraint() to associate a - Constraint to a Frame (default is a \c NULL Frame::constraint()). + Constraint to a Frame (default is a \c nullptr Frame::constraint()).

    How does it work ?

    diff --git a/GraphicsView/include/CGAL/Qt/frame.h b/GraphicsView/include/CGAL/Qt/frame.h index bfc4e28538f..939e8505c63 100644 --- a/GraphicsView/include/CGAL/Qt/frame.h +++ b/GraphicsView/include/CGAL/Qt/frame.h @@ -70,7 +70,7 @@ class Constraint; The position and the orientation of a Frame are actually defined with respect to a referenceFrame(). The default referenceFrame() is the world coordinate - system (represented by a \c NULL referenceFrame()). If you setReferenceFrame() + system (represented by a \c nullptr referenceFrame()). If you setReferenceFrame() to a different Frame, you must then differentiate: \arg the \e local translation() and rotation(), defined with respect to the @@ -86,7 +86,7 @@ class Constraint; This terminology for \e local (translation() and rotation()) and \e global (position() and orientation()) definitions is used in all the methods' names and should be sufficient to prevent ambiguities. These notions are obviously - identical when the referenceFrame() is \c NULL, i.e. when the Frame is defined + identical when the referenceFrame() is \c nullptr, i.e. when the Frame is defined in the world coordinate system (the one you are in at the beginning of the CGAL::QGLViewer::draw() method, see the introduction page). @@ -111,7 +111,7 @@ class Constraint; An interesting feature of Frames is that their displacements can be constrained. When a Constraint is attached to a Frame, it filters the input of translate() and rotate(), and only the resulting filtered motion is applied to - the Frame. The default constraint() is \c NULL resulting in no filtering. Use + the Frame. The default constraint() is \c nullptr resulting in no filtering. Use setConstraint() to attach a Constraint to a frame. Constraints are especially usefull for the ManipulatedFrame instances, in @@ -156,7 +156,7 @@ Q_SIGNALS: \note If your Frame is part of a Frame hierarchy (see referenceFrame()), a modification of one of the parents of this Frame will \e not emit this signal. Use code like this to change this behavior (you can do this recursively for - all the referenceFrame() until the \c NULL world root frame is encountered): + all the referenceFrame() until the \c nullptr world root frame is encountered): \code // Emits the Frame modified() signal when its referenceFrame() is modified(). connect(myFrame->referenceFrame(), SIGNAL(modified()), myFrame, @@ -249,14 +249,14 @@ public: referenceFrame(). Use position() to get the result in the world coordinates. These two values - are identical when the referenceFrame() is \c NULL (default). + are identical when the referenceFrame() is \c nullptr (default). See also setTranslation() and setTranslationWithConstraint(). */ Vec translation() const { return t_; } /*! Returns the Frame rotation, defined with respect to the referenceFrame(). Use orientation() to get the result in the world coordinates. These two values - are identical when the referenceFrame() is \c NULL (default). + are identical when the referenceFrame() is \c nullptr (default). See also setRotation() and setRotationWithConstraint(). */ @@ -274,12 +274,12 @@ public: defined. The translation() and rotation() of the Frame are defined with respect to the - referenceFrame() coordinate system. A \c NULL referenceFrame() (default value) + referenceFrame() coordinate system. A \c nullptr referenceFrame() (default value) means that the Frame is defined in the world coordinate system. Use position() and orientation() to recursively convert values along the referenceFrame() chain and to get values expressed in the world coordinate - system. The values match when the referenceFrame() is \c NULL. + system. The values match when the referenceFrame() is \c nullptr. Use setReferenceFrame() to set this value and create a Frame hierarchy. Convenient functions allow you to convert 3D coordinates from one Frame to an @@ -359,7 +359,7 @@ public: // When In (resp. From) is appended to the names, the functions transform from // (resp. To) the frame that is given as an argument. The frame does not need - // to be in the same branch or the hierarchical tree, and can be \c NULL (the + // to be in the same branch or the hierarchical tree, and can be \c nullptr (the // world coordinates system). // Combining any of these functions with its inverse (in any order) leads to @@ -386,7 +386,7 @@ public: //@{ /*! Returns the current constraint applied to the Frame. - A \c NULL value (default) means that no Constraint is used to filter Frame + A \c nullptr value (default) means that no Constraint is used to filter Frame translation and rotation. See the Constraint class documentation for details. You may have to use a \c dynamic_cast to convert the result to a Constraint @@ -394,7 +394,7 @@ public: Constraint *constraint() const { return constraint_; } /*! Sets the constraint() attached to the Frame. - A \c NULL value means no constraint. The previous constraint() should be + A \c nullptr value means no constraint. The previous constraint() should be deleted by the calling method if needed. */ void setConstraint(Constraint *const constraint) { constraint_ = constraint; } //@} @@ -423,7 +423,7 @@ public: original orientation. Its position() is the negated and inverse rotated image of the original position. - The result Frame has a \c NULL referenceFrame() and a \c NULL constraint(). + The result Frame has a \c nullptr referenceFrame() and a \c nullptr constraint(). Use inverse() for a local (i.e. with respect to referenceFrame()) transformation inverse. */ diff --git a/GraphicsView/include/CGAL/Qt/frame_impl.h b/GraphicsView/include/CGAL/Qt/frame_impl.h index acacb62c9b4..da0b5afb3bf 100644 --- a/GraphicsView/include/CGAL/Qt/frame_impl.h +++ b/GraphicsView/include/CGAL/Qt/frame_impl.h @@ -39,9 +39,9 @@ namespace qglviewer{ /*! Creates a default Frame. Its position() is (0,0,0) and it has an identity orientation() Quaternion. The - referenceFrame() and the constraint() are \c NULL. */ + referenceFrame() and the constraint() are \c nullptr. */ CGAL_INLINE_FUNCTION -Frame::Frame() : constraint_(NULL), referenceFrame_(NULL) {} +Frame::Frame() : constraint_(nullptr), referenceFrame_(nullptr) {} /*! Creates a Frame with a position() and an orientation(). @@ -49,10 +49,10 @@ Frame::Frame() : constraint_(NULL), referenceFrame_(NULL) {} methods. The Frame is defined in the world coordinate system (its referenceFrame() is \c - NULL). It has a \c NULL associated constraint(). */ + nullptr). It has a \c nullptr associated constraint(). */ CGAL_INLINE_FUNCTION Frame::Frame(const Vec &position, const Quaternion &orientation) - : t_(position), q_(orientation), constraint_(NULL), referenceFrame_(NULL) {} + : t_(position), q_(orientation), constraint_(nullptr), referenceFrame_(nullptr) {} /*! Equal operator. @@ -118,7 +118,7 @@ Frame::Frame(const Frame &frame) : QObject() { (*this) = frame; } This matrix only represents the local Frame transformation (i.e. with respect to the referenceFrame()). Use worldMatrix() to get the full Frame transformation matrix (i.e. from the world to the Frame coordinate system). - These two match when the referenceFrame() is \c NULL. + These two match when the referenceFrame() is \c nullptr. The result is only valid until the next call to matrix(), getMatrix(), worldMatrix() or getWorldMatrix(). Use it immediately (as above) or use @@ -170,7 +170,7 @@ void Frame::getMatrix(GLdouble m[16]) const { Only the local Frame transformation (i.e. defined with respect to the referenceFrame()) is inverted. Use worldInverse() for a global inverse. - The resulting Frame has the same referenceFrame() as the Frame and a \c NULL + The resulting Frame has the same referenceFrame() as the Frame and a \c nullptr constraint(). \note The scaling factor of the 4x4 matrix is 1.0. */ @@ -198,7 +198,7 @@ Frame Frame::inverse() const { referenceFrame() hierarchy is taken into account to define the Frame transformation from the world coordinate system. Use matrix() to get the local Frame transformation matrix (i.e. defined with respect to the - referenceFrame()). These two match when the referenceFrame() is \c NULL. + referenceFrame()). These two match when the referenceFrame() is \c nullptr. The OpenGL format of the result is the transpose of the actual mathematical European representation (translation is on the last \e line instead of the @@ -574,7 +574,7 @@ CGAL_INLINE_FUNCTION Quaternion Frame::orientation() const { Quaternion res = rotation(); const Frame *fr = referenceFrame(); - while (fr != NULL) { + while (fr != nullptr) { res = fr->rotation() * res; fr = fr->referenceFrame(); } @@ -691,7 +691,7 @@ Emits the modified() signal if \p refFrame differs from the current referenceFrame(). Using this method, you can create a hierarchy of Frames. This hierarchy needs to -be a tree, which root is the world coordinate system (i.e. a \c NULL +be a tree, which root is the world coordinate system (i.e. a \c nullptr referenceFrame()). A warning is printed and no action is performed if setting \p refFrame as the referenceFrame() would create a loop in the Frame hierarchy (see settingAsReferenceFrameWillCreateALoop()). */ @@ -712,7 +712,7 @@ void Frame::setReferenceFrame(const Frame *const refFrame) { CGAL_INLINE_FUNCTION bool Frame::settingAsReferenceFrameWillCreateALoop(const Frame *const frame) { const Frame *f = frame; - while (f != NULL) { + while (f != nullptr) { if (f == this) return true; f = f->referenceFrame(); @@ -748,7 +748,7 @@ CGAL_INLINE_FUNCTION Vec Frame::inverseCoordinatesOf(const Vec &src) const { const Frame *fr = this; Vec res = src; - while (fr != NULL) { + while (fr != nullptr) { res = fr->localInverseCoordinatesOf(res); fr = fr->referenceFrame(); } @@ -797,7 +797,7 @@ CGAL_INLINE_FUNCTION Vec Frame::coordinatesOfIn(const Vec &src, const Frame *const in) const { const Frame *fr = this; Vec res = src; - while ((fr != NULL) && (fr != in)) { + while ((fr != nullptr) && (fr != in)) { res = fr->localInverseCoordinatesOf(res); fr = fr->referenceFrame(); } @@ -892,7 +892,7 @@ CGAL_INLINE_FUNCTION Vec Frame::inverseTransformOf(const Vec &src) const { const Frame *fr = this; Vec res = src; - while (fr != NULL) { + while (fr != nullptr) { res = fr->localInverseTransformOf(res); fr = fr->referenceFrame(); } @@ -942,7 +942,7 @@ CGAL_INLINE_FUNCTION Vec Frame::transformOfIn(const Vec &src, const Frame *const in) const { const Frame *fr = this; Vec res = src; - while ((fr != NULL) && (fr != in)) { + while ((fr != nullptr) && (fr != in)) { res = fr->localInverseTransformOf(res); fr = fr->referenceFrame(); } @@ -1092,7 +1092,7 @@ alignment. The new Frame's position() is such that the \p frame position (computed with coordinatesOf(), in the Frame coordinates system) does not change. -\p frame may be \c NULL and then represents the world coordinate system (same +\p frame may be \c nullptr and then represents the world coordinate system (same convention than for the referenceFrame()). The rotation (and translation when \p move is \c true) applied to the Frame are diff --git a/GraphicsView/include/CGAL/Qt/image_interface.h b/GraphicsView/include/CGAL/Qt/image_interface.h index aa423eb5587..8be43c91707 100644 --- a/GraphicsView/include/CGAL/Qt/image_interface.h +++ b/GraphicsView/include/CGAL/Qt/image_interface.h @@ -36,7 +36,7 @@ public: ImageInterface(QWidget *parent, qreal ratio) : QDialog(parent), ratio(ratio) { - currentlyFocused = NULL; + currentlyFocused = nullptr; setupUi(this); connect(imgHeight, SIGNAL(valueChanged(int)), this, SLOT(imgHeightValueChanged(int))); diff --git a/GraphicsView/include/CGAL/Qt/keyFrameInterpolator.h b/GraphicsView/include/CGAL/Qt/keyFrameInterpolator.h index 2090b3f6de8..31906dfdca9 100644 --- a/GraphicsView/include/CGAL/Qt/keyFrameInterpolator.h +++ b/GraphicsView/include/CGAL/Qt/keyFrameInterpolator.h @@ -131,7 +131,7 @@ class CGAL_QT_EXPORT KeyFrameInterpolator : public QObject { Q_OBJECT public: - KeyFrameInterpolator(Frame *fr = NULL); + KeyFrameInterpolator(Frame *fr = nullptr); virtual ~KeyFrameInterpolator(); Q_SIGNALS: diff --git a/GraphicsView/include/CGAL/Qt/keyFrameInterpolator_impl.h b/GraphicsView/include/CGAL/Qt/keyFrameInterpolator_impl.h index a591734c161..d38060fcdb1 100644 --- a/GraphicsView/include/CGAL/Qt/keyFrameInterpolator_impl.h +++ b/GraphicsView/include/CGAL/Qt/keyFrameInterpolator_impl.h @@ -41,7 +41,7 @@ namespace qglviewer{ their default values. */ CGAL_INLINE_FUNCTION KeyFrameInterpolator::KeyFrameInterpolator(Frame *frame) - : frame_(NULL), period_(40), interpolationTime_(0.0), + : frame_(nullptr), period_(40), interpolationTime_(0.0), interpolationSpeed_(1.0), interpolationStarted_(false), closedPath_(false), loopInterpolation_(false), pathIsValid_(false), valuesAreValid_(true), currentFrameValid_(false) @@ -181,7 +181,7 @@ void KeyFrameInterpolator::resetInterpolation() { edited, even during the interpolation. See the keyFrames example for an illustration. - \c NULL \p frame pointers are silently ignored. The keyFrameTime() has to be + \c nullptr \p frame pointers are silently ignored. The keyFrameTime() has to be monotonously increasing over keyFrames. Use addKeyFrame(const Frame&, qreal) to add keyFrame by values. */ @@ -290,7 +290,7 @@ void KeyFrameInterpolator::updateModifiedFrameValues() { kf = keyFrame_.first(); int index = 1; while (kf) { - KeyFrame *next = (index < keyFrame_.size()) ? keyFrame_.at(index) : NULL; + KeyFrame *next = (index < keyFrame_.size()) ? keyFrame_.at(index) : nullptr; index++; if (next) kf->computeTangent(prev, next); @@ -538,7 +538,7 @@ void KeyFrameInterpolator::initFromDOMElement(const QDomElement &element) { setClosedPath(DomUtils::boolFromDom(element, "closedPath", false)); setLoopInterpolation(DomUtils::boolFromDom(element, "loop", false)); - // setFrame(NULL); + // setFrame(nullptr); pathIsValid_ = false; valuesAreValid_ = false; currentFrameValid_ = false; @@ -551,7 +551,7 @@ void KeyFrameInterpolator::initFromDOMElement(const QDomElement &element) { //////////// KeyFrame private class implementation ///////// CGAL_INLINE_FUNCTION KeyFrameInterpolator::KeyFrame::KeyFrame(const Frame &fr, qreal t) - : time_(t), frame_(NULL) { + : time_(t), frame_(nullptr) { p_ = fr.position(); q_ = fr.orientation(); } diff --git a/GraphicsView/include/CGAL/Qt/manipulatedFrame_impl.h b/GraphicsView/include/CGAL/Qt/manipulatedFrame_impl.h index e8ded238fa0..0bb8ef620e6 100644 --- a/GraphicsView/include/CGAL/Qt/manipulatedFrame_impl.h +++ b/GraphicsView/include/CGAL/Qt/manipulatedFrame_impl.h @@ -59,7 +59,7 @@ ManipulatedFrame::ManipulatedFrame() setZoomSensitivity(1.0); isSpinning_ = false; - previousConstraint_ = NULL; + previousConstraint_ = nullptr; connect(&spinningTimer_, SIGNAL(timeout()), SLOT(spinUpdate())); } @@ -154,7 +154,7 @@ restored and are left unchanged. See Vec::initFromDOMElement() for a complete code example. */ CGAL_INLINE_FUNCTION void ManipulatedFrame::initFromDOMElement(const QDomElement &element) { - // Not called since it would set constraint() and referenceFrame() to NULL. + // Not called since it would set constraint() and referenceFrame() to nullptr. // *this = ManipulatedFrame(); Frame::initFromDOMElement(element); @@ -230,10 +230,10 @@ void ManipulatedFrame::startAction(int ma, bool withConstraint) { // manipulatedCameraFrame::wheelEvent and mouseReleaseEvent() restore previous // constraint if (withConstraint) - previousConstraint_ = NULL; + previousConstraint_ = nullptr; else { previousConstraint_ = constraint(); - setConstraint(NULL); + setConstraint(nullptr); } switch (action_) { diff --git a/GraphicsView/include/CGAL/Qt/qglviewer.h b/GraphicsView/include/CGAL/Qt/qglviewer.h index f13f5a5ed1c..4e18cd3f515 100644 --- a/GraphicsView/include/CGAL/Qt/qglviewer.h +++ b/GraphicsView/include/CGAL/Qt/qglviewer.h @@ -292,7 +292,7 @@ public Q_SLOTS: /*! @name Associated objects */ //@{ public: - /*! Returns the associated qglviewer::Camera, never \c NULL. */ + /*! Returns the associated qglviewer::Camera, never \c nullptr. */ qglviewer::Camera *camera() const { return camera_; } /*! Returns the viewer's qglviewer::ManipulatedFrame. @@ -304,7 +304,7 @@ public: See the manipulatedFrame example for a complete implementation. - Default value is \c NULL, meaning that no qglviewer::ManipulatedFrame is set. + Default value is \c nullptr, meaning that no qglviewer::ManipulatedFrame is set. */ qglviewer::ManipulatedFrame *manipulatedFrame() const { return manipulatedFrame_; @@ -318,7 +318,7 @@ public Q_SLOTS: /*! @name Mouse grabbers */ //@{ public: - /*! Returns the current qglviewer::MouseGrabber, or \c NULL if no + /*! Returns the current qglviewer::MouseGrabber, or \c nullptr if no qglviewer::MouseGrabber currently grabs mouse events. When qglviewer::MouseGrabber::grabsMouse(), the different mouse events are @@ -621,7 +621,7 @@ Q_SIGNALS: /*! Signal emitted by setMouseGrabber() when the mouseGrabber() is changed. \p mouseGrabber is a pointer to the new MouseGrabber. Note that this signal is - emitted with a \c NULL parameter each time a MouseGrabber stops grabbing + emitted with a \c nullptr parameter each time a MouseGrabber stops grabbing mouse. */ void mouseGrabberChanged(qglviewer::MouseGrabber *mouseGrabber); @@ -963,7 +963,7 @@ protected: //@{ public: /*! Returns a \c QList that contains pointers to all the created QGLViewers. - Note that this list may contain \c NULL pointers if the associated viewer + Note that this list may contain \c nullptr pointers if the associated viewer has been deleted. Can be useful to apply a method or to connect a signal to all the viewers: @@ -978,7 +978,7 @@ public: index in unique and can be used to identify the different created QGLViewers (see stateFileName() for an application example). - When a QGLViewer is deleted, the QGLViewers' indexes are preserved and NULL is + When a QGLViewer is deleted, the QGLViewers' indexes are preserved and nullptr is set for that index. When a QGLViewer is created, it is placed in the first available position in that list. Returns -1 if the QGLViewer could not be found (which should not be possible). */ diff --git a/GraphicsView/include/CGAL/Qt/qglviewer_impl.h b/GraphicsView/include/CGAL/Qt/qglviewer_impl.h index 2045b0aabec..4266a0f8bdc 100644 --- a/GraphicsView/include/CGAL/Qt/qglviewer_impl.h +++ b/GraphicsView/include/CGAL/Qt/qglviewer_impl.h @@ -111,15 +111,15 @@ void CGAL::QGLViewer::defaultConstructor() { // setFullScreen(true) // #CONNECTION# default values in initFromDOMElement() - manipulatedFrame_ = NULL; + manipulatedFrame_ = nullptr; manipulatedFrameIsACamera_ = false; mouseGrabberIsAManipulatedFrame_ = false; mouseGrabberIsAManipulatedCameraFrame_ = false; displayMessage_ = false; connect(&messageTimer_, SIGNAL(timeout()), SLOT(hideMessage())); messageTimer_.setSingleShot(true); - helpWidget_ = NULL; - setMouseGrabber(NULL); + helpWidget_ = nullptr; + setMouseGrabber(nullptr); setSceneRadius(1.0); showEntireScene(); @@ -139,7 +139,7 @@ void CGAL::QGLViewer::defaultConstructor() { stopAnimation(); setAnimationPeriod(40); // 25Hz - selectBuffer_ = NULL; + selectBuffer_ = nullptr; setSelectBufferSize(4 * 1000); setSelectRegionWidth(3); setSelectRegionHeight(3); @@ -158,10 +158,10 @@ void CGAL::QGLViewer::defaultConstructor() { axisIsDrawn_ = true; _offset = CGAL::qglviewer::Vec(0,0,0); - stored_fbo = NULL; + stored_fbo = nullptr; is_sharing = false; is_linked = false; - shared_context = NULL; + shared_context = nullptr; } CGAL_INLINE_FUNCTION @@ -181,7 +181,7 @@ CGAL::QGLViewer::QGLViewer(QOpenGLContext* context, QWidget *parent, /*! Virtual destructor. -The viewer is replaced by \c NULL in the QGLViewerPool() (in order to preserve +The viewer is replaced by \c nullptr in the QGLViewerPool() (in order to preserve other viewer's indexes) and allocated memory is released. The camera() is deleted and should be copied before if it is shared by an other viewer. */ CGAL_INLINE_FUNCTION @@ -787,7 +787,7 @@ It you simply want to save and restore Camera positions, use CGAL::qglviewer::Camera::addKeyFrameToPath() and CGAL::qglviewer::Camera::playPath() instead. -This method silently ignores \c NULL \p camera pointers. The calling method is +This method silently ignores \c nullptr \p camera pointers. The calling method is responsible for deleting the previous camera pointer in order to prevent memory leaks if needed. @@ -1412,7 +1412,7 @@ void CGAL::QGLViewer::mouseMoveEvent(QMouseEvent *e) { else mouseGrabber()->mouseMoveEvent(e, camera()); else - setMouseGrabber(NULL); + setMouseGrabber(nullptr); update(); } @@ -1463,7 +1463,7 @@ void CGAL::QGLViewer::mouseReleaseEvent(QMouseEvent *e) { mouseGrabber()->mouseReleaseEvent(e, camera()); mouseGrabber()->checkIfGrabsMouse(e->x(), e->y(), camera()); if (!(mouseGrabber()->grabsMouse())) - setMouseGrabber(NULL); + setMouseGrabber(nullptr); // update(); } else //#CONNECTION# mouseMoveEvent has the same structure @@ -1597,9 +1597,9 @@ void CGAL::QGLViewer::setMouseGrabber(qglviewer::MouseGrabber *mouseGrabber) { mouseGrabber_ = mouseGrabber; mouseGrabberIsAManipulatedFrame_ = - (dynamic_cast(mouseGrabber) != NULL); + (dynamic_cast(mouseGrabber) != nullptr); mouseGrabberIsAManipulatedCameraFrame_ = - ((dynamic_cast(mouseGrabber) != NULL) && + ((dynamic_cast(mouseGrabber) != nullptr) && (mouseGrabber != camera()->frame())); Q_EMIT mouseGrabberChanged(mouseGrabber); } @@ -2137,13 +2137,13 @@ void CGAL::QGLViewer::help() { tr("&About", "Help window about title")}; if (!helpWidget()) { - // Qt4 requires a NULL parent... - helpWidget_ = new QTabWidget(NULL); + // Qt4 requires a nullptr parent... + helpWidget_ = new QTabWidget(nullptr); helpWidget()->setWindowTitle(tr("Help", "Help window title")); resize = true; for (int i = 0; i < 4; ++i) { - QTextEdit *tab = new QTextEdit(NULL); + QTextEdit *tab = new QTextEdit(nullptr); tab->setReadOnly(true); helpWidget()->insertTab(i, tab, label[i]); @@ -2284,7 +2284,7 @@ void CGAL::QGLViewer::keyPressEvent(QKeyEvent *e) { camera()->deletePath(index); } } else { - bool nullBefore = (camera()->keyFrameInterpolator(index) == NULL); + bool nullBefore = (camera()->keyFrameInterpolator(index) == nullptr); camera()->addKeyFrameToPath(index); if (nullBefore) connect(camera()->keyFrameInterpolator(index), SIGNAL(interpolated()), @@ -3084,7 +3084,7 @@ void CGAL::QGLViewer::setManipulatedFrame(qglviewer::ManipulatedFrame *frame) { manipulatedFrameIsACamera_ = ((manipulatedFrame() != camera()->frame()) && - (dynamic_cast(manipulatedFrame()) != NULL)); + (dynamic_cast(manipulatedFrame()) != nullptr)); if (manipulatedFrame()) { // Prevent multiple connections, that would result in useless display @@ -3976,7 +3976,7 @@ QImage* CGAL::QGLViewer::takeSnapshot( CGAL::qglviewer::SnapShotBackground back setBackgroundColor(c); } else - return NULL; + return nullptr; break; } @@ -4029,7 +4029,7 @@ QImage* CGAL::QGLViewer::takeSnapshot( CGAL::qglviewer::SnapShotBackground back "Unable to create resulting image", QMessageBox::Ok, QMessageBox::NoButton); setBackgroundColor(previousBGColor); - return NULL; + return nullptr; } qreal scaleX = subSize.width() / static_cast(finalSize.width()); @@ -4090,7 +4090,7 @@ QImage* CGAL::QGLViewer::takeSnapshot( CGAL::qglviewer::SnapShotBackground back if(background_color !=0) setBackgroundColor(previousBGColor); camera()->setFrustum(frustum); - stored_fbo = NULL; + stored_fbo = nullptr; return image; } @@ -4110,7 +4110,7 @@ CGAL_INLINE_FUNCTION void CGAL::QGLViewer::saveSnapshot() { qreal aspectRatio = width() / static_cast(height()); - static ImageInterface* imageInterface = NULL; + static ImageInterface* imageInterface = nullptr; if (!imageInterface) imageInterface = new ImageInterface(this, aspectRatio); diff --git a/HalfedgeDS/doc/HalfedgeDS/Concepts/HalfedgeDS.h b/HalfedgeDS/doc/HalfedgeDS/Concepts/HalfedgeDS.h index b8bbf25099c..35c70056a57 100644 --- a/HalfedgeDS/doc/HalfedgeDS/Concepts/HalfedgeDS.h +++ b/HalfedgeDS/doc/HalfedgeDS/Concepts/HalfedgeDS.h @@ -143,7 +143,7 @@ iterators are assignable to the respective handle types. Wherever the handles appear in function parameter lists, the corresponding iterators can be used as well. \note The handle types must have a default constructor that creates a unique and always the same handle -value. It will be used in analogy to `NULL` for pointers. +value. It will be used in analogy to `nullptr` for pointers. */ /// @{ diff --git a/HalfedgeDS/include/CGAL/HalfedgeDS_decorator.h b/HalfedgeDS/include/CGAL/HalfedgeDS_decorator.h index c14bf4cda9f..cb4a8234a61 100644 --- a/HalfedgeDS/include/CGAL/HalfedgeDS_decorator.h +++ b/HalfedgeDS/include/CGAL/HalfedgeDS_decorator.h @@ -819,7 +819,7 @@ public: // Removes component from list components.erase(components.begin()); - if (vertex->halfedge() != NULL) // if not isolated vertex + if (vertex->halfedge() != nullptr) // if not isolated vertex { erase_connected_component(vertex->halfedge()); nb_erased_components++; @@ -935,7 +935,7 @@ private: return it; } - return NULL; + return nullptr; } /// Helper method for keep_largest_connected_components(): @@ -1015,8 +1015,8 @@ private: } // Record each component - Vertex_handle seed_vertex = NULL; - while((seed_vertex = get_any_free_vertex(tags)) != NULL) + Vertex_handle seed_vertex = nullptr; + while((seed_vertex = get_any_free_vertex(tags)) != nullptr) { // Tag it as "done" and compute its size (number of vertices) unsigned int number_of_vertices = tag_component(seed_vertex, tags); diff --git a/HalfedgeDS/include/CGAL/HalfedgeDS_iterator.h b/HalfedgeDS/include/CGAL/HalfedgeDS_iterator.h index 1f24f2715be..01c9e328e5d 100644 --- a/HalfedgeDS/include/CGAL/HalfedgeDS_iterator.h +++ b/HalfedgeDS/include/CGAL/HalfedgeDS_iterator.h @@ -61,11 +61,11 @@ public: // pointer ptr() const { return & It::operator*();} - bool operator==( Nullptr_t CGAL_assertion_code(p)) const { + bool operator==( std::nullptr_t CGAL_assertion_code(p)) const { CGAL_assertion( p == 0); return It::operator==( It()); } - bool operator!=( Nullptr_t p) const { return !(*this == p); } + bool operator!=( std::nullptr_t p) const { return !(*this == p); } bool operator==( const Self& i) const { return It::operator==(i); } bool operator!=( const Self& i) const { return !(*this == i); } @@ -121,11 +121,11 @@ public: // pointer ptr() const { return & It::operator*();} - bool operator==( Nullptr_t CGAL_assertion_code(p)) const { + bool operator==( std::nullptr_t CGAL_assertion_code(p)) const { CGAL_assertion( p == 0); return It::operator==( It()); } - bool operator!=( Nullptr_t p) const { return !(*this == p); } + bool operator!=( std::nullptr_t p) const { return !(*this == p); } bool operator==( const Self& i) const { return It::operator==(i); } bool operator!=( const Self& i) const { return !(*this == i); } @@ -199,12 +199,12 @@ public: pointer ptr() const { return & It::operator*();} - bool operator==( Nullptr_t p) const { + bool operator==( std::nullptr_t p) const { CGAL_USE(p); - CGAL_assertion( p == NULL); - return It::operator==( It(NULL)); + CGAL_assertion( p == nullptr); + return It::operator==( It(nullptr)); } - bool operator!=( Nullptr_t p) const { return !(*this == p); } + bool operator!=( std::nullptr_t p) const { return !(*this == p); } bool operator==( const Self& i) const { return It::operator==(i); } bool operator!=( const Self& i) const { return !(*this == i); } @@ -263,12 +263,12 @@ public: pointer ptr() const { return & It::operator*();} - bool operator==( Nullptr_t p) const { + bool operator==( std::nullptr_t p) const { CGAL_USE(p); - CGAL_assertion( p == NULL); - return It::operator==( It(NULL)); + CGAL_assertion( p == nullptr); + return It::operator==( It(nullptr)); } - bool operator!=( Nullptr_t p) const { return !(*this == p); } + bool operator!=( std::nullptr_t p) const { return !(*this == p); } bool operator==( const Self& i) const { return It::operator==(i); } bool operator!=( const Self& i) const { return !(*this == i); } @@ -322,12 +322,12 @@ public: pointer ptr() const { return & It::operator*();} - bool operator==( Nullptr_t p) const { + bool operator==( std::nullptr_t p) const { CGAL_USE(p); - CGAL_assertion( p == NULL); - return It::operator==( It(NULL)); + CGAL_assertion( p == nullptr); + return It::operator==( It(nullptr)); } - bool operator!=( Nullptr_t p) const { return !(*this == p); } + bool operator!=( std::nullptr_t p) const { return !(*this == p); } bool operator==( const Self& i) const { return It::operator==(i); } bool operator!=( const Self& i) const { return !(*this == i); } @@ -386,12 +386,12 @@ public: pointer ptr() const { return & It::operator*();} - bool operator==( Nullptr_t p) const { + bool operator==( std::nullptr_t p) const { CGAL_USE(p); - CGAL_assertion( p == NULL); - return It::operator==( It(NULL)); + CGAL_assertion( p == nullptr); + return It::operator==( It(nullptr)); } - bool operator!=( Nullptr_t p) const { return !(*this == p); } + bool operator!=( std::nullptr_t p) const { return !(*this == p); } bool operator==( const Self& i) const { return It::operator==(i); } bool operator!=( const Self& i) const { return !(*this == i); } diff --git a/HalfedgeDS/include/CGAL/HalfedgeDS_iterator_adaptor.h b/HalfedgeDS/include/CGAL/HalfedgeDS_iterator_adaptor.h index 3e989074d09..820d5e86657 100644 --- a/HalfedgeDS/include/CGAL/HalfedgeDS_iterator_adaptor.h +++ b/HalfedgeDS/include/CGAL/HalfedgeDS_iterator_adaptor.h @@ -33,7 +33,7 @@ namespace CGAL { // The iterator identity adaptor will be used for the HDS implementations // that are based on STL (or other) container classes which do not // guarantee that the default construction of its iterator gives always -// the same singular value (i.e. something like NULL). This adaptor +// the same singular value (i.e. something like nullptr). This adaptor // assumes that iterator traits are fully supported. It works for all // kinds of iterators, from input iterators to random access iterators. // It does no longer require that these iterators have a constructor diff --git a/Hash_map/include/CGAL/Tools/chained_map.h b/Hash_map/include/CGAL/Tools/chained_map.h index a9e266de870..686e8d120f8 100644 --- a/Hash_map/include/CGAL/Tools/chained_map.h +++ b/Hash_map/include/CGAL/Tools/chained_map.h @@ -46,8 +46,8 @@ class chained_map_elem template class chained_map { - const std::size_t NULLKEY; - const std::size_t NONNULLKEY; + const std::size_t nullptrKEY; + const std::size_t NONnullptrKEY; chained_map_elem STOP; @@ -144,7 +144,7 @@ inline T& chained_map::access(std::size_t x) return p->i; } else { - if ( p->k == NULLKEY ) { + if ( p->k == nullptrKEY ) { p->k = x; init_inf(p->i); // initializes p->i to xdef old_index = x; @@ -173,16 +173,16 @@ void chained_map::init_table(std::size_t t) for (chained_map_item p = table; p < free; p++) { p->succ = &STOP; - p->k = NULLKEY; + p->k = nullptrKEY; } - table->k = NONNULLKEY; + table->k = NONnullptrKEY; } template inline void chained_map::insert(std::size_t x, T y) { chained_map_item q = HASH(x); - if ( q->k == NULLKEY ) { + if ( q->k == nullptrKEY ) { q->k = x; q->i = y; } else { @@ -211,7 +211,7 @@ void chained_map::rehash() for(p = old_table + 1; p < old_table_mid; p++) { std::size_t x = p->k; - if ( x != NULLKEY ) // list p is non-empty + if ( x != nullptrKEY ) // list p is non-empty { chained_map_item q = HASH(x); q->k = x; q->i = p->i; @@ -275,7 +275,7 @@ T& chained_map::access(chained_map_item p, std::size_t x) p = HASH(x); } - if (p->k == NULLKEY) + if (p->k == nullptrKEY) { p->k = x; init_inf(p->i); // initializes p->i to xdef return p->i; @@ -292,7 +292,7 @@ T& chained_map::access(chained_map_item p, std::size_t x) template chained_map::chained_map(std::size_t n) : - NULLKEY(0), NONNULLKEY(1), old_table(0) + nullptrKEY(0), NONnullptrKEY(1), old_table(0) { if (n < 512) init_table(512); @@ -306,13 +306,13 @@ chained_map::chained_map(std::size_t n) : template chained_map::chained_map(const chained_map& D) : - NULLKEY(0), NONNULLKEY(1), old_table(0) + nullptrKEY(0), NONnullptrKEY(1), old_table(0) { init_table(D.table_size); STOP.i = D.STOP.i; // xdef for(chained_map_item p = D.table + 1; p < D.free; p++) - { if (p->k != NULLKEY || p >= D.table + D.table_size) + { if (p->k != nullptrKEY || p >= D.table + D.table_size) { insert(p->k,p->i); //D.copy_inf(p->i); // see chapter Implementation } @@ -333,7 +333,7 @@ chained_map& chained_map::operator=(const chained_ma STOP.i = D.STOP.i; // xdef for(chained_map_item p = D.table + 1; p < D.free; p++) - { if (p->k != NULLKEY || p >= D.table + D.table_size) + { if (p->k != nullptrKEY || p >= D.table + D.table_size) { insert(p->k,p->i); //copy_inf(p->i); // see chapter Implementation } @@ -344,7 +344,7 @@ chained_map& chained_map::operator=(const chained_ma template void chained_map::clear_entries() { for(chained_map_item p = table + 1; p < free; p++) - if (p->k != NULLKEY || p >= table + table_size) + if (p->k != nullptrKEY || p >= table + table_size) p->i = T(); } @@ -380,7 +380,7 @@ template typename chained_map::chained_map_item chained_map::next_item(chained_map_item it) const { if (it == 0) return 0; - do it++; while (it < table + table_size && it->k == NULLKEY); + do it++; while (it < table + table_size && it->k == nullptrKEY); return (it < free ? it : 0); } @@ -389,7 +389,7 @@ void chained_map::statistics() const { std::cout << "table_size: " << table_size <<"\n"; std::size_t n = 0; for (chained_map_item p = table + 1; p < table + table_size; p++) - if (p ->k != NULLKEY) n++; + if (p ->k != nullptrKEY) n++; std::size_t used_in_overflow = free - (table + table_size ); n += used_in_overflow; std::cout << "number of entries: " << n << "\n"; diff --git a/Hyperbolic_triangulation_2/include/CGAL/Hyperbolic_Delaunay_triangulation_2.h b/Hyperbolic_triangulation_2/include/CGAL/Hyperbolic_Delaunay_triangulation_2.h index ab4e6c1835b..6ef65ca0137 100644 --- a/Hyperbolic_triangulation_2/include/CGAL/Hyperbolic_Delaunay_triangulation_2.h +++ b/Hyperbolic_triangulation_2/include/CGAL/Hyperbolic_Delaunay_triangulation_2.h @@ -448,7 +448,7 @@ public: std::ptrdiff_t insert(InputIterator first, InputIterator last, typename boost::enable_if< boost::is_base_of::value_type> - >::type* = NULL) + >::type* = nullptr) #else template < class InputIterator > std::ptrdiff_t insert(InputIterator first, InputIterator last) diff --git a/Inscribed_areas/include/CGAL/Largest_empty_iso_rectangle_2.h b/Inscribed_areas/include/CGAL/Largest_empty_iso_rectangle_2.h index a2aad1ea46d..0878bf33dd2 100644 --- a/Inscribed_areas/include/CGAL/Largest_empty_iso_rectangle_2.h +++ b/Inscribed_areas/include/CGAL/Largest_empty_iso_rectangle_2.h @@ -307,10 +307,10 @@ public: {} ~Point_data() { - if(right_tent != NULL){ + if(right_tent != nullptr){ delete right_tent; } - if (left_tent != NULL){ + if (left_tent != nullptr){ delete left_tent; } } diff --git a/Installation/CHANGES.md b/Installation/CHANGES.md index 315fe015f3e..c73842a60d1 100644 --- a/Installation/CHANGES.md +++ b/Installation/CHANGES.md @@ -53,8 +53,12 @@ Release date: September 2019 Parameters. ### Polygon Mesh Processing - - Added the function `CGAL::Polygon_mesh_processing::centroid()` which computes + - Added the function `CGAL::Polygon_mesh_processing::centroid()`, which computes the centroid of a closed triangle mesh. +- Added the functions `CGAL::Polygon_mesh_processing::stitch_boundary_cycle()` and + `CGAL::Polygon_mesh_processing::stitch_boundary_cycles()`, which can be used + to try and merge together geometrically compatible but combinatorially different halfedges + that belong to the same boundary cycle. ### IO Streams - **Breaking change:** The API of `CGAL::Color` has been cleaned up. diff --git a/Installation/include/CGAL/config.h b/Installation/include/CGAL/config.h index 208adc24849..1d363b6bf38 100644 --- a/Installation/include/CGAL/config.h +++ b/Installation/include/CGAL/config.h @@ -656,7 +656,7 @@ namespace CGAL { namespace CGAL { -// Typedef for the type of NULL. +// Typedef for the type of nullptr. typedef const void * Nullptr_t; // Anticipate C++0x's std::nullptr_t } //namespace CGAL diff --git a/Installation/include/CGAL/tss.h b/Installation/include/CGAL/tss.h index 0e67263f4bd..7096b1612e8 100644 --- a/Installation/include/CGAL/tss.h +++ b/Installation/include/CGAL/tss.h @@ -36,27 +36,27 @@ # define CGAL_STATIC_THREAD_LOCAL_VARIABLE_0(TYPE, VAR) \ static boost::thread_specific_ptr VAR##_ptr; \ - if(VAR##_ptr.get() == NULL) {VAR##_ptr.reset(new TYPE());} \ + if(VAR##_ptr.get() == nullptr) {VAR##_ptr.reset(new TYPE());} \ TYPE& VAR = * VAR##_ptr.get() # define CGAL_STATIC_THREAD_LOCAL_VARIABLE(TYPE, VAR, ARG1) \ static boost::thread_specific_ptr VAR##_ptr; \ - if(VAR##_ptr.get() == NULL) {VAR##_ptr.reset(new TYPE(ARG1));} \ + if(VAR##_ptr.get() == nullptr) {VAR##_ptr.reset(new TYPE(ARG1));} \ TYPE& VAR = * VAR##_ptr.get() # define CGAL_STATIC_THREAD_LOCAL_VARIABLE_2(TYPE, VAR, ARG1, ARG2) \ static boost::thread_specific_ptr VAR##_ptr; \ - if(VAR##_ptr.get() == NULL) {VAR##_ptr.reset(new TYPE(ARG1,ARG2));} \ + if(VAR##_ptr.get() == nullptr) {VAR##_ptr.reset(new TYPE(ARG1,ARG2));} \ TYPE& VAR = * VAR##_ptr.get() # define CGAL_STATIC_THREAD_LOCAL_VARIABLE_3(TYPE, VAR, ARG1, ARG2, ARG3) \ static boost::thread_specific_ptr VAR##_ptr; \ - if(VAR##_ptr.get() == NULL) {VAR##_ptr.reset(new TYPE(ARG1,ARG2,ARG3));} \ + if(VAR##_ptr.get() == nullptr) {VAR##_ptr.reset(new TYPE(ARG1,ARG2,ARG3));} \ TYPE& VAR = * VAR##_ptr.get() # define CGAL_STATIC_THREAD_LOCAL_VARIABLE_4(TYPE, VAR, ARG1, ARG2, ARG3, ARG4) \ static boost::thread_specific_ptr VAR##_ptr; \ - if(VAR##_ptr.get() == NULL) {VAR##_ptr.reset(new TYPE(ARG1,ARG2,ARG3,ARG4));} \ + if(VAR##_ptr.get() == nullptr) {VAR##_ptr.reset(new TYPE(ARG1,ARG2,ARG3,ARG4));} \ TYPE& VAR = * VAR##_ptr.get() diff --git a/Installation/test/Installation/CMakeLists.txt b/Installation/test/Installation/CMakeLists.txt index c5d6f6c02db..a8e11520ed3 100644 --- a/Installation/test/Installation/CMakeLists.txt +++ b/Installation/test/Installation/CMakeLists.txt @@ -73,9 +73,6 @@ if ( CGAL_FOUND ) find_package(Qt5 QUIET) if( Qt5_FOUND ) create_link_to_program(CGAL_Qt5) - if (CGAL_HEADER_ONLY) - qt5_use_modules(link_to_CGAL_Qt5) - endif() endif() endif() diff --git a/Interpolation/examples/Interpolation/sibson_interpolation_2.cpp b/Interpolation/examples/Interpolation/sibson_interpolation_2.cpp index 9402cd4b60d..d902cc15297 100644 --- a/Interpolation/examples/Interpolation/sibson_interpolation_2.cpp +++ b/Interpolation/examples/Interpolation/sibson_interpolation_2.cpp @@ -43,9 +43,9 @@ int main() CGAL:: Data_access(value_function), Traits()); - for(Point_vector_map::iterator it = gradient_function.begin(); it != gradient_function.end(); ++it) + for(const Point_vector_map::value_type& pv : gradient_function) { - std::cout << it->first << " " << it->second << std::endl; + std::cout << pv.first << " " << pv.second << std::endl; } // coordinate computation K::Point_2 p(1.6, 1.4); diff --git a/Interpolation/examples/Interpolation/sibson_interpolation_rn_2.cpp b/Interpolation/examples/Interpolation/sibson_interpolation_rn_2.cpp index 3df9d430340..642329b4b28 100644 --- a/Interpolation/examples/Interpolation/sibson_interpolation_rn_2.cpp +++ b/Interpolation/examples/Interpolation/sibson_interpolation_rn_2.cpp @@ -52,9 +52,8 @@ int main() CGAL::Data_access(value_function), Traits()); - for(Point_vector_map::iterator it = gradient_function.begin(); - it != gradient_function.end(); ++it) { - std::cout << it->first << " " << it->second << std::endl; + for(const Point_vector_map::value_type& pv : gradient_function) { + std::cout << pv.first << " " << pv.second << std::endl; } //coordinate computation diff --git a/Interpolation/examples/Interpolation/surface_neighbor_coordinates_3.cpp b/Interpolation/examples/Interpolation/surface_neighbor_coordinates_3.cpp index 2a361c1a44f..e200c6cfd30 100644 --- a/Interpolation/examples/Interpolation/surface_neighbor_coordinates_3.cpp +++ b/Interpolation/examples/Interpolation/surface_neighbor_coordinates_3.cpp @@ -48,9 +48,8 @@ int main() std::cout << "Testing the barycentric property " << std::endl; Point_3 b(0, 0, 0); - for(std::vector< std::pair< Point_3, Coord_type > >::const_iterator - it = coords.begin(); it!=coords.end(); ++it) - b = b + (it->second/norm) * (it->first - CGAL::ORIGIN); + for(const std::pair< Point_3, Coord_type >& pc : coords) + b = b + (pc.second/norm) * (pc.first - CGAL::ORIGIN); std::cout << " weighted barycenter: " << b <, ValueFunctor - >::value>::type* = NULL) + >::value>::type* = nullptr) { typedef typename Traits::FT FT; typedef typename Dt::Point VF_arg_type; @@ -272,7 +272,7 @@ sibson_gradient_fitting_nn_2(const Dt& dt, std::is_constructible< std::function, ValueFunctor - >::value>::type* = NULL) + >::value>::type* = nullptr) { typedef typename Traits::FT FT; typedef typename Dt::Vertex_handle VF_arg_type; @@ -350,7 +350,7 @@ sibson_gradient_fitting_rn_2(const Rt& rt, std::is_constructible< std::function, ValueFunctor - >::value>::type* = NULL) + >::value>::type* = nullptr) { typedef typename Traits::FT FT; typedef typename Rt::Point VF_arg_type; @@ -376,7 +376,7 @@ sibson_gradient_fitting_rn_2(const Rt& rt, std::is_constructible< std::function, ValueFunctor - >::value>::type* = NULL) + >::value>::type* = nullptr) { typedef typename Traits::FT FT; typedef typename Rt::Vertex_handle VF_arg_type; diff --git a/Intersections_3/include/CGAL/Intersections_3/internal/Triangle_3_Triangle_3_intersection.h b/Intersections_3/include/CGAL/Intersections_3/internal/Triangle_3_Triangle_3_intersection.h index 1985b1e9b31..f577c5d9ce6 100644 --- a/Intersections_3/include/CGAL/Intersections_3/internal/Triangle_3_Triangle_3_intersection.h +++ b/Intersections_3/include/CGAL/Intersections_3/internal/Triangle_3_Triangle_3_intersection.h @@ -75,7 +75,7 @@ void intersection_coplanar_triangles_cutoff( // assert "not empty" CGAL_kernel_assertion(bool(obj)); const typename Kernel::Point_3* inter=intersect_get(obj); - CGAL_kernel_assertion(inter!=NULL); + CGAL_kernel_assertion(inter!=nullptr); prev=&(* inter_pts.insert(it,*inter) ); orientations[prev]=COLLINEAR; ++pt_added; diff --git a/Intersections_3/include/CGAL/Intersections_3/internal/intersection_3_1_impl.h b/Intersections_3/include/CGAL/Intersections_3/internal/intersection_3_1_impl.h index 2112802e019..9dc63cfa718 100644 --- a/Intersections_3/include/CGAL/Intersections_3/internal/intersection_3_1_impl.h +++ b/Intersections_3/include/CGAL/Intersections_3/internal/intersection_3_1_impl.h @@ -1078,7 +1078,7 @@ intersection(const typename K::Plane_3 &plane, else{ pl_res v = internal::intersection(plane, k.construct_line_3_object()(tri.vertex(1),tri.vertex(2)), k); const typename K::Point_3* p = intersect_get(v); - CGAL_kernel_assertion(p!=NULL); + CGAL_kernel_assertion(p!=nullptr); return intersection_return(k.construct_segment_3_object() (*p,tri.vertex(0))); } @@ -1095,7 +1095,7 @@ intersection(const typename K::Plane_3 &plane, else{ pl_res v = intersection(plane, k.construct_line_3_object()(tri.vertex(0),tri.vertex(2)), k); const typename K::Point_3* p = intersect_get(v); - CGAL_kernel_assertion(p!=NULL); + CGAL_kernel_assertion(p!=nullptr); return intersection_return(k.construct_segment_3_object() (*p,tri.vertex(1))); } @@ -1107,7 +1107,7 @@ intersection(const typename K::Plane_3 &plane, else{ pl_res v = intersection(plane, k.construct_line_3_object()(tri.vertex(0),tri.vertex(1)), k); const typename K::Point_3* p = intersect_get(v); - CGAL_kernel_assertion(p!=NULL); + CGAL_kernel_assertion(p!=nullptr); return intersection_return(k.construct_segment_3_object() (*p,tri.vertex(2))); } @@ -1119,19 +1119,19 @@ intersection(const typename K::Plane_3 &plane, if (or0!=or1){ pl_res v = intersection(plane, k.construct_line_3_object()(tri.vertex(0),tri.vertex(1)), k); const typename K::Point_3* pt_ptr = intersect_get(v); - CGAL_kernel_assertion( pt_ptr!=NULL ); + CGAL_kernel_assertion( pt_ptr!=nullptr ); pts.push_back( *pt_ptr ); } if (or0!=or2){ pl_res v = intersection(plane, k.construct_line_3_object()(tri.vertex(0),tri.vertex(2)), k); const typename K::Point_3* pt_ptr = intersect_get(v); - CGAL_kernel_assertion( pt_ptr!=NULL ); + CGAL_kernel_assertion( pt_ptr!=nullptr ); pts.push_back( *pt_ptr ); } if (or1!=or2){ pl_res v = intersection(plane, k.construct_line_3_object()(tri.vertex(1),tri.vertex(2)), k); const typename K::Point_3* pt_ptr = intersect_get(v); - CGAL_kernel_assertion( pt_ptr!=NULL ); + CGAL_kernel_assertion( pt_ptr!=nullptr ); pts.push_back( *pt_ptr ); } diff --git a/Interval_skip_list/include/CGAL/Interval_skip_list.h b/Interval_skip_list/include/CGAL/Interval_skip_list.h index ddc63f06b82..d8a5e9b6e5e 100644 --- a/Interval_skip_list/include/CGAL/Interval_skip_list.h +++ b/Interval_skip_list/include/CGAL/Interval_skip_list.h @@ -120,7 +120,7 @@ class Interval_for_container : public Interval_ void * p; public: Interval_for_container(const Interval_& i) - : Interval_(i), p(NULL) + : Interval_(i), p(nullptr) {} void * for_compact_container() const { return p; } @@ -422,7 +422,7 @@ class Interval_for_container : public Interval_ copy(OutputIterator out) const { ILE_handle e = header; - while(e!= NULL) { + while(e!= nullptr) { out = *(e->I); ++out; e = e->next; @@ -627,7 +627,7 @@ template void IntervalList::copy(IntervalList* from) { ILE_handle e = from->header; - while(e!=NULL) { + while(e!=nullptr) { insert(e->I); e = e->next; } @@ -639,7 +639,7 @@ template { ILE_handle x = header; ILE_handle y; - while(x!= NULL) { // was 0 + while(x!= nullptr) { // was 0 y = x; x = x->next; erase_list_element(y); @@ -717,7 +717,7 @@ template for(i=0; (i<= x->level() - 2) && x->forward[i+1]!=0; i++) { IntervalList* markList = update[i]->markers[i]; - for(m = markList->get_first(); m != NULL ; m = markList->get_next(m)) { + for(m = markList->get_first(); m != nullptr ; m = markList->get_next(m)) { if(m->getInterval()->contains_interval(x->key,x->forward[i+1]->key)) { // promote m @@ -735,7 +735,7 @@ template } } - for(m = promoted.get_first(); m != NULL; m = promoted.get_next(m)) { + for(m = promoted.get_first(); m != nullptr; m = promoted.get_next(m)) { if(!m->getInterval()->contains_interval(x->key, x->forward[i+1]->key)){ // Then m does not need to be promoted higher. // Place m on the level i edge out of x and remove m from promoted. @@ -765,7 +765,7 @@ template x->markers[i]->copy(&promoted); x->markers[i]->copy(update[i]->markers[i]); - for(m=promoted.get_first(); m!=NULL; m=promoted.get_next(m)) + for(m=promoted.get_first(); m!=nullptr; m=promoted.get_next(m)) if(m->getInterval()->contains(x->forward[i]->key)) x->forward[i]->eqMarkers->insert(m->getInterval()); @@ -779,7 +779,7 @@ template for (i=0; (i <= x->level() - 2) && !update[i+1]->isHeader(); i++) { tempMarkList.copy(update[i]->markers[i]); for(m = tempMarkList.get_first(); - m != NULL; + m != nullptr; m = tempMarkList.get_next(m)){ if(m->getInterval()->contains_interval(update[i+1]->key,x->key)) { // m needs to be promoted @@ -794,7 +794,7 @@ template } tempMarkList.clear(); // reclaim storage - for(m = promoted.get_first(); m != NULL; m = promoted.get_next(m)) { + for(m = promoted.get_first(); m != nullptr; m = promoted.get_next(m)) { if (!update[i]->isHeader() && m->getInterval()->contains_interval(update[i]->key,x->key) && !update[i+1]->isHeader() && @@ -837,7 +837,7 @@ template will be placed on the edge. */ update[i]->markers[i]->copy(&promoted); - for(m=promoted.get_first(); m!=NULL; m=promoted.get_next(m)) + for(m=promoted.get_first(); m!=nullptr; m=promoted.get_next(m)) if(m->getInterval()->contains(update[i]->key)) update[i]->eqMarkers->insert(m->getInterval()); @@ -869,7 +869,7 @@ template for(i=x->level()-1; i>=0; i--){ // find marks on edge into x at level i to be demoted - for(m=update[i]->markers[i]->get_first(); m!=NULL; + for(m=update[i]->markers[i]->get_first(); m!=nullptr; m=update[i]->markers[i]->get_next(m)){ if(x->forward[i]==0 || ! m->getInterval()->contains_interval(update[i]->key, @@ -883,7 +883,7 @@ template // there before demotion must be there afterwards. // Place previously demoted marks on this level as needed. - for(m=demoted.get_first(); m!=NULL; m=demoted.get_next(m)){ + for(m=demoted.get_first(); m!=nullptr; m=demoted.get_next(m)){ // Place mark on level i from update[i+1] to update[i], not including // update[i+1] itself, since it already has a mark if it needs one. for(y=update[i+1]; y!=0 && y!=update[i]; y=y->forward[i]) { @@ -917,7 +917,7 @@ template // newDemoted is already empty for(i=x->level()-1; i>=0; i--){ - for(m=x->markers[i]->get_first(); m!=NULL ; m=x->markers[i]->get_next(m)){ + for(m=x->markers[i]->get_first(); m!=nullptr ; m=x->markers[i]->get_next(m)){ if(x->forward[i]!=0 && (update[i]->isHeader() || !m->getInterval()->contains_interval(update[i]->key, @@ -927,7 +927,7 @@ template } } - for(m=demoted.get_first(); m!= NULL; m=demoted.get_next(m)){ + for(m=demoted.get_first(); m!= nullptr; m=demoted.get_next(m)){ // Place mark on level i from x->forward[i] to x->forward[i+1]. // Don't place a mark directly on x->forward[i+1] since it is already // marked. @@ -1018,10 +1018,10 @@ template } } x = x->forward[0]; - if(x != NULL && (x->key == searchKey)) + if(x != nullptr && (x->key == searchKey)) return(x); else - return(NULL); + return(nullptr); } template @@ -1237,10 +1237,10 @@ template for(i=0; i<=topLevel; i++) { os << "forward[" << i << "] = "; - if(forward[i] != NULL) { + if(forward[i] != nullptr) { os << forward[i]->getValue(); } else { - os << "NULL"; + os << "nullptr"; } os << std::endl; } @@ -1248,10 +1248,10 @@ template for(i=0; i<=topLevel; i++) { os << "markers[" << i << "] = "; - if(markers[i] != NULL) { + if(markers[i] != nullptr) { markers[i]->print(os); } else { - os << "NULL"; + os << "nullptr"; } os << "\n"; } @@ -1276,14 +1276,14 @@ template IntervalList::remove(const Interval& I, Interval_handle& res) { ILE_handle x, last; - x = header; last = NULL; - while(x != NULL && *(x->getInterval()) != I) { + x = header; last = nullptr; + while(x != nullptr && *(x->getInterval()) != I) { last = x; x = x->next; } - if(x==NULL) { + if(x==nullptr) { return false; - } else if (last==NULL) { + } else if (last==nullptr) { header = x->next; res = x->getInterval(); erase_list_element(x); @@ -1301,14 +1301,14 @@ template IntervalList::remove(const Interval& I) { ILE_handle x, last; - x = header; last = NULL; - while(x != NULL && *(x->getInterval()) != I) { + x = header; last = nullptr; + while(x != nullptr && *(x->getInterval()) != I) { last = x; x = x->next; } - if(x==NULL) { + if(x==nullptr) { return ; - } else if (last==NULL) { + } else if (last==nullptr) { header = x->next; erase_list_element(x); } else { @@ -1321,7 +1321,7 @@ template void IntervalList::removeAll(IntervalList *l) { ILE_handle x; - for(x=l->get_first(); x!=NULL; x=l->get_next(x)) + for(x=l->get_first(); x!=nullptr; x=l->get_next(x)) this->remove(*(x->getInterval())); } @@ -1329,14 +1329,14 @@ template template inline IntervalListElt::IntervalListElt() - : next(NULL) + : next(nullptr) {} template inline IntervalListElt::IntervalListElt(const Interval_handle& anInterval) - : I(anInterval), next(NULL) + : I(anInterval), next(nullptr) {} template @@ -1366,7 +1366,7 @@ template void IntervalList::print(std::ostream& os) const { ILE_handle e = header; - while(e != NULL) { + while(e != nullptr) { e->print(os); e = e->get_next(); } @@ -1377,7 +1377,7 @@ template { /* if(I == 0) { - os << "NULL"; + os << "nullptr"; } else { os << *I; } @@ -1391,7 +1391,7 @@ template ILE_handle x = header; while(x!=0 && I != x->I) x = x->next; - if (x==NULL) + if (x==nullptr) return false; else return true; @@ -1401,7 +1401,7 @@ template template inline IntervalList::IntervalList() - : header(NULL) + : header(nullptr) {} diff --git a/Interval_support/include/CGAL/Interval_traits.h b/Interval_support/include/CGAL/Interval_traits.h index 4a4c5451d4c..891bc11d494 100644 --- a/Interval_support/include/CGAL/Interval_traits.h +++ b/Interval_support/include/CGAL/Interval_traits.h @@ -203,7 +203,7 @@ template inline typename Interval_traits::Intersection::result_type intersection(Interval interval1, Interval interval2, typename boost::enable_if< typename Interval_traits::Is_interval - >::type* = NULL + >::type* = nullptr ) { typename Interval_traits::Intersection intersection; return intersection(interval1, interval2); @@ -214,7 +214,7 @@ typename Interval_traits::Hull::result_type hull(Interval interval1, Interval interval2, typename boost::enable_if< boost::is_same< typename Interval_traits::Is_interval, - Tag_true > >::type* = NULL) + Tag_true > >::type* = nullptr) { typename Interval_traits::Hull hull; return hull(interval1, interval2); diff --git a/Inventor/include/CGAL/IO/VRML_2_ostream.h b/Inventor/include/CGAL/IO/VRML_2_ostream.h index 1e6f12fe13f..1ae0f76ad12 100644 --- a/Inventor/include/CGAL/IO/VRML_2_ostream.h +++ b/Inventor/include/CGAL/IO/VRML_2_ostream.h @@ -82,7 +82,7 @@ private: " Appearance {\n" " material DEF Material Material {}\n" " }\n" - " geometry NULL\n" + " geometry nullptr\n" " }\n" " #-- End of file header" << std::endl; } diff --git a/Kernel_23/include/CGAL/Kernel/function_objects.h b/Kernel_23/include/CGAL/Kernel/function_objects.h index 670bfb7d3c3..03c27b157a7 100644 --- a/Kernel_23/include/CGAL/Kernel/function_objects.h +++ b/Kernel_23/include/CGAL/Kernel/function_objects.h @@ -1695,7 +1695,7 @@ namespace CommonKernelFunctors { res = typename K::Intersect_3()(l1,l2); CGAL_assertion(res!=boost::none); const Point* e_pt = boost::get(&(*res)); - CGAL_assertion(e_pt!=NULL); + CGAL_assertion(e_pt!=nullptr); return *e_pt; } }; @@ -2095,7 +2095,7 @@ namespace CommonKernelFunctors { res = typename K::Intersect_3()(plane,line); CGAL_assertion(res!=boost::none); const Point* e_pt = boost::get(&(*res)); - CGAL_assertion(e_pt!=NULL); + CGAL_assertion(e_pt!=nullptr); return *e_pt; } @@ -2109,7 +2109,7 @@ namespace CommonKernelFunctors { res = typename K::Intersect_3()(plane,line); CGAL_assertion(res!=boost::none); const Point* e_pt = boost::get(&(*res)); - CGAL_assertion(e_pt!=NULL); + CGAL_assertion(e_pt!=nullptr); return *e_pt; } }; diff --git a/Kernel_23/include/CGAL/internal/Projection_traits_3.h b/Kernel_23/include/CGAL/internal/Projection_traits_3.h index 0f15a7e084f..e475c4978e9 100644 --- a/Kernel_23/include/CGAL/internal/Projection_traits_3.h +++ b/Kernel_23/include/CGAL/internal/Projection_traits_3.h @@ -322,9 +322,9 @@ public: //We know that none of the segment is degenerate Object o = intersection(s1_2,s2_2); const Point_2* pi=CGAL::object_cast(&o); - if (pi==NULL) { //case of segment or empty + if (pi==nullptr) { //case of segment or empty const Segment_2* si=CGAL::object_cast(&o); - if (si==NULL) return Object(); + if (si==nullptr) return Object(); FT src[3],tgt[3]; //the third coordinate is the midpoint between the points on s1 and s2 FT z1 = s1.source()[dim] + ( alpha(si->source(), s1_source, s1_target) * ( s1.target()[dim] - s1.source()[dim] )); diff --git a/Linear_cell_complex/include/CGAL/CMap_linear_cell_complex_storages.h b/Linear_cell_complex/include/CGAL/CMap_linear_cell_complex_storages.h index a4957f67da5..acccd2cf9d5 100644 --- a/Linear_cell_complex/include/CGAL/CMap_linear_cell_complex_storages.h +++ b/Linear_cell_complex/include/CGAL/CMap_linear_cell_complex_storages.h @@ -88,7 +88,7 @@ namespace CGAL { typedef typename Dart_container::const_iterator Dart_const_handle; typedef typename Dart_container::size_type size_type; - typedef CGAL::Void* Null_handle_type; + typedef std::nullptr_t Null_handle_type; static const Null_handle_type null_handle; typedef Items_ Items; @@ -155,18 +155,18 @@ namespace CGAL { /** Return if this dart is free for adimension. * @param dh a dart handle * @param i the dimension. - * @return true iff dh is linked with NULL for \em adimension. + * @return true iff dh is linked with nullptr for \em adimension. */ template bool is_free(Dart_const_handle dh) const { - CGAL_assertion( dh!=NULL ); + CGAL_assertion( dh!=nullptr ); CGAL_assertion(i <= dimension); return dh->mf[i]==null_dart_handle; } bool is_free(Dart_const_handle dh, unsigned int i) const { - CGAL_assertion( dh!=NULL ); + CGAL_assertion( dh!=nullptr ); CGAL_assertion(i <= dimension); return dh->mf[i]==null_dart_handle; } @@ -175,57 +175,57 @@ namespace CGAL { void set_dart_marks(Dart_const_handle ADart, const std::bitset& amarks) const { - CGAL_assertion( ADart!=NULL ); + CGAL_assertion( ADart!=nullptr ); ADart->set_marks(amarks); } /// Return all the marks of a dart. std::bitset get_dart_marks(Dart_const_handle ADart) const { - CGAL_assertion( ADart!=NULL ); + CGAL_assertion( ADart!=nullptr ); return ADart->get_marks(); } /// Return the mark value of dart a given mark number. bool get_dart_mark(Dart_const_handle ADart, size_type amark) const { - CGAL_assertion( ADart!=NULL ); + CGAL_assertion( ADart!=nullptr ); return ADart->get_mark(amark); } /// Set the mark of a given mark number to a given value. void set_dart_mark(Dart_const_handle ADart, size_type amark, bool avalue) const { - CGAL_assertion( ADart!=NULL ); + CGAL_assertion( ADart!=nullptr ); ADart->set_mark(amark, avalue); } /// Flip the mark of a given mark number to a given value. void flip_dart_mark(Dart_const_handle ADart, size_type amark) const { - CGAL_assertion( ADart!=NULL ); + CGAL_assertion( ADart!=nullptr ); ADart->flip_mark(amark); } // Access to beta maps Dart_handle get_beta(Dart_handle ADart, int B1) { - CGAL_assertion(ADart!=NULL && B1>=0 && B1<=(int)dimension); + CGAL_assertion(ADart!=nullptr && B1>=0 && B1<=(int)dimension); return ADart->mf[B1]; } Dart_const_handle get_beta(Dart_const_handle ADart, int B1) const { - CGAL_assertion(ADart!=NULL && B1>=0 && B1<=(int)dimension); + CGAL_assertion(ADart!=nullptr && B1>=0 && B1<=(int)dimension); return ADart->mf[B1]; } template Dart_handle get_beta(Dart_handle ADart) { - CGAL_assertion(ADart!=NULL && B1>=0 && B1<=(int)dimension); + CGAL_assertion(ADart!=nullptr && B1>=0 && B1<=(int)dimension); return ADart->mf[B1]; } template Dart_const_handle get_beta(Dart_const_handle ADart) const { - CGAL_assertion(ADart!=NULL && B1>=0 && B1<=(int)dimension); + CGAL_assertion(ADart!=nullptr && B1>=0 && B1<=(int)dimension); return ADart->mf[B1]; } @@ -266,7 +266,7 @@ namespace CGAL { template bool is_valid_attribute(typename Attribute_const_handle::type ah) const { - CGAL_assertion( ah!=NULL ); + CGAL_assertion( ah!=nullptr ); return ah->is_valid(); } @@ -275,25 +275,25 @@ namespace CGAL { std::size_t get_attribute_ref_counting (typename Attribute_const_handle::type ah) const { - CGAL_assertion( ah!=NULL ); + CGAL_assertion( ah!=nullptr ); return ah->get_nb_refs(); } template void init_attribute_ref_counting(typename Attribute_handle::type ah) { - CGAL_assertion( ah!=NULL ); + CGAL_assertion( ah!=nullptr ); ah->mrefcounting=0; } template void inc_attribute_ref_counting(typename Attribute_handle::type ah) { - CGAL_assertion( ah!=NULL ); + CGAL_assertion( ah!=nullptr ); ah->inc_nb_refs(); } template void dec_attribute_ref_counting(typename Attribute_handle::type ah) { - CGAL_assertion( ah!=NULL ); + CGAL_assertion( ah!=nullptr ); ah->dec_nb_refs(); } @@ -302,14 +302,14 @@ namespace CGAL { typename Attribute_type::type& get_attribute(typename Attribute_handle::type ah) { - CGAL_assertion( ah!=NULL ); + CGAL_assertion( ah!=nullptr ); return *ah; } template const typename Attribute_type::type& get_attribute(typename Attribute_const_handle::type ah) const { - CGAL_assertion( ah!=NULL ); + CGAL_assertion( ah!=nullptr ); return *ah; } @@ -317,14 +317,14 @@ namespace CGAL { template Dart_handle dart_of_attribute(typename Attribute_handle::type ah) { - CGAL_assertion( ah!=NULL ); + CGAL_assertion( ah!=nullptr ); return ah->dart(); } template Dart_const_handle dart_of_attribute(typename Attribute_const_handle::type ah) const { - CGAL_assertion( ah!=NULL ); + CGAL_assertion( ah!=nullptr ); return ah->dart(); } @@ -333,7 +333,7 @@ namespace CGAL { void set_dart_of_attribute(typename Attribute_handle::type ah, Dart_handle adart) { - CGAL_assertion( ah!=NULL ); + CGAL_assertion( ah!=nullptr ); ah->set_dart(adart); } @@ -350,14 +350,14 @@ namespace CGAL { typename Attribute_type::type::Info & info_of_attribute(typename Attribute_handle::type ah) { - CGAL_assertion( ah!=NULL ); + CGAL_assertion( ah!=nullptr ); return ah->info(); } template const typename Attribute_type::type::Info & info_of_attribute(typename Attribute_const_handle::type ah) const { - CGAL_assertion( ah!=NULL ); + CGAL_assertion( ah!=nullptr ); return ah->info(); } @@ -365,16 +365,16 @@ namespace CGAL { template typename Attribute_type::type::Info & info(Dart_handle adart) { - CGAL_assertion( adart!=NULL ); - CGAL_assertion( attribute(adart)!=NULL ); + CGAL_assertion( adart!=nullptr ); + CGAL_assertion( attribute(adart)!=nullptr ); return info_of_attribute(attribute(adart)); } template const typename Attribute_type::type::Info & info(Dart_const_handle adart) const { - CGAL_assertion( adart!=NULL ); - CGAL_assertion( attribute(adart)!=NULL ); + CGAL_assertion( adart!=nullptr ); + CGAL_assertion( attribute(adart)!=nullptr ); return info_of_attribute(attribute(adart)); } @@ -382,29 +382,29 @@ namespace CGAL { template Dart_handle dart(Dart_handle adart) { - CGAL_assertion( adart!=NULL ); - CGAL_assertion( attribute(adart)!=NULL ); + CGAL_assertion( adart!=nullptr ); + CGAL_assertion( attribute(adart)!=nullptr ); return dart_of_attribute(attribute(adart)); } template Dart_const_handle dart(Dart_const_handle adart) const { - CGAL_assertion( adart!=NULL ); - CGAL_assertion( attribute(adart)!=NULL ); + CGAL_assertion( adart!=nullptr ); + CGAL_assertion( attribute(adart)!=nullptr ); return dart_of_attribute(attribute(adart)); } // Get the dart of the given 0-attribute Point & point_of_vertex_attribute(typename Attribute_handle<0>::type vh) { - CGAL_assertion( vh!=NULL ); + CGAL_assertion( vh!=nullptr ); return get_attribute<0>(vh).point(); } const Point & point_of_vertex_attribute (typename Attribute_const_handle<0>::type vh) const { - CGAL_assertion( vh!=NULL ); + CGAL_assertion( vh!=nullptr ); return get_attribute<0>(vh).point(); } @@ -436,14 +436,14 @@ namespace CGAL { void dart_link_beta(Dart_handle adart, Dart_handle adart2) { CGAL_assertion(i <= dimension); - CGAL_assertion(adart!=NULL && adart2!=NULL); + CGAL_assertion(adart!=nullptr && adart2!=nullptr); CGAL_assertion(adart!=null_dart_handle); adart->mf[i] = adart2; } void dart_link_beta(Dart_handle adart, Dart_handle adart2, unsigned int i) { CGAL_assertion(i <= dimension); - CGAL_assertion(adart!=NULL && adart2!=NULL); + CGAL_assertion(adart!=nullptr && adart2!=nullptr); CGAL_assertion(adart!=null_dart_handle); adart->mf[i] = adart2; } @@ -455,12 +455,12 @@ namespace CGAL { template void dart_unlink_beta(Dart_handle adart) { - CGAL_assertion(adart!=NULL && i <= dimension); + CGAL_assertion(adart!=nullptr && i <= dimension); adart->mf[i] = null_dart_handle; } void dart_unlink_beta(Dart_handle adart, unsigned int i) { - CGAL_assertion(adart!=NULL && i <= dimension); + CGAL_assertion(adart!=nullptr && i <= dimension); adart->mf[i] = null_dart_handle; } @@ -485,7 +485,7 @@ namespace CGAL { const typename CMap_linear_cell_complex_storage_1::Null_handle_type CMap_linear_cell_complex_storage_1::null_handle = NULL; + Items_, Alloc_>::null_handle = nullptr; } // namespace CGAL diff --git a/Linear_cell_complex/include/CGAL/GMap_linear_cell_complex_storages.h b/Linear_cell_complex/include/CGAL/GMap_linear_cell_complex_storages.h index c1728bf53ba..d066b3d98a3 100644 --- a/Linear_cell_complex/include/CGAL/GMap_linear_cell_complex_storages.h +++ b/Linear_cell_complex/include/CGAL/GMap_linear_cell_complex_storages.h @@ -84,7 +84,7 @@ namespace CGAL { typedef typename Dart_container::const_iterator Dart_const_handle; typedef typename Dart_container::size_type size_type; - typedef CGAL::Void* Null_handle_type; + typedef std::nullptr_t Null_handle_type; static const Null_handle_type null_handle; typedef Items_ Items; @@ -147,18 +147,18 @@ namespace CGAL { /** Return if this dart is free for adimension. * @param dh a dart handle * @param i the dimension. - * @return true iff dh is linked with NULL for \em adimension. + * @return true iff dh is linked with nullptr for \em adimension. */ template bool is_free(Dart_const_handle dh) const { - CGAL_assertion( dh!=NULL ); + CGAL_assertion( dh!=nullptr ); CGAL_assertion(i <= dimension); return dh->mf[i]==dh; } bool is_free(Dart_const_handle dh, unsigned int i) const { - CGAL_assertion( dh!=NULL ); + CGAL_assertion( dh!=nullptr ); CGAL_assertion(i <= dimension); return dh->mf[i]==dh; } @@ -167,57 +167,57 @@ namespace CGAL { void set_dart_marks(Dart_const_handle ADart, const std::bitset& amarks) const { - CGAL_assertion( ADart!=NULL ); + CGAL_assertion( ADart!=nullptr ); ADart->set_marks(amarks); } /// Return all the marks of a dart. std::bitset get_dart_marks(Dart_const_handle ADart) const { - CGAL_assertion( ADart!=NULL ); + CGAL_assertion( ADart!=nullptr ); return ADart->get_marks(); } /// Return the mark value of dart a given mark number. bool get_dart_mark(Dart_const_handle ADart, size_type amark) const { - CGAL_assertion( ADart!=NULL ); + CGAL_assertion( ADart!=nullptr ); return ADart->get_mark(amark); } /// Set the mark of a given mark number to a given value. void set_dart_mark(Dart_const_handle ADart, size_type amark, bool avalue) const { - CGAL_assertion( ADart!=NULL ); + CGAL_assertion( ADart!=nullptr ); ADart->set_mark(amark, avalue); } /// Flip the mark of a given mark number to a given value. void flip_dart_mark(Dart_const_handle ADart, size_type amark) const { - CGAL_assertion( ADart!=NULL ); + CGAL_assertion( ADart!=nullptr ); ADart->flip_mark(amark); } // Access to alpha maps Dart_handle get_alpha(Dart_handle ADart, int B1) { - CGAL_assertion(ADart!=NULL && B1>=0 && B1<=(int)dimension); + CGAL_assertion(ADart!=nullptr && B1>=0 && B1<=(int)dimension); return ADart->mf[B1]; } Dart_const_handle get_alpha(Dart_const_handle ADart, int B1) const { - CGAL_assertion(ADart!=NULL && B1>=0 && B1<=(int)dimension); + CGAL_assertion(ADart!=nullptr && B1>=0 && B1<=(int)dimension); return ADart->mf[B1]; } template Dart_handle get_alpha(Dart_handle ADart) { - CGAL_assertion(ADart!=NULL && B1>=0 && B1<=(int)dimension); + CGAL_assertion(ADart!=nullptr && B1>=0 && B1<=(int)dimension); return ADart->mf[B1]; } template Dart_const_handle get_alpha(Dart_const_handle ADart) const { - CGAL_assertion(ADart!=NULL && B1>=0 && B1<=(int)dimension); + CGAL_assertion(ADart!=nullptr && B1>=0 && B1<=(int)dimension); return ADart->mf[B1]; } @@ -258,7 +258,7 @@ namespace CGAL { template bool is_valid_attribute(typename Attribute_const_handle::type ah) const { - CGAL_assertion( ah!=NULL ); + CGAL_assertion( ah!=nullptr ); return ah->is_valid(); } @@ -267,25 +267,25 @@ namespace CGAL { std::size_t get_attribute_ref_counting (typename Attribute_const_handle::type ah) const { - CGAL_assertion( ah!=NULL ); + CGAL_assertion( ah!=nullptr ); return ah->get_nb_refs(); } template void init_attribute_ref_counting(typename Attribute_handle::type ah) { - CGAL_assertion( ah!=NULL ); + CGAL_assertion( ah!=nullptr ); ah->mrefcounting=0; } template void inc_attribute_ref_counting(typename Attribute_handle::type ah) { - CGAL_assertion( ah!=NULL ); + CGAL_assertion( ah!=nullptr ); ah->inc_nb_refs(); } template void dec_attribute_ref_counting(typename Attribute_handle::type ah) { - CGAL_assertion( ah!=NULL ); + CGAL_assertion( ah!=nullptr ); ah->dec_nb_refs(); } @@ -294,14 +294,14 @@ namespace CGAL { typename Attribute_type::type& get_attribute(typename Attribute_handle::type ah) { - CGAL_assertion( ah!=NULL ); + CGAL_assertion( ah!=nullptr ); return *ah; } template const typename Attribute_type::type& get_attribute(typename Attribute_const_handle::type ah) const { - CGAL_assertion( ah!=NULL ); + CGAL_assertion( ah!=nullptr ); return *ah; } @@ -309,14 +309,14 @@ namespace CGAL { template Dart_handle dart_of_attribute(typename Attribute_handle::type ah) { - CGAL_assertion( ah!=NULL ); + CGAL_assertion( ah!=nullptr ); return ah->dart(); } template Dart_const_handle dart_of_attribute(typename Attribute_const_handle::type ah) const { - CGAL_assertion( ah!=NULL ); + CGAL_assertion( ah!=nullptr ); return ah->dart(); } @@ -325,7 +325,7 @@ namespace CGAL { void set_dart_of_attribute(typename Attribute_handle::type ah, Dart_handle adart) { - CGAL_assertion( ah!=NULL ); + CGAL_assertion( ah!=nullptr ); ah->set_dart(adart); } @@ -340,14 +340,14 @@ namespace CGAL { typename Attribute_type::type::Info & info_of_attribute(typename Attribute_handle::type ah) { - CGAL_assertion( ah!=NULL ); + CGAL_assertion( ah!=nullptr ); return ah->info(); } template const typename Attribute_type::type::Info & info_of_attribute(typename Attribute_const_handle::type ah) const { - CGAL_assertion( ah!=NULL ); + CGAL_assertion( ah!=nullptr ); return ah->info(); } @@ -355,16 +355,16 @@ namespace CGAL { template typename Attribute_type::type::Info & info(Dart_handle adart) { - CGAL_assertion( adart!=NULL ); - CGAL_assertion( attribute(adart)!=NULL ); + CGAL_assertion( adart!=nullptr ); + CGAL_assertion( attribute(adart)!=nullptr ); return info_of_attribute(attribute(adart)); } template const typename Attribute_type::type::Info & info(Dart_const_handle adart) const { - CGAL_assertion( adart!=NULL ); - CGAL_assertion( attribute(adart)!=NULL ); + CGAL_assertion( adart!=nullptr ); + CGAL_assertion( attribute(adart)!=nullptr ); return info_of_attribute(attribute(adart)); } @@ -372,29 +372,29 @@ namespace CGAL { template Dart_handle dart(Dart_handle adart) { - CGAL_assertion( adart!=NULL ); - CGAL_assertion( attribute(adart)!=NULL ); + CGAL_assertion( adart!=nullptr ); + CGAL_assertion( attribute(adart)!=nullptr ); return dart_of_attribute(attribute(adart)); } template Dart_const_handle dart(Dart_const_handle adart) const { - CGAL_assertion( adart!=NULL ); - CGAL_assertion( attribute(adart)!=NULL ); + CGAL_assertion( adart!=nullptr ); + CGAL_assertion( attribute(adart)!=nullptr ); return dart_of_attribute(attribute(adart)); } // Get the dart of the given 0-attribute Point & point_of_vertex_attribute(typename Attribute_handle<0>::type vh) { - CGAL_assertion( vh!=NULL ); + CGAL_assertion( vh!=nullptr ); return get_attribute<0>(vh).point(); } const Point & point_of_vertex_attribute (typename Attribute_const_handle<0>::type vh) const { - CGAL_assertion( vh!=NULL ); + CGAL_assertion( vh!=nullptr ); return get_attribute<0>(vh).point(); } @@ -426,13 +426,13 @@ namespace CGAL { void dart_link_alpha(Dart_handle adart, Dart_handle adart2) { CGAL_assertion(i <= dimension); - CGAL_assertion(adart!=NULL && adart2!=NULL); + CGAL_assertion(adart!=nullptr && adart2!=nullptr); adart->mf[i] = adart2; } void dart_link_alpha(Dart_handle adart, Dart_handle adart2, unsigned int i) { CGAL_assertion(i <= dimension); - CGAL_assertion(adart!=NULL && adart2!=NULL); + CGAL_assertion(adart!=nullptr && adart2!=nullptr); adart->mf[i] = adart2; } @@ -443,12 +443,12 @@ namespace CGAL { template void dart_unlink_alpha(Dart_handle adart) { - CGAL_assertion(adart!=NULL && i <= dimension); + CGAL_assertion(adart!=nullptr && i <= dimension); adart->mf[i] = adart; } void dart_unlink_alpha(Dart_handle adart, unsigned int i) { - CGAL_assertion(adart!=NULL && i <= dimension); + CGAL_assertion(adart!=nullptr && i <= dimension); adart->mf[i] = adart; } @@ -466,7 +466,7 @@ namespace CGAL { const typename GMap_linear_cell_complex_storage_1::Null_handle_type GMap_linear_cell_complex_storage_1::null_handle = NULL; + Items_, Alloc_>::null_handle = nullptr; } // namespace CGAL #if (BOOST_GCC >= 40900) diff --git a/Linear_cell_complex/include/CGAL/Linear_cell_complex_base.h b/Linear_cell_complex/include/CGAL/Linear_cell_complex_base.h index 82426feab5a..f732589383c 100644 --- a/Linear_cell_complex/include/CGAL/Linear_cell_complex_base.h +++ b/Linear_cell_complex/include/CGAL/Linear_cell_complex_base.h @@ -747,7 +747,7 @@ namespace CGAL { } /** Insert a dangling edge in a given facet. - * @param dh a dart of the facet (!=NULL). + * @param dh a dart of the facet (!=nullptr). * @param p the coordinates of the new vertex. * @param update_attributes a boolean to update the enabled attributes * @return a dart of the new edge, incident to the new vertex. @@ -772,8 +772,8 @@ namespace CGAL { /** Compute the dual of a Linear_cell_complex. * @param alcc the lcc in which we build the dual of this lcc. - * @param adart a dart of the initial lcc, NULL by default. - * @return adart of the dual lcc, the dual of adart if adart!=NULL, + * @param adart a dart of the initial lcc, nullptr by default. + * @return adart of the dual lcc, the dual of adart if adart!=nullptr, * any dart otherwise. * As soon as we don't modify this lcc and alcc lcc, we can iterate * simultaneously through all the darts of the two lcc and we have diff --git a/Linear_cell_complex/include/CGAL/boost/graph/graph_traits_Linear_cell_complex_for_combinatorial_map.h b/Linear_cell_complex/include/CGAL/boost/graph/graph_traits_Linear_cell_complex_for_combinatorial_map.h index 0f86130aeff..5d6b83401a8 100644 --- a/Linear_cell_complex/include/CGAL/boost/graph/graph_traits_Linear_cell_complex_for_combinatorial_map.h +++ b/Linear_cell_complex/include/CGAL/boost/graph/graph_traits_Linear_cell_complex_for_combinatorial_map.h @@ -66,7 +66,7 @@ namespace internal template struct EdgeHandle : Dart_handle { - EdgeHandle() : Dart_handle(NULL){} + EdgeHandle() : Dart_handle(nullptr){} explicit EdgeHandle(Dart_handle h): Dart_handle(h) {} @@ -75,14 +75,14 @@ struct EdgeHandle : Dart_handle Dart_handle second_halfedge() const { - assert(*this!=NULL); + assert(*this!=nullptr); return (*this)->get_f(2); } bool operator==(const EdgeHandle& h) const { return first_halfedge()==h.first_halfedge() || - (h.first_halfedge()!=NULL && + (h.first_halfedge()!=nullptr && first_halfedge()==h.second_halfedge()); } @@ -106,7 +106,7 @@ struct EdgeHandle : Dart_handle friend std::size_t hash_value(const EdgeHandle& i) { - if (i.first_halfedge()==NULL) return 0; + if (i.first_halfedge()==nullptr) return 0; return hash_value(i.first_halfedge() out_edge_iterator; // nulls - static vertex_descriptor null_vertex() { return NULL; } - static face_descriptor null_face() { return NULL; } - static halfedge_descriptor null_halfedge() { return NULL; } + static vertex_descriptor null_vertex() { return nullptr; } + static face_descriptor null_face() { return nullptr; } + static halfedge_descriptor null_halfedge() { return nullptr; } }; } //namespace CGAL @@ -421,7 +421,7 @@ typename boost::graph_traits::halfedge_descriptor halfedge(typename boost::graph_traits::vertex_descriptor v, const CGAL_LCC_TYPE& lcc) { - if (v->dart()==NULL) return NULL; + if (v->dart()==nullptr) return nullptr; return const_cast(lcc).template beta<2>(v->dart()); } @@ -488,7 +488,7 @@ void set_halfedge(typename boost::graph_traits::vertex_descriptor typename boost::graph_traits::halfedge_descriptor h, CGAL_LCC_TYPE& lcc) { - if (h!=NULL) + if (h!=nullptr) lcc.template set_dart_of_attribute<0>(v, lcc.template beta<2>(h)); else lcc.template set_dart_of_attribute<0>(v, h); diff --git a/Linear_cell_complex/include/CGAL/draw_linear_cell_complex.h b/Linear_cell_complex/include/CGAL/draw_linear_cell_complex.h index 1cdc247d855..2e2c09cc36a 100644 --- a/Linear_cell_complex/include/CGAL/draw_linear_cell_complex.h +++ b/Linear_cell_complex/include/CGAL/draw_linear_cell_complex.h @@ -170,7 +170,7 @@ public: /// @param anofaces if true, do not draw faces (faces are not computed; this can be /// usefull for very big object where this time could be long) SimpleLCCViewerQt(QWidget* parent, - const LCC* alcc=NULL, + const LCC* alcc=nullptr, const char* title="Basic LCC Viewer", bool anofaces=false, const DrawingFunctorLCC& drawing_functor=DrawingFunctorLCC()) : @@ -244,7 +244,7 @@ protected: Point p1 = lcc->point(dh); Dart_const_handle d2 = lcc->other_extremity(dh); - if (d2!=NULL) + if (d2!=nullptr) { if (m_drawing_functor.colored_edge(*lcc, dh)) { add_segment(p1, lcc->point(d2), m_drawing_functor.edge_color(*lcc, dh)); } @@ -266,7 +266,7 @@ protected: void compute_elements() { clear(); - if (lcc==NULL) return; + if (lcc==nullptr) return; typename LCC::size_type markvolumes = lcc->get_new_mark(); typename LCC::size_type markfaces = lcc->get_new_mark(); diff --git a/Maintenance/infrastructure/cgal.geometryfactory.com/crontab b/Maintenance/infrastructure/cgal.geometryfactory.com/crontab index 48aab3ac248..59d8539ed46 100644 --- a/Maintenance/infrastructure/cgal.geometryfactory.com/crontab +++ b/Maintenance/infrastructure/cgal.geometryfactory.com/crontab @@ -25,11 +25,11 @@ LC_CTYPE=en_US.UTF-8 # "master" alone 0 21 * * Sun cd $HOME/CGAL/create_internal_release && /usr/bin/time $HOME/bin/create_release $HOME/CGAL/branches/master.git --public --do-it || echo ERROR # "integration" -0 21 * * Mon,Tue,Thu,Fri cd $HOME/CGAL/create_internal_release && /usr/bin/time $HOME/bin/create_release $HOME/CGAL/branches/integration.git $HOME/CGAL/branches/empty-dir --do-it || echo ERROR +0 21 * * Mon,Tue,Wed,Thu,Fri cd $HOME/CGAL/create_internal_release && /usr/bin/time $HOME/bin/create_release $HOME/CGAL/branches/integration.git $HOME/CGAL/branches/empty-dir --do-it || echo ERROR # from branch 4.14 0 21 * * Sat cd $HOME/CGAL/create_internal_release-4.14-branch && /usr/bin/time $HOME/bin/create_release $HOME/CGAL/branches/CGAL-4.14-branch.git --public --do-it || echo ERROR # from branch 4.13 -0 21 * * Wed cd $HOME/CGAL/create_internal_release-4.13-branch && /usr/bin/time $HOME/bin/create_release $HOME/CGAL/branches/CGAL-4.13-branch.git --public --do-it || echo ERROR +#0 21 * * Wed cd $HOME/CGAL/create_internal_release-4.13-branch && /usr/bin/time $HOME/bin/create_release $HOME/CGAL/branches/CGAL-4.13-branch.git --public --do-it || echo ERROR # from branch 4.12 #0 21 * * Sat cd $HOME/CGAL/create_internal_release-4.12-branch && /usr/bin/time $HOME/bin/create_release $HOME/CGAL/branches/CGAL-4.12-branch.git --public --do-it || echo ERROR # from branch 4.11 diff --git a/Mesh_2/include/CGAL/Delaunay_mesher_2.h b/Mesh_2/include/CGAL/Delaunay_mesher_2.h index c50c0327fa6..91a5d0733d6 100644 --- a/Mesh_2/include/CGAL/Delaunay_mesher_2.h +++ b/Mesh_2/include/CGAL/Delaunay_mesher_2.h @@ -175,7 +175,7 @@ public: for(Seeds_it sit=begin; sit!=end; ++sit) { Face_handle fh=tr.locate(*sit); - if(fh!=NULL) + if(fh!=nullptr) propagate_marks(fh, mark); } propagate_marks(tr.infinite_face(), false); diff --git a/Mesh_2/include/CGAL/Delaunay_mesher_no_edge_refinement_2.h b/Mesh_2/include/CGAL/Delaunay_mesher_no_edge_refinement_2.h index c1fe32a2aea..e692e02c688 100644 --- a/Mesh_2/include/CGAL/Delaunay_mesher_no_edge_refinement_2.h +++ b/Mesh_2/include/CGAL/Delaunay_mesher_no_edge_refinement_2.h @@ -168,7 +168,7 @@ public: for(Seeds_it sit=begin; sit!=end; ++sit) { Face_handle fh=tr.locate(*sit); - if(fh!=NULL) + if(fh!=nullptr) propagate_marks(fh, mark); } propagate_marks(tr.infinite_face(), false); diff --git a/Mesh_2/include/CGAL/Filter_circulator.h b/Mesh_2/include/CGAL/Filter_circulator.h index 9a32569bf0f..61d173ab400 100644 --- a/Mesh_2/include/CGAL/Filter_circulator.h +++ b/Mesh_2/include/CGAL/Filter_circulator.h @@ -73,11 +73,11 @@ public: CGAL_assertion(is_null || test(*this)); } - bool operator==( Nullptr_t ) const { + bool operator==( std::nullptr_t ) const { return is_null; } - bool operator!=( Nullptr_t ) const { + bool operator!=( std::nullptr_t ) const { return !is_null; } diff --git a/Mesh_2/include/CGAL/Mesh_2/Lipschitz_sizing_field_2.h b/Mesh_2/include/CGAL/Mesh_2/Lipschitz_sizing_field_2.h index 810deb938cb..0daa70f94dd 100644 --- a/Mesh_2/include/CGAL/Mesh_2/Lipschitz_sizing_field_2.h +++ b/Mesh_2/include/CGAL/Mesh_2/Lipschitz_sizing_field_2.h @@ -209,7 +209,7 @@ protected: Face_circulator c = fc; std::list vv; - if (fc != NULL) + if (fc != nullptr) { do { diff --git a/Mesh_3/include/CGAL/Compact_mesh_cell_base_3.h b/Mesh_3/include/CGAL/Compact_mesh_cell_base_3.h index 0766f56f98a..778c7e00abd 100644 --- a/Mesh_3/include/CGAL/Compact_mesh_cell_base_3.h +++ b/Mesh_3/include/CGAL/Compact_mesh_cell_base_3.h @@ -61,7 +61,7 @@ class Compact_mesh_cell_base_3_base protected: Compact_mesh_cell_base_3_base() : bits_(0) - , weighted_circumcenter_(NULL) + , weighted_circumcenter_(nullptr) {} public: @@ -104,10 +104,10 @@ public: return ( (bits_ & (1 << facet)) != 0 ); } - /// Precondition weighted_circumcenter_ == NULL + /// Precondition weighted_circumcenter_ == nullptr void try_to_set_circumcenter(Point_3 *cc) const { - CGAL_precondition(weighted_circumcenter_ == NULL); + CGAL_precondition(weighted_circumcenter_ == nullptr); weighted_circumcenter_ = cc; } @@ -138,7 +138,7 @@ protected: Compact_mesh_cell_base_3_base() { bits_ = 0; - weighted_circumcenter_ = NULL; + weighted_circumcenter_ = nullptr; } public: @@ -187,11 +187,11 @@ public: return ( (bits_ & char(1 << facet)) != 0 ); } - /// If the circumcenter is already set (weighted_circumcenter_ != NULL), + /// If the circumcenter is already set (weighted_circumcenter_ != nullptr), /// this function "deletes" cc void try_to_set_circumcenter(Point_3 *cc) const { - if (weighted_circumcenter_.compare_and_swap(cc, NULL) != NULL) + if (weighted_circumcenter_.compare_and_swap(cc, nullptr) != nullptr) delete cc; } @@ -255,7 +255,7 @@ public: { if (weighted_circumcenter_) { delete weighted_circumcenter_; - weighted_circumcenter_ = NULL; + weighted_circumcenter_ = nullptr; } } @@ -337,7 +337,7 @@ public: ~Compact_mesh_cell_base_3() { - if(weighted_circumcenter_ != NULL){ + if(weighted_circumcenter_ != nullptr){ delete weighted_circumcenter_; } } @@ -449,7 +449,7 @@ public: Point_iterator hidden_points_begin() const { return hidden_points_end(); } - Point_iterator hidden_points_end() const { return NULL; } + Point_iterator hidden_points_end() const { return nullptr; } void hide_point (const Point&) const { } // We must override the functions that modify the vertices. @@ -483,7 +483,7 @@ public: { CGAL_static_assertion((boost::is_same::value)); - if (weighted_circumcenter_ == NULL) { + if (weighted_circumcenter_ == nullptr) { this->try_to_set_circumcenter( new Point_3(gt.construct_weighted_circumcenter_3_object() (this->vertex(0)->point(), diff --git a/Mesh_3/include/CGAL/Gray_image_mesh_domain_3.h b/Mesh_3/include/CGAL/Gray_image_mesh_domain_3.h index 75353453464..476e27d93a0 100644 --- a/Mesh_3/include/CGAL/Gray_image_mesh_domain_3.h +++ b/Mesh_3/include/CGAL/Gray_image_mesh_domain_3.h @@ -72,7 +72,7 @@ public: const Image_word_type iso_value, const Image_word_type value_outside = 0., const FT& error_bound = FT(1e-3), - CGAL::Random* p_rng = NULL) + CGAL::Random* p_rng = nullptr) : Base(Wrapper(image, Transform(iso_value), Transform(iso_value)(value_outside)), @@ -87,7 +87,7 @@ public: const Transform& transform, const Image_word_type value_outside = 0., const FT& error_bound = FT(1e-3), - CGAL::Random* p_rng = NULL) + CGAL::Random* p_rng = nullptr) : Base(Wrapper(image, transform, transform(value_outside)), Mesh_3::internal::compute_bounding_box(image), error_bound, diff --git a/Mesh_3/include/CGAL/Implicit_mesh_domain_3.h b/Mesh_3/include/CGAL/Implicit_mesh_domain_3.h index 48e20b86774..1273b784544 100644 --- a/Mesh_3/include/CGAL/Implicit_mesh_domain_3.h +++ b/Mesh_3/include/CGAL/Implicit_mesh_domain_3.h @@ -73,7 +73,7 @@ public: Implicit_mesh_domain_3(Function_ f, const Sphere_3& bounding_sphere, const FT& error_bound = FT(1e-6), - CGAL::Random* p_rng = NULL) + CGAL::Random* p_rng = nullptr) : Base(Wrapper(f), bounding_sphere, error_bound, Null_subdomain_index(), p_rng) {} diff --git a/Mesh_3/include/CGAL/Labeled_image_mesh_domain_3.h b/Mesh_3/include/CGAL/Labeled_image_mesh_domain_3.h index 275a4b312d8..b2430d810ea 100644 --- a/Mesh_3/include/CGAL/Labeled_image_mesh_domain_3.h +++ b/Mesh_3/include/CGAL/Labeled_image_mesh_domain_3.h @@ -83,7 +83,7 @@ public: const FT& error_bound = FT(1e-3), Subdomain_index value_outside = 0, Null null = Null(), - CGAL::Random* p_rng = NULL) + CGAL::Random* p_rng = nullptr) : Base(Wrapper(image, Identity(), value_outside), compute_bounding_box(image), error_bound, diff --git a/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h b/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h index 509dad4a189..782e62b648b 100644 --- a/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h +++ b/Mesh_3/include/CGAL/Labeled_mesh_domain_3.h @@ -346,7 +346,7 @@ public: const Sphere_3& bounding_sphere, const FT& error_bound = FT(1e-3), Null null = Null_subdomain_index(), - CGAL::Random* p_rng = NULL) + CGAL::Random* p_rng = nullptr) : Impl_details(f, bounding_sphere, error_bound, construct_pair_functor(), @@ -356,7 +356,7 @@ public: const Bbox_3& bbox, const FT& error_bound = FT(1e-3), Null null = Null_subdomain_index(), - CGAL::Random* p_rng = NULL) + CGAL::Random* p_rng = nullptr) : Impl_details(f, bbox, error_bound, construct_pair_functor(), @@ -366,7 +366,7 @@ public: const Iso_cuboid_3& bbox, const FT& error_bound = FT(1e-3), Null null = Null_subdomain_index(), - CGAL::Random* p_rng = NULL) + CGAL::Random* p_rng = nullptr) : Impl_details(f, bbox, error_bound, construct_pair_functor(), null, p_rng) diff --git a/Mesh_3/include/CGAL/Mesh_3/C3T3_helpers.h b/Mesh_3/include/CGAL/Mesh_3/C3T3_helpers.h index f88508b5a06..818b2863149 100644 --- a/Mesh_3/include/CGAL/Mesh_3/C3T3_helpers.h +++ b/Mesh_3/include/CGAL/Mesh_3/C3T3_helpers.h @@ -714,7 +714,7 @@ public: * Constructor */ C3T3_helpers(C3T3& c3t3, const MeshDomain& domain, - Lock_data_structure *lock_ds = NULL) + Lock_data_structure *lock_ds = nullptr) : Base(lock_ds) , c3t3_(c3t3) , tr_(c3t3.triangulation()) @@ -743,7 +743,7 @@ public: const Weighted_point& new_position, const SliverCriterion& criterion, OutputIterator modified_vertices, - bool *could_lock_zone = NULL); + bool *could_lock_zone = nullptr); /** @brief tries to move \c old_vertex to \c new_position in the mesh * @@ -757,7 +757,7 @@ public: const Weighted_point& new_position, const SliverCriterion& criterion, OutputIterator modified_vertices, - bool *could_lock_zone = NULL); + bool *could_lock_zone = nullptr); /** * Updates mesh moving vertex \c old_vertex to \c new_position. Returns the @@ -1666,7 +1666,7 @@ private: move_point_topo_change(const Vertex_handle& old_vertex, const Weighted_point& new_position, Outdated_cell_set& outdated_cells_set, - bool *could_lock_zone = NULL) const; + bool *could_lock_zone = nullptr) const; template < typename OutdatedCellsOutputIterator, typename DeletedCellsOutputIterator > @@ -1799,7 +1799,7 @@ private: CellsOutputIterator insertion_conflict_cells, FacetsOutputIterator insertion_conflict_boundary, CellsOutputIterator removal_conflict_cells, - bool *could_lock_zone = NULL) const; + bool *could_lock_zone = nullptr) const; template < typename ConflictCellsInputIterator, @@ -3034,7 +3034,7 @@ move_point(const Vertex_handle& old_vertex, Moving_vertices_set& moving_vertices, bool *could_lock_zone) const { - CGAL_assertion(could_lock_zone != NULL); + CGAL_assertion(could_lock_zone != nullptr); *could_lock_zone = true; if (!try_lock_vertex(old_vertex)) // LOCK diff --git a/Mesh_3/include/CGAL/Mesh_3/Mesher_3.h b/Mesh_3/include/CGAL/Mesh_3/Mesher_3.h index 327dc902dc3..9b18c64cddf 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Mesher_3.h +++ b/Mesh_3/include/CGAL/Mesh_3/Mesher_3.h @@ -229,7 +229,7 @@ public: ~Mesher_3() { // The lock data structure is going to be destroyed - r_c3t3_.triangulation().set_lock_data_structure(NULL); + r_c3t3_.triangulation().set_lock_data_structure(nullptr); } /// Launch mesh refinement diff --git a/Mesh_3/include/CGAL/Mesh_3/Mesher_level.h b/Mesh_3/include/CGAL/Mesh_3/Mesher_level.h index c5554f3e109..a23768d7260 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Mesher_level.h +++ b/Mesh_3/include/CGAL/Mesh_3/Mesher_level.h @@ -426,7 +426,7 @@ public: for (int i = 0 ; i < 4 ; ++i) vertices[i] = e->vertex(i); } - // Among the 4 values, one of them will be Vertex_handle() (~= NULL) + // Among the 4 values, one of them will be Vertex_handle() (~= nullptr) void get_valid_vertices_of_element(const Facet &e, Vertex_handle vertices[4]) const { for (int i = 0 ; i < 4 ; ++i) @@ -859,7 +859,7 @@ public: { CGAL_assertion_msg(triangulation().get_lock_data_structure() == 0, - "In refine_sequentially_up_to_N_vertices, the triangulation's locking data structure should be NULL"); + "In refine_sequentially_up_to_N_vertices, the triangulation's locking data structure should be nullptr"); while(! is_algorithm_done() && triangulation().number_of_vertices() < approx_max_num_mesh_vertices) diff --git a/Mesh_3/include/CGAL/Mesh_3/Sizing_grid.h b/Mesh_3/include/CGAL/Mesh_3/Sizing_grid.h index d622e968c0a..8472501dfe4 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Sizing_grid.h +++ b/Mesh_3/include/CGAL/Mesh_3/Sizing_grid.h @@ -60,7 +60,7 @@ public: { m_done = false; m_size = CGAL_MESH_3_INFINITE_SIZE; - m_pRef_node = NULL; + m_pRef_node = nullptr; m_indices[0] = m_indices[1] = m_indices[2] = 0; } @@ -192,7 +192,7 @@ public: { m_k = 1.0; m_ds = m_dv = 0; - m_pppNodes = NULL; + m_pppNodes = nullptr; m_nx = m_ny = m_nz = 0; m_xrange[0] = m_xrange[1] = m_xrange[2] = 0; m_yrange[0] = m_yrange[1] = m_yrange[2] = 0; @@ -254,7 +254,7 @@ private: delete [] m_pppNodes[i]; } delete [] m_pppNodes; - m_pppNodes = NULL; + m_pppNodes = nullptr; m_nx = m_ny = m_nz = 0; m_updated = false; } @@ -268,7 +268,7 @@ private: // alloc m_pppNodes = new Node**[nx]; - if(m_pppNodes == NULL) + if(m_pppNodes == nullptr) { cleanup(); return false; @@ -277,7 +277,7 @@ private: for(i=0; i= (int)m_nx || j >= (int)m_ny || k >= (int)m_nz) - return NULL; + return nullptr; return &m_pppNodes[i][j][k]; } @@ -388,8 +388,8 @@ private: Node* neighbor(Node* n, unsigned int index) { - if(n == NULL) - return NULL; + if(n == nullptr) + return nullptr; switch(index) { @@ -406,7 +406,7 @@ private: case 5: return node(n->i(),n->j(),n->k()+1); default: - return NULL; + return nullptr; } } @@ -461,7 +461,7 @@ private: { // TODO: change size of seeds Node *pNeighbor = neighbor(pNode,index_neighbor); - if(pNeighbor != NULL && + if(pNeighbor != nullptr && pNeighbor->done() == false) priority_queue.push(Candidate_size(pNeighbor,pNode->ref_node(),m_k)); } @@ -481,7 +481,7 @@ private: // get node at position p Node *pNode = node(p); - if(pNode != NULL && pNode->done() == false) // specific + if(pNode != nullptr && pNode->done() == false) // specific { pNode->point() = p; pNode->init_size() = init_size; @@ -495,7 +495,7 @@ private: index_neighbor++) { Node *pNeighbor = neighbor(pNode,index_neighbor); - if(pNeighbor != NULL && + if(pNeighbor != nullptr && pNeighbor->done() == false) { Candidate_size candidate(pNeighbor,pNode->ref_node(),m_k); diff --git a/Mesh_3/include/CGAL/Mesh_3/Sliver_perturber.h b/Mesh_3/include/CGAL/Mesh_3/Sliver_perturber.h index 0f9cdb7f0a0..e71a7572c3f 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Sliver_perturber.h +++ b/Mesh_3/include/CGAL/Mesh_3/Sliver_perturber.h @@ -114,7 +114,7 @@ PVertex_() , incident_sliver_nb_(0) , min_value_((std::numeric_limits::max)()) , try_nb_(0) -, p_perturbation_(NULL) +, p_perturbation_(nullptr) , id_() { } @@ -123,7 +123,7 @@ PVertex_(const Vertex_handle& vh, id_type id) , incident_sliver_nb_(0) , min_value_((std::numeric_limits::max)()) , try_nb_(0) -, p_perturbation_(NULL) +, p_perturbation_(nullptr) , id_(id) { } @@ -143,7 +143,7 @@ void set_perturbation(const Perturbation* p) { p_perturbation_ = p; } bool is_perturbable() const { return ( (vertex_handle_->in_dimension() > 1) - && (NULL != perturbation()) + && (nullptr != perturbation()) && (sliver_nb() != 0) ); } @@ -223,7 +223,7 @@ PVertex_() , incident_sliver_nb_(0) , min_value_((std::numeric_limits::max)()) , try_nb_(0) -, p_perturbation_(NULL) +, p_perturbation_(nullptr) , id_() { } @@ -234,7 +234,7 @@ PVertex_(const Vertex_handle& vh, id_type id) , incident_sliver_nb_(0) , min_value_((std::numeric_limits::max)()) , try_nb_(0) -, p_perturbation_(NULL) +, p_perturbation_(nullptr) , id_(id) { } @@ -264,7 +264,7 @@ void set_perturbation(const Perturbation* p) { p_perturbation_ = p; } bool is_perturbable() const { return ( (vertex_handle_->in_dimension() > 1) - && (NULL != perturbation()) + && (nullptr != perturbation()) && (sliver_nb() != 0) ); } @@ -892,7 +892,7 @@ add_perturbation(Perturbation* perturbation) if ( !perturbation_vector_.empty() ) perturbation_vector_.back().set_next(perturbation); - if ( NULL != perturbation ) + if ( nullptr != perturbation ) { // Set order perturbation->set_order(next_perturbation_order_++); @@ -1001,8 +1001,8 @@ perturb(const FT& sliver_bound, PQueue& pqueue, Visitor& visitor) const // Perturb vertex Vertex_vector modified_vertices; - // pv.perturbation() should not be NULL if pv is in pqueue - CGAL_assertion(pv.perturbation() != NULL); + // pv.perturbation() should not be nullptr if pv is in pqueue + CGAL_assertion(pv.perturbation() != nullptr); std::pair perturbation_ok = pv.perturbation()->operator()(pv.vertex(), @@ -1041,7 +1041,7 @@ perturb(const FT& sliver_bound, PQueue& pqueue, Visitor& visitor) const // If perturbation fails, try next one pv.set_perturbation(pv.perturbation()->next()); - if ( NULL == pv.perturbation() ) + if ( nullptr == pv.perturbation() ) { bad_vertices.push_back(pv.vertex()); } @@ -1333,8 +1333,8 @@ perturb_vertex( PVertex pv // Perturb vertex Vertex_vector modified_vertices; - // pv.perturbation() should not be NULL if pv is in pqueue - CGAL_assertion(pv.perturbation() != NULL); + // pv.perturbation() should not be nullptr if pv is in pqueue + CGAL_assertion(pv.perturbation() != nullptr); std::pair perturbation_ok = pv.perturbation()->operator()(pv.vertex(), @@ -1383,7 +1383,7 @@ perturb_vertex( PVertex pv pv.set_perturbation(pv.perturbation()->next()); pv.update_saved_erase_counter(); - if ( NULL == pv.perturbation() ) + if ( nullptr == pv.perturbation() ) { bad_vertices.push_back(pv.vertex()); } diff --git a/Mesh_3/include/CGAL/Mesh_3/Slivers_exuder.h b/Mesh_3/include/CGAL/Mesh_3/Slivers_exuder.h index 798ade537f8..f3cf5ba5caa 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Slivers_exuder.h +++ b/Mesh_3/include/CGAL/Mesh_3/Slivers_exuder.h @@ -471,13 +471,13 @@ private: */ template bool pump_vertex(const Vertex_handle& v, - bool *could_lock_zone = NULL); + bool *could_lock_zone = nullptr); /** * Returns the best_weight of v */ FT get_best_weight(const Vertex_handle& v, - bool *could_lock_zone = NULL) const; + bool *could_lock_zone = nullptr) const; /** * Initializes pre_star and criterion_values @@ -515,7 +515,7 @@ private: template bool update_mesh(const Weighted_point& new_point, const Vertex_handle& old_vertex, - bool *could_lock_zone = NULL); + bool *could_lock_zone = nullptr); /** * Restores cells and boundary facets of conflict zone of new_vertex in c3t3_ diff --git a/Mesh_3/include/CGAL/Mesh_3/Triangulation_helpers.h b/Mesh_3/include/CGAL/Mesh_3/Triangulation_helpers.h index bea16f4fa07..7a3cc2c1630 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Triangulation_helpers.h +++ b/Mesh_3/include/CGAL/Mesh_3/Triangulation_helpers.h @@ -154,14 +154,14 @@ public: FT get_sq_distance_to_closest_vertex(const Tr& tr, const Vertex_handle& vh, const Cell_vector& incident_cells, - typename boost::enable_if_c::type* = NULL) const; + typename boost::enable_if_c::type* = nullptr) const; // @todo are the two versions really worth it, I can't tell the difference from a time POV... template FT get_sq_distance_to_closest_vertex(const Tr& tr, const Vertex_handle& vh, const Cell_vector& incident_cells, - typename boost::disable_if_c::type* = NULL) const; + typename boost::disable_if_c::type* = nullptr) const; private: /** diff --git a/Mesh_3/include/CGAL/Mesh_3/Worksharing_data_structures.h b/Mesh_3/include/CGAL/Mesh_3/Worksharing_data_structures.h index a4d41ad7440..1876a499894 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Worksharing_data_structures.h +++ b/Mesh_3/include/CGAL/Mesh_3/Worksharing_data_structures.h @@ -841,19 +841,19 @@ protected: inline tbb::task* TokenTask::execute() { m_worksharing_ds->run_next_work_item(); - return NULL; + return nullptr; } inline tbb::task* WorkItemTask::execute() { m_pwi->run(); - return NULL; + return nullptr; } inline tbb::task* WorkBatchTask::execute() { m_wb.run(); - return NULL; + return nullptr; } } } //namespace CGAL::Mesh_3 diff --git a/Mesh_3/include/CGAL/Mesh_3/experimental/Lipschitz_sizing_experimental.h b/Mesh_3/include/CGAL/Mesh_3/experimental/Lipschitz_sizing_experimental.h index 08fbaab082b..27f5ec12ec6 100644 --- a/Mesh_3/include/CGAL/Mesh_3/experimental/Lipschitz_sizing_experimental.h +++ b/Mesh_3/include/CGAL/Mesh_3/experimental/Lipschitz_sizing_experimental.h @@ -121,7 +121,7 @@ private: public: Lipschitz_sizing(const MeshDomain& domain) - : m_ptree(NULL) + : m_ptree(nullptr) , m_own_ptree() , m_domain(domain) , m_params(domain) @@ -382,7 +382,7 @@ private: m_params.get_parameters(index, k, size_min, size_max); FT sqdist = 0.; - if(m_ptree == NULL) + if(m_ptree == nullptr) { sqdist = m_own_ptree->squared_distance(p); } diff --git a/Mesh_3/include/CGAL/Mesh_3/experimental/Lipschitz_sizing_polyhedron.h b/Mesh_3/include/CGAL/Mesh_3/experimental/Lipschitz_sizing_polyhedron.h index 7f5706f1d99..fa6f3670567 100644 --- a/Mesh_3/include/CGAL/Mesh_3/experimental/Lipschitz_sizing_polyhedron.h +++ b/Mesh_3/include/CGAL/Mesh_3/experimental/Lipschitz_sizing_polyhedron.h @@ -82,7 +82,7 @@ private: public: Lipschitz_sizing(const MeshDomain& domain) - : m_ptree(NULL) + : m_ptree(nullptr) , m_own_ptree() , m_domain(domain) , m_params(domain) @@ -150,7 +150,7 @@ private: m_params.get_parameters(index, k, size_min, size_max); FT sqdist = 0.; - if(m_ptree == NULL) + if(m_ptree == nullptr) { sqdist = m_own_ptree->squared_distance(p); } diff --git a/Mesh_3/include/CGAL/Mesh_3/vertex_perturbation.h b/Mesh_3/include/CGAL/Mesh_3/vertex_perturbation.h index 28041ac9fd2..e8f1da9ba56 100644 --- a/Mesh_3/include/CGAL/Mesh_3/vertex_perturbation.h +++ b/Mesh_3/include/CGAL/Mesh_3/vertex_perturbation.h @@ -192,8 +192,8 @@ public: * @brief constructor */ Abstract_perturbation() - : p_next_(NULL) - , p_previous_(NULL) + : p_next_(nullptr) + , p_previous_(nullptr) , order_(0) #ifdef CGAL_MESH_3_PERTURBER_VERBOSE , counter_(0) @@ -243,7 +243,7 @@ public: const SliverCriterion& criterion, const FT& sliver_bound, std::vector& modified_vertices, - bool *could_lock_zone = NULL) const + bool *could_lock_zone = nullptr) const { #ifndef CGAL_MESH_3_PERTURBER_VERBOSE return do_perturb(v, slivers, c3t3, domain, criterion, @@ -272,7 +272,7 @@ public: { p_next_ = next; - if ( NULL != next ) + if ( nullptr != next ) next->p_previous_ = this; } @@ -320,7 +320,7 @@ protected: const SliverCriterion& criterion, const FT& sliver_bound, std::vector& modified_vertices, - bool *could_lock_zone = NULL) const = 0; + bool *could_lock_zone = nullptr) const = 0; /** * @brief a helper function which returns the amplitude of perturbation @@ -431,7 +431,7 @@ protected: const SliverCriterion& criterion, const FT& sliver_bound, std::vector& modified_vertices, - bool *could_lock_zone = NULL) const = 0; + bool *could_lock_zone = nullptr) const = 0; protected: // ----------------------------------- @@ -449,7 +449,7 @@ protected: const MeshDomain& domain, const SliverCriterion& criterion, std::vector& modified_vertices, - bool *could_lock_zone = NULL) const + bool *could_lock_zone = nullptr) const { typedef Triangulation_helpers Th; @@ -595,7 +595,7 @@ protected: const SliverCriterion& criterion, const FT&, std::vector& modified_vertices, - bool *could_lock_zone = NULL) const + bool *could_lock_zone = nullptr) const { CGAL_precondition(!slivers.empty()); @@ -771,7 +771,7 @@ protected: const SliverCriterion& criterion, const FT&, std::vector& modified_vertices, - bool *could_lock_zone = NULL) const + bool *could_lock_zone = nullptr) const { CGAL_precondition(!slivers.empty()); @@ -922,7 +922,7 @@ protected: const SliverCriterion& criterion, const FT&, std::vector& modified_vertices, - bool *could_lock_zone = NULL) const + bool *could_lock_zone = nullptr) const { CGAL_precondition(!slivers.empty()); @@ -1152,7 +1152,7 @@ protected: const SliverCriterion& criterion, const FT& sliver_bound, std::vector& modified_vertices, - bool *could_lock_zone = NULL) const = 0; + bool *could_lock_zone = nullptr) const = 0; protected: // ----------------------------------- @@ -1292,7 +1292,7 @@ protected: const SliverCriterion& criterion, const FT& sliver_bound, std::vector& modified_vertices, - bool *could_lock_zone = NULL) const + bool *could_lock_zone = nullptr) const { CGAL_precondition(!slivers.empty()); @@ -1317,7 +1317,7 @@ private: const SliverCriterion& criterion, const FT& sliver_bound, std::vector& modified_vertices, - bool *could_lock_zone = NULL) const + bool *could_lock_zone = nullptr) const { typedef Triangulation_helpers Th; diff --git a/Mesh_3/include/CGAL/Polyhedral_complex_mesh_domain_3.h b/Mesh_3/include/CGAL/Polyhedral_complex_mesh_domain_3.h index 4f30d41f279..58d4dfce87e 100644 --- a/Mesh_3/include/CGAL/Polyhedral_complex_mesh_domain_3.h +++ b/Mesh_3/include/CGAL/Polyhedral_complex_mesh_domain_3.h @@ -219,7 +219,7 @@ public: InputPairOfSubdomainIndicesIterator indices_begin, InputPairOfSubdomainIndicesIterator indices_end #ifndef DOXYGEN_RUNNING - , CGAL::Random* p_rng = NULL + , CGAL::Random* p_rng = nullptr #endif ) : Base(p_rng) @@ -256,7 +256,7 @@ public: /// @cond DEVELOPERS Polyhedral_complex_mesh_domain_3 ( - CGAL::Random* p_rng = NULL + CGAL::Random* p_rng = nullptr ) : Base(p_rng) , borders_detected_(false) diff --git a/Mesh_3/include/CGAL/Polyhedral_mesh_domain_3.h b/Mesh_3/include/CGAL/Polyhedral_mesh_domain_3.h index 0a6ed63c152..6b013766433 100644 --- a/Mesh_3/include/CGAL/Polyhedral_mesh_domain_3.h +++ b/Mesh_3/include/CGAL/Polyhedral_mesh_domain_3.h @@ -250,7 +250,7 @@ public: public: /// Default constructor - Polyhedral_mesh_domain_3(CGAL::Random* p_rng = NULL) + Polyhedral_mesh_domain_3(CGAL::Random* p_rng = nullptr) : tree_() , bounding_tree_(&tree_) , p_rng_(p_rng) @@ -262,7 +262,7 @@ public: * @param polyhedron the polyhedron describing the polyhedral surface */ Polyhedral_mesh_domain_3(const Polyhedron& p, - CGAL::Random* p_rng = NULL) + CGAL::Random* p_rng = nullptr) : tree_() , bounding_tree_(&tree_) // the bounding tree is tree_ , p_rng_(p_rng) @@ -277,7 +277,7 @@ public: Polyhedral_mesh_domain_3(const Polyhedron& p, const Polyhedron& bounding_polyhedron, - CGAL::Random* p_rng = NULL) + CGAL::Random* p_rng = nullptr) : tree_() , bounding_tree_(new AABB_tree_) , p_rng_(p_rng) @@ -307,7 +307,7 @@ public: Polyhedral_mesh_domain_3(InputPolyhedraPtrIterator begin, InputPolyhedraPtrIterator end, const Polyhedron& bounding_polyhedron, - CGAL::Random* p_rng = NULL) + CGAL::Random* p_rng = nullptr) : p_rng_(p_rng) , delete_rng_(false) { @@ -338,7 +338,7 @@ public: template Polyhedral_mesh_domain_3(InputPolyhedraPtrIterator begin, InputPolyhedraPtrIterator end, - CGAL::Random* p_rng = NULL) + CGAL::Random* p_rng = nullptr) : p_rng_(p_rng) { if(begin != end) { diff --git a/Mesh_3/include/CGAL/Polyhedral_mesh_domain_with_features_3.h b/Mesh_3/include/CGAL/Polyhedral_mesh_domain_with_features_3.h index d3547b6d768..5c34e8b50fd 100644 --- a/Mesh_3/include/CGAL/Polyhedral_mesh_domain_with_features_3.h +++ b/Mesh_3/include/CGAL/Polyhedral_mesh_domain_with_features_3.h @@ -131,7 +131,7 @@ public: Bare_polyline > Polyline_with_context; /// Constructors Polyhedral_mesh_domain_with_features_3(const Polyhedron& p, - CGAL::Random* p_rng = NULL) + CGAL::Random* p_rng = nullptr) : Base(p_rng) , borders_detected_(false) { stored_polyhedra.resize(1); @@ -145,7 +145,7 @@ public: CGAL_DEPRECATED Polyhedral_mesh_domain_with_features_3(const std::string& filename, - CGAL::Random* p_rng = NULL) + CGAL::Random* p_rng = nullptr) : Base(p_rng) , borders_detected_(false) { load_from_file(filename.c_str()); @@ -156,7 +156,7 @@ public: // constructor with `std::string`. CGAL_DEPRECATED Polyhedral_mesh_domain_with_features_3(const char* filename, - CGAL::Random* p_rng = NULL) + CGAL::Random* p_rng = nullptr) : Base(p_rng) , borders_detected_(false) { load_from_file(filename); @@ -165,7 +165,7 @@ public: Polyhedral_mesh_domain_with_features_3(const Polyhedron& p, const Polyhedron& bounding_p, - CGAL::Random* p_rng = NULL) + CGAL::Random* p_rng = nullptr) : Base(p_rng) , borders_detected_(false) { stored_polyhedra.resize(2); @@ -185,7 +185,7 @@ public: template Polyhedral_mesh_domain_with_features_3(InputPolyhedraPtrIterator begin, InputPolyhedraPtrIterator end, - CGAL::Random* p_rng = NULL) + CGAL::Random* p_rng = nullptr) : Base(p_rng) , borders_detected_(false) { stored_polyhedra.reserve(std::distance(begin, end)); @@ -202,7 +202,7 @@ public: Polyhedral_mesh_domain_with_features_3(InputPolyhedraPtrIterator begin, InputPolyhedraPtrIterator end, const Polyhedron& bounding_polyhedron, - CGAL::Random* p_rng = NULL) + CGAL::Random* p_rng = nullptr) : Base(p_rng) , borders_detected_(false) { stored_polyhedra.reserve(std::distance(begin, end)+1); diff --git a/Mesh_3/include/CGAL/internal/Mesh_3/check_weights.h b/Mesh_3/include/CGAL/internal/Mesh_3/check_weights.h index 71652287a6b..39eaae34cf7 100644 --- a/Mesh_3/include/CGAL/internal/Mesh_3/check_weights.h +++ b/Mesh_3/include/CGAL/internal/Mesh_3/check_weights.h @@ -42,8 +42,7 @@ template bool has_non_protecting_weights(const Triangulation& tr, const MeshDomain&) { - bool with_features = - boost::is_same, CGAL::Tag_true>::value; + const bool with_features = Has_features::value; typedef typename Triangulation::FT FT; typedef typename Triangulation::Weighted_point Weighted_point; @@ -59,7 +58,12 @@ bool has_non_protecting_weights(const Triangulation& tr, const Weighted_point& vv_wp = tr.point(vv); if (cwsr(vv_wp, FT(0)) != CGAL::EQUAL) { - if (with_features && vv->in_dimension() > 1) + if (with_features) + { + if (vv->in_dimension() > 1) + return true; + } + else return true; } } diff --git a/Mesh_3/test/Mesh_3/test_meshing_3D_gray_image.cpp b/Mesh_3/test/Mesh_3/test_meshing_3D_gray_image.cpp index 1ee420467b2..941dce7dc63 100644 --- a/Mesh_3/test/Mesh_3/test_meshing_3D_gray_image.cpp +++ b/Mesh_3/test/Mesh_3/test_meshing_3D_gray_image.cpp @@ -87,7 +87,6 @@ public: Mesh_criteria criteria(facet_angle = 30, facet_size = 6, facet_distance = 2, - facet_topology = CGAL::MANIFOLD, cell_radius_edge_ratio = 3, cell_size = 8); diff --git a/Minkowski_sum_2/include/CGAL/Minkowski_sum_2/AABB_node_with_join.h b/Minkowski_sum_2/include/CGAL/Minkowski_sum_2/AABB_node_with_join.h index 85e40e511ca..3b4f39c7e4e 100644 --- a/Minkowski_sum_2/include/CGAL/Minkowski_sum_2/AABB_node_with_join.h +++ b/Minkowski_sum_2/include/CGAL/Minkowski_sum_2/AABB_node_with_join.h @@ -47,8 +47,8 @@ public: /// Constructor AABB_node_with_join() : m_bbox() - , m_p_left_child(NULL) - , m_p_right_child(NULL) { }; + , m_p_left_child(nullptr) + , m_p_right_child(nullptr) { }; /// Non virtual Destructor /// Do not delete children because the tree hosts and delete them diff --git a/Minkowski_sum_2/include/CGAL/Minkowski_sum_2/AABB_tree_with_join.h b/Minkowski_sum_2/include/CGAL/Minkowski_sum_2/AABB_tree_with_join.h index e4316f429cc..7c74c3b7e4d 100644 --- a/Minkowski_sum_2/include/CGAL/Minkowski_sum_2/AABB_tree_with_join.h +++ b/Minkowski_sum_2/include/CGAL/Minkowski_sum_2/AABB_tree_with_join.h @@ -429,7 +429,7 @@ public: if( size() > 1 ) { delete [] m_p_root_node; } - m_p_root_node = NULL; + m_p_root_node = nullptr; } // clears internal KD tree @@ -437,9 +437,9 @@ public: { if ( m_search_tree_constructed ) { - CGAL_assertion( m_p_search_tree!=NULL ); + CGAL_assertion( m_p_search_tree!=nullptr ); delete m_p_search_tree; - m_p_search_tree = NULL; + m_p_search_tree = nullptr; m_search_tree_constructed = false; m_default_search_tree_constructed = false; } @@ -554,8 +554,8 @@ public: AABB_tree_with_join