VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkColorSeries.h 00005 00006 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 00007 All rights reserved. 00008 See Copyright.txt or http://www.kitware.com/Copyright.htm for details. 00009 00010 This software is distributed WITHOUT ANY WARRANTY; without even 00011 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00012 PURPOSE. See the above copyright notice for more information. 00013 00014 =========================================================================*/ 00015 00043 #ifndef vtkColorSeries_h 00044 #define vtkColorSeries_h 00045 00046 #include "vtkCommonColorModule.h" // For export macro 00047 #include "vtkObject.h" 00048 #include "vtkColor.h" // Needed for vtkColor[34]ub 00049 #include "vtkStdString.h" // Needed for arguments 00050 00051 class vtkLookupTable; 00052 00053 class VTKCOMMONCOLOR_EXPORT vtkColorSeries : public vtkObject 00054 { 00055 public: 00056 vtkTypeMacro(vtkColorSeries, vtkObject); 00057 virtual void PrintSelf(ostream &os, vtkIndent indent); 00058 00060 static vtkColorSeries* New(); 00061 00062 //BTX 00064 00065 enum ColorSchemes { 00067 SPECTRUM = 0, 00069 WARM, 00071 COOL, 00073 BLUES, 00075 WILD_FLOWER, 00077 CITRUS, 00079 BREWER_DIVERGING_PURPLE_ORANGE_11, 00081 BREWER_DIVERGING_PURPLE_ORANGE_10, 00083 BREWER_DIVERGING_PURPLE_ORANGE_9, 00085 BREWER_DIVERGING_PURPLE_ORANGE_8, 00087 BREWER_DIVERGING_PURPLE_ORANGE_7, 00089 BREWER_DIVERGING_PURPLE_ORANGE_6, 00091 BREWER_DIVERGING_PURPLE_ORANGE_5, 00093 BREWER_DIVERGING_PURPLE_ORANGE_4, 00095 BREWER_DIVERGING_PURPLE_ORANGE_3, 00097 BREWER_DIVERGING_SPECTRAL_11, 00099 BREWER_DIVERGING_SPECTRAL_10, 00101 BREWER_DIVERGING_SPECTRAL_9, 00103 BREWER_DIVERGING_SPECTRAL_8, 00105 BREWER_DIVERGING_SPECTRAL_7, 00107 BREWER_DIVERGING_SPECTRAL_6, 00109 BREWER_DIVERGING_SPECTRAL_5, 00111 BREWER_DIVERGING_SPECTRAL_4, 00113 BREWER_DIVERGING_SPECTRAL_3, 00115 BREWER_DIVERGING_BROWN_BLUE_GREEN_11, 00117 BREWER_DIVERGING_BROWN_BLUE_GREEN_10, 00119 BREWER_DIVERGING_BROWN_BLUE_GREEN_9, 00121 BREWER_DIVERGING_BROWN_BLUE_GREEN_8, 00123 BREWER_DIVERGING_BROWN_BLUE_GREEN_7, 00125 BREWER_DIVERGING_BROWN_BLUE_GREEN_6, 00127 BREWER_DIVERGING_BROWN_BLUE_GREEN_5, 00129 BREWER_DIVERGING_BROWN_BLUE_GREEN_4, 00131 BREWER_DIVERGING_BROWN_BLUE_GREEN_3, 00133 BREWER_SEQUENTIAL_BLUE_GREEN_9, 00135 BREWER_SEQUENTIAL_BLUE_GREEN_8, 00137 BREWER_SEQUENTIAL_BLUE_GREEN_7, 00139 BREWER_SEQUENTIAL_BLUE_GREEN_6, 00141 BREWER_SEQUENTIAL_BLUE_GREEN_5, 00143 BREWER_SEQUENTIAL_BLUE_GREEN_4, 00145 BREWER_SEQUENTIAL_BLUE_GREEN_3, 00147 BREWER_SEQUENTIAL_YELLOW_ORANGE_BROWN_9, 00149 BREWER_SEQUENTIAL_YELLOW_ORANGE_BROWN_8, 00151 BREWER_SEQUENTIAL_YELLOW_ORANGE_BROWN_7, 00153 BREWER_SEQUENTIAL_YELLOW_ORANGE_BROWN_6, 00155 BREWER_SEQUENTIAL_YELLOW_ORANGE_BROWN_5, 00157 BREWER_SEQUENTIAL_YELLOW_ORANGE_BROWN_4, 00159 BREWER_SEQUENTIAL_YELLOW_ORANGE_BROWN_3, 00161 BREWER_SEQUENTIAL_BLUE_PURPLE_9, 00163 BREWER_SEQUENTIAL_BLUE_PURPLE_8, 00165 BREWER_SEQUENTIAL_BLUE_PURPLE_7, 00167 BREWER_SEQUENTIAL_BLUE_PURPLE_6, 00169 BREWER_SEQUENTIAL_BLUE_PURPLE_5, 00171 BREWER_SEQUENTIAL_BLUE_PURPLE_4, 00173 BREWER_SEQUENTIAL_BLUE_PURPLE_3, 00175 BREWER_QUALITATIVE_ACCENT, 00177 BREWER_QUALITATIVE_DARK2, 00179 BREWER_QUALITATIVE_SET2, 00181 BREWER_QUALITATIVE_PASTEL2, 00183 BREWER_QUALITATIVE_PASTEL1, 00185 BREWER_QUALITATIVE_SET1, 00187 BREWER_QUALITATIVE_PAIRED, 00189 BREWER_QUALITATIVE_SET3, 00191 CUSTOM 00192 }; 00193 //ETX 00195 00196 //BTX 00198 00201 enum LUTMode { 00203 ORDINAL = 0, 00205 CATEGORICAL 00206 }; 00207 //ETX 00209 00211 00216 virtual void SetColorScheme(int scheme); 00217 virtual int SetColorSchemeByName(const vtkStdString& schemeName); 00219 00221 int GetNumberOfColorSchemes() const; 00222 00224 virtual vtkStdString GetColorSchemeName() const; 00225 00227 virtual void SetColorSchemeName(const vtkStdString& scheme); 00228 00230 virtual int GetColorScheme() const; 00231 00233 virtual int GetNumberOfColors() const; 00234 00238 virtual void SetNumberOfColors(int numColors); 00239 00240 //BTX 00243 vtkColor3ub GetColor(int index) const; 00244 00247 vtkColor3ub GetColorRepeating(int index) const; 00248 00251 virtual void SetColor(int index, const vtkColor3ub &color); 00252 00254 virtual void AddColor(const vtkColor3ub &color); 00255 00257 00258 virtual void InsertColor(int index, const vtkColor3ub &color); 00259 //ETX 00261 00263 virtual void RemoveColor(int index); 00264 00266 virtual void ClearColors(); 00267 00269 virtual void DeepCopy(vtkColorSeries *chartColors); 00270 00275 void BuildLookupTable(vtkLookupTable* lkup, int lutIndexing = CATEGORICAL); 00276 00282 vtkLookupTable* CreateLookupTable(int lutIndexing = CATEGORICAL); 00283 00284 //BTX 00285 protected: 00286 vtkColorSeries(); 00287 virtual ~vtkColorSeries(); 00288 00291 virtual void CopyOnWrite(); 00292 00294 00295 class Private; 00296 Private* Storage; 00298 00300 int ColorScheme; 00301 00303 vtkStdString ColorSchemeName; 00304 00305 private: 00306 vtkColorSeries(const vtkColorSeries &); // Not implemented. 00307 void operator=(const vtkColorSeries &); // Not implemented. 00308 //ETX 00309 }; 00310 00311 #endif //vtkColorSeries_h