Index: guiframe/local_perspectives/plotting/boxSlicer.py
===================================================================
--- guiframe/local_perspectives/plotting/boxSlicer.py	(revision 7ab924167074b04222ed48f22e9ba404064832c3)
+++ guiframe/local_perspectives/plotting/boxSlicer.py	(revision 78ed1ad0935abeb4dc4f82ca853bfc483f2afbe3)
@@ -44,5 +44,5 @@
         self.left_line = VerticalLine(self, self.base.subplot,color='blue', zorder=zorder, 
                                         ymin= self.ymin, ymax= self.ymax,
-                                        x= self.xmin,
+                                        xmin= self.xmin,xmax= self.xmin,
                                         theta2= self.theta2)
         self.left_line.qmax = self.base.qmax
@@ -50,5 +50,5 @@
         self.right_line= VerticalLine(self, self.base.subplot,color='black', zorder=zorder,
                                      ymin= self.ymin, ymax= self.ymax,
-                                     x=self.xmax,
+                                     xmin=self.xmax,xmax=self.xmax,
                                       theta2= self.theta2)
         self.right_line.qmax = self.base.qmax
@@ -127,5 +127,5 @@
             print "left has moved"
             self.left_line.update(mline= self.main_line,translation=True)
-            self.right_line.update(mline= self.main_line,translation=True)
+            self.right_line.update(x=-1*self.left_line.x,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,
@@ -136,5 +136,5 @@
             print "right has moved"
             self.right_line.update(mline= self.main_line,translation=True)
-            self.left_line.update(mline= self.main_line,translation=True)
+            self.left_line.update(x=-1*self.right_line.x,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,
@@ -219,6 +219,6 @@
     def get_params(self):
         params = {}
-        params["x_min"] = self.left_line.x 
-        params["x_max"] = self.right_line.x 
+        params["x_min"] = self.left_line.xmin 
+        params["x_max"] = self.right_line.xmax 
         params["y_min"] = self.bottom_line.y
         params["y_max"] = self.top_line.y
@@ -264,5 +264,5 @@
         self.axes = axes
         
-        self.y = y
+        self.y= y
         self.save_y = y 
         
@@ -271,20 +271,15 @@
         self.xmax = xmax
         self.save_xmax = xmax
+        
         self.theta2 = theta2
-        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))
-        
-       
-        #print "phi and theta2", math.degrees(math.atan2(self.y, self.xmax))
-        
-        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 
-        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],
+
+        
+        x1= self.xmin*math.cos(self.theta2)- self.y*math.sin(self.theta2)
+        y1= self.xmin*math.sin(self.theta2)+ self.y*math.sin(self.theta2)
+        
+        x2= self.xmax*math.cos(self.theta2)- self.y*math.sin(self.theta2)
+        y2= self.xmax*math.sin(self.theta2)+ self.y*math.sin(self.theta2)
+        print "x1, y1", x1, y1, x2,y2
+        self.line = self.axes.plot([x1,x2],[y1,y2],
                                       linestyle='-', marker='',
                                       color=self.color,
@@ -329,10 +324,10 @@
             self.theta2= mline.theta
             delta = mline.get_delta_angle()
-            # rotation
-            x1 = self.radius1 * math.cos(self.phi_left +  delta)
-            y1= self.radius1 * math.sin(self.phi_left + delta)
-                
-            x2= -1*self.radius2 * math.cos( self.phi_right + delta)
-            y2= -1*self.radius2 * math.sin(self.phi_right + delta)
+            
+            x1= self.xmin*math.cos(self.theta2)- self.y*math.sin(self.theta2)
+            y1= self.xmin*math.sin(self.theta2)+ self.y*math.sin(self.theta2)
+        
+            x2= self.xmax*math.cos(self.theta2)- self.y*math.sin(self.theta2)
+            y2= self.xmax*math.sin(self.theta2)+ self.y*math.sin(self.theta2)
             
             self.line.set(xdata=[x1,x2], ydata=[y1,y2]) 
@@ -373,12 +368,5 @@
         """
         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
@@ -409,5 +397,5 @@
     """
     def __init__(self,base,axes,color='black', zorder=5, ymin=0.0, 
-                 ymax=0.5,x= 0.5,
+                 ymax=0.5,xmin= 0.5,xmax=0.5,
                  theta2= math.pi/3 ):
         
@@ -416,6 +404,8 @@
         self.axes = axes
         # x coordinate of the vertical line
-        self.x = x
-        self.save_x = x
+        self.xmin = xmin
+        self.save_xmin = xmin
+        self.xmax = xmax
+        self.save_xmax = xmax
         # minimum value of y coordinate of the vertical line 
         self.ymin = ymin
@@ -425,10 +415,10 @@
         self.save_ymax=ymax
         #insure rotation
-        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.radius1= math.sqrt(math.pow(self.xmin, 2)+ math.pow(self.ymin, 2))
+        self.radius2= math.sqrt(math.pow(self.xmax, 2)+ math.pow(self.ymax, 2))
+        
+        
+        self.theta_down = math.atan2(self.ymin, self.xmin)
+        self.theta_up = math.atan2(self.ymax, self.xmax)
         self.theta2= theta2
         
@@ -438,5 +428,11 @@
         #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],
+        self.xmin= self.xmin* math.cos(self.theta2)-self.ymin *math.sin(self.theta2)
+        self.xmax= self.xmax* math.cos(self.theta2)-self.ymax *math.sin(self.theta2)
+        
+        self.ymin= self.xmin* math.sin(self.theta2)+self.ymin *math.cos(self.theta2)
+        self.ymax= self.xmax* math.sin(self.theta2)+self.ymax *math.cos(self.theta2)
+        
+        self.line = self.axes.plot([self.xmin,self.xmax],[self.ymin,self.ymax],
                                       linestyle='-', marker='',
                                       color=self.color,
@@ -488,6 +484,9 @@
             x2= -1*self.radius2 * math.cos( self.phi_up + delta)
             y2= -1*self.radius2 * math.sin(self.phi_up + delta)
-            
-            self.line.set(xdata=[x1,x2], ydata=[y1,y2])  
+            self.xmin= x1
+            self.xmax=x2
+            self.ymin= y1
+            self.ymax= y2
+            self.line.set(xdata=[self.xmin,self.xmax], ydata=[self.ymin,self.ymax])  
            
         #else:
@@ -501,5 +500,7 @@
         can restore on Esc.
         """
-        self.save_x= self.x
+        #self.save_x= self.x
+        self.save_xmin= self.xmin
+        self.save_xmax= self.xmax
         self.save_ymin= self.ymin
         self.save_ymax= self.ymax
@@ -516,24 +517,26 @@
         Restore the roughness for this layer.
         """
-        self.x = self.save_x
-        
+        self.xmin = self.save_xmin
+        self.xmax = self.save_xmax
         self.ymin=self.save_ymin
         self.ymax=self.save_ymax
+        
+        
     def move(self, x, y, ev):
         """
         Process move to a new position, making sure that the move is allowed.
         """
-        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
-       
+        delta_xmin = x- self.save_xmin
+        delta_xmax = x- self.save_xmax
+        delta_ymin = y- self.save_ymin
+        delta_ymax = y- self.save_ymax
+        
+        self.xmin= self.xmin + delta_xmin
+        self.xmax= self.xmax + delta_xmax
+        
+        self.ymin= self.ymin +delta_ymin
+        self.ymax= self.ymax +delta_ymax
+        
+        
         self.has_move=True
         self.base.base.update()
Index: guiframe/local_perspectives/plotting/boxSum.py
===================================================================
--- guiframe/local_perspectives/plotting/boxSum.py	(revision 78ed1ad0935abeb4dc4f82ca853bfc483f2afbe3)
+++ guiframe/local_perspectives/plotting/boxSum.py	(revision 78ed1ad0935abeb4dc4f82ca853bfc483f2afbe3)
@@ -0,0 +1,502 @@
+#TODO: the line slicer should listen to all 2DREFRESH events, get the data and slice it
+#      before pushing a new 1D data update.
+
+#
+#TODO: NEED MAJOR REFACTOR
+#
+
+
+# Debug printout
+#from config import printEVT
+from BaseInteractor import _BaseInteractor
+from copy import deepcopy
+import math
+
+#from Plotter1D import AddPlotEvent
+import SlicerParameters
+import wx
+
+class BoxSum(_BaseInteractor):
+    """
+         Select an annulus through a 2D plot
+    """
+    def __init__(self,base,axes,color='black', zorder=3, x_min=0.0025, x_max=0.0025, y_min=0.0025, y_max=0.0025):
+        
+        _BaseInteractor.__init__(self, base, axes, color=color)
+        self.markers = []
+        self.axes = axes
+        self.qmax = self.base.qmax
+        self.connect = self.base.connect
+        
+        self.xmin= -1* x_min
+        self.ymin= -1* y_min
+        self.xmax= x_max
+        self.ymax=  y_max
+        # center of the figure
+        self.center_x= 0.0005
+        self.center_y= 0.0005
+       
+        ## Number of points on the plot
+        self.nbins = 20
+        self.count=0
+        self.error=0
+        
+        self.left_line = VerticalLine(self, self.base.subplot,color='blue', zorder=zorder, 
+                                        ymin= self.ymin, ymax= self.ymax,
+                                        x= self.xmin,
+                                        center_x= self.center_x,
+                                        center_y= self.center_y)
+        self.left_line.qmax = self.base.qmax
+        
+        self.right_line= VerticalLine(self, self.base.subplot,color='black', zorder=zorder,
+                                     ymin= self.ymin, ymax= self.ymax,
+                                     x=self.xmax,
+                                     center_x= self.center_x,
+                                     center_y= self.center_y)
+        self.right_line.qmax = self.base.qmax
+        
+        self.top_line= HorizontalLine(self, self.base.subplot,color='green', zorder=zorder,
+                                    y= self.ymax,
+                                    xmin= self.xmin, xmax= self.xmax,
+                                    center_x= self.center_x,
+                                    center_y= self.center_y)
+        self.top_line.qmax = self.base.qmax
+        
+        self.bottom_line= HorizontalLine(self, self.base.subplot,color='red', zorder=zorder,
+                                    y =self.ymin,
+                                    xmin= self.xmin, xmax= self.xmax,
+                                    center_x= self.center_x,
+                                    center_y= self.center_y)
+        self.bottom_line.qmax = self.base.qmax
+        #self.outer_circle.set_cursor(self.base.qmax/1.8, 0)
+        
+        self.connect_markers([])
+                      
+        self.update()
+        #self._post_data()
+        
+        # Bind to slice parameter events
+        self.base.parent.Bind(SlicerParameters.EVT_SLICER_PARS, self._onEVT_SLICER_PARS)
+
+
+    def _onEVT_SLICER_PARS(self, event):
+        #printEVT("AnnulusSlicer._onEVT_SLICER_PARS")
+        event.Skip()
+        if event.type == self.__class__.__name__:
+            #self.set_params(event.params)
+            self.base.update()
+
+    def update_and_post(self):
+        self.update()
+        self._post_data()
+
+    def save_data(self, path, image, x, y):
+        output = open(path, 'w')
+        
+        data_x, data_y = self.get_data(image, x, y)
+        
+        output.write("<phi>  <average>\n")
+        for i in range(len(data_x)):
+            output.write("%g  %g\n" % (data_x[i], data_y[i]))
+        output.close()
+
+    def set_layer(self, n):
+        self.layernum = n
+        self.update()
+        
+    def clear(self):
+        self.clear_markers()
+        self.left_line.clear()
+        self.right_line.clear()
+        self.top_line.clear()
+        self.bottom_line.clear()
+        
+        #self.base.connect.disconnect()
+        self.base.parent.Unbind(SlicerParameters.EVT_SLICER_PARS)
+        
+    def update(self):
+        """
+        Respond to changes in the model by recalculating the profiles and
+        resetting the widgets.
+        """
+        if self.left_line.has_move:
+            print "left has moved"
+            self.left_line.update(mline=[self.center_x, self.center_y],translation=True)
+            self.right_line.update(mline= [self.center_x, self.center_y],translation=True)
+            self.top_line.update( xmin= self.left_line.x ,xmax= self.right_line.x,
+                                  mline= [self.center_x, self.center_y],translation=True)
+            self.bottom_line.update(xmin= self.left_line.x ,xmax= self.right_line.x,
+                                    mline= [self.center_x, self.center_y],translation=True)
+        if self.right_line.has_move:
+            print "right has moved"
+            self.right_line.update(mline= [self.center_x, self.center_y],translation=True)
+            self.left_line.update(mline=[self.center_x, self.center_y],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,
+                                  mline= [self.center_x, self.center_y],translation=True)
+            self.bottom_line.update(xmin= self.left_line.x ,xmax= self.right_line.x,
+                                    mline= [self.center_x, self.center_y],translation=True)
+            
+            
+        if self.bottom_line.has_move:
+            print "bottom has moved"
+            self.bottom_line.update(mline= [self.center_x, self.center_y],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.center_x, self.center_y],translation=True)
+            self.right_line.update(ymin= self.bottom_line.y ,ymax= self.top_line.y,
+                                   mline= [self.center_x, self.center_y],translation=True)
+            
+        if self.top_line.has_move:
+            print "top has moved"
+            self.top_line.update(mline= [self.center_x, self.center_y],translation=True)
+            #self.bottom_line.update()xmin=None, xmax=None,y=None, mline=None):
+            self.bottom_line.update(y= -1*self.top_line.y,mline= [self.center_x, self.center_y],
+                                    translation=True )
+            self.left_line.update(ymin= self.bottom_line.y ,ymax= self.top_line.y,
+                                  mline= [self.center_x, self.center_y],translation=True)
+            self.right_line.update(ymin= self.bottom_line.y ,ymax= self.top_line.y,
+                                   mline= [self.center_x, self.center_y],translation=True)
+            
+    
+    def save(self, ev):
+        """
+        Remember the roughness for this layer and the next so that we
+        can restore on Esc.
+        """
+        self.base.freeze_axes()
+        self.inner_circle.save(ev)
+        self.outer_circle.save(ev)
+
+    def _post_data(self):
+        # Compute data
+        data = self.base.data2D
+        from DataLoader.manipulations import  Boxavg
+        radius = math.sqrt(math.pow(self.qmax,2)+math.pow(self.qmax,2))
+        x_min= self.left_line.x 
+        x_max= self.right_line.x 
+        y_min= self.bottom_line.y
+        y_max= self.top_line.y
+        box =  Boxavg (x_min=x_min, x_max=x_max, y_min=y_min, y_max=y_max)
+       
+        self.count, self.error= box(self.base.data2D)
+        
+        
+              
+                                       
+    def moveend(self, ev):
+        self.base.thaw_axes()
+        
+        # Post paramters
+        event = SlicerParameters.SlicerParameterEvent()
+        event.type = self.__class__.__name__
+        #event.params = self.get_params()
+        wx.PostEvent(self.base.parent, event)
+
+        self._post_data()
+            
+    def restore(self):
+        """
+        Restore the roughness for this layer.
+        """
+        self.inner_circle.restore()
+        self.outer_circle.restore()
+
+    def move(self, x, y, ev):
+        """
+        Process move to a new position, making sure that the move is allowed.
+        """
+        print "in move"
+        if self.xmin <= x and x<= self.xmax:
+            print "has move whole", x
+        
+    def set_cursor(self, x, y):
+        pass
+        
+    def get_params(self):
+        params = {}
+        params["x_min"] = self.left_line.x 
+        params["x_max"] = self.right_line.x 
+        params["y_min"] = self.bottom_line.y
+        params["y_max"] = self.top_line.y
+        params["count"] = self.count
+        params["error"] = self.error
+        params["center_x"] = self.center_x
+        params["center_y"] = self.center_y
+        return params
+    
+    def set_params(self, params):
+        
+        x_min = params["x_min"] 
+        x_max = params["x_max"] 
+        y_min = params["y_min"]
+        y_max = params["y_max"] 
+        theta = params["theta"]
+        center_x = params["center_x"]
+        center_y = params["center_y"]
+        
+        self.left_line.update(mline= [center_x, center_y],ymin= y_min ,ymax= y_max)
+        self.right_line.update(mline= [center_x, center_y],ymin= y_min ,ymax= y_max)
+        self.top_line.update(mline= [center_x, center_y], xmin= x_min ,xmax= xmax)
+        self.bottom_line.update(mline= [center_x, center_y],xmin= xmin ,xmax= xmax)
+        
+        
+        self._post_data()
+    def freeze_axes(self):
+        self.base.freeze_axes()
+        
+    def thaw_axes(self):
+        self.base.thaw_axes()
+
+    def draw(self):
+        self.base.draw()
+
+class HorizontalLine(_BaseInteractor):
+    """
+         Select an annulus through a 2D plot
+    """
+    def __init__(self,base,axes,color='black', zorder=5, y=0.5,
+                 xmin=0.0,xmax=0.5,
+                 center_x= 0,
+                 center_y= 0):
+        
+        _BaseInteractor.__init__(self, base, axes, color=color)
+        self.markers = []
+        self.axes = axes
+        # center
+        self.center_x = center_x
+        self.center_y = center_y
+        
+        self.y= y - self.center_y
+        self.save_y= y- self.center_y
+        
+        self.xmin = xmin - self.center_x
+        self.save_xmin = xmin - self.center_x
+        self.xmax = xmax - self.center_x
+        self.save_xmax = xmax - self.center_x
+        
+       
+        self.line = self.axes.plot([self.xmin,self.xmax],[self.y,self.y],
+                                      linestyle='-', marker='',
+                                      color=self.color,
+                                      visible=True)[0]
+ 
+
+        self.npts = 20
+        self.has_move=False
+        self.connect_markers([self.line])
+        self.update()
+
+    def set_layer(self, n):
+        self.layernum = n
+        self.update()
+        
+    def clear(self):
+        self.clear_markers()
+        try:
+            
+            self.line.remove()
+        except:
+            # Old version of matplotlib
+            for item in range(len(self.axes.lines)):
+                del self.axes.lines[0]
+        
+    def get_radius(self):
+        
+        return 0
+   
+    def update(self,xmin=None, xmax=None,y=None, mline=None,translation=False):
+        """
+        Draw the new roughness on the graph.
+        """
+        #print "update main line", self.has_move
+        if xmin !=None:
+            self.xmin = xmin # - self.center_x
+        if xmax !=None:
+            self.xmax = xmax #- self.center_x
+        if y !=None:
+            self.y = y #- self.center_y
+        
+        self.line.set(xdata=[self.xmin,self.xmax], ydata=[self.y,self.y])
+     
+        
+        
+    def save(self, ev):
+        """
+        Remember the roughness for this layer and the next so that we
+        can restore on Esc.
+        """
+        self.save_xmin= self.xmin
+        self.save_xmax= self.xmax
+       
+        self.save_y= self.y
+        self.base.freeze_axes()
+
+    def moveend(self, ev):
+        
+        self.has_move=False
+        self.base.moveend(ev)
+            
+    def restore(self):
+        """
+        Restore the roughness for this layer.
+        """
+        self.ymin = self.save_ymin
+        self.ymax = self.save_ymax
+
+    def move(self, x, y, ev):
+        """
+        Process move to a new position, making sure that the move is allowed.
+        """
+        self.y= y - self.center_y
+        
+        self.has_move=True
+        self.base.base.update()
+        
+    def set_cursor(self, x, y):
+        self.move(x, y, None)
+        self.update()
+        
+        
+    def get_params(self):
+        params = {}
+        params["radius"] = self.xmin
+        params["theta"] = self.xmax
+        return params
+    
+    def set_params(self, params):
+
+        x = params["radius"] 
+        self.set_cursor(x, self._inner_mouse_y)
+        
+
+
+
+class VerticalLine(_BaseInteractor):
+    """
+         Select an annulus through a 2D plot
+    """
+    def __init__(self,base,axes,color='black', zorder=5, ymin=0.0, 
+                 ymax=0.5,x= 0.5,
+                   center_x= 0,
+                 center_y= 0):
+        
+        _BaseInteractor.__init__(self, base, axes, color=color)
+        self.markers = []
+        self.axes = axes
+        # x coordinate of the vertical line
+        self.center_x= center_x
+        self.center_y= center_y
+        self.x = x - center_x
+        self.save_x = x - center_x
+        # minimum value of y coordinate of the vertical line 
+        self.ymin = ymin - center_y
+        self.save_ymin = ymin - center_y
+        # maximum value of y coordinate of the vertical line 
+        self.ymax= ymax - center_y
+        self.save_ymax= ymax - center_y
+        
+        # Draw vertical line
+        self.line = self.axes.plot([self.x,self.x],[self.ymin,self.ymax],
+                                      linestyle='-', marker='',
+                                      color=self.color,
+                                      visible=True)[0]
+      
+        self.npts = 20
+        # Check vertical line motion
+        self.has_move=False
+        self.connect_markers([self.line])
+        self.update()
+
+    def set_layer(self, n):
+        self.layernum = n
+        self.update()
+        
+    def clear(self):
+        self.clear_markers()
+        try:
+            
+            self.line.remove()
+        except:
+            # Old version of matplotlib
+            for item in range(len(self.axes.lines)):
+                del self.axes.lines[0]
+        
+    def get_radius(self):
+        return 0
+    
+    def update(self,x=None,ymin=None, ymax=None, mline=None,translation=False):
+        """
+        Draw the new roughness on the graph.
+        """
+        if x!=None:
+            self.x = x #-self.center_x
+        if ymin !=None:
+            self.ymin = ymin #- self.center_y
+        if ymax !=None:
+            self.ymax = ymax #- self.center_y
+        
+        self.line.set(xdata=[self.x,self.x], ydata=[self.ymin,self.ymax])
+     
+        
+        
+    def save(self, ev):
+        """
+        Remember the roughness for this layer and the next so that we
+        can restore on Esc.
+        """
+        self.save_x= self.x
+        self.save_ymin= self.ymin
+        self.save_ymax= self.ymax
+        
+        self.base.freeze_axes()
+
+    def moveend(self, ev):
+        
+        self.has_move=False
+        self.base.moveend(ev)
+            
+    def restore(self):
+        """
+        Restore the roughness for this layer.
+        """
+        self.x = self.save_x
+        
+        self.ymin=self.save_ymin
+        self.ymax=self.save_ymax
+    def move(self, x, y, ev):
+        """
+        Process move to a new position, making sure that the move is allowed.
+        """
+        self.x = x - self.center_x
+       
+        self.has_move=True
+        self.base.base.update()
+        
+        
+    def set_cursor(self, x, y):
+        self.move(x, y, None)
+        self.update()
+        
+        
+    def get_params(self):
+        params = {}
+        params["x"] = self.xmin
+        params["ymin"] = self.ymin
+        params["ymax"] = self.ymax
+        return params
+    
+    def set_params(self, params):
+        """
+            Draw a vertical line given some value of params
+            @param params: a dictionary containing value for x, ymin , ymax to draw 
+            a vertical line
+        """
+        x = params["x"] 
+        ymin = params["ymin"] 
+        ymax = params["ymax"] 
+        #self.set_cursor(x, self._inner_mouse_y)
+        self.update(self,x =x,ymin =ymin, ymax =ymax)
+        
+
+         
