VTK
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
vtkGL2PSContextDevice2D.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkGL2PSContextDevice2D.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 
28 #ifndef __vtkGL2PSContextDevice2D_h
29 #define __vtkGL2PSContextDevice2D_h
30 
31 #include "vtkRenderingGL2PSModule.h" // For export macro
32 #include "vtkOpenGLContextDevice2D.h"
33 
34 class vtkPath;
35 
36 class VTKRENDERINGGL2PS_EXPORT vtkGL2PSContextDevice2D
37  : public vtkOpenGLContextDevice2D
38 {
39 public:
40  vtkTypeMacro(vtkGL2PSContextDevice2D, vtkOpenGLContextDevice2D);
41  virtual void PrintSelf(ostream &os, vtkIndent indent);
42 
43  static vtkGL2PSContextDevice2D *New();
44 
46 
50  virtual void DrawPoly(float *f, int n, unsigned char *colors = 0,
51  int nc_comps = 0);
53 
55 
57  virtual void DrawPoints(float *points, int n, unsigned char* colors = 0,
58  int nc_comps = 0);
60 
62 
67  virtual void DrawPointSprites(vtkImageData *sprite, float *points, int n,
68  unsigned char *colors = 0, int nc_comps = 0);
70 
72  virtual void DrawQuadStrip(float *, int);
73 
75  virtual void DrawPolygon(float *, int);
76 
78 
84  virtual void DrawEllipseWedge(float x, float y, float outRx, float outRy,
85  float inRx, float inRy, float startAngle,
86  float stopAngle);
88 
90 
93  virtual void DrawEllipticArc(float x, float y, float rX, float rY,
94  float startAngle, float stopAngle);
96 
98 
104  virtual void DrawMarkers(int shape, bool highlight, float *points, int n,
105  unsigned char *colors = 0, int nc_comps = 0);
107 
109  virtual void DrawQuad(float *points, int n);
110 
112  virtual void DrawString(float *point, const vtkStdString &string);
113 
115  virtual void DrawString(float *point, const vtkUnicodeString &string);
116 
120  virtual void DrawMathTextString(float point[2], const vtkStdString &string);
121 
126  void ApplyPen(vtkPen *pen);
127 
129  virtual void SetPointSize(float size);
130 
132  virtual void SetLineWidth(float width);
133 
135  virtual void SetLineType(int type);
136 
137 protected:
139  virtual ~vtkGL2PSContextDevice2D();
140 
141 private:
142  vtkGL2PSContextDevice2D(const vtkGL2PSContextDevice2D &); // Not implemented.
143  void operator=(const vtkGL2PSContextDevice2D &); // Not implemented.
144 
145  void DrawCrossMarkers(bool highlight, float *points, int n,
146  unsigned char *colors, int nc_comps);
147  void DrawPlusMarkers(bool highlight, float *points, int n,
148  unsigned char *colors, int nc_comps);
149  void DrawSquareMarkers(bool highlight, float *points, int n,
150  unsigned char *colors, int nc_comps);
151  void DrawCircleMarkers(bool highlight, float *points, int n,
152  unsigned char *colors, int nc_comps);
153  void DrawDiamondMarkers(bool highlight, float *points, int n,
154  unsigned char *colors, int nc_comps);
155  void AddEllipseToPath(vtkPath *path, float x, float y, float rx, float ry,
156  bool reverse);
157  // Transform the path using the current modelview matrix.
158  void TransformPath(vtkPath *path);
159 };
160 
161 #endif //__vtkGL2PSContextDevice2D_h
Class for drawing 2D primitives using GL2PS.