wolfhece.PyDraw

Author: HECE - University of Liege, Pierre Archambeau Date: 2024

Copyright (c) 2024 University of Liege. All rights reserved.

This script and its content are protected by copyright law. Unauthorized copying or distribution of this file, via any medium, is strictly prohibited.

Module Contents

wolfhece.PyDraw.msg[source]
wolfhece.PyDraw.ID_SELECTCS = 1000[source]
wolfhece.PyDraw.ID_SORTALONG = 1001[source]
wolfhece.PyDraw.ID_LOCMINMAX = 1002[source]
wolfhece.PyDraw.ID_PLOTCS = 1003[source]
wolfhece.PyDraw.LIST_1TO9[source]
class wolfhece.PyDraw.draw_type[source]

Bases: enum.Enum

Inheritance diagram of wolfhece.PyDraw.draw_type

Generic enumeration.

Derive from this class to define new enumerations.

ARRAYS = 'arrays'[source]
BRIDGES = 'bridges'[source]
WEIRS = 'weirs'[source]
VECTORS = 'vectors'[source]
CLOUD = 'clouds'[source]
TRIANGULATION = 'triangulations'[source]
PARTICLE_SYSTEM = 'particle systems'[source]
CROSS_SECTIONS = 'cross_sections'[source]
OTHER = 'others'[source]
VIEWS = 'views'[source]
RES2D = 'wolf2d'[source]
WMSBACK = 'wms-background'[source]
WMSFORE = 'wms-foreground'[source]
TILES = 'tiles'[source]
class wolfhece.PyDraw.Colors_1to9(parent)[source]

Bases: wx.Frame

Inheritance diagram of wolfhece.PyDraw.Colors_1to9
property directory[source]
property file[source]
change_colors(e)[source]
Apply()[source]
OnOK(event)[source]
OnCancel(event)[source]
OnSetDefault(event)[source]
OnSave(event)[source]
OnLoad(event)[source]
class wolfhece.PyDraw.DragdropFileTarget(window: WolfMapViewer)[source]

Bases: wx.FileDropTarget

Inheritance diagram of wolfhece.PyDraw.DragdropFileTarget
OnDropFiles(x, y, filenames)[source]
class wolfhece.PyDraw.WolfMapViewer(wxparent=None, title: str = _('Default Wolf Map Viewer'), w: int = 500, h: int = 500, treewidth: int = 200, wolfparent=None, wxlogging=None)[source]

Bases: wx.Frame

Inheritance diagram of wolfhece.PyDraw.WolfMapViewer

Fenêtre de visualisation de données WOLF grâce aux WxWidgets

property wxlogging[source]
property bkg_color[source]

Return the background color from configs

property ticks_size: float[source]

Return the ticks spacing from configs

property ticks_bounds: bool[source]

Return the ticks bounds from configs

property palette_for_copy: wolfhece.PyPalette.wolfpalette[source]

Return the palette for copy from configs

