PyDVT.ExtendedGraphView (version 1.0)
index
/mntdirect/_bliss/users/gobbo/PyDVT/PyDVT/ExtendedGraphView.py

ExtendedGraphView.py
Derived from GraphView, 1D plotting class.
Add some functionnalities to GraphView :
        -       a status bar for visualizing on cursor's informations (position and under cursor pixel's value)
        -       some graph draw methods : graph draw design modification (change plot symbol,line style, color, width...) 
        -       some rois management methods : add, del, design customization (change roi name ; border style, color, width ; interior filling stripes, color). Also roi limits moving by click and drag
        -       some peaks management methods : add, del, design customization (change peak name ; peak line style, color, width). Also peaks moving by click and drag

 
Modules
            
Command
EventHandler
PyDVT.GraphViewSelect
Numeric
PyDVT
math
sys
types

 
Classes
            
PyDVT.GraphView.GraphView(PyDVT.View.View)
ExtendedGraphView
GraphViewPeak
GraphViewRoi

 
class ExtendedGraphView(PyDVT.GraphView.GraphView)
       
  
AddMenuPopupCascade(self, label, menu) from PyDVT.View.View
AddMenuPopupItem(self, label, Command, Style='command') from PyDVT.View.View
AddMenuSeparator(self) from PyDVT.View.View
ClearMenu(self) from PyDVT.View.View
ClearZoomSelect(self) from PyDVT.GraphView.GraphView
ClickOnGraphCB(self, graphName=None)
Callback of a click near a graph event : to be overidden for specific behavior
ClickOnPeakCB(self, peakName=None)
Callback of a click near a peak event : to be overidden for specific behavior
ClickOnRoiCB(self, roiName=None)
Callback of a click in a roi event : to be overidden for specific behavior
CreateDrawable(self)
View window creation, override it for customization
CreateExtendedMenu(self)
create mode menu
CreateMenu(self)
Create the standard GraphView menu
DataChanged(self, source=None)
################################
###     GRAPH MANAGEMENT     ###
################################
DataCoord2ImageCoord(self, data_coord) from PyDVT.View.View
DataCoord2ViewCoord(self, coord) from PyDVT.GraphView.GraphView
DelGraph(self, name=None)
delete the graph called 'name'
DelPeak(self, name='')
delete the peak which has the given name. Delete nothing if no peak has this name
DelRoi(self, name='')
Delete the roi with the given name
DeleteMenuItem(self, index) from PyDVT.View.View
Destroy(self, source=None) from PyDVT.View.View
DisableMenuItem(self, index) from PyDVT.View.View
DisableMode(self, mode='')
Calls a function to disable the specified mode with a name "DisableMode"+'mode'
DisableModePeak(self)
DisableModeRoi(self)
DisableModeZoom(self)
EnableLegend(self, enable, position='bottom') from PyDVT.GraphView.GraphView
EnableMenuItem(self, index) from PyDVT.View.View
EnableMode(self, mode='')
Calls a function to enable the specified mode with a name "EnableMode"+'mode'
EnableModePeak(self)
EnableModeRoi(self)
EnableModeZoom(self)
EventButtonPress(self, pos)
EventButtonPressMotion(self, pos)
EventButtonRelease(self, pos)
EventDoubleClick(self, pos)
display a popup with items properties
EventKeyPress(self, key, flags)
EventMotion(self, pos)
EventPeakSelection(self, source)
Virtual : Callback of a new peak selection : to be overidden for specific behavior
EventPosition(self, source)
When cursor is moved on the image, staus bar values are updated
EventRoiSelection(self, source)
Virtual : Callback of a new roi selection : to be overidden for specific behavior
EventZoomSelection(self, source)
Callback of a zoom box selection
GetActiveGraph(self)
return the active graph
GetActivePeak(self)
return the active peak (last which has been added for the moment)
GetActiveRoi(self)
return the active roi
GetClosestFunction(self, coord) from PyDVT.GraphView.GraphView
GetDrawable(self) from PyDVT.View.View
GetDrawableHeight(self) from PyDVT.View.View
GetDrawableWidth(self) from PyDVT.View.View
GetHeight(self) from PyDVT.GUIBinding.Binding.Container
GetPolarCoords(self, coords) from PyDVT.GraphView.GraphView
GetPopupMenu(self) from PyDVT.View.View
GetPosition(self, event) from PyDVT.GraphView.GraphView
GetPositionValues(self, position) from PyDVT.GraphView.GraphView
GetRois(self)
return a sequence containing all the displayed roi
GetSaveFormats(self) from PyDVT.GraphView.GraphView
GetSource(self) from PyDVT.View.View
GetWidth(self) from PyDVT.GUIBinding.Binding.Container
GetXAxis(self) from PyDVT.GraphView.GraphView
GetY2Axis(self) from PyDVT.GraphView.GraphView
GetYAxis(self) from PyDVT.GraphView.GraphView
HidePeaksNames(self)
hide all peaks labels
HideRoiName(self, name='')
hide the label of the roi called 'name'
HideRoisNames(self)
hide all rois labels
ImageCoord2DataCoord(self, view_coord) from PyDVT.View.View
InsideRoi(self, pos)
return the sequence of rois containing the graph position 'pos'. If None, return an empty sequence
Invalidate(self) from PyDVT.View.View
IsVisible(self) from PyDVT.GUIBinding.Binding.Container
LockPosition(self, value) from PyDVT.GraphView.GraphView
PutPeak(self, name='pk', pos=0, pen=<PyDVT.GUIBinding.Binding.Pen instance>)
Put a peak on the graph :
        -       name : name of the peak. If an existing peaqk has already this name, using the style existing-name'_x'
                                   where x is a integer.
        -       pos : the x position where to put the peak
        -       pen : the pen style used for drawing the peak
