wolfhece.gpuview
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
- class wolfhece.gpuview.Rectangle(x, y=None, width=None, height=None)[source]
- class wolfhece.gpuview.VectorField(x_extent, y_extent, bounds, dx, dy, idx: str = '', plotted: bool = True, mapviewer=None, need_for_wx: bool = False, minsize=0.1)[source]
Bases:
wolfhece.drawing_obj.Element_To_Draw
Draws a field of arrows.
The arrow are defined by an x and and y extent (in matrices) and drawn based on a grid (which we compute here).
- zoom_2 = 2[source]
Logique de calcul: - on normalise les composantes vectorielles –> [0, 1] - on redistribue les normes entre [minsize , 1.] –> minsize==1 => toutes les flèches sont de taille identique - on recalcule les composantes vectorielles sur base de cette nouvelle norme - lors du dessin, on multiplie le facteur de mise à l’échelle par (self.zoom_factor * self.zoom_2)
le premier facteur tient compte de la mise à l’échelle globale du champ vectoriel sur base d’une combinaison de blocs –> Wolfresults_2D
le second facteur est purement graphique et sert à augmenter/réduire la taille tout en gardent la proportionnalité
- plot(sx=None, sy=None, xmin=None, ymin=None, xmax=None, ymax=None, size=None)[source]
Plot data in OpenGL context
- update_geometry(model_bounds: Rectangle, grid_bounds: Rectangle, nb_arrows_x: int, nb_arrows_y: int, arrow_scale_x: float, arrow_scale_y: float, aspect_ratio: float)[source]
Model bounds: the coordinates of the full model we draw (world coord) Grid bounds : the coordinates over which the grid will be computed (world coord); nb_arrows: number of vector to plot in x/y dimension expected to be a subset of model bounds. arrow_scale : scale factor for arrows (expected to be used to maintain the arrow size constant on screen) aspect_ration: to adapt to screen’s aspect ratio.