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
9f9fe8d8
Commit
9f9fe8d8
authored
Jul 07, 2016
by
Alisa Jung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
started patch detection. compiles, not used yet. stopped because I don't know…
started patch detection. compiles, not used yet. stopped because I don't know what a patch is supposed to do.
parent
ce7512e6
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
0 deletions
+41
-0
subdivision.cpp
QTProject/subdivision.cpp
+33
-0
subdivision.h
QTProject/subdivision.h
+8
-0
No files found.
QTProject/subdivision.cpp
View file @
9f9fe8d8
...
@@ -318,6 +318,39 @@ Subdivision::Tables Subdivision::precomputeTables(Input input) {
...
@@ -318,6 +318,39 @@ Subdivision::Tables Subdivision::precomputeTables(Input input) {
return
tables
;
return
tables
;
}
}
void
Subdivision
::
extractPatches
(
QVector
<
unsigned
int
>
index_buffer
,
QVector
<
Vertex
>
vertex_buffer
,
QVector
<
Subdivision
::
Patch
>
&
patches
){
patches
.
clear
();
for
(
unsigned
int
i
=
0
;
i
<
index_buffer
.
length
()
-
2
;
i
+=
3
){
Vertex
vx
=
vertex_buffer
[
index_buffer
[
i
]];
Vertex
vy
=
vertex_buffer
[
index_buffer
[
i
+
1
]];
Vertex
vz
=
vertex_buffer
[
index_buffer
[
i
+
2
]];
int
countx
=
0
;
int
county
=
0
;
int
countz
=
0
;
for
(
unsigned
int
j
=
0
;
j
<
index_buffer
.
length
();
j
++
){
if
(
j
!=
i
&&
j
!=
i
+
1
&&
j
!=
i
+
2
){
if
(
vx
.
samePos
(
vertex_buffer
[
index_buffer
[
j
]])){
countx
++
;
}
if
(
vy
.
samePos
(
vertex_buffer
[
index_buffer
[
j
]])){
county
++
;
}
if
(
vz
.
samePos
(
vertex_buffer
[
index_buffer
[
j
]])){
countz
++
;
}
}
}
if
(
countx
!=
5
||
county
!=
5
||
countz
!=
5
){
//triangle is irregular
}
}
}
Subdivision
::
Result
Subdivision
::
runShader
(
Input
input
,
Tables
&
tables
)
{
Subdivision
::
Result
Subdivision
::
runShader
(
Input
input
,
Tables
&
tables
)
{
qDebug
()
<<
"Running compute shader"
;
qDebug
()
<<
"Running compute shader"
;
...
...
QTProject/subdivision.h
View file @
9f9fe8d8
...
@@ -37,6 +37,12 @@ private:
...
@@ -37,6 +37,12 @@ private:
QVector
<
Vertex
>
vertex_buffer
;
QVector
<
Vertex
>
vertex_buffer
;
};
};
struct
Patch
{
QVector
<
unsigned
int
>
index_buffer
;
bool
is_regular
;
};
QOpenGLFunctions_4_3_Core
*
f
;
QOpenGLFunctions_4_3_Core
*
f
;
QOpenGLShaderProgram
*
edgeShader
;
QOpenGLShaderProgram
*
edgeShader
;
QOpenGLShaderProgram
*
vertexShader
;
QOpenGLShaderProgram
*
vertexShader
;
...
@@ -46,6 +52,8 @@ private:
...
@@ -46,6 +52,8 @@ private:
Result
runShader
(
Input
input
,
Tables
&
tables
);
Result
runShader
(
Input
input
,
Tables
&
tables
);
void
runVertexShader
(
GLuint
size
,
GLuint
vb_handle
,
GLuint
vertex_indices_handle
,
GLuint
vertex_offsets_handle
,
GLuint
output_handle
);
void
runVertexShader
(
GLuint
size
,
GLuint
vb_handle
,
GLuint
vertex_indices_handle
,
GLuint
vertex_offsets_handle
,
GLuint
output_handle
);
void
runEdgeShader
(
GLuint
size
,
GLuint
vb_handle
,
GLuint
edge_indices_handle
,
GLuint
output_handle
,
GLuint
offset
);
void
runEdgeShader
(
GLuint
size
,
GLuint
vb_handle
,
GLuint
edge_indices_handle
,
GLuint
output_handle
,
GLuint
offset
);
void
extractPatches
(
QVector
<
unsigned
int
>
index_buffer
,
QVector
<
Vertex
>
vertex_buffer
,
QVector
<
Patch
>
&
patches
);
};
};
#endif
#endif
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