Manta Interactive Ray Tracer Development Mailing List

Text archives Help


[Manta] r2084 - trunk/scenes/csafe/python


Chronological Thread 
  • From: brownlee@sci.utah.edu
  • To: manta@sci.utah.edu
  • Subject: [Manta] r2084 - trunk/scenes/csafe/python
  • Date: Sat, 16 Feb 2008 05:39:26 -0700 (MST)

Author: brownlee
Date: Sat Feb 16 05:39:24 2008
New Revision: 2084

Modified:
   trunk/scenes/csafe/python/Histogram.py
   trunk/scenes/csafe/python/SceneMenus.py
   trunk/scenes/csafe/python/csafe_demo.py
Log:
fixed some display errors with wxpython and mac

Modified: trunk/scenes/csafe/python/Histogram.py
==============================================================================
--- trunk/scenes/csafe/python/Histogram.py      (original)
+++ trunk/scenes/csafe/python/Histogram.py      Sat Feb 16 05:39:24 2008
@@ -477,11 +477,11 @@
         
         gbs.Add(self.histogram,(0, 0), (2, 2) )
         if self.scene.histogramBMPLoaded == False:
-               self.scene.bmpVis = wx.Bitmap(opj('images/eye.png.8x8'))
-               self.scene.bmpColor = wx.Bitmap(opj('images/color.png.8x8'))
-               self.scene.bmpRuler = wx.Bitmap(opj('images/ruler.png.8x8'))
-                       self.scene.bmpZoomIn = 
wx.Bitmap(opj('images/zoomin.png.8x8'))
-               self.scene.bmpZoomOut = 
wx.Bitmap(opj('images/zoomout.png.8x8'))
+               self.scene.bmpVis = wx.Bitmap(opj('images/eye.png.8x8'), 
wx.BITMAP_TYPE_PNG)
+               self.scene.bmpColor = wx.Bitmap(opj('images/color.png.8x8'), 
wx.BITMAP_TYPE_PNG)
+               self.scene.bmpRuler = wx.Bitmap(opj('images/ruler.png.8x8'), 
wx.BITMAP_TYPE_PNG)
+                       self.scene.bmpZoomIn = 
wx.Bitmap(opj('images/zoomin.png.8x8'), wx.BITMAP_TYPE_PNG)
+               self.scene.bmpZoomOut = 
wx.Bitmap(opj('images/zoomout.png.8x8'), wx.BITMAP_TYPE_PNG)
                self.scene.histogramBMPLoaded = True
        
        self.bmpVis = self.scene.bmpVis
@@ -491,7 +491,7 @@
        self.bmpZoomOut = self.scene.bmpZoomOut
 
         size = 10
-        visibilityB = wx.BitmapButton(self, -1, self.bmpVis, (0,0), 
style=wx.NO_BORDER)
+        visibilityB = wx.BitmapButton(self, -1, self.bmpVis, (8,8), 
style=wx.NO_BORDER)
         self.visibilityB = visibilityB
         colorB = wx.BitmapButton(self, -1, self.bmpColor, (0,0), 
style=wx.NO_BORDER)
         self.colorB = colorB

Modified: trunk/scenes/csafe/python/SceneMenus.py
==============================================================================
--- trunk/scenes/csafe/python/SceneMenus.py     (original)
+++ trunk/scenes/csafe/python/SceneMenus.py     Sat Feb 16 05:39:24 2008
@@ -447,7 +447,7 @@
            histValues1.append(5)
        colors = []
        #t = TransferF.TransferF(self, colors, self.transferFID, self.name, 
