OwlCyberSecurity - MANAGER
Edit File: transforms.cpython-38.pyc
U ��]} � @ s d Z ddlZddlZddlZddlmZ ddlmZ ddl m Z mZmZ ddl mZ dZd d � ZG dd� de�ZG d d� de�ZG dd� de�ZG dd� de�ZG dd� de�ZG dd� de�ZG dd� de�ZG dd� de�ZG dd� de�ZG dd� de�ZG dd � d e�ZG d!d"� d"e�ZG d#d$� d$e�Zd%d&� ZG d'd(� d(e�Z G d)d*� d*e�Z!d+d,� Z"G d-d.� d.e�Z#G d/d0� d0e�Z$G d1d2� d2e$�Z%G d3d4� d4e�Z&G d5d6� d6e�Z'G d7d8� d8e�Z(G d9d:� d:e(�Z)dKd>d?�Z*d@dA� Z+dLdCdD�Z,dEdF� Z-dMdIdJ�Z.dS )Na� matplotlib includes a framework for arbitrary geometric transformations that is used determine the final position of all elements drawn on the canvas. Transforms are composed into trees of :class:`TransformNode` objects whose actual value depends on their children. When the contents of children change, their parents are automatically invalidated. The next time an invalidated transform is accessed, it is recomputed to reflect those changes. This invalidation/caching approach prevents unnecessary recomputations of transforms, and contributes to better interactive performance. For example, here is a graph of the transform tree used to plot data to the graph: .. image:: ../_static/transforms.png The framework can be used for both affine and non-affine transformations. However, for speed, we want use the backend renderers to perform affine transformations whenever possible. Therefore, it is possible to perform just the affine or non-affine part of a transformation on a set of data. The affine is always assumed to occur after the non-affine. For any transform:: full transform == non-affine part + affine part The backends are not expected to handle non-affine transformations themselves. � N)�inv)�cbook)�affine_transform�count_bboxes_overlapping_bbox�update_path_extents� )�PathFc C s t �ddt| ��S )Nz(^| )z\1 )�re�sub�str)�obj� r �7/usr/lib/python3/dist-packages/matplotlib/transforms.py�_indent_str2 s r c @ s� e Zd ZdZdZdZdZeeB ZdZdZ dZ ddd�ZerBd d � Z dd� Zd d� Zdd� ZeZdd� Zdd� Zdd� Zer�eZdd� Zeje_dd� Zer�g fdd�ZdS )� TransformNodeaE :class:`TransformNode` is the base class for anything that participates in the transform tree and needs to invalidate its parents or be invalidated. This includes classes that are not really transforms, such as bounding boxes, since some transforms depend on bounding boxes to compute their values. r r � FNc C s i | _ d| _|pd| _dS )a@ Creates a new :class:`TransformNode`. Parameters ---------- shorthand_name : str A string representing the "name" of the transform. The name carries no significance other than to improve the readability of ``str(transform)`` when DEBUG=True. r � N)�_parents�_invalid�_shorthand_name)�self�shorthand_namer r r �__init__R s zTransformNode.__init__c C s | j pt| �S �N)r �repr�r r r r �__str__e s zTransformNode.__str__c C s | j ddd� | j�� D �i�S )Nr c S s i | ]\}}||� �qS r r ��.0�k�vr r r � <dictcomp>l s z.TransformNode.__getstate__.<locals>.<dictcomp>��__dict__r �itemsr r r r �__getstate__i s �zTransformNode.__getstate__c s$ |� _ � fdd�� j�� D �� _d S )Nc s2 i | ]*\}}|d k r|t �||� jfdd���qS )Nc S s |� |�S r ��pop��refZsid�targetr r r �<lambda>s s z7TransformNode.__setstate__.<locals>.<dictcomp>.<lambda>)�weakrefr) r r r r r r! s s � �z.TransformNode.__setstate__.<locals>.<dictcomp>r"