From 97ba0f33f459f87b3c07af19e39a83bdc20eb585 Mon Sep 17 00:00:00 2001 From: Maxime Gimeno Date: Tue, 12 Jan 2016 10:30:06 +0100 Subject: [PATCH] Fix for the header() function - I forgot half the work on that one. --- Polyhedron/demo/Polyhedron/MainWindow.cpp | 3 +-- Polyhedron/demo/Polyhedron/Scene_item.cpp | 5 +++-- Polyhedron/demo/Polyhedron/Scene_polyhedron_item.cpp | 4 +++- Polyhedron/demo/Polyhedron/Scene_polyhedron_item.h | 2 +- Three/include/CGAL/Three/Scene_item.h | 2 +- 5 files changed, 9 insertions(+), 7 deletions(-) diff --git a/Polyhedron/demo/Polyhedron/MainWindow.cpp b/Polyhedron/demo/Polyhedron/MainWindow.cpp index 5709353b82f..39a6c8e3cb6 100644 --- a/Polyhedron/demo/Polyhedron/MainWindow.cpp +++ b/Polyhedron/demo/Polyhedron/MainWindow.cpp @@ -1804,8 +1804,7 @@ QString MainWindow::get_polyhedron_stats() QString str; for(int i=0; i< classnames.size(); i++) { - CGAL::Three::Scene_item::Header_data data; - items[i].at(0)->header(data); + CGAL::Three::Scene_item::Header_data data = items[i].at(0)->header(); int title = 0; int titles_limit =0; if(data.titles.size()>0) diff --git a/Polyhedron/demo/Polyhedron/Scene_item.cpp b/Polyhedron/demo/Polyhedron/Scene_item.cpp index 70a3353d7dc..c59e714a6d1 100644 --- a/Polyhedron/demo/Polyhedron/Scene_item.cpp +++ b/Polyhedron/demo/Polyhedron/Scene_item.cpp @@ -153,9 +153,10 @@ QOpenGLShaderProgram* CGAL::Three::Scene_item::getShaderProgram(int name, CGAL:: return viewer->getShaderProgram(name); } -CGAL::Three::Scene_item::Header_data CGAL::Three::Scene_item::header() +CGAL::Three::Scene_item::Header_data CGAL::Three::Scene_item::header() const { - + CGAL::Three::Scene_item::Header_data data; + return data; } QString CGAL::Three::Scene_item::compute_stats(int ) diff --git a/Polyhedron/demo/Polyhedron/Scene_polyhedron_item.cpp b/Polyhedron/demo/Polyhedron/Scene_polyhedron_item.cpp index a653ba04be2..45050ac7e7b 100644 --- a/Polyhedron/demo/Polyhedron/Scene_polyhedron_item.cpp +++ b/Polyhedron/demo/Polyhedron/Scene_polyhedron_item.cpp @@ -1255,8 +1255,9 @@ QString Scene_polyhedron_item::compute_stats(int type) return QString(); } -void Scene_polyhedron_item::header(Header_data &data) +CGAL::Three::Scene_item::Header_data Scene_polyhedron_item::header() const { + CGAL::Three::Scene_item::Header_data data; //categories data.categories.append(std::pair(QString("Properties"),9)); data.categories.append(std::pair(QString("Edges"),6)); @@ -1282,4 +1283,5 @@ void Scene_polyhedron_item::header(Header_data &data) data.titles.append(QString("Minimum")); data.titles.append(QString("Maximum")); data.titles.append(QString("Average")); + return data; } diff --git a/Polyhedron/demo/Polyhedron/Scene_polyhedron_item.h b/Polyhedron/demo/Polyhedron/Scene_polyhedron_item.h index 6001283afd6..188966bb885 100644 --- a/Polyhedron/demo/Polyhedron/Scene_polyhedron_item.h +++ b/Polyhedron/demo/Polyhedron/Scene_polyhedron_item.h @@ -45,7 +45,7 @@ public: MEAN_ANGLE }; QString compute_stats(int type); - void header(Header_data &); + CGAL::Three::Scene_item::Header_data header() const; Scene_polyhedron_item(); // Scene_polyhedron_item(const Scene_polyhedron_item&); Scene_polyhedron_item(const Polyhedron& p); diff --git a/Three/include/CGAL/Three/Scene_item.h b/Three/include/CGAL/Three/Scene_item.h index c680b8c7be1..21829f7a319 100644 --- a/Three/include/CGAL/Three/Scene_item.h +++ b/Three/include/CGAL/Three/Scene_item.h @@ -259,7 +259,7 @@ public: QList titles; }; //!Returns a Header_data struct containing the header information. - virtual Header_data header(); + virtual Header_data header()const; //!Returns a QString containing the requested value for the the table in the statistics dialog /*! * Example :