]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/bezier.cc
release: 1.1.33
[lilypond.git] / lily / bezier.cc
index e851e74f031b72e8274bbbcdf8c761dbb587d07f..d516ff1c8d28d35aa5744749fdf663f99f1b8f3b 100644 (file)
@@ -3,7 +3,7 @@
 
   source file of the GNU LilyPond music typesetter
 
-  (c) 1998 Jan Nieuwenhuizen <janneke@gnu.org>
+  (c) 1998--1999 Jan Nieuwenhuizen <janneke@gnu.org>
 */
 
 #include <math.h>
@@ -11,8 +11,8 @@
 #include "misc.hh"
 
 #ifndef STANDALONE
+#include "dimensions.hh"
 #include "direction.hh"
-#include "dimension.hh"
 #include "paper-def.hh"
 #include "debug.hh"
 #include "main.hh"
@@ -85,6 +85,24 @@ Bezier::calc (int steps)
     }
 }
 
+void
+Bezier::print () const
+{
+#ifndef NPRINT
+  if (check_debug && !monitor->silent_b ("Bezier_controls"))
+    {
+      if (control_[1].length ())
+        {
+         cout << "Bezier\n";
+         cout << "Controls:  ";
+         for (int i=0; i < control_.size (); i++)
+           cout << control_[i].str () << ", ";
+//       cout << "\n";
+       }
+    }
+#endif
+}
+
 void
 Bezier::set (Array<Offset> points)
 {       
@@ -212,11 +230,33 @@ Bezier_bow::calc_f (Real height)
 void
 Bezier_bow::calc ()
 {
+#ifndef NPRINT
+//  if (check_debug && !monitor->silent_b ("Bezier_bow_controls"))
+  if (check_debug && !(monitor->silent_b ("Bezier_controls")
+    && monitor->silent_b ("Bezier_bow_controls")))
+    {
+      cout << "Before transform*********\n";
+      print ();
+      cout << "************************\n";
+    }
+#endif
   transform ();
+  print ();
 
   calc_controls ();
 
+  print ();
   transform_back ();
+#ifndef NPRINT
+//  if (check_debug && !monitor->silent_b ("Bezier_bow_controls"))
+  if (check_debug && !(monitor->silent_b ("Bezier_controls")
+    && monitor->silent_b ("Bezier_bow_controls")))
+    {
+      cout << "After transform*********\n";
+      print ();
+      cout << "************************\n";
+    }
+#endif
 }
 
 /*
@@ -474,6 +514,22 @@ Bezier_bow::check_fit_f ()
   return dy;
 }
 
+void
+Bezier_bow::print () const
+{
+#ifndef NPRINT
+  Bezier::print ();
+  if (check_debug && !monitor->silent_b ("Bezier_bow_controls"))
+    {
+      cout << "Bezier_bow\n";
+      cout << "Encompass: ";
+      for (int i=0; i < encompass_.size (); i++)
+       cout << encompass_[i].str () << ", ";
+//      cout << "\n";
+    }
+#endif
+}
+
 void
 Bezier_bow::set (Array<Offset> points, int dir)
 {
@@ -541,20 +597,11 @@ Bezier_bow::calc_default (Real h)
   Real indent = alpha * atan (beta * b);
   Real height = indent + h;
  
-#define RESIZE_ICE
-#ifndef RESIZE_ICE
   Array<Offset> control;
   control.push (Offset (0, 0));
   control.push (Offset (indent, height));
   control.push (Offset (b - indent, height));
   control.push (Offset (b, 0));
-#else
-  Array<Offset> control (4);
-  control[0] = Offset (0, 0);
-  control[1] = Offset (indent, height);
-  control[2] = Offset (b - indent, height);
-  control[3] = Offset (b, 0);
-#endif
   Bezier::set (control);
 }