Started work on new textures interface

This commit is contained in:
Michaël Lemaire 2013-06-23 22:54:57 +02:00
parent 300f53121e
commit 039e4bb3cb
7 changed files with 438 additions and 11 deletions

View file

@ -9,6 +9,11 @@
<file>images/load.png</file> <file>images/load.png</file>
<file>images/new.png</file> <file>images/new.png</file>
<file>images/save.png</file> <file>images/save.png</file>
<file>images/layer_add.png</file>
<file>images/layer_del.png</file>
<file>images/layer_down.png</file>
<file>images/layer_rename.png</file>
<file>images/layer_up.png</file>
</qresource> </qresource>
<qresource prefix="/tabs"> <qresource prefix="/tabs">
<file>images/tab_atmosphere.png</file> <file>images/tab_atmosphere.png</file>

View file

@ -135,8 +135,6 @@
</widget> </widget>
</item> </item>
</layout> </layout>
<zorder>widget</zorder>
<zorder>widget</zorder>
</widget> </widget>
</item> </item>
<item> <item>
@ -260,7 +258,7 @@
<item> <item>
<widget class="QTabWidget" name="tabs"> <widget class="QTabWidget" name="tabs">
<property name="currentIndex"> <property name="currentIndex">
<number>0</number> <number>1</number>
</property> </property>
<property name="iconSize"> <property name="iconSize">
<size> <size>
@ -277,6 +275,15 @@
<string>Lanscape shape</string> <string>Lanscape shape</string>
</attribute> </attribute>
</widget> </widget>
<widget class="MainTexturesForm" name="tab">
<attribute name="icon">
<iconset resource="../../../data/ui_pictures.qrc">
<normaloff>:/tabs/images/tab_textures.png</normaloff>:/tabs/images/tab_textures.png</iconset>
</attribute>
<attribute name="title">
<string>Textures</string>
</attribute>
</widget>
</widget> </widget>
</item> </item>
</layout> </layout>
@ -483,6 +490,12 @@
<header>terrain/mainterrainform.h</header> <header>terrain/mainterrainform.h</header>
<container>1</container> <container>1</container>
</customwidget> </customwidget>
<customwidget>
<class>MainTexturesForm</class>
<extends>QWidget</extends>
<header>textures/maintexturesform.h</header>
<container>1</container>
</customwidget>
</customwidgets> </customwidgets>
<resources> <resources>
<include location="../../../data/ui_pictures.qrc"/> <include location="../../../data/ui_pictures.qrc"/>
@ -515,8 +528,8 @@
<y>425</y> <y>425</y>
</hint> </hint>
<hint type="destinationlabel"> <hint type="destinationlabel">
<x>213</x> <x>-1</x>
<y>425</y> <y>-1</y>
</hint> </hint>
</hints> </hints>
</connection> </connection>

View file

@ -71,7 +71,8 @@ HEADERS += \
common/previewrenderer.h \ common/previewrenderer.h \
terrain/widgetterrainbasenoisepreview.h \ terrain/widgetterrainbasenoisepreview.h \
common/mainwindow.h \ common/mainwindow.h \
terrain/dialogbaseterrainnoise.h terrain/dialogbaseterrainnoise.h \
textures/maintexturesform.h
SOURCES += \ SOURCES += \
terrain/widgetheightmap.cpp \ terrain/widgetheightmap.cpp \
@ -122,14 +123,16 @@ SOURCES += \
common/previewrenderer.cpp \ common/previewrenderer.cpp \
terrain/widgetterrainbasenoisepreview.cpp \ terrain/widgetterrainbasenoisepreview.cpp \
common/mainwindow.cpp \ common/mainwindow.cpp \
terrain/dialogbaseterrainnoise.cpp terrain/dialogbaseterrainnoise.cpp \
textures/maintexturesform.cpp
FORMS += \ FORMS += \
terrain/dialogterrainpainting.ui \ terrain/dialogterrainpainting.ui \
common/widgetglobalformbuttons.ui \ common/widgetglobalformbuttons.ui \
terrain/mainterrainform.ui \ terrain/mainterrainform.ui \
common/mainwindow.ui \ common/mainwindow.ui \
terrain/dialogbaseterrainnoise.ui terrain/dialogbaseterrainnoise.ui \
textures/maintexturesform.ui
RESOURCES += \ RESOURCES += \
../../data/ui_pictures.qrc ../../data/ui_pictures.qrc

View file

@ -6,8 +6,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>1079</width> <width>1181</width>
<height>720</height> <height>693</height>
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
@ -293,7 +293,7 @@
</size> </size>
</property> </property>
<property name="text"> <property name="text">
<string>Go to textures to add small height displacements (rocks...)</string> <string>Go to textures to add relief effect (rocks...)</string>
</property> </property>
</widget> </widget>
</item> </item>

View file

@ -0,0 +1,14 @@
#include "maintexturesform.h"
#include "ui_maintexturesform.h"
MainTexturesForm::MainTexturesForm(QWidget *parent) :
QWidget(parent),
ui(new Ui::MainTexturesForm)
{
ui->setupUi(this);
}
MainTexturesForm::~MainTexturesForm()
{
delete ui;
}

