#include "pcol.hh"
+#include "pscore.hh"
#include "pstaff.hh"
#include "debug.hh"
void
PCol::print() const
{
- #ifndef NPRINT
+#ifndef NPRINT
mtor << "PCol {";
+ if (pscore_) { // ugh
+ PCursor<PCol*> me=pscore_->find_col(this);
+ PCursor<PCol*> bot(pscore_->cols.top());
+ if (me.ok()) {
+ mtor << "rank: " << me - bot << '\n';
+ }
+ }
mtor << "# symbols: " << its.size() ;
if (breakable()){
- mtor << "pre,post: ";
+ mtor << "\npre,post: ";
prebreak->print();
postbreak->print();
+ } else if (daddy) {
+ mtor<<'\n' << ((this == daddy->prebreak) ? "prebreak" : "postbreak");
}
mtor << "extent: " << width().min << ", " << width().max << "\n";
mtor << "}\n";
- #endif
+#endif
}
int
-PCol::compare(const PCol &, const PCol &)
+PCol::compare(const PCol &c1, const PCol &c2)
{
- assert(false);
- return 0 ;
+ return c1.pscore_->compare_pcols(&c1,&c2);
}
void
assert(prebreak&&postbreak);
assert(prebreak->daddy == this);
assert(postbreak->daddy == this);
- }
-
+ }
}
void
prebreak = new PCol(this);
postbreak = new PCol(this);
- used = true;
+ prebreak->pscore_ = pscore_;
+ postbreak->pscore_ = pscore_;
+
+
}
bool
prebreak=0;
postbreak=0;
line=0;
- used = false;
+
+ pscore_ = 0;
}
PCol::~PCol()
{
its.bottom().add(i);
i->pcol_ = this;
- used = true;
+
+}
+
+bool
+PCol::used()const
+{
+ return breakable() || its.size();
}