]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-0.0.11
authorfred <fred>
Wed, 27 Nov 1996 01:37:49 +0000 (01:37 +0000)
committerfred <fred>
Wed, 27 Nov 1996 01:37:49 +0000 (01:37 +0000)
hdr/boxes.hh
src/boxes.cc
src/molecule.cc

index e3ea69a3bf98563ea0ed6b29f24e3eed86f34cd2..5bc2cb2e735197da924d7c75b832e598a5234c8a 100644 (file)
@@ -5,9 +5,10 @@
 #ifndef BOXES_HH
 #define BOXES_HH
 
-#include "textdb.hh"
+#include "fproto.hh"
 #include "real.hh"
-#include "vray.hh"
+#include "interval.hh"
+
 
 /// 2d vector 
 struct Offset {
@@ -34,46 +35,6 @@ struct Offset {
     }
 };
 
-/// a Real interval
-struct Interval {
-    Real min, max;
-
-    void translate(Real t) {
-       min += t;
-       max += t;
-    }
-    Real operator[](int j) {
-       if (j==-1)
-           return min;
-       else if (j==1)
-           return max;
-       else
-           assert(false);
-               
-    }
-    void unite(Interval h) {
-       if (h.min<min)
-           min = h.min;
-       if (h.max>max)
-           max = h.max;
-    }
-    Real length() const;
-    void set_empty() ;
-    bool empty() { return min > max; }
-    Interval() {
-       set_empty();
-    }
-    Interval(Real m, Real M) {
-       min =m;
-       max = M;
-    }
-    Interval &operator += (Real r) {
-       min += r;
-       max +=r;
-       return *this;
-    }
-};
-
 
 /// a 4-tuple of #Real#s
 struct Box {
@@ -87,7 +48,7 @@ struct Box {
        x.unite(b.x);
        y.unite(b.y);
     }
-    Box(svec<Real> );
+    Box(svec<Real> &);
     Box();
     Box(Interval ix, Interval iy);
 };
index ebfc08abfe02c7861e90e4bea5b40567339752e2..b280e45f921dbf287812dcd86db74b9933a07a35 100644 (file)
@@ -1,16 +1,8 @@
 #include "boxes.hh"
 #include "const.hh"
+#include "vray.hh"
 
-void
-Interval::set_empty() {
-    min = INFTY;
-    max = -INFTY;
-}
-Real
-Interval::length() const {
-    return max-min;
-}
-Box::Box(svec<Real> s)
+Box::Box(svec<Real> &s)
 {
     assert(s.sz() == 4);
     x.min = s[0];
index e8c4d2adeca0f10a6728207a6f1f5a7173e31746..a664eeb74ad00c8902360a35f147318fd9ea6fb8 100644 (file)
@@ -1,4 +1,6 @@
 #include "glob.hh"
+#include "vray.hh"
+#include "interval.hh"
 #include "dimen.hh"
 #include "string.hh"
 #include "molecule.hh"
@@ -38,6 +40,7 @@ Atom::TeXstring() const
     return substitute_args(s, a);
 }
 
+/****************/
 
 String
 Molecule::TeXstring() const