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
56
57
58// this definition uses windows dll to export function.
59// WXDLLIMPEXP_MATHPLOT definition definition changed to WXDLLIMPEXP_MATHPLOT
60// mathplot_EXPORTS will be defined by cmake
61#ifdef mathplot_EXPORTS
62#define WXDLLIMPEXP_MATHPLOT WXEXPORT
63#define WXDLLIMPEXP_DATA_MATHPLOT( type ) WXEXPORT type
64#else // not making DLL
65#define WXDLLIMPEXP_MATHPLOT
66#define WXDLLIMPEXP_DATA_MATHPLOT( type ) type
67#endif
68
69
70#include <wx/defs.h>
71#include <wx/menu.h>
72#include <wx/scrolwin.h>
73#include <wx/event.h>
74#include <wx/dynarray.h>
75#include <wx/pen.h>
76#include <wx/dcmemory.h>
77#include <wx/string.h>
78#include <wx/print.h>
79#include <wx/image.h>
80
81#include <vector>
82#include <deque>
83#include <stack>
84#include <array>
85#include <algorithm>
86
87// For memory leak debug
88#ifdef _WINDOWS
89#ifdef _DEBUG
90#include <crtdbg.h>
91#define DEBUG_NEW new (_NORMAL_BLOCK, __FILE__, __LINE__)
92#else
93#define DEBUG_NEW new
94#endif // _DEBUG
95#endif // _WINDOWS
96
97// Separation for axes when set close to border
98#define X_BORDER_SEPARATION 40
99#define Y_BORDER_SEPARATION 60
100
101// -----------------------------------------------------------------------------
102// classes
103// -----------------------------------------------------------------------------
104
114
126bool WXDLLIMPEXP_MATHPLOT mpFiniteRange( const std::vector<double>& aValues, double& aMin,
127 double& aMax );
128
130enum
131{
132 mpID_FIT = 2000, // !< Fit view to match bounding box of all layers
135 mpID_ZOOM_IN, // !< Zoom into view at clickposition / window center
136 mpID_ZOOM_OUT, // !< Zoom out
137 mpID_CENTER, // !< Center view on click position
138};
139
140// -----------------------------------------------------------------------------
141// mpLayer
142// -----------------------------------------------------------------------------
143
144typedef enum __mp_Layer_Type
145{
146 mpLAYER_UNDEF, // !< Layer type undefined
147 mpLAYER_AXIS, // !< Axis type layer
148 mpLAYER_PLOT, // !< Plot type layer
149 mpLAYER_INFO, // !< Info box type layer
150 mpLAYER_BITMAP // !< Bitmap type layer
152
163class mpScaleBase;
164
165class WXDLLIMPEXP_MATHPLOT mpLayer : public wxObject
166{
167public:
168 mpLayer();
169
170 virtual ~mpLayer() {};
171
179 virtual bool HasBBox() const { return true; }
180
188 virtual bool IsInfo() const { return false; };
189
193 virtual double GetMinX() const { return -1.0; }
194
198 virtual double GetMaxX() const { return 1.0; }
199
203 virtual double GetMinY() const { return -1.0; }
204
208 virtual double GetMaxY() const { return 1.0; }
209
251 virtual void Plot( wxDC& dc, mpWindow& w ) = 0;
252
256 const wxString& GetName() const { return m_name; }
257
258 const wxString& GetDisplayName() const
259 {
260 return m_displayName.IsEmpty() ? m_name : m_displayName;
261 }
262
266 const wxFont& GetFont() const { return m_font; }
267
276 const wxFont& GetPlotFont() const
277 {
278 if( m_font.IsOk() )
279 return m_font;
280
281 return *wxSMALL_FONT;
282 }
283
287 const wxPen& GetPen() const { return m_pen; }
288
292 void SetContinuity( bool continuity ) { m_continuous = continuity; }
293
297 bool GetContinuity() const { return m_continuous; }
298
301 void ShowName( bool show ) { m_showName = show; };
302
306 virtual void SetName( const wxString& name ) { m_name = name; }
307
311 void SetFont( const wxFont& font ) { m_font = font; }
312
316 void SetPen( const wxPen& pen ) { m_pen = pen; }
317
320 mpLayerType GetLayerType() const { return m_type; };
321
324 bool IsVisible() const { return m_visible; };
325
328 void SetVisible( bool show ) { m_visible = show; };
329
332 const wxBrush& GetBrush() const { return m_brush; };
333
336 void SetBrush( const wxBrush& brush ) { m_brush = brush; };
337
338protected:
339
340 wxFont m_font;
341 wxPen m_pen;
342 wxBrush m_brush;
343 wxString m_name;
349
350 DECLARE_DYNAMIC_CLASS( mpLayer )
351};
352
353
354// -----------------------------------------------------------------------------
355// mpInfoLayer
356// -----------------------------------------------------------------------------
357
364{
365public:
367 mpInfoLayer();
368
372 mpInfoLayer( wxRect rect, const wxBrush* brush = wxTRANSPARENT_BRUSH );
373
375 virtual ~mpInfoLayer();
376
379 virtual bool HasBBox() const override { return false; }
380
385 virtual void Plot( wxDC& dc, mpWindow& w ) override;
386
390 virtual bool IsInfo() const override { return true; }
391
395 virtual bool Inside( const wxPoint& point ) const;
396
397 virtual bool OnDoubleClick( const wxPoint& point, mpWindow& w );
398
401 virtual void Move( wxPoint delta );
402
404 virtual void UpdateReference();
405
408 wxPoint GetPosition() const;
409
412 wxSize GetSize() const;
413
414protected:
415 wxRect m_dim; // !< The bounding rectangle of the box. It may be resized dynamically
416 // by the Plot method.
417 wxPoint m_reference; // !< Holds the reference point for movements
418 wxBrush m_brush; // !< The brush to be used for the background
419 int m_winX; // !< Holds the mpWindow size. Used to rescale position when window is
420 int m_winY; // resized.
421
422 DECLARE_DYNAMIC_CLASS( mpInfoLayer )
423};
424
430{
431public:
433 mpInfoLegend();
434
439 mpInfoLegend( wxRect rect, const wxBrush* brush = wxTRANSPARENT_BRUSH );
440
443
448 virtual void Plot( wxDC& dc, mpWindow& w ) override;
449
450protected:
451};
452
453
454// -----------------------------------------------------------------------------
455// mpLayer implementations - functions
456// -----------------------------------------------------------------------------
457
460
462#define mpALIGNMASK 0x03
464#define mpALIGN_RIGHT 0x00
466#define mpALIGN_CENTER 0x01
468#define mpALIGN_LEFT 0x02
470#define mpALIGN_TOP mpALIGN_RIGHT
472#define mpALIGN_BOTTOM mpALIGN_LEFT
474#define mpALIGN_BORDER_BOTTOM 0x04
476#define mpALIGN_BORDER_TOP 0x05
478#define mpALIGN_FAR_RIGHT 0x06
480#define mpX_NORMAL 0x00
483#define mpX_TIME 0x01
485#define mpX_HOURS 0x02
487#define mpX_DATE 0x03
489#define mpX_DATETIME 0x04
491#define mpALIGN_BORDER_LEFT mpALIGN_BORDER_BOTTOM
493#define mpALIGN_BORDER_RIGHT mpALIGN_BORDER_TOP
495#define mpALIGN_NE 0x00
497#define mpALIGN_NW 0x01
499#define mpALIGN_SW 0x02
501#define mpALIGN_SE 0x03
502
504
507
514{
515public:
519 mpFX( const wxString& name = wxEmptyString, int flags = mpALIGN_RIGHT );
520
526 virtual double GetY( double x ) const = 0;
527
532 virtual void Plot( wxDC& dc, mpWindow& w ) override;
533
534protected:
535 int m_flags; // !< Holds label alignment
536
537 DECLARE_DYNAMIC_CLASS( mpFX )
538};
539
546{
547public:
551 mpFY( const wxString& name = wxEmptyString, int flags = mpALIGN_TOP );
552
558 virtual double GetX( double y ) const = 0;
559
564 virtual void Plot( wxDC& dc, mpWindow& w ) override;
565
566protected:
567 int m_flags; // !< Holds label alignment
568
569 DECLARE_DYNAMIC_CLASS( mpFY )
570};
571
578
580{
581public:
585 mpFXY( const wxString& name = wxEmptyString, int flags = mpALIGN_NE );
586
590 virtual void Rewind() = 0;
591 virtual void SetSweepWindow( int aSweepIdx ) { Rewind(); }
592
598 virtual bool GetNextXY( double& x, double& y ) = 0;
599
600 virtual size_t GetCount() const = 0;
601 virtual int GetSweepCount() const { return 1; }
602
607 virtual void Plot( wxDC& dc, mpWindow& w ) override;
608
609 virtual void SetScale( mpScaleBase* scaleX, mpScaleBase* scaleY );
610
611 void UpdateScales();
612
613 double s2x( double plotCoordX ) const;
614 double s2y( double plotCoordY ) const;
615
616 double x2s( double x ) const;
617 double y2s( double y ) const;
618
619protected:
620 int m_flags; // !< Holds label alignment
621
622 // Data to calculate label positioning
624 // int drawnPoints;
626
631 void UpdateViewBoundary( wxCoord xnew, wxCoord ynew );
632
633 DECLARE_DYNAMIC_CLASS( mpFXY )
634};
635
637
638// -----------------------------------------------------------------------------
639// mpLayer implementations - furniture (scales, ...)
640// -----------------------------------------------------------------------------
641
644
649
650
652{
653public:
654 mpScaleBase();
655 virtual ~mpScaleBase() {};
656
657 virtual bool IsHorizontal() const = 0;
658
659 bool HasBBox() const override { return false; }
660
665 void SetAlign( int align ) { m_flags = align; };
666
667 void SetNameAlign( int align ) { m_nameFlags = align; }
668
672 void SetTicks( bool enable ) { m_ticks = enable; };
673
677 bool GetTicks() const { return m_ticks; };
678
679 void GetDataRange( double& minV, double& maxV ) const
680 {
681 minV = m_minV;
682 maxV = m_maxV;
683 }
684
685 virtual void ExtendDataRange( double minV, double maxV )
686 {
687 if( !m_rangeSet )
688 {
689 m_minV = minV;
690 m_maxV = maxV;
691 m_rangeSet = true;
692 }
693 else
694 {
695 m_minV = std::min( minV, m_minV );
696 m_maxV = std::max( maxV, m_maxV );
697 }
698
699 if( m_minV == m_maxV )
700 {
701 m_minV = m_minV - 1.0;
702 m_maxV = m_maxV + 1.0;
703 }
704 }
705
710 void SetDataRange( double minV, double maxV )
711 {
712 m_minV = minV;
713 m_maxV = maxV;
714 m_rangeSet = true;
715
716 if( m_minV == m_maxV )
717 {
718 m_minV = m_minV - 1.0;
719 m_maxV = m_maxV + 1.0;
720 }
721 }
722
723 virtual void ResetDataRange()
724 {
725 m_rangeSet = false;
726 }
727
728 double AbsMaxValue() const
729 {
730 return std::max( std::abs( m_maxV ), std::abs( m_minV ) );
731 }
732
733 double AbsVisibleMaxValue() const
734 {
735 return m_absVisibleMaxV;
736 }
737
738 void SetAxisMinMax( bool lock, double minV, double maxV )
739 {
740 m_axisLocked = lock;
741 m_axisMin = minV;
742 m_axisMax = maxV;
743 }
744
745 bool GetAxisMinMax( double* minV, double* maxV )
746 {
747 if( m_axisLocked )
748 {
749 *minV = m_axisMin;
750 *maxV = m_axisMax;
751 }
752 else if( !m_tickValues.empty() )
753 {
754 *minV = m_tickValues.front();
755 *maxV = m_tickValues.back();
756 }
757
758 return m_axisLocked;
759 }
760
761 virtual double TransformToPlot( double x ) const { return 0.0; };
762 virtual double TransformFromPlot( double xplot ) const { return 0.0; };
763
765 {
766 TICK_LABEL( double pos_ = 0.0, const wxString& label_ = wxT( "" ) ) :
767 pos( pos_ ),
768 label( label_ ),
769 visible( true )
770 {}
771
772 double pos;
773 wxString label;
775 };
776
777protected:
778
779 void updateTickLabels( wxDC& dc, mpWindow& w );
780 void computeLabelExtents( wxDC& dc, mpWindow& w );
781
782 // virtual int getLabelDecimalDigits(int maxDigits) const;
783 virtual void getVisibleDataRange( mpWindow& w, double& minV, double& maxV ) {};
784 virtual void recalculateTicks( wxDC& dc, mpWindow& w ) {};
785
786 virtual void formatLabels() {};
787
788protected:
789 std::vector<double> m_tickValues;
790 std::vector<TICK_LABEL> m_tickLabels;
791
794 int m_flags; // !< Flag for axis alignment
796 bool m_ticks; // !< Flag to toggle between ticks or grid
797 double m_minV, m_maxV;
800 double m_axisMin;
801 double m_axisMax;
804};
805
807
808
810{
811public:
819 mpScaleXBase( const wxString& name = wxT( "X" ), int flags = mpALIGN_CENTER, bool ticks = true,
820 unsigned int type = mpX_NORMAL );
821 virtual ~mpScaleXBase() {};
822
823 virtual bool IsHorizontal() const override { return true; }
824 virtual void Plot( wxDC& dc, mpWindow& w ) override;
825
826 virtual void getVisibleDataRange( mpWindow& w, double& minV, double& maxV ) override;
827
828 DECLARE_DYNAMIC_CLASS( mpScaleXBase )
829};
830
831
833{
834public:
842 mpScaleX( const wxString& name = wxT( "X" ), int flags = mpALIGN_CENTER, bool ticks = true,
843 unsigned int type = mpX_NORMAL );
844
845 virtual double TransformToPlot( double x ) const override;
846 virtual double TransformFromPlot( double xplot ) const override;
847
848protected:
849 virtual void recalculateTicks( wxDC& dc, mpWindow& w ) override;
850
851 DECLARE_DYNAMIC_CLASS( mpScaleX )
852};
853
854
856{
857public:
865 mpScaleXLog( const wxString& name = wxT( "log(X)" ), int flags = mpALIGN_CENTER,
866 bool ticks = true, unsigned int type = mpX_NORMAL );
867
868 virtual double TransformToPlot( double x ) const override;
869 virtual double TransformFromPlot( double xplot ) const override;
870
871protected:
872 void recalculateTicks( wxDC& dc, mpWindow& w ) override;
873
874 DECLARE_DYNAMIC_CLASS( mpScaleXLog )
875};
876
877
886{
887public:
893 mpScaleY( const wxString& name = wxT( "Y" ), int flags = mpALIGN_CENTER, bool ticks = true );
894
895 virtual bool IsHorizontal() const override { return false; }
896
900 virtual void Plot( wxDC& dc, mpWindow& w ) override;
901
906 virtual bool HasBBox() const override { return false; }
907
908 virtual double TransformToPlot( double x ) const override;
909 virtual double TransformFromPlot( double xplot ) const override;
910
911 void SetMasterScale( mpScaleY* masterScale ) { m_masterScale = masterScale; }
912
913protected:
914 virtual void getVisibleDataRange( mpWindow& w, double& minV, double& maxV ) override;
915 virtual void recalculateTicks( wxDC& dc, mpWindow& w ) override;
916
917 void computeSlaveTicks( mpWindow& w );
918
920 int m_flags; // !< Flag for axis alignment
921 bool m_ticks; // !< Flag to toggle between ticks or grid
922
923 DECLARE_DYNAMIC_CLASS( mpScaleY )
924};
925
926// -----------------------------------------------------------------------------
927// mpWindow
928// -----------------------------------------------------------------------------
929
932
934#define mpMOUSEMODE_DRAG 0
936#define mpMOUSEMODE_ZOOMBOX 1
937
939
941// WX_DECLARE_HASH_MAP( int, mpLayer*, wxIntegerHash, wxIntegerEqual, wxLayerList );
942typedef std::deque<mpLayer*> wxLayerList;
943
966class WXDLLIMPEXP_MATHPLOT mpWindow : public wxWindow
967{
968public:
983
988 {
989 /* If this bundled wxMathPlot implementation is to remain single-header and not dependent
990 * on any part of KiCad, then the SIM_MOUSE_WHEEL_ACTION_SET struct must be duplicated
991 * here. SIM_PLOT_TAB::convertMouseWheelActions is used to convert from
992 * SIM_MOUSE_WHEEL_ACTION_SET to mpWindow::MouseWheelActionSet. */
993
999 };
1000
1001 mpWindow();
1002 mpWindow( wxWindow* parent, wxWindowID id );
1003 ~mpWindow();
1004
1008 wxMenu* GetPopupMenu() { return &m_popmenu; }
1009
1018 bool AddLayer( mpLayer* layer, bool refreshDisplay = true );
1019
1030 bool DelLayer( mpLayer* layer, bool alsoDeleteObject = false, bool refreshDisplay = true );
1031
1038 void DelAllLayers( bool alsoDeleteObject, bool refreshDisplay = true );
1039
1040
1046 mpLayer* GetLayer( int position ) const;
1047
1052 const mpLayer* GetLayerByName( const wxString& name ) const;
1053 mpLayer* GetLayerByName( const wxString& name )
1054 {
1055 return const_cast<mpLayer*>( static_cast<const mpWindow*>( this )->GetLayerByName( name ) );
1056 }
1057
1062 double GetScaleX() const { return m_scaleX; };
1063
1068 double GetScaleY() const { return m_scaleY; }
1069
1074 double GetPosX() const { return m_posX; }
1075
1080 double GetPosY() const { return m_posY; }
1081
1088 int GetScrX() const { return m_scrX; }
1089 int GetXScreen() const { return m_scrX; }
1090
1097 int GetScrY() const { return m_scrY; }
1098 int GetYScreen() const { return m_scrY; }
1099
1103 void SetScaleX( double scaleX );
1104
1108 void SetScaleY( double scaleY )
1109 {
1110 if( scaleY != 0 )
1111 m_scaleY = scaleY;
1112
1113 UpdateAll();
1114 }
1115
1119 void SetPosX( double posX ) { m_posX = posX; UpdateAll(); }
1120
1124 void SetPosY( double posY ) { m_posY = posY; UpdateAll(); }
1125
1130 void SetPos( double posX, double posY ) { m_posX = posX; m_posY = posY; UpdateAll(); }
1131
1137 void SetScr( int scrX, int scrY ) { m_scrX = scrX; m_scrY = scrY; }
1138
1142 inline double p2x( wxCoord pixelCoordX ) { return m_posX + pixelCoordX / m_scaleX; }
1143
1147 inline double p2y( wxCoord pixelCoordY ) { return m_posY - pixelCoordY / m_scaleY; }
1148
1152 inline wxCoord x2p( double x ) { return (wxCoord) ( (x - m_posX) * m_scaleX ); }
1153
1157 inline wxCoord y2p( double y ) { return (wxCoord) ( (m_posY - y) * m_scaleY ); }
1158
1159
1162 void EnableDoubleBuffer( bool enabled ) { m_enableDoubleBuffer = enabled; }
1163
1166 void EnableMousePanZoom( bool enabled ) { m_enableMouseNavigation = enabled; }
1167
1170
1175 void Fit() override;
1176
1183 void Fit( double xMin, double xMax, double yMin, double yMax,
1184 const wxCoord* printSizeX = nullptr, const wxCoord* printSizeY = nullptr,
1185 wxOrientation directions = wxBOTH );
1186
1191 void ZoomIn( const wxPoint& centerPoint = wxDefaultPosition );
1192 void ZoomIn( const wxPoint& centerPoint, double zoomFactor, wxOrientation directions = wxBOTH );
1193
1198 void ZoomOut( const wxPoint& centerPoint = wxDefaultPosition );
1199 void ZoomOut( const wxPoint& centerPoint, double zoomFactor,
1200 wxOrientation directions = wxBOTH );
1201
1204 void ZoomRect( wxPoint p0, wxPoint p1 );
1205
1207 void UpdateAll();
1208
1209 // Added methods by Davide Rondini
1210
1213 unsigned int CountAllLayers() const { return m_layers.size(); };
1214
1219 double GetDesiredXmin() const { return m_desiredXmin; }
1220
1225 double GetDesiredXmax() const { return m_desiredXmax; }
1226
1231 double GetDesiredYmin() const { return m_desiredYmin; }
1232
1237 double GetDesiredYmax() const { return m_desiredYmax; }
1238
1242 void GetBoundingBox( double* bbox ) const;
1243
1249 bool SaveScreenshot( wxImage& aImage,
1250 wxSize aImageSize = wxDefaultSize, bool aFit = false );
1251
1257
1264 void SetMargins( int top, int right, int bottom, int left );
1265
1267 void SetMarginTop( int top ) { m_marginTop = top; };
1271 void SetMarginBottom( int bottom ) { m_marginBottom = bottom; };
1274
1276 int GetMarginTop() const { return m_marginTop; };
1278 int GetMarginRight() const { return m_marginRight; };
1280 int GetMarginBottom() const { return m_marginBottom; };
1282 int GetMarginLeft() const { return m_marginLeft; };
1283
1287 mpInfoLayer* IsInsideInfoLayer( wxPoint& point );
1288
1292 void SetLayerVisible( const wxString& name, bool viewable );
1293
1297 bool IsLayerVisible( const wxString& name ) const;
1298
1302 void SetLayerVisible( const unsigned int position, bool viewable );
1303
1307 bool IsLayerVisible( unsigned int position ) const;
1308
1313 void SetColourTheme( const wxColour& bgColour, const wxColour& drawColour,
1314 const wxColour& axesColour );
1315
1318 const wxColour& GetAxesColour() { return m_axColour; };
1319
1321 void LimitView( bool aEnable )
1322 {
1323 m_enableLimitedView = aEnable;
1324 }
1325
1326 void LockY( bool aLock ) { m_yLocked = aLock; }
1327 bool GetYLocked() const { return m_yLocked; }
1328
1329 void ZoomUndo();
1330 void ZoomRedo();
1331 int UndoZoomStackSize() const { return m_undoZoomStack.size(); }
1332 int RedoZoomStackSize() const { return m_redoZoomStack.size(); }
1333
1335 void AdjustLimitedView( wxOrientation directions = wxBOTH );
1336
1337 void OnFit( wxCommandEvent& event );
1338 void OnCenter( wxCommandEvent& event );
1339
1340protected:
1341 static MouseWheelActionSet defaultMouseWheelActions();
1342
1343 void pushZoomUndo( const std::array<double, 4>& aZoom );
1344
1345 void OnPaint( wxPaintEvent& event ); // !< Paint handler, will plot all attached layers
1346 void OnSize( wxSizeEvent& event ); // !< Size handler, will update scroll bar sizes
1347
1348 void OnShowPopupMenu( wxMouseEvent& event ); // !< Mouse handler, will show context menu
1349 void OnMouseMiddleDown( wxMouseEvent& event ); // !< Mouse handler, for detecting when the user
1350
1351 // !< drags with the middle button or just "clicks" for the menu
1352 void onZoomIn( wxCommandEvent& event ); // !< Context menu handler
1353 void onZoomOut( wxCommandEvent& event ); // !< Context menu handler
1354 void onZoomUndo( wxCommandEvent& event ); // !< Context menu handler
1355 void onZoomRedo( wxCommandEvent& event ); // !< Context menu handler
1356 void onMouseWheel( wxMouseEvent& event ); // !< Mouse handler for the wheel
1357 void onMagnify( wxMouseEvent& event ); // !< Pinch zoom handler
1358 void onMouseMove( wxMouseEvent& event ); // !< Mouse handler for mouse motion (for pan)
1359 void onMouseLeftDown( wxMouseEvent& event ); // !< Mouse left click (for rect zoom)
1360 void onMouseLeftDClick( wxMouseEvent& event );
1361 void onMouseLeftRelease( wxMouseEvent& event ); // !< Mouse left click (for rect zoom)
1362
1363 void DoZoom( const wxPoint& centerPoint, double zoomFactor, wxOrientation directions );
1364 void RecomputeDesiredX( double& min, double& max );
1365 void RecomputeDesiredY( double& min, double& max );
1366 wxOrientation ViewNeedsRefitting( wxOrientation directions ) const;
1367
1368 void PerformMouseWheelAction( wxMouseEvent& event, MouseWheelAction action );
1369
1373 virtual bool UpdateBBox();
1374
1378 virtual bool SetXView( double pos, double desiredMax, double desiredMin );
1379
1383 virtual bool SetYView( double pos, double desiredMax, double desiredMin );
1384
1389 virtual void OnXViewChanged() {}
1390
1391 // wxList m_layers; //!< List of attached plot layers
1392 wxLayerList m_layers; // !< List of attached plot layers
1393 wxMenu m_popmenu; // !< Canvas' context menu
1394 wxColour m_bgColour; // !< Background Colour
1395 wxColour m_fgColour; // !< Foreground Colour
1396 wxColour m_axColour; // !< Axes Colour
1397
1398 double m_minX; // !< Global layer bounding box, left border incl.
1399 double m_maxX; // !< Global layer bounding box, right border incl.
1400 double m_minY; // !< Global layer bounding box, bottom border incl.
1401 double m_maxY; // !< Global layer bounding box, top border incl.
1402 double m_scaleX; // !< Current view's X scale
1403 double m_scaleY; // !< Current view's Y scale
1404 double m_posX; // !< Current view's X position
1405 double m_posY; // !< Current view's Y position
1406 int m_scrX; // !< Current view's X dimension
1407 int m_scrY; // !< Current view's Y dimension
1408 int m_clickedX; // !< Last mouse click X position, for centering and zooming the view
1409 int m_clickedY; // !< Last mouse click Y position, for centering and zooming the view
1410
1412
1420
1421 // These are gaps between the curve extrema and the edges of the plot area, expressed as
1422 // a factor of global layer bounding box width/height.
1425
1427
1428 int m_last_lx, m_last_ly; // !< For double buffering
1429 wxMemoryDC m_buff_dc; // !< For double buffering
1430 wxBitmap* m_buff_bmp; // !< For double buffering
1431 bool m_enableDoubleBuffer; // !< For double buffering
1432 bool m_enableMouseNavigation; // !< For pan/zoom with the mouse.
1435 wxPoint m_mouseMClick; // !< For the middle button "drag" feature
1436 wxPoint m_mouseLClick; // !< Starting coords for rectangular zoom selection
1437 mpInfoLayer* m_movingInfoLayer; // !< For moving info layers over the window area
1440 std::stack<std::array<double, 4>> m_undoZoomStack;
1441 std::stack<std::array<double, 4>> m_redoZoomStack;
1442
1443 DECLARE_DYNAMIC_CLASS( mpWindow )
1444 DECLARE_EVENT_TABLE()
1445
1446private:
1448
1449 template <typename... Ts>
1450 mpWindow( DelegatingContructorTag, Ts&&... windowArgs );
1451
1453};
1454
1455// -----------------------------------------------------------------------------
1456// mpFXYVector - provided by Jose Luis Blanco
1457// -----------------------------------------------------------------------------
1458
1479{
1480public:
1484 mpFXYVector( const wxString& name = wxEmptyString, int flags = mpALIGN_NE );
1485
1486 virtual ~mpFXYVector() {}
1487
1492 virtual void SetData( const std::vector<double>& xs, const std::vector<double>& ys );
1493
1494 void SetSweepCount( int aSweepCount ) { m_sweepCount = aSweepCount; }
1495 void SetSweepSize( size_t aSweepSize ) { m_sweepSize = aSweepSize; }
1496 size_t GetSweepSize() const { return m_sweepSize; }
1497
1501 void Clear();
1502
1505 double GetMinX() const override { return m_minX; }
1506
1509 double GetMinY() const override { return m_minY; }
1510
1513 double GetMaxX() const override { return m_maxX; }
1514
1517 double GetMaxY() const override { return m_maxY; }
1518
1519 size_t GetCount() const override { return m_xs.size(); }
1520 int GetSweepCount() const override { return m_sweepCount; }
1521
1522protected:
1525 std::vector<double> m_xs, m_ys;
1526
1527 size_t m_index; // internal counter for the "GetNextXY" interface
1528 size_t m_sweepWindow; // last m_index of the current sweep
1529
1533 int m_sweepCount = 1; // sweeps to split data into
1534 size_t m_sweepSize = std::numeric_limits<size_t>::max(); // data-points in each sweep
1535
1539 void Rewind() override;
1540 void SetSweepWindow( int aSweepIdx ) override;
1541
1547 bool GetNextXY( double& x, double& y ) override;
1548
1549protected:
1550
1551 DECLARE_DYNAMIC_CLASS( mpFXYVector )
1552};
1553
1554
1555#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:1479
double GetMaxY() const override
Returns the actual maximum Y data (loaded in SetData).
Definition mathplot.h:1517
void SetSweepWindow(int aSweepIdx) override
void SetSweepSize(size_t aSweepSize)
Definition mathplot.h:1495
double GetMinY() const override
Returns the actual minimum Y data (loaded in SetData).
Definition mathplot.h:1509
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:1505
mpFXYVector(const wxString &name=wxEmptyString, int flags=mpALIGN_NE)
double m_maxY
Definition mathplot.h:1532
std::vector< double > m_ys
Definition mathplot.h:1525
double m_minX
Loaded at SetData.
Definition mathplot.h:1532
std::vector< double > m_xs
The internal copy of the set of data to draw.
Definition mathplot.h:1525
size_t m_sweepWindow
Definition mathplot.h:1528
double m_maxX
Definition mathplot.h:1532
size_t GetSweepSize() const
Definition mathplot.h:1496
size_t m_sweepSize
Definition mathplot.h:1534
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:1513
int m_sweepCount
Definition mathplot.h:1533
void SetSweepCount(int aSweepCount)
Definition mathplot.h:1494
virtual ~mpFXYVector()
Definition mathplot.h:1486
size_t GetCount() const override
Definition mathplot.h:1519
size_t m_index
Definition mathplot.h:1527
int GetSweepCount() const override
Definition mathplot.h:1520
double m_minY
Definition mathplot.h:1532
Abstract base class providing plot and labeling functionality for a locus plot F:N->X,...
Definition mathplot.h:580
mpScaleBase * m_scaleX
Definition mathplot.h:625
wxCoord maxDrawY
Definition mathplot.h:623
mpScaleBase * m_scaleY
Definition mathplot.h:625
wxCoord maxDrawX
Definition mathplot.h:623
virtual void Rewind()=0
Rewind value enumeration with mpFXY::GetNextXY.
virtual void SetSweepWindow(int aSweepIdx)
Definition mathplot.h:591
virtual size_t GetCount() const =0
int m_flags
Definition mathplot.h:620
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:601
wxCoord minDrawX
Definition mathplot.h:623
wxCoord minDrawY
Definition mathplot.h:623
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:514
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:535
Abstract base class providing plot and labeling functionality for functions F:Y->X.
Definition mathplot.h:546
int m_flags
Definition mathplot.h:567
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:364
virtual bool HasBBox() const override
mpInfoLayer has not bounding box.
Definition mathplot.h:379
wxPoint m_reference
Definition mathplot.h:417
wxRect m_dim
Definition mathplot.h:415
mpInfoLayer()
Default constructor.
Definition mathplot.cpp:105
virtual bool IsInfo() const override
Specifies that this is an Info box layer.
Definition mathplot.h:390
wxBrush m_brush
Definition mathplot.h:418
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:258
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:320
wxFont m_font
Layer's font.
Definition mathplot.h:340
void SetFont(const wxFont &font)
Set layer font.
Definition mathplot.h:311
bool IsVisible() const
Checks whether the layer is visible or not.
Definition mathplot.h:324
const wxString & GetName() const
Get layer name.
Definition mathplot.h:256
virtual ~mpLayer()
Definition mathplot.h:170
virtual double GetMinY() const
Get inclusive bottom border of bounding box.
Definition mathplot.h:203
bool GetContinuity() const
Gets the 'continuity' property of the layer.
Definition mathplot.h:297
bool m_continuous
Specify if the layer will be plotted as a continuous line or a set of points.
Definition mathplot.h:345
bool m_showName
States whether the name of the layer must be shown (default is true).
Definition mathplot.h:346
bool m_visible
Toggles layer visibility.
Definition mathplot.h:348
virtual bool IsInfo() const
Check whether the layer is an info box.
Definition mathplot.h:188
void SetContinuity(bool continuity)
Set the 'continuity' property of the layer (true:draws a continuous line, false:draws separate points...
Definition mathplot.h:292
void ShowName(bool show)
Shows or hides the text label with the name of the layer (default is visible).
Definition mathplot.h:301
virtual void SetName(const wxString &name)
Set layer name.
Definition mathplot.h:306
const wxFont & GetFont() const
Get font set for this layer.
Definition mathplot.h:266
const wxPen & GetPen() const
Get pen set for this layer.
Definition mathplot.h:287
mpLayerType m_type
Define layer type, which is assigned by constructor.
Definition mathplot.h:347
void SetVisible(bool show)
Sets layer visibility.
Definition mathplot.h:328
wxString m_name
Layer's name.
Definition mathplot.h:343
wxBrush m_brush
Layer's brush.
Definition mathplot.h:342
const wxFont & GetPlotFont() const
Get the font to draw this layer with, which is the default one when none was set.
Definition mathplot.h:276
wxString m_displayName
Definition mathplot.h:344
void SetPen(const wxPen &pen)
Set layer pen.
Definition mathplot.h:316
wxPen m_pen
Layer's pen.
Definition mathplot.h:341
void SetBrush(const wxBrush &brush)
Set layer brush.
Definition mathplot.h:336
virtual double GetMaxX() const
Get inclusive right border of bounding box.
Definition mathplot.h:198
const wxBrush & GetBrush() const
Get brush set for this layer.
Definition mathplot.h:332
virtual double GetMinX() const
Get inclusive left border of bounding box.
Definition mathplot.h:193
virtual double GetMaxY() const
Get inclusive top border of bounding box.
Definition mathplot.h:208
virtual bool HasBBox() const
Check whether this layer has a bounding box.
Definition mathplot.h:179
Plot layer implementing a x-scale ruler.
Definition mathplot.h:652
void SetAxisMinMax(bool lock, double minV, double maxV)
Definition mathplot.h:738
bool m_axisLocked
Definition mathplot.h:799
double m_scale
Definition mathplot.h:792
void SetNameAlign(int align)
Definition mathplot.h:667
virtual void recalculateTicks(wxDC &dc, mpWindow &w)
Definition mathplot.h:784
double m_offset
Definition mathplot.h:792
double AbsMaxValue() const
Definition mathplot.h:728
void GetDataRange(double &minV, double &maxV) const
Definition mathplot.h:679
std::vector< double > m_tickValues
Definition mathplot.h:789
bool m_rangeSet
Definition mathplot.h:798
double AbsVisibleMaxValue() const
Definition mathplot.h:733
bool HasBBox() const override
Check whether this layer has a bounding box.
Definition mathplot.h:659
void SetAlign(int align)
Set X axis alignment.
Definition mathplot.h:665
void SetTicks(bool enable)
Set X axis ticks or grid.
Definition mathplot.h:672
virtual double TransformToPlot(double x) const
Definition mathplot.h:761
virtual void ResetDataRange()
Definition mathplot.h:723
virtual void formatLabels()
Definition mathplot.h:786
int m_maxLabelHeight
Definition mathplot.h:802
virtual bool IsHorizontal() const =0
double m_axisMin
Definition mathplot.h:800
double m_maxV
Definition mathplot.h:797
void computeLabelExtents(wxDC &dc, mpWindow &w)
Definition mathplot.cpp:879
int m_maxLabelWidth
Definition mathplot.h:803
bool GetTicks() const
Get X axis ticks or grid.
Definition mathplot.h:677
virtual void ExtendDataRange(double minV, double maxV)
Definition mathplot.h:685
std::vector< TICK_LABEL > m_tickLabels
Definition mathplot.h:790
double m_absVisibleMaxV
Definition mathplot.h:793
bool m_ticks
Definition mathplot.h:796
bool GetAxisMinMax(double *minV, double *maxV)
Definition mathplot.h:745
double m_minV
Definition mathplot.h:797
void updateTickLabels(wxDC &dc, mpWindow &w)
Definition mathplot.cpp:896
virtual void getVisibleDataRange(mpWindow &w, double &minV, double &maxV)
Definition mathplot.h:783
int m_nameFlags
Definition mathplot.h:795
virtual ~mpScaleBase()
Definition mathplot.h:655
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:710
virtual double TransformFromPlot(double xplot) const
Definition mathplot.h:762
double m_axisMax
Definition mathplot.h:801
virtual ~mpScaleXBase()
Definition mathplot.h:821
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:823
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:886
int m_flags
Definition mathplot.h:920
mpScaleY * m_masterScale
Definition mathplot.h:919
virtual bool IsHorizontal() const override
Definition mathplot.h:895
void SetMasterScale(mpScaleY *masterScale)
Definition mathplot.h:911
bool m_ticks
Definition mathplot.h:921
virtual bool HasBBox() const override
Check whether this layer has a bounding box.
Definition mathplot.h:906
mpScaleY(const wxString &name=wxT("Y"), int flags=mpALIGN_CENTER, bool ticks=true)
Canvas for plotting mpLayer implementations.
Definition mathplot.h:967
double m_desiredYmin
Definition mathplot.h:1419
mpInfoLayer * m_movingInfoLayer
Definition mathplot.h:1437
bool m_zooming
Definition mathplot.h:1438
int RedoZoomStackSize() const
Definition mathplot.h:1332
double m_maxY
Definition mathplot.h:1401
double m_posY
Definition mathplot.h:1405
int GetMarginLeft() const
Definition mathplot.h:1282
bool m_enableMouseNavigation
Definition mathplot.h:1432
int GetYScreen() const
Definition mathplot.h:1098
void EnableMousePanZoom(bool enabled)
Enable/disable the feature of pan/zoom with the mouse (default=enabled)
Definition mathplot.h:1166
void SetMarginLeft(int left)
Set the left margin.
Definition mathplot.h:1273
const wxColour & GetAxesColour()
Get axes draw colour.
Definition mathplot.h:1318
double m_desiredXmax
Definition mathplot.h:1419
int m_last_lx
Definition mathplot.h:1428
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:1434
int m_marginLeft
Definition mathplot.h:1426
int m_marginTop
Definition mathplot.h:1426
double m_minY
Definition mathplot.h:1400
int GetScrX() const
Get current view's X dimension in device context units.
Definition mathplot.h:1088
int GetScrY() const
Get current view's Y dimension in device context units.
Definition mathplot.h:1097
void SetMouseWheelActions(const MouseWheelActionSet &s)
Set the pan/zoom actions corresponding to mousewheel/trackpad events.
Definition mathplot.h:1169
double p2x(wxCoord pixelCoordX)
Converts mpWindow (screen) pixel coordinates into graph (floating point) coordinates,...
Definition mathplot.h:1142
double p2y(wxCoord pixelCoordY)
Converts mpWindow (screen) pixel coordinates into graph (floating point) coordinates,...
Definition mathplot.h:1147
wxMemoryDC m_buff_dc
Definition mathplot.h:1429
double m_maxX
Definition mathplot.h:1399
void initializeGraphicsContext()
void SetMarginRight(int right)
Set the right margin.
Definition mathplot.h:1269
int m_marginBottom
Definition mathplot.h:1426
void LimitView(bool aEnable)
Enable limiting of zooming & panning to the area used by the plots.
Definition mathplot.h:1321
int m_clickedY
Definition mathplot.h:1409
wxCoord x2p(double x)
Converts graph (floating point) coordinates into mpWindow (screen) pixel coordinates,...
Definition mathplot.h:1152
wxColour m_bgColour
Definition mathplot.h:1394
MouseWheelAction
Enumerates the possible mouse wheel actions that can be performed on the plot.
Definition mathplot.h:973
double m_leftRightPlotGapFactor
Definition mathplot.h:1424
double m_posX
Definition mathplot.h:1404
wxPoint m_mouseLClick
Definition mathplot.h:1436
void SetMarginTop(int top)
Set the top margin.
Definition mathplot.h:1267
std::stack< std::array< double, 4 > > m_redoZoomStack
Definition mathplot.h:1441
void SetPosX(double posX)
Set current view's X position and refresh display.
Definition mathplot.h:1119
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:1237
int GetXScreen() const
Definition mathplot.h:1089
int GetMarginTop() const
Definition mathplot.h:1276
double m_scaleY
Definition mathplot.h:1403
void SetMarginBottom(int bottom)
Set the bottom margin.
Definition mathplot.h:1271
void SetPosY(double posY)
Set current view's Y position and refresh display.
Definition mathplot.h:1124
int m_marginRight
Definition mathplot.h:1426
void SetScaleY(double scaleY)
Set current view's Y scale and refresh display.
Definition mathplot.h:1108
wxColour m_fgColour
Definition mathplot.h:1395
bool GetYLocked() const
Definition mathplot.h:1327
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:1231
virtual void OnXViewChanged()
Called whenever the visible X range changes (pan, zoom, fit, ...).
Definition mathplot.h:1389
double m_minX
Definition mathplot.h:1398
wxRect m_zoomRect
Definition mathplot.h:1439
void UpdateAll()
Refresh display.
wxLayerList m_layers
Definition mathplot.h:1392
wxCoord y2p(double y)
Converts graph (floating point) coordinates into mpWindow (screen) pixel coordinates,...
Definition mathplot.h:1157
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:1225
wxMenu m_popmenu
Definition mathplot.h:1393
bool m_enableLimitedView
Definition mathplot.h:1433
int m_clickedX
Definition mathplot.h:1408
wxBitmap * m_buff_bmp
Definition mathplot.h:1430
double m_topBottomPlotGapFactor
Definition mathplot.h:1423
wxMenu * GetPopupMenu()
Get reference to context menu of the plot canvas.
Definition mathplot.h:1008
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:1219
wxPoint m_mouseMClick
Definition mathplot.h:1435
double m_desiredYmax
Definition mathplot.h:1419
std::stack< std::array< double, 4 > > m_undoZoomStack
Definition mathplot.h:1440
int GetMarginRight() const
Definition mathplot.h:1278
void SetScr(int scrX, int scrY)
Set current view's dimensions in device context units.
Definition mathplot.h:1137
int GetMarginBottom() const
Definition mathplot.h:1280
void EnableDoubleBuffer(bool enabled)
Enable/disable the double-buffering of the window, eliminating the flicker (default=disabled).
Definition mathplot.h:1162
wxColour m_axColour
Definition mathplot.h:1396
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:1256
mpLayer * GetLayerByName(const wxString &name)
Definition mathplot.h:1053
bool m_yLocked
Definition mathplot.h:1411
int UndoZoomStackSize() const
Definition mathplot.h:1331
double m_desiredXmin
These are updated in Fit, ZoomIn, ZoomOut, ZoomRect, SetXView, SetYView and may be different from the...
Definition mathplot.h:1419
double m_scaleX
Definition mathplot.h:1402
bool m_enableDoubleBuffer
Definition mathplot.h:1431
void LockY(bool aLock)
Definition mathplot.h:1326
unsigned int CountAllLayers() const
Counts the number of plot layers, whether or not they have a bounding box.
Definition mathplot.h:1213
void SetPos(double posX, double posY)
Set current view's X and Y position and refresh display.
Definition mathplot.h:1130
double GetScaleY() const
Get current view's Y scale.
Definition mathplot.h:1068
int m_scrY
Definition mathplot.h:1407
double GetScaleX() const
Get current view's X scale.
Definition mathplot.h:1062
double GetPosY() const
Get current view's Y position.
Definition mathplot.h:1080
double GetPosX() const
Get current view's X position.
Definition mathplot.h:1074
int m_scrX
Definition mathplot.h:1406
int m_last_ly
Definition mathplot.h:1428
class WXDLLIMPEXP_MATHPLOT mpFY
Definition mathplot.h:107
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:112
class WXDLLIMPEXP_MATHPLOT mpPrintout
Definition mathplot.h:113
class WXDLLIMPEXP_MATHPLOT mpFXYVector
Definition mathplot.h:109
__mp_Layer_Type
Definition mathplot.h:145
@ mpLAYER_INFO
Definition mathplot.h:149
@ mpLAYER_BITMAP
Definition mathplot.h:150
@ mpLAYER_UNDEF
Definition mathplot.h:146
@ mpLAYER_AXIS
Definition mathplot.h:147
@ mpLAYER_PLOT
Definition mathplot.h:148
#define mpALIGN_RIGHT
Aligns label to the right.
Definition mathplot.h:464
enum __mp_Layer_Type mpLayerType
std::deque< mpLayer * > wxLayerList
Define the type for the list of layers inside mpWindow.
Definition mathplot.h:942
class WXDLLIMPEXP_MATHPLOT mpFXY
Definition mathplot.h:108
#define mpALIGN_CENTER
Aligns label to the center.
Definition mathplot.h:466
#define mpALIGN_TOP
Aligns label to the top.
Definition mathplot.h:470
#define WXDLLIMPEXP_MATHPLOT
wxMathPlot is a framework for mathematical graph plotting in wxWindows.
Definition mathplot.h:65
@ mpID_ZOOM_REDO
Definition mathplot.h:134
@ mpID_FIT
Definition mathplot.h:132
@ mpID_ZOOM_IN
Definition mathplot.h:135
@ mpID_CENTER
Definition mathplot.h:137
@ mpID_ZOOM_UNDO
Definition mathplot.h:133
@ mpID_ZOOM_OUT
Definition mathplot.h:136
class WXDLLIMPEXP_MATHPLOT mpLayer
Definition mathplot.h:105
class WXDLLIMPEXP_MATHPLOT mpFX
Definition mathplot.h:106
class WXDLLIMPEXP_MATHPLOT mpScaleX
Definition mathplot.h:110
class WXDLLIMPEXP_MATHPLOT mpScaleY
Definition mathplot.h:111
#define mpX_NORMAL
Set label for X axis in normal mode.
Definition mathplot.h:480
#define mpALIGN_NE
Aligns label to north-east.
Definition mathplot.h:495
EDA_ANGLE abs(const EDA_ANGLE &aAngle)
Definition eda_angle.h:437
TICK_LABEL(double pos_=0.0, const wxString &label_=wxT(""))
Definition mathplot.h:766
Contains the set of modified mouse wheel actions that can be performed on the plot.
Definition mathplot.h:988
MouseWheelAction horizontal
Definition mathplot.h:998
MouseWheelAction verticalWithShift
Definition mathplot.h:996
MouseWheelAction verticalWithCtrl
Definition mathplot.h:995
MouseWheelAction verticalWithAlt
Definition mathplot.h:997
MouseWheelAction verticalUnmodified
Definition mathplot.h:994
KIBIS top(path, &reporter)
int delta