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
119bool WXDLLIMPEXP_MATHPLOT mpFiniteRange( const std::vector<double>& aValues, double& aMin,
120 double& aMax );
121
123enum
124{
125 mpID_FIT = 2000, // !< Fit view to match bounding box of all layers
128 mpID_ZOOM_IN, // !< Zoom into view at clickposition / window center
129 mpID_ZOOM_OUT, // !< Zoom out
130 mpID_CENTER, // !< Center view on click position
131};
132
133// -----------------------------------------------------------------------------
134// mpLayer
135// -----------------------------------------------------------------------------
136
137typedef enum __mp_Layer_Type
138{
139 mpLAYER_UNDEF, // !< Layer type undefined
140 mpLAYER_AXIS, // !< Axis type layer
141 mpLAYER_PLOT, // !< Plot type layer
142 mpLAYER_INFO, // !< Info box type layer
143 mpLAYER_BITMAP // !< Bitmap type layer
145
156class mpScaleBase;
157
158class WXDLLIMPEXP_MATHPLOT mpLayer : public wxObject
159{
160public:
161 mpLayer();
162
163 virtual ~mpLayer() {};
164
172 virtual bool HasBBox() const { return true; }
173
181 virtual bool IsInfo() const { return false; };
182
186 virtual double GetMinX() const { return -1.0; }
187
191 virtual double GetMaxX() const { return 1.0; }
192
196 virtual double GetMinY() const { return -1.0; }
197
201 virtual double GetMaxY() const { return 1.0; }
202
244 virtual void Plot( wxDC& dc, mpWindow& w ) = 0;
245
249 const wxString& GetName() const { return m_name; }
250
251 const wxString& GetDisplayName() const
252 {
253 return m_displayName.IsEmpty() ? m_name : m_displayName;
254 }
255
259 const wxFont& GetFont() const { return m_font; }
260
269 const wxFont& GetPlotFont() const
270 {
271 if( m_font.IsOk() )
272 return m_font;
273
274 return *wxSMALL_FONT;
275 }
276
280 const wxPen& GetPen() const { return m_pen; }
281
285 void SetContinuity( bool continuity ) { m_continuous = continuity; }
286
290 bool GetContinuity() const { return m_continuous; }
291
294 void ShowName( bool show ) { m_showName = show; };
295
299 virtual void SetName( const wxString& name ) { m_name = name; }
300
304 void SetFont( const wxFont& font ) { m_font = font; }
305
309 void SetPen( const wxPen& pen ) { m_pen = pen; }
310
313 mpLayerType GetLayerType() const { return m_type; };
314
317 bool IsVisible() const { return m_visible; };
318
321 void SetVisible( bool show ) { m_visible = show; };
322
325 const wxBrush& GetBrush() const { return m_brush; };
326
329 void SetBrush( const wxBrush& brush ) { m_brush = brush; };
330
331protected:
332
333 wxFont m_font; // !< Layer's font
334 wxPen m_pen; // !< Layer's pen
335 wxBrush m_brush; // !< Layer's brush
336 wxString m_name; // !< Layer's name
338 bool m_continuous; // !< Specify if the layer will be plotted as a continuous line or a set of points.
339 bool m_showName; // !< States whether the name of the layer must be shown (default is true).
340 mpLayerType m_type; // !< Define layer type, which is assigned by constructor
341 bool m_visible; // !< Toggles layer visibility
342
343 DECLARE_DYNAMIC_CLASS( mpLayer )
344};
345
346
347// -----------------------------------------------------------------------------
348// mpInfoLayer
349// -----------------------------------------------------------------------------
350
356{
357public:
359 mpInfoLayer();
360
364 mpInfoLayer( wxRect rect, const wxBrush* brush = wxTRANSPARENT_BRUSH );
365
367 virtual ~mpInfoLayer();
368
371 virtual bool HasBBox() const override { return false; }
372
377 virtual void Plot( wxDC& dc, mpWindow& w ) override;
378
382 virtual bool IsInfo() const override { return true; }
383
387 virtual bool Inside( const wxPoint& point ) const;
388
389 virtual bool OnDoubleClick( const wxPoint& point, mpWindow& w );
390
393 virtual void Move( wxPoint delta );
394
396 virtual void UpdateReference();
397
400 wxPoint GetPosition() const;
401
404 wxSize GetSize() const;
405
406protected:
407 wxRect m_dim; // !< The bounding rectangle of the box. It may be resized dynamically
408 // by the Plot method.
409 wxPoint m_reference; // !< Holds the reference point for movements
410 wxBrush m_brush; // !< The brush to be used for the background
411 int m_winX; // !< Holds the mpWindow size. Used to rescale position when window is
412 int m_winY; // resized.
413
414 DECLARE_DYNAMIC_CLASS( mpInfoLayer )
415};
416
421{
422public:
424 mpInfoLegend();
425
430 mpInfoLegend( wxRect rect, const wxBrush* brush = wxTRANSPARENT_BRUSH );
431
434
439 virtual void Plot( wxDC& dc, mpWindow& w ) override;
440
441protected:
442};
443
444
445// -----------------------------------------------------------------------------
446// mpLayer implementations - functions
447// -----------------------------------------------------------------------------
448
451
453#define mpALIGNMASK 0x03
455#define mpALIGN_RIGHT 0x00
457#define mpALIGN_CENTER 0x01
459#define mpALIGN_LEFT 0x02
461#define mpALIGN_TOP mpALIGN_RIGHT
463#define mpALIGN_BOTTOM mpALIGN_LEFT
465#define mpALIGN_BORDER_BOTTOM 0x04
467#define mpALIGN_BORDER_TOP 0x05
469#define mpALIGN_FAR_RIGHT 0x06
471#define mpX_NORMAL 0x00
473#define mpX_TIME 0x01
475#define mpX_HOURS 0x02
477#define mpX_DATE 0x03
479#define mpX_DATETIME 0x04
481#define mpALIGN_BORDER_LEFT mpALIGN_BORDER_BOTTOM
483#define mpALIGN_BORDER_RIGHT mpALIGN_BORDER_TOP
485#define mpALIGN_NE 0x00
487#define mpALIGN_NW 0x01
489#define mpALIGN_SW 0x02
491#define mpALIGN_SE 0x03
492
494
497
504{
505public:
509 mpFX( const wxString& name = wxEmptyString, int flags = mpALIGN_RIGHT );
510
516 virtual double GetY( double x ) const = 0;
517
522 virtual void Plot( wxDC& dc, mpWindow& w ) override;
523
524protected:
525 int m_flags; // !< Holds label alignment
526
527 DECLARE_DYNAMIC_CLASS( mpFX )
528};
529
536{
537public:
541 mpFY( const wxString& name = wxEmptyString, int flags = mpALIGN_TOP );
542
548 virtual double GetX( double y ) const = 0;
549
554 virtual void Plot( wxDC& dc, mpWindow& w ) override;
555
556protected:
557 int m_flags; // !< Holds label alignment
558
559 DECLARE_DYNAMIC_CLASS( mpFY )
560};
561
568
570{
571public:
575 mpFXY( const wxString& name = wxEmptyString, int flags = mpALIGN_NE );
576
580 virtual void Rewind() = 0;
581 virtual void SetSweepWindow( int aSweepIdx ) { Rewind(); }
582
588 virtual bool GetNextXY( double& x, double& y ) = 0;
589
590 virtual size_t GetCount() const = 0;
591 virtual int GetSweepCount() const { return 1; }
592
597 virtual void Plot( wxDC& dc, mpWindow& w ) override;
598
599 virtual void SetScale( mpScaleBase* scaleX, mpScaleBase* scaleY );
600
601 void UpdateScales();
602
603 double s2x( double plotCoordX ) const;
604 double s2y( double plotCoordY ) const;
605
606 double x2s( double x ) const;
607 double y2s( double y ) const;
608
609protected:
610 int m_flags; // !< Holds label alignment
611
612 // Data to calculate label positioning
614 // int drawnPoints;
616
621 void UpdateViewBoundary( wxCoord xnew, wxCoord ynew );
622
623 DECLARE_DYNAMIC_CLASS( mpFXY )
624};
625
627
628// -----------------------------------------------------------------------------
629// mpLayer implementations - furniture (scales, ...)
630// -----------------------------------------------------------------------------
631
634
639
640
642{
643public:
644 mpScaleBase();
645 virtual ~mpScaleBase() {};
646
647 virtual bool IsHorizontal() const = 0;
648
649 bool HasBBox() const override { return false; }
650
655 void SetAlign( int align ) { m_flags = align; };
656
657 void SetNameAlign( int align ) { m_nameFlags = align; }
658
662 void SetTicks( bool enable ) { m_ticks = enable; };
663
667 bool GetTicks() const { return m_ticks; };
668
669 void GetDataRange( double& minV, double& maxV ) const
670 {
671 minV = m_minV;
672 maxV = m_maxV;
673 }
674
675 virtual void ExtendDataRange( double minV, double maxV )
676 {
677 if( !m_rangeSet )
678 {
679 m_minV = minV;
680 m_maxV = maxV;
681 m_rangeSet = true;
682 }
683 else
684 {
685 m_minV = std::min( minV, m_minV );
686 m_maxV = std::max( maxV, m_maxV );
687 }
688
689 if( m_minV == m_maxV )
690 {
691 m_minV = m_minV - 1.0;
692 m_maxV = m_maxV + 1.0;
693 }
694 }
695
700 void SetDataRange( double minV, double maxV )
701 {
702 m_minV = minV;
703 m_maxV = maxV;
704 m_rangeSet = true;
705
706 if( m_minV == m_maxV )
707 {
708 m_minV = m_minV - 1.0;
709 m_maxV = m_maxV + 1.0;
710 }
711 }
712
713 virtual void ResetDataRange()
714 {
715 m_rangeSet = false;
716 }
717
718 double AbsMaxValue() const
719 {
720 return std::max( std::abs( m_maxV ), std::abs( m_minV ) );
721 }
722
723 double AbsVisibleMaxValue() const
724 {
725 return m_absVisibleMaxV;
726 }
727
728 void SetAxisMinMax( bool lock, double minV, double maxV )
729 {
730 m_axisLocked = lock;
731 m_axisMin = minV;
732 m_axisMax = maxV;
733 }
734
735 bool GetAxisMinMax( double* minV, double* maxV )
736 {
737 if( m_axisLocked )
738 {
739 *minV = m_axisMin;
740 *maxV = m_axisMax;
741 }
742 else if( !m_tickValues.empty() )
743 {
744 *minV = m_tickValues.front();
745 *maxV = m_tickValues.back();
746 }
747
748 return m_axisLocked;
749 }
750
751 virtual double TransformToPlot( double x ) const { return 0.0; };
752 virtual double TransformFromPlot( double xplot ) const { return 0.0; };
753
755 {
756 TICK_LABEL( double pos_ = 0.0, const wxString& label_ = wxT( "" ) ) :
757 pos( pos_ ),
758 label( label_ ),
759 visible( true )
760 {}
761
762 double pos;
763 wxString label;
765 };
766
767protected:
768
769 void updateTickLabels( wxDC& dc, mpWindow& w );
770 void computeLabelExtents( wxDC& dc, mpWindow& w );
771
772 // virtual int getLabelDecimalDigits(int maxDigits) const;
773 virtual void getVisibleDataRange( mpWindow& w, double& minV, double& maxV ) {};
774 virtual void recalculateTicks( wxDC& dc, mpWindow& w ) {};
775
776 virtual void formatLabels() {};
777
778protected:
779 std::vector<double> m_tickValues;
780 std::vector<TICK_LABEL> m_tickLabels;
781
784 int m_flags; // !< Flag for axis alignment
786 bool m_ticks; // !< Flag to toggle between ticks or grid
787 double m_minV, m_maxV;
790 double m_axisMin;
791 double m_axisMax;
794};
795
797{
798public:
806 mpScaleXBase( const wxString& name = wxT( "X" ), int flags = mpALIGN_CENTER, bool ticks = true,
807 unsigned int type = mpX_NORMAL );
808 virtual ~mpScaleXBase() {};
809
810 virtual bool IsHorizontal() const override { return true; }
811 virtual void Plot( wxDC& dc, mpWindow& w ) override;
812
813 virtual void getVisibleDataRange( mpWindow& w, double& minV, double& maxV ) override;
814
815 DECLARE_DYNAMIC_CLASS( mpScaleXBase )
816};
817
818
820{
821public:
829 mpScaleX( const wxString& name = wxT( "X" ), int flags = mpALIGN_CENTER, bool ticks = true,
830 unsigned int type = mpX_NORMAL );
831
832 virtual double TransformToPlot( double x ) const override;
833 virtual double TransformFromPlot( double xplot ) const override;
834
835protected:
836 virtual void recalculateTicks( wxDC& dc, mpWindow& w ) override;
837
838 DECLARE_DYNAMIC_CLASS( mpScaleX )
839};
840
841
843{
844public:
852 mpScaleXLog( const wxString& name = wxT( "log(X)" ), int flags = mpALIGN_CENTER,
853 bool ticks = true, unsigned int type = mpX_NORMAL );
854
855 virtual double TransformToPlot( double x ) const override;
856 virtual double TransformFromPlot( double xplot ) const override;
857
858protected:
859 void recalculateTicks( wxDC& dc, mpWindow& w ) override;
860
861 DECLARE_DYNAMIC_CLASS( mpScaleXLog )
862};
863
864
873{
874public:
880 mpScaleY( const wxString& name = wxT( "Y" ), int flags = mpALIGN_CENTER, bool ticks = true );
881
882 virtual bool IsHorizontal() const override { return false; }
883
887 virtual void Plot( wxDC& dc, mpWindow& w ) override;
888
893 virtual bool HasBBox() const override { return false; }
894
895 virtual double TransformToPlot( double x ) const override;
896 virtual double TransformFromPlot( double xplot ) const override;
897
898 void SetMasterScale( mpScaleY* masterScale ) { m_masterScale = masterScale; }
899
900protected:
901 virtual void getVisibleDataRange( mpWindow& w, double& minV, double& maxV ) override;
902 virtual void recalculateTicks( wxDC& dc, mpWindow& w ) override;
903
904 void computeSlaveTicks( mpWindow& w );
905
907 int m_flags; // !< Flag for axis alignment
908 bool m_ticks; // !< Flag to toggle between ticks or grid
909
910 DECLARE_DYNAMIC_CLASS( mpScaleY )
911};
912
913// -----------------------------------------------------------------------------
914// mpWindow
915// -----------------------------------------------------------------------------
916
919
921#define mpMOUSEMODE_DRAG 0
923#define mpMOUSEMODE_ZOOMBOX 1
924
927// WX_DECLARE_HASH_MAP( int, mpLayer*, wxIntegerHash, wxIntegerEqual, wxLayerList );
928typedef std::deque<mpLayer*> wxLayerList;
929
952class WXDLLIMPEXP_MATHPLOT mpWindow : public wxWindow
953{
954public:
969
974 {
975 /* If this bundled wxMathPlot implementation is to remain single-header and not dependent
976 * on any part of KiCad, then the SIM_MOUSE_WHEEL_ACTION_SET struct must be duplicated
977 * here. SIM_PLOT_TAB::convertMouseWheelActions is used to convert from
978 * SIM_MOUSE_WHEEL_ACTION_SET to mpWindow::MouseWheelActionSet. */
979
985 };
986
987 mpWindow();
988 mpWindow( wxWindow* parent, wxWindowID id );
989 ~mpWindow();
990
994 wxMenu* GetPopupMenu() { return &m_popmenu; }
995
1004 bool AddLayer( mpLayer* layer, bool refreshDisplay = true );
1005
1016 bool DelLayer( mpLayer* layer, bool alsoDeleteObject = false, bool refreshDisplay = true );
1017
1024 void DelAllLayers( bool alsoDeleteObject, bool refreshDisplay = true );
1025
1026
1032 mpLayer* GetLayer( int position ) const;
1033
1038 const mpLayer* GetLayerByName( const wxString& name ) const;
1039 mpLayer* GetLayerByName( const wxString& name )
1040 {
1041 return const_cast<mpLayer*>( static_cast<const mpWindow*>( this )->GetLayerByName( name ) );
1042 }
1043
1048 double GetScaleX() const { return m_scaleX; };
1049
1054 double GetScaleY() const { return m_scaleY; }
1055
1060 double GetPosX() const { return m_posX; }
1061
1066 double GetPosY() const { return m_posY; }
1067
1074 int GetScrX() const { return m_scrX; }
1075 int GetXScreen() const { return m_scrX; }
1076
1083 int GetScrY() const { return m_scrY; }
1084 int GetYScreen() const { return m_scrY; }
1085
1089 void SetScaleX( double scaleX );
1090
1094 void SetScaleY( double scaleY )
1095 {
1096 if( scaleY != 0 )
1097 m_scaleY = scaleY;
1098
1099 UpdateAll();
1100 }
1101
1105 void SetPosX( double posX ) { m_posX = posX; UpdateAll(); }
1106
1110 void SetPosY( double posY ) { m_posY = posY; UpdateAll(); }
1111
1116 void SetPos( double posX, double posY ) { m_posX = posX; m_posY = posY; UpdateAll(); }
1117
1123 void SetScr( int scrX, int scrY ) { m_scrX = scrX; m_scrY = scrY; }
1124
1127 inline double p2x( wxCoord pixelCoordX ) { return m_posX + pixelCoordX / m_scaleX; }
1128
1131 inline double p2y( wxCoord pixelCoordY ) { return m_posY - pixelCoordY / m_scaleY; }
1132
1135 inline wxCoord x2p( double x ) { return (wxCoord) ( (x - m_posX) * m_scaleX ); }
1136
1139 inline wxCoord y2p( double y ) { return (wxCoord) ( (m_posY - y) * m_scaleY ); }
1140
1141
1144 void EnableDoubleBuffer( bool enabled ) { m_enableDoubleBuffer = enabled; }
1145
1148 void EnableMousePanZoom( bool enabled ) { m_enableMouseNavigation = enabled; }
1149
1152
1157 void Fit() override;
1158
1165 void Fit( double xMin, double xMax, double yMin, double yMax,
1166 const wxCoord* printSizeX = nullptr, const wxCoord* printSizeY = nullptr,
1167 wxOrientation directions = wxBOTH );
1168
1173 void ZoomIn( const wxPoint& centerPoint = wxDefaultPosition );
1174 void ZoomIn( const wxPoint& centerPoint, double zoomFactor, wxOrientation directions = wxBOTH );
1175
1180 void ZoomOut( const wxPoint& centerPoint = wxDefaultPosition );
1181 void ZoomOut( const wxPoint& centerPoint, double zoomFactor,
1182 wxOrientation directions = wxBOTH );
1183
1186 void ZoomRect( wxPoint p0, wxPoint p1 );
1187
1189 void UpdateAll();
1190
1191 // Added methods by Davide Rondini
1192
1195 unsigned int CountAllLayers() const { return m_layers.size(); };
1196
1201 double GetDesiredXmin() const { return m_desiredXmin; }
1202
1207 double GetDesiredXmax() const { return m_desiredXmax; }
1208
1213 double GetDesiredYmin() const { return m_desiredYmin; }
1214
1219 double GetDesiredYmax() const { return m_desiredYmax; }
1220
1224 void GetBoundingBox( double* bbox ) const;
1225
1231 bool SaveScreenshot( wxImage& aImage,
1232 wxSize aImageSize = wxDefaultSize, bool aFit = false );
1233
1239
1246 void SetMargins( int top, int right, int bottom, int left );
1247
1249 void SetMarginTop( int top ) { m_marginTop = top; };
1253 void SetMarginBottom( int bottom ) { m_marginBottom = bottom; };
1256
1258 int GetMarginTop() const { return m_marginTop; };
1260 int GetMarginRight() const { return m_marginRight; };
1262 int GetMarginBottom() const { return m_marginBottom; };
1264 int GetMarginLeft() const { return m_marginLeft; };
1265
1269 mpInfoLayer* IsInsideInfoLayer( wxPoint& point );
1270
1274 void SetLayerVisible( const wxString& name, bool viewable );
1275
1279 bool IsLayerVisible( const wxString& name ) const;
1280
1284 void SetLayerVisible( const unsigned int position, bool viewable );
1285
1289 bool IsLayerVisible( unsigned int position ) const;
1290
1295 void SetColourTheme( const wxColour& bgColour, const wxColour& drawColour,
1296 const wxColour& axesColour );
1297
1300 const wxColour& GetAxesColour() { return m_axColour; };
1301
1303 void LimitView( bool aEnable )
1304 {
1305 m_enableLimitedView = aEnable;
1306 }
1307
1308 void LockY( bool aLock ) { m_yLocked = aLock; }
1309 bool GetYLocked() const { return m_yLocked; }
1310
1311 void ZoomUndo();
1312 void ZoomRedo();
1313 int UndoZoomStackSize() const { return m_undoZoomStack.size(); }
1314 int RedoZoomStackSize() const { return m_redoZoomStack.size(); }
1315
1317 void AdjustLimitedView( wxOrientation directions = wxBOTH );
1318
1319 void OnFit( wxCommandEvent& event );
1320 void OnCenter( wxCommandEvent& event );
1321
1322protected:
1323 static MouseWheelActionSet defaultMouseWheelActions();
1324
1325 void pushZoomUndo( const std::array<double, 4>& aZoom );
1326
1327 void OnPaint( wxPaintEvent& event ); // !< Paint handler, will plot all attached layers
1328 void OnSize( wxSizeEvent& event ); // !< Size handler, will update scroll bar sizes
1329
1330 void OnShowPopupMenu( wxMouseEvent& event ); // !< Mouse handler, will show context menu
1331 void OnMouseMiddleDown( wxMouseEvent& event ); // !< Mouse handler, for detecting when the user
1332
1333 // !< drags with the middle button or just "clicks" for the menu
1334 void onZoomIn( wxCommandEvent& event ); // !< Context menu handler
1335 void onZoomOut( wxCommandEvent& event ); // !< Context menu handler
1336 void onZoomUndo( wxCommandEvent& event ); // !< Context menu handler
1337 void onZoomRedo( wxCommandEvent& event ); // !< Context menu handler
1338 void onMouseWheel( wxMouseEvent& event ); // !< Mouse handler for the wheel
1339 void onMagnify( wxMouseEvent& event ); // !< Pinch zoom handler
1340 void onMouseMove( wxMouseEvent& event ); // !< Mouse handler for mouse motion (for pan)
1341 void onMouseLeftDown( wxMouseEvent& event ); // !< Mouse left click (for rect zoom)
1342 void onMouseLeftDClick( wxMouseEvent& event );
1343 void onMouseLeftRelease( wxMouseEvent& event ); // !< Mouse left click (for rect zoom)
1344
1345 void DoZoom( const wxPoint& centerPoint, double zoomFactor, wxOrientation directions );
1346 void RecomputeDesiredX( double& min, double& max );
1347 void RecomputeDesiredY( double& min, double& max );
1348 wxOrientation ViewNeedsRefitting( wxOrientation directions ) const;
1349
1350 void PerformMouseWheelAction( wxMouseEvent& event, MouseWheelAction action );
1351
1355 virtual bool UpdateBBox();
1356
1360 virtual bool SetXView( double pos, double desiredMax, double desiredMin );
1361
1365 virtual bool SetYView( double pos, double desiredMax, double desiredMin );
1366
1371 virtual void OnXViewChanged() {}
1372
1373 // wxList m_layers; //!< List of attached plot layers
1374 wxLayerList m_layers; // !< List of attached plot layers
1375 wxMenu m_popmenu; // !< Canvas' context menu
1376 wxColour m_bgColour; // !< Background Colour
1377 wxColour m_fgColour; // !< Foreground Colour
1378 wxColour m_axColour; // !< Axes Colour
1379
1380 double m_minX; // !< Global layer bounding box, left border incl.
1381 double m_maxX; // !< Global layer bounding box, right border incl.
1382 double m_minY; // !< Global layer bounding box, bottom border incl.
1383 double m_maxY; // !< Global layer bounding box, top border incl.
1384 double m_scaleX; // !< Current view's X scale
1385 double m_scaleY; // !< Current view's Y scale
1386 double m_posX; // !< Current view's X position
1387 double m_posY; // !< Current view's Y position
1388 int m_scrX; // !< Current view's X dimension
1389 int m_scrY; // !< Current view's Y dimension
1390 int m_clickedX; // !< Last mouse click X position, for centering and zooming the view
1391 int m_clickedY; // !< Last mouse click Y position, for centering and zooming the view
1392
1394
1402
1403 // These are gaps between the curve extrema and the edges of the plot area, expressed as
1404 // a factor of global layer bounding box width/height.
1407
1409
1410 int m_last_lx, m_last_ly; // !< For double buffering
1411 wxMemoryDC m_buff_dc; // !< For double buffering
1412 wxBitmap* m_buff_bmp; // !< For double buffering
1413 bool m_enableDoubleBuffer; // !< For double buffering
1414 bool m_enableMouseNavigation; // !< For pan/zoom with the mouse.
1417 wxPoint m_mouseMClick; // !< For the middle button "drag" feature
1418 wxPoint m_mouseLClick; // !< Starting coords for rectangular zoom selection
1419 mpInfoLayer* m_movingInfoLayer; // !< For moving info layers over the window area
1422 std::stack<std::array<double, 4>> m_undoZoomStack;
1423 std::stack<std::array<double, 4>> m_redoZoomStack;
1424
1425 DECLARE_DYNAMIC_CLASS( mpWindow )
1426 DECLARE_EVENT_TABLE()
1427
1428private:
1430
1431 template <typename... Ts>
1432 mpWindow( DelegatingContructorTag, Ts&&... windowArgs );
1433
1435};
1436
1437// -----------------------------------------------------------------------------
1438// mpFXYVector - provided by Jose Luis Blanco
1439// -----------------------------------------------------------------------------
1440
1461{
1462public:
1466 mpFXYVector( const wxString& name = wxEmptyString, int flags = mpALIGN_NE );
1467
1468 virtual ~mpFXYVector() {}
1469
1474 virtual void SetData( const std::vector<double>& xs, const std::vector<double>& ys );
1475
1476 void SetSweepCount( int aSweepCount ) { m_sweepCount = aSweepCount; }
1477 void SetSweepSize( size_t aSweepSize ) { m_sweepSize = aSweepSize; }
1478 size_t GetSweepSize() const { return m_sweepSize; }
1479
1483 void Clear();
1484
1487 double GetMinX() const override { return m_minX; }
1488
1491 double GetMinY() const override { return m_minY; }
1492
1495 double GetMaxX() const override { return m_maxX; }
1496
1499 double GetMaxY() const override { return m_maxY; }
1500
1501 size_t GetCount() const override { return m_xs.size(); }
1502 int GetSweepCount() const override { return m_sweepCount; }
1503
1504protected:
1507 std::vector<double> m_xs, m_ys;
1508
1509 size_t m_index; // internal counter for the "GetNextXY" interface
1510 size_t m_sweepWindow; // last m_index of the current sweep
1511
1515 int m_sweepCount = 1; // sweeps to split data into
1516 size_t m_sweepSize = std::numeric_limits<size_t>::max(); // data-points in each sweep
1517
1521 void Rewind() override;
1522 void SetSweepWindow( int aSweepIdx ) override;
1523
1529 bool GetNextXY( double& x, double& y ) override;
1530
1531protected:
1532
1533 DECLARE_DYNAMIC_CLASS( mpFXYVector )
1534};
1535
1536
1537#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:1461
double GetMaxY() const override
Returns the actual maximum Y data (loaded in SetData).
Definition mathplot.h:1499
void SetSweepWindow(int aSweepIdx) override
void SetSweepSize(size_t aSweepSize)
Definition mathplot.h:1477
double GetMinY() const override
Returns the actual minimum Y data (loaded in SetData).
Definition mathplot.h:1491
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:1487
mpFXYVector(const wxString &name=wxEmptyString, int flags=mpALIGN_NE)
double m_maxY
Definition mathplot.h:1514
std::vector< double > m_ys
Definition mathplot.h:1507
double m_minX
Loaded at SetData.
Definition mathplot.h:1514
std::vector< double > m_xs
The internal copy of the set of data to draw.
Definition mathplot.h:1507
size_t m_sweepWindow
Definition mathplot.h:1510
double m_maxX
Definition mathplot.h:1514
size_t GetSweepSize() const
Definition mathplot.h:1478
size_t m_sweepSize
Definition mathplot.h:1516
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:1495
int m_sweepCount
Definition mathplot.h:1515
void SetSweepCount(int aSweepCount)
Definition mathplot.h:1476
virtual ~mpFXYVector()
Definition mathplot.h:1468
size_t GetCount() const override
Definition mathplot.h:1501
size_t m_index
Definition mathplot.h:1509
int GetSweepCount() const override
Definition mathplot.h:1502
double m_minY
Definition mathplot.h:1514
Abstract base class providing plot and labeling functionality for a locus plot F:N->X,...
Definition mathplot.h:570
mpScaleBase * m_scaleX
Definition mathplot.h:615
wxCoord maxDrawY
Definition mathplot.h:613
mpScaleBase * m_scaleY
Definition mathplot.h:615
wxCoord maxDrawX
Definition mathplot.h:613
virtual void Rewind()=0
Rewind value enumeration with mpFXY::GetNextXY.
virtual void SetSweepWindow(int aSweepIdx)
Definition mathplot.h:581
virtual size_t GetCount() const =0
int m_flags
Definition mathplot.h:610
mpFXY(const wxString &name=wxEmptyString, int flags=mpALIGN_NE)
Definition mathplot.cpp:458
void UpdateViewBoundary(wxCoord xnew, wxCoord ynew)
Update label positioning data.
Definition mathplot.cpp:471
virtual int GetSweepCount() const
Definition mathplot.h:591
wxCoord minDrawX
Definition mathplot.h:613
wxCoord minDrawY
Definition mathplot.h:613
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:504
virtual double GetY(double x) const =0
Get function value for argument.
mpFX(const wxString &name=wxEmptyString, int flags=mpALIGN_RIGHT)
Definition mathplot.cpp:322
virtual void Plot(wxDC &dc, mpWindow &w) override
Layer plot handler.
Definition mathplot.cpp:330
int m_flags
Definition mathplot.h:525
Abstract base class providing plot and labeling functionality for functions F:Y->X.
Definition mathplot.h:536
int m_flags
Definition mathplot.h:557
virtual double GetX(double y) const =0
Get function value for argument.
mpFY(const wxString &name=wxEmptyString, int flags=mpALIGN_TOP)
Definition mathplot.cpp:392
virtual void Plot(wxDC &dc, mpWindow &w) override
Layer plot handler.
Definition mathplot.cpp:400
Base class to create small rectangular info boxes mpInfoLayer is the base class to create a small rec...
Definition mathplot.h:356
virtual bool HasBBox() const override
mpInfoLayer has not bounding box.
Definition mathplot.h:371
wxPoint m_reference
Definition mathplot.h:409
wxRect m_dim
Definition mathplot.h:407
mpInfoLayer()
Default constructor.
Definition mathplot.cpp:105
virtual bool IsInfo() const override
Specifies that this is an Info box layer.
Definition mathplot.h:382
wxBrush m_brush
Definition mathplot.h:410
mpInfoLegend()
Default constructor.
Definition mathplot.cpp:209
virtual void Plot(wxDC &dc, mpWindow &w) override
Plot method.
Definition mathplot.cpp:226
const wxString & GetDisplayName() const
Definition mathplot.h:251
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:313
wxFont m_font
Definition mathplot.h:333
void SetFont(const wxFont &font)
Set layer font.
Definition mathplot.h:304
bool IsVisible() const
Checks whether the layer is visible or not.
Definition mathplot.h:317
const wxString & GetName() const
Get layer name.
Definition mathplot.h:249
virtual ~mpLayer()
Definition mathplot.h:163
virtual double GetMinY() const
Get inclusive bottom border of bounding box.
Definition mathplot.h:196
bool GetContinuity() const
Gets the 'continuity' property of the layer.
Definition mathplot.h:290
bool m_continuous
Definition mathplot.h:338
bool m_showName
Definition mathplot.h:339
bool m_visible
Definition mathplot.h:341
virtual bool IsInfo() const
Check whether the layer is an info box.
Definition mathplot.h:181
void SetContinuity(bool continuity)
Set the 'continuity' property of the layer (true:draws a continuous line, false:draws separate points...
Definition mathplot.h:285
void ShowName(bool show)
Shows or hides the text label with the name of the layer (default is visible).
Definition mathplot.h:294
virtual void SetName(const wxString &name)
Set layer name.
Definition mathplot.h:299
const wxFont & GetFont() const
Get font set for this layer.
Definition mathplot.h:259
const wxPen & GetPen() const
Get pen set for this layer.
Definition mathplot.h:280
mpLayerType m_type
Definition mathplot.h:340
void SetVisible(bool show)
Sets layer visibility.
Definition mathplot.h:321
wxString m_name
Definition mathplot.h:336
wxBrush m_brush
Definition mathplot.h:335
const wxFont & GetPlotFont() const
Get the font to draw this layer with, which is the default one when none was set.
Definition mathplot.h:269
wxString m_displayName
Definition mathplot.h:337
void SetPen(const wxPen &pen)
Set layer pen.
Definition mathplot.h:309
wxPen m_pen
Definition mathplot.h:334
void SetBrush(const wxBrush &brush)
Set layer brush.
Definition mathplot.h:329
virtual double GetMaxX() const
Get inclusive right border of bounding box.
Definition mathplot.h:191
const wxBrush & GetBrush() const
Get brush set for this layer.
Definition mathplot.h:325
virtual double GetMinX() const
Get inclusive left border of bounding box.
Definition mathplot.h:186
virtual double GetMaxY() const
Get inclusive top border of bounding box.
Definition mathplot.h:201
virtual bool HasBBox() const
Check whether this layer has a bounding box.
Definition mathplot.h:172
Plot layer implementing a x-scale ruler.
Definition mathplot.h:642
void SetAxisMinMax(bool lock, double minV, double maxV)
Definition mathplot.h:728
bool m_axisLocked
Definition mathplot.h:789
double m_scale
Definition mathplot.h:782
void SetNameAlign(int align)
Definition mathplot.h:657
virtual void recalculateTicks(wxDC &dc, mpWindow &w)
Definition mathplot.h:774
double m_offset
Definition mathplot.h:782
double AbsMaxValue() const
Definition mathplot.h:718
void GetDataRange(double &minV, double &maxV) const
Definition mathplot.h:669
std::vector< double > m_tickValues
Definition mathplot.h:779
bool m_rangeSet
Definition mathplot.h:788
double AbsVisibleMaxValue() const
Definition mathplot.h:723
bool HasBBox() const override
Check whether this layer has a bounding box.
Definition mathplot.h:649
void SetAlign(int align)
Set X axis alignment.
Definition mathplot.h:655
void SetTicks(bool enable)
Set X axis ticks or grid.
Definition mathplot.h:662
virtual double TransformToPlot(double x) const
Definition mathplot.h:751
virtual void ResetDataRange()
Definition mathplot.h:713
virtual void formatLabels()
Definition mathplot.h:776
int m_maxLabelHeight
Definition mathplot.h:792
virtual bool IsHorizontal() const =0
double m_axisMin
Definition mathplot.h:790
double m_maxV
Definition mathplot.h:787
void computeLabelExtents(wxDC &dc, mpWindow &w)
Definition mathplot.cpp:879
int m_maxLabelWidth
Definition mathplot.h:793
bool GetTicks() const
Get X axis ticks or grid.
Definition mathplot.h:667
virtual void ExtendDataRange(double minV, double maxV)
Definition mathplot.h:675
std::vector< TICK_LABEL > m_tickLabels
Definition mathplot.h:780
double m_absVisibleMaxV
Definition mathplot.h:783
bool m_ticks
Definition mathplot.h:786
bool GetAxisMinMax(double *minV, double *maxV)
Definition mathplot.h:735
double m_minV
Definition mathplot.h:787
void updateTickLabels(wxDC &dc, mpWindow &w)
Definition mathplot.cpp:896
virtual void getVisibleDataRange(mpWindow &w, double &minV, double &maxV)
Definition mathplot.h:773
int m_nameFlags
Definition mathplot.h:785
virtual ~mpScaleBase()
Definition mathplot.h:645
void SetDataRange(double minV, double maxV)
Force this axis' data range to an explicit [minV, maxV], as if it had been computed by ExtendDataRang...
Definition mathplot.h:700
virtual double TransformFromPlot(double xplot) const
Definition mathplot.h:752
double m_axisMax
Definition mathplot.h:791
virtual ~mpScaleXBase()
Definition mathplot.h:808
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:810
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
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:791
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:873
int m_flags
Definition mathplot.h:907
mpScaleY * m_masterScale
Definition mathplot.h:906
virtual bool IsHorizontal() const override
Definition mathplot.h:882
void SetMasterScale(mpScaleY *masterScale)
Definition mathplot.h:898
bool m_ticks
Definition mathplot.h:908
virtual bool HasBBox() const override
Check whether this layer has a bounding box.
Definition mathplot.h:893
mpScaleY(const wxString &name=wxT("Y"), int flags=mpALIGN_CENTER, bool ticks=true)
Canvas for plotting mpLayer implementations.
Definition mathplot.h:953
double m_desiredYmin
Definition mathplot.h:1401
mpInfoLayer * m_movingInfoLayer
Definition mathplot.h:1419
bool m_zooming
Definition mathplot.h:1420
int RedoZoomStackSize() const
Definition mathplot.h:1314
double m_maxY
Definition mathplot.h:1383
double m_posY
Definition mathplot.h:1387
int GetMarginLeft() const
Definition mathplot.h:1264
bool m_enableMouseNavigation
Definition mathplot.h:1414
int GetYScreen() const
Definition mathplot.h:1084
void EnableMousePanZoom(bool enabled)
Enable/disable the feature of pan/zoom with the mouse (default=enabled)
Definition mathplot.h:1148
void SetMarginLeft(int left)
Set the left margin.
Definition mathplot.h:1255
const wxColour & GetAxesColour()
Get axes draw colour.
Definition mathplot.h:1300
double m_desiredXmax
Definition mathplot.h:1401
int m_last_lx
Definition mathplot.h:1410
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:1416
int m_marginLeft
Definition mathplot.h:1408
int m_marginTop
Definition mathplot.h:1408
double m_minY
Definition mathplot.h:1382
int GetScrX() const
Get current view's X dimension in device context units.
Definition mathplot.h:1074
int GetScrY() const
Get current view's Y dimension in device context units.
Definition mathplot.h:1083
void SetMouseWheelActions(const MouseWheelActionSet &s)
Set the pan/zoom actions corresponding to mousewheel/trackpad events.
Definition mathplot.h:1151
double p2x(wxCoord pixelCoordX)
Converts mpWindow (screen) pixel coordinates into graph (floating point) coordinates,...
Definition mathplot.h:1127
double p2y(wxCoord pixelCoordY)
Converts mpWindow (screen) pixel coordinates into graph (floating point) coordinates,...
Definition mathplot.h:1131
wxMemoryDC m_buff_dc
Definition mathplot.h:1411
double m_maxX
Definition mathplot.h:1381
void initializeGraphicsContext()
void SetMarginRight(int right)
Set the right margin.
Definition mathplot.h:1251
int m_marginBottom
Definition mathplot.h:1408
void LimitView(bool aEnable)
Enable limiting of zooming & panning to the area used by the plots.
Definition mathplot.h:1303
int m_clickedY
Definition mathplot.h:1391
wxCoord x2p(double x)
Converts graph (floating point) coordinates into mpWindow (screen) pixel coordinates,...
Definition mathplot.h:1135
wxColour m_bgColour
Definition mathplot.h:1376
MouseWheelAction
Enumerates the possible mouse wheel actions that can be performed on the plot.
Definition mathplot.h:959
double m_leftRightPlotGapFactor
Definition mathplot.h:1406
double m_posX
Definition mathplot.h:1386
wxPoint m_mouseLClick
Definition mathplot.h:1418
void SetMarginTop(int top)
Set the top margin.
Definition mathplot.h:1249
std::stack< std::array< double, 4 > > m_redoZoomStack
Definition mathplot.h:1423
void SetPosX(double posX)
Set current view's X position and refresh display.
Definition mathplot.h:1105
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:1219
int GetXScreen() const
Definition mathplot.h:1075
int GetMarginTop() const
Definition mathplot.h:1258
double m_scaleY
Definition mathplot.h:1385
void SetMarginBottom(int bottom)
Set the bottom margin.
Definition mathplot.h:1253
void SetPosY(double posY)
Set current view's Y position and refresh display.
Definition mathplot.h:1110
int m_marginRight
Definition mathplot.h:1408
void SetScaleY(double scaleY)
Set current view's Y scale and refresh display.
Definition mathplot.h:1094
wxColour m_fgColour
Definition mathplot.h:1377
bool GetYLocked() const
Definition mathplot.h:1309
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:1213
virtual void OnXViewChanged()
Called whenever the visible X range changes (pan, zoom, fit, ...).
Definition mathplot.h:1371
double m_minX
Definition mathplot.h:1380
wxRect m_zoomRect
Definition mathplot.h:1421
void UpdateAll()
Refresh display.
wxLayerList m_layers
Definition mathplot.h:1374
wxCoord y2p(double y)
Converts graph (floating point) coordinates into mpWindow (screen) pixel coordinates,...
Definition mathplot.h:1139
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:1207
wxMenu m_popmenu
Definition mathplot.h:1375
bool m_enableLimitedView
Definition mathplot.h:1415
int m_clickedX
Definition mathplot.h:1390
wxBitmap * m_buff_bmp
Definition mathplot.h:1412
double m_topBottomPlotGapFactor
Definition mathplot.h:1405
wxMenu * GetPopupMenu()
Get reference to context menu of the plot canvas.
Definition mathplot.h:994
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:1201
wxPoint m_mouseMClick
Definition mathplot.h:1417
double m_desiredYmax
Definition mathplot.h:1401
std::stack< std::array< double, 4 > > m_undoZoomStack
Definition mathplot.h:1422
int GetMarginRight() const
Definition mathplot.h:1260
void SetScr(int scrX, int scrY)
Set current view's dimensions in device context units.
Definition mathplot.h:1123
int GetMarginBottom() const
Definition mathplot.h:1262
void EnableDoubleBuffer(bool enabled)
Enable/disable the double-buffering of the window, eliminating the flicker (default=disabled).
Definition mathplot.h:1144
wxColour m_axColour
Definition mathplot.h:1378
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:1238
mpLayer * GetLayerByName(const wxString &name)
Definition mathplot.h:1039
bool m_yLocked
Definition mathplot.h:1393
int UndoZoomStackSize() const
Definition mathplot.h:1313
double m_desiredXmin
These are updated in Fit, ZoomIn, ZoomOut, ZoomRect, SetXView, SetYView and may be different from the...
Definition mathplot.h:1401
double m_scaleX
Definition mathplot.h:1384
bool m_enableDoubleBuffer
Definition mathplot.h:1413
void LockY(bool aLock)
Definition mathplot.h:1308
unsigned int CountAllLayers() const
Counts the number of plot layers, whether or not they have a bounding box.
Definition mathplot.h:1195
void SetPos(double posX, double posY)
Set current view's X and Y position and refresh display.
Definition mathplot.h:1116
double GetScaleY() const
Get current view's Y scale.
Definition mathplot.h:1054
int m_scrY
Definition mathplot.h:1389
double GetScaleX() const
Get current view's X scale.
Definition mathplot.h:1048
double GetPosY() const
Get current view's Y position.
Definition mathplot.h:1066
double GetPosX() const
Get current view's X position.
Definition mathplot.h:1060
int m_scrX
Definition mathplot.h:1388
int m_last_ly
Definition mathplot.h:1410
class WXDLLIMPEXP_MATHPLOT mpFY
Definition mathplot.h:104
bool WXDLLIMPEXP_MATHPLOT mpFiniteRange(const std::vector< double > &aValues, double &aMin, double &aMax)
Find the smallest and largest finite value in aValues.
Definition mathplot.cpp:58
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:138
@ mpLAYER_INFO
Definition mathplot.h:142
@ mpLAYER_BITMAP
Definition mathplot.h:143
@ mpLAYER_UNDEF
Definition mathplot.h:139
@ mpLAYER_AXIS
Definition mathplot.h:140
@ mpLAYER_PLOT
Definition mathplot.h:141
#define mpALIGN_RIGHT
Aligns label to the right.
Definition mathplot.h:455
enum __mp_Layer_Type mpLayerType
std::deque< mpLayer * > wxLayerList
Define the type for the list of layers inside mpWindow.
Definition mathplot.h:928
class WXDLLIMPEXP_MATHPLOT mpFXY
Definition mathplot.h:105
#define mpALIGN_CENTER
Aligns label to the center.
Definition mathplot.h:457
#define mpALIGN_TOP
Aligns label to the top.
Definition mathplot.h:461
#define WXDLLIMPEXP_MATHPLOT
wxMathPlot is a framework for mathematical graph plotting in wxWindows.
Definition mathplot.h:62
@ mpID_ZOOM_REDO
Definition mathplot.h:127
@ mpID_FIT
Definition mathplot.h:125
@ mpID_ZOOM_IN
Definition mathplot.h:128
@ mpID_CENTER
Definition mathplot.h:130
@ mpID_ZOOM_UNDO
Definition mathplot.h:126
@ mpID_ZOOM_OUT
Definition mathplot.h:129
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:471
#define mpALIGN_NE
Aligns label to north-east.
Definition mathplot.h:485
EDA_ANGLE abs(const EDA_ANGLE &aAngle)
Definition eda_angle.h:411
TICK_LABEL(double pos_=0.0, const wxString &label_=wxT(""))
Definition mathplot.h:756
Contains the set of modified mouse wheel actions that can be performed on the plot.
Definition mathplot.h:974
MouseWheelAction horizontal
Definition mathplot.h:984
MouseWheelAction verticalWithShift
Definition mathplot.h:982
MouseWheelAction verticalWithCtrl
Definition mathplot.h:981
MouseWheelAction verticalWithAlt
Definition mathplot.h:983
MouseWheelAction verticalUnmodified
Definition mathplot.h:980
KIBIS top(path, &reporter)
int delta