mirror of https://github.com/CGAL/cgal
Add a workaround so that one use QColor::lighter for Qt>=4.3 and QColor::light for Qt<=4.2.
This commit is contained in:
parent
051aa10937
commit
04b54f52e3
|
|
@ -205,39 +205,23 @@ void MainWindow::selectionChanged()
|
|||
viewer->updateGL();
|
||||
}
|
||||
|
||||
void MainWindow::quit()
|
||||
{
|
||||
writeSettings();
|
||||
close();
|
||||
}
|
||||
|
||||
void MainWindow::readSettings()
|
||||
{
|
||||
QSettings settings;
|
||||
|
||||
settings.beginGroup("MainWindow");
|
||||
resize(settings.value("size", QSize(400, 400)).toSize());
|
||||
move(settings.value("pos", QPoint(0, 0)).toPoint());
|
||||
QByteArray mainWindowState = settings.value("state").toByteArray();
|
||||
if(!mainWindowState.isNull()) {
|
||||
restoreState(mainWindowState);
|
||||
}
|
||||
settings.endGroup();
|
||||
this->readState("MainWindow", Size|State);
|
||||
}
|
||||
|
||||
void MainWindow::writeSettings()
|
||||
{
|
||||
QSettings settings;
|
||||
|
||||
settings.beginGroup("MainWindow");
|
||||
settings.setValue("size", size());
|
||||
settings.setValue("pos", pos());
|
||||
settings.setValue("state", saveState());
|
||||
settings.endGroup();
|
||||
|
||||
this->writeState("MainWindow");
|
||||
std::cerr << "Write setting... done.\n";
|
||||
}
|
||||
|
||||
void MainWindow::quit()
|
||||
{
|
||||
writeSettings();
|
||||
close();
|
||||
}
|
||||
|
||||
void MainWindow::closeEvent(QCloseEvent *event)
|
||||
{
|
||||
writeSettings();
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#define CGAL_SURFACE_MESHER_VERBOSE 0
|
||||
#define CGAL_SURFACE_MESHER_VERBOSE 1
|
||||
#undef CGAL_SURFACE_MESHER_VERBOSE
|
||||
|
||||
#include <QApplication>
|
||||
|
|
@ -20,6 +20,7 @@
|
|||
|
||||
#include <CGAL/IO/Complex_2_in_triangulation_3_file_writer.h>
|
||||
#include <CGAL/IO/Complex_2_in_triangulation_3_polyhedron_builder.h>
|
||||
#include <CGAL/IO/Complex_2_in_triangulation_3_file_writer.h>
|
||||
|
||||
#include <QTime>
|
||||
#include <QInputDialog>
|
||||
|
|
@ -119,7 +120,9 @@ void MainWindow::on_actionRemeshing_triggered()
|
|||
// remesh
|
||||
time.start();
|
||||
std::cout << "Remesh...";
|
||||
CGAL::make_surface_mesh(c2t3, input, facets_criteria, CGAL::Manifold_tag());
|
||||
CGAL::make_surface_mesh(c2t3, input, facets_criteria, CGAL::Non_manifold_tag());
|
||||
std::ofstream out("out.off");
|
||||
CGAL::output_surface_facets_to_off(out, c2t3);
|
||||
std::cout << "done (" << time.elapsed() << " ms, " << tr.number_of_vertices() << " vertices)" << std::endl;
|
||||
|
||||
if(tr.number_of_vertices() > 0)
|
||||
|
|
|
|||
|
|
@ -288,6 +288,11 @@ void Scene::initializeGL()
|
|||
texture.GetData());
|
||||
}
|
||||
|
||||
// workaround for Qt-4.2.
|
||||
#if QT_VERSION < 0x040300
|
||||
# define lighter light
|
||||
#endif
|
||||
|
||||
void
|
||||
Scene::draw(bool with_names)
|
||||
{
|
||||
|
|
@ -334,7 +339,7 @@ Scene::draw(bool with_names)
|
|||
}
|
||||
|
||||
}
|
||||
if(viewEdges)
|
||||
if(viewEdges || entry.rendering_mode == Wireframe)
|
||||
{
|
||||
::glDisable(GL_LIGHTING);
|
||||
::glPolygonMode(GL_FRONT_AND_BACK,GL_LINE);
|
||||
|
|
@ -360,6 +365,9 @@ Scene::draw(bool with_names)
|
|||
}
|
||||
}
|
||||
|
||||
// workaround for Qt-4.2 (see below)
|
||||
#undef lighter
|
||||
|
||||
void
|
||||
Scene::draw(Polyhedron_entry& entry)
|
||||
{
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue