Free cookie consent management tool by TermsFeed Policy Generator

source: branches/HeuristicLab.Problems.GrammaticalOptimization/DynamicDataDisplay/ViewportConstraints/ViewportConstraint.cs @ 13376

Last change on this file since 13376 was 12503, checked in by aballeit, 9 years ago

#2283 added GUI and charts; fixed MCTS

File size: 1.2 KB
Line 
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Text;
5using System.Windows;
6using Microsoft.Research.DynamicDataDisplay.Common;
7
8namespace Microsoft.Research.DynamicDataDisplay.ViewportConstraints
9{
10  /// <summary>
11  /// Represents a base class for all constraints that are being applied to viewport's visible rect.
12  /// </summary>
13  public abstract class ViewportConstraint
14  {
15    /// <summary>
16    /// Applies the constraint.
17    /// </summary>
18    /// <param name="previousDataRect">Previous data rectangle.</param>
19    /// <param name="proposedDataRect">Proposed data rectangle.</param>
20    /// <param name="viewport">The viewport, to which current restriction is being applied.</param>
21    /// <returns>New changed visible rectangle.</returns>
22    public abstract DataRect Apply(DataRect previousDataRect, DataRect proposedDataRect, Viewport2D viewport);
23
24    /// <summary>
25    /// Raises the changed event.
26    /// </summary>
27    protected void RaiseChanged()
28    {
29      Changed.Raise(this);
30    }
31    /// <summary>
32    /// Occurs when constraint changes.
33    /// Causes update of <see cref="Viewport"/>'s Visible property.
34    /// </summary>
35    public event EventHandler Changed;
36  }
37}
Note: See TracBrowser for help on using the repository browser.