Geoinformatica  0.90
Gtk2::Ex::Geo::Overlay Class Reference

Public Member Functions

public method INIT_INSTANCE ()
 
public method close ()
 
public method size_allocate ()
 
public method my_inits ()
 
public method add_layer (scalar layer, scalar do_not_zoom_to)
 Add a layer to the list and by default zoom to it. Always zooms to the first layer added. More...
 
public method layer_count (scalar name)
 Get the index of the given layer in the list. More...
 
public method has_layer ()
 
public method index_of_layer ()
 
public method get_layer_by_index (scalar index)
 
public method get_layer_by_name (scalar name)
 
public method remove_layer_by_index (scalar index)
 
public method remove_layer_by_name (scalar index)
 
public method zoom_to (scalar minx, scalar miny, scalar maxx, scalar maxy)
 Tries to set the given bounding box as the world. More...
 
public method get_world ()
 Get the total area of the canvas. More...
 
public method get_viewport ()
 Get the visible area of the canvas. More...
 
public method get_viewport_of_selection ()
 Get the visible area of the canvas. More...
 
public method size ()
 The size of the viewport in pixels (height, width) More...
 
public method zoom_to_all ()
 Sets the world as the bounding box for all layers. More...
 
public method value_changed ()
 
public method get_focus ()
 
public method render (hash params)
 Render the layers on the canvas. Each layer's render method is called: More...
 
public method render_geometry (scalar gc, scalar geom)
 Render a geometry on the overlay. More...
 
public method update_image (scalar annotations, scalar user_param)
 Updates the image on the screen to show the changes in pixmap. More...
 
public method zoom (scalar w_offset, scalar h_offset, scalar pixel_size)
 Select a part of the world into the visible area. More...
 
private method _zoom ()
 
public method zoom_in (scalar event, scalar center_x, scalar center_y)
 Zooms in an amount determined by the zoom_factor. More...
 
public method zoom_out (scalar event, scalar center_x, scalar center_y)
 Zooms out an amount determined by the zoom_factor. Note: : may enlarge the world. More...
 
public method pan (scalar w_move, scalar h_move, scalar event)
 Pans the viewport. More...
 
public method key_press_event (scalar event)
 Handling of key press events. More...
 
public method scroll_event ()
 
public method draw_mode ()
 
public method key_release_event (scalar event)
 Handling of key release events. More...
 
public method add_to_selection ()
 
public method button_press_event ()
 Pops up a context menu or (optionally) does rubberbanding. More...
 
public method motion_notify ()
 Updates the rubberband if rubberbanding. More...
 
public method rubberband_mode ()
 
public method rubberband_value ()
 
public method delete_rubberband ()
 Escapes from rubberbanding. More...
 
public method button_release_event ()
 Finishes rubberbanding. More...
 
public method event_pixel2point ()
 
public method point2pixmap_pixel ()
 
public method point2surface ()
 
public method min ()
 
public method max ()
 
public method round ()
 

Detailed Description

NAME

Gtk2::Ex::Geo::Overlay

Gtk2::Ex::Geo::Schema

DESCRIPTION

An overlay is a widget, subclassed from Gtk2::ScrolledWindow. An overlay contains a list of layers, which it renders on a canvas, which it puts into its window.

Rubberbanding and keyboard zoom-in (with + key), zoom-out (with - key), and panning (with arrow keys) is built-in.

Definition at line 26 of file Overlay.pm.

Member Function Documentation

private method Gtk2::Ex::Geo::Overlay::_zoom ( )

Undocumented Method

Code:
click to view
public method Gtk2::Ex::Geo::Overlay::add_layer ( scalar  layer,
scalar  do_not_zoom_to 
)

Add a layer to the list and by default zoom to it. Always zooms to the first layer added.

Code:
click to view
public method Gtk2::Ex::Geo::Overlay::add_to_selection ( )

Undocumented Method

Code:
click to view
public method Gtk2::Ex::Geo::Overlay::button_press_event ( )

Pops up a context menu or (optionally) does rubberbanding.

Code:
click to view
public method Gtk2::Ex::Geo::Overlay::button_release_event ( )

Finishes rubberbanding.

Code:
click to view
public method Gtk2::Ex::Geo::Overlay::close ( )

Undocumented Method

Code:
click to view
public method Gtk2::Ex::Geo::Overlay::delete_rubberband ( )

Escapes from rubberbanding.

Code:
click to view
public method Gtk2::Ex::Geo::Overlay::draw_mode ( )

Undocumented Method

Code:
click to view
public method Gtk2::Ex::Geo::Overlay::event_pixel2point ( )

Undocumented Method

Code:
click to view
public method Gtk2::Ex::Geo::Overlay::get_focus ( )
Deprecated:
use get_viewport_of_selection or get_viewport
Returns
the visible area or the selection, if one exists, as ($minx, $miny, $maxx, $maxy).
Code:
click to view
public method Gtk2::Ex::Geo::Overlay::get_layer_by_index ( scalar  index)
Code:
click to view
public method Gtk2::Ex::Geo::Overlay::get_layer_by_name ( scalar  name)
Code:
click to view
public method Gtk2::Ex::Geo::Overlay::get_viewport ( )

Get the visible area of the canvas.

Returns
(min_x, min_y, max_x, max_y)
Code:
click to view
public method Gtk2::Ex::Geo::Overlay::get_viewport_of_selection ( )

Get the visible area of the canvas.

