-ADD_INTERFACE (Tie_column, "tie-column-interface",
- "Object that sets directions of multiple ties in a tied chord",
- "direction");
+MAKE_SCHEME_CALLBACK (Tie_column, calc_positioning_done, 1)
+SCM
+Tie_column::calc_positioning_done (SCM smob)
+{
+ Grob *me = unsmob_grob (smob);
+ extract_grob_set (me, "ties", ro_ties);
+ vector<Grob *> ties (ro_ties);
+ if (!ties.size ())
+ return SCM_BOOL_T;
+
+ me->set_property ("positioning-done", SCM_BOOL_T);
+ vector_sort (ties, Tie::less);
+
+ Tie_formatting_problem problem;
+ problem.from_ties (ties);
+
+ SCM manual_configs = me->get_property ("tie-configuration");
+ problem.set_manual_tie_configuration (manual_configs);
+
+ Ties_configuration base = problem.generate_optimal_configuration ();
+ for (vsize i = 0; i < base.size (); i++)
+ {
+ SCM cp = Tie::get_control_points (ties[i], problem.common_x_refpoint (),
+ base[i],
+ problem.details_);
+
+ ties[i]->set_property ("control-points", cp);
+ set_grob_direction (ties[i],
+ base[i].dir_);
+
+ problem.set_debug_scoring (base);
+ }
+ return SCM_BOOL_T;
+}
+
+ADD_INTERFACE (Tie_column,
+ "Object that sets directions of multiple ties in a tied"
+ " chord.",
+
+ /* properties */
+ "positioning-done "
+ "tie-configuration "
+ );