VTK
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 
27 #ifndef vtkBrush_h
28 #define vtkBrush_h
29 
30 #include "vtkRenderingContext2DModule.h" // For export macro
31 #include "vtkObject.h"
32 #include "vtkColor.h" // Needed for vtkColor4ub
33 
34 class vtkImageData;
35 
37 {
38 public:
39  vtkTypeMacro(vtkBrush, vtkObject);
40  virtual void PrintSelf(ostream &os, vtkIndent indent);
41 
42  static vtkBrush *New();
43 
46  void SetColorF(double color[3]);
47 
50  void SetColorF(double r, double g, double b);
51 
54  void SetColorF(double r, double g, double b, double a);
55 
58  void SetOpacityF(double a);
59 
61  double GetOpacityF();
62 
65  void SetColor(unsigned char color[3]);
66 
69  void SetColor(unsigned char r, unsigned char g, unsigned char b);
70 
72 
74  void SetColor(unsigned char r, unsigned char g, unsigned char b,
75  unsigned char a);
76  void SetColor(const vtkColor4ub &color);
78 
81  void SetOpacity(unsigned char a);
82 
84  unsigned char GetOpacity();
85 
88  void GetColorF(double color[4]);
89 
91  void GetColor(unsigned char color[4]);
92 
94  unsigned char * GetColor() { return &this->Color[0]; }
95 
97  vtkColor4ub GetColorObject();
98 
102  void SetTexture(vtkImageData* image);
103 
105 
106  vtkGetObjectMacro(Texture, vtkImageData);
108 
110 
112  Nearest = 0x01,
113  Linear = 0x02,
114  Stretch = 0x04,
115  Repeat = 0x08
116  };
118 
120 
124  vtkSetMacro(TextureProperties, int);
126 
128 
129  vtkGetMacro(TextureProperties, int);
131 
133  void DeepCopy(vtkBrush *brush);
134 
135 //BTX
136 protected:
137  vtkBrush();
138  ~vtkBrush();
139 
140  // Storage of the color in RGBA format (0-255 per channel).
141  unsigned char* Color;
145 
146 private:
147  vtkBrush(const vtkBrush &); // Not implemented.
148  void operator=(const vtkBrush &); // Not implemented.
149 //ETX
150 };
151 
152 #endif //vtkBrush_h
abstract base class for most VTK objects
Definition: vtkObject.h:61
void DeepCopy(vtkPistonReference *self, vtkPistonReference *other)
unsigned char * GetColor()
Definition: vtkBrush.h:94
provides a brush that fills shapes drawn by vtkContext2D.
Definition: vtkBrush.h:36
virtual void PrintSelf(ostream &os, vtkIndent indent)
#define VTKRENDERINGCONTEXT2D_EXPORT
a simple class to control print indentation
Definition: vtkIndent.h:38
vtkColor4ub BrushColor
Definition: vtkBrush.h:142
topologically and geometrically regular array of data
Definition: vtkImageData.h:44
TextureProperty
Definition: vtkBrush.h:111
static vtkObject * New()
vtkImageData * Texture
Definition: vtkBrush.h:143
int TextureProperties
Definition: vtkBrush.h:144
unsigned char * Color
Definition: vtkBrush.h:141