ciacob / maidens

MAIDENS: an application for algorithmically drafting ideas for your next art music masterpiece.
https://github.com/ciacob/maidens/wiki
GNU General Public License v3.0
13 stars 0 forks source link

Notes for implementing the cross-selection for Part Nodes #8

Open ciacob opened 6 months ago

ciacob commented 6 months ago

The purpose of the following is that, when the user selects a node of the "Part" type in the tree, the selection resulting in the score to reflect its parent Section.

  1. When the user clicks on a "Part" node in the tree, just before sending the message "externally selected score element" with the "mirror ID" of the selected "Part" element, another message should be sent: "current section", containing the "route" of the element stored by the controller in " _currentSection ";

  2. the score editor stores the "current section" value, and only then proceeds to process the message "externally selected score element";

  3. The score editor derives the "route" of the first child (of the "Measure" type) from the value of "current section". Example: "-1_1_0_0" becomes "-1_1_0_0_0";

  4. the score editor obtains all the "hotspots" stored under the derived "Measure" type route, realizes the geometric union of the surface they occupy on the screen, and translates the left edge of the rectangle thus obtained to the leftmost edge of the score;

  5. the score editor obtains all the "part" type hotspots stored under the "mirror ID" sent by the message "externally selected score element", and checks, for each, if it intersects the rectangle obtained in point 4. The first one that does, is made visible. If no "hotspot" intersects the rectangle obtained in point 4, then the first "hotspot" stored under the "mirror ID" sent by the message "externally selected score element" is made visible.