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 
157 #ifndef vtkColorSeries_h
158 #define vtkColorSeries_h
159 
160 #include "vtkColor.h" // Needed for vtkColor[34]ub
161 #include "vtkCommonColorModule.h" // For export macro
162 #include "vtkObject.h"
163 #include "vtkStdString.h" // Needed for arguments
164 
165 class vtkLookupTable;
166 
167 class VTKCOMMONCOLOR_EXPORT vtkColorSeries : public vtkObject
168 {
169 public:
170  vtkTypeMacro(vtkColorSeries, vtkObject);
171  void PrintSelf(ostream& os, vtkIndent indent) override;
172 
176  static vtkColorSeries* New();
177 
182  {
184  SPECTRUM = 0,
308  CUSTOM
309  };
310 
316  enum LUTMode
317  {
319  ORDINAL = 0,
321  CATEGORICAL
322  };
323 
325 
332  virtual void SetColorScheme(int scheme);
333  virtual int SetColorSchemeByName(const vtkStdString& schemeName);
335 
340 
345 
349  virtual void SetColorSchemeName(const vtkStdString& name);
350 
354  virtual int GetColorScheme() const;
355 
359  virtual int GetNumberOfColors() const;
360 
366  virtual void SetNumberOfColors(int numColors);
367 
373 
379 
384  virtual void SetColor(int index, const vtkColor3ub& color);
385 
389  virtual void AddColor(const vtkColor3ub& color);
390 
394  virtual void InsertColor(int index, const vtkColor3ub& color);
395 
399  virtual void RemoveColor(int index);
400 
404  virtual void ClearColors();
405 
409  virtual void DeepCopy(vtkColorSeries* chartColors);
410 
418  void BuildLookupTable(vtkLookupTable* lkup, int lutIndexing = CATEGORICAL);
419 
430  vtkLookupTable* CreateLookupTable(int lutIndexing = CATEGORICAL);
431 
432 protected:
434  ~vtkColorSeries() override;
435 
440  virtual void CopyOnWrite();
441 
443 
446  class Private;
447  Private* Storage;
449 
454 
457 
458 private:
459  vtkColorSeries(const vtkColorSeries&) = delete;
460  void operator=(const vtkColorSeries&) = delete;
461 };
462 
463 #endif // vtkColorSeries_h
vtkColorSeries::GetNumberOfColors
virtual int GetNumberOfColors() const
Get the number of colors available in the current color scheme.
vtkColorSeries::BREWER_SEQUENTIAL_BLUE_PURPLE_4
@ BREWER_SEQUENTIAL_BLUE_PURPLE_4
blue to purple sequential ColorBrewer scheme (4 colors)
Definition: vtkColorSeries.h:288
vtkColorSeries::SetColorScheme
virtual void SetColorScheme(int scheme)
Set the color scheme that should be used.
vtkColorSeries::BREWER_QUALITATIVE_SET2
@ BREWER_QUALITATIVE_SET2
a qualitative ColorBrewer scheme useful for color set members
Definition: vtkColorSeries.h:296
vtkColorSeries::BREWER_DIVERGING_BROWN_BLUE_GREEN_5
@ BREWER_DIVERGING_BROWN_BLUE_GREEN_5
brown-blue-green diverging ColorBrewer scheme (5 colors)
Definition: vtkColorSeries.h:244
vtkStdString.h
vtkColorSeries::BREWER_QUALITATIVE_SET1
@ BREWER_QUALITATIVE_SET1
a qualitative ColorBrewer scheme useful for color set members
Definition: vtkColorSeries.h:302
vtkColorSeries::WARM
@ WARM
6 warm colors (red to yellow).
Definition: vtkColorSeries.h:186
vtkColorSeries::BREWER_DIVERGING_SPECTRAL_8
@ BREWER_DIVERGING_SPECTRAL_8
diverging spectral ColorBrewer scheme (8 colors)
Definition: vtkColorSeries.h:220
vtkColorSeries::BREWER_DIVERGING_PURPLE_ORANGE_8
@ BREWER_DIVERGING_PURPLE_ORANGE_8
purple-grey-orange diverging ColorBrewer scheme (8 colors)
Definition: vtkColorSeries.h:202
vtkColorSeries::BREWER_SEQUENTIAL_YELLOW_ORANGE_BROWN_8
@ BREWER_SEQUENTIAL_YELLOW_ORANGE_BROWN_8
yellow-orange-brown sequential ColorBrewer scheme (8 colors)
Definition: vtkColorSeries.h:266
vtkColorSeries::BREWER_DIVERGING_SPECTRAL_3
@ BREWER_DIVERGING_SPECTRAL_3
diverging spectral ColorBrewer scheme (3 colors)
Definition: vtkColorSeries.h:230
vtkColorSeries::BREWER_SEQUENTIAL_BLUE_GREEN_5
@ BREWER_SEQUENTIAL_BLUE_GREEN_5
blue to green sequential ColorBrewer scheme (5 colors)
Definition: vtkColorSeries.h:258
vtkColorSeries::GetColorScheme
virtual int GetColorScheme() const
Return the ID of the color scheme currently in use.
vtkColorSeries::BREWER_DIVERGING_SPECTRAL_5
@ BREWER_DIVERGING_SPECTRAL_5
diverging spectral ColorBrewer scheme (5 colors)
Definition: vtkColorSeries.h:226
vtkColorSeries::BREWER_SEQUENTIAL_YELLOW_ORANGE_BROWN_7
@ BREWER_SEQUENTIAL_YELLOW_ORANGE_BROWN_7
yellow-orange-brown sequential ColorBrewer scheme (7 colors)
Definition: vtkColorSeries.h:268
vtkColorSeries::SetColorSchemeName
virtual void SetColorSchemeName(const vtkStdString &name)
Set the name of the current color scheme.
vtkColorSeries::BREWER_SEQUENTIAL_YELLOW_ORANGE_BROWN_3
@ BREWER_SEQUENTIAL_YELLOW_ORANGE_BROWN_3
yellow-orange-brown sequential ColorBrewer scheme (3 colors)
Definition: vtkColorSeries.h:276
vtkColorSeries::BREWER_SEQUENTIAL_BLUE_PURPLE_5
@ BREWER_SEQUENTIAL_BLUE_PURPLE_5
blue to purple sequential ColorBrewer scheme (5 colors)
Definition: vtkColorSeries.h:286
vtkColorSeries::ColorScheme
int ColorScheme
The color scheme being used.
Definition: vtkColorSeries.h:453
vtkColorSeries
stores a list of colors.
Definition: vtkColorSeries.h:168
vtkColorSeries::BREWER_DIVERGING_PURPLE_ORANGE_9
@ BREWER_DIVERGING_PURPLE_ORANGE_9
purple-grey-orange diverging ColorBrewer scheme (9 colors)
Definition: vtkColorSeries.h:200
vtkColorSeries::BLUES
@ BLUES
7 different blues.
Definition: vtkColorSeries.h:190
vtkColorSeries::New
static vtkColorSeries * New()
Create a new vtkColorSeries with the SPECTRUM color scheme.
vtkColorSeries::BREWER_SEQUENTIAL_BLUE_GREEN_4
@ BREWER_SEQUENTIAL_BLUE_GREEN_4
blue to green sequential ColorBrewer scheme (4 colors)
Definition: vtkColorSeries.h:260
vtkColorSeries::COOL
@ COOL
7 cool colors (green to purple).
Definition: vtkColorSeries.h:188
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:82
vtkColorSeries::BREWER_DIVERGING_BROWN_BLUE_GREEN_3
@ BREWER_DIVERGING_BROWN_BLUE_GREEN_3
brown-blue-green diverging ColorBrewer scheme (3 colors)
Definition: vtkColorSeries.h:248
vtkColorSeries::DeepCopy
virtual void DeepCopy(vtkColorSeries *chartColors)
Make a deep copy of the supplied object.
vtkColorSeries::BREWER_DIVERGING_BROWN_BLUE_GREEN_6
@ BREWER_DIVERGING_BROWN_BLUE_GREEN_6
brown-blue-green diverging ColorBrewer scheme (6 colors)
Definition: vtkColorSeries.h:242
vtkColorSeries::BREWER_DIVERGING_PURPLE_ORANGE_5
@ BREWER_DIVERGING_PURPLE_ORANGE_5
purple-grey-orange diverging ColorBrewer scheme (5 colors)
Definition: vtkColorSeries.h:208
vtkColorSeries::BREWER_SEQUENTIAL_YELLOW_ORANGE_BROWN_9
@ BREWER_SEQUENTIAL_YELLOW_ORANGE_BROWN_9
yellow-orange-brown sequential ColorBrewer scheme (9 colors)
Definition: vtkColorSeries.h:264
vtkColorSeries::BREWER_SEQUENTIAL_BLUE_PURPLE_7
@ BREWER_SEQUENTIAL_BLUE_PURPLE_7
blue to purple sequential ColorBrewer scheme (7 colors)
Definition: vtkColorSeries.h:282
vtkColorSeries::GetColorRepeating
vtkColor3ub GetColorRepeating(int index) const
Get the color at the specified index.
vtkColorSeries::BREWER_SEQUENTIAL_BLUE_GREEN_6
@ BREWER_SEQUENTIAL_BLUE_GREEN_6
blue to green sequential ColorBrewer scheme (6 colors)
Definition: vtkColorSeries.h:256
vtkColorSeries::AddColor
virtual void AddColor(const vtkColor3ub &color)
Adds the color to the end of the list.
vtkColorSeries::BREWER_DIVERGING_BROWN_BLUE_GREEN_8
@ BREWER_DIVERGING_BROWN_BLUE_GREEN_8
brown-blue-green diverging ColorBrewer scheme (8 colors)
Definition: vtkColorSeries.h:238
vtkColorSeries::ClearColors
virtual void ClearColors()
Clears the list of colors.
vtkColorSeries::BREWER_DIVERGING_SPECTRAL_7
@ BREWER_DIVERGING_SPECTRAL_7
diverging spectral ColorBrewer scheme (7 colors)
Definition: vtkColorSeries.h:222
vtkColorSeries::BREWER_QUALITATIVE_PASTEL1
@ BREWER_QUALITATIVE_PASTEL1
a qualitative ColorBrewer scheme composed of pastel colors
Definition: vtkColorSeries.h:300
vtkColorSeries::BREWER_DIVERGING_PURPLE_ORANGE_11
@ BREWER_DIVERGING_PURPLE_ORANGE_11
purple-grey-orange diverging ColorBrewer scheme (11 colors)
Definition: vtkColorSeries.h:196
vtkColorSeries::BREWER_DIVERGING_PURPLE_ORANGE_6
@ BREWER_DIVERGING_PURPLE_ORANGE_6
purple-grey-orange diverging ColorBrewer scheme (6 colors)
Definition: vtkColorSeries.h:206
vtkColorSeries::BREWER_DIVERGING_BROWN_BLUE_GREEN_7
@ BREWER_DIVERGING_BROWN_BLUE_GREEN_7
brown-blue-green diverging ColorBrewer scheme (7 colors)
Definition: vtkColorSeries.h:240
vtkColorSeries::BREWER_DIVERGING_BROWN_BLUE_GREEN_4
@ BREWER_DIVERGING_BROWN_BLUE_GREEN_4
brown-blue-green diverging ColorBrewer scheme (4 colors)
Definition: vtkColorSeries.h:246
vtkColorSeries::BREWER_SEQUENTIAL_BLUE_PURPLE_3
@ BREWER_SEQUENTIAL_BLUE_PURPLE_3
blue to purple sequential ColorBrewer scheme (3 colors)
Definition: vtkColorSeries.h:290
vtkColorSeries::BREWER_DIVERGING_PURPLE_ORANGE_4
@ BREWER_DIVERGING_PURPLE_ORANGE_4
purple-grey-orange diverging ColorBrewer scheme (4 colors)
Definition: vtkColorSeries.h:210
vtkX3D::color
@ color
Definition: vtkX3D.h:227
vtkColorSeries::BREWER_DIVERGING_BROWN_BLUE_GREEN_10
@ BREWER_DIVERGING_BROWN_BLUE_GREEN_10
brown-blue-green diverging ColorBrewer scheme (10 colors)
Definition: vtkColorSeries.h:234
vtkColorSeries::vtkColorSeries
vtkColorSeries()
vtkColorSeries::ColorSchemes
ColorSchemes
Enum of the available color schemes.
Definition: vtkColorSeries.h:182
vtkColorSeries::BREWER_SEQUENTIAL_YELLOW_ORANGE_BROWN_6
@ BREWER_SEQUENTIAL_YELLOW_ORANGE_BROWN_6
yellow-orange-brown sequential ColorBrewer scheme (6 colors)
Definition: vtkColorSeries.h:270
vtkColorSeries::BREWER_SEQUENTIAL_YELLOW_ORANGE_BROWN_5
@ BREWER_SEQUENTIAL_YELLOW_ORANGE_BROWN_5
yellow-orange-brown sequential ColorBrewer scheme (5 colors)
Definition: vtkColorSeries.h:272
vtkColorSeries::ColorSchemeName
vtkStdString ColorSchemeName
The color scheme being used.
Definition: vtkColorSeries.h:456
vtkColor.h
vtkColorSeries::BREWER_QUALITATIVE_PAIRED
@ BREWER_QUALITATIVE_PAIRED
a qualitative ColorBrewer scheme with pairs of matching colors
Definition: vtkColorSeries.h:304
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:113
vtkColorSeries::BREWER_SEQUENTIAL_BLUE_PURPLE_8
@ BREWER_SEQUENTIAL_BLUE_PURPLE_8
blue to purple sequential ColorBrewer scheme (8 colors)
Definition: vtkColorSeries.h:280
vtkColorSeries::InsertColor
virtual void InsertColor(int index, const vtkColor3ub &color)
Inserts the color at the specified index in the list.
vtkColorSeries::BREWER_QUALITATIVE_SET3
@ BREWER_QUALITATIVE_SET3
a qualitative ColorBrewer scheme useful for color set members
Definition: vtkColorSeries.h:306
vtkColorSeries::~vtkColorSeries
~vtkColorSeries() override
vtkColorSeries::BREWER_SEQUENTIAL_BLUE_GREEN_9
@ BREWER_SEQUENTIAL_BLUE_GREEN_9
blue to green sequential ColorBrewer scheme (9 colors)
Definition: vtkColorSeries.h:250
vtkColorSeries::CreateLookupTable
vtkLookupTable * CreateLookupTable(int lutIndexing=CATEGORICAL)
Create a new lookup table with all the colors in the current scheme.
vtkColorSeries::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkColorSeries::SetNumberOfColors
virtual void SetNumberOfColors(int numColors)
Set the number of colors to be stored in a non-default color scheme.
vtkColorSeries::WILD_FLOWER
@ WILD_FLOWER
7 colors from blue to magenta.
Definition: vtkColorSeries.h:192
vtkColorSeries::BREWER_SEQUENTIAL_BLUE_GREEN_3
@ BREWER_SEQUENTIAL_BLUE_GREEN_3
blue to green sequential ColorBrewer scheme (3 colors)
Definition: vtkColorSeries.h:262
vtkColorSeries::CopyOnWrite
virtual void CopyOnWrite()
If the current scheme is a predefined (read-only) scheme, copy the current colors to a new scheme and...
vtkColorSeries::BREWER_DIVERGING_BROWN_BLUE_GREEN_9
@ BREWER_DIVERGING_BROWN_BLUE_GREEN_9
brown-blue-green diverging ColorBrewer scheme (9 colors)
Definition: vtkColorSeries.h:236
vtkX3D::name
@ name
Definition: vtkX3D.h:225
vtkColorSeries::BREWER_DIVERGING_PURPLE_ORANGE_10
@ BREWER_DIVERGING_PURPLE_ORANGE_10
purple-grey-orange diverging ColorBrewer scheme (10 colors)
Definition: vtkColorSeries.h:198
vtkObject.h
vtkColorSeries::SetColor
virtual void SetColor(int index, const vtkColor3ub &color)
Set the color at the specified index.
vtkColorSeries::BREWER_QUALITATIVE_DARK2
@ BREWER_QUALITATIVE_DARK2
a dark set of qualitative colors from ColorBrewer
Definition: vtkColorSeries.h:294
vtkLookupTable
map scalar values into colors via a lookup table
Definition: vtkLookupTable.h:178
vtkColorSeries::BREWER_DIVERGING_PURPLE_ORANGE_7
@ BREWER_DIVERGING_PURPLE_ORANGE_7
purple-grey-orange diverging ColorBrewer scheme (7 colors)
Definition: vtkColorSeries.h:204
vtkColorSeries::BREWER_QUALITATIVE_ACCENT
@ BREWER_QUALITATIVE_ACCENT
qualitative ColorBrewer scheme good for accenting
Definition: vtkColorSeries.h:292
vtkColorSeries::LUTMode
LUTMode
An enum defining how lookup tables should be used: either as a list of discrete colors to choose from...
Definition: vtkColorSeries.h:317
vtkColorSeries::BREWER_QUALITATIVE_PASTEL2
@ BREWER_QUALITATIVE_PASTEL2
a qualitative ColorBrewer scheme composed of pastel colors
Definition: vtkColorSeries.h:298
vtkColorSeries::BREWER_DIVERGING_BROWN_BLUE_GREEN_11
@ BREWER_DIVERGING_BROWN_BLUE_GREEN_11
brown-blue-green diverging ColorBrewer scheme (11 colors)
Definition: vtkColorSeries.h:232
vtkColorSeries::BREWER_DIVERGING_SPECTRAL_11
@ BREWER_DIVERGING_SPECTRAL_11
diverging spectral ColorBrewer scheme (11 colors)
Definition: vtkColorSeries.h:214
vtkColorSeries::BREWER_SEQUENTIAL_BLUE_GREEN_8
@ BREWER_SEQUENTIAL_BLUE_GREEN_8
blue to green sequential ColorBrewer scheme (8 colors)
Definition: vtkColorSeries.h:252
vtkColorSeries::CITRUS
@ CITRUS
6 colors from green to orange.
Definition: vtkColorSeries.h:194
vtkColorSeries::BREWER_SEQUENTIAL_BLUE_GREEN_7
@ BREWER_SEQUENTIAL_BLUE_GREEN_7
blue to green sequential ColorBrewer scheme (7 colors)
Definition: vtkColorSeries.h:254
vtkColor3ub
Some derived classes for the different colors commonly used.
Definition: vtkColor.h:304
vtkColorSeries::BREWER_SEQUENTIAL_BLUE_PURPLE_9
@ BREWER_SEQUENTIAL_BLUE_PURPLE_9
blue to purple sequential ColorBrewer scheme (9 colors)
Definition: vtkColorSeries.h:278
vtkColorSeries::BuildLookupTable
void BuildLookupTable(vtkLookupTable *lkup, int lutIndexing=CATEGORICAL)
Populate a lookup table with all the colors in the current scheme.
vtkColorSeries::GetColor
vtkColor3ub GetColor(int index) const
Get the color at the specified index.
vtkColorSeries::BREWER_SEQUENTIAL_BLUE_PURPLE_6
@ BREWER_SEQUENTIAL_BLUE_PURPLE_6
blue to purple sequential ColorBrewer scheme (6 colors)
Definition: vtkColorSeries.h:284
VTK_NEWINSTANCE
#define VTK_NEWINSTANCE
Definition: vtkWrappingHints.h:44
vtkColorSeries::BREWER_DIVERGING_PURPLE_ORANGE_3
@ BREWER_DIVERGING_PURPLE_ORANGE_3
purple-grey-orange diverging ColorBrewer scheme (3 colors)
Definition: vtkColorSeries.h:212
vtkStdString
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:105
vtkColorSeries::BREWER_DIVERGING_SPECTRAL_9
@ BREWER_DIVERGING_SPECTRAL_9
diverging spectral ColorBrewer scheme (9 colors)
Definition: vtkColorSeries.h:218
vtkX3D::index
@ index
Definition: vtkX3D.h:252
vtkColorSeries::BREWER_DIVERGING_SPECTRAL_10
@ BREWER_DIVERGING_SPECTRAL_10
diverging spectral ColorBrewer scheme (10 colors)
Definition: vtkColorSeries.h:216
vtkColorSeries::RemoveColor
virtual void RemoveColor(int index)
Removes the color at the specified index in the list.
vtkColorSeries::GetNumberOfColorSchemes
int GetNumberOfColorSchemes() const
Return the number of schemes currently defined.
vtkColorSeries::GetColorSchemeName
virtual vtkStdString GetColorSchemeName() const
Get the color scheme that is currently being used.
vtkColorSeries::BREWER_DIVERGING_SPECTRAL_6
@ BREWER_DIVERGING_SPECTRAL_6
diverging spectral ColorBrewer scheme (6 colors)
Definition: vtkColorSeries.h:224
vtkColorSeries::Storage
Private * Storage
Definition: vtkColorSeries.h:446
vtkColorSeries::BREWER_SEQUENTIAL_YELLOW_ORANGE_BROWN_4
@ BREWER_SEQUENTIAL_YELLOW_ORANGE_BROWN_4
yellow-orange-brown sequential ColorBrewer scheme (4 colors)
Definition: vtkColorSeries.h:274
vtkColorSeries::SetColorSchemeByName
virtual int SetColorSchemeByName(const vtkStdString &schemeName)
Set the color scheme that should be used.
vtkColorSeries::BREWER_DIVERGING_SPECTRAL_4
@ BREWER_DIVERGING_SPECTRAL_4
diverging spectral ColorBrewer scheme (4 colors)
Definition: vtkColorSeries.h:228