mirror of https://github.com/CGAL/cgal
Makes the facets color editable.
This commit is contained in:
parent
dd9a666fd4
commit
1adc45b2fc
|
|
@ -181,7 +181,7 @@ void Scene_polyhedron_selection_item::draw(CGAL::Three::Viewer_interface* viewer
|
|||
program = getShaderProgram(PROGRAM_WITH_LIGHT);
|
||||
attrib_buffers(viewer,PROGRAM_WITH_LIGHT);
|
||||
program->bind();
|
||||
program->setAttributeValue("colors",facet_color);
|
||||
program->setAttributeValue("colors",this->color());
|
||||
viewer->glDrawArrays(GL_TRIANGLES, 0, static_cast<GLsizei>(nb_facets/3));
|
||||
program->release();
|
||||
vaos[0]->release();
|
||||
|
|
|
|||
|
|
@ -187,6 +187,7 @@ public:
|
|||
nb_facets = 0;
|
||||
nb_points = 0;
|
||||
nb_lines = 0;
|
||||
this->setColor(facet_color);
|
||||
}
|
||||
|
||||
Scene_polyhedron_selection_item(Scene_polyhedron_item* poly_item, QMainWindow* mw)
|
||||
|
|
@ -207,6 +208,7 @@ public:
|
|||
buffers[i].create();
|
||||
}
|
||||
init(poly_item, mw);
|
||||
this->setColor(facet_color);
|
||||
invalidateOpenGLBuffers();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -298,7 +298,7 @@ public Q_SLOTS:
|
|||
//!Must be overloaded.
|
||||
virtual void invalidateOpenGLBuffers();
|
||||
//!Setter for the color of the item. Calls invalidateOpenGLBuffers() so the new color is applied.
|
||||
virtual void setColor(QColor c) { color_ = c; invalidateOpenGLBuffers(); }
|
||||
virtual void setColor(QColor c) { color_ = c; if(!is_monochrome)invalidateOpenGLBuffers(); }
|
||||
//!Setter for the RGB color of the item. Calls setColor(QColor).
|
||||
//!@see setColor(QColor c)
|
||||
void setRbgColor(int r, int g, int b) { setColor(QColor(r, g, b)); }
|
||||
|
|
|
|||
Loading…
Reference in New Issue