VTK  9.1.0
vtkColorSeries.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkColorSeries.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
15 
48 #ifndef vtkColorSeries_h
49 #define vtkColorSeries_h
50 
51 #include "vtkColor.h" // Needed for vtkColor[34]ub
52 #include "vtkCommonColorModule.h" // For export macro
53 #include "vtkObject.h"
54 #include "vtkStdString.h" // Needed for arguments
55 
56 class vtkLookupTable;
57 
58 class VTKCOMMONCOLOR_EXPORT vtkColorSeries : public vtkObject
59 {
60 public:
61  vtkTypeMacro(vtkColorSeries, vtkObject);
62  void PrintSelf(ostream& os, vtkIndent indent) override;
63 
67  static vtkColorSeries* New();
68 
73  {
75  SPECTRUM = 0,
199  CUSTOM
200  };
201 
207  enum LUTMode
208  {
210  ORDINAL = 0,
212  CATEGORICAL
213  };
214 
216 
223  virtual void SetColorScheme(int scheme);
224  virtual int SetColorSchemeByName(const vtkStdString& schemeName);
226 
231 
236 
240  virtual void SetColorSchemeName(const vtkStdString& name);
241 
245  virtual int GetColorScheme() const;
246 
250  virtual int GetNumberOfColors() const;
251 
257  virtual void SetNumberOfColors(int numColors);
258 
264 
270 
275  virtual void SetColor(int index, const vtkColor3ub& color);
276 
280  virtual void AddColor(const vtkColor3ub& color);
281 
285  virtual void InsertColor(int index, const vtkColor3ub& color);
286 
290  virtual void RemoveColor(int index);
291 
295  virtual void ClearColors();
296 
300  virtual void DeepCopy(vtkColorSeries* chartColors);
301 
309  void BuildLookupTable(vtkLookupTable* lkup, int lutIndexing = CATEGORICAL);
310 
321  vtkLookupTable* CreateLookupTable(int lutIndexing = CATEGORICAL);
322 
323 protected:
325  ~vtkColorSeries() override;
326 
331  virtual void CopyOnWrite();
332 
334 
337  class Private;
338  Private* Storage;
340 
345 
348 
349 private:
350  vtkColorSeries(const vtkColorSeries&) = delete;
351  void operator=(const vtkColorSeries&) = delete;
352 };
353 
354 #endif // vtkColorSeries_h
Some derived classes for the different colors commonly used.
Definition: vtkColor.h:195
stores a list of colors.
Private * Storage
int ColorScheme
The color scheme being used.
void BuildLookupTable(vtkLookupTable *lkup, int lutIndexing=CATEGORICAL)
Populate a lookup table with all the colors in the current scheme.
LUTMode
An enum defining how lookup tables should be used: either as a list of discrete colors to choose from...
virtual void AddColor(const vtkColor3ub &color)
Adds the color to the end of the list.
virtual int GetColorScheme() const
Return the ID of the color scheme currently in use.
~vtkColorSeries() override
virtual int GetNumberOfColors() const
Get the number of colors available in the current color scheme.
virtual vtkStdString GetColorSchemeName() const
Get the color scheme that is currently being used.
virtual int SetColorSchemeByName(const vtkStdString &schemeName)
Set the color scheme that should be used.
vtkColor3ub GetColor(int index) const
Get the color at the specified index.
vtkColor3ub GetColorRepeating(int index) const
Get the color at the specified index.
virtual void DeepCopy(vtkColorSeries *chartColors)
Make a deep copy of the supplied object.
vtkStdString ColorSchemeName
The color scheme being used.
virtual void ClearColors()
Clears the list of colors.
static vtkColorSeries * New()
Create a new vtkColorSeries with the SPECTRUM color scheme.
virtual void SetColorSchemeName(const vtkStdString &name)
Set the name of the current color scheme.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
virtual void RemoveColor(int index)
Removes the color at the specified index in the list.
virtual void SetColor(int index, const vtkColor3ub &color)
Set the color at the specified index.
ColorSchemes
Enum of the available color schemes.
@ BREWER_DIVERGING_SPECTRAL_5
diverging spectral ColorBrewer scheme (5 colors)
@ WILD_FLOWER
7 colors from blue to magenta.
@ BREWER_DIVERGING_SPECTRAL_4
diverging spectral ColorBrewer scheme (4 colors)
@ BLUES
7 different blues.
@ BREWER_DIVERGING_BROWN_BLUE_GREEN_6
brown-blue-green diverging ColorBrewer scheme (6 colors)
@ BREWER_SEQUENTIAL_BLUE_PURPLE_4
blue to purple sequential ColorBrewer scheme (4 colors)
@ BREWER_QUALITATIVE_ACCENT
qualitative ColorBrewer scheme good for accenting
@ BREWER_DIVERGING_BROWN_BLUE_GREEN_11
brown-blue-green diverging ColorBrewer scheme (11 colors)
@ BREWER_QUALITATIVE_SET1
a qualitative ColorBrewer scheme useful for color set members
@ BREWER_QUALITATIVE_PASTEL2
a qualitative ColorBrewer scheme composed of pastel colors
@ BREWER_SEQUENTIAL_BLUE_GREEN_5
blue to green sequential ColorBrewer scheme (5 colors)
@ BREWER_SEQUENTIAL_BLUE_PURPLE_5
blue to purple sequential ColorBrewer scheme (5 colors)
@ BREWER_DIVERGING_BROWN_BLUE_GREEN_7
brown-blue-green diverging ColorBrewer scheme (7 colors)
@ BREWER_DIVERGING_BROWN_BLUE_GREEN_5
brown-blue-green diverging ColorBrewer scheme (5 colors)
@ BREWER_DIVERGING_PURPLE_ORANGE_6
purple-grey-orange diverging ColorBrewer scheme (6 colors)
@ BREWER_DIVERGING_BROWN_BLUE_GREEN_8
brown-blue-green diverging ColorBrewer scheme (8 colors)
@ BREWER_DIVERGING_BROWN_BLUE_GREEN_3
brown-blue-green diverging ColorBrewer scheme (3 colors)
@ BREWER_DIVERGING_PURPLE_ORANGE_9
purple-grey-orange diverging ColorBrewer scheme (9 colors)
@ BREWER_SEQUENTIAL_YELLOW_ORANGE_BROWN_4
yellow-orange-brown sequential ColorBrewer scheme (4 colors)
@ BREWER_DIVERGING_SPECTRAL_3
diverging spectral ColorBrewer scheme (3 colors)
@ BREWER_SEQUENTIAL_BLUE_GREEN_4
blue to green sequential ColorBrewer scheme (4 colors)
@ BREWER_DIVERGING_SPECTRAL_11
diverging spectral ColorBrewer scheme (11 colors)
@ BREWER_SEQUENTIAL_YELLOW_ORANGE_BROWN_7
yellow-orange-brown sequential ColorBrewer scheme (7 colors)
@ BREWER_SEQUENTIAL_BLUE_PURPLE_7
blue to purple sequential ColorBrewer scheme (7 colors)
@ BREWER_SEQUENTIAL_BLUE_PURPLE_3
blue to purple sequential ColorBrewer scheme (3 colors)
@ BREWER_QUALITATIVE_PAIRED
a qualitative ColorBrewer scheme with pairs of matching colors
@ BREWER_DIVERGING_SPECTRAL_10
diverging spectral ColorBrewer scheme (10 colors)
@ BREWER_QUALITATIVE_DARK2
a dark set of qualitative colors from ColorBrewer
@ BREWER_DIVERGING_BROWN_BLUE_GREEN_4
brown-blue-green diverging ColorBrewer scheme (4 colors)
@ BREWER_DIVERGING_SPECTRAL_6
diverging spectral ColorBrewer scheme (6 colors)
@ BREWER_SEQUENTIAL_BLUE_GREEN_9
blue to green sequential ColorBrewer scheme (9 colors)
@ BREWER_DIVERGING_PURPLE_ORANGE_8
purple-grey-orange diverging ColorBrewer scheme (8 colors)
@ BREWER_DIVERGING_PURPLE_ORANGE_5
purple-grey-orange diverging ColorBrewer scheme (5 colors)
@ BREWER_QUALITATIVE_SET3
a qualitative ColorBrewer scheme useful for color set members
@ BREWER_DIVERGING_BROWN_BLUE_GREEN_9
brown-blue-green diverging ColorBrewer scheme (9 colors)
@ BREWER_SEQUENTIAL_BLUE_GREEN_3
blue to green sequential ColorBrewer scheme (3 colors)
@ BREWER_DIVERGING_PURPLE_ORANGE_11
purple-grey-orange diverging ColorBrewer scheme (11 colors)
@ CITRUS
6 colors from green to orange.
@ BREWER_DIVERGING_PURPLE_ORANGE_3
purple-grey-orange diverging ColorBrewer scheme (3 colors)
@ BREWER_SEQUENTIAL_BLUE_PURPLE_6
blue to purple sequential ColorBrewer scheme (6 colors)
@ BREWER_SEQUENTIAL_BLUE_GREEN_8
blue to green sequential ColorBrewer scheme (8 colors)
@ BREWER_SEQUENTIAL_BLUE_PURPLE_8
blue to purple sequential ColorBrewer scheme (8 colors)
@ BREWER_SEQUENTIAL_BLUE_PURPLE_9
blue to purple sequential ColorBrewer scheme (9 colors)
@ BREWER_SEQUENTIAL_YELLOW_ORANGE_BROWN_3
yellow-orange-brown sequential ColorBrewer scheme (3 colors)
@ BREWER_SEQUENTIAL_YELLOW_ORANGE_BROWN_6
yellow-orange-brown sequential ColorBrewer scheme (6 colors)
@ WARM
6 warm colors (red to yellow).
@ BREWER_DIVERGING_PURPLE_ORANGE_10
purple-grey-orange diverging ColorBrewer scheme (10 colors)
@ BREWER_DIVERGING_SPECTRAL_8
diverging spectral ColorBrewer scheme (8 colors)
@ BREWER_SEQUENTIAL_YELLOW_ORANGE_BROWN_9
yellow-orange-brown sequential ColorBrewer scheme (9 colors)
@ BREWER_SEQUENTIAL_YELLOW_ORANGE_BROWN_8
yellow-orange-brown sequential ColorBrewer scheme (8 colors)
@ BREWER_SEQUENTIAL_BLUE_GREEN_7
blue to green sequential ColorBrewer scheme (7 colors)
@ BREWER_SEQUENTIAL_YELLOW_ORANGE_BROWN_5
yellow-orange-brown sequential ColorBrewer scheme (5 colors)
@ BREWER_DIVERGING_PURPLE_ORANGE_7
purple-grey-orange diverging ColorBrewer scheme (7 colors)
@ BREWER_QUALITATIVE_SET2
a qualitative ColorBrewer scheme useful for color set members
@ BREWER_DIVERGING_SPECTRAL_9
diverging spectral ColorBrewer scheme (9 colors)
@ BREWER_SEQUENTIAL_BLUE_GREEN_6
blue to green sequential ColorBrewer scheme (6 colors)
@ BREWER_DIVERGING_SPECTRAL_7
diverging spectral ColorBrewer scheme (7 colors)
@ BREWER_DIVERGING_PURPLE_ORANGE_4
purple-grey-orange diverging ColorBrewer scheme (4 colors)
@ BREWER_DIVERGING_BROWN_BLUE_GREEN_10
brown-blue-green diverging ColorBrewer scheme (10 colors)
@ BREWER_QUALITATIVE_PASTEL1
a qualitative ColorBrewer scheme composed of pastel colors
@ COOL
7 cool colors (green to purple).
vtkLookupTable * CreateLookupTable(int lutIndexing=CATEGORICAL)
Create a new lookup table with all the colors in the current scheme.
virtual void CopyOnWrite()
If the current scheme is a predefined (read-only) scheme, copy the current colors to a new scheme and...
virtual void InsertColor(int index, const vtkColor3ub &color)
Inserts the color at the specified index in the list.
virtual void SetNumberOfColors(int numColors)
Set the number of colors to be stored in a non-default color scheme.
int GetNumberOfColorSchemes() const
Return the number of schemes currently defined.
virtual void SetColorScheme(int scheme)
Set the color scheme that should be used.
a simple class to control print indentation
Definition: vtkIndent.h:34
map scalar values into colors via a lookup table
abstract base class for most VTK objects
Definition: vtkObject.h:63
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:36
@ color
Definition: vtkX3D.h:227
@ name
Definition: vtkX3D.h:225
@ index
Definition: vtkX3D.h:252
#define VTK_NEWINSTANCE