anim.plane.group

class anim.plane.group(group=None, x=0, y=0, position=None, center_of_rotation=[0, 0], orientation=0, zvalue=0, draggable=False, clickable=False)

Group item

A group item has no representation upon display but serves as a parent for multiple other items in order to create and manipulate compositions.

Note on rotation:

Be carefull to rotate the group AFTER having added the items.

Parameters ══════════

  • name

    str The group name.

  • group

    anim.plane.group default: None The group’s group. If None, the position of the reference point and center of rotation are in absolute coordinates. Otherwise, the position is relative to the parent group’s reference point.

─── position ────────────────────────────────

  • x

    float default: 0 x-position of the reference point.

  • y

    float default: 0 y-position of the reference point.

  • position

    (float, float), [float, float], complex default: [0,0] Position of the reference point. The user can define either x, y or the position. In case of conflict, the position attribute wins.

─── transformations ─────────────────────────

  • orientation

    float default: 0, unit: radians Orientation of the item, with respect to the positive part of the x-axis.

  • center_of_rotation

    None, (float, float), [float, float], complex default: None Center point for the rotation.

  • draggable

    bool default: False Boolean specifying if the item can be dragged. If True, the dragging callback is defined in the ‘itemChange’ method of the event class, which is transfered to the canva’s ‘event’ method (recommended).

─── stack ───────────────────────────────────

  • zvalue

    float default: 0 Z-value (stack order) of the item.

Methods ═══════

  • Lx(): return the group’s total width

  • Ly(): return the group’s total height

__init__(group=None, x=0, y=0, position=None, center_of_rotation=[0, 0], orientation=0, zvalue=0, draggable=False, clickable=False)

Group item constructor

Defines a group, which inherits both from QGraphicsItemGroup and item.

Methods

Lx()

Ly()

__init__([group, x, y, position, ...])

Group item constructor

initialize()

Initialize the item

rotate(angle)

Relative rotation

setOrientation()

Set the qitem orientation

setPosition([position])

Sets the qitem's position.

translate(dx[, dy])

Relative translation

Attributes

center_of_rotation

clickable

draggable

group

orientation

position

x

y

zvalue