Free cookie consent management tool by TermsFeed Policy Generator

source: branches/HeuristicLab.Problems.GrammaticalOptimization/DynamicDataDisplay/PointMarkers/CompositePointMarker.cs @ 13847

Last change on this file since 13847 was 12503, checked in by aballeit, 10 years ago

#2283 added GUI and charts; fixed MCTS

File size: 1.5 KB
Line 
1using System;
2using System.Collections.Generic;
3using System.Collections.ObjectModel;
4using System.ComponentModel;
5using System.Windows;
6using System.Windows.Media;
7
8namespace Microsoft.Research.DynamicDataDisplay.PointMarkers
9{
10    /// <summary>Composite point markers renders a specified set of markers
11    /// at every point of graph</summary>
12  public sealed class CompositePointMarker : PointMarker {
13    public CompositePointMarker() { }
14
15    public CompositePointMarker(params PointMarker[] markers) {
16      if (markers == null)
17        throw new ArgumentNullException("markers");
18
19            foreach (PointMarker m in markers)
20                this.markers.Add(m);
21    }
22
23    public CompositePointMarker(IEnumerable<PointMarker> markers) {
24      if (markers == null)
25        throw new ArgumentNullException("markers");
26            foreach (PointMarker m in markers)
27                this.markers.Add(m);
28    }
29
30
31    private readonly Collection<PointMarker> markers = new Collection<PointMarker>();
32    [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
33    public Collection<PointMarker> Markers {
34      get { return markers; }
35    }
36
37    public override void Render(DrawingContext dc, Point screenPoint) {
38      LocalValueEnumerator enumerator = GetLocalValueEnumerator();
39      foreach (var marker in markers) {
40        enumerator.Reset();
41        while (enumerator.MoveNext()) {
42          marker.SetValue(enumerator.Current.Property, enumerator.Current.Value);
43        }
44
45        marker.Render(dc, screenPoint);
46      }
47    }
48  }
49}
Note: See TracBrowser for help on using the repository browser.