예제 #1
0
 def get_pos(view):
     if (not view):
         return (QPointF(0.0, 0.0))
     elif (isinstance(view, QPointF)):
         return (self.mapFromScene(QPointF(view.x(), view.y())))
     else:
         return (self.mapFromScene(view.mapToScene(QPointF(0.0, 0.0))))
예제 #2
0
 def get_pos(view):
   if (not view):
     return(QPointF(0.0, 0.0))
   elif (isinstance(view, QPointF)):
     return(self.mapFromScene(QPointF(view.x(), view.y())))
   else:
     return(self.mapFromScene(view.mapToScene(QPointF(0.0, 0.0))))
예제 #3
0
파일: model.py 프로젝트: kewt/tf-mapper
    def switchLevel(self, newLevel):
        levels = self.__map.levels()
        if self.__map.levelExists(newLevel):
            level = self.__map.getLevelByIndex(newLevel)
            if self.__registry.currentLevel is level:
                return

            newView = level.getView()
            view = self.__registry.currentLevel.getView().views()[0]
            center = view.mapToScene(view.rect().center())
            self.__registry.mainWindow.mapView().setScene(self.__map.getLevelByIndex(newLevel).getView())
            scene = self.__registry.mainWindow.mapView().scene().getModel()
            view.centerOn(center)
예제 #4
0
파일: model.py 프로젝트: x1a0/tf-mapper
    def switchLevel(self, newLevel):
        levels = self.__map.levels()
        if self.__map.levelExists(newLevel):
            level = self.__map.getLevelByIndex(newLevel)
            if self.__registry.currentLevel is level:
                return

            newView = level.getView()
            view = self.__registry.currentLevel.getView().views()[0]
            center = view.mapToScene(view.rect().center())
            self.__registry.mainWindow.mapView().setScene(
                self.__map.getLevelByIndex(newLevel).getView())
            scene = self.__registry.mainWindow.mapView().scene().getModel()
            view.centerOn(center)