Skip to content
Snippets Groups Projects
Commit 0f016e48 authored by Wuttke, Joachim's avatar Wuttke, Joachim
Browse files

clang-tidy GUI/ba3d/*/*

parent a4e5e5c0
No related branches found
No related tags found
1 merge request!458Automatic modernization (clang-tidy --fix)
......@@ -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);
......
......@@ -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
......
......@@ -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;
......
......@@ -32,7 +32,7 @@ class Model : public QObject {
public:
Model();
virtual ~Model();
~Model() override;
void clearOpaque();
void clearBlend();
......
......@@ -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);
......
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment