mirror of
https://github.com/rwengine/openrw.git
synced 2024-11-07 19:32:49 +01:00
0f4152d099
* ViewerWidget now highlights selected non-model frames
46 lines
1022 B
C++
46 lines
1022 B
C++
#include "ModelViewer.hpp"
|
|
#include <widgets/ModelFramesWidget.hpp>
|
|
#include "ViewerWidget.hpp"
|
|
#include <QDebug>
|
|
|
|
ModelViewer::ModelViewer(ViewerWidget* viewer, QWidget* parent, Qt::WindowFlags f)
|
|
: QWidget(parent, f), _world(nullptr), viewing(nullptr)
|
|
{
|
|
mainSplit = new QSplitter;
|
|
mainLayout = new QVBoxLayout;
|
|
|
|
viewerWidget = viewer;
|
|
viewerWidget->setMinimumSize(250,250);
|
|
|
|
frames = new ModelFramesWidget;
|
|
frames->setMaximumWidth(300);
|
|
|
|
mainSplit->addWidget(frames);
|
|
mainLayout->addWidget(mainSplit);
|
|
|
|
this->setLayout(mainLayout);
|
|
|
|
connect(frames, SIGNAL(selectedFrameChanged(ModelFrame*)),
|
|
viewerWidget, SLOT(selectFrame(ModelFrame*)));
|
|
setViewerWidget(viewerWidget);
|
|
}
|
|
|
|
void ModelViewer::setViewerWidget(ViewerWidget* widget)
|
|
{
|
|
viewerWidget = widget;
|
|
mainSplit->addWidget(viewerWidget);
|
|
showModel(viewing);
|
|
}
|
|
|
|
void ModelViewer::showData(GameWorld* world)
|
|
{
|
|
_world = world;
|
|
}
|
|
|
|
void ModelViewer::showModel(Model* model)
|
|
{
|
|
viewing = model;
|
|
viewerWidget->showModel(model);
|
|
frames->setModel(model);
|
|
}
|