# Path: Qt.py

# 
# Path: ts2/scenery/helper.py
# class TrackGraphicsItem(QtWidgets.QGraphicsItem):
# class TrackPropertiesModel(QtCore.QAbstractTableModel):
# class TIProperty:
#     def __init__(self, trackItem, itemId=0):
#     def boundingRect(self):
#     def shape(self):
#     def paint(self, painter, option, widget=None):
#     def mousePressEvent(self, event):
#     def mouseMoveEvent(self, event):
#     def dragEnterEvent(self, event):
#     def dragLeaveEvent(self, event):
#     def dropEvent(self, event):
#     def __init__(self, trackItems):
#     def rowCount(self, parent=None, *args):
#     def columnCount(self, parent=None, *args):
#     def data(self, index, role=Qt.DisplayRole):
#     def setData(self, index, value, role=Qt.EditRole):
#     def headerData(self, section, orientation, role=Qt.DisplayRole):
#     def flags(self, index):
#     def __init__(self, name, display, readOnly=False, propType="str",
#                  enumNames=None, enumValues=None):
# 
# Path: ts2/scenery/abstract.py
# def qPointFStrizer(attr):
#     def getter(self):
# def qPointFDestrizer(attr):
#     def setter(self, value):
# def qPointFTupler(attr):
#     def getter(self):
# def qPointFDetupler(attr):
#     def setter(self, value):
#     def __init__(self, parameters):
#     def updateFromParameters(self, parameters):
#     def initialize(self, simulation):
#     def updateData(self, msg):
#     def getProperties():
#     def getMultiProperties():
#     def for_json(self):
#     def _getOrigin(self):
#     def _setOrigin(self, pos):
#     def _getEnd(self):
#     def _getName(self):
#     def _setName(self, value):
#     def maxSpeed(self):
#     def maxSpeed(self, value):
#     def toolTipText(self):
#     def tiTypeStr(self):
#     def highlighted(self):
#     def _getRealLength(self):
#     def place(self):
#     def nextItem(self):
#     def nextItem(self, ni):
#     def previousItem(self):
#     def previousItem(self, pi):
#     def _getGraphicsItem(self):
#     def _getSelected(self):
#     def _setSelected(self, value):
#     def conflictTI(self):
#     def conflictTiId(self):
#     def conflictTiId(self, value):
#     def getFollowingItem(self, precedingItem, direction=-1):
#     def trainPresent(self):
#     def distanceToTrainEnd(self, pos):
#     def isOnPosition(self, p):
#     def setupTriggers(self):
#     def __eq__(self, ti):
#     def __ne__(self, ti):
#     def __updateGraphics(self):
#     def removeAllGraphicsItems(self):
#     def updateGraphics(self):
#     def updateTrain(self):
#     def getPen(self):
#     def drawConnectionRect(self, painter, point):
#     def graphicsBoundingRect(self, itemId):
#     def graphicsShape(self, shape, itemId):
#     def graphicsPaint(self, painter, options, itemId, widget=None):
#     def graphicsMousePressEvent(self, event, itemId):
#     def graphicsMouseMoveEvent(self, event, itemId=0):
#     def graphicsDragEnterEvent(self, event, itemId):
#     def graphicsDragLeaveEvent(self, event, itemId):
#     def graphicsDropEvent(self, event, itemId):
#     def updateFromParameters(self, parameters):
#     def getProperties():
#     def for_json(self):
#     def _setOrigin(self, pos):
#     def _setEnd(self, pos):
#     def _getStart(self):
#     def _setStart(self, pos):
#     def graphicsBoundingRect(self, itemId):
#     def graphicsMouseMoveEvent(self, event, itemId=0):
# class TrackItem(QtCore.QObject):
# class ResizableItem(TrackItem):