manta_new(CDColorMap(1)))
-        histoGroup = Histogram.HistogramGroup(self.scene.frame, histValues1, 
dataMin, dataMax, 300, 40.0, 
self.scene.frame.transferFunctions[self.transferFID], self.scene.tPanel, 
self.scene, self.index, self.name)
+        histoGroup = Histogram.HistogramGroup(self.scene.frame.panel, 
histValues1, dataMin, dataMax, 300, 40.0, 
self.scene.frame.transferFunctions[self.transferFID], self.scene.tPanel, 
self.scene, self.index, self.name)
        color = wx.Colour(90,90,90)
        histoGroup.group = self.group
         histoGroup.SetBackgroundColour(color)

Modified: trunk/scenes/csafe/python/csafe_demo.py
==============================================================================
--- trunk/scenes/csafe/python/csafe_demo.py     (original)
+++ trunk/scenes/csafe/python/csafe_demo.py     Sat Feb 16 05:39:24 2008
@@ -60,6 +60,7 @@
     def __init__(self, parent, ID, title):
         wx.Frame.__init__(self, parent, ID, title, 
         wx.DefaultPosition, wx.Size(200, 150))
+        self.panel = wx.Panel(self,1)
         self.scene = SceneInfo.Scene()
         #self.SetForegroundColour(wx.Colour(255,0,0))
         self.SetBackgroundColour(self.scene.bgColor)
@@ -249,7 +250,7 @@
        slices = vector_ColorSlice()
        t.colors.sort()
        for i in range(0, len(t.colors)):
