
    \i<                         S r SSKJrJr  SSKJr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\5      rg)a  
Copyright 2011-2018 Kyle Lancaster | 2019 Patrick Eisoldt

Simplekml is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.

    )Kmlablecheck)CameraLookAtc                   <   ^  \ rS rSrSrU 4S jr\S 5       rSrU =r	$ )GxTourPrimitive   zQAbstract class extended by all tour types.

.. note::
  Not to be used directly.
c                 *   > [         [        U ]  5         g N)superr   __init__)self	__class__s    Q/var/www/html/kml_chatgpt/mouzaenv/lib/python3.13/site-packages/simplekml/tour.pyr   GxTourPrimitive.__init__   s    ot-/    c                     U R                   $ )zThe id string.)_idr   s    r   idGxTourPrimitive.id    s     xxr    )
__name__
__module____qualname____firstlineno____doc__r   propertyr   __static_attributes____classcell__r   s   @r   r   r      s!    0  r   r   c                      ^  \ rS rSrSr  S
U 4S jjr\S 5       r\R                  S 5       r\S 5       r	\	R                  S 5       r	U 4S jr
S	rU =r$ )
GxSoundCue&   zSpecifies a sound to be played in a tour.

The arguments are the same as the properties. See :class:`simplekml.GxTour` for usage.
c                 b   > [         [        U ]  5         XR                  S'   X R                  S'   g )Nhrefgx:delayedStart)r   r#   r   _kml)r   r&   gxdelayedstartr   s      r   r   GxSoundCue.__init__+   s+     	j$(* 		&'5		#$r   c                      U R                   S   $ )z+A string reference to a sound file to play.r&   r(   r   s    r   r&   GxSoundCue.href2        yy  r   c                      XR                   S'   g )Nr&   r,   )r   r&   s     r   r&   r-   7        		&r   c                      U R                   S   $ )z?Double telling the number of seconds to delay playing the file.r'   r,   r   s    r   r)   GxSoundCue.gxdelayedstart;        yy*++r   c                      XR                   S'   g Nr'   r,   r   r)   s     r   r)   r2   @       '5		#$r   c                    > SR                  U R                  5      [        [        U ]  5       SR                  U R                  5      /nSR                  U5      $ )Nz<gx:SoundCue id="{0}">z</gx:SoundCue> )formatr   r   r#   __str__joinr   bufr   s     r   r;   GxSoundCue.__str__D   sK    '..txx8Z.0&&txx02 wws|r   r   )NN)r   r   r   r   r   r   r   r&   setterr)   r;   r   r    r!   s   @r   r#   r#   &   sy    
  $6 ! ! 
[[! ! , , 6 6 r   r#   c                   r   ^  \ rS rSrSr SU 4S jjr\S 5       r\R                  S 5       rU 4S jr	Sr
U =r$ )	GxTourControlK   zKAllows a tour to be paused.

The arguments are the same as the properties.
c                 F   > [         [        U ]  5         XR                  S'   g Ngx:playMode)r   rB   r   r(   )r   
gxplaymoder   s     r   r   GxTourControl.__init__P   s    mT+-#-		- r   c                      U R                   S   $ )zJString to pause the tour, accepts :class:`simplekml.GxPlayMode` constants.rF   r,   r   s    r   rG   GxTourControl.gxplaymodeU        yy''r   c                      XR                   S'   g rE   r,   )r   rG   s     r   rG   rJ   Z       #-		- r   c                    > SR                  U R                  5      [        [        U ]  5       SR                  U R                  5      /nSR                  U5      $ )Nz<gx:TourControl id="{0}">z</gx:TourControl>r9   )r:   r   r   rB   r;   r<   r=   s     r   r;   GxTourControl.__str__^   sK    *11$((;]D13"))$((35 wws|r   r   )pause)r   r   r   r   r   r   r   rG   r@   r;   r   r    r!   s   @r   rB   rB   K   sJ    
 $.
 ( ( . . r   rB   c                   r   ^  \ rS rSrSr SU 4S jjr\S 5       r\R                  S 5       rU 4S jr	Sr
U =r$ )	GxWaite   ztAllows a tour to be paused.

The arguments are the same as the properties. See :class:`simplekml.GxTour` for usage.
c                 F   > [         [        U ]  5         XR                  S'   g Ngx:duration)r   rR   r   r(   )r   
gxdurationr   s     r   r   GxWait.__init__j   s    fd$&#-		- r   c                      U R                   S   $ z4Double indicating how long the camera remains still.rV   r,   r   s    r   rW   GxWait.gxdurationo   rK   r   c                      XR                   S'   g rU   r,   r   rW   s     r   rW   r[   t   rM   r   c                    > SR                  U R                  5      [        [        U ]  5       SR                  U R                  5      /nSR                  U5      $ )Nz<gx:Wait id="{0}">z
</gx:Wait>r9   )r:   r   r   rR   r;   r<   r=   s     r   r;   GxWait.__str__x   sI    #**4884VT*,l.A.A$((.KMwws|r   r   r   )r   r   r   r   r   r   r   rW   r@   r;   r   r    r!   s   @r   rR   rR   e   sJ    
 !.
 ( ( . . r   rR   c                   H  ^  \ rS rSrSrSrSr    SU 4S jjr\S 5       r	\	R                  S 5       r	\S 5       r\R                  S	 5       r\S
 5       r\R                  \" \5      S 5       5       r\S 5       r\R                  \" \5      S 5       5       rU 4S jrSrU =r$ )GxFlyTo~   zAllows unbroken flight from point to point.

The arguments are the same as the properties. See :class:`simplekml.GxTour` for usage.
bouncesmoothc                   > [         [        U ]  5         XR                  S'   X R                  S'   S U R                  S'   S U R                  S'   Ub  X0R                  S'   S U R                  S'   g S U R                  S'   X@R                  S'   g )NrV   gx:flyToModer   r   )r   ra   r   r(   )r   rW   gxflytomodecameralookatr   s        r   r   GxFlyTo.__init__   s    
 	gt%'#-		- $/		.!"		("		("(IIh"&DIIh"&DIIh"(IIhr   c                      U R                   S   $ rZ   r,   r   s    r   rW   GxFlyTo.gxduration   rK   r   c                      XR                   S'   g rU   r,   r]   s     r   rW   rl      rM   r   c                      U R                   S   $ )zIHow the camera behaves, accepts :class:`simplekml.GxFlyToMode` constants.rf   r,   r   s    r   rg   GxFlyTo.gxflytomode   s     yy((r   c                      XR                   S'   g )Nrf   r,   )r   rg   s     r   rg   ro      s    $/		.!r   c                     U R                   S   c&  [        5       U R                   S'   SU R                   S'   U R                   S   $ )z>Camera that views the scene, accepts :class:`simplekml.Camera`r   Nr   )r(   r   r   s    r   rh   GxFlyTo.camera   @     99X&"((DIIh"&DIIhyy""r   c                 >    XR                   S'   S U R                   S'   g Nr   r   r,   )r   rh   s     r   rh   rr      s     %		("		(r   c                     U R                   S   c&  [        5       U R                   S'   SU R                   S'   U R                   S   $ )zACamera relative to the feature, accepts :class:`simplekml.LookAt`r   Nr   )r(   r   r   s    r   ri   GxFlyTo.lookat   rs   r   c                 >    S U R                   S'   XR                   S'   g ru   r,   )r   ri   s     r   ri   rw      s     #		($		(r   c                    > SR                  U R                  5      [        [        U ]  5       SR                  U R                  5      /nSR                  U5      $ )Nz<gx:FlyTo id="{0}">z</gx:FlyTo>r9   )r:   r   r   ra   r;   r<   r=   s     r   r;   GxFlyTo.__str__   sK    $++DHH5Wd+-##DHH-/ wws|r   r   NNNN)r   r   r   r   r   rc   rd   r   r   rW   r@   rg   rh   r   r   ri   r   r;   r   r    r!   s   @r   ra   ra   ~   s    
 FF !!	)" ( ( . . ) ) 0 0 # # ]]
6]#  # # # ]]
6]%  % r   ra   c                     ^  \ rS rSrSr    SU 4S jjr\S 5       r\R                  S 5       r\S 5       r	\	R                  S 5       r	\S 5       r
\
R                  S	 5       r
\S
 5       r\R                  S 5       rSrU =r$ )Update   zAction to take when animation updates.

