CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Classes | Public Member Functions | Static Public Attributes | Private Attributes
Vispa.Gui.PortConnection.PointToPointConnection Class Reference
Inheritance diagram for Vispa.Gui.PortConnection.PointToPointConnection:
Vispa.Gui.ZoomableWidget.ZoomableWidget Vispa.Gui.Zoomable.Zoomable Vispa.Gui.PortConnection.PortConnection Vispa.Gui.PortConnection.LinearPortConnection

Classes

class  ConnectionDirection
 
class  CornerType
 
class  DrawOrientation
 

Public Member Functions

def __init__
 
def belongsToRoute
 
def betweenTwoPoints
 
def bottomRight
 
def calculateRoute
 
def connectionDirectionString
 
def cornerIsDefined
 
def cornerTypeString
 
def delete
 
def dragReferencePoint
 
def draw
 
def drawCorner
 
def drawLineSection
 
def drawSection
 
def drawStraightLine
 
def forceRouteRecalculation
 
def getCornerType
 
def getPointByDistance
 
def getPointToPointDirection
 
def getRectBetweenTwoPoints
 
def isDeletable
 
def isSelectable
 
def isSelected
 
def keyPressEvent
 
def mousePressEvent
 
def nextPointByDistance
 
def nextPointByTarget
 
def paintEvent
 
def routeChanged
 
def routeIsValid
 
def select
 
def setDeletable
 
def setDragReferencePoint
 
def setSelectable
 
def setSourceDirection
 
def setTargetDirection
 
def setType
 
def setZoom
 
def sourceDirection
 
def sourcePoint
 
def targetDirection
 
def targetPoint
 
def topLeft
 
def updateConnection
 
def updateTargetPoint
 
- Public Member Functions inherited from Vispa.Gui.ZoomableWidget.ZoomableWidget
def __init__
 
def exportImage
 
def setZoom
 
- Public Member Functions inherited from Vispa.Gui.Zoomable.Zoomable
def __init__
 
def decrementZoom
 
def incrementZoom
 
def setZoom
 
def zoom
 
def zoomFactor
 

Static Public Attributes

int CONNECTION_THICKNESS = 5
 
string CONNECTION_TYPE = "ORTHOGONAL"
 
int CONNECTOR_LENGTH = 15
 
tuple FILL_COLOR1 = QColor(155, 0, 0)
 
tuple FILL_COLOR2 = QColor(255, 0, 0)
 
 FOCUSPOLICY = Qt.ClickFocus
 
tuple SELECT_COLOR = QColor('darkblue')
 
int SELECTED_FRAME_WIDTH = 4
 

Private Attributes

 _deletableFlag
 
 _deletedFlag
 
 _dragReferencePoint
 
 _recalculateRouteFlag
 
 _route
 
 _selectableFlag
 
 _selectedFlag
 
 _sourceDirection
 
 _sourcePoint
 
 _targetDirection
 
 _targetPoint
 
 _type
 

Detailed Description

Visualizes a connection between two points.

There are several types of connections available (see setType()):
   ORTHOGONAL    - Start and end points are connected by a set of horizontal and vertical lines (default).
   STRAIGHT      - Start and end points are connected by a straight line. 
   DIAGONAL      - Start and end points are connected by a set of three diagonal lines with different angles.

Definition at line 9 of file PortConnection.py.

Constructor & Destructor Documentation

def Vispa.Gui.PortConnection.PointToPointConnection.__init__ (   self,
  workspace,
  sourcePoint,
  targetPoint 
)

Definition at line 48 of file PortConnection.py.

48 
49  def __init__(self, workspace, sourcePoint, targetPoint):
50  #logging.debug(__name__ +": __init__()")
52  self._sourceDirection = PointToPointConnection.ConnectionDirection.RIGHT
53  self._targetDirection = PointToPointConnection.ConnectionDirection.LEFT
54  self._route = None
55  self._selectableFlag = True
56  self._selectedFlag = False
57  self._deletableFlag = True
58  self._deletedFlag = False
59  self._sourcePoint = sourcePoint
60  self._targetPoint = targetPoint
61  self._dragReferencePoint = None
62 
63  ZoomableWidget.__init__(self, workspace)
64  self.setFocusPolicy(self.FOCUSPOLICY)
65  self.setType(self.CONNECTION_TYPE)
66 
67  self.updateConnection()
68 
69  # debug
70  #self.setAutoFillBackground(True)
71  #self.setPalette(QPalette(Qt.green))

Member Function Documentation

def Vispa.Gui.PortConnection.PointToPointConnection.belongsToRoute (   self,
  point 
)
Checks whether 'point' is part of the connection.

'point' has to be in coordinates of self.drawPanel.

Definition at line 225 of file PortConnection.py.

References Vispa.Gui.PortConnection.PointToPointConnection._route, edm.contains(), Vispa.Gui.PortConnection.PointToPointConnection.getRectBetweenTwoPoints(), and Vispa.Gui.PortConnection.PointToPointConnection.routeIsValid().

Referenced by Vispa.Gui.PortConnection.PointToPointConnection.mousePressEvent().

226  def belongsToRoute(self, point):
227  """ Checks whether 'point' is part of the connection.
228 
229  'point' has to be in coordinates of self.drawPanel.
230  """
231 
232  if not self.routeIsValid():
233  return False
234 
235  lastP = None
236  for thisP in self._route:
237  if lastP != None:
238  if self.getRectBetweenTwoPoints(lastP, thisP).contains(QPointF(point)):
239  return True
240  lastP = thisP
241 
242  return False
bool contains(EventRange const &lh, EventID const &rh)
Definition: EventRange.cc:38
def Vispa.Gui.PortConnection.PointToPointConnection.betweenTwoPoints (   self,
  point,
  first,
  second 
)
Checks whether 'point' lies between 'first' and 'second'.

This function can currently (08-11-15) only deal with horizontal and vertical distances.

Definition at line 184 of file PortConnection.py.

References Vispa.Gui.PortConnection.PointToPointConnection.CONNECTION_THICKNESS, Vispa.Gui.PortConnection.PointToPointConnection.getPointToPointDirection(), and Vispa.Gui.Zoomable.Zoomable.zoomFactor().

185  def betweenTwoPoints(self, point, first, second):
186  """ Checks whether 'point' lies between 'first' and 'second'.
187 
188  This function can currently (08-11-15) only deal with horizontal and vertical distances.
189  """
190 
191  halfthick = 0.5 * self.CONNECTION_THICKNESS * self.zoomFactor()
192  direction = self.getPointToPointDirection(first, second)
193 
194  topLeft = QPointF()
195  bottomRight = QPointF()
196  if direction == self.ConnectionDirection.LEFT:
197  # horizontal, negative
198  topLeft.setX(second.x())
199  topLeft.setY(second.y() - halfthick)
200  bottomRight.setX(first.x())
201  bottomRight.setY(first.y() + halfthick)
202  elif direction == self.ConnectionDirection.RIGHT:
203  # horizontal, positive
204  topLeft.setX(first.x())
205  topLeft.setY(first.y() - halfthick)
206  bottomRight.setX(second.x())
207  bottomRight.setY(second.y() + halfthick)
208  elif direction == self.ConnectionDirection.UP:
209  # vertical, negative
210  topLeft.setX(second.x() - halfthick)
211  topLeft.setY(second.y())
212  bottomRight.setX(first.x() + halfthick)
213  bottomRight.setY(first.y())
214  elif direction == self.ConnectionDirection.UP:
215  # vertical, positive
216  topLeft.setX(first.x() - halfthick)
217  topLeft.setY(first.y())
218  bottomRight.setX(second.x() + halfthick)
219  bottomRight.setY(second.y())
220  else:
221  return False
222 
223  rect = QRectF(topLeft, bottomRight)
224  return rect.contains(QPointF(point))
def Vispa.Gui.PortConnection.PointToPointConnection.bottomRight (   self)
Places a rectangle around the route and returns the bottom-right point in parent's coordinates.

Definition at line 774 of file PortConnection.py.

References Vispa.Gui.PortConnection.PointToPointConnection._route, Vispa.Gui.PortConnection.PointToPointConnection.CONNECTION_THICKNESS, Vispa.Gui.PortConnection.PointToPointConnection.routeIsValid(), vdt.x, detailsBasic3DVector.y, and Vispa.Gui.Zoomable.Zoomable.zoomFactor().

Referenced by Vispa.Gui.PortConnection.PointToPointConnection.updateConnection().

775  def bottomRight(self):
776  """ Places a rectangle around the route and returns the bottom-right point in parent's coordinates.
777  """
778  if not self.routeIsValid():
779  return None
780  thickness = self.CONNECTION_THICKNESS * self.zoomFactor()
781  xMax = self._route[0].x()
782  yMax = self._route[0].y()
783  for point in self._route:
784  if point.x() > xMax:
785  xMax = point.x()
786  if point.y() > yMax:
787  yMax = point.y()
788 
789  return QPoint(xMax + thickness, yMax + thickness)
x
Definition: VDTMath.h:216
def Vispa.Gui.PortConnection.PointToPointConnection.calculateRoute (   self)
Calculates the route and stores all route points in internal list.

If start and end points have not changed since last last calculation, the route wont be recalculated unless forceRouteRecalculation() was called before.
If route was recalculated function returns True otherwise False.

Definition at line 289 of file PortConnection.py.

References Vispa.Gui.PortConnection.PointToPointConnection._recalculateRouteFlag, Vispa.Gui.PortConnection.PointToPointConnection._route, PGeometricDet::Item._type, python.Handle._type, HistoParams< T >._type, Vispa.Gui.PortConnection.PointToPointConnection._type, MELaserPrim._type, RPCCompDetId._type, HistoParams< TH2F >._type, TrackerGeometryCompare._type, HistoParams< TProfile2D >._type, abs, Vispa.Gui.PortConnection.PointToPointConnection.CONNECTOR_LENGTH, Vispa.Gui.PortConnection.PointToPointConnection.getPointByDistance(), Vispa.Gui.PortConnection.PointToPointConnection.nextPointByDistance(), Vispa.Gui.PortConnection.PointToPointConnection.nextPointByTarget(), Vispa.Gui.PortConnection.PointToPointConnection.sourceDirection(), Vispa.Gui.PortConnection.PointToPointConnection.sourcePoint(), Vispa.Gui.PortConnection.PointToPointConnection.targetDirection(), Vispa.Gui.PortConnection.PointToPointConnection.targetPoint(), and Vispa.Gui.Zoomable.Zoomable.zoomFactor().

Referenced by Vispa.Gui.PortConnection.PointToPointConnection.draw(), and Vispa.Gui.PortConnection.PointToPointConnection.updateConnection().

290  def calculateRoute(self):
291  """ Calculates the route and stores all route points in internal list.
292 
293  If start and end points have not changed since last last calculation, the route wont be recalculated unless forceRouteRecalculation() was called before.
294  If route was recalculated function returns True otherwise False.
295  """
296  if not self._recalculateRouteFlag and self._route != None and len(self._route) > 1:
297  if self._route[0] == self.sourcePoint() and self._route[len(self._route) - 1] == self.targetPoint():
298  # Nothing has changed, so route not recalculated
299  return False
300 
301  # Recaclucating route
302 
303  # Whenever the start directions point at each other, the connection has to go through the center of the points
304  throughCenter = False
305  rowKind = False
306  columnKind = False
307 
308  sourceDirection = self.sourceDirection()
309  targetDirection = self.targetDirection()
310 
311  if self._type == "ORTHOGONAL":
312  if sourceDirection == self.ConnectionDirection.RIGHT and targetDirection == self.ConnectionDirection.LEFT:
313  throughCenter = True
314  rowKind = True
315  elif sourceDirection == self.ConnectionDirection.LEFT and targetDirection == self.ConnectionDirection.RIGHT:
316  throughCenter = True
317  rowKind = True
318  elif sourceDirection == self.ConnectionDirection.DOWN and targetDirection == self.ConnectionDirection.UP:
319  throughCenter = True
320  columnKind = True
321  elif sourceDirection == self.ConnectionDirection.UP and targetDirection == self.ConnectionDirection.DOWN:
322  throughCenter = True
323  columnKind = True
324 
325  self._route = []
326 
327  sP = QPoint(self.sourcePoint()) # start
328  eP = QPoint(self.targetPoint()) # end
329  self._route.append(sP)
330 
331 
332  if throughCenter:
333  # ORTHOGONAL
334  centerP = (sP + eP) * 0.5
335  firstP = self.nextPointByDistance(self._route, self.CONNECTOR_LENGTH * self.zoomFactor(), sourceDirection)
336  lastP = self.getPointByDistance(eP, self.CONNECTOR_LENGTH * self.zoomFactor() , targetDirection)
337  self._route.append(firstP)
338  if rowKind:
339  #if lastP.x() - firstP.x() > self.CONNECTOR_LENGTH * self.zoomFactor() * 0.5:
340  if eP.x() - sP.x() > (self.CONNECTOR_LENGTH +1) * self.zoomFactor() * 2:
341  self._route.append(self.nextPointByTarget(self._route, centerP, self.DrawOrientation.HORIZONTAL))
342  #self._route.append(centerP)
343  self._route.append(self.nextPointByTarget(self._route, lastP, self.DrawOrientation.VERTICAL))
344  else:
345  self._route.append(self.nextPointByTarget(self._route, centerP, self.DrawOrientation.VERTICAL))
346  #self._route.append(centerP)
347  self._route.append(self.nextPointByTarget(self._route, lastP +QPoint(-self.CONNECTOR_LENGTH * self.zoomFactor(), 0), self.DrawOrientation.HORIZONTAL))
348  #self._route.append(self.nextPointByDistance(self._route, self.CONNECTOR_LENGTH * self.zoomFactor() , self.targetDirection()))
349  self._route.append(self.nextPointByTarget(self._route, lastP, self.DrawOrientation.VERTICAL))
350 
351  elif columnKind:
352  #print " columnKind"
353  route.append(self.nextPointByTarget(self._route, centerP, self.DrawOrientation.VERTICAL))
354  route.append(centerP)
355  route.append(self.nextPointByTarget(self._route, lastP, self.DrawOrientation.HORIZONTAL))
356  else:
357  logging.error("PointToPointConnection.calculateRoute() - Sorry connections going through the center have to be either rowKind or columKind.")
358 
359  self._route.append(lastP)
360  else:
361  # STRAIGHT or DIAGONAL
362  if self._type == "DIAGONAL":
363  width = abs(sP.x() - eP.x())
364  height = abs(sP.y() - eP.y())
365  if width > 0:
366  directionX = (sP.x() - eP.x()) / width
367  else:
368  directionX = 0
369  if height > 0:
370  directionY = (sP.y() - eP.y()) / height
371  else:
372  directionY = 0
373  if width > height:
374  diagonal = height / 2
375  else:
376  diagonal = width / 2
377  self._route.append(QPoint(sP.x() - directionX * diagonal, sP.y() - directionY * diagonal))
378  self._route.append(QPoint(sP.x() - directionX * (width - diagonal), sP.y() - directionY * (height - diagonal)))
379 
380  self._route.append(eP)
381  self._recalculateRouteFlag = False
382  return True
#define abs(x)
Definition: mlp_lapack.h:159
def Vispa.Gui.PortConnection.PointToPointConnection.connectionDirectionString (   self,
  dir 
)

Definition at line 160 of file PortConnection.py.

161  def connectionDirectionString(self, dir):
162  if dir == self.ConnectionDirection.DOWN:
163  return "DOWN"
164  elif dir == self.ConnectionDirection.LEFT:
165  return "LEFT"
166  elif dir == self.ConnectionDirection.RIGHT:
167  return "RIGHT"
168  elif dir == self.ConnectionDirection.UP:
169  return "UP"
170  return "UNDEFINED_DIRECTION"
def Vispa.Gui.PortConnection.PointToPointConnection.cornerIsDefined (   self,
  type 
)

Definition at line 401 of file PortConnection.py.

Referenced by Vispa.Gui.PortConnection.PointToPointConnection.getRectBetweenTwoPoints().

402  def cornerIsDefined(self, type):
403  if type == self.CornerType.TOP_RIGHT or type == self.CornerType.TOP_LEFT or type == self.CornerType.BOTTOM_LEFT or type == self.CornerType.BOTTOM_RIGHT:
404  return True
405  return False
def Vispa.Gui.PortConnection.PointToPointConnection.cornerTypeString (   self,
  type 
)

Definition at line 147 of file PortConnection.py.

148  def cornerTypeString(self, type):
149  if type == self.CornerType.TOP_RIGHT:
150  return "TOP_RIGHT"
151  elif type == self.CornerType.TOP_LEFT:
152  return "TOP_LEFT"
153  elif type == self.CornerType.BOTTOM_LEFT:
154  return "BOTTOM_LEFT"
155  elif type == self.CornerType.BOTTOM_RIGHT:
156  return "BOTTOM_RIGHT"
157  elif type == self.CornerType.STRAIGHT:
158  return "STRAIGHT"
159  return "UDEFINED_CORNER"
def Vispa.Gui.PortConnection.PointToPointConnection.delete (   self)
Deletes this connection.

Definition at line 810 of file PortConnection.py.

References Vispa.Gui.PortConnection.PointToPointConnection._deletedFlag, Vispa.Gui.ConnectableWidget.ConnectableWidget.deleteLater(), edm::ELlog4cplus.emit(), and Vispa.Gui.PortConnection.PointToPointConnection.isDeletable().

Referenced by Vispa.Gui.PortConnection.PointToPointConnection.keyPressEvent(), Vispa.Views.LineDecayView.LineDecayContainer.keyPressEvent(), and Vispa.Gui.VispaWidget.VispaWidget.keyPressEvent().

811  def delete(self):
812  """ Deletes this connection.
813  """
814  if self._deletedFlag:
815  return False
816  if not self.isDeletable():
817  return False
818  self.deleteLater()
819  self.emit(SIGNAL("connectionDeleted"))
820  return True
def Vispa.Gui.PortConnection.PointToPointConnection.dragReferencePoint (   self)

Definition at line 144 of file PortConnection.py.

References Vispa.Gui.PortConnection.PointToPointConnection._dragReferencePoint.

145  def dragReferencePoint(self):
146  return self._dragReferencePoint
def Vispa.Gui.PortConnection.PointToPointConnection.draw (   self)
Draws connection.

Definition at line 727 of file PortConnection.py.

References Vispa.Gui.PortConnection.PointToPointConnection._route, Vispa.Gui.PortConnection.PointToPointConnection._selectedFlag, Vispa.Gui.PortConnection.PointToPointConnection.calculateRoute(), Vispa.Gui.PortConnection.PointToPointConnection.drawSection(), Vispa.Gui.PortConnection.PointToPointConnection.routeIsValid(), Vispa.Gui.PortConnection.PointToPointConnection.SELECT_COLOR, Vispa.Gui.PortConnection.PointToPointConnection.SELECTED_FRAME_WIDTH, and Vispa.Gui.Zoomable.Zoomable.zoom().

Referenced by Vispa.Gui.PortConnection.PointToPointConnection.paintEvent().

728  def draw(self):
729  """ Draws connection.
730  """
731  self.calculateRoute()
732  if not self.routeIsValid():
733  return
734  painter = QPainter(self)
735  #logging.debug(self.__class__.__name__ +": draw()")
736 
737  if self._selectedFlag:
738  # Selected
739  framePen = QPen(self.SELECT_COLOR)
740  framePen.setWidth(self.SELECTED_FRAME_WIDTH)
741  else:
742  #self.select(False)
743  framePen = QPen(Qt.NoPen)
744 
745  #if hasattr(QPainter, 'Antialiasing'):
746  if self.zoom() > 30:
747  painter.setRenderHint(QPainter.Antialiasing)
748 
749 # painter.setPen(Qt.black)
750 # for thisP in self._route:
751 # painter.drawEllipse(self.mapFromParent(thisP), self.CONNECTION_THICKNESS * self.zoomFactor(), self.CONNECTION_THICKNESS* self.zoomFactor())
752 
753  painter.setPen(framePen)
754  for i in range(0, len(self._route) -1):
755  #self.drawLineSection(painter, route[i], route[i + 1], self._cornerTypes[i], self._cornerTypes[i + 1])
756  self.drawSection(painter, i)
757  #self.drawCorner(painter, route[i], self._cornerTypes[i])
def Vispa.Gui.PortConnection.PointToPointConnection.drawCorner (   self,
  painter,
  position,
  cornerType,
  maxRadius = None 
)

Definition at line 418 of file PortConnection.py.

References Vispa.Gui.PortConnection.PointToPointConnection.CONNECTION_THICKNESS, Vispa.Gui.MenuWidget.MenuWidget.FILL_COLOR1, Vispa.Gui.PortConnection.PointToPointConnection.FILL_COLOR1, Vispa.Gui.PortConnection.PointToPointConnection.FILL_COLOR2, max(), min, and Vispa.Gui.Zoomable.Zoomable.zoomFactor().

Referenced by Vispa.Gui.PortConnection.PointToPointConnection.drawSection().

419  def drawCorner(self, painter, position, cornerType, maxRadius=None):
420  #logging.debug(self.__class__.__name__ +": drawCorner() "+ self.cornerTypeString(cornerType))
421  thickness = self.CONNECTION_THICKNESS * self.zoomFactor()
422  halfthick = thickness / 2
423  cornerRoundness = halfthick ** 0.5
424  cornerOffset = halfthick * (cornerRoundness)
425  innerCorner = halfthick * (cornerRoundness - 1)
426  outerCorner = halfthick * (cornerRoundness + 1)
427  innerWidth = halfthick * (cornerRoundness - 1)
428  radius = halfthick * (cornerRoundness + 1)
429  if maxRadius:
430  maxRadius = max(maxRadius, thickness)
431  radius = min(radius, maxRadius)
432 
433  if cornerType == self.CornerType.TOP_RIGHT:
434  startAngle = 0
435 
436  outerCorner = QPointF(position.x() + halfthick - 2 * radius, position.y() - halfthick)
437  innerCorner = QPointF(outerCorner.x(), outerCorner.y() + (thickness))
438  center = QPointF(outerCorner.x() + radius, outerCorner.y() + radius)
439 
440  outerRect = QRectF(outerCorner, QSizeF(2 * radius, 2 * radius))
441  innerRect = QRectF(innerCorner, QSizeF((2 * radius - thickness), (2 * radius - thickness)))
442 
443  outerStart = QPointF(outerCorner.x() + 2 * radius, outerCorner.y() + (radius + halfthick))
444  innerStart = QPointF(outerCorner.x() + (radius - halfthick), outerCorner.y())
445 
446  elif cornerType == self.CornerType.TOP_LEFT:
447  startAngle = 90
448 
449  outerCorner = QPointF(position.x() - halfthick, position.y() - halfthick)
450  innerCorner = QPointF(outerCorner.x() + (thickness), outerCorner.y() + (thickness))
451  center = QPointF(outerCorner.x() + radius, outerCorner.y() + radius)
452 
453  outerRect = QRectF(outerCorner, QSizeF(2 * radius, 2 * radius))
454  innerRect = QRectF(innerCorner, QSizeF((2 * radius - thickness), (2 * radius - thickness)))
455 
456  outerStart = QPointF(outerCorner.x() + (radius + halfthick), outerCorner.y())
457  innerStart = QPointF(outerCorner.x(), outerCorner.y() + (radius + halfthick))
458 
459  elif cornerType == self.CornerType.BOTTOM_LEFT:
460  startAngle = 180
461 
462  outerCorner = QPointF(position.x() - halfthick, position.y() + halfthick - 2 * radius)
463  innerCorner = QPointF(outerCorner.x() + (thickness), outerCorner.y())
464  center = QPointF(outerCorner.x() + radius, outerCorner.y() + radius)
465 
466  outerRect = QRectF(outerCorner, QSizeF(2 * radius, 2 * radius))
467  innerRect = QRectF(innerCorner, QSizeF((2 * radius - thickness), (2 * radius - thickness)))
468 
469  outerStart = QPointF(outerCorner.x(), outerCorner.y() + (radius - halfthick))
470  innerStart = QPointF(outerCorner.x() + (radius + halfthick), outerCorner.y() + (2 * radius))
471 
472  elif cornerType == self.CornerType.BOTTOM_RIGHT:
473  startAngle = 270
474 
475  outerCorner = QPointF(position.x() + halfthick - 2 * radius, position.y() + halfthick - 2 * radius)
476  innerCorner = QPointF(outerCorner.x(), outerCorner.y())
477  center = QPointF(outerCorner.x() + radius, outerCorner.y() + radius)
478 
479  outerRect = QRectF(outerCorner, QSizeF(2 * radius, 2 * radius))
480  innerRect = QRectF(innerCorner, QSizeF((2 * radius - thickness), (2 * radius - thickness)))
481 
482  outerStart = QPointF(outerCorner.x() + (radius - halfthick), outerCorner.y() + 2 * radius)
483  innerStart = QPointF(outerCorner.x() + 2 * radius, outerCorner.y() + (radius - halfthick))
484 
485  else:
486  # No defined corner, so nothing to draw.
487  #print "PointToPointConnection.drawCorner() - No valid corner, aborting..."
488  return
489 
490  if painter.redirected(painter.device()):
491  # e.q. QPixmap.grabWidget()
492  painter.setBrush(self.FILL_COLOR1)
493  else:
494  brush = QRadialGradient(center, radius)
495  if radius >= thickness:
496  brush.setColorAt((radius - thickness) / radius, self.FILL_COLOR1) # inner border
497  brush.setColorAt((radius - halfthick + 1) / radius, self.FILL_COLOR2) # center of line
498  else:
499  # If zoom is too small use single color
500  brush.setColorAt(0, self.FILL_COLOR1)
501  brush.setColorAt(1, self.FILL_COLOR1) # outer border
502  painter.setBrush(brush)
503 
504  path = QPainterPath()
505  path.moveTo(outerStart)
506  path.arcTo(outerRect, startAngle, 90)
507  path.lineTo(innerStart)
508  path.arcTo(innerRect, startAngle + 90, - 90)
509  path.closeSubpath()
510 
511  #painter.setPen(Qt.NoPen)
512  painter.drawPath(path)
513 
514 
515 # # Helper lines
516 #
517 # painter.setBrush(Qt.NoBrush)
518 # painter.setPen(QPen(QColor(0,255,255)))
519 # painter.drawPath(path)
520 # painter.setPen(QPen(QColor(0,255,0)))
521 # painter.drawRect(innerRect)
522 # painter.setPen(QPen(QColor(0,0, 255)))
523 # painter.drawRect(outerRect)
524 #
525 # # Mark important points
526 # painter.setPen(QPen(QColor(0,0, 0)))
527 # painter.drawEllipse(outerCorner, 2, 2)
528 # painter.drawEllipse(innerCorner, 2, 2)
529 # painter.drawEllipse(center, 2, 2)
530 # painter.drawEllipse(outerStart, 2, 2)
531 # painter.drawEllipse(innerStart, 2, 2)
#define min(a, b)
Definition: mlp_lapack.h:161
const T & max(const T &a, const T &b)
def Vispa.Gui.PortConnection.PointToPointConnection.drawLineSection (   self,
  painter,
  firstP,
  secondP,
  firstCorner,
  secondCorner 
)

Definition at line 579 of file PortConnection.py.

References Vispa.Gui.PortConnection.PointToPointConnection.CONNECTION_THICKNESS, Vispa.Gui.MenuWidget.MenuWidget.FILL_COLOR1, Vispa.Gui.PortConnection.PointToPointConnection.FILL_COLOR1, Vispa.Gui.PortConnection.PointToPointConnection.FILL_COLOR2, Vispa.Gui.PortConnection.PointToPointConnection.getPointToPointDirection(), Vispa.Gui.PortConnection.PointToPointConnection.getRectBetweenTwoPoints(), and Vispa.Gui.Zoomable.Zoomable.zoomFactor().

580  def drawLineSection(self, painter, firstP, secondP, firstCorner, secondCorner):
581  direction = self.getPointToPointDirection(firstP, secondP)
582 
583  thickness = self.CONNECTION_THICKNESS * self.zoomFactor()
584  halfthick = thickness / 2
585  cornerRoundness = halfthick ** 0.5
586  cornerOffset = halfthick * cornerRoundness * (4 * self.zoomFactor()**2)
587  innerCorner = halfthick * (cornerRoundness + 1)
588  outerCorner = halfthick * (cornerRoundness - 1)
589 
590  rect = self.getRectBetweenTwoPoints(firstP, secondP, firstCorner, secondCorner)
591  # Paint witch color gradient (PyQt4)
592  if direction == self.ConnectionDirection.LEFT: # horizontal, negative
593  brush = QLinearGradient(rect.x(), rect.y(), rect.x(), rect.y() + halfthick)
594  elif direction == self.ConnectionDirection.RIGHT: # horizontal, positive
595  brush = QLinearGradient(rect.x(), rect.y(), rect.x(), rect.y() + halfthick)
596  elif direction == self.ConnectionDirection.UP: # vertical, negative
597  brush = QLinearGradient(rect.x(), rect.y(), rect.x() + halfthick, rect.y())
598  elif direction == self.ConnectionDirection.DOWN: # vertical, positive
599  brush = QLinearGradient(rect.x(), rect.y(), rect.x() + halfthick, rect.y())
600 
601  brush.setSpread(QLinearGradient.ReflectSpread)
602  brush.setColorAt(0, self.FILL_COLOR1)
603  brush.setColorAt(1, self.FILL_COLOR2)
604  painter.setBrush(brush)
605 
606  painter.drawRect(rect)
def Vispa.Gui.PortConnection.PointToPointConnection.drawSection (   self,
  painter,
  sectionIndex 
)
This is going to replace drawLineSection

Definition at line 607 of file PortConnection.py.

References Vispa.Gui.PortConnection.PointToPointConnection._route, abs, Vispa.Gui.PortConnection.PointToPointConnection.CONNECTION_THICKNESS, Vispa.Gui.PortConnection.PointToPointConnection.CONNECTION_TYPE, Vispa.Gui.PortConnection.PointToPointConnection.drawCorner(), Vispa.Gui.PortConnection.PointToPointConnection.drawStraightLine(), Vispa.Gui.MenuWidget.MenuWidget.FILL_COLOR1, Vispa.Gui.PortConnection.PointToPointConnection.FILL_COLOR1, Vispa.Gui.PortConnection.PointToPointConnection.FILL_COLOR2, Vispa.Gui.PortConnection.PointToPointConnection.getCornerType(), Vispa.Gui.PortConnection.PointToPointConnection.getPointToPointDirection(), Vispa.Gui.PortConnection.PointToPointConnection.getRectBetweenTwoPoints(), Vispa.Gui.PortConnection.PointToPointConnection.sourceDirection(), Vispa.Gui.PortConnection.PointToPointConnection.targetDirection(), and Vispa.Gui.Zoomable.Zoomable.zoomFactor().

Referenced by Vispa.Gui.PortConnection.PointToPointConnection.draw().

608  def drawSection(self, painter, sectionIndex):
609  """ This is going to replace drawLineSection
610  """
611  firstP = self.mapFromParent(self._route[sectionIndex])
612  secondP = self.mapFromParent(self._route[sectionIndex +1])
613  direction = self.getPointToPointDirection(firstP, secondP)
614 
615  if self.CONNECTION_TYPE!="ORTHOGONAL" or direction == self.ConnectionDirection.UNDEFINED:
616  self.drawStraightLine(painter, firstP, secondP)
617  return
618 
619  previousP = None
620  nextP = None
621  if sectionIndex == 0:
622  lastDirection = self.sourceDirection()
623  else:
624  previousP = self.mapFromParent(self._route[sectionIndex -1])
625  lastDirection = self.getPointToPointDirection(previousP, firstP)
626  if sectionIndex > len(self._route) -3:
627  nextDirection = self.targetDirection()
628  else:
629  nextP = self.mapFromParent(self._route[sectionIndex +2])
630  nextDirection = self.getPointToPointDirection(secondP, nextP)
631 
632  firstCorner = self.getCornerType(lastDirection, direction)
633  secondCorner = self.getCornerType(direction, nextDirection)
634 
635  minDist = self.CONNECTION_THICKNESS * self.zoomFactor() * 4
636  maxRadius = None
637  if previousP:
638  xDist = abs(firstP.x() - previousP.x())
639  yDist = abs(firstP.y() - previousP.y())
640  if xDist > 0 and xDist < minDist:
641  maxRadius = 0.5 * xDist
642  elif yDist > 0 and yDist < minDist:
643  maxRadius = 0.5 * yDist
644 
645  xDist = abs(firstP.x() - secondP.x())
646  yDist = abs(firstP.y() - secondP.y())
647  if xDist > 0 and xDist < minDist:
648  maxRadius = 0.5 * xDist
649  elif yDist > 0 and yDist < minDist:
650  maxRadius = 0.5 * yDist
651  #if maxRadius:
652  self.drawCorner(painter, firstP, firstCorner, maxRadius)
653 
654 # print "_____________________ darawSection _______________________"
655 # print "firstP", firstP
656 # print "secondP", secondP
657 # print "lastDirection", self.connectionDirectionString(lastDirection)
658 # print " firstCorner", self.cornerTypeString(firstCorner)
659 # print "direction", self.connectionDirectionString(direction)
660 # print " secondCorner", self.cornerTypeString(secondCorner)
661 # print "nextDirection", self.connectionDirectionString(nextDirection)
662 # print "\n\n"
663 
664  thickness = self.CONNECTION_THICKNESS * self.zoomFactor()
665  halfthick = thickness / 2
666  cornerRoundness = halfthick ** 0.5
667  cornerOffset = halfthick * cornerRoundness * (4 * self.zoomFactor()**2)
668  innerCorner = halfthick * (cornerRoundness + 1)
669  outerCorner = halfthick * (cornerRoundness - 1)
670 
671  rect = self.getRectBetweenTwoPoints(firstP, secondP, firstCorner, secondCorner)
672  # Paint witch color gradient (PyQt4)
673  if direction == self.ConnectionDirection.LEFT: # horizontal, negative
674  brush = QLinearGradient(rect.x(), rect.y(), rect.x(), rect.y() + halfthick)
675  elif direction == self.ConnectionDirection.RIGHT: # horizontal, positive
676  brush = QLinearGradient(rect.x(), rect.y(), rect.x(), rect.y() + halfthick)
677  elif direction == self.ConnectionDirection.UP: # vertical, negative
678  brush = QLinearGradient(rect.x(), rect.y(), rect.x() + halfthick, rect.y())
679  elif direction == self.ConnectionDirection.DOWN: # vertical, positive
680  brush = QLinearGradient(rect.x(), rect.y(), rect.x() + halfthick, rect.y())
681  else:
682  # Should already be drawn above --> direction == self.ConnectionDirection.UNDEFINED
683  return
684 
685  if painter.redirected(painter.device()):
686  # e.q. QPixmap.grabWidget()
687  painter.setBrush(self.FILL_COLOR1)
688  else:
689  brush.setSpread(QLinearGradient.ReflectSpread)
690  brush.setColorAt(0, self.FILL_COLOR1)
691  brush.setColorAt(1, self.FILL_COLOR2)
692  painter.setBrush(brush)
693 
694  painter.drawRect(rect)
#define abs(x)
Definition: mlp_lapack.h:159
def Vispa.Gui.PortConnection.PointToPointConnection.drawStraightLine (   self,
  painter,
  firstP,
  secondP 
)
Draw a straight line between two points.

Definition at line 695 of file PortConnection.py.

References Vispa.Gui.PortConnection.PointToPointConnection.CONNECTION_THICKNESS, Vispa.Gui.PortConnection.PointToPointConnection.FILL_COLOR2, max(), and Vispa.Gui.Zoomable.Zoomable.zoomFactor().

Referenced by Vispa.Gui.PortConnection.PointToPointConnection.drawSection().

696  def drawStraightLine(self, painter, firstP, secondP):
697  """ Draw a straight line between two points.
698  """
699  thickness = self.CONNECTION_THICKNESS * self.zoomFactor()
700  halfthick = max(0.5, thickness / 2)
701  pen = QPen(self.FILL_COLOR2, 2 * halfthick, Qt.SolidLine, Qt.RoundCap)
702  painter.setPen(pen)
703  painter.drawLine(firstP, secondP)
const T & max(const T &a, const T &b)
def Vispa.Gui.PortConnection.PointToPointConnection.forceRouteRecalculation (   self)

Definition at line 171 of file PortConnection.py.

References Vispa.Gui.PortConnection.PointToPointConnection._recalculateRouteFlag.

Referenced by Vispa.Gui.PortConnection.PointToPointConnection.setZoom().

172  def forceRouteRecalculation(self):
173  self._recalculateRouteFlag = True
def Vispa.Gui.PortConnection.PointToPointConnection.getCornerType (   self,
  lastDirection,
  thisDirection 
)

Definition at line 406 of file PortConnection.py.

Referenced by Vispa.Gui.PortConnection.PointToPointConnection.drawSection().

407  def getCornerType(self, lastDirection, thisDirection):
408  if (lastDirection == self.ConnectionDirection.UP and thisDirection == self.ConnectionDirection.RIGHT) or (lastDirection == self.ConnectionDirection.LEFT and thisDirection == self.ConnectionDirection.DOWN):
409  return self.CornerType.TOP_LEFT
410  elif (lastDirection == self.ConnectionDirection.RIGHT and thisDirection == self.ConnectionDirection.DOWN) or (lastDirection == self.ConnectionDirection.UP and thisDirection == self.ConnectionDirection.LEFT):
411  return self.CornerType.TOP_RIGHT
412  elif (lastDirection == self.ConnectionDirection.DOWN and thisDirection == self.ConnectionDirection.LEFT) or (lastDirection == self.ConnectionDirection.RIGHT and thisDirection == self.ConnectionDirection.UP):
413  return self.CornerType.BOTTOM_RIGHT
414  elif (lastDirection == self.ConnectionDirection.LEFT and thisDirection == self.ConnectionDirection.UP) or (lastDirection == self.ConnectionDirection.DOWN and thisDirection == self.ConnectionDirection.RIGHT):
415  return self.CornerType.BOTTOM_LEFT
416 
417  return self.CornerType.UNDEFINED
def Vispa.Gui.PortConnection.PointToPointConnection.getPointByDistance (   self,
  start,
  distance,
  direction 
)
Returns a point which is about 'distance' pixels remotely from 'start' in direction 'direction'.

Definition at line 243 of file PortConnection.py.

Referenced by Vispa.Gui.PortConnection.PointToPointConnection.calculateRoute(), and Vispa.Gui.PortConnection.PointToPointConnection.nextPointByDistance().

244  def getPointByDistance(self, start, distance, direction):
245  """ Returns a point which is about 'distance' pixels remotely from 'start' in direction 'direction'.
246  """
247 
248  if direction == self.ConnectionDirection.DOWN:
249  return QPoint(start.x(), start.y() + distance)
250  elif direction == self.ConnectionDirection.LEFT:
251  return QPoint(start.x() - distance, start.y())
252  elif direction == self.ConnectionDirection.RIGHT:
253  return QPoint(start.x() + distance, start.y())
254  elif direction == self.ConnectionDirection.UP:
255  return QPoint(start.x(), start.y() - distance)
256  else:
257  logging.error("PointToPointConnection.getPointByDistance() - Unknown ConnectionDirection.")
def Vispa.Gui.PortConnection.PointToPointConnection.getPointToPointDirection (   self,
  lastP,
  thisP 
)

Definition at line 383 of file PortConnection.py.

Referenced by Vispa.Gui.PortConnection.PointToPointConnection.betweenTwoPoints(), Vispa.Gui.PortConnection.PointToPointConnection.drawLineSection(), Vispa.Gui.PortConnection.PointToPointConnection.drawSection(), and Vispa.Gui.PortConnection.PointToPointConnection.getRectBetweenTwoPoints().

384  def getPointToPointDirection(self, lastP, thisP):
385 
386  if not lastP or not thisP:
387  return self.ConnectionDirection.UNDEFINED
388 
389  if lastP.y() == thisP.y(): # horizontal
390  if lastP.x() < thisP.x():
391  return self.ConnectionDirection.RIGHT
392  else:
393  return self.ConnectionDirection.LEFT
394  elif lastP.x() == thisP.x(): # vertical
395  if lastP.y() < thisP.y():
396  return self.ConnectionDirection.DOWN
397  else:
398  return self.ConnectionDirection.UP
399 
400  return self.ConnectionDirection.UNDEFINED
def Vispa.Gui.PortConnection.PointToPointConnection.getRectBetweenTwoPoints (   self,
  firstP,
  secondP,
  firstCorner = CornerType.UNDEFINED,
  secondCorner = CornerType.UNDEFINED 
)

Definition at line 532 of file PortConnection.py.

References Vispa.Gui.PortConnection.PointToPointConnection.CONNECTION_THICKNESS, Vispa.Gui.PortConnection.PointToPointConnection.cornerIsDefined(), Vispa.Gui.PortConnection.PointToPointConnection.getPointToPointDirection(), and Vispa.Gui.Zoomable.Zoomable.zoomFactor().

Referenced by Vispa.Gui.PortConnection.PointToPointConnection.belongsToRoute(), Vispa.Gui.PortConnection.PointToPointConnection.drawLineSection(), and Vispa.Gui.PortConnection.PointToPointConnection.drawSection().

533  def getRectBetweenTwoPoints(self, firstP, secondP, firstCorner=CornerType.UNDEFINED, secondCorner=CornerType.UNDEFINED):
534 
535  halfthick = 0.5 * self.CONNECTION_THICKNESS * self.zoomFactor()
536  cornerRoundness = halfthick ** 0.5
537  offset = 2*halfthick #* (cornerRoundness + 1) - 1 # -1 prevents one pixel gaps which sometimes appear at corners.
538 
539  direction = self.getPointToPointDirection(firstP, secondP)
540 
541  firstOffset = 0
542  if self.cornerIsDefined(firstCorner):
543  firstOffset = offset
544 
545  secondOffset = 0
546  if self.cornerIsDefined(secondCorner):
547  secondOffset = offset
548 
549  topLeft = QPointF()
550  bottomRight = QPointF()
551  if direction == self.ConnectionDirection.LEFT:
552  # horizontal, negative
553  topLeft.setX(secondP.x() + secondOffset)
554  topLeft.setY(secondP.y() - halfthick)
555  bottomRight.setX(firstP.x() - firstOffset + 1)
556  bottomRight.setY(firstP.y() + halfthick)
557  elif direction == self.ConnectionDirection.RIGHT:
558  # horizontal, positive
559  topLeft.setX(firstP.x() + firstOffset)
560  topLeft.setY(firstP.y() - halfthick)
561  bottomRight.setX(secondP.x() - secondOffset + 1)
562  bottomRight.setY(secondP.y() + halfthick)
563  elif direction == self.ConnectionDirection.UP:
564  # vrtical, negative
565  topLeft.setX(secondP.x() - halfthick)
566  topLeft.setY(secondP.y() + secondOffset)
567  bottomRight.setX(firstP.x() + halfthick)
568  bottomRight.setY(firstP.y() - firstOffset + 1)
569  elif direction == self.ConnectionDirection.DOWN:
570  # vertical, positive
571  topLeft.setX(firstP.x() - halfthick)
572  topLeft.setY(firstP.y() + firstOffset)
573  bottomRight.setX(secondP.x() + halfthick)
574  bottomRight.setY(secondP.y() - secondOffset + 1)
575  else:
576  return QRectF(topLeft, bottomRight)
577 
578  return QRectF(topLeft, bottomRight)
def Vispa.Gui.PortConnection.PointToPointConnection.isDeletable (   self)

Definition at line 117 of file PortConnection.py.

References Vispa.Gui.PortConnection.PointToPointConnection._deletableFlag.

Referenced by Vispa.Gui.PortConnection.PointToPointConnection.delete(), and Vispa.Gui.VispaWidget.VispaWidget.delete().

118  def isDeletable(self):
119  return bool(self._deletableFlag)
def Vispa.Gui.PortConnection.PointToPointConnection.isSelectable (   self)

Definition at line 111 of file PortConnection.py.

References Vispa.Gui.PortConnection.PointToPointConnection._selectableFlag.

Referenced by Vispa.Gui.VispaWidget.VispaWidget.isSelected(), Vispa.Gui.PortConnection.PointToPointConnection.select(), and Vispa.Gui.VispaWidget.VispaWidget.select().

112  def isSelectable(self):
113  return bool(self._selectableFlag)
def Vispa.Gui.PortConnection.PointToPointConnection.isSelected (   self)

Definition at line 120 of file PortConnection.py.

References Vispa.Gui.PortConnection.PointToPointConnection._selectedFlag.

Referenced by Vispa.Gui.VispaWidget.VispaWidget.contentRect(), Vispa.Gui.VispaWidget.VispaWidget.drawHeaderBackground(), Vispa.Views.LineDecayView.LineDecayContainer.keyPressEvent(), Vispa.Gui.ConnectableWidget.ConnectableWidget.leaveEvent(), Vispa.Gui.VispaWidget.VispaWidget.mousePressEvent(), Vispa.Gui.VispaWidget.VispaWidget.paint(), Vispa.Views.LineDecayView.ParticleWidget.paint(), Vispa.Gui.PortConnection.PointToPointConnection.select(), and Vispa.Gui.VispaWidget.VispaWidget.select().

121  def isSelected(self):
122  return self._selectedFlag
def Vispa.Gui.PortConnection.PointToPointConnection.keyPressEvent (   self,
  event 
)
Handle delete and backspace keys to delete connections.

Definition at line 802 of file PortConnection.py.

References Vispa.Gui.PortConnection.PointToPointConnection.delete(), and edm::ELlog4cplus.emit().

803  def keyPressEvent(self, event):
804  """ Handle delete and backspace keys to delete connections.
805  """
806  if event.key() == Qt.Key_Backspace or event.key() == Qt.Key_Delete:
807  #print __name__ +'.keyPressEvent', event.key()
808  self.delete()
809  self.emit(SIGNAL("deleteButtonPressed"))
def Vispa.Gui.PortConnection.PointToPointConnection.mousePressEvent (   self,
  event 
)
Selects connection if event.pos() lies within the connection's borders.

Otherwise the event is propagated to underlying widget via AnalysisDesignerWorkspace.propagateEventUnderConnectionWidget().

Definition at line 790 of file PortConnection.py.

References Vispa.Gui.PortConnection.PointToPointConnection.belongsToRoute(), python.multivaluedict.MyUserList.parent, FSimVertex.parent(), reco::PattRecoNode< Cluster >.parent(), DDI::Division.parent(), EmDQMReco::FourVectorMonitorElements.parent, graphwalker< N, E >.parent(), graphwalker< ReferenceCountingPointer, ReferenceCountingPointer >.parent(), graphwalker< DDLogicalPart, DDPosData * >.parent(), OpticalObject.parent(), DDLSAX2FileHandler.parent(), edm::DocFormatHelper.parent(), FWPSetTableManager::PSetData.parent, DDFilteredView.parent(), confdb.HLTProcess.parent, DDExpandedView.parent(), DDDivision.parent(), stor::TriggerSelector::TreeElement.parent(), DDXMLElement.parent(), argparse.HelpFormatter._Section.parent, python.rootplot.argparse.HelpFormatter._Section.parent, globcontrol.parent, TiXmlNode.parent, Vispa.Views.LineDecayView.DecayObject.parent(), FWViewContextMenuHandlerGL.select(), pf2pat::PdgIdPFCandidateSelectorDefinition.select(), pf2pat::PtMinPFCandidateSelectorDefinition.select(), pf2pat::GenericPFJetSelectorDefinition.select(), SeedConfigSelector.select(), AlignmentSeedSelector.select(), pf2pat::GenericPFCandidateSelectorDefinition.select(), ipf2pat::ObjectSelector< Selector, CollectionType >.select(), AlignmentCSCOverlapSelector.select(), CSCBeamHaloConfigSelector.select(), CSCOverlapConfigSelector.select(), AlignmentCSCBeamHaloSelector.select(), StringCutEventSelector< Object >.select(), EventSelector.select(), AlignmentTwoBodyDecayTrackSelector.select(), RPCMonitorLinkSynchro.select(), AlignmentGlobalTrackSelector.select(), CSCTrackConfigSelector.select(), pf2pat::IsolatedPFCandidateSelectorDefinition.select(), pf2pat::MuonIDPFCandidateSelectorDefinition.select(), CalibrationTrackSelector.select(), AlignmentCSCTrackSelector.select(), pf2pat::IPCutPFCandidateSelectorDefinition.select(), RawDataFEDSelector.select(), AlignmentTrackSelector.select(), SingleElementCollectionSelectorPlusEvent< InputCollection, Selector, OutputCollection, StoreContainer, RefAdder >.select(), HLTTauDQMFilter.select(), SiStripCalTrackConfigSelector.select(), SingleEleCalibSelector.select(), SingleElementCollectionSelector< InputCollection, Selector, OutputCollection, StoreContainer, RefAdder >.select(), reco::modules::MatcherBase< C1, C2, M >.select(), SingleElementCollectionRefSelector< InputType, Selector, OutputCollection, StoreContainer, RefAdder >.select(), MuonConfigSelector.select(), AlignmentMuonSelector.select(), reco::modulesNew::Matcher< C1, C2, S, D >.select(), FWModelExpressionSelector.select(), AssociatedVariableCollectionSelector< InputCollection, VarCollection, Selector, OutputCollection, StoreContainer, RefAdder >.select(), ObjectPairCollectionSelector< InputCollection, Selector, StoreContainer, RefAdder >.select(), TrackConfigSelector.select(), RecoTrackRefSelector.select(), SortCollectionSelector< InputCollection, Comparator, OutputCollection, StoreContainer, RefAdder >.select(), ora::PVectorReader.select(), pf2pat::ElectronIDPFCandidateSelectorDefinition.select(), RecoTrackSelector.select(), FWModelId.select(), reco::modules::Matcher< C1, C2, S, D, M >.select(), ora::IRelationalReader.select(), CosmicTrackingParticleSelector.select(), FWSelectionManager.select(), FWViewContextMenuHandlerBase.select(), HSCPTrackSelector.select(), CandCombinerBase< OutputCollection, CandPtr >.select(), ora::QueryableVectorReader.select(), ora::PrimitiveReader.select(), NamedCandCombinerBase.select(), StringCutsEventSelector< Object, existenceMatter >.select(), ora::OraReferenceReader.select(), ora::BlobReader.select(), ora::OraPtrReader.select(), ora::UniqueRefReader.select(), reco::PhysObjectMatcher< C1, C2, S, D, Q >.select(), ora::CArrayReader.select(), ora::InlineCArrayReader.select(), ora::ObjectReader.select(), ora::STLContainerReader.select(), ora::NamedRefReader.select(), Vispa.Gui.PortConnection.PointToPointConnection.select(), AlgoPos.select(), NamedCandCombiner< Selector, PairSelector, Cloner, Setup >.select(), MuonResidualsFitter::MuonAlignmentTreeRow.select, CandCombiner< Selector, PairSelector, Cloner, OutputCollection, Setup >.select(), SelectionStep< Object >.select(), ora::QVQueryMaker.select(), FWEventItem.select(), ora::QueryableVector< Tp >.select(), and Vispa.Gui.ConnectableWidget.ConnectableWidget.select().

791  def mousePressEvent(self, event):
792  """ Selects connection if event.pos() lies within the connection's borders.
793 
794  Otherwise the event is propagated to underlying widget via AnalysisDesignerWorkspace.propagateEventUnderConnectionWidget().
795  """
796  logging.debug(__name__ + ": mousePressEvent")
797  if self.belongsToRoute(self.mapToParent(event.pos())):
798  self.select()
799  else:
800  if not hasattr(self.parent(), "propagateEventUnderConnectionWidget") or not self.parent().propagateEventUnderConnectionWidget(self, event):
801  event.ignore()
def Vispa.Gui.PortConnection.PointToPointConnection.nextPointByDistance (   self,
  route,
  distance,
  direction 
)
Directly adds getPointByDistance() to 'route'.

Definition at line 258 of file PortConnection.py.

References Vispa.Gui.PortConnection.PointToPointConnection.getPointByDistance().

Referenced by Vispa.Gui.PortConnection.PointToPointConnection.calculateRoute().

259  def nextPointByDistance(self, route, distance, direction):
260  """ Directly adds getPointByDistance() to 'route'.
261  """
262 
263  if len(route) < 1:
264  logging.error("PointToPointConnection.nextPointByDistance() - Can not calculate next point for empty route.")
265  return
266 
267  start = route[len(route) - 1]
268  return self.getPointByDistance(start, distance, direction)
def Vispa.Gui.PortConnection.PointToPointConnection.nextPointByTarget (   self,
  route,
  target,
  orientation 
)
Adds a point to 'route', so the route approaches to the 'target' point in a specific 'orientation'.

This means that the added point and 'target' have one coordinate in common.
If 'orientation' points in horizontal direction (left or right) the x components will be equal.
If 'orientation' points in vertical direction (up or down) the y components will be equal.

Definition at line 269 of file PortConnection.py.

Referenced by Vispa.Gui.PortConnection.PointToPointConnection.calculateRoute().

270  def nextPointByTarget(self, route, target, orientation):
271  """ Adds a point to 'route', so the route approaches to the 'target' point in a specific 'orientation'.
272 
273  This means that the added point and 'target' have one coordinate in common.
274  If 'orientation' points in horizontal direction (left or right) the x components will be equal.
275  If 'orientation' points in vertical direction (up or down) the y components will be equal.
276  """
277  if len(route) < 1:
278  logging.error("PointToPointConnection.nextPointByTarget() - Can not calculate next point for empty route.")
279  return
280 
281  start = route[len(route) - 1]
282 
283  if orientation == self.DrawOrientation.HORIZONTAL:
284  return QPoint(target.x(), start.y())
285  elif orientation == self.DrawOrientation.VERTICAL:
286  return QPoint(start.x(), target.y())
287  else:
288  logging.error("PointToPointConnection.nextPointByTarget() - Unknown DrwaOrientation.")
def Vispa.Gui.PortConnection.PointToPointConnection.paintEvent (   self,
  event 
)
Handles paint events.

Definition at line 718 of file PortConnection.py.

References evf::AsciiRollingChart.draw(), FWBoxIconBase.draw(), FWCheckedTextTableCellRenderer.draw(), FWColumnLabelCellRenderer.draw(), FWCollectionSummaryModelCellRenderer.draw(), evf::AsciiHisto.draw(), FWFramedTextTableCellRenderer.draw(), FWTableCellRendererBase.draw(), FWTextTableCellRenderer.draw(), CmsShowMainBase.draw(), FWTextTreeCellRenderer.draw(), FWGeometryTableManagerBase::ColorBoxRenderer.draw(), fwlite::Event.draw(), Vispa.Gui.PortConnection.PointToPointConnection.draw(), HcalObjRepresent::ADataRepr.draw(), cond::CredentialStore.updateConnection(), and Vispa.Gui.PortConnection.PointToPointConnection.updateConnection().

719  def paintEvent(self, event):
720  """ Handles paint events.
721  """
722  if self.updateConnection():
723  event.ignore()
724  else:
725  #print "paintEvent() accept"
726  self.draw()
def Vispa.Gui.PortConnection.PointToPointConnection.routeChanged (   self)

Definition at line 79 of file PortConnection.py.

References Vispa.Gui.PortConnection.PointToPointConnection._recalculateRouteFlag.

79 
80  def routeChanged(self):
81  self._recalculateRouteFlag = True
def Vispa.Gui.PortConnection.PointToPointConnection.routeIsValid (   self)

Definition at line 174 of file PortConnection.py.

References Vispa.Gui.PortConnection.PointToPointConnection._route.

Referenced by Vispa.Gui.PortConnection.PointToPointConnection.belongsToRoute(), Vispa.Gui.PortConnection.PointToPointConnection.bottomRight(), Vispa.Gui.PortConnection.PointToPointConnection.draw(), and Vispa.Gui.PortConnection.PointToPointConnection.topLeft().

175  def routeIsValid(self):
176  try:
177  if type(self._route).__name__ != 'list':
178  logging.error("PointToPointConnection.routeIsValid() - 'route' does not contain a list an so is not a valid route.")
179  return False
180  except:
181  logging.error("PointToPointConnection.routeIsValid() - 'route' is not valid.")
182  return False
183  return True
def Vispa.Gui.PortConnection.PointToPointConnection.select (   self,
  sel = True,
  multiSelect = False 
)

Definition at line 123 of file PortConnection.py.

References Vispa.Gui.PortConnection.PointToPointConnection._selectedFlag, Vispa.Gui.PortConnection.PointToPointConnection.isSelectable(), DetIdSelector.isSelected(), FWGUISubviewArea.isSelected(), FWEventItem::ModelInfo.isSelected(), Vispa.Gui.PortConnection.PointToPointConnection.isSelected(), python.multivaluedict.MyUserList.parent, FSimVertex.parent(), reco::PattRecoNode< Cluster >.parent(), DDI::Division.parent(), EmDQMReco::FourVectorMonitorElements.parent, graphwalker< N, E >.parent(), graphwalker< ReferenceCountingPointer, ReferenceCountingPointer >.parent(), graphwalker< DDLogicalPart, DDPosData * >.parent(), OpticalObject.parent(), DDLSAX2FileHandler.parent(), edm::DocFormatHelper.parent(), FWPSetTableManager::PSetData.parent, DDFilteredView.parent(), confdb.HLTProcess.parent, DDExpandedView.parent(), DDDivision.parent(), stor::TriggerSelector::TreeElement.parent(), DDXMLElement.parent(), argparse.HelpFormatter._Section.parent, python.rootplot.argparse.HelpFormatter._Section.parent, globcontrol.parent, TiXmlNode.parent, Vispa.Views.LineDecayView.DecayObject.parent(), DDDWorldObserver< Event >.update(), SaveSimTrack.update(), PixelTrackFilter.update(), PTStatistics.update(), KillSecondariesRunAction.update(), KillSecondariesTrackAction.update(), HIPixelTrackFilter.update(), HIProtoTrackFilter.update(), KalmanAlignmentMetricsUpdator.update(), PrintTrackNumberAction.update(), GenericMVAComputerCache.update(), reco::KalmanGhostTrackUpdater.update(), DDG4ProductionCuts.update(), SimpleMetricsUpdator.update(), HICMuonUpdator.update(), MSLayersAtAngle.update(), TrajectoryStateUpdator.update(), MultiMetricsUpdator.update(), LagrangeChildUpdator.update(), DummyVertexTrackUpdator< N >.update(), FastFedCablingTask.update(), VertexTrackUpdator< N >.update(), VpspScanTask.update(), ErrorCorrelation.update(), ApvTimingTask.update(), DaqScopeModeTask.update(), FedTimingTask.update(), DummyMetricsUpdator.update(), PedestalsTask.update(), OptoScanTask.update(), GsfMultiStateUpdator.update(), MonopoleSteppingAction.update(), ApvTimingHistosUsingDb.update(), NoiseHistosUsingDb.update(), OptoScanHistosUsingDb.update(), PedestalsHistosUsingDb.update(), PedsFullNoiseHistosUsingDb.update(), PedsOnlyHistosUsingDb.update(), VpspScanHistosUsingDb.update(), CalibrationScanTask.update(), CalibrationTask.update(), LatencyTask.update(), FineDelayTask.update(), CurrentAlignmentKFUpdator.update(), RHStopTracer.update(), FastFedCablingHistosUsingDb.update(), PrintSensitive.update(), FedCablingTask.update(), SamplingHistosUsingDb.update(), TkPixelMeasurementDet.update(), PedsOnlyTask.update(), EcalUnpackerWorkerBase.update(), KFStrip1DUpdator.update(), KFStripUpdator.update(), LatencyHistosUsingDb.update(), CheckOverlap.update(), NoiseTask.update(), CalibrationHistosUsingDb.update(), KFSwitchingUpdator.update(), ChildUpdator.update(), PedsFullNoiseTask.update(), CountProcessesAction.update(), PrintGeomInfoAction.update(), PrintMaterialBudgetInfo.update(), FineDelayHistosUsingDb.update(), progressbar.Widget.update(), MeasurementTracker.update(), ora::PVectorUpdater.update(), KinematicConstrainedVertexUpdator.update(), PhysicsTools::MVAComputerCache.update(), MaterialBudgetHcal.update(), StoreSecondary.update(), BinomialProbability.update(), ESUnpackerWorker.update(), OnDemandMeasurementTracker.update(), TrackingMaterialProducer.update(), GraphPath< N, E >.update(), MuonServiceProxy.update(), EcalUnpackerWorker.update(), GflashG4Watcher.update(), MaterialBudgetForward.update(), EcalSimHitsValidProducer.update(), funct::Master< F >.update(), CheckSecondary.update(), Observer< T >.update(), KFSwitching1DUpdator.update(), pat::CandidateSummaryTable::Record.update(), Observer< const DDDWorld * >.update(), Observer< const BeginOfTrack * >.update(), Observer< const G4Step * >.update(), Observer< const EndOfRun * >.update(), Observer< const EndOfTrack * >.update(), Observer< const BeginOfJob * >.update(), Observer< const BeginOfEvent * >.update(), Observer< const EndOfEvent * >.update(), Observer< const BeginOfRun * >.update(), Observer< const Event * >.update(), Observer< const T * >.update(), KFUpdator.update(), HLTMonBTagClient.update(), KalmanVertexTrackUpdator< 5 >.update(), KalmanVertexTrackUpdator< N >.update(), HcaluLUTTPGCoder.update(), CaloTrkProcessing.update(), HcalTestAnalysis.update(), pos::PixelConfig.update(), TkStripMeasurementDet.update(), ora::IRelationalUpdater.update(), jptJetAnalysis::TrackPropagatorToCalo.update(), FWJobMetadataManager.update(), BasicMultiTrajectoryState.update(), KalmanAlignmentUserVariables.update(), TrackingVerboseAction.update(), PhysicsTools::TreeReader.update(), MaterialBudgetAction.update(), ora::QueryableVectorUpdater.update(), FiberSD.update(), SingleParticleEvent.update(), KalmanVertexUpdator< 5 >.update(), KalmanVertexUpdator< N >.update(), reco::GhostTrackFitter::PredictionUpdater.update(), SimG4HcalValidation.update(), SiStripPartition.update(), fwlite::RecordWriter.update(), KinematicConstrainedVertexUpdatorT< nTrk, nConstraint >.update(), FWParameterSetterBase.update(), simwatcher::BeginOfTrackCounter.update(), MuonTrajectoryUpdator.update(), progressbar.Timer.update(), TotemTestGem.update(), PLTSensitiveDetector.update(), DQMOldReceiver.update(), TkAccumulatingSensitiveDetector.update(), MuonUpdatorAtVertex.update(), ora::OraPtrUpdater.update(), jptJetAnalysis::StripSignalOverNoiseCalculator.update(), LaserAlignmentSimulation.update(), HcalTB02Analysis.update(), ora::PrimitiveUpdater.update(), ora::UniqueRefUpdater.update(), ora::CArrayUpdater.update(), ora::OraReferenceUpdater.update(), HcalTB06Analysis.update(), ApvAnalysisFactory.update(), BTagPerformanceAnalyzerOnData.update, TotemSD.update(), progressbar.WidgetHFill.update(), ora::ObjectUpdater.update(), HcalForwardAnalysis.update(), ora::BlobUpdater.update(), StMeasurementDetSet.update(), MuonSensitiveDetector.update(), MeasurementTrackerImpl.update(), SimTracer.update(), ora::InlineCArrayUpdater.update(), sistrip::RawToDigiUnpacker.update(), HcalTB04Analysis.update(), DTVDriftCalibration::cellInfo.update(), DTSegmentUpdator.update(), DAClusterizerInZ.update(), ora::STLContainerUpdater.update(), DynamicTruncation.update(), sim_act::Signaler< EndOfRun >.update(), sim_act::Signaler< BeginOfRun >.update(), sim_act::Signaler< EndOfEvent >.update(), sim_act::Signaler< T >.update(), sim_act::Signaler< EndOfTrack >.update(), sim_act::Signaler< BeginOfJob >.update(), sim_act::Signaler< BeginOfTrack >.update(), EcalTBH4Trigger.update(), sim_act::Signaler< BeginOfEvent >.update(), sim_act::Signaler< G4Step >.update(), sim_act::Signaler< DDDWorld >.update(), DoCastorAnalysis.update(), ora::NamedRefUpdater.update(), ZdcTestAnalysis.update(), CastorTestAnalysis.update(), CaloSD.update(), BTagPerformanceAnalyzerMC.update, BscSD.update(), edm::service::SimpleMemoryCheck.update(), PhysicsTools::MVAModuleHelper< Record, Object, Filler >::Value.update(), edm::BMixingModule.update(), ora::Container.update(), BetafuncEvtVtxGenerator.update(), PhysicsTools::TreeReader::Value.update(), progressbar.Bar.update(), FP420SD.update(), progressbar.BouncingBar.update(), HLTScalersClient::CountLSFifo_t.update(), GaussianSumUtilities1D.update(), CastorShowerLibraryMaker.update(), MonitorElement.update(), ora::Database.update(), StandAloneMuonFilter.update(), DTRecSegment2D.update(), DQMNet::Peer.update, CommissioningTask.update(), FWPSetTableManager.update(), progressbar.FormatLabel.update(), DQMNet::AutoPeer.update, G4StepStatistics.update(), FWLiteESRecordWriterAnalyzer.update(), python.seqvaluedict.seqdict.update(), FP420Test.update(), Folder.update(), BscTest.update(), TrajectoryStateOnSurface.update(), BasicTrajectoryState.update(), progressbar.ProgressBar.update(), DetSetVector< ClusterType >.update(), const_iterator.update(), DetSetVector< SiStripCluster >.update(), edmNew::DetSetVector< T >.update(), DetSetVector< SiPixelCluster >.update(), DetSetVector< T >.update(), and evf::iDie::lsStat.update().

Referenced by Vispa.Plugins.Browser.BrowserTabController.BrowserTabController.find(), Vispa.Gui.PortConnection.PointToPointConnection.mousePressEvent(), Vispa.Gui.VispaWidget.VispaWidget.mousePressEvent(), and Vispa.Views.AbstractView.AbstractView.restoreSelection().

124  def select(self, sel=True, multiSelect=False):
125  if not self.isSelectable():
126  return
127  changed = False
128  if self._selectedFlag != sel:
129  changed = True
130 
131  self._selectedFlag = sel
132 
133  if self._selectedFlag:
134  self.raise_()
135 
136  if changed:
137  self.update()
138 
139  if not multiSelect and self.isSelected() and isinstance(self.parent(), VispaWidgetOwner):
140  self.parent().deselectAllWidgets(self)
def Vispa.Gui.PortConnection.PointToPointConnection.setDeletable (   self,
  sel 
)

Definition at line 114 of file PortConnection.py.

References Vispa.Gui.PortConnection.PointToPointConnection._deletableFlag.

115  def setDeletable(self, sel):
116  self._deletableFlag = sel
def Vispa.Gui.PortConnection.PointToPointConnection.setDragReferencePoint (   self,
  pos 
)

Definition at line 141 of file PortConnection.py.

References Vispa.Gui.PortConnection.PointToPointConnection._dragReferencePoint.

142  def setDragReferencePoint(self, pos):
143  self._dragReferencePoint = pos
def Vispa.Gui.PortConnection.PointToPointConnection.setSelectable (   self,
  sel 
)

Definition at line 108 of file PortConnection.py.

References Vispa.Gui.PortConnection.PointToPointConnection._selectableFlag.

109  def setSelectable(self, sel):
110  self._selectableFlag = sel
def Vispa.Gui.PortConnection.PointToPointConnection.setSourceDirection (   self,
  dir 
)

Definition at line 96 of file PortConnection.py.

References Vispa.Gui.PortConnection.PointToPointConnection._sourceDirection.

96 
97  def setSourceDirection(self, dir):
98  self._sourceDirection = dir
def Vispa.Gui.PortConnection.PointToPointConnection.setTargetDirection (   self,
  dir 
)

Definition at line 102 of file PortConnection.py.

References Vispa.Gui.PortConnection.PointToPointConnection._targetDirection.

103  def setTargetDirection(self, dir):
104  self._targetDirection = dir
def Vispa.Gui.PortConnection.PointToPointConnection.setType (   self,
  type 
)
Sets type of connection.

The type argument is a string of capitalized letters and should be one of the available types described in the class documentation.

Definition at line 72 of file PortConnection.py.

72 
73  def setType(self, type):
74  """ Sets type of connection.
75 
76  The type argument is a string of capitalized letters and should be one of the available types described in the class documentation.
77  """
78  self._type = type
def Vispa.Gui.PortConnection.PointToPointConnection.setZoom (   self,
  zoom 
)

