]> git.donarmstrong.com Git - lilypond.git/blob - lily/collision-grav.cc
release: 0.0.72pre
[lilypond.git] / lily / collision-grav.cc
1 /*
2   collision-reg.cc -- implement Collision_engraver
3
4   source file of the GNU LilyPond music typesetter
5
6   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
7 */
8
9 #include "note-column.hh"
10 #include "collision-grav.hh"
11 #include "collision.hh"
12
13 void
14 Collision_engraver::acknowledge_element(Score_elem_info i)
15 {
16     if (!(i.elem_l_->name() == Note_column::static_name()))
17         return;
18
19     if (!col_p_)
20         col_p_ = new Collision;
21     
22     col_p_->add((Note_column*)i.elem_l_->item());
23 }
24
25 void
26 Collision_engraver::do_pre_move_processing()
27 {
28     if (col_p_) {
29         typeset_element(col_p_);
30         col_p_ =0;
31     }
32 }
33 Collision_engraver::Collision_engraver()
34 {
35     col_p_ =0;
36 }
37
38 IMPLEMENT_STATIC_NAME(Collision_engraver);
39 IMPLEMENT_IS_TYPE_B1(Collision_engraver,Request_engraver);
40 ADD_THIS_ENGRAVER(Collision_engraver);