PutRoi(self, name='roi', limits=[], pen=<PyDVT.GUIBinding.Binding.Pen instance>, brush=<PyDVT.GUIBinding.Binding.Brush instance>)
Put a roi on the graph with the specified parametres :
        -       name : the name given to this roi. If an already existant roi have the same name, it will be renamed with an non existing name using the style existing-name'_x'
                                   where x is a integer.
        -       limits : the graph limits defining this roi : it's a sequence of min,max tuples
        -       pen : the pen style used for drawing the roi border
        -       brush : the brush style used for filling the roi
Once the roi has been added, it is set as the active one
Redraw(self) from PyDVT.GraphView.GraphView
Refresh(self) from PyDVT.View.View
ResetZoom(self) from PyDVT.GraphView.GraphView
Save(self, filename, format) from PyDVT.View.View
SetActiveGraph(self, name)
set the graph 'name' as the active one
SetActiveGraphPen(self, color=None, width=None, style=None)
changed the pen style used to highlight the active graph
Changes only the non None parameters
To disable active graph highlight, call this method without any parameter
SetActiveMode(self, mode='')
disable old active mode, and set the mode named 'mode' asa active
SetActivePeak(self, name)
make the peak called 'name' become the active one
SetActiveRoi(self, name='')
if existant, set the roi with a name of 'name' as the active one. Draws a red rectangle around it, and remove it on the old active one
SetCursor(self, cursor) from PyDVT.View.View
SetCursorType(self, cursortype) from PyDVT.GraphView.GraphView
SetFunctionYScale(self, name, yscale) from PyDVT.GraphView.GraphView
SetLabels(self, title_label=None, x_label=None, y_label=None, y2_label=None) from PyDVT.GraphView.GraphView
SetModeStatePeak(self, state)
# peak mode
SetModeStateRoi(self, state)
# Roi mode
SetModeStateZoom(self, state)
# Zoom mode
SetOnLine(self, value) from PyDVT.View.View
SetPen(self, name, pen) from PyDVT.GraphView.GraphView
SetPointer(self, pointer) from PyDVT.GUIBinding.Binding.Container
SetPolarEnv(self, value, rmax=None) from PyDVT.GraphView.GraphView
SetSize(self, width, height) from PyDVT.GUIBinding.Binding.Container
SetSource(self, source=()) from PyDVT.View.View
SetStyle(self, style) from PyDVT.GraphView.GraphView
SetSymbol(self, name, symbol) from PyDVT.GraphView.GraphView
SetXAxis(self, x_axis=None) from PyDVT.GraphView.GraphView
SetXScaleLinear(self) from PyDVT.GraphView.GraphView
SetXScaleLog(self, minval=1) from PyDVT.GraphView.GraphView
SetY2Axis(self, y2_axis=None) from PyDVT.GraphView.GraphView
SetYAxis(self, y_axis=None) from PyDVT.GraphView.GraphView
SetYScaleLinear(self) from PyDVT.GraphView.GraphView
SetYScaleLog(self, minval=9.9999999999999995e-07) from PyDVT.GraphView.GraphView
SetZoom(self, (x0, y0), (x1, y1)) from PyDVT.GraphView.GraphView
SetZoomStyle(self, pen=<PyDVT.GUIBinding.Binding.Pen instance>, brush=<PyDVT.GUIBinding.Binding.Brush instance>) from PyDVT.GraphView.GraphView
Show(self) from PyDVT.GUIBinding.Binding.Container
ShowPeakName(self, name)
show all peaks labels
ShowPeaksNames(self)
show all peaks labels
ShowRoiName(self, name='')
show the label of the roi called 'name'
ShowRoisNames(self)
show all rois labels
Update(self) from PyDVT.View.View
ViewCoord2DataCoord(self, coord) from PyDVT.GraphView.GraphView
ZoomTo(self) from PyDVT.GraphView.GraphView
_ButtonPress(self, event) from PyDVT.View.View
_ButtonPressMotion(self, event) from PyDVT.View.View
_ButtonRelease(self, event) from PyDVT.View.View
_ChangeGraphElementStyle(self, graphName, graphCnf)
callback of a GraphStyleDialog event
_ChangePeakStyle(self, peakName, (newPeakName, peakCnf))
callback of a PeakStyleDialog event
_ChangeRoiStyle(self, roiName, (newRoiName, roiFillCnf, roiBorderCnf))
callback of the event generated by the RoiStyleDialog
_CmdLockPosition(self) from PyDVT.View.View
_CmdOnLine(self) from PyDVT.View.View
_DataChanged(self, source=None) from PyDVT.View.View
_DataDeleted(self, source=None) from PyDVT.View.View
_DestroySelect(self)
_DoubleClick(self, event) from PyDVT.View.View
_DrawAxis(self, sels) from PyDVT.GraphView.GraphView
_EraseSelect(self)
_EventZoomSelection(self, source) from PyDVT.GraphView.GraphView
_KeyPress(self, key, flags=None) from PyDVT.View.View
_Motion(self, event) from PyDVT.View.View
_RedrawGraphItems(self)
update the graph items (roi, peaks) size, when the frame is resized for exemple
_RightButtonPress(self, event) from PyDVT.View.View
_SetCrosshairs(self)
_SetGridlines(self)
_SetPeak(self)
_SetRoi(self)
_SetZoom(self)
_ToggleLogX(self) from PyDVT.GraphView.GraphView
_ToggleLogY(self) from PyDVT.GraphView.GraphView
__init__(self, parent=None, pars={}, **kw)
Constructor
Evoluted 1D plotting class
parametres : 
        -       parent : parent widget
        -       pars : parametres' dictionnary. 
                                'StatusBar' : if 0, no status bar added. if 1 or not present in keys, displayed
                                'SelectionSensibility' : it represents the division of graph's screen around around a peak or a roi limit which permit to select it :
                                                                                                The width of the sensible to selection area is calculated as (xmin-xmax)/SelectionSensibility. So the bigger is SelectionSensibility, 
                                                                                                the smaller is the selecting area. Default is 20
                                'RoiSelection' : enable the roi selection mode. Default is on
                                'PeakSelection' : enable the peak selection mode. Default is on
                                'Legend' : if 0, no graph legend added. if 1 or not present in keys, displayed ##### not done yet for Qt
                 For details on other keys, see GraphView documentation
