[cig-commits] r4474 - in mc/3D/CitcomS/trunk/visual/Mayavi2: . plugins plugins/filter

maweier at geodynamics.org maweier at geodynamics.org
Tue Sep 5 13:53:25 PDT 2006


Author: maweier
Date: 2006-09-05 13:53:25 -0700 (Tue, 05 Sep 2006)
New Revision: 4474

Modified:
   mc/3D/CitcomS/trunk/visual/Mayavi2/Citcoms_HdfDisplay.py
   mc/3D/CitcomS/trunk/visual/Mayavi2/Citcoms_hdf2vtk.py
   mc/3D/CitcomS/trunk/visual/Mayavi2/__init__.py
   mc/3D/CitcomS/trunk/visual/Mayavi2/plugins/CitcomS_vtk_file_reader.py
   mc/3D/CitcomS/trunk/visual/Mayavi2/plugins/filter/CitcomSFilterActions.py
   mc/3D/CitcomS/trunk/visual/Mayavi2/plugins/filter/CitcomSshowCaps.py
   mc/3D/CitcomS/trunk/visual/Mayavi2/plugins/filter/CitcomSshowSurface.py
   mc/3D/CitcomS/trunk/visual/Mayavi2/plugins/filter/__init__.py
Log:
Some minor bugfixes


Modified: mc/3D/CitcomS/trunk/visual/Mayavi2/Citcoms_HdfDisplay.py
===================================================================
--- mc/3D/CitcomS/trunk/visual/Mayavi2/Citcoms_HdfDisplay.py	2006-09-05 20:49:51 UTC (rev 4473)
+++ mc/3D/CitcomS/trunk/visual/Mayavi2/Citcoms_HdfDisplay.py	2006-09-05 20:53:25 UTC (rev 4474)
@@ -110,7 +110,7 @@
             sys.exit(1)
             
     else:
-        print "[filename] [timestep]"
+        print "[filename] [timestep] -x [Reduce Grid Size X] -y [Reduce Grid Size X] -z [Reduce Grid Size Z]"
         sys.exit(0)
    ##parse for reduction factors 
     try:

Modified: mc/3D/CitcomS/trunk/visual/Mayavi2/Citcoms_hdf2vtk.py
===================================================================
--- mc/3D/CitcomS/trunk/visual/Mayavi2/Citcoms_hdf2vtk.py	2006-09-05 20:49:51 UTC (rev 4473)
+++ mc/3D/CitcomS/trunk/visual/Mayavi2/Citcoms_hdf2vtk.py	2006-09-05 20:53:25 UTC (rev 4474)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 
-#    <Script to generate VTK files from CitcomS hdf files>
+#    Script to generate VTK files from CitcomS hdf files
 #    Copyright (C) 2006 California Institue of Technology 
 #
 #    This program is free software; you can redistribute it and/or modify
@@ -83,7 +83,7 @@
         for i in xrange(nx):
             for j in xrange(ny):
                 for k in xrange(nz):
-                    yield k + nz * i + nz * nx * j
+                    yield k + i * nz + j * nz * nx
 
 #Reduces the CitcomS grid
 def reduce_iter(n,nredu):
@@ -226,6 +226,10 @@
         # rearange vtk data - xyz (x fastest).
         for n0 in xrange(el_nz_redu*el_ny_redu*el_nx_redu):
             iter = vtk_i.next()
+            
+            if capnr==0:
+                print iter
+            
             #print iter
             #Get Cartesian Coords from Coords
             #zxy Citcom to xyz Vtk
@@ -664,4 +668,4 @@
 
 
 if __name__ == '__main__':
-    citcoms_hdf2vtk()
\ No newline at end of file
+    citcoms_hdf2vtk()

