forked from hkociemba/CubeExplorer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
RubikMain.pas
6419 lines (5843 loc) · 215 KB
/
RubikMain.pas
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
unit RubikMain;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, FaceCube, ComCtrls, ExtCtrls,CubeDefs, Buttons,syncobjs, Menus,
hh,hh_funcs,Printers,ClipBrd,
{$IFDEF VER140}
D6OnHelpFix,
{$EndIf}
CubiCube,CordCube, Spin, Sockets, ScktComp,IniFiles, ImgList,CosetExp,
DSPack, DirectShow9,DSUtil,TlHelp32,//TlHelp32 for CountThreads
MTRandom;//Mersenne Twister Random Generator
const
WM_NEXTSEARCH=WM_APP+1111;
WM_NEXTLEVEL=WM_APP+1112;
WM_CREATETABLES=WM_APP+1113;
WM_CONNECT=WM_APP+1114;
WM_WARNING23=WM_APP+1115;
WM_UPDATELABELS=WM_APP+1116;
type
TForm1 = class(TForm)
PageCtrl: TPageControl;
TabSheet1: TTabSheet;
ButtonU: TButton;
ButtonR: TButton;
ButtonF: TButton;
ButtonD: TButton;
ButtonL: TButton;
ButtonB: TButton;
FacePaint: TPaintBox;
GroupBox1: TGroupBox;
GroupBox2: TGroupBox;
ButtonEmpty: TButton;
ButtonClear: TButton;
ButtonRandom: TButton;
ButtonCustomize: TButton;
GroupBox3: TGroupBox;
ButtonAddSolve: TButton;
ButtonAddGen: TButton;
Bevel1: TBevel;
ColorDialog: TColorDialog;
LSelColor: TLabel;
CheckBoxA1: TCheckBox;
CheckBoxF1: TCheckBox;
CheckBoxR1: TCheckBox;
CheckBoxU1: TCheckBox;
CheckBoxD1: TCheckBox;
CheckBoxL1: TCheckBox;
CheckBoxB1: TCheckBox;
CheckBoxA2: TCheckBox;
CheckBoxU2: TCheckBox;
CheckBoxD2: TCheckBox;
CheckBoxR2: TCheckBox;
CheckBoxL2: TCheckBox;
CheckBoxF2: TCheckBox;
CheckBoxB2: TCheckBox;
CheckBoxA3: TCheckBox;
CheckBoxU3: TCheckBox;
CheckBoxD3: TCheckBox;
CheckBoxR3: TCheckBox;
CheckBoxL3: TCheckBox;
CheckBoxF3: TCheckBox;
CheckBoxB3: TCheckBox;
CheckBoxA4: TCheckBox;
CheckBoxU4: TCheckBox;
CheckBoxD4: TCheckBox;
CheckBoxR4: TCheckBox;
CheckBoxL4: TCheckBox;
CheckBoxF4: TCheckBox;
CheckBoxB4: TCheckBox;
CheckBoxA5: TCheckBox;
CheckBoxU5: TCheckBox;
CheckBoxD5: TCheckBox;
CheckBoxR5: TCheckBox;
CheckBoxL5: TCheckBox;
CheckBoxF5: TCheckBox;
CheckBoxB5: TCheckBox;
PatBox1: TGroupBox;
PatBox2: TGroupBox;
PatBox3: TGroupBox;
PatBox4: TGroupBox;
PatBox5: TGroupBox;
CheckBoxContinuous: TCheckBox;
SbVert: TScrollBar;
SbHor: TScrollBar;
Panel1: TPanel;
OutPut: TPaintBox;
MainMenu1: TMainMenu;
File1: TMenuItem;
Options1: TMenuItem;
Help1: TMenuItem;
LoadWorkspace1: TMenuItem;
SaveWorkspace1: TMenuItem;
N2: TMenuItem;
PrinterSetup1: TMenuItem;
PrintMainWindow: TMenuItem;
N3: TMenuItem;
Exit1: TMenuItem;
TwoPhaseAlgorithm1: TMenuItem;
Contents1: TMenuItem;
N4: TMenuItem;
About1: TMenuItem;
SDWorkSpace: TSaveDialog;
ODWorkspace: TOpenDialog;
ProgressBar: TProgressBar;
ProgressLabel: TLabel;
PopupMenu1: TPopupMenu;
DeleteselectedCubes1: TMenuItem;
CubePopupMenu: TPopupMenu;
N1: TMenuItem;
ClearMainWindow1: TMenuItem;
rotUD: TMenuItem;
RotURF: TMenuItem;
RefRL: TMenuItem;
N5: TMenuItem;
RemoveCube1: TMenuItem;
N6: TMenuItem;
TransferCubetoFaceletEditor1: TMenuItem;
RotFB: TMenuItem;
Bevel2: TBevel;
GroupBox4: TGroupBox;
PatShape1: TShape;
PatShape2: TShape;
PatShape3: TShape;
PatShape4: TShape;
PatShape5: TShape;
PatShape6: TShape;
CurShape: TShape;
Label1: TLabel;
PatClear: TButton;
RunPatButton: TButton;
PrinterSetupDialog: TPrinterSetupDialog;
FindGenerators: TCheckBox;
PrintSelectedCubes: TMenuItem;
Invert1: TMenuItem;
Edit1: TMenuItem;
DeleteselectedCubes2: TMenuItem;
StartSearchforSelectedCubes: TMenuItem;
ClearMainWindow2: TMenuItem;
SaveasHtml1: TMenuItem;
SaveHtml: TSaveDialog;
HugeSolver: TMenuItem;
TabVideo: TTabSheet;
GroupBox5: TGroupBox;
RbB: TRadioButton;
RbL: TRadioButton;
RbF: TRadioButton;
RbR: TRadioButton;
RbU: TRadioButton;
RbD: TRadioButton;
BScan: TButton;
DisplayGroupBox: TGroupBox;
RbHue: TRadioButton;
RbSat: TRadioButton;
RbVal: TRadioButton;
BTransferCam: TButton;
GroupBox7: TGroupBox;
Bevel4: TBevel;
ILeft: TImage;
IFront: TImage;
IRight: TImage;
IUp: TImage;
IDown: TImage;
TimerBlink: TTimer;
Bevel5: TBevel;
WebServer1: TMenuItem;
ServerSocket1: TServerSocket;
TimerWatchDog: TTimer;
ClientSocket1: TClientSocket;
TabSym: TTabSheet;
GBSpeed: TGroupBox;
GBNumCol: TGroupBox;
SymFindGenerators: TCheckBox;
CBContinuous: TCheckBox;
Bevel6: TBevel;
SBr2e1: TSpeedButton;
SBr2e2: TSpeedButton;
SBr2e3: TSpeedButton;
SBr2e4: TSpeedButton;
SBr2e5: TSpeedButton;
SBr2e6: TSpeedButton;
SBme1: TSpeedButton;
SBme2: TSpeedButton;
SBme3: TSpeedButton;
SBme4: TSpeedButton;
SBme5: TSpeedButton;
SBme6: TSpeedButton;
SBr2f1: TSpeedButton;
SBr2f2: TSpeedButton;
SBr2f3: TSpeedButton;
SBr41: TSpeedButton;
SBr42: TSpeedButton;
SBr43: TSpeedButton;
SBmf1: TSpeedButton;
SBmf2: TSpeedButton;
SBmf3: TSpeedButton;
SBm41: TSpeedButton;
SBm42: TSpeedButton;
SBm43: TSpeedButton;
SBr31: TSpeedButton;
SB26: TSpeedButton;
SB27: TSpeedButton;
SB28: TSpeedButton;
SBmc: TSpeedButton;
BRunSym: TButton;
GroupBox11: TGroupBox;
CbSymmetries: TComboBox;
ImageList1: TImageList;
GBSymmetry: TGroupBox;
CBn1: TCheckBox;
CBn3: TCheckBox;
CBn2: TCheckBox;
CBn4: TCheckBox;
CBn5: TCheckBox;
CBn6: TCheckBox;
GBPermutation: TGroupBox;
RBAll: TRadioButton;
RBEdgesE: TRadioButton;
RBCornersE: TRadioButton;
Bevel7: TBevel;
Bevel8: TBevel;
Bevel9: TBevel;
Bevel10: TBevel;
MTransferSym: TMenuItem;
CBIsomorph: TCheckBox;
RBEdgesO: TRadioButton;
RBCornersO: TRadioButton;
GroupBox10: TGroupBox;
Label8: TLabel;
LSymSize: TLabel;
Label9: TLabel;
LSymN: TLabel;
GroupBox12: TGroupBox;
RBSym: TRadioButton;
RBASym: TRadioButton;
GBAntiSym: TGroupBox;
CBASy: TComboBox;
MemoAntisym: TMemo;
MIApplySymToSel: TMenuItem;
ApplySymPopUp: TPopupMenu;
GroupBox8: TGroupBox;
EManeuver: TEdit;
BApplyMan: TButton;
CopySolverToClipboard: TMenuItem;
N8: TMenuItem;
CopyGeneratortoClipboard: TMenuItem;
Bevel12: TBevel;
Bevel13: TBevel;
Bevel14: TBevel;
N9: TMenuItem;
MIUseAsAntiSymmetry: TMenuItem;
CSelfInverse: TCheckBox;
CBSelfInverse: TCheckBox;
N7: TMenuItem;
StartSearchforSelectedCubes1: TMenuItem;
StopSearchforSelectedCubes1: TMenuItem;
N11: TMenuItem;
N12: TMenuItem;
AddRandomCubes1: TMenuItem;
N13: TMenuItem;
FreeThreadsonTerminate1: TMenuItem;
BatchTimer: TTimer;
StartAutomodusforOptimalSolver1: TMenuItem;
StartAutorunforTFS: TMenuItem;
AutoRunIdx: TLabel;
IgnoreIsoOnLoad: TMenuItem;
N15: TMenuItem;
GenerateStatistics1: TMenuItem;
N16: TMenuItem;
IsoInvInclude: TMenuItem;
N18: TMenuItem;
ArrangeSelected: TMenuItem;
AddSymmetryInfoforSelected: TMenuItem;
AddAllInverses: TMenuItem;
N19: TMenuItem;
ArrangeSelected1: TMenuItem;
AddSymmetryInfoforSelected1: TMenuItem;
N20: TMenuItem;
FixCenterFacelets: TMenuItem;
N21: TMenuItem;
SortCubesbyPatternName: TMenuItem;
SortCubesbyManeuverLength: TMenuItem;
ExpandFirstCube: TMenuItem;
ColorCheck: TCheckBox;
TMenuRun: TMenuItem;
N10: TMenuItem;
N14: TMenuItem;
StopSearchForSelectedCubes: TMenuItem;
N22: TMenuItem;
WCAscramble: TMenuItem;
FilterGraph: TFilterGraph;
SampleGrabber: TSampleGrabber;
Filter: TFilter;
GroupBox9: TGroupBox;
CapDevs: TComboBox;
CapConfig: TButton;
CapFormat: TButton;
EditCenters: TMenuItem;
GroupBox13: TGroupBox;
LOrange: TLabel;
ETreshOrange: TEdit;
LYellow: TLabel;
ETreshYellow: TEdit;
LGreen: TLabel;
ETreshGreen: TEdit;
LBlue: TLabel;
ETreshBlue: TEdit;
BRyanHeise: TButton;
RODistance: TGroupBox;
HueSep: TRadioButton;
ValSep: TRadioButton;
GroupBox15: TGroupBox;
RBAutomatic: TRadioButton;
RBInteractive: TRadioButton;
SampleNumber: TGroupBox;
sampleRed: TLabel;
sampleOrange: TLabel;
Button1: TButton;
GBPreview: TGroupBox;
prevBox: TPaintBox;
Button2: TButton;
MaximumNumber1: TMenuItem;
ButtonEmptyC: TButton;
ButtonEmptyE: TButton;
ButtonClearC: TButton;
ButtonClearE: TButton;
ButtonE: TButton;
Buttony: TButton;
ButtonS: TButton;
ButtonM: TButton;
Buttonx: TButton;
Buttonz: TButton;
N23: TMenuItem;
AllowSliceMoves1: TMenuItem;
ButtonRandomC: TButton;
ButtonRandomE: TButton;
Multiply: TMenuItem;
MultiplyInverse: TMenuItem;
CBExactSym: TCheckBox;
CBExactAsym: TCheckBox;
SortCubesbyCubeID: TMenuItem;
procedure FormCreate(Sender: TObject);
procedure FacePaintPaint(Sender: TObject);
procedure ButtonEmptyClick(Sender: TObject);
procedure ButtonClearClick(Sender: TObject);
procedure ButtonCustomizeClick(Sender: TObject);
procedure FacePaintMouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
procedure FacePaintMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
procedure ButtonRandomClick(Sender: TObject);
procedure ButtonAddSolveClick(Sender: TObject);
procedure OutputPaint(Sender: TObject);
procedure SbVertScroll(Sender: TObject; ScrollCode: TScrollCode;
var ScrollPos: Integer);
procedure FormResize(Sender: TObject);
procedure RunPatButtonClick(Sender: TObject);
procedure About1Click(Sender: TObject);
procedure TwoPhaseAlgorithm1Click(Sender: TObject);
procedure SaveWorkspace1Click(Sender: TObject);
procedure LoadWorkspace1Click(Sender: TObject);
procedure OutPutMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
procedure SbHorScroll(Sender: TObject; ScrollCode: TScrollCode;
var ScrollPos: Integer);
procedure FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
procedure DeleteselectedCubes1Click(Sender: TObject);
procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
procedure ClearMainWindow1Click(Sender: TObject);
procedure RemoveCube1Click(Sender: TObject);
procedure TransferCubetoFaceletEditor1Click(Sender: TObject);
procedure rotUDClick(Sender: TObject);
procedure RotURFClick(Sender: TObject);
procedure RotFBClick(Sender: TObject);
procedure RefRLClick(Sender: TObject);
procedure CheckBoxOnClick(Sender: TObject);
procedure CheckBoxAOnClick(Sender: TObject);
procedure PatShapeMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
procedure PatClearClick(Sender: TObject);
procedure PrinterSetup1Click(Sender: TObject);
procedure PrintMainWindowClick(Sender: TObject);
procedure File1Click(Sender: TObject);
procedure FormDestroy(Sender: TObject);
procedure Contents1Click(Sender: TObject);
procedure InvertClick(Sender: TObject);
procedure Edit1Click(Sender: TObject);
procedure SaveasHtml1Click(Sender: TObject);
procedure Exit1Click(Sender: TObject);
procedure HugeSolverClick(Sender: TObject);
procedure ButtonXClick(Sender: TObject);
procedure ButtonMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
procedure ButtonMouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure RbFaceClick(Sender: TObject);
procedure BScanClick(Sender: TObject);
procedure BTransferCamClick(Sender: TObject);
procedure TBRedChange(Sender: TObject);
procedure TBBlueChange(Sender: TObject);
procedure TBGreenChange(Sender: TObject);
procedure TimerBlinkTimer(Sender: TObject);
procedure TimerBlinkTimer1(Sender: TObject);//für das two-phase-test modul
procedure FormMouseWheel(Sender: TObject; Shift: TShiftState;
WheelDelta: Integer; MousePos: TPoint; var Handled: Boolean);
procedure WebServer1Click(Sender: TObject);
procedure ServerSocket1ClientError(Sender: TObject;
Socket: TCustomWinSocket; ErrorEvent: TErrorEvent;
var ErrorCode: Integer);
procedure ServerSocket1GetThread(Sender: TObject;
ClientSocket: TServerClientWinSocket;
var SocketThread: TServerClientThread);
procedure TimerWatchDogTimer(Sender: TObject);
procedure ClientSocket1Error(Sender: TObject; Socket: TCustomWinSocket;
ErrorEvent: TErrorEvent; var ErrorCode: Integer);
procedure BRunSymClick(Sender: TObject);
procedure CbSymmetriesDrawItem(Control: TWinControl; Index: Integer;
Rect: TRect; State: TOwnerDrawState);
procedure CbSymmetriesChange(Sender: TObject);
procedure SBSymmetriesClick(Sender: TObject);
procedure BClearSymClick(Sender: TObject);
procedure MTransferSymClick(Sender: TObject);
procedure CubePopupMenuPopup(Sender: TObject);
procedure PopupMenu1Popup(Sender: TObject);
procedure CBIsomorphClick(Sender: TObject);
procedure RBEdgesOClick(Sender: TObject);
procedure RBCornersOClick(Sender: TObject);
procedure RBSymClick(Sender: TObject);
procedure RBASymClick(Sender: TObject);
procedure CBASyDrawItem(Control: TWinControl; Index: Integer;
Rect: TRect; State: TOwnerDrawState);
procedure CBASyChange(Sender: TObject);
procedure MIApplySymToSelClick(Sender: TObject);
procedure SBr2e1MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
procedure ApplySymPopUpPopup(Sender: TObject);
procedure BApplyManClick(Sender: TObject);
procedure CopySolverToClipboardClick(Sender: TObject);
procedure CopyGeneratortoClipboardClick(Sender: TObject);
procedure MIUseAsAntiSymmetryClick(Sender: TObject);
procedure CSelfInverseClick(Sender: TObject);
procedure EManeuverKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
procedure StartSearchforSelectedCubesClick(Sender: TObject);
procedure AddRandomCubes1Click(Sender: TObject);
procedure FreeThreadsonTerminate1Click(Sender: TObject);
procedure Options1Click(Sender: TObject);
procedure StartAutomodusforOptimalSolver1Click(Sender: TObject);
procedure BatchTimerTimer(Sender: TObject);
procedure StartAutorunforTFSClick(Sender: TObject);
procedure SbVertChange(Sender: TObject);
procedure IgnoreIsoOnLoadClick(Sender: TObject);
procedure GenerateStatistics1Click(Sender: TObject);
procedure ArrangeSelectedClick(
Sender: TObject);
procedure AddSymmetryInfoforSelectedClick(Sender: TObject);
procedure AddAllInversesClick(Sender: TObject);
procedure FixCenterFaceletsClick(Sender: TObject);
procedure SortCubesbyPatternNameClick(Sender: TObject);
procedure ExpandFirstCubeClick(Sender: TObject);
procedure SkipDuplicatesOnLoadClick(Sender: TObject);
procedure ColorCheckClick(Sender: TObject);
procedure StopSearchForSelectedCubesClick(Sender: TObject);
procedure WCAscrambleClick(Sender: TObject);
procedure CapDevsChange(Sender: TObject);
procedure SampleGrabberBuffer(sender: TObject; SampleTime: Double;
pBuffer: Pointer; BufferLen: Integer);
procedure CapConfigClick(Sender: TObject);
procedure CapFormatClick(Sender: TObject);
procedure BRyanHeiseClick(Sender: TObject);
procedure EditCentersClick(Sender: TObject);
procedure ETreshOrangeChange(Sender: TObject);
procedure ETreshYellowChange(Sender: TObject);
procedure ETreshGreenChange(Sender: TObject);
procedure ETreshBlueChange(Sender: TObject);
procedure RBAutomaticClick(Sender: TObject);
procedure RBInteractiveClick(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure prevBoxPaint(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure MaximumNumber1Click(Sender: TObject);
procedure ButtonEmptyCClick(Sender: TObject);
procedure ButtonEmptyEClick(Sender: TObject);
procedure ButtonClearCClick(Sender: TObject);
procedure ButtonClearEClick(Sender: TObject);
procedure AllowSliceMoves1Click(Sender: TObject);
procedure MultiplyClick(Sender: TObject);
procedure MultiplyInverseClick(Sender: TObject);
procedure PageCtrlChange(Sender: TObject);
{ Private declarations }
private
t: array[0..8] of Integer;//Bildindizes für die CBAsy-Combobox
procedure DoNextSearch(var Message: TMessage); message WM_NEXTSEARCH;
procedure ShowNextLevel(var Message: TMessage); message WM_NEXTLEVEL;
procedure CreateTables(var Message: TMessage); message WM_CREATETABLES;
procedure Warning23(var Message: TMessage); message WM_WARNING23;
procedure Connect(var Message: TMessage); message WM_CONNECT;
procedure UpdateLabels(var Message: TMessage); message WM_UPDATELABELS;
procedure PatSearchTerminate(Sender: TObject);
procedure SymSearchTerminate(Sender: TObject);
public
BmRun,BmStop: TBitmap;
lowOLd,highOld:Integer;
dirty:Boolean;
curFileName:String;
procedure AddCube(f:FaceletCube;isSolver,startSearch,askIsomorphics:Boolean;pType:Integer;isOriented: Boolean);
procedure ButClick(Sender: TObject);
procedure ButSolveClick(Sender: TObject);
procedure OptBoxClick(Sender: TObject);
procedure EdNameChange(Sender: TObject);
procedure SquareMouseDown(Sender: TObject;Button:TMouseButton;Shift:TShiftState;X,Y:Integer);
procedure SetUpProgressBar(min,max:Integer;lab:String);
procedure DeleteSelectedCubes;
procedure SearchIncomplete;
procedure ShowCenterDialog;
procedure saveToDefaultFile;
end;
procedure DoManeuverString(fcb:FaceletCube;man:String;var mvs:Integer);
const MAXNUM=15;//maximal number of cubes on visible part of Main Window
CSIZE=4;//size of cube unit in output window
UBORD=8;//offset from top
LBORD=5;//left offset of cubes in main window
EDMAXLENGTH=30;//maximal length of name for pattern
HORSIZE=650;//horizontal size of output window
var
Form1: TForm1;
fCube,prevCube: FaceletCube;
curCol:ColorIndex;
curPatCol:Integer;//current colour in Pattern Editor
curFace:Integer;//current face to scan with WebCam
fc: Array of FaceletCube;//for the cubes in the Main Window
fcN: Integer;//Highest Index for the fcubes used
xOffset,yOffset: Integer;//offset of the scrollwindow
h: Integer;//Height of Output-Window
ButRun,ButSolve: array[0..MAXNUM] of TSpeedButton;
EdName: array[0..MAXNUM] of TEdit;
OptBox: array[0..MAXNUM] of TCheckBox;
CheckBox: array[U..B,1..5] of TCheckBox;
ACheckBox:array[1..5] of TCheckBox;
Square: array[1..5,1..9] of TShape;
PatSelector : array[1..6] of TShape;
lastSelected: Integer;//index of last selected Cube
makesTables: Boolean;//during table generation
var mHHelp: THookHelpSystem;//for html help
buf: TBitmap;
scannedFaces: array[0..5] of boolean;//faces already scanned
iniFile: TIniFile;
//minTime: Integer;//minimal time to search with webinterface
//maxCubes: Integer;//maximal number of Cubes in Main Window if WebServer is active
curSym: array[0..47] of byte;//current Symmetry in Symmetry Editor
curASym: Int64;//current Symmetry of antisymmtery subgroup
curSymNormal: Int64;//the symmetry of the largest subgroup of M, in which curSym is normal, d.h. x^-1 cursSym x = cursSym
counter: Int64;//counter for different purposes, set to 0 at start
save1,save2,save3: Cardinal;//other multipurpose variables
escPressed: boolean;//wird gesetzt, wenn ESC gedrückt wird, in Load File verwendet
bitvecDone: Integer;//Zähler für den Coset Explorer
cubeCount: array[0..20] of Integer;//Speichert die Anzahl der Wüfel in bestimmeter Tiefe
coSearch:CosetSearch;
globalmessage: String;//um Texte zwischen den Modulen zu tauschen
incoIsRunning: boolean;//flag das anzeigt, ob das Incomplete Search Mdoul läuft
SysDev: TSysDevEnum;//zum Nummerieren der DirectShow Devices
bmap: TBitMap;//bitmap zum Zeichnen für das videofenster
treshOrange,treshYellow,treshGreen,treshBlue: Integer;
//parameteres for webcam recognition
ryanCount: Integer; //Zähler für ryans online simulator
xdist,ydist: Integer;//Parameter für Abstände der Scanfelder bei der Webcam
redHue,orangeHue,redVal,orangeVal,redSat,orangeSat:
array [0..8] of Integer;//rot/orange für interaktiven Modus
capXPos,capYPos: Integer;//Position der rechten Maustaste im Capture Fenster
redRequest,orangeRequest: Boolean;//signaliere, dass rot bzw orangewert gelesen wird
nSampleRed,nSampleOrange:Integer;//Nummer der Sample für rot oder orange
redHueS,redSatS,redValS: Integer;//Standard Abweichung der rot-Samples
orangeHueS,orangeSatS,orangeValS: Integer;
maxAutoRunThreads: Integer;//Maximum number of Threads for Autorun
useSlices: Boolean; //Use slice moves in Incoplete Search
sliceMode: Boolean;// Use Slice moves in Two-Phase-Algorithm and Optimal Search
ID: TMTID; //Mersenne Twister Random Generator Id
RandVec: TRandVector; //
MausPos:TPoint;
manSep: String;//entweder f,q,s,sq
writeToFile: Boolean;//Antwort des Webservers in file schreiben
threadN: Integer; //Anzahl der bereits vorhandenen Threads beim Autorun Start
CS: TRTLCriticalSection;
implementation
uses Math,Symmetries,Search,OptSearch,TripSearch, About,
Options,PatternSearch, OptOptions,WebCam,MathFuncs,ServPort,
StrUtils,TcpServer,SymSearch, RunSetup, Statistics, Incomp, centers,UKeyBoardOutput,
OptBatch;
var ps:PatSearch;usedRightButton:Boolean;
ss:SySearch;
{$IF CUBE20STUFF}
//Variablen nur für die Nebenklassenberechnung von Q
sliceRep: array [0..495*70-1] of Boolean;
sliceSym: array [0..495*70-1] of Int64;
eoriRep: array [0..2048-1] of Boolean;
eoriSym: array [0..2048-1] of Int64;
tetraRep: array [0..70-1] of Boolean;
tetraSym: array [0..70-1] of Int64;
coriRep: array [0..2187-1] of Boolean;
coriSym: array [0..2187-1] of Int64;
tcosetBitmap: array [0..70963200 div 8] of Byte;
{$IFEND}
{$R *.DFM}
//++++++++++++++++++++++++++Initialize the Form+++++++++++++++++++++++++++++++++
procedure TForm1.FormCreate(Sender: TObject);
var i,j: Integer;prnt:TWinControl;
k: Face;
begin
InitializeCriticalSection(CS);
{$If not QTM}
manSep:='f';
{$ELSE}
manSep:='q';
{$IFEND}
useSlices:=false;
messageboxPopup:=false;//Messagebox bei Wechsel des slicemodes
SysDev:= TSysDevEnum.Create(CLSID_VideoInputDeviceCategory);
if SysDev.CountFilters > 0 then
for i := 0 to SysDev.CountFilters - 1 do
begin
CapDevs.Items.Add(SysDev.Filters[i].FriendlyName);
end;
if SysDev.CountFilters=0 then
begin
CapDevs.Text:='No device found - connect device prior to program start!';
CapDevs.Enabled:=false;
end;
bmap:=TBitMap.Create;
SetCurrentDir(ExtractFilePath(Paramstr(0)));//Cube Explorer directory
{$IF NOT PRIVAT}
ExpandFirstCube.Visible:=false;
{$IFEND}
ClientSocket1.Port:=ServerSocket1.Port;
incoIsRunning:=false;
for k:=U1 to B9 do faceValue[k]:=Ord(NoCol);//für prevCube
for i:= 0 to 5 do scannedFaces[i]:=false;
BScan.Hint:=Hints[5]+Chr(13)+Hints[6]+Chr(13)+Hints[7]+Chr(13)+Hints[8];
Application.ShowHint:=true;
Application.Title := curVersion;
Application.HintHidePause:=30000;//show hint max. 30 seconds
PostMessage(Handle,WM_CreateTables,0,0); //build the tables
buf:=TBitmap.Create;//double buffer the Output
Output.ControlStyle:=Output.ControlStyle+[csOpaque];//prevent flicker
usedRightButton:=false;
fcube := FaceletCube.Create(FacePaint.Canvas);//facelet editor
prevCube:= FaceletCube.Create(prevBox.Canvas);
prevCube.size:=2; prevCube.paintType:=4;//Farben direkt zeichnen
prevCube.Empty;
prevCube.PFace^[U5]:=NoCol;prevCube.PFace^[R5]:=NoCol;prevCube.PFace^[F5]:=NoCol;
prevCube.PFace^[D5]:=NoCol;prevCube.PFace^[L5]:=NoCol;prevCube.PFace^[B5]:=NoCol;
mHHelp := THookHelpSystem.Create('cube.chm', '', htHHAPI);
curCol:=UCol;
Screen.Cursors[1]:=LoadCursor(HInstance,'Eimer');//cursor for filling
Screen.Cursors[2]:=LoadCursor(HInstance,'Pipette');//cursor for colorpicking
FacePaint.Cursor:=1;
LSelColor.Cursor:=1;
Randomize;
MT_RandInit(ID,RandSeed);//Itialize Mersenne Twister
Cubedefs.Color[UCol]:=clBlue;
Cubedefs.Color[RCol]:=clYellow;
Cubedefs.Color[FCol]:=clRed;
Cubedefs.Color[DCol]:=clGreen;
Cubedefs.Color[LCol]:=clWhite;
Cubedefs.Color[BCol]:=RGB(255,128,0);//orange
Cubedefs.Color[NoCol]:=clGray;
iniFile := TIniFile.Create(ExtractFilePath(Paramstr(0))+'cube.ini');
Cubedefs.Color[UCol]:=iniFile.ReadInteger('Color Scheme','UColor',Cubedefs.Color[UCol]);
Cubedefs.Color[RCol]:=iniFile.ReadInteger('Color Scheme','RColor',Cubedefs.Color[RCol]);
Cubedefs.Color[FCol]:=iniFile.ReadInteger('Color Scheme','FColor',Cubedefs.Color[FCol]);
Cubedefs.Color[DCol]:=iniFile.ReadInteger('Color Scheme','DColor',Cubedefs.Color[DCol]);
Cubedefs.Color[LCol]:=iniFile.ReadInteger('Color Scheme','LColor',Cubedefs.Color[LCol]);
Cubedefs.Color[BCol]:=iniFile.ReadInteger('Color Scheme','BColor',Cubedefs.Color[BCol]);
Cubedefs.Color[NoCol]:=iniFile.ReadInteger('Color Scheme','FreeColor',Cubedefs.Color[NoCol]);
ColorCheck.Checked:= iniFile.ReadBool('Faclet Editor','AutoFix',true);
RBAutomatic.Checked:= iniFile.ReadBool('WebCam','autoMode',false);//default ist false
SetLength(fc,10);fcN:=0;xOffset:=0;yOffset:=0;lowOld:=-1;highOld:=-1;
BMRun:=TBitmap.Create;
BMRun.LoadFromResourceName(HInstance,'Run');//load green run bitmap
BMStop:=TBitmap.Create;
BMStop.LoadFromResourceName(HInstance,'Stop');//load red stop bitmap
for i:= 0 to MAXNUM do//create the dynamic objects in the main window
begin
ButRun[i]:=TSpeedButton.Create(Form1);
ButRun[i].Visible:=false;
ButRun[i].Parent:=Panel1;
ButRun[i].Width:=23;
ButRun[i].Height:=22;
ButRun[i].Caption:='';
ButRun[i].Flat:=True;
ButRun[i].Left:=410;
ButRun[i].OnClick:= ButClick;
ButSolve[i]:=TSpeedButton.Create(Form1);
ButSolve[i].Visible:=false;
ButSolve[i].Parent:=Panel1;
ButSolve[i].Width:=58;
ButSolve[i].Height:=22;
ButSolve[i].Flat:=True;
ButSolve[i].Left:=220;
ButSolve[i].OnClick:= ButSolveClick;
EdName[i]:=TEdit.Create(Form1);
EdName[i].Parent:=Panel1;
EdName[i].Width:=150;
EdName[i].Left:=180;
EdName[i].Visible:=false;
EdName[i].MaxLength:=EDMAXLENGTH;
EdName[i].OnChange:=EdNameChange;
OptBox[i]:=TCheckBox.Create(Form1);
OptBox[i].Parent:=Panel1;
OptBox[i].Width:=60;
OptBox[i].Left:=350;
OptBox[i].Visible:=false;
OptBox[i].OnClick:= OptBoxClick;
OptBox[i].Caption:='optimal';
end;
for i:= 1 to 5 do//create the objects in the pattern-editor
begin
prnt:=nil;
case i of
1: prnt:=PatBox1;
2: prnt:=PatBox2;
3: prnt:=PatBox3;
4: prnt:=PatBox4;
5: prnt:=PatBox5;
end;
for j:= 1 to 9 do
begin
Square[i,j]:= TShape.Create(Form1);
Square[i,j].Width:=26;
Square[i,j].Height:=26;
Square[i,j].Brush.Color:=Cubedefs.Color[NoCol];
Square[i,j].Tag:=6;//Nr 6 in palette
Square[i,j].Parent:=prnt;
Square[i,j].Left:=2+((j-1) mod 3)*25;
Square[i,j].Top:=7+((j-1) div 3)*25;
Square[i,j].Cursor:=1;
Square[i,j].OnMouseDown:=SquareMouseDown;
end;
end;
//initialize the checkboxes in the pattern editor
CheckBox[U,1]:=CheckBoxU1;CheckBox[R,1]:=CheckBoxR1;CheckBox[F,1]:=CheckBoxF1;
CheckBox[D,1]:=CheckBoxD1;CheckBox[L,1]:=CheckBoxL1;CheckBox[B,1]:=CheckBoxB1;
CheckBox[U,2]:=CheckBoxU2;CheckBox[R,2]:=CheckBoxR2;CheckBox[F,2]:=CheckBoxF2;
CheckBox[D,2]:=CheckBoxD2;CheckBox[L,2]:=CheckBoxL2;CheckBox[B,2]:=CheckBoxB2;
CheckBox[U,3]:=CheckBoxU3;CheckBox[R,3]:=CheckBoxR3;CheckBox[F,3]:=CheckBoxF3;
CheckBox[D,3]:=CheckBoxD3;CheckBox[L,3]:=CheckBoxL3;CheckBox[B,3]:=CheckBoxB3;
CheckBox[U,4]:=CheckBoxU4;CheckBox[R,4]:=CheckBoxR4;CheckBox[F,4]:=CheckBoxF4;
CheckBox[D,4]:=CheckBoxD4;CheckBox[L,4]:=CheckBoxL4;CheckBox[B,4]:=CheckBoxB4;
CheckBox[U,5]:=CheckBoxU5;CheckBox[R,5]:=CheckBoxR5;CheckBox[F,5]:=CheckBoxF5;
CheckBox[D,5]:=CheckBoxD5;CheckBox[L,5]:=CheckBoxL5;CheckBox[B,5]:=CheckBoxB5;
ACheckBox[1]:=CheckBoxA1;ACheckBox[2]:=CheckBoxA2;ACheckBox[3]:=CheckBoxA3;
ACheckBox[4]:=CheckBoxA4;ACheckBox[5]:=CheckBoxA5;
PatShape1.Cursor:=2;PatShape2.Cursor:=2;PatShape3.Cursor:=2;
PatShape4.Cursor:=2;PatShape5.Cursor:=2;PatShape6.Cursor:=2;
PatSelector[1]:=PatShape1;PatSelector[2]:=PatShape2;PatSelector[3]:=PatShape3;
PatSelector[4]:=PatShape4;PatSelector[5]:=PatShape5;PatSelector[6]:=PatShape6;
lastSelected:=-1;
makesTables:=false;
dirty:=false;
curFileName:='untitled.txt';//name of last loaded or save file
Caption:=ExtractFileName(curFilename)+' - '+curVersion;
checkIsomorphics:=true;//check for isomorphic cubes before adding to Main-Window
curPatCol:=1;//current color in Pattern Editor
curFace:=5;//current face to scan
treshOrange:=20;
treshYellow:=60;
treshGreen:=125;
treshBlue:=220;
xDist:=5;yDist:=5;
for i:= Low(redHue) to High(RedHue) do
begin
redHue[i]:=9999;orangeHue[i]:=9999;
redVal[i]:=-1;orangeVal[i]:=-1;
redSat[i]:=-1;orangeSat[i]:=-1;
end;
redRequest:=false;orangeRequest:=false;
nSampleRed:=0;nSampleOrange:=0;
end;
//+++++++++++++++++++++++End initialize the Form++++++++++++++++++++++++++++++++
//+++++++++++++++++++++++Draw the Facelet Editor++++++++++++++++++++++++++++++++
procedure TForm1.FacePaintPaint(Sender: TObject);
begin
fCube.DrawCube(0,0);
FacePaint.Canvas.Brush.Color:= CubeDefs.Color[curCol];
FacePaint.Canvas.Rectangle(228,150,293,215);
//FacePaint.Canvas.Rectangle(288,150,293,215);
end;
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//++++++++++++++++++++++++Reset to Empty++++++++++++++++++++++++++++++++++++++++
procedure TForm1.ButtonEmptyClick(Sender: TObject);
begin
fcube.Empty;
CenterDlg.Button1Click(nil);
FacePaint.Invalidate;
end;
//++++++++++++++++++++++++Reset to Clean++++++++++++++++++++++++++++++++++++++++
procedure TForm1.ButtonClearClick(Sender: TObject);
begin
fcube.Clean;//reset to clean
CenterDlg.Button1Click(nil);
FacePaint.Invalidate;
end;
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//++++++++++++++++++++++++++++Reset to Random+++++++++++++++++++++++++++++++++++
procedure TForm1.ButtonRandomClick(Sender: TObject);
var c: CubieCube; co: Corner; ed: Edge;
var one: Extended;
var n1,n2,n3,n3h,n3l,n4,n5 : Int64;
begin
one:=1;//be sure to use Extended precision
n1:= Trunc(one*MT_RandNext(ID)/$100000000*40320);
n2:= Trunc(one*MT_RandNext(ID)/$100000000*2187);
//n3:= Trunc(one*MT_RandNext(ID)/$100000000*479001600);
n3h:= Trunc(one*MT_RandNext(ID)/$100000000*22275);//22275*21504=12!
n3l:= Trunc(one*MT_RandNext(ID)/$100000000*21504);
n3:= n3h*21504+n3l;
n4:= Trunc(one*MT_RandNext(ID)/$100000000*2048);
n5:= Trunc(one*MT_RandNext(ID)/$100000000*4096);
if (Sender<>nil) and((Sender as TButton).Name= 'ButtonRandomC')
then begin n3:=0;n4:=0;n5:=0; end
else if (Sender<>nil) and ((Sender as TButton).Name= 'ButtonRandomE')
then begin n1:=0;n2:=0;n5:=0 end ;
c:=CubieCube.Create(n1,n2,n3,n4,n5);
//c:=CubieCube.Create(n1,n2,n3,0,n5);//edge orientation 0 cubes
if c.CornParityEven <> c.CentParityEven then
begin co:=c.PCorn^[URF].c; c.PCorn^[URF].c:=c.PCorn^[UFL].c; c.PCorn^[UFL].c:=co; end;
if c.EdgeParityEven <> c.CornParityEven then
begin ed:=c.PEdge^[UR].e; c.PEdge^[UR].e:=c.PEdge^[UF].e; c.PEdge^[UF].e:=ed; end;
fCube.SetFacelets(c);
FacePaint.Invalidate;
c.Free;
CenterDlg.Button1Click(nil);
end;
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//+++++++++++++++++++++++++Customize Selected Color+++++++++++++++++++++++++++++
procedure TForm1.ButtonCustomizeClick(Sender: TObject);
//var fs: TFileStream;
//const filename = 'colors.cust';//user defined colors are stored here
begin
ColorDialog.Color:=Cubedefs.Color[curCol];
if ColorDialog.Execute= true then
begin
Cubedefs.Color[curCol]:=ColorDialog.Color;
case curCol of
UCol: iniFile.WriteInteger('Color Scheme','UColor',Cubedefs.Color[CurCol]);
RCol: iniFile.WriteInteger('Color Scheme','RColor',Cubedefs.Color[CurCol]);
FCol: iniFile.WriteInteger('Color Scheme','FColor',Cubedefs.Color[CurCol]);
DCol: iniFile.WriteInteger('Color Scheme','DColor',Cubedefs.Color[CurCol]);
LCol: iniFile.WriteInteger('Color Scheme','LColor',Cubedefs.Color[CurCol]);
BCol: iniFile.WriteInteger('Color Scheme','BColor',Cubedefs.Color[CurCol]);
NoCol: iniFile.WriteInteger('Color Scheme','FreeColor',Cubedefs.Color[CurCol]);
end;
FacePaint.Invalidate;Output.Invalidate;
end;
end;
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//+++++++++Change cursor according position on Cube in Pattern Editor+++++++++++
procedure TForm1.FacePaintMouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
var xr,yr,a,b: Real; s: Integer;
begin
s:=fCube.size;
if (x>3*s) and (x<6*s) and (y>9*s) and (y<12*s) then FacePaint.Cursor:=2
else if (x>12*s) and (x<15*s) and (y>9*s) and (y<12*s) then FacePaint.Cursor:=2
else if (x>27*s) and (x<30*s) and (y>3*s) and (y<6*s) then FacePaint.Cursor:=2
else if (x>12*s) and (x<15*s) and (y>18*s) and (y<21*s) then FacePaint.Cursor:=2
else
begin
xr:=x-16*s;
yr:=y-2*s;
b:=yr/2;a:=(xr+yr)/3;
if (a>0) and (a<s)and (b>0) and (b<s) then FacePaint.Cursor:=2
else
begin
xr:=x-20*s;
yr:=y-7*s;
b:=(xr+yr)/3;a:=xr/2;
if (a>0) and (a<s)and (b>0) and (b<s) then FacePaint.Cursor:=2
else FacePaint.Cursor:=1;
end
end
end;
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
procedure TForm1.ShowCenterDialog;
begin
//aktuelle Orientierungen übertragen
case fCube.cenTwist[U] of
0:CenterDlg.RadioButton1.Checked:=true;
1:CenterDlg.RadioButton2.Checked:=true;
2:CenterDlg.RadioButton3.Checked:=true;
3:CenterDlg.RadioButton4.Checked:=true;
end;
case fCube.cenTwist[R] of
0:CenterDlg.RadioButton5.Checked:=true;
1:CenterDlg.RadioButton6.Checked:=true;
2:CenterDlg.RadioButton7.Checked:=true;
3:CenterDlg.RadioButton8.Checked:=true;
end;
case fCube.cenTwist[F] of
0:CenterDlg.RadioButton9.Checked:=true;
1:CenterDlg.RadioButton10.Checked:=true;
2:CenterDlg.RadioButton11.Checked:=true;
3:CenterDlg.RadioButton12.Checked:=true;
end;
case fCube.cenTwist[D] of
0:CenterDlg.RadioButton13.Checked:=true;
1:CenterDlg.RadioButton14.Checked:=true;
2:CenterDlg.RadioButton15.Checked:=true;
3:CenterDlg.RadioButton16.Checked:=true;
end;
case fCube.cenTwist[L] of
0:CenterDlg.RadioButton17.Checked:=true;
1:CenterDlg.RadioButton18.Checked:=true;
2:CenterDlg.RadioButton19.Checked:=true;
3:CenterDlg.RadioButton20.Checked:=true;
end;
case fCube.cenTwist[cubedefs.B] of
0:CenterDlg.RadioButton21.Checked:=true;
1:CenterDlg.RadioButton22.Checked:=true;
2:CenterDlg.RadioButton23.Checked:=true;
3:CenterDlg.RadioButton24.Checked:=true;
end;
ButtonU.Enabled:=false;ButtonR.Enabled:=false;ButtonF.Enabled:=false;
ButtonD.Enabled:=false;ButtonL.Enabled:=false;ButtonB.Enabled:=false;
ButtonAddSolve.Enabled:=false; ButtonAddGen.Enabled:=false;
CenterDlg.Show;
end;
//+++++++++++++Change the color of the facelets in the Facelet Editor+++++++++++
procedure TForm1.FacePaintMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
label ende,noChange;