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
4e359fde
Commit
4e359fde
authored
Jul 25, 2013
by
Guillaume Seguin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move rotate_shape to Plater
parent
77ca068e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
15 deletions
+20
-15
objectplater.py
printrun/objectplater.py
+11
-0
stlview.py
printrun/stlview.py
+9
-15
No files found.
printrun/objectplater.py
View file @
4e359fde
...
@@ -118,6 +118,17 @@ class Plater(wx.Frame):
...
@@ -118,6 +118,17 @@ class Plater(wx.Frame):
]
]
return
True
return
True
def
rotate_shape
(
self
,
angle
):
"""rotates acive shape
positive angle is clockwise
"""
name
=
self
.
l
.
GetSelection
()
if
name
==
wx
.
NOT_FOUND
:
return
False
name
=
self
.
l
.
GetString
(
name
)
model
=
self
.
models
[
name
]
model
.
rot
+=
angle
def
autoplate
(
self
,
event
=
None
):
def
autoplate
(
self
,
event
=
None
):
print
_
(
"Autoplating"
)
print
_
(
"Autoplating"
)
separation
=
2
separation
=
2
...
...
printrun/stlview.py
View file @
4e359fde
...
@@ -164,17 +164,11 @@ class StlViewPanel(wxGLPanel):
...
@@ -164,17 +164,11 @@ class StlViewPanel(wxGLPanel):
elif
event
.
ButtonUp
(
wx
.
MOUSE_BTN_RIGHT
):
elif
event
.
ButtonUp
(
wx
.
MOUSE_BTN_RIGHT
):
if
self
.
initpos
is
not
None
:
if
self
.
initpos
is
not
None
:
self
.
initpos
=
None
self
.
initpos
=
None
else
:
def
rotate_shape
(
self
,
angle
):
event
.
Skip
()
"""rotates acive shape
return
positive angle is clockwise
event
.
Skip
()
"""
wx
.
CallAfter
(
self
.
Refresh
)
name
=
self
.
parent
.
l
.
GetSelection
()
if
name
==
wx
.
NOT_FOUND
:
return
False
name
=
self
.
parent
.
l
.
GetString
(
name
)
model
=
self
.
parent
.
models
[
name
]
model
.
rot
+=
angle
def
wheel
(
self
,
event
):
def
wheel
(
self
,
event
):
"""react to mouse wheel actions:
"""react to mouse wheel actions:
...
@@ -185,9 +179,9 @@ class StlViewPanel(wxGLPanel):
...
@@ -185,9 +179,9 @@ class StlViewPanel(wxGLPanel):
if
not
event
.
ShiftDown
():
if
not
event
.
ShiftDown
():
angle
=
10
angle
=
10
if
delta
>
0
:
if
delta
>
0
:
self
.
rotate_shape
(
angle
/
2
)
self
.
parent
.
rotate_shape
(
angle
/
2
)
else
:
else
:
self
.
rotate_shape
(
-
angle
/
2
)
self
.
parent
.
rotate_shape
(
-
angle
/
2
)
else
:
else
:
factor
=
1.05
factor
=
1.05
x
,
y
=
event
.
GetPositionTuple
()
x
,
y
=
event
.
GetPositionTuple
()
...
@@ -221,10 +215,10 @@ class StlViewPanel(wxGLPanel):
...
@@ -221,10 +215,10 @@ class StlViewPanel(wxGLPanel):
self
.
parent
.
move_shape
((
0
,
-
step
))
self
.
parent
.
move_shape
((
0
,
-
step
))
#[
#[
if
keycode
==
91
:
if
keycode
==
91
:
self
.
rotate_shape
(
-
angle
)
self
.
parent
.
rotate_shape
(
-
angle
)
#]
#]
if
keycode
==
93
:
if
keycode
==
93
:
self
.
rotate_shape
(
angle
)
self
.
parent
.
rotate_shape
(
angle
)
event
.
Skip
()
event
.
Skip
()
wx
.
CallAfter
(
self
.
Refresh
)
wx
.
CallAfter
(
self
.
Refresh
)
...
...
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