Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
grapa_alisa
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
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Alisa Jung
grapa_alisa
Commits
bcc14a79
Commit
bcc14a79
authored
Nov 22, 2015
by
Alisa Jung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
still compiling
parent
18280c79
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
1 deletion
+23
-1
mainwindow.cpp
helloqube/mainwindow.cpp
+6
-0
mainwindow.h
helloqube/mainwindow.h
+5
-1
scenegraph.cpp
helloqube/scenegraph.cpp
+5
-0
scenegraph.h
helloqube/scenegraph.h
+7
-0
No files found.
helloqube/mainwindow.cpp
View file @
bcc14a79
...
@@ -242,6 +242,12 @@ MainWindow::MainWindow(QWidget *parent)
...
@@ -242,6 +242,12 @@ MainWindow::MainWindow(QWidget *parent)
connect
(
deletePrimitive
,
SIGNAL
(
triggered
(
bool
)),
controller
,
SLOT
(
deletePrimitive
()));
connect
(
deletePrimitive
,
SIGNAL
(
triggered
(
bool
)),
controller
,
SLOT
(
deletePrimitive
()));
deletePrimitive
->
setShortcut
(
QKeySequence
(
Qt
::
Key_Delete
));
deletePrimitive
->
setShortcut
(
QKeySequence
(
Qt
::
Key_Delete
));
treeView
=
new
QTreeView
(
this
);
treeView
->
setModel
(
controller
->
getSceneGraph
()
->
getModel
());
treeView
->
expandAll
();
}
}
...
...
helloqube/mainwindow.h
View file @
bcc14a79
...
@@ -16,7 +16,9 @@
...
@@ -16,7 +16,9 @@
#include <controller.h>
#include <controller.h>
#include <QLayout>
#include <QLayout>
#include <QSplitter>
#include <QSplitter>
#include <QTreeView>
#include <scenegraph.h>
#include <myitemmodel.h>
class
MainWindow
:
public
QMainWindow
class
MainWindow
:
public
QMainWindow
{
{
Q_OBJECT
Q_OBJECT
...
@@ -87,6 +89,8 @@ private:
...
@@ -87,6 +89,8 @@ private:
QAction
*
deletePrimitive
;
QAction
*
deletePrimitive
;
QTreeView
*
treeView
;
public
slots
:
public
slots
:
void
showAboutBox
(
)
;
void
showAboutBox
(
)
;
};
};
...
...
helloqube/scenegraph.cpp
View file @
bcc14a79
...
@@ -13,6 +13,7 @@ SceneGraph::SceneGraph()
...
@@ -13,6 +13,7 @@ SceneGraph::SceneGraph()
coneIndex
=
1
;
coneIndex
=
1
;
torusIndex
=
1
;
torusIndex
=
1
;
model
=
new
MyItemModel
;
}
}
//Scenegraph gets a list of all views it needs to notify on changes
//Scenegraph gets a list of all views it needs to notify on changes
...
@@ -20,6 +21,10 @@ void SceneGraph::registerView(MyGLWidget* view){
...
@@ -20,6 +21,10 @@ void SceneGraph::registerView(MyGLWidget* view){
views
.
append
(
view
);
views
.
append
(
view
);
}
}
MyItemModel
*
SceneGraph
::
getModel
(){
return
model
;
}
//add primitives to sceneGraph
//add primitives to sceneGraph
RigidBodyTransformation
*
SceneGraph
::
addSphere
(
int
tesselation
){
RigidBodyTransformation
*
SceneGraph
::
addSphere
(
int
tesselation
){
nextSphereName
=
"Sphere "
;
nextSphereName
=
"Sphere "
;
...
...
helloqube/scenegraph.h
View file @
bcc14a79
...
@@ -4,6 +4,7 @@
...
@@ -4,6 +4,7 @@
#include <QList>
#include <QList>
#include <rigidbodytransformation.h>
#include <rigidbodytransformation.h>
#include <QString>
#include <QString>
#include <myitemmodel.h>
class
MyGLWidget
;
class
MyGLWidget
;
...
@@ -30,6 +31,9 @@ public:
...
@@ -30,6 +31,9 @@ public:
//automatically selects last added primitive. if none left, selects 0.
//automatically selects last added primitive. if none left, selects 0.
RigidBodyTransformation
*
deleteNode
(
RigidBodyTransformation
*
r
);
RigidBodyTransformation
*
deleteNode
(
RigidBodyTransformation
*
r
);
MyItemModel
*
getModel
();
//Hallo. Todos:
//Hallo. Todos:
//Log selected name in status bar
//Log selected name in status bar
//add remaining primitive types
//add remaining primitive types
...
@@ -56,6 +60,9 @@ private:
...
@@ -56,6 +60,9 @@ private:
QList
<
MyGLWidget
*>
views
;
QList
<
MyGLWidget
*>
views
;
MyItemModel
*
model
;
};
};
#endif // SCENEGRAPH_H
#endif // SCENEGRAPH_H
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