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 
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:
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
vtkRenderingGL2PSModule.h
vtkGL2PSContextDevice2D::DrawPointSprites
virtual void DrawPointSprites(vtkImageData *sprite, float *points, int n, unsigned char *colors=0, int nc_comps=0)
vtkGL2PSContextDevice2D::DrawMathTextString
virtual void DrawMathTextString(float point[2], const vtkStdString &string)
vtkGL2PSContextDevice2D::DrawEllipseWedge
virtual void DrawEllipseWedge(float x, float y, float outRx, float outRy, float inRx, float inRy, float startAngle, float stopAngle)
vtkGL2PSContextDevice2D::DrawPolygon
virtual void DrawPolygon(float *, int)
vtkPath
concrete dataset representing a path defined by Bezier curves.
Definition: vtkPath.h:35
vtkTypeMacro
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:642
vtkgl::n
GLclampd n
Definition: vtkgl.h:14370
vtkGL2PSContextDevice2D::DrawString
virtual void DrawString(float *point, const vtkStdString &string)
vtkgl::x
GLint GLint GLint GLint GLint x
Definition: vtkgl.h:11318
vtkGL2PSContextDevice2D::SetLineWidth
virtual void SetLineWidth(float width)
VTKRENDERINGGL2PS_EXPORT
#define VTKRENDERINGGL2PS_EXPORT
Definition: vtkRenderingGL2PSModule.h:15
vtkGL2PSContextDevice2D::DrawPoints
virtual void DrawPoints(float *points, int n, unsigned char *colors=0, int nc_comps=0)
vtkgl::points
GLsizei const GLfloat * points
Definition: vtkgl.h:14786
vtkGL2PSContextDevice2D::ApplyPen
void ApplyPen(vtkPen *pen)
vtkX3D::point
@ point
Definition: vtkX3D.h:236
vtkOpenGLContextDevice2D
Class for drawing 2D primitives using OpenGL 1.1+.
Definition: vtkOpenGLContextDevice2D.h:48
vtkGL2PSContextDevice2D::DrawMarkers
virtual void DrawMarkers(int shape, bool highlight, float *points, int n, unsigned char *colors=0, int nc_comps=0)
vtkImageData
topologically and geometrically regular array of data
Definition: vtkImageData.h:45
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkGL2PSContextDevice2D::DrawEllipticArc
virtual void DrawEllipticArc(float x, float y, float rX, float rY, float startAngle, float stopAngle)
vtkUnicodeString
String class that stores Unicode text.
Definition: vtkUnicodeString.h:72
vtkgl::path
GLsizei const GLchar ** path
Definition: vtkgl.h:13835
vtkGL2PSContextDevice2D::SetLineType
virtual void SetLineType(int type)
vtkX3D::startAngle
@ startAngle
Definition: vtkX3D.h:486
vtkgl::f
GLclampf f
Definition: vtkgl.h:14181
vtkGL2PSContextDevice2D
Class for drawing 2D primitives using GL2PS.
Definition: vtkGL2PSContextDevice2D.h:38
vtkgl::width
GLint GLint GLsizei width
Definition: vtkgl.h:11316
vtkgl::y
GLint GLint GLint GLint GLint GLint y
Definition: vtkgl.h:11318
vtkGL2PSContextDevice2D::~vtkGL2PSContextDevice2D
virtual ~vtkGL2PSContextDevice2D()
vtkGL2PSContextDevice2D::DrawPoly
virtual void DrawPoly(float *f, int n, unsigned char *colors=0, int nc_comps=0)
vtkGL2PSContextDevice2D::DrawQuad
virtual void DrawQuad(float *points, int n)
vtkPen
provides a pen that draws the outlines of shapes drawn by vtkContext2D.
Definition: vtkPen.h:39
vtkStdString
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:48
vtkgl::type
GLuint GLuint GLsizei GLenum type
Definition: vtkgl.h:11315
vtkGL2PSContextDevice2D::New
static vtkGL2PSContextDevice2D * New()
vtkGL2PSContextDevice2D::DrawQuadStrip
virtual void DrawQuadStrip(float *, int)
vtkGL2PSContextDevice2D::vtkGL2PSContextDevice2D
vtkGL2PSContextDevice2D()
vtkGL2PSContextDevice2D::SetPointSize
virtual void SetPointSize(float size)
vtkgl::size
GLsizeiptr size
Definition: vtkgl.h:11843
vtkGL2PSContextDevice2D::DrawString
virtual void DrawString(float *point, const vtkUnicodeString &string)
vtkGL2PSContextDevice2D::PrintSelf
virtual void PrintSelf(ostream &os, vtkIndent indent)