- Change tooltips

- Rename some actions
- Shortest_path doesn't create a polyline if there is no path.
This commit is contained in:
Maxime Gimeno 2017-07-17 11:27:37 +02:00
parent f6b6390cce
commit 39bfcebbee
8 changed files with 24 additions and 21 deletions

View File

@ -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;

View File

@ -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);

View File

@ -408,10 +408,10 @@ bool Scene_polyhedron_shortest_path_item_priv::run_point_select(const Ray_3& ray
boost::property_map<Face_graph, CGAL::face_index_t>::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;
}

View File

@ -487,7 +487,7 @@ Scene_nef_polyhedron_item::toolTip() const
return QString();
return QObject::tr("<p><b>%1</b> (mode: %5, color: %6)<br />"
"<i>Nef_3 polyhedron</i></p>"
"<i>Nef_polyhedron_3</i></p>"
"<p>Number of vertices: %2<br />"
"Number of edges: %3<br />"
"Number of facets: %4<br />"

View File

@ -663,7 +663,7 @@ Scene_points_with_normal_item::toolTip() const
Q_ASSERT(d->m_points != NULL);
return QObject::tr("<p><b>%1</b> (color: %4)<br />"
"<i>Point set</i></p>"
"<i>Point_set_3</i></p>"
"<p>Number of points: %2</p>")
.arg(name())
.arg(d->m_points->size())

View File

@ -998,7 +998,7 @@ Scene_polyhedron_item::toolTip() const
return QString();
QString str =
QObject::tr("<p>Polyhedron <b>%1</b> (mode: %5, color: %6)</p>"
QObject::tr("<p>Polyhedron_3 <b>%1</b> (mode: %5, color: %6)</p>"
"<p>Number of vertices: %2<br />"
"Number of edges: %3<br />"
"Number of facets: %4")

View File

@ -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("<p>Legende of endpoints colors: <ul>"
QString("<p>Legend of endpoints colors: <ul>"
"<li>black: one incident polyline</li>"
"<li>green: two incident polylines</li>"
"<li>blue: three incident polylines</li>"

View File

@ -343,7 +343,7 @@ Scene_textured_polyhedron_item::toolTip() const
if(!d->poly)
return QString();
return QObject::tr("<p>Textured polyhedron <b>%1</b> (mode: %5, color: %6)</p>"
return QObject::tr("<p>Textured Polyhedron_3 <b>%1</b> (mode: %5, color: %6)</p>"
"<p>Number of vertices: %2<br />"
"Number of edges: %3<br />"
"Number of facets: %4</p>")