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
264 const wxPen& GetPen() const { return m_pen; }
265
269 void SetContinuity( bool continuity ) { m_continuous = continuity; }
270
274 bool GetContinuity() const { return m_continuous; }
275
278 void ShowName( bool show ) { m_showName = show; };
279
283 virtual void SetName( const wxString& name ) { m_name = name; }
284
288 void SetFont( const wxFont& font ) { m_font = font; }
289
293 void SetPen( const wxPen& pen ) { m_pen = pen; }
294
297 mpLayerType GetLayerType() const { return m_type; };
298
301 bool IsVisible() const { return m_visible; };
302
305 void SetVisible( bool show ) { m_visible = show; };
306
309 const wxBrush& GetBrush() const { return m_brush; };
310
313 void SetBrush( const wxBrush& brush ) { m_brush = brush; };
314
315protected:
316
317 wxFont m_font; // !< Layer's font
318 wxPen m_pen; // !< Layer's pen
319 wxBrush m_brush; // !< Layer's brush
320 wxString m_name; // !< Layer's name
322 bool m_continuous; // !< Specify if the layer will be plotted as a continuous line or a set of points.
323 bool m_showName; // !< States whether the name of the layer must be shown (default is true).
324 mpLayerType m_type; // !< Define layer type, which is assigned by constructor
325 bool m_visible; // !< Toggles layer visibility
326
327 DECLARE_DYNAMIC_CLASS( mpLayer )
328};
329
330
331// -----------------------------------------------------------------------------
332// mpInfoLayer
333// -----------------------------------------------------------------------------
334
340{
341public:
343 mpInfoLayer();
344
348 mpInfoLayer( wxRect rect, const wxBrush* brush = wxTRANSPARENT_BRUSH );
349
351 virtual ~mpInfoLayer();
352
355 virtual bool HasBBox() const override { return false; }
356
361 virtual void Plot( wxDC& dc, mpWindow& w ) override;
362
366 virtual bool IsInfo() const override { return true; }
367
371 virtual bool Inside( const wxPoint& point ) const;
372
373 virtual bool OnDoubleClick( const wxPoint& point, mpWindow& w );
374
377 virtual void Move( wxPoint delta );
378
380 virtual void UpdateReference();
381
384 wxPoint GetPosition() const;
385
388 wxSize GetSize() const;
389
390protected:
391 wxRect m_dim; // !< The bounding rectangle of the box. It may be resized dynamically
392 // by the Plot method.
393 wxPoint m_reference; // !< Holds the reference point for movements
394 wxBrush m_brush; // !< The brush to be used for the background
395 int m_winX; // !< Holds the mpWindow size. Used to rescale position when window is
396 int m_winY; // resized.
397
398 DECLARE_DYNAMIC_CLASS( mpInfoLayer )
399};
400
405{
406public:
408 mpInfoLegend();
409
414 mpInfoLegend( wxRect rect, const wxBrush* brush = wxTRANSPARENT_BRUSH );
415
418
423 virtual void Plot( wxDC& dc, mpWindow& w ) override;
424
425protected:
426};
427
428
429// -----------------------------------------------------------------------------
430// mpLayer implementations - functions
431// -----------------------------------------------------------------------------
432
435
437#define mpALIGNMASK 0x03
439#define mpALIGN_RIGHT 0x00
441#define mpALIGN_CENTER 0x01
443#define mpALIGN_LEFT 0x02
445#define mpALIGN_TOP mpALIGN_RIGHT
447#define mpALIGN_BOTTOM mpALIGN_LEFT
449#define mpALIGN_BORDER_BOTTOM 0x04
451#define mpALIGN_BORDER_TOP 0x05
453#define mpALIGN_FAR_RIGHT 0x06
455#define mpX_NORMAL 0x00
457#define mpX_TIME 0x01
459#define mpX_HOURS 0x02
461#define mpX_DATE 0x03
463#define mpX_DATETIME 0x04
465#define mpALIGN_BORDER_LEFT mpALIGN_BORDER_BOTTOM
467#define mpALIGN_BORDER_RIGHT mpALIGN_BORDER_TOP
469#define mpALIGN_NE 0x00
471#define mpALIGN_NW 0x01
473#define mpALIGN_SW 0x02
475#define mpALIGN_SE 0x03
476
478
481
488{
489public:
493 mpFX( const wxString& name = wxEmptyString, int flags = mpALIGN_RIGHT );
494
500 virtual double GetY( double x ) const = 0;
501
506 virtual void Plot( wxDC& dc, mpWindow& w ) override;
507
508protected:
509 int m_flags; // !< Holds label alignment
510
511 DECLARE_DYNAMIC_CLASS( mpFX )
512};
513
520{
521public:
525 mpFY( const wxString& name = wxEmptyString, int flags = mpALIGN_TOP );
526
532 virtual double GetX( double y ) const = 0;
533
538 virtual void Plot( wxDC& dc, mpWindow& w ) override;
539
540protected:
541 int m_flags; // !< Holds label alignment
542
543 DECLARE_DYNAMIC_CLASS( mpFY )
544};
545
552
554{
555public:
559 mpFXY( const wxString& name = wxEmptyString, int flags = mpALIGN_NE );
560
564 virtual void Rewind() = 0;
565 virtual void SetSweepWindow( int aSweepIdx ) { Rewind(); }
566
572 virtual bool GetNextXY( double& x, double& y ) = 0;
573
574 virtual size_t GetCount() const = 0;
575 virtual int GetSweepCount() const { return 1; }
576
581 virtual void Plot( wxDC& dc, mpWindow& w ) override;
582
583 virtual void SetScale( mpScaleBase* scaleX, mpScaleBase* scaleY );
584
585 void UpdateScales();
586
587 double s2x( double plotCoordX ) const;
588 double s2y( double plotCoordY ) const;
589
590 double x2s( double x ) const;
591 double y2s( double y ) const;
592
593protected:
594 int m_flags; // !< Holds label alignment
595
596 // Data to calculate label positioning
598 // int drawnPoints;
600
605 void UpdateViewBoundary( wxCoord xnew, wxCoord ynew );
606
607 DECLARE_DYNAMIC_CLASS( mpFXY )
608};
609
611
612// -----------------------------------------------------------------------------
613// mpLayer implementations - furniture (scales, ...)
614// -----------------------------------------------------------------------------
615
618
623
624
626{
627public:
628 mpScaleBase();
629 virtual ~mpScaleBase() {};
630
631 virtual bool IsHorizontal() const = 0;
632
633 bool HasBBox() const override { return false; }
634
639 void SetAlign( int align ) { m_flags = align; };
640
641 void SetNameAlign( int align ) { m_nameFlags = align; }
642
646 void SetTicks( bool enable ) { m_ticks = enable; };
647
651 bool GetTicks() const { return m_ticks; };
652
653 void GetDataRange( double& minV, double& maxV ) const
654 {
655 minV = m_minV;
656 maxV = m_maxV;
657 }
658
659 virtual void ExtendDataRange( double minV, double maxV )
660 {
661 if( !m_rangeSet )
662 {
663 m_minV = minV;
664 m_maxV = maxV;
665 m_rangeSet = true;
666 }
667 else
668 {
669 m_minV = std::min( minV, m_minV );
670 m_maxV = std::max( maxV, m_maxV );
671 }
672
673 if( m_minV == m_maxV )
674 {
675 m_minV = m_minV - 1.0;
676 m_maxV = m_maxV + 1.0;
677 }
678 }
679
680 virtual void ResetDataRange()
681 {
682 m_rangeSet = false;
683 }
684
685 double AbsMaxValue() const
686 {
687 return std::max( std::abs( m_maxV ), std::abs( m_minV ) );
688 }
689
690 double AbsVisibleMaxValue() const
691 {
692 return m_absVisibleMaxV;
693 }
694
695 void SetAxisMinMax( bool lock, double minV, double maxV )
696 {
697 m_axisLocked = lock;
698 m_axisMin = minV;
699 m_axisMax = maxV;
700 }
701
702 bool GetAxisMinMax( double* minV, double* maxV )
703 {
704 if( m_axisLocked )
705 {
706 *minV = m_axisMin;
707 *maxV = m_axisMax;
708 }
709 else if( !m_tickValues.empty() )
710 {
711 *minV = m_tickValues.front();
712 *maxV = m_tickValues.back();
713 }
714
715 return m_axisLocked;
716 }
717
718 virtual double TransformToPlot( double x ) const { return 0.0; };
719 virtual double TransformFromPlot( double xplot ) const { return 0.0; };
720
722 {
723 TICK_LABEL( double pos_ = 0.0, const wxString& label_ = wxT( "" ) ) :
724 pos( pos_ ),
725 label( label_ ),
726 visible( true )
727 {}
728
729 double pos;
730 wxString label;
732 };
733
734protected:
735
736 void updateTickLabels( wxDC& dc, mpWindow& w );
737 void computeLabelExtents( wxDC& dc, mpWindow& w );
738
739 // virtual int getLabelDecimalDigits(int maxDigits) const;
740 virtual void getVisibleDataRange( mpWindow& w, double& minV, double& maxV ) {};
741 virtual void recalculateTicks( wxDC& dc, mpWindow& w ) {};
742
743 virtual void formatLabels() {};
744
745protected:
746 std::vector<double> m_tickValues;
747 std::vector<TICK_LABEL> m_tickLabels;
748
751 int m_flags; // !< Flag for axis alignment
753 bool m_ticks; // !< Flag to toggle between ticks or grid
754 double m_minV, m_maxV;
757 double m_axisMin;
758 double m_axisMax;
761};
762
764{
765public:
773 mpScaleXBase( const wxString& name = wxT( "X" ), int flags = mpALIGN_CENTER, bool ticks = true,
774 unsigned int type = mpX_NORMAL );
775 virtual ~mpScaleXBase() {};
776
777 virtual bool IsHorizontal() const override { return true; }
778 virtual void Plot( wxDC& dc, mpWindow& w ) override;
779
780 virtual void getVisibleDataRange( mpWindow& w, double& minV, double& maxV ) override;
781
782 DECLARE_DYNAMIC_CLASS( mpScaleXBase )
783};
784
785
787{
788public:
796 mpScaleX( const wxString& name = wxT( "X" ), int flags = mpALIGN_CENTER, bool ticks = true,
797 unsigned int type = mpX_NORMAL );
798
799 virtual double TransformToPlot( double x ) const override;
800 virtual double TransformFromPlot( double xplot ) const override;
801
802protected:
803 virtual void recalculateTicks( wxDC& dc, mpWindow& w ) override;
804
805 DECLARE_DYNAMIC_CLASS( mpScaleX )
806};
807
808
810{
811public:
819 mpScaleXLog( const wxString& name = wxT( "log(X)" ), int flags = mpALIGN_CENTER,
820 bool ticks = true, unsigned int type = mpX_NORMAL );
821
822 virtual double TransformToPlot( double x ) const override;
823 virtual double TransformFromPlot( double xplot ) const override;
824
825protected:
826 void recalculateTicks( wxDC& dc, mpWindow& w ) override;
827
828 DECLARE_DYNAMIC_CLASS( mpScaleXLog )
829};
830
831
840{
841public:
847 mpScaleY( const wxString& name = wxT( "Y" ), int flags = mpALIGN_CENTER, bool ticks = true );
848
849 virtual bool IsHorizontal() const override { return false; }
850
854 virtual void Plot( wxDC& dc, mpWindow& w ) override;
855
860 virtual bool HasBBox() const override { return false; }
861
862 virtual double TransformToPlot( double x ) const override;
863 virtual double TransformFromPlot( double xplot ) const override;
864
865 void SetMasterScale( mpScaleY* masterScale ) { m_masterScale = masterScale; }
866
867protected:
868 virtual void getVisibleDataRange( mpWindow& w, double& minV, double& maxV ) override;
869 virtual void recalculateTicks( wxDC& dc, mpWindow& w ) override;
870
871 void computeSlaveTicks( mpWindow& w );
872
874 int m_flags; // !< Flag for axis alignment
875 bool m_ticks; // !< Flag to toggle between ticks or grid
876
877 DECLARE_DYNAMIC_CLASS( mpScaleY )
878};
879
880// -----------------------------------------------------------------------------
881// mpWindow
882// -----------------------------------------------------------------------------
883
886
888#define mpMOUSEMODE_DRAG 0
890#define mpMOUSEMODE_ZOOMBOX 1
891
894// WX_DECLARE_HASH_MAP( int, mpLayer*, wxIntegerHash, wxIntegerEqual, wxLayerList );
895typedef std::deque<mpLayer*> wxLayerList;
896
919class WXDLLIMPEXP_MATHPLOT mpWindow : public wxWindow
920{
921public:
936
941 {
942 /* If this bundled wxMathPlot implementation is to remain single-header and not dependent
943 * on any part of KiCad, then the SIM_MOUSE_WHEEL_ACTION_SET struct must be duplicated
944 * here. SIM_PLOT_TAB::convertMouseWheelActions is used to convert from
945 * SIM_MOUSE_WHEEL_ACTION_SET to mpWindow::MouseWheelActionSet. */
946
952 };
953
954 mpWindow();
955 mpWindow( wxWindow* parent, wxWindowID id );
956 ~mpWindow();
957
961 wxMenu* GetPopupMenu() { return &m_popmenu; }
962
971 bool AddLayer( mpLayer* layer, bool refreshDisplay = true );
972
983 bool DelLayer( mpLayer* layer, bool alsoDeleteObject = false, bool refreshDisplay = true );
984
991 void DelAllLayers( bool alsoDeleteObject, bool refreshDisplay = true );
992
993
999 mpLayer* GetLayer( int position ) const;
1000
1005 const mpLayer* GetLayerByName( const wxString& name ) const;
1006 mpLayer* GetLayerByName( const wxString& name )
1007 {
1008 return const_cast<mpLayer*>( static_cast<const mpWindow*>( this )->GetLayerByName( name ) );
1009 }
1010
1015 double GetScaleX() const { return m_scaleX; };
1016
1021 double GetScaleY() const { return m_scaleY; }
1022
1027 double GetPosX() const { return m_posX; }
1028
1033 double GetPosY() const { return m_posY; }
1034
1041 int GetScrX() const { return m_scrX; }
1042 int GetXScreen() const { return m_scrX; }
1043
1050 int GetScrY() const { return m_scrY; }
1051 int GetYScreen() const { return m_scrY; }
1052
1056 void SetScaleX( double scaleX );
1057
1061 void SetScaleY( double scaleY )
1062 {
1063 if( scaleY != 0 )
1064 m_scaleY = scaleY;
1065
1066 UpdateAll();
1067 }
1068
1072 void SetPosX( double posX ) { m_posX = posX; UpdateAll(); }
1073
1077 void SetPosY( double posY ) { m_posY = posY; UpdateAll(); }
1078
1083 void SetPos( double posX, double posY ) { m_posX = posX; m_posY = posY; UpdateAll(); }
1084
1090 void SetScr( int scrX, int scrY ) { m_scrX = scrX; m_scrY = scrY; }
1091
1094 inline double p2x( wxCoord pixelCoordX ) { return m_posX + pixelCoordX / m_scaleX; }
1095
1098 inline double p2y( wxCoord pixelCoordY ) { return m_posY - pixelCoordY / m_scaleY; }
1099
1102 inline wxCoord x2p( double x ) { return (wxCoord) ( (x - m_posX) * m_scaleX ); }
1103
1106 inline wxCoord y2p( double y ) { return (wxCoord) ( (m_posY - y) * m_scaleY ); }
1107
1108
1111 void EnableDoubleBuffer( bool enabled ) { m_enableDoubleBuffer = enabled; }
1112
1115 void EnableMousePanZoom( bool enabled ) { m_enableMouseNavigation = enabled; }
1116
1119
1124 void Fit() override;
1125
1132 void Fit( double xMin, double xMax, double yMin, double yMax,
1133 const wxCoord* printSizeX = nullptr, const wxCoord* printSizeY = nullptr,
1134 wxOrientation directions = wxBOTH );
1135
1140 void ZoomIn( const wxPoint& centerPoint = wxDefaultPosition );
1141 void ZoomIn( const wxPoint& centerPoint, double zoomFactor, wxOrientation directions = wxBOTH );
1142
1147 void ZoomOut( const wxPoint& centerPoint = wxDefaultPosition );
1148 void ZoomOut( const wxPoint& centerPoint, double zoomFactor,
1149 wxOrientation directions = wxBOTH );
1150
1153 void ZoomRect( wxPoint p0, wxPoint p1 );
1154
1156 void UpdateAll();
1157
1158 // Added methods by Davide Rondini
1159
1162 unsigned int CountAllLayers() const { return m_layers.size(); };
1163
1168 double GetDesiredXmin() const { return m_desiredXmin; }
1169
1174 double GetDesiredXmax() const { return m_desiredXmax; }
1175
1180 double GetDesiredYmin() const { return m_desiredYmin; }
1181
1186 double GetDesiredYmax() const { return m_desiredYmax; }
1187
1191 void GetBoundingBox( double* bbox ) const;
1192
1198 bool SaveScreenshot( wxImage& aImage,
1199 wxSize aImageSize = wxDefaultSize, bool aFit = false );
1200
1206
1213 void SetMargins( int top, int right, int bottom, int left );
1214
1216 void SetMarginTop( int top ) { m_marginTop = top; };
1220 void SetMarginBottom( int bottom ) { m_marginBottom = bottom; };
1223
1225 int GetMarginTop() const { return m_marginTop; };
1227 int GetMarginRight() const { return m_marginRight; };
1229 int GetMarginBottom() const { return m_marginBottom; };
1231 int GetMarginLeft() const { return m_marginLeft; };
1232
1236 mpInfoLayer* IsInsideInfoLayer( wxPoint& point );
1237
1241 void SetLayerVisible( const wxString& name, bool viewable );
1242
1246 bool IsLayerVisible( const wxString& name ) const;
1247
1251 void SetLayerVisible( const unsigned int position, bool viewable );
1252
1256 bool IsLayerVisible( unsigned int position ) const;
1257
1262 void SetColourTheme( const wxColour& bgColour, const wxColour& drawColour,
1263 const wxColour& axesColour );
1264
1267 const wxColour& GetAxesColour() { return m_axColour; };
1268
1270 void LimitView( bool aEnable )
1271 {
1272 m_enableLimitedView = aEnable;
1273 }
1274
1275 void LockY( bool aLock ) { m_yLocked = aLock; }
1276 bool GetYLocked() const { return m_yLocked; }
1277
1278 void ZoomUndo();
1279 void ZoomRedo();
1280 int UndoZoomStackSize() const { return m_undoZoomStack.size(); }
1281 int RedoZoomStackSize() const { return m_redoZoomStack.size(); }
1282
1284 void AdjustLimitedView( wxOrientation directions = wxBOTH );
1285
1286 void OnFit( wxCommandEvent& event );
1287 void OnCenter( wxCommandEvent& event );
1288
1289protected:
1290 static MouseWheelActionSet defaultMouseWheelActions();
1291
1292 void pushZoomUndo( const std::array<double, 4>& aZoom );
1293
1294 void OnPaint( wxPaintEvent& event ); // !< Paint handler, will plot all attached layers
1295 void OnSize( wxSizeEvent& event ); // !< Size handler, will update scroll bar sizes
1296
1297 void OnShowPopupMenu( wxMouseEvent& event ); // !< Mouse handler, will show context menu
1298 void OnMouseMiddleDown( wxMouseEvent& event ); // !< Mouse handler, for detecting when the user
1299
1300 // !< drags with the middle button or just "clicks" for the menu
1301 void onZoomIn( wxCommandEvent& event ); // !< Context menu handler
1302 void onZoomOut( wxCommandEvent& event ); // !< Context menu handler
1303 void onZoomUndo( wxCommandEvent& event ); // !< Context menu handler
1304 void onZoomRedo( wxCommandEvent& event ); // !< Context menu handler
1305 void onMouseWheel( wxMouseEvent& event ); // !< Mouse handler for the wheel
1306 void onMagnify( wxMouseEvent& event ); // !< Pinch zoom handler
1307 void onMouseMove( wxMouseEvent& event ); // !< Mouse handler for mouse motion (for pan)
1308 void onMouseLeftDown( wxMouseEvent& event ); // !< Mouse left click (for rect zoom)
1309 void onMouseLeftDClick( wxMouseEvent& event );
1310 void onMouseLeftRelease( wxMouseEvent& event ); // !< Mouse left click (for rect zoom)
1311
1312 void DoZoom( const wxPoint& centerPoint, double zoomFactor, wxOrientation directions );
1313 void RecomputeDesiredX( double& min, double& max );
1314 void RecomputeDesiredY( double& min, double& max );
1315 wxOrientation ViewNeedsRefitting( wxOrientation directions ) const;
1316
1317 void PerformMouseWheelAction( wxMouseEvent& event, MouseWheelAction action );
1318
1322 virtual bool UpdateBBox();
1323
1327 virtual bool SetXView( double pos, double desiredMax, double desiredMin );
1328
1332 virtual bool SetYView( double pos, double desiredMax, double desiredMin );
1333
1334 // wxList m_layers; //!< List of attached plot layers
1335 wxLayerList m_layers; // !< List of attached plot layers
1336 wxMenu m_popmenu; // !< Canvas' context menu
1337 wxColour m_bgColour; // !< Background Colour
1338 wxColour m_fgColour; // !< Foreground Colour
1339 wxColour m_axColour; // !< Axes Colour
1340
1341 double m_minX; // !< Global layer bounding box, left border incl.
1342 double m_maxX; // !< Global layer bounding box, right border incl.
1343 double m_minY; // !< Global layer bounding box, bottom border incl.
1344 double m_maxY; // !< Global layer bounding box, top border incl.
1345 double m_scaleX; // !< Current view's X scale
1346 double m_scaleY; // !< Current view's Y scale
1347 double m_posX; // !< Current view's X position
1348 double m_posY; // !< Current view's Y position
1349 int m_scrX; // !< Current view's X dimension
1350 int m_scrY; // !< Current view's Y dimension
1351 int m_clickedX; // !< Last mouse click X position, for centering and zooming the view
1352 int m_clickedY; // !< Last mouse click Y position, for centering and zooming the view
1353
1355
1363
1364 // These are gaps between the curve extrema and the edges of the plot area, expressed as
1365 // a factor of global layer bounding box width/height.
1368
1370
1371 int m_last_lx, m_last_ly; // !< For double buffering
1372 wxMemoryDC m_buff_dc; // !< For double buffering
1373 wxBitmap* m_buff_bmp; // !< For double buffering
1374 bool m_enableDoubleBuffer; // !< For double buffering
1375 bool m_enableMouseNavigation; // !< For pan/zoom with the mouse.
1378 wxPoint m_mouseMClick; // !< For the middle button "drag" feature
1379 wxPoint m_mouseLClick; // !< Starting coords for rectangular zoom selection
1380 mpInfoLayer* m_movingInfoLayer; // !< For moving info layers over the window area
1383 std::stack<std::array<double, 4>> m_undoZoomStack;
1384 std::stack<std::array<double, 4>> m_redoZoomStack;
1385
1386 DECLARE_DYNAMIC_CLASS( mpWindow )
1387 DECLARE_EVENT_TABLE()
1388
1389private:
1391
1392 template <typename... Ts>
1393 mpWindow( DelegatingContructorTag, Ts&&... windowArgs );
1394
1396};
1397
1398// -----------------------------------------------------------------------------
1399// mpFXYVector - provided by Jose Luis Blanco
1400// -----------------------------------------------------------------------------
1401
1422{
1423public:
1427 mpFXYVector( const wxString& name = wxEmptyString, int flags = mpALIGN_NE );
1428
1429 virtual ~mpFXYVector() {}
1430
1435 virtual void SetData( const std::vector<double>& xs, const std::vector<double>& ys );
1436
1437 void SetSweepCount( int aSweepCount ) { m_sweepCount = aSweepCount; }
1438 void SetSweepSize( size_t aSweepSize ) { m_sweepSize = aSweepSize; }
1439 size_t GetSweepSize() const { return m_sweepSize; }
1440
1444 void Clear();
1445
1448 double GetMinX() const override { return m_minX; }
1449
1452 double GetMinY() const override { return m_minY; }
1453
1456 double GetMaxX() const override { return m_maxX; }
1457
1460 double GetMaxY() const override { return m_maxY; }
1461
1462 size_t GetCount() const override { return m_xs.size(); }
1463 int GetSweepCount() const override { return m_sweepCount; }
1464
1465protected:
1468 std::vector<double> m_xs, m_ys;
1469
1470 size_t m_index; // internal counter for the "GetNextXY" interface
1471 size_t m_sweepWindow; // last m_index of the current sweep
1472
1476 int m_sweepCount = 1; // sweeps to split data into
1477 size_t m_sweepSize = std::numeric_limits<size_t>::max(); // data-points in each sweep
1478
1482 void Rewind() override;
1483 void SetSweepWindow( int aSweepIdx ) override;
1484
1490 bool GetNextXY( double& x, double& y ) override;
1491
1492protected:
1493
1494 DECLARE_DYNAMIC_CLASS( mpFXYVector )
1495};
1496
1497
1498#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:1422
double GetMaxY() const override
Returns the actual maximum Y data (loaded in SetData).
Definition mathplot.h:1460
void SetSweepWindow(int aSweepIdx) override
void SetSweepSize(size_t aSweepSize)
Definition mathplot.h:1438
double GetMinY() const override
Returns the actual minimum Y data (loaded in SetData).
Definition mathplot.h:1452
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:1448
mpFXYVector(const wxString &name=wxEmptyString, int flags=mpALIGN_NE)
double m_maxY
Definition mathplot.h:1475
std::vector< double > m_ys
Definition mathplot.h:1468
double m_minX
Loaded at SetData.
Definition mathplot.h:1475
std::vector< double > m_xs
The internal copy of the set of data to draw.
Definition mathplot.h:1468
size_t m_sweepWindow
Definition mathplot.h:1471
double m_maxX
Definition mathplot.h:1475
size_t GetSweepSize() const
Definition mathplot.h:1439
size_t m_sweepSize
Definition mathplot.h:1477
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:1456
int m_sweepCount
Definition mathplot.h:1476
void SetSweepCount(int aSweepCount)
Definition mathplot.h:1437
virtual ~mpFXYVector()
Definition mathplot.h:1429
size_t GetCount() const override
Definition mathplot.h:1462
size_t m_index
Definition mathplot.h:1470
int GetSweepCount() const override
Definition mathplot.h:1463
double m_minY
Definition mathplot.h:1475
Abstract base class providing plot and labeling functionality for a locus plot F:N->X,...
Definition mathplot.h:554
mpScaleBase * m_scaleX
Definition mathplot.h:599
wxCoord maxDrawY
Definition mathplot.h:597
mpScaleBase * m_scaleY
Definition mathplot.h:599
wxCoord maxDrawX
Definition mathplot.h:597
virtual void Rewind()=0
Rewind value enumeration with mpFXY::GetNextXY.
virtual void SetSweepWindow(int aSweepIdx)
Definition mathplot.h:565
virtual size_t GetCount() const =0
int m_flags
Definition mathplot.h:594
mpFXY(const wxString &name=wxEmptyString, int flags=mpALIGN_NE)
Definition mathplot.cpp:455
void UpdateViewBoundary(wxCoord xnew, wxCoord ynew)
Update label positioning data.
Definition mathplot.cpp:468
virtual int GetSweepCount() const
Definition mathplot.h:575
wxCoord minDrawX
Definition mathplot.h:597
wxCoord minDrawY
Definition mathplot.h:597
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:488
virtual double GetY(double x) const =0
Get function value for argument.
mpFX(const wxString &name=wxEmptyString, int flags=mpALIGN_RIGHT)
Definition mathplot.cpp:319
virtual void Plot(wxDC &dc, mpWindow &w) override
Layer plot handler.
Definition mathplot.cpp:327
int m_flags
Definition mathplot.h:509
Abstract base class providing plot and labeling functionality for functions F:Y->X.
Definition mathplot.h:520
int m_flags
Definition mathplot.h:541
virtual double GetX(double y) const =0
Get function value for argument.
mpFY(const wxString &name=wxEmptyString, int flags=mpALIGN_TOP)
Definition mathplot.cpp:389
virtual void Plot(wxDC &dc, mpWindow &w) override
Layer plot handler.
Definition mathplot.cpp:397
Base class to create small rectangular info boxes mpInfoLayer is the base class to create a small rec...
Definition mathplot.h:340
virtual bool HasBBox() const override
mpInfoLayer has not bounding box.
Definition mathplot.h:355
wxPoint m_reference
Definition mathplot.h:393
wxRect m_dim
Definition mathplot.h:391
mpInfoLayer()
Default constructor.
Definition mathplot.cpp:106
virtual bool IsInfo() const override
Specifies that this is an Info box layer.
Definition mathplot.h:366
wxBrush m_brush
Definition mathplot.h:394
mpInfoLegend()
Default constructor.
Definition mathplot.cpp:210
virtual void Plot(wxDC &dc, mpWindow &w) override
Plot method.
Definition mathplot.cpp:227
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:297
wxFont m_font
Definition mathplot.h:317
void SetFont(const wxFont &font)
Set layer font.
Definition mathplot.h:288
bool IsVisible() const
Checks whether the layer is visible or not.
Definition mathplot.h:301
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:274
bool m_continuous
Definition mathplot.h:322
bool m_showName
Definition mathplot.h:323
bool m_visible
Definition mathplot.h:325
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:269
void ShowName(bool show)
Shows or hides the text label with the name of the layer (default is visible).
Definition mathplot.h:278
virtual void SetName(const wxString &name)
Set layer name.
Definition mathplot.h:283
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:264
mpLayerType m_type
Definition mathplot.h:324
void SetVisible(bool show)
Sets layer visibility.
Definition mathplot.h:305
wxString m_name
Definition mathplot.h:320
wxBrush m_brush
Definition mathplot.h:319
wxString m_displayName
Definition mathplot.h:321
void SetPen(const wxPen &pen)
Set layer pen.
Definition mathplot.h:293
wxPen m_pen
Definition mathplot.h:318
void SetBrush(const wxBrush &brush)
Set layer brush.
Definition mathplot.h:313
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:309
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:626
void SetAxisMinMax(bool lock, double minV, double maxV)
Definition mathplot.h:695
bool m_axisLocked
Definition mathplot.h:756
double m_scale
Definition mathplot.h:749
void SetNameAlign(int align)
Definition mathplot.h:641
virtual void recalculateTicks(wxDC &dc, mpWindow &w)
Definition mathplot.h:741
double m_offset
Definition mathplot.h:749
double AbsMaxValue() const
Definition mathplot.h:685
void GetDataRange(double &minV, double &maxV) const
Definition mathplot.h:653
std::vector< double > m_tickValues
Definition mathplot.h:746
bool m_rangeSet
Definition mathplot.h:755
double AbsVisibleMaxValue() const
Definition mathplot.h:690
bool HasBBox() const override
Check whether this layer has a bounding box.
Definition mathplot.h:633
void SetAlign(int align)
Set X axis alignment.
Definition mathplot.h:639
void SetTicks(bool enable)
Set X axis ticks or grid.
Definition mathplot.h:646
virtual double TransformToPlot(double x) const
Definition mathplot.h:718
virtual void ResetDataRange()
Definition mathplot.h:680
virtual void formatLabels()
Definition mathplot.h:743
int m_maxLabelHeight
Definition mathplot.h:759
virtual bool IsHorizontal() const =0
double m_axisMin
Definition mathplot.h:757
double m_maxV
Definition mathplot.h:754
void computeLabelExtents(wxDC &dc, mpWindow &w)
Definition mathplot.cpp:876
int m_maxLabelWidth
Definition mathplot.h:760
bool GetTicks() const
Get X axis ticks or grid.
Definition mathplot.h:651
virtual void ExtendDataRange(double minV, double maxV)
Definition mathplot.h:659
std::vector< TICK_LABEL > m_tickLabels
Definition mathplot.h:747
double m_absVisibleMaxV
Definition mathplot.h:750
bool m_ticks
Definition mathplot.h:753
bool GetAxisMinMax(double *minV, double *maxV)
Definition mathplot.h:702
double m_minV
Definition mathplot.h:754
void updateTickLabels(wxDC &dc, mpWindow &w)
Definition mathplot.cpp:893
virtual void getVisibleDataRange(mpWindow &w, double &minV, double &maxV)
Definition mathplot.h:740
int m_nameFlags
Definition mathplot.h:752
virtual ~mpScaleBase()
Definition mathplot.h:629
virtual double TransformFromPlot(double xplot) const
Definition mathplot.h:719
double m_axisMax
Definition mathplot.h:758
virtual ~mpScaleXBase()
Definition mathplot.h:775
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:777
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:788
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:840
int m_flags
Definition mathplot.h:874
mpScaleY * m_masterScale
Definition mathplot.h:873
virtual bool IsHorizontal() const override
Definition mathplot.h:849
void SetMasterScale(mpScaleY *masterScale)
Definition mathplot.h:865
bool m_ticks
Definition mathplot.h:875
virtual bool HasBBox() const override
Check whether this layer has a bounding box.
Definition mathplot.h:860
mpScaleY(const wxString &name=wxT("Y"), int flags=mpALIGN_CENTER, bool ticks=true)
Canvas for plotting mpLayer implementations.
Definition mathplot.h:920
double m_desiredYmin
Definition mathplot.h:1362
mpInfoLayer * m_movingInfoLayer
Definition mathplot.h:1380
bool m_zooming
Definition mathplot.h:1381
int RedoZoomStackSize() const
Definition mathplot.h:1281
double m_maxY
Definition mathplot.h:1344
double m_posY
Definition mathplot.h:1348
int GetMarginLeft() const
Definition mathplot.h:1231
bool m_enableMouseNavigation
Definition mathplot.h:1375
int GetYScreen() const
Definition mathplot.h:1051
void EnableMousePanZoom(bool enabled)
Enable/disable the feature of pan/zoom with the mouse (default=enabled)
Definition mathplot.h:1115
void SetMarginLeft(int left)
Set the left margin.
Definition mathplot.h:1222
const wxColour & GetAxesColour()
Get axes draw colour.
Definition mathplot.h:1267
double m_desiredXmax
Definition mathplot.h:1362
int m_last_lx
Definition mathplot.h:1371
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:1377
int m_marginLeft
Definition mathplot.h:1369
int m_marginTop
Definition mathplot.h:1369
double m_minY
Definition mathplot.h:1343
int GetScrX() const
Get current view's X dimension in device context units.
Definition mathplot.h:1041
int GetScrY() const
Get current view's Y dimension in device context units.
Definition mathplot.h:1050
void SetMouseWheelActions(const MouseWheelActionSet &s)
Set the pan/zoom actions corresponding to mousewheel/trackpad events.
Definition mathplot.h:1118
double p2x(wxCoord pixelCoordX)
Converts mpWindow (screen) pixel coordinates into graph (floating point) coordinates,...
Definition mathplot.h:1094
double p2y(wxCoord pixelCoordY)
Converts mpWindow (screen) pixel coordinates into graph (floating point) coordinates,...
Definition mathplot.h:1098
wxMemoryDC m_buff_dc
Definition mathplot.h:1372
double m_maxX
Definition mathplot.h:1342
void initializeGraphicsContext()
void SetMarginRight(int right)
Set the right margin.
Definition mathplot.h:1218
int m_marginBottom
Definition mathplot.h:1369
void LimitView(bool aEnable)
Enable limiting of zooming & panning to the area used by the plots.
Definition mathplot.h:1270
int m_clickedY
Definition mathplot.h:1352
wxCoord x2p(double x)
Converts graph (floating point) coordinates into mpWindow (screen) pixel coordinates,...
Definition mathplot.h:1102
wxColour m_bgColour
Definition mathplot.h:1337
MouseWheelAction
Enumerates the possible mouse wheel actions that can be performed on the plot.
Definition mathplot.h:926
double m_leftRightPlotGapFactor
Definition mathplot.h:1367
double m_posX
Definition mathplot.h:1347
wxPoint m_mouseLClick
Definition mathplot.h:1379
void SetMarginTop(int top)
Set the top margin.
Definition mathplot.h:1216
std::stack< std::array< double, 4 > > m_redoZoomStack
Definition mathplot.h:1384
void SetPosX(double posX)
Set current view's X position and refresh display.
Definition mathplot.h:1072
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:1186
int GetXScreen() const
Definition mathplot.h:1042
int GetMarginTop() const
Definition mathplot.h:1225
double m_scaleY
Definition mathplot.h:1346
void SetMarginBottom(int bottom)
Set the bottom margin.
Definition mathplot.h:1220
void SetPosY(double posY)
Set current view's Y position and refresh display.
Definition mathplot.h:1077
int m_marginRight
Definition mathplot.h:1369
void SetScaleY(double scaleY)
Set current view's Y scale and refresh display.
Definition mathplot.h:1061
wxColour m_fgColour
Definition mathplot.h:1338
bool GetYLocked() const
Definition mathplot.h:1276
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:1180
double m_minX
Definition mathplot.h:1341
wxRect m_zoomRect
Definition mathplot.h:1382
void UpdateAll()
Refresh display.
wxLayerList m_layers
Definition mathplot.h:1335
wxCoord y2p(double y)
Converts graph (floating point) coordinates into mpWindow (screen) pixel coordinates,...
Definition mathplot.h:1106
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:1174
wxMenu m_popmenu
Definition mathplot.h:1336
bool m_enableLimitedView
Definition mathplot.h:1376
int m_clickedX
Definition mathplot.h:1351
wxBitmap * m_buff_bmp
Definition mathplot.h:1373
double m_topBottomPlotGapFactor
Definition mathplot.h:1366
wxMenu * GetPopupMenu()
Get reference to context menu of the plot canvas.
Definition mathplot.h:961
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:1168
wxPoint m_mouseMClick
Definition mathplot.h:1378
double m_desiredYmax
Definition mathplot.h:1362
std::stack< std::array< double, 4 > > m_undoZoomStack
Definition mathplot.h:1383
int GetMarginRight() const
Definition mathplot.h:1227
void SetScr(int scrX, int scrY)
Set current view's dimensions in device context units.
Definition mathplot.h:1090
int GetMarginBottom() const
Definition mathplot.h:1229
void EnableDoubleBuffer(bool enabled)
Enable/disable the double-buffering of the window, eliminating the flicker (default=disabled).
Definition mathplot.h:1111
wxColour m_axColour
Definition mathplot.h:1339
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:1205
mpLayer * GetLayerByName(const wxString &name)
Definition mathplot.h:1006
bool m_yLocked
Definition mathplot.h:1354
int UndoZoomStackSize() const
Definition mathplot.h:1280
double m_desiredXmin
These are updated in Fit, ZoomIn, ZoomOut, ZoomRect, SetXView, SetYView and may be different from the...
Definition mathplot.h:1362
double m_scaleX
Definition mathplot.h:1345
bool m_enableDoubleBuffer
Definition mathplot.h:1374
void LockY(bool aLock)
Definition mathplot.h:1275
unsigned int CountAllLayers() const
Counts the number of plot layers, whether or not they have a bounding box.
Definition mathplot.h:1162
void SetPos(double posX, double posY)
Set current view's X and Y position and refresh display.
Definition mathplot.h:1083
double GetScaleY() const
Get current view's Y scale.
Definition mathplot.h:1021
int m_scrY
Definition mathplot.h:1350
double GetScaleX() const
Get current view's X scale.
Definition mathplot.h:1015
double GetPosY() const
Get current view's Y position.
Definition mathplot.h:1033
double GetPosX() const
Get current view's X position.
Definition mathplot.h:1027
int m_scrX
Definition mathplot.h:1349
int m_last_ly
Definition mathplot.h:1371
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:439
enum __mp_Layer_Type mpLayerType
std::deque< mpLayer * > wxLayerList
Define the type for the list of layers inside mpWindow.
Definition mathplot.h:895
class WXDLLIMPEXP_MATHPLOT mpFXY
Definition mathplot.h:105
#define mpALIGN_CENTER
Aligns label to the center.
Definition mathplot.h:441
#define mpALIGN_TOP
Aligns label to the top.
Definition mathplot.h:445
#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:455
#define mpALIGN_NE
Aligns label to north-east.
Definition mathplot.h:469
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:723
Contains the set of modified mouse wheel actions that can be performed on the plot.
Definition mathplot.h:941
MouseWheelAction horizontal
Definition mathplot.h:951
MouseWheelAction verticalWithShift
Definition mathplot.h:949
MouseWheelAction verticalWithCtrl
Definition mathplot.h:948
MouseWheelAction verticalWithAlt
Definition mathplot.h:950
MouseWheelAction verticalUnmodified
Definition mathplot.h:947
KIBIS top(path, &reporter)
int delta