src/AircraftTrajectories/Models/Visualisation/KML/KMLAnimator.cs
/// <summary>
/// Creates the actual KML file by starting an animation playlist
/// </summary>
/// <param name="duration"></param>
/// <returns></returns>
Creates the actual KML file by starting an animation playlist
Creates the actual KML file by starting an animation playlist
protected string CreateAnimationKML(int duration)
        {
            StringBuilder builder = new StringBuilder();
            builder.AppendLine("<kml xmlns=\"http://www.opengis.net/kml/2.2\" xmlns:atom=\"http://www.w3.org/2005/Atom\" xmlns:gx=\"http://www.google.com/kml/ext/2.2\" xmlns:kml=\"http://www.opengis.net/kml/2.2\">");
            builder.AppendLine("<Document>");
            builder.Append(_camera.KMLSetup());
            foreach (KMLAnimatorSectionInterface kmlAnimator in _animators)
            {
                builder.Append(kmlAnimator.KMLSetup());
            }
            builder.AppendLine("<gx:Tour><name>Flight animation</name><gx:Playlist>");
            for (int t = 0; t < duration; t++)
            {
                builder.Append(_camera.KMLAnimationStep(t));
                builder.Append(@"
<gx:AnimatedUpdate>
    <gx:duration>" + Duration + @"</gx:duration>
    <Update>
        <Change>");
                foreach (KMLAnimatorSectionInterface kmlAnimator in _animators)
                {
                    builder.Append(kmlAnimator.KMLAnimationStep(t));
                }
                builder.Append(@"
        </Change>
    </Update>
</gx:AnimatedUpdate>");
            }
            builder.AppendLine("</gx:Playlist></gx:Tour>");
            foreach (KMLAnimatorSectionInterface kmlAnimator in _animators)
            {
                builder.Append(kmlAnimator.KMLFinish());
            }
            builder.AppendLine("</Document>");
            builder.AppendLine("</kml>");
            return builder.ToString();
        }
protected string CreateAnimationKML ( int duration ) { StringBuilder builder = new StringBuilder ( ) ; builder . AppendLine ( " \" \" \" \" \" \" \" \" " ) ; builder . AppendLine ( " " ) ; builder . Append ( _camera . KMLSetup ( ) ) ; foreach ( KMLAnimatorSectionInterface kmlAnimator in _animators ) { builder . Append ( kmlAnimator . KMLSetup ( ) ) ; } builder . AppendLine ( " " ) ; for ( int t = 0 ; t < duration ; t ++ ) { builder . Append ( _camera . KMLAnimationStep ( t ) ) ; builder . Append ( @"
<gx:AnimatedUpdate>
    <gx:duration>" + Duration + @"</gx:duration>
    <Update>
        <Change>" ) ; foreach ( KMLAnimatorSectionInterface kmlAnimator in _animators ) { builder . Append ( kmlAnimator . KMLAnimationStep ( t ) ) ; } builder . Append ( @"
        </Change>
    </Update>
</gx:AnimatedUpdate>" ) ; } builder . AppendLine ( " " ) ; foreach ( KMLAnimatorSectionInterface kmlAnimator in _animators ) { builder . Append ( kmlAnimator . KMLFinish ( ) ) ; } builder . AppendLine ( " " ) ; builder . AppendLine ( " " ) ; return builder . ToString ( ) ; }
Creates the actual KML file by starting an animation playlist
Creates the actual KML file by starting an animation playlist
// Add each kml section definition of this animation // Add all kml updates of each animation section // Add the post animation definitions
None
duration
int
None