Normand Briere
2019-08-06 b3ae4e889872ca0b9ca76f1d17b2f0b961226729
GroupEditor.java
....@@ -23,6 +23,302 @@
2323 DragGestureListener, DragSourceListener, DropTargetListener,
2424 ItemListener // ListSelectionListener
2525 {
26
+
27
+ public void AddSkyboxButton(String f, String s, cGridBag row)
28
+ {
29
+ cButton skyboxButton;
30
+ final String path = "cubemaps/" + f + "-skyboxes/" + s;
31
+ row.add(skyboxButton = GetButton(path + "/preview.jpg", !Grafreed.NIMBUSLAF));
32
+ //row.add(skyboxButton = GetButton(path + "/negx.jpg", !Grafreed.NIMBUSLAF));
33
+ skyboxButton.setToolTipText(s);
34
+ skyboxButton.addActionListener(new ActionListener()
35
+ {
36
+ @Override
37
+ public void actionPerformed(ActionEvent e)
38
+ {
39
+ ChangeSkybox(path);
40
+ }
41
+ });
42
+ }
43
+
44
+ public void AddSkyboxTab0(JTabbedPane skyboxpanel)
45
+ {
46
+ cGridBag tab0 = new cGridBag().setVertical(true);
47
+
48
+ tab0.setName("Urban");
49
+ skyboxpanel.add(tab0);
50
+
51
+ cGridBag row0 = new cGridBag();
52
+ cGridBag row1 = new cGridBag();
53
+ cGridBag row2 = new cGridBag();
54
+ cGridBag row3 = new cGridBag();
55
+ cGridBag row4 = new cGridBag();
56
+ cGridBag row5 = new cGridBag();
57
+ cGridBag row6 = new cGridBag();
58
+
59
+ AddSkyboxButton("default", "rgb", row0);
60
+ //AddSkyboxButton("default", "cornell", row0);
61
+ AddSkyboxButton("penguins", "dust", row0);
62
+ AddSkyboxButton("penguins", "tropic", row0);
63
+ AddSkyboxButton("penguins", "yonder", row0);
64
+
65
+ AddSkyboxButton("default", "uffizi", row1);
66
+ AddSkyboxButton("bridge", "Bridge", row1);
67
+ AddSkyboxButton("bridge", "Bridge2", row1);
68
+ AddSkyboxButton("urban", "GamlaStan2", row1);
69
+
70
+ AddSkyboxButton("urban", "Parliament", row2);
71
+ AddSkyboxButton("urban", "Roundabout", row2);
72
+ AddSkyboxButton("urban", "SaintLazarusChurch", row2);
73
+ AddSkyboxButton("urban", "SaintLazarusChurch2", row2);
74
+
75
+ AddSkyboxButton("urban", "SaintLazarusChurch3", row3);
76
+ AddSkyboxButton("urban", "UnionSquare", row3);
77
+ AddSkyboxButton("urban", "Medborgarplatsen", row3);
78
+ AddSkyboxButton("park", "BerzeliiPark", row3);
79
+
80
+ AddSkyboxButton("park", "Buddha", row4);
81
+ AddSkyboxButton("park", "CNTower2", row4);
82
+ AddSkyboxButton("park", "NiagaraFalls1", row4);
83
+ AddSkyboxButton("park", "NiagaraFalls3", row4);
84
+
85
+ AddSkyboxButton("park", "Park", row5);
86
+ AddSkyboxButton("park", "Pond", row5);
87
+ AddSkyboxButton("park", "Skansen", row5);
88
+ AddSkyboxButton("park", "Skansen2", row5);
89
+
90
+ AddSkyboxButton("park", "Skansen3", row6);
91
+ AddSkyboxButton("park", "Skansen4", row6);
92
+ AddSkyboxButton("park", "Skansen5", row6);
93
+ AddSkyboxButton("persson", "VancouverConventionCentre", row6);
94
+
95
+ tab0.add(row0);
96
+ tab0.add(row1);
97
+ tab0.add(row2);
98
+ tab0.add(row3);
99
+ tab0.add(row4);
100
+ tab0.add(row5);
101
+ tab0.add(row6);
102
+
103
+ for (int i=5; --i>=0;)
104
+ {
105
+ //oe.toolboxPanel.Return();
106
+ //tab0.add(new cGridBag());
107
+ }
108
+ }
109
+
110
+ public void AddSkyboxTab1(JTabbedPane skyboxpanel)
111
+ {
112
+ cGridBag tab0 = new cGridBag().setVertical(true);
113
+
114
+ tab0.setName("Nature");
115
+ skyboxpanel.add(tab0);
116
+
117
+ cGridBag row0 = new cGridBag();
118
+ cGridBag row1 = new cGridBag();
119
+ cGridBag row2 = new cGridBag();
120
+ cGridBag row3 = new cGridBag();
121
+ cGridBag row4 = new cGridBag();
122
+ cGridBag row5 = new cGridBag();
123
+ cGridBag row6 = new cGridBag();
124
+
125
+ AddSkyboxButton("beach", "HeartInTheSand", row0);
126
+ AddSkyboxButton("beach", "LarnacaBeach", row0);
127
+ AddSkyboxButton("beach", "PalmTrees", row0);
128
+ AddSkyboxButton("beach", "Tenerife", row0);
129
+
130
+ AddSkyboxButton("beach", "Tenerife2", row1);
131
+ AddSkyboxButton("beach", "Tenerife3", row1);
132
+ AddSkyboxButton("field", "FishPond", row1);
133
+ AddSkyboxButton("field", "Footballfield", row1);
134
+
135
+ AddSkyboxButton("field", "Meadow", row2);
136
+ AddSkyboxButton("field", "Sorsele", row2);
137
+ AddSkyboxButton("field", "Sorsele2", row2);
138
+ AddSkyboxButton("field", "Sorsele3", row2);
139
+
140
+ AddSkyboxButton("forest", "Brudslojan", row3);
141
+ AddSkyboxButton("forest", "Langholmen2", row3);
142
+ AddSkyboxButton("forest", "Plants", row3);
143
+ AddSkyboxButton("mountain", "Maskonaive", row3);
144
+
145
+ AddSkyboxButton("mountain", "Maskonaive2", row4);
146
+ AddSkyboxButton("mountain", "Maskonaive3", row4);
147
+ AddSkyboxButton("mountain", "Teide", row4);
148
+ AddSkyboxButton("park", "Tantolunden4", row4);
149
+
150
+ AddSkyboxButton("park", "Stairs", row5);
151
+ AddSkyboxButton("default", "skycube", row6);
152
+ AddSkyboxButton("rocky", "Langholmen", row5);
153
+ AddSkyboxButton("rocky", "Skinnarviksberget", row5);
154
+
155
+ AddSkyboxButton("rocky", "Tantolunden6", row5);
156
+ AddSkyboxButton("default", "CloudyHills", row6);
157
+ AddSkyboxButton("daz", "Autumn", row6);
158
+ AddSkyboxButton("daz", "MountainTrail", row6);
159
+ /*
160
+Autumn
161
+Greenlands
162
+MountainTrail
163
+Oasis
164
+TheRock
165
+TopOfTheWorld
166
+Winter
167
+ */
168
+
169
+ tab0.add(row0);
170
+ tab0.add(row1);
171
+ tab0.add(row2);
172
+ tab0.add(row3);
173
+ tab0.add(row4);
174
+ tab0.add(row5);
175
+ tab0.add(row6);
176
+
177
+ for (int i=5; --i>=0;)
178
+ {
179
+ //oe.toolboxPanel.Return();
180
+ //tab0.add(new cGridBag());
181
+ }
182
+ }
183
+
184
+ public void AddSkyboxTab2(JTabbedPane skyboxpanel)
185
+ {
186
+ cGridBag tab0 = new cGridBag().setVertical(true);
187
+
188
+ tab0.setName("Night");
189
+ skyboxpanel.add(tab0);
190
+
191
+ cGridBag row0 = new cGridBag();
192
+ cGridBag row1 = new cGridBag();
193
+ cGridBag row2 = new cGridBag();
194
+ cGridBag row3 = new cGridBag();
195
+ cGridBag row4 = new cGridBag();
196
+ cGridBag row5 = new cGridBag();
197
+ cGridBag row6 = new cGridBag();
198
+
199
+ AddSkyboxButton("night", "NightPath", row0);
200
+ AddSkyboxButton("night", "PondNight", row0);
201
+ AddSkyboxButton("night", "Powerlines", row0);
202
+ AddSkyboxButton("night", "SwedishRoyalCastle", row0);
203
+
204
+ AddSkyboxButton("urban", "CNTower", row1);
205
+ AddSkyboxButton("bridge", "ArstaBridge", row1);
206
+ AddSkyboxButton("rocky", "Riddarfjarden", row1);
207
+ AddSkyboxButton("penguins", "sleepyhollow", row1);
208
+
209
+ AddSkyboxButton("penguins", "kenon_star", row2);
210
+ AddSkyboxButton("persson", "corona", row2);
211
+ AddSkyboxButton("persson", "spaceskybox", row2);
212
+ AddSkyboxButton("indoors", "Vasa", row2);
213
+
214
+ AddSkyboxButton("winter", "Backyard", row3);
215
+ AddSkyboxButton("winter", "Creek", row3);
216
+ AddSkyboxButton("winter", "FootballField3", row3);
217
+ AddSkyboxButton("winter", "Forest", row3);
218
+
219
+ AddSkyboxButton("winter", "HornstullsStrand2", row4);
220
+ AddSkyboxButton("winter", "House", row4);
221
+ AddSkyboxButton("winter", "IceLake", row4);
222
+ AddSkyboxButton("winter", "IceRiver", row4);
223
+
224
+ AddSkyboxButton("winter", "Park3", row5);
225
+ AddSkyboxButton("winter", "PondWinter", row5);
226
+ AddSkyboxButton("winter", "Tantolunden5", row5);
227
+ AddSkyboxButton("winter", "Vindelalven", row5);
228
+
229
+ AddSkyboxButton("daz", "TheRock", row6);
230
+ AddSkyboxButton("daz", "TopOfTheWorld", row6);
231
+ AddSkyboxButton("daz", "Winter", row6);
232
+ AddSkyboxButton("mountain", "Ryfjallet", row6);
233
+
234
+ tab0.add(row0);
235
+ tab0.add(row1);
236
+ tab0.add(row2);
237
+ tab0.add(row3);
238
+ tab0.add(row4);
239
+ tab0.add(row5);
240
+ tab0.add(row6);
241
+
242
+ for (int i=5; --i>=0;)
243
+ {
244
+ //oe.toolboxPanel.Return();
245
+ //tab0.add(new cGridBag());
246
+ }
247
+ }
248
+
249
+ public void AddSkyboxTab3(JTabbedPane skyboxpanel)
250
+ {
251
+ cGridBag tab0 = new cGridBag().setVertical(true);
252
+
253
+ tab0.setName("Others");
254
+ skyboxpanel.add(tab0);
255
+
256
+ cGridBag row0 = new cGridBag();
257
+ cGridBag row1 = new cGridBag();
258
+ cGridBag row2 = new cGridBag();
259
+ cGridBag row3 = new cGridBag();
260
+ cGridBag row4 = new cGridBag();
261
+ cGridBag row5 = new cGridBag();
262
+ cGridBag row6 = new cGridBag();
263
+
264
+ AddSkyboxButton("mayhem", "afterrain", row0);
265
+ AddSkyboxButton("mayhem", "aqua4", row0);
266
+ AddSkyboxButton("mayhem", "aqua9", row0);
267
+ AddSkyboxButton("mayhem", "flame", row0);
268
+
269
+ AddSkyboxButton("mayhem", "h2s", row1);
270
+ AddSkyboxButton("mayhem", "prehistoric", row1);
271
+ AddSkyboxButton("mayhem", "scorched", row1);
272
+ AddSkyboxButton("penguins", "desertdawn", row1);
273
+
274
+ AddSkyboxButton("persson", "Citadella", row2);
275
+ AddSkyboxButton("persson", "Citadella2", row2);
276
+ AddSkyboxButton("persson", "clouds1", row2);
277
+ AddSkyboxButton("penguins", "wrath", row2);
278
+
279
+ AddSkyboxButton("persson", "FishermansBastion", row3);
280
+ AddSkyboxButton("persson", "HeroesSquare", row3);
281
+ AddSkyboxButton("indoors", "DallasW", row3);
282
+ AddSkyboxButton("indoors", "MarriottMadisonWest", row3);
283
+
284
+ AddSkyboxButton("persson", "LancellottiChapel", row4);
285
+ AddSkyboxButton("persson", "PereaBeach1", row4);
286
+ AddSkyboxButton("persson", "PereaBeach2", row4);
287
+ AddSkyboxButton("persson", "redeclipse", row4);
288
+
289
+ AddSkyboxButton("daz", "Greenlands", row5);
290
+ AddSkyboxButton("daz", "Oasis", row5);
291
+ AddSkyboxButton("elyvisions", "arch3", row5);
292
+ AddSkyboxButton("elyvisions", "calm_sea", row5);
293
+
294
+ AddSkyboxButton("elyvisions", "rainbow", row6);
295
+ AddSkyboxButton("elyvisions", "distant_sunset", row6);
296
+ AddSkyboxButton("elyvisions", "heaven", row6);
297
+ AddSkyboxButton("elyvisions", "hot", row6);
298
+
299
+ tab0.add(row0);
300
+ tab0.add(row1);
301
+ tab0.add(row2);
302
+ tab0.add(row3);
303
+ tab0.add(row4);
304
+ tab0.add(row5);
305
+ tab0.add(row6);
306
+
307
+ for (int i=5; --i>=0;)
308
+ {
309
+ //oe.toolboxPanel.Return();
310
+ //tab0.add(new cGridBag());
311
+ }
312
+ }
313
+
314
+ public void ChangeSkybox(String name)
315
+ {
316
+ //cameraView.envyoff = false;
317
+ group.skyboxname = name;
318
+ group.skyboxext = "jpg";
319
+ cameraView.repaint();
320
+ }
321
+
26322 //ObjEditor objEditor;
27323 public void closeUI2()
28324 {
....@@ -60,6 +356,12 @@
60356 this.copy = this.group = group;
61357 //selectees = this.group.selectees;
62358
359
+ if (copy.versionlist == null)
360
+ {
361
+ copy.versionlist = new Object3D[100];
362
+ copy.versionindex = -1;
363
+ }
364
+
63365 if(ui)
64366 SetupUI(objEditor);
65367 }
....@@ -80,10 +382,22 @@
80382 SetupViews(objEditor);
81383
82384 ((cRadio)radioPanel.getComponent(0)).SetCamera(cameraView.renderCamera, true);
385
+
386
+ if (copy.versionlist == null)
387
+ {
388
+ copy.versionlist = new Object3D[100];
389
+ copy.versionindex = -1;
390
+
391
+ Save(true);
392
+ }
83393 }
84394
85395 void CloneSelection(boolean supports)
86396 {
397
+ if (Globals.REPLACEONMAKE)
398
+ Save();
399
+ boolean keep = Globals.REPLACEONMAKE;
400
+ Globals.REPLACEONMAKE = false;
87401 // Object3D keep = GrafreeD.clipboard;
88402 //Object3D obj;
89403 for (int i=0; i<group.selection.size(); i++)// Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -94,6 +408,7 @@
94408
95409 makeSomething(clone, i==group.selection.size()-1);
96410 }
411
+ Globals.REPLACEONMAKE = keep;
97412 }
98413
99414 void CloneClipboard(boolean supports)
....@@ -150,16 +465,19 @@
150465
151466 void SetupMenu2(GroupEditor oe)
152467 {
468
+ oe.jTree = new cTree();
469
+
153470 Menu menu;
154471 oe.menuBar.add(menu = new Menu("Edit"));
155472 //editItem = menu.add(new MenuItem("Edit"));
156473 //editItem.addActionListener(this);
157
- undoItem = menu.add(new MenuItem("Undo"));
158
- undoItem.addActionListener(this);
159
- redoItem = menu.add(new MenuItem("Redo"));
160
- redoItem.addActionListener(this);
161
- menu.add("-");
162
- duplicateItem = menu.add(new MenuItem("Duplicate"));
474
+
475
+// undoItem = menu.add(new MenuItem("Undo"));
476
+// undoItem.addActionListener(this);
477
+// redoItem = menu.add(new MenuItem("Redo"));
478
+// redoItem.addActionListener(this);
479
+// menu.add("-");
480
+ duplicateItem = oe.jTree.popup.add(new JMenuItem("Duplicate"));
163481 duplicateItem.addActionListener(this);
164482 cloneItem = menu.add(new MenuItem("Clone"));
165483 cloneItem.addActionListener(this);
....@@ -175,7 +493,6 @@
175493 copyItem.addActionListener(this);
176494 pasteItem = menu.add(new MenuItem("Paste"));
177495 pasteItem.addActionListener(this);
178
- menu.add("-");
179496
180497 menu.add("-");
181498 pasteIntoItem = menu.add(new MenuItem("Paste into"));
....@@ -187,8 +504,8 @@
187504 // pasteExpandItem = menu.add(new MenuItem("Paste expand"));
188505 // pasteExpandItem.addActionListener(this);
189506 menu.add("-");
190
- clearItem = menu.add(new MenuItem("Clear"));
191
- clearItem.addActionListener(this);
507
+ deleteItem = menu.add(new MenuItem("Delete"));
508
+ deleteItem.addActionListener(this);
192509
193510 if (Globals.ADVANCED)
194511 {
....@@ -202,23 +519,23 @@
202519 //zBufferItem.addActionListener(this);
203520 //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens"));
204521 //normalLensItem.addActionListener(this);
205
- cameraMenu.add(revertCameraItem = new MenuItem("Restore Camera"));
206
- revertCameraItem.addActionListener(this);
522
+ cameraMenu.add(restoreCameraItem = new MenuItem("Restore Viewpoint"));
523
+ restoreCameraItem.addActionListener(this);
207524
208
- cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen"));
209
- toggleFullScreenItem.addItemListener(this);
210
- toggleFullScreenItem.setState(CameraPane.FULLSCREEN);
211
- cameraMenu.add("-");
525
+// cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen"));
526
+// toggleFullScreenItem.addItemListener(this);
527
+// toggleFullScreenItem.setState(CameraPane.FULLSCREEN);
528
+// cameraMenu.add("-");
529
+//
530
+// cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture"));
531
+// toggleTextureItem.addItemListener(this);
532
+// toggleTextureItem.setState(CameraPane.textureon);
533
+//
534
+// cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch"));
535
+// toggleSwitchItem.addItemListener(this);
536
+// toggleSwitchItem.setState(CameraPane.SWITCH);
212537
213
- cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture"));
214
- toggleTextureItem.addItemListener(this);
215
- toggleTextureItem.setState(CameraPane.textureon);
216
-
217
- cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch"));
218
- toggleSwitchItem.addItemListener(this);
219
- toggleSwitchItem.setState(CameraPane.SWITCH);
220
-
221
- cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles"));
538
+ cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Show Handles"));
222539 toggleHandleItem.addItemListener(this);
223540 toggleHandleItem.setState(CameraPane.HANDLES);
224541
....@@ -245,7 +562,7 @@
245562
246563 cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug"));
247564 toggleDebugItem.addItemListener(this);
248
- toggleDebugItem.setState(CameraPane.DEBUG);
565
+ toggleDebugItem.setState(Globals.DEBUG);
249566
250567 cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum"));
251568 toggleFrustumItem.addItemListener(this);
....@@ -266,14 +583,14 @@
266583 // animationItem.addItemListener(this);
267584 // animationItem.setState(CameraPane.ANIMATION);
268585 cameraMenu.add("-");
269
- cameraMenu.add(editCameraItem = new MenuItem("Save Camera"));
586
+ cameraMenu.add(editCameraItem = new MenuItem("Save Viewpoint"));
270587 editCameraItem.addActionListener(this);
271588
272589 if (Globals.ADVANCED)
273590 {
274591 oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
275592 //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
276
- //cameraMenu.add(switchItem = new MenuItem("Reverse View"));
593
+ //cameraMenu.add(switchViewItem = new MenuItem("Reverse View"));
277594 editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf"));
278595 oe.cameraMenu.add("-");
279596 openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy..."));
....@@ -281,7 +598,7 @@
281598 editLeafItem.addActionListener(this);
282599 lookAtItem.addActionListener(this);
283600 //lookFromItem.addActinoListener(this);
284
- //switchItem.addActionListener(this);
601
+ //switchViewItem.addActionListener(this);
285602 }
286603
287604 oe.menuBar.add(menu = new Menu("Setting"));
....@@ -326,21 +643,29 @@
326643 }
327644
328645 oe.menuBar.add(menu = new Menu("Group"));
329
- grabItem = menu.add(new MenuItem("Grab"));
330
- grabItem.addActionListener(this);
646
+// grabItem = menu.add(new MenuItem("Grab"));
647
+// grabItem.addActionListener(this);
331648 backItem = menu.add(new MenuItem("Back"));
332649 backItem.addActionListener(this);
333650 frontItem = menu.add(new MenuItem("Front"));
334651 frontItem.addActionListener(this);
335
- compositeItem = menu.add(new MenuItem("Composite"));
336
- compositeItem.addActionListener(this);
652
+// compositeItem = menu.add(new MenuItem("Composite"));
653
+// compositeItem.addActionListener(this);
654
+
655
+ if (Globals.ADVANCED)
656
+ {
337657 hideItem = menu.add(new MenuItem("Hidden Group"));
338658 hideItem.addActionListener(this);
659
+ }
339660 ungroupItem = menu.add(new MenuItem("Ungroup"));
340661 ungroupItem.addActionListener(this);
341
- menu.add("-");
342
- randomItem = menu.add(new MenuItem("Switch node"));
343
- randomItem.addActionListener(this);
662
+
663
+// menu.add("-");
664
+//
665
+// switchItem = menu.add(new MenuItem("Switch node"));
666
+// switchItem.addActionListener(this);
667
+ if (Globals.ADVANCED)
668
+ {
344669 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
345670 switchGeoItem.addActionListener(this);
346671 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
....@@ -348,8 +673,6 @@
348673 morphItem = menu.add(new MenuItem("Morph Group"));
349674 morphItem.addActionListener(this);
350675
351
- if (Globals.ADVANCED)
352
- {
353676 menu.add("-");
354677 physicsItem = menu.add(new MenuItem("Physics"));
355678 physicsItem.addActionListener(this);
....@@ -357,30 +680,29 @@
357680 frameselectorItem.addActionListener(this);
358681 scriptNodeItem = menu.add(new MenuItem("Script Node"));
359682 scriptNodeItem.addActionListener(this);
360
- cameraItem = menu.add(new MenuItem("Camera"));
361
- cameraItem.addActionListener(this);
362683 }
363684
364685 oe.menuBar.add(menu = new Menu("Object"));
365
- textureItem = menu.add(new MenuItem("Texture"));
366
- textureItem.addActionListener(this);
686
+// textureItem = menu.add(new MenuItem("Texture"));
687
+// textureItem.addActionListener(this);
367688 billboardItem = menu.add(new MenuItem("Billboard"));
368689 billboardItem.addActionListener(this);
369690 csgItem = menu.add(new MenuItem("CSG"));
370691 csgItem.addActionListener(this);
371
- shadowXItem = menu.add(new MenuItem("Shadow X"));
692
+ shadowXItem = menu.add(new MenuItem("Shadow Red"));
372693 shadowXItem.addActionListener(this);
373
- shadowYItem = menu.add(new MenuItem("Shadow Y"));
694
+ shadowYItem = menu.add(new MenuItem("Shadow Green"));
374695 shadowYItem.addActionListener(this);
375
- shadowZItem = menu.add(new MenuItem("Shadow Z"));
696
+ shadowZItem = menu.add(new MenuItem("Shadow Blue"));
376697 shadowZItem.addActionListener(this);
698
+ attributeItem = menu.add(new MenuItem("Attribute"));
699
+ attributeItem.addActionListener(this);
700
+
377701 if (Globals.ADVANCED)
378702 {
379703 menu.add("-");
380704 linkerItem = menu.add(new MenuItem("Linker"));
381705 linkerItem.addActionListener(this);
382
- attributeItem = menu.add(new MenuItem("Attribute"));
383
- attributeItem.addActionListener(this);
384706 templateItem = menu.add(new MenuItem("Template"));
385707 templateItem.addActionListener(this);
386708 pointflowItem = menu.add(new MenuItem("Point Flow"));
....@@ -409,7 +731,7 @@
409731 genNormalsMESHItem.addActionListener(this);
410732 if (Globals.ADVANCED)
411733 {
412
- genNormalsMINEItem = menu.add(new MenuItem("My Normals"));
734
+ genNormalsMINEItem = menu.add(new MenuItem("Stitch Normals"));
413735 genNormalsMINEItem.addActionListener(this);
414736 }
415737 stripifyItem = menu.add(new MenuItem("Stripify"));
....@@ -469,6 +791,14 @@
469791 markleavesItem.addActionListener(this);
470792 unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves"));
471793 unmarkleavesItem.addActionListener(this);
794
+ rewindleavesItem = menu.add(new MenuItem("Rewind Leaves"));
795
+ rewindleavesItem.addActionListener(this);
796
+ unrewindleavesItem = menu.add(new MenuItem("Unrewind Leaves"));
797
+ unrewindleavesItem.addActionListener(this);
798
+ randomleavesItem = menu.add(new MenuItem("Random Leaves"));
799
+ randomleavesItem.addActionListener(this);
800
+ unrandomleavesItem = menu.add(new MenuItem("Unrandom Leaves"));
801
+ unrandomleavesItem.addActionListener(this);
472802 menu.add("-");
473803 flipVItem = menu.add(new MenuItem("Flip V"));
474804 flipVItem.addActionListener(this);
....@@ -494,10 +824,15 @@
494824 attachBumpItem.addActionListener(this);
495825 pigmentBumpItem = menu.add(new MenuItem("Pigment -> Bump"));
496826 pigmentBumpItem.addActionListener(this);
827
+ //embedTexturesItem
497828 detachPigmentItem = menu.add(new MenuItem("Detach Pigment"));
498829 detachPigmentItem.addActionListener(this);
499830 detachBumpItem = menu.add(new MenuItem("Detach Bump"));
500831 detachBumpItem.addActionListener(this);
832
+ embedTexturesItem = menu.add(new MenuItem("Embed Textures"));
833
+ embedTexturesItem.addActionListener(this);
834
+ deEmbedTexturesItem = menu.add(new MenuItem("De-embed Textures"));
835
+ deEmbedTexturesItem.addActionListener(this);
501836 menu.add("-");
502837 sortbysizeItem = menu.add(new MenuItem("Sort by size"));
503838 sortbysizeItem.addActionListener(this);
....@@ -524,8 +859,21 @@
524859 buildToolsMenu(menu);
525860 }
526861
862
+
527863 void SetupUI2(ObjEditor oe)
528864 {
865
+ // June 2019
866
+ if (oe == null)
867
+ {
868
+ //super.SetupUI2(this);
869
+ //return;
870
+ }
871
+
872
+ if (copy != group)
873
+ {
874
+ //super.SetupUI2(this);
875
+ }
876
+
529877 //new Exception().printStackTrace();
530878
531879 oe.radioPanel = new JPanel(new GridBagLayout());
....@@ -554,27 +902,83 @@
554902 oe.radioPanel.add(dummyButton);
555903 oe.buttonGroup.add(dummyButton);
556904 */
905
+ cGridBag copyOptionsPanel = new cGridBag();
906
+
907
+ copyOptionsPanel.preferredHeight = 2;
908
+
557909 //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
558910
559
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints);
911
+ //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
912
+ //minButton.setToolTipText("Minimize window");
913
+ //minButton.addActionListener(this);
914
+
915
+ if (Globals.ADVANCED)
916
+ {
917
+ oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
918
+ maxButton.setToolTipText("Maximize window");
919
+ maxButton.addActionListener(this);
920
+ }
921
+
922
+ oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
923
+ fullButton.setToolTipText("Full-screen window");
924
+ fullButton.addActionListener(this);
925
+
926
+ oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
927
+ screenfitButton.setToolTipText("Screen fit");
928
+ screenfitButton.addActionListener(this);
929
+
930
+ oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
931
+ restoreCameraButton.setToolTipText("Restore viewpoint");
932
+ restoreCameraButton.addActionListener(this);
933
+
934
+ copyOptionsPanel.add(saveVersionButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
935
+ saveVersionButton.setToolTipText("Duplicate current version");
936
+ saveVersionButton.addActionListener(this);
937
+
938
+ copyOptionsPanel.add(deleteVersionButton = GetButton("icons/trash.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
939
+ deleteVersionButton.setToolTipText("Delete current version");
940
+ deleteVersionButton.addActionListener(this);
941
+
942
+ copyOptionsPanel.add(previousVersionButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
943
+ previousVersionButton.setToolTipText("Previous version");
944
+ previousVersionButton.addActionListener(this);
945
+ previousVersionButton.setEnabled(false);
946
+
947
+ cGridBag updown = new cGridBag().setVertical(true);
948
+ updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
949
+ restoreButton.setToolTipText("Undo (restore current version)");
950
+ restoreButton.addActionListener(this);
951
+ //restoreButton.setEnabled(false);
952
+
953
+ updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
954
+ replaceButton.setToolTipText("Save (replace current version)");
955
+ replaceButton.addActionListener(this);
956
+ //replaceButton.setEnabled(false);
957
+
958
+ copyOptionsPanel.add(updown);
959
+
960
+ copyOptionsPanel.add(nextVersionButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
961
+ nextVersionButton.setToolTipText("Next version");
962
+ nextVersionButton.addActionListener(this);
963
+ nextVersionButton.setEnabled(false);
964
+
965
+ oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints);
560966 liveCB.setToolTipText("Enable animation");
561967 liveCB.addItemListener(this);
562968
563
- oe.toolbarPanel.add(oneStepButton = new cButton("Step", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
969
+ oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
564970 oneStepButton.setToolTipText("Animate one step forward");
565971 oneStepButton.addActionListener(this);
566972
567
- oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints);
973
+ oe.toolbarPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints);
568974 fastCB.setToolTipText("Fast mode");
569975 fastCB.addItemListener(this);
570976
571
- oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
572
- trackCB.setToolTipText("Enable tracking");
573
- trackCB.addItemListener(this);
574
-
575
- oe.toolbarPanel.add(screenfitButton = new cButton("@", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
576
- screenfitButton.setToolTipText("Screen fit");
577
- screenfitButton.addActionListener(this);
977
+ //oe.toolboxPanel.Return();
978
+
979
+// copyOptionsPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints);
980
+// trackCB.setToolTipText("Enable tracking");
981
+// trackCB.addItemListener(this);
578982
579983 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
580984 // screenfitpointButton.addActionListener(this);
....@@ -584,67 +988,156 @@
584988 oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
585989 snapobjectButton.addActionListener(this);
586990 snapobjectButton.setToolTipText("Snap Object");
991
+
992
+ oe.toolbarPanel.add(fourButton = GetButton("icons/controls-horizontal.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
993
+ fourButton.addActionListener(this);
994
+ fourButton.setToolTipText("Show control panel only");
587995 }
588996
589
- oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
590
- flashSelectionButton.setToolTipText("Show selection");
591
- flashSelectionButton.addActionListener(this);
997
+ //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
592998
593
- oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
594
-
595
- oe.toolbarPanel.add(twoButton = new cButton("|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
596
- twoButton.setToolTipText("Show center view only");
999
+ oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1000
+ twoButton.setToolTipText("Show 3D view only");
5971001 twoButton.addActionListener(this);
598
- oe.toolbarPanel.add(fourButton = new cButton("+||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
599
- fourButton.addActionListener(this);
600
- fourButton.setToolTipText("Show left panel only");
601
- oe.toolbarPanel.add(sixButton = new cButton("+|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
602
- sixButton.setToolTipText("2-column layout left");
603
- sixButton.addActionListener(this);
604
- oe.toolbarPanel.add(threeButton = new cButton("|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
605
- threeButton.setToolTipText("2-column layout right");
1002
+ this.fullscreenLayout = twoButton;
1003
+
1004
+ oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1005
+ threeButton.setToolTipText("Show controls and 3D view");
6061006 threeButton.addActionListener(this);
607
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
608
- sevenButton.setToolTipText("3-column layout");
609
- sevenButton.addActionListener(this);
1007
+ oe.toolbarPanel.add(sixButton = GetButton("icons/viewcontrols.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1008
+ sixButton.setToolTipText("Show 3D view and controls");
1009
+ sixButton.addActionListener(this);
1010
+// oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1011
+// sevenButton.setToolTipText("3-column layout");
1012
+// sevenButton.addActionListener(this);
6101013 //
6111014
612
- oe.toolbarPanel.add(rootButton = new cButton("o o o", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
613
- rootButton.setToolTipText("Edit selection in new tab");
1015
+ oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1016
+ rootButton.setToolTipText("Open selection in new tab");
6141017 rootButton.addActionListener(this);
6151018
616
- oe.toolbarPanel.add(closeButton = new cButton("X", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1019
+ oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
6171020 closeButton.setToolTipText("Close tab");
6181021 closeButton.addActionListener(this);
6191022 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
6201023 //clearButton.addActionListener(this);
621
-
622
- cGridBag commandsPanel = new cGridBag();
1024
+
1025
+ cGridBag row1 = new cGridBag();
6231026
624
- commandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
625
- editButton.setToolTipText("Edit selection");
1027
+ // INSERT
1028
+ row1.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1029
+ gridButton.setToolTipText("Create grid");
1030
+ gridButton.addActionListener(this);
1031
+
1032
+ row1.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1033
+ boxButton.setToolTipText("Create box");
1034
+ boxButton.addActionListener(this);
1035
+
1036
+ row1.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1037
+ sphereButton.setToolTipText("Create sphere");
1038
+ sphereButton.addActionListener(this);
1039
+
1040
+ row1.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1041
+ coneButton.setToolTipText("Create cone");
1042
+ coneButton.addActionListener(this);
1043
+
1044
+ row1.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1045
+ torusButton.setToolTipText("Create torus");
1046
+ torusButton.addActionListener(this);
1047
+
1048
+ row1.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1049
+ superButton.setToolTipText("Create superellipsoid");
1050
+ superButton.addActionListener(this);
1051
+
1052
+ if (Globals.ADVANCED)
1053
+ {
1054
+ oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1055
+ kleinButton.setToolTipText("Create Klein bottle");
1056
+ kleinButton.addActionListener(this);
1057
+ }
1058
+
1059
+ row1.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1060
+ particlesButton.setToolTipText("Create particle system");
1061
+ particlesButton.addActionListener(this);
1062
+
1063
+ oe.toolboxPanel.add(row1);
1064
+
1065
+ cGridBag row2 = new cGridBag();
1066
+
1067
+ row2.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1068
+ groupButton.setToolTipText("Create group");
1069
+ groupButton.addActionListener(this);
1070
+
1071
+ row2.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1072
+ compositeButton.setToolTipText("Create composite");
1073
+ compositeButton.addActionListener(this);
1074
+
1075
+ row2.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1076
+ switchButton.setToolTipText("Create item switcher");
1077
+ switchButton.addActionListener(this);
1078
+
1079
+ row2.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1080
+ loopButton.setToolTipText("Create loop");
1081
+ loopButton.addActionListener(this);
1082
+
1083
+ row2.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1084
+ textureButton.setToolTipText("Create texture");
1085
+ textureButton.addActionListener(this);
1086
+
1087
+ row2.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1088
+ overlayButton.setToolTipText("Create overlay");
1089
+ overlayButton.addActionListener(this);
1090
+
1091
+ row2.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1092
+ lightButton.setToolTipText("Create light");
1093
+ lightButton.addActionListener(this);
1094
+
1095
+ oe.toolboxPanel.add(row2);
1096
+
1097
+ // ENVYMAPS
1098
+ cGridBag skyboxpane = new cGridBag();
1099
+ skyboxpane.preferredHeight = 100;
1100
+
1101
+ oe.toolboxPanel.add(skyboxpane);
1102
+
1103
+ JTabbedPane skyboxpanel = new JTabbedPane();
1104
+ skyboxpane.add(skyboxpanel);
1105
+
1106
+ AddSkyboxTab0(skyboxpanel);
1107
+ AddSkyboxTab1(skyboxpanel);
1108
+ AddSkyboxTab2(skyboxpanel);
1109
+ AddSkyboxTab3(skyboxpanel);
1110
+
1111
+ // EDIT panel
1112
+ editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1113
+ editButton.setToolTipText("Pin selection controls");
6261114 editButton.addActionListener(this);
6271115
628
- commandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
629
- uneditButton.setToolTipText("Unedit selection");
1116
+ editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1117
+ uneditButton.setToolTipText("Unpin and remove selection controls");
6301118 uneditButton.addActionListener(this);
6311119
632
- commandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
633
- allParamsButton.setToolTipText("Edit all params");
1120
+ editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
1121
+ allParamsButton.setToolTipText("Show all controle");
6341122 allParamsButton.addActionListener(this);
6351123
636
- commandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1124
+ editCommandsPanel.add(clearPanelButton = GetButton("icons/clear.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
6371125 clearPanelButton.setToolTipText("Clear edit panel");
6381126 clearPanelButton.addActionListener(this);
6391127
640
- commandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1128
+ editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
6411129 unselectButton.setToolTipText("Unselect");
6421130 unselectButton.addActionListener(this);
6431131
644
- commandsPanel.preferredHeight = 1;
1132
+ editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1133
+ flashSelectionButton.setToolTipText("Highlight selection");
1134
+ flashSelectionButton.addActionListener(this);
6451135
646
- oe.treePanel.add(commandsPanel);
647
- oe.treePanel.Return();
1136
+ editCommandsPanel.preferredHeight = 1;
1137
+
1138
+ SetPinStates(false);
1139
+// oe.treePanel.add(commandsPanel);
1140
+// oe.treePanel.Return();
6481141
6491142 // oe.aConstraints.gridx += 1;
6501143 // oe.aConstraints.weighty = 0;
....@@ -661,32 +1154,20 @@
6611154
6621155 JScrollPane jSP;
6631156 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
664
- jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints);
1157
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints);
6651158 ResetModel();
6661159
6671160 oe.treePanel.add(jSPPanel);
6681161 oe.treePanel.Return();
6691162
670
- cGridBag copyOptionsPanel = new cGridBag();
671
-
672
- copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
673
- colorCB.setToolTipText("Copy color when dropped");
674
- colorCB.addItemListener(this);
675
-
676
- copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
677
- materialCB.setToolTipText("Copy material when dropped");
678
- materialCB.addItemListener(this);
679
-
680
- copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
681
- textureCB.setToolTipText("Copy texture when dropped");
682
- textureCB.addItemListener(this);
683
-
684
- copyOptionsPanel.preferredHeight = 1;
6851163 oe.treePanel.add(copyOptionsPanel);
6861164 oe.treePanel.Return();
1165
+ cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0);
1166
+ versionSlider = (cNumberSlider)sliderPane.getComponent(1);
1167
+ sliderPane.preferredHeight = 1;
6871168
688
-// mainPanel.setDividerLocation(0.5); //1.0);
689
-// mainPanel.setResizeWeight(0.5);
1169
+// mainPanel.setDividerLocation(0.1); //1.0);
1170
+ mainPanel.setResizeWeight(0.4);
6901171
6911172 //jList.addListSelectionListener(this);
6921173 oe.jTree.addTreeSelectionListener(this);
....@@ -694,7 +1175,7 @@
6941175 //jTree.setEditable(true);
6951176 oe.jTree.setDragEnabled(true);
6961177 //jTree.setPreferredSize(new Dimension(10,10));
697
- jSP.setPreferredSize(new Dimension(100,200));
1178
+ //jSP.setPreferredSize(new Dimension(100,200));
6981179
6991180 oe.jTree.setCellRenderer(new cTreeModel.Renderer());
7001181
....@@ -706,29 +1187,49 @@
7061187 dgr.addDragGestureListener(this);
7071188 }catch(Exception e) {}
7081189 */
709
- radio.layout = sevenButton;
1190
+ radio.layout = threeButton; // sixButton;
7101191 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
7111192 }
7121193
7131194 void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
7141195 {
1196
+ panel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
1197
+ colorCB.setToolTipText("Copy color when dropped");
1198
+ colorCB.addItemListener(this);
1199
+
1200
+ panel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
1201
+ materialCB.setToolTipText("Copy material when dropped");
1202
+ materialCB.addItemListener(this);
1203
+
1204
+ panel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
1205
+ textureCB.setToolTipText("Copy texture when dropped");
1206
+ textureCB.addItemListener(this);
1207
+
1208
+ panel.Return();
1209
+
7151210 panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
7161211 boxCB.setToolTipText("Display bounding boxes");
7171212 boxCB.addItemListener(this);
7181213
7191214 panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
720
- zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
1215
+ zoomBoxCB.setToolTipText("Display only for wheel");
7211216 zoomBoxCB.addItemListener(this);
7221217
7231218 if (true) // Globals.ADVANCED)
7241219 {
725
- panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
726
- supportCB.setToolTipText("Enable rigging");
727
- supportCB.addItemListener(this);
1220
+// panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
1221
+// supportCB.setToolTipText("Enable rigging");
1222
+// supportCB.addItemListener(this);
1223
+
1224
+ panel.add(freezeCB = new cCheckBox("Freeze", Globals.FREEZEONMOVE)); //, constraints);
1225
+ freezeCB.setToolTipText("Fast moving camera");
1226
+ freezeCB.addItemListener(this);
7281227
7291228 // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
7301229 // localCB.addItemListener(this);
7311230
1231
+ panel.Return();
1232
+
7321233 panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
7331234 crowdCB.setToolTipText("Used for crowds");
7341235 crowdCB.addItemListener(this);
....@@ -737,14 +1238,19 @@
7371238 smoothCB.setToolTipText("Snapping delay");
7381239 smoothCB.addItemListener(this);
7391240
740
- panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
741
- slowCB.setToolTipText("Smooth interpolation");
742
- slowCB.addItemListener(this);
1241
+// panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
1242
+// slowCB.setToolTipText("Smooth interpolation");
1243
+// slowCB.addItemListener(this);
1244
+ panel.add(minshaderCB = new cCheckBox("Min shader", Globals.MINSHADER)); //, constraints);
1245
+ minshaderCB.setToolTipText("Minimal fast shader");
1246
+ minshaderCB.addItemListener(this);
7431247
7441248 // constraints.gridy += 1;
7451249 // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
7461250 // speakerMocapCB.addItemListener(this);
7471251
1252
+ panel.Return();
1253
+
7481254 if (false)
7491255 {
7501256 // handled in scripts
....@@ -759,34 +1265,74 @@
7591265 //constraints.gridy += 1;
7601266 panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
7611267 smoothfocusCB.addItemListener(this);
1268
+ panel.Return();
7621269 }
7631270
7641271 //constraints.gridx += 1;
7651272 //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
7661273 // debugCB.addItemListener(this);
7671274
1275
+ panel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
1276
+ trackCB.setToolTipText("Enable tracking target");
1277
+ trackCB.addItemListener(this);
1278
+
7681279 panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
1280
+ oeilCB.setToolTipText("Move camera when tracking");
7691281 oeilCB.addItemListener(this);
7701282
1283
+ panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints);
1284
+ shadowCB.setToolTipText("When live compute shadows");
1285
+ shadowCB.addItemListener(this);
1286
+
1287
+ panel.Return();
1288
+ panel.add(toggleTextureCB = new cCheckBox("Textures", CameraPane.textureon)); //, constraints);
1289
+ toggleTextureCB.setToolTipText("Load textures");
1290
+ toggleTextureCB.addItemListener(this);
1291
+
1292
+ panel.add(toggleSwitchCB = new cCheckBox("Switch", CameraPane.SWITCH)); //, constraints);
1293
+ toggleSwitchCB.setToolTipText("Choose a single item");
1294
+ toggleSwitchCB.addItemListener(this);
1295
+
1296
+ panel.add(autokeepCB = new cCheckBox("Auto-replace", Globals.REPLACEONMAKE)); //, constraints);
1297
+ autokeepCB.setToolTipText("On structure change");
1298
+ autokeepCB.addItemListener(this);
1299
+
1300
+ panel.Return();
1301
+ if (Globals.ADVANCED)
1302
+ {
7711303 panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
7721304 lookAtCB.setToolTipText("Look-at target");
7731305 lookAtCB.addItemListener(this);
1306
+ }
7741307
7751308 }
7761309
7771310 cGridBag fill = new cGridBag();
778
-
7791311 fill.preferredHeight = 200;
1312
+ cGridBag fill2 = new cGridBag();
1313
+ fill2.preferredHeight = 200;
1314
+ cGridBag fill3 = new cGridBag();
1315
+ fill3.preferredHeight = 200;
7801316
7811317 panel.add(fill);
1318
+ panel.add(fill2);
1319
+ panel.add(fill3);
7821320
7831321 }
7841322
7851323 void EditObject(Object3D obj)
7861324 {
7871325 cRadio radioButton = new cRadio(obj.name);
1326
+
1327
+ // June 2019. Patch to avoid bug with transparency.
1328
+ radioButton.hadMaterial = obj.material != null;
1329
+ if (!radioButton.hadMaterial)
1330
+ {
1331
+ obj.material = new cMaterial();
1332
+ }
1333
+
7881334 radioButton.SetObject(obj);
789
- radioButton.layout = sevenButton;
1335
+ radioButton.layout = threeButton; // sixButton;
7901336 radioButton.SetCamera(cameraView.renderCamera, false);
7911337 radioButton.addActionListener(this);
7921338 radioPanel.add(radioButton);
....@@ -796,6 +1342,8 @@
7961342
7971343 void SetupViews(ObjEditor oe)
7981344 {
1345
+ theFrame = this;
1346
+
7991347 oe.SetupViews();
8001348
8011349 System.out.println("SetupViews");
....@@ -804,23 +1352,30 @@
8041352 /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this);
8051353 }
8061354
807
- JCheckBox liveCB;
808
- JCheckBox supportCB;
809
- JCheckBox localCB;
810
- JCheckBox crowdCB;
811
- JCheckBox smoothCB;
812
- JCheckBox fastCB;
813
- JCheckBox slowCB;
814
- JCheckBox boxCB;
815
- JCheckBox zoomBoxCB;
816
- JCheckBox trackCB;
817
- JCheckBox smoothfocusCB;
1355
+ cToggleButton liveCB;
1356
+ cCheckBox supportCB;
1357
+ cCheckBox localCB;
1358
+ cCheckBox crowdCB;
1359
+ cCheckBox smoothCB;
1360
+ cCheckBox minshaderCB;
1361
+
1362
+ cToggleButton fastCB;
1363
+ cCheckBox slowCB;
1364
+ cCheckBox boxCB;
1365
+ cCheckBox zoomBoxCB;
1366
+ cCheckBox freezeCB;
1367
+ //cToggleButton trackCB;
1368
+ cCheckBox trackCB;
1369
+ cCheckBox smoothfocusCB;
8181370 // JCheckBox speakerMocapCB;
819
- JCheckBox speakerCameraCB;
820
- JCheckBox speakerFocusCB;
821
- JCheckBox debugCB;
822
- JCheckBox oeilCB;
823
- JCheckBox lookAtCB;
1371
+ cCheckBox speakerCameraCB;
1372
+ cCheckBox speakerFocusCB;
1373
+ cCheckBox debugCB;
1374
+
1375
+ cCheckBox oeilCB;
1376
+ cCheckBox shadowCB;
1377
+ cCheckBox autokeepCB;
1378
+ cCheckBox lookAtCB;
8241379
8251380 // static int COLOR = 1;
8261381 // static int MATERIAL = 2;
....@@ -828,9 +1383,9 @@
8281383
8291384 int dropAttributes = Object3D.COLOR | Object3D.MATERIAL;
8301385
831
- JCheckBox colorCB;
832
- JCheckBox materialCB;
833
- JCheckBox textureCB;
1386
+ cCheckBox colorCB;
1387
+ cCheckBox materialCB;
1388
+ cCheckBox textureCB;
8341389
8351390 public void itemStateChanged(ItemEvent e)
8361391 {
....@@ -858,6 +1413,7 @@
8581413 } else if(e.getSource() == liveCB)
8591414 {
8601415 cameraView.ToggleLive();
1416
+ refreshContents(false);
8611417 }
8621418 else if(e.getSource() == supportCB)
8631419 {
....@@ -873,6 +1429,12 @@
8731429 {
8741430 cameraView.ToggleInertia();
8751431 cameraView.repaint();
1432
+ }
1433
+ else if(e.getSource() == minshaderCB)
1434
+ {
1435
+ Globals.MINSHADER ^= true;
1436
+ cameraView.programInitialized = false;
1437
+ cameraView.repaint();
8761438 }
8771439 else if(e.getSource() == localCB)
8781440 {
....@@ -922,6 +1484,18 @@
9221484 {
9231485 cameraView.ToggleOeil();
9241486 }
1487
+ else if(e.getSource() == shadowCB)
1488
+ {
1489
+ Globals.COMPUTESHADOWWHENLIVE ^= true;
1490
+ }
1491
+ else if(e.getSource() == freezeCB)
1492
+ {
1493
+ Globals.FREEZEONMOVE ^= true;
1494
+ }
1495
+ else if(e.getSource() == autokeepCB)
1496
+ {
1497
+ Globals.REPLACEONMAKE ^= true;
1498
+ }
9251499 else if(e.getSource() == lookAtCB)
9261500 {
9271501 cameraView.ToggleLookAt();
....@@ -938,7 +1512,8 @@
9381512
9391513 /**/
9401514 //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this);
941
- TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1515
+ //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1516
+ TreePath path = objEditor.jTree.getSelectionPath();
9421517 if ((path == null) || (path.getPathCount() <= 1)) {
9431518 // We can't move the root node or an empty selection
9441519 return;
....@@ -1001,8 +1576,6 @@
10011576 }
10021577 }
10031578
1004
- String string = (String) object;
1005
-
10061579 System.out.println("Transfer = " + object + "; drop : " + target);
10071580 // if( object instanceof java.io.File[])
10081581 // {
....@@ -1010,6 +1583,8 @@
10101583 // objEditor.DropFile((java.io.File[]) object, true);
10111584 // return;
10121585 // }
1586
+
1587
+ String string = object.toString();
10131588
10141589 // File path for Mac and Windows
10151590 if (string.charAt(0) == '/' || string.charAt(1) == ':')
....@@ -1055,23 +1630,33 @@
10551630
10561631 assert target == objEditor.jTree;
10571632 TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y);
1633
+ Object3D destinationLeaf;
10581634 try {
1059
- Object3D dummy = (Composite) destinationPath.getLastPathComponent();
1635
+ destinationLeaf = (Composite) destinationPath.getLastPathComponent();
10601636 } catch (Exception e) {
10611637 System.out.println("destinationPath : " + destinationPath);
10621638 return;
10631639 }
10641640
1065
- if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1641
+ for (int i=group.selection.size(); --i>=0;)
10661642 {
1643
+ Object3D child = (Object3D)group.selection.elementAt(i);
1644
+
1645
+ // Cannot move into itself
1646
+ if (child == destinationLeaf)
1647
+ return;
1648
+ }
1649
+
1650
+// june 2019 if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1651
+// {
10671652 loadClipboard(true);
10681653 objEditor.jTree.setSelectionPath(destinationPath);
10691654 pasteInto(false, false);
1070
- } else {
1071
- loadClipboard(false);
1072
- objEditor.jTree.setSelectionPath(destinationPath);
1073
- pasteInto(false, false); // true); // ???
1074
- }
1655
+// } else {
1656
+// loadClipboard(false);
1657
+// objEditor.jTree.setSelectionPath(destinationPath);
1658
+// pasteInto(false, false); // true); // ???
1659
+// }
10751660 }
10761661 public void dropActionChanged(DropTargetDragEvent dtde)
10771662 // Called if the user has modified the current drop gesture
....@@ -1176,22 +1761,30 @@
11761761 {
11771762 //heightFieldItem = menu.add(new MenuItem("Height Field"));
11781763 //heightFieldItem.addActionListener(this);
1179
- gridItem = menu.add(new MenuItem("Grid"));
1180
- gridItem.addActionListener(this);
1181
- rectoidItem = menu.add(new MenuItem("Box"));
1182
- rectoidItem.addActionListener(this);
1183
- ellipsoidItem = menu.add(new MenuItem("Sphere"));
1184
- ellipsoidItem.addActionListener(this);
1185
- coneItem = menu.add(new MenuItem("Cone"));
1186
- coneItem.addActionListener(this);
1187
- torusItem = menu.add(new MenuItem("Torus"));
1188
- torusItem.addActionListener(this);
1189
- superItem = menu.add(new MenuItem("Superellipsoid"));
1190
- superItem.addActionListener(this);
1764
+// gridItem = menu.add(new MenuItem("Grid"));
1765
+// gridItem.addActionListener(this);
1766
+// rectoidItem = menu.add(new MenuItem("Box"));
1767
+// rectoidItem.addActionListener(this);
1768
+// ellipsoidItem = menu.add(new MenuItem("Sphere"));
1769
+// ellipsoidItem.addActionListener(this);
1770
+// coneItem = menu.add(new MenuItem("Cone"));
1771
+// coneItem.addActionListener(this);
1772
+// torusItem = menu.add(new MenuItem("Torus"));
1773
+// torusItem.addActionListener(this);
1774
+// superItem = menu.add(new MenuItem("Superellipsoid"));
1775
+// superItem.addActionListener(this);
1776
+
1777
+ cameraItem = menu.add(new MenuItem("Camera"));
1778
+ cameraItem.addActionListener(this);
1779
+
1780
+ if (!Globals.ADVANCED)
1781
+ {
11911782 kleinItem = menu.add(new MenuItem("Klein Bottle"));
11921783 kleinItem.addActionListener(this);
1193
- particleItem = menu.add(new MenuItem("Particle system"));
1194
- particleItem.addActionListener(this);
1784
+ }
1785
+
1786
+// particleItem = menu.add(new MenuItem("Particle system"));
1787
+// particleItem.addActionListener(this);
11951788 if (Globals.ADVANCED)
11961789 {
11971790 ragdollItem = menu.add(new MenuItem("Rag Walk"));
....@@ -1217,15 +1810,15 @@
12171810 }
12181811 bezierItem = menu.add(new MenuItem("Bezier Patch"));
12191812 bezierItem.addActionListener(this);
1220
- overlayItem = menu.add(new MenuItem("Overlay"));
1221
- overlayItem.addActionListener(this);
1222
- lightItem = menu.add(new MenuItem("Light"));
1223
- lightItem.addActionListener(this);
1813
+// overlayItem = menu.add(new MenuItem("Overlay"));
1814
+// overlayItem.addActionListener(this);
1815
+// lightItem = menu.add(new MenuItem("Light"));
1816
+// lightItem.addActionListener(this);
12241817 menu.add("-");
12251818 //superLoopItem = menu.add(new MenuItem("Super Loop"));
12261819 //superLoopItem.addActionListener(this);
1227
- loopItem = menu.add(new MenuItem("Loop"));
1228
- loopItem.addActionListener(this);
1820
+// loopItem = menu.add(new MenuItem("Loop"));
1821
+// loopItem.addActionListener(this);
12291822 doubleItem = menu.add(new MenuItem("Fork"));
12301823 doubleItem.addActionListener(this);
12311824 if (Globals.ADVANCED)
....@@ -1241,6 +1834,9 @@
12411834 animationItem.addItemListener(this);
12421835 animationItem.setState(Globals.ANIMATION);
12431836
1837
+ menu.add(archiveItem = new MenuItem("Archive3D..."));
1838
+ archiveItem.addActionListener(this);
1839
+
12441840 menu.add("-");
12451841 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
12461842 parseverticesItem.addActionListener(this);
....@@ -1253,6 +1849,8 @@
12531849 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
12541850 reduce34MorphItem.addActionListener(this);
12551851 menu.add("-");
1852
+ menu.add(memoryItem = new MenuItem("Memory Usage"));
1853
+ memoryItem.addActionListener(this);
12561854 menu.add(computeAOItem = new MenuItem("Compute AO"));
12571855 computeAOItem.addActionListener(this);
12581856
....@@ -1261,11 +1859,9 @@
12611859 mirrorItem = menu.add(new MenuItem("Mirror Poses"));
12621860 mirrorItem.addActionListener(this);
12631861 menu.add("-");
1264
- menu.add(memoryItem = new MenuItem("Memory Usage"));
1265
- memoryItem.addActionListener(this);
12661862 menu.add(analyzeItem = new MenuItem("Analyze"));
12671863 analyzeItem.addActionListener(this);
1268
- menu.add(dumpItem = new MenuItem("Dump"));
1864
+ menu.add(dumpItem = new MenuItem("Print"));
12691865 dumpItem.addActionListener(this);
12701866 // menu.add(pathItem = new MenuItem("From-to path"));
12711867 // pathItem.addActionListener(this);
....@@ -1406,9 +2002,34 @@
14062002 shadow.material = new cMaterial(obj.material);
14072003 shadow.material.diffuse = 0.0001f;
14082004 shadow.material.specular = 0.0001f;
2005
+ //shadow.projectedVertices[1].x = 300;
14092006
14102007 makeSomething(shadow);
14112008 }
2009
+
2010
+ private void ClearUnpinned()
2011
+ {
2012
+ //for (Object3D obj : listUI)
2013
+ for (int i=listUI.size(); --i>=0;)
2014
+ {
2015
+ Object3D obj = listUI.elementAt(i);
2016
+ if (!obj.pinned)
2017
+ {
2018
+ obj.CloseUI();
2019
+ listUI.remove(i);
2020
+ }
2021
+ }
2022
+ }
2023
+
2024
+ private void EditElement(Object3D elem, boolean newWindow)
2025
+ {
2026
+ // if (!(elem instanceof Composite))
2027
+ // newWindow = false;
2028
+ listUI.add(elem);
2029
+ elem.openEditWindow(this, newWindow); //, false);
2030
+ System.out.println("edit : " + elem);
2031
+ elem.editWindow.refreshContents(true); // ? new
2032
+ }
14122033
14132034 /**
14142035 * applyExample
....@@ -1653,7 +2274,7 @@
16532274 {
16542275 ScreenFit();
16552276 } else
1656
- if (source == switchItem)
2277
+ if (source == switchViewItem)
16572278 {
16582279 cVector v1 = new cVector();
16592280 cVector v2 = new cVector();
....@@ -1662,11 +2283,11 @@
16622283 objEditor.cameraView.renderCamera.setAim(v2, v1);
16632284 objEditor.cameraView.repaint();
16642285 } else
1665
- if (source == rectoidItem)
2286
+ if (source == rectoidItem || source == boxButton)
16662287 {
16672288 makeSomething(new Box());
16682289 } else
1669
- if (source == particleItem)
2290
+ if (source == particleItem || source == particlesButton)
16702291 {
16712292 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
16722293 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1745,27 +2366,27 @@
17452366
17462367 makeSomething(obj);
17472368 } else
1748
- if (source == gridItem)
2369
+ if (source == gridItem || source == gridButton)
17492370 {
17502371 makeSomething(new Grid());
17512372 } else
1752
- if (source == ellipsoidItem)
2373
+ if (source == ellipsoidItem || source == sphereButton)
17532374 {
17542375 makeSomething(new Sphere());
17552376 } else
1756
- if (source == coneItem)
2377
+ if (source == coneItem || source == coneButton)
17572378 {
17582379 makeSomething(new Cone());
17592380 } else
1760
- if (source == torusItem)
2381
+ if (source == torusItem || source == torusButton)
17612382 {
17622383 makeSomething(new Torus());
17632384 } else
1764
- if (source == superItem)
2385
+ if (source == superItem || source == superButton)
17652386 {
17662387 makeSomething(new Superellipsoid());
17672388 } else
1768
- if (source == kleinItem)
2389
+ if (source == kleinItem || source == kleinButton)
17692390 {
17702391 makeSomething(new Klein());
17712392 } else
....@@ -1785,7 +2406,7 @@
17852406 {
17862407 makeSomething(new BezierSurface());
17872408 } else
1788
- if (source == overlayItem)
2409
+ if (source == overlayItem || source == overlayButton)
17892410 {
17902411 /*
17912412 Object3D obj = new BezierSurface(5,8);
....@@ -1833,10 +2454,27 @@
18332454 s.setup();
18342455 makeSomething(s);
18352456 } else
1836
- if (source == lightItem)
2457
+ if (source == lightItem || source == lightButton)
18372458 {
18382459 makeSomething(new Light());
18392460 } else
2461
+// if (source == skybox1Button ||
2462
+// source == skybox2Button ||
2463
+// source == skybox3Button ||
2464
+// source == skybox4Button ||
2465
+// source == skybox5Button ||
2466
+// source == skybox6Button ||
2467
+// source == skybox7Button ||
2468
+// source == skybox11Button ||
2469
+// source == skybox12Button ||
2470
+// source == skybox13Button ||
2471
+// source == skybox14Button ||
2472
+// source == skybox15Button ||
2473
+// source == skybox16Button ||
2474
+// source == skybox17Button)
2475
+// {
2476
+// ChangeSkybox(source);
2477
+// } else
18402478 if (source == csgItem)
18412479 {
18422480 group(new CSG());
....@@ -1883,30 +2521,30 @@
18832521
18842522 group(g);
18852523 } else
1886
- if (source == loopItem)
2524
+ if (source == loopItem || source == loopButton)
18872525 {
18882526 Composite csg = new GroupLeaf();
18892527 csg.count = 5;
18902528 group(csg);
1891
- Composite child = new cGroup();
2529
+ Composite child = new cGroup("Branch");
18922530 csg.addChild(child);
18932531 child.addChild(csg);
18942532 } else
18952533 if (source == doubleItem)
18962534 {
1897
- Composite csg = new GroupLeaf();
2535
+ Composite csg = new GroupLeaf("Fork");
18982536 csg.count = 5;
18992537 group(csg);
1900
- Composite child = new cGroup();
2538
+ Composite child = new cGroup("Branch A");
19012539 csg.addChild(child);
19022540 child.addChild(csg);
1903
- child = new cGroup();
2541
+ child = new cGroup("Branch B");
19042542 csg.addChild(child);
19052543 child.addChild(csg);
19062544 } else
19072545 if (source == tripleItem)
19082546 {
1909
- Composite csg = new GroupLeaf();
2547
+ Composite csg = new GroupLeaf("Trident");
19102548 csg.count = 4;
19112549 group(csg);
19122550 Composite child = new cGroup();
....@@ -1922,7 +2560,7 @@
19222560 if (source == computeAOItem)
19232561 {
19242562 Globals.drawMode = CameraPane.OCCLUSION;
1925
- Globals.theRenderer.repaint();
2563
+ cameraView.repaint();
19262564 } else
19272565 if (source == recompileItem)
19282566 {
....@@ -1937,7 +2575,7 @@
19372575 if (source == invariantsItem)
19382576 {
19392577 System.out.println("Invariants:");
1940
- Grafreed.grafreeD.universe.invariants();
2578
+ Grafreed.grafreed.universe.invariants();
19412579 } else
19422580 if (source == memoryItem)
19432581 {
....@@ -1956,6 +2594,53 @@
19562594 {
19572595 DumpObject();
19582596 } else
2597
+ if (source == minButton)
2598
+ {
2599
+ Minimize();
2600
+ } else
2601
+ if (source == maxButton)
2602
+ {
2603
+ Maximize();
2604
+ } else
2605
+ if (source == fullButton)
2606
+ {
2607
+ ToggleFullScreen();
2608
+ } else
2609
+ if (source == previousVersionButton)
2610
+ {
2611
+ // Go to previous version
2612
+ //if (!Undo())
2613
+ //java.awt.Toolkit.getDefaultToolkit().beep();
2614
+ PreviousVersion();
2615
+ } else
2616
+ if (source == restoreButton)
2617
+ {
2618
+ // Restore current version
2619
+ Restore();
2620
+ //restoreButton.setEnabled(false);
2621
+ } else
2622
+ if (source == replaceButton)
2623
+ {
2624
+ // Overwrite current version
2625
+ Replace();
2626
+ //replaceButton.setEnabled(false);
2627
+ } else
2628
+ if (source == nextVersionButton)
2629
+ {
2630
+ // Go to next version
2631
+ NextVersion();
2632
+ } else
2633
+ if (source == saveVersionButton)
2634
+ {
2635
+ // Save a new version
2636
+ if (!Save(true))
2637
+ java.awt.Toolkit.getDefaultToolkit().beep();
2638
+ } else
2639
+ if (source == deleteVersionButton)
2640
+ {
2641
+ // Delete a new version
2642
+ DeleteVersion();
2643
+ } else
19592644 if (source == oneStepButton)
19602645 {
19612646 Globals.ONESTEP = true;
....@@ -1963,17 +2648,14 @@
19632648 } else
19642649 if (source == screenfitButton)
19652650 {
1966
- //Reload(lastConverter, lastFilename, true);
19672651 ScreenFit();
19682652 } else
19692653 if (source == screenfitpointButton)
19702654 {
1971
- //Reload(lastConverter, lastFilename, true);
19722655 ScreenFitPoint();
19732656 } else
19742657 if (source == snapobjectButton)
19752658 {
1976
- //Reload(lastConverter, lastFilename, true);
19772659 SnapObject();
19782660 } else
19792661 // if (event.getSource() == recompileButton)
....@@ -2012,11 +2694,11 @@
20122694 } else
20132695 if (source == undoItem)
20142696 {
2015
- Undo();
2697
+ PreviousVersion();
20162698 } else
20172699 if (source == redoItem)
20182700 {
2019
- Redo();
2701
+ NextVersion();
20202702 } else
20212703 if (source == duplicateItem)
20222704 {
....@@ -2337,7 +3019,7 @@
23373019 {
23383020 StepAll();
23393021 } else
2340
- if (source == clearItem) // || event.getSource() == clearButton)
3022
+ if (source == deleteItem) // || event.getSource() == clearButton)
23413023 {
23423024 //int indices[] = jList.getSelectedIndices();
23433025 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2349,9 +3031,9 @@
23493031 {
23503032 ClearSelection(true);
23513033 } else
2352
- if (source == grabItem)
3034
+ if (source == grabItem || source == groupButton)
23533035 {
2354
- group(new cGroup(), true);
3036
+ group(new cGroup(), false); // true);
23553037 } else
23563038 if (source == hideItem)
23573039 {
....@@ -2369,11 +3051,11 @@
23693051 {
23703052 makeSomething(new Camera());
23713053 } else
2372
- if (source == compositeItem)
3054
+ if (source == compositeItem || source == compositeButton)
23733055 {
23743056 group(new Composite());
23753057 } else
2376
- if (source == randomItem)
3058
+ if (source == switchItem || source == switchButton)
23773059 {
23783060 RandomNode random = new RandomNode();
23793061 group(random);
....@@ -2475,7 +3157,7 @@
24753157 {
24763158 group(new cLinker());
24773159 } else
2478
- if (source == textureItem)
3160
+ if (source == textureItem || source == textureButton)
24793161 {
24803162 group(new TextureNode());
24813163 } else
....@@ -2495,17 +3177,30 @@
24953177 {
24963178 CastShadow(2);
24973179 } else
2498
- if (source == ungroupItem)
3180
+ if (source == ungroupItem || source == ungroupButton)
24993181 {
2500
- //ungroup();
3182
+ boolean hasRoot = false;
3183
+
25013184 for (int i=0; i<group.selection.size(); i++)
25023185 {
2503
- Ungroup(group.selection.get(i));
3186
+ if (group.selection.get(i) == group)
3187
+ {
3188
+ hasRoot = true;
3189
+ break;
3190
+ }
25043191 }
25053192
2506
- ClearSelection(false);
2507
-
2508
- refreshContents();
3193
+ if (!hasRoot)
3194
+ {
3195
+ for (int i=0; i<group.selection.size(); i++)
3196
+ {
3197
+ Ungroup(group.selection.get(i));
3198
+ }
3199
+
3200
+ ClearSelection(false);
3201
+
3202
+ refreshContents();
3203
+ }
25093204 } else
25103205 if (source == genUVItem)
25113206 {
....@@ -2517,7 +3212,7 @@
25173212 } else
25183213 if (source == genNormalsMESHItem)
25193214 {
2520
- GenNormals(true); // TODO
3215
+ GenNormalsMESH();
25213216 } else
25223217 if (source == genNormalsORGANItem)
25233218 {
....@@ -2582,6 +3277,22 @@
25823277 if (source == unmarkleavesItem)
25833278 {
25843279 MarkLeaves(false);
3280
+ } else
3281
+ if (source == rewindleavesItem)
3282
+ {
3283
+ RewindLeaves(true);
3284
+ } else
3285
+ if (source == unrewindleavesItem)
3286
+ {
3287
+ RewindLeaves(false);
3288
+ } else
3289
+ if (source == randomleavesItem)
3290
+ {
3291
+ RandomLeaves(true);
3292
+ } else
3293
+ if (source == unrandomleavesItem)
3294
+ {
3295
+ RandomLeaves(false);
25853296 } else
25863297 if (source == flipVItem)
25873298 {
....@@ -2790,7 +3501,7 @@
27903501 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
27913502 {
27923503 obj = (Object3D)e.nextElement();
2793
- obj.SetBumpTexture(null);
3504
+ obj.ResetBumpTexture();
27943505 }
27953506
27963507 refreshContents();
....@@ -2806,6 +3517,31 @@
28063517
28073518 refreshContents();
28083519 } else
3520
+ if (source == embedTexturesItem)
3521
+ {
3522
+ Object3D obj;
3523
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3524
+ {
3525
+ obj = (Object3D)e.nextElement();
3526
+ obj.EmbedTextures(true);
3527
+ }
3528
+
3529
+ refreshContents();
3530
+ } else
3531
+ if (source == deEmbedTexturesItem)
3532
+ {
3533
+ Object3D obj;
3534
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3535
+ {
3536
+ obj = (Object3D)e.nextElement();
3537
+ obj.EmbedTextures(false);
3538
+ }
3539
+
3540
+ CameraPane.texturepigment.clear();
3541
+ CameraPane.texturebump.clear();
3542
+
3543
+ refreshContents();
3544
+ } else
28093545 if (source == flashSelectionButton)
28103546 {
28113547 CameraPane.flash = true;
....@@ -2817,6 +3553,10 @@
28173553 if (source == twoButton)
28183554 {
28193555 radio.layout = twoButton;
3556
+
3557
+ if (CameraPane.FULLSCREEN)
3558
+ fullscreenLayout = radio.layout;
3559
+
28203560 // bug
28213561 //gridPanel.setDividerLocation(1.0);
28223562 //bigPanel.setDividerLocation(0.0);
....@@ -2849,10 +3589,31 @@
28493589 bigThree.ClearUI();
28503590 bigThree.add(centralPanel);
28513591 bigThree.FlushUI();
3592
+
3593
+ cameraView.requestFocusInWindow();
3594
+
3595
+// refreshContents(true);
3596
+//
3597
+// try
3598
+// {
3599
+// java.awt.Robot bot = new java.awt.Robot();
3600
+// int mask = InputEvent.BUTTON1_MASK;
3601
+// bot.mouseMove(100, 100);
3602
+// bot.mousePress(mask);
3603
+// bot.mouseRelease(mask);
3604
+// }
3605
+// catch (Exception e)
3606
+// {
3607
+//
3608
+// }
3609
+
28523610 } else
28533611 if (source == threeButton)
28543612 {
28553613 radio.layout = threeButton;
3614
+
3615
+ if (CameraPane.FULLSCREEN)
3616
+ fullscreenLayout = radio.layout;
28563617
28573618 // bigThree.remove(scenePanel);
28583619 // bigThree.remove(centralPanel);
....@@ -2882,13 +3643,18 @@
28823643 // centralPanel.setVisible(true);
28833644 // XYZPanel.setVisible(true);
28843645 bigThree.ClearUI();
3646
+ bigThree.add(scenePanel);
28853647 bigThree.add(centralPanel);
2886
- bigThree.add(XYZPanel);
28873648 bigThree.FlushUI();
3649
+
3650
+ cameraView.requestFocusInWindow();
28883651 } else
28893652 if (source == fourButton)
28903653 {
28913654 radio.layout = fourButton;
3655
+
3656
+ if (CameraPane.FULLSCREEN)
3657
+ fullscreenLayout = radio.layout;
28923658
28933659 // bigThree.remove(scenePanel);
28943660 // bigThree.remove(centralPanel);
....@@ -2920,10 +3686,15 @@
29203686 bigThree.ClearUI();
29213687 bigThree.add(scenePanel);
29223688 bigThree.FlushUI();
3689
+
3690
+ cameraView.requestFocusInWindow();
29233691 } else
29243692 if (source == sixButton)
29253693 {
29263694 radio.layout = sixButton;
3695
+
3696
+ if (CameraPane.FULLSCREEN)
3697
+ fullscreenLayout = radio.layout;
29273698
29283699 // bigThree.remove(scenePanel);
29293700 // bigThree.remove(centralPanel);
....@@ -2953,13 +3724,18 @@
29533724 // centralPanel.setVisible(true);
29543725 // XYZPanel.setVisible(false);
29553726 bigThree.ClearUI();
2956
- bigThree.add(scenePanel);
29573727 bigThree.add(centralPanel);
3728
+ bigThree.add(scenePanel);
29583729 bigThree.FlushUI();
3730
+
3731
+ cameraView.requestFocusInWindow();
29593732 } else
29603733 if (source == sevenButton)
29613734 {
29623735 radio.layout = sevenButton;
3736
+
3737
+ if (CameraPane.FULLSCREEN)
3738
+ fullscreenLayout = radio.layout;
29633739
29643740 // bigThree.remove(scenePanel);
29653741 // bigThree.remove(centralPanel);
....@@ -2993,6 +3769,8 @@
29933769 bigThree.add(centralPanel);
29943770 bigThree.add(XYZPanel);
29953771 bigThree.FlushUI();
3772
+
3773
+ cameraView.requestFocusInWindow();
29963774 } else
29973775 if (source == rootButton)
29983776 {
....@@ -3004,6 +3782,7 @@
30043782 EditObject(obj);
30053783 }
30063784
3785
+ cameraView.requestFocusInWindow();
30073786 refreshContents(true);
30083787 } else
30093788 if (source == closeButton)
....@@ -3013,22 +3792,37 @@
30133792 for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
30143793 {
30153794 ab = (cRadio)e.nextElement();
3016
- if(ab.getModel().isSelected() && ab.GetObject() != client)
3795
+ if (ab.getModel().isSelected() && ab.GetObject() != client)
30173796 {
3797
+ // Patch to avoid bug with transparency.
3798
+ if (!ab.hadMaterial)
3799
+ {
3800
+ ab.object.material = null;
3801
+ }
3802
+
30183803 buttonGroup.remove(ab);
30193804 radioPanel.remove(ab);
30203805
3021
- ab.GetObject().editWindow = null;
3806
+ //ab.GetObject().editWindow = null;
3807
+ ab.GetObject().manipWindow = null;
30223808 // ab.GetObject().objectUI = null; // ?????????
30233809
30243810 ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick();
30253811 break;
30263812 }
30273813 }
3814
+
3815
+ cameraView.requestFocusInWindow();
30283816 refreshContents(true);
30293817 } else
30303818 if (source == editItem || source == editButton)
30313819 {
3820
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3821
+ {
3822
+ Object3D child = (Object3D)e.nextElement();
3823
+ child.pinned = true;
3824
+ }
3825
+
30323826 EditSelection(false);
30333827 } else
30343828 if (source == uneditButton)
....@@ -3037,9 +3831,10 @@
30373831 {
30383832 Object3D child = (Object3D)e.nextElement();
30393833 if(child.editWindow != null)
3040
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3834
+ child.pinned = false;
30413835 child.CloseUI();
30423836 listUI.remove(child);
3837
+// objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
30433838
30443839 //child.editWindow = null; // ???????????
30453840 }
....@@ -3054,16 +3849,18 @@
30543849 //copy.ClearUI();
30553850 for (Object3D obj : listUI)
30563851 {
3852
+ obj.pinned = false;
30573853 obj.CloseUI();
30583854 }
30593855 listUI.clear();
3856
+ SetPinStates(group.selection.size() > 0);
30603857 refreshContents(true);
30613858 } else
30623859 if (source == allParamsButton)
30633860 {
30643861 assert(copy == group);
30653862
3066
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3863
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
30673864
30683865 for (Object3D obj : listUI)
30693866 {
....@@ -3112,6 +3909,9 @@
31123909 }
31133910
31143911 copy = group;
3912
+
3913
+ SetUndoStates();
3914
+
31153915 //Globals.theRenderer.object = group;
31163916 if(!useclient)
31173917 {
....@@ -3128,7 +3928,9 @@
31283928 sideView.object = group;
31293929 }
31303930
3131
-// fix "+" issue group.editWindow = this;
3931
+// fix "+" issue
3932
+ //group.editWindow = this;
3933
+ group.manipWindow = this;
31323934
31333935 /*
31343936 currentLayout = radio.layout;
....@@ -3136,20 +3938,32 @@
31363938 currentLayout = sevenButton;
31373939 */
31383940 radio.layout.doClick();
3941
+
3942
+ ClearUnpinned();
3943
+
3944
+ //Grafreed.Assert(group != null);
3945
+ //Grafreed.Assert(group.selection != null);
3946
+ SetPinStates(group.selection == null || group.selection.size() > 0);
3947
+ if (group.selection == null || group.selection.size() == 1)
3948
+ EditSelection(false);
31393949 keepparent = group.parent;
31403950 // PARENT = NULL or not???
31413951 //group.parent = null; // ROOT
31423952 //group.attributes = -1;
31433953 ResetModel();
3954
+
3955
+ cameraView.requestFocusInWindow();
31443956 refreshContents(true);
31453957 } else if (event.getSource() == editCameraItem)
31463958 {
31473959 cameraView.ProtectCamera();
3960
+ cameraView.requestFocusInWindow();
31483961 cameraView.repaint();
31493962 return;
3150
- } else if (event.getSource() == revertCameraItem)
3963
+ } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton)
31513964 {
31523965 cameraView.RevertCamera();
3966
+ cameraView.requestFocusInWindow();
31533967 cameraView.repaint();
31543968 return;
31553969 // } else if (event.getSource() == textureButton)
....@@ -3164,7 +3978,6 @@
31643978 }
31653979
31663980 boolean useclient = false;
3167
- cRadio radio;
31683981
31693982 void ToggleRoot()
31703983 {
....@@ -3403,7 +4216,8 @@
34034216
34044217 int size = obj.MemorySize();
34054218
3406
- System.err.println((size/1024) + " KB is the size of " + obj);
4219
+ //System.err.println((size/1024) + " KB is the size of " + obj);
4220
+ System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)");
34074221 }
34084222 }
34094223 catch (Exception e)
....@@ -3484,6 +4298,13 @@
34844298 void GenNormals(boolean crease)
34854299 {
34864300 group.GenNormalsS(crease);
4301
+
4302
+ refreshContents();
4303
+ }
4304
+
4305
+ void GenNormalsMESH()
4306
+ {
4307
+ group.GenNormalsMeshS();
34874308
34884309 refreshContents();
34894310 }
....@@ -3719,7 +4540,7 @@
37194540
37204541 try
37214542 {
3722
- texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
4543
+ texturedata = Globals.theRenderer.GetTextureData(tex, false, node.texres);
37234544 }
37244545 catch (Exception e)
37254546 {
....@@ -4111,6 +4932,18 @@
41114932 refreshContents();
41124933 }
41134934
4935
+ void RewindLeaves(boolean hide)
4936
+ {
4937
+ group.selection.RewindLeaves(hide);
4938
+ refreshContents();
4939
+ }
4940
+
4941
+ void RandomLeaves(boolean hide)
4942
+ {
4943
+ group.selection.RandomLeaves(hide);
4944
+ refreshContents();
4945
+ }
4946
+
41144947 void SetTexRes(int tr)
41154948 {
41164949 group.selection.SetTexRes(tr);
....@@ -4182,28 +5015,25 @@
41825015 // }
41835016 // }
41845017
4185
- static boolean allparams = true;
4186
-
4187
- static Vector<Object3D> listUI = new Vector<Object3D>();
4188
-
41895018 void EditSelection(boolean newWindow)
41905019 {
5020
+ if (group.selection == null)
5021
+ {
5022
+ EditElement(group, newWindow); // ? new
5023
+ return;
5024
+ }
5025
+
41915026 // aConstraints.gridy = 0;
41925027 for (int i=0; i<group.selection.size(); i++)
41935028 {
41945029 //System.out.println("edit : " + objectPanel.indexOfTab("Material"));
41955030 //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false);
4196
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
5031
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
41975032
41985033 Object3D elem = (Object3D)group.selection.elementAt(i);
41995034 if(elem != group || !newWindow)
42005035 {
4201
- // if (!(elem instanceof Composite))
4202
- // newWindow = false;
4203
- listUI.add(elem);
4204
- elem.openEditWindow(this, newWindow); //, false);
4205
- System.out.println("edit : " + elem);
4206
- elem.editWindow.refreshContents(true); // ? new
5036
+ EditElement(elem, newWindow); // ? new
42075037 }
42085038 }
42095039 }
....@@ -4266,9 +5096,7 @@
42665096
42675097 freezemodel = false;
42685098 }
4269
-
4270
- boolean flashIt = true;
4271
-
5099
+
42725100 public void valueChanged(TreeSelectionEvent e)
42735101 //public boolean handleEvent(Event event)
42745102 {
....@@ -4278,7 +5106,8 @@
42785106 //new Exception().printStackTrace();
42795107
42805108 freezemodel = true;
4281
-
5109
+ ClearUnpinned();
5110
+
42825111 /**/
42835112 //switch (event.id)
42845113 {
....@@ -4286,7 +5115,6 @@
42865115 //case 702: // Event.LIST_DESELECT
42875116 group.deselectAll();
42885117 TreePath tps[] = objEditor.jTree.getSelectionPaths();
4289
- objEditor.ClearInfo(); // .GetMaterial());
42905118 if (tps != null)
42915119 {
42925120 for (int i=0; i < tps.length; i++)
....@@ -4295,10 +5123,8 @@
42955123
42965124 //if (child.parent != null)
42975125 //child.parent.addSelectee(child);
5126
+ objEditor.SetMaterial(child);
42985127 group.addSelectee(child);
4299
- objEditor.SetMaterial(child); // .GetMaterial());
4300
- objEditor.AddInfo(child, this, true); // .GetMaterial());
4301
- System.err.println("info : " + child.GetPath());
43025128 }
43035129 }
43045130 // else
....@@ -4308,15 +5134,13 @@
43085134 // System.err.println("info : " + group.GetPath());
43095135 // }
43105136
4311
- objEditor.SetText(); // jan 2014
4312
-
43135137 if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera))
43145138 CameraPane.flash = true;
43155139
43165140 if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
43175141 // a camera
43185142 {
4319
- if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera())
5143
+ if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crash the camera because of invalid lightspace
43205144 {
43215145 CameraPane.camerachangeframe = 0; // don't refuse it
43225146 Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
....@@ -4325,6 +5149,13 @@
43255149 // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
43265150 }
43275151
5152
+ if (tps != null && tps.length == 1)
5153
+ {
5154
+ EditSelection(false);
5155
+ }
5156
+
5157
+ SetPinStates(tps != null && tps.length > 0);
5158
+
43285159 refreshContents();
43295160 //return true;
43305161 }
....@@ -4333,6 +5164,37 @@
43335164
43345165 freezemodel = false;
43355166 }
5167
+
5168
+ void SetPinStates(boolean enabled)
5169
+ {
5170
+ editButton.setEnabled(enabled);
5171
+ uneditButton.setEnabled(enabled);
5172
+ unselectButton.setEnabled(enabled);
5173
+ flashSelectionButton.setEnabled(enabled);
5174
+
5175
+ clearPanelButton.setEnabled(!listUI.isEmpty());
5176
+ }
5177
+
5178
+ void refreshContents(boolean cp)
5179
+ {
5180
+ if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info"))
5181
+ if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING)
5182
+ {
5183
+ objEditor.ClearInfo(); // .GetMaterial());
5184
+
5185
+ for (int i=0; i < group.selection.Size(); i++)
5186
+ {
5187
+ Object3D child = (Object3D) group.selection.get(i);
5188
+
5189
+ objEditor.AddInfo(child, this, true);
5190
+ System.err.println("info : " + child.GetPath());
5191
+ }
5192
+
5193
+ objEditor.SetText(); // jan 2014
5194
+ }
5195
+
5196
+ super.refreshContents(cp);
5197
+ }
43365198
43375199 void linkSomething(Object3D thing)
43385200 {
....@@ -4404,6 +5266,7 @@
44045266 {
44055267 if (group.selection.isEmpty())
44065268 return;
5269
+
44075270 Grafreed.clipboardIsTempGroup = false;
44085271 Composite tGroup = null;
44095272 if (group.selection.size() > 0) // 1)
....@@ -4414,6 +5277,8 @@
44145277
44155278 if (cut)
44165279 {
5280
+// if (Globals.SAVEONMAKE) // Moved to the clipboard, no need to save.
5281
+// Save();
44175282 //int indices[] = jList.getSelectedIndices();
44185283 //for (int i = indices.length - 1; i >= 0; i--)
44195284 //jList.remove(indices[i]);
....@@ -4503,8 +5368,10 @@
45035368 }
45045369
45055370 }
5371
+
45065372 if (Grafreed.clipboardIsTempGroup)
45075373 Grafreed.clipboard = tGroup;
5374
+
45085375 if (cut)
45095376 {
45105377 ResetModel();
....@@ -4514,6 +5381,10 @@
45145381
45155382 void paste(boolean expand)
45165383 {
5384
+ if (Globals.REPLACEONMAKE)
5385
+ Save();
5386
+ boolean keep = Globals.REPLACEONMAKE;
5387
+ Globals.REPLACEONMAKE = false;
45175388 // if (GrafreeD.clipboard == null)
45185389 // return;
45195390 boolean first = true;
....@@ -4573,6 +5444,7 @@
45735444 Grafreed.clipboard.get(0).parent = keepparent;
45745445 }
45755446
5447
+ Globals.REPLACEONMAKE = keep;
45765448 ResetModel();
45775449 refreshContents();
45785450 }
....@@ -4708,6 +5580,10 @@
47085580
47095581 void group(Object3D csg, boolean grab)
47105582 {
5583
+ if (Globals.REPLACEONMAKE)
5584
+ Save();
5585
+ boolean keep = Globals.REPLACEONMAKE;
5586
+ Globals.REPLACEONMAKE = false;
47115587 if (//false) // why??
47125588 !group.selection.isEmpty())
47135589 {
....@@ -4821,10 +5697,15 @@
48215697 //node.add(csg);
48225698 //makeSomething(node);
48235699 makeSomething(csg);
5700
+ Globals.REPLACEONMAKE = keep;
48245701 }
48255702
48265703 void Ungroup(Object3D g)
48275704 {
5705
+ if (Globals.REPLACEONMAKE)
5706
+ Save();
5707
+ boolean keep = Globals.REPLACEONMAKE;
5708
+ Globals.REPLACEONMAKE = false;
48285709 if (g instanceof HiddenObject)
48295710 {
48305711 HiddenObject h = (HiddenObject) g;
....@@ -4841,6 +5722,7 @@
48415722 objEditor.makeSomething(g.get(i), false);
48425723 }
48435724 }
5725
+ Globals.REPLACEONMAKE = keep;
48445726 }
48455727
48465728 void ungroup()
....@@ -5129,7 +6011,43 @@
51296011 cButton clearpanelButton;
51306012 cButton unselectButton;
51316013
6014
+ cButton restoreCameraButton;
6015
+
51326016 cButton oneStepButton;
6017
+
6018
+ cButton groupButton;
6019
+ cButton ungroupButton;
6020
+ cButton compositeButton;
6021
+ cButton switchButton;
6022
+ cButton loopButton;
6023
+ cButton textureButton;
6024
+
6025
+ cButton skybox1Button;
6026
+ cButton skybox2Button;
6027
+ cButton skybox3Button;
6028
+ cButton skybox4Button;
6029
+ cButton skybox5Button;
6030
+ cButton skybox6Button;
6031
+ cButton skybox7Button;
6032
+
6033
+ cButton skybox11Button;
6034
+ cButton skybox12Button;
6035
+ cButton skybox13Button;
6036
+ cButton skybox14Button;
6037
+ cButton skybox15Button;
6038
+ cButton skybox16Button;
6039
+ cButton skybox17Button;
6040
+
6041
+ cButton gridButton;
6042
+ cButton boxButton;
6043
+ cButton sphereButton;
6044
+ cButton coneButton;
6045
+ cButton torusButton;
6046
+ cButton superButton;
6047
+ cButton kleinButton;
6048
+ cButton particlesButton;
6049
+ cButton overlayButton;
6050
+ cButton lightButton;
51336051
51346052 cButton screenfitButton;
51356053 cButton screenfitpointButton;
....@@ -5142,14 +6060,6 @@
51426060
51436061 cButton setsupportButton;
51446062
5145
- cButton twoButton;
5146
- cButton sixButton;
5147
- cButton threeButton;
5148
- cButton sevenButton;
5149
- cButton fourButton; // full panel
5150
- cButton oneButton; // full XYZ
5151
- //cButton currentLayout;
5152
-
51536063 //
51546064 //Composite
51556065 Object3D // to do !!
....@@ -5159,11 +6069,11 @@
51596069 //JTree jTree;
51606070 private MenuItem lookAtItem;
51616071 private MenuItem lookFromItem;
5162
- private MenuItem switchItem;
6072
+ private MenuItem switchViewItem;
51636073 private MenuItem cutItem;
51646074 private MenuItem undoItem;
51656075 private MenuItem redoItem;
5166
- private MenuItem duplicateItem;
6076
+ private JMenuItem duplicateItem;
51676077 private MenuItem cloneItem;
51686078 private MenuItem cloneSupportItem;
51696079 private MenuItem overwriteGeoItem;
....@@ -5191,7 +6101,7 @@
51916101 private MenuItem pasteLinkItem;
51926102 private MenuItem pasteCloneItem;
51936103 private MenuItem pasteExpandItem;
5194
- private MenuItem clearItem;
6104
+ private MenuItem deleteItem;
51956105 private MenuItem clearAllItem;
51966106 private MenuItem genUVItem;
51976107 private MenuItem genNormalsMESHItem;
....@@ -5226,6 +6136,10 @@
52266136 private MenuItem showleavesItem;
52276137 private MenuItem markleavesItem;
52286138 private MenuItem unmarkleavesItem;
6139
+ private MenuItem rewindleavesItem;
6140
+ private MenuItem unrewindleavesItem;
6141
+ private MenuItem randomleavesItem;
6142
+ private MenuItem unrandomleavesItem;
52296143
52306144 private MenuItem flipVItem;
52316145 private MenuItem unflipVItem;
....@@ -5247,7 +6161,7 @@
52476161 private MenuItem frontItem;
52486162 private MenuItem cameraItem;
52496163 private MenuItem compositeItem;
5250
- private MenuItem randomItem;
6164
+ private MenuItem switchItem;
52516165 private MenuItem physicsItem;
52526166 private MenuItem frameselectorItem;
52536167 private MenuItem scriptNodeItem;
....@@ -5271,6 +6185,8 @@
52716185 private MenuItem attachBumpItem;
52726186 private MenuItem detachBumpItem;
52736187 private MenuItem pigmentBumpItem;
6188
+ private MenuItem embedTexturesItem;
6189
+ private MenuItem deEmbedTexturesItem;
52746190
52756191 private MenuItem particleItem;
52766192 private MenuItem ragdollItem;
....@@ -5321,5 +6237,5 @@
53216237
53226238 Menu cameraMenu;
53236239 MenuItem editCameraItem;
5324
- MenuItem revertCameraItem;
6240
+ MenuItem restoreCameraItem;
53256241 }