NumeRe v1.1.4
NumeRe: Framework für Numerische Rechnungen
wxMGL Class Reference

Class is Wx widget which display MathGL graphics. More...

#include <wx.h>

Inheritance diagram for wxMGL:
Collaboration diagram for wxMGL:

Public Types

enum  CurrentDrawMode {
  DM_NONE = 0 , DM_LINE = 1 , DM_RECT , DM_CIRCLE ,
  DM_TEXT
}
 

Public Member Functions

 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. More...
 
virtual ~wxMGL ()
 Destructor: stops the timer, if it is running and deletes the referenced drawing class. More...
 
double GetRatio ()
 This member function returns the image aspect ratio. More...
 
void SetPopup (wxMenu *p)
 
void SetSize (int w, int h)
 Set popup menu pointer. More...
 
void SetGraph (mglGraph *GR)
 
HMGL GetGraph ()
 
void SetDraw (int(*func)(mglBase *gr, void *par), void *par=0)
 Set drawing functions and its parameter. More...
 
void SetDraw (mglDraw *dr)
 
void SetDraw (int(*draw)(mglGraph *gr))
 
void ZoomRegion (mreal xx1, mreal xx2, mreal yy1, mreal yy2)
 
int GetPer ()
 
int GetPhi ()
 Get perspective value. More...
 
int GetTet ()
 Get Phi-angle value. More...
 
bool GetAlpha ()
 Get Theta-angle value. More...
 
bool GetLight ()
 Get transparency state. More...
 
bool GetZoom ()
 Get lightning state. More...
 
bool GetRotate ()
 Get mouse zooming state. More...
 
void Repaint ()
 Get mouse rotation state. More...
 
void Update ()
 Update picture. More...
 
void Copy ()
 copy graphics to clipboard More...
 
void Print ()
 Print plot. More...
 
void SetPer (int p)
 Set perspective value. More...
 
void SetPhi (int p)
 Set Phi-angle value. More...
 
void SetTet (int t)
 Set Theta-angle value. More...
 
void SetZoom (bool z)
 Switch on/off mouse zooming. More...
 
void SetRotate (bool r)
 Switch on/off mouse rotation. More...
 
void SetDrawMode (int dm)
 This member function selects the current drawing mode by dis- and enabling the tools and the other modification modes. More...
 
void ZoomIn (int x, int y)
 Zoom in graphics. More...
 
void ZoomOut (int x, int y)
 Zoom out graphics. More...
 
void Restore ()
 Restore zoom and rotation to default values. More...
 
void DrawCurrentObject (int end_x, int end_y)
 This member function draws the drawing object selected by the toolbar after the user released the left mouse button. More...
 
void ExportPNG (wxString fname=L"")
 export to PNG file More...
 
void ExportPNGs (wxString fname=L"")
 export to PNG file (no transparency) More...
 
void ExportJPG (wxString fname=L"")
 export to JPEG file More...
 
void ExportBPS (wxString fname=L"")
 export to bitmap EPS file More...
 
void ExportEPS (wxString fname=L"")
 export to vector EPS file More...
 
void ExportSVG (wxString fname=L"")
 export to SVG file More...
 
void Adjust ()
 Adjust plot size to fill entire window. More...
 
int getNumFrames ()
 
void NextSlide ()
 Show next slide. More...
 
void PrevSlide ()
 Show previous slide. More...
 
void Animation (bool st=true)
 Start animation. More...
 
void AnimateAsynch ()
 
wxString getClickedCoords ()
 Return the clicked coordinates as a parsable string. This is used by the custom GUI event handler. More...
 

Public Attributes

wxString appName
 Application name for message boxes. More...
 
bool AutoResize
 Allow auto resizing (default is false) More...
 

Protected Member Functions

void InitializeToolbar ()
 This member function initializes the toolbar of the GraphViewer Window. More...
 
void OnExport ()
 This member function displays the file dialog during exporting the current image displayed in the window. More...
 
void OnPaint (wxPaintEvent &event)
 This member function is the redrawing and painting event handler. It will display the bitmap currently selected by the wxMGL::Repaint() function. More...
 
void OnEraseBackground (wxEraseEvent &event)
 This member function handles the background erasing process. It is disabled to avoid flickering (kind of a hack). More...
 
void OnSize (wxSizeEvent &event)
 This member function is the resizing event handler. More...
 
void OnNextSlide (wxTimerEvent &evt)
 Show next slide. More...
 
void OnMouseLeftDown (wxMouseEvent &ev)
 This member function is the event handling function applied, when the user presses the left mouse button. More...
 
void OnMouseDown (wxMouseEvent &ev)
 This member function is the event handling function applied, when the user presses any of the other mouse buttons. More...
 
void OnMouseLeftUp (wxMouseEvent &ev)
 This member function is the event handling function applied, when the user releases the left mouse button. More...
 
void OnMouseRightUp (wxMouseEvent &ev)
 This member function is the event handling function applied, when the user releases the right mouse button. More...
 
void OnMouseMove (wxMouseEvent &ev)
 This member function is the event handling function applied, when the user moves the mouse. More...
 
void OnEnter (wxMouseEvent &event)
 This member function is the event handling function applied, when the user moves the mouse in the window. More...
 
