A computational geometry learning and experimentation tool.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

66 lines
1.9 KiB

5 years ago
import os
5 years ago
from enum import Enum
5 years ago
from PyQt5 import QtWidgets, uic
from clusterview_ui import Ui_MainWindow
5 years ago
class Mode(Enum):
"""
Class to make it easier to figure out what mode
we are operating in when the OpenGL window is
clicked
"""
OFF = 0
ADD = 1
EDIT = 2
DELETE = 3
class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow):
5 years ago
"""
A wrapper class for handling creating a window based
on the `clusterview_ui.py` code generated from
`clusterview.ui`.
5 years ago
"""
5 years ago
__mode = Mode.OFF
def __init__(self, parent=None):
super(MainWindow, self).__init__(parent)
self.setupUi(self)
5 years ago
# -------------------------------------
# UI Handlers
# -------------------------------------
self.action_add_points.triggered.connect(self.__add_points)
self.action_edit_points.triggered.connect(self.__edit_points)
self.action_delete_points.triggered.connect(self.__delete_points)
self.action_solve.triggered.connect(self.__solve_launcher)
# TODO: These handlers should probably be broken out into classes
# Such as "GraphicsDrawer", etc that implements these functions
# in isolation so this file remains relatively clean aside from
# the UI hooks to the functions above.
def __add_points(self):
5 years ago
self.__mode = Mode.ADD
5 years ago
print("ADDING POINT MODE ENABLED!")
def __edit_points(self):
5 years ago
self.__mode = Mode.EDIT
5 years ago
print("EDITING POINT MODE ENABLED!")
def __delete_points(self):
5 years ago
self.__mode = Mode.DELETE
5 years ago
print("DELETE POINT MODE ENABLED!")
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...")