CMS 3D CMS Logo

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

Public Member Functions

def __init__ (self, parent, position)
 
def boundingRect (self)
 
def containsPoint (self, pos)
 
def delete (self)
 
def move (self, arg)
 
def paint (self, painter, paintMode=0x0)
 
def position (self, zoomed=False)
 
def select (self, pos=None, selected=True)
 
def setPosition (self, pos)
 
def unite (self, node)
 
def x (self)
 
def y (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)
 
- Public Member Functions inherited from Vispa.Share.ObjectHolder.ObjectHolder
def __init__ (self)
 
def allDataObjectChildren (self, objects=None)
 
def appendObject (self, object)
 
def applyFilter (self, objects)
 
def clearObjects (self)
 
def dataAccessor (self)
 
def dataObject (self)
 
def dataObjects (self)
 
def dataObjectsCount (self)
 
def numberDataObjectChildren (self, objects=None)
 
def removeObject (self, object)
 
def setDataAccessor (self, accessor)
 
def setDataObject (self, object)
 
def setDataObjects (self, objects)
 
def setExclusiveMode (self, exclusive=True)
 
def setFilter (self, filter)
 

Private Attributes

 _dragMouseRel
 
 _position
 

Detailed Description

Definition at line 1077 of file LineDecayView.py.

Constructor & Destructor Documentation

def Vispa.Views.LineDecayView.DecayNode.__init__ (   self,
  parent,
  position 
)

Definition at line 1082 of file LineDecayView.py.

References Vispa.Share.ObjectHolder.ObjectHolder.setExclusiveMode().

1082  def __init__(self, parent, position):
1083  DecayObject.__init__(self, parent)
1084  ObjectHolder.__init__(self)
1085  self.setExclusiveMode(True)
1086  self._position = QPoint(position) # copy
1087  self._dragMouseRel = QPoint(0, 0)
1088 
def __init__(self, parent, position)
def setExclusiveMode(self, exclusive=True)
Definition: ObjectHolder.py:15

Member Function Documentation

def Vispa.Views.LineDecayView.DecayNode.boundingRect (   self)
def Vispa.Views.LineDecayView.DecayNode.containsPoint (   self,
  pos 
)
def Vispa.Views.LineDecayView.DecayNode.delete (   self)

Definition at line 1089 of file LineDecayView.py.

References Vispa.Share.ObjectHolder.ObjectHolder.dataAccessor(), Vispa.Share.ObjectHolder.ObjectHolder.dataObjects(), 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().

1089  def delete(self):
1090  if self.parent().dataAccessor():
1091  for decayObject in self.dataObjects():
1092  for decayObject2 in self.dataObjects():
1093  if decayObject2.object() in self.parent().dataAccessor().motherRelations(decayObject.object()):
1094  decayObject.object().unlinkMother(decayObject2.object())
1095  if decayObject2.object() in self.parent().dataAccessor().daughterRelations(decayObject.object()):
1096  decayObject.object().unlinkDaughter(decayObject2.object())
1097  return True
1098 
def Vispa.Views.LineDecayView.DecayNode.move (   self,
  arg 
)

Definition at line 1139 of file LineDecayView.py.

References Vispa.Views.LineDecayView.DecayNode._dragMouseRel, Vispa.Views.LineDecayView.DecayNode._position, Vispa.Main.StartupScreen.StartupScreen.boundingRect(), Vispa.Views.LineDecayView.DecayObject.boundingRect(), Vispa.Gui.VispaWidget.VispaWidget.boundingRect(), Vispa.Share.ObjectHolder.ObjectHolder.dataObjects(), 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(), BeautifulSoup.PageElement.parent, DDXMLElement.parent(), globcontrol.parent, Vispa.Views.LineDecayView.DecayObject.parent(), and Vispa.Gui.Zoomable.Zoomable.zoomFactor().

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

1139  def move(self, *arg):
1140 
1141  if len(arg) == 1:
1142  pos = arg[0]
1143  if len(arg) > 1:
1144  pos = QPoint(arg[0], arg[1])
1145 
1146  if self.parent():
1147  oldBoundingRect = self.boundingRect()
1148  oldBoundingRects = {}
1149  for object in self.dataObjects():
1150  oldBoundingRects[object] = object.boundingRect()
1151 
1152  self._position = pos / self.zoomFactor() + self._dragMouseRel
1153 
1154  if self.parent():
1155  for object in self.dataObjects():
1156  self.parent().objectMoved(object, oldBoundingRects[object])
1157  self.parent().objectMoved(self, oldBoundingRect)
1158 
def Vispa.Views.LineDecayView.DecayNode.paint (   self,
  painter,
  paintMode = 0x0 
)

