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:
Anakin
2017-01-04 14:35:27 +01:00
parent a221ed4957
commit a2f5324a3c
12 changed files with 133 additions and 37 deletions

View File

@@ -1,5 +1,4 @@
#include "..\Header\MshFile.h"
#include <iostream>
// helper function to save data from file to any variable type
@@ -9,8 +8,8 @@
/////////////////////////////////////////////////////////////////////////
// public constructor/destructor
MshFile::MshFile(const char * path)
: FileInterface(path)
MshFile::MshFile(const char * path, QObject * parent)
: FileInterface(path, parent)
{
import();
}
@@ -89,8 +88,7 @@ void MshFile::loadChunks(std::list<ChunkHeader*>& destination, std::streampos st
// out of file. Maybe a size information is corrupted
if (!m_file.good())
{
//TODO: different way for output
std::cout << "WARNING: corrupted file. Trying to continue" << std::endl;
emit sendMessage("WARNING: corrupted file. Trying to continue..", 1);
m_file.clear();
break;
}
@@ -579,15 +577,15 @@ void MshFile::readUV(Segment * dataDestination, std::streampos position)
if (tmp_size < dataDestination->vertices.size())
{
//TODO: warning
std::cout << "WARNING: too less UVs " << tmp_size << " < " << dataDestination->vertices.size() << std::endl;
emit sendMessage("WARNING: too less UVs " + QString::number(tmp_size) + " < " + QString::number(dataDestination->vertices.size()),1);
//TODO: fill backward with default UVs
for (unsigned int i = dataDestination->vertices.size(); i != tmp_size; i--)
for (unsigned int j = 0; j < 2; j++)
dataDestination->vertices[i - 1].texCoord[j] = 0;
}
else if (tmp_size > dataDestination->vertices.size())
{
//TODO: warning
std::cout << "WARNING: too many UVs " << tmp_size << " > " << dataDestination->vertices.size() << std::endl;
emit sendMessage("WARNING: too many UVs " + QString::number(tmp_size) + " > " + QString::number(dataDestination->vertices.size()), 1);
tmp_size = dataDestination->vertices.size();
}