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 00060 double GetOpacityF(); 00061 00064 void SetColor(unsigned char color[3]); 00065 00068 void SetColor(unsigned char r, unsigned char g, unsigned char b); 00069 00071 00073 void SetColor(unsigned char r, unsigned char g, unsigned char b, 00074 unsigned char a); 00075 void SetColor(const vtkColor4ub &color); 00077 00080 void SetOpacity(unsigned char a); 00081 00083 unsigned char GetOpacity(); 00084 00087 void GetColorF(double color[4]); 00088 00090 void GetColor(unsigned char color[4]); 00091 00093 unsigned char * GetColor() { return &this->Color[0]; } 00094 00096 vtkColor4ub GetColorObject(); 00097 00101 void SetTexture(vtkImageData* image); 00102 00104 00105 vtkGetObjectMacro(Texture, vtkImageData); 00107 00109 00110 enum TextureProperty { 00111 Nearest = 0x01, 00112 Linear = 0x02, 00113 Stretch = 0x04, 00114 Repeat = 0x08 00115 }; 00117 00119 00123 vtkSetMacro(TextureProperties, int); 00125 00127 00128 vtkGetMacro(TextureProperties, int); 00130 00132 void DeepCopy(vtkBrush *brush); 00133 00134 //BTX 00135 protected: 00136 vtkBrush(); 00137 ~vtkBrush(); 00138 00139 // Storage of the color in RGBA format (0-255 per channel). 00140 unsigned char* Color; 00141 vtkColor4ub BrushColor; 00142 vtkImageData* Texture; 00143 int TextureProperties; 00144 00145 private: 00146 vtkBrush(const vtkBrush &); // Not implemented. 00147 void operator=(const vtkBrush &); // Not implemented. 00148 //ETX 00149 }; 00150 00151 #endif //__vtkBrush_h