VTK
vtkViewTheme.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkViewTheme.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 /*-------------------------------------------------------------------------
16  Copyright 2008 Sandia Corporation.
17  Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
18  the U.S. Government retains certain rights in this software.
19 -------------------------------------------------------------------------*/
38 #ifndef __vtkViewTheme_h
39 #define __vtkViewTheme_h
40 
41 #include "vtkObject.h"
42 
43 class vtkScalarsToColors;
44 class vtkTextProperty;
45 
47 {
48 public:
49  static vtkViewTheme* New();
50  vtkTypeMacro(vtkViewTheme, vtkObject);
51  void PrintSelf(ostream& os, vtkIndent indent);
52 
54 
55  vtkSetMacro(PointSize, double);
56  vtkGetMacro(PointSize, double);
58 
60 
61  vtkSetMacro(LineWidth, double);
62  vtkGetMacro(LineWidth, double);
64 
66 
68  vtkSetVector3Macro(PointColor, double);
69  vtkGetVector3Macro(PointColor, double);
70  vtkSetMacro(PointOpacity, double);
71  vtkGetMacro(PointOpacity, double);
73 
75 
78  virtual void SetPointHueRange(double mn, double mx);
79  virtual void SetPointHueRange(double rng[2]);
80  virtual double* GetPointHueRange();
81  virtual void GetPointHueRange(double& mn, double& mx);
82  virtual void GetPointHueRange(double rng[2]);
84 
85  virtual void SetPointSaturationRange(double mn, double mx);
86  virtual void SetPointSaturationRange(double rng[2]);
87  virtual double* GetPointSaturationRange();
88  virtual void GetPointSaturationRange(double& mn, double& mx);
89  virtual void GetPointSaturationRange(double rng[2]);
90 
91  virtual void SetPointValueRange(double mn, double mx);
92  virtual void SetPointValueRange(double rng[2]);
93  virtual double* GetPointValueRange();
94  virtual void GetPointValueRange(double& mn, double& mx);
95  virtual void GetPointValueRange(double rng[2]);
96 
97  virtual void SetPointAlphaRange(double mn, double mx);
98  virtual void SetPointAlphaRange(double rng[2]);
99  virtual double* GetPointAlphaRange();
100  virtual void GetPointAlphaRange(double& mn, double& mx);
101  virtual void GetPointAlphaRange(double rng[2]);
102 
104 
105  vtkGetObjectMacro(PointLookupTable, vtkScalarsToColors);
106  virtual void SetPointLookupTable(vtkScalarsToColors* lut);
108 
110 
111  vtkSetMacro(ScalePointLookupTable, bool);
112  vtkGetMacro(ScalePointLookupTable, bool);
113  vtkBooleanMacro(ScalePointLookupTable, bool);
115 
117 
119  vtkSetVector3Macro(CellColor, double);
120  vtkGetVector3Macro(CellColor, double);
121  vtkSetMacro(CellOpacity, double);
122  vtkGetMacro(CellOpacity, double);
124 
126 
129  virtual void SetCellHueRange(double mn, double mx);
130  virtual void SetCellHueRange(double rng[2]);
131  virtual double* GetCellHueRange();
132  virtual void GetCellHueRange(double& mn, double& mx);
133  virtual void GetCellHueRange(double rng[2]);
135 
136  virtual void SetCellSaturationRange(double mn, double mx);
137  virtual void SetCellSaturationRange(double rng[2]);
138  virtual double* GetCellSaturationRange();
139  virtual void GetCellSaturationRange(double& mn, double& mx);
140  virtual void GetCellSaturationRange(double rng[2]);
141 
142  virtual void SetCellValueRange(double mn, double mx);
143  virtual void SetCellValueRange(double rng[2]);
144  virtual double* GetCellValueRange();
145  virtual void GetCellValueRange(double& mn, double& mx);
146  virtual void GetCellValueRange(double rng[2]);
147 
148  virtual void SetCellAlphaRange(double mn, double mx);
149  virtual void SetCellAlphaRange(double rng[2]);
150  virtual double* GetCellAlphaRange();
151  virtual void GetCellAlphaRange(double& mn, double& mx);
152  virtual void GetCellAlphaRange(double rng[2]);
153 
155 
156  vtkGetObjectMacro(CellLookupTable, vtkScalarsToColors);
157  virtual void SetCellLookupTable(vtkScalarsToColors* lut);
159 
161 
162  vtkSetMacro(ScaleCellLookupTable, bool);
163  vtkGetMacro(ScaleCellLookupTable, bool);
164  vtkBooleanMacro(ScaleCellLookupTable, bool);
166 
168 
169  vtkSetVector3Macro(OutlineColor, double);
170  vtkGetVector3Macro(OutlineColor, double);
172 
174 
175  vtkSetVector3Macro(SelectedPointColor, double);
176  vtkGetVector3Macro(SelectedPointColor, double);
177  vtkSetMacro(SelectedPointOpacity, double);
178  vtkGetMacro(SelectedPointOpacity, double);
180 
182 
183  vtkSetVector3Macro(SelectedCellColor, double);
184  vtkGetVector3Macro(SelectedCellColor, double);
185  vtkSetMacro(SelectedCellOpacity, double);
186  vtkGetMacro(SelectedCellOpacity, double);
188 
190 
191  vtkSetVector3Macro(BackgroundColor, double);
192  vtkGetVector3Macro(BackgroundColor, double);
194 
196 
197  vtkSetVector3Macro(BackgroundColor2, double);
198  vtkGetVector3Macro(BackgroundColor2, double);
200 
202 
203  virtual void SetPointTextProperty(vtkTextProperty* tprop);
204  vtkGetObjectMacro(PointTextProperty, vtkTextProperty);
206 
208 
209  virtual void SetCellTextProperty(vtkTextProperty* tprop);
210  vtkGetObjectMacro(CellTextProperty, vtkTextProperty);
212 
214 
216  virtual void SetVertexLabelColor(double r, double g, double b);
217  virtual void SetVertexLabelColor(double c[3])
218  { this->SetVertexLabelColor(c[0], c[1], c[2]); }
219  virtual double *GetVertexLabelColor();
220  virtual void GetVertexLabelColor(double &r, double &g, double &b)
221  { double* c = this->GetVertexLabelColor(); if (c) { r = c[0]; g = c[1]; b = c[2]; } }
222  virtual void GetVertexLabelColor(double c[3])
223  { this->GetVertexLabelColor(c[0], c[1], c[2]); }
225 
227 
229  virtual void SetEdgeLabelColor(double r, double g, double b);
230  virtual void SetEdgeLabelColor(double c[3])
231  { this->SetEdgeLabelColor(c[0], c[1], c[2]); }
232  virtual double *GetEdgeLabelColor();
233  virtual void GetEdgeLabelColor(double &r, double &g, double &b)
234  { double* c = this->GetEdgeLabelColor(); if (c) { r = c[0]; g = c[1]; b = c[2]; } }
235  virtual void GetEdgeLabelColor(double c[3])
236  { this->GetEdgeLabelColor(c[0], c[1], c[2]); }
238 
240 
243  static vtkViewTheme* CreateOceanTheme();
244  static vtkViewTheme* CreateMellowTheme();
245  static vtkViewTheme* CreateNeonTheme();
247 
249 
251  bool LookupMatchesPointTheme(vtkScalarsToColors* s2c);
252  bool LookupMatchesCellTheme(vtkScalarsToColors* s2c);
254 
255 protected:
256  vtkViewTheme();
257  ~vtkViewTheme();
258 
259  double PointSize;
260  double LineWidth;
261 
262  double PointColor[3];
263  double PointOpacity;
264 
265  double CellColor[3];
266  double CellOpacity;
267 
268  double OutlineColor[3];
269 
270  double SelectedPointColor[3];
272  double SelectedCellColor[3];
274 
275  double BackgroundColor[3];
276  double BackgroundColor2[3];
277 
280 
283 
286 
287 private:
288  vtkViewTheme(const vtkViewTheme&); // Not implemented.
289  void operator=(const vtkViewTheme&); // Not implemented.
290 };
291 
292 #endif
293