VTK  9.7.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 #include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
29 
30 VTK_ABI_NAMESPACE_BEGIN
31 class vtkScalarsToColors;
32 class vtkTextProperty;
33 
34 class VTKVIEWSCORE_EXPORT VTK_MARSHALAUTO vtkViewTheme : public vtkObject
35 {
36 public:
37  static vtkViewTheme* New();
38  vtkTypeMacro(vtkViewTheme, vtkObject);
39  void PrintSelf(ostream& os, vtkIndent indent) override;
40 
42 
45  vtkSetMacro(PointSize, double);
46  vtkGetMacro(PointSize, double);
48 
50 
53  vtkSetMacro(LineWidth, double);
54  vtkGetMacro(LineWidth, double);
56 
58 
62  vtkSetVector3Macro(PointColor, double);
63  vtkGetVector3Macro(PointColor, double);
64  vtkSetMacro(PointOpacity, double);
65  vtkGetMacro(PointOpacity, double);
67 
69 
74  virtual void SetPointHueRange(double mn, double mx);
75  virtual void SetPointHueRange(double rng[2]);
76  virtual double* GetPointHueRange();
77  virtual void GetPointHueRange(double& mn, double& mx);
78  virtual void GetPointHueRange(double rng[2]);
80 
81  virtual void SetPointSaturationRange(double mn, double mx);
82  virtual void SetPointSaturationRange(double rng[2]);
83  virtual double* GetPointSaturationRange();
84  virtual void GetPointSaturationRange(double& mn, double& mx);
85  virtual void GetPointSaturationRange(double rng[2]);
86 
87  virtual void SetPointValueRange(double mn, double mx);
88  virtual void SetPointValueRange(double rng[2]);
89  virtual double* GetPointValueRange();
90  virtual void GetPointValueRange(double& mn, double& mx);
91  virtual void GetPointValueRange(double rng[2]);
92 
93  virtual void SetPointAlphaRange(double mn, double mx);
94  virtual void SetPointAlphaRange(double rng[2]);
95  virtual double* GetPointAlphaRange();
96  virtual void GetPointAlphaRange(double& mn, double& mx);
97  virtual void GetPointAlphaRange(double rng[2]);
98 
100 
103  vtkGetObjectMacro(PointLookupTable, vtkScalarsToColors);
104  virtual void SetPointLookupTable(vtkScalarsToColors* lut);
106 
108 
111  vtkSetMacro(ScalePointLookupTable, bool);
112  vtkGetMacro(ScalePointLookupTable, bool);
113  vtkBooleanMacro(ScalePointLookupTable, bool);
115 
117 
121  vtkSetVector3Macro(CellColor, double);
122  vtkGetVector3Macro(CellColor, double);
123  vtkSetMacro(CellOpacity, double);
124  vtkGetMacro(CellOpacity, double);
126 
128 
133  virtual void SetCellHueRange(double mn, double mx);
134  virtual void SetCellHueRange(double rng[2]);
135  virtual double* GetCellHueRange();
136  virtual void GetCellHueRange(double& mn, double& mx);
137  virtual void GetCellHueRange(double rng[2]);
139 
140  virtual void SetCellSaturationRange(double mn, double mx);
141  virtual void SetCellSaturationRange(double rng[2]);
142  virtual double* GetCellSaturationRange();
143  virtual void GetCellSaturationRange(double& mn, double& mx);
144  virtual void GetCellSaturationRange(double rng[2]);
145 
146  virtual void SetCellValueRange(double mn, double mx);
147  virtual void SetCellValueRange(double rng[2]);
148  virtual double* GetCellValueRange();
149  virtual void GetCellValueRange(double& mn, double& mx);
150  virtual void GetCellValueRange(double rng[2]);
151 
152  virtual void SetCellAlphaRange(double mn, double mx);
153  virtual void SetCellAlphaRange(double rng[2]);
154  virtual double* GetCellAlphaRange();
155  virtual void GetCellAlphaRange(double& mn, double& mx);
156  virtual void GetCellAlphaRange(double rng[2]);
157 
159 
162  vtkGetObjectMacro(CellLookupTable, vtkScalarsToColors);
163  virtual void SetCellLookupTable(vtkScalarsToColors* lut);
165 
167 
170  vtkSetMacro(ScaleCellLookupTable, bool);
171  vtkGetMacro(ScaleCellLookupTable, bool);
172  vtkBooleanMacro(ScaleCellLookupTable, bool);
174 
176 
179  vtkSetVector3Macro(OutlineColor, double);
180  vtkGetVector3Macro(OutlineColor, double);
182 
184 
187  vtkSetVector3Macro(SelectedPointColor, double);
188  vtkGetVector3Macro(SelectedPointColor, double);
189  vtkSetMacro(SelectedPointOpacity, double);
190  vtkGetMacro(SelectedPointOpacity, double);
192 
194 
197  vtkSetVector3Macro(SelectedCellColor, double);
198  vtkGetVector3Macro(SelectedCellColor, double);
199  vtkSetMacro(SelectedCellOpacity, double);
200  vtkGetMacro(SelectedCellOpacity, double);
202 
204 
207  vtkSetVector3Macro(BackgroundColor, double);
208  vtkGetVector3Macro(BackgroundColor, double);
210 
212 
215  vtkSetVector3Macro(BackgroundColor2, double);
216  vtkGetVector3Macro(BackgroundColor2, double);
218 
220 
223  virtual void SetPointTextProperty(vtkTextProperty* tprop);
224  vtkGetObjectMacro(PointTextProperty, vtkTextProperty);
226 
228 
231  virtual void SetCellTextProperty(vtkTextProperty* tprop);
232  vtkGetObjectMacro(CellTextProperty, vtkTextProperty);
234 
236 
240  virtual void SetVertexLabelColor(double r, double g, double b);
241  virtual void SetVertexLabelColor(double c[3]) { this->SetVertexLabelColor(c[0], c[1], c[2]); }
242  virtual double* GetVertexLabelColor();
243  virtual void GetVertexLabelColor(double& r, double& g, double& b)
244  {
245  double* c = this->GetVertexLabelColor();
246  if (c)
247  {
248  r = c[0];
249  g = c[1];
250  b = c[2];
251  }
252  }
253  virtual void GetVertexLabelColor(double c[3]) { this->GetVertexLabelColor(c[0], c[1], c[2]); }
255 
257 
261  virtual void SetEdgeLabelColor(double r, double g, double b);
262  virtual void SetEdgeLabelColor(double c[3]) { this->SetEdgeLabelColor(c[0], c[1], c[2]); }
263  virtual double* GetEdgeLabelColor();
264  virtual void GetEdgeLabelColor(double& r, double& g, double& b)
265  {
266  double* c = this->GetEdgeLabelColor();
267  if (c)
268  {
269  r = c[0];
270  g = c[1];
271  b = c[2];
272  }
273  }
274  virtual void GetEdgeLabelColor(double c[3]) { this->GetEdgeLabelColor(c[0], c[1], c[2]); }
276 
278 
283  static vtkViewTheme* CreateOceanTheme();
284  static vtkViewTheme* CreateMellowTheme();
285  static vtkViewTheme* CreateNeonTheme();
287 
289 
293  bool LookupMatchesPointTheme(vtkScalarsToColors* s2c);
294  bool LookupMatchesCellTheme(vtkScalarsToColors* s2c);
296 
297 protected:
298  vtkViewTheme();
299  ~vtkViewTheme() override;
300 
301  double PointSize;
302  double LineWidth;
303 
304  double PointColor[3];
305  double PointOpacity;
306 
307  double CellColor[3];
308  double CellOpacity;
309 
310  double OutlineColor[3];
311 
312  double SelectedPointColor[3];
314  double SelectedCellColor[3];
316 
317  double BackgroundColor[3];
318  double BackgroundColor2[3];
319 
322 
325 
328 
329 private:
330  vtkViewTheme(const vtkViewTheme&) = delete;
331  void operator=(const vtkViewTheme&) = delete;
332 };
333 
334 VTK_ABI_NAMESPACE_END
335 #endif
double LineWidth
Definition: vtkViewTheme.h:302
abstract base class for most VTK objects
Definition: vtkObject.h:52
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:243
bool ScalePointLookupTable
Definition: vtkViewTheme.h:323
virtual void SetVertexLabelColor(double c[3])
The color to use for labeling graph vertices.
Definition: vtkViewTheme.h:241
Superclass for mapping scalar values to colors.
Sets theme colors for a graphical view.
Definition: vtkViewTheme.h:34
vtkScalarsToColors * CellLookupTable
Definition: vtkViewTheme.h:321
double SelectedPointOpacity
Definition: vtkViewTheme.h:313
a simple class to control print indentation
Definition: vtkIndent.h:28
vtkScalarsToColors * PointLookupTable
Definition: vtkViewTheme.h:320
represent text properties.
double PointSize
Definition: vtkViewTheme.h:301
virtual void GetVertexLabelColor(double c[3])
The color to use for labeling graph vertices.
Definition: vtkViewTheme.h:253
virtual void SetEdgeLabelColor(double c[3])
The color to use for labeling graph edges.
Definition: vtkViewTheme.h:262
virtual void GetEdgeLabelColor(double &r, double &g, double &b)
The color to use for labeling graph edges.
Definition: vtkViewTheme.h:264
double PointOpacity
Definition: vtkViewTheme.h:305
#define VTK_MARSHALAUTO
vtkTextProperty * CellTextProperty
Definition: vtkViewTheme.h:327
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
double SelectedCellOpacity
Definition: vtkViewTheme.h:315
vtkTextProperty * PointTextProperty
Definition: vtkViewTheme.h:326
bool ScaleCellLookupTable
Definition: vtkViewTheme.h:324
double CellOpacity
Definition: vtkViewTheme.h:308
virtual void GetEdgeLabelColor(double c[3])
The color to use for labeling graph edges.
Definition: vtkViewTheme.h:274