2012-06-08 12:54:57 +00:00
|
|
|
#include "dialogexplorer.h"
|
2012-01-26 23:08:09 +00:00
|
|
|
|
2012-01-27 23:01:21 +00:00
|
|
|
#include <QWidget>
|
|
|
|
#include <QPushButton>
|
2012-01-26 23:08:09 +00:00
|
|
|
#include <QVBoxLayout>
|
2012-04-02 19:48:46 +00:00
|
|
|
#include <QLabel>
|
2012-01-26 23:08:09 +00:00
|
|
|
|
2012-06-08 12:54:57 +00:00
|
|
|
DialogExplorer::DialogExplorer(QWidget* parent, CameraDefinition* camera, bool camera_validable) : QDialog(parent)
|
2012-01-26 23:08:09 +00:00
|
|
|
{
|
2012-01-27 23:01:21 +00:00
|
|
|
QWidget* panel;
|
|
|
|
QPushButton* button;
|
|
|
|
|
2012-01-26 23:08:09 +00:00
|
|
|
setModal(true);
|
2012-02-28 13:45:11 +00:00
|
|
|
setWindowTitle(tr("Paysages 3D - Explore"));
|
2012-01-27 23:01:21 +00:00
|
|
|
setLayout(new QHBoxLayout());
|
|
|
|
|
2012-06-08 12:54:57 +00:00
|
|
|
_wanderer = new WidgetExplorer(this, camera);
|
2012-01-27 23:01:21 +00:00
|
|
|
layout()->addWidget(_wanderer);
|
|
|
|
|
|
|
|
panel = new QWidget(this);
|
|
|
|
panel->setLayout(new QVBoxLayout());
|
2012-03-31 11:32:03 +00:00
|
|
|
panel->setMaximumWidth(230);
|
2013-01-31 14:02:17 +00:00
|
|
|
|
2012-04-22 17:12:39 +00:00
|
|
|
panel->layout()->addWidget(new QLabel(tr("COMMANDS\n\nLeft click : Look around\nRight click : Pan (adjust framing)\nWheel : Move forward/backward\nHold SHIFT : Faster\nHold CTRL : Slower"), panel));
|
2012-01-27 23:01:21 +00:00
|
|
|
|
2012-02-28 13:45:11 +00:00
|
|
|
button = new QPushButton(tr("Reset camera"), panel);
|
2012-01-27 23:01:21 +00:00
|
|
|
panel->layout()->addWidget(button);
|
|
|
|
QObject::connect(button, SIGNAL(clicked()), _wanderer, SLOT(resetCamera()));
|
|
|
|
|
|
|
|
if (camera_validable)
|
|
|
|
{
|
2012-02-28 13:45:11 +00:00
|
|
|
button = new QPushButton(tr("Validate as render camera"), panel);
|
2012-01-27 23:01:21 +00:00
|
|
|
panel->layout()->addWidget(button);
|
|
|
|
QObject::connect(button, SIGNAL(clicked()), this, SLOT(validateCamera()));
|
|
|
|
}
|
2012-01-27 14:47:08 +00:00
|
|
|
|
2012-02-28 13:45:11 +00:00
|
|
|
button = new QPushButton(tr("Close"), panel);
|
2012-01-27 23:01:21 +00:00
|
|
|
panel->layout()->addWidget(button);
|
|
|
|
QObject::connect(button, SIGNAL(clicked()), this, SLOT(reject()));
|
2012-01-27 17:21:57 +00:00
|
|
|
|
2012-01-27 23:01:21 +00:00
|
|
|
layout()->addWidget(panel);
|
|
|
|
|
|
|
|
resize(900, 600);
|
2012-01-26 23:08:09 +00:00
|
|
|
}
|
|
|
|
|
2012-06-08 12:54:57 +00:00
|
|
|
DialogExplorer::~DialogExplorer()
|
2012-01-26 23:08:09 +00:00
|
|
|
{
|
|
|
|
}
|
2012-01-27 14:47:08 +00:00
|
|
|
|
2012-06-08 12:54:57 +00:00
|
|
|
void DialogExplorer::validateCamera()
|
2012-01-27 23:01:21 +00:00
|
|
|
{
|
|
|
|
_wanderer->validateCamera();
|
2012-04-12 20:20:57 +00:00
|
|
|
accept();
|
2012-01-27 23:01:21 +00:00
|
|
|
}
|
|
|
|
|