VTK  9.4.20250123
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
78#ifndef vtkBrush_h
79#define vtkBrush_h
80
81#include "vtkColor.h" // Needed for vtkColor4ub
82#include "vtkObject.h"
83#include "vtkRenderingContext2DModule.h" // For export macro
84#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
85
86VTK_ABI_NAMESPACE_BEGIN
87class vtkImageData;
88
89class VTKRENDERINGCONTEXT2D_EXPORT VTK_MARSHALAUTO vtkBrush : public vtkObject
90{
91public:
92 vtkTypeMacro(vtkBrush, vtkObject);
93 void PrintSelf(ostream& os, vtkIndent indent) override;
94
95 static vtkBrush* New();
96
102 void SetColorF(double color[3]);
103
109 void SetColorF(double r, double g, double b);
110
116 void SetColorF(double r, double g, double b, double a);
117
123 void SetOpacityF(double a);
124
129 double GetOpacityF();
130
135 void SetColor(unsigned char color[3]);
136
141 void SetColor(unsigned char r, unsigned char g, unsigned char b);
142
144
149 void SetColor(unsigned char r, unsigned char g, unsigned char b, unsigned char a);
150 void SetColor(const vtkColor4ub& color);
152
157 void SetOpacity(unsigned char a);
158
162 unsigned char GetOpacity();
163
168 void GetColorF(double color[4]);
169
173 void GetColor(unsigned char color[4]);
174
179 unsigned char* GetColor() { return &this->Color[0]; }
180
185
193
195
198 vtkGetObjectMacro(Texture, vtkImageData);
200
205 {
206 Nearest = 0x01,
207 Linear = 0x02,
208 Stretch = 0x04,
209 Repeat = 0x08
210 };
211
213
220 vtkSetMacro(TextureProperties, int);
222
224
227 vtkGetMacro(TextureProperties, int);
229
233 void DeepCopy(vtkBrush* brush);
234
235protected:
237 ~vtkBrush() override;
238
239 // Storage of the color in RGBA format (0-255 per channel).
240 unsigned char* Color;
244
245private:
246 vtkBrush(const vtkBrush&) = delete;
247 void operator=(const vtkBrush&) = delete;
248};
249
250VTK_ABI_NAMESPACE_END
251#endif // vtkBrush_h
provides a brush that fills shapes drawn by vtkContext2D.
Definition vtkBrush.h:90
void SetTexture(vtkImageData *image)
Set the texture that will be used to fill polygons By default, no texture is set.
static vtkBrush * New()
vtkColor4ub GetColorObject()
Get the color of the brush.
int TextureProperties
Definition vtkBrush.h:243
vtkColor4ub BrushColor
Definition vtkBrush.h:241
unsigned char * Color
Definition vtkBrush.h:240
~vtkBrush() override
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
TextureProperty
Texture properties.
Definition vtkBrush.h:205
void DeepCopy(vtkBrush *brush)
Make a deep copy of the supplied brush.
vtkImageData * Texture
Definition vtkBrush.h:242
topologically and geometrically regular array of data
a simple class to control print indentation
Definition vtkIndent.h:108
abstract base class for most VTK objects
Definition vtkObject.h:162
#define VTK_MARSHAL_EXCLUDE_REASON_IS_REDUNDANT
#define VTK_MARSHALAUTO
#define VTK_MARSHALEXCLUDE(reason)