]> git.donarmstrong.com Git - lilypond.git/blob - lily/collision-reg.cc
release: 0.0.63
[lilypond.git] / lily / collision-reg.cc
1 /*
2   collision-reg.cc -- implement Collision_register
3
4   source file of the LilyPond music typesetter
5
6   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
7 */
8
9 #include "note-column.hh"
10 #include "collision-reg.hh"
11 #include "collision.hh"
12
13 void
14 Collision_register::acknowledge_element(Staff_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_);
23 }
24
25 void
26 Collision_register::pre_move_processing()
27 {
28     if (col_p_) {
29         typeset_element(col_p_);
30         col_p_ =0;
31     }
32 }
33 Collision_register::Collision_register()
34 {
35     col_p_ =0;
36 }
37
38 IMPLEMENT_STATIC_NAME(Collision_register);
39 ADD_THIS_REGISTER(Collision_register);