wolfhece.pyvertexvectors._zone

GUI-enabled zone class with OpenGL and wx integration.

Module Contents

class wolfhece.pyvertexvectors._zone.zone(lines: list[str] = [], name: str = 'NoName', parent: wolfhece.pyvertexvectors._zones.Zones = None, is2D: bool = True, fromshapely: shapely.geometry.LineString | shapely.geometry.Polygon | shapely.geometry.MultiLineString | shapely.geometry.MultiPolygon = None)[source]

Bases: wolfhece.pyvertexvectors._models.zoneModel

Inheritance diagram of wolfhece.pyvertexvectors._zone.zone

Objet de gestion d’informations vectorielles (GUI).

Hérite de zoneModel pour les données/géométrie et ajoute OpenGL, wx et matplotlib.

mytree: TreeListCtrl[source]
myitem: wx.core.TreeItemId[source]
myprops = None[source]
idgllist = -99999[source]
_rendering_machine = None[source]
_make_vector(**kwargs) wolfhece.pyvertexvectors._vector.vector[source]

Factory: create a new GUI-enabled vector.

_make_zone(**kwargs) zone[source]

Factory: create a new GUI-enabled zone.

_make_zones(**kwargs) wolfhece.pyvertexvectors._zones.Zones[source]

Factory: create a GUI-enabled Zones collection.

_make_triangulation(**kwargs) wolfhece.pyvertexvectors._triangulation.Triangulation[source]

Factory: create a GUI-enabled triangulation.

find_nearest_vertex(x: float, y: float) wolfhece.PyVertex.wolfvertex | None[source]

Return the nearest vertex across all GUI vectors in the zone.

find_nearest_vector(x: float, y: float) wolfhece.pyvertexvectors._vector.vector | None[source]

Return the nearest GUI vector in the zone.

use()[source]

A utiliser

unuse()[source]

Ne plus utiliser

add2tree(tree: TreeListCtrl, root)[source]

Add the zone to a wx TreeListCtrl.

Parameters:
  • tree – Target tree control.

  • root – Parent tree item.

_fill_structure()[source]

Mise à jour des structures

show_properties()[source]

Show properties of the zone –> will be applied to all vectors int he zone

hide_properties()[source]

Hide the properties window

_callback_destroy_props()[source]

Callback to destroy the properties window

_callback_prop()[source]

Callback to update properties

property rendering_machine[source]

Current rendering backend.

Returns the zone’s own setting, or the parent Zones’ setting, or LIST.

prep_listogl()[source]

Préparation des listes OpenGL pour augmenter la vitesse d’affichage

plot(prep: bool = False, sx=None, sy=None, xmin=None, ymin=None, xmax=None, ymax=None, size=None, anim_phase: float = 0.0)[source]

Plot the zone using OpenGL.

Dispatches to shader or display-list path depending on rendering_machine.

Parameters:
  • prep – If True, compile into an OpenGL display list (list mode only).

  • sx – Scale factor along X.

  • sy – Scale factor along Y.

  • xmin – Minimum X of the viewport.

  • ymin – Minimum Y of the viewport.

  • xmax – Maximum X of the viewport.

  • ymax – Maximum Y of the viewport.

  • size – Reference size for rendering.

  • anim_phase – Animation phase [0, 1] for shader effects.

_plot_shader(sx=None, sy=None, xmin=None, ymin=None, xmax=None, ymax=None, size=None, anim_phase: float = 0.0)[source]

Render all vectors in this zone using the shader pipeline.

_plot_list(prep: bool = False, sx=None, sy=None, xmin=None, ymin=None, xmax=None, ymax=None, size=None)[source]

Render all vectors using legacy display lists / immediate mode.

reset_listogl()[source]

Reset OpenGL lists.

Force deletion of the OpenGL list. If the object is newly plotted, the lists will be recreated.

plot_matplotlib(ax: matplotlib.pyplot.Axes | tuple[matplotlib.figure.Figure, matplotlib.axes.Axes] = None, xlim: tuple[float] | None = None, ylim: tuple[float] | None = None, **kwargs)[source]

Plot the zone using Matplotlib.

Parameters:
  • ax – Matplotlib Axes, (fig, ax) tuple, or None.

  • xlim – Optional (xmin, xmax) bounds for legend clipping.

  • ylim – Optional (ymin, ymax) bounds for legend clipping.

  • kwargs – Additional keyword arguments.

Returns:

(fig, ax) tuple.

