lazylabel-gui 1.2.1__py3-none-any.whl → 1.3.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,6 @@
1
+ """UI mode handlers for different view modes."""
2
+
3
+ from .multi_view_mode import MultiViewModeHandler
4
+ from .single_view_mode import SingleViewModeHandler
5
+
6
+ __all__ = ["MultiViewModeHandler", "SingleViewModeHandler"]
@@ -0,0 +1,52 @@
1
+ """Base class for mode handlers."""
2
+
3
+ from abc import ABC, abstractmethod
4
+ from typing import TYPE_CHECKING
5
+
6
+ if TYPE_CHECKING:
7
+ from ..main_window import MainWindow
8
+
9
+
10
+ class BaseModeHandler(ABC):
11
+ """Base class for mode handlers."""
12
+
13
+ def __init__(self, main_window: "MainWindow"):
14
+ self.main_window = main_window
15
+ self.segment_manager = main_window.segment_manager
16
+ self.model_manager = main_window.model_manager
17
+ self.file_manager = main_window.file_manager
18
+
19
+ @abstractmethod
20
+ def handle_ai_click(self, pos, event):
21
+ """Handle AI mode click."""
22
+ pass
23
+
24
+ @abstractmethod
25
+ def handle_polygon_click(self, pos):
26
+ """Handle polygon mode click."""
27
+ pass
28
+
29
+ @abstractmethod
30
+ def handle_bbox_start(self, pos):
31
+ """Handle bbox mode start."""
32
+ pass
33
+
34
+ @abstractmethod
35
+ def handle_bbox_drag(self, pos):
36
+ """Handle bbox mode drag."""
37
+ pass
38
+
39
+ @abstractmethod
40
+ def handle_bbox_complete(self, pos):
41
+ """Handle bbox mode completion."""
42
+ pass
43
+
44
+ @abstractmethod
45
+ def display_all_segments(self):
46
+ """Display all segments."""
47
+ pass
48
+
49
+ @abstractmethod
50
+ def clear_all_points(self):
51
+ """Clear all points."""
52
+ pass