VTK: Rendering/GL2PSOpenGL2/vtkOpenGLGL2PSHelperImpl.h Source File

| VTK 9.3.1

vtkOpenGLGL2PSHelperImpl.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
10 #ifndef vtkOpenGLGL2PSHelperImpl_h
11 #define vtkOpenGLGL2PSHelperImpl_h
12
13 #include "vtkOpenGLGL2PSHelper.h"
14 #include "vtkRenderingGL2PSOpenGL2Module.h" // For export macro
15
16 VTK_ABI_NAMESPACE_BEGIN
17 class vtkMatrix4x4;
18 class vtkPoints;
19
20 class VTKRENDERINGGL2PSOPENGL2_EXPORT vtkOpenGLGL2PSHelperImpl : public vtkOpenGLGL2PSHelper
21 {
22 public:
23 static vtkOpenGLGL2PSHelperImpl* New();
24 vtkTypeMacro(vtkOpenGLGL2PSHelperImpl, vtkOpenGLGL2PSHelper);
25 void PrintSelf(ostream& os, vtkIndent indent) override;
26
27 void ProcessTransformFeedback(
28 vtkTransformFeedback* tfc, vtkRenderer* ren, vtkActor* act) override;
29 void ProcessTransformFeedback(
30 vtkTransformFeedback* tfc, vtkRenderer* ren, unsigned char col[4]) override;
31 void ProcessTransformFeedback(vtkTransformFeedback* tfc, vtkRenderer* ren, float col[4]) override;
32
33 void DrawString(const std::string& str, vtkTextProperty* tprop, double pos[3],
34 double backgroundDepth, vtkRenderer* ren) override;
35
36 void DrawPath(vtkPath* path, double rasterPos[3], double windowPos[2], unsigned char rgba[4],
37 double scale[2] = nullptr, double rotateAngle = 0.0, float strokeWidth = -1,
38 const char* label = nullptr) override;
39
40 void Draw3DPath(vtkPath* path, vtkMatrix4x4* actorMatrix, double rasterPos[3],
41 unsigned char actorColor[4], vtkRenderer* ren, const char* label = nullptr) override;
42
43 void DrawImage(vtkImageData* input, double pos[3]) override;
44
45 protected:
46 vtkOpenGLGL2PSHelperImpl();
47 ~vtkOpenGLGL2PSHelperImpl() override;
48
52 static const char* TextPropertyToPSFontName(vtkTextProperty* tprop);
53
57 static int TextPropertyToGL2PSAlignment(vtkTextProperty* tprop);
58
63 static void GetTransformParameters(vtkRenderer* ren, vtkMatrix4x4* actorMatrix,
64 vtkMatrix4x4* xform, double vpOrigin[2], double halfSize[2], double zfact[2]);
65
67
70 static void ProjectPoint(double point[3], vtkRenderer* ren, vtkMatrix4x4* actorMatrix = nullptr);
71 static void ProjectPoint(double point[4], vtkMatrix4x4* transformMatrix, double viewportOrigin[2],
72 double halfWidth, double halfHeight, double zfact1, double zfact2);
73 static void ProjectPoints(
74 vtkPoints* points, vtkRenderer* ren, vtkMatrix4x4* actorMatrix = nullptr);
76
78
82 static void UnprojectPoint(double point[4], vtkMatrix4x4* invTransformMatrix,
83 double viewportOrigin[2], double halfWidth, double halfHeight, double zfact1, double zfact2);
84 static void UnprojectPoints(
85 double* points3D, vtkIdType numPoints, vtkRenderer* ren, vtkMatrix4x4* actorMatrix = nullptr);
87
88 void DrawPathPS(vtkPath* path, double rasterPos[3], double windowPos[2], unsigned char rgba[4],
89 double scale[2], double rotateAngle, float strokeWidth, const std::string& label);
90 void DrawPathPDF(vtkPath* path, double rasterPos[3], double windowPos[2], unsigned char rgba[4],
91 double scale[2], double rotateAngle, float strokeWidth, const std::string& label);
92 void DrawPathSVG(vtkPath* path, double rasterPos[3], double windowPos[2], unsigned char rgba[4],
93 double scale[2], double rotateAngle, float strokeWidth, const std::string& label);
94
95 private:
96 vtkOpenGLGL2PSHelperImpl(const vtkOpenGLGL2PSHelperImpl&) = delete;
97 void operator=(const vtkOpenGLGL2PSHelperImpl&) = delete;
98 };
99
100 VTK_ABI_NAMESPACE_END
101 #endif // vtkOpenGLGL2PSHelperImpl_h
vtkActor
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:50
vtkImageData
topologically and geometrically regular array of data
Definition: vtkImageData.h:52
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:38
vtkMatrix4x4
represent and manipulate 4x4 transformation matrices
Definition: vtkMatrix4x4.h:40
vtkOpenGLGL2PSHelperImpl
vtkOpenGLGL2PSHelper override implementation.
Definition: vtkOpenGLGL2PSHelperImpl.h:21
vtkOpenGLGL2PSHelperImpl::DrawPath
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) override
Generate PS, EPS, or SVG markup from a vtkPath object, and then inject it into the output using the g...
vtkOpenGLGL2PSHelperImpl::DrawPathPDF
void DrawPathPDF(vtkPath *path, double rasterPos[3], double windowPos[2], unsigned char rgba[4], double scale[2], double rotateAngle, float strokeWidth, const std::string &label)
vtkOpenGLGL2PSHelperImpl::TextPropertyToPSFontName
static const char * TextPropertyToPSFontName(vtkTextProperty *tprop)
Translate the tprop's fontname into a Postscript font name.
vtkOpenGLGL2PSHelperImpl::ProcessTransformFeedback
void ProcessTransformFeedback(vtkTransformFeedback *tfc, vtkRenderer *ren, vtkActor *act) override
Parse the vertex information in tfc and inject primitives into GL2PS.
vtkOpenGLGL2PSHelperImpl::vtkOpenGLGL2PSHelperImpl
vtkOpenGLGL2PSHelperImpl()
vtkOpenGLGL2PSHelperImpl::DrawString
void DrawString(const std::string &str, vtkTextProperty *tprop, double pos[3], double backgroundDepth, vtkRenderer *ren) override
Format the text in str according to tprop and instruct GL2PS to draw it at pixel coordinate pos.
vtkOpenGLGL2PSHelperImpl::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkOpenGLGL2PSHelperImpl::UnprojectPoint
static void UnprojectPoint(double point[4], vtkMatrix4x4 *invTransformMatrix, double viewportOrigin[2], double halfWidth, double halfHeight, double zfact1, double zfact2)
Unproject the point from device coordinates into world coordinates.
vtkOpenGLGL2PSHelperImpl::ProcessTransformFeedback
void ProcessTransformFeedback(vtkTransformFeedback *tfc, vtkRenderer *ren, float col[4]) override
Parse the vertex information in tfc and inject primitives into GL2PS.
vtkOpenGLGL2PSHelperImpl::New
static vtkOpenGLGL2PSHelperImpl * New()
vtkOpenGLGL2PSHelperImpl::ProjectPoints
static void ProjectPoints(vtkPoints *points, vtkRenderer *ren, vtkMatrix4x4 *actorMatrix=nullptr)
Project the point from world coordinates into device coordinates.
vtkOpenGLGL2PSHelperImpl::DrawPathPS
void DrawPathPS(vtkPath *path, double rasterPos[3], double windowPos[2], unsigned char rgba[4], double scale[2], double rotateAngle, float strokeWidth, const std::string &label)
vtkOpenGLGL2PSHelperImpl::Draw3DPath
void Draw3DPath(vtkPath *path, vtkMatrix4x4 *actorMatrix, double rasterPos[3], unsigned char actorColor[4], vtkRenderer *ren, const char *label=nullptr) override
Transform the path using the actor's matrix and current GL state, then draw it to GL2PS.
vtkOpenGLGL2PSHelperImpl::DrawPathSVG
void DrawPathSVG(vtkPath *path, double rasterPos[3], double windowPos[2], unsigned char rgba[4], double scale[2], double rotateAngle, float strokeWidth, const std::string &label)
vtkOpenGLGL2PSHelperImpl::DrawImage
void DrawImage(vtkImageData *input, double pos[3]) override
Draw the image at pos.
vtkOpenGLGL2PSHelperImpl::ProjectPoint
static void ProjectPoint(double point[3], vtkRenderer *ren, vtkMatrix4x4 *actorMatrix=nullptr)
Project the point from world coordinates into device coordinates.
vtkOpenGLGL2PSHelperImpl::~vtkOpenGLGL2PSHelperImpl
~vtkOpenGLGL2PSHelperImpl() override
vtkOpenGLGL2PSHelperImpl::GetTransformParameters
static void GetTransformParameters(vtkRenderer *ren, vtkMatrix4x4 *actorMatrix, vtkMatrix4x4 *xform, double vpOrigin[2], double halfSize[2], double zfact[2])
Extracts the information needed for transforming and projecting points from a renderer.
vtkOpenGLGL2PSHelperImpl::TextPropertyToGL2PSAlignment
static int TextPropertyToGL2PSAlignment(vtkTextProperty *tprop)
Convert the alignment hint in tprop to a GL2PS text alignment constant.
vtkOpenGLGL2PSHelperImpl::ProcessTransformFeedback
void ProcessTransformFeedback(vtkTransformFeedback *tfc, vtkRenderer *ren, unsigned char col[4]) override
Parse the vertex information in tfc and inject primitives into GL2PS.
vtkOpenGLGL2PSHelperImpl::ProjectPoint
static void ProjectPoint(double point[4], vtkMatrix4x4 *transformMatrix, double viewportOrigin[2], double halfWidth, double halfHeight, double zfact1, double zfact2)
Project the point from world coordinates into device coordinates.
vtkOpenGLGL2PSHelperImpl::UnprojectPoints
static void UnprojectPoints(double *points3D, vtkIdType numPoints, vtkRenderer *ren, vtkMatrix4x4 *actorMatrix=nullptr)
Unproject the point from device coordinates into world coordinates.
vtkOpenGLGL2PSHelper
Access GL2PS functionality.
Definition: vtkOpenGLGL2PSHelper.h:33
vtkPath
concrete dataset representing a path defined by Bezier curves.
Definition: vtkPath.h:34
vtkPoints
represent and manipulate 3D points
Definition: vtkPoints.h:38
vtkRenderer
abstract specification for renderers
Definition: vtkRenderer.h:71
vtkTextProperty
represent text properties.
Definition: vtkTextProperty.h:35
vtkTransformFeedback
Manages a TransformFeedback buffer.
Definition: vtkTransformFeedback.h:30
vtkX3D::point
@ point
Definition: vtkX3D.h:236
vtkX3D::points
@ points
Definition: vtkX3D.h:446
vtkX3D::scale
@ scale
Definition: vtkX3D.h:229
vtkX3D::string
@ string
Definition: vtkX3D.h:490
vtkOpenGLGL2PSHelper.h
vtkIdType
int vtkIdType
Definition: vtkType.h:315