VTK  9.3.20240327
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 
85 VTK_ABI_NAMESPACE_BEGIN
86 class vtkImageData;
87 
88 class VTKRENDERINGCONTEXT2D_EXPORT vtkBrush : public vtkObject
89 {
90 public:
91  vtkTypeMacro(vtkBrush, vtkObject);
92  void PrintSelf(ostream& os, vtkIndent indent) override;
93 
94  static vtkBrush* New();
95 
100  void SetColorF(double color[3]);
101 
106  void SetColorF(double r, double g, double b);
107 
112  void SetColorF(double r, double g, double b, double a);
113 
118  void SetOpacityF(double a);
119 
123  double GetOpacityF();
124 
129  void SetColor(unsigned char color[3]);
130 
135  void SetColor(unsigned char r, unsigned char g, unsigned char b);
136 
138 
142  void SetColor(unsigned char r, unsigned char g, unsigned char b, unsigned char a);
143  void SetColor(const vtkColor4ub& color);
145 
150  void SetOpacity(unsigned char a);
151 
155  unsigned char GetOpacity();
156 
160  void GetColorF(double color[4]);
161 
165  void GetColor(unsigned char color[4]);
166 
170  unsigned char* GetColor() { return &this->Color[0]; }
171 
176 
184 
186 
189  vtkGetObjectMacro(Texture, vtkImageData);
191 
196  {
197  Nearest = 0x01,
198  Linear = 0x02,
199  Stretch = 0x04,
200  Repeat = 0x08
201  };
202 
204 
211  vtkSetMacro(TextureProperties, int);
213 
215 
218  vtkGetMacro(TextureProperties, int);
220 
224  void DeepCopy(vtkBrush* brush);
225 
226 protected:
228  ~vtkBrush() override;
229 
230  // Storage of the color in RGBA format (0-255 per channel).
231  unsigned char* Color;
235 
236 private:
237  vtkBrush(const vtkBrush&) = delete;
238  void operator=(const vtkBrush&) = delete;
239 };
240 
241 VTK_ABI_NAMESPACE_END
242 #endif // vtkBrush_h
provides a brush that fills shapes drawn by vtkContext2D.
Definition: vtkBrush.h:89
void SetTexture(vtkImageData *image)
Set the texture that will be used to fill polygons By default, no texture is set.
void GetColor(unsigned char color[4])
Get the color of the brush - expects an unsigned char of length 4.
static vtkBrush * New()
vtkColor4ub GetColorObject()
Get the color of the brush.
void SetColorF(double r, double g, double b)
Set the color of the brush with three component doubles (RGB), ranging from 0.0 to 1....
int TextureProperties
Definition: vtkBrush.h:234
vtkColor4ub BrushColor
Definition: vtkBrush.h:232
void SetColor(unsigned char r, unsigned char g, unsigned char b, unsigned char a)
Set the color of the brush with four component unsigned chars (RGBA), ranging from 0 to 255.
void SetColor(unsigned char r, unsigned char g, unsigned char b)
Set the color of the brush with three component unsigned chars (RGB), ranging from 0 to 255.
unsigned char * Color
Definition: vtkBrush.h:231
void SetOpacity(unsigned char a)
Set the opacity with an unsigned char, ranging from 0 (transparent) to 255 (opaque).
~vtkBrush() override
unsigned char * GetColor()
Get the color of the brush - gives a pointer to the underlying data.
Definition: vtkBrush.h:170
void SetOpacityF(double a)
Set the opacity with a double, ranging from 0.0 (transparent) to 1.0 (opaque).
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
unsigned char GetOpacity()
Get the opacity ranging from 0 (transparent) to 255(opaque).
void SetColor(unsigned char color[3])
Set the color of the brush with three component unsigned chars (RGB), ranging from 0 to 255.
void SetColorF(double r, double g, double b, double a)
Set the color of the brush with four component doubles (RGBA), ranging from 0.0 to 1....
TextureProperty
Texture properties.
Definition: vtkBrush.h:196
double GetOpacityF()
Get the opacity ranging from 0.0 (transparent) to 1.0(opaque).
void SetColorF(double color[3])
Set the color of the brush with three component doubles (RGB), ranging from 0.0 to 1....
void DeepCopy(vtkBrush *brush)
Make a deep copy of the supplied brush.
void GetColorF(double color[4])
Get the color of the brush - expects a double of length 4 to copy into.
vtkImageData * Texture
Definition: vtkBrush.h:233
void SetColor(const vtkColor4ub &color)
Set the color of the brush with four component unsigned chars (RGBA), ranging from 0 to 255.
topologically and geometrically regular array of data
Definition: vtkImageData.h:155
a simple class to control print indentation
Definition: vtkIndent.h:108
abstract base class for most VTK objects
Definition: vtkObject.h:161
@ Color
Definition: vtkX3D.h:46
@ color
Definition: vtkX3D.h:221
@ image
Definition: vtkX3D.h:374