VTK
vtkOpenGLGL2PSHelper.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkOpenGLGL2PSHelper.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 vtkOpenGLGL2PSHelper_h
33 #define vtkOpenGLGL2PSHelper_h
34 
35 #include "vtkRenderingOpenGLModule.h" // For export macro
36 #include "vtkOpenGL.h" // for GL defines.
37 
38 class VTKRENDERINGOPENGL_EXPORT vtkOpenGLGL2PSHelper
39 {
40 public:
41 
43 
44  static void SetLineWidth(float lineWidth)
45  {
47  {
49  glPassThrough(vtkOpenGLGL2PSHelper::LineWidthFactor * lineWidth);
50  }
51  }
53 
55 
56  static void SetPointSize(float pointSize)
57  {
59  {
61  glPassThrough(vtkOpenGLGL2PSHelper::PointSizeFactor * pointSize);
62  }
63  }
65 
67 
70  static void EnableStipple()
71  {
73  {
74  GLint tmp;
76  glGetIntegerv(GL_LINE_STIPPLE_PATTERN, &tmp);
77  glPassThrough(static_cast<GLfloat>(tmp));
78  glGetIntegerv(GL_LINE_STIPPLE_REPEAT, &tmp);
79  glPassThrough(static_cast<GLfloat>(tmp));
80  }
81  }
83 
85 
87  static void DisableStipple()
88  {
90  {
92  }
93  }
95 
96 
97 protected:
98  friend class vtkGL2PSUtilities;
99 
100  static bool InGL2PSRender;
101  static GLfloat PointSizeFactor;
102  static GLfloat LineWidthFactor;
103  static GLfloat PointSizeToken;
104  static GLfloat LineWidthToken;
105  static GLfloat StippleBeginToken;
106  static GLfloat StippleEndToken;
107 
108 private:
109  // static-only class -- no need to construct/destroy.
112  vtkOpenGLGL2PSHelper(const vtkOpenGLGL2PSHelper &); // Not implemented.
113  void operator=(const vtkOpenGLGL2PSHelper &); // Not implemented.
114 };
115 
116 #endif //vtkOpenGLGL2PSHelper_h
117 // VTK-HeaderTest-Exclude: vtkOpenGLGL2PSHelper.h
Helper functions for using GL2PS within VTK.
static void SetPointSize(float pointSize)
Helper functionality for GL2PS exporting.
static void SetLineWidth(float lineWidth)
static GLfloat StippleBeginToken
static GLfloat LineWidthFactor
static GLfloat StippleEndToken
static GLfloat PointSizeFactor