Hi Gaël,

thanks for the fast response.

On Wed, Feb 16, 2011 at 3:30 PM, Gael Varoquaux
<gael.varoqu...@normalesup.org> wrote:
> On Wed, Feb 16, 2011 at 01:22:27PM +0000, Michele Mattioni wrote:
>> However if I try to use it complains that no object is loaded
>
> Indeed, the TVTK visual module does not define any data for Mayavi.
>
>> When I open the Mayavi browser however I cannot see any datastructure loaded.
>
>> Consider this code:
>
>>     from enthought.txtk.tools import visual
>>     cyl = visual.Cylinder()
>>     cyl.traits()
>
> Can you give us a bit more of info on how you are plugin your objects in
> the viewport? That's where we can capture them to expose them as data for
> Mayavi, and thus be able to use things such as a colorbar.
>

I use the visual API, so basically I create all the cylinders that I
need directly with the code shown above (the second line, basically),
passing the coordinates and the scalar for the axis, basically
setting, x,y,z and axis as keyword.

According to the CylinderClass DocString:

Docstring:
    Cylinder class creates Cylinder from tvtk CylinderSource,
    follows the usual VTK pipeline and creates a Sphere actor, which
    is passed to the show_actor() function as an argument.


I think the magic happens there, because I don't create the actor
myself, but all that is already taken care in the visual code.
Check out this functions:

def _create_viewer():
https://github.com/enthought/mayavi/blob/master/enthought/tvtk/tools/visual.py#L80

def show_actor(*tvtk_actors):
https://github.com/enthought/mayavi/blob/master/enthought/tvtk/tools/visual.py#L116

Maybe the data should be plugged in over there?

Cheers,
Michele

------------------------------------------------------------------------------
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb
_______________________________________________
MayaVi-users mailing list
MayaVi-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mayavi-users

Reply via email to