2022-06-07 11:55:27 +00:00
|
|
|
// Copyright (C) 2015 The Qt Company Ltd.
|
2024-03-15 08:19:25 +00:00
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
|
2011-04-27 10:05:43 +00:00
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
**
|
|
|
|
** This is a simple QGLWidget displaying an openGL wireframe box
|
|
|
|
**
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
#ifndef GLBOX_H
|
|
|
|
#define GLBOX_H
|
|
|
|
|
2020-03-30 05:38:05 +00:00
|
|
|
#include <QOpenGLWidget>
|
2015-09-06 19:50:59 +00:00
|
|
|
#include <QOpenGLFunctions_1_1>
|
2011-04-27 10:05:43 +00:00
|
|
|
//! [0]
|
|
|
|
#include <QAxBindable>
|
|
|
|
|
2020-03-30 05:38:05 +00:00
|
|
|
class GLBox : public QOpenGLWidget,
|
2015-09-06 19:50:59 +00:00
|
|
|
public QOpenGLFunctions_1_1,
|
2014-01-15 21:17:52 +00:00
|
|
|
public QAxBindable
|
2011-04-27 10:05:43 +00:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
2015-09-05 15:15:56 +00:00
|
|
|
Q_CLASSINFO("ClassID", "{5fd9c22e-ed45-43fa-ba13-1530bb6b03e0}")
|
|
|
|
Q_CLASSINFO("InterfaceID", "{33b051af-bb25-47cf-a390-5cfd2987d26a}")
|
|
|
|
Q_CLASSINFO("EventsID", "{8c996c29-eafa-46ac-a6f9-901951e765b5}")
|
|
|
|
//! [0] //! [1]
|
2011-04-27 10:05:43 +00:00
|
|
|
|
|
|
|
public:
|
2017-08-21 11:23:48 +00:00
|
|
|
explicit GLBox(QWidget *parent, const char *name = nullptr);
|
|
|
|
virtual ~GLBox();
|
2019-06-04 13:24:37 +00:00
|
|
|
QAxAggregated *createAggregate() override;
|
2011-04-27 10:05:43 +00:00
|
|
|
|
|
|
|
public slots:
|
2017-08-21 11:23:48 +00:00
|
|
|
void setXRotation(int degrees);
|
2011-04-27 10:05:43 +00:00
|
|
|
//! [1]
|
2017-08-21 11:23:48 +00:00
|
|
|
void setYRotation(int degrees);
|
|
|
|
void setZRotation(int degrees);
|
2011-04-27 10:05:43 +00:00
|
|
|
|
|
|
|
protected:
|
2019-06-04 13:24:37 +00:00
|
|
|
void initializeGL() override;
|
|
|
|
void paintGL() override;
|
|
|
|
void resizeGL(int w, int h) override;
|
2014-01-15 21:17:52 +00:00
|
|
|
virtual GLuint makeObject();
|
2011-04-27 10:05:43 +00:00
|
|
|
|
|
|
|
private:
|
2020-03-30 05:47:04 +00:00
|
|
|
GLuint m_object = 0;
|
|
|
|
GLdouble m_xRot = 0;
|
|
|
|
GLdouble m_yRot = 0;
|
|
|
|
GLdouble m_zRot = 0;
|
|
|
|
GLdouble m_scale = 1.25;
|
2011-04-27 10:05:43 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // GLBOX_H
|