7fd59977 |
1 | -- |
2 | -- File: Aspect_ColorMap.cdl |
3 | -- Created: 23/03/93 |
4 | -- Author: BBL |
5 | -- |
6 | ---Copyright: MatraDatavision 1993 |
7 | -- |
8 | |
9 | deferred class ColorMap from Aspect inherits TShared from MMgt |
10 | |
11 | ---Version: 0.0 |
12 | |
13 | ---Purpose: This class defines a ColorMap object. |
14 | ---Keywords: |
15 | ---Warning: |
16 | ---References: |
17 | uses |
18 | Color from Quantity, |
19 | TypeOfColorMap from Aspect, |
20 | ColorMapEntry from Aspect, |
21 | SequenceOfColorMapEntry from Aspect |
22 | |
23 | raises |
24 | BadAccess from Aspect |
25 | |
26 | is |
27 | |
28 | Initialize( type : TypeOfColorMap from Aspect ); |
29 | |
30 | Type( me ) |
31 | returns TypeOfColorMap from Aspect is static; |
32 | ---Level: Public |
33 | |
34 | Size( me ) returns Integer from Standard is static; |
35 | ---Level: Public |
36 | ---Purpose: Returns the Allocated colormap Size |
37 | |
38 | Index( me ; aColormapIndex : Integer ) returns Integer from Standard |
39 | ---Level: Public |
40 | ---Purpose: Returns the ColorMapEntry.Index of the ColorMap |
41 | -- at rank <aColormapIndex> . |
42 | raises BadAccess from Aspect is static; |
43 | ---Trigger: Raises BadAccess if the index less than 1 or |
44 | -- greater than Size. |
45 | |
46 | Dump( me ) ; |
47 | ---Level: Internal |
48 | |
49 | Entry ( me ; AColorMapIndex : Integer from Standard ) |
50 | returns ColorMapEntry from Aspect |
51 | ---Level: Public |
52 | ---Purpose: Return the value of the <Index>th element of |
53 | -- the ColorMap |
54 | raises BadAccess from Aspect is static; |
55 | ---Trigger: Raises BadAccess if the index less than 1 or |
56 | -- greater than Size. |
57 | ---C++: return const & |
58 | |
59 | FindColorMapIndex ( me ; |
60 | AColorMapEntryIndex : Integer from Standard ) |
61 | returns Integer from Standard |
62 | ---Level: Public |
63 | ---Purpose: Returns the index in the ColorMap of the |
64 | -- ColorMapEntry.Index() equal to <AnEntryIndex>. |
65 | raises BadAccess from Aspect is deferred ; |
66 | ---Trigger: Raises BadAccess if the index is not defined in the |
67 | -- ColorMap. |
68 | |
69 | FindEntry ( me ; AColorMapEntryIndex : Integer from Standard ) |
70 | returns ColorMapEntry from Aspect |
71 | ---Level: Public |
72 | ---Purpose: Returns the ColorMapEntry with ColorMapEntry.Index() |
73 | -- equal to <AnEntryIndex>. |
74 | raises BadAccess from Aspect is deferred ; |
75 | ---Trigger: Raises BadAccess if the index is not defined in the |
76 | -- ColorMap. |
77 | ---C++: return const & |
78 | |
79 | NearestColorMapIndex( me ; aColor : Color from Quantity ) |
80 | returns Integer from Standard is deferred ; |
81 | ---Level: Public |
82 | ---Purpose: Returns the index in the ColorMap of the |
83 | -- nearest matching ColorMapEntry |
84 | |
85 | NearestEntry( me ; aColor : Color from Quantity ) |
86 | returns ColorMapEntry from Aspect is deferred ; |
87 | ---Level: Public |
88 | ---Purpose: Returns the nearest ColorMapEntry that match aColor . |
89 | ---C++: return const & |
90 | |
91 | AddEntry (me : mutable; aColor : Color from Quantity) |
92 | returns Integer from Standard is deferred; |
93 | ---Level: Public |
94 | ---Purpose: Search an identical color entry in the color map <me> |
95 | -- and returns the ColorMapEntry Index if exist. |
96 | -- Or add a new entry and returns the computed ColorMapEntry index used. |
97 | |
98 | fields |
99 | |
100 | mytype : TypeOfColorMap from Aspect; |
101 | mydata : SequenceOfColorMapEntry from Aspect is protected; |
102 | |
103 | end ColorMap ; |