235 |
def run(rself): |
def run(rself): |
236 |
for i in range(0, len(papers)): |
for i in range(0, len(papers)): |
237 |
# create always all cs, gets interpolation better |
# create always all cs, gets interpolation better |
238 |
cs1 = vs.coords.affineCoordsys(cs1into, 100, |
cs1c = vs.coords.affineCoordsys(cs1into, 100, |
239 |
self.curx, ycoord, self.scale, 0, 0, self.scale) |
self.curx-self.scale, ycoord-self.scale, |
240 |
vs.matcher.add(cs1, key+"_p_"+str(i)) |
self.scale*2, 0, 0, self.scale*2) |
241 |
|
vs.matcher.add(cs1c, key+"_pc_"+str(i)) |
242 |
|
|
243 |
# If cliprect is defined, create coordsys transformation from |
# If cliprect is defined, create coordsys transformation from |
244 |
# IrregularQuad's object coordsys into CulledPaperQuad's object |
# IrregularQuad's object coordsys into CulledPaperQuad's object |
245 |
# coordsys. Then create CulledPaperQuad's instead of |
# coordsys. Then create CulledPaperQuad's instead of |
246 |
# regular renderable2 PaperQuads. |
# regular renderable2 PaperQuads. |
247 |
if cliprect: |
if cliprect: |
248 |
irreg_orig_x = (cliprect[0]+cliprect[2])/2 |
clip = vs.coords.affineCoordsys(cs1into, 0, |
249 |
irreg_orig_y = (cliprect[1]+cliprect[3])/2 |
cliprect[0], cliprect[1], |
250 |
irreg_orig_x_on_pq = (irreg_orig_x - self.curx) / self.scale |
cliprect[2]-cliprect[0], 0, 0, |
251 |
irreg_orig_y_on_pq = (irreg_orig_y - ycoord) / self.scale |
cliprect[3]-cliprect[1]) |
|
cs3 = vs.coords.affineCoordsys(0, 0, |
|
|
irreg_orig_x_on_pq, irreg_orig_y_on_pq, |
|
|
((cliprect[2]-cliprect[0])/2) / self.scale, 0, 0, |
|
|
((cliprect[3]-cliprect[1])/2) / self.scale) |
|
252 |
|
|
253 |
vs.matcher.add(cs3, key+"_cp_"+str(i)) |
vs.matcher.add(clip, key+"_clip_"+str(i)) |
254 |
|
cs_cull = vs.coords.cull(cs1c, clip); |
255 |
|
vs.matcher.add(cs_cull, key+"_cull_"+str(i)) |
256 |
|
|
257 |
|
cs1 = vs.coords.affineCoordsys(cs_cull, 100, 0.5, 0.5, 0.5, 0, 0, 0.5) |
258 |
|
vs.matcher.add(cs1, key+"_p_"+str(i)) |
259 |
|
else: |
260 |
|
cs1 = cs1c |
261 |
|
|
262 |
if onlypages == None or i in onlypages: |
if onlypages == None or i in onlypages: |
263 |
if fancy: |
if fancy: |
|
if cliprect: |
|
|
pq = GLRen.createCulledPaperQuad( |
|
|
papers[i][3], *corners) |
|
|
vs.map.put(pq, cs1, cs2, cs3) |
|
|
else: |
|
264 |
pq = GLRen.createPaperQuad( |
pq = GLRen.createPaperQuad( |
265 |
papers[i][3], *corners) |
papers[i][3], *corners) |
266 |
vs.map.put(pq, cs1, cs2) |
vs.map.put(pq, cs1, cs2) |
267 |
else: |
else: |
268 |
if cliprect: |
pq = GLRen.createPaperQuadq( |
|
pq = GLRen.createCulledPaperQuad( |
|
|
papers[i][0], *corners) |
|
|
vs.map.put(pq, cs1, cs2, cs3) |
|
|
else: |
|
|
pq = GLRen.createPaperQuad( |
|
269 |
papers[i][0], *corners) |
papers[i][0], *corners) |
270 |
vs.map.put(pq, cs1, cs2) |
vs.map.put(pq, cs1, cs2) |
271 |
|
|