Fix more bugs

Now it does something.
older_libs
LEdoian 2 years ago
parent a759cdfd93
commit 561c39e052

@ -12,7 +12,7 @@ from PySide6 import QtCore, QtGui, QtWidgets
# Classification # Classification
class DifferenceStatus: class DifferenceStatus(Enum):
"""Describes differences between two topologies""" """Describes differences between two topologies"""
NORMAL = auto() NORMAL = auto()
MISSING = auto() MISSING = auto()
@ -109,6 +109,7 @@ def assign_brushes(at):
for tags in annot.values(): for tags in annot.values():
statuses = list(filter(lambda x: isinstance(x, DifferenceStatus), tags)) statuses = list(filter(lambda x: isinstance(x, DifferenceStatus), tags))
status = statuses[-1] if len(statuses) > 0 else DifferenceStatus.DISCREPANCY # should always have something. status = statuses[-1] if len(statuses) > 0 else DifferenceStatus.DISCREPANCY # should always have something.
print(repr(status))
color = { color = {
DifferenceStatus.NORMAL: 'black', DifferenceStatus.NORMAL: 'black',
DifferenceStatus.EXTRA: 'green', DifferenceStatus.EXTRA: 'green',
@ -182,4 +183,5 @@ def create_qgritems(at):
line = QtWidgets.QGraphicsLineItem(rpos.x, rpos.y, npos.x, npos.y) line = QtWidgets.QGraphicsLineItem(rpos.x, rpos.y, npos.x, npos.y)
at.link_annotations[lk].append(line) at.link_annotations[lk].append(line)
return at

@ -29,6 +29,14 @@ final_topo = combiner.get_complete_topology()
from birdvisu.visualisation import annotators from birdvisu.visualisation import annotators
def dbg_ann(at):
print('hello')
return at
# annotators.create_qgritems does not like being run without Qt initialization.
from PySide6 import QtCore, QtGui, QtWidgets
app = QtWidgets.QApplication([])
annotated_topology = maps_new.annotate_topology(final_topo, annotated_topology = maps_new.annotate_topology(final_topo,
# A semi-canonical set of annotators: # A semi-canonical set of annotators:
[ [
@ -40,11 +48,9 @@ annotated_topology = maps_new.annotate_topology(final_topo,
] ]
) )
# Render the widget
from PySide6 import QtCore, QtGui, QtWidgets # Render the widget
app = QtWidgets.QApplication([])
scene = QtWidgets.QGraphicsScene() scene = QtWidgets.QGraphicsScene()
for tagsrc in [ for tagsrc in [

Loading…
Cancel
Save