VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkViewTheme.h 00005 00006 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 00007 All rights reserved. 00008 See Copyright.txt or http://www.kitware.com/Copyright.htm for details. 00009 00010 This software is distributed WITHOUT ANY WARRANTY; without even 00011 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00012 PURPOSE. See the above copyright notice for more information. 00013 00014 =========================================================================*/ 00015 /*------------------------------------------------------------------------- 00016 Copyright 2008 Sandia Corporation. 00017 Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, 00018 the U.S. Government retains certain rights in this software. 00019 -------------------------------------------------------------------------*/ 00038 #ifndef vtkViewTheme_h 00039 #define vtkViewTheme_h 00040 00041 #include "vtkViewsCoreModule.h" // For export macro 00042 #include "vtkObject.h" 00043 00044 class vtkScalarsToColors; 00045 class vtkTextProperty; 00046 00047 class VTKVIEWSCORE_EXPORT vtkViewTheme : public vtkObject 00048 { 00049 public: 00050 static vtkViewTheme* New(); 00051 vtkTypeMacro(vtkViewTheme, vtkObject); 00052 void PrintSelf(ostream& os, vtkIndent indent); 00053 00055 00056 vtkSetMacro(PointSize, double); 00057 vtkGetMacro(PointSize, double); 00059 00061 00062 vtkSetMacro(LineWidth, double); 00063 vtkGetMacro(LineWidth, double); 00065 00067 00069 vtkSetVector3Macro(PointColor, double); 00070 vtkGetVector3Macro(PointColor, double); 00071 vtkSetMacro(PointOpacity, double); 00072 vtkGetMacro(PointOpacity, double); 00074 00076 00079 virtual void SetPointHueRange(double mn, double mx); 00080 virtual void SetPointHueRange(double rng[2]); 00081 virtual double* GetPointHueRange(); 00082 virtual void GetPointHueRange(double& mn, double& mx); 00083 virtual void GetPointHueRange(double rng[2]); 00085 00086 virtual void SetPointSaturationRange(double mn, double mx); 00087 virtual void SetPointSaturationRange(double rng[2]); 00088 virtual double* GetPointSaturationRange(); 00089 virtual void GetPointSaturationRange(double& mn, double& mx); 00090 virtual void GetPointSaturationRange(double rng[2]); 00091 00092 virtual void SetPointValueRange(double mn, double mx); 00093 virtual void SetPointValueRange(double rng[2]); 00094 virtual double* GetPointValueRange(); 00095 virtual void GetPointValueRange(double& mn, double& mx); 00096 virtual void GetPointValueRange(double rng[2]); 00097 00098 virtual void SetPointAlphaRange(double mn, double mx); 00099 virtual void SetPointAlphaRange(double rng[2]); 00100 virtual double* GetPointAlphaRange(); 00101 virtual void GetPointAlphaRange(double& mn, double& mx); 00102 virtual void GetPointAlphaRange(double rng[2]); 00103 00105 00106 vtkGetObjectMacro(PointLookupTable, vtkScalarsToColors); 00107 virtual void SetPointLookupTable(vtkScalarsToColors* lut); 00109 00111 00112 vtkSetMacro(ScalePointLookupTable, bool); 00113 vtkGetMacro(ScalePointLookupTable, bool); 00114 vtkBooleanMacro(ScalePointLookupTable, bool); 00116 00118 00120 vtkSetVector3Macro(CellColor, double); 00121 vtkGetVector3Macro(CellColor, double); 00122 vtkSetMacro(CellOpacity, double); 00123 vtkGetMacro(CellOpacity, double); 00125 00127 00130 virtual void SetCellHueRange(double mn, double mx); 00131 virtual void SetCellHueRange(double rng[2]); 00132 virtual double* GetCellHueRange(); 00133 virtual void GetCellHueRange(double& mn, double& mx); 00134 virtual void GetCellHueRange(double rng[2]); 00136 00137 virtual void SetCellSaturationRange(double mn, double mx); 00138 virtual void SetCellSaturationRange(double rng[2]); 00139 virtual double* GetCellSaturationRange(); 00140 virtual void GetCellSaturationRange(double& mn, double& mx); 00141 virtual void GetCellSaturationRange(double rng[2]); 00142 00143 virtual void SetCellValueRange(double mn, double mx); 00144 virtual void SetCellValueRange(double rng[2]); 00145 virtual double* GetCellValueRange(); 00146 virtual void GetCellValueRange(double& mn, double& mx); 00147 virtual void GetCellValueRange(double rng[2]); 00148 00149 virtual void SetCellAlphaRange(double mn, double mx); 00150 virtual void SetCellAlphaRange(double rng[2]); 00151 virtual double* GetCellAlphaRange(); 00152 virtual void GetCellAlphaRange(double& mn, double& mx); 00153 virtual void GetCellAlphaRange(double rng[2]); 00154 00156 00157 vtkGetObjectMacro(CellLookupTable, vtkScalarsToColors); 00158 virtual void SetCellLookupTable(vtkScalarsToColors* lut); 00160 00162 00163 vtkSetMacro(ScaleCellLookupTable, bool); 00164 vtkGetMacro(ScaleCellLookupTable, bool); 00165 vtkBooleanMacro(ScaleCellLookupTable, bool); 00167 00169 00170 vtkSetVector3Macro(OutlineColor, double); 00171 vtkGetVector3Macro(OutlineColor, double); 00173 00175 00176 vtkSetVector3Macro(SelectedPointColor, double); 00177 vtkGetVector3Macro(SelectedPointColor, double); 00178 vtkSetMacro(SelectedPointOpacity, double); 00179 vtkGetMacro(SelectedPointOpacity, double); 00181 00183 00184 vtkSetVector3Macro(SelectedCellColor, double); 00185 vtkGetVector3Macro(SelectedCellColor, double); 00186 vtkSetMacro(SelectedCellOpacity, double); 00187 vtkGetMacro(SelectedCellOpacity, double); 00189 00191 00192 vtkSetVector3Macro(BackgroundColor, double); 00193 vtkGetVector3Macro(BackgroundColor, double); 00195 00197 00198 vtkSetVector3Macro(BackgroundColor2, double); 00199 vtkGetVector3Macro(BackgroundColor2, double); 00201 00203 00204 virtual void SetPointTextProperty(vtkTextProperty* tprop); 00205 vtkGetObjectMacro(PointTextProperty, vtkTextProperty); 00207 00209 00210 virtual void SetCellTextProperty(vtkTextProperty* tprop); 00211 vtkGetObjectMacro(CellTextProperty, vtkTextProperty); 00213 00215 00217 virtual void SetVertexLabelColor(double r, double g, double b); 00218 virtual void SetVertexLabelColor(double c[3]) 00219 { this->SetVertexLabelColor(c[0], c[1], c[2]); } 00220 virtual double *GetVertexLabelColor(); 00221 virtual void GetVertexLabelColor(double &r, double &g, double &b) 00222 { double* c = this->GetVertexLabelColor(); if (c) { r = c[0]; g = c[1]; b = c[2]; } } 00223 virtual void GetVertexLabelColor(double c[3]) 00224 { this->GetVertexLabelColor(c[0], c[1], c[2]); } 00226 00228 00230 virtual void SetEdgeLabelColor(double r, double g, double b); 00231 virtual void SetEdgeLabelColor(double c[3]) 00232 { this->SetEdgeLabelColor(c[0], c[1], c[2]); } 00233 virtual double *GetEdgeLabelColor(); 00234 virtual void GetEdgeLabelColor(double &r, double &g, double &b) 00235 { double* c = this->GetEdgeLabelColor(); if (c) { r = c[0]; g = c[1]; b = c[2]; } } 00236 virtual void GetEdgeLabelColor(double c[3]) 00237 { this->GetEdgeLabelColor(c[0], c[1], c[2]); } 00239 00241 00244 static vtkViewTheme* CreateOceanTheme(); 00245 static vtkViewTheme* CreateMellowTheme(); 00246 static vtkViewTheme* CreateNeonTheme(); 00248 00250 00252 bool LookupMatchesPointTheme(vtkScalarsToColors* s2c); 00253 bool LookupMatchesCellTheme(vtkScalarsToColors* s2c); 00255 00256 protected: 00257 vtkViewTheme(); 00258 ~vtkViewTheme(); 00259 00260 double PointSize; 00261 double LineWidth; 00262 00263 double PointColor[3]; 00264 double PointOpacity; 00265 00266 double CellColor[3]; 00267 double CellOpacity; 00268 00269 double OutlineColor[3]; 00270 00271 double SelectedPointColor[3]; 00272 double SelectedPointOpacity; 00273 double SelectedCellColor[3]; 00274 double SelectedCellOpacity; 00275 00276 double BackgroundColor[3]; 00277 double BackgroundColor2[3]; 00278 00279 vtkScalarsToColors* PointLookupTable; 00280 vtkScalarsToColors* CellLookupTable; 00281 00282 bool ScalePointLookupTable; 00283 bool ScaleCellLookupTable; 00284 00285 vtkTextProperty* PointTextProperty; 00286 vtkTextProperty* CellTextProperty; 00287 00288 private: 00289 vtkViewTheme(const vtkViewTheme&); // Not implemented. 00290 void operator=(const vtkViewTheme&); // Not implemented. 00291 }; 00292 00293 #endif 00294