1 | ///
|
---|
2 | /// This file is part of ILNumerics Community Edition.
|
---|
3 | ///
|
---|
4 | /// ILNumerics Community Edition - high performance computing for applications.
|
---|
5 | /// Copyright (C) 2006 - 2012 Haymo Kutschbach, http://ilnumerics.net
|
---|
6 | ///
|
---|
7 | /// ILNumerics Community Edition is free software: you can redistribute it and/or modify
|
---|
8 | /// it under the terms of the GNU General Public License version 3 as published by
|
---|
9 | /// the Free Software Foundation.
|
---|
10 | ///
|
---|
11 | /// ILNumerics Community Edition is distributed in the hope that it will be useful,
|
---|
12 | /// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
13 | /// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
14 | /// GNU General Public License for more details.
|
---|
15 | ///
|
---|
16 | /// You should have received a copy of the GNU General Public License
|
---|
17 | /// along with ILNumerics Community Edition. See the file License.txt in the root
|
---|
18 | /// of your distribution package. If not, see <http://www.gnu.org/licenses/>.
|
---|
19 | ///
|
---|
20 | /// In addition this software uses the following components and/or licenses:
|
---|
21 | ///
|
---|
22 | /// =================================================================================
|
---|
23 | /// The Open Toolkit Library License
|
---|
24 | ///
|
---|
25 | /// Copyright (c) 2006 - 2009 the Open Toolkit library.
|
---|
26 | ///
|
---|
27 | /// Permission is hereby granted, free of charge, to any person obtaining a copy
|
---|
28 | /// of this software and associated documentation files (the "Software"), to deal
|
---|
29 | /// in the Software without restriction, including without limitation the rights to
|
---|
30 | /// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
---|
31 | /// the Software, and to permit persons to whom the Software is furnished to do
|
---|
32 | /// so, subject to the following conditions:
|
---|
33 | ///
|
---|
34 | /// The above copyright notice and this permission notice shall be included in all
|
---|
35 | /// copies or substantial portions of the Software.
|
---|
36 | ///
|
---|
37 | /// =================================================================================
|
---|
38 | ///
|
---|
39 |
|
---|
40 | #pragma warning disable 1591
|
---|
41 |
|
---|
42 | using System;
|
---|
43 | using System.Collections.Generic;
|
---|
44 | using System.Text;
|
---|
45 | using System.Drawing;
|
---|
46 | using ILNumerics.Drawing.Graphs;
|
---|
47 | using ILNumerics.Drawing.Interfaces;
|
---|
48 |
|
---|
49 | namespace ILNumerics.Drawing {
|
---|
50 |
|
---|
51 | /// <summary>
|
---|
52 | /// tick provider function delegate definition
|
---|
53 | /// </summary>
|
---|
54 | /// <param name="min">minimum axis limit</param>
|
---|
55 | /// <param name="max">maximum axis limit</param>
|
---|
56 | /// <param name="maxCount">maximum number of ticks to create</param>
|
---|
57 | /// <returns>list of tick position to be drawn</returns>
|
---|
58 | /// <remarks>User defined tick providers must fulfill this delegates signature.
|
---|
59 | /// </remarks>
|
---|
60 | public delegate List<float> ILLabeledTickProvider (float min, float max, int maxCount);
|
---|
61 |
|
---|
62 | /// <summary>
|
---|
63 | /// occours if the clipping data for an subfigure have changed
|
---|
64 | /// </summary>
|
---|
65 | /// <param name="sender">object which changed the data</param>
|
---|
66 | /// <param name="e">arguments containing the new clipping data</param>
|
---|
67 | public delegate void ILClippingDataChangedEvent (object sender, ClippingChangedEventArgs e);
|
---|
68 |
|
---|
69 | /// <summary>
|
---|
70 | /// delegate used to measure text, device dependent
|
---|
71 | /// </summary>
|
---|
72 | /// <param name="text">text to be measured</param>
|
---|
73 | /// <param name="font">Font used for rendering</param>
|
---|
74 | /// <returns>Size in screen coords</returns>
|
---|
75 | public delegate Size MeasureTextDelegate(string text, Font font);
|
---|
76 |
|
---|
77 | /// <summary>
|
---|
78 | /// arguments on ClippinChangedEvents
|
---|
79 | /// </summary>
|
---|
80 | public class ClippingChangedEventArgs : EventArgs {
|
---|
81 | /// <summary>
|
---|
82 | /// creates a new ClippingChangedEventArgs object
|
---|
83 | /// </summary>
|
---|
84 | /// <param name="clippingData"></param>
|
---|
85 | public ClippingChangedEventArgs(ILClippingData clippingData) {
|
---|
86 | ClippingData = clippingData;
|
---|
87 | }
|
---|
88 | /// <summary>
|
---|
89 | /// the current (new) clipping data
|
---|
90 | /// </summary>
|
---|
91 | public ILClippingData ClippingData;
|
---|
92 | }
|
---|
93 | /// <summary>
|
---|
94 | /// occours if a graphics device has been reset by the underlying graphics framework
|
---|
95 | /// </summary>
|
---|
96 | /// <param name="sender">objects who hosts the graphics device</param>
|
---|
97 | /// <param name="eventArgs"></param>
|
---|
98 | public delegate void ILGraphicsDeviceResetEvent(object sender, EventArgs eventArgs);
|
---|
99 | /// <summary>
|
---|
100 | /// occours if a graphics device has been (re)created by an output panel
|
---|
101 | /// </summary>
|
---|
102 | /// <param name="sender">objects who hosts the graphics device</param>
|
---|
103 | /// <param name="eventArgs"></param>
|
---|
104 | public delegate void ILGraphicsDeviceCreatedEvent(object sender, EventArgs eventArgs);
|
---|
105 | /// <summary>
|
---|
106 | /// arguments to communicate changes on graphs
|
---|
107 | /// </summary>
|
---|
108 | public class ILGraphChangedEventArgs : EventArgs {
|
---|
109 | /// <summary>
|
---|
110 | /// string description of the changed parameter
|
---|
111 | /// </summary>
|
---|
112 | public readonly string Source;
|
---|
113 | public ILGraphChangedEventArgs (string source) {
|
---|
114 | this.Source = source;
|
---|
115 | }
|
---|
116 | }
|
---|
117 | /// <summary>
|
---|
118 | /// fires, if properties of a graph were /have changed
|
---|
119 | /// </summary>
|
---|
120 | /// <param name="sender"></param>
|
---|
121 | /// <param name="args"></param>
|
---|
122 | public delegate void ILGraphChangedEvent (object sender, ILGraphChangedEventArgs args);
|
---|
123 |
|
---|
124 | /// <summary>
|
---|
125 | /// arguments for ILGraphCollectionChanged events
|
---|
126 | /// </summary>
|
---|
127 | public class ILGraphCollectionChangedEventArgs: EventArgs {
|
---|
128 | public readonly GraphCollectionChangeReason Reason;
|
---|
129 | public readonly ILGraph Graph;
|
---|
130 | /// <summary>
|
---|
131 | /// description of element changed (in some cases)
|
---|
132 | /// </summary>
|
---|
133 | public readonly IILPanelConfigurator Configurator;
|
---|
134 | /// <summary>
|
---|
135 | /// arguments for GraphCollectionChanged events
|
---|
136 | /// </summary>
|
---|
137 | /// <param name="graph">the graph who was changed, for ILPlot: the scene graph</param>
|
---|
138 | /// <param name="reason">reason</param>
|
---|
139 | /// <param name="configurator"> instance of IILPanelConfigurator or null</param>
|
---|
140 | public ILGraphCollectionChangedEventArgs(ILGraph graph, GraphCollectionChangeReason reason, IILPanelConfigurator configurator) {
|
---|
141 | this.Graph = graph;
|
---|
142 | this.Reason = reason;
|
---|
143 | this.Configurator = configurator;
|
---|
144 | }
|
---|
145 | }
|
---|
146 | /// <summary>
|
---|
147 | /// occurs on changes to the graph collection: add, delete
|
---|
148 | /// </summary>
|
---|
149 | /// <param name="sender">graph collection</param>
|
---|
150 | /// <param name="args"></param>
|
---|
151 | public delegate void ILGraphCollectionChangedEvent(object sender, ILGraphCollectionChangedEventArgs args);
|
---|
152 |
|
---|
153 | /// <summary>
|
---|
154 | /// Event handler handling LabeledTickAdding events
|
---|
155 | /// </summary>
|
---|
156 | public class ILLabeledTickAddingArgs : EventArgs {
|
---|
157 | public bool Cancel;
|
---|
158 | public float Value;
|
---|
159 | public string Expression;
|
---|
160 | public int Index;
|
---|
161 |
|
---|
162 | public ILLabeledTickAddingArgs (float value, string expression, int index) {
|
---|
163 | Value = value;
|
---|
164 | Expression = expression;
|
---|
165 | Cancel = false;
|
---|
166 | Index = index;
|
---|
167 | }
|
---|
168 | }
|
---|
169 | /// <summary>
|
---|
170 | /// Delegate definition for function handling LabeledTickAdding events
|
---|
171 | /// </summary>
|
---|
172 | /// <param name="sender">the sender of the event (e.g. ILTickCollection)</param>
|
---|
173 | /// <param name="args">arguments </param>
|
---|
174 | public delegate void LabeledTickAddingHandler (object sender, ILLabeledTickAddingArgs args);
|
---|
175 |
|
---|
176 | /// <summary>
|
---|
177 | /// Event arguments for axis changed events
|
---|
178 | /// </summary>
|
---|
179 | public class ILAxisChangedEventArgs : EventArgs {
|
---|
180 | /// <summary>
|
---|
181 | /// Name of changed axis (X-,Y-,ZAxis)
|
---|
182 | /// </summary>
|
---|
183 | public AxisNames AxisName;
|
---|
184 | /// <summary>
|
---|
185 | /// construct a new instance
|
---|
186 | /// </summary>
|
---|
187 | /// <param name="name"></param>
|
---|
188 | public ILAxisChangedEventArgs (AxisNames name) {
|
---|
189 | AxisName = name;
|
---|
190 | }
|
---|
191 | }
|
---|
192 | /// <summary>
|
---|
193 | /// delegate for functions handling AxisChanged events
|
---|
194 | /// </summary>
|
---|
195 | /// <param name="sender"></param>
|
---|
196 | /// <param name="args"></param>
|
---|
197 | public delegate void AxisChangedEventHandler (object sender, ILAxisChangedEventArgs args);
|
---|
198 |
|
---|
199 | /// <summary>
|
---|
200 | /// event argument for SceneGraphNodeAdded events
|
---|
201 | /// </summary>
|
---|
202 | public class ILSceneGraphNodeEventArgs : EventArgs {
|
---|
203 | /// <summary>
|
---|
204 | /// Node which was added to the scene graph
|
---|
205 | /// </summary>
|
---|
206 | public ILSceneGraphNode Node;
|
---|
207 |
|
---|
208 | public ILSceneGraphNodeEventArgs(ILSceneGraphNode node) {
|
---|
209 | Node = node;
|
---|
210 | }
|
---|
211 | }
|
---|
212 | /// <summary>
|
---|
213 | /// used for events fired once a SceneGraphNode was added
|
---|
214 | /// </summary>
|
---|
215 | /// <param name="sender">the object</param>
|
---|
216 | /// <param name="args">the arguments</param>
|
---|
217 | public delegate void SceneGraphNodeHandler (object sender, ILSceneGraphNodeEventArgs args);
|
---|
218 |
|
---|
219 | }
|
---|