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 "vtkObject.h"
31 #include "vtkColor.h" // Needed for vtkColor4ub
32 
33 class vtkImageData;
34 
36 {
37 public:
38  vtkTypeMacro(vtkBrush, vtkObject);
39  virtual void PrintSelf(ostream &os, vtkIndent indent);
40 
41  static vtkBrush *New();
42 
45  void SetColorF(double color[3]);
46 
49  void SetColorF(double r, double g, double b);
50 
53  void SetColorF(double r, double g, double b, double a);
54 
57  void SetOpacityF(double a);
58 
61  void SetColor(unsigned char color[3]);
62 
65  void SetColor(unsigned char r, unsigned char g, unsigned char b);
66 
68 
70  void SetColor(unsigned char r, unsigned char g, unsigned char b,
71  unsigned char a);
72  void SetColor(const vtkColor4ub &color);
74 
77  void SetOpacity(unsigned char a);
78 
81  void GetColorF(double color[4]);
82 
84  void GetColor(unsigned char color[4]);
85 
87  unsigned char * GetColor() { return &this->Color[0]; }
88 
90  vtkColor4ub GetColorObject();
91 
95  void SetTexture(vtkImageData* image);
96 
98 
99  vtkGetObjectMacro(Texture, vtkImageData);
101 
103 
105  Nearest = 0x01,
106  Linear = 0x02,
107  Stretch = 0x04,
108  Repeat = 0x08
109  };
111 
113 
117  vtkSetMacro(TextureProperties, int);
119 
121 
122  vtkGetMacro(TextureProperties, int);
124 
126  void DeepCopy(vtkBrush *brush);
127 
128 //BTX
129 protected:
130  vtkBrush();
131  ~vtkBrush();
132 
133  // Storage of the color in RGBA format (0-255 per channel).
134  unsigned char* Color;
138 
139 private:
140  vtkBrush(const vtkBrush &); // Not implemented.
141  void operator=(const vtkBrush &); // Not implemented.
142 //ETX
143 };
144 
145 #endif //__vtkBrush_h
#define VTK_CHARTS_EXPORT
abstract base class for most VTK objects
Definition: vtkObject.h:60
unsigned char * GetColor()
Definition: vtkBrush.h:87
provides a brush that fills shapes drawn by vtkContext2D.
Definition: vtkBrush.h:35
virtual void PrintSelf(ostream &os, vtkIndent indent)
a simple class to control print indentation
Definition: vtkIndent.h:37
vtkColor4ub BrushColor
Definition: vtkBrush.h:135
topologically and geometrically regular array of data
Definition: vtkImageData.h:43
TextureProperty
Definition: vtkBrush.h:104
static vtkObject * New()
vtkImageData * Texture
Definition: vtkBrush.h:136
int TextureProperties
Definition: vtkBrush.h:137
unsigned char * Color
Definition: vtkBrush.h:134