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 
32 #ifndef vtkPen_h
33 #define vtkPen_h
34 
35 #include "vtkRenderingContext2DModule.h" // For export macro
36 #include "vtkObject.h"
37 #include "vtkColor.h" // Needed for vtkColor4ub
38 
39 class VTKRENDERINGCONTEXT2D_EXPORT vtkPen : public vtkObject
40 {
41 public:
42  vtkTypeMacro(vtkPen, vtkObject);
43  void PrintSelf(ostream &os, vtkIndent indent) override;
44 
45  static vtkPen *New();
46 
50  enum {
56  DASH_DOT_DOT_LINE};
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,
110  unsigned char a);
111  void SetColor(const vtkColor4ub &color);
113 
118  void SetOpacity(unsigned char a);
119 
123  void GetColorF(double color[3]);
124 
128  void GetColor(unsigned char color[3]);
129 
133  vtkColor4ub GetColorObject();
134 
139  unsigned char GetOpacity();
140 
144  unsigned char * GetColor() { return this->Color; }
145 
147 
150  vtkSetMacro(Width, float);
151  vtkGetMacro(Width, float);
153 
157  void DeepCopy(vtkPen *pen);
158 
159 protected:
160  vtkPen();
161  ~vtkPen() override;
162 
164 
167  unsigned char* Color;
170 
174  float Width;
175 
179  int LineType;
180 
181 private:
182  vtkPen(const vtkPen &) = delete;
183  void operator=(const vtkPen &) = delete;
184 
185 };
186 
187 #endif //vtkPen_h
vtkPen::Width
float Width
Store the width of the pen in pixels.
Definition: vtkPen.h:174
vtkPen::LineType
int LineType
The type of line to be drawn with this pen.
Definition: vtkPen.h:179
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:52
vtkX3D::Color
Definition: vtkX3D.h:46
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:59
vtkPen::PenColor
vtkColor4ub PenColor
Definition: vtkPen.h:168
vtkPen::DASH_DOT_LINE
Definition: vtkPen.h:55
vtkPen::DOT_LINE
Definition: vtkPen.h:54
vtkX3D::color
Definition: vtkX3D.h:221
vtkPen::DASH_LINE
Definition: vtkPen.h:53
vtkPen::NO_PEN
Definition: vtkPen.h:51
vtkColor.h
vtkPen::GetColor
unsigned char * GetColor()
Get the color of the brush - gives a pointer to the underlying data.
Definition: vtkPen.h:144
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
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:167
vtkColor4ub
Definition: vtkColor.h:240
vtkPen
provides a pen that draws the outlines of shapes drawn by vtkContext2D.
Definition: vtkPen.h:39