VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkBrush.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 00027 #ifndef __vtkBrush_h 00028 #define __vtkBrush_h 00029 00030 #include "vtkObject.h" 00031 #include "vtkColor.h" // Needed for vtkColor4ub 00032 00033 class vtkImageData; 00034 00035 class VTK_CHARTS_EXPORT vtkBrush : public vtkObject 00036 { 00037 public: 00038 vtkTypeMacro(vtkBrush, vtkObject); 00039 virtual void PrintSelf(ostream &os, vtkIndent indent); 00040 00041 static vtkBrush *New(); 00042 00045 void SetColorF(double color[3]); 00046 00049 void SetColorF(double r, double g, double b); 00050 00053 void SetColorF(double r, double g, double b, double a); 00054 00057 void SetOpacityF(double a); 00058 00061 void SetColor(unsigned char color[3]); 00062 00065 void SetColor(unsigned char r, unsigned char g, unsigned char b); 00066 00068 00070 void SetColor(unsigned char r, unsigned char g, unsigned char b, 00071 unsigned char a); 00072 void SetColor(const vtkColor4ub &color); 00074 00077 void SetOpacity(unsigned char a); 00078 00081 void GetColorF(double color[4]); 00082 00084 void GetColor(unsigned char color[4]); 00085 00087 unsigned char * GetColor() { return &this->Color[0]; } 00088 00090 vtkColor4ub GetColorObject(); 00091 00095 void SetTexture(vtkImageData* image); 00096 00098 00099 vtkGetObjectMacro(Texture, vtkImageData); 00101 00103 00104 enum TextureProperty { 00105 Nearest = 0x01, 00106 Linear = 0x02, 00107 Stretch = 0x04, 00108 Repeat = 0x08 00109 }; 00111 00113 00117 vtkSetMacro(TextureProperties, int); 00119 00121 00122 vtkGetMacro(TextureProperties, int); 00124 00126 void DeepCopy(vtkBrush *brush); 00127 00128 //BTX 00129 protected: 00130 vtkBrush(); 00131 ~vtkBrush(); 00132 00133 // Storage of the color in RGBA format (0-255 per channel). 00134 unsigned char* Color; 00135 vtkColor4ub BrushColor; 00136 vtkImageData* Texture; 00137 int TextureProperties; 00138 00139 private: 00140 vtkBrush(const vtkBrush &); // Not implemented. 00141 void operator=(const vtkBrush &); // Not implemented. 00142 //ETX 00143 }; 00144 00145 #endif //__vtkBrush_h