Manta Interactive Ray Tracer Development Mailing List

Text archives Help


[MANTA] r1162 - trunk/SwigInterface


Chronological Thread 
  • From: abe@sci.utah.edu
  • To: manta@sci.utah.edu
  • Subject: [MANTA] r1162 - trunk/SwigInterface
  • Date: Wed, 9 Aug 2006 22:54:55 -0600 (MDT)

Author: abe
Date: Wed Aug  9 22:54:55 2006
New Revision: 1162

Modified:
   trunk/SwigInterface/wxManta.py
Log:

Rearranged menus, added autoview menu option and other changes to support 
code I'm still working on.

M    wxManta.py


Modified: trunk/SwigInterface/wxManta.py
==============================================================================
--- trunk/SwigInterface/wxManta.py      (original)
+++ trunk/SwigInterface/wxManta.py      Wed Aug  9 22:54:55 2006
@@ -37,7 +37,7 @@
                                              Vector(0,1,0)))
     # plane_matl = manta_new(Phong(checker1, constant_color1, 32, checker2))
     plane_matl = manta_new(Lambertian(checker1))
-    #
+    
     world = manta_new(Group())
     floor = manta_new(Parallelogram(plane_matl, Vector(-20,-20,0),
                                     Vector(40,0,0), Vector(0,40,0)))
@@ -286,14 +286,20 @@
 
         # Create the menu
         menuBar = wx.MenuBar()
-        menu1 = wx.Menu()
-        self.Bind(wx.EVT_MENU, self.OnCloseWindow,
-                  menu1.Append(wx.NewId(), "&Quit"))
-        menuBar.Append(menu1, "&File")
-        menu2 = wx.Menu()
+
+        manta_menu = wx.Menu()
         self.Bind(wx.EVT_MENU, self.OnAbout,
-                  menu2.Append(wx.NewId(), "About Manta"))
-        menuBar.Append(menu2, "&Help")
+                  manta_menu.Append(wx.NewId(), "About Manta"))
+        self.Bind(wx.EVT_MENU, self.OnCloseWindow,
+                  manta_menu.Append(wx.NewId(), "&Quit Manta"))
+        menuBar.Append(manta_menu, "&Manta")
+
+        
+        view_menu = wx.Menu()
+        self.Bind(wx.EVT_MENU, self.OnAutoView,
+                  view_menu.Append(wx.NewId(), "&Auto View"))
+        menuBar.Append(view_menu, "&View")
+
         self.SetMenuBar(menuBar)
 
         # Create the Main panel that will hold the renderer
@@ -381,7 +387,7 @@
         
 
     
###########################################################################
-    ## OnCloseWindow
+    ## OnSize
     
###########################################################################
     def OnSize(self, event):
         panelSize = self.panel.GetSize()
@@ -405,7 +411,7 @@
     ## ShutdownEngine
     
###########################################################################
     def ShutdownEngine(self):
-        print "Exiting the engine"
+        # print "Exiting the engine"
         # sync_thread and sync_display only exist for when we use a
         # SyncDisplay class.  Since this doesn't happen all the time
         # we use the try block to allow continued progress
@@ -418,7 +424,7 @@
             self.sync_display.doneRendering()
         except: pass
         self.engine.blockUntilFinished()
-        print "Engine exited"
+        # print "Engine exited"
         
     
###########################################################################
     ## OnMotion
@@ -458,6 +464,26 @@
     def OnAbout(self, event):
         wx.MessageBox("This is the Python GUI to the Manta Interactive Ray 
Tracer",
                       "About Manta", wx.OK | wx.ICON_INFORMATION, self)
+
+    
###########################################################################
+    ## OnAutoView
+    
###########################################################################
+    def OnAutoView(self, event):
+        
+        # Add the transaction.
+        self.engine.addTransaction("auto view",
+                                   
manta_new(createMantaTransaction(self.MantaAutoView,() )))
+
+    def MantaAutoView(self):
+
+        # Find the bounding box of the scene.
+        bounds = BBox();
+        self.engine.getScene().getObject().computeBounds( 
PreprocessContext(), bounds );
+
+        # Invoke the autoview method.
+        channel = 0
+        self.engine.getCamera(channel).autoview( bounds )
+        
 
     
###########################################################################
     ## FrameReady




  • [MANTA] r1162 - trunk/SwigInterface, abe, 08/09/2006

Archive powered by MHonArc 2.6.16.

Top of page