Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
openstructure
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
schwede
openstructure
Commits
c5ec3483
Commit
c5ec3483
authored
12 years ago
by
Tobias Schmidt
Browse files
Options
Downloads
Patches
Plain Diff
allow SpaceExplorer sensitivity to be changed by +/- buttons (fixes BZDNG-105)
parent
b6dae426
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/gui/pymod/init_spacenav.py
+18
-7
18 additions, 7 deletions
modules/gui/pymod/init_spacenav.py
with
18 additions
and
7 deletions
modules/gui/pymod/init_spacenav.py
+
18
−
7
View file @
c5ec3483
...
@@ -11,17 +11,18 @@ class SpacenavControl(QtCore.QObject):
...
@@ -11,17 +11,18 @@ class SpacenavControl(QtCore.QObject):
self
.
trans
=
True
self
.
trans
=
True
self
.
rot
=
True
self
.
rot
=
True
self
.
speed
=
480.0
def
Changed
(
self
,
tx
,
ty
,
tz
,
rx
,
ry
,
rz
):
def
Changed
(
self
,
tx
,
ty
,
tz
,
rx
,
ry
,
rz
):
transf
=
gfx
.
Scene
().
GetTransform
()
transf
=
gfx
.
Scene
().
GetTransform
()
if
(
self
.
trans
):
if
(
self
.
trans
):
transf
.
ApplyXAxisTranslation
(
tx
/
480.0
)
transf
.
ApplyXAxisTranslation
(
tx
/
self
.
speed
)
transf
.
ApplyYAxisTranslation
(
ty
/
480.0
)
transf
.
ApplyYAxisTranslation
(
ty
/
self
.
speed
)
transf
.
ApplyZAxisTranslation
(
-
tz
/
480.0
)
transf
.
ApplyZAxisTranslation
(
-
tz
/
self
.
speed
)
if
(
self
.
rot
):
if
(
self
.
rot
):
transf
.
ApplyXAxisRotation
(
rx
/
480.0
)
transf
.
ApplyXAxisRotation
(
rx
/
self
.
speed
)
transf
.
ApplyYAxisRotation
(
ry
/
480.0
)
transf
.
ApplyYAxisRotation
(
ry
/
self
.
speed
)
transf
.
ApplyZAxisRotation
(
rz
/
480.0
)
transf
.
ApplyZAxisRotation
(
rz
/
self
.
speed
)
gfx
.
Scene
().
SetTransform
(
transf
)
gfx
.
Scene
().
SetTransform
(
transf
)
gfx
.
Scene
().
RequestRedraw
()
gfx
.
Scene
().
RequestRedraw
()
...
@@ -32,6 +33,16 @@ class SpacenavControl(QtCore.QObject):
...
@@ -32,6 +33,16 @@ class SpacenavControl(QtCore.QObject):
elif
button
==
1
:
elif
button
==
1
:
self
.
rot
=
not
self
.
rot
self
.
rot
=
not
self
.
rot
print
"
Rotation Enabled:
"
,
self
.
rot
print
"
Rotation Enabled:
"
,
self
.
rot
elif
button
==
12
:
if
self
.
speed
>
20
:
self
.
speed
*=
0.8
print
"
Speed Increased:
"
,
self
.
speed
elif
button
==
13
:
self
.
speed
/=
0.8
print
"
Speed Reduced:
"
,
self
.
speed
else
:
print
"
other:
"
,
button
def
_InitSpaceNav
(
app
):
def
_InitSpaceNav
(
app
):
try
:
try
:
...
@@ -40,4 +51,4 @@ def _InitSpaceNav(app):
...
@@ -40,4 +51,4 @@ def _InitSpaceNav(app):
parent
=
app
.
gl_win
.
qobject
parent
=
app
.
gl_win
.
qobject
SpacenavControl
(
spnav
,
parent
)
SpacenavControl
(
spnav
,
parent
)
except
AttributeError
:
except
AttributeError
:
pass
pass
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment