]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/box.hh
* input/regression/balloon.ly: new file.
[lilypond.git] / lily / include / box.hh
1 /*
2     some 2D geometrical concepts
3 */
4
5 #ifndef BOXES_HH
6 #define BOXES_HH
7
8 #include "flower-proto.hh"
9 #include "real.hh"
10 #include "interval.hh"
11 #include "offset.hh"
12 #include "axes.hh"
13
14
15 struct Box
16 {
17   Interval interval_a_[NO_AXES];
18     
19   Interval &x () {return interval_a_[X_AXIS]; }
20   Interval &y (){ return interval_a_[Y_AXIS]; }
21   Interval x () const{ return interval_a_[X_AXIS]; }
22   Interval y () const{return interval_a_[Y_AXIS]; }
23   Interval operator[] (Axis a) const;
24   Interval &operator[] (Axis a);
25
26   Offset center () const;
27     
28   void translate (Offset o);
29   /// smallest box enclosing #b#
30   void set_empty ();
31   void add_point (Offset);
32   void widen (Real x, Real y);
33   void scale (Real r);
34   void unite (Box b);
35   Box ();
36   Box (Interval ix, Interval iy);
37 };
38
39
40 #endif