]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/include/box.hh
Imported Upstream version 2.19.45
[lilypond.git] / lily / include / box.hh
index 85173e0b5277ed15190661e8a7318457e0e42568..d4a8655a429b0cf965364132871cf2b7f9c3b054 100644 (file)
@@ -7,29 +7,40 @@
 
 #include "interval.hh"
 #include "offset.hh"
+#include "smobs.hh"
 
-struct Box
+class Box : public Simple_smob<Box>
 {
+public:
+  static const char * const type_p_name_;
+private:
   Interval interval_a_[NO_AXES];
-
+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 &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);
+  Real area () const;
+  bool is_empty () const;
+  bool is_empty (Axis a) const;
 
   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);
+  void intersect (Box b);
+  void print ();
   Box ();
   Box (Interval ix, Interval iy);
 };
 
+
 #endif