TIMER_ID = 100[source]
mybc: list[wolfhece.mesh2d.bc_manager.BcManager][source]
myarrays: list[source]
myvectors: list[wolfhece.PyVertexvectors.Zones][source]
myclouds: list[wolfhece.PyVertex.cloud_vertices][source]
mytri: list[wolfhece.PyVertexvectors.Triangulation][source]
myothers: list[source]
myviews: list[wolfhece.wolfresults_2D.views_2D][source]
mywmsback: list[source]
mywmsfore: list[source]
myres2D: list[source]
mytiles: list[wolfhece.wolf_tiles.Tiles][source]
mypartsystems: list[wolfhece.lagrangian.particle_system_ui.Particle_system_to_draw][source]
myviewers3d: list[wolfhece.opengl.py3d.Wolf_Viewer3D][source]
canvas: wx.glcanvas.GLCanvas[source]
context: wx.glcanvas.GLContext[source]
mytooltip: wolfhece.PyVertexvectors.Wolf_Param[source]
treelist: wx.dataview.TreeListCtrl[source]
_lbl_selecteditem: wx.core.StaticText[source]
leftbox: wx.core.BoxSizer[source]
active_vector: wolfhece.PyVertexvectors.vector[source]
active_zone: wolfhece.PyVertexvectors.zone[source]
active_zones: wolfhece.PyVertexvectors.Zones[source]
active_array: wolfhece.wolf_array.WolfArray[source]
active_bc: wolfhece.mesh2d.bc_manager.BcManager[source]
active_view: wolfhece.pyviews.WolfViews[source]
active_vertex: wolfhece.PyVertexvectors.wolfvertex[source]
active_cs: wolfhece.PyCrosssections.crosssections[source]
active_tri: wolfhece.PyVertexvectors.Triangulation[source]
active_tile: wolfhece.wolf_tiles.Tiles[source]
active_particle_system: wolfhece.lagrangian.particle_system_ui.Particle_system_to_draw[source]
active_viewer3d: wolfhece.opengl.py3d.Wolf_Viewer3D[source]
check_logging()[source]

Check if logging window is shown

check_tooltip()[source]

Check if tooltip window is shown

open_hydrological_model()[source]

Open a hydrological model

create_2D_MB_model()[source]

Create a 2D model

check_2D_MB_headers()[source]

Check headers of a 2D simulation without opening viewer

get_mapviewer()[source]

Retourne une instance WolfMapViewer

do_quit()[source]
create_cloud_menu()[source]
get_choices_arrays()[source]

Boîte de dialogue permettant de choisir une ou plusieurs matrices parmi celles chargées

menu_tiles()[source]

Menu for tiles

pick_tile(event: wx.Event)[source]
create_data_from_tiles_activevec(event: wx.Event)[source]
_create_data_from_tiles_common()[source]
create_data_from_tiles_tmpvec(event: wx.Event)[source]
menu_laz()[source]

Menu for LAZ Data

menu_wolf2d()[source]
menu_walous()[source]
get_canvas_bounds(gridsize: float = None)[source]

Retourne les limites de la zone d’affichage

Returns:

[xmin, ymin, xmax, ymax]

Onmenuwalous(event: wx.MenuEvent)[source]
Onmenuwolf2d(event: wx.MenuEvent)[source]
menu_2dgpu()[source]
menu_landmaps()[source]
change_transparent_color_landmap(event: wx.Event)[source]
set_tolerance_landmap(event: wx.Event)[source]
change_colors_landmap(event: wx.Event)[source]
pick_landmap_full(event: wx.Event)[source]
pick_landmap_low(event: wx.Event)[source]
menu_particlesystem()[source]
action_menu_particlesystem(event: wx.Event)[source]

Action to perform when the timer is triggered

update_particlesystem(event: wx.Event)[source]

Animation of the particle system

menu_sim2D()[source]

Menu for 2D simulations

Onmenusim2D(event: wx.MenuEvent)[source]

Action to perform whern menu 2D entry is selected

get_configuration() OpenGL.GLUT.Union[wolfhece.PyConfig.WolfConfiguration, None][source]

Get global configuration parameters

GlobalOptionsDialog(event)[source]
triangulate_cs()[source]
interpolate_cloud()[source]

Interpolation d’un nuage de point sur une matrice

Il est possible d’utiliser une autre valeur que la coordonnées Z des vertices

interpolate_cs()[source]
interpolate_triangulation()[source]
compare_cloud2array()[source]

Compare the active cloud points to the active array

compare_tri2array()[source]
copy_canvasogl(mpl: bool = True, ds: float = 0.0, figsizes=[10.0, 10.0], palette: wolfhece.PyPalette.wolfpalette = None)[source]

Generate image based on UI context and copy to the Clipboard

Parameters:

mpl (bool, optional) – Using Matplolib as renderer. Defaults to True.

