Commit 3368c442 by Philipp Adolf

Remove debugOutput variable

parent d737b96a
...@@ -158,12 +158,6 @@ void MainWidget::subdivide(int level){ ...@@ -158,12 +158,6 @@ void MainWidget::subdivide(int level){
} }
void MainWidget::setdebugOutput(bool output){
subdivision->setDebugOutbut(output);
}
void MainWidget::setRotation(bool started){ void MainWidget::setRotation(bool started){
qDebug()<<"rotation"<<started; qDebug()<<"rotation"<<started;
this->rotation = started; this->rotation = started;
......
...@@ -35,7 +35,6 @@ public slots: ...@@ -35,7 +35,6 @@ public slots:
void setRotation(bool started); void setRotation(bool started);
void setWireframe(bool active); void setWireframe(bool active);
void subdivide(int level); void subdivide(int level);
void setdebugOutput(bool output);
protected: protected:
void initializeGL(); void initializeGL();
......
...@@ -7,7 +7,6 @@ ...@@ -7,7 +7,6 @@
Subdivision::Subdivision(QOpenGLFunctions_4_3_Core *f) Subdivision::Subdivision(QOpenGLFunctions_4_3_Core *f)
{ {
this->f =f; this->f =f;
debugOutput = false;
} }
Subdivision::~Subdivision() Subdivision::~Subdivision()
...@@ -15,10 +14,6 @@ Subdivision::~Subdivision() ...@@ -15,10 +14,6 @@ Subdivision::~Subdivision()
delete edgeShader; delete edgeShader;
} }
void Subdivision::setDebugOutbut(bool debug){
this->debugOutput = debug;
}
void Subdivision::init() { void Subdivision::init() {
QString source = QLatin1String(":/subdivision-edge.compute"); QString source = QLatin1String(":/subdivision-edge.compute");
edgeShader = initComputeShaderProgram(source); edgeShader = initComputeShaderProgram(source);
...@@ -144,12 +139,10 @@ Subdivision::Tables Subdivision::precomputeTables(Input input) { ...@@ -144,12 +139,10 @@ Subdivision::Tables Subdivision::precomputeTables(Input input) {
Tables tables; Tables tables;
QVector<unsigned int> ib = input.index_buffer; QVector<unsigned int> ib = input.index_buffer;
if(debugOutput) qCDebug(log_subdiv) << "Index Buffer: " << ib;
qCDebug(log_subdiv) << "Index Buffer: " << ib;
QVector<Vertex> vb = input.vertex_buffer; QVector<Vertex> vb = input.vertex_buffer;
if(debugOutput) qCDebug(log_subdiv) << "Vertex Buffer: " << vb;
qCDebug(log_subdiv) << "Vertex Buffer: " << vb;
QVector<Triangle> triangles; QVector<Triangle> triangles;
for (int i = 0; i < ib.length(); i+=3) { for (int i = 0; i < ib.length(); i+=3) {
...@@ -263,12 +256,10 @@ Subdivision::Tables Subdivision::precomputeTables(Input input) { ...@@ -263,12 +256,10 @@ Subdivision::Tables Subdivision::precomputeTables(Input input) {
} }
qCDebug(log_subdiv) << "Done with edge table. " << tables.edge_indices.length(); qCDebug(log_subdiv) << "Done with edge table. " << tables.edge_indices.length();
if (debugOutput){ qCDebug(log_subdiv) << "Eedges found. Table: " << tables.edge_indices;
qCDebug(log_subdiv) << "Eedges found. Table: " << tables.edge_indices; qCDebug(log_subdiv) << "Table (long version):";
qCDebug(log_subdiv) << "Table (long version):"; for (int i = 0; i < tables.edge_indices.length(); i++){
for (int i = 0; i < tables.edge_indices.length(); i++){ qCDebug(log_subdiv) << "blub:" << tables.edge_indices[i];
qCDebug(log_subdiv) << "blub:" << tables.edge_indices[i];
}
} }
//compute vertex table //compute vertex table
...@@ -336,11 +327,9 @@ Subdivision::Tables Subdivision::precomputeTables(Input input) { ...@@ -336,11 +327,9 @@ Subdivision::Tables Subdivision::precomputeTables(Input input) {
tables.vertex_offsets.push_back(offset); tables.vertex_offsets.push_back(offset);
qCDebug(log_subdiv) << "Done with vertex index table. "; qCDebug(log_subdiv) << "Done with vertex index table. ";
if(debugOutput){ qCDebug(log_subdiv) << "Duplicates: ";
qCDebug(log_subdiv) << "Duplicates: "; for (int i = 0; i < duplicates.length(); i++){
for (int i = 0; i < duplicates.length(); i++){ qCDebug(log_subdiv) << duplicates[i];
qCDebug(log_subdiv) << duplicates[i];
}
} }
tables.index_regular = getPatchIndexBuffer(ib); tables.index_regular = getPatchIndexBuffer(ib);
qInfo() << "Precompute Tables Done"; qInfo() << "Precompute Tables Done";
...@@ -592,19 +581,15 @@ Subdivision::Result Subdivision::runShader(Input input, Tables &tables) { ...@@ -592,19 +581,15 @@ Subdivision::Result Subdivision::runShader(Input input, Tables &tables) {
Vertex *ptr; Vertex *ptr;
ptr = (Vertex *) f->glMapBuffer(GL_SHADER_STORAGE_BUFFER, GL_WRITE_ONLY); ptr = (Vertex *) f->glMapBuffer(GL_SHADER_STORAGE_BUFFER, GL_WRITE_ONLY);
if(debugOutput) qCDebug(log_subdiv) << "New vertices:";
qCDebug(log_subdiv) << "New vertices:";
for (int i = 0; i < input.vertex_buffer.size(); i++) { for (int i = 0; i < input.vertex_buffer.size(); i++) {
if(debugOutput) qCDebug(log_subdiv) << ptr[i].pos;
qCDebug(log_subdiv) << ptr[i].pos;
result.vertex_buffer.push_back(ptr[i]); result.vertex_buffer.push_back(ptr[i]);
} }
if(debugOutput) qCDebug(log_subdiv) << "New edge points:";
qCDebug(log_subdiv) << "New edge points:";
for (int i = 0; i < tables.edge_indices.size() / 4; i++) { for (int i = 0; i < tables.edge_indices.size() / 4; i++) {
if(debugOutput) qCDebug(log_subdiv) << ptr[edgeOffset + i].pos;
qCDebug(log_subdiv) << ptr[edgeOffset + i].pos;
result.vertex_buffer.push_back(ptr[edgeOffset + i]); result.vertex_buffer.push_back(ptr[edgeOffset + i]);
} }
......
...@@ -16,11 +16,8 @@ public: ...@@ -16,11 +16,8 @@ public:
void init(); void init();
void splitRegular(Mesh *mesh); void splitRegular(Mesh *mesh);
void subdivide(Mesh *mesh, int level); void subdivide(Mesh *mesh, int level);
void setDebugOutbut(bool debug);
private: private:
bool debugOutput;
struct Input struct Input
{ {
GLuint vb_handle; GLuint vb_handle;
......
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