summaryrefslogtreecommitdiffstats
path: root/openglscene.h
diff options
context:
space:
mode:
Diffstat (limited to 'openglscene.h')
-rw-r--r--openglscene.h27
1 files changed, 21 insertions, 6 deletions
diff --git a/openglscene.h b/openglscene.h
index c0d5c20..9b78ea0 100644
--- a/openglscene.h
+++ b/openglscene.h
@@ -3,9 +3,18 @@
#include "point3d.h"
+#include <QDir>
#include <QGraphicsScene>
#include <QTime>
+#ifndef QT_NO_CONCURRENT
+#include <QFutureWatcher>
+#endif
+
+QT_BEGIN_NAMESPACE
+class QComboBox;
+QT_END_NAMESPACE
+
class Model;
class OpenGLScene : public QGraphicsScene
@@ -17,16 +26,14 @@ public:
void drawBackground(QPainter *painter, const QRectF &rect);
- QColor backgroundColor() const;
- QColor modelColor() const;
-
public slots:
- void setModel(Model *model);
void enableWireframe(bool enabled);
void enableNormals(bool enabled);
void setLightPosition(int pos);
- void setModelColor(const QColor &color);
- void setBackgroundColor(const QColor &color);
+ void setModelColor();
+ void setBackgroundColor();
+ void loadModel(const QString &model);
+ void modelLoaded();
protected:
void mousePressEvent(QGraphicsSceneMouseEvent *event);
@@ -35,6 +42,8 @@ protected:
void wheelEvent(QGraphicsSceneWheelEvent * wheelEvent);
private:
+ void setModel(Model *model);
+
bool m_wireframeEnabled;
bool m_normalsEnabled;
@@ -53,6 +62,12 @@ private:
Point3d m_rotation;
Point3d m_angularMomentum;
Point3d m_accumulatedMomentum;
+
+#ifndef QT_NO_CONCURRENT
+ QFutureWatcher<Model *> m_modelLoader;
+#endif
+ QComboBox *m_models;
+ QDir m_dir;
};
#endif