VTK
dox/Common/Color/vtkColorSeries.h
Go to the documentation of this file.
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 {
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 
00197 
00202   virtual void SetColorScheme(int scheme);
00203   virtual int SetColorSchemeByName(const vtkStdString& schemeName);
00205 
00207   int GetNumberOfColorSchemes() const;
00208 
00210   virtual vtkStdString GetColorSchemeName() const;
00211 
00213   virtual void SetColorSchemeName(const vtkStdString& scheme);
00214 
00216   virtual int GetColorScheme() const;
00217 
00219   virtual int GetNumberOfColors() const;
00220 
00224   virtual void SetNumberOfColors(int numColors);
00225 
00226 //BTX
00229   vtkColor3ub GetColor(int index) const;
00230 
00233   vtkColor3ub GetColorRepeating(int index) const;
00234 
00237   virtual void SetColor(int index, const vtkColor3ub &color);
00238 
00240   virtual void AddColor(const vtkColor3ub &color);
00241 
00243 
00244   virtual void InsertColor(int index, const vtkColor3ub &color);
00245 //ETX
00247 
00249   virtual void RemoveColor(int index);
00250 
00252   virtual void ClearColors();
00253 
00255   virtual void DeepCopy(vtkColorSeries *chartColors);
00256 
00258   void BuildLookupTable(vtkLookupTable* lkup);
00259 
00262   vtkLookupTable* CreateLookupTable();
00263 
00264 //BTX
00265 protected:
00266   vtkColorSeries();
00267   virtual ~vtkColorSeries();
00268 
00271   virtual void CopyOnWrite();
00272 
00274 
00275   class Private;
00276   Private* Storage;
00278 
00280   int ColorScheme;
00281 
00283   vtkStdString ColorSchemeName;
00284 
00285 private:
00286   vtkColorSeries(const vtkColorSeries &); // Not implemented.
00287   void operator=(const vtkColorSeries &);   // Not implemented.
00288 //ETX
00289 };
00290 
00291 #endif //__vtkColorSeries_h