CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
Vispa.Views.LineDecayView.DecayLine Class Reference
Inheritance diagram for Vispa.Views.LineDecayView.DecayLine:
Vispa.Views.LineDecayView.DecayObject Vispa.Gui.Zoomable.Zoomable

Public Member Functions

def __init__ (self, parent, startPointOrNode, endPointOrNode)
 
def arrowBoundingRect (self, forceRecalculation=False)
 
def boundingRect (self)
 
def containsPoint (self, pos)
 
def dataAccessor (self)
 
def daughterNode (self)
 
def delete (self)
 
def drawArrow (self, painter, paintMode=0x0)
 
def drawText (self, painter, paintMode=0x0)
 
def extendedSize (self)
 
def labelBoundingRect (self, forceRecalculation=False)
 
def length (self, zoomed=False)
 
def lineWidth (self)
 
def motherNode (self)
 
def move (self, pos)
 
def nodeType (self, node)
 
def object (self)
 
def paint (self, painter, paintMode=0x0)
 
def qtLineStyle (self)
 
def replaceNode (self, oldNode, newNode)
 
def select (self, pos=None, selected=True)
 
def setColor (self, color)
 
def setLabel (self, label)
 
def setLineStyle (self, style)
 
def setObject (self, object)
 
def setShowLabel (self, show)
 
def setZoom (self, zoom)
 
def slope (self)
 
def transform (self)
 
- Public Member Functions inherited from Vispa.Views.LineDecayView.DecayObject
def __init__ (self, parent=None)
 
def boundingRect (self)
 
def containsAreaSquareRect (self, position)
 
def containsPoint (self, pos)
 
def delete (self)
 
def move (self, pos)
 
def object (self)
 
def paint (self, painter, paintMode=0x0)
 
def parent (self)
 
def select (self, pos=None, selected=True)
 
- Public Member Functions inherited from Vispa.Gui.Zoomable.Zoomable
def __init__ (self)
 
def decrementZoom (self)
 
def incrementZoom (self)
 
def setZoom (self, zoom)
 
def zoom (self)
 
def zoomFactor (self)
 

Private Attributes

 _arrowBoundingRect
 
 _boundingRect
 
 _color
 
 _endNode
 
 _forwardDirection
 
 _label
 
 _labelBoundingRect
 
 _labelFont
 
 _labelMatrix
 
 _lineStyle
 l = (n + 1/2) * r * 2 * math.pi More...
 
 _pxlObject
 
 _recalculateBoundingRect
 
 _recalculateTransform
 
 _selfContained
 
 _showLabel
 
 _startNode
 
 _transform
 

Detailed Description

Definition at line 1186 of file LineDecayView.py.

Constructor & Destructor Documentation

def Vispa.Views.LineDecayView.DecayLine.__init__ (   self,
  parent,
  startPointOrNode,
  endPointOrNode 
)

Definition at line 1198 of file LineDecayView.py.

1198  def __init__(self, parent, startPointOrNode, endPointOrNode):
1199  self._color = QColor(176, 179, 177)
1200  self._lineStyle = Qt.SolidLine
1201  self._label = None
1202  self._labelFont = None
1203  self._showLabel = True
1204  self._labelMatrix = None
1207  self._boundingRect = None
1209  self._forwardDirection = True
1211  self._transform = None
1212  self._pxlObject = None
1213 
1214  DecayObject.__init__(self, parent)
1215 
1216  if isinstance(parent, LineDecayContainer):
1217  self._selfContained = False
1218  if isinstance(startPointOrNode, QPoint):
1219  # startPoint
1220  self._startNode = parent.addDecayNode(startPointOrNode)
1221  else:
1222  # startNode
1223  self._startNode = startPointOrNode
1224  if isinstance(endPointOrNode, QPoint):
1225  # endPoint
1226  self._endNode = parent.addDecayNode(endPointOrNode)
1227  else:
1228  # endNode
1229  self._endNode = endPointOrNode
1230  else:
1231  # make it possible to use DecayLine outside LineDecayContainer
1232  self._selfContained = True
1233  self._startNode = DecayNode(parent, startPointOrNode)
1234  self._endNode = DecayNode(parent, endPointOrNode)
1235 
1236  self._startNode.appendObject(self)
1237  self._endNode.appendObject(self)
1238 
_lineStyle
l = (n + 1/2) * r * 2 * math.pi
def __init__(self, parent, startPointOrNode, endPointOrNode)

Member Function Documentation

def Vispa.Views.LineDecayView.DecayLine.arrowBoundingRect (   self,
  forceRecalculation = False 
)

Definition at line 1513 of file LineDecayView.py.

