Declared in module gview
gview.GvViewArea
gtk.GtkDrawingArea
class GvViewArea(GtkDrawingArea): def gview.GvViewArea.__init__(self, _obj=None) def gview.GvViewArea.active_layer(self) # Fetch the active layer for this view def gview.GvViewArea.add_layer(self, layer) # Add a new layer to the view window. def gview.GvViewArea.copy_state(self, src_view) # Copy the view state of another view. def gview.GvViewArea.create_thumbnail(self, layer, w, h) # Return area thumbnail as a GdkWindow. def gview.GvViewArea.fit_all_layers(self) # Fit view window to extents of all layers def gview.GvViewArea.fit_extents(self, llx, lly, width, height) # Fit view window to region. def gview.GvViewArea.get_extents(self) # Fetch extents of view window. def gview.GvViewArea.get_height(self) # Return height of area in pixels. def gview.GvViewArea.get_pointer(self) # Fetch current pointer position. def gview.GvViewArea.get_projection(self) # Return view coordinate system. def gview.GvViewArea.get_translation(self) # Get view center translation. def gview.GvViewArea.get_width(self) # Return width of area in pixels. def gview.GvViewArea.height_scale(self, scale=1.0) # Set height scaling factor. def gview.GvViewArea.inverse_map_pointer(self, xy) # Translate position from georef coords. def gview.GvViewArea.list_layers(self) # Fetch list of layers attached to this view. def gview.GvViewArea.map_pointer(self, xy) # Translate position to georef coords. def gview.GvViewArea.print_postscript_to_file(self, width, height, is_rgb, filename) # Print view (at indicated resolution) to PostScript file. def gview.GvViewArea.print_to_file(self, width, height, filename, format='GTiff') # Print view (at indicated resolution) to raster file. def gview.GvViewArea.remove_layer(self, layer) # Remove a layer from view window. def gview.GvViewArea.rotate(self, angle) # Rotate view about center. def gview.GvViewArea.set_active_layer(self, layer) # Set the active layer for this view. def gview.GvViewArea.set_mode(self, flag_3D=0) # Set 2D/3D view mode. def gview.GvViewArea.set_projection(self, proj) # Set the coordinate system of the view. def gview.GvViewArea.set_translation(self, x, y) # Set view center translation. def gview.GvViewArea.swap_layers(self, layer_a, layer_b) # Swap two layers in the display order stack. def gview.GvViewArea.zoom(self, zoom) # Zoom in or out. # Inherited from gtk.GtkWidget def gtk.GtkWidget.__init__(self, _obj=None) def gtk.GtkWidget.accelerators_locked(self) def gtk.GtkWidget.activate(self, obj=None) def gtk.GtkWidget.add_accelerator(self, signal, group, key, mods, flags) def gtk.GtkWidget.add_events(self, events) def gtk.GtkWidget.destroy(self, obj=None) def gtk.GtkWidget.drag_begin(self, targets, actions, button, event) def gtk.GtkWidget.drag_dest_set(self, flags, targets, actions) def gtk.GtkWidget.drag_dest_set_proxy(self, proxy_window, protocol, use_coordinates) def gtk.GtkWidget.drag_dest_unset(self) def gtk.GtkWidget.drag_finish(self, context, success, delete, time) def gtk.GtkWidget.drag_get_data(self, context, target, time) def gtk.GtkWidget.drag_get_source_widget(self, context) def gtk.GtkWidget.drag_highlight(self) def gtk.GtkWidget.drag_set_default_icon(self, colormap, pixmap, mask, hot_x, hot_y) def gtk.GtkWidget.drag_set_icon_default(self, context) def gtk.GtkWidget.drag_set_icon_pixmap(self, context, colormap, pixmap, mask, hot_x, hot_y) def gtk.GtkWidget.drag_set_icon_widget(self, context, widget, hot_x, hot_y) def gtk.GtkWidget.drag_source_set(self, button_mask, targets, actions) def gtk.GtkWidget.drag_source_set_icon(self, colormap, pixmap, mask) def gtk.GtkWidget.drag_status(self, context, action, time) def gtk.GtkWidget.drag_unhighlight(self) def gtk.GtkWidget.draw(self, rect) def gtk.GtkWidget.draw_default(self, obj=None) def gtk.GtkWidget.draw_focus(self, obj=None) def gtk.GtkWidget.ensure_style(self) def gtk.GtkWidget.event(self, event) def gtk.GtkWidget.get_allocation(self) def gtk.GtkWidget.get_ancestor(self, type) def gtk.GtkWidget.get_child_requisition(self) def gtk.GtkWidget.get_colormap(self) def gtk.GtkWidget.get_composite_name(self) def gtk.GtkWidget.get_events(self) def gtk.GtkWidget.get_extension_events(self) def gtk.GtkWidget.get_name(self) def gtk.GtkWidget.get_parent_window(self) def gtk.GtkWidget.get_pointer(self) def gtk.GtkWidget.get_style(self) def gtk.GtkWidget.get_toplevel(self) def gtk.GtkWidget.get_window(self) def gtk.GtkWidget.grab_default(self, obj=None) def gtk.GtkWidget.grab_focus(self, obj=None) def gtk.GtkWidget.hide(self, obj=None) def gtk.GtkWidget.hide_all(self, obj=None) def gtk.GtkWidget.hide_on_delete(self, obj=None) def gtk.GtkWidget.intersect(self, rect) def gtk.GtkWidget.is_ancestor(self, a) def gtk.GtkWidget.lock_accelerators(self) def gtk.GtkWidget.map(self, obj=None) def gtk.GtkWidget.popup(self, x, y) def gtk.GtkWidget.queue_draw(self, obj=None) def gtk.GtkWidget.queue_resize(self, obj=None) def gtk.GtkWidget.realize(self, obj=None) def gtk.GtkWidget.remove_accelerator(self, group, key, mods) def gtk.GtkWidget.remove_accelerators(self, signal, visible_only) def gtk.GtkWidget.reparent(self, new_parent) def gtk.GtkWidget.reset_rc_styles(self) def gtk.GtkWidget.restore_default_style(self) def gtk.GtkWidget.selection_add_target(self, selection, target, info) def gtk.GtkWidget.selection_convert(self, selection, target, time) def gtk.GtkWidget.selection_owner_set(self, selection, time) def gtk.GtkWidget.selection_remove_all(self) def gtk.GtkWidget.set_app_paintable(self, app_paintable) def gtk.GtkWidget.set_composite_name(self, name) def gtk.GtkWidget.set_events(self, events) def gtk.GtkWidget.set_extension_events(self, exevents) def gtk.GtkWidget.set_name(self, name) def gtk.GtkWidget.set_parent(self, parent) def gtk.GtkWidget.set_parent_window(self, parent) def gtk.GtkWidget.set_rc_style(self) def gtk.GtkWidget.set_scroll_adjustments(self, hadj, vadj) def gtk.GtkWidget.set_sensitive(self, s) def gtk.GtkWidget.set_state(self, s) def gtk.GtkWidget.set_style(self, style) def gtk.GtkWidget.set_uposition(self, x, y) def gtk.GtkWidget.set_usize(self, w, h) def gtk.GtkWidget.shape_combine_mask(self, mask, ofs_x, ofs_y) def gtk.GtkWidget.show(self, obj=None) def gtk.GtkWidget.show_all(self, obj=None) def gtk.GtkWidget.show_now(self, obj=None) def gtk.GtkWidget.size_allocate(self, a) def gtk.GtkWidget.size_request(self) def gtk.GtkWidget.unlock_accelerators(self) def gtk.GtkWidget.unmap(self, obj=None) def gtk.GtkWidget.unparent(self) def gtk.GtkWidget.unrealize(self, obj=None) # Inherited from gtk.GtkObject def gtk.GtkObject.__cmp__(self, other) def gtk.GtkObject.__getattr__(self, attr) def gtk.GtkObject.__getitem__(self, key) def gtk.GtkObject.__hash__(self) def gtk.GtkObject.__init__(self, _obj=None) def gtk.GtkObject.__setitem__(self, key, v) def gtk.GtkObject.connect(self, name, f, *extra) def gtk.GtkObject.connect(self, name, f, *extra) def gtk.GtkObject.connect_after(self, name, f, *extra) def gtk.GtkObject.connect_after(self, name, f, *extra) def gtk.GtkObject.connect_object(self, name, f, obj, *extra) def gtk.GtkObject.connect_object(self, name, f, obj, *extra) def gtk.GtkObject.connect_object_after(self, name, f, obj, *extra) def gtk.GtkObject.destroy(self, _obj=None) def gtk.GtkObject.disconnect(self, id) def gtk.GtkObject.emit(self, signal, *args) def gtk.GtkObject.emit_stop_by_name(self, sig) def gtk.GtkObject.flags(self, mask=None) def gtk.GtkObject.get_data(self, key) def gtk.GtkObject.remove_data(self, key) def gtk.GtkObject.set(self, dict) def gtk.GtkObject.set_data(self, key, value) def gtk.GtkObject.set_flags(self, flags) def gtk.GtkObject.signal_handler_block(self, id) def gtk.GtkObject.signal_handler_unblock(self, id) def gtk.GtkObject.signal_handlers_destroy(self) def gtk.GtkObject.unset_flags(self, flags) # Inherited from gtk.GtkDrawingArea def gtk.GtkDrawingArea.__cache_win(self) def gtk.GtkDrawingArea.__init__(self, _obj=None) def gtk.GtkDrawingArea.draw_arc(self, gc, fill, x, y, width, height, angle1, angle2) def gtk.GtkDrawingArea.draw_gray_image(self, gc, x, y, width, height, dither, buffer, rowstride) def gtk.GtkDrawingArea.draw_line(self, gc, x1, y1, x2, y2) def gtk.GtkDrawingArea.draw_lines(self, gc, points) def gtk.GtkDrawingArea.draw_pixmap(self, gc, src, xsrc, ysrc, xdest, ydest, width, height) def gtk.GtkDrawingArea.draw_point(self, gc, x, y) def gtk.GtkDrawingArea.draw_points(self, gc, points) def gtk.GtkDrawingArea.draw_polygon(self, gc, fill, points) def gtk.GtkDrawingArea.draw_rectangle(self, gc, fill, x, y, width, height) def gtk.GtkDrawingArea.draw_rgb_32_image(self, gc, x, y, width, height, dither, buffer, rowstride) def gtk.GtkDrawingArea.draw_rgb_image(self, gc, x, y, width, height, dither, buffer, rowstride) def gtk.GtkDrawingArea.draw_segments(self, gc, segs) def gtk.GtkDrawingArea.draw_string(self, font, gc, x, y, string) def gtk.GtkDrawingArea.draw_text(self, font, gc, x, y, text) def gtk.GtkDrawingArea.size(self, w, h)
Signals:
Note that the GvViewArea is a GtkWidget, and application code may attach callbacks to the motion-notify-event, button-press-event, key-press-event and other similar events. The map_pointer() method should be used to translate raw GtkWidget coordinates to georeferenced positions.
Add a new layer to the view window.
Copy the view state of another view.
This includes translation, rotation, and zoom factor.Return area thumbnail as a GdkWindow.
Fit view window to region.
The position and size of the window are in georeferenced coordinates. The translation, zoom and rotation are updated to fit the entire desired box. If the aspect ratio of the box is different than the window, then the window will display the region centered, with extra area viewed in one dimension. The rotation is always set to zero by this call.Fetch extents of view window.
The extents are returned as an (xmin,ymin,xmax,ymax) tuple in georeferenced coordinates.Fetch current pointer position.
The pointer value is returned as an (X,Y) tuple in georeferenced coordinates.Return view coordinate system.
The coordinate system is returned in OGC WKT format, and will likely be an empty string if there is no coordinate system.Get view center translation.
The translation values are in georeferenced coordinates, and to put the value (1000,2000) at the view center a translation of (-1000,-2000) would be returned. The value is returned as an (x,y) tuple.Set height scaling factor.
Has no effect unless in 3D mode. A scale value of 2.0 will exaggerate all elevations by a factor of 2 relative to horizontal (georeferenced) coordinates.Translate position from georef coords.
Translates a map (georeferenced) position into pixel/line coordinates within the GvViewArea on screen.Returns an (x,y) tuple in pixel/line coordinates.Translate position to georef coords.
Translates a pixel/line position into map (georeferenced) coordinates within the view. The pixel/line coordinates might come from a raw GdkEvent, for instance.Returns an (x,y) tuple in georeferenced coordinates.Print view (at indicated resolution) to PostScript file.
Print view (at indicated resolution) to raster file.
Remove a layer from view window.
Rotate view about center.
Set the active layer for this view.
It is an error to make a layer active if it has not already been added to the view.Set 2D/3D view mode.
Set the view mode to either 2D orthonormal projection or 3D perspective projection.Set the coordinate system of the view.
Currently the only time the coordinate system can be modified is when there are no layers attached. When raster layers are added to the view, they will attempt to reproject themselves to match the view if possible. Vector layers do not currently do this.Set view center translation.
The translation values are in georeferenced coordinates, and to put the value (1000,2000) at the view center a translation of (-1000,-2000) is needed.Swap two layers in the display order stack.
Zoom in or out.
Note that the zoom value is log base 2 of the linear zoom factor. So to zoom in by a factor of 2, you would pass 1. To zoom in by a factor of 8 you would pass 3. To zoom out by a factor of eight you would pass -8.
|