Parent Directory
|
Revision Log
Sticky Revision: |
2007-04-12 Didrik Pinte <dpinte@itae.be> * Removed workaround for file encoding in the Thuban code
made a copy
2007-01-06 Didrik Pinte <dpinte@itae.be> UTF-8 locales support reading non utf-8 files. This is a workaround and not a real bugfix. See http://wald.intevation.org/tracker/index.php?func=detail&aid=118 for more details * Thuban/UI/ tableview.py, controls.py, baserenderer.py, view.py: decode text from iso-8859-1 encoding.
2006-09-18 Didrik Pinte <dpinte@itae.be> * wxPython 2.6 update : wx 2.4 syntax has been updated to 2.6
(BaseRenderer.draw_raster_layer): Pass the opacity of the layer to draw_raster_data rather than the layer. (BaseRenderer.draw_raster_data): Remove the layer parameter because the function doesn't need to know about the layer. Add the optional opacity parameter whose default is 1.0. Add 'PNG' as a supported graphics format.
Add support for adjusting the opacity of a raster layer.
Refactored baserenderer.py and renderer.py to remove baserenderer.py's dependencies on wxPython. Added a new method projected_raster_layer() that returns a raster layer image in projected space. This must be implemented in classes derived from BaseRenderer. This also eliminates the dependency on gdal in baserenderer.py.
Further wxPython 2.5 changes using patches from Daniel Calvelo Aros so that that wxproj doesn't crash. Added GUI support for selecting alpha channel (opacity can't be selected yet).
Make layer's use_mask flag default to true. Support a bit array describing the mask to use. Improve error handling in ProjectRasterFile (also addresses RT #2947).
Add a new dialog box for raster layers. The dialog box allows the user to toggle a mask that is generated by ProjectRasterFile and is used to only draw the real parts of the projected image.
Improved rendering raster layers by changing the return format of the ProjectRasterFile function.
* Thuban/Model/base.py (UnsetModified): Fixed some typos in docstring. * Thuban/UI/baserenderer.py (BaseRenderer.draw_polygon_shape()): Added hints on the used algorithm for handling holes.
(BaseRenderer.draw_shape_layer_incrementally): If the draw function is for points, call it with the size as additional parameter. BaseRenderer.draw_point_shape): Added additional, optional parameter for the size. Compute the radius using the size.
(BaseRenderer.render_map_incrementally): Fix a logic bug in the optimization that tries not to draw layers under a raster layer. The bug was harmless. All it effectively did was to produce The a strange messages about not being able to draw Layer instances for all vector layers below a raster layer which would be invisible anyway because the raster layer currently always covers the entire window
Fix some typos.
Avoid warnings when run under Python 2.3 (BaseRenderer.draw_point_shape) (BaseRenderer.draw_label_layer): Coordinates must be ints.
Add a way to specify how layers in extensions are to be rendered. (_renderer_extensions): New. List with renderer for layers in extensions (add_renderer_extension): New. Add a renderer extension (init_renderer_extensions): New. Init the renderer extensions (BaseRenderer.render_map_incrementally): Search _renderer_extensions for how to draw unknown layer types (BaseRenderer.draw_raster_data): Add format parameter so that formats other than BMP can be drawn (BaseRenderer.draw_raster_layer): Pass an explicit format to draw_raster_data
(BaseRenderer.draw_shape_layer_incrementally): Use the ReadValue method. ReadValue is faster than ReadRowAsDict since it only reads one cell especially now that the dbf file objects actually implement it.
(BaseRenderer.draw_shape_layer_incrementally): Cache the pens and brushes for the groups so that they're not created over and over again
(BaseRenderer.draw_shape_layer_incrementally): Speed up the special case of a classification that only has the default group
Several rendering changes: - Render the selection into a separate bitmap so that only that bitmap needs to be redrawn when the selection changes - Render incrementally showing previews and allowing interaction before rendering is complete - Update the renderer interface a bit. Most parameters of RenderMap are now parameters of the constructor * Thuban/UI/baserenderer.py (BaseRenderer.__init__): Add the map and the update region as parameters. Update the doc-string (BaseRenderer.render_map_incrementally): New. Generator function to renders the map incrementally (BaseRenderer.render_map): Remove the map argument (it's now in the constructor) and simply iterate over the render_map_incrementally generator to draw the map. (BaseRenderer.draw_shape_layer_incrementally) (BaseRenderer.draw_shape_layer): Renamed to draw_shape_layer_incrementally and changed into a generator that yields True every 500 shapes. Used by render_map_incrementally to render shape layers incrementally * Thuban/UI/renderer.py (ScreenRenderer.RenderMap): Removed the map and region parameters which are now in the constructor (ScreenRenderer.RenderMapIncrementally): New. Public frontend for the inherited render_map_incrementally. (BaseRenderer.draw_shape_layer): Removed. (ScreenRenderer.draw_selection_incrementally): New. The selection drawing part of the removed draw_shape_layer as a generator (ScreenRenderer.layer_shapes): Update because of the region parameter change (ExportRenderer.__init__): New. Extend the inherited constructor with the destination region for the drawing (ExportRenderer.RenderMap): Removed the map and region parameters which are now in the constructor * Thuban/UI/view.py (MapCanvas.PreviewBitmap): New. Return a bitmap suitable for a preview in a tool (CanvasPanTool.MouseMove): Use the PreviewBitmap method to get the bitmap (MapPrintout.draw_on_dc): Adapt to new renderer interface (MapCanvas.OnPaint): Handle drawing the selection bitmap if it exists (MapCanvas.OnIdle): Update the logic to deal with incremental rendering and the selection bitmap (MapCanvas._do_redraw): Handle the instantiation of the render iterator and the redraws during rendering (MapCanvas._render_iterator): New. Generator to incrementally redraw both bitmaps (MapCanvas.Export): Adapt to new renderer interface. (MapCanvas.full_redraw): Reset the selection bitmap and the renderer iterator too (MapCanvas.redraw_selection): New. Force a redraw of the selection bitmap (MapCanvas.shape_selected): Only redraw the selection bitmap
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
Make the renderers deal correctly with raw vs. python level representation of shape geometries * Thuban/UI/baserenderer.py (BaseRenderer.low_level_renderer): Return a flag useraw in addition to the callable and the parameter to indicate whether the callable can deal with the raw shape data or uses the higher level python lists of coordinates. The callable now should accept either the raw data or the return value of the shape's Points() method. (BaseRenderer.draw_shape_layer): Adapt to the low_level_renderer change (BaseRenderer.projected_points): Instead of the shape id use the points list as parameter. (BaseRenderer.draw_polygon_shape, BaseRenderer.draw_arc_shape) (BaseRenderer.draw_point_shape): Adapt to projected_points() change and accept the points list as parameter instead of the shape id. * Thuban/UI/renderer.py (MapRenderer.low_level_renderer): Return the useraw flag as required by the BaseRenderer (ScreenRenderer.draw_shape_layer): Adapt to low-level renderer changes. * test/test_baserenderer.py (TestBaseRenderer.test_point_with_classification): New test for rendering a map with classifications.
New file with the basic rendering logic. The code in this file is completely independend of wx. (BaseRenderer): Class with the basic rendering logic
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 |