Commit 2799525e by Philipp Adolf

Change log level of some qDebug messages

parent 7dd34947
......@@ -194,7 +194,7 @@ QOpenGLShaderProgram* MainWidget::initShaderProgram(QString vertSource, QString
qCritical()<< "Linking shader failed:"<<shader->log();
exit(5);
}
qDebug()<<"Linking Shader done";
qInfo()<<"Linking Shader done";
return shader;
......
......@@ -9,7 +9,7 @@ Mesh::SubdivEntry::SubdivEntry()
Mesh::SubdivEntry::~SubdivEntry()
{
qDebug()<<"FIXME: Delete Called: num vertex:"<<vertices.size();
qDebug() << "FIXME: Delete Called: num vertex:" << vertices.size();
/*f->glDeleteBuffers(1, &VB_handle);
f->glDeleteBuffers(1, &IB_irregular_handle);
f->glDeleteBuffers(1, &IB_regular_handle);
......@@ -149,10 +149,10 @@ Mesh::Mesh(QOpenGLFunctions_4_3_Core *f,QString fileName)
aiProcess_Triangulate
);
qDebug()<<"File Read";
qDebug() << "File Read";
if( !scene)
{
qDebug()<<importer.GetErrorString();
qDebug() << importer.GetErrorString();
}else {
QString dir = QFileInfo(fileName).path();
......@@ -166,10 +166,10 @@ Mesh::Mesh(QOpenGLFunctions_4_3_Core *f,QString fileName)
material->Get(AI_MATKEY_NAME, mname);
initMaterial(dir, i, material);
qDebug()<<"Loaded Material"<<(i+1)<<"/"<<scene->mNumMaterials<<":"<<mname.C_Str()<<"Shininess"<<materials[i].Shininess;
qDebug() << "Loaded Material" << (i+1) << "/" << scene->mNumMaterials << ":" << mname.C_Str() << "Shininess" << materials[i].Shininess;
}
}
qDebug()<<"Materials Read";
qDebug() << "Materials Read";
//Init Mesh
if(scene->HasMeshes())
......@@ -181,11 +181,11 @@ Mesh::Mesh(QOpenGLFunctions_4_3_Core *f,QString fileName)
}
} else{
qWarning()<<"No Mesh found";
qWarning() << "No Mesh found";
return;
}
qDebug()<<"Mesh Read";
qDebug() << "Mesh Read";
//init Nodes
if(scene->mRootNode != NULL)
......@@ -200,9 +200,9 @@ Mesh::Mesh(QOpenGLFunctions_4_3_Core *f,QString fileName)
{
rootNode.meshes[i] = i;
}
qDebug()<<"No Root Node";
qDebug() << "No Root Node";
}
qDebug()<<"Nodes Read";
qDebug() << "Nodes Read";
globalInverseTransform = rootNode.transformation.inverted();
......@@ -211,7 +211,7 @@ Mesh::Mesh(QOpenGLFunctions_4_3_Core *f,QString fileName)
QVector3D max = QVector3D(-amax,-amax,-amax);
findObjectDimension(rootNode,QMatrix4x4(),min,max);
qDebug()<<"AABB"<<min<<max;
qDebug() << "AABB" << min << max;
float dist = qMax(max.x() - min.x(), qMax(max.y()-min.y(), max.z() - min.z()));
float sc = 100.0/dist;
......@@ -256,7 +256,7 @@ Mesh::Mesh(QOpenGLFunctions_4_3_Core *f, Mesh *mesh, QVector<Vertex> &vertex_buf
QVector3D max = QVector3D(-amax,-amax,-amax);
findObjectDimension(rootNode,QMatrix4x4(),min,max);
qDebug()<<"AABB"<<min<<max;
qDebug() << "AABB" << min << max;
float dist = qMax(max.x() - min.x(), qMax(max.y()-min.y(), max.z() - min.z()));
float sc = 100.0/dist;
......@@ -290,16 +290,16 @@ void Mesh::initNode(const aiScene *scene, aiNode *node, Node &newNode,QString de
newNode.transformation = QMatrix4x4(node->mTransformation[0]);
newNode.meshes.resize(node->mNumMeshes);
if(debug) qDebug()<<debugoffset.toStdString().c_str() << "NodeName" << newNode.name;
if(debug) qDebug()<<debugoffset.toStdString().c_str() << " NumMeshes" << newNode.meshes.size();
if(debug) qDebug() << debugoffset.toStdString().c_str() << "NodeName" << newNode.name;
if(debug) qDebug() << debugoffset.toStdString().c_str() << " NumMeshes" << newNode.meshes.size();
for(uint i = 0; i < node->mNumMeshes; ++i)
{
newNode.meshes[i] = node->mMeshes[i];
if(debug) qDebug()<<debugoffset.toStdString().c_str() << " MeshName" << entries[newNode.meshes[i]].name;
if(debug) qDebug() << debugoffset.toStdString().c_str() << " MeshName" << entries[newNode.meshes[i]].name;
}
if(debug) qDebug()<<debugoffset.toStdString().c_str() << " NumChildren" << node->mNumChildren;
if(debug) qDebug() << debugoffset.toStdString().c_str() << " NumChildren" << node->mNumChildren;
QString newDebug = QString(debugoffset).append(" ");
for(uint i = 0; i < node->mNumChildren; ++i)
{
......@@ -344,7 +344,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].hasTexture = true;
} else{
qDebug()<<"Warning No Texture";
qWarning() << "Warning No Texture";
materials[i].hasTexture = false;
}
}
......@@ -381,7 +381,7 @@ void Mesh::initMeshEntry(int index, aiMesh * entry) {
entries[index].name = entry->mName.length != 0 ? entry->mName.C_Str() : "";
entries[index].materialIndex = entry->mMaterialIndex;
qDebug()<<"Loaded Mesh:"<<entries[index].name<<"HasBones:"<<entry->HasBones();
qDebug() << "Loaded Mesh:" << entries[index].name << "HasBones:" << entry->HasBones();
entries[index].init(f,Vertices, Indices);
}
......@@ -390,7 +390,7 @@ void Mesh::render(QOpenGLShaderProgram *shader, QMatrix4x4 V,QMatrix4x4 P, int s
if(!loaded)
return;
if(f == NULL){
qDebug()<<"OpenGL Funktions = null";
qCritical() << "OpenGL functions == null";
return;
}
......@@ -429,7 +429,7 @@ void Mesh::renderMesh(QOpenGLShaderProgram *shader, int index, int subdivision,
{
int MaterialIndex = entries[index].materialIndex;
if (MaterialIndex < materials.size()) {
// qDebug()<<materials[MaterialIndex].Diffuse<<materials[MaterialIndex].Specular<<materials[MaterialIndex].Shininess<<materials[MaterialIndex].hasTexture;
// qDebug() << materials[MaterialIndex].Diffuse << materials[MaterialIndex].Specular << materials[MaterialIndex].Shininess << materials[MaterialIndex].hasTexture;
if (regular) {
shader->setUniformValue("materialInfo.Diffuse", QVector3D(0.0f, 0.0f, 1.0f));
......
......@@ -27,22 +27,22 @@ void Subdivision::init() {
}
QOpenGLShaderProgram *Subdivision::initComputeShaderProgram(QString &source){
qDebug()<<"Compiling compute shader ...";
qInfo() << "Compiling compute shader ...";
QOpenGLShader *computeShader = new QOpenGLShader(QOpenGLShader::Compute);
if(!computeShader->compileSourceFile(source)){
qCritical()<<"Compute Shader"<<source<<"failed"<<computeShader->log();
qCritical() << "Compute Shader" << source << "failed" << computeShader->log();
exit(5);
}
qDebug()<<"Adding compute shader ...";
qDebug() << "Adding compute shader ...";
QOpenGLShaderProgram *shader = new QOpenGLShaderProgram();
shader->addShader(computeShader);
qDebug()<<"Linking compute shader ...";
qDebug() << "Linking compute shader ...";
if(!shader->link()){
qCritical()<<"Linking compute shader failed:"<<shader->log();
qCritical() << "Linking compute shader failed:" << shader->log();
exit(5);
}
qDebug()<<"Linking compute shader done";
qDebug() << "Linking compute shader done";
return shader;
}
......@@ -53,7 +53,7 @@ void Subdivision::subdivide(Mesh *mesh, int level) {
int first_mesh_index = -1;
if (!root.getFirstMeshIndex(first_mesh_index)) {
qCritical()<<"No mesh found, aborting subdivision";
qCritical() << "No mesh found, aborting subdivision";
return;
}
......@@ -62,7 +62,7 @@ void Subdivision::subdivide(Mesh *mesh, int level) {
Input input;
int currentMax = current_mesh->buffers.size()-1;
qDebug()<<"Subdiv Level"<<level<<"Requested. Current Max:"<<currentMax;
qInfo() << "Subdiv Level" << level << "Requested. Current Max:" << currentMax;
if(level <= currentMax)
return;
......@@ -144,11 +144,11 @@ Subdivision::Tables Subdivision::precomputeTables(Input input) {
QVector<unsigned int> ib = input.index_buffer;
if(debugOutput)
qDebug()<<"Index Buffer: "<<ib;
qDebug() << "Index Buffer: " << ib;
QVector<Vertex> vb = input.vertex_buffer;
if(debugOutput)
qDebug()<<"Vertex Buffer: "<<vb;
qDebug() << "Vertex Buffer: " << vb;
QVector<Triangle> triangles;
for (int i = 0; i < ib.length(); i+=3) {
......@@ -261,12 +261,12 @@ Subdivision::Tables Subdivision::precomputeTables(Input input) {
tables.index_buffer.push_back(wu);
}
qDebug()<<"Done with edge table. "<<tables.edge_indices.length();
qDebug() << "Done with edge table. " << tables.edge_indices.length();
if (debugOutput){
qDebug()<<"Eedges found. Table: "<<tables.edge_indices;
qDebug()<<"Table (long version):";
qDebug() << "Eedges found. Table: " << tables.edge_indices;
qDebug() << "Table (long version):";
for (int i = 0; i < tables.edge_indices.length(); i++){
qDebug()<<"blub:"<<tables.edge_indices[i];
qDebug() << "blub:" << tables.edge_indices[i];
}
}
......@@ -334,15 +334,15 @@ Subdivision::Tables Subdivision::precomputeTables(Input input) {
tables.vertex_offsets.push_back(offset);
qDebug()<<"Done with vertex index table. ";
qDebug() << "Done with vertex index table. ";
if(debugOutput){
qDebug()<<"Duplicates: ";
qDebug() << "Duplicates: ";
for (int i = 0; i < duplicates.length(); i++){
qDebug()<<duplicates[i];
qDebug() << duplicates[i];
}
}
qDebug()<<"Precompute Tables Done";
tables.index_regular = getPatchIndexBuffer(ib);
qInfo() << "Precompute Tables Done";
return tables;
}
......@@ -351,7 +351,7 @@ void Subdivision::splitRegular(Mesh *mesh) {
int first_mesh_index = -1;
if (!root.getFirstMeshIndex(first_mesh_index)) {
qCritical()<<"No mesh found, aborting subdivision";
qCritical() << "No mesh found, aborting subdivision";
return;
}
......@@ -411,7 +411,7 @@ QVector<unsigned int> Subdivision::getPatchIndexBuffer(QVector<unsigned int> ib)
}
}
if (count3 != 5 || count6 != 5 || count7 != 5){
qWarning()<<"Counts wrong! 3: "<< count3 <<", 6: "<<count6<<", 7: "<<count7;
qWarning() << "Counts wrong! 3: "<< count3 <<", 6: " << count6 << ", 7: " << count7;
}
......@@ -434,7 +434,7 @@ QVector<unsigned int> Subdivision::getPatchIndexBuffer(QVector<unsigned int> ib)
}
if (!(found36 && found67 && found73)){
qWarning()<<"Didnt find neighbour. duplicate vertex? Abort.";
qWarning() << "Didnt find neighbour. duplicate vertex? Abort.";
return pib;
}
}
......@@ -468,12 +468,12 @@ QVector<unsigned int> Subdivision::getPatchIndexBuffer(QVector<unsigned int> ib)
found11 |= matchAndCompleteTriangle(j0,j1,j2,i7,i10,i11);
}
if (!(found0 && found1 && found5 && found9 && found8 && found11)){
qWarning()<<"Couldnt find some neighbour at i= "<<i;
qWarning()<<found0<<found1<<found5<<found9<<found8<<found11;
qWarning()<<"Abort computing patch index buffer.";
qWarning() << "Couldnt find some neighbour at i= " << i;
qWarning() << found0 << found1 << found5 << found9 << found8 << found11;
qWarning() << "Abort computing patch index buffer.";
return pib;
}
//else qWarning()<<"found all neighbours for patch.";
//else qWarning() << "found all neighbours for patch.";
pib.push_back(i0);
pib.push_back(i1);
pib.push_back(i2);
......@@ -551,7 +551,7 @@ bool Subdivision::matchAndCompleteTriangle(unsigned int sx, unsigned int sy, uns
}
Subdivision::Result Subdivision::runShader(Input input, Tables &tables) {
qDebug()<<"Running compute shader";
qInfo() << "Running compute shader";
Result result;
......
......@@ -14,11 +14,11 @@ void Texture::Load(GLenum textureTarget, QString fileName)
//load
if(fileName.isEmpty()){
qDebug()<<"No Image to load";
qWarning() << "No Image to load";
return;
}
qDebug()<<"Loading Texture:"<<fileName;
qDebug() << "Loading Texture:" << fileName;
QString suffix = QFileInfo(fileName).completeSuffix();
......@@ -29,15 +29,15 @@ void Texture::Load(GLenum textureTarget, QString fileName)
if(!QFile::exists(fileName))
{
qDebug()<<"File "<<fileName<<"don't exists";
qDebug() << "File " << fileName << "don't exists";
return;
}
QImage *texture = new QImage(fileName, suffix.toStdString().c_str());
if (texture == NULL|| texture->isNull()){
qDebug()<<"Could not load Texture:"<<fileName<<"Suffix:"<< suffix;
qDebug()<<QImageReader::supportedImageFormats();
qDebug() << "Could not load Texture:" << fileName << "Suffix:"<< suffix;
qDebug() << QImageReader::supportedImageFormats();
return;
}
......@@ -55,7 +55,7 @@ void Texture::Load(GLenum textureTarget, QString fileName)
glBindTexture( this->textureTarget, 0 );
qDebug()<<"Loaded texture"+fileName;
qDebug() << "Loaded texture"+fileName;
}
Texture::~Texture(){
......
......@@ -158,7 +158,7 @@ Triangle::Edge::Name rotate_edge_name(Triangle::Edge::Name edge) {
case Triangle::Edge::Name::wu:
return Triangle::Edge::Name::uv;
default:
qDebug() << "Default case should be unreachable";
qWarning() << "Default case should be unreachable";
return Triangle::Edge::Name::uv;
}
}
......
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