paysages: Added preview scrolling and progressive scaling.
git-svn-id: https://subversion.assembla.com/svn/thunderk/paysages@296 b1fd45b6-86a6-48da-8261-f70d1f35bdcc
This commit is contained in:
parent
adaa18c01f
commit
5e6952b4c8
8 changed files with 196 additions and 217 deletions
1
TODO
1
TODO
|
@ -1,5 +1,4 @@
|
||||||
Technology Preview 1 :
|
Technology Preview 1 :
|
||||||
- Implement scrolling on previews.
|
|
||||||
- Find a licence and apply it.
|
- Find a licence and apply it.
|
||||||
|
|
||||||
Technology Preview 2 :
|
Technology Preview 2 :
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
#include "basepreview.h"
|
#include "basepreview.h"
|
||||||
|
|
||||||
|
#include <math.h>
|
||||||
#include <QVector>
|
#include <QVector>
|
||||||
#include <QPainter>
|
#include <QPainter>
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
|
@ -40,8 +41,10 @@ BasePreview::BasePreview(QWidget* parent) :
|
||||||
|
|
||||||
this->conf_scroll_xmin = 0.0;
|
this->conf_scroll_xmin = 0.0;
|
||||||
this->conf_scroll_xmax = 0.0;
|
this->conf_scroll_xmax = 0.0;
|
||||||
|
this->conf_scroll_xinit = 0.0;
|
||||||
this->conf_scroll_ymin = 0.0;
|
this->conf_scroll_ymin = 0.0;
|
||||||
this->conf_scroll_ymax = 0.0;
|
this->conf_scroll_ymax = 0.0;
|
||||||
|
this->conf_scroll_yinit = 0.0;
|
||||||
this->conf_scale_min = 1.0;
|
this->conf_scale_min = 1.0;
|
||||||
this->conf_scale_max = 1.0;
|
this->conf_scale_max = 1.0;
|
||||||
this->conf_scale_init = 1.0;
|
this->conf_scale_init = 1.0;
|
||||||
|
@ -102,6 +105,19 @@ void BasePreview::configScaling(double min, double max, double step, double init
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void BasePreview::configScrolling(double xmin, double xmax, double xinit, double ymin, double ymax, double yinit)
|
||||||
|
{
|
||||||
|
conf_scroll_xmin = xmin;
|
||||||
|
conf_scroll_xmax = xmax;
|
||||||
|
conf_scroll_xinit = xinit;
|
||||||
|
conf_scroll_ymin = ymin;
|
||||||
|
conf_scroll_ymax = ymax;
|
||||||
|
conf_scroll_yinit = yinit;
|
||||||
|
xoffset = xinit;
|
||||||
|
yoffset = yinit;
|
||||||
|
redraw();
|
||||||
|
}
|
||||||
|
|
||||||
void BasePreview::start()
|
void BasePreview::start()
|
||||||
{
|
{
|
||||||
this->updater->start();
|
this->updater->start();
|
||||||
|
@ -199,9 +215,10 @@ void BasePreview::renderPixbuf()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (qAlpha(this->pixbuf->pixel(x, y)) == 0)
|
if (qAlpha(this->pixbuf->pixel(x, y)) < 255)
|
||||||
{
|
{
|
||||||
col = this->getColor((double)(x - w / 2) * this->scaling + this->xoffset, (double)(y - h / 2) * this->scaling + this->yoffset);
|
col = this->getColor((double)(x - w / 2) * this->scaling + this->xoffset, (double)(y - h / 2) * this->scaling + this->yoffset);
|
||||||
|
col.setAlpha(255);
|
||||||
this->pixbuf->setPixel(x, y, col.rgb());
|
this->pixbuf->setPixel(x, y, col.rgb());
|
||||||
done = true;
|
done = true;
|
||||||
}
|
}
|
||||||
|
@ -214,9 +231,107 @@ void BasePreview::renderPixbuf()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void BasePreview::mousePressEvent(QMouseEvent* event)
|
||||||
|
{
|
||||||
|
if (event->button() == Qt::LeftButton)
|
||||||
|
{
|
||||||
|
mousex = event->x();
|
||||||
|
mousey = event->y();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void BasePreview::mouseMoveEvent(QMouseEvent* event)
|
||||||
|
{
|
||||||
|
int dx, dy;
|
||||||
|
int ndx, ndy;
|
||||||
|
int width, height;
|
||||||
|
|
||||||
|
if (event->buttons() & Qt::LeftButton)
|
||||||
|
{
|
||||||
|
dx = event->x() - mousex;
|
||||||
|
dy = event->y() - mousey;
|
||||||
|
|
||||||
|
ndx = dx;
|
||||||
|
ndy = dy;
|
||||||
|
if (xoffset - dx * scaling > conf_scroll_xmax)
|
||||||
|
{
|
||||||
|
ndx = (int)floor((conf_scroll_xmax - xoffset) / scaling);
|
||||||
|
}
|
||||||
|
if (xoffset - dx * scaling < conf_scroll_xmin)
|
||||||
|
{
|
||||||
|
ndx = (int)floor((conf_scroll_xmin - xoffset) / scaling);
|
||||||
|
}
|
||||||
|
if (yoffset - dy * scaling > conf_scroll_ymax)
|
||||||
|
{
|
||||||
|
ndy = (int)floor((conf_scroll_ymax - yoffset) / scaling);
|
||||||
|
}
|
||||||
|
if (yoffset - dy * scaling < conf_scroll_ymin)
|
||||||
|
{
|
||||||
|
ndy = (int)floor((conf_scroll_ymin - yoffset) / scaling);
|
||||||
|
}
|
||||||
|
if (ndx != 0 || ndy != 0)
|
||||||
|
{
|
||||||
|
width = this->width();
|
||||||
|
height = this->height();
|
||||||
|
|
||||||
|
if (ndx <= -width || ndx >= width || ndy <= -height || ndy >= height)
|
||||||
|
{
|
||||||
|
xoffset -= (double)ndx * scaling;
|
||||||
|
yoffset -= (double)ndy * scaling;
|
||||||
|
|
||||||
|
forceRender();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
int xstart, xsize, ystart, ysize;
|
||||||
|
|
||||||
|
lock_drawing->lock();
|
||||||
|
|
||||||
|
xoffset -= (double)ndx * scaling;
|
||||||
|
yoffset -= (double)ndy * scaling;
|
||||||
|
|
||||||
|
if (ndx < 0)
|
||||||
|
{
|
||||||
|
xstart = -ndx;
|
||||||
|
xsize = width + ndx;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
xstart = 0;
|
||||||
|
xsize = width - ndx;
|
||||||
|
}
|
||||||
|
if (ndy < 0)
|
||||||
|
{
|
||||||
|
ystart = -ndy;
|
||||||
|
ysize = height + ndy;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ystart = 0;
|
||||||
|
ysize = height - ndy;
|
||||||
|
}
|
||||||
|
|
||||||
|
QImage part = pixbuf->copy(xstart, ystart, xsize, ysize);
|
||||||
|
QPainter painter(pixbuf);
|
||||||
|
pixbuf->fill(0x00000000);
|
||||||
|
painter.drawImage(xstart + ndx, ystart + ndy, part);
|
||||||
|
|
||||||
|
need_render = true;
|
||||||
|
lock_drawing->unlock();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
mousex = event->x();
|
||||||
|
mousey = event->y();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void BasePreview::wheelEvent(QWheelEvent* event)
|
void BasePreview::wheelEvent(QWheelEvent* event)
|
||||||
{
|
{
|
||||||
double factor;
|
double factor;
|
||||||
|
double old_scaling;
|
||||||
|
int width, height;
|
||||||
|
int new_width, new_height;
|
||||||
|
|
||||||
if (event->modifiers() & Qt::ShiftModifier)
|
if (event->modifiers() & Qt::ShiftModifier)
|
||||||
{
|
{
|
||||||
|
@ -231,6 +346,10 @@ void BasePreview::wheelEvent(QWheelEvent* event)
|
||||||
factor = 1.0;
|
factor = 1.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
old_scaling = scaling;
|
||||||
|
width = pixbuf->width();
|
||||||
|
height = pixbuf->height();
|
||||||
|
|
||||||
if (event->orientation() == Qt::Vertical)
|
if (event->orientation() == Qt::Vertical)
|
||||||
{
|
{
|
||||||
if (event->delta() > 0 && scaling > conf_scale_min)
|
if (event->delta() > 0 && scaling > conf_scale_min)
|
||||||
|
@ -240,7 +359,17 @@ void BasePreview::wheelEvent(QWheelEvent* event)
|
||||||
{
|
{
|
||||||
scaling = conf_scale_min;
|
scaling = conf_scale_min;
|
||||||
}
|
}
|
||||||
redraw();
|
|
||||||
|
lock_drawing->lock();
|
||||||
|
new_width = (int)floor(((double)width) * scaling / old_scaling);
|
||||||
|
new_height = (int)floor(((double)height) * scaling / old_scaling);
|
||||||
|
QImage part = pixbuf->copy((width - new_width) / 2, (height - new_height) / 2, new_width, new_height).scaled(width, height);
|
||||||
|
QPainter painter(pixbuf);
|
||||||
|
pixbuf->fill(0x00000000);
|
||||||
|
painter.setOpacity(0.99);
|
||||||
|
painter.drawImage(0, 0, part);
|
||||||
|
need_render = true;
|
||||||
|
lock_drawing->unlock();
|
||||||
}
|
}
|
||||||
else if (event->delta() < 0 && scaling < conf_scale_max)
|
else if (event->delta() < 0 && scaling < conf_scale_max)
|
||||||
{
|
{
|
||||||
|
@ -249,7 +378,15 @@ void BasePreview::wheelEvent(QWheelEvent* event)
|
||||||
{
|
{
|
||||||
scaling = conf_scale_max;
|
scaling = conf_scale_max;
|
||||||
}
|
}
|
||||||
redraw();
|
|
||||||
|
lock_drawing->lock();
|
||||||
|
QImage part = pixbuf->scaled((int)floor(((double)width) * old_scaling / scaling), (int)floor(((double)height) * old_scaling / scaling));
|
||||||
|
QPainter painter(pixbuf);
|
||||||
|
pixbuf->fill(0x00000000);
|
||||||
|
painter.setOpacity(0.99);
|
||||||
|
painter.drawImage((width - part.width()) / 2, (height - part.height()) / 2, part);
|
||||||
|
need_render = true;
|
||||||
|
lock_drawing->unlock();
|
||||||
}
|
}
|
||||||
event->accept();
|
event->accept();
|
||||||
}
|
}
|
||||||
|
@ -325,171 +462,3 @@ void BasePreview::wheelEvent(QWheelEvent* event)
|
||||||
// preview->need_render = 1;
|
// preview->need_render = 1;
|
||||||
// }
|
// }
|
||||||
//}
|
//}
|
||||||
|
|
||||||
//static inline int _fixScroll(SmallPreview* preview, int dx, int dy, int* new_dx, int* new_dy)
|
|
||||||
//{
|
|
||||||
// *new_dx = dx;
|
|
||||||
// *new_dy = dy;
|
|
||||||
// if (preview->xoffset - dx * preview->scaling > preview->conf_scroll_xmax)
|
|
||||||
// {
|
|
||||||
// *new_dx = (int)floor((preview->conf_scroll_xmax - preview->xoffset) / preview->scaling);
|
|
||||||
// }
|
|
||||||
// if (preview->xoffset - dx * preview->scaling < preview->conf_scroll_xmin)
|
|
||||||
// {
|
|
||||||
// *new_dx = (int)floor((preview->conf_scroll_xmin - preview->xoffset) / preview->scaling);
|
|
||||||
// }
|
|
||||||
// if (preview->yoffset - dy * preview->scaling > preview->conf_scroll_ymax)
|
|
||||||
// {
|
|
||||||
// *new_dy = (int)floor((preview->conf_scroll_ymax - preview->yoffset) / preview->scaling);
|
|
||||||
// }
|
|
||||||
// if (preview->yoffset - dy * preview->scaling < preview->conf_scroll_ymin)
|
|
||||||
// {
|
|
||||||
// *new_dy = (int)floor((preview->conf_scroll_ymin - preview->yoffset) / preview->scaling);
|
|
||||||
// }
|
|
||||||
// return (*new_dx == 0 && *new_dy == 0) ? 0 : 1;
|
|
||||||
//}
|
|
||||||
|
|
||||||
//static inline int _fixScaling(SmallPreview* preview, double scaling, double* new_scaling)
|
|
||||||
//{
|
|
||||||
// double old_scaling = preview->scaling;
|
|
||||||
// *new_scaling = scaling;
|
|
||||||
// if (scaling < preview->conf_scale_min)
|
|
||||||
// {
|
|
||||||
// *new_scaling = preview->conf_scale_min;
|
|
||||||
// }
|
|
||||||
// if (scaling > preview->conf_scale_max)
|
|
||||||
// {
|
|
||||||
// *new_scaling = preview->conf_scale_max;
|
|
||||||
// }
|
|
||||||
// return (old_scaling == *new_scaling) ? 0 : 1;
|
|
||||||
//}
|
|
||||||
|
|
||||||
//static int _cbMouseScroll(GtkEventBox* image, GdkEventScroll* event, gpointer data)
|
|
||||||
//{
|
|
||||||
// SmallPreview* preview = (SmallPreview*)data;
|
|
||||||
|
|
||||||
// /* TODO Center the zoom on the cursor */
|
|
||||||
|
|
||||||
// if (event->direction == GDK_SCROLL_UP)
|
|
||||||
// {
|
|
||||||
// mutexAcquire(preview->lock);
|
|
||||||
// if (_fixScaling(preview, preview->scaling - preview->conf_scale_step, &preview->scaling))
|
|
||||||
// {
|
|
||||||
// preview->need_rerender = 1;
|
|
||||||
// }
|
|
||||||
// mutexRelease(preview->lock);
|
|
||||||
// }
|
|
||||||
// else if (event->direction == GDK_SCROLL_DOWN)
|
|
||||||
// {
|
|
||||||
// mutexAcquire(preview->lock);
|
|
||||||
// if (_fixScaling(preview, preview->scaling + preview->conf_scale_step, &preview->scaling))
|
|
||||||
// {
|
|
||||||
// preview->need_rerender = 1;
|
|
||||||
// }
|
|
||||||
// mutexRelease(preview->lock);
|
|
||||||
// }
|
|
||||||
|
|
||||||
// return 1;
|
|
||||||
//}
|
|
||||||
|
|
||||||
//static int _cbMouseButtonPressed(GtkEventBox* image, GdkEventButton* event, gpointer data)
|
|
||||||
//{
|
|
||||||
// SmallPreview* preview = (SmallPreview*)data;
|
|
||||||
|
|
||||||
// if (event->button == 1)
|
|
||||||
// {
|
|
||||||
// preview->mousex = (int)event->x;
|
|
||||||
// preview->mousey = (int)event->y;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// return 1;
|
|
||||||
//}
|
|
||||||
|
|
||||||
//static int _cbMouseMove(GtkEventBox* image, GdkEventMotion* event, gpointer data)
|
|
||||||
//{
|
|
||||||
// SmallPreview* preview = (SmallPreview*)data;
|
|
||||||
// int dx, dy;
|
|
||||||
|
|
||||||
// if (event->state & GDK_BUTTON1_MASK)
|
|
||||||
// {
|
|
||||||
// mutexAcquire(preview->lock);
|
|
||||||
|
|
||||||
// dx = (int)event->x - preview->mousex;
|
|
||||||
// dy = (int)event->y - preview->mousey;
|
|
||||||
|
|
||||||
// if (_fixScroll(preview, dx, dy, &dx, &dy))
|
|
||||||
// {
|
|
||||||
// _scrollPixbuf(preview, dx, dy);
|
|
||||||
// }
|
|
||||||
|
|
||||||
// preview->mousex = (int)event->x;
|
|
||||||
// preview->mousey = (int)event->y;
|
|
||||||
|
|
||||||
// mutexRelease(preview->lock);
|
|
||||||
// }
|
|
||||||
|
|
||||||
// return 1;
|
|
||||||
//}
|
|
||||||
|
|
||||||
//void guiPreviewRedrawAll()
|
|
||||||
//{
|
|
||||||
// int i;
|
|
||||||
|
|
||||||
// for (i = 0; i < _previews_count; i++)
|
|
||||||
// {
|
|
||||||
// guiPreviewRedraw(_preview + i);
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
|
|
||||||
//void guiPreviewConfigScrolling(SmallPreview* preview, double xmin, double xmax, double ymin, double ymax)
|
|
||||||
//{
|
|
||||||
// mutexAcquire(preview->lock);
|
|
||||||
// preview->conf_scroll_xmin = xmin;
|
|
||||||
// preview->conf_scroll_xmax = xmax;
|
|
||||||
// preview->conf_scroll_ymin = ymin;
|
|
||||||
// preview->conf_scroll_ymax = ymax;
|
|
||||||
// preview->need_rerender = 1;
|
|
||||||
// mutexRelease(preview->lock);
|
|
||||||
//}
|
|
||||||
|
|
||||||
//void guiPreviewConfigScaling(SmallPreview* preview, double min, double max, double step)
|
|
||||||
//{
|
|
||||||
// mutexAcquire(preview->lock);
|
|
||||||
// preview->conf_scale_min = min;
|
|
||||||
// preview->conf_scale_max = max;
|
|
||||||
// preview->conf_scale_step = step;
|
|
||||||
// preview->need_rerender = 1;
|
|
||||||
// mutexRelease(preview->lock);
|
|
||||||
//}
|
|
||||||
|
|
||||||
//void guiPreviewSetRenderer(SmallPreview* preview, SmallPreviewCallback renderer)
|
|
||||||
//{
|
|
||||||
// mutexAcquire(preview->lock);
|
|
||||||
// preview->renderer = renderer;
|
|
||||||
// preview->need_rerender = 1;
|
|
||||||
// mutexRelease(preview->lock);
|
|
||||||
//}
|
|
||||||
|
|
||||||
//void guiPreviewSetViewport(SmallPreview* preview, double xoffset, double yoffset, double scaling)
|
|
||||||
//{
|
|
||||||
// mutexAcquire(preview->lock);
|
|
||||||
// preview->xoffset = xoffset;
|
|
||||||
// preview->yoffset = yoffset;
|
|
||||||
// preview->scaling = scaling;
|
|
||||||
// preview->need_rerender = 1;
|
|
||||||
// mutexRelease(preview->lock);
|
|
||||||
//}
|
|
||||||
|
|
||||||
//void guiPreviewSetTerrainHeight(SmallPreview* preview)
|
|
||||||
//{
|
|
||||||
// /*preview->conf_scroll_x = 1;
|
|
||||||
// preview->conf_scroll_y = 1;
|
|
||||||
// preview->conf_zoom = 1;
|
|
||||||
// preview->init_scaling = preview->scaling = 0.1;
|
|
||||||
// preview->init_xoffset = preview->xoffset = 0.0;
|
|
||||||
// preview->init_yoffset = preview->yoffset = 0.0;
|
|
||||||
|
|
||||||
// preview->renderer = _renderTopDownHeight;*/
|
|
||||||
|
|
||||||
// guiPreviewRedraw(preview);
|
|
||||||
//}
|
|
||||||
|
|
|
@ -23,6 +23,7 @@ protected:
|
||||||
virtual QColor getColor(double x, double y);
|
virtual QColor getColor(double x, double y);
|
||||||
|
|
||||||
void configScaling(double min, double max, double step, double init);
|
void configScaling(double min, double max, double step, double init);
|
||||||
|
void configScrolling(double xmin, double xmax, double xinit, double ymin, double ymax, double yinit);
|
||||||
|
|
||||||
double xoffset;
|
double xoffset;
|
||||||
double yoffset;
|
double yoffset;
|
||||||
|
@ -35,6 +36,8 @@ private:
|
||||||
void resizeEvent(QResizeEvent* event);
|
void resizeEvent(QResizeEvent* event);
|
||||||
void paintEvent(QPaintEvent* event);
|
void paintEvent(QPaintEvent* event);
|
||||||
|
|
||||||
|
void mousePressEvent(QMouseEvent* event);
|
||||||
|
void mouseMoveEvent(QMouseEvent* event);
|
||||||
void wheelEvent(QWheelEvent* event);
|
void wheelEvent(QWheelEvent* event);
|
||||||
|
|
||||||
QThread* updater;
|
QThread* updater;
|
||||||
|
@ -51,8 +54,10 @@ private:
|
||||||
|
|
||||||
double conf_scroll_xmin;
|
double conf_scroll_xmin;
|
||||||
double conf_scroll_xmax;
|
double conf_scroll_xmax;
|
||||||
|
double conf_scroll_xinit;
|
||||||
double conf_scroll_ymin;
|
double conf_scroll_ymin;
|
||||||
double conf_scroll_ymax;
|
double conf_scroll_ymax;
|
||||||
|
double conf_scroll_yinit;
|
||||||
|
|
||||||
double conf_scale_min;
|
double conf_scale_min;
|
||||||
double conf_scale_max;
|
double conf_scale_max;
|
||||||
|
|
|
@ -34,6 +34,7 @@ public:
|
||||||
_renderer.customData[3] = &_water;
|
_renderer.customData[3] = &_water;
|
||||||
|
|
||||||
configScaling(0.5, 200.0, 1.0, 50.0);
|
configScaling(0.5, 200.0, 1.0, 50.0);
|
||||||
|
configScrolling(-1000.0, 1000.0, 0.0, -1000.0, 1000.0, 0.0);
|
||||||
}
|
}
|
||||||
protected:
|
protected:
|
||||||
QColor getColor(double x, double y)
|
QColor getColor(double x, double y)
|
||||||
|
|
|
@ -20,6 +20,7 @@ public:
|
||||||
_preview_definition = terrainCreateDefinition();
|
_preview_definition = terrainCreateDefinition();
|
||||||
|
|
||||||
configScaling(0.5, 200.0, 1.0, 50.0);
|
configScaling(0.5, 200.0, 1.0, 50.0);
|
||||||
|
configScrolling(-1000.0, 1000.0, 0.0, -1000.0, 1000.0, 0.0);
|
||||||
}
|
}
|
||||||
protected:
|
protected:
|
||||||
QColor getColor(double x, double y)
|
QColor getColor(double x, double y)
|
||||||
|
@ -94,6 +95,7 @@ public:
|
||||||
_renderer.customData[2] = &_lighting;
|
_renderer.customData[2] = &_lighting;
|
||||||
|
|
||||||
configScaling(0.5, 200.0, 1.0, 50.0);
|
configScaling(0.5, 200.0, 1.0, 50.0);
|
||||||
|
configScrolling(-1000.0, 1000.0, 0.0, -1000.0, 1000.0, 0.0);
|
||||||
}
|
}
|
||||||
protected:
|
protected:
|
||||||
QColor getColor(double x, double y)
|
QColor getColor(double x, double y)
|
||||||
|
|
|
@ -36,6 +36,7 @@ public:
|
||||||
_preview_layer = texturesLayerCreateDefinition();
|
_preview_layer = texturesLayerCreateDefinition();
|
||||||
|
|
||||||
configScaling(0.5, 200.0, 1.0, 50.0);
|
configScaling(0.5, 200.0, 1.0, 50.0);
|
||||||
|
configScrolling(-1000.0, 1000.0, 0.0, -1000.0, 1000.0, 0.0);
|
||||||
}
|
}
|
||||||
protected:
|
protected:
|
||||||
QColor getColor(double x, double y)
|
QColor getColor(double x, double y)
|
||||||
|
@ -95,6 +96,7 @@ public:
|
||||||
_renderer.camera_location.z = 0.0;
|
_renderer.camera_location.z = 0.0;
|
||||||
|
|
||||||
configScaling(0.1, 10.0, 0.1, 1.0);
|
configScaling(0.1, 10.0, 0.1, 1.0);
|
||||||
|
configScrolling(-1000.0, 1000.0, 0.0, -1000.0, 1000.0, 0.0);
|
||||||
}
|
}
|
||||||
protected:
|
protected:
|
||||||
QColor getColor(double x, double y)
|
QColor getColor(double x, double y)
|
||||||
|
|
|
@ -26,6 +26,7 @@ public:
|
||||||
_terrain = terrainCreateDefinition();
|
_terrain = terrainCreateDefinition();
|
||||||
|
|
||||||
configScaling(0.5, 200.0, 1.0, 50.0);
|
configScaling(0.5, 200.0, 1.0, 50.0);
|
||||||
|
configScrolling(-1000.0, 1000.0, 0.0, -1000.0, 1000.0, 0.0);
|
||||||
}
|
}
|
||||||
protected:
|
protected:
|
||||||
QColor getColor(double x, double y)
|
QColor getColor(double x, double y)
|
||||||
|
|
|
@ -353,52 +353,52 @@ Maintenir Ctrl : Plus rapide</translation>
|
||||||
<context>
|
<context>
|
||||||
<name>FormRender</name>
|
<name>FormRender</name>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../gui_qt/formrender.cpp" line="106"/>
|
<location filename="../gui_qt/formrender.cpp" line="107"/>
|
||||||
<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="108"/>
|
<location filename="../gui_qt/formrender.cpp" line="109"/>
|
||||||
<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="109"/>
|
<location filename="../gui_qt/formrender.cpp" line="110"/>
|
||||||
<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="110"/>
|
<location filename="../gui_qt/formrender.cpp" line="111"/>
|
||||||
<source>Image width</source>
|
<source>Image width</source>
|
||||||
<translation>Largeur de l'image</translation>
|
<translation>Largeur de l'image</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../gui_qt/formrender.cpp" line="111"/>
|
<location filename="../gui_qt/formrender.cpp" line="112"/>
|
||||||
<source>Image height</source>
|
<source>Image height</source>
|
||||||
<translation>Hauteur de l'image</translation>
|
<translation>Hauteur de l'image</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../gui_qt/formrender.cpp" line="113"/>
|
<location filename="../gui_qt/formrender.cpp" line="114"/>
|
||||||
<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="115"/>
|
<location filename="../gui_qt/formrender.cpp" line="116"/>
|
||||||
<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="117"/>
|
<location filename="../gui_qt/formrender.cpp" line="118"/>
|
||||||
<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="196"/>
|
<location filename="../gui_qt/formrender.cpp" line="197"/>
|
||||||
<source>Choose a filename to save the last render</source>
|
<source>Choose a filename to save the last render</source>
|
||||||
<translation>Choisissez un nom de fichier pour le rendu</translation>
|
<translation>Choisissez un nom de fichier pour le rendu</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../gui_qt/formrender.cpp" line="200"/>
|
<location filename="../gui_qt/formrender.cpp" line="201"/>
|
||||||
<source>The picture %1 has been saved.</source>
|
<source>The picture %1 has been saved.</source>
|
||||||
<translation>L'image %1 a été sauvegardée.</translation>
|
<translation>L'image %1 a été sauvegardée.</translation>
|
||||||
</message>
|
</message>
|
||||||
|
@ -454,7 +454,7 @@ Maintenir Ctrl : Plus rapide</translation>
|
||||||
<context>
|
<context>
|
||||||
<name>FormTerrain</name>
|
<name>FormTerrain</name>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../gui_qt/formterrain.cpp" line="143"/>
|
<location filename="../gui_qt/formterrain.cpp" line="145"/>
|
||||||
<source>Height preview (normalized)</source>
|
<source>Height preview (normalized)</source>
|
||||||
<translation>Aperçu de la hauteur (normalisée)</translation>
|
<translation>Aperçu de la hauteur (normalisée)</translation>
|
||||||
</message>
|
</message>
|
||||||
|
@ -463,22 +463,22 @@ Maintenir Ctrl : Plus rapide</translation>
|
||||||
<translation type="obsolete">Aperçu du rendu (sans ombres)</translation>
|
<translation type="obsolete">Aperçu du rendu (sans ombres)</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../gui_qt/formterrain.cpp" line="144"/>
|
<location filename="../gui_qt/formterrain.cpp" line="146"/>
|
||||||
<source>Lighted preview (no texture)</source>
|
<source>Lighted preview (no texture)</source>
|
||||||
<translation>Aperçu éclairé (sans texture)</translation>
|
<translation>Aperçu éclairé (sans texture)</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../gui_qt/formterrain.cpp" line="146"/>
|
<location filename="../gui_qt/formterrain.cpp" line="148"/>
|
||||||
<source>Noise</source>
|
<source>Noise</source>
|
||||||
<translation>Bruit</translation>
|
<translation>Bruit</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../gui_qt/formterrain.cpp" line="147"/>
|
<location filename="../gui_qt/formterrain.cpp" line="149"/>
|
||||||
<source>Height</source>
|
<source>Height</source>
|
||||||
<translation>Hauteur</translation>
|
<translation>Hauteur</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../gui_qt/formterrain.cpp" line="148"/>
|
<location filename="../gui_qt/formterrain.cpp" line="150"/>
|
||||||
<source>Scaling</source>
|
<source>Scaling</source>
|
||||||
<translation>Echelle</translation>
|
<translation>Echelle</translation>
|
||||||
</message>
|
</message>
|
||||||
|
@ -486,7 +486,7 @@ Maintenir Ctrl : Plus rapide</translation>
|
||||||
<context>
|
<context>
|
||||||
<name>FormTextures</name>
|
<name>FormTextures</name>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../gui_qt/formtextures.cpp" line="132"/>
|
<location filename="../gui_qt/formtextures.cpp" line="134"/>
|
||||||
<source>Coverage preview</source>
|
<source>Coverage preview</source>
|
||||||
<translation>Aperçu de la couverture</translation>
|
<translation>Aperçu de la couverture</translation>
|
||||||
</message>
|
</message>
|
||||||
|
@ -495,77 +495,77 @@ Maintenir Ctrl : Plus rapide</translation>
|
||||||
<translation type="obsolete">Rendu en couleur</translation>
|
<translation type="obsolete">Rendu en couleur</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../gui_qt/formtextures.cpp" line="133"/>
|
<location filename="../gui_qt/formtextures.cpp" line="135"/>
|
||||||
<source>Lighted sample</source>
|
<source>Lighted sample</source>
|
||||||
<translation>Echantillon éclairé</translation>
|
<translation>Echantillon éclairé</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../gui_qt/formtextures.cpp" line="135"/>
|
<location filename="../gui_qt/formtextures.cpp" line="137"/>
|
||||||
<source>Surface noise</source>
|
<source>Surface noise</source>
|
||||||
<translation>Bruit de surface</translation>
|
<translation>Bruit de surface</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../gui_qt/formtextures.cpp" line="136"/>
|
<location filename="../gui_qt/formtextures.cpp" line="138"/>
|
||||||
<source>Surface noise height</source>
|
<source>Surface noise height</source>
|
||||||
<translation>Hauteur du bruit</translation>
|
<translation>Hauteur du bruit</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../gui_qt/formtextures.cpp" line="137"/>
|
<location filename="../gui_qt/formtextures.cpp" line="139"/>
|
||||||
<source>Surface noise scaling</source>
|
<source>Surface noise scaling</source>
|
||||||
<translation>Echelle du bruit</translation>
|
<translation>Echelle du bruit</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../gui_qt/formtextures.cpp" line="138"/>
|
<location filename="../gui_qt/formtextures.cpp" line="140"/>
|
||||||
<source>Base color</source>
|
<source>Base color</source>
|
||||||
<translation>Couleur de base</translation>
|
<translation>Couleur de base</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../gui_qt/formtextures.cpp" line="139"/>
|
<location filename="../gui_qt/formtextures.cpp" line="141"/>
|
||||||
<source>Light reflection</source>
|
<source>Light reflection</source>
|
||||||
<translation>Réflexion de lumière</translation>
|
<translation>Réflexion de lumière</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../gui_qt/formtextures.cpp" line="140"/>
|
<location filename="../gui_qt/formtextures.cpp" line="142"/>
|
||||||
<source>Light reflection shininess</source>
|
<source>Light reflection shininess</source>
|
||||||
<translation>Concentration de la lumière réfléchie</translation>
|
<translation>Concentration de la lumière réfléchie</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../gui_qt/formtextures.cpp" line="143"/>
|
<location filename="../gui_qt/formtextures.cpp" line="145"/>
|
||||||
<source>Soft minimal height</source>
|
<source>Soft minimal height</source>
|
||||||
<translation>Altitude minimal (adoucie)</translation>
|
<translation>Altitude minimal (adoucie)</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../gui_qt/formtextures.cpp" line="142"/>
|
<location filename="../gui_qt/formtextures.cpp" line="144"/>
|
||||||
<source>Hard minimal height</source>
|
<source>Hard minimal height</source>
|
||||||
<translation>Altitude minimale</translation>
|
<translation>Altitude minimale</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../gui_qt/formtextures.cpp" line="145"/>
|
<location filename="../gui_qt/formtextures.cpp" line="147"/>
|
||||||
<source>Hard maximal height</source>
|
<source>Hard maximal height</source>
|
||||||
<translation>Altitude maximale</translation>
|
<translation>Altitude maximale</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../gui_qt/formtextures.cpp" line="144"/>
|
<location filename="../gui_qt/formtextures.cpp" line="146"/>
|
||||||
<source>Soft maximal height</source>
|
<source>Soft maximal height</source>
|
||||||
<translation>Altitude maximale (adoucie)</translation>
|
<translation>Altitude maximale (adoucie)</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../gui_qt/formtextures.cpp" line="147"/>
|
<location filename="../gui_qt/formtextures.cpp" line="149"/>
|
||||||
<source>Soft minimal slope</source>
|
<source>Soft minimal slope</source>
|
||||||
<translation>Pente minimale (adoucie)</translation>
|
<translation>Pente minimale (adoucie)</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../gui_qt/formtextures.cpp" line="146"/>
|
<location filename="../gui_qt/formtextures.cpp" line="148"/>
|
||||||
<source>Hard minimal slope</source>
|
<source>Hard minimal slope</source>
|
||||||
<translation>Pente minimale</translation>
|
<translation>Pente minimale</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../gui_qt/formtextures.cpp" line="149"/>
|
<location filename="../gui_qt/formtextures.cpp" line="151"/>
|
||||||
<source>Hard maximal slope</source>
|
<source>Hard maximal slope</source>
|
||||||
<translation>Pente maximale</translation>
|
<translation>Pente maximale</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../gui_qt/formtextures.cpp" line="148"/>
|
<location filename="../gui_qt/formtextures.cpp" line="150"/>
|
||||||
<source>Soft maximal slope</source>
|
<source>Soft maximal slope</source>
|
||||||
<translation>Pente maximale (adoucie)</translation>
|
<translation>Pente maximale (adoucie)</translation>
|
||||||
</message>
|
</message>
|
||||||
|
@ -573,72 +573,72 @@ Maintenir Ctrl : Plus rapide</translation>
|
||||||
<context>
|
<context>
|
||||||
<name>FormWater</name>
|
<name>FormWater</name>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../gui_qt/formwater.cpp" line="177"/>
|
<location filename="../gui_qt/formwater.cpp" line="178"/>
|
||||||
<source>Coverage preview</source>
|
<source>Coverage preview</source>
|
||||||
<translation>Aperçu de la couverture</translation>
|
<translation>Aperçu de la couverture</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../gui_qt/formwater.cpp" line="178"/>
|
<location filename="../gui_qt/formwater.cpp" line="179"/>
|
||||||
<source>Rendered preview (without/with lighting)</source>
|
<source>Rendered preview (without/with lighting)</source>
|
||||||
<translation>Aperçu du rendu (sans/avec éclairage)</translation>
|
<translation>Aperçu du rendu (sans/avec éclairage)</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../gui_qt/formwater.cpp" line="180"/>
|
<location filename="../gui_qt/formwater.cpp" line="181"/>
|
||||||
<source>Height</source>
|
<source>Height</source>
|
||||||
<translation>Hauteur</translation>
|
<translation>Hauteur</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../gui_qt/formwater.cpp" line="181"/>
|
<location filename="../gui_qt/formwater.cpp" line="182"/>
|
||||||
<source>Surface color</source>
|
<source>Surface color</source>
|
||||||
<translation>Couleur de la surface</translation>
|
<translation>Couleur de la surface</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../gui_qt/formwater.cpp" line="182"/>
|
<location filename="../gui_qt/formwater.cpp" line="183"/>
|
||||||
<source>Light reflection</source>
|
<source>Light reflection</source>
|
||||||
<translation>Réflection de la lumière</translation>
|
<translation>Réflection de la lumière</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../gui_qt/formwater.cpp" line="183"/>
|
<location filename="../gui_qt/formwater.cpp" line="184"/>
|
||||||
<source>Shininess to light</source>
|
<source>Shininess to light</source>
|
||||||
<translation>Concentration de la lumière réfléchie</translation>
|
<translation>Concentration de la lumière réfléchie</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../gui_qt/formwater.cpp" line="184"/>
|
<location filename="../gui_qt/formwater.cpp" line="185"/>
|
||||||
<source>Transparency</source>
|
<source>Transparency</source>
|
||||||
<translation>Transparence</translation>
|
<translation>Transparence</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../gui_qt/formwater.cpp" line="185"/>
|
<location filename="../gui_qt/formwater.cpp" line="186"/>
|
||||||
<source>Reflection</source>
|
<source>Reflection</source>
|
||||||
<translation>Reflets</translation>
|
<translation>Reflets</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../gui_qt/formwater.cpp" line="186"/>
|
<location filename="../gui_qt/formwater.cpp" line="187"/>
|
||||||
<source>Transparency distance</source>
|
<source>Transparency distance</source>
|
||||||
<translation>Distance maximale de transparence</translation>
|
<translation>Distance maximale de transparence</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../gui_qt/formwater.cpp" line="187"/>
|
<location filename="../gui_qt/formwater.cpp" line="188"/>
|
||||||
<source>Depth color</source>
|
<source>Depth color</source>
|
||||||
<translation>Couleur en profondeur</translation>
|
<translation>Couleur en profondeur</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../gui_qt/formwater.cpp" line="188"/>
|
<location filename="../gui_qt/formwater.cpp" line="189"/>
|
||||||
<source>Light-through distance</source>
|
<source>Light-through distance</source>
|
||||||
<translation>Distance de filtrage de la lumière</translation>
|
<translation>Distance de filtrage de la lumière</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../gui_qt/formwater.cpp" line="189"/>
|
<location filename="../gui_qt/formwater.cpp" line="190"/>
|
||||||
<source>Waves noise</source>
|
<source>Waves noise</source>
|
||||||
<translation>Bruit des vagues</translation>
|
<translation>Bruit des vagues</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../gui_qt/formwater.cpp" line="190"/>
|
<location filename="../gui_qt/formwater.cpp" line="191"/>
|
||||||
<source>Waves height</source>
|
<source>Waves height</source>
|
||||||
<translation>Hauteur des vagues</translation>
|
<translation>Hauteur des vagues</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../gui_qt/formwater.cpp" line="191"/>
|
<location filename="../gui_qt/formwater.cpp" line="192"/>
|
||||||
<source>Waves scaling</source>
|
<source>Waves scaling</source>
|
||||||
<translation>Echelle des vagues</translation>
|
<translation>Echelle des vagues</translation>
|
||||||
</message>
|
</message>
|
||||||
|
|
Loading…
Reference in a new issue