References Vispa.Views.LineDecayView.DecayLine._arrowBoundingRect, Vispa.Views.LineDecayView.DecayLine._forwardDirection, TmModule.length, OpenBounds.length(), SimpleDiskBounds.length(), Phase2Tracker::Phase2TrackerFEDChannel.length(), RectangularPlaneBounds.length(), GeneralNSurfaceDelimitedBounds.length(), SimpleCylinderBounds.length(), OOTPileupCorrectionBuffer.length(), FFTJetCorrectorParameters.length(), Bounds.length(), RecoProducerFP420.length, TrapezoidalPlaneBounds.length(), sistrip::DetSetVectorFiller< T, dsvIsSparse >::ChannelRegistryItem.length, AlignableSurface.length(), SimpleConeBounds.length(), CaloSegment.length(), l1t::rctDataBase.length, Phase2Tracker::Phase2TrackerDigiProducer::Registry.length, FEDHeader.length, FEDTrailer.length, sistrip::RawToDigiUnpacker::Registry.length, SiStripModule.length(), sistrip::FEDChannel.length(), Vispa.Views.LineDecayView.DecayLine.length(), and Vispa.Gui.Zoomable.Zoomable.zoomFactor().

Referenced by Vispa.Views.LineDecayView.DecayLine.boundingRect(), and Vispa.Views.LineDecayView.DecayLine.drawArrow().

1513  def arrowBoundingRect(self, forceRecalculation=False):
1514  if not self._arrowBoundingRect or forceRecalculation:
1515  zoomFactor = self.zoomFactor()
1516  l = self.length(zoomed = True)
1517  arrowLength = self.ARROW_LENGTH * zoomFactor
1518  arrowWidth = self.ARROW_WIDTH * zoomFactor
1519  horizontalOffset = self.CONTAINS_AREA_SIZE * 0.4 * self.zoomFactor() # offset from end of line
1520  if self._forwardDirection:
1521  self._arrowBoundingRect = QRect(l-arrowLength - horizontalOffset, -arrowWidth, arrowLength, 2*arrowWidth)
1522  else:
1523  self._arrowBoundingRect = QRect(horizontalOffset, -arrowWidth, arrowLength, 2*arrowWidth)
1524 
1525  return self._arrowBoundingRect
1526 
def arrowBoundingRect(self, forceRecalculation=False)
def length(self, zoomed=False)
def Vispa.Views.LineDecayView.DecayLine.boundingRect (   self)

Definition at line 1527 of file LineDecayView.py.

References Vispa.Views.LineDecayView.DecayLine._boundingRect, MagneticFieldMapESProducer._label, TrackerInteractionGeometryESProducer._label, Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigFolder._label, Vispa.Views.LineDecayView.DecayLine._label, Vispa.Views.LineDecayView.DecayLine._labelFont, Vispa.Views.LineDecayView.DecayLine._recalculateBoundingRect, Vispa.Views.LineDecayView.DecayLine._recalculateTransform, Vispa.Views.LineDecayView.DecayLine.arrowBoundingRect(), Vispa.Views.LineDecayView.DecayLine.extendedSize(), Vispa.Views.LineDecayView.DecayLine.labelBoundingRect(), SiStripPI.max, min(), ErrorFrameTransformer.transform(), FrameToFrameDerivative.transform(), AlignTransform.transform(), MuonGeometrySanityCheckCustomFrame.transform(), SurveyPxbDicer.transform(), TkRotation< T >.transform(), Vispa.Views.LineDecayView.DecayLine.transform(), and Vispa.Gui.Zoomable.Zoomable.zoomFactor().

1527  def boundingRect(self):
1528  if not self._recalculateBoundingRect and self._boundingRect:
1529  return self._boundingRect
1530 
1531  self._recalculateTransform = True
1532  contains_area_size = self.CONTAINS_AREA_SIZE
1533  if self.extendedSize():
1534  contains_area_size += 4
1535 
1536  zoomFactor = self.zoomFactor()
1537  offset = contains_area_size * zoomFactor
1538  startPoint = self._startNode.position() * zoomFactor
1539  endPoint = self._endNode.position() * zoomFactor
1540 
1541  topLeft = QPoint(min(startPoint.x(), endPoint.x()) - offset, min(startPoint.y(), endPoint.y()) - offset)
1542  bottomRight = QPoint(max(startPoint.x(), endPoint.x()) + offset, max(startPoint.y(), endPoint.y()) + offset)
1543 
1544  rect = QRect(topLeft, bottomRight)
1545 
1546  # increase rect for label and arrow (shows when selected or hovered
1547  rect = rect.united(self.transform().mapRect(self.arrowBoundingRect(True)))
1548  if self._label and self._labelFont:
1549  rect = rect.united(self.transform().mapRect(self.labelBoundingRect(True)))
1550 
1551  self._boundingRect = rect
1552  return self._boundingRect
1553 
def labelBoundingRect(self, forceRecalculation=False)
def arrowBoundingRect(self, forceRecalculation=False)
T min(T a, T b)
Definition: MathUtil.h:58
def Vispa.Views.LineDecayView.DecayLine.containsPoint (   self,
  pos 
)

Definition at line 1567 of file LineDecayView.py.

