Manta Interactive Ray Tracer Development Mailing List

Text archives Help


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


Chronological Thread 
  • From:
  • To:
  • Subject: [Manta] r2383 - trunk/scenes/csafe/python
  • Date: Thu, 5 Mar 2009 15:51:12 -0700 (MST)

Author: brownlee
Date: Thu Mar  5 15:51:09 2009
New Revision: 2383

Modified:
   trunk/scenes/csafe/python/Histogram.py
   trunk/scenes/csafe/python/SceneMenus.py
   trunk/scenes/csafe/python/TransferF.py
   trunk/scenes/csafe/python/csafe_scene.py
Log:
M    csafe_scene.py
   greying out forward/back buttons when no data is loaded
M    Histogram.py
   fixing zooming out issue
M    SceneMenus.py
   
M    TransferF.py
   adding data range display and mouse position information in data
range





Modified: trunk/scenes/csafe/python/Histogram.py
==============================================================================
--- trunk/scenes/csafe/python/Histogram.py      (original)
+++ trunk/scenes/csafe/python/Histogram.py      Thu Mar  5 15:51:09 2009
@@ -73,6 +73,7 @@
         #self.SetForegroundColour(wx.Colour(255,255,255))
        
     def SetHistValues(self, histValues, dataMin, dataMax):
+        self.zooms = []
         self.colorMin = -99999.0
         self.colorMax = 99999.0
         self.dMin = dataMin
@@ -166,7 +167,7 @@
             self.cropMin = temp
             self.UpdateDisplayedValues()
             self.UpdateCropDMin()
-            self.UpdateCropDmax()
+            self.UpdateCropDMax()
             self.Refresh()
             
         self.dragging = False
@@ -286,9 +287,9 @@
         dMax = self.dMax
         absoluteDMin = self.absoluteDMin
         absoluteDMax = self.absoluteDMax
-        absWidth = absoluteDMax - absoluteDMin
+        absWidth = float(absoluteDMax - absoluteDMin)
         if absWidth == 0:
-           absWidth = 1.0
+           return
         dWidth = dMax - dMin        
 
         # lines.append( (0,0, 50, 50) )

Modified: trunk/scenes/csafe/python/SceneMenus.py
==============================================================================
--- trunk/scenes/csafe/python/SceneMenus.py     (original)
+++ trunk/scenes/csafe/python/SceneMenus.py     Thu Mar  5 15:51:09 2009
@@ -24,7 +24,8 @@
        hSizer1 = wx.BoxSizer(wx.HORIZONTAL)
        self.addParticlesButton = wx.Button(panel,-1, "Add Particle File(s)")
        self.removeButton = wx.Button(panel, -1,"Remove Particle File")
-       self.removeButton.Disable()
+       if (len(self.scene.nrrdFiles) < 1):
+         self.removeButton.Disable()
        hSizer1.Add(self.addParticlesButton, 0, wx.ALL, 3)
        hSizer1.Add(self.removeButton, 0, wx.ALL, 3)
        sizer.Add(hSizer1, 0, wx.ALL|wx.ALIGN_CENTER, 5)
@@ -36,7 +37,8 @@
        
        self.addVolumeButton = wx.Button(panel,-1, "Add Volume File(s)")
        self.removeButton2 = wx.Button(panel, -1, "Remove Volume File")
-       self.removeButton2.Disable()
+       if (len(self.scene.nrrdFiles2) < 1):
+         self.removeButton2.Disable()
        hSizer2.Add(self.addVolumeButton, 0, wx.ALL, 3)
        hSizer2.Add(self.removeButton2, 0, wx.ALL, 3)
        sizer.Add(hSizer2, 0, wx.ALL|wx.ALIGN_CENTER, 5)                

Modified: trunk/scenes/csafe/python/TransferF.py
==============================================================================
--- trunk/scenes/csafe/python/TransferF.py      (original)
+++ trunk/scenes/csafe/python/TransferF.py      Thu Mar  5 15:51:09 2009
@@ -135,8 +135,9 @@
         path = setup.csafe_scene_path
         self.scene = scene
         self.backgroundIMG = wx.Image(opj(path+'images/bckgrnd.png'), 
wx.BITMAP_TYPE_PNG).ConvertToBitmap()
+        self.mouse_value = 0.0
         self.paddingW = 20.0
-        self.paddingH = 30.0
+        self.paddingH = 20.0
         self.transferF = transferF
         self.width = width
         self.height = height
@@ -298,7 +299,10 @@
        if (x < 0.0):
            x = 0.0
        if x > self.width:
-           x = self.width              
+           x = self.width
+        zoomDRange = self.zoomDMax - self.zoomDMin
+        self.mouse_value = 
float(x)/float(self.width)*float(zoomDRange)+float(self.zoomDMin)
+        self.Refresh()
         y = evt.GetPosition().y - self.paddingH/2.0
        if y < 0.0:
            y = 0.0
@@ -494,6 +498,12 @@
         diff = xpos + extent[0] - (self.width + self.paddingW/2.0)
         if (diff > 0 ):
            xpos -= diff
+        dc.DrawTextPoint(string, (xpos,ypos))
+
+        ypos = self.paddingH/2.0 - extent[1]
+        string = str("%1.4g" % self.mouse_value)
+        extent = dc.GetTextExtent(string)
+        xpos = self.paddingW/2.0 + self.width/2.0 - extent[0]/2.0
         dc.DrawTextPoint(string, (xpos,ypos))
 
 class TransferFGroup(wx.Panel):

Modified: trunk/scenes/csafe/python/csafe_scene.py
==============================================================================
--- trunk/scenes/csafe/python/csafe_scene.py    (original)
+++ trunk/scenes/csafe/python/csafe_scene.py    Thu Mar  5 15:51:09 2009
@@ -347,6 +347,9 @@
         self.BuildHistograms()
         self.slider.SetRange(1, int(max(len(self.scene.nrrdFiles), 
len(self.scene.nrrdFiles2))))
         self.scene.mantaApp.frame.StartEngine()
+        if self.scene.nrrdFiles > 1 or self.scene.nrrdFiles2 > 1:
+           self.forwardB.Enable(True)
+           self.backB.Enable(True)
 
     def BuildHistograms(self):
         for i in range(len(self.histoGroups)):
@@ -565,10 +568,11 @@
         self.playB.SetBackgroundColour(self.scene.bgColor)
 
         self.forwardB = wx.BitmapButton(self.panel, -1, self.forwardBmp, 
(20,20), style=wx.NO_BORDER)
-        self.forwardB.SetToolTip( wx.ToolTip( "Forward (fix me)" ) )
+        self.forwardB.SetToolTip( wx.ToolTip( "Forward" ) )
+        self.forwardB.Enable(False)
 
         self.backB = wx.BitmapButton(self.panel, -1, self.backBmp, (20,20), 
style=wx.NO_BORDER)
-        self.backB.SetToolTip( wx.ToolTip( "Backward (fix me)" ) )
+        self.backB.SetToolTip( wx.ToolTip( "Backward" ) )
         self.backB.Enable( False )
 
         self.slider = wx.Slider(self.panel, 100, 0, 0, 0, (30, 60), (250, 
-1), wx.SL_HORIZONTAL | wx.SL_AUTOTICKS | wx.SL_LABELS )


  • [Manta] r2383 - trunk/scenes/csafe/python, brownlee, 03/05/2009

Archive powered by MHonArc 2.6.16.

Top of page