From cd5312a5adad65b2bc8ced4416ff1bc7fd52836e Mon Sep 17 00:00:00 2001 From: Maxime Gimeno Date: Tue, 8 Sep 2015 15:53:38 +0200 Subject: [PATCH] ::gl error fix and CGALColor warning fix --- .../Polyhedron_demo_hole_filling_plugin.cpp | 4 +-- ...hedron_demo_point_set_selection_plugin.cpp | 2 +- Polyhedron/demo/Polyhedron/Scene.cpp | 6 ---- Polyhedron/demo/Polyhedron/Scene_c2t3_item.h | 4 +-- .../Scene_implicit_function_item.cpp | 2 +- .../Scene_points_with_normal_item.cpp | 13 ++++--- Polyhedron/demo/Polyhedron/Viewer.cpp | 36 +++++++++---------- 7 files changed, 30 insertions(+), 37 deletions(-) diff --git a/Polyhedron/demo/Polyhedron/Polyhedron_demo_hole_filling_plugin.cpp b/Polyhedron/demo/Polyhedron/Polyhedron_demo_hole_filling_plugin.cpp index 43a9325e747..d5df0e927e1 100644 --- a/Polyhedron/demo/Polyhedron/Polyhedron_demo_hole_filling_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Polyhedron_demo_hole_filling_plugin.cpp @@ -102,8 +102,8 @@ public: void draw_edges(Viewer_interface* viewer) const { for(Polyline_data_list::const_iterator it = polyline_data_list.begin(); it != polyline_data_list.end(); ++it) { - if(it == active_hole) { ::glLineWidth(7.f); } - else { ::glLineWidth(3.f); } + if(it == active_hole) { viewer->glLineWidth(7.f); } + else { viewer->glLineWidth(3.f); } if(selected_holes.find(it) != selected_holes.end()) { it->polyline->setRbgColor(255, 0, 0); } diff --git a/Polyhedron/demo/Polyhedron/Polyhedron_demo_point_set_selection_plugin.cpp b/Polyhedron/demo/Polyhedron/Polyhedron_demo_point_set_selection_plugin.cpp index a4cefb15f52..be9c8d32fe0 100644 --- a/Polyhedron/demo/Polyhedron/Polyhedron_demo_point_set_selection_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Polyhedron_demo_point_set_selection_plugin.cpp @@ -74,7 +74,7 @@ public: } void draw_edges(Viewer_interface* viewer) const { - ::glLineWidth(3.f); + viewer->glLineWidth(3.f); polyline->setRbgColor(0, 255, 0); polyline->draw_edges(viewer); diff --git a/Polyhedron/demo/Polyhedron/Scene.cpp b/Polyhedron/demo/Polyhedron/Scene.cpp index dcb83773e21..b4fdbdc3bc5 100644 --- a/Polyhedron/demo/Polyhedron/Scene.cpp +++ b/Polyhedron/demo/Polyhedron/Scene.cpp @@ -20,12 +20,6 @@ #include -namespace { -void CGALglcolor(QColor c) -{ - ::glColor4d(c.red()/255.0, c.green()/255.0, c.blue()/255.0, c.alpha()/255.0); -} -} GlSplat::SplatRenderer* Scene::ms_splatting = 0; diff --git a/Polyhedron/demo/Polyhedron/Scene_c2t3_item.h b/Polyhedron/demo/Polyhedron/Scene_c2t3_item.h index ab946836d24..724867e4a5b 100644 --- a/Polyhedron/demo/Polyhedron/Scene_c2t3_item.h +++ b/Polyhedron/demo/Polyhedron/Scene_c2t3_item.h @@ -76,7 +76,7 @@ public: } void draw() const { - ::glBegin(GL_TRIANGLES); + /* ::glBegin(GL_TRIANGLES); for(C2t3::Facet_iterator fit = c2t3().facets_begin(), end = c2t3().facets_end(); @@ -89,7 +89,7 @@ public: const Tr::Geom_traits::Point_3& pc = cell->vertex((index+3)&3)->point(); draw_triangle(pa, pb, pc); } - ::glEnd(); + ::glEnd();*/ } private: diff --git a/Polyhedron/demo/Polyhedron/Scene_implicit_function_item.cpp b/Polyhedron/demo/Polyhedron/Scene_implicit_function_item.cpp index 82d1e587e80..85694e3340c 100644 --- a/Polyhedron/demo/Polyhedron/Scene_implicit_function_item.cpp +++ b/Polyhedron/demo/Polyhedron/Scene_implicit_function_item.cpp @@ -506,7 +506,7 @@ compute_function_grid() const typedef K::Point_3 Point_3; // Get transformation - const ::GLdouble* m = frame_->matrix(); + const GLdouble* m = frame_->matrix(); // OpenGL matrices are row-major matrices Aff_transformation t (m[0], m[4], m[8], m[12], diff --git a/Polyhedron/demo/Polyhedron/Scene_points_with_normal_item.cpp b/Polyhedron/demo/Polyhedron/Scene_points_with_normal_item.cpp index 48d18a676ec..140944bf794 100644 --- a/Polyhedron/demo/Polyhedron/Scene_points_with_normal_item.cpp +++ b/Polyhedron/demo/Polyhedron/Scene_points_with_normal_item.cpp @@ -167,7 +167,6 @@ void Scene_points_with_normal_item::compute_normals_and_vertices(void) // Draw *selected* points if (m_points->nb_selected_points() > 0) { - ::glPointSize(4.f); // selected => bigger for (Point_set_3::const_iterator it = m_points->begin(); it != m_points->end(); it++) { const UI_point& p = *it; @@ -381,19 +380,19 @@ bool Scene_points_with_normal_item::supportsRenderingMode(RenderingMode m) const ( m==PointsPlusNormals || m==Splatting ) ); } -void Scene_points_with_normal_item::draw_splats(Viewer_interface*) const +void Scene_points_with_normal_item::draw_splats(Viewer_interface* viewer) const { // TODO add support for selection - ::glBegin(GL_POINTS); + viewer->glBegin(GL_POINTS); for ( Point_set_3::const_iterator it = m_points->begin(); it != m_points->end(); it++) { const UI_point& p = *it; - ::glNormal3dv(&p.normal().x()); - ::glMultiTexCoord1d(GL_TEXTURE2, p.radius()); - ::glVertex3dv(&p.x()); + viewer->glNormal3dv(&p.normal().x()); + viewer->glMultiTexCoord1d(GL_TEXTURE2, p.radius()); + viewer->glVertex3dv(&p.x()); } - ::glEnd(); + viewer->glEnd(); diff --git a/Polyhedron/demo/Polyhedron/Viewer.cpp b/Polyhedron/demo/Polyhedron/Viewer.cpp index 7da7c0d194f..fee167b5b4c 100644 --- a/Polyhedron/demo/Polyhedron/Viewer.cpp +++ b/Polyhedron/demo/Polyhedron/Viewer.cpp @@ -190,39 +190,39 @@ void Viewer_impl::draw_aux(bool with_names, Viewer* viewer) if(scene == 0) return; - ::glLineWidth(1.0f); - ::glPointSize(2.f); - ::glEnable(GL_POLYGON_OFFSET_FILL); - ::glPolygonOffset(1.0f,1.0f); - ::glPolygonMode(GL_FRONT_AND_BACK,GL_FILL); + viewer->glLineWidth(1.0f); + viewer->glPointSize(2.f); + viewer->glEnable(GL_POLYGON_OFFSET_FILL); + viewer->glPolygonOffset(1.0f,1.0f); + viewer->glPolygonMode(GL_FRONT_AND_BACK,GL_FILL); - ::glLightModeli(GL_LIGHT_MODEL_LOCAL_VIEWER, GL_TRUE); + viewer->glLightModeli(GL_LIGHT_MODEL_LOCAL_VIEWER, GL_TRUE); if(twosides) - ::glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, GL_TRUE); + viewer->glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, GL_TRUE); else - ::glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, GL_FALSE); + viewer->glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, GL_FALSE); if(antialiasing) { - ::glEnable(GL_BLEND); - ::glEnable(GL_LINE_SMOOTH); - ::glHint(GL_LINE_SMOOTH_HINT, GL_NICEST); - ::glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + viewer->glEnable(GL_BLEND); + viewer->glEnable(GL_LINE_SMOOTH); + viewer->glHint(GL_LINE_SMOOTH_HINT, GL_NICEST); + viewer->glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); } else { - ::glDisable(GL_BLEND); - ::glDisable(GL_LINE_SMOOTH); - ::glHint(GL_LINE_SMOOTH_HINT, GL_FASTEST); - ::glBlendFunc(GL_ONE, GL_ZERO); + viewer->glDisable(GL_BLEND); + viewer->glDisable(GL_LINE_SMOOTH); + viewer->glHint(GL_LINE_SMOOTH_HINT, GL_FASTEST); + viewer->glBlendFunc(GL_ONE, GL_ZERO); } if(with_names) scene->drawWithNames(viewer); else scene->draw(viewer); - ::glDisable(GL_POLYGON_OFFSET_FILL); - ::glPolygonMode(GL_FRONT_AND_BACK,GL_FILL); + viewer->glDisable(GL_POLYGON_OFFSET_FILL); + viewer->glPolygonMode(GL_FRONT_AND_BACK,GL_FILL); } void Viewer::drawWithNames()