VTK  9.3.20240419
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 
22 VTK_ABI_NAMESPACE_BEGIN
23 class vtkActor;
24 class vtkImageData;
25 class vtkMatrix4x4;
26 class vtkPath;
27 class vtkRenderer;
28 class vtkRenderWindow;
29 class vtkTextProperty;
31 
32 class VTKRENDERINGOPENGL2_EXPORT vtkOpenGLGL2PSHelper : public vtkObject
33 {
34 public:
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 
154 protected:
156 
159 
160  vtkSetMacro(ActiveState, State);
161  vtkSetMacro(TextAsPath, bool);
163  vtkSetMacro(PointSizeFactor, float);
164  vtkSetMacro(LineWidthFactor, float);
165 
167 
171  float PointSize;
172  float LineWidth;
175  unsigned short LineStipple;
176 
177 private:
179  void operator=(const vtkOpenGLGL2PSHelper&) = delete;
180 };
181 
182 VTK_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
Definition: vtkImageData.h:156
a simple class to control print indentation
Definition: vtkIndent.h:108
represent and manipulate 4x4 transformation matrices
Definition: vtkMatrix4x4.h:141
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)
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:44
create a window for renderers to draw into
abstract specification for renderers
Definition: vtkRenderer.h:172
represent text properties.
Manages a TransformFeedback buffer.
@ scale
Definition: vtkX3D.h:229
@ image
Definition: vtkX3D.h:374
@ string
Definition: vtkX3D.h:490