View file

@ -0,0 +1,22 @@
#ifndef MAINTEXTURESFORM_H
#define MAINTEXTURESFORM_H
#include <QWidget>
namespace Ui {
class MainTexturesForm;
}
class MainTexturesForm : public QWidget
{
Q_OBJECT
public:
explicit MainTexturesForm(QWidget *parent = 0);
~MainTexturesForm();
private:
Ui::MainTexturesForm *ui;
};
#endif // MAINTEXTURESFORM_H

View file

@ -0,0 +1,370 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>MainTexturesForm</class>
<widget class="QWidget" name="MainTexturesForm">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>1008</width>
<height>664</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QGroupBox" name="groupBox_2">
<property name="title">
<string>Texture layers</string>
</property>
<property name="flat">
<bool>true</bool>
</property>
<layout class="QVBoxLayout" name="verticalLayout_6">
<item>
<widget class="QLabel" name="label_6">
<property name="font">
<font>
<italic>true</italic>
</font>
</property>
<property name="text">
<string>These are the layers of textures that control the ground details. Each texture has two effects : a relief effect to add better definition to the base terrain shape, and a detail effect for close views.</string>
</property>
<property name="textFormat">
<enum>Qt::AutoText</enum>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QTableView" name="tableView"/>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<spacer name="verticalSpacer_4">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="pushButton">
<property name="text">
<string>Add layer</string>
</property>
<property name="icon">
<iconset resource="../../../data/ui_pictures.qrc">
<normaloff>:/buttons/logo/images/layer_add.png</normaloff>:/buttons/logo/images/layer_add.png</iconset>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButton_2">
<property name="text">
<string>Remove layer</string>
</property>
<property name="icon">
<iconset resource="../../../data/ui_pictures.qrc">
<normaloff>:/buttons/logo/images/layer_del.png</normaloff>:/buttons/logo/images/layer_del.png</iconset>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer_3">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="pushButton_3">
<property name="text">
<string>Rename layer</string>
</property>
<property name="icon">
<iconset resource="../../../data/ui_pictures.qrc">
<normaloff>:/buttons/logo/images/layer_rename.png</normaloff>:/buttons/logo/images/layer_rename.png</iconset>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="pushButton_5">
<property name="text">
<string>Move layer down</string>
</property>
<property name="icon">
<iconset resource="../../../data/ui_pictures.qrc">
<normaloff>:/buttons/logo/images/layer_down.png</normaloff>:/buttons/logo/images/layer_down.png</iconset>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButton_4">
<property name="text">
<string>Move layer up</string>
</property>
<property name="icon">
<iconset resource="../../../data/ui_pictures.qrc">
<normaloff>:/buttons/logo/images/layer_up.png</normaloff>:/buttons/logo/images/layer_up.png</iconset>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer_5">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_3">
<property name="title">
<string>Selected layer previews</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="2" column="1">
<widget class="BasePreview" name="preview_shape_6" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>200</width>
<height>200</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>200</width>
<height>200</height>
</size>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Coverage</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="BasePreview" name="preview_shape_2" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>200</width>
<height>200</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>200</width>
<height>200</height>
</size>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLabel" name="label_5">
<property name="text">
<string>Appearance</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</item>
<item>
<widget class="Line" name="line">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>All layers preview</string>
</property>
<property name="flat">
<bool>true</bool>
</property>
<layout class="QVBoxLayout" name="verticalLayout_4">
<item>
<widget class="BasePreview" name="preview_shape" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>200</width>
<height>200</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>200</width>
<height>200</height>
</size>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="button_render">
<property name="text">
<string>Render preview</string>
</property>
<property name="icon">
<iconset resource="../../../data/ui_pictures.qrc">
<normaloff>:/buttons/logo/images/render.png</normaloff>:/buttons/logo/images/render.png</iconset>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="button_explore">
<property name="text">
<string>Explore in 3D</string>
</property>
<property name="icon">
<iconset resource="../../../data/ui_pictures.qrc">
<normaloff>:/buttons/logo/images/explore.png</normaloff>:/buttons/logo/images/explore.png</iconset>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_4">
<property name="title">
<string>Actions</string>
</property>
<property name="flat">
<bool>true</bool>
</property>
<layout class="QVBoxLayout" name="verticalLayout_5">
<item>
<widget class="QPushButton" name="button_revert">
<property name="text">
<string>Revert modifications</string>
</property>
<property name="icon">
<iconset resource="../../../data/ui_pictures.qrc">
<normaloff>:/buttons/logo/images/revert.png</normaloff>:/buttons/logo/images/revert.png</iconset>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="button_apply">
<property name="text">
<string>Apply modifications</string>
</property>
<property name="icon">
<iconset resource="../../../data/ui_pictures.qrc">
<normaloff>:/buttons/logo/images/apply.png</normaloff>:/buttons/logo/images/apply.png</iconset>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>BasePreview</class>
<extends>QWidget</extends>
<header>basepreview.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<resources>
<include location="../../../data/ui_pictures.qrc"/>
</resources>
<connections/>
</ui>