]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-0.1.22
authorfred <fred>
Sun, 24 Mar 2002 20:00:15 +0000 (20:00 +0000)
committerfred <fred>
Sun, 24 Mar 2002 20:00:15 +0000 (20:00 +0000)
bin/make-docxx.sh [new file with mode: 0644]
lily/axis.cc
lily/boxes.cc
lily/dot-column.cc
lily/dots.cc
lily/graphical-element.cc
lily/horizontal-align-item.cc
lily/include/axes.hh

diff --git a/bin/make-docxx.sh b/bin/make-docxx.sh
new file mode 100644 (file)
index 0000000..dc60f80
--- /dev/null
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+p1=`find ./ -name '*.hh' |egrep -v out/` 
+p2=`find ./ -name '*.cc' |egrep -v out/`
+doc++ -d out/ -S -k -p $p1 $p2
index d98d745b4c57347aef35b78390767ddba401664c..8689e1c1fe67e4ac7dbf2a0781cf0f3f49335d71 100644 (file)
@@ -6,6 +6,8 @@
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
 
+#include <assert.h>
+
 #include "axes.hh"
 #include "string.hh"
 
@@ -14,3 +16,24 @@ axis_name_str (Axis a)
 {
   return String (a + 'x');
 }
+
+/*
+  TODO inline these.
+ */
+Axis
+post_incr(Axis &a)
+{
+  assert(a < NO_AXES);
+  Axis b= a;
+  a = Axis(int(a) + 1);
+  return b;
+}
+
+Axis
+incr(Axis &a)
+{
+  assert(a < NO_AXES);
+  a = Axis(int(a) + 1);
+  return a;
+}
+
index 28fdeade839e61ce7147d12e7feee082b970972b..1529c7074915798270cde15212c9054caceeafd7 100644 (file)
 void
 Box::translate (Offset o)
 {
-  x().translate (o.x ());
-  y().translate (o.y ());
+  for (Axis i=X_AXIS; i < NO_AXES; incr(i))
+    interval_a_[i] += o[i];
 }
 
 void
 Box::unite (Box b)
 {
-  x().unite (b.x ());
-  y().unite (b.y ());
+  for (Axis i=X_AXIS; i < NO_AXES; incr(i))
+    interval_a_[i].unite (b[i]);
 }
 
+/**
+  Initialize to empty.
+ */
 Box::Box()
 {        
-
 }
 
 Box::Box (Interval ix, Interval iy)
index 6da5e0bbced6c990b08e786c16ca16965a5b82c4..58a16c1ce5d0956fcc6c7ef0ddfcc937be2096fd 100644 (file)
@@ -49,7 +49,7 @@ Dot_column::do_pre_processing ()
     w.unite (head_l_arr_[i]->width ());
   
   if (!w.empty_b ())
-    translate (w[RIGHT] - width() [LEFT],X_AXIS);
+    translate_axis (w[RIGHT] - width() [LEFT],X_AXIS);
 }
 
 IMPLEMENT_IS_TYPE_B1(Dot_column, Horizontal_group_item);
index 44e06c0b23bc9336a0fd96eef051f910024738c2..8bba43afcb4c7a9872c4038238484b572eb72e31 100644 (file)
@@ -36,17 +36,17 @@ Dots::brew_molecule_p () const
   Atom fill = paper()->lookup_l ()->fill (Box(Interval(0,0),Interval(0,0)));
   out->add(fill);
 
-  Atom d = paper ()->lookup_l ()->dots (0);
+  Atom d = paper ()->lookup_l ()->dots ();
 
   Real dw = d.dim_[X_AXIS].length();
-  d.translate(-dw,X_AXIS);
+  d.translate_axis(-dw,X_AXIS);
   for (int i=no_dots_i_; i--; )
     {
-      d.translate(2*dw,X_AXIS);
+      d.translate_axis(2*dw,X_AXIS);
       out->add (d);
     }
   Real inter_f = paper ()->internote_f ();
-  out->translate (inter_f * position_i_, Y_AXIS);
+  out->translate_axis (inter_f * position_i_, Y_AXIS);
   return out;
 }
 
index 98f29f77f468bb2f5f72a228c2a2ce1e8e0b5ae4..b5c104684691d3148e102428693a88f6b84074b2 100644 (file)
@@ -67,7 +67,7 @@ Graphical_element::absolute_offset() const
 }
 
 void
-Graphical_element::translate (Real y, Axis a)
+Graphical_element::translate_axis (Real y, Axis a)
 {
   if (axis_group_l_a_[a])
     axis_group_l_a_[a]->invalidate_cache (a);
@@ -109,8 +109,8 @@ Graphical_element::common_group (Graphical_element const* s, Axis a) const
 void
 Graphical_element::translate (Offset offset)
 {
-  translate (offset[Y_AXIS], Y_AXIS);
-  translate (offset[X_AXIS], X_AXIS);
+  translate_axis (offset[Y_AXIS], Y_AXIS);
+  translate_axis (offset[X_AXIS], X_AXIS);
 }
 
 Interval
index 6e63be3daa6177a9e19226e0b76ef56d3a202100..e5fe2e8d564c67d60ad15fbf8a3ffb6871575645 100644 (file)
@@ -94,14 +94,14 @@ Horizontal_align_item::do_pre_processing()
   for (int i=0 ;  i < item_l_arr_.size(); i++) 
     {
       Real dx = where_f -dims[i][-1];
-      item_l_arr_[i]->translate (dx , X_AXIS);
+      item_l_arr_[i]->translate_axis (dx , X_AXIS);
       if (item_l_arr_[i] == center_l_)
        center_dx_f = where_f;
       where_f += dims[i].length();
     }
   if (center_dx_f && !align_i_)
     for (int i=0 ;  i < item_l_arr_.size(); i++) 
-      item_l_arr_[i]->translate (- center_dx_f , X_AXIS);
+      item_l_arr_[i]->translate_axis (- center_dx_f , X_AXIS);
   
 }
 
index 812d983faa9f75cda9b56bba7454ba2fde01b3be..3e0284b68d3927a27a501f321dc85cbc9daa2b19 100644 (file)
@@ -20,4 +20,12 @@ class String;
 
 String axis_name_str (Axis);
 
+/**
+  the operator ++ for Axis. 
+ */
+Axis post_incr(Axis &);
+Axis incr(Axis &);
+//Axis operator++(Axis);
+
+
 #endif // AXES_HH