(c) 1996--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
-#include <math.h>
-#include <libc-extension.hh>
+#include "spanner.hh"
+
+#include <cmath>
+
+#include <libc-extension.hh>
#include "warn.hh"
-#include "spanner.hh"
#include "paper-column.hh"
#include "paper-score.hh"
#include "stencil.hh"
#include "system.hh"
#include "group-interface.hh"
+
+
+Grob *
+Spanner::clone (int count) const
+{
+ return new Spanner (*this, count);
+}
+
void
Spanner::do_break_processing ()
{
programming_error ("no broken bound");
else if (bound->get_system ())
{
- Spanner * span = dynamic_cast<Spanner*> (clone ());
+ Spanner * span = dynamic_cast<Spanner*> (clone (broken_intos_.size ()));
span->set_bound (LEFT, bound);
span->set_bound (RIGHT, bound);
continue;
}
- Spanner *span = dynamic_cast<Spanner*> (clone ());
+ Spanner *span = dynamic_cast<Spanner*> (clone (broken_intos_.size ()));
span->set_bound (LEFT,bounds[LEFT]);
span->set_bound (RIGHT,bounds[RIGHT]);
}
int
-Spanner::get_break_index ()const
+Spanner::get_break_index () const
{
return break_index_;
}
{
Interval_t<int> iv (0, 0);
- if (spanned_drul_[LEFT])
- {
- iv[LEFT] = Paper_column::get_rank (spanned_drul_[LEFT]->get_column ());
- }
- if (spanned_drul_[RIGHT])
- {
- iv[RIGHT] = Paper_column::get_rank (spanned_drul_[RIGHT]->get_column ());
- }
+ if (spanned_drul_[LEFT] && spanned_drul_[LEFT]->get_column ())
+ iv[LEFT] = Paper_column::get_rank (spanned_drul_[LEFT]->get_column ());
+ if (spanned_drul_[RIGHT] && spanned_drul_[RIGHT]->get_column ())
+ iv[RIGHT] = Paper_column::get_rank (spanned_drul_[RIGHT]->get_column ());
return iv;
}
}
}
-Spanner::Spanner (SCM s)
- : Grob (s)
+Spanner::Spanner (SCM s, Object_key const*key)
+ : Grob (s, key)
{
break_index_ = 0;
spanned_drul_[LEFT]=0;
Group_interface::add_thing (this, ly_symbol2scm ("interfaces"), ly_symbol2scm ("spanner-interface"));
}
-Spanner::Spanner (Spanner const &s)
- : Grob (s)
+Spanner::Spanner (Spanner const &s, int count)
+ : Grob (s, count)
{
spanned_drul_[LEFT] = spanned_drul_[RIGHT] =0;
}