def __init__(self, histo2D, sym, viewport): DrawableManager.__init__(self, viewport) self.histo2D = histo2D self.sym = sym self.ID = None self._xproj = None self._yproj = None self._color = hdtv.color.default
def Hide(self): if self.viewport is None: return with LockViewport(self.viewport): DrawableManager.Hide(self) if self.hist: self.hist.Hide()
def Refresh(self): if self.viewport is None: return with LockViewport(self.viewport): DrawableManager.Refresh(self) if self.hist: self.hist.Refresh()
def Draw(self, viewport): self.viewport = viewport self.viewport.LockUpdate() DrawableManager.Draw(self, viewport) if self.hist: self.hist.Draw(viewport) self.viewport.UnlockUpdate()
def Show(self): if self.viewport is None: return with LockViewport(self.viewport): DrawableManager.Show(self) if self.hist: self.hist.Show()
def Refresh(self): if self.viewport is None: return self.viewport.LockUpdate() DrawableManager.Refresh(self) if self.hist: self.hist.Refresh() self.viewport.UnlockUpdate()
def Hide(self): if self.viewport is None: return self.viewport.LockUpdate() DrawableManager.Hide(self) if self.hist: self.hist.Hide() self.viewport.UnlockUpdate()
def Insert(self, obj, ID=None): """ Insert cut to internal dict """ obj.color = self.color obj.dashed = True if ID is None: ID = self.activeID ID = DrawableManager.Insert(self, obj, ID) self.ActivateObject(ID) return ID
def Draw(self, viewport): self.viewport = viewport with LockViewport(self.viewport): DrawableManager.Draw(self, viewport) if self.hist: self.hist.Draw(viewport)
def Pop(self, ID): fit = DrawableManager.Pop(self, ID) if fit is not None: fit.spec = None return fit
def Insert(self, fit, ID=None): fit.spec = self return DrawableManager.Insert(self, fit, ID)
def __setattr__(self, name, value): if self.hist is not None: self.hist.__setattr__(name, value) if hasattr(self, name): # Update attribute of this class, if existent DrawableManager.__setattr__(self, name, value)
def __init__(self, histogram): # Create histogram attribute avoiding __setattr__ method self.__dict__["hist"] = histogram DrawableManager.__init__(self)