simphony / simphony-mayavi

The mayavi adapters to the simphony framework
BSD 2-Clause "Simplified" License
0 stars 1 forks source link

[WIP] Refactor show, snapshot and exposed add_dataset function to plugin #136

Closed kitchoi closed 8 years ago

kitchoi commented 8 years ago

Refs: #134

Usage:

from simphony.visualisation import mayavi_tools
source = mayavi_tools.add_dataset(cuds, point_scalars_name="TEMPERATURE")  # scene is empty
mayavi_tools.add_default_modules(source)   # add default visualisation

show is doing exactly the above + mlab.show() Usage for show (similarly for snapshot):

from simphony.visualisation import mayavi_tools
mayavi_tools.show(cuds, point_scalars_name="TEMPERATURE", point_vectors_name="VELOCITY")

# if "TEMPERATURE" and "VELOCITY" are the only point scalars and vectors, 
# previous behaviour works fine
mayavi_tool.show(cuds)

@itziakos, @dpinte what do you think?

After this PR is accepted and merged, I will create a new issue for making the GUI use these functions instead.

kitchoi commented 8 years ago

Relevant to #132 too

kitchoi commented 8 years ago

@dpinte, @itziakos, this is ready for review. Please let me know if this is good to merge.

kitchoi commented 8 years ago

add_dataset may not be ideal. Let me try a different implementation for refactoring.

dpinte commented 8 years ago

@kitchoi LGTM

kitchoi commented 8 years ago

Superseded by #162, closing.