Changeset cd68f8c in sasview for guiframe/local_perspectives
- Timestamp:
- Jan 5, 2009 10:14:54 PM (16 years ago)
- 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:
- 7ab9241
- Parents:
- 8ff3ec1
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
guiframe/local_perspectives/plotting/boxSlicer.py
r8ff3ec1 rcd68f8c 126 126 if self.left_line.has_move: 127 127 print "left has moved" 128 self.left_line.update( )129 self.right_line.update( )128 self.left_line.update(mline= self.main_line,translation=True) 129 self.right_line.update(mline= self.main_line,translation=True) 130 130 #self.right_line.update(xmin= self.left_line.x ,xmax=-1*self.left_line.x) 131 self.top_line.update( xmin= self.left_line.x ,xmax= self.right_line.x) 132 self.bottom_line.update(xmin= self.left_line.x ,xmax= self.right_line.x) 131 self.top_line.update( xmin= self.left_line.x ,xmax= self.right_line.x, 132 mline= self.main_line,translation=True) 133 self.bottom_line.update(xmin= self.left_line.x ,xmax= self.right_line.x, 134 mline= self.main_line,translation=True) 133 135 if self.right_line.has_move: 134 136 print "right has moved" 135 self.right_line.update( )136 self.left_line.update( )137 self.right_line.update(mline= self.main_line,translation=True) 138 self.left_line.update(mline= self.main_line,translation=True) 137 139 #self.left_line.update(xmin= self.right_line.x ,xmax=-1*self.right_line.x) 138 self.top_line.update( xmin= self.left_line.x ,xmax= self.right_line.x) 139 self.bottom_line.update(xmin= self.left_line.x ,xmax= self.right_line.x) 140 self.top_line.update( xmin= self.left_line.x ,xmax= self.right_line.x, 141 mline= self.main_line,translation=True) 142 self.bottom_line.update(xmin= self.left_line.x ,xmax= self.right_line.x, 143 mline= self.main_line,translation=True) 140 144 141 145 142 146 if self.bottom_line.has_move: 143 147 print "bottom has moved" 144 self.bottom_line.update() 145 self.top_line.update(y= -1*self.top_line.y) 146 self.left_line.update( ymin= self.bottom_line.y ,ymax= self.top_line.y) 147 self.right_line.update(ymin= self.bottom_line.y ,ymax= self.top_line.y) 148 self.bottom_line.update(mline= self.main_line,translation=True) 149 self.top_line.update(y= -1*self.top_line.y,translation=True) 150 self.left_line.update( ymin= self.bottom_line.y ,ymax= self.top_line.y, 151 mline= self.main_line,translation=True) 152 self.right_line.update(ymin= self.bottom_line.y ,ymax= self.top_line.y, 153 mline= self.main_line,translation=True) 148 154 149 155 if self.top_line.has_move: 150 156 print "top has moved" 151 self.top_line.update( )157 self.top_line.update(mline= self.main_line,translation=True) 152 158 #self.bottom_line.update()xmin=None, xmax=None,y=None, mline=None): 153 self.bottom_line.update(y= -1*self.top_line.y ) 154 self.left_line.update(ymin= self.bottom_line.y ,ymax= self.top_line.y) 155 self.right_line.update(ymin= self.bottom_line.y ,ymax= self.top_line.y) 159 self.bottom_line.update(y= -1*self.top_line.y,mline= self.main_line, 160 translation=True ) 161 self.left_line.update(ymin= self.bottom_line.y ,ymax= self.top_line.y, 162 mline= self.main_line,translation=True) 163 self.right_line.update(ymin= self.bottom_line.y ,ymax= self.top_line.y, 164 mline= self.main_line,translation=True) 156 165 157 166 … … 274 283 self.phi_left= self.theta_left - self.theta2 275 284 self.phi_right= self.theta_right - self.theta2 276 #print "phi left right", math.degrees(self.phi_left),math.degrees(self.phi_right)277 print "theta left right ", math.degrees(self.theta_left),math.degrees(self.theta_right)285 print "phi left right", math.degrees(self.phi_left),math.degrees(self.phi_right) 286 #print "theta left right ", math.degrees(self.theta_left),math.degrees(self.theta_right) 278 287 279 288 self.line = self.axes.plot([self.xmin,self.xmax],[self.y,self.y], … … 306 315 return 0 307 316 308 def update(self,xmin=None, xmax=None,y=None, mline=None ):317 def update(self,xmin=None, xmax=None,y=None, mline=None,translation=False): 309 318 """ 310 319 Draw the new roughness on the graph. … … 331 340 print x1,x2,y1,y2 332 341 333 else:334 self.line.set(xdata=[self.xmin,self.xmax], ydata=[self.y,self.y])342 #else: 343 # self.line.set(xdata=[self.xmin,self.xmax], ydata=[self.y,self.y]) 335 344 336 345 … … 364 373 """ 365 374 self.y=y 366 375 self.radius1= math.sqrt(math.pow(self.xmin, 2)+ math.pow(self.y, 2)) 376 self.radius2= math.sqrt(math.pow(self.xmax, 2)+ math.pow(self.y, 2)) 377 378 self.theta_right= math.atan2(self.y,self.xmin) 379 self.theta_left= math.atan2(self.y,self.xmax) 380 381 self.phi_left= self.theta_left - self.theta2 382 self.phi_right= self.theta_right - self.theta2 367 383 368 384 self.has_move=True … … 420 436 self.phi_up= self.theta_up - self.theta2 421 437 print "phi up down", math.degrees(self.phi_up),math.degrees(self.phi_down) 422 print "theta up down ", math.degrees(self.theta_up),math.degrees(self.theta_down)438 #print "theta up down ", math.degrees(self.theta_up),math.degrees(self.theta_down) 423 439 # Draw vertical line 424 440 self.line = self.axes.plot([self.x,self.x],[self.ymin,self.ymax], … … 450 466 return 0 451 467 452 def update(self,x=None,ymin=None, ymax=None, mline=None ):468 def update(self,x=None,ymin=None, ymax=None, mline=None,translation=False): 453 469 """ 454 470 Draw the new roughness on the graph. … … 461 477 self.ymax = ymax 462 478 if mline !=None: 479 463 480 self.theta2= mline.theta 464 481 delta = mline.get_delta_angle() 482 if translation: 483 delta= 0 465 484 # rotation 466 485 x1 = self.radius1 * math.cos(self.phi_down + delta) … … 472 491 self.line.set(xdata=[x1,x2], ydata=[y1,y2]) 473 492 474 else:475 self.line.set(xdata=[self.x,self.x], ydata=[self.ymin,self.ymax])493 #else: 494 # self.line.set(xdata=[self.x,self.x], ydata=[self.ymin,self.ymax]) 476 495 477 496 … … 506 525 """ 507 526 self.x = x 527 self.radius1= math.sqrt(math.pow(self.x, 2)+ math.pow(self.ymin, 2)) 528 self.radius2= math.sqrt(math.pow(self.x, 2)+ math.pow(self.ymax, 2)) 529 530 531 self.theta_down = math.atan2(self.ymin, self.x) 532 self.theta_up = math.atan2(self.ymax, self.x) 533 534 535 self.phi_down= self.theta_down - self.theta2 536 self.phi_up= self.theta_up - self.theta2 537 508 538 self.has_move=True 509 539 self.base.base.update()
Note: See TracChangeset
for help on using the changeset viewer.