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