VTK  9.3.1
vtkBrush.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
3 
19 #ifndef vtkBrush_h
20 #define vtkBrush_h
21 
22 #include "vtkColor.h" // Needed for vtkColor4ub
23 #include "vtkObject.h"
24 #include "vtkRenderingContext2DModule.h" // For export macro
25 
26 VTK_ABI_NAMESPACE_BEGIN
27 class vtkImageData;
28 
29 class VTKRENDERINGCONTEXT2D_EXPORT vtkBrush : public vtkObject
30 {
31 public:
32  vtkTypeMacro(vtkBrush, vtkObject);
33  void PrintSelf(ostream& os, vtkIndent indent) override;
34 
35  static vtkBrush* New();
36 
41  void SetColorF(double color[3]);
42 
47  void SetColorF(double r, double g, double b);
48 
53  void SetColorF(double r, double g, double b, double a);
54 
59  void SetOpacityF(double a);
60 
64  double GetOpacityF();
65 
70  void SetColor(unsigned char color[3]);
71 
76  void SetColor(unsigned char r, unsigned char g, unsigned char b);
77 
79 
83  void SetColor(unsigned char r, unsigned char g, unsigned char b, unsigned char a);
84  void SetColor(const vtkColor4ub& color);
86 
91  void SetOpacity(unsigned char a);
92 
96  unsigned char GetOpacity();
97 
101  void GetColorF(double color[4]);
102 
106  void GetColor(unsigned char color[4]);
107 
111  unsigned char* GetColor() { return &this->Color[0]; }
112 
116  vtkColor4ub GetColorObject();
117 
124  void SetTexture(vtkImageData* image);
125 
127 
130  vtkGetObjectMacro(Texture, vtkImageData);
132 
137  {
138  Nearest = 0x01,
139  Linear = 0x02,
140  Stretch = 0x04,
141  Repeat = 0x08
142  };
143 
145 
152  vtkSetMacro(TextureProperties, int);
154 
156 
159  vtkGetMacro(TextureProperties, int);
161 
165  void DeepCopy(vtkBrush* brush);
166 
167 protected:
168  vtkBrush();
169  ~vtkBrush() override;
170 
171  // Storage of the color in RGBA format (0-255 per channel).
172  unsigned char* Color;
176 
177 private:
178  vtkBrush(const vtkBrush&) = delete;
179  void operator=(const vtkBrush&) = delete;
180 };
181 
182 VTK_ABI_NAMESPACE_END
183 #endif // vtkBrush_h
abstract base class for most VTK objects
Definition: vtkObject.h:51
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:111
provides a brush that fills shapes drawn by vtkContext2D.
Definition: vtkBrush.h:29
a simple class to control print indentation
Definition: vtkIndent.h:28
vtkColor4ub BrushColor
Definition: vtkBrush.h:173
topologically and geometrically regular array of data
Definition: vtkImageData.h:42
TextureProperty
Texture properties.
Definition: vtkBrush.h:136
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
vtkImageData * Texture
Definition: vtkBrush.h:174
int TextureProperties
Definition: vtkBrush.h:175
unsigned char * Color
Definition: vtkBrush.h:172