10 |
# Module pagespanview |
# Module pagespanview |
11 |
|
|
12 |
globalseedoffs = 0 |
globalseedoffs = 0 |
13 |
globalLOD = 1 |
globalLOD = 0 |
14 |
|
|
15 |
|
|
16 |
def enf2span(enf): |
def enf2span(enf): |
108 |
|
|
109 |
|
|
110 |
class CellPDFView: |
class CellPDFView: |
111 |
|
dicefactor = 1.0 |
112 |
"""A view of a PDF file in a cell, spread out in space. |
"""A view of a PDF file in a cell, spread out in space. |
113 |
""" |
""" |
114 |
def __init__(self, cell): |
def __init__(self, cell): |
126 |
self.scale = h/ph |
self.scale = h/ph |
127 |
|
|
128 |
self.scaledsheetsize = (self.pap[0][1] * self.scale, self.pap[0][2] * self.scale) |
self.scaledsheetsize = (self.pap[0][1] * self.scale, self.pap[0][2] * self.scale) |
129 |
|
self.scaledsize = (len(self.pap) * self.scaledsheetsize[0], self.scaledsheetsize[1]) |
130 |
print "Scaledsize: ",self.scaledsheetsize |
print "Scaledsize: ",self.scaledsheetsize |
131 |
# Height = always 1. |
# Height = always 1. |
132 |
# Start = always (0,0) |
# Start = always (0,0) |
133 |
def placepapers(self, vs, |
def placepapers(self, vs, |
134 |
cs1into, onlypages=None, depth=10, |
cs1into, onlypages=None, depth=10, |
135 |
cliprect = None, |
cliprect = None, |
136 |
fancy = 1): |
fancy = 1, |
137 |
|
showTessel = 0): |
138 |
key = self.cell.getId() |
key = self.cell.getId() |
139 |
# The height in coords |
# The height in coords |
140 |
papers = self.pap |
papers = self.pap |
143 |
# print "x,y for place: ",curx, ycoord |
# print "x,y for place: ",curx, ycoord |
144 |
# print papers |
# print papers |
145 |
grid = 13 |
grid = 13 |
146 |
corners = (0, 0, papers[0][1], papers[0][2]) |
corners = (0, 0, papers[0][1], papers[0][2], self.dicefactor) |
147 |
cs2 = vs.coords.affineCoordsys(0, 0, 0, 0, 1, 0, 0, 1) |
cs2 = vs.coords.affineCoordsys(0, 0, 0, 0, 1, 0, 0, 1) |
148 |
vs.matcher.add(cs2, key+"_p2_") |
vs.matcher.add(cs2, key+"_p2_") |
149 |
|
|
184 |
vs.map.put(self.white) |
vs.map.put(self.white) |
185 |
vs.map.put(self.irregu.content, cs1into, irr) |
vs.map.put(self.irregu.content, cs1into, irr) |
186 |
|
|
187 |
if 0: |
if showTessel: |
188 |
vs.map.put(GLCache.getCallList(""" |
vs.map.put(GLCache.getCallList(""" |
189 |
|
PushAttrib POLYGON_BIT |
190 |
PolygonMode FRONT_AND_BACK LINE |
PolygonMode FRONT_AND_BACK LINE |
191 |
|
LineWidth 1 |
192 |
""")) |
""")) |
193 |
ContentR().run() |
ContentR().run() |
194 |
|
FrameR().run() |
195 |
if 1: |
pp.run() |
196 |
|
vs.map.put(GLCache.getCallList(""" |
197 |
|
PopAttrib |
198 |
|
""")) |
199 |
|
else: |
200 |
Stencil.drawStenciled(vs, |
Stencil.drawStenciled(vs, |
201 |
ContentR(), |
ContentR(), |
202 |
None, |
None, |