]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/bow.cc
release: 1.1.44
[lilypond.git] / lily / bow.cc
index 04a09d7bc95968a6d9c90ecc8048291e3d1c3191..046a95ee98812ddf1e971a61e1fd4842c02879de 100644 (file)
@@ -3,7 +3,7 @@
 
   source file of the GNU LilyPond music typesetter
 
-  (c)  1997--1998 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  (c)  1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
       Jan Nieuwenhuizen <janneke@gnu.org>
 */
 
 #include "bezier.hh"
 #include "main.hh"
 
-IMPLEMENT_IS_TYPE_B1(Bow,Directional_spanner);
-
 Bow::Bow ()
 {
   dy_f_drul_[LEFT] = dy_f_drul_[RIGHT] = 0.0;
   dx_f_drul_[LEFT] = dx_f_drul_[RIGHT] = 0.0;
-  dash_i_ = 0;
 }
 
 Molecule*
-Bow::brew_molecule_p () const
+Bow::do_brew_molecule_p () const
 {
-  Real thick = paper ()->get_var ("slur_thickness");
+  Real thick = paper_l ()->get_var ("slur_thickness");
   Array<Offset> c = get_controls ();
   Real dy = c[3].y () - c[0].y ();
-  Atom a;
+  Molecule a;
 
-  if (!dash_i_)
+  SCM d =  get_elt_property (dashed_scm_sym);
+  if (d == SCM_BOOL_F)
     a = lookup_l ()->slur (c);
   else
-    a = lookup_l ()->dashed_slur (c, thick, dash_i_);
+    a = lookup_l ()->dashed_slur (c, thick, gh_scm2int (SCM_CDR(d)));
 
   if (check_debug && !monitor->silent_b ("Bow"))
     {
       static int i = 1;
       cout << "******" << i++ << "******" << endl;
-      // gcc 2.7.2: ices
-//      cout << "c0.y: " << c[0].y << endl;
       cout << "c0.y: " << c[0].y () << endl;
       cout << "c3.y: " << c[3].y () << endl;
       cout << "dy: " << dy << endl;
@@ -53,7 +49,7 @@ Bow::brew_molecule_p () const
   a.translate (Offset (dx_f_drul_[LEFT], dy_f_drul_[LEFT]));
 
   Molecule* mol_p = new Molecule;
-  mol_p->add_atom (a);
+  mol_p->add_molecule (a);
 
   return mol_p;
 }
@@ -63,7 +59,7 @@ Bow::center () const
 {
   Real dy = dy_f_drul_[RIGHT] - dy_f_drul_[LEFT];
 
-  Real dx = width ().length ();
+  Real dx =  extent(X_AXIS).length ();
 
   return Offset (dx / 2, dy);
 }
@@ -71,15 +67,13 @@ Bow::center () const
 
 
 /*
-   
-   ugh .  Control points are too crude measures.
+   Ugh.  Control points are too crude measures.
  */
 Interval
 Bow::do_height () const
 {
-  Array<Offset> c (get_controls());
-
   Interval iv;
+  Array<Offset> c (get_controls());
   for (int i=0; i < c.size (); i++)
     {
       Real y = c[i][Y_AXIS];
@@ -88,18 +82,11 @@ Bow::do_height () const
   return iv;
 }
 
-Interval
-Bow::do_width () const    
-{
-  Interval i = Spanner::do_width ();
-  Real dx = i.length();
-  return Interval (0, dx);
-}
 
 Array<Offset>
 Bow::get_controls () const
 {
-  Bezier_bow b (paper ());
+  Bezier_bow b (paper_l ());
   b.set (get_encompass_offset_arr (), dir_);
   b.calc ();
   Array<Offset> controls;
@@ -116,18 +103,11 @@ Bow::get_encompass_offset_arr () const
 {
   Offset d (dx_f_drul_[RIGHT] - dx_f_drul_[LEFT],
     dy_f_drul_[RIGHT] - dy_f_drul_[LEFT]);
-  d.x() += width (). length ();
+  d.x() += extent (X_AXIS). length ();
 
-#define RESIZE_ICE
-#ifndef RESIZE_ICE
   Array<Offset> notes;
-  notes.push (Offset 0, 0));
+  notes.push (Offset (0, 0));
   notes.push (d);
-#else
-  Array<Offset> notes (2);
-  notes[0] = Offset (0, 0);
-  notes[1] = Offset (d);
-#endif
 
   return notes;
 }