Parent Directory
|
Revision Log
Sticky Revision: |
made a copy
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
2006-09-18 Didrik Pinte <dpinte@itae.be> * wxPython 2.6 update : wx 2.4 syntax has been updated to 2.6
(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.
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
(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.
* 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()
* 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
(ViewPort.map_projection_changed): Use InverseBBox to unproject bboxes
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
(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
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
* 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
* 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
Import the SHAPETYPE_* constants from data instead of layer.
Remove commented out code that wouldn't belong in viewport anyway
(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.
* 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.
* Thuban/UI/viewport.py: Remove unused imports * Thuban/UI/view.py: Remove unused imports
* 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
* 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.
(ViewPort.find_shape_at): Get the classification field from layer.
(Tool.MouseUp): Should have called drag_stop, not drag_move when the mouse is released.
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.
[email protected] | ViewVC Help |
Powered by ViewVC 1.1.26 |