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
e18547b6
Commit
e18547b6
authored
Aug 03, 2011
by
kliment
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #43 from grevaillot/master
Plater.py : add delete object button.
parents
78e585e6
887eeb3d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
10 deletions
+19
-10
plater.py
plater.py
+19
-10
No files found.
plater.py
View file @
e18547b6
...
@@ -16,13 +16,15 @@ class stlwrap:
...
@@ -16,13 +16,15 @@ class stlwrap:
class
showstl
(
wx
.
Window
):
class
showstl
(
wx
.
Window
):
def
__init__
(
self
,
parent
,
size
,
pos
):
def
__init__
(
self
,
parent
,
size
,
pos
):
wx
.
Window
.
__init__
(
self
,
parent
,
size
=
size
,
pos
=
pos
)
wx
.
Window
.
__init__
(
self
,
parent
,
size
=
size
,
pos
=
pos
)
self
.
l
=
wx
.
ListCtrl
(
self
,
style
=
wx
.
LC_LIST
,
size
=
(
300
,
100
),
pos
=
(
0
,
size
[
1
]
-
100
))
self
.
l
=
wx
.
ListCtrl
(
self
,
style
=
wx
.
LC_LIST
,
size
=
(
300
,
130
),
pos
=
(
0
,
size
[
1
]
-
130
))
self
.
eb
=
wx
.
Button
(
self
,
label
=
"Export"
,
pos
=
(
300
,
size
[
1
]
-
100
))
self
.
eb
=
wx
.
Button
(
self
,
label
=
"Export"
,
pos
=
(
300
,
size
[
1
]
-
130
))
self
.
sb
=
wx
.
Button
(
self
,
label
=
"Snap to Z=0"
,
pos
=
(
300
,
size
[
1
]
-
70
))
self
.
sb
=
wx
.
Button
(
self
,
label
=
"Snap to Z=0"
,
pos
=
(
300
,
size
[
1
]
-
100
))
self
.
cb
=
wx
.
Button
(
self
,
label
=
"Put at 100,100"
,
pos
=
(
300
,
size
[
1
]
-
40
))
self
.
cb
=
wx
.
Button
(
self
,
label
=
"Put at 100,100"
,
pos
=
(
300
,
size
[
1
]
-
70
))
self
.
db
=
wx
.
Button
(
self
,
label
=
"Delete"
,
pos
=
(
300
,
size
[
1
]
-
40
))
self
.
eb
.
Bind
(
wx
.
EVT_BUTTON
,
self
.
export
)
self
.
eb
.
Bind
(
wx
.
EVT_BUTTON
,
self
.
export
)
self
.
sb
.
Bind
(
wx
.
EVT_BUTTON
,
self
.
snap
)
self
.
sb
.
Bind
(
wx
.
EVT_BUTTON
,
self
.
snap
)
self
.
cb
.
Bind
(
wx
.
EVT_BUTTON
,
self
.
center
)
self
.
cb
.
Bind
(
wx
.
EVT_BUTTON
,
self
.
center
)
self
.
db
.
Bind
(
wx
.
EVT_BUTTON
,
self
.
delete
)
#self.SetBackgroundColour((0,0,0))
#self.SetBackgroundColour((0,0,0))
#wx.FutureCall(200,self.paint)
#wx.FutureCall(200,self.paint)
self
.
i
=
0
self
.
i
=
0
...
@@ -36,14 +38,14 @@ class showstl(wx.Window):
...
@@ -36,14 +38,14 @@ class showstl(wx.Window):
self
.
basedir
=
"."
self
.
basedir
=
"."
self
.
initpos
=
None
self
.
initpos
=
None
self
.
prevsel
=-
1
self
.
prevsel
=-
1
def
center
(
self
,
event
):
def
center
(
self
,
event
):
i
=
self
.
l
.
GetFirstSelected
()
i
=
self
.
l
.
GetFirstSelected
()
if
i
!=
-
1
:
if
i
!=
-
1
:
m
=
self
.
models
[
self
.
l
.
GetItemText
(
i
)]
m
=
self
.
models
[
self
.
l
.
GetItemText
(
i
)]
m
.
offsets
=
[
100
,
100
,
m
.
offsets
[
2
]]
m
.
offsets
=
[
100
,
100
,
m
.
offsets
[
2
]]
self
.
Refresh
()
self
.
Refresh
()
def
snap
(
self
,
event
):
def
snap
(
self
,
event
):
i
=
self
.
l
.
GetFirstSelected
()
i
=
self
.
l
.
GetFirstSelected
()
if
i
!=
-
1
:
if
i
!=
-
1
:
...
@@ -51,8 +53,15 @@ class showstl(wx.Window):
...
@@ -51,8 +53,15 @@ class showstl(wx.Window):
m
.
offsets
[
2
]
=-
1.0
*
min
(
m
.
facetsminz
)[
0
]
m
.
offsets
[
2
]
=-
1.0
*
min
(
m
.
facetsminz
)[
0
]
#print m.offsets[2]
#print m.offsets[2]
self
.
Refresh
()
self
.
Refresh
()
def
delete
(
self
,
event
):
i
=
self
.
l
.
GetFirstSelected
()
if
i
!=
-
1
:
del
self
.
models
[
self
.
l
.
GetItemText
(
i
)]
self
.
l
.
DeleteItem
(
i
)
self
.
l
.
Select
(
self
.
l
.
GetItemCount
()
-
1
)
self
.
Refresh
()
def
export
(
self
,
event
):
def
export
(
self
,
event
):
dlg
=
wx
.
FileDialog
(
self
,
"Pick file to save to"
,
self
.
basedir
,
style
=
wx
.
FD_SAVE
)
dlg
=
wx
.
FileDialog
(
self
,
"Pick file to save to"
,
self
.
basedir
,
style
=
wx
.
FD_SAVE
)
dlg
.
SetWildcard
(
"STL files (;*.stl;)"
)
dlg
.
SetWildcard
(
"STL files (;*.stl;)"
)
...
@@ -182,11 +191,11 @@ class showstl(wx.Window):
...
@@ -182,11 +191,11 @@ class showstl(wx.Window):
#s.export()
#s.export()
class
stlwin
(
wx
.
Frame
):
class
stlwin
(
wx
.
Frame
):
def
__init__
(
self
,
size
=
(
400
,
5
0
0
)):
def
__init__
(
self
,
size
=
(
400
,
5
3
0
)):
wx
.
Frame
.
__init__
(
self
,
None
,
title
=
"Right-click to add a file"
,
size
=
size
)
wx
.
Frame
.
__init__
(
self
,
None
,
title
=
"Right-click to add a file"
,
size
=
size
)
self
.
SetIcon
(
wx
.
Icon
(
"plater.ico"
,
wx
.
BITMAP_TYPE_ICO
))
self
.
SetIcon
(
wx
.
Icon
(
"plater.ico"
,
wx
.
BITMAP_TYPE_ICO
))
self
.
SetClientSize
(
size
)
self
.
SetClientSize
(
size
)
self
.
s
=
showstl
(
self
,(
400
,
5
0
0
),(
0
,
0
))
self
.
s
=
showstl
(
self
,(
400
,
5
3
0
),(
0
,
0
))
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
app
=
wx
.
App
(
False
)
app
=
wx
.
App
(
False
)
...
...
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