2 collision-reg.cc -- implement Collision_engraver
4 source file of the GNU LilyPond music typesetter
6 (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
9 #include "note-column.hh"
10 #include "collision-engraver.hh"
11 #include "collision.hh"
14 Collision_engraver::process_acknowledged ()
17 if (col_p_ || note_column_l_arr_.size () < 2)
21 col_p_ = new Collision;
22 announce_element (Score_element_info (col_p_,0));
24 for (int i=0; i< note_column_l_arr_.size (); i++)
25 col_p_->add_column (note_column_l_arr_[i]);
29 Collision_engraver::acknowledge_element (Score_element_info i)
31 if (Note_column * c = dynamic_cast<Note_column *> (i.elem_l_))
33 if (c->rest_b () || c->dim_cache_[X_AXIS]->parent_l_
34 || c->dim_cache_[X_AXIS]->parent_l_)
37 note_column_l_arr_.push (c);
42 Collision_engraver::do_pre_move_processing()
46 typeset_element (col_p_);
49 note_column_l_arr_.clear ();
52 Collision_engraver::Collision_engraver()
59 ADD_THIS_TRANSLATOR(Collision_engraver);