Tie_formatting_problem::get_attachment (Real y, Drul_array<int> columns) const
{
Interval attachments (0, 0);
- Direction d = LEFT;
- do
+
+ for (LEFT_and_RIGHT (d))
{
Tuple2<int> key (columns[d], int (d));
Chord_outline_map::const_iterator i (chord_outlines_.find (key));
else
attachments[d] = i->second.height (y);
}
- while (flip (&d) != LEFT);
return attachments;
}
}
- Direction updowndir = DOWN;
- do
+ for (DOWN_and_UP (updowndir))
{
Interval x;
Interval y;
if (!x.is_empty ())
boxes.push_back (Box (x, y));
}
- while (flip (&updowndir) != DOWN);
/* todo: the horizon_padding is somewhat arbitrary */
chord_outlines_[key] = Skyline (boxes, details_.skyline_padding_, Y_AXIS, -dir);
details_.from_grob (ties[0]);
- Direction d = LEFT;
- do
+ for (LEFT_and_RIGHT (d))
{
vector<Item *> bounds;
set_chord_outline (bounds, d);
}
- while (flip (&d) != LEFT);
for (vsize i = 0; i < ties.size (); i++)
{
Tie_specification spec;
spec.from_grob (ties[i]);
- do
+ for (LEFT_and_RIGHT (d))
{
spec.note_head_drul_[d] = Tie::head (ties[i], d);
spec.column_ranks_[d] = Tie::get_column_rank (ties[i], d);
}
- while (flip (&d) != LEFT);
specifications_.push_back (spec);
}
}
It would be better to check D against HEAD-DIRECTION if
applicable.
*/
- Direction d = LEFT;
- do
+ for (LEFT_and_RIGHT (d))
{
Real y = conf->position_ * details_.staff_space_ * 0.5 + conf->delta_y_;
if (get_stem_extent (conf->column_ranks_[d], d, X_AXIS).is_empty ()
= d * min (d * conf->attachment_x_[d],
d * (get_stem_extent (conf->column_ranks_[d], d, X_AXIS)[-d] - d * details_.stem_gap_));
}
- while (flip (&d) != LEFT);
}
return conf;
}
penalty += p;
}
- Direction d = LEFT;
- do
+ for (LEFT_and_RIGHT (d))
{
if (!spec.note_head_drul_[d])
continue;
penalty += p;
}
- while (flip (&d) != LEFT);
if (ties_conf
&& ties_conf->size () == 1)
{
- Direction d = LEFT;
Drul_array<Grob *> stems (0, 0);
- do
+ for (LEFT_and_RIGHT (d))
{
if (!spec.note_head_drul_[d])
continue;
&& Stem::is_normal_stem (stem))
stems[d] = stem;
}
- while (flip (&d) != LEFT);
bool tie_stem_dir_ok = true;
bool tie_position_dir_ok = true;
Tie_formatting_problem::generate_extremal_tie_variations (Ties_configuration const &ties) const
{
vector<Tie_configuration_variation> vars;
- Direction d = DOWN;
for (int i = 1; i <= details_.multi_tie_region_size_; i++)
{
Drul_array<Tie_configuration *> configs (0, 0);
- do
+ for (DOWN_and_UP (d))
{
const Tie_configuration &config = boundary (ties, d, 0);
if (config.dir_ == d
vars.push_back (var);
}
}
- while (flip (&d) != DOWN);
if (configs[LEFT] && configs[RIGHT])
{
Tie_configuration_variation var;
sz = 1;
for (int i = 0; i < sz; i++)
{
- Direction d = LEFT;
- do
+ for (LEFT_and_RIGHT (d))
{
if (i == 0
&& ties[0].dir_ == d)
vars.push_back (var);
}
}
- while (flip (&d) != LEFT);
}
return vars;
}