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
Show 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):
...
@@ -67,7 +67,6 @@ class wxGLPanel(wx.Panel):
def
processSizeEvent
(
self
,
event
):
def
processSizeEvent
(
self
,
event
):
'''Process the resize event.'''
'''Process the resize event.'''
size
=
self
.
GetClientSize
()
size
=
self
.
GetClientSize
()
self
.
winsize
=
(
size
.
width
,
size
.
height
)
self
.
width
,
self
.
height
=
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
():
if
(
wx
.
VERSION
>
(
2
,
9
)
and
self
.
canvas
.
IsShownOnScreen
())
or
self
.
canvas
.
GetContext
():
# Make sure the frame is shown before calling SetCurrent.
# Make sure the frame is shown before calling SetCurrent.
...
...
printrun/stlview.py
View file @
160c9d62
...
@@ -47,10 +47,10 @@ class GLPanel(wx.Panel):
...
@@ -47,10 +47,10 @@ class GLPanel(wx.Panel):
# Create the canvas
# Create the canvas
self
.
sizer
=
wx
.
BoxSizer
(
wx
.
HORIZONTAL
)
self
.
sizer
=
wx
.
BoxSizer
(
wx
.
HORIZONTAL
)
self
.
canvas
=
glcanvas
.
GLCanvas
(
self
,
attribList
=
attribList
)
self
.
canvas
=
glcanvas
.
GLCanvas
(
self
,
attribList
=
attribList
)
self
.
context
=
glcanvas
.
GLContext
(
self
.
canvas
)
self
.
sizer
.
Add
(
self
.
canvas
,
1
,
wx
.
EXPAND
)
self
.
sizer
.
Add
(
self
.
canvas
,
1
,
wx
.
EXPAND
)
self
.
SetSizer
(
self
.
sizer
)
self
.
SetSizer
(
self
.
sizer
)
#self.sizer.Fit(self)
self
.
sizer
.
Fit
(
self
)
self
.
Layout
()
# bind events
# bind events
self
.
canvas
.
Bind
(
wx
.
EVT_ERASE_BACKGROUND
,
self
.
processEraseBackgroundEvent
)
self
.
canvas
.
Bind
(
wx
.
EVT_ERASE_BACKGROUND
,
self
.
processEraseBackgroundEvent
)
...
@@ -77,20 +77,18 @@ class GLPanel(wx.Panel):
...
@@ -77,20 +77,18 @@ class GLPanel(wx.Panel):
def
processSizeEvent
(
self
,
event
):
def
processSizeEvent
(
self
,
event
):
'''Process the resize event.'''
'''Process the resize event.'''
if
self
.
canvas
.
GetContext
():
size
=
self
.
GetClientSize
()
# 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
.
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
.
canvas
.
SetCurrent
(
self
.
context
)
self
.
OnReshape
(
size
.
width
,
size
.
height
)
self
.
OnReshape
(
size
.
width
,
size
.
height
)
self
.
canvas
.
Refresh
(
False
)
self
.
canvas
.
Refresh
(
False
)
event
.
Skip
()
event
.
Skip
()
def
processPaintEvent
(
self
,
event
):
def
processPaintEvent
(
self
,
event
):
'''Process the drawing 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
# This is a 'perfect' time to initialize OpenGL ... only if we need to
if
not
self
.
GLinitialized
:
if
not
self
.
GLinitialized
:
...
@@ -180,7 +178,7 @@ class GLPanel(wx.Panel):
...
@@ -180,7 +178,7 @@ class GLPanel(wx.Panel):
def
OnDraw
(
self
,
*
args
,
**
kwargs
):
def
OnDraw
(
self
,
*
args
,
**
kwargs
):
"""Draw the window."""
"""Draw the window."""
#clear the context
#clear the context
self
.
canvas
.
SetCurrent
()
self
.
canvas
.
SetCurrent
(
self
.
context
)
self
.
pygletcontext
.
set_current
()
self
.
pygletcontext
.
set_current
()
glClear
(
GL_COLOR_BUFFER_BIT
|
GL_DEPTH_BUFFER_BIT
)
glClear
(
GL_COLOR_BUFFER_BIT
|
GL_DEPTH_BUFFER_BIT
)
#draw objects
#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