VTK  9.1.0
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 
87 #ifndef vtkBrush_h
88 #define vtkBrush_h
89 
90 #include "vtkColor.h" // Needed for vtkColor4ub
91 #include "vtkObject.h"
92 #include "vtkRenderingContext2DModule.h" // For export macro
93 
94 class vtkImageData;
95 
96 class VTKRENDERINGCONTEXT2D_EXPORT vtkBrush : public vtkObject
97 {
98 public:
99  vtkTypeMacro(vtkBrush, vtkObject);
100  void PrintSelf(ostream& os, vtkIndent indent) override;
101 
102  static vtkBrush* New();
103 
108  void SetColorF(double color[3]);
109 
114  void SetColorF(double r, double g, double b);
115 
120  void SetColorF(double r, double g, double b, double a);
121 
126  void SetOpacityF(double a);
127 
131  double GetOpacityF();
132 
137  void SetColor(unsigned char color[3]);
138 
143  void SetColor(unsigned char r, unsigned char g, unsigned char b);
144 
146 
150  void SetColor(unsigned char r, unsigned char g, unsigned char b, unsigned char a);
151  void SetColor(const vtkColor4ub& color);
153 
158  void SetOpacity(unsigned char a);
159 
163  unsigned char GetOpacity();
164 
168  void GetColorF(double color[4]);
169 
173  void GetColor(unsigned char color[4]);
174 
178  unsigned char* GetColor() { return &this->Color[0]; }
179 
184 
192 
194 
197  vtkGetObjectMacro(Texture, vtkImageData);
199 
204  {
205  Nearest = 0x01,
206  Linear = 0x02,
207  Stretch = 0x04,
208  Repeat = 0x08
209  };
210 
212 
219  vtkSetMacro(TextureProperties, int);
221 
223 
226  vtkGetMacro(TextureProperties, int);
228 
232  void DeepCopy(vtkBrush* brush);
233 
234 protected:
236  ~vtkBrush() override;
237 
238  // Storage of the color in RGBA format (0-255 per channel).
239  unsigned char* Color;
243 
244 private:
245  vtkBrush(const vtkBrush&) = delete;
246  void operator=(const vtkBrush&) = delete;
247 };
248 
249 #endif // vtkBrush_h
vtkBrush
provides a brush that fills shapes drawn by vtkContext2D.
Definition: vtkBrush.h:97
vtkBrush::Texture
vtkImageData * Texture
Definition: vtkBrush.h:241
vtkBrush::SetColorF
void SetColorF(double color[3])
Set the color of the brush with three component doubles (RGB), ranging from 0.0 to 1....
vtkBrush::TextureProperties
int TextureProperties
Definition: vtkBrush.h:242
vtkBrush::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkBrush::GetColor
unsigned char * GetColor()
Get the color of the brush - gives a pointer to the underlying data.
Definition: vtkBrush.h:178
vtkX3D::image
@ image
Definition: vtkX3D.h:380
vtkX3D::Color
@ Color
Definition: vtkX3D.h:52
vtkBrush::GetOpacity
unsigned char GetOpacity()
Get the opacity ranging from 0 (transparent) to 255(opaque).
vtkBrush::SetColor
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.
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:82
vtkBrush::New
static vtkBrush * New()
vtkBrush::~vtkBrush
~vtkBrush() override
vtkBrush::Color
unsigned char * Color
Definition: vtkBrush.h:239
vtkBrush::SetOpacity
void SetOpacity(unsigned char a)
Set the opacity with an unsigned char, ranging from 0 (transparent) to 255 (opaque).
vtkBrush::SetColor
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.
vtkBrush::SetColor
void SetColor(unsigned char color[3])
Set the color of the brush with three component unsigned chars (RGB), ranging from 0 to 255.
vtkBrush::SetColorF
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....
vtkBrush::SetOpacityF
void SetOpacityF(double a)
Set the opacity with a double, ranging from 0.0 (transparent) to 1.0 (opaque).
vtkBrush::BrushColor
vtkColor4ub BrushColor
Definition: vtkBrush.h:240
vtkBrush::GetOpacityF
double GetOpacityF()
Get the opacity ranging from 0.0 (transparent) to 1.0(opaque).
vtkX3D::color
@ color
Definition: vtkX3D.h:227
vtkBrush::GetColorF
void GetColorF(double color[4])
Get the color of the brush - expects a double of length 4 to copy into.
vtkBrush::SetColorF
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....
vtkBrush::GetColor
void GetColor(unsigned char color[4])
Get the color of the brush - expects an unsigned char of length 4.
vtkColor.h
vtkImageData
topologically and geometrically regular array of data
Definition: vtkImageData.h:157
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:113
vtkObject.h
vtkBrush::SetColor
void SetColor(const vtkColor4ub &color)
Set the color of the brush with four component unsigned chars (RGBA), ranging from 0 to 255.
vtkBrush::vtkBrush
vtkBrush()
vtkColor4ub
Definition: vtkColor.h:374
vtkBrush::GetColorObject
vtkColor4ub GetColorObject()
Get the color of the brush.
vtkBrush::TextureProperty
TextureProperty
Texture properties.
Definition: vtkBrush.h:204
vtkBrush::SetTexture
void SetTexture(vtkImageData *image)
Set the texture that will be used to fill polygons By default, no texture is set.
vtkBrush::DeepCopy
void DeepCopy(vtkBrush *brush)
Make a deep copy of the supplied brush.