open_viewmin.filter_tree_plot_Qt.filter_tree_plot_Qt
#
Extend pyvistaqt.BackgroundPlotter functionality to include auto-updating filter trees and more complete UI.
Module Contents#
Classes#
Implement some PyVista functionality, with filter trees, in the PyVistaQt |
- class open_viewmin.filter_tree_plot_Qt.filter_tree_plot_Qt.FilterTreePlotQt(filenames=None, user_settings=None, theme=None, reader=ovm_utilities.fast_import, **kwargs)#
Bases:
open_viewmin.filter_tree_plot.filter_tree_plot.FilterTreePlot
,pyvistaqt.BackgroundPlotter
Implement some PyVista functionality, with filter trees, in the PyVistaQt GUI
- Parameters:
filenames (list[str], str, or None, optional) – Files to import.
user_settings (dict or None, optional) – Customizations to default plotter settings.
theme (['dark' | 'document' | 'paraview' | None], optional) – PyVista plot theme
reader (callable()) – Function to import and process data files
kwargs (dict, optional) – Keyword arguments to open_viewmin.FilterTreePlot
- property actor_control_toolbars#
Get toolbars controlling individual actors
- Returns:
Dictionary of toolbars
- Return type:
dict
- _assign_keypress_events()#
Assign actions to keyboard keys.
- _enable_3_lights(only_active=False)#
- _enable_lightkit(only_active=False)#
Get a menu with a given title
- Parameters:
parent (PyQt5.QtWidgets.QMenuBar) – Menu bar to search
title (str) – Title of menu
- Returns:
Menu
- Return type:
PyQt5.QtWidgets.QMenu
- _init_procedures_after_data_import()#
Initialization steps that can be carried out only after some data is imported
- add_filter_formula(name=None, **kwargs)#
Add a filter formula to the plotter.
- Parameters:
name (str or None, optional) – Name of new mesh. Pass None to do nothing.
**kwargs – Keyword arguments to open_viewmin.FilterFormula.__init__.
- Returns:
New child mesh created by filter formula, or None if no filter formula was created.
- Return type:
pyvista.dataset or None
- add_slice_with_controls(scalars_name, mesh_to_slice_name='fullmesh')#
Create a callable that adds a slice filter formula controlled by sliders and buttons in the controls area.
- Parameters:
scalars_name (str or None) – Name of scalar dataset to use for coloring the slice. Pass None to use a solid color.
mesh_to_slice_name (str, optional) – Name of parent mesh to slice
- Return type:
callable()
- add_widget_formula(name=None, **kwargs)#
Add a widget formula to the plotter.
- Parameters:
name (str or None, optional) – Name of new widget. Pass None to do nothing.
kwargs (dict, optional) – Keyword arguments to open_viewmin.WidgetFormula.__init__
- Returns:
The new widget formula, or None if none was created.
- Return type:
open_viewmin.WidgetFormula or None
- customize_controls_dock()#
Modify settings of controls area
- initialize_plotter(**kwargs)#
Override parent class’s plotter initialization to use pyvistaqt.BackgroundPlotter instead of pyvista.Plotter
- Parameters:
kwargs (dict, optional) – Keyword arguments to pyvistaqt.BackgroundPlotter
- load(filenames, **kwargs)#
Import a file or files.
- Parameters:
filenames (str or list[str]) – Files to load.
reader (callable, optional) – Function to read each file.
mpi_group (bool, optional) – Whether to stitch files together as separate outputs from the same timestep from an MPI run.
do_load_frame (bool, optional) – Whether to view the frame containing the loaded data.
- open_files_dialog(sort=True)#
Launch GUI widget for selecting files to import
- Parameters:
sort (bool, optional) – Whether to sort filenames by timestamp
- refresh()#
Re-apply all filter formulas to refresh meshes
- remove_actor_completely(actor_name)#
- remove_mesh_completely(mesh_name, remove_children=True)#
Remove a mesh (filter or actor) from the plotter and from the filters tree.
- Parameters:
mesh_name (str) – Name of mesh to remove.
remove_children (bool, optional) – Whether to recursively remove all meshes descended from this mesh in the filters tree.
- Return type:
None
- rename_mesh(from_name, to_name, do_refresh=False)#
Copy a mesh in the filters tree by copying its recipe.
- Parameters:
from_name (str) – Name of mesh to copy.
to_name (str) – Name of new mesh.
do_refresh (bool, optional) – Whether to create the mesh anew from its filter after renaming.
- Return type:
None
- save_html(filename=None)#
Export plotter scene as interactive html widget
- Parameters:
filename (str or None) – Filename to write to. Pass None to launch GUI file selector.
- save_mesh(mesh_name, mesh_filename=None)#
Export a mesh.
Note that the allowed file types depend on the type of mesh.
- Parameters:
mesh_name (str) – Mesh name
mesh_filename (str or None) – File to write to. Pass None to launch GUI file selector.
- save_meshes_launch_dialog(file_prefix=None)#
- set_actor_visibility(actor, visibility)#
Set visibility of a mesh or meshes
- Parameters:
actor (str, sequence of str, VTK actor, or sequence of VTK actors) –
visibility (bool) – Whether mesh(es) are to be visible.
- set_orbit_dlg(**kwargs)#
- show_editor()#
Show editor widget controlling actors’ visibility
- update_actor(actor_name, **kwargs)#
Update a filter formula’s mesh visualization options.
Shorthand for `self.get_filter_formula(ellipsoid_mesh_name).set()
- Parameters:
actor_name (str) – Name of filter formula
**kwargs – Keyword arguments to `open_viewmin.FilterFormula.set
- update_filter(mesh_name, update_actor=False, **kwargs)#
Update a filter formula.
Shorthand for self.get_filter_formula(parent_mesh_name).update().
- Parameters:
mesh_name (str) – Name of filter formula
update_actor (bool, optional) – Whether to update an actor immediately after updating its mesh.
kwargs (dict, optional) – Keyword arguments to open_viewmin.FilterFormula.update
- update_filters_tree()#
- update_frame_spinbox()#
Update the spinbox controlling the frame
- view_frame(frame_num=0, **kwargs)#
Use one of the imported data files as the source for all datasets