/// <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(); }
/// <summary> /// Handler for ShowAttractor_Checkbox click event. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void OnShowAttractorCheckboxClicked(object sender, RoutedEventArgs e) { if (!showAttractor) { showAttractor = true; RenderAttractorGeometry(); } else { showAttractor = false; if (hasFinished && isCleared) { aggregate_manager.ClearAggregate(); } } }