Normand Briere
2019-08-01 29d5516687020263d3ae0454ce81879a3a450af0
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.versions == null)
360
+ {
361
+ copy.versions = new byte[100][];
362
+ copy.versionindex = -1;
363
+ }
364
+
63365 if(ui)
64366 SetupUI(objEditor);
65367 }
....@@ -74,16 +376,28 @@
74376 this.copy = this.group = copy;
75377 //selectees = this.group.selectees;
76378
77
- SetupMenu2(objEditor);
379
+ SetupMenu2(this); //objEditor);
78380 SetupUI2(objEditor);
79381 objEditor.SetupUI(true);
80382 SetupViews(objEditor);
81383
82384 ((cRadio)radioPanel.getComponent(0)).SetCamera(cameraView.renderCamera, true);
385
+
386
+ if (copy.versions == null)
387
+ {
388
+ copy.versions = new byte[100][];
389
+ copy.versionindex = -1;
390
+
391
+ Save(true);
392
+ }
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,18 +408,19 @@
94408
95409 makeSomething(clone, i==group.selection.size()-1);
96410 }
411
+ Globals.REPLACEONMAKE = keep;
97412 }
98413
99414 void CloneClipboard(boolean supports)
100415 {
101
- assert(GrafreeD.clipboard.parent == null);
102
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
103
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
104
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
105
- makeSomething(CloneObject(GrafreeD.clipboard.get(0), false));
416
+ assert(Grafreed.clipboard.parent == null);
417
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
418
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
419
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
420
+ makeSomething(CloneObject(Grafreed.clipboard.get(0), false));
106421 else
107
- makeSomething(CloneObject(GrafreeD.clipboard, false));
108
- GrafreeD.clipboard.get(0).parent = keepparent;
422
+ makeSomething(CloneObject(Grafreed.clipboard, false));
423
+ Grafreed.clipboard.get(0).parent = keepparent;
109424 }
110425
111426 static Object3D CloneObject(Object3D obj, boolean supports)
....@@ -119,7 +434,7 @@
119434 // obj.support = null;
120435 if (!supports)
121436 obj.SaveSupports();
122
- Object3D clone = (Object3D)GrafreeD.clone(obj);
437
+ Object3D clone = (Object3D)Grafreed.clone(obj);
123438 obj.parent = parent;
124439 // obj.support = support;
125440 // clone.support = support; // aout 2013
....@@ -148,40 +463,37 @@
148463
149464 //JTextField nameField;
150465
151
- void SetupMenu2(ObjEditor oe)
466
+ void SetupMenu2(GroupEditor oe)
152467 {
153
- if (Globals.ADVANCED)
154
- {
155
- oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
156
- //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
157
- //cameraMenu.add(switchItem = new MenuItem("Reverse View"));
158
- editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf"));
159
- oe.cameraMenu.add("-");
160
- openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy..."));
161
- openWindowItem.addActionListener(this);
162
- editLeafItem.addActionListener(this);
163
- lookAtItem.addActionListener(this);
164
- //lookFromItem.addActinoListener(this);
165
- //switchItem.addActionListener(this);
166
- }
167
-
468
+ oe.jTree = new cTree();
469
+
168470 Menu menu;
169471 oe.menuBar.add(menu = new Menu("Edit"));
170472 //editItem = menu.add(new MenuItem("Edit"));
171473 //editItem.addActionListener(this);
172
- 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"));
173481 duplicateItem.addActionListener(this);
482
+ cloneItem = menu.add(new MenuItem("Clone"));
483
+ cloneItem.addActionListener(this);
484
+ if (Globals.ADVANCED)
485
+ {
486
+ cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
487
+ cloneSupportItem.addActionListener(this);
488
+ }
489
+ menu.add("-");
174490 cutItem = menu.add(new MenuItem("Cut"));
175491 cutItem.addActionListener(this);
176492 copyItem = menu.add(new MenuItem("Copy"));
177493 copyItem.addActionListener(this);
178494 pasteItem = menu.add(new MenuItem("Paste"));
179495 pasteItem.addActionListener(this);
180
- menu.add("-");
181
- cloneItem = menu.add(new MenuItem("Clone"));
182
- cloneItem.addActionListener(this);
183
- cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
184
- cloneSupportItem.addActionListener(this);
496
+
185497 menu.add("-");
186498 pasteIntoItem = menu.add(new MenuItem("Paste into"));
187499 pasteIntoItem.addActionListener(this);
....@@ -192,8 +504,8 @@
192504 // pasteExpandItem = menu.add(new MenuItem("Paste expand"));
193505 // pasteExpandItem.addActionListener(this);
194506 menu.add("-");
195
- clearItem = menu.add(new MenuItem("Clear"));
196
- clearItem.addActionListener(this);
507
+ deleteItem = menu.add(new MenuItem("Delete"));
508
+ deleteItem.addActionListener(this);
197509
198510 if (Globals.ADVANCED)
199511 {
....@@ -201,14 +513,97 @@
201513 clearAllItem = menu.add(new MenuItem("Clear All"));
202514 clearAllItem.addActionListener(this);
203515 }
516
+
517
+ menuBar.add(cameraMenu = new Menu("View"));
518
+ //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer"));
519
+ //zBufferItem.addActionListener(this);
520
+ //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens"));
521
+ //normalLensItem.addActionListener(this);
522
+ cameraMenu.add(restoreCameraItem = new MenuItem("Restore Viewpoint"));
523
+ restoreCameraItem.addActionListener(this);
524
+
525
+// cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen"));
526
+// toggleFullScreenItem.addItemListener(this);
527
+// toggleFullScreenItem.setState(CameraPane.FULLSCREEN);
528
+// cameraMenu.add("-");
529
+//
530
+// cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture"));
531
+// toggleTextureItem.addItemListener(this);
532
+// toggleTextureItem.setState(CameraPane.textureon);
533
+//
534
+// cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch"));
535
+// toggleSwitchItem.addItemListener(this);
536
+// toggleSwitchItem.setState(CameraPane.SWITCH);
537
+
538
+ cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Show Handles"));
539
+ toggleHandleItem.addItemListener(this);
540
+ toggleHandleItem.setState(CameraPane.HANDLES);
541
+
542
+ cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode"));
543
+ togglePaintItem.addItemListener(this);
544
+ togglePaintItem.setState(CameraPane.PAINTMODE);
545
+
546
+ if (Globals.ADVANCED)
547
+ {
548
+ cameraMenu.add("-");
549
+ cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live"));
550
+ toggleLiveItem.addItemListener(this);
551
+ toggleLiveItem.setState(Globals.isLIVE());
204552
553
+ cameraMenu.add(stepItem = new MenuItem("Step"));
554
+ stepItem.addActionListener(this);
555
+ // cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List"));
556
+ // toggleDLItem.addItemListener(this);
557
+ // toggleDLItem.setState(false);
558
+
559
+ cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render"));
560
+ toggleRenderItem.addItemListener(this);
561
+ toggleRenderItem.setState(!CameraPane.frozen);
562
+
563
+ cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug"));
564
+ toggleDebugItem.addItemListener(this);
565
+ toggleDebugItem.setState(Globals.DEBUG);
566
+
567
+ cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum"));
568
+ toggleFrustumItem.addItemListener(this);
569
+ toggleFrustumItem.setState(CameraPane.FRUSTUM);
570
+
571
+ cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact"));
572
+ toggleFootContactItem.addItemListener(this);
573
+ toggleFootContactItem.setState(CameraPane.FOOTCONTACT);
574
+
575
+ cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline"));
576
+ toggleTimelineItem.addItemListener(this);
577
+ }
578
+
579
+// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root"));
580
+// toggleRootItem.addItemListener(this);
581
+// toggleRootItem.setState(false);
582
+// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation"));
583
+// animationItem.addItemListener(this);
584
+// animationItem.setState(CameraPane.ANIMATION);
585
+ cameraMenu.add("-");
586
+ cameraMenu.add(editCameraItem = new MenuItem("Save Viewpoint"));
587
+ editCameraItem.addActionListener(this);
588
+
589
+ if (Globals.ADVANCED)
590
+ {
591
+ oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
592
+ //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
593
+ //cameraMenu.add(switchViewItem = new MenuItem("Reverse View"));
594
+ editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf"));
595
+ oe.cameraMenu.add("-");
596
+ openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy..."));
597
+ openWindowItem.addActionListener(this);
598
+ editLeafItem.addActionListener(this);
599
+ lookAtItem.addActionListener(this);
600
+ //lookFromItem.addActinoListener(this);
601
+ //switchViewItem.addActionListener(this);
602
+ }
603
+
205604 oe.menuBar.add(menu = new Menu("Setting"));
206605 if (Globals.ADVANCED)
207606 {
208
- resetMeshItem = menu.add(new MenuItem("Reset All"));
209
- resetMeshItem.addActionListener(this);
210
- stepAllItem = menu.add(new MenuItem("Step All"));
211
- stepAllItem.addActionListener(this);
212607 revertMeshItem = menu.add(new MenuItem("Revert Meshes"));
213608 revertMeshItem.addActionListener(this);
214609 resetreferencesItem = menu.add(new MenuItem("Reset Mesh References"));
....@@ -248,21 +643,29 @@
248643 }
249644
250645 oe.menuBar.add(menu = new Menu("Group"));
251
- grabItem = menu.add(new MenuItem("Grab"));
252
- grabItem.addActionListener(this);
646
+// grabItem = menu.add(new MenuItem("Grab"));
647
+// grabItem.addActionListener(this);
253648 backItem = menu.add(new MenuItem("Back"));
254649 backItem.addActionListener(this);
255650 frontItem = menu.add(new MenuItem("Front"));
256651 frontItem.addActionListener(this);
257
- compositeItem = menu.add(new MenuItem("Composite"));
258
- compositeItem.addActionListener(this);
652
+// compositeItem = menu.add(new MenuItem("Composite"));
653
+// compositeItem.addActionListener(this);
654
+
655
+ if (Globals.ADVANCED)
656
+ {
259657 hideItem = menu.add(new MenuItem("Hidden Group"));
260658 hideItem.addActionListener(this);
659
+ }
261660 ungroupItem = menu.add(new MenuItem("Ungroup"));
262661 ungroupItem.addActionListener(this);
263
- menu.add("-");
264
- randomItem = menu.add(new MenuItem("Switch node"));
265
- 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
+ {
266669 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
267670 switchGeoItem.addActionListener(this);
268671 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
....@@ -270,49 +673,52 @@
270673 morphItem = menu.add(new MenuItem("Morph Group"));
271674 morphItem.addActionListener(this);
272675
273
- if (Globals.ADVANCED)
274
- {
676
+ menu.add("-");
275677 physicsItem = menu.add(new MenuItem("Physics"));
276678 physicsItem.addActionListener(this);
277679 frameselectorItem = menu.add(new MenuItem("Frame Selector"));
278680 frameselectorItem.addActionListener(this);
279681 scriptNodeItem = menu.add(new MenuItem("Script Node"));
280682 scriptNodeItem.addActionListener(this);
281
- cameraItem = menu.add(new MenuItem("Camera"));
282
- cameraItem.addActionListener(this);
283683 }
284684
285685 oe.menuBar.add(menu = new Menu("Object"));
286
- textureItem = menu.add(new MenuItem("Texture"));
287
- textureItem.addActionListener(this);
686
+// textureItem = menu.add(new MenuItem("Texture"));
687
+// textureItem.addActionListener(this);
288688 billboardItem = menu.add(new MenuItem("Billboard"));
289689 billboardItem.addActionListener(this);
290690 csgItem = menu.add(new MenuItem("CSG"));
291691 csgItem.addActionListener(this);
292
- shadowXItem = menu.add(new MenuItem("Shadow X"));
692
+ shadowXItem = menu.add(new MenuItem("Shadow Red"));
293693 shadowXItem.addActionListener(this);
294
- shadowYItem = menu.add(new MenuItem("Shadow Y"));
694
+ shadowYItem = menu.add(new MenuItem("Shadow Green"));
295695 shadowYItem.addActionListener(this);
296
- shadowZItem = menu.add(new MenuItem("Shadow Z"));
696
+ shadowZItem = menu.add(new MenuItem("Shadow Blue"));
297697 shadowZItem.addActionListener(this);
298
- if (Globals.ADVANCED)
299
- {
300
- linkerItem = menu.add(new MenuItem("Linker"));
301
- linkerItem.addActionListener(this);
302698 attributeItem = menu.add(new MenuItem("Attribute"));
303699 attributeItem.addActionListener(this);
700
+
701
+ if (Globals.ADVANCED)
702
+ {
703
+ menu.add("-");
704
+ linkerItem = menu.add(new MenuItem("Linker"));
705
+ linkerItem.addActionListener(this);
304706 templateItem = menu.add(new MenuItem("Template"));
305707 templateItem.addActionListener(this);
306708 pointflowItem = menu.add(new MenuItem("Point Flow"));
307709 pointflowItem.addActionListener(this);
308
- menu.add("-");
309710 }
711
+ menu.add("-");
310712 resetTransformItem = menu.add(new MenuItem("Reset Transform"));
311713 resetTransformItem.addActionListener(this);
312714 resetCentroidItem = menu.add(new MenuItem("Reset Centroid"));
313715 resetCentroidItem.addActionListener(this);
314
- transformgeometryItem = menu.add(new MenuItem("Transform Geometry"));
315
- transformgeometryItem.addActionListener(this);
716
+ resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY"));
717
+ resetCentroidXZItem.addActionListener(this);
718
+ transformGeometryItem = menu.add(new MenuItem("Transform Geometry"));
719
+ transformGeometryItem.addActionListener(this);
720
+ transformChildrenItem = menu.add(new MenuItem("Transform Children"));
721
+ transformChildrenItem.addActionListener(this);
316722
317723 oe.menuBar.add(menu = new Menu("Geometry"));
318724 genUVItem = menu.add(new MenuItem("Generate UV"));
....@@ -325,7 +731,7 @@
325731 genNormalsMESHItem.addActionListener(this);
326732 if (Globals.ADVANCED)
327733 {
328
- genNormalsMINEItem = menu.add(new MenuItem("My Normals"));
734
+ genNormalsMINEItem = menu.add(new MenuItem("Stitch Normals"));
329735 genNormalsMINEItem.addActionListener(this);
330736 }
331737 stripifyItem = menu.add(new MenuItem("Stripify"));
....@@ -361,6 +767,10 @@
361767 oe.menuBar.add(menu = new Menu("Attributes"));
362768 clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
363769 clearMaterialsItem.addActionListener(this);
770
+ resetAllItem = menu.add(new MenuItem("Reset All"));
771
+ resetAllItem.addActionListener(this);
772
+ stepAllItem = menu.add(new MenuItem("Step All"));
773
+ stepAllItem.addActionListener(this);
364774 menu.add("-");
365775 liveleavesItem = menu.add(new MenuItem("Live Leaves"));
366776 liveleavesItem.addActionListener(this);
....@@ -381,6 +791,14 @@
381791 markleavesItem.addActionListener(this);
382792 unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves"));
383793 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);
384802 menu.add("-");
385803 flipVItem = menu.add(new MenuItem("Flip V"));
386804 flipVItem.addActionListener(this);
....@@ -406,47 +824,56 @@
406824 attachBumpItem.addActionListener(this);
407825 pigmentBumpItem = menu.add(new MenuItem("Pigment -> Bump"));
408826 pigmentBumpItem.addActionListener(this);
827
+ //embedTexturesItem
409828 detachPigmentItem = menu.add(new MenuItem("Detach Pigment"));
410829 detachPigmentItem.addActionListener(this);
411830 detachBumpItem = menu.add(new MenuItem("Detach Bump"));
412831 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);
413836 menu.add("-");
414837 sortbysizeItem = menu.add(new MenuItem("Sort by size"));
415838 sortbysizeItem.addActionListener(this);
416839 sortbynameItem = menu.add(new MenuItem("Sort by name"));
417840 sortbynameItem.addActionListener(this);
841
+ menu.add("-");
842
+ shareGeometriesItem = menu.add(new MenuItem("Share Geometries"));
843
+ shareGeometriesItem.addActionListener(this);
844
+ mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries"));
845
+ mergeGeometriesItem.addActionListener(this);
418846 if (Globals.ADVANCED)
419847 {
420
- menu.add("-");
848
+ // Pretty much the same as duplicate and clone.
421849 extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
422850 extractGeometriesItem.addActionListener(this);
423851 cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry"));
424852 cloneGeometriesItem.addActionListener(this);
425
- shareGeometriesItem = menu.add(new MenuItem("Share Geometry"));
426
- shareGeometriesItem.addActionListener(this);
427
- mergeGeometriesItem = menu.add(new MenuItem("Merge Geometry"));
428
- mergeGeometriesItem.addActionListener(this);
429853 }
430854
431855 oe.menuBar.add(menu = new Menu("Insert"));
432856 buildCreateMenu(menu);
433857
434
- oe.menuBar.add(menu = new Menu("Include"));
435
- importGFDItem = menu.add(new MenuItem("GrafreeD Object..."));
436
- importGFDItem.addActionListener(this);
437
- importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D Object..."));
438
- importVRMLX3DItem.addActionListener(this);
439
- importOBJItem = menu.add(new MenuItem("OBJ Object..."));
440
- importOBJItem.addActionListener(this);
441
- import3DSItem = menu.add(new MenuItem("3DS Object..."));
442
- import3DSItem.addActionListener(this);
443
-
444858 oe.menuBar.add(menu = new Menu("Tools"));
445859 buildToolsMenu(menu);
446860 }
447861
862
+
448863 void SetupUI2(ObjEditor oe)
449864 {
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
+
450877 //new Exception().printStackTrace();
451878
452879 oe.radioPanel = new JPanel(new GridBagLayout());
....@@ -475,97 +902,238 @@
475902 oe.radioPanel.add(dummyButton);
476903 oe.buttonGroup.add(dummyButton);
477904 */
905
+ cGridBag copyOptionsPanel = new cGridBag();
906
+
907
+ copyOptionsPanel.preferredHeight = 2;
908
+
478909 //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
479910
480
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints);
481
- liveCB.setToolTipText("Enabled animation");
911
+ //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
912
+ //minButton.setToolTipText("Minimize window");
913
+ //minButton.addActionListener(this);
914
+
915
+ if (Globals.ADVANCED)
916
+ {
917
+ oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
918
+ maxButton.setToolTipText("Maximize window");
919
+ maxButton.addActionListener(this);
920
+ }
921
+
922
+ oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
923
+ fullButton.setToolTipText("Full-screen window");
924
+ fullButton.addActionListener(this);
925
+
926
+ oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
927
+ screenfitButton.setToolTipText("Screen fit");
928
+ screenfitButton.addActionListener(this);
929
+
930
+ oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
931
+ restoreCameraButton.setToolTipText("Restore viewpoint");
932
+ restoreCameraButton.addActionListener(this);
933
+
934
+ copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
935
+ saveButton.setToolTipText("New version");
936
+ saveButton.addActionListener(this);
937
+
938
+ copyOptionsPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
939
+ undoButton.setToolTipText("Previous version");
940
+ undoButton.addActionListener(this);
941
+ undoButton.setEnabled(false);
942
+
943
+ cGridBag updown = new cGridBag().setVertical(true);
944
+ updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
945
+ restoreButton.setToolTipText("Restore current");
946
+ restoreButton.addActionListener(this);
947
+ restoreButton.setEnabled(false);
948
+
949
+ updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
950
+ replaceButton.setToolTipText("Replace current");
951
+ replaceButton.addActionListener(this);
952
+ replaceButton.setEnabled(false);
953
+
954
+ copyOptionsPanel.add(updown);
955
+
956
+ copyOptionsPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
957
+ redoButton.setToolTipText("Next version");
958
+ redoButton.addActionListener(this);
959
+ redoButton.setEnabled(false);
960
+
961
+ oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints);
962
+ liveCB.setToolTipText("Enable animation");
482963 liveCB.addItemListener(this);
483964
484
- oe.toolbarPanel.add(oneStepButton = new cButton("Step", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
965
+ oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
485966 oneStepButton.setToolTipText("Animate one step forward");
486967 oneStepButton.addActionListener(this);
487968
488
- oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints);
969
+ oe.toolbarPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints);
489970 fastCB.setToolTipText("Fast mode");
490971 fastCB.addItemListener(this);
491972
492
- oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
493
- trackCB.setToolTipText("Enable tracking");
494
- trackCB.addItemListener(this);
495
-
496
- oe.toolbarPanel.add(screenfitButton = new cButton("@", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
497
- screenfitButton.setToolTipText("Screen fit");
498
- screenfitButton.addActionListener(this);
973
+ //oe.toolboxPanel.Return();
974
+
975
+// copyOptionsPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints);
976
+// trackCB.setToolTipText("Enable tracking");
977
+// trackCB.addItemListener(this);
499978
500979 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
501980 // screenfitpointButton.addActionListener(this);
502981
503982 if (Globals.ADVANCED)
504983 {
505
- oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
984
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
506985 snapobjectButton.addActionListener(this);
507986 snapobjectButton.setToolTipText("Snap Object");
987
+
988
+ oe.toolbarPanel.add(fourButton = GetButton("icons/controls-horizontal.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
989
+ fourButton.addActionListener(this);
990
+ fourButton.setToolTipText("Show control panel only");
508991 }
509992
510
- oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
511
- flashSelectionButton.setToolTipText("Show selection");
512
- flashSelectionButton.addActionListener(this);
993
+ //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
513994
514
- oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
515
-
516
- oe.toolbarPanel.add(twoButton = new cButton("|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
517
- twoButton.setToolTipText("Show center view only");
995
+ oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
996
+ twoButton.setToolTipText("Show 3D view only");
518997 twoButton.addActionListener(this);
519
- oe.toolbarPanel.add(fourButton = new cButton("+||", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
520
- fourButton.addActionListener(this);
521
- fourButton.setToolTipText("Show left panel only");
522
- oe.toolbarPanel.add(sixButton = new cButton("+|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
523
- sixButton.setToolTipText("2-column layout left");
524
- sixButton.addActionListener(this);
525
- oe.toolbarPanel.add(threeButton = new cButton("|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
526
- threeButton.setToolTipText("2-column layout right");
998
+ this.fullscreenLayout = twoButton;
999
+
1000
+ oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1001
+ threeButton.setToolTipText("Show controls and 3D view");
5271002 threeButton.addActionListener(this);
528
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
529
- sevenButton.setToolTipText("3-column layout");
530
- sevenButton.addActionListener(this);
1003
+ oe.toolbarPanel.add(sixButton = GetButton("icons/viewcontrols.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1004
+ sixButton.setToolTipText("Show 3D view and controls");
1005
+ sixButton.addActionListener(this);
1006
+// oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1007
+// sevenButton.setToolTipText("3-column layout");
1008
+// sevenButton.addActionListener(this);
5311009 //
5321010
533
- oe.toolbarPanel.add(rootButton = new cButton("o o o", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
534
- rootButton.setToolTipText("Edit selection in new tab");
1011
+ oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1012
+ rootButton.setToolTipText("Open selection in new tab");
5351013 rootButton.addActionListener(this);
5361014
537
- oe.toolbarPanel.add(closeButton = new cButton("X", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
1015
+ oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
5381016 closeButton.setToolTipText("Close tab");
5391017 closeButton.addActionListener(this);
5401018 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
5411019 //clearButton.addActionListener(this);
542
-
543
- cGridBag commandsPanel = new cGridBag();
1020
+
1021
+ cGridBag row1 = new cGridBag();
5441022
545
- commandsPanel.add(editButton = new cButton("+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
546
- editButton.setToolTipText("Edit selection");
1023
+ // INSERT
1024
+ row1.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1025
+ gridButton.setToolTipText("Create grid");
1026
+ gridButton.addActionListener(this);
1027
+
1028
+ row1.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1029
+ boxButton.setToolTipText("Create box");
1030
+ boxButton.addActionListener(this);
1031
+
1032
+ row1.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1033
+ sphereButton.setToolTipText("Create sphere");
1034
+ sphereButton.addActionListener(this);
1035
+
1036
+ row1.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1037
+ coneButton.setToolTipText("Create cone");
1038
+ coneButton.addActionListener(this);
1039
+
1040
+ row1.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1041
+ torusButton.setToolTipText("Create torus");
1042
+ torusButton.addActionListener(this);
1043
+
1044
+ row1.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1045
+ superButton.setToolTipText("Create superellipsoid");
1046
+ superButton.addActionListener(this);
1047
+
1048
+ if (Globals.ADVANCED)
1049
+ {
1050
+ oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1051
+ kleinButton.setToolTipText("Create Klein bottle");
1052
+ kleinButton.addActionListener(this);
1053
+ }
1054
+
1055
+ row1.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1056
+ particlesButton.setToolTipText("Create particle system");
1057
+ particlesButton.addActionListener(this);
1058
+
1059
+ oe.toolboxPanel.add(row1);
1060
+
1061
+ cGridBag row2 = new cGridBag();
1062
+
1063
+ row2.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1064
+ groupButton.setToolTipText("Create group");
1065
+ groupButton.addActionListener(this);
1066
+
1067
+ row2.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1068
+ compositeButton.setToolTipText("Create composite");
1069
+ compositeButton.addActionListener(this);
1070
+
1071
+ row2.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1072
+ switchButton.setToolTipText("Create item switcher");
1073
+ switchButton.addActionListener(this);
1074
+
1075
+ row2.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1076
+ loopButton.setToolTipText("Create loop");
1077
+ loopButton.addActionListener(this);
1078
+
1079
+ row2.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1080
+ textureButton.setToolTipText("Create texture");
1081
+ textureButton.addActionListener(this);
1082
+
1083
+ row2.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1084
+ overlayButton.setToolTipText("Create overlay");
1085
+ overlayButton.addActionListener(this);
1086
+
1087
+ row2.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1088
+ lightButton.setToolTipText("Create light");
1089
+ lightButton.addActionListener(this);
1090
+
1091
+ oe.toolboxPanel.add(row2);
1092
+
1093
+ // ENVYMAPS
1094
+ cGridBag skyboxpane = new cGridBag();
1095
+ skyboxpane.preferredHeight = 100;
1096
+
1097
+ oe.toolboxPanel.add(skyboxpane);
1098
+
1099
+ JTabbedPane skyboxpanel = new JTabbedPane();
1100
+ skyboxpane.add(skyboxpanel);
1101
+
1102
+ AddSkyboxTab0(skyboxpanel);
1103
+ AddSkyboxTab1(skyboxpanel);
1104
+ AddSkyboxTab2(skyboxpanel);
1105
+ AddSkyboxTab3(skyboxpanel);
1106
+
1107
+ // EDIT panel
1108
+ editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1109
+ editButton.setToolTipText("Pin selection controls");
5471110 editButton.addActionListener(this);
5481111
549
- commandsPanel.add(uneditButton = new cButton("-", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
550
- uneditButton.setToolTipText("Unedit selection");
1112
+ editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1113
+ uneditButton.setToolTipText("Remove selection controls");
5511114 uneditButton.addActionListener(this);
5521115
553
- commandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
554
- allParamsButton.setToolTipText("Edit all params");
1116
+ editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
1117
+ allParamsButton.setToolTipText("Show all controle");
5551118 allParamsButton.addActionListener(this);
5561119
557
- commandsPanel.add(clearPanelButton = new cButton("C", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
1120
+ editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
5581121 clearPanelButton.setToolTipText("Clear edit panel");
5591122 clearPanelButton.addActionListener(this);
5601123
561
- commandsPanel.add(unselectButton = new cButton("U", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
1124
+ editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
5621125 unselectButton.setToolTipText("Unselect");
5631126 unselectButton.addActionListener(this);
5641127
565
- commandsPanel.preferredHeight = 1;
1128
+ editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1129
+ flashSelectionButton.setToolTipText("Highlight selection");
1130
+ flashSelectionButton.addActionListener(this);
5661131
567
- oe.treePanel.add(commandsPanel);
568
- oe.treePanel.Return();
1132
+ editCommandsPanel.preferredHeight = 1;
1133
+
1134
+ SetPinStates(false);
1135
+// oe.treePanel.add(commandsPanel);
1136
+// oe.treePanel.Return();
5691137
5701138 // oe.aConstraints.gridx += 1;
5711139 // oe.aConstraints.weighty = 0;
....@@ -582,32 +1150,20 @@
5821150
5831151 JScrollPane jSP;
5841152 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
585
- jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints);
1153
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints);
5861154 ResetModel();
5871155
5881156 oe.treePanel.add(jSPPanel);
5891157 oe.treePanel.Return();
5901158
591
- cGridBag copyOptionsPanel = new cGridBag();
592
-
593
- copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
594
- colorCB.setToolTipText("Copy color when dropped");
595
- colorCB.addItemListener(this);
596
-
597
- copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
598
- materialCB.setToolTipText("Copy material when dropped");
599
- materialCB.addItemListener(this);
600
-
601
- copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
602
- textureCB.setToolTipText("Copy texture when dropped");
603
- textureCB.addItemListener(this);
604
-
605
- copyOptionsPanel.preferredHeight = 1;
6061159 oe.treePanel.add(copyOptionsPanel);
6071160 oe.treePanel.Return();
1161
+ cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0);
1162
+ versionSlider = (cNumberSlider)sliderPane.getComponent(1);
1163
+ sliderPane.preferredHeight = 1;
6081164
609
-// mainPanel.setDividerLocation(0.5); //1.0);
610
-// mainPanel.setResizeWeight(0.5);
1165
+// mainPanel.setDividerLocation(0.1); //1.0);
1166
+ mainPanel.setResizeWeight(0.4);
6111167
6121168 //jList.addListSelectionListener(this);
6131169 oe.jTree.addTreeSelectionListener(this);
....@@ -615,7 +1171,7 @@
6151171 //jTree.setEditable(true);
6161172 oe.jTree.setDragEnabled(true);
6171173 //jTree.setPreferredSize(new Dimension(10,10));
618
- jSP.setPreferredSize(new Dimension(100,200));
1174
+ //jSP.setPreferredSize(new Dimension(100,200));
6191175
6201176 oe.jTree.setCellRenderer(new cTreeModel.Renderer());
6211177
....@@ -627,29 +1183,49 @@
6271183 dgr.addDragGestureListener(this);
6281184 }catch(Exception e) {}
6291185 */
630
- radio.layout = sevenButton;
1186
+ radio.layout = sixButton; // sevenButton;
6311187 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
6321188 }
6331189
6341190 void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
6351191 {
1192
+ panel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
1193
+ colorCB.setToolTipText("Copy color when dropped");
1194
+ colorCB.addItemListener(this);
1195
+
1196
+ panel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
1197
+ materialCB.setToolTipText("Copy material when dropped");
1198
+ materialCB.addItemListener(this);
1199
+
1200
+ panel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
1201
+ textureCB.setToolTipText("Copy texture when dropped");
1202
+ textureCB.addItemListener(this);
1203
+
1204
+ panel.Return();
1205
+
6361206 panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
6371207 boxCB.setToolTipText("Display bounding boxes");
6381208 boxCB.addItemListener(this);
6391209
6401210 panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
641
- zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
1211
+ zoomBoxCB.setToolTipText("Display only for wheel");
6421212 zoomBoxCB.addItemListener(this);
6431213
644
- if (Globals.ADVANCED)
1214
+ if (true) // Globals.ADVANCED)
6451215 {
646
- panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
647
- supportCB.setToolTipText("Enable rigging");
648
- supportCB.addItemListener(this);
1216
+// panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
1217
+// supportCB.setToolTipText("Enable rigging");
1218
+// supportCB.addItemListener(this);
1219
+
1220
+ panel.add(freezeCB = new cCheckBox("Freeze", Globals.FREEZEONMOVE)); //, constraints);
1221
+ freezeCB.setToolTipText("Fast moving camera");
1222
+ freezeCB.addItemListener(this);
6491223
6501224 // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
6511225 // localCB.addItemListener(this);
6521226
1227
+ panel.Return();
1228
+
6531229 panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
6541230 crowdCB.setToolTipText("Used for crowds");
6551231 crowdCB.addItemListener(this);
....@@ -658,14 +1234,19 @@
6581234 smoothCB.setToolTipText("Snapping delay");
6591235 smoothCB.addItemListener(this);
6601236
661
- panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
662
- slowCB.setToolTipText("Smooth interpolation");
663
- slowCB.addItemListener(this);
1237
+// panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
1238
+// slowCB.setToolTipText("Smooth interpolation");
1239
+// slowCB.addItemListener(this);
1240
+ panel.add(minshaderCB = new cCheckBox("Min shader", Globals.MINSHADER)); //, constraints);
1241
+ minshaderCB.setToolTipText("Minimal fast shader");
1242
+ minshaderCB.addItemListener(this);
6641243
6651244 // constraints.gridy += 1;
6661245 // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
6671246 // speakerMocapCB.addItemListener(this);
6681247
1248
+ panel.Return();
1249
+
6691250 if (false)
6701251 {
6711252 // handled in scripts
....@@ -680,42 +1261,85 @@
6801261 //constraints.gridy += 1;
6811262 panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
6821263 smoothfocusCB.addItemListener(this);
1264
+ panel.Return();
6831265 }
6841266
6851267 //constraints.gridx += 1;
6861268 //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
6871269 // debugCB.addItemListener(this);
6881270
1271
+ panel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
1272
+ trackCB.setToolTipText("Enable tracking target");
1273
+ trackCB.addItemListener(this);
1274
+
6891275 panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
1276
+ oeilCB.setToolTipText("Move camera when tracking");
6901277 oeilCB.addItemListener(this);
6911278
1279
+ panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints);
1280
+ shadowCB.setToolTipText("When live compute shadows");
1281
+ shadowCB.addItemListener(this);
1282
+
1283
+ panel.Return();
1284
+ panel.add(toggleTextureCB = new cCheckBox("Textures", CameraPane.textureon)); //, constraints);
1285
+ toggleTextureCB.setToolTipText("Load textures");
1286
+ toggleTextureCB.addItemListener(this);
1287
+
1288
+ panel.add(toggleSwitchCB = new cCheckBox("Switch", CameraPane.SWITCH)); //, constraints);
1289
+ toggleSwitchCB.setToolTipText("Choose a single item");
1290
+ toggleSwitchCB.addItemListener(this);
1291
+
1292
+ panel.add(autokeepCB = new cCheckBox("Auto-replace", Globals.REPLACEONMAKE)); //, constraints);
1293
+ autokeepCB.setToolTipText("On structure change");
1294
+ autokeepCB.addItemListener(this);
1295
+
1296
+ panel.Return();
1297
+ if (Globals.ADVANCED)
1298
+ {
6921299 panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
6931300 lookAtCB.setToolTipText("Look-at target");
6941301 lookAtCB.addItemListener(this);
1302
+ }
6951303
6961304 }
6971305
6981306 cGridBag fill = new cGridBag();
699
-
7001307 fill.preferredHeight = 200;
1308
+ cGridBag fill2 = new cGridBag();
1309
+ fill2.preferredHeight = 200;
1310
+ cGridBag fill3 = new cGridBag();
1311
+ fill3.preferredHeight = 200;
7011312
7021313 panel.add(fill);
1314
+ panel.add(fill2);
1315
+ panel.add(fill3);
7031316
7041317 }
7051318
7061319 void EditObject(Object3D obj)
7071320 {
7081321 cRadio radioButton = new cRadio(obj.name);
1322
+
1323
+ // June 2019. Patch to avoid bug with transparency.
1324
+ radioButton.hadMaterial = obj.material != null;
1325
+ if (!radioButton.hadMaterial)
1326
+ {
1327
+ obj.material = new cMaterial();
1328
+ }
1329
+
7091330 radioButton.SetObject(obj);
710
- radioButton.layout = sevenButton;
1331
+ radioButton.layout = sixButton; // sevenButton;
7111332 radioButton.SetCamera(cameraView.renderCamera, false);
7121333 radioButton.addActionListener(this);
7131334 radioPanel.add(radioButton);
7141335 buttonGroup.add(radioButton);
7151336 radioButton.doClick();
7161337 }
1338
+
7171339 void SetupViews(ObjEditor oe)
7181340 {
1341
+ theFrame = this;
1342
+
7191343 oe.SetupViews();
7201344
7211345 System.out.println("SetupViews");
....@@ -724,23 +1348,30 @@
7241348 /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this);
7251349 }
7261350
727
- JCheckBox liveCB;
728
- JCheckBox supportCB;
729
- JCheckBox localCB;
730
- JCheckBox crowdCB;
731
- JCheckBox smoothCB;
732
- JCheckBox fastCB;
733
- JCheckBox slowCB;
734
- JCheckBox boxCB;
735
- JCheckBox zoomBoxCB;
736
- JCheckBox trackCB;
737
- JCheckBox smoothfocusCB;
1351
+ cToggleButton liveCB;
1352
+ cCheckBox supportCB;
1353
+ cCheckBox localCB;
1354
+ cCheckBox crowdCB;
1355
+ cCheckBox smoothCB;
1356
+ cCheckBox minshaderCB;
1357
+
1358
+ cToggleButton fastCB;
1359
+ cCheckBox slowCB;
1360
+ cCheckBox boxCB;
1361
+ cCheckBox zoomBoxCB;
1362
+ cCheckBox freezeCB;
1363
+ //cToggleButton trackCB;
1364
+ cCheckBox trackCB;
1365
+ cCheckBox smoothfocusCB;
7381366 // JCheckBox speakerMocapCB;
739
- JCheckBox speakerCameraCB;
740
- JCheckBox speakerFocusCB;
741
- JCheckBox debugCB;
742
- JCheckBox oeilCB;
743
- JCheckBox lookAtCB;
1367
+ cCheckBox speakerCameraCB;
1368
+ cCheckBox speakerFocusCB;
1369
+ cCheckBox debugCB;
1370
+
1371
+ cCheckBox oeilCB;
1372
+ cCheckBox shadowCB;
1373
+ cCheckBox autokeepCB;
1374
+ cCheckBox lookAtCB;
7441375
7451376 // static int COLOR = 1;
7461377 // static int MATERIAL = 2;
....@@ -748,9 +1379,9 @@
7481379
7491380 int dropAttributes = Object3D.COLOR | Object3D.MATERIAL;
7501381
751
- JCheckBox colorCB;
752
- JCheckBox materialCB;
753
- JCheckBox textureCB;
1382
+ cCheckBox colorCB;
1383
+ cCheckBox materialCB;
1384
+ cCheckBox textureCB;
7541385
7551386 public void itemStateChanged(ItemEvent e)
7561387 {
....@@ -778,6 +1409,7 @@
7781409 } else if(e.getSource() == liveCB)
7791410 {
7801411 cameraView.ToggleLive();
1412
+ refreshContents(false);
7811413 }
7821414 else if(e.getSource() == supportCB)
7831415 {
....@@ -793,6 +1425,12 @@
7931425 {
7941426 cameraView.ToggleInertia();
7951427 cameraView.repaint();
1428
+ }
1429
+ else if(e.getSource() == minshaderCB)
1430
+ {
1431
+ Globals.MINSHADER ^= true;
1432
+ cameraView.programInitialized = false;
1433
+ cameraView.repaint();
7961434 }
7971435 else if(e.getSource() == localCB)
7981436 {
....@@ -842,6 +1480,18 @@
8421480 {
8431481 cameraView.ToggleOeil();
8441482 }
1483
+ else if(e.getSource() == shadowCB)
1484
+ {
1485
+ Globals.COMPUTESHADOWWHENLIVE ^= true;
1486
+ }
1487
+ else if(e.getSource() == freezeCB)
1488
+ {
1489
+ Globals.FREEZEONMOVE ^= true;
1490
+ }
1491
+ else if(e.getSource() == autokeepCB)
1492
+ {
1493
+ Globals.REPLACEONMAKE ^= true;
1494
+ }
8451495 else if(e.getSource() == lookAtCB)
8461496 {
8471497 cameraView.ToggleLookAt();
....@@ -858,7 +1508,8 @@
8581508
8591509 /**/
8601510 //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this);
861
- TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1511
+ //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1512
+ TreePath path = objEditor.jTree.getSelectionPath();
8621513 if ((path == null) || (path.getPathCount() <= 1)) {
8631514 // We can't move the root node or an empty selection
8641515 return;
....@@ -921,8 +1572,6 @@
9211572 }
9221573 }
9231574
924
- String string = (String) object;
925
-
9261575 System.out.println("Transfer = " + object + "; drop : " + target);
9271576 // if( object instanceof java.io.File[])
9281577 // {
....@@ -930,7 +1579,11 @@
9301579 // objEditor.DropFile((java.io.File[]) object, true);
9311580 // return;
9321581 // }
933
- if (string.charAt(0) == '/')
1582
+
1583
+ String string = object.toString();
1584
+
1585
+ // File path for Mac and Windows
1586
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
9341587 {
9351588 // file(s)
9361589 String[] names = string.split("\n");
....@@ -957,7 +1610,7 @@
9571610
9581611 flashIt = false;
9591612 CameraPane pane = (CameraPane) target;
960
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1613
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
9611614 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
9621615
9631616 if (group.selection.size() == 1)
....@@ -973,23 +1626,33 @@
9731626
9741627 assert target == objEditor.jTree;
9751628 TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y);
1629
+ Object3D destinationLeaf;
9761630 try {
977
- Object3D dummy = (Composite) destinationPath.getLastPathComponent();
1631
+ destinationLeaf = (Composite) destinationPath.getLastPathComponent();
9781632 } catch (Exception e) {
9791633 System.out.println("destinationPath : " + destinationPath);
9801634 return;
9811635 }
9821636
983
- if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1637
+ for (int i=group.selection.size(); --i>=0;)
9841638 {
1639
+ Object3D child = (Object3D)group.selection.elementAt(i);
1640
+
1641
+ // Cannot move into itself
1642
+ if (child == destinationLeaf)
1643
+ return;
1644
+ }
1645
+
1646
+// june 2019 if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1647
+// {
9851648 loadClipboard(true);
9861649 objEditor.jTree.setSelectionPath(destinationPath);
9871650 pasteInto(false, false);
988
- } else {
989
- loadClipboard(false);
990
- objEditor.jTree.setSelectionPath(destinationPath);
991
- pasteInto(false, false); // true); // ???
992
- }
1651
+// } else {
1652
+// loadClipboard(false);
1653
+// objEditor.jTree.setSelectionPath(destinationPath);
1654
+// pasteInto(false, false); // true); // ???
1655
+// }
9931656 }
9941657 public void dropActionChanged(DropTargetDragEvent dtde)
9951658 // Called if the user has modified the current drop gesture
....@@ -1094,22 +1757,30 @@
10941757 {
10951758 //heightFieldItem = menu.add(new MenuItem("Height Field"));
10961759 //heightFieldItem.addActionListener(this);
1097
- gridItem = menu.add(new MenuItem("Grid"));
1098
- gridItem.addActionListener(this);
1099
- rectoidItem = menu.add(new MenuItem("Box"));
1100
- rectoidItem.addActionListener(this);
1101
- ellipsoidItem = menu.add(new MenuItem("Sphere"));
1102
- ellipsoidItem.addActionListener(this);
1103
- coneItem = menu.add(new MenuItem("Cone"));
1104
- coneItem.addActionListener(this);
1105
- torusItem = menu.add(new MenuItem("Torus"));
1106
- torusItem.addActionListener(this);
1107
- superItem = menu.add(new MenuItem("Superellipsoid"));
1108
- superItem.addActionListener(this);
1760
+// gridItem = menu.add(new MenuItem("Grid"));
1761
+// gridItem.addActionListener(this);
1762
+// rectoidItem = menu.add(new MenuItem("Box"));
1763
+// rectoidItem.addActionListener(this);
1764
+// ellipsoidItem = menu.add(new MenuItem("Sphere"));
1765
+// ellipsoidItem.addActionListener(this);
1766
+// coneItem = menu.add(new MenuItem("Cone"));
1767
+// coneItem.addActionListener(this);
1768
+// torusItem = menu.add(new MenuItem("Torus"));
1769
+// torusItem.addActionListener(this);
1770
+// superItem = menu.add(new MenuItem("Superellipsoid"));
1771
+// superItem.addActionListener(this);
1772
+
1773
+ cameraItem = menu.add(new MenuItem("Camera"));
1774
+ cameraItem.addActionListener(this);
1775
+
1776
+ if (!Globals.ADVANCED)
1777
+ {
11091778 kleinItem = menu.add(new MenuItem("Klein Bottle"));
11101779 kleinItem.addActionListener(this);
1111
- particleItem = menu.add(new MenuItem("Particle system"));
1112
- particleItem.addActionListener(this);
1780
+ }
1781
+
1782
+// particleItem = menu.add(new MenuItem("Particle system"));
1783
+// particleItem.addActionListener(this);
11131784 if (Globals.ADVANCED)
11141785 {
11151786 ragdollItem = menu.add(new MenuItem("Rag Walk"));
....@@ -1135,15 +1806,15 @@
11351806 }
11361807 bezierItem = menu.add(new MenuItem("Bezier Patch"));
11371808 bezierItem.addActionListener(this);
1138
- overlayItem = menu.add(new MenuItem("Overlay"));
1139
- overlayItem.addActionListener(this);
1140
- lightItem = menu.add(new MenuItem("Light"));
1141
- lightItem.addActionListener(this);
1809
+// overlayItem = menu.add(new MenuItem("Overlay"));
1810
+// overlayItem.addActionListener(this);
1811
+// lightItem = menu.add(new MenuItem("Light"));
1812
+// lightItem.addActionListener(this);
11421813 menu.add("-");
11431814 //superLoopItem = menu.add(new MenuItem("Super Loop"));
11441815 //superLoopItem.addActionListener(this);
1145
- loopItem = menu.add(new MenuItem("Loop"));
1146
- loopItem.addActionListener(this);
1816
+// loopItem = menu.add(new MenuItem("Loop"));
1817
+// loopItem.addActionListener(this);
11471818 doubleItem = menu.add(new MenuItem("Fork"));
11481819 doubleItem.addActionListener(this);
11491820 if (Globals.ADVANCED)
....@@ -1159,18 +1830,23 @@
11591830 animationItem.addItemListener(this);
11601831 animationItem.setState(Globals.ANIMATION);
11611832
1833
+ menu.add(archiveItem = new MenuItem("Archive3D..."));
1834
+ archiveItem.addActionListener(this);
1835
+
11621836 menu.add("-");
11631837 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
11641838 parseverticesItem.addActionListener(this);
11651839 textureFieldItem = menu.add(new MenuItem("Texture Field"));
11661840 textureFieldItem.addActionListener(this);
1167
- alignItem = menu.add(new MenuItem("Align Object"));
1841
+ alignItem = menu.add(new MenuItem("Align Objects"));
11681842 alignItem.addActionListener(this);
11691843 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
11701844 reduceMorphItem.addActionListener(this);
11711845 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
11721846 reduce34MorphItem.addActionListener(this);
1173
-
1847
+ menu.add("-");
1848
+ menu.add(memoryItem = new MenuItem("Memory Usage"));
1849
+ memoryItem.addActionListener(this);
11741850 menu.add(computeAOItem = new MenuItem("Compute AO"));
11751851 computeAOItem.addActionListener(this);
11761852
....@@ -1179,11 +1855,9 @@
11791855 mirrorItem = menu.add(new MenuItem("Mirror Poses"));
11801856 mirrorItem.addActionListener(this);
11811857 menu.add("-");
1182
- menu.add(memoryItem = new MenuItem("Memory Usage"));
1183
- memoryItem.addActionListener(this);
11841858 menu.add(analyzeItem = new MenuItem("Analyze"));
11851859 analyzeItem.addActionListener(this);
1186
- menu.add(dumpItem = new MenuItem("Dump"));
1860
+ menu.add(dumpItem = new MenuItem("Print"));
11871861 dumpItem.addActionListener(this);
11881862 // menu.add(pathItem = new MenuItem("From-to path"));
11891863 // pathItem.addActionListener(this);
....@@ -1324,9 +1998,34 @@
13241998 shadow.material = new cMaterial(obj.material);
13251999 shadow.material.diffuse = 0.0001f;
13262000 shadow.material.specular = 0.0001f;
2001
+ //shadow.projectedVertices[1].x = 300;
13272002
13282003 makeSomething(shadow);
13292004 }
2005
+
2006
+ private void ClearUnpinned()
2007
+ {
2008
+ //for (Object3D obj : listUI)
2009
+ for (int i=listUI.size(); --i>=0;)
2010
+ {
2011
+ Object3D obj = listUI.elementAt(i);
2012
+ if (!obj.pinned)
2013
+ {
2014
+ obj.CloseUI();
2015
+ listUI.remove(i);
2016
+ }
2017
+ }
2018
+ }
2019
+
2020
+ private void EditElement(Object3D elem, boolean newWindow)
2021
+ {
2022
+ // if (!(elem instanceof Composite))
2023
+ // newWindow = false;
2024
+ listUI.add(elem);
2025
+ elem.openEditWindow(this, newWindow); //, false);
2026
+ System.out.println("edit : " + elem);
2027
+ elem.editWindow.refreshContents(true); // ? new
2028
+ }
13302029
13312030 /**
13322031 * applyExample
....@@ -1530,9 +2229,9 @@
15302229
15312230 void Overwrite(int mask)
15322231 {
1533
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2232
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
15342233 {
1535
- Object3D content = GrafreeD.clipboard.get(0);
2234
+ Object3D content = Grafreed.clipboard.get(0);
15362235
15372236 if (content instanceof cGroup && ((cGroup)content).transientlink )
15382237 content = ((cGroup)content).get(0);
....@@ -1571,7 +2270,7 @@
15712270 {
15722271 ScreenFit();
15732272 } else
1574
- if (source == switchItem)
2273
+ if (source == switchViewItem)
15752274 {
15762275 cVector v1 = new cVector();
15772276 cVector v2 = new cVector();
....@@ -1580,11 +2279,11 @@
15802279 objEditor.cameraView.renderCamera.setAim(v2, v1);
15812280 objEditor.cameraView.repaint();
15822281 } else
1583
- if (source == rectoidItem)
2282
+ if (source == rectoidItem || source == boxButton)
15842283 {
15852284 makeSomething(new Box());
15862285 } else
1587
- if (source == particleItem)
2286
+ if (source == particleItem || source == particlesButton)
15882287 {
15892288 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15902289 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1663,27 +2362,27 @@
16632362
16642363 makeSomething(obj);
16652364 } else
1666
- if (source == gridItem)
2365
+ if (source == gridItem || source == gridButton)
16672366 {
16682367 makeSomething(new Grid());
16692368 } else
1670
- if (source == ellipsoidItem)
2369
+ if (source == ellipsoidItem || source == sphereButton)
16712370 {
16722371 makeSomething(new Sphere());
16732372 } else
1674
- if (source == coneItem)
2373
+ if (source == coneItem || source == coneButton)
16752374 {
16762375 makeSomething(new Cone());
16772376 } else
1678
- if (source == torusItem)
2377
+ if (source == torusItem || source == torusButton)
16792378 {
16802379 makeSomething(new Torus());
16812380 } else
1682
- if (source == superItem)
2381
+ if (source == superItem || source == superButton)
16832382 {
16842383 makeSomething(new Superellipsoid());
16852384 } else
1686
- if (source == kleinItem)
2385
+ if (source == kleinItem || source == kleinButton)
16872386 {
16882387 makeSomething(new Klein());
16892388 } else
....@@ -1703,7 +2402,7 @@
17032402 {
17042403 makeSomething(new BezierSurface());
17052404 } else
1706
- if (source == overlayItem)
2405
+ if (source == overlayItem || source == overlayButton)
17072406 {
17082407 /*
17092408 Object3D obj = new BezierSurface(5,8);
....@@ -1751,10 +2450,27 @@
17512450 s.setup();
17522451 makeSomething(s);
17532452 } else
1754
- if (source == lightItem)
2453
+ if (source == lightItem || source == lightButton)
17552454 {
17562455 makeSomething(new Light());
17572456 } else
2457
+// if (source == skybox1Button ||
2458
+// source == skybox2Button ||
2459
+// source == skybox3Button ||
2460
+// source == skybox4Button ||
2461
+// source == skybox5Button ||
2462
+// source == skybox6Button ||
2463
+// source == skybox7Button ||
2464
+// source == skybox11Button ||
2465
+// source == skybox12Button ||
2466
+// source == skybox13Button ||
2467
+// source == skybox14Button ||
2468
+// source == skybox15Button ||
2469
+// source == skybox16Button ||
2470
+// source == skybox17Button)
2471
+// {
2472
+// ChangeSkybox(source);
2473
+// } else
17582474 if (source == csgItem)
17592475 {
17602476 group(new CSG());
....@@ -1801,30 +2517,30 @@
18012517
18022518 group(g);
18032519 } else
1804
- if (source == loopItem)
2520
+ if (source == loopItem || source == loopButton)
18052521 {
18062522 Composite csg = new GroupLeaf();
18072523 csg.count = 5;
18082524 group(csg);
1809
- Composite child = new cGroup();
2525
+ Composite child = new cGroup("Branch");
18102526 csg.addChild(child);
18112527 child.addChild(csg);
18122528 } else
18132529 if (source == doubleItem)
18142530 {
1815
- Composite csg = new GroupLeaf();
2531
+ Composite csg = new GroupLeaf("Fork");
18162532 csg.count = 5;
18172533 group(csg);
1818
- Composite child = new cGroup();
2534
+ Composite child = new cGroup("Branch A");
18192535 csg.addChild(child);
18202536 child.addChild(csg);
1821
- child = new cGroup();
2537
+ child = new cGroup("Branch B");
18222538 csg.addChild(child);
18232539 child.addChild(csg);
18242540 } else
18252541 if (source == tripleItem)
18262542 {
1827
- Composite csg = new GroupLeaf();
2543
+ Composite csg = new GroupLeaf("Trident");
18282544 csg.count = 4;
18292545 group(csg);
18302546 Composite child = new cGroup();
....@@ -1837,27 +2553,10 @@
18372553 csg.addChild(child);
18382554 child.addChild(csg);
18392555 } else
1840
-
1841
- if (source == importGFDItem)
1842
- {
1843
- ImportGFD();
1844
- } else
1845
- if (source == importVRMLX3DItem)
1846
- {
1847
- ImportVRMLX3D();
1848
- } else
1849
- if (source == import3DSItem)
1850
- {
1851
- objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
1852
- } else
1853
- if (source == importOBJItem)
1854
- {
1855
- objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1856
- } else
18572556 if (source == computeAOItem)
18582557 {
18592558 Globals.drawMode = CameraPane.OCCLUSION;
1860
- Globals.theRenderer.repaint();
2559
+ cameraView.repaint();
18612560 } else
18622561 if (source == recompileItem)
18632562 {
....@@ -1872,7 +2571,7 @@
18722571 if (source == invariantsItem)
18732572 {
18742573 System.out.println("Invariants:");
1875
- GrafreeD.grafreeD.universe.invariants();
2574
+ Grafreed.grafreeD.universe.invariants();
18762575 } else
18772576 if (source == memoryItem)
18782577 {
....@@ -1891,6 +2590,46 @@
18912590 {
18922591 DumpObject();
18932592 } else
2593
+ if (source == minButton)
2594
+ {
2595
+ Minimize();
2596
+ } else
2597
+ if (source == maxButton)
2598
+ {
2599
+ Maximize();
2600
+ } else
2601
+ if (source == fullButton)
2602
+ {
2603
+ ToggleFullScreen();
2604
+ } else
2605
+ if (source == undoButton)
2606
+ {
2607
+ // Go to previous version
2608
+ //if (!Undo())
2609
+ //java.awt.Toolkit.getDefaultToolkit().beep();
2610
+ Undo();
2611
+ } else
2612
+ if (source == restoreButton)
2613
+ {
2614
+ // Restore current version
2615
+ Restore();
2616
+ } else
2617
+ if (source == replaceButton)
2618
+ {
2619
+ // Overwrite current version
2620
+ Replace();
2621
+ } else
2622
+ if (source == redoButton)
2623
+ {
2624
+ // Go to next version
2625
+ Redo();
2626
+ } else
2627
+ if (source == saveButton)
2628
+ {
2629
+ // Save a new version
2630
+ if (!Save(true))
2631
+ java.awt.Toolkit.getDefaultToolkit().beep();
2632
+ } else
18942633 if (source == oneStepButton)
18952634 {
18962635 Globals.ONESTEP = true;
....@@ -1898,17 +2637,14 @@
18982637 } else
18992638 if (source == screenfitButton)
19002639 {
1901
- //Reload(lastConverter, lastFilename, true);
19022640 ScreenFit();
19032641 } else
19042642 if (source == screenfitpointButton)
19052643 {
1906
- //Reload(lastConverter, lastFilename, true);
19072644 ScreenFitPoint();
19082645 } else
19092646 if (source == snapobjectButton)
19102647 {
1911
- //Reload(lastConverter, lastFilename, true);
19122648 SnapObject();
19132649 } else
19142650 // if (event.getSource() == recompileButton)
....@@ -1945,12 +2681,20 @@
19452681 {
19462682 loadClipboard(true);
19472683 } else
2684
+ if (source == undoItem)
2685
+ {
2686
+ Undo();
2687
+ } else
2688
+ if (source == redoItem)
2689
+ {
2690
+ Redo();
2691
+ } else
19482692 if (source == duplicateItem)
19492693 {
1950
- Object3D keep = GrafreeD.clipboard;
2694
+ Object3D keep = Grafreed.clipboard;
19512695 loadClipboard(false);
19522696 paste(false);
1953
- GrafreeD.clipboard = keep;
2697
+ Grafreed.clipboard = keep;
19542698 } else
19552699 if (source == cloneItem)
19562700 {
....@@ -2170,9 +2914,9 @@
21702914 // group.selection.get(0).setMasterThis(content); // should be identity
21712915 // refreshContents();
21722916 // }
2173
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2917
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
21742918 {
2175
- Object3D content = GrafreeD.clipboard.get(0);
2919
+ Object3D content = Grafreed.clipboard.get(0);
21762920
21772921 if (content instanceof cGroup && ((cGroup)content).transientlink )
21782922 content = ((cGroup)content).get(0);
....@@ -2222,9 +2966,9 @@
22222966 } else
22232967 if (source == setMasterItem)
22242968 {
2225
- if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
2969
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
22262970 {
2227
- Object3D content = GrafreeD.clipboard.get(0);
2971
+ Object3D content = Grafreed.clipboard.get(0);
22282972
22292973 if (content instanceof cGroup && ((cGroup)content).transientlink )
22302974 content = ((cGroup)content).get(0);
....@@ -2237,9 +2981,9 @@
22372981 {
22382982 if (group.selection.size() == 1)
22392983 {
2240
- if (GrafreeD.clipboard.size() == 1)
2984
+ if (Grafreed.clipboard.size() == 1)
22412985 {
2242
- Object3D content = GrafreeD.clipboard.get(0);
2986
+ Object3D content = Grafreed.clipboard.get(0);
22432987
22442988 if (content instanceof cGroup && ((cGroup)content).transientlink )
22452989 content = ((cGroup)content).get(0);
....@@ -2256,7 +3000,7 @@
22563000 {
22573001 RevertMeshes();
22583002 } else
2259
- if (source == resetMeshItem)
3003
+ if (source == resetAllItem)
22603004 {
22613005 ResetAll();
22623006 } else
....@@ -2264,7 +3008,7 @@
22643008 {
22653009 StepAll();
22663010 } else
2267
- if (source == clearItem) // || event.getSource() == clearButton)
3011
+ if (source == deleteItem) // || event.getSource() == clearButton)
22683012 {
22693013 //int indices[] = jList.getSelectedIndices();
22703014 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2276,9 +3020,9 @@
22763020 {
22773021 ClearSelection(true);
22783022 } else
2279
- if (source == grabItem)
3023
+ if (source == grabItem || source == groupButton)
22803024 {
2281
- group(new cGroup(), true);
3025
+ group(new cGroup(), false); // true);
22823026 } else
22833027 if (source == hideItem)
22843028 {
....@@ -2296,11 +3040,11 @@
22963040 {
22973041 makeSomething(new Camera());
22983042 } else
2299
- if (source == compositeItem)
3043
+ if (source == compositeItem || source == compositeButton)
23003044 {
23013045 group(new Composite());
23023046 } else
2303
- if (source == randomItem)
3047
+ if (source == switchItem || source == switchButton)
23043048 {
23053049 RandomNode random = new RandomNode();
23063050 group(random);
....@@ -2402,7 +3146,7 @@
24023146 {
24033147 group(new cLinker());
24043148 } else
2405
- if (source == textureItem)
3149
+ if (source == textureItem || source == textureButton)
24063150 {
24073151 group(new TextureNode());
24083152 } else
....@@ -2422,17 +3166,30 @@
24223166 {
24233167 CastShadow(2);
24243168 } else
2425
- if (source == ungroupItem)
3169
+ if (source == ungroupItem || source == ungroupButton)
24263170 {
2427
- //ungroup();
3171
+ boolean hasRoot = false;
3172
+
24283173 for (int i=0; i<group.selection.size(); i++)
24293174 {
2430
- Ungroup(group.selection.get(i));
3175
+ if (group.selection.get(i) == group)
3176
+ {
3177
+ hasRoot = true;
3178
+ break;
3179
+ }
24313180 }
24323181
2433
- ClearSelection(false);
2434
-
2435
- refreshContents();
3182
+ if (!hasRoot)
3183
+ {
3184
+ for (int i=0; i<group.selection.size(); i++)
3185
+ {
3186
+ Ungroup(group.selection.get(i));
3187
+ }
3188
+
3189
+ ClearSelection(false);
3190
+
3191
+ refreshContents();
3192
+ }
24363193 } else
24373194 if (source == genUVItem)
24383195 {
....@@ -2444,7 +3201,7 @@
24443201 } else
24453202 if (source == genNormalsMESHItem)
24463203 {
2447
- GenNormals(true); // TODO
3204
+ GenNormalsMESH();
24483205 } else
24493206 if (source == genNormalsORGANItem)
24503207 {
....@@ -2509,6 +3266,22 @@
25093266 if (source == unmarkleavesItem)
25103267 {
25113268 MarkLeaves(false);
3269
+ } else
3270
+ if (source == rewindleavesItem)
3271
+ {
3272
+ RewindLeaves(true);
3273
+ } else
3274
+ if (source == unrewindleavesItem)
3275
+ {
3276
+ RewindLeaves(false);
3277
+ } else
3278
+ if (source == randomleavesItem)
3279
+ {
3280
+ RandomLeaves(true);
3281
+ } else
3282
+ if (source == unrandomleavesItem)
3283
+ {
3284
+ RandomLeaves(false);
25123285 } else
25133286 if (source == flipVItem)
25143287 {
....@@ -2594,9 +3367,13 @@
25943367 {
25953368 SmoothMesh();
25963369 } else
2597
- if (source == transformgeometryItem)
3370
+ if (source == transformGeometryItem)
25983371 {
25993372 TransformGeometry();
3373
+ } else
3374
+ if (source == transformChildrenItem)
3375
+ {
3376
+ TransformChildren();
26003377 } else
26013378 if (source == resetTransformItem)
26023379 {
....@@ -2604,7 +3381,11 @@
26043381 } else
26053382 if (source == resetCentroidItem)
26063383 {
2607
- ResetCentroid();
3384
+ ResetCentroid(true);
3385
+ } else
3386
+ if (source == resetCentroidXZItem)
3387
+ {
3388
+ ResetCentroid(false);
26083389 } else
26093390 if (source == resetParentItem)
26103391 {
....@@ -2709,7 +3490,7 @@
27093490 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
27103491 {
27113492 obj = (Object3D)e.nextElement();
2712
- obj.SetBumpTexture(null);
3493
+ obj.ResetBumpTexture();
27133494 }
27143495
27153496 refreshContents();
....@@ -2725,6 +3506,31 @@
27253506
27263507 refreshContents();
27273508 } else
3509
+ if (source == embedTexturesItem)
3510
+ {
3511
+ Object3D obj;
3512
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3513
+ {
3514
+ obj = (Object3D)e.nextElement();
3515
+ obj.EmbedTextures(true);
3516
+ }
3517
+
3518
+ refreshContents();
3519
+ } else
3520
+ if (source == deEmbedTexturesItem)
3521
+ {
3522
+ Object3D obj;
3523
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3524
+ {
3525
+ obj = (Object3D)e.nextElement();
3526
+ obj.EmbedTextures(false);
3527
+ }
3528
+
3529
+ CameraPane.texturepigment.clear();
3530
+ CameraPane.texturebump.clear();
3531
+
3532
+ refreshContents();
3533
+ } else
27283534 if (source == flashSelectionButton)
27293535 {
27303536 CameraPane.flash = true;
....@@ -2736,6 +3542,10 @@
27363542 if (source == twoButton)
27373543 {
27383544 radio.layout = twoButton;
3545
+
3546
+ if (CameraPane.FULLSCREEN)
3547
+ fullscreenLayout = radio.layout;
3548
+
27393549 // bug
27403550 //gridPanel.setDividerLocation(1.0);
27413551 //bigPanel.setDividerLocation(0.0);
....@@ -2768,10 +3578,31 @@
27683578 bigThree.ClearUI();
27693579 bigThree.add(centralPanel);
27703580 bigThree.FlushUI();
3581
+
3582
+ cameraView.requestFocusInWindow();
3583
+
3584
+// refreshContents(true);
3585
+//
3586
+// try
3587
+// {
3588
+// java.awt.Robot bot = new java.awt.Robot();
3589
+// int mask = InputEvent.BUTTON1_MASK;
3590
+// bot.mouseMove(100, 100);
3591
+// bot.mousePress(mask);
3592
+// bot.mouseRelease(mask);
3593
+// }
3594
+// catch (Exception e)
3595
+// {
3596
+//
3597
+// }
3598
+
27713599 } else
27723600 if (source == threeButton)
27733601 {
27743602 radio.layout = threeButton;
3603
+
3604
+ if (CameraPane.FULLSCREEN)
3605
+ fullscreenLayout = radio.layout;
27753606
27763607 // bigThree.remove(scenePanel);
27773608 // bigThree.remove(centralPanel);
....@@ -2801,13 +3632,18 @@
28013632 // centralPanel.setVisible(true);
28023633 // XYZPanel.setVisible(true);
28033634 bigThree.ClearUI();
3635
+ bigThree.add(scenePanel);
28043636 bigThree.add(centralPanel);
2805
- bigThree.add(XYZPanel);
28063637 bigThree.FlushUI();
3638
+
3639
+ cameraView.requestFocusInWindow();
28073640 } else
28083641 if (source == fourButton)
28093642 {
28103643 radio.layout = fourButton;
3644
+
3645
+ if (CameraPane.FULLSCREEN)
3646
+ fullscreenLayout = radio.layout;
28113647
28123648 // bigThree.remove(scenePanel);
28133649 // bigThree.remove(centralPanel);
....@@ -2839,10 +3675,15 @@
28393675 bigThree.ClearUI();
28403676 bigThree.add(scenePanel);
28413677 bigThree.FlushUI();
3678
+
3679
+ cameraView.requestFocusInWindow();
28423680 } else
28433681 if (source == sixButton)
28443682 {
28453683 radio.layout = sixButton;
3684
+
3685
+ if (CameraPane.FULLSCREEN)
3686
+ fullscreenLayout = radio.layout;
28463687
28473688 // bigThree.remove(scenePanel);
28483689 // bigThree.remove(centralPanel);
....@@ -2872,13 +3713,18 @@
28723713 // centralPanel.setVisible(true);
28733714 // XYZPanel.setVisible(false);
28743715 bigThree.ClearUI();
2875
- bigThree.add(scenePanel);
28763716 bigThree.add(centralPanel);
3717
+ bigThree.add(scenePanel);
28773718 bigThree.FlushUI();
3719
+
3720
+ cameraView.requestFocusInWindow();
28783721 } else
28793722 if (source == sevenButton)
28803723 {
28813724 radio.layout = sevenButton;
3725
+
3726
+ if (CameraPane.FULLSCREEN)
3727
+ fullscreenLayout = radio.layout;
28823728
28833729 // bigThree.remove(scenePanel);
28843730 // bigThree.remove(centralPanel);
....@@ -2912,6 +3758,8 @@
29123758 bigThree.add(centralPanel);
29133759 bigThree.add(XYZPanel);
29143760 bigThree.FlushUI();
3761
+
3762
+ cameraView.requestFocusInWindow();
29153763 } else
29163764 if (source == rootButton)
29173765 {
....@@ -2923,6 +3771,7 @@
29233771 EditObject(obj);
29243772 }
29253773
3774
+ cameraView.requestFocusInWindow();
29263775 refreshContents(true);
29273776 } else
29283777 if (source == closeButton)
....@@ -2932,22 +3781,37 @@
29323781 for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
29333782 {
29343783 ab = (cRadio)e.nextElement();
2935
- if(ab.getModel().isSelected() && ab.GetObject() != client)
3784
+ if (ab.getModel().isSelected() && ab.GetObject() != client)
29363785 {
3786
+ // Patch to avoid bug with transparency.
3787
+ if (!ab.hadMaterial)
3788
+ {
3789
+ ab.object.material = null;
3790
+ }
3791
+
29373792 buttonGroup.remove(ab);
29383793 radioPanel.remove(ab);
29393794
2940
- ab.GetObject().editWindow = null;
3795
+ //ab.GetObject().editWindow = null;
3796
+ ab.GetObject().manipWindow = null;
29413797 // ab.GetObject().objectUI = null; // ?????????
29423798
29433799 ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick();
29443800 break;
29453801 }
29463802 }
3803
+
3804
+ cameraView.requestFocusInWindow();
29473805 refreshContents(true);
29483806 } else
29493807 if (source == editItem || source == editButton)
29503808 {
3809
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3810
+ {
3811
+ Object3D child = (Object3D)e.nextElement();
3812
+ child.pinned = true;
3813
+ }
3814
+
29513815 EditSelection(false);
29523816 } else
29533817 if (source == uneditButton)
....@@ -2957,10 +3821,11 @@
29573821 Object3D child = (Object3D)e.nextElement();
29583822 if(child.editWindow != null)
29593823 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3824
+ child.pinned = false;
29603825 child.CloseUI();
29613826 listUI.remove(child);
29623827
2963
- child.editWindow = null; // ???????????
3828
+ //child.editWindow = null; // ???????????
29643829 }
29653830 objEditor.ctrlPanel.FlushUI();
29663831 //objEditor.jTree.clearSelection();
....@@ -2973,6 +3838,7 @@
29733838 //copy.ClearUI();
29743839 for (Object3D obj : listUI)
29753840 {
3841
+ obj.pinned = false;
29763842 obj.CloseUI();
29773843 }
29783844 listUI.clear();
....@@ -2982,7 +3848,7 @@
29823848 {
29833849 assert(copy == group);
29843850
2985
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3851
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
29863852
29873853 for (Object3D obj : listUI)
29883854 {
....@@ -3031,6 +3897,9 @@
30313897 }
30323898
30333899 copy = group;
3900
+
3901
+ SetUndoStates();
3902
+
30343903 //Globals.theRenderer.object = group;
30353904 if(!useclient)
30363905 {
....@@ -3046,20 +3915,46 @@
30463915 frontView.object = group;
30473916 sideView.object = group;
30483917 }
3049
- group.editWindow = this;
3918
+
3919
+// fix "+" issue
3920
+ //group.editWindow = this;
3921
+ group.manipWindow = this;
3922
+
30503923 /*
30513924 currentLayout = radio.layout;
30523925 if (currentLayout == null)
30533926 currentLayout = sevenButton;
30543927 */
30553928 radio.layout.doClick();
3929
+
3930
+ ClearUnpinned();
3931
+ //Grafreed.Assert(group != null);
3932
+ //Grafreed.Assert(group.selection != null);
3933
+ SetPinStates(group.selection == null || group.selection.size() > 0);
3934
+ if (group.selection == null || group.selection.size() == 1)
3935
+ EditSelection(false);
30563936 keepparent = group.parent;
30573937 // PARENT = NULL or not???
30583938 //group.parent = null; // ROOT
30593939 //group.attributes = -1;
30603940 ResetModel();
3941
+
3942
+ cameraView.requestFocusInWindow();
30613943 refreshContents(true);
3062
- }
3944
+ } else if (event.getSource() == editCameraItem)
3945
+ {
3946
+ cameraView.ProtectCamera();
3947
+ cameraView.repaint();
3948
+ return;
3949
+ } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton)
3950
+ {
3951
+ cameraView.RevertCamera();
3952
+ cameraView.repaint();
3953
+ return;
3954
+ // } else if (event.getSource() == textureButton)
3955
+ // {
3956
+ // return; // true;
3957
+ }
30633958 else
30643959 {
30653960 //return super.action(event, arg);
....@@ -3068,7 +3963,6 @@
30683963 }
30693964
30703965 boolean useclient = false;
3071
- cRadio radio;
30723966
30733967 void ToggleRoot()
30743968 {
....@@ -3120,6 +4014,28 @@
31204014 refreshContents();
31214015 }
31224016
4017
+ void TransformChildren()
4018
+ {
4019
+ Object3D obj;
4020
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
4021
+ {
4022
+ obj = (Object3D)e.nextElement();
4023
+ obj.KeepTextureMatrices();
4024
+ obj.TransformChildren();
4025
+ obj.RestoreTextureMatrices();
4026
+
4027
+// if (obj.parent == null)
4028
+// {
4029
+// System.out.println("NULL PARENT!");
4030
+// new Exception().printStackTrace();
4031
+// }
4032
+// else
4033
+// TouchTransform(obj);
4034
+// //obj.parent.Touch();
4035
+ }
4036
+
4037
+ refreshContents();
4038
+ }
31234039
31244040 void ResetTransform()
31254041 {
....@@ -3232,7 +4148,7 @@
32324148 refreshContents();
32334149 }
32344150
3235
- void ResetCentroid()
4151
+ void ResetCentroid(boolean full)
32364152 {
32374153 Object3D obj;
32384154 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3247,12 +4163,16 @@
32474163 LA.matIdentity(Object3D.mat);
32484164 obj.getBounds(minima, maxima, false);
32494165 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3250
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
4166
+ if (full)
4167
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
32514168 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
32524169 obj.TransformMesh(Object3D.mat);
4170
+
32534171 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3254
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
4172
+ if (full)
4173
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
32554174 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
4175
+
32564176 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
32574177 //Object3D.mat[3][0] = -Object3D.mat[3][0];
32584178 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3281,7 +4201,8 @@
32814201
32824202 int size = obj.MemorySize();
32834203
3284
- System.err.println((size/1024) + " KB is the size of " + obj);
4204
+ //System.err.println((size/1024) + " KB is the size of " + obj);
4205
+ System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)");
32854206 }
32864207 }
32874208 catch (Exception e)
....@@ -3318,9 +4239,9 @@
33184239 obj = (Object3D)e.nextElement();
33194240
33204241 System.out.println("Object is: " + obj);
3321
- GrafreeD.AnalyzeObject(obj);
4242
+ Grafreed.AnalyzeObject(obj);
33224243 System.out.println("Boundary rep: " + obj.bRep);
3323
- GrafreeD.AnalyzeObject(obj.bRep);
4244
+ Grafreed.AnalyzeObject(obj.bRep);
33244245
33254246 // System.err.println((size/1024) + " KB is the size of " + obj);
33264247 }
....@@ -3362,6 +4283,13 @@
33624283 void GenNormals(boolean crease)
33634284 {
33644285 group.GenNormalsS(crease);
4286
+
4287
+ refreshContents();
4288
+ }
4289
+
4290
+ void GenNormalsMESH()
4291
+ {
4292
+ group.GenNormalsMeshS();
33654293
33664294 refreshContents();
33674295 }
....@@ -3534,8 +4462,8 @@
35344462
35354463 void ParseVertices()
35364464 {
3537
- boolean epsequal = GrafreeD.epsequal;
3538
- GrafreeD.epsequal = true;
4465
+ boolean epsequal = Grafreed.epsequal;
4466
+ Grafreed.epsequal = true;
35394467
35404468 for (int i=0; i<group.selection.size(); i++)
35414469 {
....@@ -3560,7 +4488,7 @@
35604488 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
35614489 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
35624490
3563
- g.add(GrafreeD.clipboard);
4491
+ g.add(Grafreed.clipboard);
35644492
35654493 buffer.add(g);
35664494 }
....@@ -3575,7 +4503,7 @@
35754503 makeSomething(buffer, i==group.selection.size()-1);
35764504 }
35774505
3578
- GrafreeD.epsequal = epsequal;
4506
+ Grafreed.epsequal = epsequal;
35794507
35804508 refreshContents();
35814509 }
....@@ -3593,7 +4521,16 @@
35934521 String pigment = Object3D.GetPigment(tex);
35944522 //String bump = Object3D.GetBump(tex);
35954523
3596
- com.sun.opengl.util.texture.TextureData texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
4524
+ com.sun.opengl.util.texture.TextureData texturedata = null;
4525
+
4526
+ try
4527
+ {
4528
+ texturedata = Globals.theRenderer.GetTextureData(tex, false, node.texres);
4529
+ }
4530
+ catch (Exception e)
4531
+ {
4532
+ System.err.println("FAIL: " + node);
4533
+ }
35974534
35984535 double s = v.s;
35994536
....@@ -3725,7 +4662,7 @@
37254662 return;
37264663
37274664 Object3D poses = group.selection.get(0);
3728
- Object3D ref = GrafreeD.clipboard.get(0);
4665
+ Object3D ref = Grafreed.clipboard.get(0);
37294666
37304667 Object3D newgroup = new Object3D("Po:" + poses.name);
37314668
....@@ -3919,9 +4856,9 @@
39194856
39204857 void ClipMesh()
39214858 {
3922
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
4859
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
39234860 {
3924
- Object3D content = GrafreeD.clipboard.get(0);
4861
+ Object3D content = Grafreed.clipboard.get(0);
39254862
39264863 if (content instanceof cGroup && ((cGroup)content).transientlink )
39274864 content = ((cGroup)content).get(0);
....@@ -3930,7 +4867,7 @@
39304867 // {
39314868 // group.selection.get(i).ClipMesh(GrafreeD.clipboard);
39324869 // }
3933
- group.selection.ClipMesh(GrafreeD.clipboard);
4870
+ group.selection.ClipMesh(Grafreed.clipboard);
39344871 }
39354872 // group.selection.ClipMesh(GrafreeD.clipboard);
39364873 System.out.println("DONE.");
....@@ -3977,6 +4914,18 @@
39774914 void MarkLeaves(boolean hide)
39784915 {
39794916 group.selection.MarkLeaves(hide);
4917
+ refreshContents();
4918
+ }
4919
+
4920
+ void RewindLeaves(boolean hide)
4921
+ {
4922
+ group.selection.RewindLeaves(hide);
4923
+ refreshContents();
4924
+ }
4925
+
4926
+ void RandomLeaves(boolean hide)
4927
+ {
4928
+ group.selection.RandomLeaves(hide);
39804929 refreshContents();
39814930 }
39824931
....@@ -4051,28 +5000,25 @@
40515000 // }
40525001 // }
40535002
4054
- static boolean allparams = true;
4055
-
4056
- static Vector<Object3D> listUI = new Vector<Object3D>();
4057
-
40585003 void EditSelection(boolean newWindow)
40595004 {
5005
+ if (group.selection == null)
5006
+ {
5007
+ EditElement(group, newWindow); // ? new
5008
+ return;
5009
+ }
5010
+
40605011 // aConstraints.gridy = 0;
40615012 for (int i=0; i<group.selection.size(); i++)
40625013 {
40635014 //System.out.println("edit : " + objectPanel.indexOfTab("Material"));
40645015 //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false);
4065
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
5016
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
40665017
40675018 Object3D elem = (Object3D)group.selection.elementAt(i);
4068
- if(elem != group)
5019
+ if(elem != group || !newWindow)
40695020 {
4070
- // if (!(elem instanceof Composite))
4071
- // newWindow = false;
4072
- listUI.add(elem);
4073
- elem.openEditWindow(this, newWindow); //, false);
4074
- System.out.println("edit : " + elem);
4075
- elem.editWindow.refreshContents(true); // ? new
5021
+ EditElement(elem, newWindow); // ? new
40765022 }
40775023 }
40785024 }
....@@ -4147,7 +5093,8 @@
41475093 //new Exception().printStackTrace();
41485094
41495095 freezemodel = true;
4150
-
5096
+ ClearUnpinned();
5097
+
41515098 /**/
41525099 //switch (event.id)
41535100 {
....@@ -4155,7 +5102,6 @@
41555102 //case 702: // Event.LIST_DESELECT
41565103 group.deselectAll();
41575104 TreePath tps[] = objEditor.jTree.getSelectionPaths();
4158
- objEditor.ClearInfo(); // .GetMaterial());
41595105 if (tps != null)
41605106 {
41615107 for (int i=0; i < tps.length; i++)
....@@ -4164,10 +5110,8 @@
41645110
41655111 //if (child.parent != null)
41665112 //child.parent.addSelectee(child);
5113
+ objEditor.SetMaterial(child);
41675114 group.addSelectee(child);
4168
- objEditor.SetMaterial(child); // .GetMaterial());
4169
- objEditor.AddInfo(child, this, true); // .GetMaterial());
4170
- System.err.println("info : " + child.GetPath());
41715115 }
41725116 }
41735117 // else
....@@ -4177,20 +5121,28 @@
41775121 // System.err.println("info : " + group.GetPath());
41785122 // }
41795123
4180
- objEditor.SetText(); // jan 2014
4181
-
4182
- if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
5124
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera))
41835125 CameraPane.flash = true;
41845126
4185
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
5127
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
41865128 // a camera
41875129 {
4188
- CameraPane.camerachangeframe = 0; // don't refuse it
4189
- Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
5130
+ if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crash the camera because of invalid lightspace
5131
+ {
5132
+ CameraPane.camerachangeframe = 0; // don't refuse it
5133
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
5134
+ }
41905135 // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
41915136 // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
41925137 }
41935138
5139
+ if (tps != null && tps.length == 1)
5140
+ {
5141
+ EditSelection(false);
5142
+ }
5143
+
5144
+ SetPinStates(tps != null && tps.length > 0);
5145
+
41945146 refreshContents();
41955147 //return true;
41965148 }
....@@ -4199,6 +5151,35 @@
41995151
42005152 freezemodel = false;
42015153 }
5154
+
5155
+ void SetPinStates(boolean enabled)
5156
+ {
5157
+ editButton.setEnabled(enabled);
5158
+ uneditButton.setEnabled(enabled);
5159
+ unselectButton.setEnabled(enabled);
5160
+ flashSelectionButton.setEnabled(enabled);
5161
+ }
5162
+
5163
+ void refreshContents(boolean cp)
5164
+ {
5165
+ if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info"))
5166
+ if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING)
5167
+ {
5168
+ objEditor.ClearInfo(); // .GetMaterial());
5169
+
5170
+ for (int i=0; i < group.selection.Size(); i++)
5171
+ {
5172
+ Object3D child = (Object3D) group.selection.get(i);
5173
+
5174
+ objEditor.AddInfo(child, this, true);
5175
+ System.err.println("info : " + child.GetPath());
5176
+ }
5177
+
5178
+ objEditor.SetText(); // jan 2014
5179
+ }
5180
+
5181
+ super.refreshContents(cp);
5182
+ }
42025183
42035184 void linkSomething(Object3D thing)
42045185 {
....@@ -4270,16 +5251,19 @@
42705251 {
42715252 if (group.selection.isEmpty())
42725253 return;
4273
- GrafreeD.clipboardIsTempGroup = false;
5254
+
5255
+ Grafreed.clipboardIsTempGroup = false;
42745256 Composite tGroup = null;
42755257 if (group.selection.size() > 0) // 1)
42765258 {
42775259 tGroup = new cGroup();
4278
- GrafreeD.clipboardIsTempGroup = true;
5260
+ Grafreed.clipboardIsTempGroup = true;
42795261 }
42805262
42815263 if (cut)
42825264 {
5265
+// if (Globals.SAVEONMAKE) // Moved to the clipboard, no need to save.
5266
+// Save();
42835267 //int indices[] = jList.getSelectedIndices();
42845268 //for (int i = indices.length - 1; i >= 0; i--)
42855269 //jList.remove(indices[i]);
....@@ -4315,16 +5299,16 @@
43155299 //System.out.println("cut " + child);
43165300 //System.out.println("parent = " + child.parent);
43175301 // tmp.addChild(child);
4318
- if (GrafreeD.clipboardIsTempGroup)
5302
+ if (Grafreed.clipboardIsTempGroup)
43195303 tGroup.add/*Child*/(tmp);
43205304 else
4321
- GrafreeD.clipboard = tmp;
5305
+ Grafreed.clipboard = tmp;
43225306 }
43235307 else
4324
- if (GrafreeD.clipboardIsTempGroup)
5308
+ if (Grafreed.clipboardIsTempGroup)
43255309 tGroup.add/*Child*/(child);
43265310 else
4327
- GrafreeD.clipboard = child;
5311
+ Grafreed.clipboard = child;
43285312 }
43295313
43305314 //ResetModel();
....@@ -4356,21 +5340,23 @@
43565340 //System.out.println("cut " + elem);
43575341 //System.out.println("parent = " + elem.parent);
43585342 // tmp.addChild(elem);
4359
- if (GrafreeD.clipboardIsTempGroup)
5343
+ if (Grafreed.clipboardIsTempGroup)
43605344 tGroup.add/*Child*/(tmp);
43615345 else
4362
- GrafreeD.clipboard = tmp;
5346
+ Grafreed.clipboard = tmp;
43635347 }
43645348 else
4365
- if (GrafreeD.clipboardIsTempGroup)
5349
+ if (Grafreed.clipboardIsTempGroup)
43665350 tGroup.add/*Child*/(child);
43675351 else
4368
- GrafreeD.clipboard = child;
5352
+ Grafreed.clipboard = child;
43695353 }
43705354
43715355 }
4372
- if (GrafreeD.clipboardIsTempGroup)
4373
- GrafreeD.clipboard = tGroup;
5356
+
5357
+ if (Grafreed.clipboardIsTempGroup)
5358
+ Grafreed.clipboard = tGroup;
5359
+
43745360 if (cut)
43755361 {
43765362 ResetModel();
....@@ -4380,11 +5366,15 @@
43805366
43815367 void paste(boolean expand)
43825368 {
5369
+ if (Globals.REPLACEONMAKE)
5370
+ Save();
5371
+ boolean keep = Globals.REPLACEONMAKE;
5372
+ Globals.REPLACEONMAKE = false;
43835373 // if (GrafreeD.clipboard == null)
43845374 // return;
43855375 boolean first = true;
43865376
4387
- if (GrafreeD.clipboardIsTempGroup)
5377
+ if (Grafreed.clipboardIsTempGroup)
43885378 {
43895379 Composite temp;
43905380
....@@ -4395,7 +5385,7 @@
43955385 temp = (Composite)Applet3D.clipboard.deepCopy();
43965386 */
43975387 Object3D elem;
4398
- for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
5388
+ for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
43995389 {
44005390 Object3D child = (Object3D)e.nextElement();
44015391
....@@ -4429,16 +5419,17 @@
44295419 //Object3D cb = Applet3D.clipboard;
44305420 //temp.addChild(cb);
44315421 //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0));
4432
- assert(GrafreeD.clipboard.parent == null);
4433
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
4434
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
4435
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
4436
- makeSomething(expand?GrafreeD.clipboard.get(0).copyExpand():GrafreeD.clipboard.get(0).deepCopy());
5422
+ assert(Grafreed.clipboard.parent == null);
5423
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
5424
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
5425
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
5426
+ makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy());
44375427 else
4438
- makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4439
- GrafreeD.clipboard.get(0).parent = keepparent;
5428
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
5429
+ Grafreed.clipboard.get(0).parent = keepparent;
44405430 }
44415431
5432
+ Globals.REPLACEONMAKE = keep;
44425433 ResetModel();
44435434 refreshContents();
44445435 }
....@@ -4485,9 +5476,9 @@
44855476 {
44865477 boolean first = true;
44875478
4488
- if (GrafreeD.clipboardIsTempGroup)
5479
+ if (Grafreed.clipboardIsTempGroup)
44895480 {
4490
- Composite temp = (Composite)GrafreeD.clipboard;
5481
+ Composite temp = (Composite)Grafreed.clipboard;
44915482 Object3D copy;
44925483 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
44935484 {
....@@ -4497,7 +5488,7 @@
44975488 }
44985489 } else
44995490 {
4500
- linkSomething(GrafreeD.clipboard); //.get(0));
5491
+ linkSomething(Grafreed.clipboard); //.get(0));
45015492 }
45025493 }
45035494 }
....@@ -4574,6 +5565,10 @@
45745565
45755566 void group(Object3D csg, boolean grab)
45765567 {
5568
+ if (Globals.REPLACEONMAKE)
5569
+ Save();
5570
+ boolean keep = Globals.REPLACEONMAKE;
5571
+ Globals.REPLACEONMAKE = false;
45775572 if (//false) // why??
45785573 !group.selection.isEmpty())
45795574 {
....@@ -4687,10 +5682,15 @@
46875682 //node.add(csg);
46885683 //makeSomething(node);
46895684 makeSomething(csg);
5685
+ Globals.REPLACEONMAKE = keep;
46905686 }
46915687
46925688 void Ungroup(Object3D g)
46935689 {
5690
+ if (Globals.REPLACEONMAKE)
5691
+ Save();
5692
+ boolean keep = Globals.REPLACEONMAKE;
5693
+ Globals.REPLACEONMAKE = false;
46945694 if (g instanceof HiddenObject)
46955695 {
46965696 HiddenObject h = (HiddenObject) g;
....@@ -4707,6 +5707,7 @@
47075707 objEditor.makeSomething(g.get(i), false);
47085708 }
47095709 }
5710
+ Globals.REPLACEONMAKE = keep;
47105711 }
47115712
47125713 void ungroup()
....@@ -4902,21 +5903,6 @@
49025903 }
49035904 */
49045905
4905
- void ImportGFD()
4906
- {
4907
- FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD);
4908
- browser.show();
4909
- String filename = browser.getFile();
4910
- if (filename != null && filename.length() > 0)
4911
- {
4912
- String fullname = browser.getDirectory() + filename;
4913
-
4914
- //Object3D readobj =
4915
- objEditor.ReadGFD(fullname, objEditor);
4916
- //makeSomething(readobj);
4917
- }
4918
- }
4919
-
49205906 /*
49215907 public void Callback(Object obj)
49225908 {
....@@ -4940,26 +5926,9 @@
49405926 }
49415927 */
49425928
4943
- void ImportVRMLX3D()
4944
- {
4945
- if (GrafreeD.standAlone)
4946
- {
4947
- /**/
4948
- FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
4949
- browser.show();
4950
- String filename = browser.getFile();
4951
- if (filename != null && filename.length() > 0)
4952
- {
4953
- String fullname = browser.getDirectory() + filename;
4954
- LoadVRMLX3D(fullname);
4955
- }
4956
- /**/
4957
- }
4958
- }
4959
-
49605929 String GetFile(String dialogName)
49615930 {
4962
- if (GrafreeD.standAlone)
5931
+ if (Grafreed.standAlone)
49635932 {
49645933 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
49655934 browser.show();
....@@ -5027,7 +5996,44 @@
50275996 cButton clearpanelButton;
50285997 cButton unselectButton;
50295998
5999
+ cButton restoreCameraButton;
6000
+
6001
+ cButton saveButton;
50306002 cButton oneStepButton;
6003
+
6004
+ cButton groupButton;
6005
+ cButton ungroupButton;
6006
+ cButton compositeButton;
6007
+ cButton switchButton;
6008
+ cButton loopButton;
6009
+ cButton textureButton;
6010
+
6011
+ cButton skybox1Button;
6012
+ cButton skybox2Button;
6013
+ cButton skybox3Button;
6014
+ cButton skybox4Button;
6015
+ cButton skybox5Button;
6016
+ cButton skybox6Button;
6017
+ cButton skybox7Button;
6018
+
6019
+ cButton skybox11Button;
6020
+ cButton skybox12Button;
6021
+ cButton skybox13Button;
6022
+ cButton skybox14Button;
6023
+ cButton skybox15Button;
6024
+ cButton skybox16Button;
6025
+ cButton skybox17Button;
6026
+
6027
+ cButton gridButton;
6028
+ cButton boxButton;
6029
+ cButton sphereButton;
6030
+ cButton coneButton;
6031
+ cButton torusButton;
6032
+ cButton superButton;
6033
+ cButton kleinButton;
6034
+ cButton particlesButton;
6035
+ cButton overlayButton;
6036
+ cButton lightButton;
50316037
50326038 cButton screenfitButton;
50336039 cButton screenfitpointButton;
....@@ -5040,14 +6046,6 @@
50406046
50416047 cButton setsupportButton;
50426048
5043
- cButton twoButton;
5044
- cButton sixButton;
5045
- cButton threeButton;
5046
- cButton sevenButton;
5047
- cButton fourButton; // full panel
5048
- cButton oneButton; // full XYZ
5049
- //cButton currentLayout;
5050
-
50516049 //
50526050 //Composite
50536051 Object3D // to do !!
....@@ -5057,9 +6055,11 @@
50576055 //JTree jTree;
50586056 private MenuItem lookAtItem;
50596057 private MenuItem lookFromItem;
5060
- private MenuItem switchItem;
6058
+ private MenuItem switchViewItem;
50616059 private MenuItem cutItem;
5062
- private MenuItem duplicateItem;
6060
+ private MenuItem undoItem;
6061
+ private MenuItem redoItem;
6062
+ private JMenuItem duplicateItem;
50636063 private MenuItem cloneItem;
50646064 private MenuItem cloneSupportItem;
50656065 private MenuItem overwriteGeoItem;
....@@ -5072,7 +6072,7 @@
50726072 private MenuItem linkverticesItem;
50736073 private MenuItem relinkverticesItem;
50746074 private MenuItem setMasterItem;
5075
- private MenuItem resetMeshItem;
6075
+ private MenuItem resetAllItem;
50766076 private MenuItem stepAllItem;
50776077 private MenuItem revertMeshItem;
50786078 private MenuItem poseMeshItem;
....@@ -5087,7 +6087,7 @@
50876087 private MenuItem pasteLinkItem;
50886088 private MenuItem pasteCloneItem;
50896089 private MenuItem pasteExpandItem;
5090
- private MenuItem clearItem;
6090
+ private MenuItem deleteItem;
50916091 private MenuItem clearAllItem;
50926092 private MenuItem genUVItem;
50936093 private MenuItem genNormalsMESHItem;
....@@ -5122,6 +6122,10 @@
51226122 private MenuItem showleavesItem;
51236123 private MenuItem markleavesItem;
51246124 private MenuItem unmarkleavesItem;
6125
+ private MenuItem rewindleavesItem;
6126
+ private MenuItem unrewindleavesItem;
6127
+ private MenuItem randomleavesItem;
6128
+ private MenuItem unrandomleavesItem;
51256129
51266130 private MenuItem flipVItem;
51276131 private MenuItem unflipVItem;
....@@ -5133,15 +6137,17 @@
51336137 private MenuItem panoTexturesItem;
51346138
51356139 private MenuItem resetCentroidItem;
5136
- private MenuItem transformgeometryItem;
6140
+ private MenuItem resetCentroidXZItem;
51376141 private MenuItem resetTransformItem;
6142
+ private MenuItem transformGeometryItem;
6143
+ private MenuItem transformChildrenItem;
51386144 private MenuItem hideItem;
51396145 private MenuItem grabItem;
51406146 private MenuItem backItem;
51416147 private MenuItem frontItem;
51426148 private MenuItem cameraItem;
51436149 private MenuItem compositeItem;
5144
- private MenuItem randomItem;
6150
+ private MenuItem switchItem;
51456151 private MenuItem physicsItem;
51466152 private MenuItem frameselectorItem;
51476153 private MenuItem scriptNodeItem;
....@@ -5165,6 +6171,8 @@
51656171 private MenuItem attachBumpItem;
51666172 private MenuItem detachBumpItem;
51676173 private MenuItem pigmentBumpItem;
6174
+ private MenuItem embedTexturesItem;
6175
+ private MenuItem deEmbedTexturesItem;
51686176
51696177 private MenuItem particleItem;
51706178 private MenuItem ragdollItem;
....@@ -5203,11 +6211,6 @@
52036211 private MenuItem doubleItem;
52046212 private MenuItem tripleItem;
52056213
5206
- private MenuItem importGFDItem;
5207
- private MenuItem importVRMLX3DItem;
5208
- private MenuItem import3DSItem;
5209
- private MenuItem importOBJItem;
5210
-
52116214 private MenuItem computeAOItem;
52126215 private MenuItem recompileItem;
52136216 private MenuItem editScriptItem;
....@@ -5217,4 +6220,8 @@
52176220 private MenuItem analyzeItem;
52186221 private MenuItem dumpItem;
52196222 //boolean freezemodel = false;
6223
+
6224
+ Menu cameraMenu;
6225
+ MenuItem editCameraItem;
6226
+ MenuItem restoreCameraItem;
52206227 }