The arguments are the same as the properties. See :class:`simplekml.GxTour` for usage.
c                    > [         [        U ]  5         Uc  SnXR                  S'   X R                  S'   X0R                  S'   X@R                  S'   g )Nr9   
targetHrefChangeCreateDelete)r   r}   r   r(   )r   
targethrefchangecreatedeleter   s        r   r   Update.__init__   sM    
 	fd$&J",		,$		($		($		(r   c                      U R                   S   $ )zThe target url.r   r,   r   s    r   r   Update.targethref   s     yy&&r   c                      XR                   S'   g )Nr   r,   )r   r   s     r   r   r      s    ",		,r   c                      U R                   S   $ )z.KML string representing a change in animation.r   r,   r   s    r   r   Update.change        yy""r   c                      XR                   S'   g )Nr   r,   )r   r   s     r   r   r          $		(r   c                      U R                   S   $ )z4KML string representing a creation during animation.r   r,   r   s    r   r   Update.create   r   r   c                      XR                   S'   g )Nr   r,   )r   r   s     r   r   r      r   r   c                      U R                   S   $ )z4KML string representing a deletion during animation.r   r,   r   s    r   r   Update.delete   r   r   c                      XR                   S'   g )Nr   r,   )r   r   s     r   r   r      r   r   r   r{   )r   r   r   r   r   r   r   r   r@   r   r   r   r   r    r!   s   @r   r}   r}      s    
 !	% ' ' - - # # ]]% % # # ]]% % # # ]]% %r   r}   c                      ^  \ rS rSrSr   SU 4S jjr\S 5       r\R                  S 5       r\S 5       r	\	R                  S 5       r	\S 5       r
\
R                  \" \5      S	 5       5       r
U 4S
 jrSrU =r$ )GxAnimatedUpdatei  zControls changes during a tour to KML features.

The arguments are the same as the properties. See :class:`simplekml.GxTour` for usage.
c                 ~   > [         [        U ]  5         XR                  S'   X R                  S'   X0R                  S'   g )NrV   r'   r}   )r   r   r   r(   )r   rW   r)   updater   s       r   r   GxAnimatedUpdate.__init__  s8     	.0#-		- '5		#$$		(r   c                      U R                   S   $ rZ   r,   r   s    r   rW   GxAnimatedUpdate.gxduration  rK   r   c                      XR                   S'   g rU   r,   r]   s     r   rW   r     rM   r   c                      U R                   S   $ )z4Double of number of seconds to wait before starting.r'   r,   r   s    r   r)   GxAnimatedUpdate.gxdelayedstart  r3   r   c                      XR                   S'   g r5   r,   r6   s     r   r)   r   "  r7   r   c                 n    U R                   S   c  [        5       U R                   S'   U R                   S   $ )z%Instance of :class:`simplekml.Update`r}   )r(   r}   r   s    r   r   GxAnimatedUpdate.update&  s2     99X&"((DIIhyy""r   c                      XR                   S'   g )Nr}   r,   )r   r   s     r   r   r   -  s     %		(r   c                    > SR                  U R                  5      [        [        U ]  5       SR                  U R                  5      /nSR                  U5      $ )Nz<gx:AnimatedUpdate id="{0}">z</gx:AnimatedUpdate>r9   )r:   r   r   r   r;   r<   r=   s     r   r;   GxAnimatedUpdate.__str__2  sL    -44TXX>%t46%,,TXX68 wws|r   r   NNN)r   r   r   r   r   r   r   rW   r@   r)   r   r   r}   r;   r   r    r!   s   @r   r   r     s     ! $% ( ( . . , , 6 6 # # ]]
6]%  % r   r   c                   r   ^  \ rS rSrSrSU 4S jjr\" \S5      S 5       rS r	S r
S rS	 rS
 rS rSrU =r$ )
