b311480e |
1 | -- Created on: 1993-03-23 |
2 | -- Created by: BBL |
3 | -- Copyright (c) 1993-1999 Matra Datavision |
4 | -- Copyright (c) 1999-2012 OPEN CASCADE SAS |
7fd59977 |
5 | -- |
b311480e |
6 | -- The content of this file is subject to the Open CASCADE Technology Public |
7 | -- License Version 6.5 (the "License"). You may not use the content of this file |
8 | -- except in compliance with the License. Please obtain a copy of the License |
9 | -- at http://www.opencascade.org and read it completely before using this file. |
7fd59977 |
10 | -- |
b311480e |
11 | -- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its |
12 | -- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France. |
7fd59977 |
13 | -- |
b311480e |
14 | -- The Original Code and all software distributed under the License is |
15 | -- distributed on an "AS IS" basis, without warranty of any kind, and the |
16 | -- Initial Developer hereby disclaims all such warranties, including without |
17 | -- limitation, any warranties of merchantability, fitness for a particular |
18 | -- purpose or non-infringement. Please see the License for the specific terms |
19 | -- and conditions governing the rights and limitations under the License. |
20 | |
7fd59977 |
21 | |
22 | deferred class ColorMap from Aspect inherits TShared from MMgt |
23 | |
24 | ---Version: 0.0 |
25 | |
26 | ---Purpose: This class defines a ColorMap object. |
27 | ---Keywords: |
28 | ---Warning: |
29 | ---References: |
30 | uses |
31 | Color from Quantity, |
32 | TypeOfColorMap from Aspect, |
33 | ColorMapEntry from Aspect, |
34 | SequenceOfColorMapEntry from Aspect |
35 | |
36 | raises |
37 | BadAccess from Aspect |
38 | |
39 | is |
40 | |
41 | Initialize( type : TypeOfColorMap from Aspect ); |
42 | |
43 | Type( me ) |
44 | returns TypeOfColorMap from Aspect is static; |
45 | ---Level: Public |
46 | |
47 | Size( me ) returns Integer from Standard is static; |
48 | ---Level: Public |
49 | ---Purpose: Returns the Allocated colormap Size |
50 | |
51 | Index( me ; aColormapIndex : Integer ) returns Integer from Standard |
52 | ---Level: Public |
53 | ---Purpose: Returns the ColorMapEntry.Index of the ColorMap |
54 | -- at rank <aColormapIndex> . |
55 | raises BadAccess from Aspect is static; |
56 | ---Trigger: Raises BadAccess if the index less than 1 or |
57 | -- greater than Size. |
58 | |
59 | Dump( me ) ; |
60 | ---Level: Internal |
61 | |
62 | Entry ( me ; AColorMapIndex : Integer from Standard ) |
63 | returns ColorMapEntry from Aspect |
64 | ---Level: Public |
65 | ---Purpose: Return the value of the <Index>th element of |
66 | -- the ColorMap |
67 | raises BadAccess from Aspect is static; |
68 | ---Trigger: Raises BadAccess if the index less than 1 or |
69 | -- greater than Size. |
70 | ---C++: return const & |
71 | |
72 | FindColorMapIndex ( me ; |
73 | AColorMapEntryIndex : Integer from Standard ) |
74 | returns Integer from Standard |
75 | ---Level: Public |
76 | ---Purpose: Returns the index in the ColorMap of the |
77 | -- ColorMapEntry.Index() equal to <AnEntryIndex>. |
78 | raises BadAccess from Aspect is deferred ; |
79 | ---Trigger: Raises BadAccess if the index is not defined in the |
80 | -- ColorMap. |
81 | |
82 | FindEntry ( me ; AColorMapEntryIndex : Integer from Standard ) |
83 | returns ColorMapEntry from Aspect |
84 | ---Level: Public |
85 | ---Purpose: Returns the ColorMapEntry with ColorMapEntry.Index() |
86 | -- equal to <AnEntryIndex>. |
87 | raises BadAccess from Aspect is deferred ; |
88 | ---Trigger: Raises BadAccess if the index is not defined in the |
89 | -- ColorMap. |
90 | ---C++: return const & |
91 | |
92 | NearestColorMapIndex( me ; aColor : Color from Quantity ) |
93 | returns Integer from Standard is deferred ; |
94 | ---Level: Public |
95 | ---Purpose: Returns the index in the ColorMap of the |
96 | -- nearest matching ColorMapEntry |
97 | |
98 | NearestEntry( me ; aColor : Color from Quantity ) |
99 | returns ColorMapEntry from Aspect is deferred ; |
100 | ---Level: Public |
101 | ---Purpose: Returns the nearest ColorMapEntry that match aColor . |
102 | ---C++: return const & |
103 | |
104 | AddEntry (me : mutable; aColor : Color from Quantity) |
105 | returns Integer from Standard is deferred; |
106 | ---Level: Public |
107 | ---Purpose: Search an identical color entry in the color map <me> |
108 | -- and returns the ColorMapEntry Index if exist. |
109 | -- Or add a new entry and returns the computed ColorMapEntry index used. |
110 | |
111 | fields |
112 | |
113 | mytype : TypeOfColorMap from Aspect; |
114 | mydata : SequenceOfColorMapEntry from Aspect is protected; |
115 | |
116 | end ColorMap ; |