mirror of https://github.com/CGAL/cgal
Fix for the context
This commit is contained in:
parent
6a405ff7e3
commit
552aaa159f
|
|
@ -5,7 +5,7 @@
|
|||
#include <CGAL/Qt/CreateOpenGLContext.h>
|
||||
|
||||
Viewer::Viewer(QWidget* parent)
|
||||
: QGLViewer(CGAL::Qt::createOpenGLContext(),parent),
|
||||
: QGLViewer(CGAL::Qt::createOpenGLContext(parent),parent),
|
||||
m_pScene(NULL),
|
||||
m_custom_mouse(false)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
#include "CGAL/Qt/CreateOpenGLContext.h"
|
||||
|
||||
Viewer::Viewer(QWidget* parent)
|
||||
: QGLViewer(CGAL::Qt::createOpenGLContext(),parent)
|
||||
: QGLViewer(CGAL::Qt::createOpenGLContext(parent),parent)
|
||||
{
|
||||
are_buffers_initialized = false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
|
||||
Viewer::Viewer(QWidget* parent )
|
||||
: QGLViewer(CGAL::Qt::createOpenGLContext(),parent)
|
||||
: QGLViewer(CGAL::Qt::createOpenGLContext(parent),parent)
|
||||
{
|
||||
extension_is_found = false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,9 +23,9 @@
|
|||
#include <QGLContext>
|
||||
namespace CGAL{
|
||||
namespace Qt{
|
||||
inline QGLContext* createOpenGLContext()
|
||||
inline QGLContext* createOpenGLContext(QObject* parent)
|
||||
{
|
||||
QOpenGLContext *context = new QOpenGLContext();
|
||||
QOpenGLContext *context = new QOpenGLContext(parent);
|
||||
QSurfaceFormat format;
|
||||
format.setVersion(2,1);
|
||||
format.setProfile(QSurfaceFormat::CompatibilityProfile);
|
||||
|
|
@ -35,9 +35,9 @@ inline QGLContext* createOpenGLContext()
|
|||
return result;
|
||||
}
|
||||
|
||||
inline QGLContext* createOpenGLMSAAContext()
|
||||
inline QGLContext* createOpenGLMSAAContext(QObject* parent)
|
||||
{
|
||||
QOpenGLContext *context = new QOpenGLContext();
|
||||
QOpenGLContext *context = new QOpenGLContext(parent);
|
||||
QSurfaceFormat format;
|
||||
format.setVersion(2,1);
|
||||
format.setProfile(QSurfaceFormat::CompatibilityProfile);
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@
|
|||
#include <QDebug>
|
||||
|
||||
Viewer::Viewer(QWidget* parent)
|
||||
: QGLViewer(CGAL::Qt::createOpenGLMSAAContext(),parent), wireframe(false),
|
||||
: QGLViewer(CGAL::Qt::createOpenGLMSAAContext(parent),parent), wireframe(false),
|
||||
flatShading(true), edges(true), vertices(true),
|
||||
m_previous_scene_empty(true), are_buffers_initialized(false)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -11,11 +11,11 @@ endif()
|
|||
# If you want to visualize a linear cell complex, you can use the following viewer
|
||||
# based on qt. Just uncomment the following two lines, plus the lines qt5_use_modules below
|
||||
|
||||
# find_package(CGAL COMPONENTS Qt5)
|
||||
# include("CMakeLCCViewerQt.inc")
|
||||
find_package(CGAL COMPONENTS Qt5)
|
||||
include("CMakeLCCViewerQt.inc")
|
||||
|
||||
# If you don't want to visualize, use the following line (otherwise comment it)
|
||||
find_package(CGAL QUIET COMPONENTS Core)
|
||||
#find_package(CGAL QUIET COMPONENTS Core)
|
||||
|
||||
# For Gprof.
|
||||
# ADD_DEFINITIONS("-pg")
|
||||
|
|
@ -43,12 +43,12 @@ if ( CGAL_FOUND )
|
|||
add_executable(voronoi_2 voronoi_2.cpp)
|
||||
target_link_libraries(voronoi_2 ${CGAL_LIBRARIES} ${CGAL_3RD_PARTY_LIBRARIES}
|
||||
${MAP_VIEWER_LIBRARIES})
|
||||
# qt5_use_modules(voronoi_2 ${MAP_VIEWER_MODULES})
|
||||
qt5_use_modules(voronoi_2 ${MAP_VIEWER_MODULES})
|
||||
|
||||
add_executable(voronoi_3 voronoi_3.cpp)
|
||||
target_link_libraries(voronoi_3 ${CGAL_LIBRARIES} ${CGAL_3RD_PARTY_LIBRARIES}
|
||||
${MAP_VIEWER_LIBRARIES})
|
||||
# qt5_use_modules(voronoi_3 ${MAP_VIEWER_MODULES})
|
||||
qt5_use_modules(voronoi_3 ${MAP_VIEWER_MODULES})
|
||||
|
||||
else()
|
||||
|
||||
|
|
|
|||
|
|
@ -154,7 +154,7 @@ class SimpleLCCViewerQt : public QGLViewer, public QOpenGLFunctions_2_1
|
|||
public:
|
||||
// Constructor/Destructor
|
||||
SimpleLCCViewerQt(LCC& alcc) :
|
||||
QGLViewer(CGAL::Qt::createOpenGLContext()),
|
||||
QGLViewer(CGAL::Qt::createOpenGLContext(0)),
|
||||
lcc(alcc),
|
||||
wireframe(false),
|
||||
flatShading(true),
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
#include <CGAL/Qt/CreateOpenGLContext.h>
|
||||
|
||||
Viewer::Viewer(QWidget* parent, bool antialiasing)
|
||||
: QGLViewer(CGAL::Qt::createOpenGLContext(), parent),
|
||||
: QGLViewer(CGAL::Qt::createOpenGLContext(parent), parent),
|
||||
scene(0),
|
||||
antialiasing(antialiasing),
|
||||
twosides(false),
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
#include <CGAL/Qt/CreateOpenGLContext.h>
|
||||
|
||||
Viewer::Viewer(QWidget *parent)
|
||||
: QGLViewer(CGAL::Qt::createOpenGLContext(),parent)
|
||||
: QGLViewer(CGAL::Qt::createOpenGLContext(parent),parent)
|
||||
{}
|
||||
Viewer::~Viewer()
|
||||
{}
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ class Viewer : public QGLViewer, QOpenGLFunctions_2_1 {
|
|||
int nr_of_facets;
|
||||
public:
|
||||
Viewer(QWidget* parent)
|
||||
: QGLViewer(CGAL::Qt::createOpenGLContext(), parent)
|
||||
: QGLViewer(CGAL::Qt::createOpenGLContext(parent), parent)
|
||||
{}
|
||||
~Viewer()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ public:
|
|||
NB_OF_PROGRAMS /** Holds the number of different programs in this enum.*/
|
||||
};
|
||||
|
||||
Viewer_interface(QWidget* parent) : QGLViewer(CGAL::Qt::createOpenGLContext(), parent) {}
|
||||
Viewer_interface(QWidget* parent) : QGLViewer(CGAL::Qt::createOpenGLContext(parent), parent) {}
|
||||
virtual ~Viewer_interface() {}
|
||||
|
||||
//! Sets the scene for the viewer.
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ class Viewer : public QGLViewer, QOpenGLFunctions_2_1 {
|
|||
|
||||
public:
|
||||
Viewer(QWidget* parent)
|
||||
: QGLViewer(CGAL::Qt::createOpenGLContext(),parent)
|
||||
: QGLViewer(CGAL::Qt::createOpenGLContext(parent),parent)
|
||||
, m_showAxis(false)
|
||||
, m_showVertex(true)
|
||||
, m_showDEdge(true)
|
||||
|
|
|
|||
Loading…
Reference in New Issue