Source code for DefaultView

"""
This module defines the DefaultView class, which handles the default view behavior for a given MainWindow.

Classes:
    - DefaultView: A class to manage the default view behavior in a PyQt application.

Dependencies:
    - ShowResult: A module providing functionality to display various types of images.
"""
from ShowResult import ShowImageResult


[docs] class DefaultView: """ DefaultView class manages the default view behavior in a PyQt application. Attributes: parent: Reference to the MainWindow of the application. show: Instance of ShowImageResult to display images. Methods: - __init__: Initializes the DefaultView object. - defaultView: Displays the default view based on the application state. """ def __init__(self, MainWindow): self.parent = MainWindow self.show = ShowImageResult(self.parent)
[docs] def defaultView(self): """ Displays the default view based on the application state. If an image is available, it displays the original image. If Anypoint mode is enabled, it shows the Anypoint view. If Panorama mode is enabled, it shows the panorama view. Otherwise, it shows the result image. """ if self.parent.image is None: pass else: image = self.parent.image.copy() self.show.showOriginalImage(image) if self.parent.ui.checkAnypoint.isChecked(): self.parent.anypoint.showPolygon() self.show.showPanoAnyImage(self.parent.angle) elif self.parent.ui.checkPanorama.isChecked(): self.parent.panorama.showOriginalPanorama() self.show.showPanoAnyImage() else: self.show.showResult(image)