]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/include/break.hh
patch::: 1.2.13.jcn4
[lilypond.git] / lily / include / break.hh
index 0a9fafe68cf461118b4b6fcc84545a80d2304797..c3d2f915e36c02159a563255e8409ed738662e70 100644 (file)
@@ -3,30 +3,18 @@
 
   source file of the GNU LilyPond music typesetter
 
-  (c) 1996, 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+  (c) 1996,  1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
 
 #ifndef BREAK_HH
 #define BREAK_HH
-#include "varray.hh"
+#include "array.hh"
+#include "interval.hh"
 #include "lily-proto.hh"
-#include "colhpos.hh"
+#include "column-x-positions.hh"
 
 
-/**
-  Statistics for the number of columns calced.
- */
-struct Col_stats
-{
-    int count_i_;
-    int cols_i_;
-
-    Col_stats(); 
-    void add(Line_of_cols const&l);
-    String str()const;
-};
-
 /** Class representation of an algorithm which decides where to put
   the column, and where to break lines.
   
@@ -36,45 +24,41 @@ struct Col_stats
 class Break_algorithm {
 protected:
 
-    Paper_score *pscore_l_;
-    Real linelength;
+  Paper_score *pscore_l_;
+  Real linelength;
 
-    /// search all pcols which are breakable.
-    Line_of_cols find_breaks() const;
+  /// search all pcols which are breakable.
+  Line_of_cols find_breaks() const;
 
-    Line_of_cols all_cols() const;
-    Array<int> find_break_indices()const;
+  Array<int> find_break_indices() const;
     
 
-    /// helper: solve for the columns in #curline#.
-    void solve_line(Col_hpositions*) const;
+  /// helper: solve for the columns in #curline#.
+  void solve_line (Column_x_positions*) const;
 
-    /// helper: approximate the energyv
-    void approximate_solve_line(Col_hpositions*) const;
+  /// helper: approximate the energyv
+  void approximate_solve_line (Column_x_positions*) const;
 
-    /// does curline fit on the paper?    
-    bool feasible(Line_of_cols)const;
+  /// does curline fit on the paper?    
+  bool feasible (Line_of_cols) const;
     
 
-    Line_spacer* generate_spacing_problem(Line_of_cols)const;
+  Line_spacer* generate_spacing_problem (Line_of_cols, Interval) const;
 
-    virtual Array<Col_hpositions> do_solve()const=0;
-    void print_stats()const;
+  virtual Array<Column_x_positions> do_solve() const=0;
+  virtual void do_set_pscore();
 
-    virtual void do_set_pscore();
 public:
-    Col_stats approx_stats_;
-    Col_stats exact_stats_;
-
-    Line_spacer* (*get_line_spacer)();
+  
+  Line_spacer* (*get_line_spacer)();
     
-    Break_algorithm();
-    void set_pscore(Paper_score*);
+  Break_algorithm();
+  void set_pscore (Paper_score*);
 
-    /// check if the spacing/breaking problem is well-stated
-    void problem_OK()const;
-    void OK()const;
-    Array<Col_hpositions> solve()const;
+  /// check if the spacing/breaking problem is well-stated
+  void problem_OK() const;
+  void OK() const;
+  Array<Column_x_positions> solve() const;
 };
 
 #endif // BREAK_HH