VTK  9.4.20250202
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
69#ifndef vtkPen_h
70#define vtkPen_h
71
72#include "vtkColor.h" // Needed for vtkColor4ub
73#include "vtkObject.h"
74#include "vtkRenderingContext2DModule.h" // For export macro
75#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
76
77VTK_ABI_NAMESPACE_BEGIN
78class VTKRENDERINGCONTEXT2D_EXPORT VTK_MARSHALAUTO vtkPen : public vtkObject
79{
80public:
81 vtkTypeMacro(vtkPen, vtkObject);
82 void PrintSelf(ostream& os, vtkIndent indent) override;
83
84 static vtkPen* New();
85
89 enum
90 {
97 DENSE_DOT_LINE
98 };
99
103 void SetLineType(int type);
104
109
115 void SetColorF(double color[3]);
116
122 void SetColorF(double r, double g, double b);
123
129 void SetColorF(double r, double g, double b, double a);
130
136 void SetOpacityF(double a);
137
142 void SetColor(unsigned char color[3]);
143
148 void SetColor(unsigned char r, unsigned char g, unsigned char b);
149
151
156 void SetColor(unsigned char r, unsigned char g, unsigned char b, unsigned char a);
157 void SetColor(const vtkColor4ub& color);
159
164 void SetOpacity(unsigned char a);
165
170 void GetColorF(double color[3]);
171
175 void GetColor(unsigned char color[3]);
176
180 vtkColor4ub GetColorObject();
181
186 unsigned char GetOpacity();
187
192 unsigned char* GetColor() { return this->Color; }
193
195
198 vtkSetMacro(Width, float);
199 vtkGetMacro(Width, float);
201
205 void DeepCopy(vtkPen* pen);
206
207protected:
209 ~vtkPen() override;
210
212
215 unsigned char* Color;
218
222 float Width;
223
228
229private:
230 vtkPen(const vtkPen&) = delete;
231 void operator=(const vtkPen&) = delete;
232};
233
234VTK_ABI_NAMESPACE_END
235#endif // vtkPen_h
a simple class to control print indentation
Definition vtkIndent.h:108
abstract base class for most VTK objects
Definition vtkObject.h:162
provides a pen that draws the outlines of shapes drawn by vtkContext2D.
Definition vtkPen.h:79
~vtkPen() override
float Width
Store the width of the pen in pixels.
Definition vtkPen.h:222
unsigned char * Color
Storage of the color in RGBA format (0-255 per channel).
Definition vtkPen.h:215
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:216
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:227
void DeepCopy(vtkPen *pen)
Make a deep copy of the supplied pen.
@ DASH_LINE
Definition vtkPen.h:93
@ SOLID_LINE
Definition vtkPen.h:92
@ NO_PEN
Definition vtkPen.h:91
@ DOT_LINE
Definition vtkPen.h:94
@ DASH_DOT_DOT_LINE
Definition vtkPen.h:96
@ DASH_DOT_LINE
Definition vtkPen.h:95
static vtkPen * New()
int GetLineType()
Get the type of line that the pen will draw.
#define VTK_MARSHAL_EXCLUDE_REASON_IS_REDUNDANT
#define VTK_MARSHALAUTO
#define VTK_MARSHALEXCLUDE(reason)