
    OgE*                    H   d dl mZ d dlmZ d dlZd dlZd dlmZ d dlmZm	Z	 d dl
mZ d dlmZ dd	lmZ  G d
 de      Z G d de      Z G d de      Z G d de      Z G d de      Z G d de      Z G d de      Z G d de      Z ed       G d d             Zy)    )annotations)OptionalN)	dataclass)Enumauto)disassemble)Measurement   )Colorc                  :    e Zd ZdZ e       Z e       Z e       Zy)
LinePolicyah  This enum is used to define how to render linetypes.

    .. note::

        Text and shapes in linetypes are not supported.

    Attributes:
        SOLID: draw all lines as solid regardless of the linetype style
        ACCURATE: render styled lines as accurately as possible
        APPROXIMATE: ignored since v0.18.1 - uses always ACCURATE by default

    N)__name__
__module____qualname____doc__r   SOLIDAPPROXIMATEACCURATE     `/var/www/html/public_html/myphp/venv/lib/python3.12/site-packages/ezdxf/addons/drawing/config.pyr   r      s     FE&KvHr   r   c                  :    e Zd ZdZ e       Z e       Z e       Zy)ProxyGraphicPolicya  The action to take when an entity with a proxy graphic is encountered

    .. note::

        To get proxy graphics support proxy graphics have to be loaded:
        Set the global option :attr:`ezdxf.options.load_proxy_graphics` to
        ``True``, which is the default value.

        This can not prevent drawing proxy graphic inside of blocks,
        because this is beyond the domain of the drawing add-on!

    Attributes:
        IGNORE: do not display proxy graphics (skip_entity will be called instead)
        SHOW: if the entity cannot be rendered directly (e.g. if not implemented)
            but a proxy is present: display the proxy
        PREFER: display proxy graphics even for entities where direct rendering
            is available
    N)r   r   r   r   r   IGNORESHOWPREFERr   r   r   r   r   "   s    & VF6DVFr   r   c                  V    e Zd ZdZ e       Z e       Z e       Z e       Z e       Z	y)HatchPolicyaA  The action to take when a HATCH entity is encountered

    Attributes:
        NORMAL: render pattern and solid fillings
        IGNORE: do not show HATCH entities at all
        SHOW_OUTLINE: show only the outline of HATCH entities
        SHOW_SOLID: show HATCH entities as solid filling regardless of the pattern

    N)
r   r   r   r   r   NORMALr   SHOW_OUTLINE
SHOW_SOLIDSHOW_APPROXIMATE_PATTERNr   r   r   r   r   ;   s-     VFVF6LJ#vr   r   c                  :    e Zd ZdZ e       Z e       Z e       Zy)LineweightPolicya  This enum is used to define how to determine the lineweight.

    Attributes:
        ABSOLUTE: in mm as resolved by the :class:`Frontend` class
        RELATIVE: lineweight is relative to page size
        RELATIVE_FIXED: fixed lineweight relative to page size for all strokes

    N)r   r   r   r   r   ABSOLUTERELATIVERELATIVE_FIXEDr   r   r   r$   r$   M   s      vH vHVNr   r$   c                      e Zd ZdZ e       Z e       Z e       Z e       Z e       Z	 e       Z
 e       Z e       Z e       Zy)ColorPolicya  This enum is used to define how to determine the line/fill color.

    Attributes:
        COLOR: as resolved by the :class:`Frontend` class
        COLOR_SWAP_BW: as resolved by the :class:`Frontend` class but swaps black and white
        COLOR_NEGATIVE: invert all colors
        MONOCHROME: maps all colors to gray scale in range [0%, 100%]
        MONOCHROME_DARK_BG: maps all colors to gray scale in range [30%, 100%], brightens
            colors for dark backgrounds
        MONOCHROME_LIGHT_BG:  maps all colors to gray scale in range [0%, 70%], darkens
            colors for light backgrounds
        BLACK: maps all colors to black
        WHITE: maps all colors to white
        CUSTOM: maps all colors to custom color :attr:`Configuration.custom_fg_color`

    N)r   r   r   r   r   COLORCOLOR_SWAP_BWCOLOR_NEGATIVE
MONOCHROMEMONOCHROME_DARK_BGMONOCHROME_LIGHT_BGBLACKWHITECUSTOMr   r   r   r)   r)   a   sJ    " FEFMVNJ&FEFEVFr   r)   c                  r    e Zd ZdZ e       Z e       Z e       Z e       Z e       Z	 e       Z
 e       Zy)BackgroundPolicya  This enum is used to define the background color.

    Attributes:
        DEFAULT: as resolved by the :class:`Frontend` class
        WHITE: white background
        BLACK: black background
        PAPERSPACE: default paperspace background
        MODELSPACE: default modelspace background
        OFF: fully transparent background
        CUSTOM: custom background color by :attr:`Configuration.custom_bg_color`

    N)r   r   r   r   r   DEFAULTr1   r0   
PAPERSPACE
MODELSPACEOFFr2   r   r   r   r4   r4   ~   s:     fGFEFEJJ
&CVFr   r4   c                  V    e Zd ZdZ e       Z e       Z e       Z e       Z e       Z	y)
TextPolicyaF  This enum is used to define the text rendering.

    Attributes:
        FILLING: text is rendered as solid filling (default)
        OUTLINE: text is rendered as outline paths
        REPLACE_RECT: replace text by a rectangle
        REPLACE_FILL: replace text by a filled rectangle
        IGNORE: ignore text entirely

    N)
r   r   r   r   r   FILLINGOUTLINEREPLACE_RECTREPLACE_FILLr   r   r   r   r:   r:      s,    	 fGfG6L6LVFr   r:   c                  V    e Zd ZdZ e       Z e       Z e       Z e       Z e       Z	y)ImagePolicya  This enum is used to define the image rendering.

    Attributes:
        DISPLAY: display images as they would appear in a regular CAD application
        RECT: display images as rectangles
        MISSING: images are always rendered as-if they are missing (rectangle + path text)
        PROXY: images are rendered using their proxy representations (rectangle)
        IGNORE: ignore images entirely

    N)
r   r   r   r   r   DISPLAYRECTMISSINGPROXYr   r   r   r   r@   r@      s,    	 fG6DfGFEVFr   r@   T)frozenc                  (   e Zd ZU dZdZded<   dZded<   dZded<   dZd	ed
<   e	j                  Zded<   ej                  Zded<   ej                   Zded<   dZded<   dZded<   dZded<   dZded<   ej.                  j0                  Zded<   dZded<   dZded<   d Zded!<   ej:                  Zd"ed#<   d$Zd%ed&<   e jB                  Z"d'ed(<   d)Z#d%ed*<   e$jJ                  Z&d+ed,<   e'jP                  Z)d-ed.<   e*jV                  Z,d/ed0<   e-d3d1       Z.d3d2Z/y)4Configurationa  Configuration options for the :mod:`drawing` add-on.

    Attributes:
        pdsize: the size to draw POINT entities (in drawing units)
            set to None to use the $PDSIZE value from the dxf document header

            ======= ====================================================
            0       5% of draw area height
            <0      Specifies a percentage of the viewport size
            >0      Specifies an absolute size
            None    use the $PDMODE value from the dxf document header
            ======= ====================================================

        pdmode: point styling mode (see POINT documentation)

            see :class:`~ezdxf.entities.Point` class documentation

        measurement: whether to use metric or imperial units as enum :class:`ezdxf.enums.Measurement`

            ======= ======================================================
            0       use imperial units (in, ft, yd, ...)
            1       use metric units (ISO meters)
            None    use the $MEASUREMENT value from the dxf document header
            ======= ======================================================

        show_defpoints: whether to show or filter out POINT entities on the defpoints layer
        proxy_graphic_policy: the action to take when a proxy graphic is encountered
        line_policy: the method to use when drawing styled lines (eg dashed,
            dotted etc)
        hatch_policy: the method to use when drawing HATCH entities
        infinite_line_length: the length to use when drawing infinite lines
        lineweight_scaling:
            multiplies every lineweight by this factor; set this factor to 0.0 for a
            constant minimum line width defined by the :attr:`min_lineweight` setting
            for all lineweights;
            the correct DXF lineweight often looks too thick in SVG, so setting a
            factor < 1 can improve the visual appearance
        min_lineweight: the minimum line width in 1/300 inch; set to ``None`` for
            let the backend choose.
        min_dash_length: the minimum length for a dash when drawing a styled line
            (default value is arbitrary)
        max_flattening_distance: Max flattening distance in drawing units
            see Path.flattening documentation.
            The backend implementation should calculate an appropriate value,
            like 1 screen- or paper pixel on the output medium, but converted
            into drawing units. Sets Path() approximation accuracy
        circle_approximation_count: Approximate a full circle by `n` segments, arcs
            have proportional less segments. Only used for approximation of arcs
            in banded polylines.
        hatching_timeout: hatching timeout for a single entity, very dense
            hatching patterns can cause a very long execution time, the default
            timeout for a single entity is 30 seconds.
        min_hatch_line_distance: minimum hatch line distance to render, narrower pattern
            lines are rendered as solid filling
        color_policy:
        custom_fg_color: Used for :class:`ColorPolicy.custom` policy, custom foreground
            color as "#RRGGBBAA" color string (RGB+alpha)
        background_policy:
        custom_bg_color: Used for :class:`BackgroundPolicy.custom` policy, custom
            background color as "#RRGGBBAA" color string (RGB+alpha)
        lineweight_policy:
        text_policy:
        image_policy: the method for drawing IMAGE entities

    NzOptional[int]pdsizepdmodezOptional[Measurement]measurementFboolshow_defpointsr   proxy_graphic_policyr   line_policyr   hatch_policy   floatinfinite_line_lengthg      ?lineweight_scalingzOptional[float]min_lineweightg?min_dash_lengthmax_flattening_distance   intcircle_approximation_countg      >@hatching_timeoutg-C6?min_hatch_line_distancer)   color_policyz#000000r   custom_fg_colorr4   background_policyz#ffffffcustom_bg_colorr$   lineweight_policyr:   text_policyr@   image_policyc                 J    t        j                  dt               t               S )Nz7use Configuration() instead of Configuration.defaults())warningswarnDeprecationWarningrG   r   r   r   defaultszConfiguration.defaults  s    E	
 r   c                |    t        j                  |       }|j                         D ]
  \  }}|||<    t        di |S )zHReturns a new frozen :class:`Configuration` object with modified values.r   )dataclassesasdictitemsrG   )selfkwargsparamskvs        r   with_changeszConfiguration.with_changes  sB    ##D)LLN 	DAqF1I	&v&&r   )returnrG   )0r   r   r   r   rH   __annotations__rI   rJ   rL   r   r   rM   r   r   rN   r   r   rO   rR   rS   rT   rU   r   	PrimitiverV   rY   rZ   r[   r)   r*   r\   r]   r4   r5   r^   r_   r$   r%   r`   r:   r;   ra   r@   rA   rb   staticmethodrg   rq   r   r   r   rG   rG      sG   @D !FM  FM )-K&- ND /A/F/F,F(11K1 + 2 2L+2"$%$ ##&*NO* OU %0%:%:%R%RUR&))"e"%)U) + 1 1L+1&OU&*:*B*B'B&OU&*:*C*C'C(00K0 + 3 3L+3 'r   rG   )
__future__r   typingr   rd   ri   r   enumr   r   ezdxfr   ezdxf.enumsr	   
type_hintsr   r   r   r   r$   r)   r4   r:   r@   rG   r   r   r   <module>r|      s    #    !   #  & 2&$ &$t ($ :t . &$ & $h' h' h'r   