febid.libraries.vtk_rendering.VTK_Rendering.Render#

class Render(cell_dim, font=12, button_size=25)[source]#

Bases: object

Class implementing rendering utilities for visualizing of Numpy data using Pyvista

Parameters:
  • cell_dim (int) – cell data spacing for VTK objects

  • font – button caption font size

  • button_size – size of the show on/off button

Methods

save_3Darray

Dump a Numpy array to a vtk file with a specified name and creation date

show

Shows plotting scene

show_full_structure

Render and plot all the structure components

show_mc_result

update

Update the plot

update_mask

class SetVisibilityCallback(actor)[source]#

Bases: object

Helper callback to keep a reference to the actor being modified. This helps button show and hide plot elements

__call__(state)[source]#

Call self as a function.

save_3Darray(filename, arr, data_name='scalar')[source]#

Dump a Numpy array to a vtk file with a specified name and creation date

Parameters:
  • filename – distinct name of the file

  • arr – array to save

  • data_name – name of the data to include in the vtk dataset

Returns:

show(screenshot=False, show_grid=True, keep_plot=False, interactive_update=False, cam_pos=None)[source]#

Shows plotting scene

Parameters:
  • screenshot – if True, a screenshot of the scene will be saved upon showing

  • show_grid – indicates axes and scales

  • keep_plot – if True, creates a copy of current Plotter before showing

  • interactive_update – if True, code execution does not stop while scene window is opened

  • cam_pos – camera view

Returns:

current camera view

show_full_structure(structure, struct=True, deposit=True, precursor=True, surface=True, semi_surface=True, temperature=True, ghosts=True, t=None, sim_time=None, beam=None, cam_pos=None)[source]#

Render and plot all the structure components

Parameters:
  • structure (Structure) – data object

  • struct – if True, plot solid structure

  • deposit – if True, plot deposit on the surface

  • precursor – if True, plot precursor surface density

  • surface – if True, color all surface cells

  • semi_surface – if True, color all semi_surface cells

  • ghosts – if True, color ghost cells

Returns:

update(time=1, force_redraw=False)[source]#

Update the plot

Parameters:
  • time – minimum time before each subsequent update

  • force_redraw – redraw the plot immediately

Returns: