VTK
vtkBrush.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkBrush.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
15 
31 #ifndef vtkBrush_h
32 #define vtkBrush_h
33 
34 #include "vtkRenderingContext2DModule.h" // For export macro
35 #include "vtkObject.h"
36 #include "vtkColor.h" // Needed for vtkColor4ub
37 
38 class vtkImageData;
39 
40 class VTKRENDERINGCONTEXT2D_EXPORT vtkBrush : public vtkObject
41 {
42 public:
43  vtkTypeMacro(vtkBrush, vtkObject);
44  void PrintSelf(ostream &os, vtkIndent indent) override;
45 
46  static vtkBrush *New();
47 
52  void SetColorF(double color[3]);
53 
58  void SetColorF(double r, double g, double b);
59 
64  void SetColorF(double r, double g, double b, double a);
65 
70  void SetOpacityF(double a);
71 
75  double GetOpacityF();
76 
81  void SetColor(unsigned char color[3]);
82 
87  void SetColor(unsigned char r, unsigned char g, unsigned char b);
88 
90 
94  void SetColor(unsigned char r, unsigned char g, unsigned char b,
95  unsigned char a);
96  void SetColor(const vtkColor4ub &color);
98 
103  void SetOpacity(unsigned char a);
104 
108  unsigned char GetOpacity();
109 
113  void GetColorF(double color[4]);
114 
118  void GetColor(unsigned char color[4]);
119 
123  unsigned char * GetColor() { return &this->Color[0]; }
124 
128  vtkColor4ub GetColorObject();
129 
136  void SetTexture(vtkImageData* image);
137 
139 
142  vtkGetObjectMacro(Texture, vtkImageData);
144 
149  Nearest = 0x01,
150  Linear = 0x02,
151  Stretch = 0x04,
152  Repeat = 0x08
153  };
154 
156 
163  vtkSetMacro(TextureProperties, int);
165 
167 
170  vtkGetMacro(TextureProperties, int);
172 
176  void DeepCopy(vtkBrush *brush);
177 
178 protected:
179  vtkBrush();
180  ~vtkBrush() override;
181 
182  // Storage of the color in RGBA format (0-255 per channel).
183  unsigned char* Color;
187 
188 private:
189  vtkBrush(const vtkBrush &) = delete;
190  void operator=(const vtkBrush &) = delete;
191 
192 };
193 
194 #endif //vtkBrush_h
abstract base class for most VTK objects
Definition: vtkObject.h:59
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
unsigned char * GetColor()
Get the color of the brush - gives a pointer to the underlying data.
Definition: vtkBrush.h:123
provides a brush that fills shapes drawn by vtkContext2D.
Definition: vtkBrush.h:40
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkColor4ub BrushColor
Definition: vtkBrush.h:184
topologically and geometrically regular array of data
Definition: vtkImageData.h:45
TextureProperty
Texture properties.
Definition: vtkBrush.h:148
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
vtkImageData * Texture
Definition: vtkBrush.h:185
int TextureProperties
Definition: vtkBrush.h:186
unsigned char * Color
Definition: vtkBrush.h:183