Просмотр исходного кода

Update and group TODO/FIXME lists

Michael Pitidis 13 лет назад
Родитель
Сommit
1a2b986fe8
3 измененных файлов с 19 добавлено и 11 удалено
  1. 5 2
      canvas.py
  2. 11 7
      labelme.py
  3. 3 2
      shape.py

+ 5 - 2
canvas.py

@@ -6,6 +6,10 @@ from PyQt4.QtCore import *
 
 from shape import Shape
 
+# TODO:
+# - [maybe] Highlight source vertex when "attracting" line.
+# - [maybe] Find optimal epsilon value.
+
 class Canvas(QWidget):
     zoomRequest = pyqtSignal(int)
     scrollRequest = pyqtSignal(int, int)
@@ -14,7 +18,7 @@ class Canvas(QWidget):
 
     SELECT, EDIT = range(2)
 
-    epsilon = 9.0 # TODO: Tune value
+    epsilon = 9.0
 
     def __init__(self, *args, **kwargs):
         super(Canvas, self).__init__(*args, **kwargs)
@@ -74,7 +78,6 @@ class Canvas(QWidget):
                 pos = self.intersectionPoint(self.current[-1], pos)
             elif len(self.current) > 1 and self.closeEnough(pos, self.current[0]):
                 # Attract line to starting point and colorise to alert the user:
-                # TODO: I would also like to highlight the pixel somehow.
                 pos = self.current[0]
                 color = self.current.line_color
             self.line[1] = pos

+ 11 - 7
labelme.py

@@ -25,12 +25,19 @@ from toolBar import ToolBar
 __appname__ = 'labelme'
 
 # FIXME
+# - [medium] Set max zoom value to something big enough for FitWidth/Window
 # - [low] Label validation/postprocessing breaks with TAB.
-# - Set max zoom value to something big enough for FitWidth/Window
 
 # TODO:
-# - [easy] Add button to Hide/Show all labels.
-# - [maybe] Open images with drag & drop.
+# - [high] Error handling for malformed .lif files.
+# - [high] Prompt user for unsaved changes.
+# - [medium] Highlight labellist on shape selection.
+# - [medium,maybe] Support vertex moving.
+# - [low,easy] Add button to Hide/Show all labels.
+# - [low,maybe] Open images with drag & drop.
+# - [low,maybe] Preview images on file dialogs.
+# - [extra] Add beginner/advanced mode, where different settings are set for
+#   the application, e.g. closable labels, different toolbuttons etc.
 # - Zoom is too "steppy".
 
 
@@ -183,7 +190,7 @@ class MainWindow(QMainWindow, WindowMixin):
         self.zoom_level = 100
         self.fit_window = False
 
-        # TODO: Could be completely declarative.
+        # XXX: Could be completely declarative.
         # Restore application settings.
         types = {
             'filename': QString,
@@ -334,7 +341,6 @@ class MainWindow(QMainWindow, WindowMixin):
         filename = unicode(filename)
         if QFile.exists(filename):
             if LabelFile.isLabelFile(filename):
-                # TODO: Error handling.
                 lf = LabelFile()
                 lf.load(filename)
                 self.labelFile = lf
@@ -391,7 +397,6 @@ class MainWindow(QMainWindow, WindowMixin):
         return w / self.canvas.pixmap.width()
 
     def closeEvent(self, event):
-        # TODO: Make sure changes are saved.
         s = self.settings
         s['filename'] = self.filename if self.filename else QString()
         s['window/size'] = self.size()
@@ -432,7 +437,6 @@ class MainWindow(QMainWindow, WindowMixin):
             self.saveLabels(filename)
 
     def check(self):
-        # TODO: Prompt user to save labels etc.
         return True
 
     def chooseColor(self):

+ 3 - 2
shape.py

@@ -7,6 +7,9 @@ from PyQt4.QtCore import *
 # FIXME:
 # - Add support for highlighting vertices.
 
+# TODO:
+# - [opt] Store paths instead of creating new ones at each paint.
+
 class Shape(object):
     P_SQUARE, P_ROUND = range(2)
 
@@ -41,8 +44,6 @@ class Shape(object):
     def isClosed(self):
         return len(self.points) > 1 and self[0] == self[-1]
 
-    # TODO:
-    # The paths could be stored and elements added directly to them.
     def paint(self, painter):
         if self.points:
             pen = QPen(self.select_color if self.selected else self.line_color)