VTK  9.3.1
vtkViewTheme.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-FileCopyrightText: Copyright 2008 Sandia Corporation
3 // SPDX-License-Identifier: LicenseRef-BSD-3-Clause-Sandia-USGov
23 #ifndef vtkViewTheme_h
24 #define vtkViewTheme_h
25 
26 #include "vtkObject.h"
27 #include "vtkViewsCoreModule.h" // For export macro
28 
29 VTK_ABI_NAMESPACE_BEGIN
30 class vtkScalarsToColors;
31 class vtkTextProperty;
32 
33 class VTKVIEWSCORE_EXPORT vtkViewTheme : public vtkObject
34 {
35 public:
36  static vtkViewTheme* New();
37  vtkTypeMacro(vtkViewTheme, vtkObject);
38  void PrintSelf(ostream& os, vtkIndent indent) override;
39 
41 
44  vtkSetMacro(PointSize, double);
45  vtkGetMacro(PointSize, double);
47 
49 
52  vtkSetMacro(LineWidth, double);
53  vtkGetMacro(LineWidth, double);
55 
57 
61  vtkSetVector3Macro(PointColor, double);
62  vtkGetVector3Macro(PointColor, double);
63  vtkSetMacro(PointOpacity, double);
64  vtkGetMacro(PointOpacity, double);
66 
68 
73  virtual void SetPointHueRange(double mn, double mx);
74  virtual void SetPointHueRange(double rng[2]);
75  virtual double* GetPointHueRange();
76  virtual void GetPointHueRange(double& mn, double& mx);
77  virtual void GetPointHueRange(double rng[2]);
79 
80  virtual void SetPointSaturationRange(double mn, double mx);
81  virtual void SetPointSaturationRange(double rng[2]);
82  virtual double* GetPointSaturationRange();
83  virtual void GetPointSaturationRange(double& mn, double& mx);
84  virtual void GetPointSaturationRange(double rng[2]);
85 
86  virtual void SetPointValueRange(double mn, double mx);
87  virtual void SetPointValueRange(double rng[2]);
88  virtual double* GetPointValueRange();
89  virtual void GetPointValueRange(double& mn, double& mx);
90  virtual void GetPointValueRange(double rng[2]);
91 
92  virtual void SetPointAlphaRange(double mn, double mx);
93  virtual void SetPointAlphaRange(double rng[2]);
94  virtual double* GetPointAlphaRange();
95  virtual void GetPointAlphaRange(double& mn, double& mx);
96  virtual void GetPointAlphaRange(double rng[2]);
97 
99 
102  vtkGetObjectMacro(PointLookupTable, vtkScalarsToColors);
103  virtual void SetPointLookupTable(vtkScalarsToColors* lut);
105 
107 
110  vtkSetMacro(ScalePointLookupTable, bool);
111  vtkGetMacro(ScalePointLookupTable, bool);
112  vtkBooleanMacro(ScalePointLookupTable, bool);
114 
116 
120  vtkSetVector3Macro(CellColor, double);
121  vtkGetVector3Macro(CellColor, double);
122  vtkSetMacro(CellOpacity, double);
123  vtkGetMacro(CellOpacity, double);
125 
127 
132  virtual void SetCellHueRange(double mn, double mx);
133  virtual void SetCellHueRange(double rng[2]);
134  virtual double* GetCellHueRange();
135  virtual void GetCellHueRange(double& mn, double& mx);
136  virtual void GetCellHueRange(double rng[2]);
138 
139  virtual void SetCellSaturationRange(double mn, double mx);
140  virtual void SetCellSaturationRange(double rng[2]);
141  virtual double* GetCellSaturationRange();
142  virtual void GetCellSaturationRange(double& mn, double& mx);
143  virtual void GetCellSaturationRange(double rng[2]);
144 
145  virtual void SetCellValueRange(double mn, double mx);
146  virtual void SetCellValueRange(double rng[2]);
147  virtual double* GetCellValueRange();
148  virtual void GetCellValueRange(double& mn, double& mx);
149  virtual void GetCellValueRange(double rng[2]);
150 
151  virtual void SetCellAlphaRange(double mn, double mx);
152  virtual void SetCellAlphaRange(double rng[2]);
153  virtual double* GetCellAlphaRange();
154  virtual void GetCellAlphaRange(double& mn, double& mx);
155  virtual void GetCellAlphaRange(double rng[2]);
156 
158 
161  vtkGetObjectMacro(CellLookupTable, vtkScalarsToColors);
162  virtual void SetCellLookupTable(vtkScalarsToColors* lut);
164 
166 
169  vtkSetMacro(ScaleCellLookupTable, bool);
170  vtkGetMacro(ScaleCellLookupTable, bool);
171  vtkBooleanMacro(ScaleCellLookupTable, bool);
173 
175 
178  vtkSetVector3Macro(OutlineColor, double);
179  vtkGetVector3Macro(OutlineColor, double);
181 
183 
186  vtkSetVector3Macro(SelectedPointColor, double);
187  vtkGetVector3Macro(SelectedPointColor, double);
188  vtkSetMacro(SelectedPointOpacity, double);
189  vtkGetMacro(SelectedPointOpacity, double);
191 
193 
196  vtkSetVector3Macro(SelectedCellColor, double);
197  vtkGetVector3Macro(SelectedCellColor, double);
198  vtkSetMacro(SelectedCellOpacity, double);
199  vtkGetMacro(SelectedCellOpacity, double);
201 
203 
206  vtkSetVector3Macro(BackgroundColor, double);
207  vtkGetVector3Macro(BackgroundColor, double);
209 
211 
214  vtkSetVector3Macro(BackgroundColor2, double);
215  vtkGetVector3Macro(BackgroundColor2, double);
217 
219 
222  virtual void SetPointTextProperty(vtkTextProperty* tprop);
223  vtkGetObjectMacro(PointTextProperty, vtkTextProperty);
225 
227 
230  virtual void SetCellTextProperty(vtkTextProperty* tprop);
231  vtkGetObjectMacro(CellTextProperty, vtkTextProperty);
233 
235 
239  virtual void SetVertexLabelColor(double r, double g, double b);
240  virtual void SetVertexLabelColor(double c[3]) { this->SetVertexLabelColor(c[0], c[1], c[2]); }
241  virtual double* GetVertexLabelColor();
242  virtual void GetVertexLabelColor(double& r, double& g, double& b)
243  {
244  double* c = this->GetVertexLabelColor();
245  if (c)
246  {
247  r = c[0];
248  g = c[1];
249  b = c[2];
250  }
251  }
252  virtual void GetVertexLabelColor(double c[3]) { this->GetVertexLabelColor(c[0], c[1], c[2]); }
254 
256 
260  virtual void SetEdgeLabelColor(double r, double g, double b);
261  virtual void SetEdgeLabelColor(double c[3]) { this->SetEdgeLabelColor(c[0], c[1], c[2]); }
262  virtual double* GetEdgeLabelColor();
263  virtual void GetEdgeLabelColor(double& r, double& g, double& b)
264  {
265  double* c = this->GetEdgeLabelColor();
266  if (c)
267  {
268  r = c[0];
269  g = c[1];
270  b = c[2];
271  }
272  }
273  virtual void GetEdgeLabelColor(double c[3]) { this->GetEdgeLabelColor(c[0], c[1], c[2]); }
275 
277 
282  static vtkViewTheme* CreateOceanTheme();
283  static vtkViewTheme* CreateMellowTheme();
284  static vtkViewTheme* CreateNeonTheme();
286 
288 
292  bool LookupMatchesPointTheme(vtkScalarsToColors* s2c);
293  bool LookupMatchesCellTheme(vtkScalarsToColors* s2c);
295 
296 protected:
297  vtkViewTheme();
298  ~vtkViewTheme() override;
299 
300  double PointSize;
301  double LineWidth;
302 
303  double PointColor[3];
304  double PointOpacity;
305 
306  double CellColor[3];
307  double CellOpacity;
308 
309  double OutlineColor[3];
310 
311  double SelectedPointColor[3];
313  double SelectedCellColor[3];
315 
316  double BackgroundColor[3];
317  double BackgroundColor2[3];
318 
321 
324 
327 
328 private:
329  vtkViewTheme(const vtkViewTheme&) = delete;
330  void operator=(const vtkViewTheme&) = delete;
331 };
332 
333 VTK_ABI_NAMESPACE_END
334 #endif
double LineWidth
Definition: vtkViewTheme.h:301
abstract base class for most VTK objects
Definition: vtkObject.h:51
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
virtual void GetVertexLabelColor(double &r, double &g, double &b)
The color to use for labeling graph vertices.
Definition: vtkViewTheme.h:242
bool ScalePointLookupTable
Definition: vtkViewTheme.h:322
virtual void SetVertexLabelColor(double c[3])
The color to use for labeling graph vertices.
Definition: vtkViewTheme.h:240
Superclass for mapping scalar values to colors.
Sets theme colors for a graphical view.
Definition: vtkViewTheme.h:33
vtkScalarsToColors * CellLookupTable
Definition: vtkViewTheme.h:320
double SelectedPointOpacity
Definition: vtkViewTheme.h:312
a simple class to control print indentation
Definition: vtkIndent.h:28
vtkScalarsToColors * PointLookupTable
Definition: vtkViewTheme.h:319
represent text properties.
double PointSize
Definition: vtkViewTheme.h:300
virtual void GetVertexLabelColor(double c[3])
The color to use for labeling graph vertices.
Definition: vtkViewTheme.h:252
virtual void SetEdgeLabelColor(double c[3])
The color to use for labeling graph edges.
Definition: vtkViewTheme.h:261
virtual void GetEdgeLabelColor(double &r, double &g, double &b)
The color to use for labeling graph edges.
Definition: vtkViewTheme.h:263
double PointOpacity
Definition: vtkViewTheme.h:304
vtkTextProperty * CellTextProperty
Definition: vtkViewTheme.h:326
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
double SelectedCellOpacity
Definition: vtkViewTheme.h:314
vtkTextProperty * PointTextProperty
Definition: vtkViewTheme.h:325
bool ScaleCellLookupTable
Definition: vtkViewTheme.h:323
double CellOpacity
Definition: vtkViewTheme.h:307
virtual void GetEdgeLabelColor(double c[3])
The color to use for labeling graph edges.
Definition: vtkViewTheme.h:273