]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-0.1.15
authorfred <fred>
Sun, 24 Mar 2002 19:58:05 +0000 (19:58 +0000)
committerfred <fred>
Sun, 24 Mar 2002 19:58:05 +0000 (19:58 +0000)
lily/tex-beam.cc
lily/tex-slur.cc

index c16a0e9c02a722e0b65da52327b4072a75926be1..5bc8ebbfcce0a22f9a82cc1470c2b3a6cc5206a1 100644 (file)
@@ -11,7 +11,7 @@
   */
 
 #include <math.h>
-#include "symbol.hh"
+#include "atom.hh"
 #include "molecule.hh"
 #include "tex.hh"
 #include "symtable.hh"
 #include "debug.hh"
 #include "lookup.hh"
 
-Symbol
+Atom
 Lookup::beam_element (int sidx, int widx, Real slope) const
 {
-  Symbol bs=(*symtables_)("beamslopes")->lookup ("slope");
+  Atom bs=(*symtables_)("beamslopes")->lookup ("slope");
   
   Array<String> args;
   args.push (sidx);
   args.push (widx);
-  bs.tex = substitute_args (bs.tex,args);
+  bs.tex_ = substitute_args (bs.tex_,args);
   int w = 2 << widx;
   Real width = w PT;
-  bs.dim.x() = Interval (0,width);
-  bs.dim.y() = Interval (0,width*slope);
+  bs.dim_.x() = Interval (0,width);
+  bs.dim_.y() = Interval (0,width*slope);
   return bs;
 }
 
@@ -54,20 +54,20 @@ slope_index (Real &s)
     return -6 * i+ 186;
 }
 
-Symbol
+Atom
 Lookup::rule_symbol (Real height, Real width) const
 {
-  Symbol bs=(*symtables_)("beamslopes")->lookup ("horizontal");    
+  Atom bs=(*symtables_)("beamslopes")->lookup ("horizontal");    
   Array<String> args;
   args.push (print_dimen (height));
   args.push (print_dimen (width));
-  bs.tex = substitute_args (bs.tex,args);
-  bs.dim.x() = Interval (0,width);
-  bs.dim.y() = Interval (0,height);
+  bs.tex_ = substitute_args (bs.tex_,args);
+  bs.dim_.x() = Interval (0,width);
+  bs.dim_.y() = Interval (0,height);
   return bs;
 }
 
-Symbol
+Atom
 Lookup::beam (Real &slope, Real width) const
 {        
   int sidx = slope_index (slope);
@@ -105,10 +105,10 @@ Lookup::beam (Real &slope, Real width) const
   a.translate (Offset (last_x, (last_x) * slope));
   m.add (a);
   
-  Symbol ret;
-  ret.tex = m.TeX_string();
-  ret.dim.y() = Interval (0,width*slope);
-  ret.dim.x() = Interval (0,width);
+  Atom ret;
+  ret.tex_ = m.TeX_string();
+  ret.dim_.y() = Interval (0,width*slope);
+  ret.dim_.x() = Interval (0,width);
   
   return ret;
 }
index 27dede2e41ac2fb96adce1e2f3e3092ef8914597..664460f8b9c542e4942071d24f8605273d559386 100644 (file)
@@ -36,7 +36,7 @@ direction_char (Direction y_sign)
   return c;
 }
 
-Symbol
+Atom
 Lookup::half_slur_middlepart (Real &dx, Direction dir) const
 {
   // todo
@@ -53,10 +53,10 @@ Lookup::half_slur_middlepart (Real &dx, Direction dir) const
       WARN <<  "slur too narrow\n";
     }
 
-  Symbol s;
+  Atom s;
   
-  s.dim.y() = Interval (min (0,0), max (0,0)); // todo
-  s.dim.x() = Interval (0,dx);
+  s.dim_.y() = Interval (min (0,0), max (0,0)); // todo
+  s.dim_.x() = Interval (0,dx);
 
   String f =  String ("\\hslurchar");
   f += direction_char (CENTER);
