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#

Display can hide the preview's handles and labels; a selected object shows its own

Alexander Graef3db1fd0c6029
diff --git a/CLAUDE.md b/CLAUDE.md
index 4ecc316..f7d294d 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -193,7 +193,10 @@ FrameStore: native memory up to the budget, the rest in a temp file (%LOCALAPPDA
the layer it measures (2026-10-18), sources on both; graph boxes lie over every handle and dot, the selected
item is drawn last among its kind, except the handles themselves (Panel.ZIndex breaks the Tab cycle, 2026-10-18);
arrows nudge, Del on a handle or a graph box removes its item or the selection it belongs to as the tree's Del does
- (2026-10-26), selection syncs with the tree, a click on empty space deselects. **Group selection** (2026-10-19): one shared `SelectedItems` list on the window beside the
+ (2026-10-26), selection syncs with the tree, a click on empty space deselects. **Display > Handles in the preview and
+ Labels in the preview** (2026-10-29, the user's request, both on by default) hide every item's handles, lines, emitter
+ dots and levers, or the names beside the handles, except a selected item's, which shows them either way (the tree is
+ where hidden items are picked; collapsed handles are out of the Tab cycle); the graph boxes are not affected. **Group selection** (2026-10-19): one shared `SelectedItems` list on the window beside the
current `SelectedItem` (the properties pane shows the current one); in the tree Ctrl+click, Insert or Ctrl+Space
toggles a row, Shift+click or Shift+arrows selects the range from the anchor, Ctrl+A everything, the row's context
menu has both; on the pictures a drag on empty space is a marquee (Shift adds, Ctrl toggles), Ctrl+click on a handle
diff --git a/WaveDudeNext.WPF/Controls/SceneOverlay.cs b/WaveDudeNext.WPF/Controls/SceneOverlay.cs
index 48137b8..c5c0da1 100644
--- a/WaveDudeNext.WPF/Controls/SceneOverlay.cs
+++ b/WaveDudeNext.WPF/Controls/SceneOverlay.cs
@@ -117,6 +117,14 @@ public sealed class SceneOverlay : Panel
public static readonly DependencyProperty AccentBrushProperty = DependencyProperty.Register(
nameof(AccentBrush), typeof(Brush), typeof(SceneOverlay), new FrameworkPropertyMetadata(Brushes.DodgerBlue, FrameworkPropertyMetadataOptions.AffectsRender));
+ /// <summary>Identifies the <see cref="HandlesInPreview"/> property.</summary>
+ public static readonly DependencyProperty HandlesInPreviewProperty = DependencyProperty.Register(
+ nameof(HandlesInPreview), typeof(bool), typeof(SceneOverlay), new PropertyMetadata(true, (d, _) => ((SceneOverlay)d).UpdateSelection()));
+
+ /// <summary>Identifies the <see cref="LabelsInPreview"/> property.</summary>
+ public static readonly DependencyProperty LabelsInPreviewProperty = DependencyProperty.Register(
+ nameof(LabelsInPreview), typeof(bool), typeof(SceneOverlay), new PropertyMetadata(true, (d, _) => ((SceneOverlay)d).UpdateSelection()));
+
/// <summary>Pixels a focused handle moves per arrow key, and with Shift.</summary>
private const int KeyStep = 1;
private const int KeyStepFast = 10;
@@ -213,6 +221,24 @@ public sealed class SceneOverlay : Panel
private void OnSelectionChanged(object? sender, NotifyCollectionChangedEventArgs e) => UpdateSelection();
+ /// <summary>
+ /// Whether the handles, lines, emitter dots and levers are shown for every item (<see cref="Display.HandlesInPreview"/>);
+ /// off, a selected item still shows its own (2026-10-29, the user's design), and the others are collapsed, out of the Tab
+ /// cycle too, so the tree is where they are picked.
+ /// </summary>
+ public bool HandlesInPreview
+ {
+ get => (bool)GetValue(HandlesInPreviewProperty);
+ set => SetValue(HandlesInPreviewProperty, value);
+ }
+
+ /// <summary>Whether the names beside the handles are drawn for every item (<see cref="Display.LabelsInPreview"/>); off, a selected item still shows its own.</summary>
+ public bool LabelsInPreview
+ {
+ get => (bool)GetValue(LabelsInPreviewProperty);
+ set => SetValue(LabelsInPreviewProperty, value);
+ }
+
/// <summary>Whether <paramref name="item"/> is the current item or one of the selected ones.</summary>
private bool IsSelected(object item) => ReferenceEquals(item, SelectedItem) || (SelectedItems?.Contains(item) ?? false);
@@ -507,11 +533,11 @@ public sealed class SceneOverlay : Panel
foreach (MarkerThumb thumb in Children)
{
thumb.IsSelectedMarker = IsSelected(thumb.Item);
- if (IsDetail(thumb.Role))
- {
- // the rotation handle, grip, point, node and Bézier handles only while their source or part is the current item (the user's rule, 2026-10-14); collapsed, they are out of the Tab cycle too
- thumb.Visibility = ReferenceEquals(thumb.Item, selected) ? Visibility.Visible : Visibility.Collapsed;
- }
+ // handles hidden by Display (2026-10-29, the user's design) except a selected item's, which shows them either way; the
+ // rotation handle, grip, point, node and Bézier handles only while their source or part is the current item (the
+ // user's rule, 2026-10-14); collapsed, they are out of the Tab cycle too
+ bool shown = HandlesInPreview || thumb.IsSelectedMarker;
+ thumb.Visibility = shown && (!IsDetail(thumb.Role) || ReferenceEquals(thumb.Item, selected)) ? Visibility.Visible : Visibility.Collapsed;
}
InvalidateVisual();
}
@@ -884,11 +910,11 @@ public sealed class SceneOverlay : Panel
dc.PushClip(new RectangleGeometry(PictureRect(RenderSize)));
foreach (Probe probe in SelectedLast(project.Probes, selected))
{
- if (probe.Kind != ProbeKind.Line || !Shows(probe))
+ bool isSelected = IsSelected(probe);
+ if (probe.Kind != ProbeKind.Line || !Shows(probe) || (!HandlesInPreview && !isSelected))
{
continue;
}
- bool isSelected = IsSelected(probe);
Point a = ToView(probe.AX, probe.AY);
Point b = ToView(probe.BX, probe.BY);
// a dark line under the dashed light one, so the line reads on any picture
@@ -897,11 +923,11 @@ public sealed class SceneOverlay : Panel
}
foreach (Source source in SelectedLast(project.Sources, selected))
{
- if (source.Array == null)
+ bool isSelected = IsSelected(source);
+ if (source.Array == null || (!HandlesInPreview && !isSelected))
{
continue;
}
- bool isSelected = IsSelected(source);
Brush dots = isSelected ? AccentBrush : LineBrush;
var halo = new Pen(HaloBrush, 1.5);
if (ReferenceEquals(source, selected))
@@ -986,7 +1012,8 @@ public sealed class SceneOverlay : Panel
dc.Pop();
foreach (MarkerThumb thumb in Children.OfType<MarkerThumb>().OrderBy(thumb => thumb.IsSelectedMarker))
{
- if (thumb.Role is MarkerRole.ProbeB || IsDetail(thumb.Role))
+ // the name beside the main handle; hidden by Display except a selected item's (2026-10-29, the user's design)
+ if (thumb.Role is MarkerRole.ProbeB || IsDetail(thumb.Role) || (!LabelsInPreview && !thumb.IsSelectedMarker))
{
continue;
}
diff --git a/WaveDudeNext.WPF/Panes/PreviewPane.xaml b/WaveDudeNext.WPF/Panes/PreviewPane.xaml
index 76fc881..dcf4bd4 100644
--- a/WaveDudeNext.WPF/Panes/PreviewPane.xaml
+++ b/WaveDudeNext.WPF/Panes/PreviewPane.xaml
@@ -612,7 +612,9 @@ version. It is distributed WITHOUT ANY WARRANTY. See the LICENSE.md file or
CanvasHeight="{Binding CanvasHeight, RelativeSource={RelativeSource AncestorType={x:Type local:PreviewPane}}}"
Layer="{Binding Path=(local:PreviewPane.Layer), RelativeSource={RelativeSource TemplatedParent}}"
SelectedItem="{Binding SelectedItem, RelativeSource={RelativeSource AncestorType={x:Type local:PreviewPane}}, Mode=TwoWay}"
- SelectedItems="{Binding SelectedItems, RelativeSource={RelativeSource AncestorType={x:Type local:PreviewPane}}}" />
+ SelectedItems="{Binding SelectedItems, RelativeSource={RelativeSource AncestorType={x:Type local:PreviewPane}}}"
+ HandlesInPreview="{Binding Project.Display.HandlesInPreview, RelativeSource={RelativeSource AncestorType={x:Type local:PreviewPane}}}"
+ LabelsInPreview="{Binding Project.Display.LabelsInPreview, RelativeSource={RelativeSource AncestorType={x:Type local:PreviewPane}}}" />
<!-- the probes' graph boxes, over the handles: no handle or emitter dot is ever drawn on a graph (the user's
rule, 2026-10-18; until then the boxes lay under the handles, to keep a handle over a box grabbable, and
a handle under a box is reached by Tab or the tree instead); which probes depends on the cell's layer
diff --git a/WaveDudeNext.WPF/Strings/Strings.DE.xaml b/WaveDudeNext.WPF/Strings/Strings.DE.xaml
index bb2e589..9a1d48e 100644
--- a/WaveDudeNext.WPF/Strings/Strings.DE.xaml
+++ b/WaveDudeNext.WPF/Strings/Strings.DE.xaml
@@ -275,6 +275,7 @@ version. It is distributed WITHOUT ANY WARRANTY. See the LICENSE.md file or
<s:String x:Key="SectionField">Feld</s:String>
<s:String x:Key="SectionIntensity">Intensität</s:String>
<s:String x:Key="SectionVideo">Videoexport</s:String>
+ <s:String x:Key="SectionPreview">Vorschau</s:String>
<s:String x:Key="SectionExportRange">Export</s:String>
<s:String x:Key="SectionPosition">Position</s:String>
<s:String x:Key="SectionWave">Welle</s:String>
@@ -378,6 +379,10 @@ version. It is distributed WITHOUT ANY WARRANTY. See the LICENSE.md file or
<s:String x:Key="Hint.Display.ProbeGraphsInExport">Die Graphkästen der Sonden in exportierte Bilder und Videos zeichnen.</s:String>
<s:String x:Key="Label.Display.ProbeMarkersInExport">Sondenmarkierungen im Export</s:String>
<s:String x:Key="Hint.Display.ProbeMarkersInExport">Die Positionen der Sonden (Kreuze, die Linie einer Liniensonde, die Nummer) in exportierte Bilder und Videos zeichnen.</s:String>
+ <s:String x:Key="Label.Display.HandlesInPreview">Griffe in der Vorschau</s:String>
+ <s:String x:Key="Hint.Display.HandlesInPreview">Die Griffe, Linien, Emitterpunkte und Hebel aller Quellen, Bauteile und Sonden über den Vorschaubildern zeigen. Ein ausgewähltes Objekt zeigt seine in jedem Fall.</s:String>
+ <s:String x:Key="Label.Display.LabelsInPreview">Beschriftungen in der Vorschau</s:String>
+ <s:String x:Key="Hint.Display.LabelsInPreview">Die Namen neben den Griffen über den Vorschaubildern zeigen. Ein ausgewähltes Objekt zeigt seinen in jedem Fall.</s:String>
<s:String x:Key="Label.Display.SourceMarkersInExport">Quellenmarkierungen im Export</s:String>
<s:String x:Key="Hint.Display.SourceMarkersInExport">Die aktiven Quellen (die Markierung, die Emitterpunkte einer zusammengesetzten Quelle, den Namen) in exportierte Bilder und Videos zeichnen.</s:String>
<s:String x:Key="Label.DisplayLayer.ColorScheme">Farbschema</s:String>
diff --git a/WaveDudeNext.WPF/Strings/Strings.EN.xaml b/WaveDudeNext.WPF/Strings/Strings.EN.xaml
index d400a08..1e224ef 100644
--- a/WaveDudeNext.WPF/Strings/Strings.EN.xaml
+++ b/WaveDudeNext.WPF/Strings/Strings.EN.xaml
@@ -277,6 +277,7 @@ version. It is distributed WITHOUT ANY WARRANTY. See the LICENSE.md file or
<s:String x:Key="SectionField">Field</s:String>
<s:String x:Key="SectionIntensity">Intensity</s:String>
<s:String x:Key="SectionVideo">Video export</s:String>
+ <s:String x:Key="SectionPreview">Preview</s:String>
<s:String x:Key="SectionExportRange">Export</s:String>
<s:String x:Key="SectionPosition">Position</s:String>
<s:String x:Key="SectionWave">Wave</s:String>
@@ -380,6 +381,10 @@ version. It is distributed WITHOUT ANY WARRANTY. See the LICENSE.md file or
<s:String x:Key="Hint.Display.ProbeGraphsInExport">Draw the probes' graph boxes over exported frames and videos.</s:String>
<s:String x:Key="Label.Display.ProbeMarkersInExport">Probe markers in the export</s:String>
<s:String x:Key="Hint.Display.ProbeMarkersInExport">Draw the probes' positions (crosses, the line of a line probe, the number) over exported frames and videos.</s:String>
+ <s:String x:Key="Label.Display.HandlesInPreview">Handles in the preview</s:String>
+ <s:String x:Key="Hint.Display.HandlesInPreview">Show the handles, lines, emitter dots and levers of every source, part and probe over the preview pictures. A selected object shows its own either way.</s:String>
+ <s:String x:Key="Label.Display.LabelsInPreview">Labels in the preview</s:String>
+ <s:String x:Key="Hint.Display.LabelsInPreview">Show the names beside the handles over the preview pictures. A selected object shows its own either way.</s:String>
<s:String x:Key="Label.Display.SourceMarkersInExport">Source markers in the export</s:String>
<s:String x:Key="Hint.Display.SourceMarkersInExport">Draw the enabled sources (the marker, a composite source's emitter dots, the name) over exported frames and videos.</s:String>
<s:String x:Key="Label.DisplayLayer.ColorScheme">Colour scheme</s:String>
diff --git a/WaveDudeNext.WPF/Strings/Strings.FR.xaml b/WaveDudeNext.WPF/Strings/Strings.FR.xaml
index 9721f4a..2a801e9 100644
--- a/WaveDudeNext.WPF/Strings/Strings.FR.xaml
+++ b/WaveDudeNext.WPF/Strings/Strings.FR.xaml
@@ -275,6 +275,7 @@ version. It is distributed WITHOUT ANY WARRANTY. See the LICENSE.md file or
<s:String x:Key="SectionField">Champ</s:String>
<s:String x:Key="SectionIntensity">Intensité</s:String>
<s:String x:Key="SectionVideo">Export vidéo</s:String>
+ <s:String x:Key="SectionPreview">Aperçu</s:String>
<s:String x:Key="SectionExportRange">Export</s:String>
<s:String x:Key="SectionPosition">Position</s:String>
<s:String x:Key="SectionWave">Onde</s:String>
@@ -378,6 +379,10 @@ version. It is distributed WITHOUT ANY WARRANTY. See the LICENSE.md file or
<s:String x:Key="Hint.Display.ProbeGraphsInExport">Dessiner les cadres de graphe des sondes sur les images et vidéos exportées.</s:String>
<s:String x:Key="Label.Display.ProbeMarkersInExport">Marqueurs des sondes dans l'export</s:String>
<s:String x:Key="Hint.Display.ProbeMarkersInExport">Dessiner les positions des sondes (croix, la ligne d'une sonde linéaire, le numéro) sur les images et vidéos exportées.</s:String>
+ <s:String x:Key="Label.Display.HandlesInPreview">Poignées dans l'aperçu</s:String>
+ <s:String x:Key="Hint.Display.HandlesInPreview">Afficher les poignées, les lignes, les points émetteurs et les leviers de toutes les sources, pièces et sondes sur les images de l'aperçu. Un objet sélectionné montre les siens dans tous les cas.</s:String>
+ <s:String x:Key="Label.Display.LabelsInPreview">Étiquettes dans l'aperçu</s:String>
+ <s:String x:Key="Hint.Display.LabelsInPreview">Afficher les noms à côté des poignées sur les images de l'aperçu. Un objet sélectionné montre le sien dans tous les cas.</s:String>
<s:String x:Key="Label.Display.SourceMarkersInExport">Marqueurs des sources dans l'export</s:String>
<s:String x:Key="Hint.Display.SourceMarkersInExport">Dessiner les sources actives (le marqueur, les points émetteurs d'une source composée, le nom) sur les images et vidéos exportées.</s:String>
<s:String x:Key="Label.DisplayLayer.ColorScheme">Palette de couleurs</s:String>
diff --git a/WaveDudeNext.WPF/Strings/Strings.NL.xaml b/WaveDudeNext.WPF/Strings/Strings.NL.xaml
index bcd74a7..7436605 100644
--- a/WaveDudeNext.WPF/Strings/Strings.NL.xaml
+++ b/WaveDudeNext.WPF/Strings/Strings.NL.xaml
@@ -275,6 +275,7 @@ version. It is distributed WITHOUT ANY WARRANTY. See the LICENSE.md file or
<s:String x:Key="SectionField">Veld</s:String>
<s:String x:Key="SectionIntensity">Intensiteit</s:String>
<s:String x:Key="SectionVideo">Video-export</s:String>
+ <s:String x:Key="SectionPreview">Voorbeeld</s:String>
<s:String x:Key="SectionExportRange">Export</s:String>
<s:String x:Key="SectionPosition">Positie</s:String>
<s:String x:Key="SectionWave">Golf</s:String>
@@ -378,6 +379,10 @@ version. It is distributed WITHOUT ANY WARRANTY. See the LICENSE.md file or
<s:String x:Key="Hint.Display.ProbeGraphsInExport">De grafiekvakken van de sondes over geëxporteerde beelden en video's tekenen.</s:String>
<s:String x:Key="Label.Display.ProbeMarkersInExport">Sondemarkeringen in de export</s:String>
<s:String x:Key="Hint.Display.ProbeMarkersInExport">De posities van de sondes (kruisen, de lijn van een lijnsonde, het nummer) over geëxporteerde beelden en video's tekenen.</s:String>
+ <s:String x:Key="Label.Display.HandlesInPreview">Grepen in het voorbeeld</s:String>
+ <s:String x:Key="Hint.Display.HandlesInPreview">De grepen, lijnen, emitterpunten en hefbomen van alle bronnen, onderdelen en sondes over de voorbeeldbeelden tonen. Een geselecteerd object toont de zijne hoe dan ook.</s:String>
+ <s:String x:Key="Label.Display.LabelsInPreview">Labels in het voorbeeld</s:String>
+ <s:String x:Key="Hint.Display.LabelsInPreview">De namen naast de grepen over de voorbeeldbeelden tonen. Een geselecteerd object toont de zijne hoe dan ook.</s:String>
<s:String x:Key="Label.Display.SourceMarkersInExport">Bronmarkeringen in de export</s:String>
<s:String x:Key="Hint.Display.SourceMarkersInExport">De ingeschakelde bronnen (de markering, de emitterpunten van een samengestelde bron, de naam) over geëxporteerde beelden en video's tekenen.</s:String>
<s:String x:Key="Label.DisplayLayer.ColorScheme">Kleurenschema</s:String>
diff --git a/WaveDudeNext.WPF/Views/DisplayView.xaml b/WaveDudeNext.WPF/Views/DisplayView.xaml
index 5db54ef..33cfb64 100644
--- a/WaveDudeNext.WPF/Views/DisplayView.xaml
+++ b/WaveDudeNext.WPF/Views/DisplayView.xaml
@@ -33,6 +33,15 @@ version. It is distributed WITHOUT ANY WARRANTY. See the LICENSE.md file or
<Label Style="{StaticResource FormSection}" Content="{DynamicResource SectionIntensity}" />
<local:DisplayLayerView DataContext="{Binding Intensity}" Kind="Intensity" />
+ <!-- what the preview pictures draw over the frames (2026-10-29, the user's request): a selected object shows its own either way -->
+ <Label Style="{StaticResource FormSection}" Content="{DynamicResource SectionPreview}" />
+ <controls:FormPanel>
+ <CheckBox controls:FormPanel.FullWidth="True" Content="{meta:Label model:Display.HandlesInPreview}"
+ IsChecked="{Binding HandlesInPreview}" ToolTip="{meta:Hint model:Display.HandlesInPreview}" AutomationProperties.AutomationId="DisplayHandlesInPreview" />
+ <CheckBox controls:FormPanel.FullWidth="True" Content="{meta:Label model:Display.LabelsInPreview}"
+ IsChecked="{Binding LabelsInPreview}" ToolTip="{meta:Hint model:Display.LabelsInPreview}" AutomationProperties.AutomationId="DisplayLabelsInPreview" />
+ </controls:FormPanel>
+
<Label Style="{StaticResource FormSection}" Content="{DynamicResource SectionExportRange}" />
<controls:FormPanel>
<TextBlock Style="{StaticResource FormLabel}" Text="{meta:Label model:Display.ExportFrom}" />
diff --git a/WaveDudeNext/Model/Display.cs b/WaveDudeNext/Model/Display.cs
index f14c305..a5ab29e 100644
--- a/WaveDudeNext/Model/Display.cs
+++ b/WaveDudeNext/Model/Display.cs
@@ -40,6 +40,8 @@ public sealed class Display : ObservableObject
private bool _probeGraphsInExport = true;
private bool _probeMarkersInExport = true;
private bool _sourceMarkersInExport;
+ private bool _handlesInPreview = true;
+ private bool _labelsInPreview = true;
/// <summary>Rendering of the wave field.</summary>
[XmlElement]
@@ -146,6 +148,34 @@ public sealed class Display : ObservableObject
set => SetProperty(ref _sourceMarkersInExport, value);
}
+ /// <summary>
+ /// Whether the preview pictures show the handles of every source, part and probe, with their lines, emitter dots and
+ /// levers (2026-10-29, the user's request; on by default). Off, a selected object still shows its own, so the tree is
+ /// where objects are picked; the probes' graph boxes are not affected.
+ /// </summary>
+ [XmlAttribute]
+ [DefaultValue(true)]
+ [Category("Preview")]
+ [DisplayName("Handles in the preview")]
+ [Description("Show the handles, lines, emitter dots and levers of every source, part and probe over the preview pictures. A selected object shows its own either way.")]
+ public bool HandlesInPreview
+ {
+ get => _handlesInPreview;
+ set => SetProperty(ref _handlesInPreview, value);
+ }
+
+ /// <summary>Whether the preview pictures show the names beside the handles (2026-10-29, the user's request; on by default). Off, a selected object still shows its own.</summary>
+ [XmlAttribute]
+ [DefaultValue(true)]
+ [Category("Preview")]
+ [DisplayName("Labels in the preview")]
+ [Description("Show the names beside the handles over the preview pictures. A selected object shows its own either way.")]
+ public bool LabelsInPreview
+ {
+ get => _labelsInPreview;
+ set => SetProperty(ref _labelsInPreview, value);
+ }
+
/// <summary>Tells <see cref="XmlSerializer"/> to leave all-default video settings out of the file.</summary>
public bool ShouldSerializeVideo() => Video.Fps != Video.DefaultFps || Video.Quality != Video.DefaultQuality;