Commit adba006b authored by Michael Büsch's avatar Michael Büsch

gui/fup/wire: Add support for constructing wire without grid

Signed-off-by: Michael Büsch's avatarMichael Buesch <m@bues.ch>
parent 2ae931e9
......@@ -78,24 +78,26 @@ class FupWire(FupBaseClass):
def __init__(self, grid, idNum=None, uuid=None):
FupBaseClass.__init__(self, uuid=uuid)
self.grid = grid
self.connections = set() # The connections this wire is connected to
self.outConn = None # The out-connection this is connected to
if idNum is None:
idNum = grid.getUnusedWireIdNum()
self.idNum = idNum # The ID number of this wire
grid.addWire(self)
self.__wirePen = QPen(QColor("#000000"))
self.__wirePen.setWidth(2)
self.__wireCollidingPen = QPen(QColor("#C02020"))
self.__wireCollidingPen.setWidth(2)
self.__wireBranchPen = QPen(QColor("#000000"))
self.__wireBranchPen.setWidth(1)
self.__wireBranchBrush = QBrush(QColor("#000000"))
self.checkCollisions()
self.grid = grid
if grid:
self.connections = set() # The connections this wire is connected to
self.outConn = None # The out-connection this is connected to
if idNum is None:
idNum = grid.getUnusedWireIdNum()
self.idNum = idNum # The ID number of this wire
grid.addWire(self)
self.__wirePen = QPen(QColor("#000000"))
self.__wirePen.setWidth(2)
self.__wireCollidingPen = QPen(QColor("#C02020"))
self.__wireCollidingPen.setWidth(2)
self.__wireBranchPen = QPen(QColor("#000000"))
self.__wireBranchPen.setWidth(1)
self.__wireBranchBrush = QBrush(QColor("#000000"))
self.checkCollisions()
def checkCollisions(self):
"""Mark the wire as must-check-collisions.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment