Index: guiframe/local_perspectives/plotting/boxSlicer.py
===================================================================
--- guiframe/local_perspectives/plotting/boxSlicer.py	(revision 8ff3ec197a6ddfb2ff282857d552e65c7af9814b)
+++ guiframe/local_perspectives/plotting/boxSlicer.py	(revision cd68f8ce443e246b276eb79add6fb60062d84fa7)
@@ -126,32 +126,41 @@
         if self.left_line.has_move:
             print "left has moved"
-            self.left_line.update()
-            self.right_line.update()
+            self.left_line.update(mline= self.main_line,translation=True)
+            self.right_line.update(mline= self.main_line,translation=True)
             #self.right_line.update(xmin= self.left_line.x ,xmax=-1*self.left_line.x)
-            self.top_line.update( xmin= self.left_line.x ,xmax= self.right_line.x)
-            self.bottom_line.update(xmin= self.left_line.x ,xmax= self.right_line.x)
+            self.top_line.update( xmin= self.left_line.x ,xmax= self.right_line.x,
+                                  mline= self.main_line,translation=True)
+            self.bottom_line.update(xmin= self.left_line.x ,xmax= self.right_line.x,
+                                    mline= self.main_line,translation=True)
         if self.right_line.has_move:
             print "right has moved"
-            self.right_line.update()
-            self.left_line.update()
+            self.right_line.update(mline= self.main_line,translation=True)
+            self.left_line.update(mline= self.main_line,translation=True)
             #self.left_line.update(xmin= self.right_line.x ,xmax=-1*self.right_line.x)
-            self.top_line.update( xmin= self.left_line.x ,xmax= self.right_line.x)
-            self.bottom_line.update(xmin= self.left_line.x ,xmax= self.right_line.x)
+            self.top_line.update( xmin= self.left_line.x ,xmax= self.right_line.x,
+                                  mline= self.main_line,translation=True)
+            self.bottom_line.update(xmin= self.left_line.x ,xmax= self.right_line.x,
+                                    mline= self.main_line,translation=True)
             
             
         if self.bottom_line.has_move:
             print "bottom has moved"
-            self.bottom_line.update()
-            self.top_line.update(y= -1*self.top_line.y)
-            self.left_line.update( ymin= self.bottom_line.y ,ymax= self.top_line.y)
-            self.right_line.update(ymin= self.bottom_line.y ,ymax= self.top_line.y)
+            self.bottom_line.update(mline= self.main_line,translation=True)
+            self.top_line.update(y= -1*self.top_line.y,translation=True)
+            self.left_line.update( ymin= self.bottom_line.y ,ymax= self.top_line.y,
+                                   mline= self.main_line,translation=True)
+            self.right_line.update(ymin= self.bottom_line.y ,ymax= self.top_line.y,
+                                   mline= self.main_line,translation=True)
             
         if self.top_line.has_move:
             print "top has moved"
-            self.top_line.update()
+            self.top_line.update(mline= self.main_line,translation=True)
             #self.bottom_line.update()xmin=None, xmax=None,y=None, mline=None):
-            self.bottom_line.update(y= -1*self.top_line.y )
-            self.left_line.update(ymin= self.bottom_line.y ,ymax= self.top_line.y)
-            self.right_line.update(ymin= self.bottom_line.y ,ymax= self.top_line.y)
+            self.bottom_line.update(y= -1*self.top_line.y,mline= self.main_line,
+                                    translation=True )
+            self.left_line.update(ymin= self.bottom_line.y ,ymax= self.top_line.y,
+                                  mline= self.main_line,translation=True)
+            self.right_line.update(ymin= self.bottom_line.y ,ymax= self.top_line.y,
+                                   mline= self.main_line,translation=True)
             
     
@@ -274,6 +283,6 @@
         self.phi_left= self.theta_left - self.theta2
         self.phi_right=  self.theta_right -  self.theta2 
-        #print "phi left right", math.degrees(self.phi_left),math.degrees(self.phi_right)
-        print "theta left right ", math.degrees(self.theta_left),math.degrees(self.theta_right)
+        print "phi left right", math.degrees(self.phi_left),math.degrees(self.phi_right)
+        #print "theta left right ", math.degrees(self.theta_left),math.degrees(self.theta_right)
         
         self.line = self.axes.plot([self.xmin,self.xmax],[self.y,self.y],
@@ -306,5 +315,5 @@
         return 0
    
-    def update(self,xmin=None, xmax=None,y=None, mline=None):
+    def update(self,xmin=None, xmax=None,y=None, mline=None,translation=False):
         """
         Draw the new roughness on the graph.
@@ -331,6 +340,6 @@
             print x1,x2,y1,y2
            
-        else:
-            self.line.set(xdata=[self.xmin,self.xmax], ydata=[self.y,self.y])
+        #else:
+        #    self.line.set(xdata=[self.xmin,self.xmax], ydata=[self.y,self.y])
      
         
@@ -364,5 +373,12 @@
         """
         self.y=y
-       
+        self.radius1= math.sqrt(math.pow(self.xmin, 2)+ math.pow(self.y, 2))
+        self.radius2= math.sqrt(math.pow(self.xmax, 2)+ math.pow(self.y, 2))
+        
+        self.theta_right= math.atan2(self.y,self.xmin)
+        self.theta_left= math.atan2(self.y,self.xmax)
+        
+        self.phi_left= self.theta_left - self.theta2
+        self.phi_right=  self.theta_right -  self.theta2 
         
         self.has_move=True
@@ -420,5 +436,5 @@
         self.phi_up= self.theta_up - self.theta2
         print "phi up down", math.degrees(self.phi_up),math.degrees(self.phi_down)
-        print "theta up down ", math.degrees(self.theta_up),math.degrees(self.theta_down)
+        #print "theta up down ", math.degrees(self.theta_up),math.degrees(self.theta_down)
         # Draw vertical line
         self.line = self.axes.plot([self.x,self.x],[self.ymin,self.ymax],
@@ -450,5 +466,5 @@
         return 0
     
-    def update(self,x=None,ymin=None, ymax=None, mline=None):
+    def update(self,x=None,ymin=None, ymax=None, mline=None,translation=False):
         """
         Draw the new roughness on the graph.
@@ -461,6 +477,9 @@
             self.ymax = ymax
         if mline !=None:
+            
             self.theta2= mline.theta
             delta = mline.get_delta_angle()
+            if translation:
+                delta= 0
             # rotation
             x1 = self.radius1 * math.cos(self.phi_down +  delta)
@@ -472,6 +491,6 @@
             self.line.set(xdata=[x1,x2], ydata=[y1,y2])  
            
-        else:
-           self.line.set(xdata=[self.x,self.x], ydata=[self.ymin,self.ymax])
+        #else:
+        #   self.line.set(xdata=[self.x,self.x], ydata=[self.ymin,self.ymax])
      
         
@@ -506,4 +525,15 @@
         """
         self.x = x
+        self.radius1= math.sqrt(math.pow(self.x, 2)+ math.pow(self.ymin, 2))
+        self.radius2= math.sqrt(math.pow(self.x, 2)+ math.pow(self.ymax, 2))
+        
+        
+        self.theta_down = math.atan2(self.ymin, self.x)
+        self.theta_up = math.atan2(self.ymax, self.x)
+        
+        
+        self.phi_down= self.theta_down - self.theta2
+        self.phi_up= self.theta_up - self.theta2
+       
         self.has_move=True
         self.base.base.update()
