1 -- Created on: 1993-03-23
3 -- Copyright (c) 1993-1999 Matra Datavision
4 -- Copyright (c) 1999-2012 OPEN CASCADE SAS
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.
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.
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.
22 class ColorRampColorMap from Aspect inherits ColorMap from Aspect
26 ---Purpose: This class defines a ColorRampColorMap object.
33 NameOfColor from Quantity,
34 ColorMapEntry from Aspect
37 RangeError from Standard,
41 Create( basepixel,dimension : in Integer from Standard ;
42 color : in Color from Quantity )
43 returns mutable ColorRampColorMap from Aspect
44 raises RangeError from Standard ;
46 ---Purpose : Create a Color Ramp Colormap starting from Black at
47 -- basepixel to color at basepixel+dimension-1.
49 Create( basepixel,dimension : in Integer from Standard ;
50 colorName : in NameOfColor from Quantity )
51 returns mutable ColorRampColorMap from Aspect
52 raises RangeError from Standard ;
54 ---Purpose : Create a Color Ramp Colormap starting from Black at
55 -- basepixel to color at basepixel+dimension-1.
57 ColorRampDefinition( me : in ;
58 basepixel,dimension : out Integer from Standard ;
59 color : out Color from Quantity ) ;
61 ---Purpose : Get Color Ramp Colormap definition .
63 ComputeEntry( me : in out mutable ;
64 basepixel,dimension : in Integer from Standard ;
65 color : in Color from Quantity )
66 raises RangeError from Standard is private ;
68 ---Purpose : Create a Color Ramp Colormap starting from Black at
69 -- basepixel to color at basepixel+dimension-1.
71 FindColorMapIndex ( me ;
72 ColorMapEntryIndex : Integer from Standard )
73 returns Integer from Standard
74 raises BadAccess from Aspect ;
76 ---Purpose: Returns the index in the ColorMap of the
77 -- ColorMapEntry.Index() equal to <AnEntryIndex>.
78 -- Warning: Raises BadAccess if the index is not defined in the
81 FindEntry ( me ; AColorMapEntryIndex : Integer from Standard )
82 returns ColorMapEntry from Aspect
83 raises BadAccess from Aspect ;
85 ---Purpose: Returns the ColorMapEntry with ColorMapEntry.Index()
86 -- equal to <AnEntryIndex>.
87 -- Warning: Raises BadAccess if the index is not defined in the
89 ---C++: return const &
91 NearestColorMapIndex( me ; aColor : Color from Quantity )
92 returns Integer from Standard ;
94 ---Purpose: Returns the index in the ColorMap of the
95 -- nearest matching ColorMapEntry
97 NearestEntry( me ; aColor : Color from Quantity )
98 returns ColorMapEntry from Aspect ;
100 ---Purpose: Returns the nearest ColorMapEntry that match aColor .
101 ---C++: return const &
103 AddEntry (me : mutable; aColor : Color from Quantity)
104 returns Integer from Standard;
106 ---Purpose: Search an identical color entry in the color map <me>
107 -- or returns the nearest ColorMapEntry Index.
110 mycolor : Color from Quantity ;
111 mybasepixel : Integer from Standard ;
112 mydimension : Integer from Standard ;
114 end ColorRampColorMap ;