sendMessage via signal plot from file to window,
add severity to messages (black, yellow, red), add about text, removed unused texture from resource
This commit is contained in:
@@ -6,6 +6,8 @@
|
||||
#include <QMatrix4x4>
|
||||
#include <QQuaternion>
|
||||
#include <QOpenGLFunctions>
|
||||
#include <QObject>
|
||||
#include <..\Header\MainWindow.h>
|
||||
|
||||
|
||||
struct BoundingBox {
|
||||
@@ -34,18 +36,27 @@ struct Model {
|
||||
std::vector<Segment*> segmList;
|
||||
};
|
||||
|
||||
class FileInterface
|
||||
class FileInterface : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit FileInterface(const char* path)
|
||||
: m_models(new QVector<Model*>)
|
||||
explicit FileInterface(const char* path, QObject *parent)
|
||||
: QObject(parent)
|
||||
, m_models(new QVector<Model*>)
|
||||
, m_textureNames(new QVector<std::string>)
|
||||
{
|
||||
//open file
|
||||
m_file.open(path, std::ios::in | std::ios::binary);
|
||||
|
||||
if (!m_file.is_open())
|
||||
throw std::invalid_argument(std::string("file not found: ") += path);
|
||||
throw std::invalid_argument(std::string("ERROR: file not found: ") += path);
|
||||
|
||||
MainWindow* tmp = dynamic_cast<MainWindow*>(parent->parent()->parent());
|
||||
if(tmp != NULL)
|
||||
connect(this, SIGNAL(sendMessage(QString, int)), tmp, SLOT(showMessage(QString, int)));
|
||||
|
||||
|
||||
};
|
||||
|
||||
virtual ~FileInterface()
|
||||
@@ -85,4 +96,7 @@ public:
|
||||
virtual QVector<Model*>* getModels() const { return m_models; };
|
||||
virtual QVector<std::string>* getTextureNames() const { return m_textureNames; };
|
||||
virtual BoundingBox getBoundingBox() const { return m_sceneBbox; };
|
||||
|
||||
signals:
|
||||
void sendMessage(QString msg, int severity);
|
||||
};
|
||||
Reference in New Issue
Block a user