nearPeaks(self, pos)
return the sequence of peaks near the graph position 'pos'. If None, return an empty sequence
nearRoisLimit(self, pos)
return the sequence of roi near the graph position 'pos'. If None, return an empty sequence

 
class GraphViewPeak
      Class representing a graph's peak
 
  
HideName(self)
hide the peak name label
Move(self, pos)
move the peak to the given position
Redraw(self)
redraw the peak to fit to new graph size
SetName(self, name)
change the name attribute, and redraw it on the graph
SetPenValues(self, style=None, width=None, color=None)
change pen values and redraw it
ShowName(self)
show the peak name label
__init__(self, view, name='roi', pos=0, pen=<PyDVT.GUIBinding.Binding.Pen instance>)
Constructor
        -       view : view where the roi must be drawn
        -       pos : the position where to put the peak
        -       pen : the pen style used for drawing the peak

 
class GraphViewRoi
      Class representing a roi made on a graph
 
  
HideName(self)
hide the roi name labels
MoveLimit(self, oldLimit, newLimit)
changes the old limit for new one and redraw
Redraw(self)
redraw the roi to fit to new graph size
SetBrushValues(self, fill=None, color=None)
change brush values and redraw it
SetLimits(self, newLimits=[])
set new limits for tyhis roi. Format : newLimits = [(roi1min,roi1max),(roi2min,roi2max)]
SetName(self, name)
change the name attribute, and redraw it on the graph
SetPenValues(self, style=None, width=None, color=None)
change pen values and redraw it
ShowName(self)
show the roi name in in all rectangle
__init__(self, view, name='roi', limits=[], pen=<PyDVT.GUIBinding.Binding.Pen instance>, brush=<PyDVT.GUIBinding.Binding.Brush instance>)
Constructor
        -       view : view where the roi must be drawn
        -       limits : the graph limits defining this roi : it's a sequence of min,max tuples
        -       pen : the pen style used for drawing the roi border
        -       brush : the brush style used for filling the roi

 
Functions
            
addPeak()
addRoi()
delGraph()
delPeak()
delRoi()
disableActiveGraphHighlight()
enableActiveGraphHighlight()
hidePeakLabels()
hideRoiLabels()
showPeakLabels()
showRoiLabels()
test()

 
Author
             Nicolas PASCAL (pascal@esrf.fr)