mirror of https://github.com/CGAL/cgal
added menu to output to console
This commit is contained in:
parent
99ca0cea7d
commit
c6e560e07e
|
|
@ -100,7 +100,7 @@
|
|||
<addaction name="actionRelocate_vertices"/>
|
||||
<addaction name="actionReconstruction_reinit"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionOutput_to_console"/>
|
||||
<addaction name="actionOutput_console"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionSet_options"/>
|
||||
<addaction name="separator"/>
|
||||
|
|
@ -590,7 +590,7 @@
|
|||
<string>O</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionOutput_to_console">
|
||||
<action name="actionOutput_console">
|
||||
<property name="text">
|
||||
<string>Output to console</string>
|
||||
</property>
|
||||
|
|
|
|||
|
|
@ -637,6 +637,36 @@ public:
|
|||
m_pwsrec->relocate_all_points();
|
||||
}
|
||||
|
||||
void output_console()
|
||||
{
|
||||
std::cout << "(-------------Off output---------- )" << std::endl;
|
||||
std::vector<Point> points;
|
||||
std::vector<std::size_t> isolated_vertices;
|
||||
std::vector<std::pair<std::size_t, std::size_t> > edges;
|
||||
|
||||
m_pwsrec->indexed_output(
|
||||
std::back_inserter(points),
|
||||
std::back_inserter(isolated_vertices),
|
||||
std::back_inserter(edges));
|
||||
|
||||
std::cout << "OFF " << points.size() << " 0 " << edges.size() << std::endl;
|
||||
|
||||
// points
|
||||
std::vector<Point>::iterator pit;
|
||||
for (pit = points.begin(); pit != points.end(); pit++)
|
||||
std::cout << *pit << std::endl;
|
||||
|
||||
// isolated vertices
|
||||
std::vector<std::size_t>::iterator vit;
|
||||
for (vit = isolated_vertices.begin(); vit != isolated_vertices.end(); vit++)
|
||||
std::cout << "1 " << *vit << std::endl;
|
||||
|
||||
// edges
|
||||
std::vector<std::pair<std::size_t, std::size_t> >::iterator eit;
|
||||
for (eit = edges.begin(); eit != edges.end(); eit++)
|
||||
std::cout << "2 " << eit->first << " " << eit->second << std::endl;
|
||||
}
|
||||
|
||||
// RENDER //
|
||||
|
||||
void render(const bool view_points, const bool view_vertices,
|
||||
|
|
|
|||
|
|
@ -530,12 +530,22 @@ void MainWindow::on_actionReconstruction_until_triggered()
|
|||
|
||||
void MainWindow::on_actionRelocate_vertices_triggered()
|
||||
{
|
||||
QApplication::setOverrideCursor(Qt::WaitCursor);
|
||||
m_scene->relocate_all_points();
|
||||
QApplication::restoreOverrideCursor();
|
||||
update();
|
||||
QApplication::setOverrideCursor(Qt::WaitCursor);
|
||||
m_scene->relocate_all_points();
|
||||
QApplication::restoreOverrideCursor();
|
||||
update();
|
||||
}
|
||||
|
||||
void MainWindow::on_actionOutput_console_triggered()
|
||||
{
|
||||
QApplication::setOverrideCursor(Qt::WaitCursor);
|
||||
m_scene->output_console();
|
||||
QApplication::restoreOverrideCursor();
|
||||
update();
|
||||
}
|
||||
|
||||
|
||||
|
||||
//////////
|
||||
// VIEW //
|
||||
//////////
|
||||
|
|
|
|||
|
|
@ -97,6 +97,7 @@ public:
|
|||
void on_actionReconstruction_until_triggered();
|
||||
void on_actionRelocate_vertices_triggered();
|
||||
void on_actionReconstruction_reinit_triggered();
|
||||
void on_actionOutput_console_triggered();
|
||||
|
||||
// view
|
||||
void on_actionView_points_toggled();
|
||||
|
|
|
|||
Loading…
Reference in New Issue