void OnLeave (wxMouseEvent &event)
 Event handler for leaving the window. Will change the drawing mode to normal and redraw the windows contents. More...
 
void OnKeyDown (wxKeyEvent &event)
 This member function is the event handling function applied, when the user presses a key. More...
 
void OnNavigationKey (wxNavigationKeyEvent &event)
 This member function is the event handling function applied, when the user presses a navigation key. More...
 
void OnMenuEvent (wxCommandEvent &event)
 This member function is the event handling function for any events emitted by the toolbar. More...
 
void OnClose (wxCloseEvent &event)
 This member function is the event handling function applied, when the window is closed. More...
 
void setBitmap ()
 This function sets the current bitmap either by explicit conversion from the RGB data in the mglGraph object or by selecting an image from the buffer. More...
 
wxImage ConvertFromGraph ()
 This member function converts the RGB image created by the mglGraph object into a platform-independent wxImage object, which can be used to create a bitmap from. More...
 

Protected Attributes

mglGraph * gr
 pointer to grapher More...
 
void * draw_par
 
int(* draw_func )(mglBase *gr, void *par)
 Drawing function for window procedure. It should return the number of frames. More...
 
mglDraw * draw_cl
 
wxString MousePos
 Last mouse position. More...
 
wxBitmap pic
 Pixmap for drawing (changed by update) More...
 
double dPolarViewPoint
 
double dAzimutalViewPoint
 Rotation angles. More...
 
double dPerspective
 Value of perspective ( must be in [0,1) ) More...
 
bool alpha
 Transparency state. More...
 
bool light
 Lightning state. More...
 
bool bZoomingMode
 Mouse zoom state. More...
 
bool bRotatingMode
 Mouse rotation state. More...
 
bool zoomactive
 
bool animation
 
int skiprotate
 
int nFramesToSkip
 
int drawMode
 Stores the current draw mode. More...
 
bool drawModeActive
 Flag, if the current draw mode is active => mouse down. More...
 
mreal l_x1
 
mreal l_y1
 start coordinates for line More...
 
mreal start_x
 
mreal start_y
 start coordinates for drawing More...
 
mreal zoom_x0
 
mreal zoom_x1
 
mreal zoom_y0
 
mreal zoom_y1
 Zoom in region. More...
 
bool showMessage
 Flag for showing messages (enabled by each execute()) More...
 
wxMenu * popup
 Pointer to pop-up menu. More...
 
wxTimer * timer
 Timer for animation. More...
 
int nFrameCounter
 
std::vector< wxImage > vAnimationBuffer
 

Private Member Functions

void UpdateTools ()
 This member function dis- or enables the animation tools depending on whether an animation is available. More...
 

Private Attributes

int mouse_x0
 
int mouse_y0
 
int mouse_x1
 
int mouse_y1
 Temporary variables for mouse. More...
 
wxFrame * m_parentFrame
 
wxToolBar * toptoolbar
 
wxStatusBar * statusbar
 
wxTextCtrl * styling
 

Detailed Description

Class is Wx widget which display MathGL graphics.

Definition at line 38 of file wx.h.

Member Enumeration Documentation

◆ CurrentDrawMode

Enumerator
DM_NONE 
DM_LINE 
DM_RECT 
DM_CIRCLE 
DM_TEXT 

Definition at line 130 of file wx.h.

Constructor & Destructor Documentation

◆ wxMGL()

wxMGL::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.

Parameters
parentwxWindow*
idwxWindowID
posconst wxPoint&
sizeconst wxSize&
stylelong
framelessbool
nameconst wxString&

Definition at line 139 of file wx.cpp.

References alpha, animation, AutoResize, bRotatingMode, bZoomingMode, dAzimutalViewPoint, DM_NONE, dPerspective, dPolarViewPoint, draw_cl, draw_func, draw_par, drawMode, drawModeActive, gr, ID_GRAPH_COPY, ID_GRAPH_DRAW_FIRST, ID_GRAPH_DRAW_LAST, ID_GRAPH_EXPORT, ID_GRAPH_NEXT, ID_GRAPH_PREVIOUS, ID_GRAPH_RESET, ID_GRAPH_ROTATE, ID_GRAPH_RUN, ID_GRAPH_STOP, ID_GRAPH_ZOOM, InitializeToolbar(), l_x1, l_y1, light, m_parentFrame, nFrameCounter, nFramesToSkip, OnMenuEvent(), popup, skiprotate, start_x, start_y, statusbar, timer, TIMER_ID, zoom_x0, zoom_x1, zoom_y0, zoom_y1, and zoomactive.

Here is the call graph for this function:

◆ ~wxMGL()

wxMGL::~wxMGL ( )
virtual

Destructor: stops the timer, if it is running and deletes the referenced drawing class.

Definition at line 196 of file wx.cpp.

References draw_cl, and timer.

Member Function Documentation

◆ Adjust()

void wxMGL::Adjust ( )

Adjust plot size to fill entire window.

Definition at line 1431 of file wx.cpp.

References gr, and Repaint().

Here is the call graph for this function:

◆ AnimateAsynch()

void wxMGL::AnimateAsynch ( )
inline

Definition at line 125 of file wx.h.

References Animation().

Referenced by CustomWindow::setItemGraph().

Here is the call graph for this function:

◆ Animation()

void wxMGL::Animation ( bool  st = true)

Start animation.

This member function starts or stops the animation. It will also dis- or enable the corresponding tools from the toolbar.

Parameters
stbool
Returns
void

Definition at line 1517 of file wx.cpp.

References animation, bRotatingMode, bZoomingMode, DM_NONE, gr, ID_GRAPH_COPY, ID_GRAPH_DRAW_FIRST, ID_GRAPH_DRAW_LAST, ID_GRAPH_EXPORT, ID_GRAPH_NEXT, ID_GRAPH_PREVIOUS, ID_GRAPH_RESET, ID_GRAPH_ROTATE, ID_GRAPH_RUN, ID_GRAPH_STOP, ID_GRAPH_ZOOM, m_parentFrame, nFrameCounter, SetDrawMode(), skiprotate, statusbar, timer, toptoolbar, vAnimationBuffer, and zoomactive.

Referenced by AnimateAsynch(), OnClose(), OnKeyDown(), OnMenuEvent(), and CustomWindow::setItemGraph().

Here is the call graph for this function:

◆ ConvertFromGraph()

wxImage wxMGL::ConvertFromGraph ( )
protected

This member function converts the RGB image created by the mglGraph object into a platform-independent wxImage object, which can be used to create a bitmap from.

Returns
wxImage

Definition at line 799 of file wx.cpp.

References gr.

Referenced by setBitmap().

◆ Copy()

void wxMGL::Copy ( )

copy graphics to clipboard

Definition at line 1415 of file wx.cpp.

References pic.

Referenced by OnMenuEvent().

◆ DrawCurrentObject()

void wxMGL::DrawCurrentObject ( int  end_x,
int  end_y 
)

This member function draws the drawing object selected by the toolbar after the user released the left mouse button.

Parameters
end_xint
end_yint
Returns
void

Definition at line 636 of file wx.cpp.

References _guilang, DM_CIRCLE, DM_LINE, DM_RECT, DM_TEXT, drawMode, Language::get(), gr, start_x, start_y, styling, and Update().

Referenced by OnMouseLeftUp().

Here is the call graph for this function:

◆ ExportBPS()

void wxMGL::ExportBPS ( wxString  fname = L"")

export to bitmap EPS file

Definition at line 1373 of file wx.cpp.

References appName, gr, mglSetExtension(), mglw_str(), and ScriptName().

Here is the call graph for this function:

◆ ExportEPS()

void wxMGL::ExportEPS ( wxString  fname = L"")

export to vector EPS file

Definition at line 1385 of file wx.cpp.

References appName, gr, mglSetExtension(), mglw_str(), and ScriptName().

Referenced by OnExport().

Here is the call graph for this function:

◆ ExportJPG()

void wxMGL::ExportJPG ( wxString  fname = L"")

export to JPEG file

Definition at line 1362 of file wx.cpp.

References appName, gr, mglSetExtension(), mglw_str(), and ScriptName().

Referenced by OnExport().

Here is the call graph for this function:

◆ ExportPNG()

void wxMGL::ExportPNG ( wxString  fname = L"")

export to PNG file

Definition at line 1341 of file wx.cpp.

References appName, gr, mglSetExtension(), mglw_str(), and ScriptName().

Referenced by OnExport().

Here is the call graph for this function:

◆ ExportPNGs()

void wxMGL::ExportPNGs ( wxString  fname = L"")

export to PNG file (no transparency)

Definition at line 1351 of file wx.cpp.

References appName, gr, mglSetExtension(), mglw_str(), and ScriptName().

Here is the call graph for this function:

◆ ExportSVG()

void wxMGL::ExportSVG ( wxString  fname = L"")

export to SVG file

Definition at line 1400 of file wx.cpp.

References appName, gr, mglSetExtension(), mglw_str(), and ScriptName().

Referenced by OnExport().

Here is the call graph for this function:

◆ GetAlpha()

bool wxMGL::GetAlpha ( )
inline

Get Theta-angle value.

Definition at line 80 of file wx.h.

References alpha.

◆ getClickedCoords()

wxString wxMGL::getClickedCoords ( )

Return the clicked coordinates as a parsable string. This is used by the custom GUI event handler.

Returns
wxString

Definition at line 1591 of file wx.cpp.

References gr, mouse_x0, and mouse_y0.

Referenced by CustomWindow::getItemParameters().

◆ GetGraph()

HMGL wxMGL::GetGraph ( )
inline

Definition at line 57 of file wx.h.

References gr.

◆ GetLight()

bool wxMGL::GetLight ( )
inline

Get transparency state.

Definition at line 81 of file wx.h.

References light.

◆ getNumFrames()

int wxMGL::getNumFrames ( )
inline

Definition at line 115 of file wx.h.

References gr.

Referenced by CustomWindow::setItemGraph().

◆ GetPer()

int wxMGL::GetPer ( )
inline

Definition at line 77 of file wx.h.

References dPerspective.

◆ GetPhi()

int wxMGL::GetPhi ( )
inline

Get perspective value.

Definition at line 78 of file wx.h.

References dAzimutalViewPoint.

◆ GetRatio()

