[cig-commits] r5471 - mc/3D/CitcomS/trunk/visual/Mayavi2/citcoms_display

luis at geodynamics.org luis at geodynamics.org
Tue Dec 5 16:18:47 PST 2006


Author: luis
Date: 2006-12-05 16:18:47 -0800 (Tue, 05 Dec 2006)
New Revision: 5471

Modified:
   mc/3D/CitcomS/trunk/visual/Mayavi2/citcoms_display/actions.py
   mc/3D/CitcomS/trunk/visual/Mayavi2/citcoms_display/mayavi_custom_ui.py
Log:
Added actions for ReduceFilter and ShowCapsFilter


Modified: mc/3D/CitcomS/trunk/visual/Mayavi2/citcoms_display/actions.py
===================================================================
--- mc/3D/CitcomS/trunk/visual/Mayavi2/citcoms_display/actions.py	2006-12-05 23:13:27 UTC (rev 5470)
+++ mc/3D/CitcomS/trunk/visual/Mayavi2/citcoms_display/actions.py	2006-12-06 00:18:47 UTC (rev 5471)
@@ -1,3 +1,22 @@
+"""
+Actions for MayaVi2 UI
+"""
+
+#Author: Martin Weier
+#Copyright (C) 2006  California Institute of Technology
+#This program is free software; you can redistribute it and/or modify
+#it under the terms of the GNU General Public License as published by
+#the Free Software Foundation; either version 2 of the License, or
+#any later version.
+#This program is distributed in the hope that it will be useful,
+#but WITHOUT ANY WARRANTY; without even the implied warranty of
+#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#GNU General Public License for more details.
+#You should have received a copy of the GNU General Public License
+#along with this program; if not, write to the Free Software
+#Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+
+
 # Standard library imports
 from os.path import isfile
 
@@ -11,8 +30,9 @@
 
 
 class OpenVTKAction(WorkbenchAction):
-    """ Open a VTK file. """
-
+    """
+    Open a VTK file.
+    """
     def perform(self):
         """Performs the action. """
         wildcard = 'VTK files (*.vtk)|*.vtk|' + FileDialog.WILDCARD_ALL
@@ -34,8 +54,9 @@
 
 
 class OpenHDF5Action(WorkbenchAction):
-    """ Open an HDF5 file. """
-
+    """
+    Open an HDF5 file.
+    """
     def perform(self):
         """ Performs the action. """
         wildcard = 'HDF5 files (*.h5)|*.h5|' + FileDialog.WILDCARD_ALL
@@ -55,3 +76,28 @@
                 error("File '%s' does not exist!" % dialog.path, parent)
         return
 
+
+class ReduceFilterAction(WorkbenchAction):
+    """
+    Add a ReduceFilter to the mayavi pipeline.
+    """
+    def perform(self):
+        """ Performs the action. """
+        from citcoms_display.plugins.ReduceFilter import ReduceFilter
+        f = ReduceFilter()
+        mv = get_imayavi(self.window)
+        mv.add_filter(f)
+
+
+class ShowCapsFilterAction(WorkbenchAction):
+    """
+    Add a ShowCapsFilter to the mayavi pipeline
+    """
+    def perform(self):
+        """ Performs the action. """
+        from citcoms_display.plugins.ShowCapsFilter import ShowCapsFilter
+        f = ShowCapsFilter()
+        mv = get_imayavi(self.window)
+        mv.add_filter(f)
+
+

Modified: mc/3D/CitcomS/trunk/visual/Mayavi2/citcoms_display/mayavi_custom_ui.py
===================================================================
--- mc/3D/CitcomS/trunk/visual/Mayavi2/citcoms_display/mayavi_custom_ui.py	2006-12-05 23:13:27 UTC (rev 5470)
+++ mc/3D/CitcomS/trunk/visual/Mayavi2/citcoms_display/mayavi_custom_ui.py	2006-12-06 00:18:47 UTC (rev 5471)
@@ -51,7 +51,7 @@
 # old name: enthought.mayavi.plugins.CitcomSFilterActions.CitcomSshowCaps
 citcoms_cap_filter = Action(
     id          = "CitcomsCapFilter",
-    class_name  = "citcoms_display.mayavi_filters.ShowCapsFilter",
+    class_name  = "citcoms_display.actions.ShowCapsFilterAction",
     name        = "&Show Citcom Caps",
     #image      = "images/new_scene.png",
     tooltip     = "Display a specified range of caps",
@@ -62,7 +62,7 @@
 # old name: enthought.mayavi.plugins.CitcomSFilterActions.CitcomSreduce
 citcoms_reduce_filter = Action(
     id          = "CitcomsReduceFilter",
-    class_name  = "citcoms_display.mayavi_filters.ReduceFilter",
+    class_name  = "citcoms_display.actions.ReduceFilterAction",
     name        = "&Reduce CitcomS grid",
     #image      = "images/new_scene.png",
     tooltip     = "Display a ReduceGrid for interpolation",



More information about the cig-commits mailing list