Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
Checks: '-clang-diagnostic*,-clang-analyzer*,modernize-use-nullptr'
HeaderFilterRegex: 'CGAL/*'
...

20 changes: 10 additions & 10 deletions AABB_tree/demo/AABB_tree/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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;
Expand All @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand All @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion AABB_tree/demo/AABB_tree/MainWindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class MainWindow :
{
Q_OBJECT
public:
MainWindow(QWidget* parent = 0);
MainWindow(QWidget* parent = nullptr);
~MainWindow();

public slots:
Expand Down
28 changes: 14 additions & 14 deletions AABB_tree/demo/AABB_tree/Scene.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand All @@ -553,7 +553,7 @@ int Scene::open(QString filename)
QApplication::restoreOverrideCursor();

delete m_pPolyhedron;
m_pPolyhedron = NULL;
m_pPolyhedron = nullptr;

return -1;
}
Expand All @@ -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;
Expand Down Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -1219,7 +1219,7 @@ void Scene::cut_segment_plane()
{
const Segment* inter_seg = CGAL::object_cast<Segment>(&(it->first));

if ( NULL != inter_seg )
if ( nullptr != inter_seg )
{
m_cut_segments.push_back(*inter_seg);
}
Expand Down Expand Up @@ -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;
Expand All @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions AABB_tree/demo/AABB_tree/Viewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

Viewer::Viewer(QWidget* parent)
: CGAL::QGLViewer(parent),
m_pScene(NULL),
m_pScene(nullptr),
m_custom_mouse(false)
{
}
Expand All @@ -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);
}
Expand Down
12 changes: 6 additions & 6 deletions AABB_tree/demo/AABB_tree/benchmarks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ struct My_triangle_primitive {
// types
typedef CGAL::AABB_traits<K, My_triangle_primitive> My_AABB_traits;
typedef CGAL::AABB_tree<My_AABB_traits> Tree;
const double* My_triangle_primitive::point_container = 0;
const double* My_triangle_primitive::point_container = nullptr;

int main()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ struct My_triangle_primitive {
// types
typedef CGAL::AABB_traits<K, My_triangle_primitive> My_AABB_traits;
typedef CGAL::AABB_tree<My_AABB_traits> Tree;
const std::vector<My_point>* My_triangle_primitive::point_container = 0;
const std::vector<My_point>* My_triangle_primitive::point_container = nullptr;

int main()
{
Expand Down
2 changes: 1 addition & 1 deletion Alpha_shapes_3/demo/Alpha_shapes_3/MainWindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Loading