Parem ds:

Ticks size. Defaults to 0..

Parem figsizes:

fig size in inches

display_canvasogl(mpl=True, ds=0.0, fig: wolfhece.PyVertexvectors.Figure = None, ax: wolfhece.PyVertexvectors.Axes = None, clear=True, redraw=True, palette=False, title='')[source]

This method takes a matplotlib figure and axe and, returns a clear screenshot of the information displayed in the wolfpy GUI.

get_mpl_plot(center=[0.0, 0.0], width=500.0, height=500.0, title='', toshow=True) tuple[wolfhece.PyVertexvectors.Figure, wolfhece.PyVertexvectors.Axes][source]

Récupère un graphique matplotlib sur base de la fenêtre OpenGL et de la palette de la matrice/résultat actif.

create_video(fn: str = '', framerate: int = 0, start_step: int = 0, end_step: int = 0, every: int = 0)[source]

Création d’une vidéo sur base des résultats

get_canvas_as_image() PIL.Image.Image[source]

Récupère la fenêtre OpenGL sous forme d’image

save_canvasogl(fn: str = '', mpl: bool = True, ds: float = 0.0, dpi: int = 300)[source]

Sauvegarde de la fenêtre d’affichage dans un fichier

Parameters:
  • fn – File name (.png or .jpg file)

  • mpl – Using Matplotlib as renderer

  • ds – Ticks interval

reporting(dir='')[source]

Firsdt attempr to create a reporting. !! Must be improved !!

InitUI()[source]

Initialisation de l’interface utilisateur

OnSize(e)[source]

Redimensionnement de la fenêtre

ManageActions(id)[source]

Gestion des actions via les menus

TODO : A généraliser?

center_view_on(cx, cy)[source]

Center the view on the point of (map) coordinates (x,y)

setbounds(updatescale=True)[source]

Calcule les limites visibles de la fenêtrte graphique sur base des facteurs d’échelle courants

setsizecanvas(width, height)[source]

Redimensionne la fenêtre graphique

updatescalefactors()[source]

Mise à jour des facteurs d’échelle This one updates the scale factors based on the relative sizes of the GLCanvas and the footprint that should fit in it.

Ajout d’une nouvelle fenêtre de visualisation et liaison avec la fenêtre courante

add_grid()[source]

Ajout d’une grille

add_WMS()[source]

Ajout de couches WMS

set_compare(ListArrays: list[wolfhece.wolf_array.WolfArray] = None, share_colormap: bool = True)[source]

Comparison of 2 arrays

Parameters:
  • ListArrays – List of 2 arrays to compare

  • share_colormap – Share the colormap between the 2 arrays

set_compare_all(ListArrays=None, names: WolfMapViewer.set_compare_all.list[str] = None)[source]

Comparison of 2 or 3 arrays

set_blender_sculpting()[source]

Mise en place de la structure nécessaire pour comparer la donnée de base avec la donnée sculptée sous Blender

La donnée de base est la matrice contenue dans la fenêtre actuelle

Fenêtres additionnelles :
  • information sur les volumes de déblai/remblai et bilan

  • matrice sculptée

  • différentiel entre scultage - source

  • gradient

  • laplacien

  • masque de modification

update_blender_sculpting()[source]

Mise à jour des fenêtres de visualisation pour la comparaison avec Blender

zoomon_activevector(size: float = 500.0, forceupdate: bool = True)[source]

Zoom on active vector

Parameters:
  • size – size of the zoomed window

  • forceupdate – force the update of the window

zoomon_active_vertex(size: float = 20, forceupdate: bool = True)[source]

Zoom on active vertex.

Parameters:
  • size – size of the zoomed window

  • forceupdate – force the update of the window

zoom_on_id(id: str, drawtype: draw_type = draw_type.ARRAYS, forceupdate=True, canvas_height=1024)[source]

Zoom on id

