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

Class Selection


The Selection struct describes an abstract selection as a collection of coordinates. It should not be accessed directly except selection class implementation.
Method Summary
  changed(i)
Emits "changed" signal on a selection.
  clear()
Clears a selection.
  delete_object(i)
Deletes a one selection object.
  finished()
Emits "finished" signal on a selection.
  get_data()
Return list of selected points.
  get_max_objects()
Gets the maximum number of selected objects.
  get_object(i, data)
Gets one selection object.
  get_object_size()
Gets the number of coordinates that make up a one selection object.
  is_full()
Checks whether the maximum number of objects is selected.
  set_data(nselected, data)
Sets selection data.
  set_max_objects(max_objects)
Sets the maximum number of objects allowed to select.
  set_object(i, data)
Sets one selection object.

Method Details

changed(i)

Emits "changed" signal on a selection.
Parameters:
i - Index of object that changed. Use -1 when not applicable, e.g., when complete selection was changed, cleared, or truncated. (int)

clear()

Clears a selection.

delete_object(i)

Deletes a one selection object.

Since there cannot be holes in the object list, the rest of selection objects is moved to close the gap.
Parameters:
i - Index of object to delete. (int)

finished()

Emits "finished" signal on a selection.

get_data()

Return list of selected points.
Returns:
a list of selected data

get_max_objects()

Gets the maximum number of selected objects.
Returns:
The maximum number of selected objects;

get_object(i, data)

Gets one selection object.
Parameters:
i - Index of object to get. (int)
data - Array to store selection object data to. Object data is an array of coordinates whose precise meaning is defined by particular selection types. (gdouble*)
Returns:
True if there was such an object and data was filled.

get_object_size()

Gets the number of coordinates that make up a one selection object.
Returns:
The number of coordinates in one selection object.

is_full()

Checks whether the maximum number of objects is selected.
Returns:
True when the maximum possible number of objects is selected, False otherwise.

set_data(nselected, data)

Sets selection data.
Parameters:
nselected - The number of selected objects. (int)
data - Selection data, that is an array nselected * Selection.get_object_size() long with selected object coordinates. (const-gdouble*)

set_max_objects(max_objects)

Sets the maximum number of objects allowed to select.

When selection reaches this number of selected objects, it emits "finished" signal.
Parameters:
max_objects - The maximum number of objects allowed to select. Note particular selection types may allow only specific values. (int)

set_object(i, data)

Sets one selection object.

This method can be also used to append objects (if the maximum number is not exceeded). Since there cannot be holes in the object list, i must be then equal to either the number of selected objects or special value -1 meaning append to end.
Parameters:
i - Index of object to set. (int)
data - Object selection data. It's an array of coordinates whose precise meaning is defined by particular selection types. (const-gdouble*)
Returns:
The index of actually set object (useful namely when i is -1).

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