plot_linked_polygons(fig: matplotlib.figure.Figure, ax: matplotlib.axes.Axes, linked_arrays: dict, linked_vec: dict[str, wolfhece.pyvertexvectors._zones.Zones] = None, linestyle: str = '-', onlymedian: bool = False, withtopography: bool = True, ds: float = None)[source]

Création d’un graphique sur base des polygones

Chaque polygone se positionnera sur base de la valeur Z de ses vertices
  • façon conventionnelle de définir une longueur

  • ceci est normalement fait lors de l’appel à ‘create_polygon_from_parallel’

  • si les polygones sont créés manuellement, il faut donc prendre soin de fournir l’information adhoc ou alors utiliser l’rgument ‘ds’

ATTENTION : Les coordonnées Z ne sont sauvegardées sur disque que si le fichier est 3D, autrement dit au format ‘.vecz’

Parameters:
  • fig – Figure

  • ax – Axes

  • linked_arrays – dictionnaire contenant les matrices à lier – les clés sont les labels

  • linked_vec – dictionnaire contenant les instances Zones à lier – Besoin d’une zone et d’un vecteur ‘trace/trace’ pour convertir les positions en coordonnées curvilignes

  • linestyle – style de ligne

  • onlymedian – affiche uniquement la médiane

  • withtopography – affiche la topographie

  • ds – pas spatial le long de l’axe

plot_linked_polygons_wx(fig: wolfhece.matplotlib_fig.Matplotlib_Figure, linked_arrays: dict, linked_vec: dict[str, wolfhece.pyvertexvectors._zones.Zones] = None, linestyle: str = '-', onlymedian: bool = False, withtopography: bool = True, ds: float = None)[source]

Création d’un graphique sur base des polygones

Chaque polygone se positionnera sur base de la valeur Z de ses vertices
  • façon conventionnelle de définir une longueur

  • ceci est normalement fait lors de l’appel à ‘create_polygon_from_parallel’

  • si les polygones sont créés manuellement, il faut donc prendre soin de fournir l’information adhoc ou alors utiliser l’rgument ‘ds’

ATTENTION : Les coordonnées Z ne sont sauvegardées sur disque que si le fichier est 3D, autrement dit au format ‘.vecz’

Parameters:
  • fig – Figure

  • ax – Axes

  • linked_arrays – dictionnaire contenant les matrices à lier – les clés sont les labels

  • linked_vec – dictionnaire contenant les instances Zones à lier – Besoin d’une zone et d’un vecteur ‘trace/trace’ pour convertir les positions en coordonnées curvilignes

  • linestyle – style de ligne

  • onlymedian – affiche uniquement la médiane

  • withtopography – affiche la topographie

  • ds – pas spatial le long de l’axe

create_multibin(nb: int = None, nb2: int = 0) wolfhece.pyvertexvectors._triangulation.Triangulation[source]

Create a triangulation from the zone’s vectors.

If nb is not provided and a wx app is running, a dialog is shown.

Parameters:
  • nb – Number of interpolation points along each polyline.

  • nb2 – Number of intermediate points between polylines.

Returns:

A Triangulation instance or None.

create_tri_crosssection(ds: float = 1.0) wolfhece.pyvertexvectors._triangulation.Triangulation[source]

Create a triangulation from cross-section and support vectors.

Parameters:

ds – Spacing used for the interpolation.

Returns:

An Interpolators instance or None.

create_constrainedDelaunay(nb: int = None) wolfhece.pyvertexvectors._triangulation.Triangulation[source]

Create a constrained Delaunay triangulation.

If nb is not provided and a wx app is running, a dialog is shown.

Parameters:

nb – Number of points along each polyline (0 to keep as-is).

Returns:

A Triangulation instance or None.

createmultibin_proj(nb=None, nb2=0) wolfhece.pyvertexvectors._triangulation.Triangulation[source]

Create a triangulation by projection.

If nb is not provided and a wx app is running, a dialog is shown.

Parameters:
  • nb – Number of points along each polyline.

  • nb2 – Number of intermediate points between polylines.

Returns:

A Triangulation instance or None.

create_sliding_polygon_from_parallel(poly_length: float, ds_sliding: float, farthest_parallel: float, interval_parallel: float = None, howmanypoly: int = 1, ds: float = None)[source]

Create sliding polygons from parallel vectors and refresh the view.

Parameters:
  • poly_length – Length of each polygon along the trace.

  • ds_sliding – Sliding step between successive polygons.

  • farthest_parallel – Maximum distance for the farthest parallel.

  • interval_parallel – Interval between parallels (None = auto).

  • howmanypoly – Number of polygons to create.

  • ds – Discretisation step for the vectors.