paysages3d/src/interface/modeler/qml/main.qml

257 lines
6.2 KiB
QML
Raw Normal View History

import QtQuick 2.2
import Paysages 1.0
OpenGLView {
2014-08-27 15:23:59 +00:00
id: main_ui
2015-09-14 17:25:54 +00:00
state: "Loading"
property string previous_state
property var current: null
property string tool: (current && current.tool) ? current.tool : ""
signal mainToolChanged(string tool)
width: 1280
height: 720
onToolChanged: mainToolChanged(tool)
2014-08-27 15:23:59 +00:00
Tooltip {
id: tooltip_widget
2015-08-19 23:15:08 +00:00
anchors.top: primary_toolbar.bottom
anchors.right: primary_toolbar.right
2014-08-27 15:23:59 +00:00
}
2015-08-23 22:39:31 +00:00
BaseToolbar {
2014-08-27 15:23:59 +00:00
id: primary_toolbar
2015-08-19 23:15:08 +00:00
horizontal: true
2014-08-28 08:29:12 +00:00
color: "#90888888"
2015-08-19 23:15:08 +00:00
property var current
2015-08-19 23:15:08 +00:00
anchors.top: parent.top
2014-08-27 15:23:59 +00:00
anchors.left: parent.left
2014-08-27 15:23:59 +00:00
ToolbarButton {
id: tool_terrain
picture: "images/tab_terrain.png"
2015-08-19 23:15:08 +00:00
hovertext: qsTr("Terrain edition")
2014-08-27 15:23:59 +00:00
}
ToolbarButton {
id: tool_textures
picture: "images/tab_textures.png"
2015-08-19 23:15:08 +00:00
hovertext: qsTr("Terrain textures")
2014-08-27 15:23:59 +00:00
}
ToolbarButton {
id: tool_water
2014-08-28 08:29:12 +00:00
picture: "images/icon_water.png"
2015-08-19 23:15:08 +00:00
hovertext: qsTr("Water tools")
2014-08-27 15:23:59 +00:00
}
ToolbarButton {
id: tool_atmosphere
2014-08-28 13:09:47 +00:00
picture: "images/icon_atmosphere.png"
2015-08-19 23:15:08 +00:00
hovertext: qsTr("Atmosphere/weather control")
2014-08-27 15:23:59 +00:00
}
ToolbarButton {
id: tool_clouds
picture: "images/tab_clouds.png"
2015-08-19 23:15:08 +00:00
hovertext: qsTr("Cloud layers")
2014-08-27 15:23:59 +00:00
}
ToolbarButton {
id: tool_render
picture: "images/tab_render.png"
2015-08-19 23:15:08 +00:00
hovertext: qsTr("Rendering")
}
2014-08-27 15:23:59 +00:00
ToolbarButton {
2015-08-19 23:15:08 +00:00
id: tool_file
picture: "images/tab_file.png"
hovertext: qsTr("File")
}
}
2015-08-23 22:39:31 +00:00
WaterSection {
id: water_section
enabled: false
2014-08-28 08:29:12 +00:00
}
2015-08-23 22:39:31 +00:00
AtmosphereSection {
id: atmosphere_section
enabled: false
2014-08-28 13:09:47 +00:00
}
2015-08-19 23:15:08 +00:00
BaseSecondaryToolbar {
id: render_toolbar
ToolbarButton {
id: tool_render_quick
objectName: "tool_render_quick"
2015-08-20 22:41:14 +00:00
picture: "images/icon_render_quick.png"
hovertext: qsTr("Start a quick render")
2015-08-20 22:46:42 +00:00
shortcut: "F5"
}
2015-08-20 22:41:14 +00:00
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"
}
2015-08-20 22:41:14 +00:00
ToolbarButton {
id: tool_render_final
objectName: "tool_render_final"
picture: "images/icon_render_final.png"
2015-08-20 22:41:14 +00:00
hovertext: qsTr("Start a final render")
shortcut: "Ctrl+Shift+F5"
2015-08-20 22:41:14 +00:00
}
ToolbarButton {
id: tool_render_show
objectName: "tool_render_show"
picture: "images/icon_render_show.png"
hovertext: qsTr("Show last rendered image")
2015-08-20 22:46:42 +00:00
shortcut: "F6"
2015-08-20 22:41:14 +00:00
}
2016-07-29 11:57:55 +00:00
ToolbarButton {
id: tool_render_raytracing
toggle: true
objectName: "tool_render_raytracing"
hovertext: qsTr("Use raytracing instead of rasterization")
}
}
2015-08-19 23:15:08 +00:00
BaseSecondaryToolbar {
id: file_toolbar
ToolbarButton {
id: tool_file_new
objectName: "tool_file_new"
picture: "images/icon_file_new.png"
hovertext: qsTr("Generate a new scene")
2015-08-20 22:46:42 +00:00
shortcut: "Ctrl+N"
2015-08-19 23:15:08 +00:00
}
ToolbarButton {
id: tool_file_save
objectName: "tool_file_save"
picture: "images/icon_file_save.png"
hovertext: qsTr("Save the current scene to a file")
2015-08-20 22:46:42 +00:00
shortcut: "Ctrl+S"
2015-08-19 23:15:08 +00:00
}
ToolbarButton {
id: tool_file_load
objectName: "tool_file_load"
picture: "images/icon_file_load.png"
hovertext: qsTr("Load a scene from a file")
2015-08-20 22:46:42 +00:00
shortcut: "Ctrl+L"
2015-08-19 23:15:08 +00:00
}
ToolbarButton {
id: tool_file_exit
objectName: "tool_file_exit"
picture: "images/icon_exit.png"
hovertext: qsTr("Exit the program")
2015-08-20 22:46:42 +00:00
shortcut: "Ctrl+Q"
2015-08-19 23:15:08 +00:00
}
}
CameraChoice {
id: camera_choice
2015-08-19 23:15:08 +00:00
height: 150
anchors.right: main_ui.right
anchors.verticalCenter: main_ui.verticalCenter
}
2014-09-09 15:56:52 +00:00
RenderDialog {
id: render_dialog
enabled: false
2014-09-09 15:56:52 +00:00
anchors.fill: parent
}
2015-09-14 17:25:54 +00:00
BaseRectangle {
id: loader
enabled: false
anchors.fill: parent
color: "#222429"
Text {
color: "#dddddd"
text: "Welcome to Paysages 3D..."
anchors.centerIn: parent
}
}
onStateChanged: {
if (state != "Render Dialog")
{
previous_state = state;
}
}
2014-08-27 15:23:59 +00:00
states: [
2015-09-14 17:25:54 +00:00
State {
name: "Loading"
PropertyChanges {
target: loader
enabled: true
}
},
2014-08-28 08:29:12 +00:00
State {
name: "Water Mode"
2015-08-28 09:40:35 +00:00
when: primary_toolbar.current === tool_water
2014-08-28 08:29:12 +00:00
PropertyChanges {
2015-08-23 22:39:31 +00:00
target: water_section
enabled: true
2014-08-28 08:29:12 +00:00
}
PropertyChanges {
target: main_ui
current: water_section
}
2014-08-28 13:09:47 +00:00
},
State {
name: "Atmosphere Mode"
2015-08-28 09:40:35 +00:00
when: primary_toolbar.current === tool_atmosphere
2014-08-28 13:09:47 +00:00
PropertyChanges {
2015-08-23 22:39:31 +00:00
target: atmosphere_section
enabled: true
2014-08-28 13:09:47 +00:00
}
PropertyChanges {
target: main_ui
current: atmosphere_section
}
2014-09-09 15:56:52 +00:00
},
State {
name: "Render Mode"
2015-08-28 09:40:35 +00:00
when: primary_toolbar.current === tool_render
PropertyChanges {
target: render_toolbar
enabled: true
}
},
2015-08-19 23:15:08 +00:00
State {
name: "File Mode"
2015-08-28 09:40:35 +00:00
when: primary_toolbar.current === tool_file
2015-08-19 23:15:08 +00:00
PropertyChanges {
target: file_toolbar
enabled: true
}
},
2014-09-09 15:56:52 +00:00
State {
name: "Render Dialog"
PropertyChanges {
target: render_dialog
enabled: true
2014-09-09 15:56:52 +00:00
}
2014-08-27 15:23:59 +00:00
}
]
}