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
c4814ea9
Commit
c4814ea9
authored
Nov 22, 2015
by
Kai Westerkamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
move fix multiple groups
parent
49ce7bd6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
22 additions
and
4 deletions
+22
-4
controler.cpp
A2/controler.cpp
+1
-1
mainwindow.cpp
A2/mainwindow.cpp
+0
-1
scene.cpp
A2/scene.cpp
+5
-1
scenenode.h
A2/scenenode.h
+1
-0
sceneobject.cpp
A2/sceneobject.cpp
+13
-1
sceneobject.h
A2/sceneobject.h
+2
-0
No files found.
A2/controler.cpp
View file @
c4814ea9
...
@@ -112,7 +112,7 @@ void Controler::move(QPointF * newPos){
...
@@ -112,7 +112,7 @@ void Controler::move(QPointF * newPos){
activeView
->
getCamera
()
->
move
(
QVector3D
(
dx
,
dy
,
0.0
));
activeView
->
getCamera
()
->
move
(
QVector3D
(
dx
,
dy
,
0.0
));
}
else
if
((
viewMode
==
EDIT
)
^
ctrlPressed
){
}
else
if
((
viewMode
==
EDIT
)
^
ctrlPressed
){
QVector3D
vec
=
activeView
->
getCamera
()
->
rotation
->
conjugate
().
rotatedVector
(
QVector3D
(
dx
,
dy
,
0.0
));
QVector3D
vec
=
activeView
->
getCamera
()
->
rotation
->
conjugate
().
rotatedVector
(
QVector3D
(
dx
,
dy
,
0.0
));
scene
->
moveActive
(
vec
);
scene
->
moveActive
(
vec
);
}
else
{
}
else
{
qDebug
()
<<
"möp"
<<
viewMode
<<
" "
<<
CAMERA
<<
" "
<<
EDIT
;
qDebug
()
<<
"möp"
<<
viewMode
<<
" "
<<
CAMERA
<<
" "
<<
EDIT
;
}
}
...
...
A2/mainwindow.cpp
View file @
c4814ea9
...
@@ -158,7 +158,6 @@ MainWindow::MainWindow(QWidget *parent)
...
@@ -158,7 +158,6 @@ MainWindow::MainWindow(QWidget *parent)
torusAdd
->
setIcon
(
QIcon
(
":/img/torus.png"
));
torusAdd
->
setIcon
(
QIcon
(
":/img/torus.png"
));
connect
(
torusAdd
,
SIGNAL
(
triggered
()),
scene
,
SLOT
(
addTorus
()));
connect
(
torusAdd
,
SIGNAL
(
triggered
()),
scene
,
SLOT
(
addTorus
()));
qDebug
()
<<
"Test"
;
groupAdd
=
new
QAction
(
"Group"
,
this
);
groupAdd
=
new
QAction
(
"Group"
,
this
);
groupAdd
->
setIcon
(
QIcon
(
":/img/wireframe.png"
));
groupAdd
->
setIcon
(
QIcon
(
":/img/wireframe.png"
));
connect
(
groupAdd
,
SIGNAL
(
triggered
()),
scene
,
SLOT
(
addNode
()));
connect
(
groupAdd
,
SIGNAL
(
triggered
()),
scene
,
SLOT
(
addNode
()));
...
...
A2/scene.cpp
View file @
c4814ea9
...
@@ -120,11 +120,15 @@ void Scene::deletActive()
...
@@ -120,11 +120,15 @@ void Scene::deletActive()
QModelIndex
parentIndex
=
activeIndex
.
parent
();
QModelIndex
parentIndex
=
activeIndex
.
parent
();
SceneNode
*
parent
=
static_cast
<
SceneNode
*>
(
active
->
getParent
());
SceneNode
*
parent
=
static_cast
<
SceneNode
*>
(
active
->
getParent
());
active
->
childNumber
();
int
number
=
active
->
childNumber
();
int
number
=
active
->
childNumber
();
beginRemoveColumns
(
parentIndex
,
number
,
number
);
beginRemoveColumns
(
parentIndex
,
number
,
number
);
parent
->
remove
(
number
);
parent
->
remove
(
number
);
endRemoveColumns
();
endRemoveColumns
();
active
=
parent
;
activeIndex
=
parentIndex
;
emit
activChanged
();
}
}
...
...
A2/scenenode.h
View file @
c4814ea9
...
@@ -24,6 +24,7 @@ public:
...
@@ -24,6 +24,7 @@ public:
void
draw
();
void
draw
();
void
add
(
SceneObject
*
child
);
void
add
(
SceneObject
*
child
);
void
remove
(
int
number
);
void
remove
(
int
number
);
};
};
#endif // SCENENODE_H
#endif // SCENENODE_H
A2/sceneobject.cpp
View file @
c4814ea9
...
@@ -7,6 +7,7 @@ SceneObject::SceneObject()
...
@@ -7,6 +7,7 @@ SceneObject::SceneObject()
name
=
QString
(
"Scene Object "
+
id
);
name
=
QString
(
"Scene Object "
+
id
);
rotation
=
QQuaternion
();
rotation
=
QQuaternion
();
translation
=
QVector3D
();
translation
=
QVector3D
();
parent
=
NULL
;
}
}
...
@@ -65,11 +66,22 @@ int SceneObject::getID(){return id;}
...
@@ -65,11 +66,22 @@ int SceneObject::getID(){return id;}
QString
SceneObject
::
getName
(){
return
name
;}
QString
SceneObject
::
getName
(){
return
name
;}
QQuaternion
SceneObject
::
getGlobalRotation
(){
qDebug
()
<<
this
->
getName
()
<<
" "
<<
parent
;
if
(
parent
==
NULL
)
return
QQuaternion
();
else
return
parent
->
getGlobalRotation
()
*
rotation
;
}
void
SceneObject
::
move
(
QVector3D
dir
)
void
SceneObject
::
move
(
QVector3D
dir
)
{
{
translation
+=
dir
;
QQuaternion
rot
=
parent
->
getGlobalRotation
();
qDebug
()
<<
rot
;
translation
+=
rot
.
conjugate
().
rotatedVector
(
dir
);
}
}
void
SceneObject
::
rotate
(
QQuaternion
rot
)
void
SceneObject
::
rotate
(
QQuaternion
rot
)
{
{
...
...
A2/sceneobject.h
View file @
c4814ea9
...
@@ -45,6 +45,8 @@ public:
...
@@ -45,6 +45,8 @@ public:
void
move
(
QVector3D
dir
);
void
move
(
QVector3D
dir
);
void
rotate
(
QQuaternion
rot
);
void
rotate
(
QQuaternion
rot
);
QQuaternion
getGlobalRotation
();
};
};
#endif // SCENEOBJECT_H
#endif // SCENEOBJECT_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