From 2251db361c657abd5dfb671aacb843f23deb61ec Mon Sep 17 00:00:00 2001 From: Michael Lemaire Date: Thu, 28 Aug 2014 10:29:12 +0200 Subject: [PATCH] WIP on QtQuick toolbars --- graphics/icons.png | Bin 0 -> 12060 bytes graphics/icons.svg | 99 ++++++++++++++++++ {data/images => graphics}/logo.svg | 0 .../modeler/quickapp/MainModelerWindow.cpp | 24 +++++ .../modeler/quickapp/MainModelerWindow.h | 28 +++++ src/interface/modeler/quickapp/OpenGLView.cpp | 46 ++++---- src/interface/modeler/quickapp/OpenGLView.h | 3 +- src/interface/modeler/quickapp/main.cpp | 11 +- .../modeler/quickapp/modeler_global.h | 3 +- .../modeler/quickapp/qml/BasePanel.qml | 27 +++++ .../modeler/quickapp/qml/PanelWaterLevel.qml | 11 ++ .../modeler/quickapp/qml/Toolbar.qml | 3 +- .../modeler/quickapp/qml/ToolbarButton.qml | 20 +++- src/interface/modeler/quickapp/qml/app.qrc | 4 + .../quickapp/qml/images/icon_water.png | Bin 0 -> 875 bytes .../quickapp/qml/images/icon_water_level.png | Bin 0 -> 1562 bytes src/interface/modeler/quickapp/qml/main.qml | 32 +++++- src/interface/modeler/quickapp/quickapp.pro | 10 +- 18 files changed, 282 insertions(+), 39 deletions(-) create mode 100644 graphics/icons.png create mode 100644 graphics/icons.svg rename {data/images => graphics}/logo.svg (100%) create mode 100644 src/interface/modeler/quickapp/MainModelerWindow.cpp create mode 100644 src/interface/modeler/quickapp/MainModelerWindow.h create mode 100644 src/interface/modeler/quickapp/qml/BasePanel.qml create mode 100644 src/interface/modeler/quickapp/qml/PanelWaterLevel.qml create mode 100644 src/interface/modeler/quickapp/qml/images/icon_water.png create mode 100644 src/interface/modeler/quickapp/qml/images/icon_water_level.png diff --git a/graphics/icons.png b/graphics/icons.png new file mode 100644 index 0000000000000000000000000000000000000000..77dbd8967a040a47d6d5efc661f6f7e4c18c44f7 GIT binary patch literal 12060 zcmb_?hd-O|7j{VP88O;gwcFAfu~%Aqw5VMxW_;D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m+c#I;b>o-XpVFuw8uq5?3BrW{6KCWMOVVJk z^wd4|Z*l!b`DNCEW3tl4;$yM1r?RHlSNecOU2FkBq%EMM9Q%~v*y$d_4Y)4634}Ua z3M>}YA3$apm3hCdGg};pQ(h?CO&cIRfCi@YSc1OFu~XGFUj(NHWK(kX^Z|z9*`u$z~2Io3L8Q!Hv<8N2}uU%~1G zXy`hnZ?1;3P1O}79|5GPr~#S456Jm`Jpk$s)`O~>nfRMBuVIV1DT$x~Fu)(vW+(!z zz?^+uquA=8QGPHZfS3_LoX{?CV--l0#(`4LQK)R)F3Kg26IYEkyxh{kIm-Da_~I8F=DcDhyI z(;CWw85AzGxi^BN*)CH_>t~g45P*#5tOiEi14a!9>eghwYrY6aiAlbGpfrtK32@t5 z090V-EI(=$D@jD}QhVg=X~P>QW;eMDr`Xw3WH&a#P zh}+$<@lKwp)`8L|tQXFde&X`(^9YWaUBH|@W+ljQHu5sfPUuM@zAm-rpq7+{!qcNJ zK2*z|{)oB4YJ+|CQQn&)*t;I|TxZg_n9zFbqD(V-)GLCn|e zX#2A`?t+=j3ePT%ZIh4olxT)raq67P{9d SxBw+PNLSN9 + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + diff --git a/data/images/logo.svg b/graphics/logo.svg similarity index 100% rename from data/images/logo.svg rename to graphics/logo.svg diff --git a/src/interface/modeler/quickapp/MainModelerWindow.cpp b/src/interface/modeler/quickapp/MainModelerWindow.cpp new file mode 100644 index 0000000..f8cca47 --- /dev/null +++ b/src/interface/modeler/quickapp/MainModelerWindow.cpp @@ -0,0 +1,24 @@ +#include "MainModelerWindow.h" + +#include "OpenGLView.h" +#include "Scenery.h" +#include "OpenGLRenderer.h" + +MainModelerWindow::MainModelerWindow() +{ + scenery = new Scenery(); + scenery->autoPreset(); + renderer = new OpenGLRenderer(scenery); + + qmlRegisterType("Paysages", 1, 0, "OpenGLView"); + + setTitle(QObject::tr("Paysages 3D")); + setResizeMode(QQuickView::SizeRootObjectToView); + setSource(QUrl("qrc:///main.qml")); +} + +MainModelerWindow::~MainModelerWindow() +{ + delete renderer; + delete scenery; +} diff --git a/src/interface/modeler/quickapp/MainModelerWindow.h b/src/interface/modeler/quickapp/MainModelerWindow.h new file mode 100644 index 0000000..f599381 --- /dev/null +++ b/src/interface/modeler/quickapp/MainModelerWindow.h @@ -0,0 +1,28 @@ +#ifndef MAINMODELERWINDOW_H +#define MAINMODELERWINDOW_H + +#include "modeler_global.h" + +#include + +namespace paysages { +namespace modeler { + +class MainModelerWindow: public QQuickView +{ + Q_OBJECT +public: + MainModelerWindow(); + virtual ~MainModelerWindow(); + + inline OpenGLRenderer *getRenderer() const {return renderer;} + +private: + OpenGLRenderer *renderer; + Scenery *scenery; +}; + +} +} + +#endif // MAINMODELERWINDOW_H diff --git a/src/interface/modeler/quickapp/OpenGLView.cpp b/src/interface/modeler/quickapp/OpenGLView.cpp index a9953df..23f0211 100644 --- a/src/interface/modeler/quickapp/OpenGLView.cpp +++ b/src/interface/modeler/quickapp/OpenGLView.cpp @@ -2,27 +2,22 @@ #include #include - -// TEMP +#include "MainModelerWindow.h" +#include "CameraDefinition.h" #include "OpenGLRenderer.h" #include "Scenery.h" -#include "CameraDefinition.h" -static OpenGLRenderer renderer; -static Scenery scenery; OpenGLView::OpenGLView(QQuickItem *parent) : QQuickItem(parent) { initialized = false; window = NULL; + renderer = NULL; setAcceptedMouseButtons(Qt::AllButtons); setAcceptHoverEvents(true); setKeepMouseGrab(true); - scenery.autoPreset(); - renderer.setScenery(&scenery); - connect(this, SIGNAL(windowChanged(QQuickWindow*)), this, SLOT(handleWindowChanged(QQuickWindow*))); startTimer(250); } @@ -31,13 +26,17 @@ void OpenGLView::handleWindowChanged(QQuickWindow *win) { if (win) { - window = win; + window = qobject_cast(win); + if (window) + { + renderer = window->getRenderer(); - connect(window, SIGNAL(beforeRendering()), this, SLOT(paint()), Qt::DirectConnection); + connect(win, SIGNAL(beforeRendering()), this, SLOT(paint()), Qt::DirectConnection); - win->setClearBeforeRendering(false); + win->setClearBeforeRendering(false); - initialized = false; + initialized = false; + } } } @@ -45,13 +44,13 @@ void OpenGLView::paint() { if (not initialized) { - renderer.initialize(); + renderer->initialize(); initialized = true; } - renderer.resize(width(), height()); - renderer.prepareOpenGLState(); - renderer.paint(); + renderer->resize(width(), height()); + renderer->prepareOpenGLState(); + renderer->paint(); if (window) { @@ -61,18 +60,23 @@ void OpenGLView::paint() void OpenGLView::hoverMoveEvent(QHoverEvent *event) { + if (!renderer) + { + return; + } + CameraDefinition camera; - renderer.getScenery()->getCamera(&camera); + renderer->getScenery()->getCamera(&camera); QPointF diff = event->posF() - event->oldPosF(); camera.strafeRight(diff.x() * 0.1); camera.strafeUp(diff.y() * 0.1); camera.validate(); - camera.copy(renderer.render_camera); - renderer.getScenery()->setCamera(&camera); - renderer.getScenery()->getCamera(&camera); - renderer.cameraChangeEvent(&camera); + camera.copy(renderer->render_camera); + renderer->getScenery()->setCamera(&camera); + renderer->getScenery()->getCamera(&camera); + renderer->cameraChangeEvent(&camera); if (window) { window->update(); diff --git a/src/interface/modeler/quickapp/OpenGLView.h b/src/interface/modeler/quickapp/OpenGLView.h index 5675818..e59c379 100644 --- a/src/interface/modeler/quickapp/OpenGLView.h +++ b/src/interface/modeler/quickapp/OpenGLView.h @@ -24,7 +24,8 @@ protected: private: bool initialized; - QQuickWindow *window; + MainModelerWindow *window; + OpenGLRenderer *renderer; }; } diff --git a/src/interface/modeler/quickapp/main.cpp b/src/interface/modeler/quickapp/main.cpp index ad89df8..3d9237a 100644 --- a/src/interface/modeler/quickapp/main.cpp +++ b/src/interface/modeler/quickapp/main.cpp @@ -1,19 +1,12 @@ #include -#include -#include -#include "OpenGLView.h" +#include "MainModelerWindow.h" int main(int argc, char *argv[]) { QGuiApplication app(argc, argv); - qmlRegisterType("Paysages", 1, 0, "OpenGLView"); - - QQuickView view; - view.setTitle(QObject::tr("Paysages 3D")); - view.setResizeMode(QQuickView::SizeRootObjectToView); - view.setSource(QUrl("qrc:///main.qml")); + MainModelerWindow view; view.show(); return app.exec(); diff --git a/src/interface/modeler/quickapp/modeler_global.h b/src/interface/modeler/quickapp/modeler_global.h index 39ab8cb..f8088b8 100644 --- a/src/interface/modeler/quickapp/modeler_global.h +++ b/src/interface/modeler/quickapp/modeler_global.h @@ -7,7 +7,8 @@ namespace paysages { namespace modeler { - class ItemOpenGLView; + class MainModelerWindow; + class OpenGLView; } } diff --git a/src/interface/modeler/quickapp/qml/BasePanel.qml b/src/interface/modeler/quickapp/qml/BasePanel.qml new file mode 100644 index 0000000..82872d6 --- /dev/null +++ b/src/interface/modeler/quickapp/qml/BasePanel.qml @@ -0,0 +1,27 @@ +import QtQuick 2.0 + +Rectangle { + property ToolbarButton tool + id: panel + + width: 200 + height: parent.height - 100 + color: "red" + enabled: visible + + anchors.right: parent.right + anchors.verticalCenter: parent.verticalCenter + + states: [ + State { + name: "Active" + when: tool.selected + + PropertyChanges { + target: panel + visible: true + } + } + + ] +} diff --git a/src/interface/modeler/quickapp/qml/PanelWaterLevel.qml b/src/interface/modeler/quickapp/qml/PanelWaterLevel.qml new file mode 100644 index 0000000..e84bd6e --- /dev/null +++ b/src/interface/modeler/quickapp/qml/PanelWaterLevel.qml @@ -0,0 +1,11 @@ +import QtQuick 2.2 +import QtQuick.Controls 1.2 + +BasePanel { + width: 20 + + Slider { + orientation: Qt.Vertical + anchors.fill: parent + } +} diff --git a/src/interface/modeler/quickapp/qml/Toolbar.qml b/src/interface/modeler/quickapp/qml/Toolbar.qml index 46838d6..b8a1424 100644 --- a/src/interface/modeler/quickapp/qml/Toolbar.qml +++ b/src/interface/modeler/quickapp/qml/Toolbar.qml @@ -5,7 +5,8 @@ Rectangle { default property alias children : inner_space.children width: 70 height: parent.height - color: "#50000000" + color: "#50888888" + enabled: opacity > 0 Column { id: inner_space diff --git a/src/interface/modeler/quickapp/qml/ToolbarButton.qml b/src/interface/modeler/quickapp/qml/ToolbarButton.qml index 23c8edb..727c408 100644 --- a/src/interface/modeler/quickapp/qml/ToolbarButton.qml +++ b/src/interface/modeler/quickapp/qml/ToolbarButton.qml @@ -1,4 +1,5 @@ import QtQuick 2.0 +import QtGraphicalEffects 1.0 Item { property string picture @@ -13,7 +14,7 @@ Item { Rectangle { id: glow anchors.fill: parent - color: "white" + color: "#cccccc" radius: 8 opacity: parent.selected ? 1.0 : (parent.hovered ? 0.5 : 0.0) @@ -22,6 +23,13 @@ Item { duration: 200 } } + RectangularGlow { + anchors.fill: glow + glowRadius: 8 + spread: 0.2 + color: "white" + cornerRadius: glow.radius + glowRadius + } } Image { @@ -30,6 +38,16 @@ Item { anchors.centerIn: parent width: 32 height: 32 + antialiasing: true + } + DropShadow { + anchors.fill: image + horizontalOffset: 2 + verticalOffset: 2 + radius: 4.0 + samples: 16 + color: "#80000000" + source: image } MouseArea { diff --git a/src/interface/modeler/quickapp/qml/app.qrc b/src/interface/modeler/quickapp/qml/app.qrc index aa09ee8..a216b39 100644 --- a/src/interface/modeler/quickapp/qml/app.qrc +++ b/src/interface/modeler/quickapp/qml/app.qrc @@ -13,5 +13,9 @@ images/display_topdown.png images/help.png Tooltip.qml + images/icon_water.png + images/icon_water_level.png + BasePanel.qml + PanelWaterLevel.qml diff --git a/src/interface/modeler/quickapp/qml/images/icon_water.png b/src/interface/modeler/quickapp/qml/images/icon_water.png new file mode 100644 index 0000000000000000000000000000000000000000..b87e23c7aea4ce4c18f2298f998ba6b6302259cb GIT binary patch literal 875 zcmV-x1C;!UP)2}hMJ@4}OO>Zrt>4yo$g7ED!-Ea`__!D)olZ+I7;II- zBP+rCfEPxEj*gB>y{xXTir?>VRl>Yg1Y9*LaAage8f9r|N#gN%s{+cvG1c&zQE`2J zeNrlw>cVF-8S(ji?M{d`%p-`v^KQ}jL#^UG|uvLYCz177;B9XdxKNgFbA>bphOND@#Q9*-) zgEBlkEHg7R|G}qHDYKTxYrqZ_0-}2JvSx9iP)HUQ7DPlO91fc$prFr3T~8SJ)TlsB z(rm^;9-a0Cx9*3G-JS1;4{q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