Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
P
Printrun
Project
Project
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
machinery
Printrun
Commits
1a888baa
Commit
1a888baa
authored
Jul 04, 2013
by
Guillaume Seguin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleanup translation handling in stlview
parent
c312d850
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
22 deletions
+12
-22
stlview.py
printrun/stlview.py
+12
-22
No files found.
printrun/stlview.py
View file @
1a888baa
...
@@ -176,13 +176,12 @@ class StlViewPanel(wxGLPanel):
...
@@ -176,13 +176,12 @@ class StlViewPanel(wxGLPanel):
self
.
initpos
=
event
.
GetPositionTuple
()
self
.
initpos
=
event
.
GetPositionTuple
()
else
:
else
:
if
not
event
.
ShiftDown
():
if
not
event
.
ShiftDown
():
currentpos
=
event
.
GetPositionTuple
()
p1
=
self
.
initpos
delta
=
(
p2
=
event
.
GetPositionTuple
()
(
currentpos
[
0
]
-
self
.
initpos
[
0
]),
x1
,
y1
,
_
=
self
.
mouse_to_3d
(
p1
[
0
],
p1
[
1
])
-
(
currentpos
[
1
]
-
self
.
initpos
[
1
])
x2
,
y2
,
_
=
self
.
mouse_to_3d
(
p2
[
0
],
p2
[
1
])
)
self
.
move_shape
((
x2
-
x1
,
y2
-
y1
))
self
.
move_shape
(
delta
)
self
.
initpos
=
p2
self
.
initpos
=
None
return
return
p1
=
self
.
initpos
p1
=
self
.
initpos
p2
=
event
.
GetPositionTuple
()
p2
=
event
.
GetPositionTuple
()
...
@@ -208,14 +207,12 @@ class StlViewPanel(wxGLPanel):
...
@@ -208,14 +207,12 @@ class StlViewPanel(wxGLPanel):
else
:
else
:
p1
=
self
.
initpos
p1
=
self
.
initpos
p2
=
event
.
GetPositionTuple
()
p2
=
event
.
GetPositionTuple
()
sz
=
self
.
GetClientSize
()
if
self
.
orthographic
:
p1
=
list
(
p1
)
x1
,
y1
,
_
=
self
.
mouse_to_3d
(
p1
[
0
],
p1
[
1
])
p2
=
list
(
p2
)
x2
,
y2
,
_
=
self
.
mouse_to_3d
(
p2
[
0
],
p2
[
1
])
p1
[
1
]
*=
-
1
glTranslatef
(
x2
-
x1
,
y2
-
y1
,
0
)
p2
[
1
]
*=
-
1
else
:
glTranslatef
(
p2
[
0
]
-
p1
[
0
],
-
(
p2
[
1
]
-
p1
[
1
]),
0
)
self
.
transv
=
map
(
lambda
x
,
y
,
z
,
c
:
c
-
self
.
dist
*
(
x
-
y
)
/
z
,
list
(
p1
)
+
[
0
],
list
(
p2
)
+
[
0
],
list
(
sz
)
+
[
1
],
self
.
transv
)
self
.
initpos
=
p2
self
.
initpos
=
p2
def
rotate_shape
(
self
,
angle
):
def
rotate_shape
(
self
,
angle
):
...
@@ -256,13 +253,6 @@ class StlViewPanel(wxGLPanel):
...
@@ -256,13 +253,6 @@ class StlViewPanel(wxGLPanel):
else
:
else
:
self
.
transv
[
2
]
-=
angle
self
.
transv
[
2
]
-=
angle
glLoadIdentity
()
glTranslatef
(
*
self
.
transv
)
if
(
self
.
rot
):
glMultMatrixd
(
build_rotmatrix
(
self
.
basequat
))
glGetDoublev
(
GL_MODELVIEW_MATRIX
,
self
.
mvmat
)
self
.
rot
=
1
def
keypress
(
self
,
event
):
def
keypress
(
self
,
event
):
"""gets keypress events and moves/rotates acive shape"""
"""gets keypress events and moves/rotates acive shape"""
keycode
=
event
.
GetKeyCode
()
keycode
=
event
.
GetKeyCode
()
...
...
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