diff --git a/src/definition/CameraDefinition.h b/src/definition/CameraDefinition.h index 2daddf6..9e2c1d3 100644 --- a/src/definition/CameraDefinition.h +++ b/src/definition/CameraDefinition.h @@ -30,15 +30,15 @@ public: virtual void copy(DefinitionNode* destination) const override; virtual void validate() override; - inline Vector3 getLocation() const {return location;} - inline Vector3 getTarget() const {return target;} - inline Vector3 getUpVector() const {return up;} + inline const Vector3 &getLocation() const {return location;} + inline const Vector3 &getTarget() const {return target;} + inline const Vector3 &getUpVector() const {return up;} inline double getRoll() const {return roll;} inline Vector3 getDirection() const {return Vector3(direction);} - inline Vector3 getDirectionNormalized() const {return forward;} + inline const Vector3 &getDirectionNormalized() const {return forward;} inline const Matrix4 &getTransformationMatrix() const {return projector;} - inline VectorSpherical getDirectionSpherical() const {return direction;} - inline CameraPerspective getPerspective() const {return perspective;} + inline const VectorSpherical &getDirectionSpherical() const {return direction;} + inline const CameraPerspective &getPerspective() const {return perspective;} inline double getWidth() const {return width;} inline double getHeight() const {return height;} diff --git a/src/interface/modeler/quickapp/MainModelerWindow.cpp b/src/interface/modeler/quickapp/MainModelerWindow.cpp index 49d4a2c..6f0b9aa 100644 --- a/src/interface/modeler/quickapp/MainModelerWindow.cpp +++ b/src/interface/modeler/quickapp/MainModelerWindow.cpp @@ -140,10 +140,14 @@ void MainModelerWindow::keyReleaseEvent(QKeyEvent *event) if (event->key() == Qt::Key_F5) { // Start render in a thread - if (event->modifiers() & Qt::ControlModifier) + if ((event->modifiers() & Qt::ControlModifier) and (event->modifiers() & Qt::ShiftModifier)) { render_process->startFinalRender(); } + else if (event->modifiers() & Qt::ControlModifier) + { + render_process->startMediumRender(); + } else { render_process->startQuickRender(); diff --git a/src/interface/modeler/quickapp/RenderProcess.cpp b/src/interface/modeler/quickapp/RenderProcess.cpp index cdc7020..ce2958b 100644 --- a/src/interface/modeler/quickapp/RenderProcess.cpp +++ b/src/interface/modeler/quickapp/RenderProcess.cpp @@ -39,6 +39,11 @@ RenderProcess::RenderProcess(MainModelerWindow *window, RenderPreviewProvider *d connect(button_quick, SIGNAL(clicked()), this, SLOT(startQuickRender())); } + QObject *button_medium = window->findQmlObject("tool_render_medium"); + if (button_medium) { + connect(button_medium, SIGNAL(clicked()), this, SLOT(startMediumRender())); + } + QObject *button_final = window->findQmlObject("tool_render_final"); if (button_final) { connect(button_final, SIGNAL(clicked()), this, SLOT(startFinalRender())); @@ -121,7 +126,12 @@ void RenderProcess::startRender(Scenery *scenery, const RenderConfig &config) void RenderProcess::startQuickRender() { - startRender(window->getScenery(), RenderConfig(400, 300, 1, 3)); + startRender(window->getScenery(), RenderConfig(480, 270, 1, 3)); +} + +void RenderProcess::startMediumRender() +{ + startRender(window->getScenery(), RenderConfig(800, 450, 1, 5)); } void RenderProcess::startFinalRender() diff --git a/src/interface/modeler/quickapp/RenderProcess.h b/src/interface/modeler/quickapp/RenderProcess.h index 32829a0..273f6ca 100644 --- a/src/interface/modeler/quickapp/RenderProcess.h +++ b/src/interface/modeler/quickapp/RenderProcess.h @@ -39,6 +39,11 @@ public slots: */ void startQuickRender(); + /** + * Start a medium render. + */ + void startMediumRender(); + /** * Start a final render. */ diff --git a/src/interface/modeler/quickapp/qml/app.qrc b/src/interface/modeler/quickapp/qml/app.qrc index 4f4a4b5..b4b14f1 100644 --- a/src/interface/modeler/quickapp/qml/app.qrc +++ b/src/interface/modeler/quickapp/qml/app.qrc @@ -49,5 +49,7 @@ images/preset_water_lake.jpg images/preset_water_sea.jpg images/icon_preset.png + images/icon_render_medium.png + images/icon_render_final.png diff --git a/src/interface/modeler/quickapp/qml/images/icon_render_final.png b/src/interface/modeler/quickapp/qml/images/icon_render_final.png new file mode 100644 index 0000000..ec68096 Binary files /dev/null and b/src/interface/modeler/quickapp/qml/images/icon_render_final.png differ diff --git a/src/interface/modeler/quickapp/qml/images/icon_render_medium.png b/src/interface/modeler/quickapp/qml/images/icon_render_medium.png new file mode 100644 index 0000000..4f47a43 Binary files /dev/null and b/src/interface/modeler/quickapp/qml/images/icon_render_medium.png differ diff --git a/src/interface/modeler/quickapp/qml/images/icon_render_quick.png b/src/interface/modeler/quickapp/qml/images/icon_render_quick.png index c97c062..cbfa010 100644 Binary files a/src/interface/modeler/quickapp/qml/images/icon_render_quick.png and b/src/interface/modeler/quickapp/qml/images/icon_render_quick.png differ diff --git a/src/interface/modeler/quickapp/qml/main.qml b/src/interface/modeler/quickapp/qml/main.qml index fc9ae58..2338c5c 100644 --- a/src/interface/modeler/quickapp/qml/main.qml +++ b/src/interface/modeler/quickapp/qml/main.qml @@ -6,8 +6,8 @@ OpenGLView { state: "Init" property string previous_state - width: 1000 - height: 700 + width: 1280 + height: 720 Tooltip { id: tooltip_widget @@ -83,12 +83,20 @@ OpenGLView { shortcut: "F5" } + ToolbarButton { + id: tool_render_medium + objectName: "tool_render_medium" + picture: "images/icon_render_medium.png" + hovertext: qsTr("Start a medium quality render") + shortcut: "Ctrl+F5" + } + ToolbarButton { id: tool_render_final objectName: "tool_render_final" - picture: "images/tab_render.png" + picture: "images/icon_render_final.png" hovertext: qsTr("Start a final render") - shortcut: "Ctrl+F5" + shortcut: "Ctrl+Shift+F5" } ToolbarButton {