import ts2.routing.position
import ts2.utils as utils
from Qt import QtCore, QtGui, QtWidgets, Qt
from ts2.scenery import helper, abstract
        self._tli = []

    def updateFromParameters(self, parameters):
        super(LineItem, self).updateFromParameters(parameters)
        self._placeCode = parameters.get("placeCode", "")
        self._trackCode = parameters.get("trackCode", "")
        self._realLength = parameters.get('realLength', 1.0)

    def initialize(self, simulation):
        """Initialize the item after all items are loaded."""
        self._place = simulation.place(self._placeCode)
        trackCode = self._parameters.get("trackCode")
        if self._place is not None:
            self._trackCode = trackCode
            self._place.addTrack(self)
        if simulation.context in utils.Context.EDITORS:
            self._gi[0].setCursor(Qt.PointingHandCursor)
            self.positionSelected.connect(simulation.setSelectedTrainHead)
        else:
            self._gi[0].setCursor(Qt.ArrowCursor)
        self.simulation = simulation
        self.drawTrain()
        self.updateGeometry()
        super().initialize(simulation)

    @staticmethod
    def getProperties():
        return abstract.ResizableItem.getProperties() + [
            helper.TIProperty("placeCode", translate("LineItem", "Place code")),
            helper.TIProperty("trackCode", translate("LineItem", "Track code")),

# Path: Qt.py

# 
# Path: ts2/scenery/helper.py
# class TrackGraphicsItem(QtWidgets.QGraphicsItem):
# class TrackPropertiesModel(QtCore.QAbstractTableModel):
# class TIProperty:
#     def __init__(self, trackItem, itemId=0):
#     def boundingRect(self):
#     def shape(self):
#     def paint(self, painter, option, widget=None):
#     def mousePressEvent(self, event):
#     def mouseMoveEvent(self, event):
#     def dragEnterEvent(self, event):
#     def dragLeaveEvent(self, event):
#     def dropEvent(self, event):
#     def __init__(self, trackItems):
#     def rowCount(self, parent=None, *args):
#     def columnCount(self, parent=None, *args):
#     def data(self, index, role=Qt.DisplayRole):
#     def setData(self, index, value, role=Qt.EditRole):
#     def headerData(self, section, orientation, role=Qt.DisplayRole):
#     def flags(self, index):
#     def __init__(self, name, display, readOnly=False, propType="str",
#                  enumNames=None, enumValues=None):
# 
# Path: ts2/scenery/abstract.py
# def qPointFStrizer(attr):
#     def getter(self):
# def qPointFDestrizer(attr):
#     def setter(self, value):
# def qPointFTupler(attr):
#     def getter(self):
# def qPointFDetupler(attr):
#     def setter(self, value):
#     def __init__(self, parameters):
#     def updateFromParameters(self, parameters):
#     def initialize(self, simulation):
#     def updateData(self, msg):
#     def getProperties():
#     def getMultiProperties():
#     def for_json(self):
#     def _getOrigin(self):
#     def _setOrigin(self, pos):
#     def _getEnd(self):
#     def _getName(self):
#     def _setName(self, value):
#     def maxSpeed(self):
#     def maxSpeed(self, value):
#     def toolTipText(self):
#     def tiTypeStr(self):
#     def highlighted(self):
#     def _getRealLength(self):
#     def place(self):
#     def nextItem(self):
#     def nextItem(self, ni):
#     def previousItem(self):
#     def previousItem(self, pi):
#     def _getGraphicsItem(self):
#     def _getSelected(self):
#     def _setSelected(self, value):
#     def conflictTI(self):
#     def conflictTiId(self):
#     def conflictTiId(self, value):
#     def getFollowingItem(self, precedingItem, direction=-1):
#     def trainPresent(self):
#     def distanceToTrainEnd(self, pos):
#     def isOnPosition(self, p):
#     def setupTriggers(self):
#     def __eq__(self, ti):
#     def __ne__(self, ti):
#     def __updateGraphics(self):
#     def removeAllGraphicsItems(self):
#     def updateGraphics(self):
#     def updateTrain(self):
#     def getPen(self):
#     def drawConnectionRect(self, painter, point):
#     def graphicsBoundingRect(self, itemId):
#     def graphicsShape(self, shape, itemId):
#     def graphicsPaint(self, painter, options, itemId, widget=None):
#     def graphicsMousePressEvent(self, event, itemId):
#     def graphicsMouseMoveEvent(self, event, itemId=0):
#     def graphicsDragEnterEvent(self, event, itemId):
#     def graphicsDragLeaveEvent(self, event, itemId):
#     def graphicsDropEvent(self, event, itemId):
#     def updateFromParameters(self, parameters):
#     def getProperties():
#     def for_json(self):
#     def _setOrigin(self, pos):
#     def _setEnd(self, pos):
#     def _getStart(self):
#     def _setStart(self, pos):
#     def graphicsBoundingRect(self, itemId):
#     def graphicsMouseMoveEvent(self, event, itemId=0):
# class TrackItem(QtCore.QObject):
# class ResizableItem(TrackItem):


# Path: ts2/scenery/lineitem.py
import ts2.routing.position
import ts2.utils as utils
from Qt import QtCore, QtGui, QtWidgets, Qt
from ts2.scenery import helper, abstract

        self._tli = []

    def updateFromParameters(self, parameters):
        super(LineItem, self).updateFromParameters(parameters)
        self._placeCode = parameters.get("placeCode", "")
        self._trackCode = parameters.get("trackCode", "")
        self._realLength = parameters.get('realLength', 1.0)

    def initialize(self, simulation):
        """Initialize the item after all items are loaded."""
        self._place = simulation.place(self._placeCode)
        trackCode = self._parameters.get("trackCode")
        if self._place is not None:
            self._trackCode = trackCode
            self._place.addTrack(self)
        if simulation.context in utils.Context.EDITORS:
            self._gi[0].setCursor(Qt.PointingHandCursor)
            self.positionSelected.connect(simulation.setSelectedTrainHead)
        else:
            self._gi[0].setCursor(Qt.ArrowCursor)
        self.simulation = simulation
        self.drawTrain()
        self.updateGeometry()
        super().initialize(simulation)

    @staticmethod
    def getProperties():
        return abstract.ResizableItem.getProperties() + [
            helper.TIProperty("placeCode", translate("LineItem", "Place code")),
            helper.TIProperty("trackCode", translate("LineItem", "Track code")),

            helper.TIProperty("realLength",