Definition at line 1113 of file LineDecayView.py.

References Vispa.Views.LineDecayView.DecayNode._position, and Vispa.Gui.Zoomable.Zoomable.zoomFactor().

1113  def paint(self, painter, paintMode=0x0):
1114  if paintMode & DecayObject.PAINT_MODE_SELECTED:
1115  penColor = QColor(Qt.blue)
1116  #elif paintMode & DecayObject.PAINT_MODE_HOVERED:
1117  # penColor = QColor(Qt.green)
1118  else:
1119  penColor = QColor(Qt.blue).lighter(140)
1120  if paintMode & DecayObject.PAINT_MODE_HOVERED:
1121  penColor = penColor.lighter(120)
1122 
1123  painter.setPen(QPen(penColor, 1 * self.zoomFactor(), Qt.SolidLine))
1124  painter.setBrush(penColor)
1125  #if paintMode & DecayObject.PAINT_MODE_HOVERED or paintMode & DecayObject.PAINT_MODE_SELECTED:
1126  painter.drawEllipse(self._position * self.zoomFactor(), self.CONTAINS_AREA_SIZE * 0.4 * self.zoomFactor(), self.CONTAINS_AREA_SIZE * 0.4 * self.zoomFactor())
1127  #painter.drawRect(self.boundingRect())
1128 
def paint(self, painter, paintMode=0x0)
def Vispa.Views.LineDecayView.DecayNode.position (   self,
  zoomed = False 
)

Definition at line 1099 of file LineDecayView.py.

References Vispa.Views.LineDecayView.DecayNode._position, and Vispa.Gui.Zoomable.Zoomable.zoomFactor().

1099  def position(self, zoomed=False):
1100  if zoomed:
1101  return QPointF(self._position.x() * self.zoomFactor(), self._position.y() * self.zoomFactor())
1102  return self._position
1103 
def position(self, zoomed=False)
def Vispa.Views.LineDecayView.DecayNode.select (   self,
  pos = None,
  selected = True 
)
def Vispa.Views.LineDecayView.DecayNode.setPosition (   self,
  pos 
)

Definition at line 1104 of file LineDecayView.py.

References Vispa.Views.LineDecayView.DecayNode._position.

1104  def setPosition(self, pos):
1105  self._position = pos
1106 
def Vispa.Views.LineDecayView.DecayNode.unite (   self,
  node 
)

Definition at line 1159 of file LineDecayView.py.

References Vispa.Share.ObjectHolder.ObjectHolder.appendObject(), Vispa.Share.ObjectHolder.ObjectHolder.dataAccessor(), Vispa.Share.ObjectHolder.ObjectHolder.dataObjects(), 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(), BeautifulSoup.PageElement.parent, DDXMLElement.parent(), globcontrol.parent, Vispa.Views.LineDecayView.DecayObject.parent(), and update.

1159  def unite(self, node):
1160  #logging.debug(self.__class__.__name__ +": unite()")
1161  if node == self:
1162  return False
1163 
1164  useDataAccessor = False
1165  if self.parent().dataAccessor():
1166  useDataAccessor = True
1167 
1168  oldDecayObjects = self.dataObjects()[:]
1169  newDecayObjects = node.dataObjects()[:]
1170  for newDecayObject in newDecayObjects:
1171  self.appendObject(newDecayObject)
1172  self.parent().update(newDecayObject.boundingRect()) # old bounding rect
1173  nodeType = newDecayObject.replaceNode(node, self)
1174  self.parent().update(newDecayObject.boundingRect()) # new bounding rect
1175  if useDataAccessor:
1176  for oldDecayObject in oldDecayObjects:
1177  if nodeType == DecayNode.TYPE_MOTHER and oldDecayObject.nodeType(self) == DecayNode.TYPE_DAUGHTER:
1178  #newDecayObject.object().linkMother(oldDecayObject.object())
1179  self.parent().dataAccessor().linkMother(newDecayObject.object(), oldDecayObject.object())
1180  if nodeType == DecayNode.TYPE_DAUGHTER and oldDecayObject.nodeType(self) == DecayNode.TYPE_MOTHER:
1181  #newDecayObject.object().linkDaughter(oldDecayObject.object())
1182  self.parent().dataAccessor().linkDaughter(newDecayObject.object(), oldDecayObject.object())
1183  return True
1184 
#define update(a, b)
def Vispa.Views.LineDecayView.DecayNode.x (   self)
def Vispa.Views.LineDecayView.DecayNode.y (   self)

Member Data Documentation

Vispa.Views.LineDecayView.DecayNode._dragMouseRel
private
Vispa.Views.LineDecayView.DecayNode._position
private