14 #ifndef MATHPLOT_H_INCLUDED 15 #define MATHPLOT_H_INCLUDED 70 #ifdef mathplot_EXPORTS 71 #define WXDLLIMPEXP_MATHPLOT WXEXPORT 73 #define WXDLLIMPEXP_DATA_MATHPLOT(type) WXEXPORT type 75 #else // not making DLL 76 #define WXDLLIMPEXP_MATHPLOT 78 #define WXDLLIMPEXP_DATA_MATHPLOT(type) type 82 #if defined(__GNUG__) && !defined(__APPLE__) && !defined(__INTEL_CLANG_COMPILER) 83 #pragma interface "mathplot.h" 89 #include <unordered_map> 101 #if (defined(__cplusplus) && (__cplusplus > 201402L)) // C++17 or newer 109 #define MP_OPTNULL_INT std::nullopt 110 #define MP_OPTTEST(opt) (opt) 112 #define MP_OPTGET(opt) (*opt) 116 #define MP_LOOP_ITER auto& [m_yID, m_yData] 124 #define MP_OPTNULL_INT -1 125 #define MP_OPTTEST(opt) ((opt) != -1) 127 #define MP_OPTGET(opt) (opt) 131 #define MP_LOOP_ITER auto& elem 132 #define m_yID elem.first 134 #define m_yData elem.second 143 #include <wx/scrolwin.h> 144 #include <wx/event.h> 145 #include <wx/dynarray.h> 147 #include <wx/dcmemory.h> 148 #include <wx/string.h> 149 #include <wx/print.h> 150 #include <wx/image.h> 157 #if defined(MP_USER_INCLUDE) 160 #define str(x) xstr(x) 162 #define header MP_USER_INCLUDE.h 167 #ifdef ENABLE_MP_CONFIG 168 #include "MathPlotConfig.h" 169 #endif // ENABLE_MP_CONFIG 176 #ifdef ENABLE_MP_NAMESPACE 178 #endif // ENABLE_MP_NAMESPACE 180 #ifdef ENABLE_MP_DEBUG 185 #define DEBUG_NEW new(_NORMAL_BLOCK ,__FILE__, __LINE__) 187 #define DEBUG_NEW new 190 #endif // ENABLE_MP_DEBUG 193 #define MP_X_BORDER_SEPARATION 40 194 #define MP_Y_BORDER_SEPARATION 60 198 #define MP_X_LOCALTIME 0x10 199 #define MP_X_UTCTIME 0x20 201 #define MP_X_RAWTIME MP_X_UTCTIME 205 #define MP_EPSILON 1e-30 206 #define ISNOTNULL(x) (std::fpclassify(x) != FP_ZERO) 210 #define MP_EXTRA_MARGIN 8 213 #define MP_ZOOM_AROUND_CENTER -1 220 #define DECLARE_DYNAMIC_CLASS_MATHPLOT(mp_class) wxDECLARE_DYNAMIC_CLASS(mp_class) 252 #ifdef ENABLE_MP_CONFIG 254 #endif // ENABLE_MP_CONFIG 289 return wxRect(startPx, startPy, endPx - startPx, endPy - startPy);
292 static_assert(
sizeof(
mpRect) == 4 *
sizeof(wxCoord));
375 return ((min != 0) || (max != 0));
433 return (min + max) / 2;
439 return std::max(fabs(min), fabs(max));
445 min = (min > 0) ? log10(min) : 0;
446 max = (max > 0) ? log10(max) : 0;
452 return ((point >= min) && (point <= max));
455 #if (defined(__cplusplus) && (__cplusplus > 201703L)) // C++20 or newer 456 bool operator==(
const mpRange&)
const =
default;
458 bool operator==(
const mpRange &other)
const 461 return (min == other.
min) && (max == other.
max);
466 return !(*
this == other);
476 struct [[
deprecated("Deprecated! No longer used as X and Y are now separated")]] mpFloatRect
479 std::vector<mpRange<double>> y;
490 mpFloatRect() =
delete;
498 bool PointIsInside(
double px,
double py,
size_t yAxisID = 0)
const {
499 if (yAxisID < y.size())
501 if( (px < x.min || px > x.max) ||
502 (py < y[yAxisID].min || py > y[yAxisID].max))
521 void UpdateBoundingBoxToInclude(
double px,
double py,
size_t yAxisID = 0) {
522 assert(yAxisID < y.size());
523 if (yAxisID < y.size())
525 if (px < x.min ) x.min = px;
526 else if (px > x.max ) x.max = px;
527 if (py < y[yAxisID].min ) y[yAxisID].min = py;
528 else if (py > y[yAxisID].max ) y[yAxisID].max = py;
538 void InitializeBoundingBox(
double px,
double py,
size_t yAxisID = 0) {
539 assert(yAxisID < y.size());
540 if (yAxisID < y.size())
543 y[yAxisID].min = y[yAxisID].max = py;
547 bool IsNotSet(
mpWindow& w)
const {
const mpFloatRect def(w);
return *
this==def; }
549 #if (defined(__cplusplus) && (__cplusplus > 201703L)) // C++ > C++17 (MSVC requires <AdditionalOptions>/Zc:__cplusplus</AdditionalOptions> 550 bool operator==(
const mpFloatRect&)
const =
default;
554 bool operator==(
const mpFloatRect& rect)
const 556 auto Same = [](
double a,
double b) {
561 if (!Same(x.min, rect.x.min) || !Same(x.max, rect.x.max))
567 if (y.size() != rect.y.size())
573 for (
size_t i = 0; i < y.size(); ++i)
575 if (!Same(y[i].min, rect.y[i].min) ||
576 !Same(y[i].max, rect.y[i].max) )
648 #ifdef ENABLE_MP_CONFIG 650 #endif // ENABLE_MP_CONFIG 874 mpLayer(mpLayerType layerType);
921 virtual bool IsLayerType(mpLayerType typeOfInterest,
int *subtype)
923 *subtype = m_subtype;
924 return (m_type == typeOfInterest);
1039 m_fontcolour = colour;
1047 return m_fontcolour;
1070 if (brush == wxNullBrush)
1071 m_brush = *wxTRANSPARENT_BRUSH;
1079 void SetBrush(
const wxColour &colour,
enum wxBrushStyle style = wxBRUSHSTYLE_SOLID)
1081 m_brush.SetColour(colour);
1082 m_brush.SetStyle(style);
1110 m_drawOutsideMargins = drawModeOutside;
1117 return m_drawOutsideMargins;
1124 wxBitmap GetColourSquare(
int side = 16);
1151 m_tractable = track;
1172 m_CanDelete = canDelete;
1209 void UpdateContext(wxDC &dc)
const;
1215 virtual void DoPlot(wxDC &dc,
mpWindow &w) = 0;
1232 void CheckLog(
double *x,
double *y,
int yAxisID);
1267 virtual void SetVisible(
bool show);
1273 virtual void UpdateInfo(
mpWindow &w, wxEvent &event);
1290 virtual bool Inside(
const wxPoint &point);
1295 virtual void Move(wxPoint delta,
mpWindow &w);
1298 virtual void UpdateReference();
1304 return m_dim.GetPosition();
1311 m_relX = pos.x / 100.0;
1312 m_relY = pos.y / 100.0;
1319 return m_dim.GetSize();
1333 m_location = location;
1355 virtual void DoPlot(wxDC &dc,
mpWindow &w);
1359 void SetInfoRectangle(
mpWindow &w,
int width = 0,
int height = 0);
1362 double clamp(
double v,
double min,
double max);
1395 virtual void UpdateInfo(
mpWindow &w, wxEvent &event);
1422 return IsVisible() && (GetDrawOutsideMargins() || plotArea.Contains(mousePos));
1431 m_timeConv = time_conv;
1438 m_series_coord = show;
1445 return m_series_coord;
1453 virtual wxString GetInfoCoordsText(
mpWindow &w,
double xVal, std::unordered_map<int, double> yValList);
1465 void DrawContent(wxDC &dc,
mpWindow &w);
1481 virtual void DoPlot(wxDC &dc,
mpWindow &w);
1484 std::unordered_map<int, double> m_yValList;
1514 m_needs_update =
true;
1527 m_item_direction = mode;
1528 m_needs_update =
true;
1534 return m_item_direction;
1540 m_needs_update =
true;
1547 m_showDraggedSeries = active;
1554 return m_showDraggedSeries;
1562 int GetLegendHitRegion(wxPoint mousePos);
1570 void DrawDraggedSeries(wxDC& dc,
mpWindow &w);
1575 void DrawContent(wxDC &dc,
mpWindow &w);
1579 void RestoreAxisHighlighting(
mpWindow &w);
1595 wxString m_headerString = wxString::FromUTF8(
"≡");
1601 virtual void DoPlot(wxDC &dc,
mpWindow &w);
1607 unsigned int layerIdx;
1611 std::vector<LegendDetail> m_LegendDetailList;
1612 wxCoord m_headerEnd;
1613 bool m_needs_update;
1624 void UpdateBitmap(wxDC &dc,
mpWindow &w);
1649 mpFunction(mpLayerType layerType =
mpLAYER_PLOT,
const wxString &name = wxEmptyString,
unsigned int yAxisID = 0);
1656 m_continuous = continuity;
1664 return m_continuous;
1699 m_symbolSize = size;
1700 m_symbolSize2 = size / 2;
1707 return m_symbolSize;
1713 virtual bool DrawSymbol(wxDC &dc, wxCoord x, wxCoord y);
1729 m_yAxisID = yAxisID;
1737 m_LegendIsAlwaysVisible = alwaysVisible;
1745 return m_LegendIsAlwaysVisible;
1753 m_autoStep = enable;
1768 m_maxNOfPoints = nOfPoints;
1775 return m_maxNOfPoints;
1804 mpLine(
double value,
const wxPen &pen = *wxGREEN_PEN);
1833 return m_IsHorizontal;
1855 mpHorizontalLine(
double yvalue,
const wxPen &pen = *wxGREEN_PEN,
unsigned int yAxisID = 0);
1867 virtual void DoPlot(wxDC &dc,
mpWindow &w);
1895 virtual void DoPlot(wxDC &dc,
mpWindow &w);
1923 mpFX(
const wxString &name = wxEmptyString,
int flags =
mpALIGN_RIGHT,
unsigned int yAxisID = 0);
1930 virtual double GetY(
double x) = 0;
1938 double DoGetY(
double x);
1944 void DefineDoGetY(
void);
1954 virtual void DoPlot(wxDC &dc,
mpWindow &w);
1960 double NormalDoGetY(
double x);
1966 double LogDoGetY(
double x);
1985 mpFY(
const wxString &name = wxEmptyString,
int flags =
mpALIGN_TOP,
unsigned int yAxisID = 0);
1992 virtual double GetX(
double y) = 0;
2000 double DoGetX(
double y);
2006 void DefineDoGetX(
void);
2016 virtual void DoPlot(wxDC &dc,
mpWindow &w);
2022 double NormalDoGetX(
double y);
2028 double LogDoGetX(
double y);
2051 mpFXY(
const wxString &name = wxEmptyString,
int flags =
mpALIGN_SW,
bool viewAsBar =
false,
unsigned int yAxisID = 0);
2056 virtual void Rewind() = 0;
2080 virtual bool GetNextXY(
double *x,
double *y) = 0;
2088 bool DoGetNextXY(
double *x,
double *y);
2094 void SetViewMode(
bool asBar);
2126 bool m_ViewAsBar =
false;
2134 virtual void DoPlot(wxDC &dc,
mpWindow &w);
2140 void UpdateViewBoundary(wxCoord xnew, wxCoord ynew);
2177 mpFXYVector(
const wxString &name = wxEmptyString,
int flags =
mpALIGN_SW,
bool viewAsBar =
false,
unsigned int yAxisID = 0);
2190 void SetData(
const std::vector<double> &xs,
const std::vector<double> &ys);
2213 bool AddData(
const double x,
const double y,
bool updatePlot);
2223 m_reserveXY = reserve;
2224 m_xs.reserve(m_reserveXY);
2225 m_ys.reserve(m_reserveXY);
2252 virtual void Rewind()
override;
2260 virtual bool GetNextXY(
double *x,
double *y);
2266 void DrawAddedPoint(
double x,
double y);
2275 return m_rangeX.
min - (m_deltaX / 2);
2279 return m_rangeX.
min;
2287 return m_rangeY.
min;
2297 return m_rangeX.
max + (m_deltaX / 2);
2301 return m_rangeX.
max;
2309 return m_rangeY.
max;
2315 void First_Point(
double x,
double y);
2319 void Check_Limit(
double val,
mpRange<double> *range,
double *last,
double *delta);
2345 virtual double GetY(
double x) = 0;
2353 virtual void DoPlot(wxDC &dc,
mpWindow &w);
2371 mpFX(name, flags, yAxisID)
2373 wxPen FXpen(*wxBLUE, 1, wxPENSTYLE_SOLID);
2374 SetDrawOutsideMargins(
false);
2375 SetContinuity(
true);
2405 return m_rangeY.min;
2414 return m_rangeY.max;
2425 virtual double ComputeY(
double x) = 0;
2448 m_variance = sigma * sigma;
2449 m_const = 1.0 / sqrt(2.0 * M_PI * m_variance);
2460 return m_const * exp(-(x - m_mu) * (x - m_mu) / (2.0 * m_variance));
2484 m_variance = sigma * sigma;
2485 m_const = 1.0 / (m_variance * sqrt(2.0 * M_PI));
2500 double tmp = log(x) - m_mu;
2501 return m_const * exp(-tmp * tmp / (2.0 * m_variance)) / x;
2518 mpChart(
const wxString &name = wxEmptyString);
2528 void SetChartValues(
const std::vector<double> &data);
2532 void SetChartLabels(
const std::vector<std::string> &labelArray);
2538 void AddData(
const double &data,
const std::string &label);
2543 virtual void Clear();
2547 return (values.size() > 0);
2565 #define mpBAR_NONE 0 2566 #define mpBAR_AXIS_H 1 2567 #define mpBAR_AXIS_V 2 2568 #define mpBAR_INSIDE 3 2577 mpBarChart(
const wxString &name = wxEmptyString,
double width = 0.5);
2586 void SetBarColour(
const wxColour &colour);
2595 void SetBarLabelPosition(
int position);
2600 virtual double GetMinX();
2605 virtual double GetMaxX();
2610 virtual double GetMinY();
2615 virtual double GetMaxY();
2628 virtual void DoPlot(wxDC &dc,
mpWindow &w);
2643 mpPieChart(
const wxString &name = wxEmptyString,
double radius = 20);
2671 void SetPieColours(
const std::vector<wxColour> &colourArray);
2678 return m_center.x - m_radius;
2686 return m_center.x + m_radius;
2694 return m_center.y - m_radius;
2702 return m_center.y + m_radius;
2715 virtual void DoPlot(wxDC &dc,
mpWindow &w);
2718 const wxColour& GetColour(
unsigned int id);
2807 m_labelFormat = format;
2808 if (updateLabelMode)
2825 m_timeConv = time_conv;
2832 return m_labelFormat;
2856 m_auto = automaticScalingIsEnabled;
2872 m_axisRange.SetMin(min);
2880 return m_axisRange.min;
2888 m_axisRange.SetMax(max);
2896 return m_axisRange.max;
2905 m_axisRange.Set(min, max);
2914 *min = m_axisRange.min;
2915 *max = m_axisRange.max;
2923 m_axisRange = range;
2963 m_CoordIsAlwaysVisible = alwaysVisible;
2971 return m_CoordIsAlwaysVisible;
2975 static const wxCoord kTickSize = 4;
2976 static const wxCoord kAxisExtraSpace = 6;
2988 bool m_hover =
false;
2993 virtual int GetOrigin(
mpWindow &w) = 0;
3001 double GetStep(
double scale,
int minLabelSpacing);
3010 virtual void DrawScaleName(wxDC &dc,
mpWindow &w,
int origin,
int labelSize) = 0;
3017 wxString FormatLabelValue(
double value);
3023 wxString FormatLogValue(
double n);
3031 int GetLabelWidth(
double value, wxDC &dc);
3037 bool UseScientific(
double maxAxisValue);
3044 int GetSignificantDigits(
double step,
double maxAxisValue);
3050 int GetDecimalDigits(
double step);
3057 double maxAxisValue;
3059 int SignificantDigits;
3061 double EpsilonScale;
3062 } m_ScaleConstraints;
3067 void ComputeScaleConstraints(
double step,
double maxAxisValue);
3088 mpScale(name, flags, grids, type)
3114 virtual void DoPlot(wxDC &dc,
mpWindow &w);
3116 virtual int GetOrigin(
mpWindow &w);
3117 virtual void DrawScaleName(wxDC &dc,
mpWindow &w,
int origin,
int labelSize);
3145 mpScale(name, flags, grids, labelType, yAxisID)
3177 if ( (IsLeftAxis() || IsRightAxis()) && (xPixel >= m_xPos) && (xPixel <= (m_xPos + m_axisWidth)) )
3190 virtual void DoPlot(wxDC &dc,
mpWindow &w);
3192 virtual int GetOrigin(
mpWindow &w);
3193 virtual void DrawScaleName(wxDC &dc,
mpWindow &w,
int origin,
int labelSize);
3208 #define mpMOUSEMODE_DRAG 0 3210 #define mpMOUSEMODE_ZOOMBOX 1 3239 return (scale == other.
scale) && (pos == other.
pos) &&
3268 typedef std::function<void(void *Sender, const wxString &classname, bool &cancel)>
mpOnDeleteLayer;
3298 m_domain = plotArea;
3314 void DrawCross(wxDC &dc,
mpWindow &w);
3319 return m_enable && m_domain.Contains(mousePos);
3376 mpWindow(wxWindow *parent, wxWindowID
id = wxID_ANY,
const wxPoint &pos = wxDefaultPosition,
const wxSize &size = wxDefaultSize,
3397 bool AddLayer(
mpLayer *layer,
bool refreshDisplay =
true,
bool refreshConfig =
true);
3411 bool DelLayer(
mpLayer *layer, mpDeleteAction alsoDeleteObject,
bool refreshDisplay =
true,
bool refreshConfig =
true);
3418 void DelAllLayers(mpDeleteAction alsoDeleteObject,
bool refreshDisplay =
true);
3426 void DelAllPlot(mpDeleteAction alsoDeleteObject, mpFunctionType func =
mpfAllType,
bool refreshDisplay =
true);
3434 void DelAllYAxisAfterID(mpDeleteAction alsoDeleteObject,
int yAxisID = 0,
bool refreshDisplay =
true);
3441 mpLayer* GetLayer(
int position);
3447 int GetLayerPosition(
mpLayer* layer);
3455 mpLayer* GetLayersType(
int position, mpLayerType type);
3480 mpFXYVector* GetXYSeries(
unsigned int n,
const wxString &name = _T(
"Serie "),
bool create =
true);
3490 mpLayer* GetClosestPlot(wxCoord ix, wxCoord iy,
double *xnear,
double *ynear);
3496 mpLayer* GetLayerByName(
const wxString &name);
3502 mpLayer* GetLayerByClassName(
const wxString &name);
3507 void RefreshLegend(
void);
3513 bool IsYAxisUsed(
int yAxisID);
3520 bool IsYAxisUsedByFunction(
int yAxisID,
int *position);
3530 mpScaleY* GetLayerYAxis(
int yAxisID);
3539 m_AxisDataX.scale = scaleX;
3540 UpdateDesiredBoundingBox(uXAxis);
3551 return m_AxisDataX.scale;
3560 assert(m_AxisDataYList.count(yAxisID) != 0);
3563 m_AxisDataYList[yAxisID].scale = scaleY;
3564 UpdateDesiredBoundingBox(uYAxis);
3576 assert(m_AxisDataYList.count(yAxisID) != 0);
3577 return m_AxisDataYList[yAxisID].scale;
3580 [[
deprecated(
"Incomplete, use UpdateBBox instead")]]
3588 return m_AxisDataX.bound;
3594 return m_AxisDataX.desired;
3602 assert(m_AxisDataYList.count(yAxisID) != 0);
3603 return m_AxisDataYList[yAxisID].bound;
3611 assert(m_AxisDataYList.count(yAxisID) != 0);
3612 return m_AxisDataYList[yAxisID].desired;
3621 std::unordered_map<int, mpRange<double>> yRange;
3635 std::unordered_map<int, mpRange<double>> yRange;
3648 m_AxisDataX.pos = posX;
3649 UpdateDesiredBoundingBox(uXAxis);
3659 return m_AxisDataX.pos;
3666 void SetPosY(std::unordered_map<int, double>& posYList)
3672 UpdateDesiredBoundingBox(uYAxis);
3683 assert(m_AxisDataYList.count(yAxisID) != 0);
3684 return m_AxisDataYList[yAxisID].pos;
3692 return (
int)m_AxisDataYList.size();
3700 return m_AxisDataYList;
3712 m_plotWidth = m_scrX - (m_margin.left + m_margin.right);
3713 m_plotHeight = m_scrY - (m_margin.top + m_margin.bottom);
3715 m_plotBoundaries.endPx = m_scrX;
3716 m_plotBoundariesMargin.endPx = m_scrX - m_margin.right;
3717 m_plotBoundaries.endPy = m_scrY;
3718 m_plotBoundariesMargin.endPy = m_scrY - m_margin.bottom;
3720 m_PlotArea = wxRect(m_margin.left - m_extraMargin, m_margin.top - m_extraMargin,
3721 m_plotWidth + 2*m_extraMargin, m_plotHeight + 2*m_extraMargin);
3723 m_magnet.UpdateBox(m_PlotArea);
3753 void SetPos(
const double posX, std::unordered_map<int, double>& posYList)
3755 m_AxisDataX.pos = posX;
3762 inline double p2x(
const wxCoord pixelCoordX)
const 3764 return m_AxisDataX.pos + (pixelCoordX / m_AxisDataX.scale);
3770 inline double p2y(
const wxCoord pixelCoordY,
int yAxisID = 0)
3772 assert(m_AxisDataYList.count(yAxisID) != 0);
3773 if (m_AxisDataYList.count(yAxisID) == 0)
3775 return m_AxisDataYList[yAxisID].pos - (pixelCoordY / m_AxisDataYList[yAxisID].scale);
3781 inline wxCoord
x2p(
const double x)
const 3783 return (wxCoord)((x - m_AxisDataX.pos) * m_AxisDataX.scale);
3789 inline wxCoord
y2p(
const double y,
int yAxisID = 0)
3791 assert(m_AxisDataYList.count(yAxisID) != 0);
3792 if (m_AxisDataYList.count(yAxisID) == 0)
3794 return (wxCoord)((m_AxisDataYList[yAxisID].pos - y) * m_AxisDataYList[yAxisID].scale);
3801 m_enableBufferedPaintDC = enabled;
3808 m_enableMouseNavigation = enabled;
3816 void LockAspect(
bool enable =
true);
3824 return m_lockaspect;
3839 void Fit(
const mpRange<double> &rangeX, std::unordered_map<
int,
mpRange<double>> rangeY, wxCoord *printSizeX = NULL, wxCoord *printSizeY = NULL);
3850 void FitY(
int yAxisID);
3856 void ZoomIn(
const wxPoint ¢erPoint = wxDefaultPosition);
3862 void ZoomOut(
const wxPoint ¢erPoint = wxDefaultPosition);
3882 void ZoomRect(wxPoint p0, wxPoint p1);
3892 unsigned int CountLayers();
3898 return (
unsigned int)m_layers.size();
3904 unsigned int CountLayersType(mpLayerType type);
3909 unsigned int CountLayersFXYPlot();
3920 if (update & uXAxis)
3922 m_AxisDataX.desired.Set(m_AxisDataX.pos + (m_margin.left / m_AxisDataX.scale),
3923 m_AxisDataX.pos + ((m_margin.left + m_plotWidth) / m_AxisDataX.scale));
3927 if (update & uYAxis)
3944 assert(m_AxisDataYList.count(yAxisID) != 0);
3946 return mpFloatRectSimple(m_AxisDataX.desired, m_AxisDataYList[yAxisID].desired);
3956 return m_AxisDataX.desired.min;
3965 return m_AxisDataX.desired.max;
3975 assert(m_AxisDataYList.count(yAxisID) != 0);
3976 return m_AxisDataYList[yAxisID].desired.min;
3986 assert(m_AxisDataYList.count(yAxisID) != 0);
3987 return m_AxisDataYList[yAxisID].desired.max;
3997 if (m_AxisDataYList.count(yAxisID) == 0)
3999 *boundX = m_AxisDataX.bound;
4000 *boundY = m_AxisDataYList[yAxisID].bound;
4011 if (m_AxisDataYList.count(yAxisID) == 0)
4014 return m_AxisDataX.bound.PointIsInside(px) && GetBoundY(yAxisID).PointIsInside(py);
4024 if (m_AxisDataYList.count(yAxisID) == 0)
4027 m_AxisDataX.bound.Update(px);
4028 m_AxisDataYList[yAxisID].bound.Update(py);
4039 if (m_AxisDataYList.count(yAxisID) == 0)
4042 m_AxisDataX.bound.Set(px, px);
4043 m_AxisDataYList[yAxisID].bound.Set(py, py);
4048 void SetMPScrollbars(
bool status);
4054 return m_enableScrollBars;
4062 bool SaveScreenshot(
const wxString &filename,
int type = wxBITMAP_TYPE_BMP, wxSize imageSize = wxDefaultSize,
bool fit =
false);
4067 wxBitmap* BitmapScreenshot(wxSize imageSize = wxDefaultSize,
bool fit =
false);
4072 void ClipboardScreenshot(wxSize imageSize = wxDefaultSize,
bool fit =
false);
4079 m_wildcard = wildcard;
4097 bool LoadFile(
const wxString &filename = wxEmptyString);
4105 m_DefaultDir = dirname;
4124 m_DefaultLegendIsAlwaysVisible = visible;
4139 m_autoFit = autoFit;
4148 void SetMargins(
int top,
int right,
int bottom,
int left);
4153 SetMargins(m_marginOuter.top, m_marginOuter.right, m_marginOuter.bottom, m_marginOuter.left);
4159 SetMargins(top, m_marginOuter.right, m_marginOuter.bottom, m_marginOuter.left);
4168 return m_margin.top - m_extraMargin;
4170 return m_margin.top;
4176 SetMargins(m_marginOuter.top, right, m_marginOuter.bottom, m_marginOuter.left);
4185 return m_margin.right - m_extraMargin;
4187 return m_margin.right;
4193 return m_marginOuter.right;
4199 SetMargins(m_marginOuter.top, m_marginOuter.right, bottom, m_marginOuter.left);
4208 return m_margin.bottom - m_extraMargin;
4210 return m_margin.bottom;
4216 SetMargins(m_marginOuter.top, m_marginOuter.right, m_marginOuter.bottom, left);
4225 return m_margin.left - m_extraMargin;
4227 return m_margin.left;
4233 m_extraMargin = extra;
4234 SetMargins(m_marginOuter.top, m_marginOuter.right, m_marginOuter.bottom, m_marginOuter.left);
4240 return m_extraMargin;
4246 return m_marginOuter.left;
4258 return m_plotHeight;
4269 bond = m_plotBoundariesMargin;
4271 bond = m_plotBoundaries;
4272 bond.startPx -= m_extraMargin;
4273 bond.endPx += m_extraMargin;
4274 bond.startPy -= m_extraMargin;
4275 bond.endPy += m_extraMargin;
4292 m_drawBox = drawbox;
4309 mpInfoLayer* IsInsideInfoLayer(
const wxPoint &point);
4314 void SetLayerVisible(
const wxString &name,
bool viewable);
4319 bool IsLayerVisible(
const wxString &name);
4324 bool IsLayerVisible(
const unsigned int position);
4329 void SetLayerVisible(
const unsigned int position,
bool viewable);
4335 void SetColourTheme(
const wxColour &bgColour,
const wxColour &drawColour,
const wxColour &axesColour);
4353 m_bgColour = colour;
4363 m_OnDeleteLayer = event;
4369 m_OnDeleteLayer = NULL;
4378 m_OnUserMouseAction = userMouseEventHandler;
4384 m_OnUserMouseAction = NULL;
4394 if (m_AxisDataX.axis)
4395 return ((
mpScaleX *)m_AxisDataX.axis)->IsLogAxis();
4406 assert(m_AxisDataYList.count(yAxisID) != 0);
4407 mpScaleY* yAxis = GetLayerYAxis(yAxisID);
4409 return yAxis->IsLogAxis();
4420 if (m_AxisDataX.axis)
4421 ((
mpScaleX *)m_AxisDataX.axis)->SetLogAxis(log);
4431 mpScaleY* yAxis = GetLayerYAxis(yAxisID);
4442 return m_magnet.IsEnabled();
4448 m_magnet.Enable(mag);
4457 m_mouseLeftDownAction = action;
4466 return m_mouseLeftDownAction;
4484 return m_movingInfoLayer;
4487 #ifdef ENABLE_MP_CONFIG 4493 #endif // ENABLE_MP_CONFIG 4501 void RefreshConfigWindow(mpLayerType layerType,
int param = 0,
bool show =
false);
4506 void OpenConfigWindow();
4511 void DeleteConfigWindow(
void);
4517 void Paint(wxDC& dc);
4523 void RenderOverlays(wxDC& dc);
4532 m_buff_dc.SelectObject(m_buff_bmp);
4537 virtual void BindEvents(
void);
4538 virtual void OnPaint(wxPaintEvent &event);
4539 virtual void OnSize(wxSizeEvent &event);
4540 virtual void OnShowPopupMenu(wxMouseEvent &event);
4541 virtual void OnCenter(wxCommandEvent &event);
4542 virtual void OnFit(wxCommandEvent &event);
4543 virtual void OnToggleGrids(wxCommandEvent &event);
4544 virtual void OnToggleCoords(wxCommandEvent &event);
4545 virtual void OnScreenShot(wxCommandEvent &event);
4546 virtual void OnFullScreen(wxCommandEvent &event);
4547 #ifdef ENABLE_MP_CONFIG 4548 virtual void OnConfiguration(wxCommandEvent &event);
4549 #endif // ENABLE_MP_CONFIG 4550 virtual void OnLoadFile(wxCommandEvent &event);
4551 virtual void OnZoomIn(wxCommandEvent &event);
4552 virtual void OnZoomOut(wxCommandEvent &event);
4553 virtual void OnLockAspect(wxCommandEvent &event);
4554 virtual void OnMouseHelp(wxCommandEvent &event);
4555 virtual void OnMouseLeftDown(wxMouseEvent &event);
4556 virtual void OnMouseRightDown(wxMouseEvent &event);
4557 virtual void OnMouseMove(wxMouseEvent &event);
4558 virtual void OnMouseLeftRelease(wxMouseEvent &event);
4559 virtual void OnMouseWheel(wxMouseEvent &event);
4560 virtual void OnMouseLeave(wxMouseEvent &event);
4561 bool CheckUserMouseAction(wxMouseEvent &event);
4562 virtual void OnScrollThumbTrack(wxScrollWinEvent &event);
4563 virtual void OnScrollPageUp(wxScrollWinEvent &event);
4564 virtual void OnScrollPageDown(wxScrollWinEvent &event);
4565 virtual void OnScrollLineUp(wxScrollWinEvent &event);
4566 virtual void OnScrollLineDown(wxScrollWinEvent &event);
4567 virtual void OnScrollTop(wxScrollWinEvent &event);
4568 virtual void OnScrollBottom(wxScrollWinEvent &event);
4571 void DoScrollCalc(
const int position,
const int orientation);
4591 void SetScaleXAndCenter(
double scaleX);
4598 void SetScaleYAndCenter(
double scaleY,
int yAxisID);
4604 void Zoom(
bool zoomIn,
const wxPoint ¢erPoint);
4608 virtual bool UpdateBBox();
4613 void DrawBoxZoom(wxDC& dc);
4618 void InitParameters();
4679 #ifdef ENABLE_MP_CONFIG 4681 #endif // ENABLE_MP_CONFIG 4682 bool m_openConfigWindowPending =
false;
4685 mpOnDeleteLayer m_OnDeleteLayer = NULL;
4686 mpOnUserMouseAction m_OnUserMouseAction = NULL;
4695 void CheckAndReportDesiredBoundsChanges();
4701 unsigned int GetNewAxisDataID(
void)
4709 newID = std::max(newID,
m_yID + 1);
4750 mpText(
const wxString &name,
int offsetx,
int offsety);
4755 mpText(
const wxString &name, mpLocation marginLocation);
4768 m_location = location;
4800 virtual void DoPlot(wxDC &dc,
mpWindow &w);
4822 SetPen(*wxWHITE_PEN);
4823 SetBrush(*wxWHITE_BRUSH);
4853 mpPrintout(
mpWindow *drawWindow,
const wxString &title = _T(
"wxMathPlot print output"),
int factor = 2);
4868 bool OnPrintPage(
int page);
4870 bool HasPage(
int page);
4876 stretch_factor = factor;
4903 m_reference_x(0), m_reference_y(0), m_reference_phi(0), m_shape_xs(0), m_shape_ys(0)
4917 phi = m_reference_phi;
4926 m_reference_phi = phi;
4933 return m_trans_shape_xs.size() != 0;
4940 return m_bbox_x.min;
4947 return m_bbox_x.max;
4954 return m_bbox_y.min;
4961 return m_bbox_y.max;
4972 virtual void DoPlot(wxDC &dc,
mpWindow &w);
4976 void TranslatePoint(
double x,
double y,
double &out_x,
double &out_y)
const;
4995 void ShapeUpdated();
5021 mpCovarianceEllipse(
double cov_00 = 1,
double cov_11 = 1,
double cov_01 = 0,
double quantiles = 2,
int segments = 32,
5023 m_cov_00(cov_00), m_cov_11(cov_11), m_cov_01(cov_01), m_quantiles(quantiles), m_segments(segments)
5025 m_continuous =
true;
5053 m_segments = segments;
5095 void RecalculateShape();
5115 m_continuous =
true;
5129 void setPoints(
const std::vector<double> &points_xs,
const std::vector<double> &points_ys,
bool closedShape =
true);
5150 m_bitmapChanged =
false;
5151 m_scaledBitmap_offset_x = m_scaledBitmap_offset_y = 0;
5161 void GetBitmapCopy(wxImage &outBmp)
const;
5170 void SetBitmap(
const wxImage &inBmp,
double x,
double y,
double lx,
double ly);
5176 return m_bitmapX.min;
5183 return m_bitmapX.max;
5190 return m_bitmapY.min;
5197 return m_bitmapY.max;
5216 virtual void DoPlot(wxDC &dc,
mpWindow &w);
5254 this->Set(0, 0, 255);
5257 this->Set(255, 0, 0);
5260 this->Set(0, 128, 0);
5263 this->Set(128, 0, 128);
5266 this->Set(255, 255, 0);
5269 this->Set(255, 0, 255);
5272 this->Set(0, 255, 0);
5275 this->Set(0, 255, 255);
5278 this->Set(128, 128, 0);
5281 this->Set((ChannelType)((rand() * 255) / RAND_MAX), (ChannelType)((rand() * 255) / RAND_MAX),
5282 (ChannelType)((rand() * 255) / RAND_MAX));
5290 #ifdef ENABLE_MP_NAMESPACE 5293 #endif // ENABLE_MP_NAMESPACE 5295 #endif // MATHPLOT_H_INCLUDED sub type for mpFXYVector function
Definition: mathplot.h:755
int m_offsety
Holds offset for Y in percentage.
Definition: mathplot.h:4795
const wxString & GetLabelFormat() const
Get axis Label format (used for mpLabel_AUTO draw mode).
Definition: mathplot.h:2830
bool m_enableBufferedPaintDC
For auto DC double buffering.
Definition: mathplot.h:4654
std::function< void(void *Sender, const wxString &classname, bool &cancel)> mpOnDeleteLayer
Define an event for when we delete a layer.
Definition: mathplot.h:3268
bool IsHorizontal(void) const
Is it a horizontal line?
Definition: mathplot.h:1831
__mp_Location_Type
Location for the Info layer.
Definition: mathplot.h:657
int GetAxisID(void)
Return the ID of the Axis.
Definition: mathplot.h:2759
mpRange< double > m_rangeY
Y range.
Definition: mathplot.h:2418
sub type for mpText layer
Definition: mathplot.h:744
Align the plot label towards the southeast.
Definition: mathplot.h:696
wxMemoryDC m_buff_dc
DC for double buffering.
Definition: mathplot.h:4652
void SetValue(const double value)
Set x or y value.
Definition: mathplot.h:1823
mpInfoLegend * m_InfoLegend
Pointer to the optional info legend layer.
Definition: mathplot.h:4668
Draw a circle.
Definition: mathplot.h:719
enum __YAxis_Align_Type mpYAxis_Align
Alignment for Y axis.
Show legend items with small square with the same color of referred mpLayer.
Definition: mathplot.h:704
mpRect m_marginOuter
Margin around the plot exluding Y-axis. Default 50.
Definition: mathplot.h:4640
bool m_isLog
Is the axis a log axis ?
Definition: mathplot.h:2987
int m_infoLegendSelectedSeries
Only used with config window: the selected series in info legend.
Definition: mathplot.h:4683
bool m_LegendIsAlwaysVisible
If true, the name is visible in the legend despite the visibility of the function. Default false.
Definition: mathplot.h:1785
size_t m_endIndex
The end index indicating the last point inside plot area.
Definition: mathplot.h:2242
wxIndexColour(unsigned int id)
Constructor.
Definition: mathplot.h:5249
void SetBrush(const wxBrush &brush)
Set layer brush.
Definition: mathplot.h:1068
bool IsLogYaxis(int yAxisID)
Get the log property (true or false) Y layer (Y axis) with a specific Y ID or false if not found...
Definition: mathplot.h:4404
std::vector< std::string > labels
Labels of the Values.
Definition: mathplot.h:2552
enum __mp_Colour mpColour
Enumeration of classic colour.
Bitmap type layer.
Definition: mathplot.h:834
static bool m_DefaultLegendIsAlwaysVisible
This value sets the default behaviour when a series is not visible for the legend display...
Definition: mathplot.h:4115
bool m_showName
States whether the name of the layer must be shown. Default : false.
Definition: mathplot.h:1198
#define MP_LOOP_ITER
Helper macro for iterating through axis maps without structured binding.
Definition: mathplot.h:131
mpLegendDirection m_item_direction
Layout direction used when arranging legend entries.
Definition: mathplot.h:1593
__Scale_Type
sub_type values for mpLAYER_AXIS
Definition: mathplot.h:762
Plot type layer.
Definition: mathplot.h:819
void Show(bool show)
Set if magnet shall be shown or hidden.
Definition: mathplot.h:3323
int GetScreenX(void) const
Get current view's X dimension in device context units.
Definition: mathplot.h:3732
wxPoint GetMousePosition()
Returns current mouse position in window.
Definition: mathplot.h:4473
void SetLegendIsAlwaysVisible(bool alwaysVisible)
Set the visibility of the name of the function in the legend despite the visibility of the function i...
Definition: mathplot.h:1735
virtual double GetMaxY()
Get inclusive top border of bounding box.
Definition: mathplot.h:5195
bool IsRightAxis()
Return true if this Y axis is aligned to the right side.
Definition: mathplot.h:3169
void SetLabelMode(mpLabelType mode, unsigned int time_conv=0x20)
Set X axis label view mode.
Definition: mathplot.h:1428
User defined position. Can be change by mouse drag.
Definition: mathplot.h:667
void UnSetOnDeleteLayer()
Remove the 'delete layer event' callback.
Definition: mathplot.h:4367
void SetXValue(const double xvalue)
Set x.
Definition: mathplot.h:1888
void SetYAxisID(unsigned int yAxisID)
Set the ID of the Y axis used by the function.
Definition: mathplot.h:1727
std::map< int, mpAxisData > mpAxisList
Define the type for the list of axis.
Definition: mathplot.h:3245
bool ShouldBeShown(wxRect plotArea, wxPoint mousePos)
Check conditions if info coords shall be shown or not.
Definition: mathplot.h:1420
mpLegendStyle GetItemMode() const
Get the current legend item drawing mode.
Definition: mathplot.h:1518
An arbitrary polygon, descendant of mpMovableObject.
Definition: mathplot.h:5108
#define MP_X_RAWTIME
Shortcut for MP_X_UTCTIME.
Definition: mathplot.h:202
void SetScaleX(const double scaleX)
Set current view's X scale and refresh display.
Definition: mathplot.h:3535
mpFloatRectSimple(mpRange< double > _x, mpRange< double > _y)
Construct a simple rectangular box.
Definition: mathplot.h:602
virtual double GetMinY()
Get inclusive bottom border of bounding box.
Definition: mathplot.h:946
__Symbol_Type
Displaying a symbol instead of a point in the plot function.
Definition: mathplot.h:716
double m_deltaY
Min delta between 2 consecutive coordinate on y direction.
Definition: mathplot.h:2122
void SetCoordIsAlwaysVisible(bool alwaysVisible)
Set the visibility of the mouse coordinates in the info coordinates despite the visibility of the axi...
Definition: mathplot.h:2961
A class providing graphs functionality for a 2D plot (either continuous or a set of points)...
Definition: mathplot.h:2169
int m_clickedX
Last mouse click X position, for centering and zooming the view.
Definition: mathplot.h:4636
Show legend items with line with the same pen of referred mpLayer.
Definition: mathplot.h:703
__mp_Layer_Type
Major type of an mpLayer (detail is in subtype)
Definition: mathplot.h:815
wxBitmap m_buff_bmp
Bmp for double buffering.
Definition: mathplot.h:4651
Show/Hide grids.
Definition: mathplot.h:645
A layer that allows you to have a bitmap image printed in the mpWindow.
Definition: mathplot.h:5142
int m_axisID
Unique ID that identify this axis. Default -1 mean that axis is not used.
Definition: mathplot.h:2978
void InitializeBoundingBox(double px, double py, int yAxisID)
Initialize the bounding box from a first point for the selected Y axis.
Definition: mathplot.h:4037
mpLabelType
enum for label for grid
Definition: mathplot.h:787
void Update(T value)
Update range according new value: Expand the range to include the value.
Definition: mathplot.h:382
bool m_mouseMovedAfterRightClick
If the mouse does not move after a right click, then the context menu is displayed.
Definition: mathplot.h:4657
Classic Normal distribution f(x) = exp(-(ln(x)-μ)²/2σ²)/(xσ.sqrt(2π))
Definition: mathplot.h:2471
virtual double GetMinY()
Get inclusive bottom border of bounding box.
Definition: mathplot.h:2692
wxPoint m_mouseRClick
For the right button "drag" feature.
Definition: mathplot.h:4659
virtual double GetMinX()
Get inclusive left border of bounding box.
Definition: mathplot.h:2676
mpPolygon(const wxString &layerName=_T(""))
Default constructor.
Definition: mathplot.h:5113
double m_lastX
Last x-coordinate point added.
Definition: mathplot.h:2244
bool GetShowGrids() const
Get axis grids.
Definition: mathplot.h:2796
bool m_showDraggedSeries
Indicate if series that has been gripped with mouse shall be drawn.
Definition: mathplot.h:1594
wxCoord y2p(const double y, int yAxisID=0)
Converts graph (floating point) coordinates into mpWindow (screen) pixel coordinates, using current mpWindow position and scale.
Definition: mathplot.h:3789
enum __Plot_Align_Name_Type mpPlot_Align
Plot alignment (which corner should plot be placed)
mpRange< double > m_bitmapX
The shape of the bitmap:
Definition: mathplot.h:5213
Layer type undefined; SHOULD NOT BE USED.
Definition: mathplot.h:817
enum __mp_Direction_Type mpLegendDirection
Direction for the Legend layer.
__mp_Delete_Action
Action to do with the object associated to the layer when we delete it.
Definition: mathplot.h:850
sub type not defined (should be never used)
Definition: mathplot.h:764
wxString m_name
Layer's name.
Definition: mathplot.h:1197
void SetMagnetize(bool mag)
Enable or disable mouse-position magnet lines (cross-hairs) in the plot area.
Definition: mathplot.h:4446
const mpLayerType m_type
Layer type mpLAYER_*.
Definition: mathplot.h:1190
double m_cov_11
Covariance matrix element (1,1).
Definition: mathplot.h:5085
virtual bool HasBBox() override
Check whether this layer has a bounding box.
Definition: mathplot.h:1807
Lock x/y scaling aspect.
Definition: mathplot.h:644
virtual double GetMinY()
Get min Y of the function.
Definition: mathplot.h:2403
void SetMaxNOfPoints(size_t nOfPoints)
Set how many points that is allowed to be drawn at a time.
Definition: mathplot.h:1766
void SetItemMode(mpLegendStyle mode)
Set item mode (the element on the left of text representing the plot line may be line, square, or line with symbol).
Definition: mathplot.h:1511
wxString m_wildcard
For loadfile() function when we use wxFileDialog.
Definition: mathplot.h:4676
Align the info in margin center-bottom.
Definition: mathplot.h:665
int m_axisWidth
Reserved width for this Y axis including labels, in pixels.
Definition: mathplot.h:3185
Info box type layer.
Definition: mathplot.h:839
int m_offsetx
Holds offset for X in percentage.
Definition: mathplot.h:4794
void SetLabelMode(mpLabelType mode, unsigned int time_conv=0x20)
Set axis label view mode.
Definition: mathplot.h:2822
Abstract class providing a line.
Definition: mathplot.h:1795
mpRange< double > m_rangeX
Range min and max on x axis.
Definition: mathplot.h:2243
Abstract class providing an vertical line.
Definition: mathplot.h:1875
bool GetShowTicks() const
Get axis ticks.
Definition: mathplot.h:2782
void SetCenter(const wxPoint center)
Set the center of the pie chart.
Definition: mathplot.h:2655
bool IsLeftAxis()
Return true if this Y axis is aligned to the left side.
Definition: mathplot.h:3163
double m_reference_y
Current object Y position in plot coordinates.
Definition: mathplot.h:4969
bool m_show
Indicates if magnet shall be shown in plot.
Definition: mathplot.h:1468
Canvas for plotting mpLayer implementations.
Definition: mathplot.h:3361
#define MP_ZOOM_AROUND_CENTER
Default value for zoom around a point (default -1 is no zoom)
Definition: mathplot.h:213
mpRange< int > m_drawY
Range min and max on y axis.
Definition: mathplot.h:2118
wxString m_DefaultDir
The default directory for wxFileDialog.
Definition: mathplot.h:4677
enum __Info_Type mpInfoType
sub_type values for mpLAYER_INFO
wxPen m_gridpen
Grid's pen. Default Colour = LIGHT_GREY, width = 1, style = wxPENSTYLE_DOT.
Definition: mathplot.h:2979
int m_labelPos
Bar-label placement mode.
Definition: mathplot.h:2621
int GetNOfYAxis(void) const
Get the number of Y axis.
Definition: mathplot.h:3690
double p2y(const wxCoord pixelCoordY, int yAxisID=0)
Converts mpWindow (screen) pixel coordinates into graph (floating point) coordinates, using current mpWindow position and scale.
Definition: mathplot.h:3770
std::vector< double > m_ys
internal copy of the set of data on y direction
Definition: mathplot.h:2238
void SetExtraMargin(int extra)
Set the extra margin.
Definition: mathplot.h:4231
mpScaleY(const wxString &name=_T("Y"), int flags=mpALIGN_CENTERY, bool grids=false, mpOptional_uint yAxisID=-1, mpLabelType labelType=mpLabel_AUTO)
Full constructor.
Definition: mathplot.h:3144
wxBitmap * m_info_bmp
The bitmap that contain the info.
Definition: mathplot.h:1345
bool m_bitmapChanged
True when the cached scaled bitmap must be regenerated.
Definition: mathplot.h:5209
void SetCoordinateBase(double x, double y, double phi=0)
Set the coordinate transformation (phi in radians, 0 means no rotation).
Definition: mathplot.h:4922
bool m_isMonotonicX
Indicates if all all X values are monotonic, i.e increasing, which enables binary search...
Definition: mathplot.h:2239
Chart type layer (bar chart)
Definition: mathplot.h:824
mpRange< double > x
range over x direction
Definition: mathplot.h:594
double GetPosY(int yAxisID)
Get current view's Y position.
Definition: mathplot.h:3681
virtual void SetLogAxis(bool log)
Set Logarithmic mode.
Definition: mathplot.h:2953
double GetQuantiles() const
Get the confidence-interval multiplier used for the ellipse.
Definition: mathplot.h:5037
sub type for mpLine function
Definition: mathplot.h:757
const wxColour & GetFontColour() const
Get font foreground colour set for this layer.
Definition: mathplot.h:1045
void SetAutoFit(bool autoFit)
Set if plot shall be auto fitted when hiding or showing axis and series via mouse.
Definition: mathplot.h:4137
bool IsAspectLocked() const
Checks whether the X/Y scale aspect is locked.
Definition: mathplot.h:3822
~mpBarChart()
Destructor.
Definition: mathplot.h:2580
double p2x(const wxCoord pixelCoordX) const
Converts mpWindow (screen) pixel coordinates into graph (floating point) coordinates, using current mpWindow position and scale.
Definition: mathplot.h:3762
T GetMaxAbs(void) const
Max absolute value of the range.
Definition: mathplot.h:437
Draw a cross X.
Definition: mathplot.h:723
void Update(mpRange range)
Update range with new range values if this expand the range.
Definition: mathplot.h:404
mpLayerZOrder m_ZIndex
The index in Z-Order to draw the layer.
Definition: mathplot.h:1205
A rectangle structure in several (integer) flavors.
Definition: mathplot.h:257
double m_width
Width of each bar/column in plot units.
Definition: mathplot.h:2619
Draw a triangle up oriented.
Definition: mathplot.h:721
wxTopLevelWindow * m_parent
Pointer to the top-level window containing the plot (used for fullscreen)
Definition: mathplot.h:4620
void SetDefaultLegendIsAlwaysVisible(bool visible)
Set if legend is always visible even if series is not plotted.
Definition: mathplot.h:4122
wxPoint m_mouseLClick
Starting coords for rectangular zoom selection.
Definition: mathplot.h:4660
bool IsEnabled() const
Check if magnet is enabled.
Definition: mathplot.h:3308
virtual void DesiredBoundsHaveChanged()
To be notified of displayed bounds changes (after user zoom etc), override this callback in your deri...
Definition: mathplot.h:4691
T min
The min value of the range.
Definition: mathplot.h:302
double m_relY
Box Y position relative window, used to rescale the info box position when the window is resized...
Definition: mathplot.h:1348
void SetPen(const wxPen &pen)
Set layer pen.
Definition: mathplot.h:1053
int m_flags
Holds label alignment. Default : mpALIGN_SW for series and mpALIGN_CENTER for scale.
Definition: mathplot.h:1202
wxRect GetRect(void)
Create rectangular area defined by start and end points.
Definition: mathplot.h:287
mpRange< double > m_bbox_x
The precomputed bounding box:
Definition: mathplot.h:4989
virtual bool HasBBox()
Text Layer has not bounding box.
Definition: mathplot.h:4759
Mouse action drag the plot.
Definition: mathplot.h:783
virtual double GetMinX()
Get inclusive left border of bounding box.
Definition: mathplot.h:930
mpNormal(double mu, double sigma)
Classic Normal distribution.
Definition: mathplot.h:2479
mpInfoLayer * GetMovingInfoLayer()
Returns moving info layer.
Definition: mathplot.h:4482
wxPoint GetPosition() const
Get the position of the upper left corner of the box (in pixels)
Definition: mathplot.h:1302
void SetPenSeries(const wxPen &pen)
Pen series for tractable.
Definition: mathplot.h:1457
void SetDrawOutsideMargins(bool drawModeOutside)
Set Draw mode: inside or outside margins.
Definition: mathplot.h:1108
~mpPieChart()
Destructor.
Definition: mathplot.h:2646
mpRange()
Default constructor.
Definition: mathplot.h:306
T max
The max value of the range.
Definition: mathplot.h:303
void Show(bool show)
Set if info coords shall be shown or hidden.
Definition: mathplot.h:1404
sub type not defined (should be never used)
Definition: mathplot.h:773
int m_symbolSize
Size of the symbol. Default 6.
Definition: mathplot.h:1781
void SetDefaultDir(const wxString &dirname)
Set the default directory for wxFileDialog.
Definition: mathplot.h:4103
enum __Function_Type mpFunctionType
sub_type values for mpLAYER_PLOT and mpLAYER_LINE
sub type not defined (should be never used)
Definition: mathplot.h:751
void Check(void)
Check to always have a range. If min = max then introduce the 0 to make a range.
Definition: mathplot.h:413
int GetPlotWidth() const
Get the width of the plot.
Definition: mathplot.h:4250
sub type not defined (should be never used)
Definition: mathplot.h:743
double m_lastY
Last y-coordinate point added.
Definition: mathplot.h:2246
int m_subtype
Layer sub type, set in constructors.
Definition: mathplot.h:1192
T GetCenter(void) const
Center of the range.
Definition: mathplot.h:431
Just the end of ZOrder.
Definition: mathplot.h:841
virtual double GetMinY()
Get inclusive bottom border of bounding box.
Definition: mathplot.h:4952
__mp_Layer_ZOrder
Z order for drawing layer Background is the deeper (bitmap layer) Then draw axis, custom layer...
Definition: mathplot.h:832
void Set(T _value)
Initialize min and max.
Definition: mathplot.h:328
mpRange< double > m_axisRange
Range axis values when autosize is false.
Definition: mathplot.h:2983
void SetMarginRight(int right)
Set the right margin.
Definition: mathplot.h:4174
static double m_zoomIncrementalFactor
This value sets the zoom steps whenever the user clicks "Zoom in/out" or performs zoom with the mouse...
Definition: mathplot.h:4110
double m_cov_01
Covariance matrix element (0,1), equal to element (1,0).
Definition: mathplot.h:5086
virtual void ErasePlot(wxDC &, mpWindow &)
Just delete the bitmap of the info.
Definition: mathplot.h:1285
void SetContinuity(bool continuity)
Set the 'continuity' property of the layer.
Definition: mathplot.h:1654
int GetMarginLeftOuter() const
Get the left outer margin, exluding Y-axis.
Definition: mathplot.h:4244
Draw a plus +.
Definition: mathplot.h:724
void SetMouseLeftDownAction(mpMouseButtonAction action)
Set the type of action for the left mouse button.
Definition: mathplot.h:4455
wxMenu m_popmenu
Canvas' context menu.
Definition: mathplot.h:4627
Keep the object, just remove the layer from the layer list.
Definition: mathplot.h:852
double m_mu
Mean value.
Definition: mathplot.h:2453
double m_mouseScaleX
Store current X-scale, used as reference during drag zooming.
Definition: mathplot.h:4661
Abstract base class providing plot and labeling functionality for functions F:Y->X.
Definition: mathplot.h:1978
Abstract base class providing plot and labeling functionality for a locus plot F:N->X,Y.
Definition: mathplot.h:2043
enum __mp_Style_Type mpLegendStyle
Style for the Legend layer.
wxColour m_axColour
Axes Colour.
Definition: mathplot.h:4631
wxColour m_barColour
Fill colour used for the bars.
Definition: mathplot.h:2620
Delete the object regardless of the CanDelete value and remove it from the layer list.
Definition: mathplot.h:854
bool m_visible
Toggles layer visibility. Default : true.
Definition: mathplot.h:1200
mpRect m_plotBoundaries
The full size of the plot. Calculated.
Definition: mathplot.h:4645
void GetCoordinateBase(double &x, double &y, double &phi) const
Get the current coordinate transformation.
Definition: mathplot.h:4913
std::function< void(void *Sender, wxMouseEvent &event, bool &cancel)> mpOnUserMouseAction
Define an event for when we have a mouse click Use like this : your_plot->SetOnUserMouseAction([this]...
Definition: mathplot.h:3276
Align the plot label towards the southwest.
Definition: mathplot.h:697
Implement the legend to be added to the plot This layer allows you to add a legend to describe the pl...
Definition: mathplot.h:1493
Plot layer implementing a x-scale ruler.
Definition: mathplot.h:3079
double m_quantiles
Confidence-interval multiplier used when drawing the ellipse.
Definition: mathplot.h:5087
Align the y-axis towards left border.
Definition: mathplot.h:684
bool m_tractable
Is the layer tractable.
Definition: mathplot.h:1201
#define ISNOTNULL(x)
Nullity test. Old solution is to test according small epsilon: (fabs(x) > MP_EPSILON) ...
Definition: mathplot.h:207
void SetLocation(mpLocation location)
Set the location of the box.
Definition: mathplot.h:4766
Align the x-axis towards bottom border.
Definition: mathplot.h:674
virtual bool HasBBox()
Check whether this layer has a bounding box.
Definition: mathplot.h:2545
void EnableMousePanZoom(const bool enabled)
Enable/disable the feature of pan/zoom with the mouse (default=enabled)
Definition: mathplot.h:3806
void Assign(T value1, T value2)
Assign values to min and max.
Definition: mathplot.h:358
bool m_drawBox
Draw box of the plot bound. Default true.
Definition: mathplot.h:4632
Plot (function) type layer.
Definition: mathplot.h:837
void UpdateDesiredBoundingBox(mpAxisUpdate update)
Update m_desired bounds.
Definition: mathplot.h:3917
void UpdateBoundingBoxToInclude(double px, double py)
Update bounding box (X and Y axis) to include this point.
Definition: mathplot.h:618
const wxPen & GetGridPen() const
Get pen set for this axis.
Definition: mathplot.h:2846
bool m_IsHorizontal
Is the line horizontal? Default false.
Definition: mathplot.h:1838
bool m_CanDelete
Is the layer can be deleted.
Definition: mathplot.h:1204
mpSymbol GetSymbol() const
Get symbol.
Definition: mathplot.h:1690
void SetWindow(mpWindow &w)
Set the wxWindow handle.
Definition: mathplot.h:883
wxFont m_font
Layer's font.
Definition: mathplot.h:1193
bool GetCoordIsAlwaysVisible() const
Get the visibility of the mouse coordinates in the info coordinates.
Definition: mathplot.h:2969
bool GetCanDelete(void) const
Retreive what we do with the object associated with the layer when we delete the layer.
Definition: mathplot.h:1177
Axis type layer.
Definition: mathplot.h:835
Dialog box for configuring the plot's layer objects In this dialog, you can configure: ...
Definition: MathPlotConfig.h:154
virtual double GetMaxY()
Get inclusive top border of bounding box.
Definition: mathplot.h:2700
bool m_auto
Flag to autosize grids. Default true.
Definition: mathplot.h:2982
Draw a triangle down oriented.
Definition: mathplot.h:722
wxCoord m_mouseY
Last mouse Y position in window pixel coordinates.
Definition: mathplot.h:1473
Axis type layer.
Definition: mathplot.h:818
void SetCanDelete(bool canDelete)
Set what we do with the object associated with the layer when we delete the layer.
Definition: mathplot.h:1170
virtual double GetMinX()
Get inclusive left border of bounding box.
Definition: mathplot.h:5174
bool GetMagnetize() const
Is mouse magnetization enabled? Useful to read the position on the axes.
Definition: mathplot.h:4440
double m_value
The x or y coordinates of the line.
Definition: mathplot.h:1837
mpInfoLayer * m_movingInfoLayer
For moving info layers over the window area.
Definition: mathplot.h:4666
void Enable(bool enable)
Enables the magnet.
Definition: mathplot.h:3302
wxPen m_penSeries
Pen used to draw the series marker when series-coordinate mode is active.
Definition: mathplot.h:1475
wxPoint m_center
Center of the pie chart in device coordinates.
Definition: mathplot.h:2708
std::vector< double > m_trans_shape_ys
Transformed shape vertices in Y coordinates.
Definition: mathplot.h:4984
mpLabelType m_labelType
Select labels mode: mpLabel_AUTO for normal labels, mpLabel_TIME for time axis in hours...
Definition: mathplot.h:2984
~mpInfoCoords()
Default destructor.
Definition: mathplot.h:1387
#define MP_Y_BORDER_SEPARATION
Default minimum separation in pixels between Y axes and the plot border.
Definition: mathplot.h:195
size_t GetMaxNOfPoints() const
Get maximum number of points to plot.
Definition: mathplot.h:1773
void ShowGrids(bool grids)
Set axis grids.
Definition: mathplot.h:2789
Align the info in margin center-right.
Definition: mathplot.h:663
const wxColour & GetAxesColour() const
Get axes draw colour.
Definition: mathplot.h:4339
const wxBrush & GetBrush() const
Get brush set for this layer.
Definition: mathplot.h:1087
std::deque< mpLayer * > mpLayerList
Define the type for the list of layers inside mpWindow.
Definition: mathplot.h:3215
virtual double GetMaxY()
Returns the actual maximum Y data (loaded in SetData).
Definition: mathplot.h:2307
void SetDrawState(bool drawState)
Set whether the plot has already been drawn on the current printout.
Definition: mathplot.h:4862
mpText(const wxString &name=wxEmptyString)
Default constructor.
Definition: mathplot.h:4737
mpRange< double > lastDesired
Last desired ranged, used for check if desired has changed.
Definition: mathplot.h:3233
double m_const
Const factor.
Definition: mathplot.h:2456
std::unordered_map< int, mpRange< double > > GetAllBoundY()
Returns the bounds for all Y-axes.
Definition: mathplot.h:3619
wxImage m_bitmap
The internal copy of the Bitmap:
Definition: mathplot.h:5204
void SetOnUserMouseAction(const mpOnUserMouseAction &userMouseEventHandler)
On user mouse action event Allows the user to perform certain actions before normal event processing...
Definition: mathplot.h:4376
void UpdateBoundingBoxToInclude(double px, double py, int yAxisID)
Ensure the bounding box includes the given point for the selected Y axis.
Definition: mathplot.h:4022
each visible plot is described on its own line, one above the other
Definition: mathplot.h:711
void SetPosX(const double posX)
Set current view's X position and refresh display.
Definition: mathplot.h:3646
int m_xPos
Leftmost X pixel occupied by this axis (starting point).
Definition: mathplot.h:3186
Align the x-axis towards top plot.
Definition: mathplot.h:677
mpLayerZOrder GetZIndex(void) const
Get the ZIndex of the plot.
Definition: mathplot.h:1184
mpRange< double > bound
Range min and max.
Definition: mathplot.h:3231
Set label for axis in auto mode, automatically switch between decimal and scientific notation...
Definition: mathplot.h:790
int GetPlotHeight() const
Get the height of the plot.
Definition: mathplot.h:4256
bool IsSeriesCoord() const
Return if we show the series coordinates.
Definition: mathplot.h:1443
Align the y-axis towards right border.
Definition: mathplot.h:688
__Info_Type
sub_type values for mpLAYER_INFO
Definition: mathplot.h:732
std::unordered_map< int, mpRange< double > > GetAllDesiredY()
Returns the desired bounds for all Y-axes.
Definition: mathplot.h:3633
size_t m_index
The internal counter for the "GetNextXY" interface.
Definition: mathplot.h:2241
virtual double GetMaxX()
Get inclusive right border of bounding box.
Definition: mathplot.h:5181
Show/Hide info coord.
Definition: mathplot.h:646
Align the x-axis towards top border.
Definition: mathplot.h:678
bool GetShowName() const
Get Name visibility.
Definition: mathplot.h:1101
Mouse action draw a box to zoom inside.
Definition: mathplot.h:782
mpFXGeneric(const wxString &name=wxT("Generic FX function"), int flags=mpALIGN_LEFT, unsigned int yAxisID=0)
Definition: mathplot.h:2370
void SetCovarianceMatrix(double cov_00, double cov_01, double cov_11)
Changes the covariance matrix:
Definition: mathplot.h:5073
__Function_Type
sub_type values for mpLAYER_PLOT and mpLAYER_LINE
Definition: mathplot.h:749
Classic Gaussian distribution f(x) = exp(-(x-μ)²/2σ²)/sqrt(2πσ²)
Definition: mathplot.h:2435
#define WXDLLIMPEXP_MATHPLOT
Definition uses windows dll to export function.
Definition: mathplot.h:77
Printout class used by mpWindow to draw in the objects to be printed.
Definition: mathplot.h:4838
Align the y-axis towards left plot.
Definition: mathplot.h:685
int m_last_ly
Last logical Y origin, used for double buffering.
Definition: mathplot.h:4650
mpMagnet m_magnet
For mouse magnetization.
Definition: mathplot.h:4672
size_t m_maxNOfPoints
Maximum number of points to draw to screen.
Definition: mathplot.h:1787
wxSize GetSize() const
Get the size of the box (in pixels)
Definition: mathplot.h:1317
Chart type layer.
Definition: mathplot.h:838
bool m_grids
Flag to show grids. Default false.
Definition: mathplot.h:2981
Set label for axis in scientific notation.
Definition: mathplot.h:794
enum __mp_Location_Type mpLocation
Location for the Info layer.
void Update(T _min, T _max)
Update range with new min and max values if this expand the range If _min < min then min = _min and i...
Definition: mathplot.h:394
wxRect m_dim
The bounding rectangle of the mpInfoLayer box (may be resized dynamically by the Plot method)...
Definition: mathplot.h:1344
Copy a screen shot to the clipboard.
Definition: mathplot.h:647
Fit view to match bounding box of all layers.
Definition: mathplot.h:640
Create a generic FX function Override the ComputeY() function with your function. ...
Definition: mathplot.h:2363
mpLocation GetLocation() const
Returns the location of the box.
Definition: mathplot.h:4773
bool PointIsInside(double px, double py) const
Is point inside this bounding box?
Definition: mathplot.h:609
Toggle fullscreen only if parent is a frame windows.
Definition: mathplot.h:653
mpRange< double > m_bitmapY
Range of the bitmap on y direction.
Definition: mathplot.h:5214
bool IsShown()
Get shown status.
Definition: mathplot.h:3329
bool m_cacheDirty
Indicate that the cached buffer m_buff_bmp need to be re-created.
Definition: mathplot.h:4653
Center view on click position.
Definition: mathplot.h:643
unsigned int m_step
Step to get point to be draw. Default : 1.
Definition: mathplot.h:1783
mpLegendStyle m_item_mode
Visual style used for each legend entry.
Definition: mathplot.h:1592
virtual ~mpFXYVector()
destrutor
Definition: mathplot.h:2181
bool m_autoFit
Automatically fit plot when hiding / showing axis and series.
Definition: mathplot.h:4665
__XAxis_Align_Type
Alignment for X axis.
Definition: mathplot.h:672
virtual void ErasePlot(wxDC &, mpWindow &)
Just delete the bitmap of the info.
Definition: mathplot.h:1400
sub type for all layers who are function.
Definition: mathplot.h:758
Draw a square.
Definition: mathplot.h:720
mpRange< double > GetBoundX(void) const
Get bounding box for X axis.
Definition: mathplot.h:3586
bool operator==(const mpAxisData &other) const
Compare axis data while ignoring the axis pointer itself.
Definition: mathplot.h:3237
This virtual class represents objects that can be moved to an arbitrary 2D location+rotation.
Definition: mathplot.h:4897
double m_variance
Sigma² is the variance.
Definition: mathplot.h:2491
Align the x-axis center plot.
Definition: mathplot.h:676
__Text_Type
sub_type values for mpLAYER_TEXT
Definition: mathplot.h:741
double m_radius
Radius of the pie chart in pixels.
Definition: mathplot.h:2707
double m_deltaX
Min delta between 2 consecutive coordinate on x direction.
Definition: mathplot.h:2121
__mp_Colour
Enumeration of classic colour.
Definition: mathplot.h:5225
mpRange< double > GetDesiredBoundY(int yAxisID)
Get desired bounding box for Y axis of ID yAxisID.
Definition: mathplot.h:3609
int m_BarWidth
Bar width in pixels when the XY series is drawn in bar mode.
Definition: mathplot.h:2124
Align the plot label towards the northwest.
Definition: mathplot.h:694
double m_total_value
Total of the values vector.
Definition: mathplot.h:2555
mpAxisList m_AxisDataYList
List of axis data for the Y direction.
Definition: mathplot.h:4625
void SetMinScale(double min)
Set the minimum of the scale range when we are in automatic mode.
Definition: mathplot.h:2870
void SetbgColour(const wxColour &colour)
Set the plot background colour.
Definition: mathplot.h:4351
bool GetAutoStep() const
Get if auto stop is enabled.
Definition: mathplot.h:1758
void SetHovering(bool hover)
Set if axis shall be highlighted when a series is dragged over it.
Definition: mathplot.h:2937
virtual int GetSize()
Return the number of points in the series.
Definition: mathplot.h:2069
std::vector< double > m_shape_xs
Shape vertices in object-local X coordinates.
Definition: mathplot.h:4979
virtual bool IsLogAxis()
Get if we are in Logarithmic mode.
Definition: mathplot.h:2945
void SetSymbolSize(int size)
Set symbol size.
Definition: mathplot.h:1697
mpRange< double > desired
Desired range min and max.
Definition: mathplot.h:3232
mpScaleX(const wxString &name=_T("X"), int flags=mpALIGN_CENTERX, bool grids=false, mpLabelType type=mpLabel_AUTO)
Full constructor.
Definition: mathplot.h:3087
Create a wxColour id is the number of the colour : blue, red, green, ...
Definition: mathplot.h:5242
int m_yAxisID
The ID of the Y axis used by the function. Equal 0 if no axis.
Definition: mathplot.h:1784
mpRange(T value1, T value2)
Create range with the 2 values.
Definition: mathplot.h:313
bool IsTopAxis()
Return true when this X axis is aligned at the top edge or top border.
Definition: mathplot.h:3094
bool GetContinuity() const
Gets the 'continuity' property of the layer.
Definition: mathplot.h:1662
int m_extraMargin
Extra margin around the plot. Default 8.
Definition: mathplot.h:4641
No symbol is drawing.
Definition: mathplot.h:718
Layer for bar chart.
Definition: mathplot.h:2573
mpFloatRectSimple GetBoundingBox(bool desired, unsigned int yAxisID=0)
Return a bounding box for an y-axis ID.
Definition: mathplot.h:3942
void SetAutoStep(bool enable)
Enables auto step which is used to plot a maximum nuber of points at a time to the plot no matter zoo...
Definition: mathplot.h:1751
__Chart_Type
sub_type values for mpLAYER_CHART
Definition: mathplot.h:771
wxPen m_pen
Layer's pen. Default Colour = Black, width = 1, style = wxPENSTYLE_SOLID.
Definition: mathplot.h:1195
wxCoord m_scaledBitmap_offset_x
Cached X pixel offset used when drawing the scaled bitmap.
Definition: mathplot.h:5206
virtual double ComputeY(double x)
The main computation of the FX function.
Definition: mathplot.h:2494
double m_variance
Sigma² is the variance.
Definition: mathplot.h:2455
wxString m_content
string holding the coordinates to be drawn.
Definition: mathplot.h:1469
abstract Layer for chart (bar and pie).
Definition: mathplot.h:2514
void SetInitialPosition(wxPoint pos)
Set the position in percent of the upper left corner of the box.
Definition: mathplot.h:1309
Show legend items with symbol used with the referred mpLayer.
Definition: mathplot.h:705
Define a simple rectangular box X refer to X axis Y refer to Y axis.
Definition: mathplot.h:592
sub type for all layers who are chart.
Definition: mathplot.h:776
const wxPen & GetPen() const
Get pen set for this layer.
Definition: mathplot.h:1061
unsigned int mpOptional_uint
Optional unsigned integer fallback type used when std::optional is unavailable.
Definition: mathplot.h:120
Align the info in margin center-left.
Definition: mathplot.h:659
void SetLabelFormat(const wxString &format, bool updateLabelMode=false)
Set axis Label format (used for mpLabel_AUTO draw mode).
Definition: mathplot.h:2805
const wxRect & GetRectangle() const
Get the current rectangle coordinates.
Definition: mathplot.h:1324
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:3954
Set label for axis in decimal notation, with number of decimals automatically calculated based on zoo...
Definition: mathplot.h:792
__Plot_Align_Name_Type
Plot alignment (which corner should plot be placed)
Definition: mathplot.h:692
mpSymbol m_symbol
A symbol for the plot in place of point. Default mpNone.
Definition: mathplot.h:1780
double GetDesiredYmin(int yAxisID)
Return the bottom-border layer coordinate that the user wants the mpWindow to show (it may be not exa...
Definition: mathplot.h:3973
void ToLog(void)
Convert to log range.
Definition: mathplot.h:443
void ShowDraggedSeries(bool active)
Set if dragged series shall be shown or hidden.
Definition: mathplot.h:1545
void SetMarginBottom(int bottom)
Set the bottom margin.
Definition: mathplot.h:4197
mpRange< double > m_rangeY
Range min and max on y axis.
Definition: mathplot.h:2245
bool operator!=(const mpRange &other) const
Compare two ranges for inequality.
Definition: mathplot.h:464
virtual int GetSize()
Return the number of points in the series We assume that size of m_xs equals size of m_ys...
Definition: mathplot.h:2201
bool IsDraggedSeriesShown() const
Get shown status of dragged series.
Definition: mathplot.h:1552
int m_symbolSize2
Size of the symbol div 2.
Definition: mathplot.h:1782
virtual double GetMinY()
Get inclusive bottom border of bounding box.
Definition: mathplot.h:5188
sub type for mpInfoLegend layer
Definition: mathplot.h:737
bool GetAuto() const
Is automatic scaling enabled for this axis?
Definition: mathplot.h:2862
virtual double GetMinX()
Returns the actual minimum X data (loaded in SetData).
Definition: mathplot.h:2270
void SetLogXaxis(bool log)
Enable or disable logarithmic scaling on the X axis.
Definition: mathplot.h:4418
int GetMarginRight(bool minusExtra=false) const
Get the right margin.
Definition: mathplot.h:4182
#define MP_EPSILON
An epsilon for float comparison to 0.
Definition: mathplot.h:205
mpRange< int > m_drawX
Range min and max on x axis.
Definition: mathplot.h:2117
void SetYValue(const double yvalue)
Set y.
Definition: mathplot.h:1860
void SetReserve(int reserve)
Set memory reserved for m_xs and m_ys Note : this does not modify the size of m_xs and m_ys...
Definition: mathplot.h:2221
bool ShouldBeShown(wxPoint mousePos)
Check conditions if magnet shall be shown.
Definition: mathplot.h:3317
int GetReserve() const
Get memory reserved for m_xs and m_ys.
Definition: mathplot.h:2231
double GetDesiredYmax(int yAxisID)
Return the top layer-border coordinate that the user wants the mpWindow to show (it may be not exactl...
Definition: mathplot.h:3984
bool GetLegendIsAlwaysVisible() const
Get the visibility of the legend.
Definition: mathplot.h:1743
Text box type layer.
Definition: mathplot.h:821
mpMouseButtonAction GetMouseLeftDownAction()
Returns the type of action for the left mouse button.
Definition: mathplot.h:4464
double pos
Position.
Definition: mathplot.h:3230
void UpdateMargins()
Update margins if e.g.
Definition: mathplot.h:4151
__YAxis_Align_Type
Alignment for Y axis.
Definition: mathplot.h:682
sub type for mpBarChart
Definition: mathplot.h:774
wxRect m_PlotArea
The full size of the plot with m_extraMargin.
Definition: mathplot.h:4647
Base class to create small rectangular info boxes mpInfoLayer is the base class to create a small rec...
Definition: mathplot.h:1250
Load a file.
Definition: mathplot.h:651
enum __Symbol_Type mpSymbol
Displaying a symbol instead of a point in the plot function.
virtual bool HasBBox()
Check whether this layer has a bounding box.
Definition: mathplot.h:895
void GetOffset(int *offX, int *offY) const
Get the offset.
Definition: mathplot.h:4787
bool m_fullscreen
Boolean value indicating that we are in fullscreen mode (default false)
Definition: mathplot.h:4621
wxCoord m_plotWidth
Width of the plot = m_scrX - (m_margin.left + m_margin.right)
Definition: mathplot.h:4642
virtual bool HasBBox()
mpInfoLayer has not bounding box.
Definition: mathplot.h:1277
mpLayerType GetLayerType() const
Get layer type: a Layer can be of different types: plot, lines, axis, info boxes, etc...
Definition: mathplot.h:903
Line (horizontal or vertical) type layer.
Definition: mathplot.h:836
Implements an overlay box which shows the mouse coordinates in plot units.
Definition: mathplot.h:1371
double m_mu
Mean value.
Definition: mathplot.h:2489
mpRange< double > y
range over y direction
Definition: mathplot.h:595
mpLocation m_location
The location of the text.
Definition: mathplot.h:4796
Delete the object if CanDelete is true and remove it from the layer list.
Definition: mathplot.h:853
bool GetMPScrollbars() const
Get scrollbars status.
Definition: mathplot.h:4052
mpLabelType m_labelType
Label formatting mode used for the X coordinate display.
Definition: mathplot.h:1470
int m_scrY
Current view's Y dimension.
Definition: mathplot.h:4635
sub type for mpTitle layer
Definition: mathplot.h:745
wxCoord x2p(const double x) const
Converts graph (floating point) coordinates into mpWindow (screen) pixel coordinates, using current mpWindow position and scale.
Definition: mathplot.h:3781
void SetStep(unsigned int step)
Set step for plot.
Definition: mathplot.h:1669
mpAxisData m_AxisDataX
Axis data for the X direction.
Definition: mathplot.h:4624
~mpInfoLegend()
Default destructor.
Definition: mathplot.h:1507
double GetMaxScale() const
Get the maximum of the scale range when we are in automatic mode.
Definition: mathplot.h:2894
Align the info in margin center-top.
Definition: mathplot.h:661
Set label for axis in date mode: the value is always represented as yyyy-mm-dd.
Definition: mathplot.h:801
wxColour m_bgColour
Background Colour.
Definition: mathplot.h:4629
bool IsLogXaxis()
Is this an X axis to be displayed with log scale? It is really an axis property but as we need to con...
Definition: mathplot.h:4392
void SetScreen(const int scrX, const int scrY)
Set current view's dimensions in device context units.
Definition: mathplot.h:3708
int GetBarWidth(void) const
Get the width of the bar when we plot in bar mode.
Definition: mathplot.h:2100
void SetOnDeleteLayer(const mpOnDeleteLayer &event)
On delete layer event Allows the user to perform certain actions before deleting the layer...
Definition: mathplot.h:4361
double m_labelAngle
Rotation angle used for bar labels, in degrees.
Definition: mathplot.h:2622
void SetSeriesCoord(bool show)
Set the series coordinates of the mouse position (if tractable set)
Definition: mathplot.h:1436
void SetAxisID(unsigned int yAxisID)
Set an ID to the axis.
Definition: mathplot.h:2768
virtual double GetMaxX()
Returns the actual maximum X data (loaded in SetData).
Definition: mathplot.h:2292
int mpOptional_int
Optional integer fallback type used when std::optional is unavailable.
Definition: mathplot.h:122
void SetMin(T _min)
Set min function, correct max.
Definition: mathplot.h:342
void SetDrawBox(bool drawbox)
Set the draw of the box around the plot.
Definition: mathplot.h:4290
double m_max_value
Max value of the values vector.
Definition: mathplot.h:2554
Plot layer implementing an abstract function plot class.
Definition: mathplot.h:1641
Abstract base class providing plot and labeling functionality for functions F:X->Y.
Definition: mathplot.h:1916
wxPoint GetCenter(void) const
Get the center of the pie chart.
Definition: mathplot.h:2663
mpTitle(const wxString &name)
Definition: mathplot.h:4818
void EnableBufferedPaintDC(const bool enabled)
Enable/disable the auto buffering of PaintDC.
Definition: mathplot.h:3799
Plot layer implementing a simple title.
Definition: mathplot.h:4809
Set no label for axis (useful for bar)
Definition: mathplot.h:807
Plot layer implementing a y-scale ruler.
Definition: mathplot.h:3134
bool m_validImg
True when the source image is valid and ready to draw.
Definition: mathplot.h:5208
enum __mp_Layer_ZOrder mpLayerZOrder
Z order for drawing layer Background is the deeper (bitmap layer) Then draw axis, custom layer...
mpMouseButtonAction
enum for left button mouse action: box zoom or drag
Definition: mathplot.h:780
#define MP_OPTNULL_INT
Null sentinel used for mpOptional_int / mpOptional_uint in the fallback implementation.
Definition: mathplot.h:124
sub type for mpPieChart
Definition: mathplot.h:775
virtual bool HasBBox()
Check whether this layer has a bounding box.
Definition: mathplot.h:4931
bool ViewAsBar(void) const
Get if we are in bar mode.
Definition: mathplot.h:2109
mpLocation m_location
Location of the box in the margin. Default mpMarginNone = use coordinates.
Definition: mathplot.h:1349
mpRange< double > GetBoundY(int yAxisID)
Get bounding box for Y axis of ID yAxisID.
Definition: mathplot.h:3600
virtual void SetVisible(bool show)
Sets layer visibility.
Definition: mathplot.h:1135
mpGaussian(double mu, double sigma)
Classic Gaussian distribution.
Definition: mathplot.h:2443
Align the plot label towards the northeast.
Definition: mathplot.h:695
mpRect GetPlotBoundaries(bool with_margin) const
Get the boundaries of the plot.
Definition: mathplot.h:4265
double GetPosX(void) const
Get current view's X position.
Definition: mathplot.h:3657
only for mpInfoCoords
Definition: mathplot.h:668
int GetAlign() const
Get X/Y alignment.
Definition: mathplot.h:1163
bool m_drawOutsideMargins
Select if the layer should draw only inside margins or over all DC. Default : false.
Definition: mathplot.h:1199
std::vector< double > m_trans_shape_xs
Transformed shape vertices in X coordinates.
Definition: mathplot.h:4983
mpLegendDirection GetItemDirection() const
Get the current legend item layout direction.
Definition: mathplot.h:1532
int GetAxisWidth()
Get the reserved width of the Y axis in pixels.
Definition: mathplot.h:3157
int GetExtraMargin() const
Get the extra margin.
Definition: mathplot.h:4238
void SetAuto(bool automaticScalingIsEnabled)
Enable/Disable automatic scaling for this axis.
Definition: mathplot.h:2854
virtual void Clear()
Clears all the data, leaving the layer empty.
Definition: mathplot.h:2061
virtual double ComputeY(double x)
The main computation of the FX function.
Definition: mathplot.h:2458
sub type for mpFXY function
Definition: mathplot.h:754
wxCoord m_mouseX
Last mouse X position in window pixel coordinates.
Definition: mathplot.h:1472
enum __XAxis_Align_Type mpXAxis_Align
Alignment for X axis.
void UpdateBox(const wxRect &plotArea)
Update the drawable magnet area from a wxRect.
Definition: mathplot.h:3296
bool m_continuous
Specify if the layer will be plotted as a continuous line or a set of points. Default false...
Definition: mathplot.h:1779
void UnSetOnUserMouseAction()
Remove the 'user mouse action event' callback.
Definition: mathplot.h:4382
enum __Chart_Type mpChartType
sub_type values for mpLAYER_CHART
bool IsBottomAxis()
Return true when this X axis is aligned at the bottom edge or bottom border.
Definition: mathplot.h:3100
std::vector< double > m_xs
internal copy of the set of data on x direction
Definition: mathplot.h:2237
void SetScale(mpRange< double > range)
Set the minimum and maximum of the scale range when we are in automatic mode.
Definition: mathplot.h:2921
mpRange< double > GetDesiredBoundX(void) const
Get desired bounding box for X axis.
Definition: mathplot.h:3592
#define m_yID
Alias for the Y-axis identifier when structured binding is unavailable.
Definition: mathplot.h:133
~mpChart()
Destructor.
Definition: mathplot.h:2521
bool GetBoundingBox(mpRange< double > *boundX, mpRange< double > *boundY, int yAxisID)
Return the bounding box coordinates for the Y axis of ID yAxisID.
Definition: mathplot.h:3995
virtual double GetY(double x)
Get function value for argument.
Definition: mathplot.h:2384
Abstract class providing an horizontal line.
Definition: mathplot.h:1846
Zoom into view at clickposition / window center.
Definition: mathplot.h:641
int GetMarginLeft(bool minusExtra=false) const
Get the left margin.
Definition: mathplot.h:4222
wxBitmap m_scaledBitmap
Cached scaled bitmap used for drawing.
Definition: mathplot.h:5205
bool m_lockaspect
Scale aspect is locked or not.
Definition: mathplot.h:4628
int m_segments
The number of line segments that build up the ellipse.
Definition: mathplot.h:5091
int GetSegments() const
Get the number of line segments used to approximate the ellipse. */.
Definition: mathplot.h:5057
bool m_enableScrollBars
Enable scrollbar in plot window (default false)
Definition: mathplot.h:4664
double scale
Scale.
Definition: mathplot.h:3229
Align the info in margin top-left.
Definition: mathplot.h:660
bool IsSet()
Check if this mpRange has been assigned any values.
Definition: mathplot.h:373
Zoom out.
Definition: mathplot.h:642
Plot layer implementing an abstract scale ruler.
Definition: mathplot.h:2736
enum __mp_Layer_Type mpLayerType
Major type of an mpLayer (detail is in subtype)
void SetFont(const wxFont &font)
Set layer font.
Definition: mathplot.h:1021
Class for drawing mouse magnetization Draw an horizontal and a vertical line at the mouse position...
Definition: mathplot.h:3282
static bool m_DefaultCoordIsAlwaysVisible
This value sets the default behaviour when an axis is not visible for the mouse info coordinates disp...
Definition: mathplot.h:4130
void SetBrush(const wxColour &colour, enum wxBrushStyle style=wxBRUSHSTYLE_SOLID)
Set layer brush.
Definition: mathplot.h:1079
static int m_orgy
The y origin coordinate of the X axis We declare it static so we can access to it in mpScaleY...
Definition: mathplot.h:3110
double GetMinScale() const
Get the minimum of the scale range when we are in automatic mode.
Definition: mathplot.h:2878
double m_relX
Box X position relative window, used to rescale the info box position when the window is resized...
Definition: mathplot.h:1347
int m_reserveXY
Memory reserved for m_xs and m_ys. Default 1000.
Definition: mathplot.h:2240
bool PointIsInside(T point) const
Return true if the point is inside the range (min and max included)
Definition: mathplot.h:450
__mp_Direction_Type
Direction for the Legend layer.
Definition: mathplot.h:709
sub type for mpInfoLayer layer
Definition: mathplot.h:735
Align the x-axis towards bottom plot.
Definition: mathplot.h:675
A 2D ellipse, described by a 2x2 covariance matrix.
Definition: mathplot.h:5015
virtual double GetMaxY()
Get max Y of the function.
Definition: mathplot.h:2412
mpLabelType GetLabelMode() const
Get axis label view mode.
Definition: mathplot.h:2814
int GetMarginTop(bool minusExtra=false) const
Get the top margin.
Definition: mathplot.h:4165
mpInfoCoords * m_InfoCoords
Pointer to the optional info coords layer.
Definition: mathplot.h:4667
double GetDesiredXmax() const
Return the right-border layer coordinate that the user wants the mpWindow to show (it may be not exac...
Definition: mathplot.h:3963
bool m_series_coord
True to show the nearest plotted series value instead of raw mouse Y coordinates. ...
Definition: mathplot.h:1474
Set label for axis in hours mode: the value is always represented as hours:minutes:seconds.
Definition: mathplot.h:799
Represents all the informations needed for plotting a layer in one direction (X or Y) This struct hol...
Definition: mathplot.h:3226
__mp_Style_Type
Style for the Legend layer.
Definition: mathplot.h:701
const wxColour & GetbgColour() const
Get the plot background colour.
Definition: mathplot.h:4345
Layer for pie chart.
Definition: mathplot.h:2637
void SetFontColour(const wxColour &colour)
Set layer font foreground colour.
Definition: mathplot.h:1037
Align the y-axis towards right plot.
Definition: mathplot.h:687
void GetScale(double *min, double *max) const
Get the minimum and maximum of the scale range when we are in automatic mode.
Definition: mathplot.h:2912
T Length(void) const
Length of the range.
Definition: mathplot.h:425
sub type for mpScaleX
Definition: mathplot.h:765
bool PointIsInsideBound(double px, double py, int yAxisID)
Is the given point inside the current bounding box for the selected Y axis?
Definition: mathplot.h:4009
sub type for mpInfoCoords layer
Definition: mathplot.h:736
bool m_CoordIsAlwaysVisible
If true, the mouse coordinates is visible in the info coordinates despite the visibility of the axis...
Definition: mathplot.h:2989
struct deprecated("Deprecated! No longer used as X and Y are now separated")]] mpFloatRect
A structure for computation of bounds in real units (not in screen pixel) X refer to X axis Y refer t...
Definition: mathplot.h:476
Set label user defined.
Definition: mathplot.h:805
void SetColumnWidth(const double colWidth)
Set the bar width in plot units.
Definition: mathplot.h:2589
mpCovarianceEllipse(double cov_00=1, double cov_11=1, double cov_01=0, double quantiles=2, int segments=32, const wxString &layerName=_T(""))
Default constructor.
Definition: mathplot.h:5021
const wxFont & GetFont() const
Get font set for this layer.
Definition: mathplot.h:1029
bool m_enableMouseNavigation
For pan/zoom with the mouse.
Definition: mathplot.h:4655
wxColour m_fontcolour
Layer's font foreground colour.
Definition: mathplot.h:1194
void SetPosY(std::unordered_map< int, double > &posYList)
Set current view's Y position and refresh display.
Definition: mathplot.h:3666
Set label for axis in time mode: the value is represented as minutes:seconds.milliseconds if time is ...
Definition: mathplot.h:797
sub type not defined (should be never used)
Definition: mathplot.h:734
Set label for axis in datetime mode: the value is always represented as yyyy-mm-ddThh:mm:ss.
Definition: mathplot.h:803
void GetCovarianceMatrix(double &cov_00, double &cov_01, double &cov_11) const
Returns the elements of the current covariance matrix:
Definition: mathplot.h:5064
void SetMax(T _max)
Set max function, correct min.
Definition: mathplot.h:350
Bitmap type layer.
Definition: mathplot.h:822
HitCode
Return codes for GetLegendHitRegion() if no series was hit.
Definition: mathplot.h:1582
void SetLocation(mpLocation location)
Set the location of the mpInfoLayer box.
Definition: mathplot.h:1331
bool IsVisible() const
Is this layer visible?
Definition: mathplot.h:1128
void ShowTicks(bool ticks)
Set axis ticks.
Definition: mathplot.h:2775
int GetLayerSubType() const
Get layer subtype: each layer type can have several flavors.
Definition: mathplot.h:911
bool IsShown()
Get shown status.
Definition: mathplot.h:1411
virtual void SetTractable(bool track)
Sets layer tractability.
Definition: mathplot.h:1149
int m_last_lx
Last logical X origin, used for double buffering.
Definition: mathplot.h:4649
int GetSymbolSize() const
Get symbol size.
Definition: mathplot.h:1705
unsigned int m_timeConv
Selects if time has to be converted to local time or not.
Definition: mathplot.h:2985
Align the info in margin bottom-left.
Definition: mathplot.h:664
const wxString & GetWildcard(void) const
Get wildcard.
Definition: mathplot.h:4085
mpMovableObject()
Default constructor (sets mpMovableObject location and rotation to (0,0,0))
Definition: mathplot.h:4902
enum __mp_Delete_Action mpDeleteAction
Action to do with the object associated to the layer when we delete it.
sub type for mpFY function
Definition: mathplot.h:753
Info box type layer.
Definition: mathplot.h:820
void SetPos(const double posX, std::unordered_map< int, double > &posYList)
Set current view's X and Y position and refresh display.
Definition: mathplot.h:3753
mpOptional_int m_mouseYAxisID
Indicate which ID of Y-axis the mouse was on during zoom/pan.
Definition: mathplot.h:4663
int GetScreenY(void) const
Get current view's Y dimension in device context units.
Definition: mathplot.h:3743
mpAxisList GetAxisDataYList(void) const
Get the Y-axis data map.
Definition: mathplot.h:3698
wxCoord m_scaledBitmap_offset_y
Cached Y pixel offset used when drawing the scaled bitmap.
Definition: mathplot.h:5207
Align the y-axis center plot.
Definition: mathplot.h:686
virtual bool DoBeforePlot()
This is the only case where we don't need and Y axis So no need to test m_yAxisID.
Definition: mathplot.h:1901
virtual double GetMaxY()
Get inclusive top border of bounding box.
Definition: mathplot.h:954
Plot layer implementing a text string.
Definition: mathplot.h:4732
virtual bool IsLayerType(mpLayerType typeOfInterest, int *subtype)
Set the layer's subtype in caller variable, and return true if the layer is of type "typeOfInterest"...
Definition: mathplot.h:921
wxCoord m_plotHeight
Height of the plot = m_scrY - (m_margin.top + m_margin.bottom)
Definition: mathplot.h:4643
virtual double GetMaxY()
Get inclusive top border of bounding box.
Definition: mathplot.h:4959
wxMemoryDC * GetMemoryDC(void)
Give a direct access to the memory DC to draw in the buffered bitmap You need release the bitmap afte...
Definition: mathplot.h:4530
bool GetDrawBox() const
Get the draw of the box around the plot.
Definition: mathplot.h:4296
bool GetDrawOutsideMargins() const
Get Draw mode: inside or outside margins.
Definition: mathplot.h:1115
wxBrush m_brush
Layer's brush. Default wxTRANSPARENT_BRUSH.
Definition: mathplot.h:1196
double m_sigma
Sigma value.
Definition: mathplot.h:2454
int GetMarginRightOuter() const
Get the right outer margin, exluding Y-axis.
Definition: mathplot.h:4191
virtual double GetMaxX()
Get inclusive right border of bounding box.
Definition: mathplot.h:938
wxPoint m_reference
Holds the reference point for movements.
Definition: mathplot.h:1346
int GetMarginBottom(bool minusExtra=false) const
Get the bottom margin.
Definition: mathplot.h:4205
Shows information about the mouse commands.
Definition: mathplot.h:652
void SetLogYaxis(int yAxisID, bool log)
Set the log property (true or false) for a Y layer (Y axis) given by is ID.
Definition: mathplot.h:4429
void SetMarginTop(int top)
Set the top margin.
Definition: mathplot.h:4157
double GetScaleX(void) const
Get current view's X scale.
Definition: mathplot.h:3549
wxColour m_fgColour
Foreground Colour.
Definition: mathplot.h:4630
mpRange< double > m_bbox_y
Range of bounding box on y direction.
Definition: mathplot.h:4990
wxBitmap * m_Screenshot_bmp
For clipboard, save and print.
Definition: mathplot.h:4674
legend components follow each other horizontally on a single line
Definition: mathplot.h:712
Align the info in margin top-right.
Definition: mathplot.h:662
double m_reference_phi
Current object rotation angle in radians.
Definition: mathplot.h:4970
void InitializeBoundingBox(double px, double py)
Initialize bounding box with an initial point.
Definition: mathplot.h:628
void SetItemDirection(mpLegendDirection mode)
Set item direction (may be vertical or horizontal)
Definition: mathplot.h:1525
enum __Text_Type mpTextType
sub_type values for mpLAYER_TEXT
void SetQuantiles(double q)
Set how many "quantiles" to draw, that is, the confidence interval of the ellipse (see GetQuantiles a...
Definition: mathplot.h:5044
double m_const
Const factor.
Definition: mathplot.h:2492
int GetYAxisID() const
Get the ID of the Y axis used by the function.
Definition: mathplot.h:1718
void SetSegments(int segments)
Set the number of line segments used to approximate the ellipse.
Definition: mathplot.h:5051
sub type for all layers who are scale.
Definition: mathplot.h:767
int m_clickedY
Last mouse click Y position, for centering and zooming the view.
Definition: mathplot.h:4637
Represents a numeric range with minimum and maximum values.
Definition: mathplot.h:300
void Set(T _min, T _max)
Set min, max function.
Definition: mathplot.h:335
Align the info in margin bottom-right.
Definition: mathplot.h:666
bool m_boxZoomActive
Indicate if box zoom is active.
Definition: mathplot.h:4670
double m_reference_x
The coordinates of the object (orientation "phi" is in radians).
Definition: mathplot.h:4968
double GetScaleY(int yAxisID)
Get current view's Y scale.
Definition: mathplot.h:3574
virtual double GetMaxX()
Get inclusive right border of bounding box.
Definition: mathplot.h:2684
unsigned int GetStep() const
Get step for plot.
Definition: mathplot.h:1676
virtual double GetMinX()
Get inclusive left border of bounding box.
Definition: mathplot.h:4938
sub type for mpMovableObject function
Definition: mathplot.h:756
Plot layer, abstract base class.
Definition: mathplot.h:867
std::vector< double > values
Values of the chart.
Definition: mathplot.h:2551
mpRect m_plotBoundaries
The boundaries for plotting curve calculated by mpWindow.
Definition: mathplot.h:1203
void SetNeedUpdate()
Mark the legend bitmap as needing regeneration.
Definition: mathplot.h:1538
bool IsInside(wxCoord xPixel)
Return true if the given X pixel lies within this Y-axis drawing area.
Definition: mathplot.h:3175
mpRange< double > GetScale() const
Get the minimum and maximum of the scale range when we are in automatic mode.
Definition: mathplot.h:2929
std::vector< double > m_shape_ys
Shape vertices in object-local Y coordinates.
Definition: mathplot.h:4980
bool m_autoStep
Calculates m_step automatically based on how many points you want to draw.
Definition: mathplot.h:1786
double GetValue() const
Get the x or y coordinates of the line.
Definition: mathplot.h:1815
enum __Scale_Type mpScaleType
sub_type values for mpLAYER_AXIS
void SetOffset(int offX, int offY)
Set offset.
Definition: mathplot.h:4780
void SetFactor(int factor)
Definition: mathplot.h:4874
sub type for mpFX function
Definition: mathplot.h:752
void SetName(const wxString &name)
Set layer name.
Definition: mathplot.h:1005
mpWindow * m_win
The wxWindow handle.
Definition: mathplot.h:1191
wxString m_labelFormat
Format string used to print labels.
Definition: mathplot.h:2986
int m_scrX
Current view's X dimension in DC units, including all scales, margins.
Definition: mathplot.h:4634
double m_sigma
Sigma value.
Definition: mathplot.h:2490
wxPoint m_mousePos
Current mouse position in window.
Definition: mathplot.h:4658
std::unordered_map< int, double > m_mouseScaleYList
Store current Y-scales, used as reference during drag zooming.
Definition: mathplot.h:4662
void SetShowName(bool show)
Set Name visibility.
Definition: mathplot.h:1094
const wxString & GetName() const
Get layer name.
Definition: mathplot.h:1013
unsigned int m_timeConv
Time conversion mode used when formatting date/time X values.
Definition: mathplot.h:1471
void SetScale(double min, double max)
Set the minimum and maximum of the scale range when we are in automatic mode.
Definition: mathplot.h:2903
virtual bool DoBeforePlot()
If we need to do something before plot like reinitialize some parameters ...
Definition: mathplot.h:1221
double m_cov_00
The elements of the matrix (only 3 since cov(0,1)=cov(1,0) in any positive definite matrix)...
Definition: mathplot.h:5084
void SetMarginLeft(int left)
Set the left margin.
Definition: mathplot.h:4214
#define m_yData
Alias for the Y-axis data when structured binding is unavailable.
Definition: mathplot.h:135
mpLayerList m_layers
List of attached plot layers.
Definition: mathplot.h:4623
std::vector< wxColour > colours
Per-slice colours used when drawing the chart.
Definition: mathplot.h:2709
bool m_ticks
Flag to show ticks. Default true.
Definition: mathplot.h:2980
mpRect m_margin
Margin around the plot including Y-axis.
Definition: mathplot.h:4639
Abstract base class providing plot and labeling functionality for functions F:Y->X.
Definition: mathplot.h:2332
mpLocation GetLocation() const
Return the location of the mpInfoLayer box.
Definition: mathplot.h:1338
void SetWildcard(const wxString &wildcard)
Set wildcard for LoadFile() function when we use wxFileDialog.
Definition: mathplot.h:4077
mpMouseButtonAction m_mouseLeftDownAction
Type of action for left mouse button.
Definition: mathplot.h:4656
mpRect m_plotBoundariesMargin
The size of the plot with the margins. Calculated.
Definition: mathplot.h:4646
bool IsTractable() const
Checks whether the layer is tractable or not.
Definition: mathplot.h:1142
virtual bool HasBBox()
Check whether this layer has a bounding box.
Definition: mathplot.h:2751
virtual double GetMaxX()
Get inclusive right border of bounding box.
Definition: mathplot.h:4945
unsigned int CountAllLayers()
Counts the number of plot layers, whether or not they have a bounding box.
Definition: mathplot.h:3896
void SetMaxScale(double max)
Set the maximum of the scale range when we are in automatic mode.
Definition: mathplot.h:2886
#define DECLARE_DYNAMIC_CLASS_MATHPLOT(mp_class)
Definition for RTTI.
Definition: mathplot.h:220
void SetGridPen(const wxPen &pen)
Set grid pen.
Definition: mathplot.h:2838
sub type for mpScaleY
Definition: mathplot.h:766
void SetSymbol(mpSymbol symbol)
Set symbol.
Definition: mathplot.h:1683
mpBitmapLayer()
Default constructor.
Definition: mathplot.h:5147
void SetScaleY(const double scaleY, int yAxisID)
Set current view's Y scale and refresh display.
Definition: mathplot.h:3558
mpAxisUpdate
Define the axis we want to update.
Definition: mathplot.h:3253
Text box type layer.
Definition: mathplot.h:840
wxMenu * GetPopupMenu()
Get reference to context menu of the plot canvas.
Definition: mathplot.h:3384
void SetAlign(int align)
Set X/Y alignment.
Definition: mathplot.h:1156
Line (horizontal or vertical) type layer.
Definition: mathplot.h:823
virtual double GetMinY()
Returns the actual minimum Y data (loaded in SetData).
Definition: mathplot.h:2285