diff --git a/.clang-tidy b/.clang-tidy new file mode 100644 index 000000000000..b7f07abf900a --- /dev/null +++ b/.clang-tidy @@ -0,0 +1,5 @@ +--- +Checks: '-clang-diagnostic*,-clang-analyzer*,modernize-use-nullptr' +HeaderFilterRegex: 'CGAL/*' +... + diff --git a/AABB_tree/demo/AABB_tree/MainWindow.cpp b/AABB_tree/demo/AABB_tree/MainWindow.cpp index bde07b1b29fd..8b111b61f013 100644 --- a/AABB_tree/demo/AABB_tree/MainWindow.cpp +++ b/AABB_tree/demo/AABB_tree/MainWindow.cpp @@ -154,7 +154,7 @@ void MainWindow::on_actionInside_points_triggered() bool ok; const unsigned int nb_points = (unsigned) - QInputDialog::getInt(NULL, "#Points", + QInputDialog::getInt(nullptr, "#Points", "#Points:",10000,1,100000000,9,&ok); if(!ok) @@ -171,19 +171,19 @@ void MainWindow::on_actionPoints_in_interval_triggered() bool ok; const unsigned int nb_points = (unsigned) - QInputDialog::getInt(NULL, "#Points", + QInputDialog::getInt(nullptr, "#Points", "#Points:",10000,1,100000000,9,&ok); if(!ok) return; const double min = - QInputDialog::getDouble(NULL, "min", + QInputDialog::getDouble(nullptr, "min", "Min:",-0.1,-1000.0,1000.0,9,&ok); if(!ok) return; const double max = - QInputDialog::getDouble(NULL, "max", + QInputDialog::getDouble(nullptr, "max", "Max:",0.1,-1000.0,1000.0,9,&ok); if(!ok) return; @@ -199,7 +199,7 @@ void MainWindow::on_actionBoundary_segments_triggered() bool ok; const unsigned int nb_slices = (unsigned) - QInputDialog::getInt(NULL, "#Slices", + QInputDialog::getInt(nullptr, "#Slices", "Slices:",100,1,1000000,8,&ok); if(!ok) @@ -216,7 +216,7 @@ void MainWindow::on_actionBoundary_points_triggered() bool ok; const unsigned int nb_points = (unsigned) - QInputDialog::getInt(NULL, "#Points", + QInputDialog::getInt(nullptr, "#Points", "Points:",1000,1,10000000,8,&ok); if(!ok) @@ -233,7 +233,7 @@ void MainWindow::on_actionEdge_points_triggered() bool ok; const unsigned int nb_points = (unsigned) - QInputDialog::getInt(NULL, "#Points", + QInputDialog::getInt(nullptr, "#Points", "Points:",1000,1,10000000,8,&ok); if(!ok) @@ -248,7 +248,7 @@ void MainWindow::on_actionEdge_points_triggered() void MainWindow::on_actionBench_distances_triggered() { bool ok; - const double duration = QInputDialog::getDouble(NULL, "Duration", + const double duration = QInputDialog::getDouble(nullptr, "Duration", "Duration (s):",1.0,0.01,1000,8,&ok); if(!ok) return; @@ -262,7 +262,7 @@ void MainWindow::on_actionBench_distances_triggered() void MainWindow::on_actionBench_intersections_triggered() { bool ok; - const double duration = QInputDialog::getDouble(NULL, "Duration", + const double duration = QInputDialog::getDouble(nullptr, "Duration", "Duration (s):",1.0,0.01,1000.0,8,&ok); if(!ok) return; @@ -361,7 +361,7 @@ void MainWindow::on_actionRefine_bisection_triggered() { bool ok; const double max_len = - QInputDialog::getDouble(NULL, "Max edge len", + QInputDialog::getDouble(nullptr, "Max edge len", "Max edge len:",0.1,0.001,100.0,9,&ok); if(!ok) return; diff --git a/AABB_tree/demo/AABB_tree/MainWindow.h b/AABB_tree/demo/AABB_tree/MainWindow.h index 3dac40b96d5a..2a072f195121 100644 --- a/AABB_tree/demo/AABB_tree/MainWindow.h +++ b/AABB_tree/demo/AABB_tree/MainWindow.h @@ -18,7 +18,7 @@ class MainWindow : { Q_OBJECT public: - MainWindow(QWidget* parent = 0); + MainWindow(QWidget* parent = nullptr); ~MainWindow(); public slots: diff --git a/AABB_tree/demo/AABB_tree/Scene.cpp b/AABB_tree/demo/AABB_tree/Scene.cpp index b86be7ca2920..6ae939bfc38a 100644 --- a/AABB_tree/demo/AABB_tree/Scene.cpp +++ b/AABB_tree/demo/AABB_tree/Scene.cpp @@ -33,7 +33,7 @@ Scene::Scene() , m_grid_size(slow_distance_grid_size) , m_cut_plane(NONE) { - m_pPolyhedron = NULL; + m_pPolyhedron = nullptr; // view options m_view_points = true; @@ -541,7 +541,7 @@ int Scene::open(QString filename) return -1; } - if(m_pPolyhedron != NULL) + if(m_pPolyhedron != nullptr) delete m_pPolyhedron; // allocate new polyhedron @@ -553,7 +553,7 @@ int Scene::open(QString filename) QApplication::restoreOverrideCursor(); delete m_pPolyhedron; - m_pPolyhedron = NULL; + m_pPolyhedron = nullptr; return -1; } @@ -571,7 +571,7 @@ void Scene::update_bbox() std::cout << "Compute bbox..."; m_bbox = Bbox(); - if(m_pPolyhedron == NULL) + if(m_pPolyhedron == nullptr) { std::cout << "failed (no polyhedron)." << std::endl; return; @@ -794,7 +794,7 @@ FT Scene::bbox_diag() const void Scene::build_facet_tree() { - if ( NULL == m_pPolyhedron ) + if ( nullptr == m_pPolyhedron ) { std::cerr << "Build facet tree failed: load polyhedron first." << std::endl; return; @@ -813,7 +813,7 @@ void Scene::build_facet_tree() void Scene::build_edge_tree() { - if ( NULL == m_pPolyhedron ) + if ( nullptr == m_pPolyhedron ) { std::cerr << "Build edge tree failed: load polyhedron first." << std::endl; return; @@ -860,7 +860,7 @@ void Scene::generate_points_in(const unsigned int nb_points, const double vmin, const double vmax) { - if(m_pPolyhedron == NULL) + if(m_pPolyhedron == nullptr) { std::cout << "Load polyhedron first." << std::endl; return; @@ -913,7 +913,7 @@ void Scene::generate_points_in(const unsigned int nb_points, void Scene::generate_inside_points(const unsigned int nb_points) { - if(m_pPolyhedron == NULL) + if(m_pPolyhedron == nullptr) { std::cout << "Load polyhedron first." << std::endl; return; @@ -955,7 +955,7 @@ void Scene::generate_inside_points(const unsigned int nb_points) void Scene::generate_boundary_segments(const unsigned int nb_slices) { - if(m_pPolyhedron == NULL) + if(m_pPolyhedron == nullptr) { std::cout << "Load polyhedron first." << std::endl; return; @@ -1005,7 +1005,7 @@ void Scene::generate_boundary_segments(const unsigned int nb_slices) void Scene::generate_boundary_points(const unsigned int nb_points) { - if(m_pPolyhedron == NULL) + if(m_pPolyhedron == nullptr) { std::cout << "Load polyhedron first." << std::endl; return; @@ -1055,7 +1055,7 @@ void Scene::generate_boundary_points(const unsigned int nb_points) void Scene::generate_edge_points(const unsigned int nb_points) { - if(m_pPolyhedron == NULL) + if(m_pPolyhedron == nullptr) { std::cout << "Load polyhedron first." << std::endl; return; @@ -1219,7 +1219,7 @@ void Scene::cut_segment_plane() { const Segment* inter_seg = CGAL::object_cast(&(it->first)); - if ( NULL != inter_seg ) + if ( nullptr != inter_seg ) { m_cut_segments.push_back(*inter_seg); } @@ -1280,7 +1280,7 @@ void Scene::toggle_view_plane() void Scene::refine_bisection(const FT max_sqlen) { - if(m_pPolyhedron == NULL) + if(m_pPolyhedron == nullptr) { std::cout << "Load polyhedron first." << std::endl; return; @@ -1295,7 +1295,7 @@ void Scene::refine_bisection(const FT max_sqlen) void Scene::refine_loop() { - if(m_pPolyhedron == NULL) + if(m_pPolyhedron == nullptr) { std::cout << "Load polyhedron first." << std::endl; return; diff --git a/AABB_tree/demo/AABB_tree/Viewer.cpp b/AABB_tree/demo/AABB_tree/Viewer.cpp index 348960c5e23e..7bc82f7770e6 100644 --- a/AABB_tree/demo/AABB_tree/Viewer.cpp +++ b/AABB_tree/demo/AABB_tree/Viewer.cpp @@ -6,7 +6,7 @@ Viewer::Viewer(QWidget* parent) : CGAL::QGLViewer(parent), - m_pScene(NULL), + m_pScene(nullptr), m_custom_mouse(false) { } @@ -19,7 +19,7 @@ void Viewer::setScene(Scene* pScene) void Viewer::draw() { CGAL::QGLViewer::draw(); - if(m_pScene != NULL) + if(m_pScene != nullptr) { m_pScene->draw(this); } diff --git a/AABB_tree/demo/AABB_tree/benchmarks.cpp b/AABB_tree/demo/AABB_tree/benchmarks.cpp index 742b07c9a8ce..0b51ef6de2a2 100644 --- a/AABB_tree/demo/AABB_tree/benchmarks.cpp +++ b/AABB_tree/demo/AABB_tree/benchmarks.cpp @@ -6,7 +6,7 @@ void Scene::benchmark_intersections(const double duration) { - if(m_pPolyhedron == NULL) + if(m_pPolyhedron == nullptr) { std::cout << "Load polyhedron first." << std::endl; return; @@ -67,7 +67,7 @@ void Scene::bench_intersections(Facet_tree& tree, void Scene::benchmark_distances(const double duration) { - if(m_pPolyhedron == NULL) + if(m_pPolyhedron == nullptr) { std::cout << "Load polyhedron first." << std::endl; return; @@ -101,7 +101,7 @@ std::size_t Scene::nb_digits(std::size_t value) // refinement loop void Scene::bench_memory() { - if(m_pPolyhedron == NULL) + if(m_pPolyhedron == nullptr) { std::cout << "Load polyhedron first." << std::endl; return; @@ -137,7 +137,7 @@ void Scene::bench_memory() void Scene::bench_construction() { - if(m_pPolyhedron == NULL) + if(m_pPolyhedron == nullptr) { std::cout << "Load polyhedron first." << std::endl; return; @@ -174,7 +174,7 @@ void Scene::bench_construction() void Scene::bench_intersections_vs_nbt() { - if(m_pPolyhedron == NULL) + if(m_pPolyhedron == nullptr) { std::cout << "Load polyhedron first." << std::endl; return; @@ -218,7 +218,7 @@ void Scene::bench_intersections_vs_nbt() void Scene::bench_distances_vs_nbt() { - if(m_pPolyhedron == NULL) + if(m_pPolyhedron == nullptr) { std::cout << "Load polyhedron first." << std::endl; return; diff --git a/AABB_tree/examples/AABB_tree/AABB_custom_indexed_triangle_set_array_example.cpp b/AABB_tree/examples/AABB_tree/AABB_custom_indexed_triangle_set_array_example.cpp index d15c7155cd91..ab8f529f54c5 100644 --- a/AABB_tree/examples/AABB_tree/AABB_custom_indexed_triangle_set_array_example.cpp +++ b/AABB_tree/examples/AABB_tree/AABB_custom_indexed_triangle_set_array_example.cpp @@ -99,7 +99,7 @@ struct My_triangle_primitive { // types typedef CGAL::AABB_traits My_AABB_traits; typedef CGAL::AABB_tree Tree; -const double* My_triangle_primitive::point_container = 0; +const double* My_triangle_primitive::point_container = nullptr; int main() { diff --git a/AABB_tree/examples/AABB_tree/AABB_custom_indexed_triangle_set_example.cpp b/AABB_tree/examples/AABB_tree/AABB_custom_indexed_triangle_set_example.cpp index a3436eed89e5..b864c08adbac 100644 --- a/AABB_tree/examples/AABB_tree/AABB_custom_indexed_triangle_set_example.cpp +++ b/AABB_tree/examples/AABB_tree/AABB_custom_indexed_triangle_set_example.cpp @@ -106,7 +106,7 @@ struct My_triangle_primitive { // types typedef CGAL::AABB_traits My_AABB_traits; typedef CGAL::AABB_tree Tree; -const std::vector* My_triangle_primitive::point_container = 0; +const std::vector* My_triangle_primitive::point_container = nullptr; int main() { diff --git a/Alpha_shapes_3/demo/Alpha_shapes_3/MainWindow.h b/Alpha_shapes_3/demo/Alpha_shapes_3/MainWindow.h index 9aee5f64484f..eb3b00a40be2 100644 --- a/Alpha_shapes_3/demo/Alpha_shapes_3/MainWindow.h +++ b/Alpha_shapes_3/demo/Alpha_shapes_3/MainWindow.h @@ -16,7 +16,7 @@ class MainWindow : public CGAL::Qt::DemosMainWindow, private Ui::MainWindow Q_OBJECT public: - MainWindow(QWidget* parent = 0); + MainWindow(QWidget* parent = nullptr); void connectActions(); diff --git a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/AlgebraicCurveInputDialog.h b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/AlgebraicCurveInputDialog.h index 780dc4c6645f..fabfd31138e3 100644 --- a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/AlgebraicCurveInputDialog.h +++ b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/AlgebraicCurveInputDialog.h @@ -22,7 +22,7 @@ class AlgebraicCurveInputDialog : public QDialog Q_OBJECT public: - explicit AlgebraicCurveInputDialog(QWidget *parent = 0); + explicit AlgebraicCurveInputDialog(QWidget *parent = nullptr); ~AlgebraicCurveInputDialog(); std::string getLineEditText(); Ui::AlgebraicCurveInputDialog* getUi(){return this->ui;} diff --git a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/ArrangementDemoGraphicsView.h b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/ArrangementDemoGraphicsView.h index f0ec2b3ac1f2..4a18bb7382ce 100644 --- a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/ArrangementDemoGraphicsView.h +++ b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/ArrangementDemoGraphicsView.h @@ -21,7 +21,7 @@ class QPaintEvent; class ArrangementDemoGraphicsView : public QGraphicsView { public: - ArrangementDemoGraphicsView( QWidget* parent = 0 ); + ArrangementDemoGraphicsView( QWidget* parent = nullptr ); void setBackgroundColor( QColor color ); QColor getBackgroundColor( ) const; diff --git a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/ArrangementDemoPropertiesDialog.cpp b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/ArrangementDemoPropertiesDialog.cpp index 271ceddc01c5..5cdaa3b00612 100644 --- a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/ArrangementDemoPropertiesDialog.cpp +++ b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/ArrangementDemoPropertiesDialog.cpp @@ -41,7 +41,7 @@ QVariant ArrangementDemoPropertiesDialog::property( int index ) } QTableWidgetItem* item = this->ui->tableWidget->item( index, 0 ); - if ( item == 0 ) + if ( item == nullptr ) { return res; } @@ -102,17 +102,17 @@ void ArrangementDemoPropertiesDialog::setupUi( ) */ void ArrangementDemoPropertiesDialog::updateUi( ) { - if ( this->parent == NULL ) + if ( this->parent == nullptr ) { return; } ArrangementDemoTab* currentTab = this->parent->getCurrentTab(); - if ( currentTab == NULL ) + if ( currentTab == nullptr ) { return; } CGAL::Qt::ArrangementGraphicsItemBase* agi = currentTab->getArrangementGraphicsItem( ); - if ( agi == NULL ) + if ( agi == nullptr ) { return; } diff --git a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/ArrangementDemoPropertiesDialog.h b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/ArrangementDemoPropertiesDialog.h index 0db3916ef8f2..843948a3d7a3 100644 --- a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/ArrangementDemoPropertiesDialog.h +++ b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/ArrangementDemoPropertiesDialog.h @@ -41,7 +41,7 @@ class ArrangementDemoPropertiesDialog : public QDialog GRID_COLOR_KEY /*!< color of the grid */ }; - ArrangementDemoPropertiesDialog( ArrangementDemoWindow* parent_ = 0 ); + ArrangementDemoPropertiesDialog( ArrangementDemoWindow* parent_ = nullptr ); QVariant property( int index ); protected: diff --git a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/ColorItemEditor.h b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/ColorItemEditor.h index 799943dd6414..13c6c13b06e5 100644 --- a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/ColorItemEditor.h +++ b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/ColorItemEditor.h @@ -56,7 +56,7 @@ class ColorItemEditor : public QPushButton Q_PROPERTY(QColor color READ color WRITE setColor USER true) public: - ColorItemEditor(QWidget *widget = 0); + ColorItemEditor(QWidget *widget = nullptr); public: QColor color( ) const; diff --git a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/NewTabDialog.h b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/NewTabDialog.h index 11e485fcc226..587c881c00d8 100644 --- a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/NewTabDialog.h +++ b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/NewTabDialog.h @@ -23,7 +23,7 @@ namespace Ui class NewTabDialog : public QDialog { public: - NewTabDialog( QWidget* parent = 0 ); + NewTabDialog( QWidget* parent = nullptr ); int checkedId( ) const; protected: diff --git a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/PropertyValueDelegate.h b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/PropertyValueDelegate.h index 21a01953d24f..8a5c11f1567a 100644 --- a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/PropertyValueDelegate.h +++ b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/PropertyValueDelegate.h @@ -22,7 +22,7 @@ class PropertyValueDelegate : public QItemDelegate Q_OBJECT public: - PropertyValueDelegate( QObject* parent = 0 ); + PropertyValueDelegate( QObject* parent = nullptr ); public: QWidget* createEditor( QWidget* parent, const QStyleOptionViewItem& option, diff --git a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/RationalCurveInputDialog.h b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/RationalCurveInputDialog.h index 86c20abea2ba..cef2ee319362 100644 --- a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/RationalCurveInputDialog.h +++ b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/RationalCurveInputDialog.h @@ -24,7 +24,7 @@ class RationalCurveInputDialog : public QDialog Q_OBJECT public: - explicit RationalCurveInputDialog(QWidget *parent = 0); + explicit RationalCurveInputDialog(QWidget *parent = nullptr); ~RationalCurveInputDialog(); std::string getNumeratorText(); std::string getDenominatorText(); diff --git a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/Utils/Utils.cpp b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/Utils/Utils.cpp index 3d93dd822dbc..a8a2f336263b 100644 --- a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/Utils/Utils.cpp +++ b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/Utils/Utils.cpp @@ -126,7 +126,7 @@ operator()(const Point_2& p, const X_monotone_curve_2& c) const // AlgKernel ker; int n = 100; - if (this->scene != NULL && this->scene->views().size() != 0) + if (this->scene != nullptr && this->scene->views().size() != 0) { // use the scene to approximate the resolution of the curve QGraphicsView* view = this->scene->views().first(); CGAL::Bbox_2 bb = c.bbox(); // assumes bounded curve diff --git a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/VerticalRayGraphicsItem.cpp b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/VerticalRayGraphicsItem.cpp index b2a01a815328..583b56d6f3a9 100644 --- a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/VerticalRayGraphicsItem.cpp +++ b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/VerticalRayGraphicsItem.cpp @@ -185,7 +185,7 @@ void VerticalRayGraphicsItem::modelChanged( ) QRectF VerticalRayGraphicsItem::viewportRect( ) const { QRectF res; - if ( this->scene( ) == NULL ) + if ( this->scene( ) == nullptr ) { return res; } @@ -207,7 +207,7 @@ QRectF VerticalRayGraphicsItem::viewportRect( ) const void VerticalRayGraphicsItem::drawArrowhead( QPainter* painter, double targetY, bool isShootingUp ) { - if ( this->scene( ) == 0 || this->scene( )->views( ).size( ) == 0 ) + if ( this->scene( ) == nullptr || this->scene( )->views( ).size( ) == 0 ) { return; } diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/Construction_test.h b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/Construction_test.h index f0cb8b30e631..913c9922be0c 100644 --- a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/Construction_test.h +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/Construction_test.h @@ -172,7 +172,7 @@ Construction_test:: Construction_test(const Geom_traits& geom_traits) : Base(geom_traits), m_geom_traits(geom_traits), - m_arr(NULL), + m_arr(nullptr), m_verbose_level(0) {} @@ -188,7 +188,7 @@ void Construction_test::deallocate_arrangement() { if (m_arr) { delete m_arr; - m_arr = NULL; + m_arr = nullptr; } } diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/Point_location_test.h b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/Point_location_test.h index c60a9a0cdad8..bce0e2d5e1f9 100644 --- a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/Point_location_test.h +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/Point_location_test.h @@ -252,7 +252,7 @@ class Point_location_test : public IO_test { template void init_pl(const std::string& name) { - m_locators[id].m_variant = static_cast(NULL); + m_locators[id].m_variant = static_cast(nullptr); m_locators[id].m_name = name; m_locators[id].m_active = true; } @@ -293,7 +293,7 @@ class Point_location_test : public IO_test { Strategy* strategy = boost::get(m_locators[id].m_variant); if (strategy) { delete strategy; - m_locators[id].m_variant = static_cast(NULL); + m_locators[id].m_variant = static_cast(nullptr); } } @@ -667,12 +667,12 @@ Point_location_test:: Point_location_test(const Geom_traits& geom_traits) : Base(geom_traits), m_geom_traits(geom_traits), - m_arr(NULL), - m_random_g(NULL), - m_grid_g(NULL), - m_halton_g(NULL), - m_middle_edges_g(NULL), - m_specified_points_g(NULL) + m_arr(nullptr), + m_random_g(nullptr), + m_grid_g(nullptr), + m_halton_g(nullptr), + m_middle_edges_g(nullptr), + m_specified_points_g(nullptr) { m_locators.resize(NUM_PL_STRATEGIES); @@ -773,7 +773,7 @@ deallocate_arrangement() { if (m_arr) { delete m_arr; - m_arr = NULL; + m_arr = nullptr; } } diff --git a/BGL/examples/BGL_LCC/transform_iterator_lcc.cpp b/BGL/examples/BGL_LCC/transform_iterator_lcc.cpp index 9e6134449ec7..12533a4ed0d0 100644 --- a/BGL/examples/BGL_LCC/transform_iterator_lcc.cpp +++ b/BGL/examples/BGL_LCC/transform_iterator_lcc.cpp @@ -24,7 +24,7 @@ struct Source { const G* g; Source() - : g(NULL) + : g(nullptr) {} Source(const G& g) diff --git a/BGL/examples/BGL_polyhedron_3/transform_iterator.cpp b/BGL/examples/BGL_polyhedron_3/transform_iterator.cpp index 8542f4ea3b37..5133f3d45df6 100644 --- a/BGL/examples/BGL_polyhedron_3/transform_iterator.cpp +++ b/BGL/examples/BGL_polyhedron_3/transform_iterator.cpp @@ -21,7 +21,7 @@ struct Source { const G* g; Source() - : g(NULL) + : g(nullptr) {} Source(const G& g) diff --git a/BGL/examples/BGL_surface_mesh/surface_mesh_dual.cpp b/BGL/examples/BGL_surface_mesh/surface_mesh_dual.cpp index 0031a0e2cd42..fd5535d0ea71 100644 --- a/BGL/examples/BGL_surface_mesh/surface_mesh_dual.cpp +++ b/BGL/examples/BGL_surface_mesh/surface_mesh_dual.cpp @@ -17,7 +17,7 @@ typedef boost::graph_traits::edge_descriptor edge_descriptor; template struct noborder { - noborder() : g(NULL) {} // default-constructor required by filtered_graph + noborder() : g(nullptr) {} // default-constructor required by filtered_graph noborder(G& g) : g(&g) {} bool operator()(const edge_descriptor& e) const diff --git a/CGAL_ImageIO/test/CGAL_ImageIO/test_trilinear_interpolation.cpp b/CGAL_ImageIO/test/CGAL_ImageIO/test_trilinear_interpolation.cpp index 61f1443423f4..a3789dc632dd 100644 --- a/CGAL_ImageIO/test/CGAL_ImageIO/test_trilinear_interpolation.cpp +++ b/CGAL_ImageIO/test/CGAL_ImageIO/test_trilinear_interpolation.cpp @@ -188,7 +188,7 @@ int main() { << "timer new implementation: " << timer_new_implementation.time() << "\ntimer old implementation: " << timer_old_implementation.time() << "\n"; - image.set_data(0); // trick to avoid ~Image_3 segfault. + image.set_data(nullptr); // trick to avoid ~Image_3 segfault. const char* filenames[] = { diff --git a/CGAL_ipelets/demo/CGAL_ipelets/mst.cpp b/CGAL_ipelets/demo/CGAL_ipelets/mst.cpp index 64de862117c5..2d3f050d6cdf 100644 --- a/CGAL_ipelets/demo/CGAL_ipelets/mst.cpp +++ b/CGAL_ipelets/demo/CGAL_ipelets/mst.cpp @@ -37,7 +37,7 @@ template struct Is_finite { const T* t_; Is_finite() - : t_(NULL) + : t_(nullptr) {} Is_finite(const T& t) : t_(&t) diff --git a/Circular_kernel_3/demo/Circular_kernel_3/Viewer.cpp b/Circular_kernel_3/demo/Circular_kernel_3/Viewer.cpp index 38e0a1924143..ae95e4ac8faa 100644 --- a/Circular_kernel_3/demo/Circular_kernel_3/Viewer.cpp +++ b/Circular_kernel_3/demo/Circular_kernel_3/Viewer.cpp @@ -906,7 +906,7 @@ void Viewer::naive_compute_intersection_points(const std::vector& for (std::vector ::const_iterator it_pt=intersections.begin();it_pt!=intersections.end();++it_pt){ const std::pair* pt= CGAL::object_cast< std::pair > (&(*it_pt)); - assert(pt!=NULL); + assert(pt!=nullptr); *out++=EPIC::Point_3( CGAL::to_double(pt->first.x()), CGAL::to_double(pt->first.y()), CGAL::to_double(pt->first.z()) diff --git a/Circular_kernel_3/demo/Circular_kernel_3/Viewer.h b/Circular_kernel_3/demo/Circular_kernel_3/Viewer.h index cad037ce2c8d..7ba3a2b1fe88 100644 --- a/Circular_kernel_3/demo/Circular_kernel_3/Viewer.h +++ b/Circular_kernel_3/demo/Circular_kernel_3/Viewer.h @@ -12,7 +12,7 @@ typedef CGAL::Exact_predicates_inexact_constructions_kernel EPIC; class Viewer : public CGAL::QGLViewer { public: - Viewer(QWidget* parent = 0); + Viewer(QWidget* parent = nullptr); ~Viewer(); GLuint dl_nb; protected : diff --git a/Circulator/test/Circulator/test_circ1.cpp b/Circulator/test/Circulator/test_circ1.cpp index cc7f1d5cd544..a3ffa58158f9 100644 --- a/Circulator/test/Circulator/test_circ1.cpp +++ b/Circulator/test/Circulator/test_circ1.cpp @@ -235,7 +235,7 @@ void test_tags() { assert( 4 == foo( v.begin())); assert( 4 == foo( v.end())); - int* p = NULL; + int* p = nullptr; assert( 4 == foo( p)); { typedef Forward_circulator_base @@ -465,8 +465,8 @@ void test_container_from_circulator() { typedef std::iterator_traits I_Traits; typedef I_Traits::value_type I_value_type; typedef I_Traits::difference_type I_difference_type; - assert(1==test_value_type( (I_value_type*)(0))); - assert(1==test_difference_type( (I_difference_type*)(0))); + assert(1==test_value_type( (I_value_type*)nullptr)); + assert(1==test_difference_type( (I_difference_type*)nullptr)); // Default constructor. Iterator z = Iterator(); @@ -577,8 +577,8 @@ void test_container_from_circulator() { typedef std::iterator_traits I_Traits; typedef I_Traits::value_type I_value_type; typedef I_Traits::difference_type I_difference_type; - assert(1==test_value_type( (I_value_type*)(0))); - assert(1==test_difference_type( (I_difference_type*)(0))); + assert(1==test_value_type( (I_value_type*)nullptr)); + assert(1==test_difference_type( (I_difference_type*)nullptr)); // Default constructor. Const_iterator z = Const_iterator(); @@ -656,8 +656,8 @@ void test_container_from_circulator() { typedef std::iterator_traits I_Traits; typedef I_Traits::value_type I_value_type; typedef I_Traits::difference_type I_difference_type; - assert(1==test_value_type( (I_value_type*)(0))); - assert(1==test_difference_type( (I_difference_type*)(0))); + assert(1==test_value_type( (I_value_type*)nullptr)); + assert(1==test_difference_type( (I_difference_type*)nullptr)); // Default constructor. Iterator z = Iterator(); @@ -749,8 +749,8 @@ void test_container_from_circulator() { typedef std::iterator_traits I_Traits; typedef I_Traits::value_type I_value_type; typedef I_Traits::difference_type I_difference_type; - assert(1==test_value_type( (I_value_type*)(0))); - assert(1==test_difference_type( (I_difference_type*)(0))); + assert(1==test_value_type( (I_value_type*)nullptr)); + assert(1==test_difference_type( (I_difference_type*)nullptr)); // Default constructor. Iterator z = Iterator(); @@ -864,8 +864,8 @@ void test_container_from_circulator() { typedef std::iterator_traits I_Traits; typedef I_Traits::value_type I_value_type; typedef I_Traits::difference_type I_difference_type; - assert(1==test_value_type( (I_value_type*)(0))); - assert(1==test_difference_type( (I_difference_type*)(0))); + assert(1==test_value_type( (I_value_type*)nullptr)); + assert(1==test_difference_type( (I_difference_type*)nullptr)); // Default constructor. Const_iterator z = Const_iterator(); @@ -982,8 +982,8 @@ void test_container_from_circulator() { typedef std::iterator_traits I_Traits; typedef I_Traits::value_type I_value_type; typedef I_Traits::difference_type I_difference_type; - assert(1==test_value_type( (I_value_type*)(0))); - assert(1==test_difference_type( (I_difference_type*)(0))); + assert(1==test_value_type( (I_value_type*)nullptr)); + assert(1==test_difference_type( (I_difference_type*)nullptr)); // Default constructor. Iterator z = Iterator(); @@ -1075,8 +1075,8 @@ void test_container_from_circulator() { typedef std::iterator_traits I_Traits; typedef I_Traits::value_type I_value_type; typedef I_Traits::difference_type I_difference_type; - assert(1==test_value_type( (I_value_type*)(0))); - assert(1==test_difference_type( (I_difference_type*)(0))); + assert(1==test_value_type( (I_value_type*)nullptr)); + assert(1==test_difference_type( (I_difference_type*)nullptr)); // Default constructor. Iterator z = Iterator(); @@ -1171,8 +1171,8 @@ void test_container_from_circulator() { typedef std::iterator_traits I_Traits; typedef I_Traits::value_type I_value_type; typedef I_Traits::difference_type I_difference_type; - assert(1==test_value_type( (I_value_type*)(0))); - assert(1==test_difference_type( (I_difference_type*)(0))); + assert(1==test_value_type( (I_value_type*)nullptr)); + assert(1==test_difference_type( (I_difference_type*)nullptr)); // Default constructor. Iterator z = Iterator(); @@ -1372,8 +1372,8 @@ void test_container_from_circulator() { typedef std::iterator_traits I_Traits; typedef I_Traits::value_type I_value_type; typedef I_Traits::difference_type I_difference_type; - assert(1==test_value_type( (I_value_type*)(0))); - assert(1==test_difference_type( (I_difference_type*)(0))); + assert(1==test_value_type( (I_value_type*)nullptr)); + assert(1==test_difference_type( (I_difference_type*)nullptr)); // Default constructor. Const_iterator z = Const_iterator(); @@ -1550,8 +1550,8 @@ void test_container_from_circulator() { typedef std::iterator_traits I_Traits; typedef I_Traits::value_type I_value_type; typedef I_Traits::difference_type I_difference_type; - assert(1==test_value_type( (I_value_type*)(0))); - assert(1==test_difference_type( (I_difference_type*)(0))); + assert(1==test_value_type( (I_value_type*)nullptr)); + assert(1==test_difference_type( (I_difference_type*)nullptr)); // Default constructor. Iterator z = Iterator(); @@ -1643,8 +1643,8 @@ void test_container_from_circulator() { typedef std::iterator_traits I_Traits; typedef I_Traits::value_type I_value_type; typedef I_Traits::difference_type I_difference_type; - assert(1==test_value_type( (I_value_type*)(0))); - assert(1==test_difference_type( (I_difference_type*)(0))); + assert(1==test_value_type( (I_value_type*)nullptr)); + assert(1==test_difference_type( (I_difference_type*)nullptr)); // Default constructor. Iterator z = Iterator(); @@ -1758,8 +1758,8 @@ void test_container_from_circulator() { typedef std::iterator_traits I_Traits; typedef I_Traits::value_type I_value_type; typedef I_Traits::difference_type I_difference_type; - assert(1==test_value_type( (I_value_type*)(0))); - assert(1==test_difference_type( (I_difference_type*)(0))); + assert(1==test_value_type( (I_value_type*)nullptr)); + assert(1==test_difference_type( (I_difference_type*)nullptr)); // Default constructor. Const_iterator z = Const_iterator(); @@ -1875,8 +1875,8 @@ void test_container_from_circulator() { typedef std::iterator_traits I_Traits; typedef I_Traits::value_type I_value_type; typedef I_Traits::difference_type I_difference_type; - assert(1==test_value_type( (I_value_type*)(0))); - assert(1==test_difference_type( (I_difference_type*)(0))); + assert(1==test_value_type( (I_value_type*)nullptr)); + assert(1==test_difference_type( (I_difference_type*)nullptr)); // Default constructor. Iterator z = Iterator(); @@ -1968,8 +1968,8 @@ void test_container_from_circulator() { typedef std::iterator_traits I_Traits; typedef I_Traits::value_type I_value_type; typedef I_Traits::difference_type I_difference_type; - assert(1==test_value_type( (I_value_type*)(0))); - assert(1==test_difference_type( (I_difference_type*)(0))); + assert(1==test_value_type( (I_value_type*)nullptr)); + assert(1==test_difference_type( (I_difference_type*)nullptr)); // Default constructor. Iterator z = Iterator(); @@ -2064,8 +2064,8 @@ void test_container_from_circulator() { typedef std::iterator_traits I_Traits; typedef I_Traits::value_type I_value_type; typedef I_Traits::difference_type I_difference_type; - assert(1==test_value_type( (I_value_type*)(0))); - assert(1==test_difference_type( (I_difference_type*)(0))); + assert(1==test_value_type( (I_value_type*)nullptr)); + assert(1==test_difference_type( (I_difference_type*)nullptr)); // Default constructor. Iterator z = Iterator(); @@ -2262,8 +2262,8 @@ void test_circulator_from_iterator() { typedef std::iterator_traits I_Traits; typedef I_Traits::value_type I_value_type; typedef I_Traits::difference_type I_difference_type; - assert(1==test_value_type( (I_value_type*)(0))); - assert(1==test_difference_type( (I_difference_type*)(0))); + assert(1==test_value_type( (I_value_type*)nullptr)); + assert(1==test_difference_type( (I_difference_type*)nullptr)); // Default constructor. Circulator z = Circulator(); @@ -2374,11 +2374,11 @@ void test_circulator_from_iterator() { // Check tests for empty data structures. Circulator z = Circulator(); - assert( z == NULL); - assert( ! (z != NULL)); + assert( z == nullptr); + assert( ! (z != nullptr)); Circulator i = c; - assert( ! (i == NULL)); - assert( i != NULL); + assert( ! (i == nullptr)); + assert( i != nullptr); assert( i == c); assert( i == c); // Do I reach myself. @@ -2408,8 +2408,8 @@ void test_circulator_from_iterator() { typedef std::iterator_traits I_Traits; typedef I_Traits::value_type I_value_type; typedef I_Traits::difference_type I_difference_type; - assert(1==test_value_type( (I_value_type*)(0))); - assert(1==test_difference_type( (I_difference_type*)(0))); + assert(1==test_value_type( (I_value_type*)nullptr)); + assert(1==test_difference_type( (I_difference_type*)nullptr)); // Default constructor. Circulator z = Circulator(); @@ -2487,11 +2487,11 @@ void test_circulator_from_iterator() { // Check tests for empty data structures. Circulator z = Circulator(); - assert( z == NULL); - assert( ! (z != NULL)); + assert( z == nullptr); + assert( ! (z != nullptr)); Circulator i = c; - assert( ! (i == NULL)); - assert( i != NULL); + assert( ! (i == nullptr)); + assert( i != nullptr); assert( i == c); assert( i == c); // Do I reach myself. @@ -2521,8 +2521,8 @@ void test_circulator_from_iterator() { typedef std::iterator_traits I_Traits; typedef I_Traits::value_type I_value_type; typedef I_Traits::difference_type I_difference_type; - assert(1==test_value_type( (I_value_type*)(0))); - assert(1==test_difference_type( (I_difference_type*)(0))); + assert(1==test_value_type( (I_value_type*)nullptr)); + assert(1==test_difference_type( (I_difference_type*)nullptr)); // Default constructor. Circulator z = Circulator(); @@ -2614,8 +2614,8 @@ void test_circulator_from_iterator() { typedef std::iterator_traits I_Traits; typedef I_Traits::value_type I_value_type; typedef I_Traits::difference_type I_difference_type; - assert(1==test_value_type( (I_value_type*)(0))); - assert(1==test_difference_type( (I_difference_type*)(0))); + assert(1==test_value_type( (I_value_type*)nullptr)); + assert(1==test_difference_type( (I_difference_type*)nullptr)); // Default constructor. Circulator z = Circulator(); @@ -2729,11 +2729,11 @@ void test_circulator_from_iterator() { // Check tests for empty data structures. Circulator z = Circulator(); - assert( z == NULL); - assert( ! (z != NULL)); + assert( z == nullptr); + assert( ! (z != nullptr)); Circulator i = c; - assert( ! (i == NULL)); - assert( i != NULL); + assert( ! (i == nullptr)); + assert( i != nullptr); assert( i == c); assert( i == c); // Do I reach myself. @@ -2776,8 +2776,8 @@ void test_circulator_from_iterator() { typedef std::iterator_traits I_Traits; typedef I_Traits::value_type I_value_type; typedef I_Traits::difference_type I_difference_type; - assert(1==test_value_type( (I_value_type*)(0))); - assert(1==test_difference_type( (I_difference_type*)(0))); + assert(1==test_value_type( (I_value_type*)nullptr)); + assert(1==test_difference_type( (I_difference_type*)nullptr)); // Default constructor. Circulator z = Circulator(); @@ -2891,11 +2891,11 @@ void test_circulator_from_iterator() { // Check tests for empty data structures. Circulator z = Circulator(); - assert( z == NULL); - assert( ! (z != NULL)); + assert( z == nullptr); + assert( ! (z != nullptr)); Circulator i = c; - assert( ! (i == NULL)); - assert( i != NULL); + assert( ! (i == nullptr)); + assert( i != nullptr); assert( i == c); assert( i == c); // Do I reach myself. @@ -2938,8 +2938,8 @@ void test_circulator_from_iterator() { typedef std::iterator_traits I_Traits; typedef I_Traits::value_type I_value_type; typedef I_Traits::difference_type I_difference_type; - assert(1==test_value_type( (I_value_type*)(0))); - assert(1==test_difference_type( (I_difference_type*)(0))); + assert(1==test_value_type( (I_value_type*)nullptr)); + assert(1==test_difference_type( (I_difference_type*)nullptr)); // Default constructor. Circulator z = Circulator(); @@ -3031,8 +3031,8 @@ void test_circulator_from_iterator() { typedef std::iterator_traits I_Traits; typedef I_Traits::value_type I_value_type; typedef I_Traits::difference_type I_difference_type; - assert(1==test_value_type( (I_value_type*)(0))); - assert(1==test_difference_type( (I_difference_type*)(0))); + assert(1==test_value_type( (I_value_type*)nullptr)); + assert(1==test_difference_type( (I_difference_type*)nullptr)); // Default constructor. Circulator z = Circulator(); @@ -3127,8 +3127,8 @@ void test_circulator_from_iterator() { typedef std::iterator_traits I_Traits; typedef I_Traits::value_type I_value_type; typedef I_Traits::difference_type I_difference_type; - assert(1==test_value_type( (I_value_type*)(0))); - assert(1==test_difference_type( (I_difference_type*)(0))); + assert(1==test_value_type( (I_value_type*)nullptr)); + assert(1==test_difference_type( (I_difference_type*)nullptr)); // Default constructor. Circulator z = Circulator(); @@ -3302,11 +3302,11 @@ void test_circulator_from_iterator() { // Check tests for empty data structures. Circulator z = Circulator(); - assert( z == NULL); - assert( ! (z != NULL)); + assert( z == nullptr); + assert( ! (z != nullptr)); Circulator i = c; - assert( ! (i == NULL)); - assert( i != NULL); + assert( ! (i == nullptr)); + assert( i != nullptr); assert( i == c); assert( i == c); // Do I reach myself. @@ -3372,8 +3372,8 @@ void test_circulator_from_iterator() { typedef std::iterator_traits I_Traits; typedef I_Traits::value_type I_value_type; typedef I_Traits::difference_type I_difference_type; - assert(1==test_value_type( (I_value_type*)(0))); - assert(1==test_difference_type( (I_difference_type*)(0))); + assert(1==test_value_type( (I_value_type*)nullptr)); + assert(1==test_difference_type( (I_difference_type*)nullptr)); // Default constructor. Circulator z = Circulator(); @@ -3527,11 +3527,11 @@ void test_circulator_from_iterator() { // Check tests for empty data structures. Circulator z = Circulator(); - assert( z == NULL); - assert( ! (z != NULL)); + assert( z == nullptr); + assert( ! (z != nullptr)); Circulator i = c; - assert( ! (i == NULL)); - assert( i != NULL); + assert( ! (i == nullptr)); + assert( i != nullptr); assert( i == c); assert( i == c); // Do I reach myself. @@ -3624,8 +3624,8 @@ void test_circulator_from_container() { typedef std::iterator_traits I_Traits; typedef I_Traits::value_type I_value_type; typedef I_Traits::difference_type I_difference_type; - assert(1==test_value_type( (I_value_type*)(0))); - assert(1==test_difference_type( (I_difference_type*)(0))); + assert(1==test_value_type( (I_value_type*)nullptr)); + assert(1==test_difference_type( (I_difference_type*)nullptr)); // Default constructor. Circulator z = Circulator(); @@ -3736,11 +3736,11 @@ void test_circulator_from_container() { // Check tests for empty data structures. Circulator z = Circulator(); - assert( z == NULL); - assert( ! (z != NULL)); + assert( z == nullptr); + assert( ! (z != nullptr)); Circulator i = c; - assert( ! (i == NULL)); - assert( i != NULL); + assert( ! (i == nullptr)); + assert( i != nullptr); assert( i == c); assert( i == c); // Do I reach myself. @@ -3770,8 +3770,8 @@ void test_circulator_from_container() { typedef std::iterator_traits I_Traits; typedef I_Traits::value_type I_value_type; typedef I_Traits::difference_type I_difference_type; - assert(1==test_value_type( (I_value_type*)(0))); - assert(1==test_difference_type( (I_difference_type*)(0))); + assert(1==test_value_type( (I_value_type*)nullptr)); + assert(1==test_difference_type( (I_difference_type*)nullptr)); // Default constructor. Circulator z = Circulator(); @@ -3849,11 +3849,11 @@ void test_circulator_from_container() { // Check tests for empty data structures. Circulator z = Circulator(); - assert( z == NULL); - assert( ! (z != NULL)); + assert( z == nullptr); + assert( ! (z != nullptr)); Circulator i = c; - assert( ! (i == NULL)); - assert( i != NULL); + assert( ! (i == nullptr)); + assert( i != nullptr); assert( i == c); assert( i == c); // Do I reach myself. @@ -3883,8 +3883,8 @@ void test_circulator_from_container() { typedef std::iterator_traits I_Traits; typedef I_Traits::value_type I_value_type; typedef I_Traits::difference_type I_difference_type; - assert(1==test_value_type( (I_value_type*)(0))); - assert(1==test_difference_type( (I_difference_type*)(0))); + assert(1==test_value_type( (I_value_type*)nullptr)); + assert(1==test_difference_type( (I_difference_type*)nullptr)); // Default constructor. Circulator z = Circulator(); @@ -3976,8 +3976,8 @@ void test_circulator_from_container() { typedef std::iterator_traits I_Traits; typedef I_Traits::value_type I_value_type; typedef I_Traits::difference_type I_difference_type; - assert(1==test_value_type( (I_value_type*)(0))); - assert(1==test_difference_type( (I_difference_type*)(0))); + assert(1==test_value_type( (I_value_type*)nullptr)); + assert(1==test_difference_type( (I_difference_type*)nullptr)); // Default constructor. Circulator z = Circulator(); @@ -4091,11 +4091,11 @@ void test_circulator_from_container() { // Check tests for empty data structures. Circulator z = Circulator(); - assert( z == NULL); - assert( ! (z != NULL)); + assert( z == nullptr); + assert( ! (z != nullptr)); Circulator i = c; - assert( ! (i == NULL)); - assert( i != NULL); + assert( ! (i == nullptr)); + assert( i != nullptr); assert( i == c); assert( i == c); // Do I reach myself. @@ -4139,8 +4139,8 @@ void test_circulator_from_container() { typedef std::iterator_traits I_Traits; typedef I_Traits::value_type I_value_type; typedef I_Traits::difference_type I_difference_type; - assert(1==test_value_type( (I_value_type*)(0))); - assert(1==test_difference_type( (I_difference_type*)(0))); + assert(1==test_value_type( (I_value_type*)nullptr)); + assert(1==test_difference_type( (I_difference_type*)nullptr)); // Default constructor. Circulator z = Circulator(); @@ -4254,11 +4254,11 @@ void test_circulator_from_container() { // Check tests for empty data structures. Circulator z = Circulator(); - assert( z == NULL); - assert( ! (z != NULL)); + assert( z == nullptr); + assert( ! (z != nullptr)); Circulator i = c; - assert( ! (i == NULL)); - assert( i != NULL); + assert( ! (i == nullptr)); + assert( i != nullptr); assert( i == c); assert( i == c); // Do I reach myself. @@ -4301,8 +4301,8 @@ void test_circulator_from_container() { typedef std::iterator_traits I_Traits; typedef I_Traits::value_type I_value_type; typedef I_Traits::difference_type I_difference_type; - assert(1==test_value_type( (I_value_type*)(0))); - assert(1==test_difference_type( (I_difference_type*)(0))); + assert(1==test_value_type( (I_value_type*)nullptr)); + assert(1==test_difference_type( (I_difference_type*)nullptr)); // Default constructor. Circulator z = Circulator(); @@ -4394,8 +4394,8 @@ void test_circulator_from_container() { typedef std::iterator_traits I_Traits; typedef I_Traits::value_type I_value_type; typedef I_Traits::difference_type I_difference_type; - assert(1==test_value_type( (I_value_type*)(0))); - assert(1==test_difference_type( (I_difference_type*)(0))); + assert(1==test_value_type( (I_value_type*)nullptr)); + assert(1==test_difference_type( (I_difference_type*)nullptr)); // Default constructor. Circulator z = Circulator(); @@ -4490,8 +4490,8 @@ void test_circulator_from_container() { typedef std::iterator_traits I_Traits; typedef I_Traits::value_type I_value_type; typedef I_Traits::difference_type I_difference_type; - assert(1==test_value_type( (I_value_type*)(0))); - assert(1==test_difference_type( (I_difference_type*)(0))); + assert(1==test_value_type( (I_value_type*)nullptr)); + assert(1==test_difference_type( (I_difference_type*)nullptr)); // Default constructor. Circulator z = Circulator(); @@ -4665,11 +4665,11 @@ void test_circulator_from_container() { // Check tests for empty data structures. Circulator z = Circulator(); - assert( z == NULL); - assert( ! (z != NULL)); + assert( z == nullptr); + assert( ! (z != nullptr)); Circulator i = c; - assert( ! (i == NULL)); - assert( i != NULL); + assert( ! (i == nullptr)); + assert( i != nullptr); assert( i == c); assert( i == c); // Do I reach myself. @@ -4736,8 +4736,8 @@ void test_circulator_from_container() { typedef std::iterator_traits I_Traits; typedef I_Traits::value_type I_value_type; typedef I_Traits::difference_type I_difference_type; - assert(1==test_value_type( (I_value_type*)(0))); - assert(1==test_difference_type( (I_difference_type*)(0))); + assert(1==test_value_type( (I_value_type*)nullptr)); + assert(1==test_difference_type( (I_difference_type*)nullptr)); // Default constructor. Circulator z = Circulator(); @@ -4891,11 +4891,11 @@ void test_circulator_from_container() { // Check tests for empty data structures. Circulator z = Circulator(); - assert( z == NULL); - assert( ! (z != NULL)); + assert( z == nullptr); + assert( ! (z != nullptr)); Circulator i = c; - assert( ! (i == NULL)); - assert( i != NULL); + assert( ! (i == nullptr)); + assert( i != nullptr); assert( i == c); assert( i == c); // Do I reach myself. diff --git a/Circulator/test/Circulator/test_circ2.cpp b/Circulator/test/Circulator/test_circ2.cpp index cc2a55ddaa4f..697363d1cb61 100644 --- a/Circulator/test/Circulator/test_circ2.cpp +++ b/Circulator/test/Circulator/test_circ2.cpp @@ -186,8 +186,8 @@ void test_struct(){ typedef std::iterator_traits I_Traits; typedef I_Traits::value_type I_value_type; typedef I_Traits::difference_type I_difference_type; - assert(1==test_value_type( (I_value_type*)(0))); - assert(1==test_difference_type( (I_difference_type*)(0))); + assert(1==test_value_type( (I_value_type*)nullptr)); + assert(1==test_difference_type( (I_difference_type*)nullptr)); // Default constructor. Struct_circulator z = Struct_circulator(); @@ -298,11 +298,11 @@ void test_struct(){ // Check tests for empty data structures. Struct_circulator z = Struct_circulator(); - assert( z == NULL); - assert( ! (z != NULL)); + assert( z == nullptr); + assert( ! (z != nullptr)); Struct_circulator i = start; - assert( ! (i == NULL)); - assert( i != NULL); + assert( ! (i == nullptr)); + assert( i != nullptr); assert( i == start); assert( i == start); // Do I reach myself. @@ -328,8 +328,8 @@ void test_struct(){ typedef std::iterator_traits I_Traits; typedef I_Traits::value_type I_value_type; typedef I_Traits::difference_type I_difference_type; - assert(1==test_value_type( (I_value_type*)(0))); - assert(1==test_difference_type( (I_difference_type*)(0))); + assert(1==test_value_type( (I_value_type*)nullptr)); + assert(1==test_difference_type( (I_difference_type*)nullptr)); // Default constructor. Struct_const_circulator z = Struct_const_circulator(); @@ -407,11 +407,11 @@ void test_struct(){ // Check tests for empty data structures. Struct_const_circulator z = Struct_const_circulator(); - assert( z == NULL); - assert( ! (z != NULL)); + assert( z == nullptr); + assert( ! (z != nullptr)); Struct_const_circulator i = start; - assert( ! (i == NULL)); - assert( i != NULL); + assert( ! (i == nullptr)); + assert( i != nullptr); assert( i == start); assert( i == start); // Do I reach myself. @@ -437,8 +437,8 @@ void test_struct(){ typedef std::iterator_traits I_Traits; typedef I_Traits::value_type I_value_type; typedef I_Traits::difference_type I_difference_type; - assert(1==test_value_type( (I_value_type*)(0))); - assert(1==test_difference_type( (I_difference_type*)(0))); + assert(1==test_value_type( (I_value_type*)nullptr)); + assert(1==test_difference_type( (I_difference_type*)nullptr)); // Default constructor. Struct_bi_circulator z = Struct_bi_circulator(); @@ -530,8 +530,8 @@ void test_struct(){ typedef std::iterator_traits I_Traits; typedef I_Traits::value_type I_value_type; typedef I_Traits::difference_type I_difference_type; - assert(1==test_value_type( (I_value_type*)(0))); - assert(1==test_difference_type( (I_difference_type*)(0))); + assert(1==test_value_type( (I_value_type*)nullptr)); + assert(1==test_difference_type( (I_difference_type*)nullptr)); // Default constructor. Struct_bi_circulator z = Struct_bi_circulator(); @@ -645,11 +645,11 @@ void test_struct(){ // Check tests for empty data structures. Struct_bi_circulator z = Struct_bi_circulator(); - assert( z == NULL); - assert( ! (z != NULL)); + assert( z == nullptr); + assert( ! (z != nullptr)); Struct_bi_circulator i = start; - assert( ! (i == NULL)); - assert( i != NULL); + assert( ! (i == nullptr)); + assert( i != nullptr); assert( i == start); assert( i == start); // Do I reach myself. @@ -688,8 +688,8 @@ void test_struct(){ typedef std::iterator_traits I_Traits; typedef I_Traits::value_type I_value_type; typedef I_Traits::difference_type I_difference_type; - assert(1==test_value_type( (I_value_type*)(0))); - assert(1==test_difference_type( (I_difference_type*)(0))); + assert(1==test_value_type( (I_value_type*)nullptr)); + assert(1==test_difference_type( (I_difference_type*)nullptr)); // Default constructor. Struct_bi_const_circulator z = Struct_bi_const_circulator(); @@ -803,11 +803,11 @@ void test_struct(){ // Check tests for empty data structures. Struct_bi_const_circulator z = Struct_bi_const_circulator(); - assert( z == NULL); - assert( ! (z != NULL)); + assert( z == nullptr); + assert( ! (z != nullptr)); Struct_bi_const_circulator i = start; - assert( ! (i == NULL)); - assert( i != NULL); + assert( ! (i == nullptr)); + assert( i != nullptr); assert( i == start); assert( i == start); // Do I reach myself. @@ -851,8 +851,8 @@ void test_class(){ typedef std::iterator_traits I_Traits; typedef I_Traits::value_type I_value_type; typedef I_Traits::difference_type I_difference_type; - assert(1==test_value_type( (I_value_type*)(0))); - assert(1==test_difference_type( (I_difference_type*)(0))); + assert(1==test_value_type( (I_value_type*)nullptr)); + assert(1==test_difference_type( (I_difference_type*)nullptr)); // Default constructor. Class_circulator z = Class_circulator(); @@ -963,11 +963,11 @@ void test_class(){ // Check tests for empty data structures. Class_circulator z = Class_circulator(); - assert( z == NULL); - assert( ! (z != NULL)); + assert( z == nullptr); + assert( ! (z != nullptr)); Class_circulator i = start; - assert( ! (i == NULL)); - assert( i != NULL); + assert( ! (i == nullptr)); + assert( i != nullptr); assert( i == start); assert( i == start); // Do I reach myself. @@ -993,8 +993,8 @@ void test_class(){ typedef std::iterator_traits I_Traits; typedef I_Traits::value_type I_value_type; typedef I_Traits::difference_type I_difference_type; - assert(1==test_value_type( (I_value_type*)(0))); - assert(1==test_difference_type( (I_difference_type*)(0))); + assert(1==test_value_type( (I_value_type*)nullptr)); + assert(1==test_difference_type( (I_difference_type*)nullptr)); // Default constructor. Class_const_circulator z = Class_const_circulator(); @@ -1072,11 +1072,11 @@ void test_class(){ // Check tests for empty data structures. Class_const_circulator z = Class_const_circulator(); - assert( z == NULL); - assert( ! (z != NULL)); + assert( z == nullptr); + assert( ! (z != nullptr)); Class_const_circulator i = start; - assert( ! (i == NULL)); - assert( i != NULL); + assert( ! (i == nullptr)); + assert( i != nullptr); assert( i == start); assert( i == start); // Do I reach myself. @@ -1102,8 +1102,8 @@ void test_class(){ typedef std::iterator_traits I_Traits; typedef I_Traits::value_type I_value_type; typedef I_Traits::difference_type I_difference_type; - assert(1==test_value_type( (I_value_type*)(0))); - assert(1==test_difference_type( (I_difference_type*)(0))); + assert(1==test_value_type( (I_value_type*)nullptr)); + assert(1==test_difference_type( (I_difference_type*)nullptr)); // Default constructor. Class_bi_circulator z = Class_bi_circulator(); @@ -1195,8 +1195,8 @@ void test_class(){ typedef std::iterator_traits I_Traits; typedef I_Traits::value_type I_value_type; typedef I_Traits::difference_type I_difference_type; - assert(1==test_value_type( (I_value_type*)(0))); - assert(1==test_difference_type( (I_difference_type*)(0))); + assert(1==test_value_type( (I_value_type*)nullptr)); + assert(1==test_difference_type( (I_difference_type*)nullptr)); // Default constructor. Class_bi_circulator z = Class_bi_circulator(); @@ -1310,11 +1310,11 @@ void test_class(){ // Check tests for empty data structures. Class_bi_circulator z = Class_bi_circulator(); - assert( z == NULL); - assert( ! (z != NULL)); + assert( z == nullptr); + assert( ! (z != nullptr)); Class_bi_circulator i = start; - assert( ! (i == NULL)); - assert( i != NULL); + assert( ! (i == nullptr)); + assert( i != nullptr); assert( i == start); assert( i == start); // Do I reach myself. @@ -1353,8 +1353,8 @@ void test_class(){ typedef std::iterator_traits I_Traits; typedef I_Traits::value_type I_value_type; typedef I_Traits::difference_type I_difference_type; - assert(1==test_value_type( (I_value_type*)(0))); - assert(1==test_difference_type( (I_difference_type*)(0))); + assert(1==test_value_type( (I_value_type*)nullptr)); + assert(1==test_difference_type( (I_difference_type*)nullptr)); // Default constructor. Class_bi_const_circulator z = Class_bi_const_circulator(); @@ -1468,11 +1468,11 @@ void test_class(){ // Check tests for empty data structures. Class_bi_const_circulator z = Class_bi_const_circulator(); - assert( z == NULL); - assert( ! (z != NULL)); + assert( z == nullptr); + assert( ! (z != nullptr)); Class_bi_const_circulator i = start; - assert( ! (i == NULL)); - assert( i != NULL); + assert( ! (i == nullptr)); + assert( i != nullptr); assert( i == start); assert( i == start); // Do I reach myself. @@ -1521,8 +1521,8 @@ void test_array() { typedef std::iterator_traits I_Traits; typedef I_Traits::value_type I_value_type; typedef I_Traits::difference_type I_difference_type; - assert(1==test_value_type( (I_value_type*)(0))); - assert(1==test_difference_type( (I_difference_type*)(0))); + assert(1==test_value_type( (I_value_type*)nullptr)); + assert(1==test_difference_type( (I_difference_type*)nullptr)); // Default constructor. Circulator z = Circulator(); @@ -1614,8 +1614,8 @@ void test_array() { typedef std::iterator_traits I_Traits; typedef I_Traits::value_type I_value_type; typedef I_Traits::difference_type I_difference_type; - assert(1==test_value_type( (I_value_type*)(0))); - assert(1==test_difference_type( (I_difference_type*)(0))); + assert(1==test_value_type( (I_value_type*)nullptr)); + assert(1==test_difference_type( (I_difference_type*)nullptr)); // Default constructor. Circulator z = Circulator(); @@ -1710,8 +1710,8 @@ void test_array() { typedef std::iterator_traits I_Traits; typedef I_Traits::value_type I_value_type; typedef I_Traits::difference_type I_difference_type; - assert(1==test_value_type( (I_value_type*)(0))); - assert(1==test_difference_type( (I_difference_type*)(0))); + assert(1==test_value_type( (I_value_type*)nullptr)); + assert(1==test_difference_type( (I_difference_type*)nullptr)); // Default constructor. Circulator z = Circulator(); @@ -1885,11 +1885,11 @@ void test_array() { // Check tests for empty data structures. Circulator z = Circulator(); - assert( z == NULL); - assert( ! (z != NULL)); + assert( z == nullptr); + assert( ! (z != nullptr)); Circulator i = start; - assert( ! (i == NULL)); - assert( i != NULL); + assert( ! (i == nullptr)); + assert( i != nullptr); assert( i == start); assert( i == start); // Do I reach myself. @@ -1958,8 +1958,8 @@ void test_array() { typedef std::iterator_traits I_Traits; typedef I_Traits::value_type I_value_type; typedef I_Traits::difference_type I_difference_type; - assert(1==test_value_type( (I_value_type*)(0))); - assert(1==test_difference_type( (I_difference_type*)(0))); + assert(1==test_value_type( (I_value_type*)nullptr)); + assert(1==test_difference_type( (I_difference_type*)nullptr)); // Default constructor. Circulator z = Circulator(); @@ -2113,11 +2113,11 @@ void test_array() { // Check tests for empty data structures. Circulator z = Circulator(); - assert( z == NULL); - assert( ! (z != NULL)); + assert( z == nullptr); + assert( ! (z != nullptr)); Circulator i = start; - assert( ! (i == NULL)); - assert( i != NULL); + assert( ! (i == nullptr)); + assert( i != nullptr); assert( i == start); assert( i == start); // Do I reach myself. diff --git a/Combinatorial_map/examples/Combinatorial_map/map_3_with_colored_facets.cpp b/Combinatorial_map/examples/Combinatorial_map/map_3_with_colored_facets.cpp index 766cbfa57ece..4fdbce46f3e9 100644 --- a/Combinatorial_map/examples/Combinatorial_map/map_3_with_colored_facets.cpp +++ b/Combinatorial_map/examples/Combinatorial_map/map_3_with_colored_facets.cpp @@ -47,7 +47,7 @@ int main() it=cm.darts().begin(), itend=cm.darts().end(); it!=itend; ++it) { - if ( cm.attribute<2>(it)==NULL ) + if ( cm.attribute<2>(it)==nullptr ) cm.set_attribute<2>(it, cm.create_attribute<2>()); } diff --git a/Convex_decomposition_3/test/Convex_decomposition_3/edge_sorter.cpp b/Convex_decomposition_3/test/Convex_decomposition_3/edge_sorter.cpp index deda0dc50ee0..921e42dc54af 100644 --- a/Convex_decomposition_3/test/Convex_decomposition_3/edge_sorter.cpp +++ b/Convex_decomposition_3/test/Convex_decomposition_3/edge_sorter.cpp @@ -23,15 +23,15 @@ class LEdge { ~LEdge() { - if(v != NULL) + if(v != nullptr) delete v; - v = NULL; + v = nullptr; } LVertex* source() { return v; } LEdge* twin() { return t; } void set_twin(LEdge* t_) { t = t_; } - void reset_source() { v = NULL; } + void reset_source() { v = nullptr; } }; template diff --git a/Filtered_kernel/test/Filtered_kernel/test_lazy_vector_objects.cpp b/Filtered_kernel/test/Filtered_kernel/test_lazy_vector_objects.cpp index a0793b58c8b6..041f6022a0ec 100644 --- a/Filtered_kernel/test/Filtered_kernel/test_lazy_vector_objects.cpp +++ b/Filtered_kernel/test/Filtered_kernel/test_lazy_vector_objects.cpp @@ -41,7 +41,7 @@ int main() return EXIT_FAILURE; } - V = NULL; + V = nullptr; if( !(V = boost::get >(&(*o_variant))) ){ std::cerr << "ERROR, something other than vector< point_2 >" << std::endl; return EXIT_FAILURE; @@ -81,7 +81,7 @@ int main() return EXIT_FAILURE; } - V = NULL; + V = nullptr; if( !(V = boost::get > (&(*o_variant))) ){ std::cerr << "ERROR" << std::endl; return EXIT_FAILURE; diff --git a/Generalized_map/examples/Generalized_map/gmap_3_with_colored_facets.cpp b/Generalized_map/examples/Generalized_map/gmap_3_with_colored_facets.cpp index e35fb19e779f..2cfca8dd0825 100644 --- a/Generalized_map/examples/Generalized_map/gmap_3_with_colored_facets.cpp +++ b/Generalized_map/examples/Generalized_map/gmap_3_with_colored_facets.cpp @@ -47,7 +47,7 @@ int main() it=gm.darts().begin(), itend=gm.darts().end(); it!=itend; ++it) { - if ( gm.attribute<2>(it)==NULL ) + if ( gm.attribute<2>(it)==nullptr ) gm.set_attribute<2>(it, gm.create_attribute<2>()); } diff --git a/GraphicsView/demo/Circular_kernel_2/ArcsGraphicsItem.h b/GraphicsView/demo/Circular_kernel_2/ArcsGraphicsItem.h index b831eecc382a..b4de860626c0 100644 --- a/GraphicsView/demo/Circular_kernel_2/ArcsGraphicsItem.h +++ b/GraphicsView/demo/Circular_kernel_2/ArcsGraphicsItem.h @@ -69,7 +69,7 @@ class ArcsGraphicsItem : public GraphicsItem template ArcsGraphicsItem::ArcsGraphicsItem(std::vector& arcs_, std::vector& intersections_) - : arcs(arcs_), intersections(intersections_), painterostream(0) + : arcs(arcs_), intersections(intersections_), painterostream(nullptr) { setIntersectionsPen(QPen(::Qt::red, 3.)); if(arcs.empty()){ diff --git a/GraphicsView/demo/Generator/Generator_2.cpp b/GraphicsView/demo/Generator/Generator_2.cpp index bc97630644b9..0072354e66c3 100644 --- a/GraphicsView/demo/Generator/Generator_2.cpp +++ b/GraphicsView/demo/Generator/Generator_2.cpp @@ -271,7 +271,7 @@ void MainWindow::on_actionGeneratePolytopeInDisc_triggered() { boost::mt19937 gen; - gen.seed(time(0)); + gen.seed(time(nullptr)); std::vector points; QRectF rect = CGAL::Qt::viewportsBbox(&scene); CGAL::Qt::Converter convert; diff --git a/GraphicsView/demo/L1_Voronoi_diagram_2/L1_voronoi_diagram_2.cpp b/GraphicsView/demo/L1_Voronoi_diagram_2/L1_voronoi_diagram_2.cpp index 621a6f6c6c90..c240f8c62a3e 100644 --- a/GraphicsView/demo/L1_Voronoi_diagram_2/L1_voronoi_diagram_2.cpp +++ b/GraphicsView/demo/L1_Voronoi_diagram_2/L1_voronoi_diagram_2.cpp @@ -358,10 +358,10 @@ MainWindow::on_actionShowVoronoi_toggled(bool checked) void MainWindow::calculate_envelope() { - if (m_envelope_diagram != NULL) { - m_graphics_item->setArrangement(NULL); + if (m_envelope_diagram != nullptr) { + m_graphics_item->setArrangement(nullptr); delete m_envelope_diagram; - m_envelope_diagram = NULL; + m_envelope_diagram = nullptr; } m_envelope_diagram = new Envelope_diagram_2(); @@ -374,7 +374,7 @@ QRectF MainWindow::bounding_rect() { CGAL::Bbox_2 bbox(0, 0, 0, 0); - if (m_envelope_diagram != NULL) { + if (m_envelope_diagram != nullptr) { for (Envelope_diagram_2::Vertex_iterator it = m_envelope_diagram->vertices_begin(); it != m_envelope_diagram->vertices_end(); ++it) { diff --git a/GraphicsView/demo/L1_Voronoi_diagram_2/include/CGAL/Qt/ArrangementGraphicsItem.h b/GraphicsView/demo/L1_Voronoi_diagram_2/include/CGAL/Qt/ArrangementGraphicsItem.h index a1bf7999f394..92e719460c15 100644 --- a/GraphicsView/demo/L1_Voronoi_diagram_2/include/CGAL/Qt/ArrangementGraphicsItem.h +++ b/GraphicsView/demo/L1_Voronoi_diagram_2/include/CGAL/Qt/ArrangementGraphicsItem.h @@ -102,7 +102,7 @@ ArrangementGraphicsItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget* ) { - if (m_arr == NULL) + if (m_arr == nullptr) return; QRectF rect = option->exposedRect; diff --git a/GraphicsView/demo/L1_Voronoi_diagram_2/include/CGAL/Qt/SetGraphicsItem.h b/GraphicsView/demo/L1_Voronoi_diagram_2/include/CGAL/Qt/SetGraphicsItem.h index 2385e006744a..6da2939996bc 100644 --- a/GraphicsView/demo/L1_Voronoi_diagram_2/include/CGAL/Qt/SetGraphicsItem.h +++ b/GraphicsView/demo/L1_Voronoi_diagram_2/include/CGAL/Qt/SetGraphicsItem.h @@ -82,7 +82,7 @@ SetGraphicsItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget* ) { - if (m_set == NULL) + if (m_set == nullptr) return; QRectF rect = option->exposedRect; diff --git a/GraphicsView/demo/Periodic_2_triangulation_2/TriangulationConflictZone.h b/GraphicsView/demo/Periodic_2_triangulation_2/TriangulationConflictZone.h index 9a785e37a1fe..dc0a27b5c007 100644 --- a/GraphicsView/demo/Periodic_2_triangulation_2/TriangulationConflictZone.h +++ b/GraphicsView/demo/Periodic_2_triangulation_2/TriangulationConflictZone.h @@ -52,7 +52,7 @@ template TriangulationConflictZone::TriangulationConflictZone(QGraphicsScene* s, T * tr_, QObject* parent) - : GraphicsViewInput(parent), m_hint(NULL), m_tr(tr_), m_containing_face(Face_handle()), m_scene(s), m_triangle(NULL), m_animate(false) + : GraphicsViewInput(parent), m_hint(nullptr), m_tr(tr_), m_containing_face(Face_handle()), m_scene(s), m_triangle(nullptr), m_animate(false) { } @@ -65,7 +65,7 @@ TriangulationConflictZone::localize_and_insert_point(QPointF qt_point) double dy = m_tr->domain().ymax() - m_tr->domain().ymin(); p = Point(p.x()- std::floor(p.x()/dx), p.y()- std::floor(p.y()/dy)); - if (m_hint == NULL) { + if (m_hint == nullptr) { m_hint = m_tr->faces_begin(); } @@ -130,7 +130,7 @@ TriangulationConflictZone::mouseReleaseEvent(QGraphicsSceneMouseEvent *) } qfaces.clear(); m_animate = false; - m_hint = NULL; + m_hint = nullptr; } diff --git a/GraphicsView/demo/Periodic_2_triangulation_2/include/CGAL/Qt/PeriodicTriangulationGraphicsItem.h b/GraphicsView/demo/Periodic_2_triangulation_2/include/CGAL/Qt/PeriodicTriangulationGraphicsItem.h index 1a334d97dbb9..0b0517c8b5ab 100644 --- a/GraphicsView/demo/Periodic_2_triangulation_2/include/CGAL/Qt/PeriodicTriangulationGraphicsItem.h +++ b/GraphicsView/demo/Periodic_2_triangulation_2/include/CGAL/Qt/PeriodicTriangulationGraphicsItem.h @@ -150,7 +150,7 @@ namespace CGAL { template PeriodicTriangulationGraphicsItem::PeriodicTriangulationGraphicsItem(T * t_) - : t(t_), painterostream(0), + : t(t_), painterostream(nullptr), visible_edges(true), visible_vertices(true), type(NONE) { diff --git a/GraphicsView/demo/Polygon/Polygon_2.cpp b/GraphicsView/demo/Polygon/Polygon_2.cpp index e08c441f7d2a..98d66af08c57 100644 --- a/GraphicsView/demo/Polygon/Polygon_2.cpp +++ b/GraphicsView/demo/Polygon/Polygon_2.cpp @@ -125,7 +125,7 @@ MainWindow::MainWindow() this->graphicsView->setAcceptDrops(false); - minkgi = 0; + minkgi = nullptr; // Add a GraphicItem for the Polygon2 pgi = new CGAL::Qt::PolygonGraphicsItem(&poly); @@ -557,10 +557,10 @@ MainWindow::clearPartition() void MainWindow::clearMinkowski() { - if(minkgi != 0){ + if(minkgi != nullptr){ scene.removeItem(minkgi); delete minkgi; - minkgi = 0; + minkgi = nullptr; } } diff --git a/GraphicsView/demo/Triangulation_2/Constrained_Delaunay_triangulation_2.cpp b/GraphicsView/demo/Triangulation_2/Constrained_Delaunay_triangulation_2.cpp index 72cd6eb5c706..60dd77c388d1 100644 --- a/GraphicsView/demo/Triangulation_2/Constrained_Delaunay_triangulation_2.cpp +++ b/GraphicsView/demo/Triangulation_2/Constrained_Delaunay_triangulation_2.cpp @@ -124,7 +124,7 @@ discoverComponents(const CDT & ct, { typename CDT::Face_handle fh_loc = ct.locate(*sit); - if(fh_loc == NULL || !fh_loc->is_in_domain()) + if(fh_loc == nullptr || !fh_loc->is_in_domain()) continue; std::list queue; diff --git a/GraphicsView/demo/Triangulation_2/include/CGAL/Lipschitz_sizing_field_criteria_2.h b/GraphicsView/demo/Triangulation_2/include/CGAL/Lipschitz_sizing_field_criteria_2.h index 9cf5e9237218..ad844db31acb 100644 --- a/GraphicsView/demo/Triangulation_2/include/CGAL/Lipschitz_sizing_field_criteria_2.h +++ b/GraphicsView/demo/Triangulation_2/include/CGAL/Lipschitz_sizing_field_criteria_2.h @@ -33,7 +33,7 @@ class Lipschitz_sizing_field_criteria_2 typedef Delaunay_mesh_criteria_2 Base; Lipschitz_sizing_field_criteria_2(const double aspect_bound = 0.125, - Sizing_field* sf = 0, + Sizing_field* sf = nullptr, const Geom_traits& traits = Geom_traits()) : Base(aspect_bound), sizing_field(sf), traits(traits) {} diff --git a/GraphicsView/include/CGAL/Qt/DemosMainWindow.h b/GraphicsView/include/CGAL/Qt/DemosMainWindow.h index 34dab58fbfcc..8ea7d1e3f70c 100644 --- a/GraphicsView/include/CGAL/Qt/DemosMainWindow.h +++ b/GraphicsView/include/CGAL/Qt/DemosMainWindow.h @@ -72,16 +72,16 @@ public Q_SLOTS: QMenu* getHelpMenu(); protected: - DemosMainWindow (QWidget * parent = 0, ::Qt::WindowFlags flags = ::Qt::WindowType(0) ); + DemosMainWindow (QWidget * parent = nullptr, ::Qt::WindowFlags flags = ::Qt::WindowType(0) ); ~DemosMainWindow(); void setupStatusBar(); void addNavigation(QGraphicsView*); - void setupOptionsMenu(QMenu* menu = 0); - void addAboutCGAL(QMenu* menu = 0); - void addAboutDemo(QString htmlResourceName, QMenu* menu = 0); + void setupOptionsMenu(QMenu* menu = nullptr); + void addAboutCGAL(QMenu* menu = nullptr); + void addAboutDemo(QString htmlResourceName, QMenu* menu = nullptr); void setupExportSVG(QAction*, QGraphicsView*); - void addRecentFiles(QMenu* menu, QAction* insertBefore = 0); + void addRecentFiles(QMenu* menu, QAction* insertBefore = nullptr); void writeState(QString groupname = "MainWindow"); void readState(QString groupname = "MainWindow", diff --git a/GraphicsView/include/CGAL/Qt/qglviewer.h b/GraphicsView/include/CGAL/Qt/qglviewer.h index 34c88e274952..1c11c9e4a52b 100644 --- a/GraphicsView/include/CGAL/Qt/qglviewer.h +++ b/GraphicsView/include/CGAL/Qt/qglviewer.h @@ -72,11 +72,11 @@ class CGAL_QT_EXPORT QGLViewer : public QOpenGLWidget, public QOpenGLFunctions { public: //todo check if this is used. If not remove it - explicit QGLViewer(QGLContext* context, QWidget *parent = 0, + explicit QGLViewer(QGLContext* context, QWidget *parent = nullptr, ::Qt::WindowFlags flags = ::Qt::WindowType(0)); - explicit QGLViewer(QOpenGLContext* context, QWidget *parent = 0, + explicit QGLViewer(QOpenGLContext* context, QWidget *parent = nullptr, ::Qt::WindowFlags flags = ::Qt::WindowType(0)); - explicit QGLViewer(QWidget *parent = 0, + explicit QGLViewer(QWidget *parent = nullptr, ::Qt::WindowFlags flags = ::Qt::WindowType(0)); virtual ~QGLViewer(); diff --git a/Intersections_3/test/Intersections_3/segment_segment.cpp b/Intersections_3/test/Intersections_3/segment_segment.cpp index 510cfa5fed75..00135f943b8e 100644 --- a/Intersections_3/test/Intersections_3/segment_segment.cpp +++ b/Intersections_3/test/Intersections_3/segment_segment.cpp @@ -123,18 +123,18 @@ void _test_intersection_construct(K) objs[7] = CGAL::intersection(s[2],s[1].supporting_line()); //s[2] for (int k=0;k<5;++k){ const Point_3* p=CGAL::object_cast(&(objs[k])); - assert(p!=NULL); + assert(p!=nullptr); assert(*p==Point_3(0,0,0)); } const Segment_3* seg=CGAL::object_cast(&(objs[5])); - assert(seg!=NULL); + assert(seg!=nullptr); assert(*seg==s[1]); seg=CGAL::object_cast(&(objs[7])); assert(*seg==s[2]); seg=CGAL::object_cast(&(objs[6])); - assert(seg!=NULL); + assert(seg!=nullptr); assert(*seg==Segment_3( Point_3(0,0,0),Point_3(-1,0,0) ) || *seg==Segment_3( Point_3(-1,0,0),Point_3(0,0,0) )); diff --git a/Intersections_3/test/Intersections_3/triangle_3_triangle_3_intersection.cpp b/Intersections_3/test/Intersections_3/triangle_3_triangle_3_intersection.cpp index 9711dd234753..0098bcd01422 100644 --- a/Intersections_3/test/Intersections_3/triangle_3_triangle_3_intersection.cpp +++ b/Intersections_3/test/Intersections_3/triangle_3_triangle_3_intersection.cpp @@ -18,168 +18,168 @@ void test_coplanar_triangles(){ t1=Triangle( Point(0,0,0),Point(0,1,0),Point(1,0,0) ); t2=Triangle( Point(0,0,0),Point(0,1,0),Point(1,0,0) ); obj=CGAL::intersection(t1,t2); - assert(CGAL::object_cast(&obj)!=NULL); + assert(CGAL::object_cast(&obj)!=nullptr); //three vertices of t2 on edges of t1, two edges of t2 included into edges of t1 t1=Triangle( Point(0,0,0),Point(0,1,0),Point(1,0,0) ); t2=Triangle( Point(0,0,0),Point(0,2,0),Point(2,0,0) ); obj=CGAL::intersection( t1,t2 ); - assert(CGAL::object_cast(&obj)!=NULL); + assert(CGAL::object_cast(&obj)!=nullptr); obj=CGAL::intersection( t2,t1 ); - assert(CGAL::object_cast(&obj)!=NULL); + assert(CGAL::object_cast(&obj)!=nullptr); //two vertices of t2 on edges of t1 t1=Triangle( Point(0,0,0),Point(0,1,0),Point(1,0,0) ); t2=Triangle( Point(0.25,0.25,0),Point(0,0.25,0),Point(0.25,0,0) ); obj=CGAL::intersection(t1,t2); - assert(CGAL::object_cast(&obj)!=NULL); + assert(CGAL::object_cast(&obj)!=nullptr); obj=CGAL::intersection(t2,t1); - assert(CGAL::object_cast(&obj)!=NULL); + assert(CGAL::object_cast(&obj)!=nullptr); //three vertices of t2 on edges of t1 (no inclusion of edges) t1=Triangle( Point(0,0,0),Point(0,1,0),Point(1,0,0) ); t2=Triangle( Point(NT(1,2),NT(1,2),0),Point(0,0.25,0),Point(0.25,0,0) ); obj=CGAL::intersection(t1,t2); - assert(CGAL::object_cast(&obj)!=NULL); + assert(CGAL::object_cast(&obj)!=nullptr); obj=CGAL::intersection(t2,t1); - assert(CGAL::object_cast(&obj)!=NULL); + assert(CGAL::object_cast(&obj)!=nullptr); //t2 is in the interior of t1 t1=Triangle( Point(0,0,0),Point(0,1,0),Point(1,0,0) ); t2=Triangle( Point(0.25,0.25,0),Point(0.25,0.3,0),Point(0.3,0.25,0) ); obj=CGAL::intersection(t1,t2); - assert(CGAL::object_cast(&obj)!=NULL); + assert(CGAL::object_cast(&obj)!=nullptr); obj=CGAL::intersection(t2,t1); - assert(CGAL::object_cast(&obj)!=NULL); + assert(CGAL::object_cast(&obj)!=nullptr); //one edge is common t1=Triangle( Point(0,0,0),Point(0,1,0),Point(1,0,0) ); t2=Triangle( Point(0,0,0),Point(0,1,0),Point(0.1,0.1,0) ); obj=CGAL::intersection(t1,t2); - assert(CGAL::object_cast(&obj)!=NULL); + assert(CGAL::object_cast(&obj)!=nullptr); obj=CGAL::intersection(t2,t1); - assert(CGAL::object_cast(&obj)!=NULL); + assert(CGAL::object_cast(&obj)!=nullptr); //one edge of t2 included into an edge of t1, one common vertex t1=Triangle( Point(0,0,0),Point(0,1,0),Point(1,0,0) ); t2=Triangle( Point(0,0,0),Point(0,0.9,0),Point(0.1,0.1,0) ); obj=CGAL::intersection(t1,t2); - assert(CGAL::object_cast(&obj)!=NULL); + assert(CGAL::object_cast(&obj)!=nullptr); obj=CGAL::intersection(t2,t1); - assert(CGAL::object_cast(&obj)!=NULL); + assert(CGAL::object_cast(&obj)!=nullptr); //one edge of t2 included into an edge of t1, no common point t1=Triangle( Point(0,0,0),Point(0,1,0),Point(1,0,0) ); t2=Triangle( Point(0,0.1,0),Point(0,0.9,0),Point(0.1,0.1,0) ); obj=CGAL::intersection(t1,t2); - assert(CGAL::object_cast(&obj)!=NULL); + assert(CGAL::object_cast(&obj)!=nullptr); obj=CGAL::intersection(t2,t1); - assert(CGAL::object_cast(&obj)!=NULL); + assert(CGAL::object_cast(&obj)!=nullptr); //only one vertex of t2 included by t1 t1=Triangle( Point(0,0,0),Point(0,1,0),Point(1,0,0) ); t2=Triangle( Point(0,-1,0),Point(0.25,0.25,0),Point(1,-1,0) ); obj=CGAL::intersection(t1,t2); - assert(CGAL::object_cast(&obj)!=NULL); + assert(CGAL::object_cast(&obj)!=nullptr); obj=CGAL::intersection(t2,t1); - assert(CGAL::object_cast(&obj)!=NULL); + assert(CGAL::object_cast(&obj)!=nullptr); //only one vertex of t2 included by t1 and one vertex of t1 included in t2 t1=Triangle( Point(0,0,0),Point(0,1,0),Point(1,0,0) ); t2=Triangle( Point(0,-1,0),Point(0,0.25,0),Point(1,-1,0) ); obj=CGAL::intersection(t1,t2); - assert(CGAL::object_cast(&obj)!=NULL); + assert(CGAL::object_cast(&obj)!=nullptr); obj=CGAL::intersection(t2,t1); - assert(CGAL::object_cast(&obj)!=NULL); + assert(CGAL::object_cast(&obj)!=nullptr); //one vertex of t1 on edges of t2 t1=Triangle( Point(0,0,0),Point(0,1,0),Point(1,0,0) ); t2=Triangle( Point(-1,-1,0),Point(0.25,0.25,0),Point(0.25,-1,0) ); obj=CGAL::intersection(t1,t2); - assert(CGAL::object_cast(&obj)!=NULL); + assert(CGAL::object_cast(&obj)!=nullptr); obj=CGAL::intersection(t2,t1); - assert(CGAL::object_cast(&obj)!=NULL); + assert(CGAL::object_cast(&obj)!=nullptr); //two vertices of t1 on edges of t2 t1=Triangle( Point(0,0,0),Point(0.5,1,0),Point(1,0,0) ); t2=Triangle( Point(-1,-1,0),Point(0.5,0.5,0),Point(2,-1,0) ); obj=CGAL::intersection(t1,t2); - assert(CGAL::object_cast(&obj)!=NULL); + assert(CGAL::object_cast(&obj)!=nullptr); obj=CGAL::intersection(t2,t1); - assert(CGAL::object_cast(&obj)!=NULL); + assert(CGAL::object_cast(&obj)!=nullptr); //Intersection is a point //edges are collinear, one vertex in common t1=Triangle( Point(0,0,0),Point(0,1,0),Point(1,0,0) ); t2=Triangle( Point(0,0,0),Point(-0.25,0,0),Point(0,-0.25,0) ); obj=CGAL::intersection(t1,t2); - assert(CGAL::object_cast(&obj)!=NULL); + assert(CGAL::object_cast(&obj)!=nullptr); obj=CGAL::intersection(t2,t1); - assert(CGAL::object_cast(&obj)!=NULL); + assert(CGAL::object_cast(&obj)!=nullptr); //edges are non-collinear, one vertex in common t1=Triangle( Point(0,0,0),Point(0.1,1,0),Point(1,0.1,0) ); t2=Triangle( Point(0,0,0),Point(-0.25,0,0),Point(0,-0.25,0) ); obj=CGAL::intersection(t1,t2); - assert(CGAL::object_cast(&obj)!=NULL); + assert(CGAL::object_cast(&obj)!=nullptr); obj=CGAL::intersection(t2,t1); - assert(CGAL::object_cast(&obj)!=NULL); + assert(CGAL::object_cast(&obj)!=nullptr); //one vertex of a triangle on an edge of another t1=Triangle( Point(0,0,0),Point(0,1,0),Point(1,0,0) ); t2=Triangle( Point(0,0.1,0),Point(-0.25,0.1,0),Point(-0.25,-0.1,0) ); obj=CGAL::intersection(t1,t2); - assert(CGAL::object_cast(&obj)!=NULL); + assert(CGAL::object_cast(&obj)!=nullptr); obj=CGAL::intersection(t2,t1); - assert(CGAL::object_cast(&obj)!=NULL); + assert(CGAL::object_cast(&obj)!=nullptr); //Intersection is a segment //triangles have a common edge t1=Triangle( Point(0,0,0),Point(0,1,0),Point(1,0,0) ); t2=Triangle( Point(0,0,0),Point(0,1,0),Point(-1,0,0) ); obj=CGAL::intersection(t1,t2); - assert(CGAL::object_cast(&obj)!=NULL); + assert(CGAL::object_cast(&obj)!=nullptr); obj=CGAL::intersection(t2,t1); - assert(CGAL::object_cast(&obj)!=NULL); + assert(CGAL::object_cast(&obj)!=nullptr); //one triangle edge is included into an edge of the other triangle t1=Triangle( Point(0,0,0),Point(0,1,0),Point(1,0,0) ); t2=Triangle( Point(0,0.1,0),Point(0,0.9,0),Point(-1,0,0) ); obj=CGAL::intersection(t1,t2); - assert(CGAL::object_cast(&obj)!=NULL); + assert(CGAL::object_cast(&obj)!=nullptr); obj=CGAL::intersection(t2,t1); - assert(CGAL::object_cast(&obj)!=NULL); + assert(CGAL::object_cast(&obj)!=nullptr); //one triangle edge is included into an edge of the other triangle + share a vertex t1=Triangle( Point(0,0,0),Point(0,1,0),Point(1,0,0) ); t2=Triangle( Point(0,0,0),Point(0,0.9,0),Point(-1,0,0) ); obj=CGAL::intersection(t1,t2); - assert(CGAL::object_cast(&obj)!=NULL); + assert(CGAL::object_cast(&obj)!=nullptr); obj=CGAL::intersection(t2,t1); - assert(CGAL::object_cast(&obj)!=NULL); + assert(CGAL::object_cast(&obj)!=nullptr); //exactly one vertex of each triangle contributes t1=Triangle( Point(0,0,0),Point(0,1,0),Point(1,0,0) ); t2=Triangle( Point(0,-0.1,0),Point(0,0.9,0),Point(-1,0,0) ); obj=CGAL::intersection(t1,t2); - assert(CGAL::object_cast(&obj)!=NULL); + assert(CGAL::object_cast(&obj)!=nullptr); obj=CGAL::intersection(t2,t1); - assert(CGAL::object_cast(&obj)!=NULL); + assert(CGAL::object_cast(&obj)!=nullptr); t1=Triangle( Point(-10,0,0),Point(10,0,0),Point(0,-3,0) ); t2=Triangle( Point(-8,0,0),Point(12,0,0),Point(1,5,0) ); obj=CGAL::intersection(t1,t2); - assert(CGAL::object_cast(&obj)!=NULL); + assert(CGAL::object_cast(&obj)!=nullptr); obj=CGAL::intersection(t2,t1); - assert(CGAL::object_cast(&obj)!=NULL); + assert(CGAL::object_cast(&obj)!=nullptr); //Intersection is a polygon //David's star t1=Triangle( Point(0,0,0),Point(1,0,0),Point(0.5,1.5,0) ); t2=Triangle( Point(0,1,0),Point(1,1,0),Point(0.5,-0.5,0) ); obj=CGAL::intersection(t1,t2); - assert(CGAL::object_cast(&obj)!=NULL); + assert(CGAL::object_cast(&obj)!=nullptr); assert(CGAL::object_cast(&obj)->size()==6); obj=CGAL::intersection(t2,t1); - assert(CGAL::object_cast(&obj)!=NULL); + assert(CGAL::object_cast(&obj)!=nullptr); assert(CGAL::object_cast(&obj)->size()==6); //intersection of two triangle corners t1=Triangle( Point(0,0,0),Point(1,0,0),Point(0.5,1,0) ); t2=Triangle( Point(0,1,0),Point(1,1,0),Point(0.5,0,0) ); obj=CGAL::intersection(t1,t2); - assert(CGAL::object_cast(&obj)!=NULL); + assert(CGAL::object_cast(&obj)!=nullptr); assert(CGAL::object_cast(&obj)->size()==4); obj=CGAL::intersection(t2,t1); - assert(CGAL::object_cast(&obj)!=NULL); + assert(CGAL::object_cast(&obj)!=nullptr); assert(CGAL::object_cast(&obj)->size()==4); //t2 pierces two edges of t1 t1=Triangle( Point(0,0,0),Point(1,0,0),Point(0,1,0) ); t2=Triangle( Point(-0.1,0.1,0),Point(-0.1,0.2,0),Point(0.5,0.8,0) ); obj=CGAL::intersection(t1,t2); - assert(CGAL::object_cast(&obj)!=NULL); + assert(CGAL::object_cast(&obj)!=nullptr); assert(CGAL::object_cast(&obj)->size()==4); obj=CGAL::intersection(t2,t1); - assert(CGAL::object_cast(&obj)!=NULL); + assert(CGAL::object_cast(&obj)!=nullptr); assert(CGAL::object_cast(&obj)->size()==4); //Intersection is empty t1=Triangle( Point(0,0,0),Point(0,1,0),Point(1,0,0) ); @@ -200,59 +200,59 @@ void test_non_coplanar_triangles() t1=Triangle( Point(0,0,0),Point(0,1,0),Point(1,0,0) ); t2=Triangle( Point(0.1,0.1,1),Point(0.2,0.1,1),Point(0.25,0.25,-1) ); obj=CGAL::intersection(t1,t2); - assert(CGAL::object_cast(&obj)!=NULL); + assert(CGAL::object_cast(&obj)!=nullptr); obj=CGAL::intersection(t2,t1); - assert(CGAL::object_cast(&obj)!=NULL); + assert(CGAL::object_cast(&obj)!=nullptr); //common edge t1=Triangle( Point(0,0,0),Point(1,0,0),Point(0,1,0) ); t2=Triangle( Point(0,0,0),Point(1,0,0),Point(0,0,1) ); obj=CGAL::intersection(t1,t2); - assert(CGAL::object_cast(&obj)!=NULL); + assert(CGAL::object_cast(&obj)!=nullptr); obj=CGAL::intersection(t2,t1); - assert(CGAL::object_cast(&obj)!=NULL); + assert(CGAL::object_cast(&obj)!=nullptr); //inclusion into an edge t1=Triangle( Point(0,0,0),Point(1,0,0),Point(0,1,0) ); t2=Triangle( Point(0.1,0,0),Point(0.9,0,0),Point(0,0,1) ); obj=CGAL::intersection(t1,t2); - assert(CGAL::object_cast(&obj)!=NULL); + assert(CGAL::object_cast(&obj)!=nullptr); obj=CGAL::intersection(t2,t1); - assert(CGAL::object_cast(&obj)!=NULL); + assert(CGAL::object_cast(&obj)!=nullptr); //inclusion into an edge, on common vertex t1=Triangle( Point(0,0,0),Point(1,0,0),Point(0,1,0) ); t2=Triangle( Point(0,0,0),Point(0.9,0,0),Point(0,0,1) ); obj=CGAL::intersection(t1,t2); - assert(CGAL::object_cast(&obj)!=NULL); + assert(CGAL::object_cast(&obj)!=nullptr); obj=CGAL::intersection(t2,t1); - assert(CGAL::object_cast(&obj)!=NULL); + assert(CGAL::object_cast(&obj)!=nullptr); //one vertex from each triangle t1=Triangle( Point(0,0,0),Point(1,0,0),Point(0,1,0) ); t2=Triangle( Point(-0.1,0,0),Point(0.9,0,0),Point(0,0,1) ); obj=CGAL::intersection(t1,t2); - assert(CGAL::object_cast(&obj)!=NULL); + assert(CGAL::object_cast(&obj)!=nullptr); obj=CGAL::intersection(t2,t1); - assert(CGAL::object_cast(&obj)!=NULL); + assert(CGAL::object_cast(&obj)!=nullptr); //Intersection is a point //common vertex t1=Triangle( Point(0,0,0),Point(1,0,0),Point(0,1,0) ); t2=Triangle( Point(0,0,0),Point(0.9,0,1),Point(0,0,1) ); obj=CGAL::intersection(t1,t2); - assert(CGAL::object_cast(&obj)!=NULL); + assert(CGAL::object_cast(&obj)!=nullptr); obj=CGAL::intersection(t2,t1); - assert(CGAL::object_cast(&obj)!=NULL); + assert(CGAL::object_cast(&obj)!=nullptr); //vertex in edge t1=Triangle( Point(0,0,0),Point(1,0,0),Point(0,1,0) ); t2=Triangle( Point(0.1,0,0),Point(0.9,0,1),Point(0,0,1) ); obj=CGAL::intersection(t1,t2); - assert(CGAL::object_cast(&obj)!=NULL); + assert(CGAL::object_cast(&obj)!=nullptr); obj=CGAL::intersection(t2,t1); - assert(CGAL::object_cast(&obj)!=NULL); + assert(CGAL::object_cast(&obj)!=nullptr); //vertex in interior t1=Triangle( Point(0,0,0),Point(1,0,0),Point(0,1,0) ); t2=Triangle( Point(0.1,0.1,0),Point(0.9,0,1),Point(0,0,1) ); obj=CGAL::intersection(t1,t2); - assert(CGAL::object_cast(&obj)!=NULL); + assert(CGAL::object_cast(&obj)!=nullptr); obj=CGAL::intersection(t2,t1); - assert(CGAL::object_cast(&obj)!=NULL); + assert(CGAL::object_cast(&obj)!=nullptr); //Intersection is empty //triangle in parallel plane t1=Triangle( Point(0,0,0),Point(1,0,0),Point(0,1,0) ); diff --git a/Intersections_3/test/Intersections_3/triangle_other_intersection_test.cpp b/Intersections_3/test/Intersections_3/triangle_other_intersection_test.cpp index 80e8069839b5..f93aabdf95a0 100644 --- a/Intersections_3/test/Intersections_3/triangle_other_intersection_test.cpp +++ b/Intersections_3/test/Intersections_3/triangle_other_intersection_test.cpp @@ -47,8 +47,8 @@ struct Checker if ( ! result.empty() ) { - assert( NULL != CGAL::object_cast(&result) - || NULL != CGAL::object_cast(&result)); + assert( nullptr != CGAL::object_cast(&result) + || nullptr != CGAL::object_cast(&result)); } } }; @@ -66,8 +66,8 @@ struct Checker if ( ! result.empty() ) { assert( CGAL::do_intersect(q, t) ); - assert( NULL != CGAL::object_cast(&result) - || NULL != CGAL::object_cast(&result)); + assert( nullptr != CGAL::object_cast(&result) + || nullptr != CGAL::object_cast(&result)); } } @@ -79,8 +79,8 @@ struct Checker { // Here we can't check do_intersect, because there are constructions when // building points on line - assert( NULL != CGAL::object_cast(&result) - || NULL != CGAL::object_cast(&result)); + assert( nullptr != CGAL::object_cast(&result) + || nullptr != CGAL::object_cast(&result)); } } }; @@ -106,8 +106,8 @@ struct Checker const Point_3* p = CGAL::object_cast(&result); const Segment_3* s = CGAL::object_cast(&result); - assert( (NULL!=p && t.has_on(*p) && q.has_on(*p)) - || (NULL!=s && t.has_on(s->source()) && t.has_on(s->target()) + assert( (nullptr!=p && t.has_on(*p) && q.has_on(*p)) + || (nullptr!=s && t.has_on(s->source()) && t.has_on(s->target()) && q.has_on(s->source()) && q.has_on(s->target())) ); } else @@ -217,7 +217,7 @@ bool test_aux(bool is_kernel_exact, CGAL::Object object = CGAL::intersection(t,q); const Result* pr = CGAL::object_cast(&object); - if ( (NULL != pr) && + if ( (nullptr != pr) && (is_kernel_exact ? (expected == *pr) : CGAL::to_double(CGAL::squared_distance(expected, *pr)) < sq_espilon ) ) @@ -229,7 +229,7 @@ bool test_aux(bool is_kernel_exact, std::cout << "ERROR: intersection(" << name << ") did not answer the expected result !"; - if ( NULL != pr ) + if ( nullptr != pr ) std::cout << " (answer: ["<< *pr << "])"; std::cout << std::endl; @@ -627,7 +627,7 @@ int main() // ----------------------------------- // Test random intersection // ----------------------------------- - srand( static_cast(time(NULL)) ); + srand( static_cast(time(nullptr)) ); std::cout << std::endl << "Test random intersections" << std::endl; std::cout << "\tTesting with Simple_cartesian..." << std::endl ; random_test(); diff --git a/Kernel_23/test/Kernel_23/include/CGAL/_test_cls_object.h b/Kernel_23/test/Kernel_23/include/CGAL/_test_cls_object.h index aa561c640548..a9c987a07a1b 100644 --- a/Kernel_23/test/Kernel_23/include/CGAL/_test_cls_object.h +++ b/Kernel_23/test/Kernel_23/include/CGAL/_test_cls_object.h @@ -114,12 +114,12 @@ _test_cls_object(const R&) // Test object_cast<>(). const int *i = CGAL::object_cast(&o6); - assert( i != NULL ); + assert( i != nullptr ); int j = CGAL::object_cast(o6); use(j); const double *d = CGAL::object_cast(&o6); - assert( d == NULL ); + assert( d == nullptr ); try { // This case must throw. double k = CGAL::object_cast(o6); diff --git a/Linear_cell_complex/demo/Linear_cell_complex/MainWindow.cpp b/Linear_cell_complex/demo/Linear_cell_complex/MainWindow.cpp index ba574f83f276..a7107bfb3abf 100644 --- a/Linear_cell_complex/demo/Linear_cell_complex/MainWindow.cpp +++ b/Linear_cell_complex/demo/Linear_cell_complex/MainWindow.cpp @@ -1047,7 +1047,7 @@ void MainWindow::on_actionMerge_coplanar_faces_triggered() if ( scene.lcc->beta<0, 2>(*it)==*it || scene.lcc->beta<1, 2>(*it)==*it) { // To process dangling edges - Dart_handle actu = *it, prev=NULL; + Dart_handle actu = *it, prev=nullptr; do { if ( scene.lcc->beta<0, 2>(actu)==actu ) prev = scene.lcc->beta<1>(actu); @@ -1060,9 +1060,9 @@ void MainWindow::on_actionMerge_coplanar_faces_triggered() actu = prev; } else - actu = NULL; + actu = nullptr; } - while (actu!=NULL && (scene.lcc->beta<0, 2>(actu)==actu || scene.lcc->beta<1, 2>(actu)==actu)); + while (actu!=nullptr && (scene.lcc->beta<0, 2>(actu)==actu || scene.lcc->beta<1, 2>(actu)==actu)); } else if ( !CGAL::belong_to_same_cell(*scene.lcc, *it, scene.lcc->beta<2>(*it)) ) @@ -1175,11 +1175,11 @@ void constrained_delaunay_triangulation(LCC &lcc, Dart_handle d1) { vh = cdt.insert(lcc.point(it)); vh->info().dh=it; - if( first==NULL ) + if( first==nullptr ) { first=vh; } - if( previous!=NULL) + if( previous!=nullptr) { CGAL_assertion( previous !=vh ); cdt.insert_constraint(previous,vh); @@ -1202,7 +1202,7 @@ void constrained_delaunay_triangulation(LCC &lcc, Dart_handle d1) } std::queue face_queue; - CDT::Face_handle face_internal = NULL; + CDT::Face_handle face_internal = nullptr; face_queue.push(cdt.infinite_vertex()->face()); while(! face_queue.empty() ) @@ -1218,14 +1218,14 @@ void constrained_delaunay_triangulation(LCC &lcc, Dart_handle d1) { face_queue.push(fh->neighbor(i)); } - else if (face_internal==NULL) + else if (face_internal==nullptr) { face_internal = fh->neighbor(i); } } } } - if ( face_internal!=NULL ) + if ( face_internal!=nullptr ) face_queue.push(face_internal); while(! face_queue.empty() ) @@ -1285,17 +1285,17 @@ void constrained_delaunay_triangulation(LCC &lcc, Dart_handle d1) const CDT::Vertex_handle vb = fh->vertex(cdt.ccw(index)); const CDT::Vertex_handle vc = fh->vertex(index); - Dart_handle dd1 = NULL; + Dart_handle dd1 = nullptr; for (LCC::Dart_of_cell_range<0, 2>::iterator it(lcc.darts_of_cell<0, 2>(va->info().dh).begin()); - dd1==NULL && it.cont(); ++it) + dd1==nullptr && it.cont(); ++it) { if (lcc.point(lcc.beta<1>(it))==vc->point()) dd1=it; } - Dart_handle dd2 = NULL; + Dart_handle dd2 = nullptr; for (LCC::Dart_of_cell_range<0, 2>::iterator it(lcc.darts_of_cell<0, 2>(vb->info().dh).begin()); - dd2==NULL && it.cont(); ++it) + dd2==nullptr && it.cont(); ++it) { if (lcc.point(lcc.beta<0>(it))==vc->point()) dd2=it; diff --git a/Linear_cell_complex/demo/Linear_cell_complex/MainWindow.h b/Linear_cell_complex/demo/Linear_cell_complex/MainWindow.h index a0daa132cf9d..1f0b4716c1b2 100644 --- a/Linear_cell_complex/demo/Linear_cell_complex/MainWindow.h +++ b/Linear_cell_complex/demo/Linear_cell_complex/MainWindow.h @@ -98,7 +98,7 @@ class MainWindow : public CGAL::Qt::DemosMainWindow, private Ui::MainWindow Q_OBJECT public: - MainWindow(QWidget* parent = 0); + MainWindow(QWidget* parent = nullptr); public Q_SLOTS: // File menu diff --git a/Linear_cell_complex/demo/Linear_cell_complex/import_moka.h b/Linear_cell_complex/demo/Linear_cell_complex/import_moka.h index b375423d4fb0..b9beb9818171 100644 --- a/Linear_cell_complex/demo/Linear_cell_complex/import_moka.h +++ b/Linear_cell_complex/demo/Linear_cell_complex/import_moka.h @@ -20,7 +20,7 @@ struct GDart Dart_handle dh; LCC::Vertex_attribute_handle vh; - GDart() : dh(NULL), vh(NULL) + GDart() : dh(nullptr), vh(nullptr) {} GDart(const GDart& adart) : dh(adart.dh), @@ -97,9 +97,9 @@ bool import_from_moka(LCC& lcc, const char* filename) std::stack totreat; for (unsigned int startingdart = 0; startingdart(gdarts[i].dh) == NULL ) + if ( lcc.template attribute<3>(gdarts[i].dh) == nullptr ) { lcc.template set_attribute<3>(gdarts[i].dh, lcc.template create_attribute<3>()); } } - if (gdarts[i].vh!=NULL) + if (gdarts[i].vh!=nullptr) { lcc.set_vertex_attribute(gdarts[i].dh, gdarts[i].vh); } diff --git a/Minkowski_sum_2/test/Minkowski_sum_2/test_approx_offset.cpp b/Minkowski_sum_2/test/Minkowski_sum_2/test_approx_offset.cpp index 81d17851fa52..e478f2c0ae06 100644 --- a/Minkowski_sum_2/test/Minkowski_sum_2/test_approx_offset.cpp +++ b/Minkowski_sum_2/test/Minkowski_sum_2/test_approx_offset.cpp @@ -71,10 +71,10 @@ int main (int argc, char* argv[]) bool use_greene = true; if (((i+2) < argc) && (argv[i+2][0] == '-')) { - use_ssab = (std::strchr (argv[i+2], 's') != NULL); - use_opt = (std::strchr (argv[i+2], 'o') != NULL); - use_hm = (std::strchr (argv[i+2], 'h') != NULL); - use_greene = (std::strchr (argv[i+2], 'g') != NULL); + use_ssab = (std::strchr (argv[i+2], 's') != nullptr); + use_opt = (std::strchr (argv[i+2], 'o') != nullptr); + use_hm = (std::strchr (argv[i+2], 'h') != nullptr); + use_greene = (std::strchr (argv[i+2], 'g') != nullptr); } // Compute the Minkowski sum using the convolution method. diff --git a/Minkowski_sum_2/test/Minkowski_sum_2/test_exact_offset.cpp b/Minkowski_sum_2/test/Minkowski_sum_2/test_exact_offset.cpp index 27c2b7d7e598..d975690b634f 100644 --- a/Minkowski_sum_2/test/Minkowski_sum_2/test_exact_offset.cpp +++ b/Minkowski_sum_2/test/Minkowski_sum_2/test_exact_offset.cpp @@ -106,10 +106,10 @@ int main (int argc, char **argv) if (i+2 < argc && argv[i+2][0] == '-') { - use_ssab = (strchr (argv[i+2], 's') != NULL); - use_opt = (strchr (argv[i+2], 'o') != NULL); - use_hm = (strchr (argv[i+2], 'h') != NULL); - use_greene = (strchr (argv[i+2], 'g') != NULL); + use_ssab = (strchr (argv[i+2], 's') != nullptr); + use_opt = (strchr (argv[i+2], 'o') != nullptr); + use_hm = (strchr (argv[i+2], 'h') != nullptr); + use_greene = (strchr (argv[i+2], 'g') != nullptr); } // Compute the Minkowski sum using the convolution method. diff --git a/Nef_S2/examples/Nef_S2/include/CGAL/Nef_S2/create_random_Nef_S2.h b/Nef_S2/examples/Nef_S2/include/CGAL/Nef_S2/create_random_Nef_S2.h index ae499f28bfbc..4dcfe9d023f1 100644 --- a/Nef_S2/examples/Nef_S2/include/CGAL/Nef_S2/create_random_Nef_S2.h +++ b/Nef_S2/examples/Nef_S2/include/CGAL/Nef_S2/create_random_Nef_S2.h @@ -21,7 +21,7 @@ create_random_Nef_S2(Nef_polyhedron_S2& P, int n=5, int seed=0) { typedef CGAL::Random_points_in_cube_3 Point_source; if(seed == 0) - std::srand(static_cast(time(0))); + std::srand(static_cast(time(nullptr))); else std::srand(seed); diff --git a/Number_types/test/Number_types/root_of_2.cpp b/Number_types/test/Number_types/root_of_2.cpp index 9fbee914abeb..d5a9cac4fde7 100644 --- a/Number_types/test/Number_types/root_of_2.cpp +++ b/Number_types/test/Number_types/root_of_2.cpp @@ -136,7 +136,7 @@ CGAL::Sqrt_extension create_root_helper(RT a, RT b, CGAL::Sqrt_ex template < class Root, class RT > Root create_root(RT a, RT b) { - return create_root_helper(a, b, (Root*) 0); + return create_root_helper(a, b, (Root*) nullptr); } // Generate random Root_of_2 of degree 1 diff --git a/Optimal_transportation_reconstruction_2/demo/Optimal_transportation_reconstruction_2/Otr2_kerneled.h b/Optimal_transportation_reconstruction_2/demo/Optimal_transportation_reconstruction_2/Otr2_kerneled.h index bf6027014c13..280bd117773f 100644 --- a/Optimal_transportation_reconstruction_2/demo/Optimal_transportation_reconstruction_2/Otr2_kerneled.h +++ b/Optimal_transportation_reconstruction_2/demo/Optimal_transportation_reconstruction_2/Otr2_kerneled.h @@ -41,7 +41,7 @@ class Optimal_transportation_reconstruction_kerneled_2: Point_property_map point_pmap, Mass_property_map mass_pmap) : Otr_2(input_range, point_pmap, mass_pmap), - viewer(NULL){ + viewer(nullptr){ } Optimal_transportation_reconstruction_kerneled_2() : diff --git a/Optimal_transportation_reconstruction_2/demo/Optimal_transportation_reconstruction_2/dialog_options.h b/Optimal_transportation_reconstruction_2/demo/Optimal_transportation_reconstruction_2/dialog_options.h index fa58dac03e9a..8df3c2c86056 100644 --- a/Optimal_transportation_reconstruction_2/demo/Optimal_transportation_reconstruction_2/dialog_options.h +++ b/Optimal_transportation_reconstruction_2/demo/Optimal_transportation_reconstruction_2/dialog_options.h @@ -22,7 +22,7 @@ public Q_SLOTS: } public: - Dialog_options(QWidget * = 0) + Dialog_options(QWidget * = nullptr) { setupUi(this); } diff --git a/Optimal_transportation_reconstruction_2/demo/Optimal_transportation_reconstruction_2/glviewer.cpp b/Optimal_transportation_reconstruction_2/demo/Optimal_transportation_reconstruction_2/glviewer.cpp index b459255eb2c0..5418bbde6fd6 100644 --- a/Optimal_transportation_reconstruction_2/demo/Optimal_transportation_reconstruction_2/glviewer.cpp +++ b/Optimal_transportation_reconstruction_2/demo/Optimal_transportation_reconstruction_2/glviewer.cpp @@ -7,7 +7,7 @@ GlViewer::GlViewer(QWidget *pParent) : QOpenGLWidget(pParent) { - m_scene = NULL; + m_scene = nullptr; m_view_points = true; m_view_tolerance = false; diff --git a/Optimal_transportation_reconstruction_2/demo/Optimal_transportation_reconstruction_2/scene.h b/Optimal_transportation_reconstruction_2/demo/Optimal_transportation_reconstruction_2/scene.h index 6e804dc87a30..e590f0f04892 100644 --- a/Optimal_transportation_reconstruction_2/demo/Optimal_transportation_reconstruction_2/scene.h +++ b/Optimal_transportation_reconstruction_2/demo/Optimal_transportation_reconstruction_2/scene.h @@ -628,7 +628,7 @@ class Scene { const float point_size, const float vertex_size, const float line_thickness, GlViewer* viewer) { - if (m_pwsrec == NULL) { + if (m_pwsrec == nullptr) { return; } if(!is_viewer_set) diff --git a/Optimal_transportation_reconstruction_2/demo/Optimal_transportation_reconstruction_2/window.h b/Optimal_transportation_reconstruction_2/demo/Optimal_transportation_reconstruction_2/window.h index c055849f8b59..5db9a7cbdd24 100644 --- a/Optimal_transportation_reconstruction_2/demo/Optimal_transportation_reconstruction_2/window.h +++ b/Optimal_transportation_reconstruction_2/demo/Optimal_transportation_reconstruction_2/window.h @@ -50,7 +50,7 @@ class MainWindow : public QMainWindow, public Ui_MainWindow void openRecentFile_aux(); void updateRecentFileActions(); void addToRecentFiles(QString fileName); - void addRecentFiles(QMenu* menu, QAction* insertBefore = 0); + void addRecentFiles(QMenu* menu, QAction* insertBefore = nullptr); unsigned int maxNumberOfRecentFiles() const {return maxNumRecentFiles;} // io diff --git a/Periodic_3_triangulation_3/test/Periodic_3_triangulation_3/include/CGAL/_test_cls_periodic_3_circulator.h b/Periodic_3_triangulation_3/test/Periodic_3_triangulation_3/include/CGAL/_test_cls_periodic_3_circulator.h index 681cac50f811..a4ec39742119 100644 --- a/Periodic_3_triangulation_3/test/Periodic_3_triangulation_3/include/CGAL/_test_cls_periodic_3_circulator.h +++ b/Periodic_3_triangulation_3/test/Periodic_3_triangulation_3/include/CGAL/_test_cls_periodic_3_circulator.h @@ -128,7 +128,7 @@ _test_circulator( const Triangulation &T ) } Facet_circulator fc, fc0, fc1; - assert(fc1 == 0); + assert(fc1 == nullptr); int i,j; // for (eit=T.edges_begin(); eit!=T.edges_end(); eit++) eit=T.edges_begin(); // test (edge) diff --git a/Polygon/test/Polygon/PolygonTest.cpp b/Polygon/test/Polygon/PolygonTest.cpp index 1e589f9ad424..77fd6058eeda 100644 --- a/Polygon/test/Polygon/PolygonTest.cpp +++ b/Polygon/test/Polygon/PolygonTest.cpp @@ -99,7 +99,7 @@ void test_iterators(ListPolygon& p, const ListPolygon& q) is_input_iterator(ic1); VC vstart(v); - if (v != 0) + if (v != nullptr) do { cout << *v << endl; ++v; @@ -113,7 +113,7 @@ void test_iterators(ListPolygon& p, const ListPolygon& q) is_input_iterator(ic2); EC estart(e); - if (e != 0) + if (e != nullptr) do { cout << *e << endl; ++e; @@ -132,7 +132,7 @@ void test_iterators(ListPolygon& p, const ListPolygon& q) is_input_iterator(ic3); VCC vstart(v); - if (v != 0) + if (v != nullptr) do { cout << *v << endl; ++v; @@ -146,7 +146,7 @@ void test_iterators(ListPolygon& p, const ListPolygon& q) is_input_iterator(ic4); EC estart(e); - if (e != 0) + if (e != nullptr) do { cout << *e << endl; ++e; diff --git a/Polygon_mesh_processing/test/Polygon_mesh_processing/remeshing_test.cpp b/Polygon_mesh_processing/test/Polygon_mesh_processing/remeshing_test.cpp index 071ee35eb0b6..db677c72e733 100644 --- a/Polygon_mesh_processing/test/Polygon_mesh_processing/remeshing_test.cpp +++ b/Polygon_mesh_processing/test/Polygon_mesh_processing/remeshing_test.cpp @@ -135,14 +135,14 @@ struct Constraints_pmap friend value_type get(const Constraints_pmap& map, const key_type& e) { - CGAL_assertion(map.set_ptr_ != NULL); + CGAL_assertion(map.set_ptr_ != nullptr); return !map.set_ptr_->empty() && map.set_ptr_->count(e); } friend void put(Constraints_pmap& map , const key_type& e, const value_type is) { - CGAL_assertion(map.set_ptr_ != NULL); + CGAL_assertion(map.set_ptr_ != nullptr); if (is) map.set_ptr_->insert(e); else if(get(map, e)) map.set_ptr_->erase(e); } @@ -171,7 +171,7 @@ Main(int argc, char* argv[]) unsigned int nb_iter = (argc > 3) ? atoi(argv[3]) : 2; const char* selection_file = (argc > 4) ? argv[4] : "data/joint-patch.selection.txt"; - const char* save_file = (argc > 5) ? argv[5] : NULL; + const char* save_file = (argc > 5) ? argv[5] : nullptr; std::set pre_patch; collect_patch(selection_file, m, pre_patch); @@ -240,7 +240,7 @@ Main(int argc, char* argv[]) t.stop(); std::cout << "Remeshing all took " << t.time() << std::endl; - if (save_file != NULL) + if (save_file != nullptr) { std::ofstream out("remeshed.off"); out << m; diff --git a/Polygon_mesh_processing/test/Polygon_mesh_processing/test_corefinement_and_constraints.cpp b/Polygon_mesh_processing/test/Polygon_mesh_processing/test_corefinement_and_constraints.cpp index 720ed7d94f9a..37a133dd44ed 100644 --- a/Polygon_mesh_processing/test/Polygon_mesh_processing/test_corefinement_and_constraints.cpp +++ b/Polygon_mesh_processing/test/Polygon_mesh_processing/test_corefinement_and_constraints.cpp @@ -165,7 +165,7 @@ void test_bool_op_no_copy( assert( count_constrained_edges(tm2, ecm2)==307 ); typedef boost::optional OTM; - Triangle_mesh *ptr = NULL; + Triangle_mesh *ptr = nullptr; const std::array output = reverse ? CGAL::make_array(OTM(&tm2), OTM(&tm1), boost::make_optional(false,ptr), boost::make_optional(false,ptr)) : CGAL::make_array(OTM(&tm1), OTM(&tm2), boost::make_optional(false,ptr), boost::make_optional(false,ptr)); diff --git a/Polygon_mesh_processing/test/Polygon_mesh_processing/test_pmp_distance.cpp b/Polygon_mesh_processing/test/Polygon_mesh_processing/test_pmp_distance.cpp index e88bfe425e9b..7a908e33b8cb 100644 --- a/Polygon_mesh_processing/test/Polygon_mesh_processing/test_pmp_distance.cpp +++ b/Polygon_mesh_processing/test/Polygon_mesh_processing/test_pmp_distance.cpp @@ -169,10 +169,10 @@ struct Custom_traits_Hausdorff Construct_cartesian_const_iterator_3(){} Construct_cartesian_const_iterator_3(const Point_3&){} const FT* operator()(const Point_3&) const - { return 0; } + { return nullptr; } const FT* operator()(const Point_3&, int) const - { return 0; } + { return nullptr; } typedef const FT* result_type; }; // } end of requirements from SearchGeomTraits_3 diff --git a/Polyhedron/demo/Polyhedron/Edge_container.cpp b/Polyhedron/demo/Polyhedron/Edge_container.cpp index 61078bf2e366..09a2b47d2589 100644 --- a/Polyhedron/demo/Polyhedron/Edge_container.cpp +++ b/Polyhedron/demo/Polyhedron/Edge_container.cpp @@ -25,7 +25,7 @@ Edge_container::Edge_container(int program, bool indexed) :Primitive_container(program, indexed), d(new Edge_d()) { - std::vector vbos(NbOfVbos, NULL); + std::vector vbos(NbOfVbos, nullptr); setVbos(vbos); } @@ -144,7 +144,7 @@ void Edge_container::draw(Viewer_interface *viewer, getVao(viewer)->program->setUniformValue("f_matrix", getFrameMatrix()); getVbo(Indices)->bind(); viewer->glDrawElements(GL_LINES, static_cast(getIdxSize()), - GL_UNSIGNED_INT, 0); + GL_UNSIGNED_INT, nullptr); getVbo(Indices)->release(); getVao(viewer)->release(); } diff --git a/Polyhedron/demo/Polyhedron/MainWindow.cpp b/Polyhedron/demo/Polyhedron/MainWindow.cpp index 8fb6f0a81a0c..2c841582f4bb 100644 --- a/Polyhedron/demo/Polyhedron/MainWindow.cpp +++ b/Polyhedron/demo/Polyhedron/MainWindow.cpp @@ -153,7 +153,7 @@ MainWindow::MainWindow(const QStringList &keywords, bool verbose, QWidget* paren ui = new Ui::MainWindow; ui->setupUi(this); menuBar()->setNativeMenuBar(false); - searchAction = new QWidgetAction(0); + searchAction = new QWidgetAction(nullptr); CGAL::Three::Three::s_mainwindow = this; menu_map[ui->menuOperations->title()] = ui->menuOperations; this->verbose = verbose; @@ -393,7 +393,7 @@ MainWindow::MainWindow(const QStringList &keywords, bool verbose, QWidget* paren QMenu* menuFile = findChild("menuFile"); insertActionBeforeLoadPlugin(menuFile, actionAddToGroup); - statistics_dlg = NULL; + statistics_dlg = nullptr; statistics_ui = new Ui::Statistics_on_item_dialog(); actionResetDefaultLoaders = new QAction("Reset Default Loaders",this); @@ -896,14 +896,14 @@ void MainWindow::addAction(QAction* action) void MainWindow::addAction(QString actionName, QString actionText, QString menuName) { - QMenu* menu = 0; + QMenu* menu = nullptr; Q_FOREACH(QAction* action, findChildren()) { if(!action->menu()) continue; QString menuText = action->menu()->title(); if(menuText != menuName) continue; menu = action->menu(); } - if(menu == 0) { + if(menu == nullptr) { menu = new QMenu(menuName, this); menuBar()->insertMenu(ui->menuView->menuAction(), menu); } @@ -989,7 +989,7 @@ void MainWindow::updateViewersBboxes(bool recenter) computeViewerBBox(min, max); Q_FOREACH(CGAL::QGLViewer* v, CGAL::QGLViewer::QGLViewerPool()) { - if(v == NULL) + if(v == nullptr) continue; Viewer* vi = static_cast(v); updateViewerBbox(vi, recenter, min, max); @@ -1035,7 +1035,7 @@ void MainWindow::computeViewerBBox(CGAL::qglviewer::Vec& vmin, CGAL::qglviewer:: { Q_FOREACH(CGAL::QGLViewer* v, CGAL::QGLViewer::QGLViewerPool()) { - if(v == NULL) + if(v == nullptr) continue; Viewer* vi = qobject_cast(v); vi->setOffset(offset); @@ -1051,7 +1051,7 @@ void MainWindow::computeViewerBBox(CGAL::qglviewer::Vec& vmin, CGAL::qglviewer:: void MainWindow::reloadItem() { - Scene_item* item = NULL; + Scene_item* item = nullptr; Q_FOREACH(Scene::Item_id id, scene->selectionIndices()) { @@ -1433,20 +1433,20 @@ void MainWindow::selectionChanged() CGAL::Three::Scene_item* item = scene->item(getSelectedSceneItemIndex()); Q_FOREACH(CGAL::QGLViewer* vi, CGAL::QGLViewer::QGLViewerPool()) { - if(vi == NULL) + if(vi == nullptr) continue; - if(item != NULL && item->manipulatable()) { + if(item != nullptr && item->manipulatable()) { vi->setManipulatedFrame(item->manipulatedFrame()); } else { - vi->setManipulatedFrame(0); + vi->setManipulatedFrame(nullptr); } - if(vi->manipulatedFrame() == 0) { + if(vi->manipulatedFrame() == nullptr) { Q_FOREACH(CGAL::Three::Scene_item* item, scene->entries()) { - if(item->manipulatable() && item->manipulatedFrame() != 0) { - if(vi->manipulatedFrame() != 0) { + if(item->manipulatable() && item->manipulatedFrame() != nullptr) { + if(vi->manipulatedFrame() != nullptr) { // there are at least two possible frames - vi->setManipulatedFrame(0); + vi->setManipulatedFrame(nullptr); break; } else { vi->setManipulatedFrame(item->manipulatedFrame()); @@ -1454,7 +1454,7 @@ void MainWindow::selectionChanged() } } } - if(vi->manipulatedFrame() != 0) { + if(vi->manipulatedFrame() != nullptr) { connect(vi->manipulatedFrame(), SIGNAL(modified()), this, SLOT(updateInfo())); } @@ -1585,7 +1585,7 @@ void MainWindow::showSceneContextMenu(const QPoint& p) { } QMenu menu; menu.addAction(actionAddToGroup); - menu.insertSeparator(0); + menu.insertSeparator(nullptr); Q_FOREACH(QString name, menu_actions.keys()) { if(name == QString("alpha slider") @@ -1751,7 +1751,7 @@ void MainWindow::showSceneContextMenu(const QPoint& p) { Q_FOREACH(QMenu* m, slider_menus){ menu.addMenu(m); } - menu.insertSeparator(0); + menu.insertSeparator(nullptr); } if(has_stats) { @@ -1784,7 +1784,7 @@ void MainWindow::removeManipulatedFrame(CGAL::Three::Scene_item* item) { if(item->manipulatable() && item->manipulatedFrame() == viewer->manipulatedFrame()) { - viewer->setManipulatedFrame(0); + viewer->setManipulatedFrame(nullptr); } } @@ -1963,9 +1963,9 @@ void MainWindow::on_actionLoad_triggered() for(auto v : CGAL::QGLViewer::QGLViewerPool()) v->update(); FilterPluginMap::iterator it = - filterPluginMap.find(dialog.selectedNameFilter()); + filterPluginMap.find(dialog.selectedNameFilter()); - CGAL::Three::Polyhedron_demo_io_plugin_interface* selectedPlugin = NULL; + CGAL::Three::Polyhedron_demo_io_plugin_interface* selectedPlugin = nullptr; if(it != filterPluginMap.end()) { selectedPlugin = it.value(); @@ -1981,7 +1981,7 @@ void MainWindow::on_actionLoad_triggered() Q_FOREACH(const QString& filename, dialog.selectedFiles()) { - CGAL::Three::Scene_item* item = NULL; + CGAL::Three::Scene_item* item = nullptr; if(selectedPlugin) { QFileInfo info(filename); bool ok; @@ -2476,13 +2476,12 @@ void MainWindow::setBackgroundColor() if(c.isValid()) { Q_FOREACH(CGAL::QGLViewer* v, CGAL::QGLViewer::QGLViewerPool()) { - if(v == NULL) + if(v == nullptr) continue; v->setBackgroundColor(c); v->update(); } } - } void MainWindow::setLighting_triggered() @@ -2492,7 +2491,7 @@ void MainWindow::setLighting_triggered() void MainWindow::viewerShowObject() { - Scene_item* item = NULL; + Scene_item* item = nullptr; QAction* sender_action = qobject_cast(sender()); if(sender_action && !sender_action->data().isNull()) { item = (Scene_item*)sender_action->data().value(); @@ -2610,7 +2609,7 @@ void MainWindow::recenterSceneView(const QModelIndex &id) if(id.isValid()) { // mapFromSource is necessary to convert the QModelIndex received - // from the Scene into a valid QModelIndex in the view, beacuse of + // from the Scene into a valid QModelIndex in the view, beacause of // the proxymodel sceneView->scrollTo(proxyModel->mapFromSource(id)); } @@ -2620,7 +2619,7 @@ void MainWindow::statisticsOnItem() { QApplication::setOverrideCursor(Qt::WaitCursor); - if (statistics_dlg == NULL) + if (statistics_dlg == nullptr) { statistics_dlg = new QDialog(this); statistics_ui->setupUi(statistics_dlg); @@ -3177,13 +3176,13 @@ void MainWindow::on_actionSa_ve_Scene_as_Script_triggered() QString path; path = QInputDialog::getText(this, "", - tr("Enter the name of your scene file.")); + tr("Enter the name of your scene file.")); if(path.isEmpty()) return; if(!path.contains("Polyhedron_demo_")) path.prepend("Polyhedron_demo_"); try{ - ssh_session session = NULL; + ssh_session session = nullptr; bool res = establish_ssh_session_from_agent(session, user.toStdString().c_str(), server.toStdString().c_str(), diff --git a/Polyhedron/demo/Polyhedron/MainWindow.h b/Polyhedron/demo/Polyhedron/MainWindow.h index a83f0fe70959..95071decc1d4 100644 --- a/Polyhedron/demo/Polyhedron/MainWindow.h +++ b/Polyhedron/demo/Polyhedron/MainWindow.h @@ -79,7 +79,7 @@ class MAINWINDOW_EXPORT MainWindow : * Then it creates and initializes the scene and do the * connexions with the UI. Finally it loads the plugins.*/ - MainWindow(const QStringList& keywords, bool verbose = false,QWidget* parent = 0); + MainWindow(const QStringList& keywords, bool verbose = false,QWidget* parent = nullptr); ~MainWindow(); /*! Finds an I/O plugin. diff --git a/Polyhedron/demo/Polyhedron/Plugins/AABB_tree/Cut_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/AABB_tree/Cut_plugin.cpp index c47593831be5..badb42d051f8 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/AABB_tree/Cut_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/AABB_tree/Cut_plugin.cpp @@ -112,7 +112,7 @@ class FillGridSize { const FT dy = 2*diag; const FT z (0); const FT fd = FT(1); - SM_Tree *min_sm_tree = NULL; + SM_Tree *min_sm_tree = nullptr; for( std::size_t t = r.begin(); t != r.end(); ++t) { int i = static_cast(t%grid_size), j = static_cast(t/grid_size); @@ -205,7 +205,7 @@ struct PPMAP Mesh* _mesh; PPMAP() - :_mesh(NULL){} + :_mesh(nullptr){} PPMAP(Mesh* mesh) :_mesh(mesh) { @@ -613,7 +613,7 @@ class Q_DECL_EXPORT Scene_aabb_item : public CGAL::Three::Scene_item_rendering_h menu->addAction(filterAction); QMenu *container = new QMenu(tr("Tree level")); - QWidgetAction *sliderAction = new QWidgetAction(0); + QWidgetAction *sliderAction = new QWidgetAction(nullptr); connect(lvlSlider, &QSlider::valueChanged, this, [this](){ invalidateOpenGLBuffers(); @@ -637,7 +637,7 @@ class Q_DECL_EXPORT Scene_aabb_item : public CGAL::Three::Scene_item_rendering_h void compute_bbox() const {} Scene_aabb_item* clone() const { - return 0; + return nullptr; } QString toolTip() const { @@ -665,7 +665,7 @@ class Q_DECL_EXPORT Scene_aabb_item : public CGAL::Three::Scene_item_rendering_h for(CGAL::QGLViewer* v: CGAL::QGLViewer::QGLViewerPool()) { CGAL::Three::Viewer_interface* viewer = static_cast(v); - if(viewer == NULL) + if(viewer == nullptr) continue; setBuffersInit(viewer, false); } @@ -938,7 +938,7 @@ class Polyhedron_demo_cut_plugin : Q_PLUGIN_METADATA(IID "com.geometryfactory.PolyhedronDemo.IOPluginInterface/1.90") public: - Polyhedron_demo_cut_plugin() : QObject(), edges_item(0) { + Polyhedron_demo_cut_plugin() : QObject(), edges_item(nullptr) { } ~Polyhedron_demo_cut_plugin(); @@ -1054,7 +1054,7 @@ public Q_SLOTS: void cut(); void computeIntersection(); void reset_edges() { - edges_item = 0; + edges_item = nullptr; } void Intersection(); void SignedFacets(); @@ -1062,7 +1062,7 @@ public Q_SLOTS: void UnsignedEdges(); void resetPlane() { - plane_item = NULL; + plane_item = nullptr; } void uncheckActions() { @@ -1168,7 +1168,7 @@ void Polyhedron_demo_cut_plugin::init(QMainWindow* mainWindow, this, SLOT(UnsignedFacets())); connect(actionUnsignedEdges, SIGNAL(triggered()), this, SLOT(UnsignedEdges())); - plane_item = NULL; + plane_item = nullptr; Scene* real_scene = static_cast(scene); connect(real_scene, SIGNAL(itemAboutToBeDestroyed(CGAL::Three::Scene_item*)), this, SLOT(deleteTrees(CGAL::Three::Scene_item*))); @@ -1296,7 +1296,7 @@ void Polyhedron_demo_cut_plugin::createCutPlane() { CGAL::Three::Scene_item* item = scene->item(i); Scene_surface_mesh_item* sm_item = qobject_cast(item); - if ( NULL != sm_item ) + if ( nullptr != sm_item ) sm_item->setVisible(false); } //fills the tree maps @@ -1338,7 +1338,7 @@ void Polyhedron_demo_cut_plugin::SignedFacets() { if(edges_item) { scene->erase(scene->item_id(edges_item)); - edges_item = NULL; + edges_item = nullptr; } QApplication::restoreOverrideCursor(); @@ -1353,7 +1353,7 @@ void Polyhedron_demo_cut_plugin::UnsignedFacets() { if(edges_item) { scene->erase(scene->item_id(edges_item)); - edges_item = NULL; + edges_item = nullptr; } QApplication::restoreOverrideCursor(); } @@ -1367,7 +1367,7 @@ void Polyhedron_demo_cut_plugin::UnsignedEdges() { if(edges_item) { scene->erase(scene->item_id(edges_item)); - edges_item = NULL; + edges_item = nullptr; } QApplication::restoreOverrideCursor(); } @@ -1408,7 +1408,7 @@ void Polyhedron_demo_cut_plugin::computeIntersection() const Simple_kernel::Segment_3* inter_seg = CGAL::object_cast(&(it->first)); - if ( NULL != inter_seg ) + if ( nullptr != inter_seg ) edges_item->edges.push_back(*inter_seg); } } diff --git a/Polyhedron/demo/Polyhedron/Plugins/Classification/Classification_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/Classification/Classification_plugin.cpp index 2d410ceb0d44..586c45709638 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Classification/Classification_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Classification/Classification_plugin.cpp @@ -416,7 +416,7 @@ public Q_SLOTS: void update_plugin_from_item(Item_classification_base* classif) { disable_everything(); - if (classif != NULL) + if (classif != nullptr) { enable_computation(); @@ -466,13 +466,13 @@ public Q_SLOTS: } } - Item_classification_base* get_classification(Scene_item* item = NULL) + Item_classification_base* get_classification(Scene_item* item = nullptr) { if (!item) item = scene->item(scene->mainSelectionIndex()); if (!item) - return NULL; + return nullptr; Scene_polyhedron_selection_item* selection_item = qobject_cast(item); @@ -488,7 +488,7 @@ public Q_SLOTS: return it->second; } - return NULL; + return nullptr; } @@ -502,7 +502,7 @@ public Q_SLOTS: if (points_item->point_set()->has_property_map ("shape")) { QMessageBox::StandardButton reply - = QMessageBox::question(NULL, "Point Set Classification", + = QMessageBox::question(nullptr, "Point Set Classification", "This point set is divided in clusters. Do you want to classify clusters instead of points?", QMessageBox::Yes|QMessageBox::No, QMessageBox::Yes); @@ -929,7 +929,7 @@ public Q_SLOTS: QPushButton* label_clicked = qobject_cast(QObject::sender()->parent()->parent()); - if (label_clicked == NULL) + if (label_clicked == nullptr) std::cerr << "Error" << std::endl; else { @@ -1049,7 +1049,7 @@ public Q_SLOTS: if (classif->number_of_labels() != 0) { QMessageBox::StandardButton reply - = QMessageBox::question(NULL, "Classification", + = QMessageBox::question(nullptr, "Classification", "Current labels will be discarded. Continue?", QMessageBox::Yes|QMessageBox::No, QMessageBox::Yes); @@ -1076,7 +1076,7 @@ public Q_SLOTS: if (classif->number_of_labels() != 0) { QMessageBox::StandardButton reply - = QMessageBox::question(NULL, "Classification", + = QMessageBox::question(nullptr, "Classification", "Current labels will be discarded. Continue?", QMessageBox::Yes|QMessageBox::No, QMessageBox::Yes); @@ -1104,7 +1104,7 @@ public Q_SLOTS: if (classif->number_of_labels() != 0) { QMessageBox::StandardButton reply - = QMessageBox::question(NULL, "Classification", + = QMessageBox::question(nullptr, "Classification", "Current labels will be discarded. Continue?", QMessageBox::Yes|QMessageBox::No, QMessageBox::Yes); @@ -1145,7 +1145,7 @@ public Q_SLOTS: if (classif->number_of_labels() != 0) { QMessageBox::StandardButton reply - = QMessageBox::question(NULL, "Classification", + = QMessageBox::question(nullptr, "Classification", "Current labels will be discarded. Continue?", QMessageBox::Yes|QMessageBox::No, QMessageBox::Yes); @@ -1197,7 +1197,7 @@ public Q_SLOTS: } QPushButton* label_clicked = qobject_cast(QObject::sender()->parent()->parent()); - if (label_clicked == NULL) + if (label_clicked == nullptr) std::cerr << "Error" << std::endl; else { @@ -1447,7 +1447,7 @@ public Q_SLOTS: } QPushButton* label_clicked = qobject_cast(QObject::sender()->parent()->parent()); - if (label_clicked == NULL) + if (label_clicked == nullptr) std::cerr << "Error" << std::endl; else { @@ -1498,7 +1498,7 @@ public Q_SLOTS: } QPushButton* label_clicked = qobject_cast(QObject::sender()->parent()->parent()); - if (label_clicked == NULL) + if (label_clicked == nullptr) std::cerr << "Error" << std::endl; else { @@ -1533,7 +1533,7 @@ public Q_SLOTS: } QPushButton* label_clicked = qobject_cast(QObject::sender()->parent()->parent()); - if (label_clicked == NULL) + if (label_clicked == nullptr) std::cerr << "Error" << std::endl; else { @@ -1574,7 +1574,7 @@ public Q_SLOTS: } QPushButton* label_clicked = qobject_cast(QObject::sender()->parent()->parent()); - if (label_clicked == NULL) + if (label_clicked == nullptr) std::cerr << "Error" << std::endl; else { diff --git a/Polyhedron/demo/Polyhedron/Plugins/Classification/Cluster_classification.cpp b/Polyhedron/demo/Polyhedron/Plugins/Classification/Cluster_classification.cpp index f4456c791a4d..1de6a367cb57 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Classification/Cluster_classification.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Classification/Cluster_classification.cpp @@ -226,9 +226,9 @@ Cluster_classification::Cluster_classification(Scene_points_with_normal_item* po update_comments_of_point_set_item(); m_sowf = new Sum_of_weighted_features (m_labels, m_features); - m_ethz = NULL; + m_ethz = nullptr; #ifdef CGAL_LINKED_WITH_OPENCV - m_random_forest = NULL; + m_random_forest = nullptr; #endif // Compute neighborhood @@ -278,15 +278,19 @@ Cluster_classification::Cluster_classification(Scene_points_with_normal_item* po Cluster_classification::~Cluster_classification() { - if (m_sowf != NULL) + if (m_sowf != nullptr) delete m_sowf; - if (m_ethz != NULL) + if (m_ethz != nullptr) delete m_ethz; #ifdef CGAL_LINKED_WITH_OPENCV - if (m_random_forest != NULL) + if (m_random_forest != nullptr) delete m_random_forest; #endif - if (m_points != NULL) +#ifdef CGAL_LINKED_WITH_TENSORFLOW + if (m_neural_network != nullptr) + delete m_neural_network; +#endif + if (m_points != nullptr) { for (Point_set::const_iterator it = m_points->point_set()->begin(); it != m_points->point_set()->first_selected(); ++ it) @@ -538,7 +542,7 @@ void Cluster_classification::change_color (int index, float* vmin, float* vmax) float min = (std::numeric_limits::max)(); float max = -(std::numeric_limits::max)(); - if (vmin != NULL && vmax != NULL + if (vmin != nullptr && vmax != nullptr && *vmin != std::numeric_limits::infinity() && *vmax != std::numeric_limits::infinity()) { @@ -577,7 +581,7 @@ void Cluster_classification::change_color (int index, float* vmin, float* vmax) m_points->point_set()->set_color(*it); } - if (vmin != NULL && vmax != NULL) + if (vmin != nullptr && vmax != nullptr) { *vmin = min; *vmax = max; @@ -705,16 +709,16 @@ void Cluster_classification::compute_features (std::size_t nb_scales, float voxe delete m_sowf; m_sowf = new Sum_of_weighted_features (m_labels, m_features); - if (m_ethz != NULL) + if (m_ethz != nullptr) { delete m_ethz; - m_ethz = NULL; + m_ethz = nullptr; } #ifdef CGAL_LINKED_WITH_OPENCV - if (m_random_forest != NULL) + if (m_random_forest != nullptr) { delete m_random_forest; - m_random_forest = NULL; + m_random_forest = nullptr; } #endif @@ -833,7 +837,7 @@ void Cluster_classification::train(int classifier, const QMultipleInputDialog& d } else if (classifier == CGAL_CLASSIFICATION_ETHZ_NUMBER) { - if (m_ethz != NULL) + if (m_ethz != nullptr) delete m_ethz; m_ethz = new ETHZ_random_forest (m_labels, m_features); m_ethz->train(training, true, @@ -846,7 +850,7 @@ void Cluster_classification::train(int classifier, const QMultipleInputDialog& d else if (classifier == CGAL_CLASSIFICATION_OPENCV_NUMBER) { #ifdef CGAL_LINKED_WITH_OPENCV - if (m_random_forest != NULL) + if (m_random_forest != nullptr) delete m_random_forest; m_random_forest = new Random_forest (m_labels, m_features, dialog.get("max_depth")->value(), 5, 15, @@ -880,7 +884,7 @@ bool Cluster_classification::run (int method, int classifier, run (method, *m_sowf, subdivisions, smoothing); else if (classifier == CGAL_CLASSIFICATION_ETHZ_NUMBER) { - if (m_ethz == NULL) + if (m_ethz == nullptr) { std::cerr << "Error: ETHZ Random Forest must be trained or have a configuration loaded first" << std::endl; return false; @@ -890,7 +894,7 @@ bool Cluster_classification::run (int method, int classifier, else if (classifier == CGAL_CLASSIFICATION_OPENCV_NUMBER) { #ifdef CGAL_LINKED_WITH_OPENCV - if (m_random_forest == NULL) + if (m_random_forest == nullptr) { std::cerr << "Error: OpenCV Random Forest must be trained or have a configuration loaded first" << std::endl; return false; diff --git a/Polyhedron/demo/Polyhedron/Plugins/Classification/Cluster_classification.h b/Polyhedron/demo/Polyhedron/Plugins/Classification/Cluster_classification.h index 01d180bc3c24..e7b3df3e9b23 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Classification/Cluster_classification.h +++ b/Polyhedron/demo/Polyhedron/Plugins/Classification/Cluster_classification.h @@ -59,7 +59,7 @@ class Cluster_classification : public Item_classification_base ~Cluster_classification(); CGAL::Three::Scene_item* item() { return m_points; } - void erase_item() { m_points = NULL; } + void erase_item() { m_points = nullptr; } CGAL::Bbox_3 bbox() { @@ -200,7 +200,7 @@ class Cluster_classification : public Item_classification_base bool run (int method, int classifier, std::size_t subdivisions, double smoothing); void update_color () { change_color (m_index_color); } - void change_color (int index, float* vmin = NULL, float* vmax = NULL); + void change_color (int index, float* vmin = nullptr, float* vmax = nullptr); CGAL::Three::Scene_item* generate_one_item (const char* name, int label) const { @@ -226,7 +226,7 @@ class Cluster_classification : public Item_classification_base const char* name) const { std::vector points_item - (m_labels.size(), NULL); + (m_labels.size(), nullptr); for (std::size_t i = 0; i < m_labels.size(); ++ i) { points_item[i] = new Scene_points_with_normal_item; diff --git a/Polyhedron/demo/Polyhedron/Plugins/Classification/Item_classification_base.h b/Polyhedron/demo/Polyhedron/Plugins/Classification/Item_classification_base.h index 876d73a94a4e..ad13090ccc9f 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Classification/Item_classification_base.h +++ b/Polyhedron/demo/Polyhedron/Plugins/Classification/Item_classification_base.h @@ -68,7 +68,7 @@ class Item_classification_base virtual bool run (int method, int classifier, std::size_t subdivisions, double smoothing) = 0; virtual void update_color () = 0; - virtual void change_color (int index, float* vmin = NULL, float* vmax = NULL) = 0; + virtual void change_color (int index, float* vmin = nullptr, float* vmax = nullptr) = 0; virtual CGAL::Three::Scene_item* generate_one_item (const char* name, int label) const = 0; virtual void generate_one_item_per_label(std::vector& items, @@ -201,7 +201,7 @@ class Item_classification_base } else if (classifier == CGAL_CLASSIFICATION_ETHZ_NUMBER) { - if (m_ethz == NULL) + if (m_ethz == nullptr) m_ethz = new ETHZ_random_forest (m_labels, m_features); std::ifstream f (filename, std::ios_base::in | std::ios_base::binary); diff --git a/Polyhedron/demo/Polyhedron/Plugins/Classification/Point_set_item_classification.cpp b/Polyhedron/demo/Polyhedron/Plugins/Classification/Point_set_item_classification.cpp index 7fed79d5f357..06a51d6d9627 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Classification/Point_set_item_classification.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Classification/Point_set_item_classification.cpp @@ -18,7 +18,7 @@ Point_set_item_classification::Point_set_item_classification(Scene_points_with_normal_item* points) : m_points (points) - , m_generator (NULL) + , m_generator (nullptr) , m_input_is_las (false) { m_index_color = 1; @@ -213,26 +213,30 @@ Point_set_item_classification::Point_set_item_classification(Scene_points_with_n update_comments_of_point_set_item(); m_sowf = new Sum_of_weighted_features (m_labels, m_features); - m_ethz = NULL; + m_ethz = nullptr; #ifdef CGAL_LINKED_WITH_OPENCV - m_random_forest = NULL; + m_random_forest = nullptr; #endif } Point_set_item_classification::~Point_set_item_classification() { - if (m_sowf != NULL) + if (m_sowf != nullptr) delete m_sowf; - if (m_ethz != NULL) + if (m_ethz != nullptr) delete m_ethz; #ifdef CGAL_LINKED_WITH_OPENCV - if (m_random_forest != NULL) + if (m_random_forest != nullptr) delete m_random_forest; #endif - if (m_generator != NULL) +#ifdef CGAL_LINKED_WITH_TENSORFLOW + if (m_neural_network != nullptr) + delete m_neural_network; +#endif + if (m_generator != nullptr) delete m_generator; - if (m_points != NULL) + if (m_points != nullptr) { // For LAS saving, convert classification info in the LAS standard QString filename = m_points->property("source filename").toString(); @@ -441,7 +445,7 @@ void Point_set_item_classification::change_color (int index, float* vmin, float* float min = (std::numeric_limits::max)(); float max = -(std::numeric_limits::max)(); - if (vmin != NULL && vmax != NULL + if (vmin != nullptr && vmax != nullptr && *vmin != std::numeric_limits::infinity() && *vmax != std::numeric_limits::infinity()) { @@ -469,7 +473,7 @@ void Point_set_item_classification::change_color (int index, float* vmin, float* m_points->point_set()->set_color(*it, ramp.r(v) * 255, ramp.g(v) * 255, ramp.b(v) * 255); } - if (vmin != NULL && vmax != NULL) + if (vmin != nullptr && vmax != nullptr) { *vmin = min; *vmax = max; @@ -508,7 +512,7 @@ void Point_set_item_classification::compute_features (std::size_t nb_scales, flo { CGAL_assertion (!(m_points->point_set()->empty())); - if (m_generator != NULL) + if (m_generator != nullptr) delete m_generator; reset_indices(); @@ -559,16 +563,16 @@ void Point_set_item_classification::compute_features (std::size_t nb_scales, flo delete m_sowf; m_sowf = new Sum_of_weighted_features (m_labels, m_features); - if (m_ethz != NULL) + if (m_ethz != nullptr) { delete m_ethz; - m_ethz = NULL; + m_ethz = nullptr; } #ifdef CGAL_LINKED_WITH_OPENCV - if (m_random_forest != NULL) + if (m_random_forest != nullptr) { delete m_random_forest; - m_random_forest = NULL; + m_random_forest = nullptr; } #endif @@ -728,7 +732,7 @@ void Point_set_item_classification::train(int classifier, const QMultipleInputDi } else if (classifier == CGAL_CLASSIFICATION_ETHZ_NUMBER) { - if (m_ethz != NULL) + if (m_ethz != nullptr) delete m_ethz; m_ethz = new ETHZ_random_forest (m_labels, m_features); m_ethz->train(training, true, @@ -741,7 +745,7 @@ void Point_set_item_classification::train(int classifier, const QMultipleInputDi else if (classifier == CGAL_CLASSIFICATION_OPENCV_NUMBER) { #ifdef CGAL_LINKED_WITH_OPENCV - if (m_random_forest != NULL) + if (m_random_forest != nullptr) delete m_random_forest; m_random_forest = new Random_forest (m_labels, m_features, dialog.get("max_depth")->value(), 5, 15, @@ -776,7 +780,7 @@ bool Point_set_item_classification::run (int method, int classifier, run (method, *m_sowf, subdivisions, smoothing); else if (classifier == CGAL_CLASSIFICATION_ETHZ_NUMBER) { - if (m_ethz == NULL) + if (m_ethz == nullptr) { std::cerr << "Error: ETHZ Random Forest must be trained or have a configuration loaded first" << std::endl; return false; @@ -786,7 +790,7 @@ bool Point_set_item_classification::run (int method, int classifier, else if (classifier == CGAL_CLASSIFICATION_OPENCV_NUMBER) { #ifdef CGAL_LINKED_WITH_OPENCV - if (m_random_forest == NULL) + if (m_random_forest == nullptr) { std::cerr << "Error: OpenCV Random Forest must be trained or have a configuration loaded first" << std::endl; return false; diff --git a/Polyhedron/demo/Polyhedron/Plugins/Classification/Point_set_item_classification.h b/Polyhedron/demo/Polyhedron/Plugins/Classification/Point_set_item_classification.h index a0cc9900fd3b..bf6f3e1cf664 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Classification/Point_set_item_classification.h +++ b/Polyhedron/demo/Polyhedron/Plugins/Classification/Point_set_item_classification.h @@ -78,7 +78,7 @@ class Point_set_item_classification : public Item_classification_base ~Point_set_item_classification(); CGAL::Three::Scene_item* item() { return m_points; } - void erase_item() { m_points = NULL; } + void erase_item() { m_points = nullptr; } CGAL::Bbox_3 bbox() { @@ -216,7 +216,7 @@ class Point_set_item_classification : public Item_classification_base bool run (int method, int classifier, std::size_t subdivisions, double smoothing); void update_color () { change_color (m_index_color); } - void change_color (int index, float* vmin = NULL, float* vmax = NULL); + void change_color (int index, float* vmin = nullptr, float* vmax = nullptr); CGAL::Three::Scene_item* generate_one_item (const char* name, int label) const { @@ -239,7 +239,7 @@ class Point_set_item_classification : public Item_classification_base const char* name) const { std::vector points_item - (m_labels.size(), NULL); + (m_labels.size(), nullptr); for (std::size_t i = 0; i < m_labels.size(); ++ i) { points_item[i] = new Scene_points_with_normal_item; diff --git a/Polyhedron/demo/Polyhedron/Plugins/Classification/Surface_mesh_item_classification.cpp b/Polyhedron/demo/Polyhedron/Plugins/Classification/Surface_mesh_item_classification.cpp index 376d767c1e92..41f56217c4ca 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Classification/Surface_mesh_item_classification.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Classification/Surface_mesh_item_classification.cpp @@ -15,8 +15,8 @@ Surface_mesh_item_classification::Surface_mesh_item_classification(Scene_surface_mesh_item* mesh) : m_mesh (mesh), - m_selection (NULL), - m_generator (NULL) + m_selection (nullptr), + m_generator (nullptr) { m_index_color = 1; @@ -30,24 +30,28 @@ Surface_mesh_item_classification::Surface_mesh_item_classification(Scene_surface m_labels.add("facade"); m_sowf = new Sum_of_weighted_features (m_labels, m_features); - m_ethz = NULL; + m_ethz = nullptr; #ifdef CGAL_LINKED_WITH_OPENCV - m_random_forest = NULL; + m_random_forest = nullptr; #endif } Surface_mesh_item_classification::~Surface_mesh_item_classification() { - if (m_sowf != NULL) + if (m_sowf != nullptr) delete m_sowf; - if (m_ethz != NULL) + if (m_ethz != nullptr) delete m_ethz; #ifdef CGAL_LINKED_WITH_OPENCV - if (m_random_forest != NULL) + if (m_random_forest != nullptr) delete m_random_forest; #endif - if (m_generator != NULL) +#ifdef CGAL_LINKED_WITH_TENSORFLOW + if (m_neural_network != nullptr) + delete m_neural_network; +#endif + if (m_generator != nullptr) delete m_generator; } @@ -162,7 +166,7 @@ void Surface_mesh_item_classification::change_color (int index, float* vmin, flo float min = (std::numeric_limits::max)(); float max = -(std::numeric_limits::max)(); - if (vmin != NULL && vmax != NULL + if (vmin != nullptr && vmax != nullptr && *vmin != std::numeric_limits::infinity() && *vmax != std::numeric_limits::infinity()) { @@ -191,7 +195,7 @@ void Surface_mesh_item_classification::change_color (int index, float* vmin, flo (unsigned char)(ramp.b(v) * 255)); } - if (vmin != NULL && vmax != NULL) + if (vmin != nullptr && vmax != nullptr) { *vmin = min; *vmax = max; @@ -210,7 +214,7 @@ void Surface_mesh_item_classification::compute_features (std::size_t nb_scales, m_features.clear(); - if (m_generator != NULL) + if (m_generator != nullptr) delete m_generator; Face_center_map fc_map (m_mesh->polyhedron()); @@ -230,16 +234,16 @@ void Surface_mesh_item_classification::compute_features (std::size_t nb_scales, delete m_sowf; m_sowf = new Sum_of_weighted_features (m_labels, m_features); - if (m_ethz != NULL) + if (m_ethz != nullptr) { delete m_ethz; - m_ethz = NULL; + m_ethz = nullptr; } #ifdef CGAL_LINKED_WITH_OPENCV - if (m_random_forest != NULL) + if (m_random_forest != nullptr) { delete m_random_forest; - m_random_forest = NULL; + m_random_forest = nullptr; } #endif std::cerr << "Features = " << m_features.size() << std::endl; @@ -288,7 +292,7 @@ void Surface_mesh_item_classification::train (int classifier, const QMultipleInp } else if (classifier == CGAL_CLASSIFICATION_ETHZ_NUMBER) { - if (m_ethz != NULL) + if (m_ethz != nullptr) delete m_ethz; m_ethz = new ETHZ_random_forest (m_labels, m_features); m_ethz->train(training, true, @@ -301,7 +305,7 @@ void Surface_mesh_item_classification::train (int classifier, const QMultipleInp else if (classifier == CGAL_CLASSIFICATION_OPENCV_NUMBER) { #ifdef CGAL_LINKED_WITH_OPENCV - if (m_random_forest != NULL) + if (m_random_forest != nullptr) delete m_random_forest; m_random_forest = new Random_forest (m_labels, m_features, dialog.get("max_depth")->value(), 5, 15, @@ -334,7 +338,7 @@ bool Surface_mesh_item_classification::run (int method, int classifier, run (method, *m_sowf, subdivisions, smoothing); else if (classifier == CGAL_CLASSIFICATION_ETHZ_NUMBER) { - if (m_ethz == NULL) + if (m_ethz == nullptr) { std::cerr << "Error: ETHZ Random Forest must be trained or have a configuration loaded first" << std::endl; return false; @@ -344,7 +348,7 @@ bool Surface_mesh_item_classification::run (int method, int classifier, else if (classifier == CGAL_CLASSIFICATION_OPENCV_NUMBER) { #ifdef CGAL_LINKED_WITH_OPENCV - if (m_random_forest == NULL) + if (m_random_forest == nullptr) { std::cerr << "Error: OpenCV Random Forest must be trained or have a configuration loaded first" << std::endl; return false; diff --git a/Polyhedron/demo/Polyhedron/Plugins/Classification/Surface_mesh_item_classification.h b/Polyhedron/demo/Polyhedron/Plugins/Classification/Surface_mesh_item_classification.h index 2b4692217c63..1b6b2c1e7202 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Classification/Surface_mesh_item_classification.h +++ b/Polyhedron/demo/Polyhedron/Plugins/Classification/Surface_mesh_item_classification.h @@ -44,13 +44,13 @@ class Surface_mesh_item_classification : public Item_classification_base void backup_existing_colors_and_add_new(); CGAL::Three::Scene_item* item() { return m_mesh; } - void erase_item() { m_mesh = NULL; } + void erase_item() { m_mesh = nullptr; } void compute_features (std::size_t nb_scales, float voxel_size); void add_selection_to_training_set (std::size_t label) { - if (m_selection == NULL) + if (m_selection == nullptr) return; for (Selection::iterator it = m_selection->selected_facets.begin(); @@ -101,7 +101,7 @@ class Surface_mesh_item_classification : public Item_classification_base } void validate_selection () { - if (m_selection == NULL) + if (m_selection == nullptr) return; for (Selection::iterator it = m_selection->selected_facets.begin(); @@ -116,13 +116,13 @@ class Surface_mesh_item_classification : public Item_classification_base bool run (int method, int classifier, std::size_t subdivisions, double smoothing); void update_color() { change_color (m_index_color); } - void change_color (int index, float* vmin = NULL, float* vmax = NULL); + void change_color (int index, float* vmin = nullptr, float* vmax = nullptr); CGAL::Three::Scene_item* generate_one_item (const char* /* name */, int /* label */) const { // TODO std::cerr << "Warning: operation not yet available for meshes." << std::endl; - return NULL; + return nullptr; } void generate_one_item_per_label(std::vector&, const char*) const diff --git a/Polyhedron/demo/Polyhedron/Plugins/Convex_decomposition/Nef_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/Convex_decomposition/Nef_plugin.cpp index 053b0d16362c..73d7a944d064 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Convex_decomposition/Nef_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Convex_decomposition/Nef_plugin.cpp @@ -270,7 +270,7 @@ void Polyhedron_demo_nef_plugin::boolean_operation(const Boolean_operation opera QApplication::setOverrideCursor(Qt::WaitCursor); // copy itemA - Scene_nef_polyhedron_item* new_item = 0; + Scene_nef_polyhedron_item* new_item = nullptr; if(operation != MINKOWSKI_SUM) { new_item = new Scene_nef_polyhedron_item(*itemA->nef_polyhedron()); }; diff --git a/Polyhedron/demo/Polyhedron/Plugins/Display/Display_property_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/Display/Display_property_plugin.cpp index 4dfe1d39e052..8b92ffb1b37f 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Display/Display_property_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Display/Display_property_plugin.cpp @@ -364,7 +364,7 @@ class DisplayPropertyPlugin : { this->scene = sc; this->mw = mw; - this->current_item = NULL; + this->current_item = nullptr; QAction *actionDisplayProperties= new QAction(QString("Display Properties"), mw); QAction *actionHeatMethod= new QAction(QString("Heat Method"), mw); @@ -890,8 +890,8 @@ private Q_SLOTS: QMessageBox::warning(mw,"Error","The mesh must be triangulated."); return false; } - Heat_method * hm = NULL; - Heat_method_idt * hm_idt = NULL; + Heat_method * hm = nullptr; + Heat_method_idt * hm_idt = nullptr; SMesh::Property_map heat_intensity = mesh.add_property_map("v:heat_intensity", 0).first; if(! iDT){ @@ -1263,7 +1263,7 @@ private Q_SLOTS: if(!current_item) return; disconnect(current_item, SIGNAL(selected_vertex(void*)), this, SLOT(on_vertex_selected(void*))); - current_item = NULL; + current_item = nullptr; } } diff --git a/Polyhedron/demo/Polyhedron/Plugins/IO/Implicit_function_io_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/IO/Implicit_function_io_plugin.cpp index 58f19006f7c5..7159c3c38394 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/IO/Implicit_function_io_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/IO/Implicit_function_io_plugin.cpp @@ -87,7 +87,7 @@ init(QMainWindow* mainWindow, CGAL::Three::Scene_interface* scene_interface, Mes this->mw = mainWindow; QAction* actionLoadFunction = new QAction("Generate &Implicit Function", mw); - if( NULL != actionLoadFunction ) + if( nullptr != actionLoadFunction ) { connect(actionLoadFunction, SIGNAL(triggered()), this, SLOT(load_function())); } @@ -167,12 +167,12 @@ load_function_plugins() QPluginLoader loader; loader.setFileName(pluginsDir.absoluteFilePath(fileName)); QObject *function_plugin = loader.instance(); - if ( NULL != function_plugin ) + if ( nullptr != function_plugin ) { Implicit_function_interface* function = qobject_cast(function_plugin); - if ( NULL != function ) + if ( nullptr != function ) { functions_ << function; } diff --git a/Polyhedron/demo/Polyhedron/Plugins/IO/OFF_io_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/IO/OFF_io_plugin.cpp index 7e8b0c627638..87b92228a800 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/IO/OFF_io_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/IO/OFF_io_plugin.cpp @@ -110,7 +110,7 @@ Polyhedron_demo_off_plugin::load_off(QFileInfo fileinfo) { std::ifstream in(fileinfo.filePath().toUtf8()); if(!in) { std::cerr << "Error! Cannot open file " << (const char*)fileinfo.filePath().toUtf8() << std::endl; - return NULL; + return nullptr; } @@ -126,7 +126,7 @@ Polyhedron_demo_off_plugin::load_off(QFileInfo fileinfo) { if(!item->read_off_point_set(in)) { delete item; - return 0; + return nullptr; } return item; @@ -158,7 +158,7 @@ Polyhedron_demo_off_plugin::load_off(QFileInfo fileinfo) { "Cannot Open File", QString("Cannot open file %1").arg((const char*)fileinfo.filePath().toUtf8())); delete soup_item; - return 0; + return nullptr; } QApplication::restoreOverrideCursor(); QMessageBox::information( @@ -183,7 +183,7 @@ Polyhedron_demo_off_plugin::load_off(QFileInfo fileinfo) { item->setNbIsolatedvertices(isolated_v); //needs two restore, it's not a typo QApplication::restoreOverrideCursor(); - QMessageBox::warning((QWidget*)NULL, + QMessageBox::warning((QWidget*)nullptr, tr("Isolated vertices"), tr("%1 isolated vertices found") .arg(item->getNbIsolatedvertices())); @@ -196,7 +196,7 @@ Polyhedron_demo_off_plugin::load_off(QFileInfo fileinfo) { { QApplication::restoreOverrideCursor(); - QMessageBox::warning((QWidget*)NULL, + QMessageBox::warning((QWidget*)nullptr, tr("Non Manifold Vertices"), tr("Non-manifold vertices have been found")); } @@ -212,7 +212,7 @@ Polyhedron_demo_off_plugin::load_obj(QFileInfo fileinfo) { std::ifstream in(fileinfo.filePath().toUtf8()); if(!in) { std::cerr << "Error! Cannot open file " << (const char*)fileinfo.filePath().toUtf8() << std::endl; - return NULL; + return nullptr; } Scene_surface_mesh_item* item = new Scene_surface_mesh_item(); item->setName(fileinfo.baseName()); diff --git a/Polyhedron/demo/Polyhedron/Plugins/IO/PLY_io_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/IO/PLY_io_plugin.cpp index d105002b0713..d649629168a2 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/IO/PLY_io_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/IO/PLY_io_plugin.cpp @@ -198,7 +198,7 @@ save(QFileInfo fileinfo,QList& items) list << tr("Ascii"); bool ok = false; QString choice - = QInputDialog::getItem(NULL, tr("Save PLY file"), tr("Format"), list, 0, false, &ok); + = QInputDialog::getItem(nullptr, tr("Save PLY file"), tr("Format"), list, 0, false, &ok); if (!ok) return false; diff --git a/Polyhedron/demo/Polyhedron/Plugins/IO/Polylines_io_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/IO/Polylines_io_plugin.cpp index 91eafc44707e..a405be72fe9d 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/IO/Polylines_io_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/IO/Polylines_io_plugin.cpp @@ -329,7 +329,7 @@ void Polyhedron_demo_polylines_io_plugin::split_graph() Scene_item* main_item = scene->item(scene->mainSelectionIndex()); Scene_polylines_item* polylines_item = qobject_cast(main_item); - if(polylines_item == 0) return; + if(polylines_item == nullptr) return; std::vector new_polylines; polylines_to_split(new_polylines, polylines_item->polylines.begin(), polylines_item->polylines.end()); Scene_polylines_item* new_item = new Scene_polylines_item; diff --git a/Polyhedron/demo/Polyhedron/Plugins/IO/STL_io_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/IO/STL_io_plugin.cpp index 4ed82ddf492b..90626158e407 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/IO/STL_io_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/IO/STL_io_plugin.cpp @@ -140,7 +140,7 @@ save(QFileInfo fileinfo,QList& items) list << tr("Ascii"); bool ok = false; QString choice - = QInputDialog::getItem(NULL, tr("Save STL file"), tr("Format"), list, 0, false, &ok); + = QInputDialog::getItem(nullptr, tr("Save STL file"), tr("Format"), list, 0, false, &ok); if (!ok) return false; diff --git a/Polyhedron/demo/Polyhedron/Plugins/IO/Surf_io_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/IO/Surf_io_plugin.cpp index ea5138c22ed2..97949de65351 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/IO/Surf_io_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/IO/Surf_io_plugin.cpp @@ -68,7 +68,7 @@ CGAL::Three::Scene_item* Surf_io_plugin::actual_load(QFileInfo fileinfo) std::ifstream in(fileinfo.filePath().toUtf8()); if(!in) { std::cerr << "Error! Cannot open file " << (const char*)fileinfo.filePath().toUtf8() << std::endl; - return NULL; + return nullptr; } if(fileinfo.size() == 0) diff --git a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Io_image_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Io_image_plugin.cpp index 2e03a6886ed3..33248597860b 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Io_image_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Io_image_plugin.cpp @@ -221,10 +221,10 @@ class Io_image_plugin : this->scene = scene_interface; this->mw = mainWindow; this->is_gray = false; - x_control = NULL; - y_control = NULL; - z_control = NULL; - current_control = NULL; + x_control = nullptr; + y_control = nullptr; + z_control = nullptr; + current_control = nullptr; planeSwitch = new QAction("Add Volume Planes", mw); QAction *actionLoadDCM = new QAction("Open Directory (for DCM files)", mw); connect(actionLoadDCM, SIGNAL(triggered()), this, SLOT(on_actionLoadDCM_triggered())); @@ -236,7 +236,7 @@ class Io_image_plugin : this, SLOT(connect_controls(int))); } Viewer_interface* v = CGAL::Three::Three::mainViewer(); - CGAL_assertion(v != 0); + CGAL_assertion(v != nullptr); pxr_.setViewer(v); connect(v, SIGNAL(pointSelected(const QMouseEvent *)), &pxr_, SLOT(update(const QMouseEvent *))); createOrGetDockLayout(); @@ -244,12 +244,12 @@ class Io_image_plugin : this, SLOT(connectNewViewer(QObject*))); QMenu* menuFile = mw->findChild("menuFile"); - if ( NULL != menuFile ) + if ( nullptr != menuFile ) { QList menuFileActions = menuFile->actions(); // Look for action just after "Load..." action - QAction* actionAfterLoad = NULL; + QAction* actionAfterLoad = nullptr; for ( QList::iterator it_action = menuFileActions.begin(), end = menuFileActions.end() ; it_action != end ; ++ it_action ) //Q_FOREACH( QAction* action, menuFileActions) { @@ -264,7 +264,7 @@ class Io_image_plugin : } // Insert "Load implicit function" action - if ( NULL != actionAfterLoad ) + if ( nullptr != actionAfterLoad ) { menuFile->insertAction(actionAfterLoad,actionLoadDCM); } @@ -279,7 +279,7 @@ class Io_image_plugin : if(controlDockWidget) controlDockWidget->hide(); } - Io_image_plugin() : planeSwitch(NULL) {} + Io_image_plugin() : planeSwitch(nullptr) {} QString nameFilters() const override; bool canLoad(QFileInfo) const override; @@ -350,10 +350,10 @@ public Q_SLOTS: std::vector< Scene_image_item* > seg_items; Scene_image_item* seg_img; - seg_img = NULL; + seg_img = nullptr; for(int i = 0; i < scene->numberOfEntries(); ++i) { Scene_image_item* tmp = qobject_cast(scene->item(i)); - if(tmp != NULL){ + if(tmp != nullptr){ seg_items.push_back(tmp); } } @@ -541,7 +541,7 @@ public Q_SLOTS: bool loadDCM(QString filename); Image* createDCMImage(QString dirname); QLayout* createOrGetDockLayout() { - QLayout* layout = NULL; + QLayout* layout = nullptr; QDockWidget* controlDockWidget = mw->findChild("volumePlanesControl");; if(!controlDockWidget) { @@ -585,7 +585,7 @@ public Q_SLOTS: QLayout* layout = createOrGetDockLayout(); QRegExpValidator* validator = new QRegExpValidator(QRegExp("\\d*"), this); bool show_sliders = true; - if(x_control == NULL) + if(x_control == nullptr) { x_control = new QWidget; x_box = new QHBoxLayout(x_control); @@ -615,7 +615,7 @@ public Q_SLOTS: show_sliders &= seg_img->image()->xdim() > 1; } - if(y_control == NULL) + if(y_control == nullptr) { y_control = new QWidget; y_box = new QHBoxLayout(y_control); @@ -644,7 +644,7 @@ public Q_SLOTS: show_sliders &= seg_img->image()->ydim() > 1; } - if(z_control == NULL) + if(z_control == nullptr) { z_control = new QWidget; z_box = new QHBoxLayout(z_control); @@ -676,7 +676,7 @@ public Q_SLOTS: y_control->setEnabled(show_sliders); z_control->setEnabled(show_sliders); - if(!(seg_img == NULL)) { + if(!(seg_img == nullptr)) { const CGAL::Image_3* img = seg_img->image(); CGAL_IMAGE_IO_CASE(img->image(), this->launchAdders(seg_img, seg_img->name())) @@ -820,9 +820,9 @@ private Q_SLOTS: { if(group_map[key].group == group_item) { - group_map[key].x_item = NULL; - group_map[key].y_item = NULL; - group_map[key].z_item = NULL; + group_map[key].x_item = nullptr; + group_map[key].y_item = nullptr; + group_map[key].z_item = nullptr; group_map.remove(key); break; } @@ -844,9 +844,9 @@ private Q_SLOTS: Scene_group_item* group = qobject_cast(group_map[img_item].group); if(!group) return; - group_map[img_item].x_item = NULL; - group_map[img_item].y_item = NULL; - group_map[img_item].z_item = NULL; + group_map[img_item].x_item = nullptr; + group_map[img_item].y_item = nullptr; + group_map[img_item].z_item = nullptr; disconnect(group_map[img_item].group, SIGNAL(aboutToBeDestroyed()), this, SLOT(erase_group())); group_map.remove(img_item); @@ -884,7 +884,7 @@ private Q_SLOTS: current_control = &group_map[sel_itm]; bool show_sliders = true; // x line - if(c.x_item != NULL) + if(c.x_item != nullptr) { Volume_plane_interface* x_plane = qobject_cast(c.x_item); if(x_slider) @@ -905,7 +905,7 @@ private Q_SLOTS: show_sliders &= qobject_cast(sel_itm)->image()->xdim() > 1; } //y line - if(c.y_item != NULL) + if(c.y_item != nullptr) { Volume_plane_interface* y_plane = qobject_cast(c.y_item); if(y_slider) @@ -925,7 +925,7 @@ private Q_SLOTS: show_sliders &= qobject_cast(sel_itm)->image()->ydim() > 1; } // z line - if(c.z_item != NULL) + if(c.z_item != nullptr) { Volume_plane_interface* z_plane = qobject_cast(c.z_item); if(z_slider) @@ -959,19 +959,19 @@ private Q_SLOTS: void destroy_x_item() { - current_control->x_item = NULL; + current_control->x_item = nullptr; if(group_map.isEmpty()) x_control->hide(); } void destroy_y_item() { - current_control->y_item = NULL; + current_control->y_item = nullptr; if(group_map.isEmpty()) y_control->hide(); } void destroy_z_item() { - current_control->z_item = NULL; + current_control->z_item = nullptr; if(group_map.isEmpty()) z_control->hide(); } @@ -1293,7 +1293,7 @@ bool Io_image_plugin::loadDCM(QString dirname) } Image* Io_image_plugin::createDCMImage(QString dirname) { - Image* image = NULL; + Image* image = nullptr; #ifdef CGAL_USE_VTK vtkNew dicom_reader; dicom_reader->SetDirectoryName(dirname.toUtf8()); diff --git a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Raw_image_dialog.h b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Raw_image_dialog.h index f880c6050382..cf89701619b4 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Raw_image_dialog.h +++ b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Raw_image_dialog.h @@ -9,7 +9,7 @@ class Raw_image_dialog : public QDialog, public Ui::Raw_image_dialog Q_OBJECT public: - Raw_image_dialog(QWidget* parent = 0); + Raw_image_dialog(QWidget* parent = nullptr); std::size_t image_word_size() const; WORD_KIND image_word_kind() const; diff --git a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Volume_plane.h b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Volume_plane.h index 4cfd0b65a2e2..d54505abb1b5 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Volume_plane.h +++ b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Volume_plane.h @@ -104,7 +104,7 @@ private : virtual ~Volume_plane(); - Volume_plane* clone() const { return NULL; } + Volume_plane* clone() const { return nullptr; } virtual RenderingMode renderingMode() const { return Flat; } bool supportsRenderingMode(RenderingMode m) const { return m == Flat; } diff --git a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Volume_plane_interface.h b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Volume_plane_interface.h index a827f23d1b65..6abab5fbb661 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Volume_plane_interface.h +++ b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Volume_plane_interface.h @@ -54,7 +54,7 @@ Q_OBJECT if (!menuChanged) { QMenu *container = new QMenu(tr("Spheres Size")); - QWidgetAction *sliderAction = new QWidgetAction(0); + QWidgetAction *sliderAction = new QWidgetAction(nullptr); connect(sphere_Slider, &QSlider::valueChanged, this, &Volume_plane_interface::itemChanged); sliderAction->setDefaultWidget(sphere_Slider); diff --git a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Volume_plane_intersection.cpp b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Volume_plane_intersection.cpp index 737786472f7b..113960617698 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Volume_plane_intersection.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Volume_plane_intersection.cpp @@ -15,7 +15,7 @@ struct Volume_plane_intersection_priv Volume_plane_intersection_priv(float x, float y, float z, float tx, float ty, float tz, Volume_plane_intersection* parent) - : a(NULL), b(NULL), c(NULL), x(x), y(y), z(z), + : a(nullptr), b(nullptr), c(nullptr), x(x), y(y), z(z), tx(tx), ty(ty), tz(tz), item(parent) { item->are_buffers_filled = false; @@ -223,11 +223,11 @@ void Volume_plane_intersection::setY(Volume_plane_interface* x) { d->b = x; } void Volume_plane_intersection::setZ(Volume_plane_interface* x) { d->c = x; } void Volume_plane_intersection::planeRemoved(Volume_plane_interface* i) { if(d->a == i) { - d->a = NULL; + d->a = nullptr; } else if(d->b == i) { - d->b = NULL; + d->b = nullptr; } else if(d->c == i) { - d->c = NULL; + d->c = nullptr; } } diff --git a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Volume_plane_intersection.h b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Volume_plane_intersection.h index a4b98216be52..7c2f8e1ef9d4 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Volume_plane_intersection.h +++ b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Volume_plane_intersection.h @@ -24,7 +24,7 @@ Q_OBJECT bool isFinite() const { return true; } bool isEmpty() const { return false; } bool manipulatable() const { return false; } - Volume_plane_intersection* clone() const { return 0; } + Volume_plane_intersection* clone() const { return nullptr; } bool supportsRenderingMode(RenderingMode) const { return true; } QString toolTip() const { return "Tooling"; } void compute_bbox() const{} diff --git a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Volume_plane_thread.h b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Volume_plane_thread.h index 62feb43b4d17..0794e75d7750 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Volume_plane_thread.h +++ b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/Volume_plane_thread.h @@ -24,7 +24,7 @@ class Volume_plane_thread : public QThread { Q_OBJECT public: Volume_plane_thread(const CGAL::Image_3* img, const Clamp_to_one_zero_range& clamp, const QString& name) - : img(img), clamper(clamp), item(NULL), name(name) { _type = 'n';} + : img(img), clamper(clamp), item(nullptr), name(name) { _type = 'n';} Volume_plane_interface* getItem() { return item; diff --git a/Polyhedron/demo/Polyhedron/Plugins/Operations_on_polyhedra/Clip_polyhedron_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/Operations_on_polyhedra/Clip_polyhedron_plugin.cpp index 7fca6b934a21..457ebdc7b44b 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Operations_on_polyhedra/Clip_polyhedron_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Operations_on_polyhedra/Clip_polyhedron_plugin.cpp @@ -175,7 +175,7 @@ if it has a closed contour on the clipping polyhedron. Otherwise, it will be lef public Q_SLOTS: void on_plane_destroyed() { - plane = NULL; + plane = nullptr; dock_widget->hide(); } diff --git a/Polyhedron/demo/Polyhedron/Plugins/Operations_on_polyhedra/Partition_graph_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/Operations_on_polyhedra/Partition_graph_plugin.cpp index 6ac00996bf3b..cf7439cb97fb 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Operations_on_polyhedra/Partition_graph_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Operations_on_polyhedra/Partition_graph_plugin.cpp @@ -26,7 +26,7 @@ class PartitionDialog : { Q_OBJECT public: - PartitionDialog(QWidget* =0) + PartitionDialog(QWidget* =nullptr) { setupUi(this); } diff --git a/Polyhedron/demo/Polyhedron/Plugins/PCA/Affine_transform_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/PCA/Affine_transform_plugin.cpp index d4e638d31b54..9abca2095f37 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PCA/Affine_transform_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/PCA/Affine_transform_plugin.cpp @@ -87,7 +87,7 @@ class Scene_transform_point_set_item : public Scene_item_rendering_helper } bool manipulatable() const { return true; } - Scene_item* clone()const{ return NULL; } + Scene_item* clone()const{ return nullptr; } bool supportsRenderingMode(RenderingMode m) const { return m==Points ; } @@ -216,8 +216,8 @@ class Polyhedron_demo_affine_transform_plugin : if(actionTransformPolyhedron) { connect(actionTransformPolyhedron, SIGNAL(triggered()),this, SLOT(go())); } - transform_item = NULL; - transform_points_item = NULL; + transform_item = nullptr; + transform_points_item = nullptr; dock_widget = new QDockWidget( tr("Affine Transformation") @@ -357,8 +357,8 @@ public Q_SLOTS: void applySingleTransformation(); void resetItems() { - transform_item = NULL; - transform_points_item = NULL; + transform_item = nullptr; + transform_points_item = nullptr; } void undo() { @@ -398,7 +398,7 @@ class GridDialog : { Q_OBJECT public: - GridDialog(QWidget* =0) + GridDialog(QWidget* =nullptr) { setupUi(this); } @@ -461,7 +461,7 @@ void Polyhedron_demo_affine_transform_plugin::grid() void Polyhedron_demo_affine_transform_plugin::go(){ if (!started){ Scene_item* item = scene->item(scene->mainSelectionIndex()); - Scene_points_with_normal_item* points_item = NULL; + Scene_points_with_normal_item* points_item = nullptr; Facegraph_item* poly_item = qobject_cast(item); if(!poly_item) { @@ -589,7 +589,7 @@ void Polyhedron_demo_affine_transform_plugin::end(){ new_item->setName(tr("%1_transformed").arg(transform_item->name())); scene->replaceItem(tr_item_index,new_item); delete transform_item; - transform_item = NULL; + transform_item = nullptr; } else if(transform_points_item) { @@ -609,7 +609,7 @@ void Polyhedron_demo_affine_transform_plugin::end(){ new_item->setName(tr("%1_transformed").arg(transform_points_item->getBase()->name())); scene->replaceItem(tr_item_index,new_item); delete transform_points_item; - transform_points_item = NULL; + transform_points_item = nullptr; } dock_widget->hide(); QApplication::restoreOverrideCursor(); diff --git a/Polyhedron/demo/Polyhedron/Plugins/PCA/Clipping_box_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/PCA/Clipping_box_plugin.cpp index fa6ddac7f7fe..062e993b175d 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PCA/Clipping_box_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/PCA/Clipping_box_plugin.cpp @@ -91,10 +91,10 @@ void Clipping_box_plugin::init(QMainWindow* mainWindow, CGAL::Three::Scene_inter connect(dock_widget->pushButton, SIGNAL(toggled(bool)), this, SLOT(clip(bool))); - item = NULL; + item = nullptr; connect(mw, SIGNAL(newViewerCreated(QObject*)), this, SLOT(connectNewViewer(QObject*))); - visualizer = NULL; + visualizer = nullptr; shift_pressing = false; } @@ -143,7 +143,7 @@ void Clipping_box_plugin::clipbox() } void Clipping_box_plugin::enableAction() { - item = NULL; + item = nullptr; actionClipbox->setEnabled(true); } @@ -213,7 +213,7 @@ void Clipping_box_plugin::tab_change() if(item) { scene->erase(scene->item_id(item)); - item = NULL; + item = nullptr; } action->setChecked(true); CGAL::QGLViewer* viewer = *CGAL::QGLViewer::QGLViewerPool().begin(); @@ -272,7 +272,7 @@ bool Clipping_box_plugin::eventFilter(QObject *, QEvent *event) { // Cancel selection else if (mouseEvent->button() == Qt::RightButton && visualizer) { - visualizer = NULL; + visualizer = nullptr; QApplication::restoreOverrideCursor(); return true; } @@ -345,7 +345,7 @@ bool Clipping_box_plugin::eventFilter(QObject *, QEvent *event) { viewer->enableClippingBox(planes); dock_widget->unclipButton->setEnabled(true); dock_widget->clipButton->setChecked(false); - visualizer = NULL; + visualizer = nullptr; QApplication::restoreOverrideCursor(); static_cast(viewer)->set2DSelectionMode(false); viewer->update(); diff --git a/Polyhedron/demo/Polyhedron/Plugins/PCA/Create_obb_mesh_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/PCA/Create_obb_mesh_plugin.cpp index a24db1457e1f..13deadd7628b 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PCA/Create_obb_mesh_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/PCA/Create_obb_mesh_plugin.cpp @@ -92,7 +92,7 @@ void Create_obb_mesh_plugin::gather_mesh_points(std::vector& points) std::vector selected_vertices; - if(item != NULL) + if(item != nullptr) { FaceGraph& pmesh = *item->polyhedron(); selected_vertices.assign(vertices(pmesh).begin(), vertices(pmesh).end()); @@ -101,7 +101,7 @@ void Create_obb_mesh_plugin::gather_mesh_points(std::vector& points) points.push_back(get(pmap, v)); } - else if(selection_item != NULL) // using selection of faces + else if(selection_item != nullptr) // using selection of faces { FaceGraph& pmesh = *selection_item->polyhedron(); for(face_descriptor f : selection_item->selected_facets) @@ -121,7 +121,7 @@ void Create_obb_mesh_plugin::gather_mesh_points(std::vector& points) if(point_set_item) { Point_set* points_set = point_set_item->point_set(); - if(points_set == NULL) + if(points_set == nullptr) return; std::cout << "points_set->size()= " << points_set->size() << std::endl; diff --git a/Polyhedron/demo/Polyhedron/Plugins/PCA/Edit_box_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/PCA/Edit_box_plugin.cpp index 8a7e50592114..29c0e731d3ae 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PCA/Edit_box_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/PCA/Edit_box_plugin.cpp @@ -116,7 +116,7 @@ void Edit_box_plugin::exportToPoly() int id =0; const CGAL::qglviewer::Vec v_offset = Three::mainViewer()->offset(); EPICK::Vector_3 offset(v_offset.x, v_offset.y, v_offset.z); - Scene_edit_box_item* item = NULL; + Scene_edit_box_item* item = nullptr; for(int i = 0, end = scene->numberOfEntries(); i < end; ++i) { diff --git a/Polyhedron/demo/Polyhedron/Plugins/PCA/Scene_edit_box_item.cpp b/Polyhedron/demo/Polyhedron/Plugins/PCA/Scene_edit_box_item.cpp index 0cb165c03f6f..9ffb90946d0c 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PCA/Scene_edit_box_item.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/PCA/Scene_edit_box_item.cpp @@ -263,7 +263,7 @@ struct Scene_edit_box_item_priv{ Scene_edit_box_item::Scene_edit_box_item() { - d = NULL; + d = nullptr; } Scene_edit_box_item::Scene_edit_box_item(const Scene_interface *scene_interface) { diff --git a/Polyhedron/demo/Polyhedron/Plugins/PCA/Scene_edit_box_item.h b/Polyhedron/demo/Polyhedron/Plugins/PCA/Scene_edit_box_item.h index 0c5dca355a3a..4b95cc4fe739 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PCA/Scene_edit_box_item.h +++ b/Polyhedron/demo/Polyhedron/Plugins/PCA/Scene_edit_box_item.h @@ -29,7 +29,7 @@ class SCENE_EDIT_BOX_ITEM_EXPORT Scene_edit_box_item: bool manipulatable() const { return true; } ManipulatedFrame* manipulatedFrame(); Scene_edit_box_item* clone() const { - return 0; + return nullptr; } QString toolTip() const; diff --git a/Polyhedron/demo/Polyhedron/Plugins/PCA/Scene_facegraph_transform_item.h b/Polyhedron/demo/Polyhedron/Plugins/PCA/Scene_facegraph_transform_item.h index 10c473067a30..0f2148548a50 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PCA/Scene_facegraph_transform_item.h +++ b/Polyhedron/demo/Polyhedron/Plugins/PCA/Scene_facegraph_transform_item.h @@ -27,7 +27,7 @@ class SCENE_FACEGRAPH_TRANSFORM_ITEM_EXPORT Scene_facegraph_transform_item public: Scene_facegraph_transform_item(const CGAL::qglviewer::Vec& pos, FaceGraph *sm, const QString name); - Scene_item* clone() const{return NULL;} + Scene_item* clone() const{return nullptr;} QString toolTip() const; void drawEdges(CGAL::Three::Viewer_interface*) const; void compute_bbox() const; diff --git a/Polyhedron/demo/Polyhedron/Plugins/PMP/Hole_filling_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/PMP/Hole_filling_plugin.cpp index d0b22bb4fb32..d746af5fbad8 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PMP/Hole_filling_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/PMP/Hole_filling_plugin.cpp @@ -132,7 +132,7 @@ public: typedef std::list Polyline_data_list; } Scene_hole_visualizer* clone() const { - return 0; + return nullptr; } QString toolTip() const { return tr("%1 with %2 holes").arg(name()).arg(polyline_data_list.size()); @@ -459,7 +459,7 @@ void Polyhedron_demo_hole_filling_plugin::init(QMainWindow* mainWindow, CGAL::Three::Scene_interface* scene_interface, Messages_interface* m) { - last_active_item = NULL; + last_active_item = nullptr; mw = mainWindow; scene = scene_interface; @@ -657,17 +657,17 @@ void Polyhedron_demo_hole_filling_plugin::on_Create_polyline_items_button(){ } } void Polyhedron_demo_hole_filling_plugin::on_Accept_button() { - if(last_active_item == NULL) { return; } + if(last_active_item == nullptr) { return; } accept_reject_toggle(false); if(Scene_hole_visualizer* hole_visualizer = get_hole_visualizer(last_active_item)) { hole_visualizer->poly_item_changed();} new_facets.clear(); - last_active_item = NULL; + last_active_item = nullptr; } void Polyhedron_demo_hole_filling_plugin::on_Reject_button() { - if(last_active_item == NULL) { return; } + if(last_active_item == nullptr) { return; } accept_reject_toggle(false); FaceGraph& graph = *(last_active_item->polyhedron()); @@ -677,7 +677,7 @@ void Polyhedron_demo_hole_filling_plugin::on_Reject_button() { change_poly_item_by_blocking(last_active_item, get_hole_visualizer(last_active_item)); new_facets.clear(); - last_active_item = NULL; + last_active_item = nullptr; } // To delete Scene_hole_visualizer when it becomes empty void Polyhedron_demo_hole_filling_plugin::hole_visualizer_changed() { @@ -926,7 +926,7 @@ void Polyhedron_demo_hole_filling_plugin::hole_filling_polyline_action() { bool use_DT = QMessageBox::Yes == QMessageBox::question( - NULL, "Use Delaunay Triangulation", "Use Delaunay Triangulation ?", QMessageBox::Yes|QMessageBox::No); + nullptr, "Use Delaunay Triangulation", "Use Delaunay Triangulation ?", QMessageBox::Yes|QMessageBox::No); QApplication::setOverrideCursor(Qt::WaitCursor); QApplication::processEvents(); diff --git a/Polyhedron/demo/Polyhedron/Plugins/PMP/Mean_curvature_flow_skeleton_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/PMP/Mean_curvature_flow_skeleton_plugin.cpp index e47d749b43dc..77074c05704a 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PMP/Mean_curvature_flow_skeleton_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/PMP/Mean_curvature_flow_skeleton_plugin.cpp @@ -108,8 +108,8 @@ class Polyhedron_demo_mean_curvature_flow_skeleton_plugin : this->mw = mainWindow; this->scene = scene_interface; - dockWidget = NULL; - ui = NULL; + dockWidget = nullptr; + ui = nullptr; actionMCFSkeleton = new QAction(tr( "Mean Curvature Skeleton (Advanced)" @@ -257,7 +257,7 @@ class Polyhedron_demo_mean_curvature_flow_skeleton_plugin : bool check_mesh(Scene_mcf_item* item) { Face_graph *pMesh = item->input_triangle_mesh; - if (item->mcs == NULL) + if (item->mcs == nullptr) { if (!is_mesh_valid(pMesh)) { @@ -623,7 +623,7 @@ void Polyhedron_demo_mean_curvature_flow_skeleton_plugin::on_actionRun() QApplication::setOverrideCursor(Qt::WaitCursor); std::cout << "Run one iteration...\n"; - Scene_face_graph_item* contracted_item = NULL; + Scene_face_graph_item* contracted_item = nullptr; if(item->contractedItemIndex != -1) contracted_item = qobject_cast(scene->item(item->contractedItemIndex)); scene->setSelectedItem(scene->item_id(item)); @@ -851,16 +851,16 @@ void Polyhedron_demo_mean_curvature_flow_skeleton_plugin::on_actionItemAboutToBe if(mcf) { - mcf->mcs = NULL; - mcf->meso_skeleton = NULL; - mcf->input_triangle_mesh = NULL; + mcf->mcs = nullptr; + mcf->meso_skeleton = nullptr; + mcf->input_triangle_mesh = nullptr; mcf->fixedPointsItemIndex = -1; mcf->nonFixedPointsItemIndex = -1; mcf->poleLinesItemIndex = -1; mcf->contractedItemIndex = -1; mcf->InputMeshItemIndex = -1; - mcf->meso_skeleton = NULL; - mcf->input_triangle_mesh = NULL; + mcf->meso_skeleton = nullptr; + mcf->input_triangle_mesh = nullptr; } } @@ -869,7 +869,7 @@ Polyhedron_demo_mean_curvature_flow_skeleton_plugin::createContractedItem(Scene_ { if(!item) return; - if(item->mcs != NULL) + if(item->mcs != nullptr) delete item->mcs; double omega_H = ui->omega_H->value(); double omega_P = ui->omega_P->value(); @@ -918,7 +918,7 @@ Polyhedron_demo_mean_curvature_flow_skeleton_plugin::getMCFItem() { Face_graph* pMesh = item->face_graph(); - if(!pMesh) return NULL; + if(!pMesh) return nullptr; Scene_mcf_item* mcf = new Scene_mcf_item(item->face_graph(), scene->mainSelectionIndex(), QString("%1 (mcf)").arg(item->name())); @@ -933,7 +933,7 @@ Polyhedron_demo_mean_curvature_flow_skeleton_plugin::getMCFItem() return mcf; } } - return NULL; + return nullptr; } #include "Mean_curvature_flow_skeleton_plugin.moc" diff --git a/Polyhedron/demo/Polyhedron/Plugins/PMP/Orient_soup_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/PMP/Orient_soup_plugin.cpp index c89865992858..b98ab4052a45 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PMP/Orient_soup_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/PMP/Orient_soup_plugin.cpp @@ -397,7 +397,7 @@ class RepairDialog : { Q_OBJECT public: - RepairDialog(QWidget* =0) + RepairDialog(QWidget* =nullptr) { setupUi(this); } diff --git a/Polyhedron/demo/Polyhedron/Plugins/PMP/Scene_facegraph_item_k_ring_selection.h b/Polyhedron/demo/Polyhedron/Plugins/PMP/Scene_facegraph_item_k_ring_selection.h index e83fbd4637a0..7432244e8e91 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PMP/Scene_facegraph_item_k_ring_selection.h +++ b/Polyhedron/demo/Polyhedron/Plugins/PMP/Scene_facegraph_item_k_ring_selection.h @@ -36,7 +36,7 @@ struct FG_is_selected_edge_property_map{ std::vector* is_selected_ptr; EImap* edge_index_map; FG_is_selected_edge_property_map() - : is_selected_ptr(NULL), edge_index_map(NULL) {} + : is_selected_ptr(nullptr), edge_index_map(nullptr) {} FG_is_selected_edge_property_map(std::vector& is_selected, EImap* map) : is_selected_ptr( &is_selected), edge_index_map(map) {} @@ -47,13 +47,13 @@ struct FG_is_selected_edge_property_map{ friend bool get(FG_is_selected_edge_property_map map, fg_edge_descriptor ed) { - CGAL_assertion(map.is_selected_ptr!=NULL); + CGAL_assertion(map.is_selected_ptr!=nullptr); return (*map.is_selected_ptr)[map.id(ed)]; } friend void put(FG_is_selected_edge_property_map map, fg_edge_descriptor ed, bool b) { - CGAL_assertion(map.is_selected_ptr!=NULL); + CGAL_assertion(map.is_selected_ptr!=nullptr); (*map.is_selected_ptr)[map.id(ed)]=b; } }; diff --git a/Polyhedron/demo/Polyhedron/Plugins/PMP/Selection_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/PMP/Selection_plugin.cpp index 28eb05147da3..b4a495d94229 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PMP/Selection_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/PMP/Selection_plugin.cpp @@ -124,7 +124,7 @@ class Polyhedron_demo_selection_plugin : bool save(QFileInfo fileinfo,QList& items) override { Scene_item* scene_item = items.front(); const Scene_polyhedron_selection_item* item = qobject_cast(scene_item); - if(item == NULL) { return false; } + if(item == nullptr) { return false; } bool res = item->save(fileinfo.filePath().toStdString()); if(res) @@ -312,7 +312,7 @@ public Q_SLOTS: Scene_polyhedron_selection_item* onTheFlyItem() { Scene_face_graph_item* poly_item = qobject_cast(scene->item(scene->mainSelectionIndex())); if(!poly_item) - return NULL; + return nullptr; Scene_polyhedron_selection_item* new_item = new Scene_polyhedron_selection_item(poly_item, mw); new_item->setName(QString("%1 (selection)").arg(poly_item->name())); connectItem(new_item); @@ -1030,8 +1030,8 @@ public Q_SLOTS: qobject_cast(scene->item(item_id)); if(!selection_item) { return; } - Scene_face_graph_item* poly_item = NULL; - if(selection_item->polyhedron_item() == NULL) { //coming from selection_io loader + Scene_face_graph_item* poly_item = nullptr; + if(selection_item->polyhedron_item() == nullptr) { //coming from selection_io loader bool found = false; for(int i = 0; inumberOfEntries(); ++i){ poly_item = qobject_cast(scene->item(i)); diff --git a/Polyhedron/demo/Polyhedron/Plugins/Point_set/Point_set_selection_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/Point_set/Point_set_selection_plugin.cpp index 59c7c2c92248..185ce8930fc5 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Point_set/Point_set_selection_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Point_set/Point_set_selection_plugin.cpp @@ -336,7 +336,7 @@ class Neighborhood public: - Neighborhood () : points_item (NULL) + Neighborhood () : points_item (nullptr) { } @@ -601,8 +601,8 @@ class Polyhedron_demo_point_set_selection_plugin : } ); - visualizer = NULL; - edit_box = NULL; + visualizer = nullptr; + edit_box = nullptr; shift_pressing = false; ctrl_pressing = false; @@ -698,7 +698,7 @@ class Polyhedron_demo_point_set_selection_plugin : // Cancel selection else if (mouseEvent->button() == Qt::RightButton && visualizer) { - visualizer = NULL; + visualizer = nullptr; QApplication::restoreOverrideCursor(); return true; } @@ -720,7 +720,7 @@ class Polyhedron_demo_point_set_selection_plugin : { visualizer->apply_path(); select_points(); - visualizer = NULL; + visualizer = nullptr; QApplication::restoreOverrideCursor(); getActiveViewer()->set2DSelectionMode(false); return true; @@ -963,7 +963,7 @@ public Q_SLOTS: { if(edit_box) scene->erase(scene->item_id(edit_box)); - edit_box = NULL; + edit_box = nullptr; add_box->setEnabled(false); } @@ -973,7 +973,7 @@ public Q_SLOTS: void reset_editbox() { - edit_box = NULL; + edit_box = nullptr; } private: diff --git a/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Scene_polyhedron_shortest_path_item.cpp b/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Scene_polyhedron_shortest_path_item.cpp index d36eaad56db7..b961a47da1d8 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Scene_polyhedron_shortest_path_item.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/Scene_polyhedron_shortest_path_item.cpp @@ -48,7 +48,7 @@ struct Scene_polyhedron_shortest_path_item_priv typedef Surface_mesh_shortest_path_traits::Point_3 Point_3; typedef Surface_mesh_shortest_path_traits::FT FT; Scene_polyhedron_shortest_path_item_priv(Scene_polyhedron_shortest_path_item *parent) - : m_shortestPaths(NULL) + : m_shortestPaths(nullptr) , m_isTreeCached(false) , m_shiftHeld(false) { @@ -70,7 +70,7 @@ struct Scene_polyhedron_shortest_path_item_priv if (m_shortestPaths) { delete m_shortestPaths; - m_sceneInterface = NULL; + m_sceneInterface = nullptr; } } @@ -96,7 +96,7 @@ void Scene_polyhedron_shortest_path_item::common_constructor() } Scene_polyhedron_shortest_path_item::Scene_polyhedron_shortest_path_item() - :Scene_polyhedron_item_decorator(NULL, false) + :Scene_polyhedron_item_decorator(nullptr, false) { d = new Scene_polyhedron_shortest_path_item_priv(this); common_constructor(); @@ -194,7 +194,7 @@ void Scene_polyhedron_shortest_path_item::drawPoints(CGAL::Three::Viewer_interfa Scene_polyhedron_shortest_path_item* Scene_polyhedron_shortest_path_item::clone() const { - return 0; + return nullptr; } void Scene_polyhedron_shortest_path_item::set_selection_mode(Selection_mode mode) @@ -272,7 +272,7 @@ void Scene_polyhedron_shortest_path_item::invalidateOpenGLBuffers() Q_FOREACH(CGAL::QGLViewer* v, CGAL::QGLViewer::QGLViewerPool()) { CGAL::Three::Viewer_interface* viewer = static_cast(v); - if(viewer == NULL) + if(viewer == nullptr) continue; setBuffersInit(viewer, false); } @@ -632,7 +632,7 @@ void Scene_polyhedron_shortest_path_item::initialize( void Scene_polyhedron_shortest_path_item::deinitialize() { d->deinitialize(); - this->poly_item = NULL; + this->poly_item = nullptr; } bool Scene_polyhedron_shortest_path_item::isFinite() const diff --git a/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh_deformation/Scene_edit_polyhedron_item.cpp b/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh_deformation/Scene_edit_polyhedron_item.cpp index c6ab13f76f6c..3709992f0520 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh_deformation/Scene_edit_polyhedron_item.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh_deformation/Scene_edit_polyhedron_item.cpp @@ -36,8 +36,8 @@ struct Scene_edit_polyhedron_item_priv nb_control = 0; nb_axis = 0; nb_bbox = 0; - spheres = NULL; - spheres_ctrl = NULL; + spheres = nullptr; + spheres_ctrl = nullptr; need_change = false; } ~Scene_edit_polyhedron_item_priv() @@ -139,7 +139,7 @@ struct Facegraph_selector { Facegraph_selector() - :d(NULL){} //used for the const functions + :d(nullptr){} //used for the const functions Scene_edit_polyhedron_item_priv* d; Facegraph_selector(Scene_edit_polyhedron_item_priv* d) @@ -484,12 +484,12 @@ struct ROI_border_pmap {} friend bool get(const ROI_border_pmap& map, const key_type& k) { - CGAL_assertion(map.m_set_ptr != NULL); + CGAL_assertion(map.m_set_ptr != nullptr); return map.m_set_ptr->count(k); } friend void put(ROI_border_pmap& map, const key_type& k, const value_type b) { - CGAL_assertion(map.m_set_ptr != NULL); + CGAL_assertion(map.m_set_ptr != nullptr); if (b) map.m_set_ptr->insert(k); else if(get(map,k)) map.m_set_ptr->erase(k); } @@ -767,7 +767,7 @@ struct Is_selected_property_map{ Mesh* mesh; std::vector* is_selected_ptr; Is_selected_property_map() - : mesh(NULL), is_selected_ptr(NULL) {} + : mesh(NULL), is_selected_ptr(nullptr) {} Is_selected_property_map(std::vector& is_selected, Mesh* mesh) : mesh(mesh), is_selected_ptr( &is_selected) {} @@ -779,13 +779,13 @@ struct Is_selected_property_map{ friend bool get(Is_selected_property_map map, mesh_vd v) { - CGAL_assertion(map.is_selected_ptr!=NULL); + CGAL_assertion(map.is_selected_ptr!=nullptr); return (*map.is_selected_ptr)[map.id(v)]; } friend void put(Is_selected_property_map map, mesh_vd v, bool b) { - CGAL_assertion(map.is_selected_ptr!=NULL); + CGAL_assertion(map.is_selected_ptr!=nullptr); (*map.is_selected_ptr)[map.id(v)]=b; } }; @@ -1135,7 +1135,7 @@ void Scene_edit_polyhedron_item::invalidateOpenGLBuffers() Q_FOREACH(CGAL::QGLViewer* v, CGAL::QGLViewer::QGLViewerPool()) { CGAL::Three::Viewer_interface* viewer = static_cast(v); - if(viewer == NULL) + if(viewer == nullptr) continue; setBuffersInit(viewer, false); viewer->update(); @@ -1187,7 +1187,7 @@ void Scene_edit_polyhedron_item::setVisible(bool b) { d->sm_item->setVisible(b); Scene_item::setVisible(b); if(!b) { - Three::mainViewer()->setManipulatedFrame(NULL); + Three::mainViewer()->setManipulatedFrame(nullptr); } } void Scene_edit_polyhedron_item::setColor(QColor c) { @@ -1204,7 +1204,7 @@ void Scene_edit_polyhedron_item::setRenderingMode(RenderingMode m) { Scene_item::setRenderingMode(m); } Scene_edit_polyhedron_item* Scene_edit_polyhedron_item::clone() const { - return 0; + return nullptr; } void Scene_edit_polyhedron_item::select( double orig_x, @@ -1260,7 +1260,7 @@ struct Reset_spheres_ctrl { Scene_edit_polyhedron_item_priv* d; Reset_spheres_ctrl(Scene_edit_polyhedron_item_priv* d) : d(d) {} - void operator()() const { d->spheres_ctrl = NULL; } + void operator()() const { d->spheres_ctrl = nullptr; } }; void Scene_edit_polyhedron_item::ShowAsSphere(bool b) @@ -1294,13 +1294,13 @@ void Scene_edit_polyhedron_item::ShowAsSphere(bool b) } else if(!b ) { - if(d->spheres!=0) + if(d->spheres!=nullptr) { unlockChild(d->spheres); removeChild(d->spheres); scene->erase(scene->item_id(d->spheres)); } - if(d->spheres_ctrl!=0) + if(d->spheres_ctrl!=nullptr) { unlockChild(d->spheres_ctrl); removeChild(d->spheres_ctrl); @@ -1320,7 +1320,7 @@ void Scene_edit_polyhedron_item::set_k_ring(int v) { d->k_ring_selector.k_ring = void Scene_edit_polyhedron_item::reset_spheres() { - d->spheres = NULL; + d->spheres = nullptr; } @@ -1684,9 +1684,9 @@ bool Scene_edit_polyhedron_item::activate_closest_manipulated_frame(int x, int y if(!d->state.ctrl_pressing) { - if(viewer->manipulatedFrame() == NULL) + if(viewer->manipulatedFrame() == nullptr) { return false;} - viewer->setManipulatedFrame(NULL); + viewer->setManipulatedFrame(nullptr); return true; } diff --git a/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh_deformation/Scene_edit_polyhedron_item.h b/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh_deformation/Scene_edit_polyhedron_item.h index a5db1cb3f62e..181492178961 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh_deformation/Scene_edit_polyhedron_item.h +++ b/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh_deformation/Scene_edit_polyhedron_item.h @@ -147,7 +147,7 @@ class Control_vertices_data M_Deform_mesh* deform_mesh; public: - Control_vertices_data(M_Deform_mesh* deform_mesh, CGAL::qglviewer::ManipulatedFrame* frame = 0) + Control_vertices_data(M_Deform_mesh* deform_mesh, CGAL::qglviewer::ManipulatedFrame* frame = nullptr) : frame(frame), bbox(0,0,0,0,0,0), rot_direction(0.,0.,1.), deform_mesh(deform_mesh) { } diff --git a/Polyhedron/demo/Polyhedron/Point_container.cpp b/Polyhedron/demo/Polyhedron/Point_container.cpp index a2ac20489892..a7e4c37a88e4 100644 --- a/Polyhedron/demo/Polyhedron/Point_container.cpp +++ b/Polyhedron/demo/Polyhedron/Point_container.cpp @@ -22,7 +22,7 @@ Point_container::Point_container(int program, bool indexed) :Primitive_container(program, indexed), d(new Point_d()) { - std::vector vbos(NbOfVbos, NULL); + std::vector vbos(NbOfVbos, nullptr); setVbos(vbos); } @@ -95,7 +95,7 @@ void Point_container::draw(Viewer_interface *viewer, getVao(viewer)->program->setUniformValue("f_matrix", getFrameMatrix()); getVbo(Indices)->bind(); viewer->glDrawElements(GL_POINTS, static_cast(getIdxSize()), - GL_UNSIGNED_INT, 0); + GL_UNSIGNED_INT, nullptr); getVbo(Indices)->release(); getVao(viewer)->release(); } diff --git a/Polyhedron/demo/Polyhedron/Scene.cpp b/Polyhedron/demo/Polyhedron/Scene.cpp index 763627eedf95..27b33bf51755 100644 --- a/Polyhedron/demo/Polyhedron/Scene.cpp +++ b/Polyhedron/demo/Polyhedron/Scene.cpp @@ -99,7 +99,7 @@ CGAL::Three::Scene_item* Scene::replaceItem(Scene::Item_id index, CGAL::Three::Scene_item* item, bool emit_item_about_to_be_destroyed) { if(index < 0 || index >= m_entries.size()) - return 0; + return nullptr; connect(item, SIGNAL(itemChanged()), this, SLOT(itemChanged())); @@ -471,13 +471,13 @@ void Scene::initializeGL(CGAL::Three::Viewer_interface* viewer) vbo[0].bind(); vbo[0].allocate(points, 18 * sizeof(float)); program.enableAttributeArray("vertex"); - program.setAttributeArray("vertex", GL_FLOAT, 0, 3); + program.setAttributeArray("vertex", GL_FLOAT, nullptr, 3); vbo[0].release(); vbo[1].bind(); vbo[1].allocate(uvs, 12 * sizeof(float)); program.enableAttributeArray("v_texCoord"); - program.setAttributeArray("v_texCoord", GL_FLOAT, 0, 2); + program.setAttributeArray("v_texCoord", GL_FLOAT, nullptr, 2); vbo[1].release(); vaos[viewer]->release(); program.release(); @@ -519,7 +519,7 @@ bool item_should_be_skipped_in_draw(Scene_item* item) { if(!item->visible()) return true; if(item->has_group == 0) return false; Scene_group_item* group = item->parentGroup(); - while(group != 0) { + while(group != nullptr) { if(!group->visible()) return false; group = group->parentGroup(); } @@ -730,7 +730,7 @@ Scene::draw_aux(bool with_names, CGAL::Three::Viewer_interface* viewer) else transparent_items.push_back(id); } - renderScene(children, viewer, picked_item_IDs, with_names, -1, false, NULL); + renderScene(children, viewer, picked_item_IDs, with_names, -1, false, nullptr); if(with_names) { //here we get the selected point, before erasing the depth buffer. We store it @@ -779,8 +779,8 @@ Scene::draw_aux(bool with_names, CGAL::Three::Viewer_interface* viewer) 0.0f); viewer->glClearDepthf(1); viewer->glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - renderScene(opaque_items, viewer, picked_item_IDs, false, 0,false, NULL); - renderScene(transparent_items, viewer, picked_item_IDs, false, 0,false, NULL); + renderScene(opaque_items, viewer, picked_item_IDs, false, 0,false, nullptr); + renderScene(transparent_items, viewer, picked_item_IDs, false, 0,false, nullptr); fbos[0]->release(); depth_test[0] = new QOpenGLFramebufferObject(viewer->width(), viewer->height(),QOpenGLFramebufferObject::Depth, GL_TEXTURE_2D, GL_RGBA32F); depth_test[0]->bind(); @@ -793,8 +793,8 @@ Scene::draw_aux(bool with_names, CGAL::Three::Viewer_interface* viewer) 0.0f); viewer->glClearDepthf(1); viewer->glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - renderScene(opaque_items, viewer, picked_item_IDs, false, 0,true, NULL); - renderScene(transparent_items, viewer, picked_item_IDs, false, 0,true, NULL); + renderScene(opaque_items, viewer, picked_item_IDs, false, 0,true, nullptr); + renderScene(transparent_items, viewer, picked_item_IDs, false, 0,true, nullptr); depth_test[0]->release(); //other passes @@ -849,7 +849,7 @@ Scene::draw_aux(bool with_names, CGAL::Three::Viewer_interface* viewer) renderScene(opaque_items , viewer, picked_item_IDs, false, (int)viewer->total_pass()-1, false, depth_test[(int)viewer->total_pass()-2]); renderScene(transparent_items, viewer, picked_item_IDs, false, (int)viewer->total_pass()-1, false, depth_test[(int)viewer->total_pass()-2]); fbos[(int)viewer->total_pass()-1]->release(); - if(viewer->getStoredFrameBuffer() != NULL) + if(viewer->getStoredFrameBuffer() != nullptr) viewer->getStoredFrameBuffer()->bind(); //blending @@ -1114,7 +1114,7 @@ bool Scene::dropMimeData(const QMimeData * /*data*/, } } //Gets the group at the drop position - CGAL::Three::Scene_group_item* group = NULL; + CGAL::Three::Scene_group_item* group = nullptr; if(parent.isValid()) group = qobject_cast(this->item(index_map[parent])); bool one_contained = false; @@ -1459,7 +1459,7 @@ bool SceneDelegate::editorEvent(QEvent *event, QAbstractItemModel *model, if(mouseEvent->button() == ::Qt::LeftButton) { QColor color = QColorDialog::getColor(model->data(index).value(), - 0/*, + nullptr/*, tr("Select color"), QColorDialog::ShowAlphaChannel*/); if (color.isValid()) { @@ -1826,12 +1826,12 @@ findItem(const CGAL::Three::Scene_interface* scene_interface, const QMetaObject& metaobj, QString name, Scene_item_name_fn_ptr fn) { const Scene* scene = dynamic_cast(scene_interface); - if(!scene) return 0; + if(!scene) return nullptr; Q_FOREACH(CGAL::Three::Scene_item* item, scene->entries()) { CGAL::Three::Scene_item* ptr = qobject_cast(metaobj.cast(item)); if(ptr && ((ptr->*fn)() == name)) return ptr; } - return 0; + return nullptr; } Q_DECL_EXPORT @@ -1946,13 +1946,13 @@ void Scene::initGL(Viewer_interface *viewer) vbo[0].bind(); vbo[0].allocate(points, 18 * sizeof(float)); program.enableAttributeArray("vertex"); - program.setAttributeArray("vertex", GL_FLOAT, 0, 3); + program.setAttributeArray("vertex", GL_FLOAT, nullptr, 3); vbo[0].release(); vbo[1].bind(); vbo[1].allocate(uvs, 12 * sizeof(float)); program.enableAttributeArray("v_texCoord"); - program.setAttributeArray("v_texCoord", GL_FLOAT, 0, 2); + program.setAttributeArray("v_texCoord", GL_FLOAT, nullptr, 2); vbo[1].release(); vaos[viewer]->release(); program.release(); diff --git a/Polyhedron/demo/Polyhedron/Scene.h b/Polyhedron/demo/Polyhedron/Scene.h index bb8b21b8db2f..d06d7bcbfe41 100644 --- a/Polyhedron/demo/Polyhedron/Scene.h +++ b/Polyhedron/demo/Polyhedron/Scene.h @@ -314,7 +314,7 @@ class QAbstractProxyModel; class SCENE_EXPORT SceneDelegate : public QItemDelegate { public: - SceneDelegate(QObject * parent = 0) + SceneDelegate(QObject * parent = nullptr) : QItemDelegate(parent), checkOnPixmap(":/cgal/icons/check-on.png"), checkOffPixmap(":/cgal/icons/check-off.png") diff --git a/Polyhedron/demo/Polyhedron/Scene_image_item.h b/Polyhedron/demo/Polyhedron/Scene_image_item.h index 0354cb498b04..39630ae6d39a 100644 --- a/Polyhedron/demo/Polyhedron/Scene_image_item.h +++ b/Polyhedron/demo/Polyhedron/Scene_image_item.h @@ -28,7 +28,7 @@ class SCENE_IMAGE_ITEM_EXPORT Scene_image_item bool isEmpty() const { return false; } void compute_bbox() const; - Scene_image_item* clone() const { return NULL; } + Scene_image_item* clone() const { return nullptr; } // rendering mode virtual bool supportsRenderingMode(RenderingMode m) const; diff --git a/Polyhedron/demo/Polyhedron/Scene_implicit_function_item.cpp b/Polyhedron/demo/Polyhedron/Scene_implicit_function_item.cpp index 0066720cd5e9..ce7f362df7af 100644 --- a/Polyhedron/demo/Polyhedron/Scene_implicit_function_item.cpp +++ b/Polyhedron/demo/Polyhedron/Scene_implicit_function_item.cpp @@ -72,7 +72,7 @@ struct Scene_implicit_function_item_priv Scene_implicit_function_item* item; }; -void Scene_implicit_function_item_priv::initialize_buffers(CGAL::Three::Viewer_interface *viewer = 0) const +void Scene_implicit_function_item_priv::initialize_buffers(CGAL::Three::Viewer_interface *viewer = nullptr) const { item->getTriangleContainer(0)->initializeBuffers(viewer); item->getTriangleContainer(0)->setFlatDataSize(nb_quad); diff --git a/Polyhedron/demo/Polyhedron/Scene_implicit_function_item.h b/Polyhedron/demo/Polyhedron/Scene_implicit_function_item.h index f22e0a642c40..89a39440f062 100644 --- a/Polyhedron/demo/Polyhedron/Scene_implicit_function_item.h +++ b/Polyhedron/demo/Polyhedron/Scene_implicit_function_item.h @@ -30,7 +30,7 @@ class SCENE_IMPLICIT_FUNCTION_ITEM_EXPORT Scene_implicit_function_item bool isEmpty() const { return false; } void compute_bbox() const; - Scene_implicit_function_item* clone() const { return NULL; } + Scene_implicit_function_item* clone() const { return nullptr; } // rendering mode virtual bool supportsRenderingMode(RenderingMode m) const; diff --git a/Polyhedron/demo/Polyhedron/Scene_item.cpp b/Polyhedron/demo/Polyhedron/Scene_item.cpp index 7b331338d267..1951ee8ff7c2 100644 --- a/Polyhedron/demo/Polyhedron/Scene_item.cpp +++ b/Polyhedron/demo/Polyhedron/Scene_item.cpp @@ -14,7 +14,7 @@ CGAL::Three::Scene_item::Scene_item(int buffers_size, int vaos_size) visible_(true), are_buffers_filled(false), rendering_mode(FlatPlusEdges), - defaultContextMenu(0), + defaultContextMenu(nullptr), buffersSize(buffers_size), vaosSize(vaos_size), vaos(vaos_size) @@ -38,7 +38,7 @@ CGAL::Three::Scene_item::Scene_item(int buffers_size, int vaos_size) } nb_isolated_vertices = 0; has_group = 0; - parent_group = 0; + parent_group = nullptr; is_selected = false; } @@ -187,7 +187,7 @@ void CGAL::Three::Scene_item::attribBuffers(CGAL::Three::Viewer_interface* viewe QOpenGLShaderProgram* CGAL::Three::Scene_item::getShaderProgram(int name, CGAL::Three::Viewer_interface * viewer) const { - if(viewer == 0) + if(viewer == nullptr) viewer = dynamic_cast(*CGAL::QGLViewer::QGLViewerPool().begin()); return viewer->getShaderProgram(name); } diff --git a/Polyhedron/demo/Polyhedron/Scene_item_rendering_helper.cpp b/Polyhedron/demo/Polyhedron/Scene_item_rendering_helper.cpp index 8edcfda6d3e9..3f36dc6c9589 100644 --- a/Polyhedron/demo/Polyhedron/Scene_item_rendering_helper.cpp +++ b/Polyhedron/demo/Polyhedron/Scene_item_rendering_helper.cpp @@ -18,7 +18,7 @@ struct PRIV{ is_bbox_computed(false), is_diag_bbox_computed(false), _diag_bbox(0), - alphaSlider(0), + alphaSlider(nullptr), are_buffers_filled(false) {} @@ -139,7 +139,7 @@ QMenu* Scene_item_rendering_helper::contextMenu() if(!prop) { QMenu *container = new QMenu(tr("Alpha value")); - QWidgetAction *sliderAction = new QWidgetAction(0); + QWidgetAction *sliderAction = new QWidgetAction(nullptr); sliderAction->setDefaultWidget(priv->alphaSlider); container->addAction(sliderAction); diff --git a/Polyhedron/demo/Polyhedron/Scene_lcc_item.cpp b/Polyhedron/demo/Polyhedron/Scene_lcc_item.cpp index 41b16a37b9c2..7f23074391d1 100644 --- a/Polyhedron/demo/Polyhedron/Scene_lcc_item.cpp +++ b/Polyhedron/demo/Polyhedron/Scene_lcc_item.cpp @@ -165,20 +165,20 @@ struct lcc_priv{ P_traits cdt_traits(f.normal); CDT cdt(cdt_traits); // (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; iinfo().v=f.normal; - 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 @@ -191,8 +191,8 @@ struct lcc_priv{ } // (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()) { @@ -205,10 +205,10 @@ struct lcc_priv{ { 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); } @@ -216,7 +216,7 @@ struct lcc_priv{ } } - if ( face_internal!=NULL ) + if ( face_internal!=nullptr ) { face_queue.push(face_internal); } while(!face_queue.empty()) @@ -231,7 +231,7 @@ struct lcc_priv{ { 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)); } } } @@ -485,7 +485,7 @@ void Scene_lcc_item::computeElements() const static_cast(d->colors.size()*sizeof(float))); } else - getTriangleContainer(0)->allocate(Tri::FColors, 0, 0); + getTriangleContainer(0)->allocate(Tri::FColors, nullptr, 0); getEdgeContainer(0)->allocate( Ec::Vertices, d->lines.data(), diff --git a/Polyhedron/demo/Polyhedron/Scene_nef_polyhedron_item.cpp b/Polyhedron/demo/Polyhedron/Scene_nef_polyhedron_item.cpp index af27d7c18b25..0595dc7956ba 100644 --- a/Polyhedron/demo/Polyhedron/Scene_nef_polyhedron_item.cpp +++ b/Polyhedron/demo/Polyhedron/Scene_nef_polyhedron_item.cpp @@ -227,11 +227,11 @@ void Scene_nef_polyhedron_item_priv::compute_normals_and_vertices(void) const Nef_polyhedron::SVertex_const_handle v = hc->source(); const Nef_polyhedron::Point_3& point = v->source()->point(); CDT::Vertex_handle vh = cdt.insert(point); - if(first == 0) { + if(first == nullptr) { first = vh; } vh->info() = hc->source(); - if(previous != 0 && previous != vh) { + if(previous != nullptr && previous != vh) { cdt.insert_constraint(previous, vh); } previous = vh; @@ -512,7 +512,7 @@ Scene_nef_polyhedron_item::nef_polyhedron()const { bool Scene_nef_polyhedron_item::isEmpty() const { - return (d->nef_poly == 0) || d->nef_poly->is_empty(); + return (d->nef_poly == nullptr) || d->nef_poly->is_empty(); } void @@ -572,7 +572,7 @@ Scene_nef_polyhedron_item* Scene_nef_polyhedron_item::from_polygon_mesh(Scene_surface_mesh_item* item) { SMesh* sm = item->polyhedron(); - if(!sm) return 0; + if(!sm) return nullptr; CGAL::Surface_mesh exact_sm; CGAL::copy_face_graph(*sm, exact_sm); Nef_polyhedron* nef_poly = new Nef_polyhedron(exact_sm); diff --git a/Polyhedron/demo/Polyhedron/Scene_plane_item.cpp b/Polyhedron/demo/Polyhedron/Scene_plane_item.cpp index 36027c902d36..05f61f08b57b 100644 --- a/Polyhedron/demo/Polyhedron/Scene_plane_item.cpp +++ b/Polyhedron/demo/Polyhedron/Scene_plane_item.cpp @@ -194,7 +194,7 @@ Scene_plane_item* Scene_plane_item::clone() const { return item; } else - return 0; + return nullptr; } QString Scene_plane_item::toolTip() const { diff --git a/Polyhedron/demo/Polyhedron/Scene_points_with_normal_item.cpp b/Polyhedron/demo/Polyhedron/Scene_points_with_normal_item.cpp index a1d7baf7cc99..deaf33e1cc7f 100644 --- a/Polyhedron/demo/Polyhedron/Scene_points_with_normal_item.cpp +++ b/Polyhedron/demo/Polyhedron/Scene_points_with_normal_item.cpp @@ -113,7 +113,7 @@ struct Scene_points_with_normal_item_priv if(m_points) { delete m_points; - m_points = NULL; + m_points = nullptr; } delete normal_Slider; delete point_Slider; @@ -547,11 +547,10 @@ void Scene_points_with_normal_item::selectDuplicates() Q_EMIT itemChanged(); } - // Loads point set from .PLY file bool Scene_points_with_normal_item::read_ply_point_set(std::istream& stream) { - Q_ASSERT(d->m_points != NULL); + Q_ASSERT(d->m_points != nullptr); d->m_points->clear(); @@ -579,7 +578,7 @@ bool Scene_points_with_normal_item::read_ply_point_set(std::istream& stream) // Write point set to .PLY file bool Scene_points_with_normal_item::write_ply_point_set(std::ostream& stream, bool binary) const { - Q_ASSERT(d->m_points != NULL); + Q_ASSERT(d->m_points != nullptr); d->m_points->reset_indices(); @@ -595,7 +594,7 @@ bool Scene_points_with_normal_item::write_ply_point_set(std::ostream& stream, bo // Loads point set from .OFF file bool Scene_points_with_normal_item::read_off_point_set(std::istream& stream) { - Q_ASSERT(d->m_points != NULL); + Q_ASSERT(d->m_points != nullptr); d->m_points->clear(); bool ok = CGAL::read_OFF(stream, *(d->m_points)) && !isEmpty(); @@ -608,7 +607,7 @@ bool Scene_points_with_normal_item::read_off_point_set(std::istream& stream) // Write point set to .OFF file bool Scene_points_with_normal_item::write_off_point_set(std::ostream& stream) const { - Q_ASSERT(d->m_points != NULL); + Q_ASSERT(d->m_points != nullptr); d->m_points->reset_indices(); @@ -618,7 +617,7 @@ bool Scene_points_with_normal_item::write_off_point_set(std::ostream& stream) co // Loads point set from .XYZ file bool Scene_points_with_normal_item::read_xyz_point_set(std::istream& stream) { - Q_ASSERT(d->m_points != NULL); + Q_ASSERT(d->m_points != nullptr); d->m_points->clear(); @@ -632,7 +631,7 @@ bool Scene_points_with_normal_item::read_xyz_point_set(std::istream& stream) // Write point set to .XYZ file bool Scene_points_with_normal_item::write_xyz_point_set(std::ostream& stream) const { - Q_ASSERT(d->m_points != NULL); + Q_ASSERT(d->m_points != nullptr); d->m_points->reset_indices(); @@ -642,7 +641,7 @@ bool Scene_points_with_normal_item::write_xyz_point_set(std::ostream& stream) co QString Scene_points_with_normal_item::toolTip() const { - Q_ASSERT(d->m_points != NULL); + Q_ASSERT(d->m_points != nullptr); return QObject::tr("

%1 (color: %4)
" "Point_set_3

" @@ -755,12 +754,12 @@ drawPoints(CGAL::Three::Viewer_interface* viewer) const // Gets wrapped point set Point_set* Scene_points_with_normal_item::point_set() { - Q_ASSERT(d->m_points != NULL); + Q_ASSERT(d->m_points != nullptr); return d->m_points; } const Point_set* Scene_points_with_normal_item::point_set() const { - Q_ASSERT(d->m_points != NULL); + Q_ASSERT(d->m_points != nullptr); return d->m_points; } @@ -777,14 +776,14 @@ const std::string& Scene_points_with_normal_item::comments() const bool Scene_points_with_normal_item::isEmpty() const { - Q_ASSERT(d->m_points != NULL); + Q_ASSERT(d->m_points != nullptr); return d->m_points->empty(); } void Scene_points_with_normal_item::compute_bbox()const { - Q_ASSERT(d->m_points != NULL); + Q_ASSERT(d->m_points != nullptr); Kernel::Iso_cuboid_3 bbox = d->m_points->bounding_box(); setBbox(Bbox(bbox.xmin(),bbox.ymin(),bbox.zmin(), @@ -841,7 +840,7 @@ QMenu* Scene_points_with_normal_item::contextMenu() if(has_normals()) { QMenu *container = new QMenu(tr("Normals Length")); - QWidgetAction *sliderAction = new QWidgetAction(0); + QWidgetAction *sliderAction = new QWidgetAction(nullptr); if((d->nb_points)/3 <= limit_fast_drawing) { connect(d->normal_Slider, &QSlider::valueChanged, this, &Scene_points_with_normal_item::invalidateOpenGLBuffers); @@ -858,7 +857,7 @@ QMenu* Scene_points_with_normal_item::contextMenu() menu->addMenu(container); } QMenu *container = new QMenu(tr("Points Size")); - QWidgetAction *sliderAction = new QWidgetAction(0); + QWidgetAction *sliderAction = new QWidgetAction(nullptr); connect(d->point_Slider, &QSlider::sliderPressed, this, &Scene_points_with_normal_item::pointSliderPressed); connect(d->point_Slider, &QSlider::sliderReleased, this, &Scene_points_with_normal_item::pointSliderReleased); connect(d->point_Slider, &QSlider::valueChanged, this, &Scene_points_with_normal_item::itemChanged); @@ -914,7 +913,7 @@ void Scene_points_with_normal_item::invalidateOpenGLBuffers() Q_FOREACH(CGAL::QGLViewer* v, CGAL::QGLViewer::QGLViewerPool()) { CGAL::Three::Viewer_interface* viewer = static_cast(v); - if(viewer == NULL) + if(viewer == nullptr) continue; setBuffersInit(viewer, false); } @@ -957,7 +956,7 @@ void Scene_points_with_normal_item::itemAboutToBeDestroyed(Scene_item *item) if(d && d->m_points && item == this) { delete d->m_points; - d->m_points = NULL; + d->m_points = nullptr; } } diff --git a/Polyhedron/demo/Polyhedron/Scene_polygon_soup_item.cpp b/Polyhedron/demo/Polyhedron/Scene_polygon_soup_item.cpp index d4c5cc946fdd..40935ddfffb8 100644 --- a/Polyhedron/demo/Polyhedron/Scene_polygon_soup_item.cpp +++ b/Polyhedron/demo/Polyhedron/Scene_polygon_soup_item.cpp @@ -57,7 +57,7 @@ struct Scene_polygon_soup_item_priv{ typedef EPICK::Point_3 Point_3; Scene_polygon_soup_item_priv(Scene_polygon_soup_item* parent) - : soup(0), + : soup(nullptr), oriented(false) { item = parent; @@ -71,7 +71,7 @@ struct Scene_polygon_soup_item_priv{ if(soup) { delete soup; - soup = NULL; + soup = nullptr; } } void compute_normals_and_vertices(void) const; @@ -528,7 +528,7 @@ Scene_polygon_soup_item::toolTip() const void Scene_polygon_soup_item::draw(CGAL::Three::Viewer_interface* viewer) const { - if(d->soup == 0) return; + if(d->soup == nullptr) return; if(!isInit(viewer)) initGL(viewer); if ( getBuffersFilled() && @@ -563,7 +563,7 @@ Scene_polygon_soup_item::draw(CGAL::Three::Viewer_interface* viewer) const { void Scene_polygon_soup_item::drawPoints(CGAL::Three::Viewer_interface* viewer) const { - if(d->soup == 0) return; + if(d->soup == nullptr) return; if(!isInit(viewer)) initGL(viewer); if ( getBuffersFilled() && @@ -583,7 +583,7 @@ Scene_polygon_soup_item::drawPoints(CGAL::Three::Viewer_interface* viewer) const void Scene_polygon_soup_item::drawEdges(CGAL::Three::Viewer_interface* viewer) const { - if(d->soup == 0) return; + if(d->soup == nullptr) return; if(!isInit(viewer)) initGL(viewer); if ( getBuffersFilled() && @@ -610,7 +610,7 @@ Scene_polygon_soup_item::drawEdges(CGAL::Three::Viewer_interface* viewer) const bool Scene_polygon_soup_item::isEmpty() const { - return (d->soup == 0 || d->soup->points.empty()); + return (d->soup == nullptr || d->soup->points.empty()); } void Scene_polygon_soup_item::invalidateOpenGLBuffers() @@ -729,7 +729,7 @@ void Scene_polygon_soup_item::itemAboutToBeDestroyed(Scene_item *item) if(d->soup) { delete d->soup; - d->soup=NULL; + d->soup=nullptr; } } } diff --git a/Polyhedron/demo/Polyhedron/Scene_polyhedron_item_decorator.cpp b/Polyhedron/demo/Polyhedron/Scene_polyhedron_item_decorator.cpp index 46610ed6d861..1e71acc2eb1d 100644 --- a/Polyhedron/demo/Polyhedron/Scene_polyhedron_item_decorator.cpp +++ b/Polyhedron/demo/Polyhedron/Scene_polyhedron_item_decorator.cpp @@ -13,7 +13,7 @@ Scene_polyhedron_item_decorator::~Scene_polyhedron_item_decorator() Scene_polyhedron_item_decorator* Scene_polyhedron_item_decorator::clone() const { - return 0; + return nullptr; } QString diff --git a/Polyhedron/demo/Polyhedron/Scene_polyhedron_selection_item.cpp b/Polyhedron/demo/Polyhedron/Scene_polyhedron_selection_item.cpp index ab972f2653d4..391f4525dd7b 100644 --- a/Polyhedron/demo/Polyhedron/Scene_polyhedron_selection_item.cpp +++ b/Polyhedron/demo/Polyhedron/Scene_polyhedron_selection_item.cpp @@ -1803,7 +1803,7 @@ void Scene_polyhedron_selection_item::common_constructor() d->is_treated = false; d->poly_need_update = false; d->are_temp_buffers_filled = false; - d->poly = NULL; + d->poly = nullptr; d->ready_to_move = false; do_process = true; setProperty("no_picking", true); @@ -1825,13 +1825,13 @@ void Scene_polyhedron_selection_item::common_constructor() } Scene_polyhedron_selection_item::Scene_polyhedron_selection_item() - : Scene_polyhedron_item_decorator(NULL, false) + : Scene_polyhedron_item_decorator(nullptr, false) { common_constructor(); } Scene_polyhedron_selection_item::Scene_polyhedron_selection_item(Scene_face_graph_item* poly_item, QMainWindow* mw) - : Scene_polyhedron_item_decorator(NULL, false) + : Scene_polyhedron_item_decorator(nullptr, false) { common_constructor(); QString sf = poly_item->property("source filename").toString(); @@ -1896,7 +1896,7 @@ void Scene_polyhedron_selection_item::invalidateOpenGLBuffers() { { CGAL::Three::Viewer_interface* viewer = static_cast(v); - if(viewer == NULL) + if(viewer == nullptr) continue; setBuffersInit(viewer, false); viewer->update(); @@ -1970,7 +1970,7 @@ void Scene_polyhedron_selection_item::validateMoveVertex() temp_selected_vertices.clear(); CGAL::QGLViewer* viewer = Three::mainViewer(); k_ring_selector.setEditMode(true); - viewer->setManipulatedFrame(NULL); + viewer->setManipulatedFrame(nullptr); invalidateOpenGLBuffers(); poly_item->itemChanged(); if(property("need_hl_restore").toBool()){ diff --git a/Polyhedron/demo/Polyhedron/Scene_polyhedron_selection_item.h b/Polyhedron/demo/Polyhedron/Scene_polyhedron_selection_item.h index ade03f8d0dc0..7a33505e0b37 100644 --- a/Polyhedron/demo/Polyhedron/Scene_polyhedron_selection_item.h +++ b/Polyhedron/demo/Polyhedron/Scene_polyhedron_selection_item.h @@ -575,7 +575,7 @@ friend class Polyhedron_demo_selection_plugin; std::vector* is_selected_ptr; IDmap idmap; Is_selected_property_map() - : is_selected_ptr(NULL) {} + : is_selected_ptr(nullptr) {} Is_selected_property_map(std::vector& is_selected, IDmap idmap) : is_selected_ptr( &is_selected), idmap(idmap) {} @@ -584,13 +584,13 @@ friend class Polyhedron_demo_selection_plugin; friend bool get(Is_selected_property_map map, Handle h) { - CGAL_assertion(map.is_selected_ptr!=NULL); + CGAL_assertion(map.is_selected_ptr!=nullptr); return (*map.is_selected_ptr)[map.id(h)]; } friend void put(Is_selected_property_map map, Handle h, bool b) { - CGAL_assertion(map.is_selected_ptr!=NULL); + CGAL_assertion(map.is_selected_ptr!=nullptr); (*map.is_selected_ptr)[map.id(h)]=b; } }; @@ -613,7 +613,7 @@ friend class Polyhedron_demo_selection_plugin; {} friend bool get(const Is_constrained_map& map, const key_type& k) { - CGAL_assertion(map.m_set_ptr != NULL); + CGAL_assertion(map.m_set_ptr != nullptr); return map.m_set_ptr->count(k); } friend void put(Is_constrained_map& map, const key_type& k, const value_type b) diff --git a/Polyhedron/demo/Polyhedron/Scene_polylines_item.cpp b/Polyhedron/demo/Polyhedron/Scene_polylines_item.cpp index 96ab32bcae4e..00af90e21ed0 100644 --- a/Polyhedron/demo/Polyhedron/Scene_polylines_item.cpp +++ b/Polyhedron/demo/Polyhedron/Scene_polylines_item.cpp @@ -276,7 +276,7 @@ Scene_polylines_item::Scene_polylines_item() { setRenderingMode(FlatPlusEdges); d->nb_lines = 0; - d->spheres = NULL; + d->spheres = nullptr; setEdgeContainer(0, new Ec(Three::mainViewer()->isOpenGL_4_3() ? Vi::PROGRAM_SOLID_WIREFRAME : Vi::PROGRAM_NO_SELECTION @@ -499,7 +499,7 @@ QMenu* Scene_polylines_item::contextMenu() connect(actionSmoothPolylines, SIGNAL(triggered()),this, SLOT(smooth())); QMenu *container = new QMenu(tr("Line Width")); - QWidgetAction *sliderAction = new QWidgetAction(0); + QWidgetAction *sliderAction = new QWidgetAction(nullptr); connect(d->line_Slider, &QSlider::valueChanged, this, &Scene_polylines_item::itemChanged); sliderAction->setDefaultWidget(d->line_Slider); @@ -542,7 +542,7 @@ void Scene_polylines_item::change_corner_radii() { proposed_radius); proposed_radius /= 100; } - double r = QInputDialog::getDouble(NULL, + double r = QInputDialog::getDouble(nullptr, tr("Display corners with new radius..."), tr("Radius:"), proposed_radius, // value @@ -587,7 +587,7 @@ void Scene_polylines_item::change_corner_radii(double r) { d->spheres->invalidateOpenGLBuffers(); d->computeSpheres(); } - else if (r<=0 && d->spheres!=NULL) + else if (r<=0 && d->spheres!=nullptr) { unlockChild(d->spheres); scene->erase(scene->item_id(d->spheres)); @@ -682,7 +682,7 @@ void Scene_polylines_item::split_at_sharp_angles() void Scene_polylines_item::merge(Scene_polylines_item* other_item) { - if(other_item == 0) return; + if(other_item == nullptr) return; std::copy(other_item->polylines.begin(), other_item->polylines.end(), std::back_inserter(polylines)); @@ -698,7 +698,7 @@ Scene_polylines_item::merge(Scene_polylines_item* other_item) { void Scene_polylines_item::reset_spheres() { - d->spheres = NULL; + d->spheres = nullptr; } void Scene_polylines_item::smooth(){ diff --git a/Polyhedron/demo/Polyhedron/Scene_spheres_item.h b/Polyhedron/demo/Polyhedron/Scene_spheres_item.h index 288906cfb3a4..7520a4fca3eb 100644 --- a/Polyhedron/demo/Polyhedron/Scene_spheres_item.h +++ b/Polyhedron/demo/Polyhedron/Scene_spheres_item.h @@ -39,7 +39,7 @@ class SCENE_BASIC_OBJECTS_EXPORT Scene_spheres_item bool isFinite() const Q_DECL_OVERRIDE{ return true; } bool isEmpty() const Q_DECL_OVERRIDE{ return false; } - Scene_item* clone() const Q_DECL_OVERRIDE{return 0;} + Scene_item* clone() const Q_DECL_OVERRIDE{return nullptr;} QString toolTip() const Q_DECL_OVERRIDE; bool supportsRenderingMode(RenderingMode m) const Q_DECL_OVERRIDE{ return (m == Gouraud || m == Wireframe); diff --git a/Polyhedron/demo/Polyhedron/Scene_surface_mesh_item.cpp b/Polyhedron/demo/Polyhedron/Scene_surface_mesh_item.cpp index 86596bfa994d..b275fc3db755 100644 --- a/Polyhedron/demo/Polyhedron/Scene_surface_mesh_item.cpp +++ b/Polyhedron/demo/Polyhedron/Scene_surface_mesh_item.cpp @@ -144,7 +144,7 @@ struct Scene_surface_mesh_item_priv{ edges_displayed = false; faces_displayed = false; all_displayed = false; - alphaSlider = NULL; + alphaSlider = nullptr; has_vcolors = false; has_fcolors = false; supported_rendering_modes << FlatPlusEdges @@ -178,7 +178,7 @@ struct Scene_surface_mesh_item_priv{ edges_displayed = false; faces_displayed = false; all_displayed = false; - alphaSlider = NULL; + alphaSlider = nullptr; has_vcolors = false; has_fcolors = false; supported_rendering_modes << FlatPlusEdges @@ -199,7 +199,7 @@ struct Scene_surface_mesh_item_priv{ if(smesh_) { delete smesh_; - smesh_ = NULL; + smesh_ = nullptr; } } void killIds(); @@ -399,7 +399,7 @@ void Scene_surface_mesh_item_priv::addFlatData(Point p, EPICK::Vector_3 n, CGAL: flat_normals.push_back((cgal_gl_data)n.y()); flat_normals.push_back((cgal_gl_data)n.z()); } - if(c != NULL && name.testFlag(Scene_item_rendering_helper::COLORS)) + if(c != nullptr && name.testFlag(Scene_item_rendering_helper::COLORS)) { f_colors.push_back((float)c->red()/255); f_colors.push_back((float)c->green()/255); @@ -494,11 +494,11 @@ void Scene_surface_mesh_item_priv::compute_elements(Scene_item_rendering_helper: } else if(is_convex) { - triangulate_convex_facet(fd, &fnormals, 0, &im, name, true); + triangulate_convex_facet(fd, &fnormals, nullptr, &im, name, true); } else { - triangulate_facet(fd, &fnormals, 0, &im, name, true); + triangulate_facet(fd, &fnormals, nullptr, &im, name, true); } } } @@ -598,7 +598,7 @@ void Scene_surface_mesh_item_priv::compute_elements(Scene_item_rendering_helper: else if(has_fcolors) c= &fcolors[fd]; else - c = 0; + c = nullptr; addFlatData(p,n,c, name); hd = next(halfedge(fd, *smesh_),*smesh_); @@ -635,11 +635,11 @@ void Scene_surface_mesh_item_priv::compute_elements(Scene_item_rendering_helper: } else if(is_convex) { - triangulate_convex_facet(fd, &fnormals, &fcolors, 0, name, false); + triangulate_convex_facet(fd, &fnormals, &fcolors, nullptr, name, false); } else { - triangulate_facet(fd, &fnormals, &fcolors, 0, name, false); + triangulate_facet(fd, &fnormals, &fcolors, nullptr, name, false); } } } @@ -711,14 +711,14 @@ void Scene_surface_mesh_item_priv::compute_elements(Scene_item_rendering_helper: static_cast(f_colors.size()*sizeof(cgal_gl_data))); } else - item->getTriangleContainer(1)->allocate(Tri::FColors, 0, 0); + item->getTriangleContainer(1)->allocate(Tri::FColors, nullptr, 0); if(!v_colors.empty()) { item->getTriangleContainer(0)->allocate(Tri::VColors, v_colors.data(), static_cast(v_colors.size()*sizeof(cgal_gl_data))); } else - item->getTriangleContainer(0)->allocate(Tri::VColors, 0, 0); + item->getTriangleContainer(0)->allocate(Tri::VColors, nullptr, 0); } QApplication::restoreOverrideCursor(); @@ -925,7 +925,7 @@ void Scene_surface_mesh_item_priv::triangulate_convex_facet(face_descriptor fd, else if(has_fcolors) color = &(*fcolors)[fd]; else - color = 0; + color = nullptr; addFlatData(p0, (*fnormals)[fd], color, @@ -1017,7 +1017,7 @@ Scene_surface_mesh_item_priv::triangulate_facet(face_descriptor fd, else if(has_fcolors) color = &(*fcolors)[fd]; else - color = 0; + color = nullptr; addFlatData(ffit->vertex(0)->point()-offset, (*fnormals)[fd], @@ -1056,7 +1056,7 @@ void delete_aabb_tree(Scene_surface_mesh_item* item) Input_facets_AABB_tree* tree = static_cast(ptr); if(tree) { delete tree; - tree = 0; + tree = nullptr; } item->setProperty(aabb_property_name, QVariant()); } @@ -1081,21 +1081,21 @@ Scene_surface_mesh_item::~Scene_surface_mesh_item() { v->textRenderer()->removeTextList(d->textVItems); delete d->textVItems; - d->textVItems=NULL; + d->textVItems=nullptr; } //Remove edges textitems if(d->textEItems) { v->textRenderer()->removeTextList(d->textEItems); delete d->textEItems; - d->textEItems=NULL; + d->textEItems=nullptr; } //Remove faces textitems if(d->textFItems) { v->textRenderer()->removeTextList(d->textFItems); delete d->textFItems; - d->textFItems=NULL; + d->textFItems=nullptr; } } delete d; @@ -1126,7 +1126,7 @@ void Scene_surface_mesh_item::itemAboutToBeDestroyed(Scene_item *item) if(d && d->smesh_ && item == this) { delete d->smesh_; - d->smesh_ = NULL; + d->smesh_ = nullptr; } } @@ -1178,7 +1178,7 @@ void* Scene_surface_mesh_item_priv::get_aabb_tree() QApplication::restoreOverrideCursor(); return tree; } - else return 0; + else return nullptr; } } @@ -1319,7 +1319,7 @@ void Scene_surface_mesh_item::invalidate(Gl_data_names name) Q_FOREACH(CGAL::QGLViewer* v, CGAL::QGLViewer::QGLViewerPool()) { CGAL::Three::Viewer_interface* viewer = static_cast(v); - if(viewer == NULL) + if(viewer == nullptr) continue; setBuffersInit(viewer, false); viewer->update(); @@ -1999,7 +1999,7 @@ QMenu* Scene_surface_mesh_item::contextMenu() if(!menuChanged) { QMenu *container = new QMenu(tr("Alpha value")); container->menuAction()->setProperty("is_groupable", true); - QWidgetAction *sliderAction = new QWidgetAction(0); + QWidgetAction *sliderAction = new QWidgetAction(nullptr); sliderAction->setDefaultWidget(d->alphaSlider); connect(d->alphaSlider, &QSlider::valueChanged, [this](){redraw();}); diff --git a/Polyhedron/demo/Polyhedron/Scene_textured_surface_mesh_item.cpp b/Polyhedron/demo/Polyhedron/Scene_textured_surface_mesh_item.cpp index 16f9129499e1..5aa05350cc99 100644 --- a/Polyhedron/demo/Polyhedron/Scene_textured_surface_mesh_item.cpp +++ b/Polyhedron/demo/Polyhedron/Scene_textured_surface_mesh_item.cpp @@ -295,7 +295,7 @@ Scene_textured_surface_mesh_item::textured_face_graph() const { return d->sm; } bool Scene_textured_surface_mesh_item::isEmpty() const { - return (d->sm == 0) || d->sm->is_empty(); + return (d->sm == nullptr) || d->sm->is_empty(); } void diff --git a/Polyhedron/demo/Polyhedron/Show_point_dialog.h b/Polyhedron/demo/Polyhedron/Show_point_dialog.h index bc7d5334578c..915b51ae397b 100644 --- a/Polyhedron/demo/Polyhedron/Show_point_dialog.h +++ b/Polyhedron/demo/Polyhedron/Show_point_dialog.h @@ -15,7 +15,7 @@ class POINT_DIALOG_EXPORT Show_point_dialog : { Q_OBJECT public: - Show_point_dialog(QWidget* parent = 0); + Show_point_dialog(QWidget* parent = nullptr); ~Show_point_dialog(); bool has_correct_coordinates() const; diff --git a/Polyhedron/demo/Polyhedron/Three.cpp b/Polyhedron/demo/Polyhedron/Three.cpp index 53489e63f030..e2af8af2df69 100644 --- a/Polyhedron/demo/Polyhedron/Three.cpp +++ b/Polyhedron/demo/Polyhedron/Three.cpp @@ -9,12 +9,12 @@ #include "Messages_interface.h" using namespace CGAL::Three; -QMainWindow* Three::s_mainwindow = NULL; -Viewer_interface* Three::s_mainviewer = NULL; -Viewer_interface* Three::s_currentviewer = NULL; -Scene_interface* Three::s_scene = NULL; -QObject* Three::s_connectable_scene = NULL; -Three* Three::s_three = NULL; +QMainWindow* Three::s_mainwindow = nullptr; +Viewer_interface* Three::s_mainviewer = nullptr; +Viewer_interface* Three::s_currentviewer = nullptr; +Scene_interface* Three::s_scene = nullptr; +QObject* Three::s_connectable_scene = nullptr; +Three* Three::s_three = nullptr; RenderingMode Three::s_defaultSMRM; RenderingMode Three::s_defaultPSRM; int Three::default_point_size; diff --git a/Polyhedron/demo/Polyhedron/Triangle_container.cpp b/Polyhedron/demo/Polyhedron/Triangle_container.cpp index 28d4602e4973..ae6ee18ae715 100644 --- a/Polyhedron/demo/Polyhedron/Triangle_container.cpp +++ b/Polyhedron/demo/Polyhedron/Triangle_container.cpp @@ -25,7 +25,7 @@ Triangle_container::Triangle_container(int program, bool indexed) : Primitive_container(program, indexed), d(new Tri_d()) { - std::vector vbos(NbOfVbos, NULL); + std::vector vbos(NbOfVbos, nullptr); setVbos(vbos); } @@ -175,11 +175,11 @@ void Triangle_container::draw(Viewer_interface* viewer, if(getVao(viewer)->program->property("drawLinesAdjacency").toBool()) { viewer->glDrawElements(GL_LINES_ADJACENCY, static_cast(getIdxSize()), - GL_UNSIGNED_INT, 0 ); + GL_UNSIGNED_INT, nullptr ); } else{ viewer->glDrawElements(GL_TRIANGLES, static_cast(getIdxSize()), - GL_UNSIGNED_INT, 0 );} + GL_UNSIGNED_INT, nullptr );} getVbo(Vertex_indices)->release(); getVao(viewer)->release(); } diff --git a/Polyhedron/demo/Polyhedron/Use_ssh.cpp b/Polyhedron/demo/Polyhedron/Use_ssh.cpp index 0b3d93db7b7d..965abf23024f 100644 --- a/Polyhedron/demo/Polyhedron/Use_ssh.cpp +++ b/Polyhedron/demo/Polyhedron/Use_ssh.cpp @@ -111,7 +111,7 @@ bool establish_ssh_session(ssh_session &session, } ssh_key pubkey = ssh_key_new(); ssh_pki_import_pubkey_file(pub_key_path, &pubkey); - res = ssh_userauth_try_publickey(session, NULL, pubkey); + res = ssh_userauth_try_publickey(session, nullptr, pubkey); ssh_key_free(pubkey); if(res == SSH_AUTH_AGAIN) { @@ -129,14 +129,14 @@ bool establish_ssh_session(ssh_session &session, } ssh_key privkey = ssh_key_new(); - res = ssh_pki_import_privkey_file(priv_key_path, priv_key_password, NULL, NULL, &privkey); + res = ssh_pki_import_privkey_file(priv_key_path, priv_key_password, nullptr, nullptr, &privkey); if (!test_result(res)) { ssh_disconnect(session); ssh_key_free(privkey); return false; } - res = ssh_userauth_publickey(session, NULL, privkey); + res = ssh_userauth_publickey(session, nullptr, privkey); ssh_key_free(privkey); if(!test_result(res)) { @@ -199,7 +199,7 @@ bool establish_ssh_session_from_agent(ssh_session& session, } ssh_key pubkey = ssh_key_new(); ssh_pki_import_pubkey_file(pub_key_path, &pubkey); - res = ssh_userauth_try_publickey(session, NULL, pubkey); + res = ssh_userauth_try_publickey(session, nullptr, pubkey); ssh_key_free(pubkey); if(res == SSH_AUTH_AGAIN) ssh_disconnect(session); @@ -243,7 +243,7 @@ bool push_file(ssh_session &session, //copy a file ssh_scp scp = ssh_scp_new( session, SSH_SCP_WRITE | SSH_SCP_RECURSIVE, "/tmp"); - if (scp == NULL) + if (scp == nullptr) { std::cerr<<"Error allocating scp session: %s\n" << ssh_get_error(session)<spec_power = viewer_settings.value("spec_power", 51.8).toFloat(); - d->scene = 0; + d->scene = nullptr; d->projection_is_ortho = false; d->cam_sharing = false; d->twosides = false; @@ -776,7 +776,7 @@ void Viewer::turnCameraBy180Degres() { void Viewer_impl::draw_aux(bool with_names, Viewer* viewer) { - if(scene == 0) + if(scene == nullptr) return; current_total_pass = viewer->inFastDrawing() ? total_pass/2 : total_pass; viewer->setGlPointSize(2.f); @@ -1398,7 +1398,7 @@ QOpenGLShaderProgram* Viewer::getShaderProgram(int name) const if(!isOpenGL_4_3()) { std::cerr<<"An OpenGL context of version 4.3 is required for the program ("<setProperty("hasLight", true); @@ -1421,7 +1421,7 @@ QOpenGLShaderProgram* Viewer::getShaderProgram(int name) const if(!isOpenGL_4_3()) { std::cerr<<"An OpenGL context of version 4.3 is required for the program ("< - QObjectType* add (const char* name, const char* key = NULL) + QObjectType* add (const char* name, const char* key = nullptr) { - QObjectType* out = NULL; + QObjectType* out = nullptr; if (boost::is_same::value) { @@ -46,7 +46,7 @@ class QMultipleInputDialog form->addRow (QString(name), out); } - if (key != NULL) + if (key != nullptr) map_widgets.insert (std::make_pair (key, out)); return out; @@ -58,7 +58,7 @@ class QMultipleInputDialog typename std::map::const_iterator found = map_widgets.find (key); if (found == map_widgets.end()) - return NULL; + return nullptr; QWidget* widget_out = found->second; return qobject_cast(widget_out); diff --git a/Polyhedron/demo/Polyhedron/texture.cpp b/Polyhedron/demo/Polyhedron/texture.cpp index bb7d976e6790..836a4397534a 100644 --- a/Polyhedron/demo/Polyhedron/texture.cpp +++ b/Polyhedron/demo/Polyhedron/texture.cpp @@ -20,7 +20,7 @@ email : pierre.alliez@sophia.inria.fr //******************************************** Texture::Texture() { - m_pData = NULL; + m_pData = nullptr; m_Width = 0; m_WidthByte32 = 0; m_Height = 0; @@ -50,7 +50,7 @@ int Texture::Alloc(unsigned int width, unsigned int height, unsigned int depth) unsigned int Width32 = WidthByte32(width,depth); m_pData = new unsigned char [Width32 * height]; - if(m_pData == NULL) + if(m_pData == nullptr) { return 0; } @@ -70,10 +70,10 @@ int Texture::Alloc(unsigned int width, unsigned int height, unsigned int depth) //******************************************** void Texture::Free() { - if(m_pData != NULL) + if(m_pData != nullptr) { delete [] m_pData; - m_pData = NULL; + m_pData = nullptr; } m_Width = 0; m_Height = 0; @@ -128,7 +128,7 @@ int Texture::IsValid() success = (m_Depth == 24) || (m_Depth == 32); success &= (m_Width != 0); success &= (m_Height != 0); - success &= (m_pData != NULL); + success &= (m_pData != nullptr); return success; } @@ -242,7 +242,7 @@ int Texture::Extract(int left, int top, int right, int bottom) // Alloc unsigned char *pData = new unsigned char[NewWidthByte32*NewHeight]; - if(pData == NULL) + if(pData == nullptr) { //TRACE("Insufficiant memory"); return 0; @@ -293,7 +293,7 @@ int Texture::DuplicateMirror(int left, int top, int right, int bottom) // Alloc unsigned char *pData = new unsigned char[NewWidthByte32*NewHeight]; - if(pData == NULL) + if(pData == nullptr) { //TRACE("Insufficiant memory"); return 0; @@ -365,7 +365,7 @@ int Texture::DuplicateRepeatWidth(int left, int top, int right, int bottom) // Alloc unsigned char *pData = new unsigned char[NewWidthByte32*NewHeight]; - if(pData == NULL) + if(pData == nullptr) { ////TRACE("Insufficiant memory"); return 0; @@ -503,7 +503,7 @@ int Texture::AddAlphaLayer(unsigned char alpha) // 0 - 255 // Alloc memory unsigned char *pData = new unsigned char[4*m_Width*m_Height]; - if(pData == NULL) + if(pData == nullptr) { //TRACE("Texture::AddAlphaLayer : insufficiant memory"); return 0; @@ -576,7 +576,7 @@ int Texture::ReadBuffer(unsigned char *buffer, int height, int depth) { - if(buffer == NULL) + if(buffer == nullptr) return 0; if(!Alloc(width,height,depth)) @@ -605,7 +605,7 @@ int Texture::ReadBufferByte32(unsigned char *pData, if(!Alloc(width,height,32)) return 0; - if(pData == NULL) + if(pData == nullptr) return 0; memcpy(m_pData,pData,height*m_WidthByte32); @@ -619,7 +619,7 @@ int Texture::ReadBufferByte32(unsigned char *pData, void Texture::Copy(Texture *pTexture) { unsigned char *pBuffer = pTexture->GetData(); - if(pBuffer == NULL) + if(pBuffer == nullptr) return; unsigned int width = pTexture->GetWidth(); @@ -646,7 +646,7 @@ int Texture::ReadBuffer(float *buffer, int height, int depth) { - if(buffer == NULL) + if(buffer == nullptr) return 0; if(!Alloc(width,height,depth)) @@ -671,7 +671,7 @@ int Texture::ReadBuffer(float **ppBuffer, int height, float ratio) { - if(ppBuffer == NULL) + if(ppBuffer == nullptr) return 0; if(!Alloc(width,height,24)) @@ -694,7 +694,7 @@ int Texture::WriteBuffer(float **ppBuffer, int width, int height) { - if(ppBuffer == NULL) + if(ppBuffer == nullptr) return 0; for(int j=0;jinsert_constraint(previous, vh); last_inserted = previous; } diff --git a/Polyline_simplification_2/demo/Polyline_simplification_2/Polyline_simplification_2.cpp b/Polyline_simplification_2/demo/Polyline_simplification_2/Polyline_simplification_2.cpp index d5422722aab3..0bf0684ae3f0 100644 --- a/Polyline_simplification_2/demo/Polyline_simplification_2/Polyline_simplification_2.cpp +++ b/Polyline_simplification_2/demo/Polyline_simplification_2/Polyline_simplification_2.cpp @@ -32,7 +32,7 @@ void error_handler ( char const* what, char const* expr, char const* file, int l << "Expr: " << expr << std::endl << "File: " << file << std::endl << "Line: " << line << std::endl; - if ( msg != 0) + if ( msg != nullptr) std::cerr << "Explanation:" << msg << std::endl; throw std::runtime_error("CGAL Error"); diff --git a/Principal_component_analysis/demo/Principal_component_analysis/MainWindow.h b/Principal_component_analysis/demo/Principal_component_analysis/MainWindow.h index 2ace352b7d32..3f0394ea0e24 100644 --- a/Principal_component_analysis/demo/Principal_component_analysis/MainWindow.h +++ b/Principal_component_analysis/demo/Principal_component_analysis/MainWindow.h @@ -18,7 +18,7 @@ class MainWindow : { Q_OBJECT public: - MainWindow(QWidget* parent = 0); + MainWindow(QWidget* parent = nullptr); ~MainWindow(); public slots: diff --git a/Principal_component_analysis/demo/Principal_component_analysis/Scene.cpp b/Principal_component_analysis/demo/Principal_component_analysis/Scene.cpp index a4c60dd0a547..d3d0719edb38 100644 --- a/Principal_component_analysis/demo/Principal_component_analysis/Scene.cpp +++ b/Principal_component_analysis/demo/Principal_component_analysis/Scene.cpp @@ -19,7 +19,7 @@ Scene::Scene() { is_gl_init = false; - m_pPolyhedron = NULL; + m_pPolyhedron = nullptr; // view options m_view_polyhedron = true; @@ -48,7 +48,7 @@ int Scene::open(QString filename) return -1; } - if(m_pPolyhedron != NULL) + if(m_pPolyhedron != nullptr) delete m_pPolyhedron; // allocate new polyhedron @@ -60,7 +60,7 @@ int Scene::open(QString filename) QApplication::restoreOverrideCursor(); delete m_pPolyhedron; - m_pPolyhedron = NULL; + m_pPolyhedron = nullptr; return -1; } @@ -74,7 +74,7 @@ void Scene::update_bbox() std::cout << "Compute bbox..."; m_bbox = Bbox(); - if(m_pPolyhedron == NULL) + if(m_pPolyhedron == nullptr) { std::cout << "failed (no polyhedron)." << std::endl; return; @@ -190,7 +190,7 @@ Vector Scene::normalize(const Vector& v) void Scene::render_polyhedron(Viewer *viewer) { // draw black edges - if(m_pPolyhedron != NULL) + if(m_pPolyhedron != nullptr) { typedef Kernel::Point_3 Point; @@ -220,7 +220,7 @@ void Scene::render_polyhedron(Viewer *viewer) void Scene::refine_loop() { - if(m_pPolyhedron == NULL) + if(m_pPolyhedron == nullptr) { std::cout << "Load polyhedron first." << std::endl; return; diff --git a/Principal_component_analysis/demo/Principal_component_analysis/Viewer.cpp b/Principal_component_analysis/demo/Principal_component_analysis/Viewer.cpp index bba04edd834c..a750bd16ae9f 100644 --- a/Principal_component_analysis/demo/Principal_component_analysis/Viewer.cpp +++ b/Principal_component_analysis/demo/Principal_component_analysis/Viewer.cpp @@ -3,7 +3,7 @@ Viewer::Viewer(QWidget* parent) : CGAL::QGLViewer(parent), - m_pScene(NULL) + m_pScene(nullptr) { } @@ -15,7 +15,7 @@ void Viewer::setScene(Scene* pScene) void Viewer::draw() { CGAL::QGLViewer::draw(); - if(m_pScene != NULL) + if(m_pScene != nullptr) { glClearColor(1.0f,1.0f,1.0f,1.0f); m_pScene->draw(this); diff --git a/QP_solver/test/QP_solver/master_mps_to_derivatives.cpp b/QP_solver/test/QP_solver/master_mps_to_derivatives.cpp index 9e19b33f6ffb..22a72be23f9c 100644 --- a/QP_solver/test/QP_solver/master_mps_to_derivatives.cpp +++ b/QP_solver/test/QP_solver/master_mps_to_derivatives.cpp @@ -47,7 +47,7 @@ namespace QP_from_mps_detail { template struct MPS_type_name { - static const char *name() { return 0; } + static const char *name() { return nullptr; } }; template<> @@ -69,7 +69,7 @@ namespace QP_from_mps_detail { else if (boost::multiprecision::number_category::value == boost::multiprecision::number_kind_rational) return "rational"; else - return 0; + return nullptr; } }; #endif @@ -189,7 +189,7 @@ void write_MPS(std::ostream& out, const char *tn = QP_from_mps_detail::MPS_type_name ::value_type>::name(); - if (tn != 0) + if (tn != nullptr) out << "* Number-type: " << tn << "\n"; } else out << "* Number-type: " << number_type << "\n"; diff --git a/STL_Extension/test/STL_Extension/test_Compact_container.cpp b/STL_Extension/test/STL_Extension/test_Compact_container.cpp index 7be7166feff9..661ec453cbd7 100644 --- a/STL_Extension/test/STL_Extension/test_Compact_container.cpp +++ b/STL_Extension/test/STL_Extension/test_Compact_container.cpp @@ -65,7 +65,7 @@ class Node_2 public: Node_2() - : p(NULL), rnd(CGAL::get_default_random().get_int(0, 100)) {} + : p(nullptr), rnd(CGAL::get_default_random().get_int(0, 100)) {} bool operator==(const Node_2 &n) const { return rnd == n.rnd; } bool operator!=(const Node_2 &n) const { return rnd != n.rnd; } diff --git a/STL_Extension/test/STL_Extension/test_Compact_container_is_used.cpp b/STL_Extension/test/STL_Extension/test_Compact_container_is_used.cpp index 2d810602cde1..5a34b3b51099 100644 --- a/STL_Extension/test/STL_Extension/test_Compact_container_is_used.cpp +++ b/STL_Extension/test/STL_Extension/test_Compact_container_is_used.cpp @@ -11,7 +11,7 @@ class Node_1 public: - Node_1() : p(NULL) + Node_1() : p(nullptr) {} void * for_compact_container() const { return p_cc; } diff --git a/STL_Extension/test/STL_Extension/test_In_place_list.cpp b/STL_Extension/test/STL_Extension/test_In_place_list.cpp index d548c9d00767..112382b35cb6 100644 --- a/STL_Extension/test/STL_Extension/test_In_place_list.cpp +++ b/STL_Extension/test/STL_Extension/test_In_place_list.cpp @@ -56,8 +56,8 @@ struct Node { int key; Node* next; Node* prev; - Node() : key(0), next(0), prev(0) { next = prev = this; } - Node(int n) : key(n), next(0), prev(0) { next = prev = this; } + Node() : key(0), next(nullptr), prev(nullptr) { next = prev = this; } + Node(int n) : key(n), next(nullptr), prev(nullptr) { next = prev = this; } Node(Node* nx_, Node* pv_, int n) : key(n), next(nx_), prev(pv_) {} }; Node* new_node( Node* nx_, Node* pv_, int n) { @@ -106,8 +106,8 @@ class CNode { const CNode* next() const { return next_;} CNode* prev() { return prev_;} const CNode* prev() const { return prev_;} - CNode() : next_(0), prev_(0), key(0) { next_ = prev_ = this; } - CNode( int n) : next_(0), prev_(0), key(n) { next_ = prev_ = this; } + CNode() : next_(nullptr), prev_(nullptr), key(0) { next_ = prev_ = this; } + CNode( int n) : next_(nullptr), prev_(nullptr), key(n) { next_ = prev_ = this; } CNode( CNode* nx_, CNode* pv_, int n) : next_(nx_), prev_( pv_), key(n) {} friend CNode* new_cnode( CNode* nx_, CNode* pv_, int n); @@ -243,8 +243,8 @@ void test_In_place_list() { CGAL::Assert_is_at_least_forward_category(end); typedef std::iterator_traits< Iterator >::value_type VT; typedef std::iterator_traits< Iterator >::difference_type DT; - assert(1==test_value_type(static_cast< VT* >(0))); - assert(1==test_distance_type(static_cast< DT* >(0))); + assert(1==test_value_type(static_cast< VT* >(nullptr))); + assert(1==test_distance_type(static_cast< DT* >(nullptr))); // Default constructor. Iterator z = Iterator(); @@ -336,8 +336,8 @@ void test_In_place_list() { CGAL::Assert_is_at_least_forward_category(end); typedef std::iterator_traits< Iterator >::value_type VT; typedef std::iterator_traits< Iterator >::difference_type DT; - assert(1==test_value_type(static_cast< VT* >(0))); - assert(1==test_distance_type(static_cast< DT* >(0))); + assert(1==test_value_type(static_cast< VT* >(nullptr))); + assert(1==test_distance_type(static_cast< DT* >(nullptr))); // Default constructor. Iterator z = Iterator(); @@ -441,8 +441,8 @@ void test_In_place_list() { CGAL::Assert_is_at_least_forward_category(c_end); typedef std::iterator_traits< Const_iterator >::value_type VT; typedef std::iterator_traits< Const_iterator >::difference_type DT; - assert(1==test_value_type(static_cast< VT* >(0))); - assert(1==test_distance_type(static_cast< DT* >(0))); + assert(1==test_value_type(static_cast< VT* >(nullptr))); + assert(1==test_distance_type(static_cast< DT* >(nullptr))); // Default constructor. Const_iterator z = Const_iterator(); @@ -573,8 +573,8 @@ void test_In_place_list() { CGAL::Assert_is_at_least_forward_category(end); typedef std::iterator_traits< Iterator >::value_type VT; typedef std::iterator_traits< Iterator >::difference_type DT; - assert(1==test_value_type(static_cast< VT* >(0))); - assert(1==test_distance_type(static_cast< DT* >(0))); + assert(1==test_value_type(static_cast< VT* >(nullptr))); + assert(1==test_distance_type(static_cast< DT* >(nullptr))); // Default constructor. Iterator z = Iterator(); @@ -666,8 +666,8 @@ void test_In_place_list() { CGAL::Assert_is_at_least_forward_category(end); typedef std::iterator_traits< Iterator >::value_type VT; typedef std::iterator_traits< Iterator >::difference_type DT; - assert(1==test_value_type(static_cast< VT* >(0))); - assert(1==test_distance_type(static_cast< DT* >(0))); + assert(1==test_value_type(static_cast< VT* >(nullptr))); + assert(1==test_distance_type(static_cast< DT* >(nullptr))); // Default constructor. Iterator z = Iterator(); @@ -770,8 +770,8 @@ void test_In_place_list() { CGAL::Assert_is_at_least_forward_category(c_end); typedef std::iterator_traits< Const_iterator >::value_type VT; typedef std::iterator_traits< Const_iterator >::difference_type DT; - assert(1==test_value_type(static_cast< VT* >(0))); - assert(1==test_distance_type(static_cast< DT* >(0))); + assert(1==test_value_type(static_cast< VT* >(nullptr))); + assert(1==test_distance_type(static_cast< DT* >(nullptr))); // Default constructor. Const_iterator z = Const_iterator(); diff --git a/STL_Extension/test/STL_Extension/test_Object.cpp b/STL_Extension/test/STL_Extension/test_Object.cpp index 80b2a927930c..7ab6f7159483 100644 --- a/STL_Extension/test/STL_Extension/test_Object.cpp +++ b/STL_Extension/test/STL_Extension/test_Object.cpp @@ -47,8 +47,8 @@ void make_object_and_assign() { CGAL::Object o = CGAL::make_object(i); CGAL_assertion(CGAL::assign(j, o)); CGAL_assertion(j == i); - CGAL_assertion(CGAL::object_cast(&o) == NULL); - CGAL_assertion(CGAL::object_cast(&o) != NULL); + CGAL_assertion(CGAL::object_cast(&o) == nullptr); + CGAL_assertion(CGAL::object_cast(&o) != nullptr); } void safe_bool() { diff --git a/STL_Extension/test/STL_Extension/test_stl_extension.cpp b/STL_Extension/test/STL_Extension/test_stl_extension.cpp index c5d93db6ad17..eb1e6aa32701 100644 --- a/STL_Extension/test/STL_Extension/test_stl_extension.cpp +++ b/STL_Extension/test/STL_Extension/test_stl_extension.cpp @@ -97,8 +97,8 @@ struct Node { int key; Node* next; Node* prev; - Node() : key(0), next(0), prev(0) { next = prev = this; } - Node(int n) : key(n), next(0), prev(0) { next = prev = this; } + Node() : key(0), next(nullptr), prev(nullptr) { next = prev = this; } + Node(int n) : key(n), next(nullptr), prev(nullptr) { next = prev = this; } Node(Node* nx_, Node* pv_, int n) : key(n), next(nx_), prev(pv_) {} }; Node* new_node( Node* nx_, Node* pv_, int n) { @@ -147,8 +147,8 @@ class CNode { const CNode* next() const { return next_;} CNode* prev() { return prev_;} const CNode* prev() const { return prev_;} - CNode() : next_(0), prev_(0), key(0) { next_ = prev_ = this; } - CNode( int n) : next_(0), prev_(0), key(n) { next_ = prev_ = this; } + CNode() : next_(nullptr), prev_(nullptr), key(0) { next_ = prev_ = this; } + CNode( int n) : next_(nullptr), prev_(nullptr), key(n) { next_ = prev_ = this; } CNode( CNode* nx_, CNode* pv_, int n) : next_(nx_), prev_( pv_), key(n) {} friend CNode* new_cnode( CNode* nx_, CNode* pv_, int n); @@ -264,8 +264,8 @@ void test_Circulator_identity() { CGAL::Assert_is_at_least_forward_category(begin); typedef std::iterator_traits< Circulator >::value_type VT; typedef std::iterator_traits< Circulator >::difference_type DT; - assert(1==test_value_type(static_cast< VT* >(0))); - assert(1==test_distance_type(static_cast< DT* >(0))); + assert(1==test_value_type(static_cast< VT* >(nullptr))); + assert(1==test_distance_type(static_cast< DT* >(nullptr))); // Default constructor. Circulator z = Circulator(); @@ -356,8 +356,8 @@ void test_Circulator_identity() { CGAL::Assert_is_at_least_forward_category(begin); typedef std::iterator_traits< Circulator >::value_type VT; typedef std::iterator_traits< Circulator >::difference_type DT; - assert(1==test_value_type(static_cast< VT* >(0))); - assert(1==test_distance_type(static_cast< DT* >(0))); + assert(1==test_value_type(static_cast< VT* >(nullptr))); + assert(1==test_distance_type(static_cast< DT* >(nullptr))); // Default constructor. Circulator z = Circulator(); @@ -471,11 +471,11 @@ void test_Circulator_identity() { // Check tests for empty data structures. Circulator z = Circulator(); - assert( z == NULL); - assert( ! (z != NULL)); + assert( z == nullptr); + assert( ! (z != nullptr)); Circulator i = begin; - assert( ! (i == NULL)); - assert( i != NULL); + assert( ! (i == nullptr)); + assert( i != nullptr); assert( i == begin); assert( i == begin); // Do I reach myself. @@ -521,8 +521,8 @@ Assert_bidirectional_category(c_begin); CGAL::Assert_is_at_least_forward_category(c_begin); typedef std::iterator_traits< C_Circulator >::value_type VT; typedef std::iterator_traits< C_Circulator >::difference_type DT; - assert(1==test_value_type(static_cast< VT* >(0))); - assert(1==test_distance_type(static_cast< DT* >(0))); + assert(1==test_value_type(static_cast< VT* >(nullptr))); + assert(1==test_distance_type(static_cast< DT* >(nullptr))); // Default constructor. C_Circulator z = C_Circulator(); @@ -636,11 +636,11 @@ Assert_bidirectional_category(c_begin); // Check tests for empty data structures. C_Circulator z = C_Circulator(); - assert( z == NULL); - assert( ! (z != NULL)); + assert( z == nullptr); + assert( ! (z != nullptr)); C_Circulator i = c_begin; - assert( ! (i == NULL)); - assert( i != NULL); + assert( ! (i == nullptr)); + assert( i != nullptr); assert( i == c_begin); assert( i == c_begin); // Do I reach myself. @@ -693,8 +693,8 @@ l2.destroy(); CGAL::Assert_is_at_least_forward_category(begin); typedef std::iterator_traits< Circulator >::value_type VT; typedef std::iterator_traits< Circulator >::difference_type DT; - assert(1==test_value_type(static_cast< VT* >(0))); - assert(1==test_distance_type(static_cast< DT* >(0))); + assert(1==test_value_type(static_cast< VT* >(nullptr))); + assert(1==test_distance_type(static_cast< DT* >(nullptr))); // Default constructor. Circulator z; @@ -785,8 +785,8 @@ l2.destroy(); CGAL::Assert_is_at_least_forward_category(begin); typedef std::iterator_traits< Circulator >::value_type VT; typedef std::iterator_traits< Circulator >::difference_type DT; - assert(1==test_value_type(static_cast< VT* >(0))); - assert(1==test_distance_type(static_cast< DT* >(0))); + assert(1==test_value_type(static_cast< VT* >(nullptr))); + assert(1==test_distance_type(static_cast< DT* >(nullptr))); // Default constructor. Circulator z = Circulator(); @@ -880,8 +880,8 @@ l2.destroy(); CGAL::Assert_is_at_least_forward_category(begin); typedef std::iterator_traits< Circulator >::value_type VT; typedef std::iterator_traits< Circulator >::difference_type DT; - assert(1==test_value_type(static_cast< VT* >(0))); - assert(1==test_distance_type(static_cast< DT* >(0))); + assert(1==test_value_type(static_cast< VT* >(nullptr))); + assert(1==test_distance_type(static_cast< DT* >(nullptr))); // Default constructor. Circulator z = Circulator(); @@ -1058,11 +1058,11 @@ l2.destroy(); // Check tests for empty data structures. Circulator z = Circulator(); - assert( z == NULL); - assert( ! (z != NULL)); + assert( z == nullptr); + assert( ! (z != nullptr)); Circulator i = begin; - assert( ! (i == NULL)); - assert( i != NULL); + assert( ! (i == nullptr)); + assert( i != nullptr); assert( i == begin); assert( i == begin); // Do I reach myself. @@ -1131,8 +1131,8 @@ Assert_random_access_category(c_begin); CGAL::Assert_is_at_least_forward_category(c_begin); typedef std::iterator_traits< C_Circulator >::value_type VT; typedef std::iterator_traits< C_Circulator >::difference_type DT; - assert(1==test_value_type(static_cast< VT* >(0))); - assert(1==test_distance_type(static_cast< DT* >(0))); + assert(1==test_value_type(static_cast< VT* >(nullptr))); + assert(1==test_distance_type(static_cast< DT* >(nullptr))); // Default constructor. C_Circulator z = C_Circulator(); @@ -1289,11 +1289,11 @@ Assert_random_access_category(c_begin); // Check tests for empty data structures. C_Circulator z = C_Circulator(); - assert( z == NULL); - assert( ! (z != NULL)); + assert( z == nullptr); + assert( ! (z != nullptr)); C_Circulator i = c_begin; - assert( ! (i == NULL)); - assert( i != NULL); + assert( ! (i == nullptr)); + assert( i != nullptr); assert( i == c_begin); assert( i == c_begin); // Do I reach myself. @@ -1372,8 +1372,8 @@ void test_Iterator_project() CGAL::Assert_is_at_least_forward_category(end); typedef std::iterator_traits< Iterator >::value_type VT; typedef std::iterator_traits< Iterator >::difference_type DT; - assert(1==test_value_type(static_cast< VT* >(0))); - assert(1==test_distance_type(static_cast< DT* >(0))); + assert(1==test_value_type(static_cast< VT* >(nullptr))); + assert(1==test_distance_type(static_cast< DT* >(nullptr))); // Default constructor. Iterator z ; @@ -1465,8 +1465,8 @@ void test_Iterator_project() CGAL::Assert_is_at_least_forward_category(end); typedef std::iterator_traits< Iterator >::value_type VT; typedef std::iterator_traits< Iterator >::difference_type DT; - assert(1==test_value_type(static_cast< VT* >(0))); - assert(1==test_distance_type(static_cast< DT* >(0))); + assert(1==test_value_type(static_cast< VT* >(nullptr))); + assert(1==test_distance_type(static_cast< DT* >(nullptr))); // Default constructor. Iterator z ; @@ -1573,8 +1573,8 @@ void test_Iterator_project() CGAL::Assert_is_at_least_forward_category(c_end); typedef std::iterator_traits< C_Iterator >::value_type VT; typedef std::iterator_traits< C_Iterator >::difference_type DT; - assert(1==test_value_type(static_cast< VT* >(0))); - assert(1==test_distance_type(static_cast< DT* >(0))); + assert(1==test_value_type(static_cast< VT* >(nullptr))); + assert(1==test_distance_type(static_cast< DT* >(nullptr))); // Default constructor. C_Iterator z ; @@ -1697,8 +1697,8 @@ void test_Iterator_project() CGAL::Assert_is_at_least_forward_category(end); typedef std::iterator_traits< Iterator >::value_type VT; typedef std::iterator_traits< Iterator >::difference_type DT; - assert(1==test_value_type(static_cast< VT* >(0))); - assert(1==test_distance_type(static_cast< DT* >(0))); + assert(1==test_value_type(static_cast< VT* >(nullptr))); + assert(1==test_distance_type(static_cast< DT* >(nullptr))); // Default constructor. Iterator z ; @@ -1790,8 +1790,8 @@ void test_Iterator_project() CGAL::Assert_is_at_least_forward_category(end); typedef std::iterator_traits< Iterator >::value_type VT; typedef std::iterator_traits< Iterator >::difference_type DT; - assert(1==test_value_type(static_cast< VT* >(0))); - assert(1==test_distance_type(static_cast< DT* >(0))); + assert(1==test_value_type(static_cast< VT* >(nullptr))); + assert(1==test_distance_type(static_cast< DT* >(nullptr))); // Default constructor. Iterator z ; @@ -1900,8 +1900,8 @@ void test_Iterator_project() CGAL::Assert_is_at_least_forward_category(c_end); typedef std::iterator_traits< C_Iterator >::value_type VT; typedef std::iterator_traits< C_Iterator >::difference_type DT; - assert(1==test_value_type(static_cast< VT* >(0))); - assert(1==test_distance_type(static_cast< DT* >(0))); + assert(1==test_value_type(static_cast< VT* >(nullptr))); + assert(1==test_distance_type(static_cast< DT* >(nullptr))); // Default constructor. C_Iterator z ; @@ -2025,8 +2025,8 @@ void test_Iterator_project() CGAL::Assert_is_at_least_forward_category(end); typedef std::iterator_traits< Iterator >::value_type VT; typedef std::iterator_traits< Iterator >::difference_type DT; - assert(1==test_value_type(static_cast< VT* >(0))); - assert(1==test_distance_type(static_cast< DT* >(0))); + assert(1==test_value_type(static_cast< VT* >(nullptr))); + assert(1==test_distance_type(static_cast< DT* >(nullptr))); // Default constructor. Iterator z ; @@ -2118,8 +2118,8 @@ void test_Iterator_project() CGAL::Assert_is_at_least_forward_category(end); typedef std::iterator_traits< Iterator >::value_type VT; typedef std::iterator_traits< Iterator >::difference_type DT; - assert(1==test_value_type(static_cast< VT* >(0))); - assert(1==test_distance_type(static_cast< DT* >(0))); + assert(1==test_value_type(static_cast< VT* >(nullptr))); + assert(1==test_distance_type(static_cast< DT* >(nullptr))); // Default constructor. Iterator z ; @@ -2215,8 +2215,8 @@ void test_Iterator_project() CGAL::Assert_is_at_least_forward_category(end); typedef std::iterator_traits< Iterator >::value_type VT; typedef std::iterator_traits< Iterator >::difference_type DT; - assert(1==test_value_type(static_cast< VT* >(0))); - assert(1==test_distance_type(static_cast< DT* >(0))); + assert(1==test_value_type(static_cast< VT* >(nullptr))); + assert(1==test_distance_type(static_cast< DT* >(nullptr))); // Default constructor. Iterator z ; @@ -2412,8 +2412,8 @@ void test_Iterator_project() CGAL::Assert_is_at_least_forward_category(c_end); typedef std::iterator_traits< C_Iterator >::value_type VT; typedef std::iterator_traits< C_Iterator >::difference_type DT; - assert(1==test_value_type(static_cast< VT* >(0))); - assert(1==test_distance_type(static_cast< DT* >(0))); + assert(1==test_value_type(static_cast< VT* >(nullptr))); + assert(1==test_distance_type(static_cast< DT* >(nullptr))); // Default constructor. C_Iterator z ; @@ -2601,8 +2601,8 @@ void test_Iterator_project() CGAL::Assert_is_at_least_forward_category(end); typedef std::iterator_traits< Iterator >::value_type VT; typedef std::iterator_traits< Iterator >::difference_type DT; - assert(1==test_value_type(static_cast< VT* >(0))); - assert(1==test_distance_type(static_cast< DT* >(0))); + assert(1==test_value_type(static_cast< VT* >(nullptr))); + assert(1==test_distance_type(static_cast< DT* >(nullptr))); // Default constructor. Iterator z ; @@ -2694,8 +2694,8 @@ void test_Iterator_project() CGAL::Assert_is_at_least_forward_category(end); typedef std::iterator_traits< Iterator >::value_type VT; typedef std::iterator_traits< Iterator >::difference_type DT; - assert(1==test_value_type(static_cast< VT* >(0))); - assert(1==test_distance_type(static_cast< DT* >(0))); + assert(1==test_value_type(static_cast< VT* >(nullptr))); + assert(1==test_distance_type(static_cast< DT* >(nullptr))); // Default constructor. Iterator z ; @@ -2801,8 +2801,8 @@ void test_Iterator_project() CGAL::Assert_is_at_least_forward_category(c_end); typedef std::iterator_traits< C_Iterator >::value_type VT; typedef std::iterator_traits< C_Iterator >::difference_type DT; - assert(1==test_value_type(static_cast< VT* >(0))); - assert(1==test_distance_type(static_cast< DT* >(0))); + assert(1==test_value_type(static_cast< VT* >(nullptr))); + assert(1==test_distance_type(static_cast< DT* >(nullptr))); // Default constructor. C_Iterator z ; @@ -2929,8 +2929,8 @@ void test_Iterator_project() CGAL::Assert_is_at_least_forward_category(end); typedef std::iterator_traits< Iterator >::value_type VT; typedef std::iterator_traits< Iterator >::difference_type DT; - assert(1==test_value_type(static_cast< VT* >(0))); - assert(1==test_distance_type(static_cast< DT* >(0))); + assert(1==test_value_type(static_cast< VT* >(nullptr))); + assert(1==test_distance_type(static_cast< DT* >(nullptr))); // Default constructor. Iterator z ; @@ -3022,8 +3022,8 @@ void test_Iterator_project() CGAL::Assert_is_at_least_forward_category(end); typedef std::iterator_traits< Iterator >::value_type VT; typedef std::iterator_traits< Iterator >::difference_type DT; - assert(1==test_value_type(static_cast< VT* >(0))); - assert(1==test_distance_type(static_cast< DT* >(0))); + assert(1==test_value_type(static_cast< VT* >(nullptr))); + assert(1==test_distance_type(static_cast< DT* >(nullptr))); // Default constructor. Iterator z ; @@ -3132,8 +3132,8 @@ void test_Iterator_project() CGAL::Assert_is_at_least_forward_category(c_end); typedef std::iterator_traits< C_Iterator >::value_type VT; typedef std::iterator_traits< C_Iterator >::difference_type DT; - assert(1==test_value_type(static_cast< VT* >(0))); - assert(1==test_distance_type(static_cast< DT* >(0))); + assert(1==test_value_type(static_cast< VT* >(nullptr))); + assert(1==test_distance_type(static_cast< DT* >(nullptr))); // Default constructor. C_Iterator z ; @@ -3258,8 +3258,8 @@ void test_Iterator_transform() typedef std::iterator_traits< Iterator >::value_type VT; typedef std::iterator_traits< Iterator >::difference_type DT; - assert(1==test_value_type(static_cast< VT* >(0))); - assert(1==test_distance_type(static_cast< DT* >(0))); + assert(1==test_value_type(static_cast< VT* >(nullptr))); + assert(1==test_distance_type(static_cast< DT* >(nullptr))); assert( CGAL::is_empty_range( end , end) ); assert( ! CGAL::is_empty_range( begin, end) ); @@ -3382,8 +3382,8 @@ void test_Circulator_project() { CGAL::Assert_is_at_least_forward_category(begin); typedef std::iterator_traits< Circulator >::value_type VT; typedef std::iterator_traits< Circulator >::difference_type DT; - assert(1==test_value_type(static_cast< VT* >(0))); - assert(1==test_distance_type(static_cast< DT* >(0))); + assert(1==test_value_type(static_cast< VT* >(nullptr))); + assert(1==test_distance_type(static_cast< DT* >(nullptr))); // Default constructor. Circulator z = Circulator(); @@ -3474,8 +3474,8 @@ void test_Circulator_project() { CGAL::Assert_is_at_least_forward_category(begin); typedef std::iterator_traits< Circulator >::value_type VT; typedef std::iterator_traits< Circulator >::difference_type DT; - assert(1==test_value_type(static_cast< VT* >(0))); - assert(1==test_distance_type(static_cast< DT* >(0))); + assert(1==test_value_type(static_cast< VT* >(nullptr))); + assert(1==test_distance_type(static_cast< DT* >(nullptr))); // Default constructor. Circulator z = Circulator(); @@ -3589,11 +3589,11 @@ void test_Circulator_project() { // Check tests for empty data structures. Circulator z = Circulator(); - assert( z == NULL); - assert( ! (z != NULL)); + assert( z == nullptr); + assert( ! (z != nullptr)); Circulator i = begin; - assert( ! (i == NULL)); - assert( i != NULL); + assert( ! (i == nullptr)); + assert( i != nullptr); assert( i == begin); assert( i == begin); // Do I reach myself. @@ -3639,8 +3639,8 @@ Assert_bidirectional_category(c_begin); CGAL::Assert_is_at_least_forward_category(c_begin); typedef std::iterator_traits< C_Circulator >::value_type VT; typedef std::iterator_traits< C_Circulator >::difference_type DT; - assert(1==test_value_type(static_cast< VT* >(0))); - assert(1==test_distance_type(static_cast< DT* >(0))); + assert(1==test_value_type(static_cast< VT* >(nullptr))); + assert(1==test_distance_type(static_cast< DT* >(nullptr))); // Default constructor. C_Circulator z = C_Circulator(); @@ -3754,11 +3754,11 @@ Assert_bidirectional_category(c_begin); // Check tests for empty data structures. C_Circulator z = C_Circulator(); - assert( z == NULL); - assert( ! (z != NULL)); + assert( z == nullptr); + assert( ! (z != nullptr)); C_Circulator i = c_begin; - assert( ! (i == NULL)); - assert( i != NULL); + assert( ! (i == nullptr)); + assert( i != nullptr); assert( i == c_begin); assert( i == c_begin); // Do I reach myself. @@ -3813,8 +3813,8 @@ l2.destroy(); CGAL::Assert_is_at_least_forward_category(begin); typedef std::iterator_traits< Circulator >::value_type VT; typedef std::iterator_traits< Circulator >::difference_type DT; - assert(1==test_value_type(static_cast< VT* >(0))); - assert(1==test_distance_type(static_cast< DT* >(0))); + assert(1==test_value_type(static_cast< VT* >(nullptr))); + assert(1==test_distance_type(static_cast< DT* >(nullptr))); // Default constructor. Circulator z = Circulator(); @@ -3905,8 +3905,8 @@ l2.destroy(); CGAL::Assert_is_at_least_forward_category(begin); typedef std::iterator_traits< Circulator >::value_type VT; typedef std::iterator_traits< Circulator >::difference_type DT; - assert(1==test_value_type(static_cast< VT* >(0))); - assert(1==test_distance_type(static_cast< DT* >(0))); + assert(1==test_value_type(static_cast< VT* >(nullptr))); + assert(1==test_distance_type(static_cast< DT* >(nullptr))); // Default constructor. Circulator z = Circulator(); @@ -4020,11 +4020,11 @@ l2.destroy(); // Check tests for empty data structures. Circulator z = Circulator(); - assert( z == NULL); - assert( ! (z != NULL)); + assert( z == nullptr); + assert( ! (z != nullptr)); Circulator i = begin; - assert( ! (i == NULL)); - assert( i != NULL); + assert( ! (i == nullptr)); + assert( i != nullptr); assert( i == begin); assert( i == begin); // Do I reach myself. @@ -4070,8 +4070,8 @@ Assert_bidirectional_category(c_begin); CGAL::Assert_is_at_least_forward_category(c_begin); typedef std::iterator_traits< C_Circulator >::value_type VT; typedef std::iterator_traits< C_Circulator >::difference_type DT; - assert(1==test_value_type(static_cast< VT* >(0))); - assert(1==test_distance_type(static_cast< DT* >(0))); + assert(1==test_value_type(static_cast< VT* >(nullptr))); + assert(1==test_distance_type(static_cast< DT* >(nullptr))); // Default constructor. C_Circulator z = C_Circulator(); @@ -4185,11 +4185,11 @@ Assert_bidirectional_category(c_begin); // Check tests for empty data structures. C_Circulator z = C_Circulator(); - assert( z == NULL); - assert( ! (z != NULL)); + assert( z == nullptr); + assert( ! (z != nullptr)); C_Circulator i = c_begin; - assert( ! (i == NULL)); - assert( i != NULL); + assert( ! (i == nullptr)); + assert( i != nullptr); assert( i == c_begin); assert( i == c_begin); // Do I reach myself. @@ -4244,8 +4244,8 @@ l2.destroy(); CGAL::Assert_is_at_least_forward_category(begin); typedef std::iterator_traits< Circulator >::value_type VT; typedef std::iterator_traits< Circulator >::difference_type DT; - assert(1==test_value_type(static_cast< VT* >(0))); - assert(1==test_distance_type(static_cast< DT* >(0))); + assert(1==test_value_type(static_cast< VT* >(nullptr))); + assert(1==test_distance_type(static_cast< DT* >(nullptr))); // Default constructor. Circulator z = Circulator(); @@ -4336,8 +4336,8 @@ l2.destroy(); CGAL::Assert_is_at_least_forward_category(begin); typedef std::iterator_traits< Circulator >::value_type VT; typedef std::iterator_traits< Circulator >::difference_type DT; - assert(1==test_value_type(static_cast< VT* >(0))); - assert(1==test_distance_type(static_cast< DT* >(0))); + assert(1==test_value_type(static_cast< VT* >(nullptr))); + assert(1==test_distance_type(static_cast< DT* >(nullptr))); // Default constructor. Circulator z = Circulator(); @@ -4431,8 +4431,8 @@ l2.destroy(); CGAL::Assert_is_at_least_forward_category(begin); typedef std::iterator_traits< Circulator >::value_type VT; typedef std::iterator_traits< Circulator >::difference_type DT; - assert(1==test_value_type(static_cast< VT* >(0))); - assert(1==test_distance_type(static_cast< DT* >(0))); + assert(1==test_value_type(static_cast< VT* >(nullptr))); + assert(1==test_distance_type(static_cast< DT* >(nullptr))); // Default constructor. Circulator z = Circulator(); @@ -4609,11 +4609,11 @@ l2.destroy(); // Check tests for empty data structures. Circulator z = Circulator(); - assert( z == NULL); - assert( ! (z != NULL)); + assert( z == nullptr); + assert( ! (z != nullptr)); Circulator i = begin; - assert( ! (i == NULL)); - assert( i != NULL); + assert( ! (i == nullptr)); + assert( i != nullptr); assert( i == begin); assert( i == begin); // Do I reach myself. @@ -4682,8 +4682,8 @@ Assert_random_access_category(c_begin); CGAL::Assert_is_at_least_forward_category(c_begin); typedef std::iterator_traits< C_Circulator >::value_type VT; typedef std::iterator_traits< C_Circulator >::difference_type DT; - assert(1==test_value_type(static_cast< VT* >(0))); - assert(1==test_distance_type(static_cast< DT* >(0))); + assert(1==test_value_type(static_cast< VT* >(nullptr))); + assert(1==test_distance_type(static_cast< DT* >(nullptr))); // Default constructor. C_Circulator z = C_Circulator(); @@ -4840,11 +4840,11 @@ Assert_random_access_category(c_begin); // Check tests for empty data structures. C_Circulator z = C_Circulator(); - assert( z == NULL); - assert( ! (z != NULL)); + assert( z == nullptr); + assert( ! (z != nullptr)); C_Circulator i = c_begin; - assert( ! (i == NULL)); - assert( i != NULL); + assert( ! (i == nullptr)); + assert( i != nullptr); assert( i == c_begin); assert( i == c_begin); // Do I reach myself. @@ -4899,7 +4899,7 @@ Assert_random_access_category(c_begin); struct NN { NN* nn; int key; - NN() : nn(0), key(-1) {} + NN() : nn(nullptr), key(-1) {} NN( int k, NN* p) : nn(p), key(k) {} NN* next() { return nn; } const NN* next() const { return nn; } @@ -4908,7 +4908,7 @@ int test_value_type( NN*) { return 1;} void test_Circulator_on_node() { { - NN* end = new NN( 5, 0); + NN* end = new NN( 5, nullptr); NN* p = new NN( 4, end); NN* start = new NN( 3, p); p = new NN( 2, start); @@ -4931,8 +4931,8 @@ void test_Circulator_on_node() { CGAL::Assert_is_at_least_forward_category(begin); typedef std::iterator_traits< Circulator >::value_type VT; typedef std::iterator_traits< Circulator >::difference_type DT; - assert(1==test_value_type(static_cast< VT* >(0))); - assert(1==test_distance_type(static_cast< DT* >(0))); + assert(1==test_value_type(static_cast< VT* >(nullptr))); + assert(1==test_distance_type(static_cast< DT* >(nullptr))); // Default constructor. Circulator z = Circulator(); @@ -5043,11 +5043,11 @@ void test_Circulator_on_node() { // Check tests for empty data structures. Circulator z = Circulator(); - assert( z == NULL); - assert( ! (z != NULL)); + assert( z == nullptr); + assert( ! (z != nullptr)); Circulator i = begin; - assert( ! (i == NULL)); - assert( i != NULL); + assert( ! (i == nullptr)); + assert( i != nullptr); assert( i == begin); assert( i == begin); // Do I reach myself. @@ -5079,8 +5079,8 @@ void test_Circulator_on_node() { CGAL::Assert_is_at_least_forward_category(c_begin); typedef std::iterator_traits< C_Circulator >::value_type VT; typedef std::iterator_traits< C_Circulator >::difference_type DT; - assert(1==test_value_type(static_cast< VT* >(0))); - assert(1==test_distance_type(static_cast< DT* >(0))); + assert(1==test_value_type(static_cast< VT* >(nullptr))); + assert(1==test_distance_type(static_cast< DT* >(nullptr))); // Default constructor. C_Circulator z = C_Circulator(); @@ -5158,11 +5158,11 @@ void test_Circulator_on_node() { // Check tests for empty data structures. C_Circulator z = C_Circulator(); - assert( z == NULL); - assert( ! (z != NULL)); + assert( z == nullptr); + assert( ! (z != nullptr)); C_Circulator i = c_begin; - assert( ! (i == NULL)); - assert( i != NULL); + assert( ! (i == nullptr)); + assert( i != nullptr); assert( i == c_begin); assert( i == c_begin); // Do I reach myself. @@ -5213,8 +5213,8 @@ void test_N_step_adaptor() { CGAL::Assert_is_at_least_forward_category(end); typedef std::iterator_traits< Iterator >::value_type VT; typedef std::iterator_traits< Iterator >::difference_type DT; - assert(1==test_value_type(static_cast< VT* >(0))); - assert(1==test_distance_type(static_cast< DT* >(0))); + assert(1==test_value_type(static_cast< VT* >(nullptr))); + assert(1==test_distance_type(static_cast< DT* >(nullptr))); // Default constructor. Iterator z ; @@ -5306,8 +5306,8 @@ void test_N_step_adaptor() { CGAL::Assert_is_at_least_forward_category(end); typedef std::iterator_traits< Iterator >::value_type VT; typedef std::iterator_traits< Iterator >::difference_type DT; - assert(1==test_value_type(static_cast< VT* >(0))); - assert(1==test_distance_type(static_cast< DT* >(0))); + assert(1==test_value_type(static_cast< VT* >(nullptr))); + assert(1==test_distance_type(static_cast< DT* >(nullptr))); // Default constructor. Iterator z ; @@ -5413,8 +5413,8 @@ Assert_bidirectional_category(c_end); CGAL::Assert_is_at_least_forward_category(c_end); typedef std::iterator_traits< C_Iterator >::value_type VT; typedef std::iterator_traits< C_Iterator >::difference_type DT; - assert(1==test_value_type(static_cast< VT* >(0))); - assert(1==test_distance_type(static_cast< DT* >(0))); + assert(1==test_value_type(static_cast< VT* >(nullptr))); + assert(1==test_distance_type(static_cast< DT* >(nullptr))); // Default constructor. C_Iterator z ; @@ -5534,8 +5534,8 @@ l2.destroy(); CGAL::Assert_is_at_least_forward_category(end); typedef std::iterator_traits< Iterator >::value_type VT; typedef std::iterator_traits< Iterator >::difference_type DT; - assert(1==test_value_type(static_cast< VT* >(0))); - assert(1==test_distance_type(static_cast< DT* >(0))); + assert(1==test_value_type(static_cast< VT* >(nullptr))); + assert(1==test_distance_type(static_cast< DT* >(nullptr))); // Default constructor. Iterator z ; @@ -5627,8 +5627,8 @@ l2.destroy(); CGAL::Assert_is_at_least_forward_category(end); typedef std::iterator_traits< Iterator >::value_type VT; typedef std::iterator_traits< Iterator >::difference_type DT; - assert(1==test_value_type(static_cast< VT* >(0))); - assert(1==test_distance_type(static_cast< DT* >(0))); + assert(1==test_value_type(static_cast< VT* >(nullptr))); + assert(1==test_distance_type(static_cast< DT* >(nullptr))); // Default constructor. Iterator z ; @@ -5723,8 +5723,8 @@ l2.destroy(); CGAL::Assert_is_at_least_forward_category(end); typedef std::iterator_traits< Iterator >::value_type VT; typedef std::iterator_traits< Iterator >::difference_type DT; - assert(1==test_value_type(static_cast< VT* >(0))); - assert(1==test_distance_type(static_cast< DT* >(0))); + assert(1==test_value_type(static_cast< VT* >(nullptr))); + assert(1==test_distance_type(static_cast< DT* >(nullptr))); // Default constructor. Iterator z ; @@ -5917,8 +5917,8 @@ l2.destroy(); CGAL::Assert_is_at_least_forward_category(c_end); typedef std::iterator_traits< C_Iterator >::value_type VT; typedef std::iterator_traits< C_Iterator >::difference_type DT; - assert(1==test_value_type(static_cast< VT* >(0))); - assert(1==test_distance_type(static_cast< DT* >(0))); + assert(1==test_value_type(static_cast< VT* >(nullptr))); + assert(1==test_distance_type(static_cast< DT* >(nullptr))); // Default constructor. C_Iterator z ; @@ -6103,8 +6103,8 @@ l2.destroy(); CGAL::Assert_is_at_least_forward_category(begin); typedef std::iterator_traits< Circulator >::value_type VT; typedef std::iterator_traits< Circulator >::difference_type DT; - assert(1==test_value_type(static_cast< VT* >(0))); - assert(1==test_distance_type(static_cast< DT* >(0))); + assert(1==test_value_type(static_cast< VT* >(nullptr))); + assert(1==test_distance_type(static_cast< DT* >(nullptr))); // Default constructor. Circulator z = Circulator(); @@ -6195,8 +6195,8 @@ l2.destroy(); CGAL::Assert_is_at_least_forward_category(begin); typedef std::iterator_traits< Circulator >::value_type VT; typedef std::iterator_traits< Circulator >::difference_type DT; - assert(1==test_value_type(static_cast< VT* >(0))); - assert(1==test_distance_type(static_cast< DT* >(0))); + assert(1==test_value_type(static_cast< VT* >(nullptr))); + assert(1==test_distance_type(static_cast< DT* >(nullptr))); // Default constructor. Circulator z = Circulator(); @@ -6290,8 +6290,8 @@ l2.destroy(); CGAL::Assert_is_at_least_forward_category(begin); typedef std::iterator_traits< Circulator >::value_type VT; typedef std::iterator_traits< Circulator >::difference_type DT; - assert(1==test_value_type(static_cast< VT* >(0))); - assert(1==test_distance_type(static_cast< DT* >(0))); + assert(1==test_value_type(static_cast< VT* >(nullptr))); + assert(1==test_distance_type(static_cast< DT* >(nullptr))); // Default constructor. Circulator z = Circulator(); @@ -6468,11 +6468,11 @@ l2.destroy(); // Check tests for empty data structures. Circulator z = Circulator(); - assert( z == NULL); - assert( ! (z != NULL)); + assert( z == nullptr); + assert( ! (z != nullptr)); Circulator i = begin; - assert( ! (i == NULL)); - assert( i != NULL); + assert( ! (i == nullptr)); + assert( i != nullptr); assert( i == begin); assert( i == begin); // Do I reach myself. @@ -6540,8 +6540,8 @@ Assert_random_access_category(c_begin); CGAL::Assert_is_at_least_forward_category(c_begin); typedef std::iterator_traits< C_Circulator >::value_type VT; typedef std::iterator_traits< C_Circulator >::difference_type DT; - assert(1==test_value_type(static_cast< VT* >(0))); - assert(1==test_distance_type(static_cast< DT* >(0))); + assert(1==test_value_type(static_cast< VT* >(nullptr))); + assert(1==test_distance_type(static_cast< DT* >(nullptr))); // Default constructor. C_Circulator z = C_Circulator(); @@ -6698,11 +6698,11 @@ Assert_random_access_category(c_begin); // Check tests for empty data structures. C_Circulator z = C_Circulator(); - assert( z == NULL); - assert( ! (z != NULL)); + assert( z == nullptr); + assert( ! (z != nullptr)); C_Circulator i = c_begin; - assert( ! (i == NULL)); - assert( i != NULL); + assert( ! (i == nullptr)); + assert( i != nullptr); assert( i == c_begin); assert( i == c_begin); // Do I reach myself. @@ -6783,8 +6783,8 @@ void test_N_step_adaptor_derived() { CGAL::Assert_is_at_least_forward_category(end); typedef std::iterator_traits< Iterator >::value_type VT; typedef std::iterator_traits< Iterator >::difference_type DT; - assert(1==test_value_type(static_cast< VT* >(0))); - assert(1==test_distance_type(static_cast< DT* >(0))); + assert(1==test_value_type(static_cast< VT* >(nullptr))); + assert(1==test_distance_type(static_cast< DT* >(nullptr))); // Default constructor. Iterator z ; @@ -6876,8 +6876,8 @@ void test_N_step_adaptor_derived() { CGAL::Assert_is_at_least_forward_category(end); typedef std::iterator_traits< Iterator >::value_type VT; typedef std::iterator_traits< Iterator >::difference_type DT; - assert(1==test_value_type(static_cast< VT* >(0))); - assert(1==test_distance_type(static_cast< DT* >(0))); + assert(1==test_value_type(static_cast< VT* >(nullptr))); + assert(1==test_distance_type(static_cast< DT* >(nullptr))); // Default constructor. Iterator z ; @@ -6983,8 +6983,8 @@ void test_N_step_adaptor_derived() { CGAL::Assert_is_at_least_forward_category(c_end); typedef std::iterator_traits< C_Iterator >::value_type VT; typedef std::iterator_traits< C_Iterator >::difference_type DT; - assert(1==test_value_type(static_cast< VT* >(0))); - assert(1==test_distance_type(static_cast< DT* >(0))); + assert(1==test_value_type(static_cast< VT* >(nullptr))); + assert(1==test_distance_type(static_cast< DT* >(nullptr))); // Default constructor. C_Iterator z ; @@ -7104,8 +7104,8 @@ void test_N_step_adaptor_derived() { CGAL::Assert_is_at_least_forward_category(begin); typedef std::iterator_traits< Circulator >::value_type VT; typedef std::iterator_traits< Circulator >::difference_type DT; - assert(1==test_value_type(static_cast< VT* >(0))); - assert(1==test_distance_type(static_cast< DT* >(0))); + assert(1==test_value_type(static_cast< VT* >(nullptr))); + assert(1==test_distance_type(static_cast< DT* >(nullptr))); // Default constructor. Circulator z = Circulator(); @@ -7196,8 +7196,8 @@ void test_N_step_adaptor_derived() { CGAL::Assert_is_at_least_forward_category(begin); typedef std::iterator_traits< Circulator >::value_type VT; typedef std::iterator_traits< Circulator >::difference_type DT; - assert(1==test_value_type(static_cast< VT* >(0))); - assert(1==test_distance_type(static_cast< DT* >(0))); + assert(1==test_value_type(static_cast< VT* >(nullptr))); + assert(1==test_distance_type(static_cast< DT* >(nullptr))); // Default constructor. Circulator z = Circulator(); @@ -7291,8 +7291,8 @@ void test_N_step_adaptor_derived() { CGAL::Assert_is_at_least_forward_category(begin); typedef std::iterator_traits< Circulator >::value_type VT; typedef std::iterator_traits< Circulator >::difference_type DT; - assert(1==test_value_type(static_cast< VT* >(0))); - assert(1==test_distance_type(static_cast< DT* >(0))); + assert(1==test_value_type(static_cast< VT* >(nullptr))); + assert(1==test_distance_type(static_cast< DT* >(nullptr))); // Default constructor. Circulator z = Circulator(); @@ -7469,11 +7469,11 @@ void test_N_step_adaptor_derived() { // Check tests for empty data structures. Circulator z = Circulator(); - assert( z == NULL); - assert( ! (z != NULL)); + assert( z == nullptr); + assert( ! (z != nullptr)); Circulator i = begin; - assert( ! (i == NULL)); - assert( i != NULL); + assert( ! (i == nullptr)); + assert( i != nullptr); assert( i == begin); assert( i == begin); // Do I reach myself. @@ -7541,8 +7541,8 @@ void test_N_step_adaptor_derived() { CGAL::Assert_is_at_least_forward_category(c_begin); typedef std::iterator_traits< C_Circulator >::value_type VT; typedef std::iterator_traits< C_Circulator >::difference_type DT; - assert(1==test_value_type(static_cast< VT* >(0))); - assert(1==test_distance_type(static_cast< DT* >(0))); + assert(1==test_value_type(static_cast< VT* >(nullptr))); + assert(1==test_distance_type(static_cast< DT* >(nullptr))); // Default constructor. C_Circulator z = C_Circulator(); @@ -7699,11 +7699,11 @@ void test_N_step_adaptor_derived() { // Check tests for empty data structures. C_Circulator z = C_Circulator(); - assert( z == NULL); - assert( ! (z != NULL)); + assert( z == nullptr); + assert( ! (z != nullptr)); C_Circulator i = c_begin; - assert( ! (i == NULL)); - assert( i != NULL); + assert( ! (i == nullptr)); + assert( i != nullptr); assert( i == c_begin); assert( i == c_begin); // Do I reach myself. diff --git a/Shape_detection/examples/Shape_detection/region_growing_on_point_set_2.cpp b/Shape_detection/examples/Shape_detection/region_growing_on_point_set_2.cpp index f687faf45847..a7359da29ee4 100644 --- a/Shape_detection/examples/Shape_detection/region_growing_on_point_set_2.cpp +++ b/Shape_detection/examples/Shape_detection/region_growing_on_point_set_2.cpp @@ -132,7 +132,7 @@ int main(int argc, char *argv[]) { << std::endl; Pwc_vector pwc; - srand(static_cast(time(NULL))); + srand(static_cast(time(nullptr))); // Iterate through all regions. for (const auto& region : regions) { diff --git a/Shape_detection/examples/Shape_detection/region_growing_on_polygon_mesh.cpp b/Shape_detection/examples/Shape_detection/region_growing_on_polygon_mesh.cpp index ba9d4faf9152..9fd7ff446396 100644 --- a/Shape_detection/examples/Shape_detection/region_growing_on_polygon_mesh.cpp +++ b/Shape_detection/examples/Shape_detection/region_growing_on_polygon_mesh.cpp @@ -130,7 +130,7 @@ int main(int argc, char *argv[]) { using Face_index = typename Polygon_mesh::Face_index; // Save the result to a file in the user-provided path if any. - srand(static_cast(time(NULL))); + srand(static_cast(time(nullptr))); if (argc > 2) { bool created; diff --git a/Solver_interface/examples/Solver_interface/sparse_solvers.cpp b/Solver_interface/examples/Solver_interface/sparse_solvers.cpp index 45ce20a871ae..e72c4414422e 100644 --- a/Solver_interface/examples/Solver_interface/sparse_solvers.cpp +++ b/Solver_interface/examples/Solver_interface/sparse_solvers.cpp @@ -8,7 +8,7 @@ typedef Eigen_solver::Vector Eigen_vector; int main(void) { - srand(static_cast(time (NULL))); + srand(static_cast(time (nullptr))); std::size_t degree = 3000; std::size_t nb_nonzero_coef = 100; diff --git a/Straight_skeleton_2/test/Straight_skeleton_2/test_sls.cpp b/Straight_skeleton_2/test/Straight_skeleton_2/test_sls.cpp index cd565f5788ee..6cf6dbb2f7df 100644 --- a/Straight_skeleton_2/test/Straight_skeleton_2/test_sls.cpp +++ b/Straight_skeleton_2/test/Straight_skeleton_2/test_sls.cpp @@ -84,7 +84,7 @@ void error_handler ( char const* what, char const* expr, char const* file, int l << "Expr: " << expr << std::endl << "File: " << file << std::endl << "Line: " << line << std::endl; - if ( msg != 0) + if ( msg != nullptr) std::cerr << "Explanation:" << msg << std::endl; if ( sAbortOnError ) @@ -1207,7 +1207,7 @@ int main( int argc, char const* argv[] ) if ( soptr != "*" ) { - sOffsetCount = strtoul(soptr.c_str(),NULL,10) ; + sOffsetCount = strtoul(soptr.c_str(),nullptr,10) ; cout << "Repeared Offset set at " << sOffset << " " << sOffsetCount << " times." << endl ; } else diff --git a/Surface_mesh/test/Surface_mesh/sm_circulator_concept_checks.cpp b/Surface_mesh/test/Surface_mesh/sm_circulator_concept_checks.cpp index f6e79c0ff04f..cac152b9127d 100644 --- a/Surface_mesh/test/Surface_mesh/sm_circulator_concept_checks.cpp +++ b/Surface_mesh/test/Surface_mesh/sm_circulator_concept_checks.cpp @@ -24,7 +24,7 @@ void test() BOOST_CONCEPT_ASSERT((CGAL::Concepts::BidirectionalCirculator)); Circ circ; if(circ){} - if(circ == NULL){} + if(circ == nullptr){} } int main() diff --git a/Surface_mesh_approximation/test/Surface_mesh_approximation/vsa_teleportation_test.cpp b/Surface_mesh_approximation/test/Surface_mesh_approximation/vsa_teleportation_test.cpp index f1d10a9a57c7..f5bf1050d681 100644 --- a/Surface_mesh_approximation/test/Surface_mesh_approximation/vsa_teleportation_test.cpp +++ b/Surface_mesh_approximation/test/Surface_mesh_approximation/vsa_teleportation_test.cpp @@ -66,7 +66,7 @@ int main() L21_approx approx(mesh, vpmap, error_metric); std::cout << "Random seeding by number." << std::endl; - std::srand(static_cast(std::time(0))); + std::srand(static_cast(std::time(nullptr))); std::size_t count = 0; while (!count) { diff --git a/Surface_mesh_simplification/test/Surface_mesh_simplification/test_edge_collapse_Polyhedron_3.cpp b/Surface_mesh_simplification/test/Surface_mesh_simplification/test_edge_collapse_Polyhedron_3.cpp index eedb3b52a068..1c84930d608b 100644 --- a/Surface_mesh_simplification/test/Surface_mesh_simplification/test_edge_collapse_Polyhedron_3.cpp +++ b/Surface_mesh_simplification/test/Surface_mesh_simplification/test_edge_collapse_Polyhedron_3.cpp @@ -38,7 +38,7 @@ void error_handler (char const* what, char const* expr, char const* file, int li << "Expr: " << expr << endl << "File: " << file << endl << "Line: " << line << endl; - if(msg != 0) + if(msg != nullptr) cerr << "Explanation:" << msg << endl; throw std::runtime_error(expr); diff --git a/Surface_mesh_topology/examples/Surface_mesh_topology/unsew_edgewidth_repeatedly.cpp b/Surface_mesh_topology/examples/Surface_mesh_topology/unsew_edgewidth_repeatedly.cpp index f66cec0b7af0..fafa9dd11602 100644 --- a/Surface_mesh_topology/examples/Surface_mesh_topology/unsew_edgewidth_repeatedly.cpp +++ b/Surface_mesh_topology/examples/Surface_mesh_topology/unsew_edgewidth_repeatedly.cpp @@ -98,7 +98,7 @@ int main(int argc, char* argv[]) std::cout<<"File '"< origin_to_copy; - lcccopy.copy(lccoriginal, &origin_to_copy, NULL); + lcccopy.copy(lccoriginal, &origin_to_copy, nullptr); LCC_3::size_type is_root=lccoriginal.get_new_mark(); LCC_3::size_type belong_to_cycle=lccoriginal.get_new_mark(); diff --git a/Tetrahedral_remeshing/examples/Tetrahedral_remeshing/tetrahedral_remeshing_with_features.cpp b/Tetrahedral_remeshing/examples/Tetrahedral_remeshing/tetrahedral_remeshing_with_features.cpp index 9135cf65a15f..31f3549f65be 100644 --- a/Tetrahedral_remeshing/examples/Tetrahedral_remeshing/tetrahedral_remeshing_with_features.cpp +++ b/Tetrahedral_remeshing/examples/Tetrahedral_remeshing/tetrahedral_remeshing_with_features.cpp @@ -34,7 +34,7 @@ class Constrained_edges_property_map public: Constrained_edges_property_map() - : m_set_ptr(NULL) + : m_set_ptr(nullptr) {} Constrained_edges_property_map(boost::unordered_set* set_) : m_set_ptr(set_) @@ -45,7 +45,7 @@ class Constrained_edges_property_map const key_type& k, const bool b) { - CGAL_assertion(map.m_set_ptr != NULL); + CGAL_assertion(map.m_set_ptr != nullptr); CGAL_assertion(k.first < k.second); if (b) map.m_set_ptr->insert(k); else map.m_set_ptr->erase(k); @@ -54,7 +54,7 @@ class Constrained_edges_property_map friend value_type get(const Constrained_edges_property_map& map, const key_type& k) { - CGAL_assertion(map.m_set_ptr != NULL); + CGAL_assertion(map.m_set_ptr != nullptr); CGAL_assertion(k.first < k.second); return (map.m_set_ptr->count(k) > 0); } diff --git a/Tetrahedral_remeshing/test/Tetrahedral_remeshing/test_tetrahedral_remeshing_with_features.cpp b/Tetrahedral_remeshing/test/Tetrahedral_remeshing/test_tetrahedral_remeshing_with_features.cpp index 3ca850d78e69..ae3fb998ef47 100644 --- a/Tetrahedral_remeshing/test/Tetrahedral_remeshing/test_tetrahedral_remeshing_with_features.cpp +++ b/Tetrahedral_remeshing/test/Tetrahedral_remeshing/test_tetrahedral_remeshing_with_features.cpp @@ -39,7 +39,7 @@ class Constrained_edges_property_map public: Constrained_edges_property_map() - : m_set_ptr(NULL) + : m_set_ptr(nullptr) {} Constrained_edges_property_map(boost::unordered_set* set_) : m_set_ptr(set_) @@ -50,7 +50,7 @@ class Constrained_edges_property_map const key_type& k, const bool b) { - CGAL_assertion(map.m_set_ptr != NULL); + CGAL_assertion(map.m_set_ptr != nullptr); CGAL_assertion(k.first < k.second); if (b) map.m_set_ptr->insert(k); else map.m_set_ptr->erase(k); @@ -59,7 +59,7 @@ class Constrained_edges_property_map friend value_type get(const Constrained_edges_property_map& map, const key_type& k) { - CGAL_assertion(map.m_set_ptr != NULL); + CGAL_assertion(map.m_set_ptr != nullptr); CGAL_assertion(k.first < k.second); return map.m_set_ptr->count(k) > 0; } diff --git a/Three/include/CGAL/Three/Scene_group_item.h b/Three/include/CGAL/Three/Scene_group_item.h index c70068a7ad35..330082e811a5 100644 --- a/Three/include/CGAL/Three/Scene_group_item.h +++ b/Three/include/CGAL/Three/Scene_group_item.h @@ -94,7 +94,7 @@ public : //!Returns an empty Bbox to avoid disturbing the Bbox of the scene. Bbox bbox() const Q_DECL_OVERRIDE; //!Not supported. - Scene_item* clone() const Q_DECL_OVERRIDE {return 0;} + Scene_item* clone() const Q_DECL_OVERRIDE {return nullptr;} //! Indicates if the rendering mode is supported. //! \returns true for all rendering modes that are shared by //! all of the children. @@ -213,7 +213,7 @@ public : if(isChildLocked(item)) return; update_group_number(item,0); - item->moveToGroup(0); + item->moveToGroup(nullptr); children.removeOne(scene->item_id(item)); } //!Removes a Scene_item from the list of children using its index. diff --git a/Three/include/CGAL/Three/Scene_item.h b/Three/include/CGAL/Three/Scene_item.h index 726ba958e0d0..0f170f2186e0 100644 --- a/Three/include/CGAL/Three/Scene_item.h +++ b/Three/include/CGAL/Three/Scene_item.h @@ -203,7 +203,7 @@ class SCENE_ITEM_EXPORT Scene_item : public QObject{ //! A manipulated frame is an independent system that can be //! translated or rotated using the Ctrl key and the mouse. //!@returns the manipulatedFrame of the item. - virtual ManipulatedFrame* manipulatedFrame() { return 0; } + virtual ManipulatedFrame* manipulatedFrame() { return nullptr; } // Getters for the four basic properties //!Getter for the item's color. @@ -482,7 +482,7 @@ public Q_SLOTS: void attribBuffers(CGAL::Three::Viewer_interface*, int program_name) const; /*! Compatibility function. Calls `viewer->getShaderProgram()`. */ - virtual QOpenGLShaderProgram* getShaderProgram(int name , CGAL::Three::Viewer_interface *viewer = 0) const; + virtual QOpenGLShaderProgram* getShaderProgram(int name , CGAL::Three::Viewer_interface *viewer = nullptr) const; public: //! \brief defaultSaveName returns the name to be used as default //! when saving this item. diff --git a/Triangulation/test/Triangulation/test_delaunay.cpp b/Triangulation/test/Triangulation/test_delaunay.cpp index 63cd50506cca..bc92fa6c7961 100644 --- a/Triangulation/test/Triangulation/test_delaunay.cpp +++ b/Triangulation/test/Triangulation/test_delaunay.cpp @@ -132,7 +132,7 @@ void go(const int N) int main(int argc, char **argv) { - srand(static_cast(time(NULL))); + srand(static_cast(time(nullptr))); int N = 10; if( argc > 1 ) N = atoi(argv[1]); diff --git a/Triangulation/test/Triangulation/test_insert_if_in_star.cpp b/Triangulation/test/Triangulation/test_insert_if_in_star.cpp index 40bb9110f154..1d5f562c7056 100644 --- a/Triangulation/test/Triangulation/test_insert_if_in_star.cpp +++ b/Triangulation/test/Triangulation/test_insert_if_in_star.cpp @@ -26,7 +26,7 @@ void test(const int d, const string & type, const int N) assert(rt.empty()); assert(rt_star_only.empty()); - srand(static_cast(time(NULL))); + srand(static_cast(time(nullptr))); // Insert first point (0, 0...) vector coords(d); diff --git a/Triangulation/test/Triangulation/test_regular.cpp b/Triangulation/test/Triangulation/test_regular.cpp index e5240e32f7be..a4d2030e2495 100644 --- a/Triangulation/test/Triangulation/test_regular.cpp +++ b/Triangulation/test/Triangulation/test_regular.cpp @@ -264,7 +264,7 @@ void test_inserting_points_at_the_same_position() int main(int argc, char **argv) { - srand(static_cast(time(NULL))); + srand(static_cast(time(nullptr))); int N = 10; if( argc > 1 ) N = atoi(argv[1]); diff --git a/Triangulation/test/Triangulation/test_torture.cpp b/Triangulation/test/Triangulation/test_torture.cpp index 72cefb83552e..e66fc6e3ea3f 100644 --- a/Triangulation/test/Triangulation/test_torture.cpp +++ b/Triangulation/test/Triangulation/test_torture.cpp @@ -132,7 +132,7 @@ int main(int argc, char **argv) { int N = 3; int nb_trials = 2; - unsigned int rand_init = static_cast(time(NULL)); + unsigned int rand_init = static_cast(time(nullptr)); if( argc > 1 ) N = atoi(argv[1]); if( argc > 2 ) diff --git a/Triangulation/test/Triangulation/test_triangulation.cpp b/Triangulation/test/Triangulation/test_triangulation.cpp index e5ec7259f84e..c86d6c4edd16 100644 --- a/Triangulation/test/Triangulation/test_triangulation.cpp +++ b/Triangulation/test/Triangulation/test_triangulation.cpp @@ -153,7 +153,7 @@ void go(int N) int main(int argc, char **argv) { - srand(static_cast(time(NULL))); + srand(static_cast(time(nullptr))); int N = 1000; if( argc > 1 ) N = atoi(argv[1]); diff --git a/Triangulation_2/examples/Triangulation_2/triangulation_prog1.cpp b/Triangulation_2/examples/Triangulation_2/triangulation_prog1.cpp index 953453860a00..e68f7973163d 100644 --- a/Triangulation_2/examples/Triangulation_2/triangulation_prog1.cpp +++ b/Triangulation_2/examples/Triangulation_2/triangulation_prog1.cpp @@ -19,7 +19,7 @@ int main() { Vertex_circulator vc = t.incident_vertices(t.infinite_vertex()), done(vc); - if (vc != 0) { + if (vc != nullptr) { do { std::cout << vc->point() << std::endl; }while(++vc != done); } diff --git a/Triangulation_2/test/Triangulation_2/include/CGAL/_test_cls_regular_triangulation_2.h b/Triangulation_2/test/Triangulation_2/include/CGAL/_test_cls_regular_triangulation_2.h index 48aed16b7747..e189e4b8cb87 100644 --- a/Triangulation_2/test/Triangulation_2/include/CGAL/_test_cls_regular_triangulation_2.h +++ b/Triangulation_2/test/Triangulation_2/include/CGAL/_test_cls_regular_triangulation_2.h @@ -199,7 +199,7 @@ _test_cls_regular_triangulation_2( const Triangulation & ) assert( T0_0.is_valid(verbose) ); Cls T0_1; - Vertex_handle v0_1_0 = T0_1.insert(wp0); assert( v0_1_0 != NULL ); + Vertex_handle v0_1_0 = T0_1.insert(wp0); assert( v0_1_0 != nullptr ); assert( T0_1.dimension() == 0 ); assert( T0_1.number_of_vertices() == 1 ); assert( T0_1.is_valid(verbose) ); @@ -521,7 +521,7 @@ _test_cls_regular_triangulation_2( const Triangulation & ) // here == operator needed for Point! // testing with the grid triangulation LFC fc= T2_3.line_walk(wp1,wp10); - assert(fc != NULL); + assert(fc != nullptr); assert(!fc.is_empty()); LFC fc2=fc; assert(fc==fc2); diff --git a/Triangulation_2/test/Triangulation_2/include/CGAL/_test_cls_triangulation_2.h b/Triangulation_2/test/Triangulation_2/include/CGAL/_test_cls_triangulation_2.h index 348428439f75..b14c998d5a92 100644 --- a/Triangulation_2/test/Triangulation_2/include/CGAL/_test_cls_triangulation_2.h +++ b/Triangulation_2/test/Triangulation_2/include/CGAL/_test_cls_triangulation_2.h @@ -156,7 +156,7 @@ _test_cls_triangulation_2( const Triangul & ) assert( T0_0.is_valid() ); Triangul T0_1; - Vertex_handle v0_1_0 = T0_1.insert(p0); assert( v0_1_0 != NULL ); + Vertex_handle v0_1_0 = T0_1.insert(p0); assert( v0_1_0 != nullptr ); assert( T0_1.dimension() == 0 ); assert( T0_1.number_of_vertices() == 1 ); assert( T0_1.number_of_faces() == 0); @@ -165,7 +165,7 @@ _test_cls_triangulation_2( const Triangul & ) // test insert_first() Triangul T0_2; Vertex_handle v0_2_0 = T0_2.insert_first(p0); - assert( v0_2_0 != NULL ); + assert( v0_2_0 != nullptr ); assert( T0_2.dimension() == 0 ); assert( T0_2.number_of_vertices() == 1 ); assert( T0_2.number_of_faces() == 0); @@ -186,9 +186,9 @@ _test_cls_triangulation_2( const Triangul & ) // p1,p3,p2 [endpoints first] Triangul T1_3_0; - Vertex_handle v1_3_0_1 = T1_3_0.insert(p1); assert( v1_3_0_1 != NULL ); - Vertex_handle v1_3_0_3 = T1_3_0.insert(p3); assert( v1_3_0_3 != NULL ); - Vertex_handle v1_3_0_2 = T1_3_0.insert(p2); assert( v1_3_0_2 != NULL ); + Vertex_handle v1_3_0_1 = T1_3_0.insert(p1); assert( v1_3_0_1 != nullptr ); + Vertex_handle v1_3_0_3 = T1_3_0.insert(p3); assert( v1_3_0_3 != nullptr ); + Vertex_handle v1_3_0_2 = T1_3_0.insert(p2); assert( v1_3_0_2 != nullptr ); assert( T1_3_0.dimension() == 1 ); assert( T1_3_0.number_of_vertices() == 3 ); assert( T1_3_0.number_of_faces() == 0 ); @@ -196,9 +196,9 @@ _test_cls_triangulation_2( const Triangul & ) // p1,p2,p3 [middle point first] Triangul T1_3_1; - Vertex_handle v1_3_1_1 = T1_3_1.insert(p1); assert( v1_3_1_1 != NULL ); - Vertex_handle v1_3_1_3 = T1_3_1.insert(p2); assert( v1_3_1_3 != NULL ); - Vertex_handle v1_3_1_2 = T1_3_1.insert(p3); assert( v1_3_1_2 != NULL ); + Vertex_handle v1_3_1_1 = T1_3_1.insert(p1); assert( v1_3_1_1 != nullptr ); + Vertex_handle v1_3_1_3 = T1_3_1.insert(p2); assert( v1_3_1_3 != nullptr ); + Vertex_handle v1_3_1_2 = T1_3_1.insert(p3); assert( v1_3_1_2 != nullptr ); assert( T1_3_1.dimension() == 1 ); assert( T1_3_1.number_of_vertices() == 3 ); assert( T1_3_1.number_of_faces() == 0 ); @@ -217,7 +217,7 @@ _test_cls_triangulation_2( const Triangul & ) // test insert_second() Triangul T1_6 = T0_2; - Vertex_handle v1_6_2 = T1_6.insert_second(p3); assert( v1_6_2 != NULL ); + Vertex_handle v1_6_2 = T1_6.insert_second(p3); assert( v1_6_2 != nullptr ); assert( T1_6.dimension() == 1 ); assert( T1_6.number_of_vertices() == 2 ); assert( T1_6.is_valid() ); @@ -694,7 +694,7 @@ _test_cls_triangulation_2( const Triangul & ) // here == operator needed for Point! // testing with the grid triangulation LFC fc= T2_7.line_walk(p1,p10); - assert(fc!=NULL); + assert(fc!=nullptr); assert(!fc.is_empty()); LFC fc2=fc; assert(fc==fc2); diff --git a/Triangulation_2/test/Triangulation_2/include/CGAL/_test_cls_triangulation_short_2.h b/Triangulation_2/test/Triangulation_2/include/CGAL/_test_cls_triangulation_short_2.h index 249b1d9e115d..bb5bbd8a6038 100644 --- a/Triangulation_2/test/Triangulation_2/include/CGAL/_test_cls_triangulation_short_2.h +++ b/Triangulation_2/test/Triangulation_2/include/CGAL/_test_cls_triangulation_short_2.h @@ -144,7 +144,7 @@ _test_cls_triangulation_short_2( const Triangul &) assert( T0_0.is_valid() ); Triangul T0_1; - Vertex_handle v0_1_0 = T0_1.insert(p0); assert( v0_1_0 != NULL ); + Vertex_handle v0_1_0 = T0_1.insert(p0); assert( v0_1_0 != nullptr ); assert( T0_1.dimension() == 0 ); assert( T0_1.number_of_vertices() == 1 ); assert( T0_1.is_valid() ); @@ -152,7 +152,7 @@ _test_cls_triangulation_short_2( const Triangul &) // test insert_first() Triangul T0_2; Vertex_handle v0_2_0 = T0_2.insert_first(p0); - assert( v0_2_0 != NULL ); + assert( v0_2_0 != nullptr ); assert( T0_2.dimension() == 0 ); assert( T0_2.number_of_vertices() == 1 ); assert( T0_2.is_valid() ); @@ -409,7 +409,7 @@ _test_cls_triangulation_short_2( const Triangul &) // here == operator needed for Point! // testing with the grid triangulation LFC fc= T2_3.line_walk(p1,p10); - assert(fc != NULL); + assert(fc != nullptr); assert(!fc.is_empty()); LFC fc2=fc; assert(fc==fc2); diff --git a/Triangulation_2/test/Triangulation_2/include/CGAL/_test_fct_is_infinite.h b/Triangulation_2/test/Triangulation_2/include/CGAL/_test_fct_is_infinite.h index 3ea9a5eac021..aeea2ed8cab0 100644 --- a/Triangulation_2/test/Triangulation_2/include/CGAL/_test_fct_is_infinite.h +++ b/Triangulation_2/test/Triangulation_2/include/CGAL/_test_fct_is_infinite.h @@ -30,7 +30,7 @@ _test_fct_is_infinite( const Triangulation &T ) All_edges_iterator; // test infinite_face() and is_infinite(Face_handle) - if ( T.infinite_face() != NULL ) + if ( T.infinite_face() != nullptr ) assert( T.is_infinite(T.infinite_face()) ); // test infinite_vertex() and is_infinite(Vertex_handle) @@ -44,7 +44,7 @@ _test_fct_is_infinite( const Triangulation &T ) // test is_infinite(Edge) // an infinite face always has two infinite edges - if ( T.infinite_face() != NULL ) + if ( T.infinite_face() != nullptr ) { int index = T.infinite_face()->index(T.infinite_vertex()); assert( T.is_infinite( Edge(T.infinite_face(),(index+1)%3)) ); diff --git a/Triangulation_2/test/Triangulation_2/include/CGAL/_test_line_face_circulator.h b/Triangulation_2/test/Triangulation_2/include/CGAL/_test_line_face_circulator.h index 103633c5b2fe..ec1302c175ab 100644 --- a/Triangulation_2/test/Triangulation_2/include/CGAL/_test_line_face_circulator.h +++ b/Triangulation_2/test/Triangulation_2/include/CGAL/_test_line_face_circulator.h @@ -108,12 +108,12 @@ _test_line_face_circulator( const Tri & ) //test line face circulator from vertex Line_face_circulator lfc; lfc = Line_face_circulator(v[0],&tr,t0); assert(f1 == lfc); - lfc = Line_face_circulator(v[0],&tr,m4); assert(lfc == 0); - lfc = Line_face_circulator(v[0],&tr,t7); assert(lfc == 0); - lfc = Line_face_circulator(v[0],&tr,q1); assert(lfc == 0); - lfc = Line_face_circulator(v[0],&tr,t8); assert(lfc != 0); - lfc = Line_face_circulator(v[0],&tr,q2); assert(lfc != 0); - lfc = Line_face_circulator(v[0],&tr,t1); assert(lfc == 0); + lfc = Line_face_circulator(v[0],&tr,m4); assert(lfc == nullptr); + lfc = Line_face_circulator(v[0],&tr,t7); assert(lfc == nullptr); + lfc = Line_face_circulator(v[0],&tr,q1); assert(lfc == nullptr); + lfc = Line_face_circulator(v[0],&tr,t8); assert(lfc != nullptr); + lfc = Line_face_circulator(v[0],&tr,q2); assert(lfc != nullptr); + lfc = Line_face_circulator(v[0],&tr,t1); assert(lfc == nullptr); lfc = Line_face_circulator(v[0],&tr,m1); assert(f1 == lfc); lfc = Line_face_circulator(v[1],&tr,p2); assert(f1 == lfc); @@ -152,47 +152,47 @@ _test_line_face_circulator( const Tri & ) } // test creator from two point - lfc = tr.line_walk(p0,t0); assert(lfc != 0); - lfc = tr.line_walk(p0,m4); assert(lfc == 0); - lfc = tr.line_walk(p0,t5); assert(lfc != 0); - lfc = tr.line_walk(p0,q1); assert(lfc == 0); - lfc = tr.line_walk(p0,t8); assert(lfc != 0); - lfc = tr.line_walk(p0,q2); assert(lfc != 0); - lfc = tr.line_walk(p0,t1); assert(lfc == 0); - lfc = tr.line_walk(p0,m1); assert(lfc != 0); - - lfc = tr.line_walk(p1,p2); assert(lfc != 0); + lfc = tr.line_walk(p0,t0); assert(lfc != nullptr); + lfc = tr.line_walk(p0,m4); assert(lfc == nullptr); + lfc = tr.line_walk(p0,t5); assert(lfc != nullptr); + lfc = tr.line_walk(p0,q1); assert(lfc == nullptr); + lfc = tr.line_walk(p0,t8); assert(lfc != nullptr); + lfc = tr.line_walk(p0,q2); assert(lfc != nullptr); + lfc = tr.line_walk(p0,t1); assert(lfc == nullptr); + lfc = tr.line_walk(p0,m1); assert(lfc != nullptr); + + lfc = tr.line_walk(p1,p2); assert(lfc != nullptr); assert( lfc->has_vertex(v[0]) && lfc->has_vertex(v[1]) && lfc->has_vertex(v[2])); - lfc = tr.line_walk(p0,p1); assert(lfc != 0); + lfc = tr.line_walk(p0,p1); assert(lfc != nullptr); assert (lfc->has_vertex(v[0]) && lfc->has_vertex(v[1]) && lfc->has_vertex(v[2])); - lfc = tr.line_walk(t0,p0); assert(lfc != 0); - lfc = tr.line_walk(m4,p0); assert(lfc != 0); - lfc = tr.line_walk(t5,p0); assert(lfc != 0); - lfc = tr.line_walk(q1,p0); assert(lfc != 0); - lfc = tr.line_walk(t8,p0); assert(lfc != 0); - lfc = tr.line_walk(q2,p0); assert(lfc == 0); - lfc = tr.line_walk(t1,p0); assert(lfc == 0); - lfc = tr.line_walk(m1,p0); assert(lfc == 0); + lfc = tr.line_walk(t0,p0); assert(lfc != nullptr); + lfc = tr.line_walk(m4,p0); assert(lfc != nullptr); + lfc = tr.line_walk(t5,p0); assert(lfc != nullptr); + lfc = tr.line_walk(q1,p0); assert(lfc != nullptr); + lfc = tr.line_walk(t8,p0); assert(lfc != nullptr); + lfc = tr.line_walk(q2,p0); assert(lfc == nullptr); + lfc = tr.line_walk(t1,p0); assert(lfc == nullptr); + lfc = tr.line_walk(m1,p0); assert(lfc == nullptr); // test creator from two points with a hint lfc = tr.line_walk(p0,t0,f1); assert(f1 == lfc); - lfc = tr.line_walk(p0,m4,f1); assert(lfc == 0); + lfc = tr.line_walk(p0,m4,f1); assert(lfc == nullptr); lfc = tr.line_walk(p0,t5,f1); assert(f1 == lfc); - lfc = tr.line_walk(p0,q1,f1); assert(lfc == 0); + lfc = tr.line_walk(p0,q1,f1); assert(lfc == nullptr); lfc = tr.line_walk(p0,t8,f1); assert(f1 == lfc); lfc = tr.line_walk(p0,q2,f1); assert(f1 == lfc); - lfc = tr.line_walk(p0,t1,f1); assert(lfc == 0); + lfc = tr.line_walk(p0,t1,f1); assert(lfc == nullptr); lfc = tr.line_walk(p0,m1,f1); assert(f1 == lfc); lfc = tr.line_walk(t0,p0,f1); assert(f1 == lfc); lfc = tr.line_walk(t0,p0,f2); assert(f2 == lfc); lfc = tr.line_walk(m4,p0,f1); assert(f1 == lfc); lfc = tr.line_walk(m3,p0,f2); assert(f2 == lfc); - lfc = tr.line_walk(m1,p0,f1); assert(lfc == 0); + lfc = tr.line_walk(m1,p0,f1); assert(lfc == nullptr); lfc = tr.line_walk(p1,p2,f2); assert(f1 == lfc); lfc = tr.line_walk(p1,p2,f1); assert(f1 == lfc); lfc = tr.line_walk(t0,p2,f1); assert(f1 == lfc); @@ -210,12 +210,12 @@ _test_line_face_circulator( const Tri & ) assert(tr.is_face(v[3],v[6],v[5],f2)); lfc = tr.line_walk(m1,p1); assert(f1 == lfc); - lfc = tr.line_walk(p1,m1); assert(lfc == 0); + lfc = tr.line_walk(p1,m1); assert(lfc == nullptr); lfc = tr.line_walk(p0, p3, f1); assert(f1 == lfc); lfc = tr.line_walk(p0, p1, f1); assert(f1 == lfc); - lfc = tr.line_walk(p0, p2, f1); assert(lfc == 0); - lfc = tr.line_walk(p0, t8, f1); assert(lfc != 0); - lfc = tr.line_walk(p0, t1, f1); assert(lfc == 0); + lfc = tr.line_walk(p0, p2, f1); assert(lfc == nullptr); + lfc = tr.line_walk(p0, t8, f1); assert(lfc != nullptr); + lfc = tr.line_walk(p0, t1, f1); assert(lfc == nullptr); return; } diff --git a/Triangulation_2/test/Triangulation_2/include/CGAL/_test_triangulation_circulators.h b/Triangulation_2/test/Triangulation_2/include/CGAL/_test_triangulation_circulators.h index 0351b97856c6..f3d09a1ef7ab 100644 --- a/Triangulation_2/test/Triangulation_2/include/CGAL/_test_triangulation_circulators.h +++ b/Triangulation_2/test/Triangulation_2/include/CGAL/_test_triangulation_circulators.h @@ -48,7 +48,7 @@ _test_circulators( const Tr &T ) { vc0 = vc = T.incident_vertices( vit, vit->face() ); if( !vc.is_empty()){ - if( vc != NULL){ + if( vc != nullptr){ do { vc++; nvi++; } while (vc != vc0); @@ -57,7 +57,7 @@ _test_circulators( const Tr &T ) //test operator --() vc0 = vc = T.incident_vertices( vit, vit->face() ); if( !vc.is_empty()){ - if( vc != NULL){ + if( vc != nullptr){ do { vc--; nvi_r++; } while (vc != vc0); diff --git a/Triangulation_3/demo/Triangulation_3/MainWindow.h b/Triangulation_3/demo/Triangulation_3/MainWindow.h index 5cc244197238..6d1262224506 100644 --- a/Triangulation_3/demo/Triangulation_3/MainWindow.h +++ b/Triangulation_3/demo/Triangulation_3/MainWindow.h @@ -18,7 +18,7 @@ class MainWindow : public CGAL::Qt::DemosMainWindow, private Ui::MainWindow Q_OBJECT public: - MainWindow(QWidget* parent = 0); + MainWindow(QWidget* parent = nullptr); ~MainWindow() {} public Q_SLOTS: diff --git a/Triangulation_3/demo/Triangulation_3/PreferenceDlg.h b/Triangulation_3/demo/Triangulation_3/PreferenceDlg.h index e96976ae3503..1a62341d45d8 100644 --- a/Triangulation_3/demo/Triangulation_3/PreferenceDlg.h +++ b/Triangulation_3/demo/Triangulation_3/PreferenceDlg.h @@ -28,7 +28,7 @@ class PreferenceDlg : public QDialog friend class Viewer; public: - PreferenceDlg(QWidget *parent=0); + PreferenceDlg(QWidget *parent=nullptr); private: void init(QColor, float, QColor, float, QColor, float, QColor, QColor, QColor, int); diff --git a/Triangulation_3/demo/Triangulation_3/Viewer.cpp b/Triangulation_3/demo/Triangulation_3/Viewer.cpp index 097aa3c25461..90af7a440dbb 100644 --- a/Triangulation_3/demo/Triangulation_3/Viewer.cpp +++ b/Triangulation_3/demo/Triangulation_3/Viewer.cpp @@ -476,7 +476,7 @@ void Viewer::compute_elements() drawVertex( m_pScene->m_vhArray.at( m_vidMoving )->point(), pos_movingPoint ); }//end-if-v // Draw the nearest neighbor - if( m_nearestNb != NULL ) { + if( m_nearestNb != nullptr ) { drawVertex( m_queryPt, pos_queryPoint); drawVertex( m_nearestNb->point(), pos_nearest_neighbor); } @@ -1676,7 +1676,7 @@ void Viewer::drawWithNames() buffers[33].bind(); buffers[33].allocate(buf, 3*sizeof(GLfloat)); rendering_program.enableAttributeArray("vertex"); - rendering_program.setAttributeArray("vertex",GL_FLOAT,0,3); + rendering_program.setAttributeArray("vertex",GL_FLOAT,nullptr,3); buffers[33].release(); vao[3].release(); @@ -1721,7 +1721,7 @@ void Viewer::drawWithNames() buffers[33].bind(); buffers[33].allocate(buf, 3*sizeof(GLfloat)); rendering_program.enableAttributeArray("vertex"); - rendering_program.setAttributeArray("vertex",GL_FLOAT,0,3); + rendering_program.setAttributeArray("vertex",GL_FLOAT,nullptr,3); buffers[33].release(); QMatrix4x4 mvpMatrix; diff --git a/Triangulation_3/demo/Triangulation_3/Viewer.h b/Triangulation_3/demo/Triangulation_3/Viewer.h index 4e604779e401..e46753c6d4f0 100644 --- a/Triangulation_3/demo/Triangulation_3/Viewer.h +++ b/Triangulation_3/demo/Triangulation_3/Viewer.h @@ -38,10 +38,10 @@ class Viewer : public CGAL::QGLViewer{ , m_isMoving(false) , m_hasNewPt(false) , m_selMode(NORMAL) - , m_nearestNb(NULL) + , m_nearestNb(nullptr) , m_hasEmptyS(false) , m_showTrackball(true) - , m_pDlgPrefer(NULL) + , m_pDlgPrefer(nullptr) { pos_emptyFacet = new std::vector(); pos_emptySphere= new std::vector(); @@ -99,7 +99,7 @@ class Viewer : public CGAL::QGLViewer{ m_curMode = m; m_isMoving = false; m_hasEmptyS = false; - m_nearestNb = NULL; + m_nearestNb = nullptr; update(); } @@ -167,7 +167,7 @@ public Q_SLOTS: m_conflictCells.clear(); m_vidSeled.clear(); m_isMoving = false; - m_nearestNb = NULL; + m_nearestNb = nullptr; m_hasEmptyS = false; if( !m_incrementalPts.isEmpty() ) { Q_EMIT( stopIncAnimation() ); @@ -185,7 +185,7 @@ public Q_SLOTS: m_conflictCells.clear(); m_vidSeled.clear(); m_isMoving = false; - m_nearestNb = NULL; + m_nearestNb = nullptr; m_hasEmptyS = false; } // stop incremental construction diff --git a/Triangulation_3/test/Triangulation_3/include/CGAL/_test_cls_circulator.h b/Triangulation_3/test/Triangulation_3/include/CGAL/_test_cls_circulator.h index 09ef089be488..5e7a22185c91 100644 --- a/Triangulation_3/test/Triangulation_3/include/CGAL/_test_cls_circulator.h +++ b/Triangulation_3/test/Triangulation_3/include/CGAL/_test_cls_circulator.h @@ -136,7 +136,7 @@ _test_circulator( const Triangulation &T ) } Facet_circulator fc, fc0, fc1; - assert(fc1 == 0); + assert(fc1 == nullptr); int i,j; // for (eit=T.edges_begin(); eit!=T.edges_end(); eit++) eit=T.edges_begin(); // test (edge) diff --git a/Triangulation_3/test/Triangulation_3/test_regular_remove_3.cpp b/Triangulation_3/test/Triangulation_3/test_regular_remove_3.cpp index aa7bd3845524..1ce3881222b7 100644 --- a/Triangulation_3/test/Triangulation_3/test_regular_remove_3.cpp +++ b/Triangulation_3/test/Triangulation_3/test_regular_remove_3.cpp @@ -197,7 +197,7 @@ class point_reader Weighted_point wp; int nb; public: - point_reader () : in (0), wp(), nb(0) {} + point_reader () : in (nullptr), wp(), nb(0) {} point_reader (std::istream &is) : in(&is) { if (*in >> nb) {