Commit 0c6f77a7 by Philipp Adolf

Add Subdivision class

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