]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/box.hh
Doc-it: update translation
[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 "interval.hh"
9 #include "offset.hh"
10 #include "smobs.hh"
11
12 class Box : public Simple_smob<Box>
13 {
14 public:
15   static const char type_p_name_[];
16 private:
17   Interval interval_a_[NO_AXES];
18 public:
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   Real area () const;
26   bool is_empty () const;
27   bool is_empty (Axis a) const;
28
29   Offset center () const;
30
31   void translate (Offset o);
32
33   /// smallest box enclosing #b#
34   void set_empty ();
35   void add_point (Offset);
36   void widen (Real x, Real y);
37   void scale (Real r);
38   void unite (Box b);
39   void intersect (Box b);
40   void print ();
41   Box ();
42   Box (Interval ix, Interval iy);
43 };
44
45
46 #endif