Commit 0c6f77a7 by Philipp Adolf

Add Subdivision class

parent aa771a6c
...@@ -17,13 +17,15 @@ SOURCES += main.cpp\ ...@@ -17,13 +17,15 @@ SOURCES += main.cpp\
mainwidget.cpp \ mainwidget.cpp \
mesh.cpp \ mesh.cpp \
texture.cpp \ texture.cpp \
camera.cpp camera.cpp \
subdivision.cpp
HEADERS += mainwindow.h \ HEADERS += mainwindow.h \
mainwidget.h \ mainwidget.h \
mesh.h \ mesh.h \
texture.h \ texture.h \
camera.h camera.h \
subdivision.h
FORMS += FORMS +=
......
...@@ -7,6 +7,7 @@ MainWidget::MainWidget(Camera *cam) ...@@ -7,6 +7,7 @@ MainWidget::MainWidget(Camera *cam)
rotTime = QTime::currentTime(); rotTime = QTime::currentTime();
wireframe = false; wireframe = false;
rotation = true; rotation = true;
subdivision = new Subdivision(this);
} }
QSize MainWidget::minimumSizeHint() const QSize MainWidget::minimumSizeHint() const
...@@ -126,6 +127,7 @@ void MainWidget::loadNewMesh(QString path){ ...@@ -126,6 +127,7 @@ void MainWidget::loadNewMesh(QString path){
qDebug()<<"Opening File:"<<path; qDebug()<<"Opening File:"<<path;
Mesh* temp = new Mesh(this,path); Mesh* temp = new Mesh(this,path);
subdivision->subdivide(temp);
mesh = temp; mesh = temp;
} }
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#include <assimp/postprocess.h> #include <assimp/postprocess.h>
#include "mesh.h" #include "mesh.h"
#include "camera.h" #include "camera.h"
#include "subdivision.h"
class MainWidget : public QOpenGLWidget, public QOpenGLFunctions_4_3_Core class MainWidget : public QOpenGLWidget, public QOpenGLFunctions_4_3_Core
...@@ -60,7 +61,7 @@ private: ...@@ -60,7 +61,7 @@ private:
QPointF * lastScreenPos; QPointF * lastScreenPos;
Subdivision *subdivision;
Mesh *mesh; Mesh *mesh;
QOpenGLShaderProgram* initShaderProgram(); QOpenGLShaderProgram* initShaderProgram();
......
#include "subdivision.h"
Subdivision::Subdivision(QOpenGLFunctions_4_3_Core *f)
{
this->f =f;
}
Subdivision::~Subdivision()
{
}
Mesh *Subdivision::subdivide(Mesh *mesh) {
precomputeTables(mesh);
runShader(mesh);
return NULL;
}
void Subdivision::precomputeTables(Mesh *mesh) {
}
void Subdivision::runShader(Mesh *mesh) {
}
#ifndef SUBDIVISION_H
#define SUBDIVISION_H
#include <QtOpenGL>
#include <QOpenGLFunctions_4_3_Core>
#include "mesh.h"
class Subdivision
{
public:
Subdivision(QOpenGLFunctions_4_3_Core *f);
~Subdivision();
Mesh *subdivide(Mesh *mesh);
private:
QOpenGLFunctions_4_3_Core *f;
void precomputeTables(Mesh *mesh);
void runShader(Mesh *mesh);
};
#endif
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