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
38138692
Commit
38138692
authored
Nov 22, 2015
by
Alisa Jung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed delete bug
parent
10d649c3
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
10 additions
and
5 deletions
+10
-5
controller.cpp
helloqube/controller.cpp
+5
-2
myglwidget.cpp
helloqube/myglwidget.cpp
+0
-2
rigidbodytransformation.cpp
helloqube/rigidbodytransformation.cpp
+2
-1
scenegraph.cpp
helloqube/scenegraph.cpp
+1
-0
treeitem.cpp
helloqube/treeitem.cpp
+2
-0
No files found.
helloqube/controller.cpp
View file @
38138692
...
...
@@ -264,8 +264,11 @@ void Controller::selectTransform(RigidBodyTransformation *rbt){
void
Controller
::
itemSelected
(
QModelIndex
q
){
qDebug
()
<<
"item selected. Row: "
<<
q
.
row
()
<<
", column: "
<<
q
.
column
();
qDebug
(
"try to retrieve rbt"
);
TreeItem
*
t
=
scene
->
getItem
(
q
);
if
(
t
->
childNumber
()
==
0
)
t
=
t
->
getParent
();
if
(
t
->
getChildrenCount
()
==
0
)
{
qDebug
()
<<
"Clicked item "
<<
t
->
data
(
0
)
<<
" is leaf. get parent transform."
;
t
=
t
->
getParent
();
//Primitive haben keine Kinder.
}
selectTransform
(
static_cast
<
RigidBodyTransformation
*>
(
t
));
qDebug
()
<<
"selected name "
<<
t
->
data
(
0
);
}
helloqube/myglwidget.cpp
View file @
38138692
...
...
@@ -173,7 +173,6 @@ void MyGLWidget::paintGL(){
Primitive
*
p
=
(
*
i
)
->
getChildPrimitive
();
int
tesselation
=
p
->
getTesselation
();
Primitive
::
Type
type
=
p
->
getType
();
qDebug
()
<<
"draw type "
<<
type
;
if
(
type
==
Primitive
::
Type
::
SPHERE
){
drawSphere
(
tesselation
);
}
else
if
(
type
==
Primitive
::
Type
::
BOX
){
...
...
@@ -276,7 +275,6 @@ void MyGLWidget::keyPressEvent(QKeyEvent* event){
void
MyGLWidget
::
keyReleaseEvent
(
QKeyEvent
*
event
){
if
(
event
->
key
()
==
Qt
::
Key_Control
){
controller
->
setCtrlPressed
(
false
);
qDebug
(
"ctrl released"
);
}
}
...
...
helloqube/rigidbodytransformation.cpp
View file @
38138692
...
...
@@ -46,6 +46,7 @@ void RigidBodyTransformation::setRotation(QQuaternion newRotation){
Primitive
*
RigidBodyTransformation
::
getChildPrimitive
(){
if
(
children
.
length
()
>
0
){
return
static_cast
<
Primitive
*>
(
children
[
0
]);
//TODO aufpassen falls höhere tiefe
}
else
{
qDebug
(
"WAAAH - RBT has no chilren."
);
}
qDebug
(
"WAAAH"
);
}
helloqube/scenegraph.cpp
View file @
38138692
...
...
@@ -94,6 +94,7 @@ RigidBodyTransformation* SceneGraph::addPrimitive(Primitive* p){
RigidBodyTransformation
*
r
=
new
RigidBodyTransformation
();
nodes
.
append
(
r
);
model
->
addNewTransformToRoot
(
r
,
p
);
qDebug
()
<<
"added primitive to root. childlength: "
<<
r
->
getChildren
().
length
();
// model->insertRows(1,1,QModelIndex());
notifyViews
();
return
r
;
...
...
helloqube/treeitem.cpp
View file @
38138692
...
...
@@ -57,6 +57,8 @@ QVariant TreeItem::data(int column){
else
return
QVariant
(
"ERROR column index"
);
}
//OWN index.
int
TreeItem
::
childNumber
(){
if
(
parent
){
return
parent
->
getChildren
().
indexOf
(
this
);
...
...
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