Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(317)

Delta Between Two Patch Sets: lily/slur-scoring.cc

Issue 6498077: Approximates cross-staff slurs in VerticalAxisGroup vertical-skylines. Base URL: http://git.savannah.gnu.org/gitweb/?p=lilypond.git/trunk/
Left Patch Set: Removes some cruft Created 12 years, 7 months ago
Right Patch Set: Better approximations Created 12 years, 6 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
LEFTRIGHT
1 /* 1 /*
2 This file is part of LilyPond, the GNU music typesetter. 2 This file is part of LilyPond, the GNU music typesetter.
3 3
4 Copyright (C) 1996--2012 Han-Wen Nienhuys <hanwen@xs4all.nl> 4 Copyright (C) 1996--2012 Han-Wen Nienhuys <hanwen@xs4all.nl>
5 Jan Nieuwenhuizen <janneke@gnu.org> 5 Jan Nieuwenhuizen <janneke@gnu.org>
6 6
7 LilyPond is free software: you can redistribute it and/or modify 7 LilyPond is free software: you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by 8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation, either version 3 of the License, or 9 the Free Software Foundation, either version 3 of the License, or
10 (at your option) any later version. 10 (at your option) any later version.
(...skipping 10 matching lines...) Expand all
21 #include "slur-scoring.hh" 21 #include "slur-scoring.hh"
22 22
23 #include <queue> 23 #include <queue>
24 24
25 #include "axis-group-interface.hh" 25 #include "axis-group-interface.hh"
26 #include "accidental-interface.hh" 26 #include "accidental-interface.hh"
27 #include "beam.hh" 27 #include "beam.hh"
28 #include "clef.hh" 28 #include "clef.hh"
29 #include "directional-element-interface.hh" 29 #include "directional-element-interface.hh"
30 #include "dots.hh" 30 #include "dots.hh"
31 #include "international.hh"
31 #include "libc-extension.hh" 32 #include "libc-extension.hh"
32 #include "main.hh" 33 #include "main.hh"
33 #include "misc.hh" 34 #include "misc.hh"
34 #include "note-column.hh" 35 #include "note-column.hh"
35 #include "output-def.hh" 36 #include "output-def.hh"
36 #include "paper-column.hh" 37 #include "paper-column.hh"
37 #include "pitch.hh" 38 #include "pitch.hh"
38 #include "pointer-group-interface.hh" 39 #include "pointer-group-interface.hh"
39 #include "slur-configuration.hh" 40 #include "slur-configuration.hh"
40 #include "slur.hh" 41 #include "slur.hh"
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 Slur_score_state::get_encompass_info (Grob *col) const 110 Slur_score_state::get_encompass_info (Grob *col) const
110 { 111 {
111 Grob *stem = unsmob_grob (col->get_object ("stem")); 112 Grob *stem = unsmob_grob (col->get_object ("stem"));
112 Encompass_info ei; 113 Encompass_info ei;
113 114
114 if (!stem) 115 if (!stem)
115 { 116 {
116 programming_error ("no stem for note column"); 117 programming_error ("no stem for note column");
117 ei.x_ = col->relative_coordinate (common_[X_AXIS], X_AXIS); 118 ei.x_ = col->relative_coordinate (common_[X_AXIS], X_AXIS);
118 ei.head_ = ei.stem_ = col->maybe_pure_extent (common_[Y_AXIS], 119 ei.head_ = ei.stem_ = col->maybe_pure_extent (common_[Y_AXIS],
119 Y_AXIS, stub_, 0, INT_MAX)[dir_]; 120 Y_AXIS, stub_, spanned_rank_interval_[L EFT], spanned_rank_interval_[RIGHT])[dir_];
120 return ei; 121 return ei;
121 } 122 }
122 Direction stem_dir = get_grob_direction (stem); 123 Direction stem_dir = get_grob_direction (stem);
123 124
124 if (Grob *head = Note_column::first_head (col)) 125 if (Grob *head = Note_column::first_head (col))
125 ei.x_ = head->extent (common_[X_AXIS], X_AXIS).center (); 126 ei.x_ = head->extent (common_[X_AXIS], X_AXIS).center ();
126 else 127 else
127 ei.x_ = col->extent (common_[X_AXIS], X_AXIS).center (); 128 ei.x_ = col->extent (common_[X_AXIS], X_AXIS).center ();
128 129
129 Grob *h = Stem::extremal_heads (stem)[Direction (dir_)]; 130 Grob *h = Stem::extremal_heads (stem)[Direction (dir_)];
130 if (!h) 131 if (!h)
131 { 132 {
132 ei.head_ = ei.stem_ = col->maybe_pure_extent (common_[Y_AXIS], Y_AXIS, stu b_, 0, INT_MAX)[dir_]; 133 ei.head_ = ei.stem_ = col->maybe_pure_extent (common_[Y_AXIS], Y_AXIS, stu b_, spanned_rank_interval_[LEFT], spanned_rank_interval_[RIGHT])[dir_];
133 return ei; 134 return ei;
134 } 135 }
135 136
136 ei.head_ = h->maybe_pure_extent (common_[Y_AXIS], Y_AXIS, stub_, 0, INT_MAX)[d ir_]; 137 ei.head_ = h->maybe_pure_extent (common_[Y_AXIS], Y_AXIS, stub_, spanned_rank_ interval_[LEFT], spanned_rank_interval_[RIGHT])[dir_];
137 138
138 if ((stem_dir == dir_) 139 if ((stem_dir == dir_)
139 && !stem->maybe_pure_extent (stem, Y_AXIS, stub_, 0, INT_MAX).is_empty ()) 140 && !stem->maybe_pure_extent (stem, Y_AXIS, stub_, spanned_rank_interval_[L EFT], spanned_rank_interval_[RIGHT]).is_empty ())
140 { 141 {
141 ei.stem_ = stem->maybe_pure_extent (common_[Y_AXIS], Y_AXIS, stub_, 0, INT _MAX)[dir_]; 142 ei.stem_ = stem->maybe_pure_extent (common_[Y_AXIS], Y_AXIS, stub_, spanne d_rank_interval_[LEFT], spanned_rank_interval_[RIGHT])[dir_];
142 if (Grob *b = Stem::get_beam (stem)) 143 if (Grob *b = Stem::get_beam (stem))
143 ei.stem_ += stem_dir * 0.5 * Beam::get_beam_thickness (b); 144 ei.stem_ += stem_dir * 0.5 * Beam::get_beam_thickness (b);
144 145
145 Interval x = stem->extent (common_[X_AXIS], X_AXIS); 146 Interval x = stem->extent (common_[X_AXIS], X_AXIS);
146 ei.x_ = x.is_empty () 147 ei.x_ = x.is_empty ()
147 ? stem->relative_coordinate (common_[X_AXIS], X_AXIS) 148 ? stem->relative_coordinate (common_[X_AXIS], X_AXIS)
148 : x.center (); 149 : x.center ();
149 } 150 }
150 else 151 else
151 ei.stem_ = ei.head_; 152 ei.stem_ = ei.head_;
(...skipping 18 matching lines...) Expand all
170 extremes[d].flag_ = Note_column::get_flag (extremes[d].note_column_); 171 extremes[d].flag_ = Note_column::get_flag (extremes[d].note_column_);
171 172
172 if (extremes[d].stem_) 173 if (extremes[d].stem_)
173 { 174 {
174 extremes[d].stem_dir_ = get_grob_direction (extremes[d].stem_); 175 extremes[d].stem_dir_ = get_grob_direction (extremes[d].stem_);
175 176
176 for (int a = X_AXIS; a < NO_AXES; a++) 177 for (int a = X_AXIS; a < NO_AXES; a++)
177 { 178 {
178 Axis ax = Axis (a); 179 Axis ax = Axis (a);
179 Interval s = ax == Y_AXIS 180 Interval s = ax == Y_AXIS
180 ? extremes[d].stem_->maybe_pure_extent (common_[a x], ax, stub_, 0, INT_MAX) 181 ? extremes[d].stem_->maybe_pure_extent (common_[a x], ax, stub_, spanned_rank_interval_[LEFT], spanned_rank_interval_[RIGHT])
181 : extremes[d].stem_->extent (common_[ax], ax); 182 : extremes[d].stem_->extent (common_[ax], ax);
182 if (extremes[d].flag_) 183 if (extremes[d].flag_)
183 s.unite (ax == Y_AXIS 184 s.unite (ax == Y_AXIS
184 ? extremes[d].flag_->maybe_pure_extent (common_[ax] , ax, stub_, 0, INT_MAX) 185 ? extremes[d].flag_->maybe_pure_extent (common_[ax] , ax, stub_, spanned_rank_interval_[LEFT], spanned_rank_interval_[RIGHT])
185 : extremes[d].flag_->extent (common_[ax], ax)); 186 : extremes[d].flag_->extent (common_[ax], ax));
186 if (s.is_empty ()) 187 if (s.is_empty ())
187 { 188 {
188 /* 189 /*
189 do not issue warning. This happens for rests and 190 do not issue warning. This happens for rests and
190 whole notes. 191 whole notes.
191 */ 192 */
192 s = Interval (0, 0) 193 s = Interval (0, 0)
193 + (ax == Y_AXIS 194 + (ax == Y_AXIS
194 ? extremes[d].stem_->maybe_pure_coordinate (common_ [ax], ax, stub_, 0, INT_MAX) 195 ? extremes[d].stem_->maybe_pure_coordinate (common_ [ax], ax, stub_, spanned_rank_interval_[LEFT], spanned_rank_interval_[RIGHT])
195 : extremes[d].stem_->relative_coordinate (common_[a x], ax)); 196 : extremes[d].stem_->relative_coordinate (common_[a x], ax));
196 } 197 }
197 extremes[d].stem_extent_[ax] = s; 198 extremes[d].stem_extent_[ax] = s;
198 } 199 }
199 200
200 extremes[d].slur_head_ 201 extremes[d].slur_head_
201 = Stem::extremal_heads (extremes[d].stem_)[dir]; 202 = Stem::extremal_heads (extremes[d].stem_)[dir];
202 if (!extremes[d].slur_head_ 203 if (!extremes[d].slur_head_
203 && Note_column::has_rests (extremes[d].bound_)) 204 && Note_column::has_rests (extremes[d].bound_))
204 extremes[d].slur_head_ = Note_column::get_rest (extremes[d].boun d_); 205 extremes[d].slur_head_ = Note_column::get_rest (extremes[d].boun d_);
(...skipping 11 matching lines...) Expand all
216 } 217 }
217 218
218 return extremes; 219 return extremes;
219 } 220 }
220 221
221 void 222 void
222 Slur_score_state::fill (Grob *me) 223 Slur_score_state::fill (Grob *me)
223 { 224 {
224 slur_ = dynamic_cast<Spanner *> (me); 225 slur_ = dynamic_cast<Spanner *> (me);
225 stub_ = slur_->internal_has_interface (ly_symbol2scm ("cross-staff-stub-interf ace")); 226 stub_ = slur_->internal_has_interface (ly_symbol2scm ("cross-staff-stub-interf ace"));
227 spanned_rank_interval_ = slur_->spanned_rank_interval ();
226 228
227 columns_ 229 columns_
228 = internal_extract_grob_array (me, ly_symbol2scm ("note-columns")); 230 = internal_extract_grob_array (me, ly_symbol2scm ("note-columns"));
229 231
230 if (columns_.empty ()) 232 if (columns_.empty ())
231 { 233 {
232 me->suicide (); 234 me->suicide ();
233 return; 235 return;
234 } 236 }
235 237
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 encompass_infos_.push_back (get_encompass_info (columns_[i])); 320 encompass_infos_.push_back (get_encompass_info (columns_[i]));
319 321
320 valid_ = true; 322 valid_ = true;
321 323
322 musical_dy_ = 0.0; 324 musical_dy_ = 0.0;
323 for (LEFT_and_RIGHT (d)) 325 for (LEFT_and_RIGHT (d))
324 { 326 {
325 if (!is_broken_ 327 if (!is_broken_
326 && extremes_[d].slur_head_) 328 && extremes_[d].slur_head_)
327 musical_dy_ += d 329 musical_dy_ += d
328 * extremes_[d].slur_head_->maybe_pure_coordinate (common_ [Y_AXIS], Y_AXIS, stub_, 0, INT_MAX); 330 * extremes_[d].slur_head_->maybe_pure_coordinate (common_ [Y_AXIS], Y_AXIS, stub_, spanned_rank_interval_[LEFT], spanned_rank_interval_[RI GHT]);
329 } 331 }
330 332
331 edge_has_beams_ 333 edge_has_beams_
332 = (extremes_[LEFT].stem_ && Stem::get_beam (extremes_[LEFT].stem_)) 334 = (extremes_[LEFT].stem_ && Stem::get_beam (extremes_[LEFT].stem_))
333 || (extremes_[RIGHT].stem_ && Stem::get_beam (extremes_[RIGHT].stem_)); 335 || (extremes_[RIGHT].stem_ && Stem::get_beam (extremes_[RIGHT].stem_));
334 336
335 if (is_broken_) 337 if (is_broken_)
336 musical_dy_ = 0.0; 338 musical_dy_ = 0.0;
337 } 339 }
338 340
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
382 me->set_property ("annotation", ly_string2scm (total)); 384 me->set_property ("annotation", ly_string2scm (total));
383 } 385 }
384 #endif 386 #endif
385 387
386 SCM controls = SCM_EOL; 388 SCM controls = SCM_EOL;
387 for (int i = 4; i--;) 389 for (int i = 4; i--;)
388 { 390 {
389 Offset o = best->curve_.control_[i] 391 Offset o = best->curve_.control_[i]
390 - Offset (me->relative_coordinate (state.common_[X_AXIS], X_AXI S), 392 - Offset (me->relative_coordinate (state.common_[X_AXIS], X_AXI S),
391 me->maybe_pure_coordinate (state.common_[Y_AXIS], Y_A XIS, 393 me->maybe_pure_coordinate (state.common_[Y_AXIS], Y_A XIS,
392 state.stub_, 0, INT_MAX)); 394 state.stub_, state.spanned_rank_interval_[LEFT], state.spanned_rank_interval_[RIGHT]));
393 395
394 controls = scm_cons (ly_offset2scm (o), controls); 396 controls = scm_cons (ly_offset2scm (o), controls);
395 } 397 }
396 398
397 return controls; 399 return controls;
398 } 400 }
399 401
400 Slur_configuration * 402 Slur_configuration *
401 Slur_score_state::get_forced_configuration (Interval ys) const 403 Slur_score_state::get_forced_configuration (Interval ys) const
402 { 404 {
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
474 { 476 {
475 Drul_array<Real> end_ys; 477 Drul_array<Real> end_ys;
476 for (LEFT_and_RIGHT (d)) 478 for (LEFT_and_RIGHT (d))
477 { 479 {
478 if (extremes_[d].note_column_) 480 if (extremes_[d].note_column_)
479 { 481 {
480 end_ys[d] = dir_ 482 end_ys[d] = dir_
481 * max (max (dir_ * (base_attachments_[d][Y_AXIS] 483 * max (max (dir_ * (base_attachments_[d][Y_AXIS]
482 + parameters_.region_size_ * dir_), 484 + parameters_.region_size_ * dir_),
483 dir_ * (dir_ + extremes_[d].note_column_->mayb e_pure_extent 485 dir_ * (dir_ + extremes_[d].note_column_->mayb e_pure_extent
484 (common_[Y_AXIS], Y_AXIS, stu b_, 0, INT_MAX)[dir_])), 486 (common_[Y_AXIS], Y_AXIS, stu b_, spanned_rank_interval_[LEFT], spanned_rank_interval_[RIGHT])[dir_])),
485 dir_ * base_attachments_[-d][Y_AXIS]); 487 dir_ * base_attachments_[-d][Y_AXIS]);
486 } 488 }
487 else 489 else
488 end_ys[d] = base_attachments_[d][Y_AXIS] + parameters_.region_size_ * di r_; 490 end_ys[d] = base_attachments_[d][Y_AXIS] + parameters_.region_size_ * di r_;
489 } 491 }
490 492
491 return end_ys; 493 return end_ys;
492 } 494 }
493 495
494 bool 496 bool
(...skipping 29 matching lines...) Expand all
524 */ 526 */
525 if (stem 527 if (stem
526 && !Stem::is_invisible (stem) 528 && !Stem::is_invisible (stem)
527 && extremes_[d].stem_dir_ == dir_ 529 && extremes_[d].stem_dir_ == dir_
528 && Stem::get_beaming (stem, -d) 530 && Stem::get_beaming (stem, -d)
529 && Stem::get_beam (stem) 531 && Stem::get_beam (stem)
530 && (!spanner_less (slur_, Stem::get_beam (stem)) 532 && (!spanner_less (slur_, Stem::get_beam (stem))
531 || has_same_beam_)) 533 || has_same_beam_))
532 y = extremes_[d].stem_extent_[Y_AXIS][dir_]; 534 y = extremes_[d].stem_extent_[Y_AXIS][dir_];
533 else if (head) 535 else if (head)
534 y = head->maybe_pure_extent (common_[Y_AXIS], Y_AXIS, stub_, 0, INT_ MAX)[dir_]; 536 y = head->maybe_pure_extent (common_[Y_AXIS], Y_AXIS, stub_, spanned _rank_interval_[LEFT], spanned_rank_interval_[RIGHT])[dir_];
535 y += dir_ * 0.5 * staff_space_; 537 y += dir_ * 0.5 * staff_space_;
536 538
537 y = move_away_from_staffline (y, head); 539 y = move_away_from_staffline (y, head);
538 540
539 Grob *fh = Note_column::first_head (extremes_[d].note_column_); 541 Grob *fh = Note_column::first_head (extremes_[d].note_column_);
540 x 542 x
541 = (fh ? fh->extent (common_[X_AXIS], X_AXIS) 543 = (fh ? fh->extent (common_[X_AXIS], X_AXIS)
542 : extremes_[d].bound_->extent (common_[X_AXIS], X_AXIS)) 544 : extremes_[d].bound_->extent (common_[X_AXIS], X_AXIS))
543 .linear_combination (CENTER); 545 .linear_combination (CENTER);
544 } 546 }
(...skipping 11 matching lines...) Expand all
556 if (ext.is_empty ()) 558 if (ext.is_empty ())
557 ext = Axis_group_interface:: 559 ext = Axis_group_interface::
558 generic_bound_extent (extremes_[d].bound_, 560 generic_bound_extent (extremes_[d].bound_,
559 common_[X_AXIS], X_AXIS); 561 common_[X_AXIS], X_AXIS);
560 x = ext[-d]; 562 x = ext[-d];
561 563
562 Grob *col = (d == LEFT) ? columns_[0] : columns_.back (); 564 Grob *col = (d == LEFT) ? columns_[0] : columns_.back ();
563 565
564 if (extremes_[-d].bound_ != col) 566 if (extremes_[-d].bound_ != col)
565 { 567 {
566 y = maybe_pure_robust_relative_extent (col, common_[Y_AXIS], Y_AXI S, stub_, 0, INT_MAX)[dir_]; 568 y = maybe_pure_robust_relative_extent (col, common_[Y_AXIS], Y_AXI S, stub_, spanned_rank_interval_[LEFT], spanned_rank_interval_[RIGHT])[dir_];
567 y += dir_ * 0.5 * staff_space_; 569 y += dir_ * 0.5 * staff_space_;
568 570
569 if (get_grob_direction (col) == dir_ 571 if (get_grob_direction (col) == dir_
570 && Note_column::get_stem (col) 572 && Note_column::get_stem (col)
571 && !Stem::is_invisible (Note_column::get_stem (col))) 573 && !Stem::is_invisible (Note_column::get_stem (col)))
572 y -= dir_ * 1.5 * staff_space_; 574 y -= dir_ * 1.5 * staff_space_;
573 } 575 }
574 else 576 else
575 y = base_attachment[-d][Y_AXIS]; 577 y = base_attachment[-d][Y_AXIS];
576 578
(...skipping 26 matching lines...) Expand all
603 { 605 {
604 if (!on_staff) 606 if (!on_staff)
605 return y; 607 return y;
606 608
607 Grob *staff_symbol = Staff_symbol_referencer::get_staff_symbol (on_staff); 609 Grob *staff_symbol = Staff_symbol_referencer::get_staff_symbol (on_staff);
608 if (!staff_symbol) 610 if (!staff_symbol)
609 return y; 611 return y;
610 612
611 Real pos 613 Real pos
612 = (y - staff_symbol->maybe_pure_coordinate (common_[Y_AXIS], 614 = (y - staff_symbol->maybe_pure_coordinate (common_[Y_AXIS],
613 Y_AXIS, stub_, 0, INT_MAX)) 615 Y_AXIS, stub_, spanned_rank_interv al_[LEFT], spanned_rank_interval_[RIGHT]))
614 * 2.0 / staff_space_; 616 * 2.0 / staff_space_;
615 617
616 if (fabs (pos - my_round (pos)) < 0.2 618 if (fabs (pos - my_round (pos)) < 0.2
617 && Staff_symbol_referencer::on_staff_line (on_staff, (int) rint (pos))) 619 && Staff_symbol_referencer::on_staff_line (on_staff, (int) rint (pos)))
618 y += 1.5 * staff_space_ * dir_ / 10; 620 y += 1.5 * staff_space_ * dir_ / 10;
619 621
620 return y; 622 return y;
621 } 623 }
622 624
623 vector<Offset> 625 vector<Offset>
(...skipping 17 matching lines...) Expand all
641 extract_grob_set (slur_, "encompass-objects", extra_encompasses); 643 extract_grob_set (slur_, "encompass-objects", extra_encompasses);
642 for (vsize i = 0; i < extra_encompasses.size (); i++) 644 for (vsize i = 0; i < extra_encompasses.size (); i++)
643 { 645 {
644 if (Slur::has_interface (extra_encompasses[i])) 646 if (Slur::has_interface (extra_encompasses[i]))
645 { 647 {
646 Grob *small_slur = extra_encompasses[i]; 648 Grob *small_slur = extra_encompasses[i];
647 Bezier b = Slur::get_curve (small_slur); 649 Bezier b = Slur::get_curve (small_slur);
648 650
649 Offset z = b.curve_point (0.5); 651 Offset z = b.curve_point (0.5);
650 z += Offset (small_slur->relative_coordinate (common_[X_AXIS], X_AXIS) , 652 z += Offset (small_slur->relative_coordinate (common_[X_AXIS], X_AXIS) ,
651 small_slur->maybe_pure_coordinate (common_[Y_AXIS], Y_AXI S, stub_, 0, INT_MAX)); 653 small_slur->maybe_pure_coordinate (common_[Y_AXIS], Y_AXI S, stub_, spanned_rank_interval_[LEFT], spanned_rank_interval_[RIGHT]));
652 654
653 z[Y_AXIS] += dir_ * parameters_.free_slur_distance_; 655 z[Y_AXIS] += dir_ * parameters_.free_slur_distance_;
654 avoid.push_back (z); 656 avoid.push_back (z);
655 } 657 }
656 else if (extra_encompasses[i]->get_property ("avoid-slur") == ly_symbol2sc m ("inside")) 658 else if (extra_encompasses[i]->get_property ("avoid-slur") == ly_symbol2sc m ("inside"))
657 { 659 {
658 Grob *g = extra_encompasses [i]; 660 Grob *g = extra_encompasses [i];
659 Interval xe = g->extent (common_[X_AXIS], X_AXIS); 661 Interval xe = g->extent (common_[X_AXIS], X_AXIS);
660 Interval ye = g->maybe_pure_extent (common_[Y_AXIS], Y_AXIS, stub_, 0, INT_MAX); 662 Interval ye = g->maybe_pure_extent (common_[Y_AXIS], Y_AXIS, stub_, sp anned_rank_interval_[LEFT], spanned_rank_interval_[RIGHT]);
661 663
662 if (!xe.is_empty () 664 if (!xe.is_empty ()
663 && !ye.is_empty ()) 665 && !ye.is_empty ())
664 avoid.push_back (Offset (xe.center (), ye[dir_])); 666 avoid.push_back (Offset (xe.center (), ye[dir_]));
665 } 667 }
666 } 668 }
667 return avoid; 669 return avoid;
668 } 670 }
669 671
670 void 672 void
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
768 extract_grob_set (slur_, "encompass-objects", encompasses); 770 extract_grob_set (slur_, "encompass-objects", encompasses);
769 vector<Extra_collision_info> collision_infos; 771 vector<Extra_collision_info> collision_infos;
770 for (vsize i = encompasses.size (); i--;) 772 for (vsize i = encompasses.size (); i--;)
771 { 773 {
772 if (Slur::has_interface (encompasses[i])) 774 if (Slur::has_interface (encompasses[i]))
773 { 775 {
774 Spanner *small_slur = dynamic_cast<Spanner *> (encompasses[i]); 776 Spanner *small_slur = dynamic_cast<Spanner *> (encompasses[i]);
775 Bezier b = Slur::get_curve (small_slur); 777 Bezier b = Slur::get_curve (small_slur);
776 778
777 Offset relative (small_slur->relative_coordinate (common_[X_AXIS], X_A XIS), 779 Offset relative (small_slur->relative_coordinate (common_[X_AXIS], X_A XIS),
778 small_slur->maybe_pure_coordinate (common_[Y_AXIS], Y _AXIS, stub_, 0, INT_MAX)); 780 small_slur->maybe_pure_coordinate (common_[Y_AXIS], Y _AXIS, stub_, spanned_rank_interval_[LEFT], spanned_rank_interval_[RIGHT]));
779 781
780 for (int k = 0; k < 3; k++) 782 for (int k = 0; k < 3; k++)
781 { 783 {
782 Direction hdir = Direction (k - 1); 784 Direction hdir = Direction (k - 1);
783 785
784 /* 786 /*
785 Only take bound into account if small slur starts 787 Only take bound into account if small slur starts
786 together with big slur. 788 together with big slur.
787 */ 789 */
788 if (hdir && small_slur->get_bound (hdir) != slur_->get_bound (hdir )) 790 if (hdir && small_slur->get_bound (hdir) != slur_->get_bound (hdir ))
(...skipping 13 matching lines...) Expand all
802 xext, 804 xext,
803 yext, 805 yext,
804 parameters_.extra_object_collision_pena lty_); 806 parameters_.extra_object_collision_pena lty_);
805 collision_infos.push_back (info); 807 collision_infos.push_back (info);
806 } 808 }
807 } 809 }
808 else 810 else
809 { 811 {
810 Grob *g = encompasses [i]; 812 Grob *g = encompasses [i];
811 Interval xe = g->extent (common_[X_AXIS], X_AXIS); 813 Interval xe = g->extent (common_[X_AXIS], X_AXIS);
812 Interval ye = g->maybe_pure_extent (common_[Y_AXIS], Y_AXIS, stub_, 0, INT_MAX); 814 Interval ye = g->maybe_pure_extent (common_[Y_AXIS], Y_AXIS, stub_, sp anned_rank_interval_[LEFT], spanned_rank_interval_[RIGHT]);
813 if (Dots::has_interface (g)) 815 if (Dots::has_interface (g))
814 ye.widen (0.2); 816 ye.widen (0.2);
815 817
816 Real xp = 0.0; 818 Real xp = 0.0;
817 Real penalty = parameters_.extra_object_collision_penalty_; 819 Real penalty = parameters_.extra_object_collision_penalty_;
818 if (Accidental_interface::has_interface (g)) 820 if (Accidental_interface::has_interface (g))
819 { 821 {
820 penalty = parameters_.accidental_collision_; 822 penalty = parameters_.accidental_collision_;
821 823
822 Rational alt = ly_scm2rational (g->get_property ("alteration")); 824 Rational alt = ly_scm2rational (g->get_property ("alteration"));
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
856 type_ = g->get_property ("avoid-slur"); 858 type_ = g->get_property ("avoid-slur");
857 } 859 }
858 860
859 Extra_collision_info::Extra_collision_info () 861 Extra_collision_info::Extra_collision_info ()
860 { 862 {
861 idx_ = 0.0; 863 idx_ = 0.0;
862 penalty_ = 0.; 864 penalty_ = 0.;
863 grob_ = 0; 865 grob_ = 0;
864 type_ = SCM_EOL; 866 type_ = SCM_EOL;
865 } 867 }
LEFTRIGHT

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b