lilypond-1.3.16
[lilypond.git] / lily / axis-group-engraver.cc
blob9ae9db643886ebd331494387bfef89d138756714
1 /*
2 axis-group-engraver.cc -- implement Axis_group_engraver
4 source file of the GNU LilyPond music typesetter
6 (c) 1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
7 */
9 #include "axis-group-engraver.hh"
10 #include "axis-group-spanner.hh"
11 #include "paper-column.hh"
13 Axis_group_engraver::Axis_group_engraver ()
15 staffline_p_ = 0;
18 void
19 Axis_group_engraver::do_creation_processing ()
21 staffline_p_ = get_spanner_p ();
22 staffline_p_->set_axes (Y_AXIS, Y_AXIS);
23 staffline_p_->set_bounds(LEFT,get_staff_info().command_pcol_l ());
24 announce_element (Score_element_info (staffline_p_, 0));
27 Axis_group_spanner*
28 Axis_group_engraver::get_spanner_p () const
30 return new Axis_group_spanner;
32 void
33 Axis_group_engraver::do_removal_processing ()
35 staffline_p_->set_bounds(RIGHT,get_staff_info().command_pcol_l ());
36 typeset_element (staffline_p_);
37 staffline_p_ = 0;
40 void
41 Axis_group_engraver::acknowledge_element (Score_element_info i)
43 elts_.push (i.elem_l_);
46 void
47 Axis_group_engraver::process_acknowledged ()
49 /* UGH UGH UGH */
50 for (int i=0; i < elts_.size (); i++)
52 if (!elts_[i]->parent_l (Y_AXIS))
53 staffline_p_->add_element (elts_[i]);
54 else
55 if (
56 // elts_[i]->get_elt_property ("Axis_group_element::add_extra_element") == SCM_UNDEFINED &&
57 ! dynamic_cast<Axis_group_element*> (elts_[i]->parent_l (Y_AXIS)))
60 staffline_p_->add_element (elts_[i]);
63 elts_.clear ();
66 ADD_THIS_TRANSLATOR(Axis_group_engraver);