GRASS Programmer's Manual
6.5.svn(2014)-r66266
|
A Buffered window class. More...
Public Member Functions | |
def | __init__ |
def | Draw |
Draws histogram or clears window. More... | |
def | OnPaint |
Draw psuedo DC to buffer. More... | |
def | OnSize |
Init image size to match window size. More... | |
def | OnIdle |
Only re-render a histogram image from GRASS during idle time instead of multiple times during resizing. More... | |
def | SaveToFile |
This will save the contents of the buffer to the specified file. More... | |
def | GetImage |
Converts files to wx.Image. More... | |
def | UpdateHist |
Update canvas if histogram options changes or window changes geometry. More... | |
def | EraseMap |
Erase the map display. More... | |
Data Fields | |
parent | |
Map | |
mapname | |
render | |
resize | |
dragimg | |
pen | |
mapfile | |
img | |
imagedict | |
pdc | |
A Buffered window class.
When the drawing needs to change, you app needs to call the UpdateHist() method. Since the drawing is stored in a bitmap, you can also save the drawing to file by calling the SaveToFile(self,file_name,file_type) method.
Definition at line 35 of file histogram.py.
def histogram.BufferedWindow.__init__ | ( | self, | |
parent, | |||
id = wx.ID_ANY , |
|||
style = wx.NO_FULL_REPAINT_ON_RESIZE , |
|||
Map = None , |
|||
kwargs | |||
) |
Definition at line 45 of file histogram.py.
def histogram.BufferedWindow.Draw | ( | self, | |
pdc, | |||
img = None , |
|||
drawid = None , |
|||
pdctype = 'image' , |
|||
coords = [0 |
|||
) |
Draws histogram or clears window.
Definition at line 85 of file histogram.py.
Referenced by frame.PsMapBufferedWindow.DrawGraphics(), histogram.BufferedWindow.EraseMap(), frame.PsMapBufferedWindow.OnDragging(), frame.PsMapBufferedWindow.OnLeftUp(), tools.PositionWindow.OnMouse(), tools.PositionWindow.PostDraw(), tools.LightPositionWindow.PostDraw(), histogram.BufferedWindow.SaveToFile(), wxnviz.Nviz.SaveToFile(), histogram.BufferedWindow.UpdateHist(), and frame.PsMapBufferedWindow.Zoom().
def histogram.BufferedWindow.EraseMap | ( | self | ) |
Erase the map display.
Definition at line 258 of file histogram.py.
References histogram.BufferedWindow.Draw(), mapwindow.BufferedWindow.Draw(), colorrules.BufferedWindow.Draw(), histogram.BufferedWindow.pdc, mapwindow.BufferedWindow.pdc, and colorrules.BufferedWindow.pdc.
def histogram.BufferedWindow.GetImage | ( | self | ) |
Converts files to wx.Image.
Definition at line 195 of file histogram.py.
References histogram.BufferedWindow.imagedict, and mapwindow.BufferedWindow.imagedict.
Referenced by histogram.BufferedWindow.OnSize(), histogram.BufferedWindow.SaveToFile(), and histogram.BufferedWindow.UpdateHist().
def histogram.BufferedWindow.OnIdle | ( | self, | |
event | |||
) |
Only re-render a histogram image from GRASS during idle time instead of multiple times during resizing.
Definition at line 163 of file histogram.py.
References histogram.BufferedWindow.render, colorrules.BufferedWindow.render, manager.GCPList.render, mapwindow.BufferedWindow.resize, histogram.BufferedWindow.resize, colorrules.BufferedWindow.resize, and histogram.BufferedWindow.UpdateHist().
def histogram.BufferedWindow.OnPaint | ( | self, | |
event | |||
) |
Draw psuedo DC to buffer.
Definition at line 121 of file histogram.py.
References histogram.BufferedWindow._buffer, and mapwindow.BufferedWindow._buffer.
def histogram.BufferedWindow.OnSize | ( | self, | |
event | |||
) |
Init image size to match window size.
Definition at line 140 of file histogram.py.
References histogram.BufferedWindow._buffer, mapwindow.BufferedWindow._buffer, histogram.BufferedWindow.GetImage(), mapwindow.BufferedWindow.GetImage(), colorrules.BufferedWindow.GetImage(), histogram.BufferedWindow.img, mapwindow.BufferedWindow.img, dialogs.RegionDef.img, colorrules.BufferedWindow.img, histogram.BufferedWindow.render, colorrules.BufferedWindow.render, manager.GCPList.render, mapwindow.BufferedWindow.resize, histogram.BufferedWindow.resize, colorrules.BufferedWindow.resize, and histogram.BufferedWindow.UpdateHist().
def histogram.BufferedWindow.SaveToFile | ( | self, | |
FileName, | |||
FileType, | |||
width, | |||
height | |||
) |
This will save the contents of the buffer to the specified file.
See the wx.Windows docs for wx.Bitmap::SaveFile for the details
Definition at line 172 of file histogram.py.
References histogram.BufferedWindow.Draw(), mapwindow.BufferedWindow.Draw(), colorrules.BufferedWindow.Draw(), histogram.BufferedWindow.GetImage(), mapwindow.BufferedWindow.GetImage(), colorrules.BufferedWindow.GetImage(), max, histogram.BufferedWindow.pdc, mapwindow.BufferedWindow.pdc, and colorrules.BufferedWindow.pdc.
def histogram.BufferedWindow.UpdateHist | ( | self, | |
img = None |
|||
) |
Update canvas if histogram options changes or window changes geometry.
Definition at line 207 of file histogram.py.
References histogram.BufferedWindow.Draw(), mapwindow.BufferedWindow.Draw(), colorrules.BufferedWindow.Draw(), histogram.BufferedWindow.GetImage(), mapwindow.BufferedWindow.GetImage(), colorrules.BufferedWindow.GetImage(), histogram.BufferedWindow.imagedict, mapwindow.BufferedWindow.imagedict, histogram.BufferedWindow.img, mapwindow.BufferedWindow.img, dialogs.RegionDef.img, colorrules.BufferedWindow.img, histogram.BufferedWindow.mapfile, mapwindow.BufferedWindow.mapfile, render.Layer.mapfile, render.Map.mapfile, colorrules.BufferedWindow.mapfile, histogram.BufferedWindow.pdc, mapwindow.BufferedWindow.pdc, colorrules.BufferedWindow.pdc, histogram.BufferedWindow.render, colorrules.BufferedWindow.render, manager.GCPList.render, mapwindow.BufferedWindow.resize, histogram.BufferedWindow.resize, and colorrules.BufferedWindow.resize.
Referenced by histogram.BufferedWindow.OnIdle(), and histogram.BufferedWindow.OnSize().
histogram.BufferedWindow.dragimg |
Definition at line 58 of file histogram.py.
histogram.BufferedWindow.imagedict |
Definition at line 74 of file histogram.py.
Referenced by histogram.BufferedWindow.GetImage(), and histogram.BufferedWindow.UpdateHist().
histogram.BufferedWindow.img |
Definition at line 72 of file histogram.py.
Referenced by histogram.BufferedWindow.OnSize(), and histogram.BufferedWindow.UpdateHist().
histogram.BufferedWindow.Map |
Definition at line 50 of file histogram.py.
Referenced by frame.MapFrame.AddNviz(), frame.MapFrame.AddToolbar(), and frame.MapFrame.GetMapWindow().
histogram.BufferedWindow.mapfile |
Definition at line 71 of file histogram.py.
Referenced by histogram.BufferedWindow.UpdateHist().
histogram.BufferedWindow.mapname |
Definition at line 51 of file histogram.py.
Referenced by histogram.HistogramFrame.OnOptions(), and histogram.HistogramFrame.SetHistLayer().
histogram.BufferedWindow.parent |
Definition at line 49 of file histogram.py.
Referenced by wxdigit.VDigitError.Database(), wxdigit.VDigitError.DbExecute(), wxdigit.VDigitError.DbLink(), wxdigit.VDigitError.DeadLine(), wxdigit.VDigitError.Driver(), wxdigit.VDigitError.FeatureType(), wxdigit.VDigitError.NoMap(), frame.PsMapBufferedWindow.OnLeftUp(), wxdigit.VDigitError.ReadLine(), and wxdigit.VDigitError.WriteLine().
histogram.BufferedWindow.pdc |
Definition at line 76 of file histogram.py.
Referenced by histogram.BufferedWindow.EraseMap(), histogram.BufferedWindow.SaveToFile(), and histogram.BufferedWindow.UpdateHist().
histogram.BufferedWindow.pen |
Definition at line 59 of file histogram.py.
Referenced by frame.PsMapBufferedWindow.OnDragging(), frame.PsMapBufferedWindow.OnLeftUp(), and frame.PsMapBufferedWindow.Zoom().
histogram.BufferedWindow.render |
Definition at line 56 of file histogram.py.
Referenced by mapwindow.GLWindow.DragItem(), mapwindow.GLWindow.FocusPanning(), mapwindow.GLWindow.GoTo(), mapwindow.GLWindow.HorizontalPanning(), mapwindow.GLWindow.OnDragging(), histogram.BufferedWindow.OnIdle(), mapwindow.GLWindow.OnKeyDown(), mapwindow.GLWindow.OnLeftUp(), mapwindow.GLWindow.OnPaint(), histogram.BufferedWindow.OnSize(), mapwindow.GLWindow.OnTimerFly(), and histogram.BufferedWindow.UpdateHist().
histogram.BufferedWindow.resize |
Definition at line 57 of file histogram.py.
Referenced by histogram.BufferedWindow.OnIdle(), histogram.BufferedWindow.OnSize(), and histogram.BufferedWindow.UpdateHist().