From: fred Date: Sun, 24 Mar 2002 19:48:18 +0000 (+0000) Subject: lilypond-0.0.76 X-Git-Tag: release/1.5.59~4442 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=165131ffc1c9387faaa97328080b9f2f33c80508;p=lilypond.git lilypond-0.0.76 --- diff --git a/lily/include/linespace.hh b/lily/include/linespace.hh index 97e4caf70c..587ecf912c 100644 --- a/lily/include/linespace.hh +++ b/lily/include/linespace.hh @@ -6,6 +6,7 @@ (c) 1996,1997 Han-Wen Nienhuys */ +#error #ifndef LINESPACE_HH #define LINESPACE_HH @@ -16,25 +17,6 @@ #include "interval.hh" #include "pointer.hh" -/// helper struct for #Spacing_problem# -struct Colinfo { - PCol *pcol_l_; - P fixpos_p_; - Interval width; - int rank_i_; - /// did some tricks to make this column come out. - bool ugh_b_; - /* *************** */ - Colinfo(); - Colinfo(PCol *,Real const *); - - void print() const; - bool fixed() const { return fixpos_p_.get_C();} - Real fixed_position()const { return *fixpos_p_; } - Real minright() const { return width.right; } - Real minleft() const { return -width.left; } -}; - /** the problem, given by the columns (which include constraints) and intercolumn spacing. The problem is: @@ -59,7 +41,7 @@ struct Colinfo { */ class Spacing_problem { - Array ideals; + PointerList ideal_p_list_; Array cols; Array loose_col_arr_; @@ -86,18 +68,7 @@ class Spacing_problem { void handle_loose_cols(); void position_loose_cols(Vector &) const; -public: - Array error_pcol_l_arr() const; - - /** solve the spacing problem - - @return the column positions, and the energy (last element) - - */ - Array solve() const; - - - /** + /** add a idealspacing to the problem. One pair of columns can have no, one or more idealspacings, @@ -105,23 +76,27 @@ public: not in this problem, the spacing is ignored. */ void add_ideal(Idealspacing const *i); - - - /** add a col to the problem. columns have to be added left to right. The column contains - info on it's minimum width. - */ - void add_column(PCol *, bool fixed=false, Real fixpos=0.0); - + void print_ideal(Idealspacing const *)const; + Vector try_initial_solution() const; + void calcideal(); + Score_column* scol_l(int); + void connect(int i,int j, Real,Real); +public: + static Line_spacer *constructor() { + return new Line_spacer; + } + Array error_pcol_l_arr() const; - bool check_constraints(Vector v) const; + virtual Array solve() const; + virtual void add_column(PCol *, bool fixed=false, Real fixpos=0.0); + - Vector try_initial_solution() const; - void OK() const; - void print() const; - void print_ideal(Idealspacing const *)const; - void prepare(); + virtual Vector default_solution() contains { + return try_initial_solution() ; + } + virtual bool check_constraints(Vector v) const; + virtual void OK() const; + virtual void print() const; + virtual void prepare(); }; - - -#endif diff --git a/lily/include/p-score.hh b/lily/include/p-score.hh index 32231f6371..596e718c41 100644 --- a/lily/include/p-score.hh +++ b/lily/include/p-score.hh @@ -25,13 +25,13 @@ public: Paper_def *paper_l_; /// the columns, ordered left to right - Pointer_list cols; + Pointer_list col_p_list_; /// the idealspacings, no particular order - Pointer_list suz; + Pointer_list suz_p_list_; /// crescs etc; no particular order - Pointer_list spanners; + Pointer_list span_p_list_; /// other elements Pointer_list elem_p_list_; @@ -71,14 +71,6 @@ public: /* UTILITY ROUTINES */ - /// get the spacing between c1 and c2, create one if necessary. - Idealspacing* get_spacing(PCol *c1, PCol *c2); - - /// connect c1 and c2 - void do_connect(PCol *c1, PCol *c2, Real distance_f, Real strength_f); - - /// connect c1 and c2 and any children of c1 and c2 - void connect(PCol* c1, PCol *c2, Real distance_f,Real strength_f= 1.0); /* STANDARD ROUTINES */ void OK()const; @@ -94,6 +86,7 @@ private: /// before calc_breaking void preprocess(); + void calc_idealspacing(); /// calculate where the lines are to be broken, and use results void calc_breaking();