2002-05-10 Bernhard Herzog * setup.py (py_modules): The shptree modules doesn't have a wrapper, so don't include it in the py_modules 2002-05-08 Bernhard Herzog * extensions/shapelib/shptree.c (compare_ints): Make arguments const void * as in the qsort prototype (SHPTreeFindLikelyShapes): Remove some unused variables. * Thuban/UI/view.py (PanTool.MouseMove): Use the bitmap the view maintains to redraw the window during a drag. (MapCanvas.unprojected_rect_around_point): New method to determine a small region around a point for hit-testing. (MapCanvas.find_shape_at): Only test the shapes in a small region around the point. * setup.py: Increment the version to 0.1.2 * Thuban/UI/tree.py (SessionTreeCtrl.unsubscribe_all): Remove a debug print and set session to None after unsubscribing 2002-05-07 Bernhard Herzog * Data/iceland_sample.session, Data/iceland_sample.thuban: Rename the file to have a .thuban extension. * Thuban/UI/tree.py (session_channels): New class constant with all the session channels to subscribe to to update the tree (SessionTreeCtrl.session_changed): Remember the session so that we can unsubscribe properly. Use the new class constant to unsubscribe from the old session and subscribe to the new one. (SessionTreeCtrl.unsubscribe_all): New method to unsubscribe all subscriptions of the SessionTreeCtrl. (SessionTreeView.OnClose): Call the tree's unsubscribe_all method. * Thuban/UI/mainwindow.py (MainWindow.__init__): Add the "Show Session Tree" command to the file menu. * Thuban/UI/view.py (MapCanvas.do_redraw): Pass the entire bitmap as update_region to the renderer. * Thuban/UI/renderer.py (ScreenRenderer.layer_ids, ScreenRenderer.draw_shape_layer): The update box is now directly a tuple, not a wxRect anymore. * Thuban/Model/layer.py (Layer.ShapesInRegion): Remove some debug prints. 2002-05-07 Bernhard Herzog * setup.py: Add the shptree extension module. See extensions/pyshapelib/ChangeLog for more details. * extensions/shapelib/shpopen.c, extensions/shapelib/shapefil.h, extensions/shapelib/dbfopen.c: Really update to the versions of shapelib 1.2.9. For some reason it wasn't really done on 2002-04-11. * extensions/shapelib/shptree.c: Modified version of shptree.c of shapelib 1.2.9. The only real difference is the use of qsort instead of a bubble sort implementation * Thuban/Model/layer.py (Layer.__init__): New instance variable shapetree to hold the shapelib quadtree for the shapefile (Layer.open_shapefile): Create the quad tree. (Layer.ShapesInRegion): New method to return the ids of shapes in a given region using the quad tree. * extensions/thuban/wxproj.cpp (project_points): Fix some typos in comment (draw_polygon_shape): Accept both arcs and polygons. (initwxproj): Use the new PYSHAPELIB_IMPORT_API macro to import the api. * Thuban/UI/renderer.py (MapRenderer.layer_ids): New method to return the shape ids to be rendered in a given layer. (MapRenderer.draw_shape_layer): Call layer_ids to get the list of ids. Use draw_polygon_shape to draw arc shapes as well. (ScreenRenderer.RenderMap): New parameter for the rectangle that has to be updated (ScreenRenderer.layer_ids): Make use of the layer's quadtree by calling it's ShapesInRegion method. * Thuban/UI/view.py (MapCanvas.__init__): New instance variable update_region for the update region. (MapCanvas.OnPaint): Maintain the update region (MapCanvas.do_redraw): Pass the bounding box of the update_region to the renderer when drawing the bitmap. Reset the update_region. 2002-05-03 Bernhard Herzog * Thuban/UI/mainwindow.py (MainWindow.SaveSessionAs, MainWindow.OpenSession): Change the file extension of the session files to .thuban * Thuban/Model/session.py (Session.AddMap, forwarded_channels): Move the map channels to be forwarded by the session into the class constant with forwarded_channels. Also add LAYER_PROJECTION_CHANGED and LAYER_VISIBILITY_CHANGED to forwarded_channels * Thuban/Model/base.py (Modifiable.changed): Fix doc-string (a typo and some rewording). 2002-05-02 Bernhard Herzog * Thuban/UI/view.py: Keep the temporary bitmap used during drawing around to speed up most redraws: (MapCanvas.__init__): New instance variable bitmap which holds the bitmap (MapCanvas.do_redraw): Redraw self.bitmap if necessary. Use self.bitmap to draw. (MapCanvas.full_redraw): New method to force a full redraw including the bitmap (MapCanvas.SetMap): Subscribe full_redraw instead of redraw to make sure the bitmap is redrawn. (MapCanvas.projection_changed, MapCanvas.set_view_transform, MapCanvas.shape_selected): Call full_redraw instead of readraw to make sure the bitmap is redrawn. (MapCanvas.OnSize): New method to handle size events so that the bitmap can be redrawn. 2002-04-29 Bernhard Herzog * Thuban/UI/mainwindow.py (MainWindow.__init__): Subscribe to the canvas' VIEW_POSITION event (MainWindow.view_position_changed): Handler for VIEW_POSITION. Update the text in the status-bar accordingly. * Thuban/UI/view.py (MapCanvas): Derive from Publisher as well (MapCanvas.__del__): Implement because Publisher.__del__ has to be called. (MapCanvas.__init__): Bind EVT_LEAVE_WINDOW too. Initialize current_position (MapCanvas.set_current_position): New method to set current_position. Issue a VIEW_POSITION event (MapCanvas.CurrentPosition): New public method to return the value of current_position. Should be called when the VIEW_POSITION event is processed. (MapCanvas.OnLeftDown, MapCanvas.OnLeftUp, MapCanvas.OnMotion): Update the position. (MapCanvas.OnLeaveWindow): Set the position to None. * Thuban/UI/messages.py (VIEW_POSITION): New message for the position in the statusbar 2002-04-26 Frank Koormann * Thuban/UI/mainwindow.py: AddLayer, Dialog title s/session/data 2002-04-24 Frank Koormann * Resources/Bitmaps/identify.xpm: shadow added * Resources/Bitmaps/fullextent.xpm: new 2002-04-22 Jan-Oliver Wagner * Thuban/UI/tree.py (update_tree): added test for None on map bounding box 2002-04-21 Jan-Oliver Wagner * Thuban/UI/proj4dialog.py (UTMProposeZoneDialog): new * Thuban/UI/tree.py (update_tree): added added map extent * Thuban/UI/mainwindow.py (_method_command): extended by parameter icon; added map_full_extend as tool 2002-04-19 Jan-Oliver Wagner * Thuban/UI/mainwindow.py (SaveSession): launch save as dialog for saving _new_ sessions * Thuban/Model/session.py (create_empty_session): new session don't have a filename (set to None) * Thuban/UI/tree.py (update_tree): added filename and modified flag * Thuban/Model/load.py (ProcessSession): convert projection parameters from unicode to regular string * Data/iceland_sample.session: Added UTM Zone 26 projection. 2002-04-11 Bernhard Herzog * extensions/shapelib/shapefil.h, extensions/shapelib/shpopen.c, extensions/shapelib/dbfopen.c: Update to the versions of shapelib 1.2.9 * setup.py (Lib.wxproj extension): Don't link shpopen.c and put the pyshapelib directoy into the list of include dirs, so that pyshapelib_api.h can be found. * extensions/thuban/wxproj.cpp (pyshapelib_api): New variable that holds the pyshapelib C-API (draw_polygon_shape, point_in_polygon_shape, shape_centroid): Use pyshapelib_api to access the shapelib functions. (initwxproj): Import the c_api from the shapelib module and initialize pyshapelib_api. 2002-04-04 Bernhard Herzog * setup.py (thuban_bdist_rpm.initialize_options): Use initialize_options to create the scripts for the rpm. * extensions/pyprojection/setup.py (PROJ4_PREFIX): Just use / 2002-04-03 Bernhard Herzog * setup.py: Increment version to 0.1.1 * Thuban/UI/mainwindow.py (MainWindow.__init__): Move the "Add Layer" and "Remove Layer" commands from the layer menu to the map menu 2002-02-15 Bernhard Herzog * Thuban/Model/layer.py (Layer.Shape): list append only takes one argument (python <= 1.5.2 erroneously accepted multiuple arguments) 2002-02-04 Bernhard Herzog * Thuban/UI/identifyview.py (IdentifyGridCtrl): New class to use a RecordGrid in the identifyview. (IdentifyView.__init__): Use IdentifyGridCtrl instead of IdentifyListCtrl. The grid allows editing of the values. * Thuban/UI/controls.py (RecordTable, RecordGridCtrl): New classes implementing a grid for a single row of a thuban table. * Thuban/UI/view.py (MapCanvas.SelectShapeAt): Search through all layers by default. Easier to use than the previous default of only searching through the select layer which meant that if no layer was selected, you couldn't select a shape. * Thuban/UI/tableview.py (TableGrid.__init__): Fix typo * Thuban/UI/renderer.py (MapRenderer.draw_shape_layer): Honour the stroke_width attribute * Thuban/Model/save.py (save_session): Write the new stroke_width attribute * Thuban/Model/load.py (ProcessSession.startElement): Read the stroke_width attribute * Thuban/Model/layer.py (Layer.__init__): New parameter and instance variable stroke_width (Layer.SetStrokeWidth): Set the stroke_width. 2002-02-01 Bernhard Herzog * extensions/thuban/wxproj.cpp (project_points): Fix two off-by-one errors in the last loop that joins the various parts together. 2002-01-14 Bernhard Herzog * setup.py (data_dist.make_distribution): Fix some typos 2001-09-18 Bernhard Herzog * README: Slight tweaking in preparation for the 0.1 release * setup.cfg: Add section for sdist to create both tgz and zip archives * setup.py: increase version number to 0.1 (data_dist): New command class for data distribution 2001-09-14 Bernhard Herzog * Thuban/UI/identifyview.py (IdentifyListCtrl.selected_shape): Handle the case of no layer (i.e. layer is None) properly. * Thuban/UI/proj4dialog.py (UTMDialog.__init__, Proj4Dialog.__init__): Set the initial selection of the combo boxes to reflect the projection we're starting with in a way that works on windows, too. * Thuban/Lib/connector.py (Connector.print_connections): Print the puiblisher's ids in hex to make it easier to compare them to the standard repr of python methods * Thuban/Model/map.py (Map.Destroy): Unsubscribe the label_layer messages 2001-09-13 Bernhard Herzog * Thuban/UI/tree.py (SessionTreeCtrl.OnSelChanged): Make sure to deselect the layer if no layer is selected * Thuban/UI/view.py (MapCanvas.OnPaint): Only delay drawing to idle time when there actually is something to draw. If there's nothing to draw simply clear the window (MapCanvas.do_redraw): Call dc.EndDrawing and add some comments. (MapCanvas.SetMap): force a redraw in all cases because FitMapToWindow doesn't always do it. (MapCanvas.ZoomFactor): Add an optional parameter, center, to specify the point to move into the center of the window (ZoomOutTool.MouseUp, ZoomInTool.MouseUp): If the mouse wasn't dragged, zoon in/out by a factor of 2 (MapCanvas.find_shape_at): Iterate backwards (i.e. with decreasing index, i.e. reversed drawing order) so that objects appearing to be in from of others are selected first. This is probably mostly relevant for point shapes where the symbols used may overlap * Thuban/Model/session.py (create_empty_session): Unset the modified bit before returning it * Thuban/UI/mainwindow.py (MainWindow.NewSession): Use create_empty_session session to create the new, empty session. * Thuban/UI/mainwindow.py (MainWindow.__init__): Set the size of the tool bitmaps. (MainWindow.OnClose, MainWindow.save_modified_session): Separate the code that asks whether the session should be saved into the new method save_modified_session. (MainWindow.OpenSession, MainWindow.NewSession): Use the new method to save modified session here too. 2001-09-11 Bernhard Herzog * setup.py (InnoIconItem): fix typo (thuban_bdist_inno.run): (bdist_inno.run): Move the decision not to create symlinks on non-nt platforms to thuban_bdist_inno and do it unconditinally since we never want to create the symlinks here 2001-09-10 Bernhard Herzog * Thuban/UI/mainwindow.py (MainWindow.IdentifyTool): Popup the identify view immediately * Thuban/UI/controls.py: New file with two classes RecordListCtrl and SelectableRecordListCtrl that implement the code shared by the identify view and the label dialog * Thuban/UI/identifyview.py (IdentifyListCtrl): Derive from the new class RecordListCtrl * Thuban/UI/labeldialog.py (LabelDialog.OnOK): Check whether the return value of GetValue is None instead of using it as a boolean directly so that Zero numbers are handled properly. (LabelListCtrl): Derive from the new class SelectableRecordListCtrl * Thuban/UI/proj4dialog.py (Proj4Dialog.__init__): (Proj4Dialog.dialogLayout): Make the window resizable and set the size of the text control explicitly to make the sizers work on both Windows and X. 2001-09-07 Bernhard Herzog * Thuban/UI/view.py (MapCanvas.find_shape_at):Add a new parameter that can limit the search to the currently selected layer. (MapCanvas.SelectShapeAt): Make sure that the currently selected layer stays selected even when no shape is found (MapCanvas.FitRectToWindow): If the rect has zero with or zero height do nothing (avoids zero division errors) 2001-09-06 Bernhard Herzog * Thuban/UI/tree.py (SessionTreeCtrl, SessionTreeView.__init__): Correct the spelling of SessionTreeCtrl. dabbrev is too damn convenient :-) (SessionTreeCtrl.__init__, SessionTreeCtrl.update_tree): Introduce a new instvar layer_to_item to map layers to tree items (SessionTreeCtrl.layer_selected): Select the appropriate tree item to match the current selection in the interactor * Thuban/UI/interactor.py (Interactor.SelectedLayer): (Interactor.HasSelectedLayer): New methods to query the current selection * Thuban/UI/mainwindow.py (MainWindow.current_layer): (MainWindow.has_selected_layer): Simply call the appropriate interactor method * Thuban/UI/mainwindow.py (MainWindow.__init__): (MainWindow.LayerShowTable): (MainWindow.identify_view_on_demand): Store the interactor in an instvar and use that reference instead of going through main.app * Thuban/UI/mainwindow.py (MainWindow.ShowSessionTree): * Thuban/UI/application.py (ThubanApplication.OnInit): * Thuban/UI/main.py (main): Create the session tree view in main with the new mainwindow method ShowSessionTree and not directly the application's OnInit method * Thuban/UI/tree.py (myTreeCtrlPanel): (SessioinTreeCtrl): Rename to SessioinTreeCtrl and turn it into a TreeCtrl isntead of a panel. This affects most method since we now refer to self instead of self.tree (SessionTreeView): New class implementing a non-modal dialog showing the session tree. * Thuban/UI/mainwindow.py (MainWindow.LayerShowTable): Pass the layer to the tableview dialog. * Thuban/UI/tableview.py: Add some doc-strings (TableGrid): (TableGrid.OnRangeSelect): (TableGrid.OnSelectCell): (TableFrame.__init__): (TableFrame.row_selected): Selecting rows in the grid view now updates the selected shapes through the TableFrame. To achieve this we derive TableGrid from Publisher and introduce the message type ROW_SELECTED which the TableFrame subscribes to and which is issued by OnRangeSelect and OnSelectCell (DataTable.SelectRow): Removed because it's no longer needed in the row/shape selection scheme * Thuban/UI/dialogs.py: New file implementing common classes for dialogs * Thuban/UI/tableview.py (TableGrid.__init__): Don't subscribe to the SELECTED_SHAPE message anymore. This is now handled by the parent. (TableGrid.select_shape): Only update the selection if the shape is not None. (TableFrame): Inherit from the new NonModalDialog class. (TableFrame.__init__, TableFrame.select_shape): Handle the SELECT_SHAPE message. (TableFrame.OnClose): Extend the inherited method to unsubscribe SELECT_SHAPE * Thuban/UI/mainwindow.py (MainWindow.init_dialogs): (MainWindow.add_dialog): (MainWindow.dialog_open): (MainWindow.remove_dialog): (MainWindow.get_open_dialog): New methods to maintain a dictionary of opened non-modal dialogs. (MainWindow.__init__): Initialize the new non-modal dictionary management code (MainWindow.LayerShowTable): maintain separate dialogs for each table using the non-modal dialog management code to only open a view once for each table. (MainWindow.IdentifyTool): (MainWindow.__init__): (MainWindow.identify_view_on_demand): Don't open the identify view in IdentifyTool anymore. This will be done automatically by the new method identify_view_on_demand which handles the SELECTED_SHAPE message so that the identify view will be opened on demand * Thuban/UI/identifyview.py (IdentifyListCtrl.__init__): Remove the interactor argument. The SELECTED_SHAPE message is now handled by the parent. (IdentifyView.__init__): Add the interactor argument so that we can handle the SELECTED_SHAPE message here (IdentifyView.selected_shape): New method to handle the SELECTED_SHAPE messages * Thuban/UI/identifyview.py (IdentifyView): Derive from the new NonModalDialog class (IdentifyView.OnClose): Extend the inherited version to unsubscribe SELECT_SHAPE * Thuban/Model/session.py (Session.UnsetModified): Remove debug prints 2001-09-05 Bernhard Herzog * Thuban/UI/view.py (MapCanvas.__init__): New argument, interactor. * Thuban/UI/mainwindow.py (MainWindow.__init__): New argument interactor to pass through to the MapCanvas * Thuban/UI/application.py (ThubanApplication.OnInit): Use the new argument to the MainWindow constructor to get rid of the ugly hack that made main.app available early just so that the mapcanvas could access the interactor object. 2001-09-04 Bernhard Herzog * Thuban/UI/mainwindow.py (MainWindow.RunMessageBox): New method that runs a modal message box (MainWindow.OnClose): Use the new method (MainWindow.RemoveLayer): Just do nothing in case no layer is selected. The command should be grayed out anyway, so there's no need to pop up a message box. (MainWindow.AddLayer): Pop up a message box with an error message if the shape file can't be opened * Thuban/Model/layer.py (Layer.__init__): Open the shapefile immediately. This will cause an exception in case the file can't be opened and we can display an appropriate message. * MANIFEST.in: Add extensions/pyprojection/LICENSE * setup.py (thuban_bdist_rpm): New class implementing a Thuban specific bdist_rpm command. * Thuban/UI/main.py: Catch ImportError exceptions when importing the locale module because it may not be available on some installations. * extensions/pyprojection/LICENSE: Copy of the license text in Projection.i. Having it in a separate file makes it easier to refer to license text in e.g. RPMs 2001-09-03 Bernhard Herzog * setup.py: use wx-config instead of wxgtk-config because it's more generic * setup.py (ThubanInstall.get_outputs): Add the symlink in /bin to the outputs (ThubanInstall.link_file): New method to link files. We need this because the standard copy_files refuses to link non-existing files. (ThubanInstall.run): Remove the leading install root from the script filename if an install root was specified and use the new link_file method * Thuban/UI/mainwindow.py (MainWindow.AddLayer): Fit the map to the window when the first layer is added to the map. * setup.py (ThubanInstall.run): Honor the build root (self.root) when linking thuban.py to /bin 2001-08-31 Bernhard Herzog * setup.py: In the setup call, the install parameters shouldn't have trailing slashes because distutils on non-posix platforms doesn't like that. The same applies to other directories like "Resources/Bitmaps" In the configuration section for nt, move the wxWindows directory optins into the part clearly marked as editable. (InstallLocal.initialize_options): (InstallLocal.user_options): remove the currently unused debug flag (thuban_build_py.find_all_modules): Add this method so that it works for our case of having packages and modules in one distribution as well. (ThubanInstall.initialize_options): (ThubanInstall.finalize_options): (ThubanInstall.user_options): (ThubanInstall.boolean_options): Add new options, do-symlink and extra files. Since these are the first ThubanInstall specific options, override user_options and boolean_options (ThubanInstall.run): Honor the new do-symlink and extra-files options. (ThubanInstall.get_outputs): Add to override the base-class's version and add the extra-files to the outputs (bdist_inno): New class for windows distributions with Inno Setup (InnoIconItem): Helper class for bdist_inno (thuban_bdist_inno): Thuban specific version of bdist_inno. Added this together with the appropriate parameters, to the setup call. * setup.cfg (bdist_inno): added new section for the inno setup installer * Thuban/UI/tree.py (myTreeCtrlPanel.__init__): New inst var changing_selection to avoid recursive selection events when modifying the selection in response to a selection event. (myTreeCtrlPanel.normalize_selection): Set the new inst var when changing the tree's selection. (myTreeCtrlPanel.OnSelChanged): Only normalize the selection when we're not being called indirectly from normalize_selection. * Thuban/UI/mainwindow.py (MainWindow.update_command_ui): Call event.Check only if the command is actuall checkable. (MainWindow.__init__): Call the toolbar's Realize method to make sure that the items are actually shown 2001-08-28 Bernhard Herzog * setup.py: Fix some doc strings * ChangeLog: started