
    lj7	                        d Z ddlmZ ddgZddlmZ ddlmZ ddlm	Z	 ddl
mZ d	d
lmZ ddlmZ d d!dZddefd"dZdS )#zDebugging utilities.    )annotationsprint_familyindex_labels)Any)Mobject)Integer)
ManimColor   )VGroup   )BLACKmobjectr   n_tabsintreturnNonec                    t          d|z  | t          |                      | j        D ]}t          ||dz              dS )zFor debugging purposes	r   N)printidsubmobjectsr   )r   r   submobs      L/home/agentuser/manim-venv/lib/python3.11/site-packages/manim/utils/debug.pyr   r      sQ    	$-"W++...% ) )VVaZ(((() )    g333333?   label_heightfloatbackground_stroke_widthbackground_stroke_colorr	   kwargsr   r   c                    t                      }t          |           D ][\  }}t          |fi |}|                    ||d           ||_        |                    |           |                    |           \|S )a  Returns a :class:`~.VGroup` of :class:`~.Integer` mobjects
    that shows the index of each submobject.

    Useful for working with parts of complicated mobjects.

    Parameters
    ----------
    mobject
        The mobject that will have its submobjects labelled.
    label_height
        The height of the labels, by default 0.15.
    background_stroke_width
        The stroke width of the outline of the labels, by default 5.
    background_stroke_color
        The stroke color of the outline of labels.
    kwargs
        Additional parameters to be passed into the :class`~.Integer`
        mobjects used to construct the labels.

    Examples
    --------
    .. manim:: IndexLabelsExample
        :save_last_frame:

        class IndexLabelsExample(Scene):
            def construct(self):
                text = MathTex(
                    "\\frac{d}{dx}f(x)g(x)=",
                    "f(x)\\frac{d}{dx}g(x)",
                    "+",
                    "g(x)\\frac{d}{dx}f(x)",
                )

                #index the fist term in the MathTex mob
                indices = index_labels(text[0])

                text[0][1].set_color(PURPLE_B)
                text[0][8:12].set_color(DARK_BLUE)

                self.add(text, indices)
    T)
background)r   	enumerater   
set_strokeheightmove_toadd)	r   r   r   r   r    labelsnr   labels	            r   r   r      s    ` XXFw''  	6$$V$$#%< 	 	
 	
 	
 $f

5Mr   N)r   )r   r   r   r   r   r   )r   r   r   r   r   r   r   r	   r    r   r   r   )__doc__
__future__r   __all__typingr   manim.mobject.mobjectr   manim.mobject.text.numbersr   manim.utils.colorr	    mobject.types.vectorized_mobjectr   colorr   r   r    r   r   <module>r5      s      " " " " " ">
*       ) ) ) ) ) ) . . . . . . ( ( ( ( ( ( 5 5 5 5 5 5      ) ) ) ) ) %&*/	9 9 9 9 9 9 9r   