#include "stencil.hh"
#include "system.hh"
#include "warn.hh"
+#include "constrained-breaking.hh"
Paper_score::Paper_score (Output_def *layout)
{
system->unprotect ();
}
+
+vector<int>
+Paper_score::find_break_indices () const
+{
+ vector<Grob*> all = root_system ()->columns ();
+ vector<int> retval;
+
+ for (vsize i = 0; i < all.size (); i++)
+ if (Item::is_breakable (all[i]))
+ retval.push_back (i);
+
+ return retval;
+}
+
+
vector<Column_x_positions>
Paper_score::calc_breaking ()
{
Break_algorithm *algorithm = 0;
vector<Column_x_positions> sol;
-
- algorithm = new Gourlay_breaking;
+
+ int system_count = robust_scm2int (layout ()->c_variable ("system-count"), 0);
+ if (system_count)
+ {
+ Constrained_breaking *b = new Constrained_breaking;
+ b->resize (system_count);
+ algorithm = b;
+ }
+ else
+ algorithm = new Gourlay_breaking;
+
algorithm->set_pscore (this);
sol = algorithm->solve ();
delete algorithm;
{
return paper_systems_;
}
+