From 145eaee720c2628b3e5f07859a4e53220da265b6 Mon Sep 17 00:00:00 2001 From: fred Date: Sun, 24 Mar 2002 19:56:49 +0000 Subject: [PATCH] lilypond-0.1.52 --- lily/p-col.cc | 42 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/lily/p-col.cc b/lily/p-col.cc index 06fae0d37f..898c7357ab 100644 --- a/lily/p-col.cc +++ b/lily/p-col.cc @@ -10,6 +10,28 @@ #include "p-score.hh" #include "debug.hh" +void +Paper_column::add_rod (Paper_column * p, Real d, Direction dir) +{ + assert( sign (p->rank_i () - rank_i ()) == dir); + for (int i=0; i < minimal_dists_arr_drul_[dir].size (); i++) + { + Column_rod &rod = minimal_dists_arr_drul_[dir][i]; + if (rod.other_l_ == p) + { + rod.distance_f_ = rod.distance_f_ >? d; + return ; + } + } + + Column_rod cr; + cr.distance_f_ = d; + cr.other_l_ = p; + cr.dir_ = dir; + + minimal_dists_arr_drul_[dir].push (cr); + +} int Paper_column::rank_i() const @@ -44,10 +66,15 @@ Paper_column::do_print() const } if (break_status_i_) { - DOUT <<'\n' << ((break_status_i_ == -1)? "prebreak" : "postbreak"); + DOUT <<'\n' << ((break_status_i_ == LEFT) ? "prebreak" : "postbreak"); DOUT << '\n'; } // DOUT << "extent: " << width().str () << "\n"; + + for (int i=0; i < minimal_dists_arr_drul_[RIGHT].size (); i++) + { + minimal_dists_arr_drul_[RIGHT][i].print (); + } #endif } @@ -96,3 +123,16 @@ Paper_column::used_b() const IMPLEMENT_IS_TYPE_B1(Paper_column, Horizontal_group_item); +Paper_column* +Paper_column::column_l () const +{ + return (Paper_column*)this; +} + + +void +Paper_column::preprocess () +{ + minimal_dists_arr_drul_[LEFT].sort (Column_rod::compare); + minimal_dists_arr_drul_[RIGHT].sort (Column_rod::compare); +} -- 2.39.5