]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/tex-beam.cc
release: 1.0.1
[lilypond.git] / lily / tex-beam.cc
index 0a1de1398db3f52a51b4791ad92fafbbbd411262..002154acc452e2ae2cd33c08c2621fd66cf17219 100644 (file)
@@ -1,9 +1,9 @@
 /*
-  tex-beam.cc -- implement Lookup::{beam_element, beam, rule_symbol}
+  tex-beam.cc -- implement Lookup::beam
 
   source file of the GNU LilyPond music typesetter
 
-  (c) 1996,1997 Han-Wen Nienhuys <hanwen@stack.nl>
+  (c) 1996, 1997--1998 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
 /*
@@ -15,7 +15,7 @@
 #include "molecule.hh"
 #include "tex.hh"
 #include "symtable.hh"
-#include "dimen.hh"
+#include "dimension.hh"
 #include "debug.hh"
 #include "lookup.hh"
 #include "misc.hh"
@@ -38,13 +38,13 @@ Lookup::rule_symbol (Real height, Real width) const
 }
 
 Atom 
-Lookup::beam(Real &slope, Real width, Real y_thick) const
+Lookup::beam(Real slope, Real width, Real thick) const
 {
   
-  Atom a( ps_beam (slope, width, y_thick));
-  Real slope_y =slope * width; 
-  Real min_y = (0 <? slope_y )- y_thick/2;
-  Real max_y = (0 >? slope_y) + y_thick/2;
+  Atom a (ps_beam (slope, width, thick));
+  Real height = slope * width; 
+  Real min_y = (0 <? height) - thick/2;
+  Real max_y = (0 >? height) + thick/2;
   
   a.dim_[X_AXIS] = Interval(0, width);
   a.dim_[Y_AXIS] = Interval(min_y, max_y);
@@ -52,29 +52,14 @@ Lookup::beam(Real &slope, Real width, Real y_thick) const
 }
 
 Atom
-Lookup::ps_beam (Real slope, Real width, Real y_thickness)const
+Lookup::ps_beam (Real slope, Real width, Real thick) const
 {
   String ps = "\\embeddedps{\n";
-  ps += String (width) + " "+ String (slope) + " " + String (y_thickness)
+  ps += to_str (width) + " "+ to_str (slope) + " " + to_str (thick)
     + " draw_beam}";
 
-  /* 
-   beam parts are rarely wider than 100pt: 
-   precision of 4 yields maximum (half beam spanning half a page)
-   error of: 1%% * 3*72pt === 0.2pt = 0.07mm
-   */
-  String width_str = String_convert::precision_str (width, 4);
-  String slope_str = String_convert::precision_str (slope, 4);
-  String thick_str = String_convert::precision_str (y_thickness, 3);
-  String name = "feta-beum-" + width_str + "-" + slope_str + "-" + thick_str;
-
-  int i;
-  while ((i = name.index_i ('.')) != -1)
-    name[i]=  'x';
-
-
-
   Atom s;
   s.tex_ = ps;
   return s;
 }
+