VTK  9.4.20251203
vtkPen.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-License-Identifier: BSD-3-Clause
3
20#ifndef vtkPen_h
21#define vtkPen_h
22
23#include "vtkColor.h" // Needed for vtkColor4ub
24#include "vtkObject.h"
25#include "vtkRenderingContext2DModule.h" // For export macro
26#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
27
28VTK_ABI_NAMESPACE_BEGIN
29class VTKRENDERINGCONTEXT2D_EXPORT VTK_MARSHALAUTO vtkPen : public vtkObject
30{
31public:
32 vtkTypeMacro(vtkPen, vtkObject);
33 void PrintSelf(ostream& os, vtkIndent indent) override;
34
35 static vtkPen* New();
36
40 enum
41 {
48 DENSE_DOT_LINE
49 };
50
54 void SetLineType(int type);
55
60
66 void SetColorF(double color[3]);
67
73 void SetColorF(double r, double g, double b);
74
80 void SetColorF(double r, double g, double b, double a);
81
87 void SetOpacityF(double a);
88
93 void SetColor(unsigned char color[3]);
94
99 void SetColor(unsigned char r, unsigned char g, unsigned char b);
100
102
107 void SetColor(unsigned char r, unsigned char g, unsigned char b, unsigned char a);
108 void SetColor(const vtkColor4ub& color);
110
115 void SetOpacity(unsigned char a);
116
121 void GetColorF(double color[3]);
122
126 void GetColor(unsigned char color[3]);
127
131 vtkColor4ub GetColorObject();
132
137 unsigned char GetOpacity();
138
143 unsigned char* GetColor() { return this->Color; }
144
146
149 vtkSetMacro(Width, float);
150 vtkGetMacro(Width, float);
152
156 void DeepCopy(vtkPen* pen);
157
158protected:
160 ~vtkPen() override;
161
163
166 unsigned char* Color;
169
173 float Width;
174
179
180private:
181 vtkPen(const vtkPen&) = delete;
182 void operator=(const vtkPen&) = delete;
183};
184
185VTK_ABI_NAMESPACE_END
186#endif // vtkPen_h
a simple class to control print indentation
Definition vtkIndent.h:29
abstract base class for most VTK objects
Definition vtkObject.h:53
provides a pen that draws the outlines of shapes drawn by vtkContext2D.
Definition vtkPen.h:30
~vtkPen() override
float Width
Store the width of the pen in pixels.
Definition vtkPen.h:173
unsigned char * Color
Storage of the color in RGBA format (0-255 per channel).
Definition vtkPen.h:166
void SetLineType(int type)
Set the type of line that the pen should draw.
vtkColor4ub PenColor
Storage of the color in RGBA format (0-255 per channel).
Definition vtkPen.h:167
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
int LineType
The type of line to be drawn with this pen.
Definition vtkPen.h:178
void DeepCopy(vtkPen *pen)
Make a deep copy of the supplied pen.
static vtkPen * New()
int GetLineType()
Get the type of line that the pen will draw.
@ DASH_LINE
Definition vtkPen.h:44
@ SOLID_LINE
Definition vtkPen.h:43
@ NO_PEN
Definition vtkPen.h:42
@ DOT_LINE
Definition vtkPen.h:45
@ DASH_DOT_DOT_LINE
Definition vtkPen.h:47
@ DASH_DOT_LINE
Definition vtkPen.h:46
#define VTK_MARSHAL_EXCLUDE_REASON_IS_REDUNDANT
#define VTK_MARSHALAUTO
#define VTK_MARSHALEXCLUDE(reason)