-
Notifications
You must be signed in to change notification settings - Fork 5
/
canvas.h
46 lines (39 loc) · 1.26 KB
/
canvas.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#ifndef __APOLO__CANVAS__H
#define __APOLO__CANVAS__H
#include "mrcore.h"
#include <wx/glcanvas.h>
#include <wx/wx.h>
class Canvas : public wxGLCanvas
{
public:
Canvas(wxWindow* parent, const wxWindowID id, const wxPoint& pos, const wxSize& size,bool triD=true);
void SetCurrent(){wxGLCanvas::SetCurrent(*m_context);}
bool dimension;
void InitGL();
void AddObject(GLObject * obj);
void SetViewPoint(double dist_or_2Dx,double rot_or_2Dy,double elv_or_2Dfx,double s2Dfy=0);
void GetViewPoint(double &dist_or_2Dix,double &rot_or_2Diy,double &elv_or_2Dfx,double s2Dfy=0);
void SetViewCenter(double x, double y, double z);
void SetShowFrame(bool show);
void ClearObjects();
void Paint(wxPaintEvent& event);
void DrawGrid(bool draw=true);
void Resized(wxSizeEvent& event);
void OnMouseM(wxMouseEvent& event);
void OnMouse(wxMouseEvent& event);
void UpdateWorld(World* w);
void UpdateMeshpart(MeshPart* m);
void OnKey(wxKeyEvent& event);
wxPoint getCursorPosition(){return pt;};
void ChangeBackGroundColour(wxColour colour);
void ViewAll();
private:
GLScene scene;
double x2Di,y2Di,x2Df,y2Df;
wxPoint pt;
wxGLContext* m_context;
wxWindow *window;
bool flag;
DECLARE_EVENT_TABLE()
};
#endif // __APOLO__CANVAS__H