
    tj                     b   d Z ddlmZ ddlZi dej                  dej
                  dej                  dej                  dej                  d	ej                  d
ej                  dej                  dej                  dej                  dej                  dej                  dej                   dej"                  dej$                  dej&                  dej&                  Zi ej                  dej
                  dej                  dej                  dej                  dej                  dej                  dej                  dej                  dej                  dej                  dej                  d ej                   d!ej"                  d"ej$                  d#ej&                  d$Zi ej                  d%ej
                  d&ej                  d'ej                  d(ej                  d)ej                  d*ej                  d+ej                  d,ej                  d-ej                  d.ej                  d/ej                  d0ej                   d1ej"                  d2ej$                  d3ej&                  d4Zd5 Zd>d6Zd7 Zd8 Z G d9 d:      Zd; Zd< Zd= Zy)?zJ
Utility functions to mimic the template support functions for vtkVariant
    )vtkCommonCoreNvoidcharzunsigned charzsigned charshortzunsigned shortintzunsigned intlongzunsigned longz	long longzunsigned long longfloatdoublestringvtkObjectBase	vtkObject ToCharToUnsignedCharToSignedCharToShortToUnsignedShortToIntToUnsignedIntToLongToUnsignedLong
ToLongLongToUnsignedLongLongToFloatToDoubleToStringToVTKObjectIsValidIsCharIsUnsignedCharIsSignedCharIsShortIsUnsignedShortIsIntIsUnsignedIntIsLongIsUnsignedLong
IsLongLongIsUnsignedLongLongIsFloatIsDoubleIsStringIsVTKObjectc                 r    t        t        |      t              s	t        |   }t	        j
                  | |      S )z
    Create a vtkVariant of the specified type, where the type is in the
    following format: 'int', 'unsigned int', etc. for numeric types,
    and 'string' for strings.  You can also use an
    integer VTK type constant for the type.
    )
issubclasstyper   _variant_type_mapr   
vtkVariantvts     G/DATA/.local/lib/python3.12/site-packages/vtkmodules/util/vtkVariant.pyvtkVariantCreater7   C   s/     d1gs#a ##Aq))    c                     t        j                  |       } |dk(  r| j                         }n"t        t	        |      t
              s	t        |   } t        | t        |                r t        | t        |                S y)aA  
    Extract the specified value type from the vtkVariant, where the type is
    in the following format: 'int', 'unsigned int', etc. for numeric types,
    and 'string' for strings.  You can also use an
    integer VTK type constant for the type.  Set the type to 'None" to
    extract the value in its native type.
    N)
r   r2   GetTyper/   r0   r   r1   getattr_variant_check_map_variant_method_mapr3   s     r6   vtkVariantExtractr>   P   sn     	  #ADyIIKQ%a (wq$Q'(*1wq-a0133r8   c                     t        t        |      t              s	t        |   }t	        j
                  | |      } | j                         r t        | t        |                S y)z
    Cast the vtkVariant to the specified value type, where the type is
    in the following format: 'int', 'unsigned int', etc. for numeric types,
    and 'string' for strings.  You can also use an
    integer VTK type constant for the type.
    N)	r/   r0   r   r1   r   r2   r   r;   r=   r3   s     r6   vtkVariantCastr@   e   sR     d1gs#a   A&Ayy{1wq-a0133r8   c                    t        j                  |       } t        j                  |      }| j                         }|j                         }||k7  r||k  S | j                         }|j                         }|r|s||k  S  t	        | t
        |                } t	        |t
        |                }|t         j                  k(  rC|j                         }|j                         }	||	k7  r||	k  S |j                  |j                  k  S ||k  S )z<
    Compare variants by type first, and then by value.
    )	r   r2   r:   r   r;   r=   
VTK_OBJECTGetClassName__this__)
s1s2t1t2v1v2r1r2c1c2s
             r6   vtkVariantStrictWeakOrderrO   w   s     
	!	!"	%B		!	!"	%B	B	B 
RxBw	B	B Bw 
.(,	-	/B	-(,	-	/B 
]%%%____87N;;,,7Nr8   c                       e Zd ZdZd Zd Zy)vtkVariantStrictWeakOrderKeyz2A key method (class, actually) for use with sort()c                     || _         y N)obj)selfrT   argss      r6   __init__z%vtkVariantStrictWeakOrderKey.__init__   s	    r8   c                 .    t        | j                  |      S rS   )rO   rT   )rU   others     r6   __lt__z#vtkVariantStrictWeakOrderKey.__lt__   s    (599r8   N)__name__
__module____qualname____doc__rW   rZ    r8   r6   rQ   rQ      s    <:r8   rQ   c                 b   t        j                  |       } t        j                  |      }| j                         }|j                         }||k7  ry| j                         }|j                         }|s|sy||k7  ry t	        | t
        |                } t	        |t
        |                }||k(  S )zC
    Check two variants for strict equality of type and value.
    FT)r   r2   r:   r   r;   r=   )rE   rF   rG   rH   rI   rJ   rK   rL   s           r6   vtkVariantStrictEqualityra      s     
	!	!"	%B		!	!"	%B	B	B 
Rx	B	B 	r 
.(,	-	/B	-(,	-	/B"Hr8   c                 X    t        j                  |       t        j                  |      k  S )z!
    Return true if s1 < s2.
    r   r2   rE   rF   s     r6   vtkVariantLessThanre      s%     $$R(=+C+CB+GGHr8   c                 X    t        j                  |       t        j                  |      k(  S )z"
    Return true if s1 == s2.
    rc   rd   s     r6   vtkVariantEqualrg      s%     $$R(M,D,DR,HHIr8   rS   )r^   
vtkmodulesr   sysVTK_VOIDVTK_CHARVTK_UNSIGNED_CHARVTK_SIGNED_CHAR	VTK_SHORTVTK_UNSIGNED_SHORTVTK_INTVTK_UNSIGNED_INTVTK_LONGVTK_UNSIGNED_LONGVTK_LONG_LONGVTK_UNSIGNED_LONG_LONG	VTK_FLOAT
VTK_DOUBLE
VTK_STRINGrB   r1   r=   r<   r7   r>   r@   rO   rQ   ra   re   rg   r_   r8   r6   <module>ry      s   % 

]##
]## m55 M11	
 m%% }77 
M!! ]33 ]## m55 --- =?? m%% }'' }''  m..!" -**# (RX ##&6 !!N	
 i $$'8 G ""_ X ##&6 , ((+? i z z  }! &YX ##&6 !!N	
 i $$'8 G ""_ X ##&6 , ((+? i z z  }! (
**$"J: :<IJr8   