mirror of https://github.com/CGAL/cgal
The Truiangulation_2/examples which use draw() compile and visualize but have an assertion in a QMap
This commit is contained in:
parent
c6ce5fb120
commit
47683f2dea
|
|
@ -34,7 +34,7 @@
|
|||
#include <CGAL/Qt/manipulatedFrame.h>
|
||||
#include <QKeyEvent>
|
||||
#include <QOpenGLVertexArrayObject>
|
||||
#include <QGLBuffer>
|
||||
#include <QOpenGLBuffer>
|
||||
#include <QOpenGLShaderProgram>
|
||||
|
||||
#ifdef __GNUC__
|
||||
|
|
@ -1779,7 +1779,7 @@ protected:
|
|||
static const unsigned int NB_VBO_BUFFERS=(END_POS-BEGIN_POS)+
|
||||
(END_COLOR-BEGIN_COLOR)+2; // +2 for 2 vectors of normals
|
||||
|
||||
QGLBuffer buffers[NB_VBO_BUFFERS];
|
||||
QOpenGLBuffer buffers[NB_VBO_BUFFERS];
|
||||
|
||||
// The following enum gives the indices of the different vao.
|
||||
enum
|
||||
|
|
|
|||
|
|
@ -13,19 +13,22 @@
|
|||
#define CGAL_QT_CREATE_OPENGL_CONTEXT_H
|
||||
|
||||
#include <QOpenGLContext>
|
||||
#include <QGLContext>
|
||||
|
||||
namespace CGAL{
|
||||
namespace Qt{
|
||||
inline QGLContext* createOpenGLContext()
|
||||
inline QOpenGLContext* createOpenGLContext()
|
||||
{
|
||||
QOpenGLContext *context = new QOpenGLContext();
|
||||
QSurfaceFormat format;
|
||||
format.setVersion(2,1);
|
||||
format.setProfile(QSurfaceFormat::CompatibilityProfile);
|
||||
context->setFormat(format);
|
||||
QGLContext *result = QGLContext::fromOpenGLContext(context);
|
||||
result->create();
|
||||
return result;
|
||||
context->create();
|
||||
return context;
|
||||
|
||||
//QSurfaceFormat format;
|
||||
//format.setVersion(2,1);
|
||||
//format.setProfile(QSurfaceFormat::CompatibilityProfile);
|
||||
//context->setFormat(format);
|
||||
//QGLContext *result = QGLContext::fromOpenGLContext(context);
|
||||
// result->create();
|
||||
//return result;
|
||||
}
|
||||
} // namespace Qt
|
||||
} // namespace CGAL
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@
|
|||
#include <QImage>
|
||||
#include <QMessageBox>
|
||||
#include <QMouseEvent>
|
||||
#include <QPainter>
|
||||
#include <QPushButton>
|
||||
#include <QTabWidget>
|
||||
#include <QTextEdit>
|
||||
|
|
@ -2455,7 +2456,10 @@ void CGAL::QGLViewer::setMouseBinding(::Qt::Key key, ::Qt::KeyboardModifiers mod
|
|||
mouseBinding_.insert(mbp, map);
|
||||
|
||||
ClickBindingPrivate cbp(modifiers, button, false, ::Qt::NoButton, key);
|
||||
clickBinding_.remove(cbp);
|
||||
|
||||
// AF: currently results in a runtime error
|
||||
// clickBinding_.remove(cbp);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
cmake_minimum_required(VERSION 3.1...3.23)
|
||||
project(Triangulation_2_Examples)
|
||||
|
||||
find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt5)
|
||||
find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt6)
|
||||
|
||||
# create a target per cppfile
|
||||
file(
|
||||
|
|
@ -15,10 +15,10 @@ foreach(cppfile ${cppfiles})
|
|||
create_single_source_cgal_program("${cppfile}")
|
||||
endforeach()
|
||||
|
||||
if(CGAL_Qt5_FOUND)
|
||||
if(CGAL_Qt6_FOUND)
|
||||
target_link_libraries(polygon_triangulation PUBLIC CGAL::CGAL_Basic_viewer)
|
||||
target_link_libraries(draw_triangulation_2 PUBLIC CGAL::CGAL_Basic_viewer)
|
||||
target_link_libraries(star_conflict_zone PUBLIC CGAL::CGAL_Basic_viewer)
|
||||
else()
|
||||
message(STATUS "NOTICE: Several examples require Qt5 and will not be compiled.")
|
||||
message(STATUS "NOTICE: Several examples require Qt6 and will not be compiled.")
|
||||
endif()
|
||||
|
|
|
|||
Loading…
Reference in New Issue