VTK
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 "vtkRenderingContext2DModule.h" // For export macro
33 #include "vtkObject.h"
34 #include "vtkColor.h" // Needed for vtkColor4ub
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 {
53  DASH_DOT_DOT_LINE};
54 
58  void SetLineType(int type);
59 
63  int GetLineType();
64 
69  void SetColorF(double color[3]);
70 
75  void SetColorF(double r, double g, double b);
76 
81  void SetColorF(double r, double g, double b, double a);
82 
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 
106  void SetColor(unsigned char r, unsigned char g, unsigned char b,
107  unsigned char a);
108  void SetColor(const vtkColor4ub &color);
110 
115  void SetOpacity(unsigned char a);
116 
120  void GetColorF(double color[3]);
121 
125  void GetColor(unsigned char color[3]);
126 
130  vtkColor4ub GetColorObject();
131 
136  unsigned char GetOpacity();
137 
141  unsigned char * GetColor() { return this->Color; }
142 
144 
147  vtkSetMacro(Width, float);
148  vtkGetMacro(Width, float);
150 
154  void DeepCopy(vtkPen *pen);
155 
156 protected:
157  vtkPen();
158  ~vtkPen() override;
159 
161 
164  unsigned char* Color;
167 
171  float Width;
172 
176  int LineType;
177 
178 private:
179  vtkPen(const vtkPen &) = delete;
180  void operator=(const vtkPen &) = delete;
181 
182 };
183 
184 #endif //vtkPen_h
vtkPen::Width
float Width
Store the width of the pen in pixels.
Definition: vtkPen.h:171
vtkPen::LineType
int LineType
The type of line to be drawn with this pen.
Definition: vtkPen.h:176
vtkX3D::type
Definition: vtkX3D.h:516
vtkObject::New
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
vtkPen::SOLID_LINE
Definition: vtkPen.h:49
vtkX3D::Color
Definition: vtkX3D.h:46
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:53
vtkPen::PenColor
vtkColor4ub PenColor
Definition: vtkPen.h:165
vtkPen::DASH_DOT_LINE
Definition: vtkPen.h:52
vtkPen::DOT_LINE
Definition: vtkPen.h:51
vtkX3D::color
Definition: vtkX3D.h:221
vtkPen::DASH_LINE
Definition: vtkPen.h:50
vtkPen::NO_PEN
Definition: vtkPen.h:48
vtkColor.h
vtkPen::GetColor
unsigned char * GetColor()
Get the color of the brush - gives a pointer to the underlying data.
Definition: vtkPen.h:141
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.
vtkObject.h
vtkPen::Color
unsigned char * Color
Storage of the color in RGBA format (0-255 per channel).
Definition: vtkPen.h:164
vtkColor4ub
Definition: vtkColor.h:240
vtkPen
provides a pen that draws the outlines of shapes drawn by vtkContext2D.
Definition: vtkPen.h:36