|
|
|
@ -7,7 +7,8 @@ from PyQt5.QtWidgets import QFileDialog, QMainWindow
|
|
|
|
|
from clusterview.exceptions import handle_exceptions |
|
|
|
|
from clusterview.colors import Color |
|
|
|
|
from clusterview.mode import Mode |
|
|
|
|
from clusterview.mode_handlers import (MODE_HANDLER_MAP, ogl_keypress_handler, |
|
|
|
|
from clusterview.mode_handlers import (group, MODE_HANDLER_MAP, |
|
|
|
|
ogl_keypress_handler, |
|
|
|
|
refresh_point_list) |
|
|
|
|
from clusterview.opengl_widget import (clear_selection, initialize_gl, |
|
|
|
|
mouse_leave, paint_gl, resize_gl, |
|
|
|
@ -66,6 +67,7 @@ class MainWindow(QMainWindow, Ui_MainWindow):
|
|
|
|
|
self)) |
|
|
|
|
|
|
|
|
|
self.choose_centroids_button.clicked.connect(self.__choose_centroids) |
|
|
|
|
self.group_button.clicked.connect(self.__group) |
|
|
|
|
|
|
|
|
|
# ----------------------------------------------- |
|
|
|
|
# OpenGL Graphics Handlers are set |
|
|
|
@ -83,7 +85,6 @@ class MainWindow(QMainWindow, Ui_MainWindow):
|
|
|
|
|
self.action_edit_points.triggered.connect(self.__edit_points) |
|
|
|
|
self.action_delete_points.triggered.connect(self.__delete_points) |
|
|
|
|
self.action_move_points.triggered.connect(self.__move_points) |
|
|
|
|
self.action_solve.triggered.connect(self.__solve_launcher) |
|
|
|
|
|
|
|
|
|
self.action_save_point_configuration.triggered.connect( |
|
|
|
|
self.__save_points_file) |
|
|
|
@ -104,6 +105,7 @@ class MainWindow(QMainWindow, Ui_MainWindow):
|
|
|
|
|
# OpenGL Widget. |
|
|
|
|
# ----------------------------------------------------------------- |
|
|
|
|
def __off_mode(self): |
|
|
|
|
self.__mode = Mode.OFF |
|
|
|
|
self.opengl_widget.setCursor(QCursor(Qt.CursorShape.ArrowCursor)) |
|
|
|
|
self.status_bar.showMessage("") |
|
|
|
|
clear_selection() |
|
|
|
@ -147,6 +149,16 @@ class MainWindow(QMainWindow, Ui_MainWindow):
|
|
|
|
|
clear_selection() |
|
|
|
|
self.opengl_widget.update() |
|
|
|
|
|
|
|
|
|
def __group(self): |
|
|
|
|
self.__mode = Mode.GROUP |
|
|
|
|
|
|
|
|
|
self.opengl_widget.setCursor(QCursor(Qt.CursorShape.ArrowCursor)) |
|
|
|
|
self.status_bar.showMessage("GROUPING") |
|
|
|
|
clear_selection() |
|
|
|
|
group(self) |
|
|
|
|
self.__off_mode() |
|
|
|
|
self.opengl_widget.update() |
|
|
|
|
|
|
|
|
|
@property |
|
|
|
|
def mode(self): |
|
|
|
|
""" |
|
|
|
@ -187,17 +199,6 @@ class MainWindow(QMainWindow, Ui_MainWindow):
|
|
|
|
|
PointManager.save(file_name) |
|
|
|
|
|
|
|
|
|
@handle_exceptions |
|
|
|
|
def __solve_launcher(self): |
|
|
|
|
""" |
|
|
|
|
Launched the solve menu. This function will call into a subclass |
|
|
|
|
of the solve dialog widget from the UI. |
|
|
|
|
|
|
|
|
|
TODO: Write the subclass once you know the parameters for the |
|
|
|
|
solve window. |
|
|
|
|
""" |
|
|
|
|
print("LAUNCHING SOLVE DIALOG...") |
|
|
|
|
|
|
|
|
|
@handle_exceptions |
|
|
|
|
def __ogl_click_dispatcher(self, event): |
|
|
|
|
""" |
|
|
|
|
Mode dispatcher for click actions on the OpenGL widget. |
|
|
|
|