]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/bow.cc
release: 0.1.15
[lilypond.git] / lily / bow.cc
index e24f79d067c16ccd46d52bd6816b2d084a03c87e..34b7eb77940d9e49cc369ebbf9a5743dde9d40f4 100644 (file)
 
 Bow::Bow()
 {
-    left_pos_i_ = right_pos_i_ = 0;
-    left_dx_f_ = right_dx_f_ = 0.0;
+  pos_i_drul_[LEFT] = pos_i_drul_[RIGHT] = 0;
+  dx_f_drul_[LEFT] = dx_f_drul_[RIGHT] = 0.0;
 }
 
 
 Offset
 Bow::center() const
 {
-    int dy =  right_pos_i_-left_pos_i_;
+  int dy =  pos_i_drul_[RIGHT]-pos_i_drul_[LEFT];
 
-    Real w = width().length();
+  Real w = width().length ();
 
-    return Offset(w/2,dy * paper()->internote_f());
+  return Offset (w/2,dy * paper()->internote_f ());
 }
 
 
 Molecule*
 Bow::brew_molecule_p() const
 {
-    Molecule*output = new Molecule;
-    Real w = width().length();
-    
-    int dy = right_pos_i_ - left_pos_i_;
-    
-    Real nw_f = paper()->note_width();
-    Real nh_f = paper()->internote_f();
-
-    
-    w+= (right_dx_f_ - left_dx_f_) * nw_f ;
-    Real round_w = w;          // slur lookup rounds the slurwidth .
-    
-    Symbol sl = paper()->lookup_l()->slur(dy , round_w, dir_i_);
-
-    Real error = w-round_w;
-    
-    Atom a(sl);
-    a.translate(Offset((left_dx_f_ + 0.5 )*nw_f + error/2,
-                      left_pos_i_ * nh_f));
-    output->add(a);
-    return output;
+  Molecule*output = new Molecule;
+  Real w = width().length ();
+  
+  int dy = pos_i_drul_[RIGHT] - pos_i_drul_[LEFT];
+  
+  Real nw_f = paper()->note_width ();
+  Real nh_f = paper()->internote_f ();
+
+  
+  w+= (dx_f_drul_[RIGHT] - dx_f_drul_[LEFT]) * nw_f ;
+  Real round_w = w;            // slur lookup rounds the slurwidth .
+  
+  Atom a = paper()->lookup_l ()->slur (dy , round_w, dir_);
+
+  Real error = w-round_w;
+    a.translate (Offset ((dx_f_drul_[LEFT] + 0.5)*nw_f + error/2,
+                      pos_i_drul_[LEFT] * nh_f));
+  output->add (a);
+  return output;
 }
 
-IMPLEMENT_STATIC_NAME(Bow);
+
+IMPLEMENT_IS_TYPE_B1(Bow,Directional_spanner);