
    hE*                    B   S SK Jr  S SKJr  S SKrS SKrS SKJr  S SKJrJ	r	  S SK
Jr  S SKJr  SS	KJr   " S
 S\5      r " S S\5      r " S S\5      r " S S\5      r " S S\5      r " S S\5      r " S S\5      r " S S\5      r\" SS9 " S S5      5       rg)    )annotations)OptionalN)	dataclass)Enumauto)disassemble)Measurement   )Colorc                  B    \ rS rSrSr\" 5       r\" 5       r\" 5       rSr	g)
LinePolicy   aL  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____firstlineno____doc__r   SOLIDAPPROXIMATEACCURATE__static_attributes__r       M/var/www/html/env/lib/python3.13/site-packages/ezdxf/addons/drawing/config.pyr   r      s     FE&KvHr   r   c                  B    \ rS rSrSr\" 5       r\" 5       r\" 5       rSr	g)ProxyGraphicPolicy"   a  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
r   N)
r   r   r   r   r   r   IGNORESHOWPREFERr   r   r   r   r   r   "   s    & VF6DVFr   r   c                  ^    \ rS rSrSr\" 5       r\" 5       r\" 5       r\" 5       r	\" 5       r
Srg)HatchPolicy;   a)  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

r   N)r   r   r   r   r   r   NORMALr   SHOW_OUTLINE
SHOW_SOLIDSHOW_APPROXIMATE_PATTERNr   r   r   r   r"   r"   ;   s-     VFVF6LJ#vr   r"   c                  B    \ rS rSrSr\" 5       r\" 5       r\" 5       rSr	g)LineweightPolicyM   a  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

r   N)
r   r   r   r   r   r   ABSOLUTERELATIVERELATIVE_FIXEDr   r   r   r   r)   r)   M   s      vH vHVNr   r)   c                      \ rS rSrSr\" 5       r\" 5       r\" 5       r\" 5       r	\" 5       r
\" 5       r\" 5       r\" 5       r\" 5       rSrg)ColorPolicya   a  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`

r   N)r   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/   r/   a   sJ    " FEFMVNJ&FEFEVFr   r/   c                  z    \ rS rSrSr\" 5       r\" 5       r\" 5       r\" 5       r	\" 5       r
\" 5       r\" 5       rSrg)BackgroundPolicy~   a  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`

r   N)r   r   r   r   r   r   DEFAULTr8   r7   
PAPERSPACE
MODELSPACEOFFr9   r   r   r   r   r;   r;   ~   s:     fGFEFEJJ
&CVFr   r;   c                  ^    \ rS rSrSr\" 5       r\" 5       r\" 5       r\" 5       r	\" 5       r
Srg)
TextPolicy   a*  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

r   N)r   r   r   r   r   r   FILLINGOUTLINEREPLACE_RECTREPLACE_FILLr   r   r   r   r   rB   rB      s,    	 fGfG6L6LVFr   rB   c                  ^    \ rS rSrSr\" 5       r\" 5       r\" 5       r\" 5       r	\" 5       r
Srg)ImagePolicy   a{  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

r   N)r   r   r   r   r   r   DISPLAYRECTMISSINGPROXYr   r   r   r   r   rI   rI      s,    	 fG6DfGFEVFr   rI   T)frozenc                  4   \ rS rSr% SrSrS\S'   SrS\S'   SrS\S'   S	r	S
\S'   \
R                  rS\S'   \R                  rS\S'   \R"                  rS\S'   SrS\S'   SrS\S'   SrS\S'   SrS\S'   \R0                  R2                  rS\S'   SrS\S'   SrS\S '   S!rS\S"'   \R<                  rS#\S$'   S%r S&\S''   \!RD                  r#S(\S)'   S*r$S&\S+'   \%RL                  r'S,\S-'   \(RR                  r*S.\S/'   \+RX                  r-S0\S1'   \.S5S2 j5       r/S5S3 jr0S4r1g)6Configuration   a  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_colorr;   background_policyz#ffffffcustom_bg_colorr)   lineweight_policyrB   text_policyrI   image_policyc                 L    [         R                  " S[        5        [        5       $ )Nz7use Configuration() instead of Configuration.defaults())warningswarnDeprecationWarningrQ   r   r   r   defaultsConfiguration.defaults  s    E	
 r   c                ~    [         R                  " U 5      nUR                  5        H	  u  p4XBU'   M     [        S0 UD6$ )zHReturns a new frozen :class:`Configuration` object with modified values.r   )dataclassesasdictitemsrQ   )selfkwargsparamskvs        r   with_changesConfiguration.with_changes  s9    ##D)LLNDA1I #&v&&r   r   )returnrQ   )2r   r   r   r   r   rS   __annotations__rT   rU   rW   r   r   rX   r   r   rY   r"   r$   rZ   r]   r^   r_   r`   r   	Primitivera   rd   re   rf   r/   r1   rg   rh   r;   r=   ri   rj   r)   r+   rk   rB   rD   rl   rI   rK   rm   staticmethodrr   r}   r   r   r   r   rQ   rQ      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   rQ   )
__future__r   typingr   ro   ru   r   enumr   r   ezdxfr   ezdxf.enumsr	   
type_hintsr   r   r   r"   r)   r/   r;   rB   rI   rQ   r   r   r   <module>r      s    #    !   #  & 2&$ &$t ($ :t . &$ & $h' h' h'r   