VTK  9.4.20241222
vtkOpenGLGL2PSHelper.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-License-Identifier: BSD-3-Clause
3
15#ifndef vtkOpenGLGL2PSHelper_h
16#define vtkOpenGLGL2PSHelper_h
17
18#include "vtkObject.h"
19#include "vtkRenderingOpenGL2Module.h" // For export macro
20#include <string> // For string usage
21
22VTK_ABI_NAMESPACE_BEGIN
23class vtkActor;
24class vtkImageData;
25class vtkMatrix4x4;
26class vtkPath;
27class vtkRenderer;
28class vtkRenderWindow;
29class vtkTextProperty;
31
32class VTKRENDERINGOPENGL2_EXPORT vtkOpenGLGL2PSHelper : public vtkObject
33{
34public:
37 void PrintSelf(ostream& os, vtkIndent indent) override;
38
40
46
48
51 vtkGetObjectMacro(RenderWindow, vtkRenderWindow);
53
54 enum State
55 {
56 Inactive = 0,
58 Capture
59 };
60
62
72 vtkGetMacro(ActiveState, State);
74
76
79 vtkSetMacro(PointSize, float);
80 vtkGetMacro(PointSize, float);
82
84
87 vtkSetMacro(LineWidth, float);
88 vtkGetMacro(LineWidth, float);
90
92
96 vtkSetMacro(LineStipple, unsigned short);
97 vtkGetMacro(LineStipple, unsigned short);
99
101
108 vtkTransformFeedback* tfc, vtkRenderer* ren, vtkActor* act) = 0;
110 vtkTransformFeedback* tfc, vtkRenderer* ren, unsigned char col[4]) = 0;
112 vtkTransformFeedback* tfc, vtkRenderer* ren, float col[4]) = 0;
114
122 virtual void DrawString(const std::string& str, vtkTextProperty* tprop, double pos[3],
123 double backgroundDepth, vtkRenderer* ren) = 0;
124
136 virtual void DrawPath(vtkPath* path, double rasterPos[3], double windowPos[2],
137 unsigned char rgba[4], double scale[2] = nullptr, double rotateAngle = 0.0,
138 float strokeWidth = -1, const char* label = nullptr) = 0;
139
145 virtual void Draw3DPath(vtkPath* path, vtkMatrix4x4* actorMatrix, double rasterPos[3],
146 unsigned char actorColor[4], vtkRenderer* ren, const char* label = nullptr) = 0;
147
152 virtual void DrawImage(vtkImageData* image, double pos[3]) = 0;
153
154protected:
156
159
160 vtkSetMacro(ActiveState, State);
161 vtkSetMacro(TextAsPath, bool);
163 vtkSetMacro(PointSizeFactor, float);
164 vtkSetMacro(LineWidthFactor, float);
165
167
175 unsigned short LineStipple;
176
177private:
179 void operator=(const vtkOpenGLGL2PSHelper&) = delete;
180};
181
182VTK_ABI_NAMESPACE_END
183#endif // vtkOpenGLGL2PSHelper_h
represents an object (geometry & properties) in a rendered scene
Definition vtkActor.h:151
topologically and geometrically regular array of data
a simple class to control print indentation
Definition vtkIndent.h:108
represent and manipulate 4x4 transformation matrices
abstract base class for most VTK objects
Definition vtkObject.h:162
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)
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.
static vtkOpenGLGL2PSHelper * GetInstance()
The global instance.
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:44
create a window for renderers to draw into
abstract specification for renderers
represent text properties.
Manages a TransformFeedback buffer.