On Thu, Feb 24, 2011 at 11:30:41AM +0000, David Flitney wrote:
>    class Visualization(HasTraits):
>        ...
>        @on_trait_change('surf_filename, cons_filename')
>        def update_data(self):
>            try:
>                if check_files(self.surf_filename, self.cons_filename):
>                    self.update_plot()
>            ...
>        def picker_callback(self, picker):
>            """ Picker callback: this get called when on pick events.
>            """
>            print "Picking..."
>            ...
>        @on_trait_change('scene.activated')
>        def update_plot(self):
>            print "Updating..."
>            self.scene.mlab.clf()
>            ...
>            self.picker =
>    self.scene.mayavi_scene.on_mouse_pick(self.picker_callback)
>            self.picker.tolerance = 0.001

>    All is well for the first rendering of the scene: picker_callback() is
>    getting called appropriately, but when I subsequently call clf(), in the
>    context of update_data(), and rebuild the scene from the newly selected
>    datasets my callback no longer gets called. Note the default, 'p'
>    activated, picker is working.
>    Can anyone suggest what I might have done wrong?

Seems like a bug to me.

What if you replace the call to mlab.clf by::

scene = self.figure
scene.scene.disable_render = True
scene.scene.disable_render = disable_render

and you don't re-register the callback (the difference with clf is that
the code above does not clear the callbacks?

G

------------------------------------------------------------------------------
Free Software Download: Index, Search & Analyze Logs and other IT data in 
Real-Time with Splunk. Collect, index and harness all the fast moving IT data 
generated by your applications, servers and devices whether physical, virtual
or in the cloud. Deliver compliance at lower cost and gain new business 
insights. http://p.sf.net/sfu/splunk-dev2dev 
_______________________________________________
MayaVi-users mailing list
MayaVi-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mayavi-users

Reply via email to