]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/collision.cc
release: 0.1.7
[lilypond.git] / lily / collision.cc
index 8f43ee4233b86f180dff743d78c4ca80638420dd..0af68c462e2e3efc6fe9ca1a61cd264d31997416 100644 (file)
 
 Collision::Collision()
 {
+    empty_b_ = transparent_b_ =true;
 }
 
 void
 Collision::add(Note_column* ncol_l)
 {
     clash_l_arr_.push(ncol_l);
+    add_element( ncol_l );
     add_dependency(ncol_l);
 }
 /**
@@ -75,7 +77,7 @@ Collision::do_pre_processing()
     do {
        if (!clash_group_arr_a[idx(d, false)].size()){
            clash_group_arr_a[idx(d,  false)] = clash_group_arr_a[idx(d, true)];
-           clash_group_arr_a[idx(d, true)].set_size(0);
+           clash_group_arr_a[idx(d, true)].clear();
        }
     } while ((d *= -1) != 1);
                                  
@@ -120,7 +122,8 @@ Collision::do_pre_processing()
 // reproduction of bugfix at 3am ?
        Note_head * nu_l= col_l_a[idx(1,0)]->head_l_arr_[0];
        Note_head * nd_l = col_l_a[idx(-1,0)]->head_l_arr_.top();
-       if (! (nu_l->balltype_i_ == nd_l->balltype_i_ && nu_l->dots_i_ == nd_l->dots_i_  && middle.length() == 0 )) {
+       if (! (nu_l->balltype_i_ == nd_l->balltype_i_ 
+              && nu_l->dots_i_ == nd_l->dots_i_  && middle.length() == 0 )) {
            x_off[idx(1,0)] -= 0.5;
            x_off[idx(1,1)] -= 0.5;
            x_off[idx(-1,1)] += 0.5;
@@ -131,14 +134,19 @@ Collision::do_pre_processing()
     Real inter_f = paper()->internote_f();
     Real wid_f = paper()->note_width();
     for (int j=0; j < 4; j++) {
-       if (col_l_a[j])
-           col_l_a[j]->translate(Offset(x_off[j] * wid_f,
-                                        y_off[j] * inter_f));
-       
+       if (col_l_a[j]) {
+           /* collision.cc:138: request for method `translate' is ambiguous 
+              
+              (shaddup)
+            */
+           Offset o(x_off[j] * wid_f, y_off[j] * inter_f);
+           ((Score_elem*)col_l_a[j])->translate(o);
+       }
     }
 }
 
-IMPLEMENT_STATIC_NAME(Collision);
+
+IMPLEMENT_IS_TYPE_B1(Collision, Item);
 
 void
 Collision::do_substitute_dependency(Score_elem*o_l,Score_elem*n_l)