Returns
(min_x, min_y, max_x, max_y)
Code:
click to view
public method Gtk2::Ex::Geo::Overlay::get_world ( )

Get the total area of the canvas.

Returns
(min_x, min_y, max_x, max_y)
Code:
click to view
public method Gtk2::Ex::Geo::Overlay::has_layer ( )

Undocumented Method

Code:
click to view
public method Gtk2::Ex::Geo::Overlay::index_of_layer ( )

Undocumented Method

Code:
click to view
public method Gtk2::Ex::Geo::Overlay::INIT_INSTANCE ( )

Undocumented Method

Code:
click to view
public method Gtk2::Ex::Geo::Overlay::key_press_event ( scalar  event)

Handling of key press events.

Tied to key_press_event and key_release_event. Ties "+" to zoom_in, "-" to zoom_out,and arrow keysto pan. Also ties "Enter" to finishing making a selection. Records press and release of "Ctrl" to object attribute "_control_down".

Code:
click to view
public method Gtk2::Ex::Geo::Overlay::key_release_event ( scalar  event)

Handling of key release events.

Unsets object attribute "_control_down" if "Ctrl" released.

Code:
click to view
public method Gtk2::Ex::Geo::Overlay::layer_count ( scalar  name)

Get the index of the given layer in the list.

Code:
click to view
public method Gtk2::Ex::Geo::Overlay::max ( )

Undocumented Method

Code:
click to view
public method Gtk2::Ex::Geo::Overlay::min ( )

Undocumented Method

Code:
click to view
public method Gtk2::Ex::Geo::Overlay::motion_notify ( )

Updates the rubberband if rubberbanding.

Todo:
Use more visible rubberband, there's no need to use XOR.
Code:
click to view
public method Gtk2::Ex::Geo::Overlay::my_inits ( )

Undocumented Method

Code:
click to view
public method Gtk2::Ex::Geo::Overlay::pan ( scalar  w_move,
scalar  h_move,
scalar  event 
)

Pans the viewport.

Code:
click to view
public method Gtk2::Ex::Geo::Overlay::point2pixmap_pixel ( )

Undocumented Method

Code:
click to view
public method Gtk2::Ex::Geo::Overlay::point2surface ( )

Undocumented Method

Code:
click to view
public method Gtk2::Ex::Geo::Overlay::remove_layer_by_index ( scalar  index)
Code:
click to view
public method Gtk2::Ex::Geo::Overlay::remove_layer_by_name ( scalar  index)
Code:
click to view
public method Gtk2::Ex::Geo::Overlay::render ( hash  params)

Render the layers on the canvas. Each layer's render method is called:

$layer->render($pixbuf_struct, $cairo_context, $self, \@viewport);

If named parameter filename is set, the generated pixbuf is saved to it:

$pixbuf->save($params{filename}, $params{type});

The generated pixmap that is shown is annotated with selection and user defined annotation function.

Code:
click to view
public method Gtk2::Ex::Geo::Overlay::render_geometry ( scalar  gc,
scalar  geom 
)

Render a geometry on the overlay.

Note
this should be called annotate or made detect the context (gdk vs cairo) Call update_image after you are finished with drawing on the pixmap.
Parameters
gcA gdk graphics context (Gtk2::Gdk::GC object)
geomA Geo::OGC::Geometry object.
Code:
click to view
public method Gtk2::Ex::Geo::Overlay::round ( )

Undocumented Method

Code:
click to view
public method Gtk2::Ex::Geo::Overlay::rubberband_mode ( )

Undocumented Method

Code:
click to view
public method Gtk2::Ex::Geo::Overlay::rubberband_value ( )

Undocumented Method

Code:
click to view
public method Gtk2::Ex::Geo::Overlay::scroll_event ( )

Undocumented Method

Code:
click to view
public method Gtk2::Ex::Geo::Overlay::size ( )

The size of the viewport in pixels (height, width)

Code:
click to view
public method Gtk2::Ex::Geo::Overlay::size_allocate ( )

Undocumented Method

Code:
click to view
public method Gtk2::Ex::Geo::Overlay::update_image ( scalar  annotations,
scalar  user_param 
)

Updates the image on the screen to show the changes in pixmap.

Parameters
annotationsA subroutine for user annotations. Called like this: $annotations->($overlay, $pixmap, $gc, $user_param).
user_paramUser parameter for the annotations.
Code:
click to view
public method Gtk2::Ex::Geo::Overlay::value_changed ( )

Undocumented Method

Code:
click to view
public method Gtk2::Ex::Geo::Overlay::zoom ( scalar  w_offset,
scalar  h_offset,
scalar  pixel_size 
)

Select a part of the world into the visible area.

Code:
click to view
public method Gtk2::Ex::Geo::Overlay::zoom_in ( scalar  event,
scalar  center_x,
scalar  center_y 
)

Zooms in an amount determined by the zoom_factor.

Code:
click to view
public method Gtk2::Ex::Geo::Overlay::zoom_out ( scalar  event,
scalar  center_x,
scalar  center_y 
)

Zooms out an amount determined by the zoom_factor. Note: : may enlarge the world.

Code:
click to view
public method Gtk2::Ex::Geo::Overlay::zoom_to ( scalar  minx,
scalar  miny,
scalar  maxx,
scalar  maxy 
)

Tries to set the given bounding box as the world.

Code:
click to view
public method Gtk2::Ex::Geo::Overlay::zoom_to_all ( )

Sets the world as the bounding box for all layers.

Code:
click to view

The documentation for this class was generated from the following file: