KiCad PCB EDA Suite
|
Canvas for plotting mpLayer implementations. More...
#include <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. More... | |
bool | AddLayer (mpLayer *layer, bool refreshDisplay=true) |
Add a plot layer to the canvas. More... | |
bool | DelLayer (mpLayer *layer, bool alsoDeleteObject=false, bool refreshDisplay=true) |
Remove a plot layer from the canvas. More... | |
void | DelAllLayers (bool alsoDeleteObject, bool refreshDisplay=true) |
Remove all layers from the plot. More... | |
mpLayer * | GetLayer (int position) |
mpLayer * | GetLayerByName (const wxString &name) |
double | GetXscl () |
Get current view's X scale. More... | |
double | GetScaleX (void) const |
double | GetYscl () const |
Get current view's Y scale. More... | |
double | GetScaleY (void) const |
double | GetXpos () const |
Get current view's X position. More... | |
double | GetPosX (void) const |
double | GetYpos () const |
Get current view's Y position. More... | |
double | GetPosY (void) const |
int | GetScrX (void) const |
Get current view's X dimension in device context units. More... | |
int | GetXScreen (void) const |
int | GetScrY (void) const |
Get current view's Y dimension in device context units. More... | |
int | GetYScreen (void) const |
void | SetScaleX (double scaleX) |
Set current view's X scale and refresh display. More... | |
void | SetScaleY (double scaleY) |
Set current view's Y scale and refresh display. More... | |
void | SetPosX (double posX) |
Set current view's X position and refresh display. More... | |
void | SetPosY (double posY) |
Set current view's Y position and refresh display. More... | |
void | SetPos (double posX, double posY) |
Set current view's X and Y position and refresh display. More... | |
void | SetScr (int scrX, int scrY) |
Set current view's dimensions in device context units. More... | |
double | p2x (wxCoord pixelCoordX) |
Converts mpWindow (screen) pixel coordinates into graph (floating point) coordinates, using current mpWindow position and scale. More... | |
double | p2y (wxCoord pixelCoordY) |
Converts mpWindow (screen) pixel coordinates into graph (floating point) coordinates, using current mpWindow position and scale. More... | |
wxCoord | x2p (double x) |
Converts graph (floating point) coordinates into mpWindow (screen) pixel coordinates, using current mpWindow position and scale. More... | |
wxCoord | y2p (double y) |
Converts graph (floating point) coordinates into mpWindow (screen) pixel coordinates, using current mpWindow position and scale. More... | |
void | EnableDoubleBuffer (bool enabled) |
Enable/disable the double-buffering of the window, eliminating the flicker (default=disabled). More... | |
void | EnableMousePanZoom (bool enabled) |
Enable/disable the feature of pan/zoom with the mouse (default=enabled) More... | |
void | LockAspect (bool enable=TRUE) |
Enable or disable X/Y scale aspect locking for the view. More... | |
bool | IsAspectLocked () |
Checks whether the X/Y scale aspect is locked. More... | |
void | Fit () override |
Set view to fit global bounding box of all plot layers and refresh display. More... | |
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. More... | |
void | ZoomIn (const wxPoint ¢erPoint=wxDefaultPosition) |
Zoom into current view and refresh display. More... | |
void | ZoomOut (const wxPoint ¢erPoint=wxDefaultPosition) |
Zoom out current view and refresh display. More... | |
void | ZoomInX () |
Zoom in current view along X and refresh display. More... | |
void | ZoomOutX () |
Zoom out current view along X and refresh display. More... | |
void | ZoomInY () |
Zoom in current view along Y and refresh display. More... | |
void | ZoomOutY () |
Zoom out current view along Y and refresh display. More... | |
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) More... | |
void | UpdateAll () |
Refresh display. More... | |
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. More... | |
unsigned int | CountAllLayers () |
Counts the number of plot layers, whether or not they have a bounding box. More... | |
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). More... | |
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). More... | |
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). More... | |
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). More... | |
void | GetBoundingBox (double *bbox) |
Returns the bounding box coordinates. More... | |
void | SetMPScrollbars (bool status) |
Enable/disable scrollbars. More... | |
bool | GetMPScrollbars () |
Get scrollbars status. More... | |
bool | SaveScreenshot (const wxString &filename, wxBitmapType type=wxBITMAP_TYPE_BMP, wxSize imageSize=wxDefaultSize, bool fit=false) |
Draw the window on a wxBitmap, then save it to a file. More... | |
void | SetMargins (int top, int right, int bottom, int left) |
Set window margins, creating a blank area where some kinds of layers cannot draw. More... | |
void | SetMarginTop (int top) |
Set the top margin. More... | |
void | SetMarginRight (int right) |
Set the right margin. More... | |
void | SetMarginBottom (int bottom) |
Set the bottom margin. More... | |
void | SetMarginLeft (int left) |
Set the left margin. More... | |
int | GetMarginTop () |
int | GetMarginRight () |
int | GetMarginBottom () |
int | GetMarginLeft () |
mpInfoLayer * | IsInsideInfoLayer (wxPoint &point) |
Check if a given point is inside the area of a mpInfoLayer and eventually returns its pointer. More... | |
void | SetLayerVisible (const wxString &name, bool viewable) |
Sets the visibility of a layer by its name. More... | |
bool | IsLayerVisible (const wxString &name) |
Check whether a layer with given name is visible. More... | |
void | SetLayerVisible (const unsigned int position, bool viewable) |
Sets the visibility of a layer by its position in layer list. More... | |
bool | IsLayerVisible (const unsigned int position) |
Check whether the layer at given position is visible. More... | |
void | SetColourTheme (const wxColour &bgColour, const wxColour &drawColour, const wxColour &axesColour) |
Set Color theme. More... | |
const wxColour & | GetAxesColour () |
Get axes draw colour. More... | |
void | LimitView (bool aEnable) |
Limit zooming & panning to the area used by the plots. More... | |
Static Public Attributes | |
static double | zoomIncrementalFactor = 1.5 |
This value sets the zoom steps whenever the user clicks "Zoom in/out" or performs zoom with the mouse wheel. More... | |
Protected Member Functions | |
void | OnPaint (wxPaintEvent &event) |
void | OnSize (wxSizeEvent &event) |
void | OnShowPopupMenu (wxMouseEvent &event) |
void | OnMouseMiddleDown (wxMouseEvent &event) |
void | OnCenter (wxCommandEvent &event) |
void | OnFit (wxCommandEvent &event) |
void | OnZoomIn (wxCommandEvent &event) |
void | OnZoomOut (wxCommandEvent &event) |
void | OnLockAspect (wxCommandEvent &event) |
void | OnMouseWheel (wxMouseEvent &event) |
void | OnMouseMove (wxMouseEvent &event) |
void | OnMouseLeftDown (wxMouseEvent &event) |
void | OnMouseLeftRelease (wxMouseEvent &event) |
void | OnScrollThumbTrack (wxScrollWinEvent &event) |
void | OnScrollPageUp (wxScrollWinEvent &event) |
void | OnScrollPageDown (wxScrollWinEvent &event) |
void | OnScrollLineUp (wxScrollWinEvent &event) |
void | OnScrollLineDown (wxScrollWinEvent &event) |
void | OnScrollTop (wxScrollWinEvent &event) |
void | OnScrollBottom (wxScrollWinEvent &event) |
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) |
bool | CheckXLimits (double &desiredMax, double &desiredMin) const |
bool | CheckYLimits (double &desiredMax, double &desiredMin) const |
void | AdjustLimitedView () |
virtual bool | UpdateBBox () |
Recalculate global layer bounding box, and save it in m_minX,... More... | |
virtual bool | SetXView (double pos, double desiredMax, double desiredMin) |
Applies new X view coordinates depending on the settings. More... | |
virtual bool | SetYView (double pos, double desiredMax, double desiredMin) |
Applies new Y view coordinates depending on the settings. More... | |
Protected Attributes | |
wxLayerList | m_layers |
wxMenu | m_popmenu |
bool | m_lockaspect |
wxColour | m_bgColour |
wxColour | m_fgColour |
wxColour | m_axColour |
double | m_minX |
double | m_maxX |
double | m_minY |
double | m_maxY |
double | m_scaleX |
double | m_scaleY |
double | m_posX |
double | m_posY |
int | m_scrX |
int | m_scrY |
int | m_clickedX |
int | m_clickedY |
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. More... | |
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 |
wxMemoryDC | m_buff_dc |
wxBitmap * | m_buff_bmp |
bool | m_enableDoubleBuffer |
bool | m_enableMouseNavigation |
bool | m_enableLimitedView |
wxPoint | m_mouseMClick |
wxPoint | m_mouseLClick |
bool | m_enableScrollBars |
wxPoint | m_scroll |
mpInfoLayer * | m_movingInfoLayer |
bool | m_zooming |
wxRect | m_zoomRect |
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 1043 of file mathplot.h.
|
inline |
mpWindow::mpWindow | ( | wxWindow * | parent, |
wxWindowID | id, | ||
const wxPoint & | pos = wxDefaultPosition , |
||
const wxSize & | size = wxDefaultSize , |
||
long | flags = 0 |
||
) |
mpWindow::~mpWindow | ( | ) |
Definition at line 1787 of file mathplot.cpp.
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. |
Definition at line 2466 of file mathplot.cpp.
Referenced by SIM_PLOT_PANEL::AddTrace(), SIM_PLOT_PANEL::EnableCursor(), and SIM_PLOT_PANEL::SIM_PLOT_PANEL().
|
protected |
Definition at line 2177 of file mathplot.cpp.
|
inlineprotected |
Definition at line 1442 of file mathplot.h.
|
inlineprotected |
Definition at line 1449 of file mathplot.h.
|
inline |
Counts the number of plot layers, whether or not they have a bounding box.
Definition at line 1276 of file mathplot.h.
Referenced by mpPrintout::OnPrintPage(), and mpInfoLegend::Plot().
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.
Definition at line 2997 of file mathplot.cpp.
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. |
Definition at line 2510 of file mathplot.cpp.
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!
Definition at line 2483 of file mathplot.cpp.
Referenced by SIM_PLOT_PANEL::AddTrace(), SIM_PLOT_PANEL::DeleteTrace(), and SIM_PLOT_PANEL::EnableCursor().
|
protected |
Definition at line 2861 of file mathplot.cpp.
|
protected |
Definition at line 2097 of file mathplot.cpp.
|
protected |
Definition at line 2117 of file mathplot.cpp.
|
protected |
Definition at line 2137 of file mathplot.cpp.
|
protected |
Definition at line 2157 of file mathplot.cpp.
|
inline |
Enable/disable the double-buffering of the window, eliminating the flicker (default=disabled).
Definition at line 1205 of file mathplot.h.
Referenced by SIM_PLOT_PANEL::SIM_PLOT_PANEL().
|
inline |
Enable/disable the feature of pan/zoom with the mouse (default=enabled)
Definition at line 1209 of file mathplot.h.
|
override |
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.
Definition at line 2006 of file mathplot.cpp.
Referenced by SIM_PLOT_FRAME::menuZoomFit(), mpPrintout::OnPrintPage(), and SIM_PLOT_FRAME::removePlot().
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.
Definition at line 2014 of file mathplot.cpp.
|
inline |
Get axes draw colour.
Definition at line 1401 of file mathplot.h.
Referenced by mpPrintout::OnPrintPage().
void mpWindow::GetBoundingBox | ( | double * | bbox | ) |
Returns the bounding box coordinates.
bbox | Pointer to a 6-element double array where to store bounding box coordinates. |
Definition at line 3035 of file mathplot.cpp.
|
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 1293 of file mathplot.h.
Referenced by mpPrintout::OnPrintPage().
|
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 1288 of file mathplot.h.
Referenced by mpPrintout::OnPrintPage().
|
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 1303 of file mathplot.h.
Referenced by mpPrintout::OnPrintPage().
|
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 1298 of file mathplot.h.
Referenced by mpPrintout::OnPrintPage().
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 |
Definition at line 3015 of file mathplot.cpp.
Referenced by mpPrintout::OnPrintPage(), and mpInfoLegend::Plot().
mpLayer * mpWindow::GetLayerByName | ( | const wxString & | name | ) |
Get the layer by its name (case sensitive).
name | The name of the layer to retrieve |
Definition at line 3024 of file mathplot.cpp.
|
inline |
Definition at line 1350 of file mathplot.h.
Referenced by mpScaleY::getVisibleDataRange(), CURSOR::Plot(), mpFX::Plot(), mpFY::Plot(), mpFXY::Plot(), mpProfile::Plot(), mpScaleXBase::Plot(), mpScaleY::Plot(), and mpText::Plot().
|
inline |
Definition at line 1352 of file mathplot.h.
Referenced by SIM_PLOT_PANEL::EnableCursor(), mpScaleXBase::getVisibleDataRange(), CURSOR::Plot(), mpFX::Plot(), mpFY::Plot(), mpFXY::Plot(), mpProfile::Plot(), mpScaleXBase::Plot(), mpScaleY::Plot(), and mpText::Plot().
|
inline |
Definition at line 1348 of file mathplot.h.
Referenced by SIM_PLOT_PANEL::EnableCursor(), mpScaleXBase::getVisibleDataRange(), CURSOR::Plot(), mpFX::Plot(), mpFY::Plot(), mpFXY::Plot(), mpProfile::Plot(), mpScaleXBase::Plot(), mpScaleY::Plot(), and mpText::Plot().
|
inline |
Definition at line 1346 of file mathplot.h.
Referenced by mpScaleY::getVisibleDataRange(), CURSOR::Plot(), mpFX::Plot(), mpFY::Plot(), mpFXY::Plot(), mpProfile::Plot(), mpScaleXBase::Plot(), mpScaleY::Plot(), and mpText::Plot().
|
inline |
Get scrollbars status.
Definition at line 1315 of file mathplot.h.
|
inline |
Get reference to context menu of the plot canvas.
Definition at line 1056 of file mathplot.h.
References GetLayer(), and name.
|
inline |
Definition at line 1116 of file mathplot.h.
Referenced by mpInfoLegend::Plot(), mpScaleXBase::Plot(), mpMovableObject::Plot(), and mpBitmapLayer::Plot().
|
inline |
Definition at line 1123 of file mathplot.h.
Referenced by mpInfoLegend::Plot(), mpScaleY::Plot(), mpMovableObject::Plot(), and mpBitmapLayer::Plot().
|
inline |
Definition at line 1102 of file mathplot.h.
Referenced by mpInfoLegend::Plot(), mpScaleXBase::Plot(), mpMovableObject::Plot(), and mpBitmapLayer::Plot().
|
inline |
Definition at line 1109 of file mathplot.h.
Referenced by mpInfoLegend::Plot(), mpScaleY::Plot(), mpMovableObject::Plot(), and mpBitmapLayer::Plot().
|
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 1131 of file mathplot.h.
Referenced by mpScaleXBase::getVisibleDataRange(), mpPrintout::OnPrintPage(), CURSOR::Plot(), mpInfoLayer::Plot(), mpInfoCoords::Plot(), mpInfoLegend::Plot(), mpFX::Plot(), mpFY::Plot(), mpFXY::Plot(), mpProfile::Plot(), mpScaleXBase::Plot(), mpScaleY::Plot(), mpText::Plot(), mpMovableObject::Plot(), and mpBitmapLayer::Plot().
|
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 1140 of file mathplot.h.
Referenced by mpScaleY::getVisibleDataRange(), mpPrintout::OnPrintPage(), CURSOR::Plot(), mpInfoLayer::Plot(), mpInfoCoords::Plot(), mpInfoLegend::Plot(), mpFX::Plot(), mpFY::Plot(), mpFXY::Plot(), mpProfile::Plot(), mpScaleXBase::Plot(), mpScaleY::Plot(), mpText::Plot(), mpMovableObject::Plot(), and mpBitmapLayer::Plot().
|
inline |
Get current view's X position.
See rules for coordinate transformation
Definition at line 1115 of file mathplot.h.
|
inline |
Get current view's X scale.
See rules for coordinate transformation
Definition at line 1101 of file mathplot.h.
|
inline |
|
inline |
Get current view's Y position.
See rules for coordinate transformation
Definition at line 1122 of file mathplot.h.
|
inline |
Get current view's Y scale.
See rules for coordinate transformation
Definition at line 1108 of file mathplot.h.
|
inline |
Definition at line 1141 of file mathplot.h.
|
inline |
Checks whether the X/Y scale aspect is locked.
TRUE | Locked |
FALSE | Unlocked |
Definition at line 1222 of file mathplot.h.
mpInfoLayer * mpWindow::IsInsideInfoLayer | ( | wxPoint & | point | ) |
Check if a given point is inside the area of a mpInfoLayer and eventually returns its pointer.
point | The position to be checked |
Definition at line 3110 of file mathplot.cpp.
References mpInfoLayer::Inside().
bool mpWindow::IsLayerVisible | ( | const wxString & | name | ) |
Check whether a layer with given name is visible.
name | The layer name |
Definition at line 3150 of file mathplot.cpp.
References mpLayer::IsVisible().
bool mpWindow::IsLayerVisible | ( | const unsigned int | position | ) |
Check whether the layer at given position is visible.
position | The layer position in layer list |
Definition at line 3170 of file mathplot.cpp.
References GetLayer(), and mpLayer::IsVisible().
|
inline |
Limit zooming & panning to the area used by the plots.
Definition at line 1404 of file mathplot.h.
Referenced by SIM_PLOT_PANEL::SIM_PLOT_PANEL().
void mpWindow::LockAspect | ( | bool | enable = TRUE | ) |
Enable or disable X/Y scale aspect locking for the view.
Definition at line 2404 of file mathplot.cpp.
References mpID_LOCKASPECT.
|
protected |
Definition at line 2434 of file mathplot.cpp.
|
protected |
Definition at line 2428 of file mathplot.cpp.
|
protected |
Definition at line 2422 of file mathplot.cpp.
|
protected |
Definition at line 1953 of file mathplot.cpp.
|
protected |
Definition at line 1976 of file mathplot.cpp.
|
protected |
Definition at line 1802 of file mathplot.cpp.
|
protected |
Definition at line 1853 of file mathplot.cpp.
References mpInfoLayer::GetRectangle(), and mpInfoLayer::UpdateInfo().
|
protected |
Definition at line 1811 of file mathplot.cpp.
|
protected |
Definition at line 2526 of file mathplot.cpp.
Referenced by mpScaleY::Plot().
|
protected |
Definition at line 2972 of file mathplot.cpp.
Referenced by mpScaleY::Plot().
|
protected |
Definition at line 2946 of file mathplot.cpp.
References mpSCROLL_NUM_PIXELS_PER_LINE.
Referenced by mpScaleY::Plot().
|
protected |
Definition at line 2930 of file mathplot.cpp.
References mpSCROLL_NUM_PIXELS_PER_LINE.
Referenced by mpScaleY::Plot().
|
protected |
Definition at line 2910 of file mathplot.cpp.
Referenced by mpScaleY::Plot().
|
protected |
Definition at line 2892 of file mathplot.cpp.
Referenced by mpScaleY::Plot().
|
protected |
Definition at line 2886 of file mathplot.cpp.
Referenced by mpScaleY::Plot().
|
protected |
Definition at line 2966 of file mathplot.cpp.
Referenced by mpScaleY::Plot().
|
protected |
Definition at line 2414 of file mathplot.cpp.
|
protected |
Definition at line 2456 of file mathplot.cpp.
Referenced by mpScaleY::Plot().
|
protected |
Definition at line 2444 of file mathplot.cpp.
|
protected |
Definition at line 2450 of file mathplot.cpp.
|
inline |
Converts mpWindow (screen) pixel coordinates into graph (floating point) coordinates, using current mpWindow position and scale.
Definition at line 1185 of file mathplot.h.
Referenced by mpScaleXBase::getVisibleDataRange(), CURSOR::Plot(), mpFX::Plot(), and mpProfile::Plot().
|
inline |
Converts mpWindow (screen) pixel coordinates into graph (floating point) coordinates, using current mpWindow position and scale.
Definition at line 1190 of file mathplot.h.
Referenced by mpScaleY::getVisibleDataRange(), and mpFY::Plot().
bool mpWindow::SaveScreenshot | ( | const wxString & | filename, |
wxBitmapType | 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 |
Definition at line 3044 of file mathplot.cpp.
Referenced by SIM_PLOT_FRAME::menuSaveImage().
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) |
Definition at line 3178 of file mathplot.cpp.
References mpLAYER_AXIS, and mpLAYER_INFO.
Referenced by mpPrintout::OnPrintPage(), and SIM_PLOT_PANEL::SIM_PLOT_PANEL().
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 |
Definition at line 3138 of file mathplot.cpp.
References mpLayer::SetVisible().
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 |
Definition at line 3158 of file mathplot.cpp.
References GetLayer(), and mpLayer::SetVisible().
|
inline |
|
inline |
|
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 |
Definition at line 3101 of file mathplot.cpp.
Referenced by SIM_PLOT_PANEL::SIM_PLOT_PANEL().
|
inline |
void mpWindow::SetMPScrollbars | ( | bool | status | ) |
Enable/disable scrollbars.
status | Set to true to show scrollbars |
Definition at line 2665 of file mathplot.cpp.
|
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 1173 of file mathplot.h.
|
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 1162 of file mathplot.h.
|
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 1167 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. |
Definition at line 2986 of file mathplot.cpp.
|
inline |
Set current view's Y scale and refresh display.
scaleY | New scale, must not be 0. |
Definition at line 1151 of file mathplot.h.
|
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 1180 of file mathplot.h.
|
protectedvirtual |
Applies new X view coordinates depending on the settings.
Definition at line 2221 of file mathplot.cpp.
|
protectedvirtual |
Applies new Y view coordinates depending on the settings.
Definition at line 2235 of file mathplot.cpp.
void mpWindow::UpdateAll | ( | ) |
Refresh display.
Definition at line 2814 of file mathplot.cpp.
References Refresh().
Referenced by SIM_PLOT_PANEL::AddTrace(), mpPrintout::OnPrintPage(), SIM_PLOT_FRAME::onSimFinished(), and SIM_PLOT_PANEL::SIM_PLOT_PANEL().
|
protectedvirtual |
Recalculate global layer bounding box, and save it in m_minX,...
Definition at line 2706 of file mathplot.cpp.
References mpLayer::GetMaxX(), mpLayer::GetMaxY(), mpLayer::GetMinX(), mpLayer::GetMinY(), and mpLayer::HasBBox().
|
inline |
Converts graph (floating point) coordinates into mpWindow (screen) pixel coordinates, using current mpWindow position and scale.
Definition at line 1195 of file mathplot.h.
Referenced by CURSOR::Plot(), mpFY::Plot(), mpFXY::Plot(), mpScaleY::Plot(), mpMovableObject::Plot(), and mpBitmapLayer::Plot().
|
inline |
Converts graph (floating point) coordinates into mpWindow (screen) pixel coordinates, using current mpWindow position and scale.
Definition at line 1200 of file mathplot.h.
Referenced by CURSOR::Plot(), mpFX::Plot(), mpFXY::Plot(), mpProfile::Plot(), mpScaleXBase::Plot(), mpMovableObject::Plot(), and mpBitmapLayer::Plot().
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). |
Definition at line 2249 of file mathplot.cpp.
References max, MAX_SCALE, min, wxPoint::x, and wxPoint::y.
Referenced by SIM_PLOT_FRAME::menuZoomIn().
void mpWindow::ZoomInX | ( | ) |
Zoom in current view along X and refresh display.
Definition at line 2353 of file mathplot.cpp.
void mpWindow::ZoomInY | ( | ) |
Zoom in current view along Y and refresh display.
Definition at line 2367 of file mathplot.cpp.
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). |
Definition at line 2306 of file mathplot.cpp.
References wxPoint::x, and wxPoint::y.
Referenced by SIM_PLOT_FRAME::menuZoomOut().
void mpWindow::ZoomOutX | ( | ) |
Zoom out current view along X and refresh display.
Definition at line 2360 of file mathplot.cpp.
void mpWindow::ZoomOutY | ( | ) |
Zoom out current view along Y and refresh display.
Definition at line 2374 of file mathplot.cpp.
Zoom view fitting given coordinates to the window (p0 and p1 do not need to be in any specific order)
Definition at line 2381 of file mathplot.cpp.
References wxPoint::x, and wxPoint::y.
|
protected |
Definition at line 1480 of file mathplot.h.
|
protected |
Definition at line 1478 of file mathplot.h.
|
protected |
Definition at line 1503 of file mathplot.h.
|
protected |
Definition at line 1502 of file mathplot.h.
|
protected |
Definition at line 1492 of file mathplot.h.
|
protected |
Definition at line 1493 of file mathplot.h.
|
protected |
Definition at line 1497 of file mathplot.h.
|
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 1497 of file mathplot.h.
|
protected |
Definition at line 1497 of file mathplot.h.
|
protected |
Definition at line 1497 of file mathplot.h.
|
protected |
Definition at line 1504 of file mathplot.h.
|
protected |
Definition at line 1506 of file mathplot.h.
|
protected |
Definition at line 1505 of file mathplot.h.
|
protected |
Definition at line 1509 of file mathplot.h.
|
protected |
Definition at line 1479 of file mathplot.h.
|
protected |
Definition at line 1501 of file mathplot.h.
|
protected |
Definition at line 1501 of file mathplot.h.
|
protected |
Definition at line 1474 of file mathplot.h.
|
protected |
Definition at line 1476 of file mathplot.h.
|
protected |
Definition at line 1499 of file mathplot.h.
|
protected |
Definition at line 1499 of file mathplot.h.
|
protected |
Definition at line 1499 of file mathplot.h.
|
protected |
Definition at line 1499 of file mathplot.h.
|
protected |
Definition at line 1483 of file mathplot.h.
|
protected |
Definition at line 1485 of file mathplot.h.
|
protected |
Definition at line 1482 of file mathplot.h.
|
protected |
Definition at line 1484 of file mathplot.h.
|
protected |
Definition at line 1508 of file mathplot.h.
|
protected |
Definition at line 1507 of file mathplot.h.
|
protected |
Definition at line 1511 of file mathplot.h.
|
protected |
Definition at line 1475 of file mathplot.h.
|
protected |
Definition at line 1488 of file mathplot.h.
|
protected |
Definition at line 1489 of file mathplot.h.
|
protected |
Definition at line 1486 of file mathplot.h.
|
protected |
Definition at line 1487 of file mathplot.h.
|
protected |
Definition at line 1510 of file mathplot.h.
|
protected |
Definition at line 1490 of file mathplot.h.
|
protected |
Definition at line 1491 of file mathplot.h.
|
protected |
Definition at line 1512 of file mathplot.h.
|
protected |
Definition at line 1513 of file mathplot.h.
|
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 1327 of file mathplot.h.