/[thuban]/branches/WIP-pyshapelib-bramz/Thuban/UI/viewport.py
ViewVC logotype

Log of /branches/WIP-pyshapelib-bramz/Thuban/UI/viewport.py

Parent Directory Parent Directory | Revision Log Revision Log


Sticky Revision:
(Current path doesn't exist after revision 2835)

Revision 2734 - (view) (annotate) - [select for diffs]
Modified Thu Mar 1 12:42:59 2007 UTC (18 years ago) by bramz
File length: 34306 byte(s)
Diff to previous 2710
made a copy

Revision 2710 - (view) (annotate) - [select for diffs]
Modified Tue Oct 10 08:31:44 2006 UTC (18 years, 4 months ago) by dpinte
Original Path: trunk/thuban/Thuban/UI/viewport.py
File length: 34306 byte(s)
Diff to previous 2700
2006-10-10 Didrik Pinte <dpinte@itae.be>
    * Thuban/Model/layer.py (Layer.GetLabelPosFromShape): new method 
        extracted from Thuban/UI/viewport.py
    * Thuban/UI/viewport.py (Viewport.LabelShapeAt): uses new method



Revision 2700 - (view) (annotate) - [select for diffs]
Modified Mon Sep 18 14:27:02 2006 UTC (18 years, 5 months ago) by dpinte
Original Path: trunk/thuban/Thuban/UI/viewport.py
File length: 35633 byte(s)
Diff to previous 2643
2006-09-18 Didrik Pinte <dpinte@itae.be>
    
        * wxPython 2.6 update : wx 2.4 syntax has been updated to 2.6



Revision 2643 - (view) (annotate) - [select for diffs]
Modified Tue Jul 5 16:00:48 2005 UTC (19 years, 8 months ago) by bh
Original Path: trunk/thuban/Thuban/UI/viewport.py
File length: 35651 byte(s)
Diff to previous 2544
(ViewPort.set_view_transform): Handle
ZeroDivisionError exceptions.  I don't know when they happen
exactly.  It probably happens when the projections aren't set
properly.


Revision 2544 - (view) (annotate) - [select for diffs]
Modified Mon Jan 24 11:19:53 2005 UTC (20 years, 1 month ago) by bh
Original Path: trunk/thuban/Thuban/UI/viewport.py
File length: 35159 byte(s)
Diff to previous 2396
Rework the status bar updates a bit to make sure the message about
the projections is produced at the right times.

* Thuban/UI/mainwindow.py (MainWindow.update_status_bar_messages):
New class variable with messages that may require a status bar
update.
(MainWindow.view_position_changed)
(MainWindow.update_status_bar): Rename from view_position_changed
to update_status_bar.  It's meaning has changed now that it may
also generate messages about problems with projection settings.
(MainWindow.__init__): Use the new update_status_bar_messages
class variable to subscribe update_status_bar
(MainWindow.set_position_text): Update doc-string.  This method
has to be renamed at some point.  See doc-string and comments.
(MainWindow.OnClose): Unsubscribe update_status_bar from all
messages in update_status_bar_messages

* Thuban/UI/viewport.py (ViewPort.forwarded_map_messages): New
class attribute.  map messages to be forwarded by the viewport.
(ViewPort._subscribe_map, ViewPort._unsubscribe_map): (un)subscribe
the messages in forwarded_map_messages


Revision 2396 - (view) (annotate) - [select for diffs]
Modified Thu Nov 18 20:17:43 2004 UTC (20 years, 3 months ago) by jan
Original Path: trunk/thuban/Thuban/UI/viewport.py
File length: 34617 byte(s)
Diff to previous 2297
(ViewPort._hit_point): Added optional parameter
size' defaulting to the previously fixed value 5.
Extended doc-string.
(Viewport._find_shape_in_layer): Resolved FIXME regarding flexibility
for symbols.
Now the size of the largest point symbol is determined to find out
about whether the point has been hit.
This fixes the problem that only clicks inside a fixed distance of
5 where found.


Revision 2297 - (view) (annotate) - [select for diffs]
Modified Thu Jul 22 13:07:52 2004 UTC (20 years, 7 months ago) by bh
Original Path: trunk/thuban/Thuban/UI/viewport.py
File length: 33958 byte(s)
Diff to previous 2289
* 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()


Revision 2289 - (view) (annotate) - [select for diffs]
Modified Fri Jul 16 19:47:29 2004 UTC (20 years, 7 months ago) by bh
Original Path: trunk/thuban/Thuban/UI/viewport.py
File length: 33573 byte(s)
Diff to previous 1985
* test/test_viewport.py
(ViewPortTest.test_changing_map_projection): Check that changing
the projection of an empty map shown in a viewport doesn't lead to
exceptions in the viewport's handler for the
MAP_PROJECTION_CHANGED messages

* Thuban/UI/viewport.py (ViewPort.map_projection_changed): Only
try to keep the same region visible when the map actually contains
something


Revision 1985 - (view) (annotate) - [select for diffs]
Modified Thu Nov 27 16:04:42 2003 UTC (21 years, 3 months ago) by bh
Original Path: trunk/thuban/Thuban/UI/viewport.py
File length: 33334 byte(s)
Diff to previous 1780
(ViewPort.map_projection_changed): Use
InverseBBox to unproject bboxes


Revision 1780 - (view) (annotate) - [select for diffs]
Modified Mon Oct 6 17:31:31 2003 UTC (21 years, 5 months ago) by bh
Original Path: trunk/thuban/Thuban/UI/viewport.py
File length: 33347 byte(s)
Diff to previous 1771
Forward the map's TITLE_CHANGED messages
(ViewPort): Derive from Conduit instead of Publisher
(ViewPort.Subscribe, ViewPort.Unsubscribe): Use the new base class
when calling the inherited versions
(ViewPort._subscribe_map, ViewPort._unsubscribe_map): New helper
methods to subscribe and unsubscribe map messages
(ViewPort.SetMap, ViewPort.Destroy): Use the new helper methods to
handle the map subscriptions
(ViewPort.Map, ViewPort.map_projection_changed)
(ViewPort.layer_projection_changed): Add or update doc-strings


Revision 1771 - (view) (annotate) - [select for diffs]
Modified Mon Oct 6 11:28:38 2003 UTC (21 years, 5 months ago) by bh
Original Path: trunk/thuban/Thuban/UI/viewport.py
File length: 32669 byte(s)
Diff to previous 1593
(ViewPort.GetTextExtent): Turn this method
into what would be a "pure virtual function" in C++: always raise
NotImplementedError. Mock implementations for test cases don't
belong into the real code


Revision 1593 - (view) (annotate) - [select for diffs]
Modified Fri Aug 15 14:10:27 2003 UTC (21 years, 6 months ago) by bh
Original Path: trunk/thuban/Thuban/UI/viewport.py
File length: 32492 byte(s)
Diff to previous 1589
Change the way shapes are returned by a shape store. The
ShapesInRegion method returns an iterator over actual shape
objects instead of a list of shape ids.

* Thuban/Model/data.py (ShapefileShape.ShapeID): New. Return shape
id.
(ShapefileStore.ShapesInRegion): Return an iterator over the
shapes which yields shape objects instead of returning a list of
shape ids
(ShapefileStore.AllShapes): New. Return an iterator over all
shapes in the shape store
(DerivedShapeStore.AllShapes): New. Like in ShapefileStore

* Thuban/Model/layer.py (Layer.ShapesInRegion): Update
doc-string.

* Thuban/UI/baserenderer.py
(BaseRenderer.layer_ids, BaseRenderer.layer_shapes): Rename to
layer_shapes and make it return an iterator containg shapes
instead of a list of ids.
(BaseRenderer.draw_shape_layer): Update doc-string; Adapt to
layer_shapes() change

* Thuban/UI/renderer.py (ScreenRenderer.layer_ids)
(ScreenRenderer.layer_shapes): Rename as in BaseRenderer

* Thuban/UI/viewport.py (ViewPort._find_shape_in_layer): Adapt to
changes in the ShapesInRegion return value.
(ViewPort._get_hit_tester): Remove commented out code

* test/mockgeo.py (SimpleShapeStore.ShapesInRegion): Adapt to the
new return value.
(SimpleShapeStore.AllShapes): New. Implement this method too.

* test/test_layer.py (TestLayer.test_arc_layer)
(TestLayer.test_polygon_layer, TestLayer.test_point_layer)
(TestLayer.test_point_layer_with_projection)
(TestLayer.test_derived_store): Adapt to changes in the
ShapesInRegion return value.

* test/test_shapefilestore.py
(TestShapefileStoreArc.test_shapes_in_region)
(TestShapefileStorePolygon.test_shapes_in_region)
(TestShapefileStorePoint.test_shapes_in_region): Adapt to changes
in the ShapesInRegion return value.
(TestShapefileStorePoint.test_all_shapes)
(TestShapefileStoreArc.test_shape_shapeid): New tests for the new
methods

* test/test_derivedshapestore.py
(TestDerivedShapeStore.test_shapes_in_region): Adapt to changes in
the ShapesInRegion return value.
(TestDerivedShapeStore.test_all_shapes)
(TestDerivedShapeStore.test_shape_shapeid): New tests for the new
methods


Revision 1589 - (view) (annotate) - [select for diffs]
Modified Fri Aug 15 12:49:08 2003 UTC (21 years, 6 months ago) by bh
Original Path: trunk/thuban/Thuban/UI/viewport.py
File length: 33123 byte(s)
Diff to previous 1551
* Thuban/UI/viewport.py (ViewPort.find_shape_at)
(ViewPort._find_shape_in_layer, ViewPort._find_shape_in_layer)
(ViewPort._get_hit_tester, ViewPort.projected_points)
(ViewPort._hit_point, ViewPort._hit_arc, ViewPort._hit_polygon)
(ViewPort._find_label_at): Split the find_shape_at method into
several new methods and use the functions in the hit-test module.

* Thuban/UI/hittest.py: New module with Python-level hit-testing
functions

* test/test_hittest.py: New. Test for the new hittest module


Revision 1551 - (view) (annotate) - [select for diffs]
Modified Wed Aug 6 17:21:07 2003 UTC (21 years, 7 months ago) by bh
Original Path: trunk/thuban/Thuban/UI/viewport.py
File length: 30527 byte(s)
Diff to previous 1539
* Thuban/Model/data.py (ShapefileStore.Shape): For consistency, a
Shape object will always have the coordinates as a list of list of
coordinate pairs (tuples).
(Shape.compute_bbox): Adapt to new representation.

* Thuban/UI/viewport.py (ViewPort.find_shape_at)
(ViewPort.LabelShapeAt): Adapt to new coordinate representation in
Shape objects.

* test/test_shapefilestore.py
(ShapefileStoreTests.assertFloatTuplesEqual)
(ShapefileStoreTests.assertPointListEquals): Rename to
assertPointListEquals and change purpose to checking equality of
the lists returned by Shape.Points().
(TestShapefileStoreArc.test_shape)
(TestShapefileStorePolygon.test_shape)
(TestShapefileStorePoint.test_shape): Use the new
assertPointListEquals instead of assertFloatTuplesEqual

* test/test_layer.py (TestLayer.assertFloatTuplesEqual)
(TestLayer.assertPointListEquals): Rename to assertPointListEquals
and change purpose to checking equality of the lists returned by
Shape.Points().
(TestLayer.test_arc_layer, TestLayer.test_arc_layer)
(TestLayer.test_polygon_layer, TestLayer.test_point_layer)
(TestLayer.test_derived_store): Use the new assertPointListEquals
instead of assertFloatTuplesEqual

* test/test_derivedshapestore.py
(TestDerivedShapeStore.assertFloatTuplesEqual)
(TestDerivedShapeStore.assertPointListEquals): Rename to
assertPointListEquals and change purpose to checking equality of
the lists returned by Shape.Points().
(TestDerivedShapeStore.test_shape): Use the new
assertPointListEquals instead of assertFloatTuplesEqual


Revision 1539 - (view) (annotate) - [select for diffs]
Modified Fri Aug 1 14:27:57 2003 UTC (21 years, 7 months ago) by bh
Original Path: trunk/thuban/Thuban/UI/viewport.py
File length: 30518 byte(s)
Diff to previous 1482
Import the SHAPETYPE_* constants from data
instead of layer.


Revision 1482 - (view) (annotate) - [select for diffs]
Modified Thu Jul 24 17:53:04 2003 UTC (21 years, 7 months ago) by bh
Original Path: trunk/thuban/Thuban/UI/viewport.py
File length: 30526 byte(s)
Diff to previous 1468
Remove commented out code that wouldn't
belong in viewport anyway


Revision 1468 - (view) (annotate) - [select for diffs]
Modified Tue Jul 22 14:03:14 2003 UTC (21 years, 7 months ago) by jonathan
Original Path: trunk/thuban/Thuban/UI/viewport.py
File length: 30814 byte(s)
Diff to previous 1464
(ViewPort.calc_min_max_scales): New.
        Calculates the minimum and maximum scale values. Factored out
        of set_view_transform so that it could be used to zoom all the
        way into a single point.
(ViewPort.set_view_transform): Call calc_min_max_scales().
(ViewPort.FitSelectedToWindow): Zoom to the maximum scale
        if only a single point is selected.


Revision 1464 - (view) (annotate) - [select for diffs]
Modified Fri Jul 18 18:20:40 2003 UTC (21 years, 7 months ago) by bh
Original Path: trunk/thuban/Thuban/UI/viewport.py
File length: 30543 byte(s)
Diff to previous 1456
* Thuban/UI/messages.py (MAP_REPLACED): New message.

* Thuban/UI/viewport.py (ViewPort.SetMap): Issue MAP_REPLACED
after the new map has been assigned

* Thuban/UI/mainwindow.py (MainWindow.delegated_messages):
Delegate MAP_REPLACED to the canvas too
(MainWindow.prepare_new_session): Removed. Thanks to the new
MAP_REPLACED message it's no longer needed
(MainWindow.OpenSession, MainWindow.NewSession):
prepare_new_session has been removed.

* Thuban/UI/classifier.py (Classifier.__init__): Subscribe to
MAP_REPLACED so that we can close the dialog if a new map is set.
(Classifier.unsubscribe_messages): Unsubscribe from MAP_REPLACED
(Classifier.map_replaced): Handle MAP_REPLACED by closing the
dialog

* test/test_viewport.py (SimpleViewPortTest)
(SimpleViewPortTest.test_default_size): Add doc-strings
(ViewPortTest.setUp): Bind map to self.map so we can use it in
tests. Subscribe to MAP_REPLACED messages too.
(ViewPortTest.tearDown): No need to explicitly unsubscribe
(ViewPortTest.test_set_map): New test for the SetMap method.


Revision 1456 - (view) (annotate) - [select for diffs]
Modified Fri Jul 18 14:56:13 2003 UTC (21 years, 7 months ago) by bh
Original Path: trunk/thuban/Thuban/UI/viewport.py
File length: 30396 byte(s)
Diff to previous 1454
* Thuban/UI/viewport.py: Remove unused imports

* Thuban/UI/view.py: Remove unused imports


Revision 1454 - (view) (annotate) - [select for diffs]
Modified Fri Jul 18 14:41:04 2003 UTC (21 years, 7 months ago) by bh
Original Path: trunk/thuban/Thuban/UI/viewport.py
File length: 30626 byte(s)
Diff to previous 1452
* test/test_export.py Remove unused imports. The OutputTransform
function is now in viewport.py and is called output_transform
(TestScalebar.test_output_transform)
(TestScalebar.test_OutputTransform): Renamed to
test_output_transform and updated to use output_transform instead
of OutputTransform

* Thuban/UI/view.py (OutputTransform): Moved to viewport.py and
renamed.
(MapCanvas.Export, MapPrintout.draw_on_dc): OutputTransform was
renamed to output_transform

* Thuban/UI/viewport.py (OutputTransform, output_transform):
Rename to output_transform


Revision 1452 - (view) (annotate) - [select for diffs]
Modified Fri Jul 18 12:57:59 2003 UTC (21 years, 7 months ago) by bh
Original Path: trunk/thuban/Thuban/UI/viewport.py
File length: 30625 byte(s)
Diff to previous 1435
* Thuban/Model/layer.py (Layer.__init__): Rename
classificationField to classificatin_column and init it here so
that it can be used in SetClassificationColumn
(Layer.GetClassificationColumn, Layer.GetClassificationField):
Rename to GetClassificationColumn.
(Layer.SetClassificationColumn, Layer.SetClassificationField):
Rename to SetClassificationColumn and issue a LAYER_CHANGED
message if the column changes.
(Layer._classification_changed, Layer.ClassChanged): Rename to
_classification_changed. Update the callers.
(Layer.SetShapeStore): Further field->column renames.

* Thuban/Model/load.py (SessionLoader.start_classification)
(SessionLoader.start_clpoint): Updates because of
field->column method name changes in the Layer class

* Thuban/Model/save.py (SessionSaver.write_classification): Updates
because of field->column method name changes in the Layer class

* Thuban/UI/classifier.py (Classifier.__init__)
(Classifier._OnTry, Classifier._OnRevert): Updates because of
field->column method name changes in the Layer class

* Thuban/UI/renderer.py (MapRenderer.draw_shape_layer): Updates
because of field->column method name changes in the Layer class

* Thuban/UI/viewport.py (ViewPort.find_shape_at): Updates because
of field->column method name changes in the Layer class

* test/test_save.py (SaveSessionTest.testClassifiedLayer)
(SaveSessionTest.testClassifiedLayer): Update because of
field->column method name changes in the Layer class

* test/test_layer.py (SetShapeStoreTests.setUp)
(SetShapeStoreTests.test_sanity): Update because of field->column
method name changes in the Layer class
(TestLayerModification.setUp): Subscribe to LAYER_CHANGED as well
(TestLayerModification.test_sanity)
(TestLayerModification.test_initial_settings): remove unsued code
and rename to test_sanity.
(TestLayerModification.test_set_classification): New test for
SetClassification and SetClassificationField.


Revision 1435 - (view) (annotate) - [select for diffs]
Modified Wed Jul 16 13:24:52 2003 UTC (21 years, 7 months ago) by jonathan
Original Path: trunk/thuban/Thuban/UI/viewport.py
File length: 30624 byte(s)
Diff to previous 1405
(ViewPort.find_shape_at): Get the classification field from layer.


Revision 1405 - (view) (annotate) - [select for diffs]
Modified Thu Jul 10 16:49:57 2003 UTC (21 years, 7 months ago) by jonathan
Original Path: trunk/thuban/Thuban/UI/viewport.py
File length: 30607 byte(s)
Diff to previous 1386
(Tool.MouseUp): Should have called
    drag_stop, not drag_move when the mouse is released.


Revision 1386 - (view) (annotate) - [select for diffs]
Added Thu Jul 10 14:52:48 2003 UTC (21 years, 7 months ago) by jonathan
Original Path: trunk/thuban/Thuban/UI/viewport.py
File length: 30607 byte(s)
New. Contains non-wx view functionality.  RTTbug #1992.


This form allows you to request diffs between any two revisions of this file. For each of the two "sides" of the diff, enter a numeric revision.

  Diffs between and
  Type of Diff should be a

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26