Module gwy :: Class DataView
[show private | hide private]
[frames | no frames]

Class DataView


DataView The ::layer-unplugged signal is emitted when a layer is unplugged from a DataView.

When a layer replaces an existing layer, ::layer-unplugged is emitted once the old layer is unplugged, then ::layer-plugged when the new is plugged.

('arg1', ' Which layer was unplugged (a #GwyDataViewLayerType value). ')

('gwydataview', ' The #GwyDataView which received the signal. ')
Method Summary
  __init__(data)
Creates a new data-displaying widget for data.
  coords_xy_to_real(xscr, yscr, xreal, yreal)
Recomputes screen coordinates relative to widget origin to physical coordinates in the sample.
  export_pixbuf(zoom, draw_alpha, draw_top)
Exports data view to a pixbuf.
  get_alpha_layer()
Returns: The currently used alpha layer.
  get_base_layer()
Returns: The currently used base layer.
  get_data()
Returns: The data as a Container.
  get_data_prefix()
Gets the prefix for the container data channel that the data view is currently set to display.
  get_hexcess()
Return the horizontal excess of widget size to data size.
  get_pixbuf(max_width, max_height)
Creates and returns a pixbuf from the data view.
  get_pixel_data_sizes(xres, yres)
Obtains pixel dimensions of data displayed by a data view.
  get_real_data_sizes(xreal, yreal)
Obtains physical dimensions of data displayed by a data view.
  get_real_zoom()
Returns: The zoom as a ratio between real displayed size and base data
  get_top_layer()
Returns: The currently used top layer.
  get_vexcess()
Return the vertical excess of widget size to data size.
  get_xmeasure()
Returns: The horizontal measure.
  get_ymeasure()
Returns: The vertical measure.
  get_zoom()
Returns: The zoom as a ratio between ideal displayed size and base data
  set_alpha_layer(layer)
Plugs layer to data_view as the alpha layer.
  set_base_layer(layer)
Plugs layer to data_view as the base layer.
  set_data_prefix(prefix)
Sets the prefix for the container data channel to display in a data view.
  set_top_layer(layer)
Plugs layer to data_view as the top layer.
  set_zoom(zoom)
Sets zoom of data_view to zoom.
  UNIMPLEMENTED_coords_real_to_xy(xreal, yreal, xscr, yscr)
Recomputes physical coordinate in the sample to screen coordinate relative to widget origin.
  UNIMPLEMENTED_coords_xy_clamp(xscr, yscr)
Fixes screen coordinates xscr and yscr to be inside the data-displaying area (which can be smaller than widget size).
  UNIMPLEMENTED_coords_xy_cut_line(x0scr, y0scr, x1scr, y1scr)
Fixes screen coordinates of line endpoints to be inside the data-displaying area (which can be smaller than widget size).
  UNIMPLEMENTED_get_metric(metric)
Fills metric matrix for a data view.

Method Details

__init__(data)
(Constructor)

Creates a new data-displaying widget for data.

A newly created DataView doesn't display anything. You have to add some layers to it, at least a base layer with DataView.set_base_layer(), and possibly others with DataView.set_alpha_layer() and DataView.set_top_layer().

The top layer is special. It must be a vector layer and can receive mouse and keyboard events.

The base layer it also special. It must be always present, and must not be transparent or vector.
Returns:
A newly created data view as a GtkWidget.

coords_xy_to_real(xscr, yscr, xreal, yreal)

Recomputes screen coordinates relative to widget origin to physical coordinates in the sample.
Parameters:
xscr - A screen x-coordinate relative to widget origin. (int)
yscr - A screen y-coordinate relative to widget origin. (int)
xreal - Where the physical x-coordinate in the data sample should be stored. (float)
yreal - Where the physical y-coordinate in the data sample should be stored. (float)

export_pixbuf(zoom, draw_alpha, draw_top)

Exports data view to a pixbuf.
Parameters:
zoom - Zoom to export data with (unrelated to data view zoom). (float)
draw_alpha - True to draw alpha layer (mask). (bool)
draw_top - True to draw top layer (selection). (bool)
Returns:
A newly created pixbuf, it must be freed by caller.

get_alpha_layer()

Returns: The currently used alpha layer.
Returns:
The currently used alpha layer.

get_base_layer()

Returns: The currently used base layer.
Returns:
The currently used base layer.

get_data()

Returns: The data as a Container.
Returns:
The data as a Container.

get_data_prefix()

Gets the prefix for the container data channel that the data view is currently set to display.
Returns:
The container data prefix (eg. "/0/data").

get_hexcess()

Return the horizontal excess of widget size to data size.

Do not use. Only useful for DataWindow implementation.
Returns:
The execess.

get_pixbuf(max_width, max_height)

Creates and returns a pixbuf from the data view.

If the data is not square, the resulting pixbuf is also nonsquare. The returned pixbuf also never has an alpha channel.
Parameters:
max_width - Pixbuf width that should not be exceeeded. Value smaller than 1 means unlimited size. (int)
max_height - Pixbuf height that should not be exceeeded. Value smaller than 1 means unlimited size. (int)
Returns:
The pixbuf as a newly created GdkPixbuf, it should be freed when no longer needed. It is never larger than the actual data size, as max_width and max_height are only upper limits.

get_pixel_data_sizes(xres, yres)

Obtains pixel dimensions of data displayed by a data view.

This is a convenience method, the same values could be obtained by DataField.get_xres() and DataField.get_yres() of the data field displayed by base layer.
Parameters:
xres - Location to store x-resolution of displayed data (or NULL). (int)
yres - Location to store y-resolution of displayed data (or NULL). (int)

get_real_data_sizes(xreal, yreal)

Obtains physical dimensions of data displayed by a data view.

Physical coordinates are always taken from data field displayed by base layer. This is a convenience method, the same values could be obtained by DataField.get_xreal() and DataField.get_yreal() of the data field displayed by base layer.
Parameters:
xreal - Location to store physical x-dimension of the displayed data without excess (or NULL). (float)
yreal - Location to store physical y-dimension of the displayed data without excess (or NULL). (float)

get_real_zoom()

Returns: The zoom as a ratio between real displayed size and base data
Returns:
The zoom as a ratio between real displayed size and base data field size.

get_top_layer()

Returns: The currently used top layer.
Returns:
The currently used top layer.

get_vexcess()

Return the vertical excess of widget size to data size.

Do not use. Only useful for DataWindow implementation.
Returns:
The execess.

get_xmeasure()

Returns: The horizontal measure.
Returns:
The horizontal measure.

get_ymeasure()

Returns: The vertical measure.
Returns:
The vertical measure.

get_zoom()

Returns: The zoom as a ratio between ideal displayed size and base data
Returns:
The zoom as a ratio between ideal displayed size and base data field size.

set_alpha_layer(layer)

Plugs layer to data_view as the alpha layer.

If another alpha layer is present, it's unplugged.

The layer must not be a vector layer. It can be NULL, meaning no alpha layer is to be used.
Parameters:
layer - A layer to be used as the alpha layer for data_view. (PixmapLayer*)

set_base_layer(layer)

Plugs layer to data_view as the base layer.

If another base layer is present, it's unplugged.

The layer must not be a vector layer. Theoretically, it can be NULL to use no base layer, but then data_view will probably display garbage.
Parameters:
layer - A layer to be used as the base layer for data_view. (PixmapLayer*)

set_data_prefix(prefix)

Sets the prefix for the container data channel to display in a data view.

This function only affects where the data view itself takes parameters from, it does not affect layer keys.
Parameters:
prefix - Container prefix for data (eg. "/0/data"). (string)

set_top_layer(layer)

Plugs layer to data_view as the top layer.

If another top layer is present, it's unplugged.

The layer must be a vector layer. It can be NULL, meaning no top layer is to be used.
Parameters:
layer - A layer to be used as the top layer for data_view. (VectorLayer*)

set_zoom(zoom)

Sets zoom of data_view to zoom.

Zoom greater than 1 means larger image on screen and vice versa.

Note window manager can prevent the window from resize and thus the zoom from change.
Parameters:
zoom - A new zoom value. (float)

UNIMPLEMENTED_coords_real_to_xy(xreal, yreal, xscr, yscr)

Recomputes physical coordinate in the sample to screen coordinate relative to widget origin.
Parameters:
xreal - A physical x-coordinate in the data sample.. (float)
yreal - A physical y-coordinate in the data sample. (float)
xscr - Where the screen x-coordinate relative to widget origin should be stored. (gint*)
yscr - Where the screen y-coordinate relative to widget origin should be stored. (gint*)

UNIMPLEMENTED_coords_xy_clamp(xscr, yscr)

Fixes screen coordinates xscr and yscr to be inside the data-displaying area (which can be smaller than widget size).
Parameters:
xscr - A screen x-coordinate relative to widget origin. (gint*)
yscr - A screen y-coordinate relative to widget origin. (gint*)

UNIMPLEMENTED_coords_xy_cut_line(x0scr, y0scr, x1scr, y1scr)

Fixes screen coordinates of line endpoints to be inside the data-displaying area (which can be smaller than widget size).

Since: 2.11
Parameters:
x0scr - First point screen x-coordinate relative to widget origin. (gint*)
y0scr - First point screen y-coordinate relative to widget origin. (gint*)
x1scr - Second point screen x-coordinate relative to widget origin. (gint*)
y1scr - Second point screen y-coordinate relative to widget origin. (gint*)

UNIMPLEMENTED_get_metric(metric)

Fills metric matrix for a data view.

The metric matrix essentially transforms distances in physical coordinates to screen distances. It is to be used with functions like gwy_math_find_nearest_point() and gwy_math_find_nearest_line() when the distance should be screen-Euclidean.
Parameters:
metric - Metric matrix 2x2 (stored in sequentially by rows: m11, m12, m12, m22). (gdouble*)

Generated by Epydoc 2.1 on Tue Dec 30 04:01:42 2008 http://epydoc.sf.net