GxPlaylisti9  zrDefines a part of a tour.

The arguments are the same as the properties. See :class:`simplekml.GxTour` for usage.
c                 j   > [         [        U ]  5         / U l        Ub  U =R                  U-  sl        g g r   )r   r   r   gxtourprimitives)r   r   r   s     r   r   GxPlaylist.__init__>  s5    j$(* "'!!%55! (r   Tc                 :    U R                   R                  U5        g)z4Adds a :class:`simplekml.GxTourPrimitive` sub-class.N)r   append)r   gxtourprimitives     r   addgxtourprimitiveGxPlaylist.addgxtourprimitiveD  s     	$$_5r   c                 >    [        S0 UD6nU R                  U5        U$ )zCreates a new :class:`simplekml.GxAnimatedUpdate` and adds it to the playlist.

Accepts the same agruments as :class:`simplekml.GxAnimatedUpdate` and returns an instance
of :class:`simplekml.GxAnimatedUpdate`
r   )r   r   )r   kwargsgxanimatedupdates      r   newgxanimatedupdateGxPlaylist.newgxanimatedupdateI  s'     ,5f5 01r   c                 >    [        S0 UD6nU R                  U5        U$ )zCreates a new :class:`simplekml.GxFlyTo` and adds it to the playlist.

Accepts the same agruments as :class:`simplekml.GxFlyTo` and returns an instance
of :class:`simplekml.GxFlyTo`
r   )ra   r   )r   r   gxflytos      r   
newgxflytoGxPlaylist.newgxflytoS  s$     #F#(r   c                 >    [        S0 UD6nU R                  U5        U$ )zCreates a new :class:`simplekml.GxSoundCue` and adds it to the playlist.

Accepts the same agruments as :class:`simplekml.GxSoundCue` and returns an instance
of :class:`simplekml.GxSoundCue`
r   )r#   r   )r   r   
gxsoundcues      r   newgxsoundcueGxPlaylist.newgxsoundcue]  s%      )&)

+r   c                 >    [        S0 UD6nU R                  U5        U$ )zCreates a new :class:`simplekml.GxTourControl` and adds it to the playlist.

Accepts the same agruments as :class:`simplekml.GxTourControl` and returns an instance
of :class:`simplekml.GxTourControl`
r   )rB   r   )r   r   gxtourcontrols      r   newgxtourcontrolGxPlaylist.newgxtourcontrolg  s%     &//.r   c                 >    [        S0 UD6nU R                  U5        U$ )zCreates a new :class:`simplekml.GxWait` and adds it to the playlist.

Accepts the same agruments as :class:`simplekml.GxWait` and returns an instance
of :class:`simplekml.GxWait`
r   )rR   r   )r   r   gxwaits      r   	newgxwaitGxPlaylist.newgxwaitq  s$     !&!'r   c                     S/nU R                    H"  nUR                  UR                  5       5        M$     UR                  S5        SR                  U5      $ )Nz<gx:Playlist>z</gx:Playlist>r9   )r   r   r;   r<   )r   r>   r   s      r   r;   GxPlaylist.__str__{  sJ    #44OJJ..01  5

#$wws|r   )r   r   )r   r   r   r   r   r   r   r   r   r   r   r   r   r   r;   r   r    r!   s   @r   r   r   9  sK    6 ?D!6 "6  r   r   c                      ^  \ rS rSrSr   SU 4S jjr\S 5       r\R                  S 5       r\S 5       r	\	R                  S 5       r	SS jr
U 4S	 jrS
rU =r$ )GxTouri  a  Defines a tour.

