diff --git a/src/interface/modeler/extension/extension.pro b/src/interface/modeler/extension/extension.pro new file mode 100644 index 0000000..03da2cd --- /dev/null +++ b/src/interface/modeler/extension/extension.pro @@ -0,0 +1,35 @@ +TEMPLATE = lib +TARGET = extension +QT += qml quick +CONFIG += qt plugin + +TARGET = $$qtLibraryTarget($$TARGET) +uri = Paysages + +# Input +SOURCES += \ + extension_plugin.cpp \ + paysages.cpp + +HEADERS += \ + extension_plugin.h \ + paysages.h + +OTHER_FILES = qmldir + +!equals(_PRO_FILE_PWD_, $$OUT_PWD) { + copy_qmldir.target = $$OUT_PWD/qmldir + copy_qmldir.depends = $$_PRO_FILE_PWD_/qmldir + copy_qmldir.commands = $(COPY_FILE) \"$$replace(copy_qmldir.depends, /, $$QMAKE_DIR_SEP)\" \"$$replace(copy_qmldir.target, /, $$QMAKE_DIR_SEP)\" + QMAKE_EXTRA_TARGETS += copy_qmldir + PRE_TARGETDEPS += $$copy_qmldir.target +} + +qmldir.files = qmldir +unix { + installPath = $$[QT_INSTALL_QML]/$$replace(uri, \\., /) + qmldir.path = $$installPath + target.path = $$installPath + INSTALLS += target qmldir +} + diff --git a/src/interface/modeler/extension/extension_plugin.cpp b/src/interface/modeler/extension/extension_plugin.cpp new file mode 100644 index 0000000..ded9382 --- /dev/null +++ b/src/interface/modeler/extension/extension_plugin.cpp @@ -0,0 +1,12 @@ +#include "extension_plugin.h" +#include "paysages.h" + +#include + +void ExtensionPlugin::registerTypes(const char *uri) +{ + // @uri Paysages + qmlRegisterType(uri, 1, 0, "Paysages"); +} + + diff --git a/src/interface/modeler/extension/extension_plugin.h b/src/interface/modeler/extension/extension_plugin.h new file mode 100644 index 0000000..9471ff3 --- /dev/null +++ b/src/interface/modeler/extension/extension_plugin.h @@ -0,0 +1,16 @@ +#ifndef EXTENSION_PLUGIN_H +#define EXTENSION_PLUGIN_H + +#include + +class ExtensionPlugin : public QQmlExtensionPlugin +{ + Q_OBJECT + Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface") + +public: + void registerTypes(const char *uri); +}; + +#endif // EXTENSION_PLUGIN_H + diff --git a/src/interface/modeler/extension/paysages.cpp b/src/interface/modeler/extension/paysages.cpp new file mode 100644 index 0000000..ad88921 --- /dev/null +++ b/src/interface/modeler/extension/paysages.cpp @@ -0,0 +1,16 @@ +#include "paysages.h" + +Paysages::Paysages(QQuickItem *parent): + QQuickItem(parent) +{ + // By default, QQuickItem does not draw anything. If you subclass + // QQuickItem to create a visual item, you will need to uncomment the + // following line and re-implement updatePaintNode() + + // setFlag(ItemHasContents, true); +} + +Paysages::~Paysages() +{ +} + diff --git a/src/interface/modeler/extension/paysages.h b/src/interface/modeler/extension/paysages.h new file mode 100644 index 0000000..0f55ef5 --- /dev/null +++ b/src/interface/modeler/extension/paysages.h @@ -0,0 +1,17 @@ +#ifndef PAYSAGES_H +#define PAYSAGES_H + +#include + +class Paysages : public QQuickItem +{ + Q_OBJECT + Q_DISABLE_COPY(Paysages) + +public: + Paysages(QQuickItem *parent = 0); + ~Paysages(); +}; + +#endif // PAYSAGES_H + diff --git a/src/interface/modeler/extension/qmldir b/src/interface/modeler/extension/qmldir new file mode 100644 index 0000000..f7a7af9 --- /dev/null +++ b/src/interface/modeler/extension/qmldir @@ -0,0 +1,3 @@ +module Paysages +plugin extension + diff --git a/src/interface/modeler/modeler.pro b/src/interface/modeler/modeler.pro new file mode 100644 index 0000000..711f598 --- /dev/null +++ b/src/interface/modeler/modeler.pro @@ -0,0 +1,5 @@ +TEMPLATE = subdirs + +SUBDIRS = \ + quickapp \ + extension diff --git a/src/interface/quick/OpenGLView.cpp b/src/interface/modeler/quickapp/OpenGLView.cpp similarity index 100% rename from src/interface/quick/OpenGLView.cpp rename to src/interface/modeler/quickapp/OpenGLView.cpp diff --git a/src/interface/quick/OpenGLView.h b/src/interface/modeler/quickapp/OpenGLView.h similarity index 87% rename from src/interface/quick/OpenGLView.h rename to src/interface/modeler/quickapp/OpenGLView.h index f741a44..cdd41ae 100644 --- a/src/interface/quick/OpenGLView.h +++ b/src/interface/modeler/quickapp/OpenGLView.h @@ -1,12 +1,12 @@ #ifndef OPENGLVIEW_H #define OPENGLVIEW_H -#include "quick_global.h" +#include "modeler_global.h" #include namespace paysages { -namespace quick { +namespace modeler { class OpenGLView : public QQuickItem { diff --git a/src/interface/quick/deployment.pri b/src/interface/modeler/quickapp/deployment.pri similarity index 100% rename from src/interface/quick/deployment.pri rename to src/interface/modeler/quickapp/deployment.pri diff --git a/src/interface/quick/images.qrc b/src/interface/modeler/quickapp/images.qrc similarity index 100% rename from src/interface/quick/images.qrc rename to src/interface/modeler/quickapp/images.qrc diff --git a/src/interface/quick/images/images.qrc b/src/interface/modeler/quickapp/images/images.qrc similarity index 100% rename from src/interface/quick/images/images.qrc rename to src/interface/modeler/quickapp/images/images.qrc diff --git a/src/interface/quick/main.cpp b/src/interface/modeler/quickapp/main.cpp similarity index 89% rename from src/interface/quick/main.cpp rename to src/interface/modeler/quickapp/main.cpp index 6a8db3f..ad89df8 100644 --- a/src/interface/quick/main.cpp +++ b/src/interface/modeler/quickapp/main.cpp @@ -11,6 +11,7 @@ int main(int argc, char *argv[]) qmlRegisterType("Paysages", 1, 0, "OpenGLView"); QQuickView view; + view.setTitle(QObject::tr("Paysages 3D")); view.setResizeMode(QQuickView::SizeRootObjectToView); view.setSource(QUrl("qrc:///main.qml")); view.show(); diff --git a/src/interface/quick/quick_global.h b/src/interface/modeler/quickapp/modeler_global.h similarity index 51% rename from src/interface/quick/quick_global.h rename to src/interface/modeler/quickapp/modeler_global.h index b92e58b..39ab8cb 100644 --- a/src/interface/quick/quick_global.h +++ b/src/interface/modeler/quickapp/modeler_global.h @@ -1,16 +1,16 @@ -#ifndef QUICK_GLOBAL_H -#define QUICK_GLOBAL_H +#ifndef MODELER_GLOBAL_H +#define MODELER_GLOBAL_H #include "definition_global.h" #include "software_global.h" #include "opengl_global.h" namespace paysages { -namespace quick { +namespace modeler { class ItemOpenGLView; } } -using namespace paysages::quick; +using namespace paysages::modeler; -#endif // QUICK_GLOBAL_H +#endif // MODELER_GLOBAL_H diff --git a/src/interface/modeler/quickapp/qml.qrc b/src/interface/modeler/quickapp/qml.qrc new file mode 100644 index 0000000..787b561 --- /dev/null +++ b/src/interface/modeler/quickapp/qml.qrc @@ -0,0 +1,7 @@ + + + qml/main.qml + qml/ToolbarButton.qml + qml/OpenGLView.qml + + diff --git a/src/interface/modeler/quickapp/qml/OpenGLView.qml b/src/interface/modeler/quickapp/qml/OpenGLView.qml new file mode 100644 index 0000000..af5804e --- /dev/null +++ b/src/interface/modeler/quickapp/qml/OpenGLView.qml @@ -0,0 +1,6 @@ +import QtQuick 2.0 + +Rectangle { + width: 100 + height: 62 +} diff --git a/src/interface/quick/ToolbarButton.qml b/src/interface/modeler/quickapp/qml/ToolbarButton.qml similarity index 88% rename from src/interface/quick/ToolbarButton.qml rename to src/interface/modeler/quickapp/qml/ToolbarButton.qml index 512c87e..ae703b5 100644 --- a/src/interface/quick/ToolbarButton.qml +++ b/src/interface/modeler/quickapp/qml/ToolbarButton.qml @@ -1,7 +1,7 @@ import QtQuick 2.0 Item { - property string code + property string picture property bool selected: false property bool hovered: false @@ -24,7 +24,7 @@ Item { Image { id: image - source: "qrc:///toolbar/primary/tab_" + parent.code + ".png" + source: parent.picture anchors.centerIn: parent } diff --git a/src/interface/modeler/quickapp/qml/app.qrc b/src/interface/modeler/quickapp/qml/app.qrc new file mode 100644 index 0000000..86302af --- /dev/null +++ b/src/interface/modeler/quickapp/qml/app.qrc @@ -0,0 +1,12 @@ + + + ToolbarButton.qml + main.qml + images/tab_atmosphere.png + images/tab_clouds.png + images/tab_render.png + images/tab_terrain.png + images/tab_textures.png + images/tab_water.png + + diff --git a/src/interface/quick/images/tab_atmosphere.png b/src/interface/modeler/quickapp/qml/images/tab_atmosphere.png similarity index 100% rename from src/interface/quick/images/tab_atmosphere.png rename to src/interface/modeler/quickapp/qml/images/tab_atmosphere.png diff --git a/src/interface/quick/images/tab_clouds.png b/src/interface/modeler/quickapp/qml/images/tab_clouds.png similarity index 100% rename from src/interface/quick/images/tab_clouds.png rename to src/interface/modeler/quickapp/qml/images/tab_clouds.png diff --git a/src/interface/quick/images/tab_render.png b/src/interface/modeler/quickapp/qml/images/tab_render.png similarity index 100% rename from src/interface/quick/images/tab_render.png rename to src/interface/modeler/quickapp/qml/images/tab_render.png diff --git a/src/interface/quick/images/tab_terrain.png b/src/interface/modeler/quickapp/qml/images/tab_terrain.png similarity index 100% rename from src/interface/quick/images/tab_terrain.png rename to src/interface/modeler/quickapp/qml/images/tab_terrain.png diff --git a/src/interface/quick/images/tab_textures.png b/src/interface/modeler/quickapp/qml/images/tab_textures.png similarity index 100% rename from src/interface/quick/images/tab_textures.png rename to src/interface/modeler/quickapp/qml/images/tab_textures.png diff --git a/src/interface/quick/images/tab_water.png b/src/interface/modeler/quickapp/qml/images/tab_water.png similarity index 100% rename from src/interface/quick/images/tab_water.png rename to src/interface/modeler/quickapp/qml/images/tab_water.png diff --git a/src/interface/quick/main.qml b/src/interface/modeler/quickapp/qml/main.qml similarity index 85% rename from src/interface/quick/main.qml rename to src/interface/modeler/quickapp/qml/main.qml index 0aff8e8..2087bd4 100644 --- a/src/interface/quick/main.qml +++ b/src/interface/modeler/quickapp/qml/main.qml @@ -34,27 +34,27 @@ OpenGLView { ToolbarButton { id: tool_terrain - code: "terrain" + picture: "images/tab_terrain.png" } ToolbarButton { id: tool_textures - code: "textures" + picture: "images/tab_textures.png" } ToolbarButton { id: tool_water - code: "water" + picture: "images/tab_water.png" } ToolbarButton { id: tool_atmosphere - code: "atmosphere" + picture: "images/tab_atmosphere.png" } ToolbarButton { id: tool_clouds - code: "clouds" + picture: "images/tab_clouds.png" } ToolbarButton { id: tool_render - code: "render" + picture: "images/tab_render.png" } } } diff --git a/src/interface/modeler/quickapp/quickapp.pro b/src/interface/modeler/quickapp/quickapp.pro new file mode 100644 index 0000000..61ee72a --- /dev/null +++ b/src/interface/modeler/quickapp/quickapp.pro @@ -0,0 +1,56 @@ +TEMPLATE = app + +QT += qml quick widgets + +include(../../../common.pri) + +SOURCES += main.cpp \ + OpenGLView.cpp + +RESOURCES += \ + qml/app.qrc + +# Additional import path used to resolve QML modules in Qt Creator's code model +QML_IMPORT_PATH = ../extension + +# Default rules for deployment. +include(deployment.pri) + +HEADERS += \ + OpenGLView.h \ + modeler_global.h + +win32:CONFIG(release, debug|release): LIBS += -L$$OUT_PWD/../../../system/release/ -lpaysages_system +else:win32:CONFIG(debug, debug|release): LIBS += -L$$OUT_PWD/../../../system/debug/ -lpaysages_system +else:unix: LIBS += -L$$OUT_PWD/../../../system/ -lpaysages_system +INCLUDEPATH += $$PWD/../../../system +DEPENDPATH += $$PWD/../../../system + +win32:CONFIG(release, debug|release): LIBS += -L$$OUT_PWD/../../../basics/release/ -lpaysages_basics +else:win32:CONFIG(debug, debug|release): LIBS += -L$$OUT_PWD/../../../basics/debug/ -lpaysages_basics +else:unix: LIBS += -L$$OUT_PWD/../../../basics/ -lpaysages_basics +INCLUDEPATH += $$PWD/../../../basics +DEPENDPATH += $$PWD/../../../basics + +win32:CONFIG(release, debug|release): LIBS += -L$$OUT_PWD/../../../definition/release/ -lpaysages_definition +else:win32:CONFIG(debug, debug|release): LIBS += -L$$OUT_PWD/../../../definition/debug/ -lpaysages_definition +else:unix: LIBS += -L$$OUT_PWD/../../../definition/ -lpaysages_definition +INCLUDEPATH += $$PWD/../../../definition +DEPENDPATH += $$PWD/../../../definition + +win32:CONFIG(release, debug|release): LIBS += -L$$OUT_PWD/../../../render/software/release/ -lpaysages_render_software +else:win32:CONFIG(debug, debug|release): LIBS += -L$$OUT_PWD/../../../render/software/debug/ -lpaysages_render_software +else:unix: LIBS += -L$$OUT_PWD/../../../render/software/ -lpaysages_render_software +INCLUDEPATH += $$PWD/../../../render/software +DEPENDPATH += $$PWD/../../../render/software + +win32:CONFIG(release, debug|release): LIBS += -L$$OUT_PWD/../../../render/opengl/release/ -lpaysages_render_opengl +else:win32:CONFIG(debug, debug|release): LIBS += -L$$OUT_PWD/../../../render/opengl/debug/ -lpaysages_render_opengl +else:unix: LIBS += -L$$OUT_PWD/../../../render/opengl/ -lpaysages_render_opengl +INCLUDEPATH += $$PWD/../../../render/opengl +DEPENDPATH += $$PWD/../../../render/opengl + +OTHER_FILES += \ + qml/main.qml \ + qml/ToolbarButton.qml \ + qml/OpenGLView.qml diff --git a/src/interface/quick/qml.qrc b/src/interface/quick/qml.qrc deleted file mode 100644 index 7292848..0000000 --- a/src/interface/quick/qml.qrc +++ /dev/null @@ -1,6 +0,0 @@ - - - main.qml - ToolbarButton.qml - - diff --git a/src/interface/quick/quick.pro b/src/interface/quick/quick.pro deleted file mode 100644 index fb2c7a0..0000000 --- a/src/interface/quick/quick.pro +++ /dev/null @@ -1,51 +0,0 @@ -TEMPLATE = app - -QT += qml quick widgets - -include(../../common.pri) - -SOURCES += main.cpp \ - OpenGLView.cpp - -RESOURCES += qml.qrc \ - images/images.qrc - -# Additional import path used to resolve QML modules in Qt Creator's code model -QML_IMPORT_PATH = - -# Default rules for deployment. -include(deployment.pri) - -HEADERS += \ - quick_global.h \ - OpenGLView.h - -win32:CONFIG(release, debug|release): LIBS += -L$$OUT_PWD/../../system/release/ -lpaysages_system -else:win32:CONFIG(debug, debug|release): LIBS += -L$$OUT_PWD/../../system/debug/ -lpaysages_system -else:unix: LIBS += -L$$OUT_PWD/../../system/ -lpaysages_system -INCLUDEPATH += $$PWD/../../system -DEPENDPATH += $$PWD/../../system - -win32:CONFIG(release, debug|release): LIBS += -L$$OUT_PWD/../../basics/release/ -lpaysages_basics -else:win32:CONFIG(debug, debug|release): LIBS += -L$$OUT_PWD/../../basics/debug/ -lpaysages_basics -else:unix: LIBS += -L$$OUT_PWD/../../basics/ -lpaysages_basics -INCLUDEPATH += $$PWD/../../basics -DEPENDPATH += $$PWD/../../basics - -win32:CONFIG(release, debug|release): LIBS += -L$$OUT_PWD/../../definition/release/ -lpaysages_definition -else:win32:CONFIG(debug, debug|release): LIBS += -L$$OUT_PWD/../../definition/debug/ -lpaysages_definition -else:unix: LIBS += -L$$OUT_PWD/../../definition/ -lpaysages_definition -INCLUDEPATH += $$PWD/../../definition -DEPENDPATH += $$PWD/../../definition - -win32:CONFIG(release, debug|release): LIBS += -L$$OUT_PWD/../../render/software/release/ -lpaysages_render_software -else:win32:CONFIG(debug, debug|release): LIBS += -L$$OUT_PWD/../../render/software/debug/ -lpaysages_render_software -else:unix: LIBS += -L$$OUT_PWD/../../render/software/ -lpaysages_render_software -INCLUDEPATH += $$PWD/../../render/software -DEPENDPATH += $$PWD/../../render/software - -win32:CONFIG(release, debug|release): LIBS += -L$$OUT_PWD/../../render/opengl/release/ -lpaysages_render_opengl -else:win32:CONFIG(debug, debug|release): LIBS += -L$$OUT_PWD/../../render/opengl/debug/ -lpaysages_render_opengl -else:unix: LIBS += -L$$OUT_PWD/../../render/opengl/ -lpaysages_render_opengl -INCLUDEPATH += $$PWD/../../render/opengl -DEPENDPATH += $$PWD/../../render/opengl diff --git a/src/paysages.pro b/src/paysages.pro index 81fe961..2deeb5a 100644 --- a/src/paysages.pro +++ b/src/paysages.pro @@ -10,7 +10,7 @@ SUBDIRS = \ render/opengl \ interface/commandline \ interface/desktop \ - interface/quick + interface/modeler exists( tests/googletest/sources/src/gtest-all.cc ) { SUBDIRS += \