References MagneticFieldMapESProducer._label, TrackerInteractionGeometryESProducer._label, Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigFolder._label, Vispa.Views.LineDecayView.DecayLine._label, Vispa.Views.LineDecayView.DecayLine._labelFont, funct.abs(), edm.contains(), Vispa.Views.LineDecayView.DecayLine.extendedSize(), Vispa.Views.LineDecayView.DecayLine.labelBoundingRect(), genParticles_cff.map, SiStripPI.max, min(), sipixelobjects::LinearConversion.slope(), LinearFitErrorsIn2Coord.slope(), HcalTimeSlew::HcalTimeSlewM2Parameters.slope, HcalQIECoder.slope(), MedianCommonModeCalculator.slope, TT6CommonModeCalculator.slope, CastorQIECoder.slope(), sistrip::MeasureLA.slope, AlignmentMonitorMuonSystemMap1D::MyResidual.slope, DDHCalEndcapAlgo.slope, Vispa.Views.LineDecayView.DecayLine.slope(), ErrorFrameTransformer.transform(), FrameToFrameDerivative.transform(), MuonGeometrySanityCheckCustomFrame.transform(), AlignTransform.transform(), SurveyPxbDicer.transform(), TkRotation< T >.transform(), Vispa.Views.LineDecayView.DecayLine.transform(), and Vispa.Gui.Zoomable.Zoomable.zoomFactor().

1567  def containsPoint(self, pos):
1568  pos = pos / self.zoomFactor()
1569 
1570  # label
1571  if self._label and self._labelFont and self.labelBoundingRect().contains(self.transform().inverted()[0].map(pos)):
1572  return True
1573 
1574  # line
1575  line_width = self.LINE_WIDTH + 1
1576  if self.extendedSize():
1577  line_width += 6
1578 
1579  if self._endNode.position().x() == self._startNode.position().x():
1580  # vertical
1581  if abs(pos.x() - self._endNode.position().x()) < line_width:
1582  return True
1583  return False
1584 
1585  if pos.x() < (min(self._startNode.position().x(), self._endNode.position().x()) - line_width) or pos.x() > (max(self._startNode.position().x(), self._endNode.position().x()) + line_width):
1586  return False
1587 
1588  slope = self.slope()
1589  deltaY = slope * (pos.x() - self._startNode.position().x()) + self._startNode.position().y() - pos.y()
1590  if abs(deltaY) < 0.5* line_width * max(1, abs(slope)):
1591  return True
1592  return False
1593 
bool contains(EventRange const &lh, EventID const &rh)
Definition: EventRange.cc:38
def labelBoundingRect(self, forceRecalculation=False)
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
T min(T a, T b)
Definition: MathUtil.h:58
def Vispa.Views.LineDecayView.DecayLine.dataAccessor (   self)
def Vispa.Views.LineDecayView.DecayLine.daughterNode (   self)
def Vispa.Views.LineDecayView.DecayLine.delete (   self)

Definition at line 1244 of file LineDecayView.py.

References Vispa.Views.LineDecayView.DecayLine._endNode, Vispa.Views.LineDecayView.DecayLine._startNode, PileUpSummaryInfo.PileUpSummaryInfo.object, HLTTauDQMPath::Object.object, SingleObjectCondition.object, SingleObjectTrigger.object, MEtoEDM< T >::MEtoEDMObject.object, PhysicsTools::TrainerMonitoring::RootObject< T >.object, querying.connection.object(), querying.factory.object(), Vispa.Views.LineDecayView.LineDecayContainer.object(), python.Events.object(), Vispa.Views.LineDecayView.DecayObject.object(), Vispa.Views.LineDecayView.DecayLine.object(), edm::ThinnedAssociationBranches.parent(), edmIntegrityCheck.PublishToFileSystem.parent, confdb.HLTProcess.parent, FSimVertex.parent(), reco::PattRecoNode< Cluster >.parent(), DDI::Division.parent(), math::GraphWalker< N, E >.parent(), DDLSAX2FileHandler.parent(), OpticalObject.parent(), FWPSetTableManager::PSetData.parent, emtf::Node.parent, EmDQMReco::FourVectorMonitorElements.parent, DDFilteredView.parent(), cms::DDFilteredView.parent(), DDExpandedView.parent(), DDDivision.parent(), options.HLTProcessOptions.parent, dqmservices::TriggerSelector::TreeElement.parent(), DDXMLElement.parent(), BeautifulSoup.PageElement.parent, globcontrol.parent, and Vispa.Views.LineDecayView.DecayObject.parent().

1244  def delete(self):
1245  self._startNode.removeObject(self)
1246  self._endNode.removeObject(self)
1247  self.parent().removeObject(self._startNode)
1248  self.parent().removeObject(self._endNode)
1249 
1250  # remove this DecayObject's pxl particle from parent's pxl event / eventview
1251  self.parent().object().removeObject(self.object())
1252  return True
1253 
def Vispa.Views.LineDecayView.DecayLine.drawArrow (   self,
  painter,
  paintMode = 0x0 
)

Definition at line 1477 of file LineDecayView.py.

References Vispa.Views.LineDecayView.DecayLine._forwardDirection, Vispa.Views.LineDecayView.DecayLine.arrowBoundingRect(), and Vispa.Views.LineDecayView.DecayLine.lineWidth().

Referenced by Vispa.Views.LineDecayView.DecayLine.paint().