double wxMGL::GetRatio ( )

This member function returns the image aspect ratio.

Returns
double

Definition at line 244 of file wx.cpp.

References gr.

◆ GetRotate()

bool wxMGL::GetRotate ( )
inline

Get mouse zooming state.

Definition at line 83 of file wx.h.

References bRotatingMode.

◆ GetTet()

int wxMGL::GetTet ( )
inline

Get Phi-angle value.

Definition at line 79 of file wx.h.

References dPolarViewPoint.

◆ GetZoom()

bool wxMGL::GetZoom ( )
inline

Get lightning state.

Definition at line 82 of file wx.h.

References bZoomingMode.

◆ InitializeToolbar()

void wxMGL::InitializeToolbar ( )
protected

This member function initializes the toolbar of the GraphViewer Window.

Returns
void

Definition at line 257 of file wx.cpp.

References _guilang, Language::get(), ID_GRAPH_CIRCLE, ID_GRAPH_COPY, ID_GRAPH_EXPORT, ID_GRAPH_LINE, ID_GRAPH_NEXT, ID_GRAPH_PREVIOUS, ID_GRAPH_RECT, ID_GRAPH_RESET, ID_GRAPH_ROTATE, ID_GRAPH_RUN, ID_GRAPH_STOP, ID_GRAPH_TEXT, ID_GRAPH_ZOOM, m_parentFrame, styling, and toptoolbar.

Referenced by wxMGL().

Here is the call graph for this function:

◆ NextSlide()

void wxMGL::NextSlide ( )

Show next slide.

This member function displays the next slide.

Returns
void

Definition at line 1446 of file wx.cpp.

References _guilang, animation, Language::get(), gr, m_parentFrame, nFrameCounter, statusbar, Update(), and vAnimationBuffer.

Referenced by OnKeyDown(), OnMenuEvent(), OnNavigationKey(), and OnNextSlide().

Here is the call graph for this function:

◆ OnClose()

void wxMGL::OnClose ( wxCloseEvent &  event)
protected

This member function is the event handling function applied, when the window is closed.

Parameters
eventwxCloseEvent&
Returns
void

Definition at line 1287 of file wx.cpp.

References Animation().

Here is the call graph for this function:

◆ OnEnter()

void wxMGL::OnEnter ( wxMouseEvent &  event)
protected

This member function is the event handling function applied, when the user moves the mouse in the window.

Parameters
eventwxMouseEvent&
Returns
void

Definition at line 1120 of file wx.cpp.

References m_parentFrame.

◆ OnEraseBackground()

void wxMGL::OnEraseBackground ( wxEraseEvent &  event)
protected

This member function handles the background erasing process. It is disabled to avoid flickering (kind of a hack).

Parameters
eventwxEraseEvent&
Returns
void

Definition at line 402 of file wx.cpp.

◆ OnExport()

void wxMGL::OnExport ( )
protected

This member function displays the file dialog during exporting the current image displayed in the window.

Returns
void

Definition at line 307 of file wx.cpp.

References _guilang, ExportEPS(), ExportJPG(), ExportPNG(), ExportSVG(), Language::get(), m_parentFrame, and PLOTPATH.

Referenced by OnMenuEvent().

Here is the call graph for this function:

◆ OnKeyDown()

void wxMGL::OnKeyDown ( wxKeyEvent &  event)
protected

This member function is the event handling function applied, when the user presses a key.

Parameters
eventwxKeyEvent&
Returns
void

Definition at line 1158 of file wx.cpp.

References Animation(), m_parentFrame, NextSlide(), PrevSlide(), and timer.

Here is the call graph for this function:

◆ OnLeave()

void wxMGL::OnLeave ( wxMouseEvent &  event)
protected

Event handler for leaving the window. Will change the drawing mode to normal and redraw the windows contents.

Parameters
eventwxMouseEvent&
Returns
void

Definition at line 1138 of file wx.cpp.

References bRotatingMode, gr, skiprotate, and Update().

Here is the call graph for this function:

◆ OnMenuEvent()

void wxMGL::OnMenuEvent ( wxCommandEvent &  event)
protected

This member function is the event handling function for any events emitted by the toolbar.

Parameters
eventwxCommandEvent&
Returns
void

Definition at line 1222 of file wx.cpp.

References Animation(), bRotatingMode, bZoomingMode, Copy(), dAzimutalViewPoint, DM_CIRCLE, DM_LINE, DM_RECT, DM_TEXT, dPerspective, dPolarViewPoint, ID_GRAPH_ALPHA, ID_GRAPH_CIRCLE, ID_GRAPH_COPY, ID_GRAPH_EXPORT, ID_GRAPH_LIGHT, ID_GRAPH_LINE, ID_GRAPH_NEXT, ID_GRAPH_PREVIOUS, ID_GRAPH_RECT, ID_GRAPH_RESET, ID_GRAPH_ROTATE, ID_GRAPH_RUN, ID_GRAPH_STOP, ID_GRAPH_TEXT, ID_GRAPH_ZOOM, NextSlide(), OnExport(), PrevSlide(), SetDrawMode(), SetRotate(), SetZoom(), Update(), zoom_x0, zoom_x1, zoom_y0, and zoom_y1.

Referenced by wxMGL().

Here is the call graph for this function:

◆ OnMouseDown()

void wxMGL::OnMouseDown ( wxMouseEvent &  ev)
protected

This member function is the event handling function applied, when the user presses any of the other mouse buttons.

Parameters
evwxMouseEvent&
Returns
void

Definition at line 900 of file wx.cpp.

References mouse_x0, mouse_x1, mouse_y0, and mouse_y1.

◆ OnMouseLeftDown()

void wxMGL::OnMouseLeftDown ( wxMouseEvent &  ev)
protected

This member function is the event handling function applied, when the user presses the left mouse button.

Parameters
evwxMouseEvent&
Returns
void

Definition at line 859 of file wx.cpp.

References bRotatingMode, bZoomingMode, DM_NONE, drawMode, drawModeActive, m_parentFrame, mouse_x0, mouse_x1, mouse_y0, mouse_y1, start_x, start_y, and zoomactive.

◆ OnMouseLeftUp()

void wxMGL::OnMouseLeftUp ( wxMouseEvent &  ev)
protected

This member function is the event handling function applied, when the user releases the left mouse button.

Parameters
evwxMouseEvent&
Returns
void

Definition at line 917 of file wx.cpp.

References bRotatingMode, bZoomingMode, DM_NONE, DrawCurrentObject(), drawMode, drawModeActive, gr, mouse_x0, mouse_x1, mouse_y0, mouse_y1, skiprotate, Update(), zoom_x0, zoom_x1, zoom_y0, zoom_y1, zoomactive, and ZoomIn().

Here is the call graph for this function:

◆ OnMouseMove()

void wxMGL::OnMouseMove ( wxMouseEvent &  ev)
protected

This member function is the event handling function applied, when the user moves the mouse.

Parameters
evwxMouseEvent&
Returns
void

Definition at line 1020 of file wx.cpp.

References bRotatingMode, bZoomingMode, dAzimutalViewPoint, DM_NONE, DM_TEXT, dPerspective, dPolarViewPoint, drawMode, drawModeActive, gr, m_parentFrame, mouse_x0, mouse_x1, mouse_y0, mouse_y1, MousePos, skiprotate, start_x, start_y, statusbar, Update(), zoom_x0, zoom_x1, zoom_y0, zoom_y1, and zoomactive.

Here is the call graph for this function:

◆ OnMouseRightUp()

void wxMGL::OnMouseRightUp ( wxMouseEvent &  ev)
protected

This member function is the event handling function applied, when the user releases the right mouse button.

Parameters
evwxMouseEvent&
Returns
void

Definition at line 990 of file wx.cpp.

References bRotatingMode, bZoomingMode, gr, mouse_x0, mouse_x1, mouse_y0, mouse_y1, popup, skiprotate, Update(), zoomactive, and ZoomOut().

Here is the call graph for this function:

◆ OnNavigationKey()

void wxMGL::OnNavigationKey ( wxNavigationKeyEvent &  event)
protected

This member function is the event handling function applied, when the user presses a navigation key.

Parameters
eventwxNavigationKeyEvent&
Returns
void

Definition at line 1197 of file wx.cpp.

References m_parentFrame, NextSlide(), and PrevSlide().

Here is the call graph for this function:

◆ OnNextSlide()

void wxMGL::OnNextSlide ( wxTimerEvent &  evt)
protected

Show next slide.

This member function is the timer event handling function needed for the animation.

Parameters
wxTimerEvent&
Returns
void

Definition at line 452 of file wx.cpp.

References NextSlide().

Here is the call graph for this function:

◆ OnPaint()

void wxMGL::OnPaint ( wxPaintEvent &  event)
protected

This member function is the redrawing and painting event handler. It will display the bitmap currently selected by the wxMGL::Repaint() function.

Parameters
eventwxPaintEvent&
Returns
void

Definition at line 347 of file wx.cpp.

References DM_CIRCLE, DM_LINE, DM_RECT, draw_cl, drawMode, drawModeActive, gr, mouse_x0, mouse_x1, mouse_y0, mouse_y1, pic, start_x, start_y, Update(), and zoomactive.

Here is the call graph for this function:

◆ OnSize()

void wxMGL::OnSize ( wxSizeEvent &  event)
protected

This member function is the resizing event handler.

Parameters
eventwxSizeEvent&
Returns
void

Definition at line 416 of file wx.cpp.

References AutoResize, gr, SetSize(), and Update().

Here is the call graph for this function:

◆ PrevSlide()

void wxMGL::PrevSlide ( )

Show previous slide.

This member function displays the previous slide.

Returns
void

Definition at line 1485 of file wx.cpp.

References gr, m_parentFrame, nFrameCounter, statusbar, and Update().

Referenced by OnKeyDown(), OnMenuEvent(), and OnNavigationKey().

Here is the call graph for this function:

◆ Print()

void wxMGL::Print ( )

Print plot.

◆ Repaint()

void wxMGL::Repaint ( )

Get mouse rotation state.

This member function sets the current drawing as new bitmap and applies the view modifications in advance.

Returns
void

Definition at line 818 of file wx.cpp.

