Text archives Help
- From:
- To:
- Subject: [Manta] r2402 - trunk/scenes/csafe/python
- Date: Tue, 14 Apr 2009 09:48:32 -0600 (MDT)
Author: brownlee
Date: Tue Apr 14 09:48:27 2009
New Revision: 2402
Modified:
trunk/scenes/csafe/python/Configuration.py
trunk/scenes/csafe/python/Histogram.py
trunk/scenes/csafe/python/SceneInfo.py
trunk/scenes/csafe/python/SceneMenus.py
trunk/scenes/csafe/python/TransferF.py
trunk/scenes/csafe/python/csafe_scene.py
Log:
M scenes/csafe/python/SceneInfo.py
adding vars for scene loading and configuration
M scenes/csafe/python/TransferF.py
fixing numbers displaying
M scenes/csafe/python/Histogram.py
adding labeled display
M scenes/csafe/python/csafe_scene.py
histograms now load saved settings
M scenes/csafe/python/SceneMenus.py
adding label display, disabling sphere radius if scene is loaded
M scenes/csafe/python/Configuration.py
saving label setting
Modified: trunk/scenes/csafe/python/Configuration.py
==============================================================================
--- trunk/scenes/csafe/python/Configuration.py (original)
+++ trunk/scenes/csafe/python/Configuration.py Tue Apr 14 09:48:27 2009
@@ -75,6 +75,10 @@
f.write(str(scene.radius)+'\n')
f.write(str(int(scene.cidx))+'\n')
f.write(str(scene.numThreads)+'\n')
+ if (scene.labels == True):
+ f.write("True\n")
+ else:
+ f.write("False\n")
for j in range(3):
f.write(str(scene.volumeMinBound[j])+" ")
f.write("\n")
@@ -257,6 +261,11 @@
scene.test.setCidx(scene.cidx)
scene.numThreads = int(float(lines[i].strip())); i += 1
scene.engine.changeNumWorkers(scene.numThreads)
+ labels = lines[i].strip(); i+=1
+ if labels == True:
+ scene.labels = True
+ else:
+ scene.labels = False
minBound = lines[i].split(); i += 1
maxBound = lines[i].split(); i += 1
for j in range(3):
Modified: trunk/scenes/csafe/python/Histogram.py
==============================================================================
--- trunk/scenes/csafe/python/Histogram.py (original)
+++ trunk/scenes/csafe/python/Histogram.py Tue Apr 14 09:48:27 2009
@@ -458,7 +458,10 @@
if self.scene.biggify == True:
fontSize = 12
dc.SetFont(wx.Font(fontSize, wx.FONTFAMILY_DEFAULT, wx.NORMAL,
wx.FONTWEIGHT_BOLD))
- string = str("%1.2g" % self.cropDMin)
+ 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
@@ -466,7 +469,10 @@
xpos -= diff
ypos = self.height-extent[1]
dc.DrawTextPoint(string, (xpos,ypos))
- string = str("%1.2g" % self.cropDMax)
+ 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)
@@ -478,11 +484,17 @@
ypos = self.height
if self.scene.biggify:
ypos = self.height
- string = str("%1.2g" %self.dMin)
+ 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 = str("%1.2g" % self.dMax)
+ 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)
Modified: trunk/scenes/csafe/python/SceneInfo.py
==============================================================================
--- trunk/scenes/csafe/python/SceneInfo.py (original)
+++ trunk/scenes/csafe/python/SceneInfo.py Tue Apr 14 09:48:27 2009
@@ -46,4 +46,5 @@
self.readConfiguration = False
self.measurementsFrame = None
self.selectedBGColor = wx.Color(70,70,70)
-
+ self.labels = True
+ self.loaded = False
Modified: trunk/scenes/csafe/python/SceneMenus.py
==============================================================================
--- trunk/scenes/csafe/python/SceneMenus.py (original)
+++ trunk/scenes/csafe/python/SceneMenus.py Tue Apr 14 09:48:27 2009
@@ -496,6 +496,12 @@
sizer.Add(self.biggifyCB,0,wx.ALL|wx.ALIGN_CENTER,5)
self.Bind(wx.EVT_CHECKBOX, self.OnClickBigger, self.biggifyCB)
+
+ self.labelsCB = wx.CheckBox(panel, -1, "Show labels")
+ self.labelsCB.SetValue(self.scene.labels)
+ sizer.Add(self.labelsCB,0,wx.ALL|wx.ALIGN_CENTER,5)
+
+ self.Bind(wx.EVT_CHECKBOX, self.OnClickLabels, self.labelsCB)
self.showSpheresCB = wx.CheckBox(panel, -1, "Show Sphere Data")
self.showSpheresCB.SetValue(self.scene.showSpheres)
@@ -523,6 +529,8 @@
hSizer5 = wx.BoxSizer(wx.HORIZONTAL)
self.radText = wx.StaticText(panel, -1, "Default Radius: ")
self.radTcl = wx.TextCtrl(panel,-1,str(scene.radius),size=(125,-1))
+ if (self.scene.loaded == True):
+ self.radTcl.Enable(False)
hSizer5.Add(self.radText,0,wx.ALL,3)
hSizer5.Add(self.radTcl,0,wx.ALL,3)
sizer.Add(hSizer5,0,wx.ALL|wx.ALIGN_CENTER,5)
@@ -608,6 +616,10 @@
def OnClickBigger(self, evt):
self.scene.biggify = evt.IsChecked()
self.scene.frame.LayoutWindow()
+
+ def OnClickLabels(self, evt):
+ self.scene.labels = evt.IsChecked()
+ self.scene.frame.LayoutWindow()
def OnClickShowSpheres(self, evt):
self.scene.showSpheres = evt.IsChecked()
Modified: trunk/scenes/csafe/python/TransferF.py
==============================================================================
--- trunk/scenes/csafe/python/TransferF.py (original)
+++ trunk/scenes/csafe/python/TransferF.py Tue Apr 14 09:48:27 2009
@@ -12,11 +12,10 @@
class TransferF(wx.Object):
def __init__(self, parent, colorsn, id, title="untitled", cmap = None):
-
- self.parent = parent
+ self.parent = parent
self.colors = colorsn
- self.id = id
- if (cmap != None):
+ self.id = id
+ if (cmap != None):
self.colors = []
num = cmap.GetNumSlices()
for i in range(num):
@@ -472,15 +471,22 @@
if self.scene.biggify == True:
fontSize = 12
dc.SetFont(wx.Font(fontSize, wx.FONTFAMILY_DEFAULT, wx.NORMAL,
wx.FONTWEIGHT_BOLD))
- string = str("%1.2g" % self.zoomDMin)
+ string = ""
+ if (self.scene.labels == True):
+ string += "zoom min: "
+ string += str("%1.2g" % self.zoomDMin)
extent = dc.GetTextExtent(string)
- xpos = extent[0]/2.0 + self.paddingW/2.0
+ #xpos = extent[0]/2.0 - self.paddingW/2.0
+ xpos = self.paddingW/2.0
diff = xpos - self.paddingW/2.0
- if diff < 0:
- xpos -= diff
- ypos = self.height+5
+ #if diff < 0:
+ # xpos -= diff
+ ypos = self.height - 2
dc.DrawTextPoint(string, (xpos,ypos))
- string = str("%1.2g" % self.zoomDMax)
+ string = ""
+ if (self.scene.labels == True):
+ string += "zoom max: "
+ string += str("%1.2g" % self.zoomDMax)
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)
@@ -489,14 +495,21 @@
dc.DrawTextPoint(string, (xpos,ypos))
# draw min/max text
- ypos = self.height+extent[1]+5
+ ypos += extent[1]
if self.scene.biggify:
ypos = self.height
- string = str("%1.2g" %self.absoluteDMin)
+ string = ""
+ if (self.scene.labels == True):
+ string += "color min: "
+ string += str("%1.2g" %self.absoluteDMin)
extent = dc.GetTextExtent(string)
- xpos = extent[0]/2.0 + self.paddingW/2.0
+ #xpos = extent[0]/2.0 + self.paddingW/2.0
+ xpos = self.paddingW/2.0
dc.DrawTextPoint(string, (xpos,ypos))
- string = str("%1.2g" % self.absoluteDMax)
+ string = ""
+ if (self.scene.labels == True):
+ string += "color max: "
+ string += str("%1.2g" % self.absoluteDMax)
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)
@@ -505,7 +518,10 @@
dc.DrawTextPoint(string, (xpos,ypos))
ypos = self.paddingH/2.0 - extent[1]
- string = str("%1.4g" % self.mouse_value)
+ string = ""
+ if (self.scene.labels == True):
+ string += "mouse value: "
+ 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))
Modified: trunk/scenes/csafe/python/csafe_scene.py
==============================================================================
--- trunk/scenes/csafe/python/csafe_scene.py (original)
+++ trunk/scenes/csafe/python/csafe_scene.py Tue Apr 14 09:48:27 2009
@@ -234,7 +234,7 @@
def Menu102(self, evt):
print "writing file: " + self.scene.sceneName
if (self.scene.sceneName != "Untitled"):
- Configuration.WriteConfiguration(self.scene, self.scene.sceneWD
+ '/' + self.scene.sceneName)
+ Configuration.WriteConfiguration(self.scene,
self.scene.sceneName)
else:
self.Menu103(evt)
@@ -334,6 +334,17 @@
print name
def BuildScene(self):
+ info = []
+ for i in range(len(self.histoGroups)):
+ hist = self.histoGroups[i].histogram
+ zoomMin = hist.zoomDMin
+ zoomMax = hist.zoomDMax
+ cropMin = hist.cropDMin
+ cropMax = hist.cropDMax
+ colorMin = hist.colorDMin
+ colorMax = hist.colorDMax
+ item = [zoomMin, zoomMax, cropMin, cropMax, colorMin, colorMax]
+ info.append(item)
self.generateMenuItem.Enable( False )
self.addRemoveDataFilesMenu.Enable( False )
@@ -417,6 +428,10 @@
if self.scene.numFrames > 1:
self.forwardB.Enable(True)
self.backB.Enable(True)
+
+ for i in range(len(info)):
+
self.histoGroups[i].SendValues(info[i][0],info[i][1],info[i][2],info[i][3],info[i][4],info[i][5])
+ self.scene.loaded = True
def BuildHistograms(self):
for i in range(len(self.histoGroups)):
- [Manta] r2402 - trunk/scenes/csafe/python, brownlee, 04/14/2009
Archive powered by MHonArc 2.6.16.