1477  def drawArrow(self, painter, paintMode=0x0):
1478  # make sure to stay within bounding rect, therefore add / substract arrowPixelOffset
1479  arrowPixelOffset = 0.7* self.lineWidth()
1480  arrowBoundingRect = self.arrowBoundingRect()
1481  arrowBoundingRectLeft = arrowBoundingRect.left() + arrowPixelOffset
1482  arrowBoundingRectRight = arrowBoundingRect.right() - arrowPixelOffset
1483  arrowBoundingRectTop = arrowBoundingRect.top() + arrowPixelOffset
1484  arrowBoundingRectBottom = arrowBoundingRect.bottom() - arrowPixelOffset
1485  arrowBoundingRectVerticalCenter = arrowBoundingRect.center().y()
1486  if self._forwardDirection:
1487  painter.drawLine(arrowBoundingRectLeft, arrowBoundingRectTop, arrowBoundingRectRight, arrowBoundingRectVerticalCenter)
1488  painter.drawLine(arrowBoundingRectLeft, arrowBoundingRectBottom, arrowBoundingRectRight, arrowBoundingRectVerticalCenter)
1489 
1490  else:
1491  painter.drawLine(arrowBoundingRectLeft, arrowBoundingRectVerticalCenter, arrowBoundingRectRight, arrowBoundingRectTop)
1492  painter.drawLine(arrowBoundingRectLeft, arrowBoundingRectVerticalCenter, arrowBoundingRectRight, arrowBoundingRectBottom)
1493 
1494 
def arrowBoundingRect(self, forceRecalculation=False)
def drawArrow(self, painter, paintMode=0x0)
def Vispa.Views.LineDecayView.DecayLine.drawText (   self,
  painter,
  paintMode = 0x0 
)
Draws self._label on given painter.

Expects coordinates of painter transformed as returned by transform()

Definition at line 1458 of file LineDecayView.py.

References MagneticFieldMapESProducer._label, TrackerInteractionGeometryESProducer._label, Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigFolder._label, Vispa.Views.LineDecayView.DecayLine._label, Vispa.Views.LineDecayView.DecayLine._labelFont, Vispa.Views.LineDecayView.DecayLine._showLabel, and Vispa.Views.LineDecayView.DecayLine.labelBoundingRect().

Referenced by Vispa.Views.LineDecayView.DecayLine.paint().

1458  def drawText(self, painter, paintMode=0x0):
1459  """ Draws self._label on given painter.
1460 
1461  Expects coordinates of painter transformed as returned by transform()
1462  """
1463  if not self._showLabel or not self._label:
1464  return
1465 
1466  if paintMode & DecayObject.PAINT_MODE_SELECTED:
1467  textColor = QColor(Qt.blue)
1468  elif paintMode & DecayObject.PAINT_MODE_HOVERED:
1469  textColor = QColor(Qt.gray)
1470  else:
1471  textColor = QColor(Qt.black)
1472 
1473  path = QPainterPath()
1474  path.addText(QPointF(self.labelBoundingRect().bottomLeft()), self._labelFont, self._label)
1475  painter.fillPath(path, textColor)
1476 
def labelBoundingRect(self, forceRecalculation=False)
def drawText(self, painter, paintMode=0x0)
def Vispa.Views.LineDecayView.DecayLine.extendedSize (   self)
Returns True if instead of simple line a spiral or a sinus function is plotted.

Definition at line 1320 of file LineDecayView.py.

References Vispa.Views.LineDecayView.DecayLine._lineStyle, Vispa.Views.LineDecayView.DecayLine.dataAccessor(), edmIntegrityCheck.PublishToFileSystem.parent, edm::ThinnedAssociationBranches.parent(), confdb.HLTProcess.parent, FSimVertex.parent(), reco::PattRecoNode< Cluster >.parent(), DDI::Division.parent(), math::GraphWalker< N, E >.parent(), DDLSAX2FileHandler.parent(), OpticalObject.parent(), FWPSetTableManager::PSetData.parent, emtf::Node.parent, EmDQMReco::FourVectorMonitorElements.parent, DDFilteredView.parent(), cms::DDFilteredView.parent(), DDExpandedView.parent(), DDDivision.parent(), options.HLTProcessOptions.parent, dqmservices::TriggerSelector::TreeElement.parent(), DDXMLElement.parent(), BeautifulSoup.PageElement.parent, globcontrol.parent, and Vispa.Views.LineDecayView.DecayObject.parent().

Referenced by Vispa.Views.LineDecayView.DecayLine.boundingRect(), Vispa.Views.LineDecayView.DecayLine.containsPoint(), Vispa.Views.LineDecayView.DecayLine.labelBoundingRect(), and Vispa.Views.LineDecayView.DecayLine.paint().

1320  def extendedSize(self):
1321  """ Returns True if instead of simple line a spiral or a sinus function is plotted.
1322  """
1323  if not self.parent().dataAccessor():
1324  return False
1325  return self._lineStyle == self.parent().dataAccessor().LINE_STYLE_SPIRAL or self._lineStyle == self.parent().dataAccessor().LINE_STYLE_WAVE or self._lineStyle == self.parent().dataAccessor().LINE_VERTEX
1326 
_lineStyle
l = (n + 1/2) * r * 2 * math.pi
def Vispa.Views.LineDecayView.DecayLine.labelBoundingRect (   self,
  forceRecalculation = False 
)

Definition at line 1495 of file LineDecayView.py.

References MagneticFieldMapESProducer._label, TrackerInteractionGeometryESProducer._label, Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigFolder._label, Vispa.Views.LineDecayView.DecayLine._label, Vispa.Views.LineDecayView.DecayLine._labelBoundingRect, Vispa.Views.LineDecayView.DecayLine._labelFont, Vispa.Views.LineDecayView.DecayLine.extendedSize(), TmModule.length, OpenBounds.length(), SimpleDiskBounds.length(), Phase2Tracker::Phase2TrackerFEDChannel.length(), RectangularPlaneBounds.length(), GeneralNSurfaceDelimitedBounds.length(), SimpleCylinderBounds.length(), OOTPileupCorrectionBuffer.length(), FFTJetCorrectorParameters.length(), Bounds.length(), TrapezoidalPlaneBounds.length(), RecoProducerFP420.length, sistrip::DetSetVectorFiller< T, dsvIsSparse >::ChannelRegistryItem.length, AlignableSurface.length(), SimpleConeBounds.length(), CaloSegment.length(), l1t::rctDataBase.length, Phase2Tracker::Phase2TrackerDigiProducer::Registry.length, FEDHeader.length, FEDTrailer.length, sistrip::RawToDigiUnpacker::Registry.length, SiStripModule.length(), sistrip::FEDChannel.length(), Vispa.Views.LineDecayView.DecayLine.length(), and Vispa.Gui.Zoomable.Zoomable.zoomFactor().

Referenced by Vispa.Views.LineDecayView.DecayLine.boundingRect(), Vispa.Views.LineDecayView.DecayLine.containsPoint(), and Vispa.Views.LineDecayView.DecayLine.drawText().

1495  def labelBoundingRect(self, forceRecalculation=False):
1496  if not self._label or not self._labelFont:
1497  return QRect()
1498 
1499  if not self._labelBoundingRect or forceRecalculation:
1500  label_offset = self.LABEL_OFFSET
1501  if self.extendedSize():
1502  label_offset += 2
1503 
1504  fm = QFontMetrics(self._labelFont)
1505  self._labelBoundingRect = fm.boundingRect(self._label)
1506 
1507  labelWidth = self._labelBoundingRect.width()
1508  offset = QPointF(0.5 * (self.length(zoomed=True) - labelWidth), - label_offset * self.zoomFactor())
1509  self._labelBoundingRect.translate(offset.x(), offset.y())
1510 
1511  return self._labelBoundingRect
1512 
def labelBoundingRect(self, forceRecalculation=False)
def length(self, zoomed=False)
def Vispa.Views.LineDecayView.DecayLine.length (   self,
  zoomed = False 
)

Definition at line 1561 of file LineDecayView.py.

References Vispa.Gui.Zoomable.Zoomable.zoomFactor().

Referenced by Vispa.Views.LineDecayView.DecayLine.arrowBoundingRect(), Vispa.Views.LineDecayView.DecayLine.labelBoundingRect(), and Vispa.Views.LineDecayView.DecayLine.paint().

1561  def length(self, zoomed=False):
1562  l = math.sqrt((self._endNode.x() - self._startNode.x())**2 + (self._endNode.y() - self._startNode.y())**2)
1563  if zoomed:
1564  return self.zoomFactor() * l
1565  return l
1566 
def length(self, zoomed=False)
def Vispa.Views.LineDecayView.DecayLine.lineWidth (   self)
def Vispa.Views.LineDecayView.DecayLine.motherNode (   self)
def Vispa.Views.LineDecayView.DecayLine.move (   self,
  pos 
)

Definition at line 1601 of file LineDecayView.py.

References Vispa.Views.LineDecayView.DecayLine._recalculateBoundingRect.

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

1601  def move(self, pos):
1602  self._startNode.move(pos)
1603  self._endNode.move(pos)
1604  self._recalculateBoundingRect = True
1605 
def Vispa.Views.LineDecayView.DecayLine.nodeType (   self,
  node 
)

Definition at line 1293 of file LineDecayView.py.

References Vispa.Views.LineDecayView.DecayLine._endNode, and Vispa.Views.LineDecayView.DecayLine._startNode.

Referenced by Vispa.Views.LineDecayView.DecayLine.replaceNode().

1293  def nodeType(self, node):
1294  if self._startNode == node:
1295  return DecayNode.TYPE_MOTHER
1296  if self._endNode == node:
1297  return DecayNode.TYPE_DAUGHTER
1298  return None
1299 
def Vispa.Views.LineDecayView.DecayLine.object (   self)
def Vispa.Views.LineDecayView.DecayLine.paint (   self,
  painter,
  paintMode = 0x0 
)

Definition at line 1355 of file LineDecayView.py.

References MELaserPrim._color, Vispa.Views.LineDecayView.DecayLine._color, Vispa.Views.LineDecayView.DecayLine._lineStyle, Vispa.Views.LineDecayView.DecayLine._selfContained, Vispa.Views.LineDecayView.DecayLine.dataAccessor(), Vispa.Views.LineDecayView.DecayLine.drawArrow(), Vispa.Views.LineDecayView.DecayLine.drawText(), Vispa.Views.LineDecayView.DecayLine.extendedSize(), createfilelist.int, TmModule.length, OpenBounds.length(), SimpleDiskBounds.length(), Phase2Tracker::Phase2TrackerFEDChannel.length(), RectangularPlaneBounds.length(), GeneralNSurfaceDelimitedBounds.length(), SimpleCylinderBounds.length(), Bounds.length(), FFTJetCorrectorParameters.length(), OOTPileupCorrectionBuffer.length(), RecoProducerFP420.length, TrapezoidalPlaneBounds.length(), sistrip::DetSetVectorFiller< T, dsvIsSparse >::ChannelRegistryItem.length, AlignableSurface.length(), SimpleConeBounds.length(), CaloSegment.length(), l1t::rctDataBase.length, Phase2Tracker::Phase2TrackerDigiProducer::Registry.length, FEDHeader.length, FEDTrailer.length, sistrip::RawToDigiUnpacker::Registry.length, SiStripModule.length(), sistrip::FEDChannel.length(), Vispa.Views.LineDecayView.DecayLine.length(), Vispa.Views.LineDecayView.DecayLine.lineWidth(), SiStripPI.max, edmIntegrityCheck.PublishToFileSystem.parent, edm::ThinnedAssociationBranches.parent(), confdb.HLTProcess.parent, reco::PattRecoNode< Cluster >.parent(), FSimVertex.parent(), DDI::Division.parent(), math::GraphWalker< N, E >.parent(), DDLSAX2FileHandler.parent(), OpticalObject.parent(), FWPSetTableManager::PSetData.parent, emtf::Node.parent, EmDQMReco::FourVectorMonitorElements.parent, DDFilteredView.parent(), cms::DDFilteredView.parent(), DDExpandedView.parent(), DDDivision.parent(), options.HLTProcessOptions.parent, dqmservices::TriggerSelector::TreeElement.parent(), DDXMLElement.parent(), BeautifulSoup.PageElement.parent, globcontrol.parent, Vispa.Views.LineDecayView.DecayObject.parent(), Vispa.Views.LineDecayView.DecayLine.qtLineStyle(), ErrorFrameTransformer.transform(), FrameToFrameDerivative.transform(), AlignTransform.transform(), MuonGeometrySanityCheckCustomFrame.transform(), SurveyPxbDicer.transform(), TkRotation< T >.transform(), Vispa.Views.LineDecayView.DecayLine.transform(), and Vispa.Gui.Zoomable.Zoomable.zoomFactor().

1355  def paint(self, painter, paintMode=0x0):
1356  if paintMode & DecayObject.PAINT_MODE_SELECTED:
1357  penColor = QColor(Qt.blue)
1358  else:
1359  penColor = self._color
1360  if paintMode & DecayObject.PAINT_MODE_HOVERED:
1361  penColor = penColor.lighter(80)
1362 
1363  showDirectionArrow = paintMode & DecayObject.PAINT_MODE_HOVERED or paintMode & DecayObject.PAINT_MODE_SELECTED
1364  extendedSize = self.extendedSize()
1365 
1366  z = self.zoomFactor()
1367  l = self.length(zoomed = True)
1368 
1369  # transform coordinates to make following calculations easier
1370  painter.setTransform(self.transform())
1371 
1372  if extendedSize:
1373  painter.setPen(QPen(penColor, 0.5*self.lineWidth(), Qt.SolidLine))
1374  # spiral or wave line
1375  ## l = (n + 1/2) * r * 2 * math.pi
1376  designRadius = 1.2 * z
1377  # n: number of spirals
1378  n = max(int(1.0 * l / (2 * math.pi * designRadius)), 4)
1379  # r: radius of cycloide wheel
1380  r = 1.0 * l / (2 * math.pi * (n + 0.5))
1381  # a: cycloide is trace of point with radius a
1382  a = 3.5 * r
1383 
1384  if self.parent().dataAccessor() and self._lineStyle == self.parent().dataAccessor().LINE_STYLE_SPIRAL:
1385  path = QPainterPath()
1386  # draw spiral using a cycloide
1387  # coordinates of center of wheel
1388  xM = a
1389  yM = 0
1390  while xM < l:
1391  phase = 1.0 * (xM-a)/r
1392  x = xM - a * math.cos(phase)
1393  y = yM - a * math.sin(phase)
1394  if x > l:
1395  x = l
1396  #path.lineTo(QPointF(x, y))
1397  break
1398  path.lineTo(QPointF(x, y))
1399  xM += 0.2 * r / z
1400  painter.drawPath(path)
1401  elif self.parent().dataAccessor() and self._lineStyle == self.parent().dataAccessor().LINE_STYLE_WAVE:
1402  path = QPainterPath()
1403  x = a
1404  while x < l - 0.5*a:
1405  y = a * math.cos(x/r)
1406  path.lineTo(QPointF(x, y))
1407  x += 0.2 * r / z
1408  painter.drawPath(path)
1409  elif self.parent().dataAccessor() and self._lineStyle == self.parent().dataAccessor().LINE_VERTEX:
1410  painter.setBrush(QBrush(penColor, Qt.SolidPattern))
1411  painter.drawEllipse(QPointF(l/2.,0.),l/2.,a)
1412 
1413  else:
1414  painter.setPen(QPen(penColor, self.lineWidth(), self.qtLineStyle()))
1415  painter.drawLine(QPoint(0,0), QPoint(l, 0))
1416 
1417  if not paintMode & DecayObject.PAINT_MODE_NO_DECORATIONS:
1418  self.drawText(painter, paintMode)
1419 
1420  # paint arrow lines
1421  if showDirectionArrow:
1422  painter.setPen(QPen(penColor, 0.8*self.lineWidth(), Qt.SolidLine, Qt.RoundCap))
1423  self.drawArrow(painter, paintMode)
1424 
1425  ## DEBUG
1426  #painter.setPen(QPen(penColor, 1, Qt.SolidLine))
1427  #painter.drawRect(self.labelBoundingRect())
1428  #painter.drawRect(self.arrowBoundingRect())
1429 
1430  painter.resetTransform()
1431  #painter.drawRect(self.boundingRect())
1432 
1433  if self._selfContained:
1434  self._startNode.paint(painter, paintMode)
1435  self._endNode.paint(painter, paintMode)
1436 
_lineStyle
l = (n + 1/2) * r * 2 * math.pi
def paint(self, painter, paintMode=0x0)
def drawArrow(self, painter, paintMode=0x0)
def length(self, zoomed=False)
def drawText(self, painter, paintMode=0x0)
def Vispa.Views.LineDecayView.DecayLine.qtLineStyle (   self)

