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 "dots.hh"
#include "rhythmic-head.hh"
void
-Dot_column::add (Dots *d)
+Dot_column::add_dots (Dots *d)
{
dot_l_arr_.push (d);
add_dependency (d);
}
void
-Dot_column::add (Rhythmic_head *r)
+Dot_column::add_head (Rhythmic_head *r)
{
if (!r->dots_l_)
return ;
head_l_arr_.push (r);
add_dependency (r);
- add (r->dots_l_);
+ add_dots (r->dots_l_);
}
void
-Dot_column::do_substitute_dependency (Score_elem*o,Score_elem*n)
+Dot_column::do_substitute_element_pointer (Score_element*o,Score_element*n)
{
- Item *oi =o->item ();
- Item *ni = n?n->item ():0;
+ Item *oi =dynamic_cast <Item *> (o);
- if (oi&&oi->is_type_b (Rhythmic_head::static_name ()))
- head_l_arr_.substitute ((Rhythmic_head*)oi, (Rhythmic_head*)ni);
- else if (oi && oi->is_type_b (Dots::static_name ()))
- dot_l_arr_.substitute ((Dots*) oi, (Dots*) ni);
+ if (oi && dynamic_cast<Rhythmic_head *> (oi))
+ head_l_arr_.substitute (dynamic_cast<Rhythmic_head*> (oi),
+ dynamic_cast<Rhythmic_head*>(n));
+ else if (oi && dynamic_cast<Dots *> (oi))
+ dot_l_arr_.substitute (dynamic_cast<Dots*> (oi),
+ dynamic_cast<Dots*> (n));
}
void
{
Interval w;
for (int i=0; i < head_l_arr_.size (); i++)
- w.unite (head_l_arr_[i]->width ());
+ w.unite (head_l_arr_[i]->extent (X_AXIS));
if (!w.empty_b ())
- translate_axis (w[RIGHT] - width() [LEFT],X_AXIS);
+ translate_axis (w[RIGHT] - extent(X_AXIS) [LEFT],X_AXIS);
}
-IMPLEMENT_IS_TYPE_B1(Dot_column, Horizontal_group_item);
+
+
+Dot_column::Dot_column ()
+{
+ set_axes(X_AXIS,X_AXIS);
+}