Manta Interactive Ray Tracer Development Mailing List

Text archives Help


[Manta] r2406 - in trunk: SwigInterface scenes/csafe/python scenes/csafe/src


Chronological Thread 
  • From:
  • To:
  • Subject: [Manta] r2406 - in trunk: SwigInterface scenes/csafe/python scenes/csafe/src
  • Date: Mon, 27 Apr 2009 18:20:02 -0600

Author: brownlee
Date: Mon Apr 27 18:20:02 2009
New Revision: 2406

Modified:
   trunk/SwigInterface/wxManta.py
   trunk/scenes/csafe/python/Histogram.py
   trunk/scenes/csafe/python/csafe_scene.py
   trunk/scenes/csafe/src/CDTest.h
Log:
empty histograms now just say empty, fixed hide issue, disable thread menu 
when loading scene

Modified: trunk/SwigInterface/wxManta.py
==============================================================================
--- trunk/SwigInterface/wxManta.py      (original)
+++ trunk/SwigInterface/wxManta.py      Mon Apr 27 18:20:02 2009
@@ -288,8 +288,9 @@
         # Threads.
         dialog_id = wx.NewId()
         self.dialog_id_map[dialog_id] = ThreadsFrame
+        self.thread_menu = self.manta_menu.Append(dialog_id, "Threads")
         self.Bind(wx.EVT_MENU, self.OnShowDialog, 
-                  self.manta_menu.Append(dialog_id, "Threads"))
+                  self.thread_menu)
 
         # Python Shell
         dialog_id = wx.NewId()

Modified: trunk/scenes/csafe/python/Histogram.py
==============================================================================
--- trunk/scenes/csafe/python/Histogram.py      (original)
+++ trunk/scenes/csafe/python/Histogram.py      Mon Apr 27 18:20:02 2009
@@ -470,49 +470,55 @@
         if self.scene.biggify == True:
                 fontSize = 12
         dc.SetFont(wx.Font(fontSize, wx.FONTFAMILY_DEFAULT, wx.NORMAL, 
wx.FONTWEIGHT_BOLD))
-        string = ""
-        if (self.scene.labels):
-          string += "crop min: "
-        string += str("%1.2g" % self.cropDMin)
-        extent = dc.GetTextExtent(string)
-        xpos = cropMin*self.width - extent[0]/2.0 + self.paddingW/2.0
-        diff = xpos - self.paddingW/2.0
-        if diff < 0:
-            xpos -= diff
-        ypos = self.height-extent[1]
-        dc.DrawTextPoint(string, (xpos,ypos))
-        string = ""
-        if (self.scene.labels):
-          string += "crop max: "
-        string += str("%1.2g" % self.cropDMax)
-        extent = dc.GetTextExtent(string)
-        xpos = cropMax*self.width - extent[0]/2.0 + self.paddingW/2.0
-        diff = xpos + extent[0] - (self.width + self.paddingW/2.0)
-        if (diff > 0 ):
-           xpos -= diff
-        dc.DrawTextPoint(string, (xpos,ypos))
-        
-        # draw min/max text
-        ypos = self.height
-        if self.scene.biggify:
-              ypos = self.height
-        string = ""
-        if (self.scene.labels):
-          string += "zoom min: "
-        string += str("%1.2g" %self.dMin)
-        extent = dc.GetTextExtent(string)
-        xpos = self.paddingW/2.0
-        dc.DrawTextPoint(string, (xpos,ypos))
-        string = ""
-        if (self.scene.labels):
-          string += "zoom max: "
-        string += str("%1.2g" % self.dMax)
-        extent = dc.GetTextExtent(string)
-        xpos = self.width - extent[0]/2.0 + self.paddingW/2.0
-        diff = xpos + extent[0] - (self.width + self.paddingW/2.0)
-        if (diff > 0 ):
-           xpos -= diff
-        dc.DrawTextPoint(string, (xpos,ypos))
+
+        if (self.dMin != self.dMax):
+            string = ""
+            if (self.scene.labels):
+              string += "crop min: "
+            string += str("%1.2g" % self.cropDMin)
+            extent = dc.GetTextExtent(string)
+            xpos = cropMin*self.width - extent[0]/2.0 + self.paddingW/2.0
+            diff = xpos - self.paddingW/2.0
+            if diff < 0:
+                xpos -= diff
+            ypos = self.height-extent[1]
+            dc.DrawTextPoint(string, (xpos,ypos))
+            string = ""
+            if (self.scene.labels):
+              string += "crop max: "
+            string += str("%1.2g" % self.cropDMax)
+            extent = dc.GetTextExtent(string)
+            xpos = cropMax*self.width - extent[0]/2.0 + self.paddingW/2.0
+            diff = xpos + extent[0] - (self.width + self.paddingW/2.0)
+            if (diff > 0 ):
+               xpos -= diff
+            dc.DrawTextPoint(string, (xpos,ypos))
+
+            # draw min/max text
+            ypos = self.height
+            if self.scene.biggify:
+                  ypos = self.height
+            string = ""
+            if (self.scene.labels):
+              string += "zoom min: "
+            string += str("%1.2g" %self.dMin)
+            extent = dc.GetTextExtent(string)
+            xpos = self.paddingW/2.0
+            dc.DrawTextPoint(string, (xpos,ypos))
+            string = ""
+            if (self.scene.labels):
+              string += "zoom max: "
+            string += str("%1.2g" % self.dMax)
+            extent = dc.GetTextExtent(string)
+            xpos = self.width - extent[0]/2.0 + self.paddingW/2.0
+            diff = xpos + extent[0] - (self.width + self.paddingW/2.0)
+            if (diff > 0 ):
+               xpos -= diff
+            dc.DrawTextPoint(string, (xpos,ypos))
+        else:
+            string = "Empty";
+            extent = dc.GetTextExtent(string)
+            dc.DrawTextPoint("Empty", (self.width/2.0 - extent[0]/2.0 + 
self.paddingW/2.0,self.height/2.0))
 
 
     def DrawLines(self, dc):