Parameters:
  • id – id of the object to zoom on

  • drawtype – type of object to zoom on - Different types elements can have the same id

zoom_on_array(array: wolfhece.wolf_array.WolfArray, forceupdate=True, canvas_height=1024)[source]

Zoom on array

zoom_on_vector(vector: WolfMapViewer.zoom_on_vector.vector, forceupdate=True, canvas_height=1024)[source]

Zoom on vector

create_Zones_from_arrays(arrays: list[wolfhece.wolf_array.WolfArray], id: str = None, add_legend: bool = True) wolfhece.PyVertexvectors.Zones[source]

Create a Zones instance from list of WolfArrays

One zone per array.

One vector per zone with the masked contour.

Parameters:
  • arrays – list of WolfArrays

  • id – id of the Zones instance

  • add_legend – add legend to the vector – centroid of the contour

zoom_on(zoom_dict=None, width=500, height=500, center=None, xll=None, yll=None, forceupdate=True, canvas_height=1024)[source]

Zoom on a specific area

It is possible to zoom on a specific area by providing the zoom parameters in :
  • a dictionnary

  • width and height of the zoomed window and the lower left corner coordinates

  • width and height of the zoomed window and the center coordinates

Parameters:
  • zoom_dict – dictionnary containing the zoom parameters - possible keys : ‘width’, ‘height’, ‘center’, ‘xmin’, ‘ymin’, ‘xmax’, ‘ymax’

  • width – width of the zoomed window [m]

  • height – height of the zoomed window [m]

  • center – center of the zoomed window [m] - tuple (x,y)

  • xll – lower left X coordinate of the zoomed window [m]

  • yll – lower left Y coordinate of the zoomed window [m]

  • forceupdate – force the update of the window

  • canvas_height – height of the canvas [pixels]

Examples :

  • zoom_on(zoom_dict = {‘center’:(500,500), ‘width’:1000, ‘height’:1000})

  • zoom_on(width = 1000, height = 1000, xll = 500, yll = 500)

  • zoom_on(width = 1000, height = 1000, center = (500,500))

zoom_on_active_profile(size: float = 500.0, forceupdate: bool = True)[source]

Zoom on active profile

read_project(fn)[source]

Projet WOLF GUI

Fichier de paramètres contenant les types et chemins d’accès aux données à ajouter

A compléter…

save_project(fn)[source]
plot_laz_around_active_vec()[source]
clip_laz_gridded()[source]

Clip laz grid on current zoom

select_active_array_from_laz(array: wolfhece.wolf_array.WolfArray = None, used_codes: list = None, chunk_size: float = 500.0)[source]

select some nodes from laz data

Parameters:
  • array – array to fill

  • used_codes – codes to use

fill_active_array_from_laz(array: wolfhece.wolf_array.WolfArray = None, used_codes: list = [], operator: int = -1, chunk_size: float = 500.0)[source]

Fill active array with laz data

Parameters:
  • array – array to fill

  • used_codes – codes to use

  • operator – operator to use

count_active_array_from_laz(array: wolfhece.wolf_array.WolfArray = None, used_codes: list = [], chunk_size: float = 500.0)[source]

Fill active array with laz data

Parameters:
  • array – array to fill

  • used_codes – codes to use

  • operator – operator to use

init_laz_from_numpy(fn=None)[source]

Read LAZ data stored in numpy array

init_laz_from_gridinfos(dirlaz: str = None)[source]
managebanks()[source]
_set_fn_fnpos_gltf()[source]

Définition du nom de fichier GLTF/GLB à lire pour réaliser la comparaison Utilisation d’une fenêtre de dialogue WX

Cette fonction n’est a priori appelée que depuis set_fn_fnpos_gltf

set_fn_fnpos_gltf()[source]

Définition ou récupération du nom de fichier GLTF/GLB à lire pour réaliser la comparaison

