From: fred Date: Wed, 27 Nov 1996 01:37:49 +0000 (+0000) Subject: lilypond-0.0.11 X-Git-Tag: release/1.5.59~6748 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=349113f767ffd2eefec199278c9ef35758c89386;p=lilypond.git lilypond-0.0.11 --- diff --git a/hdr/boxes.hh b/hdr/boxes.hh index e3ea69a3bf..5bc2cb2e73 100644 --- a/hdr/boxes.hh +++ b/hdr/boxes.hh @@ -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.minmax) - 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 ); + Box(svec &); Box(); Box(Interval ix, Interval iy); }; diff --git a/src/boxes.cc b/src/boxes.cc index ebfc08abfe..b280e45f92 100644 --- a/src/boxes.cc +++ b/src/boxes.cc @@ -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 s) +Box::Box(svec &s) { assert(s.sz() == 4); x.min = s[0]; diff --git a/src/molecule.cc b/src/molecule.cc index e8c4d2adec..a664eeb74a 100644 --- a/src/molecule.cc +++ b/src/molecule.cc @@ -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