UML Diagrams » History » Revision 7
Revision 6 (Ty Hikaru DAULTON, 10/31/2024 02:03 PM) → Revision 7/11 (Ty Hikaru DAULTON, 11/01/2024 10:43 AM)
___
[[/|Home]] | [[About Us]] | [[About the Project]] | [[UML Diagrams]] | [[Codes]] | [[Outcome]]
___
h1=. <pre> UML Diagrams
</pre>
table{width: 100%}.
|={width: 30%; background-color: #aaf;}. Project Draft Diagram |
!UML_Diagram.png!
table{width: 100%}.
h1. Package: pkg
The package *pkg* includes a system for managing images, their overlap, and user interactions through a GUI. Below is a description of the key classes and their relationships.
---
h2. Class: ShareData
*ShareData* serves as the central data holder and manager for the system. It handles image paths, configurations, and shared data between various components.
*Attributes:*
|={width: 30%; background-color: #aaf;}. Project Diagram 2| - *path*: String — Path of the image or configuration file.
- *left_image*: nparray — Left-side image as a numpy array.
- *right_image*: nparray — Right-side image as a numpy array.
- *overlap_region*: int — Represents the overlap between left and right images.
- *alpha*: int — Alpha value, likely used for image transparency.
- *leftSide*: boolean — Indicates whether the left side is active or selected.
!UML_Diagram2.png! *Methods:*
- *__init__()*: Constructor for initializing the ShareData object.
- *write_config()*: Writes configuration settings to a file.
- *read_config(path: String)*: Reads a configuration file from the specified path.
*ShareData* is crucial for holding and sharing data that other classes, such as *Commands* and *ImageIO*, interact with.
---
h2. Class: Commands
The *Commands* class implements methods for interacting with images and the GUI.
*Attributes:*
None explicitly defined but has access to *ShareData* and the *GUI*.
*Methods:*
- *__init__(gui: GUI, shared_data: String[])*: Constructor to initialize with the GUI and shared data.
- *load_left_image()*: Loads the left image from shared data.
- *load_right_image()*: Loads the right image from shared data.
- *show_left_image()*: Displays the left image in the GUI.
- *show_right_image()*: Displays the right image in the GUI.
- *set_overlap_region()*: Sets the overlap region between the images.
- *set_alpha_value()*: Sets the alpha value (transparency).
The *Commands* class manages core logic for loading and manipulating images and coordinates between the *ShareData* and *GUI*.
---
h2. Class: ImageIO
The *ImageIO* class handles input/output operations related to image files. It can load images, write images to a file, and display images in a window.
*Methods:*
- *__init__(shared_data: String[])*: Initializes the object with shared data.
- *load_image(path: int)*: Loads an image from the given path.
- *write_image(img: nparray, fileName: String)*: Writes an image to a file.
- *show_image(img: nparray, title: String)*: Displays an image with the specified title.
*ImageIO* focuses on the actual image processing tasks like reading, saving, and displaying images.
---
h2. Class: GUI
*GUI* is the class responsible for rendering the user interface and managing user interactions. It is likely based on *tkinter* given the constructor reference.
*Methods:*
- *__init__(master: tk.TK)*: Initializes the GUI with a master window from tkinter.
- *control_window()*: Manages control of the GUI window, possibly handling user interactions.
This class represents the visual layer of the system where images are displayed and controlled.
---
h2. Relationships
- The *Commands*, *ImageIO*, and *GUI* classes all interact with *ShareData* to store and retrieve image data and configuration.
- *Commands* and *GUI* are closely connected, with *Commands* issuing instructions to *GUI* for displaying images or responding to user input.
- The *ConfigFile* (depicted at the top) indicates that configuration data is stored in external files, which are managed by the *ShareData* class through *write_config()* and *read_config()*.