The arguments are the same as the properties.

Usage::

    # Demonstrates touring with the reproduction of the tour sample in the KML Reference
    # https://developers.google.com/kml/documentation/kmlreference#gxtour with the addition of GxSoundCue

    import os
    import simplekml

    # Create an instance of kml
    kml = simplekml.Kml(name="Tours", open=1)

    # Create a new point and style it
    pnt = kml.newpoint(name="New Zealand's Southern Alps", coords=[(170.144,-43.605)])
    pnt.style.iconstyle.scale = 1.0

    # Create a tour and attach a playlist to it
    tour = kml.newgxtour(name="Play me!")
    playlist = tour.newgxplaylist()

    # Attach a gx:SoundCue to the playlist and delay playing by 2 second (sound clip is about 4 seconds long)
    soundcue = playlist.newgxsoundcue()
    soundcue.href = "http://simplekml.googlecode.com/hg/samples/resources/drum_roll_1.wav"
    soundcue.gxdelayedstart = 2

    # Attach a gx:AnimatedUpdate to the playlist
    animatedupdate = playlist.newgxanimatedupdate(gxduration=6.5)
    animatedupdate.update.change = '<IconStyle targetId="{0}"><scale>10.0</scale></IconStyle>'.format(pnt.style.iconstyle.id)

    # Attach a gx:FlyTo to the playlist
    flyto = playlist.newgxflyto(gxduration=4.1)
    flyto.camera.longitude = 170.157
    flyto.camera.latitude = -43.671
    flyto.camera.altitude = 9700
    flyto.camera.heading = -6.333
    flyto.camera.tilt = 33.5
    flyto.camera.roll = 0

    # Attach a gx:Wait to the playlist to give the gx:AnimatedUpdate time to finish
    wait = playlist.newgxwait(gxduration=2.4)

    # Save to file
    kml.save(os.path.splitext(__file__)[0] + ".kml")
c                    > [         [        U ]  5         XR                  S'   X R                  S'   / U l        Ub  U =R                  U-  sl        g g )Nnamedescription)r   r   r   r(   gxplaylists)r   r   r   r   r   s       r   r   GxTour.__init__  sN     	ot-/ 		&#.		- "+ #r   c                      U R                   S   $ )zString name of the tourr   r,   r   s    r   r   GxTour.name  r.   r   c                      XR                   S'   g )Nr   r,   )r   r   s     r   r   r     r0   r   c                      U R                   S   $ )zString description of the tour.r   r,   r   s    r   r   GxTour.description  rK   r   c                      XR                   S'   g )Nr   r,   )r   r   s     r   r   r     s    #.		- r   c                 R    [        U5      nU R                  R                  U5        U$ )z4Adds a :class:`simplekml.GxPlaylist` and returns it.)r   r   r   )r   r   
gxplaylists      r   newgxplaylistGxTour.newgxplaylist  s'     01

+r   c                    > S[         [        U ]  5       /nU R                   H"  nUR	                  UR                  5       5        M$     UR	                  S5        SR                  U5      $ )Nz	<gx:Tour>z
</gx:Tour>r9   )r   r   r;   r   r   r<   )r   r>   r   r   s      r   r;   GxTour.__str__  sY    VT*,.**JJJz))+, +

< wws|r   )r   r   r   )r   r   r   r   r   r   r   r   r@   r   r   r;   r   r    r!   s   @r   r   r     s    .` !!	, ! ! 
[[! ! ( ( / / r   r   N)r   simplekml.baser   r   simplekml.abstractviewr   r   r   r#   rB   rR   ra   r}   r   r   r   r   r   r   <module>r      s   $ * 1g  " "JO 4_ 2Lo L^5%W 5%p1 1hG GTY_ Yr   