VTK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
vtkNamedColors.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkNamedColors.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 =========================================================================*/
62 #ifndef __vtkNamedColors_h
63 #define __vtkNamedColors_h
64 
65 #include "vtkCommonColorModule.h" // For export macro
66 #include "vtkObject.h"
67 #include "vtkColor.h" // Needed for vtkColor[34]ub
68 #include "vtkStdString.h" // Needed for arguments
69 #include "vtkStringArray.h" // For returning color names
70 
71 class vtkNamedColorsDataStore;
72 
74 {
75 public:
77 
82  virtual void PrintSelf(ostream &os, vtkIndent indent);
83 
85  static vtkNamedColors* New();
86 
88  int GetNumberOfColors();
89 
92  void ResetColors();
93 
95  bool ColorExists(const vtkStdString & name);
96 
100  vtkColor4ub GetColor4ub(const vtkStdString & name);
101 
103 
107  void GetColor(const vtkStdString & name,
108  unsigned char & r, unsigned char & g,
109  unsigned char & b, unsigned char & a);
111 
116  void GetColor(const vtkStdString & name, unsigned char rgba[4]);
117 
121  void GetColor(const vtkStdString & name, vtkColor4ub & rgba);
122 
126  vtkColor4d GetColor4d(const vtkStdString & name);
127 
129 
133  void GetColor(const vtkStdString & name,
134  double & r, double & g, double & b, double & a);
136 
141  void GetColor(const vtkStdString & name, double rgba[4]);
142 
146  void GetColor(const vtkStdString & name, vtkColor4d & rgba);
147 
151  vtkColor3ub GetColor3ub(const vtkStdString & name);
152 
156  vtkColor3d GetColor3d(const vtkStdString & name);
157 
159 
163  void GetColor(const vtkStdString & name,
164  double & r, double & g, double & b);
166 
171  void GetColorRGB(const vtkStdString & name, double rgb[3]);
172 
176  void GetColor(const vtkStdString & name, vtkColor3ub & rgb);
177 
181  void GetColor(const vtkStdString & name, vtkColor3d & rgb);
182 
184 
187  virtual void SetColor(const vtkStdString & name,
188  const unsigned char & r, const unsigned char & g,
189  const unsigned char & b, const unsigned char & a = 255);
191 
193 
196  virtual void SetColor(const vtkStdString & name,
197  const double & r, const double & g,
198  const double & b, const double & a = 1);
200 
205  virtual void SetColor(const vtkStdString & name, const unsigned char rgba[4]);
206 
210  virtual void SetColor(const vtkStdString & name, const vtkColor4ub & rgba);
211 
215  virtual void SetColor(const vtkStdString & name, const vtkColor3ub & rgb);
216 
220  virtual void SetColor(const vtkStdString & name, const double rgba[4]);
221 
225  virtual void SetColor(const vtkStdString & name, const vtkColor4d & rgba);
226 
230  virtual void SetColor(const vtkStdString & name, const vtkColor3d & rgb);
231 
235  void RemoveColor(const vtkStdString & name);
236 
241  vtkStdString GetColorNames();
242 
244  void GetColorNames(vtkStringArray * colorNames);
245 
252  vtkStdString GetSynonyms();
253 
254 protected:
255  vtkNamedColors();
256  virtual ~vtkNamedColors();
257 
258 private:
260  vtkNamedColorsDataStore *Colors;
261 
262  vtkNamedColors(const vtkNamedColors&); // Not implemented.
263  void operator=(const vtkNamedColors&); // Not implemented.
264 };
265 
266 #endif /* __vtkNamedColors_h */
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:46
GLboolean GLboolean GLboolean b
Definition: vtkgl.h:12312
#define VTKCOMMONCOLOR_EXPORT
abstract base class for most VTK objects
Definition: vtkObject.h:61
A class holding colors and their names.
a vtkAbstractArray subclass for strings
GLdouble GLdouble GLdouble r
Definition: vtkgl.h:11610
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:619
GLuint const GLchar * name
Definition: vtkgl.h:11983
virtual void PrintSelf(ostream &os, vtkIndent indent)
a simple class to control print indentation
Definition: vtkIndent.h:38
GLboolean GLboolean GLboolean GLboolean a
Definition: vtkgl.h:12312
GLboolean GLboolean g
Definition: vtkgl.h:12312
static vtkObject * New()