Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
U
Unterteilungsalgorithmen
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
3
Issues
3
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kai Westerkamp
Unterteilungsalgorithmen
Commits
07352b7c
Commit
07352b7c
authored
Sep 27, 2016
by
Kai Westerkamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bounding Volume Button
parent
81e35fd2
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
17 additions
and
2 deletions
+17
-2
mainwidget.cpp
QTProject/mainwidget.cpp
+7
-2
mainwidget.h
QTProject/mainwidget.h
+2
-0
mainwindow.cpp
QTProject/mainwindow.cpp
+7
-0
mainwindow.h
QTProject/mainwindow.h
+1
-0
watertight.png
watertight.png
+0
-0
No files found.
QTProject/mainwidget.cpp
View file @
07352b7c
...
...
@@ -6,6 +6,7 @@ MainWidget::MainWidget(Camera *cam)
startTime
=
QTime
::
currentTime
();
rotTime
=
QTime
::
currentTime
();
wireframe
=
true
;
boundingVolume
=
true
;
rotation
=
false
;
subdivision
=
new
Subdivision
(
this
);
subdivLevel
=
0
;
...
...
@@ -189,6 +190,10 @@ void MainWidget::setWireframe(bool active){
this
->
wireframe
=
active
;
}
void
MainWidget
::
setBoundingVolume
(
bool
active
){
this
->
boundingVolume
=
active
;
}
QOpenGLShaderProgram
*
MainWidget
::
initShaderProgram
(
QString
vertSource
,
QString
tesselationControlSource
,
QString
tesselationEvaluationSource
,
QString
geometrySource
,
QString
fragSource
){
QOpenGLShader
*
vert
=
initGLShader
(
vertSource
,
QOpenGLShader
::
Vertex
);
...
...
@@ -248,7 +253,7 @@ void MainWidget::paintGL(){
mesh
->
render
(
regularShader
,
view
,
m_projection
,
subdivLevel
,
true
);
if
(
subdivLevel
>
0
){
if
(
subdivLevel
>
0
&&
boundingVolume
){
glEnable
(
GL_BLEND
);
glDepthMask
(
GL_FALSE
);
glBlendFunc
(
GL_SRC_ALPHA
,
GL_ONE_MINUS_SRC_ALPHA
);
...
...
@@ -268,7 +273,7 @@ void MainWidget::paintGL(){
mesh
->
render
(
subdivisionShader
,
view
,
m_projection
,
subdivLevel
,
false
);
if
(
subdivLevel
>
0
){
if
(
subdivLevel
>
0
&&
boundingVolume
){
glEnable
(
GL_BLEND
);
glDepthMask
(
GL_FALSE
);
glBlendFunc
(
GL_SRC_ALPHA
,
GL_ONE_MINUS_SRC_ALPHA
);
...
...
QTProject/mainwidget.h
View file @
07352b7c
...
...
@@ -28,6 +28,7 @@ public:
bool
rotation
;
bool
wireframe
;
bool
boundingVolume
;
int
subdivLevel
;
public
slots
:
...
...
@@ -35,6 +36,7 @@ public slots:
void
loadNewMesh
(
QString
path
);
void
setRotation
(
bool
started
);
void
setWireframe
(
bool
active
);
void
setBoundingVolume
(
bool
active
);
void
subdivide
(
int
level
);
signals
:
...
...
QTProject/mainwindow.cpp
View file @
07352b7c
...
...
@@ -28,6 +28,13 @@ MainWindow::MainWindow(QWidget *parent) :
connect
(
switchWireframe
,
SIGNAL
(
triggered
(
bool
)),
m_centralWidget
,
SLOT
(
setWireframe
(
bool
)));
toolBar
->
addAction
(
switchWireframe
);
switchBoundingVolume
=
new
QAction
(
"Bounding Volume"
,
this
);
switchBoundingVolume
->
setCheckable
(
true
);
switchBoundingVolume
->
setChecked
(
m_centralWidget
->
boundingVolume
);
connect
(
switchBoundingVolume
,
SIGNAL
(
triggered
(
bool
)),
m_centralWidget
,
SLOT
(
setBoundingVolume
(
bool
)));
toolBar
->
addAction
(
switchBoundingVolume
);
CamHome
=
new
QAction
(
"Cam"
,
this
);
CamHome
->
setCheckable
(
false
);
...
...
QTProject/mainwindow.h
View file @
07352b7c
...
...
@@ -31,6 +31,7 @@ private:
QAction
*
loadMesh
;
QAction
*
switchRotation
;
QAction
*
switchWireframe
;
QAction
*
switchBoundingVolume
;
QAction
*
CamHome
;
QAction
*
debugOutput
;
QSlider
*
subdivSlider
;
...
...
watertight.png
0 → 100644
View file @
07352b7c
568 KB
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment