]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-0.1.7
authorfred <fred>
Sun, 24 Mar 2002 19:50:46 +0000 (19:50 +0000)
committerfred <fred>
Sun, 24 Mar 2002 19:50:46 +0000 (19:50 +0000)
lily/include/offset.hh
lily/paper-def.cc

index bd5b2695323f497ff318baebd0e5c4befeac1bc4..00bc73e0e29032e2813403b2c4381f4554d3853f 100644 (file)
@@ -6,33 +6,49 @@
 
 #ifndef OFFSET_HH
 #define OFFSET_HH
+
 #include "real.hh"
+#include "axes.hh"
+
 
 /// 2d vector 
 struct Offset {
-    Real x,y;
-
-    Offset operator+(Offset o)const {
-       Offset r(*this);
-       r+=o;
-       return r;
+    Real coordinate_a_[NO_AXES];
+    
+    Real &y() { return coordinate_a_[Y_AXIS]; }
+    Real &x() { return coordinate_a_[X_AXIS]; }
+    Real y()const { return coordinate_a_[Y_AXIS]; }
+    Real x()const { return coordinate_a_[X_AXIS]; }
+    
+    Real &operator[](Axis i) {
+       return coordinate_a_[i];
+    }
+    Real operator[](Axis i) const{
+       return coordinate_a_[i];
     }
     
     Offset operator+=(Offset o) {
-       x+=o.x;
-       y+=o.y;
+       x()+=o.x();
+       y()+=o.y();
        return *this;
     }
     Offset(Real ix , Real iy) {
-       x=ix;
-       y=iy;
+       x()=ix;
+       y()=iy;
     }
     Offset() {
-       x=0.0;
-       y=0.0;
+       x()=0.0;
+       y()=0.0;
     }
 };
 
+inline Offset
+operator+(Offset o1, Offset const& o2)
+{
+    o1 += o2;
+    return o1;
+}
+    
 #endif // OFFSET_HH
 
 
index 4cf44b1f8d9b2f8f9ad505c7c0ebc7be9b4898a7..baace2c030f282b80db685a7ac1d45062d156907 100644 (file)
@@ -51,7 +51,6 @@ Paper_def::Paper_def()
     itrans_p_ = 0;
     lookup_p_ = 0;
     real_vars_p_ = new Assoc<String,Real>;
-    outfile_str_ = "lelie.tex";
 }
 
 Paper_def::~Paper_def()