Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
GraPa
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
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
GraPa
Commits
8ece7716
Commit
8ece7716
authored
Nov 23, 2015
by
Kai Westerkamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
grid
parent
0de3f161
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
57 additions
and
4 deletions
+57
-4
glview.cpp
A2/glview.cpp
+1
-1
glview.h
A2/glview.h
+7
-3
mainwindow.cpp
A2/mainwindow.cpp
+44
-0
mainwindow.h
A2/mainwindow.h
+5
-0
No files found.
A2/glview.cpp
View file @
8ece7716
...
@@ -9,7 +9,7 @@ GLView::GLView(Scene *scene,Camera * camera,Controler *controler )
...
@@ -9,7 +9,7 @@ GLView::GLView(Scene *scene,Camera * camera,Controler *controler )
this
->
controler
=
controler
;
this
->
controler
=
controler
;
gridSize
=
5
;
gridSize
=
5
;
gridStepSize
=
1
;
gridStepSize
=
1
;
isGridEnabled
=
tru
e
;
isGridEnabled
=
fals
e
;
}
}
QSize
GLView
::
minimumSizeHint
()
const
QSize
GLView
::
minimumSizeHint
()
const
...
...
A2/glview.h
View file @
8ece7716
...
@@ -23,6 +23,10 @@ protected :
...
@@ -23,6 +23,10 @@ protected :
public
slots
:
public
slots
:
void
home
();
void
home
();
void
setGridSize
(
int
size
){
gridSize
=
size
;}
void
setGridStepSize
(
int
size
){
gridStepSize
=
size
;}
void
showGrid
(
bool
bo
){
isGridEnabled
=
bo
;}
public
:
public
:
GLView
(
Scene
*
scene
,
Camera
*
camera
,
Controler
*
controler
);
GLView
(
Scene
*
scene
,
Camera
*
camera
,
Controler
*
controler
);
void
setHome
(
QQuaternion
*
rotation
,
QVector3D
*
translation
);
void
setHome
(
QQuaternion
*
rotation
,
QVector3D
*
translation
);
...
@@ -47,9 +51,9 @@ private:
...
@@ -47,9 +51,9 @@ private:
GLdouble
aspect
;
GLdouble
aspect
;
GLuint
fbo
;
GLuint
fbo
;
GLuint
color
;
GLuint
color
;
GLuint
picID
;
GLuint
picID
;
GLuint
depth
;
GLuint
depth
;
void
drawGrid
();
void
drawGrid
();
void
initShader
();
void
initShader
();
...
...
A2/mainwindow.cpp
View file @
8ece7716
...
@@ -175,6 +175,42 @@ MainWindow::MainWindow(QWidget *parent)
...
@@ -175,6 +175,42 @@ MainWindow::MainWindow(QWidget *parent)
primitivesMenu
->
addAction
(
groupAdd
);
primitivesMenu
->
addAction
(
groupAdd
);
primitivesMenu
->
addAction
(
activeDelete
);
primitivesMenu
->
addAction
(
activeDelete
);
showGridButton
=
new
QToolButton
(
toolBar
);
showGridButton
->
setCheckable
(
true
);
gridSizeInput
=
new
QSpinBox
(
toolBar
);
gridSizeInput
->
setRange
(
0
,
100
);
gridSizeInput
->
setValue
(
5
);
gridSizeInput
->
setToolTip
(
"Grid Size"
);
gridStepInput
=
new
QSpinBox
(
toolBar
);
gridStepInput
->
setRange
(
1
,
10
);
gridStepInput
->
setToolTip
(
"Grid Step Size"
);
connect
(
gridSizeInput
,
SIGNAL
(
valueChanged
(
int
)),
perspectiveView
,
SLOT
(
setGridSize
(
int
)));
connect
(
gridStepInput
,
SIGNAL
(
valueChanged
(
int
)),
perspectiveView
,
SLOT
(
setGridStepSize
(
int
)));
connect
(
showGridButton
,
SIGNAL
(
clicked
(
bool
)),
perspectiveView
,
SLOT
(
showGrid
(
bool
)));
connect
(
gridSizeInput
,
SIGNAL
(
valueChanged
(
int
)),
topView
,
SLOT
(
setGridSize
(
int
)));
connect
(
gridStepInput
,
SIGNAL
(
valueChanged
(
int
)),
topView
,
SLOT
(
setGridStepSize
(
int
)));
connect
(
showGridButton
,
SIGNAL
(
clicked
(
bool
)),
topView
,
SLOT
(
showGrid
(
bool
)));
connect
(
gridSizeInput
,
SIGNAL
(
valueChanged
(
int
)),
leftView
,
SLOT
(
setGridSize
(
int
)));
connect
(
gridStepInput
,
SIGNAL
(
valueChanged
(
int
)),
leftView
,
SLOT
(
setGridStepSize
(
int
)));
connect
(
showGridButton
,
SIGNAL
(
clicked
(
bool
)),
leftView
,
SLOT
(
showGrid
(
bool
)));
connect
(
gridSizeInput
,
SIGNAL
(
valueChanged
(
int
)),
frontView
,
SLOT
(
setGridSize
(
int
)));
connect
(
gridStepInput
,
SIGNAL
(
valueChanged
(
int
)),
frontView
,
SLOT
(
setGridStepSize
(
int
)));
connect
(
showGridButton
,
SIGNAL
(
clicked
(
bool
)),
frontView
,
SLOT
(
showGrid
(
bool
)));
connect
(
gridSizeInput
,
SIGNAL
(
valueChanged
(
int
)),
this
,
SLOT
(
updateGL
()));
connect
(
gridStepInput
,
SIGNAL
(
valueChanged
(
int
)),
this
,
SLOT
(
updateGL
()));
connect
(
showGridButton
,
SIGNAL
(
clicked
(
bool
)),
this
,
SLOT
(
updateGL
()));
// Assemble Menus
// Assemble Menus
fileMenu
->
addAction
(
exitAction
);
fileMenu
->
addAction
(
exitAction
);
...
@@ -192,6 +228,12 @@ MainWindow::MainWindow(QWidget *parent)
...
@@ -192,6 +228,12 @@ MainWindow::MainWindow(QWidget *parent)
toolBar
->
addAction
(
camHome
);
toolBar
->
addAction
(
camHome
);
toolBar
->
addSeparator
();
toolBar
->
addSeparator
();
toolBar
->
addWidget
(
showGridButton
);
toolBar
->
addWidget
(
gridSizeInput
);
toolBar
->
addWidget
(
gridStepInput
);
toolBar
->
addSeparator
();
QToolButton
*
toolButton
=
new
QToolButton
();
QToolButton
*
toolButton
=
new
QToolButton
();
toolButton
->
setIcon
(
QIcon
(
":/img/viewports.png"
));
toolButton
->
setIcon
(
QIcon
(
":/img/viewports.png"
));
...
@@ -215,6 +257,8 @@ MainWindow::MainWindow(QWidget *parent)
...
@@ -215,6 +257,8 @@ MainWindow::MainWindow(QWidget *parent)
addToolBar
(
toolBar
);
addToolBar
(
toolBar
);
scene
->
simpleScene
();
scene
->
simpleScene
();
setStatusBar
(
statusBar
);
setStatusBar
(
statusBar
);
initDoc
();
initDoc
();
...
...
A2/mainwindow.h
View file @
8ece7716
...
@@ -71,6 +71,11 @@ private:
...
@@ -71,6 +71,11 @@ private:
QTreeView
*
sceneView
;
QTreeView
*
sceneView
;
QSpinBox
*
gridSizeInput
;
QSpinBox
*
gridStepInput
;
QToolButton
*
showGridButton
;
void
initDoc
();
void
initDoc
();
public
:
public
:
...
...
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