Skip to content

Commit

Permalink
Fix streamlines for real now.
Browse files Browse the repository at this point in the history
  • Loading branch information
prabhuramachandran committed Apr 16, 2014
1 parent e15651b commit 66a3957
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 15 deletions.
3 changes: 0 additions & 3 deletions mayavi/components/source_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@ class SourceWidget(Component):
# The poly data that the widget manages.
poly_data = Instance(tvtk.PolyData, args=())

poly_data_updated = Event

########################################
# Private traits.

Expand Down Expand Up @@ -195,7 +193,6 @@ def update_data(self):
######################################################################
def update_poly_data(self):
self.widget.get_poly_data(self.poly_data)
self.poly_data_updated = True

######################################################################
# Non-public traits.
Expand Down
16 changes: 6 additions & 10 deletions mayavi/modules/streamline.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
Delegate, Button
from traitsui.api import View, Group, Item, InstanceEditor
from tvtk.api import tvtk
from tvtk.common import is_old_pipeline
from tvtk.common import configure_outputs

# Local imports
from mayavi.core.module import Module
Expand Down Expand Up @@ -202,13 +202,13 @@ def _streamline_type_changed(self, value):
rf = self.ribbon_filter
tf = self.tube_filter
if value == 'line':
self.outputs = [st.output]
configure_outputs(self, st)
elif value == 'ribbon':
rf.input_connection = st.output_port
self.outputs = [rf.output]
self.configure_connection(rf, st)
configure_outputs(self, rf)
elif value == 'tube':
tf.input_connection = st.output_port
self.outputs = [tf.output]
self.configure_connection(tf, st)
configure_outputs(self, tf)
self.render()

def _update_streamlines_fired(self):
Expand Down Expand Up @@ -256,7 +256,3 @@ def _actor_changed(self, old, new):
new.scene = self.scene
new.inputs = [self]
self._change_components(old, new)

def _poly_data_updated_changed_for_seed(self):
if not is_old_pipeline():
self.stream_tracer.update()
6 changes: 4 additions & 2 deletions tvtk/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,12 @@ def is_old_pipeline():

def configure_connection(obj, inp):
""" Configure topology for vtk pipeline obj."""
if inp.has_output_port():
if hasattr(inp, 'output_port'):
obj.input_connection = inp.output_port
elif inp.has_output_port():
obj.input_connection = inp.get_output_object()
else:
configure_input_data(obj, inp.outputs[0])
configure_input(obj, inp.outputs[0])

def configure_input_data(obj, data):
""" Configure the input data for vtk pipeline object obj."""
Expand Down

0 comments on commit 66a3957

Please sign in to comment.