Modified: mc/3D/CitcomS/trunk/visual/Mayavi2/__init__.py
===================================================================
--- mc/3D/CitcomS/trunk/visual/Mayavi2/__init__.py	2006-09-05 20:49:51 UTC (rev 4473)
+++ mc/3D/CitcomS/trunk/visual/Mayavi2/__init__.py	2006-09-05 20:53:25 UTC (rev 4474)
@@ -1,40 +1 @@
-#------------------------------------------------------------------------------
-# Copyright 2003, Enthought, Inc.
-# All rights reserved.
-# 
-# This software is provided without warranty under the terms of the BSD
-# license included in enthought/LICENSE.txt and may be redistributed only
-# under the conditions described in the aforementioned license.  The license
-# is also available online at http://www.enthought.com/licenses/BSD.txt
-# Thanks for using Enthought open source!
-# 
-# Author: Enthought, Inc.
-# Description: <Enthought library component>
-#------------------------------------------------------------------------------
-"""
-==========================
-Enthought Library
-========================== 
-
-The Enthought Open Source Library
-
-Copyright 2003-2005, Enthought, Inc.
-
-
-"""
-
-try:
-    import __config__
-except ImportError:
-    __config__ = None
-
-if __config__ is not None:
-    if __config__.get_info('numpy'):
-        import os
-        if os.environ.get('NUMERIX','numpy').lower() not in ['','numpy']:
-            print 55*'*'
-            print "*** This enthought installation is built against numpy\n"\
-                  "*** but the current environment is for %r.\n"\
-                  "*** Resetting NUMERIX variable to 'numpy'."% (os.environ['NUMERIX'])
-            print 55*'*'
-        os.environ['NUMERIX'] = 'numpy'
+# Author: Martin Weier

Modified: mc/3D/CitcomS/trunk/visual/Mayavi2/plugins/CitcomS_vtk_file_reader.py
===================================================================
--- mc/3D/CitcomS/trunk/visual/Mayavi2/plugins/CitcomS_vtk_file_reader.py	2006-09-05 20:49:51 UTC (rev 4473)
+++ mc/3D/CitcomS/trunk/visual/Mayavi2/plugins/CitcomS_vtk_file_reader.py	2006-09-05 20:53:25 UTC (rev 4474)
@@ -1,9 +1,9 @@
 """A VTK file reader object.
 
 """
-# Author: Prabhu Ramachandran <prabhu_r at users.sf.net>
-# Copyright (c) 2005, Enthought, Inc.
-# License: BSD Style.
+# Author: Martin Weier
+# Copyright (c) 2006, California Institute of Technology
+# License: GPL Style
 
 
 # Standard library imports.

Modified: mc/3D/CitcomS/trunk/visual/Mayavi2/plugins/filter/CitcomSFilterActions.py
===================================================================
--- mc/3D/CitcomS/trunk/visual/Mayavi2/plugins/filter/CitcomSFilterActions.py	2006-09-05 20:49:51 UTC (rev 4473)
+++ mc/3D/CitcomS/trunk/visual/Mayavi2/plugins/filter/CitcomSFilterActions.py	2006-09-05 20:53:25 UTC (rev 4474)
@@ -2,7 +2,7 @@
 
 """
 # Author: Martin Weier
-# Copyright (c) 
+# Copyright (c) California Institute of Technology
 # License: 
 
 # Enthought library imports.

Modified: mc/3D/CitcomS/trunk/visual/Mayavi2/plugins/filter/CitcomSshowCaps.py
===================================================================
--- mc/3D/CitcomS/trunk/visual/Mayavi2/plugins/filter/CitcomSshowCaps.py	2006-09-05 20:49:51 UTC (rev 4473)
+++ mc/3D/CitcomS/trunk/visual/Mayavi2/plugins/filter/CitcomSshowCaps.py	2006-09-05 20:53:25 UTC (rev 4474)
@@ -111,29 +111,23 @@
     ######################################################################
     # Non-public interface
     ######################################################################
-    def _lower_threshold_changed(self,old_value, new_value):
+    def _lower_threshold_changed(self, old_value, new_value):
         """Callback interface for the lower threshold slider"""
+        if new_value>=self.upper_threshold:
+            new_value=self.upper_threshold-1
         fil = self.ugrid_filter
-        if new_value<> self.upper_threshold and new_value<self.upper_threshold:
-            fil.point_minimum = (self.lower_threshold)*(self.n)
-            fil.update()
-            self.data_changed = True
-        else:
-            self.outputs[0].points = [(100,100,100)]
-            fil.update()
-            self.data_changed = True
-	
+        fil.point_minimum = new_value*(self.n)
+        fil.update()
+        self.data_changed = True
         
     def _upper_threshold_changed(self, old_value, new_value):
         """Callback interface for the upper threshold slider"""
+        if new_value<=self.lower_threshold:
+            new_value=self.lower_threshold+1
         fil = self.ugrid_filter
-        if new_value<> self.lower_threshold and new_value>self.lower_threshold:
-            fil.point_maximum = self.upper_threshold*(self.n)
-            fil.update()
-            self.data_changed = True
-        else:
-            self.outputs[0].points = [(100,100,100)]
-            fil.update()
-            self.data_changed = True
+        fil.point_maximum = new_value*(self.n)
+        fil.update()
+        self.data_changed = True
+       
 
    

Modified: mc/3D/CitcomS/trunk/visual/Mayavi2/plugins/filter/CitcomSshowSurface.py
===================================================================
--- mc/3D/CitcomS/trunk/visual/Mayavi2/plugins/filter/CitcomSshowSurface.py	2006-09-05 20:49:51 UTC (rev 4473)
+++ mc/3D/CitcomS/trunk/visual/Mayavi2/plugins/filter/CitcomSshowSurface.py	2006-09-05 20:53:25 UTC (rev 4474)
@@ -1,9 +1,9 @@
-"""A simple filter that thresholds on input data.
+"""A that shows a slice at a specified radius
 
 """
