Commit 547955fa by Philipp Adolf

Also use categories for info, warning, critical

parent f4a2cb8f
...@@ -182,7 +182,7 @@ Mesh::Mesh(QOpenGLFunctions_4_3_Core *f,QString fileName) ...@@ -182,7 +182,7 @@ Mesh::Mesh(QOpenGLFunctions_4_3_Core *f,QString fileName)
} }
} else{ } else{
qWarning() << "No Mesh found"; qCWarning(log_mesh) << "No Mesh found";
return; return;
} }
...@@ -345,7 +345,7 @@ void Mesh::initMaterial(QString dir, unsigned int i, const aiMaterial* material) ...@@ -345,7 +345,7 @@ void Mesh::initMaterial(QString dir, unsigned int i, const aiMaterial* material)
materials[i].texture.Load(GL_TEXTURE_2D, QString(FullPath.c_str())); materials[i].texture.Load(GL_TEXTURE_2D, QString(FullPath.c_str()));
materials[i].hasTexture = true; materials[i].hasTexture = true;
} else{ } else{
qWarning() << "Warning No Texture"; qCWarning(log_mesh) << "Warning No Texture";
materials[i].hasTexture = false; materials[i].hasTexture = false;
} }
} }
...@@ -391,7 +391,7 @@ void Mesh::render(QOpenGLShaderProgram *shader, QMatrix4x4 V,QMatrix4x4 P, int s ...@@ -391,7 +391,7 @@ void Mesh::render(QOpenGLShaderProgram *shader, QMatrix4x4 V,QMatrix4x4 P, int s
if(!loaded) if(!loaded)
return; return;
if(f == NULL){ if(f == NULL){
qCritical() << "OpenGL functions == null"; qCCritical(log_mesh) << "OpenGL functions == null";
return; return;
} }
......
...@@ -23,10 +23,10 @@ void Subdivision::init() { ...@@ -23,10 +23,10 @@ void Subdivision::init() {
} }
QOpenGLShaderProgram *Subdivision::initComputeShaderProgram(QString &source){ QOpenGLShaderProgram *Subdivision::initComputeShaderProgram(QString &source){
qInfo() << "Compiling compute shader ..."; qCInfo(log_subdiv) << "Compiling compute shader ...";
QOpenGLShader *computeShader = new QOpenGLShader(QOpenGLShader::Compute); QOpenGLShader *computeShader = new QOpenGLShader(QOpenGLShader::Compute);
if(!computeShader->compileSourceFile(source)){ if(!computeShader->compileSourceFile(source)){
qCritical() << "Compute Shader" << source << "failed" << computeShader->log(); qCCritical(log_subdiv) << "Compute Shader" << source << "failed" << computeShader->log();
exit(5); exit(5);
} }
...@@ -35,7 +35,7 @@ QOpenGLShaderProgram *Subdivision::initComputeShaderProgram(QString &source){ ...@@ -35,7 +35,7 @@ QOpenGLShaderProgram *Subdivision::initComputeShaderProgram(QString &source){
shader->addShader(computeShader); shader->addShader(computeShader);
qCDebug(log_subdiv) << "Linking compute shader ..."; qCDebug(log_subdiv) << "Linking compute shader ...";
if(!shader->link()){ if(!shader->link()){
qCritical() << "Linking compute shader failed:" << shader->log(); qCCritical(log_subdiv) << "Linking compute shader failed:" << shader->log();
exit(5); exit(5);
} }
qCDebug(log_subdiv) << "Linking compute shader done"; qCDebug(log_subdiv) << "Linking compute shader done";
...@@ -49,7 +49,7 @@ void Subdivision::subdivide(Mesh *mesh, int level) { ...@@ -49,7 +49,7 @@ void Subdivision::subdivide(Mesh *mesh, int level) {
int first_mesh_index = -1; int first_mesh_index = -1;
if (!root.getFirstMeshIndex(first_mesh_index)) { if (!root.getFirstMeshIndex(first_mesh_index)) {
qCritical() << "No mesh found, aborting subdivision"; qCCritical(log_subdiv) << "No mesh found, aborting subdivision";
return; return;
} }
...@@ -58,7 +58,7 @@ void Subdivision::subdivide(Mesh *mesh, int level) { ...@@ -58,7 +58,7 @@ void Subdivision::subdivide(Mesh *mesh, int level) {
Input input; Input input;
int currentMax = current_mesh->buffers.size()-1; int currentMax = current_mesh->buffers.size()-1;
qInfo() << "Subdiv Level" << level << "Requested. Current Max:" << currentMax; qCInfo(log_subdiv) << "Subdiv Level" << level << "Requested. Current Max:" << currentMax;
if(level <= currentMax) if(level <= currentMax)
return; return;
...@@ -103,7 +103,7 @@ void insert_edge(QMap<Triangle, QVector<Triangle::Edge>> &opposite_edges, const ...@@ -103,7 +103,7 @@ void insert_edge(QMap<Triangle, QVector<Triangle::Edge>> &opposite_edges, const
edges[2] = edge_b; edges[2] = edge_b;
break; break;
default: default:
qWarning() << "got" << edge_a.name << "as edge!"; qCWarning(log_subdiv) << "got" << edge_a.name << "as edge!";
break; break;
} }
opposite_edges.insert(triangle, edges); opposite_edges.insert(triangle, edges);
...@@ -334,7 +334,7 @@ Subdivision::Tables Subdivision::precomputeTables(Input input) { ...@@ -334,7 +334,7 @@ Subdivision::Tables Subdivision::precomputeTables(Input input) {
qCDebug(log_subdiv) << duplicates[i]; qCDebug(log_subdiv) << duplicates[i];
} }
tables.index_regular = getPatchIndexBuffer(ib); tables.index_regular = getPatchIndexBuffer(ib);
qInfo() << "Precompute Tables Done"; qCInfo(log_subdiv) << "Precompute Tables Done";
return tables; return tables;
} }
...@@ -343,7 +343,7 @@ void Subdivision::splitRegular(Mesh *mesh) { ...@@ -343,7 +343,7 @@ void Subdivision::splitRegular(Mesh *mesh) {
int first_mesh_index = -1; int first_mesh_index = -1;
if (!root.getFirstMeshIndex(first_mesh_index)) { if (!root.getFirstMeshIndex(first_mesh_index)) {
qCritical() << "No mesh found, aborting subdivision"; qCCritical(log_subdiv) << "No mesh found, aborting subdivision";
return; return;
} }
...@@ -403,7 +403,7 @@ QVector<unsigned int> Subdivision::getPatchIndexBuffer(QVector<unsigned int> ib) ...@@ -403,7 +403,7 @@ QVector<unsigned int> Subdivision::getPatchIndexBuffer(QVector<unsigned int> ib)
} }
} }
if (count3 != 5 || count6 != 5 || count7 != 5){ if (count3 != 5 || count6 != 5 || count7 != 5){
qWarning() << "Counts wrong! 3: "<< count3 <<", 6: " << count6 << ", 7: " << count7; qCWarning(log_subdiv) << "Counts wrong! 3: "<< count3 <<", 6: " << count6 << ", 7: " << count7;
} }
...@@ -426,7 +426,7 @@ QVector<unsigned int> Subdivision::getPatchIndexBuffer(QVector<unsigned int> ib) ...@@ -426,7 +426,7 @@ QVector<unsigned int> Subdivision::getPatchIndexBuffer(QVector<unsigned int> ib)
} }
if (!(found36 && found67 && found73)){ if (!(found36 && found67 && found73)){
qWarning() << "Didnt find neighbour. duplicate vertex? Abort."; qCWarning(log_subdiv) << "Didnt find neighbour. duplicate vertex? Abort.";
return pib; return pib;
} }
} }
...@@ -460,12 +460,12 @@ QVector<unsigned int> Subdivision::getPatchIndexBuffer(QVector<unsigned int> ib) ...@@ -460,12 +460,12 @@ QVector<unsigned int> Subdivision::getPatchIndexBuffer(QVector<unsigned int> ib)
found11 |= matchAndCompleteTriangle(j0,j1,j2,i7,i10,i11); found11 |= matchAndCompleteTriangle(j0,j1,j2,i7,i10,i11);
} }
if (!(found0 && found1 && found5 && found9 && found8 && found11)){ if (!(found0 && found1 && found5 && found9 && found8 && found11)){
qWarning() << "Couldnt find some neighbour at i= " << i; qCWarning(log_subdiv) << "Couldnt find some neighbour at i= " << i;
qWarning() << found0 << found1 << found5 << found9 << found8 << found11; qCWarning(log_subdiv) << found0 << found1 << found5 << found9 << found8 << found11;
qWarning() << "Abort computing patch index buffer."; qCWarning(log_subdiv) << "Abort computing patch index buffer.";
return pib; return pib;
} }
//else qWarning() << "found all neighbours for patch."; //else qCWarning(log_subdiv) << "found all neighbours for patch.";
pib.push_back(i0); pib.push_back(i0);
pib.push_back(i1); pib.push_back(i1);
pib.push_back(i2); pib.push_back(i2);
...@@ -543,7 +543,7 @@ bool Subdivision::matchAndCompleteTriangle(unsigned int sx, unsigned int sy, uns ...@@ -543,7 +543,7 @@ bool Subdivision::matchAndCompleteTriangle(unsigned int sx, unsigned int sy, uns
} }
Subdivision::Result Subdivision::runShader(Input input, Tables &tables) { Subdivision::Result Subdivision::runShader(Input input, Tables &tables) {
qInfo() << "Running compute shader"; qCInfo(log_subdiv) << "Running compute shader";
Result result; Result result;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment