add OuputDevice as singleton to manage output to statusbar,
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
#include "..\Header\MshFile.h"
|
||||
#include "..\Header\OglViewerWidget.h"
|
||||
#include "..\Header\MainWindow.h"
|
||||
#include "..\Header\OutputDevice.h"
|
||||
#include <QRegExp>
|
||||
|
||||
|
||||
@@ -154,7 +155,7 @@ void GeometryEngine::loadFile(QString filePath)
|
||||
|
||||
//reset view
|
||||
emit requestResetView();
|
||||
emit sendMessage("loading file..", 0);
|
||||
OutputDevice::getInstance()->print("loading file..", 0);
|
||||
|
||||
try
|
||||
{
|
||||
@@ -163,7 +164,7 @@ void GeometryEngine::loadFile(QString filePath)
|
||||
QVector<GLuint> indexData;
|
||||
|
||||
// open file and get the information
|
||||
MshFile file(filePath, this);
|
||||
MshFile file(filePath);
|
||||
|
||||
models = file.getModels();
|
||||
m_materials = file.getMaterials();
|
||||
@@ -213,13 +214,13 @@ void GeometryEngine::loadFile(QString filePath)
|
||||
m_indexBuf.allocate(indexData.data(), indexData.size() * sizeof(GLuint));
|
||||
|
||||
emit requestUpdate();
|
||||
emit sendMessage("done..", 0);
|
||||
OutputDevice::getInstance()->print("done..", 0);
|
||||
emit sendFileInfo(filePath.right(filePath.size() - filePath.lastIndexOf(QRegExp("/|\\\\")) - 1), m_materials, vertexData.size(), indexData.size() / 3);
|
||||
}
|
||||
catch (std::invalid_argument e)
|
||||
{
|
||||
clearData();
|
||||
emit sendMessage(QString(e.what()), 2);
|
||||
OutputDevice::getInstance()->print(QString(e.what()), 2);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user