Remove SessionModel mechanism (Major change)
Removal of SessionModel
which is entangled to SessionItem
is the last major step in the plan to remove the SessionItem
mechanism (parent-child hierarchy). See issue #393 (closed).
MaskContainerItem
and MaskContainerModel
classes are created to replace MaskItems
functionality. The discarded class MaskItems
was itself derived from SessionModel
.
ProjectionContainerItem
(container for projections) is derived from MaskContainerItem
.
In the current implementation, MaskContainerModel
is derived from QAbstractListModel
which is the
simplest class in the complexity hierarchy of Qt Model/View classes (derivatives of QAbstractItemModel
).
This class is needed in the GUI to connect the MaskContainerItem
(which holds a set of masks) to other widgets.
The other classes in the GUI module are adapted to this change (esp. the signature of functions and class members).
In particular, MaskGraphicsScene
class is completely refactored accordingly.
The remnants of SessionItem
are removed from IntensityDataItem
:
- replaced
T_MASKS
with a simpleMaskContainerItem
member - replaced
T_PROJECTIONS
with a simpleProjectionContainerItem
member
Some functions are simplified:
-
PolygonView::addView
: rm ununsed argumentrow
-
IShape2DView::addView
: rm ununsed argumentrow
The test TestMapperForItem.AboutToRemoveChild
is disabled since it relies on the original SessionModel/SessionItem
mechanism.
This resolves #393 (closed)
Known bugs:
- The mechanism for sending forward/backward leads to SEGFAULTs (see
MaskEditorActions::changeMaskStackingOrder
). - "Mask properties" sometimes does not display the properties for the selected mask.