Normand Briere
2019-08-04 0c85af6e46f48b7425d59fc776b193c06a4a1f52
GroupEditor.java
....@@ -23,6 +23,302 @@
2323 DragGestureListener, DragSourceListener, DropTargetListener,
2424 ItemListener // ListSelectionListener
2525 {
26
+
27
+ public void AddSkyboxButton(String f, String s, cGridBag row)
28
+ {
29
+ cButton skyboxButton;
30
+ final String path = "cubemaps/" + f + "-skyboxes/" + s;
31
+ row.add(skyboxButton = GetButton(path + "/preview.jpg", !Grafreed.NIMBUSLAF));
32
+ //row.add(skyboxButton = GetButton(path + "/negx.jpg", !Grafreed.NIMBUSLAF));
33
+ skyboxButton.setToolTipText(s);
34
+ skyboxButton.addActionListener(new ActionListener()
35
+ {
36
+ @Override
37
+ public void actionPerformed(ActionEvent e)
38
+ {
39
+ ChangeSkybox(path);
40
+ }
41
+ });
42
+ }
43
+
44
+ public void AddSkyboxTab0(JTabbedPane skyboxpanel)
45
+ {
46
+ cGridBag tab0 = new cGridBag().setVertical(true);
47
+
48
+ tab0.setName("Urban");
49
+ skyboxpanel.add(tab0);
50
+
51
+ cGridBag row0 = new cGridBag();
52
+ cGridBag row1 = new cGridBag();
53
+ cGridBag row2 = new cGridBag();
54
+ cGridBag row3 = new cGridBag();
55
+ cGridBag row4 = new cGridBag();
56
+ cGridBag row5 = new cGridBag();
57
+ cGridBag row6 = new cGridBag();
58
+
59
+ AddSkyboxButton("default", "rgb", row0);
60
+ //AddSkyboxButton("default", "cornell", row0);
61
+ AddSkyboxButton("penguins", "dust", row0);
62
+ AddSkyboxButton("penguins", "tropic", row0);
63
+ AddSkyboxButton("penguins", "yonder", row0);
64
+
65
+ AddSkyboxButton("default", "uffizi", row1);
66
+ AddSkyboxButton("bridge", "Bridge", row1);
67
+ AddSkyboxButton("bridge", "Bridge2", row1);
68
+ AddSkyboxButton("urban", "GamlaStan2", row1);
69
+
70
+ AddSkyboxButton("urban", "Parliament", row2);
71
+ AddSkyboxButton("urban", "Roundabout", row2);
72
+ AddSkyboxButton("urban", "SaintLazarusChurch", row2);
73
+ AddSkyboxButton("urban", "SaintLazarusChurch2", row2);
74
+
75
+ AddSkyboxButton("urban", "SaintLazarusChurch3", row3);
76
+ AddSkyboxButton("urban", "UnionSquare", row3);
77
+ AddSkyboxButton("urban", "Medborgarplatsen", row3);
78
+ AddSkyboxButton("park", "BerzeliiPark", row3);
79
+
80
+ AddSkyboxButton("park", "Buddha", row4);
81
+ AddSkyboxButton("park", "CNTower2", row4);
82
+ AddSkyboxButton("park", "NiagaraFalls1", row4);
83
+ AddSkyboxButton("park", "NiagaraFalls3", row4);
84
+
85
+ AddSkyboxButton("park", "Park", row5);
86
+ AddSkyboxButton("park", "Pond", row5);
87
+ AddSkyboxButton("park", "Skansen", row5);
88
+ AddSkyboxButton("park", "Skansen2", row5);
89
+
90
+ AddSkyboxButton("park", "Skansen3", row6);
91
+ AddSkyboxButton("park", "Skansen4", row6);
92
+ AddSkyboxButton("park", "Skansen5", row6);
93
+ AddSkyboxButton("persson", "VancouverConventionCentre", row6);
94
+
95
+ tab0.add(row0);
96
+ tab0.add(row1);
97
+ tab0.add(row2);
98
+ tab0.add(row3);
99
+ tab0.add(row4);
100
+ tab0.add(row5);
101
+ tab0.add(row6);
102
+
103
+ for (int i=5; --i>=0;)
104
+ {
105
+ //oe.toolboxPanel.Return();
106
+ //tab0.add(new cGridBag());
107
+ }
108
+ }
109
+
110
+ public void AddSkyboxTab1(JTabbedPane skyboxpanel)
111
+ {
112
+ cGridBag tab0 = new cGridBag().setVertical(true);
113
+
114
+ tab0.setName("Nature");
115
+ skyboxpanel.add(tab0);
116
+
117
+ cGridBag row0 = new cGridBag();
118
+ cGridBag row1 = new cGridBag();
119
+ cGridBag row2 = new cGridBag();
120
+ cGridBag row3 = new cGridBag();
121
+ cGridBag row4 = new cGridBag();
122
+ cGridBag row5 = new cGridBag();
123
+ cGridBag row6 = new cGridBag();
124
+
125
+ AddSkyboxButton("beach", "HeartInTheSand", row0);
126
+ AddSkyboxButton("beach", "LarnacaBeach", row0);
127
+ AddSkyboxButton("beach", "PalmTrees", row0);
128
+ AddSkyboxButton("beach", "Tenerife", row0);
129
+
130
+ AddSkyboxButton("beach", "Tenerife2", row1);
131
+ AddSkyboxButton("beach", "Tenerife3", row1);
132
+ AddSkyboxButton("field", "FishPond", row1);
133
+ AddSkyboxButton("field", "Footballfield", row1);
134
+
135
+ AddSkyboxButton("field", "Meadow", row2);
136
+ AddSkyboxButton("field", "Sorsele", row2);
137
+ AddSkyboxButton("field", "Sorsele2", row2);
138
+ AddSkyboxButton("field", "Sorsele3", row2);
139
+
140
+ AddSkyboxButton("forest", "Brudslojan", row3);
141
+ AddSkyboxButton("forest", "Langholmen2", row3);
142
+ AddSkyboxButton("forest", "Plants", row3);
143
+ AddSkyboxButton("mountain", "Maskonaive", row3);
144
+
145
+ AddSkyboxButton("mountain", "Maskonaive2", row4);
146
+ AddSkyboxButton("mountain", "Maskonaive3", row4);
147
+ AddSkyboxButton("mountain", "Teide", row4);
148
+ AddSkyboxButton("park", "Tantolunden4", row4);
149
+
150
+ AddSkyboxButton("park", "Stairs", row5);
151
+ AddSkyboxButton("default", "skycube", row6);
152
+ AddSkyboxButton("rocky", "Langholmen", row5);
153
+ AddSkyboxButton("rocky", "Skinnarviksberget", row5);
154
+
155
+ AddSkyboxButton("rocky", "Tantolunden6", row5);
156
+ AddSkyboxButton("default", "CloudyHills", row6);
157
+ AddSkyboxButton("daz", "Autumn", row6);
158
+ AddSkyboxButton("daz", "MountainTrail", row6);
159
+ /*
160
+Autumn
161
+Greenlands
162
+MountainTrail
163
+Oasis
164
+TheRock
165
+TopOfTheWorld
166
+Winter
167
+ */
168
+
169
+ tab0.add(row0);
170
+ tab0.add(row1);
171
+ tab0.add(row2);
172
+ tab0.add(row3);
173
+ tab0.add(row4);
174
+ tab0.add(row5);
175
+ tab0.add(row6);
176
+
177
+ for (int i=5; --i>=0;)
178
+ {
179
+ //oe.toolboxPanel.Return();
180
+ //tab0.add(new cGridBag());
181
+ }
182
+ }
183
+
184
+ public void AddSkyboxTab2(JTabbedPane skyboxpanel)
185
+ {
186
+ cGridBag tab0 = new cGridBag().setVertical(true);
187
+
188
+ tab0.setName("Night");
189
+ skyboxpanel.add(tab0);
190
+
191
+ cGridBag row0 = new cGridBag();
192
+ cGridBag row1 = new cGridBag();
193
+ cGridBag row2 = new cGridBag();
194
+ cGridBag row3 = new cGridBag();
195
+ cGridBag row4 = new cGridBag();
196
+ cGridBag row5 = new cGridBag();
197
+ cGridBag row6 = new cGridBag();
198
+
199
+ AddSkyboxButton("night", "NightPath", row0);
200
+ AddSkyboxButton("night", "PondNight", row0);
201
+ AddSkyboxButton("night", "Powerlines", row0);
202
+ AddSkyboxButton("night", "SwedishRoyalCastle", row0);
203
+
204
+ AddSkyboxButton("urban", "CNTower", row1);
205
+ AddSkyboxButton("bridge", "ArstaBridge", row1);
206
+ AddSkyboxButton("rocky", "Riddarfjarden", row1);
207
+ AddSkyboxButton("penguins", "sleepyhollow", row1);
208
+
209
+ AddSkyboxButton("penguins", "kenon_star", row2);
210
+ AddSkyboxButton("persson", "corona", row2);
211
+ AddSkyboxButton("persson", "spaceskybox", row2);
212
+ AddSkyboxButton("indoors", "Vasa", row2);
213
+
214
+ AddSkyboxButton("winter", "Backyard", row3);
215
+ AddSkyboxButton("winter", "Creek", row3);
216
+ AddSkyboxButton("winter", "FootballField3", row3);
217
+ AddSkyboxButton("winter", "Forest", row3);
218
+
219
+ AddSkyboxButton("winter", "HornstullsStrand2", row4);
220
+ AddSkyboxButton("winter", "House", row4);
221
+ AddSkyboxButton("winter", "IceLake", row4);
222
+ AddSkyboxButton("winter", "IceRiver", row4);
223
+
224
+ AddSkyboxButton("winter", "Park3", row5);
225
+ AddSkyboxButton("winter", "PondWinter", row5);
226
+ AddSkyboxButton("winter", "Tantolunden5", row5);
227
+ AddSkyboxButton("winter", "Vindelalven", row5);
228
+
229
+ AddSkyboxButton("daz", "TheRock", row6);
230
+ AddSkyboxButton("daz", "TopOfTheWorld", row6);
231
+ AddSkyboxButton("daz", "Winter", row6);
232
+ AddSkyboxButton("mountain", "Ryfjallet", row6);
233
+
234
+ tab0.add(row0);
235
+ tab0.add(row1);
236
+ tab0.add(row2);
237
+ tab0.add(row3);
238
+ tab0.add(row4);
239
+ tab0.add(row5);
240
+ tab0.add(row6);
241
+
242
+ for (int i=5; --i>=0;)
243
+ {
244
+ //oe.toolboxPanel.Return();
245
+ //tab0.add(new cGridBag());
246
+ }
247
+ }
248
+
249
+ public void AddSkyboxTab3(JTabbedPane skyboxpanel)
250
+ {
251
+ cGridBag tab0 = new cGridBag().setVertical(true);
252
+
253
+ tab0.setName("Others");
254
+ skyboxpanel.add(tab0);
255
+
256
+ cGridBag row0 = new cGridBag();
257
+ cGridBag row1 = new cGridBag();
258
+ cGridBag row2 = new cGridBag();
259
+ cGridBag row3 = new cGridBag();
260
+ cGridBag row4 = new cGridBag();
261
+ cGridBag row5 = new cGridBag();
262
+ cGridBag row6 = new cGridBag();
263
+
264
+ AddSkyboxButton("mayhem", "afterrain", row0);
265
+ AddSkyboxButton("mayhem", "aqua4", row0);
266
+ AddSkyboxButton("mayhem", "aqua9", row0);
267
+ AddSkyboxButton("mayhem", "flame", row0);
268
+
269
+ AddSkyboxButton("mayhem", "h2s", row1);
270
+ AddSkyboxButton("mayhem", "prehistoric", row1);
271
+ AddSkyboxButton("mayhem", "scorched", row1);
272
+ AddSkyboxButton("penguins", "desertdawn", row1);
273
+
274
+ AddSkyboxButton("persson", "Citadella", row2);
275
+ AddSkyboxButton("persson", "Citadella2", row2);
276
+ AddSkyboxButton("persson", "clouds1", row2);
277
+ AddSkyboxButton("penguins", "wrath", row2);
278
+
279
+ AddSkyboxButton("persson", "FishermansBastion", row3);
280
+ AddSkyboxButton("persson", "HeroesSquare", row3);
281
+ AddSkyboxButton("indoors", "DallasW", row3);
282
+ AddSkyboxButton("indoors", "MarriottMadisonWest", row3);
283
+
284
+ AddSkyboxButton("persson", "LancellottiChapel", row4);
285
+ AddSkyboxButton("persson", "PereaBeach1", row4);
286
+ AddSkyboxButton("persson", "PereaBeach2", row4);
287
+ AddSkyboxButton("persson", "redeclipse", row4);
288
+
289
+ AddSkyboxButton("daz", "Greenlands", row5);
290
+ AddSkyboxButton("daz", "Oasis", row5);
291
+ AddSkyboxButton("elyvisions", "arch3", row5);
292
+ AddSkyboxButton("elyvisions", "calm_sea", row5);
293
+
294
+ AddSkyboxButton("elyvisions", "rainbow", row6);
295
+ AddSkyboxButton("elyvisions", "distant_sunset", row6);
296
+ AddSkyboxButton("elyvisions", "heaven", row6);
297
+ AddSkyboxButton("elyvisions", "hot", row6);
298
+
299
+ tab0.add(row0);
300
+ tab0.add(row1);
301
+ tab0.add(row2);
302
+ tab0.add(row3);
303
+ tab0.add(row4);
304
+ tab0.add(row5);
305
+ tab0.add(row6);
306
+
307
+ for (int i=5; --i>=0;)
308
+ {
309
+ //oe.toolboxPanel.Return();
310
+ //tab0.add(new cGridBag());
311
+ }
312
+ }
313
+
314
+ public void ChangeSkybox(String name)
315
+ {
316
+ //cameraView.envyoff = false;
317
+ group.skyboxname = name;
318
+ group.skyboxext = "jpg";
319
+ cameraView.repaint();
320
+ }
321
+
26322 //ObjEditor objEditor;
27323 public void closeUI2()
28324 {
....@@ -60,6 +356,12 @@
60356 this.copy = this.group = group;
61357 //selectees = this.group.selectees;
62358
359
+ if (copy.versionlist == null)
360
+ {
361
+ copy.versionlist = new Object3D[100];
362
+ copy.versionindex = -1;
363
+ }
364
+
63365 if(ui)
64366 SetupUI(objEditor);
65367 }
....@@ -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.versionlist == null)
387
+ {
388
+ copy.versionlist = new Object3D[100];
389
+ copy.versionindex = -1;
390
+
391
+ Save(true);
392
+ }
83393 }
84394
85395 void CloneSelection(boolean supports)
86396 {
397
+ if (Globals.REPLACEONMAKE)
398
+ Save();
399
+ boolean keep = Globals.REPLACEONMAKE;
400
+ Globals.REPLACEONMAKE = false;
87401 // Object3D keep = GrafreeD.clipboard;
88402 //Object3D obj;
89403 for (int i=0; i<group.selection.size(); i++)// Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -94,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,28 +463,21 @@
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);
174482 cloneItem = menu.add(new MenuItem("Clone"));
175483 cloneItem.addActionListener(this);
....@@ -185,7 +493,6 @@
185493 copyItem.addActionListener(this);
186494 pasteItem = menu.add(new MenuItem("Paste"));
187495 pasteItem.addActionListener(this);
188
- menu.add("-");
189496
190497 menu.add("-");
191498 pasteIntoItem = menu.add(new MenuItem("Paste into"));
....@@ -197,8 +504,8 @@
197504 // pasteExpandItem = menu.add(new MenuItem("Paste expand"));
198505 // pasteExpandItem.addActionListener(this);
199506 menu.add("-");
200
- clearItem = menu.add(new MenuItem("Clear"));
201
- clearItem.addActionListener(this);
507
+ deleteItem = menu.add(new MenuItem("Delete"));
508
+ deleteItem.addActionListener(this);
202509
203510 if (Globals.ADVANCED)
204511 {
....@@ -206,14 +513,97 @@
206513 clearAllItem = menu.add(new MenuItem("Clear All"));
207514 clearAllItem.addActionListener(this);
208515 }
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());
209552
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
+
210604 oe.menuBar.add(menu = new Menu("Setting"));
211605 if (Globals.ADVANCED)
212606 {
213
- resetMeshItem = menu.add(new MenuItem("Reset All"));
214
- resetMeshItem.addActionListener(this);
215
- stepAllItem = menu.add(new MenuItem("Step All"));
216
- stepAllItem.addActionListener(this);
217607 revertMeshItem = menu.add(new MenuItem("Revert Meshes"));
218608 revertMeshItem.addActionListener(this);
219609 resetreferencesItem = menu.add(new MenuItem("Reset Mesh References"));
....@@ -253,21 +643,29 @@
253643 }
254644
255645 oe.menuBar.add(menu = new Menu("Group"));
256
- grabItem = menu.add(new MenuItem("Grab"));
257
- grabItem.addActionListener(this);
646
+// grabItem = menu.add(new MenuItem("Grab"));
647
+// grabItem.addActionListener(this);
258648 backItem = menu.add(new MenuItem("Back"));
259649 backItem.addActionListener(this);
260650 frontItem = menu.add(new MenuItem("Front"));
261651 frontItem.addActionListener(this);
262
- compositeItem = menu.add(new MenuItem("Composite"));
263
- compositeItem.addActionListener(this);
652
+// compositeItem = menu.add(new MenuItem("Composite"));
653
+// compositeItem.addActionListener(this);
654
+
655
+ if (Globals.ADVANCED)
656
+ {
264657 hideItem = menu.add(new MenuItem("Hidden Group"));
265658 hideItem.addActionListener(this);
659
+ }
266660 ungroupItem = menu.add(new MenuItem("Ungroup"));
267661 ungroupItem.addActionListener(this);
268
- menu.add("-");
269
- randomItem = menu.add(new MenuItem("Switch node"));
270
- 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
+ {
271669 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
272670 switchGeoItem.addActionListener(this);
273671 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
....@@ -275,8 +673,6 @@
275673 morphItem = menu.add(new MenuItem("Morph Group"));
276674 morphItem.addActionListener(this);
277675
278
- if (Globals.ADVANCED)
279
- {
280676 menu.add("-");
281677 physicsItem = menu.add(new MenuItem("Physics"));
282678 physicsItem.addActionListener(this);
....@@ -284,30 +680,29 @@
284680 frameselectorItem.addActionListener(this);
285681 scriptNodeItem = menu.add(new MenuItem("Script Node"));
286682 scriptNodeItem.addActionListener(this);
287
- cameraItem = menu.add(new MenuItem("Camera"));
288
- cameraItem.addActionListener(this);
289683 }
290684
291685 oe.menuBar.add(menu = new Menu("Object"));
292
- textureItem = menu.add(new MenuItem("Texture"));
293
- textureItem.addActionListener(this);
686
+// textureItem = menu.add(new MenuItem("Texture"));
687
+// textureItem.addActionListener(this);
294688 billboardItem = menu.add(new MenuItem("Billboard"));
295689 billboardItem.addActionListener(this);
296690 csgItem = menu.add(new MenuItem("CSG"));
297691 csgItem.addActionListener(this);
298
- shadowXItem = menu.add(new MenuItem("Shadow X"));
692
+ shadowXItem = menu.add(new MenuItem("Shadow Red"));
299693 shadowXItem.addActionListener(this);
300
- shadowYItem = menu.add(new MenuItem("Shadow Y"));
694
+ shadowYItem = menu.add(new MenuItem("Shadow Green"));
301695 shadowYItem.addActionListener(this);
302
- shadowZItem = menu.add(new MenuItem("Shadow Z"));
696
+ shadowZItem = menu.add(new MenuItem("Shadow Blue"));
303697 shadowZItem.addActionListener(this);
698
+ attributeItem = menu.add(new MenuItem("Attribute"));
699
+ attributeItem.addActionListener(this);
700
+
304701 if (Globals.ADVANCED)
305702 {
306703 menu.add("-");
307704 linkerItem = menu.add(new MenuItem("Linker"));
308705 linkerItem.addActionListener(this);
309
- attributeItem = menu.add(new MenuItem("Attribute"));
310
- attributeItem.addActionListener(this);
311706 templateItem = menu.add(new MenuItem("Template"));
312707 templateItem.addActionListener(this);
313708 pointflowItem = menu.add(new MenuItem("Point Flow"));
....@@ -318,8 +713,12 @@
318713 resetTransformItem.addActionListener(this);
319714 resetCentroidItem = menu.add(new MenuItem("Reset Centroid"));
320715 resetCentroidItem.addActionListener(this);
321
- transformgeometryItem = menu.add(new MenuItem("Transform Geometry"));
322
- 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);
323722
324723 oe.menuBar.add(menu = new Menu("Geometry"));
325724 genUVItem = menu.add(new MenuItem("Generate UV"));
....@@ -332,7 +731,7 @@
332731 genNormalsMESHItem.addActionListener(this);
333732 if (Globals.ADVANCED)
334733 {
335
- genNormalsMINEItem = menu.add(new MenuItem("My Normals"));
734
+ genNormalsMINEItem = menu.add(new MenuItem("Stitch Normals"));
336735 genNormalsMINEItem.addActionListener(this);
337736 }
338737 stripifyItem = menu.add(new MenuItem("Stripify"));
....@@ -368,6 +767,10 @@
368767 oe.menuBar.add(menu = new Menu("Attributes"));
369768 clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
370769 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);
371774 menu.add("-");
372775 liveleavesItem = menu.add(new MenuItem("Live Leaves"));
373776 liveleavesItem.addActionListener(this);
....@@ -388,6 +791,14 @@
388791 markleavesItem.addActionListener(this);
389792 unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves"));
390793 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);
391802 menu.add("-");
392803 flipVItem = menu.add(new MenuItem("Flip V"));
393804 flipVItem.addActionListener(this);
....@@ -413,50 +824,56 @@
413824 attachBumpItem.addActionListener(this);
414825 pigmentBumpItem = menu.add(new MenuItem("Pigment -> Bump"));
415826 pigmentBumpItem.addActionListener(this);
827
+ //embedTexturesItem
416828 detachPigmentItem = menu.add(new MenuItem("Detach Pigment"));
417829 detachPigmentItem.addActionListener(this);
418830 detachBumpItem = menu.add(new MenuItem("Detach Bump"));
419831 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);
420836 menu.add("-");
421837 sortbysizeItem = menu.add(new MenuItem("Sort by size"));
422838 sortbysizeItem.addActionListener(this);
423839 sortbynameItem = menu.add(new MenuItem("Sort by name"));
424840 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);
425846 if (Globals.ADVANCED)
426847 {
427
- menu.add("-");
848
+ // Pretty much the same as duplicate and clone.
428849 extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
429850 extractGeometriesItem.addActionListener(this);
430851 cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry"));
431852 cloneGeometriesItem.addActionListener(this);
432
- shareGeometriesItem = menu.add(new MenuItem("Share Geometry"));
433
- shareGeometriesItem.addActionListener(this);
434
- mergeGeometriesItem = menu.add(new MenuItem("Merge Geometry"));
435
- mergeGeometriesItem.addActionListener(this);
436853 }
437854
438855 oe.menuBar.add(menu = new Menu("Insert"));
439856 buildCreateMenu(menu);
440857
441
- oe.menuBar.add(menu = new Menu("Include"));
442
- importOBJItem = menu.add(new MenuItem("OBJ file..."));
443
- importOBJItem.addActionListener(this);
444
- menu.add("-");
445
- import3DSItem = menu.add(new MenuItem("3DS file..."));
446
- import3DSItem.addActionListener(this);
447
- menu.add("-");
448
- importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D file..."));
449
- importVRMLX3DItem.addActionListener(this);
450
- menu.add("-");
451
- importGFDItem = menu.add(new MenuItem("GrafreeD file..."));
452
- importGFDItem.addActionListener(this);
453
-
454858 oe.menuBar.add(menu = new Menu("Tools"));
455859 buildToolsMenu(menu);
456860 }
457861
862
+
458863 void SetupUI2(ObjEditor oe)
459864 {
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
+
460877 //new Exception().printStackTrace();
461878
462879 oe.radioPanel = new JPanel(new GridBagLayout());
....@@ -485,97 +902,238 @@
485902 oe.radioPanel.add(dummyButton);
486903 oe.buttonGroup.add(dummyButton);
487904 */
905
+ cGridBag copyOptionsPanel = new cGridBag();
906
+
907
+ copyOptionsPanel.preferredHeight = 2;
908
+
488909 //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
489910
490
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints);
491
- 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("Duplicate current version");
936
+ saveButton.addActionListener(this);
937
+
938
+ copyOptionsPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
939
+ undoButton.setToolTipText("Previous version");
940
+ undoButton.addActionListener(this);
941
+ undoButton.setEnabled(false);
942
+
943
+ cGridBag updown = new cGridBag().setVertical(true);
944
+ updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
945
+ restoreButton.setToolTipText("Undo (restore current version)");
946
+ restoreButton.addActionListener(this);
947
+ restoreButton.setEnabled(false);
948
+
949
+ updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
950
+ replaceButton.setToolTipText("Save (replace current version)");
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");
492963 liveCB.addItemListener(this);
493964
494
- oe.toolbarPanel.add(oneStepButton = new cButton("Step", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
965
+ oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
495966 oneStepButton.setToolTipText("Animate one step forward");
496967 oneStepButton.addActionListener(this);
497968
498
- oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints);
969
+ oe.toolbarPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints);
499970 fastCB.setToolTipText("Fast mode");
500971 fastCB.addItemListener(this);
501972
502
- oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
503
- trackCB.setToolTipText("Enable tracking");
504
- trackCB.addItemListener(this);
505
-
506
- oe.toolbarPanel.add(screenfitButton = new cButton("@", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
507
- screenfitButton.setToolTipText("Screen fit");
508
- 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);
509978
510979 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
511980 // screenfitpointButton.addActionListener(this);
512981
513982 if (Globals.ADVANCED)
514983 {
515
- oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
984
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
516985 snapobjectButton.addActionListener(this);
517986 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");
518991 }
519992
520
- oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
521
- flashSelectionButton.setToolTipText("Show selection");
522
- flashSelectionButton.addActionListener(this);
993
+ //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
523994
524
- oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
525
-
526
- oe.toolbarPanel.add(twoButton = new cButton("|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
527
- 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");
528997 twoButton.addActionListener(this);
529
- oe.toolbarPanel.add(fourButton = new cButton("+||", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
530
- fourButton.addActionListener(this);
531
- fourButton.setToolTipText("Show left panel only");
532
- oe.toolbarPanel.add(sixButton = new cButton("+|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
533
- sixButton.setToolTipText("2-column layout left");
534
- sixButton.addActionListener(this);
535
- oe.toolbarPanel.add(threeButton = new cButton("|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
536
- 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");
5371002 threeButton.addActionListener(this);
538
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
539
- sevenButton.setToolTipText("3-column layout");
540
- 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);
5411009 //
5421010
543
- oe.toolbarPanel.add(rootButton = new cButton("o o o", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
544
- 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");
5451013 rootButton.addActionListener(this);
5461014
547
- 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);
5481016 closeButton.setToolTipText("Close tab");
5491017 closeButton.addActionListener(this);
5501018 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
5511019 //clearButton.addActionListener(this);
552
-
553
- cGridBag commandsPanel = new cGridBag();
1020
+
1021
+ cGridBag row1 = new cGridBag();
5541022
555
- commandsPanel.add(editButton = new cButton("+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
556
- 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");
5571110 editButton.addActionListener(this);
5581111
559
- commandsPanel.add(uneditButton = new cButton("-", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
560
- uneditButton.setToolTipText("Unedit selection");
1112
+ editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1113
+ uneditButton.setToolTipText("Unpin and remove selection controls");
5611114 uneditButton.addActionListener(this);
5621115
563
- commandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
564
- allParamsButton.setToolTipText("Edit all params");
1116
+ editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
1117
+ allParamsButton.setToolTipText("Show all controle");
5651118 allParamsButton.addActionListener(this);
5661119
567
- commandsPanel.add(clearPanelButton = new cButton("C", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
1120
+ editCommandsPanel.add(clearPanelButton = GetButton("icons/clear.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
5681121 clearPanelButton.setToolTipText("Clear edit panel");
5691122 clearPanelButton.addActionListener(this);
5701123
571
- commandsPanel.add(unselectButton = new cButton("U", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
1124
+ editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
5721125 unselectButton.setToolTipText("Unselect");
5731126 unselectButton.addActionListener(this);
5741127
575
- 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);
5761131
577
- oe.treePanel.add(commandsPanel);
578
- oe.treePanel.Return();
1132
+ editCommandsPanel.preferredHeight = 1;
1133
+
1134
+ SetPinStates(false);
1135
+// oe.treePanel.add(commandsPanel);
1136
+// oe.treePanel.Return();
5791137
5801138 // oe.aConstraints.gridx += 1;
5811139 // oe.aConstraints.weighty = 0;
....@@ -592,32 +1150,20 @@
5921150
5931151 JScrollPane jSP;
5941152 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
595
- jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints);
1153
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints);
5961154 ResetModel();
5971155
5981156 oe.treePanel.add(jSPPanel);
5991157 oe.treePanel.Return();
6001158
601
- cGridBag copyOptionsPanel = new cGridBag();
602
-
603
- copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
604
- colorCB.setToolTipText("Copy color when dropped");
605
- colorCB.addItemListener(this);
606
-
607
- copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
608
- materialCB.setToolTipText("Copy material when dropped");
609
- materialCB.addItemListener(this);
610
-
611
- copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
612
- textureCB.setToolTipText("Copy texture when dropped");
613
- textureCB.addItemListener(this);
614
-
615
- copyOptionsPanel.preferredHeight = 1;
6161159 oe.treePanel.add(copyOptionsPanel);
6171160 oe.treePanel.Return();
1161
+ cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0);
1162
+ versionSlider = (cNumberSlider)sliderPane.getComponent(1);
1163
+ sliderPane.preferredHeight = 1;
6181164
619
-// mainPanel.setDividerLocation(0.5); //1.0);
620
-// mainPanel.setResizeWeight(0.5);
1165
+// mainPanel.setDividerLocation(0.1); //1.0);
1166
+ mainPanel.setResizeWeight(0.4);
6211167
6221168 //jList.addListSelectionListener(this);
6231169 oe.jTree.addTreeSelectionListener(this);
....@@ -625,7 +1171,7 @@
6251171 //jTree.setEditable(true);
6261172 oe.jTree.setDragEnabled(true);
6271173 //jTree.setPreferredSize(new Dimension(10,10));
628
- jSP.setPreferredSize(new Dimension(100,200));
1174
+ //jSP.setPreferredSize(new Dimension(100,200));
6291175
6301176 oe.jTree.setCellRenderer(new cTreeModel.Renderer());
6311177
....@@ -637,29 +1183,49 @@
6371183 dgr.addDragGestureListener(this);
6381184 }catch(Exception e) {}
6391185 */
640
- radio.layout = sevenButton;
1186
+ radio.layout = threeButton; // sixButton;
6411187 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
6421188 }
6431189
6441190 void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
6451191 {
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
+
6461206 panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
6471207 boxCB.setToolTipText("Display bounding boxes");
6481208 boxCB.addItemListener(this);
6491209
6501210 panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
651
- zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
1211
+ zoomBoxCB.setToolTipText("Display only for wheel");
6521212 zoomBoxCB.addItemListener(this);
6531213
654
- if (Globals.ADVANCED)
1214
+ if (true) // Globals.ADVANCED)
6551215 {
656
- panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
657
- supportCB.setToolTipText("Enable rigging");
658
- 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);
6591223
6601224 // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
6611225 // localCB.addItemListener(this);
6621226
1227
+ panel.Return();
1228
+
6631229 panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
6641230 crowdCB.setToolTipText("Used for crowds");
6651231 crowdCB.addItemListener(this);
....@@ -668,14 +1234,19 @@
6681234 smoothCB.setToolTipText("Snapping delay");
6691235 smoothCB.addItemListener(this);
6701236
671
- panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
672
- slowCB.setToolTipText("Smooth interpolation");
673
- 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);
6741243
6751244 // constraints.gridy += 1;
6761245 // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
6771246 // speakerMocapCB.addItemListener(this);
6781247
1248
+ panel.Return();
1249
+
6791250 if (false)
6801251 {
6811252 // handled in scripts
....@@ -690,42 +1261,85 @@
6901261 //constraints.gridy += 1;
6911262 panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
6921263 smoothfocusCB.addItemListener(this);
1264
+ panel.Return();
6931265 }
6941266
6951267 //constraints.gridx += 1;
6961268 //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
6971269 // debugCB.addItemListener(this);
6981270
1271
+ panel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
1272
+ trackCB.setToolTipText("Enable tracking target");
1273
+ trackCB.addItemListener(this);
1274
+
6991275 panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
1276
+ oeilCB.setToolTipText("Move camera when tracking");
7001277 oeilCB.addItemListener(this);
7011278
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
+ {
7021299 panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
7031300 lookAtCB.setToolTipText("Look-at target");
7041301 lookAtCB.addItemListener(this);
1302
+ }
7051303
7061304 }
7071305
7081306 cGridBag fill = new cGridBag();
709
-
7101307 fill.preferredHeight = 200;
1308
+ cGridBag fill2 = new cGridBag();
1309
+ fill2.preferredHeight = 200;
1310
+ cGridBag fill3 = new cGridBag();
1311
+ fill3.preferredHeight = 200;
7111312
7121313 panel.add(fill);
1314
+ panel.add(fill2);
1315
+ panel.add(fill3);
7131316
7141317 }
7151318
7161319 void EditObject(Object3D obj)
7171320 {
7181321 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
+
7191330 radioButton.SetObject(obj);
720
- radioButton.layout = sevenButton;
1331
+ radioButton.layout = threeButton; // sixButton;
7211332 radioButton.SetCamera(cameraView.renderCamera, false);
7221333 radioButton.addActionListener(this);
7231334 radioPanel.add(radioButton);
7241335 buttonGroup.add(radioButton);
7251336 radioButton.doClick();
7261337 }
1338
+
7271339 void SetupViews(ObjEditor oe)
7281340 {
1341
+ theFrame = this;
1342
+
7291343 oe.SetupViews();
7301344
7311345 System.out.println("SetupViews");
....@@ -734,23 +1348,30 @@
7341348 /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this);
7351349 }
7361350
737
- JCheckBox liveCB;
738
- JCheckBox supportCB;
739
- JCheckBox localCB;
740
- JCheckBox crowdCB;
741
- JCheckBox smoothCB;
742
- JCheckBox fastCB;
743
- JCheckBox slowCB;
744
- JCheckBox boxCB;
745
- JCheckBox zoomBoxCB;
746
- JCheckBox trackCB;
747
- 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;
7481366 // JCheckBox speakerMocapCB;
749
- JCheckBox speakerCameraCB;
750
- JCheckBox speakerFocusCB;
751
- JCheckBox debugCB;
752
- JCheckBox oeilCB;
753
- JCheckBox lookAtCB;
1367
+ cCheckBox speakerCameraCB;
1368
+ cCheckBox speakerFocusCB;
1369
+ cCheckBox debugCB;
1370
+
1371
+ cCheckBox oeilCB;
1372
+ cCheckBox shadowCB;
1373
+ cCheckBox autokeepCB;
1374
+ cCheckBox lookAtCB;
7541375
7551376 // static int COLOR = 1;
7561377 // static int MATERIAL = 2;
....@@ -758,9 +1379,9 @@
7581379
7591380 int dropAttributes = Object3D.COLOR | Object3D.MATERIAL;
7601381
761
- JCheckBox colorCB;
762
- JCheckBox materialCB;
763
- JCheckBox textureCB;
1382
+ cCheckBox colorCB;
1383
+ cCheckBox materialCB;
1384
+ cCheckBox textureCB;
7641385
7651386 public void itemStateChanged(ItemEvent e)
7661387 {
....@@ -788,6 +1409,7 @@
7881409 } else if(e.getSource() == liveCB)
7891410 {
7901411 cameraView.ToggleLive();
1412
+ refreshContents(false);
7911413 }
7921414 else if(e.getSource() == supportCB)
7931415 {
....@@ -803,6 +1425,12 @@
8031425 {
8041426 cameraView.ToggleInertia();
8051427 cameraView.repaint();
1428
+ }
1429
+ else if(e.getSource() == minshaderCB)
1430
+ {
1431
+ Globals.MINSHADER ^= true;
1432
+ cameraView.programInitialized = false;
1433
+ cameraView.repaint();
8061434 }
8071435 else if(e.getSource() == localCB)
8081436 {
....@@ -852,6 +1480,18 @@
8521480 {
8531481 cameraView.ToggleOeil();
8541482 }
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
+ }
8551495 else if(e.getSource() == lookAtCB)
8561496 {
8571497 cameraView.ToggleLookAt();
....@@ -868,7 +1508,8 @@
8681508
8691509 /**/
8701510 //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this);
871
- TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1511
+ //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1512
+ TreePath path = objEditor.jTree.getSelectionPath();
8721513 if ((path == null) || (path.getPathCount() <= 1)) {
8731514 // We can't move the root node or an empty selection
8741515 return;
....@@ -931,8 +1572,6 @@
9311572 }
9321573 }
9331574
934
- String string = (String) object;
935
-
9361575 System.out.println("Transfer = " + object + "; drop : " + target);
9371576 // if( object instanceof java.io.File[])
9381577 // {
....@@ -940,7 +1579,11 @@
9401579 // objEditor.DropFile((java.io.File[]) object, true);
9411580 // return;
9421581 // }
943
- 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) == ':')
9441587 {
9451588 // file(s)
9461589 String[] names = string.split("\n");
....@@ -967,7 +1610,7 @@
9671610
9681611 flashIt = false;
9691612 CameraPane pane = (CameraPane) target;
970
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1613
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
9711614 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
9721615
9731616 if (group.selection.size() == 1)
....@@ -983,23 +1626,33 @@
9831626
9841627 assert target == objEditor.jTree;
9851628 TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y);
1629
+ Object3D destinationLeaf;
9861630 try {
987
- Object3D dummy = (Composite) destinationPath.getLastPathComponent();
1631
+ destinationLeaf = (Composite) destinationPath.getLastPathComponent();
9881632 } catch (Exception e) {
9891633 System.out.println("destinationPath : " + destinationPath);
9901634 return;
9911635 }
9921636
993
- if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1637
+ for (int i=group.selection.size(); --i>=0;)
9941638 {
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
+// {
9951648 loadClipboard(true);
9961649 objEditor.jTree.setSelectionPath(destinationPath);
9971650 pasteInto(false, false);
998
- } else {
999
- loadClipboard(false);
1000
- objEditor.jTree.setSelectionPath(destinationPath);
1001
- pasteInto(false, false); // true); // ???
1002
- }
1651
+// } else {
1652
+// loadClipboard(false);
1653
+// objEditor.jTree.setSelectionPath(destinationPath);
1654
+// pasteInto(false, false); // true); // ???
1655
+// }
10031656 }
10041657 public void dropActionChanged(DropTargetDragEvent dtde)
10051658 // Called if the user has modified the current drop gesture
....@@ -1104,22 +1757,30 @@
11041757 {
11051758 //heightFieldItem = menu.add(new MenuItem("Height Field"));
11061759 //heightFieldItem.addActionListener(this);
1107
- gridItem = menu.add(new MenuItem("Grid"));
1108
- gridItem.addActionListener(this);
1109
- rectoidItem = menu.add(new MenuItem("Box"));
1110
- rectoidItem.addActionListener(this);
1111
- ellipsoidItem = menu.add(new MenuItem("Sphere"));
1112
- ellipsoidItem.addActionListener(this);
1113
- coneItem = menu.add(new MenuItem("Cone"));
1114
- coneItem.addActionListener(this);
1115
- torusItem = menu.add(new MenuItem("Torus"));
1116
- torusItem.addActionListener(this);
1117
- superItem = menu.add(new MenuItem("Superellipsoid"));
1118
- 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
+ {
11191778 kleinItem = menu.add(new MenuItem("Klein Bottle"));
11201779 kleinItem.addActionListener(this);
1121
- particleItem = menu.add(new MenuItem("Particle system"));
1122
- particleItem.addActionListener(this);
1780
+ }
1781
+
1782
+// particleItem = menu.add(new MenuItem("Particle system"));
1783
+// particleItem.addActionListener(this);
11231784 if (Globals.ADVANCED)
11241785 {
11251786 ragdollItem = menu.add(new MenuItem("Rag Walk"));
....@@ -1145,15 +1806,15 @@
11451806 }
11461807 bezierItem = menu.add(new MenuItem("Bezier Patch"));
11471808 bezierItem.addActionListener(this);
1148
- overlayItem = menu.add(new MenuItem("Overlay"));
1149
- overlayItem.addActionListener(this);
1150
- lightItem = menu.add(new MenuItem("Light"));
1151
- 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);
11521813 menu.add("-");
11531814 //superLoopItem = menu.add(new MenuItem("Super Loop"));
11541815 //superLoopItem.addActionListener(this);
1155
- loopItem = menu.add(new MenuItem("Loop"));
1156
- loopItem.addActionListener(this);
1816
+// loopItem = menu.add(new MenuItem("Loop"));
1817
+// loopItem.addActionListener(this);
11571818 doubleItem = menu.add(new MenuItem("Fork"));
11581819 doubleItem.addActionListener(this);
11591820 if (Globals.ADVANCED)
....@@ -1169,6 +1830,9 @@
11691830 animationItem.addItemListener(this);
11701831 animationItem.setState(Globals.ANIMATION);
11711832
1833
+ menu.add(archiveItem = new MenuItem("Archive3D..."));
1834
+ archiveItem.addActionListener(this);
1835
+
11721836 menu.add("-");
11731837 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
11741838 parseverticesItem.addActionListener(this);
....@@ -1181,6 +1845,8 @@
11811845 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
11821846 reduce34MorphItem.addActionListener(this);
11831847 menu.add("-");
1848
+ menu.add(memoryItem = new MenuItem("Memory Usage"));
1849
+ memoryItem.addActionListener(this);
11841850 menu.add(computeAOItem = new MenuItem("Compute AO"));
11851851 computeAOItem.addActionListener(this);
11861852
....@@ -1189,11 +1855,9 @@
11891855 mirrorItem = menu.add(new MenuItem("Mirror Poses"));
11901856 mirrorItem.addActionListener(this);
11911857 menu.add("-");
1192
- menu.add(memoryItem = new MenuItem("Memory Usage"));
1193
- memoryItem.addActionListener(this);
11941858 menu.add(analyzeItem = new MenuItem("Analyze"));
11951859 analyzeItem.addActionListener(this);
1196
- menu.add(dumpItem = new MenuItem("Dump"));
1860
+ menu.add(dumpItem = new MenuItem("Print"));
11971861 dumpItem.addActionListener(this);
11981862 // menu.add(pathItem = new MenuItem("From-to path"));
11991863 // pathItem.addActionListener(this);
....@@ -1334,9 +1998,34 @@
13341998 shadow.material = new cMaterial(obj.material);
13351999 shadow.material.diffuse = 0.0001f;
13362000 shadow.material.specular = 0.0001f;
2001
+ //shadow.projectedVertices[1].x = 300;
13372002
13382003 makeSomething(shadow);
13392004 }
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
+ }
13402029
13412030 /**
13422031 * applyExample
....@@ -1540,9 +2229,9 @@
15402229
15412230 void Overwrite(int mask)
15422231 {
1543
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2232
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
15442233 {
1545
- Object3D content = GrafreeD.clipboard.get(0);
2234
+ Object3D content = Grafreed.clipboard.get(0);
15462235
15472236 if (content instanceof cGroup && ((cGroup)content).transientlink )
15482237 content = ((cGroup)content).get(0);
....@@ -1581,7 +2270,7 @@
15812270 {
15822271 ScreenFit();
15832272 } else
1584
- if (source == switchItem)
2273
+ if (source == switchViewItem)
15852274 {
15862275 cVector v1 = new cVector();
15872276 cVector v2 = new cVector();
....@@ -1590,11 +2279,11 @@
15902279 objEditor.cameraView.renderCamera.setAim(v2, v1);
15912280 objEditor.cameraView.repaint();
15922281 } else
1593
- if (source == rectoidItem)
2282
+ if (source == rectoidItem || source == boxButton)
15942283 {
15952284 makeSomething(new Box());
15962285 } else
1597
- if (source == particleItem)
2286
+ if (source == particleItem || source == particlesButton)
15982287 {
15992288 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
16002289 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1673,27 +2362,27 @@
16732362
16742363 makeSomething(obj);
16752364 } else
1676
- if (source == gridItem)
2365
+ if (source == gridItem || source == gridButton)
16772366 {
16782367 makeSomething(new Grid());
16792368 } else
1680
- if (source == ellipsoidItem)
2369
+ if (source == ellipsoidItem || source == sphereButton)
16812370 {
16822371 makeSomething(new Sphere());
16832372 } else
1684
- if (source == coneItem)
2373
+ if (source == coneItem || source == coneButton)
16852374 {
16862375 makeSomething(new Cone());
16872376 } else
1688
- if (source == torusItem)
2377
+ if (source == torusItem || source == torusButton)
16892378 {
16902379 makeSomething(new Torus());
16912380 } else
1692
- if (source == superItem)
2381
+ if (source == superItem || source == superButton)
16932382 {
16942383 makeSomething(new Superellipsoid());
16952384 } else
1696
- if (source == kleinItem)
2385
+ if (source == kleinItem || source == kleinButton)
16972386 {
16982387 makeSomething(new Klein());
16992388 } else
....@@ -1713,7 +2402,7 @@
17132402 {
17142403 makeSomething(new BezierSurface());
17152404 } else
1716
- if (source == overlayItem)
2405
+ if (source == overlayItem || source == overlayButton)
17172406 {
17182407 /*
17192408 Object3D obj = new BezierSurface(5,8);
....@@ -1761,10 +2450,27 @@
17612450 s.setup();
17622451 makeSomething(s);
17632452 } else
1764
- if (source == lightItem)
2453
+ if (source == lightItem || source == lightButton)
17652454 {
17662455 makeSomething(new Light());
17672456 } 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
17682474 if (source == csgItem)
17692475 {
17702476 group(new CSG());
....@@ -1811,30 +2517,30 @@
18112517
18122518 group(g);
18132519 } else
1814
- if (source == loopItem)
2520
+ if (source == loopItem || source == loopButton)
18152521 {
18162522 Composite csg = new GroupLeaf();
18172523 csg.count = 5;
18182524 group(csg);
1819
- Composite child = new cGroup();
2525
+ Composite child = new cGroup("Branch");
18202526 csg.addChild(child);
18212527 child.addChild(csg);
18222528 } else
18232529 if (source == doubleItem)
18242530 {
1825
- Composite csg = new GroupLeaf();
2531
+ Composite csg = new GroupLeaf("Fork");
18262532 csg.count = 5;
18272533 group(csg);
1828
- Composite child = new cGroup();
2534
+ Composite child = new cGroup("Branch A");
18292535 csg.addChild(child);
18302536 child.addChild(csg);
1831
- child = new cGroup();
2537
+ child = new cGroup("Branch B");
18322538 csg.addChild(child);
18332539 child.addChild(csg);
18342540 } else
18352541 if (source == tripleItem)
18362542 {
1837
- Composite csg = new GroupLeaf();
2543
+ Composite csg = new GroupLeaf("Trident");
18382544 csg.count = 4;
18392545 group(csg);
18402546 Composite child = new cGroup();
....@@ -1847,35 +2553,10 @@
18472553 csg.addChild(child);
18482554 child.addChild(csg);
18492555 } else
1850
-
1851
- if (source == importGFDItem)
1852
- {
1853
- ImportGFD();
1854
- } else
1855
- if (source == importVRMLX3DItem)
1856
- {
1857
- ImportVRMLX3D();
1858
- } else
1859
- if (source == import3DSItem)
1860
- {
1861
- objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
1862
- } else
1863
- if (source == importOBJItem)
1864
- {
1865
- //objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1866
- FileDialog browser = new FileDialog(frame, "Import OBJ", FileDialog.LOAD);
1867
- browser.setVisible(true);
1868
- String filename = browser.getFile();
1869
- if (filename != null && filename.length() > 0)
1870
- {
1871
- String fullname = browser.getDirectory() + filename;
1872
- makeSomething(ReadOBJ(fullname), true);
1873
- }
1874
- } else
18752556 if (source == computeAOItem)
18762557 {
18772558 Globals.drawMode = CameraPane.OCCLUSION;
1878
- Globals.theRenderer.repaint();
2559
+ cameraView.repaint();
18792560 } else
18802561 if (source == recompileItem)
18812562 {
....@@ -1890,7 +2571,7 @@
18902571 if (source == invariantsItem)
18912572 {
18922573 System.out.println("Invariants:");
1893
- GrafreeD.grafreeD.universe.invariants();
2574
+ Grafreed.grafreeD.universe.invariants();
18942575 } else
18952576 if (source == memoryItem)
18962577 {
....@@ -1909,6 +2590,48 @@
19092590 {
19102591 DumpObject();
19112592 } 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
+ restoreButton.setEnabled(false);
2617
+ } else
2618
+ if (source == replaceButton)
2619
+ {
2620
+ // Overwrite current version
2621
+ Replace();
2622
+ replaceButton.setEnabled(false);
2623
+ } else
2624
+ if (source == redoButton)
2625
+ {
2626
+ // Go to next version
2627
+ Redo();
2628
+ } else
2629
+ if (source == saveButton)
2630
+ {
2631
+ // Save a new version
2632
+ if (!Save(true))
2633
+ java.awt.Toolkit.getDefaultToolkit().beep();
2634
+ } else
19122635 if (source == oneStepButton)
19132636 {
19142637 Globals.ONESTEP = true;
....@@ -1916,17 +2639,14 @@
19162639 } else
19172640 if (source == screenfitButton)
19182641 {
1919
- //Reload(lastConverter, lastFilename, true);
19202642 ScreenFit();
19212643 } else
19222644 if (source == screenfitpointButton)
19232645 {
1924
- //Reload(lastConverter, lastFilename, true);
19252646 ScreenFitPoint();
19262647 } else
19272648 if (source == snapobjectButton)
19282649 {
1929
- //Reload(lastConverter, lastFilename, true);
19302650 SnapObject();
19312651 } else
19322652 // if (event.getSource() == recompileButton)
....@@ -1963,12 +2683,20 @@
19632683 {
19642684 loadClipboard(true);
19652685 } else
2686
+ if (source == undoItem)
2687
+ {
2688
+ Undo();
2689
+ } else
2690
+ if (source == redoItem)
2691
+ {
2692
+ Redo();
2693
+ } else
19662694 if (source == duplicateItem)
19672695 {
1968
- Object3D keep = GrafreeD.clipboard;
2696
+ Object3D keep = Grafreed.clipboard;
19692697 loadClipboard(false);
19702698 paste(false);
1971
- GrafreeD.clipboard = keep;
2699
+ Grafreed.clipboard = keep;
19722700 } else
19732701 if (source == cloneItem)
19742702 {
....@@ -2188,9 +2916,9 @@
21882916 // group.selection.get(0).setMasterThis(content); // should be identity
21892917 // refreshContents();
21902918 // }
2191
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2919
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
21922920 {
2193
- Object3D content = GrafreeD.clipboard.get(0);
2921
+ Object3D content = Grafreed.clipboard.get(0);
21942922
21952923 if (content instanceof cGroup && ((cGroup)content).transientlink )
21962924 content = ((cGroup)content).get(0);
....@@ -2240,9 +2968,9 @@
22402968 } else
22412969 if (source == setMasterItem)
22422970 {
2243
- if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
2971
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
22442972 {
2245
- Object3D content = GrafreeD.clipboard.get(0);
2973
+ Object3D content = Grafreed.clipboard.get(0);
22462974
22472975 if (content instanceof cGroup && ((cGroup)content).transientlink )
22482976 content = ((cGroup)content).get(0);
....@@ -2255,9 +2983,9 @@
22552983 {
22562984 if (group.selection.size() == 1)
22572985 {
2258
- if (GrafreeD.clipboard.size() == 1)
2986
+ if (Grafreed.clipboard.size() == 1)
22592987 {
2260
- Object3D content = GrafreeD.clipboard.get(0);
2988
+ Object3D content = Grafreed.clipboard.get(0);
22612989
22622990 if (content instanceof cGroup && ((cGroup)content).transientlink )
22632991 content = ((cGroup)content).get(0);
....@@ -2274,7 +3002,7 @@
22743002 {
22753003 RevertMeshes();
22763004 } else
2277
- if (source == resetMeshItem)
3005
+ if (source == resetAllItem)
22783006 {
22793007 ResetAll();
22803008 } else
....@@ -2282,7 +3010,7 @@
22823010 {
22833011 StepAll();
22843012 } else
2285
- if (source == clearItem) // || event.getSource() == clearButton)
3013
+ if (source == deleteItem) // || event.getSource() == clearButton)
22863014 {
22873015 //int indices[] = jList.getSelectedIndices();
22883016 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2294,9 +3022,9 @@
22943022 {
22953023 ClearSelection(true);
22963024 } else
2297
- if (source == grabItem)
3025
+ if (source == grabItem || source == groupButton)
22983026 {
2299
- group(new cGroup(), true);
3027
+ group(new cGroup(), false); // true);
23003028 } else
23013029 if (source == hideItem)
23023030 {
....@@ -2314,11 +3042,11 @@
23143042 {
23153043 makeSomething(new Camera());
23163044 } else
2317
- if (source == compositeItem)
3045
+ if (source == compositeItem || source == compositeButton)
23183046 {
23193047 group(new Composite());
23203048 } else
2321
- if (source == randomItem)
3049
+ if (source == switchItem || source == switchButton)
23223050 {
23233051 RandomNode random = new RandomNode();
23243052 group(random);
....@@ -2420,7 +3148,7 @@
24203148 {
24213149 group(new cLinker());
24223150 } else
2423
- if (source == textureItem)
3151
+ if (source == textureItem || source == textureButton)
24243152 {
24253153 group(new TextureNode());
24263154 } else
....@@ -2440,17 +3168,30 @@
24403168 {
24413169 CastShadow(2);
24423170 } else
2443
- if (source == ungroupItem)
3171
+ if (source == ungroupItem || source == ungroupButton)
24443172 {
2445
- //ungroup();
3173
+ boolean hasRoot = false;
3174
+
24463175 for (int i=0; i<group.selection.size(); i++)
24473176 {
2448
- Ungroup(group.selection.get(i));
3177
+ if (group.selection.get(i) == group)
3178
+ {
3179
+ hasRoot = true;
3180
+ break;
3181
+ }
24493182 }
24503183
2451
- ClearSelection(false);
2452
-
2453
- refreshContents();
3184
+ if (!hasRoot)
3185
+ {
3186
+ for (int i=0; i<group.selection.size(); i++)
3187
+ {
3188
+ Ungroup(group.selection.get(i));
3189
+ }
3190
+
3191
+ ClearSelection(false);
3192
+
3193
+ refreshContents();
3194
+ }
24543195 } else
24553196 if (source == genUVItem)
24563197 {
....@@ -2462,7 +3203,7 @@
24623203 } else
24633204 if (source == genNormalsMESHItem)
24643205 {
2465
- GenNormals(true); // TODO
3206
+ GenNormalsMESH();
24663207 } else
24673208 if (source == genNormalsORGANItem)
24683209 {
....@@ -2527,6 +3268,22 @@
25273268 if (source == unmarkleavesItem)
25283269 {
25293270 MarkLeaves(false);
3271
+ } else
3272
+ if (source == rewindleavesItem)
3273
+ {
3274
+ RewindLeaves(true);
3275
+ } else
3276
+ if (source == unrewindleavesItem)
3277
+ {
3278
+ RewindLeaves(false);
3279
+ } else
3280
+ if (source == randomleavesItem)
3281
+ {
3282
+ RandomLeaves(true);
3283
+ } else
3284
+ if (source == unrandomleavesItem)
3285
+ {
3286
+ RandomLeaves(false);
25303287 } else
25313288 if (source == flipVItem)
25323289 {
....@@ -2612,9 +3369,13 @@
26123369 {
26133370 SmoothMesh();
26143371 } else
2615
- if (source == transformgeometryItem)
3372
+ if (source == transformGeometryItem)
26163373 {
26173374 TransformGeometry();
3375
+ } else
3376
+ if (source == transformChildrenItem)
3377
+ {
3378
+ TransformChildren();
26183379 } else
26193380 if (source == resetTransformItem)
26203381 {
....@@ -2622,7 +3383,11 @@
26223383 } else
26233384 if (source == resetCentroidItem)
26243385 {
2625
- ResetCentroid();
3386
+ ResetCentroid(true);
3387
+ } else
3388
+ if (source == resetCentroidXZItem)
3389
+ {
3390
+ ResetCentroid(false);
26263391 } else
26273392 if (source == resetParentItem)
26283393 {
....@@ -2727,7 +3492,7 @@
27273492 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
27283493 {
27293494 obj = (Object3D)e.nextElement();
2730
- obj.SetBumpTexture(null);
3495
+ obj.ResetBumpTexture();
27313496 }
27323497
27333498 refreshContents();
....@@ -2743,6 +3508,31 @@
27433508
27443509 refreshContents();
27453510 } else
3511
+ if (source == embedTexturesItem)
3512
+ {
3513
+ Object3D obj;
3514
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3515
+ {
3516
+ obj = (Object3D)e.nextElement();
3517
+ obj.EmbedTextures(true);
3518
+ }
3519
+
3520
+ refreshContents();
3521
+ } else
3522
+ if (source == deEmbedTexturesItem)
3523
+ {
3524
+ Object3D obj;
3525
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3526
+ {
3527
+ obj = (Object3D)e.nextElement();
3528
+ obj.EmbedTextures(false);
3529
+ }
3530
+
3531
+ CameraPane.texturepigment.clear();
3532
+ CameraPane.texturebump.clear();
3533
+
3534
+ refreshContents();
3535
+ } else
27463536 if (source == flashSelectionButton)
27473537 {
27483538 CameraPane.flash = true;
....@@ -2754,6 +3544,10 @@
27543544 if (source == twoButton)
27553545 {
27563546 radio.layout = twoButton;
3547
+
3548
+ if (CameraPane.FULLSCREEN)
3549
+ fullscreenLayout = radio.layout;
3550
+
27573551 // bug
27583552 //gridPanel.setDividerLocation(1.0);
27593553 //bigPanel.setDividerLocation(0.0);
....@@ -2786,10 +3580,31 @@
27863580 bigThree.ClearUI();
27873581 bigThree.add(centralPanel);
27883582 bigThree.FlushUI();
3583
+
3584
+ cameraView.requestFocusInWindow();
3585
+
3586
+// refreshContents(true);
3587
+//
3588
+// try
3589
+// {
3590
+// java.awt.Robot bot = new java.awt.Robot();
3591
+// int mask = InputEvent.BUTTON1_MASK;
3592
+// bot.mouseMove(100, 100);
3593
+// bot.mousePress(mask);
3594
+// bot.mouseRelease(mask);
3595
+// }
3596
+// catch (Exception e)
3597
+// {
3598
+//
3599
+// }
3600
+
27893601 } else
27903602 if (source == threeButton)
27913603 {
27923604 radio.layout = threeButton;
3605
+
3606
+ if (CameraPane.FULLSCREEN)
3607
+ fullscreenLayout = radio.layout;
27933608
27943609 // bigThree.remove(scenePanel);
27953610 // bigThree.remove(centralPanel);
....@@ -2819,13 +3634,18 @@
28193634 // centralPanel.setVisible(true);
28203635 // XYZPanel.setVisible(true);
28213636 bigThree.ClearUI();
3637
+ bigThree.add(scenePanel);
28223638 bigThree.add(centralPanel);
2823
- bigThree.add(XYZPanel);
28243639 bigThree.FlushUI();
3640
+
3641
+ cameraView.requestFocusInWindow();
28253642 } else
28263643 if (source == fourButton)
28273644 {
28283645 radio.layout = fourButton;
3646
+
3647
+ if (CameraPane.FULLSCREEN)
3648
+ fullscreenLayout = radio.layout;
28293649
28303650 // bigThree.remove(scenePanel);
28313651 // bigThree.remove(centralPanel);
....@@ -2857,10 +3677,15 @@
28573677 bigThree.ClearUI();
28583678 bigThree.add(scenePanel);
28593679 bigThree.FlushUI();
3680
+
3681
+ cameraView.requestFocusInWindow();
28603682 } else
28613683 if (source == sixButton)
28623684 {
28633685 radio.layout = sixButton;
3686
+
3687
+ if (CameraPane.FULLSCREEN)
3688
+ fullscreenLayout = radio.layout;
28643689
28653690 // bigThree.remove(scenePanel);
28663691 // bigThree.remove(centralPanel);
....@@ -2890,13 +3715,18 @@
28903715 // centralPanel.setVisible(true);
28913716 // XYZPanel.setVisible(false);
28923717 bigThree.ClearUI();
2893
- bigThree.add(scenePanel);
28943718 bigThree.add(centralPanel);
3719
+ bigThree.add(scenePanel);
28953720 bigThree.FlushUI();
3721
+
3722
+ cameraView.requestFocusInWindow();
28963723 } else
28973724 if (source == sevenButton)
28983725 {
28993726 radio.layout = sevenButton;
3727
+
3728
+ if (CameraPane.FULLSCREEN)
3729
+ fullscreenLayout = radio.layout;
29003730
29013731 // bigThree.remove(scenePanel);
29023732 // bigThree.remove(centralPanel);
....@@ -2930,6 +3760,8 @@
29303760 bigThree.add(centralPanel);
29313761 bigThree.add(XYZPanel);
29323762 bigThree.FlushUI();
3763
+
3764
+ cameraView.requestFocusInWindow();
29333765 } else
29343766 if (source == rootButton)
29353767 {
....@@ -2941,6 +3773,7 @@
29413773 EditObject(obj);
29423774 }
29433775
3776
+ cameraView.requestFocusInWindow();
29443777 refreshContents(true);
29453778 } else
29463779 if (source == closeButton)
....@@ -2950,22 +3783,37 @@
29503783 for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
29513784 {
29523785 ab = (cRadio)e.nextElement();
2953
- if(ab.getModel().isSelected() && ab.GetObject() != client)
3786
+ if (ab.getModel().isSelected() && ab.GetObject() != client)
29543787 {
3788
+ // Patch to avoid bug with transparency.
3789
+ if (!ab.hadMaterial)
3790
+ {
3791
+ ab.object.material = null;
3792
+ }
3793
+
29553794 buttonGroup.remove(ab);
29563795 radioPanel.remove(ab);
29573796
2958
- ab.GetObject().editWindow = null;
3797
+ //ab.GetObject().editWindow = null;
3798
+ ab.GetObject().manipWindow = null;
29593799 // ab.GetObject().objectUI = null; // ?????????
29603800
29613801 ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick();
29623802 break;
29633803 }
29643804 }
3805
+
3806
+ cameraView.requestFocusInWindow();
29653807 refreshContents(true);
29663808 } else
29673809 if (source == editItem || source == editButton)
29683810 {
3811
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3812
+ {
3813
+ Object3D child = (Object3D)e.nextElement();
3814
+ child.pinned = true;
3815
+ }
3816
+
29693817 EditSelection(false);
29703818 } else
29713819 if (source == uneditButton)
....@@ -2974,11 +3822,12 @@
29743822 {
29753823 Object3D child = (Object3D)e.nextElement();
29763824 if(child.editWindow != null)
2977
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3825
+ child.pinned = false;
29783826 child.CloseUI();
29793827 listUI.remove(child);
3828
+// objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
29803829
2981
- child.editWindow = null; // ???????????
3830
+ //child.editWindow = null; // ???????????
29823831 }
29833832 objEditor.ctrlPanel.FlushUI();
29843833 //objEditor.jTree.clearSelection();
....@@ -2991,16 +3840,18 @@
29913840 //copy.ClearUI();
29923841 for (Object3D obj : listUI)
29933842 {
3843
+ obj.pinned = false;
29943844 obj.CloseUI();
29953845 }
29963846 listUI.clear();
3847
+ SetPinStates(group.selection.size() > 0);
29973848 refreshContents(true);
29983849 } else
29993850 if (source == allParamsButton)
30003851 {
30013852 assert(copy == group);
30023853
3003
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3854
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
30043855
30053856 for (Object3D obj : listUI)
30063857 {
....@@ -3049,6 +3900,9 @@
30493900 }
30503901
30513902 copy = group;
3903
+
3904
+ SetUndoStates();
3905
+
30523906 //Globals.theRenderer.object = group;
30533907 if(!useclient)
30543908 {
....@@ -3064,20 +3918,49 @@
30643918 frontView.object = group;
30653919 sideView.object = group;
30663920 }
3067
- group.editWindow = this;
3921
+
3922
+// fix "+" issue
3923
+ //group.editWindow = this;
3924
+ group.manipWindow = this;
3925
+
30683926 /*
30693927 currentLayout = radio.layout;
30703928 if (currentLayout == null)
30713929 currentLayout = sevenButton;
30723930 */
30733931 radio.layout.doClick();
3932
+
3933
+ ClearUnpinned();
3934
+
3935
+ //Grafreed.Assert(group != null);
3936
+ //Grafreed.Assert(group.selection != null);
3937
+ SetPinStates(group.selection == null || group.selection.size() > 0);
3938
+ if (group.selection == null || group.selection.size() == 1)
3939
+ EditSelection(false);
30743940 keepparent = group.parent;
30753941 // PARENT = NULL or not???
30763942 //group.parent = null; // ROOT
30773943 //group.attributes = -1;
30783944 ResetModel();
3945
+
3946
+ cameraView.requestFocusInWindow();
30793947 refreshContents(true);
3080
- }
3948
+ } else if (event.getSource() == editCameraItem)
3949
+ {
3950
+ cameraView.ProtectCamera();
3951
+ cameraView.requestFocusInWindow();
3952
+ cameraView.repaint();
3953
+ return;
3954
+ } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton)
3955
+ {
3956
+ cameraView.RevertCamera();
3957
+ cameraView.requestFocusInWindow();
3958
+ cameraView.repaint();
3959
+ return;
3960
+ // } else if (event.getSource() == textureButton)
3961
+ // {
3962
+ // return; // true;
3963
+ }
30813964 else
30823965 {
30833966 //return super.action(event, arg);
....@@ -3086,7 +3969,6 @@
30863969 }
30873970
30883971 boolean useclient = false;
3089
- cRadio radio;
30903972
30913973 void ToggleRoot()
30923974 {
....@@ -3138,6 +4020,28 @@
31384020 refreshContents();
31394021 }
31404022
4023
+ void TransformChildren()
4024
+ {
4025
+ Object3D obj;
4026
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
4027
+ {
4028
+ obj = (Object3D)e.nextElement();
4029
+ obj.KeepTextureMatrices();
4030
+ obj.TransformChildren();
4031
+ obj.RestoreTextureMatrices();
4032
+
4033
+// if (obj.parent == null)
4034
+// {
4035
+// System.out.println("NULL PARENT!");
4036
+// new Exception().printStackTrace();
4037
+// }
4038
+// else
4039
+// TouchTransform(obj);
4040
+// //obj.parent.Touch();
4041
+ }
4042
+
4043
+ refreshContents();
4044
+ }
31414045
31424046 void ResetTransform()
31434047 {
....@@ -3250,7 +4154,7 @@
32504154 refreshContents();
32514155 }
32524156
3253
- void ResetCentroid()
4157
+ void ResetCentroid(boolean full)
32544158 {
32554159 Object3D obj;
32564160 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3265,12 +4169,16 @@
32654169 LA.matIdentity(Object3D.mat);
32664170 obj.getBounds(minima, maxima, false);
32674171 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3268
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
4172
+ if (full)
4173
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
32694174 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
32704175 obj.TransformMesh(Object3D.mat);
4176
+
32714177 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3272
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
4178
+ if (full)
4179
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
32734180 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
4181
+
32744182 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
32754183 //Object3D.mat[3][0] = -Object3D.mat[3][0];
32764184 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3299,7 +4207,8 @@
32994207
33004208 int size = obj.MemorySize();
33014209
3302
- System.err.println((size/1024) + " KB is the size of " + obj);
4210
+ //System.err.println((size/1024) + " KB is the size of " + obj);
4211
+ System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)");
33034212 }
33044213 }
33054214 catch (Exception e)
....@@ -3336,9 +4245,9 @@
33364245 obj = (Object3D)e.nextElement();
33374246
33384247 System.out.println("Object is: " + obj);
3339
- GrafreeD.AnalyzeObject(obj);
4248
+ Grafreed.AnalyzeObject(obj);
33404249 System.out.println("Boundary rep: " + obj.bRep);
3341
- GrafreeD.AnalyzeObject(obj.bRep);
4250
+ Grafreed.AnalyzeObject(obj.bRep);
33424251
33434252 // System.err.println((size/1024) + " KB is the size of " + obj);
33444253 }
....@@ -3380,6 +4289,13 @@
33804289 void GenNormals(boolean crease)
33814290 {
33824291 group.GenNormalsS(crease);
4292
+
4293
+ refreshContents();
4294
+ }
4295
+
4296
+ void GenNormalsMESH()
4297
+ {
4298
+ group.GenNormalsMeshS();
33834299
33844300 refreshContents();
33854301 }
....@@ -3552,8 +4468,8 @@
35524468
35534469 void ParseVertices()
35544470 {
3555
- boolean epsequal = GrafreeD.epsequal;
3556
- GrafreeD.epsequal = true;
4471
+ boolean epsequal = Grafreed.epsequal;
4472
+ Grafreed.epsequal = true;
35574473
35584474 for (int i=0; i<group.selection.size(); i++)
35594475 {
....@@ -3578,7 +4494,7 @@
35784494 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
35794495 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
35804496
3581
- g.add(GrafreeD.clipboard);
4497
+ g.add(Grafreed.clipboard);
35824498
35834499 buffer.add(g);
35844500 }
....@@ -3593,7 +4509,7 @@
35934509 makeSomething(buffer, i==group.selection.size()-1);
35944510 }
35954511
3596
- GrafreeD.epsequal = epsequal;
4512
+ Grafreed.epsequal = epsequal;
35974513
35984514 refreshContents();
35994515 }
....@@ -3611,7 +4527,16 @@
36114527 String pigment = Object3D.GetPigment(tex);
36124528 //String bump = Object3D.GetBump(tex);
36134529
3614
- com.sun.opengl.util.texture.TextureData texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
4530
+ com.sun.opengl.util.texture.TextureData texturedata = null;
4531
+
4532
+ try
4533
+ {
4534
+ texturedata = Globals.theRenderer.GetTextureData(tex, false, node.texres);
4535
+ }
4536
+ catch (Exception e)
4537
+ {
4538
+ System.err.println("FAIL: " + node);
4539
+ }
36154540
36164541 double s = v.s;
36174542
....@@ -3743,7 +4668,7 @@
37434668 return;
37444669
37454670 Object3D poses = group.selection.get(0);
3746
- Object3D ref = GrafreeD.clipboard.get(0);
4671
+ Object3D ref = Grafreed.clipboard.get(0);
37474672
37484673 Object3D newgroup = new Object3D("Po:" + poses.name);
37494674
....@@ -3937,9 +4862,9 @@
39374862
39384863 void ClipMesh()
39394864 {
3940
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
4865
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
39414866 {
3942
- Object3D content = GrafreeD.clipboard.get(0);
4867
+ Object3D content = Grafreed.clipboard.get(0);
39434868
39444869 if (content instanceof cGroup && ((cGroup)content).transientlink )
39454870 content = ((cGroup)content).get(0);
....@@ -3948,7 +4873,7 @@
39484873 // {
39494874 // group.selection.get(i).ClipMesh(GrafreeD.clipboard);
39504875 // }
3951
- group.selection.ClipMesh(GrafreeD.clipboard);
4876
+ group.selection.ClipMesh(Grafreed.clipboard);
39524877 }
39534878 // group.selection.ClipMesh(GrafreeD.clipboard);
39544879 System.out.println("DONE.");
....@@ -3995,6 +4920,18 @@
39954920 void MarkLeaves(boolean hide)
39964921 {
39974922 group.selection.MarkLeaves(hide);
4923
+ refreshContents();
4924
+ }
4925
+
4926
+ void RewindLeaves(boolean hide)
4927
+ {
4928
+ group.selection.RewindLeaves(hide);
4929
+ refreshContents();
4930
+ }
4931
+
4932
+ void RandomLeaves(boolean hide)
4933
+ {
4934
+ group.selection.RandomLeaves(hide);
39984935 refreshContents();
39994936 }
40004937
....@@ -4069,28 +5006,25 @@
40695006 // }
40705007 // }
40715008
4072
- static boolean allparams = true;
4073
-
4074
- static Vector<Object3D> listUI = new Vector<Object3D>();
4075
-
40765009 void EditSelection(boolean newWindow)
40775010 {
5011
+ if (group.selection == null)
5012
+ {
5013
+ EditElement(group, newWindow); // ? new
5014
+ return;
5015
+ }
5016
+
40785017 // aConstraints.gridy = 0;
40795018 for (int i=0; i<group.selection.size(); i++)
40805019 {
40815020 //System.out.println("edit : " + objectPanel.indexOfTab("Material"));
40825021 //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false);
4083
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
5022
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
40845023
40855024 Object3D elem = (Object3D)group.selection.elementAt(i);
4086
- if(elem != group)
5025
+ if(elem != group || !newWindow)
40875026 {
4088
- // if (!(elem instanceof Composite))
4089
- // newWindow = false;
4090
- listUI.add(elem);
4091
- elem.openEditWindow(this, newWindow); //, false);
4092
- System.out.println("edit : " + elem);
4093
- elem.editWindow.refreshContents(true); // ? new
5027
+ EditElement(elem, newWindow); // ? new
40945028 }
40955029 }
40965030 }
....@@ -4153,9 +5087,7 @@
41535087
41545088 freezemodel = false;
41555089 }
4156
-
4157
- boolean flashIt = true;
4158
-
5090
+
41595091 public void valueChanged(TreeSelectionEvent e)
41605092 //public boolean handleEvent(Event event)
41615093 {
....@@ -4165,7 +5097,8 @@
41655097 //new Exception().printStackTrace();
41665098
41675099 freezemodel = true;
4168
-
5100
+ ClearUnpinned();
5101
+
41695102 /**/
41705103 //switch (event.id)
41715104 {
....@@ -4173,7 +5106,6 @@
41735106 //case 702: // Event.LIST_DESELECT
41745107 group.deselectAll();
41755108 TreePath tps[] = objEditor.jTree.getSelectionPaths();
4176
- objEditor.ClearInfo(); // .GetMaterial());
41775109 if (tps != null)
41785110 {
41795111 for (int i=0; i < tps.length; i++)
....@@ -4182,10 +5114,8 @@
41825114
41835115 //if (child.parent != null)
41845116 //child.parent.addSelectee(child);
5117
+ objEditor.SetMaterial(child);
41855118 group.addSelectee(child);
4186
- objEditor.SetMaterial(child); // .GetMaterial());
4187
- objEditor.AddInfo(child, this, true); // .GetMaterial());
4188
- System.err.println("info : " + child.GetPath());
41895119 }
41905120 }
41915121 // else
....@@ -4195,20 +5125,28 @@
41955125 // System.err.println("info : " + group.GetPath());
41965126 // }
41975127
4198
- objEditor.SetText(); // jan 2014
4199
-
4200
- if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
5128
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera))
42015129 CameraPane.flash = true;
42025130
4203
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
5131
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
42045132 // a camera
42055133 {
4206
- CameraPane.camerachangeframe = 0; // don't refuse it
4207
- Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
5134
+ if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crash the camera because of invalid lightspace
5135
+ {
5136
+ CameraPane.camerachangeframe = 0; // don't refuse it
5137
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
5138
+ }
42085139 // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
42095140 // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
42105141 }
42115142
5143
+ if (tps != null && tps.length == 1)
5144
+ {
5145
+ EditSelection(false);
5146
+ }
5147
+
5148
+ SetPinStates(tps != null && tps.length > 0);
5149
+
42125150 refreshContents();
42135151 //return true;
42145152 }
....@@ -4217,6 +5155,37 @@
42175155
42185156 freezemodel = false;
42195157 }
5158
+
5159
+ void SetPinStates(boolean enabled)
5160
+ {
5161
+ editButton.setEnabled(enabled);
5162
+ uneditButton.setEnabled(enabled);
5163
+ unselectButton.setEnabled(enabled);
5164
+ flashSelectionButton.setEnabled(enabled);
5165
+
5166
+ clearPanelButton.setEnabled(!listUI.isEmpty());
5167
+ }
5168
+
5169
+ void refreshContents(boolean cp)
5170
+ {
5171
+ if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info"))
5172
+ if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING)
5173
+ {
5174
+ objEditor.ClearInfo(); // .GetMaterial());
5175
+
5176
+ for (int i=0; i < group.selection.Size(); i++)
5177
+ {
5178
+ Object3D child = (Object3D) group.selection.get(i);
5179
+
5180
+ objEditor.AddInfo(child, this, true);
5181
+ System.err.println("info : " + child.GetPath());
5182
+ }
5183
+
5184
+ objEditor.SetText(); // jan 2014
5185
+ }
5186
+
5187
+ super.refreshContents(cp);
5188
+ }
42205189
42215190 void linkSomething(Object3D thing)
42225191 {
....@@ -4288,16 +5257,19 @@
42885257 {
42895258 if (group.selection.isEmpty())
42905259 return;
4291
- GrafreeD.clipboardIsTempGroup = false;
5260
+
5261
+ Grafreed.clipboardIsTempGroup = false;
42925262 Composite tGroup = null;
42935263 if (group.selection.size() > 0) // 1)
42945264 {
42955265 tGroup = new cGroup();
4296
- GrafreeD.clipboardIsTempGroup = true;
5266
+ Grafreed.clipboardIsTempGroup = true;
42975267 }
42985268
42995269 if (cut)
43005270 {
5271
+// if (Globals.SAVEONMAKE) // Moved to the clipboard, no need to save.
5272
+// Save();
43015273 //int indices[] = jList.getSelectedIndices();
43025274 //for (int i = indices.length - 1; i >= 0; i--)
43035275 //jList.remove(indices[i]);
....@@ -4333,16 +5305,16 @@
43335305 //System.out.println("cut " + child);
43345306 //System.out.println("parent = " + child.parent);
43355307 // tmp.addChild(child);
4336
- if (GrafreeD.clipboardIsTempGroup)
5308
+ if (Grafreed.clipboardIsTempGroup)
43375309 tGroup.add/*Child*/(tmp);
43385310 else
4339
- GrafreeD.clipboard = tmp;
5311
+ Grafreed.clipboard = tmp;
43405312 }
43415313 else
4342
- if (GrafreeD.clipboardIsTempGroup)
5314
+ if (Grafreed.clipboardIsTempGroup)
43435315 tGroup.add/*Child*/(child);
43445316 else
4345
- GrafreeD.clipboard = child;
5317
+ Grafreed.clipboard = child;
43465318 }
43475319
43485320 //ResetModel();
....@@ -4374,21 +5346,23 @@
43745346 //System.out.println("cut " + elem);
43755347 //System.out.println("parent = " + elem.parent);
43765348 // tmp.addChild(elem);
4377
- if (GrafreeD.clipboardIsTempGroup)
5349
+ if (Grafreed.clipboardIsTempGroup)
43785350 tGroup.add/*Child*/(tmp);
43795351 else
4380
- GrafreeD.clipboard = tmp;
5352
+ Grafreed.clipboard = tmp;
43815353 }
43825354 else
4383
- if (GrafreeD.clipboardIsTempGroup)
5355
+ if (Grafreed.clipboardIsTempGroup)
43845356 tGroup.add/*Child*/(child);
43855357 else
4386
- GrafreeD.clipboard = child;
5358
+ Grafreed.clipboard = child;
43875359 }
43885360
43895361 }
4390
- if (GrafreeD.clipboardIsTempGroup)
4391
- GrafreeD.clipboard = tGroup;
5362
+
5363
+ if (Grafreed.clipboardIsTempGroup)
5364
+ Grafreed.clipboard = tGroup;
5365
+
43925366 if (cut)
43935367 {
43945368 ResetModel();
....@@ -4398,11 +5372,15 @@
43985372
43995373 void paste(boolean expand)
44005374 {
5375
+ if (Globals.REPLACEONMAKE)
5376
+ Save();
5377
+ boolean keep = Globals.REPLACEONMAKE;
5378
+ Globals.REPLACEONMAKE = false;
44015379 // if (GrafreeD.clipboard == null)
44025380 // return;
44035381 boolean first = true;
44045382
4405
- if (GrafreeD.clipboardIsTempGroup)
5383
+ if (Grafreed.clipboardIsTempGroup)
44065384 {
44075385 Composite temp;
44085386
....@@ -4413,7 +5391,7 @@
44135391 temp = (Composite)Applet3D.clipboard.deepCopy();
44145392 */
44155393 Object3D elem;
4416
- for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
5394
+ for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
44175395 {
44185396 Object3D child = (Object3D)e.nextElement();
44195397
....@@ -4447,16 +5425,17 @@
44475425 //Object3D cb = Applet3D.clipboard;
44485426 //temp.addChild(cb);
44495427 //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0));
4450
- assert(GrafreeD.clipboard.parent == null);
4451
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
4452
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
4453
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
4454
- makeSomething(expand?GrafreeD.clipboard.get(0).copyExpand():GrafreeD.clipboard.get(0).deepCopy());
5428
+ assert(Grafreed.clipboard.parent == null);
5429
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
5430
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
5431
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
5432
+ makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy());
44555433 else
4456
- makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4457
- GrafreeD.clipboard.get(0).parent = keepparent;
5434
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
5435
+ Grafreed.clipboard.get(0).parent = keepparent;
44585436 }
44595437
5438
+ Globals.REPLACEONMAKE = keep;
44605439 ResetModel();
44615440 refreshContents();
44625441 }
....@@ -4503,9 +5482,9 @@
45035482 {
45045483 boolean first = true;
45055484
4506
- if (GrafreeD.clipboardIsTempGroup)
5485
+ if (Grafreed.clipboardIsTempGroup)
45075486 {
4508
- Composite temp = (Composite)GrafreeD.clipboard;
5487
+ Composite temp = (Composite)Grafreed.clipboard;
45095488 Object3D copy;
45105489 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
45115490 {
....@@ -4515,7 +5494,7 @@
45155494 }
45165495 } else
45175496 {
4518
- linkSomething(GrafreeD.clipboard); //.get(0));
5497
+ linkSomething(Grafreed.clipboard); //.get(0));
45195498 }
45205499 }
45215500 }
....@@ -4592,6 +5571,10 @@
45925571
45935572 void group(Object3D csg, boolean grab)
45945573 {
5574
+ if (Globals.REPLACEONMAKE)
5575
+ Save();
5576
+ boolean keep = Globals.REPLACEONMAKE;
5577
+ Globals.REPLACEONMAKE = false;
45955578 if (//false) // why??
45965579 !group.selection.isEmpty())
45975580 {
....@@ -4705,10 +5688,15 @@
47055688 //node.add(csg);
47065689 //makeSomething(node);
47075690 makeSomething(csg);
5691
+ Globals.REPLACEONMAKE = keep;
47085692 }
47095693
47105694 void Ungroup(Object3D g)
47115695 {
5696
+ if (Globals.REPLACEONMAKE)
5697
+ Save();
5698
+ boolean keep = Globals.REPLACEONMAKE;
5699
+ Globals.REPLACEONMAKE = false;
47125700 if (g instanceof HiddenObject)
47135701 {
47145702 HiddenObject h = (HiddenObject) g;
....@@ -4725,6 +5713,7 @@
47255713 objEditor.makeSomething(g.get(i), false);
47265714 }
47275715 }
5716
+ Globals.REPLACEONMAKE = keep;
47285717 }
47295718
47305719 void ungroup()
....@@ -4920,21 +5909,6 @@
49205909 }
49215910 */
49225911
4923
- void ImportGFD()
4924
- {
4925
- FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD);
4926
- browser.show();
4927
- String filename = browser.getFile();
4928
- if (filename != null && filename.length() > 0)
4929
- {
4930
- String fullname = browser.getDirectory() + filename;
4931
-
4932
- //Object3D readobj =
4933
- objEditor.ReadGFD(fullname, objEditor);
4934
- //makeSomething(readobj);
4935
- }
4936
- }
4937
-
49385912 /*
49395913 public void Callback(Object obj)
49405914 {
....@@ -4958,26 +5932,9 @@
49585932 }
49595933 */
49605934
4961
- void ImportVRMLX3D()
4962
- {
4963
- if (GrafreeD.standAlone)
4964
- {
4965
- /**/
4966
- FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
4967
- browser.show();
4968
- String filename = browser.getFile();
4969
- if (filename != null && filename.length() > 0)
4970
- {
4971
- String fullname = browser.getDirectory() + filename;
4972
- LoadVRMLX3D(fullname);
4973
- }
4974
- /**/
4975
- }
4976
- }
4977
-
49785935 String GetFile(String dialogName)
49795936 {
4980
- if (GrafreeD.standAlone)
5937
+ if (Grafreed.standAlone)
49815938 {
49825939 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
49835940 browser.show();
....@@ -5045,7 +6002,44 @@
50456002 cButton clearpanelButton;
50466003 cButton unselectButton;
50476004
6005
+ cButton restoreCameraButton;
6006
+
6007
+ cButton saveButton;
50486008 cButton oneStepButton;
6009
+
6010
+ cButton groupButton;
6011
+ cButton ungroupButton;
6012
+ cButton compositeButton;
6013
+ cButton switchButton;
6014
+ cButton loopButton;
6015
+ cButton textureButton;
6016
+
6017
+ cButton skybox1Button;
6018
+ cButton skybox2Button;
6019
+ cButton skybox3Button;
6020
+ cButton skybox4Button;
6021
+ cButton skybox5Button;
6022
+ cButton skybox6Button;
6023
+ cButton skybox7Button;
6024
+
6025
+ cButton skybox11Button;
6026
+ cButton skybox12Button;
6027
+ cButton skybox13Button;
6028
+ cButton skybox14Button;
6029
+ cButton skybox15Button;
6030
+ cButton skybox16Button;
6031
+ cButton skybox17Button;
6032
+
6033
+ cButton gridButton;
6034
+ cButton boxButton;
6035
+ cButton sphereButton;
6036
+ cButton coneButton;
6037
+ cButton torusButton;
6038
+ cButton superButton;
6039
+ cButton kleinButton;
6040
+ cButton particlesButton;
6041
+ cButton overlayButton;
6042
+ cButton lightButton;
50496043
50506044 cButton screenfitButton;
50516045 cButton screenfitpointButton;
....@@ -5058,14 +6052,6 @@
50586052
50596053 cButton setsupportButton;
50606054
5061
- cButton twoButton;
5062
- cButton sixButton;
5063
- cButton threeButton;
5064
- cButton sevenButton;
5065
- cButton fourButton; // full panel
5066
- cButton oneButton; // full XYZ
5067
- //cButton currentLayout;
5068
-
50696055 //
50706056 //Composite
50716057 Object3D // to do !!
....@@ -5075,9 +6061,11 @@
50756061 //JTree jTree;
50766062 private MenuItem lookAtItem;
50776063 private MenuItem lookFromItem;
5078
- private MenuItem switchItem;
6064
+ private MenuItem switchViewItem;
50796065 private MenuItem cutItem;
5080
- private MenuItem duplicateItem;
6066
+ private MenuItem undoItem;
6067
+ private MenuItem redoItem;
6068
+ private JMenuItem duplicateItem;
50816069 private MenuItem cloneItem;
50826070 private MenuItem cloneSupportItem;
50836071 private MenuItem overwriteGeoItem;
....@@ -5090,7 +6078,7 @@
50906078 private MenuItem linkverticesItem;
50916079 private MenuItem relinkverticesItem;
50926080 private MenuItem setMasterItem;
5093
- private MenuItem resetMeshItem;
6081
+ private MenuItem resetAllItem;
50946082 private MenuItem stepAllItem;
50956083 private MenuItem revertMeshItem;
50966084 private MenuItem poseMeshItem;
....@@ -5105,7 +6093,7 @@
51056093 private MenuItem pasteLinkItem;
51066094 private MenuItem pasteCloneItem;
51076095 private MenuItem pasteExpandItem;
5108
- private MenuItem clearItem;
6096
+ private MenuItem deleteItem;
51096097 private MenuItem clearAllItem;
51106098 private MenuItem genUVItem;
51116099 private MenuItem genNormalsMESHItem;
....@@ -5140,6 +6128,10 @@
51406128 private MenuItem showleavesItem;
51416129 private MenuItem markleavesItem;
51426130 private MenuItem unmarkleavesItem;
6131
+ private MenuItem rewindleavesItem;
6132
+ private MenuItem unrewindleavesItem;
6133
+ private MenuItem randomleavesItem;
6134
+ private MenuItem unrandomleavesItem;
51436135
51446136 private MenuItem flipVItem;
51456137 private MenuItem unflipVItem;
....@@ -5151,15 +6143,17 @@
51516143 private MenuItem panoTexturesItem;
51526144
51536145 private MenuItem resetCentroidItem;
5154
- private MenuItem transformgeometryItem;
6146
+ private MenuItem resetCentroidXZItem;
51556147 private MenuItem resetTransformItem;
6148
+ private MenuItem transformGeometryItem;
6149
+ private MenuItem transformChildrenItem;
51566150 private MenuItem hideItem;
51576151 private MenuItem grabItem;
51586152 private MenuItem backItem;
51596153 private MenuItem frontItem;
51606154 private MenuItem cameraItem;
51616155 private MenuItem compositeItem;
5162
- private MenuItem randomItem;
6156
+ private MenuItem switchItem;
51636157 private MenuItem physicsItem;
51646158 private MenuItem frameselectorItem;
51656159 private MenuItem scriptNodeItem;
....@@ -5183,6 +6177,8 @@
51836177 private MenuItem attachBumpItem;
51846178 private MenuItem detachBumpItem;
51856179 private MenuItem pigmentBumpItem;
6180
+ private MenuItem embedTexturesItem;
6181
+ private MenuItem deEmbedTexturesItem;
51866182
51876183 private MenuItem particleItem;
51886184 private MenuItem ragdollItem;
....@@ -5221,11 +6217,6 @@
52216217 private MenuItem doubleItem;
52226218 private MenuItem tripleItem;
52236219
5224
- private MenuItem importGFDItem;
5225
- private MenuItem importVRMLX3DItem;
5226
- private MenuItem import3DSItem;
5227
- private MenuItem importOBJItem;
5228
-
52296220 private MenuItem computeAOItem;
52306221 private MenuItem recompileItem;
52316222 private MenuItem editScriptItem;
....@@ -5235,4 +6226,8 @@
52356226 private MenuItem analyzeItem;
52366227 private MenuItem dumpItem;
52376228 //boolean freezemodel = false;
6229
+
6230
+ Menu cameraMenu;
6231
+ MenuItem editCameraItem;
6232
+ MenuItem restoreCameraItem;
52386233 }