paysages : Renaming wanderer->explorer
git-svn-id: https://subversion.assembla.com/svn/thunderk/paysages@340 b1fd45b6-86a6-48da-8261-f70d1f35bdcc
This commit is contained in:
parent
f270c6aad0
commit
a3aa859f0c
8 changed files with 59 additions and 60 deletions
|
@ -1,12 +1,11 @@
|
||||||
#include "dialogwanderer.h"
|
#include "dialogexplorer.h"
|
||||||
|
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
#include <QPushButton>
|
#include <QPushButton>
|
||||||
#include <QVBoxLayout>
|
#include <QVBoxLayout>
|
||||||
#include <QLabel>
|
#include <QLabel>
|
||||||
#include "widgetwanderer.h"
|
|
||||||
|
|
||||||
DialogWanderer::DialogWanderer(QWidget* parent, CameraDefinition* camera, bool camera_validable) : QDialog(parent)
|
DialogExplorer::DialogExplorer(QWidget* parent, CameraDefinition* camera, bool camera_validable) : QDialog(parent)
|
||||||
{
|
{
|
||||||
QWidget* panel;
|
QWidget* panel;
|
||||||
QPushButton* button;
|
QPushButton* button;
|
||||||
|
@ -15,7 +14,7 @@ DialogWanderer::DialogWanderer(QWidget* parent, CameraDefinition* camera, bool c
|
||||||
setWindowTitle(tr("Paysages 3D - Explore"));
|
setWindowTitle(tr("Paysages 3D - Explore"));
|
||||||
setLayout(new QHBoxLayout());
|
setLayout(new QHBoxLayout());
|
||||||
|
|
||||||
_wanderer = new WidgetWanderer(this, camera);
|
_wanderer = new WidgetExplorer(this, camera);
|
||||||
layout()->addWidget(_wanderer);
|
layout()->addWidget(_wanderer);
|
||||||
|
|
||||||
panel = new QWidget(this);
|
panel = new QWidget(this);
|
||||||
|
@ -44,11 +43,11 @@ DialogWanderer::DialogWanderer(QWidget* parent, CameraDefinition* camera, bool c
|
||||||
resize(900, 600);
|
resize(900, 600);
|
||||||
}
|
}
|
||||||
|
|
||||||
DialogWanderer::~DialogWanderer()
|
DialogExplorer::~DialogExplorer()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void DialogWanderer::validateCamera()
|
void DialogExplorer::validateCamera()
|
||||||
{
|
{
|
||||||
_wanderer->validateCamera();
|
_wanderer->validateCamera();
|
||||||
accept();
|
accept();
|
22
gui_qt/dialogexplorer.h
Normal file
22
gui_qt/dialogexplorer.h
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
#ifndef _PAYSAGES_QT_DIALOGEXPLORER_H_
|
||||||
|
#define _PAYSAGES_QT_DIALOGEXPLORER_H_
|
||||||
|
|
||||||
|
#include <QDialog>
|
||||||
|
#include "widgetexplorer.h"
|
||||||
|
#include "../lib_paysages/camera.h"
|
||||||
|
|
||||||
|
class DialogExplorer : public QDialog
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
public:
|
||||||
|
explicit DialogExplorer(QWidget *parent, CameraDefinition* camera, bool camera_validable);
|
||||||
|
~DialogExplorer();
|
||||||
|
|
||||||
|
protected slots:
|
||||||
|
void validateCamera();
|
||||||
|
|
||||||
|
private:
|
||||||
|
WidgetExplorer* _wanderer;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
|
@ -1,22 +0,0 @@
|
||||||
#ifndef _PAYSAGES_QT_DIALOGWANDERER_H_
|
|
||||||
#define _PAYSAGES_QT_DIALOGWANDERER_H_
|
|
||||||
|
|
||||||
#include <QDialog>
|
|
||||||
#include "widgetwanderer.h"
|
|
||||||
#include "../lib_paysages/camera.h"
|
|
||||||
|
|
||||||
class DialogWanderer : public QDialog
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
public:
|
|
||||||
explicit DialogWanderer(QWidget *parent, CameraDefinition* camera, bool camera_validable);
|
|
||||||
~DialogWanderer();
|
|
||||||
|
|
||||||
protected slots:
|
|
||||||
void validateCamera();
|
|
||||||
|
|
||||||
private:
|
|
||||||
WidgetWanderer* _wanderer;
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif
|
|
|
@ -5,7 +5,7 @@
|
||||||
#include <QPainter>
|
#include <QPainter>
|
||||||
#include <QColorDialog>
|
#include <QColorDialog>
|
||||||
|
|
||||||
#include "dialogwanderer.h"
|
#include "dialogexplorer.h"
|
||||||
|
|
||||||
InputCamera::InputCamera(QWidget* form, QString label, CameraDefinition* value):BaseInput(form, label)
|
InputCamera::InputCamera(QWidget* form, QString label, CameraDefinition* value):BaseInput(form, label)
|
||||||
{
|
{
|
||||||
|
@ -40,7 +40,7 @@ void InputCamera::editCamera()
|
||||||
{
|
{
|
||||||
int result;
|
int result;
|
||||||
|
|
||||||
DialogWanderer* dialog = new DialogWanderer(_control, _value, true);
|
DialogExplorer* dialog = new DialogExplorer(_control, _value, true);
|
||||||
result = dialog->exec();
|
result = dialog->exec();
|
||||||
|
|
||||||
delete dialog;
|
delete dialog;
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
#include "formrender.h"
|
#include "formrender.h"
|
||||||
|
|
||||||
#include "dialogrender.h"
|
#include "dialogrender.h"
|
||||||
#include "dialogwanderer.h"
|
#include "dialogexplorer.h"
|
||||||
|
|
||||||
#include "../lib_paysages/main.h"
|
#include "../lib_paysages/main.h"
|
||||||
#include "../lib_paysages/auto.h"
|
#include "../lib_paysages/auto.h"
|
||||||
|
@ -230,7 +230,7 @@ void MainWindow::explore3D()
|
||||||
|
|
||||||
sceneryGetCamera(&camera);
|
sceneryGetCamera(&camera);
|
||||||
|
|
||||||
DialogWanderer* dialog = new DialogWanderer(this, &camera, true);
|
DialogExplorer* dialog = new DialogExplorer(this, &camera, true);
|
||||||
result = dialog->exec();
|
result = dialog->exec();
|
||||||
|
|
||||||
delete dialog;
|
delete dialog;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#include "widgetwanderer.h"
|
#include "widgetexplorer.h"
|
||||||
|
|
||||||
#include <QGLWidget>
|
#include <QGLWidget>
|
||||||
#include <QKeyEvent>
|
#include <QKeyEvent>
|
||||||
|
@ -13,7 +13,7 @@
|
||||||
class ChunkMaintenanceThread:public QThread
|
class ChunkMaintenanceThread:public QThread
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ChunkMaintenanceThread(WidgetWanderer* wanderer)
|
ChunkMaintenanceThread(WidgetExplorer* wanderer)
|
||||||
{
|
{
|
||||||
_wanderer = wanderer;
|
_wanderer = wanderer;
|
||||||
_running = true;
|
_running = true;
|
||||||
|
@ -41,7 +41,7 @@ protected:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool _running;
|
bool _running;
|
||||||
WidgetWanderer* _wanderer;
|
WidgetExplorer* _wanderer;
|
||||||
};
|
};
|
||||||
|
|
||||||
static QVector<ChunkMaintenanceThread*> _threads;
|
static QVector<ChunkMaintenanceThread*> _threads;
|
||||||
|
@ -66,7 +66,7 @@ static void _getLightStatus(Renderer* renderer, LightStatus* status, Vector3 loc
|
||||||
lightingGetStatus((LightingDefinition*)renderer->customData[2], renderer, location, status);
|
lightingGetStatus((LightingDefinition*)renderer->customData[2], renderer, location, status);
|
||||||
}
|
}
|
||||||
|
|
||||||
WidgetWanderer::WidgetWanderer(QWidget *parent, CameraDefinition* camera):
|
WidgetExplorer::WidgetExplorer(QWidget *parent, CameraDefinition* camera):
|
||||||
QGLWidget(parent)
|
QGLWidget(parent)
|
||||||
{
|
{
|
||||||
setMinimumSize(400, 300);
|
setMinimumSize(400, 300);
|
||||||
|
@ -122,7 +122,7 @@ WidgetWanderer::WidgetWanderer(QWidget *parent, CameraDefinition* camera):
|
||||||
_last_mouse_y = 0;
|
_last_mouse_y = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WidgetWanderer::~WidgetWanderer()
|
WidgetExplorer::~WidgetExplorer()
|
||||||
{
|
{
|
||||||
stopThreads();
|
stopThreads();
|
||||||
|
|
||||||
|
@ -133,7 +133,7 @@ WidgetWanderer::~WidgetWanderer()
|
||||||
waterDeleteDefinition(&_water);
|
waterDeleteDefinition(&_water);
|
||||||
}
|
}
|
||||||
|
|
||||||
void WidgetWanderer::startThreads()
|
void WidgetExplorer::startThreads()
|
||||||
{
|
{
|
||||||
int nbcore;
|
int nbcore;
|
||||||
|
|
||||||
|
@ -155,7 +155,7 @@ void WidgetWanderer::startThreads()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void WidgetWanderer::stopThreads()
|
void WidgetExplorer::stopThreads()
|
||||||
{
|
{
|
||||||
for (int i = 0; i < _threads.count(); i++)
|
for (int i = 0; i < _threads.count(); i++)
|
||||||
{
|
{
|
||||||
|
@ -173,7 +173,7 @@ bool _cmpChunks(const BaseExplorerChunk* c1, const BaseExplorerChunk* c2)
|
||||||
return c1->priority > c2->priority;
|
return c1->priority > c2->priority;
|
||||||
}
|
}
|
||||||
|
|
||||||
void WidgetWanderer::performChunksMaintenance()
|
void WidgetExplorer::performChunksMaintenance()
|
||||||
{
|
{
|
||||||
BaseExplorerChunk* chunk;
|
BaseExplorerChunk* chunk;
|
||||||
|
|
||||||
|
@ -204,18 +204,18 @@ void WidgetWanderer::performChunksMaintenance()
|
||||||
_lock_chunks.unlock();
|
_lock_chunks.unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
void WidgetWanderer::resetCamera()
|
void WidgetExplorer::resetCamera()
|
||||||
{
|
{
|
||||||
cameraCopyDefinition(_base_camera, &_current_camera);
|
cameraCopyDefinition(_base_camera, &_current_camera);
|
||||||
updateGL();
|
updateGL();
|
||||||
}
|
}
|
||||||
|
|
||||||
void WidgetWanderer::validateCamera()
|
void WidgetExplorer::validateCamera()
|
||||||
{
|
{
|
||||||
cameraCopyDefinition(&_current_camera, _base_camera);
|
cameraCopyDefinition(&_current_camera, _base_camera);
|
||||||
}
|
}
|
||||||
|
|
||||||
void WidgetWanderer::keyPressEvent(QKeyEvent* event)
|
void WidgetExplorer::keyPressEvent(QKeyEvent* event)
|
||||||
{
|
{
|
||||||
double factor;
|
double factor;
|
||||||
|
|
||||||
|
@ -269,7 +269,7 @@ void WidgetWanderer::keyPressEvent(QKeyEvent* event)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void WidgetWanderer::mousePressEvent(QMouseEvent* event)
|
void WidgetExplorer::mousePressEvent(QMouseEvent* event)
|
||||||
{
|
{
|
||||||
_last_mouse_x = event->x();
|
_last_mouse_x = event->x();
|
||||||
_last_mouse_y = event->y();
|
_last_mouse_y = event->y();
|
||||||
|
@ -277,7 +277,7 @@ void WidgetWanderer::mousePressEvent(QMouseEvent* event)
|
||||||
event->ignore();
|
event->ignore();
|
||||||
}
|
}
|
||||||
|
|
||||||
void WidgetWanderer::mouseMoveEvent(QMouseEvent* event)
|
void WidgetExplorer::mouseMoveEvent(QMouseEvent* event)
|
||||||
{
|
{
|
||||||
double factor;
|
double factor;
|
||||||
|
|
||||||
|
@ -318,7 +318,7 @@ void WidgetWanderer::mouseMoveEvent(QMouseEvent* event)
|
||||||
_last_mouse_y = event->y();
|
_last_mouse_y = event->y();
|
||||||
}
|
}
|
||||||
|
|
||||||
void WidgetWanderer::wheelEvent(QWheelEvent* event)
|
void WidgetExplorer::wheelEvent(QWheelEvent* event)
|
||||||
{
|
{
|
||||||
double factor;
|
double factor;
|
||||||
|
|
||||||
|
@ -345,7 +345,7 @@ void WidgetWanderer::wheelEvent(QWheelEvent* event)
|
||||||
event->accept();
|
event->accept();
|
||||||
}
|
}
|
||||||
|
|
||||||
void WidgetWanderer::timerEvent(QTimerEvent *event)
|
void WidgetExplorer::timerEvent(QTimerEvent *event)
|
||||||
{
|
{
|
||||||
if (_updated)
|
if (_updated)
|
||||||
{
|
{
|
||||||
|
@ -362,7 +362,7 @@ void WidgetWanderer::timerEvent(QTimerEvent *event)
|
||||||
_lock_chunks.unlock();
|
_lock_chunks.unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
void WidgetWanderer::initializeGL()
|
void WidgetExplorer::initializeGL()
|
||||||
{
|
{
|
||||||
glClearColor(0.0, 0.0, 0.0, 0.0);
|
glClearColor(0.0, 0.0, 0.0, 0.0);
|
||||||
|
|
||||||
|
@ -385,7 +385,7 @@ void WidgetWanderer::initializeGL()
|
||||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||||
}
|
}
|
||||||
|
|
||||||
void WidgetWanderer::resizeGL(int w, int h)
|
void WidgetExplorer::resizeGL(int w, int h)
|
||||||
{
|
{
|
||||||
cameraSetRenderSize(&_current_camera, w, h);
|
cameraSetRenderSize(&_current_camera, w, h);
|
||||||
|
|
||||||
|
@ -398,7 +398,7 @@ void WidgetWanderer::resizeGL(int w, int h)
|
||||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||||
}
|
}
|
||||||
|
|
||||||
void WidgetWanderer::paintGL()
|
void WidgetExplorer::paintGL()
|
||||||
{
|
{
|
||||||
QTime start_time;
|
QTime start_time;
|
||||||
double frame_time;
|
double frame_time;
|
|
@ -1,5 +1,5 @@
|
||||||
#ifndef _PAYSAGES_QT_WIDGETWANDERER_H_
|
#ifndef _PAYSAGES_QT_WIDGETEXPLORER_H_
|
||||||
#define _PAYSAGES_QT_WIDGETWANDERER_H_
|
#define _PAYSAGES_QT_WIDGETEXPLORER_H_
|
||||||
|
|
||||||
#include <QGLWidget>
|
#include <QGLWidget>
|
||||||
#include "baseexplorerchunk.h"
|
#include "baseexplorerchunk.h"
|
||||||
|
@ -11,12 +11,12 @@
|
||||||
#include "../lib_paysages/textures.h"
|
#include "../lib_paysages/textures.h"
|
||||||
#include "../lib_paysages/lighting.h"
|
#include "../lib_paysages/lighting.h"
|
||||||
|
|
||||||
class WidgetWanderer : public QGLWidget
|
class WidgetExplorer : public QGLWidget
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
WidgetWanderer(QWidget* parent, CameraDefinition* camera);
|
WidgetExplorer(QWidget* parent, CameraDefinition* camera);
|
||||||
~WidgetWanderer();
|
~WidgetExplorer();
|
||||||
|
|
||||||
void performChunksMaintenance();
|
void performChunksMaintenance();
|
||||||
|
|
|
@ -218,12 +218,12 @@ Right click on a point to delete it.</source>
|
||||||
<context>
|
<context>
|
||||||
<name>DialogWanderer</name>
|
<name>DialogWanderer</name>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../gui_qt/dialogwanderer.cpp" line="15"/>
|
<location filename="../gui_qt/dialogexplorer.cpp" line="14"/>
|
||||||
<source>Paysages 3D - Explore</source>
|
<source>Paysages 3D - Explore</source>
|
||||||
<translation>Paysages 3D - Exploration</translation>
|
<translation>Paysages 3D - Exploration</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../gui_qt/dialogwanderer.cpp" line="25"/>
|
<location filename="../gui_qt/dialogexplorer.cpp" line="24"/>
|
||||||
<source>COMMANDS
|
<source>COMMANDS
|
||||||
|
|
||||||
Left click : Look around
|
Left click : Look around
|
||||||
|
@ -256,17 +256,17 @@ Maintenir MAJ : Plus lent
|
||||||
Maintenir Ctrl : Plus rapide</translation>
|
Maintenir Ctrl : Plus rapide</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../gui_qt/dialogwanderer.cpp" line="27"/>
|
<location filename="../gui_qt/dialogexplorer.cpp" line="26"/>
|
||||||
<source>Reset camera</source>
|
<source>Reset camera</source>
|
||||||
<translation>Revenir au point de vue initial</translation>
|
<translation>Revenir au point de vue initial</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../gui_qt/dialogwanderer.cpp" line="33"/>
|
<location filename="../gui_qt/dialogexplorer.cpp" line="32"/>
|
||||||
<source>Validate as render camera</source>
|
<source>Validate as render camera</source>
|
||||||
<translation>Choisir comme caméra de rendu</translation>
|
<translation>Choisir comme caméra de rendu</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../gui_qt/dialogwanderer.cpp" line="38"/>
|
<location filename="../gui_qt/dialogexplorer.cpp" line="37"/>
|
||||||
<source>Close</source>
|
<source>Close</source>
|
||||||
<translation>Fermer</translation>
|
<translation>Fermer</translation>
|
||||||
</message>
|
</message>
|
||||||
|
|
Loading…
Reference in a new issue