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
1b4d8490
Commit
1b4d8490
authored
Jul 04, 2013
by
Guillaume Seguin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update zooming in stlview
parent
3486a5f4
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
16 deletions
+21
-16
panel.py
printrun/gl/panel.py
+11
-0
stlview.py
printrun/stlview.py
+10
-16
No files found.
printrun/gl/panel.py
View file @
1b4d8490
...
...
@@ -178,3 +178,14 @@ class wxGLPanel(wx.Panel):
glGetDoublev
(
GL_MODELVIEW_MATRIX
,
mvmat
)
gluUnProject
(
x
,
y
,
1.0
,
mvmat
,
pmat
,
viewport
,
px
,
py
,
pz
)
return
(
px
.
value
,
py
.
value
,
pz
.
value
)
def
zoom
(
self
,
factor
,
to
=
None
):
glMatrixMode
(
GL_MODELVIEW
)
if
to
:
delta_x
=
to
[
0
]
delta_y
=
to
[
1
]
glTranslatef
(
delta_x
,
delta_y
,
0
)
glScalef
(
factor
,
factor
,
1
)
if
to
:
glTranslatef
(
-
delta_x
,
-
delta_y
,
0
)
wx
.
CallAfter
(
self
.
Refresh
)
printrun/stlview.py
View file @
1b4d8490
...
...
@@ -231,27 +231,21 @@ class StlViewPanel(wxGLPanel):
rotate object
with shift zoom viewport
"""
z
=
event
.
GetWheelRotation
()
angle
=
10
delta
=
event
.
GetWheelRotation
()
if
not
event
.
ShiftDown
():
i
=
self
.
parent
.
l
.
GetSelection
()
if
i
<
0
:
try
:
self
.
parent
.
setlayerindex
(
z
)
except
:
pass
return
if
z
>
0
:
angle
=
10
if
delta
>
0
:
self
.
rotate_shape
(
angle
/
2
)
else
:
self
.
rotate_shape
(
-
angle
/
2
)
return
if
z
>
0
:
self
.
transv
[
2
]
+=
angle
else
:
self
.
transv
[
2
]
-=
angle
factor
=
1.05
x
,
y
=
event
.
GetPositionTuple
()
x
,
y
,
_
=
self
.
mouse_to_3d
(
x
,
y
)
if
delta
>
0
:
self
.
zoom
(
factor
,
(
x
,
y
))
else
:
self
.
zoom
(
1
/
factor
,
(
x
,
y
))
def
keypress
(
self
,
event
):
"""gets keypress events and moves/rotates acive shape"""
...
...
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