Normand Briere
2019-07-30 7a77e39423398b7ad8bf7e80cf45fac6817000c2
GroupEditor.java
....@@ -23,6 +23,302 @@
2323 DragGestureListener, DragSourceListener, DropTargetListener,
2424 ItemListener // ListSelectionListener
2525 {
26
+
27
+ public void AddSkyboxButton(String f, String s, cGridBag row)
28
+ {
29
+ cButton skyboxButton;
30
+ final String path = "cubemaps/" + f + "-skyboxes/" + s;
31
+ row.add(skyboxButton = GetButton(path + "/preview.jpg", !Grafreed.NIMBUSLAF));
32
+ //row.add(skyboxButton = GetButton(path + "/negx.jpg", !Grafreed.NIMBUSLAF));
33
+ skyboxButton.setToolTipText(s);
34
+ skyboxButton.addActionListener(new ActionListener()
35
+ {
36
+ @Override
37
+ public void actionPerformed(ActionEvent e)
38
+ {
39
+ ChangeSkybox(path);
40
+ }
41
+ });
42
+ }
43
+
44
+ public void AddSkyboxTab0(JTabbedPane skyboxpanel)
45
+ {
46
+ cGridBag tab0 = new cGridBag().setVertical(true);
47
+
48
+ tab0.setName("Urban");
49
+ skyboxpanel.add(tab0);
50
+
51
+ cGridBag row0 = new cGridBag();
52
+ cGridBag row1 = new cGridBag();
53
+ cGridBag row2 = new cGridBag();
54
+ cGridBag row3 = new cGridBag();
55
+ cGridBag row4 = new cGridBag();
56
+ cGridBag row5 = new cGridBag();
57
+ cGridBag row6 = new cGridBag();
58
+
59
+ AddSkyboxButton("default", "rgb", row0);
60
+ //AddSkyboxButton("default", "cornell", row0);
61
+ AddSkyboxButton("penguins", "dust", row0);
62
+ AddSkyboxButton("penguins", "tropic", row0);
63
+ AddSkyboxButton("penguins", "yonder", row0);
64
+
65
+ AddSkyboxButton("default", "uffizi", row1);
66
+ AddSkyboxButton("bridge", "Bridge", row1);
67
+ AddSkyboxButton("bridge", "Bridge2", row1);
68
+ AddSkyboxButton("urban", "GamlaStan2", row1);
69
+
70
+ AddSkyboxButton("urban", "Parliament", row2);
71
+ AddSkyboxButton("urban", "Roundabout", row2);
72
+ AddSkyboxButton("urban", "SaintLazarusChurch", row2);
73
+ AddSkyboxButton("urban", "SaintLazarusChurch2", row2);
74
+
75
+ AddSkyboxButton("urban", "SaintLazarusChurch3", row3);
76
+ AddSkyboxButton("urban", "UnionSquare", row3);
77
+ AddSkyboxButton("urban", "Medborgarplatsen", row3);
78
+ AddSkyboxButton("park", "BerzeliiPark", row3);
79
+
80
+ AddSkyboxButton("park", "Buddha", row4);
81
+ AddSkyboxButton("park", "CNTower2", row4);
82
+ AddSkyboxButton("park", "NiagaraFalls1", row4);
83
+ AddSkyboxButton("park", "NiagaraFalls3", row4);
84
+
85
+ AddSkyboxButton("park", "Park", row5);
86
+ AddSkyboxButton("park", "Pond", row5);
87
+ AddSkyboxButton("park", "Skansen", row5);
88
+ AddSkyboxButton("park", "Skansen2", row5);
89
+
90
+ AddSkyboxButton("park", "Skansen3", row6);
91
+ AddSkyboxButton("park", "Skansen4", row6);
92
+ AddSkyboxButton("park", "Skansen5", row6);
93
+ AddSkyboxButton("persson", "VancouverConventionCentre", row6);
94
+
95
+ tab0.add(row0);
96
+ tab0.add(row1);
97
+ tab0.add(row2);
98
+ tab0.add(row3);
99
+ tab0.add(row4);
100
+ tab0.add(row5);
101
+ tab0.add(row6);
102
+
103
+ for (int i=5; --i>=0;)
104
+ {
105
+ //oe.toolboxPanel.Return();
106
+ //tab0.add(new cGridBag());
107
+ }
108
+ }
109
+
110
+ public void AddSkyboxTab1(JTabbedPane skyboxpanel)
111
+ {
112
+ cGridBag tab0 = new cGridBag().setVertical(true);
113
+
114
+ tab0.setName("Nature");
115
+ skyboxpanel.add(tab0);
116
+
117
+ cGridBag row0 = new cGridBag();
118
+ cGridBag row1 = new cGridBag();
119
+ cGridBag row2 = new cGridBag();
120
+ cGridBag row3 = new cGridBag();
121
+ cGridBag row4 = new cGridBag();
122
+ cGridBag row5 = new cGridBag();
123
+ cGridBag row6 = new cGridBag();
124
+
125
+ AddSkyboxButton("beach", "HeartInTheSand", row0);
126
+ AddSkyboxButton("beach", "LarnacaBeach", row0);
127
+ AddSkyboxButton("beach", "PalmTrees", row0);
128
+ AddSkyboxButton("beach", "Tenerife", row0);
129
+
130
+ AddSkyboxButton("beach", "Tenerife2", row1);
131
+ AddSkyboxButton("beach", "Tenerife3", row1);
132
+ AddSkyboxButton("field", "FishPond", row1);
133
+ AddSkyboxButton("field", "Footballfield", row1);
134
+
135
+ AddSkyboxButton("field", "Meadow", row2);
136
+ AddSkyboxButton("field", "Sorsele", row2);
137
+ AddSkyboxButton("field", "Sorsele2", row2);
138
+ AddSkyboxButton("field", "Sorsele3", row2);
139
+
140
+ AddSkyboxButton("forest", "Brudslojan", row3);
141
+ AddSkyboxButton("forest", "Langholmen2", row3);
142
+ AddSkyboxButton("forest", "Plants", row3);
143
+ AddSkyboxButton("mountain", "Maskonaive", row3);
144
+
145
+ AddSkyboxButton("mountain", "Maskonaive2", row4);
146
+ AddSkyboxButton("mountain", "Maskonaive3", row4);
147
+ AddSkyboxButton("mountain", "Teide", row4);
148
+ AddSkyboxButton("park", "Tantolunden4", row4);
149
+
150
+ AddSkyboxButton("park", "Stairs", row5);
151
+ AddSkyboxButton("default", "skycube", row6);
152
+ AddSkyboxButton("rocky", "Langholmen", row5);
153
+ AddSkyboxButton("rocky", "Skinnarviksberget", row5);
154
+
155
+ AddSkyboxButton("rocky", "Tantolunden6", row5);
156
+ AddSkyboxButton("default", "CloudyHills", row6);
157
+ AddSkyboxButton("daz", "Autumn", row6);
158
+ AddSkyboxButton("daz", "MountainTrail", row6);
159
+ /*
160
+Autumn
161
+Greenlands
162
+MountainTrail
163
+Oasis
164
+TheRock
165
+TopOfTheWorld
166
+Winter
167
+ */
168
+
169
+ tab0.add(row0);
170
+ tab0.add(row1);
171
+ tab0.add(row2);
172
+ tab0.add(row3);
173
+ tab0.add(row4);
174
+ tab0.add(row5);
175
+ tab0.add(row6);
176
+
177
+ for (int i=5; --i>=0;)
178
+ {
179
+ //oe.toolboxPanel.Return();
180
+ //tab0.add(new cGridBag());
181
+ }
182
+ }
183
+
184
+ public void AddSkyboxTab2(JTabbedPane skyboxpanel)
185
+ {
186
+ cGridBag tab0 = new cGridBag().setVertical(true);
187
+
188
+ tab0.setName("Night");
189
+ skyboxpanel.add(tab0);
190
+
191
+ cGridBag row0 = new cGridBag();
192
+ cGridBag row1 = new cGridBag();
193
+ cGridBag row2 = new cGridBag();
194
+ cGridBag row3 = new cGridBag();
195
+ cGridBag row4 = new cGridBag();
196
+ cGridBag row5 = new cGridBag();
197
+ cGridBag row6 = new cGridBag();
198
+
199
+ AddSkyboxButton("night", "NightPath", row0);
200
+ AddSkyboxButton("night", "PondNight", row0);
201
+ AddSkyboxButton("night", "Powerlines", row0);
202
+ AddSkyboxButton("night", "SwedishRoyalCastle", row0);
203
+
204
+ AddSkyboxButton("urban", "CNTower", row1);
205
+ AddSkyboxButton("bridge", "ArstaBridge", row1);
206
+ AddSkyboxButton("rocky", "Riddarfjarden", row1);
207
+ AddSkyboxButton("penguins", "sleepyhollow", row1);
208
+
209
+ AddSkyboxButton("penguins", "kenon_star", row2);
210
+ AddSkyboxButton("persson", "corona", row2);
211
+ AddSkyboxButton("persson", "spaceskybox", row2);
212
+ AddSkyboxButton("indoors", "Vasa", row2);
213
+
214
+ AddSkyboxButton("winter", "Backyard", row3);
215
+ AddSkyboxButton("winter", "Creek", row3);
216
+ AddSkyboxButton("winter", "FootballField3", row3);
217
+ AddSkyboxButton("winter", "Forest", row3);
218
+
219
+ AddSkyboxButton("winter", "HornstullsStrand2", row4);
220
+ AddSkyboxButton("winter", "House", row4);
221
+ AddSkyboxButton("winter", "IceLake", row4);
222
+ AddSkyboxButton("winter", "IceRiver", row4);
223
+
224
+ AddSkyboxButton("winter", "Park3", row5);
225
+ AddSkyboxButton("winter", "PondWinter", row5);
226
+ AddSkyboxButton("winter", "Tantolunden5", row5);
227
+ AddSkyboxButton("winter", "Vindelalven", row5);
228
+
229
+ AddSkyboxButton("daz", "TheRock", row6);
230
+ AddSkyboxButton("daz", "TopOfTheWorld", row6);
231
+ AddSkyboxButton("daz", "Winter", row6);
232
+ AddSkyboxButton("mountain", "Ryfjallet", row6);
233
+
234
+ tab0.add(row0);
235
+ tab0.add(row1);
236
+ tab0.add(row2);
237
+ tab0.add(row3);
238
+ tab0.add(row4);
239
+ tab0.add(row5);
240
+ tab0.add(row6);
241
+
242
+ for (int i=5; --i>=0;)
243
+ {
244
+ //oe.toolboxPanel.Return();
245
+ //tab0.add(new cGridBag());
246
+ }
247
+ }
248
+
249
+ public void AddSkyboxTab3(JTabbedPane skyboxpanel)
250
+ {
251
+ cGridBag tab0 = new cGridBag().setVertical(true);
252
+
253
+ tab0.setName("Others");
254
+ skyboxpanel.add(tab0);
255
+
256
+ cGridBag row0 = new cGridBag();
257
+ cGridBag row1 = new cGridBag();
258
+ cGridBag row2 = new cGridBag();
259
+ cGridBag row3 = new cGridBag();
260
+ cGridBag row4 = new cGridBag();
261
+ cGridBag row5 = new cGridBag();
262
+ cGridBag row6 = new cGridBag();
263
+
264
+ AddSkyboxButton("mayhem", "afterrain", row0);
265
+ AddSkyboxButton("mayhem", "aqua4", row0);
266
+ AddSkyboxButton("mayhem", "aqua9", row0);
267
+ AddSkyboxButton("mayhem", "flame", row0);
268
+
269
+ AddSkyboxButton("mayhem", "h2s", row1);
270
+ AddSkyboxButton("mayhem", "prehistoric", row1);
271
+ AddSkyboxButton("mayhem", "scorched", row1);
272
+ AddSkyboxButton("penguins", "desertdawn", row1);
273
+
274
+ AddSkyboxButton("persson", "Citadella", row2);
275
+ AddSkyboxButton("persson", "Citadella2", row2);
276
+ AddSkyboxButton("persson", "clouds1", row2);
277
+ AddSkyboxButton("penguins", "wrath", row2);
278
+
279
+ AddSkyboxButton("persson", "FishermansBastion", row3);
280
+ AddSkyboxButton("persson", "HeroesSquare", row3);
281
+ AddSkyboxButton("indoors", "DallasW", row3);
282
+ AddSkyboxButton("indoors", "MarriottMadisonWest", row3);
283
+
284
+ AddSkyboxButton("persson", "LancellottiChapel", row4);
285
+ AddSkyboxButton("persson", "PereaBeach1", row4);
286
+ AddSkyboxButton("persson", "PereaBeach2", row4);
287
+ AddSkyboxButton("persson", "redeclipse", row4);
288
+
289
+ AddSkyboxButton("daz", "Greenlands", row5);
290
+ AddSkyboxButton("daz", "Oasis", row5);
291
+ AddSkyboxButton("elyvisions", "arch3", row5);
292
+ AddSkyboxButton("elyvisions", "calm_sea", row5);
293
+
294
+ AddSkyboxButton("elyvisions", "rainbow", row6);
295
+ AddSkyboxButton("elyvisions", "distant_sunset", row6);
296
+ AddSkyboxButton("elyvisions", "heaven", row6);
297
+ AddSkyboxButton("elyvisions", "hot", row6);
298
+
299
+ tab0.add(row0);
300
+ tab0.add(row1);
301
+ tab0.add(row2);
302
+ tab0.add(row3);
303
+ tab0.add(row4);
304
+ tab0.add(row5);
305
+ tab0.add(row6);
306
+
307
+ for (int i=5; --i>=0;)
308
+ {
309
+ //oe.toolboxPanel.Return();
310
+ //tab0.add(new cGridBag());
311
+ }
312
+ }
313
+
314
+ public void ChangeSkybox(String name)
315
+ {
316
+ //cameraView.envyoff = false;
317
+ group.skyboxname = name;
318
+ group.skyboxext = "jpg";
319
+ cameraView.repaint();
320
+ }
321
+
26322 //ObjEditor objEditor;
27323 public void closeUI2()
28324 {
....@@ -60,6 +356,12 @@
60356 this.copy = this.group = group;
61357 //selectees = this.group.selectees;
62358
359
+ if (copy.versions == null)
360
+ {
361
+ copy.versions = new byte[100][];
362
+ copy.versionindex = -1;
363
+ }
364
+
63365 if(ui)
64366 SetupUI(objEditor);
65367 }
....@@ -74,16 +376,28 @@
74376 this.copy = this.group = copy;
75377 //selectees = this.group.selectees;
76378
77
- SetupMenu2(objEditor);
379
+ SetupMenu2(this); //objEditor);
78380 SetupUI2(objEditor);
79381 objEditor.SetupUI(true);
80382 SetupViews(objEditor);
81383
82384 ((cRadio)radioPanel.getComponent(0)).SetCamera(cameraView.renderCamera, true);
385
+
386
+ if (copy.versions == null)
387
+ {
388
+ copy.versions = new byte[100][];
389
+ copy.versionindex = -1;
390
+
391
+ Save(true);
392
+ }
83393 }
84394
85395 void CloneSelection(boolean supports)
86396 {
397
+ if (Globals.REPLACEONMAKE)
398
+ Save();
399
+ boolean keep = Globals.REPLACEONMAKE;
400
+ Globals.REPLACEONMAKE = false;
87401 // Object3D keep = GrafreeD.clipboard;
88402 //Object3D obj;
89403 for (int i=0; i<group.selection.size(); i++)// Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -94,18 +408,19 @@
94408
95409 makeSomething(clone, i==group.selection.size()-1);
96410 }
411
+ Globals.REPLACEONMAKE = keep;
97412 }
98413
99414 void CloneClipboard(boolean supports)
100415 {
101
- assert(GrafreeD.clipboard.parent == null);
102
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
103
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
104
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
105
- makeSomething(CloneObject(GrafreeD.clipboard.get(0), false));
416
+ assert(Grafreed.clipboard.parent == null);
417
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
418
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
419
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
420
+ makeSomething(CloneObject(Grafreed.clipboard.get(0), false));
106421 else
107
- makeSomething(CloneObject(GrafreeD.clipboard, false));
108
- GrafreeD.clipboard.get(0).parent = keepparent;
422
+ makeSomething(CloneObject(Grafreed.clipboard, false));
423
+ Grafreed.clipboard.get(0).parent = keepparent;
109424 }
110425
111426 static Object3D CloneObject(Object3D obj, boolean supports)
....@@ -119,7 +434,7 @@
119434 // obj.support = null;
120435 if (!supports)
121436 obj.SaveSupports();
122
- Object3D clone = (Object3D)GrafreeD.clone(obj);
437
+ Object3D clone = (Object3D)Grafreed.clone(obj);
123438 obj.parent = parent;
124439 // obj.support = support;
125440 // clone.support = support; // aout 2013
....@@ -148,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("New version");
936
+ saveButton.addActionListener(this);
937
+
938
+ copyOptionsPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
939
+ undoButton.setToolTipText("Previous version");
940
+ undoButton.addActionListener(this);
941
+ undoButton.setEnabled(false);
942
+
943
+ cGridBag updown = new cGridBag().setVertical(true);
944
+ updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
945
+ restoreButton.setToolTipText("Restore current");
946
+ restoreButton.addActionListener(this);
947
+ restoreButton.setEnabled(false);
948
+
949
+ updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
950
+ replaceButton.setToolTipText("Replace current");
951
+ replaceButton.addActionListener(this);
952
+ replaceButton.setEnabled(false);
953
+
954
+ copyOptionsPanel.add(updown);
955
+
956
+ copyOptionsPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
957
+ redoButton.setToolTipText("Next version");
958
+ redoButton.addActionListener(this);
959
+ redoButton.setEnabled(false);
960
+
961
+ oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints);
962
+ liveCB.setToolTipText("Enable animation");
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("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 = new cButton("C", !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 = sixButton; // sevenButton;
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);
....@@ -676,6 +1242,8 @@
6761242 // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
6771243 // speakerMocapCB.addItemListener(this);
6781244
1245
+ panel.Return();
1246
+
6791247 if (false)
6801248 {
6811249 // handled in scripts
....@@ -690,42 +1258,85 @@
6901258 //constraints.gridy += 1;
6911259 panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
6921260 smoothfocusCB.addItemListener(this);
1261
+ panel.Return();
6931262 }
6941263
6951264 //constraints.gridx += 1;
6961265 //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
6971266 // debugCB.addItemListener(this);
6981267
1268
+ panel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
1269
+ trackCB.setToolTipText("Enable tracking target");
1270
+ trackCB.addItemListener(this);
1271
+
6991272 panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
1273
+ oeilCB.setToolTipText("Move camera when tracking");
7001274 oeilCB.addItemListener(this);
7011275
1276
+ panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints);
1277
+ shadowCB.setToolTipText("When live compute shadows");
1278
+ shadowCB.addItemListener(this);
1279
+
1280
+ panel.Return();
1281
+ panel.add(toggleTextureCB = new cCheckBox("Textures", CameraPane.textureon)); //, constraints);
1282
+ toggleTextureCB.setToolTipText("Load textures");
1283
+ toggleTextureCB.addItemListener(this);
1284
+
1285
+ panel.add(toggleSwitchCB = new cCheckBox("Switch", CameraPane.SWITCH)); //, constraints);
1286
+ toggleSwitchCB.setToolTipText("Choose a single item");
1287
+ toggleSwitchCB.addItemListener(this);
1288
+
1289
+ panel.add(autokeepCB = new cCheckBox("Auto-replace", Globals.REPLACEONMAKE)); //, constraints);
1290
+ autokeepCB.setToolTipText("On structure change");
1291
+ autokeepCB.addItemListener(this);
1292
+
1293
+ panel.Return();
1294
+ if (Globals.ADVANCED)
1295
+ {
7021296 panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
7031297 lookAtCB.setToolTipText("Look-at target");
7041298 lookAtCB.addItemListener(this);
1299
+ }
7051300
7061301 }
7071302
7081303 cGridBag fill = new cGridBag();
709
-
7101304 fill.preferredHeight = 200;
1305
+ cGridBag fill2 = new cGridBag();
1306
+ fill2.preferredHeight = 200;
1307
+ cGridBag fill3 = new cGridBag();
1308
+ fill3.preferredHeight = 200;
7111309
7121310 panel.add(fill);
1311
+ panel.add(fill2);
1312
+ panel.add(fill3);
7131313
7141314 }
7151315
7161316 void EditObject(Object3D obj)
7171317 {
7181318 cRadio radioButton = new cRadio(obj.name);
1319
+
1320
+ // June 2019. Patch to avoid bug with transparency.
1321
+ radioButton.hadMaterial = obj.material != null;
1322
+ if (!radioButton.hadMaterial)
1323
+ {
1324
+ obj.material = new cMaterial();
1325
+ }
1326
+
7191327 radioButton.SetObject(obj);
720
- radioButton.layout = sevenButton;
1328
+ radioButton.layout = sixButton; // sevenButton;
7211329 radioButton.SetCamera(cameraView.renderCamera, false);
7221330 radioButton.addActionListener(this);
7231331 radioPanel.add(radioButton);
7241332 buttonGroup.add(radioButton);
7251333 radioButton.doClick();
7261334 }
1335
+
7271336 void SetupViews(ObjEditor oe)
7281337 {
1338
+ theFrame = this;
1339
+
7291340 oe.SetupViews();
7301341
7311342 System.out.println("SetupViews");
....@@ -734,23 +1345,28 @@
7341345 /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this);
7351346 }
7361347
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;
1348
+ cToggleButton liveCB;
1349
+ cCheckBox supportCB;
1350
+ cCheckBox localCB;
1351
+ cCheckBox crowdCB;
1352
+ cCheckBox smoothCB;
1353
+ cToggleButton fastCB;
1354
+ cCheckBox slowCB;
1355
+ cCheckBox boxCB;
1356
+ cCheckBox zoomBoxCB;
1357
+ cCheckBox freezeCB;
1358
+ //cToggleButton trackCB;
1359
+ cCheckBox trackCB;
1360
+ cCheckBox smoothfocusCB;
7481361 // JCheckBox speakerMocapCB;
749
- JCheckBox speakerCameraCB;
750
- JCheckBox speakerFocusCB;
751
- JCheckBox debugCB;
752
- JCheckBox oeilCB;
753
- JCheckBox lookAtCB;
1362
+ cCheckBox speakerCameraCB;
1363
+ cCheckBox speakerFocusCB;
1364
+ cCheckBox debugCB;
1365
+
1366
+ cCheckBox oeilCB;
1367
+ cCheckBox shadowCB;
1368
+ cCheckBox autokeepCB;
1369
+ cCheckBox lookAtCB;
7541370
7551371 // static int COLOR = 1;
7561372 // static int MATERIAL = 2;
....@@ -758,9 +1374,9 @@
7581374
7591375 int dropAttributes = Object3D.COLOR | Object3D.MATERIAL;
7601376
761
- JCheckBox colorCB;
762
- JCheckBox materialCB;
763
- JCheckBox textureCB;
1377
+ cCheckBox colorCB;
1378
+ cCheckBox materialCB;
1379
+ cCheckBox textureCB;
7641380
7651381 public void itemStateChanged(ItemEvent e)
7661382 {
....@@ -788,6 +1404,7 @@
7881404 } else if(e.getSource() == liveCB)
7891405 {
7901406 cameraView.ToggleLive();
1407
+ refreshContents(false);
7911408 }
7921409 else if(e.getSource() == supportCB)
7931410 {
....@@ -852,6 +1469,18 @@
8521469 {
8531470 cameraView.ToggleOeil();
8541471 }
1472
+ else if(e.getSource() == shadowCB)
1473
+ {
1474
+ Globals.COMPUTESHADOWWHENLIVE ^= true;
1475
+ }
1476
+ else if(e.getSource() == freezeCB)
1477
+ {
1478
+ Globals.FREEZEONMOVE ^= true;
1479
+ }
1480
+ else if(e.getSource() == autokeepCB)
1481
+ {
1482
+ Globals.REPLACEONMAKE ^= true;
1483
+ }
8551484 else if(e.getSource() == lookAtCB)
8561485 {
8571486 cameraView.ToggleLookAt();
....@@ -868,7 +1497,8 @@
8681497
8691498 /**/
8701499 //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this);
871
- TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1500
+ //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1501
+ TreePath path = objEditor.jTree.getSelectionPath();
8721502 if ((path == null) || (path.getPathCount() <= 1)) {
8731503 // We can't move the root node or an empty selection
8741504 return;
....@@ -931,8 +1561,6 @@
9311561 }
9321562 }
9331563
934
- String string = (String) object;
935
-
9361564 System.out.println("Transfer = " + object + "; drop : " + target);
9371565 // if( object instanceof java.io.File[])
9381566 // {
....@@ -940,6 +1568,8 @@
9401568 // objEditor.DropFile((java.io.File[]) object, true);
9411569 // return;
9421570 // }
1571
+
1572
+ String string = object.toString();
9431573
9441574 // File path for Mac and Windows
9451575 if (string.charAt(0) == '/' || string.charAt(1) == ':')
....@@ -969,7 +1599,7 @@
9691599
9701600 flashIt = false;
9711601 CameraPane pane = (CameraPane) target;
972
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1602
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
9731603 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
9741604
9751605 if (group.selection.size() == 1)
....@@ -985,23 +1615,33 @@
9851615
9861616 assert target == objEditor.jTree;
9871617 TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y);
1618
+ Object3D destinationLeaf;
9881619 try {
989
- Object3D dummy = (Composite) destinationPath.getLastPathComponent();
1620
+ destinationLeaf = (Composite) destinationPath.getLastPathComponent();
9901621 } catch (Exception e) {
9911622 System.out.println("destinationPath : " + destinationPath);
9921623 return;
9931624 }
9941625
995
- if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1626
+ for (int i=group.selection.size(); --i>=0;)
9961627 {
1628
+ Object3D child = (Object3D)group.selection.elementAt(i);
1629
+
1630
+ // Cannot move into itself
1631
+ if (child == destinationLeaf)
1632
+ return;
1633
+ }
1634
+
1635
+// june 2019 if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1636
+// {
9971637 loadClipboard(true);
9981638 objEditor.jTree.setSelectionPath(destinationPath);
9991639 pasteInto(false, false);
1000
- } else {
1001
- loadClipboard(false);
1002
- objEditor.jTree.setSelectionPath(destinationPath);
1003
- pasteInto(false, false); // true); // ???
1004
- }
1640
+// } else {
1641
+// loadClipboard(false);
1642
+// objEditor.jTree.setSelectionPath(destinationPath);
1643
+// pasteInto(false, false); // true); // ???
1644
+// }
10051645 }
10061646 public void dropActionChanged(DropTargetDragEvent dtde)
10071647 // Called if the user has modified the current drop gesture
....@@ -1106,22 +1746,30 @@
11061746 {
11071747 //heightFieldItem = menu.add(new MenuItem("Height Field"));
11081748 //heightFieldItem.addActionListener(this);
1109
- gridItem = menu.add(new MenuItem("Grid"));
1110
- gridItem.addActionListener(this);
1111
- rectoidItem = menu.add(new MenuItem("Box"));
1112
- rectoidItem.addActionListener(this);
1113
- ellipsoidItem = menu.add(new MenuItem("Sphere"));
1114
- ellipsoidItem.addActionListener(this);
1115
- coneItem = menu.add(new MenuItem("Cone"));
1116
- coneItem.addActionListener(this);
1117
- torusItem = menu.add(new MenuItem("Torus"));
1118
- torusItem.addActionListener(this);
1119
- superItem = menu.add(new MenuItem("Superellipsoid"));
1120
- superItem.addActionListener(this);
1749
+// gridItem = menu.add(new MenuItem("Grid"));
1750
+// gridItem.addActionListener(this);
1751
+// rectoidItem = menu.add(new MenuItem("Box"));
1752
+// rectoidItem.addActionListener(this);
1753
+// ellipsoidItem = menu.add(new MenuItem("Sphere"));
1754
+// ellipsoidItem.addActionListener(this);
1755
+// coneItem = menu.add(new MenuItem("Cone"));
1756
+// coneItem.addActionListener(this);
1757
+// torusItem = menu.add(new MenuItem("Torus"));
1758
+// torusItem.addActionListener(this);
1759
+// superItem = menu.add(new MenuItem("Superellipsoid"));
1760
+// superItem.addActionListener(this);
1761
+
1762
+ cameraItem = menu.add(new MenuItem("Camera"));
1763
+ cameraItem.addActionListener(this);
1764
+
1765
+ if (!Globals.ADVANCED)
1766
+ {
11211767 kleinItem = menu.add(new MenuItem("Klein Bottle"));
11221768 kleinItem.addActionListener(this);
1123
- particleItem = menu.add(new MenuItem("Particle system"));
1124
- particleItem.addActionListener(this);
1769
+ }
1770
+
1771
+// particleItem = menu.add(new MenuItem("Particle system"));
1772
+// particleItem.addActionListener(this);
11251773 if (Globals.ADVANCED)
11261774 {
11271775 ragdollItem = menu.add(new MenuItem("Rag Walk"));
....@@ -1147,15 +1795,15 @@
11471795 }
11481796 bezierItem = menu.add(new MenuItem("Bezier Patch"));
11491797 bezierItem.addActionListener(this);
1150
- overlayItem = menu.add(new MenuItem("Overlay"));
1151
- overlayItem.addActionListener(this);
1152
- lightItem = menu.add(new MenuItem("Light"));
1153
- lightItem.addActionListener(this);
1798
+// overlayItem = menu.add(new MenuItem("Overlay"));
1799
+// overlayItem.addActionListener(this);
1800
+// lightItem = menu.add(new MenuItem("Light"));
1801
+// lightItem.addActionListener(this);
11541802 menu.add("-");
11551803 //superLoopItem = menu.add(new MenuItem("Super Loop"));
11561804 //superLoopItem.addActionListener(this);
1157
- loopItem = menu.add(new MenuItem("Loop"));
1158
- loopItem.addActionListener(this);
1805
+// loopItem = menu.add(new MenuItem("Loop"));
1806
+// loopItem.addActionListener(this);
11591807 doubleItem = menu.add(new MenuItem("Fork"));
11601808 doubleItem.addActionListener(this);
11611809 if (Globals.ADVANCED)
....@@ -1171,6 +1819,9 @@
11711819 animationItem.addItemListener(this);
11721820 animationItem.setState(Globals.ANIMATION);
11731821
1822
+ menu.add(archiveItem = new MenuItem("Archive3D..."));
1823
+ archiveItem.addActionListener(this);
1824
+
11741825 menu.add("-");
11751826 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
11761827 parseverticesItem.addActionListener(this);
....@@ -1183,6 +1834,8 @@
11831834 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
11841835 reduce34MorphItem.addActionListener(this);
11851836 menu.add("-");
1837
+ menu.add(memoryItem = new MenuItem("Memory Usage"));
1838
+ memoryItem.addActionListener(this);
11861839 menu.add(computeAOItem = new MenuItem("Compute AO"));
11871840 computeAOItem.addActionListener(this);
11881841
....@@ -1191,11 +1844,9 @@
11911844 mirrorItem = menu.add(new MenuItem("Mirror Poses"));
11921845 mirrorItem.addActionListener(this);
11931846 menu.add("-");
1194
- menu.add(memoryItem = new MenuItem("Memory Usage"));
1195
- memoryItem.addActionListener(this);
11961847 menu.add(analyzeItem = new MenuItem("Analyze"));
11971848 analyzeItem.addActionListener(this);
1198
- menu.add(dumpItem = new MenuItem("Dump"));
1849
+ menu.add(dumpItem = new MenuItem("Print"));
11991850 dumpItem.addActionListener(this);
12001851 // menu.add(pathItem = new MenuItem("From-to path"));
12011852 // pathItem.addActionListener(this);
....@@ -1336,9 +1987,34 @@
13361987 shadow.material = new cMaterial(obj.material);
13371988 shadow.material.diffuse = 0.0001f;
13381989 shadow.material.specular = 0.0001f;
1990
+ //shadow.projectedVertices[1].x = 300;
13391991
13401992 makeSomething(shadow);
13411993 }
1994
+
1995
+ private void ClearUnpinned()
1996
+ {
1997
+ //for (Object3D obj : listUI)
1998
+ for (int i=listUI.size(); --i>=0;)
1999
+ {
2000
+ Object3D obj = listUI.elementAt(i);
2001
+ if (!obj.pinned)
2002
+ {
2003
+ obj.CloseUI();
2004
+ listUI.remove(i);
2005
+ }
2006
+ }
2007
+ }
2008
+
2009
+ private void EditElement(Object3D elem, boolean newWindow)
2010
+ {
2011
+ // if (!(elem instanceof Composite))
2012
+ // newWindow = false;
2013
+ listUI.add(elem);
2014
+ elem.openEditWindow(this, newWindow); //, false);
2015
+ System.out.println("edit : " + elem);
2016
+ elem.editWindow.refreshContents(true); // ? new
2017
+ }
13422018
13432019 /**
13442020 * applyExample
....@@ -1542,9 +2218,9 @@
15422218
15432219 void Overwrite(int mask)
15442220 {
1545
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2221
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
15462222 {
1547
- Object3D content = GrafreeD.clipboard.get(0);
2223
+ Object3D content = Grafreed.clipboard.get(0);
15482224
15492225 if (content instanceof cGroup && ((cGroup)content).transientlink )
15502226 content = ((cGroup)content).get(0);
....@@ -1583,7 +2259,7 @@
15832259 {
15842260 ScreenFit();
15852261 } else
1586
- if (source == switchItem)
2262
+ if (source == switchViewItem)
15872263 {
15882264 cVector v1 = new cVector();
15892265 cVector v2 = new cVector();
....@@ -1592,11 +2268,11 @@
15922268 objEditor.cameraView.renderCamera.setAim(v2, v1);
15932269 objEditor.cameraView.repaint();
15942270 } else
1595
- if (source == rectoidItem)
2271
+ if (source == rectoidItem || source == boxButton)
15962272 {
15972273 makeSomething(new Box());
15982274 } else
1599
- if (source == particleItem)
2275
+ if (source == particleItem || source == particlesButton)
16002276 {
16012277 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
16022278 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1675,27 +2351,27 @@
16752351
16762352 makeSomething(obj);
16772353 } else
1678
- if (source == gridItem)
2354
+ if (source == gridItem || source == gridButton)
16792355 {
16802356 makeSomething(new Grid());
16812357 } else
1682
- if (source == ellipsoidItem)
2358
+ if (source == ellipsoidItem || source == sphereButton)
16832359 {
16842360 makeSomething(new Sphere());
16852361 } else
1686
- if (source == coneItem)
2362
+ if (source == coneItem || source == coneButton)
16872363 {
16882364 makeSomething(new Cone());
16892365 } else
1690
- if (source == torusItem)
2366
+ if (source == torusItem || source == torusButton)
16912367 {
16922368 makeSomething(new Torus());
16932369 } else
1694
- if (source == superItem)
2370
+ if (source == superItem || source == superButton)
16952371 {
16962372 makeSomething(new Superellipsoid());
16972373 } else
1698
- if (source == kleinItem)
2374
+ if (source == kleinItem || source == kleinButton)
16992375 {
17002376 makeSomething(new Klein());
17012377 } else
....@@ -1715,7 +2391,7 @@
17152391 {
17162392 makeSomething(new BezierSurface());
17172393 } else
1718
- if (source == overlayItem)
2394
+ if (source == overlayItem || source == overlayButton)
17192395 {
17202396 /*
17212397 Object3D obj = new BezierSurface(5,8);
....@@ -1763,10 +2439,27 @@
17632439 s.setup();
17642440 makeSomething(s);
17652441 } else
1766
- if (source == lightItem)
2442
+ if (source == lightItem || source == lightButton)
17672443 {
17682444 makeSomething(new Light());
17692445 } else
2446
+// if (source == skybox1Button ||
2447
+// source == skybox2Button ||
2448
+// source == skybox3Button ||
2449
+// source == skybox4Button ||
2450
+// source == skybox5Button ||
2451
+// source == skybox6Button ||
2452
+// source == skybox7Button ||
2453
+// source == skybox11Button ||
2454
+// source == skybox12Button ||
2455
+// source == skybox13Button ||
2456
+// source == skybox14Button ||
2457
+// source == skybox15Button ||
2458
+// source == skybox16Button ||
2459
+// source == skybox17Button)
2460
+// {
2461
+// ChangeSkybox(source);
2462
+// } else
17702463 if (source == csgItem)
17712464 {
17722465 group(new CSG());
....@@ -1813,30 +2506,30 @@
18132506
18142507 group(g);
18152508 } else
1816
- if (source == loopItem)
2509
+ if (source == loopItem || source == loopButton)
18172510 {
18182511 Composite csg = new GroupLeaf();
18192512 csg.count = 5;
18202513 group(csg);
1821
- Composite child = new cGroup();
2514
+ Composite child = new cGroup("Branch");
18222515 csg.addChild(child);
18232516 child.addChild(csg);
18242517 } else
18252518 if (source == doubleItem)
18262519 {
1827
- Composite csg = new GroupLeaf();
2520
+ Composite csg = new GroupLeaf("Fork");
18282521 csg.count = 5;
18292522 group(csg);
1830
- Composite child = new cGroup();
2523
+ Composite child = new cGroup("Branch A");
18312524 csg.addChild(child);
18322525 child.addChild(csg);
1833
- child = new cGroup();
2526
+ child = new cGroup("Branch B");
18342527 csg.addChild(child);
18352528 child.addChild(csg);
18362529 } else
18372530 if (source == tripleItem)
18382531 {
1839
- Composite csg = new GroupLeaf();
2532
+ Composite csg = new GroupLeaf("Trident");
18402533 csg.count = 4;
18412534 group(csg);
18422535 Composite child = new cGroup();
....@@ -1849,35 +2542,10 @@
18492542 csg.addChild(child);
18502543 child.addChild(csg);
18512544 } else
1852
-
1853
- if (source == importGFDItem)
1854
- {
1855
- ImportGFD();
1856
- } else
1857
- if (source == importVRMLX3DItem)
1858
- {
1859
- ImportVRMLX3D();
1860
- } else
1861
- if (source == import3DSItem)
1862
- {
1863
- objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
1864
- } else
1865
- if (source == importOBJItem)
1866
- {
1867
- //objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1868
- FileDialog browser = new FileDialog(frame, "Import OBJ", FileDialog.LOAD);
1869
- browser.setVisible(true);
1870
- String filename = browser.getFile();
1871
- if (filename != null && filename.length() > 0)
1872
- {
1873
- String fullname = browser.getDirectory() + filename;
1874
- makeSomething(ReadOBJ(fullname), true);
1875
- }
1876
- } else
18772545 if (source == computeAOItem)
18782546 {
18792547 Globals.drawMode = CameraPane.OCCLUSION;
1880
- Globals.theRenderer.repaint();
2548
+ cameraView.repaint();
18812549 } else
18822550 if (source == recompileItem)
18832551 {
....@@ -1892,7 +2560,7 @@
18922560 if (source == invariantsItem)
18932561 {
18942562 System.out.println("Invariants:");
1895
- GrafreeD.grafreeD.universe.invariants();
2563
+ Grafreed.grafreeD.universe.invariants();
18962564 } else
18972565 if (source == memoryItem)
18982566 {
....@@ -1911,6 +2579,46 @@
19112579 {
19122580 DumpObject();
19132581 } else
2582
+ if (source == minButton)
2583
+ {
2584
+ Minimize();
2585
+ } else
2586
+ if (source == maxButton)
2587
+ {
2588
+ Maximize();
2589
+ } else
2590
+ if (source == fullButton)
2591
+ {
2592
+ ToggleFullScreen();
2593
+ } else
2594
+ if (source == undoButton)
2595
+ {
2596
+ // Go to previous version
2597
+ //if (!Undo())
2598
+ //java.awt.Toolkit.getDefaultToolkit().beep();
2599
+ Undo();
2600
+ } else
2601
+ if (source == restoreButton)
2602
+ {
2603
+ // Restore current version
2604
+ Restore();
2605
+ } else
2606
+ if (source == replaceButton)
2607
+ {
2608
+ // Overwrite current version
2609
+ Replace();
2610
+ } else
2611
+ if (source == redoButton)
2612
+ {
2613
+ // Go to next version
2614
+ Redo();
2615
+ } else
2616
+ if (source == saveButton)
2617
+ {
2618
+ // Save a new version
2619
+ if (!Save(true))
2620
+ java.awt.Toolkit.getDefaultToolkit().beep();
2621
+ } else
19142622 if (source == oneStepButton)
19152623 {
19162624 Globals.ONESTEP = true;
....@@ -1918,17 +2626,14 @@
19182626 } else
19192627 if (source == screenfitButton)
19202628 {
1921
- //Reload(lastConverter, lastFilename, true);
19222629 ScreenFit();
19232630 } else
19242631 if (source == screenfitpointButton)
19252632 {
1926
- //Reload(lastConverter, lastFilename, true);
19272633 ScreenFitPoint();
19282634 } else
19292635 if (source == snapobjectButton)
19302636 {
1931
- //Reload(lastConverter, lastFilename, true);
19322637 SnapObject();
19332638 } else
19342639 // if (event.getSource() == recompileButton)
....@@ -1965,12 +2670,20 @@
19652670 {
19662671 loadClipboard(true);
19672672 } else
2673
+ if (source == undoItem)
2674
+ {
2675
+ Undo();
2676
+ } else
2677
+ if (source == redoItem)
2678
+ {
2679
+ Redo();
2680
+ } else
19682681 if (source == duplicateItem)
19692682 {
1970
- Object3D keep = GrafreeD.clipboard;
2683
+ Object3D keep = Grafreed.clipboard;
19712684 loadClipboard(false);
19722685 paste(false);
1973
- GrafreeD.clipboard = keep;
2686
+ Grafreed.clipboard = keep;
19742687 } else
19752688 if (source == cloneItem)
19762689 {
....@@ -2190,9 +2903,9 @@
21902903 // group.selection.get(0).setMasterThis(content); // should be identity
21912904 // refreshContents();
21922905 // }
2193
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2906
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
21942907 {
2195
- Object3D content = GrafreeD.clipboard.get(0);
2908
+ Object3D content = Grafreed.clipboard.get(0);
21962909
21972910 if (content instanceof cGroup && ((cGroup)content).transientlink )
21982911 content = ((cGroup)content).get(0);
....@@ -2242,9 +2955,9 @@
22422955 } else
22432956 if (source == setMasterItem)
22442957 {
2245
- if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
2958
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
22462959 {
2247
- Object3D content = GrafreeD.clipboard.get(0);
2960
+ Object3D content = Grafreed.clipboard.get(0);
22482961
22492962 if (content instanceof cGroup && ((cGroup)content).transientlink )
22502963 content = ((cGroup)content).get(0);
....@@ -2257,9 +2970,9 @@
22572970 {
22582971 if (group.selection.size() == 1)
22592972 {
2260
- if (GrafreeD.clipboard.size() == 1)
2973
+ if (Grafreed.clipboard.size() == 1)
22612974 {
2262
- Object3D content = GrafreeD.clipboard.get(0);
2975
+ Object3D content = Grafreed.clipboard.get(0);
22632976
22642977 if (content instanceof cGroup && ((cGroup)content).transientlink )
22652978 content = ((cGroup)content).get(0);
....@@ -2276,7 +2989,7 @@
22762989 {
22772990 RevertMeshes();
22782991 } else
2279
- if (source == resetMeshItem)
2992
+ if (source == resetAllItem)
22802993 {
22812994 ResetAll();
22822995 } else
....@@ -2284,7 +2997,7 @@
22842997 {
22852998 StepAll();
22862999 } else
2287
- if (source == clearItem) // || event.getSource() == clearButton)
3000
+ if (source == deleteItem) // || event.getSource() == clearButton)
22883001 {
22893002 //int indices[] = jList.getSelectedIndices();
22903003 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2296,9 +3009,9 @@
22963009 {
22973010 ClearSelection(true);
22983011 } else
2299
- if (source == grabItem)
3012
+ if (source == grabItem || source == groupButton)
23003013 {
2301
- group(new cGroup(), true);
3014
+ group(new cGroup(), false); // true);
23023015 } else
23033016 if (source == hideItem)
23043017 {
....@@ -2316,11 +3029,11 @@
23163029 {
23173030 makeSomething(new Camera());
23183031 } else
2319
- if (source == compositeItem)
3032
+ if (source == compositeItem || source == compositeButton)
23203033 {
23213034 group(new Composite());
23223035 } else
2323
- if (source == randomItem)
3036
+ if (source == switchItem || source == switchButton)
23243037 {
23253038 RandomNode random = new RandomNode();
23263039 group(random);
....@@ -2422,7 +3135,7 @@
24223135 {
24233136 group(new cLinker());
24243137 } else
2425
- if (source == textureItem)
3138
+ if (source == textureItem || source == textureButton)
24263139 {
24273140 group(new TextureNode());
24283141 } else
....@@ -2442,17 +3155,30 @@
24423155 {
24433156 CastShadow(2);
24443157 } else
2445
- if (source == ungroupItem)
3158
+ if (source == ungroupItem || source == ungroupButton)
24463159 {
2447
- //ungroup();
3160
+ boolean hasRoot = false;
3161
+
24483162 for (int i=0; i<group.selection.size(); i++)
24493163 {
2450
- Ungroup(group.selection.get(i));
3164
+ if (group.selection.get(i) == group)
3165
+ {
3166
+ hasRoot = true;
3167
+ break;
3168
+ }
24513169 }
24523170
2453
- ClearSelection(false);
2454
-
2455
- refreshContents();
3171
+ if (!hasRoot)
3172
+ {
3173
+ for (int i=0; i<group.selection.size(); i++)
3174
+ {
3175
+ Ungroup(group.selection.get(i));
3176
+ }
3177
+
3178
+ ClearSelection(false);
3179
+
3180
+ refreshContents();
3181
+ }
24563182 } else
24573183 if (source == genUVItem)
24583184 {
....@@ -2464,7 +3190,7 @@
24643190 } else
24653191 if (source == genNormalsMESHItem)
24663192 {
2467
- GenNormals(true); // TODO
3193
+ GenNormalsMESH();
24683194 } else
24693195 if (source == genNormalsORGANItem)
24703196 {
....@@ -2529,6 +3255,22 @@
25293255 if (source == unmarkleavesItem)
25303256 {
25313257 MarkLeaves(false);
3258
+ } else
3259
+ if (source == rewindleavesItem)
3260
+ {
3261
+ RewindLeaves(true);
3262
+ } else
3263
+ if (source == unrewindleavesItem)
3264
+ {
3265
+ RewindLeaves(false);
3266
+ } else
3267
+ if (source == randomleavesItem)
3268
+ {
3269
+ RandomLeaves(true);
3270
+ } else
3271
+ if (source == unrandomleavesItem)
3272
+ {
3273
+ RandomLeaves(false);
25323274 } else
25333275 if (source == flipVItem)
25343276 {
....@@ -2614,9 +3356,13 @@
26143356 {
26153357 SmoothMesh();
26163358 } else
2617
- if (source == transformgeometryItem)
3359
+ if (source == transformGeometryItem)
26183360 {
26193361 TransformGeometry();
3362
+ } else
3363
+ if (source == transformChildrenItem)
3364
+ {
3365
+ TransformChildren();
26203366 } else
26213367 if (source == resetTransformItem)
26223368 {
....@@ -2624,7 +3370,11 @@
26243370 } else
26253371 if (source == resetCentroidItem)
26263372 {
2627
- ResetCentroid();
3373
+ ResetCentroid(true);
3374
+ } else
3375
+ if (source == resetCentroidXZItem)
3376
+ {
3377
+ ResetCentroid(false);
26283378 } else
26293379 if (source == resetParentItem)
26303380 {
....@@ -2729,7 +3479,7 @@
27293479 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
27303480 {
27313481 obj = (Object3D)e.nextElement();
2732
- obj.SetBumpTexture(null);
3482
+ obj.ResetBumpTexture();
27333483 }
27343484
27353485 refreshContents();
....@@ -2745,6 +3495,31 @@
27453495
27463496 refreshContents();
27473497 } else
3498
+ if (source == embedTexturesItem)
3499
+ {
3500
+ Object3D obj;
3501
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3502
+ {
3503
+ obj = (Object3D)e.nextElement();
3504
+ obj.EmbedTextures(true);
3505
+ }
3506
+
3507
+ refreshContents();
3508
+ } else
3509
+ if (source == deEmbedTexturesItem)
3510
+ {
3511
+ Object3D obj;
3512
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3513
+ {
3514
+ obj = (Object3D)e.nextElement();
3515
+ obj.EmbedTextures(false);
3516
+ }
3517
+
3518
+ CameraPane.texturepigment.clear();
3519
+ CameraPane.texturebump.clear();
3520
+
3521
+ refreshContents();
3522
+ } else
27483523 if (source == flashSelectionButton)
27493524 {
27503525 CameraPane.flash = true;
....@@ -2756,6 +3531,10 @@
27563531 if (source == twoButton)
27573532 {
27583533 radio.layout = twoButton;
3534
+
3535
+ if (CameraPane.FULLSCREEN)
3536
+ fullscreenLayout = radio.layout;
3537
+
27593538 // bug
27603539 //gridPanel.setDividerLocation(1.0);
27613540 //bigPanel.setDividerLocation(0.0);
....@@ -2788,10 +3567,31 @@
27883567 bigThree.ClearUI();
27893568 bigThree.add(centralPanel);
27903569 bigThree.FlushUI();
3570
+
3571
+ cameraView.requestFocusInWindow();
3572
+
3573
+// refreshContents(true);
3574
+//
3575
+// try
3576
+// {
3577
+// java.awt.Robot bot = new java.awt.Robot();
3578
+// int mask = InputEvent.BUTTON1_MASK;
3579
+// bot.mouseMove(100, 100);
3580
+// bot.mousePress(mask);
3581
+// bot.mouseRelease(mask);
3582
+// }
3583
+// catch (Exception e)
3584
+// {
3585
+//
3586
+// }
3587
+
27913588 } else
27923589 if (source == threeButton)
27933590 {
27943591 radio.layout = threeButton;
3592
+
3593
+ if (CameraPane.FULLSCREEN)
3594
+ fullscreenLayout = radio.layout;
27953595
27963596 // bigThree.remove(scenePanel);
27973597 // bigThree.remove(centralPanel);
....@@ -2821,13 +3621,18 @@
28213621 // centralPanel.setVisible(true);
28223622 // XYZPanel.setVisible(true);
28233623 bigThree.ClearUI();
3624
+ bigThree.add(scenePanel);
28243625 bigThree.add(centralPanel);
2825
- bigThree.add(XYZPanel);
28263626 bigThree.FlushUI();
3627
+
3628
+ cameraView.requestFocusInWindow();
28273629 } else
28283630 if (source == fourButton)
28293631 {
28303632 radio.layout = fourButton;
3633
+
3634
+ if (CameraPane.FULLSCREEN)
3635
+ fullscreenLayout = radio.layout;
28313636
28323637 // bigThree.remove(scenePanel);
28333638 // bigThree.remove(centralPanel);
....@@ -2859,10 +3664,15 @@
28593664 bigThree.ClearUI();
28603665 bigThree.add(scenePanel);
28613666 bigThree.FlushUI();
3667
+
3668
+ cameraView.requestFocusInWindow();
28623669 } else
28633670 if (source == sixButton)
28643671 {
28653672 radio.layout = sixButton;
3673
+
3674
+ if (CameraPane.FULLSCREEN)
3675
+ fullscreenLayout = radio.layout;
28663676
28673677 // bigThree.remove(scenePanel);
28683678 // bigThree.remove(centralPanel);
....@@ -2892,13 +3702,18 @@
28923702 // centralPanel.setVisible(true);
28933703 // XYZPanel.setVisible(false);
28943704 bigThree.ClearUI();
2895
- bigThree.add(scenePanel);
28963705 bigThree.add(centralPanel);
3706
+ bigThree.add(scenePanel);
28973707 bigThree.FlushUI();
3708
+
3709
+ cameraView.requestFocusInWindow();
28983710 } else
28993711 if (source == sevenButton)
29003712 {
29013713 radio.layout = sevenButton;
3714
+
3715
+ if (CameraPane.FULLSCREEN)
3716
+ fullscreenLayout = radio.layout;
29023717
29033718 // bigThree.remove(scenePanel);
29043719 // bigThree.remove(centralPanel);
....@@ -2932,6 +3747,8 @@
29323747 bigThree.add(centralPanel);
29333748 bigThree.add(XYZPanel);
29343749 bigThree.FlushUI();
3750
+
3751
+ cameraView.requestFocusInWindow();
29353752 } else
29363753 if (source == rootButton)
29373754 {
....@@ -2943,6 +3760,7 @@
29433760 EditObject(obj);
29443761 }
29453762
3763
+ cameraView.requestFocusInWindow();
29463764 refreshContents(true);
29473765 } else
29483766 if (source == closeButton)
....@@ -2952,22 +3770,37 @@
29523770 for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
29533771 {
29543772 ab = (cRadio)e.nextElement();
2955
- if(ab.getModel().isSelected() && ab.GetObject() != client)
3773
+ if (ab.getModel().isSelected() && ab.GetObject() != client)
29563774 {
3775
+ // Patch to avoid bug with transparency.
3776
+ if (!ab.hadMaterial)
3777
+ {
3778
+ ab.object.material = null;
3779
+ }
3780
+
29573781 buttonGroup.remove(ab);
29583782 radioPanel.remove(ab);
29593783
2960
- ab.GetObject().editWindow = null;
3784
+ //ab.GetObject().editWindow = null;
3785
+ ab.GetObject().manipWindow = null;
29613786 // ab.GetObject().objectUI = null; // ?????????
29623787
29633788 ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick();
29643789 break;
29653790 }
29663791 }
3792
+
3793
+ cameraView.requestFocusInWindow();
29673794 refreshContents(true);
29683795 } else
29693796 if (source == editItem || source == editButton)
29703797 {
3798
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3799
+ {
3800
+ Object3D child = (Object3D)e.nextElement();
3801
+ child.pinned = true;
3802
+ }
3803
+
29713804 EditSelection(false);
29723805 } else
29733806 if (source == uneditButton)
....@@ -2977,10 +3810,11 @@
29773810 Object3D child = (Object3D)e.nextElement();
29783811 if(child.editWindow != null)
29793812 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3813
+ child.pinned = false;
29803814 child.CloseUI();
29813815 listUI.remove(child);
29823816
2983
- child.editWindow = null; // ???????????
3817
+ //child.editWindow = null; // ???????????
29843818 }
29853819 objEditor.ctrlPanel.FlushUI();
29863820 //objEditor.jTree.clearSelection();
....@@ -2993,6 +3827,7 @@
29933827 //copy.ClearUI();
29943828 for (Object3D obj : listUI)
29953829 {
3830
+ obj.pinned = false;
29963831 obj.CloseUI();
29973832 }
29983833 listUI.clear();
....@@ -3002,7 +3837,7 @@
30023837 {
30033838 assert(copy == group);
30043839
3005
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3840
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
30063841
30073842 for (Object3D obj : listUI)
30083843 {
....@@ -3051,6 +3886,9 @@
30513886 }
30523887
30533888 copy = group;
3889
+
3890
+ SetUndoStates();
3891
+
30543892 //Globals.theRenderer.object = group;
30553893 if(!useclient)
30563894 {
....@@ -3066,20 +3904,46 @@
30663904 frontView.object = group;
30673905 sideView.object = group;
30683906 }
3069
- group.editWindow = this;
3907
+
3908
+// fix "+" issue
3909
+ //group.editWindow = this;
3910
+ group.manipWindow = this;
3911
+
30703912 /*
30713913 currentLayout = radio.layout;
30723914 if (currentLayout == null)
30733915 currentLayout = sevenButton;
30743916 */
30753917 radio.layout.doClick();
3918
+
3919
+ ClearUnpinned();
3920
+ //Grafreed.Assert(group != null);
3921
+ //Grafreed.Assert(group.selection != null);
3922
+ SetPinStates(group.selection == null || group.selection.size() > 0);
3923
+ if (group.selection == null || group.selection.size() == 1)
3924
+ EditSelection(false);
30763925 keepparent = group.parent;
30773926 // PARENT = NULL or not???
30783927 //group.parent = null; // ROOT
30793928 //group.attributes = -1;
30803929 ResetModel();
3930
+
3931
+ cameraView.requestFocusInWindow();
30813932 refreshContents(true);
3082
- }
3933
+ } else if (event.getSource() == editCameraItem)
3934
+ {
3935
+ cameraView.ProtectCamera();
3936
+ cameraView.repaint();
3937
+ return;
3938
+ } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton)
3939
+ {
3940
+ cameraView.RevertCamera();
3941
+ cameraView.repaint();
3942
+ return;
3943
+ // } else if (event.getSource() == textureButton)
3944
+ // {
3945
+ // return; // true;
3946
+ }
30833947 else
30843948 {
30853949 //return super.action(event, arg);
....@@ -3088,7 +3952,6 @@
30883952 }
30893953
30903954 boolean useclient = false;
3091
- cRadio radio;
30923955
30933956 void ToggleRoot()
30943957 {
....@@ -3140,6 +4003,28 @@
31404003 refreshContents();
31414004 }
31424005
4006
+ void TransformChildren()
4007
+ {
4008
+ Object3D obj;
4009
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
4010
+ {
4011
+ obj = (Object3D)e.nextElement();
4012
+ obj.KeepTextureMatrices();
4013
+ obj.TransformChildren();
4014
+ obj.RestoreTextureMatrices();
4015
+
4016
+// if (obj.parent == null)
4017
+// {
4018
+// System.out.println("NULL PARENT!");
4019
+// new Exception().printStackTrace();
4020
+// }
4021
+// else
4022
+// TouchTransform(obj);
4023
+// //obj.parent.Touch();
4024
+ }
4025
+
4026
+ refreshContents();
4027
+ }
31434028
31444029 void ResetTransform()
31454030 {
....@@ -3252,7 +4137,7 @@
32524137 refreshContents();
32534138 }
32544139
3255
- void ResetCentroid()
4140
+ void ResetCentroid(boolean full)
32564141 {
32574142 Object3D obj;
32584143 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3267,12 +4152,16 @@
32674152 LA.matIdentity(Object3D.mat);
32684153 obj.getBounds(minima, maxima, false);
32694154 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3270
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
4155
+ if (full)
4156
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
32714157 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
32724158 obj.TransformMesh(Object3D.mat);
4159
+
32734160 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3274
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
4161
+ if (full)
4162
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
32754163 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
4164
+
32764165 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
32774166 //Object3D.mat[3][0] = -Object3D.mat[3][0];
32784167 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3301,7 +4190,8 @@
33014190
33024191 int size = obj.MemorySize();
33034192
3304
- System.err.println((size/1024) + " KB is the size of " + obj);
4193
+ //System.err.println((size/1024) + " KB is the size of " + obj);
4194
+ System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)");
33054195 }
33064196 }
33074197 catch (Exception e)
....@@ -3338,9 +4228,9 @@
33384228 obj = (Object3D)e.nextElement();
33394229
33404230 System.out.println("Object is: " + obj);
3341
- GrafreeD.AnalyzeObject(obj);
4231
+ Grafreed.AnalyzeObject(obj);
33424232 System.out.println("Boundary rep: " + obj.bRep);
3343
- GrafreeD.AnalyzeObject(obj.bRep);
4233
+ Grafreed.AnalyzeObject(obj.bRep);
33444234
33454235 // System.err.println((size/1024) + " KB is the size of " + obj);
33464236 }
....@@ -3382,6 +4272,13 @@
33824272 void GenNormals(boolean crease)
33834273 {
33844274 group.GenNormalsS(crease);
4275
+
4276
+ refreshContents();
4277
+ }
4278
+
4279
+ void GenNormalsMESH()
4280
+ {
4281
+ group.GenNormalsMeshS();
33854282
33864283 refreshContents();
33874284 }
....@@ -3554,8 +4451,8 @@
35544451
35554452 void ParseVertices()
35564453 {
3557
- boolean epsequal = GrafreeD.epsequal;
3558
- GrafreeD.epsequal = true;
4454
+ boolean epsequal = Grafreed.epsequal;
4455
+ Grafreed.epsequal = true;
35594456
35604457 for (int i=0; i<group.selection.size(); i++)
35614458 {
....@@ -3580,7 +4477,7 @@
35804477 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
35814478 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
35824479
3583
- g.add(GrafreeD.clipboard);
4480
+ g.add(Grafreed.clipboard);
35844481
35854482 buffer.add(g);
35864483 }
....@@ -3595,7 +4492,7 @@
35954492 makeSomething(buffer, i==group.selection.size()-1);
35964493 }
35974494
3598
- GrafreeD.epsequal = epsequal;
4495
+ Grafreed.epsequal = epsequal;
35994496
36004497 refreshContents();
36014498 }
....@@ -3613,7 +4510,16 @@
36134510 String pigment = Object3D.GetPigment(tex);
36144511 //String bump = Object3D.GetBump(tex);
36154512
3616
- com.sun.opengl.util.texture.TextureData texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
4513
+ com.sun.opengl.util.texture.TextureData texturedata = null;
4514
+
4515
+ try
4516
+ {
4517
+ texturedata = Globals.theRenderer.GetTextureData(tex, false, node.texres);
4518
+ }
4519
+ catch (Exception e)
4520
+ {
4521
+ System.err.println("FAIL: " + node);
4522
+ }
36174523
36184524 double s = v.s;
36194525
....@@ -3745,7 +4651,7 @@
37454651 return;
37464652
37474653 Object3D poses = group.selection.get(0);
3748
- Object3D ref = GrafreeD.clipboard.get(0);
4654
+ Object3D ref = Grafreed.clipboard.get(0);
37494655
37504656 Object3D newgroup = new Object3D("Po:" + poses.name);
37514657
....@@ -3939,9 +4845,9 @@
39394845
39404846 void ClipMesh()
39414847 {
3942
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
4848
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
39434849 {
3944
- Object3D content = GrafreeD.clipboard.get(0);
4850
+ Object3D content = Grafreed.clipboard.get(0);
39454851
39464852 if (content instanceof cGroup && ((cGroup)content).transientlink )
39474853 content = ((cGroup)content).get(0);
....@@ -3950,7 +4856,7 @@
39504856 // {
39514857 // group.selection.get(i).ClipMesh(GrafreeD.clipboard);
39524858 // }
3953
- group.selection.ClipMesh(GrafreeD.clipboard);
4859
+ group.selection.ClipMesh(Grafreed.clipboard);
39544860 }
39554861 // group.selection.ClipMesh(GrafreeD.clipboard);
39564862 System.out.println("DONE.");
....@@ -3997,6 +4903,18 @@
39974903 void MarkLeaves(boolean hide)
39984904 {
39994905 group.selection.MarkLeaves(hide);
4906
+ refreshContents();
4907
+ }
4908
+
4909
+ void RewindLeaves(boolean hide)
4910
+ {
4911
+ group.selection.RewindLeaves(hide);
4912
+ refreshContents();
4913
+ }
4914
+
4915
+ void RandomLeaves(boolean hide)
4916
+ {
4917
+ group.selection.RandomLeaves(hide);
40004918 refreshContents();
40014919 }
40024920
....@@ -4071,28 +4989,25 @@
40714989 // }
40724990 // }
40734991
4074
- static boolean allparams = true;
4075
-
4076
- static Vector<Object3D> listUI = new Vector<Object3D>();
4077
-
40784992 void EditSelection(boolean newWindow)
40794993 {
4994
+ if (group.selection == null)
4995
+ {
4996
+ EditElement(group, newWindow); // ? new
4997
+ return;
4998
+ }
4999
+
40805000 // aConstraints.gridy = 0;
40815001 for (int i=0; i<group.selection.size(); i++)
40825002 {
40835003 //System.out.println("edit : " + objectPanel.indexOfTab("Material"));
40845004 //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false);
4085
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
5005
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
40865006
40875007 Object3D elem = (Object3D)group.selection.elementAt(i);
4088
- if(elem != group)
5008
+ if(elem != group || !newWindow)
40895009 {
4090
- // if (!(elem instanceof Composite))
4091
- // newWindow = false;
4092
- listUI.add(elem);
4093
- elem.openEditWindow(this, newWindow); //, false);
4094
- System.out.println("edit : " + elem);
4095
- elem.editWindow.refreshContents(true); // ? new
5010
+ EditElement(elem, newWindow); // ? new
40965011 }
40975012 }
40985013 }
....@@ -4167,7 +5082,8 @@
41675082 //new Exception().printStackTrace();
41685083
41695084 freezemodel = true;
4170
-
5085
+ ClearUnpinned();
5086
+
41715087 /**/
41725088 //switch (event.id)
41735089 {
....@@ -4175,7 +5091,6 @@
41755091 //case 702: // Event.LIST_DESELECT
41765092 group.deselectAll();
41775093 TreePath tps[] = objEditor.jTree.getSelectionPaths();
4178
- objEditor.ClearInfo(); // .GetMaterial());
41795094 if (tps != null)
41805095 {
41815096 for (int i=0; i < tps.length; i++)
....@@ -4184,10 +5099,8 @@
41845099
41855100 //if (child.parent != null)
41865101 //child.parent.addSelectee(child);
5102
+ objEditor.SetMaterial(child);
41875103 group.addSelectee(child);
4188
- objEditor.SetMaterial(child); // .GetMaterial());
4189
- objEditor.AddInfo(child, this, true); // .GetMaterial());
4190
- System.err.println("info : " + child.GetPath());
41915104 }
41925105 }
41935106 // else
....@@ -4197,20 +5110,28 @@
41975110 // System.err.println("info : " + group.GetPath());
41985111 // }
41995112
4200
- objEditor.SetText(); // jan 2014
4201
-
4202
- if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
5113
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera))
42035114 CameraPane.flash = true;
42045115
4205
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
5116
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
42065117 // a camera
42075118 {
4208
- CameraPane.camerachangeframe = 0; // don't refuse it
4209
- Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
5119
+ if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crash the camera because of invalid lightspace
5120
+ {
5121
+ CameraPane.camerachangeframe = 0; // don't refuse it
5122
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
5123
+ }
42105124 // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
42115125 // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
42125126 }
42135127
5128
+ if (tps != null && tps.length == 1)
5129
+ {
5130
+ EditSelection(false);
5131
+ }
5132
+
5133
+ SetPinStates(tps != null && tps.length > 0);
5134
+
42145135 refreshContents();
42155136 //return true;
42165137 }
....@@ -4219,6 +5140,35 @@
42195140
42205141 freezemodel = false;
42215142 }
5143
+
5144
+ void SetPinStates(boolean enabled)
5145
+ {
5146
+ editButton.setEnabled(enabled);
5147
+ uneditButton.setEnabled(enabled);
5148
+ unselectButton.setEnabled(enabled);
5149
+ flashSelectionButton.setEnabled(enabled);
5150
+ }
5151
+
5152
+ void refreshContents(boolean cp)
5153
+ {
5154
+ if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info"))
5155
+ if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING)
5156
+ {
5157
+ objEditor.ClearInfo(); // .GetMaterial());
5158
+
5159
+ for (int i=0; i < group.selection.Size(); i++)
5160
+ {
5161
+ Object3D child = (Object3D) group.selection.get(i);
5162
+
5163
+ objEditor.AddInfo(child, this, true);
5164
+ System.err.println("info : " + child.GetPath());
5165
+ }
5166
+
5167
+ objEditor.SetText(); // jan 2014
5168
+ }
5169
+
5170
+ super.refreshContents(cp);
5171
+ }
42225172
42235173 void linkSomething(Object3D thing)
42245174 {
....@@ -4290,16 +5240,19 @@
42905240 {
42915241 if (group.selection.isEmpty())
42925242 return;
4293
- GrafreeD.clipboardIsTempGroup = false;
5243
+
5244
+ Grafreed.clipboardIsTempGroup = false;
42945245 Composite tGroup = null;
42955246 if (group.selection.size() > 0) // 1)
42965247 {
42975248 tGroup = new cGroup();
4298
- GrafreeD.clipboardIsTempGroup = true;
5249
+ Grafreed.clipboardIsTempGroup = true;
42995250 }
43005251
43015252 if (cut)
43025253 {
5254
+// if (Globals.SAVEONMAKE) // Moved to the clipboard, no need to save.
5255
+// Save();
43035256 //int indices[] = jList.getSelectedIndices();
43045257 //for (int i = indices.length - 1; i >= 0; i--)
43055258 //jList.remove(indices[i]);
....@@ -4335,16 +5288,16 @@
43355288 //System.out.println("cut " + child);
43365289 //System.out.println("parent = " + child.parent);
43375290 // tmp.addChild(child);
4338
- if (GrafreeD.clipboardIsTempGroup)
5291
+ if (Grafreed.clipboardIsTempGroup)
43395292 tGroup.add/*Child*/(tmp);
43405293 else
4341
- GrafreeD.clipboard = tmp;
5294
+ Grafreed.clipboard = tmp;
43425295 }
43435296 else
4344
- if (GrafreeD.clipboardIsTempGroup)
5297
+ if (Grafreed.clipboardIsTempGroup)
43455298 tGroup.add/*Child*/(child);
43465299 else
4347
- GrafreeD.clipboard = child;
5300
+ Grafreed.clipboard = child;
43485301 }
43495302
43505303 //ResetModel();
....@@ -4376,21 +5329,23 @@
43765329 //System.out.println("cut " + elem);
43775330 //System.out.println("parent = " + elem.parent);
43785331 // tmp.addChild(elem);
4379
- if (GrafreeD.clipboardIsTempGroup)
5332
+ if (Grafreed.clipboardIsTempGroup)
43805333 tGroup.add/*Child*/(tmp);
43815334 else
4382
- GrafreeD.clipboard = tmp;
5335
+ Grafreed.clipboard = tmp;
43835336 }
43845337 else
4385
- if (GrafreeD.clipboardIsTempGroup)
5338
+ if (Grafreed.clipboardIsTempGroup)
43865339 tGroup.add/*Child*/(child);
43875340 else
4388
- GrafreeD.clipboard = child;
5341
+ Grafreed.clipboard = child;
43895342 }
43905343
43915344 }
4392
- if (GrafreeD.clipboardIsTempGroup)
4393
- GrafreeD.clipboard = tGroup;
5345
+
5346
+ if (Grafreed.clipboardIsTempGroup)
5347
+ Grafreed.clipboard = tGroup;
5348
+
43945349 if (cut)
43955350 {
43965351 ResetModel();
....@@ -4400,11 +5355,15 @@
44005355
44015356 void paste(boolean expand)
44025357 {
5358
+ if (Globals.REPLACEONMAKE)
5359
+ Save();
5360
+ boolean keep = Globals.REPLACEONMAKE;
5361
+ Globals.REPLACEONMAKE = false;
44035362 // if (GrafreeD.clipboard == null)
44045363 // return;
44055364 boolean first = true;
44065365
4407
- if (GrafreeD.clipboardIsTempGroup)
5366
+ if (Grafreed.clipboardIsTempGroup)
44085367 {
44095368 Composite temp;
44105369
....@@ -4415,7 +5374,7 @@
44155374 temp = (Composite)Applet3D.clipboard.deepCopy();
44165375 */
44175376 Object3D elem;
4418
- for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
5377
+ for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
44195378 {
44205379 Object3D child = (Object3D)e.nextElement();
44215380
....@@ -4449,16 +5408,17 @@
44495408 //Object3D cb = Applet3D.clipboard;
44505409 //temp.addChild(cb);
44515410 //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0));
4452
- assert(GrafreeD.clipboard.parent == null);
4453
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
4454
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
4455
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
4456
- makeSomething(expand?GrafreeD.clipboard.get(0).copyExpand():GrafreeD.clipboard.get(0).deepCopy());
5411
+ assert(Grafreed.clipboard.parent == null);
5412
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
5413
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
5414
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
5415
+ makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy());
44575416 else
4458
- makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4459
- GrafreeD.clipboard.get(0).parent = keepparent;
5417
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
5418
+ Grafreed.clipboard.get(0).parent = keepparent;
44605419 }
44615420
5421
+ Globals.REPLACEONMAKE = keep;
44625422 ResetModel();
44635423 refreshContents();
44645424 }
....@@ -4505,9 +5465,9 @@
45055465 {
45065466 boolean first = true;
45075467
4508
- if (GrafreeD.clipboardIsTempGroup)
5468
+ if (Grafreed.clipboardIsTempGroup)
45095469 {
4510
- Composite temp = (Composite)GrafreeD.clipboard;
5470
+ Composite temp = (Composite)Grafreed.clipboard;
45115471 Object3D copy;
45125472 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
45135473 {
....@@ -4517,7 +5477,7 @@
45175477 }
45185478 } else
45195479 {
4520
- linkSomething(GrafreeD.clipboard); //.get(0));
5480
+ linkSomething(Grafreed.clipboard); //.get(0));
45215481 }
45225482 }
45235483 }
....@@ -4594,6 +5554,10 @@
45945554
45955555 void group(Object3D csg, boolean grab)
45965556 {
5557
+ if (Globals.REPLACEONMAKE)
5558
+ Save();
5559
+ boolean keep = Globals.REPLACEONMAKE;
5560
+ Globals.REPLACEONMAKE = false;
45975561 if (//false) // why??
45985562 !group.selection.isEmpty())
45995563 {
....@@ -4707,10 +5671,15 @@
47075671 //node.add(csg);
47085672 //makeSomething(node);
47095673 makeSomething(csg);
5674
+ Globals.REPLACEONMAKE = keep;
47105675 }
47115676
47125677 void Ungroup(Object3D g)
47135678 {
5679
+ if (Globals.REPLACEONMAKE)
5680
+ Save();
5681
+ boolean keep = Globals.REPLACEONMAKE;
5682
+ Globals.REPLACEONMAKE = false;
47145683 if (g instanceof HiddenObject)
47155684 {
47165685 HiddenObject h = (HiddenObject) g;
....@@ -4727,6 +5696,7 @@
47275696 objEditor.makeSomething(g.get(i), false);
47285697 }
47295698 }
5699
+ Globals.REPLACEONMAKE = keep;
47305700 }
47315701
47325702 void ungroup()
....@@ -4922,21 +5892,6 @@
49225892 }
49235893 */
49245894
4925
- void ImportGFD()
4926
- {
4927
- FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD);
4928
- browser.show();
4929
- String filename = browser.getFile();
4930
- if (filename != null && filename.length() > 0)
4931
- {
4932
- String fullname = browser.getDirectory() + filename;
4933
-
4934
- //Object3D readobj =
4935
- objEditor.ReadGFD(fullname, objEditor);
4936
- //makeSomething(readobj);
4937
- }
4938
- }
4939
-
49405895 /*
49415896 public void Callback(Object obj)
49425897 {
....@@ -4960,26 +5915,9 @@
49605915 }
49615916 */
49625917
4963
- void ImportVRMLX3D()
4964
- {
4965
- if (GrafreeD.standAlone)
4966
- {
4967
- /**/
4968
- FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
4969
- browser.show();
4970
- String filename = browser.getFile();
4971
- if (filename != null && filename.length() > 0)
4972
- {
4973
- String fullname = browser.getDirectory() + filename;
4974
- LoadVRMLX3D(fullname);
4975
- }
4976
- /**/
4977
- }
4978
- }
4979
-
49805918 String GetFile(String dialogName)
49815919 {
4982
- if (GrafreeD.standAlone)
5920
+ if (Grafreed.standAlone)
49835921 {
49845922 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
49855923 browser.show();
....@@ -5047,7 +5985,44 @@
50475985 cButton clearpanelButton;
50485986 cButton unselectButton;
50495987
5988
+ cButton restoreCameraButton;
5989
+
5990
+ cButton saveButton;
50505991 cButton oneStepButton;
5992
+
5993
+ cButton groupButton;
5994
+ cButton ungroupButton;
5995
+ cButton compositeButton;
5996
+ cButton switchButton;
5997
+ cButton loopButton;
5998
+ cButton textureButton;
5999
+
6000
+ cButton skybox1Button;
6001
+ cButton skybox2Button;
6002
+ cButton skybox3Button;
6003
+ cButton skybox4Button;
6004
+ cButton skybox5Button;
6005
+ cButton skybox6Button;
6006
+ cButton skybox7Button;
6007
+
6008
+ cButton skybox11Button;
6009
+ cButton skybox12Button;
6010
+ cButton skybox13Button;
6011
+ cButton skybox14Button;
6012
+ cButton skybox15Button;
6013
+ cButton skybox16Button;
6014
+ cButton skybox17Button;
6015
+
6016
+ cButton gridButton;
6017
+ cButton boxButton;
6018
+ cButton sphereButton;
6019
+ cButton coneButton;
6020
+ cButton torusButton;
6021
+ cButton superButton;
6022
+ cButton kleinButton;
6023
+ cButton particlesButton;
6024
+ cButton overlayButton;
6025
+ cButton lightButton;
50516026
50526027 cButton screenfitButton;
50536028 cButton screenfitpointButton;
....@@ -5060,14 +6035,6 @@
50606035
50616036 cButton setsupportButton;
50626037
5063
- cButton twoButton;
5064
- cButton sixButton;
5065
- cButton threeButton;
5066
- cButton sevenButton;
5067
- cButton fourButton; // full panel
5068
- cButton oneButton; // full XYZ
5069
- //cButton currentLayout;
5070
-
50716038 //
50726039 //Composite
50736040 Object3D // to do !!
....@@ -5077,9 +6044,11 @@
50776044 //JTree jTree;
50786045 private MenuItem lookAtItem;
50796046 private MenuItem lookFromItem;
5080
- private MenuItem switchItem;
6047
+ private MenuItem switchViewItem;
50816048 private MenuItem cutItem;
5082
- private MenuItem duplicateItem;
6049
+ private MenuItem undoItem;
6050
+ private MenuItem redoItem;
6051
+ private JMenuItem duplicateItem;
50836052 private MenuItem cloneItem;
50846053 private MenuItem cloneSupportItem;
50856054 private MenuItem overwriteGeoItem;
....@@ -5092,7 +6061,7 @@
50926061 private MenuItem linkverticesItem;
50936062 private MenuItem relinkverticesItem;
50946063 private MenuItem setMasterItem;
5095
- private MenuItem resetMeshItem;
6064
+ private MenuItem resetAllItem;
50966065 private MenuItem stepAllItem;
50976066 private MenuItem revertMeshItem;
50986067 private MenuItem poseMeshItem;
....@@ -5107,7 +6076,7 @@
51076076 private MenuItem pasteLinkItem;
51086077 private MenuItem pasteCloneItem;
51096078 private MenuItem pasteExpandItem;
5110
- private MenuItem clearItem;
6079
+ private MenuItem deleteItem;
51116080 private MenuItem clearAllItem;
51126081 private MenuItem genUVItem;
51136082 private MenuItem genNormalsMESHItem;
....@@ -5142,6 +6111,10 @@
51426111 private MenuItem showleavesItem;
51436112 private MenuItem markleavesItem;
51446113 private MenuItem unmarkleavesItem;
6114
+ private MenuItem rewindleavesItem;
6115
+ private MenuItem unrewindleavesItem;
6116
+ private MenuItem randomleavesItem;
6117
+ private MenuItem unrandomleavesItem;
51456118
51466119 private MenuItem flipVItem;
51476120 private MenuItem unflipVItem;
....@@ -5153,15 +6126,17 @@
51536126 private MenuItem panoTexturesItem;
51546127
51556128 private MenuItem resetCentroidItem;
5156
- private MenuItem transformgeometryItem;
6129
+ private MenuItem resetCentroidXZItem;
51576130 private MenuItem resetTransformItem;
6131
+ private MenuItem transformGeometryItem;
6132
+ private MenuItem transformChildrenItem;
51586133 private MenuItem hideItem;
51596134 private MenuItem grabItem;
51606135 private MenuItem backItem;
51616136 private MenuItem frontItem;
51626137 private MenuItem cameraItem;
51636138 private MenuItem compositeItem;
5164
- private MenuItem randomItem;
6139
+ private MenuItem switchItem;
51656140 private MenuItem physicsItem;
51666141 private MenuItem frameselectorItem;
51676142 private MenuItem scriptNodeItem;
....@@ -5185,6 +6160,8 @@
51856160 private MenuItem attachBumpItem;
51866161 private MenuItem detachBumpItem;
51876162 private MenuItem pigmentBumpItem;
6163
+ private MenuItem embedTexturesItem;
6164
+ private MenuItem deEmbedTexturesItem;
51886165
51896166 private MenuItem particleItem;
51906167 private MenuItem ragdollItem;
....@@ -5223,11 +6200,6 @@
52236200 private MenuItem doubleItem;
52246201 private MenuItem tripleItem;
52256202
5226
- private MenuItem importGFDItem;
5227
- private MenuItem importVRMLX3DItem;
5228
- private MenuItem import3DSItem;
5229
- private MenuItem importOBJItem;
5230
-
52316203 private MenuItem computeAOItem;
52326204 private MenuItem recompileItem;
52336205 private MenuItem editScriptItem;
....@@ -5237,4 +6209,8 @@
52376209 private MenuItem analyzeItem;
52386210 private MenuItem dumpItem;
52396211 //boolean freezemodel = false;
6212
+
6213
+ Menu cameraMenu;
6214
+ MenuItem editCameraItem;
6215
+ MenuItem restoreCameraItem;
52406216 }