Definition at line 1267 of file LineDecayView.py.

References Vispa.Views.LineDecayView.DecayLine._lineStyle, Vispa.Views.LineDecayView.DecayLine.dataAccessor(), edmIntegrityCheck.PublishToFileSystem.parent, edm::ThinnedAssociationBranches.parent(), confdb.HLTProcess.parent, FSimVertex.parent(), reco::PattRecoNode< Cluster >.parent(), DDI::Division.parent(), math::GraphWalker< N, E >.parent(), DDLSAX2FileHandler.parent(), OpticalObject.parent(), FWPSetTableManager::PSetData.parent, emtf::Node.parent, EmDQMReco::FourVectorMonitorElements.parent, DDFilteredView.parent(), cms::DDFilteredView.parent(), DDExpandedView.parent(), DDDivision.parent(), options.HLTProcessOptions.parent, dqmservices::TriggerSelector::TreeElement.parent(), DDXMLElement.parent(), BeautifulSoup.PageElement.parent, globcontrol.parent, and Vispa.Views.LineDecayView.DecayObject.parent().

Referenced by Vispa.Views.LineDecayView.DecayLine.paint().

1267  def qtLineStyle(self):
1268  if not self.parent().dataAccessor():
1269  return Qt.SolidLine
1270  if self._lineStyle == self.parent().dataAccessor().LINE_STYLE_DASH:
1271  return Qt.DashLine
1272  elif self._lineStyle == self.parent().dataAccessor().LINE_STYLE_SOLID:
1273  return Qt.SolidLine
1274  return None
1275 
_lineStyle
l = (n + 1/2) * r * 2 * math.pi
def Vispa.Views.LineDecayView.DecayLine.replaceNode (   self,
  oldNode,
  newNode 
)

Definition at line 1300 of file LineDecayView.py.

References Vispa.Views.LineDecayView.DecayLine._endNode, Vispa.Views.LineDecayView.DecayLine._recalculateBoundingRect, Vispa.Views.LineDecayView.DecayLine._startNode, and Vispa.Views.LineDecayView.DecayLine.nodeType().

1300  def replaceNode(self, oldNode, newNode):
1301  if self._startNode == oldNode:
1302  self._startNode.removeObject(self)
1303  self._startNode = newNode
1304  self._startNode.appendObject(self)
1305  if self._endNode == oldNode:
1306  self._endNode.removeObject(self)
1307  self._endNode = newNode
1308  self._endNode.appendObject(self)
1309  self._recalculateBoundingRect = True
1310  return self.nodeType(newNode)
1311 
def replaceNode(self, oldNode, newNode)
def Vispa.Views.LineDecayView.DecayLine.select (   self,
  pos = None,
  selected = True 
)

Definition at line 1594 of file LineDecayView.py.

References Vispa.Views.LineDecayView.DecayLine._recalculateBoundingRect.

1594  def select(self, pos=None, selected=True):
1595  if not pos:
1596  pos = (self._startNode.position() + self._endNode.position()) * 0.5
1597  self._startNode.select(pos)
1598  self._endNode.select(pos)
1599  self._recalculateBoundingRect = True
1600 
def select(self, pos=None, selected=True)
def Vispa.Views.LineDecayView.DecayLine.setColor (   self,
  color 
)
def Vispa.Views.LineDecayView.DecayLine.setLabel (   self,
  label 
)
def Vispa.Views.LineDecayView.DecayLine.setLineStyle (   self,
  style 
)
def Vispa.Views.LineDecayView.DecayLine.setObject (   self,
  object 
)
def Vispa.Views.LineDecayView.DecayLine.setShowLabel (   self,
  show 
)

Definition at line 1290 of file LineDecayView.py.

