PyANGKernel.GKSelection

class GKSelection

Inheritance diagram of PyANGKernel.GKSelection

Inherited by: GKGeoSelection

Synopsis

Methods

Virtual methods

Signals

Note

This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE

Detailed Description

This class represents a generic collection of selected objects from the model. Objects are selected or deselected through select and deselect calls or using the selectMultiple / endSelectMultiple and deselectMultiple / endSelectMultiple .

The first calls are used to select (or deselect) a single object. The second set of calls are used when more than one object will be selected (or deselected). The difference is when they emit the selectionChanged signal.

Selection can also be removed, that is, all the selected objects are destroyed. Destroyed means objects removed from the model and the model and inserted in a delete command. This operation, then, can be undone. After undone, all the objects are deselected.

Selection in this class is handled internally, so the objects are not selected at model level. GKGeoSelection , which is derived from this class, takes care of if at geoModel level (and thus it handles ‘selected’ flag in GKGeoObjects).

class MatchMode
__init__()
anySelected(byType, mm)
Parameters:
Return type:

bool

Returns true if the type of any of the selected objects is “byType” (or a subclass of “byType” if allowSubclass is true) Equivalent to call atLeast with a minimum of 1.

atLeast(minimum, byType, mm)
Parameters:
Return type:

bool

Returns true if at least “minimum” number of object of type “byType” are selected (or a subclass of “byType” mm is eThisAndSubclasses).

This method is faster than size as it stops when the minimum is reached.

canBeCopied()
Return type:

bool

Selection can be copied (usually yes but maybe a turn is selected and they cannot be copied)?

canBeCutted()
Return type:

bool

Selection can be cutted (usually yes but maybe a turn is selected and they cannot be copied)?

canBeDeleted()
Return type:

bool

Selection can be deleted?

canBeModified()
Return type:

bool

Selection can be modified?

clear()

Clears the selection internally, without throwing out the selectionChanged() signal.

cut()

Removes (deletes) all the selected objects that allows the CUT command (GKObject::allowClipboardOperations) using a command (to UNDO the operation).

deselect(obj)
Parameters:

objGKObject

Deselects a single object (remove it from the selection list) and emits a selectionChanged signal

deselectAll()

Deselect all the selected objects.

deselectMultiple(obj)
Parameters:

objGKObject

As deselect but without emiting the signal

endSelectMultiple()

Emits the signal since all the objects that will be selected have been selected now.

getAny(byType, mm)
Parameters:
Return type:

GKObject

Get any selected object of type “byType” (or a subclass of “byType” if mm is eThisAndSubclasses)

getModel()
Return type:

GKModel

The model in where this selection is

getObjects()
Return type:

.list of GKObject

Iter over the selection

getSelectionType()
Return type:

GKType

Returns the type of the selection. That is the common type of all the selected objects going down in the hierarchy. If the selection is empty or there is not a common base class it returns NULL.

isEmpty()
Return type:

bool

Returns true if the selection is empty

isSelected(object)
Parameters:

objectGKObject

Return type:

bool

Is object selected in this selection?

remove()

Removes (deletes) all the selected objects using a command (to UNDO the operation).

select(obj)
Parameters:

objGKObject

Selects a single object (add it to the selection list) and emits a selectionChanged signal

selectMultiple(obj)
Parameters:

objGKObject

As select but without emiting the signal

selectionChanged(model, me)
Parameters:

Emitted when the selection has been changed, with its model and itself as a parameter.

setModel(amodel)
Parameters:

amodelGKModel

The model in where this selection is

size()
Return type:

int

Number of selected objects

size(byType, mm)
Parameters:
Return type:

int

Number of selected objects of type “byType” (or a subclass of “byType” if mm is eThisAndSubclasses)