QNodeEditor.graphics.cutter.Cutter#

class QNodeEditor.graphics.cutter.Cutter(scene: NodeScene, parent: ~PyQt5.QtWidgets.QGraphicsItem = None, theme: ~typing.Type[~QNodeEditor.themes.theme.Theme] = <class 'QNodeEditor.themes.dark.DarkTheme'>)#

Bases: QGraphicsItem

Extension of QGraphicsItem for a line defined by points to cut edges with.

Properties

theme

Get or set the cutting line theme.

Methods

__init__

Create a new cutting line.

add_point

Add a point to the cutting line

boundingRect

Get the bounding rectangle of the cutting line.

cut

Cut the edges that this cutting line intersects with.

paint

Draw the cutting line.

reset

Reset the cutting line by removing all points

shape

Get the shape of the cutting line.

__init__(scene: NodeScene, parent: ~PyQt5.QtWidgets.QGraphicsItem = None, theme: ~typing.Type[~QNodeEditor.themes.theme.Theme] = <class 'QNodeEditor.themes.dark.DarkTheme'>)#

Create a new cutting line.

Parameters:
  • scene (NodeScene) – Scene the cutter should act in

  • parent (QGraphicsItem, optional) – Parent item (if any)

  • theme (Type[Theme], optional) – Theme for the cutting line (default: DarkTheme)

add_point(position: QPoint) None#

Add a point to the cutting line

Parameters:

position (QPoint or QPointF) – Scene position to add to cutting line

Return type:

None

cut() None#

Cut the edges that this cutting line intersects with.

Return type:

None

reset(position: QPoint = None) None#

Reset the cutting line by removing all points

Parameters:

position (QPoint or QPointF, optional) – Point to add after removing all points

Return type:

None

property theme: Type[Theme]#

Get or set the cutting line theme.