References Vispa.Views.LineDecayView.DecayLine._showLabel.

1290  def setShowLabel(self, show):
1291  self._showLabel = show
1292 
def Vispa.Views.LineDecayView.DecayLine.setZoom (   self,
  zoom 
)

Definition at line 1239 of file LineDecayView.py.

References Vispa.Views.LineDecayView.DecayLine._labelFont, and Vispa.Gui.Zoomable.Zoomable.zoomFactor().

1239  def setZoom(self, zoom):
1240  DecayObject.setZoom(self, zoom)
1241  if self._labelFont:
1242  self._labelFont.setPointSize(12 * self.zoomFactor())
1243 
def Vispa.Views.LineDecayView.DecayLine.slope (   self)

Definition at line 1554 of file LineDecayView.py.

Referenced by Vispa.Views.LineDecayView.DecayLine.containsPoint(), and Vispa.Views.LineDecayView.DecayLine.transform().

1554  def slope(self):
1555  deltaX = self._endNode.x() - self._startNode.x()
1556  if deltaX == 0:
1557  return sys.maxsize
1558 
1559  return 1.0 * (self._endNode.y() - self._startNode.y()) / deltaX
1560 
def Vispa.Views.LineDecayView.DecayLine.transform (   self)
Returns QTransform that sets the origin to the start point and rotates by the slope angle.

Used to change coordinates of painter in paint().

Definition at line 1327 of file LineDecayView.py.

References Vispa.Views.LineDecayView.DecayLine._forwardDirection, Vispa.Views.LineDecayView.DecayLine._recalculateTransform, Vispa.Views.LineDecayView.DecayLine._transform, sipixelobjects::LinearConversion.slope(), LinearFitErrorsIn2Coord.slope(), HcalTimeSlew::HcalTimeSlewM2Parameters.slope, HcalQIECoder.slope(), MedianCommonModeCalculator.slope, TT6CommonModeCalculator.slope, CastorQIECoder.slope(), sistrip::MeasureLA.slope, AlignmentMonitorMuonSystemMap1D::MyResidual.slope, DDHCalEndcapAlgo.slope, Vispa.Views.LineDecayView.DecayLine.slope(), and Vispa.Gui.Zoomable.Zoomable.zoomFactor().

Referenced by Vispa.Views.LineDecayView.DecayLine.boundingRect(), Vispa.Views.LineDecayView.DecayLine.containsPoint(), and Vispa.Views.LineDecayView.DecayLine.paint().

1327  def transform(self):
1328  """ Returns QTransform that sets the origin to the start point and rotates by the slope angle.
1329 
1330  Used to change coordinates of painter in paint().
1331  """
1332 
1333  if not self._recalculateTransform and self._transform:
1334  return self._transform
1335 
1336  z = self.zoomFactor()
1337  if self._startNode.x() < self._endNode.x():
1338  self._forwardDirection = True
1339  xNull = self._startNode.x() * z
1340  yNull = self._startNode.y() * z
1341  else:
1342  self._forwardDirection = False
1343  xNull = self._endNode.x() * z
1344  yNull = self._endNode.y() * z
1345 
1346  slope = self.slope()
1347  angle = math.atan(slope)
1348  angleDegree = angle * self.HUNDREDEIGHTY_OVER_PI
1349 
1350  self._transform = QTransform()
1351  self._transform.translate(xNull, yNull) # rotate around start point
1352  self._transform.rotate(angleDegree)
1353  return self._transform
1354 

Member Data Documentation

Vispa.Views.LineDecayView.DecayLine._arrowBoundingRect
private
Vispa.Views.LineDecayView.DecayLine._boundingRect
private

Definition at line 1207 of file LineDecayView.py.

Referenced by Vispa.Views.LineDecayView.DecayLine.boundingRect().

Vispa.Views.LineDecayView.DecayLine._color
private
Vispa.Views.LineDecayView.DecayLine._endNode
private
Vispa.Views.LineDecayView.DecayLine._forwardDirection
private
Vispa.Views.LineDecayView.DecayLine._label
private
Vispa.Views.LineDecayView.DecayLine._labelBoundingRect
private
Vispa.Views.LineDecayView.DecayLine._labelFont
private
Vispa.Views.LineDecayView.DecayLine._labelMatrix
private

Definition at line 1204 of file LineDecayView.py.

Vispa.Views.LineDecayView.DecayLine._lineStyle
private
Vispa.Views.LineDecayView.DecayLine._pxlObject
private
Vispa.Views.LineDecayView.DecayLine._recalculateBoundingRect
private
Vispa.Views.LineDecayView.DecayLine._recalculateTransform
private
Vispa.Views.LineDecayView.DecayLine._selfContained
private

Definition at line 1217 of file LineDecayView.py.

Referenced by Vispa.Views.LineDecayView.DecayLine.paint().

Vispa.Views.LineDecayView.DecayLine._showLabel
private
Vispa.Views.LineDecayView.DecayLine._startNode
private
Vispa.Views.LineDecayView.DecayLine._transform
private

Definition at line 1211 of file LineDecayView.py.

Referenced by Vispa.Views.LineDecayView.DecayLine.transform().