Tweaked window and render sizes to keep full hd ratio

Also added medium render size
This commit is contained in:
Michaël Lemaire 2015-09-14 00:48:55 +02:00
parent 0c8a88cddb
commit 005c24fa85
9 changed files with 41 additions and 12 deletions

View file

@ -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;}

View file

@ -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();

View file

@ -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()

View file

@ -39,6 +39,11 @@ public slots:
*/
void startQuickRender();
/**
* Start a medium render.
*/
void startMediumRender();
/**
* Start a final render.
*/

View file

@ -49,5 +49,7 @@
<file>images/preset_water_lake.jpg</file>
<file>images/preset_water_sea.jpg</file>
<file>images/icon_preset.png</file>
<file>images/icon_render_medium.png</file>
<file>images/icon_render_final.png</file>
</qresource>
</RCC>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 1 KiB

View file

@ -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 {