References bRotatingMode, bZoomingMode, dAzimutalViewPoint, dPerspective, dPolarViewPoint, draw_cl, gr, nFramesToSkip, pic, setBitmap(), SetSize(), skiprotate, zoom_x0, zoom_x1, zoom_y0, and zoom_y1.

Referenced by Adjust(), Restore(), SetPer(), SetPhi(), SetTet(), Update(), ZoomIn(), and ZoomOut().

Here is the call graph for this function:

◆ Restore()

void wxMGL::Restore ( )

Restore zoom and rotation to default values.

This member function can be used to reset the view modifications completely.

Returns
void

Definition at line 683 of file wx.cpp.

References bRotatingMode, bZoomingMode, Repaint(), SetPer(), SetPhi(), SetTet(), zoom_x0, zoom_x1, zoom_y0, and zoom_y1.

Here is the call graph for this function:

◆ setBitmap()

void wxMGL::setBitmap ( )
protected

This function sets the current bitmap either by explicit conversion from the RGB data in the mglGraph object or by selecting an image from the buffer.

Returns
void

Definition at line 1303 of file wx.cpp.

References animation, ConvertFromGraph(), gr, nFrameCounter, pic, and vAnimationBuffer.

Referenced by Repaint().

Here is the call graph for this function:

◆ SetDraw() [1/3]

