Commit e28d3501 by Kai Westerkamp

Time format

parent 6c991eac
......@@ -13,6 +13,12 @@ Subdivision::~Subdivision()
delete edgeShader;
}
QString Subdivision::getTimeSting(int time){
return QString("%1m %2s %3ms").arg( time / 60000 , 2, 10, QChar('0'))
.arg((time % 60000) / 1000, 2, 10, QChar('0'))
.arg((time % 1000) , 3, 10, QChar('0'));
}
void Subdivision::init() {
QString source = QLatin1String(":/subdivision-edge.compute");
edgeShader = initComputeShaderProgram(source);
......@@ -383,7 +389,7 @@ void Subdivision::splitRegular(Mesh *mesh) {
current_mesh->buffers[0]->updateIndices();
qCDebug(log_timing) << "splitRegular(mesh): time: " << totalTimer.elapsed()<<"ms";
qCDebug(log_timing) << "splitRegular(mesh): time: " <<getTimeSting(totalTimer.elapsed());
qCDebug(log_subdiv) << "splitRegular(mesh): regular: " << regular.length();
qCDebug(log_subdiv) << "splitRegular(mesh): irregular: " << irregular.length();
}
......@@ -536,7 +542,7 @@ QVector<unsigned int> Subdivision::getPatchIndexBuffer(QVector<unsigned int> ib_
}
}
qCDebug(log_timing)<<"PatchIndexBuffer done:"<<totalTimer.elapsed()<<"ms";
qCDebug(log_timing)<<"PatchIndexBuffer done:"<<getTimeSting(totalTimer.elapsed());
return pib;
}
......@@ -596,7 +602,7 @@ void Subdivision::findRegular(QVector<unsigned int> index_buffer, QVector<Vertex
irregular.push_back(index_buffer[i+2]);
}
}
qCDebug(log_timing)<<"Find Regular done:"<<totalTimer.elapsed()<<"ms";
qCDebug(log_timing)<<"Find Regular done:"<<getTimeSting(totalTimer.elapsed());
}
bool Subdivision::matchAndCompleteTriangleIndices(unsigned int sx, unsigned int sy, unsigned int sz, unsigned int tx, unsigned int ty, unsigned int &tz){
......
......@@ -48,6 +48,8 @@ private:
bool is_regular;
};
QString getTimeSting(int time);
QOpenGLFunctions_4_3_Core *f;
QOpenGLShaderProgram *edgeShader;
QOpenGLShaderProgram *vertexShader;
......
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