@@ -940,7 +946,7 @@
             self.vs.Fit(self)
             self.parent.GetSizer().Layout()
             self.parent.Refresh()
-            
self.transferFPanel.transferFPanel.SetHistogramGroup(self.histogram)
+            self.transferFPanel.transferFPanel.SetHistogramGroup(self)
             
             
 class MeasurementsFrame(wx.Frame):

Modified: trunk/scenes/csafe/python/csafe_scene.py
==============================================================================
--- trunk/scenes/csafe/python/csafe_scene.py    (original)
+++ trunk/scenes/csafe/python/csafe_scene.py    Mon Apr 27 18:20:02 2009
@@ -341,7 +341,12 @@
         print index
         print name
 
+
+
+
     def BuildScene(self):
+        self.scene.mantaApp.frame.thread_menu.Enable(False)
+        
         info = []
         for i in range(len(self.histoGroups)):
           hist = self.histoGroups[i].histogram
@@ -454,6 +459,7 @@
         self.scene.mantaApp.frame.OnAutoView(None)
         if self.scene.currentVolumeHistogram != None:
           
self.test.setVolCMap(self.scene.currentVolumeHistogram.transferF.cmap)
+        self.scene.mantaApp.frame.thread_menu.Enable(True)
 
     def BuildHistograms(self):
         for i in range(len(self.histoGroups)):
@@ -730,7 +736,7 @@
         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.AddSpacer((0,10))
         vs.Layout()
         self.panel.SetSizer(vs)
         self.panel.SetupScrolling()

Modified: trunk/scenes/csafe/src/CDTest.h
==============================================================================
--- trunk/scenes/csafe/src/CDTest.h     (original)
+++ trunk/scenes/csafe/src/CDTest.h     Mon Apr 27 18:20:02 2009
@@ -106,6 +106,7 @@
       _stepSize = 0.0015;
       _num_vars = 0;
       _forceVolumeData = false;
+      _is_loaded = false;
     }
 
   ~CDTest()
@@ -580,8 +581,10 @@
       //_vols.clear();
       //_spherePNrrds.clear();
       //_sphereGrids.clear();
+      _is_loaded = false;
       loadSphereNrrds();
       loadVolNrrds();
+      _is_loaded = true;
       //_manta_interface->addOneShotCallback(MantaInterface::Relative, 2, 
Callback::create(this, &CDTest::reloadDataHelper));
     }
         
@@ -1039,6 +1042,7 @@
         return "";
       return key_value_pairs[i].second;
     }
+  bool isLoaded() { return _is_loaded; }
 
   //! get color index
   /*!
@@ -1148,6 +1152,7 @@
   int _num_vars;
   bool _forceVolumeData;
   std::vector<std::pair<string, string> > key_value_pairs;
+  bool _is_loaded;
 };
 
 #endif


  • [Manta] r2406 - in trunk: SwigInterface scenes/csafe/python scenes/csafe/src, brownlee, 04/27/2009

Archive powered by MHonArc 2.6.16.

Top of page