0024428: Implementation of LGPL license
[occt.git] / src / Aspect / Aspect_ColorScale.cdl
CommitLineData
b311480e 1-- Created on: 2004-06-22
2-- Created by: STV
973c2be1 3-- Copyright (c) 2004-2014 OPEN CASCADE SAS
7fd59977 4--
973c2be1 5-- This file is part of Open CASCADE Technology software library.
7fd59977 6--
973c2be1 7-- This library is free software; you can redistribute it and / or modify it
8-- under the terms of the GNU Lesser General Public version 2.1 as published
9-- by the Free Software Foundation, with special exception defined in the file
10-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
11-- distribution for complete text of the license and disclaimer of any warranty.
b311480e 12--
973c2be1 13-- Alternatively, this file may be used under the terms of Open CASCADE
14-- commercial license or contractual agreement.
7fd59977 15
16deferred class ColorScale from Aspect inherits TShared from MMgt
17
18uses
19
20 TypeOfColorScaleData from Aspect,
21 TypeOfColorScalePosition from Aspect,
22 ColorMap from Aspect,
23 SequenceOfColor from Aspect,
7fd59977 24 Color from Quantity,
25 AsciiString from TCollection,
26 ExtendedString from TCollection,
27 SequenceOfExtendedString from TColStd
28
29is
30
31 ---Category: Public
32
33 FindColor( me; Value : Real from Standard;
34 Color : in out Color from Quantity ) returns Boolean from Standard;
35 ---Purpose: Calculate color according passed value; returns true if value is in range or false, if isn't
36
37
38 FindColor( myclass; Value : Real from Standard;
39 Min, Max : Real from Standard;
40 ColorsCount : Integer from Standard;
41 Color : in out Color from Quantity ) returns Boolean from Standard;
42
43 GetMin(me)
44 returns Real from Standard;
45 ---Purpose: Returns minimal value of color scale;
46
47 GetMax(me)
48 returns Real from Standard;
49 ---Purpose: Returns maximal value of color scale;
50
51 GetRange(me; aMin : in out Real from Standard;
52 aMax : in out Real from Standard);
53 ---Purpose: Returns minimal and maximal values of color scale;
54
55 GetLabelType(me)
56 returns TypeOfColorScaleData from Aspect;
57 ---Purpose: Returns the type of labels;
58 --- Aspect_TOCSD_AUTO - labels as boundary values for intervals
59 --- Aspect_TOCSD_USER - user specified label is used
60
61 GetColorType(me)
62 returns TypeOfColorScaleData from Aspect;
63 ---Purpose: Returns the type of colors;
64 --- Aspect_TOCSD_AUTO - value between Red and Blue
65 --- Aspect_TOCSD_USER - user specified color from color map
66
67 GetNumberOfIntervals(me)
68 returns Integer from Standard;
69 ---Purpose: Returns the number of color scale intervals;
70
71 GetTitle(me)
72 returns ExtendedString from TCollection;
73 ---Purpose: Returns the color scale title string;
74
75 GetFormat(me)
76 returns AsciiString from TCollection;
77 ---Purpose: Returns the format for numbers.
78 -- The same like format for function printf().
79 -- Used if GetLabelType() is TOCSD_AUTO;
80
81 GetLabel(me; anIndex : Integer from Standard)
82 returns ExtendedString from TCollection;
83 ---Purpose: Returns the user specified label with index <anIndex>.
84 -- Returns empty string if label not defined.
85
86 GetColor(me; anIndex : Integer from Standard)
87 returns Color from Quantity;
88 ---Purpose: Returns the user specified color from color map with index <anIndex>.
89 -- Returns default color if index out of range in color map.
90
91 GetLabels(me; aLabels : in out SequenceOfExtendedString from TColStd);
92 ---Purpose: Returns the user specified labels.
93
94 GetColors(me; aColors : in out SequenceOfColor from Aspect);
95 ---Purpose: Returns the user specified colors.
96
97 GetLabelPosition(me)
98 returns TypeOfColorScalePosition from Aspect;
99 ---Purpose: Returns the position of labels concerning color filled rectangles.
100
101 GetTitlePosition(me)
102 returns TypeOfColorScalePosition from Aspect;
103 ---Purpose: Returns the position of color scale title.
104
105 IsReversed(me)
106 returns Boolean from Standard;
107 ---Purpose: Returns true if the labels and colors used in reversed order.
108
109 IsLabelAtBorder(me)
110 returns Boolean from Standard;
111 ---Purpose: Returns true if the labels placed at border of color filled rectangles.
112
113 SetMin(me : mutable; aMin : Real from Standard);
114 ---Purpose: Sets the minimal value of color scale.
115
116 SetMax(me : mutable; aMax : Real from Standard);
117 ---Purpose: Sets the maximal value of color scale.
118
119 SetRange(me : mutable; aMin : Real from Standard;
120 aMax : Real from Standard);
121 ---Purpose: Sets the minimal and maximal value of color scale.
122
123 SetLabelType(me : mutable; aType : TypeOfColorScaleData from Aspect);
124 ---Purpose: Sets the type of labels.
125 -- Aspect_TOCSD_AUTO - labels as boundary values for intervals
126 -- Aspect_TOCSD_USER - user specified label is used
127
128 SetColorType(me : mutable; aType : TypeOfColorScaleData from Aspect);
129 ---Purpose: Sets the type of colors.
130 -- Aspect_TOCSD_AUTO - value between Red and Blue
131 -- Aspect_TOCSD_USER - user specified color from color map
132
133 SetNumberOfIntervals(me : mutable; aNum : Integer from Standard);
134 ---Purpose: Sets the number of color scale intervals.
135
136 SetTitle(me : mutable; aTitle : ExtendedString from TCollection);
137 ---Purpose: Sets the color scale title string.
138
139 SetFormat(me : mutable; aFormat : AsciiString from TCollection);
140 ---Purpose: Sets the color scale auto label format specification.
141
142 SetLabel(me : mutable; aLabel : ExtendedString from TCollection;
143 anIndex : Integer from Standard = -1);
144 ---Purpose: Sets the color scale label at index. Index started from 1.
145
146 SetColor(me : mutable; aColor : Color from Quantity;
147 anIndex : Integer from Standard = -1);
148 ---Purpose: Sets the color scale color at index. Index started from 1.
149
150 SetLabels(me : mutable; aSeq : SequenceOfExtendedString from TColStd);
151 ---Purpose: Sets the color scale labels.
152
153 SetColors(me : mutable; aMap : ColorMap from Aspect);
154 ---Purpose: Sets the color scale colors.
155
156 SetColors(me : mutable; aSeq : SequenceOfColor from Aspect);
157 ---Purpose: Sets the color scale colors.
158
159 SetLabelPosition(me : mutable; aPos : TypeOfColorScalePosition from Aspect);
160 ---Purpose: Sets the color scale labels position concerning color filled rectangles.
161
162 SetTitlePosition(me : mutable; aPos : TypeOfColorScalePosition from Aspect);
163 ---Purpose: Sets the color scale title position.
164
165 SetReversed(me : mutable; aReverse : Boolean from Standard);
166 ---Purpose: Sets true if the labels and colors used in reversed order.
167
168 SetLabelAtBorder(me : mutable; anOn : Boolean from Standard);
169 ---Purpose: Sets true if the labels placed at border of color filled rectangles.
170
171 --- Size and position management
172 --- Size and position are values relative to view size (between 0 and 1)
173
174 GetSize(me; aWidth : in out Real from Standard;
175 aHeight : in out Real from Standard);
176 ---Purpose: Returns the size of color scale.
177
178 GetWidth(me)
179 returns Real from Standard;
180 ---Purpose: Returns the width of color scale.
181
182 GetHeight(me)
183 returns Real from Standard;
184 ---Purpose: Returns the height of color scale.
185
186 SetSize(me : mutable; aWidth : Real from Standard;
187 aHeight : Real from Standard);
188 ---Purpose: Sets the size of color scale.
189
190 SetWidth(me : mutable; aWidth : Real from Standard);
191 ---Purpose: Sets the width of color scale.
192
193 SetHeight(me : mutable; aHeight : Real from Standard);
194 ---Purpose: Sets the height of color scale.
195
196 GetPosition(me; aX : in out Real from Standard;
197 aY : in out Real from Standard);
198 ---Purpose: Returns the position of color scale.
199
200 GetXPosition(me)
201 returns Real from Standard;
202 ---Purpose: Returns the X position of color scale.
203
204 GetYPosition(me)
205 returns Real from Standard;
206 ---Purpose: Returns the height of color scale.
207
208 SetPosition(me : mutable; aX : Real from Standard;
209 aY : Real from Standard);
210 ---Purpose: Sets the position of color scale.
211
212 SetXPosition(me : mutable; aX : Real from Standard);
213 ---Purpose: Sets the X position of color scale.
214
215 SetYPosition(me : mutable; aY : Real from Standard);
216 ---Purpose: Sets the Y position of color scale.
217
218 GetTextHeight(me)
219 returns Integer from Standard;
220
221 SetTextHeight(me: mutable; aHeigh : Integer from Standard);
222
223
224 ---Category: Protected
225
226
227 Initialize
228 returns ColorScale from Aspect
229 is protected;
230
231 SizeHint(me; aWidth : in out Integer from Standard;
232 aHeight : in out Integer from Standard)
233 is protected;
234
235 UpdateColorScale(me : mutable)
236 is virtual protected;
237
238 DrawScale(me : mutable; aBgColor : Color from Quantity;
239 X, Y, W, H : Integer from Standard)
240 is protected;
241
242 BeginPaint(me : mutable)
243 returns Boolean from Standard
244 is virtual protected;
245
246 EndPaint(me : mutable)
247 returns Boolean from Standard
248 is virtual protected;
249
250 PaintRect(me : mutable; X, Y, W, H : Integer from Standard;
251 aColor : Color from Quantity;
252 aFilled : Boolean from Standard = Standard_False)
253 is deferred;
254
255 PaintText(me : mutable; aText : ExtendedString from TCollection;
256 X, Y : Integer from Standard;
257 aColor : Color from Quantity)
258 is deferred;
259
260 TextWidth(me; aText : ExtendedString from TCollection)
261 returns Integer from Standard
262 is deferred;
263
264 TextHeight(me; aText : ExtendedString from TCollection)
265 returns Integer from Standard
266 is deferred;
267
268 ---Category: Private
269
270 Format(me)
271 returns AsciiString from TCollection
272 is private;
273
274 GetCurrentLabel(me; anIndex : Integer from Standard)
275 returns ExtendedString from TCollection
276 is private;
277
278 GetCurrentColor(me; anIndex : Integer from Standard)
279 returns Color from Quantity
280 is private;
281
282 GetNumber(me; anIndex : Integer from Standard)
283 returns Real from Standard
284 is private;
285
286 HueFromValue(myclass; aValue : Integer from Standard;
287 aMin : Integer from Standard;
288 aMax : Integer from Standard)
289 returns Integer from Standard
290 is private;
291
292fields
293
294 myMin, myMax : Real from Standard;
295 myTitle : ExtendedString from TCollection;
296 myFormat : AsciiString from TCollection;
297 myInterval : Integer from Standard;
298 myColorType : TypeOfColorScaleData from Aspect;
299 myLabelType : TypeOfColorScaleData from Aspect;
300
301 myAtBorder : Boolean from Standard;
302 myReversed : Boolean from Standard;
303
304 myColors : SequenceOfColor from Aspect;
305 myLabels : SequenceOfExtendedString from TColStd;
306
307 myLabelPos : TypeOfColorScalePosition from Aspect;
308 myTitlePos : TypeOfColorScalePosition from Aspect;
309
310 myXPos, myYPos : Real from Standard;
311 myWidth, myHeight : Real from Standard;
312
313 myTextHeight : Integer from Standard;
314
315end ColorScale;