1 // Copyright (c) 1995-1999 Matra Datavision
2 // Copyright (c) 1999-2014 OPEN CASCADE SAS
4 // This file is part of Open CASCADE Technology software library.
6 // This library is free software; you can redistribute it and/or modify it under
7 // the terms of the GNU Lesser General Public License version 2.1 as published
8 // by the Free Software Foundation, with special exception defined in the file
9 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
10 // distribution for complete text of the license and disclaimer of any warranty.
12 // Alternatively, this file may be used under the terms of Open CASCADE
13 // commercial license or contractual agreement.
15 #include <Aspect_ColorMap.ixx>
17 Aspect_ColorMap::Aspect_ColorMap( const Aspect_TypeOfColorMap type ) {
22 Aspect_TypeOfColorMap Aspect_ColorMap::Type() const {
27 Standard_Integer Aspect_ColorMap::Size() const {
29 return mydata.Length() ;
32 Standard_Integer Aspect_ColorMap::Index(const Standard_Integer anIndex) const {
34 if( anIndex < 1 || anIndex > Size() ) {
35 Aspect_BadAccess::Raise ("Undefined colormap Index");
38 Aspect_ColorMapEntry theEntry = mydata.Value(anIndex) ;
40 return theEntry.Index() ;
43 const Aspect_ColorMapEntry& Aspect_ColorMap::Entry (const Standard_Integer AnIndex) const {
45 return mydata.Value(AnIndex);
48 void Aspect_ColorMap::Dump () const {
52 cout << "Colormap Dump-->\n" ;
54 for ( i = 1 ; i <= Size() ; i++ ) (Entry(i)).Dump() ;
56 cout << "<--End Colormap Dump\n" ;