示例#1
0
 def perform(self):
     """ Performs the action. """
     wildcard = 'HDF5 timestep files (*.*.h5)|*.*.h5|' + FileDialog.WILDCARD_ALL
     parent = self.window.control
     dialog = FileDialog(parent=parent,
                         title='Open CitcomS HDF5 timestep file',
                         action='open', wildcard=wildcard
                         )
     if dialog.open() == OK:
         if not isfile(dialog.path):
             error("File '%s' does not exist!" % dialog.path, parent)
             return
         from citcoms_plugins.plugins.CitcomS_hdf_file_reader import CitcomSHDFFileReader
         r = CitcomSHDFFileReader()
         r.initialize(dialog.path)
         mv = get_imayavi(self.window)
         mv.add_source(r)
 def perform(self):
     """ Performs the action. """
     wildcard = 'HDF files (*.h5)|*.h5|' + FileDialog.WILDCARD_ALL
     parent = self.window.control
     dialog = FileDialog(parent=parent,
                         title='Open CitcomS H5 file',
                         action='open',
                         wildcard=wildcard)
     if dialog.open() == OK:
         if not isfile(dialog.path):
             error("File '%s' does not exist!" % dialog.path, parent)
             return
         from enthought.mayavi.plugins.CitcomS_hdf_file_reader import CitcomSHDFFileReader
         r = CitcomSHDFFileReader()
         r.initialize(dialog.path)
         mv = get_imayavi(self.window)
         mv.add_source(r)
示例#3
0
 def perform(self):
     """Performs the action. """
     wildcard = 'VTK files (*.vtk)|*.vtk|' + FileDialog.WILDCARD_ALL
     parent = self.window.control
     dialog = FileDialog(parent=parent,
                         title='Open CitcomS VTK file',
                         action='open',
                         wildcard=wildcard)
     if dialog.open() == OK:
         if isfile(dialog):
             from citcoms_display.plugins.VTKFileReader import VTKFileReader
             r = VTKFileReader()
             r.initialize(dialog.path)
             mv = get_imayavi(self.window)
             mv.add_source(r)
         else:
             error("File '%s' does not exist!" % dialog.path, parent)
     return
示例#4
0
 def perform(self):
     """ Performs the action. """
     wildcard = 'HDF5 files (*.h5)|*.h5|' + FileDialog.WILDCARD_ALL
     parent = self.window.control
     dialog = FileDialog(parent=parent,
                         title='Open CitcomS HDF5 file',
                         action='open',
                         wildcard=wildcard)
     if dialog.open() == OK:
         if isfile(dialog.path):
             from citcoms_display.plugins.HDF5FileReader import HDF5FileReader
             r = HDF5FileReader()
             r.initialize(dialog.path)
             mv = get_imayavi(self.window)
             mv.add_source(r)
         else:
             error("File '%s' does not exist!" % dialog.path, parent)
     return