Skip to content

Interactive 2D wave optics simulator. Turn any image into a refractive scene, add sources, watch waves refract, diffract and interfere. Probes, intensity maps, video export.

C#
2.0 KB
Raw Blame
// SPDX-License-Identifier: GPL-3.0-or-later
// Copyright (C) 2026 Alexander Graef <[email protected]>
//
// This file is part of WaveDude Next, a 2D wave simulator.
//
// Based on the work of
//   Jeroen Vleggaar (Huygens Optics), author of Wave Dude 2D, Copyright (C) 2026
//     <https://www.youtube.com/@HuygensOptics>, <https://www.huygensoptics.com>
//   0x23 (Diffraction Limited), author of WaveSimulator2D
//     <https://www.youtube.com/@DiffractionLimited>, <https://github.com/0x23/WaveSimulator2D>
//
// WaveDude Next is free software: you can redistribute it and/or modify it under
// the terms of the GNU General Public License as published by the Free Software
// Foundation, either version 3 of the License, or (at your option) any later
// version. It is distributed WITHOUT ANY WARRANTY. See the LICENSE.md file or
// <https://www.gnu.org/licenses/>.

using System.Windows.Input;

namespace WaveDudeNext.WPF.Commands;

/// <summary>Commands of the part editors, bound on the views themselves: the point list of an outline (<c>Views/PartPointsView</c>), the node list of a fibre's path (<c>Views/FiberPathView</c>, 2026-10-22) and the lens's Mirror box (<c>Views/LensPartView</c>, 2026-10-29).</summary>
public static class PartCommands
{
	/// <summary>Appends a point after the last one.</summary>
	public static readonly RoutedUICommand AddPoint = new("Add point", nameof(AddPoint), typeof(PartCommands));

	/// <summary>Removes the point given as parameter.</summary>
	public static readonly RoutedUICommand RemovePoint = new("Remove point", nameof(RemovePoint), typeof(PartCommands));

	/// <summary>
	/// The lens's Mirror box was ticked or unticked by the user (the box's own command, run after its binding has set the
	/// flag): the part's name follows, Lens becoming Mirror and back (<see cref="Model.LensPart.MirrorName"/>, 2026-10-29,
	/// the user's design). The parameter is the <see cref="Model.LensPart"/>.
	/// </summary>
	public static readonly RoutedUICommand MirrorToggled = new("Mirror toggled", nameof(MirrorToggled), typeof(PartCommands));
}