mirror of https://github.com/CGAL/cgal
Apply google-readability-casting to the off_plugin
This commit is contained in:
parent
3613a94638
commit
1a9a578df8
|
|
@ -1,5 +1,5 @@
|
||||||
---
|
---
|
||||||
Checks: '-clang-diagnostic*,-clang-analyzer*,modernize-use-nullptr'
|
Checks: '-clang-diagnostic*,-clang-analyzer*,google-readability-casting'
|
||||||
HeaderFilterRegex: 'CGAL/*'
|
HeaderFilterRegex: 'CGAL/*'
|
||||||
...
|
...
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ compute_color_map(QColor base_color,
|
||||||
Output_color_iterator out)
|
Output_color_iterator out)
|
||||||
{
|
{
|
||||||
qreal hue = base_color.hueF();
|
qreal hue = base_color.hueF();
|
||||||
const qreal step = ((qreal)1) / nb_of_colors;
|
const qreal step = (static_cast<qreal>(1)) / nb_of_colors;
|
||||||
|
|
||||||
qreal h = hue==-1 ? 0
|
qreal h = hue==-1 ? 0
|
||||||
:hue;
|
:hue;
|
||||||
|
|
|
||||||
|
|
@ -167,8 +167,8 @@ void Edge_container::draw(Viewer_interface *viewer,
|
||||||
if(getVao(viewer)->program->property("hasViewport").toBool())
|
if(getVao(viewer)->program->property("hasViewport").toBool())
|
||||||
{
|
{
|
||||||
getVao(viewer)->program->setUniformValue("viewport", getViewport());
|
getVao(viewer)->program->setUniformValue("viewport", getViewport());
|
||||||
getVao(viewer)->program->setUniformValue("near",(GLfloat)viewer->camera()->zNear());
|
getVao(viewer)->program->setUniformValue("near",static_cast<GLfloat>(viewer->camera()->zNear()));
|
||||||
getVao(viewer)->program->setUniformValue("far",(GLfloat)viewer->camera()->zFar());
|
getVao(viewer)->program->setUniformValue("far",static_cast<GLfloat>(viewer->camera()->zFar()));
|
||||||
}
|
}
|
||||||
if(getVao(viewer)->program->property("hasWidth").toBool())
|
if(getVao(viewer)->program->property("hasWidth").toBool())
|
||||||
getVao(viewer)->program->setUniformValue("width", getWidth());
|
getVao(viewer)->program->setUniformValue("width", getWidth());
|
||||||
|
|
|
||||||
|
|
@ -2494,15 +2494,15 @@ void MainWindow::viewerShowObject()
|
||||||
Scene_item* item = nullptr;
|
Scene_item* item = nullptr;
|
||||||
QAction* sender_action = qobject_cast<QAction*>(sender());
|
QAction* sender_action = qobject_cast<QAction*>(sender());
|
||||||
if(sender_action && !sender_action->data().isNull()) {
|
if(sender_action && !sender_action->data().isNull()) {
|
||||||
item = (Scene_item*)sender_action->data().value<void*>();
|
item = static_cast<Scene_item*>(sender_action->data().value<void*>());
|
||||||
}
|
}
|
||||||
if(item) {
|
if(item) {
|
||||||
const Scene::Bbox bbox = item->bbox();
|
const Scene::Bbox bbox = item->bbox();
|
||||||
CGAL::qglviewer::Vec min((float)bbox.xmin()+viewer->offset().x, (float)bbox.ymin()+viewer->offset().y, (float)bbox.zmin()+viewer->offset().z),
|
CGAL::qglviewer::Vec min(static_cast<float>(bbox.xmin())+viewer->offset().x, static_cast<float>(bbox.ymin())+viewer->offset().y, static_cast<float>(bbox.zmin())+viewer->offset().z),
|
||||||
max((float)bbox.xmax()+viewer->offset().x, (float)bbox.ymax()+viewer->offset().y, (float)bbox.zmax()+viewer->offset().z);
|
max(static_cast<float>(bbox.xmax())+viewer->offset().x, static_cast<float>(bbox.ymax())+viewer->offset().y, static_cast<float>(bbox.zmax())+viewer->offset().z);
|
||||||
viewer->setSceneBoundingBox(min, max);
|
viewer->setSceneBoundingBox(min, max);
|
||||||
viewerShow((float)min.x, (float)min.y, (float)min.z,
|
viewerShow(static_cast<float>(min.x), static_cast<float>(min.y), static_cast<float>(min.z),
|
||||||
(float)max.x, (float)max.y, (float)max.z);
|
static_cast<float>(max.x), static_cast<float>(max.y), static_cast<float>(max.z));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* to check
|
/* to check
|
||||||
|
|
@ -3598,9 +3598,9 @@ void SubViewer::lookat()
|
||||||
if (viewer->camera()->frame()->isSpinning())
|
if (viewer->camera()->frame()->isSpinning())
|
||||||
viewer->camera()->frame()->stopSpinning();
|
viewer->camera()->frame()->stopSpinning();
|
||||||
mw->viewerShow(viewer,
|
mw->viewerShow(viewer,
|
||||||
(float)dialog.get_x() + viewer->offset().x,
|
static_cast<float>(dialog.get_x()) + viewer->offset().x,
|
||||||
(float)dialog.get_y() + viewer->offset().y,
|
static_cast<float>(dialog.get_y()) + viewer->offset().y,
|
||||||
(float)dialog.get_z() + viewer->offset().z);
|
static_cast<float>(dialog.get_z()) + viewer->offset().z);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -302,7 +302,7 @@ public Q_SLOTS:
|
||||||
}
|
}
|
||||||
if(total == 0)
|
if(total == 0)
|
||||||
continue;
|
continue;
|
||||||
CGAL::qglviewer::Vec center(x/(double)total, y/(double)total, z/(double)total);
|
CGAL::qglviewer::Vec center(x/static_cast<double>(total), y/static_cast<double>(total), z/static_cast<double>(total));
|
||||||
CGAL::qglviewer::Vec orig;
|
CGAL::qglviewer::Vec orig;
|
||||||
CGAL::qglviewer::Vec dir;
|
CGAL::qglviewer::Vec dir;
|
||||||
if(camera->type() == CGAL::qglviewer::Camera::PERSPECTIVE)
|
if(camera->type() == CGAL::qglviewer::Camera::PERSPECTIVE)
|
||||||
|
|
|
||||||
|
|
@ -764,8 +764,8 @@ Scene::draw_aux(bool with_names, CGAL::Three::Viewer_interface* viewer)
|
||||||
std::vector<QOpenGLFramebufferObject*> fbos;
|
std::vector<QOpenGLFramebufferObject*> fbos;
|
||||||
std::vector<QOpenGLFramebufferObject*> depth_test;
|
std::vector<QOpenGLFramebufferObject*> depth_test;
|
||||||
QColor background = viewer->backgroundColor();
|
QColor background = viewer->backgroundColor();
|
||||||
fbos.resize((int)viewer->total_pass());
|
fbos.resize(static_cast<int>(viewer->total_pass()));
|
||||||
depth_test.resize((int)viewer->total_pass()-1);
|
depth_test.resize(static_cast<int>(viewer->total_pass())-1);
|
||||||
|
|
||||||
//first pass
|
//first pass
|
||||||
fbos[0] = new QOpenGLFramebufferObject(viewer->width(), viewer->height(),QOpenGLFramebufferObject::Depth, GL_TEXTURE_2D, GL_RGBA32F);
|
fbos[0] = new QOpenGLFramebufferObject(viewer->width(), viewer->height(),QOpenGLFramebufferObject::Depth, GL_TEXTURE_2D, GL_RGBA32F);
|
||||||
|
|
@ -835,8 +835,8 @@ Scene::draw_aux(bool with_names, CGAL::Three::Viewer_interface* viewer)
|
||||||
|
|
||||||
|
|
||||||
//last pass
|
//last pass
|
||||||
fbos[(int)viewer->total_pass()-1] = new QOpenGLFramebufferObject(viewer->width(), viewer->height(),QOpenGLFramebufferObject::Depth, GL_TEXTURE_2D, GL_RGBA32F);
|
fbos[static_cast<int>(viewer->total_pass())-1] = new QOpenGLFramebufferObject(viewer->width(), viewer->height(),QOpenGLFramebufferObject::Depth, GL_TEXTURE_2D, GL_RGBA32F);
|
||||||
fbos[(int)viewer->total_pass()-1]->bind();
|
fbos[static_cast<int>(viewer->total_pass())-1]->bind();
|
||||||
viewer->glDisable(GL_BLEND);
|
viewer->glDisable(GL_BLEND);
|
||||||
viewer->glEnable(GL_DEPTH_TEST);
|
viewer->glEnable(GL_DEPTH_TEST);
|
||||||
viewer->glDepthFunc(GL_LESS);
|
viewer->glDepthFunc(GL_LESS);
|
||||||
|
|
@ -846,18 +846,18 @@ Scene::draw_aux(bool with_names, CGAL::Three::Viewer_interface* viewer)
|
||||||
0.0f);
|
0.0f);
|
||||||
viewer->glClearDepthf(1);
|
viewer->glClearDepthf(1);
|
||||||
viewer->glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
viewer->glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||||
renderScene(opaque_items , viewer, picked_item_IDs, false, (int)viewer->total_pass()-1, false, depth_test[(int)viewer->total_pass()-2]);
|
renderScene(opaque_items , viewer, picked_item_IDs, false, static_cast<int>(viewer->total_pass())-1, false, depth_test[static_cast<int>(viewer->total_pass())-2]);
|
||||||
renderScene(transparent_items, viewer, picked_item_IDs, false, (int)viewer->total_pass()-1, false, depth_test[(int)viewer->total_pass()-2]);
|
renderScene(transparent_items, viewer, picked_item_IDs, false, static_cast<int>(viewer->total_pass())-1, false, depth_test[static_cast<int>(viewer->total_pass())-2]);
|
||||||
fbos[(int)viewer->total_pass()-1]->release();
|
fbos[static_cast<int>(viewer->total_pass())-1]->release();
|
||||||
if(viewer->getStoredFrameBuffer() != nullptr)
|
if(viewer->getStoredFrameBuffer() != nullptr)
|
||||||
viewer->getStoredFrameBuffer()->bind();
|
viewer->getStoredFrameBuffer()->bind();
|
||||||
|
|
||||||
//blending
|
//blending
|
||||||
program.bind();
|
program.bind();
|
||||||
vaos[viewer]->bind();
|
vaos[viewer]->bind();
|
||||||
viewer->glClearColor((GLclampf)background.redF(),
|
viewer->glClearColor(static_cast<GLclampf>(background.redF()),
|
||||||
(GLclampf)background.greenF(),
|
static_cast<GLclampf>(background.greenF()),
|
||||||
(GLclampf)background.blueF(),
|
static_cast<GLclampf>(background.blueF()),
|
||||||
0.0f);
|
0.0f);
|
||||||
viewer->glDisable(GL_DEPTH_TEST);
|
viewer->glDisable(GL_DEPTH_TEST);
|
||||||
viewer->glClear(GL_COLOR_BUFFER_BIT);
|
viewer->glClear(GL_COLOR_BUFFER_BIT);
|
||||||
|
|
@ -868,9 +868,9 @@ Scene::draw_aux(bool with_names, CGAL::Three::Viewer_interface* viewer)
|
||||||
proj_mat.setToIdentity();
|
proj_mat.setToIdentity();
|
||||||
proj_mat.ortho(-1,1,-1,1,0,1);
|
proj_mat.ortho(-1,1,-1,1,0,1);
|
||||||
program.setUniformValue("projection_matrix", proj_mat);
|
program.setUniformValue("projection_matrix", proj_mat);
|
||||||
for(int i=0; i< (int)viewer->total_pass()-1; ++i)
|
for(int i=0; i< static_cast<int>(viewer->total_pass())-1; ++i)
|
||||||
delete depth_test[i];
|
delete depth_test[i];
|
||||||
for(int i = (int)viewer->total_pass()-1; i>=0; --i)
|
for(int i = static_cast<int>(viewer->total_pass())-1; i>=0; --i)
|
||||||
{
|
{
|
||||||
viewer->glBindTexture(GL_TEXTURE_2D, fbos[i]->texture());
|
viewer->glBindTexture(GL_TEXTURE_2D, fbos[i]->texture());
|
||||||
viewer->glDrawArrays(GL_TRIANGLES,0,static_cast<GLsizei>(6));
|
viewer->glDrawArrays(GL_TRIANGLES,0,static_cast<GLsizei>(6));
|
||||||
|
|
|
||||||
|
|
@ -88,7 +88,7 @@ float Scene_item_rendering_helper::alpha() const
|
||||||
{
|
{
|
||||||
if(!priv->alphaSlider)
|
if(!priv->alphaSlider)
|
||||||
return 1.0f;
|
return 1.0f;
|
||||||
return (float)priv->alphaSlider->value() / 255.0f;
|
return static_cast<float>(priv->alphaSlider->value()) / 255.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Scene_item_rendering_helper::initGL(CGAL::Three::Viewer_interface* viewer) const
|
void Scene_item_rendering_helper::initGL(CGAL::Three::Viewer_interface* viewer) const
|
||||||
|
|
|
||||||
|
|
@ -671,7 +671,7 @@ void Scene_points_with_normal_item::drawEdges(CGAL::Three::Viewer_interface* vie
|
||||||
double ratio_displayed = 1.0;
|
double ratio_displayed = 1.0;
|
||||||
if (viewer->inFastDrawing () &&
|
if (viewer->inFastDrawing () &&
|
||||||
(d->nb_lines/6 > limit_fast_drawing)) // arbitrary large value
|
(d->nb_lines/6 > limit_fast_drawing)) // arbitrary large value
|
||||||
ratio_displayed = 6 * limit_fast_drawing / (double)(d->nb_lines);
|
ratio_displayed = 6 * limit_fast_drawing / static_cast<double>(d->nb_lines);
|
||||||
if(!isInit(viewer))
|
if(!isInit(viewer))
|
||||||
initGL(viewer);
|
initGL(viewer);
|
||||||
if ( getBuffersFilled() &&
|
if ( getBuffersFilled() &&
|
||||||
|
|
@ -699,7 +699,7 @@ drawPoints(CGAL::Three::Viewer_interface* viewer) const
|
||||||
double ratio_displayed = 1.0;
|
double ratio_displayed = 1.0;
|
||||||
if ((viewer->inFastDrawing () || d->isPointSliderMoving())
|
if ((viewer->inFastDrawing () || d->isPointSliderMoving())
|
||||||
&&((d->nb_points )/3 > limit_fast_drawing)) // arbitrary large value
|
&&((d->nb_points )/3 > limit_fast_drawing)) // arbitrary large value
|
||||||
ratio_displayed = 3 * limit_fast_drawing / (double)(d->nb_points);
|
ratio_displayed = 3 * limit_fast_drawing / static_cast<double>(d->nb_points);
|
||||||
|
|
||||||
if(!isInit(viewer))
|
if(!isInit(viewer))
|
||||||
initGL(viewer);
|
initGL(viewer);
|
||||||
|
|
|
||||||
|
|
@ -196,16 +196,16 @@ Scene_polygon_soup_item_priv::triangulate_polygon(Polygons_iterator pit, int pol
|
||||||
normals.push_back(normal.z());
|
normals.push_back(normal.z());
|
||||||
if(!soup->fcolors.empty())
|
if(!soup->fcolors.empty())
|
||||||
{
|
{
|
||||||
f_colors.push_back((float)color.red()/255);
|
f_colors.push_back(static_cast<float>(color.red())/255);
|
||||||
f_colors.push_back((float)color.green()/255);
|
f_colors.push_back(static_cast<float>(color.green())/255);
|
||||||
f_colors.push_back((float)color.blue()/255);
|
f_colors.push_back(static_cast<float>(color.blue())/255);
|
||||||
}
|
}
|
||||||
if(!soup->vcolors.empty())
|
if(!soup->vcolors.empty())
|
||||||
{
|
{
|
||||||
CGAL::IO::Color vcolor = soup->vcolors[triangulation.v2v[ffit->vertex(i)]];
|
CGAL::IO::Color vcolor = soup->vcolors[triangulation.v2v[ffit->vertex(i)]];
|
||||||
v_colors.push_back((float)vcolor.red()/255);
|
v_colors.push_back(static_cast<float>(vcolor.red())/255);
|
||||||
v_colors.push_back((float)vcolor.green()/255);
|
v_colors.push_back(static_cast<float>(vcolor.green())/255);
|
||||||
v_colors.push_back((float)vcolor.blue()/255);
|
v_colors.push_back(static_cast<float>(vcolor.blue())/255);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -263,17 +263,17 @@ Scene_polygon_soup_item_priv::compute_normals_and_vertices() const{
|
||||||
if(!soup->fcolors.empty())
|
if(!soup->fcolors.empty())
|
||||||
{
|
{
|
||||||
const CGAL::IO::Color color = soup->fcolors[nb];
|
const CGAL::IO::Color color = soup->fcolors[nb];
|
||||||
f_colors.push_back((float)color.red()/255);
|
f_colors.push_back(static_cast<float>(color.red())/255);
|
||||||
f_colors.push_back((float)color.green()/255);
|
f_colors.push_back(static_cast<float>(color.green())/255);
|
||||||
f_colors.push_back((float)color.blue()/255);
|
f_colors.push_back(static_cast<float>(color.blue())/255);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!soup->vcolors.empty())
|
if(!soup->vcolors.empty())
|
||||||
{
|
{
|
||||||
const CGAL::IO::Color color = soup->vcolors[it->at(i)];
|
const CGAL::IO::Color color = soup->vcolors[it->at(i)];
|
||||||
v_colors.push_back((float)color.red()/255);
|
v_colors.push_back(static_cast<float>(color.red())/255);
|
||||||
v_colors.push_back((float)color.green()/255);
|
v_colors.push_back(static_cast<float>(color.green())/255);
|
||||||
v_colors.push_back((float)color.blue()/255);
|
v_colors.push_back(static_cast<float>(color.blue())/255);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -389,21 +389,21 @@ void Scene_surface_mesh_item_priv::addFlatData(Point p, EPICK::Vector_3 n, CGAL:
|
||||||
const CGAL::qglviewer::Vec offset = static_cast<CGAL::Three::Viewer_interface*>(CGAL::QGLViewer::QGLViewerPool().first())->offset();
|
const CGAL::qglviewer::Vec offset = static_cast<CGAL::Three::Viewer_interface*>(CGAL::QGLViewer::QGLViewerPool().first())->offset();
|
||||||
if(name.testFlag(Scene_item_rendering_helper::GEOMETRY))
|
if(name.testFlag(Scene_item_rendering_helper::GEOMETRY))
|
||||||
{
|
{
|
||||||
flat_vertices.push_back((cgal_gl_data)(p.x()+offset[0]));
|
flat_vertices.push_back(static_cast<cgal_gl_data>(p.x()+offset[0]));
|
||||||
flat_vertices.push_back((cgal_gl_data)(p.y()+offset[1]));
|
flat_vertices.push_back(static_cast<cgal_gl_data>(p.y()+offset[1]));
|
||||||
flat_vertices.push_back((cgal_gl_data)(p.z()+offset[2]));
|
flat_vertices.push_back(static_cast<cgal_gl_data>(p.z()+offset[2]));
|
||||||
}
|
}
|
||||||
if(name.testFlag(Scene_item_rendering_helper::NORMALS))
|
if(name.testFlag(Scene_item_rendering_helper::NORMALS))
|
||||||
{
|
{
|
||||||
flat_normals.push_back((cgal_gl_data)n.x());
|
flat_normals.push_back(static_cast<cgal_gl_data>(n.x()));
|
||||||
flat_normals.push_back((cgal_gl_data)n.y());
|
flat_normals.push_back(static_cast<cgal_gl_data>(n.y()));
|
||||||
flat_normals.push_back((cgal_gl_data)n.z());
|
flat_normals.push_back(static_cast<cgal_gl_data>(n.z()));
|
||||||
}
|
}
|
||||||
if(c != nullptr && name.testFlag(Scene_item_rendering_helper::COLORS))
|
if(c != nullptr && name.testFlag(Scene_item_rendering_helper::COLORS))
|
||||||
{
|
{
|
||||||
f_colors.push_back((float)c->red()/255);
|
f_colors.push_back(static_cast<float>(c->red())/255);
|
||||||
f_colors.push_back((float)c->green()/255);
|
f_colors.push_back(static_cast<float>(c->green())/255);
|
||||||
f_colors.push_back((float)c->blue()/255);
|
f_colors.push_back(static_cast<float>(c->blue())/255);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -649,9 +649,9 @@ void Scene_surface_mesh_item_priv::compute_elements(Scene_item_rendering_helper:
|
||||||
for(vertex_descriptor vd : vertices(*smesh_))
|
for(vertex_descriptor vd : vertices(*smesh_))
|
||||||
{
|
{
|
||||||
CGAL::IO::Color c = vcolors[vd];
|
CGAL::IO::Color c = vcolors[vd];
|
||||||
v_colors.push_back((float)c.red()/255);
|
v_colors.push_back(static_cast<float>(c.red())/255);
|
||||||
v_colors.push_back((float)c.green()/255);
|
v_colors.push_back(static_cast<float>(c.green())/255);
|
||||||
v_colors.push_back((float)c.blue()/255);
|
v_colors.push_back(static_cast<float>(c.blue())/255);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1566,8 +1566,8 @@ void
|
||||||
Scene_surface_mesh_item_priv::
|
Scene_surface_mesh_item_priv::
|
||||||
invalidate_stats()
|
invalidate_stats()
|
||||||
{
|
{
|
||||||
number_of_degenerated_faces = (unsigned int)(-1);
|
number_of_degenerated_faces = static_cast<unsigned int>(-1);
|
||||||
number_of_null_length_edges = (unsigned int)(-1);
|
number_of_null_length_edges = static_cast<unsigned int>(-1);
|
||||||
has_nm_vertices = false;
|
has_nm_vertices = false;
|
||||||
volume = -std::numeric_limits<double>::infinity();
|
volume = -std::numeric_limits<double>::infinity();
|
||||||
area = -std::numeric_limits<double>::infinity();
|
area = -std::numeric_limits<double>::infinity();
|
||||||
|
|
@ -1675,7 +1675,7 @@ QString Scene_surface_mesh_item::computeStats(int type)
|
||||||
{
|
{
|
||||||
if(is_triangle_mesh(*d->smesh_))
|
if(is_triangle_mesh(*d->smesh_))
|
||||||
{
|
{
|
||||||
if (d->number_of_degenerated_faces == (unsigned int)(-1))
|
if (d->number_of_degenerated_faces == static_cast<unsigned int>(-1))
|
||||||
d->number_of_degenerated_faces = nb_degenerate_faces(d->smesh_);
|
d->number_of_degenerated_faces = nb_degenerate_faces(d->smesh_);
|
||||||
return QString::number(d->number_of_degenerated_faces);
|
return QString::number(d->number_of_degenerated_faces);
|
||||||
}
|
}
|
||||||
|
|
@ -2333,7 +2333,7 @@ float Scene_surface_mesh_item::alpha() const
|
||||||
{
|
{
|
||||||
if(!d->alphaSlider)
|
if(!d->alphaSlider)
|
||||||
return 1.0f;
|
return 1.0f;
|
||||||
return (float)d->alphaSlider->value() / 255.0f;
|
return static_cast<float>(d->alphaSlider->value()) / 255.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Scene_surface_mesh_item::setAlpha(int alpha)
|
void Scene_surface_mesh_item::setAlpha(int alpha)
|
||||||
|
|
|
||||||
|
|
@ -165,8 +165,8 @@ void Triangle_container::draw(Viewer_interface* viewer,
|
||||||
getVao(viewer)->program->setUniformValue("comparing", viewer->currentPass() > 0);
|
getVao(viewer)->program->setUniformValue("comparing", viewer->currentPass() > 0);
|
||||||
getVao(viewer)->program->setUniformValue("width", viewer->width()*1.0f);
|
getVao(viewer)->program->setUniformValue("width", viewer->width()*1.0f);
|
||||||
getVao(viewer)->program->setUniformValue("height", viewer->height()*1.0f);
|
getVao(viewer)->program->setUniformValue("height", viewer->height()*1.0f);
|
||||||
getVao(viewer)->program->setUniformValue("near", (float)viewer->camera()->zNear());
|
getVao(viewer)->program->setUniformValue("near", static_cast<float>(viewer->camera()->zNear()));
|
||||||
getVao(viewer)->program->setUniformValue("far", (float)viewer->camera()->zFar());
|
getVao(viewer)->program->setUniformValue("far", static_cast<float>(viewer->camera()->zFar()));
|
||||||
getVao(viewer)->program->setUniformValue("writing", viewer->isDepthWriting());
|
getVao(viewer)->program->setUniformValue("writing", viewer->isDepthWriting());
|
||||||
getVao(viewer)->program->setUniformValue("alpha", d->alpha);
|
getVao(viewer)->program->setUniformValue("alpha", d->alpha);
|
||||||
if( fbo)
|
if( fbo)
|
||||||
|
|
@ -205,8 +205,8 @@ void Triangle_container::draw(Viewer_interface* viewer,
|
||||||
getVao(viewer)->program->setUniformValue("comparing", viewer->currentPass() > 0);
|
getVao(viewer)->program->setUniformValue("comparing", viewer->currentPass() > 0);
|
||||||
getVao(viewer)->program->setUniformValue("width", viewer->width()*1.0f);
|
getVao(viewer)->program->setUniformValue("width", viewer->width()*1.0f);
|
||||||
getVao(viewer)->program->setUniformValue("height", viewer->height()*1.0f);
|
getVao(viewer)->program->setUniformValue("height", viewer->height()*1.0f);
|
||||||
getVao(viewer)->program->setUniformValue("near", (float)viewer->camera()->zNear());
|
getVao(viewer)->program->setUniformValue("near", static_cast<float>(viewer->camera()->zNear()));
|
||||||
getVao(viewer)->program->setUniformValue("far", (float)viewer->camera()->zFar());
|
getVao(viewer)->program->setUniformValue("far", static_cast<float>(viewer->camera()->zFar()));
|
||||||
getVao(viewer)->program->setUniformValue("writing", viewer->isDepthWriting());
|
getVao(viewer)->program->setUniformValue("writing", viewer->isDepthWriting());
|
||||||
getVao(viewer)->program->setUniformValue("alpha", d->alpha);
|
getVao(viewer)->program->setUniformValue("alpha", d->alpha);
|
||||||
if( fbo)
|
if( fbo)
|
||||||
|
|
|
||||||
|
|
@ -502,7 +502,7 @@ void Viewer::init()
|
||||||
connect(d->logger, SIGNAL(messageLogged(QOpenGLDebugMessage)), this, SLOT(messageLogged(QOpenGLDebugMessage)));
|
connect(d->logger, SIGNAL(messageLogged(QOpenGLDebugMessage)), this, SLOT(messageLogged(QOpenGLDebugMessage)));
|
||||||
d->logger->startLogging();
|
d->logger->startLogging();
|
||||||
}
|
}
|
||||||
glDrawArraysInstanced = (PFNGLDRAWARRAYSINSTANCEDARBPROC)this->context()->getProcAddress("glDrawArraysInstancedARB");
|
glDrawArraysInstanced = reinterpret_cast<PFNGLDRAWARRAYSINSTANCEDARBPROC>(this->context()->getProcAddress("glDrawArraysInstancedARB"));
|
||||||
if(!glDrawArraysInstanced)
|
if(!glDrawArraysInstanced)
|
||||||
{
|
{
|
||||||
qDebug()<<"glDrawArraysInstancedARB : extension not found. Spheres will be displayed as points.";
|
qDebug()<<"glDrawArraysInstancedARB : extension not found. Spheres will be displayed as points.";
|
||||||
|
|
@ -511,7 +511,7 @@ void Viewer::init()
|
||||||
else
|
else
|
||||||
d->extension_is_found = true;
|
d->extension_is_found = true;
|
||||||
|
|
||||||
glVertexAttribDivisor = (PFNGLVERTEXATTRIBDIVISORARBPROC)this->context()->getProcAddress("glVertexAttribDivisorARB");
|
glVertexAttribDivisor = reinterpret_cast<PFNGLVERTEXATTRIBDIVISORARBPROC>(this->context()->getProcAddress("glVertexAttribDivisorARB"));
|
||||||
if(!glDrawArraysInstanced)
|
if(!glDrawArraysInstanced)
|
||||||
{
|
{
|
||||||
qDebug()<<"glVertexAttribDivisorARB : extension not found. Spheres will be displayed as points.";
|
qDebug()<<"glVertexAttribDivisorARB : extension not found. Spheres will be displayed as points.";
|
||||||
|
|
@ -1092,7 +1092,7 @@ void Viewer::drawVisualHints()
|
||||||
camera()->getModelViewProjectionMatrix(mat);
|
camera()->getModelViewProjectionMatrix(mat);
|
||||||
for(int i=0; i < 16; i++)
|
for(int i=0; i < 16; i++)
|
||||||
{
|
{
|
||||||
mvpMatrix.data()[i] = (float)mat[i];
|
mvpMatrix.data()[i] = static_cast<float>(mat[i]);
|
||||||
}
|
}
|
||||||
if(!isOpenGL_4_3())
|
if(!isOpenGL_4_3())
|
||||||
{
|
{
|
||||||
|
|
@ -1114,8 +1114,8 @@ void Viewer::drawVisualHints()
|
||||||
program->bind();
|
program->bind();
|
||||||
QVector2D vp(width(), height());
|
QVector2D vp(width(), height());
|
||||||
program->setUniformValue("viewport", vp);
|
program->setUniformValue("viewport", vp);
|
||||||
program->setUniformValue("near",(GLfloat)camera()->zNear());
|
program->setUniformValue("near",static_cast<GLfloat>(camera()->zNear()));
|
||||||
program->setUniformValue("far",(GLfloat)camera()->zFar());
|
program->setUniformValue("far",static_cast<GLfloat>(camera()->zFar()));
|
||||||
program->setUniformValue("width", GLfloat(3.0f));
|
program->setUniformValue("width", GLfloat(3.0f));
|
||||||
program->setAttributeValue("colors", QColor(Qt::black));
|
program->setAttributeValue("colors", QColor(Qt::black));
|
||||||
program->setUniformValue("mvp_matrix", mvpMatrix);
|
program->setUniformValue("mvp_matrix", mvpMatrix);
|
||||||
|
|
@ -1852,9 +1852,9 @@ void Viewer::setLighting()
|
||||||
//set ambient
|
//set ambient
|
||||||
connect(dialog, &LightingDialog::s_ambient_changed,
|
connect(dialog, &LightingDialog::s_ambient_changed,
|
||||||
[this, dialog](){
|
[this, dialog](){
|
||||||
d->ambient=QVector4D((float)dialog->ambient.redF(),
|
d->ambient=QVector4D(static_cast<float>(dialog->ambient.redF()),
|
||||||
(float)dialog->ambient.greenF(),
|
static_cast<float>(dialog->ambient.greenF()),
|
||||||
(float)dialog->ambient.blueF(),
|
static_cast<float>(dialog->ambient.blueF()),
|
||||||
1.0f);
|
1.0f);
|
||||||
update();
|
update();
|
||||||
});
|
});
|
||||||
|
|
@ -1862,18 +1862,18 @@ void Viewer::setLighting()
|
||||||
//set diffuse
|
//set diffuse
|
||||||
connect(dialog, &LightingDialog::s_diffuse_changed,
|
connect(dialog, &LightingDialog::s_diffuse_changed,
|
||||||
[this, dialog](){
|
[this, dialog](){
|
||||||
d->diffuse=QVector4D((float)dialog->diffuse.redF(),
|
d->diffuse=QVector4D(static_cast<float>(dialog->diffuse.redF()),
|
||||||
(float)dialog->diffuse.greenF(),
|
static_cast<float>(dialog->diffuse.greenF()),
|
||||||
(float)dialog->diffuse.blueF(),
|
static_cast<float>(dialog->diffuse.blueF()),
|
||||||
1.0f);
|
1.0f);
|
||||||
update();
|
update();
|
||||||
});
|
});
|
||||||
//set specular
|
//set specular
|
||||||
connect(dialog, &LightingDialog::s_specular_changed,
|
connect(dialog, &LightingDialog::s_specular_changed,
|
||||||
[this, dialog](){
|
[this, dialog](){
|
||||||
d->specular=QVector4D((float)dialog->specular.redF(),
|
d->specular=QVector4D(static_cast<float>(dialog->specular.redF()),
|
||||||
(float)dialog->specular.greenF(),
|
static_cast<float>(dialog->specular.greenF()),
|
||||||
(float)dialog->specular.blueF(),
|
static_cast<float>(dialog->specular.blueF()),
|
||||||
1.0f);
|
1.0f);
|
||||||
update();
|
update();
|
||||||
|
|
||||||
|
|
@ -2035,8 +2035,8 @@ void Viewer::scaleScene()
|
||||||
else
|
else
|
||||||
d->scaler = QVector3D(1,1,1);
|
d->scaler = QVector3D(1,1,1);
|
||||||
|
|
||||||
CGAL::qglviewer::Vec vmin(((float)bbox.xmin()+offset().x)*d->scaler.x(), ((float)bbox.ymin()+offset().y)*d->scaler.y(), ((float)bbox.zmin()+offset().z)*d->scaler.z()),
|
CGAL::qglviewer::Vec vmin((static_cast<float>(bbox.xmin())+offset().x)*d->scaler.x(), (static_cast<float>(bbox.ymin())+offset().y)*d->scaler.y(), (static_cast<float>(bbox.zmin())+offset().z)*d->scaler.z()),
|
||||||
vmax(((float)bbox.xmax()+offset().x)*d->scaler.x(), ((float)bbox.ymax()+offset().y)*d->scaler.y(), ((float)bbox.zmax()+offset().z)*d->scaler.z());
|
vmax((static_cast<float>(bbox.xmax())+offset().x)*d->scaler.x(), (static_cast<float>(bbox.ymax())+offset().y)*d->scaler.y(), (static_cast<float>(bbox.zmax())+offset().z)*d->scaler.z());
|
||||||
camera()->setPivotPoint((vmin+vmax)*0.5);
|
camera()->setPivotPoint((vmin+vmax)*0.5);
|
||||||
camera()->setSceneBoundingBox(vmin, vmax);
|
camera()->setSceneBoundingBox(vmin, vmax);
|
||||||
camera()->fitBoundingBox(vmin, vmax);
|
camera()->fitBoundingBox(vmin, vmax);
|
||||||
|
|
@ -2132,8 +2132,8 @@ void Viewer::showEntireScene()
|
||||||
CGAL::QGLViewer::showEntireScene();
|
CGAL::QGLViewer::showEntireScene();
|
||||||
CGAL::Bbox_3 bbox = CGAL::Three::Three::scene()->bbox();
|
CGAL::Bbox_3 bbox = CGAL::Three::Three::scene()->bbox();
|
||||||
|
|
||||||
CGAL::qglviewer::Vec vmin(((float)bbox.xmin()+offset().x)*d->scaler.x(), ((float)bbox.ymin()+offset().y)*d->scaler.y(), ((float)bbox.zmin()+offset().z)*d->scaler.z()),
|
CGAL::qglviewer::Vec vmin((static_cast<float>(bbox.xmin())+offset().x)*d->scaler.x(), (static_cast<float>(bbox.ymin())+offset().y)*d->scaler.y(), (static_cast<float>(bbox.zmin())+offset().z)*d->scaler.z()),
|
||||||
vmax(((float)bbox.xmax()+offset().x)*d->scaler.x(), ((float)bbox.ymax()+offset().y)*d->scaler.y(), ((float)bbox.zmax()+offset().z)*d->scaler.z());
|
vmax((static_cast<float>(bbox.xmax())+offset().x)*d->scaler.x(), (static_cast<float>(bbox.ymax())+offset().y)*d->scaler.y(), (static_cast<float>(bbox.zmax())+offset().z)*d->scaler.z());
|
||||||
camera()->setPivotPoint((vmin+vmax)*0.5);
|
camera()->setPivotPoint((vmin+vmax)*0.5);
|
||||||
camera()->setSceneBoundingBox(vmin, vmax);
|
camera()->setSceneBoundingBox(vmin, vmax);
|
||||||
camera()->fitBoundingBox(vmin, vmax);
|
camera()->fitBoundingBox(vmin, vmax);
|
||||||
|
|
|
||||||
|
|
@ -331,7 +331,7 @@ public Q_SLOTS:
|
||||||
//!This function is called by `Scene::changeGroup` and should not be
|
//!This function is called by `Scene::changeGroup` and should not be
|
||||||
//!called manually.
|
//!called manually.
|
||||||
virtual void moveToGroup(Scene_group_item* group);
|
virtual void moveToGroup(Scene_group_item* group);
|
||||||
void setRenderingMode(int m) { setRenderingMode((RenderingMode)m);}
|
void setRenderingMode(int m) { setRenderingMode(static_cast<RenderingMode>(m));}
|
||||||
//!Sets the rendering mode of the item.
|
//!Sets the rendering mode of the item.
|
||||||
//!@see RenderingMode
|
//!@see RenderingMode
|
||||||
virtual void setRenderingMode(RenderingMode m) {
|
virtual void setRenderingMode(RenderingMode m) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue