Changeset 7892:493bdde7c3b4 in orange
 Timestamp:
 05/05/11 13:46:36 (3 years ago)
 Branch:
 default
 Children:
 7893:faf89837aa9b, 8263:878dcb566cce
 Convert:
 31f607ab996d371dfad949ee812680360c54461d
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

orange/OrangeWidgets/Unsupervised/OWNetworkCanvas.py
r7178 r7892 231 231 self.labelsOnMarkedOnly = 0 232 232 self.enableWheelZoom = 1 233 self.smoothOptimization = 0234 233 self.optimizing = 0 235 234 self.stopOptimizing = 0 … … 495 494 self.showTip(event.pos().x(), event.pos().y(), str(dst)) 496 495 self.replot() 497 498 if self.smoothOptimization:499 px = self.invTransform(2, event.x())500 py = self.invTransform(0, event.y())501 ndx, mind = self.visualizer.closestVertex(px, py)502 dX = self.transform(QwtPlot.xBottom, self.visualizer.graph.coors[0][ndx])  event.x()503 dY = self.transform(QwtPlot.yLeft, self.visualizer.graph.coors[1][ndx])  event.y()504 # transform to pixel distance505 distance = math.sqrt(dX**2 + dY**2)506 if ndx != 1 and distance <= self.vertices[ndx].size / 2:507 if not self.optimizing:508 self.optimizing = 1509 initTemp = 1000510 coolFactor = exp(log(10.0 / 10000.0) / 500)511 512 for i in range(10):513 if self.stopOptimizing:514 self.stopOptimizing = 0515 break516 initTemp = self.visualizer.smoothFruchtermanReingold(ndx, 50, initTemp, coolFactor)517 qApp.processEvents()518 self.updateData()519 self.replot()520 521 self.optimizing = 0522 else:523 self.stopOptimizing = 1524 496 525 497 def mousePressEvent(self, event):
Note: See TracChangeset
for help on using the changeset viewer.