Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members

vtkPaletteColorBase.h

Go to the documentation of this file.
00001 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- 00002 * 00003 * $Id: vtkPaletteColorBase.h,v 1.1 2004/06/02 11:35:08 xpxqx Exp $ 00004 * 00005 * Copyright (c) 2004 Sean McInerney 00006 * All rights reserved. 00007 * 00008 * See Copyright.txt or http://vtkextensions.sourceforge.net/Copyright.html 00009 * for details. 00010 * 00011 * This software is distributed WITHOUT ANY WARRANTY; without even 00012 * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00013 * PURPOSE. See the above copyright notice for more information. 00014 * 00015 */ 00016 #ifndef VTK_PALETTE_COLOR_BASE_H_ 00017 # define VTK_PALETTE_COLOR_BASE_H_ 00018 # include "vtkAbstractPaletteColor.h" 00019 00020 VTK_EXTENSIONS_PALETTE_NAMESPACE_BEGIN 00021 00032 class VTK_EXTENSIONS_PALETTE_EXPORT vtkPaletteColorBase 00033 : public vtkAbstractPaletteColor 00034 { 00035 public: 00036 vtkTypeRevisionMacro (vtkPaletteColorBase, vtkAbstractPaletteColor); 00037 void PrintSelf (ostream&, vtkIndent); 00038 00041 void GetColor (double& a0, double& a1, double& a2); 00042 void SetColor (double a0, double a1, double a2); 00045 //BTX 00047 void UnmarshalContent (const vtkXMLChType* const& content); 00048 //ETX 00049 00050 protected: 00051 vtkPaletteColorBase (void); 00052 ~vtkPaletteColorBase() {} 00053 00054 //BTX 00055 void MarshalContent (ostream&, vtkIndent); 00056 00057 double Color[3]; 00058 //ETX 00059 00060 private: 00066 vtkPaletteColorBase (const vtkPaletteColorBase&); 00067 void operator= (const vtkPaletteColorBase&); 00069 }; 00070 00071 // ---------------------------------------------------------------------------- 00072 inline void 00073 vtkPaletteColorBase::GetColor (double& a0, double& a1, double& a2) 00074 { 00075 a0 = this->Color[0]; 00076 a1 = this->Color[1]; 00077 a2 = this->Color[2]; 00078 00079 vtkDebugMacro(<< "GetColor(" << a0 << ", " << a1 << ", " << a2 << ")"); 00080 } 00081 00082 inline void 00083 vtkPaletteColorBase::SetColor (double a0, double a1, double a2) 00084 { 00085 const double c0 = (a0<0.0 ? 0.0 : (a0>1.0 ? 1.0 : a0)); 00086 const double c1 = (a1<0.0 ? 0.0 : (a1>1.0 ? 1.0 : a1)); 00087 const double c2 = (a2<0.0 ? 0.0 : (a2>1.0 ? 1.0 : a2)); 00088 00089 vtkDebugMacro(<< "SetColor(" << c0 << ", " << c1 << ", " << c2 << ")"); 00090 00091 if ((this->Color[0] != c0)||(this->Color[1] != c1)||(this->Color[2] != c2)) 00092 { 00093 this->Color[0] = c0; 00094 this->Color[1] = c1; 00095 this->Color[2] = c2; 00096 this->Modified(); 00097 } 00098 } 00099 00100 VTK_EXTENSIONS_PALETTE_NAMESPACE_END 00101 00102 #endif /* VTK_PALETTE_COLOR_BASE_H_ */ 00103 /* 00104 * End of: $Id: vtkPaletteColorBase.h,v 1.1 2004/06/02 11:35:08 xpxqx Exp $. 00105 * 00106 */

Generated on Tue Aug 10 03:38:10 2004 for vtkExtensions by doxygen 1.3.7