Package: paraview / 5.4.1+dfsg4-3.1

fix_gl2ps_new.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
Description: Workaround to compile paraview
Author: Anton Gladky <gladk@debian.org>
Last-Update: 2018-03-15

--- a/VTK/Rendering/GL2PS/vtkGL2PSUtilities.cxx
+++ b/VTK/Rendering/GL2PS/vtkGL2PSUtilities.cxx
@@ -241,8 +241,7 @@
       // move the bottom left corner to the baseline as this is how PDF
       // draws text
       blpos[1] -= m.Descent[1];
-      gl2psTextOptColorBL(spaceStr.c_str(), fontname, fontSize, align, angle, rgba,
-                          blpos[0], blpos[1]);
+      gl2psTextOptColor(spaceStr.c_str(), fontname, fontSize, align, angle, rgba);
     }
     else
     {
@@ -624,7 +623,7 @@
   out << "grestore" << endl;
 
   glRasterPos3dv(rasterPos);
-  gl2psSpecial(gl2psGetFileFormat(), out.str().c_str(), NULL);
+  gl2psSpecial(gl2psGetFileFormat(), out.str().c_str());
 }
 
 void vtkGL2PSUtilities::DrawPathPDF(vtkPath *path, double rasterPos[3],
@@ -776,7 +775,7 @@
   colorRgba[2] = rgba[2]/255.0;
   colorRgba[3] = rgba[3]/255.0;
 
-  gl2psSpecial(gl2psGetFileFormat(), out.str().c_str(), colorRgba);
+  gl2psSpecial(gl2psGetFileFormat(), out.str().c_str());
 }
 
 void vtkGL2PSUtilities::DrawPathSVG(vtkPath *path, double rasterPos[3],
@@ -937,7 +936,7 @@
       << "</g>" << endl;
 
   glRasterPos3dv(rasterPos);
-  gl2psSpecial(gl2psGetFileFormat(), out.str().c_str(), NULL);
+  gl2psSpecial(gl2psGetFileFormat(), out.str().c_str());
 }
 
 
--- a/VTK/Rendering/GL2PSOpenGL2/Testing/Cxx/TestGL2PSAddPolyPrimitive.cxx
+++ b/VTK/Rendering/GL2PSOpenGL2/Testing/Cxx/TestGL2PSAddPolyPrimitive.cxx
@@ -96,21 +96,21 @@
   // Point:
   setVertex(vertices[0], 200, 307.5, 0, 0.f, 0.f, 1.f, 1.f);
   gl2psAddPolyPrimitive(GL2PS_POINT, 1, vertices, offset, ofactor, ounits,
-                        pattern, factor, /*width=*/15, boundary);
+                        pattern, factor, /*width=*/15, 0, 0, boundary);
 
   // Line:
   // Note that the first vertex's color is used for the entire line.
   setVertex(vertices[0], 100, 50, 0, 1.f, 0.f, 0.f, 1.f);
   setVertex(vertices[1], 300, 50, 0, 0.f, 0.f, 1.f, 1.f);
   gl2psAddPolyPrimitive(GL2PS_LINE, 2, vertices, offset, ofactor, ounits,
-                        pattern, factor, width, boundary);
+                        pattern, factor, width, 0, 0, boundary);
 
   // Triangle:
   setVertex(vertices[0], 100, 100, 0, 1.f, 0.f, 0.f, 1.f);
   setVertex(vertices[1], 300, 100, 0, 0.f, 1.f, 0.f, 1.f);
   setVertex(vertices[2], 200, 300, 0, 0.f, 0.f, 1.f, 1.f);
   gl2psAddPolyPrimitive(GL2PS_TRIANGLE, 3, vertices, offset, ofactor, ounits,
-                        pattern, factor, width, boundary);
+                        pattern, factor, width, 0, 0, boundary);
 
   // Text:
   setVertex(vertices[0], 200, 325, 0, 0.f, 0.f, 0.f, 1.f);
--- a/VTK/Rendering/GL2PSOpenGL2/vtkOpenGLGL2PSHelperImpl.cxx
+++ b/VTK/Rendering/GL2PSOpenGL2/vtkOpenGLGL2PSHelperImpl.cxx
@@ -270,7 +270,7 @@
     {
       case GL_POINTS:
         gl2psAddPolyPrimitive(GL2PS_POINT, 1, verts, 0, 0.f, 0.f, 0xffff, 1,
-                              pointSize, 0);
+                              pointSize, 0, 0, 0);
         break;
 
       case GL_LINES:
@@ -278,7 +278,7 @@
         if (curVert == 0)
         {
           gl2psAddPolyPrimitive(GL2PS_LINE, 2, verts, 0, 0.f, 0.f,
-                                this->LineStipple, 1, lineWidth, 0);
+                                this->LineStipple, 1, lineWidth, 0, 0, 0);
         }
         break;
 
@@ -287,7 +287,7 @@
         if (curVert == 0)
         {
           gl2psAddPolyPrimitive(GL2PS_TRIANGLE, 3, verts, 0, 0.f, 0.f, 0xffff,
-                                1, 1, 0);
+                                1, 1, 0, 0, 0);
         }
         break;
 
@@ -357,9 +357,9 @@
       bgVerts[4].xyz[2] = bgVerts[0].xyz[2];
 
       gl2psAddPolyPrimitive(GL2PS_TRIANGLE, 3, bgVerts,     0, 0, 0, 0xffff, 0,
-                            0, 0);
+                            0, 0, 0, 0);
       gl2psAddPolyPrimitive(GL2PS_TRIANGLE, 3, bgVerts + 2, 0, 0, 0, 0xffff, 0,
-                            0, 0);
+                            0, 0, 0, 0);
     }
   }
 
@@ -407,7 +407,14 @@
       // we cannot draw the text
       return;
     }
-    if (::ComputeBottomLeft(tprop, m.BoundingBox, pos, this->TextAsPath, blpos))
+
+#if GL2PS_MAJOR_VERSION > 1 || \
+    (GL2PS_MAJOR_VERSION == 1 && (GL2PS_MINOR_VERSION > 4 || \
+        (GL2PS_MINOR_VERSION == 4 && GL2PS_MICRO_VERSION > 0)))
+#define HAVE_gl2psTextOptColorBL
+#endif 
+#if HAVE_gl2psTextOptColorBL
+     if (::ComputeBottomLeft(tprop, m.BoundingBox, pos, this->TextAsPath, blpos))
     {
       // move the bottom left corner to the baseline as this is how PDF
       // draws text
@@ -419,13 +426,16 @@
     }
     else
     {
+#endif 
       // move the bottom left corner to the baseline as this
       // how PDF draws text.
       gl2psRasterPos.xyz[0] -= m.Descent[0];
       gl2psRasterPos.xyz[1] -= m.Descent[1];
       gl2psForceRasterPos(&gl2psRasterPos);
       gl2psTextOptColor(str.c_str(), fontname, fontSize, align, angle, rgba);
+#if HAVE_gl2psTextOptColorBL
     }
+#endif
   }
   else
   {
@@ -983,7 +993,7 @@
   gl2psRasterPos.rgba[2] = 0.f;
   gl2psRasterPos.rgba[3] = 0.f;
   gl2psForceRasterPos(&gl2psRasterPos);
-  gl2psSpecial(gl2psGetFileFormat(), out.str().c_str(), NULL);
+  gl2psSpecial(gl2psGetFileFormat(), out.str().c_str());
 }
 
 //------------------------------------------------------------------------------
@@ -1140,7 +1150,7 @@
   gl2psRasterPos.rgba[2] = 0.f;
   gl2psRasterPos.rgba[3] = 0.f;
   gl2psForceRasterPos(&gl2psRasterPos);
-  gl2psSpecial(gl2psGetFileFormat(), out.str().c_str(), NULL);
+  gl2psSpecial(gl2psGetFileFormat(), out.str().c_str());
 }
 
 //------------------------------------------------------------------------------
@@ -1300,5 +1310,5 @@
   gl2psRasterPos.rgba[2] = 0.f;
   gl2psRasterPos.rgba[3] = 0.f;
   gl2psForceRasterPos(&gl2psRasterPos);
-  gl2psSpecial(gl2psGetFileFormat(), out.str().c_str(), NULL);
+  gl2psSpecial(gl2psGetFileFormat(), out.str().c_str());
 }