protected void OneTrajectoryVisualisation()
        {
            // Create legend
            var legend = new LegendCreator();

            legend.OutputLegendImage();
            legend.OutputLegendTitle();

            var sections = new List <KMLAnimatorSectionInterface>();

            // Contour animator
            List <int> contoursOfInterest = (_view.VisualiseContoursOfInterest) ? _view.ContoursOfInterest : null;
            var        contourAnimator    = new ContourKMLAnimator(temporalGrid, trajectory, contoursOfInterest);

            if (_view.VisualiseGradient)
            {
                contourAnimator.SetGradientSettings((int)_view.LowestContourValue, (int)_view.HighestContourValue, (int)_view.ContourValueStep);
            }

            // Create sections
            sections.Add(new LegendKMLAnimator());
            sections.Add(new AircraftKMLAnimator(trajectory.Aircraft, trajectory));
            sections.Add(new AirplotKMLAnimator(trajectory));
            sections.Add(new GroundplotKMLAnimator(trajectory));
            sections.Add(contourAnimator);
            //new AnnoyanceKMLAnimator(temporalGrid, population.getPopulationData())
            if (_view.Heatmap)
            {
                var population = new PopulationData(Globals.currentDirectory + "population.dat");
                population.Chance = _view.PopulationFactor;
                var section = new HeatmapKMLAnimator(population);
                section.DotSize = _view.PopulationDotSize;
                section.DotFile = _view.PopulationDotFile;
                sections.Add(section);
            }

            // Create animator
            var camera   = new FollowKMLAnimatorCamera(trajectory.Aircraft, trajectory);
            var animator = new KMLAnimator(sections, camera);

            animator.AnimationToFile(trajectory.Duration, Globals.webrootDirectory + "visualisation.kml");

            _view.Invoke(delegate { _view.PreparationCalculationCompleted(); });
        }
        protected void MultipleTrajectoryVisualisation()
        {
            // Legend
            var legend = new LegendCreator();

            // plot legend
            legend.OutputLegendImage();
            legend.OutputLegendTitle();

            // Create sections
            var sections = new List <KMLAnimatorSectionInterface>();

            //sections.Add(new MaintainMultipleGroundPlotKMLAnimator(trajectories));
            if (!VisualiseOptimisation)
            {
                // Contour animator
                List <int> contoursOfInterest = (_view.VisualiseContoursOfInterest) ? _view.ContoursOfInterest : null;
                var        contourAnimator    = new ContourKMLAnimator(temporalGrid, null, contoursOfInterest);
                if (_view.VisualiseGradient)
                {
                    legend.SetSettings(_view.LowestContourValue, _view.HighestContourValue);
                    contourAnimator.SetGradientSettings((int)_view.LowestContourValue, (int)_view.HighestContourValue, (int)_view.ContourValueStep);
                }
                contourAnimator.AltitudeOffset = (_view.MapFile != "");
                sections.Add(new MultipleGroundplotKMLAnimator(trajectories));
                sections.Add(new LegendKMLAnimator());
                sections.Add(contourAnimator);
            }
            else
            {
                trajectories = TrajectoryFitness.trajectories;
                sections.Add(new FitnessGroundPlotKMLAnimator(trajectories));
            }
            if (_view.MapFile != "")
            {
                sections.Add(new CustomMapKMLAnimator(_view.MapFile, _view.MapBottomLeft, _view.MapUpperRight));
            }
            if (_view.Heatmap)
            {
                var population = new PopulationData(Globals.currentDirectory + "population.dat");
                population.Chance = _view.PopulationFactor;
                var section = new HeatmapKMLAnimator(population);
                section.DotSize = _view.PopulationDotSize;
                section.DotFile = _view.PopulationDotFile;
                sections.Add(section);
            }

            var camera = new TopViewKMLAnimatorCamera(
                new GeoPoint3D(4.9773743, 52.2384423,
                               _view.CameraAltitude)
                );
            // Create animator

            /*
             * var camera = new TopViewKMLAnimatorCamera(
             *  new GeoPoint3D(referencePoint.GeoPoint.Longitude, referencePoint.GeoPoint.Latitude,
             *  _view.CameraAltitude)
             * );
             */
            var animator = new KMLAnimator(sections, camera);

            animator.Duration = 0;
            animator.AnimationToFile(trajectories.Count, Globals.webrootDirectory + "visualisation.kml");

            _view.Invoke(delegate { _view.PreparationCalculationCompleted(); });
        }