13#ifndef _MP_MATHPLOT_H_
14#define _MP_MATHPLOT_H_
57#ifdef mathplot_EXPORTS
58#define WXDLLIMPEXP_MATHPLOT WXEXPORT
59#define WXDLLIMPEXP_DATA_MATHPLOT( type ) WXEXPORT type
61#define WXDLLIMPEXP_MATHPLOT
62#define WXDLLIMPEXP_DATA_MATHPLOT( type ) type
69#include <wx/scrolwin.h>
71#include <wx/dynarray.h>
73#include <wx/dcmemory.h>
87#define DEBUG_NEW new (_NORMAL_BLOCK, __FILE__, __LINE__)
94#define X_BORDER_SEPARATION 40
95#define Y_BORDER_SEPARATION 60
170 virtual bool IsInfo()
const {
return false; };
175 virtual double GetMinX()
const {
return -1.0; }
180 virtual double GetMaxX()
const {
return 1.0; }
185 virtual double GetMinY()
const {
return -1.0; }
190 virtual double GetMaxY()
const {
return 1.0; }
238 const wxString&
GetName()
const {
return m_name; }
243 const wxFont&
GetFont()
const {
return m_font; }
248 const wxPen&
GetPen()
const {
return m_pen; }
272 void SetFont( wxFont& font ) { m_font = font; }
277 void SetPen( wxPen pen ) { m_pen = pen; }
290 wxBitmap GetColourSquare(
int side = 16 )
const;
306 const wxBrush&
GetBrush()
const {
return m_brush; };
310 void SetBrush( wxBrush brush ) { m_brush = brush; };
323 DECLARE_DYNAMIC_CLASS(
mpLayer )
344 mpInfoLayer( wxRect rect,
const wxBrush* brush = wxTRANSPARENT_BRUSH );
353 virtual void UpdateInfo(
mpWindow& w, wxEvent& event );
357 virtual bool HasBBox()
const override {
return false; }
363 virtual void Plot( wxDC& dc,
mpWindow& w )
override;
368 virtual bool IsInfo()
const override {
return true; }
373 virtual bool Inside(
const wxPoint& point )
const;
377 virtual void Move( wxPoint
delta );
380 virtual void UpdateReference();
384 wxPoint GetPosition()
const;
388 wxSize GetSize()
const;
414 mpInfoCoords( wxRect rect,
const wxBrush* brush = wxTRANSPARENT_BRUSH );
422 virtual void UpdateInfo(
mpWindow& w, wxEvent& event )
override;
428 virtual void Plot( wxDC& dc,
mpWindow& w )
override;
447 mpInfoLegend( wxRect rect,
const wxBrush* brush = wxTRANSPARENT_BRUSH );
455 virtual void UpdateInfo(
mpWindow& w, wxEvent& event )
override;
461 virtual void Plot( wxDC& dc,
mpWindow& w )
override;
475#define mpALIGNMASK 0x03
477#define mpALIGN_RIGHT 0x00
479#define mpALIGN_CENTER 0x01
481#define mpALIGN_LEFT 0x02
483#define mpALIGN_TOP mpALIGN_RIGHT
485#define mpALIGN_BOTTOM mpALIGN_LEFT
487#define mpALIGN_BORDER_BOTTOM 0x04
489#define mpALIGN_BORDER_TOP 0x05
491#define mpALIGN_FAR_RIGHT 0x06
493#define mpX_NORMAL 0x00
497#define mpX_HOURS 0x02
501#define mpX_DATETIME 0x04
503#define mpALIGN_BORDER_LEFT mpALIGN_BORDER_BOTTOM
505#define mpALIGN_BORDER_RIGHT mpALIGN_BORDER_TOP
507#define mpALIGN_NE 0x00
509#define mpALIGN_NW 0x01
511#define mpALIGN_SW 0x02
513#define mpALIGN_SE 0x03
538 virtual double GetY(
double x )
const = 0;
544 virtual void Plot( wxDC& dc,
mpWindow& w )
override;
549 DECLARE_DYNAMIC_CLASS(
mpFX )
570 virtual double GetX(
double y )
const = 0;
576 virtual void Plot( wxDC& dc,
mpWindow& w )
override;
581 DECLARE_DYNAMIC_CLASS(
mpFY )
617 virtual void Plot( wxDC& dc,
mpWindow& w )
override;
623 double s2x(
double plotCoordX )
const;
624 double s2y(
double plotCoordY )
const;
626 double x2s(
double x )
const;
627 double y2s(
double y )
const;
641 void UpdateViewBoundary( wxCoord xnew, wxCoord ynew );
643 DECLARE_DYNAMIC_CLASS(
mpFXY )
665 virtual double GetY(
double x )
const = 0;
671 virtual void Plot( wxDC& dc,
mpWindow& w )
override;
703 bool HasBBox()
const override {
return false; }
716 void SetTicks(
bool enable ) { m_ticks = enable; };
750 m_minV = std::min( minV, m_minV );
751 m_maxV = std::max( maxV, m_maxV );
754 if( m_minV == m_maxV )
756 m_minV = m_minV - 1.0;
757 m_maxV = m_maxV + 1.0;
773 return m_absVisibleMaxV;
781 TickLabel(
double pos_ = 0.0,
const wxString& label_ = wxT(
"") ) :
782 pos( pos_ ), label( label_ ), pixelPos( 0 ), visible( true )
791 std::vector<TickLabel>&
TickLabels() {
return m_tickLabels; };
795 void updateTickLabels( wxDC& dc,
mpWindow& w );
796 void computeLabelExtents( wxDC& dc,
mpWindow& w );
804 return m_tickValues.size();
809 return m_tickLabels.size();
812 virtual const wxString
formatLabel(
double value,
int nDigits ) {
return wxT(
"" ); }
817 return m_tickValues[n];
822 return m_tickLabels[n].pos;
827 return m_tickLabels[n].label;
854 bool ticks =
true,
unsigned int type =
mpX_NORMAL );
860 virtual void Plot( wxDC& dc,
mpWindow& w )
override;
862 virtual void getVisibleDataRange(
mpWindow& w,
double& minV,
double& maxV )
override;
880 bool ticks =
true,
unsigned int type =
mpX_NORMAL );
888 virtual double TransformToPlot(
double x )
const override;
889 virtual double TransformFromPlot(
double xplot )
const override;
892 virtual void recalculateTicks( wxDC& dc,
mpWindow& w )
override;
909 bool ticks =
true,
unsigned int type =
mpX_NORMAL );
911 virtual double TransformToPlot(
double x )
const override;
912 virtual double TransformFromPlot(
double xplot )
const override;
921 void recalculateTicks( wxDC& dc,
mpWindow& w )
override;
957 virtual void Plot( wxDC& dc,
mpWindow& w )
override;
963 virtual bool HasBBox()
const override {
return false; }
977 virtual double TransformToPlot(
double x )
const override;
978 virtual double TransformFromPlot(
double xplot )
const override;
983 m_masterScale = masterScale;
987 virtual void getVisibleDataRange(
mpWindow& w,
double& minV,
double& maxV )
override;
988 virtual void recalculateTicks( wxDC& dc,
mpWindow& w )
override;
996 void computeSlaveTicks(
mpWindow& w );
1017#define mpMOUSEMODE_DRAG 0
1019#define mpMOUSEMODE_ZOOMBOX 1
1052 mpWindow( wxWindow* parent, wxWindowID
id,
1053 const wxPoint& pos = wxDefaultPosition,
1054 const wxSize& size = wxDefaultSize,
1070 bool AddLayer(
mpLayer* layer,
bool refreshDisplay =
true );
1080 bool DelLayer(
mpLayer* layer,
bool alsoDeleteObject =
false,
bool refreshDisplay =
true );
1086 void DelAllLayers(
bool alsoDeleteObject,
bool refreshDisplay =
true );
1094 mpLayer* GetLayer(
int position )
const;
1100 const mpLayer* GetLayerByName(
const wxString&
name )
const;
1103 return const_cast<mpLayer*
>(
static_cast<const mpWindow*
>( this )->GetLayerByName(
name ) );
1155 void SetScaleX(
double scaleX );
1171 void SetPosX(
double posX ) { m_posX = posX; UpdateAll(); }
1176 void SetPosY(
double posY ) { m_posY = posY; UpdateAll(); }
1182 void SetPos(
double posX,
double posY ) { m_posX = posX; m_posY = posY; UpdateAll(); }
1189 void SetScr(
int scrX,
int scrY ) { m_scrX = scrX; m_scrY = scrY; }
1194 inline double p2x( wxCoord pixelCoordX ) {
return m_posX + pixelCoordX / m_scaleX; }
1199 inline double p2y( wxCoord pixelCoordY ) {
return m_posY - pixelCoordY / m_scaleY; }
1204 inline wxCoord
x2p(
double x ) {
return (wxCoord) ( (x - m_posX) * m_scaleX ); }
1209 inline wxCoord
y2p(
double y ) {
return (wxCoord) ( (m_posY - y) * m_scaleY ); }
1229 void LockAspect(
bool enable =
true );
1241 void Fit()
override;
1249 void Fit(
double xMin,
double xMax,
double yMin,
double yMax,
1250 wxCoord* printSizeX = NULL, wxCoord* printSizeY = NULL );
1256 void ZoomIn(
const wxPoint& centerPoint = wxDefaultPosition );
1257 void ZoomIn(
const wxPoint& centerPoint,
double zoomFactor );
1263 void ZoomOut(
const wxPoint& centerPoint = wxDefaultPosition );
1264 void ZoomOut(
const wxPoint& centerPoint,
double zoomFactor );
1280 void ZoomRect( wxPoint p0, wxPoint p1 );
1291 unsigned int CountLayers()
const;
1331 void GetBoundingBox(
double* bbox )
const;
1346 bool SaveScreenshot(
const wxString& filename, wxBitmapType type = wxBITMAP_TYPE_BMP,
1347 wxSize imageSize = wxDefaultSize,
bool fit =
false );
1361 void SetMargins(
int top,
int right,
int bottom,
int left );
1401 void SetLayerVisible(
const wxString&
name,
bool viewable );
1406 bool IsLayerVisible(
const wxString&
name )
const;
1411 void SetLayerVisible(
const unsigned int position,
bool viewable );
1416 bool IsLayerVisible(
unsigned int position )
const;
1422 void SetColourTheme(
const wxColour& bgColour,
1423 const wxColour& drawColour,
1424 const wxColour& axesColour );
1433 m_enableLimitedView = aEnable;
1437 void OnPaint( wxPaintEvent& event );
1438 void OnSize( wxSizeEvent& event );
1441 void OnShowPopupMenu( wxMouseEvent& event );
1442 void OnMouseMiddleDown( wxMouseEvent& event );
1445 void OnCenter( wxCommandEvent& event );
1446 void OnFit( wxCommandEvent& event );
1447 void OnZoomIn( wxCommandEvent& event );
1448 void OnZoomOut( wxCommandEvent& event );
1449 void OnLockAspect( wxCommandEvent& event );
1450 void OnMouseWheel( wxMouseEvent& event );
1452 void OnMouseMove( wxMouseEvent& event );
1453 void OnMouseLeftDown( wxMouseEvent& event );
1454 void OnMouseLeftRelease( wxMouseEvent& event );
1455 void OnScrollThumbTrack( wxScrollWinEvent& event );
1456 void OnScrollPageUp( wxScrollWinEvent& event );
1457 void OnScrollPageDown( wxScrollWinEvent& event );
1458 void OnScrollLineUp( wxScrollWinEvent& event );
1459 void OnScrollLineDown( wxScrollWinEvent& event );
1460 void OnScrollTop( wxScrollWinEvent& event );
1461 void OnScrollBottom( wxScrollWinEvent& event );
1463 void DoScrollCalc(
const int position,
const int orientation );
1465 void DoZoomInXCalc(
const int staticXpixel );
1472 return !( m_enableLimitedView
1473 && (desiredMax > m_maxX - m_marginRight / m_scaleX
1474 || desiredMin < m_minX - m_marginLeft / m_scaleX) );
1479 return !( m_enableLimitedView
1480 && (desiredMax > m_maxY + m_marginBottom / m_scaleY
1481 || desiredMin < m_minY + m_marginTop / m_scaleY) );
1484 void AdjustLimitedView();
1489 virtual bool UpdateBBox();
1494 virtual bool SetXView(
double pos,
double desiredMax,
double desiredMin );
1499 virtual bool SetYView(
double pos,
double desiredMax,
double desiredMin );
1545 DECLARE_EVENT_TABLE()
1585 virtual void SetData(
const std::vector<double>& xs,
const std::vector<double>& ys );
1608 void Rewind()
override;
1615 bool GetNextXY(
double& x,
double& y )
override;
1617 size_t GetCount()
const override;
1622 double GetMinX()
const override {
return m_minX; }
1626 double GetMinY()
const override {
return m_minY; }
1630 double GetMaxX()
const override {
return m_maxX; }
1634 double GetMaxY()
const override {
return m_maxY; }
1650 mpFSemiLogXVector( wxString
name = wxEmptyString,
int flags =
mpALIGN_NE );
1652 virtual ~mpFSemiLogXVector() {}
1659 DECLARE_DYNAMIC_CLASS( mpFSemiLogXVector )
1679 mpText(
const wxString&
name = wxT(
"Title"),
int offsetx = 5,
int offsety = 50 );
1683 virtual void Plot( wxDC& dc,
mpWindow& w )
override;
1686 virtual bool HasBBox()
const override {
return false; }
1692 DECLARE_DYNAMIC_CLASS(
mpText )
1707 mpPrintout(
mpWindow* drawWindow,
const wxChar* title = _T(
"wxMathPlot print output") );
1711 bool OnPrintPage(
int page )
override;
1712 bool HasPage(
int page )
override;
1738 m_reference_phi( 0 ),
1757 phi = m_reference_phi;
1766 m_reference_phi = phi;
1771 virtual bool HasBBox()
const override {
return m_trans_shape_xs.size()!=0; }
1775 virtual double GetMinX()
const override {
return m_bbox_min_x; }
1779 virtual double GetMaxX()
const override {
return m_bbox_max_x; }
1783 virtual double GetMinY()
const override {
return m_bbox_min_y; }
1787 virtual double GetMaxY()
const override {
return m_bbox_max_y; }
1789 virtual void Plot( wxDC& dc,
mpWindow& w )
override;
1806 void TranslatePoint(
double x,
double y,
double& out_x,
double& out_y );
1827 void ShapeUpdated();
1854 double quantiles = 2,
1856 const wxString& layerName = wxT(
"") ) :
1860 m_quantiles( quantiles ),
1861 m_segments( segments )
1863 m_continuous =
true;
1915 void RecalculateShape();
1932 m_continuous =
true;
1943 void setPoints(
const std::vector<double>& points_xs,
1944 const std::vector<double>& points_ys,
1945 bool closedShape =
true );
1965 m_min_y = m_max_y = 0;
1966 m_scaledBitmap_offset_x = 0;
1967 m_scaledBitmap_offset_y = 0;
1976 void GetBitmapCopy( wxImage& outBmp )
const;
1985 void SetBitmap(
const wxImage& inBmp,
double x,
double y,
double lx,
double ly );
1987 virtual bool HasBBox()
const override {
return true; }
1991 virtual double GetMinX()
const override {
return m_min_x; }
1995 virtual double GetMaxX()
const override {
return m_max_x; }
1999 virtual double GetMinY()
const override {
return m_min_y; }
2003 virtual double GetMaxY()
const override {
return m_max_y; }
2005 virtual void Plot( wxDC& dc,
mpWindow& w )
override;
This virtual class represents objects that can be moved to an arbitrary 2D location+rotation.
virtual double GetMaxX() const override
Get inclusive right border of bounding box.
virtual double GetMinX() const override
Get inclusive left border of bounding box.
wxImage m_bitmap
The internal copy of the Bitmap:
virtual bool HasBBox() const override
Check whether this layer has a bounding box.
void SetAlign(int align)
Set label axis alignment.
mpBitmapLayer()
Default constructor.
virtual double GetMinY() const override
Get inclusive bottom border of bounding box.
wxCoord m_scaledBitmap_offset_x
virtual double GetMaxY() const override
Get inclusive top border of bounding box.
A 2D ellipse, described by a 2x2 covariance matrix.
void SetSegments(int segments)
double m_cov_00
The elements of the matrix (only 3 since cov(0,1)=cov(1,0) in any positive definite matrix).
void SetQuantiles(double q)
Set how many "quantiles" to draw, that is, the confidence interval of the ellipse (see above).
void SetCovarianceMatrix(double cov_00, double cov_01, double cov_11)
Changes the covariance matrix:
double GetQuantiles() const
int m_segments
The number of line segments that build up the ellipse.
void GetCovarianceMatrix(double &cov_00, double &cov_01, double &cov_11) const
Returns the elements of the current covariance matrix:
mpCovarianceEllipse(double cov_00=1, double cov_11=1, double cov_01=0, double quantiles=2, int segments=32, const wxString &layerName=wxT(""))
Default constructor.
virtual ~mpCovarianceEllipse()
A class providing graphs functionality for a 2D plot (either continuous or a set of points),...
double GetMaxY() const override
Returns the actual maximum Y data (loaded in SetData).
double GetMinY() const override
Returns the actual minimum Y data (loaded in SetData).
double GetMinX() const override
Returns the actual minimum X data (loaded in SetData).
std::vector< double > m_xs
The internal copy of the set of data to draw.
double GetMaxX() const override
Returns the actual maximum X data (loaded in SetData).
size_t m_index
The internal counter for the "GetNextXY" interface.
Abstract base class providing plot and labeling functionality for a locus plot F:N->X,...
virtual void Rewind()=0
Rewind value enumeration with mpFXY::GetNextXY.
virtual size_t GetCount() const =0
virtual bool GetNextXY(double &x, double &y)=0
Get locus value for next N.
Abstract base class providing plot and labeling functionality for functions F:X->Y.
virtual double GetY(double x) const =0
Get function value for argument.
Abstract base class providing plot and labeling functionality for functions F:Y->X.
virtual double GetX(double y) const =0
Get function value for argument.
Implements an overlay box which shows the mouse coordinates in plot units.
Base class to create small rectangular info boxes mpInfoLayer is the base class to create a small rec...
const wxRect & GetRectangle() const
Returns the current rectangle coordinates.
virtual bool HasBBox() const override
mpInfoLayer has not bounding box.
virtual bool IsInfo() const override
Specifies that this is an Info box layer.
Implements the legend to be added to the plot This layer allows you to add a legend to describe the p...
virtual void Plot(wxDC &dc, mpWindow &w)=0
Plot given view of layer to the given device context.
mpLayerType GetLayerType() const
Get layer type: a Layer can be of different types: plot lines, axis, info boxes, etc,...
bool m_drawOutsideMargins
bool IsVisible() const
Checks whether the layer is visible or not.
const wxString & GetName() const
Get layer name.
virtual double GetMinY() const
Get inclusive bottom border of bounding box.
bool GetContinuity() const
Gets the 'continuity' property of the layer.
void SetPen(wxPen pen)
Set layer pen.
virtual bool IsInfo() const
Check whether the layer is an info box.
bool GetDrawOutsideMargins()
Get Draw mode: inside or outside margins.
void SetContinuity(bool continuity)
Set the 'continuity' property of the layer (true:draws a continuous line, false:draws separate points...
void ShowName(bool show)
Shows or hides the text label with the name of the layer (default is visible).
void SetFont(wxFont &font)
Set layer font.
const wxFont & GetFont() const
Get font set for this layer.
const wxPen & GetPen() const
Get pen set for this layer.
void SetVisible(bool show)
Sets layer visibility.
void SetBrush(wxBrush brush)
Set layer brush.
virtual double GetMaxX() const
Get inclusive right border of bounding box.
const wxBrush & GetBrush() const
Get brush set for this layer.
virtual double GetMinX() const
Get inclusive left border of bounding box.
virtual void SetName(wxString name)
Set layer name.
virtual double GetMaxY() const
Get inclusive top border of bounding box.
virtual bool HasBBox() const
Check whether this layer has a bounding box.
void SetDrawOutsideMargins(bool drawModeOutside)
Set Draw mode: inside or outside margins.
This virtual class represents objects that can be moved to an arbitrary 2D location+rotation.
void SetAlign(int align)
Set label axis alignment.
void GetCoordinateBase(double &x, double &y, double &phi) const
Get the current coordinate transformation.
virtual double GetMaxY() const override
Get inclusive top border of bounding box.
std::vector< double > m_trans_shape_xs
The buffer for the translated & rotated points (to avoid recomputing them with each mpWindow refresh)...
virtual double GetMinX() const override
Get inclusive left border of bounding box.
virtual ~mpMovableObject()
mpMovableObject()
Default constructor (sets location and rotation to (0,0,0))
virtual bool HasBBox() const override
Check whether this layer has a bounding box.
void SetCoordinateBase(double x, double y, double phi=0)
Set the coordinate transformation (phi in radians, 0 means no rotation).
virtual double GetMinY() const override
Get inclusive bottom border of bounding box.
std::vector< double > m_shape_xs
This contains the object points, in local coordinates (to be transformed by the current transformatio...
virtual double GetMaxX() const override
Get inclusive right border of bounding box.
An arbitrary polygon, descendant of mpMovableObject.
mpPolygon(const wxString &layerName=wxT(""))
Default constructor.
Printout class used by mpWindow to draw in the objects to be printed.
void SetDrawState(bool drawState)
Abstract base class providing plot and labeling functionality for functions F:Y->X.
virtual double GetY(double x) const =0
Get function value for argument.
Plot layer implementing a x-scale ruler.
void SetNameAlign(int align)
virtual void recalculateTicks(wxDC &dc, mpWindow &w)
double AbsMaxValue() const
void GetDataRange(double &minV, double &maxV) const
std::vector< double > m_tickValues
double AbsVisibleMaxValue() const
bool HasBBox() const override
Check whether this layer has a bounding box.
void SetAlign(int align)
Set X axis alignment.
std::vector< TickLabel > & TickLabels()
void SetTicks(bool enable)
Set X axis ticks or grid.
virtual double TransformToPlot(double x) const
std::vector< TickLabel > m_tickLabels
virtual void formatLabels()
virtual wxString getLabel(int n) const
virtual bool IsHorizontal() const =0
virtual double getTickPos(int n) const
bool GetTicks() const
Get X axis ticks or grid.
virtual const wxString formatLabel(double value, int nDigits)
virtual double getLabelPos(int n) const
virtual void getVisibleDataRange(mpWindow &w, double &minV, double &maxV)
void ExtendDataRange(double minV, double maxV)
void SetDataRange(double minV, double maxV)
virtual double TransformFromPlot(double xplot) const
virtual int labelCount() const
virtual bool IsHorizontal() const override
void computeLabelExtents(wxDC &dc, mpWindow &w)
Plot layer implementing a y-scale ruler.
void SetTicks(bool ticks)
Set Y axis ticks or grid.
void computeLabelExtents(wxDC &dc, mpWindow &w)
virtual bool IsHorizontal() const override
void SetMasterScale(mpScaleY *masterScale)
bool GetTicks() const
Get Y axis ticks or grid.
void SetAlign(int align)
Set Y axis alignment.
virtual bool HasBBox() const override
Check whether this layer has a bounding box.
Plot layer implementing a text string.
virtual bool HasBBox() const override
mpText should not be used for scaling decisions.
Canvas for plotting mpLayer implementations.
mpInfoLayer * m_movingInfoLayer
int GetMarginLeft() const
bool m_enableMouseNavigation
void DoZoomInYCalc(const int staticYpixel)
void EnableMousePanZoom(bool enabled)
Enable/disable the feature of pan/zoom with the mouse (default=enabled)
int GetScrX(void) const
Get current view's X dimension in device context units.
void SetMarginLeft(int left)
Set the left margin.
double GetYscl() const
Get current view's Y scale.
const wxColour & GetAxesColour()
Get axes draw colour.
bool m_enableMouseWheelPan
double p2x(wxCoord pixelCoordX)
Converts mpWindow (screen) pixel coordinates into graph (floating point) coordinates,...
int GetXScreen(void) const
double p2y(wxCoord pixelCoordY)
Converts mpWindow (screen) pixel coordinates into graph (floating point) coordinates,...
void SetMarginRight(int right)
Set the right margin.
void LimitView(bool aEnable)
Limit zooming & panning to the area used by the plots.
wxCoord x2p(double x)
Converts graph (floating point) coordinates into mpWindow (screen) pixel coordinates,...
double GetYpos() const
Get current view's Y position.
void SetMarginTop(int top)
Set the top margin.
double GetPosY(void) const
void SetPosX(double posX)
Set current view's X position and refresh display.
double GetDesiredYmax() const
Returns the top layer-border coordinate that the user wants the mpWindow to show (it may be not exact...
void SetMarginBottom(int bottom)
Set the bottom margin.
double GetScaleX(void) const
void SetPosY(double posY)
Set current view's Y position and refresh display.
void SetScaleY(double scaleY)
Set current view's Y scale and refresh display.
void OnMagnify(wxMouseEvent &event)
void ZoomInY()
Zoom in current view along Y and refresh display.
double GetDesiredYmin() const
Returns the bottom-border layer coordinate that the user wants the mpWindow to show (it may be not ex...
double GetScaleY(void) const
bool IsAspectLocked() const
Checks whether the X/Y scale aspect is locked.
void ZoomOutY()
Zoom out current view along Y and refresh display.
bool CheckYLimits(double &desiredMax, double &desiredMin) const
wxCoord y2p(double y)
Converts graph (floating point) coordinates into mpWindow (screen) pixel coordinates,...
double GetDesiredXmax() const
Returns the right-border layer coordinate that the user wants the mpWindow to show (it may be not exa...
bool CheckXLimits(double &desiredMax, double &desiredMin) const
wxMenu * GetPopupMenu()
Get reference to context menu of the plot canvas.
double GetDesiredXmin() const
Returns the left-border layer coordinate that the user wants the mpWindow to show (it may be not exac...
void DoZoomOutXCalc(const int staticXpixel)
double GetXpos() const
Get current view's X position.
void SetMPScrollbars(bool status)
Enable/disable scrollbars.
double GetXscl() const
Get current view's X scale.
int GetMarginRight() const
void SetScr(int scrX, int scrY)
Set current view's dimensions in device context units.
int GetMarginBottom() const
void EnableDoubleBuffer(bool enabled)
Enable/disable the double-buffering of the window, eliminating the flicker (default=disabled).
static double zoomIncrementalFactor
This value sets the zoom steps whenever the user clicks "Zoom in/out" or performs zoom with the mouse...
mpLayer * GetLayerByName(const wxString &name)
int GetScrY(void) const
Get current view's Y dimension in device context units.
void ZoomOutX()
Zoom out current view along X and refresh display.
void DoZoomOutYCalc(const int staticYpixel)
bool m_enableDoubleBuffer
void EnableMouseWheelPan(bool enabled)
Enable/disable trackpad friendly panning (2-axis scroll wheel)
unsigned int CountAllLayers() const
Counts the number of plot layers, whether or not they have a bounding box.
double GetPosX(void) const
void SetPos(double posX, double posY)
Set current view's X and Y position and refresh display.
int GetYScreen(void) const
bool GetMPScrollbars() const
Get scrollbars status.
class WXDLLIMPEXP_MATHPLOT mpText
class WXDLLIMPEXP_MATHPLOT mpFY
class WXDLLIMPEXP_MATHPLOT mpWindow
class WXDLLIMPEXP_MATHPLOT mpPrintout
class WXDLLIMPEXP_MATHPLOT mpFXYVector
#define mpALIGN_RIGHT
Aligns label to the right.
enum __mp_Layer_Type mpLayerType
std::deque< mpLayer * > wxLayerList
Define the type for the list of layers inside mpWindow.
class WXDLLIMPEXP_MATHPLOT mpFXY
#define mpALIGN_CENTER
Aligns label to the center.
#define mpALIGN_TOP
Aligns label to the top.
#define WXDLLIMPEXP_MATHPLOT
wxMathPlot is a framework for mathematical graph plotting in wxWindows.
class WXDLLIMPEXP_MATHPLOT mpLayer
class WXDLLIMPEXP_MATHPLOT mpFX
class WXDLLIMPEXP_MATHPLOT mpScaleX
class WXDLLIMPEXP_MATHPLOT mpScaleY
#define mpX_NORMAL
Set label for X axis in normal mode.
#define mpALIGN_NE
Aligns label to north-east.
EDA_ANGLE abs(const EDA_ANGLE &aAngle)
TickLabel(double pos_=0.0, const wxString &label_=wxT(""))