1 -- Created on: 1993-03-23
3 -- Copyright (c) 1993-1999 Matra Datavision
4 -- Copyright (c) 1999-2014 OPEN CASCADE SAS
6 -- This file is part of Open CASCADE Technology software library.
8 -- This library is free software; you can redistribute it and/or modify it under
9 -- the terms of the GNU Lesser General Public License 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.
14 -- Alternatively, this file may be used under the terms of Open CASCADE
15 -- commercial license or contractual agreement.
17 class ColorRampColorMap from Aspect inherits ColorMap from Aspect
21 ---Purpose: This class defines a ColorRampColorMap object.
28 NameOfColor from Quantity,
29 ColorMapEntry from Aspect
32 RangeError from Standard,
36 Create( basepixel,dimension : in Integer from Standard ;
37 color : in Color from Quantity )
38 returns mutable ColorRampColorMap from Aspect
39 raises RangeError from Standard ;
41 ---Purpose : Create a Color Ramp Colormap starting from Black at
42 -- basepixel to color at basepixel+dimension-1.
44 Create( basepixel,dimension : in Integer from Standard ;
45 colorName : in NameOfColor from Quantity )
46 returns mutable ColorRampColorMap from Aspect
47 raises RangeError from Standard ;
49 ---Purpose : Create a Color Ramp Colormap starting from Black at
50 -- basepixel to color at basepixel+dimension-1.
52 ColorRampDefinition( me : in ;
53 basepixel,dimension : out Integer from Standard ;
54 color : out Color from Quantity ) ;
56 ---Purpose : Get Color Ramp Colormap definition .
58 ComputeEntry( me : in out mutable ;
59 basepixel,dimension : in Integer from Standard ;
60 color : in Color from Quantity )
61 raises RangeError from Standard is private ;
63 ---Purpose : Create a Color Ramp Colormap starting from Black at
64 -- basepixel to color at basepixel+dimension-1.
66 FindColorMapIndex ( me ;
67 ColorMapEntryIndex : Integer from Standard )
68 returns Integer from Standard
69 raises BadAccess from Aspect ;
71 ---Purpose: Returns the index in the ColorMap of the
72 -- ColorMapEntry.Index() equal to <AnEntryIndex>.
73 -- Warning: Raises BadAccess if the index is not defined in the
76 FindEntry ( me ; AColorMapEntryIndex : Integer from Standard )
77 returns ColorMapEntry from Aspect
78 raises BadAccess from Aspect ;
80 ---Purpose: Returns the ColorMapEntry with ColorMapEntry.Index()
81 -- equal to <AnEntryIndex>.
82 -- Warning: Raises BadAccess if the index is not defined in the
84 ---C++: return const &
86 NearestColorMapIndex( me ; aColor : Color from Quantity )
87 returns Integer from Standard ;
89 ---Purpose: Returns the index in the ColorMap of the
90 -- nearest matching ColorMapEntry
92 NearestEntry( me ; aColor : Color from Quantity )
93 returns ColorMapEntry from Aspect ;
95 ---Purpose: Returns the nearest ColorMapEntry that match aColor .
96 ---C++: return const &
98 AddEntry (me : mutable; aColor : Color from Quantity)
99 returns Integer from Standard;
101 ---Purpose: Search an identical color entry in the color map <me>
102 -- or returns the nearest ColorMapEntry Index.
105 mycolor : Color from Quantity ;
106 mybasepixel : Integer from Standard ;
107 mydimension : Integer from Standard ;
109 end ColorRampColorMap ;