Changeset d5a792a in sasview for guiframe


Ignore:
Timestamp:
Jan 7, 2009 1:44:22 PM (16 years ago)
Author:
Gervaise Alina <gervyh@…>
Branches:
master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
030873e
Parents:
d054809
Message:

working on boxslicer

File:
1 edited

Legend:

Unmodified
Added
Removed
  • guiframe/local_perspectives/plotting/boxSlicer.py

    rd054809 rd5a792a  
    149149             
    150150            self.main_line.update() 
    151             self.left_line.update(mline= self.main_line, 
     151            self.left_line.update( 
    152152                                  xmin= self.xmin, 
    153153                                  xmax= self.xmin, 
     
    155155                                  ymax=self.ymax, 
    156156                                  translation=True) 
    157             self.right_line.update(mline= self.main_line, 
     157            self.right_line.update( 
    158158                                   xmin= self.xmax, 
    159159                                  xmax= self.xmax, 
     
    166166        if self.left_line.has_move: 
    167167            print "left has moved" 
    168             self.left_line.update(mline= self.main_line, 
    169                                   xmin= self.xmin, 
    170                                   translation=True) 
    171             self.right_line.update(mline= self.main_line, 
    172                                    xmin=-1*self.xmin, 
    173                                    translation=True) 
     168            self.left_line.update() 
     169            self.right_line.update(opline= self.left_line ) 
    174170            """ 
    175171            self.top_line.update( xmin= self.left_line.xmax ,xmax= self.right_line.xmax, 
     
    180176        if self.right_line.has_move: 
    181177            print "right has moved" 
    182             self.right_line.update(mline= self.main_line, 
    183                                   xmin= self.xmax, 
    184                                   translation=True) 
    185             self.left_line.update(mline= self.main_line, 
    186                                    xmin=-1*self.xmax, 
    187                                    translation=True) 
     178            self.right_line.update() 
     179            self.left_line.update(opline= self.right_line ) 
    188180            """ 
    189181            self.top_line.update( xmin= self.left_line.xmax ,xmax= self.right_line.xmax, 
     
    508500        self.deltay=0 
    509501         
    510         self.clickx=0 
    511         self.clicky=0 
     502        
    512503        self.clickxf=0 
    513504        self.clickyf=0 
     
    555546        return 0 
    556547     
    557     def update(self,xmin=None,xmax=None,ymin=None, ymax=None, mline=None,translation=False): 
     548    def update(self,xmin=None,xmax=None,ymin=None, ymax=None, opline=None,translation=False): 
    558549        """ 
    559550        Draw the new roughness on the graph. 
    560551        """ 
    561          
     552        if opline !=None: 
     553            self.line.set(xdata=[-1*opline.x1,-1*opline.x2], 
     554                           ydata=[-opline.y1,-opline.y2])  
     555            return 
    562556        if xmin== None: 
    563557            xmin= self.L_width 
     
    573567 
    574568        self.line.set(xdata=[self.x1,self.x2], ydata=[self.y1,self.y2])   
    575             
     569        if opline !=None: 
     570            self.line.set(xdata=[-1*self.opline.x1,-1*self.opline.x2], 
     571                           ydata=[self.opline.y1,self.opline.y2])  
     572            return 
    576573        if translation: 
    577             self.deltax= self.clickxf +self.clickx 
    578             self.deltay= self.clickyf +self.clicky 
    579             print"translation deltax deltay", self.deltax, self.deltay 
    580             self.x1=self.x1 +self.deltax 
    581             self.y1=self.y1+ self.deltay 
    582             self.x2=self.x2+ self.deltax 
    583             self.y2=self.y2+self.deltay 
     574            #if xmin !=None: 
     575            #    self.L_width=xmin 
     576            self.x1= self.mline.x1 + self.L_width*math.cos(math.pi/2 - self.mline.theta) 
     577            self.x2= self.mline.x2 + self.L_width*math.cos(math.pi/2 - self.mline.theta) 
     578            self.y1= self.mline.y1 - self.L_width*math.sin(math.pi/2 - self.mline.theta) 
     579            self.y2= self.mline.y2 - self.L_width*math.sin(math.pi/2 - self.mline.theta) 
     580             
     581            print"translation x1, x2,y1,y2",self.x1, self.x2,self.y1,self.y2 
    584582            self.line.set(xdata=[self.x1,self.x2], ydata=[self.y1,self.y2])  
    585583    def save(self, ev): 
     
    608606        self.xmin = self.save_xmin 
    609607        self.xmax = self.save_xmax 
    610         self.ymin=self.save_ymin 
    611         self.ymax=self.save_ymax 
     608        self.ymin = self.save_ymin 
     609        self.ymax = self.save_ymax 
    612610         
    613611         
     
    616614        Process move to a new position, making sure that the move is allowed. 
    617615        """ 
    618          
    619616        self.has_move=True 
     617        self.L_width=x 
     618         
     619        
    620620        self.base.base.update() 
    621621         
Note: See TracChangeset for help on using the changeset viewer.