Manta Interactive Ray Tracer Development Mailing List

Text archives Help


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


Chronological Thread 
  • From:
  • To:
  • Subject: [Manta] r2353 - in trunk: SwigInterface UserInterface scenes/csafe/python scenes/csafe/src
  • Date: Fri, 12 Dec 2008 15:03:16 -0700 (MST)

Author: dav
Date: Fri Dec 12 15:03:13 2008
New Revision: 2353

Added:
   trunk/scenes/csafe/python/csafe_scene.py   (contents, props changed)
      - copied, changed from r2352, trunk/scenes/csafe/python/csafe_demo.py
Removed:
   trunk/scenes/csafe/python/csafe_demo.py
Modified:
   trunk/SwigInterface/LightFrame.py
   trunk/SwigInterface/ThreadsFrame.py
   trunk/SwigInterface/wxManta.py
   trunk/UserInterface/XWindowUI.cc
   trunk/scenes/csafe/python/CMakeLists.txt
   trunk/scenes/csafe/python/Configuration.py
   trunk/scenes/csafe/python/Histogram.py
   trunk/scenes/csafe/python/SceneMenus.py
   trunk/scenes/csafe/python/TransferF.py
   trunk/scenes/csafe/src/CDTest.h
Log:
M    scenes/csafe/python/TransferF.py

- Don't allow opacity to be changed on particle color maps.  (It doesn't make 
sense.)
- Moved "opj" function to common location (in wxManta.py).
- Added some whitespace where needed.

M    scenes/csafe/python/Histogram.py

- Updates to display correctly color map when starting (as were saved in .cfg 
file).
- Display NRRD data index in colormap title field.
- Better tooltip.
- Added some whitespace where needed, removed tabs.
- Moved "opj" function to common location (in wxManta.py).

D    scenes/csafe/python/csafe_demo.py
AM + scenes/csafe/python/csafe_scene.py

- Renamed from "csafe_demo.py" to "csafe_scene.py" as this isn't a demo 
anymore...
- Save the currentHistorgram (and currentParticleHistogram) so they can be 
loaded back from the .cfg file.
- Updates to correctly display proper color map when starting up (as were 
saved in .cfg file).
- Fix "Save" to work with (automatically use) the name of the loaded .cfg 
file.
- moveToMouse moved to common location (in wxManta.py)

M    scenes/csafe/python/SceneMenus.py

- Some clearer GUI element names.

M    scenes/csafe/python/CMakeLists.txt

- Renamed scene.

M    scenes/csafe/python/Configuration.py

- Save/Load currently selected colormaps so they can be restored next time.
- Save/Load camera eye point to it can be restored.
  - Use transaction to set new eye point.

M    scenes/csafe/src/CDTest.h

- Order #includes alphabetically (which revealed and allowed for removing 
about
    5 duplicated #includes).
- Use a little more whitespace for functions declared in .h file for better 
readability.

M    SwigInterface/ThreadsFrame.py

- Don't destroy these dialogs when they are closed, just show/hide them so 
they can be reused
    (and thus kept in sync).

M    SwigInterface/wxManta.py

- Keep track of the dialogs that have been created so they can be 
shown/hidden (instead of destroyed).
- Renamed dialog_map to the more accurate dialog_id_map.
- Add in support for printing out camera position when 'c' is pressed.  Note, 
it turns out that
    this info can be found in the Camera dialog... so perhaps this isn't 
necessary...
- Add a "Are you sure" dialog before quitting.  (Note, 'quit'ing is still 
broken as it doesn't actually quit).
- Move dialogs to the mouse cursor when they are raised so it is easier for 
the user to interact with them.
- Moved common helper functions (moveToMouse and opj) here.

M    SwigInterface/LightFrame.py

- Renamed "button" to "closeButton" to be a little more descriptive.
- Don't destroy on close, just hide the dialog so it can be reused.

M    UserInterface/XWindowUI.cc

- Cosmetic fix.




Modified: trunk/SwigInterface/LightFrame.py
==============================================================================
--- trunk/SwigInterface/LightFrame.py   (original)
+++ trunk/SwigInterface/LightFrame.py   Fri Dec 12 15:03:13 2008
@@ -36,21 +36,21 @@
 
         mlteButton = wx.Button(self, -1, "Move Light To Eye")
 
-        button = wx.Button(self, -1, "Close")
+        closeButton = wx.Button(self, -1, "Close")
         panel.SetSizer(gbs)
 
         vsizer.Add( panel, 0, wx.EXPAND );
 
         hsizer = wx.BoxSizer( wx.HORIZONTAL );
-        hsizer.Add( mlteButton, 0, wx.ALIGN_CENTER );
-        hsizer.Add( button, 0, wx.ALIGN_CENTER );
+        hsizer.Add( mlteButton,  0, wx.ALIGN_CENTER );
+        hsizer.Add( closeButton, 0, wx.ALIGN_CENTER );
         
         vsizer.Add( hsizer, 0, wx.ALIGN_CENTER );
         self.SetSizerAndFit( vsizer );
 
-        self.Bind(wx.EVT_BUTTON, self.MoveLightToEye, mlteButton)
-        self.Bind(wx.EVT_BUTTON, self.OnCloseMe, button)
-        self.Bind(wx.EVT_CLOSE, self.OnCloseWindow)        
+        self.Bind( wx.EVT_BUTTON, self.MoveLightToEye, mlteButton)
+        self.Bind( wx.EVT_BUTTON, self.OnClose, closeButton)
+        self.Bind( wx.EVT_CLOSE,  self.OnClose )
 
     def MoveLightToEye(self, event):
         point_light = PointLight.fromLight( 
self.engine.getScene().getLights().getLight(0) )
@@ -65,12 +65,6 @@
                                    
manta_new(createMantaTransaction(point_light.setPosition, cbArgs)))
         # FIXME: Update spinner with new values.
         #        Probably need to add this button every spinner frame...
-
-    def OnCloseMe(self, event):
-        self.Close(True)
-
-    def OnCloseWindow(self, event):
-        self.Destroy()
         
     def addLight(self, where, light):
         point_light = PointLight.fromLight(light)
@@ -236,3 +230,6 @@
         except:
             wx.LogError("Button not found")
 
+    def OnClose( self, event ):
+        # Don't destroy... just remove it from the screen so it can be used 
later.
+        self.Show( False )

Modified: trunk/SwigInterface/ThreadsFrame.py
==============================================================================
--- trunk/SwigInterface/ThreadsFrame.py (original)
+++ trunk/SwigInterface/ThreadsFrame.py Fri Dec 12 15:03:13 2008
@@ -27,9 +27,10 @@
         hsizer.Add(wx.StaticText(self,-1,"(%d cores)" % 
Thread.numProcessors()), 0, wx.ALIGN_CENTER);
         vsizer.Add(hsizer);
 
+        self.Bind( wx.EVT_CLOSE, self.OnClose )
+
         # Rendering time.
         
-        
         self.SetSizerAndFit( vsizer );
 
     # Change the number of workers.
@@ -37,3 +38,7 @@
         np = event.GetInt()
         self.engine.addTransaction("processor count change",
                                    
manta_new(createMantaTransaction(self.engine.changeNumWorkers, (np,)) ))      
  