-               slices.push_back(ColorSlice(t.colors[i][0], 
RGBAColor(Color(RGBColor(t.colors[i][1], \
+               slices.push_back(ColorSlice(t.colors[i][0], 
RGBAColor(Color(RGBColor(t.colors[i][1], 
                t.colors[i][2], t.colors[i][3])), t.colors[i][4])))
        if (cmap != None):
                cmap.SetColors(slices)
@@ -374,7 +375,7 @@
        self.transferFunctions = []
        self.transferFunctions.append(self.t0)
 
-       self.tPanel = tPanel = TransferF.TransferFGroup(self, 300, 100, 
self.defaultTransferF, "empty")
+       self.tPanel = tPanel = TransferF.TransferFGroup(self.panel, 300, 100, 
self.defaultTransferF, "empty")
        self.scene.tPanel = tPanel
        tPanel.SetBackgroundColour(self.scene.bgColor)
        self.Bind(wx.EVT_LEFT_DOWN, self.OnKeyDown)
@@ -386,36 +387,46 @@
        color = self.scene.bgColor
         self.scene.histoVS = hvs = wx.BoxSizer(wx.VERTICAL)
         self.scene.frame = self
-       histoGroup0 = Histogram.HistogramGroup(self, histValues1, dataMin1, 
dataMax1, 300, 40.0, t0, tPanel, self.scene, 8, "volume")
+       histoGroup0 = Histogram.HistogramGroup(self.panel, histValues1, 
dataMin1, dataMax1, 300, 40.0, t0, tPanel, self.scene, 8, "volume")
        histoGroup0.group = 1
        histoGroup0.SetBackgroundColour(color)
        tPanel.transferFPanel.SetHistogram(histoGroup0.histogram)
        self.histoGroups = []
        self.histoGroups.append(histoGroup0)
-        vs.Add(hvs,0,wx.ALIGN_CENTER|wx.ALL,1)
+        vs.Add(hvs,0,wx.ALIGN_TOP|wx.ALL,1)
+        vs.Add(tPanel,0,wx.ALIGN_TOP|wx.ALL,1)
 
-       animCtrlTitle = wx.StaticBox(self, -1)
-       animCtrlSizer = wx.StaticBoxSizer(animCtrlTitle, wx.HORIZONTAL)
+#      animCtrlTitle = wx.StaticBox(self.panel, -1)
+#      animCtrlSizer = wx.StaticBoxSizer(animCtrlTitle, wx.HORIZONTAL)
        self.backBmp = wx.Bitmap("images/back.png.32x32", wx.BITMAP_TYPE_PNG)
-       self.playBmp = wx.Bitmap("images/play.png.64x64", wx.BITMAP_TYPE_PNG)
-       self.pauseBmp = wx.Bitmap("images/pause.png.64x64", 
wx.BITMAP_TYPE_PNG)
+       self.playBmp = wx.Bitmap("images/play.png.32x32", wx.BITMAP_TYPE_PNG)
+       self.pauseBmp = wx.Bitmap("images/pause.png.32x32", 
wx.BITMAP_TYPE_PNG)
        self.forwardBmp = wx.Bitmap("images/forward.png.32x32", 
wx.BITMAP_TYPE_PNG)
-       self.playB = wx.BitmapButton(self, -1, self.pauseBmp, (20,20), 
style=wx.NO_BORDER)
-       self.forwardB = wx.BitmapButton(self, -1, self.forwardBmp, (20,20), 
style=wx.NO_BORDER)
-       self.backB = wx.BitmapButton(self, -1, self.backBmp, (20,20), 
style=wx.NO_BORDER)
+       self.playB = wx.BitmapButton(self.panel, -1, self.pauseBmp, (40,40), 
style=wx.NO_BORDER)
+       self.playB.SetBackgroundColour(self.scene.bgColor)
+       self.forwardB = wx.BitmapButton(self.panel, -1, self.forwardBmp, 
(20,20), style=wx.NO_BORDER)
+       self.backB = wx.BitmapButton(self.panel, -1, self.backBmp, (20,20), 
style=wx.NO_BORDER)
        
-       self.Bind(wx.EVT_BUTTON, self.OnClickBack, self.backB)
-       self.Bind(wx.EVT_BUTTON, self.OnClickPlay, self.playB)
-       self.Bind(wx.EVT_BUTTON, self.OnClickForward, self.forwardB)
-       animCtrlSizer.Add(self.backB, -1, wx.ALIGN_CENTRE, 1)
-       animCtrlSizer.Add(self.playB, -1, wx.ALIGN_CENTRE, 1)
-       animCtrlSizer.Add(self.forwardB, -1, wx.ALIGN_CENTRE, 1)
-       vs.Add(animCtrlSizer, wx.ALIGN_CENTRE, 5)
+#      self.Bind(wx.EVT_BUTTON, self.OnClickBack, self.backB)
+#      self.Bind(wx.EVT_BUTTON, self.OnClickPlay, self.playB)
+#      self.Bind(wx.EVT_BUTTON, self.OnClickForward, self.forwardB)
+       #animCtrlSizer.Add(self.backB, 0, wx.ALIGN_TOP, 1)
+       #animCtrlSizer.Add(self.playB, 0, wx.ALIGN_TOP, 1)
+       #animCtrlSizer.Add(self.forwardB, 0, wx.ALIGN_TOP, 1)
+      #  vs.Add(animCtrlSizer, wx.ALIGN_TOP|wx.ALL, 5)
 
        vs.Layout()
 
-       self.SetSizer( vs )
-       vs.Fit( self )
+#      self.SetSizer( vs )
+#      self.SetAutoLayout(True)
+       #vs.Fit( self )
+       #self.panel1.SetSizer(vs)
+       #vs.Layout()
+       #self.SetSizer(vs)
+       #vs.Fit(self)
+       self.panel.SetBackgroundColour(self.scene.bgColor)
+       self.panel.SetSizer(vs)
+       self.SetBackgroundColour(self.scene.bgColor)
        self.LayoutWindow()
 #TODO: values hardcoded for now
        
self.scene.nrrdFiles2.append("/usr/sci/data/Medical/VFemHead/vfhead-crop.nhdr")
@@ -427,24 +438,39 @@
        self.vs = vs = wx.BoxSizer( wx.VERTICAL )
         self.scene.histoVS = hvs = wx.BoxSizer(wx.VERTICAL)
        for i in range(len(self.histoGroups)):
-                hvs.Add(self.histoGroups[i], 0, wx.ALIGN_CENTER, 1)
-        hvs.Add(self.tPanel, 0, wx.ALIGN_CENTRE|wx.ALL, 1 )
-       vs.Add(hvs,0,wx.ALIGN_CENTER|wx.ALL,1)
+                hvs.Add(self.histoGroups[i], -1,wx.ALIGN_TOP, 1)
+        hvs.Add(self.tPanel, 0, wx.ALIGN_TOP, 1 )
+       vs.Add(hvs,0,wx.ALIGN_TOP,1)
 
-       hvs2 = wx.BoxSizer(wx.VERTICAL)
-       animCtrlTitle = wx.StaticBox(self, -1)
+       hvs2 = wx.BoxSizer(wx.HORIZONTAL)
+       animCtrlTitle = wx.StaticBox(self.panel, -1, "")
         animCtrlSizer = wx.StaticBoxSizer(animCtrlTitle, wx.HORIZONTAL)
-       animCtrlSizer.Add(self.backB, -1, wx.ALIGN_CENTRE, 1)
-        animCtrlSizer.Add(self.playB, -1, wx.ALIGN_CENTRE, 1)
-        animCtrlSizer.Add(self.forwardB, -1, wx.ALIGN_CENTRE, 1)
-        hvs2.Add(animCtrlSizer, wx.ALIGN_CENTER|wx.ALL,1)
-        vs.Add(hvs2, wx.ALIGN_CENTRE|wx.ALL, 5)
-        vs.AddSpacer(100,100)
+#      animCtrlSizer.Add(self.backB, 0, wx.ALIGN_CENTER, 1)
+   #     animCtrlSizer.Add(self.playB, 0, wx.ALIGN_CENTER, 1)
+   #     animCtrlSizer.Add(self.forwardB, 0, wx.ALIGN_CENTER, 1)
+    #    hvs2.Add(animCtrlSizer,wx.ALIGN_CENTER,2)
+     #   vs.Add(hvs2, wx.BOTTOM, 5)
+        #vs.AddSpacer(100,100)
+        #animCtrlSizer.Add(self.playB )
+        hvs2.Add(self.backB,0,wx.ALIGN_CENTER,2)
+        hvs2.Add(self.playB,0,wx.ALIGN_CENTER,2)
+        hvs2.Add(self.forwardB,0,wx.ALIGN_CENTER,2)
+        vs.Add(hvs2,0,wx.ALIGN_BOTTOM|wx.ALIGN_CENTER)
+        #TODO: can't get the staticbox to friggin work with the buttons
+#        vs.Add( animCtrlSizer, 0, wx.ALIGN_CENTRE|wx.ALL, 5 )
+        
+               
+       self.Bind(wx.EVT_BUTTON, self.OnClickBack, self.backB)
+       self.Bind(wx.EVT_BUTTON, self.OnClickPlay, self.playB)
+       self.Bind(wx.EVT_BUTTON, self.OnClickForward, self.forwardB)
 
        vs.Layout()
-       self.SetSizer(vs)
+       self.panel.SetSizer(vs)
        vs.Fit(self)
-       self.SetBackgroundColour(self.scene.bgColor)
+       #self.SetSizer(vs)
+       #self.SetAutoLayout(True)
+       #vs.Fit(self)
+       #self.SetBackgroundColour(self.scene.bgColor)
        self.Refresh()
 
     def OnClickBack(self, evt):
@@ -468,9 +494,9 @@
        self.test.forwardAnimation()
 
 def initialize_scene( frame, engine ):
-    frame = MyFrame(None, -1, "CSAFE Demo")
-    frame.Show(True)   
-    frame.InitializeScene(frame, engine)
+        frame = MyFrame(None, -1, "CSAFE Demo")
+        frame.Show(True)       
+        frame.InitializeScene(frame, engine)
     
 
 def usage():




  • [Manta] r2084 - trunk/scenes/csafe/python, brownlee, 02/16/2008

Archive powered by MHonArc 2.6.16.

Top of page