Text archives Help
- From: bigler@sci.utah.edu
- To: manta@sci.utah.edu
- Subject: [Manta] r1920 - trunk/SwigInterface
- Date: Wed, 12 Dec 2007 07:17:06 -0700 (MST)
Author: bigler
Date: Wed Dec 12 07:17:04 2007
New Revision: 1920
Modified:
trunk/SwigInterface/MantaCameraPath.py
trunk/SwigInterface/MantaCapture.py
trunk/SwigInterface/wxManta.py
Log:
SwigInterface/MantaCameraPath.py
SwigInterface/MantaCapture.py
Don't import any gl things. They aren't needed, and were likely
copied from another module file out of laziness.
SwigInterface/wxManta.py
Use wxversion to ensure we have a minimum version of 2.5.3.
Use the newer way to utilize glcanvas. This gets rid of deprecation
warnings.
Move the main frame's layout to after we create the canvas. This
fixes an error when we try to set the canvas's size before it's
created.
Add the currently running wx.VERSION to the about dialog.
Modified: trunk/SwigInterface/MantaCameraPath.py
==============================================================================
--- trunk/SwigInterface/MantaCameraPath.py (original)
+++ trunk/SwigInterface/MantaCameraPath.py Wed Dec 12 07:17:04 2007
@@ -4,9 +4,6 @@
import sys
import time
-from wxPython.glcanvas import wxGLCanvas
-from wx.glcanvas import WX_GL_DOUBLEBUFFER as GL_DOUBLEBUFFER
-
import threading
import math
import wx.lib.colourselect as csel
Modified: trunk/SwigInterface/MantaCapture.py
==============================================================================
--- trunk/SwigInterface/MantaCapture.py (original)
+++ trunk/SwigInterface/MantaCapture.py Wed Dec 12 07:17:04 2007
@@ -2,9 +2,6 @@
import sys
import time
-from wxPython.glcanvas import wxGLCanvas
-from wx.glcanvas import WX_GL_DOUBLEBUFFER as GL_DOUBLEBUFFER
-
import threading
import math
import wx.lib.colourselect as csel
Modified: trunk/SwigInterface/wxManta.py
==============================================================================
--- trunk/SwigInterface/wxManta.py (original)
+++ trunk/SwigInterface/wxManta.py Wed Dec 12 07:17:04 2007
@@ -1,5 +1,11 @@
#!/usr/bin/python
+import wxversion
+# This will barf and give warnings if you don't have a new enough version.
+wxversion.ensureMinimal('2.5.3')
+# This will select a particular version if you have more than one installed.
+#wxversion.select("2.5")
+
import wx
import sys
import time
@@ -7,9 +13,6 @@
import re
from wx import glcanvas
-from wxPython.glcanvas import wxGLCanvas
-from wx.glcanvas import WX_GL_DOUBLEBUFFER as GL_DOUBLEBUFFER
-
import threading
import math
@@ -23,6 +26,7 @@
import FloatSpin as FS
+# import traceback # Use traceback.print_stack() for a stack trace.
# Determine frame resolution.
xres = 512
@@ -152,7 +156,7 @@
-class mantaGLCanvas(wxGLCanvas):
+class mantaGLCanvas(glcanvas.GLCanvas):
# updateFramerate is a function that you call to update the framerate
def __init__(self, parent, sync_display, opengl_display, updateFramerate,
size=wx.Size(xres,yres)):
@@ -160,10 +164,10 @@
if (sys.platform == "darwin" or
(wx.VERSION[0]*10 + wx.VERSION[1]) < 26):
# This line for OSX
- wxGLCanvas.__init__(self, parent, -1, style=wx.NO_BORDER,
size=size)
+ glcanvas.GLCanvas.__init__(self, parent, -1, style=wx.NO_BORDER,
size=size)
else:
# This line for linux.
- wxGLCanvas.__init__(self, parent, -1,
attribList=[GL_DOUBLEBUFFER, glcanvas.WX_GL_RGBA, 0], style=wx.NO_BORDER,
size=size)
+ glcanvas.GLCanvas.__init__(self, parent, -1,
attribList=[glcanvas.WX_GL_DOUBLEBUFFER, glcanvas.WX_GL_RGBA, 0],
style=wx.NO_BORDER, size=size)
self.sync_display = sync_display
self.opengl_display = opengl_display
@@ -691,16 +695,6 @@
# Create the Main panel that will hold the renderer
self.panel = wx.Panel(self, size=renderSize)
- ############################################################
- # Layout
- box = wx.BoxSizer(wx.HORIZONTAL)
- box.Add(self.panel, 1, wx.EXPAND)
- self.SetSizerAndFit(box)
- self.panel.SetMinSize((20,20))
- self.SetMinSize(self.GetSize() - self.panel.GetSize()
- + self.panel.GetMinSize())
-
-
#######################################################################
# Setup manta.
@@ -760,6 +754,20 @@
# Basic scene.
initialize_callback( self, self.engine )
+
+ ############################################################
+ # Layout. This needs to happen *after* we create all the GUI
+ # elements, including the canvas.
+ box = wx.BoxSizer(wx.HORIZONTAL)
+ box.Add(self.panel, 1, wx.EXPAND)
+ self.SetSizerAndFit(box)
+ self.panel.SetMinSize((20,20))
+ self.SetMinSize(self.GetSize() - self.panel.GetSize()
+ + self.panel.GetMinSize())
+
+
+ ############################################################
+ # Start up the renderer
try:
self.engine.beginRendering(False)
@@ -955,7 +963,8 @@
"The Manta Interactive Ray Tracer\n\n" + \
"(c) 2005-2006 Scientific Computing and Imaging Institute.\n" + \
"University of Utah\n\n" + \
- "Revision Information:\n" + getAboutString()
+ "Revision Information:\n" + getAboutString() + "\n" + \
+ "wx.VERSION = %s" % (wx.VERSION,)
wx.MessageBox( message, "About Manta",
wx.TE_MULTILINE | wx.OK | wx.ICON_INFORMATION, self)
- [Manta] r1920 - trunk/SwigInterface, bigler, 12/12/2007
Archive powered by MHonArc 2.6.16.