2013-09-28 07:25:54 +00:00
|
|
|
|
|
|
|
#include "scenesubview.hpp"
|
|
|
|
|
2014-04-01 08:04:14 +00:00
|
|
|
#include <sstream>
|
|
|
|
|
2013-09-28 07:25:54 +00:00
|
|
|
#include <QVBoxLayout>
|
|
|
|
#include <QHBoxLayout>
|
|
|
|
#include <QLabel>
|
|
|
|
|
|
|
|
#include "../../model/doc/document.hpp"
|
|
|
|
|
|
|
|
#include "../filter/filterbox.hpp"
|
|
|
|
|
2014-03-06 09:13:39 +00:00
|
|
|
#include "../render/pagedworldspacewidget.hpp"
|
|
|
|
#include "../render/unpagedworldspacewidget.hpp"
|
2013-11-02 01:48:30 +00:00
|
|
|
|
2013-09-28 07:25:54 +00:00
|
|
|
#include "tablebottombox.hpp"
|
|
|
|
#include "creator.hpp"
|
|
|
|
#include "scenetoolbar.hpp"
|
2013-09-28 09:27:24 +00:00
|
|
|
#include "scenetoolmode.hpp"
|
2013-09-28 07:25:54 +00:00
|
|
|
|
|
|
|
CSVWorld::SceneSubView::SceneSubView (const CSMWorld::UniversalId& id, CSMDoc::Document& document)
|
|
|
|
: SubView (id)
|
|
|
|
{
|
|
|
|
QVBoxLayout *layout = new QVBoxLayout;
|
|
|
|
|
|
|
|
layout->setContentsMargins (QMargins (0, 0, 0, 0));
|
|
|
|
|
|
|
|
layout->addWidget (mBottom =
|
|
|
|
new TableBottomBox (NullCreatorFactory(), document.getData(), document.getUndoStack(), id,
|
|
|
|
this), 0);
|
|
|
|
|
|
|
|
QHBoxLayout *layout2 = new QHBoxLayout;
|
|
|
|
|
|
|
|
layout2->setContentsMargins (QMargins (0, 0, 0, 0));
|
|
|
|
|
2014-04-05 11:16:13 +00:00
|
|
|
SceneToolbar *toolbar = new SceneToolbar (48+6, this);
|
2014-02-25 13:59:46 +00:00
|
|
|
|
2014-03-10 11:44:34 +00:00
|
|
|
if (id.getId()=="sys::default")
|
2014-04-01 08:04:14 +00:00
|
|
|
{
|
|
|
|
CSVRender::PagedWorldspaceWidget *widget = new CSVRender::PagedWorldspaceWidget (this);
|
|
|
|
mScene = widget;
|
|
|
|
connect (widget,
|
|
|
|
SIGNAL (cellIndexChanged (const std::pair<int, int>&, const std::pair<int, int>&)),
|
|
|
|
this,
|
|
|
|
SLOT (cellIndexChanged (const std::pair<int, int>&, const std::pair<int, int>&)));
|
|
|
|
}
|
2014-03-06 09:13:39 +00:00
|
|
|
else
|
2014-03-06 12:02:21 +00:00
|
|
|
mScene = new CSVRender::UnpagedWorldspaceWidget (id.getId(), document, this);
|
2014-03-06 09:01:23 +00:00
|
|
|
|
2014-03-23 14:14:26 +00:00
|
|
|
SceneToolMode *navigationTool = mScene->makeNavigationSelector (toolbar);
|
|
|
|
toolbar->addTool (navigationTool);
|
|
|
|
|
|
|
|
SceneToolMode *lightingTool = mScene->makeLightingSelector (toolbar);
|
|
|
|
toolbar->addTool (lightingTool);
|
2014-02-25 13:59:46 +00:00
|
|
|
|
2013-09-28 07:25:54 +00:00
|
|
|
layout2->addWidget (toolbar, 0);
|
|
|
|
|
2014-02-25 13:59:46 +00:00
|
|
|
layout2->addWidget (mScene, 1);
|
2013-09-28 07:25:54 +00:00
|
|
|
|
|
|
|
layout->insertLayout (0, layout2, 1);
|
|
|
|
|
|
|
|
CSVFilter::FilterBox *filterBox = new CSVFilter::FilterBox (document.getData(), this);
|
|
|
|
|
|
|
|
layout->insertWidget (0, filterBox);
|
|
|
|
|
|
|
|
QWidget *widget = new QWidget;
|
|
|
|
|
|
|
|
widget->setLayout (layout);
|
|
|
|
|
|
|
|
setWidget (widget);
|
2014-02-27 14:23:14 +00:00
|
|
|
|
2014-03-06 09:01:23 +00:00
|
|
|
mScene->selectDefaultNavigationMode();
|
2014-03-06 15:40:08 +00:00
|
|
|
|
|
|
|
connect (mScene, SIGNAL (closeRequest()), this, SLOT (closeRequest()));
|
2013-09-28 07:25:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void CSVWorld::SceneSubView::setEditLock (bool locked)
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
void CSVWorld::SceneSubView::updateEditorSetting(const QString &settingName, const QString &settingValue)
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
void CSVWorld::SceneSubView::setStatusBar (bool show)
|
|
|
|
{
|
|
|
|
mBottom->setStatusBar (show);
|
2013-11-02 01:48:30 +00:00
|
|
|
}
|
2014-03-06 15:40:08 +00:00
|
|
|
|
2014-04-01 08:04:14 +00:00
|
|
|
void CSVWorld::SceneSubView::useHint (const std::string& hint)
|
|
|
|
{
|
|
|
|
mScene->useViewHint (hint);
|
|
|
|
}
|
|
|
|
|
2014-03-06 15:40:08 +00:00
|
|
|
void CSVWorld::SceneSubView::closeRequest()
|
|
|
|
{
|
|
|
|
deleteLater();
|
2014-04-01 08:04:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void CSVWorld::SceneSubView::cellIndexChanged (const std::pair<int, int>& min,
|
|
|
|
const std::pair<int, int>& max)
|
|
|
|
{
|
|
|
|
std::ostringstream stream;
|
|
|
|
stream << "Scene: " << getUniversalId().getId() << " (" << min.first << ", " << min.second;
|
|
|
|
|
|
|
|
if (min!=max)
|
|
|
|
stream << " to " << max.first << ", " << max.second;
|
|
|
|
|
|
|
|
stream << ")";
|
|
|
|
|
|
|
|
setWindowTitle (QString::fromUtf8 (stream.str().c_str()));
|
2014-03-06 15:40:08 +00:00
|
|
|
}
|