Definition at line 82 of file PortConnection.py.

References Vispa.Gui.PortConnection.PointToPointConnection.forceRouteRecalculation().

Referenced by Vispa.Gui.Zoomable.Zoomable.decrementZoom(), Vispa.Gui.Zoomable.Zoomable.incrementZoom(), Vispa.Main.TabController.TabController.zoomAll(), Vispa.Main.TabController.TabController.zoomDialog(), Vispa.Main.TabController.TabController.zoomHundred(), and Vispa.Main.TabController.TabController.zoomUser().

82 
83  def setZoom(self, zoom):
84  ZoomableWidget.setZoom(self, zoom)
def Vispa.Gui.PortConnection.PointToPointConnection.sourceDirection (   self)

Definition at line 99 of file PortConnection.py.

References Vispa.Gui.PortConnection.PointToPointConnection._sourceDirection.

Referenced by Vispa.Gui.PortConnection.PointToPointConnection.calculateRoute(), and Vispa.Gui.PortConnection.PointToPointConnection.drawSection().

99 
100  def sourceDirection(self):
101  return self._sourceDirection
def Vispa.Gui.PortConnection.PointToPointConnection.sourcePoint (   self)

Definition at line 86 of file PortConnection.py.

References Vispa.Gui.PortConnection.PointToPointConnection._sourcePoint.

Referenced by Vispa.Gui.PortConnection.PointToPointConnection.calculateRoute().

86 
87  def sourcePoint(self):
88  return self._sourcePoint
def Vispa.Gui.PortConnection.PointToPointConnection.targetDirection (   self)

Definition at line 105 of file PortConnection.py.

References Vispa.Gui.PortConnection.PointToPointConnection._targetDirection.

Referenced by Vispa.Gui.PortConnection.PointToPointConnection.calculateRoute(), and Vispa.Gui.PortConnection.PointToPointConnection.drawSection().

106  def targetDirection(self):
107  return self._targetDirection
def Vispa.Gui.PortConnection.PointToPointConnection.targetPoint (   self)

Definition at line 89 of file PortConnection.py.

References Vispa.Gui.PortConnection.PointToPointConnection._targetPoint.

Referenced by Vispa.Gui.PortConnection.PointToPointConnection.calculateRoute().

89 
90  def targetPoint(self):
91  return self._targetPoint
def Vispa.Gui.PortConnection.PointToPointConnection.topLeft (   self)
Places a rect around the route and returns the top-left point in parent's coordinates.

Definition at line 758 of file PortConnection.py.

References Vispa.Gui.PortConnection.PointToPointConnection._route, Vispa.Gui.PortConnection.PointToPointConnection.CONNECTION_THICKNESS, Vispa.Gui.PortConnection.PointToPointConnection.routeIsValid(), vdt.x, detailsBasic3DVector.y, and Vispa.Gui.Zoomable.Zoomable.zoomFactor().

Referenced by Vispa.Gui.PortConnection.PointToPointConnection.updateConnection().

759  def topLeft(self):
760  """ Places a rect around the route and returns the top-left point in parent's coordinates.
761  """
762  if not self.routeIsValid():
763  return None
764  thickness = self.CONNECTION_THICKNESS * self.zoomFactor()
765  xMin = self._route[0].x()
766  yMin = self._route[0].y()
767  for point in self._route:
768  if point.x() < xMin:
769  xMin = point.x()
770  if point.y() < yMin:
771  yMin = point.y()
772 
773  return QPoint(xMin - thickness, yMin - thickness)
x
Definition: VDTMath.h:216
def Vispa.Gui.PortConnection.PointToPointConnection.updateConnection (   self)
Recalculates route and then positions and sizes the widget accordingly.

Definition at line 704 of file PortConnection.py.

References Vispa.Gui.PortConnection.PointToPointConnection.bottomRight(), Vispa.Gui.PortConnection.PointToPointConnection.calculateRoute(), AlignableDetUnit.move(), AlignableBeamSpot.move(), AlignableComposite.move(), CaloGeometryHelper.move(), PFRecHitProducerHO.move(), PFRecHitProducerECAL.move(), Alignable.move(), GeomDet.move(), GloballyPositioned< T >.move(), GloballyPositioned< float >.move(), GloballyPositioned< align::Scalar >.move(), Vispa.Gui.ConnectableWidget.ConnectableWidget.move(), Vispa.Views.LineDecayView.DecayObject.move(), Vispa.Views.LineDecayView.DecayNode.move(), Vispa.Gui.VispaWidget.VispaWidget.move(), Vispa.Views.LineDecayView.DecayLine.move(), EZMgrVL< T >.resize(), LocalCacheFile.resize(), EZMgrFL< EEDetId >.resize(), EZMgrFL< EBDetId >.resize(), EZMgrFL< T >.resize(), Storage.resize(), StorageAccountProxy.resize(), LStoreFile.resize(), DCacheFile.resize(), RFIOFile.resize(), EZArrayVL< T >.resize(), XrdFile.resize(), lhef::HEPRUP.resize(), File.resize(), FEDRawData.resize(), EZArrayFL< GlobalPoint >.resize(), EZArrayFL< T >.resize(), edm::DataFrameContainer.resize(), L1GctProcessor::Pipeline< T >.resize(), ora::PVector< Tp >.resize(), PVector< Tp >.resize(), reco::FlavorHistoryEvent.resize(), L1GtfeExtWord.resize(), edmNew::DetSetVector< T >::FastFiller.resize(), lhef::HEPEUP.resize(), edmNew::DetSetVector< T >.resize(), const_iterator.resize(), DetSetVector< SiStripCluster >.resize(), DetSetVector< SiPixelCluster >.resize(), DetSetVector< ClusterType >.resize(), DetSetVector< T >.resize(), ora::QueryableVector< Tp >.resize(), ora::QueryableVector< Item >.resize(), QueryableVector< Tp >.resize(), Vispa.Gui.VispaWidget.VispaWidget.resize(), Vispa.Gui.PortConnection.PointToPointConnection.topLeft(), DDDWorldObserver< Event >.update(), PixelTrackFilter.update(), SaveSimTrack.update(), PTStatistics.update(), HIPixelTrackFilter.update(), KillSecondariesRunAction.update(), KillSecondariesTrackAction.update(), HIProtoTrackFilter.update(), GenericMVAComputerCache.update(), reco::KalmanGhostTrackUpdater.update(), PrintTrackNumberAction.update(), KalmanAlignmentMetricsUpdator.update(), SimpleMetricsUpdator.update(), HICMuonUpdator.update(), MSLayersAtAngle.update(), DDG4ProductionCuts.update(), MultiMetricsUpdator.update(), LagrangeChildUpdator.update(), VertexTrackUpdator< N >.update(), DummyVertexTrackUpdator< N >.update(), FastFedCablingTask.update(), TrajectoryStateUpdator.update(), ApvTimingTask.update(), DaqScopeModeTask.update(), FedTimingTask.update(), ErrorCorrelation.update(), VpspScanTask.update(), GsfMultiStateUpdator.update(), OptoScanTask.update(), PedestalsTask.update(), DummyMetricsUpdator.update(), ApvTimingHistosUsingDb.update(), NoiseHistosUsingDb.update(), OptoScanHistosUsingDb.update(), PedestalsHistosUsingDb.update(), PedsFullNoiseHistosUsingDb.update(), PedsOnlyHistosUsingDb.update(), MonopoleSteppingAction.update(), VpspScanHistosUsingDb.update(), CalibrationScanTask.update(), CalibrationTask.update(), FineDelayTask.update(), LatencyTask.update(), RHStopTracer.update(), CurrentAlignmentKFUpdator.update(), FastFedCablingHistosUsingDb.update(), FedCablingTask.update(), PrintSensitive.update(), TkPixelMeasurementDet.update(), SamplingHistosUsingDb.update(), KFStrip1DUpdator.update(), LatencyHistosUsingDb.update(), KFStripUpdator.update(), NoiseTask.update(), PedsOnlyTask.update(), CheckOverlap.update(), EcalUnpackerWorkerBase.update(), CalibrationHistosUsingDb.update(), ChildUpdator.update(), KFSwitchingUpdator.update(), FineDelayHistosUsingDb.update(), CountProcessesAction.update(), PrintGeomInfoAction.update(), PrintMaterialBudgetInfo.update(), progressbar.Widget.update(), PedsFullNoiseTask.update(), MeasurementTracker.update(), ora::PVectorUpdater.update(), KinematicConstrainedVertexUpdator.update(), PhysicsTools::MVAComputerCache.update(), MaterialBudgetHcal.update(), ESUnpackerWorker.update(), BinomialProbability.update(), OnDemandMeasurementTracker.update(), StoreSecondary.update(), TrackingMaterialProducer.update(), MuonServiceProxy.update(), GraphPath< N, E >.update(), funct::Master< F >.update(), EcalSimHitsValidProducer.update(), GflashG4Watcher.update(), MaterialBudgetForward.update(), EcalUnpackerWorker.update(), pat::CandidateSummaryTable::Record.update(), KFSwitching1DUpdator.update(), Observer< const Event * >.update(), Observer< const T * >.update(), Observer< const BeginOfEvent * >.update(), Observer< const EndOfEvent * >.update(), CheckSecondary.update(), Observer< T >.update(), Observer< const BeginOfRun * >.update(), Observer< const DDDWorld * >.update(), Observer< const BeginOfTrack * >.update(), Observer< const G4Step * >.update(), Observer< const EndOfRun * >.update(), Observer< const EndOfTrack * >.update(), Observer< const BeginOfJob * >.update(), KalmanVertexTrackUpdator< N >.update(), KalmanVertexTrackUpdator< 5 >.update(), HLTMonBTagClient.update(), KFUpdator.update(), HcaluLUTTPGCoder.update(), CaloTrkProcessing.update(), HcalTestAnalysis.update(), pos::PixelConfig.update(), TkStripMeasurementDet.update(), jptJetAnalysis::TrackPropagatorToCalo.update(), ora::IRelationalUpdater.update(), FWJobMetadataManager.update(), KalmanAlignmentUserVariables.update(), BasicMultiTrajectoryState.update(), PhysicsTools::TreeReader.update(), TrackingVerboseAction.update(), MaterialBudgetAction.update(), SingleParticleEvent.update(), KalmanVertexUpdator< 5 >.update(), reco::GhostTrackFitter::PredictionUpdater.update(), KalmanVertexUpdator< N >.update(), FiberSD.update(), ora::QueryableVectorUpdater.update(), SimG4HcalValidation.update(), SiStripPartition.update(), fwlite::RecordWriter.update(), KinematicConstrainedVertexUpdatorT< nTrk, nConstraint >.update(), FWParameterSetterBase.update(), MuonTrajectoryUpdator.update(), simwatcher::BeginOfTrackCounter.update(), progressbar.Timer.update(), TotemTestGem.update(), PLTSensitiveDetector.update(), DQMOldReceiver.update(), TkAccumulatingSensitiveDetector.update(), MuonUpdatorAtVertex.update(), ora::OraPtrUpdater.update(), LaserAlignmentSimulation.update(), jptJetAnalysis::StripSignalOverNoiseCalculator.update(), HcalTB02Analysis.update(), ora::PrimitiveUpdater.update(), ora::UniqueRefUpdater.update(), ora::CArrayUpdater.update(), ora::OraReferenceUpdater.update(), ApvAnalysisFactory.update(), HcalTB06Analysis.update(), BTagPerformanceAnalyzerOnData.update, ora::ObjectUpdater.update(), TotemSD.update(), progressbar.WidgetHFill.update(), MeasurementTrackerImpl.update(), ora::BlobUpdater.update(), HcalForwardAnalysis.update(), StMeasurementDetSet.update(), MuonSensitiveDetector.update(), ora::InlineCArrayUpdater.update(), SimTracer.update(), sistrip::RawToDigiUnpacker.update(), HcalTB04Analysis.update(), DAClusterizerInZ.update(), DTSegmentUpdator.update(), DTVDriftCalibration::cellInfo.update(), ora::STLContainerUpdater.update(), DynamicTruncation.update(), sim_act::Signaler< G4Step >.update(), sim_act::Signaler< T >.update(), sim_act::Signaler< DDDWorld >.update(), sim_act::Signaler< EndOfTrack >.update(), sim_act::Signaler< BeginOfTrack >.update(), sim_act::Signaler< EndOfEvent >.update(), sim_act::Signaler< EndOfRun >.update(), sim_act::Signaler< BeginOfRun >.update(), EcalTBH4Trigger.update(), sim_act::Signaler< BeginOfEvent >.update(), sim_act::Signaler< BeginOfJob >.update(), DoCastorAnalysis.update(), ora::NamedRefUpdater.update(), ZdcTestAnalysis.update(), CastorTestAnalysis.update(), CaloSD.update(), BTagPerformanceAnalyzerMC.update, BscSD.update(), edm::service::SimpleMemoryCheck.update(), PhysicsTools::MVAModuleHelper< Record, Object, Filler >::Value.update(), edm::BMixingModule.update(), ora::Container.update(), BetafuncEvtVtxGenerator.update(), PhysicsTools::TreeReader::Value.update(), progressbar.Bar.update(), FP420SD.update(), progressbar.BouncingBar.update(), GaussianSumUtilities1D.update(), HLTScalersClient::CountLSFifo_t.update(), CastorShowerLibraryMaker.update(), MonitorElement.update(), ora::Database.update(), StandAloneMuonFilter.update(), DTRecSegment2D.update(), DQMNet::Peer.update, FWPSetTableManager.update(), CommissioningTask.update(), progressbar.FormatLabel.update(), DQMNet::AutoPeer.update, G4StepStatistics.update(), FWLiteESRecordWriterAnalyzer.update(), python.seqvaluedict.seqdict.update(), FP420Test.update(), Folder.update(), BscTest.update(), TrajectoryStateOnSurface.update(), BasicTrajectoryState.update(), progressbar.ProgressBar.update(), DetSetVector< SiPixelCluster >.update(), DetSetVector< SiStripCluster >.update(), edmNew::DetSetVector< T >.update(), DetSetVector< ClusterType >.update(), DetSetVector< T >.update(), const_iterator.update(), and evf::iDie::lsStat.update().

Referenced by Vispa.Gui.PortConnection.PointToPointConnection.paintEvent(), and Vispa.Gui.PortConnection.PointToPointConnection.updateTargetPoint().

705  def updateConnection(self):
706  """ Recalculates route and then positions and sizes the widget accordingly.
707  """
708  #logging.debug(self.__class__.__name__ +": updateConnection()")
709  #print " sourcePoint, targetPoint", self.sourcePoint(), self.targetPoint()
710  if self.calculateRoute():
711  tl = self.topLeft()
712  br = self.bottomRight()
713  self.move(tl)
714  self.resize(br.x() - tl.x(), br.y() - tl.y())
715  self.update()
716  return True
717  return False
def Vispa.Gui.PortConnection.PointToPointConnection.updateTargetPoint (   self,
  point 
)

Definition at line 92 of file PortConnection.py.

References Vispa.Gui.PortConnection.PointToPointConnection._targetPoint, cond::CredentialStore.updateConnection(), and Vispa.Gui.PortConnection.PointToPointConnection.updateConnection().

92 
93  def updateTargetPoint(self, point):
94  self._targetPoint = point
95  self.updateConnection()

Member Data Documentation

Vispa.Gui.PortConnection.PointToPointConnection._deletableFlag
private

Definition at line 56 of file PortConnection.py.

Referenced by Vispa.Gui.PortConnection.PointToPointConnection.isDeletable(), Vispa.Gui.VispaWidget.VispaWidget.isDeletable(), Vispa.Gui.PortConnection.PointToPointConnection.setDeletable(), and Vispa.Gui.VispaWidget.VispaWidget.setDeletable().

Vispa.Gui.PortConnection.PointToPointConnection._deletedFlag
private

Definition at line 57 of file PortConnection.py.

Referenced by Vispa.Gui.PortConnection.PointToPointConnection.delete().

Vispa.Gui.PortConnection.PointToPointConnection._dragReferencePoint
private

Definition at line 60 of file PortConnection.py.

Referenced by Vispa.Gui.PortConnection.PointToPointConnection.dragReferencePoint(), and Vispa.Gui.PortConnection.PointToPointConnection.setDragReferencePoint().

Vispa.Gui.PortConnection.PointToPointConnection._recalculateRouteFlag
private

Definition at line 50 of file PortConnection.py.

Referenced by Vispa.Gui.PortConnection.PointToPointConnection.calculateRoute(), Vispa.Gui.PortConnection.PointToPointConnection.forceRouteRecalculation(), and Vispa.Gui.PortConnection.PointToPointConnection.routeChanged().

Vispa.Gui.PortConnection.PointToPointConnection._route
private

Definition at line 53 of file PortConnection.py.

Referenced by Vispa.Gui.PortConnection.PointToPointConnection.belongsToRoute(), Vispa.Gui.PortConnection.PointToPointConnection.bottomRight(), Vispa.Gui.PortConnection.PointToPointConnection.calculateRoute(), Vispa.Gui.PortConnection.PointToPointConnection.draw(), Vispa.Gui.PortConnection.PointToPointConnection.drawSection(), Vispa.Gui.PortConnection.PointToPointConnection.routeIsValid(), and Vispa.Gui.PortConnection.PointToPointConnection.topLeft().

Vispa.Gui.PortConnection.PointToPointConnection._selectableFlag
private

Definition at line 54 of file PortConnection.py.

Referenced by Vispa.Gui.PortConnection.PointToPointConnection.isSelectable(), Vispa.Gui.VispaWidget.VispaWidget.isSelectable(), Vispa.Gui.PortConnection.PointToPointConnection.setSelectable(), and Vispa.Gui.VispaWidget.VispaWidget.setSelectable().

Vispa.Gui.PortConnection.PointToPointConnection._selectedFlag
private

Definition at line 55 of file PortConnection.py.

Referenced by Vispa.Gui.PortConnection.PointToPointConnection.draw(), Vispa.Gui.PortConnection.PointToPointConnection.isSelected(), Vispa.Gui.VispaWidget.VispaWidget.isSelected(), Vispa.Gui.PortConnection.PointToPointConnection.select(), and Vispa.Gui.VispaWidget.VispaWidget.select().

Vispa.Gui.PortConnection.PointToPointConnection._sourceDirection
private

Definition at line 51 of file PortConnection.py.

Referenced by Vispa.Gui.PortConnection.PointToPointConnection.setSourceDirection(), and Vispa.Gui.PortConnection.PointToPointConnection.sourceDirection().

Vispa.Gui.PortConnection.PointToPointConnection._sourcePoint
private

Definition at line 58 of file PortConnection.py.

Referenced by Vispa.Gui.PortConnection.PointToPointConnection.sourcePoint().

Vispa.Gui.PortConnection.PointToPointConnection._targetDirection
private

Definition at line 52 of file PortConnection.py.

Referenced by Vispa.Gui.PortConnection.PointToPointConnection.setTargetDirection(), and Vispa.Gui.PortConnection.PointToPointConnection.targetDirection().

Vispa.Gui.PortConnection.PointToPointConnection._targetPoint
private

Definition at line 59 of file PortConnection.py.

Referenced by Vispa.Gui.PortConnection.PointToPointConnection.targetPoint(), and Vispa.Gui.PortConnection.PointToPointConnection.updateTargetPoint().

Vispa.Gui.PortConnection.PointToPointConnection._type
private

Definition at line 77 of file PortConnection.py.

Referenced by Vispa.Gui.PortConnection.PointToPointConnection.calculateRoute(), and SequenceTypes.ExpandVisitor.result().

int Vispa.Gui.PortConnection.PointToPointConnection.CONNECTION_THICKNESS = 5
static

Definition at line 18 of file PortConnection.py.

Referenced by Vispa.Gui.PortConnection.PointToPointConnection.betweenTwoPoints(), Vispa.Gui.PortConnection.PointToPointConnection.bottomRight(), Vispa.Gui.PortConnection.PointToPointConnection.drawCorner(), Vispa.Gui.PortConnection.PointToPointConnection.drawLineSection(), Vispa.Gui.PortConnection.PointToPointConnection.drawSection(), Vispa.Gui.PortConnection.PointToPointConnection.drawStraightLine(), Vispa.Gui.PortConnection.PointToPointConnection.getRectBetweenTwoPoints(), and Vispa.Gui.PortConnection.PointToPointConnection.topLeft().

string Vispa.Gui.PortConnection.PointToPointConnection.CONNECTION_TYPE = "ORTHOGONAL"
static

Definition at line 27 of file PortConnection.py.

Referenced by Vispa.Gui.PortConnection.PointToPointConnection.drawSection().

int Vispa.Gui.PortConnection.PointToPointConnection.CONNECTOR_LENGTH = 15
static

Definition at line 17 of file PortConnection.py.

Referenced by Vispa.Gui.PortConnection.PointToPointConnection.calculateRoute().

tuple Vispa.Gui.PortConnection.PointToPointConnection.FILL_COLOR1 = QColor(155, 0, 0)
static

Definition at line 19 of file PortConnection.py.

Referenced by Vispa.Gui.PortConnection.PointToPointConnection.drawCorner(), Vispa.Gui.PortConnection.PointToPointConnection.drawLineSection(), Vispa.Gui.PortConnection.PointToPointConnection.drawSection(), and Vispa.Gui.WidgetContainer.WidgetContainer.toggleCollapse().

tuple Vispa.Gui.PortConnection.PointToPointConnection.FILL_COLOR2 = QColor(255, 0, 0)
static

Definition at line 20 of file PortConnection.py.

Referenced by Vispa.Gui.PortConnection.PointToPointConnection.drawCorner(), Vispa.Gui.PortConnection.PointToPointConnection.drawLineSection(), Vispa.Gui.PortConnection.PointToPointConnection.drawSection(), Vispa.Gui.PortConnection.PointToPointConnection.drawStraightLine(), and Vispa.Gui.WidgetContainer.WidgetContainer.toggleCollapse().

Vispa.Gui.PortConnection.PointToPointConnection.FOCUSPOLICY = Qt.ClickFocus
static

Definition at line 25 of file PortConnection.py.

Referenced by Vispa.Gui.VispaWidget.VispaWidget.setSelectable().

tuple Vispa.Gui.PortConnection.PointToPointConnection.SELECT_COLOR = QColor('darkblue')
static

Definition at line 22 of file PortConnection.py.

Referenced by Vispa.Gui.PortConnection.PointToPointConnection.draw(), and Vispa.Gui.VispaWidget.VispaWidget.paint().

int Vispa.Gui.PortConnection.PointToPointConnection.SELECTED_FRAME_WIDTH = 4
static

Definition at line 23 of file PortConnection.py.

Referenced by Vispa.Gui.VispaWidget.VispaWidget.contentRect(), Vispa.Gui.PortConnection.PointToPointConnection.draw(), Vispa.Gui.VispaWidget.VispaWidget.drawHeaderBackground(), and Vispa.Gui.VispaWidget.VispaWidget.paint().