VTK
vtkOpenGLGL2PSHelperImpl.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkOpenGLGL2PSHelperImpl.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 
22 #ifndef vtkOpenGLGL2PSHelperImpl_h
23 #define vtkOpenGLGL2PSHelperImpl_h
24 
25 #include "vtkRenderingGL2PSOpenGL2Module.h" // For export macro
26 #include "vtkOpenGLGL2PSHelper.h"
27 
28 class vtkMatrix4x4;
29 class vtkPoints;
30 
31 class VTKRENDERINGGL2PSOPENGL2_EXPORT vtkOpenGLGL2PSHelperImpl
32  : public vtkOpenGLGL2PSHelper
33 {
34 public:
35  static vtkOpenGLGL2PSHelperImpl *New();
37  void PrintSelf(ostream &os, vtkIndent indent) override;
38 
39  void ProcessTransformFeedback(vtkTransformFeedback *tfc,
40  vtkRenderer *ren, vtkActor *act) override;
41  void ProcessTransformFeedback(vtkTransformFeedback *tfc,
42  vtkRenderer *ren,
43  unsigned char col[4]) override;
44  void ProcessTransformFeedback(vtkTransformFeedback *tfc,
45  vtkRenderer *ren,
46  float col[4]) override;
47 
48  void DrawString(const std::string &str, vtkTextProperty *tprop,
49  double pos[3], double backgroundDepth,
50  vtkRenderer *ren) override;
51 
52  void DrawPath(vtkPath *path, double rasterPos[3], double windowPos[2],
53  unsigned char rgba[4], double scale[2] = nullptr,
54  double rotateAngle = 0.0, float strokeWidth = -1,
55  const char *label = nullptr) override;
56 
57  void Draw3DPath(vtkPath *path, vtkMatrix4x4 *actorMatrix,
58  double rasterPos[3], unsigned char actorColor[4],
59  vtkRenderer *ren, const char *label = nullptr) override;
60 
61  void DrawImage(vtkImageData *image, double pos[3]) override;
62 
63 protected:
65  ~vtkOpenGLGL2PSHelperImpl() override;
66 
70  static const char* TextPropertyToPSFontName(vtkTextProperty *tprop);
71 
75  static int TextPropertyToGL2PSAlignment(vtkTextProperty *tprop);
76 
81  static void GetTransformParameters(vtkRenderer *ren,
82  vtkMatrix4x4 *actorMatrix,
83  vtkMatrix4x4 *xform, double vpOrigin[2],
84  double halfSize[2], double zfact[2]);
85 
87 
90  static void ProjectPoint(double point[3], vtkRenderer *ren,
91  vtkMatrix4x4 *actorMatrix = nullptr);
92  static void ProjectPoint(double point[4], vtkMatrix4x4 *transformMatrix,
93  double viewportOrigin[2], double halfWidth,
94  double halfHeight, double zfact1, double zfact2);
95  static void ProjectPoints(vtkPoints *points, vtkRenderer *ren,
96  vtkMatrix4x4 *actorMatrix = nullptr);
98 
100 
104  static void UnprojectPoint(double point[4], vtkMatrix4x4 *invTransformMatrix,
105  double viewportOrigin[2], double halfWidth,
106  double halfHeight, double zfact1, double zfact2);
107  static void UnprojectPoints(double *points3D, vtkIdType numPoints,
108  vtkRenderer *ren,
109  vtkMatrix4x4 *actorMatrix = nullptr);
111 
112  void DrawPathPS(vtkPath *path, double rasterPos[3], double windowPos[2],
113  unsigned char rgba[4], double scale[2], double rotateAngle,
114  float strokeWidth, const std::string &label);
115  void DrawPathPDF(vtkPath *path, double rasterPos[3], double windowPos[2],
116  unsigned char rgba[4], double scale[2], double rotateAngle,
117  float strokeWidth, const std::string &label);
118  void DrawPathSVG(vtkPath *path, double rasterPos[3], double windowPos[2],
119  unsigned char rgba[4], double scale[2], double rotateAngle,
120  float strokeWidth, const std::string &label);
121 
122 private:
123  vtkOpenGLGL2PSHelperImpl(const vtkOpenGLGL2PSHelperImpl &) = delete;
124  void operator=(const vtkOpenGLGL2PSHelperImpl &) = delete;
125 };
126 
127 #endif // vtkOpenGLGL2PSHelperImpl_h
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:51
represent and manipulate 4x4 transformation matrices
Definition: vtkMatrix4x4.h:41
concrete dataset representing a path defined by Bezier curves.
Definition: vtkPath.h:35
Access GL2PS functionality.
abstract specification for renderers
Definition: vtkRenderer.h:63
int vtkIdType
Definition: vtkType.h:347
a simple class to control print indentation
Definition: vtkIndent.h:39
topologically and geometrically regular array of data
Definition: vtkImageData.h:45
Manages a TransformFeedback buffer.
represent text properties.
vtkOpenGLGL2PSHelper override implementation.
static vtkOpenGLGL2PSHelper * New()
represent and manipulate 3D points
Definition: vtkPoints.h:39