;iDddlmZmZddlmZdgZGddeZdS))QtCoreQtGui)GraphicsObjectUIGraphicsItemcLeZdZdZd dZdZdZdZddZd Z d Z d Z d Z dS)raU Base class for graphics items with boundaries relative to a GraphicsView or ViewBox. The purpose of this class is to allow the creation of GraphicsItems which live inside a scalable view, but whose boundaries will always stay fixed relative to the view's boundaries. For example: GridItem, InfiniteLine The view can be specified on initialization or it can be automatically detected when the item is painted. NOTE: Only the item's boundingRect is affected; the item is not transformed in any way. Use viewRangeChanged to respond to changes in the view. Nctj||||jj|t jdddd|_n||_d|_| dS)a ============== ============================================================================= **Arguments:** bounds QRectF with coordinates relative to view box. The default is QRectF(0,0,1,1), which means the item will have the same bounds as the view. ============== ============================================================================= Nr) r__init__setFlagGraphicsItemFlagItemSendsScenePositionChangesrQRectF_bounds _boundingRect _updateView)selfboundsparents ZC:\PYTHON\MyICR_Workspace\venv\Lib\site-packages\pyqtgraph/graphicsItems/UIGraphicsItem.pyr zUIGraphicsItem.__init__st f--- T*HIII >!=Aq!44DLL!DL! cdSNrargss rpaintzUIGraphicsItem.paint's  rcztj|||}||jjkr||Sr)r itemChangeGraphicsItemChangeItemScenePositionHasChanged setNewBounds)rchangevaluerets rrzUIGraphicsItem.itemChange,s>'fe<< T,H H H       rc|j0|}|tjS||_tj|jSr)rviewRectrr)rbrs r boundingRectzUIGraphicsItem.boundingRectMsD   %Bz}&%'"}T/000r?cdS)zyCalled by ViewBox for determining the auto-range bounds. By default, UIGraphicsItems are excluded from autoRange.Nr)raxisfrac orthoRanges r dataBoundszUIGraphicsItem.dataBoundsVs trcV||dS)z7Called when the view widget/viewbox is resized/rescaledN)r"updaters rviewRangeChangedzUIGraphicsItem.viewRangeChanged[s%  rc<d|_|dS)z5Update the item's bounding rect to match the viewportN)rprepareGeometryChanger2s rr"zUIGraphicsItem.setNewBounds`s"! ""$$$$$rcRtj|g|R|dSr)rsetPosr"rs rr7zUIGraphicsItem.setPosfs3d*T**** rc|}||}tj}|d|||}||S)z9Return the shape of this item after expanding by 2 pixelsr)shape mapToDevicerQPainterPathStrokersetWidh createStrokeunited mapFromDevice)rr9dsstrokerds2s r mouseShapezUIGraphicsItem.mouseShapejsw    e $ $+--""2&&--b11!!#&&&r)NN)r*N) __name__ __module__ __qualname____doc__r rrr)r/r3r"r7rCrrrrrs  &   B111  %%% '''''rN)Qtrrr__all__rrrrrJsu******  l'l'l'l'l'^l'l'l'l'l'r