def scaleScene(self, factor, resizewin):
    '\n        Scales both the horizontal and vertical directions by factor.\n        Scaling factors are not accumulative.  So if the scene was\n        already scaled, that scaling is "removed" before this scaling\n        factor is applied.  If resizewin is True, the main window is \n        resized to accommodate this new scaled scene size.\n\n        If factor is zero, just switch to auto-scaling at the current\n        window size.  If factor is negative, rescale using the absolute\n        value (possibly resizing the window) then switch to auto-scaling.\n        '
    fltfactor = float(factor)
    if (fltfactor != 0.0):
        if resizewin:
            self.__autoscale = False
        newfactor = abs(fltfactor)
        newlabwidth = int(((newfactor * self.__scenewidth) + 0.5))
        newlabheight = int(((newfactor * self.__sceneheight) + 0.5))
        if ((newlabwidth < self.__minsize) or (newlabheight < self.__minsize)):
            if (self.__scenewidth <= self.__sceneheight):
                newfactor = (float(self.__minsize) / float(self.__scenewidth))
            else:
                newfactor = (float(self.__minsize) / float(self.__sceneheight))
            newlabwidth = int(((newfactor * self.__scenewidth) + 0.5))
            newlabheight = int(((newfactor * self.__sceneheight) + 0.5))
        oldlabwidth = int(((self.__scalefactor * self.__scenewidth) + 0.5))
        oldlabheight = int(((self.__scalefactor * self.__sceneheight) + 0.5))
        if ((newlabwidth != oldlabwidth) or (newlabheight != oldlabheight)):
            self.__scalefactor = newfactor
            QApplication.setOverrideCursor(Qt.WaitCursor)
            self.statusBar().showMessage(self.tr('Scaling image'))
            try:
                self.updateScene()
            finally:
                self.statusBar().clearMessage()
                QApplication.restoreOverrideCursor()
        if resizewin:
            barheights = (self.menuBar().height() + self.statusBar().height())
            mwheight = ((newlabheight + barheights) + self.__framedelta)
            mwwidth = (newlabwidth + self.__framedelta)
            scrnrect = QApplication.desktop().availableGeometry()
            if (mwwidth > (0.95 * scrnrect.width())):
                mwwidth = int(((0.9 * scrnrect.width()) + 0.5))
            if (mwheight > (0.95 * scrnrect.height())):
                mwheight = int(((0.9 * scrnrect.height()) + 0.5))
            self.resize(mwwidth, mwheight)
    if (fltfactor <= 0.0):
        self.__autoscale = True
        self.autoScaleScene()
Scales both the horizontal and vertical directions by factor.
Scaling factors are not accumulative.  So if the scene was
already scaled, that scaling is "removed" before this scaling
factor is applied.  If resizewin is True, the main window is 
resized to accommodate this new scaled scene size.

If factor is zero, just switch to auto-scaling at the current
window size.  If factor is negative, rescale using the absolute
value (possibly resizing the window) then switch to auto-scaling.
def scaleScene(self, factor, resizewin):
    '\n        Scales both the horizontal and vertical directions by factor.\n        Scaling factors are not accumulative.  So if the scene was\n        already scaled, that scaling is "removed" before this scaling\n        factor is applied.  If resizewin is True, the main window is \n        resized to accommodate this new scaled scene size.\n\n        If factor is zero, just switch to auto-scaling at the current\n        window size.  If factor is negative, rescale using the absolute\n        value (possibly resizing the window) then switch to auto-scaling.\n        '
    fltfactor = float(factor)
    if (fltfactor != 0.0):
        if resizewin:
            self.__autoscale = False
        newfactor = abs(fltfactor)
        newlabwidth = int(((newfactor * self.__scenewidth) + 0.5))
        newlabheight = int(((newfactor * self.__sceneheight) + 0.5))
        if ((newlabwidth < self.__minsize) or (newlabheight < self.__minsize)):
            if (self.__scenewidth <= self.__sceneheight):
                newfactor = (float(self.__minsize) / float(self.__scenewidth))
            else:
                newfactor = (float(self.__minsize) / float(self.__sceneheight))
            newlabwidth = int(((newfactor * self.__scenewidth) + 0.5))
            newlabheight = int(((newfactor * self.__sceneheight) + 0.5))
        oldlabwidth = int(((self.__scalefactor * self.__scenewidth) + 0.5))
        oldlabheight = int(((self.__scalefactor * self.__sceneheight) + 0.5))
        if ((newlabwidth != oldlabwidth) or (newlabheight != oldlabheight)):
            self.__scalefactor = newfactor
            QApplication.setOverrideCursor(Qt.WaitCursor)
            self.statusBar().showMessage(self.tr('Scaling image'))
            try:
                self.updateScene()
            finally:
                self.statusBar().clearMessage()
                QApplication.restoreOverrideCursor()
        if resizewin:
            barheights = (self.menuBar().height() + self.statusBar().height())
            mwheight = ((newlabheight + barheights) + self.__framedelta)
            mwwidth = (newlabwidth + self.__framedelta)
            scrnrect = QApplication.desktop().availableGeometry()
            if (mwwidth > (0.95 * scrnrect.width())):
                mwwidth = int(((0.9 * scrnrect.width()) + 0.5))
            if (mwheight > (0.95 * scrnrect.height())):
                mwheight = int(((0.9 * scrnrect.height()) + 0.5))
            self.resize(mwwidth, mwheight)
    if (fltfactor <= 0.0):
        self.__autoscale = True
        self.autoScaleScene()