19 #ifndef _WX_WXMULTIGRAPH_H_
20 #define _WX_WXMULTIGRAPH_H_
22 #ifdef _MSC_VER // MS VC++ predefined macros....
30 #include "wx/wxprec.h"
37 #include "ObjCryst/wxCryst/wxCryst.h"
58 void OnPaint(wxPaintEvent &event);
59 void OnMouse(wxMouseEvent &event);
60 void OnMouseWheel(wxMouseEvent &event);
61 void OnKeyDown(wxKeyEvent &event);
65 unsigned long AddGraph(
const std::string &name);
70 void SetGraphData(
const unsigned long id,
const std::valarray<float> &vx,
71 const std::valarray<float> &vy);
80 void AutoScale(
const long id=-1,
const bool xmin=
true,
const bool xmax=
true,
81 const bool ymin=
true,
const bool ymax=
true);
82 void OnUpdateUI(wxUpdateUIEvent &event);
83 void OnSize(wxSizeEvent &event);
84 void SetXLabel(
const wxString &xlabel);
85 void SetYLabel(
const wxString &ylabel);
86 virtual void UpdateDisplay();
95 std::valarray<float> vx;
96 std::valarray<float> vy;
97 float xmin,xmax,ymin,ymax;
99 std::map<unsigned long, GraphData> mvData;
118 DECLARE_EVENT_TABLE()
virtual void DeleteGraph(const unsigned long id)
Remove graph.
void SetGraphData(const unsigned long id, const std::valarray< float > &vx, const std::valarray< float > &vy)
Set data for a given graph.
float mDragX0
dragging origin (in reduced coordinates)
long mLeft
The margins in pixels around the graph.
void Screen2Data(float &x, float &y)
Convert screen (pixel) to data coordinates.
bool mIsDragging
Are we within a dragging event ?
float mMinX
The current min & max values along x and y.
CrystMutex mMutexData
Mutex for the data.
void Data2Screen(float &x, float &y)
Convert data to screen (pixel) coordinates.
wxFrame * mpParentFrame
parent frame
wxMenu * mpPopUpMenu
Pop-up menu.
The namespace which includes all objects (crystallographic and algorithmic) in ObjCryst++.
unsigned long AddGraph(const std::string &name)
Add a graph.
void AutoScale(const long id=-1, const bool xmin=true, const bool xmax=true, const bool ymin=true, const bool ymax=true)
Auto-scale graph, i.e.