From: fred Date: Tue, 3 Dec 1996 23:06:11 +0000 (+0000) Subject: lilypond-0.0.14 X-Git-Tag: release/1.5.59~6682 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=9a8cb4d7ed924ebde1eb5b90cc9795f7ce8cb5e3;p=lilypond.git lilypond-0.0.14 --- diff --git a/src/idealspacing.cc b/src/idealspacing.cc new file mode 100644 index 0000000000..c6b84931f6 --- /dev/null +++ b/src/idealspacing.cc @@ -0,0 +1,30 @@ +#include "pcol.hh" +#include "pscore.hh" +#include "pstaff.hh" +#include "debug.hh" + +void +Idealspacing::print() const +{ +#ifndef NPRINT + mtor << "idealspacing {" ; + mtor << "distance "<rank() << " right " << right->rank() << "}\n"; +#endif +} + +Idealspacing::Idealspacing(const PCol * l,const PCol * r) +{ + space = 0.0; + hooke = 0.0; + left = l; + right = r; +} + +void +Idealspacing::OK() const +{ +#ifndef NDEBUG + assert(hooke >= 0 && left && right); +#endif +} diff --git a/src/pcol.cc b/src/pcol.cc index 41cf4fdb67..2fab154829 100644 --- a/src/pcol.cc +++ b/src/pcol.cc @@ -3,33 +3,6 @@ #include "pstaff.hh" #include "debug.hh" -void -Idealspacing::print() const -{ -#ifndef NPRINT - mtor << "idealspacing {" ; - mtor << "distance "<= 0 && left && right); -#endif -} - -/****************************************************************/ - Interval PCol::width() const { @@ -41,19 +14,27 @@ PCol::width() const w.unite(Interval(0,0)); return w; } +int +PCol::rank() const +{ + if(!pscore_) + return -1; + PCursor me=pscore_->find_col(this); + if (!me.ok()) + return -1; + PCursor bot(pscore_->cols.top()); + return me - bot; +} void PCol::print() const { #ifndef NPRINT mtor << "PCol {"; - if (pscore_) { // ugh - PCursor me=pscore_->find_col(this); - PCursor bot(pscore_->cols.top()); - if (me.ok()) { - mtor << "rank: " << me - bot << '\n'; - } - } + + if (rank() >= 0) + mtor << "rank: " << rank() << '\n'; + mtor << "# symbols: " << its.size() ; if (breakable()){ mtor << "\npre,post: ";