/// <summary> /// Handler for reset_view_button click event. Resets the viewport to initial state. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void ResetViewButtonHandler(object sender, RoutedEventArgs e) { // reset rotational view trackview.ResetView(); // reset orthographic_camera properties switch (lattice_dimension) { case LatticeDimension._2D: orthograghic_camera.Position = new Point3D(0, 0, 32); orthograghic_camera.LookDirection = new Vector3D(0, 0, -32); orthograghic_camera.Width = 256.0; break; case LatticeDimension._3D: orthograghic_camera.Position = new Point3D(16, 16, 16); orthograghic_camera.LookDirection = new Vector3D(-8, -8, -8); orthograghic_camera.Width = 128.0; break; } }
/// <summary> /// Auxiliary method for resetting aggregate view properties. /// </summary> private void ResetView() { // reset rotational, translational and scalar view trackview.ResetView(); // set orthographic_camera properties according to dimension of lattice switch (current_executing_dimension) { case LatticeDimension._2D: orthograghic_camera.Position = new Point3D(0, 0, 32); orthograghic_camera.LookDirection = new Vector3D(0, 0, -32); orthograghic_camera.Width = 256.0; break; case LatticeDimension._3D: orthograghic_camera.Position = new Point3D(16, 16, 16); orthograghic_camera.LookDirection = new Vector3D(-8, -8, -8); orthograghic_camera.Width = 128.0; break; } }