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 "vtkRenderingContext2DModule.h" // For export macro 00031 #include "vtkObject.h" 00032 #include "vtkColor.h" // Needed for vtkColor4ub 00033 00034 class vtkImageData; 00035 00036 class VTKRENDERINGCONTEXT2D_EXPORT vtkBrush : public vtkObject 00037 { 00038 public: 00039 vtkTypeMacro(vtkBrush, vtkObject); 00040 virtual void PrintSelf(ostream &os, vtkIndent indent); 00041 00042 static vtkBrush *New(); 00043 00046 void SetColorF(double color[3]); 00047 00050 void SetColorF(double r, double g, double b); 00051 00054 void SetColorF(double r, double g, double b, double a); 00055 00058 void SetOpacityF(double a); 00059 00061 double GetOpacityF(); 00062 00065 void SetColor(unsigned char color[3]); 00066 00069 void SetColor(unsigned char r, unsigned char g, unsigned char b); 00070 00072 00074 void SetColor(unsigned char r, unsigned char g, unsigned char b, 00075 unsigned char a); 00076 void SetColor(const vtkColor4ub &color); 00078 00081 void SetOpacity(unsigned char a); 00082 00084 unsigned char GetOpacity(); 00085 00088 void GetColorF(double color[4]); 00089 00091 void GetColor(unsigned char color[4]); 00092 00094 unsigned char * GetColor() { return &this->Color[0]; } 00095 00097 vtkColor4ub GetColorObject(); 00098 00102 void SetTexture(vtkImageData* image); 00103 00105 00106 vtkGetObjectMacro(Texture, vtkImageData); 00108 00110 00111 enum TextureProperty { 00112 Nearest = 0x01, 00113 Linear = 0x02, 00114 Stretch = 0x04, 00115 Repeat = 0x08 00116 }; 00118 00120 00124 vtkSetMacro(TextureProperties, int); 00126 00128 00129 vtkGetMacro(TextureProperties, int); 00131 00133 void DeepCopy(vtkBrush *brush); 00134 00135 //BTX 00136 protected: 00137 vtkBrush(); 00138 ~vtkBrush(); 00139 00140 // Storage of the color in RGBA format (0-255 per channel). 00141 unsigned char* Color; 00142 vtkColor4ub BrushColor; 00143 vtkImageData* Texture; 00144 int TextureProperties; 00145 00146 private: 00147 vtkBrush(const vtkBrush &); // Not implemented. 00148 void operator=(const vtkBrush &); // Not implemented. 00149 //ETX 00150 }; 00151 00152 #endif //__vtkBrush_h