- seperate items and inserters

- use dicts for ITEMS and INSERTERS
This commit is contained in:
Martin Baeuml
2011-05-12 16:57:28 +02:00
parent a56cce4669
commit d058b6057a
8 changed files with 471 additions and 431 deletions
+10 -22
View File
@@ -1,5 +1,4 @@
from items import AnnotationGraphicsRectItem as RectItem
from items import RectItemInserter, AnnotationGraphicsPointItem
import items
from loaders import FeretLoader, RectIdLoader
from bboxitem import *
@@ -20,16 +19,16 @@ HOTKEYS = (
("", "BodyBBox", "b")
)
ITEMS = (
("rect", RectItem),
("point", AnnotationGraphicsPointItem),
("bodybbox", BodyBoundingboxItem),
)
ITEMS = {
"rect": items.RectItem,
"point": items.PointItem,
"bodybbox": BodyBoundingboxItem,
}
INSERTERS = (
("rect", RectItemInserter),
("bodybbox", BodyBoundingboxItemInserter),
)
INSERTERS = {
"rect": items.RectItemInserter,
"bodybbox": BodyBoundingboxItemInserter,
}
LOADERS = (
('txt', RectIdLoader),
@@ -38,14 +37,3 @@ LOADERS = (
PLUGINS = (
)
#labeltool.buttonarea.add_label("Rect", {"type": "rect"})
#labeltool.buttonarea.add_label("FixedRatioRect", {"type": "ratiorect", "_ratio": RATIOS})
#labeltool.buttonarea.add_label("Point", {"type": "point"})
#labeltool.buttonarea.add_label("Polygon", {"type": "polygon"})
#labeltool.buttonarea.add_label("BodyBBox", {"type": "bodybbox"})
#
#Labeltool.buttonarea.add_hotkey("", "Rect", "r")
#Labeltool.buttonarea.add_hotkey("", "Point", "p")
#Labeltool.buttonarea.add_hotkey("", "Polygon", "o")
#Labeltool.buttonarea.add_hotkey("", "BodyBBox", "b")