void wxMGL::SetDraw ( int(*)(mglGraph *gr draw)
inline

Definition at line 72 of file wx.h.

References SetDraw().

Here is the call graph for this function:

◆ SetDraw() [2/3]

void wxMGL::SetDraw ( int(*)(mglBase *gr, void *par)  func,
void *  par = 0 
)
inline

Set drawing functions and its parameter.

Definition at line 60 of file wx.h.

References draw_func, draw_par, and func.

Referenced by SetDraw(), and CustomWindow::setItemGraph().

◆ SetDraw() [3/3]

void wxMGL::SetDraw ( mglDraw *  dr)
inline

Definition at line 62 of file wx.h.

References draw_cl, and gr.

◆ SetDrawMode()

void wxMGL::SetDrawMode ( int  dm)

This member function selects the current drawing mode by dis- and enabling the tools and the other modification modes.

Parameters
dmint
Returns
void

Definition at line 575 of file wx.cpp.

References _guilang, bRotatingMode, bZoomingMode, DM_CIRCLE, DM_LINE, DM_NONE, DM_RECT, DM_TEXT, drawMode, Language::get(), ID_GRAPH_CIRCLE, ID_GRAPH_DRAW_FIRST, ID_GRAPH_DRAW_LAST, ID_GRAPH_LINE, ID_GRAPH_RECT, ID_GRAPH_ROTATE, ID_GRAPH_TEXT, ID_GRAPH_ZOOM, statusbar, toptoolbar, and Update().

Referenced by Animation(), OnMenuEvent(), SetRotate(), and SetZoom().

Here is the call graph for this function:

◆ SetGraph()

void wxMGL::SetGraph ( mglGraph *  GR)
inline

Definition at line 49 of file wx.h.

References gr, and UpdateTools().

Referenced by CustomWindow::setItemGraph().

Here is the call graph for this function:

◆ SetPer()

void wxMGL::SetPer ( int  p)

Set perspective value.

This member function can be used to set the perspective effect applied to the drawing.

Parameters
pint
Returns
void

Definition at line 467 of file wx.cpp.

References dPerspective, and Repaint().

Referenced by Restore().

Here is the call graph for this function:

◆ SetPhi()

void wxMGL::SetPhi ( int  p)

Set Phi-angle value.

This member function can be used to set the azimutal viewpoint of the drawing.

Parameters
pint
Returns
void

Definition at line 486 of file wx.cpp.

References dAzimutalViewPoint, and Repaint().

Referenced by Restore().

Here is the call graph for this function:

◆ SetPopup()

void wxMGL::SetPopup ( wxMenu *  p)
inline

Definition at line 47 of file wx.h.

References popup.

◆ SetRotate()

void wxMGL::SetRotate ( bool  r)

Switch on/off mouse rotation.

This member function can be used to (de-)activate the rotating mode.

Parameters
rbool
Returns
void

Definition at line 548 of file wx.cpp.

References _guilang, bRotatingMode, bZoomingMode, DM_NONE, Language::get(), ID_GRAPH_ROTATE, SetDrawMode(), statusbar, toptoolbar, and Update().

Referenced by OnMenuEvent().

Here is the call graph for this function:

◆ SetSize()

void wxMGL::SetSize ( int  w,
int  h 
)

Set popup menu pointer.

Set window/picture sizes

Definition at line 1424 of file wx.cpp.

References gr, and Update().

Referenced by OnSize(), Repaint(), and CustomWindow::setItemGraph().

Here is the call graph for this function:

◆ SetTet()

void wxMGL::SetTet ( int  t)

Set Theta-angle value.

This member function can be used to set the polar viewpoint of the drawing.

Parameters
tint
Returns
void

Definition at line 504 of file wx.cpp.

References dPolarViewPoint, and Repaint().

Referenced by Restore().

Here is the call graph for this function:

◆ SetZoom()

void wxMGL::SetZoom ( bool  z)

Switch on/off mouse zooming.

This member function can be used to (de-)activate the zooming mode.

Parameters
zbool
Returns
void

Definition at line 522 of file wx.cpp.

References _guilang, bRotatingMode, bZoomingMode, DM_NONE, Language::get(), ID_GRAPH_ZOOM, SetDrawMode(), statusbar, toptoolbar, and Update().

Referenced by OnMenuEvent().

Here is the call graph for this function:

◆ Update()

void wxMGL::Update ( )

Update picture.

This member function tells the internal mglGraph object to draw its contents.

Returns
void

Definition at line 750 of file wx.cpp.

References alpha, appName, bRotatingMode, draw_cl, draw_func, draw_par, gr, light, MousePos, Repaint(), and vAnimationBuffer.

Referenced by DrawCurrentObject(), NextSlide(), OnLeave(), OnMenuEvent(), OnMouseLeftUp(), OnMouseMove(), OnMouseRightUp(), OnPaint(), OnSize(), PrevSlide(), SetDrawMode(), SetRotate(), SetSize(), and SetZoom().

Here is the call graph for this function:

◆ UpdateTools()

void wxMGL::UpdateTools ( )
private

This member function dis- or enables the animation tools depending on whether an animation is available.

Returns
void

Definition at line 215 of file wx.cpp.

References gr, ID_GRAPH_NEXT, ID_GRAPH_PREVIOUS, ID_GRAPH_RUN, ID_GRAPH_STOP, m_parentFrame, nFrameCounter, statusbar, and toptoolbar.

Referenced by SetGraph().

◆ ZoomIn()

void wxMGL::ZoomIn ( int  x,
int  y 
)

Zoom in graphics.

Applies a zoom with the factor of two around the selected position (passed as pixel coordinates).

Parameters
xint
yint
Returns
void

Definition at line 705 of file wx.cpp.

References Repaint(), zoom_x0, zoom_x1, zoom_y0, and zoom_y1.

Referenced by OnMouseLeftUp().

Here is the call graph for this function:

◆ ZoomOut()

void wxMGL::ZoomOut ( int  x,
int  y 
)

Zoom out graphics.

Applies a zoom with the factor of one half around the selected position (passed as pixel coordinates).

Parameters
xint
yint
Returns
void

Definition at line 729 of file wx.cpp.

References Repaint(), zoom_x0, zoom_x1, zoom_y0, and zoom_y1.

Referenced by OnMouseRightUp().

Here is the call graph for this function:

◆ ZoomRegion()

void wxMGL::ZoomRegion ( mreal  xx1,
mreal  xx2,
mreal  yy1,
mreal  yy2 
)
inline

Definition at line 74 of file wx.h.

References zoom_x0, zoom_x1, zoom_y0, and zoom_y1.

Member Data Documentation

◆ alpha

bool wxMGL::alpha
protected

Transparency state.

Definition at line 175 of file wx.h.

Referenced by GetAlpha(), Update(), and wxMGL().

◆ animation

bool wxMGL::animation
protected

Definition at line 180 of file wx.h.

Referenced by Animation(), NextSlide(), setBitmap(), and wxMGL().

◆ appName

wxString wxMGL::appName

Application name for message boxes.

Definition at line 41 of file wx.h.

Referenced by ExportBPS(), ExportEPS(), ExportJPG(), ExportPNG(), ExportPNGs(), ExportSVG(), and Update().

◆ AutoResize

bool wxMGL::AutoResize

Allow auto resizing (default is false)

Definition at line 42 of file wx.h.

Referenced by OnSize(), and wxMGL().

◆ bRotatingMode

bool wxMGL::bRotatingMode
protected

◆ bZoomingMode

bool wxMGL::bZoomingMode
protected

◆ dAzimutalViewPoint

double wxMGL::dAzimutalViewPoint
protected

Rotation angles.

Definition at line 173 of file wx.h.

Referenced by GetPhi(), OnMenuEvent(), OnMouseMove(), Repaint(), SetPhi(), and wxMGL().

◆ dPerspective

double wxMGL::dPerspective
protected

Value of perspective ( must be in [0,1) )

Definition at line 174 of file wx.h.

Referenced by GetPer(), OnMenuEvent(), OnMouseMove(), Repaint(), SetPer(), and wxMGL().

◆ dPolarViewPoint

double wxMGL::dPolarViewPoint
protected

Definition at line 173 of file wx.h.

Referenced by GetTet(), OnMenuEvent(), OnMouseMove(), Repaint(), SetTet(), and wxMGL().

◆ draw_cl

mglDraw* wxMGL::draw_cl
protected

Definition at line 169 of file wx.h.

Referenced by OnPaint(), Repaint(), SetDraw(), Update(), wxMGL(), and ~wxMGL().

◆ draw_func

int(* wxMGL::draw_func) (mglBase *gr, void *par)
protected

Drawing function for window procedure. It should return the number of frames.

Definition at line 168 of file wx.h.

Referenced by SetDraw(), Update(), and wxMGL().

◆ draw_par

void* wxMGL::draw_par
protected

Parameters for drawing function mglCanvasWnd::DrawFunc.

Definition at line 166 of file wx.h.

Referenced by SetDraw(), Update(), and wxMGL().

◆ drawMode

int wxMGL::drawMode
protected

Stores the current draw mode.

Definition at line 183 of file wx.h.

Referenced by DrawCurrentObject(), OnMouseLeftDown(), OnMouseLeftUp(), OnMouseMove(), OnPaint(), SetDrawMode(), and wxMGL().

◆ drawModeActive

bool wxMGL::drawModeActive
protected

Flag, if the current draw mode is active => mouse down.

Definition at line 184 of file wx.h.

Referenced by OnMouseLeftDown(), OnMouseLeftUp(), OnMouseMove(), OnPaint(), and wxMGL().

◆ gr

◆ l_x1

mreal wxMGL::l_x1
protected

Definition at line 185 of file wx.h.

Referenced by wxMGL().

◆ l_y1

mreal wxMGL::l_y1
protected

start coordinates for line

Definition at line 185 of file wx.h.

Referenced by wxMGL().

◆ light

bool wxMGL::light
protected

Lightning state.

Definition at line 176 of file wx.h.

Referenced by GetLight(), Update(), and wxMGL().

◆ m_parentFrame

wxFrame* wxMGL::m_parentFrame
private

◆ mouse_x0

int wxMGL::mouse_x0
private

◆ mouse_x1

int wxMGL::mouse_x1
private

Definition at line 199 of file wx.h.

Referenced by OnMouseDown(), OnMouseLeftDown(), OnMouseLeftUp(), OnMouseMove(), OnMouseRightUp(), and OnPaint().

◆ mouse_y0

int wxMGL::mouse_y0
private

◆ mouse_y1

int wxMGL::mouse_y1
private

Temporary variables for mouse.

Definition at line 199 of file wx.h.

Referenced by OnMouseDown(), OnMouseLeftDown(), OnMouseLeftUp(), OnMouseMove(), OnMouseRightUp(), and OnPaint().

◆ MousePos

wxString wxMGL::MousePos
protected

Last mouse position.

Definition at line 171 of file wx.h.

Referenced by OnMouseMove(), and Update().

◆ nFrameCounter

int wxMGL::nFrameCounter
protected

Definition at line 191 of file wx.h.

Referenced by Animation(), NextSlide(), PrevSlide(), setBitmap(), UpdateTools(), and wxMGL().

◆ nFramesToSkip

int wxMGL::nFramesToSkip
protected

Definition at line 182 of file wx.h.

Referenced by Repaint(), and wxMGL().

◆ pic

wxBitmap wxMGL::pic
protected

Pixmap for drawing (changed by update)

Definition at line 172 of file wx.h.

Referenced by Copy(), OnPaint(), Repaint(), and setBitmap().

◆ popup

wxMenu* wxMGL::popup
protected

Pointer to pop-up menu.

Definition at line 189 of file wx.h.

Referenced by OnMouseRightUp(), SetPopup(), and wxMGL().

◆ showMessage

bool wxMGL::showMessage
protected

Flag for showing messages (enabled by each execute())

Definition at line 188 of file wx.h.

◆ skiprotate

int wxMGL::skiprotate
protected

Definition at line 181 of file wx.h.

Referenced by Animation(), OnLeave(), OnMouseLeftUp(), OnMouseMove(), OnMouseRightUp(), Repaint(), and wxMGL().

◆ start_x

mreal wxMGL::start_x
protected

Definition at line 186 of file wx.h.

Referenced by DrawCurrentObject(), OnMouseLeftDown(), OnMouseMove(), OnPaint(), and wxMGL().

◆ start_y

mreal wxMGL::start_y
protected

start coordinates for drawing

Definition at line 186 of file wx.h.

Referenced by DrawCurrentObject(), OnMouseLeftDown(), OnMouseMove(), OnPaint(), and wxMGL().

◆ statusbar

wxStatusBar* wxMGL::statusbar
private

◆ styling

wxTextCtrl* wxMGL::styling
private

Definition at line 205 of file wx.h.

Referenced by DrawCurrentObject(), and InitializeToolbar().

◆ timer

wxTimer* wxMGL::timer
protected

Timer for animation.

Definition at line 190 of file wx.h.

Referenced by Animation(), OnKeyDown(), wxMGL(), and ~wxMGL().

◆ toptoolbar

wxToolBar* wxMGL::toptoolbar
private

Definition at line 201 of file wx.h.

Referenced by Animation(), InitializeToolbar(), SetDrawMode(), SetRotate(), SetZoom(), and UpdateTools().

◆ vAnimationBuffer

std::vector<wxImage> wxMGL::vAnimationBuffer
protected

Definition at line 192 of file wx.h.

Referenced by Animation(), NextSlide(), setBitmap(), and Update().

◆ zoom_x0

mreal wxMGL::zoom_x0
protected

◆ zoom_x1

mreal wxMGL::zoom_x1
protected

◆ zoom_y0

mreal wxMGL::zoom_y0
protected

◆ zoom_y1

mreal wxMGL::zoom_y1
protected

Zoom in region.

Definition at line 187 of file wx.h.

Referenced by OnMenuEvent(), OnMouseLeftUp(), OnMouseMove(), Repaint(), Restore(), wxMGL(), ZoomIn(), ZoomOut(), and ZoomRegion().

◆ zoomactive

bool wxMGL::zoomactive
protected

The documentation for this class was generated from the following files: