VTK  9.0.20200809
vtkPen.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkPen.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 
29 #ifndef vtkPen_h
30 #define vtkPen_h
31 
32 #include "vtkColor.h" // Needed for vtkColor4ub
33 #include "vtkObject.h"
34 #include "vtkRenderingContext2DModule.h" // For export macro
35 
36 class VTKRENDERINGCONTEXT2D_EXPORT vtkPen : public vtkObject
37 {
38 public:
39  vtkTypeMacro(vtkPen, vtkObject);
40  void PrintSelf(ostream& os, vtkIndent indent) override;
41 
42  static vtkPen* New();
43 
47  enum
48  {
55  DENSE_DOT_LINE
56  };
57 
61  void SetLineType(int type);
62 
66  int GetLineType();
67 
72  void SetColorF(double color[3]);
73 
78  void SetColorF(double r, double g, double b);
79 
84  void SetColorF(double r, double g, double b, double a);
85 
90  void SetOpacityF(double a);
91 
96  void SetColor(unsigned char color[3]);
97 
102  void SetColor(unsigned char r, unsigned char g, unsigned char b);
103 
105 
109  void SetColor(unsigned char r, unsigned char g, unsigned char b, unsigned char a);
110  void SetColor(const vtkColor4ub& color);
112 
117  void SetOpacity(unsigned char a);
118 
122  void GetColorF(double color[3]);
123 
127  void GetColor(unsigned char color[3]);
128 
132  vtkColor4ub GetColorObject();
133 
138  unsigned char GetOpacity();
139 
143  unsigned char* GetColor() { return this->Color; }
144 
146 
149  vtkSetMacro(Width, float);
150  vtkGetMacro(Width, float);
152 
156  void DeepCopy(vtkPen* pen);
157 
158 protected:
159  vtkPen();
160  ~vtkPen() override;
161 
163 
166  unsigned char* Color;
169 
173  float Width;
174 
178  int LineType;
179 
180 private:
181  vtkPen(const vtkPen&) = delete;
182  void operator=(const vtkPen&) = delete;
183 };
184 
185 #endif // vtkPen_h
vtkPen::Width
float Width
Store the width of the pen in pixels.
Definition: vtkPen.h:173
vtkPen::LineType
int LineType
The type of line to be drawn with this pen.
Definition: vtkPen.h:178
vtkX3D::type
Definition: vtkX3D.h:522
vtkObject::New
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
vtkX3D::Color
Definition: vtkX3D.h:52
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:62
vtkPen::PenColor
vtkColor4ub PenColor
Definition: vtkPen.h:167
vtkPen::DASH_DOT_LINE
Definition: vtkPen.h:53
vtkPen::DASH_DOT_DOT_LINE
Definition: vtkPen.h:54
vtkPen::DASH_LINE
Definition: vtkPen.h:51
vtkX3D::color
Definition: vtkX3D.h:227
vtkColor.h
vtkPen::GetColor
unsigned char * GetColor()
Get the color of the brush - gives a pointer to the underlying data.
Definition: vtkPen.h:143
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkObject::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkPen::DOT_LINE
Definition: vtkPen.h:52
vtkPen::SOLID_LINE
Definition: vtkPen.h:50
vtkObject.h
vtkPen::Color
unsigned char * Color
Storage of the color in RGBA format (0-255 per channel).
Definition: vtkPen.h:166
vtkPen::NO_PEN
Definition: vtkPen.h:49
vtkColor4ub
Definition: vtkColor.h:264
vtkPen
provides a pen that draws the outlines of shapes drawn by vtkContext2D.
Definition: vtkPen.h:36