Le nom de fichier est stocké dans la liste des paramètres partagés de façon à ce que l’appel de mise à jour puisse s’effectuer dans n’importe quel frame

read_last_result()[source]

Lecture du dernier résultat pour les modèles ajoutés et plottés

read_one_result(which: int)[source]

Lecture d’un résultat spécific pour les modèles ajoutés et plottés

simul_previous_step()[source]

Mise à jour au pas précédent

particle_next_step()[source]

Mise à jour au pas suivant

particle_previous_step()[source]

Mise à jour au pas précédent

simul_next_step()[source]

Mise à jour au pas suivant

OnMenuHighlight(event: wx.MenuEvent)[source]
_select_laz_source()[source]

Select laz source

OnMenubar(event: wx.MenuEvent)[source]

Gestion des clicks sur le menu quel que soit le niveau

Idée générale :
  • récupérer le label du menu sur base de l’id de l’event WX passé en argument –> itemlabel

  • tester le label du menu sur base de la chaîne traduite

  • a priori appeler une autre routine spécifique au traitement choisi

  • éviter autant que possible de coder des fonctions directement dans cette routine ce qui la rendrait complexe à lire

AUTRE POSSIBILITE:
  • mettre en place un dictionnaire avec key==label, value==action qui se contenterait de tester la présence du label dans les clés et d’appeler l’action

  • dans ce dernier cas, il faudrait que les routines possèdent idéalement une interface unique

pop_boundary_manager(which: wolfhece.mesh2d.bc_manager.BcManager)[source]

Pop a boundary condition manager after Destroying

get_boundary_manager(which: wolfhece.wolf_array.WolfArray)[source]

Get a boundary manager

uniquecolormap(loadfromfile=False)[source]

Compute unique colormap from all (arrays, 2D results) and apply it to all

loadnap_and_apply()[source]
uniforminparts_all(TrueOrFalse: bool)[source]
filter_inundation()[source]
export_results_as(which='geotiff')[source]

Export des résultats WOLF2D vers le format GeoTiff On attend que les matrices “.hbin” aient été chargées dans l’interface

TODO : Modifier la routine pour prendre les classe de résultats 2D

export_shape(outdir='', fn='', myarrays=[], descr=[], mask: wolfhece.wolf_array.WolfArray = None)[source]

Export multiple arrays to shapefile

Parameters:
  • outdir – output directory

  • fn – filename – .shp will be added if not present

  • myarrays – list of Wolfarrays to export

  • descr – list of descriptions

  • mask – mask array – export only where mask > 0

export_geotif(outdir='', fn='', myarrays=[], descr=[])[source]

Export multiple arrays to geotiff

Parameters:
  • outdir – output directory

  • fn – filename – .tif will be added if not present

  • myarrays – list of Wolfarrays to export

  • descr – list of descriptions – Bands names

get_linked_arrays(linked: bool = True) dict[source]

Get all arrays in the viewer and linked viewers

save_linked_canvas(fn, mpl=True, ds=0.0)[source]

Save canvas of all linked viewers

thread_update_blender()[source]
add_object(which: Literal[array, array_lidar_first, array_lidar_second, array_xyz, array_tiles, bridges, weirs, wolfhece.PyVertexvectors.vector, tiles, tilescompcloud, triangulation, cross_sections, other, views, res2d, res2d_gpu, particlesystem, wmsback, wmsfore] = 'array', filename='', newobj=None, ToCheck=True, id='')[source]

Add object to current Frame/Drawing area

get_obj_from_treeitem(treeitem)[source]

Find the object associated with treeitem

getobj_from_id(id: str)[source]

Find the object associated with id

get_obj_from_id(id: str, drawtype: draw_type)[source]

Find the object associated with id in a specifid drawtype

If you want to search in all drawtypes, use getobj_from_id instead.

Parameters:
  • id – str : id of the object

  • drawtype – draw_type : type of object to search

