forked from JamesMcCrae/flatfab
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mainwindow.cpp
1436 lines (1149 loc) · 48.5 KB
/
mainwindow.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#include "mainwindow.h"
MainWindow::MainWindow()
{
//title/window stuff
window_title = "FlatFab 0.8.0 (beta)";
setWindowTitle(window_title);
//release 0.8.0
//added initial support for finger joints for the surface facet generation (teeth between adjacent faces)
//added ability to export slab geometry as a 2D layout (link to video) https://www.youtube.com/watch?v=b-i05v8l9nM
//release 0.7.1
//fixed an issue with mouse cursor position on OSX with retina display
//release 0.7
//stability improvement: new ear clipping algorithm performs triangulations for sections with/without holes
//release 0.6 -
//more ui improvements
//new interaction for specifying planes for procedural modelling operations
//updated curve filtering/fitting algorithm for input strokes
//potentially fixed bug on mac with cpu usage
//fixed bug where "new flatfab" from menu would not first remove the webview
//added filename to window title
//release 0.5 -
//ui improvements including
//- new tool sidebar
//- new transform widget
//release 0.4 -
//added "calibration shape" generation to make finding the right calibration setting a cinch
//multisampling now a command line parameter, the default value is 4. e.g: flatfab.exe -ms 0 would disable multisampling
//smoother animations/frame updates
//updated linux binary with RPATH set in the executable (rather than relying on a script)
//release 0.3
//updated name
//updated program icon
//added antialiasing/multisampling option
//release 0.2
// fixed rippling effect of bezier curve fit
// made 80 degrees the default rotation angle
//side dock widget stuff
//sideWidget = glWidget.GetSideWidget();
//dockWidget = new QDockWidget();
//dockWidget->setWindowTitle("Settings");
//dockWidget->setWidget(sideWidget);
//web view stuff
webView = new QWebView(this);
webView->setGeometry(0,0,800,700);
// --- does nothing for some reason
webView->settings()->setFontFamily(QWebSettings::SansSerifFont, "Arial");
// ---
webView->load(QUrl("http://flatfab.com/splash.html"));
webView->show();
createActions();
createMenus();
//set up bottom widget
ShowWelcomePage();
//track usage
SendTrackRequest();
toolWidget = NULL;
window_title_timer.setSingleShot(false);
window_title_timer.start(1000);
connect(&window_title_timer, SIGNAL(timeout()), this, SLOT(UpdateWindowTitle()));
}
MainWindow::~MainWindow()
{
}
void MainWindow::ShowWelcomePage()
{
QPushButton *button1 = new QPushButton("New FlatFab");
QPushButton *button2 = new QPushButton("Open FlatFab...");
QPushButton *button3 = new QPushButton("Quit");
button1->setMinimumHeight(40);
button2->setMinimumHeight(40);
button3->setMinimumHeight(40);
connect(button1, SIGNAL(clicked()), this, SLOT(NewPlaneSketch()));
connect(button2, SIGNAL(clicked()), this, SLOT(LoadPlaneSketch()));
connect(button3, SIGNAL(clicked()), this, SLOT(Exit()));
//ShowAppWidgets() is now called from within NewPlaneSketch and LoadPlaneSketch
//connect(button1, SIGNAL(clicked()), this, SLOT(ShowAppWidgets()));
//connect(button2, SIGNAL(clicked()), this, SLOT(ShowAppWidgets()));
QHBoxLayout *layout = new QHBoxLayout;
layout->addWidget(button1);
layout->addWidget(button2);
layout->addWidget(button3);
bottomWidget = new QWidget(this);
bottomWidget->setLayout(layout);
bottomDockWidget = new QDockWidget();
bottomDockWidget->setFeatures(0);
bottomDockWidget->setWindowTitle("Start using FlatFab:");
bottomDockWidget->setWidget(bottomWidget);
setCentralWidget(webView);
addDockWidget(Qt::TopDockWidgetArea, bottomDockWidget);
}
void MainWindow::ShowAppWidgets()
{
//main widget/window layout
if (webView != NULL) {
webView->hide();
delete webView;
webView = NULL;
}
else {
//skip everything else if webview is NULL, as it means this method has been called before
return;
}
this->removeDockWidget(bottomDockWidget);
//addDockWidget(Qt::RightDockWidgetArea, dockWidget);
createSideBar();
createQuickToolBar();
setCentralWidget(&glWidget);
this->update(); //@chris: maybe this solves that issue (a quick redraw after changing widgets and before showing the messagebox?)
glWidget.repaint();
// For some reason the message box causes the webView to show up for a fraction
// of a second as a side widget is opened on Windows - this happens even after deleting the webView
QMessageBox mb;
mb.setPalette(QPalette(QColor(230,230,230), QColor(255,255,255)));
mb.setMinimumSize(500, 300);
mb.setTextFormat(Qt::RichText);
mb.setWindowTitle ( "Welcome to FlatFab" );
mb.setText("<p><font size='6'><b>Getting Started</b></font></p>"
"<p>Start by drawing your first shape with the left mouse button held</p>"
"<p><font size='4'><b>Create a New Section</b></font>"
"<table> <tr><td>- Left click on a section and drag to the section edge to form a slit<br>"
"- Now draw the new section while holding the left mouse button</td></tr></table></p>"
"<p><font size='4'><b>Selecting a Section</b></font>"
"<table> <tr><td>- Sections must be selected to perform editing operation<br>"
"- Click on a section with the right mouse button to select it</td></tr></table></p>"
"<p><font size='4'><b>Delete a Section</b></font>"
"<table> <tr><td>- Press <b>Delete</b>/<b>Backspace</b> to delete the selected section</td></tr></p>"
"<p><font size='4'><b>Editing Section Control Points</b></font>"
"<table> <tr> <td>- Right click and drag the control points to modify the section shape (hold ctrl to create sharp corners)<br>"
"- While hovering over a control point press <b>-</b> to delete a handle or <b>+</b> to add one</td></tr></table></p>"
"<p><font size='4'><b>Camera Controls</b></font>"
"<table> <tr><td><b>orbit</b><br><b>zoom</b><br><b>dolly</b></td>"
"<td>left-click (anywhere off the model)<br>"
"left-click + ctrl (command on Mac OSX)<br>"
"left-click + shift</td> </table>");
mb.setStandardButtons(QMessageBox::Ok);
mb.exec();
// qDebug()<<"hey";
// mb.close();
}
void MainWindow::closeDialog()
{
}
void MainWindow::createQuickToolBar()
{
// ---- old tool bar - this should stay till new tool bar has been tested enough
// quickToolBar = new QToolBar(tr("Quick Settings"), this);
// quickToolBar->setIconSize(QSize(25,25));
//// quickToolBar->setMovable(false);
//// quickToolBar->setFloatable(false);
//// quickToolBar->setWindowFlags(Qt::Tool | Qt::FramelessWindowHint);
//// quickToolBar->setStyleSheet("QToolButton {color: #aaa; font-size: 10px;}"
//// "QToolButton::checked { background-color: #fff;}"
//// "QToolBar {position:absolute; top:10px; right:10px;}");
// QAction *setLocalSymmetry = new QAction(QIcon(":/icons/appbar.transform.flip.horizontal.png"), "Local Symmetry", this);
// setLocalSymmetry->setStatusTip(tr("Local Symmetry"));
// setLocalSymmetry->setCheckable(true);
// setLocalSymmetry->setChecked(true);
// connect(setLocalSymmetry, SIGNAL(triggered()), this, SLOT(ToggleLocalSymmetry()));
// quickToolBar->addAction(setLocalSymmetry);
//// quickToolBar->setAllowedAreas(Qt::BottomToolBarArea);
// addToolBar(quickToolBar);
// -----
// Push buttons - all buttons are opposite of their boolean counterparts - this is an ugly hack to acheive the right gradient
//
QPushButton * button = new QPushButton(QIcon(":/icons/appbar.transform.flip.horizontal.png"),"",this);
button->setCheckable(true);
button->setChecked(false); // this is opposite of what it should be - ugly hack to acheive the right gradient
//button->setIconSize(QSize(25,25));
button->setToolTip("Local Symmetry");
button->setStyleSheet("QPushButton {icon-size:35px; max-width:35px; max-height:35px;}"
"QPushButton:closed {background-color: #22c024;}"
"QPushButton:open {background-color: #fff;}");
connect(button, SIGNAL(clicked()), this, SLOT(ToggleLocalSymmetry()));
button->setFocusPolicy(Qt::NoFocus);
// Pen method
QPushButton * button2 = new QPushButton(QIcon(":/icons/appbar.vector.pen.png"),"",this);
button2->setCheckable(true);
button2->setChecked(true); // this is opposite of what it should be - ugly hack to acheive the right gradient
//button->setIconSize(QSize(25,25));
button2->setToolTip("Pen Mode");
button2->setStyleSheet("QPushButton {icon-size:35px; max-width:35px; max-height:35px;}"
"QPushButton:closed {background-color: #22c024;}"
"QPushButton:open {background-color: #fff;}");
connect(button2, SIGNAL(clicked()), this, SLOT(TogglePenMode()));
button2->setFocusPolicy(Qt::NoFocus);
// Setting up layout and widget
QHBoxLayout * layout = new QHBoxLayout();
layout->addWidget(button);
layout->addWidget(button2);
QWidget * widget = new QWidget();
widget->setLayout(layout);
widget->setFocusPolicy(Qt::NoFocus);
toolWidget = new QDockWidget("Tools", this);
toolWidget->setWidget(widget);
// Setting tool widget properties
toolWidget->setFloating( true );
QPoint point = mapToGlobal(QPoint(width() - 10, 10));
toolWidget->setGeometry( point.x(),point.y(),0,0);
toolWidget->setAllowedAreas( Qt::NoDockWidgetArea );
toolWidget->setWindowFlags(Qt::Tool | Qt::FramelessWindowHint);
toolWidget->setWindowTitle( "Tools" );
toolWidget->setFocusPolicy(Qt::NoFocus);
toolWidget->show();
}
void MainWindow::createSideBar()
{
QIcon icon[5];
icon[0].addFile(":/icons/edit-normal.png", QSize(), QIcon::Normal, QIcon::Off);
icon[0].addFile(":/icons/edit-hover.png", QSize(),QIcon::Active);
icon[0].addFile(":/icons/edit-checked.png", QSize(), QIcon::Normal, QIcon::On);
openDock[0] = new QAction(icon[0], tr("&Edit"), this);
//openEdit->setShortcuts(QKeySequence::Open);
openDock[0]->setStatusTip(tr("Edit"));
openDock[0]->setCheckable(true);
connect(openDock[0], SIGNAL(triggered()), this, SLOT(openEditWidget()));
icon[1].addFile(":/icons/generate-normal.png", QSize(), QIcon::Normal, QIcon::Off);
icon[1].addFile(":/icons/generate-hover.png", QSize(),QIcon::Active);
icon[1].addFile(":/icons/generate-checked.png", QSize(), QIcon::Normal, QIcon::On);
openDock[1] = new QAction(icon[1], tr("&Generate"), this);
//openEdit->setShortcuts(QKeySequence::Open);
openDock[1]->setStatusTip(tr("Generate"));
openDock[1]->setCheckable(true);
connect(openDock[1], SIGNAL(triggered()), this, SLOT(openGenerateWidget()));
icon[2].addFile(":/icons/guides-normal.png", QSize(), QIcon::Normal, QIcon::Off);
icon[2].addFile(":/icons/guides-hover.png", QSize(),QIcon::Active);
icon[2].addFile(":/icons/guides-checked.png", QSize(), QIcon::Normal, QIcon::On);
openDock[2] = new QAction(icon[2], tr("&Guides"), this);
//openEdit->setShortcuts(QKeySequence::Open);
openDock[2]->setStatusTip(tr("Guides"));
openDock[2]->setCheckable(true);
connect(openDock[2], SIGNAL(triggered()), this, SLOT(openGuidesWidget()));
icon[3].addFile(":/icons/physics-normal.png", QSize(), QIcon::Normal, QIcon::Off);
icon[3].addFile(":/icons/physics-hover.png", QSize(),QIcon::Active);
icon[3].addFile(":/icons/physics-checked.png", QSize(), QIcon::Normal, QIcon::On);
openDock[3] = new QAction(icon[3], tr("&Physics"), this);
//openEdit->setShortcuts(QKeySequence::Open);
openDock[3]->setStatusTip(tr("Physics"));
openDock[3]->setCheckable(true);
connect(openDock[3], SIGNAL(triggered()), this, SLOT(openPhysicsWidget()));
icon[4].addFile(":/icons/views-normal.png", QSize(), QIcon::Normal, QIcon::Off);
icon[4].addFile(":/icons/views-hover.png", QSize(),QIcon::Active);
icon[4].addFile(":/icons/views-checked.png", QSize(), QIcon::Normal, QIcon::On);
openDock[4] = new QAction(icon[4], tr("&View"), this);
//openEdit->setShortcuts(QKeySequence::Open);
openDock[4]->setStatusTip(tr("View"));
openDock[4]->setCheckable(true);
connect(openDock[4], SIGNAL(triggered()), this, SLOT(openViewWidget()));
//mainToolGroup->setExclusive(true);
mainToolBar = new QToolBar(tr("Tools"));
for(int i = 0; i < 4; i++)
{
mainToolBar->addAction(openDock[i]);
mainToolBar->widgetForAction(openDock[i])->setMinimumSize(QSize(75,75));
mainToolBar->addSeparator();
}
mainToolBar->addAction(openDock[4]);
mainToolBar->widgetForAction(openDock[4])->setMinimumSize(QSize(75,75));
mainToolBar->setMovable(false);
mainToolBar->setContextMenuPolicy(Qt::PreventContextMenu);
mainToolBar->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
mainToolBar->setIconSize(QSize(76,76));
addToolBar(Qt::LeftToolBarArea, mainToolBar);
QWidget *widgets[5];
widgets[0] = glWidget.GetEditWidget();
widgets[1] = glWidget.GetGenerateWidget();
widgets[2] = glWidget.GetGuidesWidget();
widgets[3] = glWidget.GetPhysicsWidget();
widgets[4] = glWidget.GetViewWidget();
for(int i = 0; i < 5; i++)
{
// QWidget *widget = new QWidget(this);
// widget->setLayout(layout);
docks[i] = new QDockWidget(this);
if (i == 1) {
QScrollArea * scrollArea = new QScrollArea;
scrollArea->setMinimumWidth(245);
scrollArea->setHorizontalScrollBarPolicy( Qt::ScrollBarAlwaysOff );
widgets[i]->layout()->setSizeConstraint(QLayout::SetFixedSize);
scrollArea->setWidget(widgets[i]);
docks[i]->setWidget(scrollArea);
}
else {
docks[i]->setWidget(widgets[i]);
}
docks[i]->setFeatures(QDockWidget::NoDockWidgetFeatures);
addDockWidget(Qt::LeftDockWidgetArea,docks[i]);
docks[i]->setVisible(false);
}
docks[0]->setWindowTitle("Edit Selected Section");
docks[1]->setWindowTitle("Generate Sections");
docks[2]->setWindowTitle("Guides and Dimensions");
docks[3]->setWindowTitle("Physical Simulation");
docks[4]->setWindowTitle("View");
}
void MainWindow::SendTrackRequest()
{
//this code sends a track request to Google Anayltics for "splash.html" for the FFF account
QNetworkAccessManager * nam = new QNetworkAccessManager(this);
//QObject::connect(nam, SIGNAL(finished(QNetworkReply*)), this, SLOT(finishedSlot(QNetworkReply*)));
QUrl collect_url("http://www.google-analytics.com/collect");
QNetworkRequest request(collect_url);
request.setHeader(QNetworkRequest::ContentTypeHeader, "application/x-www-form-urlencoded");
QByteArray query_items("v=1&tid=UA-51900137-1&cid=555&t=pageview&dp=%2Fsplash.html");
//QNetworkReply * reply = nam->post(request, query_items);
nam->post(request, query_items);
}
void MainWindow::keyPressEvent(QKeyEvent *event)
{
glWidget.keyPressEvent(event);
}
void MainWindow::keyReleaseEvent(QKeyEvent *event)
{
glWidget.keyReleaseEvent(event);
}
void MainWindow::createActions()
{
//file menu actions
newPlaneSketchAct = new QAction(tr("&New FlatFab"), this);
newPlaneSketchAct->setStatusTip(tr("Create a new FlatFab."));
newPlaneSketchAct->setShortcuts(QKeySequence::New);
connect(newPlaneSketchAct, SIGNAL(triggered()), this, SLOT(NewPlaneSketch()));
loadPlaneSketchAct = new QAction(tr("&Open FlatFab..."), this);
loadPlaneSketchAct->setStatusTip(tr("Open a FlatFab file (TXT)."));
loadPlaneSketchAct->setShortcuts(QKeySequence::Open);
connect(loadPlaneSketchAct, SIGNAL(triggered()), this, SLOT(LoadPlaneSketch()));
loadCurveAct = new QAction(tr("Open &Curve Template..."), this);
loadCurveAct->setStatusTip(tr("Open a template curve."));
connect(loadCurveAct, SIGNAL(triggered()), this, SLOT(LoadTemplateCurve()));
loadImageAct = new QAction(tr("Open &Image Template..."), this);
loadImageAct->setStatusTip(tr("Open a template image."));
connect(loadImageAct, SIGNAL(triggered()), this, SLOT(LoadTemplateImage()));
loadOBJAct = new QAction(tr("Open Surface &Template..."), this);
loadOBJAct->setStatusTip(tr("Open a template surface (OBJ)."));
connect(loadOBJAct, SIGNAL(triggered()), this, SLOT(LoadTemplateOBJ()));
savePlaneSketchAct = new QAction(tr("&Save FlatFab..."), this);
savePlaneSketchAct->setStatusTip(tr("Save a FlatFab file (TXT)."));
savePlaneSketchAct->setShortcuts(QKeySequence::Save);
connect(savePlaneSketchAct, SIGNAL(triggered()), this, SLOT(SavePlaneSketch()));
saveSliceOBJAct = new QAction(tr("Save Slice Geometry..."), this);
saveSliceOBJAct->setStatusTip(tr("Save geometry of flat planar sections (OBJ)."));
connect(saveSliceOBJAct, SIGNAL(triggered()), this, SLOT(SaveSliceOBJ()));
saveSlabOBJAct = new QAction(tr("Save Slab Geometry..."), this);
saveSlabOBJAct->setStatusTip(tr("Save geometry of thick planar sections (OBJ)."));
connect(saveSlabOBJAct, SIGNAL(triggered()), this, SLOT(SaveSlabOBJ()));
saveFlattenedSlabOBJAct = new QAction(tr("Save Flattened Slab Geometry..."), this);
saveFlattenedSlabOBJAct->setStatusTip(tr("Save geometry of thick planar sections onto a 2D plane (OBJ)."));
connect(saveFlattenedSlabOBJAct, SIGNAL(triggered()), this, SLOT(SaveFlattenedSlabOBJ()));
saveSurfaceOBJAct = new QAction(tr("Save Surface Patches..."), this);
saveSurfaceOBJAct->setStatusTip(tr("Save geometry of created surface patches (OBJ)."));
connect(saveSurfaceOBJAct, SIGNAL(triggered()), this, SLOT(SaveSurfaceOBJ()));
saveSVGAct = new QAction(tr("Save SVG for Fabrication..."), this);
saveSVGAct->setStatusTip(tr("Save fabrication template (SVG) file."));
connect(saveSVGAct, SIGNAL(triggered()), this, SLOT(SaveSVG()));
saveDXFAct = new QAction(tr("Save DXF for Fabrication..."), this);
saveDXFAct->setStatusTip(tr("Save fabrication template (DXF) file."));
connect(saveDXFAct, SIGNAL(triggered()), this, SLOT(SaveDXF()));
saveCalibrationAct = new QAction(tr("Save Calibration Shape..."), this);
saveCalibrationAct->setStatusTip(tr("Save calibration shape (SVG) file, used to find optimal slit width."));
connect(saveCalibrationAct, SIGNAL(triggered()), this, SLOT(SaveCalibration()));
savePhysicsOutput = new QAction(tr("Save PhysicsFile..."), this);
savePhysicsOutput->setStatusTip(tr("Save model in format for external applications (TXT)."));
connect(savePhysicsOutput, SIGNAL(triggered()), this, SLOT(SavePhysicsOutput()));
exitAct = new QAction(tr("&Quit"), this);
exitAct->setStatusTip(tr("Quit the application."));
exitAct->setShortcut(QKeySequence::Quit);
connect(exitAct, SIGNAL(triggered()), this, SLOT(Exit()));
//edit menu actions
useLocalSymmetryAct = new QAction(tr("&Local Symmetry"), this);
useLocalSymmetryAct->setStatusTip(tr("Enable/disable the use of local symmetry for sketched planar sections."));
useLocalSymmetryAct->setCheckable(true);
useLocalSymmetryAct->setChecked(glWidget.GetDoLocalSymmetry());
connect(useLocalSymmetryAct, SIGNAL(triggered()), this, SLOT(ToggleLocalSymmetry()));
copyMirrorXAct = new QAction(tr("Copy (Mirror &X)"), this);
copyMirrorXAct->setStatusTip(tr("Copy planar section, mirroring along X axis."));
connect(copyMirrorXAct, SIGNAL(triggered()), this, SLOT(CopyMirrorX()));
copyRotateYAct = new QAction(tr("Copy (Rotate &Y)"), this);
copyRotateYAct->setStatusTip(tr("Copy planar section, rotation 90 degrees about Y axis."));
connect(copyRotateYAct, SIGNAL(triggered()), this, SLOT(CopyRotateY()));
copyMirrorZAct = new QAction(tr("Copy (Mirror &Z)"), this);
copyMirrorZAct->setStatusTip(tr("Copy planar section, mirroring along Z axis."));
connect(copyMirrorZAct, SIGNAL(triggered()), this, SLOT(CopyMirrorZ()));
copyDuplicateAct = new QAction(tr("Copy (Duplicate)"), this);
copyDuplicateAct->setStatusTip(tr("Copy planar section, duplicating it in place."));
connect(copyDuplicateAct, SIGNAL(triggered()), this, SLOT(CopyDuplicate()));
undoAct = new QAction(tr("&Undo"), this);
undoAct->setStatusTip(tr("Undo the last change to the planar sections."));
undoAct->setShortcut(QKeySequence::Undo);
connect(undoAct, SIGNAL(triggered()), this, SLOT(Undo()));
redoAct = new QAction(tr("&Redo"), this);
redoAct->setStatusTip(tr("Redo the last undo to the planar sections."));
redoAct->setShortcut(QKeySequence::Redo);
connect(redoAct, SIGNAL(triggered()), this, SLOT(Redo()));
deleteAct = new QAction(tr("&Delete"), this);
deleteAct->setStatusTip(tr("Delete selected planar section."));
QList <QKeySequence> del_shortcuts;
del_shortcuts.push_back(Qt::Key_Backspace);
del_shortcuts.push_back(Qt::Key_Delete);
deleteAct->setShortcuts(del_shortcuts);
connect(deleteAct, SIGNAL(triggered()), this, SLOT(Delete()));
addAction(deleteAct);
transformAct = new QAction(tr("&Transform"), this);
transformAct->setStatusTip(tr("Transform a planar section using translate/rotate/scale."));
connect(transformAct, SIGNAL(triggered()), this, SLOT(Transform()));
snapMajorAxisAct = new QAction(tr("Snap To Major Axis"), this);
snapMajorAxisAct->setStatusTip(tr("Snaps the planar section normal to one of the 3 major axes."));
connect(snapMajorAxisAct, SIGNAL(triggered()), this, SLOT(SnapToMajorAxis()));
resketchCurveAct = new QAction(tr("Re-sketch &Boundary"), this);
resketchCurveAct->setStatusTip(tr("Allows immediate re-sketching of an already-created planar section."));
connect(resketchCurveAct, SIGNAL(triggered()), this, SLOT(ResketchCurve()));
addHoleBoundaryAct = new QAction(tr("Add &Hole"), this);
addHoleBoundaryAct->setStatusTip(tr("Sketch a boundary for a hole into the selected planar section."));
connect(addHoleBoundaryAct, SIGNAL(triggered()), this, SLOT(AddHoleBoundary()));
removeHolesBoundaryAct = new QAction(tr("Remove Holes"), this);
removeHolesBoundaryAct->setStatusTip(tr("Removes all holes from the selected planar section."));
connect(removeHolesBoundaryAct, SIGNAL(triggered()), this, SLOT(RemoveHolesBoundary()));
useMagneticCutsAct = new QAction(tr("Use Magnetic Cuts"), this);
useMagneticCutsAct->setStatusTip(tr("Deform the template surface using existing planar sections."));
useMagneticCutsAct->setCheckable(true);
useMagneticCutsAct->setChecked(glWidget.GetDoMagneticCuts());
connect(useMagneticCutsAct, SIGNAL(triggered()), this, SLOT(ToggleUseMagneticCuts()));
createSurfacePatchesAct = new QAction(tr("Create Surface Patches"), this);
createSurfacePatchesAct->setStatusTip(tr("Surface the model by creating a set of Coons patches."));
connect(createSurfacePatchesAct, SIGNAL(triggered()), this, SLOT(CreateSurfacePatches()));
deleteSurfacePatchesAct = new QAction(tr("Delete Surface Patches"), this);
deleteSurfacePatchesAct->setStatusTip(tr("Delete a created set of Coons patches."));
connect(deleteSurfacePatchesAct, SIGNAL(triggered()), this, SLOT(DeleteSurfacePatches()));
dimensioningToolAct = new QAction(tr("Dimensioning Tool"), this);
dimensioningToolAct->setStatusTip(tr("Scale the model by specifying dimensions along a defined line."));
connect(dimensioningToolAct, SIGNAL(triggered()), this, SLOT(StartDimensioningTool()));
//view menu actions
viewIso1Act = new QAction(tr("Isometric &1"), this);
viewIso1Act->setStatusTip(tr("Set camera to isometric view 1."));
viewIso1Act->setShortcut(QKeySequence(tr("1")));
connect(viewIso1Act, SIGNAL(triggered()), this, SLOT(ViewIso1()));
viewIso2Act = new QAction(tr("Isometric &2"), this);
viewIso2Act->setStatusTip(tr("Set camera to isometric view 2."));
viewIso2Act->setShortcut(QKeySequence(tr("2")));
connect(viewIso2Act, SIGNAL(triggered()), this, SLOT(ViewIso2()));
viewIso3Act = new QAction(tr("Isometric &3"), this);
viewIso3Act->setStatusTip(tr("Set camera to isometric view 3."));
viewIso3Act->setShortcut(QKeySequence(tr("3")));
connect(viewIso3Act, SIGNAL(triggered()), this, SLOT(ViewIso3()));
viewIso4Act = new QAction(tr("Isometric &4"), this);
viewIso4Act->setStatusTip(tr("Set camera to isometric view 4."));
viewIso4Act->setShortcut(QKeySequence(tr("4")));
connect(viewIso4Act, SIGNAL(triggered()), this, SLOT(ViewIso4()));
viewXAct = new QAction(tr("Along &X"), this);
viewXAct->setStatusTip(tr("Set camera to view along X axis."));
viewXAct->setShortcut(QKeySequence(tr("Q")));
connect(viewXAct, SIGNAL(triggered()), this, SLOT(ViewX()));
viewYAct = new QAction(tr("Along &Y"), this);
viewYAct->setStatusTip(tr("Set camera to view along Y axis."));
viewYAct->setShortcut(QKeySequence(tr("W")));
connect(viewYAct, SIGNAL(triggered()), this, SLOT(ViewY()));
viewZAct = new QAction(tr("Along &Z"), this);
viewZAct->setStatusTip(tr("Set camera to view along Z axis."));
viewZAct->setShortcut(QKeySequence(tr("E")));
connect(viewZAct, SIGNAL(triggered()), this, SLOT(ViewZ()));
viewPartAct = new QAction(tr("&Selected"), this);
viewPartAct->setStatusTip(tr("Set camera to view selected planar section."));
viewPartAct->setShortcut(QKeySequence(tr("A")));
connect(viewPartAct, SIGNAL(triggered()), this, SLOT(ViewPart()));
viewTNBFramesAct = new QAction(tr("&TNB Frames"), this);
viewTNBFramesAct->setStatusTip(tr("Show TNB frames for each planar section."));
viewTNBFramesAct->setCheckable(true);
viewTNBFramesAct->setChecked(glWidget.GetShowTNBFrames());
connect(viewTNBFramesAct, SIGNAL(triggered()), this, SLOT(ToggleShowTNBFrames()));
viewShadowAct = new QAction(tr("S&hadow"), this);
viewShadowAct->setStatusTip(tr("Show shadow on the ground plane."));
viewShadowAct->setCheckable(true);
viewShadowAct->setChecked(glWidget.GetShowShadow());
connect(viewShadowAct, SIGNAL(triggered()), this, SLOT(ToggleShowShadow()));
viewTemplatesAct = new QAction(tr("T&emplates"), this);
viewTemplatesAct->setStatusTip(tr("Show loaded surface or image templates."));
viewTemplatesAct->setCheckable(true);
viewTemplatesAct->setChecked(glWidget.GetShowTemplates());
connect(viewTemplatesAct, SIGNAL(triggered()), this, SLOT(ToggleShowTemplates()));
testCyclesAct = new QAction(tr("&Cycles"), this);
testCyclesAct->setStatusTip(tr("Show cycles of the model."));
testCyclesAct->setCheckable(true);
testCyclesAct->setChecked(glWidget.GetDoCyclesTest());
connect(testCyclesAct, SIGNAL(triggered()), this, SLOT(ToggleCyclesTest()));
testConnectedAct = new QAction(tr("C&onnectivity"), this);
testConnectedAct->setStatusTip(tr("Show connectivity of the model."));
testConnectedAct->setCheckable(true);
testConnectedAct->setChecked(glWidget.GetDoConnectedTest());
connect(testConnectedAct, SIGNAL(triggered()), this, SLOT(ToggleConnectedTest()));
testStabilityAct = new QAction(tr("&Stability"), this);
testStabilityAct->setStatusTip(tr("Show stability of the model."));
testStabilityAct->setCheckable(true);
testStabilityAct->setChecked(glWidget.GetDoStabilityTest());
connect(testStabilityAct, SIGNAL(triggered()), this, SLOT(ToggleStabilityTest()));
multisample0Act = new QAction(tr("No Multisamping"), this);
multisample0Act->setStatusTip(tr("Show stability of the model."));
multisample0Act->setCheckable(true);
multisample0Act->setChecked(glWidget.GetDoStabilityTest());
connect(multisample0Act, SIGNAL(triggered()), this, SLOT(SetMultisampling0()));
multisample4Act = new QAction(tr("4x Multisamping"), this);
multisample4Act->setStatusTip(tr("Show stability of the model."));
multisample4Act->setCheckable(true);
multisample4Act->setChecked(glWidget.GetDoStabilityTest());
connect(multisample4Act, SIGNAL(triggered()), this, SLOT(SetMultisampling4()));
multisample16Act = new QAction(tr("16x Multisamping"), this);
multisample16Act->setStatusTip(tr("Show stability of the model."));
multisample16Act->setCheckable(true);
multisample16Act->setChecked(glWidget.GetDoStabilityTest());
connect(multisample16Act, SIGNAL(triggered()), this, SLOT(SetMultisampling16()));
//generate menu actions
generateBranchingSetRootAct = new QAction(tr("Branching (Set Root Slit)"), this);
generateBranchingSetRootAct->setStatusTip(tr("Set the slit for the root node to generate branching planar sections."));
connect(generateBranchingSetRootAct, SIGNAL(triggered()), this, SLOT(GenerateBranchingSetRoot()));
generateBranchingAct = new QAction(tr("&Branching"), this);
generateBranchingAct->setStatusTip(tr("Generate branching planar sections."));
generateBranchingAct->setShortcut(QKeySequence("Ctrl+B"));
connect(generateBranchingAct, SIGNAL(triggered()), this, SLOT(GenerateBranching()));
generateLinearAct = new QAction(tr("&Linear"), this);
generateLinearAct->setStatusTip(tr("Generate linearly arranged planar sections."));
generateLinearAct->setShortcut(QKeySequence("Ctrl+L"));
connect(generateLinearAct, SIGNAL(triggered()), this, SLOT(GenerateLinear()));
generateBlendAct = new QAction(tr("Bl&end"), this);
generateBlendAct->setStatusTip(tr("Generate an arrangement of blended planar sections."));
generateBlendAct->setShortcut(QKeySequence("Ctrl+E"));
connect(generateBlendAct, SIGNAL(triggered()), this, SLOT(GenerateBlend()));
generateGridAct = new QAction(tr("&Grid"), this);
generateGridAct->setStatusTip(tr("Create a grid of planar sections whose elements fit within a specified rectangular boundary."));
generateGridAct->setShortcut(QKeySequence("Ctrl+G"));
connect(generateGridAct, SIGNAL(triggered()), this, SLOT(GenerateGrid()));
generateRevolveAct = new QAction(tr("&Revolve"), this);
generateRevolveAct->setStatusTip(tr("Generate a sequence of planar sections which revolve around a base section."));
generateRevolveAct->setShortcut(QKeySequence("Ctrl+R"));
connect(generateRevolveAct, SIGNAL(triggered()), this, SLOT(GenerateRevolve()));
generateMakeCircleAct = new QAction(tr("Set &Circle"), this);
generateMakeCircleAct->setStatusTip(tr("Mkae the boundary of an existing planar section a circle."));
connect(generateMakeCircleAct, SIGNAL(triggered()), this, SLOT(GenerateMakeCircle()));
generateMakeRectangleAct = new QAction(tr("Set Rec&tangle"), this);
generateMakeRectangleAct->setStatusTip(tr("Mkae the boundary of an existing planar section a rectangle."));
connect(generateMakeRectangleAct, SIGNAL(triggered()), this, SLOT(GenerateMakeRectangle()));
generateMakeRadialAct = new QAction(tr("Set R&adial"), this);
generateMakeRadialAct->setStatusTip(tr("Make the boundary of an existing planar section a radial pattern."));
connect(generateMakeRadialAct, SIGNAL(triggered()), this, SLOT(GenerateMakeRadial()));
generateMakeRadialHoleAct = new QAction(tr("Make Radial Holes"), this);
generateMakeRadialHoleAct->setStatusTip(tr("Make a radial set of holes in a selected planar section."));
connect(generateMakeRadialHoleAct, SIGNAL(triggered()), this, SLOT(GenerateMakeRadialHole()));
generateSlicesAct = new QAction(tr("&Slices"), this);
generateSlicesAct->setStatusTip(tr("Create regularly sampled sections from a template surface."));
connect(generateSlicesAct, SIGNAL(triggered()), this, SLOT(GenerateSlices()));
generateSurfaceFacetsAct = new QAction(tr("Surface &Facets"), this);
generateSurfaceFacetsAct->setStatusTip(tr("Create sections from the planar facets of a template surface."));
connect(generateSurfaceFacetsAct, SIGNAL(triggered()), this, SLOT(GenerateSurfaceFacets()));
//physics menu actions
testPhysicsAct = new QAction(tr("Test &Physics"), this);
testPhysicsAct->setStatusTip(tr("Perform physically-based tests of the model."));
testPhysicsAct->setCheckable(true);
testPhysicsAct->setChecked(glWidget.GetDoPhysicsTest());
connect(testPhysicsAct, SIGNAL(triggered()), this, SLOT(TogglePhysicsTest()));
CPhysics & physics = glWidget.GetPhysics();
showPhysicsDeformedAct = new QAction(tr("Show &Deformed"), this);
showPhysicsDeformedAct->setStatusTip(tr("Show deformed physics."));
showPhysicsDeformedAct->setCheckable(true);
showPhysicsDeformedAct->setChecked(physics.GetDrawDeformed());
connect(showPhysicsDeformedAct, SIGNAL(triggered()), this, SLOT(TogglePhysicsDeformed()));
showPhysicsSkeletonAct = new QAction(tr("Show &Skeleton"), this);
showPhysicsSkeletonAct->setStatusTip(tr("Show skeleton used in physics."));
showPhysicsSkeletonAct->setCheckable(true);
showPhysicsSkeletonAct->setChecked(physics.GetDrawSkeleton());
connect(showPhysicsSkeletonAct, SIGNAL(triggered()), this, SLOT(TogglePhysicsSkeleton()));
showPhysicsForceAct = new QAction(tr("Show &Force"), this);
showPhysicsForceAct->setStatusTip(tr("Show calcualted forces."));
showPhysicsForceAct->setCheckable(true);
showPhysicsForceAct->setChecked(physics.GetDrawForce());
connect(showPhysicsForceAct, SIGNAL(triggered()), this, SLOT(TogglePhysicsForce()));
showPhysicsSectionAct = new QAction(tr("Show S&ections"), this);
showPhysicsSectionAct->setStatusTip(tr("Show planar sections used by physics."));
showPhysicsSectionAct->setCheckable(true);
showPhysicsSectionAct->setChecked(physics.GetDrawSection());
connect(showPhysicsSectionAct, SIGNAL(triggered()), this, SLOT(TogglePhysicsSection()));
showPhysicsSectionMomentAct = new QAction(tr("Show Section &Moments"), this);
showPhysicsSectionMomentAct->setStatusTip(tr("Show within-plane forces calculated by physics."));
showPhysicsSectionMomentAct->setCheckable(true);
showPhysicsSectionMomentAct->setChecked(physics.GetDrawSectionMoment());
connect(showPhysicsSectionMomentAct, SIGNAL(triggered()), this, SLOT(TogglePhysicsSectionMoment()));
addExternalWeightAct = new QAction(tr("Add &Weight"), this);
addExternalWeightAct->setStatusTip(tr("Add an external mass to the selected plane."));
connect(addExternalWeightAct, SIGNAL(triggered()), this, SLOT(PhysicsAddExternalMass()));
removeExternalWeightsAct = new QAction(tr("Remove Weights"), this);
removeExternalWeightsAct->setStatusTip(tr("Removes external masses from the selected plane."));
connect(removeExternalWeightsAct, SIGNAL(triggered()), this, SLOT(PhysicsRemoveExternalMasses()));
}
void MainWindow::createMenus()
{
fileMenu = menuBar()->addMenu(tr("&File"));
fileMenu->addAction(newPlaneSketchAct);
fileMenu->addSeparator();
fileMenu->addAction(loadPlaneSketchAct);
fileMenu->addAction(loadCurveAct);
fileMenu->addAction(loadImageAct);
fileMenu->addAction(loadOBJAct);
fileMenu->addSeparator();
fileMenu->addAction(savePlaneSketchAct);
fileMenu->addAction(saveSliceOBJAct);
fileMenu->addAction(saveSlabOBJAct);
fileMenu->addAction(saveFlattenedSlabOBJAct);
//fileMenu->addAction(saveSurfaceOBJAct);
fileMenu->addAction(saveSVGAct);
fileMenu->addAction(saveDXFAct);
fileMenu->addAction(saveCalibrationAct);
//fileMenu->addAction(savePhysicsOutput);
fileMenu->addSeparator();
fileMenu->addAction(exitAct);
editMenu = menuBar()->addMenu(tr("&Edit"));
editMenu->addAction(undoAct);
editMenu->addAction(redoAct);
editMenu->addAction(deleteAct);
editMenu->addSeparator();
editMenu->addAction(transformAct);
editMenu->addSeparator();
editMenu->addAction(copyMirrorXAct);
editMenu->addAction(copyRotateYAct);
editMenu->addAction(copyMirrorZAct);
editMenu->addAction(copyDuplicateAct);
//editMenu->addSeparator();
// editMenu->addAction(createSurfacePatchesAct);
// editMenu->addAction(deleteSurfacePatchesAct);
editMenu->addSeparator();
editMenu->addAction(addHoleBoundaryAct);
editMenu->addAction(removeHolesBoundaryAct);
editMenu->addSeparator();
editMenu->addAction(generateMakeCircleAct);
editMenu->addAction(generateMakeRadialAct);
//editMenu->addAction(generateMakeRadialHoleAct);
editMenu->addAction(generateMakeRectangleAct);
editMenu->addSeparator();
editMenu->addAction(dimensioningToolAct);
editMenu->addSeparator();
editMenu->addAction(snapMajorAxisAct);
editMenu->addAction(resketchCurveAct);
editMenu->addAction(useMagneticCutsAct);
editMenu->addAction(useLocalSymmetryAct);
viewMenu = menuBar()->addMenu(tr("&View"));
viewMenu->addAction(viewIso1Act);
viewMenu->addAction(viewIso2Act);
viewMenu->addAction(viewIso3Act);
viewMenu->addAction(viewIso4Act);
viewMenu->addAction(viewXAct);
viewMenu->addAction(viewYAct);
viewMenu->addAction(viewZAct);
viewMenu->addAction(viewPartAct);
viewMenu->addSeparator();
viewMenu->addAction(viewTNBFramesAct);
viewMenu->addAction(viewShadowAct);
viewMenu->addSeparator();
viewMenu->addAction(viewTemplatesAct);
viewMenu->addSeparator();
viewMenu->addAction(testCyclesAct);
viewMenu->addAction(testConnectedAct);
viewMenu->addAction(testStabilityAct);
//viewMenu->addAction(multisample0Act);
//viewMenu->addAction(multisample4Act);
//viewMenu->addAction(multisample16Act);
generateMenu = menuBar()->addMenu(tr("&Generate"));
generateMenu->addAction(generateBlendAct);
generateMenu->addAction(generateBranchingSetRootAct);
generateMenu->addAction(generateBranchingAct);
generateMenu->addAction(generateGridAct);
generateMenu->addAction(generateLinearAct);
generateMenu->addAction(generateRevolveAct);
generateMenu->addAction(generateSlicesAct);
generateMenu->addAction(generateSurfaceFacetsAct);
physicsMenu = menuBar()->addMenu(tr("&Physics"));
physicsMenu->addAction(testPhysicsAct);
physicsMenu->addSeparator();
physicsMenu->addAction(showPhysicsDeformedAct);
physicsMenu->addAction(showPhysicsSkeletonAct);
physicsMenu->addAction(showPhysicsForceAct);
physicsMenu->addAction(showPhysicsSectionAct);
physicsMenu->addAction(showPhysicsSectionMomentAct);
physicsMenu->addSeparator();
physicsMenu->addAction(addExternalWeightAct);
physicsMenu->addAction(removeExternalWeightsAct);
connect(editMenu, SIGNAL(aboutToShow()), this, SLOT(setEditMenuChecks()) );
connect(viewMenu, SIGNAL(aboutToShow()), this, SLOT(setViewMenuChecks()) );
connect(physicsMenu, SIGNAL(aboutToShow()), this, SLOT(setPhysicsMenuChecks()) );
}
void MainWindow::UpdateWindowTitle()
{
QString open_filename = glWidget.GetOpenFilename();
if (open_filename.length() > 0) {
setWindowTitle(glWidget.GetOpenFilename() + " - " + window_title);
}
else {
setWindowTitle(window_title);
}
}
void MainWindow::NewPlaneSketch()
{
ShowAppWidgets();
glWidget.NewPlaneSketch();
}
void MainWindow::LoadTemplateOBJ()
{
glWidget.LoadTemplateOBJ();
}
void MainWindow::LoadTemplateCurve()
{
glWidget.LoadTemplateCurve();
}
void MainWindow::LoadTemplateImage()
{
glWidget.LoadTemplateImage();
}
void MainWindow::LoadPlaneSketch()
{
if (glWidget.LoadPlaneSketch()) {
ShowAppWidgets();
}
}
void MainWindow::SavePlaneSketch()
{
glWidget.SavePlaneSketch();
}
void MainWindow::SaveSliceOBJ()
{
glWidget.SaveSliceOBJ();
}
void MainWindow::SaveSlabOBJ()
{
glWidget.SaveSlabOBJ();
}
void MainWindow::SaveFlattenedSlabOBJ()
{
glWidget.SaveFlattenedSlabOBJ();
}
void MainWindow::SaveSurfaceOBJ()
{
glWidget.SaveSurfaceOBJ();
}
void MainWindow::SaveSVG()
{
glWidget.SaveSVG();
}
void MainWindow::SaveDXF()
{
glWidget.SaveDXF();
}
void MainWindow::SavePhysicsOutput()
{
glWidget.SavePhysicsOutput();
}
void MainWindow::SaveCalibration()
{
glWidget.SaveCalibration();
}
void MainWindow::Exit()
{
close();
qApp->quit();
}
void MainWindow::ToggleUseMagneticCuts()
{
glWidget.SetDoMagneticCuts(!glWidget.GetDoMagneticCuts());
}
void MainWindow::ToggleLocalSymmetry()
{
glWidget.SetDoLocalSymmetry(!glWidget.GetDoLocalSymmetry());
}
void MainWindow::TogglePenMode()
{
glWidget.SetPenModeOn(!glWidget.GetPenModeOn());
}
void MainWindow::StartDimensioningTool()
{
glWidget.StartDimensioningTool();
}
void MainWindow::Undo()
{
glWidget.Undo(OP_UNDO);
//glWidget.updateGL();
}
void MainWindow::Redo()
{
glWidget.Redo();
}