bh: thuban/Thuban/UI viewport.py,1.17,1.18
cvs@intevation.de
cvs at intevation.de
Thu Jul 22 15:07:54 CEST 2004
Author: bh
Update of /thubanrepository/thuban/Thuban/UI
In directory doto:/tmp/cvs-serv30330/Thuban/UI
Modified Files:
viewport.py
Log Message:
* Thuban/UI/viewport.py (ViewPort.VisibleExtent): New. Return the
visible extent of the map in projected coordinates
* test/test_viewport.py (SimpleViewPortTest.test_default_size)
(SimpleViewPortTest.test_init_with_size): Add some VisibleExtent()
tests.
(SimpleViewPortTest.test_visible_extent): New. The real test for
VisibleExtent()
Index: viewport.py
===================================================================
RCS file: /thubanrepository/thuban/Thuban/UI/viewport.py,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- viewport.py 16 Jul 2004 19:47:29 -0000 1.17
+++ viewport.py 22 Jul 2004 13:07:52 -0000 1.18
@@ -431,6 +431,17 @@
offx, offy = self.offset
return ((x - offx) / self.scale, (offy - y) / self.scale)
+ def VisibleExtent(self):
+ """Return the extent of the visible region in projected coordinates
+
+ The return values is a tuple (llx, lly, urx, ury) describing the
+ region.
+ """
+ width, height = self.GetPortSizeTuple()
+ llx, lly = self.win_to_proj(0, height)
+ urx, ury = self.win_to_proj(width, 0)
+ return (llx, lly, urx, ury)
+
def FitRectToWindow(self, rect):
"""Fit the rectangular region given by rect into the window.
More information about the Thuban-devel
mailing list
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)