b311480e |
1 | -- Created on: 1993-03-23 |
2 | -- Created by: BBL |
3 | -- Copyright (c) 1993-1999 Matra Datavision |
973c2be1 |
4 | -- Copyright (c) 1999-2014 OPEN CASCADE SAS |
7fd59977 |
5 | -- |
973c2be1 |
6 | -- This file is part of Open CASCADE Technology software library. |
7fd59977 |
7 | -- |
973c2be1 |
8 | -- This library is free software; you can redistribute it and / or modify it |
9 | -- under the terms of the GNU Lesser General Public version 2.1 as published |
10 | -- by the Free Software Foundation, with special exception defined in the file |
11 | -- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT |
12 | -- distribution for complete text of the license and disclaimer of any warranty. |
7fd59977 |
13 | -- |
973c2be1 |
14 | -- Alternatively, this file may be used under the terms of Open CASCADE |
15 | -- commercial license or contractual agreement. |
7fd59977 |
16 | |
17 | deferred class ColorMap from Aspect inherits TShared from MMgt |
18 | |
19 | ---Version: 0.0 |
20 | |
21 | ---Purpose: This class defines a ColorMap object. |
22 | ---Keywords: |
23 | ---Warning: |
24 | ---References: |
25 | uses |
26 | Color from Quantity, |
27 | TypeOfColorMap from Aspect, |
28 | ColorMapEntry from Aspect, |
29 | SequenceOfColorMapEntry from Aspect |
30 | |
31 | raises |
32 | BadAccess from Aspect |
33 | |
34 | is |
35 | |
36 | Initialize( type : TypeOfColorMap from Aspect ); |
37 | |
38 | Type( me ) |
39 | returns TypeOfColorMap from Aspect is static; |
40 | ---Level: Public |
41 | |
42 | Size( me ) returns Integer from Standard is static; |
43 | ---Level: Public |
44 | ---Purpose: Returns the Allocated colormap Size |
45 | |
46 | Index( me ; aColormapIndex : Integer ) returns Integer from Standard |
47 | ---Level: Public |
48 | ---Purpose: Returns the ColorMapEntry.Index of the ColorMap |
49 | -- at rank <aColormapIndex> . |
50 | raises BadAccess from Aspect is static; |
51 | ---Trigger: Raises BadAccess if the index less than 1 or |
52 | -- greater than Size. |
53 | |
54 | Dump( me ) ; |
55 | ---Level: Internal |
56 | |
57 | Entry ( me ; AColorMapIndex : Integer from Standard ) |
58 | returns ColorMapEntry from Aspect |
59 | ---Level: Public |
60 | ---Purpose: Return the value of the <Index>th element of |
61 | -- the ColorMap |
62 | raises BadAccess from Aspect is static; |
63 | ---Trigger: Raises BadAccess if the index less than 1 or |
64 | -- greater than Size. |
65 | ---C++: return const & |
66 | |
67 | FindColorMapIndex ( me ; |
68 | AColorMapEntryIndex : Integer from Standard ) |
69 | returns Integer from Standard |
70 | ---Level: Public |
71 | ---Purpose: Returns the index in the ColorMap of the |
72 | -- ColorMapEntry.Index() equal to <AnEntryIndex>. |
73 | raises BadAccess from Aspect is deferred ; |
74 | ---Trigger: Raises BadAccess if the index is not defined in the |
75 | -- ColorMap. |
76 | |
77 | FindEntry ( me ; AColorMapEntryIndex : Integer from Standard ) |
78 | returns ColorMapEntry from Aspect |
79 | ---Level: Public |
80 | ---Purpose: Returns the ColorMapEntry with ColorMapEntry.Index() |
81 | -- equal to <AnEntryIndex>. |
82 | raises BadAccess from Aspect is deferred ; |
83 | ---Trigger: Raises BadAccess if the index is not defined in the |
84 | -- ColorMap. |
85 | ---C++: return const & |
86 | |
87 | NearestColorMapIndex( me ; aColor : Color from Quantity ) |
88 | returns Integer from Standard is deferred ; |
89 | ---Level: Public |
90 | ---Purpose: Returns the index in the ColorMap of the |
91 | -- nearest matching ColorMapEntry |
92 | |
93 | NearestEntry( me ; aColor : Color from Quantity ) |
94 | returns ColorMapEntry from Aspect is deferred ; |
95 | ---Level: Public |
96 | ---Purpose: Returns the nearest ColorMapEntry that match aColor . |
97 | ---C++: return const & |
98 | |
99 | AddEntry (me : mutable; aColor : Color from Quantity) |
100 | returns Integer from Standard is deferred; |
101 | ---Level: Public |
102 | ---Purpose: Search an identical color entry in the color map <me> |
103 | -- and returns the ColorMapEntry Index if exist. |
104 | -- Or add a new entry and returns the computed ColorMapEntry index used. |
105 | |
106 | fields |
107 | |
108 | mytype : TypeOfColorMap from Aspect; |
109 | mydata : SequenceOfColorMapEntry from Aspect is protected; |
110 | |
111 | end ColorMap ; |