]> git.donarmstrong.com Git - lilypond.git/blob - hdr/boxes.hh
partial: 0.0.39-1.jcn
[lilypond.git] / hdr / boxes.hh
1 /*
2     some 2D geometrical concepts
3 */
4
5 #ifndef BOXES_HH
6 #define BOXES_HH
7
8 #include "fproto.hh"
9 #include "real.hh"
10 #include "interval.hh"
11 #include "offset.hh"
12
13 /// a square subset of Real^2
14 struct Box {
15     Interval x, y;
16
17     void translate(Offset o) {
18         x.translate(o.x);
19         y.translate(o.y);
20     }
21     /// smallest box enclosing #b#
22     void unite(Box b) {
23         x.unite(b.x);
24         y.unite(b.y);
25     }
26     Box();
27     Box(Interval ix, Interval iy);
28 };
29
30
31 #endif