]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/include/spring-spacer.hh
release: 1.2.8
[lilypond.git] / lily / include / spring-spacer.hh
index 27d2f153331321858dd73ecf351307e1fc369e98..7359f6a1a6cb7296ce42fd948951f3f8d8b24370 100644 (file)
@@ -3,7 +3,7 @@
 
   source file of the GNU LilyPond music typesetter
 
-  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+  (c)  1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
 
@@ -11,9 +11,9 @@
 #define SPRING_SPACER_HH
 
 #include "line-spacer.hh"
-#include "plist.hh"
+#include "cons.hh"
 #include "col-info.hh"
-#include "colhpos.hh"
+#include "column-x-positions.hh"
 #include "moment.hh"
 
 
     The quality is given by the total potential energy in the
     springs. The lower the energy, the better the configuration.
 
-    TODO: make item widths work per Staff.
 
+    TODO: too complicated.  Revise.
+    Use force iso. energy.  Also optimise for uniform density
 */
 
 class Spring_spacer : public Line_spacer {
   friend class Durations_iter;
-    
-  Pointer_list<Idealspacing *> ideal_p_list_;
-  Array<Colinfo> cols_;
-  Array<Colinfo> loose_col_arr_;
-  Array<Spacer_rod> rods_;
+private:
+  // can't copy me.
+  Spring_spacer (Spring_spacer const&s);
+  Cons<Idealspacing> *ideal_p_list_;
+  Array<Column_info> cols_;
+  Real indent_f_;
   
-  /// mark column #i# as being loose.
-  void loosen_column (int i);
   /// the index of #c# in #cols#
   int col_id (Paper_column const *c) const;
 
@@ -64,37 +64,36 @@ class Spring_spacer : public Line_spacer {
 
   /// make the energy function
   void make_matrices (Matrix &quad, Vector &lin,Real&) const;
-  void get_ruling_durations(Array<Moment>&, Array<Moment>&);
+
 
   /// generate the LP constraints
   void make_constraints (Mixed_qp& lp) const;
 
 
   void handle_loose_cols();
-  void position_loose_cols (Vector &) const;
   bool try_initial_solution_and_tell (Vector&)const;
   Vector try_initial_solution() const;
-  void calc_idealspacing();
+
   void set_fixed_cols (Mixed_qp&) const;
 
   Score_column* scol_l (int);
   void connect (int i,int j, Real,Real);
-  Line_of_cols error_pcol_l_arr() const;
   Real calculate_energy_f (Vector) const;
 public:
   static Line_spacer *constructor();
-
-  virtual void solve (Col_hpositions*) const;
-  virtual void lower_bound_solution (Col_hpositions*) const;
-  virtual void add_column (Paper_column  *, bool fixed=false, Real fixpos=0.0);
+  Real energy_normalisation_f_;
+  Spring_spacer ();
+  virtual ~Spring_spacer ();  
+  virtual void solve (Column_x_positions*) const;
+  virtual void lower_bound_solution (Column_x_positions*) const;
+  virtual void add_columns (Link_array<Paper_column>);
+  void add_column (Paper_column *, bool,  Real);  
 
   virtual Vector default_solution() const;
   virtual bool check_constraints (Vector v) const;
   virtual void OK() const;
   virtual void print() const;
   virtual void prepare();
-  virtual ~Spring_spacer(){}
 };
 
 #endif // SPRING_SPACER_HH