brown.interface.graphic_object_interface

classes

permalink view source

GraphicObjectInterface (Interface)

Interface for a generic graphic object.

All graphic interfaces for renderable objects should descend from this.

GraphicObjectInterface classes have no concept of parentage, or, by extension, page numbers. The GraphicObjects responsible for creating these interface objects should pass only document-space positions to these.

Implementing class __init__ methods should, in the following order:

  • Create a QGraphicsItem subclass object and store it in self.qt_object.
  • Set self.pos, self.pen, and self.brush. The setters will automatically update self.qt_object with their values translated into Qt-compatible values.

__init__ (brown_object) permalink view source

overriden from Interface

arguments:

brown_object (GraphicObject): the brown object this belongs to

properties

pos: Point[Unit] The absolute position of the object. permalink view source

This setter automatically propagates changes to the underlying Qt object.

x: Unit The absolute x position of the object permalink view source

This setter automatically propagates changes to the underlying Qt object.

y: Unit The absolute y position of the object permalink view source

This setter automatically propagates changes to the underlying Qt object.

pen: PenInterface The pen to draw outlines with. permalink view source

This setter automatically propagates changes to the underlying Qt object.

brush: BrushInterface The brush to fill shapes with. permalink view source

This setter automatically propagates changes to the underlying Qt object.

methods

render () permalink view source

Render the object to the scene.

returns:

None