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/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 ffb887580a3..9f940860783 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/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/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/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_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/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/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(e1is_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; @@ -685,7 +685,7 @@ shape. The implementation follows \cgalCite{schnabel2007efficient}. if (occupied >= candidates.size()) break; candidates[empty] = candidates[occupied]; - candidates[occupied] = NULL; + candidates[occupied] = nullptr; empty++; occupied++; } @@ -703,7 +703,7 @@ shape. The implementation follows \cgalCite{schnabel2007efficient}. <= 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( @@ -766,7 +766,7 @@ shape. The implementation follows \cgalCite{schnabel2007efficient}. 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) ? @@ -784,7 +784,7 @@ shape. The implementation follows \cgalCite{schnabel2007efficient}. 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/Point_set_shape_detection_3/include/CGAL/Shape_detection_3/Octree.h b/Point_set_shape_detection_3/include/CGAL/Shape_detection_3/Octree.h index 646f3228cff..5921e4258e7 100644 --- a/Point_set_shape_detection_3/include/CGAL/Shape_detection_3/Octree.h +++ b/Point_set_shape_detection_3/include/CGAL/Shape_detection_3/Octree.h @@ -235,7 +235,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, @@ -246,7 +246,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/Point_set_shape_detection_3/include/CGAL/Shape_detection_3/Region_growing.h b/Point_set_shape_detection_3/include/CGAL/Shape_detection_3/Region_growing.h index f6181ed1efc..57508855785 100644 --- a/Point_set_shape_detection_3/include/CGAL/Shape_detection_3/Region_growing.h +++ b/Point_set_shape_detection_3/include/CGAL/Shape_detection_3/Region_growing.h @@ -311,7 +311,7 @@ shape. The implementation follows \cgalCite{cgal:lm-clscm-12}. , m_num_available_points(0) , m_num_total_points(0) , m_valid_iterators(false) - , m_tree (NULL) + , m_tree (nullptr) {} /*! @@ -441,10 +441,10 @@ shape. The implementation follows \cgalCite{cgal:lm-clscm-12}. 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/Profiling_tools/include/CGAL/Memory_sizer.h b/Profiling_tools/include/CGAL/Memory_sizer.h index a590745c862..dc58048696a 100644 --- a/Profiling_tools/include/CGAL/Memory_sizer.h +++ b/Profiling_tools/include/CGAL/Memory_sizer.h @@ -141,7 +141,7 @@ private: // (though non-root of course!). I haven't tested with non-admin user. // -- Samuel Hornus - task_t task = MACH_PORT_NULL; + task_t task = MACH_PORT_nullptr; // The task_for_pid() seems to be time consuming (looking at the source // in xnu-source/bsd/vm/vm_unix.c // TODO: so it may be a good idea to cache the resulting 'task' 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/Three/doc/Three/Three.txt b/Three/doc/Three/Three.txt index 8c615392b71..a5a3e296113 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()); } 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_3/include/CGAL/Delaunay_triangulation_3.h b/Triangulation_3/include/CGAL/Delaunay_triangulation_3.h index 2ba4b33574a..29348f2709e 100644 --- a/Triangulation_3/include/CGAL/Delaunay_triangulation_3.h +++ b/Triangulation_3/include/CGAL/Delaunay_triangulation_3.h @@ -1278,7 +1278,7 @@ class Delaunay_triangulation_3::Vertex_remover typedef DelaunayTriangulation_3 Delaunay; public: - typedef std::std::nullptr_t Hidden_points_iterator; + typedef std::nullptr_t Hidden_points_iterator; Vertex_remover(Delaunay &tmp_) : tmp(tmp_) {} @@ -1303,7 +1303,7 @@ class Delaunay_triangulation_3::Vertex_inserter typedef DelaunayTriangulation_3 Delaunay; public: - typedef std::std::nullptr_t Hidden_points_iterator; + typedef std::nullptr_t Hidden_points_iterator; Vertex_inserter(Delaunay &tmp_) : tmp(tmp_) {} diff --git a/Triangulation_3/include/CGAL/Regular_triangulation_3.h b/Triangulation_3/include/CGAL/Regular_triangulation_3.h index d8d710b41c7..4d09fa918b4 100644 --- a/Triangulation_3/include/CGAL/Regular_triangulation_3.h +++ b/Triangulation_3/include/CGAL/Regular_triangulation_3.h @@ -2496,7 +2496,7 @@ class Regular_triangulation_3::Vertex_inserter typedef RegularTriangulation_3 Regular; public: - typedef std::std::nullptr_t Hidden_points_iterator; + typedef std::nullptr_t Hidden_points_iterator; Vertex_inserter(Regular &tmp_) : tmp(tmp_) {}
    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_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_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/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/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..35aa11334a6 100644 --- a/Combinatorial_map/include/CGAL/Combinatorial_map_storages.h +++ b/Combinatorial_map/include/CGAL/Combinatorial_map_storages.h @@ -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/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..e85f2c802db 100644 --- a/Generalized_map/include/CGAL/Generalized_map_storages.h +++ b/Generalized_map/include/CGAL/Generalized_map_storages.h @@ -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_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/include/CGAL/config.h b/Installation/include/CGAL/config.h index ed9f90ec594..1d363b6bf38 100644 --- a/Installation/include/CGAL/config.h +++ b/Installation/include/CGAL/config.h @@ -656,8 +656,8 @@ namespace CGAL { namespace CGAL { -// Typedef for the type of NULL. -typedef const void * Nullptr_t; // Anticipate C++0x's std::std::nullptr_t +// 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/Interpolation/include/CGAL/sibson_gradient_fitting.h b/Interpolation/include/CGAL/sibson_gradient_fitting.h index 106e19e2384..9ba4f4119f2 100644 --- a/Interpolation/include/CGAL/sibson_gradient_fitting.h +++ b/Interpolation/include/CGAL/sibson_gradient_fitting.h @@ -246,7 +246,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::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..c7bdeac5a2b 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 @@ -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..8cd7315fdb7 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 @@ -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/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/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/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