-
-
-void
-set_chord_outlines (Drul_array< Array<Skyline_entry> > *skyline_drul,
- Link_array<Grob> ties,
- Grob *common)
-{
- Direction d = LEFT;
-
- Real staff_space = Staff_symbol_referencer::staff_space (ties[0]);
- do
- {
- Array<Box> boxes;
- Interval x_union;
-
- Grob *stem = 0;
- for (int i = 0; i < ties.size (); i++)
- {
- Spanner *tie = dynamic_cast<Spanner*> (ties[i]);
-
- Grob *head = Tie::head (tie, d);
- if (!head)
- continue;
-
- if (!stem)
- stem = unsmob_grob (head->get_object ("stem"));
-
- Real p = Tie::get_position (tie);
- Interval y ((p-1) * 0.5 * staff_space,
- (p+1) * 0.5 * staff_space);
-
- Interval x = head->extent (common, X_AXIS);
- boxes.push (Box (x, y));
- x_union.unite (x);
- }
-
- (*skyline_drul)[d] = empty_skyline (-d);
-
- Spanner *tie = dynamic_cast<Spanner*> (ties[0]);
- if (tie->get_bound (d)->break_status_dir ())
- {
- Real x = robust_relative_extent (tie->get_bound (d),
- common,
- X_AXIS)[-d];
-
- (*skyline_drul)[d].elem_ref (0).height_ = x;
- }
-
- for (int i = 0; i < boxes.size (); i++)
- insert_extent_into_skyline (&skyline_drul->elem_ref (d),
- boxes[i], Y_AXIS, -d);
-
- Direction updowndir = DOWN;
- do
- {
- Interval x ;
- if (boxes.size())
- {
- Box b = boxes.boundary (updowndir, 0);
- x = b[X_AXIS];
- x[-d] = b[X_AXIS].linear_combination (-d / 2);
- }
-
- if (stem
- && !Stem::is_invisible (stem)
- && updowndir == get_grob_direction (stem))
- x.unite (robust_relative_extent (stem, common, X_AXIS));
-
- if (!x.is_empty ())
- (*skyline_drul)[d].boundary (updowndir, 0).height_ = x[-d];
- }
- while (flip (&updowndir) != DOWN);
-
- for (int i = 0; i < ties.size (); i++)
- {
- Spanner *tie = dynamic_cast<Spanner*> (ties[i]);
- Grob *head = Tie::head (tie, d);
- if (!head)
- continue;
-
- Grob *dots = unsmob_grob (head->get_object ("dot"));
- if (dots && d == LEFT)
- {
- Interval x = dots->extent (common, X_AXIS);
- Real p = Staff_symbol_referencer::get_position (dots);
-
- Interval y (-1,1);
- y *= (staff_space /4);
- y.translate (p * staff_space * .5);
-
- insert_extent_into_skyline (&skyline_drul->elem_ref (d),
- Box (x,y), Y_AXIS, -d);
- }
- }
-
- }
- while (flip (&d) != LEFT);
-}
-
-
-void
-Tie_column::new_directions (Grob *me)