mlab.pipeline.streamline() problem

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

mlab.pipeline.streamline() problem

Robert Cimrman
Hello,

when I am trying to use mlab.pipeline.streamline() on an unstructured grid for
a vector (velocity) field, I keep getting:

vtkPlaneWidget (0x642c010): The interactor must be set prior to
enabling/disabling widget

Does anybody know what is the problem? I am using it within my mayavi-based
viewer. Other mlab.pipeline.*() commands like surface, scalar_cut_plane, glyph,
etc. work fine in the same context.

magnetic_field_lines.py [1] works without problems.

Best regards,
r.

[1]
http://github.enthought.com/mayavi/mayavi/auto/example_magnetic_field_lines.html
_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: mlab.pipeline.streamline() problem

Gael Varoquaux
On Mon, Dec 05, 2011 at 05:09:27PM +0100, Robert Cimrman wrote:
> a vector (velocity) field, I keep getting:

> vtkPlaneWidget (0x642c010): The interactor must be set prior to
> enabling/disabling widget

I am not certain, but a random guess could be that you are doing this
when the pipeline has not a window opened, for instance in an
MlabSceneModel.

In which case, could you please try to set this module up only after the
scene has been activated. For this, see the last warning of the
subsection:
http://github.enthought.com/mayavi/mayavi/building_applications.html#a-scene-with-mlab-embedded
Just before the 'Learning by example' box.

This is a random guess, so I might be wrong

Gael
_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: mlab.pipeline.streamline() problem

Robert Cimrman
On 12/06/11 07:57, Gael Varoquaux wrote:
> On Mon, Dec 05, 2011 at 05:09:27PM +0100, Robert Cimrman wrote:
>> a vector (velocity) field, I keep getting:
>
>> vtkPlaneWidget (0x642c010): The interactor must be set prior to
>> enabling/disabling widget
>
> I am not certain, but a random guess could be that you are doing this
> when the pipeline has not a window opened, for instance in an
> MlabSceneModel.

Your guess is perfect.

> In which case, could you please try to set this module up only after the
> scene has been activated. For this, see the last warning of the
> subsection:
> http://github.enthought.com/mayavi/mayavi/building_applications.html#a-scene-with-mlab-embedded
> Just before the 'Learning by example' box.

Yes, that's it. I thought it might be something like that, but hoped there is
an easy workaround... I will have to do a bit of redesign then.

Thanks!
r.
_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: mlab.pipeline.streamline() problem

Robert Cimrman
On 12/06/11 08:37, Robert Cimrman wrote:

> On 12/06/11 07:57, Gael Varoquaux wrote:
>> On Mon, Dec 05, 2011 at 05:09:27PM +0100, Robert Cimrman wrote:
>>> a vector (velocity) field, I keep getting:
>>
>>> vtkPlaneWidget (0x642c010): The interactor must be set prior to
>>> enabling/disabling widget
>>
>> I am not certain, but a random guess could be that you are doing this
>> when the pipeline has not a window opened, for instance in an
>> MlabSceneModel.
>
> Your guess is perfect.
>
>> In which case, could you please try to set this module up only after the
>> scene has been activated. For this, see the last warning of the
>> subsection:
>> http://github.enthought.com/mayavi/mayavi/building_applications.html#a-scene-with-mlab-embedded
>> Just before the 'Learning by example' box.
>
> Yes, that's it. I thought it might be something like that, but hoped there is
> an easy workaround... I will have to do a bit of redesign then.

It was easier than I thought, the solution using
@on_trait_change('scene.activated') works. It has only one quirk:

even with

streamline.update_streamlines = True

I have to call

source.update() # this is VTKDataSource instance

manually to get the streamlines shown.

But anyway, it works, so thanks again!

r.
_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev