VTK  9.2.6
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 
90 #ifndef vtkBrush_h
91 #define vtkBrush_h
92 
93 #include "vtkColor.h" // Needed for vtkColor4ub
94 #include "vtkObject.h"
95 #include "vtkRenderingContext2DModule.h" // For export macro
96 
97 class vtkImageData;
98 
99 class VTKRENDERINGCONTEXT2D_EXPORT vtkBrush : public vtkObject
100 {
101 public:
102  vtkTypeMacro(vtkBrush, vtkObject);
103  void PrintSelf(ostream& os, vtkIndent indent) override;
104 
105  static vtkBrush* New();
106 
111  void SetColorF(double color[3]);
112 
117  void SetColorF(double r, double g, double b);
118 
123  void SetColorF(double r, double g, double b, double a);
124 
129  void SetOpacityF(double a);
130 
134  double GetOpacityF();
135 
140  void SetColor(unsigned char color[3]);
141 
146  void SetColor(unsigned char r, unsigned char g, unsigned char b);
147 
149 
153  void SetColor(unsigned char r, unsigned char g, unsigned char b, unsigned char a);
154  void SetColor(const vtkColor4ub& color);
156 
161  void SetOpacity(unsigned char a);
162 
166  unsigned char GetOpacity();
167 
171  void GetColorF(double color[4]);
172 
176  void GetColor(unsigned char color[4]);
177 
181  unsigned char* GetColor() { return &this->Color[0]; }
182 
187 
195 
197 
200  vtkGetObjectMacro(Texture, vtkImageData);
202 
207  {
208  Nearest = 0x01,
209  Linear = 0x02,
210  Stretch = 0x04,
211  Repeat = 0x08
212  };
213 
215 
222  vtkSetMacro(TextureProperties, int);
224 
226 
229  vtkGetMacro(TextureProperties, int);
231 
235  void DeepCopy(vtkBrush* brush);
236 
237 protected:
239  ~vtkBrush() override;
240 
241  // Storage of the color in RGBA format (0-255 per channel).
242  unsigned char* Color;
246 
247 private:
248  vtkBrush(const vtkBrush&) = delete;
249  void operator=(const vtkBrush&) = delete;
250 };
251 
252 #endif // vtkBrush_h
provides a brush that fills shapes drawn by vtkContext2D.
Definition: vtkBrush.h:100
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:245
vtkColor4ub BrushColor
Definition: vtkBrush.h:243
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:242
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:181
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:207
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:244
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:163
a simple class to control print indentation
Definition: vtkIndent.h:119
abstract base class for most VTK objects
Definition: vtkObject.h:82
@ Color
Definition: vtkX3D.h:52
@ color
Definition: vtkX3D.h:227
@ image
Definition: vtkX3D.h:380