25 #ifndef vtkPDFContextDevice2D_h 26 #define vtkPDFContextDevice2D_h 28 #include "vtkIOExportPDFModule.h" 42 void PrintSelf(ostream &os,
vtkIndent indent) override;
49 void SetHaruObjects(
void *doc,
void *page);
53 void DrawPoly(
float *
points,
int n,
unsigned char *colors =
nullptr,
54 int nc_comps = 0) override;
55 void DrawLines(
float *f,
int n,
unsigned char *colors =
nullptr,
56 int nc_comps = 0) override;
57 void DrawPoints(
float *points,
int n,
unsigned char* colors =
nullptr,
58 int nc_comps = 0) override;
59 void DrawPointSprites(
vtkImageData *sprite,
float *points,
int n,
60 unsigned char *colors =
nullptr,
61 int nc_comps = 0) override;
62 void DrawMarkers(
int shape,
bool highlight,
float *points,
int n,
63 unsigned char *colors =
nullptr,
int nc_comps = 0) override;
64 void DrawQuad(
float *,
int) override;
65 void DrawQuadStrip(
float *,
int) override;
66 void DrawPolygon(
float *,
int) override;
67 void DrawColoredPolygon(
float *points,
int numPoints,
68 unsigned char *colors =
nullptr,
69 int nc_comps = 0) override;
70 void DrawEllipseWedge(
float x,
float y,
float outRx,
float outRy,
72 float stopAngle) override;
73 void DrawEllipticArc(
float x,
float y,
float rX,
float rY,
74 float startAngle,
float stopAngle) override;
77 float bounds[4]) override;
80 float bounds[4]) override;
81 void ComputeJustifiedStringBounds(const
char*
string,
82 float bounds[4]) override;
83 void DrawMathTextString(
float *point, const
vtkStdString &str) override;
86 void SetColor4(
unsigned char color[4]) override;
88 void SetPointSize(
float size) override;
89 void SetLineWidth(
float width) override;
90 void DrawPolyData(
float p[2],
float scale,
vtkPolyData* polyData,
93 void SetLineType(
int type) override;
97 void PushMatrix() override;
98 void PopMatrix() override;
99 void SetClipping(
int *x) override;
100 void EnableClipping(
bool enable) override;
104 ~vtkPDFContextDevice2D() override;
106 void PushGraphicsState();
107 void PopGraphicsState();
109 void ApplyPenState();
110 void ApplyStrokeColor(
unsigned char *
color,
int numComps);
111 void ApplyLineWidth(
float width);
112 void ApplyLineType(
int type);
115 void ApplyPenStateAsFill();
116 void ApplyBrushState();
117 void ApplyTextPropertyState();
118 void ApplyFillColor(
unsigned char *color,
int numComps);
119 void ApplyFillAlpha(
unsigned char alpha);
120 void Fill(
bool stroke = false);
121 void FillEvenOdd(
bool stroke = false);
123 void BeginClipPathForTexture();
124 void RegisterTexturePoints(
float *
data,
int numPoints);
131 void DrawEllipticArcSegments(
float x,
float y,
float rX,
float rY,
132 float startAngle,
float stopAngle,
134 int GetNumberOfArcIterations(
float rX,
float rY,
135 float startAngle,
float stopAngle);
137 void DrawCrossMarkers(
bool highlight,
float *points,
int n,
138 unsigned char *colors,
int nc_comps);
139 void DrawPlusMarkers(
bool highlight,
float *points,
int n,
140 unsigned char *colors,
int nc_comps);
141 void DrawSquareMarkers(
bool highlight,
float *points,
int n,
142 unsigned char *colors,
int nc_comps);
143 void DrawCircleMarkers(
bool highlight,
float *points,
int n,
144 unsigned char *colors,
int nc_comps);
145 void DrawDiamondMarkers(
bool highlight,
float *points,
int n,
146 unsigned char *colors,
int nc_comps);
148 void DrawPath(
vtkPath *path,
float x,
float y);
150 void ApplyTransform();
158 static
void Matrix3ToMatrix4(
vtkMatrix3x3 *mat3,
double mat4[16]);
159 static
void Matrix4ToMatrix3(
double mat4[16],
vtkMatrix3x3 *mat3);
160 static
void Matrix4ToMatrix3(
double mat4[16],
double mat3[9]);
167 static
void Matrix4ToHPDFTransform(const
double mat4[16],
float hpdfMat[6]);
168 static
void Matrix3ToHPDFTransform(const
double mat4[9],
float hpdfMat[6]);
169 static
void HPDFTransformToMatrix3(
float a,
float b,
float c,
float d,
170 float x,
float y,
double mat3[9]);
178 vtkRenderer *Renderer;
182 bool IsInTexturedFill;
183 float TextureBounds[4];
186 vtkPDFContextDevice2D(const vtkPDFContextDevice2D&) = delete;
187 void operator=(const vtkPDFContextDevice2D&) = delete;
190 #endif // vtkPDFContextDevice2D_h
Wrapper around std::string to keep symbols short.
concrete dataset representing a path defined by Bezier curves.
abstract specification for renderers
static vtkContextDevice2D * New()
concrete dataset represents vertices, lines, polygons, and triangle strips
Some derived classes for the different colors commonly used.
a simple class to control print indentation
topologically and geometrically regular array of data
Abstract class for drawing 2D primitives.
vtkContextDevice2D implementation for use with vtkPDFExporter.
dynamic, self-adjusting array of unsigned char
Allocate and hold a VTK object.
represent and manipulate 3x3 transformation matrices
String class that stores Unicode text.