VTK  9.7.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 #include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
26 
27 VTK_ABI_NAMESPACE_BEGIN
28 class vtkImageData;
29 
30 class VTKRENDERINGCONTEXT2D_EXPORT VTK_MARSHALAUTO vtkBrush : public vtkObject
31 {
32 public:
33  vtkTypeMacro(vtkBrush, vtkObject);
34  void PrintSelf(ostream& os, vtkIndent indent) override;
35 
36  static vtkBrush* New();
37 
43  void SetColorF(double color[3]);
44 
50  void SetColorF(double r, double g, double b);
51 
57  void SetColorF(double r, double g, double b, double a);
58 
64  void SetOpacityF(double a);
65 
70  double GetOpacityF();
71 
76  void SetColor(unsigned char color[3]);
77 
82  void SetColor(unsigned char r, unsigned char g, unsigned char b);
83 
85 
90  void SetColor(unsigned char r, unsigned char g, unsigned char b, unsigned char a);
91  void SetColor(const vtkColor4ub& color);
93 
98  void SetOpacity(unsigned char a);
99 
103  unsigned char GetOpacity();
104 
109  void GetColorF(double color[4]);
110 
114  void GetColor(unsigned char color[4]);
115 
120  unsigned char* GetColor() { return &this->Color[0]; }
121 
125  vtkColor4ub GetColorObject();
126 
133  void SetTexture(vtkImageData* image);
134 
136 
139  vtkGetObjectMacro(Texture, vtkImageData);
141 
146  {
147  Nearest = 0x01,
148  Linear = 0x02,
149  Stretch = 0x04,
150  Repeat = 0x08
151  };
152 
154 
161  vtkSetMacro(TextureProperties, int);
163 
165 
168  vtkGetMacro(TextureProperties, int);
170 
174  void DeepCopy(vtkBrush* brush);
175 
176 protected:
177  vtkBrush();
178  ~vtkBrush() override;
179 
180  // Storage of the color in RGBA format (0-255 per channel).
181  unsigned char* Color;
185 
186 private:
187  vtkBrush(const vtkBrush&) = delete;
188  void operator=(const vtkBrush&) = delete;
189 };
190 
191 VTK_ABI_NAMESPACE_END
192 #endif // vtkBrush_h
abstract base class for most VTK objects
Definition: vtkObject.h:52
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
#define VTK_MARSHAL_EXCLUDE_REASON_IS_REDUNDANT
provides a brush that fills shapes drawn by vtkContext2D.
Definition: vtkBrush.h:30
a simple class to control print indentation
Definition: vtkIndent.h:28
vtkColor4ub BrushColor
Definition: vtkBrush.h:182
topologically and geometrically regular array of data
Definition: vtkImageData.h:45
#define VTK_MARSHALEXCLUDE(reason)
TextureProperty
Texture properties.
Definition: vtkBrush.h:145
#define VTK_MARSHALAUTO
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
vtkImageData * Texture
Definition: vtkBrush.h:183
int TextureProperties
Definition: vtkBrush.h:184
unsigned char * Color
Definition: vtkBrush.h:181