Canvas for plotting mpLayer implementations.
This class defines a zoomable and moveable 2D plot canvas. Any number of mpLayer implementations (scale rulers, function plots, ...) can be attached using mpWindow::AddLayer.
The canvas window provides a context menu with actions for navigating the view. The context menu can be retrieved with mpWindow::GetPopupMenu, e.g. for extending it externally.
Since wxMathPlot version 0.03, the mpWindow incorporates the following features:
The mouse commands can be visualized by the user through the popup menu, and are:
Definition at line 833 of file mathplot.h.
#include <mrpt/otherlibs/mathplot/mathplot.h>
Public Member Functions | |
mpWindow () | |
mpWindow (wxWindow *parent, wxWindowID id, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long flags=0) | |
~mpWindow () | |
wxMenu * | GetPopupMenu () |
Get reference to context menu of the plot canvas. | |
bool | AddLayer (mpLayer *layer, bool refreshDisplay=true) |
Add a plot layer to the canvas. | |
bool | DelLayer (mpLayer *layer, bool alsoDeleteObject=false, bool refreshDisplay=true) |
Remove a plot layer from the canvas. | |
void | DelAllLayers (bool alsoDeleteObject, bool refreshDisplay=true) |
Remove all layers from the plot. | |
mpLayer * | GetLayer (int position) |
mpLayer * | GetLayerByName (const wxString &name) |
double | GetXscl () |
Get current view's X scale. | |
double | GetScaleX (void) const |
double | GetYscl () const |
Get current view's Y scale. | |
double | GetScaleY (void) const |
double | GetXpos () const |
Get current view's X position. | |
double | GetPosX (void) const |
double | GetYpos () const |
Get current view's Y position. | |
double | GetPosY (void) const |
int | GetScrX (void) const |
Get current view's X dimension in device context units. | |
int | GetXScreen (void) const |
int | GetScrY (void) const |
Get current view's Y dimension in device context units. | |
int | GetYScreen (void) const |
void | SetScaleX (double scaleX) |
Set current view's X scale and refresh display. | |
void | SetScaleY (double scaleY) |
Set current view's Y scale and refresh display. | |
void | SetPosX (double posX) |
Set current view's X position and refresh display. | |
void | SetPosY (double posY) |
Set current view's Y position and refresh display. | |
void | SetPos (double posX, double posY) |
Set current view's X and Y position and refresh display. | |
void | SetScr (int scrX, int scrY) |
Set current view's dimensions in device context units. | |
double | p2x (wxCoord pixelCoordX) |
Converts mpWindow (screen) pixel coordinates into graph (floating point) coordinates, using current mpWindow position and scale. | |
double | p2y (wxCoord pixelCoordY) |
Converts mpWindow (screen) pixel coordinates into graph (floating point) coordinates, using current mpWindow position and scale. | |
wxCoord | x2p (double x) |
Converts graph (floating point) coordinates into mpWindow (screen) pixel coordinates, using current mpWindow position and scale. | |
wxCoord | y2p (double y) |
Converts graph (floating point) coordinates into mpWindow (screen) pixel coordinates, using current mpWindow position and scale. | |
void | EnableDoubleBuffer (bool enabled) |
Enable/disable the double-buffering of the window, eliminating the flicker (default=disabled). | |
void | EnableMousePanZoom (bool enabled) |
Enable/disable the feature of pan/zoom with the mouse (default=enabled) | |
void | LockAspect (bool enable=TRUE) |
Enable or disable X/Y scale aspect locking for the view. | |
bool | IsAspectLocked () |
Checks whether the X/Y scale aspect is locked. | |
void | Fit () |
Set view to fit global bounding box of all plot layers and refresh display. | |
void | Fit (double xMin, double xMax, double yMin, double yMax, wxCoord *printSizeX=NULL, wxCoord *printSizeY=NULL) |
Set view to fit a given bounding box and refresh display. | |
void | ZoomIn (const wxPoint ¢erPoint=wxDefaultPosition) |
Zoom into current view and refresh display. | |
void | ZoomOut (const wxPoint ¢erPoint=wxDefaultPosition) |
Zoom out current view and refresh display. | |
void | ZoomInX () |
Zoom in current view along X and refresh display. | |
void | ZoomOutX () |
Zoom out current view along X and refresh display. | |
void | ZoomInY () |
Zoom in current view along Y and refresh display. | |
void | ZoomOutY () |
Zoom out current view along Y and refresh display. | |
void | ZoomRect (wxPoint p0, wxPoint p1) |
Zoom view fitting given coordinates to the window (p0 and p1 do not need to be in any specific order) | |
void | UpdateAll () |
Refresh display. | |
unsigned int | CountLayers () |
Counts the number of plot layers, excluding axes or text: this is to count only the layers which have a bounding box. | |
unsigned int | CountAllLayers () |
Counts the number of plot layers, whether or not they have a bounding box. | |
void | ShowPrintDialog () |
Draws the mpWindow on a page for printing. | |
double | GetDesiredXmin () |
Returns the left-border layer coordinate that the user wants the mpWindow to show (it may be not exactly the actual shown coordinate in the case of locked aspect ratio). | |
double | GetDesiredXmax () |
Returns the right-border layer coordinate that the user wants the mpWindow to show (it may be not exactly the actual shown coordinate in the case of locked aspect ratio). | |
double | GetDesiredYmin () |
Returns the bottom-border layer coordinate that the user wants the mpWindow to show (it may be not exactly the actual shown coordinate in the case of locked aspect ratio). | |
double | GetDesiredYmax () |
Returns the top layer-border coordinate that the user wants the mpWindow to show (it may be not exactly the actual shown coordinate in the case of locked aspect ratio). | |
void | GetBoundingBox (double *bbox) |
Returns the bounding box coordinates. | |
void | SetMPScrollbars (bool status) |
Enable/disable scrollbars. | |
bool | GetMPScrollbars () |
Get scrollbars status. | |
bool | SaveScreenshot (const wxString &filename, int type=wxBITMAP_TYPE_BMP, wxSize imageSize=wxDefaultSize, bool fit=false) |
Draw the window on a wxBitmap, then save it to a file. | |
void | SetMargins (int top, int right, int bottom, int left) |
Set window margins, creating a blank area where some kinds of layers cannot draw. | |
void | SetMarginTop (int top) |
Set the top margin. | |
void | SetMarginRight (int right) |
Set the right margin. | |
void | SetMarginBottom (int bottom) |
Set the bottom margin. | |
void | SetMarginLeft (int left) |
Set the left margin. | |
int | GetMarginTop () |
Get the top margin. | |
int | GetMarginRight () |
Get the right margin. | |
int | GetMarginBottom () |
Get the bottom margin. | |
int | GetMarginLeft () |
Get the left margin. | |
mpInfoLayer * | IsInsideInfoLayer (wxPoint &point) |
Sets whether to show coordinate tooltip when mouse passes over the plot. | |
void | SetLayerVisible (const wxString &name, bool viewable) |
Sets the visibility of a layer by its name. | |
bool | IsLayerVisible (const wxString &name) |
Check whether a layer with given name is visible. | |
void | SetLayerVisible (const unsigned int position, bool viewable) |
Sets the visibility of a layer by its position in layer list. | |
bool | IsLayerVisible (const unsigned int position) |
Check whether the layer at given position is visible. | |
void | SetColourTheme (const wxColour &bgColour, const wxColour &drawColour, const wxColour &axesColour) |
Set Color theme. | |
const wxColour & | GetAxesColour () |
Get axes draw colour. | |
Static Public Attributes | |
static double | zoomIncrementalFactor |
This value sets the zoom steps whenever the user clicks "Zoom in/out" or performs zoom with the mouse wheel. | |
Protected Member Functions | |
void | OnPaint (wxPaintEvent &event) |
Paint handler, will plot all attached layers. | |
void | OnSize (wxSizeEvent &event) |
Size handler, will update scroll bar sizes. | |
void | OnShowPopupMenu (wxMouseEvent &event) |
Mouse handler, will show context menu. | |
void | OnMouseRightDown (wxMouseEvent &event) |
Mouse handler, for detecting when the user drags with the right button or just "clicks" for the menu. | |
void | OnCenter (wxCommandEvent &event) |
Context menu handler. | |
void | OnFit (wxCommandEvent &event) |
Context menu handler. | |
void | OnZoomIn (wxCommandEvent &event) |
Context menu handler. | |
void | OnZoomOut (wxCommandEvent &event) |
Context menu handler. | |
void | OnLockAspect (wxCommandEvent &event) |
Context menu handler. | |
void | OnMouseHelp (wxCommandEvent &event) |
Context menu handler. | |
void | OnPrintMenu (wxCommandEvent &event) |
Context menu handler. | |
void | OnMouseWheel (wxMouseEvent &event) |
Mouse handler for the wheel. | |
void | OnMouseMove (wxMouseEvent &event) |
Mouse handler for mouse motion (for pan) | |
void | OnMouseLeftDown (wxMouseEvent &event) |
Mouse left click (for rect zoom) | |
void | OnMouseLeftRelease (wxMouseEvent &event) |
Mouse left click (for rect zoom) | |
void | OnScrollThumbTrack (wxScrollWinEvent &event) |
Scroll thumb on scroll bar moving. | |
void | OnScrollPageUp (wxScrollWinEvent &event) |
Scroll page up. | |
void | OnScrollPageDown (wxScrollWinEvent &event) |
Scroll page down. | |
void | OnScrollLineUp (wxScrollWinEvent &event) |
Scroll line up. | |
void | OnScrollLineDown (wxScrollWinEvent &event) |
Scroll line down. | |
void | OnScrollTop (wxScrollWinEvent &event) |
Scroll to top. | |
void | OnScrollBottom (wxScrollWinEvent &event) |
Scroll to bottom. | |
void | DoScrollCalc (const int position, const int orientation) |
void | DoZoomInXCalc (const int staticXpixel) |
void | DoZoomInYCalc (const int staticYpixel) |
void | DoZoomOutXCalc (const int staticXpixel) |
void | DoZoomOutYCalc (const int staticYpixel) |
virtual bool | UpdateBBox () |
Recalculate global layer bounding box, and save it in m_minX,... | |
Protected Attributes | |
wxLayerList | m_layers |
List of attached plot layers. | |
wxMenu | m_popmenu |
Canvas' context menu. | |
bool | m_lockaspect |
Scale aspect is locked or not. | |
wxColour | m_bgColour |
Background Colour. | |
wxColour | m_fgColour |
Foreground Colour. | |
wxColour | m_axColour |
Axes Colour. | |
double | m_minX |
Global layer bounding box, left border incl. | |
double | m_maxX |
Global layer bounding box, right border incl. | |
double | m_minY |
Global layer bounding box, bottom border incl. | |
double | m_maxY |
Global layer bounding box, top border incl. | |
double | m_scaleX |
Current view's X scale. | |
double | m_scaleY |
Current view's Y scale. | |
double | m_posX |
Current view's X position. | |
double | m_posY |
Current view's Y position. | |
int | m_scrX |
Current view's X dimension. | |
int | m_scrY |
Current view's Y dimension. | |
int | m_clickedX |
Last mouse click X position, for centering and zooming the view. | |
int | m_clickedY |
Last mouse click Y position, for centering and zooming the view. | |
double | m_desiredXmin |
These are updated in Fit() only, and may be different from the real borders (layer coordinates) only if lock aspect ratio is true. | |
double | m_desiredXmax |
double | m_desiredYmin |
double | m_desiredYmax |
int | m_marginTop |
int | m_marginRight |
int | m_marginBottom |
int | m_marginLeft |
int | m_last_lx |
int | m_last_ly |
For double buffering. | |
wxMemoryDC | m_buff_dc |
For double buffering. | |
wxBitmap * | m_buff_bmp |
For double buffering. | |
bool | m_enableDoubleBuffer |
For double buffering. | |
bool | m_enableMouseNavigation |
For pan/zoom with the mouse. | |
bool | m_mouseMovedAfterRightClick |
long | m_mouseRClick_X |
long | m_mouseRClick_Y |
For the right button "drag" feature. | |
int | m_mouseLClick_X |
int | m_mouseLClick_Y |
Starting coords for rectangular zoom selection. | |
bool | m_enableScrollBars |
int | m_scrollX |
int | m_scrollY |
mpInfoLayer * | m_movingInfoLayer |
For moving info layers over the window area. |
mpWindow::mpWindow | ( | ) | [inline] |
Definition at line 836 of file mathplot.h.
mpWindow::mpWindow | ( | wxWindow * | parent, |
wxWindowID | id, | ||
const wxPoint & | pos = wxDefaultPosition , |
||
const wxSize & | size = wxDefaultSize , |
||
long | flags = 0 |
||
) |
mpWindow::~mpWindow | ( | ) |
bool mpWindow::AddLayer | ( | mpLayer * | layer, |
bool | refreshDisplay = true |
||
) |
Add a plot layer to the canvas.
layer | Pointer to layer. The mpLayer object will get under control of mpWindow, i.e. it will be delete'd on mpWindow destruction |
refreshDisplay | States whether to refresh the display (UpdateAll) after adding the layer. |
TRUE | Success |
FALSE | Failure due to out of memory. |
unsigned int mpWindow::CountAllLayers | ( | ) | [inline] |
Counts the number of plot layers, whether or not they have a bounding box.
Definition at line 1056 of file mathplot.h.
unsigned int mpWindow::CountLayers | ( | ) |
Counts the number of plot layers, excluding axes or text: this is to count only the layers which have a bounding box.
void mpWindow::DelAllLayers | ( | bool | alsoDeleteObject, |
bool | refreshDisplay = true |
||
) |
Remove all layers from the plot.
alsoDeleteObject | If set to true, the mpLayer objects will be also "deleted", not just removed from the internal list. |
refreshDisplay | States whether to refresh the display (UpdateAll) after removing the layers. |
bool mpWindow::DelLayer | ( | mpLayer * | layer, |
bool | alsoDeleteObject = false , |
||
bool | refreshDisplay = true |
||
) |
Remove a plot layer from the canvas.
layer | Pointer to layer. The mpLayer object will be destructed using delete. |
alsoDeleteObject | If set to true, the mpLayer object will be also "deleted", not just removed from the internal list. |
refreshDisplay | States whether to refresh the display (UpdateAll) after removing the layer. |
N.B. Only the layer reference in the mpWindow is deleted, the layer object still exists!
void mpWindow::DoScrollCalc | ( | const int | position, |
const int | orientation | ||
) | [protected] |
void mpWindow::DoZoomInXCalc | ( | const int | staticXpixel ) | [protected] |
void mpWindow::DoZoomInYCalc | ( | const int | staticYpixel ) | [protected] |
void mpWindow::DoZoomOutXCalc | ( | const int | staticXpixel ) | [protected] |
void mpWindow::DoZoomOutYCalc | ( | const int | staticYpixel ) | [protected] |
void mpWindow::EnableDoubleBuffer | ( | bool | enabled ) | [inline] |
Enable/disable the double-buffering of the window, eliminating the flicker (default=disabled).
Definition at line 989 of file mathplot.h.
void mpWindow::EnableMousePanZoom | ( | bool | enabled ) | [inline] |
Enable/disable the feature of pan/zoom with the mouse (default=enabled)
Definition at line 993 of file mathplot.h.
void mpWindow::Fit | ( | ) |
Set view to fit global bounding box of all plot layers and refresh display.
Scale and position will be set to show all attached mpLayers. The X/Y scale aspect lock is taken into account.
void mpWindow::Fit | ( | double | xMin, |
double | xMax, | ||
double | yMin, | ||
double | yMax, | ||
wxCoord * | printSizeX = NULL , |
||
wxCoord * | printSizeY = NULL |
||
) |
Set view to fit a given bounding box and refresh display.
The X/Y scale aspect lock is taken into account. If provided, the parameters printSizeX and printSizeY are taken as the DC size, and the pixel scales are computed accordingly. Also, in this case the passed borders are not saved as the "desired borders", since this use will be invoked only when printing.
const wxColour& mpWindow::GetAxesColour | ( | ) | [inline] |
Get axes draw colour.
Definition at line 1175 of file mathplot.h.
void mpWindow::GetBoundingBox | ( | double * | bbox ) |
Returns the bounding box coordinates.
bbox | Pointer to a 6-element double array where to store bounding box coordinates. |
double mpWindow::GetDesiredXmax | ( | ) | [inline] |
Returns the right-border layer coordinate that the user wants the mpWindow to show (it may be not exactly the actual shown coordinate in the case of locked aspect ratio).
Definition at line 1077 of file mathplot.h.
double mpWindow::GetDesiredXmin | ( | ) | [inline] |
Returns the left-border layer coordinate that the user wants the mpWindow to show (it may be not exactly the actual shown coordinate in the case of locked aspect ratio).
Definition at line 1072 of file mathplot.h.
double mpWindow::GetDesiredYmax | ( | ) | [inline] |
Returns the top layer-border coordinate that the user wants the mpWindow to show (it may be not exactly the actual shown coordinate in the case of locked aspect ratio).
Definition at line 1087 of file mathplot.h.
double mpWindow::GetDesiredYmin | ( | ) | [inline] |
Returns the bottom-border layer coordinate that the user wants the mpWindow to show (it may be not exactly the actual shown coordinate in the case of locked aspect ratio).
Definition at line 1082 of file mathplot.h.
mpLayer* mpWindow::GetLayer | ( | int | position ) |
Get the layer in list position indicated. N.B. You must know the index of the layer inside the list!
position | position of the layer in the layers list |
mpLayer* mpWindow::GetLayerByName | ( | const wxString & | name ) |
Get the layer by its name (case sensitive).
name | The name of the layer to retrieve |
int mpWindow::GetMarginBottom | ( | ) | [inline] |
int mpWindow::GetMarginLeft | ( | ) | [inline] |
int mpWindow::GetMarginRight | ( | ) | [inline] |
int mpWindow::GetMarginTop | ( | ) | [inline] |
bool mpWindow::GetMPScrollbars | ( | ) | [inline] |
Get scrollbars status.
Definition at line 1099 of file mathplot.h.
wxMenu* mpWindow::GetPopupMenu | ( | ) | [inline] |
Get reference to context menu of the plot canvas.
Definition at line 846 of file mathplot.h.
double mpWindow::GetPosX | ( | void | ) | const [inline] |
Definition at line 906 of file mathplot.h.
double mpWindow::GetPosY | ( | void | ) | const [inline] |
Definition at line 913 of file mathplot.h.
double mpWindow::GetScaleX | ( | void | ) | const [inline] |
Definition at line 892 of file mathplot.h.
double mpWindow::GetScaleY | ( | void | ) | const [inline] |
Definition at line 899 of file mathplot.h.
int mpWindow::GetScrX | ( | void | ) | const [inline] |
Get current view's X dimension in device context units.
Usually this is equal to wxDC::GetSize, but it might differ thus mpLayer implementations should rely on the value returned by the function. See rules for coordinate transformation
Definition at line 921 of file mathplot.h.
int mpWindow::GetScrY | ( | void | ) | const [inline] |
Get current view's Y dimension in device context units.
Usually this is equal to wxDC::GetSize, but it might differ thus mpLayer implementations should rely on the value returned by the function. See rules for coordinate transformation
Definition at line 930 of file mathplot.h.
double mpWindow::GetXpos | ( | ) | const [inline] |
Get current view's X position.
See rules for coordinate transformation
Definition at line 905 of file mathplot.h.
double mpWindow::GetXscl | ( | ) | [inline] |
Get current view's X scale.
See rules for coordinate transformation
Definition at line 891 of file mathplot.h.
int mpWindow::GetXScreen | ( | void | ) | const [inline] |
Definition at line 922 of file mathplot.h.
double mpWindow::GetYpos | ( | ) | const [inline] |
Get current view's Y position.
See rules for coordinate transformation
Definition at line 912 of file mathplot.h.
double mpWindow::GetYscl | ( | ) | const [inline] |
Get current view's Y scale.
See rules for coordinate transformation
Definition at line 898 of file mathplot.h.
int mpWindow::GetYScreen | ( | void | ) | const [inline] |
Definition at line 931 of file mathplot.h.
bool mpWindow::IsAspectLocked | ( | ) | [inline] |
Checks whether the X/Y scale aspect is locked.
TRUE | Locked |
FALSE | Unlocked |
Definition at line 1006 of file mathplot.h.
mpInfoLayer* mpWindow::IsInsideInfoLayer | ( | wxPoint & | point ) |
Sets whether to show coordinate tooltip when mouse passes over the plot.
value | true for enable, false for disable Gets coordinate tooltip status. |
point | The position to be checked |
bool mpWindow::IsLayerVisible | ( | const wxString & | name ) |
Check whether a layer with given name is visible.
name | The layer name |
bool mpWindow::IsLayerVisible | ( | const unsigned int | position ) |
Check whether the layer at given position is visible.
position | The layer position in layer list |
void mpWindow::LockAspect | ( | bool | enable = TRUE ) |
Enable or disable X/Y scale aspect locking for the view.
void mpWindow::OnCenter | ( | wxCommandEvent & | event ) | [protected] |
Context menu handler.
void mpWindow::OnFit | ( | wxCommandEvent & | event ) | [protected] |
Context menu handler.
void mpWindow::OnLockAspect | ( | wxCommandEvent & | event ) | [protected] |
Context menu handler.
void mpWindow::OnMouseHelp | ( | wxCommandEvent & | event ) | [protected] |
Context menu handler.
void mpWindow::OnMouseLeftDown | ( | wxMouseEvent & | event ) | [protected] |
Mouse left click (for rect zoom)
void mpWindow::OnMouseLeftRelease | ( | wxMouseEvent & | event ) | [protected] |
Mouse left click (for rect zoom)
void mpWindow::OnMouseMove | ( | wxMouseEvent & | event ) | [protected] |
Mouse handler for mouse motion (for pan)
void mpWindow::OnMouseRightDown | ( | wxMouseEvent & | event ) | [protected] |
Mouse handler, for detecting when the user drags with the right button or just "clicks" for the menu.
void mpWindow::OnMouseWheel | ( | wxMouseEvent & | event ) | [protected] |
Mouse handler for the wheel.
void mpWindow::OnPaint | ( | wxPaintEvent & | event ) | [protected] |
Paint handler, will plot all attached layers.
void mpWindow::OnPrintMenu | ( | wxCommandEvent & | event ) | [protected] |
Context menu handler.
void mpWindow::OnScrollBottom | ( | wxScrollWinEvent & | event ) | [protected] |
Scroll to bottom.
void mpWindow::OnScrollLineDown | ( | wxScrollWinEvent & | event ) | [protected] |
Scroll line down.
void mpWindow::OnScrollLineUp | ( | wxScrollWinEvent & | event ) | [protected] |
Scroll line up.
void mpWindow::OnScrollPageDown | ( | wxScrollWinEvent & | event ) | [protected] |
Scroll page down.
void mpWindow::OnScrollPageUp | ( | wxScrollWinEvent & | event ) | [protected] |
Scroll page up.
void mpWindow::OnScrollThumbTrack | ( | wxScrollWinEvent & | event ) | [protected] |
Scroll thumb on scroll bar moving.
void mpWindow::OnScrollTop | ( | wxScrollWinEvent & | event ) | [protected] |
Scroll to top.
void mpWindow::OnShowPopupMenu | ( | wxMouseEvent & | event ) | [protected] |
Mouse handler, will show context menu.
void mpWindow::OnSize | ( | wxSizeEvent & | event ) | [protected] |
Size handler, will update scroll bar sizes.
void mpWindow::OnZoomIn | ( | wxCommandEvent & | event ) | [protected] |
Context menu handler.
void mpWindow::OnZoomOut | ( | wxCommandEvent & | event ) | [protected] |
Context menu handler.
double mpWindow::p2x | ( | wxCoord | pixelCoordX ) | [inline] |
double mpWindow::p2y | ( | wxCoord | pixelCoordY ) | [inline] |
bool mpWindow::SaveScreenshot | ( | const wxString & | filename, |
int | type = wxBITMAP_TYPE_BMP , |
||
wxSize | imageSize = wxDefaultSize , |
||
bool | fit = false |
||
) |
Draw the window on a wxBitmap, then save it to a file.
filename | File name where to save the screenshot |
type | image type to be saved: see wxImage output file types for flags |
imageSize | Set a size for the output image. Default is the same as the screen size |
fit | Decide whether to fit the plot into the size |
void mpWindow::SetColourTheme | ( | const wxColour & | bgColour, |
const wxColour & | drawColour, | ||
const wxColour & | axesColour | ||
) |
Set Color theme.
Provide colours to set a new colour theme.
bgColour | Background colour |
drawColour | The colour used to draw all elements in foreground, axes excluded |
axesColour | The colour used to draw axes (but not their labels) |
void mpWindow::SetLayerVisible | ( | const wxString & | name, |
bool | viewable | ||
) |
Sets the visibility of a layer by its name.
name | The layer name to set visibility |
viewable | the view status to be set |
void mpWindow::SetLayerVisible | ( | const unsigned int | position, |
bool | viewable | ||
) |
Sets the visibility of a layer by its position in layer list.
position | The layer position in layer list |
viewable | the view status to be set |
void mpWindow::SetMarginBottom | ( | int | bottom ) | [inline] |
void mpWindow::SetMarginLeft | ( | int | left ) | [inline] |
void mpWindow::SetMarginRight | ( | int | right ) | [inline] |
void mpWindow::SetMargins | ( | int | top, |
int | right, | ||
int | bottom, | ||
int | left | ||
) |
Set window margins, creating a blank area where some kinds of layers cannot draw.
This is useful for example to draw axes outside the area where the plots are drawn.
top | Top border |
right | Right border |
bottom | Bottom border |
left | Left border |
void mpWindow::SetMarginTop | ( | int | top ) | [inline] |
void mpWindow::SetMPScrollbars | ( | bool | status ) |
Enable/disable scrollbars.
status | Set to true to show scrollbars |
void mpWindow::SetPos | ( | double | posX, |
double | posY | ||
) | [inline] |
Set current view's X and Y position and refresh display.
posX | New position that corresponds to the center point of the view. |
posY | New position that corresponds to the center point of the view. |
Definition at line 957 of file mathplot.h.
void mpWindow::SetPosX | ( | double | posX ) | [inline] |
Set current view's X position and refresh display.
posX | New position that corresponds to the center point of the view. |
Definition at line 946 of file mathplot.h.
void mpWindow::SetPosY | ( | double | posY ) | [inline] |
Set current view's Y position and refresh display.
posY | New position that corresponds to the center point of the view. |
Definition at line 951 of file mathplot.h.
void mpWindow::SetScaleX | ( | double | scaleX ) |
Set current view's X scale and refresh display.
scaleX | New scale, must not be 0. |
void mpWindow::SetScaleY | ( | double | scaleY ) | [inline] |
Set current view's Y scale and refresh display.
scaleY | New scale, must not be 0. |
Definition at line 941 of file mathplot.h.
void mpWindow::SetScr | ( | int | scrX, |
int | scrY | ||
) | [inline] |
Set current view's dimensions in device context units.
Needed by plotting functions. It doesn't refresh display.
scrX | New position that corresponds to the center point of the view. |
scrY | New position that corresponds to the center point of the view. |
Definition at line 964 of file mathplot.h.
void mpWindow::ShowPrintDialog | ( | ) | [inline] |
Draws the mpWindow on a page for printing.
the mpPrintout where to print the graph |
Definition at line 1062 of file mathplot.h.
void mpWindow::UpdateAll | ( | ) |
Refresh display.
virtual bool mpWindow::UpdateBBox | ( | ) | [protected, virtual] |
Recalculate global layer bounding box, and save it in m_minX,...
wxCoord mpWindow::x2p | ( | double | x ) | [inline] |
wxCoord mpWindow::y2p | ( | double | y ) | [inline] |
Converts graph (floating point) coordinates into mpWindow (screen) pixel coordinates, using current mpWindow position and scale.
Definition at line 984 of file mathplot.h.
References internal::y.
void mpWindow::ZoomIn | ( | const wxPoint & | centerPoint = wxDefaultPosition ) |
Zoom into current view and refresh display.
centerPoint | The point (pixel coordinates) that will stay in the same position on the screen after the zoom (by default, the center of the mpWindow). |
void mpWindow::ZoomInX | ( | ) |
Zoom in current view along X and refresh display.
void mpWindow::ZoomInY | ( | ) |
Zoom in current view along Y and refresh display.
void mpWindow::ZoomOut | ( | const wxPoint & | centerPoint = wxDefaultPosition ) |
Zoom out current view and refresh display.
centerPoint | The point (pixel coordinates) that will stay in the same position on the screen after the zoom (by default, the center of the mpWindow). |
void mpWindow::ZoomOutX | ( | ) |
Zoom out current view along X and refresh display.
void mpWindow::ZoomOutY | ( | ) |
Zoom out current view along Y and refresh display.
void mpWindow::ZoomRect | ( | wxPoint | p0, |
wxPoint | p1 | ||
) |
Zoom view fitting given coordinates to the window (p0 and p1 do not need to be in any specific order)
wxColour mpWindow::m_axColour [protected] |
Axes Colour.
Definition at line 1221 of file mathplot.h.
wxColour mpWindow::m_bgColour [protected] |
Background Colour.
Definition at line 1219 of file mathplot.h.
wxBitmap* mpWindow::m_buff_bmp [protected] |
For double buffering.
Definition at line 1244 of file mathplot.h.
wxMemoryDC mpWindow::m_buff_dc [protected] |
For double buffering.
Definition at line 1243 of file mathplot.h.
int mpWindow::m_clickedX [protected] |
Last mouse click X position, for centering and zooming the view.
Definition at line 1233 of file mathplot.h.
int mpWindow::m_clickedY [protected] |
Last mouse click Y position, for centering and zooming the view.
Definition at line 1234 of file mathplot.h.
double mpWindow::m_desiredXmax [protected] |
Definition at line 1238 of file mathplot.h.
double mpWindow::m_desiredXmin [protected] |
These are updated in Fit() only, and may be different from the real borders (layer coordinates) only if lock aspect ratio is true.
Definition at line 1238 of file mathplot.h.
double mpWindow::m_desiredYmax [protected] |
Definition at line 1238 of file mathplot.h.
double mpWindow::m_desiredYmin [protected] |
Definition at line 1238 of file mathplot.h.
bool mpWindow::m_enableDoubleBuffer [protected] |
For double buffering.
Definition at line 1245 of file mathplot.h.
bool mpWindow::m_enableMouseNavigation [protected] |
For pan/zoom with the mouse.
Definition at line 1246 of file mathplot.h.
bool mpWindow::m_enableScrollBars [protected] |
Definition at line 1250 of file mathplot.h.
wxColour mpWindow::m_fgColour [protected] |
Foreground Colour.
Definition at line 1220 of file mathplot.h.
int mpWindow::m_last_lx [protected] |
Definition at line 1242 of file mathplot.h.
int mpWindow::m_last_ly [protected] |
For double buffering.
Definition at line 1242 of file mathplot.h.
wxLayerList mpWindow::m_layers [protected] |
List of attached plot layers.
Definition at line 1215 of file mathplot.h.
bool mpWindow::m_lockaspect [protected] |
Scale aspect is locked or not.
Definition at line 1217 of file mathplot.h.
int mpWindow::m_marginBottom [protected] |
Definition at line 1240 of file mathplot.h.
int mpWindow::m_marginLeft [protected] |
Definition at line 1240 of file mathplot.h.
int mpWindow::m_marginRight [protected] |
Definition at line 1240 of file mathplot.h.
int mpWindow::m_marginTop [protected] |
Definition at line 1240 of file mathplot.h.
double mpWindow::m_maxX [protected] |
Global layer bounding box, right border incl.
Definition at line 1224 of file mathplot.h.
double mpWindow::m_maxY [protected] |
Global layer bounding box, top border incl.
Definition at line 1226 of file mathplot.h.
double mpWindow::m_minX [protected] |
Global layer bounding box, left border incl.
Definition at line 1223 of file mathplot.h.
double mpWindow::m_minY [protected] |
Global layer bounding box, bottom border incl.
Definition at line 1225 of file mathplot.h.
int mpWindow::m_mouseLClick_X [protected] |
Definition at line 1249 of file mathplot.h.
int mpWindow::m_mouseLClick_Y [protected] |
Starting coords for rectangular zoom selection.
Definition at line 1249 of file mathplot.h.
bool mpWindow::m_mouseMovedAfterRightClick [protected] |
Definition at line 1247 of file mathplot.h.
long mpWindow::m_mouseRClick_X [protected] |
Definition at line 1248 of file mathplot.h.
long mpWindow::m_mouseRClick_Y [protected] |
For the right button "drag" feature.
Definition at line 1248 of file mathplot.h.
mpInfoLayer* mpWindow::m_movingInfoLayer [protected] |
For moving info layers over the window area.
Definition at line 1252 of file mathplot.h.
wxMenu mpWindow::m_popmenu [protected] |
Canvas' context menu.
Definition at line 1216 of file mathplot.h.
double mpWindow::m_posX [protected] |
Current view's X position.
Definition at line 1229 of file mathplot.h.
double mpWindow::m_posY [protected] |
Current view's Y position.
Definition at line 1230 of file mathplot.h.
double mpWindow::m_scaleX [protected] |
Current view's X scale.
Definition at line 1227 of file mathplot.h.
double mpWindow::m_scaleY [protected] |
Current view's Y scale.
Definition at line 1228 of file mathplot.h.
int mpWindow::m_scrollX [protected] |
Definition at line 1251 of file mathplot.h.
int mpWindow::m_scrollY [protected] |
Definition at line 1251 of file mathplot.h.
int mpWindow::m_scrX [protected] |
Current view's X dimension.
Definition at line 1231 of file mathplot.h.
int mpWindow::m_scrY [protected] |
Current view's Y dimension.
Definition at line 1232 of file mathplot.h.
double mpWindow::zoomIncrementalFactor [static] |
This value sets the zoom steps whenever the user clicks "Zoom in/out" or performs zoom with the mouse wheel.
It must be a number above unity. This number is used for zoom in, and its inverse for zoom out. Set to 1.5 by default.
Definition at line 1110 of file mathplot.h.
Page generated by Doxygen 1.7.2 for MRPT 0.9.4 SVN: at Mon Jan 10 22:46:17 UTC 2011 |