-
Notifications
You must be signed in to change notification settings - Fork 5
/
faceWidget.cpp
55 lines (35 loc) · 977 Bytes
/
faceWidget.cpp
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
47
48
49
50
51
52
53
54
55
#include "faceWidget.h"
DEFINE_EVENT_TYPE(wxEVT_POINT_ADDED)
BEGIN_EVENT_TABLE(FaceWidget, wxPanel)
END_EVENT_TABLE()
FaceWidget::FaceWidget(wxWindow *parent,SimulatedWorld *simu,const wxPoint& pos,const wxSize& size,bool horizontal,bool pre)
: wxPanel(parent, wxID_ANY, pos, size)
{
noPreliminar3D=pre;
world=simu;
worldView=false;
CreatePanel();
}
void FaceWidget::CreatePanel()
{
wxBoxSizer *fbox=new wxBoxSizer(wxHORIZONTAL);
canvas3d=new Canvas(this,wxID_ANY,wxDefaultPosition,wxSize(790,500));
canvas3d->DrawGrid();
fbox->Add(canvas3d,5,wxEXPAND);
SetSizer(fbox);
Vis2d=new globalView(this,wxID_ANY,wxT("Design2D"));
}
void FaceWidget::DrawFace(GLObject* obj)
{
canvas3d->AddObject(obj);
}
void FaceWidget::RefreshCanvas()
{
canvas3d->Refresh();
canvas3d->Update();
}
void FaceWidget::CreateVis2D()
{
Vis2d->Destroy();
Vis2d=new globalView(this,wxID_ANY,wxT("Design2D"));
}