VTK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
vtkGL2PSUtilities.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkGL2PSUtilities.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 =========================================================================*/
23 #ifndef __vtkGL2PSUtilities_h
24 #define __vtkGL2PSUtilities_h
25 
26 #include "vtkObject.h"
27 #include "vtkRenderingGL2PSModule.h" // For export macro
28 
29 class vtkImageData;
30 class vtkMatrix4x4;
31 class vtkPath;
32 class vtkPoints;
33 class vtkRenderWindow;
34 class vtkTextProperty;
35 
37 {
38 public:
39  static vtkGL2PSUtilities *New();
41  void PrintSelf(ostream& os, vtkIndent indent)
42  {
43  this->Superclass::PrintSelf(os, indent);
44  }
45 
48  static void DrawString(const char *str, vtkTextProperty *tprop, double pos[3]);
49 
51  static const char * TextPropertyToPSFontName(vtkTextProperty *tprop);
52 
55  static int TextPropertyToGL2PSAlignment(vtkTextProperty *tprop);
56 
58 
60  {
61  return vtkGL2PSUtilities::RenderWindow;
62  }
64 
66 
70  static void Draw3DPath(vtkPath *path, vtkMatrix4x4 *actorMatrix,
71  double rasterPos[3], unsigned char actorColor[4],
72  const char *label = NULL);
74 
75 
85  static void DrawPath(vtkPath *path, double rasterPos[3], double windowPos[2],
86  unsigned char rgba[4], double scale[2] = NULL,
87  double rotateAngle = 0.0, float strokeWidth = -1,
88  const char *label = NULL);
90 
92 
93  static bool GetTextAsPath()
94  {
95  return vtkGL2PSUtilities::TextAsPath;
96  }
98 
100 
102  static float GetPointSizeFactor()
103  { return vtkGL2PSUtilities::PointSizeFactor; }
104  static float GetLineWidthFactor()
105  { return vtkGL2PSUtilities::LineWidthFactor; }
107 
108 protected:
109  friend class vtkGL2PSExporter;
110 
111  static void StartExport();
112  static void FinishExport();
113 
114  static void SetPointSizeFactor(float f)
115  { vtkGL2PSUtilities::PointSizeFactor = f; }
116 
117  static void SetLineWidthFactor(float f)
118  { vtkGL2PSUtilities::LineWidthFactor = f; }
119 
120  static void SetTextAsPath(bool b)
121  {
122  vtkGL2PSUtilities::TextAsPath = b;
123  }
124 
125  static void SetRenderWindow(vtkRenderWindow *renWin)
126  {
127  vtkGL2PSUtilities::RenderWindow = renWin;
128  }
129 
130  static void DrawPathPS(vtkPath *path, double rasterPos[3],
131  double windowPos[2], unsigned char rgba[4],
132  double scale[2] = NULL, double rotateAngle = 0.0,
133  float strokeWidth = -1, const char *label = NULL);
134  static void DrawPathPDF(vtkPath *path, double rasterPos[3],
135  double windowPos[2], unsigned char rgba[4],
136  double scale[2] = NULL, double rotateAngle = 0.0,
137  float strokeWidth = -1, const char *label = NULL);
138  static void DrawPathSVG(vtkPath *path, double rasterPos[3],
139  double windowPos[2], unsigned char rgba[4],
140  double scale[2] = NULL, double rotateAngle = 0.0,
141  float strokeWidth = -1, const char *label = NULL);
142 
145 
146 private:
147  vtkGL2PSUtilities(const vtkGL2PSUtilities &); // Not implemented
148  void operator=(const vtkGL2PSUtilities&); // Not implemented
149 
151  static bool TextAsPath;
152  static float PointSizeFactor;
153  static float LineWidthFactor;
154 
156 
157  static void ProjectPoint(double point[3], vtkMatrix4x4 *actorMatrix = NULL);
158  static void ProjectPoint(double point[4], vtkMatrix4x4 * transformMatrix,
159  double viewportOrigin[2], double halfWidth,
160  double halfHeight, double zfact1, double zfact2);
161  static void ProjectPoints(vtkPoints *points,
162  vtkMatrix4x4 *actorMatrix = NULL);
163 };
165 
166 #endif
GLclampf f
Definition: vtkgl.h:14181
GLboolean GLboolean GLboolean b
Definition: vtkgl.h:12312
Helper functions for using GL2PS within VTK.
abstract base class for most VTK objects
Definition: vtkObject.h:61
represent and manipulate 4x4 transformation matrices
Definition: vtkMatrix4x4.h:38
export a scene as a PostScript file using GL2PS.
static float GetPointSizeFactor()
concrete dataset representing a path defined by Bezier curves.
Definition: vtkPath.h:34
GLenum GLenum GLenum GLenum GLenum scale
Definition: vtkgl.h:15942
static bool GetTextAsPath()
typedef void(APIENTRYP PFNGLBLENDCOLORPROC)(GLclampf red
virtual void PrintSelf(ostream &os, vtkIndent indent)
static void SetLineWidthFactor(float f)
static void SetRenderWindow(vtkRenderWindow *renWin)
a simple class to control print indentation
Definition: vtkIndent.h:38
topologically and geometrically regular array of data
Definition: vtkImageData.h:44
static float GetLineWidthFactor()
GLsizei const GLchar ** path
Definition: vtkgl.h:13835
represent text properties.
vtkWeakPointer< vtkRenderWindow > RenderWindow
GLsizei const GLfloat * points
Definition: vtkgl.h:14786
create a window for renderers to draw into
static void SetTextAsPath(bool b)
static vtkRenderWindow * GetRenderWindow()
static vtkObject * New()
#define VTKRENDERINGGL2PS_EXPORT
represent and manipulate 3D points
Definition: vtkPoints.h:39
static void SetPointSizeFactor(float f)