Normand Briere
2019-07-28 d7fd07756f4095cb87dc25d89fcffcbda092e2cf
GroupEditor.java
....@@ -23,6 +23,237 @@
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 + "/" + s + ".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("default", "uffizi", row0);
62
+ AddSkyboxButton("default", "CloudyHills", row0);
63
+
64
+ AddSkyboxButton("default", "skycube", row1);
65
+ AddSkyboxButton("bridge", "Bridge", row1);
66
+ AddSkyboxButton("bridge", "Bridge2", row1);
67
+ AddSkyboxButton("urban", "GamlaStan2", row1);
68
+
69
+ AddSkyboxButton("urban", "Parliament", row2);
70
+ AddSkyboxButton("urban", "Roundabout", row2);
71
+ AddSkyboxButton("urban", "SaintLazarusChurch", row2);
72
+ AddSkyboxButton("urban", "SaintLazarusChurch2", row2);
73
+
74
+ AddSkyboxButton("urban", "SaintLazarusChurch3", row3);
75
+ AddSkyboxButton("urban", "UnionSquare", row3);
76
+ AddSkyboxButton("park", "BerzeliiPark", row3);
77
+ AddSkyboxButton("park", "Buddha", row3);
78
+
79
+ AddSkyboxButton("park", "CNTower2", row4);
80
+ AddSkyboxButton("park", "NiagaraFalls1", row4);
81
+ AddSkyboxButton("park", "NiagaraFalls3", row4);
82
+ AddSkyboxButton("park", "Park", row4);
83
+
84
+ AddSkyboxButton("park", "Pond", row5);
85
+ AddSkyboxButton("park", "Skansen", row5);
86
+ AddSkyboxButton("park", "Skansen2", row5);
87
+ AddSkyboxButton("park", "Skansen3", row5);
88
+
89
+ AddSkyboxButton("park", "Skansen4", row6);
90
+ AddSkyboxButton("park", "Skansen5", row6);
91
+ AddSkyboxButton("park", "Stairs", row6);
92
+ AddSkyboxButton("park", "Tantolunden4", row6);
93
+
94
+ tab0.add(row0);
95
+ tab0.add(row1);
96
+ tab0.add(row2);
97
+ tab0.add(row3);
98
+ tab0.add(row4);
99
+ tab0.add(row5);
100
+ tab0.add(row6);
101
+
102
+ for (int i=5; --i>=0;)
103
+ {
104
+ //oe.toolboxPanel.Return();
105
+ //tab0.add(new cGridBag());
106
+ }
107
+ }
108
+
109
+ public void AddSkyboxTab1(JTabbedPane skyboxpanel)
110
+ {
111
+ cGridBag tab0 = new cGridBag().setVertical(true);
112
+
113
+ tab0.setName("Nature");
114
+ skyboxpanel.add(tab0);
115
+
116
+ cGridBag row0 = new cGridBag();
117
+ cGridBag row1 = new cGridBag();
118
+ cGridBag row2 = new cGridBag();
119
+ cGridBag row3 = new cGridBag();
120
+ cGridBag row4 = new cGridBag();
121
+ cGridBag row5 = new cGridBag();
122
+ cGridBag row6 = new cGridBag();
123
+
124
+ AddSkyboxButton("beach", "HeartInTheSand", row0);
125
+ AddSkyboxButton("beach", "LarnacaBeach", row0);
126
+ AddSkyboxButton("beach", "PalmTrees", row0);
127
+ AddSkyboxButton("beach", "Tenerife", row0);
128
+
129
+ AddSkyboxButton("beach", "Tenerife2", row1);
130
+ AddSkyboxButton("beach", "Tenerife3", row1);
131
+ AddSkyboxButton("field", "FishPond", row1);
132
+ AddSkyboxButton("field", "Footballfield", row1);
133
+
134
+ AddSkyboxButton("field", "Meadow", row2);
135
+ AddSkyboxButton("field", "Sorsele", row2);
136
+ AddSkyboxButton("field", "Sorsele2", row2);
137
+ AddSkyboxButton("field", "Sorsele3", row2);
138
+
139
+ AddSkyboxButton("forest", "Brudslojan", row3);
140
+ AddSkyboxButton("forest", "Langholmen2", row3);
141
+ AddSkyboxButton("forest", "Plants", row3);
142
+ AddSkyboxButton("mountain", "Maskonaive", row3);
143
+ AddSkyboxButton("mountain", "Maskonaive2", row4);
144
+
145
+ AddSkyboxButton("mountain", "Maskonaive3", row4);
146
+ AddSkyboxButton("mountain", "Ryfjallet", row4);
147
+ AddSkyboxButton("mountain", "Teide", row4);
148
+
149
+ AddSkyboxButton("rocky", "Langholmen", row5);
150
+ AddSkyboxButton("rocky", "Riddarfjarden", row5);
151
+ AddSkyboxButton("rocky", "Skinnarviksberget", row5);
152
+ AddSkyboxButton("rocky", "Tantolunden6", row5);
153
+ /*
154
+Kastellholmen
155
+Langholmen
156
+Riddarfjarden
157
+Skinnarviksberget
158
+Tanto
159
+Tantolunden2
160
+Tantolunden6
161
+ */
162
+
163
+ tab0.add(row0);
164
+ tab0.add(row1);
165
+ tab0.add(row2);
166
+ tab0.add(row3);
167
+ tab0.add(row4);
168
+ tab0.add(row5);
169
+ tab0.add(row6);
170
+
171
+ for (int i=5; --i>=0;)
172
+ {
173
+ //oe.toolboxPanel.Return();
174
+ //tab0.add(new cGridBag());
175
+ }
176
+ }
177
+
178
+ public void AddSkyboxTab2(JTabbedPane skyboxpanel)
179
+ {
180
+ cGridBag tab0 = new cGridBag().setVertical(true);
181
+
182
+ tab0.setName("Night");
183
+ skyboxpanel.add(tab0);
184
+
185
+ cGridBag row0 = new cGridBag();
186
+ cGridBag row1 = new cGridBag();
187
+ cGridBag row2 = new cGridBag();
188
+ cGridBag row3 = new cGridBag();
189
+ cGridBag row4 = new cGridBag();
190
+ cGridBag row5 = new cGridBag();
191
+ cGridBag row6 = new cGridBag();
192
+
193
+ AddSkyboxButton("night", "NightPath", row0);
194
+ AddSkyboxButton("night", "PondNight", row0);
195
+ AddSkyboxButton("night", "Powerlines", row0);
196
+ AddSkyboxButton("night", "SwedishRoyalCastle", row0);
197
+
198
+ AddSkyboxButton("urban", "CNTower", row1);
199
+ AddSkyboxButton("bridge", "ArstaBridge", row1);
200
+ AddSkyboxButton("indoors", "DallasW", row1);
201
+ AddSkyboxButton("indoors", "MarriottMadisonWest", row1);
202
+
203
+ AddSkyboxButton("indoors", "Vasa", row2);
204
+ AddSkyboxButton("winter", "Backyard", row2);
205
+ AddSkyboxButton("winter", "Creek", row2);
206
+ AddSkyboxButton("winter", "FootballField3", row2);
207
+
208
+ AddSkyboxButton("winter", "Forest", row3);
209
+ AddSkyboxButton("winter", "HornstullsStrand2", row3);
210
+ AddSkyboxButton("winter", "House", row3);
211
+ AddSkyboxButton("winter", "IceLake", row3);
212
+
213
+ AddSkyboxButton("winter", "IceRiver", row4);
214
+ AddSkyboxButton("winter", "Park3", row4);
215
+ AddSkyboxButton("winter", "PondWinter", row4);
216
+
217
+ AddSkyboxButton("winter", "Tantolunden5", row5);
218
+ AddSkyboxButton("winter", "Vindelalven", row5);
219
+ /*
220
+Backyard
221
+Creek
222
+FootballField3
223
+Forest
224
+HornstullsStrand2
225
+House
226
+IceLake
227
+IceRiver
228
+Park3
229
+PondWinter
230
+Tantolunden5
231
+Vindelalven *
232
+ */
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 ChangeSkybox(String name)
250
+ {
251
+ cameraView.envyoff = false;
252
+ cameraView.skyboxname = name;
253
+ cameraView.skyboxext = "jpg";
254
+ cameraView.repaint();
255
+ }
256
+
26257 //ObjEditor objEditor;
27258 public void closeUI2()
28259 {
....@@ -60,6 +291,12 @@
60291 this.copy = this.group = group;
61292 //selectees = this.group.selectees;
62293
294
+ if (copy.versions == null)
295
+ {
296
+ copy.versions = new byte[100][];
297
+ copy.versionindex = -1;
298
+ }
299
+
63300 if(ui)
64301 SetupUI(objEditor);
65302 }
....@@ -74,16 +311,28 @@
74311 this.copy = this.group = copy;
75312 //selectees = this.group.selectees;
76313
77
- SetupMenu2(objEditor);
314
+ SetupMenu2(this); //objEditor);
78315 SetupUI2(objEditor);
79316 objEditor.SetupUI(true);
80317 SetupViews(objEditor);
81318
82319 ((cRadio)radioPanel.getComponent(0)).SetCamera(cameraView.renderCamera, true);
320
+
321
+ if (copy.versions == null)
322
+ {
323
+ copy.versions = new byte[100][];
324
+ copy.versionindex = -1;
325
+
326
+ Save(true);
327
+ }
83328 }
84329
85330 void CloneSelection(boolean supports)
86331 {
332
+ if (Globals.REPLACEONMAKE)
333
+ Save();
334
+ boolean keep = Globals.REPLACEONMAKE;
335
+ Globals.REPLACEONMAKE = false;
87336 // Object3D keep = GrafreeD.clipboard;
88337 //Object3D obj;
89338 for (int i=0; i<group.selection.size(); i++)// Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -94,18 +343,19 @@
94343
95344 makeSomething(clone, i==group.selection.size()-1);
96345 }
346
+ Globals.REPLACEONMAKE = keep;
97347 }
98348
99349 void CloneClipboard(boolean supports)
100350 {
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));
351
+ assert(Grafreed.clipboard.parent == null);
352
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
353
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
354
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
355
+ makeSomething(CloneObject(Grafreed.clipboard.get(0), false));
106356 else
107
- makeSomething(CloneObject(GrafreeD.clipboard, false));
108
- GrafreeD.clipboard.get(0).parent = keepparent;
357
+ makeSomething(CloneObject(Grafreed.clipboard, false));
358
+ Grafreed.clipboard.get(0).parent = keepparent;
109359 }
110360
111361 static Object3D CloneObject(Object3D obj, boolean supports)
....@@ -119,7 +369,7 @@
119369 // obj.support = null;
120370 if (!supports)
121371 obj.SaveSupports();
122
- Object3D clone = (Object3D)GrafreeD.clone(obj);
372
+ Object3D clone = (Object3D)Grafreed.clone(obj);
123373 obj.parent = parent;
124374 // obj.support = support;
125375 // clone.support = support; // aout 2013
....@@ -148,40 +398,37 @@
148398
149399 //JTextField nameField;
150400
151
- void SetupMenu2(ObjEditor oe)
401
+ void SetupMenu2(GroupEditor oe)
152402 {
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
-
403
+ oe.jTree = new cTree();
404
+
168405 Menu menu;
169406 oe.menuBar.add(menu = new Menu("Edit"));
170407 //editItem = menu.add(new MenuItem("Edit"));
171408 //editItem.addActionListener(this);
172
- duplicateItem = menu.add(new MenuItem("Duplicate"));
409
+
410
+// undoItem = menu.add(new MenuItem("Undo"));
411
+// undoItem.addActionListener(this);
412
+// redoItem = menu.add(new MenuItem("Redo"));
413
+// redoItem.addActionListener(this);
414
+// menu.add("-");
415
+ duplicateItem = oe.jTree.popup.add(new JMenuItem("Duplicate"));
173416 duplicateItem.addActionListener(this);
417
+ cloneItem = menu.add(new MenuItem("Clone"));
418
+ cloneItem.addActionListener(this);
419
+ if (Globals.ADVANCED)
420
+ {
421
+ cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
422
+ cloneSupportItem.addActionListener(this);
423
+ }
424
+ menu.add("-");
174425 cutItem = menu.add(new MenuItem("Cut"));
175426 cutItem.addActionListener(this);
176427 copyItem = menu.add(new MenuItem("Copy"));
177428 copyItem.addActionListener(this);
178429 pasteItem = menu.add(new MenuItem("Paste"));
179430 pasteItem.addActionListener(this);
180
- menu.add("-");
181
- cloneItem = menu.add(new MenuItem("Clone"));
182
- cloneItem.addActionListener(this);
183
- cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
184
- cloneSupportItem.addActionListener(this);
431
+
185432 menu.add("-");
186433 pasteIntoItem = menu.add(new MenuItem("Paste into"));
187434 pasteIntoItem.addActionListener(this);
....@@ -192,8 +439,8 @@
192439 // pasteExpandItem = menu.add(new MenuItem("Paste expand"));
193440 // pasteExpandItem.addActionListener(this);
194441 menu.add("-");
195
- clearItem = menu.add(new MenuItem("Clear"));
196
- clearItem.addActionListener(this);
442
+ deleteItem = menu.add(new MenuItem("Delete"));
443
+ deleteItem.addActionListener(this);
197444
198445 if (Globals.ADVANCED)
199446 {
....@@ -201,14 +448,97 @@
201448 clearAllItem = menu.add(new MenuItem("Clear All"));
202449 clearAllItem.addActionListener(this);
203450 }
451
+
452
+ menuBar.add(cameraMenu = new Menu("View"));
453
+ //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer"));
454
+ //zBufferItem.addActionListener(this);
455
+ //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens"));
456
+ //normalLensItem.addActionListener(this);
457
+ cameraMenu.add(restoreCameraItem = new MenuItem("Restore Viewpoint"));
458
+ restoreCameraItem.addActionListener(this);
459
+
460
+// cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen"));
461
+// toggleFullScreenItem.addItemListener(this);
462
+// toggleFullScreenItem.setState(CameraPane.FULLSCREEN);
463
+// cameraMenu.add("-");
464
+//
465
+// cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture"));
466
+// toggleTextureItem.addItemListener(this);
467
+// toggleTextureItem.setState(CameraPane.textureon);
468
+//
469
+// cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch"));
470
+// toggleSwitchItem.addItemListener(this);
471
+// toggleSwitchItem.setState(CameraPane.SWITCH);
472
+
473
+ cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Show Handles"));
474
+ toggleHandleItem.addItemListener(this);
475
+ toggleHandleItem.setState(CameraPane.HANDLES);
476
+
477
+ cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode"));
478
+ togglePaintItem.addItemListener(this);
479
+ togglePaintItem.setState(CameraPane.PAINTMODE);
480
+
481
+ if (Globals.ADVANCED)
482
+ {
483
+ cameraMenu.add("-");
484
+ cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live"));
485
+ toggleLiveItem.addItemListener(this);
486
+ toggleLiveItem.setState(Globals.isLIVE());
204487
488
+ cameraMenu.add(stepItem = new MenuItem("Step"));
489
+ stepItem.addActionListener(this);
490
+ // cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List"));
491
+ // toggleDLItem.addItemListener(this);
492
+ // toggleDLItem.setState(false);
493
+
494
+ cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render"));
495
+ toggleRenderItem.addItemListener(this);
496
+ toggleRenderItem.setState(!CameraPane.frozen);
497
+
498
+ cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug"));
499
+ toggleDebugItem.addItemListener(this);
500
+ toggleDebugItem.setState(Globals.DEBUG);
501
+
502
+ cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum"));
503
+ toggleFrustumItem.addItemListener(this);
504
+ toggleFrustumItem.setState(CameraPane.FRUSTUM);
505
+
506
+ cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact"));
507
+ toggleFootContactItem.addItemListener(this);
508
+ toggleFootContactItem.setState(CameraPane.FOOTCONTACT);
509
+
510
+ cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline"));
511
+ toggleTimelineItem.addItemListener(this);
512
+ }
513
+
514
+// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root"));
515
+// toggleRootItem.addItemListener(this);
516
+// toggleRootItem.setState(false);
517
+// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation"));
518
+// animationItem.addItemListener(this);
519
+// animationItem.setState(CameraPane.ANIMATION);
520
+ cameraMenu.add("-");
521
+ cameraMenu.add(editCameraItem = new MenuItem("Save Viewpoint"));
522
+ editCameraItem.addActionListener(this);
523
+
524
+ if (Globals.ADVANCED)
525
+ {
526
+ oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
527
+ //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
528
+ //cameraMenu.add(switchViewItem = new MenuItem("Reverse View"));
529
+ editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf"));
530
+ oe.cameraMenu.add("-");
531
+ openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy..."));
532
+ openWindowItem.addActionListener(this);
533
+ editLeafItem.addActionListener(this);
534
+ lookAtItem.addActionListener(this);
535
+ //lookFromItem.addActinoListener(this);
536
+ //switchViewItem.addActionListener(this);
537
+ }
538
+
205539 oe.menuBar.add(menu = new Menu("Setting"));
206540 if (Globals.ADVANCED)
207541 {
208
- resetMeshItem = menu.add(new MenuItem("Reset All"));
209
- resetMeshItem.addActionListener(this);
210
- stepAllItem = menu.add(new MenuItem("Step All"));
211
- stepAllItem.addActionListener(this);
212542 revertMeshItem = menu.add(new MenuItem("Revert Meshes"));
213543 revertMeshItem.addActionListener(this);
214544 resetreferencesItem = menu.add(new MenuItem("Reset Mesh References"));
....@@ -248,21 +578,29 @@
248578 }
249579
250580 oe.menuBar.add(menu = new Menu("Group"));
251
- grabItem = menu.add(new MenuItem("Grab"));
252
- grabItem.addActionListener(this);
581
+// grabItem = menu.add(new MenuItem("Grab"));
582
+// grabItem.addActionListener(this);
253583 backItem = menu.add(new MenuItem("Back"));
254584 backItem.addActionListener(this);
255585 frontItem = menu.add(new MenuItem("Front"));
256586 frontItem.addActionListener(this);
257
- compositeItem = menu.add(new MenuItem("Composite"));
258
- compositeItem.addActionListener(this);
587
+// compositeItem = menu.add(new MenuItem("Composite"));
588
+// compositeItem.addActionListener(this);
589
+
590
+ if (Globals.ADVANCED)
591
+ {
259592 hideItem = menu.add(new MenuItem("Hidden Group"));
260593 hideItem.addActionListener(this);
594
+ }
261595 ungroupItem = menu.add(new MenuItem("Ungroup"));
262596 ungroupItem.addActionListener(this);
263
- menu.add("-");
264
- randomItem = menu.add(new MenuItem("Switch node"));
265
- randomItem.addActionListener(this);
597
+
598
+// menu.add("-");
599
+//
600
+// switchItem = menu.add(new MenuItem("Switch node"));
601
+// switchItem.addActionListener(this);
602
+ if (Globals.ADVANCED)
603
+ {
266604 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
267605 switchGeoItem.addActionListener(this);
268606 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
....@@ -270,49 +608,52 @@
270608 morphItem = menu.add(new MenuItem("Morph Group"));
271609 morphItem.addActionListener(this);
272610
273
- if (Globals.ADVANCED)
274
- {
611
+ menu.add("-");
275612 physicsItem = menu.add(new MenuItem("Physics"));
276613 physicsItem.addActionListener(this);
277614 frameselectorItem = menu.add(new MenuItem("Frame Selector"));
278615 frameselectorItem.addActionListener(this);
279616 scriptNodeItem = menu.add(new MenuItem("Script Node"));
280617 scriptNodeItem.addActionListener(this);
281
- cameraItem = menu.add(new MenuItem("Camera"));
282
- cameraItem.addActionListener(this);
283618 }
284619
285620 oe.menuBar.add(menu = new Menu("Object"));
286
- textureItem = menu.add(new MenuItem("Texture"));
287
- textureItem.addActionListener(this);
621
+// textureItem = menu.add(new MenuItem("Texture"));
622
+// textureItem.addActionListener(this);
288623 billboardItem = menu.add(new MenuItem("Billboard"));
289624 billboardItem.addActionListener(this);
290625 csgItem = menu.add(new MenuItem("CSG"));
291626 csgItem.addActionListener(this);
292
- shadowXItem = menu.add(new MenuItem("Shadow X"));
627
+ shadowXItem = menu.add(new MenuItem("Shadow Red"));
293628 shadowXItem.addActionListener(this);
294
- shadowYItem = menu.add(new MenuItem("Shadow Y"));
629
+ shadowYItem = menu.add(new MenuItem("Shadow Green"));
295630 shadowYItem.addActionListener(this);
296
- shadowZItem = menu.add(new MenuItem("Shadow Z"));
631
+ shadowZItem = menu.add(new MenuItem("Shadow Blue"));
297632 shadowZItem.addActionListener(this);
298
- if (Globals.ADVANCED)
299
- {
300
- linkerItem = menu.add(new MenuItem("Linker"));
301
- linkerItem.addActionListener(this);
302633 attributeItem = menu.add(new MenuItem("Attribute"));
303634 attributeItem.addActionListener(this);
635
+
636
+ if (Globals.ADVANCED)
637
+ {
638
+ menu.add("-");
639
+ linkerItem = menu.add(new MenuItem("Linker"));
640
+ linkerItem.addActionListener(this);
304641 templateItem = menu.add(new MenuItem("Template"));
305642 templateItem.addActionListener(this);
306643 pointflowItem = menu.add(new MenuItem("Point Flow"));
307644 pointflowItem.addActionListener(this);
308
- menu.add("-");
309645 }
646
+ menu.add("-");
310647 resetTransformItem = menu.add(new MenuItem("Reset Transform"));
311648 resetTransformItem.addActionListener(this);
312649 resetCentroidItem = menu.add(new MenuItem("Reset Centroid"));
313650 resetCentroidItem.addActionListener(this);
314
- transformgeometryItem = menu.add(new MenuItem("Transform Geometry"));
315
- transformgeometryItem.addActionListener(this);
651
+ resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY"));
652
+ resetCentroidXZItem.addActionListener(this);
653
+ transformGeometryItem = menu.add(new MenuItem("Transform Geometry"));
654
+ transformGeometryItem.addActionListener(this);
655
+ transformChildrenItem = menu.add(new MenuItem("Transform Children"));
656
+ transformChildrenItem.addActionListener(this);
316657
317658 oe.menuBar.add(menu = new Menu("Geometry"));
318659 genUVItem = menu.add(new MenuItem("Generate UV"));
....@@ -325,7 +666,7 @@
325666 genNormalsMESHItem.addActionListener(this);
326667 if (Globals.ADVANCED)
327668 {
328
- genNormalsMINEItem = menu.add(new MenuItem("My Normals"));
669
+ genNormalsMINEItem = menu.add(new MenuItem("Stitch Normals"));
329670 genNormalsMINEItem.addActionListener(this);
330671 }
331672 stripifyItem = menu.add(new MenuItem("Stripify"));
....@@ -361,6 +702,10 @@
361702 oe.menuBar.add(menu = new Menu("Attributes"));
362703 clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
363704 clearMaterialsItem.addActionListener(this);
705
+ resetAllItem = menu.add(new MenuItem("Reset All"));
706
+ resetAllItem.addActionListener(this);
707
+ stepAllItem = menu.add(new MenuItem("Step All"));
708
+ stepAllItem.addActionListener(this);
364709 menu.add("-");
365710 liveleavesItem = menu.add(new MenuItem("Live Leaves"));
366711 liveleavesItem.addActionListener(this);
....@@ -381,6 +726,14 @@
381726 markleavesItem.addActionListener(this);
382727 unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves"));
383728 unmarkleavesItem.addActionListener(this);
729
+ rewindleavesItem = menu.add(new MenuItem("Rewind Leaves"));
730
+ rewindleavesItem.addActionListener(this);
731
+ unrewindleavesItem = menu.add(new MenuItem("Unrewind Leaves"));
732
+ unrewindleavesItem.addActionListener(this);
733
+ randomleavesItem = menu.add(new MenuItem("Random Leaves"));
734
+ randomleavesItem.addActionListener(this);
735
+ unrandomleavesItem = menu.add(new MenuItem("Unrandom Leaves"));
736
+ unrandomleavesItem.addActionListener(this);
384737 menu.add("-");
385738 flipVItem = menu.add(new MenuItem("Flip V"));
386739 flipVItem.addActionListener(this);
....@@ -406,47 +759,56 @@
406759 attachBumpItem.addActionListener(this);
407760 pigmentBumpItem = menu.add(new MenuItem("Pigment -> Bump"));
408761 pigmentBumpItem.addActionListener(this);
762
+ //embedTexturesItem
409763 detachPigmentItem = menu.add(new MenuItem("Detach Pigment"));
410764 detachPigmentItem.addActionListener(this);
411765 detachBumpItem = menu.add(new MenuItem("Detach Bump"));
412766 detachBumpItem.addActionListener(this);
767
+ embedTexturesItem = menu.add(new MenuItem("Embed Textures"));
768
+ embedTexturesItem.addActionListener(this);
769
+ deEmbedTexturesItem = menu.add(new MenuItem("De-embed Textures"));
770
+ deEmbedTexturesItem.addActionListener(this);
413771 menu.add("-");
414772 sortbysizeItem = menu.add(new MenuItem("Sort by size"));
415773 sortbysizeItem.addActionListener(this);
416774 sortbynameItem = menu.add(new MenuItem("Sort by name"));
417775 sortbynameItem.addActionListener(this);
776
+ menu.add("-");
777
+ shareGeometriesItem = menu.add(new MenuItem("Share Geometries"));
778
+ shareGeometriesItem.addActionListener(this);
779
+ mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries"));
780
+ mergeGeometriesItem.addActionListener(this);
418781 if (Globals.ADVANCED)
419782 {
420
- menu.add("-");
783
+ // Pretty much the same as duplicate and clone.
421784 extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
422785 extractGeometriesItem.addActionListener(this);
423786 cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry"));
424787 cloneGeometriesItem.addActionListener(this);
425
- shareGeometriesItem = menu.add(new MenuItem("Share Geometry"));
426
- shareGeometriesItem.addActionListener(this);
427
- mergeGeometriesItem = menu.add(new MenuItem("Merge Geometry"));
428
- mergeGeometriesItem.addActionListener(this);
429788 }
430789
431790 oe.menuBar.add(menu = new Menu("Insert"));
432791 buildCreateMenu(menu);
433792
434
- oe.menuBar.add(menu = new Menu("Include"));
435
- importGFDItem = menu.add(new MenuItem("GrafreeD Object..."));
436
- importGFDItem.addActionListener(this);
437
- importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D Object..."));
438
- importVRMLX3DItem.addActionListener(this);
439
- importOBJItem = menu.add(new MenuItem("OBJ Object..."));
440
- importOBJItem.addActionListener(this);
441
- import3DSItem = menu.add(new MenuItem("3DS Object..."));
442
- import3DSItem.addActionListener(this);
443
-
444793 oe.menuBar.add(menu = new Menu("Tools"));
445794 buildToolsMenu(menu);
446795 }
447796
797
+
448798 void SetupUI2(ObjEditor oe)
449799 {
800
+ // June 2019
801
+ if (oe == null)
802
+ {
803
+ //super.SetupUI2(this);
804
+ //return;
805
+ }
806
+
807
+ if (copy != group)
808
+ {
809
+ //super.SetupUI2(this);
810
+ }
811
+
450812 //new Exception().printStackTrace();
451813
452814 oe.radioPanel = new JPanel(new GridBagLayout());
....@@ -475,97 +837,237 @@
475837 oe.radioPanel.add(dummyButton);
476838 oe.buttonGroup.add(dummyButton);
477839 */
840
+ cGridBag copyOptionsPanel = new cGridBag();
841
+
842
+ copyOptionsPanel.preferredHeight = 2;
843
+
478844 //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
479845
480
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints);
481
- liveCB.setToolTipText("Enabled animation");
846
+ //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
847
+ //minButton.setToolTipText("Minimize window");
848
+ //minButton.addActionListener(this);
849
+
850
+ if (Globals.ADVANCED)
851
+ {
852
+ oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
853
+ maxButton.setToolTipText("Maximize window");
854
+ maxButton.addActionListener(this);
855
+ }
856
+
857
+ oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
858
+ fullButton.setToolTipText("Full-screen window");
859
+ fullButton.addActionListener(this);
860
+
861
+ oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
862
+ screenfitButton.setToolTipText("Screen fit");
863
+ screenfitButton.addActionListener(this);
864
+
865
+ oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
866
+ restoreCameraButton.setToolTipText("Restore viewpoint");
867
+ restoreCameraButton.addActionListener(this);
868
+
869
+ copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
870
+ saveButton.setToolTipText("New version");
871
+ saveButton.addActionListener(this);
872
+
873
+ copyOptionsPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
874
+ undoButton.setToolTipText("Previous version");
875
+ undoButton.addActionListener(this);
876
+ undoButton.setEnabled(false);
877
+
878
+ cGridBag updown = new cGridBag().setVertical(true);
879
+ updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
880
+ restoreButton.setToolTipText("Restore current");
881
+ restoreButton.addActionListener(this);
882
+ restoreButton.setEnabled(false);
883
+
884
+ updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
885
+ replaceButton.setToolTipText("Replace current");
886
+ replaceButton.addActionListener(this);
887
+ replaceButton.setEnabled(false);
888
+
889
+ copyOptionsPanel.add(updown);
890
+
891
+ copyOptionsPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
892
+ redoButton.setToolTipText("Next version");
893
+ redoButton.addActionListener(this);
894
+ redoButton.setEnabled(false);
895
+
896
+ oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints);
897
+ liveCB.setToolTipText("Enable animation");
482898 liveCB.addItemListener(this);
483899
484
- oe.toolbarPanel.add(oneStepButton = new cButton("Step", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
900
+ oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
485901 oneStepButton.setToolTipText("Animate one step forward");
486902 oneStepButton.addActionListener(this);
487903
488
- oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints);
904
+ oe.toolbarPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints);
489905 fastCB.setToolTipText("Fast mode");
490906 fastCB.addItemListener(this);
491907
492
- oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
493
- trackCB.setToolTipText("Enable tracking");
494
- trackCB.addItemListener(this);
495
-
496
- oe.toolbarPanel.add(screenfitButton = new cButton("@", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
497
- screenfitButton.setToolTipText("Screen fit");
498
- screenfitButton.addActionListener(this);
908
+ //oe.toolboxPanel.Return();
909
+
910
+// copyOptionsPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints);
911
+// trackCB.setToolTipText("Enable tracking");
912
+// trackCB.addItemListener(this);
499913
500914 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
501915 // screenfitpointButton.addActionListener(this);
502916
503917 if (Globals.ADVANCED)
504918 {
505
- oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
919
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
506920 snapobjectButton.addActionListener(this);
507921 snapobjectButton.setToolTipText("Snap Object");
922
+
923
+ oe.toolbarPanel.add(fourButton = GetButton("icons/controls-horizontal.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
924
+ fourButton.addActionListener(this);
925
+ fourButton.setToolTipText("Show control panel only");
508926 }
509927
510
- oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
511
- flashSelectionButton.setToolTipText("Show selection");
512
- flashSelectionButton.addActionListener(this);
928
+ //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
513929
514
- oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
515
-
516
- oe.toolbarPanel.add(twoButton = new cButton("|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
517
- twoButton.setToolTipText("Show center view only");
930
+ oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
931
+ twoButton.setToolTipText("Show 3D view only");
518932 twoButton.addActionListener(this);
519
- oe.toolbarPanel.add(fourButton = new cButton("+||", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
520
- fourButton.addActionListener(this);
521
- fourButton.setToolTipText("Show left panel only");
522
- oe.toolbarPanel.add(sixButton = new cButton("+|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
523
- sixButton.setToolTipText("2-column layout left");
524
- sixButton.addActionListener(this);
525
- oe.toolbarPanel.add(threeButton = new cButton("|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
526
- threeButton.setToolTipText("2-column layout right");
933
+ this.fullscreenLayout = twoButton;
934
+
935
+ oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
936
+ threeButton.setToolTipText("Show controls and 3D view");
527937 threeButton.addActionListener(this);
528
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
529
- sevenButton.setToolTipText("3-column layout");
530
- sevenButton.addActionListener(this);
938
+ oe.toolbarPanel.add(sixButton = GetButton("icons/viewcontrols.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
939
+ sixButton.setToolTipText("Show 3D view and controls");
940
+ sixButton.addActionListener(this);
941
+// oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
942
+// sevenButton.setToolTipText("3-column layout");
943
+// sevenButton.addActionListener(this);
531944 //
532945
533
- oe.toolbarPanel.add(rootButton = new cButton("o o o", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
534
- rootButton.setToolTipText("Edit selection in new tab");
946
+ oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
947
+ rootButton.setToolTipText("Open selection in new tab");
535948 rootButton.addActionListener(this);
536949
537
- oe.toolbarPanel.add(closeButton = new cButton("X", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
950
+ oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
538951 closeButton.setToolTipText("Close tab");
539952 closeButton.addActionListener(this);
540953 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
541954 //clearButton.addActionListener(this);
542
-
543
- cGridBag commandsPanel = new cGridBag();
955
+
956
+ cGridBag row1 = new cGridBag();
544957
545
- commandsPanel.add(editButton = new cButton("+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
546
- editButton.setToolTipText("Edit selection");
958
+ // INSERT
959
+ row1.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
960
+ gridButton.setToolTipText("Create grid");
961
+ gridButton.addActionListener(this);
962
+
963
+ row1.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
964
+ boxButton.setToolTipText("Create box");
965
+ boxButton.addActionListener(this);
966
+
967
+ row1.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
968
+ sphereButton.setToolTipText("Create sphere");
969
+ sphereButton.addActionListener(this);
970
+
971
+ row1.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
972
+ coneButton.setToolTipText("Create cone");
973
+ coneButton.addActionListener(this);
974
+
975
+ row1.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
976
+ torusButton.setToolTipText("Create torus");
977
+ torusButton.addActionListener(this);
978
+
979
+ row1.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
980
+ superButton.setToolTipText("Create superellipsoid");
981
+ superButton.addActionListener(this);
982
+
983
+ if (Globals.ADVANCED)
984
+ {
985
+ oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
986
+ kleinButton.setToolTipText("Create Klein bottle");
987
+ kleinButton.addActionListener(this);
988
+ }
989
+
990
+ row1.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
991
+ particlesButton.setToolTipText("Create particle system");
992
+ particlesButton.addActionListener(this);
993
+
994
+ oe.toolboxPanel.add(row1);
995
+
996
+ cGridBag row2 = new cGridBag();
997
+
998
+ row2.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
999
+ groupButton.setToolTipText("Create group");
1000
+ groupButton.addActionListener(this);
1001
+
1002
+ row2.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1003
+ compositeButton.setToolTipText("Create composite");
1004
+ compositeButton.addActionListener(this);
1005
+
1006
+ row2.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1007
+ switchButton.setToolTipText("Create item switcher");
1008
+ switchButton.addActionListener(this);
1009
+
1010
+ row2.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1011
+ loopButton.setToolTipText("Create loop");
1012
+ loopButton.addActionListener(this);
1013
+
1014
+ row2.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1015
+ textureButton.setToolTipText("Create texture");
1016
+ textureButton.addActionListener(this);
1017
+
1018
+ row2.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1019
+ overlayButton.setToolTipText("Create overlay");
1020
+ overlayButton.addActionListener(this);
1021
+
1022
+ row2.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1023
+ lightButton.setToolTipText("Create light");
1024
+ lightButton.addActionListener(this);
1025
+
1026
+ oe.toolboxPanel.add(row2);
1027
+
1028
+ // ENVYMAPS
1029
+ cGridBag skyboxpane = new cGridBag();
1030
+ skyboxpane.preferredHeight = 100;
1031
+
1032
+ oe.toolboxPanel.add(skyboxpane);
1033
+
1034
+ JTabbedPane skyboxpanel = new JTabbedPane();
1035
+ skyboxpane.add(skyboxpanel);
1036
+
1037
+ AddSkyboxTab0(skyboxpanel);
1038
+ AddSkyboxTab1(skyboxpanel);
1039
+ AddSkyboxTab2(skyboxpanel);
1040
+
1041
+ // EDIT panel
1042
+ editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1043
+ editButton.setToolTipText("Pin selection controls");
5471044 editButton.addActionListener(this);
5481045
549
- commandsPanel.add(uneditButton = new cButton("-", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
550
- uneditButton.setToolTipText("Unedit selection");
1046
+ editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1047
+ uneditButton.setToolTipText("Remove selection controls");
5511048 uneditButton.addActionListener(this);
5521049
553
- commandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
554
- allParamsButton.setToolTipText("Edit all params");
1050
+ editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
1051
+ allParamsButton.setToolTipText("Show all controle");
5551052 allParamsButton.addActionListener(this);
5561053
557
- commandsPanel.add(clearPanelButton = new cButton("C", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
1054
+ editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
5581055 clearPanelButton.setToolTipText("Clear edit panel");
5591056 clearPanelButton.addActionListener(this);
5601057
561
- commandsPanel.add(unselectButton = new cButton("U", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
1058
+ editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
5621059 unselectButton.setToolTipText("Unselect");
5631060 unselectButton.addActionListener(this);
5641061
565
- commandsPanel.preferredHeight = 1;
1062
+ editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1063
+ flashSelectionButton.setToolTipText("Highlight selection");
1064
+ flashSelectionButton.addActionListener(this);
5661065
567
- oe.treePanel.add(commandsPanel);
568
- oe.treePanel.Return();
1066
+ editCommandsPanel.preferredHeight = 1;
1067
+
1068
+ SetPinStates(false);
1069
+// oe.treePanel.add(commandsPanel);
1070
+// oe.treePanel.Return();
5691071
5701072 // oe.aConstraints.gridx += 1;
5711073 // oe.aConstraints.weighty = 0;
....@@ -582,32 +1084,20 @@
5821084
5831085 JScrollPane jSP;
5841086 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
585
- jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints);
1087
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints);
5861088 ResetModel();
5871089
5881090 oe.treePanel.add(jSPPanel);
5891091 oe.treePanel.Return();
5901092
591
- cGridBag copyOptionsPanel = new cGridBag();
592
-
593
- copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
594
- colorCB.setToolTipText("Copy color when dropped");
595
- colorCB.addItemListener(this);
596
-
597
- copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
598
- materialCB.setToolTipText("Copy material when dropped");
599
- materialCB.addItemListener(this);
600
-
601
- copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
602
- textureCB.setToolTipText("Copy texture when dropped");
603
- textureCB.addItemListener(this);
604
-
605
- copyOptionsPanel.preferredHeight = 1;
6061093 oe.treePanel.add(copyOptionsPanel);
6071094 oe.treePanel.Return();
1095
+ cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0);
1096
+ versionSlider = (cNumberSlider)sliderPane.getComponent(1);
1097
+ sliderPane.preferredHeight = 1;
6081098
609
-// mainPanel.setDividerLocation(0.5); //1.0);
610
-// mainPanel.setResizeWeight(0.5);
1099
+// mainPanel.setDividerLocation(0.1); //1.0);
1100
+ mainPanel.setResizeWeight(0.4);
6111101
6121102 //jList.addListSelectionListener(this);
6131103 oe.jTree.addTreeSelectionListener(this);
....@@ -615,7 +1105,7 @@
6151105 //jTree.setEditable(true);
6161106 oe.jTree.setDragEnabled(true);
6171107 //jTree.setPreferredSize(new Dimension(10,10));
618
- jSP.setPreferredSize(new Dimension(100,200));
1108
+ //jSP.setPreferredSize(new Dimension(100,200));
6191109
6201110 oe.jTree.setCellRenderer(new cTreeModel.Renderer());
6211111
....@@ -627,29 +1117,49 @@
6271117 dgr.addDragGestureListener(this);
6281118 }catch(Exception e) {}
6291119 */
630
- radio.layout = sevenButton;
1120
+ radio.layout = sixButton; // sevenButton;
6311121 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
6321122 }
6331123
6341124 void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
6351125 {
1126
+ panel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
1127
+ colorCB.setToolTipText("Copy color when dropped");
1128
+ colorCB.addItemListener(this);
1129
+
1130
+ panel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
1131
+ materialCB.setToolTipText("Copy material when dropped");
1132
+ materialCB.addItemListener(this);
1133
+
1134
+ panel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
1135
+ textureCB.setToolTipText("Copy texture when dropped");
1136
+ textureCB.addItemListener(this);
1137
+
1138
+ panel.Return();
1139
+
6361140 panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
6371141 boxCB.setToolTipText("Display bounding boxes");
6381142 boxCB.addItemListener(this);
6391143
6401144 panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
641
- zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
1145
+ zoomBoxCB.setToolTipText("Display only for wheel");
6421146 zoomBoxCB.addItemListener(this);
6431147
644
- if (Globals.ADVANCED)
1148
+ if (true) // Globals.ADVANCED)
6451149 {
646
- panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
647
- supportCB.setToolTipText("Enable rigging");
648
- supportCB.addItemListener(this);
1150
+// panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
1151
+// supportCB.setToolTipText("Enable rigging");
1152
+// supportCB.addItemListener(this);
1153
+
1154
+ panel.add(freezeCB = new cCheckBox("Freeze", Globals.FREEZEONMOVE)); //, constraints);
1155
+ freezeCB.setToolTipText("Fast moving camera");
1156
+ freezeCB.addItemListener(this);
6491157
6501158 // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
6511159 // localCB.addItemListener(this);
6521160
1161
+ panel.Return();
1162
+
6531163 panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
6541164 crowdCB.setToolTipText("Used for crowds");
6551165 crowdCB.addItemListener(this);
....@@ -666,6 +1176,8 @@
6661176 // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
6671177 // speakerMocapCB.addItemListener(this);
6681178
1179
+ panel.Return();
1180
+
6691181 if (false)
6701182 {
6711183 // handled in scripts
....@@ -680,42 +1192,85 @@
6801192 //constraints.gridy += 1;
6811193 panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
6821194 smoothfocusCB.addItemListener(this);
1195
+ panel.Return();
6831196 }
6841197
6851198 //constraints.gridx += 1;
6861199 //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
6871200 // debugCB.addItemListener(this);
6881201
1202
+ panel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
1203
+ trackCB.setToolTipText("Enable tracking target");
1204
+ trackCB.addItemListener(this);
1205
+
6891206 panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
1207
+ oeilCB.setToolTipText("Move camera when tracking");
6901208 oeilCB.addItemListener(this);
6911209
1210
+ panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints);
1211
+ shadowCB.setToolTipText("When live compute shadows");
1212
+ shadowCB.addItemListener(this);
1213
+
1214
+ panel.Return();
1215
+ panel.add(toggleTextureCB = new cCheckBox("Textures", CameraPane.textureon)); //, constraints);
1216
+ toggleTextureCB.setToolTipText("Load textures");
1217
+ toggleTextureCB.addItemListener(this);
1218
+
1219
+ panel.add(toggleSwitchCB = new cCheckBox("Switch", CameraPane.SWITCH)); //, constraints);
1220
+ toggleSwitchCB.setToolTipText("Choose a single item");
1221
+ toggleSwitchCB.addItemListener(this);
1222
+
1223
+ panel.add(autokeepCB = new cCheckBox("Auto-replace", Globals.REPLACEONMAKE)); //, constraints);
1224
+ autokeepCB.setToolTipText("On structure change");
1225
+ autokeepCB.addItemListener(this);
1226
+
1227
+ panel.Return();
1228
+ if (Globals.ADVANCED)
1229
+ {
6921230 panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
6931231 lookAtCB.setToolTipText("Look-at target");
6941232 lookAtCB.addItemListener(this);
1233
+ }
6951234
6961235 }
6971236
6981237 cGridBag fill = new cGridBag();
699
-
7001238 fill.preferredHeight = 200;
1239
+ cGridBag fill2 = new cGridBag();
1240
+ fill2.preferredHeight = 200;
1241
+ cGridBag fill3 = new cGridBag();
1242
+ fill3.preferredHeight = 200;
7011243
7021244 panel.add(fill);
1245
+ panel.add(fill2);
1246
+ panel.add(fill3);
7031247
7041248 }
7051249
7061250 void EditObject(Object3D obj)
7071251 {
7081252 cRadio radioButton = new cRadio(obj.name);
1253
+
1254
+ // June 2019. Patch to avoid bug with transparency.
1255
+ radioButton.hadMaterial = obj.material != null;
1256
+ if (!radioButton.hadMaterial)
1257
+ {
1258
+ obj.material = new cMaterial();
1259
+ }
1260
+
7091261 radioButton.SetObject(obj);
710
- radioButton.layout = sevenButton;
1262
+ radioButton.layout = sixButton; // sevenButton;
7111263 radioButton.SetCamera(cameraView.renderCamera, false);
7121264 radioButton.addActionListener(this);
7131265 radioPanel.add(radioButton);
7141266 buttonGroup.add(radioButton);
7151267 radioButton.doClick();
7161268 }
1269
+
7171270 void SetupViews(ObjEditor oe)
7181271 {
1272
+ theFrame = this;
1273
+
7191274 oe.SetupViews();
7201275
7211276 System.out.println("SetupViews");
....@@ -724,23 +1279,28 @@
7241279 /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this);
7251280 }
7261281
727
- JCheckBox liveCB;
728
- JCheckBox supportCB;
729
- JCheckBox localCB;
730
- JCheckBox crowdCB;
731
- JCheckBox smoothCB;
732
- JCheckBox fastCB;
733
- JCheckBox slowCB;
734
- JCheckBox boxCB;
735
- JCheckBox zoomBoxCB;
736
- JCheckBox trackCB;
737
- JCheckBox smoothfocusCB;
1282
+ cToggleButton liveCB;
1283
+ cCheckBox supportCB;
1284
+ cCheckBox localCB;
1285
+ cCheckBox crowdCB;
1286
+ cCheckBox smoothCB;
1287
+ cToggleButton fastCB;
1288
+ cCheckBox slowCB;
1289
+ cCheckBox boxCB;
1290
+ cCheckBox zoomBoxCB;
1291
+ cCheckBox freezeCB;
1292
+ //cToggleButton trackCB;
1293
+ cCheckBox trackCB;
1294
+ cCheckBox smoothfocusCB;
7381295 // JCheckBox speakerMocapCB;
739
- JCheckBox speakerCameraCB;
740
- JCheckBox speakerFocusCB;
741
- JCheckBox debugCB;
742
- JCheckBox oeilCB;
743
- JCheckBox lookAtCB;
1296
+ cCheckBox speakerCameraCB;
1297
+ cCheckBox speakerFocusCB;
1298
+ cCheckBox debugCB;
1299
+
1300
+ cCheckBox oeilCB;
1301
+ cCheckBox shadowCB;
1302
+ cCheckBox autokeepCB;
1303
+ cCheckBox lookAtCB;
7441304
7451305 // static int COLOR = 1;
7461306 // static int MATERIAL = 2;
....@@ -748,9 +1308,9 @@
7481308
7491309 int dropAttributes = Object3D.COLOR | Object3D.MATERIAL;
7501310
751
- JCheckBox colorCB;
752
- JCheckBox materialCB;
753
- JCheckBox textureCB;
1311
+ cCheckBox colorCB;
1312
+ cCheckBox materialCB;
1313
+ cCheckBox textureCB;
7541314
7551315 public void itemStateChanged(ItemEvent e)
7561316 {
....@@ -778,6 +1338,7 @@
7781338 } else if(e.getSource() == liveCB)
7791339 {
7801340 cameraView.ToggleLive();
1341
+ refreshContents(false);
7811342 }
7821343 else if(e.getSource() == supportCB)
7831344 {
....@@ -842,6 +1403,18 @@
8421403 {
8431404 cameraView.ToggleOeil();
8441405 }
1406
+ else if(e.getSource() == shadowCB)
1407
+ {
1408
+ Globals.COMPUTESHADOWWHENLIVE ^= true;
1409
+ }
1410
+ else if(e.getSource() == freezeCB)
1411
+ {
1412
+ Globals.FREEZEONMOVE ^= true;
1413
+ }
1414
+ else if(e.getSource() == autokeepCB)
1415
+ {
1416
+ Globals.REPLACEONMAKE ^= true;
1417
+ }
8451418 else if(e.getSource() == lookAtCB)
8461419 {
8471420 cameraView.ToggleLookAt();
....@@ -858,7 +1431,8 @@
8581431
8591432 /**/
8601433 //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this);
861
- TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1434
+ //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1435
+ TreePath path = objEditor.jTree.getSelectionPath();
8621436 if ((path == null) || (path.getPathCount() <= 1)) {
8631437 // We can't move the root node or an empty selection
8641438 return;
....@@ -921,8 +1495,6 @@
9211495 }
9221496 }
9231497
924
- String string = (String) object;
925
-
9261498 System.out.println("Transfer = " + object + "; drop : " + target);
9271499 // if( object instanceof java.io.File[])
9281500 // {
....@@ -930,7 +1502,11 @@
9301502 // objEditor.DropFile((java.io.File[]) object, true);
9311503 // return;
9321504 // }
933
- if (string.charAt(0) == '/')
1505
+
1506
+ String string = object.toString();
1507
+
1508
+ // File path for Mac and Windows
1509
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
9341510 {
9351511 // file(s)
9361512 String[] names = string.split("\n");
....@@ -957,7 +1533,7 @@
9571533
9581534 flashIt = false;
9591535 CameraPane pane = (CameraPane) target;
960
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1536
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
9611537 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
9621538
9631539 if (group.selection.size() == 1)
....@@ -973,23 +1549,33 @@
9731549
9741550 assert target == objEditor.jTree;
9751551 TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y);
1552
+ Object3D destinationLeaf;
9761553 try {
977
- Object3D dummy = (Composite) destinationPath.getLastPathComponent();
1554
+ destinationLeaf = (Composite) destinationPath.getLastPathComponent();
9781555 } catch (Exception e) {
9791556 System.out.println("destinationPath : " + destinationPath);
9801557 return;
9811558 }
9821559
983
- if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1560
+ for (int i=group.selection.size(); --i>=0;)
9841561 {
1562
+ Object3D child = (Object3D)group.selection.elementAt(i);
1563
+
1564
+ // Cannot move into itself
1565
+ if (child == destinationLeaf)
1566
+ return;
1567
+ }
1568
+
1569
+// june 2019 if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1570
+// {
9851571 loadClipboard(true);
9861572 objEditor.jTree.setSelectionPath(destinationPath);
9871573 pasteInto(false, false);
988
- } else {
989
- loadClipboard(false);
990
- objEditor.jTree.setSelectionPath(destinationPath);
991
- pasteInto(false, false); // true); // ???
992
- }
1574
+// } else {
1575
+// loadClipboard(false);
1576
+// objEditor.jTree.setSelectionPath(destinationPath);
1577
+// pasteInto(false, false); // true); // ???
1578
+// }
9931579 }
9941580 public void dropActionChanged(DropTargetDragEvent dtde)
9951581 // Called if the user has modified the current drop gesture
....@@ -1094,22 +1680,30 @@
10941680 {
10951681 //heightFieldItem = menu.add(new MenuItem("Height Field"));
10961682 //heightFieldItem.addActionListener(this);
1097
- gridItem = menu.add(new MenuItem("Grid"));
1098
- gridItem.addActionListener(this);
1099
- rectoidItem = menu.add(new MenuItem("Box"));
1100
- rectoidItem.addActionListener(this);
1101
- ellipsoidItem = menu.add(new MenuItem("Sphere"));
1102
- ellipsoidItem.addActionListener(this);
1103
- coneItem = menu.add(new MenuItem("Cone"));
1104
- coneItem.addActionListener(this);
1105
- torusItem = menu.add(new MenuItem("Torus"));
1106
- torusItem.addActionListener(this);
1107
- superItem = menu.add(new MenuItem("Superellipsoid"));
1108
- superItem.addActionListener(this);
1683
+// gridItem = menu.add(new MenuItem("Grid"));
1684
+// gridItem.addActionListener(this);
1685
+// rectoidItem = menu.add(new MenuItem("Box"));
1686
+// rectoidItem.addActionListener(this);
1687
+// ellipsoidItem = menu.add(new MenuItem("Sphere"));
1688
+// ellipsoidItem.addActionListener(this);
1689
+// coneItem = menu.add(new MenuItem("Cone"));
1690
+// coneItem.addActionListener(this);
1691
+// torusItem = menu.add(new MenuItem("Torus"));
1692
+// torusItem.addActionListener(this);
1693
+// superItem = menu.add(new MenuItem("Superellipsoid"));
1694
+// superItem.addActionListener(this);
1695
+
1696
+ cameraItem = menu.add(new MenuItem("Camera"));
1697
+ cameraItem.addActionListener(this);
1698
+
1699
+ if (!Globals.ADVANCED)
1700
+ {
11091701 kleinItem = menu.add(new MenuItem("Klein Bottle"));
11101702 kleinItem.addActionListener(this);
1111
- particleItem = menu.add(new MenuItem("Particle system"));
1112
- particleItem.addActionListener(this);
1703
+ }
1704
+
1705
+// particleItem = menu.add(new MenuItem("Particle system"));
1706
+// particleItem.addActionListener(this);
11131707 if (Globals.ADVANCED)
11141708 {
11151709 ragdollItem = menu.add(new MenuItem("Rag Walk"));
....@@ -1135,15 +1729,15 @@
11351729 }
11361730 bezierItem = menu.add(new MenuItem("Bezier Patch"));
11371731 bezierItem.addActionListener(this);
1138
- overlayItem = menu.add(new MenuItem("Overlay"));
1139
- overlayItem.addActionListener(this);
1140
- lightItem = menu.add(new MenuItem("Light"));
1141
- lightItem.addActionListener(this);
1732
+// overlayItem = menu.add(new MenuItem("Overlay"));
1733
+// overlayItem.addActionListener(this);
1734
+// lightItem = menu.add(new MenuItem("Light"));
1735
+// lightItem.addActionListener(this);
11421736 menu.add("-");
11431737 //superLoopItem = menu.add(new MenuItem("Super Loop"));
11441738 //superLoopItem.addActionListener(this);
1145
- loopItem = menu.add(new MenuItem("Loop"));
1146
- loopItem.addActionListener(this);
1739
+// loopItem = menu.add(new MenuItem("Loop"));
1740
+// loopItem.addActionListener(this);
11471741 doubleItem = menu.add(new MenuItem("Fork"));
11481742 doubleItem.addActionListener(this);
11491743 if (Globals.ADVANCED)
....@@ -1159,18 +1753,23 @@
11591753 animationItem.addItemListener(this);
11601754 animationItem.setState(Globals.ANIMATION);
11611755
1756
+ menu.add(archiveItem = new MenuItem("Archive3D..."));
1757
+ archiveItem.addActionListener(this);
1758
+
11621759 menu.add("-");
11631760 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
11641761 parseverticesItem.addActionListener(this);
11651762 textureFieldItem = menu.add(new MenuItem("Texture Field"));
11661763 textureFieldItem.addActionListener(this);
1167
- alignItem = menu.add(new MenuItem("Align Object"));
1764
+ alignItem = menu.add(new MenuItem("Align Objects"));
11681765 alignItem.addActionListener(this);
11691766 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
11701767 reduceMorphItem.addActionListener(this);
11711768 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
11721769 reduce34MorphItem.addActionListener(this);
1173
-
1770
+ menu.add("-");
1771
+ menu.add(memoryItem = new MenuItem("Memory Usage"));
1772
+ memoryItem.addActionListener(this);
11741773 menu.add(computeAOItem = new MenuItem("Compute AO"));
11751774 computeAOItem.addActionListener(this);
11761775
....@@ -1179,11 +1778,9 @@
11791778 mirrorItem = menu.add(new MenuItem("Mirror Poses"));
11801779 mirrorItem.addActionListener(this);
11811780 menu.add("-");
1182
- menu.add(memoryItem = new MenuItem("Memory Usage"));
1183
- memoryItem.addActionListener(this);
11841781 menu.add(analyzeItem = new MenuItem("Analyze"));
11851782 analyzeItem.addActionListener(this);
1186
- menu.add(dumpItem = new MenuItem("Dump"));
1783
+ menu.add(dumpItem = new MenuItem("Print"));
11871784 dumpItem.addActionListener(this);
11881785 // menu.add(pathItem = new MenuItem("From-to path"));
11891786 // pathItem.addActionListener(this);
....@@ -1324,9 +1921,34 @@
13241921 shadow.material = new cMaterial(obj.material);
13251922 shadow.material.diffuse = 0.0001f;
13261923 shadow.material.specular = 0.0001f;
1924
+ //shadow.projectedVertices[1].x = 300;
13271925
13281926 makeSomething(shadow);
13291927 }
1928
+
1929
+ private void ClearUnpinned()
1930
+ {
1931
+ //for (Object3D obj : listUI)
1932
+ for (int i=listUI.size(); --i>=0;)
1933
+ {
1934
+ Object3D obj = listUI.elementAt(i);
1935
+ if (!obj.pinned)
1936
+ {
1937
+ obj.CloseUI();
1938
+ listUI.remove(i);
1939
+ }
1940
+ }
1941
+ }
1942
+
1943
+ private void EditElement(Object3D elem, boolean newWindow)
1944
+ {
1945
+ // if (!(elem instanceof Composite))
1946
+ // newWindow = false;
1947
+ listUI.add(elem);
1948
+ elem.openEditWindow(this, newWindow); //, false);
1949
+ System.out.println("edit : " + elem);
1950
+ elem.editWindow.refreshContents(true); // ? new
1951
+ }
13301952
13311953 /**
13321954 * applyExample
....@@ -1530,9 +2152,9 @@
15302152
15312153 void Overwrite(int mask)
15322154 {
1533
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2155
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
15342156 {
1535
- Object3D content = GrafreeD.clipboard.get(0);
2157
+ Object3D content = Grafreed.clipboard.get(0);
15362158
15372159 if (content instanceof cGroup && ((cGroup)content).transientlink )
15382160 content = ((cGroup)content).get(0);
....@@ -1571,7 +2193,7 @@
15712193 {
15722194 ScreenFit();
15732195 } else
1574
- if (source == switchItem)
2196
+ if (source == switchViewItem)
15752197 {
15762198 cVector v1 = new cVector();
15772199 cVector v2 = new cVector();
....@@ -1580,11 +2202,11 @@
15802202 objEditor.cameraView.renderCamera.setAim(v2, v1);
15812203 objEditor.cameraView.repaint();
15822204 } else
1583
- if (source == rectoidItem)
2205
+ if (source == rectoidItem || source == boxButton)
15842206 {
15852207 makeSomething(new Box());
15862208 } else
1587
- if (source == particleItem)
2209
+ if (source == particleItem || source == particlesButton)
15882210 {
15892211 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15902212 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1663,27 +2285,27 @@
16632285
16642286 makeSomething(obj);
16652287 } else
1666
- if (source == gridItem)
2288
+ if (source == gridItem || source == gridButton)
16672289 {
16682290 makeSomething(new Grid());
16692291 } else
1670
- if (source == ellipsoidItem)
2292
+ if (source == ellipsoidItem || source == sphereButton)
16712293 {
16722294 makeSomething(new Sphere());
16732295 } else
1674
- if (source == coneItem)
2296
+ if (source == coneItem || source == coneButton)
16752297 {
16762298 makeSomething(new Cone());
16772299 } else
1678
- if (source == torusItem)
2300
+ if (source == torusItem || source == torusButton)
16792301 {
16802302 makeSomething(new Torus());
16812303 } else
1682
- if (source == superItem)
2304
+ if (source == superItem || source == superButton)
16832305 {
16842306 makeSomething(new Superellipsoid());
16852307 } else
1686
- if (source == kleinItem)
2308
+ if (source == kleinItem || source == kleinButton)
16872309 {
16882310 makeSomething(new Klein());
16892311 } else
....@@ -1703,7 +2325,7 @@
17032325 {
17042326 makeSomething(new BezierSurface());
17052327 } else
1706
- if (source == overlayItem)
2328
+ if (source == overlayItem || source == overlayButton)
17072329 {
17082330 /*
17092331 Object3D obj = new BezierSurface(5,8);
....@@ -1751,10 +2373,27 @@
17512373 s.setup();
17522374 makeSomething(s);
17532375 } else
1754
- if (source == lightItem)
2376
+ if (source == lightItem || source == lightButton)
17552377 {
17562378 makeSomething(new Light());
17572379 } else
2380
+// if (source == skybox1Button ||
2381
+// source == skybox2Button ||
2382
+// source == skybox3Button ||
2383
+// source == skybox4Button ||
2384
+// source == skybox5Button ||
2385
+// source == skybox6Button ||
2386
+// source == skybox7Button ||
2387
+// source == skybox11Button ||
2388
+// source == skybox12Button ||
2389
+// source == skybox13Button ||
2390
+// source == skybox14Button ||
2391
+// source == skybox15Button ||
2392
+// source == skybox16Button ||
2393
+// source == skybox17Button)
2394
+// {
2395
+// ChangeSkybox(source);
2396
+// } else
17582397 if (source == csgItem)
17592398 {
17602399 group(new CSG());
....@@ -1801,30 +2440,30 @@
18012440
18022441 group(g);
18032442 } else
1804
- if (source == loopItem)
2443
+ if (source == loopItem || source == loopButton)
18052444 {
18062445 Composite csg = new GroupLeaf();
18072446 csg.count = 5;
18082447 group(csg);
1809
- Composite child = new cGroup();
2448
+ Composite child = new cGroup("Branch");
18102449 csg.addChild(child);
18112450 child.addChild(csg);
18122451 } else
18132452 if (source == doubleItem)
18142453 {
1815
- Composite csg = new GroupLeaf();
2454
+ Composite csg = new GroupLeaf("Fork");
18162455 csg.count = 5;
18172456 group(csg);
1818
- Composite child = new cGroup();
2457
+ Composite child = new cGroup("Branch A");
18192458 csg.addChild(child);
18202459 child.addChild(csg);
1821
- child = new cGroup();
2460
+ child = new cGroup("Branch B");
18222461 csg.addChild(child);
18232462 child.addChild(csg);
18242463 } else
18252464 if (source == tripleItem)
18262465 {
1827
- Composite csg = new GroupLeaf();
2466
+ Composite csg = new GroupLeaf("Trident");
18282467 csg.count = 4;
18292468 group(csg);
18302469 Composite child = new cGroup();
....@@ -1837,27 +2476,10 @@
18372476 csg.addChild(child);
18382477 child.addChild(csg);
18392478 } else
1840
-
1841
- if (source == importGFDItem)
1842
- {
1843
- ImportGFD();
1844
- } else
1845
- if (source == importVRMLX3DItem)
1846
- {
1847
- ImportVRMLX3D();
1848
- } else
1849
- if (source == import3DSItem)
1850
- {
1851
- objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
1852
- } else
1853
- if (source == importOBJItem)
1854
- {
1855
- objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1856
- } else
18572479 if (source == computeAOItem)
18582480 {
18592481 Globals.drawMode = CameraPane.OCCLUSION;
1860
- Globals.theRenderer.repaint();
2482
+ cameraView.repaint();
18612483 } else
18622484 if (source == recompileItem)
18632485 {
....@@ -1872,7 +2494,7 @@
18722494 if (source == invariantsItem)
18732495 {
18742496 System.out.println("Invariants:");
1875
- GrafreeD.grafreeD.universe.invariants();
2497
+ Grafreed.grafreeD.universe.invariants();
18762498 } else
18772499 if (source == memoryItem)
18782500 {
....@@ -1891,6 +2513,46 @@
18912513 {
18922514 DumpObject();
18932515 } else
2516
+ if (source == minButton)
2517
+ {
2518
+ Minimize();
2519
+ } else
2520
+ if (source == maxButton)
2521
+ {
2522
+ Maximize();
2523
+ } else
2524
+ if (source == fullButton)
2525
+ {
2526
+ ToggleFullScreen();
2527
+ } else
2528
+ if (source == undoButton)
2529
+ {
2530
+ // Go to previous version
2531
+ //if (!Undo())
2532
+ //java.awt.Toolkit.getDefaultToolkit().beep();
2533
+ Undo();
2534
+ } else
2535
+ if (source == restoreButton)
2536
+ {
2537
+ // Restore current version
2538
+ Restore();
2539
+ } else
2540
+ if (source == replaceButton)
2541
+ {
2542
+ // Overwrite current version
2543
+ Replace();
2544
+ } else
2545
+ if (source == redoButton)
2546
+ {
2547
+ // Go to next version
2548
+ Redo();
2549
+ } else
2550
+ if (source == saveButton)
2551
+ {
2552
+ // Save a new version
2553
+ if (!Save(true))
2554
+ java.awt.Toolkit.getDefaultToolkit().beep();
2555
+ } else
18942556 if (source == oneStepButton)
18952557 {
18962558 Globals.ONESTEP = true;
....@@ -1898,17 +2560,14 @@
18982560 } else
18992561 if (source == screenfitButton)
19002562 {
1901
- //Reload(lastConverter, lastFilename, true);
19022563 ScreenFit();
19032564 } else
19042565 if (source == screenfitpointButton)
19052566 {
1906
- //Reload(lastConverter, lastFilename, true);
19072567 ScreenFitPoint();
19082568 } else
19092569 if (source == snapobjectButton)
19102570 {
1911
- //Reload(lastConverter, lastFilename, true);
19122571 SnapObject();
19132572 } else
19142573 // if (event.getSource() == recompileButton)
....@@ -1945,12 +2604,20 @@
19452604 {
19462605 loadClipboard(true);
19472606 } else
2607
+ if (source == undoItem)
2608
+ {
2609
+ Undo();
2610
+ } else
2611
+ if (source == redoItem)
2612
+ {
2613
+ Redo();
2614
+ } else
19482615 if (source == duplicateItem)
19492616 {
1950
- Object3D keep = GrafreeD.clipboard;
2617
+ Object3D keep = Grafreed.clipboard;
19512618 loadClipboard(false);
19522619 paste(false);
1953
- GrafreeD.clipboard = keep;
2620
+ Grafreed.clipboard = keep;
19542621 } else
19552622 if (source == cloneItem)
19562623 {
....@@ -2170,9 +2837,9 @@
21702837 // group.selection.get(0).setMasterThis(content); // should be identity
21712838 // refreshContents();
21722839 // }
2173
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2840
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
21742841 {
2175
- Object3D content = GrafreeD.clipboard.get(0);
2842
+ Object3D content = Grafreed.clipboard.get(0);
21762843
21772844 if (content instanceof cGroup && ((cGroup)content).transientlink )
21782845 content = ((cGroup)content).get(0);
....@@ -2222,9 +2889,9 @@
22222889 } else
22232890 if (source == setMasterItem)
22242891 {
2225
- if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
2892
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
22262893 {
2227
- Object3D content = GrafreeD.clipboard.get(0);
2894
+ Object3D content = Grafreed.clipboard.get(0);
22282895
22292896 if (content instanceof cGroup && ((cGroup)content).transientlink )
22302897 content = ((cGroup)content).get(0);
....@@ -2237,9 +2904,9 @@
22372904 {
22382905 if (group.selection.size() == 1)
22392906 {
2240
- if (GrafreeD.clipboard.size() == 1)
2907
+ if (Grafreed.clipboard.size() == 1)
22412908 {
2242
- Object3D content = GrafreeD.clipboard.get(0);
2909
+ Object3D content = Grafreed.clipboard.get(0);
22432910
22442911 if (content instanceof cGroup && ((cGroup)content).transientlink )
22452912 content = ((cGroup)content).get(0);
....@@ -2256,7 +2923,7 @@
22562923 {
22572924 RevertMeshes();
22582925 } else
2259
- if (source == resetMeshItem)
2926
+ if (source == resetAllItem)
22602927 {
22612928 ResetAll();
22622929 } else
....@@ -2264,7 +2931,7 @@
22642931 {
22652932 StepAll();
22662933 } else
2267
- if (source == clearItem) // || event.getSource() == clearButton)
2934
+ if (source == deleteItem) // || event.getSource() == clearButton)
22682935 {
22692936 //int indices[] = jList.getSelectedIndices();
22702937 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2276,9 +2943,9 @@
22762943 {
22772944 ClearSelection(true);
22782945 } else
2279
- if (source == grabItem)
2946
+ if (source == grabItem || source == groupButton)
22802947 {
2281
- group(new cGroup(), true);
2948
+ group(new cGroup(), false); // true);
22822949 } else
22832950 if (source == hideItem)
22842951 {
....@@ -2296,11 +2963,11 @@
22962963 {
22972964 makeSomething(new Camera());
22982965 } else
2299
- if (source == compositeItem)
2966
+ if (source == compositeItem || source == compositeButton)
23002967 {
23012968 group(new Composite());
23022969 } else
2303
- if (source == randomItem)
2970
+ if (source == switchItem || source == switchButton)
23042971 {
23052972 RandomNode random = new RandomNode();
23062973 group(random);
....@@ -2402,7 +3069,7 @@
24023069 {
24033070 group(new cLinker());
24043071 } else
2405
- if (source == textureItem)
3072
+ if (source == textureItem || source == textureButton)
24063073 {
24073074 group(new TextureNode());
24083075 } else
....@@ -2422,17 +3089,30 @@
24223089 {
24233090 CastShadow(2);
24243091 } else
2425
- if (source == ungroupItem)
3092
+ if (source == ungroupItem || source == ungroupButton)
24263093 {
2427
- //ungroup();
3094
+ boolean hasRoot = false;
3095
+
24283096 for (int i=0; i<group.selection.size(); i++)
24293097 {
2430
- Ungroup(group.selection.get(i));
3098
+ if (group.selection.get(i) == group)
3099
+ {
3100
+ hasRoot = true;
3101
+ break;
3102
+ }
24313103 }
24323104
2433
- ClearSelection(false);
2434
-
2435
- refreshContents();
3105
+ if (!hasRoot)
3106
+ {
3107
+ for (int i=0; i<group.selection.size(); i++)
3108
+ {
3109
+ Ungroup(group.selection.get(i));
3110
+ }
3111
+
3112
+ ClearSelection(false);
3113
+
3114
+ refreshContents();
3115
+ }
24363116 } else
24373117 if (source == genUVItem)
24383118 {
....@@ -2444,7 +3124,7 @@
24443124 } else
24453125 if (source == genNormalsMESHItem)
24463126 {
2447
- GenNormals(true); // TODO
3127
+ GenNormalsMESH();
24483128 } else
24493129 if (source == genNormalsORGANItem)
24503130 {
....@@ -2509,6 +3189,22 @@
25093189 if (source == unmarkleavesItem)
25103190 {
25113191 MarkLeaves(false);
3192
+ } else
3193
+ if (source == rewindleavesItem)
3194
+ {
3195
+ RewindLeaves(true);
3196
+ } else
3197
+ if (source == unrewindleavesItem)
3198
+ {
3199
+ RewindLeaves(false);
3200
+ } else
3201
+ if (source == randomleavesItem)
3202
+ {
3203
+ RandomLeaves(true);
3204
+ } else
3205
+ if (source == unrandomleavesItem)
3206
+ {
3207
+ RandomLeaves(false);
25123208 } else
25133209 if (source == flipVItem)
25143210 {
....@@ -2594,9 +3290,13 @@
25943290 {
25953291 SmoothMesh();
25963292 } else
2597
- if (source == transformgeometryItem)
3293
+ if (source == transformGeometryItem)
25983294 {
25993295 TransformGeometry();
3296
+ } else
3297
+ if (source == transformChildrenItem)
3298
+ {
3299
+ TransformChildren();
26003300 } else
26013301 if (source == resetTransformItem)
26023302 {
....@@ -2604,7 +3304,11 @@
26043304 } else
26053305 if (source == resetCentroidItem)
26063306 {
2607
- ResetCentroid();
3307
+ ResetCentroid(true);
3308
+ } else
3309
+ if (source == resetCentroidXZItem)
3310
+ {
3311
+ ResetCentroid(false);
26083312 } else
26093313 if (source == resetParentItem)
26103314 {
....@@ -2709,7 +3413,7 @@
27093413 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
27103414 {
27113415 obj = (Object3D)e.nextElement();
2712
- obj.SetBumpTexture(null);
3416
+ obj.ResetBumpTexture();
27133417 }
27143418
27153419 refreshContents();
....@@ -2725,6 +3429,31 @@
27253429
27263430 refreshContents();
27273431 } else
3432
+ if (source == embedTexturesItem)
3433
+ {
3434
+ Object3D obj;
3435
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3436
+ {
3437
+ obj = (Object3D)e.nextElement();
3438
+ obj.EmbedTextures(true);
3439
+ }
3440
+
3441
+ refreshContents();
3442
+ } else
3443
+ if (source == deEmbedTexturesItem)
3444
+ {
3445
+ Object3D obj;
3446
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3447
+ {
3448
+ obj = (Object3D)e.nextElement();
3449
+ obj.EmbedTextures(false);
3450
+ }
3451
+
3452
+ CameraPane.texturepigment.clear();
3453
+ CameraPane.texturebump.clear();
3454
+
3455
+ refreshContents();
3456
+ } else
27283457 if (source == flashSelectionButton)
27293458 {
27303459 CameraPane.flash = true;
....@@ -2736,6 +3465,10 @@
27363465 if (source == twoButton)
27373466 {
27383467 radio.layout = twoButton;
3468
+
3469
+ if (CameraPane.FULLSCREEN)
3470
+ fullscreenLayout = radio.layout;
3471
+
27393472 // bug
27403473 //gridPanel.setDividerLocation(1.0);
27413474 //bigPanel.setDividerLocation(0.0);
....@@ -2768,10 +3501,31 @@
27683501 bigThree.ClearUI();
27693502 bigThree.add(centralPanel);
27703503 bigThree.FlushUI();
3504
+
3505
+ cameraView.requestFocusInWindow();
3506
+
3507
+// refreshContents(true);
3508
+//
3509
+// try
3510
+// {
3511
+// java.awt.Robot bot = new java.awt.Robot();
3512
+// int mask = InputEvent.BUTTON1_MASK;
3513
+// bot.mouseMove(100, 100);
3514
+// bot.mousePress(mask);
3515
+// bot.mouseRelease(mask);
3516
+// }
3517
+// catch (Exception e)
3518
+// {
3519
+//
3520
+// }
3521
+
27713522 } else
27723523 if (source == threeButton)
27733524 {
27743525 radio.layout = threeButton;
3526
+
3527
+ if (CameraPane.FULLSCREEN)
3528
+ fullscreenLayout = radio.layout;
27753529
27763530 // bigThree.remove(scenePanel);
27773531 // bigThree.remove(centralPanel);
....@@ -2801,13 +3555,18 @@
28013555 // centralPanel.setVisible(true);
28023556 // XYZPanel.setVisible(true);
28033557 bigThree.ClearUI();
3558
+ bigThree.add(scenePanel);
28043559 bigThree.add(centralPanel);
2805
- bigThree.add(XYZPanel);
28063560 bigThree.FlushUI();
3561
+
3562
+ cameraView.requestFocusInWindow();
28073563 } else
28083564 if (source == fourButton)
28093565 {
28103566 radio.layout = fourButton;
3567
+
3568
+ if (CameraPane.FULLSCREEN)
3569
+ fullscreenLayout = radio.layout;
28113570
28123571 // bigThree.remove(scenePanel);
28133572 // bigThree.remove(centralPanel);
....@@ -2839,10 +3598,15 @@
28393598 bigThree.ClearUI();
28403599 bigThree.add(scenePanel);
28413600 bigThree.FlushUI();
3601
+
3602
+ cameraView.requestFocusInWindow();
28423603 } else
28433604 if (source == sixButton)
28443605 {
28453606 radio.layout = sixButton;
3607
+
3608
+ if (CameraPane.FULLSCREEN)
3609
+ fullscreenLayout = radio.layout;
28463610
28473611 // bigThree.remove(scenePanel);
28483612 // bigThree.remove(centralPanel);
....@@ -2872,13 +3636,18 @@
28723636 // centralPanel.setVisible(true);
28733637 // XYZPanel.setVisible(false);
28743638 bigThree.ClearUI();
2875
- bigThree.add(scenePanel);
28763639 bigThree.add(centralPanel);
3640
+ bigThree.add(scenePanel);
28773641 bigThree.FlushUI();
3642
+
3643
+ cameraView.requestFocusInWindow();
28783644 } else
28793645 if (source == sevenButton)
28803646 {
28813647 radio.layout = sevenButton;
3648
+
3649
+ if (CameraPane.FULLSCREEN)
3650
+ fullscreenLayout = radio.layout;
28823651
28833652 // bigThree.remove(scenePanel);
28843653 // bigThree.remove(centralPanel);
....@@ -2912,6 +3681,8 @@
29123681 bigThree.add(centralPanel);
29133682 bigThree.add(XYZPanel);
29143683 bigThree.FlushUI();
3684
+
3685
+ cameraView.requestFocusInWindow();
29153686 } else
29163687 if (source == rootButton)
29173688 {
....@@ -2923,6 +3694,7 @@
29233694 EditObject(obj);
29243695 }
29253696
3697
+ cameraView.requestFocusInWindow();
29263698 refreshContents(true);
29273699 } else
29283700 if (source == closeButton)
....@@ -2932,22 +3704,37 @@
29323704 for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
29333705 {
29343706 ab = (cRadio)e.nextElement();
2935
- if(ab.getModel().isSelected() && ab.GetObject() != client)
3707
+ if (ab.getModel().isSelected() && ab.GetObject() != client)
29363708 {
3709
+ // Patch to avoid bug with transparency.
3710
+ if (!ab.hadMaterial)
3711
+ {
3712
+ ab.object.material = null;
3713
+ }
3714
+
29373715 buttonGroup.remove(ab);
29383716 radioPanel.remove(ab);
29393717
2940
- ab.GetObject().editWindow = null;
3718
+ //ab.GetObject().editWindow = null;
3719
+ ab.GetObject().manipWindow = null;
29413720 // ab.GetObject().objectUI = null; // ?????????
29423721
29433722 ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick();
29443723 break;
29453724 }
29463725 }
3726
+
3727
+ cameraView.requestFocusInWindow();
29473728 refreshContents(true);
29483729 } else
29493730 if (source == editItem || source == editButton)
29503731 {
3732
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3733
+ {
3734
+ Object3D child = (Object3D)e.nextElement();
3735
+ child.pinned = true;
3736
+ }
3737
+
29513738 EditSelection(false);
29523739 } else
29533740 if (source == uneditButton)
....@@ -2957,10 +3744,11 @@
29573744 Object3D child = (Object3D)e.nextElement();
29583745 if(child.editWindow != null)
29593746 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3747
+ child.pinned = false;
29603748 child.CloseUI();
29613749 listUI.remove(child);
29623750
2963
- child.editWindow = null; // ???????????
3751
+ //child.editWindow = null; // ???????????
29643752 }
29653753 objEditor.ctrlPanel.FlushUI();
29663754 //objEditor.jTree.clearSelection();
....@@ -2973,6 +3761,7 @@
29733761 //copy.ClearUI();
29743762 for (Object3D obj : listUI)
29753763 {
3764
+ obj.pinned = false;
29763765 obj.CloseUI();
29773766 }
29783767 listUI.clear();
....@@ -2982,7 +3771,7 @@
29823771 {
29833772 assert(copy == group);
29843773
2985
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3774
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
29863775
29873776 for (Object3D obj : listUI)
29883777 {
....@@ -3031,6 +3820,9 @@
30313820 }
30323821
30333822 copy = group;
3823
+
3824
+ SetUndoStates();
3825
+
30343826 //Globals.theRenderer.object = group;
30353827 if(!useclient)
30363828 {
....@@ -3046,20 +3838,46 @@
30463838 frontView.object = group;
30473839 sideView.object = group;
30483840 }
3049
- group.editWindow = this;
3841
+
3842
+// fix "+" issue
3843
+ //group.editWindow = this;
3844
+ group.manipWindow = this;
3845
+
30503846 /*
30513847 currentLayout = radio.layout;
30523848 if (currentLayout == null)
30533849 currentLayout = sevenButton;
30543850 */
30553851 radio.layout.doClick();
3852
+
3853
+ ClearUnpinned();
3854
+ //Grafreed.Assert(group != null);
3855
+ //Grafreed.Assert(group.selection != null);
3856
+ SetPinStates(group.selection == null || group.selection.size() > 0);
3857
+ if (group.selection == null || group.selection.size() == 1)
3858
+ EditSelection(false);
30563859 keepparent = group.parent;
30573860 // PARENT = NULL or not???
30583861 //group.parent = null; // ROOT
30593862 //group.attributes = -1;
30603863 ResetModel();
3864
+
3865
+ cameraView.requestFocusInWindow();
30613866 refreshContents(true);
3062
- }
3867
+ } else if (event.getSource() == editCameraItem)
3868
+ {
3869
+ cameraView.ProtectCamera();
3870
+ cameraView.repaint();
3871
+ return;
3872
+ } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton)
3873
+ {
3874
+ cameraView.RevertCamera();
3875
+ cameraView.repaint();
3876
+ return;
3877
+ // } else if (event.getSource() == textureButton)
3878
+ // {
3879
+ // return; // true;
3880
+ }
30633881 else
30643882 {
30653883 //return super.action(event, arg);
....@@ -3068,7 +3886,6 @@
30683886 }
30693887
30703888 boolean useclient = false;
3071
- cRadio radio;
30723889
30733890 void ToggleRoot()
30743891 {
....@@ -3120,6 +3937,28 @@
31203937 refreshContents();
31213938 }
31223939
3940
+ void TransformChildren()
3941
+ {
3942
+ Object3D obj;
3943
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3944
+ {
3945
+ obj = (Object3D)e.nextElement();
3946
+ obj.KeepTextureMatrices();
3947
+ obj.TransformChildren();
3948
+ obj.RestoreTextureMatrices();
3949
+
3950
+// if (obj.parent == null)
3951
+// {
3952
+// System.out.println("NULL PARENT!");
3953
+// new Exception().printStackTrace();
3954
+// }
3955
+// else
3956
+// TouchTransform(obj);
3957
+// //obj.parent.Touch();
3958
+ }
3959
+
3960
+ refreshContents();
3961
+ }
31233962
31243963 void ResetTransform()
31253964 {
....@@ -3232,7 +4071,7 @@
32324071 refreshContents();
32334072 }
32344073
3235
- void ResetCentroid()
4074
+ void ResetCentroid(boolean full)
32364075 {
32374076 Object3D obj;
32384077 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3247,12 +4086,16 @@
32474086 LA.matIdentity(Object3D.mat);
32484087 obj.getBounds(minima, maxima, false);
32494088 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3250
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
4089
+ if (full)
4090
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
32514091 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
32524092 obj.TransformMesh(Object3D.mat);
4093
+
32534094 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3254
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
4095
+ if (full)
4096
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
32554097 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
4098
+
32564099 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
32574100 //Object3D.mat[3][0] = -Object3D.mat[3][0];
32584101 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3281,7 +4124,8 @@
32814124
32824125 int size = obj.MemorySize();
32834126
3284
- System.err.println((size/1024) + " KB is the size of " + obj);
4127
+ //System.err.println((size/1024) + " KB is the size of " + obj);
4128
+ System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)");
32854129 }
32864130 }
32874131 catch (Exception e)
....@@ -3318,9 +4162,9 @@
33184162 obj = (Object3D)e.nextElement();
33194163
33204164 System.out.println("Object is: " + obj);
3321
- GrafreeD.AnalyzeObject(obj);
4165
+ Grafreed.AnalyzeObject(obj);
33224166 System.out.println("Boundary rep: " + obj.bRep);
3323
- GrafreeD.AnalyzeObject(obj.bRep);
4167
+ Grafreed.AnalyzeObject(obj.bRep);
33244168
33254169 // System.err.println((size/1024) + " KB is the size of " + obj);
33264170 }
....@@ -3362,6 +4206,13 @@
33624206 void GenNormals(boolean crease)
33634207 {
33644208 group.GenNormalsS(crease);
4209
+
4210
+ refreshContents();
4211
+ }
4212
+
4213
+ void GenNormalsMESH()
4214
+ {
4215
+ group.GenNormalsMeshS();
33654216
33664217 refreshContents();
33674218 }
....@@ -3534,8 +4385,8 @@
35344385
35354386 void ParseVertices()
35364387 {
3537
- boolean epsequal = GrafreeD.epsequal;
3538
- GrafreeD.epsequal = true;
4388
+ boolean epsequal = Grafreed.epsequal;
4389
+ Grafreed.epsequal = true;
35394390
35404391 for (int i=0; i<group.selection.size(); i++)
35414392 {
....@@ -3560,7 +4411,7 @@
35604411 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
35614412 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
35624413
3563
- g.add(GrafreeD.clipboard);
4414
+ g.add(Grafreed.clipboard);
35644415
35654416 buffer.add(g);
35664417 }
....@@ -3575,7 +4426,7 @@
35754426 makeSomething(buffer, i==group.selection.size()-1);
35764427 }
35774428
3578
- GrafreeD.epsequal = epsequal;
4429
+ Grafreed.epsequal = epsequal;
35794430
35804431 refreshContents();
35814432 }
....@@ -3593,7 +4444,16 @@
35934444 String pigment = Object3D.GetPigment(tex);
35944445 //String bump = Object3D.GetBump(tex);
35954446
3596
- com.sun.opengl.util.texture.TextureData texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
4447
+ com.sun.opengl.util.texture.TextureData texturedata = null;
4448
+
4449
+ try
4450
+ {
4451
+ texturedata = Globals.theRenderer.GetTextureData(tex, false, node.texres);
4452
+ }
4453
+ catch (Exception e)
4454
+ {
4455
+ System.err.println("FAIL: " + node);
4456
+ }
35974457
35984458 double s = v.s;
35994459
....@@ -3725,7 +4585,7 @@
37254585 return;
37264586
37274587 Object3D poses = group.selection.get(0);
3728
- Object3D ref = GrafreeD.clipboard.get(0);
4588
+ Object3D ref = Grafreed.clipboard.get(0);
37294589
37304590 Object3D newgroup = new Object3D("Po:" + poses.name);
37314591
....@@ -3919,9 +4779,9 @@
39194779
39204780 void ClipMesh()
39214781 {
3922
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
4782
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
39234783 {
3924
- Object3D content = GrafreeD.clipboard.get(0);
4784
+ Object3D content = Grafreed.clipboard.get(0);
39254785
39264786 if (content instanceof cGroup && ((cGroup)content).transientlink )
39274787 content = ((cGroup)content).get(0);
....@@ -3930,7 +4790,7 @@
39304790 // {
39314791 // group.selection.get(i).ClipMesh(GrafreeD.clipboard);
39324792 // }
3933
- group.selection.ClipMesh(GrafreeD.clipboard);
4793
+ group.selection.ClipMesh(Grafreed.clipboard);
39344794 }
39354795 // group.selection.ClipMesh(GrafreeD.clipboard);
39364796 System.out.println("DONE.");
....@@ -3977,6 +4837,18 @@
39774837 void MarkLeaves(boolean hide)
39784838 {
39794839 group.selection.MarkLeaves(hide);
4840
+ refreshContents();
4841
+ }
4842
+
4843
+ void RewindLeaves(boolean hide)
4844
+ {
4845
+ group.selection.RewindLeaves(hide);
4846
+ refreshContents();
4847
+ }
4848
+
4849
+ void RandomLeaves(boolean hide)
4850
+ {
4851
+ group.selection.RandomLeaves(hide);
39804852 refreshContents();
39814853 }
39824854
....@@ -4051,28 +4923,25 @@
40514923 // }
40524924 // }
40534925
4054
- static boolean allparams = true;
4055
-
4056
- static Vector<Object3D> listUI = new Vector<Object3D>();
4057
-
40584926 void EditSelection(boolean newWindow)
40594927 {
4928
+ if (group.selection == null)
4929
+ {
4930
+ EditElement(group, newWindow); // ? new
4931
+ return;
4932
+ }
4933
+
40604934 // aConstraints.gridy = 0;
40614935 for (int i=0; i<group.selection.size(); i++)
40624936 {
40634937 //System.out.println("edit : " + objectPanel.indexOfTab("Material"));
40644938 //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false);
4065
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
4939
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
40664940
40674941 Object3D elem = (Object3D)group.selection.elementAt(i);
4068
- if(elem != group)
4942
+ if(elem != group || !newWindow)
40694943 {
4070
- // if (!(elem instanceof Composite))
4071
- // newWindow = false;
4072
- listUI.add(elem);
4073
- elem.openEditWindow(this, newWindow); //, false);
4074
- System.out.println("edit : " + elem);
4075
- elem.editWindow.refreshContents(true); // ? new
4944
+ EditElement(elem, newWindow); // ? new
40764945 }
40774946 }
40784947 }
....@@ -4147,7 +5016,8 @@
41475016 //new Exception().printStackTrace();
41485017
41495018 freezemodel = true;
4150
-
5019
+ ClearUnpinned();
5020
+
41515021 /**/
41525022 //switch (event.id)
41535023 {
....@@ -4155,7 +5025,6 @@
41555025 //case 702: // Event.LIST_DESELECT
41565026 group.deselectAll();
41575027 TreePath tps[] = objEditor.jTree.getSelectionPaths();
4158
- objEditor.ClearInfo(); // .GetMaterial());
41595028 if (tps != null)
41605029 {
41615030 for (int i=0; i < tps.length; i++)
....@@ -4164,10 +5033,8 @@
41645033
41655034 //if (child.parent != null)
41665035 //child.parent.addSelectee(child);
5036
+ objEditor.SetMaterial(child);
41675037 group.addSelectee(child);
4168
- objEditor.SetMaterial(child); // .GetMaterial());
4169
- objEditor.AddInfo(child, this, true); // .GetMaterial());
4170
- System.err.println("info : " + child.GetPath());
41715038 }
41725039 }
41735040 // else
....@@ -4177,20 +5044,28 @@
41775044 // System.err.println("info : " + group.GetPath());
41785045 // }
41795046
4180
- objEditor.SetText(); // jan 2014
4181
-
4182
- if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
5047
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera))
41835048 CameraPane.flash = true;
41845049
4185
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
5050
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
41865051 // a camera
41875052 {
4188
- CameraPane.camerachangeframe = 0; // don't refuse it
4189
- Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
5053
+ if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crash the camera because of invalid lightspace
5054
+ {
5055
+ CameraPane.camerachangeframe = 0; // don't refuse it
5056
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
5057
+ }
41905058 // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
41915059 // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
41925060 }
41935061
5062
+ if (tps != null && tps.length == 1)
5063
+ {
5064
+ EditSelection(false);
5065
+ }
5066
+
5067
+ SetPinStates(tps != null && tps.length > 0);
5068
+
41945069 refreshContents();
41955070 //return true;
41965071 }
....@@ -4199,6 +5074,35 @@
41995074
42005075 freezemodel = false;
42015076 }
5077
+
5078
+ void SetPinStates(boolean enabled)
5079
+ {
5080
+ editButton.setEnabled(enabled);
5081
+ uneditButton.setEnabled(enabled);
5082
+ unselectButton.setEnabled(enabled);
5083
+ flashSelectionButton.setEnabled(enabled);
5084
+ }
5085
+
5086
+ void refreshContents(boolean cp)
5087
+ {
5088
+ if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info"))
5089
+ if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING)
5090
+ {
5091
+ objEditor.ClearInfo(); // .GetMaterial());
5092
+
5093
+ for (int i=0; i < group.selection.Size(); i++)
5094
+ {
5095
+ Object3D child = (Object3D) group.selection.get(i);
5096
+
5097
+ objEditor.AddInfo(child, this, true);
5098
+ System.err.println("info : " + child.GetPath());
5099
+ }
5100
+
5101
+ objEditor.SetText(); // jan 2014
5102
+ }
5103
+
5104
+ super.refreshContents(cp);
5105
+ }
42025106
42035107 void linkSomething(Object3D thing)
42045108 {
....@@ -4270,16 +5174,19 @@
42705174 {
42715175 if (group.selection.isEmpty())
42725176 return;
4273
- GrafreeD.clipboardIsTempGroup = false;
5177
+
5178
+ Grafreed.clipboardIsTempGroup = false;
42745179 Composite tGroup = null;
42755180 if (group.selection.size() > 0) // 1)
42765181 {
42775182 tGroup = new cGroup();
4278
- GrafreeD.clipboardIsTempGroup = true;
5183
+ Grafreed.clipboardIsTempGroup = true;
42795184 }
42805185
42815186 if (cut)
42825187 {
5188
+// if (Globals.SAVEONMAKE) // Moved to the clipboard, no need to save.
5189
+// Save();
42835190 //int indices[] = jList.getSelectedIndices();
42845191 //for (int i = indices.length - 1; i >= 0; i--)
42855192 //jList.remove(indices[i]);
....@@ -4315,16 +5222,16 @@
43155222 //System.out.println("cut " + child);
43165223 //System.out.println("parent = " + child.parent);
43175224 // tmp.addChild(child);
4318
- if (GrafreeD.clipboardIsTempGroup)
5225
+ if (Grafreed.clipboardIsTempGroup)
43195226 tGroup.add/*Child*/(tmp);
43205227 else
4321
- GrafreeD.clipboard = tmp;
5228
+ Grafreed.clipboard = tmp;
43225229 }
43235230 else
4324
- if (GrafreeD.clipboardIsTempGroup)
5231
+ if (Grafreed.clipboardIsTempGroup)
43255232 tGroup.add/*Child*/(child);
43265233 else
4327
- GrafreeD.clipboard = child;
5234
+ Grafreed.clipboard = child;
43285235 }
43295236
43305237 //ResetModel();
....@@ -4356,21 +5263,23 @@
43565263 //System.out.println("cut " + elem);
43575264 //System.out.println("parent = " + elem.parent);
43585265 // tmp.addChild(elem);
4359
- if (GrafreeD.clipboardIsTempGroup)
5266
+ if (Grafreed.clipboardIsTempGroup)
43605267 tGroup.add/*Child*/(tmp);
43615268 else
4362
- GrafreeD.clipboard = tmp;
5269
+ Grafreed.clipboard = tmp;
43635270 }
43645271 else
4365
- if (GrafreeD.clipboardIsTempGroup)
5272
+ if (Grafreed.clipboardIsTempGroup)
43665273 tGroup.add/*Child*/(child);
43675274 else
4368
- GrafreeD.clipboard = child;
5275
+ Grafreed.clipboard = child;
43695276 }
43705277
43715278 }
4372
- if (GrafreeD.clipboardIsTempGroup)
4373
- GrafreeD.clipboard = tGroup;
5279
+
5280
+ if (Grafreed.clipboardIsTempGroup)
5281
+ Grafreed.clipboard = tGroup;
5282
+
43745283 if (cut)
43755284 {
43765285 ResetModel();
....@@ -4380,11 +5289,15 @@
43805289
43815290 void paste(boolean expand)
43825291 {
5292
+ if (Globals.REPLACEONMAKE)
5293
+ Save();
5294
+ boolean keep = Globals.REPLACEONMAKE;
5295
+ Globals.REPLACEONMAKE = false;
43835296 // if (GrafreeD.clipboard == null)
43845297 // return;
43855298 boolean first = true;
43865299
4387
- if (GrafreeD.clipboardIsTempGroup)
5300
+ if (Grafreed.clipboardIsTempGroup)
43885301 {
43895302 Composite temp;
43905303
....@@ -4395,7 +5308,7 @@
43955308 temp = (Composite)Applet3D.clipboard.deepCopy();
43965309 */
43975310 Object3D elem;
4398
- for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
5311
+ for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
43995312 {
44005313 Object3D child = (Object3D)e.nextElement();
44015314
....@@ -4429,16 +5342,17 @@
44295342 //Object3D cb = Applet3D.clipboard;
44305343 //temp.addChild(cb);
44315344 //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0));
4432
- assert(GrafreeD.clipboard.parent == null);
4433
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
4434
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
4435
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
4436
- makeSomething(expand?GrafreeD.clipboard.get(0).copyExpand():GrafreeD.clipboard.get(0).deepCopy());
5345
+ assert(Grafreed.clipboard.parent == null);
5346
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
5347
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
5348
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
5349
+ makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy());
44375350 else
4438
- makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4439
- GrafreeD.clipboard.get(0).parent = keepparent;
5351
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
5352
+ Grafreed.clipboard.get(0).parent = keepparent;
44405353 }
44415354
5355
+ Globals.REPLACEONMAKE = keep;
44425356 ResetModel();
44435357 refreshContents();
44445358 }
....@@ -4485,9 +5399,9 @@
44855399 {
44865400 boolean first = true;
44875401
4488
- if (GrafreeD.clipboardIsTempGroup)
5402
+ if (Grafreed.clipboardIsTempGroup)
44895403 {
4490
- Composite temp = (Composite)GrafreeD.clipboard;
5404
+ Composite temp = (Composite)Grafreed.clipboard;
44915405 Object3D copy;
44925406 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
44935407 {
....@@ -4497,7 +5411,7 @@
44975411 }
44985412 } else
44995413 {
4500
- linkSomething(GrafreeD.clipboard); //.get(0));
5414
+ linkSomething(Grafreed.clipboard); //.get(0));
45015415 }
45025416 }
45035417 }
....@@ -4574,6 +5488,10 @@
45745488
45755489 void group(Object3D csg, boolean grab)
45765490 {
5491
+ if (Globals.REPLACEONMAKE)
5492
+ Save();
5493
+ boolean keep = Globals.REPLACEONMAKE;
5494
+ Globals.REPLACEONMAKE = false;
45775495 if (//false) // why??
45785496 !group.selection.isEmpty())
45795497 {
....@@ -4687,10 +5605,15 @@
46875605 //node.add(csg);
46885606 //makeSomething(node);
46895607 makeSomething(csg);
5608
+ Globals.REPLACEONMAKE = keep;
46905609 }
46915610
46925611 void Ungroup(Object3D g)
46935612 {
5613
+ if (Globals.REPLACEONMAKE)
5614
+ Save();
5615
+ boolean keep = Globals.REPLACEONMAKE;
5616
+ Globals.REPLACEONMAKE = false;
46945617 if (g instanceof HiddenObject)
46955618 {
46965619 HiddenObject h = (HiddenObject) g;
....@@ -4707,6 +5630,7 @@
47075630 objEditor.makeSomething(g.get(i), false);
47085631 }
47095632 }
5633
+ Globals.REPLACEONMAKE = keep;
47105634 }
47115635
47125636 void ungroup()
....@@ -4902,21 +5826,6 @@
49025826 }
49035827 */
49045828
4905
- void ImportGFD()
4906
- {
4907
- FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD);
4908
- browser.show();
4909
- String filename = browser.getFile();
4910
- if (filename != null && filename.length() > 0)
4911
- {
4912
- String fullname = browser.getDirectory() + filename;
4913
-
4914
- //Object3D readobj =
4915
- objEditor.ReadGFD(fullname, objEditor);
4916
- //makeSomething(readobj);
4917
- }
4918
- }
4919
-
49205829 /*
49215830 public void Callback(Object obj)
49225831 {
....@@ -4940,26 +5849,9 @@
49405849 }
49415850 */
49425851
4943
- void ImportVRMLX3D()
4944
- {
4945
- if (GrafreeD.standAlone)
4946
- {
4947
- /**/
4948
- FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
4949
- browser.show();
4950
- String filename = browser.getFile();
4951
- if (filename != null && filename.length() > 0)
4952
- {
4953
- String fullname = browser.getDirectory() + filename;
4954
- LoadVRMLX3D(fullname);
4955
- }
4956
- /**/
4957
- }
4958
- }
4959
-
49605852 String GetFile(String dialogName)
49615853 {
4962
- if (GrafreeD.standAlone)
5854
+ if (Grafreed.standAlone)
49635855 {
49645856 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
49655857 browser.show();
....@@ -5027,7 +5919,44 @@
50275919 cButton clearpanelButton;
50285920 cButton unselectButton;
50295921
5922
+ cButton restoreCameraButton;
5923
+
5924
+ cButton saveButton;
50305925 cButton oneStepButton;
5926
+
5927
+ cButton groupButton;
5928
+ cButton ungroupButton;
5929
+ cButton compositeButton;
5930
+ cButton switchButton;
5931
+ cButton loopButton;
5932
+ cButton textureButton;
5933
+
5934
+ cButton skybox1Button;
5935
+ cButton skybox2Button;
5936
+ cButton skybox3Button;
5937
+ cButton skybox4Button;
5938
+ cButton skybox5Button;
5939
+ cButton skybox6Button;
5940
+ cButton skybox7Button;
5941
+
5942
+ cButton skybox11Button;
5943
+ cButton skybox12Button;
5944
+ cButton skybox13Button;
5945
+ cButton skybox14Button;
5946
+ cButton skybox15Button;
5947
+ cButton skybox16Button;
5948
+ cButton skybox17Button;
5949
+
5950
+ cButton gridButton;
5951
+ cButton boxButton;
5952
+ cButton sphereButton;
5953
+ cButton coneButton;
5954
+ cButton torusButton;
5955
+ cButton superButton;
5956
+ cButton kleinButton;
5957
+ cButton particlesButton;
5958
+ cButton overlayButton;
5959
+ cButton lightButton;
50315960
50325961 cButton screenfitButton;
50335962 cButton screenfitpointButton;
....@@ -5040,14 +5969,6 @@
50405969
50415970 cButton setsupportButton;
50425971
5043
- cButton twoButton;
5044
- cButton sixButton;
5045
- cButton threeButton;
5046
- cButton sevenButton;
5047
- cButton fourButton; // full panel
5048
- cButton oneButton; // full XYZ
5049
- //cButton currentLayout;
5050
-
50515972 //
50525973 //Composite
50535974 Object3D // to do !!
....@@ -5057,9 +5978,11 @@
50575978 //JTree jTree;
50585979 private MenuItem lookAtItem;
50595980 private MenuItem lookFromItem;
5060
- private MenuItem switchItem;
5981
+ private MenuItem switchViewItem;
50615982 private MenuItem cutItem;
5062
- private MenuItem duplicateItem;
5983
+ private MenuItem undoItem;
5984
+ private MenuItem redoItem;
5985
+ private JMenuItem duplicateItem;
50635986 private MenuItem cloneItem;
50645987 private MenuItem cloneSupportItem;
50655988 private MenuItem overwriteGeoItem;
....@@ -5072,7 +5995,7 @@
50725995 private MenuItem linkverticesItem;
50735996 private MenuItem relinkverticesItem;
50745997 private MenuItem setMasterItem;
5075
- private MenuItem resetMeshItem;
5998
+ private MenuItem resetAllItem;
50765999 private MenuItem stepAllItem;
50776000 private MenuItem revertMeshItem;
50786001 private MenuItem poseMeshItem;
....@@ -5087,7 +6010,7 @@
50876010 private MenuItem pasteLinkItem;
50886011 private MenuItem pasteCloneItem;
50896012 private MenuItem pasteExpandItem;
5090
- private MenuItem clearItem;
6013
+ private MenuItem deleteItem;
50916014 private MenuItem clearAllItem;
50926015 private MenuItem genUVItem;
50936016 private MenuItem genNormalsMESHItem;
....@@ -5122,6 +6045,10 @@
51226045 private MenuItem showleavesItem;
51236046 private MenuItem markleavesItem;
51246047 private MenuItem unmarkleavesItem;
6048
+ private MenuItem rewindleavesItem;
6049
+ private MenuItem unrewindleavesItem;
6050
+ private MenuItem randomleavesItem;
6051
+ private MenuItem unrandomleavesItem;
51256052
51266053 private MenuItem flipVItem;
51276054 private MenuItem unflipVItem;
....@@ -5133,15 +6060,17 @@
51336060 private MenuItem panoTexturesItem;
51346061
51356062 private MenuItem resetCentroidItem;
5136
- private MenuItem transformgeometryItem;
6063
+ private MenuItem resetCentroidXZItem;
51376064 private MenuItem resetTransformItem;
6065
+ private MenuItem transformGeometryItem;
6066
+ private MenuItem transformChildrenItem;
51386067 private MenuItem hideItem;
51396068 private MenuItem grabItem;
51406069 private MenuItem backItem;
51416070 private MenuItem frontItem;
51426071 private MenuItem cameraItem;
51436072 private MenuItem compositeItem;
5144
- private MenuItem randomItem;
6073
+ private MenuItem switchItem;
51456074 private MenuItem physicsItem;
51466075 private MenuItem frameselectorItem;
51476076 private MenuItem scriptNodeItem;
....@@ -5165,6 +6094,8 @@
51656094 private MenuItem attachBumpItem;
51666095 private MenuItem detachBumpItem;
51676096 private MenuItem pigmentBumpItem;
6097
+ private MenuItem embedTexturesItem;
6098
+ private MenuItem deEmbedTexturesItem;
51686099
51696100 private MenuItem particleItem;
51706101 private MenuItem ragdollItem;
....@@ -5203,11 +6134,6 @@
52036134 private MenuItem doubleItem;
52046135 private MenuItem tripleItem;
52056136
5206
- private MenuItem importGFDItem;
5207
- private MenuItem importVRMLX3DItem;
5208
- private MenuItem import3DSItem;
5209
- private MenuItem importOBJItem;
5210
-
52116137 private MenuItem computeAOItem;
52126138 private MenuItem recompileItem;
52136139 private MenuItem editScriptItem;
....@@ -5217,4 +6143,8 @@
52176143 private MenuItem analyzeItem;
52186144 private MenuItem dumpItem;
52196145 //boolean freezemodel = false;
6146
+
6147
+ Menu cameraMenu;
6148
+ MenuItem editCameraItem;
6149
+ MenuItem restoreCameraItem;
52206150 }