VTK  9.3.1
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:
35  static vtkOpenGLGL2PSHelper* New();
36  vtkAbstractTypeMacro(vtkOpenGLGL2PSHelper, vtkObject);
37  void PrintSelf(ostream& os, vtkIndent indent) override;
38 
40 
43  static vtkOpenGLGL2PSHelper* GetInstance();
44  static void SetInstance(vtkOpenGLGL2PSHelper*);
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 
107  virtual void ProcessTransformFeedback(
108  vtkTransformFeedback* tfc, vtkRenderer* ren, vtkActor* act) = 0;
109  virtual void ProcessTransformFeedback(
110  vtkTransformFeedback* tfc, vtkRenderer* ren, unsigned char col[4]) = 0;
111  virtual void ProcessTransformFeedback(
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 
158  ~vtkOpenGLGL2PSHelper() override;
159 
160  vtkSetMacro(ActiveState, State);
161  vtkSetMacro(TextAsPath, bool);
162  virtual void SetRenderWindow(vtkRenderWindow*);
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:40
abstract base class for most VTK objects
Definition: vtkObject.h:51
represent and manipulate 4x4 transformation matrices
Definition: vtkMatrix4x4.h:30
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
concrete dataset representing a path defined by Bezier curves.
Definition: vtkPath.h:24
Access GL2PS functionality.
abstract specification for renderers
Definition: vtkRenderer.h:61
a simple class to control print indentation
Definition: vtkIndent.h:28
topologically and geometrically regular array of data
Definition: vtkImageData.h:42
Manages a TransformFeedback buffer.
static vtkOpenGLGL2PSHelper * Instance
OpenGL2 implementation of GL2PS exporter.
represent text properties.
create a window for renderers to draw into
vtkRenderWindow * RenderWindow
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
virtual void SetRenderWindow(vtkRenderWindow *)
Set/Get the rendering window that contains the scene to be written.