mirror of https://github.com/CGAL/cgal
::gl error fix and CGALColor warning fix
This commit is contained in:
parent
ea54208be1
commit
cd5312a5ad
|
|
@ -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); }
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -20,12 +20,6 @@
|
|||
#include <QAbstractProxyModel>
|
||||
|
||||
|
||||
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;
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -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],
|
||||
|
|
|
|||
|
|
@ -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<Kernel>::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<Kernel>::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();
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Reference in New Issue