- this file is a big mess, clean it up
-
- short-cut: try a smaller region first.
- handle non-visible stems better.
};
+
+struct Extra_collision_info
+{
+ Real idx_;
+ Box extents_;
+ Real penalty_;
+ Grob * grob_;
+
+ Extra_collision_info (Grob *g, Real idx, Interval x, Interval y, Real p)
+ {
+ idx_ = idx;
+ extents_[X_AXIS] = x;
+ extents_[Y_AXIS] = y;
+ penalty_ = p;
+ grob_ = g;
+ }
+ Extra_collision_info ()
+ {
+ idx_ = 0.0;
+ penalty_ = 0.;
+ grob_ = 0;
+ }
+};
+
+
struct Encompass_info
{
Real x_;
delete scores_;
}
-static void score_extra_encompass (Slur_score_state);
-static void score_slopes (Slur_score_state);
-static void score_edges (Slur_score_state);
-static void score_encompass (Slur_score_state);
-static Bezier avoid_staff_line (Slur_score_state,
+static void score_extra_encompass (Slur_score_state const&);
+static void score_slopes (Slur_score_state const&);
+static void score_edges (Slur_score_state const&);
+static void score_encompass (Slur_score_state const&);
+static Bezier avoid_staff_line (Slur_score_state const&,
Bezier bez);
-static Encompass_info get_encompass_info (Slur_score_state, Grob *col);
-static Bezier get_bezier (Slur_score_state,
+static Encompass_info get_encompass_info (Slur_score_state const&, Grob *col);
+static Bezier get_bezier (Slur_score_state const&,
Drul_array<Offset>,
Real r_0, Real h_inf);
static Direction get_default_dir (Grob *me);
static void set_end_points (Grob *);
-static Real broken_trend_y (Slur_score_state, Direction dir);
-static Drul_array<Bound_info> get_bound_info (Slur_score_state);
+static Real broken_trend_y (Slur_score_state const&, Direction dir);
+static Drul_array<Bound_info> get_bound_info (Slur_score_state const&);
-static void generate_curves (Slur_score_state);
-static Array<Slur_score> *enumerate_attachments (Slur_score_state,
+static void generate_curves (Slur_score_state const&);
+static Array<Slur_score> *enumerate_attachments (Slur_score_state const&,
Drul_array<Real> end_ys);
-static Drul_array<Offset> get_base_attachments(Slur_score_state);
-static Drul_array<Real> get_y_attachment_range(Slur_score_state);
+static Drul_array<Offset> get_base_attachments(Slur_score_state const&);
+static Drul_array<Real> get_y_attachment_range(Slur_score_state const&);
Real
/* HDIR indicates which side (left or right) we are processing here. */
Real
-broken_trend_y (Slur_score_state state, Direction hdir)
+broken_trend_y (Slur_score_state const &state, Direction hdir)
{
/* A broken slur should maintain the same vertical trend
the unbroken slur would have had. */
}
Encompass_info
-get_encompass_info (Slur_score_state state,
+get_encompass_info (Slur_score_state const &state,
Grob *col)
{
Grob *stem = unsmob_grob (col->get_property ("stem"));
}
Drul_array<Bound_info>
-get_bound_info (Slur_score_state state)
+get_bound_info (Slur_score_state const &state)
{
Drul_array<Bound_info> extremes;
*/
Drul_array<Real>
-get_y_attachment_range (Slur_score_state state)
+get_y_attachment_range (Slur_score_state const &state)
{
Drul_array<Real> end_ys;
Direction d = LEFT;
Drul_array<Offset>
-get_base_attachments (Slur_score_state state)
+get_base_attachments (Slur_score_state const &state)
{
Drul_array<Offset> base_attachment;
Direction d = RIGHT;
}
void
-generate_curves (Slur_score_state state)
+generate_curves (Slur_score_state const &state)
{
Real r_0 = robust_scm2double (state.slur_->get_property ("ratio"), 0.33);
Real h_inf = state.staff_space_ *scm_to_double (state.slur_->get_property ("height-limit"));
}
Bezier
-avoid_staff_line (Slur_score_state state,
+avoid_staff_line (Slur_score_state const &state,
Bezier bez)
{
Offset horiz (1,0);
}
Array<Slur_score> *
-enumerate_attachments (Slur_score_state state, Drul_array<Real> end_ys)
+enumerate_attachments (Slur_score_state const &state, Drul_array<Real> end_ys)
{
/*ugh. */
Array<Slur_score> scores;
void
-score_encompass (Slur_score_state state)
+score_encompass (Slur_score_state const &state)
{
Array<Encompass_info> infos;
(*state.scores_)[i].score_ += demerit + variance_penalty;
}
}
-
-struct Extra_collision_info
-{
- Real idx_;
- Box extents_;
- Real penalty_;
- Grob * grob_;
-
- Extra_collision_info (Grob *g, Real idx, Interval x, Interval y, Real p)
- {
- idx_ = idx;
- extents_[X_AXIS] = x;
- extents_[Y_AXIS] = y;
- penalty_ = p;
- grob_ = g;
- }
- Extra_collision_info ()
- {
- idx_ = 0.0;
- penalty_ = 0.;
- grob_ = 0;
- }
-};
-
void
-score_extra_encompass (Slur_score_state state)
+score_extra_encompass (Slur_score_state const &state)
{
Link_array<Grob> encompasses
= Pointer_group_interface__extract_grobs (state.slur_, (Grob *)0,
}
}
-/*
- TODO: should make edge penalties dependent on the direction that the
- slur-end is pointing.
- */
void
-score_edges (Slur_score_state state)
+score_edges (Slur_score_state const &state)
{
for (int i = 0; i < state.scores_->size (); i++)
{
}
void
-score_slopes (Slur_score_state state)
+score_slopes (Slur_score_state const &state)
{
Drul_array<Real> ys;
: state.parameters_.same_slope_penalty_;
#if DEBUG_SLUR_QUANTING
- (*state.scores_)[i].score_card_ += to_string ("S%.2f", d);
+ (*state.scores_)[i].score_card_ += to_string ("S%.2f", d);
#endif
- (*state.scores_)[i].score_ += demerit;
+ (*state.scores_)[i].score_ += demerit;
}
Bezier
-get_bezier (Slur_score_state state,
+get_bezier (Slur_score_state const &state,
Drul_array<Offset> attachments,
Real r_0, Real h_inf
)