From 0f016e480d4cae11b1c5e3ba9cdcc918c029c9dc Mon Sep 17 00:00:00 2001 From: "Joachim Wuttke (h)" <j.wuttke@fz-juelich.de> Date: Sat, 13 Nov 2021 07:46:55 +0100 Subject: [PATCH] clang-tidy GUI/ba3d/*/* --- GUI/ba3d/mesh/ripple.cpp | 2 +- GUI/ba3d/mesh/sphere.cpp | 2 +- GUI/ba3d/model/geometry_inc.h | 4 ++-- GUI/ba3d/model/model.h | 2 +- GUI/ba3d/view/buffer.cpp | 2 +- GUI/ba3d/view/canvas.h | 16 ++++++++-------- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/GUI/ba3d/mesh/ripple.cpp b/GUI/ba3d/mesh/ripple.cpp index 75fb1f89010..1a7964eba0f 100644 --- a/GUI/ba3d/mesh/ripple.cpp +++ b/GUI/ba3d/mesh/ripple.cpp @@ -43,7 +43,7 @@ Geometry::Mesh Geometry::meshRipple(float numSides, float ratio_asymmetry_W) } else if (numSides == 0) { // CosineRipple: cosine ripple for (int s = 0; s < slices; ++s) { - float th = static_cast<float>(M_PI * s / (slices + 1)); + auto th = static_cast<float>(M_PI * s / (slices + 1)); float y = -R * cosf(th); float z = R * (1.0f + cosf(2 * static_cast<float>(M_PI) * y / (2 * R))); vfront[s] = Vector3D(-R, y, z); diff --git a/GUI/ba3d/mesh/sphere.cpp b/GUI/ba3d/mesh/sphere.cpp index 0f834413a87..5c934a427f8 100644 --- a/GUI/ba3d/mesh/sphere.cpp +++ b/GUI/ba3d/mesh/sphere.cpp @@ -70,7 +70,7 @@ Geometry::Mesh Geometry::meshSphere(float cut, float baseShift, float removedTop float cp = cosf(ph), sp = sinf(ph); for (int s = 0; s < slices; ++s) { - float th = float(M_TWOPI * s / slices); + auto th = float(M_TWOPI * s / slices); Vector3D v(R * cp * cosf(th), R * cp * sinf(th), R * sp); v.z += baseShift; // baseShift is used for shifting the bottom of the spherical shape // to z=0 plane diff --git a/GUI/ba3d/model/geometry_inc.h b/GUI/ba3d/model/geometry_inc.h index 37d6ec8b064..33d639e8497 100644 --- a/GUI/ba3d/model/geometry_inc.h +++ b/GUI/ba3d/model/geometry_inc.h @@ -24,8 +24,8 @@ namespace GUI::RealSpace { class Geometry; -typedef std::shared_ptr<Geometry> GeometryHandle; -typedef std::weak_ptr<Geometry> GeometryRef; +using GeometryHandle = std::shared_ptr<Geometry>; +using GeometryRef = std::weak_ptr<Geometry>; // some useful constants: extern const float GoldenRatio; diff --git a/GUI/ba3d/model/model.h b/GUI/ba3d/model/model.h index 87910a70ee5..8a9faf01301 100644 --- a/GUI/ba3d/model/model.h +++ b/GUI/ba3d/model/model.h @@ -32,7 +32,7 @@ class Model : public QObject { public: Model(); - virtual ~Model(); + ~Model() override; void clearOpaque(); void clearBlend(); diff --git a/GUI/ba3d/view/buffer.cpp b/GUI/ba3d/view/buffer.cpp index 67501b01d58..0019e8dbc4a 100644 --- a/GUI/ba3d/view/buffer.cpp +++ b/GUI/ba3d/view/buffer.cpp @@ -26,7 +26,7 @@ Buffer::Buffer(Geometry const& geometry) { initializeOpenGLFunctions(); - auto& mesh = geometry.m_mesh; + const auto& mesh = geometry.m_mesh; m_vertexCount = mesh.count(); QOpenGLVertexArrayObject::Binder dummy(&m_vao); diff --git a/GUI/ba3d/view/canvas.h b/GUI/ba3d/view/canvas.h index 812bd6a7c4b..3c36a3445fa 100644 --- a/GUI/ba3d/view/canvas.h +++ b/GUI/ba3d/view/canvas.h @@ -37,7 +37,7 @@ class Canvas : public QOpenGLWidget, protected QOpenGLFunctions { public: Canvas(); - ~Canvas(); + ~Canvas() override; void setBgColor(QColor const&); @@ -65,19 +65,19 @@ private: void setCamera(bool full = true); - void initializeGL(); - void resizeGL(int, int); - void paintGL(); + void initializeGL() override; + void resizeGL(int, int) override; + void paintGL() override; QPoint e_last; // latest mouse event's (x,y) screen coordinates QMatrix4x4 matModel, matProj; QVector3D unproject(QPoint const&); enum { btnNONE, btnTURN, btnZOOM } mouseButton; - void mousePressEvent(QMouseEvent*); - void mouseMoveEvent(QMouseEvent*); - void mouseReleaseEvent(QMouseEvent*); - void wheelEvent(QWheelEvent*); + void mousePressEvent(QMouseEvent*) override; + void mouseMoveEvent(QMouseEvent*) override; + void mouseReleaseEvent(QMouseEvent*) override; + void wheelEvent(QWheelEvent*) override; Camera* camera; Program* program; -- GitLab