;ò   tDc@sUdkZdkZdfd„ƒYZdefd„ƒYZdefd„ƒYZdS(Nsbbox_ptcBsytZdZd„Zd„Zd„Zd„Zd„Zd„Zd„Z d„Z d „Z d „Z d „Z d „Zd „Zd„Zdeeeed„Zdeeeed„Zdeeeed„Zdeeeed„Zd„ZeZd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Z d„Z!d„Z"d „Z#d!„Z$d"„Z%RS(#sÝclass for bounding boxes This variant requires points in the constructor, and is used for internal purposes. A bbox for which llx_pt is None represents an empty bbox, i.e., one containing no points. cCs(||_||_||_||_dS(N(sllx_ptsselfslly_ptsurx_ptsury_pt(sselfsllx_ptslly_ptsurx_ptsury_pt((s</mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/bbox.pys__init__)s   cCs|itj SdS(N(sselfsllx_ptsNone(sself((s</mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/bbox.pys __nonzero__/scCs¹|itj o†|itj oStt|i|iƒt|i|iƒt|i|iƒt|i |i ƒƒSqµt|i|i|i|i ƒSn t|i|i|i|i ƒSdS(sjoin two bboxesN( sselfsllx_ptsNonesothersbbox_ptsminslly_ptsmaxsurx_ptsury_pt(sselfsother((s</mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/bbox.pys__add__2s',#cCsÀ|itj ox|itj odt|i|iƒ|_t|i|iƒ|_t|i|iƒ|_t|i|iƒ|_q¸n1|i|_|i|_|i|_|i|_|SdS(sjoin two bboxes inplaceN( sselfsllx_ptsNonesothersminslly_ptsmaxsurx_ptsury_pt(sselfsother((s</mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/bbox.pys__iadd__=s     cCs~|itj o |itj oStt|i|iƒt|i|iƒt|i|iƒt|i |i ƒƒSnt ƒSdS(s!return intersection of two bboxesN( sselfsllx_ptsNonesothersbbox_ptsmaxslly_ptsminsurx_ptsury_ptsempty(sselfsother((s</mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/bbox.pys__mul__Ls  ',cCs©|itj o |itj odt|i|iƒ|_t|i|iƒ|_t|i|iƒ|_t|i|iƒ|_n|itjo t|_n|SdS(sintersect two bboxes in placeN( sselfsllx_ptsNonesothersmaxslly_ptsminsurx_ptsury_pt(sselfsother((s</mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/bbox.pys__imul__Ts  cCs#t|i|i|i|iƒSdS(N(sbbox_ptsselfsllx_ptslly_ptsurx_ptsury_pt(sself((s</mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/bbox.pyscopy_scCs4|i|_|i|_|i|_|i|_dS(N(sothersllx_ptsselfslly_ptsurx_ptsury_pt(sselfsother((s</mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/bbox.pyssetbs   cCsd|itjotdƒ‚nti|iƒti|iƒti|iƒti|i ƒfSdS(Ns*Cannot return low-res tuple for empty bbox( sselfsllx_ptsNones ValueErrorsmathsfloorslly_ptsceilsurx_ptsury_pt(sself((s</mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/bbox.pyslowrestuple_pthscCs@|itjotdƒ‚n|i|i|i|ifSdS(Ns+Cannot return high-res tuple for empty bbox(sselfsllx_ptsNones ValueErrorslly_ptsurx_ptsury_pt(sself((s</mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/bbox.pyshighrestuple_ptnscCsv|itjp |itjodSnK|i|ijp6|i|ijp#|i|ijp|i|ij SdS(s(check, if two bboxes intersect eachotheriN(sselfsllx_ptsNonesothersurx_ptslly_ptsury_pt(sselfsother((s</mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/bbox.pys intersectsss cCsŒ|itjo$||_|_||_|_nUt|i|ƒ|_t|i|ƒ|_t |i|ƒ|_t |i|ƒ|_dS(N( sselfsllx_ptsNonesx_ptsurx_ptsy_ptsury_ptsminslly_ptsmax(sselfsx_ptsy_pt((s</mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/bbox.pysincludepoint_pt}sc Csô|itjodSn|i|i|iƒ\}} |i|i|iƒ\}}|i|i|i ƒ\}}|i|i|i ƒ\}}t ||||ƒ|_t | |||ƒ|_t ||||ƒ|_t | |||ƒ|_ dS(s transform bbox in place by trafoN(sselfsllx_ptsNonestrafosapply_ptslly_ptsurx_ptslrx_ptslry_ptsury_ptsulx_ptsuly_ptsminsmax( sselfstrafosulx_ptsury_ptsurx_ptsllx_ptsuly_ptslrx_ptslry_ptslly_pt((s</mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/bbox.pys transform‡sc Csæ|itjo tƒSn|i|i|iƒ\}} |i|i|iƒ\}}|i|i|i ƒ\}}|i|i|i ƒ\}}t t||||ƒt| |||ƒt||||ƒt| |||ƒƒSdS(s return bbox transformed by trafoN(sselfsllx_ptsNonesemptystrafosapply_ptslly_ptsurx_ptslrx_ptslry_ptsury_ptsulx_ptsuly_ptsbbox_ptsminsmax( sselfstrafosulx_ptsury_ptsurx_ptsllx_ptsuly_ptslrx_ptslry_ptslly_pt((s</mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/bbox.pys transformed˜s 'icCs´|itjodSn|tjo |}n|tjo |}n|tjo |}n|tjo |}n|i|8_|i|8_|i |7_ |i |7_ dS(s‚enlarge bbox in place by the given amounts in pts all is used, if bottom, left, top and/or right are not given. N( sselfsllx_ptsNones bottom_ptsall_ptsleft_ptstop_ptsright_ptslly_ptsurx_ptsury_pt(sselfsall_pts bottom_ptsleft_ptstop_ptsright_pt((s</mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/bbox.pys enlarge_pt§s        cCsª|itjo tƒSn|tjo |}n|tjo |}n|tjo |}n|tjo |}nt |i||i ||i ||i |ƒSdS(sreturn bbox enlarged by the given amounts in pts all is used, if bottom, left, top and/or right are not given. N( sselfsllx_ptsNonesemptys bottom_ptsall_ptsleft_ptstop_ptsright_ptsbbox_ptslly_ptsurx_ptsury_pt(sselfsall_pts bottom_ptsleft_ptstop_ptsright_pt((s</mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/bbox.pys enlarged_pt¼s         c Csó|itjodSnti|ƒ}}}} |tj oti|ƒ}n|tj oti|ƒ}n|tj oti|ƒ}n|tj oti|ƒ} n|i|8_|i|8_|i| 7_|i|7_dS(sfenlarge bbox in place all is used, if bottom, left, top and/or right are not given. N(sselfsllx_ptsNonesunitstoptsalls bottom_ptsleft_ptstop_ptsright_ptsbottomsleftstopsrightslly_ptsurx_ptsury_pt( sselfsallsbottomsleftstopsrightstop_ptsleft_pts bottom_ptsright_pt((s</mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/bbox.pysenlargeÎs     c Csé|itjo tƒSnti|ƒ}}}} |tj oti|ƒ}n|tj oti|ƒ}n|tj oti|ƒ}n|tj oti|ƒ} nt|i||i||i| |i|ƒSdS(sereturn bbox enlarged all is used, if bottom, left, top and/or right are not given. N(sselfsllx_ptsNonesemptysunitstoptsalls bottom_ptsleft_ptstop_ptsright_ptsbottomsleftstopsrightsbbox_ptslly_ptsurx_ptsury_pt( sselfsallsbottomsleftstopsrightstop_ptsleft_pts bottom_ptsright_pt((s</mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/bbox.pysenlargedäs     cCs]|itjotdƒ‚ndk}|i|i|i|i|i|i|iƒSdS(s&return rectangle corresponding to bboxs!Cannot return path for empty bboxN( sselfsllx_ptsNones ValueErrorspathsrect_ptslly_ptsurx_ptsury_pt(sselfspath((s</mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/bbox.pysrect÷s  cCs2|itjotdƒ‚n|i|iSdS(sreturn height of bbox in ptss"Cannot return heigth of empty bboxN(sselfsllx_ptsNones ValueErrorsury_ptslly_pt(sself((s</mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/bbox.pys height_ptscCs2|itjotdƒ‚n|i|iSdS(sreturn width of bbox in ptss!Cannot return width of empty bboxN(sselfsllx_ptsNones ValueErrorsurx_pt(sself((s</mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/bbox.pyswidth_ptscCs+|itjotdƒ‚n|iSdS(s$return top coordinate of bbox in ptss*Cannot return top coordinate of empty bboxN(sselfsllx_ptsNones ValueErrorsury_pt(sself((s</mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/bbox.pystop_pt scCs+|itjotdƒ‚n|iSdS(s'return bottom coordinate of bbox in ptss-Cannot return bottom coordinate of empty bboxN(sselfsllx_ptsNones ValueErrorslly_pt(sself((s</mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/bbox.pys bottom_ptscCs+|itjotdƒ‚n|iSdS(s%return left coordinate of bbox in ptss+Cannot return left coordinate of empty bboxN(sselfsllx_ptsNones ValueError(sself((s</mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/bbox.pysleft_ptscCs+|itjotdƒ‚n|iSdS(s&return right coordinate of bbox in ptss,Cannot return right coordinate of empty bboxN(sselfsllx_ptsNones ValueErrorsurx_pt(sself((s</mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/bbox.pysright_ptscCsJ|itjotdƒ‚nd|i|id|i|ifSdS(s3return coordinates of the center of the bbox in ptss.Cannot return center coordinates of empty bboxf0.5N(sselfsllx_ptsNones ValueErrorsurx_ptslly_ptsury_pt(sself((s</mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/bbox.pys center_pt$scCs|iƒtiSdS(sreturn height of bboxN(sselfs height_ptsunitst_pt(sself((s</mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/bbox.pysheight*scCs|iƒtiSdS(sreturn width of bboxN(sselfswidth_ptsunitst_pt(sself((s</mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/bbox.pyswidth.scCs|itiSdS(sreturn top coordinate of bboxN(sselfsury_ptsunitst_pt(sself((s</mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/bbox.pystop2scCs|itiSdS(s return bottom coordinate of bboxN(sselfslly_ptsunitst_pt(sself((s</mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/bbox.pysbottom6scCs|itiSdS(sreturn left coordinate of bboxN(sselfsllx_ptsunitst_pt(sself((s</mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/bbox.pysleft:scCs|itiSdS(sreturn right coordinate of bboxN(sselfsurx_ptsunitst_pt(sself((s</mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/bbox.pysright>scCs.|iƒ\}}|ti|tifSdS(s,return coordinates of the center of the bboxN(sselfs center_pts centerx_pts centery_ptsunitst_pt(sselfs centery_pts centerx_pt((s</mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/bbox.pyscenterBs(&s__name__s __module__s__doc__s__init__s __nonzero__s__add__s__iadd__s__mul__s__imul__scopyssetslowrestuple_ptshighrestuple_pts intersectssincludepoint_pts transforms transformedsNones enlarge_pts enlarged_ptsenlargesenlargedsrectspaths height_ptswidth_ptstop_pts bottom_ptsleft_ptsright_pts center_ptsheightswidthstopsbottomsleftsrightscenter(((s</mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/bbox.pysbbox_ptsF                         sbboxcBstZdZd„ZRS(sclass for bounding boxescCsYti|ƒ}ti|ƒ}ti|ƒ}ti|ƒ}ti|||||ƒdS(N( sunitstoptsllx_ptslly_ptsurx_ptsury_ptsbbox_pts__init__sself(sselfsllx_ptslly_ptsurx_ptsury_pt((s</mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/bbox.pys__init__Ls (s__name__s __module__s__doc__s__init__(((s</mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/bbox.pysbboxHs semptycBstZdZd„ZRS(s1empty bounding box, i.e., one containing no pointcCsti|ttttƒdS(N(sbbox_pts__init__sselfsNone(sself((s</mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/bbox.pys__init__Ws(s__name__s __module__s__doc__s__init__(((s</mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/bbox.pysemptyTs (smathsunitsbbox_ptsbboxsempty(sbboxsemptysunitsmathsbbox_pt((s</mnt/gmirror/ports/graphics/py-PyX/work/PyX-0.10/pyx/bbox.pys?s  ÿ+