+
+    def OnClose( self, event ):
+        # Don't destroy... just remove it from the screen so it can be used 
later.
+        self.Show( False )

Modified: trunk/SwigInterface/wxManta.py
==============================================================================
--- trunk/SwigInterface/wxManta.py      (original)
+++ trunk/SwigInterface/wxManta.py      Fri Dec 12 15:03:13 2008
@@ -273,7 +273,9 @@
         # Create the StatusBar
         self.statusbar = self.CreateStatusBar()
 
-        # Create the dialog map
+        # The dialog_id_map holds pointers from the (arbitrary) wxId to the 
dialog's class
+        self.dialog_id_map = {}
+        # The dialog_map holds pointers from the (arbitrary) wxId to the 
instantiation of the class
         self.dialog_map = {}
         
         # Create the menu
@@ -285,13 +287,13 @@
 
         # Threads.
         dialog_id = wx.NewId()
-        self.dialog_map[dialog_id] = ThreadsFrame
+        self.dialog_id_map[dialog_id] = ThreadsFrame
         self.Bind(wx.EVT_MENU, self.OnShowDialog, 
                   self.manta_menu.Append(dialog_id, "Threads"))
 
         # Python Shell
         dialog_id = wx.NewId()
-        self.dialog_map[dialog_id] = MantaShellFrame
+        self.dialog_id_map[dialog_id] = MantaShellFrame
         self.Bind(wx.EVT_MENU, self.OnShowDialog, 
                   self.manta_menu.Append(dialog_id, "Python Shell"))
 
@@ -311,25 +313,25 @@
 
         # Edit camera dialog.
         dialog_id = wx.NewId()
-        self.dialog_map[dialog_id] = CameraFrame
+        self.dialog_id_map[dialog_id] = CameraFrame
         self.Bind(wx.EVT_MENU, self.OnShowDialog, 
                   self.view_menu.Append(dialog_id, "Edit Camera"))
 
         #Edit Background dialog.
         dialog_id = wx.NewId()
-        self.dialog_map[dialog_id] = BackgroundFrame
+        self.dialog_id_map[dialog_id] = BackgroundFrame
         self.Bind(wx.EVT_MENU, self.OnShowDialog,
                   self.view_menu.Append(dialog_id, "Edit Background"))
 
         # Camera Path dialog.
         dialog_id = wx.NewId()
-        self.dialog_map[dialog_id] = MantaCameraPathFrame
+        self.dialog_id_map[dialog_id] = MantaCameraPathFrame
         self.Bind( wx.EVT_MENU, self.OnShowDialog,
                    self.view_menu.Append(dialog_id, "Camera Paths"))
 
         # Capture frames dialog.
         dialog_id = wx.NewId()
-        self.dialog_map[dialog_id] = MantaCaptureFrame
+        self.dialog_id_map[dialog_id] = MantaCaptureFrame
         self.Bind( wx.EVT_MENU, self.OnShowDialog,
                    self.view_menu.Append(dialog_id, "Capture Frames"))
 
@@ -339,7 +341,7 @@
         self.light_menu = wx.Menu()
         
         light_dialog_id = wx.NewId()
-        self.dialog_map[light_dialog_id] = LightFrame
+        self.dialog_id_map[light_dialog_id] = LightFrame
         self.Bind(wx.EVT_MENU, self.OnShowDialog,
                   self.light_menu.Append(light_dialog_id, "Edit Lights"))
         light_dialog_id = wx.NewId()
@@ -610,8 +612,14 @@
         key = event.GetKeyCode()
         if (key < 256):
             key = chr(key)
+
+            # WARNING: Not sure why, but the comparison below MUST be with 
the capital letter...
+
             if key == "L":
                 LightFrame(self, self.engine).Show()
+            elif key == 'C':
+                self.engine.addTransaction("output camera",
+                                           
manta_new(createMantaTransaction(self.showCameraPosition, () )))
             elif key == 'P':
                 change = 1
                 if (event.ShiftDown()):
@@ -621,8 +629,11 @@
             elif key == 'I':
                 self.toggleVisibleLights()
             elif key == 'Q':
-                print "Quitting"
-                self.Close()
+                dialog = wx.MessageDialog( None, 'Are you sure you want to 
quit?', 'Quit?',
+                                           wx.CANCEL | wx.OK | wx.NO_DEFAULT 
| wx.ICON_EXCLAMATION )
+                result = dialog.ShowModal()
+                if result == wx.ID_OK :
+                    self.Close()
             elif key == 'T':
                 self.OnTKey(event)
             elif key == 'V':
@@ -656,13 +667,21 @@
     
###########################################################################
     def OnShowDialog(self, event):
         # Get the dialog
-        dialog = self.dialog_map[event.GetId()]
-        if (dialog == None):
+        dialog_id = self.dialog_id_map[event.GetId()]
+        if (dialog_id == None):
             wx.LogError("Unknown dialog ID")
             return
 
-        # Invoke the constructor.
-        dialog(self, self.engine).Show()
+        if event.GetId() not in self.dialog_map :
+            # Create the dialog
+            dialog = dialog_id(self, self.engine)
+            self.dialog_map[event.GetId()] = dialog
+        else :
+            dialog = self.dialog_map[event.GetId()]
+
+        moveToMouse( dialog )
+        dialog.Raise()
+        dialog.Show( True )
 
     
###########################################################################
     ## OnAbout
@@ -894,6 +913,15 @@
             return Vector(x,y,z)
 
     
###########################################################################
+    ## showCameraPosition
+    
###########################################################################
+    def showCameraPosition(self):
+        data = self.engine.getCamera(0).getBasicCameraData()        
+        print "Camera: " + str(data.eye.x()) + ", " + str(data.eye.y()) + ", 
" + str(data.eye.z())
+        print "        " + str(data.lookat.x()) + ", " + 
str(data.lookat.y()) + ", " + str(data.lookat.z())
+        print "        " + str(data.up.x()) + ", " + str(data.up.y()) + ", " 
+ str(data.up.z())
+
+    
###########################################################################
     ## changeNumWorkers
     
###########################################################################
     def changeNumWorkers(self, value, change):
@@ -937,6 +965,21 @@
 
         self.statusbar.SetStatusText(text, 0)
         
+
+###############################################################################
+# Helper Functions
+
+def moveToMouse( window ) :
+    window.Move( (wx.GetMouseState().GetX(),wx.GetMouseState().GetY()) )
+    
+def opj(path):
+    # copied from demo.py
+    """Convert paths to the platform-specific separator"""
+    str = apply(os.path.join, tuple(path.split('/')))
+    # HACK: on Linux, a leading / gets lost...
+    if path.startswith('/'):
+        str = '/' + str
+    return str
 
 ###########################################################################
 ## usage

Modified: trunk/UserInterface/XWindowUI.cc
==============================================================================
--- trunk/UserInterface/XWindowUI.cc    (original)
+++ trunk/UserInterface/XWindowUI.cc    Fri Dec 12 15:03:13 2008
@@ -70,13 +70,13 @@
     ui->removeConnection(fd);
 }
 
