2015-04-13 02:48:29 +02:00
|
|
|
#pragma once
|
|
|
|
#ifndef _MODELVIEWER_HPP_
|
|
|
|
#define _MODELVIEWER_HPP_
|
2016-05-15 21:25:20 +02:00
|
|
|
#include <engine/GameData.hpp>
|
|
|
|
#include <engine/GameWorld.hpp>
|
|
|
|
#include "AnimationListWidget.hpp"
|
|
|
|
|
|
|
|
#include "ViewerInterface.hpp"
|
|
|
|
|
2015-04-13 02:48:29 +02:00
|
|
|
#include <QLabel>
|
|
|
|
#include <QLayout>
|
2016-09-09 22:13:21 +02:00
|
|
|
#include <QSplitter>
|
|
|
|
#include <QTreeView>
|
|
|
|
#include <QVBoxLayout>
|
2015-04-13 02:48:29 +02:00
|
|
|
|
|
|
|
class ViewerWidget;
|
|
|
|
class Model;
|
2015-04-14 02:06:50 +02:00
|
|
|
class Skeleton;
|
2015-04-13 02:48:29 +02:00
|
|
|
class ModelFramesWidget;
|
2016-04-16 15:06:02 +02:00
|
|
|
class Animation;
|
2015-04-13 02:48:29 +02:00
|
|
|
|
2016-09-09 22:13:21 +02:00
|
|
|
class ModelViewer : public ViewerInterface {
|
|
|
|
Q_OBJECT
|
2015-04-13 02:48:29 +02:00
|
|
|
|
2016-09-09 22:13:21 +02:00
|
|
|
Model* viewing;
|
|
|
|
Skeleton* skeleton;
|
2015-04-13 02:48:29 +02:00
|
|
|
|
2016-09-09 22:13:21 +02:00
|
|
|
QSplitter* mainSplit;
|
|
|
|
QVBoxLayout* mainLayout;
|
|
|
|
ViewerWidget* viewerWidget;
|
2015-04-13 02:48:29 +02:00
|
|
|
|
2016-09-09 22:13:21 +02:00
|
|
|
ModelFramesWidget* frames;
|
2016-04-16 15:06:02 +02:00
|
|
|
|
2016-09-09 22:13:21 +02:00
|
|
|
AnimationList loadedAnimations;
|
|
|
|
AnimationListWidget* animationWidget;
|
2015-04-13 02:48:29 +02:00
|
|
|
|
2016-09-09 22:13:21 +02:00
|
|
|
public:
|
|
|
|
ModelViewer(ViewerWidget* viewer = 0, QWidget* parent = 0,
|
|
|
|
Qt::WindowFlags f = 0);
|
2015-04-13 02:48:29 +02:00
|
|
|
|
2016-09-09 22:13:21 +02:00
|
|
|
void setViewerWidget(ViewerWidget* widget) override;
|
2015-04-13 02:48:29 +02:00
|
|
|
|
|
|
|
public slots:
|
|
|
|
|
2016-09-09 22:13:21 +02:00
|
|
|
/**
|
|
|
|
* Display a raw model
|
|
|
|
*/
|
|
|
|
void showModel(Model* model);
|
2015-04-13 02:48:29 +02:00
|
|
|
|
2016-09-09 22:13:21 +02:00
|
|
|
/**
|
|
|
|
* Display a game object's model
|
|
|
|
*/
|
|
|
|
void showObject(uint16_t object);
|
2015-04-14 02:06:50 +02:00
|
|
|
|
2016-09-09 22:13:21 +02:00
|
|
|
void loadAnimations(const QString& file);
|
|
|
|
void playAnimation(Animation* anim);
|
2015-04-13 02:48:29 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|