paysages : Disable auto preview updating for render tab.

git-svn-id: https://subversion.assembla.com/svn/thunderk/paysages@367 b1fd45b6-86a6-48da-8261-f70d1f35bdcc
This commit is contained in:
Michaël Lemaire 2012-06-27 13:28:12 +00:00 committed by ThunderK
parent 474e4284d4
commit 73e6c40f75
5 changed files with 40 additions and 19 deletions

1
TODO
View file

@ -10,7 +10,6 @@ Technology Preview 2 :
- Replace zone ranges with curves (with curve input and curve dialog). - Replace zone ranges with curves (with curve input and curve dialog).
- Interface for textures thickness, slope_range and thickness_transparency (and correct slider ranges). - Interface for textures thickness, slope_range and thickness_transparency (and correct slider ranges).
- Add "hardness to light" and shadow control ("minimum lighting") to material. - Add "hardness to light" and shadow control ("minimum lighting") to material.
- Render tab previews should not rerender when changing render options.
- Add layer sorting/naming. - Add layer sorting/naming.
- Add logarithmic sliders for some float values. - Add logarithmic sliders for some float values.
- Improve previews. - Improve previews.

View file

@ -91,6 +91,8 @@ BaseForm::BaseForm(QWidget* parent, bool auto_apply, bool with_layers) : QWidget
button_revert = addButton(tr("Revert")); button_revert = addButton(tr("Revert"));
button_revert->setEnabled(false); button_revert->setEnabled(false);
connect(button_revert, SIGNAL(clicked()), this, SLOT(revertConfig())); connect(button_revert, SIGNAL(clicked()), this, SLOT(revertConfig()));
auto_update_previews = true;
if (auto_apply) if (auto_apply)
{ {
@ -144,10 +146,9 @@ void BaseForm::configChangeEvent()
inputs[i]->checkVisibility(); inputs[i]->checkVisibility();
} }
QList<BasePreview*> list_previews = previews->findChildren<BasePreview*>("_form_preview_"); if (auto_update_previews)
for (int i = 0; i < list_previews.size(); i++)
{ {
list_previews[i]->redraw(); updatePreviews();
} }
} }
@ -167,7 +168,8 @@ void BaseForm::revertConfig()
} }
} }
BaseForm::configChangeEvent(); updatePreviews();
configChangeEvent();
button_apply->setEnabled(false); button_apply->setEnabled(false);
button_revert->setEnabled(false); button_revert->setEnabled(false);
@ -300,6 +302,20 @@ BaseInput* BaseForm::addInputEnum(QString label, int* value, const QStringList&
return addInput(new InputEnum(form, label, value, values)); return addInput(new InputEnum(form, label, value, values));
} }
void BaseForm::updatePreviews()
{
QList<BasePreview*> list_previews = previews->findChildren<BasePreview*>("_form_preview_");
for (int i = 0; i < list_previews.size(); i++)
{
list_previews[i]->redraw();
}
}
void BaseForm::disablePreviewsUpdate()
{
auto_update_previews = false;
}
int BaseForm::currentLayer() int BaseForm::currentLayer()
{ {
if (with_layers) if (with_layers)

View file

@ -51,6 +51,9 @@ protected:
BaseInput* addInputMaterial(QString label, SurfaceMaterial* material); BaseInput* addInputMaterial(QString label, SurfaceMaterial* material);
BaseInput* addInputEnum(QString label, int* value, const QStringList& values); BaseInput* addInputEnum(QString label, int* value, const QStringList& values);
void updatePreviews();
void disablePreviewsUpdate();
int currentLayer(); int currentLayer();
void setLayerCount(int layer_count); void setLayerCount(int layer_count);
@ -59,6 +62,7 @@ protected:
virtual void layerSelectedEvent(int layer); virtual void layerSelectedEvent(int layer);
private: private:
bool auto_update_previews;
bool auto_apply; bool auto_apply;
bool with_layers; bool with_layers;
QComboBox* layer_list; QComboBox* layer_list;

View file

@ -115,6 +115,8 @@ FormRender::FormRender(QWidget *parent) :
_camera = cameraCreateDefinition(); _camera = cameraCreateDefinition();
_renderer_inited = false; _renderer_inited = false;
disablePreviewsUpdate();
_preview_landscape = new PreviewRenderLandscape(this); _preview_landscape = new PreviewRenderLandscape(this);
addPreview(_preview_landscape, QString(tr("Top-down preview"))); addPreview(_preview_landscape, QString(tr("Top-down preview")));

View file

@ -29,7 +29,7 @@
<translation>Annuler les modifications</translation> <translation>Annuler les modifications</translation>
</message> </message>
<message> <message>
<location filename="../gui_qt/baseform.cpp" line="326"/> <location filename="../gui_qt/baseform.cpp" line="342"/>
<source>Layer %1</source> <source>Layer %1</source>
<translation>Niveau %1</translation> <translation>Niveau %1</translation>
</message> </message>
@ -530,62 +530,62 @@ Maintenir Ctrl : Plus rapide</translation>
<context> <context>
<name>FormRender</name> <name>FormRender</name>
<message> <message>
<location filename="../gui_qt/formrender.cpp" line="120"/> <location filename="../gui_qt/formrender.cpp" line="122"/>
<source>Top-down preview</source> <source>Top-down preview</source>
<translation>Aperçu plongeant</translation> <translation>Aperçu plongeant</translation>
</message> </message>
<message> <message>
<location filename="../gui_qt/formrender.cpp" line="122"/> <location filename="../gui_qt/formrender.cpp" line="124"/>
<source>Camera</source> <source>Camera</source>
<translation>Caméra</translation> <translation>Caméra</translation>
</message> </message>
<message> <message>
<location filename="../gui_qt/formrender.cpp" line="123"/> <location filename="../gui_qt/formrender.cpp" line="125"/>
<source>Quality</source> <source>Quality</source>
<translation>Qualité de rendu</translation> <translation>Qualité de rendu</translation>
</message> </message>
<message> <message>
<location filename="../gui_qt/formrender.cpp" line="124"/> <location filename="../gui_qt/formrender.cpp" line="126"/>
<source>Image width</source> <source>Image width</source>
<translation>Largeur de l&apos;image</translation> <translation>Largeur de l&apos;image</translation>
</message> </message>
<message> <message>
<location filename="../gui_qt/formrender.cpp" line="125"/> <location filename="../gui_qt/formrender.cpp" line="127"/>
<source>Image height</source> <source>Image height</source>
<translation>Hauteur de l&apos;image</translation> <translation>Hauteur de l&apos;image</translation>
</message> </message>
<message> <message>
<location filename="../gui_qt/formrender.cpp" line="126"/> <location filename="../gui_qt/formrender.cpp" line="128"/>
<source>Anti aliasing</source> <source>Anti aliasing</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../gui_qt/formrender.cpp" line="128"/> <location filename="../gui_qt/formrender.cpp" line="130"/>
<source>Start new render</source> <source>Start new render</source>
<translation>Démarrer un rendu</translation> <translation>Démarrer un rendu</translation>
</message> </message>
<message> <message>
<location filename="../gui_qt/formrender.cpp" line="130"/> <location filename="../gui_qt/formrender.cpp" line="132"/>
<source>Show last render</source> <source>Show last render</source>
<translation>Voir le dernier rendu</translation> <translation>Voir le dernier rendu</translation>
</message> </message>
<message> <message>
<location filename="../gui_qt/formrender.cpp" line="132"/> <location filename="../gui_qt/formrender.cpp" line="134"/>
<source>Save last render</source> <source>Save last render</source>
<translation>Sauvegarder le dernier rendu</translation> <translation>Sauvegarder le dernier rendu</translation>
</message> </message>
<message> <message>
<location filename="../gui_qt/formrender.cpp" line="234"/> <location filename="../gui_qt/formrender.cpp" line="236"/>
<source>Paysages 3D - Choose a filename to save the last render</source> <source>Paysages 3D - Choose a filename to save the last render</source>
<translation>Paysages 3D - Choisissez un nom de fichier pour le rendu</translation> <translation>Paysages 3D - Choisissez un nom de fichier pour le rendu</translation>
</message> </message>
<message> <message>
<location filename="../gui_qt/formrender.cpp" line="234"/> <location filename="../gui_qt/formrender.cpp" line="236"/>
<source>Images (*.png *.jpg)</source> <source>Images (*.png *.jpg)</source>
<translation>Images (*.png *.jpg)</translation> <translation>Images (*.png *.jpg)</translation>
</message> </message>
<message> <message>
<location filename="../gui_qt/formrender.cpp" line="247"/> <location filename="../gui_qt/formrender.cpp" line="249"/>
<source>Can&apos;t write to file : %1</source> <source>Can&apos;t write to file : %1</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
@ -598,7 +598,7 @@ Maintenir Ctrl : Plus rapide</translation>
<translation type="obsolete">Choisissez un nom de fichier pour le rendu</translation> <translation type="obsolete">Choisissez un nom de fichier pour le rendu</translation>
</message> </message>
<message> <message>
<location filename="../gui_qt/formrender.cpp" line="243"/> <location filename="../gui_qt/formrender.cpp" line="245"/>
<source>The picture %1 has been saved.</source> <source>The picture %1 has been saved.</source>
<translation>L&apos;image %1 a é sauvegardée.</translation> <translation>L&apos;image %1 a é sauvegardée.</translation>
</message> </message>