VTK
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 
38 {
39 public:
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 
158  // Transform the path using the current modelview matrix.
159  void TransformPath(vtkPath *path) const;
160 
161  // Transform the 2D point using the current modelview matrix.
162  void TransformPoint(float &x, float &y) const;
163 
164  // Transform the width and height from pixels to data units.
165  void TransformSize(float &dx, float &dy) const;
166 };
167 
168 #endif //vtkGL2PSContextDevice2D_h
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:46
concrete dataset representing a path defined by Bezier curves.
Definition: vtkPath.h:34
Class for drawing 2D primitives using OpenGL 1.1+.
virtual void DrawMathTextString(float point[2], const vtkStdString &string)
virtual void DrawString(float *point, const vtkStdString &string)
virtual void SetLineWidth(float width)
virtual void DrawQuadStrip(float *points, int n)
static vtkOpenGLContextDevice2D * New()
void ApplyPen(vtkPen *pen)
virtual void DrawEllipseWedge(float x, float y, float outRx, float outRy, float inRx, float inRy, float startAngle, float stopAngle)
virtual void DrawEllipticArc(float x, float y, float rX, float rY, float startAngle, float stopAngle)
virtual void SetPointSize(float size)
virtual void PrintSelf(ostream &os, vtkIndent indent)
a simple class to control print indentation
Definition: vtkIndent.h:38
topologically and geometrically regular array of data
Definition: vtkImageData.h:44
Class for drawing 2D primitives using GL2PS.
provides a pen that draws the outlines of shapes drawn by vtkContext2D.
Definition: vtkPen.h:38
virtual void DrawPoints(float *points, int n, unsigned char *colors=0, int nc_comps=0)
virtual void DrawPoly(float *f, int n, unsigned char *colors=0, int nc_comps=0)
virtual void DrawMarkers(int shape, bool highlight, float *points, int n, unsigned char *colors=0, int nc_comps=0)
virtual void DrawPolygon(float *, int)
virtual void DrawPointSprites(vtkImageData *sprite, float *points, int n, unsigned char *colors=0, int nc_comps=0)
#define VTKRENDERINGGL2PS_EXPORT
virtual void SetLineType(int type)
String class that stores Unicode text.
virtual void DrawQuad(float *points, int n)