Merge branch 'CGAL-Qt5_support-GF' of github.com:CGAL/cgal-public-dev into CGAL-Qt5_support-GF

This commit is contained in:
Andreas Fabri 2015-07-07 11:20:17 +02:00
commit 82e56b036d
3 changed files with 10 additions and 12 deletions

View File

@ -46,8 +46,6 @@ Scene::Scene()
m_max_distance_function = (FT)0.0;
texture = new Texture(m_grid_size,m_grid_size);
are_buffers_initialized = false;
context_initialized = false;
}
@ -591,12 +589,6 @@ void Scene::update_bbox()
void Scene::draw(QGLViewer* viewer)
{
if(!context_initialized)
{
initializeOpenGLFunctions();
glGenTextures(1, &textureId);
context_initialized = true;
}
if(!are_buffers_initialized)
initialize_buffers();
QColor color;
@ -1317,3 +1309,9 @@ void Scene::deactivate_cutting_plane()
disconnect(m_frame, SIGNAL(modified()), this, SLOT(cutting_plane()));
m_view_plane = false;
}
void Scene::initGL()
{
initializeOpenGLFunctions();
glGenTextures(1, &textureId);
compile_shaders();
}

View File

@ -81,6 +81,7 @@ public:
void update_bbox();
Bbox bbox() { return m_bbox; }
ManipulatedFrame* manipulatedFrame() const { return m_frame; }
void initGL();
private:
// member data
@ -110,7 +111,6 @@ private:
Cut_planes_types m_cut_plane;
bool are_buffers_initialized;
bool context_initialized;
private:
// utility functions
@ -167,6 +167,7 @@ private:
void initialize_buffers();
void compute_elements(int mode);
void attrib_buffers(QGLViewer*);
void compile_shaders();
void compute_texture(int, int, Color_ramp, Color_ramp);
public:
@ -250,7 +251,6 @@ public slots:
// cutting plane
void cutting_plane();
void changed();
void compile_shaders();
}; // end class Scene
#endif // SCENE_H

View File

@ -31,7 +31,7 @@ void Viewer::initializeGL()
QGLViewer::initializeGL();
setBackgroundColor(::Qt::white);
m_pScene->context = this->context();
m_pScene->compile_shaders();
m_pScene->initGL();
}
void Viewer::mousePressEvent(QMouseEvent* e)