wolfhece.pyvertexvectors._zone ============================== .. py:module:: wolfhece.pyvertexvectors._zone .. autoapi-nested-parse:: GUI-enabled zone class with OpenGL and wx integration. Module Contents --------------- .. py:class:: zone(lines: list[str] = [], name: str = 'NoName', parent: wolfhece.pyvertexvectors._zones.Zones = None, is2D: bool = True, fromshapely: Union[shapely.geometry.LineString, shapely.geometry.Polygon, shapely.geometry.MultiLineString, shapely.geometry.MultiPolygon] = None) Bases: :py:obj:`wolfhece.pyvertexvectors._models.zoneModel` .. autoapi-inheritance-diagram:: wolfhece.pyvertexvectors._zone.zone :parts: 1 :private-bases: Objet de gestion d'informations vectorielles (GUI). Hérite de :class:`zoneModel` pour les données/géométrie et ajoute OpenGL, wx et matplotlib. .. py:attribute:: mytree :type: TreeListCtrl .. py:attribute:: myitem :type: wx.core.TreeItemId .. py:attribute:: myprops :value: None .. py:attribute:: idgllist :value: -99999 .. py:attribute:: _rendering_machine :value: None .. py:method:: _make_vector(**kwargs) -> wolfhece.pyvertexvectors._vector.vector Factory: create a new GUI-enabled vector. .. py:method:: _make_zone(**kwargs) -> zone Factory: create a new GUI-enabled zone. .. py:method:: _make_zones(**kwargs) -> wolfhece.pyvertexvectors._zones.Zones Factory: create a GUI-enabled Zones collection. .. py:method:: _make_triangulation(**kwargs) -> wolfhece.pyvertexvectors._triangulation.Triangulation Factory: create a GUI-enabled triangulation. .. py:method:: find_nearest_vertex(x: float, y: float) -> wolfhece.PyVertex.wolfvertex | None Return the nearest vertex across all GUI vectors in the zone. .. py:method:: find_nearest_vector(x: float, y: float) -> wolfhece.pyvertexvectors._vector.vector | None Return the nearest GUI vector in the zone. .. py:method:: use() A utiliser .. py:method:: unuse() Ne plus utiliser .. py:method:: add2tree(tree: TreeListCtrl, root) Add the zone to a wx TreeListCtrl. :param tree: Target tree control. :param root: Parent tree item. .. py:method:: _fill_structure() Mise à jour des structures .. py:method:: show_properties() Show properties of the zone --> will be applied to all vectors int he zone .. py:method:: hide_properties() Hide the properties window .. py:method:: _callback_destroy_props() Callback to destroy the properties window .. py:method:: _callback_prop() Callback to update properties .. py:property:: rendering_machine Current rendering backend. Returns the zone's own setting, or the parent Zones' setting, or LIST. .. py:method:: prep_listogl() Préparation des listes OpenGL pour augmenter la vitesse d'affichage .. py:method:: plot(prep: bool = False, sx=None, sy=None, xmin=None, ymin=None, xmax=None, ymax=None, size=None, anim_phase: float = 0.0) Plot the zone using OpenGL. Dispatches to shader or display-list path depending on :attr:`rendering_machine`. :param prep: If True, compile into an OpenGL display list (list mode only). :param sx: Scale factor along X. :param sy: Scale factor along Y. :param xmin: Minimum X of the viewport. :param ymin: Minimum Y of the viewport. :param xmax: Maximum X of the viewport. :param ymax: Maximum Y of the viewport. :param size: Reference size for rendering. :param anim_phase: Animation phase ``[0, 1]`` for shader effects. .. py:method:: _plot_shader(sx=None, sy=None, xmin=None, ymin=None, xmax=None, ymax=None, size=None, anim_phase: float = 0.0) Render all vectors in this zone using the shader pipeline. .. py:method:: _plot_list(prep: bool = False, sx=None, sy=None, xmin=None, ymin=None, xmax=None, ymax=None, size=None) Render all vectors using legacy display lists / immediate mode. .. py:method:: reset_listogl() Reset OpenGL lists. Force deletion of the OpenGL list. If the object is newly plotted, the lists will be recreated. .. py:method:: 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) Plot the zone using Matplotlib. :param ax: Matplotlib Axes, ``(fig, ax)`` tuple, or None. :param xlim: Optional ``(xmin, xmax)`` bounds for legend clipping. :param ylim: Optional ``(ymin, ymax)`` bounds for legend clipping. :param kwargs: Additional keyword arguments. :return: ``(fig, ax)`` tuple. .. py:method:: 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) 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' :param fig: Figure :param ax: Axes :param linked_arrays: dictionnaire contenant les matrices à lier -- les clés sont les labels :param 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 :param linestyle: style de ligne :param onlymedian: affiche uniquement la médiane :param withtopography: affiche la topographie :param ds: pas spatial le long de l'axe .. py:method:: 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) 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' :param fig: Figure :param ax: Axes :param linked_arrays: dictionnaire contenant les matrices à lier -- les clés sont les labels :param 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 :param linestyle: style de ligne :param onlymedian: affiche uniquement la médiane :param withtopography: affiche la topographie :param ds: pas spatial le long de l'axe .. py:method:: create_multibin(nb: int = None, nb2: int = 0) -> wolfhece.pyvertexvectors._triangulation.Triangulation Create a triangulation from the zone's vectors. If *nb* is not provided and a wx app is running, a dialog is shown. :param nb: Number of interpolation points along each polyline. :param nb2: Number of intermediate points between polylines. :return: A :class:`Triangulation` instance or *None*. .. py:method:: create_tri_crosssection(ds: float = 1.0) -> wolfhece.pyvertexvectors._triangulation.Triangulation Create a triangulation from cross-section and support vectors. :param ds: Spacing used for the interpolation. :return: An :class:`Interpolators` instance or *None*. .. py:method:: create_constrainedDelaunay(nb: int = None) -> wolfhece.pyvertexvectors._triangulation.Triangulation Create a constrained Delaunay triangulation. If *nb* is not provided and a wx app is running, a dialog is shown. :param nb: Number of points along each polyline (0 to keep as-is). :return: A :class:`Triangulation` instance or *None*. .. py:method:: createmultibin_proj(nb=None, nb2=0) -> wolfhece.pyvertexvectors._triangulation.Triangulation Create a triangulation by projection. If *nb* is not provided and a wx app is running, a dialog is shown. :param nb: Number of points along each polyline. :param nb2: Number of intermediate points between polylines. :return: A :class:`Triangulation` instance or *None*. .. py:method:: create_sliding_polygon_from_parallel(poly_length: float, ds_sliding: float, farthest_parallel: float, interval_parallel: float = None, howmanypoly: int = 1, ds: float = None) Create sliding polygons from parallel vectors and refresh the view. :param poly_length: Length of each polygon along the trace. :param ds_sliding: Sliding step between successive polygons. :param farthest_parallel: Maximum distance for the farthest parallel. :param interval_parallel: Interval between parallels (None = auto). :param howmanypoly: Number of polygons to create. :param ds: Discretisation step for the vectors.