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 
31 #ifndef vtkPen_h
32 #define vtkPen_h
33 
34 #include "vtkRenderingContext2DModule.h" // For export macro
35 #include "vtkObject.h"
36 #include "vtkColor.h" // Needed for vtkColor4ub
37 
39 {
40 public:
41  vtkTypeMacro(vtkPen, vtkObject);
42  virtual void PrintSelf(ostream &os, vtkIndent indent);
43 
44  static vtkPen *New();
45 
46 //BTX
48 
49  enum {
55  DASH_DOT_DOT_LINE};
56 //ETX
58 
61  void SetLineType(int type);
62 
64  int GetLineType();
65 
68  void SetColorF(double color[3]);
69 
72  void SetColorF(double r, double g, double b);
73 
76  void SetColorF(double r, double g, double b, double a);
77 
80  void SetOpacityF(double a);
81 
84  void SetColor(unsigned char color[3]);
85 
88  void SetColor(unsigned char r, unsigned char g, unsigned char b);
89 
91 
93  void SetColor(unsigned char r, unsigned char g, unsigned char b,
94  unsigned char a);
95  void SetColor(const vtkColor4ub &color);
97 
100  void SetOpacity(unsigned char a);
101 
104  void GetColorF(double color[3]);
105 
107  void GetColor(unsigned char color[3]);
108 
110  vtkColor4ub GetColorObject();
111 
114  unsigned char GetOpacity();
115 
117  unsigned char * GetColor() { return this->Color; }
118 
120 
121  vtkSetMacro(Width, float);
122  vtkGetMacro(Width, float);
124 
126  void DeepCopy(vtkPen *pen);
127 
128 //BTX
129 protected:
130  vtkPen();
131  ~vtkPen();
132 
134 
135  unsigned char* Color;
138 
140  float Width;
141 
143  int LineType;
144 
145 private:
146  vtkPen(const vtkPen &); // Not implemented.
147  void operator=(const vtkPen &); // Not implemented.
148 //ETX
149 };
150 
151 #endif //vtkPen_h
abstract base class for most VTK objects
Definition: vtkObject.h:61
void DeepCopy(vtkPistonReference *self, vtkPistonReference *other)
float Width
Definition: vtkPen.h:140
unsigned char * GetColor()
Definition: vtkPen.h:117
virtual void PrintSelf(ostream &os, vtkIndent indent)
#define VTKRENDERINGCONTEXT2D_EXPORT
a simple class to control print indentation
Definition: vtkIndent.h:38
vtkColor4ub PenColor
Definition: vtkPen.h:136
provides a pen that draws the outlines of shapes drawn by vtkContext2D.
Definition: vtkPen.h:38
unsigned char * Color
Definition: vtkPen.h:135
int LineType
Definition: vtkPen.h:143
static vtkObject * New()