lomse icon indicating copy to clipboard operation
lomse copied to clipboard

Make the internal model clonable

Open cecilios opened this issue 3 years ago • 0 comments

This PR makes the internal model clonable and prepares the Document class to use a cloned model. This is part of the new strategy for undo/redo to avoid excessive processing time and memory requirements when using the current strategy for undo/redo in edition commands.

Backwards incompatible changes

  • Global logger logger renamed as glogger to differentiate it from other variables also named logger and to avoid mistakes. I also avoids many compilation warnings about shadowed variables.

Changes

  • Defined new class DocModel for wrapping all internal model structures: the internal model tree and the IdAssigner object, as well as the ColStaffObjs table and the measures table associated to each score.
  • Defined copy and assignment constructors for all ImoObj objects.
  • Some changes in the internal model tree objects to simplify cloning, mainly replacing some pointers to ImoObj objects by their Id.
  • The tree has been reviewed to ensure that all tree nodes can be traversed using Visitor objects.
  • Class IdAssigner now uses std::unordered_map when appropriate instead of std::map. This improves performance when using Id to locate an object.

cecilios avatar Aug 30 '22 15:08 cecilios