Example #1
0
        /// <summary>
        /// Handler for clear_button click event. Clears the current aggregate data and simulation view.
        /// </summary>
        /// <param name="sender">Sender identification</param>
        /// <param name="e">Variable containing state information associated with event</param>
        private void ClearButtonHandler(object sender, RoutedEventArgs e)
        {
            // if an aggregate exists, clear it
            if (current_particles > 0)
            {
                // switch on dimension of lattice
                switch (lattice_dimension)
                {
                case LatticeDimension._2D:
                    // if generation process not finished, raise an abort signal
                    if (!hasFinished)
                    {
                        dla_2d.RaiseAbortSignal();
                    }
                    dla_2d.Clear();
                    break;

                case LatticeDimension._3D:
                    // if generation process not finished, raise an abort signal
                    if (!hasFinished)
                    {
                        dla_3d.RaiseAbortSignal();
                    }
                    dla_3d.Clear();
                    break;
                }
            }
            // clear aggregate from user interface
            aggregate_manager.ClearAggregate();
            current_particles            = 0;
            DynamicParticleLabel.Content = "Particles: " + current_particles;
            colour_list.Clear();
        }
Example #2
0
        /// <summary>
        /// Auxiliary method for clearing aggregate and all related properties/instances.
        /// </summary>
        private void ClearAggregate()
        {
            // switch on dimension of lattice previously generated
            switch (current_executing_dimension)
            {
            case LatticeDimension._2D:
                // if generation process not finished, raise abort signal
                if (!hasFinished)
                {
                    dla_2d.RaiseAbortSignal();
                }
                dla_2d.Clear();     // clear aggregate data structure
                break;

            case LatticeDimension._3D:
                // if generation process not finished, raise abort signal
                if (!hasFinished)
                {
                    dla_3d.RaiseAbortSignal();
                }
                dla_3d.Clear();     // clear aggregate data structure
                break;
            }
            aggregate_manager.ClearAggregate(); // clear aggregate from user interface
            colour_list.Clear();
            current_particles        = 0;
            compare_button.IsEnabled = false; // grey out compare_button
            if (!saveCurrentChartSeries)      // clear the NumberRadiusChart
            {
                nrchart.ResetAxisProperties();
                nrchart.ClearAllSeriesDataPoints();
                saveCurrentChartSeries = true;
            }
            // reset labels to initial values
            DynamicParticleLabel.Content = "Particles: " + current_particles;
            FracDimLabel.Content         = "Est. Fractal Dimension: 0.00";
            AggMissesLabel.Content       = "Aggregate Misses: 0";
            SimulationTimerLabel.Content = "Elapsed Time: 00:00.000";
            isCleared = true;
            RenderAttractorGeometry(); // re-render initial attractor geometry
            // WORK IN PROGRESS, USED FOR MULTI-COLOUR AGGREGATE VERSION
            // WorldModels.Children.Clear();
            // WorldModels.Children.Add(new AmbientLight(Colors.White));
            // comp_manager.Clear();
        }