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
160c9d62
Commit
160c9d62
authored
Jul 02, 2013
by
Guillaume Seguin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Start cleaning up stlview
parent
1921d2ab
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
11 deletions
+8
-11
gcview.py
printrun/gcview.py
+0
-1
stlview.py
printrun/stlview.py
+8
-10
No files found.
printrun/gcview.py
View file @
160c9d62
...
...
@@ -67,7 +67,6 @@ class wxGLPanel(wx.Panel):
def
processSizeEvent
(
self
,
event
):
'''Process the resize event.'''
size
=
self
.
GetClientSize
()
self
.
winsize
=
(
size
.
width
,
size
.
height
)
self
.
width
,
self
.
height
=
size
.
width
,
size
.
height
if
(
wx
.
VERSION
>
(
2
,
9
)
and
self
.
canvas
.
IsShownOnScreen
())
or
self
.
canvas
.
GetContext
():
# Make sure the frame is shown before calling SetCurrent.
...
...
printrun/stlview.py
View file @
160c9d62
...
...
@@ -47,10 +47,10 @@ class GLPanel(wx.Panel):
# Create the canvas
self
.
sizer
=
wx
.
BoxSizer
(
wx
.
HORIZONTAL
)
self
.
canvas
=
glcanvas
.
GLCanvas
(
self
,
attribList
=
attribList
)
self
.
context
=
glcanvas
.
GLContext
(
self
.
canvas
)
self
.
sizer
.
Add
(
self
.
canvas
,
1
,
wx
.
EXPAND
)
self
.
SetSizer
(
self
.
sizer
)
#self.sizer.Fit(self)
self
.
Layout
()
self
.
sizer
.
Fit
(
self
)
# bind events
self
.
canvas
.
Bind
(
wx
.
EVT_ERASE_BACKGROUND
,
self
.
processEraseBackgroundEvent
)
...
...
@@ -77,20 +77,18 @@ class GLPanel(wx.Panel):
def
processSizeEvent
(
self
,
event
):
'''Process the resize event.'''
if
self
.
canvas
.
GetContext
():
size
=
self
.
GetClientSize
()
self
.
width
,
self
.
height
=
size
.
width
,
size
.
height
if
(
wx
.
VERSION
>
(
2
,
9
)
and
self
.
canvas
.
IsShownOnScreen
())
or
self
.
canvas
.
GetContext
():
# Make sure the frame is shown before calling SetCurrent.
self
.
Show
()
self
.
canvas
.
SetCurrent
()
size
=
self
.
GetGLExtents
()
self
.
winsize
=
(
size
.
width
,
size
.
height
)
self
.
width
,
self
.
height
=
size
.
width
,
size
.
height
self
.
canvas
.
SetCurrent
(
self
.
context
)
self
.
OnReshape
(
size
.
width
,
size
.
height
)
self
.
canvas
.
Refresh
(
False
)
event
.
Skip
()
def
processPaintEvent
(
self
,
event
):
'''Process the drawing event.'''
self
.
canvas
.
SetCurrent
()
self
.
canvas
.
SetCurrent
(
self
.
context
)
# This is a 'perfect' time to initialize OpenGL ... only if we need to
if
not
self
.
GLinitialized
:
...
...
@@ -180,7 +178,7 @@ class GLPanel(wx.Panel):
def
OnDraw
(
self
,
*
args
,
**
kwargs
):
"""Draw the window."""
#clear the context
self
.
canvas
.
SetCurrent
()
self
.
canvas
.
SetCurrent
(
self
.
context
)
self
.
pygletcontext
.
set_current
()
glClear
(
GL_COLOR_BUFFER_BIT
|
GL_DEPTH_BUFFER_BIT
)
#draw objects
...
...
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