KiCad PCB EDA Suite
Loading...
Searching...
No Matches
mathplot.h
Go to the documentation of this file.
1
2// Name: mathplot.cpp
3// Purpose: Framework for plotting in wxWindows
4// Original Author: David Schalig
5// Maintainer: Davide Rondini
6// Contributors: Jose Luis Blanco, Val Greene, Maciej Suminski, Tomasz Wlostowski
7// Created: 21/07/2003
8// Last edit: 05/08/2016
9// Copyright: (c) David Schalig, Davide Rondini
10// Copyright (c) 2021-2024 KiCad Developers, see AUTHORS.txt for contributors.
11// Licence: wxWindows licence
13
14#ifndef _MP_MATHPLOT_H_
15#define _MP_MATHPLOT_H_
16
53
54
55// this definition uses windows dll to export function.
56// WXDLLIMPEXP_MATHPLOT definition definition changed to WXDLLIMPEXP_MATHPLOT
57// mathplot_EXPORTS will be defined by cmake
58#ifdef mathplot_EXPORTS
59#define WXDLLIMPEXP_MATHPLOT WXEXPORT
60#define WXDLLIMPEXP_DATA_MATHPLOT( type ) WXEXPORT type
61#else // not making DLL
62#define WXDLLIMPEXP_MATHPLOT
63#define WXDLLIMPEXP_DATA_MATHPLOT( type ) type
64#endif
65
66
67#include <wx/defs.h>
68#include <wx/menu.h>
69#include <wx/scrolwin.h>
70#include <wx/event.h>
71#include <wx/dynarray.h>
72#include <wx/pen.h>
73#include <wx/dcmemory.h>
74#include <wx/string.h>
75#include <wx/print.h>
76#include <wx/image.h>
77
78#include <vector>
79#include <deque>
80#include <stack>
81#include <array>
82#include <algorithm>
83
84// For memory leak debug
85#ifdef _WINDOWS
86#ifdef _DEBUG
87#include <crtdbg.h>
88#define DEBUG_NEW new (_NORMAL_BLOCK, __FILE__, __LINE__)
89#else
90#define DEBUG_NEW new
91#endif // _DEBUG
92#endif // _WINDOWS
93
94// Separation for axes when set close to border
95#define X_BORDER_SEPARATION 40
96#define Y_BORDER_SEPARATION 60
97
98// -----------------------------------------------------------------------------
99// classes
100// -----------------------------------------------------------------------------
101
111
113enum
114{
115 mpID_FIT = 2000, // !< Fit view to match bounding box of all layers
118 mpID_ZOOM_IN, // !< Zoom into view at clickposition / window center
119 mpID_ZOOM_OUT, // !< Zoom out
120 mpID_CENTER, // !< Center view on click position
121};
122
123// -----------------------------------------------------------------------------
124// mpLayer
125// -----------------------------------------------------------------------------
126
127typedef enum __mp_Layer_Type
128{
129 mpLAYER_UNDEF, // !< Layer type undefined
130 mpLAYER_AXIS, // !< Axis type layer
131 mpLAYER_PLOT, // !< Plot type layer
132 mpLAYER_INFO, // !< Info box type layer
133 mpLAYER_BITMAP // !< Bitmap type layer
135
146class mpScaleBase;
147
148class WXDLLIMPEXP_MATHPLOT mpLayer : public wxObject
149{
150public:
151 mpLayer();
152
153 virtual ~mpLayer() {};
154
162 virtual bool HasBBox() const { return true; }
163
171 virtual bool IsInfo() const { return false; };
172
176 virtual double GetMinX() const { return -1.0; }
177
181 virtual double GetMaxX() const { return 1.0; }
182
186 virtual double GetMinY() const { return -1.0; }
187
191 virtual double GetMaxY() const { return 1.0; }
192
234 virtual void Plot( wxDC& dc, mpWindow& w ) = 0;
235
239 const wxString& GetName() const { return m_name; }
240
241 const wxString& GetDisplayName() const
242 {
243 return m_displayName.IsEmpty() ? m_name : m_displayName;
244 }
245
249 const wxFont& GetFont() const { return m_font; }
250
254 const wxPen& GetPen() const { return m_pen; }
255
259 void SetContinuity( bool continuity ) { m_continuous = continuity; }
260
264 bool GetContinuity() const { return m_continuous; }
265
268 void ShowName( bool show ) { m_showName = show; };
269
273 virtual void SetName( const wxString& name ) { m_name = name; }
274
278 void SetFont( const wxFont& font ) { m_font = font; }
279
283 void SetPen( const wxPen& pen ) { m_pen = pen; }
284
287 mpLayerType GetLayerType() const { return m_type; };
288
291 bool IsVisible() const { return m_visible; };
292
295 void SetVisible( bool show ) { m_visible = show; };
296
299 const wxBrush& GetBrush() const { return m_brush; };
300
303 void SetBrush( const wxBrush& brush ) { m_brush = brush; };
304
305protected:
306
307 wxFont m_font; // !< Layer's font
308 wxPen m_pen; // !< Layer's pen
309 wxBrush m_brush; // !< Layer's brush
310 wxString m_name; // !< Layer's name
312 bool m_continuous; // !< Specify if the layer will be plotted as a continuous line or a set of points.
313 bool m_showName; // !< States whether the name of the layer must be shown (default is true).
314 mpLayerType m_type; // !< Define layer type, which is assigned by constructor
315 bool m_visible; // !< Toggles layer visibility
316
317 DECLARE_DYNAMIC_CLASS( mpLayer )
318};
319
320
321// -----------------------------------------------------------------------------
322// mpInfoLayer
323// -----------------------------------------------------------------------------
324
330{
331public:
333 mpInfoLayer();
334
338 mpInfoLayer( wxRect rect, const wxBrush* brush = wxTRANSPARENT_BRUSH );
339
341 virtual ~mpInfoLayer();
342
345 virtual bool HasBBox() const override { return false; }
346
351 virtual void Plot( wxDC& dc, mpWindow& w ) override;
352
356 virtual bool IsInfo() const override { return true; }
357
361 virtual bool Inside( const wxPoint& point ) const;
362
363 virtual bool OnDoubleClick( const wxPoint& point, mpWindow& w );
364
367 virtual void Move( wxPoint delta );
368
370 virtual void UpdateReference();
371
374 wxPoint GetPosition() const;
375
378 wxSize GetSize() const;
379
380protected:
381 wxRect m_dim; // !< The bounding rectangle of the box. It may be resized dynamically
382 // by the Plot method.
383 wxPoint m_reference; // !< Holds the reference point for movements
384 wxBrush m_brush; // !< The brush to be used for the background
385 int m_winX; // !< Holds the mpWindow size. Used to rescale position when window is
386 int m_winY; // resized.
387
388 DECLARE_DYNAMIC_CLASS( mpInfoLayer )
389};
390
395{
396public:
398 mpInfoLegend();
399
404 mpInfoLegend( wxRect rect, const wxBrush* brush = wxTRANSPARENT_BRUSH );
405
408
413 virtual void Plot( wxDC& dc, mpWindow& w ) override;
414
415protected:
416};
417
418
419// -----------------------------------------------------------------------------
420// mpLayer implementations - functions
421// -----------------------------------------------------------------------------
422
425
427#define mpALIGNMASK 0x03
429#define mpALIGN_RIGHT 0x00
431#define mpALIGN_CENTER 0x01
433#define mpALIGN_LEFT 0x02
435#define mpALIGN_TOP mpALIGN_RIGHT
437#define mpALIGN_BOTTOM mpALIGN_LEFT
439#define mpALIGN_BORDER_BOTTOM 0x04
441#define mpALIGN_BORDER_TOP 0x05
443#define mpALIGN_FAR_RIGHT 0x06
445#define mpX_NORMAL 0x00
447#define mpX_TIME 0x01
449#define mpX_HOURS 0x02
451#define mpX_DATE 0x03
453#define mpX_DATETIME 0x04
455#define mpALIGN_BORDER_LEFT mpALIGN_BORDER_BOTTOM
457#define mpALIGN_BORDER_RIGHT mpALIGN_BORDER_TOP
459#define mpALIGN_NE 0x00
461#define mpALIGN_NW 0x01
463#define mpALIGN_SW 0x02
465#define mpALIGN_SE 0x03
466
468
471
478{
479public:
483 mpFX( const wxString& name = wxEmptyString, int flags = mpALIGN_RIGHT );
484
490 virtual double GetY( double x ) const = 0;
491
496 virtual void Plot( wxDC& dc, mpWindow& w ) override;
497
498protected:
499 int m_flags; // !< Holds label alignment
500
501 DECLARE_DYNAMIC_CLASS( mpFX )
502};
503
510{
511public:
515 mpFY( const wxString& name = wxEmptyString, int flags = mpALIGN_TOP );
516
522 virtual double GetX( double y ) const = 0;
523
528 virtual void Plot( wxDC& dc, mpWindow& w ) override;
529
530protected:
531 int m_flags; // !< Holds label alignment
532
533 DECLARE_DYNAMIC_CLASS( mpFY )
534};
535
542
544{
545public:
549 mpFXY( const wxString& name = wxEmptyString, int flags = mpALIGN_NE );
550
554 virtual void Rewind() = 0;
555 virtual void SetSweepWindow( int aSweepIdx ) { Rewind(); }
556
562 virtual bool GetNextXY( double& x, double& y ) = 0;
563
564 virtual size_t GetCount() const = 0;
565 virtual int GetSweepCount() const { return 1; }
566
571 virtual void Plot( wxDC& dc, mpWindow& w ) override;
572
573 virtual void SetScale( mpScaleBase* scaleX, mpScaleBase* scaleY );
574
575 void UpdateScales();
576
577 double s2x( double plotCoordX ) const;
578 double s2y( double plotCoordY ) const;
579
580 double x2s( double x ) const;
581 double y2s( double y ) const;
582
583protected:
584 int m_flags; // !< Holds label alignment
585
586 // Data to calculate label positioning
588 // int drawnPoints;
590
595 void UpdateViewBoundary( wxCoord xnew, wxCoord ynew );
596
597 DECLARE_DYNAMIC_CLASS( mpFXY )
598};
599
601
602// -----------------------------------------------------------------------------
603// mpLayer implementations - furniture (scales, ...)
604// -----------------------------------------------------------------------------
605
608
613
614
616{
617public:
618 mpScaleBase();
619 virtual ~mpScaleBase() {};
620
621 virtual bool IsHorizontal() const = 0;
622
623 bool HasBBox() const override { return false; }
624
629 void SetAlign( int align ) { m_flags = align; };
630
631 void SetNameAlign( int align ) { m_nameFlags = align; }
632
636 void SetTicks( bool enable ) { m_ticks = enable; };
637
641 bool GetTicks() const { return m_ticks; };
642
643 void GetDataRange( double& minV, double& maxV ) const
644 {
645 minV = m_minV;
646 maxV = m_maxV;
647 }
648
649 virtual void ExtendDataRange( double minV, double maxV )
650 {
651 if( !m_rangeSet )
652 {
653 m_minV = minV;
654 m_maxV = maxV;
655 m_rangeSet = true;
656 }
657 else
658 {
659 m_minV = std::min( minV, m_minV );
660 m_maxV = std::max( maxV, m_maxV );
661 }
662
663 if( m_minV == m_maxV )
664 {
665 m_minV = m_minV - 1.0;
666 m_maxV = m_maxV + 1.0;
667 }
668 }
669
670 virtual void ResetDataRange()
671 {
672 m_rangeSet = false;
673 }
674
675 double AbsMaxValue() const
676 {
677 return std::max( std::abs( m_maxV ), std::abs( m_minV ) );
678 }
679
680 double AbsVisibleMaxValue() const
681 {
682 return m_absVisibleMaxV;
683 }
684
685 void SetAxisMinMax( bool lock, double minV, double maxV )
686 {
687 m_axisLocked = lock;
688 m_axisMin = minV;
689 m_axisMax = maxV;
690 }
691
692 bool GetAxisMinMax( double* minV, double* maxV )
693 {
694 if( m_axisLocked )
695 {
696 *minV = m_axisMin;
697 *maxV = m_axisMax;
698 }
699 else if( !m_tickValues.empty() )
700 {
701 *minV = m_tickValues.front();
702 *maxV = m_tickValues.back();
703 }
704
705 return m_axisLocked;
706 }
707
708 virtual double TransformToPlot( double x ) const { return 0.0; };
709 virtual double TransformFromPlot( double xplot ) const { return 0.0; };
710
712 {
713 TICK_LABEL( double pos_ = 0.0, const wxString& label_ = wxT( "" ) ) :
714 pos( pos_ ),
715 label( label_ ),
716 visible( true )
717 {}
718
719 double pos;
720 wxString label;
722 };
723
724protected:
725
726 void updateTickLabels( wxDC& dc, mpWindow& w );
727 void computeLabelExtents( wxDC& dc, mpWindow& w );
728
729 // virtual int getLabelDecimalDigits(int maxDigits) const;
730 virtual void getVisibleDataRange( mpWindow& w, double& minV, double& maxV ) {};
731 virtual void recalculateTicks( wxDC& dc, mpWindow& w ) {};
732
733 virtual void formatLabels() {};
734
735protected:
736 std::vector<double> m_tickValues;
737 std::vector<TICK_LABEL> m_tickLabels;
738
741 int m_flags; // !< Flag for axis alignment
743 bool m_ticks; // !< Flag to toggle between ticks or grid
744 double m_minV, m_maxV;
747 double m_axisMin;
748 double m_axisMax;
751};
752
754{
755public:
763 mpScaleXBase( const wxString& name = wxT( "X" ), int flags = mpALIGN_CENTER, bool ticks = true,
764 unsigned int type = mpX_NORMAL );
765 virtual ~mpScaleXBase() {};
766
767 virtual bool IsHorizontal() const override { return true; }
768 virtual void Plot( wxDC& dc, mpWindow& w ) override;
769
770 virtual void getVisibleDataRange( mpWindow& w, double& minV, double& maxV ) override;
771
772 DECLARE_DYNAMIC_CLASS( mpScaleXBase )
773};
774
775
777{
778public:
786 mpScaleX( const wxString& name = wxT( "X" ), int flags = mpALIGN_CENTER, bool ticks = true,
787 unsigned int type = mpX_NORMAL );
788
789 virtual double TransformToPlot( double x ) const override;
790 virtual double TransformFromPlot( double xplot ) const override;
791
792protected:
793 virtual void recalculateTicks( wxDC& dc, mpWindow& w ) override;
794
795 DECLARE_DYNAMIC_CLASS( mpScaleX )
796};
797
798
800{
801public:
809 mpScaleXLog( const wxString& name = wxT( "log(X)" ), int flags = mpALIGN_CENTER,
810 bool ticks = true, unsigned int type = mpX_NORMAL );
811
812 virtual double TransformToPlot( double x ) const override;
813 virtual double TransformFromPlot( double xplot ) const override;
814
815protected:
816 void recalculateTicks( wxDC& dc, mpWindow& w ) override;
817
818 DECLARE_DYNAMIC_CLASS( mpScaleXLog )
819};
820
821
830{
831public:
837 mpScaleY( const wxString& name = wxT( "Y" ), int flags = mpALIGN_CENTER, bool ticks = true );
838
839 virtual bool IsHorizontal() const override { return false; }
840
844 virtual void Plot( wxDC& dc, mpWindow& w ) override;
845
850 virtual bool HasBBox() const override { return false; }
851
852 virtual double TransformToPlot( double x ) const override;
853 virtual double TransformFromPlot( double xplot ) const override;
854
855 void SetMasterScale( mpScaleY* masterScale ) { m_masterScale = masterScale; }
856
857protected:
858 virtual void getVisibleDataRange( mpWindow& w, double& minV, double& maxV ) override;
859 virtual void recalculateTicks( wxDC& dc, mpWindow& w ) override;
860
861 void computeSlaveTicks( mpWindow& w );
862
864 int m_flags; // !< Flag for axis alignment
865 bool m_ticks; // !< Flag to toggle between ticks or grid
866
867 DECLARE_DYNAMIC_CLASS( mpScaleY )
868};
869
870// -----------------------------------------------------------------------------
871// mpWindow
872// -----------------------------------------------------------------------------
873
876
878#define mpMOUSEMODE_DRAG 0
880#define mpMOUSEMODE_ZOOMBOX 1
881
884// WX_DECLARE_HASH_MAP( int, mpLayer*, wxIntegerHash, wxIntegerEqual, wxLayerList );
885typedef std::deque<mpLayer*> wxLayerList;
886
909class WXDLLIMPEXP_MATHPLOT mpWindow : public wxWindow
910{
911public:
926
931 {
932 /* If this bundled wxMathPlot implementation is to remain single-header and not dependent
933 * on any part of KiCad, then the SIM_MOUSE_WHEEL_ACTION_SET struct must be duplicated
934 * here. SIM_PLOT_TAB::convertMouseWheelActions is used to convert from
935 * SIM_MOUSE_WHEEL_ACTION_SET to mpWindow::MouseWheelActionSet. */
936
942 };
943
944 mpWindow();
945 mpWindow( wxWindow* parent, wxWindowID id );
946 ~mpWindow();
947
951 wxMenu* GetPopupMenu() { return &m_popmenu; }
952
961 bool AddLayer( mpLayer* layer, bool refreshDisplay = true );
962
973 bool DelLayer( mpLayer* layer, bool alsoDeleteObject = false, bool refreshDisplay = true );
974
981 void DelAllLayers( bool alsoDeleteObject, bool refreshDisplay = true );
982
983
989 mpLayer* GetLayer( int position ) const;
990
995 const mpLayer* GetLayerByName( const wxString& name ) const;
996 mpLayer* GetLayerByName( const wxString& name )
997 {
998 return const_cast<mpLayer*>( static_cast<const mpWindow*>( this )->GetLayerByName( name ) );
999 }
1000
1005 double GetScaleX() const { return m_scaleX; };
1006
1011 double GetScaleY() const { return m_scaleY; }
1012
1017 double GetPosX() const { return m_posX; }
1018
1023 double GetPosY() const { return m_posY; }
1024
1031 int GetScrX() const { return m_scrX; }
1032 int GetXScreen() const { return m_scrX; }
1033
1040 int GetScrY() const { return m_scrY; }
1041 int GetYScreen() const { return m_scrY; }
1042
1046 void SetScaleX( double scaleX );
1047
1051 void SetScaleY( double scaleY )
1052 {
1053 if( scaleY != 0 )
1054 m_scaleY = scaleY;
1055
1056 UpdateAll();
1057 }
1058
1062 void SetPosX( double posX ) { m_posX = posX; UpdateAll(); }
1063
1067 void SetPosY( double posY ) { m_posY = posY; UpdateAll(); }
1068
1073 void SetPos( double posX, double posY ) { m_posX = posX; m_posY = posY; UpdateAll(); }
1074
1080 void SetScr( int scrX, int scrY ) { m_scrX = scrX; m_scrY = scrY; }
1081
1084 inline double p2x( wxCoord pixelCoordX ) { return m_posX + pixelCoordX / m_scaleX; }
1085
1088 inline double p2y( wxCoord pixelCoordY ) { return m_posY - pixelCoordY / m_scaleY; }
1089
1092 inline wxCoord x2p( double x ) { return (wxCoord) ( (x - m_posX) * m_scaleX ); }
1093
1096 inline wxCoord y2p( double y ) { return (wxCoord) ( (m_posY - y) * m_scaleY ); }
1097
1098
1101 void EnableDoubleBuffer( bool enabled ) { m_enableDoubleBuffer = enabled; }
1102
1105 void EnableMousePanZoom( bool enabled ) { m_enableMouseNavigation = enabled; }
1106
1109
1114 void Fit() override;
1115
1122 void Fit( double xMin, double xMax, double yMin, double yMax,
1123 const wxCoord* printSizeX = nullptr, const wxCoord* printSizeY = nullptr,
1124 wxOrientation directions = wxBOTH );
1125
1130 void ZoomIn( const wxPoint& centerPoint = wxDefaultPosition );
1131 void ZoomIn( const wxPoint& centerPoint, double zoomFactor, wxOrientation directions = wxBOTH );
1132
1137 void ZoomOut( const wxPoint& centerPoint = wxDefaultPosition );
1138 void ZoomOut( const wxPoint& centerPoint, double zoomFactor,
1139 wxOrientation directions = wxBOTH );
1140
1143 void ZoomRect( wxPoint p0, wxPoint p1 );
1144
1146 void UpdateAll();
1147
1148 // Added methods by Davide Rondini
1149
1152 unsigned int CountAllLayers() const { return m_layers.size(); };
1153
1158 double GetDesiredXmin() const { return m_desiredXmin; }
1159
1164 double GetDesiredXmax() const { return m_desiredXmax; }
1165
1170 double GetDesiredYmin() const { return m_desiredYmin; }
1171
1176 double GetDesiredYmax() const { return m_desiredYmax; }
1177
1181 void GetBoundingBox( double* bbox ) const;
1182
1188 bool SaveScreenshot( wxImage& aImage,
1189 wxSize aImageSize = wxDefaultSize, bool aFit = false );
1190
1196
1203 void SetMargins( int top, int right, int bottom, int left );
1204
1206 void SetMarginTop( int top ) { m_marginTop = top; };
1210 void SetMarginBottom( int bottom ) { m_marginBottom = bottom; };
1213
1215 int GetMarginTop() const { return m_marginTop; };
1217 int GetMarginRight() const { return m_marginRight; };
1219 int GetMarginBottom() const { return m_marginBottom; };
1221 int GetMarginLeft() const { return m_marginLeft; };
1222
1226 mpInfoLayer* IsInsideInfoLayer( wxPoint& point );
1227
1231 void SetLayerVisible( const wxString& name, bool viewable );
1232
1236 bool IsLayerVisible( const wxString& name ) const;
1237
1241 void SetLayerVisible( const unsigned int position, bool viewable );
1242
1246 bool IsLayerVisible( unsigned int position ) const;
1247
1252 void SetColourTheme( const wxColour& bgColour, const wxColour& drawColour,
1253 const wxColour& axesColour );
1254
1257 const wxColour& GetAxesColour() { return m_axColour; };
1258
1260 void LimitView( bool aEnable )
1261 {
1262 m_enableLimitedView = aEnable;
1263 }
1264
1265 void LockY( bool aLock ) { m_yLocked = aLock; }
1266 bool GetYLocked() const { return m_yLocked; }
1267
1268 void ZoomUndo();
1269 void ZoomRedo();
1270 int UndoZoomStackSize() const { return m_undoZoomStack.size(); }
1271 int RedoZoomStackSize() const { return m_redoZoomStack.size(); }
1272
1274 void AdjustLimitedView( wxOrientation directions = wxBOTH );
1275
1276 void OnFit( wxCommandEvent& event );
1277 void OnCenter( wxCommandEvent& event );
1278
1279protected:
1280 static MouseWheelActionSet defaultMouseWheelActions();
1281
1282 void pushZoomUndo( const std::array<double, 4>& aZoom );
1283
1284 void OnPaint( wxPaintEvent& event ); // !< Paint handler, will plot all attached layers
1285 void OnSize( wxSizeEvent& event ); // !< Size handler, will update scroll bar sizes
1286
1287 void OnShowPopupMenu( wxMouseEvent& event ); // !< Mouse handler, will show context menu
1288 void OnMouseMiddleDown( wxMouseEvent& event ); // !< Mouse handler, for detecting when the user
1289
1290 // !< drags with the middle button or just "clicks" for the menu
1291 void onZoomIn( wxCommandEvent& event ); // !< Context menu handler
1292 void onZoomOut( wxCommandEvent& event ); // !< Context menu handler
1293 void onZoomUndo( wxCommandEvent& event ); // !< Context menu handler
1294 void onZoomRedo( wxCommandEvent& event ); // !< Context menu handler
1295 void onMouseWheel( wxMouseEvent& event ); // !< Mouse handler for the wheel
1296 void onMagnify( wxMouseEvent& event ); // !< Pinch zoom handler
1297 void onMouseMove( wxMouseEvent& event ); // !< Mouse handler for mouse motion (for pan)
1298 void onMouseLeftDown( wxMouseEvent& event ); // !< Mouse left click (for rect zoom)
1299 void onMouseLeftDClick( wxMouseEvent& event );
1300 void onMouseLeftRelease( wxMouseEvent& event ); // !< Mouse left click (for rect zoom)
1301
1302 void DoZoom( const wxPoint& centerPoint, double zoomFactor, wxOrientation directions );
1303 void RecomputeDesiredX( double& min, double& max );
1304 void RecomputeDesiredY( double& min, double& max );
1305 wxOrientation ViewNeedsRefitting( wxOrientation directions ) const;
1306
1307 void PerformMouseWheelAction( wxMouseEvent& event, MouseWheelAction action );
1308
1312 virtual bool UpdateBBox();
1313
1317 virtual bool SetXView( double pos, double desiredMax, double desiredMin );
1318
1322 virtual bool SetYView( double pos, double desiredMax, double desiredMin );
1323
1324 // wxList m_layers; //!< List of attached plot layers
1325 wxLayerList m_layers; // !< List of attached plot layers
1326 wxMenu m_popmenu; // !< Canvas' context menu
1327 wxColour m_bgColour; // !< Background Colour
1328 wxColour m_fgColour; // !< Foreground Colour
1329 wxColour m_axColour; // !< Axes Colour
1330
1331 double m_minX; // !< Global layer bounding box, left border incl.
1332 double m_maxX; // !< Global layer bounding box, right border incl.
1333 double m_minY; // !< Global layer bounding box, bottom border incl.
1334 double m_maxY; // !< Global layer bounding box, top border incl.
1335 double m_scaleX; // !< Current view's X scale
1336 double m_scaleY; // !< Current view's Y scale
1337 double m_posX; // !< Current view's X position
1338 double m_posY; // !< Current view's Y position
1339 int m_scrX; // !< Current view's X dimension
1340 int m_scrY; // !< Current view's Y dimension
1341 int m_clickedX; // !< Last mouse click X position, for centering and zooming the view
1342 int m_clickedY; // !< Last mouse click Y position, for centering and zooming the view
1343
1345
1353
1354 // These are gaps between the curve extrema and the edges of the plot area, expressed as
1355 // a factor of global layer bounding box width/height.
1358
1360
1361 int m_last_lx, m_last_ly; // !< For double buffering
1362 wxMemoryDC m_buff_dc; // !< For double buffering
1363 wxBitmap* m_buff_bmp; // !< For double buffering
1364 bool m_enableDoubleBuffer; // !< For double buffering
1365 bool m_enableMouseNavigation; // !< For pan/zoom with the mouse.
1368 wxPoint m_mouseMClick; // !< For the middle button "drag" feature
1369 wxPoint m_mouseLClick; // !< Starting coords for rectangular zoom selection
1370 mpInfoLayer* m_movingInfoLayer; // !< For moving info layers over the window area
1373 std::stack<std::array<double, 4>> m_undoZoomStack;
1374 std::stack<std::array<double, 4>> m_redoZoomStack;
1375
1376 DECLARE_DYNAMIC_CLASS( mpWindow )
1377 DECLARE_EVENT_TABLE()
1378
1379private:
1381
1382 template <typename... Ts>
1383 mpWindow( DelegatingContructorTag, Ts&&... windowArgs );
1384
1386};
1387
1388// -----------------------------------------------------------------------------
1389// mpFXYVector - provided by Jose Luis Blanco
1390// -----------------------------------------------------------------------------
1391
1412{
1413public:
1417 mpFXYVector( const wxString& name = wxEmptyString, int flags = mpALIGN_NE );
1418
1419 virtual ~mpFXYVector() {}
1420
1425 virtual void SetData( const std::vector<double>& xs, const std::vector<double>& ys );
1426
1427 void SetSweepCount( int aSweepCount ) { m_sweepCount = aSweepCount; }
1428 void SetSweepSize( size_t aSweepSize ) { m_sweepSize = aSweepSize; }
1429 size_t GetSweepSize() const { return m_sweepSize; }
1430
1434 void Clear();
1435
1438 double GetMinX() const override { return m_minX; }
1439
1442 double GetMinY() const override { return m_minY; }
1443
1446 double GetMaxX() const override { return m_maxX; }
1447
1450 double GetMaxY() const override { return m_maxY; }
1451
1452 size_t GetCount() const override { return m_xs.size(); }
1453 int GetSweepCount() const override { return m_sweepCount; }
1454
1455protected:
1458 std::vector<double> m_xs, m_ys;
1459
1460 size_t m_index; // internal counter for the "GetNextXY" interface
1461 size_t m_sweepWindow; // last m_index of the current sweep
1462
1466 int m_sweepCount = 1; // sweeps to split data into
1467 size_t m_sweepSize = std::numeric_limits<size_t>::max(); // data-points in each sweep
1468
1472 void Rewind() override;
1473 void SetSweepWindow( int aSweepIdx ) override;
1474
1480 bool GetNextXY( double& x, double& y ) override;
1481
1482protected:
1483
1484 DECLARE_DYNAMIC_CLASS( mpFXYVector )
1485};
1486
1487
1488#endif // _MP_MATHPLOT_H_
const char * name
A class providing graphs functionality for a 2D plot (either continuous or a set of points),...
Definition mathplot.h:1412
double GetMaxY() const override
Returns the actual maximum Y data (loaded in SetData).
Definition mathplot.h:1450
void SetSweepWindow(int aSweepIdx) override
void SetSweepSize(size_t aSweepSize)
Definition mathplot.h:1428
double GetMinY() const override
Returns the actual minimum Y data (loaded in SetData).
Definition mathplot.h:1442
bool GetNextXY(double &x, double &y) override
Get locus value for next N.
double GetMinX() const override
Returns the actual minimum X data (loaded in SetData).
Definition mathplot.h:1438
mpFXYVector(const wxString &name=wxEmptyString, int flags=mpALIGN_NE)
double m_maxY
Definition mathplot.h:1465
std::vector< double > m_ys
Definition mathplot.h:1458
double m_minX
Loaded at SetData.
Definition mathplot.h:1465
std::vector< double > m_xs
The internal copy of the set of data to draw.
Definition mathplot.h:1458
size_t m_sweepWindow
Definition mathplot.h:1461
double m_maxX
Definition mathplot.h:1465
size_t GetSweepSize() const
Definition mathplot.h:1429
size_t m_sweepSize
Definition mathplot.h:1467
void Rewind() override
Rewind value enumeration with mpFXY::GetNextXY.
double GetMaxX() const override
Returns the actual maximum X data (loaded in SetData).
Definition mathplot.h:1446
int m_sweepCount
Definition mathplot.h:1466
void SetSweepCount(int aSweepCount)
Definition mathplot.h:1427
virtual ~mpFXYVector()
Definition mathplot.h:1419
size_t GetCount() const override
Definition mathplot.h:1452
size_t m_index
Definition mathplot.h:1460
int GetSweepCount() const override
Definition mathplot.h:1453
double m_minY
Definition mathplot.h:1465
Abstract base class providing plot and labeling functionality for a locus plot F:N->X,...
Definition mathplot.h:544
mpScaleBase * m_scaleX
Definition mathplot.h:589
wxCoord maxDrawY
Definition mathplot.h:587
mpScaleBase * m_scaleY
Definition mathplot.h:589
wxCoord maxDrawX
Definition mathplot.h:587
virtual void Rewind()=0
Rewind value enumeration with mpFXY::GetNextXY.
virtual void SetSweepWindow(int aSweepIdx)
Definition mathplot.h:555
virtual size_t GetCount() const =0
int m_flags
Definition mathplot.h:584
mpFXY(const wxString &name=wxEmptyString, int flags=mpALIGN_NE)
Definition mathplot.cpp:427
void UpdateViewBoundary(wxCoord xnew, wxCoord ynew)
Update label positioning data.
Definition mathplot.cpp:440
virtual int GetSweepCount() const
Definition mathplot.h:565
wxCoord minDrawX
Definition mathplot.h:587
wxCoord minDrawY
Definition mathplot.h:587
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.
Definition mathplot.h:478
virtual double GetY(double x) const =0
Get function value for argument.
mpFX(const wxString &name=wxEmptyString, int flags=mpALIGN_RIGHT)
Definition mathplot.cpp:291
virtual void Plot(wxDC &dc, mpWindow &w) override
Layer plot handler.
Definition mathplot.cpp:299
int m_flags
Definition mathplot.h:499
Abstract base class providing plot and labeling functionality for functions F:Y->X.
Definition mathplot.h:510
int m_flags
Definition mathplot.h:531
virtual double GetX(double y) const =0
Get function value for argument.
mpFY(const wxString &name=wxEmptyString, int flags=mpALIGN_TOP)
Definition mathplot.cpp:361
virtual void Plot(wxDC &dc, mpWindow &w) override
Layer plot handler.
Definition mathplot.cpp:369
Base class to create small rectangular info boxes mpInfoLayer is the base class to create a small rec...
Definition mathplot.h:330
virtual bool HasBBox() const override
mpInfoLayer has not bounding box.
Definition mathplot.h:345
wxPoint m_reference
Definition mathplot.h:383
wxRect m_dim
Definition mathplot.h:381
mpInfoLayer()
Default constructor.
Definition mathplot.cpp:78
virtual bool IsInfo() const override
Specifies that this is an Info box layer.
Definition mathplot.h:356
wxBrush m_brush
Definition mathplot.h:384
mpInfoLegend()
Default constructor.
Definition mathplot.cpp:182
virtual void Plot(wxDC &dc, mpWindow &w) override
Plot method.
Definition mathplot.cpp:199
const wxString & GetDisplayName() const
Definition mathplot.h:241
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,...
Definition mathplot.h:287
wxFont m_font
Definition mathplot.h:307
void SetFont(const wxFont &font)
Set layer font.
Definition mathplot.h:278
bool IsVisible() const
Checks whether the layer is visible or not.
Definition mathplot.h:291
const wxString & GetName() const
Get layer name.
Definition mathplot.h:239
virtual ~mpLayer()
Definition mathplot.h:153
virtual double GetMinY() const
Get inclusive bottom border of bounding box.
Definition mathplot.h:186
bool GetContinuity() const
Gets the 'continuity' property of the layer.
Definition mathplot.h:264
bool m_continuous
Definition mathplot.h:312
bool m_showName
Definition mathplot.h:313
bool m_visible
Definition mathplot.h:315
virtual bool IsInfo() const
Check whether the layer is an info box.
Definition mathplot.h:171
void SetContinuity(bool continuity)
Set the 'continuity' property of the layer (true:draws a continuous line, false:draws separate points...
Definition mathplot.h:259
void ShowName(bool show)
Shows or hides the text label with the name of the layer (default is visible).
Definition mathplot.h:268
virtual void SetName(const wxString &name)
Set layer name.
Definition mathplot.h:273
const wxFont & GetFont() const
Get font set for this layer.
Definition mathplot.h:249
const wxPen & GetPen() const
Get pen set for this layer.
Definition mathplot.h:254
mpLayerType m_type
Definition mathplot.h:314
void SetVisible(bool show)
Sets layer visibility.
Definition mathplot.h:295
wxString m_name
Definition mathplot.h:310
wxBrush m_brush
Definition mathplot.h:309
wxString m_displayName
Definition mathplot.h:311
void SetPen(const wxPen &pen)
Set layer pen.
Definition mathplot.h:283
wxPen m_pen
Definition mathplot.h:308
void SetBrush(const wxBrush &brush)
Set layer brush.
Definition mathplot.h:303
virtual double GetMaxX() const
Get inclusive right border of bounding box.
Definition mathplot.h:181
const wxBrush & GetBrush() const
Get brush set for this layer.
Definition mathplot.h:299
virtual double GetMinX() const
Get inclusive left border of bounding box.
Definition mathplot.h:176
virtual double GetMaxY() const
Get inclusive top border of bounding box.
Definition mathplot.h:191
virtual bool HasBBox() const
Check whether this layer has a bounding box.
Definition mathplot.h:162
Plot layer implementing a x-scale ruler.
Definition mathplot.h:616
void SetAxisMinMax(bool lock, double minV, double maxV)
Definition mathplot.h:685
bool m_axisLocked
Definition mathplot.h:746
double m_scale
Definition mathplot.h:739
void SetNameAlign(int align)
Definition mathplot.h:631
virtual void recalculateTicks(wxDC &dc, mpWindow &w)
Definition mathplot.h:731
double m_offset
Definition mathplot.h:739
double AbsMaxValue() const
Definition mathplot.h:675
void GetDataRange(double &minV, double &maxV) const
Definition mathplot.h:643
std::vector< double > m_tickValues
Definition mathplot.h:736
bool m_rangeSet
Definition mathplot.h:745
double AbsVisibleMaxValue() const
Definition mathplot.h:680
bool HasBBox() const override
Check whether this layer has a bounding box.
Definition mathplot.h:623
void SetAlign(int align)
Set X axis alignment.
Definition mathplot.h:629
void SetTicks(bool enable)
Set X axis ticks or grid.
Definition mathplot.h:636
virtual double TransformToPlot(double x) const
Definition mathplot.h:708
virtual void ResetDataRange()
Definition mathplot.h:670
virtual void formatLabels()
Definition mathplot.h:733
int m_maxLabelHeight
Definition mathplot.h:749
virtual bool IsHorizontal() const =0
double m_axisMin
Definition mathplot.h:747
double m_maxV
Definition mathplot.h:744
void computeLabelExtents(wxDC &dc, mpWindow &w)
Definition mathplot.cpp:800
int m_maxLabelWidth
Definition mathplot.h:750
bool GetTicks() const
Get X axis ticks or grid.
Definition mathplot.h:641
virtual void ExtendDataRange(double minV, double maxV)
Definition mathplot.h:649
std::vector< TICK_LABEL > m_tickLabels
Definition mathplot.h:737
double m_absVisibleMaxV
Definition mathplot.h:740
bool m_ticks
Definition mathplot.h:743
bool GetAxisMinMax(double *minV, double *maxV)
Definition mathplot.h:692
double m_minV
Definition mathplot.h:744
void updateTickLabels(wxDC &dc, mpWindow &w)
Definition mathplot.cpp:817
virtual void getVisibleDataRange(mpWindow &w, double &minV, double &maxV)
Definition mathplot.h:730
int m_nameFlags
Definition mathplot.h:742
virtual ~mpScaleBase()
Definition mathplot.h:619
virtual double TransformFromPlot(double xplot) const
Definition mathplot.h:709
double m_axisMax
Definition mathplot.h:748
virtual ~mpScaleXBase()
Definition mathplot.h:765
mpScaleXBase(const wxString &name=wxT("X"), int flags=mpALIGN_CENTER, bool ticks=true, unsigned int type=mpX_NORMAL)
Full constructor.
virtual bool IsHorizontal() const override
Definition mathplot.h:767
mpScaleXLog(const wxString &name=wxT("log(X)"), int flags=mpALIGN_CENTER, bool ticks=true, unsigned int type=mpX_NORMAL)
Full constructor.
virtual double TransformFromPlot(double xplot) const override
virtual double TransformToPlot(double x) const override
void recalculateTicks(wxDC &dc, mpWindow &w) override
Definition mathplot.cpp:986
virtual double TransformToPlot(double x) const override
virtual double TransformFromPlot(double xplot) const override
virtual void recalculateTicks(wxDC &dc, mpWindow &w) override
Definition mathplot.cpp:712
mpScaleX(const wxString &name=wxT("X"), int flags=mpALIGN_CENTER, bool ticks=true, unsigned int type=mpX_NORMAL)
Full constructor.
Plot layer implementing a y-scale ruler.
Definition mathplot.h:830
int m_flags
Definition mathplot.h:864
mpScaleY * m_masterScale
Definition mathplot.h:863
virtual bool IsHorizontal() const override
Definition mathplot.h:839
void SetMasterScale(mpScaleY *masterScale)
Definition mathplot.h:855
bool m_ticks
Definition mathplot.h:865
virtual bool HasBBox() const override
Check whether this layer has a bounding box.
Definition mathplot.h:850
mpScaleY(const wxString &name=wxT("Y"), int flags=mpALIGN_CENTER, bool ticks=true)
Canvas for plotting mpLayer implementations.
Definition mathplot.h:910
double m_desiredYmin
Definition mathplot.h:1352
mpInfoLayer * m_movingInfoLayer
Definition mathplot.h:1370
bool m_zooming
Definition mathplot.h:1371
int RedoZoomStackSize() const
Definition mathplot.h:1271
double m_maxY
Definition mathplot.h:1334
double m_posY
Definition mathplot.h:1338
int GetMarginLeft() const
Definition mathplot.h:1221
bool m_enableMouseNavigation
Definition mathplot.h:1365
int GetYScreen() const
Definition mathplot.h:1041
void EnableMousePanZoom(bool enabled)
Enable/disable the feature of pan/zoom with the mouse (default=enabled)
Definition mathplot.h:1105
void SetMarginLeft(int left)
Set the left margin.
Definition mathplot.h:1212
const wxColour & GetAxesColour()
Get axes draw colour.
Definition mathplot.h:1257
double m_desiredXmax
Definition mathplot.h:1352
int m_last_lx
Definition mathplot.h:1361
void SetMargins(int top, int right, int bottom, int left)
Set window margins, creating a blank area where some kinds of layers cannot draw.
MouseWheelActionSet m_mouseWheelActions
Definition mathplot.h:1367
int m_marginLeft
Definition mathplot.h:1359
int m_marginTop
Definition mathplot.h:1359
double m_minY
Definition mathplot.h:1333
int GetScrX() const
Get current view's X dimension in device context units.
Definition mathplot.h:1031
int GetScrY() const
Get current view's Y dimension in device context units.
Definition mathplot.h:1040
void SetMouseWheelActions(const MouseWheelActionSet &s)
Set the pan/zoom actions corresponding to mousewheel/trackpad events.
Definition mathplot.h:1108
double p2x(wxCoord pixelCoordX)
Converts mpWindow (screen) pixel coordinates into graph (floating point) coordinates,...
Definition mathplot.h:1084
double p2y(wxCoord pixelCoordY)
Converts mpWindow (screen) pixel coordinates into graph (floating point) coordinates,...
Definition mathplot.h:1088
wxMemoryDC m_buff_dc
Definition mathplot.h:1362
double m_maxX
Definition mathplot.h:1332
void initializeGraphicsContext()
void SetMarginRight(int right)
Set the right margin.
Definition mathplot.h:1208
int m_marginBottom
Definition mathplot.h:1359
void LimitView(bool aEnable)
Enable limiting of zooming & panning to the area used by the plots.
Definition mathplot.h:1260
int m_clickedY
Definition mathplot.h:1342
wxCoord x2p(double x)
Converts graph (floating point) coordinates into mpWindow (screen) pixel coordinates,...
Definition mathplot.h:1092
wxColour m_bgColour
Definition mathplot.h:1327
MouseWheelAction
Enumerates the possible mouse wheel actions that can be performed on the plot.
Definition mathplot.h:916
double m_leftRightPlotGapFactor
Definition mathplot.h:1357
double m_posX
Definition mathplot.h:1337
wxPoint m_mouseLClick
Definition mathplot.h:1369
void SetMarginTop(int top)
Set the top margin.
Definition mathplot.h:1206
std::stack< std::array< double, 4 > > m_redoZoomStack
Definition mathplot.h:1374
void SetPosX(double posX)
Set current view's X position and refresh display.
Definition mathplot.h:1062
double GetDesiredYmax() const
Returns the top layer-border coordinate that the user wants the mpWindow to show (it may be not exact...
Definition mathplot.h:1176
int GetXScreen() const
Definition mathplot.h:1032
int GetMarginTop() const
Definition mathplot.h:1215
double m_scaleY
Definition mathplot.h:1336
void SetMarginBottom(int bottom)
Set the bottom margin.
Definition mathplot.h:1210
void SetPosY(double posY)
Set current view's Y position and refresh display.
Definition mathplot.h:1067
int m_marginRight
Definition mathplot.h:1359
void SetScaleY(double scaleY)
Set current view's Y scale and refresh display.
Definition mathplot.h:1051
wxColour m_fgColour
Definition mathplot.h:1328
bool GetYLocked() const
Definition mathplot.h:1266
double GetDesiredYmin() const
Returns the bottom-border layer coordinate that the user wants the mpWindow to show (it may be not ex...
Definition mathplot.h:1170
double m_minX
Definition mathplot.h:1331
wxRect m_zoomRect
Definition mathplot.h:1372
void UpdateAll()
Refresh display.
wxLayerList m_layers
Definition mathplot.h:1325
wxCoord y2p(double y)
Converts graph (floating point) coordinates into mpWindow (screen) pixel coordinates,...
Definition mathplot.h:1096
double GetDesiredXmax() const
Returns the right-border layer coordinate that the user wants the mpWindow to show (it may be not exa...
Definition mathplot.h:1164
wxMenu m_popmenu
Definition mathplot.h:1326
bool m_enableLimitedView
Definition mathplot.h:1366
int m_clickedX
Definition mathplot.h:1341
wxBitmap * m_buff_bmp
Definition mathplot.h:1363
double m_topBottomPlotGapFactor
Definition mathplot.h:1356
wxMenu * GetPopupMenu()
Get reference to context menu of the plot canvas.
Definition mathplot.h:951
double GetDesiredXmin() const
Returns the left-border layer coordinate that the user wants the mpWindow to show (it may be not exac...
Definition mathplot.h:1158
wxPoint m_mouseMClick
Definition mathplot.h:1368
double m_desiredYmax
Definition mathplot.h:1352
std::stack< std::array< double, 4 > > m_undoZoomStack
Definition mathplot.h:1373
int GetMarginRight() const
Definition mathplot.h:1217
void SetScr(int scrX, int scrY)
Set current view's dimensions in device context units.
Definition mathplot.h:1080
int GetMarginBottom() const
Definition mathplot.h:1219
void EnableDoubleBuffer(bool enabled)
Enable/disable the double-buffering of the window, eliminating the flicker (default=disabled).
Definition mathplot.h:1101
wxColour m_axColour
Definition mathplot.h:1329
static double zoomIncrementalFactor
This value sets the zoom steps whenever the user clicks "Zoom in/out" or performs zoom with the mouse...
Definition mathplot.h:1195
mpLayer * GetLayerByName(const wxString &name)
Definition mathplot.h:996
bool m_yLocked
Definition mathplot.h:1344
int UndoZoomStackSize() const
Definition mathplot.h:1270
double m_desiredXmin
These are updated in Fit, ZoomIn, ZoomOut, ZoomRect, SetXView, SetYView and may be different from the...
Definition mathplot.h:1352
double m_scaleX
Definition mathplot.h:1335
bool m_enableDoubleBuffer
Definition mathplot.h:1364
void LockY(bool aLock)
Definition mathplot.h:1265
unsigned int CountAllLayers() const
Counts the number of plot layers, whether or not they have a bounding box.
Definition mathplot.h:1152
void SetPos(double posX, double posY)
Set current view's X and Y position and refresh display.
Definition mathplot.h:1073
double GetScaleY() const
Get current view's Y scale.
Definition mathplot.h:1011
int m_scrY
Definition mathplot.h:1340
double GetScaleX() const
Get current view's X scale.
Definition mathplot.h:1005
double GetPosY() const
Get current view's Y position.
Definition mathplot.h:1023
double GetPosX() const
Get current view's X position.
Definition mathplot.h:1017
int m_scrX
Definition mathplot.h:1339
int m_last_ly
Definition mathplot.h:1361
class WXDLLIMPEXP_MATHPLOT mpFY
Definition mathplot.h:104
class WXDLLIMPEXP_MATHPLOT mpWindow
Definition mathplot.h:109
class WXDLLIMPEXP_MATHPLOT mpPrintout
Definition mathplot.h:110
class WXDLLIMPEXP_MATHPLOT mpFXYVector
Definition mathplot.h:106
__mp_Layer_Type
Definition mathplot.h:128
@ mpLAYER_INFO
Definition mathplot.h:132
@ mpLAYER_BITMAP
Definition mathplot.h:133
@ mpLAYER_UNDEF
Definition mathplot.h:129
@ mpLAYER_AXIS
Definition mathplot.h:130
@ mpLAYER_PLOT
Definition mathplot.h:131
#define mpALIGN_RIGHT
Aligns label to the right.
Definition mathplot.h:429
enum __mp_Layer_Type mpLayerType
std::deque< mpLayer * > wxLayerList
Define the type for the list of layers inside mpWindow.
Definition mathplot.h:885
class WXDLLIMPEXP_MATHPLOT mpFXY
Definition mathplot.h:105
#define mpALIGN_CENTER
Aligns label to the center.
Definition mathplot.h:431
#define mpALIGN_TOP
Aligns label to the top.
Definition mathplot.h:435
#define WXDLLIMPEXP_MATHPLOT
wxMathPlot is a framework for mathematical graph plotting in wxWindows.
Definition mathplot.h:62
@ mpID_ZOOM_REDO
Definition mathplot.h:117
@ mpID_FIT
Definition mathplot.h:115
@ mpID_ZOOM_IN
Definition mathplot.h:118
@ mpID_CENTER
Definition mathplot.h:120
@ mpID_ZOOM_UNDO
Definition mathplot.h:116
@ mpID_ZOOM_OUT
Definition mathplot.h:119
class WXDLLIMPEXP_MATHPLOT mpLayer
Definition mathplot.h:102
class WXDLLIMPEXP_MATHPLOT mpFX
Definition mathplot.h:103
class WXDLLIMPEXP_MATHPLOT mpScaleX
Definition mathplot.h:107
class WXDLLIMPEXP_MATHPLOT mpScaleY
Definition mathplot.h:108
#define mpX_NORMAL
Set label for X axis in normal mode.
Definition mathplot.h:445
#define mpALIGN_NE
Aligns label to north-east.
Definition mathplot.h:459
EDA_ANGLE abs(const EDA_ANGLE &aAngle)
Definition eda_angle.h:400
TICK_LABEL(double pos_=0.0, const wxString &label_=wxT(""))
Definition mathplot.h:713
Contains the set of modified mouse wheel actions that can be performed on the plot.
Definition mathplot.h:931
MouseWheelAction horizontal
Definition mathplot.h:941
MouseWheelAction verticalWithShift
Definition mathplot.h:939
MouseWheelAction verticalWithCtrl
Definition mathplot.h:938
MouseWheelAction verticalWithAlt
Definition mathplot.h:940
MouseWheelAction verticalUnmodified
Definition mathplot.h:937
int delta