From 39bfcebbeeeea7ecd25f3eeacfeca804ad6ca02b Mon Sep 17 00:00:00 2001
From: Maxime Gimeno
Date: Mon, 17 Jul 2017 11:27:37 +0200
Subject: [PATCH] - Change tooltips - Rename some actions - Shortest_path
doesn't create a polyline if there is no path.
---
.../Plugins/Convex_hull/Kernel_plugin.cpp | 3 +-
.../Plugins/PCA/Edit_box_plugin.cpp | 2 +-
.../Scene_polyhedron_shortest_path_item.cpp | 30 +++++++++++--------
.../Polyhedron/Scene_nef_polyhedron_item.cpp | 2 +-
.../Scene_points_with_normal_item.cpp | 2 +-
.../demo/Polyhedron/Scene_polyhedron_item.cpp | 2 +-
.../demo/Polyhedron/Scene_polylines_item.cpp | 2 +-
.../Scene_textured_polyhedron_item.cpp | 2 +-
8 files changed, 24 insertions(+), 21 deletions(-)
diff --git a/Polyhedron/demo/Polyhedron/Plugins/Convex_hull/Kernel_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/Convex_hull/Kernel_plugin.cpp
index 94ac9fdb4e0..5fbfe64e5d4 100644
--- a/Polyhedron/demo/Polyhedron/Plugins/Convex_hull/Kernel_plugin.cpp
+++ b/Polyhedron/demo/Polyhedron/Plugins/Convex_hull/Kernel_plugin.cpp
@@ -93,12 +93,11 @@ void Polyhedron_demo_kernel_plugin::on_actionKernel_triggered()
Polyhedron_kernel kernel;
if(!kernel.solve(triangles.begin(),triangles.end()))
{
- std::cout << "done (empty kernel)" << std::endl;
QApplication::restoreOverrideCursor();
+ std::cout << "done (empty kernel)" << std::endl;
QMessageBox::information(mw, tr("Empty Kernel"),
tr("The kernel of the polyhedron \"%1\" is empty.").
arg((item)?item->name():sm_item->name()));
-
return;
}
std::cout << "done" << 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 937e6f2068c..a2217015647 100644
--- a/Polyhedron/demo/Polyhedron/Plugins/PCA/Edit_box_plugin.cpp
+++ b/Polyhedron/demo/Polyhedron/Plugins/PCA/Edit_box_plugin.cpp
@@ -64,7 +64,7 @@ void Edit_box_plugin::init(QMainWindow* mainWindow, CGAL::Three::Scene_interface
{
scene = scene_interface;
mw = mainWindow;
- actionBbox = new QAction(tr("Create Bbox"), mainWindow);
+ actionBbox = new QAction(tr("Create Editable Bbox"), mainWindow);
connect(actionBbox, SIGNAL(triggered()),
this, SLOT(bbox()));
actionExport = new QAction(tr("Export to Face_graph item"), mainWindow);
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 94d3c6ca2ca..f0c73c1f9eb 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
@@ -408,10 +408,10 @@ bool Scene_polyhedron_shortest_path_item_priv::run_point_select(const Ray_3& ray
boost::property_map::type fimap
= get(CGAL::face_index, *item->polyhedron());
m_messages->information(QObject::tr("Shortest Paths: Selected Face: %1; Barycentric coordinates: %2 %3 %4")
- .arg(get(fimap, faceLocation.first))
- .arg(double(faceLocation.second[0]))
- .arg(double(faceLocation.second[1]))
- .arg(double(faceLocation.second[2])));
+ .arg(get(fimap, faceLocation.first))
+ .arg(double(faceLocation.second[0]))
+ .arg(double(faceLocation.second[1]))
+ .arg(double(faceLocation.second[2])));
switch (m_selectionMode)
{
case INSERT_POINTS_MODE:
@@ -451,9 +451,9 @@ bool Scene_polyhedron_shortest_path_item_priv::run_point_select(const Ray_3& ray
ensure_shortest_paths_tree();
Scene_polylines_item* polylines = new Scene_polylines_item();
-
+
polylines->polylines.push_back(Scene_polylines_item::Polyline());
-
+
m_messages->information(QObject::tr("Computing shortest path polyline..."));
QTime time;
@@ -461,12 +461,16 @@ bool Scene_polyhedron_shortest_path_item_priv::run_point_select(const Ray_3& ray
//~ m_shortestPaths->m_debugOutput=true;
m_shortestPaths->shortest_path_points_to_source_points(faceLocation.first, faceLocation.second, std::back_inserter(polylines->polylines.back()));
std::cout << "ok (" << time.elapsed() << " ms)" << std::endl;
-
- polylines->setName(QObject::tr("%1 (shortest path)").arg(item->polyhedron_item()->name()));
- polylines->setColor(Qt::red);
- this->m_sceneInterface->setSelectedItem(-1);
- this->m_sceneInterface->addItem(polylines);
- this->m_sceneInterface->changeGroup(polylines, item->parentGroup());
+ if(!polylines->polylines.front().empty())
+ {
+ polylines->setName(QObject::tr("%1 (shortest path)").arg(item->polyhedron_item()->name()));
+ polylines->setColor(Qt::red);
+ this->m_sceneInterface->setSelectedItem(-1);
+ this->m_sceneInterface->addItem(polylines);
+ this->m_sceneInterface->changeGroup(polylines, item->parentGroup());
+ }
+ else
+ delete polylines;
}
else
{
@@ -601,7 +605,7 @@ bool Scene_polyhedron_shortest_path_item::isFinite() const
return true;
}
-bool Scene_polyhedron_shortest_path_item::isEmpty() const
+bool Scene_polyhedron_shortest_path_item::isEmpty() const
{
return false;
}
diff --git a/Polyhedron/demo/Polyhedron/Scene_nef_polyhedron_item.cpp b/Polyhedron/demo/Polyhedron/Scene_nef_polyhedron_item.cpp
index 596977d94a2..17c7178a764 100644
--- a/Polyhedron/demo/Polyhedron/Scene_nef_polyhedron_item.cpp
+++ b/Polyhedron/demo/Polyhedron/Scene_nef_polyhedron_item.cpp
@@ -487,7 +487,7 @@ Scene_nef_polyhedron_item::toolTip() const
return QString();
return QObject::tr("%1 (mode: %5, color: %6)
"
- "Nef_3 polyhedron
"
+ "Nef_polyhedron_3
"
"Number of vertices: %2
"
"Number of edges: %3
"
"Number of facets: %4
"
diff --git a/Polyhedron/demo/Polyhedron/Scene_points_with_normal_item.cpp b/Polyhedron/demo/Polyhedron/Scene_points_with_normal_item.cpp
index a8922da9645..991e7e3b60f 100644
--- a/Polyhedron/demo/Polyhedron/Scene_points_with_normal_item.cpp
+++ b/Polyhedron/demo/Polyhedron/Scene_points_with_normal_item.cpp
@@ -663,7 +663,7 @@ Scene_points_with_normal_item::toolTip() const
Q_ASSERT(d->m_points != NULL);
return QObject::tr("
%1 (color: %4)
"
- "Point set
"
+ "Point_set_3"
"Number of points: %2
")
.arg(name())
.arg(d->m_points->size())
diff --git a/Polyhedron/demo/Polyhedron/Scene_polyhedron_item.cpp b/Polyhedron/demo/Polyhedron/Scene_polyhedron_item.cpp
index 48b7a633011..09622034012 100644
--- a/Polyhedron/demo/Polyhedron/Scene_polyhedron_item.cpp
+++ b/Polyhedron/demo/Polyhedron/Scene_polyhedron_item.cpp
@@ -998,7 +998,7 @@ Scene_polyhedron_item::toolTip() const
return QString();
QString str =
- QObject::tr("Polyhedron %1 (mode: %5, color: %6)
"
+ QObject::tr("Polyhedron_3 %1 (mode: %5, color: %6)
"
"Number of vertices: %2
"
"Number of edges: %3
"
"Number of facets: %4")
diff --git a/Polyhedron/demo/Polyhedron/Scene_polylines_item.cpp b/Polyhedron/demo/Polyhedron/Scene_polylines_item.cpp
index 60d84872678..48e451f2af4 100644
--- a/Polyhedron/demo/Polyhedron/Scene_polylines_item.cpp
+++ b/Polyhedron/demo/Polyhedron/Scene_polylines_item.cpp
@@ -244,7 +244,7 @@ Scene_polylines_item_private::computeSpheres()
spheres->add_sphere(K::Sphere_3(center+offset, spheres_drawn_square_radius), c);
}
spheres->setToolTip(
- QString("
Legende of endpoints colors:
"
+ QString("Legend of endpoints colors:
"
"- black: one incident polyline
"
"- green: two incident polylines
"
"- blue: three incident polylines
"
diff --git a/Polyhedron/demo/Polyhedron/Scene_textured_polyhedron_item.cpp b/Polyhedron/demo/Polyhedron/Scene_textured_polyhedron_item.cpp
index f3c101063fd..21ee04603e8 100644
--- a/Polyhedron/demo/Polyhedron/Scene_textured_polyhedron_item.cpp
+++ b/Polyhedron/demo/Polyhedron/Scene_textured_polyhedron_item.cpp
@@ -343,7 +343,7 @@ Scene_textured_polyhedron_item::toolTip() const
if(!d->poly)
return QString();
- return QObject::tr("Textured polyhedron %1 (mode: %5, color: %6)
"
+ return QObject::tr("Textured Polyhedron_3 %1 (mode: %5, color: %6)
"
"Number of vertices: %2
"
"Number of edges: %3
"
"Number of facets: %4
")