_get_list(drawing_type: draw_type)[source]

return the list of objects of type drawing_type

get_list_keys(drawing_type: draw_type, checked_state: bool = True)[source]

Create a list of keys of type draw_type

get_list_objects(drawing_type: draw_type, checked_state: bool = True)[source]

Create a list of objects of type draw_type

single_choice_key(draw_type: WolfMapViewer.single_choice_key.draw_type, checked_state: bool = True, message: str = _('Make a choice'), title: str = _('Choice'))[source]

Create wx dialog to choose a key object of type draw_type

single_choice_object(draw_type: WolfMapViewer.single_choice_object.draw_type, checked_state: bool = True, message: str = _('Make a choice'), title: str = _('Choice'))[source]

Create wx dialog to choose an object of type draw_type

multiple_choice_key(draw_type: WolfMapViewer.multiple_choice_key.draw_type, checked_state: bool = True, message: str = _('Make a choice'), title: str = _('Choice'))[source]

Create wx dialog to choose multiple keys object of type draw_type

multiple_choice_object(draw_type: WolfMapViewer.multiple_choice_object.draw_type, checked_state: bool = True, message: str = _('Make a choice'), title: str = _('Choice'))[source]

Create wx dialog to choose multiple objects of type draw_type

iterator_over_objects(drawing_type: draw_type, checked_state: bool = True)[source]

Create iterator over objects of type draw_type

gettreeitem(obj)[source]

Find the tree item associated with obj

removeobj()[source]

Remove selected item from general tree

removeobj_from_id(id: str)[source]

Remove object from id

upobj()[source]

Up selected item into general tree

downobj()[source]

Down selected item into general tree

OnShowPopup(event)[source]
OnPopupItemSelected(event)[source]

Action to do when an item is selected in the popup menu

OnClose(event)[source]

Close the application

OnSelectItem(event)[source]

Select the item in the tree list

OnCheckItem(event: TreeListEvent)[source]

Check the item in the tree list

getXY(pospix)[source]
OnZoomGesture(e)[source]
OnLeave(e)[source]
get_cross_sections()[source]

Récupération du premier objet crosssections disponible

set_active_profile(active_profile: wolfhece.PyCrosssections.profile)[source]

This method sets the active profile in Pydraw (useful for interfaces communication).

set_active_vector(active_vector: wolfhece.PyVertexvectors.vector)[source]

This method sets the active vector in Pydraw (useful for interfaces communication).

get_active_profile()[source]

This methods returns the active profile in pydraw (useful for interfaces communication).

plot_cross(x: float, y: float)[source]
OnRightDown(e: wx.MouseEvent)[source]

Event when the right button of the mouse is pressed.

We use this event to manage “action” set by others objects.

OnRightUp(e)[source]
OnButton(e: wx.MouseEvent)[source]
OnRDClick(e)[source]
OnLDClick(e: wx.MouseEvent)[source]
OnLDown(e)[source]
_set_active_bc()[source]

Search and activate BCManager according to active_array

set_statusbar_text(txt: str)[source]

Set the status bar text

set_label_selecteditem(nameitem: str)[source]

Set the label of the selected item in the tree list

get_label_selecteditem()[source]

Get the label of the selected item in the tree list

OnActivateTreeElem(e)[source]

Activate the selected item in the tree list

_update_mytooltip()[source]

Update the tooltip with the values of the active arrays and results at position x,y

OnMotion(e: wx.MouseEvent)[source]

Mouse move event

Autoscale(update_backfore=True)[source]

Redimensionnement de la fenêtre pour afficher tous les objets

_endactions()[source]

End of actions

Call when the user double click on the right button of the mouse or press return.

Depending on the action, the method will call differnt routines and refresh the figure.

Each action must call self.end_action() to nullify the action and print a message.

print_About()[source]

Print the About window

check_for_updates()[source]

Check for updates

print_shortcuts(inframe: bool = None)[source]

