Go to the documentation of this file.
21 #ifndef _MP_MATHPLOT_H_
22 #define _MP_MATHPLOT_H_
27 #pragma warning(disable:4251)
77 #define WXDLLIMPEXP_MATHPLOT GUI_IMPEXP
80 #if defined(__GNUG__) && !defined(__clang__)
81 #pragma interface "mathplot.h"
89 #include <wx/scrolwin.h>
91 #include <wx/dynarray.h>
93 #include <wx/dcmemory.h>
94 #include <wx/string.h>
105 #define DEBUG_NEW new(_NORMAL_BLOCK ,__FILE__, __LINE__)
107 #define DEBUG_NEW new
112 #define X_BORDER_SEPARATION 40
113 #define Y_BORDER_SEPARATION 60
259 const wxFont&
GetFont()
const {
return m_font; }
264 const wxPen&
GetPen()
const {
return m_pen; }
283 void SetName(wxString name) { m_name = name; }
322 const wxBrush&
GetBrush()
const {
return m_brush; };
359 mpInfoLayer(wxRect rect,
const wxBrush* brush = wxTRANSPARENT_BRUSH);
392 virtual void Move(wxPoint delta);
491 #define mpALIGNMASK 0x03
493 #define mpALIGN_RIGHT 0x00
495 #define mpALIGN_CENTER 0x01
497 #define mpALIGN_LEFT 0x02
499 #define mpALIGN_TOP mpALIGN_RIGHT
501 #define mpALIGN_BOTTOM mpALIGN_LEFT
503 #define mpALIGN_BORDER_BOTTOM 0x04
505 #define mpALIGN_BORDER_TOP 0x05
507 #define mpX_NORMAL 0x00
509 #define mpX_TIME 0x01
511 #define mpX_HOURS 0x02
513 #define mpX_DATE 0x03
515 #define mpX_DATETIME 0x04
517 #define mpALIGN_BORDER_LEFT mpALIGN_BORDER_BOTTOM
519 #define mpALIGN_BORDER_RIGHT mpALIGN_BORDER_TOP
521 #define mpALIGN_NE 0x00
523 #define mpALIGN_NW 0x01
525 #define mpALIGN_SW 0x02
527 #define mpALIGN_SE 0x03
552 virtual double GetY(
double x ) = 0;
563 DECLARE_DYNAMIC_CLASS(
mpFX)
584 virtual double GetX(
double y ) = 0;
595 DECLARE_DYNAMIC_CLASS(
mpFY)
644 DECLARE_DYNAMIC_CLASS(
mpFXY)
666 virtual double GetY(
double x ) = 0;
810 #define mpMOUSEMODE_DRAG 0
812 #define mpMOUSEMODE_ZOOMBOX 1
846 const wxPoint &pos = wxDefaultPosition,
847 const wxSize &
size = wxDefaultSize,
873 bool DelLayer(
mpLayer* layer,
bool alsoDeleteObject =
false,
bool refreshDisplay =
true);
949 void SetScaleY(
double scaleY) {
if (scaleY!=0) m_scaleY=scaleY; UpdateAll(); }
954 void SetPosX(
double posX) { m_posX=posX; UpdateAll(); }
959 void SetPosY(
double posY) { m_posY=posY; UpdateAll(); }
965 void SetPos(
double posX,
double posY) { m_posX=posX; m_posY=posY; UpdateAll(); }
972 void SetScr(
int scrX,
int scrY) { m_scrX=scrX; m_scrY=scrY; }
977 inline double p2x(wxCoord pixelCoordX ) {
return m_posX + pixelCoordX/m_scaleX; }
982 inline double p2y(wxCoord pixelCoordY ) {
return m_posY - pixelCoordY/m_scaleY; }
987 inline wxCoord
x2p(
double x) {
return (wxCoord) ( (x-m_posX) * m_scaleX); }
992 inline wxCoord
y2p(
double y) {
return (wxCoord) ( (m_posY-y) * m_scaleY); }
1028 void Fit(
double xMin,
double xMax,
double yMin,
double yMax,wxCoord *printSizeX=NULL,wxCoord *printSizeY=NULL);
1033 void ZoomIn(
const wxPoint& centerPoint = wxDefaultPosition );
1038 void ZoomOut(
const wxPoint& centerPoint = wxDefaultPosition );
1114 bool SaveScreenshot(
const wxString& filename,
int type = wxBITMAP_TYPE_BMP, wxSize imageSize = wxDefaultSize,
bool fit =
false);
1179 void SetColourTheme(
const wxColour& bgColour,
const wxColour& drawColour,
const wxColour& axesColour);
1263 DECLARE_EVENT_TABLE()
1301 void SetData(
const std::vector<double> &xs,
const std::vector<double> &ys);
1307 void SetData(
const std::vector<float> &xs,
const std::vector<float> &ys);
1391 mpText(wxString name = wxT(
"Title"),
int offsetx = 5,
int offsety = 50);
1404 DECLARE_DYNAMIC_CLASS(
mpText)
1464 phi = m_reference_phi;
1473 m_reference_phi = phi;
1478 virtual bool HasBBox() {
return m_trans_shape_xs.size()!=0; }
1559 double quantiles = 2,
1561 const wxString & layerName = wxT(
"") ) :
1565 m_quantiles(quantiles),
1566 m_segments(segments)
1568 m_continuous =
true;
1637 m_continuous =
true;
1649 const std::vector<double>& points_xs,
1650 const std::vector<double>& points_ys,
1651 bool closedShape=
true );
1659 const std::vector<float>& points_xs,
1660 const std::vector<float>& points_ys,
1661 bool closedShape=
true );
1684 m_min_y = m_max_y = 0;
1702 void SetBitmap(
const wxImage &inBmp,
double x,
double y,
double lx,
double ly );
1753 #if defined(_MSC_VER)
1754 #pragma warning(pop)
1758 #endif // _MP_MATHPLOT_H_
@ mpID_ZOOM_IN
Zoom into view at clickposition / window center.
wxPoint GetPosition()
Returns the position of the upper left corner of the box (in pixels)
void GetCoordinateBase(double &x, double &y, double &phi) const
Get the current coordinate transformation.
mpFY(wxString name=wxEmptyString, int flags=mpALIGN_TOP)
void OnShowPopupMenu(wxMouseEvent &event)
Mouse handler, will show context menu.
void OnScrollThumbTrack(wxScrollWinEvent &event)
Scroll thumb on scroll bar moving.
bool GetNextXY(double &x, double &y)
Get locus value for next N.
void EnableMousePanZoom(bool enabled)
Enable/disable the feature of pan/zoom with the mouse (default=enabled)
mpInfoLayer * IsInsideInfoLayer(wxPoint &point)
Sets whether to show coordinate tooltip when mouse passes over the plot.
double GetDesiredYmin()
Returns the bottom-border layer coordinate that the user wants the mpWindow to show (it may be not ex...
mpFXY(wxString name=wxEmptyString, int flags=mpALIGN_NE)
void OnScrollPageUp(wxScrollWinEvent &event)
Scroll page up.
virtual double GetMinX()
Get inclusive left border of bounding box.
virtual void Plot(wxDC &dc, mpWindow &w)
Layer plot handler.
#define mpALIGN_CENTER
Aligns label to the center.
mpFX(wxString name=wxEmptyString, int flags=mpALIGN_RIGHT)
wxMenu * GetPopupMenu()
Get reference to context menu of the plot canvas.
std::vector< double > m_trans_shape_ys
void TranslatePoint(double x, double y, double &out_x, double &out_y)
A method for 2D translation and rotation, using the current transformation stored in m_reference_x,...
bool IsLayerVisible(const wxString &name)
Check whether a layer with given name is visible.
Base class to create small rectangular info boxes mpInfoLayer is the base class to create a small rec...
int GetScrX(void) const
Get current view's X dimension in device context units.
virtual bool HasBBox()
mpInfoLayer has not bounding box.
std::vector< double > m_ys
double GetDesiredXmin()
Returns the left-border layer coordinate that the user wants the mpWindow to show (it may be not exac...
double GetMinY()
Returns the actual minimum Y data (loaded in SetData).
void Fit()
Set view to fit global bounding box of all plot layers and refresh display.
const wxRect & GetRectangle()
Returns the current rectangle coordinates.
mpPrintout(mpWindow *drawWindow, const wxChar *title=_T("wxMathPlot print output"))
size_t GetDataLength() const
Returns the number of data points currently hold in X & Y.
void DelAllLayers(bool alsoDeleteObject, bool refreshDisplay=true)
Remove all layers from the plot.
void SetPosY(double posY)
Set current view's Y position and refresh display.
int m_flags
Holds label alignment.
void SetLabelFormat(const wxString &format)
Set X axis Label format (used for mpX_NORMAL draw mode).
wxBitmap * m_buff_bmp
For double buffering.
virtual bool Inside(wxPoint &point)
Checks whether a point is inside the info box rectangle.
mpInfoLayer()
Default constructor.
virtual void Plot(wxDC &dc, mpWindow &w)
Layer plot handler.
#define mpALIGN_TOP
Aligns label to the top.
const wxFont & GetFont() const
Get font set for this layer.
Plot layer, abstract base class.
void ZoomOut(const wxPoint ¢erPoint=wxDefaultPosition)
Zoom out current view and refresh display.
void OnScrollBottom(wxScrollWinEvent &event)
Scroll to bottom.
double GetMaxX()
Returns the actual maximum X data (loaded in SetData).
int m_scrY
Current view's Y dimension.
virtual void UpdateInfo(mpWindow &w, wxEvent &event)
Updates the content of the info box.
bool GetDrawOutsideMargins()
Get Draw mode: inside or outside margins.
Printout class used by mpWindow to draw in the objects to be printed.
void OnMouseRightDown(wxMouseEvent &event)
Mouse handler, for detecting when the user drags with the right button or just "clicks" for the menu.
virtual bool HasBBox()
Check whether this layer has a bounding box.
Abstract base class providing plot and labeling functionality for functions F:X->Y.
double GetXpos() const
Get current view's X position.
void SetMarginLeft(int left)
Set the left margin.
void SetLayerVisible(const wxString &name, bool viewable)
Sets the visibility of a layer by its name.
void GetCovarianceMatrix(double &cov_00, double &cov_01, double &cov_11) const
Returns the elements of the current covariance matrix:
void SetMarginBottom(int bottom)
Set the bottom margin.
virtual void Plot(wxDC &dc, mpWindow &w)
Plot method.
wxCoord y2p(double y)
Converts graph (floating point) coordinates into mpWindow (screen) pixel coordinates,...
void ZoomIn(const wxPoint ¢erPoint=wxDefaultPosition)
Zoom into current view and refresh display.
void ShapeUpdated()
Must be called by the descendent class after updating the shape (m_shape_xs/ys), or when the transfor...
void OnLockAspect(wxCommandEvent &event)
Context menu handler.
int m_flags
Holds label alignment.
mpInfoCoords()
Default constructor.
void OnZoomOut(wxCommandEvent &event)
Context menu handler.
mpText(wxString name=wxT("Title"), int offsetx=5, int offsety=50)
double m_posX
Current view's X position.
const wxString & SetLabelFormat()
Get X axis Label format (used for mpX_NORMAL draw mode).
void OnScrollLineUp(wxScrollWinEvent &event)
Scroll line up.
virtual bool IsInfo()
Specifies that this is an Info box layer.
void OnMouseMove(wxMouseEvent &event)
Mouse handler for mouse motion (for pan)
unsigned int GetLabelMode()
Get X axis label view mode.
virtual void Plot(wxDC &dc, mpWindow &w)=0
Plot given view of layer to the given device context.
void OnCenter(wxCommandEvent &event)
Context menu handler.
size_t size(const MATRIXLIKE &m, int dim)
double GetYscl() const
Get current view's Y scale.
double m_maxY
Global layer bounding box, top border incl.
unsigned int CountLayers()
Counts the number of plot layers, excluding axes or text: this is to count only the layers which have...
void LockAspect(bool enable=TRUE)
Enable or disable X/Y scale aspect locking for the view.
double m_scaleY
Current view's Y scale.
const wxColour & GetAxesColour()
Get axes draw colour.
double GetXscl()
Get current view's X scale.
mpScaleY(wxString name=wxT("Y"), int flags=mpALIGN_CENTER, bool ticks=true)
bool GetContinuity() const
Gets the 'continuity' property of the layer.
wxString m_labelFormat
Format string used to print labels.
void SetAlign(int align)
Set label axis alignment.
double p2y(wxCoord pixelCoordY)
Converts mpWindow (screen) pixel coordinates into graph (floating point) coordinates,...
void SetPen(wxPen pen)
Set layer pen.
virtual ~mpMovableObject()
double GetQuantiles() const
virtual bool UpdateBBox()
Recalculate global layer bounding box, and save it in m_minX,...
wxColour m_axColour
Axes Colour.
void DoZoomOutYCalc(const int staticYpixel)
int GetYScreen(void) const
const wxPen & GetPen() const
Get pen set for this layer.
wxString m_content
string holding the coordinates to be drawn.
virtual void Plot(wxDC &dc, mpWindow &w)
Plot given view of layer to the given device context.
void OnMouseLeftDown(wxMouseEvent &event)
Mouse left click (for rect zoom)
void SetColourTheme(const wxColour &bgColour, const wxColour &drawColour, const wxColour &axesColour)
Set Color theme.
void ShowPrintDialog()
Draws the mpWindow on a page for printing.
wxLayerList m_layers
List of attached plot layers.
long m_mouseRClick_Y
For the right button "drag" feature.
#define mpX_NORMAL
Set label for X axis in normal mode.
wxString GetName() const
Get layer name.
void SetLabelMode(unsigned int mode)
Set X axis label view mode.
#define mpALIGN_NE
Aligns label to north-east.
@ mpID_HELP_MOUSE
Shows information about the mouse commands.
wxImage m_bitmap
The internal copy of the Bitmap:
void SetLabelFormat(const wxString &format)
Set Y axis Label format.
@ mpID_LOCKASPECT
Lock x/y scaling aspect.
void SetAlign(int align)
Set label axis alignment.
void OnFit(wxCommandEvent &event)
Context menu handler.
Plot layer implementing a x-scale ruler.
~mpInfoLegend()
Default destructor.
size_t CountAllLayers()
Counts the number of plot layers, whether or not they have a bounding box.
bool IsLayerVisible(const unsigned int position)
Check whether the layer at given position is visible.
void SetData(const std::vector< double > &xs, const std::vector< double > &ys)
Changes the internal data: the set of points to draw.
double GetMaxY()
Returns the actual maximum Y data (loaded in SetData).
bool m_ticks
Flag to toggle between ticks or grid.
bool AddLayer(mpLayer *layer, bool refreshDisplay=true)
Add a plot layer to the canvas.
void SetDrawState(bool drawState)
wxColour m_fgColour
Foreground Colour.
mpLayerType m_type
Define layer type, which is assigned by constructor.
void EnableDoubleBuffer(bool enabled)
Enable/disable the double-buffering of the window, eliminating the flicker (default=disabled).
int m_offsety
Holds offset for Y in percentage.
void SetContinuity(bool continuity)
Set the 'continuity' property of the layer (true:draws a continuous line, false:draws separate points...
int m_winY
Holds the mpWindow size. Used to rescale position when window is resized.
virtual double GetMinY()
Get inclusive bottom border of bounding box.
bool GetTicks()
Get X axis ticks or grid.
bool m_enableDoubleBuffer
For double buffering.
virtual bool HasBBox()
Check whether this layer has a bounding box.
mpLayer * GetLayerByName(const wxString &name)
virtual bool HasBBox()
mpText should not be used for scaling decisions.
int m_flags
Holds label alignment.
const wxBrush & GetBrush() const
Get brush set for this layer.
void RecalculateShape()
Called to update the m_shape_xs, m_shape_ys vectors, whenever a parameter changes.
virtual double GetY(double x)=0
Get function value for argument.
double GetPosY(void) const
wxRect m_dim
The bounding rectangle of the box. It may be resized dynamically by the Plot method.
void SetSegments(int segments)
Implements the legend to be added to the plot This layer allows you to add a legend to describe the p...
virtual double GetMaxY()
Get inclusive top border of bounding box.
enum __mp_Layer_Type mpLayerType
double GetMinX()
Returns the actual minimum X data (loaded in SetData).
@ mpLAYER_AXIS
Axis type layer.
wxSize GetSize()
Returns the size of the box (in pixels)
void SetPos(double posX, double posY)
Set current view's X and Y position and refresh display.
void OnZoomIn(wxCommandEvent &event)
Context menu handler.
int m_flags
Holds label alignment.
bool m_visible
Toggles layer visibility.
void SetMargins(int top, int right, int bottom, int left)
Set window margins, creating a blank area where some kinds of layers cannot draw.
bool DelLayer(mpLayer *layer, bool alsoDeleteObject=false, bool refreshDisplay=true)
Remove a plot layer from the canvas.
void AppendDataPoint(float x, float y)
Append a new data point (x,y)
int GetMarginLeft()
Get the left margin.
double GetScaleY(void) const
wxBrush m_brush
Layer's brush.
virtual void Plot(wxDC &dc, mpWindow &w)
Layer plot handler.
void SetTicks(bool ticks)
Set Y axis ticks or grid.
#define mpALIGN_RIGHT
Aligns label to the right.
Implements an overlay box which shows the mouse coordinates in plot units.
virtual bool GetNextXY(double &x, double &y)=0
Get locus value for next N.
@ mpLAYER_INFO
Info box type layer.
virtual void Plot(wxDC &dc, mpWindow &w)
Text Layer plot handler.
void UpdateViewBoundary(wxCoord xnew, wxCoord ynew)
Update label positioning data.
void SetCoordinateBase(double x, double y, double phi=0)
Set the coordinate transformation (phi in radians, 0 means no rotation).
mpScaleX(wxString name=wxT("X"), int flags=mpALIGN_CENTER, bool ticks=true, unsigned int type=mpX_NORMAL)
Full constructor.
void Clear()
Clears all the data, leaving the layer empty.
double GetDesiredXmax()
Returns the right-border layer coordinate that the user wants the mpWindow to show (it may be not exa...
bool m_showName
States whether the name of the layer must be shown (default is true).
int m_flags
Flag for axis alignment.
bool IsVisible()
Checks whether the layer is visible or not.
void GetBitmapCopy(wxImage &outBmp) const
Returns a copy of the current bitmap assigned to the layer.
int GetMarginTop()
Get the top margin.
bool m_drawOutsideMargins
select if the layer should draw only inside margins or over all DC
@ mpID_FIT
Fit view to match bounding box of all layers.
double GetDesiredYmax()
Returns the top layer-border coordinate that the user wants the mpWindow to show (it may be not exact...
int m_offsetx
Holds offset for X in percentage.
double GetScaleX(void) const
void Rewind()
Rewind value enumeration with mpFXY::GetNextXY.
virtual double GetMaxY()
Get inclusive top border of bounding box.
mpInfoLayer * m_movingInfoLayer
For moving info layers over the window area.
void SetBrush(wxBrush brush)
Set layer brush.
@ mpLAYER_PLOT
Plot type layer.
mpInfoLayer(wxRect rect, const wxBrush *brush=wxTRANSPARENT_BRUSH)
Complete constructor.
void OnScrollTop(wxScrollWinEvent &event)
Scroll to top.
void DoZoomOutXCalc(const int staticXpixel)
virtual double GetY(double x)=0
Get function value for argument.
void SetAlign(int align)
Set Y axis alignment.
A 2D ellipse, described by a 2x2 covariance matrix.
void OnSize(wxSizeEvent &event)
Size handler, will update scroll bar sizes.
bool GetMPScrollbars()
Get scrollbars status.
double m_scaleX
Current view's X scale.
void SetMPScrollbars(bool status)
Enable/disable scrollbars.
void UpdateAll()
Refresh display.
mpWindow(wxWindow *parent, wxWindowID id, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long flags=0)
void OnMouseHelp(wxCommandEvent &event)
Context menu handler.
virtual ~mpInfoLayer()
Destructor.
mpInfoLegend(wxRect rect, const wxBrush *brush=wxTRANSPARENT_BRUSH)
Complete constructor, setting initial rectangle and background brush.
wxColour m_bgColour
Background Colour.
mpMovableObject()
Default constructor (sets location and rotation to (0,0,0))
mpLayerType GetLayerType()
Get layer type: a Layer can be of different types: plot lines, axis, info boxes, etc,...
virtual double GetMinY()
Get inclusive bottom border of bounding box.
mpCovarianceEllipse(double cov_00=1, double cov_11=1, double cov_01=0, double quantiles=2, int segments=32, const wxString &layerName=wxT(""))
Default constructor.
virtual void UpdateInfo(mpWindow &w, wxEvent &event)
Updates the content of the info box.
virtual double GetMinY()
Get inclusive bottom border of bounding box.
A class providing graphs functionality for a 2D plot (either continuous or a set of points),...
virtual double GetMaxY()
Get inclusive top border of bounding box.
double p2x(wxCoord pixelCoordX)
Converts mpWindow (screen) pixel coordinates into graph (floating point) coordinates,...
void SetDrawOutsideMargins(bool drawModeOutside)
Set Draw mode: inside or outside margins.
void OnPrintMenu(wxCommandEvent &event)
Context menu handler.
void SetTicks(bool ticks)
Set X axis ticks or grid.
wxMenu m_popmenu
Canvas' context menu.
virtual void Plot(wxDC &dc, mpWindow &w)
Plot method.
mpFXYVector(wxString name=wxEmptyString, int flags=mpALIGN_NE)
double GetYpos() const
Get current view's Y position.
mpInfoLegend()
Default constructor.
void OnMouseWheel(wxMouseEvent &event)
Mouse handler for the wheel.
@ mpLAYER_UNDEF
Layer type undefined.
void SetName(wxString name)
Set layer name.
double GetPosX(void) const
int GetMarginBottom()
Get the bottom margin.
int m_clickedY
Last mouse click Y position, for centering and zooming the view.
bool m_continuous
Specify if the layer will be plotted as a continuous line or a set of points.
Plot layer implementing a text string.
mpBitmapLayer()
Default constructor.
Abstract base class providing plot and labeling functionality for a locus plot F:N->X,...
bool m_ticks
Flag to toggle between ticks or grid.
void OnMouseLeftRelease(wxMouseEvent &event)
Mouse left click (for rect zoom)
void SetCovarianceMatrix(double cov_00, double cov_01, double cov_11)
Changes the covariance matrix:
void OnScrollLineDown(wxScrollWinEvent &event)
Scroll line down.
Plot layer implementing a y-scale ruler.
virtual ~mpCovarianceEllipse()
int m_mouseLClick_Y
Starting coords for rectangular zoom selection.
bool m_lockaspect
Scale aspect is locked or not.
bool OnPrintPage(int page)
void SetBitmap(const wxImage &inBmp, double x, double y, double lx, double ly)
Change the bitmap associated with the layer (to update the screen, refresh the mpWindow).
void DoZoomInXCalc(const int staticXpixel)
void ShowName(bool show)
Shows or hides the text label with the name of the layer (default is visible).
std::vector< double > m_shape_ys
virtual void Plot(wxDC &dc, mpWindow &w)
Plot given view of layer to the given device context.
static double zoomIncrementalFactor
This value sets the zoom steps whenever the user clicks "Zoom in/out" or performs zoom with the mouse...
virtual void Plot(wxDC &dc, mpWindow &w)
Plot method.
bool m_enableMouseNavigation
For pan/zoom with the mouse.
void SetPosX(double posX)
Set current view's X position and refresh display.
std::deque< mpLayer * > wxLayerList
Define the type for the list of layers inside mpWindow.
virtual bool HasBBox()
Check whether this layer has a bounding box.
wxBrush m_brush
The brush to be used for the background.
@ mpID_CENTER
Center view on click position.
virtual bool HasBBox()
Check whether this layer has a bounding box.
Abstract base class providing plot and labeling functionality for functions F:Y->X.
virtual void UpdateInfo(mpWindow &w, wxEvent &event)
Updates the content of the info box.
void ZoomOutX()
Zoom out current view along X and refresh display.
void GetBoundingBox(double *bbox)
Returns the bounding box coordinates.
void SetQuantiles(double q)
Set how many "quantiles" to draw, that is, the confidence interval of the ellipse (see above).
An arbitrary polygon, descendant of mpMovableObject.
mpPolygon(const wxString &layerName=wxT(""))
Default constructor.
void OnScrollPageDown(wxScrollWinEvent &event)
Scroll page down.
void SetFont(wxFont &font)
Set layer font.
void DoZoomInYCalc(const int staticYpixel)
void SetScaleY(double scaleY)
Set current view's Y scale and refresh display.
int GetScrY(void) const
Get current view's Y dimension in device context units.
wxCoord x2p(double x)
Converts graph (floating point) coordinates into mpWindow (screen) pixel coordinates,...
bool m_mouseMovedAfterRightClick
mpInfoCoords(wxRect rect, const wxBrush *brush=wxTRANSPARENT_BRUSH)
Complete constructor, setting initial rectangle and background brush.
int m_last_ly
For double buffering.
virtual void Plot(wxDC &dc, mpWindow &w)
Layer plot handler.
~mpInfoCoords()
Default destructor.
int GetXScreen(void) const
double m_minY
Global layer bounding box, bottom border incl.
wxFont m_font
Layer's font.
wxMemoryDC m_buff_dc
For double buffering.
This virtual class represents objects that can be moved to an arbitrary 2D location+rotation.
int m_flags
Holds label alignment.
void SetMarginTop(int top)
Set the top margin.
@ mpLAYER_BITMAP
Bitmap type layer.
Canvas for plotting mpLayer implementations.
This virtual class represents objects that can be moved to an arbitrary 2D location+rotation.
const wxString & SetLabelFormat()
Get Y axis Label format.
virtual double GetMinX()
Get inclusive left border of bounding box.
virtual void Rewind()=0
Rewind value enumeration with mpFXY::GetNextXY.
size_t m_index
The internal counter for the "GetNextXY" interface.
double m_minX
Global layer bounding box, left border incl.
int m_flags
Flag for axis alignment.
void setPoints(const std::vector< double > &points_xs, const std::vector< double > &points_ys, bool closedShape=true)
Set the points in the polygon.
bool SaveScreenshot(const wxString &filename, int type=wxBITMAP_TYPE_BMP, wxSize imageSize=wxDefaultSize, bool fit=false)
Draw the window on a wxBitmap, then save it to a file.
void DoScrollCalc(const int position, const int orientation)
void SetMarginRight(int right)
Set the right margin.
void ZoomRect(wxPoint p0, wxPoint p1)
Zoom view fitting given coordinates to the window (p0 and p1 do not need to be in any specific order)
virtual void Plot(wxDC &dc, mpWindow &w)
Layer plot handler.
int m_clickedX
Last mouse click X position, for centering and zooming the view.
void SetAlign(int align)
Set X axis alignment.
virtual bool HasBBox()
Check whether this layer has a bounding box.
void OnPaint(wxPaintEvent &event)
Paint handler, will plot all attached layers.
#define WXDLLIMPEXP_MATHPLOT
virtual double GetMinX()
Get inclusive left border of bounding box.
@ mpID_PRINT
JL: Prints the graph.
void SetLayerVisible(const unsigned int position, bool viewable)
Sets the visibility of a layer by its position in layer list.
bool IsAspectLocked()
Checks whether the X/Y scale aspect is locked.
std::string BASE_IMPEXP format(const char *fmt,...) MRPT_printf_format_check(1
A std::string version of C sprintf.
virtual double GetMaxX()
Get inclusive right border of bounding box.
virtual void UpdateReference()
Updates the rectangle reference point.
virtual double GetMaxX()
Get inclusive right border of bounding box.
void ZoomOutY()
Zoom out current view along Y and refresh display.
int m_flags
Holds label alignment.
int m_scrX
Current view's X dimension.
virtual bool IsInfo()
Check whether the layer is an info box.
int m_flags
Holds label alignment.
virtual void Plot(wxDC &dc, mpWindow &w)
Layer plot handler.
void SetData(const std::vector< float > &xs, const std::vector< float > &ys)
Changes the internal data: the set of points to draw.
wxPoint m_reference
Holds the reference point for movements.
mpProfile(wxString name=wxEmptyString, int flags=mpALIGN_TOP)
unsigned int m_labelType
Select labels mode: mpX_NORMAL for normal labels, mpX_TIME for time axis in hours,...
Abstract base class providing plot and labeling functionality for functions F:Y->X.
virtual double GetMaxX()
Get inclusive right border of bounding box.
void SetScr(int scrX, int scrY)
Set current view's dimensions in device context units.
double m_posY
Current view's Y position.
wxCoord m_scaledBitmap_offset_y
wxBitmap GetColourSquare(int side=16)
Get a small square bitmap filled with the colour of the pen used in the layer.
bool GetTicks()
Get Y axis ticks or grid.
virtual double GetX(double y)=0
Get function value for argument.
void setPoints(const std::vector< float > &points_xs, const std::vector< float > &points_ys, bool closedShape=true)
Set the points in the polygon.
int GetMarginRight()
Get the right margin.
void SetVisible(bool show)
Sets layer visibility.
mpLayer * GetLayer(int position)
int m_segments
The number of line segments that build up the ellipse.
wxString m_labelFormat
Format string used to print labels.
double m_maxX
Global layer bounding box, right border incl.
void ZoomInY()
Zoom in current view along Y and refresh display.
void Fit(double xMin, double xMax, double yMin, double yMax, wxCoord *printSizeX=NULL, wxCoord *printSizeY=NULL)
Set view to fit a given bounding box and refresh display.
virtual void Move(wxPoint delta)
Moves the layer rectangle of given pixel deltas.
wxString m_name
Layer's name.
void ZoomInX()
Zoom in current view along X and refresh display.
void SetScaleX(double scaleX)
Set current view's X scale and refresh display.
Page generated by Doxygen 1.8.20 for MRPT 1.4.0 SVN: at Thu Aug 27 02:40:23 UTC 2020 | | |