VTK  9.0.1
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 class vtkActor;
35 class vtkImageData;
36 class vtkMatrix4x4;
37 class vtkPath;
38 class vtkRenderer;
39 class vtkRenderWindow;
40 class vtkTextProperty;
42 
43 class VTKRENDERINGOPENGL2_EXPORT vtkOpenGLGL2PSHelper : public vtkObject
44 {
45 public:
48  void PrintSelf(ostream& os, vtkIndent indent) override;
49 
51 
57 
59 
62  vtkGetMacro(RenderWindow, vtkRenderWindow*);
64 
65  enum State
66  {
67  Inactive = 0,
69  Capture
70  };
71 
73 
83  vtkGetMacro(ActiveState, State);
85 
87 
90  vtkSetMacro(PointSize, float);
91  vtkGetMacro(PointSize, float);
93 
95 
98  vtkSetMacro(LineWidth, float);
99  vtkGetMacro(LineWidth, float);
101 
103 
107  vtkSetMacro(LineStipple, unsigned short);
108  vtkGetMacro(LineStipple, unsigned short);
110 
112 
119  vtkTransformFeedback* tfc, vtkRenderer* ren, vtkActor* act) = 0;
121  vtkTransformFeedback* tfc, vtkRenderer* ren, unsigned char col[4]) = 0;
123  vtkTransformFeedback* tfc, vtkRenderer* ren, float col[4]) = 0;
125 
133  virtual void DrawString(const std::string& str, vtkTextProperty* tprop, double pos[3],
134  double backgroundDepth, vtkRenderer* ren) = 0;
135 
147  virtual void DrawPath(vtkPath* path, double rasterPos[3], double windowPos[2],
148  unsigned char rgba[4], double scale[2] = nullptr, double rotateAngle = 0.0,
149  float strokeWidth = -1, const char* label = nullptr) = 0;
150 
156  virtual void Draw3DPath(vtkPath* path, vtkMatrix4x4* actorMatrix, double rasterPos[3],
157  unsigned char actorColor[4], vtkRenderer* ren, const char* label = nullptr) = 0;
158 
163  virtual void DrawImage(vtkImageData* image, double pos[3]) = 0;
164 
165 protected:
167 
170 
171  vtkSetMacro(ActiveState, State);
172  vtkSetMacro(TextAsPath, bool);
173  vtkSetMacro(RenderWindow, vtkRenderWindow*); // Doesn't ref count, not needed.
174  vtkSetMacro(PointSizeFactor, float);
175  vtkSetMacro(LineWidthFactor, float);
176 
178 
182  float PointSize;
183  float LineWidth;
186  unsigned short LineStipple;
187 
188 private:
190  void operator=(const vtkOpenGLGL2PSHelper&) = delete;
191 };
192 
193 #endif // vtkOpenGLGL2PSHelper_h
vtkOpenGLGL2PSHelper::DrawImage
virtual void DrawImage(vtkImageData *image, double pos[3])=0
Draw the image at pos.
vtkOpenGLGL2PSHelper::ActiveState
State ActiveState
Definition: vtkOpenGLGL2PSHelper.h:180
vtkOpenGLGL2PSHelper::LineStipple
unsigned short LineStipple
Definition: vtkOpenGLGL2PSHelper.h:186
vtkOpenGLGL2PSHelper::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkX3D::scale
@ scale
Definition: vtkX3D.h:235
vtkOpenGLGL2PSHelper::TextAsPath
bool TextAsPath
Definition: vtkOpenGLGL2PSHelper.h:181
vtkGL2PSExporter::PointSizeFactor
float PointSizeFactor
Definition: vtkGL2PSExporter.h:368
vtkOpenGLGL2PSExporter
OpenGL2 implementation of GL2PS exporter.
Definition: vtkOpenGLGL2PSExporter.h:33
vtkOpenGLGL2PSHelper::Background
@ Background
No export active.
Definition: vtkOpenGLGL2PSHelper.h:68
vtkOpenGLGL2PSHelper::DrawString
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.
vtkX3D::image
@ image
Definition: vtkX3D.h:380
vtkPath
concrete dataset representing a path defined by Bezier curves.
Definition: vtkPath.h:33
vtkOpenGLGL2PSHelper::ProcessTransformFeedback
virtual void ProcessTransformFeedback(vtkTransformFeedback *tfc, vtkRenderer *ren, unsigned char col[4])=0
vtkOpenGLGL2PSHelper::ProcessTransformFeedback
virtual void ProcessTransformFeedback(vtkTransformFeedback *tfc, vtkRenderer *ren, vtkActor *act)=0
Parse the vertex information in tfc and inject primitives into GL2PS.
vtkOpenGLGL2PSHelper::PointSizeFactor
float PointSizeFactor
Definition: vtkOpenGLGL2PSHelper.h:184
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:54
vtkOpenGLGL2PSHelper::State
State
Definition: vtkOpenGLGL2PSHelper.h:66
vtkGL2PSExporter::TextAsPath
bool TextAsPath
Definition: vtkGL2PSExporter.h:367
vtkOpenGLGL2PSHelper::Draw3DPath
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.
vtkOpenGLGL2PSHelper::LineWidthFactor
float LineWidthFactor
Definition: vtkOpenGLGL2PSHelper.h:185
vtkOpenGLGL2PSHelper::vtkAbstractTypeMacro
vtkAbstractTypeMacro(vtkOpenGLGL2PSHelper, vtkObject)
vtkOpenGLGL2PSHelper::New
static vtkOpenGLGL2PSHelper * New()
vtkGL2PSExporter::LineWidthFactor
float LineWidthFactor
Definition: vtkGL2PSExporter.h:369
vtkOpenGLGL2PSHelper::Instance
static vtkOpenGLGL2PSHelper * Instance
Definition: vtkOpenGLGL2PSHelper.h:175
vtkActor
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:46
vtkImageData
topologically and geometrically regular array of data
Definition: vtkImageData.h:42
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:34
vtkMatrix4x4
represent and manipulate 4x4 transformation matrices
Definition: vtkMatrix4x4.h:36
vtkOpenGLGL2PSHelper::ProcessTransformFeedback
virtual void ProcessTransformFeedback(vtkTransformFeedback *tfc, vtkRenderer *ren, float col[4])=0
vtkOpenGLGL2PSHelper::vtkOpenGLGL2PSHelper
vtkOpenGLGL2PSHelper()
vtkOpenGLGL2PSHelper::LineWidth
float LineWidth
Definition: vtkOpenGLGL2PSHelper.h:183
vtkOpenGLGL2PSHelper::SetInstance
static void SetInstance(vtkOpenGLGL2PSHelper *)
vtkOpenGLGL2PSHelper::GetInstance
static vtkOpenGLGL2PSHelper * GetInstance()
The global instance.
vtkObject.h
vtkOpenGLGL2PSHelper::PointSize
float PointSize
Definition: vtkOpenGLGL2PSHelper.h:182
vtkTextProperty
represent text properties.
Definition: vtkTextProperty.h:34
vtkOpenGLGL2PSHelper::~vtkOpenGLGL2PSHelper
~vtkOpenGLGL2PSHelper() override
vtkX3D::string
@ string
Definition: vtkX3D.h:496
vtkRenderer
abstract specification for renderers
Definition: vtkRenderer.h:59
vtkOpenGLGL2PSHelper
Access GL2PS functionality.
Definition: vtkOpenGLGL2PSHelper.h:44
vtkRenderWindow
create a window for renderers to draw into
Definition: vtkRenderWindow.h:85
vtkExporter::RenderWindow
vtkRenderWindow * RenderWindow
Definition: vtkExporter.h:127
vtkOpenGLGL2PSHelper::RenderWindow
vtkRenderWindow * RenderWindow
Definition: vtkOpenGLGL2PSHelper.h:179
vtkOpenGLGL2PSHelper::DrawPath
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...
vtkTransformFeedback
Manages a TransformFeedback buffer.
Definition: vtkTransformFeedback.h:41