Exemple #1
0
 def _update_ranges(self):
     # Here we get the module's source since the input of this
     # component may not in general represent the entire object.
     if not self.auto_update_range:
         return
     src = get_module_source(self.inputs[0])
     dataset = self._get_source_dataset(src)
     sc = dataset.point_data.scalars
     if sc is not None:
         sc_array = sc.to_array()
         has_nan = numpy.isnan(sc_array).any()
         if has_nan:
             rng = (float(numpy.nanmin(sc_array)),
                    float(numpy.nanmax(sc_array)))
         else:
             rng = sc.range
     else:
         error('Cannot contour: No scalars in input data!')
         rng = (0.0, 1.0)
     if rng != self._current_range:
         self.set(_data_min=rng[0],
                  _data_max=rng[1],
                  trait_change_notify=False)
         self._clip_contours(rng)
         self._current_range = rng
Exemple #2
0
 def _update_ranges(self):
     # Here we get the module's source since the input of this
     # component may not in general represent the entire object.
     if not self.auto_update_range:
         return
     src = get_module_source(self.inputs[0])
     dsh = DataSetHelper(src.outputs[0])
     name, rng = dsh.get_range('scalars', 'point')
     if name is None:
         error('Cannot contour: No scalars in input data!')
         rng = (0.0, 1.0)
     if rng != self._current_range:
         self.trait_set(_data_min=rng[0], _data_max=rng[1],
                        trait_change_notify=False)
         self._clip_contours(rng)
         self._current_range = rng
 def _update_ranges(self):
     # Here we get the module's source since the input of this
     # component may not in general represent the entire object.
     if not self.auto_update_range:
         return
     src = get_module_source(self.inputs[0])
     dsh = DataSetHelper(src.outputs[0])
     name, rng = dsh.get_range('scalars', 'point')
     if name is None:
         error('Cannot contour: No scalars in input data!')
         rng = (0.0, 1.0)
     if rng != self._current_range:
         self.trait_set(_data_min=rng[0],
                        _data_max=rng[1],
                        trait_change_notify=False)
         self._clip_contours(rng)
         self._current_range = rng
Exemple #4
0
 def _update_ranges(self):
     # Here we get the module's source since the input of this
     # component may not in general represent the entire object.
     if not self.auto_update_range:
         return
     src = get_module_source(self.inputs[0])
     sc = src.outputs[0].point_data.scalars
     if sc is not None:
         sc_array = sc.to_array()
         has_nan = numpy.isnan(sc_array).any()
         if has_nan:
             rng = (float(numpy.nanmin(sc_array)),
                    float(numpy.nanmax(sc_array)))
         else:
             rng = sc.range
     else:
         error('Cannot contour: No scalars in input data!')
         rng = (0.0, 1.0)
     if rng != self._current_range:
         self.set(_data_min=rng[0], _data_max=rng[1],
                  trait_change_notify=False)
         self._clip_contours(rng)
         self._current_range = rng