-# Author: Prabhu Ramachandran <prabhu_r at users.sf.net>
-# Copyright (c) 2005, Enthought, Inc.
-# License: BSD Style.
+# Author: Martin Weier
+# Copyright (c) 2006, California Institue of Technology
+# License: GPL Style.
 
 # Enthought library imports.
 from enthought.traits import Instance, Range, Int, Float
@@ -15,7 +15,7 @@
 
 
 ######################################################################
-# `Threshold` class.
+# `ShowSurface` class.
 ######################################################################
 class ShowSurface(Filter):
 
@@ -178,35 +178,4 @@
         fil.update()
         self.data_changed = True
     
-    def _update_ranges(self, reset=False):
-        """Updates the ranges of the input.  When `reset` is True, the
-        lower and upper thresholds are automatically set to the limits
-        of the input data."""
-        
-        input = self.inputs[0].outputs[0]
-        data_range = []
-        ps = input.point_data.scalars
-        cs = input.cell_data.scalars
-
-        # FIXME: need to be able to handle cell and point data
-        # together.        
-        if ps:
-            data_range = ps.range
-        elif cs:
-            data_range = cs.range
-            
-        if data_range:
-            dr = data_range
-            l = max(self.lower_threshold, dr[0])
-            trait = Range(dr[0], dr[1], l,
-                          desc='the lower threshold of the filter')
-            self.add_trait('lower_threshold', trait)
-
-            h = min(dr[1], self.upper_threshold)
-            trait = Range(dr[0], dr[1], h,
-                          desc='the upper threshold of the filter')
-            self.add_trait('upper_threshold', trait)
-
-            if reset:
-                self.lower_threshold = dr[0]
-                self.upper_threshold = dr[1]
+    

Modified: mc/3D/CitcomS/trunk/visual/Mayavi2/plugins/filter/__init__.py
===================================================================
--- mc/3D/CitcomS/trunk/visual/Mayavi2/plugins/filter/__init__.py	2006-09-05 20:49:51 UTC (rev 4473)
+++ mc/3D/CitcomS/trunk/visual/Mayavi2/plugins/filter/__init__.py	2006-09-05 20:53:25 UTC (rev 4474)
@@ -1,40 +1 @@
-#------------------------------------------------------------------------------
-# Copyright 2003, Enthought, Inc.
-# All rights reserved.
-# 
-# This software is provided without warranty under the terms of the BSD
-# license included in enthought/LICENSE.txt and may be redistributed only
-# under the conditions described in the aforementioned license.  The license
-# is also available online at http://www.enthought.com/licenses/BSD.txt
-# Thanks for using Enthought open source!
-# 
-# Author: Enthought, Inc.
-# Description: <Enthought library component>
-#------------------------------------------------------------------------------
-"""
-==========================
-Enthought Library
-========================== 
-
-The Enthought Open Source Library
-
-Copyright 2003-2005, Enthought, Inc.
-
-
-"""
-
-try:
-    import __config__
-except ImportError:
-    __config__ = None
-
-if __config__ is not None:
-    if __config__.get_info('numpy'):
-        import os
-        if os.environ.get('NUMERIX','numpy').lower() not in ['','numpy']:
-            print 55*'*'
-            print "*** This enthought installation is built against numpy\n"\
-                  "*** but the current environment is for %r.\n"\
-                  "*** Resetting NUMERIX variable to 'numpy'."% (os.environ['NUMERIX'])
-            print 55*'*'
-        os.environ['NUMERIX'] = 'numpy'
+# Author: Martin Weier



More information about the cig-commits mailing list