Skip to content

Refactor MaskItems to remove the SessionItem mechanism (Major change)

Ammar Nejati requested to merge maskItems_i89 into main

The following modifications are made to remove the SessionItem mechanism from MaskItems.
The SessionItem-Tags and SessionItem-Properties are replaced by simple data members. The most complicated part is replacing the T_MASKS and T_POINTS SessionItem-Tags.

  • MaskItem:

    • P_IS_VISIBLE => bool
    • P_MASK_VALUE => bool
    • rm unused method maskValueItem
  • MaskContainerItem:

    • T_MASKS => QVector<MaskItem*>
  • PolygonItem:

    • T_POINTS => QVector<PolygonPointItem*>
    • P_ISCLOSED => bool
  • RectangleItem:

    • xLow, xUp, yLow, yUp => double
  • VerticalLineItem:

    • P_POSX => double
  • EllipseItem:

    • P_XCENTER, P_YCENTER, P_XRADIUS, P_YRADIUS, P_ANGLE => double
  • PolygonPointItem:

    • P_POSX, P_POSY => double
  • HorizontalLineItem:

    • P_POSY => double
  • MaskGraphicsScene: updateViews and processPolygonItem refactored according to the new implementation of PolygonItem.

  • MaskItems refactored according to the new implementation of MaskContainerItem.

  • ItemizeSimulation: Correct the mask appending mechanism.

  • TestMapperForItem: Disabled TwoWidgetsSubscription because the test works only with the SessionItem mechanism, but the SessionItem mechanism is removed from HorizontalLineItem. Hence, the test is disabled.

The serialization mechanism is also corrected.

Known bug: Bringing a polygon mask forward/backward leads to a crash. Yet this is related to the SessionModel, which is out of the scope of the current refactoring stage. See the TODO note for MaskEditorActions::changeMaskStackingOrder.

Related to issue #89 (closed)

Edited by Ammar Nejati

Merge request reports

Loading