]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/col-info.cc
patch::: 1.1.41.tca1
[lilypond.git] / lily / col-info.cc
index e54d421b3a2330093297ff24959ccc9766099943..fa87a8f65396ede486210bdb89d5646ba04fb372 100644 (file)
@@ -1,9 +1,9 @@
 /*
-  col-info.cc -- implement Colinfo
+  col-info.cc -- implement Column_info
 
   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>
 */
 
 #include "p-col.hh"
 #include "debug.hh"
 
 void
-Colinfo::print() const
+Column_info::print() const
 {
 #ifndef NPRINT
-    mtor << "column { ";
-    if (fixed())
-       mtor << "fixed at " << fixed_position()<<", ";
-    assert(pcol_l_);
-    mtor << "[" << minleft() << ", " << minright() << "]";
-    mtor <<"}\n";
+  DOUT << "column { ";
+  if (fixed_b())
+    DOUT << "fixed at " << fixed_position() << ", ";
+  assert (pcol_l_);
+  DOUT << width_.str();
+  Direction d = LEFT;
+  do {
+    for (int i=0; i < rods_[d].size (); i++)
+      rods_[d][i].print ();
+  } while (flip (&d) != LEFT);
+  
+  DOUT <<"}\n";
 #endif
 }
 
-Colinfo::Colinfo(PCol *col_l, Real const *fixed_C)
+Column_info::Column_info (Paper_column *col_l, Real const *fixed_C)
 {
-    if (fixed_C)
-       fixpos_p_.set_l(fixed_C);
-    ugh_b_ = false;
-    pcol_l_ = col_l;
-    width = pcol_l_->width();
+  if (fixed_C)
+    fixpos_p_.set_l (fixed_C);
+  ugh_b_ = false;
+  pcol_l_ = col_l;
+  width_ = pcol_l_->extent(X_AXIS);
+  if (width_.empty_b())
+    width_ = Interval(0,0);
 }
 
 
-Colinfo::Colinfo()
+Column_info::Column_info()
 {
-    ugh_b_ = false;
-    pcol_l_ =0;
+  ugh_b_ = false;
+  pcol_l_ =0;
 }
 
+bool
+Column_info::fixed_b () const
+{
+ return fixpos_p_.get_C();
+}
+
+Real
+Column_info::fixed_position () const
+{
+  return *fixpos_p_;
+}
+
+int
+Column_info::rank_i () const
+{
+  return pcol_l_->rank_i ();
+}
+
+void
+Spacer_rod::print ()const
+{
+  DOUT << "Other " << other_idx_ << "dist = " << distance_f_ << '\n';
+}