-XWindowUI::XWindowUI(const vector<string>& args, MantaInterface 
*rtrt_interface)
-  : rtrt_interface(rtrt_interface),
-    path( 0 ),
-    timeView(0),
-    xlock("XWindowUI display lock"),
-    xsema("XWindowUI semaphore", 0),
-    quitting(false)
+XWindowUI::XWindowUI(const vector<string>& args, MantaInterface 
*rtrt_interface) :
+  rtrt_interface(rtrt_interface),
+  path( 0 ),
+  timeView(0),
+  xlock("XWindowUI display lock"),
+  xsema("XWindowUI semaphore", 0),
+  quitting(false)
 {
   bool quit=false;
   int max_count=0;

Modified: trunk/scenes/csafe/python/CMakeLists.txt
==============================================================================
--- trunk/scenes/csafe/python/CMakeLists.txt    (original)
+++ trunk/scenes/csafe/python/CMakeLists.txt    Fri Dec 12 15:03:13 2008
@@ -1,8 +1,8 @@
 
 INCLUDE(${CMAKE_SOURCE_DIR}/CMake/PythonInvoke.cmake)
 
-PYTHON_ADD_EXECUTABLE(csafe_demo
-  ${CMAKE_CURRENT_SOURCE_DIR}/csafe_demo.py
+PYTHON_ADD_EXECUTABLE(csafe_scene
+  ${CMAKE_CURRENT_SOURCE_DIR}/csafe_scene.py
   ${CMAKE_CURRENT_SOURCE_DIR}
   ${CMAKE_SOURCE_DIR}/SwigInterface
   ${LIBRARY_OUTPUT_PATH}

Modified: trunk/scenes/csafe/python/Configuration.py
==============================================================================
--- trunk/scenes/csafe/python/Configuration.py  (original)
+++ trunk/scenes/csafe/python/Configuration.py  Fri Dec 12 15:03:13 2008
@@ -5,9 +5,12 @@
 import Histogram
 import TransferF
 import wxManta
+
 from csafe import *
 from manta import *
 
+from pycallback import *
+
 def WriteConfiguration(scene, filename):
 
     # Make sure the 'filename' ends with ".cfg".  If not, add it.
@@ -29,6 +32,15 @@
             f.write(str(c[0])+' '+str(c[1])+' '+str(c[2])+' '+str(c[3])+' 
'+str(c[4])+'\n')
         f.write('\n\n')
     histoGroups = scene.frame.histoGroups
+
+    f.write('[currentHistogram]\n')
+    f.write( str( scene.frame.histoGroups.index( scene.currentHistogram ) ) )
+    f.write('\n\n')
+
+    f.write('[currentParticleHistogram]\n')
+    f.write( str( scene.frame.histoGroups.index( 
scene.currentParticleHistogram ) ) )
+    f.write('\n\n')
+
     for i in range(len(histoGroups)):
         h = histoGroups[i]
         f.write('[Histogram]\n')
@@ -40,6 +52,15 @@
         f.write(str(h.histogram.cropDMin)+' '+str(h.histogram.cropDMax)+'\n')
         f.write(str(h.transferFID)+'\n')
         f.write('\n\n')
+
+    f.write('[Eye]\n')
+    data = scene.engine.getCamera(0).getBasicCameraData()        
+    f.write( str(data.eye.x())    + " " + str(data.eye.y())    + " " + 
str(data.eye.z())  + "\n" )
+    f.write( str(data.lookat.x()) + " " + str(data.lookat.y()) + " " + 
str(data.lookat.z()) + "\n" )
+    f.write( str(data.up.x())     + " " + str(data.up.y())     + " " + 
str(data.up.z()) + "\n" )
+    f.write( str(data.hfov)       + " " + str(data.vfov) + "\n" )
+    f.write( '\n' )
+
     f.write('[Scene Properties]\n')
     f.write(str(scene.duration)+'\n')
     f.write(str(scene.ridx)+'\n')
@@ -109,6 +130,17 @@
                 slices.push_back(ColorSlice(pos, 
RGBAColor(Color(RGBColor(r,g,b)), a)))
                 
             
scene.frame.transferFunctions.append(TransferF.TransferF(scene.frame, colors, 
id, name, manta_new(RGBAColorMap(slices))))
+
+        #### Current Histogram ####
+        elif lines[i].find("[currentHistogram]") != -1:
+            i +=1
+            currentHistogramIndex = int( lines[i].strip() )
+
+        #### Current Histogram ####
+        elif lines[i].find("[currentParticleHistogram]") != -1:
+            i +=1
+            currentParticleHistogramIndex = int( lines[i].strip() )
+
         #### Histogram ####
         elif lines[i].find("[Histogram]") != -1:
             i +=1
@@ -137,7 +169,15 @@
             histoGroup = Histogram.HistogramGroup(scene.frame.panel, scene, 
index, name, transferFID)
             histoGroup.SetBackgroundColour(wx.Colour(90,90,90))
             histoGroup.group = group
+
+            if( len( scene.frame.histoGroups ) == currentHistogramIndex ) :
+                scene.currentHistogram = histoGroup
+
+            if( len( scene.frame.histoGroups ) == 
currentParticleHistogramIndex ) :
+                scene.currentParticleHistogram = histoGroup
+
             scene.frame.histoGroups.append(histoGroup)
+
             #TODO: read these in
             if (group == 1):
                 
scene.test.setVolCMap(scene.frame.transferFunctions[transferFID].cmap)
@@ -147,6 +187,39 @@
             #     scene.test.setSphereCMinMax(index, cropColorMin, 
cropColorMax)
             # else:
             #     scene.test.setVolCMinMax(cropColorMin, cropColorMax)
+
+        ##### Eye (Camera) ####
+        elif lines[i].find("[Eye]") != -1:
+            i+=1
+            line = lines[i].split()
+            x = float(line[0])
+            y = float(line[1])
+            z = float(line[2])
+            eye = manta_new( Vector(x, y, z) )
+
+            i+=1
+            line = lines[i].split()
+            x = float(line[0])
+            y = float(line[1])
+            z = float(line[2])
+            lookat = manta_new( Vector(x, y, z) )
+
+            i+=1
+            line = lines[i].split()
+            x = float(line[0])
+            y = float(line[1])
+            z = float(line[2])
+            up     = manta_new( Vector(x, y, z) )
+
+            i+=1
+            line = lines[i].split()
+            h = float(line[0]) # h-fov
+            v = float(line[1]) # v-fov
+
+            cbArgs = ( manta_new( BasicCameraData( eye, lookat, up, h, v ) 
), )
+            scene.engine.addTransaction( "Set basic camera data",
+                                         manta_new( createMantaTransaction( 
scene.engine.getCamera(0).setBasicCameraData,
+                                                                            
cbArgs)))
 
         ##### Scene Properties ####
         elif lines[i].find("[Scene Properties]") != -1:

Modified: trunk/scenes/csafe/python/Histogram.py
==============================================================================
--- trunk/scenes/csafe/python/Histogram.py      (original)
+++ trunk/scenes/csafe/python/Histogram.py      Fri Dec 12 15:03:13 2008
@@ -9,8 +9,9 @@
 import TransferF
 import wx.lib.foldpanelbar
 
-from csafe      import *
-from csafe_demo import setup, moveToMouse
+from csafe       import *
+from csafe_scene import setup
+from wxManta     import moveToMouse, opj
 
 data = []
 numBuckets = 1
@@ -25,15 +26,6 @@
 colors = []
 measurementsWindow = []
 
-def opj(path):
-    #copied from demo.py
-    """Convert paths to the platform-specific separator"""
-    str = apply(os.path.join, tuple(path.split('/')))
-    # HACK: on Linux, a leading / gets lost...
-    if path.startswith('/'):
-        str = '/' + str
-    return str
-
 class HistogramPanel(wx.Panel):
     def __init__(self, parent,histValues, dataMin, dataMax, width, height, 
transferF, scene, varIndex):
         self.scene = scene
@@ -154,7 +146,7 @@
         elif (pos >= self.cropMin and pos <= self.cropMax):
             self.dragging = True
             self.dragWidth = abs((float(self.cropMax) - float(self.cropMin)))
-        else: #selecting
+        else: # selecting
             self.selecting = True
             self.draggingLeft = False
             self.draggingRight = False
@@ -212,7 +204,7 @@
             self.UpdateDMinMax()
             self.Refresh()
             update_clip = True
-        if (update_clip and self.parent.group != 1):  #if not the volumedata
+        if (update_clip and self.parent.group != 1):  # if not the volumedata
             index = self.varIndex;
             min = float(self.cropDMin - 0.00001)
             max = float(self.cropDMax + 0.00001)
@@ -238,8 +230,8 @@
         else:
            self.dMin = self.dMax = 0.0
         dWidth = self.dMax - self.dMin
-        self.cropDMin = self.cropMin*dWidth + self.dMin #cropped data min
-        self.cropDMax = self.cropMax*dWidth + self.dMin #cropped data max
+        self.cropDMin = self.cropMin*dWidth + self.dMin # cropped data min
+        self.cropDMax = self.cropMax*dWidth + self.dMin # cropped data max
         
     def UpdateCropToD(self):
         dWidth = self.dMax - self.dMin
@@ -270,8 +262,9 @@
            absWidth = 1.0
         dWidth = dMax - dMin        
 
-     #   lines.append( (0,0, 50, 50) )
-        #function(lines, range(0.0, 1.0))
+        # lines.append( (0,0, 50, 50) )
+        # function(lines, range(0.0, 1.0))
+
         start = float((dMin - absoluteDMin)/absWidth*float(numBuckets))
         if (numBuckets > 0):
            step = float((dWidth/absWidth)/float(width))*float(numBuckets)
@@ -288,7 +281,7 @@
         blx = 0.0 + barWidth/2.0 + self.paddingW/2.0 # bottom left x
         bly = 0.0 + height - barWidth/2.0
         
-        hMin = 99999.0 #min and max frequencies
+        hMin = 99999.0 # min and max frequencies
         hMax = -999999.0
     
         
@@ -309,7 +302,7 @@
         colorWidth = float(self.colorDMax - self.colorDMin)
         croppedHeightValues = int(width)*[0]
         for i in range(0,int(width)):
-            #frequency = len( [x for x in data if (x >= start and x <= end)] 
)
+            # frequency = len( [x for x in data if (x >= start and x <= 
end)] )
             start2 = int(start)
             end2 = int(end)
             if (start2 == end2):