@@ -67,16 +67,14 @@ Lookup::half_slur_middlepart (Real &dx, Direction dir) const
 
   assert (idx < 256);
 
-  f+=String ("{") + String (idx) + "}";
-  s.tex = f;
-  Atom a (s);
-  a.translate (dx/2, X_AXIS);
-  s.tex = a.TeX_string();
+  f +=String ("{") + String (idx) + "}";
+  s.tex_ = f;
+  s.translate (dx/2, X_AXIS);
 
   return s;
 }
 
-Symbol
+Atom
 Lookup::half_slur (int dy, Real &dx, Direction dir, int xpart) const
 {
   Real orig_dx = dx;
@@ -100,9 +98,9 @@ Lookup::half_slur (int dy, Real &dx, Direction dir, int xpart) const
       WARN <<  "slur too narrow " << print_dimen (orig_dx)<<"\n";
     }
        
-  Symbol s;
-  s.dim.x() = Interval (0,dx);
-  s.dim.y() = Interval (min (0,dy), max (0,dy));
+  Atom s;
+  s.dim_.x() = Interval (0,dx);
+  s.dim_.y() = Interval (min (0,dy), max (0,dy));
 
 
   String f = String ("\\hslurchar");
@@ -123,12 +121,12 @@ Lookup::half_slur (int dy, Real &dx, Direction dir, int xpart) const
   f+=String ("{") + String (idx) + "}";
 
   
-  s.tex = f;
+  s.tex_ = f;
  
   return s;
 }
 
-Symbol
+Atom
 Lookup::slur (int dy , Real &dx, Direction dir) const
 {
   
@@ -172,9 +170,9 @@ Lookup::slur (int dy , Real &dx, Direction dir) const
       WARN<<"slur to steep: " << dy << " shrinking (ugh)\n";
     }
   
-  Symbol s;
-  s.dim.x() = Interval (0,dx);
-  s.dim.y() = Interval (min (0,dy), max (0,dy));
+  Atom s;
+  s.dim_.x() = Interval (-dx/2,dx/2);
+  s.dim_.y() = Interval (min (0,dy), max (0,dy));
 
   String f = String ("\\slurchar") + String (direction_char (y_sign));
 
@@ -199,16 +197,14 @@ Lookup::slur (int dy , Real &dx, Direction dir) const
   
   assert (idx < 256);
   f+=String ("{") + String (idx) + "}";
-  s.tex = f;
+  s.tex_ = f;
+
 
-  Atom a (s);
-  a.translate (dx/2, X_AXIS);
-  s.dim = a.extent();
-  s.tex = a.TeX_string();
+  s.translate (dx/2, X_AXIS);
   return s;    
 }
 
-Symbol
+Atom
 Lookup::big_slur (int dy , Real &dx, Direction dir) const
 {
   if (dx < 24 PT) 
@@ -229,18 +225,17 @@ Lookup::big_slur (int dy , Real &dx, Direction dir) const
   Atom r = half_slur (r_dy, right_wid, dir, 1);
   Real mid_wid = dx - left_wid - right_wid;
 
-  Atom m = half_slur (0, mid_wid, dir, 0);
-
   Molecule mol;
   mol.add (l);
-  Atom a (m);
+  Atom a (half_slur (0, mid_wid, dir, 0));
   a.translate (slur_extra * internote_f, Y_AXIS);
-  mol.add_at_edge (X_AXIS, RIGHT, m);
+  mol.add_at_edge (X_AXIS, RIGHT, a);
   mol.add_at_edge (X_AXIS, RIGHT, r);
   mol.translate (l_dy * internote_f, Y_AXIS);
-  Symbol s;
-  s.tex = mol.TeX_string();
-  s.dim = mol.extent();
+  
+  Atom s;
+  s.tex_ = mol.TeX_string();
+  s.dim_ = mol.extent();
   return s;
 }