nodedge.graphics_cut_line

Graphics cut line module containing GraphicsCutLine class.

class nodedge.graphics_cut_line.CutLineMode

Bases: enum.IntEnum

CutLineMode class.

NOOP = 1

Mode representing ready state

CUTTING = 2

Mode representing when we draw a cutting edge

class nodedge.graphics_cut_line.CutLine(graphicsView: GraphicsView)

Bases: object

CutLine class.

update(event: PySide2.QtGui.QMouseEvent) → Optional[PySide2.QtGui.QMouseEvent]

Update the state machine of the cut line as well as the graphics cut line.

Parameters

event (QMouseEvent) – Event triggering the update

Returns

Optional modified event needed by GraphicsView

Return type

Optional[QMouseEvent]

cutIntersectingEdges() → None

Compare which GraphicsCutLine and delete them safely.

class nodedge.graphics_cut_line.GraphicsCutLine(parent: Optional[PySide2.QtWidgets.QGraphicsItem] = None)

Bases: PySide2.QtWidgets.QGraphicsItem

GraphicsCutLine class

Cutting Line used for cutting multiple Edges with one stroke

Parameters

parent (Optional[QGraphicsItem]) – parent widget

boundingRect() → PySide2.QtCore.QRectF

Define Qt’ bounding rectangle

shape() → PySide2.QtGui.QPainterPath

Calculate the QPainterPath object from list of line points.

Returns

shape function returning QPainterPath representation of cut line

Return type

QPainterPath

paint(painter: PySide2.QtGui.QPainter, option: PySide2.QtWidgets.QStyleOptionGraphicsItem, widget: Optional[PySide2.QtWidgets.QWidget] = None) → None

Paint the cut line