SWBF2-Classic-Msh-Viewer/QtMeshViewer/Header/OutputDevice.h
Anakin 7b739ab892 use OutputDevice to set fileinfo,
use new connect function,
2017-01-29 15:19:20 +01:00

32 lines
840 B
C++

#pragma once
#include <QObject>
struct Material;
class OutputDevice : public QObject
{
Q_OBJECT
private:
OutputDevice(QObject *parent = Q_NULLPTR) : QObject(parent) {};
public:
OutputDevice(OutputDevice const&) = delete;
void operator=(OutputDevice const&) = delete;
~OutputDevice() {};
static OutputDevice* getInstance(QObject *parent = Q_NULLPTR) {
static OutputDevice* instance = new OutputDevice(parent);
return instance;
};
void print(QString message, int severity) { emit sendMessage(message, severity); };
void setFileInfo(QString name, QVector<Material>* materials, int vertices, int triangle) {
emit sendFileInfo(name, materials, vertices, triangle);
};
signals:
void sendMessage(QString message, int severity);
void sendFileInfo(QString name, QVector<Material>* materials, int vertices, int triangle);
};