Normand Briere
2019-08-08 8294241adc5fe698b70e13ebd6780af46ab83f7e
GroupEditor.java
....@@ -12,9 +12,11 @@
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,
19
+ Grafreed.iResourceCallBack,
1820 ObjectUI,
1921 Runnable,
2022 ActionListener,
....@@ -22,6 +24,335 @@
2224 DragGestureListener, DragSourceListener, DropTargetListener,
2325 ItemListener // ListSelectionListener
2426 {
27
+
28
+ public void AddSkyboxButton(String f, String s, cGridBag row)
29
+ {
30
+ cButton skyboxButton;
31
+ final String path = "cubemaps/" + f + "-skyboxes/" + s;
32
+ row.add(skyboxButton = GetButton(path + "/preview.jpg", !Grafreed.NIMBUSLAF));
33
+ //row.add(skyboxButton = GetButton(path + "/negx.jpg", !Grafreed.NIMBUSLAF));
34
+ skyboxButton.setToolTipText(s);
35
+ skyboxButton.addActionListener(new ActionListener()
36
+ {
37
+ @Override
38
+ public void actionPerformed(ActionEvent e)
39
+ {
40
+ ChangeSkybox(path);
41
+ }
42
+ });
43
+ }
44
+
45
+ public void AddTextureButton(String f, final String t, cGridBag row)
46
+ {
47
+ cButton textureButton;
48
+ final String path = "textures/" + f + "/"; // + t;
49
+ row.add(textureButton = GetButton(path + "icons/" + t, !Grafreed.NIMBUSLAF));
50
+ textureButton.setToolTipText(f + "s");
51
+ textureButton.addActionListener(new ActionListener()
52
+ {
53
+ @Override
54
+ public void actionPerformed(ActionEvent e)
55
+ {
56
+ ChangeTexture(path + t);
57
+ }
58
+ });
59
+ }
60
+
61
+ public void AddSkyboxTab0(JTabbedPane skyboxpanel)
62
+ {
63
+ cGridBag tab0 = new cGridBag().setVertical(true);
64
+
65
+ tab0.setName("Urban");
66
+ skyboxpanel.add(tab0);
67
+
68
+ cGridBag row0 = new cGridBag();
69
+ cGridBag row1 = new cGridBag();
70
+ cGridBag row2 = new cGridBag();
71
+ cGridBag row3 = new cGridBag();
72
+ cGridBag row4 = new cGridBag();
73
+ cGridBag row5 = new cGridBag();
74
+ cGridBag row6 = new cGridBag();
75
+
76
+ AddSkyboxButton("default", "rgb", row0);
77
+ //AddSkyboxButton("default", "cornell", row0);
78
+ AddSkyboxButton("penguins", "dust", row0);
79
+ AddSkyboxButton("penguins", "tropic", row0);
80
+ AddSkyboxButton("penguins", "yonder", row0);
81
+
82
+ AddSkyboxButton("default", "uffizi", row1);
83
+ AddSkyboxButton("bridge", "Bridge", row1);
84
+ AddSkyboxButton("bridge", "Bridge2", row1);
85
+ AddSkyboxButton("urban", "GamlaStan2", row1);
86
+
87
+ AddSkyboxButton("urban", "Parliament", row2);
88
+ AddSkyboxButton("urban", "Roundabout", row2);
89
+ AddSkyboxButton("urban", "SaintLazarusChurch", row2);
90
+ AddSkyboxButton("urban", "SaintLazarusChurch2", row2);
91
+
92
+ AddSkyboxButton("urban", "SaintLazarusChurch3", row3);
93
+ AddSkyboxButton("urban", "UnionSquare", row3);
94
+ AddSkyboxButton("urban", "Medborgarplatsen", row3);
95
+ AddSkyboxButton("park", "BerzeliiPark", row3);
96
+
97
+ AddSkyboxButton("park", "Buddha", row4);
98
+ AddSkyboxButton("park", "CNTower2", row4);
99
+ AddSkyboxButton("park", "NiagaraFalls1", row4);
100
+ AddSkyboxButton("park", "NiagaraFalls3", row4);
101
+
102
+ AddSkyboxButton("park", "Park", row5);
103
+ AddSkyboxButton("park", "Pond", row5);
104
+ AddSkyboxButton("park", "Skansen", row5);
105
+ AddSkyboxButton("park", "Skansen2", row5);
106
+
107
+ AddSkyboxButton("park", "Skansen3", row6);
108
+ AddSkyboxButton("park", "Skansen4", row6);
109
+ AddSkyboxButton("park", "Skansen5", row6);
110
+ AddSkyboxButton("persson", "VancouverConventionCentre", row6);
111
+
112
+ tab0.add(row0);
113
+ tab0.add(row1);
114
+ tab0.add(row2);
115
+ tab0.add(row3);
116
+ tab0.add(row4);
117
+ tab0.add(row5);
118
+ tab0.add(row6);
119
+
120
+ for (int i=5; --i>=0;)
121
+ {
122
+ //oe.toolboxPanel.Return();
123
+ //tab0.add(new cGridBag());
124
+ }
125
+ }
126
+
127
+ public void AddSkyboxTab1(JTabbedPane skyboxpanel)
128
+ {
129
+ cGridBag tab0 = new cGridBag().setVertical(true);
130
+
131
+ tab0.setName("Nature");
132
+ skyboxpanel.add(tab0);
133
+
134
+ cGridBag row0 = new cGridBag();
135
+ cGridBag row1 = new cGridBag();
136
+ cGridBag row2 = new cGridBag();
137
+ cGridBag row3 = new cGridBag();
138
+ cGridBag row4 = new cGridBag();
139
+ cGridBag row5 = new cGridBag();
140
+ cGridBag row6 = new cGridBag();
141
+
142
+ AddSkyboxButton("beach", "HeartInTheSand", row0);
143
+ AddSkyboxButton("beach", "LarnacaBeach", row0);
144
+ AddSkyboxButton("beach", "PalmTrees", row0);
145
+ AddSkyboxButton("beach", "Tenerife", row0);
146
+
147
+ AddSkyboxButton("beach", "Tenerife2", row1);
148
+ AddSkyboxButton("beach", "Tenerife3", row1);
149
+ AddSkyboxButton("field", "FishPond", row1);
150
+ AddSkyboxButton("field", "Footballfield", row1);
151
+
152
+ AddSkyboxButton("field", "Meadow", row2);
153
+ AddSkyboxButton("field", "Sorsele", row2);
154
+ AddSkyboxButton("field", "Sorsele2", row2);
155
+ AddSkyboxButton("field", "Sorsele3", row2);
156
+
157
+ AddSkyboxButton("forest", "Brudslojan", row3);
158
+ AddSkyboxButton("forest", "Langholmen2", row3);
159
+ AddSkyboxButton("forest", "Plants", row3);
160
+ AddSkyboxButton("mountain", "Maskonaive", row3);
161
+
162
+ AddSkyboxButton("mountain", "Maskonaive2", row4);
163
+ AddSkyboxButton("mountain", "Maskonaive3", row4);
164
+ AddSkyboxButton("mountain", "Teide", row4);
165
+ AddSkyboxButton("park", "Tantolunden4", row4);
166
+
167
+ AddSkyboxButton("park", "Stairs", row5);
168
+ AddSkyboxButton("default", "skycube", row6);
169
+ AddSkyboxButton("rocky", "Langholmen", row5);
170
+ AddSkyboxButton("rocky", "Skinnarviksberget", row5);
171
+
172
+ AddSkyboxButton("rocky", "Tantolunden6", row5);
173
+ AddSkyboxButton("default", "CloudyHills", row6);
174
+ AddSkyboxButton("daz", "Autumn", row6);
175
+ AddSkyboxButton("daz", "MountainTrail", row6);
176
+ /*
177
+Autumn
178
+Greenlands
179
+MountainTrail
180
+Oasis
181
+TheRock
182
+TopOfTheWorld
183
+Winter
184
+ */
185
+
186
+ tab0.add(row0);
187
+ tab0.add(row1);
188
+ tab0.add(row2);
189
+ tab0.add(row3);
190
+ tab0.add(row4);
191
+ tab0.add(row5);
192
+ tab0.add(row6);
193
+
194
+ for (int i=5; --i>=0;)
195
+ {
196
+ //oe.toolboxPanel.Return();
197
+ //tab0.add(new cGridBag());
198
+ }
199
+ }
200
+
201
+ public void AddSkyboxTab2(JTabbedPane skyboxpanel)
202
+ {
203
+ cGridBag tab0 = new cGridBag().setVertical(true);
204
+
205
+ tab0.setName("Night");
206
+ skyboxpanel.add(tab0);
207
+
208
+ cGridBag row0 = new cGridBag();
209
+ cGridBag row1 = new cGridBag();
210
+ cGridBag row2 = new cGridBag();
211
+ cGridBag row3 = new cGridBag();
212
+ cGridBag row4 = new cGridBag();
213
+ cGridBag row5 = new cGridBag();
214
+ cGridBag row6 = new cGridBag();
215
+
216
+ AddSkyboxButton("night", "NightPath", row0);
217
+ AddSkyboxButton("night", "PondNight", row0);
218
+ AddSkyboxButton("night", "Powerlines", row0);
219
+ AddSkyboxButton("night", "SwedishRoyalCastle", row0);
220
+
221
+ AddSkyboxButton("urban", "CNTower", row1);
222
+ AddSkyboxButton("bridge", "ArstaBridge", row1);
223
+ AddSkyboxButton("rocky", "Riddarfjarden", row1);
224
+ AddSkyboxButton("penguins", "sleepyhollow", row1);
225
+
226
+ AddSkyboxButton("penguins", "kenon_star", row2);
227
+ AddSkyboxButton("persson", "corona", row2);
228
+ AddSkyboxButton("persson", "spaceskybox", row2);
229
+ AddSkyboxButton("indoors", "Vasa", row2);
230
+
231
+ AddSkyboxButton("winter", "Backyard", row3);
232
+ AddSkyboxButton("winter", "Creek", row3);
233
+ AddSkyboxButton("winter", "FootballField3", row3);
234
+ AddSkyboxButton("winter", "Forest", row3);
235
+
236
+ AddSkyboxButton("winter", "HornstullsStrand2", row4);
237
+ AddSkyboxButton("winter", "House", row4);
238
+ AddSkyboxButton("winter", "IceLake", row4);
239
+ AddSkyboxButton("winter", "IceRiver", row4);
240
+
241
+ AddSkyboxButton("winter", "Park3", row5);
242
+ AddSkyboxButton("winter", "PondWinter", row5);
243
+ AddSkyboxButton("winter", "Tantolunden5", row5);
244
+ AddSkyboxButton("winter", "Vindelalven", row5);
245
+
246
+ AddSkyboxButton("daz", "TheRock", row6);
247
+ AddSkyboxButton("daz", "TopOfTheWorld", row6);
248
+ AddSkyboxButton("daz", "Winter", row6);
249
+ AddSkyboxButton("mountain", "Ryfjallet", row6);
250
+
251
+ tab0.add(row0);
252
+ tab0.add(row1);
253
+ tab0.add(row2);
254
+ tab0.add(row3);
255
+ tab0.add(row4);
256
+ tab0.add(row5);
257
+ tab0.add(row6);
258
+
259
+ for (int i=5; --i>=0;)
260
+ {
261
+ //oe.toolboxPanel.Return();
262
+ //tab0.add(new cGridBag());
263
+ }
264
+ }
265
+
266
+ public void AddSkyboxTab3(JTabbedPane skyboxpanel)
267
+ {
268
+ cGridBag tab0 = new cGridBag().setVertical(true);
269
+
270
+ tab0.setName("Others");
271
+ skyboxpanel.add(tab0);
272
+
273
+ cGridBag row0 = new cGridBag();
274
+ cGridBag row1 = new cGridBag();
275
+ cGridBag row2 = new cGridBag();
276
+ cGridBag row3 = new cGridBag();
277
+ cGridBag row4 = new cGridBag();
278
+ cGridBag row5 = new cGridBag();
279
+ cGridBag row6 = new cGridBag();
280
+
281
+ AddSkyboxButton("mayhem", "afterrain", row0);
282
+ AddSkyboxButton("mayhem", "aqua4", row0);
283
+ AddSkyboxButton("mayhem", "aqua9", row0);
284
+ AddSkyboxButton("mayhem", "flame", row0);
285
+
286
+ AddSkyboxButton("mayhem", "h2s", row1);
287
+ AddSkyboxButton("mayhem", "prehistoric", row1);
288
+ AddSkyboxButton("mayhem", "scorched", row1);
289
+ AddSkyboxButton("penguins", "desertdawn", row1);
290
+
291
+ AddSkyboxButton("persson", "Citadella", row2);
292
+ AddSkyboxButton("persson", "Citadella2", row2);
293
+ AddSkyboxButton("persson", "clouds1", row2);
294
+ AddSkyboxButton("penguins", "wrath", row2);
295
+
296
+ AddSkyboxButton("persson", "FishermansBastion", row3);
297
+ AddSkyboxButton("persson", "HeroesSquare", row3);
298
+ AddSkyboxButton("indoors", "DallasW", row3);
299
+ AddSkyboxButton("indoors", "MarriottMadisonWest", row3);
300
+
301
+ AddSkyboxButton("persson", "LancellottiChapel", row4);
302
+ AddSkyboxButton("persson", "PereaBeach1", row4);
303
+ AddSkyboxButton("persson", "PereaBeach2", row4);
304
+ AddSkyboxButton("persson", "redeclipse", row4);
305
+
306
+ AddSkyboxButton("daz", "Greenlands", row5);
307
+ AddSkyboxButton("daz", "Oasis", row5);
308
+ AddSkyboxButton("elyvisions", "arch3", row5);
309
+ AddSkyboxButton("elyvisions", "calm_sea", row5);
310
+
311
+ AddSkyboxButton("elyvisions", "rainbow", row6);
312
+ AddSkyboxButton("elyvisions", "distant_sunset", row6);
313
+ AddSkyboxButton("elyvisions", "heaven", row6);
314
+ AddSkyboxButton("elyvisions", "hot", row6);
315
+
316
+ tab0.add(row0);
317
+ tab0.add(row1);
318
+ tab0.add(row2);
319
+ tab0.add(row3);
320
+ tab0.add(row4);
321
+ tab0.add(row5);
322
+ tab0.add(row6);
323
+
324
+ for (int i=5; --i>=0;)
325
+ {
326
+ //oe.toolboxPanel.Return();
327
+ //tab0.add(new cGridBag());
328
+ }
329
+ }
330
+
331
+ public void ChangeSkybox(String skybox)
332
+ {
333
+ //cameraView.envyoff = false;
334
+ group.skyboxname = skybox;
335
+ group.skyboxext = "jpg";
336
+ cameraView.repaint();
337
+ }
338
+
339
+ public void CreateSkyboxPanel(cGridBag skyboxPanel)
340
+ {
341
+ JTabbedPane skyboxpane = new JTabbedPane();
342
+
343
+ AddSkyboxTab0(skyboxpane);
344
+ AddSkyboxTab1(skyboxpane);
345
+ AddSkyboxTab2(skyboxpane);
346
+ AddSkyboxTab3(skyboxpane);
347
+
348
+ skyboxPanel.add(skyboxpane);
349
+ }
350
+
351
+ public void ChangeTexture(String texture)
352
+ {
353
+ cameraView.repaint();
354
+ }
355
+
25356 //ObjEditor objEditor;
26357 public void closeUI2()
27358 {
....@@ -59,6 +390,12 @@
59390 this.copy = this.group = group;
60391 //selectees = this.group.selectees;
61392
393
+ if (copy.versionlist == null)
394
+ {
395
+ copy.versionlist = new Object3D[100];
396
+ copy.versionindex = -1;
397
+ }
398
+
62399 if(ui)
63400 SetupUI(objEditor);
64401 }
....@@ -73,17 +410,29 @@
73410 this.copy = this.group = copy;
74411 //selectees = this.group.selectees;
75412
76
- SetupMenu2(objEditor);
413
+ SetupMenu2(this); //objEditor);
77414 SetupUI2(objEditor);
78415 objEditor.SetupUI(true);
79416 SetupViews(objEditor);
80417
81418 ((cRadio)radioPanel.getComponent(0)).SetCamera(cameraView.renderCamera, true);
419
+
420
+ if (copy.versionlist == null)
421
+ {
422
+ copy.versionlist = new Object3D[100];
423
+ copy.versionindex = -1;
424
+
425
+ Save(true);
426
+ }
82427 }
83428
84429 void CloneSelection(boolean supports)
85430 {
86
- // Object3D keep = GraphreeD.clipboard;
431
+ if (Globals.REPLACEONMAKE)
432
+ Save();
433
+ boolean keep = Globals.REPLACEONMAKE;
434
+ Globals.REPLACEONMAKE = false;
435
+ // Object3D keep = GrafreeD.clipboard;
87436 //Object3D obj;
88437 for (int i=0; i<group.selection.size(); i++)// Enumeration e = group.selection.elements(); e.hasMoreElements();)
89438 {
....@@ -93,18 +442,19 @@
93442
94443 makeSomething(clone, i==group.selection.size()-1);
95444 }
445
+ Globals.REPLACEONMAKE = keep;
96446 }
97447
98448 void CloneClipboard(boolean supports)
99449 {
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));
450
+ assert(Grafreed.clipboard.parent == null);
451
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
452
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
453
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
454
+ makeSomething(CloneObject(Grafreed.clipboard.get(0), false));
105455 else
106
- makeSomething(CloneObject(GraphreeD.clipboard, false));
107
- GraphreeD.clipboard.get(0).parent = keepparent;
456
+ makeSomething(CloneObject(Grafreed.clipboard, false));
457
+ Grafreed.clipboard.get(0).parent = keepparent;
108458 }
109459
110460 static Object3D CloneObject(Object3D obj, boolean supports)
....@@ -118,7 +468,7 @@
118468 // obj.support = null;
119469 if (!supports)
120470 obj.SaveSupports();
121
- Object3D clone = (Object3D)GraphreeD.clone(obj);
471
+ Object3D clone = (Object3D)Grafreed.clone(obj);
122472 obj.parent = parent;
123473 // obj.support = support;
124474 // clone.support = support; // aout 2013
....@@ -147,30 +497,29 @@
147497
148498 //JTextField nameField;
149499
150
- void SetupMenu2(ObjEditor oe)
500
+ void SetupMenu2(GroupEditor oe)
151501 {
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);
502
+ oe.jTree = new cTree();
503
+
163504 Menu menu;
164505 oe.menuBar.add(menu = new Menu("Edit"));
165506 //editItem = menu.add(new MenuItem("Edit"));
166507 //editItem.addActionListener(this);
167
- duplicateItem = menu.add(new MenuItem("Duplicate"));
508
+
509
+// undoItem = menu.add(new MenuItem("Undo"));
510
+// undoItem.addActionListener(this);
511
+// redoItem = menu.add(new MenuItem("Redo"));
512
+// redoItem.addActionListener(this);
513
+// menu.add("-");
514
+ duplicateItem = oe.jTree.popup.add(new JMenuItem("Duplicate"));
168515 duplicateItem.addActionListener(this);
169
- menu.add("-");
170516 cloneItem = menu.add(new MenuItem("Clone"));
171517 cloneItem.addActionListener(this);
518
+ if (Globals.ADVANCED)
519
+ {
172520 cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
173521 cloneSupportItem.addActionListener(this);
522
+ }
174523 menu.add("-");
175524 cutItem = menu.add(new MenuItem("Cut"));
176525 cutItem.addActionListener(this);
....@@ -178,27 +527,123 @@
178527 copyItem.addActionListener(this);
179528 pasteItem = menu.add(new MenuItem("Paste"));
180529 pasteItem.addActionListener(this);
530
+
531
+ menu.add("-");
532
+ pasteIntoItem = menu.add(new MenuItem("Paste into"));
533
+ pasteIntoItem.addActionListener(this);
181534 pasteLinkItem = menu.add(new MenuItem("Paste link"));
182535 pasteLinkItem.addActionListener(this);
183536 pasteCloneItem = menu.add(new MenuItem("Paste clone"));
184537 pasteCloneItem.addActionListener(this);
185538 // pasteExpandItem = menu.add(new MenuItem("Paste expand"));
186539 // pasteExpandItem.addActionListener(this);
187
- clearItem = menu.add(new MenuItem("Clear"));
188
- clearItem.addActionListener(this);
540
+ menu.add("-");
541
+ deleteItem = menu.add(new MenuItem("Delete"));
542
+ deleteItem.addActionListener(this);
543
+
544
+ if (Globals.ADVANCED)
545
+ {
546
+ // Deletes the cameras...
189547 clearAllItem = menu.add(new MenuItem("Clear All"));
190548 clearAllItem.addActionListener(this);
549
+ }
550
+
551
+ menuBar.add(cameraMenu = new Menu("View"));
552
+ //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer"));
553
+ //zBufferItem.addActionListener(this);
554
+ //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens"));
555
+ //normalLensItem.addActionListener(this);
556
+ cameraMenu.add(restoreCameraItem = new MenuItem("Restore Viewpoint"));
557
+ restoreCameraItem.addActionListener(this);
558
+
559
+// cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen"));
560
+// toggleFullScreenItem.addItemListener(this);
561
+// toggleFullScreenItem.setState(CameraPane.FULLSCREEN);
562
+// cameraMenu.add("-");
563
+//
564
+// cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture"));
565
+// toggleTextureItem.addItemListener(this);
566
+// toggleTextureItem.setState(CameraPane.textureon);
567
+//
568
+// cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch"));
569
+// toggleSwitchItem.addItemListener(this);
570
+// toggleSwitchItem.setState(CameraPane.SWITCH);
571
+
572
+ cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Show Handles"));
573
+ toggleHandleItem.addItemListener(this);
574
+ toggleHandleItem.setState(CameraPane.HANDLES);
575
+
576
+ cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode"));
577
+ togglePaintItem.addItemListener(this);
578
+ togglePaintItem.setState(CameraPane.PAINTMODE);
579
+
580
+ if (Globals.ADVANCED)
581
+ {
582
+ cameraMenu.add("-");
583
+ cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live"));
584
+ toggleLiveItem.addItemListener(this);
585
+ toggleLiveItem.setState(Globals.isLIVE());
191586
587
+ cameraMenu.add(stepItem = new MenuItem("Step"));
588
+ stepItem.addActionListener(this);
589
+ // cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List"));
590
+ // toggleDLItem.addItemListener(this);
591
+ // toggleDLItem.setState(false);
592
+
593
+ cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render"));
594
+ toggleRenderItem.addItemListener(this);
595
+ toggleRenderItem.setState(!CameraPane.frozen);
596
+
597
+ cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug"));
598
+ toggleDebugItem.addItemListener(this);
599
+ toggleDebugItem.setState(Globals.DEBUG);
600
+
601
+ cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum"));
602
+ toggleFrustumItem.addItemListener(this);
603
+ toggleFrustumItem.setState(CameraPane.FRUSTUM);
604
+
605
+ cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact"));
606
+ toggleFootContactItem.addItemListener(this);
607
+ toggleFootContactItem.setState(CameraPane.FOOTCONTACT);
608
+
609
+ cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline"));
610
+ toggleTimelineItem.addItemListener(this);
611
+ }
612
+
613
+// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root"));
614
+// toggleRootItem.addItemListener(this);
615
+// toggleRootItem.setState(false);
616
+// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation"));
617
+// animationItem.addItemListener(this);
618
+// animationItem.setState(CameraPane.ANIMATION);
619
+ cameraMenu.add("-");
620
+ cameraMenu.add(editCameraItem = new MenuItem("Save Viewpoint"));
621
+ editCameraItem.addActionListener(this);
622
+
623
+ if (Globals.ADVANCED)
624
+ {
625
+ oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
626
+ //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
627
+ //cameraMenu.add(switchViewItem = new MenuItem("Reverse View"));
628
+ editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf"));
629
+ oe.cameraMenu.add("-");
630
+ openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy..."));
631
+ openWindowItem.addActionListener(this);
632
+ editLeafItem.addActionListener(this);
633
+ lookAtItem.addActionListener(this);
634
+ //lookFromItem.addActinoListener(this);
635
+ //switchViewItem.addActionListener(this);
636
+ }
637
+
192638 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);
639
+ if (Globals.ADVANCED)
640
+ {
197641 revertMeshItem = menu.add(new MenuItem("Revert Meshes"));
198642 revertMeshItem.addActionListener(this);
199643 resetreferencesItem = menu.add(new MenuItem("Reset Mesh References"));
200644 resetreferencesItem.addActionListener(this);
201645 menu.add("-");
646
+ }
202647 overwriteGeoItem = menu.add(new MenuItem("Overwrite Geometry"));
203648 overwriteGeoItem.addActionListener(this);
204649 overwriteMatItem = menu.add(new MenuItem("Overwrite Material"));
....@@ -210,73 +655,104 @@
210655 overwriteUVItem = menu.add(new MenuItem("Overwrite UV"));
211656 overwriteUVItem.addActionListener(this);
212657 menu.add("-");
658
+ if (Globals.ADVANCED)
659
+ {
213660 generateMeshItem = menu.add(new MenuItem("Generate Meshes"));
214661 generateMeshItem.addActionListener(this);
215662 poseMeshItem = menu.add(new MenuItem("Set Pose Meshes"));
216663 poseMeshItem.addActionListener(this);
217664 menu.add("-");
665
+ }
218666 resetsupportItem = menu.add(new MenuItem("Reset support"));
219667 resetsupportItem.addActionListener(this);
220668 linkverticesItem = menu.add(new MenuItem("Link to Support"));
221669 linkverticesItem.addActionListener(this);
670
+ relinkverticesItem = menu.add(new MenuItem("Re-link to Support"));
671
+ relinkverticesItem.addActionListener(this);
672
+
673
+ if (Globals.ADVANCED)
674
+ {
222675 setMasterItem = menu.add(new MenuItem("Set Master Mesh"));
223676 setMasterItem.addActionListener(this);
677
+ }
224678
225679 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);
680
+// grabItem = menu.add(new MenuItem("Grab"));
681
+// grabItem.addActionListener(this);
230682 backItem = menu.add(new MenuItem("Back"));
231683 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);
684
+ frontItem = menu.add(new MenuItem("Front"));
685
+ frontItem.addActionListener(this);
686
+// compositeItem = menu.add(new MenuItem("Composite"));
687
+// compositeItem.addActionListener(this);
688
+
689
+ if (Globals.ADVANCED)
690
+ {
691
+ hideItem = menu.add(new MenuItem("Hidden Group"));
692
+ hideItem.addActionListener(this);
693
+ }
694
+ ungroupItem = menu.add(new MenuItem("Ungroup"));
695
+ ungroupItem.addActionListener(this);
696
+
697
+// menu.add("-");
698
+//
699
+// switchItem = menu.add(new MenuItem("Switch node"));
700
+// switchItem.addActionListener(this);
701
+ if (Globals.ADVANCED)
702
+ {
241703 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
242704 switchGeoItem.addActionListener(this);
243705 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
244706 switchTransfoItem.addActionListener(this);
245
- morphItem = menu.add(new MenuItem("Morph"));
707
+ morphItem = menu.add(new MenuItem("Morph Group"));
246708 morphItem.addActionListener(this);
709
+
710
+ menu.add("-");
711
+ physicsItem = menu.add(new MenuItem("Physics"));
712
+ physicsItem.addActionListener(this);
713
+ frameselectorItem = menu.add(new MenuItem("Frame Selector"));
714
+ frameselectorItem.addActionListener(this);
247715 scriptNodeItem = menu.add(new MenuItem("Script Node"));
248716 scriptNodeItem.addActionListener(this);
249
- cameraItem = menu.add(new MenuItem("Camera"));
250
- cameraItem.addActionListener(this);
717
+ }
251718
252719 oe.menuBar.add(menu = new Menu("Object"));
253
- textureItem = menu.add(new MenuItem("Texture"));
254
- textureItem.addActionListener(this);
720
+// textureItem = menu.add(new MenuItem("Texture"));
721
+// textureItem.addActionListener(this);
722
+ billboardItem = menu.add(new MenuItem("Billboard"));
723
+ billboardItem.addActionListener(this);
255724 csgItem = menu.add(new MenuItem("CSG"));
256725 csgItem.addActionListener(this);
257
- shadowXItem = menu.add(new MenuItem("Shadow X"));
726
+ shadowXItem = menu.add(new MenuItem("Shadow Red"));
258727 shadowXItem.addActionListener(this);
259
- shadowYItem = menu.add(new MenuItem("Shadow Y"));
728
+ shadowYItem = menu.add(new MenuItem("Shadow Green"));
260729 shadowYItem.addActionListener(this);
261
- shadowZItem = menu.add(new MenuItem("Shadow Z"));
730
+ shadowZItem = menu.add(new MenuItem("Shadow Blue"));
262731 shadowZItem.addActionListener(this);
732
+ attributeItem = menu.add(new MenuItem("Attribute"));
733
+ attributeItem.addActionListener(this);
734
+
735
+ if (Globals.ADVANCED)
736
+ {
737
+ menu.add("-");
263738 linkerItem = menu.add(new MenuItem("Linker"));
264739 linkerItem.addActionListener(this);
265740 templateItem = menu.add(new MenuItem("Template"));
266741 templateItem.addActionListener(this);
267
- attributeItem = menu.add(new MenuItem("Attribute"));
268
- attributeItem.addActionListener(this);
269742 pointflowItem = menu.add(new MenuItem("Point Flow"));
270743 pointflowItem.addActionListener(this);
744
+ }
271745 menu.add("-");
272
- transformgeometryItem = menu.add(new MenuItem("Transform Geometry"));
273
- transformgeometryItem.addActionListener(this);
274746 resetTransformItem = menu.add(new MenuItem("Reset Transform"));
275747 resetTransformItem.addActionListener(this);
276748 resetCentroidItem = menu.add(new MenuItem("Reset Centroid"));
277749 resetCentroidItem.addActionListener(this);
278
- ungroupItem = menu.add(new MenuItem("Ungroup"));
279
- ungroupItem.addActionListener(this);
750
+ resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY"));
751
+ resetCentroidXZItem.addActionListener(this);
752
+ transformGeometryItem = menu.add(new MenuItem("Transform Geometry"));
753
+ transformGeometryItem.addActionListener(this);
754
+ transformChildrenItem = menu.add(new MenuItem("Transform Children"));
755
+ transformChildrenItem.addActionListener(this);
280756
281757 oe.menuBar.add(menu = new Menu("Geometry"));
282758 genUVItem = menu.add(new MenuItem("Generate UV"));
....@@ -285,6 +761,13 @@
285761 genNormalsORGANItem.addActionListener(this);
286762 genNormalsCADItem = menu.add(new MenuItem("CAD Normals"));
287763 genNormalsCADItem.addActionListener(this);
764
+ genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals"));
765
+ genNormalsMESHItem.addActionListener(this);
766
+ if (Globals.ADVANCED)
767
+ {
768
+ genNormalsMINEItem = menu.add(new MenuItem("Stitch Normals"));
769
+ genNormalsMINEItem.addActionListener(this);
770
+ }
288771 stripifyItem = menu.add(new MenuItem("Stripify"));
289772 stripifyItem.addActionListener(this);
290773 unstripifyItem = menu.add(new MenuItem("Unstripify"));
....@@ -306,23 +789,34 @@
306789 reduce34MeshItem.addActionListener(this);
307790 increaseMeshItem = menu.add(new MenuItem("Increase mesh"));
308791 increaseMeshItem.addActionListener(this);
309
- smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
310
- smoothMeshItem.addActionListener(this);
311792 clipMeshItem = menu.add(new MenuItem("Clip mesh"));
312793 clipMeshItem.addActionListener(this);
794
+
795
+ if (Globals.ADVANCED)
796
+ {
797
+ smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
798
+ smoothMeshItem.addActionListener(this);
799
+ }
313800
314801 oe.menuBar.add(menu = new Menu("Attributes"));
315802 clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
316803 clearMaterialsItem.addActionListener(this);
804
+ resetAllItem = menu.add(new MenuItem("Reset All"));
805
+ resetAllItem.addActionListener(this);
806
+ stepAllItem = menu.add(new MenuItem("Step All"));
807
+ stepAllItem.addActionListener(this);
317808 menu.add("-");
318809 liveleavesItem = menu.add(new MenuItem("Live Leaves"));
319810 liveleavesItem.addActionListener(this);
320811 unliveleavesItem = menu.add(new MenuItem("Unlive Leaves"));
321812 unliveleavesItem.addActionListener(this);
813
+ if (Globals.ADVANCED)
814
+ {
322815 supportleavesItem = menu.add(new MenuItem("Support Leaves"));
323816 supportleavesItem.addActionListener(this);
324817 unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves"));
325818 unsupportleavesItem.addActionListener(this);
819
+ }
326820 hideleavesItem = menu.add(new MenuItem("Hide Leaves"));
327821 hideleavesItem.addActionListener(this);
328822 showleavesItem = menu.add(new MenuItem("Show Leaves"));
....@@ -331,6 +825,14 @@
331825 markleavesItem.addActionListener(this);
332826 unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves"));
333827 unmarkleavesItem.addActionListener(this);
828
+ rewindleavesItem = menu.add(new MenuItem("Rewind Leaves"));
829
+ rewindleavesItem.addActionListener(this);
830
+ unrewindleavesItem = menu.add(new MenuItem("Unrewind Leaves"));
831
+ unrewindleavesItem.addActionListener(this);
832
+ randomleavesItem = menu.add(new MenuItem("Random Leaves"));
833
+ randomleavesItem.addActionListener(this);
834
+ unrandomleavesItem = menu.add(new MenuItem("Unrandom Leaves"));
835
+ unrandomleavesItem.addActionListener(this);
334836 menu.add("-");
335837 flipVItem = menu.add(new MenuItem("Flip V"));
336838 flipVItem.addActionListener(this);
....@@ -356,45 +858,117 @@
356858 attachBumpItem.addActionListener(this);
357859 pigmentBumpItem = menu.add(new MenuItem("Pigment -> Bump"));
358860 pigmentBumpItem.addActionListener(this);
861
+ //embedTexturesItem
359862 detachPigmentItem = menu.add(new MenuItem("Detach Pigment"));
360863 detachPigmentItem.addActionListener(this);
361864 detachBumpItem = menu.add(new MenuItem("Detach Bump"));
362865 detachBumpItem.addActionListener(this);
866
+ embedTexturesItem = menu.add(new MenuItem("Embed Textures"));
867
+ embedTexturesItem.addActionListener(this);
868
+ deEmbedTexturesItem = menu.add(new MenuItem("De-embed Textures"));
869
+ deEmbedTexturesItem.addActionListener(this);
363870 menu.add("-");
364871 sortbysizeItem = menu.add(new MenuItem("Sort by size"));
365872 sortbysizeItem.addActionListener(this);
366873 sortbynameItem = menu.add(new MenuItem("Sort by name"));
367874 sortbynameItem.addActionListener(this);
368875 menu.add("-");
876
+ shareGeometriesItem = menu.add(new MenuItem("Share Geometries"));
877
+ shareGeometriesItem.addActionListener(this);
878
+ mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries"));
879
+ mergeGeometriesItem.addActionListener(this);
880
+ if (Globals.ADVANCED)
881
+ {
882
+ // Pretty much the same as duplicate and clone.
369883 extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
370884 extractGeometriesItem.addActionListener(this);
371885 cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry"));
372886 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);
887
+ }
377888
378889 oe.menuBar.add(menu = new Menu("Insert"));
379890 buildCreateMenu(menu);
380891
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
-
392892 oe.menuBar.add(menu = new Menu("Tools"));
393893 buildToolsMenu(menu);
394894 }
395895
896
+ JTabbedPane resourcecontainer;
897
+ cGridBag currenttab;
898
+ boolean added; // patch for jar
899
+
900
+ int tabcount = 0;
901
+ int colcount = 0;
902
+ int rowcount = 0;
903
+
904
+ int columns = 5;
905
+ int rows = 7;
906
+
907
+ public void ResourceCallBack(String[] path)
908
+ {
909
+ for (int i = 0; i < path.length; i++)
910
+ System.out.print(path[i] + "/");
911
+ System.out.println();
912
+ if (rowcount == 0)
913
+ {
914
+ currenttab = new cGridBag();
915
+ added = false;
916
+ String tabname = String.valueOf((char)('A'+tabcount));
917
+ currenttab.setName(tabname);
918
+ rowcount = 1;
919
+ }
920
+
921
+ if (path.length > 1 && path[1].toLowerCase().endsWith(".jpg"))
922
+ {
923
+ if (!added)
924
+ {
925
+ added = true;
926
+ resourcecontainer.add(currenttab);
927
+ String tabname = String.valueOf((char)('A'+tabcount));
928
+ resourcecontainer.setToolTipTextAt(tabcount++, "Texture Group " + tabname);
929
+ }
930
+
931
+ AddTextureButton(path[0], path[1], currenttab);
932
+ if (++colcount >= columns)
933
+ {
934
+ colcount = 0;
935
+ currenttab.Return();
936
+
937
+ if (rowcount++ >= rows)
938
+ {
939
+ rowcount = 0;
940
+ }
941
+ }
942
+ }
943
+ else
944
+ {
945
+// if (!path[path.length-1].equals("icons"))
946
+// resourcecontainer.Return();
947
+ }
948
+ }
949
+
950
+ void CreateTexturePanel(cGridBag container)
951
+ {
952
+ resourcecontainer = new JTabbedPane();
953
+ container.add(resourcecontainer);
954
+
955
+ Grafreed.ParseResources("textures", this);
956
+ }
957
+
396958 void SetupUI2(ObjEditor oe)
397959 {
960
+ // June 2019
961
+ if (oe == null)
962
+ {
963
+ //super.SetupUI2(this);
964
+ //return;
965
+ }
966
+
967
+ if (copy != group)
968
+ {
969
+ //super.SetupUI2(this);
970
+ }
971
+
398972 //new Exception().printStackTrace();
399973
400974 oe.radioPanel = new JPanel(new GridBagLayout());
....@@ -423,150 +997,239 @@
423997 oe.radioPanel.add(dummyButton);
424998 oe.buttonGroup.add(dummyButton);
425999 */
426
- aConstraints.gridy += 1;
427
- oe.aConstraints.gridwidth = 1;
428
- oe.aConstraints.gridx = 0;
1000
+ cGridBag copyOptionsPanel = new cGridBag();
1001
+
1002
+ copyOptionsPanel.preferredHeight = 2;
4291003
430
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", CameraPane.isLIVE()), oe.aConstraints);
1004
+ //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
1005
+
1006
+ //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1007
+ //minButton.setToolTipText("Minimize window");
1008
+ //minButton.addActionListener(this);
1009
+
1010
+ if (Globals.ADVANCED)
1011
+ {
1012
+ oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1013
+ maxButton.setToolTipText("Maximize window");
1014
+ maxButton.addActionListener(this);
1015
+ }
1016
+
1017
+ oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1018
+ fullButton.setToolTipText("Full-screen window");
1019
+ fullButton.addActionListener(this);
1020
+
1021
+ oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1022
+ screenfitButton.setToolTipText("Screen fit");
1023
+ screenfitButton.addActionListener(this);
1024
+
1025
+ oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1026
+ restoreCameraButton.setToolTipText("Restore viewpoint");
1027
+ restoreCameraButton.addActionListener(this);
1028
+
1029
+ copyOptionsPanel.add(saveVersionButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1030
+ saveVersionButton.setToolTipText("Duplicate current version");
1031
+ saveVersionButton.addActionListener(this);
1032
+
1033
+ copyOptionsPanel.add(deleteVersionButton = GetButton("icons/trash.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1034
+ deleteVersionButton.setToolTipText("Delete current version");
1035
+ deleteVersionButton.addActionListener(this);
1036
+
1037
+ copyOptionsPanel.add(previousVersionButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1038
+ previousVersionButton.setToolTipText("Previous version");
1039
+ previousVersionButton.addActionListener(this);
1040
+ previousVersionButton.setEnabled(false);
1041
+
1042
+ cGridBag updown = new cGridBag().setVertical(true);
1043
+ updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1044
+ restoreButton.setToolTipText("Undo (restore current version)");
1045
+ restoreButton.addActionListener(this);
1046
+ //restoreButton.setEnabled(false);
1047
+
1048
+ updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1049
+ replaceButton.setToolTipText("Save (replace current version)");
1050
+ replaceButton.addActionListener(this);
1051
+ //replaceButton.setEnabled(false);
1052
+
1053
+ copyOptionsPanel.add(updown);
1054
+
1055
+ copyOptionsPanel.add(nextVersionButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1056
+ nextVersionButton.setToolTipText("Next version");
1057
+ nextVersionButton.addActionListener(this);
1058
+ nextVersionButton.setEnabled(false);
1059
+
1060
+ oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints);
1061
+ liveCB.setToolTipText("Enable animation");
4311062 liveCB.addItemListener(this);
4321063
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);
1064
+ oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1065
+ oneStepButton.setToolTipText("Animate one step forward");
1066
+ oneStepButton.addActionListener(this);
1067
+
1068
+ oe.toolbarPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints);
1069
+ fastCB.setToolTipText("Fast mode");
4511070 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);
1071
+
1072
+ //oe.toolboxPanel.Return();
1073
+
1074
+// copyOptionsPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints);
1075
+// trackCB.setToolTipText("Enable tracking");
1076
+// trackCB.addItemListener(this);
4581077
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;
4991078 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
5001079 // 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;
5051080
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);
1081
+ if (Globals.ADVANCED)
1082
+ {
1083
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1084
+ snapobjectButton.addActionListener(this);
1085
+ snapobjectButton.setToolTipText("Snap Object");
1086
+
1087
+ oe.toolbarPanel.add(fourButton = GetButton("icons/controls-horizontal.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
5211088 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);
1089
+ fourButton.setToolTipText("Show control panel only");
1090
+ }
1091
+
1092
+ //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
1093
+
1094
+ oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1095
+ twoButton.setToolTipText("Show 3D view only");
1096
+ twoButton.addActionListener(this);
1097
+ this.fullscreenLayout = twoButton;
1098
+
1099
+ oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1100
+ threeButton.setToolTipText("Show controls and 3D view");
5251101 threeButton.addActionListener(this);
526
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
527
- sevenButton.addActionListener(this);
1102
+ oe.toolbarPanel.add(sixButton = GetButton("icons/viewcontrols.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1103
+ sixButton.setToolTipText("Show 3D view and controls");
1104
+ sixButton.addActionListener(this);
1105
+// oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1106
+// sevenButton.setToolTipText("3-column layout");
1107
+// sevenButton.addActionListener(this);
5281108 //
5291109
530
- oe.toolbarPanel.add(rootButton = new cButton(" o o o E ")); //, oe.aConstraints);
1110
+ oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1111
+ rootButton.setToolTipText("Open selection in new tab");
5311112 rootButton.addActionListener(this);
532
- oe.aConstraints.gridx += 1;
533
- oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
1113
+
1114
+ oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1115
+ closeButton.setToolTipText("Close tab");
5341116 closeButton.addActionListener(this);
5351117 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
5361118 //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;
5451119
546
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
1120
+ cGridBag row1 = new cGridBag();
1121
+
1122
+ // INSERT
1123
+ row1.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1124
+ gridButton.setToolTipText("Create grid");
1125
+ gridButton.addActionListener(this);
1126
+
1127
+ row1.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1128
+ boxButton.setToolTipText("Create box");
1129
+ boxButton.addActionListener(this);
1130
+
1131
+ row1.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1132
+ sphereButton.setToolTipText("Create sphere");
1133
+ sphereButton.addActionListener(this);
1134
+
1135
+ row1.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1136
+ coneButton.setToolTipText("Create cone");
1137
+ coneButton.addActionListener(this);
1138
+
1139
+ row1.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1140
+ torusButton.setToolTipText("Create torus");
1141
+ torusButton.addActionListener(this);
1142
+
1143
+ row1.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1144
+ superButton.setToolTipText("Create superellipsoid");
1145
+ superButton.addActionListener(this);
1146
+
1147
+ if (Globals.ADVANCED)
1148
+ {
1149
+ oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1150
+ kleinButton.setToolTipText("Create Klein bottle");
1151
+ kleinButton.addActionListener(this);
1152
+ }
1153
+
1154
+ row1.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1155
+ particlesButton.setToolTipText("Create particle system");
1156
+ particlesButton.addActionListener(this);
1157
+
1158
+ oe.toolboxPanel.add(row1);
1159
+
1160
+ cGridBag row2 = new cGridBag();
1161
+
1162
+ row2.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1163
+ groupButton.setToolTipText("Create group");
1164
+ groupButton.addActionListener(this);
1165
+
1166
+ row2.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1167
+ compositeButton.setToolTipText("Create composite");
1168
+ compositeButton.addActionListener(this);
1169
+
1170
+ row2.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1171
+ switchButton.setToolTipText("Create item switcher");
1172
+ switchButton.addActionListener(this);
1173
+
1174
+ row2.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1175
+ loopButton.setToolTipText("Create loop");
1176
+ loopButton.addActionListener(this);
1177
+
1178
+ row2.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1179
+ textureButton.setToolTipText("Create texture");
1180
+ textureButton.addActionListener(this);
1181
+
1182
+ row2.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1183
+ overlayButton.setToolTipText("Create overlay");
1184
+ overlayButton.addActionListener(this);
1185
+
1186
+ row2.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1187
+ lightButton.setToolTipText("Create light");
1188
+ lightButton.addActionListener(this);
1189
+
1190
+ oe.toolboxPanel.add(row2);
1191
+
1192
+ cGridBag textures = new cGridBag();
1193
+
1194
+ CreateTexturePanel(textures);
1195
+
1196
+ oe.toolboxPanel.add(textures);
1197
+
1198
+ textures.preferredHeight = 100;
1199
+
1200
+ CreateSkyboxPanel(oe.skyboxPanel);
1201
+
1202
+ // EDIT panel
1203
+ editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1204
+ editButton.setToolTipText("Pin selection controls");
1205
+ editButton.addActionListener(this);
1206
+
1207
+ editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1208
+ uneditButton.setToolTipText("Unpin and remove selection controls");
5471209 uneditButton.addActionListener(this);
5481210
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);
1211
+ editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
1212
+ allParamsButton.setToolTipText("Show all controls");
5611213 allParamsButton.addActionListener(this);
5621214
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);
568
- unselectButton.addActionListener(this);
1215
+ editCommandsPanel.add(clearPanelButton = GetButton("icons/clear.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1216
+ clearPanelButton.setToolTipText("Clear all controls");
1217
+ clearPanelButton.addActionListener(this);
5691218
1219
+ //editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1220
+ //unselectButton.setToolTipText("Unselect");
1221
+ //unselectButton.addActionListener(this);
1222
+
1223
+ editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1224
+ flashSelectionButton.setToolTipText("Highlight selection");
1225
+ flashSelectionButton.addActionListener(this);
1226
+
1227
+ editCommandsPanel.preferredHeight = 1;
1228
+
1229
+ SetPinStates(false);
1230
+// oe.treePanel.add(commandsPanel);
1231
+// oe.treePanel.Return();
1232
+
5701233 // oe.aConstraints.gridx += 1;
5711234 // oe.aConstraints.weighty = 0;
5721235 // oe.aConstraints.gridwidth = 1;
....@@ -578,47 +1241,32 @@
5781241 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
5791242 // gcButton.addActionListener(this);
5801243
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;
1244
+ cGridBag jSPPanel = new cGridBag();
1245
+
1246
+ JScrollPane jSP;
5921247 //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);
1248
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints);
5941249 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;
6141250
1251
+ oe.treePanel.add(jSPPanel);
1252
+ oe.treePanel.Return();
1253
+
1254
+ oe.treePanel.add(copyOptionsPanel);
1255
+ oe.treePanel.Return();
1256
+ cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0);
1257
+ versionSlider = (cNumberSlider)sliderPane.getComponent(1);
1258
+ sliderPane.preferredHeight = 1;
1259
+
1260
+// mainPanel.setDividerLocation(0.1); //1.0);
1261
+ mainPanel.setResizeWeight(0.4);
1262
+
6151263 //jList.addListSelectionListener(this);
6161264 oe.jTree.addTreeSelectionListener(this);
6171265 //jTree.setRootVisible(false);
6181266 //jTree.setEditable(true);
6191267 oe.jTree.setDragEnabled(true);
6201268 //jTree.setPreferredSize(new Dimension(10,10));
621
- jSP.setPreferredSize(new Dimension(100,200));
1269
+ //jSP.setPreferredSize(new Dimension(100,200));
6221270
6231271 oe.jTree.setCellRenderer(new cTreeModel.Renderer());
6241272
....@@ -630,23 +1278,163 @@
6301278 dgr.addDragGestureListener(this);
6311279 }catch(Exception e) {}
6321280 */
633
- radio.layout = sevenButton;
1281
+ radio.layout = threeButton; // sixButton;
6341282 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
6351283 }
1284
+
1285
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
1286
+ {
1287
+ panel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
1288
+ colorCB.setToolTipText("Copy color when dropped");
1289
+ colorCB.addItemListener(this);
1290
+
1291
+ panel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
1292
+ materialCB.setToolTipText("Copy material when dropped");
1293
+ materialCB.addItemListener(this);
1294
+
1295
+ panel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
1296
+ textureCB.setToolTipText("Copy texture when dropped");
1297
+ textureCB.addItemListener(this);
1298
+
1299
+ panel.Return();
1300
+
1301
+ panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
1302
+ boxCB.setToolTipText("Display bounding boxes");
1303
+ boxCB.addItemListener(this);
1304
+
1305
+ panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
1306
+ zoomBoxCB.setToolTipText("Display only for wheel");
1307
+ zoomBoxCB.addItemListener(this);
1308
+
1309
+ if (true) // Globals.ADVANCED)
1310
+ {
1311
+// panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
1312
+// supportCB.setToolTipText("Enable rigging");
1313
+// supportCB.addItemListener(this);
1314
+
1315
+ panel.add(freezeCB = new cCheckBox("Freeze", Globals.FREEZEONMOVE)); //, constraints);
1316
+ freezeCB.setToolTipText("Fast moving camera");
1317
+ freezeCB.addItemListener(this);
1318
+
1319
+ // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
1320
+ // localCB.addItemListener(this);
1321
+
1322
+ panel.Return();
1323
+
1324
+ panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
1325
+ crowdCB.setToolTipText("Used for crowds");
1326
+ crowdCB.addItemListener(this);
1327
+
1328
+ panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
1329
+ smoothCB.setToolTipText("Snapping delay");
1330
+ smoothCB.addItemListener(this);
1331
+
1332
+// panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
1333
+// slowCB.setToolTipText("Smooth interpolation");
1334
+// slowCB.addItemListener(this);
1335
+ panel.add(minshaderCB = new cCheckBox("Min shader", Globals.MINSHADER)); //, constraints);
1336
+ minshaderCB.setToolTipText("Minimal fast shader");
1337
+ minshaderCB.addItemListener(this);
1338
+
1339
+// constraints.gridy += 1;
1340
+// panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
1341
+// speakerMocapCB.addItemListener(this);
1342
+
1343
+ panel.Return();
1344
+
1345
+ if (false)
1346
+ {
1347
+ // handled in scripts
1348
+ //constraints.gridy += 1;
1349
+ panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints);
1350
+ speakerCameraCB.addItemListener(this);
1351
+
1352
+ //constraints.gridy += 1;
1353
+ panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints);
1354
+ speakerFocusCB.addItemListener(this);
1355
+
1356
+ //constraints.gridy += 1;
1357
+ panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
1358
+ smoothfocusCB.addItemListener(this);
1359
+ panel.Return();
1360
+ }
1361
+
1362
+//constraints.gridx += 1;
1363
+//panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
1364
+// debugCB.addItemListener(this);
1365
+
1366
+ panel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
1367
+ trackCB.setToolTipText("Enable tracking target");
1368
+ trackCB.addItemListener(this);
1369
+
1370
+ panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
1371
+ oeilCB.setToolTipText("Move camera when tracking");
1372
+ oeilCB.addItemListener(this);
1373
+
1374
+ panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints);
1375
+ shadowCB.setToolTipText("When live compute shadows");
1376
+ shadowCB.addItemListener(this);
1377
+
1378
+ panel.Return();
1379
+ panel.add(toggleTextureCB = new cCheckBox("Textures", CameraPane.textureon)); //, constraints);
1380
+ toggleTextureCB.setToolTipText("Load textures");
1381
+ toggleTextureCB.addItemListener(this);
1382
+
1383
+ panel.add(toggleSwitchCB = new cCheckBox("Switch", CameraPane.SWITCH)); //, constraints);
1384
+ toggleSwitchCB.setToolTipText("Choose a single item");
1385
+ toggleSwitchCB.addItemListener(this);
1386
+
1387
+ panel.add(autokeepCB = new cCheckBox("Auto-replace", Globals.REPLACEONMAKE)); //, constraints);
1388
+ autokeepCB.setToolTipText("On structure change");
1389
+ autokeepCB.addItemListener(this);
1390
+
1391
+ panel.Return();
1392
+ if (Globals.ADVANCED)
1393
+ {
1394
+ panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
1395
+ lookAtCB.setToolTipText("Look-at target");
1396
+ lookAtCB.addItemListener(this);
1397
+ }
1398
+
1399
+ }
1400
+
1401
+ cGridBag fill = new cGridBag();
1402
+ fill.preferredHeight = 200;
1403
+ cGridBag fill2 = new cGridBag();
1404
+ fill2.preferredHeight = 200;
1405
+ cGridBag fill3 = new cGridBag();
1406
+ fill3.preferredHeight = 200;
1407
+
1408
+ panel.add(fill);
1409
+ panel.add(fill2);
1410
+ panel.add(fill3);
1411
+
1412
+ }
6361413
6371414 void EditObject(Object3D obj)
6381415 {
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();
1416
+ cRadio radioButton = new cRadio(obj.name);
1417
+
1418
+ // June 2019. Patch to avoid bug with transparency.
1419
+ radioButton.hadMaterial = obj.material != null;
1420
+ if (!radioButton.hadMaterial)
1421
+ {
1422
+ obj.material = new cMaterial();
1423
+ }
1424
+
1425
+ radioButton.SetObject(obj);
1426
+ radioButton.layout = threeButton; // sixButton;
1427
+ radioButton.SetCamera(cameraView.renderCamera, false);
1428
+ radioButton.addActionListener(this);
1429
+ radioPanel.add(radioButton);
1430
+ buttonGroup.add(radioButton);
1431
+ radioButton.doClick();
6471432 }
1433
+
6481434 void SetupViews(ObjEditor oe)
6491435 {
1436
+ theFrame = this;
1437
+
6501438 oe.SetupViews();
6511439
6521440 System.out.println("SetupViews");
....@@ -655,22 +1443,30 @@
6551443 /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this);
6561444 }
6571445
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;
1446
+ cToggleButton liveCB;
1447
+ cCheckBox supportCB;
1448
+ cCheckBox localCB;
1449
+ cCheckBox crowdCB;
1450
+ cCheckBox smoothCB;
1451
+ cCheckBox minshaderCB;
1452
+
1453
+ cToggleButton fastCB;
1454
+ cCheckBox slowCB;
1455
+ cCheckBox boxCB;
1456
+ cCheckBox zoomBoxCB;
1457
+ cCheckBox freezeCB;
1458
+ //cToggleButton trackCB;
1459
+ cCheckBox trackCB;
1460
+ cCheckBox smoothfocusCB;
6681461 // JCheckBox speakerMocapCB;
669
- JCheckBox speakerCameraCB;
670
- JCheckBox speakerFocusCB;
671
- JCheckBox debugCB;
672
- JCheckBox oeilCB;
673
- JCheckBox lookAtCB;
1462
+ cCheckBox speakerCameraCB;
1463
+ cCheckBox speakerFocusCB;
1464
+ cCheckBox debugCB;
1465
+
1466
+ cCheckBox oeilCB;
1467
+ cCheckBox shadowCB;
1468
+ cCheckBox autokeepCB;
1469
+ cCheckBox lookAtCB;
6741470
6751471 // static int COLOR = 1;
6761472 // static int MATERIAL = 2;
....@@ -678,9 +1474,9 @@
6781474
6791475 int dropAttributes = Object3D.COLOR | Object3D.MATERIAL;
6801476
681
- JCheckBox colorCB;
682
- JCheckBox materialCB;
683
- JCheckBox textureCB;
1477
+ cCheckBox colorCB;
1478
+ cCheckBox materialCB;
1479
+ cCheckBox textureCB;
6841480
6851481 public void itemStateChanged(ItemEvent e)
6861482 {
....@@ -705,10 +1501,10 @@
7051501 dropAttributes |= Object3D.TEXTURE;
7061502 else
7071503 dropAttributes &= ~Object3D.TEXTURE;
708
- }
709
- else if(e.getSource() == liveCB)
1504
+ } else if(e.getSource() == liveCB)
7101505 {
7111506 cameraView.ToggleLive();
1507
+ refreshContents(false);
7121508 }
7131509 else if(e.getSource() == supportCB)
7141510 {
....@@ -724,6 +1520,12 @@
7241520 {
7251521 cameraView.ToggleInertia();
7261522 cameraView.repaint();
1523
+ }
1524
+ else if(e.getSource() == minshaderCB)
1525
+ {
1526
+ Globals.MINSHADER ^= true;
1527
+ cameraView.programInitialized = false;
1528
+ cameraView.repaint();
7271529 }
7281530 else if(e.getSource() == localCB)
7291531 {
....@@ -743,6 +1545,10 @@
7431545 Recompile();
7441546 cameraView.repaint();
7451547 // refreshContents();
1548
+ }
1549
+ else if(e.getSource() == zoomBoxCB)
1550
+ {
1551
+ cameraView.ToggleZoomBoxMode();
7461552 }
7471553 else if(e.getSource() == smoothfocusCB)
7481554 {
....@@ -769,6 +1575,18 @@
7691575 {
7701576 cameraView.ToggleOeil();
7711577 }
1578
+ else if(e.getSource() == shadowCB)
1579
+ {
1580
+ Globals.COMPUTESHADOWWHENLIVE ^= true;
1581
+ }
1582
+ else if(e.getSource() == freezeCB)
1583
+ {
1584
+ Globals.FREEZEONMOVE ^= true;
1585
+ }
1586
+ else if(e.getSource() == autokeepCB)
1587
+ {
1588
+ Globals.REPLACEONMAKE ^= true;
1589
+ }
7721590 else if(e.getSource() == lookAtCB)
7731591 {
7741592 cameraView.ToggleLookAt();
....@@ -785,7 +1603,8 @@
7851603
7861604 /**/
7871605 //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this);
788
- TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1606
+ //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1607
+ TreePath path = objEditor.jTree.getSelectionPath();
7891608 if ((path == null) || (path.getPathCount() <= 1)) {
7901609 // We can't move the root node or an empty selection
7911610 return;
....@@ -848,8 +1667,6 @@
8481667 }
8491668 }
8501669
851
- String string = (String) object;
852
-
8531670 System.out.println("Transfer = " + object + "; drop : " + target);
8541671 // if( object instanceof java.io.File[])
8551672 // {
....@@ -857,7 +1674,11 @@
8571674 // objEditor.DropFile((java.io.File[]) object, true);
8581675 // return;
8591676 // }
860
- if (string.charAt(0) == '/')
1677
+
1678
+ String string = object.toString();
1679
+
1680
+ // File path for Mac and Windows
1681
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
8611682 {
8621683 // file(s)
8631684 String[] names = string.split("\n");
....@@ -884,7 +1705,7 @@
8841705
8851706 flashIt = false;
8861707 CameraPane pane = (CameraPane) target;
887
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1708
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
8881709 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
8891710
8901711 if (group.selection.size() == 1)
....@@ -900,23 +1721,33 @@
9001721
9011722 assert target == objEditor.jTree;
9021723 TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y);
1724
+ Object3D destinationLeaf;
9031725 try {
904
- Object3D dummy = (Composite) destinationPath.getLastPathComponent();
1726
+ destinationLeaf = (Composite) destinationPath.getLastPathComponent();
9051727 } catch (Exception e) {
9061728 System.out.println("destinationPath : " + destinationPath);
9071729 return;
9081730 }
9091731
910
- if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1732
+ for (int i=group.selection.size(); --i>=0;)
9111733 {
1734
+ Object3D child = (Object3D)group.selection.elementAt(i);
1735
+
1736
+ // Cannot move into itself
1737
+ if (child == destinationLeaf)
1738
+ return;
1739
+ }
1740
+
1741
+// june 2019 if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1742
+// {
9121743 loadClipboard(true);
9131744 objEditor.jTree.setSelectionPath(destinationPath);
914
- pasteInto(false);
915
- } else {
916
- loadClipboard(false);
917
- objEditor.jTree.setSelectionPath(destinationPath);
918
- pasteInto(false); // true); // ???
919
- }
1745
+ pasteInto(false, false);
1746
+// } else {
1747
+// loadClipboard(false);
1748
+// objEditor.jTree.setSelectionPath(destinationPath);
1749
+// pasteInto(false, false); // true); // ???
1750
+// }
9201751 }
9211752 public void dropActionChanged(DropTargetDragEvent dtde)
9221753 // Called if the user has modified the current drop gesture
....@@ -1021,83 +1852,107 @@
10211852 {
10221853 //heightFieldItem = menu.add(new MenuItem("Height Field"));
10231854 //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);
1855
+// gridItem = menu.add(new MenuItem("Grid"));
1856
+// gridItem.addActionListener(this);
1857
+// rectoidItem = menu.add(new MenuItem("Box"));
1858
+// rectoidItem.addActionListener(this);
1859
+// ellipsoidItem = menu.add(new MenuItem("Sphere"));
1860
+// ellipsoidItem.addActionListener(this);
1861
+// coneItem = menu.add(new MenuItem("Cone"));
1862
+// coneItem.addActionListener(this);
1863
+// torusItem = menu.add(new MenuItem("Torus"));
1864
+// torusItem.addActionListener(this);
1865
+// superItem = menu.add(new MenuItem("Superellipsoid"));
1866
+// superItem.addActionListener(this);
1867
+
1868
+ cameraItem = menu.add(new MenuItem("Camera"));
1869
+ cameraItem.addActionListener(this);
1870
+
1871
+ if (!Globals.ADVANCED)
1872
+ {
1873
+ kleinItem = menu.add(new MenuItem("Klein Bottle"));
1874
+ kleinItem.addActionListener(this);
1875
+ }
1876
+
1877
+// particleItem = menu.add(new MenuItem("Particle system"));
1878
+// particleItem.addActionListener(this);
1879
+ if (Globals.ADVANCED)
1880
+ {
10381881 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10391882 ragdollItem.addActionListener(this);
10401883 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10411884 ragdoll2Item.addActionListener(this);
1885
+ }
10421886 menu.add("-");
1043
- meshItem = menu.add(new MenuItem("Mesh"));
1887
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10441888 meshItem.addActionListener(this);
10451889 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10461890 // meshGroupItem.addActionListener(this);
1891
+ if (Globals.ADVANCED)
1892
+ {
10471893 springItem = menu.add(new MenuItem("Spring"));
10481894 springItem.addActionListener(this);
10491895 flagItem = menu.add(new MenuItem("Flag"));
10501896 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);
10551897 blobItem = menu.add(new MenuItem("Blob"));
10561898 blobItem.addActionListener(this);
10571899 latheItem = menu.add(new MenuItem("Lathe"));
10581900 latheItem.addActionListener(this);
1059
- lightItem = menu.add(new MenuItem("Light"));
1060
- lightItem.addActionListener(this);
1901
+ }
1902
+ bezierItem = menu.add(new MenuItem("Bezier Patch"));
1903
+ bezierItem.addActionListener(this);
1904
+// overlayItem = menu.add(new MenuItem("Overlay"));
1905
+// overlayItem.addActionListener(this);
1906
+// lightItem = menu.add(new MenuItem("Light"));
1907
+// lightItem.addActionListener(this);
10611908 menu.add("-");
10621909 //superLoopItem = menu.add(new MenuItem("Super Loop"));
10631910 //superLoopItem.addActionListener(this);
1064
- loopItem = menu.add(new MenuItem("Loop"));
1065
- loopItem.addActionListener(this);
1911
+// loopItem = menu.add(new MenuItem("Loop"));
1912
+// loopItem.addActionListener(this);
10661913 doubleItem = menu.add(new MenuItem("Fork"));
10671914 doubleItem.addActionListener(this);
1915
+ if (Globals.ADVANCED)
1916
+ {
10681917 tripleItem = menu.add(new MenuItem("Trident"));
10691918 tripleItem.addActionListener(this);
1919
+ }
10701920 }
10711921
10721922 void buildToolsMenu(Menu menu)
10731923 {
10741924 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
10751925 animationItem.addItemListener(this);
1076
- animationItem.setState(CameraPane.ANIMATION);
1926
+ animationItem.setState(Globals.ANIMATION);
1927
+
1928
+ menu.add(archiveItem = new MenuItem("Archive3D..."));
1929
+ archiveItem.addActionListener(this);
10771930
10781931 menu.add("-");
10791932 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
10801933 parseverticesItem.addActionListener(this);
10811934 textureFieldItem = menu.add(new MenuItem("Texture Field"));
10821935 textureFieldItem.addActionListener(this);
1083
- alignItem = menu.add(new MenuItem("Align"));
1936
+ alignItem = menu.add(new MenuItem("Align Objects"));
10841937 alignItem.addActionListener(this);
1085
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1086
- mirrorItem.addActionListener(this);
10871938 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
10881939 reduceMorphItem.addActionListener(this);
10891940 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
10901941 reduce34MorphItem.addActionListener(this);
1091
-
1092
- menu.add(computeAOItem = new MenuItem("Compute AO"));
1093
- computeAOItem.addActionListener(this);
10941942 menu.add("-");
1095
-
10961943 menu.add(memoryItem = new MenuItem("Memory Usage"));
10971944 memoryItem.addActionListener(this);
1945
+ menu.add(computeAOItem = new MenuItem("Compute AO"));
1946
+ computeAOItem.addActionListener(this);
1947
+
1948
+ if (Globals.ADVANCED)
1949
+ {
1950
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1951
+ mirrorItem.addActionListener(this);
1952
+ menu.add("-");
10981953 menu.add(analyzeItem = new MenuItem("Analyze"));
10991954 analyzeItem.addActionListener(this);
1100
- menu.add(dumpItem = new MenuItem("Dump"));
1955
+ menu.add(dumpItem = new MenuItem("Print"));
11011956 dumpItem.addActionListener(this);
11021957 // menu.add(pathItem = new MenuItem("From-to path"));
11031958 // pathItem.addActionListener(this);
....@@ -1106,6 +1961,8 @@
11061961 resetParentItem.addActionListener(this);
11071962 repairParentItem = menu.add(new MenuItem("Repair Parent"));
11081963 repairParentItem.addActionListener(this);
1964
+ repairShadowItem = menu.add(new MenuItem("Repair Shadow"));
1965
+ repairShadowItem.addActionListener(this);
11091966 menu.add(invariantsItem = new MenuItem("Invariants"));
11101967 invariantsItem.addActionListener(this);
11111968 menu.add(recompileItem = new MenuItem("Recompile"));
....@@ -1113,6 +1970,7 @@
11131970 menu.add("-");
11141971 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11151972 editScriptItem.addActionListener(this);
1973
+ }
11161974 }
11171975
11181976 void ScreenFit()
....@@ -1235,9 +2093,34 @@
12352093 shadow.material = new cMaterial(obj.material);
12362094 shadow.material.diffuse = 0.0001f;
12372095 shadow.material.specular = 0.0001f;
2096
+ //shadow.projectedVertices[1].x = 300;
12382097
12392098 makeSomething(shadow);
12402099 }
2100
+
2101
+ private void ClearUnpinned()
2102
+ {
2103
+ //for (Object3D obj : listUI)
2104
+ for (int i=listUI.size(); --i>=0;)
2105
+ {
2106
+ Object3D obj = listUI.elementAt(i);
2107
+ if (!obj.pinned)
2108
+ {
2109
+ obj.CloseUI();
2110
+ listUI.remove(i);
2111
+ }
2112
+ }
2113
+ }
2114
+
2115
+ private void EditElement(Object3D elem, boolean newWindow)
2116
+ {
2117
+ // if (!(elem instanceof Composite))
2118
+ // newWindow = false;
2119
+ listUI.add(elem);
2120
+ elem.openEditWindow(this, newWindow); //, false);
2121
+ System.out.println("edit : " + elem);
2122
+ elem.editWindow.refreshContents(true); // ? new
2123
+ }
12412124
12422125 /**
12432126 * applyExample
....@@ -1441,9 +2324,9 @@
14412324
14422325 void Overwrite(int mask)
14432326 {
1444
- if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
2327
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14452328 {
1446
- Object3D content = GraphreeD.clipboard.get(0);
2329
+ Object3D content = Grafreed.clipboard.get(0);
14472330
14482331 if (content instanceof cGroup && ((cGroup)content).transientlink )
14492332 content = ((cGroup)content).get(0);
....@@ -1466,6 +2349,7 @@
14662349 //
14672350 public void actionPerformed(ActionEvent event) // , Object arg)
14682351 {
2352
+ Object source = event.getSource();
14692353 /*
14702354 if (event.getSource() == nameField)
14712355 {
....@@ -1477,11 +2361,11 @@
14772361 }
14782362 else
14792363 */
1480
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
2364
+ if (source == lookAtItem || source == lookFromItem)
14812365 {
14822366 ScreenFit();
14832367 } else
1484
- if (event.getSource() == switchItem)
2368
+ if (source == switchViewItem)
14852369 {
14862370 cVector v1 = new cVector();
14872371 cVector v2 = new cVector();
....@@ -1490,11 +2374,11 @@
14902374 objEditor.cameraView.renderCamera.setAim(v2, v1);
14912375 objEditor.cameraView.repaint();
14922376 } else
1493
- if (event.getSource() == rectoidItem)
2377
+ if (source == rectoidItem || source == boxButton)
14942378 {
14952379 makeSomething(new Box());
14962380 } else
1497
- if (event.getSource() == particleItem)
2381
+ if (source == particleItem || source == particlesButton)
14982382 {
14992383 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15002384 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1515,9 +2399,9 @@
15152399 applyExample(particleGeom, "SMOKE");
15162400 makeSomething(particleGeom);
15172401 } else
1518
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
2402
+ if (source == ragdollItem || source == ragdoll2Item)
15192403 {
1520
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
2404
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15212405
15222406 ragdoll.toParent = LA.newMatrix();
15232407 ragdoll.fromParent = LA.newMatrix();
....@@ -1535,7 +2419,7 @@
15352419 } else
15362420 /*
15372421 */
1538
- if (event.getSource() == heightFieldItem)
2422
+ if (source == heightFieldItem)
15392423 {
15402424 Object3D obj = new Object3D();
15412425
....@@ -1573,27 +2457,31 @@
15732457
15742458 makeSomething(obj);
15752459 } else
1576
- if (event.getSource() == gridItem)
2460
+ if (source == gridItem || source == gridButton)
15772461 {
15782462 makeSomething(new Grid());
15792463 } else
1580
- if (event.getSource() == ellipsoidItem)
2464
+ if (source == ellipsoidItem || source == sphereButton)
15812465 {
15822466 makeSomething(new Sphere());
15832467 } else
1584
- if (event.getSource() == coneItem)
2468
+ if (source == coneItem || source == coneButton)
15852469 {
15862470 makeSomething(new Cone());
15872471 } else
1588
- if (event.getSource() == torusItem)
2472
+ if (source == torusItem || source == torusButton)
15892473 {
15902474 makeSomething(new Torus());
15912475 } else
1592
- if (event.getSource() == superItem)
2476
+ if (source == superItem || source == superButton)
15932477 {
15942478 makeSomething(new Superellipsoid());
15952479 } else
1596
- if (event.getSource() == blobItem)
2480
+ if (source == kleinItem || source == kleinButton)
2481
+ {
2482
+ makeSomething(new Klein());
2483
+ } else
2484
+ if (source == blobItem)
15972485 {
15982486 Blob blob = new Blob();
15992487 BlobComponent comp = new BlobComponent();
....@@ -1601,15 +2489,15 @@
16012489 //blob.retile();
16022490 makeSomething(blob);
16032491 } else
1604
- if (event.getSource() == latheItem)
2492
+ if (source == latheItem)
16052493 {
16062494 makeSomething(new Lathe());
16072495 } else
1608
- if (event.getSource() == bezierItem)
2496
+ if (source == bezierItem)
16092497 {
16102498 makeSomething(new BezierSurface());
16112499 } else
1612
- if (event.getSource() == checkerItem)
2500
+ if (source == overlayItem || source == overlayButton)
16132501 {
16142502 /*
16152503 Object3D obj = new BezierSurface(5,8);
....@@ -1624,7 +2512,7 @@
16242512 */
16252513 makeSomething(new Checker());
16262514 } else
1627
- if (event.getSource() == meshItem)
2515
+ if (source == meshItem)
16282516 {
16292517 Object3D itemtomake = new Object3D();
16302518 Object3D child;
....@@ -1645,35 +2533,52 @@
16452533 makeSomething(child);
16462534 }
16472535 } else
1648
- if (event.getSource() == springItem)
2536
+ if (source == springItem)
16492537 {
16502538 cSpring s = new cSpring();
16512539 s.setup();
16522540 makeSomething(s);
16532541 } else
1654
- if (event.getSource() == flagItem)
2542
+ if (source == flagItem)
16552543 {
16562544 cSpring s = new cFlag();
16572545 s.setup();
16582546 makeSomething(s);
16592547 } else
1660
- if (event.getSource() == lightItem)
2548
+ if (source == lightItem || source == lightButton)
16612549 {
16622550 makeSomething(new Light());
16632551 } else
1664
- if (event.getSource() == csgItem)
2552
+// if (source == skybox1Button ||
2553
+// source == skybox2Button ||
2554
+// source == skybox3Button ||
2555
+// source == skybox4Button ||
2556
+// source == skybox5Button ||
2557
+// source == skybox6Button ||
2558
+// source == skybox7Button ||
2559
+// source == skybox11Button ||
2560
+// source == skybox12Button ||
2561
+// source == skybox13Button ||
2562
+// source == skybox14Button ||
2563
+// source == skybox15Button ||
2564
+// source == skybox16Button ||
2565
+// source == skybox17Button)
2566
+// {
2567
+// ChangeSkybox(source);
2568
+// } else
2569
+ if (source == csgItem)
16652570 {
16662571 group(new CSG());
16672572 } else
1668
- if (event.getSource() == templateItem)
2573
+ if (source == templateItem)
16692574 {
16702575 group(new cTemplate());
16712576 } else
1672
- if (event.getSource() == attributeItem)
2577
+ if (source == attributeItem)
16732578 {
16742579 makeSomething(new Attribute());
16752580 } else
1676
- if (event.getSource() == pointflowItem)
2581
+ if (source == pointflowItem)
16772582 {
16782583 makeSomething(new PointFlow());
16792584 } else
....@@ -1685,7 +2590,7 @@
16852590 } else
16862591 */
16872592
1688
- if (event.getSource() == superLoopItem)
2593
+ if (source == superLoopItem)
16892594 {
16902595 Composite g = new cGroup();
16912596 for (int i=0; i<15; i++)
....@@ -1707,30 +2612,30 @@
17072612
17082613 group(g);
17092614 } else
1710
- if (event.getSource() == loopItem)
2615
+ if (source == loopItem || source == loopButton)
17112616 {
17122617 Composite csg = new GroupLeaf();
17132618 csg.count = 5;
17142619 group(csg);
1715
- Composite child = new cGroup();
2620
+ Composite child = new cGroup("Branch");
17162621 csg.addChild(child);
17172622 child.addChild(csg);
17182623 } else
1719
- if (event.getSource() == doubleItem)
2624
+ if (source == doubleItem)
17202625 {
1721
- Composite csg = new GroupLeaf();
2626
+ Composite csg = new GroupLeaf("Fork");
17222627 csg.count = 5;
17232628 group(csg);
1724
- Composite child = new cGroup();
2629
+ Composite child = new cGroup("Branch A");
17252630 csg.addChild(child);
17262631 child.addChild(csg);
1727
- child = new cGroup();
2632
+ child = new cGroup("Branch B");
17282633 csg.addChild(child);
17292634 child.addChild(csg);
17302635 } else
1731
- if (event.getSource() == tripleItem)
2636
+ if (source == tripleItem)
17322637 {
1733
- Composite csg = new GroupLeaf();
2638
+ Composite csg = new GroupLeaf("Trident");
17342639 csg.count = 4;
17352640 group(csg);
17362641 Composite child = new cGroup();
....@@ -1743,73 +2648,105 @@
17432648 csg.addChild(child);
17442649 child.addChild(csg);
17452650 } else
1746
-
1747
- if (event.getSource() == importGFDItem)
2651
+ if (source == computeAOItem)
17482652 {
1749
- ImportGFD();
2653
+ Globals.drawMode = CameraPane.OCCLUSION;
2654
+ cameraView.repaint();
17502655 } 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)
2656
+ if (source == recompileItem)
17692657 {
17702658 Recompile();
17712659 refreshContents();
17722660 } else
1773
- if (event.getSource() == editScriptItem)
2661
+ if (source == editScriptItem)
17742662 {
17752663 OpenDialog();
17762664 refreshContents();
17772665 } else
1778
- if (event.getSource() == invariantsItem)
2666
+ if (source == invariantsItem)
17792667 {
17802668 System.out.println("Invariants:");
1781
- GraphreeD.theApplet3D.universe.invariants();
2669
+ Grafreed.grafreed.universe.invariants();
17822670 } else
1783
- if (event.getSource() == memoryItem)
2671
+ if (source == memoryItem)
17842672 {
17852673 //System.out.println("Invariants:");
17862674 PrintMemory();
17872675 } else
1788
- if (event.getSource() == pathItem)
2676
+ if (source == pathItem)
17892677 {
17902678 PrintPath();
17912679 } else
1792
- if (event.getSource() == analyzeItem)
2680
+ if (source == analyzeItem)
17932681 {
17942682 AnalyzeObject();
17952683 } else
1796
- if (event.getSource() == dumpItem)
2684
+ if (source == dumpItem)
17972685 {
17982686 DumpObject();
17992687 } else
1800
- if (event.getSource() == screenfitButton)
2688
+ if (source == minButton)
18012689 {
1802
- //Reload(lastConverter, lastFilename, true);
2690
+ Minimize();
2691
+ } else
2692
+ if (source == maxButton)
2693
+ {
2694
+ Maximize();
2695
+ } else
2696
+ if (source == fullButton)
2697
+ {
2698
+ ToggleFullScreen();
2699
+ } else
2700
+ if (source == previousVersionButton)
2701
+ {
2702
+ // Go to previous version
2703
+ //if (!Undo())
2704
+ //java.awt.Toolkit.getDefaultToolkit().beep();
2705
+ PreviousVersion();
2706
+ } else
2707
+ if (source == restoreButton)
2708
+ {
2709
+ // Restore current version
2710
+ Restore();
2711
+ //restoreButton.setEnabled(false);
2712
+ } else
2713
+ if (source == replaceButton)
2714
+ {
2715
+ // Overwrite current version
2716
+ Replace();
2717
+ //replaceButton.setEnabled(false);
2718
+ } else
2719
+ if (source == nextVersionButton)
2720
+ {
2721
+ // Go to next version
2722
+ NextVersion();
2723
+ } else
2724
+ if (source == saveVersionButton)
2725
+ {
2726
+ // Save a new version
2727
+ if (!Save(true))
2728
+ java.awt.Toolkit.getDefaultToolkit().beep();
2729
+ } else
2730
+ if (source == deleteVersionButton)
2731
+ {
2732
+ // Delete a new version
2733
+ DeleteVersion();
2734
+ } else
2735
+ if (source == oneStepButton)
2736
+ {
2737
+ Globals.ONESTEP = true;
2738
+ cameraView.repaint();
2739
+ } else
2740
+ if (source == screenfitButton)
2741
+ {
18032742 ScreenFit();
18042743 } else
1805
- if (event.getSource() == screenfitpointButton)
2744
+ if (source == screenfitpointButton)
18062745 {
1807
- //Reload(lastConverter, lastFilename, true);
18082746 ScreenFitPoint();
18092747 } else
1810
- if (event.getSource() == snapobjectButton)
2748
+ if (source == snapobjectButton)
18112749 {
1812
- //Reload(lastConverter, lastFilename, true);
18132750 SnapObject();
18142751 } else
18152752 // if (event.getSource() == recompileButton)
....@@ -1818,13 +2755,13 @@
18182755 // Recompile();
18192756 // refreshContents();
18202757 // } else
1821
- if (event.getSource() == gcButton)
2758
+ if (source == gcButton)
18222759 {
18232760 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18242761 System.gc();
18252762 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18262763 } else
1827
- if (event.getSource() == editLeafItem)
2764
+ if (source == editLeafItem)
18282765 {
18292766 Object3D obj;
18302767 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1838,65 +2775,78 @@
18382775 }
18392776 refreshContents(true);
18402777 } else
1841
- if (event.getSource() == openWindowItem)
2778
+ if (source == openWindowItem)
18422779 {
18432780 EditSelection(true);
18442781 } else
1845
- if (event.getSource() == cutItem || event.getSource() == clearButton)
2782
+ if (source == cutItem || source == clearButton)
18462783 {
18472784 loadClipboard(true);
18482785 } else
1849
- if (event.getSource() == duplicateItem)
2786
+ if (source == undoItem)
18502787 {
1851
- Object3D keep = GraphreeD.clipboard;
2788
+ PreviousVersion();
2789
+ } else
2790
+ if (source == redoItem)
2791
+ {
2792
+ NextVersion();
2793
+ } else
2794
+ if (source == duplicateItem)
2795
+ {
2796
+ Object3D keep = Grafreed.clipboard;
18522797 loadClipboard(false);
18532798 paste(false);
1854
- GraphreeD.clipboard = keep;
2799
+ Grafreed.clipboard = keep;
18552800 } else
1856
- if (event.getSource() == cloneItem)
2801
+ if (source == cloneItem)
18572802 {
18582803 CloneSelection(false);
18592804 } else
1860
- if (event.getSource() == cloneSupportItem)
2805
+ if (source == cloneSupportItem)
18612806 {
18622807 CloneSelection(true);
18632808 } else
1864
- if (event.getSource() == copyItem)
2809
+ if (source == copyItem)
18652810 {
18662811 loadClipboard(false);
18672812 } else
1868
- if (event.getSource() == pasteItem)
2813
+ if (source == pasteItem)
18692814 {
18702815 paste(false);
18712816 } else
1872
- if (event.getSource() == pasteLinkItem)
2817
+ if (source == pasteIntoItem)
18732818 {
1874
- pasteInto(false);
2819
+ pasteInto(true, false);
18752820 } else
1876
- if (event.getSource() == pasteCloneItem)
2821
+ if (source == pasteLinkItem)
18772822 {
1878
- pasteInto(true);
2823
+ pasteInto(false, false);
18792824 } else
1880
- if (event.getSource() == pasteExpandItem)
2825
+ if (source == pasteCloneItem)
2826
+ {
2827
+ pasteInto(true, true);
2828
+ } else
2829
+ if (source == pasteExpandItem)
18812830 {
18822831 paste(true);
18832832 } else
1884
- if (event.getSource() == synchronizeItem)
2833
+ if (source == synchronizeItem)
18852834 {
18862835 Overwrite(Object3D.TRANSFORM);
18872836 } else
1888
- if (event.getSource() == overwriteNameItem)
2837
+ if (source == overwriteNameItem)
18892838 {
18902839 Overwrite(Object3D.NAME);
18912840 } else
1892
- if (event.getSource() == overwriteUVItem)
2841
+ if (source == overwriteUVItem)
18932842 {
18942843 Overwrite(Object3D.UV);
18952844 } else
1896
- if (event.getSource() == overwriteMatItem)
2845
+ if (source == overwriteMatItem)
18972846 {
2847
+ /* july 2015
18982848 if ((dropAttributes & Object3D.TEXTURE) == 0)
1899
- Overwrite(Object3D.MATERIAL);
2849
+ Overwrite(Object3D.MATERIAL | Object3D.COLOR);
19002850 else
19012851 {
19022852 if ((dropAttributes & Object3D.COLOR) == 0 && (dropAttributes & Object3D.MATERIAL) == 0)
....@@ -1908,13 +2858,16 @@
19082858 Overwrite(Object3D.MATERIAL | Object3D.TEXTURE);
19092859 }
19102860 }
2861
+ */
2862
+
2863
+ Overwrite(dropAttributes);
19112864 }
1912
- if (event.getSource() == overwriteGeoItem)
2865
+ if (source == overwriteGeoItem)
19132866 {
19142867 Overwrite(Object3D.GEOMETRY);
1915
-// if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
2868
+// if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
19162869 // {
1917
-// Object3D content = GraphreeD.clipboard.get(0);
2870
+// Object3D content = GrafreeD.clipboard.get(0);
19182871 //
19192872 // if (content instanceof cGroup && ((cGroup)content).transientlink )
19202873 // content = ((cGroup)content).get(0);
....@@ -1926,7 +2879,7 @@
19262879 // refreshContents();
19272880 // }
19282881 } else
1929
- if (event.getSource() == generateMeshItem)
2882
+ if (source == generateMeshItem)
19302883 {
19312884 //if (group.selection.size() == 1)
19322885 // for (int i=0; i<group.selection.size(); i++)
....@@ -1937,7 +2890,7 @@
19372890 ResetModel();
19382891 refreshContents();
19392892 } else
1940
- if (event.getSource() == extractGeometriesItem)
2893
+ if (source == extractGeometriesItem)
19412894 {
19422895 boolean one = false;
19432896
....@@ -1964,7 +2917,7 @@
19642917 ResetModel();
19652918 refreshContents();
19662919 } else
1967
- if (event.getSource() == cloneGeometriesItem)
2920
+ if (source == cloneGeometriesItem)
19682921 {
19692922 boolean one = false;
19702923
....@@ -1990,32 +2943,37 @@
19902943 ResetModel();
19912944 refreshContents();
19922945 } else
1993
- if (event.getSource() == shareGeometriesItem)
2946
+ if (source == shareGeometriesItem)
19942947 {
19952948 boolean one = false;
19962949
19972950 if (group.selection.size() == 1)
19982951 one = true;
19992952
2953
+ Object3D merge = null;
2954
+
20002955 Object3D content = new cGroup();
20012956
20022957 for (int i=0; i<group.selection.size(); i++)
20032958 {
2004
- Object3D sel = new Merge(group.selection.get(i));
2959
+ merge = new Merge(group.selection.get(i));
20052960
20062961 if (one)
2007
- makeSomething(sel, false);
2962
+ makeSomething(merge, false);
20082963 else
2009
- content.addChild(sel);
2964
+ content.addChild(merge);
20102965 }
20112966
20122967 if (!one)
2013
- makeSomething(content, false);
2014
-
2015
- ResetModel();
2016
- refreshContents();
2968
+ makeSomething(content, true);
2969
+ else
2970
+ {
2971
+ ResetModel();
2972
+ Select(merge.GetTreePath(), true, false); // unselect... false);
2973
+ refreshContents();
2974
+ }
20172975 } else
2018
- if (event.getSource() == mergeGeometriesItem)
2976
+ if (source == mergeGeometriesItem)
20192977 {
20202978 boolean one = false;
20212979
....@@ -2045,11 +3003,11 @@
20453003 ResetModel();
20463004 refreshContents();
20473005 } else
2048
- if (event.getSource() == linkverticesItem)
3006
+ if (source == linkverticesItem)
20493007 {
2050
-// if (group.selection.size() == 1 && GraphreeD.clipboard.size() == 1)
3008
+// if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
20513009 // {
2052
-// Object3D content = GraphreeD.clipboard.get(0);
3010
+// Object3D content = GrafreeD.clipboard.get(0);
20533011 //
20543012 // if (content instanceof cGroup && ((cGroup)content).transientlink )
20553013 // content = ((cGroup)content).get(0);
....@@ -2058,39 +3016,48 @@
20583016 // group.selection.get(0).setMasterThis(content); // should be identity
20593017 // refreshContents();
20603018 // }
2061
- if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
3019
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
20623020 {
2063
- Object3D content = GraphreeD.clipboard.get(0);
3021
+ Object3D content = Grafreed.clipboard.get(0);
20643022
20653023 if (content instanceof cGroup && ((cGroup)content).transientlink )
20663024 content = ((cGroup)content).get(0);
20673025
2068
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
3026
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
20693027 for (int i=0; i<group.selection.size(); i++)
20703028 {
2071
- boolean random = CameraPane.RANDOM;
2072
- CameraPane.RANDOM = false; // parse all random nodes
3029
+ boolean random = CameraPane.SWITCH;
3030
+ CameraPane.SWITCH = false; // parse all random nodes
20733031 group.selection.get(i).linkVerticesThis(content);
20743032 // group.selection.get(i).setMasterThis(content); // should be identity
2075
- CameraPane.RANDOM = random;
3033
+ CameraPane.SWITCH = random;
20763034 }
2077
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
3035
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
20783036 refreshContents();
20793037 }
20803038 } else
2081
- if (event.getSource() == resetsupportItem)
3039
+ if (source == resetsupportItem)
20823040 {
20833041 for (int i=0; i<group.selection.size(); i++)
20843042 {
2085
- boolean random = CameraPane.RANDOM;
2086
- CameraPane.RANDOM = false; // parse all random nodes
3043
+ boolean random = CameraPane.SWITCH;
3044
+ CameraPane.SWITCH = false; // parse all random nodes
20873045 group.selection.get(i).linkVerticesThis(null);
2088
- CameraPane.RANDOM = random;
3046
+ CameraPane.SWITCH = random;
20893047 }
20903048
20913049 refreshContents();
20923050 } else
2093
- if (event.getSource() == resetreferencesItem)
3051
+ if (source == relinkverticesItem)
3052
+ {
3053
+ boolean random = CameraPane.SWITCH;
3054
+ CameraPane.SWITCH = false; // parse all random nodes
3055
+ group.selection.RelinkToSupport();
3056
+ CameraPane.SWITCH = random;
3057
+
3058
+ refreshContents();
3059
+ } else
3060
+ if (source == resetreferencesItem)
20943061 {
20953062 for (int i=0; i<group.selection.size(); i++)
20963063 {
....@@ -2099,11 +3066,11 @@
20993066
21003067 refreshContents();
21013068 } else
2102
- if (event.getSource() == setMasterItem)
3069
+ if (source == setMasterItem)
21033070 {
2104
- if (group.selection.size() == 1 && GraphreeD.clipboard.size() == 1)
3071
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
21053072 {
2106
- Object3D content = GraphreeD.clipboard.get(0);
3073
+ Object3D content = Grafreed.clipboard.get(0);
21073074
21083075 if (content instanceof cGroup && ((cGroup)content).transientlink )
21093076 content = ((cGroup)content).get(0);
....@@ -2112,13 +3079,13 @@
21123079 refreshContents();
21133080 }
21143081 } else
2115
- if (event.getSource() == poseMeshItem)
3082
+ if (source == poseMeshItem)
21163083 {
21173084 if (group.selection.size() == 1)
21183085 {
2119
- if (GraphreeD.clipboard.size() == 1)
3086
+ if (Grafreed.clipboard.size() == 1)
21203087 {
2121
- Object3D content = GraphreeD.clipboard.get(0);
3088
+ Object3D content = Grafreed.clipboard.get(0);
21223089
21233090 if (content instanceof cGroup && ((cGroup)content).transientlink )
21243091 content = ((cGroup)content).get(0);
....@@ -2131,19 +3098,19 @@
21313098 }
21323099
21333100 } else
2134
- if (event.getSource() == revertMeshItem)
3101
+ if (source == revertMeshItem)
21353102 {
21363103 RevertMeshes();
21373104 } else
2138
- if (event.getSource() == resetMeshItem)
3105
+ if (source == resetAllItem)
21393106 {
21403107 ResetAll();
21413108 } else
2142
- if (event.getSource() == stepAllItem)
3109
+ if (source == stepAllItem)
21433110 {
21443111 StepAll();
21453112 } else
2146
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
3113
+ if (source == deleteItem) // || event.getSource() == clearButton)
21473114 {
21483115 //int indices[] = jList.getSelectedIndices();
21493116 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2151,42 +3118,46 @@
21513118
21523119 ClearSelection(false);
21533120 } else
2154
- if (event.getSource() == clearAllItem)
3121
+ if (source == clearAllItem)
21553122 {
21563123 ClearSelection(true);
21573124 } else
2158
- if (event.getSource() == grabItem)
3125
+ if (source == grabItem || source == groupButton)
21593126 {
2160
- group(new cGroup(), true);
3127
+ group(new cGroup(), false); // true);
21613128 } else
2162
- if (event.getSource() == frontItem)
3129
+ if (source == hideItem)
3130
+ {
3131
+ group(new HiddenObject());
3132
+ } else
3133
+ if (source == frontItem)
21633134 {
21643135 front();
21653136 } else
2166
- if (event.getSource() == backItem)
3137
+ if (source == backItem)
21673138 {
21683139 back();
21693140 } else
2170
- if (event.getSource() == cameraItem)
3141
+ if (source == cameraItem)
21713142 {
21723143 makeSomething(new Camera());
21733144 } else
2174
- if (event.getSource() == compositeItem)
3145
+ if (source == compositeItem || source == compositeButton)
21753146 {
21763147 group(new Composite());
21773148 } else
2178
- if (event.getSource() == randomItem)
3149
+ if (source == switchItem || source == switchButton)
21793150 {
21803151 RandomNode random = new RandomNode();
21813152 group(random);
21823153 if (random.size() > 0)
2183
- random.name = random.get(0).name + "Rnd";
3154
+ random.name = random.get(0).name + "Switch";
21843155 } else
2185
- if (event.getSource() == physicsItem)
3156
+ if (source == physicsItem)
21863157 {
21873158 group(new PhysicsNode());
21883159 } else
2189
- if (event.getSource() == frameselectorItem)
3160
+ if (source == frameselectorItem)
21903161 {
21913162 for (int i=0; i<group.selection.size(); i++)
21923163 {
....@@ -2198,7 +3169,7 @@
21983169 ResetModel();
21993170 refreshContents();
22003171 } else
2201
- if (event.getSource() == switchGeoItem)
3172
+ if (source == switchGeoItem)
22023173 {
22033174 for (int i=0; i<group.selection.size(); i++)
22043175 {
....@@ -2210,7 +3181,7 @@
22103181 ResetModel();
22113182 refreshContents();
22123183 } else
2213
- if (event.getSource() == switchTransfoItem)
3184
+ if (source == switchTransfoItem)
22143185 {
22153186 for (int i=0; i<group.selection.size(); i++)
22163187 {
....@@ -2222,7 +3193,7 @@
22223193 ResetModel();
22233194 refreshContents();
22243195 } else
2225
- if (event.getSource() == morphItem)
3196
+ if (source == morphItem)
22263197 {
22273198 for (int i=0; i<group.selection.size(); i++)
22283199 {
....@@ -2234,7 +3205,7 @@
22343205 ResetModel();
22353206 refreshContents();
22363207 } else
2237
- if (event.getSource() == scriptNodeItem)
3208
+ if (source == scriptNodeItem)
22383209 {
22393210 boolean atleastone = false;
22403211
....@@ -2273,195 +3244,252 @@
22733244 }
22743245 }
22753246 } else
2276
- if (event.getSource() == linkerItem)
3247
+ if (source == linkerItem)
22773248 {
22783249 group(new cLinker());
22793250 } else
2280
- if (event.getSource() == textureItem)
3251
+ if (source == textureItem || source == textureButton)
22813252 {
22823253 group(new TextureNode());
22833254 } else
2284
- if (event.getSource() == shadowXItem)
3255
+ if (source == billboardItem)
3256
+ {
3257
+ group(new BillboardNode());
3258
+ } else
3259
+ if (source == shadowXItem)
22853260 {
22863261 CastShadow(0);
22873262 } else
2288
- if (event.getSource() == shadowYItem)
3263
+ if (source == shadowYItem)
22893264 {
22903265 CastShadow(1);
22913266 } else
2292
- if (event.getSource() == shadowZItem)
3267
+ if (source == shadowZItem)
22933268 {
22943269 CastShadow(2);
22953270 } else
2296
- if (event.getSource() == ungroupItem)
3271
+ if (source == ungroupItem || source == ungroupButton)
22973272 {
2298
- ungroup();
3273
+ boolean hasRoot = false;
3274
+
3275
+ for (int i=0; i<group.selection.size(); i++)
3276
+ {
3277
+ if (group.selection.get(i) == group)
3278
+ {
3279
+ hasRoot = true;
3280
+ break;
3281
+ }
3282
+ }
3283
+
3284
+ if (!hasRoot)
3285
+ {
3286
+ for (int i=0; i<group.selection.size(); i++)
3287
+ {
3288
+ Ungroup(group.selection.get(i));
3289
+ }
3290
+
3291
+ ClearSelection(false);
3292
+
3293
+ refreshContents();
3294
+ }
22993295 } else
2300
- if (event.getSource() == genUVItem)
3296
+ if (source == genUVItem)
23013297 {
23023298 GenUV();
23033299 } else
2304
- if (event.getSource() == genNormalsCADItem)
3300
+ if (source == genNormalsCADItem)
23053301 {
23063302 GenNormals(true);
23073303 } else
2308
- if (event.getSource() == genNormalsORGANItem)
3304
+ if (source == genNormalsMESHItem)
3305
+ {
3306
+ GenNormalsMESH();
3307
+ } else
3308
+ if (source == genNormalsORGANItem)
23093309 {
23103310 GenNormals(false);
23113311 } else
2312
- if (event.getSource() == stripifyItem)
3312
+ if (source == genNormalsMINEItem)
3313
+ {
3314
+ GenNormalsMINE();
3315
+ } else
3316
+ if (source == stripifyItem)
23133317 {
23143318 Stripify();
23153319 } else
2316
- if (event.getSource() == unstripifyItem)
3320
+ if (source == unstripifyItem)
23173321 {
23183322 Unstripify();
23193323 } else
2320
- if (event.getSource() == trimItem)
3324
+ if (source == trimItem)
23213325 {
23223326 Trim();
23233327 } else
2324
- if (event.getSource() == untrimItem)
3328
+ if (source == untrimItem)
23253329 {
23263330 Untrim();
23273331 } else
2328
- if (event.getSource() == clearColorsItem)
3332
+ if (source == clearColorsItem)
23293333 {
23303334 ClearColors();
23313335 } else
2332
- if (event.getSource() == clearMaterialsItem)
3336
+ if (source == clearMaterialsItem)
23333337 {
23343338 ClearMaterials();
23353339 } else
2336
- if (event.getSource() == liveleavesItem)
3340
+ if (source == liveleavesItem)
23373341 {
23383342 LiveLeaves(true);
23393343 } else
2340
- if (event.getSource() == unliveleavesItem)
3344
+ if (source == unliveleavesItem)
23413345 {
23423346 LiveLeaves(false);
23433347 } else
2344
- if (event.getSource() == supportleavesItem)
3348
+ if (source == supportleavesItem)
23453349 {
23463350 SupportLeaves(true);
23473351 } else
2348
- if (event.getSource() == unsupportleavesItem)
3352
+ if (source == unsupportleavesItem)
23493353 {
23503354 SupportLeaves(false);
23513355 } else
2352
- if (event.getSource() == hideleavesItem)
3356
+ if (source == hideleavesItem)
23533357 {
23543358 HideLeaves(true);
23553359 } else
2356
- if (event.getSource() == showleavesItem)
3360
+ if (source == showleavesItem)
23573361 {
23583362 HideLeaves(false);
23593363 } else
2360
- if (event.getSource() == markleavesItem)
3364
+ if (source == markleavesItem)
23613365 {
23623366 MarkLeaves(true);
23633367 } else
2364
- if (event.getSource() == unmarkleavesItem)
3368
+ if (source == unmarkleavesItem)
23653369 {
23663370 MarkLeaves(false);
23673371 } else
2368
- if (event.getSource() == flipVItem)
3372
+ if (source == rewindleavesItem)
3373
+ {
3374
+ RewindLeaves(true);
3375
+ } else
3376
+ if (source == unrewindleavesItem)
3377
+ {
3378
+ RewindLeaves(false);
3379
+ } else
3380
+ if (source == randomleavesItem)
3381
+ {
3382
+ RandomLeaves(true);
3383
+ } else
3384
+ if (source == unrandomleavesItem)
3385
+ {
3386
+ RandomLeaves(false);
3387
+ } else
3388
+ if (source == flipVItem)
23693389 {
23703390 FlipV(true);
23713391 } else
2372
- if (event.getSource() == unflipVItem)
3392
+ if (source == unflipVItem)
23733393 {
23743394 FlipV(false);
23753395 } else
2376
- if (event.getSource() == lowTexturesItem)
3396
+ if (source == lowTexturesItem)
23773397 {
23783398 SetTexRes(0);
23793399 } else
2380
- if (event.getSource() == normalTexturesItem)
3400
+ if (source == normalTexturesItem)
23813401 {
23823402 SetTexRes(1);
23833403 } else
2384
- if (event.getSource() == highTexturesItem)
3404
+ if (source == highTexturesItem)
23853405 {
23863406 SetTexRes(2);
23873407 } else
2388
- if (event.getSource() == veryhighTexturesItem)
3408
+ if (source == veryhighTexturesItem)
23893409 {
23903410 SetTexRes(3);
23913411 } else
2392
- if (event.getSource() == maxTexturesItem)
3412
+ if (source == maxTexturesItem)
23933413 {
23943414 SetTexRes(4);
23953415 } else
2396
- if (event.getSource() == panoTexturesItem)
3416
+ if (source == panoTexturesItem)
23973417 {
23983418 SetTexRes(5);
23993419 } else
2400
- if (event.getSource() == reverseNormalsItem)
3420
+ if (source == reverseNormalsItem)
24013421 {
24023422 ReverseNormals();
24033423 } else
2404
- if (event.getSource() == parseverticesItem)
3424
+ if (source == parseverticesItem)
24053425 {
24063426 ParseVertices();
24073427 } else
2408
- if (event.getSource() == textureFieldItem)
3428
+ if (source == textureFieldItem)
24093429 {
24103430 TextureVertices();
24113431 } else
2412
- if (event.getSource() == alignItem)
3432
+ if (source == alignItem)
24133433 {
24143434 Align();
24153435 } else
2416
- if (event.getSource() == mirrorItem)
3436
+ if (source == mirrorItem)
24173437 {
24183438 MirrorPoses();
24193439 } else
2420
- if (event.getSource() == reduceMorphItem)
3440
+ if (source == reduceMorphItem)
24213441 {
24223442 MeshReduction(false);
24233443 } else
2424
- if (event.getSource() == reduce34MorphItem)
3444
+ if (source == reduce34MorphItem)
24253445 {
24263446 MeshReduction(true);
24273447 } else
2428
- if (event.getSource() == reverseTrianglesItem)
3448
+ if (source == reverseTrianglesItem)
24293449 {
24303450 ReverseTriangles();
24313451 } else
2432
- if (event.getSource() == reduceMeshItem)
3452
+ if (source == reduceMeshItem)
24333453 {
24343454 ReduceMesh(false);
24353455 } else
2436
- if (event.getSource() == reduce34MeshItem)
3456
+ if (source == reduce34MeshItem)
24373457 {
24383458 ReduceMesh(true);
24393459 } else
2440
- if (event.getSource() == increaseMeshItem)
3460
+ if (source == increaseMeshItem)
24413461 {
24423462 IncreaseMesh();
24433463 } else
2444
- if (event.getSource() == clipMeshItem)
3464
+ if (source == clipMeshItem)
24453465 {
24463466 ClipMesh();
24473467 } else
2448
- if (event.getSource() == smoothMeshItem)
3468
+ if (source == smoothMeshItem)
24493469 {
24503470 SmoothMesh();
24513471 } else
2452
- if (event.getSource() == transformgeometryItem)
3472
+ if (source == transformGeometryItem)
24533473 {
24543474 TransformGeometry();
24553475 } else
2456
- if (event.getSource() == resetTransformItem)
3476
+ if (source == transformChildrenItem)
3477
+ {
3478
+ TransformChildren();
3479
+ } else
3480
+ if (source == resetTransformItem)
24573481 {
24583482 ResetTransform();
24593483 } else
2460
- if (event.getSource() == resetCentroidItem)
3484
+ if (source == resetCentroidItem)
24613485 {
2462
- ResetCentroid();
3486
+ ResetCentroid(true);
24633487 } else
2464
- if (event.getSource() == resetParentItem)
3488
+ if (source == resetCentroidXZItem)
3489
+ {
3490
+ ResetCentroid(false);
3491
+ } else
3492
+ if (source == resetParentItem)
24653493 {
24663494 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24673495 {
....@@ -2471,7 +3499,7 @@
24713499
24723500 refreshContents();
24733501 } else
2474
- if (event.getSource() == repairParentItem)
3502
+ if (source == repairParentItem)
24753503 {
24763504 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24773505 {
....@@ -2485,7 +3513,21 @@
24853513
24863514 refreshContents();
24873515 } else
2488
- if (event.getSource() == sortbysizeItem)
3516
+ if (source == repairShadowItem)
3517
+ {
3518
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3519
+ {
3520
+ Object3D obj = (Object3D)e.nextElement();
3521
+ obj.RepairShadow();
3522
+// for (int i=0; i<obj.size(); i++)
3523
+// {
3524
+// obj.get(i).parent = obj;
3525
+// }
3526
+ }
3527
+
3528
+ refreshContents();
3529
+ } else
3530
+ if (source == sortbysizeItem)
24893531 {
24903532 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24913533 {
....@@ -2497,7 +3539,7 @@
24973539 ResetModel();
24983540 refreshContents();
24993541 } else
2500
- if (event.getSource() == sortbynameItem)
3542
+ if (source == sortbynameItem)
25013543 {
25023544 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25033545 {
....@@ -2509,7 +3551,7 @@
25093551 ResetModel();
25103552 refreshContents();
25113553 } else
2512
- if (event.getSource() == attachPigmentItem)
3554
+ if (source == attachPigmentItem)
25133555 {
25143556 String texture = GetFile("Attach pigment");
25153557 Object3D obj;
....@@ -2521,7 +3563,7 @@
25213563
25223564 refreshContents();
25233565 } else
2524
- if (event.getSource() == detachPigmentItem)
3566
+ if (source == detachPigmentItem)
25253567 {
25263568 Object3D obj;
25273569 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2532,7 +3574,7 @@
25323574
25333575 refreshContents();
25343576 } else
2535
- if (event.getSource() == attachBumpItem)
3577
+ if (source == attachBumpItem)
25363578 {
25373579 String texture = GetFile("Attach bump");
25383580 Object3D obj;
....@@ -2544,18 +3586,18 @@
25443586
25453587 refreshContents();
25463588 } else
2547
- if (event.getSource() == detachBumpItem)
3589
+ if (source == detachBumpItem)
25483590 {
25493591 Object3D obj;
25503592 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25513593 {
25523594 obj = (Object3D)e.nextElement();
2553
- obj.SetBumpTexture(null);
3595
+ obj.ResetBumpTexture();
25543596 }
25553597
25563598 refreshContents();
25573599 } else
2558
- if (event.getSource() == pigmentBumpItem)
3600
+ if (source == pigmentBumpItem)
25593601 {
25603602 Object3D obj;
25613603 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2566,158 +3608,262 @@
25663608
25673609 refreshContents();
25683610 } else
2569
- if (event.getSource() == flashSelectionButton)
3611
+ if (source == embedTexturesItem)
3612
+ {
3613
+ Object3D obj;
3614
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3615
+ {
3616
+ obj = (Object3D)e.nextElement();
3617
+ obj.EmbedTextures(true);
3618
+ }
3619
+
3620
+ refreshContents();
3621
+ } else
3622
+ if (source == deEmbedTexturesItem)
3623
+ {
3624
+ Object3D obj;
3625
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3626
+ {
3627
+ obj = (Object3D)e.nextElement();
3628
+ obj.EmbedTextures(false);
3629
+ }
3630
+
3631
+ CameraPane.texturepigment.clear();
3632
+ CameraPane.texturebump.clear();
3633
+
3634
+ refreshContents();
3635
+ } else
3636
+ if (source == flashSelectionButton)
25703637 {
25713638 CameraPane.flash = true;
25723639 refreshContents();
25733640 } else
2574
- if (event.getSource() == oneButton)
3641
+ if (source == oneButton)
25753642 {
25763643 } else
2577
- if (event.getSource() == twoButton)
3644
+ if (source == twoButton)
25783645 {
25793646 radio.layout = twoButton;
3647
+
3648
+ if (CameraPane.FULLSCREEN)
3649
+ fullscreenLayout = radio.layout;
3650
+
25803651 // bug
25813652 //gridPanel.setDividerLocation(1.0);
25823653 //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();
3654
+// bigThree.remove(scenePanel);
3655
+// bigThree.remove(centralPanel);
3656
+// bigThree.remove(XYZPanel);
3657
+// aWindowConstraints.gridx = 0;
3658
+// aWindowConstraints.gridy = 0;
3659
+// aWindowConstraints.gridwidth = 1;
3660
+// // aConstraints.gridheight = 3;
3661
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3662
+// aWindowConstraints.weightx = 0;
3663
+// aWindowConstraints.weighty = 1;
3664
+// //bigThree.add(jtp, aWindowConstraints);
3665
+// aWindowConstraints.weightx = 1;
3666
+// aWindowConstraints.gridwidth = 3;
3667
+// // aConstraints.gridheight = 3;
3668
+// aWindowConstraints.gridx = 1;
3669
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3670
+// bigThree.add(centralPanel, aWindowConstraints);
3671
+// aWindowConstraints.weightx = 0;
3672
+// aWindowConstraints.gridx = 4;
3673
+// aWindowConstraints.gridwidth = 1;
3674
+// // aConstraints.gridheight = 3;
3675
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3676
+// //bigThree.add(XYZPanel, aWindowConstraints);
3677
+// scenePanel.setVisible(false);
3678
+// centralPanel.setVisible(true);
3679
+// XYZPanel.setVisible(false);
3680
+ bigThree.ClearUI();
3681
+ bigThree.add(centralPanel);
3682
+ bigThree.FlushUI();
3683
+
3684
+ cameraView.requestFocusInWindow();
3685
+
3686
+// refreshContents(true);
3687
+//
3688
+// try
3689
+// {
3690
+// java.awt.Robot bot = new java.awt.Robot();
3691
+// int mask = InputEvent.BUTTON1_MASK;
3692
+// bot.mouseMove(100, 100);
3693
+// bot.mousePress(mask);
3694
+// bot.mouseRelease(mask);
3695
+// }
3696
+// catch (Exception e)
3697
+// {
3698
+//
3699
+// }
3700
+
26073701 } else
2608
- if (event.getSource() == threeButton)
3702
+ if (source == threeButton)
26093703 {
26103704 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();
3705
+
3706
+ if (CameraPane.FULLSCREEN)
3707
+ fullscreenLayout = radio.layout;
3708
+
3709
+// bigThree.remove(scenePanel);
3710
+// bigThree.remove(centralPanel);
3711
+// bigThree.remove(XYZPanel);
3712
+// aWindowConstraints.gridx = 0;
3713
+// aWindowConstraints.gridy = 0;
3714
+// aWindowConstraints.gridwidth = 1;
3715
+// // aConstraints.gridheight = 3;
3716
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3717
+// aWindowConstraints.weightx = 0;
3718
+// aWindowConstraints.weighty = 1;
3719
+// //bigThree.add(jtp, aWindowConstraints);
3720
+// aWindowConstraints.weightx = 1;
3721
+// aWindowConstraints.gridwidth = 3;
3722
+// // aConstraints.gridheight = 3;
3723
+// aWindowConstraints.gridx = 1;
3724
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3725
+// bigThree.add(centralPanel, aWindowConstraints);
3726
+// aWindowConstraints.weightx = 0;
3727
+// aWindowConstraints.gridx = 4;
3728
+// aWindowConstraints.gridwidth = 1;
3729
+// // aConstraints.gridheight = 3;
3730
+// aConstraints.fill = GridBagConstraints.VERTICAL;
3731
+// bigThree.add(XYZPanel, aWindowConstraints);
3732
+// bigThree.validate();
3733
+// scenePanel.setVisible(false);
3734
+// centralPanel.setVisible(true);
3735
+// XYZPanel.setVisible(true);
3736
+ bigThree.ClearUI();
3737
+ bigThree.add(scenePanel);
3738
+ bigThree.add(centralPanel);
3739
+ bigThree.FlushUI();
3740
+
3741
+ cameraView.requestFocusInWindow();
26353742 } else
2636
- if (event.getSource() == fourButton)
3743
+ if (source == fourButton)
26373744 {
26383745 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();
3746
+
3747
+ if (CameraPane.FULLSCREEN)
3748
+ fullscreenLayout = radio.layout;
3749
+
3750
+// bigThree.remove(scenePanel);
3751
+// bigThree.remove(centralPanel);
3752
+// bigThree.remove(XYZPanel);
3753
+// aWindowConstraints.gridx = 0;
3754
+// aWindowConstraints.gridy = 0;
3755
+// aWindowConstraints.gridwidth = 1;
3756
+// // aWindowConstraints.gridheight = 3;
3757
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3758
+// aWindowConstraints.weightx = 1;
3759
+// aWindowConstraints.weighty = 1;
3760
+// bigThree.add(scenePanel, aWindowConstraints);
3761
+// aWindowConstraints.weightx = 1;
3762
+// aWindowConstraints.gridwidth = 3;
3763
+// // aConstraints.gridheight = 3;
3764
+// aWindowConstraints.gridx = 1;
3765
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3766
+// //bigThree.add(cameraPanel, aWindowConstraints);
3767
+// aWindowConstraints.weightx = 0;
3768
+// aWindowConstraints.gridx = 4;
3769
+// aWindowConstraints.gridwidth = 1;
3770
+// // aWindowConstraints.gridheight = 3;
3771
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3772
+// //bigThree.add(XYZPanel, aWindowConstraints);
3773
+// bigThree.validate();
3774
+// scenePanel.setVisible(true);
3775
+// centralPanel.setVisible(false);
3776
+// XYZPanel.setVisible(false);
3777
+ bigThree.ClearUI();
3778
+ bigThree.add(scenePanel);
3779
+ bigThree.FlushUI();
3780
+
3781
+ cameraView.requestFocusInWindow();
26633782 } else
2664
- if (event.getSource() == sixButton)
3783
+ if (source == sixButton)
26653784 {
26663785 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();
3786
+
3787
+ if (CameraPane.FULLSCREEN)
3788
+ fullscreenLayout = radio.layout;
3789
+
3790
+// bigThree.remove(scenePanel);
3791
+// bigThree.remove(centralPanel);
3792
+// bigThree.remove(XYZPanel);
3793
+// aWindowConstraints.gridx = 0;
3794
+// aWindowConstraints.gridy = 0;
3795
+// aWindowConstraints.gridwidth = 1;
3796
+// // aConstraints.gridheight = 3;
3797
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3798
+// aWindowConstraints.weightx = 0;
3799
+// aWindowConstraints.weighty = 1;
3800
+// bigThree.add(scenePanel, aWindowConstraints);
3801
+// aWindowConstraints.weightx = 1;
3802
+// aWindowConstraints.gridwidth = 3;
3803
+// // aWindowConstraints.gridheight = 3;
3804
+// aWindowConstraints.gridx = 1;
3805
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3806
+// bigThree.add(centralPanel, aWindowConstraints);
3807
+// aWindowConstraints.weightx = 0;
3808
+// aWindowConstraints.gridx = 4;
3809
+// aWindowConstraints.gridwidth = 1;
3810
+// // aWindowConstraints.gridheight = 3;
3811
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3812
+// //bigThree.add(XYZPanel, aConstraints);
3813
+// bigThree.validate();
3814
+// scenePanel.setVisible(true);
3815
+// centralPanel.setVisible(true);
3816
+// XYZPanel.setVisible(false);
3817
+ bigThree.ClearUI();
3818
+ bigThree.add(centralPanel);
3819
+ bigThree.add(scenePanel);
3820
+ bigThree.FlushUI();
3821
+
3822
+ cameraView.requestFocusInWindow();
26913823 } else
2692
- if (event.getSource() == sevenButton)
3824
+ if (source == sevenButton)
26933825 {
26943826 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();
3827
+
3828
+ if (CameraPane.FULLSCREEN)
3829
+ fullscreenLayout = radio.layout;
3830
+
3831
+// bigThree.remove(scenePanel);
3832
+// bigThree.remove(centralPanel);
3833
+// bigThree.remove(XYZPanel);
3834
+// aWindowConstraints.gridx = 0;
3835
+// aWindowConstraints.gridy = 0;
3836
+// aWindowConstraints.gridwidth = 1;
3837
+// // aWindowConstraints.gridheight = 3;
3838
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3839
+// aWindowConstraints.weightx = 0;
3840
+// aWindowConstraints.weighty = 1;
3841
+// bigThree.add(scenePanel, aWindowConstraints);
3842
+// aWindowConstraints.weightx = 1;
3843
+// aWindowConstraints.gridwidth = 3;
3844
+// // aWindowConstraints.gridheight = 3;
3845
+// aWindowConstraints.gridx = 1;
3846
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3847
+// bigThree.add(centralPanel, aWindowConstraints);
3848
+// aWindowConstraints.weightx = 0;
3849
+// aWindowConstraints.gridx = 4;
3850
+// aWindowConstraints.gridwidth = 1;
3851
+// // aConstraints.gridheight = 3;
3852
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3853
+// bigThree.add(XYZPanel, aWindowConstraints);
3854
+// bigThree.validate();
3855
+// scenePanel.setVisible(true);
3856
+// centralPanel.setVisible(true);
3857
+// XYZPanel.setVisible(true);
3858
+ bigThree.ClearUI();
3859
+ bigThree.add(scenePanel);
3860
+ bigThree.add(centralPanel);
3861
+ bigThree.add(XYZPanel);
3862
+ bigThree.FlushUI();
3863
+
3864
+ cameraView.requestFocusInWindow();
27193865 } else
2720
- if (event.getSource() == rootButton)
3866
+ if (source == rootButton)
27213867 {
27223868 Object3D obj;
27233869 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2727,66 +3873,85 @@
27273873 EditObject(obj);
27283874 }
27293875
3876
+ cameraView.requestFocusInWindow();
27303877 refreshContents(true);
27313878 } else
2732
- if (event.getSource() == closeButton)
3879
+ if (source == closeButton)
27333880 {
27343881 //System.out.println("CLOSE: " + buttonGroup.getSelection());
27353882 cRadio ab;
27363883 for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
27373884 {
27383885 ab = (cRadio)e.nextElement();
2739
- if(ab.getModel().isSelected() && ab.GetObject() != client)
3886
+ if (ab.getModel().isSelected() && ab.GetObject() != client)
27403887 {
3888
+ // Patch to avoid bug with transparency.
3889
+ if (!ab.hadMaterial)
3890
+ {
3891
+ ab.object.material = null;
3892
+ }
3893
+
27413894 buttonGroup.remove(ab);
27423895 radioPanel.remove(ab);
27433896
2744
- ab.GetObject().editWindow = null;
3897
+ //ab.GetObject().editWindow = null;
3898
+ ab.GetObject().manipWindow = null;
27453899 // ab.GetObject().objectUI = null; // ?????????
27463900
27473901 ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick();
27483902 break;
27493903 }
27503904 }
3905
+
3906
+ cameraView.requestFocusInWindow();
27513907 refreshContents(true);
27523908 } else
2753
- if (event.getSource() == editItem || event.getSource() == editButton)
3909
+ if (source == editItem || source == editButton)
27543910 {
3911
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3912
+ {
3913
+ Object3D child = (Object3D)e.nextElement();
3914
+ child.pinned = true;
3915
+ }
3916
+
27553917 EditSelection(false);
27563918 } else
2757
- if (event.getSource() == uneditButton)
3919
+ if (source == uneditButton)
27583920 {
27593921 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
27603922 {
27613923 Object3D child = (Object3D)e.nextElement();
27623924 if(child.editWindow != null)
2763
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3925
+ child.pinned = false;
27643926 child.CloseUI();
27653927 listUI.remove(child);
3928
+// objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
27663929
2767
- child.editWindow = null; // ???????????
3930
+ //child.editWindow = null; // ???????????
27683931 }
2769
- objEditor.ctrlPanel.revalidate();
3932
+ objEditor.ctrlPanel.FlushUI();
27703933 //objEditor.jTree.clearSelection();
27713934 //objEditor.ResetSliders();
27723935 refreshContents(true);
27733936 } else
2774
- if (event.getSource() == clearPanelButton)
3937
+ if (source == clearPanelButton)
27753938 {
27763939 assert(copy == group);
27773940 //copy.ClearUI();
27783941 for (Object3D obj : listUI)
27793942 {
3943
+ obj.pinned = false;
27803944 obj.CloseUI();
27813945 }
27823946 listUI.clear();
3947
+ SetPinStates(group.selection.size() > 0);
27833948 refreshContents(true);
27843949 } else
2785
- if (event.getSource() == allParamsButton)
3950
+ if (source == allParamsButton)
27863951 {
27873952 assert(copy == group);
27883953
2789
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3954
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
27903955
27913956 for (Object3D obj : listUI)
27923957 {
....@@ -2803,19 +3968,19 @@
28033968
28043969 refreshContents(true);
28053970 } else
2806
- if (event.getSource() == unselectButton)
3971
+ if (source == unselectButton)
28073972 {
28083973 objEditor.jTree.clearSelection();
2809
- // ?? oct 2012 GraphreeD.clipboard.clear();
3974
+ // ?? oct 2012 GrafreeD.clipboard.clear();
28103975 objEditor.ResetSliders();
28113976 refreshContents(true);
28123977 } else
2813
- if(event.getSource() instanceof cRadio)
3978
+ if(source instanceof cRadio)
28143979 {
28153980 group.parent = keepparent;
28163981 group.attributes = 0;
28173982 //group.editWindow = null;
2818
- /*cRadio*/ radio = (cRadio)event.getSource();
3983
+ /*cRadio*/ radio = (cRadio)source;
28193984 Object3D obj = radio.GetObject();
28203985 System.out.println("Edit " + obj);
28213986 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -2835,7 +4000,10 @@
28354000 }
28364001
28374002 copy = group;
2838
- //CameraPane.theRenderer.object = group;
4003
+
4004
+ SetUndoStates();
4005
+
4006
+ //Globals.theRenderer.object = group;
28394007 if(!useclient)
28404008 {
28414009 cameraView.renderCamera = radio.camera;
....@@ -2844,25 +4012,55 @@
28444012 cameraView.cameras[cameraView.cameracount] = radio.camera;
28454013 cameraView.targetLookAt.set(radio.camera.lookAt);
28464014 cameraView.object = group;
2847
- cameraView.lighttouched = true;
4015
+ //cameraView.lighttouched = true;
4016
+ Globals.lighttouched = true;
28484017 topView.object = group;
28494018 frontView.object = group;
28504019 sideView.object = group;
28514020 }
2852
- group.editWindow = this;
4021
+
4022
+// fix "+" issue
4023
+ //group.editWindow = this;
4024
+ group.manipWindow = this;
4025
+
28534026 /*
28544027 currentLayout = radio.layout;
28554028 if (currentLayout == null)
28564029 currentLayout = sevenButton;
28574030 */
28584031 radio.layout.doClick();
4032
+
4033
+ ClearUnpinned();
4034
+
4035
+ //Grafreed.Assert(group != null);
4036
+ //Grafreed.Assert(group.selection != null);
4037
+ SetPinStates(group.selection == null || group.selection.size() > 0);
4038
+ if (group.selection == null || group.selection.size() == 1)
4039
+ EditSelection(false);
28594040 keepparent = group.parent;
28604041 // PARENT = NULL or not???
28614042 //group.parent = null; // ROOT
28624043 //group.attributes = -1;
28634044 ResetModel();
4045
+
4046
+ cameraView.requestFocusInWindow();
28644047 refreshContents(true);
2865
- }
4048
+ } else if (event.getSource() == editCameraItem)
4049
+ {
4050
+ cameraView.ProtectCamera();
4051
+ cameraView.requestFocusInWindow();
4052
+ cameraView.repaint();
4053
+ return;
4054
+ } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton)
4055
+ {
4056
+ cameraView.RevertCamera();
4057
+ cameraView.requestFocusInWindow();
4058
+ cameraView.repaint();
4059
+ return;
4060
+ // } else if (event.getSource() == textureButton)
4061
+ // {
4062
+ // return; // true;
4063
+ }
28664064 else
28674065 {
28684066 //return super.action(event, arg);
....@@ -2871,7 +4069,6 @@
28714069 }
28724070
28734071 boolean useclient = false;
2874
- cRadio radio;
28754072
28764073 void ToggleRoot()
28774074 {
....@@ -2880,7 +4077,7 @@
28804077 if (useclient)
28814078 {
28824079 cameraView.object = client;
2883
- cameraView.lighttouched = true;
4080
+ Globals.lighttouched = true;
28844081 //topView.object = client;
28854082 //frontView.object = client;
28864083 //sideView.object = client;
....@@ -2888,7 +4085,7 @@
28884085 else
28894086 {
28904087 cameraView.object = group;
2891
- cameraView.lighttouched = true;
4088
+ Globals.lighttouched = true;
28924089 //topView.object = group;
28934090 //frontView.object = group;
28944091 //sideView.object = group;
....@@ -2923,6 +4120,28 @@
29234120 refreshContents();
29244121 }
29254122
4123
+ void TransformChildren()
4124
+ {
4125
+ Object3D obj;
4126
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
4127
+ {
4128
+ obj = (Object3D)e.nextElement();
4129
+ obj.KeepTextureMatrices();
4130
+ obj.TransformChildren();
4131
+ obj.RestoreTextureMatrices();
4132
+
4133
+// if (obj.parent == null)
4134
+// {
4135
+// System.out.println("NULL PARENT!");
4136
+// new Exception().printStackTrace();
4137
+// }
4138
+// else
4139
+// TouchTransform(obj);
4140
+// //obj.parent.Touch();
4141
+ }
4142
+
4143
+ refreshContents();
4144
+ }
29264145
29274146 void ResetTransform()
29284147 {
....@@ -3035,7 +4254,7 @@
30354254 refreshContents();
30364255 }
30374256
3038
- void ResetCentroid()
4257
+ void ResetCentroid(boolean full)
30394258 {
30404259 Object3D obj;
30414260 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3050,12 +4269,16 @@
30504269 LA.matIdentity(Object3D.mat);
30514270 obj.getBounds(minima, maxima, false);
30524271 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3053
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
4272
+ if (full)
4273
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
30544274 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
30554275 obj.TransformMesh(Object3D.mat);
4276
+
30564277 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3057
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
4278
+ if (full)
4279
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
30584280 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
4281
+
30594282 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
30604283 //Object3D.mat[3][0] = -Object3D.mat[3][0];
30614284 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3084,7 +4307,8 @@
30844307
30854308 int size = obj.MemorySize();
30864309
3087
- System.err.println((size/1024) + " KB is the size of " + obj);
4310
+ //System.err.println((size/1024) + " KB is the size of " + obj);
4311
+ System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)");
30884312 }
30894313 }
30904314 catch (Exception e)
....@@ -3121,9 +4345,9 @@
31214345 obj = (Object3D)e.nextElement();
31224346
31234347 System.out.println("Object is: " + obj);
3124
- GraphreeD.AnalyzeObject(obj);
4348
+ Grafreed.AnalyzeObject(obj);
31254349 System.out.println("Boundary rep: " + obj.bRep);
3126
- GraphreeD.AnalyzeObject(obj.bRep);
4350
+ Grafreed.AnalyzeObject(obj.bRep);
31274351
31284352 // System.err.println((size/1024) + " KB is the size of " + obj);
31294353 }
....@@ -3165,6 +4389,20 @@
31654389 void GenNormals(boolean crease)
31664390 {
31674391 group.GenNormalsS(crease);
4392
+
4393
+ refreshContents();
4394
+ }
4395
+
4396
+ void GenNormalsMESH()
4397
+ {
4398
+ group.GenNormalsMeshS();
4399
+
4400
+ refreshContents();
4401
+ }
4402
+
4403
+ void GenNormalsMINE()
4404
+ {
4405
+ group.selection.GenNormalsMINE();
31684406
31694407 refreshContents();
31704408 }
....@@ -3250,7 +4488,7 @@
32504488 // LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
32514489 // LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
32524490 //
3253
-// g.add(GraphreeD.clipboard);
4491
+// g.add(GrafreeD.clipboard);
32544492 //
32554493 // buffer.add(g);
32564494 // }
....@@ -3269,8 +4507,8 @@
32694507 // nodes = new Object3D();
32704508 // vertices = new Vector<Vertex>();
32714509 //
3272
-// boolean epsequal = GraphreeD.epsequal;
3273
-// GraphreeD.epsequal = true;
4510
+// boolean epsequal = GrafreeD.epsequal;
4511
+// GrafreeD.epsequal = true;
32744512 //
32754513 // for (int i=0; i<group.selection.size(); i++)
32764514 // {
....@@ -3311,7 +4549,7 @@
33114549 // LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
33124550 // LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
33134551 //
3314
-// g.add(GraphreeD.clipboard);
4552
+// g.add(GrafreeD.clipboard);
33154553 //
33164554 // buffer.add(g);
33174555 // }
....@@ -3319,7 +4557,7 @@
33194557 // makeSomething(buffer, i==group.selection.size()-1);
33204558 // }
33214559 //
3322
-// GraphreeD.epsequal = epsequal;
4560
+// GrafreeD.epsequal = epsequal;
33234561 //
33244562 // //buffer = null;
33254563 // temprep = null;
....@@ -3330,8 +4568,8 @@
33304568
33314569 void ParseVertices()
33324570 {
3333
- boolean epsequal = GraphreeD.epsequal;
3334
- GraphreeD.epsequal = true;
4571
+ boolean epsequal = Grafreed.epsequal;
4572
+ Grafreed.epsequal = true;
33354573
33364574 for (int i=0; i<group.selection.size(); i++)
33374575 {
....@@ -3356,7 +4594,7 @@
33564594 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
33574595 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
33584596
3359
- g.add(GraphreeD.clipboard);
4597
+ g.add(Grafreed.clipboard);
33604598
33614599 buffer.add(g);
33624600 }
....@@ -3371,7 +4609,7 @@
33714609 makeSomething(buffer, i==group.selection.size()-1);
33724610 }
33734611
3374
- GraphreeD.epsequal = epsequal;
4612
+ Grafreed.epsequal = epsequal;
33754613
33764614 refreshContents();
33774615 }
....@@ -3389,7 +4627,16 @@
33894627 String pigment = Object3D.GetPigment(tex);
33904628 //String bump = Object3D.GetBump(tex);
33914629
3392
- com.sun.opengl.util.texture.TextureData texturedata = CameraPane.theRenderer.GetTextureData(pigment, false, node.texres);
4630
+ com.sun.opengl.util.texture.TextureData texturedata = null;
4631
+
4632
+ try
4633
+ {
4634
+ texturedata = Globals.theRenderer.GetTextureData(tex, false, node.texres);
4635
+ }
4636
+ catch (Exception e)
4637
+ {
4638
+ System.err.println("FAIL: " + node);
4639
+ }
33934640
33944641 double s = v.s;
33954642
....@@ -3416,7 +4663,7 @@
34164663 scale /= 3;
34174664
34184665 scale /= 0xFF;
3419
- scale /= 4;
4666
+ // c'est quoi ca? scale /= 4;
34204667
34214668 //v.AO = scale;
34224669
....@@ -3437,12 +4684,26 @@
34374684
34384685 void Align()
34394686 {
4687
+ if (group.selection.size() == 0)
4688
+ return;
4689
+
4690
+ cVector bbmin = new cVector();
4691
+ cVector bbmax = new cVector();
4692
+
4693
+ group.selection.get(0).getBounds(bbmin, bbmax, true);
4694
+
4695
+ double dx = bbmax.x - bbmin.x;
4696
+ double dy = bbmax.y - bbmin.y;
4697
+ double dz = bbmax.z - bbmin.z;
4698
+
4699
+ double scale = Math.sqrt(dx*dx + dy*dy + dz*dz);
4700
+
34404701 for (int i=0; i<group.selection.size(); i++)
34414702 {
34424703 Object3D obj = group.selection.get(i);
34434704
3444
- LA.matTranslate(obj.toParent, i/2f, 0, 0);
3445
- LA.matTranslateInv(obj.fromParent, -i/2f, 0, 0);
4705
+ LA.matTranslate(obj.toParent, i * scale, 0, 0);
4706
+ LA.matTranslateInv(obj.fromParent, -i * scale, 0, 0);
34464707 }
34474708
34484709 refreshContents();
....@@ -3455,7 +4716,7 @@
34554716 // ref.SaveSupports();
34564717 // Object3D par = ref.parent;
34574718 // ref.parent = null;
3458
-// Object3D lowres = (Object3D) GraphreeD.clone(ref);
4719
+// Object3D lowres = (Object3D) GrafreeD.clone(ref);
34594720 // ref.parent = par;
34604721 // ref.RestoreSupports();
34614722
....@@ -3463,11 +4724,11 @@
34634724
34644725 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
34654726
3466
- boolean random = CameraPane.RANDOM;
3467
- CameraPane.RANDOM = false; // parse all random nodes
4727
+ boolean random = CameraPane.SWITCH;
4728
+ CameraPane.SWITCH = false; // parse all random nodes
34684729 lowres.linkVerticesThis(null);
34694730 lowres.linkVerticesThis(sn);
3470
- CameraPane.RANDOM = random;
4731
+ CameraPane.SWITCH = random;
34714732
34724733 System.err.flush();
34734734
....@@ -3485,7 +4746,7 @@
34854746 // lowres.SaveSupports();
34864747 // par = lowres.parent;
34874748 // lowres.parent = null;
3488
-// Object3D newlow = (Object3D) GraphreeD.clone(lowres);
4749
+// Object3D newlow = (Object3D) GrafreeD.clone(lowres);
34894750 Object3D newlow = CloneObject(lowres, false);
34904751 newlow.name = sn.switchobject.get(i).name;
34914752 System.out.println(" pose#" + i + " = " + newlow);
....@@ -3507,7 +4768,7 @@
35074768 return;
35084769
35094770 Object3D poses = group.selection.get(0);
3510
- Object3D ref = GraphreeD.clipboard.get(0);
4771
+ Object3D ref = Grafreed.clipboard.get(0);
35114772
35124773 Object3D newgroup = new Object3D("Po:" + poses.name);
35134774
....@@ -3676,7 +4937,7 @@
36764937 group.selection.RelinkToSupport(); // july 2014
36774938 System.out.println("DONE.");
36784939 refreshContents();
3679
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
4940
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
36804941 }
36814942
36824943 void ReduceMesh(boolean reduction34)
....@@ -3701,20 +4962,20 @@
37014962
37024963 void ClipMesh()
37034964 {
3704
- if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
4965
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
37054966 {
3706
- Object3D content = GraphreeD.clipboard.get(0);
4967
+ Object3D content = Grafreed.clipboard.get(0);
37074968
37084969 if (content instanceof cGroup && ((cGroup)content).transientlink )
37094970 content = ((cGroup)content).get(0);
37104971
37114972 // for (int i=0; i<group.selection.size(); i++)
37124973 // {
3713
-// group.selection.get(i).ClipMesh(GraphreeD.clipboard);
4974
+// group.selection.get(i).ClipMesh(GrafreeD.clipboard);
37144975 // }
3715
- group.selection.ClipMesh(GraphreeD.clipboard);
4976
+ group.selection.ClipMesh(Grafreed.clipboard);
37164977 }
3717
-// group.selection.ClipMesh(GraphreeD.clipboard);
4978
+// group.selection.ClipMesh(GrafreeD.clipboard);
37184979 System.out.println("DONE.");
37194980 refreshContents();
37204981 }
....@@ -3759,6 +5020,18 @@
37595020 void MarkLeaves(boolean hide)
37605021 {
37615022 group.selection.MarkLeaves(hide);
5023
+ refreshContents();
5024
+ }
5025
+
5026
+ void RewindLeaves(boolean hide)
5027
+ {
5028
+ group.selection.RewindLeaves(hide);
5029
+ refreshContents();
5030
+ }
5031
+
5032
+ void RandomLeaves(boolean hide)
5033
+ {
5034
+ group.selection.RandomLeaves(hide);
37625035 refreshContents();
37635036 }
37645037
....@@ -3833,28 +5106,25 @@
38335106 // }
38345107 // }
38355108
3836
- static boolean allparams = true;
3837
-
3838
- static Vector<Object3D> listUI = new Vector<Object3D>();
3839
-
38405109 void EditSelection(boolean newWindow)
38415110 {
5111
+ if (group.selection == null)
5112
+ {
5113
+ EditElement(group, newWindow); // ? new
5114
+ return;
5115
+ }
5116
+
38425117 // aConstraints.gridy = 0;
38435118 for (int i=0; i<group.selection.size(); i++)
38445119 {
38455120 //System.out.println("edit : " + objectPanel.indexOfTab("Material"));
38465121 //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false);
3847
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
5122
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
38485123
38495124 Object3D elem = (Object3D)group.selection.elementAt(i);
3850
- if(elem != group)
5125
+ if(elem != group || !newWindow)
38515126 {
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
5127
+ EditElement(elem, newWindow); // ? new
38585128 }
38595129 }
38605130 }
....@@ -3917,9 +5187,7 @@
39175187
39185188 freezemodel = false;
39195189 }
3920
-
3921
- boolean flashIt = true;
3922
-
5190
+
39235191 public void valueChanged(TreeSelectionEvent e)
39245192 //public boolean handleEvent(Event event)
39255193 {
....@@ -3929,7 +5197,8 @@
39295197 //new Exception().printStackTrace();
39305198
39315199 freezemodel = true;
3932
-
5200
+ ClearUnpinned();
5201
+
39335202 /**/
39345203 //switch (event.id)
39355204 {
....@@ -3937,7 +5206,6 @@
39375206 //case 702: // Event.LIST_DESELECT
39385207 group.deselectAll();
39395208 TreePath tps[] = objEditor.jTree.getSelectionPaths();
3940
- objEditor.ClearInfo(); // .GetMaterial());
39415209 if (tps != null)
39425210 {
39435211 for (int i=0; i < tps.length; i++)
....@@ -3946,33 +5214,39 @@
39465214
39475215 //if (child.parent != null)
39485216 //child.parent.addSelectee(child);
5217
+ objEditor.SetMaterial(child);
39495218 group.addSelectee(child);
3950
- objEditor.SetMaterial(child); // .GetMaterial());
3951
- objEditor.AddInfo(child, this, true); // .GetMaterial());
3952
- System.err.println("info : " + child.GetPath());
39535219 }
39545220 }
3955
- else
3956
- {
3957
- objEditor.SetMaterial(group); // .GetMaterial());
3958
- objEditor.AddInfo(group, this, true); // .GetMaterial());
3959
- System.err.println("info : " + group.GetPath());
3960
- }
5221
+// else
5222
+// {
5223
+// objEditor.SetMaterial(group); // .GetMaterial());
5224
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
5225
+// System.err.println("info : " + group.GetPath());
5226
+// }
39615227
3962
- objEditor.SetText(); // jan 2014
3963
-
3964
- if (flashIt && !CameraPane.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
5228
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera))
39655229 CameraPane.flash = true;
39665230
3967
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
5231
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
39685232 // a camera
39695233 {
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;
5234
+ if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crash the camera because of invalid lightspace
5235
+ {
5236
+ CameraPane.camerachangeframe = 0; // don't refuse it
5237
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
5238
+ }
5239
+ // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
5240
+ // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
39745241 }
39755242
5243
+ if (tps != null && tps.length == 1)
5244
+ {
5245
+ EditSelection(false);
5246
+ }
5247
+
5248
+ SetPinStates(tps != null && tps.length > 0);
5249
+
39765250 refreshContents();
39775251 //return true;
39785252 }
....@@ -3981,6 +5255,37 @@
39815255
39825256 freezemodel = false;
39835257 }
5258
+
5259
+ void SetPinStates(boolean enabled)
5260
+ {
5261
+ editButton.setEnabled(enabled);
5262
+ uneditButton.setEnabled(enabled);
5263
+ //unselectButton.setEnabled(enabled);
5264
+ flashSelectionButton.setEnabled(enabled);
5265
+
5266
+ clearPanelButton.setEnabled(!listUI.isEmpty());
5267
+ }
5268
+
5269
+ void refreshContents(boolean cp)
5270
+ {
5271
+ //if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info"))
5272
+ if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING)
5273
+ {
5274
+ objEditor.ClearInfo(); // .GetMaterial());
5275
+
5276
+ for (int i=0; i < group.selection.Size(); i++)
5277
+ {
5278
+ Object3D child = (Object3D) group.selection.get(i);
5279
+
5280
+ objEditor.AddInfo(child, this, true);
5281
+ System.err.println("info : " + child.GetPath());
5282
+ }
5283
+
5284
+ objEditor.SetText(); // jan 2014
5285
+ }
5286
+
5287
+ super.refreshContents(cp);
5288
+ }
39845289
39855290 void linkSomething(Object3D thing)
39865291 {
....@@ -4052,16 +5357,19 @@
40525357 {
40535358 if (group.selection.isEmpty())
40545359 return;
4055
- GraphreeD.clipboardIsTempGroup = false;
5360
+
5361
+ Grafreed.clipboardIsTempGroup = false;
40565362 Composite tGroup = null;
40575363 if (group.selection.size() > 0) // 1)
40585364 {
40595365 tGroup = new cGroup();
4060
- GraphreeD.clipboardIsTempGroup = true;
5366
+ Grafreed.clipboardIsTempGroup = true;
40615367 }
40625368
40635369 if (cut)
40645370 {
5371
+// if (Globals.SAVEONMAKE) // Moved to the clipboard, no need to save.
5372
+// Save();
40655373 //int indices[] = jList.getSelectedIndices();
40665374 //for (int i = indices.length - 1; i >= 0; i--)
40675375 //jList.remove(indices[i]);
....@@ -4097,16 +5405,16 @@
40975405 //System.out.println("cut " + child);
40985406 //System.out.println("parent = " + child.parent);
40995407 // tmp.addChild(child);
4100
- if (GraphreeD.clipboardIsTempGroup)
5408
+ if (Grafreed.clipboardIsTempGroup)
41015409 tGroup.add/*Child*/(tmp);
41025410 else
4103
- GraphreeD.clipboard = tmp;
5411
+ Grafreed.clipboard = tmp;
41045412 }
41055413 else
4106
- if (GraphreeD.clipboardIsTempGroup)
5414
+ if (Grafreed.clipboardIsTempGroup)
41075415 tGroup.add/*Child*/(child);
41085416 else
4109
- GraphreeD.clipboard = child;
5417
+ Grafreed.clipboard = child;
41105418 }
41115419
41125420 //ResetModel();
....@@ -4138,21 +5446,23 @@
41385446 //System.out.println("cut " + elem);
41395447 //System.out.println("parent = " + elem.parent);
41405448 // tmp.addChild(elem);
4141
- if (GraphreeD.clipboardIsTempGroup)
5449
+ if (Grafreed.clipboardIsTempGroup)
41425450 tGroup.add/*Child*/(tmp);
41435451 else
4144
- GraphreeD.clipboard = tmp;
5452
+ Grafreed.clipboard = tmp;
41455453 }
41465454 else
4147
- if (GraphreeD.clipboardIsTempGroup)
5455
+ if (Grafreed.clipboardIsTempGroup)
41485456 tGroup.add/*Child*/(child);
41495457 else
4150
- GraphreeD.clipboard = child;
5458
+ Grafreed.clipboard = child;
41515459 }
41525460
41535461 }
4154
- if (GraphreeD.clipboardIsTempGroup)
4155
- GraphreeD.clipboard = tGroup;
5462
+
5463
+ if (Grafreed.clipboardIsTempGroup)
5464
+ Grafreed.clipboard = tGroup;
5465
+
41565466 if (cut)
41575467 {
41585468 ResetModel();
....@@ -4162,11 +5472,15 @@
41625472
41635473 void paste(boolean expand)
41645474 {
4165
- // if (GraphreeD.clipboard == null)
5475
+ if (Globals.REPLACEONMAKE)
5476
+ Save();
5477
+ boolean keep = Globals.REPLACEONMAKE;
5478
+ Globals.REPLACEONMAKE = false;
5479
+ // if (GrafreeD.clipboard == null)
41665480 // return;
41675481 boolean first = true;
41685482
4169
- if (GraphreeD.clipboardIsTempGroup)
5483
+ if (Grafreed.clipboardIsTempGroup)
41705484 {
41715485 Composite temp;
41725486
....@@ -4177,7 +5491,7 @@
41775491 temp = (Composite)Applet3D.clipboard.deepCopy();
41785492 */
41795493 Object3D elem;
4180
- for (Enumeration e = /*temp.children*/GraphreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
5494
+ for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
41815495 {
41825496 Object3D child = (Object3D)e.nextElement();
41835497
....@@ -4191,7 +5505,7 @@
41915505 else
41925506 elem = child.deepCopy(); // ?
41935507 child.parent = keepparent;
4194
- //if (GraphreeD.clipboardIsTempGroup && LA.isIdentity(elem.fromParent))
5508
+ //if (GrafreeD.clipboardIsTempGroup && LA.isIdentity(elem.fromParent))
41955509 // elem = elem.get(0);
41965510 makeSomething(elem, true); // ?? first);
41975511 //group.addChild(elem);
....@@ -4211,23 +5525,24 @@
42115525 //Object3D cb = Applet3D.clipboard;
42125526 //temp.addChild(cb);
42135527 //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());
5528
+ assert(Grafreed.clipboard.parent == null);
5529
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
5530
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
5531
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
5532
+ makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy());
42195533 else
4220
- makeSomething(expand?GraphreeD.clipboard.copyExpand():GraphreeD.clipboard.deepCopy());
4221
- GraphreeD.clipboard.get(0).parent = keepparent;
5534
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
5535
+ Grafreed.clipboard.get(0).parent = keepparent;
42225536 }
42235537
5538
+ Globals.REPLACEONMAKE = keep;
42245539 ResetModel();
42255540 refreshContents();
42265541 }
42275542
4228
- void pasteInto(boolean copyit)
5543
+ void pasteInto(boolean copyit, boolean clone)
42295544 {
4230
-// if (GraphreeD.clipboard == null)
5545
+// if (GrafreeD.clipboard == null)
42315546 // return;
42325547
42335548 if (group.selection.size() != 1)
....@@ -4254,15 +5569,22 @@
42545569 if (copyit)
42555570 {
42565571 // paste(false);
4257
- CloneClipboard(false); // sept 2014
5572
+ if (clone)
5573
+ {
5574
+ CloneClipboard(false); // sept 2014
5575
+ }
5576
+ else
5577
+ {
5578
+ paste(false);
5579
+ }
42585580 }
42595581 else
42605582 {
42615583 boolean first = true;
42625584
4263
- if (GraphreeD.clipboardIsTempGroup)
5585
+ if (Grafreed.clipboardIsTempGroup)
42645586 {
4265
- Composite temp = (Composite)GraphreeD.clipboard;
5587
+ Composite temp = (Composite)Grafreed.clipboard;
42665588 Object3D copy;
42675589 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
42685590 {
....@@ -4272,7 +5594,7 @@
42725594 }
42735595 } else
42745596 {
4275
- linkSomething(GraphreeD.clipboard); //.get(0));
5597
+ linkSomething(Grafreed.clipboard); //.get(0));
42765598 }
42775599 }
42785600 }
....@@ -4349,6 +5671,10 @@
43495671
43505672 void group(Object3D csg, boolean grab)
43515673 {
5674
+ if (Globals.REPLACEONMAKE)
5675
+ Save();
5676
+ boolean keep = Globals.REPLACEONMAKE;
5677
+ Globals.REPLACEONMAKE = false;
43525678 if (//false) // why??
43535679 !group.selection.isEmpty())
43545680 {
....@@ -4462,8 +5788,34 @@
44625788 //node.add(csg);
44635789 //makeSomething(node);
44645790 makeSomething(csg);
5791
+ Globals.REPLACEONMAKE = keep;
44655792 }
44665793
5794
+ void Ungroup(Object3D g)
5795
+ {
5796
+ if (Globals.REPLACEONMAKE)
5797
+ Save();
5798
+ boolean keep = Globals.REPLACEONMAKE;
5799
+ Globals.REPLACEONMAKE = false;
5800
+ if (g instanceof HiddenObject)
5801
+ {
5802
+ HiddenObject h = (HiddenObject) g;
5803
+
5804
+ for (int i=0; i<h.ActualSize(); i++)
5805
+ {
5806
+ objEditor.makeSomething(h.get(i), false);
5807
+ }
5808
+ }
5809
+ else
5810
+ {
5811
+ for (int i=0; i<g.Size(); i++)
5812
+ {
5813
+ objEditor.makeSomething(g.get(i), false);
5814
+ }
5815
+ }
5816
+ Globals.REPLACEONMAKE = keep;
5817
+ }
5818
+
44675819 void ungroup()
44685820 {
44695821 /*
....@@ -4657,21 +6009,6 @@
46576009 }
46586010 */
46596011
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
-
46756012 /*
46766013 public void Callback(Object obj)
46776014 {
....@@ -4695,26 +6032,9 @@
46956032 }
46966033 */
46976034
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
-
47156035 String GetFile(String dialogName)
47166036 {
4717
- if (GraphreeD.standAlone)
6037
+ if (Grafreed.standAlone)
47186038 {
47196039 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
47206040 browser.show();
....@@ -4778,10 +6098,48 @@
47786098 cButton flashSelectionButton;
47796099 cButton editButton;
47806100 cButton uneditButton;
6101
+ JCheckBox allParamsButton;
47816102 cButton clearpanelButton;
4782
- cButton allParamsButton;
47836103 cButton unselectButton;
47846104
6105
+ cButton restoreCameraButton;
6106
+
6107
+ cButton oneStepButton;
6108
+
6109
+ cButton groupButton;
6110
+ cButton ungroupButton;
6111
+ cButton compositeButton;
6112
+ cButton switchButton;
6113
+ cButton loopButton;
6114
+ cButton textureButton;
6115
+
6116
+ cButton skybox1Button;
6117
+ cButton skybox2Button;
6118
+ cButton skybox3Button;
6119
+ cButton skybox4Button;
6120
+ cButton skybox5Button;
6121
+ cButton skybox6Button;
6122
+ cButton skybox7Button;
6123
+
6124
+ cButton skybox11Button;
6125
+ cButton skybox12Button;
6126
+ cButton skybox13Button;
6127
+ cButton skybox14Button;
6128
+ cButton skybox15Button;
6129
+ cButton skybox16Button;
6130
+ cButton skybox17Button;
6131
+
6132
+ cButton gridButton;
6133
+ cButton boxButton;
6134
+ cButton sphereButton;
6135
+ cButton coneButton;
6136
+ cButton torusButton;
6137
+ cButton superButton;
6138
+ cButton kleinButton;
6139
+ cButton particlesButton;
6140
+ cButton overlayButton;
6141
+ cButton lightButton;
6142
+
47856143 cButton screenfitButton;
47866144 cButton screenfitpointButton;
47876145 cButton snapobjectButton;
....@@ -4793,14 +6151,6 @@
47936151
47946152 cButton setsupportButton;
47956153
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
-
48046154 //
48056155 //Composite
48066156 Object3D // to do !!
....@@ -4810,9 +6160,11 @@
48106160 //JTree jTree;
48116161 private MenuItem lookAtItem;
48126162 private MenuItem lookFromItem;
4813
- private MenuItem switchItem;
6163
+ private MenuItem switchViewItem;
48146164 private MenuItem cutItem;
4815
- private MenuItem duplicateItem;
6165
+ private MenuItem undoItem;
6166
+ private MenuItem redoItem;
6167
+ private JMenuItem duplicateItem;
48166168 private MenuItem cloneItem;
48176169 private MenuItem cloneSupportItem;
48186170 private MenuItem overwriteGeoItem;
....@@ -4823,8 +6175,9 @@
48236175 private MenuItem resetsupportItem;
48246176 private MenuItem resetreferencesItem;
48256177 private MenuItem linkverticesItem;
6178
+ private MenuItem relinkverticesItem;
48266179 private MenuItem setMasterItem;
4827
- private MenuItem resetMeshItem;
6180
+ private MenuItem resetAllItem;
48286181 private MenuItem stepAllItem;
48296182 private MenuItem revertMeshItem;
48306183 private MenuItem poseMeshItem;
....@@ -4835,14 +6188,17 @@
48356188 private MenuItem mergeGeometriesItem;
48366189 private MenuItem copyItem;
48376190 private MenuItem pasteItem;
6191
+ private MenuItem pasteIntoItem;
48386192 private MenuItem pasteLinkItem;
48396193 private MenuItem pasteCloneItem;
48406194 private MenuItem pasteExpandItem;
4841
- private MenuItem clearItem;
6195
+ private MenuItem deleteItem;
48426196 private MenuItem clearAllItem;
48436197 private MenuItem genUVItem;
6198
+ private MenuItem genNormalsMESHItem;
48446199 private MenuItem genNormalsCADItem;
48456200 private MenuItem genNormalsORGANItem;
6201
+ private MenuItem genNormalsMINEItem;
48466202 private MenuItem stripifyItem;
48476203 private MenuItem unstripifyItem;
48486204 private MenuItem trimItem;
....@@ -4871,6 +6227,10 @@
48716227 private MenuItem showleavesItem;
48726228 private MenuItem markleavesItem;
48736229 private MenuItem unmarkleavesItem;
6230
+ private MenuItem rewindleavesItem;
6231
+ private MenuItem unrewindleavesItem;
6232
+ private MenuItem randomleavesItem;
6233
+ private MenuItem unrandomleavesItem;
48746234
48756235 private MenuItem flipVItem;
48766236 private MenuItem unflipVItem;
....@@ -4882,14 +6242,17 @@
48826242 private MenuItem panoTexturesItem;
48836243
48846244 private MenuItem resetCentroidItem;
4885
- private MenuItem transformgeometryItem;
6245
+ private MenuItem resetCentroidXZItem;
48866246 private MenuItem resetTransformItem;
6247
+ private MenuItem transformGeometryItem;
6248
+ private MenuItem transformChildrenItem;
6249
+ private MenuItem hideItem;
48876250 private MenuItem grabItem;
48886251 private MenuItem backItem;
48896252 private MenuItem frontItem;
48906253 private MenuItem cameraItem;
48916254 private MenuItem compositeItem;
4892
- private MenuItem randomItem;
6255
+ private MenuItem switchItem;
48936256 private MenuItem physicsItem;
48946257 private MenuItem frameselectorItem;
48956258 private MenuItem scriptNodeItem;
....@@ -4904,6 +6267,7 @@
49046267
49056268 private MenuItem resetParentItem;
49066269 private MenuItem repairParentItem;
6270
+ private MenuItem repairShadowItem;
49076271 private MenuItem sortbysizeItem;
49086272 private MenuItem sortbynameItem;
49096273
....@@ -4912,6 +6276,8 @@
49126276 private MenuItem attachBumpItem;
49136277 private MenuItem detachBumpItem;
49146278 private MenuItem pigmentBumpItem;
6279
+ private MenuItem embedTexturesItem;
6280
+ private MenuItem deEmbedTexturesItem;
49156281
49166282 private MenuItem particleItem;
49176283 private MenuItem ragdollItem;
....@@ -4924,10 +6290,11 @@
49246290 private MenuItem coneItem;
49256291 private MenuItem torusItem;
49266292 private MenuItem superItem;
6293
+ private MenuItem kleinItem;
49276294 private MenuItem blobItem;
49286295 private MenuItem latheItem;
49296296 private MenuItem bezierItem;
4930
- private MenuItem checkerItem;
6297
+ private MenuItem overlayItem;
49316298 private MenuItem meshItem;
49326299 // private MenuItem meshGroupItem;
49336300 private MenuItem springItem;
....@@ -4936,6 +6303,7 @@
49366303 private MenuItem csgItem;
49376304 private MenuItem templateItem;
49386305 private MenuItem textureItem;
6306
+ private MenuItem billboardItem;
49396307 private MenuItem shadowXItem;
49406308 private MenuItem shadowYItem;
49416309 private MenuItem shadowZItem;
....@@ -4948,11 +6316,6 @@
49486316 private MenuItem doubleItem;
49496317 private MenuItem tripleItem;
49506318
4951
- private MenuItem importGFDItem;
4952
- private MenuItem importVRMLX3DItem;
4953
- private MenuItem import3DSItem;
4954
- private MenuItem importOBJItem;
4955
-
49566319 private MenuItem computeAOItem;
49576320 private MenuItem recompileItem;
49586321 private MenuItem editScriptItem;
....@@ -4962,4 +6325,8 @@
49626325 private MenuItem analyzeItem;
49636326 private MenuItem dumpItem;
49646327 //boolean freezemodel = false;
6328
+
6329
+ Menu cameraMenu;
6330
+ MenuItem editCameraItem;
6331
+ MenuItem restoreCameraItem;
49656332 }