Print the list of shortcuts into logging

msg_action(which: int = 0)[source]

Message to end action

start_action(action: str, message: str = '')[source]

Message to start action

end_action(message: str = '')[source]

Message to end action

OnHotKey(e: wx.KeyEvent)[source]

Gestion des touches clavier – see print_shortcuts for more details

paste_values(fromarray: wolfhece.wolf_array.WolfArray)[source]

Paste selected values from a WolfArray to the active array

paste_selxy(fromarray: wolfhece.wolf_array.WolfArray)[source]

Paste selected nodes from a WolfArray to the active array

OntreeRight(e: wx.MouseEvent)[source]

Gestion du menu contextuel sur l’arbre des objets

update()[source]

Update backgournd et foreground elements and arrays if local minmax is checked.

_plotting(drawing_type: draw_type, checked_state: bool = True)[source]

Drawing objets on canvas

get_MVP_Viewport_matrix()[source]

Get the modelview projection matrix

SetCurrentContext()[source]

Set the current OGL context if exists otherwise return False

_set_gl_projection_matrix()[source]
Paint()[source]

Dessin des éléments ajoutés au viewer

OnPaint(e)[source]

event handler for paint event

findminmax(force=False)[source]

Find min/max of all objects

resizeFrame(w: int, h: int)[source]

Resize the frame

Parameters:
  • w – width in pixels

  • h – height in pixels

mimicme()[source]

Report des caractéristiques de la fenêtre sur les autres éléments liés

mimicme_copyfrom()[source]
Active_vector(vect)[source]

Active un vecteur et sa zone parent si existante

Active_zone(zone: WolfMapViewer.Active_zone.zone)[source]

Active une zone et son parent si existant

list_background()[source]
list_foreground()[source]
check_id(id=str, gridsize=100.0)[source]

Check an element from its id

uncheck_id(id=str, unload=True, forceresetOGL=True, askquestion=False)[source]

Uncheck an element from its id

get_current_zoom()[source]

Get the current zoom

Returns:

dict with keys ‘center’, ‘xmin’, ‘xmax’, ‘ymin’, ‘ymax’, ‘width’, ‘height’

save_current_zoom(filepath)[source]

Save the current zoom in a json file

read_current_zoom(filepath)[source]

Read the current zoom from a json file

class wolfhece.PyDraw.Comp_Type[source]

Bases: enum.Enum

Inheritance diagram of wolfhece.PyDraw.Comp_Type

Generic enumeration.

Derive from this class to define new enumerations.

ARRAYS = 1[source]
ARRAYS_MB = 2[source]
RES2D = 3[source]
RES2D_GPU = 4[source]
class wolfhece.PyDraw.Compare_Arrays_Results(parent: WolfMapViewer = None, share_cmap_array: bool = False, share_cmap_diff: bool = False)[source]
_check_type(file: pathlib.Path)[source]

Check the type of the file/directory

If it is a file and suffix is empty, it is considered as RES2D. If it is a directory and contains a simul_gpu_results, it is considered as RES2D_GPU. If it is a file and suffix is not empty, it is considered as ARRAYS. A check is done to see if it is a multi-block array.

add(file_or_dir: OpenGL.GLUT.Union[str, pathlib.Path] = None)[source]
check()[source]

Check the consystency of the elements to compare

update_comp(idx=list[int])[source]

Update Arrays from 2D modellings

Parameters:

idx – indexes of the time step to update –> steps to read

update_type_result(newtype)[source]

Update the result type for each element

set_elements()[source]

Set the elements to compare with the right type

set_diff()[source]

Set the differential between the elements and the first one, which is the reference

set_viewers(independent: bool = None)[source]

Set viewers

set_shields_param(diamsize: float = 0.001, graindensity: float = 2.65)[source]

Set the parameters for the shields diagram

update_viewers()[source]

Update the viewers with the new elements

bake()[source]