]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/include/box.hh
Fix some bugs in the dynamic engraver and PostScript backend
[lilypond.git] / lily / include / box.hh
index 39aa77eeb3b88824b10d4f35a1316794258df8e6..a8119664b798d4f74bfe5c3fa272eb2f98c30caa 100644 (file)
@@ -1,35 +1,37 @@
 /*
-    some 2D geometrical concepts
+  some 2D geometrical concepts
 */
 
 #ifndef BOXES_HH
 #define BOXES_HH
 
-#include "flower-proto.hh"
-#include "real.hh"
 #include "interval.hh"
 #include "offset.hh"
-#include "axes.hh"
+#include "smobs.hh"
 
-
-struct Box {
+class Box
+{
   Interval interval_a_[NO_AXES];
-    
+  DECLARE_SIMPLE_SMOBS (Box,);
+public:
   Interval &x () {return interval_a_[X_AXIS]; }
   Interval &y (){ return interval_a_[Y_AXIS]; }
   Interval x () const{ return interval_a_[X_AXIS]; }
   Interval y () const{return interval_a_[Y_AXIS]; }
-  Interval operator[] (Axis a) const;
-  Interval &operator[] (Axis a);
-    
+  Interval operator [] (Axis a) const;
+  Interval &operator [] (Axis a);
+
+  Offset center () const;
+
   void translate (Offset o);
   /// smallest box enclosing #b#
   void set_empty ();
+  void add_point (Offset);
+  void widen (Real x, Real y);
   void scale (Real r);
   void unite (Box b);
   Box ();
   Box (Interval ix, Interval iy);
 };
 
-
 #endif