VTK  9.2.20230326
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 
27 #ifndef vtkOpenGLGL2PSHelper_h
28 #define vtkOpenGLGL2PSHelper_h
29 
30 #include "vtkObject.h"
31 #include "vtkRenderingOpenGL2Module.h" // For export macro
32 #include <string> // For string usage
33 
34 VTK_ABI_NAMESPACE_BEGIN
35 class vtkActor;
36 class vtkImageData;
37 class vtkMatrix4x4;
38 class vtkPath;
39 class vtkRenderer;
40 class vtkRenderWindow;
41 class vtkTextProperty;
43 
44 class VTKRENDERINGOPENGL2_EXPORT vtkOpenGLGL2PSHelper : public vtkObject
45 {
46 public:
49  void PrintSelf(ostream& os, vtkIndent indent) override;
50 
52 
58 
60 
63  vtkGetObjectMacro(RenderWindow, vtkRenderWindow);
65 
66  enum State
67  {
68  Inactive = 0,
70  Capture
71  };
72 
74 
84  vtkGetMacro(ActiveState, State);
86 
88 
91  vtkSetMacro(PointSize, float);
92  vtkGetMacro(PointSize, float);
94 
96 
99  vtkSetMacro(LineWidth, float);
100  vtkGetMacro(LineWidth, float);
102 
104 
108  vtkSetMacro(LineStipple, unsigned short);
109  vtkGetMacro(LineStipple, unsigned short);
111 
113 
120  vtkTransformFeedback* tfc, vtkRenderer* ren, vtkActor* act) = 0;
122  vtkTransformFeedback* tfc, vtkRenderer* ren, unsigned char col[4]) = 0;
124  vtkTransformFeedback* tfc, vtkRenderer* ren, float col[4]) = 0;
126 
134  virtual void DrawString(const std::string& str, vtkTextProperty* tprop, double pos[3],
135  double backgroundDepth, vtkRenderer* ren) = 0;
136 
148  virtual void DrawPath(vtkPath* path, double rasterPos[3], double windowPos[2],
149  unsigned char rgba[4], double scale[2] = nullptr, double rotateAngle = 0.0,
150  float strokeWidth = -1, const char* label = nullptr) = 0;
151 
157  virtual void Draw3DPath(vtkPath* path, vtkMatrix4x4* actorMatrix, double rasterPos[3],
158  unsigned char actorColor[4], vtkRenderer* ren, const char* label = nullptr) = 0;
159 
164  virtual void DrawImage(vtkImageData* image, double pos[3]) = 0;
165 
166 protected:
168 
171 
172  vtkSetMacro(ActiveState, State);
173  vtkSetMacro(TextAsPath, bool);
175  vtkSetMacro(PointSizeFactor, float);
176  vtkSetMacro(LineWidthFactor, float);
177 
179 
183  float PointSize;
184  float LineWidth;
187  unsigned short LineStipple;
188 
189 private:
191  void operator=(const vtkOpenGLGL2PSHelper&) = delete;
192 };
193 
194 VTK_ABI_NAMESPACE_END
195 #endif // vtkOpenGLGL2PSHelper_h
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:162
topologically and geometrically regular array of data
Definition: vtkImageData.h:164
a simple class to control print indentation
Definition: vtkIndent.h:120
represent and manipulate 4x4 transformation matrices
Definition: vtkMatrix4x4.h:152
abstract base class for most VTK objects
Definition: vtkObject.h:83
OpenGL2 implementation of GL2PS exporter.
Access GL2PS functionality.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkRenderWindow * RenderWindow
virtual void SetRenderWindow(vtkRenderWindow *)
virtual void ProcessTransformFeedback(vtkTransformFeedback *tfc, vtkRenderer *ren, vtkActor *act)=0
Parse the vertex information in tfc and inject primitives into GL2PS.
virtual void DrawImage(vtkImageData *image, double pos[3])=0
Draw the image at pos.
static void SetInstance(vtkOpenGLGL2PSHelper *)
The global instance.
static vtkOpenGLGL2PSHelper * Instance
virtual void DrawPath(vtkPath *path, double rasterPos[3], double windowPos[2], unsigned char rgba[4], double scale[2]=nullptr, double rotateAngle=0.0, float strokeWidth=-1, const char *label=nullptr)=0
Generate PS, EPS, or SVG markup from a vtkPath object, and then inject it into the output using the g...
@ Background
No export active.
static vtkOpenGLGL2PSHelper * New()
virtual void ProcessTransformFeedback(vtkTransformFeedback *tfc, vtkRenderer *ren, unsigned char col[4])=0
Parse the vertex information in tfc and inject primitives into GL2PS.
vtkAbstractTypeMacro(vtkOpenGLGL2PSHelper, vtkObject)
static vtkOpenGLGL2PSHelper * GetInstance()
The global instance.
virtual void Draw3DPath(vtkPath *path, vtkMatrix4x4 *actorMatrix, double rasterPos[3], unsigned char actorColor[4], vtkRenderer *ren, const char *label=nullptr)=0
Transform the path using the actor's matrix and current GL state, then draw it to GL2PS.
virtual void DrawString(const std::string &str, vtkTextProperty *tprop, double pos[3], double backgroundDepth, vtkRenderer *ren)=0
Format the text in str according to tprop and instruct GL2PS to draw it at pixel coordinate pos.
virtual void ProcessTransformFeedback(vtkTransformFeedback *tfc, vtkRenderer *ren, float col[4])=0
Parse the vertex information in tfc and inject primitives into GL2PS.
~vtkOpenGLGL2PSHelper() override
concrete dataset representing a path defined by Bezier curves.
Definition: vtkPath.h:37
create a window for renderers to draw into
abstract specification for renderers
Definition: vtkRenderer.h:183
represent text properties.
Manages a TransformFeedback buffer.
@ scale
Definition: vtkX3D.h:241
@ image
Definition: vtkX3D.h:386
@ string
Definition: vtkX3D.h:502