28#include <wx/toolbar.h>
29#include <wx/statusbr.h>
30#include <wx/textctrl.h>
44 wxMGL(wxWindow* parent, wxWindowID
id = -1,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
bool frameless =
false,
const wxString&
name = wxPanelNameStr);
73 {
SetDraw(draw?mgl_draw_graph:0,(
void*)draw); }
74 inline void ZoomRegion(mreal xx1,mreal xx2,mreal yy1, mreal yy2)
118 return gr->GetNumFrame();
144 void OnPaint(wxPaintEvent& event);
146 void OnSize(wxSizeEvent& event);
154 void OnEnter(wxMouseEvent& event);
155 void OnLeave(wxMouseEvent& event);
159 void OnClose(wxCloseEvent& event);
194 DECLARE_EVENT_TABLE()
Class is Wx widget which display MathGL graphics.
wxString getClickedCoords()
Return the clicked coordinates as a parsable string. This is used by the custom GUI event handler.
wxBitmap pic
Pixmap for drawing (changed by update)
void SetSize(int w, int h)
Set popup menu pointer.
double dPerspective
Value of perspective ( must be in [0,1) )
wxString MousePos
Last mouse position.
double GetRatio()
This member function returns the image aspect ratio.
void PrevSlide()
Show previous slide.
void DrawCurrentObject(int end_x, int end_y)
This member function draws the drawing object selected by the toolbar after the user released the lef...
void OnSize(wxSizeEvent &event)
This member function is the resizing event handler.
void OnNextSlide(wxTimerEvent &evt)
Show next slide.
void OnMouseDown(wxMouseEvent &ev)
This member function is the event handling function applied, when the user presses any of the other m...
int mouse_y1
Temporary variables for mouse.
wxMGL(wxWindow *parent, wxWindowID id=-1, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=0, bool frameless=false, const wxString &name=wxPanelNameStr)
wxMGL constructor.
mreal start_y
start coordinates for drawing
void OnMouseLeftDown(wxMouseEvent &ev)
This member function is the event handling function applied, when the user presses the left mouse but...
void SetGraph(mglGraph *GR)
void SetDraw(int(*draw)(mglGraph *gr))
void Repaint()
Get mouse rotation state.
void SetRotate(bool r)
Switch on/off mouse rotation.
bool AutoResize
Allow auto resizing (default is false)
wxImage ConvertFromGraph()
This member function converts the RGB image created by the mglGraph object into a platform-independen...
bool alpha
Transparency state.
std::vector< wxImage > vAnimationBuffer
bool bRotatingMode
Mouse rotation state.
bool showMessage
Flag for showing messages (enabled by each execute())
int GetTet()
Get Phi-angle value.
void OnLeave(wxMouseEvent &event)
Event handler for leaving the window. Will change the drawing mode to normal and redraw the windows c...
void OnMouseMove(wxMouseEvent &ev)
This member function is the event handling function applied, when the user moves the mouse.
void OnExport()
This member function displays the file dialog during exporting the current image displayed in the win...
void SetZoom(bool z)
Switch on/off mouse zooming.
void OnEraseBackground(wxEraseEvent &event)
This member function handles the background erasing process. It is disabled to avoid flickering (kind...
mglGraph * gr
pointer to grapher
void UpdateTools()
This member function dis- or enables the animation tools depending on whether an animation is availab...
void InitializeToolbar()
This member function initializes the toolbar of the GraphViewer Window.
double dAzimutalViewPoint
Rotation angles.
void OnKeyDown(wxKeyEvent &event)
This member function is the event handling function applied, when the user presses a key.
void OnEnter(wxMouseEvent &event)
This member function is the event handling function applied, when the user moves the mouse in the win...
void SetPhi(int p)
Set Phi-angle value.
wxString appName
Application name for message boxes.
void OnNavigationKey(wxNavigationKeyEvent &event)
This member function is the event handling function applied, when the user presses a navigation key.
bool bZoomingMode
Mouse zoom state.
void Animation(bool st=true)
Start animation.
int(* draw_func)(mglBase *gr, void *par)
Drawing function for window procedure. It should return the number of frames.
void SetDraw(mglDraw *dr)
void SetDraw(int(*func)(mglBase *gr, void *par), void *par=0)
Set drawing functions and its parameter.
void ExportBPS(wxString fname=L"")
export to bitmap EPS file
virtual ~wxMGL()
Destructor: stops the timer, if it is running and deletes the referenced drawing class.
void ExportEPS(wxString fname=L"")
export to vector EPS file
bool GetLight()
Get transparency state.
mreal zoom_y1
Zoom in region.
void ZoomRegion(mreal xx1, mreal xx2, mreal yy1, mreal yy2)
wxTimer * timer
Timer for animation.
void OnMenuEvent(wxCommandEvent &event)
This member function is the event handling function for any events emitted by the toolbar.
bool drawModeActive
Flag, if the current draw mode is active => mouse down.
void ZoomIn(int x, int y)
Zoom in graphics.
void ExportJPG(wxString fname=L"")
export to JPEG file
void OnMouseRightUp(wxMouseEvent &ev)
This member function is the event handling function applied, when the user releases the right mouse b...
wxMenu * popup
Pointer to pop-up menu.
void SetPer(int p)
Set perspective value.
int GetPhi()
Get perspective value.
void Restore()
Restore zoom and rotation to default values.
void OnPaint(wxPaintEvent &event)
This member function is the redrawing and painting event handler. It will display the bitmap currentl...
void ZoomOut(int x, int y)
Zoom out graphics.
void ExportPNG(wxString fname=L"")
export to PNG file
void SetTet(int t)
Set Theta-angle value.
bool GetRotate()
Get mouse zooming state.
void Adjust()
Adjust plot size to fill entire window.
void Update()
Update picture.
void setBitmap()
This function sets the current bitmap either by explicit conversion from the RGB data in the mglGraph...
int drawMode
Stores the current draw mode.
void OnMouseLeftUp(wxMouseEvent &ev)
This member function is the event handling function applied, when the user releases the left mouse bu...
void SetDrawMode(int dm)
This member function selects the current drawing mode by dis- and enabling the tools and the other mo...
void OnClose(wxCloseEvent &event)
This member function is the event handling function applied, when the window is closed.
bool GetAlpha()
Get Theta-angle value.
bool light
Lightning state.
void Copy()
copy graphics to clipboard
void ExportSVG(wxString fname=L"")
export to SVG file
bool GetZoom()
Get lightning state.
void ExportPNGs(wxString fname=L"")
export to PNG file (no transparency)
mreal l_y1
start coordinates for line
void NextSlide()
Show next slide.
Resample_Real(* func)(Resample_Real t)