UML Diagrams » History » Version 6
Ty Hikaru DAULTON, 10/31/2024 02:03 PM
1 | 1 | Dylan WIDJAJA | ___ |
---|---|---|---|
2 | |||
3 | 4 | Ty Hikaru DAULTON | [[/|Home]] | [[About Us]] | [[About the Project]] | [[UML Diagrams]] | [[Codes]] | [[Outcome]] |
4 | 1 | Dylan WIDJAJA | |
5 | |||
6 | ___ |
||
7 | |||
8 | 3 | Ty Hikaru DAULTON | h1=. <pre> UML Diagrams |
9 | </pre> |
||
10 | |||
11 | 2 | Ty Hikaru DAULTON | |
12 | |||
13 | 1 | Dylan WIDJAJA | |
14 | table{width: 100%}. |
||
15 | |={width: 30%; background-color: #aaf;}. Project Draft Diagram | |
||
16 | 6 | Ty Hikaru DAULTON | |
17 | !UML_Diagram.png! |
||
18 | |||
19 | h1. Package: pkg |
||
20 | |||
21 | 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. |
||
22 | |||
23 | --- |
||
24 | |||
25 | h2. Class: ShareData |
||
26 | |||
27 | *ShareData* serves as the central data holder and manager for the system. It handles image paths, configurations, and shared data between various components. |
||
28 | |||
29 | *Attributes:* |
||
30 | - *path*: String — Path of the image or configuration file. |
||
31 | - *left_image*: nparray — Left-side image as a numpy array. |
||
32 | - *right_image*: nparray — Right-side image as a numpy array. |
||
33 | - *overlap_region*: int — Represents the overlap between left and right images. |
||
34 | - *alpha*: int — Alpha value, likely used for image transparency. |
||
35 | - *leftSide*: boolean — Indicates whether the left side is active or selected. |
||
36 | |||
37 | *Methods:* |
||
38 | - *__init__()*: Constructor for initializing the ShareData object. |
||
39 | - *write_config()*: Writes configuration settings to a file. |
||
40 | - *read_config(path: String)*: Reads a configuration file from the specified path. |
||
41 | |||
42 | *ShareData* is crucial for holding and sharing data that other classes, such as *Commands* and *ImageIO*, interact with. |
||
43 | |||
44 | --- |
||
45 | |||
46 | h2. Class: Commands |
||
47 | |||
48 | The *Commands* class implements methods for interacting with images and the GUI. |
||
49 | |||
50 | *Attributes:* |
||
51 | None explicitly defined but has access to *ShareData* and the *GUI*. |
||
52 | |||
53 | *Methods:* |
||
54 | - *__init__(gui: GUI, shared_data: String[])*: Constructor to initialize with the GUI and shared data. |
||
55 | - *load_left_image()*: Loads the left image from shared data. |
||
56 | - *load_right_image()*: Loads the right image from shared data. |
||
57 | - *show_left_image()*: Displays the left image in the GUI. |
||
58 | - *show_right_image()*: Displays the right image in the GUI. |
||
59 | - *set_overlap_region()*: Sets the overlap region between the images. |
||
60 | - *set_alpha_value()*: Sets the alpha value (transparency). |
||
61 | |||
62 | The *Commands* class manages core logic for loading and manipulating images and coordinates between the *ShareData* and *GUI*. |
||
63 | |||
64 | --- |
||
65 | |||
66 | h2. Class: ImageIO |
||
67 | |||
68 | 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. |
||
69 | |||
70 | *Methods:* |
||
71 | - *__init__(shared_data: String[])*: Initializes the object with shared data. |
||
72 | - *load_image(path: int)*: Loads an image from the given path. |
||
73 | - *write_image(img: nparray, fileName: String)*: Writes an image to a file. |
||
74 | - *show_image(img: nparray, title: String)*: Displays an image with the specified title. |
||
75 | |||
76 | *ImageIO* focuses on the actual image processing tasks like reading, saving, and displaying images. |
||
77 | |||
78 | --- |
||
79 | |||
80 | h2. Class: GUI |
||
81 | |||
82 | *GUI* is the class responsible for rendering the user interface and managing user interactions. It is likely based on *tkinter* given the constructor reference. |
||
83 | |||
84 | *Methods:* |
||
85 | - *__init__(master: tk.TK)*: Initializes the GUI with a master window from tkinter. |
||
86 | - *control_window()*: Manages control of the GUI window, possibly handling user interactions. |
||
87 | |||
88 | This class represents the visual layer of the system where images are displayed and controlled. |
||
89 | |||
90 | --- |
||
91 | |||
92 | h2. Relationships |
||
93 | |||
94 | - The *Commands*, *ImageIO*, and *GUI* classes all interact with *ShareData* to store and retrieve image data and configuration. |
||
95 | - *Commands* and *GUI* are closely connected, with *Commands* issuing instructions to *GUI* for displaying images or responding to user input. |
||
96 | - 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()*. |