Normand Briere
2019-08-01 650ecb410e75381cf73a4139325741b36d84d94e
GroupEditor.java
....@@ -12,6 +12,7 @@
1212 import com.jme.math.Vector3f;
1313 import com.jme.renderer.ColorRGBA;
1414
15
+import grafeme.ui.*;
1516 //import buoy.widget.BFileChooser;
1617
1718 class GroupEditor extends ObjEditor implements //iParse, //iCallBack,
....@@ -22,6 +23,302 @@
2223 DragGestureListener, DragSourceListener, DropTargetListener,
2324 ItemListener // ListSelectionListener
2425 {
26
+
27
+ public void AddSkyboxButton(String f, String s, cGridBag row)
28
+ {
29
+ cButton skyboxButton;
30
+ final String path = "cubemaps/" + f + "-skyboxes/" + s;
31
+ row.add(skyboxButton = GetButton(path + "/preview.jpg", !Grafreed.NIMBUSLAF));
32
+ //row.add(skyboxButton = GetButton(path + "/negx.jpg", !Grafreed.NIMBUSLAF));
33
+ skyboxButton.setToolTipText(s);
34
+ skyboxButton.addActionListener(new ActionListener()
35
+ {
36
+ @Override
37
+ public void actionPerformed(ActionEvent e)
38
+ {
39
+ ChangeSkybox(path);
40
+ }
41
+ });
42
+ }
43
+
44
+ public void AddSkyboxTab0(JTabbedPane skyboxpanel)
45
+ {
46
+ cGridBag tab0 = new cGridBag().setVertical(true);
47
+
48
+ tab0.setName("Urban");
49
+ skyboxpanel.add(tab0);
50
+
51
+ cGridBag row0 = new cGridBag();
52
+ cGridBag row1 = new cGridBag();
53
+ cGridBag row2 = new cGridBag();
54
+ cGridBag row3 = new cGridBag();
55
+ cGridBag row4 = new cGridBag();
56
+ cGridBag row5 = new cGridBag();
57
+ cGridBag row6 = new cGridBag();
58
+
59
+ AddSkyboxButton("default", "rgb", row0);
60
+ //AddSkyboxButton("default", "cornell", row0);
61
+ AddSkyboxButton("penguins", "dust", row0);
62
+ AddSkyboxButton("penguins", "tropic", row0);
63
+ AddSkyboxButton("penguins", "yonder", row0);
64
+
65
+ AddSkyboxButton("default", "uffizi", row1);
66
+ AddSkyboxButton("bridge", "Bridge", row1);
67
+ AddSkyboxButton("bridge", "Bridge2", row1);
68
+ AddSkyboxButton("urban", "GamlaStan2", row1);
69
+
70
+ AddSkyboxButton("urban", "Parliament", row2);
71
+ AddSkyboxButton("urban", "Roundabout", row2);
72
+ AddSkyboxButton("urban", "SaintLazarusChurch", row2);
73
+ AddSkyboxButton("urban", "SaintLazarusChurch2", row2);
74
+
75
+ AddSkyboxButton("urban", "SaintLazarusChurch3", row3);
76
+ AddSkyboxButton("urban", "UnionSquare", row3);
77
+ AddSkyboxButton("urban", "Medborgarplatsen", row3);
78
+ AddSkyboxButton("park", "BerzeliiPark", row3);
79
+
80
+ AddSkyboxButton("park", "Buddha", row4);
81
+ AddSkyboxButton("park", "CNTower2", row4);
82
+ AddSkyboxButton("park", "NiagaraFalls1", row4);
83
+ AddSkyboxButton("park", "NiagaraFalls3", row4);
84
+
85
+ AddSkyboxButton("park", "Park", row5);
86
+ AddSkyboxButton("park", "Pond", row5);
87
+ AddSkyboxButton("park", "Skansen", row5);
88
+ AddSkyboxButton("park", "Skansen2", row5);
89
+
90
+ AddSkyboxButton("park", "Skansen3", row6);
91
+ AddSkyboxButton("park", "Skansen4", row6);
92
+ AddSkyboxButton("park", "Skansen5", row6);
93
+ AddSkyboxButton("persson", "VancouverConventionCentre", row6);
94
+
95
+ tab0.add(row0);
96
+ tab0.add(row1);
97
+ tab0.add(row2);
98
+ tab0.add(row3);
99
+ tab0.add(row4);
100
+ tab0.add(row5);
101
+ tab0.add(row6);
102
+
103
+ for (int i=5; --i>=0;)
104
+ {
105
+ //oe.toolboxPanel.Return();
106
+ //tab0.add(new cGridBag());
107
+ }
108
+ }
109
+
110
+ public void AddSkyboxTab1(JTabbedPane skyboxpanel)
111
+ {
112
+ cGridBag tab0 = new cGridBag().setVertical(true);
113
+
114
+ tab0.setName("Nature");
115
+ skyboxpanel.add(tab0);
116
+
117
+ cGridBag row0 = new cGridBag();
118
+ cGridBag row1 = new cGridBag();
119
+ cGridBag row2 = new cGridBag();
120
+ cGridBag row3 = new cGridBag();
121
+ cGridBag row4 = new cGridBag();
122
+ cGridBag row5 = new cGridBag();
123
+ cGridBag row6 = new cGridBag();
124
+
125
+ AddSkyboxButton("beach", "HeartInTheSand", row0);
126
+ AddSkyboxButton("beach", "LarnacaBeach", row0);
127
+ AddSkyboxButton("beach", "PalmTrees", row0);
128
+ AddSkyboxButton("beach", "Tenerife", row0);
129
+
130
+ AddSkyboxButton("beach", "Tenerife2", row1);
131
+ AddSkyboxButton("beach", "Tenerife3", row1);
132
+ AddSkyboxButton("field", "FishPond", row1);
133
+ AddSkyboxButton("field", "Footballfield", row1);
134
+
135
+ AddSkyboxButton("field", "Meadow", row2);
136
+ AddSkyboxButton("field", "Sorsele", row2);
137
+ AddSkyboxButton("field", "Sorsele2", row2);
138
+ AddSkyboxButton("field", "Sorsele3", row2);
139
+
140
+ AddSkyboxButton("forest", "Brudslojan", row3);
141
+ AddSkyboxButton("forest", "Langholmen2", row3);
142
+ AddSkyboxButton("forest", "Plants", row3);
143
+ AddSkyboxButton("mountain", "Maskonaive", row3);
144
+
145
+ AddSkyboxButton("mountain", "Maskonaive2", row4);
146
+ AddSkyboxButton("mountain", "Maskonaive3", row4);
147
+ AddSkyboxButton("mountain", "Teide", row4);
148
+ AddSkyboxButton("park", "Tantolunden4", row4);
149
+
150
+ AddSkyboxButton("park", "Stairs", row5);
151
+ AddSkyboxButton("default", "skycube", row6);
152
+ AddSkyboxButton("rocky", "Langholmen", row5);
153
+ AddSkyboxButton("rocky", "Skinnarviksberget", row5);
154
+
155
+ AddSkyboxButton("rocky", "Tantolunden6", row5);
156
+ AddSkyboxButton("default", "CloudyHills", row6);
157
+ AddSkyboxButton("daz", "Autumn", row6);
158
+ AddSkyboxButton("daz", "MountainTrail", row6);
159
+ /*
160
+Autumn
161
+Greenlands
162
+MountainTrail
163
+Oasis
164
+TheRock
165
+TopOfTheWorld
166
+Winter
167
+ */
168
+
169
+ tab0.add(row0);
170
+ tab0.add(row1);
171
+ tab0.add(row2);
172
+ tab0.add(row3);
173
+ tab0.add(row4);
174
+ tab0.add(row5);
175
+ tab0.add(row6);
176
+
177
+ for (int i=5; --i>=0;)
178
+ {
179
+ //oe.toolboxPanel.Return();
180
+ //tab0.add(new cGridBag());
181
+ }
182
+ }
183
+
184
+ public void AddSkyboxTab2(JTabbedPane skyboxpanel)
185
+ {
186
+ cGridBag tab0 = new cGridBag().setVertical(true);
187
+
188
+ tab0.setName("Night");
189
+ skyboxpanel.add(tab0);
190
+
191
+ cGridBag row0 = new cGridBag();
192
+ cGridBag row1 = new cGridBag();
193
+ cGridBag row2 = new cGridBag();
194
+ cGridBag row3 = new cGridBag();
195
+ cGridBag row4 = new cGridBag();
196
+ cGridBag row5 = new cGridBag();
197
+ cGridBag row6 = new cGridBag();
198
+
199
+ AddSkyboxButton("night", "NightPath", row0);
200
+ AddSkyboxButton("night", "PondNight", row0);
201
+ AddSkyboxButton("night", "Powerlines", row0);
202
+ AddSkyboxButton("night", "SwedishRoyalCastle", row0);
203
+
204
+ AddSkyboxButton("urban", "CNTower", row1);
205
+ AddSkyboxButton("bridge", "ArstaBridge", row1);
206
+ AddSkyboxButton("rocky", "Riddarfjarden", row1);
207
+ AddSkyboxButton("penguins", "sleepyhollow", row1);
208
+
209
+ AddSkyboxButton("penguins", "kenon_star", row2);
210
+ AddSkyboxButton("persson", "corona", row2);
211
+ AddSkyboxButton("persson", "spaceskybox", row2);
212
+ AddSkyboxButton("indoors", "Vasa", row2);
213
+
214
+ AddSkyboxButton("winter", "Backyard", row3);
215
+ AddSkyboxButton("winter", "Creek", row3);
216
+ AddSkyboxButton("winter", "FootballField3", row3);
217
+ AddSkyboxButton("winter", "Forest", row3);
218
+
219
+ AddSkyboxButton("winter", "HornstullsStrand2", row4);
220
+ AddSkyboxButton("winter", "House", row4);
221
+ AddSkyboxButton("winter", "IceLake", row4);
222
+ AddSkyboxButton("winter", "IceRiver", row4);
223
+
224
+ AddSkyboxButton("winter", "Park3", row5);
225
+ AddSkyboxButton("winter", "PondWinter", row5);
226
+ AddSkyboxButton("winter", "Tantolunden5", row5);
227
+ AddSkyboxButton("winter", "Vindelalven", row5);
228
+
229
+ AddSkyboxButton("daz", "TheRock", row6);
230
+ AddSkyboxButton("daz", "TopOfTheWorld", row6);
231
+ AddSkyboxButton("daz", "Winter", row6);
232
+ AddSkyboxButton("mountain", "Ryfjallet", row6);
233
+
234
+ tab0.add(row0);
235
+ tab0.add(row1);
236
+ tab0.add(row2);
237
+ tab0.add(row3);
238
+ tab0.add(row4);
239
+ tab0.add(row5);
240
+ tab0.add(row6);
241
+
242
+ for (int i=5; --i>=0;)
243
+ {
244
+ //oe.toolboxPanel.Return();
245
+ //tab0.add(new cGridBag());
246
+ }
247
+ }
248
+
249
+ public void AddSkyboxTab3(JTabbedPane skyboxpanel)
250
+ {
251
+ cGridBag tab0 = new cGridBag().setVertical(true);
252
+
253
+ tab0.setName("Others");
254
+ skyboxpanel.add(tab0);
255
+
256
+ cGridBag row0 = new cGridBag();
257
+ cGridBag row1 = new cGridBag();
258
+ cGridBag row2 = new cGridBag();
259
+ cGridBag row3 = new cGridBag();
260
+ cGridBag row4 = new cGridBag();
261
+ cGridBag row5 = new cGridBag();
262
+ cGridBag row6 = new cGridBag();
263
+
264
+ AddSkyboxButton("mayhem", "afterrain", row0);
265
+ AddSkyboxButton("mayhem", "aqua4", row0);
266
+ AddSkyboxButton("mayhem", "aqua9", row0);
267
+ AddSkyboxButton("mayhem", "flame", row0);
268
+
269
+ AddSkyboxButton("mayhem", "h2s", row1);
270
+ AddSkyboxButton("mayhem", "prehistoric", row1);
271
+ AddSkyboxButton("mayhem", "scorched", row1);
272
+ AddSkyboxButton("penguins", "desertdawn", row1);
273
+
274
+ AddSkyboxButton("persson", "Citadella", row2);
275
+ AddSkyboxButton("persson", "Citadella2", row2);
276
+ AddSkyboxButton("persson", "clouds1", row2);
277
+ AddSkyboxButton("penguins", "wrath", row2);
278
+
279
+ AddSkyboxButton("persson", "FishermansBastion", row3);
280
+ AddSkyboxButton("persson", "HeroesSquare", row3);
281
+ AddSkyboxButton("indoors", "DallasW", row3);
282
+ AddSkyboxButton("indoors", "MarriottMadisonWest", row3);
283
+
284
+ AddSkyboxButton("persson", "LancellottiChapel", row4);
285
+ AddSkyboxButton("persson", "PereaBeach1", row4);
286
+ AddSkyboxButton("persson", "PereaBeach2", row4);
287
+ AddSkyboxButton("persson", "redeclipse", row4);
288
+
289
+ AddSkyboxButton("daz", "Greenlands", row5);
290
+ AddSkyboxButton("daz", "Oasis", row5);
291
+ AddSkyboxButton("elyvisions", "arch3", row5);
292
+ AddSkyboxButton("elyvisions", "calm_sea", row5);
293
+
294
+ AddSkyboxButton("elyvisions", "rainbow", row6);
295
+ AddSkyboxButton("elyvisions", "distant_sunset", row6);
296
+ AddSkyboxButton("elyvisions", "heaven", row6);
297
+ AddSkyboxButton("elyvisions", "hot", row6);
298
+
299
+ tab0.add(row0);
300
+ tab0.add(row1);
301
+ tab0.add(row2);
302
+ tab0.add(row3);
303
+ tab0.add(row4);
304
+ tab0.add(row5);
305
+ tab0.add(row6);
306
+
307
+ for (int i=5; --i>=0;)
308
+ {
309
+ //oe.toolboxPanel.Return();
310
+ //tab0.add(new cGridBag());
311
+ }
312
+ }
313
+
314
+ public void ChangeSkybox(String name)
315
+ {
316
+ //cameraView.envyoff = false;
317
+ group.skyboxname = name;
318
+ group.skyboxext = "jpg";
319
+ cameraView.repaint();
320
+ }
321
+
25322 //ObjEditor objEditor;
26323 public void closeUI2()
27324 {
....@@ -59,6 +356,12 @@
59356 this.copy = this.group = group;
60357 //selectees = this.group.selectees;
61358
359
+ if (copy.versions == null)
360
+ {
361
+ copy.versions = new byte[100][];
362
+ copy.versionindex = -1;
363
+ }
364
+
62365 if(ui)
63366 SetupUI(objEditor);
64367 }
....@@ -73,17 +376,29 @@
73376 this.copy = this.group = copy;
74377 //selectees = this.group.selectees;
75378
76
- SetupMenu2(objEditor);
379
+ SetupMenu2(this); //objEditor);
77380 SetupUI2(objEditor);
78381 objEditor.SetupUI(true);
79382 SetupViews(objEditor);
80383
81384 ((cRadio)radioPanel.getComponent(0)).SetCamera(cameraView.renderCamera, true);
385
+
386
+ if (copy.versions == null)
387
+ {
388
+ copy.versions = new byte[100][];
389
+ copy.versionindex = -1;
390
+
391
+ Save(true);
392
+ }
82393 }
83394
84395 void CloneSelection(boolean supports)
85396 {
86
- // Object3D keep = GraphreeD.clipboard;
397
+ if (Globals.REPLACEONMAKE)
398
+ Save();
399
+ boolean keep = Globals.REPLACEONMAKE;
400
+ Globals.REPLACEONMAKE = false;
401
+ // Object3D keep = GrafreeD.clipboard;
87402 //Object3D obj;
88403 for (int i=0; i<group.selection.size(); i++)// Enumeration e = group.selection.elements(); e.hasMoreElements();)
89404 {
....@@ -93,18 +408,19 @@
93408
94409 makeSomething(clone, i==group.selection.size()-1);
95410 }
411
+ Globals.REPLACEONMAKE = keep;
96412 }
97413
98414 void CloneClipboard(boolean supports)
99415 {
100
- assert(GraphreeD.clipboard.parent == null);
101
- Object3D /*Composite*/ keepparent = GraphreeD.clipboard.get(0).parent;
102
- GraphreeD.clipboard.get(0).parent = null; // Avoid copy?
103
- if (LA.isIdentity(GraphreeD.clipboard.toParent))
104
- makeSomething(CloneObject(GraphreeD.clipboard.get(0), false));
416
+ assert(Grafreed.clipboard.parent == null);
417
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
418
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
419
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
420
+ makeSomething(CloneObject(Grafreed.clipboard.get(0), false));
105421 else
106
- makeSomething(CloneObject(GraphreeD.clipboard, false));
107
- GraphreeD.clipboard.get(0).parent = keepparent;
422
+ makeSomething(CloneObject(Grafreed.clipboard, false));
423
+ Grafreed.clipboard.get(0).parent = keepparent;
108424 }
109425
110426 static Object3D CloneObject(Object3D obj, boolean supports)
....@@ -118,7 +434,7 @@
118434 // obj.support = null;
119435 if (!supports)
120436 obj.SaveSupports();
121
- Object3D clone = (Object3D)GraphreeD.clone(obj);
437
+ Object3D clone = (Object3D)Grafreed.clone(obj);
122438 obj.parent = parent;
123439 // obj.support = support;
124440 // clone.support = support; // aout 2013
....@@ -147,30 +463,29 @@
147463
148464 //JTextField nameField;
149465
150
- void SetupMenu2(ObjEditor oe)
466
+ void SetupMenu2(GroupEditor oe)
151467 {
152
- oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
153
- //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
154
- //cameraMenu.add(switchItem = new MenuItem("Reverse View"));
155
- editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf"));
156
- oe.cameraMenu.add("-");
157
- openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy..."));
158
- openWindowItem.addActionListener(this);
159
- editLeafItem.addActionListener(this);
160
- lookAtItem.addActionListener(this);
161
- //lookFromItem.addActinoListener(this);
162
- //switchItem.addActionListener(this);
468
+ oe.jTree = new cTree();
469
+
163470 Menu menu;
164471 oe.menuBar.add(menu = new Menu("Edit"));
165472 //editItem = menu.add(new MenuItem("Edit"));
166473 //editItem.addActionListener(this);
167
- duplicateItem = menu.add(new MenuItem("Duplicate"));
474
+
475
+// undoItem = menu.add(new MenuItem("Undo"));
476
+// undoItem.addActionListener(this);
477
+// redoItem = menu.add(new MenuItem("Redo"));
478
+// redoItem.addActionListener(this);
479
+// menu.add("-");
480
+ duplicateItem = oe.jTree.popup.add(new JMenuItem("Duplicate"));
168481 duplicateItem.addActionListener(this);
169
- menu.add("-");
170482 cloneItem = menu.add(new MenuItem("Clone"));
171483 cloneItem.addActionListener(this);
484
+ if (Globals.ADVANCED)
485
+ {
172486 cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
173487 cloneSupportItem.addActionListener(this);
488
+ }
174489 menu.add("-");
175490 cutItem = menu.add(new MenuItem("Cut"));
176491 cutItem.addActionListener(this);
....@@ -178,27 +493,123 @@
178493 copyItem.addActionListener(this);
179494 pasteItem = menu.add(new MenuItem("Paste"));
180495 pasteItem.addActionListener(this);
496
+
497
+ menu.add("-");
498
+ pasteIntoItem = menu.add(new MenuItem("Paste into"));
499
+ pasteIntoItem.addActionListener(this);
181500 pasteLinkItem = menu.add(new MenuItem("Paste link"));
182501 pasteLinkItem.addActionListener(this);
183502 pasteCloneItem = menu.add(new MenuItem("Paste clone"));
184503 pasteCloneItem.addActionListener(this);
185504 // pasteExpandItem = menu.add(new MenuItem("Paste expand"));
186505 // pasteExpandItem.addActionListener(this);
187
- clearItem = menu.add(new MenuItem("Clear"));
188
- clearItem.addActionListener(this);
506
+ menu.add("-");
507
+ deleteItem = menu.add(new MenuItem("Delete"));
508
+ deleteItem.addActionListener(this);
509
+
510
+ if (Globals.ADVANCED)
511
+ {
512
+ // Deletes the cameras...
189513 clearAllItem = menu.add(new MenuItem("Clear All"));
190514 clearAllItem.addActionListener(this);
515
+ }
516
+
517
+ menuBar.add(cameraMenu = new Menu("View"));
518
+ //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer"));
519
+ //zBufferItem.addActionListener(this);
520
+ //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens"));
521
+ //normalLensItem.addActionListener(this);
522
+ cameraMenu.add(restoreCameraItem = new MenuItem("Restore Viewpoint"));
523
+ restoreCameraItem.addActionListener(this);
524
+
525
+// cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen"));
526
+// toggleFullScreenItem.addItemListener(this);
527
+// toggleFullScreenItem.setState(CameraPane.FULLSCREEN);
528
+// cameraMenu.add("-");
529
+//
530
+// cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture"));
531
+// toggleTextureItem.addItemListener(this);
532
+// toggleTextureItem.setState(CameraPane.textureon);
533
+//
534
+// cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch"));
535
+// toggleSwitchItem.addItemListener(this);
536
+// toggleSwitchItem.setState(CameraPane.SWITCH);
537
+
538
+ cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Show Handles"));
539
+ toggleHandleItem.addItemListener(this);
540
+ toggleHandleItem.setState(CameraPane.HANDLES);
541
+
542
+ cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode"));
543
+ togglePaintItem.addItemListener(this);
544
+ togglePaintItem.setState(CameraPane.PAINTMODE);
545
+
546
+ if (Globals.ADVANCED)
547
+ {
548
+ cameraMenu.add("-");
549
+ cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live"));
550
+ toggleLiveItem.addItemListener(this);
551
+ toggleLiveItem.setState(Globals.isLIVE());
191552
553
+ cameraMenu.add(stepItem = new MenuItem("Step"));
554
+ stepItem.addActionListener(this);
555
+ // cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List"));
556
+ // toggleDLItem.addItemListener(this);
557
+ // toggleDLItem.setState(false);
558
+
559
+ cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render"));
560
+ toggleRenderItem.addItemListener(this);
561
+ toggleRenderItem.setState(!CameraPane.frozen);
562
+
563
+ cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug"));
564
+ toggleDebugItem.addItemListener(this);
565
+ toggleDebugItem.setState(Globals.DEBUG);
566
+
567
+ cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum"));
568
+ toggleFrustumItem.addItemListener(this);
569
+ toggleFrustumItem.setState(CameraPane.FRUSTUM);
570
+
571
+ cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact"));
572
+ toggleFootContactItem.addItemListener(this);
573
+ toggleFootContactItem.setState(CameraPane.FOOTCONTACT);
574
+
575
+ cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline"));
576
+ toggleTimelineItem.addItemListener(this);
577
+ }
578
+
579
+// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root"));
580
+// toggleRootItem.addItemListener(this);
581
+// toggleRootItem.setState(false);
582
+// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation"));
583
+// animationItem.addItemListener(this);
584
+// animationItem.setState(CameraPane.ANIMATION);
585
+ cameraMenu.add("-");
586
+ cameraMenu.add(editCameraItem = new MenuItem("Save Viewpoint"));
587
+ editCameraItem.addActionListener(this);
588
+
589
+ if (Globals.ADVANCED)
590
+ {
591
+ oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
592
+ //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
593
+ //cameraMenu.add(switchViewItem = new MenuItem("Reverse View"));
594
+ editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf"));
595
+ oe.cameraMenu.add("-");
596
+ openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy..."));
597
+ openWindowItem.addActionListener(this);
598
+ editLeafItem.addActionListener(this);
599
+ lookAtItem.addActionListener(this);
600
+ //lookFromItem.addActinoListener(this);
601
+ //switchViewItem.addActionListener(this);
602
+ }
603
+
192604 oe.menuBar.add(menu = new Menu("Setting"));
193
- resetMeshItem = menu.add(new MenuItem("Reset All"));
194
- resetMeshItem.addActionListener(this);
195
- stepAllItem = menu.add(new MenuItem("Step All"));
196
- stepAllItem.addActionListener(this);
605
+ if (Globals.ADVANCED)
606
+ {
197607 revertMeshItem = menu.add(new MenuItem("Revert Meshes"));
198608 revertMeshItem.addActionListener(this);
199609 resetreferencesItem = menu.add(new MenuItem("Reset Mesh References"));
200610 resetreferencesItem.addActionListener(this);
201611 menu.add("-");
612
+ }
202613 overwriteGeoItem = menu.add(new MenuItem("Overwrite Geometry"));
203614 overwriteGeoItem.addActionListener(this);
204615 overwriteMatItem = menu.add(new MenuItem("Overwrite Material"));
....@@ -210,73 +621,104 @@
210621 overwriteUVItem = menu.add(new MenuItem("Overwrite UV"));
211622 overwriteUVItem.addActionListener(this);
212623 menu.add("-");
624
+ if (Globals.ADVANCED)
625
+ {
213626 generateMeshItem = menu.add(new MenuItem("Generate Meshes"));
214627 generateMeshItem.addActionListener(this);
215628 poseMeshItem = menu.add(new MenuItem("Set Pose Meshes"));
216629 poseMeshItem.addActionListener(this);
217630 menu.add("-");
631
+ }
218632 resetsupportItem = menu.add(new MenuItem("Reset support"));
219633 resetsupportItem.addActionListener(this);
220634 linkverticesItem = menu.add(new MenuItem("Link to Support"));
221635 linkverticesItem.addActionListener(this);
636
+ relinkverticesItem = menu.add(new MenuItem("Re-link to Support"));
637
+ relinkverticesItem.addActionListener(this);
638
+
639
+ if (Globals.ADVANCED)
640
+ {
222641 setMasterItem = menu.add(new MenuItem("Set Master Mesh"));
223642 setMasterItem.addActionListener(this);
643
+ }
224644
225645 oe.menuBar.add(menu = new Menu("Group"));
226
- grabItem = menu.add(new MenuItem("Grab"));
227
- grabItem.addActionListener(this);
228
- frontItem = menu.add(new MenuItem("Front"));
229
- frontItem.addActionListener(this);
646
+// grabItem = menu.add(new MenuItem("Grab"));
647
+// grabItem.addActionListener(this);
230648 backItem = menu.add(new MenuItem("Back"));
231649 backItem.addActionListener(this);
232
- compositeItem = menu.add(new MenuItem("Composite"));
233
- compositeItem.addActionListener(this);
234
- menu.add("-");
235
- randomItem = menu.add(new MenuItem("Random"));
236
- randomItem.addActionListener(this);
237
- physicsItem = menu.add(new MenuItem("Physics"));
238
- physicsItem.addActionListener(this);
239
- frameselectorItem = menu.add(new MenuItem("Frame Selector"));
240
- frameselectorItem.addActionListener(this);
650
+ frontItem = menu.add(new MenuItem("Front"));
651
+ frontItem.addActionListener(this);
652
+// compositeItem = menu.add(new MenuItem("Composite"));
653
+// compositeItem.addActionListener(this);
654
+
655
+ if (Globals.ADVANCED)
656
+ {
657
+ hideItem = menu.add(new MenuItem("Hidden Group"));
658
+ hideItem.addActionListener(this);
659
+ }
660
+ ungroupItem = menu.add(new MenuItem("Ungroup"));
661
+ ungroupItem.addActionListener(this);
662
+
663
+// menu.add("-");
664
+//
665
+// switchItem = menu.add(new MenuItem("Switch node"));
666
+// switchItem.addActionListener(this);
667
+ if (Globals.ADVANCED)
668
+ {
241669 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
242670 switchGeoItem.addActionListener(this);
243671 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
244672 switchTransfoItem.addActionListener(this);
245
- morphItem = menu.add(new MenuItem("Morph"));
673
+ morphItem = menu.add(new MenuItem("Morph Group"));
246674 morphItem.addActionListener(this);
675
+
676
+ menu.add("-");
677
+ physicsItem = menu.add(new MenuItem("Physics"));
678
+ physicsItem.addActionListener(this);
679
+ frameselectorItem = menu.add(new MenuItem("Frame Selector"));
680
+ frameselectorItem.addActionListener(this);
247681 scriptNodeItem = menu.add(new MenuItem("Script Node"));
248682 scriptNodeItem.addActionListener(this);
249
- cameraItem = menu.add(new MenuItem("Camera"));
250
- cameraItem.addActionListener(this);
683
+ }
251684
252685 oe.menuBar.add(menu = new Menu("Object"));
253
- textureItem = menu.add(new MenuItem("Texture"));
254
- textureItem.addActionListener(this);
686
+// textureItem = menu.add(new MenuItem("Texture"));
687
+// textureItem.addActionListener(this);
688
+ billboardItem = menu.add(new MenuItem("Billboard"));
689
+ billboardItem.addActionListener(this);
255690 csgItem = menu.add(new MenuItem("CSG"));
256691 csgItem.addActionListener(this);
257
- shadowXItem = menu.add(new MenuItem("Shadow X"));
692
+ shadowXItem = menu.add(new MenuItem("Shadow Red"));
258693 shadowXItem.addActionListener(this);
259
- shadowYItem = menu.add(new MenuItem("Shadow Y"));
694
+ shadowYItem = menu.add(new MenuItem("Shadow Green"));
260695 shadowYItem.addActionListener(this);
261
- shadowZItem = menu.add(new MenuItem("Shadow Z"));
696
+ shadowZItem = menu.add(new MenuItem("Shadow Blue"));
262697 shadowZItem.addActionListener(this);
698
+ attributeItem = menu.add(new MenuItem("Attribute"));
699
+ attributeItem.addActionListener(this);
700
+
701
+ if (Globals.ADVANCED)
702
+ {
703
+ menu.add("-");
263704 linkerItem = menu.add(new MenuItem("Linker"));
264705 linkerItem.addActionListener(this);
265706 templateItem = menu.add(new MenuItem("Template"));
266707 templateItem.addActionListener(this);
267
- attributeItem = menu.add(new MenuItem("Attribute"));
268
- attributeItem.addActionListener(this);
269708 pointflowItem = menu.add(new MenuItem("Point Flow"));
270709 pointflowItem.addActionListener(this);
710
+ }
271711 menu.add("-");
272
- transformgeometryItem = menu.add(new MenuItem("Transform Geometry"));
273
- transformgeometryItem.addActionListener(this);
274712 resetTransformItem = menu.add(new MenuItem("Reset Transform"));
275713 resetTransformItem.addActionListener(this);
276714 resetCentroidItem = menu.add(new MenuItem("Reset Centroid"));
277715 resetCentroidItem.addActionListener(this);
278
- ungroupItem = menu.add(new MenuItem("Ungroup"));
279
- ungroupItem.addActionListener(this);
716
+ resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY"));
717
+ resetCentroidXZItem.addActionListener(this);
718
+ transformGeometryItem = menu.add(new MenuItem("Transform Geometry"));
719
+ transformGeometryItem.addActionListener(this);
720
+ transformChildrenItem = menu.add(new MenuItem("Transform Children"));
721
+ transformChildrenItem.addActionListener(this);
280722
281723 oe.menuBar.add(menu = new Menu("Geometry"));
282724 genUVItem = menu.add(new MenuItem("Generate UV"));
....@@ -285,6 +727,13 @@
285727 genNormalsORGANItem.addActionListener(this);
286728 genNormalsCADItem = menu.add(new MenuItem("CAD Normals"));
287729 genNormalsCADItem.addActionListener(this);
730
+ genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals"));
731
+ genNormalsMESHItem.addActionListener(this);
732
+ if (Globals.ADVANCED)
733
+ {
734
+ genNormalsMINEItem = menu.add(new MenuItem("Stitch Normals"));
735
+ genNormalsMINEItem.addActionListener(this);
736
+ }
288737 stripifyItem = menu.add(new MenuItem("Stripify"));
289738 stripifyItem.addActionListener(this);
290739 unstripifyItem = menu.add(new MenuItem("Unstripify"));
....@@ -306,23 +755,34 @@
306755 reduce34MeshItem.addActionListener(this);
307756 increaseMeshItem = menu.add(new MenuItem("Increase mesh"));
308757 increaseMeshItem.addActionListener(this);
309
- smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
310
- smoothMeshItem.addActionListener(this);
311758 clipMeshItem = menu.add(new MenuItem("Clip mesh"));
312759 clipMeshItem.addActionListener(this);
760
+
761
+ if (Globals.ADVANCED)
762
+ {
763
+ smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
764
+ smoothMeshItem.addActionListener(this);
765
+ }
313766
314767 oe.menuBar.add(menu = new Menu("Attributes"));
315768 clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
316769 clearMaterialsItem.addActionListener(this);
770
+ resetAllItem = menu.add(new MenuItem("Reset All"));
771
+ resetAllItem.addActionListener(this);
772
+ stepAllItem = menu.add(new MenuItem("Step All"));
773
+ stepAllItem.addActionListener(this);
317774 menu.add("-");
318775 liveleavesItem = menu.add(new MenuItem("Live Leaves"));
319776 liveleavesItem.addActionListener(this);
320777 unliveleavesItem = menu.add(new MenuItem("Unlive Leaves"));
321778 unliveleavesItem.addActionListener(this);
779
+ if (Globals.ADVANCED)
780
+ {
322781 supportleavesItem = menu.add(new MenuItem("Support Leaves"));
323782 supportleavesItem.addActionListener(this);
324783 unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves"));
325784 unsupportleavesItem.addActionListener(this);
785
+ }
326786 hideleavesItem = menu.add(new MenuItem("Hide Leaves"));
327787 hideleavesItem.addActionListener(this);
328788 showleavesItem = menu.add(new MenuItem("Show Leaves"));
....@@ -331,6 +791,14 @@
331791 markleavesItem.addActionListener(this);
332792 unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves"));
333793 unmarkleavesItem.addActionListener(this);
794
+ rewindleavesItem = menu.add(new MenuItem("Rewind Leaves"));
795
+ rewindleavesItem.addActionListener(this);
796
+ unrewindleavesItem = menu.add(new MenuItem("Unrewind Leaves"));
797
+ unrewindleavesItem.addActionListener(this);
798
+ randomleavesItem = menu.add(new MenuItem("Random Leaves"));
799
+ randomleavesItem.addActionListener(this);
800
+ unrandomleavesItem = menu.add(new MenuItem("Unrandom Leaves"));
801
+ unrandomleavesItem.addActionListener(this);
334802 menu.add("-");
335803 flipVItem = menu.add(new MenuItem("Flip V"));
336804 flipVItem.addActionListener(this);
....@@ -356,45 +824,56 @@
356824 attachBumpItem.addActionListener(this);
357825 pigmentBumpItem = menu.add(new MenuItem("Pigment -> Bump"));
358826 pigmentBumpItem.addActionListener(this);
827
+ //embedTexturesItem
359828 detachPigmentItem = menu.add(new MenuItem("Detach Pigment"));
360829 detachPigmentItem.addActionListener(this);
361830 detachBumpItem = menu.add(new MenuItem("Detach Bump"));
362831 detachBumpItem.addActionListener(this);
832
+ embedTexturesItem = menu.add(new MenuItem("Embed Textures"));
833
+ embedTexturesItem.addActionListener(this);
834
+ deEmbedTexturesItem = menu.add(new MenuItem("De-embed Textures"));
835
+ deEmbedTexturesItem.addActionListener(this);
363836 menu.add("-");
364837 sortbysizeItem = menu.add(new MenuItem("Sort by size"));
365838 sortbysizeItem.addActionListener(this);
366839 sortbynameItem = menu.add(new MenuItem("Sort by name"));
367840 sortbynameItem.addActionListener(this);
368841 menu.add("-");
842
+ shareGeometriesItem = menu.add(new MenuItem("Share Geometries"));
843
+ shareGeometriesItem.addActionListener(this);
844
+ mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries"));
845
+ mergeGeometriesItem.addActionListener(this);
846
+ if (Globals.ADVANCED)
847
+ {
848
+ // Pretty much the same as duplicate and clone.
369849 extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
370850 extractGeometriesItem.addActionListener(this);
371851 cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry"));
372852 cloneGeometriesItem.addActionListener(this);
373
- shareGeometriesItem = menu.add(new MenuItem("Share Geometry"));
374
- shareGeometriesItem.addActionListener(this);
375
- mergeGeometriesItem = menu.add(new MenuItem("Merge Geometry"));
376
- mergeGeometriesItem.addActionListener(this);
853
+ }
377854
378855 oe.menuBar.add(menu = new Menu("Insert"));
379856 buildCreateMenu(menu);
380857
381
-
382
- oe.menuBar.add(menu = new Menu("Include"));
383
- importGFDItem = menu.add(new MenuItem("GraphreeD Object..."));
384
- importGFDItem.addActionListener(this);
385
- importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D Object..."));
386
- importVRMLX3DItem.addActionListener(this);
387
- importOBJItem = menu.add(new MenuItem("OBJ Object..."));
388
- importOBJItem.addActionListener(this);
389
- import3DSItem = menu.add(new MenuItem("3DS Object..."));
390
- import3DSItem.addActionListener(this);
391
-
392858 oe.menuBar.add(menu = new Menu("Tools"));
393859 buildToolsMenu(menu);
394860 }
395861
862
+
396863 void SetupUI2(ObjEditor oe)
397864 {
865
+ // June 2019
866
+ if (oe == null)
867
+ {
868
+ //super.SetupUI2(this);
869
+ //return;
870
+ }
871
+
872
+ if (copy != group)
873
+ {
874
+ //super.SetupUI2(this);
875
+ }
876
+
398877 //new Exception().printStackTrace();
399878
400879 oe.radioPanel = new JPanel(new GridBagLayout());
....@@ -423,150 +902,239 @@
423902 oe.radioPanel.add(dummyButton);
424903 oe.buttonGroup.add(dummyButton);
425904 */
426
- aConstraints.gridy += 1;
427
- oe.aConstraints.gridwidth = 1;
428
- oe.aConstraints.gridx = 0;
905
+ cGridBag copyOptionsPanel = new cGridBag();
906
+
907
+ copyOptionsPanel.preferredHeight = 2;
429908
430
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", CameraPane.isLIVE()), oe.aConstraints);
909
+ //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
910
+
911
+ //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
912
+ //minButton.setToolTipText("Minimize window");
913
+ //minButton.addActionListener(this);
914
+
915
+ if (Globals.ADVANCED)
916
+ {
917
+ oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
918
+ maxButton.setToolTipText("Maximize window");
919
+ maxButton.addActionListener(this);
920
+ }
921
+
922
+ oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
923
+ fullButton.setToolTipText("Full-screen window");
924
+ fullButton.addActionListener(this);
925
+
926
+ oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
927
+ screenfitButton.setToolTipText("Screen fit");
928
+ screenfitButton.addActionListener(this);
929
+
930
+ oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
931
+ restoreCameraButton.setToolTipText("Restore viewpoint");
932
+ restoreCameraButton.addActionListener(this);
933
+
934
+ copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
935
+ saveButton.setToolTipText("Duplicate current version");
936
+ saveButton.addActionListener(this);
937
+
938
+ copyOptionsPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
939
+ undoButton.setToolTipText("Previous version");
940
+ undoButton.addActionListener(this);
941
+ undoButton.setEnabled(false);
942
+
943
+ cGridBag updown = new cGridBag().setVertical(true);
944
+ updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
945
+ restoreButton.setToolTipText("Restore current version (undo latest change)");
946
+ restoreButton.addActionListener(this);
947
+ restoreButton.setEnabled(false);
948
+
949
+ updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
950
+ replaceButton.setToolTipText("Replace current version (save latest change)");
951
+ replaceButton.addActionListener(this);
952
+ replaceButton.setEnabled(false);
953
+
954
+ copyOptionsPanel.add(updown);
955
+
956
+ copyOptionsPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
957
+ redoButton.setToolTipText("Next version");
958
+ redoButton.addActionListener(this);
959
+ redoButton.setEnabled(false);
960
+
961
+ oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints);
962
+ liveCB.setToolTipText("Enable animation");
431963 liveCB.addItemListener(this);
432964
433
- oe.aConstraints.gridx += 1;
434
- oe.toolbarPanel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT), oe.aConstraints);
435
- supportCB.addItemListener(this);
436
-
437
- // oe.aConstraints.gridx += 1;
438
- // oe.toolbarPanel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), oe.aConstraints);
439
- // localCB.addItemListener(this);
440
-
441
- oe.aConstraints.gridx += 1;
442
- oe.toolbarPanel.add(crowdCB = new cCheckBox("Crowd", CameraPane.CROWD), oe.aConstraints);
443
- crowdCB.addItemListener(this);
444
-
445
- oe.aConstraints.gridx += 1;
446
- oe.toolbarPanel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA), oe.aConstraints);
447
- smoothCB.addItemListener(this);
448
-
449
- oe.aConstraints.gridx += 1;
450
- oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST), oe.aConstraints);
965
+ oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
966
+ oneStepButton.setToolTipText("Animate one step forward");
967
+ oneStepButton.addActionListener(this);
968
+
969
+ oe.toolbarPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints);
970
+ fastCB.setToolTipText("Fast mode");
451971 fastCB.addItemListener(this);
452
- oe.aConstraints.gridx += 1;
453
- oe.toolbarPanel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE), oe.aConstraints);
454
- slowCB.addItemListener(this);
455
- oe.aConstraints.gridx += 1;
456
- oe.toolbarPanel.add(boxCB = new cCheckBox("Box", CameraPane.FAST), oe.aConstraints);
457
- boxCB.addItemListener(this);
972
+
973
+ //oe.toolboxPanel.Return();
974
+
975
+// copyOptionsPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints);
976
+// trackCB.setToolTipText("Enable tracking");
977
+// trackCB.addItemListener(this);
458978
459
-// oe.aConstraints.gridx += 1;
460
-// oe.toolbarPanel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), oe.aConstraints);
461
-// speakerMocapCB.addItemListener(this);
462
-
463
- if (false)
464
- {
465
- // handled in scripts
466
- oe.aConstraints.gridx += 1;
467
- oe.toolbarPanel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA), oe.aConstraints);
468
- speakerCameraCB.addItemListener(this);
469
-
470
- oe.aConstraints.gridx += 1;
471
- oe.toolbarPanel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS), oe.aConstraints);
472
- speakerFocusCB.addItemListener(this);
473
-
474
- oe.aConstraints.gridx += 1;
475
- oe.toolbarPanel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS), oe.aConstraints);
476
- smoothfocusCB.addItemListener(this);
477
- }
478
-
479
-//oe.aConstraints.gridx += 1;
480
-//oe.toolbarPanel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), oe.aConstraints);
481
-// debugCB.addItemListener(this);
482
-
483
- oe.aConstraints.gridx += 1;
484
- oe.toolbarPanel.add(oeilCB = new cCheckBox("O", CameraPane.OEIL), oe.aConstraints);
485
- oeilCB.addItemListener(this);
486
-
487
- oe.aConstraints.gridx += 1;
488
- oe.toolbarPanel.add(lookAtCB = new cCheckBox("T", CameraPane.LOOKAT), oe.aConstraints);
489
- lookAtCB.addItemListener(this);
490
-
491
- oe.aConstraints.gridx += 1;
492
- oe.toolbarPanel.add(trackCB = new cCheckBox(":", CameraPane.TRACK), oe.aConstraints);
493
- trackCB.addItemListener(this);
494
-
495
- oe.aConstraints.gridx += 1;
496
- oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
497
- screenfitButton.addActionListener(this);
498
- oe.aConstraints.gridx += 1;
499979 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
500980 // screenfitpointButton.addActionListener(this);
501
-// oe.aConstraints.gridx += 1;
502
- oe.toolbarPanel.add(snapobjectButton = new cButton(" O+ ")); //, oe.aConstraints);
503
- snapobjectButton.addActionListener(this);
504
- oe.aConstraints.gridx += 1;
505981
506
- //aConstraints.gridx = 0;
507
- //aConstraints.gridy += 1;
508
- oe.aConstraints.weighty = 0;
509
- oe.aConstraints.gridwidth = 1;
510
-
511
- oe.toolbarPanel.add(flashSelectionButton = new cButton(" ? ")); //, oe.aConstraints);
512
- flashSelectionButton.addActionListener(this);
513
- oe.aConstraints.gridx += 1;
514
- oe.aConstraints.weighty = 0;
515
- oe.aConstraints.gridwidth = 1;
516
-
517
- //
518
- oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints);
519
- twoButton.addActionListener(this);
520
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
982
+ if (Globals.ADVANCED)
983
+ {
984
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
985
+ snapobjectButton.addActionListener(this);
986
+ snapobjectButton.setToolTipText("Snap Object");
987
+
988
+ oe.toolbarPanel.add(fourButton = GetButton("icons/controls-horizontal.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
521989 fourButton.addActionListener(this);
522
- oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
523
- sixButton.addActionListener(this);
524
- oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
990
+ fourButton.setToolTipText("Show control panel only");
991
+ }
992
+
993
+ //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
994
+
995
+ oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
996
+ twoButton.setToolTipText("Show 3D view only");
997
+ twoButton.addActionListener(this);
998
+ this.fullscreenLayout = twoButton;
999
+
1000
+ oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1001
+ threeButton.setToolTipText("Show controls and 3D view");
5251002 threeButton.addActionListener(this);
526
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
527
- sevenButton.addActionListener(this);
1003
+ oe.toolbarPanel.add(sixButton = GetButton("icons/viewcontrols.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1004
+ sixButton.setToolTipText("Show 3D view and controls");
1005
+ sixButton.addActionListener(this);
1006
+// oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1007
+// sevenButton.setToolTipText("3-column layout");
1008
+// sevenButton.addActionListener(this);
5281009 //
5291010
530
- oe.toolbarPanel.add(rootButton = new cButton(" o o o E ")); //, oe.aConstraints);
1011
+ oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1012
+ rootButton.setToolTipText("Open selection in new tab");
5311013 rootButton.addActionListener(this);
532
- oe.aConstraints.gridx += 1;
533
- oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
1014
+
1015
+ oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1016
+ closeButton.setToolTipText("Close tab");
5341017 closeButton.addActionListener(this);
5351018 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
5361019 //clearButton.addActionListener(this);
537
- oe.aConstraints.gridx += 1;
538
-
539
- oe.aConstraints.gridx = 1; //
540
- oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints);
541
- editButton.addActionListener(this);
542
- oe.aConstraints.gridx += 1;
543
- oe.aConstraints.weighty = 0;
544
- oe.aConstraints.gridwidth = 1;
5451020
546
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
1021
+ cGridBag row1 = new cGridBag();
1022
+
1023
+ // INSERT
1024
+ row1.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1025
+ gridButton.setToolTipText("Create grid");
1026
+ gridButton.addActionListener(this);
1027
+
1028
+ row1.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1029
+ boxButton.setToolTipText("Create box");
1030
+ boxButton.addActionListener(this);
1031
+
1032
+ row1.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1033
+ sphereButton.setToolTipText("Create sphere");
1034
+ sphereButton.addActionListener(this);
1035
+
1036
+ row1.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1037
+ coneButton.setToolTipText("Create cone");
1038
+ coneButton.addActionListener(this);
1039
+
1040
+ row1.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1041
+ torusButton.setToolTipText("Create torus");
1042
+ torusButton.addActionListener(this);
1043
+
1044
+ row1.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1045
+ superButton.setToolTipText("Create superellipsoid");
1046
+ superButton.addActionListener(this);
1047
+
1048
+ if (Globals.ADVANCED)
1049
+ {
1050
+ oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1051
+ kleinButton.setToolTipText("Create Klein bottle");
1052
+ kleinButton.addActionListener(this);
1053
+ }
1054
+
1055
+ row1.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1056
+ particlesButton.setToolTipText("Create particle system");
1057
+ particlesButton.addActionListener(this);
1058
+
1059
+ oe.toolboxPanel.add(row1);
1060
+
1061
+ cGridBag row2 = new cGridBag();
1062
+
1063
+ row2.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1064
+ groupButton.setToolTipText("Create group");
1065
+ groupButton.addActionListener(this);
1066
+
1067
+ row2.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1068
+ compositeButton.setToolTipText("Create composite");
1069
+ compositeButton.addActionListener(this);
1070
+
1071
+ row2.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1072
+ switchButton.setToolTipText("Create item switcher");
1073
+ switchButton.addActionListener(this);
1074
+
1075
+ row2.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1076
+ loopButton.setToolTipText("Create loop");
1077
+ loopButton.addActionListener(this);
1078
+
1079
+ row2.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1080
+ textureButton.setToolTipText("Create texture");
1081
+ textureButton.addActionListener(this);
1082
+
1083
+ row2.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1084
+ overlayButton.setToolTipText("Create overlay");
1085
+ overlayButton.addActionListener(this);
1086
+
1087
+ row2.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1088
+ lightButton.setToolTipText("Create light");
1089
+ lightButton.addActionListener(this);
1090
+
1091
+ oe.toolboxPanel.add(row2);
1092
+
1093
+ // ENVYMAPS
1094
+ cGridBag skyboxpane = new cGridBag();
1095
+ skyboxpane.preferredHeight = 100;
1096
+
1097
+ oe.toolboxPanel.add(skyboxpane);
1098
+
1099
+ JTabbedPane skyboxpanel = new JTabbedPane();
1100
+ skyboxpane.add(skyboxpanel);
1101
+
1102
+ AddSkyboxTab0(skyboxpanel);
1103
+ AddSkyboxTab1(skyboxpanel);
1104
+ AddSkyboxTab2(skyboxpanel);
1105
+ AddSkyboxTab3(skyboxpanel);
1106
+
1107
+ // EDIT panel
1108
+ editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1109
+ editButton.setToolTipText("Pin selection controls");
1110
+ editButton.addActionListener(this);
1111
+
1112
+ editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1113
+ uneditButton.setToolTipText("Remove selection controls");
5471114 uneditButton.addActionListener(this);
5481115
549
- oe.aConstraints.gridx += 1;
550
- oe.aConstraints.weighty = 0;
551
- oe.aConstraints.gridwidth = 1;
552
-
553
- oe.treePanel.add(clearPanelButton = new cButton("C"), oe.aConstraints);
554
- clearPanelButton.addActionListener(this);
555
-
556
- oe.aConstraints.gridx += 1;
557
- oe.aConstraints.weighty = 0;
558
- oe.aConstraints.gridwidth = 1;
559
-
560
- oe.treePanel.add(allParamsButton = new cButton("A"), oe.aConstraints);
1116
+ editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
1117
+ allParamsButton.setToolTipText("Show all controle");
5611118 allParamsButton.addActionListener(this);
5621119
563
- oe.aConstraints.gridx += 1;
564
- oe.aConstraints.weighty = 0;
565
- oe.aConstraints.gridwidth = 1;
566
-
567
- oe.treePanel.add(unselectButton = new cButton("U"), oe.aConstraints);
1120
+ editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1121
+ clearPanelButton.setToolTipText("Clear edit panel");
1122
+ clearPanelButton.addActionListener(this);
1123
+
1124
+ editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1125
+ unselectButton.setToolTipText("Unselect");
5681126 unselectButton.addActionListener(this);
5691127
1128
+ editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1129
+ flashSelectionButton.setToolTipText("Highlight selection");
1130
+ flashSelectionButton.addActionListener(this);
1131
+
1132
+ editCommandsPanel.preferredHeight = 1;
1133
+
1134
+ SetPinStates(false);
1135
+// oe.treePanel.add(commandsPanel);
1136
+// oe.treePanel.Return();
1137
+
5701138 // oe.aConstraints.gridx += 1;
5711139 // oe.aConstraints.weighty = 0;
5721140 // oe.aConstraints.gridwidth = 1;
....@@ -578,47 +1146,32 @@
5781146 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
5791147 // gcButton.addActionListener(this);
5801148
581
- oe.aConstraints.gridx = 0;
582
- oe.aConstraints.gridy += 1;
583
-
584
- //ctrlPanel.add(objList = new List(5, true));
585
- oe.aConstraints.gridwidth = 100;
586
- // oe.aConstraints.gridheight = 100;
587
- oe.aConstraints.fill = GridBagConstraints.BOTH; // HORIZONTAL;
588
- oe.aConstraints.gridheight = 1;
589
- oe.aConstraints.weighty = 0.5;
590
- oe.aConstraints.gridx = 0;
591
- JScrollPane jSP;
1149
+ cGridBag jSPPanel = new cGridBag();
1150
+
1151
+ JScrollPane jSP;
5921152 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
593
- oe.treePanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null)), oe.aConstraints);
1153
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints);
5941154 ResetModel();
595
- oe.aConstraints.weighty = 0.5;
596
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
597
- oe.aConstraints.gridy += 1;
598
- oe.aConstraints.gridwidth = 1;
599
-
600
- oe.aConstraints.weighty = 0;
601
- oe.aConstraints.gridwidth = 2;
602
-
603
- oe.treePanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0), oe.aConstraints);
604
- colorCB.addItemListener(this);
605
- oe.aConstraints.gridx += 2;
606
- oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints);
607
- materialCB.addItemListener(this);
608
- oe.aConstraints.gridx += 2;
609
- oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints);
610
- textureCB.addItemListener(this);
611
-
612
- oe.aConstraints.gridx = 0;
613
- oe.aConstraints.gridy += 1;
6141155
1156
+ oe.treePanel.add(jSPPanel);
1157
+ oe.treePanel.Return();
1158
+
1159
+ oe.treePanel.add(copyOptionsPanel);
1160
+ oe.treePanel.Return();
1161
+ cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0);
1162
+ versionSlider = (cNumberSlider)sliderPane.getComponent(1);
1163
+ sliderPane.preferredHeight = 1;
1164
+
1165
+// mainPanel.setDividerLocation(0.1); //1.0);
1166
+ mainPanel.setResizeWeight(0.4);
1167
+
6151168 //jList.addListSelectionListener(this);
6161169 oe.jTree.addTreeSelectionListener(this);
6171170 //jTree.setRootVisible(false);
6181171 //jTree.setEditable(true);
6191172 oe.jTree.setDragEnabled(true);
6201173 //jTree.setPreferredSize(new Dimension(10,10));
621
- jSP.setPreferredSize(new Dimension(100,200));
1174
+ //jSP.setPreferredSize(new Dimension(100,200));
6221175
6231176 oe.jTree.setCellRenderer(new cTreeModel.Renderer());
6241177
....@@ -630,23 +1183,163 @@
6301183 dgr.addDragGestureListener(this);
6311184 }catch(Exception e) {}
6321185 */
633
- radio.layout = sevenButton;
1186
+ radio.layout = threeButton; // sixButton;
6341187 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
6351188 }
1189
+
1190
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
1191
+ {
1192
+ panel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
1193
+ colorCB.setToolTipText("Copy color when dropped");
1194
+ colorCB.addItemListener(this);
1195
+
1196
+ panel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
1197
+ materialCB.setToolTipText("Copy material when dropped");
1198
+ materialCB.addItemListener(this);
1199
+
1200
+ panel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
1201
+ textureCB.setToolTipText("Copy texture when dropped");
1202
+ textureCB.addItemListener(this);
1203
+
1204
+ panel.Return();
1205
+
1206
+ panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
1207
+ boxCB.setToolTipText("Display bounding boxes");
1208
+ boxCB.addItemListener(this);
1209
+
1210
+ panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
1211
+ zoomBoxCB.setToolTipText("Display only for wheel");
1212
+ zoomBoxCB.addItemListener(this);
1213
+
1214
+ if (true) // Globals.ADVANCED)
1215
+ {
1216
+// panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
1217
+// supportCB.setToolTipText("Enable rigging");
1218
+// supportCB.addItemListener(this);
1219
+
1220
+ panel.add(freezeCB = new cCheckBox("Freeze", Globals.FREEZEONMOVE)); //, constraints);
1221
+ freezeCB.setToolTipText("Fast moving camera");
1222
+ freezeCB.addItemListener(this);
1223
+
1224
+ // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
1225
+ // localCB.addItemListener(this);
1226
+
1227
+ panel.Return();
1228
+
1229
+ panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
1230
+ crowdCB.setToolTipText("Used for crowds");
1231
+ crowdCB.addItemListener(this);
1232
+
1233
+ panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
1234
+ smoothCB.setToolTipText("Snapping delay");
1235
+ smoothCB.addItemListener(this);
1236
+
1237
+// panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
1238
+// slowCB.setToolTipText("Smooth interpolation");
1239
+// slowCB.addItemListener(this);
1240
+ panel.add(minshaderCB = new cCheckBox("Min shader", Globals.MINSHADER)); //, constraints);
1241
+ minshaderCB.setToolTipText("Minimal fast shader");
1242
+ minshaderCB.addItemListener(this);
1243
+
1244
+// constraints.gridy += 1;
1245
+// panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
1246
+// speakerMocapCB.addItemListener(this);
1247
+
1248
+ panel.Return();
1249
+
1250
+ if (false)
1251
+ {
1252
+ // handled in scripts
1253
+ //constraints.gridy += 1;
1254
+ panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints);
1255
+ speakerCameraCB.addItemListener(this);
1256
+
1257
+ //constraints.gridy += 1;
1258
+ panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints);
1259
+ speakerFocusCB.addItemListener(this);
1260
+
1261
+ //constraints.gridy += 1;
1262
+ panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
1263
+ smoothfocusCB.addItemListener(this);
1264
+ panel.Return();
1265
+ }
1266
+
1267
+//constraints.gridx += 1;
1268
+//panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
1269
+// debugCB.addItemListener(this);
1270
+
1271
+ panel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
1272
+ trackCB.setToolTipText("Enable tracking target");
1273
+ trackCB.addItemListener(this);
1274
+
1275
+ panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
1276
+ oeilCB.setToolTipText("Move camera when tracking");
1277
+ oeilCB.addItemListener(this);
1278
+
1279
+ panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints);
1280
+ shadowCB.setToolTipText("When live compute shadows");
1281
+ shadowCB.addItemListener(this);
1282
+
1283
+ panel.Return();
1284
+ panel.add(toggleTextureCB = new cCheckBox("Textures", CameraPane.textureon)); //, constraints);
1285
+ toggleTextureCB.setToolTipText("Load textures");
1286
+ toggleTextureCB.addItemListener(this);
1287
+
1288
+ panel.add(toggleSwitchCB = new cCheckBox("Switch", CameraPane.SWITCH)); //, constraints);
1289
+ toggleSwitchCB.setToolTipText("Choose a single item");
1290
+ toggleSwitchCB.addItemListener(this);
1291
+
1292
+ panel.add(autokeepCB = new cCheckBox("Auto-replace", Globals.REPLACEONMAKE)); //, constraints);
1293
+ autokeepCB.setToolTipText("On structure change");
1294
+ autokeepCB.addItemListener(this);
1295
+
1296
+ panel.Return();
1297
+ if (Globals.ADVANCED)
1298
+ {
1299
+ panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
1300
+ lookAtCB.setToolTipText("Look-at target");
1301
+ lookAtCB.addItemListener(this);
1302
+ }
1303
+
1304
+ }
1305
+
1306
+ cGridBag fill = new cGridBag();
1307
+ fill.preferredHeight = 200;
1308
+ cGridBag fill2 = new cGridBag();
1309
+ fill2.preferredHeight = 200;
1310
+ cGridBag fill3 = new cGridBag();
1311
+ fill3.preferredHeight = 200;
1312
+
1313
+ panel.add(fill);
1314
+ panel.add(fill2);
1315
+ panel.add(fill3);
1316
+
1317
+ }
6361318
6371319 void EditObject(Object3D obj)
6381320 {
639
- cRadio dummyButton = new cRadio(obj.name);
640
- dummyButton.SetObject(obj);
641
- dummyButton.layout = sevenButton;
642
- dummyButton.SetCamera(cameraView.renderCamera, false);
643
- dummyButton.addActionListener(this);
644
- radioPanel.add(dummyButton);
645
- buttonGroup.add(dummyButton);
646
- dummyButton.doClick();
1321
+ cRadio radioButton = new cRadio(obj.name);
1322
+
1323
+ // June 2019. Patch to avoid bug with transparency.
1324
+ radioButton.hadMaterial = obj.material != null;
1325
+ if (!radioButton.hadMaterial)
1326
+ {
1327
+ obj.material = new cMaterial();
1328
+ }
1329
+
1330
+ radioButton.SetObject(obj);
1331
+ radioButton.layout = threeButton; // sixButton;
1332
+ radioButton.SetCamera(cameraView.renderCamera, false);
1333
+ radioButton.addActionListener(this);
1334
+ radioPanel.add(radioButton);
1335
+ buttonGroup.add(radioButton);
1336
+ radioButton.doClick();
6471337 }
1338
+
6481339 void SetupViews(ObjEditor oe)
6491340 {
1341
+ theFrame = this;
1342
+
6501343 oe.SetupViews();
6511344
6521345 System.out.println("SetupViews");
....@@ -655,22 +1348,30 @@
6551348 /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this);
6561349 }
6571350
658
- JCheckBox liveCB;
659
- JCheckBox supportCB;
660
- JCheckBox localCB;
661
- JCheckBox crowdCB;
662
- JCheckBox smoothCB;
663
- JCheckBox fastCB;
664
- JCheckBox slowCB;
665
- JCheckBox boxCB;
666
- JCheckBox trackCB;
667
- JCheckBox smoothfocusCB;
1351
+ cToggleButton liveCB;
1352
+ cCheckBox supportCB;
1353
+ cCheckBox localCB;
1354
+ cCheckBox crowdCB;
1355
+ cCheckBox smoothCB;
1356
+ cCheckBox minshaderCB;
1357
+
1358
+ cToggleButton fastCB;
1359
+ cCheckBox slowCB;
1360
+ cCheckBox boxCB;
1361
+ cCheckBox zoomBoxCB;
1362
+ cCheckBox freezeCB;
1363
+ //cToggleButton trackCB;
1364
+ cCheckBox trackCB;
1365
+ cCheckBox smoothfocusCB;
6681366 // JCheckBox speakerMocapCB;
669
- JCheckBox speakerCameraCB;
670
- JCheckBox speakerFocusCB;
671
- JCheckBox debugCB;
672
- JCheckBox oeilCB;
673
- JCheckBox lookAtCB;
1367
+ cCheckBox speakerCameraCB;
1368
+ cCheckBox speakerFocusCB;
1369
+ cCheckBox debugCB;
1370
+
1371
+ cCheckBox oeilCB;
1372
+ cCheckBox shadowCB;
1373
+ cCheckBox autokeepCB;
1374
+ cCheckBox lookAtCB;
6741375
6751376 // static int COLOR = 1;
6761377 // static int MATERIAL = 2;
....@@ -678,9 +1379,9 @@
6781379
6791380 int dropAttributes = Object3D.COLOR | Object3D.MATERIAL;
6801381
681
- JCheckBox colorCB;
682
- JCheckBox materialCB;
683
- JCheckBox textureCB;
1382
+ cCheckBox colorCB;
1383
+ cCheckBox materialCB;
1384
+ cCheckBox textureCB;
6841385
6851386 public void itemStateChanged(ItemEvent e)
6861387 {
....@@ -705,10 +1406,10 @@
7051406 dropAttributes |= Object3D.TEXTURE;
7061407 else
7071408 dropAttributes &= ~Object3D.TEXTURE;
708
- }
709
- else if(e.getSource() == liveCB)
1409
+ } else if(e.getSource() == liveCB)
7101410 {
7111411 cameraView.ToggleLive();
1412
+ refreshContents(false);
7121413 }
7131414 else if(e.getSource() == supportCB)
7141415 {
....@@ -724,6 +1425,12 @@
7241425 {
7251426 cameraView.ToggleInertia();
7261427 cameraView.repaint();
1428
+ }
1429
+ else if(e.getSource() == minshaderCB)
1430
+ {
1431
+ Globals.MINSHADER ^= true;
1432
+ cameraView.programInitialized = false;
1433
+ cameraView.repaint();
7271434 }
7281435 else if(e.getSource() == localCB)
7291436 {
....@@ -743,6 +1450,10 @@
7431450 Recompile();
7441451 cameraView.repaint();
7451452 // refreshContents();
1453
+ }
1454
+ else if(e.getSource() == zoomBoxCB)
1455
+ {
1456
+ cameraView.ToggleZoomBoxMode();
7461457 }
7471458 else if(e.getSource() == smoothfocusCB)
7481459 {
....@@ -769,6 +1480,18 @@
7691480 {
7701481 cameraView.ToggleOeil();
7711482 }
1483
+ else if(e.getSource() == shadowCB)
1484
+ {
1485
+ Globals.COMPUTESHADOWWHENLIVE ^= true;
1486
+ }
1487
+ else if(e.getSource() == freezeCB)
1488
+ {
1489
+ Globals.FREEZEONMOVE ^= true;
1490
+ }
1491
+ else if(e.getSource() == autokeepCB)
1492
+ {
1493
+ Globals.REPLACEONMAKE ^= true;
1494
+ }
7721495 else if(e.getSource() == lookAtCB)
7731496 {
7741497 cameraView.ToggleLookAt();
....@@ -785,7 +1508,8 @@
7851508
7861509 /**/
7871510 //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this);
788
- TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1511
+ //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1512
+ TreePath path = objEditor.jTree.getSelectionPath();
7891513 if ((path == null) || (path.getPathCount() <= 1)) {
7901514 // We can't move the root node or an empty selection
7911515 return;
....@@ -848,8 +1572,6 @@
8481572 }
8491573 }
8501574
851
- String string = (String) object;
852
-
8531575 System.out.println("Transfer = " + object + "; drop : " + target);
8541576 // if( object instanceof java.io.File[])
8551577 // {
....@@ -857,7 +1579,11 @@
8571579 // objEditor.DropFile((java.io.File[]) object, true);
8581580 // return;
8591581 // }
860
- if (string.charAt(0) == '/')
1582
+
1583
+ String string = object.toString();
1584
+
1585
+ // File path for Mac and Windows
1586
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
8611587 {
8621588 // file(s)
8631589 String[] names = string.split("\n");
....@@ -884,7 +1610,7 @@
8841610
8851611 flashIt = false;
8861612 CameraPane pane = (CameraPane) target;
887
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1613
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
8881614 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
8891615
8901616 if (group.selection.size() == 1)
....@@ -900,23 +1626,33 @@
9001626
9011627 assert target == objEditor.jTree;
9021628 TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y);
1629
+ Object3D destinationLeaf;
9031630 try {
904
- Object3D dummy = (Composite) destinationPath.getLastPathComponent();
1631
+ destinationLeaf = (Composite) destinationPath.getLastPathComponent();
9051632 } catch (Exception e) {
9061633 System.out.println("destinationPath : " + destinationPath);
9071634 return;
9081635 }
9091636
910
- if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1637
+ for (int i=group.selection.size(); --i>=0;)
9111638 {
1639
+ Object3D child = (Object3D)group.selection.elementAt(i);
1640
+
1641
+ // Cannot move into itself
1642
+ if (child == destinationLeaf)
1643
+ return;
1644
+ }
1645
+
1646
+// june 2019 if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1647
+// {
9121648 loadClipboard(true);
9131649 objEditor.jTree.setSelectionPath(destinationPath);
914
- pasteInto(false);
915
- } else {
916
- loadClipboard(false);
917
- objEditor.jTree.setSelectionPath(destinationPath);
918
- pasteInto(false); // true); // ???
919
- }
1650
+ pasteInto(false, false);
1651
+// } else {
1652
+// loadClipboard(false);
1653
+// objEditor.jTree.setSelectionPath(destinationPath);
1654
+// pasteInto(false, false); // true); // ???
1655
+// }
9201656 }
9211657 public void dropActionChanged(DropTargetDragEvent dtde)
9221658 // Called if the user has modified the current drop gesture
....@@ -1021,83 +1757,107 @@
10211757 {
10221758 //heightFieldItem = menu.add(new MenuItem("Height Field"));
10231759 //heightFieldItem.addActionListener(this);
1024
- gridItem = menu.add(new MenuItem("Grid"));
1025
- gridItem.addActionListener(this);
1026
- rectoidItem = menu.add(new MenuItem("Box"));
1027
- rectoidItem.addActionListener(this);
1028
- ellipsoidItem = menu.add(new MenuItem("Sphere"));
1029
- ellipsoidItem.addActionListener(this);
1030
- coneItem = menu.add(new MenuItem("Cone"));
1031
- coneItem.addActionListener(this);
1032
- torusItem = menu.add(new MenuItem("Torus"));
1033
- torusItem.addActionListener(this);
1034
- superItem = menu.add(new MenuItem("Superellipsoid"));
1035
- superItem.addActionListener(this);
1036
- particleItem = menu.add(new MenuItem("Particle system"));
1037
- particleItem.addActionListener(this);
1760
+// gridItem = menu.add(new MenuItem("Grid"));
1761
+// gridItem.addActionListener(this);
1762
+// rectoidItem = menu.add(new MenuItem("Box"));
1763
+// rectoidItem.addActionListener(this);
1764
+// ellipsoidItem = menu.add(new MenuItem("Sphere"));
1765
+// ellipsoidItem.addActionListener(this);
1766
+// coneItem = menu.add(new MenuItem("Cone"));
1767
+// coneItem.addActionListener(this);
1768
+// torusItem = menu.add(new MenuItem("Torus"));
1769
+// torusItem.addActionListener(this);
1770
+// superItem = menu.add(new MenuItem("Superellipsoid"));
1771
+// superItem.addActionListener(this);
1772
+
1773
+ cameraItem = menu.add(new MenuItem("Camera"));
1774
+ cameraItem.addActionListener(this);
1775
+
1776
+ if (!Globals.ADVANCED)
1777
+ {
1778
+ kleinItem = menu.add(new MenuItem("Klein Bottle"));
1779
+ kleinItem.addActionListener(this);
1780
+ }
1781
+
1782
+// particleItem = menu.add(new MenuItem("Particle system"));
1783
+// particleItem.addActionListener(this);
1784
+ if (Globals.ADVANCED)
1785
+ {
10381786 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10391787 ragdollItem.addActionListener(this);
10401788 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10411789 ragdoll2Item.addActionListener(this);
1790
+ }
10421791 menu.add("-");
1043
- meshItem = menu.add(new MenuItem("Mesh"));
1792
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10441793 meshItem.addActionListener(this);
10451794 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10461795 // meshGroupItem.addActionListener(this);
1796
+ if (Globals.ADVANCED)
1797
+ {
10471798 springItem = menu.add(new MenuItem("Spring"));
10481799 springItem.addActionListener(this);
10491800 flagItem = menu.add(new MenuItem("Flag"));
10501801 flagItem.addActionListener(this);
1051
- bezierItem = menu.add(new MenuItem("Patch"));
1052
- bezierItem.addActionListener(this);
1053
- checkerItem = menu.add(new MenuItem("Checker"));
1054
- checkerItem.addActionListener(this);
10551802 blobItem = menu.add(new MenuItem("Blob"));
10561803 blobItem.addActionListener(this);
10571804 latheItem = menu.add(new MenuItem("Lathe"));
10581805 latheItem.addActionListener(this);
1059
- lightItem = menu.add(new MenuItem("Light"));
1060
- lightItem.addActionListener(this);
1806
+ }
1807
+ bezierItem = menu.add(new MenuItem("Bezier Patch"));
1808
+ bezierItem.addActionListener(this);
1809
+// overlayItem = menu.add(new MenuItem("Overlay"));
1810
+// overlayItem.addActionListener(this);
1811
+// lightItem = menu.add(new MenuItem("Light"));
1812
+// lightItem.addActionListener(this);
10611813 menu.add("-");
10621814 //superLoopItem = menu.add(new MenuItem("Super Loop"));
10631815 //superLoopItem.addActionListener(this);
1064
- loopItem = menu.add(new MenuItem("Loop"));
1065
- loopItem.addActionListener(this);
1816
+// loopItem = menu.add(new MenuItem("Loop"));
1817
+// loopItem.addActionListener(this);
10661818 doubleItem = menu.add(new MenuItem("Fork"));
10671819 doubleItem.addActionListener(this);
1820
+ if (Globals.ADVANCED)
1821
+ {
10681822 tripleItem = menu.add(new MenuItem("Trident"));
10691823 tripleItem.addActionListener(this);
1824
+ }
10701825 }
10711826
10721827 void buildToolsMenu(Menu menu)
10731828 {
10741829 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
10751830 animationItem.addItemListener(this);
1076
- animationItem.setState(CameraPane.ANIMATION);
1831
+ animationItem.setState(Globals.ANIMATION);
1832
+
1833
+ menu.add(archiveItem = new MenuItem("Archive3D..."));
1834
+ archiveItem.addActionListener(this);
10771835
10781836 menu.add("-");
10791837 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
10801838 parseverticesItem.addActionListener(this);
10811839 textureFieldItem = menu.add(new MenuItem("Texture Field"));
10821840 textureFieldItem.addActionListener(this);
1083
- alignItem = menu.add(new MenuItem("Align"));
1841
+ alignItem = menu.add(new MenuItem("Align Objects"));
10841842 alignItem.addActionListener(this);
1085
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1086
- mirrorItem.addActionListener(this);
10871843 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
10881844 reduceMorphItem.addActionListener(this);
10891845 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
10901846 reduce34MorphItem.addActionListener(this);
1091
-
1092
- menu.add(computeAOItem = new MenuItem("Compute AO"));
1093
- computeAOItem.addActionListener(this);
10941847 menu.add("-");
1095
-
10961848 menu.add(memoryItem = new MenuItem("Memory Usage"));
10971849 memoryItem.addActionListener(this);
1850
+ menu.add(computeAOItem = new MenuItem("Compute AO"));
1851
+ computeAOItem.addActionListener(this);
1852
+
1853
+ if (Globals.ADVANCED)
1854
+ {
1855
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1856
+ mirrorItem.addActionListener(this);
1857
+ menu.add("-");
10981858 menu.add(analyzeItem = new MenuItem("Analyze"));
10991859 analyzeItem.addActionListener(this);
1100
- menu.add(dumpItem = new MenuItem("Dump"));
1860
+ menu.add(dumpItem = new MenuItem("Print"));
11011861 dumpItem.addActionListener(this);
11021862 // menu.add(pathItem = new MenuItem("From-to path"));
11031863 // pathItem.addActionListener(this);
....@@ -1106,6 +1866,8 @@
11061866 resetParentItem.addActionListener(this);
11071867 repairParentItem = menu.add(new MenuItem("Repair Parent"));
11081868 repairParentItem.addActionListener(this);
1869
+ repairShadowItem = menu.add(new MenuItem("Repair Shadow"));
1870
+ repairShadowItem.addActionListener(this);
11091871 menu.add(invariantsItem = new MenuItem("Invariants"));
11101872 invariantsItem.addActionListener(this);
11111873 menu.add(recompileItem = new MenuItem("Recompile"));
....@@ -1113,6 +1875,7 @@
11131875 menu.add("-");
11141876 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11151877 editScriptItem.addActionListener(this);
1878
+ }
11161879 }
11171880
11181881 void ScreenFit()
....@@ -1235,9 +1998,34 @@
12351998 shadow.material = new cMaterial(obj.material);
12361999 shadow.material.diffuse = 0.0001f;
12372000 shadow.material.specular = 0.0001f;
2001
+ //shadow.projectedVertices[1].x = 300;
12382002
12392003 makeSomething(shadow);
12402004 }
2005
+
2006
+ private void ClearUnpinned()
2007
+ {
2008
+ //for (Object3D obj : listUI)
2009
+ for (int i=listUI.size(); --i>=0;)
2010
+ {
2011
+ Object3D obj = listUI.elementAt(i);
2012
+ if (!obj.pinned)
2013
+ {
2014
+ obj.CloseUI();
2015
+ listUI.remove(i);
2016
+ }
2017
+ }
2018
+ }
2019
+
2020
+ private void EditElement(Object3D elem, boolean newWindow)
2021
+ {
2022
+ // if (!(elem instanceof Composite))
2023
+ // newWindow = false;
2024
+ listUI.add(elem);
2025
+ elem.openEditWindow(this, newWindow); //, false);
2026
+ System.out.println("edit : " + elem);
2027
+ elem.editWindow.refreshContents(true); // ? new
2028
+ }
12412029
12422030 /**
12432031 * applyExample
....@@ -1441,9 +2229,9 @@
14412229
14422230 void Overwrite(int mask)
14432231 {
1444
- if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
2232
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14452233 {
1446
- Object3D content = GraphreeD.clipboard.get(0);
2234
+ Object3D content = Grafreed.clipboard.get(0);
14472235
14482236 if (content instanceof cGroup && ((cGroup)content).transientlink )
14492237 content = ((cGroup)content).get(0);
....@@ -1466,6 +2254,7 @@
14662254 //
14672255 public void actionPerformed(ActionEvent event) // , Object arg)
14682256 {
2257
+ Object source = event.getSource();
14692258 /*
14702259 if (event.getSource() == nameField)
14712260 {
....@@ -1477,11 +2266,11 @@
14772266 }
14782267 else
14792268 */
1480
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
2269
+ if (source == lookAtItem || source == lookFromItem)
14812270 {
14822271 ScreenFit();
14832272 } else
1484
- if (event.getSource() == switchItem)
2273
+ if (source == switchViewItem)
14852274 {
14862275 cVector v1 = new cVector();
14872276 cVector v2 = new cVector();
....@@ -1490,11 +2279,11 @@
14902279 objEditor.cameraView.renderCamera.setAim(v2, v1);
14912280 objEditor.cameraView.repaint();
14922281 } else
1493
- if (event.getSource() == rectoidItem)
2282
+ if (source == rectoidItem || source == boxButton)
14942283 {
14952284 makeSomething(new Box());
14962285 } else
1497
- if (event.getSource() == particleItem)
2286
+ if (source == particleItem || source == particlesButton)
14982287 {
14992288 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15002289 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1515,9 +2304,9 @@
15152304 applyExample(particleGeom, "SMOKE");
15162305 makeSomething(particleGeom);
15172306 } else
1518
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
2307
+ if (source == ragdollItem || source == ragdoll2Item)
15192308 {
1520
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
2309
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15212310
15222311 ragdoll.toParent = LA.newMatrix();
15232312 ragdoll.fromParent = LA.newMatrix();
....@@ -1535,7 +2324,7 @@
15352324 } else
15362325 /*
15372326 */
1538
- if (event.getSource() == heightFieldItem)
2327
+ if (source == heightFieldItem)
15392328 {
15402329 Object3D obj = new Object3D();
15412330
....@@ -1573,27 +2362,31 @@
15732362
15742363 makeSomething(obj);
15752364 } else
1576
- if (event.getSource() == gridItem)
2365
+ if (source == gridItem || source == gridButton)
15772366 {
15782367 makeSomething(new Grid());
15792368 } else
1580
- if (event.getSource() == ellipsoidItem)
2369
+ if (source == ellipsoidItem || source == sphereButton)
15812370 {
15822371 makeSomething(new Sphere());
15832372 } else
1584
- if (event.getSource() == coneItem)
2373
+ if (source == coneItem || source == coneButton)
15852374 {
15862375 makeSomething(new Cone());
15872376 } else
1588
- if (event.getSource() == torusItem)
2377
+ if (source == torusItem || source == torusButton)
15892378 {
15902379 makeSomething(new Torus());
15912380 } else
1592
- if (event.getSource() == superItem)
2381
+ if (source == superItem || source == superButton)
15932382 {
15942383 makeSomething(new Superellipsoid());
15952384 } else
1596
- if (event.getSource() == blobItem)
2385
+ if (source == kleinItem || source == kleinButton)
2386
+ {
2387
+ makeSomething(new Klein());
2388
+ } else
2389
+ if (source == blobItem)
15972390 {
15982391 Blob blob = new Blob();
15992392 BlobComponent comp = new BlobComponent();
....@@ -1601,15 +2394,15 @@
16012394 //blob.retile();
16022395 makeSomething(blob);
16032396 } else
1604
- if (event.getSource() == latheItem)
2397
+ if (source == latheItem)
16052398 {
16062399 makeSomething(new Lathe());
16072400 } else
1608
- if (event.getSource() == bezierItem)
2401
+ if (source == bezierItem)
16092402 {
16102403 makeSomething(new BezierSurface());
16112404 } else
1612
- if (event.getSource() == checkerItem)
2405
+ if (source == overlayItem || source == overlayButton)
16132406 {
16142407 /*
16152408 Object3D obj = new BezierSurface(5,8);
....@@ -1624,7 +2417,7 @@
16242417 */
16252418 makeSomething(new Checker());
16262419 } else
1627
- if (event.getSource() == meshItem)
2420
+ if (source == meshItem)
16282421 {
16292422 Object3D itemtomake = new Object3D();
16302423 Object3D child;
....@@ -1645,35 +2438,52 @@
16452438 makeSomething(child);
16462439 }
16472440 } else
1648
- if (event.getSource() == springItem)
2441
+ if (source == springItem)
16492442 {
16502443 cSpring s = new cSpring();
16512444 s.setup();
16522445 makeSomething(s);
16532446 } else
1654
- if (event.getSource() == flagItem)
2447
+ if (source == flagItem)
16552448 {
16562449 cSpring s = new cFlag();
16572450 s.setup();
16582451 makeSomething(s);
16592452 } else
1660
- if (event.getSource() == lightItem)
2453
+ if (source == lightItem || source == lightButton)
16612454 {
16622455 makeSomething(new Light());
16632456 } else
1664
- if (event.getSource() == csgItem)
2457
+// if (source == skybox1Button ||
2458
+// source == skybox2Button ||
2459
+// source == skybox3Button ||
2460
+// source == skybox4Button ||
2461
+// source == skybox5Button ||
2462
+// source == skybox6Button ||
2463
+// source == skybox7Button ||
2464
+// source == skybox11Button ||
2465
+// source == skybox12Button ||
2466
+// source == skybox13Button ||
2467
+// source == skybox14Button ||
2468
+// source == skybox15Button ||
2469
+// source == skybox16Button ||
2470
+// source == skybox17Button)
2471
+// {
2472
+// ChangeSkybox(source);
2473
+// } else
2474
+ if (source == csgItem)
16652475 {
16662476 group(new CSG());
16672477 } else
1668
- if (event.getSource() == templateItem)
2478
+ if (source == templateItem)
16692479 {
16702480 group(new cTemplate());
16712481 } else
1672
- if (event.getSource() == attributeItem)
2482
+ if (source == attributeItem)
16732483 {
16742484 makeSomething(new Attribute());
16752485 } else
1676
- if (event.getSource() == pointflowItem)
2486
+ if (source == pointflowItem)
16772487 {
16782488 makeSomething(new PointFlow());
16792489 } else
....@@ -1685,7 +2495,7 @@
16852495 } else
16862496 */
16872497
1688
- if (event.getSource() == superLoopItem)
2498
+ if (source == superLoopItem)
16892499 {
16902500 Composite g = new cGroup();
16912501 for (int i=0; i<15; i++)
....@@ -1707,30 +2517,30 @@
17072517
17082518 group(g);
17092519 } else
1710
- if (event.getSource() == loopItem)
2520
+ if (source == loopItem || source == loopButton)
17112521 {
17122522 Composite csg = new GroupLeaf();
17132523 csg.count = 5;
17142524 group(csg);
1715
- Composite child = new cGroup();
2525
+ Composite child = new cGroup("Branch");
17162526 csg.addChild(child);
17172527 child.addChild(csg);
17182528 } else
1719
- if (event.getSource() == doubleItem)
2529
+ if (source == doubleItem)
17202530 {
1721
- Composite csg = new GroupLeaf();
2531
+ Composite csg = new GroupLeaf("Fork");
17222532 csg.count = 5;
17232533 group(csg);
1724
- Composite child = new cGroup();
2534
+ Composite child = new cGroup("Branch A");
17252535 csg.addChild(child);
17262536 child.addChild(csg);
1727
- child = new cGroup();
2537
+ child = new cGroup("Branch B");
17282538 csg.addChild(child);
17292539 child.addChild(csg);
17302540 } else
1731
- if (event.getSource() == tripleItem)
2541
+ if (source == tripleItem)
17322542 {
1733
- Composite csg = new GroupLeaf();
2543
+ Composite csg = new GroupLeaf("Trident");
17342544 csg.count = 4;
17352545 group(csg);
17362546 Composite child = new cGroup();
....@@ -1743,73 +2553,98 @@
17432553 csg.addChild(child);
17442554 child.addChild(csg);
17452555 } else
1746
-
1747
- if (event.getSource() == importGFDItem)
2556
+ if (source == computeAOItem)
17482557 {
1749
- ImportGFD();
2558
+ Globals.drawMode = CameraPane.OCCLUSION;
2559
+ cameraView.repaint();
17502560 } else
1751
- if (event.getSource() == importVRMLX3DItem)
1752
- {
1753
- ImportVRMLX3D();
1754
- } else
1755
- if (event.getSource() == import3DSItem)
1756
- {
1757
- objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
1758
- } else
1759
- if (event.getSource() == importOBJItem)
1760
- {
1761
- objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1762
- } else
1763
- if (event.getSource() == computeAOItem)
1764
- {
1765
- CameraPane.drawMode = CameraPane.OCCLUSION;
1766
- CameraPane.theRenderer.repaint();
1767
- } else
1768
- if (event.getSource() == recompileItem)
2561
+ if (source == recompileItem)
17692562 {
17702563 Recompile();
17712564 refreshContents();
17722565 } else
1773
- if (event.getSource() == editScriptItem)
2566
+ if (source == editScriptItem)
17742567 {
17752568 OpenDialog();
17762569 refreshContents();
17772570 } else
1778
- if (event.getSource() == invariantsItem)
2571
+ if (source == invariantsItem)
17792572 {
17802573 System.out.println("Invariants:");
1781
- GraphreeD.theApplet3D.universe.invariants();
2574
+ Grafreed.grafreeD.universe.invariants();
17822575 } else
1783
- if (event.getSource() == memoryItem)
2576
+ if (source == memoryItem)
17842577 {
17852578 //System.out.println("Invariants:");
17862579 PrintMemory();
17872580 } else
1788
- if (event.getSource() == pathItem)
2581
+ if (source == pathItem)
17892582 {
17902583 PrintPath();
17912584 } else
1792
- if (event.getSource() == analyzeItem)
2585
+ if (source == analyzeItem)
17932586 {
17942587 AnalyzeObject();
17952588 } else
1796
- if (event.getSource() == dumpItem)
2589
+ if (source == dumpItem)
17972590 {
17982591 DumpObject();
17992592 } else
1800
- if (event.getSource() == screenfitButton)
2593
+ if (source == minButton)
18012594 {
1802
- //Reload(lastConverter, lastFilename, true);
2595
+ Minimize();
2596
+ } else
2597
+ if (source == maxButton)
2598
+ {
2599
+ Maximize();
2600
+ } else
2601
+ if (source == fullButton)
2602
+ {
2603
+ ToggleFullScreen();
2604
+ } else
2605
+ if (source == undoButton)
2606
+ {
2607
+ // Go to previous version
2608
+ //if (!Undo())
2609
+ //java.awt.Toolkit.getDefaultToolkit().beep();
2610
+ Undo();
2611
+ } else
2612
+ if (source == restoreButton)
2613
+ {
2614
+ // Restore current version
2615
+ Restore();
2616
+ } else
2617
+ if (source == replaceButton)
2618
+ {
2619
+ // Overwrite current version
2620
+ Replace();
2621
+ } else
2622
+ if (source == redoButton)
2623
+ {
2624
+ // Go to next version
2625
+ Redo();
2626
+ } else
2627
+ if (source == saveButton)
2628
+ {
2629
+ // Save a new version
2630
+ if (!Save(true))
2631
+ java.awt.Toolkit.getDefaultToolkit().beep();
2632
+ } else
2633
+ if (source == oneStepButton)
2634
+ {
2635
+ Globals.ONESTEP = true;
2636
+ cameraView.repaint();
2637
+ } else
2638
+ if (source == screenfitButton)
2639
+ {
18032640 ScreenFit();
18042641 } else
1805
- if (event.getSource() == screenfitpointButton)
2642
+ if (source == screenfitpointButton)
18062643 {
1807
- //Reload(lastConverter, lastFilename, true);
18082644 ScreenFitPoint();
18092645 } else
1810
- if (event.getSource() == snapobjectButton)
2646
+ if (source == snapobjectButton)
18112647 {
1812
- //Reload(lastConverter, lastFilename, true);
18132648 SnapObject();
18142649 } else
18152650 // if (event.getSource() == recompileButton)
....@@ -1818,13 +2653,13 @@
18182653 // Recompile();
18192654 // refreshContents();
18202655 // } else
1821
- if (event.getSource() == gcButton)
2656
+ if (source == gcButton)
18222657 {
18232658 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18242659 System.gc();
18252660 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18262661 } else
1827
- if (event.getSource() == editLeafItem)
2662
+ if (source == editLeafItem)
18282663 {
18292664 Object3D obj;
18302665 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1838,65 +2673,78 @@
18382673 }
18392674 refreshContents(true);
18402675 } else
1841
- if (event.getSource() == openWindowItem)
2676
+ if (source == openWindowItem)
18422677 {
18432678 EditSelection(true);
18442679 } else
1845
- if (event.getSource() == cutItem || event.getSource() == clearButton)
2680
+ if (source == cutItem || source == clearButton)
18462681 {
18472682 loadClipboard(true);
18482683 } else
1849
- if (event.getSource() == duplicateItem)
2684
+ if (source == undoItem)
18502685 {
1851
- Object3D keep = GraphreeD.clipboard;
2686
+ Undo();
2687
+ } else
2688
+ if (source == redoItem)
2689
+ {
2690
+ Redo();
2691
+ } else
2692
+ if (source == duplicateItem)
2693
+ {
2694
+ Object3D keep = Grafreed.clipboard;
18522695 loadClipboard(false);
18532696 paste(false);
1854
- GraphreeD.clipboard = keep;
2697
+ Grafreed.clipboard = keep;
18552698 } else
1856
- if (event.getSource() == cloneItem)
2699
+ if (source == cloneItem)
18572700 {
18582701 CloneSelection(false);
18592702 } else
1860
- if (event.getSource() == cloneSupportItem)
2703
+ if (source == cloneSupportItem)
18612704 {
18622705 CloneSelection(true);
18632706 } else
1864
- if (event.getSource() == copyItem)
2707
+ if (source == copyItem)
18652708 {
18662709 loadClipboard(false);
18672710 } else
1868
- if (event.getSource() == pasteItem)
2711
+ if (source == pasteItem)
18692712 {
18702713 paste(false);
18712714 } else
1872
- if (event.getSource() == pasteLinkItem)
2715
+ if (source == pasteIntoItem)
18732716 {
1874
- pasteInto(false);
2717
+ pasteInto(true, false);
18752718 } else
1876
- if (event.getSource() == pasteCloneItem)
2719
+ if (source == pasteLinkItem)
18772720 {
1878
- pasteInto(true);
2721
+ pasteInto(false, false);
18792722 } else
1880
- if (event.getSource() == pasteExpandItem)
2723
+ if (source == pasteCloneItem)
2724
+ {
2725
+ pasteInto(true, true);
2726
+ } else
2727
+ if (source == pasteExpandItem)
18812728 {
18822729 paste(true);
18832730 } else
1884
- if (event.getSource() == synchronizeItem)
2731
+ if (source == synchronizeItem)
18852732 {
18862733 Overwrite(Object3D.TRANSFORM);
18872734 } else
1888
- if (event.getSource() == overwriteNameItem)
2735
+ if (source == overwriteNameItem)
18892736 {
18902737 Overwrite(Object3D.NAME);
18912738 } else
1892
- if (event.getSource() == overwriteUVItem)
2739
+ if (source == overwriteUVItem)
18932740 {
18942741 Overwrite(Object3D.UV);
18952742 } else
1896
- if (event.getSource() == overwriteMatItem)
2743
+ if (source == overwriteMatItem)
18972744 {
2745
+ /* july 2015
18982746 if ((dropAttributes & Object3D.TEXTURE) == 0)
1899
- Overwrite(Object3D.MATERIAL);
2747
+ Overwrite(Object3D.MATERIAL | Object3D.COLOR);
19002748 else
19012749 {
19022750 if ((dropAttributes & Object3D.COLOR) == 0 && (dropAttributes & Object3D.MATERIAL) == 0)
....@@ -1908,13 +2756,16 @@
19082756 Overwrite(Object3D.MATERIAL | Object3D.TEXTURE);
19092757 }
19102758 }
2759
+ */
2760
+
2761
+ Overwrite(dropAttributes);
19112762 }
1912
- if (event.getSource() == overwriteGeoItem)
2763
+ if (source == overwriteGeoItem)
19132764 {
19142765 Overwrite(Object3D.GEOMETRY);
1915
-// if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
2766
+// if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
19162767 // {
1917
-// Object3D content = GraphreeD.clipboard.get(0);
2768
+// Object3D content = GrafreeD.clipboard.get(0);
19182769 //
19192770 // if (content instanceof cGroup && ((cGroup)content).transientlink )
19202771 // content = ((cGroup)content).get(0);
....@@ -1926,7 +2777,7 @@
19262777 // refreshContents();
19272778 // }
19282779 } else
1929
- if (event.getSource() == generateMeshItem)
2780
+ if (source == generateMeshItem)
19302781 {
19312782 //if (group.selection.size() == 1)
19322783 // for (int i=0; i<group.selection.size(); i++)
....@@ -1937,7 +2788,7 @@
19372788 ResetModel();
19382789 refreshContents();
19392790 } else
1940
- if (event.getSource() == extractGeometriesItem)
2791
+ if (source == extractGeometriesItem)
19412792 {
19422793 boolean one = false;
19432794
....@@ -1964,7 +2815,7 @@
19642815 ResetModel();
19652816 refreshContents();
19662817 } else
1967
- if (event.getSource() == cloneGeometriesItem)
2818
+ if (source == cloneGeometriesItem)
19682819 {
19692820 boolean one = false;
19702821
....@@ -1990,32 +2841,37 @@
19902841 ResetModel();
19912842 refreshContents();
19922843 } else
1993
- if (event.getSource() == shareGeometriesItem)
2844
+ if (source == shareGeometriesItem)
19942845 {
19952846 boolean one = false;
19962847
19972848 if (group.selection.size() == 1)
19982849 one = true;
19992850
2851
+ Object3D merge = null;
2852
+
20002853 Object3D content = new cGroup();
20012854
20022855 for (int i=0; i<group.selection.size(); i++)
20032856 {
2004
- Object3D sel = new Merge(group.selection.get(i));
2857
+ merge = new Merge(group.selection.get(i));
20052858
20062859 if (one)
2007
- makeSomething(sel, false);
2860
+ makeSomething(merge, false);
20082861 else
2009
- content.addChild(sel);
2862
+ content.addChild(merge);
20102863 }
20112864
20122865 if (!one)
2013
- makeSomething(content, false);
2014
-
2015
- ResetModel();
2016
- refreshContents();
2866
+ makeSomething(content, true);
2867
+ else
2868
+ {
2869
+ ResetModel();
2870
+ Select(merge.GetTreePath(), true, false); // unselect... false);
2871
+ refreshContents();
2872
+ }
20172873 } else
2018
- if (event.getSource() == mergeGeometriesItem)
2874
+ if (source == mergeGeometriesItem)
20192875 {
20202876 boolean one = false;
20212877
....@@ -2045,11 +2901,11 @@
20452901 ResetModel();
20462902 refreshContents();
20472903 } else
2048
- if (event.getSource() == linkverticesItem)
2904
+ if (source == linkverticesItem)
20492905 {
2050
-// if (group.selection.size() == 1 && GraphreeD.clipboard.size() == 1)
2906
+// if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
20512907 // {
2052
-// Object3D content = GraphreeD.clipboard.get(0);
2908
+// Object3D content = GrafreeD.clipboard.get(0);
20532909 //
20542910 // if (content instanceof cGroup && ((cGroup)content).transientlink )
20552911 // content = ((cGroup)content).get(0);
....@@ -2058,39 +2914,48 @@
20582914 // group.selection.get(0).setMasterThis(content); // should be identity
20592915 // refreshContents();
20602916 // }
2061
- if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
2917
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
20622918 {
2063
- Object3D content = GraphreeD.clipboard.get(0);
2919
+ Object3D content = Grafreed.clipboard.get(0);
20642920
20652921 if (content instanceof cGroup && ((cGroup)content).transientlink )
20662922 content = ((cGroup)content).get(0);
20672923
2068
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
2924
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
20692925 for (int i=0; i<group.selection.size(); i++)
20702926 {
2071
- boolean random = CameraPane.RANDOM;
2072
- CameraPane.RANDOM = false; // parse all random nodes
2927
+ boolean random = CameraPane.SWITCH;
2928
+ CameraPane.SWITCH = false; // parse all random nodes
20732929 group.selection.get(i).linkVerticesThis(content);
20742930 // group.selection.get(i).setMasterThis(content); // should be identity
2075
- CameraPane.RANDOM = random;
2931
+ CameraPane.SWITCH = random;
20762932 }
2077
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
2933
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
20782934 refreshContents();
20792935 }
20802936 } else
2081
- if (event.getSource() == resetsupportItem)
2937
+ if (source == resetsupportItem)
20822938 {
20832939 for (int i=0; i<group.selection.size(); i++)
20842940 {
2085
- boolean random = CameraPane.RANDOM;
2086
- CameraPane.RANDOM = false; // parse all random nodes
2941
+ boolean random = CameraPane.SWITCH;
2942
+ CameraPane.SWITCH = false; // parse all random nodes
20872943 group.selection.get(i).linkVerticesThis(null);
2088
- CameraPane.RANDOM = random;
2944
+ CameraPane.SWITCH = random;
20892945 }
20902946
20912947 refreshContents();
20922948 } else
2093
- if (event.getSource() == resetreferencesItem)
2949
+ if (source == relinkverticesItem)
2950
+ {
2951
+ boolean random = CameraPane.SWITCH;
2952
+ CameraPane.SWITCH = false; // parse all random nodes
2953
+ group.selection.RelinkToSupport();
2954
+ CameraPane.SWITCH = random;
2955
+
2956
+ refreshContents();
2957
+ } else
2958
+ if (source == resetreferencesItem)
20942959 {
20952960 for (int i=0; i<group.selection.size(); i++)
20962961 {
....@@ -2099,11 +2964,11 @@
20992964
21002965 refreshContents();
21012966 } else
2102
- if (event.getSource() == setMasterItem)
2967
+ if (source == setMasterItem)
21032968 {
2104
- if (group.selection.size() == 1 && GraphreeD.clipboard.size() == 1)
2969
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
21052970 {
2106
- Object3D content = GraphreeD.clipboard.get(0);
2971
+ Object3D content = Grafreed.clipboard.get(0);
21072972
21082973 if (content instanceof cGroup && ((cGroup)content).transientlink )
21092974 content = ((cGroup)content).get(0);
....@@ -2112,13 +2977,13 @@
21122977 refreshContents();
21132978 }
21142979 } else
2115
- if (event.getSource() == poseMeshItem)
2980
+ if (source == poseMeshItem)
21162981 {
21172982 if (group.selection.size() == 1)
21182983 {
2119
- if (GraphreeD.clipboard.size() == 1)
2984
+ if (Grafreed.clipboard.size() == 1)
21202985 {
2121
- Object3D content = GraphreeD.clipboard.get(0);
2986
+ Object3D content = Grafreed.clipboard.get(0);
21222987
21232988 if (content instanceof cGroup && ((cGroup)content).transientlink )
21242989 content = ((cGroup)content).get(0);
....@@ -2131,19 +2996,19 @@
21312996 }
21322997
21332998 } else
2134
- if (event.getSource() == revertMeshItem)
2999
+ if (source == revertMeshItem)
21353000 {
21363001 RevertMeshes();
21373002 } else
2138
- if (event.getSource() == resetMeshItem)
3003
+ if (source == resetAllItem)
21393004 {
21403005 ResetAll();
21413006 } else
2142
- if (event.getSource() == stepAllItem)
3007
+ if (source == stepAllItem)
21433008 {
21443009 StepAll();
21453010 } else
2146
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
3011
+ if (source == deleteItem) // || event.getSource() == clearButton)
21473012 {
21483013 //int indices[] = jList.getSelectedIndices();
21493014 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2151,42 +3016,46 @@
21513016
21523017 ClearSelection(false);
21533018 } else
2154
- if (event.getSource() == clearAllItem)
3019
+ if (source == clearAllItem)
21553020 {
21563021 ClearSelection(true);
21573022 } else
2158
- if (event.getSource() == grabItem)
3023
+ if (source == grabItem || source == groupButton)
21593024 {
2160
- group(new cGroup(), true);
3025
+ group(new cGroup(), false); // true);
21613026 } else
2162
- if (event.getSource() == frontItem)
3027
+ if (source == hideItem)
3028
+ {
3029
+ group(new HiddenObject());
3030
+ } else
3031
+ if (source == frontItem)
21633032 {
21643033 front();
21653034 } else
2166
- if (event.getSource() == backItem)
3035
+ if (source == backItem)
21673036 {
21683037 back();
21693038 } else
2170
- if (event.getSource() == cameraItem)
3039
+ if (source == cameraItem)
21713040 {
21723041 makeSomething(new Camera());
21733042 } else
2174
- if (event.getSource() == compositeItem)
3043
+ if (source == compositeItem || source == compositeButton)
21753044 {
21763045 group(new Composite());
21773046 } else
2178
- if (event.getSource() == randomItem)
3047
+ if (source == switchItem || source == switchButton)
21793048 {
21803049 RandomNode random = new RandomNode();
21813050 group(random);
21823051 if (random.size() > 0)
2183
- random.name = random.get(0).name + "Rnd";
3052
+ random.name = random.get(0).name + "Switch";
21843053 } else
2185
- if (event.getSource() == physicsItem)
3054
+ if (source == physicsItem)
21863055 {
21873056 group(new PhysicsNode());
21883057 } else
2189
- if (event.getSource() == frameselectorItem)
3058
+ if (source == frameselectorItem)
21903059 {
21913060 for (int i=0; i<group.selection.size(); i++)
21923061 {
....@@ -2198,7 +3067,7 @@
21983067 ResetModel();
21993068 refreshContents();
22003069 } else
2201
- if (event.getSource() == switchGeoItem)
3070
+ if (source == switchGeoItem)
22023071 {
22033072 for (int i=0; i<group.selection.size(); i++)
22043073 {
....@@ -2210,7 +3079,7 @@
22103079 ResetModel();
22113080 refreshContents();
22123081 } else
2213
- if (event.getSource() == switchTransfoItem)
3082
+ if (source == switchTransfoItem)
22143083 {
22153084 for (int i=0; i<group.selection.size(); i++)
22163085 {
....@@ -2222,7 +3091,7 @@
22223091 ResetModel();
22233092 refreshContents();
22243093 } else
2225
- if (event.getSource() == morphItem)
3094
+ if (source == morphItem)
22263095 {
22273096 for (int i=0; i<group.selection.size(); i++)
22283097 {
....@@ -2234,7 +3103,7 @@
22343103 ResetModel();
22353104 refreshContents();
22363105 } else
2237
- if (event.getSource() == scriptNodeItem)
3106
+ if (source == scriptNodeItem)
22383107 {
22393108 boolean atleastone = false;
22403109
....@@ -2273,195 +3142,252 @@
22733142 }
22743143 }
22753144 } else
2276
- if (event.getSource() == linkerItem)
3145
+ if (source == linkerItem)
22773146 {
22783147 group(new cLinker());
22793148 } else
2280
- if (event.getSource() == textureItem)
3149
+ if (source == textureItem || source == textureButton)
22813150 {
22823151 group(new TextureNode());
22833152 } else
2284
- if (event.getSource() == shadowXItem)
3153
+ if (source == billboardItem)
3154
+ {
3155
+ group(new BillboardNode());
3156
+ } else
3157
+ if (source == shadowXItem)
22853158 {
22863159 CastShadow(0);
22873160 } else
2288
- if (event.getSource() == shadowYItem)
3161
+ if (source == shadowYItem)
22893162 {
22903163 CastShadow(1);
22913164 } else
2292
- if (event.getSource() == shadowZItem)
3165
+ if (source == shadowZItem)
22933166 {
22943167 CastShadow(2);
22953168 } else
2296
- if (event.getSource() == ungroupItem)
3169
+ if (source == ungroupItem || source == ungroupButton)
22973170 {
2298
- ungroup();
3171
+ boolean hasRoot = false;
3172
+
3173
+ for (int i=0; i<group.selection.size(); i++)
3174
+ {
3175
+ if (group.selection.get(i) == group)
3176
+ {
3177
+ hasRoot = true;
3178
+ break;
3179
+ }
3180
+ }
3181
+
3182
+ if (!hasRoot)
3183
+ {
3184
+ for (int i=0; i<group.selection.size(); i++)
3185
+ {
3186
+ Ungroup(group.selection.get(i));
3187
+ }
3188
+
3189
+ ClearSelection(false);
3190
+
3191
+ refreshContents();
3192
+ }
22993193 } else
2300
- if (event.getSource() == genUVItem)
3194
+ if (source == genUVItem)
23013195 {
23023196 GenUV();
23033197 } else
2304
- if (event.getSource() == genNormalsCADItem)
3198
+ if (source == genNormalsCADItem)
23053199 {
23063200 GenNormals(true);
23073201 } else
2308
- if (event.getSource() == genNormalsORGANItem)
3202
+ if (source == genNormalsMESHItem)
3203
+ {
3204
+ GenNormalsMESH();
3205
+ } else
3206
+ if (source == genNormalsORGANItem)
23093207 {
23103208 GenNormals(false);
23113209 } else
2312
- if (event.getSource() == stripifyItem)
3210
+ if (source == genNormalsMINEItem)
3211
+ {
3212
+ GenNormalsMINE();
3213
+ } else
3214
+ if (source == stripifyItem)
23133215 {
23143216 Stripify();
23153217 } else
2316
- if (event.getSource() == unstripifyItem)
3218
+ if (source == unstripifyItem)
23173219 {
23183220 Unstripify();
23193221 } else
2320
- if (event.getSource() == trimItem)
3222
+ if (source == trimItem)
23213223 {
23223224 Trim();
23233225 } else
2324
- if (event.getSource() == untrimItem)
3226
+ if (source == untrimItem)
23253227 {
23263228 Untrim();
23273229 } else
2328
- if (event.getSource() == clearColorsItem)
3230
+ if (source == clearColorsItem)
23293231 {
23303232 ClearColors();
23313233 } else
2332
- if (event.getSource() == clearMaterialsItem)
3234
+ if (source == clearMaterialsItem)
23333235 {
23343236 ClearMaterials();
23353237 } else
2336
- if (event.getSource() == liveleavesItem)
3238
+ if (source == liveleavesItem)
23373239 {
23383240 LiveLeaves(true);
23393241 } else
2340
- if (event.getSource() == unliveleavesItem)
3242
+ if (source == unliveleavesItem)
23413243 {
23423244 LiveLeaves(false);
23433245 } else
2344
- if (event.getSource() == supportleavesItem)
3246
+ if (source == supportleavesItem)
23453247 {
23463248 SupportLeaves(true);
23473249 } else
2348
- if (event.getSource() == unsupportleavesItem)
3250
+ if (source == unsupportleavesItem)
23493251 {
23503252 SupportLeaves(false);
23513253 } else
2352
- if (event.getSource() == hideleavesItem)
3254
+ if (source == hideleavesItem)
23533255 {
23543256 HideLeaves(true);
23553257 } else
2356
- if (event.getSource() == showleavesItem)
3258
+ if (source == showleavesItem)
23573259 {
23583260 HideLeaves(false);
23593261 } else
2360
- if (event.getSource() == markleavesItem)
3262
+ if (source == markleavesItem)
23613263 {
23623264 MarkLeaves(true);
23633265 } else
2364
- if (event.getSource() == unmarkleavesItem)
3266
+ if (source == unmarkleavesItem)
23653267 {
23663268 MarkLeaves(false);
23673269 } else
2368
- if (event.getSource() == flipVItem)
3270
+ if (source == rewindleavesItem)
3271
+ {
3272
+ RewindLeaves(true);
3273
+ } else
3274
+ if (source == unrewindleavesItem)
3275
+ {
3276
+ RewindLeaves(false);
3277
+ } else
3278
+ if (source == randomleavesItem)
3279
+ {
3280
+ RandomLeaves(true);
3281
+ } else
3282
+ if (source == unrandomleavesItem)
3283
+ {
3284
+ RandomLeaves(false);
3285
+ } else
3286
+ if (source == flipVItem)
23693287 {
23703288 FlipV(true);
23713289 } else
2372
- if (event.getSource() == unflipVItem)
3290
+ if (source == unflipVItem)
23733291 {
23743292 FlipV(false);
23753293 } else
2376
- if (event.getSource() == lowTexturesItem)
3294
+ if (source == lowTexturesItem)
23773295 {
23783296 SetTexRes(0);
23793297 } else
2380
- if (event.getSource() == normalTexturesItem)
3298
+ if (source == normalTexturesItem)
23813299 {
23823300 SetTexRes(1);
23833301 } else
2384
- if (event.getSource() == highTexturesItem)
3302
+ if (source == highTexturesItem)
23853303 {
23863304 SetTexRes(2);
23873305 } else
2388
- if (event.getSource() == veryhighTexturesItem)
3306
+ if (source == veryhighTexturesItem)
23893307 {
23903308 SetTexRes(3);
23913309 } else
2392
- if (event.getSource() == maxTexturesItem)
3310
+ if (source == maxTexturesItem)
23933311 {
23943312 SetTexRes(4);
23953313 } else
2396
- if (event.getSource() == panoTexturesItem)
3314
+ if (source == panoTexturesItem)
23973315 {
23983316 SetTexRes(5);
23993317 } else
2400
- if (event.getSource() == reverseNormalsItem)
3318
+ if (source == reverseNormalsItem)
24013319 {
24023320 ReverseNormals();
24033321 } else
2404
- if (event.getSource() == parseverticesItem)
3322
+ if (source == parseverticesItem)
24053323 {
24063324 ParseVertices();
24073325 } else
2408
- if (event.getSource() == textureFieldItem)
3326
+ if (source == textureFieldItem)
24093327 {
24103328 TextureVertices();
24113329 } else
2412
- if (event.getSource() == alignItem)
3330
+ if (source == alignItem)
24133331 {
24143332 Align();
24153333 } else
2416
- if (event.getSource() == mirrorItem)
3334
+ if (source == mirrorItem)
24173335 {
24183336 MirrorPoses();
24193337 } else
2420
- if (event.getSource() == reduceMorphItem)
3338
+ if (source == reduceMorphItem)
24213339 {
24223340 MeshReduction(false);
24233341 } else
2424
- if (event.getSource() == reduce34MorphItem)
3342
+ if (source == reduce34MorphItem)
24253343 {
24263344 MeshReduction(true);
24273345 } else
2428
- if (event.getSource() == reverseTrianglesItem)
3346
+ if (source == reverseTrianglesItem)
24293347 {
24303348 ReverseTriangles();
24313349 } else
2432
- if (event.getSource() == reduceMeshItem)
3350
+ if (source == reduceMeshItem)
24333351 {
24343352 ReduceMesh(false);
24353353 } else
2436
- if (event.getSource() == reduce34MeshItem)
3354
+ if (source == reduce34MeshItem)
24373355 {
24383356 ReduceMesh(true);
24393357 } else
2440
- if (event.getSource() == increaseMeshItem)
3358
+ if (source == increaseMeshItem)
24413359 {
24423360 IncreaseMesh();
24433361 } else
2444
- if (event.getSource() == clipMeshItem)
3362
+ if (source == clipMeshItem)
24453363 {
24463364 ClipMesh();
24473365 } else
2448
- if (event.getSource() == smoothMeshItem)
3366
+ if (source == smoothMeshItem)
24493367 {
24503368 SmoothMesh();
24513369 } else
2452
- if (event.getSource() == transformgeometryItem)
3370
+ if (source == transformGeometryItem)
24533371 {
24543372 TransformGeometry();
24553373 } else
2456
- if (event.getSource() == resetTransformItem)
3374
+ if (source == transformChildrenItem)
3375
+ {
3376
+ TransformChildren();
3377
+ } else
3378
+ if (source == resetTransformItem)
24573379 {
24583380 ResetTransform();
24593381 } else
2460
- if (event.getSource() == resetCentroidItem)
3382
+ if (source == resetCentroidItem)
24613383 {
2462
- ResetCentroid();
3384
+ ResetCentroid(true);
24633385 } else
2464
- if (event.getSource() == resetParentItem)
3386
+ if (source == resetCentroidXZItem)
3387
+ {
3388
+ ResetCentroid(false);
3389
+ } else
3390
+ if (source == resetParentItem)
24653391 {
24663392 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24673393 {
....@@ -2471,7 +3397,7 @@
24713397
24723398 refreshContents();
24733399 } else
2474
- if (event.getSource() == repairParentItem)
3400
+ if (source == repairParentItem)
24753401 {
24763402 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24773403 {
....@@ -2485,7 +3411,21 @@
24853411
24863412 refreshContents();
24873413 } else
2488
- if (event.getSource() == sortbysizeItem)
3414
+ if (source == repairShadowItem)
3415
+ {
3416
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3417
+ {
3418
+ Object3D obj = (Object3D)e.nextElement();
3419
+ obj.RepairShadow();
3420
+// for (int i=0; i<obj.size(); i++)
3421
+// {
3422
+// obj.get(i).parent = obj;
3423
+// }
3424
+ }
3425
+
3426
+ refreshContents();
3427
+ } else
3428
+ if (source == sortbysizeItem)
24893429 {
24903430 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24913431 {
....@@ -2497,7 +3437,7 @@
24973437 ResetModel();
24983438 refreshContents();
24993439 } else
2500
- if (event.getSource() == sortbynameItem)
3440
+ if (source == sortbynameItem)
25013441 {
25023442 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25033443 {
....@@ -2509,7 +3449,7 @@
25093449 ResetModel();
25103450 refreshContents();
25113451 } else
2512
- if (event.getSource() == attachPigmentItem)
3452
+ if (source == attachPigmentItem)
25133453 {
25143454 String texture = GetFile("Attach pigment");
25153455 Object3D obj;
....@@ -2521,7 +3461,7 @@
25213461
25223462 refreshContents();
25233463 } else
2524
- if (event.getSource() == detachPigmentItem)
3464
+ if (source == detachPigmentItem)
25253465 {
25263466 Object3D obj;
25273467 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2532,7 +3472,7 @@
25323472
25333473 refreshContents();
25343474 } else
2535
- if (event.getSource() == attachBumpItem)
3475
+ if (source == attachBumpItem)
25363476 {
25373477 String texture = GetFile("Attach bump");
25383478 Object3D obj;
....@@ -2544,18 +3484,18 @@
25443484
25453485 refreshContents();
25463486 } else
2547
- if (event.getSource() == detachBumpItem)
3487
+ if (source == detachBumpItem)
25483488 {
25493489 Object3D obj;
25503490 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25513491 {
25523492 obj = (Object3D)e.nextElement();
2553
- obj.SetBumpTexture(null);
3493
+ obj.ResetBumpTexture();
25543494 }
25553495
25563496 refreshContents();
25573497 } else
2558
- if (event.getSource() == pigmentBumpItem)
3498
+ if (source == pigmentBumpItem)
25593499 {
25603500 Object3D obj;
25613501 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2566,158 +3506,262 @@
25663506
25673507 refreshContents();
25683508 } else
2569
- if (event.getSource() == flashSelectionButton)
3509
+ if (source == embedTexturesItem)
3510
+ {
3511
+ Object3D obj;
3512
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3513
+ {
3514
+ obj = (Object3D)e.nextElement();
3515
+ obj.EmbedTextures(true);
3516
+ }
3517
+
3518
+ refreshContents();
3519
+ } else
3520
+ if (source == deEmbedTexturesItem)
3521
+ {
3522
+ Object3D obj;
3523
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3524
+ {
3525
+ obj = (Object3D)e.nextElement();
3526
+ obj.EmbedTextures(false);
3527
+ }
3528
+
3529
+ CameraPane.texturepigment.clear();
3530
+ CameraPane.texturebump.clear();
3531
+
3532
+ refreshContents();
3533
+ } else
3534
+ if (source == flashSelectionButton)
25703535 {
25713536 CameraPane.flash = true;
25723537 refreshContents();
25733538 } else
2574
- if (event.getSource() == oneButton)
3539
+ if (source == oneButton)
25753540 {
25763541 } else
2577
- if (event.getSource() == twoButton)
3542
+ if (source == twoButton)
25783543 {
25793544 radio.layout = twoButton;
3545
+
3546
+ if (CameraPane.FULLSCREEN)
3547
+ fullscreenLayout = radio.layout;
3548
+
25803549 // bug
25813550 //gridPanel.setDividerLocation(1.0);
25823551 //bigPanel.setDividerLocation(0.0);
2583
- bigThree.remove(jtp);
2584
- bigThree.remove(cameraPanel);
2585
- bigThree.remove(XYZPanel);
2586
- aWindowConstraints.gridx = 0;
2587
- aWindowConstraints.gridy = 0;
2588
- aWindowConstraints.gridwidth = 1;
2589
- // aConstraints.gridheight = 3;
2590
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2591
- aWindowConstraints.weightx = 0;
2592
- aWindowConstraints.weighty = 1;
2593
- //bigThree.add(jtp, aWindowConstraints);
2594
- aWindowConstraints.weightx = 1;
2595
- aWindowConstraints.gridwidth = 3;
2596
- // aConstraints.gridheight = 3;
2597
- aWindowConstraints.gridx = 1;
2598
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2599
- bigThree.add(cameraPanel, aWindowConstraints);
2600
- aWindowConstraints.weightx = 0;
2601
- aWindowConstraints.gridx = 4;
2602
- aWindowConstraints.gridwidth = 1;
2603
- // aConstraints.gridheight = 3;
2604
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2605
- //bigThree.add(XYZPanel, aWindowConstraints);
2606
- bigThree.revalidate();
3552
+// bigThree.remove(scenePanel);
3553
+// bigThree.remove(centralPanel);
3554
+// bigThree.remove(XYZPanel);
3555
+// aWindowConstraints.gridx = 0;
3556
+// aWindowConstraints.gridy = 0;
3557
+// aWindowConstraints.gridwidth = 1;
3558
+// // aConstraints.gridheight = 3;
3559
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3560
+// aWindowConstraints.weightx = 0;
3561
+// aWindowConstraints.weighty = 1;
3562
+// //bigThree.add(jtp, aWindowConstraints);
3563
+// aWindowConstraints.weightx = 1;
3564
+// aWindowConstraints.gridwidth = 3;
3565
+// // aConstraints.gridheight = 3;
3566
+// aWindowConstraints.gridx = 1;
3567
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3568
+// bigThree.add(centralPanel, aWindowConstraints);
3569
+// aWindowConstraints.weightx = 0;
3570
+// aWindowConstraints.gridx = 4;
3571
+// aWindowConstraints.gridwidth = 1;
3572
+// // aConstraints.gridheight = 3;
3573
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3574
+// //bigThree.add(XYZPanel, aWindowConstraints);
3575
+// scenePanel.setVisible(false);
3576
+// centralPanel.setVisible(true);
3577
+// XYZPanel.setVisible(false);
3578
+ bigThree.ClearUI();
3579
+ bigThree.add(centralPanel);
3580
+ bigThree.FlushUI();
3581
+
3582
+ cameraView.requestFocusInWindow();
3583
+
3584
+// refreshContents(true);
3585
+//
3586
+// try
3587
+// {
3588
+// java.awt.Robot bot = new java.awt.Robot();
3589
+// int mask = InputEvent.BUTTON1_MASK;
3590
+// bot.mouseMove(100, 100);
3591
+// bot.mousePress(mask);
3592
+// bot.mouseRelease(mask);
3593
+// }
3594
+// catch (Exception e)
3595
+// {
3596
+//
3597
+// }
3598
+
26073599 } else
2608
- if (event.getSource() == threeButton)
3600
+ if (source == threeButton)
26093601 {
26103602 radio.layout = threeButton;
2611
- bigThree.remove(jtp);
2612
- bigThree.remove(cameraPanel);
2613
- bigThree.remove(XYZPanel);
2614
- aWindowConstraints.gridx = 0;
2615
- aWindowConstraints.gridy = 0;
2616
- aWindowConstraints.gridwidth = 1;
2617
- // aConstraints.gridheight = 3;
2618
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2619
- aWindowConstraints.weightx = 0;
2620
- aWindowConstraints.weighty = 1;
2621
- //bigThree.add(jtp, aWindowConstraints);
2622
- aWindowConstraints.weightx = 1;
2623
- aWindowConstraints.gridwidth = 3;
2624
- // aConstraints.gridheight = 3;
2625
- aWindowConstraints.gridx = 1;
2626
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2627
- bigThree.add(cameraPanel, aWindowConstraints);
2628
- aWindowConstraints.weightx = 0;
2629
- aWindowConstraints.gridx = 4;
2630
- aWindowConstraints.gridwidth = 1;
2631
- // aConstraints.gridheight = 3;
2632
- aConstraints.fill = GridBagConstraints.VERTICAL;
2633
- bigThree.add(XYZPanel, aWindowConstraints);
2634
- bigThree.revalidate();
3603
+
3604
+ if (CameraPane.FULLSCREEN)
3605
+ fullscreenLayout = radio.layout;
3606
+
3607
+// bigThree.remove(scenePanel);
3608
+// bigThree.remove(centralPanel);
3609
+// bigThree.remove(XYZPanel);
3610
+// aWindowConstraints.gridx = 0;
3611
+// aWindowConstraints.gridy = 0;
3612
+// aWindowConstraints.gridwidth = 1;
3613
+// // aConstraints.gridheight = 3;
3614
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3615
+// aWindowConstraints.weightx = 0;
3616
+// aWindowConstraints.weighty = 1;
3617
+// //bigThree.add(jtp, aWindowConstraints);
3618
+// aWindowConstraints.weightx = 1;
3619
+// aWindowConstraints.gridwidth = 3;
3620
+// // aConstraints.gridheight = 3;
3621
+// aWindowConstraints.gridx = 1;
3622
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3623
+// bigThree.add(centralPanel, aWindowConstraints);
3624
+// aWindowConstraints.weightx = 0;
3625
+// aWindowConstraints.gridx = 4;
3626
+// aWindowConstraints.gridwidth = 1;
3627
+// // aConstraints.gridheight = 3;
3628
+// aConstraints.fill = GridBagConstraints.VERTICAL;
3629
+// bigThree.add(XYZPanel, aWindowConstraints);
3630
+// bigThree.validate();
3631
+// scenePanel.setVisible(false);
3632
+// centralPanel.setVisible(true);
3633
+// XYZPanel.setVisible(true);
3634
+ bigThree.ClearUI();
3635
+ bigThree.add(scenePanel);
3636
+ bigThree.add(centralPanel);
3637
+ bigThree.FlushUI();
3638
+
3639
+ cameraView.requestFocusInWindow();
26353640 } else
2636
- if (event.getSource() == fourButton)
3641
+ if (source == fourButton)
26373642 {
26383643 radio.layout = fourButton;
2639
- bigThree.remove(jtp);
2640
- bigThree.remove(cameraPanel);
2641
- bigThree.remove(XYZPanel);
2642
- aWindowConstraints.gridx = 0;
2643
- aWindowConstraints.gridy = 0;
2644
- aWindowConstraints.gridwidth = 1;
2645
- // aWindowConstraints.gridheight = 3;
2646
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2647
- aWindowConstraints.weightx = 1;
2648
- aWindowConstraints.weighty = 1;
2649
- bigThree.add(jtp, aWindowConstraints);
2650
- aWindowConstraints.weightx = 1;
2651
- aWindowConstraints.gridwidth = 3;
2652
- // aConstraints.gridheight = 3;
2653
- aWindowConstraints.gridx = 1;
2654
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2655
- //bigThree.add(cameraPanel, aWindowConstraints);
2656
- aWindowConstraints.weightx = 0;
2657
- aWindowConstraints.gridx = 4;
2658
- aWindowConstraints.gridwidth = 1;
2659
- // aWindowConstraints.gridheight = 3;
2660
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2661
- //bigThree.add(XYZPanel, aWindowConstraints);
2662
- bigThree.revalidate();
3644
+
3645
+ if (CameraPane.FULLSCREEN)
3646
+ fullscreenLayout = radio.layout;
3647
+
3648
+// bigThree.remove(scenePanel);
3649
+// bigThree.remove(centralPanel);
3650
+// bigThree.remove(XYZPanel);
3651
+// aWindowConstraints.gridx = 0;
3652
+// aWindowConstraints.gridy = 0;
3653
+// aWindowConstraints.gridwidth = 1;
3654
+// // aWindowConstraints.gridheight = 3;
3655
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3656
+// aWindowConstraints.weightx = 1;
3657
+// aWindowConstraints.weighty = 1;
3658
+// bigThree.add(scenePanel, aWindowConstraints);
3659
+// aWindowConstraints.weightx = 1;
3660
+// aWindowConstraints.gridwidth = 3;
3661
+// // aConstraints.gridheight = 3;
3662
+// aWindowConstraints.gridx = 1;
3663
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3664
+// //bigThree.add(cameraPanel, aWindowConstraints);
3665
+// aWindowConstraints.weightx = 0;
3666
+// aWindowConstraints.gridx = 4;
3667
+// aWindowConstraints.gridwidth = 1;
3668
+// // aWindowConstraints.gridheight = 3;
3669
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3670
+// //bigThree.add(XYZPanel, aWindowConstraints);
3671
+// bigThree.validate();
3672
+// scenePanel.setVisible(true);
3673
+// centralPanel.setVisible(false);
3674
+// XYZPanel.setVisible(false);
3675
+ bigThree.ClearUI();
3676
+ bigThree.add(scenePanel);
3677
+ bigThree.FlushUI();
3678
+
3679
+ cameraView.requestFocusInWindow();
26633680 } else
2664
- if (event.getSource() == sixButton)
3681
+ if (source == sixButton)
26653682 {
26663683 radio.layout = sixButton;
2667
- bigThree.remove(jtp);
2668
- bigThree.remove(cameraPanel);
2669
- bigThree.remove(XYZPanel);
2670
- aWindowConstraints.gridx = 0;
2671
- aWindowConstraints.gridy = 0;
2672
- aWindowConstraints.gridwidth = 1;
2673
- // aConstraints.gridheight = 3;
2674
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2675
- aWindowConstraints.weightx = 0;
2676
- aWindowConstraints.weighty = 1;
2677
- bigThree.add(jtp, aWindowConstraints);
2678
- aWindowConstraints.weightx = 1;
2679
- aWindowConstraints.gridwidth = 3;
2680
- // aWindowConstraints.gridheight = 3;
2681
- aWindowConstraints.gridx = 1;
2682
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2683
- bigThree.add(cameraPanel, aWindowConstraints);
2684
- aWindowConstraints.weightx = 0;
2685
- aWindowConstraints.gridx = 4;
2686
- aWindowConstraints.gridwidth = 1;
2687
- // aWindowConstraints.gridheight = 3;
2688
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2689
- //bigThree.add(XYZPanel, aConstraints);
2690
- bigThree.revalidate();
3684
+
3685
+ if (CameraPane.FULLSCREEN)
3686
+ fullscreenLayout = radio.layout;
3687
+
3688
+// bigThree.remove(scenePanel);
3689
+// bigThree.remove(centralPanel);
3690
+// bigThree.remove(XYZPanel);
3691
+// aWindowConstraints.gridx = 0;
3692
+// aWindowConstraints.gridy = 0;
3693
+// aWindowConstraints.gridwidth = 1;
3694
+// // aConstraints.gridheight = 3;
3695
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3696
+// aWindowConstraints.weightx = 0;
3697
+// aWindowConstraints.weighty = 1;
3698
+// bigThree.add(scenePanel, aWindowConstraints);
3699
+// aWindowConstraints.weightx = 1;
3700
+// aWindowConstraints.gridwidth = 3;
3701
+// // aWindowConstraints.gridheight = 3;
3702
+// aWindowConstraints.gridx = 1;
3703
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3704
+// bigThree.add(centralPanel, aWindowConstraints);
3705
+// aWindowConstraints.weightx = 0;
3706
+// aWindowConstraints.gridx = 4;
3707
+// aWindowConstraints.gridwidth = 1;
3708
+// // aWindowConstraints.gridheight = 3;
3709
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3710
+// //bigThree.add(XYZPanel, aConstraints);
3711
+// bigThree.validate();
3712
+// scenePanel.setVisible(true);
3713
+// centralPanel.setVisible(true);
3714
+// XYZPanel.setVisible(false);
3715
+ bigThree.ClearUI();
3716
+ bigThree.add(centralPanel);
3717
+ bigThree.add(scenePanel);
3718
+ bigThree.FlushUI();
3719
+
3720
+ cameraView.requestFocusInWindow();
26913721 } else
2692
- if (event.getSource() == sevenButton)
3722
+ if (source == sevenButton)
26933723 {
26943724 radio.layout = sevenButton;
2695
- bigThree.remove(jtp);
2696
- bigThree.remove(cameraPanel);
2697
- bigThree.remove(XYZPanel);
2698
- aWindowConstraints.gridx = 0;
2699
- aWindowConstraints.gridy = 0;
2700
- aWindowConstraints.gridwidth = 1;
2701
- // aWindowConstraints.gridheight = 3;
2702
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2703
- aWindowConstraints.weightx = 0;
2704
- aWindowConstraints.weighty = 1;
2705
- bigThree.add(jtp, aWindowConstraints);
2706
- aWindowConstraints.weightx = 1;
2707
- aWindowConstraints.gridwidth = 3;
2708
- // aWindowConstraints.gridheight = 3;
2709
- aWindowConstraints.gridx = 1;
2710
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2711
- bigThree.add(cameraPanel, aWindowConstraints);
2712
- aWindowConstraints.weightx = 0;
2713
- aWindowConstraints.gridx = 4;
2714
- aWindowConstraints.gridwidth = 1;
2715
- // aConstraints.gridheight = 3;
2716
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2717
- bigThree.add(XYZPanel, aWindowConstraints);
2718
- bigThree.revalidate();
3725
+
3726
+ if (CameraPane.FULLSCREEN)
3727
+ fullscreenLayout = radio.layout;
3728
+
3729
+// bigThree.remove(scenePanel);
3730
+// bigThree.remove(centralPanel);
3731
+// bigThree.remove(XYZPanel);
3732
+// aWindowConstraints.gridx = 0;
3733
+// aWindowConstraints.gridy = 0;
3734
+// aWindowConstraints.gridwidth = 1;
3735
+// // aWindowConstraints.gridheight = 3;
3736
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3737
+// aWindowConstraints.weightx = 0;
3738
+// aWindowConstraints.weighty = 1;
3739
+// bigThree.add(scenePanel, aWindowConstraints);
3740
+// aWindowConstraints.weightx = 1;
3741
+// aWindowConstraints.gridwidth = 3;
3742
+// // aWindowConstraints.gridheight = 3;
3743
+// aWindowConstraints.gridx = 1;
3744
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3745
+// bigThree.add(centralPanel, aWindowConstraints);
3746
+// aWindowConstraints.weightx = 0;
3747
+// aWindowConstraints.gridx = 4;
3748
+// aWindowConstraints.gridwidth = 1;
3749
+// // aConstraints.gridheight = 3;
3750
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3751
+// bigThree.add(XYZPanel, aWindowConstraints);
3752
+// bigThree.validate();
3753
+// scenePanel.setVisible(true);
3754
+// centralPanel.setVisible(true);
3755
+// XYZPanel.setVisible(true);
3756
+ bigThree.ClearUI();
3757
+ bigThree.add(scenePanel);
3758
+ bigThree.add(centralPanel);
3759
+ bigThree.add(XYZPanel);
3760
+ bigThree.FlushUI();
3761
+
3762
+ cameraView.requestFocusInWindow();
27193763 } else
2720
- if (event.getSource() == rootButton)
3764
+ if (source == rootButton)
27213765 {
27223766 Object3D obj;
27233767 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2727,66 +3771,84 @@
27273771 EditObject(obj);
27283772 }
27293773
3774
+ cameraView.requestFocusInWindow();
27303775 refreshContents(true);
27313776 } else
2732
- if (event.getSource() == closeButton)
3777
+ if (source == closeButton)
27333778 {
27343779 //System.out.println("CLOSE: " + buttonGroup.getSelection());
27353780 cRadio ab;
27363781 for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
27373782 {
27383783 ab = (cRadio)e.nextElement();
2739
- if(ab.getModel().isSelected() && ab.GetObject() != client)
3784
+ if (ab.getModel().isSelected() && ab.GetObject() != client)
27403785 {
3786
+ // Patch to avoid bug with transparency.
3787
+ if (!ab.hadMaterial)
3788
+ {
3789
+ ab.object.material = null;
3790
+ }
3791
+
27413792 buttonGroup.remove(ab);
27423793 radioPanel.remove(ab);
27433794
2744
- ab.GetObject().editWindow = null;
3795
+ //ab.GetObject().editWindow = null;
3796
+ ab.GetObject().manipWindow = null;
27453797 // ab.GetObject().objectUI = null; // ?????????
27463798
27473799 ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick();
27483800 break;
27493801 }
27503802 }
3803
+
3804
+ cameraView.requestFocusInWindow();
27513805 refreshContents(true);
27523806 } else
2753
- if (event.getSource() == editItem || event.getSource() == editButton)
3807
+ if (source == editItem || source == editButton)
27543808 {
3809
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3810
+ {
3811
+ Object3D child = (Object3D)e.nextElement();
3812
+ child.pinned = true;
3813
+ }
3814
+
27553815 EditSelection(false);
27563816 } else
2757
- if (event.getSource() == uneditButton)
3817
+ if (source == uneditButton)
27583818 {
27593819 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
27603820 {
27613821 Object3D child = (Object3D)e.nextElement();
27623822 if(child.editWindow != null)
27633823 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3824
+ child.pinned = false;
27643825 child.CloseUI();
27653826 listUI.remove(child);
27663827
2767
- child.editWindow = null; // ???????????
3828
+ //child.editWindow = null; // ???????????
27683829 }
2769
- objEditor.ctrlPanel.revalidate();
3830
+ objEditor.ctrlPanel.FlushUI();
27703831 //objEditor.jTree.clearSelection();
27713832 //objEditor.ResetSliders();
27723833 refreshContents(true);
27733834 } else
2774
- if (event.getSource() == clearPanelButton)
3835
+ if (source == clearPanelButton)
27753836 {
27763837 assert(copy == group);
27773838 //copy.ClearUI();
27783839 for (Object3D obj : listUI)
27793840 {
3841
+ obj.pinned = false;
27803842 obj.CloseUI();
27813843 }
27823844 listUI.clear();
27833845 refreshContents(true);
27843846 } else
2785
- if (event.getSource() == allParamsButton)
3847
+ if (source == allParamsButton)
27863848 {
27873849 assert(copy == group);
27883850
2789
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3851
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
27903852
27913853 for (Object3D obj : listUI)
27923854 {
....@@ -2803,19 +3865,19 @@
28033865
28043866 refreshContents(true);
28053867 } else
2806
- if (event.getSource() == unselectButton)
3868
+ if (source == unselectButton)
28073869 {
28083870 objEditor.jTree.clearSelection();
2809
- // ?? oct 2012 GraphreeD.clipboard.clear();
3871
+ // ?? oct 2012 GrafreeD.clipboard.clear();
28103872 objEditor.ResetSliders();
28113873 refreshContents(true);
28123874 } else
2813
- if(event.getSource() instanceof cRadio)
3875
+ if(source instanceof cRadio)
28143876 {
28153877 group.parent = keepparent;
28163878 group.attributes = 0;
28173879 //group.editWindow = null;
2818
- /*cRadio*/ radio = (cRadio)event.getSource();
3880
+ /*cRadio*/ radio = (cRadio)source;
28193881 Object3D obj = radio.GetObject();
28203882 System.out.println("Edit " + obj);
28213883 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -2835,7 +3897,10 @@
28353897 }
28363898
28373899 copy = group;
2838
- //CameraPane.theRenderer.object = group;
3900
+
3901
+ SetUndoStates();
3902
+
3903
+ //Globals.theRenderer.object = group;
28393904 if(!useclient)
28403905 {
28413906 cameraView.renderCamera = radio.camera;
....@@ -2844,25 +3909,54 @@
28443909 cameraView.cameras[cameraView.cameracount] = radio.camera;
28453910 cameraView.targetLookAt.set(radio.camera.lookAt);
28463911 cameraView.object = group;
2847
- cameraView.lighttouched = true;
3912
+ //cameraView.lighttouched = true;
3913
+ Globals.lighttouched = true;
28483914 topView.object = group;
28493915 frontView.object = group;
28503916 sideView.object = group;
28513917 }
2852
- group.editWindow = this;
3918
+
3919
+// fix "+" issue
3920
+ //group.editWindow = this;
3921
+ group.manipWindow = this;
3922
+
28533923 /*
28543924 currentLayout = radio.layout;
28553925 if (currentLayout == null)
28563926 currentLayout = sevenButton;
28573927 */
28583928 radio.layout.doClick();
3929
+
3930
+ ClearUnpinned();
3931
+ //Grafreed.Assert(group != null);
3932
+ //Grafreed.Assert(group.selection != null);
3933
+ SetPinStates(group.selection == null || group.selection.size() > 0);
3934
+ if (group.selection == null || group.selection.size() == 1)
3935
+ EditSelection(false);
28593936 keepparent = group.parent;
28603937 // PARENT = NULL or not???
28613938 //group.parent = null; // ROOT
28623939 //group.attributes = -1;
28633940 ResetModel();
3941
+
3942
+ cameraView.requestFocusInWindow();
28643943 refreshContents(true);
2865
- }
3944
+ } else if (event.getSource() == editCameraItem)
3945
+ {
3946
+ cameraView.ProtectCamera();
3947
+ cameraView.requestFocusInWindow();
3948
+ cameraView.repaint();
3949
+ return;
3950
+ } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton)
3951
+ {
3952
+ cameraView.RevertCamera();
3953
+ cameraView.requestFocusInWindow();
3954
+ cameraView.repaint();
3955
+ return;
3956
+ // } else if (event.getSource() == textureButton)
3957
+ // {
3958
+ // return; // true;
3959
+ }
28663960 else
28673961 {
28683962 //return super.action(event, arg);
....@@ -2871,7 +3965,6 @@
28713965 }
28723966
28733967 boolean useclient = false;
2874
- cRadio radio;
28753968
28763969 void ToggleRoot()
28773970 {
....@@ -2880,7 +3973,7 @@
28803973 if (useclient)
28813974 {
28823975 cameraView.object = client;
2883
- cameraView.lighttouched = true;
3976
+ Globals.lighttouched = true;
28843977 //topView.object = client;
28853978 //frontView.object = client;
28863979 //sideView.object = client;
....@@ -2888,7 +3981,7 @@
28883981 else
28893982 {
28903983 cameraView.object = group;
2891
- cameraView.lighttouched = true;
3984
+ Globals.lighttouched = true;
28923985 //topView.object = group;
28933986 //frontView.object = group;
28943987 //sideView.object = group;
....@@ -2923,6 +4016,28 @@
29234016 refreshContents();
29244017 }
29254018
4019
+ void TransformChildren()
4020
+ {
4021
+ Object3D obj;
4022
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
4023
+ {
4024
+ obj = (Object3D)e.nextElement();
4025
+ obj.KeepTextureMatrices();
4026
+ obj.TransformChildren();
4027
+ obj.RestoreTextureMatrices();
4028
+
4029
+// if (obj.parent == null)
4030
+// {
4031
+// System.out.println("NULL PARENT!");
4032
+// new Exception().printStackTrace();
4033
+// }
4034
+// else
4035
+// TouchTransform(obj);
4036
+// //obj.parent.Touch();
4037
+ }
4038
+
4039
+ refreshContents();
4040
+ }
29264041
29274042 void ResetTransform()
29284043 {
....@@ -3035,7 +4150,7 @@
30354150 refreshContents();
30364151 }
30374152
3038
- void ResetCentroid()
4153
+ void ResetCentroid(boolean full)
30394154 {
30404155 Object3D obj;
30414156 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3050,12 +4165,16 @@
30504165 LA.matIdentity(Object3D.mat);
30514166 obj.getBounds(minima, maxima, false);
30524167 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3053
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
4168
+ if (full)
4169
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
30544170 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
30554171 obj.TransformMesh(Object3D.mat);
4172
+
30564173 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3057
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
4174
+ if (full)
4175
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
30584176 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
4177
+
30594178 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
30604179 //Object3D.mat[3][0] = -Object3D.mat[3][0];
30614180 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3084,7 +4203,8 @@
30844203
30854204 int size = obj.MemorySize();
30864205
3087
- System.err.println((size/1024) + " KB is the size of " + obj);
4206
+ //System.err.println((size/1024) + " KB is the size of " + obj);
4207
+ System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)");
30884208 }
30894209 }
30904210 catch (Exception e)
....@@ -3121,9 +4241,9 @@
31214241 obj = (Object3D)e.nextElement();
31224242
31234243 System.out.println("Object is: " + obj);
3124
- GraphreeD.AnalyzeObject(obj);
4244
+ Grafreed.AnalyzeObject(obj);
31254245 System.out.println("Boundary rep: " + obj.bRep);
3126
- GraphreeD.AnalyzeObject(obj.bRep);
4246
+ Grafreed.AnalyzeObject(obj.bRep);
31274247
31284248 // System.err.println((size/1024) + " KB is the size of " + obj);
31294249 }
....@@ -3165,6 +4285,20 @@
31654285 void GenNormals(boolean crease)
31664286 {
31674287 group.GenNormalsS(crease);
4288
+
4289
+ refreshContents();
4290
+ }
4291
+
4292
+ void GenNormalsMESH()
4293
+ {
4294
+ group.GenNormalsMeshS();
4295
+
4296
+ refreshContents();
4297
+ }
4298
+
4299
+ void GenNormalsMINE()
4300
+ {
4301
+ group.selection.GenNormalsMINE();
31684302
31694303 refreshContents();
31704304 }
....@@ -3250,7 +4384,7 @@
32504384 // LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
32514385 // LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
32524386 //
3253
-// g.add(GraphreeD.clipboard);
4387
+// g.add(GrafreeD.clipboard);
32544388 //
32554389 // buffer.add(g);
32564390 // }
....@@ -3269,8 +4403,8 @@
32694403 // nodes = new Object3D();
32704404 // vertices = new Vector<Vertex>();
32714405 //
3272
-// boolean epsequal = GraphreeD.epsequal;
3273
-// GraphreeD.epsequal = true;
4406
+// boolean epsequal = GrafreeD.epsequal;
4407
+// GrafreeD.epsequal = true;
32744408 //
32754409 // for (int i=0; i<group.selection.size(); i++)
32764410 // {
....@@ -3311,7 +4445,7 @@
33114445 // LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
33124446 // LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
33134447 //
3314
-// g.add(GraphreeD.clipboard);
4448
+// g.add(GrafreeD.clipboard);
33154449 //
33164450 // buffer.add(g);
33174451 // }
....@@ -3319,7 +4453,7 @@
33194453 // makeSomething(buffer, i==group.selection.size()-1);
33204454 // }
33214455 //
3322
-// GraphreeD.epsequal = epsequal;
4456
+// GrafreeD.epsequal = epsequal;
33234457 //
33244458 // //buffer = null;
33254459 // temprep = null;
....@@ -3330,8 +4464,8 @@
33304464
33314465 void ParseVertices()
33324466 {
3333
- boolean epsequal = GraphreeD.epsequal;
3334
- GraphreeD.epsequal = true;
4467
+ boolean epsequal = Grafreed.epsequal;
4468
+ Grafreed.epsequal = true;
33354469
33364470 for (int i=0; i<group.selection.size(); i++)
33374471 {
....@@ -3356,7 +4490,7 @@
33564490 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
33574491 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
33584492
3359
- g.add(GraphreeD.clipboard);
4493
+ g.add(Grafreed.clipboard);
33604494
33614495 buffer.add(g);
33624496 }
....@@ -3371,7 +4505,7 @@
33714505 makeSomething(buffer, i==group.selection.size()-1);
33724506 }
33734507
3374
- GraphreeD.epsequal = epsequal;
4508
+ Grafreed.epsequal = epsequal;
33754509
33764510 refreshContents();
33774511 }
....@@ -3389,7 +4523,16 @@
33894523 String pigment = Object3D.GetPigment(tex);
33904524 //String bump = Object3D.GetBump(tex);
33914525
3392
- com.sun.opengl.util.texture.TextureData texturedata = CameraPane.theRenderer.GetTextureData(pigment, false, node.texres);
4526
+ com.sun.opengl.util.texture.TextureData texturedata = null;
4527
+
4528
+ try
4529
+ {
4530
+ texturedata = Globals.theRenderer.GetTextureData(tex, false, node.texres);
4531
+ }
4532
+ catch (Exception e)
4533
+ {
4534
+ System.err.println("FAIL: " + node);
4535
+ }
33934536
33944537 double s = v.s;
33954538
....@@ -3416,7 +4559,7 @@
34164559 scale /= 3;
34174560
34184561 scale /= 0xFF;
3419
- scale /= 4;
4562
+ // c'est quoi ca? scale /= 4;
34204563
34214564 //v.AO = scale;
34224565
....@@ -3437,12 +4580,26 @@
34374580
34384581 void Align()
34394582 {
4583
+ if (group.selection.size() == 0)
4584
+ return;
4585
+
4586
+ cVector bbmin = new cVector();
4587
+ cVector bbmax = new cVector();
4588
+
4589
+ group.selection.get(0).getBounds(bbmin, bbmax, true);
4590
+
4591
+ double dx = bbmax.x - bbmin.x;
4592
+ double dy = bbmax.y - bbmin.y;
4593
+ double dz = bbmax.z - bbmin.z;
4594
+
4595
+ double scale = Math.sqrt(dx*dx + dy*dy + dz*dz);
4596
+
34404597 for (int i=0; i<group.selection.size(); i++)
34414598 {
34424599 Object3D obj = group.selection.get(i);
34434600
3444
- LA.matTranslate(obj.toParent, i/2f, 0, 0);
3445
- LA.matTranslateInv(obj.fromParent, -i/2f, 0, 0);
4601
+ LA.matTranslate(obj.toParent, i * scale, 0, 0);
4602
+ LA.matTranslateInv(obj.fromParent, -i * scale, 0, 0);
34464603 }
34474604
34484605 refreshContents();
....@@ -3455,7 +4612,7 @@
34554612 // ref.SaveSupports();
34564613 // Object3D par = ref.parent;
34574614 // ref.parent = null;
3458
-// Object3D lowres = (Object3D) GraphreeD.clone(ref);
4615
+// Object3D lowres = (Object3D) GrafreeD.clone(ref);
34594616 // ref.parent = par;
34604617 // ref.RestoreSupports();
34614618
....@@ -3463,11 +4620,11 @@
34634620
34644621 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
34654622
3466
- boolean random = CameraPane.RANDOM;
3467
- CameraPane.RANDOM = false; // parse all random nodes
4623
+ boolean random = CameraPane.SWITCH;
4624
+ CameraPane.SWITCH = false; // parse all random nodes
34684625 lowres.linkVerticesThis(null);
34694626 lowres.linkVerticesThis(sn);
3470
- CameraPane.RANDOM = random;
4627
+ CameraPane.SWITCH = random;
34714628
34724629 System.err.flush();
34734630
....@@ -3485,7 +4642,7 @@
34854642 // lowres.SaveSupports();
34864643 // par = lowres.parent;
34874644 // lowres.parent = null;
3488
-// Object3D newlow = (Object3D) GraphreeD.clone(lowres);
4645
+// Object3D newlow = (Object3D) GrafreeD.clone(lowres);
34894646 Object3D newlow = CloneObject(lowres, false);
34904647 newlow.name = sn.switchobject.get(i).name;
34914648 System.out.println(" pose#" + i + " = " + newlow);
....@@ -3507,7 +4664,7 @@
35074664 return;
35084665
35094666 Object3D poses = group.selection.get(0);
3510
- Object3D ref = GraphreeD.clipboard.get(0);
4667
+ Object3D ref = Grafreed.clipboard.get(0);
35114668
35124669 Object3D newgroup = new Object3D("Po:" + poses.name);
35134670
....@@ -3676,7 +4833,7 @@
36764833 group.selection.RelinkToSupport(); // july 2014
36774834 System.out.println("DONE.");
36784835 refreshContents();
3679
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
4836
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
36804837 }
36814838
36824839 void ReduceMesh(boolean reduction34)
....@@ -3701,20 +4858,20 @@
37014858
37024859 void ClipMesh()
37034860 {
3704
- if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
4861
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
37054862 {
3706
- Object3D content = GraphreeD.clipboard.get(0);
4863
+ Object3D content = Grafreed.clipboard.get(0);
37074864
37084865 if (content instanceof cGroup && ((cGroup)content).transientlink )
37094866 content = ((cGroup)content).get(0);
37104867
37114868 // for (int i=0; i<group.selection.size(); i++)
37124869 // {
3713
-// group.selection.get(i).ClipMesh(GraphreeD.clipboard);
4870
+// group.selection.get(i).ClipMesh(GrafreeD.clipboard);
37144871 // }
3715
- group.selection.ClipMesh(GraphreeD.clipboard);
4872
+ group.selection.ClipMesh(Grafreed.clipboard);
37164873 }
3717
-// group.selection.ClipMesh(GraphreeD.clipboard);
4874
+// group.selection.ClipMesh(GrafreeD.clipboard);
37184875 System.out.println("DONE.");
37194876 refreshContents();
37204877 }
....@@ -3759,6 +4916,18 @@
37594916 void MarkLeaves(boolean hide)
37604917 {
37614918 group.selection.MarkLeaves(hide);
4919
+ refreshContents();
4920
+ }
4921
+
4922
+ void RewindLeaves(boolean hide)
4923
+ {
4924
+ group.selection.RewindLeaves(hide);
4925
+ refreshContents();
4926
+ }
4927
+
4928
+ void RandomLeaves(boolean hide)
4929
+ {
4930
+ group.selection.RandomLeaves(hide);
37624931 refreshContents();
37634932 }
37644933
....@@ -3833,28 +5002,25 @@
38335002 // }
38345003 // }
38355004
3836
- static boolean allparams = true;
3837
-
3838
- static Vector<Object3D> listUI = new Vector<Object3D>();
3839
-
38405005 void EditSelection(boolean newWindow)
38415006 {
5007
+ if (group.selection == null)
5008
+ {
5009
+ EditElement(group, newWindow); // ? new
5010
+ return;
5011
+ }
5012
+
38425013 // aConstraints.gridy = 0;
38435014 for (int i=0; i<group.selection.size(); i++)
38445015 {
38455016 //System.out.println("edit : " + objectPanel.indexOfTab("Material"));
38465017 //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false);
3847
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
5018
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
38485019
38495020 Object3D elem = (Object3D)group.selection.elementAt(i);
3850
- if(elem != group)
5021
+ if(elem != group || !newWindow)
38515022 {
3852
- // if (!(elem instanceof Composite))
3853
- // newWindow = false;
3854
- listUI.add(elem);
3855
- elem.openEditWindow(this, newWindow); //, false);
3856
- System.out.println("edit : " + elem);
3857
- elem.editWindow.refreshContents(true); // ? new
5023
+ EditElement(elem, newWindow); // ? new
38585024 }
38595025 }
38605026 }
....@@ -3929,7 +5095,8 @@
39295095 //new Exception().printStackTrace();
39305096
39315097 freezemodel = true;
3932
-
5098
+ ClearUnpinned();
5099
+
39335100 /**/
39345101 //switch (event.id)
39355102 {
....@@ -3937,7 +5104,6 @@
39375104 //case 702: // Event.LIST_DESELECT
39385105 group.deselectAll();
39395106 TreePath tps[] = objEditor.jTree.getSelectionPaths();
3940
- objEditor.ClearInfo(); // .GetMaterial());
39415107 if (tps != null)
39425108 {
39435109 for (int i=0; i < tps.length; i++)
....@@ -3946,33 +5112,39 @@
39465112
39475113 //if (child.parent != null)
39485114 //child.parent.addSelectee(child);
5115
+ objEditor.SetMaterial(child);
39495116 group.addSelectee(child);
3950
- objEditor.SetMaterial(child); // .GetMaterial());
3951
- objEditor.AddInfo(child, this, true); // .GetMaterial());
3952
- System.err.println("info : " + child.GetPath());
39535117 }
39545118 }
3955
- else
3956
- {
3957
- objEditor.SetMaterial(group); // .GetMaterial());
3958
- objEditor.AddInfo(group, this, true); // .GetMaterial());
3959
- System.err.println("info : " + group.GetPath());
3960
- }
5119
+// else
5120
+// {
5121
+// objEditor.SetMaterial(group); // .GetMaterial());
5122
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
5123
+// System.err.println("info : " + group.GetPath());
5124
+// }
39615125
3962
- objEditor.SetText(); // jan 2014
3963
-
3964
- if (flashIt && !CameraPane.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
5126
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera))
39655127 CameraPane.flash = true;
39665128
3967
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
5129
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
39685130 // a camera
39695131 {
3970
- CameraPane.camerachangeframe = 0; // don't refuse it
3971
- CameraPane.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
3972
- // CameraPane.theRenderer.renderCamera = CameraPane.theRenderer.manipCamera;
3973
- // CameraPane.theRenderer.eyeCamera = CameraPane.theRenderer.manipCamera;
5132
+ if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crash the camera because of invalid lightspace
5133
+ {
5134
+ CameraPane.camerachangeframe = 0; // don't refuse it
5135
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
5136
+ }
5137
+ // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
5138
+ // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
39745139 }
39755140
5141
+ if (tps != null && tps.length == 1)
5142
+ {
5143
+ EditSelection(false);
5144
+ }
5145
+
5146
+ SetPinStates(tps != null && tps.length > 0);
5147
+
39765148 refreshContents();
39775149 //return true;
39785150 }
....@@ -3981,6 +5153,35 @@
39815153
39825154 freezemodel = false;
39835155 }
5156
+
5157
+ void SetPinStates(boolean enabled)
5158
+ {
5159
+ editButton.setEnabled(enabled);
5160
+ uneditButton.setEnabled(enabled);
5161
+ unselectButton.setEnabled(enabled);
5162
+ flashSelectionButton.setEnabled(enabled);
5163
+ }
5164
+
5165
+ void refreshContents(boolean cp)
5166
+ {
5167
+ if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info"))
5168
+ if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING)
5169
+ {
5170
+ objEditor.ClearInfo(); // .GetMaterial());
5171
+
5172
+ for (int i=0; i < group.selection.Size(); i++)
5173
+ {
5174
+ Object3D child = (Object3D) group.selection.get(i);
5175
+
5176
+ objEditor.AddInfo(child, this, true);
5177
+ System.err.println("info : " + child.GetPath());
5178
+ }
5179
+
5180
+ objEditor.SetText(); // jan 2014
5181
+ }
5182
+
5183
+ super.refreshContents(cp);
5184
+ }
39845185
39855186 void linkSomething(Object3D thing)
39865187 {
....@@ -4052,16 +5253,19 @@
40525253 {
40535254 if (group.selection.isEmpty())
40545255 return;
4055
- GraphreeD.clipboardIsTempGroup = false;
5256
+
5257
+ Grafreed.clipboardIsTempGroup = false;
40565258 Composite tGroup = null;
40575259 if (group.selection.size() > 0) // 1)
40585260 {
40595261 tGroup = new cGroup();
4060
- GraphreeD.clipboardIsTempGroup = true;
5262
+ Grafreed.clipboardIsTempGroup = true;
40615263 }
40625264
40635265 if (cut)
40645266 {
5267
+// if (Globals.SAVEONMAKE) // Moved to the clipboard, no need to save.
5268
+// Save();
40655269 //int indices[] = jList.getSelectedIndices();
40665270 //for (int i = indices.length - 1; i >= 0; i--)
40675271 //jList.remove(indices[i]);
....@@ -4097,16 +5301,16 @@
40975301 //System.out.println("cut " + child);
40985302 //System.out.println("parent = " + child.parent);
40995303 // tmp.addChild(child);
4100
- if (GraphreeD.clipboardIsTempGroup)
5304
+ if (Grafreed.clipboardIsTempGroup)
41015305 tGroup.add/*Child*/(tmp);
41025306 else
4103
- GraphreeD.clipboard = tmp;
5307
+ Grafreed.clipboard = tmp;
41045308 }
41055309 else
4106
- if (GraphreeD.clipboardIsTempGroup)
5310
+ if (Grafreed.clipboardIsTempGroup)
41075311 tGroup.add/*Child*/(child);
41085312 else
4109
- GraphreeD.clipboard = child;
5313
+ Grafreed.clipboard = child;
41105314 }
41115315
41125316 //ResetModel();
....@@ -4138,21 +5342,23 @@
41385342 //System.out.println("cut " + elem);
41395343 //System.out.println("parent = " + elem.parent);
41405344 // tmp.addChild(elem);
4141
- if (GraphreeD.clipboardIsTempGroup)
5345
+ if (Grafreed.clipboardIsTempGroup)
41425346 tGroup.add/*Child*/(tmp);
41435347 else
4144
- GraphreeD.clipboard = tmp;
5348
+ Grafreed.clipboard = tmp;
41455349 }
41465350 else
4147
- if (GraphreeD.clipboardIsTempGroup)
5351
+ if (Grafreed.clipboardIsTempGroup)
41485352 tGroup.add/*Child*/(child);
41495353 else
4150
- GraphreeD.clipboard = child;
5354
+ Grafreed.clipboard = child;
41515355 }
41525356
41535357 }
4154
- if (GraphreeD.clipboardIsTempGroup)
4155
- GraphreeD.clipboard = tGroup;
5358
+
5359
+ if (Grafreed.clipboardIsTempGroup)
5360
+ Grafreed.clipboard = tGroup;
5361
+
41565362 if (cut)
41575363 {
41585364 ResetModel();
....@@ -4162,11 +5368,15 @@
41625368
41635369 void paste(boolean expand)
41645370 {
4165
- // if (GraphreeD.clipboard == null)
5371
+ if (Globals.REPLACEONMAKE)
5372
+ Save();
5373
+ boolean keep = Globals.REPLACEONMAKE;
5374
+ Globals.REPLACEONMAKE = false;
5375
+ // if (GrafreeD.clipboard == null)
41665376 // return;
41675377 boolean first = true;
41685378
4169
- if (GraphreeD.clipboardIsTempGroup)
5379
+ if (Grafreed.clipboardIsTempGroup)
41705380 {
41715381 Composite temp;
41725382
....@@ -4177,7 +5387,7 @@
41775387 temp = (Composite)Applet3D.clipboard.deepCopy();
41785388 */
41795389 Object3D elem;
4180
- for (Enumeration e = /*temp.children*/GraphreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
5390
+ for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
41815391 {
41825392 Object3D child = (Object3D)e.nextElement();
41835393
....@@ -4191,7 +5401,7 @@
41915401 else
41925402 elem = child.deepCopy(); // ?
41935403 child.parent = keepparent;
4194
- //if (GraphreeD.clipboardIsTempGroup && LA.isIdentity(elem.fromParent))
5404
+ //if (GrafreeD.clipboardIsTempGroup && LA.isIdentity(elem.fromParent))
41955405 // elem = elem.get(0);
41965406 makeSomething(elem, true); // ?? first);
41975407 //group.addChild(elem);
....@@ -4211,23 +5421,24 @@
42115421 //Object3D cb = Applet3D.clipboard;
42125422 //temp.addChild(cb);
42135423 //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0));
4214
- assert(GraphreeD.clipboard.parent == null);
4215
- Object3D /*Composite*/ keepparent = GraphreeD.clipboard.get(0).parent;
4216
- GraphreeD.clipboard.get(0).parent = null; // Avoid copy?
4217
- if (LA.isIdentity(GraphreeD.clipboard.toParent))
4218
- makeSomething(expand?GraphreeD.clipboard.get(0).copyExpand():GraphreeD.clipboard.get(0).deepCopy());
5424
+ assert(Grafreed.clipboard.parent == null);
5425
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
5426
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
5427
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
5428
+ makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy());
42195429 else
4220
- makeSomething(expand?GraphreeD.clipboard.copyExpand():GraphreeD.clipboard.deepCopy());
4221
- GraphreeD.clipboard.get(0).parent = keepparent;
5430
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
5431
+ Grafreed.clipboard.get(0).parent = keepparent;
42225432 }
42235433
5434
+ Globals.REPLACEONMAKE = keep;
42245435 ResetModel();
42255436 refreshContents();
42265437 }
42275438
4228
- void pasteInto(boolean copyit)
5439
+ void pasteInto(boolean copyit, boolean clone)
42295440 {
4230
-// if (GraphreeD.clipboard == null)
5441
+// if (GrafreeD.clipboard == null)
42315442 // return;
42325443
42335444 if (group.selection.size() != 1)
....@@ -4254,15 +5465,22 @@
42545465 if (copyit)
42555466 {
42565467 // paste(false);
4257
- CloneClipboard(false); // sept 2014
5468
+ if (clone)
5469
+ {
5470
+ CloneClipboard(false); // sept 2014
5471
+ }
5472
+ else
5473
+ {
5474
+ paste(false);
5475
+ }
42585476 }
42595477 else
42605478 {
42615479 boolean first = true;
42625480
4263
- if (GraphreeD.clipboardIsTempGroup)
5481
+ if (Grafreed.clipboardIsTempGroup)
42645482 {
4265
- Composite temp = (Composite)GraphreeD.clipboard;
5483
+ Composite temp = (Composite)Grafreed.clipboard;
42665484 Object3D copy;
42675485 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
42685486 {
....@@ -4272,7 +5490,7 @@
42725490 }
42735491 } else
42745492 {
4275
- linkSomething(GraphreeD.clipboard); //.get(0));
5493
+ linkSomething(Grafreed.clipboard); //.get(0));
42765494 }
42775495 }
42785496 }
....@@ -4349,6 +5567,10 @@
43495567
43505568 void group(Object3D csg, boolean grab)
43515569 {
5570
+ if (Globals.REPLACEONMAKE)
5571
+ Save();
5572
+ boolean keep = Globals.REPLACEONMAKE;
5573
+ Globals.REPLACEONMAKE = false;
43525574 if (//false) // why??
43535575 !group.selection.isEmpty())
43545576 {
....@@ -4462,8 +5684,34 @@
44625684 //node.add(csg);
44635685 //makeSomething(node);
44645686 makeSomething(csg);
5687
+ Globals.REPLACEONMAKE = keep;
44655688 }
44665689
5690
+ void Ungroup(Object3D g)
5691
+ {
5692
+ if (Globals.REPLACEONMAKE)
5693
+ Save();
5694
+ boolean keep = Globals.REPLACEONMAKE;
5695
+ Globals.REPLACEONMAKE = false;
5696
+ if (g instanceof HiddenObject)
5697
+ {
5698
+ HiddenObject h = (HiddenObject) g;
5699
+
5700
+ for (int i=0; i<h.ActualSize(); i++)
5701
+ {
5702
+ objEditor.makeSomething(h.get(i), false);
5703
+ }
5704
+ }
5705
+ else
5706
+ {
5707
+ for (int i=0; i<g.Size(); i++)
5708
+ {
5709
+ objEditor.makeSomething(g.get(i), false);
5710
+ }
5711
+ }
5712
+ Globals.REPLACEONMAKE = keep;
5713
+ }
5714
+
44675715 void ungroup()
44685716 {
44695717 /*
....@@ -4657,21 +5905,6 @@
46575905 }
46585906 */
46595907
4660
- void ImportGFD()
4661
- {
4662
- FileDialog browser = new FileDialog(objEditor.frame, "Import GraphreeD", FileDialog.LOAD);
4663
- browser.show();
4664
- String filename = browser.getFile();
4665
- if (filename != null && filename.length() > 0)
4666
- {
4667
- String fullname = browser.getDirectory() + filename;
4668
-
4669
- //Object3D readobj =
4670
- objEditor.ReadGFD(fullname, objEditor);
4671
- //makeSomething(readobj);
4672
- }
4673
- }
4674
-
46755908 /*
46765909 public void Callback(Object obj)
46775910 {
....@@ -4695,26 +5928,9 @@
46955928 }
46965929 */
46975930
4698
- void ImportVRMLX3D()
4699
- {
4700
- if (GraphreeD.standAlone)
4701
- {
4702
- /**/
4703
- FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
4704
- browser.show();
4705
- String filename = browser.getFile();
4706
- if (filename != null && filename.length() > 0)
4707
- {
4708
- String fullname = browser.getDirectory() + filename;
4709
- LoadVRMLX3D(fullname);
4710
- }
4711
- /**/
4712
- }
4713
- }
4714
-
47155931 String GetFile(String dialogName)
47165932 {
4717
- if (GraphreeD.standAlone)
5933
+ if (Grafreed.standAlone)
47185934 {
47195935 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
47205936 browser.show();
....@@ -4778,10 +5994,49 @@
47785994 cButton flashSelectionButton;
47795995 cButton editButton;
47805996 cButton uneditButton;
5997
+ JCheckBox allParamsButton;
47815998 cButton clearpanelButton;
4782
- cButton allParamsButton;
47835999 cButton unselectButton;
47846000
6001
+ cButton restoreCameraButton;
6002
+
6003
+ cButton saveButton;
6004
+ cButton oneStepButton;
6005
+
6006
+ cButton groupButton;
6007
+ cButton ungroupButton;
6008
+ cButton compositeButton;
6009
+ cButton switchButton;
6010
+ cButton loopButton;
6011
+ cButton textureButton;
6012
+
6013
+ cButton skybox1Button;
6014
+ cButton skybox2Button;
6015
+ cButton skybox3Button;
6016
+ cButton skybox4Button;
6017
+ cButton skybox5Button;
6018
+ cButton skybox6Button;
6019
+ cButton skybox7Button;
6020
+
6021
+ cButton skybox11Button;
6022
+ cButton skybox12Button;
6023
+ cButton skybox13Button;
6024
+ cButton skybox14Button;
6025
+ cButton skybox15Button;
6026
+ cButton skybox16Button;
6027
+ cButton skybox17Button;
6028
+
6029
+ cButton gridButton;
6030
+ cButton boxButton;
6031
+ cButton sphereButton;
6032
+ cButton coneButton;
6033
+ cButton torusButton;
6034
+ cButton superButton;
6035
+ cButton kleinButton;
6036
+ cButton particlesButton;
6037
+ cButton overlayButton;
6038
+ cButton lightButton;
6039
+
47856040 cButton screenfitButton;
47866041 cButton screenfitpointButton;
47876042 cButton snapobjectButton;
....@@ -4793,14 +6048,6 @@
47936048
47946049 cButton setsupportButton;
47956050
4796
- cButton twoButton;
4797
- cButton sixButton;
4798
- cButton threeButton;
4799
- cButton sevenButton;
4800
- cButton fourButton; // full panel
4801
- cButton oneButton; // full XYZ
4802
- //cButton currentLayout;
4803
-
48046051 //
48056052 //Composite
48066053 Object3D // to do !!
....@@ -4810,9 +6057,11 @@
48106057 //JTree jTree;
48116058 private MenuItem lookAtItem;
48126059 private MenuItem lookFromItem;
4813
- private MenuItem switchItem;
6060
+ private MenuItem switchViewItem;
48146061 private MenuItem cutItem;
4815
- private MenuItem duplicateItem;
6062
+ private MenuItem undoItem;
6063
+ private MenuItem redoItem;
6064
+ private JMenuItem duplicateItem;
48166065 private MenuItem cloneItem;
48176066 private MenuItem cloneSupportItem;
48186067 private MenuItem overwriteGeoItem;
....@@ -4823,8 +6072,9 @@
48236072 private MenuItem resetsupportItem;
48246073 private MenuItem resetreferencesItem;
48256074 private MenuItem linkverticesItem;
6075
+ private MenuItem relinkverticesItem;
48266076 private MenuItem setMasterItem;
4827
- private MenuItem resetMeshItem;
6077
+ private MenuItem resetAllItem;
48286078 private MenuItem stepAllItem;
48296079 private MenuItem revertMeshItem;
48306080 private MenuItem poseMeshItem;
....@@ -4835,14 +6085,17 @@
48356085 private MenuItem mergeGeometriesItem;
48366086 private MenuItem copyItem;
48376087 private MenuItem pasteItem;
6088
+ private MenuItem pasteIntoItem;
48386089 private MenuItem pasteLinkItem;
48396090 private MenuItem pasteCloneItem;
48406091 private MenuItem pasteExpandItem;
4841
- private MenuItem clearItem;
6092
+ private MenuItem deleteItem;
48426093 private MenuItem clearAllItem;
48436094 private MenuItem genUVItem;
6095
+ private MenuItem genNormalsMESHItem;
48446096 private MenuItem genNormalsCADItem;
48456097 private MenuItem genNormalsORGANItem;
6098
+ private MenuItem genNormalsMINEItem;
48466099 private MenuItem stripifyItem;
48476100 private MenuItem unstripifyItem;
48486101 private MenuItem trimItem;
....@@ -4871,6 +6124,10 @@
48716124 private MenuItem showleavesItem;
48726125 private MenuItem markleavesItem;
48736126 private MenuItem unmarkleavesItem;
6127
+ private MenuItem rewindleavesItem;
6128
+ private MenuItem unrewindleavesItem;
6129
+ private MenuItem randomleavesItem;
6130
+ private MenuItem unrandomleavesItem;
48746131
48756132 private MenuItem flipVItem;
48766133 private MenuItem unflipVItem;
....@@ -4882,14 +6139,17 @@
48826139 private MenuItem panoTexturesItem;
48836140
48846141 private MenuItem resetCentroidItem;
4885
- private MenuItem transformgeometryItem;
6142
+ private MenuItem resetCentroidXZItem;
48866143 private MenuItem resetTransformItem;
6144
+ private MenuItem transformGeometryItem;
6145
+ private MenuItem transformChildrenItem;
6146
+ private MenuItem hideItem;
48876147 private MenuItem grabItem;
48886148 private MenuItem backItem;
48896149 private MenuItem frontItem;
48906150 private MenuItem cameraItem;
48916151 private MenuItem compositeItem;
4892
- private MenuItem randomItem;
6152
+ private MenuItem switchItem;
48936153 private MenuItem physicsItem;
48946154 private MenuItem frameselectorItem;
48956155 private MenuItem scriptNodeItem;
....@@ -4904,6 +6164,7 @@
49046164
49056165 private MenuItem resetParentItem;
49066166 private MenuItem repairParentItem;
6167
+ private MenuItem repairShadowItem;
49076168 private MenuItem sortbysizeItem;
49086169 private MenuItem sortbynameItem;
49096170
....@@ -4912,6 +6173,8 @@
49126173 private MenuItem attachBumpItem;
49136174 private MenuItem detachBumpItem;
49146175 private MenuItem pigmentBumpItem;
6176
+ private MenuItem embedTexturesItem;
6177
+ private MenuItem deEmbedTexturesItem;
49156178
49166179 private MenuItem particleItem;
49176180 private MenuItem ragdollItem;
....@@ -4924,10 +6187,11 @@
49246187 private MenuItem coneItem;
49256188 private MenuItem torusItem;
49266189 private MenuItem superItem;
6190
+ private MenuItem kleinItem;
49276191 private MenuItem blobItem;
49286192 private MenuItem latheItem;
49296193 private MenuItem bezierItem;
4930
- private MenuItem checkerItem;
6194
+ private MenuItem overlayItem;
49316195 private MenuItem meshItem;
49326196 // private MenuItem meshGroupItem;
49336197 private MenuItem springItem;
....@@ -4936,6 +6200,7 @@
49366200 private MenuItem csgItem;
49376201 private MenuItem templateItem;
49386202 private MenuItem textureItem;
6203
+ private MenuItem billboardItem;
49396204 private MenuItem shadowXItem;
49406205 private MenuItem shadowYItem;
49416206 private MenuItem shadowZItem;
....@@ -4948,11 +6213,6 @@
49486213 private MenuItem doubleItem;
49496214 private MenuItem tripleItem;
49506215
4951
- private MenuItem importGFDItem;
4952
- private MenuItem importVRMLX3DItem;
4953
- private MenuItem import3DSItem;
4954
- private MenuItem importOBJItem;
4955
-
49566216 private MenuItem computeAOItem;
49576217 private MenuItem recompileItem;
49586218 private MenuItem editScriptItem;
....@@ -4962,4 +6222,8 @@
49626222 private MenuItem analyzeItem;
49636223 private MenuItem dumpItem;
49646224 //boolean freezemodel = false;
6225
+
6226
+ Menu cameraMenu;
6227
+ MenuItem editCameraItem;
6228
+ MenuItem restoreCameraItem;
49656229 }