@@ -330,27 +323,27 @@
             for i in range(0, width):
                 frequency = croppedHeightValues[i]
                 barHeightNorm = float(frequency)/float(hMax)
-                #print str(frequency) + " " + str(barHeightNorm)
+                # print str(frequency) + " " + str(barHeightNorm)
                 if float(barHeightNorm) > 1.0:
                     print "error"
-               # print '%f %f %f %f' % (frequency, start, end, barHeightNorm)
-               # colorPos = (( (float(i)/width)*(absoluteDMax-absoluteDMin)) 
+ absoluteDMin- self.colorDMin)/colorWidth
+                # print '%f %f %f %f' % (frequency, start, end, 
barHeightNorm)
+                # colorPos = (( 
(float(i)/width)*(absoluteDMax-absoluteDMin)) + absoluteDMin- 
self.colorDMin)/colorWidth
                 colorPos = (( 
(float(i)/width)*(self.zoomDMax-self.zoomDMin)) + self.zoomDMin- 
self.colorDMin)/colorWidth
-                #print colorPos
+                # print colorPos
                 color = self.transferF.GetColor(colorPos)
                 self.lines.append( (color, ( blx + i, bly, blx + i, (bly - 
barHeightNorm*height) ) ) )
         self.Refresh()
        
     def OnPaint(self, evt=None):
         pdc = wx.PaintDC(self)
-        #pdc.Clear()
+        # pdc.Clear()
         try:
           dc = wx.GCDC(pdc)
         except:
           dc = pdc
-        #gc = wx.GraphicsContext.Create(dc)       
+        # gc = wx.GraphicsContext.Create(dc)       
         dc.SetPen(wx.Pen("BLACK", 1) )
-        #dc.DrawRectangle( 0, 0, width, height) 
+        # dc.DrawRectangle( 0, 0, width, height) 
         
         self.DrawLines(dc)
         try:
@@ -368,7 +361,7 @@
         cropWidth = (float(cropMax) - float(cropMin))*float(self.width)
         dc.DrawRectangle(float(cropMin)*float(self.width) + 
self.paddingW/2.0 , 0, cropWidth, self.height)
         
-        #draw cropping texta
+        # draw cropping texta
         dc.SetTextForeground(wx.Colour(255,255,255))
         self.SetForegroundColour(wx.Colour(255,0,0))
         dc.SetPen(wx.Pen(wx.Colour(255,255,255), 1))
@@ -393,7 +386,7 @@
            xpos -= diff
         dc.DrawTextPoint(string, (xpos,ypos))
         
-        #draw min/max text
+        # draw min/max text
         ypos = self.height
         if self.scene.biggify:
               ypos = self.height
@@ -412,9 +405,9 @@
 
     def DrawLines(self, dc):
 
-        #dc.BeginDrawing()
+        # dc.BeginDrawing()
         for i in range(0, len(self.lines)):
-            #pos = float(i)/float(len(self.lines))
+            # pos = float(i)/float(len(self.lines))
             a = self.lines[i][0][3]*255.0
             r = self.lines[i][0][0]*255.0
             g = self.lines[i][0][1]*255.0
@@ -426,9 +419,9 @@
             dc.SetPen(wx.Pen(penColor, self.barWidth))
             dc.DrawLine( self.lines[i][1][0], self.lines[i][1][1], 
self.lines[i][1][2], self.lines[i][1][3])
         
-        #dc.DrawLineList(lines)
-        #dc.DrawLine(0,0,50,50)
-        #dc.EndDrawing()
+        # dc.DrawLineList(lines)
+        # dc.DrawLine(0,0,50,50)
+        # dc.EndDrawing()
  
 
 ###################################################################
@@ -452,7 +445,7 @@
         self.numbuckets = self.scene.histogramBuckets
         self.width = 300.0
         self.height = 40.0
-        self.group = 0 #0 = spheres, 1 = volume
+        self.group = 0 # 0 = spheres, 1 = volume
         
         self.CreateElements()
         self.SetBackgroundColour(scene.bgColor)
@@ -508,20 +501,20 @@
         path = setup.csafe_scene_path
 
         self.vs = vs = wx.BoxSizer( wx.VERTICAL )
-        box1_title = wx.StaticBox( self, -1, self.title )
+        box1_title = wx.StaticBox( self, -1, self.title + " (" + str( 
self.varIndex ) + ")" )
 
         box1_title.SetForegroundColour( wx.WHITE ) # Make label readable!
 
         self.histogram = HistogramPanel( self, self.datavalues, 
self.dataMin, self.dataMax, self.width, self.height,
                                          self.transferF, self.scene, 
self.varIndex )
         self.box1 = box1 = wx.StaticBoxSizer( box1_title, wx.VERTICAL )
-        #grid1 = wx.FlexGridSizer( 2, 2, 0, 0 )
+        # grid1 = wx.FlexGridSizer( 2, 2, 0, 0 )
         gbs = wx.GridBagSizer(1,3)
         self.sizer = box1
         
-        #wx.EVT_LEFT_DOWN(self.histogram, self.OnClick)
-        #self.SetFocus()
-      #  self.histogram.Bind(wx.EVT_LEFT_DOWN, self.OnClick)
+        # wx.EVT_LEFT_DOWN(self.histogram, self.OnClick)
+        # self.SetFocus()
+        # self.histogram.Bind(wx.EVT_LEFT_DOWN, self.OnClick)
         
         gbs.Add(self.histogram,(0, 0), (2, 2) )
         if self.scene.histogramBMPLoaded == False:
@@ -548,7 +541,7 @@
 
         self.colorB = colorB
         self.rulerB = wx.BitmapButton(self, -1, self.bmpRuler, (0,0), 
style=wx.NO_BORDER)
-        self.rulerB.SetToolTip( wx.ToolTip( "Options" ) )
+        self.rulerB.SetToolTip( wx.ToolTip( "Press to set clipping range 
explicitly." ) )
 
         self.zoomInB = wx.BitmapButton(self, -1, self.bmpZoomIn, (0,0), 
style=wx.NO_BORDER)
         self.zoomInB.SetToolTip( wx.ToolTip( "Zoom In" ) )
@@ -564,9 +557,9 @@
         
         
         vs2 = wx.BoxSizer( wx.VERTICAL )
-        #vs3 = wx.BoxSizer( wx.VERTICAL )
-        #box1_title2 = wx.StaticBox( self, -1, "" )
-        #box2 = wx.StaticBoxSizer( box1_title2, wx.VERTICAL )
+        # vs3 = wx.BoxSizer( wx.VERTICAL )
+        # box1_title2 = wx.StaticBox( self, -1, "" )
+        # box2 = wx.StaticBoxSizer( box1_title2, wx.VERTICAL )
         vs2.Add( visibilityB, wx.ALIGN_CENTRE|wx.ALL, 0, 10)
         space = (0,0)
         vs2.AddSpacer(space)
@@ -584,9 +577,9 @@
         vsH = wx.BoxSizer(wx.HORIZONTAL)
         vsH.Add(vs2, wx.ALIGN_CENTER|wx.ALL,0)
         vsH.Add(vs3, wx.ALIGN_CENTER|wx.ALL,0)  
-        #vs3.Layout()
+        # vs3.Layout()
         gbs.Add(vsH, (0, 2), (2, 1))
-        #gbs.Add(vs3, (0, 3), (2, 1))
+        # gbs.Add(vs3, (0, 3), (2, 1))
         
         
         gbs.Layout()
@@ -594,7 +587,7 @@
         box1.Add( gbs, 0, wx.ALIGN_CENTRE|wx.ALL, 0 )
         self.box1 = box1
         vs.Add( box1, 0, wx.ALIGN_CENTRE|wx.ALL, 0 )
-        #vs.Add(grid1, 0, wx.ALIGN_CENTRE|wx.ALL, 5 )
+        # vs.Add(grid1, 0, wx.ALIGN_CENTRE|wx.ALL, 5 )
         self.SetSizer( vs )
         vs.Fit( self )
         self.visible = True
@@ -611,7 +604,7 @@
         measurementsWindow.Raise()
 
     def SendValues(self, zoomMin, zoomMax, cropMin, cropMax, colorMin, 
colorMax):  # sent from MeasurementsFrame
-        #print "values arrived"
+        # print "values arrived"
         self.histogram.zooms.append( (self.histogram.zoomDMin, 
self.histogram.zoomDMax))
         self.histogram.zoomDMin = zoomMin
         self.histogram.zoomDMax = zoomMax
@@ -634,8 +627,8 @@
         if self.histogram.cropDMax > 1.0:
             self.histogram.cropDMax = 1.0
             
-        self.histogram.cropDMin = self.histogram.cropMin*dWidth + 
self.histogram.dMin #cropped data min
-        self.histogram.cropDMax = self.histogram.cropMax*dWidth + 
self.histogram.dMin #cropped data max
+        self.histogram.cropDMin = self.histogram.cropMin*dWidth + 
self.histogram.dMin # cropped data min
+        self.histogram.cropDMax = self.histogram.cropMax*dWidth + 
self.histogram.dMin # cropped data max
         if (self.histogram.parent.group == 0):
             if self.transferFPanel.transferFPanel.histogramGroup == self:
                 
self.scene.test.setSphereColorMinMax(self.histogram.varIndex, colorMin, 
colorMax)
@@ -652,23 +645,29 @@
         self.histogram.Update()
         
     def OnClickColor(self, evt):
-        #self.transferFPanel.SetLabel(self.transferF.GetLabel())
+        # self.transferFPanel.SetLabel(self.transferF.GetLabel())
+
+        if( evt != None ) : #  evt == None if called in csafe_scene for 
initialization.
+            self.scene.currentHistogram = self
+            if (self.group == 0 ): # group 0 == Particles.
+                self.scene.currentParticleHistogram = self
+
         self.transferFPanel.transferFPanel.SetHistogramGroup(self)
         self.transferFPanel.SetTransferF(self.transferF)
         self.transferFPanel.SetUpdateFunction(self.Update())
         if self.varIndex != self.scene.volVar:
-                self.scene.test.setCidx(self.varIndex)        
-                if (self.transferF != None):
-                        self.scene.test.setSphereCMap(self.transferF.cmap)
-                        self.scene.test.setSphereColorMinMax(self.varIndex,  
self.histogram.colorDMin,  self.histogram.colorDMax)
+            self.scene.test.setCidx(self.varIndex)        
+            if (self.transferF != None):
+                self.scene.test.setSphereCMap(self.transferF.cmap)
+                self.scene.test.setSphereColorMinMax(self.varIndex,  
self.histogram.colorDMin,  self.histogram.colorDMax)
 
     def OnClickVisible(self, evt):
         if self.visible:
             path = setup.csafe_scene_path
             self.sizer.ShowItems(False)
-            #self.sizer.Show(self.visibilityB, True, True)
-            #self.sizer.Show(self.historgram, False, True)
-            #self.sizer.Show(self.colorB, False, True)
+            # self.sizer.Show(self.visibilityB, True, True)
+            # self.sizer.Show(self.historgram, False, True)
+            # self.sizer.Show(self.colorB, False, True)
             self.visible = False
 
             box1_title = wx.StaticBox( self, -1, self.title )
@@ -684,37 +683,37 @@
 
             box.Add(visibilityB, wx.ALIGN_CENTRE|wx.ALL, 0, 0)
             self.Bind(wx.EVT_BUTTON, self.OnClickVisible, visibilityB)
-            #p = wx.Panel(self.parent, -1)
-            #text = wx.StaticText(self.parent, -1, "warg?", (20, 10))
+            # p = wx.Panel(self.parent, -1)
+            # text = wx.StaticText(self.parent, -1, "warg?", (20, 10))
 
-            #box.Add(text, wx.ALIGN_CENTRE|wx.ALL, 0, 0 )
+            # box.Add(text, wx.ALIGN_CENTRE|wx.ALL, 0, 0 )
             box.AddSpacer((100,0))
-            #box.Layout()
+            # box.Layout()
             sizer.Add(box)
             sizer.Layout()
             self.SetSizer(box)
             box.Fit(self)
-            #sizer.Fit(self)
-            #self.vs.SetDimension(0,0,0,0)
-            #self.vs.Clear(False)
-            #self.vs.Add( self.visibilityB, wx.ALIGN_CENTRE|wx.ALL, 0, 10)
-            #self.vs.Clear()
-            #self.vs.Fit(self)
-           # self.vs.SetSize(100, 100)
-            #self.vs.Layout()
-            #self.SetMaxSize((100, 10))
+            # sizer.Fit(self)
+            # self.vs.SetDimension(0,0,0,0)
+            # self.vs.Clear(False)
+            # self.vs.Add( self.visibilityB, wx.ALIGN_CENTRE|wx.ALL, 0, 10)
+            # self.vs.Clear()
+            # self.vs.Fit(self)
+            # self.vs.SetSize(100, 100)
+            # self.vs.Layout()
+            # self.SetMaxSize((100, 10))
             self.scene.frame.panel.GetSizer().Layout()
             self.parent.Refresh()
         else:
-            #self.SetSizer(self.vs)
-            #self.vs.Fit(self)
-            #self.vs.Clear(False)
-            #self.vs.Add(self.box1)
-            #self.sizer.ShowItems(True)
-            #self.visible = True
-            #self.SetSizer( vs )
-            #vs.Fit( self )
-            #self.vs.Layout()
+            # self.SetSizer(self.vs)
+            # self.vs.Fit(self)
+            # self.vs.Clear(False)
+            # self.vs.Add(self.box1)
+            # self.sizer.ShowItems(True)
+            # self.visible = True
+            # self.SetSizer( vs )
+            # vs.Fit( self )
+            # self.vs.Layout()
             self.GetSizer().ShowItems(False)
             self.GetSizer().Clear()
             self.CreateElements()
@@ -737,7 +736,7 @@
         self.zoomText = wx.StaticText(self, -1, "Zoom into data values: ", 
(20, 10))
         self.zoomMinTcl = wx.TextCtrl(self, -1, str(zoomMin), size=(125, -1))
         self.zoomMaxTcl = wx.TextCtrl(self, -1, str(zoomMax), size=(125, -1))
-        if (group == 0): # spheres
+        if (group == 0): # Particles
             self.cropText = wx.StaticText(self, -1, "Crop displayed data 
values: ", (20, 10))
             self.cropMinTcl = wx.TextCtrl(self, -1, str(cropMin), size=(125, 
-1))
             self.cropMaxTcl = wx.TextCtrl(self, -1, str(cropMax), size=(125, 
-1))

Modified: trunk/scenes/csafe/python/SceneMenus.py
==============================================================================
--- trunk/scenes/csafe/python/SceneMenus.py     (original)
+++ trunk/scenes/csafe/python/SceneMenus.py     Fri Dec 12 15:03:13 2008
@@ -620,8 +620,10 @@
        sizer = wx.BoxSizer(wx.VERTICAL)
 
        hSizer1 = wx.BoxSizer(wx.HORIZONTAL)
-       list = ['spheres','volume']
-       text1 = wx.StaticText(panel, -1, "Select data type: ")
+
+       #  'Particle' and 'Volume' must remain in this order... or other 
things have to be fixed (EvtChoice).
+       list = ['Particle','Volume']
+       text1 = wx.StaticText(panel, -1, "Variable type: ")
        self.ch = wx.Choice(panel,-1,(100, 50), choices=list)
        hSizer1.Add(text1, 0, wx.ALL,3)
        hSizer1.Add(self.ch,0,wx.ALL,3)
@@ -630,7 +632,7 @@
        self.Bind(wx.EVT_CLOSE, self.OnCloseWindow)
 
        hSizer2 = wx.BoxSizer(wx.HORIZONTAL)
-       text2 = wx.StaticText(panel,-1,"Index in data: ")
+       text2 = wx.StaticText(panel,-1,"Index in NRRD: ")
        self.indexSP = wx.SpinCtrl(panel, -1, "", (30,50))
        self.indexSP.SetRange(0, 100)
        self.indexSP.SetValue(0)
@@ -723,23 +725,12 @@
     def OnClickCancel(self, evt):
         self.Close(True)
 
-
     def EvtChoice(self, e):
-          ch = e.GetString()
-           if ch == 'spheres':
-                 self.group = 0
-           else:
-                 self.group = 1
+        self.group = e.GetSelection()
           
     def OnCloseMe(self, evt):
         self.Close(True)
 
     def OnCloseWindow(self, evt):
         self.Destroy()
-
-
-
-
-
-
 

Modified: trunk/scenes/csafe/python/TransferF.py
==============================================================================
--- trunk/scenes/csafe/python/TransferF.py      (original)
+++ trunk/scenes/csafe/python/TransferF.py      Fri Dec 12 15:03:13 2008
@@ -2,23 +2,14 @@
 import wx
 import Histogram
 import random
-import wxManta
 
-from manta      import *
-from csafe      import *
-from csafe_demo import setup
+from manta       import *
+from csafe       import *
+from csafe_scene import setup
+from wxManta     import opj
 
 colors = [] # (pos, r, g, b, a)
 
-def opj(path):
-    #copied from demo.py
-    """Convert paths to the platform-specific separator"""
-    str = apply(os.path.join, tuple(path.split('/')))
-    # HACK: on Linux, a leading / gets lost...
-    if path.startswith('/'):
-        str = '/' + str
-    return str
-
 class TransferF(wx.Object):
     def __init__(self, parent, colorsn, id, title="untitled", cmap = None):
 
@@ -62,10 +53,10 @@
             
     def MoveColor(self, index, pos):
         c = (  pos, self.colors[index][1],self.colors[index][2], 
self.colors[index][3], self.colors[index][4] ) 
-        #c = ( 0.5 , 1, 0, 0, 1)
-        #print index
+        # c = ( 0.5 , 1, 0, 0, 1)
+        # print index
         self.colors[index] = c
-        #self.colors.sort()
+        # self.colors.sort()
             
     def AddColor(self, color, pos):
         if (len(color) == 3):
@@ -74,7 +65,7 @@
                 self.colors.append( (  pos, color[0], color[1], color[2], 
color[3] ) )
         else:
             blowuphorribly
-        #self.colors.sort()
+        # self.colors.sort()
         
     def SetColor(self, index, color):
         pos = self.colors[index][0]
@@ -88,7 +79,7 @@
         self.colors[index] = c
         
         
-    def GetColor(self, pos):  #color at position pos, in range [0,1]
+    def GetColor(self, pos):  # color at position pos, in range [0,1]
         colors = []
         for i in range(len(self.colors)):
             colors.append( (self.colors[i][0], self.colors[i][1], 
self.colors[i][2], self.colors[i][3], self.colors[i][4] ) )
@@ -109,8 +100,8 @@
             index2 = len(colors) - 1
         
         
-        #print index1
-        #print index2
+        # print index1
+        # print index2
         
         pos1 = colors[index1][0]
         pos2 = colors[index2][0]
@@ -128,7 +119,7 @@
             colors[index1][3]*amt1 + colors[index2][3]*amt2, 
colors[index1][4]*amt1 + colors[index2][4]*amt2)
         return color
         
-    def GetColorAtIndex(self, index):  #get the non interpolated color value
+    def GetColorAtIndex(self, index):  # get the non interpolated color value
         colord = self.colors[index]
         return (colord[1], colord[2], colord[3], colord[4])
         
@@ -137,7 +128,7 @@
         color = self.GetColor(pos)
         return (color[0]*color[3]*255.0, color[1]*color[3]*255.0, 
color[2]*color[3]*255.0)
         
-        #return ( ( 0, 0, 0, 0) )
+        # return ( ( 0, 0, 0, 0) )
         
     def RemoveColor(self, index):
         self.colors.pop(index)
@@ -164,7 +155,7 @@
         self.Bind(wx.EVT_RIGHT_UP, self.OnRightClick)
         self.Bind(wx.EVT_MOTION, self.OnMotion)
         self.Bind(wx.EVT_KEY_DOWN, self.OnKeyDown)
-        #self.SetFocus()
+        # self.SetFocus()
         self.colorSelectorWidth = 10.0
         self.selected = None
         self.dSelected = None
@@ -189,10 +180,10 @@
     def OnRightClick(self, evt):
         x = evt.GetPosition().x - self.paddingW/2.0
         y = evt.GetPosition().y - self.paddingH/2.0
-        #did they click on a color picker?
+        # did they click on a color picker?
         clicked = False
         index = -1
-        #print evt.GetPosition().x
+        # print evt.GetPosition().x
         for i in range(len(self.transferF.colors)):
             if abs(x - self.transferF.colors[i][0]*self.width) < 
self.colorSelectorWidth/2.0:
                 clicked = True 
@@ -220,8 +211,8 @@
                 color[0] /= 255.0
                 color[1] /= 255.0
                 color[2] /= 255.0
-                #print color[0]
-                #print color[1]
+                # print color[0]
+                # print color[1]
                 self.transferF.SetColor(index, color)
                 self.Update()
                 self.Refresh()
@@ -248,8 +239,8 @@
                 color[1] /= 255.0
                 color[2] /= 255.0
                 pos = float(x)/float(self.width)
-                #print color[0]
-                #print color[1]
+                # print color[0]
+                # print color[1]
                 self.transferF.AddColor( color, pos)
                 self.Update()
                 
@@ -269,7 +260,7 @@
         x = evt.GetPosition().x - self.paddingW/2.0
         if self.selected == None:
             index = -1
-            #print evt.GetPosition().x
+            # print evt.GetPosition().x
             for i in range(len(self.transferF.colors)):
                 if abs(x - self.transferF.colors[i][0]*self.width) < 
self.colorSelectorWidth/2.0:
                     clicked = True 
@@ -297,6 +288,12 @@
            y = 0.0
        if y > self.height:
            y = self.height
+
+        # Determine if this is a Particle historgram... and if so, don't 
allow modification of the
+        # opacity.
+        if self.histogramGroup.group == 0:
+            y = 0
+
         if self.selected != None:
             pos = float(x) / float(self.width)
             self.transferF.MoveColor(self.selected, pos)
@@ -306,7 +303,9 @@
                 a = 1.0
             elif a < 0.0:
                 a = 0.0
+
             color = (colord[0], colord[1], colord[2], a)
+
             self.transferF.SetColor(self.selected, color)
             self.Update()
         
@@ -372,8 +371,8 @@
                 color[0] /= 255.0
                 color[1] /= 255.0
                 color[2] /= 255.0
-                #print color[0]
-                #print color[1]
+                # print color[0]
+                # print color[1]
                 self.transferF.SetColor(self.dSelected, color)
                 self.Update()
                 self.Refresh()
@@ -400,7 +399,8 @@
         for x in range(int(self.paddingW/2) + 1, int(self.width ), 
int(imgWidth)):
                 for y in range(int(self.paddingH/2.0) +2, int(self.height) , 
int(imgHeight)):
                         dc.DrawBitmap(self.backgroundIMG,x,y, True)
-       
#dc.SetClippingRegion(0-self.paddingW/2.0,0-self.paddingH/2.0,originalSize.width,
 originalSize.height)
+        # IS THIS THE BROKEN LINE? ->
+       # 
dc.SetClippingRegion(0-self.paddingW/2.0,0-self.paddingH/2.0,originalSize.width,
 originalSize.height)
         try:
           dc = wx.GCDC(pdc)
         except:
@@ -465,7 +465,7 @@
         self.delColorB.SetToolTip( wx.ToolTip( "delcolorb: fix me" ) )
 
         self.modifyColorB = wx.BitmapButton(self, -1, bmpMod, (0,0), 
style=wx.NO_BORDER)
-        self.modifyColorB.SetToolTip( wx.ToolTip( "Modify Colormap" ) )
+        self.modifyColorB.SetToolTip( wx.ToolTip( "Modify Colormap Node 
(Make sure you select a gray square first.)" ) )
         
         self.presetsB = wx.BitmapButton(self, -1, bmpMod, (0,0), 
style=wx.NO_BORDER)
         self.presetsB.SetToolTip( wx.ToolTip( "Choose Colormap Preset" ) )

Copied: trunk/scenes/csafe/python/csafe_scene.py (from r2352, 
trunk/scenes/csafe/python/csafe_demo.py)
==============================================================================
--- trunk/scenes/csafe/python/csafe_demo.py     (original)
+++ trunk/scenes/csafe/python/csafe_scene.py    Fri Dec 12 15:03:13 2008
@@ -28,8 +28,8 @@
 #  DEALINGS IN THE SOFTWARE.
 #
 
-""" File: csafe_demo.py
-Description:  runs csafe demo.  
+""" File: csafe_scene.py
+Description:  runs csafe scene.
 see http://code.sci.utah.edu/Manta/index.php/CSAFE for instructions
 
 """
@@ -77,6 +77,13 @@
         wx.Point(20,20), wx.Size(400, 450))
         self.panel = scrolled.ScrolledPanel(self,-1, style= wx.TAB_TRAVERSAL)
         self.scene = SceneInfo.Scene()
+
+        # CurrentHistogram is the histogram being edited.  
currentParticleHistogram may also
+        # be the currentHistogram, but always denotes the histogram 
currently chosen
+        # for coloring the particles.
+        self.scene.currentHistogram = None
+        self.scene.currentParticleHistogram = None
+        
         self.SetBackgroundColour(self.scene.bgColor)
         menuBar = wx.MenuBar()
         menuFile = wx.Menu()
@@ -844,6 +851,9 @@
 
     if (setup.cfg != ""):
         Configuration.ReadConfiguration(frame1.scene, setup.cfg)
+        frame1.scene.sceneName = setup.cfg
+        frame1.scene.sceneWD = setup.original_path
+
         if( len( frame1.scene.nrrdFiles ) > 0 or len( frame1.scene.nrrdFiles 
) > 0 ) :
             frame1.generateMenuItem.Enable( True );
             
@@ -869,8 +879,18 @@
     frame1.scene.engine.changeNumWorkers(frame1.scene.numThreads)
     if (setup.generate == True):
         frame1.BuildScene()
-
     
+    if( ( frame1.scene.currentParticleHistogram != None ) and
+        ( frame1.scene.currentHistogram != 
frame1.scene.currentParticleHistogram ) ) :
+        # Update the particle historgram to the one read in from the 
configure file.
+        frame1.scene.currentParticleHistogram.OnClickColor( evt=None ) # FIX 
ME... Is there a better way to do this? (OnClickColor does too much, I think)
+        frame1.scene.currentParticleHistogram.transferF.UpdateColorMap()
+
+    if( frame1.scene.currentHistogram != None ) :
+        # Update the current historgram to the one read in from the 
configure file.
+        frame1.scene.currentHistogram.OnClickColor( evt=None ) # FIX ME... 
Is there a better way to do this?
+        frame1.scene.currentHistogram.transferF.UpdateColorMap()
+
     
###########################################################################
     # Perform any additional setup
 
@@ -878,12 +898,6 @@
     # Start rendering.
     app.MainLoop()
 
-###############################################################################
-# Helper Functions
-
-def moveToMouse( window ) :
-    window.Move( (wx.GetMouseState().GetX(),wx.GetMouseState().GetY()) )
-    
 
###############################################################################
 
 if __name__ == "__main__":

Modified: trunk/scenes/csafe/src/CDTest.h
==============================================================================
--- trunk/scenes/csafe/src/CDTest.h     (original)
+++ trunk/scenes/csafe/src/CDTest.h     Fri Dec 12 15:03:13 2008
@@ -7,48 +7,49 @@
 #ifndef CDTEST_H
 #define CDTEST_H
 
-#include <Model/Primitives/Sphere.h>
-#include <Model/Materials/Phong.h>
-#include <Model/Materials/AmbientOcclusion.h>
-#include <Model/Groups/RecursiveGrid.h>
+#include "CDGridSpheres.h"
 #include "CSAFEObject.h"
-#include <Model/Textures/ValueColormap.h>
 
+#include <Model/Groups/RecursiveGrid.h>
+#include <Model/Materials/AmbientOcclusion.h>
+#include <Model/Materials/Phong.h>
 #include <Model/Materials/Volume.h>
+#include <Model/Primitives/Sphere.h>
+#include <Model/Textures/ValueColormap.h>
+
 #include <Core/Color/Color.h>
-#include <Core/Geometry/Vector.h>
-#include <Core/Exceptions/IllegalArgument.h>
-#include <Core/Util/Args.h>
-#include <Interface/Context.h>
-#include <Interface/LightSet.h>
-#include <Interface/MantaInterface.h>
-#include <Model/Groups/Group.h>
-#include <Model/Lights/PointLight.h>
-#include "CDGridSpheres.h"
-#include <Engine/Factory/Factory.h>
-#include <Model/MiscObjects/CuttingPlane.h>
-#include <iostream>
-#include <math.h>
 #include <Core/Exceptions/IllegalArgument.h>
 #include <Core/Geometry/Vector.h>
 #include <Core/Util/Args.h>
+#include <Core/Thread/Thread.h>
+
+#include <Engine/Factory/Factory.h>
+
 #include <Interface/Context.h>
+#include <Interface/Context.h>
+#include <Interface/LightSet.h>
 #include <Interface/LightSet.h>
 #include <Interface/MantaInterface.h>
+#include <Interface/MantaInterface.h>
+
+#include <Model/AmbientLights/ConstantAmbient.h>
 #include <Model/Backgrounds/ConstantBackground.h>
-#include <Model/Lights/PointLight.h>
-#include <Model/Readers/ParticleNRRD.h>
-#include <Core/Thread/Thread.h>
 #include <Model/Cameras/PinholeCamera.h>
+#include <Model/Groups/Group.h>
+#include <Model/Lights/PointLight.h>
+#include <Model/Materials/Lambertian.h>
+#include <Model/MiscObjects/CuttingPlane.h>
 #include <Model/MiscObjects/KeyFrameAnimation.h>
-#include <Model/AmbientLights/ConstantAmbient.h>
 #include <Model/Primitives/Cube.h>
-#include <Model/Materials/Lambertian.h>
-#include <teem/nrrd.h>
-#include <Model/Readers/VolumeNRRD.h>
+#include <Model/Readers/ParticleNRRD.h>
 #include <Model/Readers/UDAReader.h>
-#include <Model/MiscObjects/CuttingPlane.h>
+#include <Model/Readers/VolumeNRRD.h>
+
+#include <teem/nrrd.h>
 
+#include <math.h>
+
+#include <iostream>
 #include <vector>
 #include <string>
 #include <sstream>
@@ -475,7 +476,7 @@
               printf("\nfound extent: %f %f %f .. %f %f %f\n", min[0], 
min[1],
                     min[2], max[0], max[1], max[2]); 
             }
-            }
+          }
          Volume<float>* mat = new Volume<float>(grid, _volCMap, BBox(min, 
max), 0.0125, 3, NULL, _forceDataMin, _forceDataMax);
          Cube* vol = new Cube(mat, min, max);
           group->add(vol);
@@ -624,9 +625,13 @@
 
   void lockFrames(bool st) { _sphereAnimation->lockFrames(st); 
_volAnimation->lockFrames(st); }
   void loopAnimations(bool st) {_sphereAnimation->loopAnimation(st); 
_volAnimation->loopAnimation(st); }
-  void clipFrames(int start, int end) { _startFrame = start; _endFrame = 
end;  _clipFrames = true;
-  if (end < numFrames1) _sphereAnimation->clipFrames(start,end); if (end < 
numFrames2) _volAnimation->clipFrames(start,end); }
-  void repeatLastFrame(float time) { 
_sphereAnimation->repeatLastFrameForSeconds(time); 
_volAnimation->repeatLastFrameForSeconds(time); }
+  void clipFrames(int start, int end) { 
+    _startFrame = start; _endFrame = end;  _clipFrames = true;
+    if (end < numFrames1) _sphereAnimation->clipFrames(start,end); if (end < 
numFrames2) _volAnimation->clipFrames(start,end);
+  }
+  void repeatLastFrame(float time) { 
+    _sphereAnimation->repeatLastFrameForSeconds(time); 
_volAnimation->repeatLastFrameForSeconds(time);
+  }
 
   //! skip ahead one frame
   /*!


  • [Manta] r2353 - in trunk: SwigInterface UserInterface scenes/csafe/python scenes/csafe/src, dav, 12/12/2008

Archive powered by MHonArc 2.6.16.

Top of page