open_viewmin.filter_tree_plot_Qt.widgets_Qt.controls ==================================================== .. py:module:: open_viewmin.filter_tree_plot_Qt.widgets_Qt.controls .. autoapi-nested-parse:: Routines to create actor control toolbars in the Qt GUI Classes ------- .. autoapisummary:: open_viewmin.filter_tree_plot_Qt.widgets_Qt.controls.ActorControlToolbar open_viewmin.filter_tree_plot_Qt.widgets_Qt.controls.ControlsCheckboxToolBar open_viewmin.filter_tree_plot_Qt.widgets_Qt.controls.SliceControlsToolBar Functions --------- .. autoapisummary:: open_viewmin.filter_tree_plot_Qt.widgets_Qt.controls.add_toolbar_to_controls_dock_widget open_viewmin.filter_tree_plot_Qt.widgets_Qt.controls.add_viz_options_toolbar open_viewmin.filter_tree_plot_Qt.widgets_Qt.controls.relink_visibility_checkbox open_viewmin.filter_tree_plot_Qt.widgets_Qt.controls.set_lights_intensity_from_slider open_viewmin.filter_tree_plot_Qt.widgets_Qt.controls.setup_animation_buttons open_viewmin.filter_tree_plot_Qt.widgets_Qt.controls.setup_lighting_control open_viewmin.filter_tree_plot_Qt.widgets_Qt.controls.setup_widget_control Module Contents --------------- .. py:class:: ActorControlToolbar(plotter, actor_name, label=None) Bases: :py:obj:`open_viewmin.filter_tree_plot_Qt.widgets_Qt.utilities_Qt.ControlsToolbar` Toolbar with standard controls for an actor .. py:method:: add_isosurface_qslider(min_val=None, max_val=None, **kwargs) Add slider control for value of `isosurface` filter :param min_val: :type min_val: float | `None` :param max_val: :type max_val: float | `None` :param \*\*kwargs: Keyword arguments to :meth:`get_min_max_scalars` :type \*\*kwargs: dict, optional :rtype: :class:`~open_viewmin.filter_tree_plot_Qt.widgets_Qt.utilities_Qt.ControlsSliderToolbar` .. py:method:: add_property_toggle_checkbox(property_name, label=None) Add checkbox that toggles a named property with boolean value :param property_name: :type property_name: str :param label: :type label: str | `None` :rtype: `qw.QCheckBox` .. py:method:: add_qslider(update_method, num_divs=100, init_val_percent=50, min_val=None, max_val=None, scalars=None, label_txt='') Add a slider control to the controls area :param update_method: :type update_method: callable :param num_divs: :type num_divs: int :param init_val_percent: :type init_val_percent: int :param min_val: :type min_val: float | `None` :param max_val: :type max_val: float | `None` :param scalars: :type scalars: pv.pyvista_ndarray :param label_txt: :type label_txt: str :rtype: :class:`~open_viewmin.filter_tree_plot_Qt.widgets_Qt.utilities_Qt.ControlsSliderToolbar` .. py:method:: add_qslider_type(type_string, **kwargs) :param type_string: Must be `"isosurface"` or `"threshold"` :type type_string: str :param \*\*kwargs: Keyword arguments to :meth:`add_isosurface_qslider` or :meth:`add_threshold_qslider` :type \*\*kwargs: dict, optional :rtype: :class:`~open_viewmin.filter_tree_plot_Qt.widgets_Qt.utilities_Qt.ControlsSliderToolbar` .. py:method:: add_threshold_qslider(min_val=None, max_val=None, **kwargs) Add two-value slider control for min/max values of `threshold` filter :param min_val: :type min_val: float | `None` :param max_val: :type max_val: float | `None` :param \*\*kwargs: Keyword arguments to :meth:`add_qslider` :type \*\*kwargs: dict, optional :rtype: :class:`~open_viewmin.filter_tree_plot_Qt.widgets_Qt.utilities_Qt.ControlsSliderToolbar` .. py:method:: add_threshold_text_controls(label='') Add text box controls for min/max values of a `threshold` filter :param label: :type label: str .. py:method:: add_to_plotter() Add this toolbar to its parent `Plotter` .. py:method:: add_visibility_checkbox() Add a checkbox that toggles an actor's visibility .. py:method:: assign_checkbox_to_actor_visibility(actor_name=None) Couple toolbar's visibility checkbox to the visibility of the associated actor :param actor_name: :type actor_name: str | `None` .. py:method:: format_label_for_filters_tree(label) By default, label toolbar with name of associated actor :param label: :type label: str | `None` :rtype: str .. py:method:: get_min_max_scalars(min_val=None, max_val=None) Get minimum and maximum values of a scalar dataset :param min_val: :type min_val: float | `None` :param max_val: :type max_val: float | `None` :rtype: dict .. py:method:: isosurface_slider_callback(contour_value) Callback to update an `isosurface` filter :param contour_value: :type contour_value: float .. py:method:: make_slice_slider_controls(widget_name=None, make_origin_slider=True) Make sliders that control a `slice` widget's orientation and position :param widget_name: :type widget_name: str | `None` :param make_origin_slider: :type make_origin_slider: bool .. py:method:: make_special_settings_button(callback) Make button that launches a settings dialog :param callback: :type callback: callable .. py:method:: relink_visibility_checkbox() Make sure visibility checkbox state matches actor visibility, otherwise checkbox becomes unusable .. py:method:: set_label(text=None) Set toolbar's label :param text: :type text: str | `None` .. py:method:: threshold_slider_callback(value_lims) Callback to update a `threshold` filter :param value_lims: :type value_lims: tuple(float, float) .. py:method:: wiggle_slider_to_update() For an actor with some feature controlled by a slider, move the slider right and left to force the actor to update .. py:attribute:: QSlider :value: None .. py:attribute:: QSlider_target_type :value: '' .. py:attribute:: actor_name .. py:attribute:: mesh_options_button .. py:attribute:: plotter .. py:attribute:: slice_controls :value: None .. py:attribute:: slider_toolbar :value: None .. py:attribute:: visibility_checkbox .. py:attribute:: visualization_options_button .. py:class:: ControlsCheckboxToolBar(plotter, name=None, label=None, icon_size=None, movable=True, floatable=True, items_dict_reference=None, init_state_callback=None, state_changed_callback=None, do_color_buttons=False) Bases: :py:obj:`open_viewmin.filter_tree_plot_Qt.widgets_Qt.utilities_Qt.ControlsToolbar` Toolbar containing only a checkbox and its label :param plotter: :type plotter: :class:`~open_viewmin.filter_tree_plot_Qt.filter_tree_plot_Qt.FilterTreePlotQt` :param name: :type name: str | `None` :param label: :type label: str | `None` :param icon_size: :type icon_size: int | `None` :param movable: :type movable: bool :param floatable: :type floatable: bool :param items_dict_reference: :type items_dict_reference: dict | `None` :param init_state_callback: :type init_state_callback: callable | `None` :param state_changed_callback: :type state_changed_callback: callable | `None` :param do_color_buttons: :type do_color_buttons: bool .. py:method:: add_checkbox(item_name) Add checkbox to toolbar :param item_name: :type item_name: str .. py:method:: add_item(item_name, init_state_callback, state_changed_callback) Add checkbox to toolbar :param item_name: :type item_name: str :param init_state_callback: :type init_state_callback: callable | `None` :param state_changed_callback: :type state_changed_callback: callable | `None` .. py:method:: make_label_a_color_button(item_name) Replace label of checkbox with a separate button that activates a color picker dialog for the widget :param item_name: :type item_name: str .. py:method:: populate() Recreate toolbar's checkbox .. py:method:: refresh(item_name=None) .. py:method:: refresh_all() .. py:attribute:: checkbox_toolbars .. py:attribute:: checkboxes .. py:attribute:: color_button_enabled .. py:attribute:: init_state_callback .. py:attribute:: items .. py:attribute:: items_dict_reference .. py:attribute:: name .. py:attribute:: plotter .. py:attribute:: state_changed_callback .. py:class:: SliceControlsToolBar(parent_toolbar, widget_name: Optional[str] = None, make_origin_slider: bool = True) Bases: :py:obj:`qtpy.QtWidgets.QToolBar` For a plane widget, add an expandable set of rows to its controls toolbar to change its normal and origin .. py:method:: collapse() Increase control toolbar height, hiding `slice`-specific controls .. py:method:: create_orientation_button_callback(theta: float, phi: float) -> callable() Callback to reset `slice` orientation :param theta: :type theta: polar angle :param phi: :type phi: azimuthal angle .. py:method:: expand() Increase control toolbar height, revealing `slice`-specific controls .. py:method:: expand_or_collapse_control_toolbar() Toggle show/hide `slice`-specific controls .. py:method:: origin_reset_callback() Reset `slice` origin to center of volume .. py:method:: setup_orient_along_axes_buttons() Make buttons to orient `slice` normal along coordinate axes .. py:method:: setup_slice_control(label: str, minimum: float, maximum: float, init_val: float, slider_formula: callable, slider_inv_formula: callable, value_changed_callback: callable, use_ints: bool = False, slider_minimum: int = 0, slider_maximum: Optional[int] = None) -> (qtpy.QtWidgets.QSlider, qtpy.QtWidgets.QSpinBox) Set up controls for `slice` widget :param label: :type label: str :param minimum: :type minimum: float :param maximum: :type maximum: float :param init_val: :type init_val: float :param slider_formula: :type slider_formula: callable :param slider_inv_formula: :type slider_inv_formula: callable :param value_changed_callback: :type value_changed_callback: callable :param use_ints: :type use_ints: bool :param slider_minimum: :type slider_minimum: int :param slider_maximum: :type slider_maximum: int | `None` :rtype: `(qw.QSlider, qw.QSpinBox)` .. py:method:: slice_origin_slider_value_changed_callback(value) Recreate `slice` after change in origin :param value: Shift along `slice` normal :type value: float :rtype: `None` .. py:method:: slice_phi_slider_formula(value: int) -> float Conversion from slider position to slice $\phi$ value :param value: slider value :type value: int :rtype: `float` .. py:method:: slice_phi_slider_inv_formula(value: float) -> int Conversion from slice $\theta$ value to slider position :param value: :type value: float :rtype: `int` .. py:method:: slice_phi_slider_value_changed_callback(value) Recreate `slice` after change in azimuthal angle :param value: azimuthal angle :type value: float :rtype: `None` .. py:method:: slice_theta_slider_formula(value: int) -> float Conversion from slider position to slice $\theta$ value :param value: slider value :type value: int :returns: polar angle :rtype: float .. py:method:: slice_theta_slider_inv_formula(value: float) -> int Conversion from slice $\theta$ value to slider position :param value: polar angle :type value: float :returns: slider value :rtype: int .. py:method:: slice_theta_slider_value_changed_callback(value) Recreate `slice` after change in polar angle :param value: polar angle :type value: float :rtype: `None` .. py:method:: slice_value_changed_callback(key: str, value_callable: callable(float) | callable(int)) -> callable(float) Make callback executed when a `slice` widget is altered :param key: :type key: str :param value_callable: :type value_callable: callable :rtype: callable .. py:attribute:: QSliders .. py:attribute:: actor_name .. py:attribute:: current_phi .. py:attribute:: current_theta .. py:attribute:: expand_controls_button .. py:attribute:: expanded :value: False .. py:attribute:: input_boxes .. py:attribute:: make_origin_slider .. py:attribute:: max_slice_translate .. py:attribute:: num_slider_divs .. py:attribute:: parent_toolbar .. py:attribute:: plotter .. py:attribute:: slice_control_toolbar .. py:attribute:: symbol :value: '⊞' .. py:attribute:: widget .. py:property:: widget_formula Callback that updates the `slice` widget :rtype: :class:`~open_viewmin.filter_tree_plot.widget_formulas.WidgetFormula` .. py:attribute:: widget_name .. py:function:: add_toolbar_to_controls_dock_widget(plotter, toolbar_name, orientation_int=2) :param plotter: :type plotter: :class:`~open_viewmin.filter_tree_plot_Qt.filter_tree_plot_Qt.FilterTreePlotQt` :param toolbar_name: :type toolbar_name: str :param orientation_int: Horizontal (`1`) or vertical (`2`, default) toolbar orientation :type orientation_int: int .. py:function:: add_viz_options_toolbar(plotter, actor_name, label=None, mesh_type=None) Standard controls toolbar for each actor's rendering options :param plotter: :type plotter: :class:`~open_viewmin.filter_tree_plot_Qt.filter_tree_plot_Qt.FilterTreePlotQt` :param actor_name: :type actor_name: str :param label: :type label: str | `None` :param mesh_type: Acceptable strings are: `"isosurface"`, `"threshold"`, `"slice"`, `"line"` :type mesh_type: str | `None` .. py:function:: relink_visibility_checkbox(plotter, actor_name) Make sure visibility checkbox state matches actor visibility, otherwise checkbox becomes unusable :param plotter: :type plotter: :class:`~open_viewmin.filter_tree_plot_Qt.filter_tree_plot_Qt.FilterTreePlotQt` :param actor_name: :type actor_name: str .. py:function:: set_lights_intensity_from_slider(plotter) Set `Plotter`'s lights intensity from the `'lighting'` toolbar's slider :param plotter: :type plotter: :class:`~open_viewmin.filter_tree_plot_Qt.filter_tree_plot_Qt.FilterTreePlotQt` .. py:function:: setup_animation_buttons(plotter) Buttons for animations toolbar to change the frame number :param plotter: :type plotter: :class:`~open_viewmin.filter_tree_plot_Qt.filter_tree_plot_Qt.FilterTreePlotQt` .. py:function:: setup_lighting_control(plotter) Slider to change lighting intensity :param plotter: :type plotter: :class:`~open_viewmin.filter_tree_plot_Qt.filter_tree_plot_Qt.FilterTreePlotQt` .. py:function:: setup_widget_control(plotter) Add toolbar to controls dock containing checkboxes for enabling/disabling PyVista widgets. :param plotter: :type plotter: :class:`~open_viewmin.filter_tree_plot_Qt.filter_tree_plot_Qt.FilterTreePlotQt`