Normand Briere
2019-07-29 c6c3f0948bd31603547ef8ce47a7784a9a4d55c2
GroupEditor.java
....@@ -23,6 +23,240 @@
2323 DragGestureListener, DragSourceListener, DropTargetListener,
2424 ItemListener // ListSelectionListener
2525 {
26
+
27
+ public void AddSkyboxButton(String f, String s, cGridBag row)
28
+ {
29
+ cButton skyboxButton;
30
+ final String path = "cubemaps/" + f + "-skyboxes/" + s;
31
+ row.add(skyboxButton = GetButton(path + "/preview.jpg", !Grafreed.NIMBUSLAF));
32
+ //row.add(skyboxButton = GetButton(path + "/negx.jpg", !Grafreed.NIMBUSLAF));
33
+ skyboxButton.setToolTipText(s);
34
+ skyboxButton.addActionListener(new ActionListener()
35
+ {
36
+ @Override
37
+ public void actionPerformed(ActionEvent e)
38
+ {
39
+ ChangeSkybox(path);
40
+ }
41
+ });
42
+ }
43
+
44
+ public void AddSkyboxTab0(JTabbedPane skyboxpanel)
45
+ {
46
+ cGridBag tab0 = new cGridBag().setVertical(true);
47
+
48
+ tab0.setName("Urban");
49
+ skyboxpanel.add(tab0);
50
+
51
+ cGridBag row0 = new cGridBag();
52
+ cGridBag row1 = new cGridBag();
53
+ cGridBag row2 = new cGridBag();
54
+ cGridBag row3 = new cGridBag();
55
+ cGridBag row4 = new cGridBag();
56
+ cGridBag row5 = new cGridBag();
57
+ cGridBag row6 = new cGridBag();
58
+
59
+ AddSkyboxButton("default", "rgb", row0);
60
+ //AddSkyboxButton("default", "cornell", row0);
61
+ AddSkyboxButton("penguins", "dust", row0);
62
+ AddSkyboxButton("penguins", "tropic", row0);
63
+ AddSkyboxButton("default", "skycube", row0);
64
+
65
+ AddSkyboxButton("default", "uffizi", row1);
66
+ AddSkyboxButton("bridge", "Bridge", row1);
67
+ AddSkyboxButton("bridge", "Bridge2", row1);
68
+ AddSkyboxButton("urban", "GamlaStan2", row1);
69
+
70
+ AddSkyboxButton("urban", "Parliament", row2);
71
+ AddSkyboxButton("urban", "Roundabout", row2);
72
+ AddSkyboxButton("urban", "SaintLazarusChurch", row2);
73
+ AddSkyboxButton("urban", "SaintLazarusChurch2", row2);
74
+
75
+ AddSkyboxButton("urban", "SaintLazarusChurch3", row3);
76
+ AddSkyboxButton("urban", "UnionSquare", row3);
77
+ AddSkyboxButton("urban", "Medborgarplatsen", row3);
78
+ AddSkyboxButton("park", "BerzeliiPark", row3);
79
+
80
+ AddSkyboxButton("park", "Buddha", row4);
81
+ AddSkyboxButton("park", "CNTower2", row4);
82
+ AddSkyboxButton("park", "NiagaraFalls1", row4);
83
+ AddSkyboxButton("park", "NiagaraFalls3", row4);
84
+
85
+ AddSkyboxButton("park", "Park", row5);
86
+ AddSkyboxButton("park", "Pond", row5);
87
+ AddSkyboxButton("park", "Skansen", row5);
88
+ AddSkyboxButton("park", "Skansen2", row5);
89
+
90
+ AddSkyboxButton("park", "Skansen3", row6);
91
+ AddSkyboxButton("park", "Skansen4", row6);
92
+ AddSkyboxButton("park", "Skansen5", row6);
93
+ AddSkyboxButton("park", "Stairs", row6);
94
+
95
+ tab0.add(row0);
96
+ tab0.add(row1);
97
+ tab0.add(row2);
98
+ tab0.add(row3);
99
+ tab0.add(row4);
100
+ tab0.add(row5);
101
+ tab0.add(row6);
102
+
103
+ for (int i=5; --i>=0;)
104
+ {
105
+ //oe.toolboxPanel.Return();
106
+ //tab0.add(new cGridBag());
107
+ }
108
+ }
109
+
110
+ public void AddSkyboxTab1(JTabbedPane skyboxpanel)
111
+ {
112
+ cGridBag tab0 = new cGridBag().setVertical(true);
113
+
114
+ tab0.setName("Nature");
115
+ skyboxpanel.add(tab0);
116
+
117
+ cGridBag row0 = new cGridBag();
118
+ cGridBag row1 = new cGridBag();
119
+ cGridBag row2 = new cGridBag();
120
+ cGridBag row3 = new cGridBag();
121
+ cGridBag row4 = new cGridBag();
122
+ cGridBag row5 = new cGridBag();
123
+ cGridBag row6 = new cGridBag();
124
+
125
+ AddSkyboxButton("beach", "HeartInTheSand", row0);
126
+ AddSkyboxButton("beach", "LarnacaBeach", row0);
127
+ AddSkyboxButton("beach", "PalmTrees", row0);
128
+ AddSkyboxButton("beach", "Tenerife", row0);
129
+
130
+ AddSkyboxButton("beach", "Tenerife2", row1);
131
+ AddSkyboxButton("beach", "Tenerife3", row1);
132
+ AddSkyboxButton("field", "FishPond", row1);
133
+ AddSkyboxButton("field", "Footballfield", row1);
134
+
135
+ AddSkyboxButton("field", "Meadow", row2);
136
+ AddSkyboxButton("field", "Sorsele", row2);
137
+ AddSkyboxButton("field", "Sorsele2", row2);
138
+ AddSkyboxButton("field", "Sorsele3", row2);
139
+
140
+ AddSkyboxButton("forest", "Brudslojan", row3);
141
+ AddSkyboxButton("forest", "Langholmen2", row3);
142
+ AddSkyboxButton("forest", "Plants", row3);
143
+ AddSkyboxButton("mountain", "Maskonaive", row3);
144
+
145
+ AddSkyboxButton("mountain", "Maskonaive2", row4);
146
+ AddSkyboxButton("mountain", "Maskonaive3", row4);
147
+ AddSkyboxButton("mountain", "Ryfjallet", row4);
148
+ AddSkyboxButton("mountain", "Teide", row4);
149
+ AddSkyboxButton("park", "Tantolunden4", row4);
150
+
151
+ AddSkyboxButton("penguins", "wrath", row5);
152
+ AddSkyboxButton("penguins", "yonder", row5);
153
+ AddSkyboxButton("rocky", "Langholmen", row5);
154
+ AddSkyboxButton("rocky", "Skinnarviksberget", row5);
155
+ AddSkyboxButton("rocky", "Tantolunden6", row5);
156
+
157
+ AddSkyboxButton("default", "CloudyHills", row6);
158
+ AddSkyboxButton("daz", "Autumn", row6);
159
+ AddSkyboxButton("daz", "Greenlands", row6);
160
+ AddSkyboxButton("daz", "MountainTrail", row6);
161
+ AddSkyboxButton("daz", "Oasis", row6);
162
+ /*
163
+Autumn
164
+Greenlands
165
+MountainTrail
166
+Oasis
167
+TheRock
168
+TopOfTheWorld
169
+Winter
170
+ */
171
+
172
+ tab0.add(row0);
173
+ tab0.add(row1);
174
+ tab0.add(row2);
175
+ tab0.add(row3);
176
+ tab0.add(row4);
177
+ tab0.add(row5);
178
+ tab0.add(row6);
179
+
180
+ for (int i=5; --i>=0;)
181
+ {
182
+ //oe.toolboxPanel.Return();
183
+ //tab0.add(new cGridBag());
184
+ }
185
+ }
186
+
187
+ public void AddSkyboxTab2(JTabbedPane skyboxpanel)
188
+ {
189
+ cGridBag tab0 = new cGridBag().setVertical(true);
190
+
191
+ tab0.setName("Night");
192
+ skyboxpanel.add(tab0);
193
+
194
+ cGridBag row0 = new cGridBag();
195
+ cGridBag row1 = new cGridBag();
196
+ cGridBag row2 = new cGridBag();
197
+ cGridBag row3 = new cGridBag();
198
+ cGridBag row4 = new cGridBag();
199
+ cGridBag row5 = new cGridBag();
200
+ cGridBag row6 = new cGridBag();
201
+
202
+ AddSkyboxButton("night", "NightPath", row0);
203
+ AddSkyboxButton("night", "PondNight", row0);
204
+ AddSkyboxButton("night", "Powerlines", row0);
205
+ AddSkyboxButton("night", "SwedishRoyalCastle", row0);
206
+
207
+ AddSkyboxButton("urban", "CNTower", row1);
208
+ AddSkyboxButton("bridge", "ArstaBridge", row1);
209
+ AddSkyboxButton("rocky", "Riddarfjarden", row1);
210
+ AddSkyboxButton("penguins", "sleepyhollow", row1);
211
+
212
+ AddSkyboxButton("penguins", "kenon_star", row2);
213
+ AddSkyboxButton("indoors", "DallasW", row2);
214
+ AddSkyboxButton("indoors", "MarriottMadisonWest", row2);
215
+ AddSkyboxButton("indoors", "Vasa", row2);
216
+
217
+ AddSkyboxButton("winter", "Backyard", row3);
218
+ AddSkyboxButton("winter", "Creek", row3);
219
+ AddSkyboxButton("winter", "FootballField3", row3);
220
+ AddSkyboxButton("winter", "Forest", row3);
221
+
222
+ AddSkyboxButton("winter", "HornstullsStrand2", row4);
223
+ AddSkyboxButton("winter", "House", row4);
224
+ AddSkyboxButton("winter", "IceLake", row4);
225
+ AddSkyboxButton("winter", "IceRiver", row4);
226
+
227
+ AddSkyboxButton("winter", "Park3", row5);
228
+ AddSkyboxButton("winter", "PondWinter", row5);
229
+ AddSkyboxButton("winter", "Tantolunden5", row5);
230
+ AddSkyboxButton("winter", "Vindelalven", row5);
231
+
232
+ AddSkyboxButton("daz", "TheRock", row6);
233
+ AddSkyboxButton("daz", "TopOfTheWorld", row6);
234
+ AddSkyboxButton("daz", "Winter", row6);
235
+ AddSkyboxButton("penguins", "desertdawn", row6);
236
+
237
+ tab0.add(row0);
238
+ tab0.add(row1);
239
+ tab0.add(row2);
240
+ tab0.add(row3);
241
+ tab0.add(row4);
242
+ tab0.add(row5);
243
+ tab0.add(row6);
244
+
245
+ for (int i=5; --i>=0;)
246
+ {
247
+ //oe.toolboxPanel.Return();
248
+ //tab0.add(new cGridBag());
249
+ }
250
+ }
251
+
252
+ public void ChangeSkybox(String name)
253
+ {
254
+ cameraView.envyoff = false;
255
+ cameraView.skyboxname = name;
256
+ cameraView.skyboxext = "jpg";
257
+ cameraView.repaint();
258
+ }
259
+
26260 //ObjEditor objEditor;
27261 public void closeUI2()
28262 {
....@@ -60,6 +294,12 @@
60294 this.copy = this.group = group;
61295 //selectees = this.group.selectees;
62296
297
+ if (copy.versions == null)
298
+ {
299
+ copy.versions = new byte[100][];
300
+ copy.versionindex = -1;
301
+ }
302
+
63303 if(ui)
64304 SetupUI(objEditor);
65305 }
....@@ -74,16 +314,28 @@
74314 this.copy = this.group = copy;
75315 //selectees = this.group.selectees;
76316
77
- SetupMenu2(objEditor);
317
+ SetupMenu2(this); //objEditor);
78318 SetupUI2(objEditor);
79319 objEditor.SetupUI(true);
80320 SetupViews(objEditor);
81321
82322 ((cRadio)radioPanel.getComponent(0)).SetCamera(cameraView.renderCamera, true);
323
+
324
+ if (copy.versions == null)
325
+ {
326
+ copy.versions = new byte[100][];
327
+ copy.versionindex = -1;
328
+
329
+ Save(true);
330
+ }
83331 }
84332
85333 void CloneSelection(boolean supports)
86334 {
335
+ if (Globals.REPLACEONMAKE)
336
+ Save();
337
+ boolean keep = Globals.REPLACEONMAKE;
338
+ Globals.REPLACEONMAKE = false;
87339 // Object3D keep = GrafreeD.clipboard;
88340 //Object3D obj;
89341 for (int i=0; i<group.selection.size(); i++)// Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -94,18 +346,19 @@
94346
95347 makeSomething(clone, i==group.selection.size()-1);
96348 }
349
+ Globals.REPLACEONMAKE = keep;
97350 }
98351
99352 void CloneClipboard(boolean supports)
100353 {
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));
354
+ assert(Grafreed.clipboard.parent == null);
355
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
356
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
357
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
358
+ makeSomething(CloneObject(Grafreed.clipboard.get(0), false));
106359 else
107
- makeSomething(CloneObject(GrafreeD.clipboard, false));
108
- GrafreeD.clipboard.get(0).parent = keepparent;
360
+ makeSomething(CloneObject(Grafreed.clipboard, false));
361
+ Grafreed.clipboard.get(0).parent = keepparent;
109362 }
110363
111364 static Object3D CloneObject(Object3D obj, boolean supports)
....@@ -119,7 +372,7 @@
119372 // obj.support = null;
120373 if (!supports)
121374 obj.SaveSupports();
122
- Object3D clone = (Object3D)GrafreeD.clone(obj);
375
+ Object3D clone = (Object3D)Grafreed.clone(obj);
123376 obj.parent = parent;
124377 // obj.support = support;
125378 // clone.support = support; // aout 2013
....@@ -148,28 +401,21 @@
148401
149402 //JTextField nameField;
150403
151
- void SetupMenu2(ObjEditor oe)
404
+ void SetupMenu2(GroupEditor oe)
152405 {
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
-
406
+ oe.jTree = new cTree();
407
+
168408 Menu menu;
169409 oe.menuBar.add(menu = new Menu("Edit"));
170410 //editItem = menu.add(new MenuItem("Edit"));
171411 //editItem.addActionListener(this);
172
- duplicateItem = menu.add(new MenuItem("Duplicate"));
412
+
413
+// undoItem = menu.add(new MenuItem("Undo"));
414
+// undoItem.addActionListener(this);
415
+// redoItem = menu.add(new MenuItem("Redo"));
416
+// redoItem.addActionListener(this);
417
+// menu.add("-");
418
+ duplicateItem = oe.jTree.popup.add(new JMenuItem("Duplicate"));
173419 duplicateItem.addActionListener(this);
174420 cloneItem = menu.add(new MenuItem("Clone"));
175421 cloneItem.addActionListener(this);
....@@ -185,7 +431,6 @@
185431 copyItem.addActionListener(this);
186432 pasteItem = menu.add(new MenuItem("Paste"));
187433 pasteItem.addActionListener(this);
188
- menu.add("-");
189434
190435 menu.add("-");
191436 pasteIntoItem = menu.add(new MenuItem("Paste into"));
....@@ -197,8 +442,8 @@
197442 // pasteExpandItem = menu.add(new MenuItem("Paste expand"));
198443 // pasteExpandItem.addActionListener(this);
199444 menu.add("-");
200
- clearItem = menu.add(new MenuItem("Clear"));
201
- clearItem.addActionListener(this);
445
+ deleteItem = menu.add(new MenuItem("Delete"));
446
+ deleteItem.addActionListener(this);
202447
203448 if (Globals.ADVANCED)
204449 {
....@@ -206,14 +451,97 @@
206451 clearAllItem = menu.add(new MenuItem("Clear All"));
207452 clearAllItem.addActionListener(this);
208453 }
454
+
455
+ menuBar.add(cameraMenu = new Menu("View"));
456
+ //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer"));
457
+ //zBufferItem.addActionListener(this);
458
+ //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens"));
459
+ //normalLensItem.addActionListener(this);
460
+ cameraMenu.add(restoreCameraItem = new MenuItem("Restore Viewpoint"));
461
+ restoreCameraItem.addActionListener(this);
462
+
463
+// cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen"));
464
+// toggleFullScreenItem.addItemListener(this);
465
+// toggleFullScreenItem.setState(CameraPane.FULLSCREEN);
466
+// cameraMenu.add("-");
467
+//
468
+// cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture"));
469
+// toggleTextureItem.addItemListener(this);
470
+// toggleTextureItem.setState(CameraPane.textureon);
471
+//
472
+// cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch"));
473
+// toggleSwitchItem.addItemListener(this);
474
+// toggleSwitchItem.setState(CameraPane.SWITCH);
475
+
476
+ cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Show Handles"));
477
+ toggleHandleItem.addItemListener(this);
478
+ toggleHandleItem.setState(CameraPane.HANDLES);
479
+
480
+ cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode"));
481
+ togglePaintItem.addItemListener(this);
482
+ togglePaintItem.setState(CameraPane.PAINTMODE);
483
+
484
+ if (Globals.ADVANCED)
485
+ {
486
+ cameraMenu.add("-");
487
+ cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live"));
488
+ toggleLiveItem.addItemListener(this);
489
+ toggleLiveItem.setState(Globals.isLIVE());
209490
491
+ cameraMenu.add(stepItem = new MenuItem("Step"));
492
+ stepItem.addActionListener(this);
493
+ // cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List"));
494
+ // toggleDLItem.addItemListener(this);
495
+ // toggleDLItem.setState(false);
496
+
497
+ cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render"));
498
+ toggleRenderItem.addItemListener(this);
499
+ toggleRenderItem.setState(!CameraPane.frozen);
500
+
501
+ cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug"));
502
+ toggleDebugItem.addItemListener(this);
503
+ toggleDebugItem.setState(Globals.DEBUG);
504
+
505
+ cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum"));
506
+ toggleFrustumItem.addItemListener(this);
507
+ toggleFrustumItem.setState(CameraPane.FRUSTUM);
508
+
509
+ cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact"));
510
+ toggleFootContactItem.addItemListener(this);
511
+ toggleFootContactItem.setState(CameraPane.FOOTCONTACT);
512
+
513
+ cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline"));
514
+ toggleTimelineItem.addItemListener(this);
515
+ }
516
+
517
+// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root"));
518
+// toggleRootItem.addItemListener(this);
519
+// toggleRootItem.setState(false);
520
+// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation"));
521
+// animationItem.addItemListener(this);
522
+// animationItem.setState(CameraPane.ANIMATION);
523
+ cameraMenu.add("-");
524
+ cameraMenu.add(editCameraItem = new MenuItem("Save Viewpoint"));
525
+ editCameraItem.addActionListener(this);
526
+
527
+ if (Globals.ADVANCED)
528
+ {
529
+ oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
530
+ //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
531
+ //cameraMenu.add(switchViewItem = new MenuItem("Reverse View"));
532
+ editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf"));
533
+ oe.cameraMenu.add("-");
534
+ openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy..."));
535
+ openWindowItem.addActionListener(this);
536
+ editLeafItem.addActionListener(this);
537
+ lookAtItem.addActionListener(this);
538
+ //lookFromItem.addActinoListener(this);
539
+ //switchViewItem.addActionListener(this);
540
+ }
541
+
210542 oe.menuBar.add(menu = new Menu("Setting"));
211543 if (Globals.ADVANCED)
212544 {
213
- resetMeshItem = menu.add(new MenuItem("Reset All"));
214
- resetMeshItem.addActionListener(this);
215
- stepAllItem = menu.add(new MenuItem("Step All"));
216
- stepAllItem.addActionListener(this);
217545 revertMeshItem = menu.add(new MenuItem("Revert Meshes"));
218546 revertMeshItem.addActionListener(this);
219547 resetreferencesItem = menu.add(new MenuItem("Reset Mesh References"));
....@@ -253,21 +581,29 @@
253581 }
254582
255583 oe.menuBar.add(menu = new Menu("Group"));
256
- grabItem = menu.add(new MenuItem("Grab"));
257
- grabItem.addActionListener(this);
584
+// grabItem = menu.add(new MenuItem("Grab"));
585
+// grabItem.addActionListener(this);
258586 backItem = menu.add(new MenuItem("Back"));
259587 backItem.addActionListener(this);
260588 frontItem = menu.add(new MenuItem("Front"));
261589 frontItem.addActionListener(this);
262
- compositeItem = menu.add(new MenuItem("Composite"));
263
- compositeItem.addActionListener(this);
590
+// compositeItem = menu.add(new MenuItem("Composite"));
591
+// compositeItem.addActionListener(this);
592
+
593
+ if (Globals.ADVANCED)
594
+ {
264595 hideItem = menu.add(new MenuItem("Hidden Group"));
265596 hideItem.addActionListener(this);
597
+ }
266598 ungroupItem = menu.add(new MenuItem("Ungroup"));
267599 ungroupItem.addActionListener(this);
268
- menu.add("-");
269
- randomItem = menu.add(new MenuItem("Switch node"));
270
- randomItem.addActionListener(this);
600
+
601
+// menu.add("-");
602
+//
603
+// switchItem = menu.add(new MenuItem("Switch node"));
604
+// switchItem.addActionListener(this);
605
+ if (Globals.ADVANCED)
606
+ {
271607 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
272608 switchGeoItem.addActionListener(this);
273609 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
....@@ -275,8 +611,6 @@
275611 morphItem = menu.add(new MenuItem("Morph Group"));
276612 morphItem.addActionListener(this);
277613
278
- if (Globals.ADVANCED)
279
- {
280614 menu.add("-");
281615 physicsItem = menu.add(new MenuItem("Physics"));
282616 physicsItem.addActionListener(this);
....@@ -284,30 +618,29 @@
284618 frameselectorItem.addActionListener(this);
285619 scriptNodeItem = menu.add(new MenuItem("Script Node"));
286620 scriptNodeItem.addActionListener(this);
287
- cameraItem = menu.add(new MenuItem("Camera"));
288
- cameraItem.addActionListener(this);
289621 }
290622
291623 oe.menuBar.add(menu = new Menu("Object"));
292
- textureItem = menu.add(new MenuItem("Texture"));
293
- textureItem.addActionListener(this);
624
+// textureItem = menu.add(new MenuItem("Texture"));
625
+// textureItem.addActionListener(this);
294626 billboardItem = menu.add(new MenuItem("Billboard"));
295627 billboardItem.addActionListener(this);
296628 csgItem = menu.add(new MenuItem("CSG"));
297629 csgItem.addActionListener(this);
298
- shadowXItem = menu.add(new MenuItem("Shadow X"));
630
+ shadowXItem = menu.add(new MenuItem("Shadow Red"));
299631 shadowXItem.addActionListener(this);
300
- shadowYItem = menu.add(new MenuItem("Shadow Y"));
632
+ shadowYItem = menu.add(new MenuItem("Shadow Green"));
301633 shadowYItem.addActionListener(this);
302
- shadowZItem = menu.add(new MenuItem("Shadow Z"));
634
+ shadowZItem = menu.add(new MenuItem("Shadow Blue"));
303635 shadowZItem.addActionListener(this);
636
+ attributeItem = menu.add(new MenuItem("Attribute"));
637
+ attributeItem.addActionListener(this);
638
+
304639 if (Globals.ADVANCED)
305640 {
306641 menu.add("-");
307642 linkerItem = menu.add(new MenuItem("Linker"));
308643 linkerItem.addActionListener(this);
309
- attributeItem = menu.add(new MenuItem("Attribute"));
310
- attributeItem.addActionListener(this);
311644 templateItem = menu.add(new MenuItem("Template"));
312645 templateItem.addActionListener(this);
313646 pointflowItem = menu.add(new MenuItem("Point Flow"));
....@@ -318,8 +651,12 @@
318651 resetTransformItem.addActionListener(this);
319652 resetCentroidItem = menu.add(new MenuItem("Reset Centroid"));
320653 resetCentroidItem.addActionListener(this);
321
- transformgeometryItem = menu.add(new MenuItem("Transform Geometry"));
322
- transformgeometryItem.addActionListener(this);
654
+ resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY"));
655
+ resetCentroidXZItem.addActionListener(this);
656
+ transformGeometryItem = menu.add(new MenuItem("Transform Geometry"));
657
+ transformGeometryItem.addActionListener(this);
658
+ transformChildrenItem = menu.add(new MenuItem("Transform Children"));
659
+ transformChildrenItem.addActionListener(this);
323660
324661 oe.menuBar.add(menu = new Menu("Geometry"));
325662 genUVItem = menu.add(new MenuItem("Generate UV"));
....@@ -332,7 +669,7 @@
332669 genNormalsMESHItem.addActionListener(this);
333670 if (Globals.ADVANCED)
334671 {
335
- genNormalsMINEItem = menu.add(new MenuItem("My Normals"));
672
+ genNormalsMINEItem = menu.add(new MenuItem("Stitch Normals"));
336673 genNormalsMINEItem.addActionListener(this);
337674 }
338675 stripifyItem = menu.add(new MenuItem("Stripify"));
....@@ -368,6 +705,10 @@
368705 oe.menuBar.add(menu = new Menu("Attributes"));
369706 clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
370707 clearMaterialsItem.addActionListener(this);
708
+ resetAllItem = menu.add(new MenuItem("Reset All"));
709
+ resetAllItem.addActionListener(this);
710
+ stepAllItem = menu.add(new MenuItem("Step All"));
711
+ stepAllItem.addActionListener(this);
371712 menu.add("-");
372713 liveleavesItem = menu.add(new MenuItem("Live Leaves"));
373714 liveleavesItem.addActionListener(this);
....@@ -388,6 +729,14 @@
388729 markleavesItem.addActionListener(this);
389730 unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves"));
390731 unmarkleavesItem.addActionListener(this);
732
+ rewindleavesItem = menu.add(new MenuItem("Rewind Leaves"));
733
+ rewindleavesItem.addActionListener(this);
734
+ unrewindleavesItem = menu.add(new MenuItem("Unrewind Leaves"));
735
+ unrewindleavesItem.addActionListener(this);
736
+ randomleavesItem = menu.add(new MenuItem("Random Leaves"));
737
+ randomleavesItem.addActionListener(this);
738
+ unrandomleavesItem = menu.add(new MenuItem("Unrandom Leaves"));
739
+ unrandomleavesItem.addActionListener(this);
391740 menu.add("-");
392741 flipVItem = menu.add(new MenuItem("Flip V"));
393742 flipVItem.addActionListener(this);
....@@ -413,47 +762,56 @@
413762 attachBumpItem.addActionListener(this);
414763 pigmentBumpItem = menu.add(new MenuItem("Pigment -> Bump"));
415764 pigmentBumpItem.addActionListener(this);
765
+ //embedTexturesItem
416766 detachPigmentItem = menu.add(new MenuItem("Detach Pigment"));
417767 detachPigmentItem.addActionListener(this);
418768 detachBumpItem = menu.add(new MenuItem("Detach Bump"));
419769 detachBumpItem.addActionListener(this);
770
+ embedTexturesItem = menu.add(new MenuItem("Embed Textures"));
771
+ embedTexturesItem.addActionListener(this);
772
+ deEmbedTexturesItem = menu.add(new MenuItem("De-embed Textures"));
773
+ deEmbedTexturesItem.addActionListener(this);
420774 menu.add("-");
421775 sortbysizeItem = menu.add(new MenuItem("Sort by size"));
422776 sortbysizeItem.addActionListener(this);
423777 sortbynameItem = menu.add(new MenuItem("Sort by name"));
424778 sortbynameItem.addActionListener(this);
779
+ menu.add("-");
780
+ shareGeometriesItem = menu.add(new MenuItem("Share Geometries"));
781
+ shareGeometriesItem.addActionListener(this);
782
+ mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries"));
783
+ mergeGeometriesItem.addActionListener(this);
425784 if (Globals.ADVANCED)
426785 {
427
- menu.add("-");
786
+ // Pretty much the same as duplicate and clone.
428787 extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
429788 extractGeometriesItem.addActionListener(this);
430789 cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry"));
431790 cloneGeometriesItem.addActionListener(this);
432
- shareGeometriesItem = menu.add(new MenuItem("Share Geometry"));
433
- shareGeometriesItem.addActionListener(this);
434
- mergeGeometriesItem = menu.add(new MenuItem("Merge Geometry"));
435
- mergeGeometriesItem.addActionListener(this);
436791 }
437792
438793 oe.menuBar.add(menu = new Menu("Insert"));
439794 buildCreateMenu(menu);
440795
441
- oe.menuBar.add(menu = new Menu("Include"));
442
- importGFDItem = menu.add(new MenuItem("GrafreeD Object..."));
443
- importGFDItem.addActionListener(this);
444
- importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D Object..."));
445
- importVRMLX3DItem.addActionListener(this);
446
- importOBJItem = menu.add(new MenuItem("OBJ Object..."));
447
- importOBJItem.addActionListener(this);
448
- import3DSItem = menu.add(new MenuItem("3DS Object..."));
449
- import3DSItem.addActionListener(this);
450
-
451796 oe.menuBar.add(menu = new Menu("Tools"));
452797 buildToolsMenu(menu);
453798 }
454799
800
+
455801 void SetupUI2(ObjEditor oe)
456802 {
803
+ // June 2019
804
+ if (oe == null)
805
+ {
806
+ //super.SetupUI2(this);
807
+ //return;
808
+ }
809
+
810
+ if (copy != group)
811
+ {
812
+ //super.SetupUI2(this);
813
+ }
814
+
457815 //new Exception().printStackTrace();
458816
459817 oe.radioPanel = new JPanel(new GridBagLayout());
....@@ -482,97 +840,237 @@
482840 oe.radioPanel.add(dummyButton);
483841 oe.buttonGroup.add(dummyButton);
484842 */
843
+ cGridBag copyOptionsPanel = new cGridBag();
844
+
845
+ copyOptionsPanel.preferredHeight = 2;
846
+
485847 //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
486848
487
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints);
488
- liveCB.setToolTipText("Enabled animation");
849
+ //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
850
+ //minButton.setToolTipText("Minimize window");
851
+ //minButton.addActionListener(this);
852
+
853
+ if (Globals.ADVANCED)
854
+ {
855
+ oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
856
+ maxButton.setToolTipText("Maximize window");
857
+ maxButton.addActionListener(this);
858
+ }
859
+
860
+ oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
861
+ fullButton.setToolTipText("Full-screen window");
862
+ fullButton.addActionListener(this);
863
+
864
+ oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
865
+ screenfitButton.setToolTipText("Screen fit");
866
+ screenfitButton.addActionListener(this);
867
+
868
+ oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
869
+ restoreCameraButton.setToolTipText("Restore viewpoint");
870
+ restoreCameraButton.addActionListener(this);
871
+
872
+ copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
873
+ saveButton.setToolTipText("New version");
874
+ saveButton.addActionListener(this);
875
+
876
+ copyOptionsPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
877
+ undoButton.setToolTipText("Previous version");
878
+ undoButton.addActionListener(this);
879
+ undoButton.setEnabled(false);
880
+
881
+ cGridBag updown = new cGridBag().setVertical(true);
882
+ updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
883
+ restoreButton.setToolTipText("Restore current");
884
+ restoreButton.addActionListener(this);
885
+ restoreButton.setEnabled(false);
886
+
887
+ updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
888
+ replaceButton.setToolTipText("Replace current");
889
+ replaceButton.addActionListener(this);
890
+ replaceButton.setEnabled(false);
891
+
892
+ copyOptionsPanel.add(updown);
893
+
894
+ copyOptionsPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
895
+ redoButton.setToolTipText("Next version");
896
+ redoButton.addActionListener(this);
897
+ redoButton.setEnabled(false);
898
+
899
+ oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints);
900
+ liveCB.setToolTipText("Enable animation");
489901 liveCB.addItemListener(this);
490902
491
- oe.toolbarPanel.add(oneStepButton = new cButton("Step", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
903
+ oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
492904 oneStepButton.setToolTipText("Animate one step forward");
493905 oneStepButton.addActionListener(this);
494906
495
- oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints);
907
+ oe.toolbarPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints);
496908 fastCB.setToolTipText("Fast mode");
497909 fastCB.addItemListener(this);
498910
499
- oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
500
- trackCB.setToolTipText("Enable tracking");
501
- trackCB.addItemListener(this);
502
-
503
- oe.toolbarPanel.add(screenfitButton = new cButton("@", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
504
- screenfitButton.setToolTipText("Screen fit");
505
- screenfitButton.addActionListener(this);
911
+ //oe.toolboxPanel.Return();
912
+
913
+// copyOptionsPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints);
914
+// trackCB.setToolTipText("Enable tracking");
915
+// trackCB.addItemListener(this);
506916
507917 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
508918 // screenfitpointButton.addActionListener(this);
509919
510920 if (Globals.ADVANCED)
511921 {
512
- oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
922
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
513923 snapobjectButton.addActionListener(this);
514924 snapobjectButton.setToolTipText("Snap Object");
925
+
926
+ oe.toolbarPanel.add(fourButton = GetButton("icons/controls-horizontal.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
927
+ fourButton.addActionListener(this);
928
+ fourButton.setToolTipText("Show control panel only");
515929 }
516930
517
- oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
518
- flashSelectionButton.setToolTipText("Show selection");
519
- flashSelectionButton.addActionListener(this);
931
+ //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
520932
521
- oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
522
-
523
- oe.toolbarPanel.add(twoButton = new cButton("|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
524
- twoButton.setToolTipText("Show center view only");
933
+ oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
934
+ twoButton.setToolTipText("Show 3D view only");
525935 twoButton.addActionListener(this);
526
- oe.toolbarPanel.add(fourButton = new cButton("+||", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
527
- fourButton.addActionListener(this);
528
- fourButton.setToolTipText("Show left panel only");
529
- oe.toolbarPanel.add(sixButton = new cButton("+|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
530
- sixButton.setToolTipText("2-column layout left");
531
- sixButton.addActionListener(this);
532
- oe.toolbarPanel.add(threeButton = new cButton("|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
533
- threeButton.setToolTipText("2-column layout right");
936
+ this.fullscreenLayout = twoButton;
937
+
938
+ oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
939
+ threeButton.setToolTipText("Show controls and 3D view");
534940 threeButton.addActionListener(this);
535
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
536
- sevenButton.setToolTipText("3-column layout");
537
- sevenButton.addActionListener(this);
941
+ oe.toolbarPanel.add(sixButton = GetButton("icons/viewcontrols.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
942
+ sixButton.setToolTipText("Show 3D view and controls");
943
+ sixButton.addActionListener(this);
944
+// oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
945
+// sevenButton.setToolTipText("3-column layout");
946
+// sevenButton.addActionListener(this);
538947 //
539948
540
- oe.toolbarPanel.add(rootButton = new cButton("o o o", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
541
- rootButton.setToolTipText("Edit selection in new tab");
949
+ oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
950
+ rootButton.setToolTipText("Open selection in new tab");
542951 rootButton.addActionListener(this);
543952
544
- oe.toolbarPanel.add(closeButton = new cButton("X", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
953
+ oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
545954 closeButton.setToolTipText("Close tab");
546955 closeButton.addActionListener(this);
547956 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
548957 //clearButton.addActionListener(this);
549
-
550
- cGridBag commandsPanel = new cGridBag();
958
+
959
+ cGridBag row1 = new cGridBag();
551960
552
- commandsPanel.add(editButton = new cButton("+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
553
- editButton.setToolTipText("Edit selection");
961
+ // INSERT
962
+ row1.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
963
+ gridButton.setToolTipText("Create grid");
964
+ gridButton.addActionListener(this);
965
+
966
+ row1.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
967
+ boxButton.setToolTipText("Create box");
968
+ boxButton.addActionListener(this);
969
+
970
+ row1.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
971
+ sphereButton.setToolTipText("Create sphere");
972
+ sphereButton.addActionListener(this);
973
+
974
+ row1.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
975
+ coneButton.setToolTipText("Create cone");
976
+ coneButton.addActionListener(this);
977
+
978
+ row1.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
979
+ torusButton.setToolTipText("Create torus");
980
+ torusButton.addActionListener(this);
981
+
982
+ row1.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
983
+ superButton.setToolTipText("Create superellipsoid");
984
+ superButton.addActionListener(this);
985
+
986
+ if (Globals.ADVANCED)
987
+ {
988
+ oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
989
+ kleinButton.setToolTipText("Create Klein bottle");
990
+ kleinButton.addActionListener(this);
991
+ }
992
+
993
+ row1.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
994
+ particlesButton.setToolTipText("Create particle system");
995
+ particlesButton.addActionListener(this);
996
+
997
+ oe.toolboxPanel.add(row1);
998
+
999
+ cGridBag row2 = new cGridBag();
1000
+
1001
+ row2.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1002
+ groupButton.setToolTipText("Create group");
1003
+ groupButton.addActionListener(this);
1004
+
1005
+ row2.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1006
+ compositeButton.setToolTipText("Create composite");
1007
+ compositeButton.addActionListener(this);
1008
+
1009
+ row2.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1010
+ switchButton.setToolTipText("Create item switcher");
1011
+ switchButton.addActionListener(this);
1012
+
1013
+ row2.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1014
+ loopButton.setToolTipText("Create loop");
1015
+ loopButton.addActionListener(this);
1016
+
1017
+ row2.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1018
+ textureButton.setToolTipText("Create texture");
1019
+ textureButton.addActionListener(this);
1020
+
1021
+ row2.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1022
+ overlayButton.setToolTipText("Create overlay");
1023
+ overlayButton.addActionListener(this);
1024
+
1025
+ row2.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1026
+ lightButton.setToolTipText("Create light");
1027
+ lightButton.addActionListener(this);
1028
+
1029
+ oe.toolboxPanel.add(row2);
1030
+
1031
+ // ENVYMAPS
1032
+ cGridBag skyboxpane = new cGridBag();
1033
+ skyboxpane.preferredHeight = 100;
1034
+
1035
+ oe.toolboxPanel.add(skyboxpane);
1036
+
1037
+ JTabbedPane skyboxpanel = new JTabbedPane();
1038
+ skyboxpane.add(skyboxpanel);
1039
+
1040
+ AddSkyboxTab0(skyboxpanel);
1041
+ AddSkyboxTab1(skyboxpanel);
1042
+ AddSkyboxTab2(skyboxpanel);
1043
+
1044
+ // EDIT panel
1045
+ editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1046
+ editButton.setToolTipText("Pin selection controls");
5541047 editButton.addActionListener(this);
5551048
556
- commandsPanel.add(uneditButton = new cButton("-", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
557
- uneditButton.setToolTipText("Unedit selection");
1049
+ editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1050
+ uneditButton.setToolTipText("Remove selection controls");
5581051 uneditButton.addActionListener(this);
5591052
560
- commandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
561
- allParamsButton.setToolTipText("Edit all params");
1053
+ editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
1054
+ allParamsButton.setToolTipText("Show all controle");
5621055 allParamsButton.addActionListener(this);
5631056
564
- commandsPanel.add(clearPanelButton = new cButton("C", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
1057
+ editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
5651058 clearPanelButton.setToolTipText("Clear edit panel");
5661059 clearPanelButton.addActionListener(this);
5671060
568
- commandsPanel.add(unselectButton = new cButton("U", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
1061
+ editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
5691062 unselectButton.setToolTipText("Unselect");
5701063 unselectButton.addActionListener(this);
5711064
572
- commandsPanel.preferredHeight = 1;
1065
+ editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1066
+ flashSelectionButton.setToolTipText("Highlight selection");
1067
+ flashSelectionButton.addActionListener(this);
5731068
574
- oe.treePanel.add(commandsPanel);
575
- oe.treePanel.Return();
1069
+ editCommandsPanel.preferredHeight = 1;
1070
+
1071
+ SetPinStates(false);
1072
+// oe.treePanel.add(commandsPanel);
1073
+// oe.treePanel.Return();
5761074
5771075 // oe.aConstraints.gridx += 1;
5781076 // oe.aConstraints.weighty = 0;
....@@ -589,32 +1087,20 @@
5891087
5901088 JScrollPane jSP;
5911089 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
592
- jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints);
1090
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints);
5931091 ResetModel();
5941092
5951093 oe.treePanel.add(jSPPanel);
5961094 oe.treePanel.Return();
5971095
598
- cGridBag copyOptionsPanel = new cGridBag();
599
-
600
- copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
601
- colorCB.setToolTipText("Copy color when dropped");
602
- colorCB.addItemListener(this);
603
-
604
- copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
605
- materialCB.setToolTipText("Copy material when dropped");
606
- materialCB.addItemListener(this);
607
-
608
- copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
609
- textureCB.setToolTipText("Copy texture when dropped");
610
- textureCB.addItemListener(this);
611
-
612
- copyOptionsPanel.preferredHeight = 1;
6131096 oe.treePanel.add(copyOptionsPanel);
6141097 oe.treePanel.Return();
1098
+ cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0);
1099
+ versionSlider = (cNumberSlider)sliderPane.getComponent(1);
1100
+ sliderPane.preferredHeight = 1;
6151101
616
-// mainPanel.setDividerLocation(0.5); //1.0);
617
-// mainPanel.setResizeWeight(0.5);
1102
+// mainPanel.setDividerLocation(0.1); //1.0);
1103
+ mainPanel.setResizeWeight(0.4);
6181104
6191105 //jList.addListSelectionListener(this);
6201106 oe.jTree.addTreeSelectionListener(this);
....@@ -622,7 +1108,7 @@
6221108 //jTree.setEditable(true);
6231109 oe.jTree.setDragEnabled(true);
6241110 //jTree.setPreferredSize(new Dimension(10,10));
625
- jSP.setPreferredSize(new Dimension(100,200));
1111
+ //jSP.setPreferredSize(new Dimension(100,200));
6261112
6271113 oe.jTree.setCellRenderer(new cTreeModel.Renderer());
6281114
....@@ -634,29 +1120,49 @@
6341120 dgr.addDragGestureListener(this);
6351121 }catch(Exception e) {}
6361122 */
637
- radio.layout = sevenButton;
1123
+ radio.layout = sixButton; // sevenButton;
6381124 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
6391125 }
6401126
6411127 void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
6421128 {
1129
+ panel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
1130
+ colorCB.setToolTipText("Copy color when dropped");
1131
+ colorCB.addItemListener(this);
1132
+
1133
+ panel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
1134
+ materialCB.setToolTipText("Copy material when dropped");
1135
+ materialCB.addItemListener(this);
1136
+
1137
+ panel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
1138
+ textureCB.setToolTipText("Copy texture when dropped");
1139
+ textureCB.addItemListener(this);
1140
+
1141
+ panel.Return();
1142
+
6431143 panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
6441144 boxCB.setToolTipText("Display bounding boxes");
6451145 boxCB.addItemListener(this);
6461146
6471147 panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
648
- zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
1148
+ zoomBoxCB.setToolTipText("Display only for wheel");
6491149 zoomBoxCB.addItemListener(this);
6501150
651
- if (Globals.ADVANCED)
1151
+ if (true) // Globals.ADVANCED)
6521152 {
653
- panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
654
- supportCB.setToolTipText("Enable rigging");
655
- supportCB.addItemListener(this);
1153
+// panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
1154
+// supportCB.setToolTipText("Enable rigging");
1155
+// supportCB.addItemListener(this);
1156
+
1157
+ panel.add(freezeCB = new cCheckBox("Freeze", Globals.FREEZEONMOVE)); //, constraints);
1158
+ freezeCB.setToolTipText("Fast moving camera");
1159
+ freezeCB.addItemListener(this);
6561160
6571161 // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
6581162 // localCB.addItemListener(this);
6591163
1164
+ panel.Return();
1165
+
6601166 panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
6611167 crowdCB.setToolTipText("Used for crowds");
6621168 crowdCB.addItemListener(this);
....@@ -673,6 +1179,8 @@
6731179 // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
6741180 // speakerMocapCB.addItemListener(this);
6751181
1182
+ panel.Return();
1183
+
6761184 if (false)
6771185 {
6781186 // handled in scripts
....@@ -687,42 +1195,85 @@
6871195 //constraints.gridy += 1;
6881196 panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
6891197 smoothfocusCB.addItemListener(this);
1198
+ panel.Return();
6901199 }
6911200
6921201 //constraints.gridx += 1;
6931202 //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
6941203 // debugCB.addItemListener(this);
6951204
1205
+ panel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
1206
+ trackCB.setToolTipText("Enable tracking target");
1207
+ trackCB.addItemListener(this);
1208
+
6961209 panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
1210
+ oeilCB.setToolTipText("Move camera when tracking");
6971211 oeilCB.addItemListener(this);
6981212
1213
+ panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints);
1214
+ shadowCB.setToolTipText("When live compute shadows");
1215
+ shadowCB.addItemListener(this);
1216
+
1217
+ panel.Return();
1218
+ panel.add(toggleTextureCB = new cCheckBox("Textures", CameraPane.textureon)); //, constraints);
1219
+ toggleTextureCB.setToolTipText("Load textures");
1220
+ toggleTextureCB.addItemListener(this);
1221
+
1222
+ panel.add(toggleSwitchCB = new cCheckBox("Switch", CameraPane.SWITCH)); //, constraints);
1223
+ toggleSwitchCB.setToolTipText("Choose a single item");
1224
+ toggleSwitchCB.addItemListener(this);
1225
+
1226
+ panel.add(autokeepCB = new cCheckBox("Auto-replace", Globals.REPLACEONMAKE)); //, constraints);
1227
+ autokeepCB.setToolTipText("On structure change");
1228
+ autokeepCB.addItemListener(this);
1229
+
1230
+ panel.Return();
1231
+ if (Globals.ADVANCED)
1232
+ {
6991233 panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
7001234 lookAtCB.setToolTipText("Look-at target");
7011235 lookAtCB.addItemListener(this);
1236
+ }
7021237
7031238 }
7041239
7051240 cGridBag fill = new cGridBag();
706
-
7071241 fill.preferredHeight = 200;
1242
+ cGridBag fill2 = new cGridBag();
1243
+ fill2.preferredHeight = 200;
1244
+ cGridBag fill3 = new cGridBag();
1245
+ fill3.preferredHeight = 200;
7081246
7091247 panel.add(fill);
1248
+ panel.add(fill2);
1249
+ panel.add(fill3);
7101250
7111251 }
7121252
7131253 void EditObject(Object3D obj)
7141254 {
7151255 cRadio radioButton = new cRadio(obj.name);
1256
+
1257
+ // June 2019. Patch to avoid bug with transparency.
1258
+ radioButton.hadMaterial = obj.material != null;
1259
+ if (!radioButton.hadMaterial)
1260
+ {
1261
+ obj.material = new cMaterial();
1262
+ }
1263
+
7161264 radioButton.SetObject(obj);
717
- radioButton.layout = sevenButton;
1265
+ radioButton.layout = sixButton; // sevenButton;
7181266 radioButton.SetCamera(cameraView.renderCamera, false);
7191267 radioButton.addActionListener(this);
7201268 radioPanel.add(radioButton);
7211269 buttonGroup.add(radioButton);
7221270 radioButton.doClick();
7231271 }
1272
+
7241273 void SetupViews(ObjEditor oe)
7251274 {
1275
+ theFrame = this;
1276
+
7261277 oe.SetupViews();
7271278
7281279 System.out.println("SetupViews");
....@@ -731,23 +1282,28 @@
7311282 /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this);
7321283 }
7331284
734
- JCheckBox liveCB;
735
- JCheckBox supportCB;
736
- JCheckBox localCB;
737
- JCheckBox crowdCB;
738
- JCheckBox smoothCB;
739
- JCheckBox fastCB;
740
- JCheckBox slowCB;
741
- JCheckBox boxCB;
742
- JCheckBox zoomBoxCB;
743
- JCheckBox trackCB;
744
- JCheckBox smoothfocusCB;
1285
+ cToggleButton liveCB;
1286
+ cCheckBox supportCB;
1287
+ cCheckBox localCB;
1288
+ cCheckBox crowdCB;
1289
+ cCheckBox smoothCB;
1290
+ cToggleButton fastCB;
1291
+ cCheckBox slowCB;
1292
+ cCheckBox boxCB;
1293
+ cCheckBox zoomBoxCB;
1294
+ cCheckBox freezeCB;
1295
+ //cToggleButton trackCB;
1296
+ cCheckBox trackCB;
1297
+ cCheckBox smoothfocusCB;
7451298 // JCheckBox speakerMocapCB;
746
- JCheckBox speakerCameraCB;
747
- JCheckBox speakerFocusCB;
748
- JCheckBox debugCB;
749
- JCheckBox oeilCB;
750
- JCheckBox lookAtCB;
1299
+ cCheckBox speakerCameraCB;
1300
+ cCheckBox speakerFocusCB;
1301
+ cCheckBox debugCB;
1302
+
1303
+ cCheckBox oeilCB;
1304
+ cCheckBox shadowCB;
1305
+ cCheckBox autokeepCB;
1306
+ cCheckBox lookAtCB;
7511307
7521308 // static int COLOR = 1;
7531309 // static int MATERIAL = 2;
....@@ -755,9 +1311,9 @@
7551311
7561312 int dropAttributes = Object3D.COLOR | Object3D.MATERIAL;
7571313
758
- JCheckBox colorCB;
759
- JCheckBox materialCB;
760
- JCheckBox textureCB;
1314
+ cCheckBox colorCB;
1315
+ cCheckBox materialCB;
1316
+ cCheckBox textureCB;
7611317
7621318 public void itemStateChanged(ItemEvent e)
7631319 {
....@@ -785,6 +1341,7 @@
7851341 } else if(e.getSource() == liveCB)
7861342 {
7871343 cameraView.ToggleLive();
1344
+ refreshContents(false);
7881345 }
7891346 else if(e.getSource() == supportCB)
7901347 {
....@@ -849,6 +1406,18 @@
8491406 {
8501407 cameraView.ToggleOeil();
8511408 }
1409
+ else if(e.getSource() == shadowCB)
1410
+ {
1411
+ Globals.COMPUTESHADOWWHENLIVE ^= true;
1412
+ }
1413
+ else if(e.getSource() == freezeCB)
1414
+ {
1415
+ Globals.FREEZEONMOVE ^= true;
1416
+ }
1417
+ else if(e.getSource() == autokeepCB)
1418
+ {
1419
+ Globals.REPLACEONMAKE ^= true;
1420
+ }
8521421 else if(e.getSource() == lookAtCB)
8531422 {
8541423 cameraView.ToggleLookAt();
....@@ -865,7 +1434,8 @@
8651434
8661435 /**/
8671436 //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this);
868
- TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1437
+ //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1438
+ TreePath path = objEditor.jTree.getSelectionPath();
8691439 if ((path == null) || (path.getPathCount() <= 1)) {
8701440 // We can't move the root node or an empty selection
8711441 return;
....@@ -928,8 +1498,6 @@
9281498 }
9291499 }
9301500
931
- String string = (String) object;
932
-
9331501 System.out.println("Transfer = " + object + "; drop : " + target);
9341502 // if( object instanceof java.io.File[])
9351503 // {
....@@ -937,7 +1505,11 @@
9371505 // objEditor.DropFile((java.io.File[]) object, true);
9381506 // return;
9391507 // }
940
- if (string.charAt(0) == '/')
1508
+
1509
+ String string = object.toString();
1510
+
1511
+ // File path for Mac and Windows
1512
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
9411513 {
9421514 // file(s)
9431515 String[] names = string.split("\n");
....@@ -964,7 +1536,7 @@
9641536
9651537 flashIt = false;
9661538 CameraPane pane = (CameraPane) target;
967
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1539
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
9681540 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
9691541
9701542 if (group.selection.size() == 1)
....@@ -980,23 +1552,33 @@
9801552
9811553 assert target == objEditor.jTree;
9821554 TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y);
1555
+ Object3D destinationLeaf;
9831556 try {
984
- Object3D dummy = (Composite) destinationPath.getLastPathComponent();
1557
+ destinationLeaf = (Composite) destinationPath.getLastPathComponent();
9851558 } catch (Exception e) {
9861559 System.out.println("destinationPath : " + destinationPath);
9871560 return;
9881561 }
9891562
990
- if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1563
+ for (int i=group.selection.size(); --i>=0;)
9911564 {
1565
+ Object3D child = (Object3D)group.selection.elementAt(i);
1566
+
1567
+ // Cannot move into itself
1568
+ if (child == destinationLeaf)
1569
+ return;
1570
+ }
1571
+
1572
+// june 2019 if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1573
+// {
9921574 loadClipboard(true);
9931575 objEditor.jTree.setSelectionPath(destinationPath);
9941576 pasteInto(false, false);
995
- } else {
996
- loadClipboard(false);
997
- objEditor.jTree.setSelectionPath(destinationPath);
998
- pasteInto(false, false); // true); // ???
999
- }
1577
+// } else {
1578
+// loadClipboard(false);
1579
+// objEditor.jTree.setSelectionPath(destinationPath);
1580
+// pasteInto(false, false); // true); // ???
1581
+// }
10001582 }
10011583 public void dropActionChanged(DropTargetDragEvent dtde)
10021584 // Called if the user has modified the current drop gesture
....@@ -1101,22 +1683,30 @@
11011683 {
11021684 //heightFieldItem = menu.add(new MenuItem("Height Field"));
11031685 //heightFieldItem.addActionListener(this);
1104
- gridItem = menu.add(new MenuItem("Grid"));
1105
- gridItem.addActionListener(this);
1106
- rectoidItem = menu.add(new MenuItem("Box"));
1107
- rectoidItem.addActionListener(this);
1108
- ellipsoidItem = menu.add(new MenuItem("Sphere"));
1109
- ellipsoidItem.addActionListener(this);
1110
- coneItem = menu.add(new MenuItem("Cone"));
1111
- coneItem.addActionListener(this);
1112
- torusItem = menu.add(new MenuItem("Torus"));
1113
- torusItem.addActionListener(this);
1114
- superItem = menu.add(new MenuItem("Superellipsoid"));
1115
- superItem.addActionListener(this);
1686
+// gridItem = menu.add(new MenuItem("Grid"));
1687
+// gridItem.addActionListener(this);
1688
+// rectoidItem = menu.add(new MenuItem("Box"));
1689
+// rectoidItem.addActionListener(this);
1690
+// ellipsoidItem = menu.add(new MenuItem("Sphere"));
1691
+// ellipsoidItem.addActionListener(this);
1692
+// coneItem = menu.add(new MenuItem("Cone"));
1693
+// coneItem.addActionListener(this);
1694
+// torusItem = menu.add(new MenuItem("Torus"));
1695
+// torusItem.addActionListener(this);
1696
+// superItem = menu.add(new MenuItem("Superellipsoid"));
1697
+// superItem.addActionListener(this);
1698
+
1699
+ cameraItem = menu.add(new MenuItem("Camera"));
1700
+ cameraItem.addActionListener(this);
1701
+
1702
+ if (!Globals.ADVANCED)
1703
+ {
11161704 kleinItem = menu.add(new MenuItem("Klein Bottle"));
11171705 kleinItem.addActionListener(this);
1118
- particleItem = menu.add(new MenuItem("Particle system"));
1119
- particleItem.addActionListener(this);
1706
+ }
1707
+
1708
+// particleItem = menu.add(new MenuItem("Particle system"));
1709
+// particleItem.addActionListener(this);
11201710 if (Globals.ADVANCED)
11211711 {
11221712 ragdollItem = menu.add(new MenuItem("Rag Walk"));
....@@ -1142,15 +1732,15 @@
11421732 }
11431733 bezierItem = menu.add(new MenuItem("Bezier Patch"));
11441734 bezierItem.addActionListener(this);
1145
- overlayItem = menu.add(new MenuItem("Overlay"));
1146
- overlayItem.addActionListener(this);
1147
- lightItem = menu.add(new MenuItem("Light"));
1148
- lightItem.addActionListener(this);
1735
+// overlayItem = menu.add(new MenuItem("Overlay"));
1736
+// overlayItem.addActionListener(this);
1737
+// lightItem = menu.add(new MenuItem("Light"));
1738
+// lightItem.addActionListener(this);
11491739 menu.add("-");
11501740 //superLoopItem = menu.add(new MenuItem("Super Loop"));
11511741 //superLoopItem.addActionListener(this);
1152
- loopItem = menu.add(new MenuItem("Loop"));
1153
- loopItem.addActionListener(this);
1742
+// loopItem = menu.add(new MenuItem("Loop"));
1743
+// loopItem.addActionListener(this);
11541744 doubleItem = menu.add(new MenuItem("Fork"));
11551745 doubleItem.addActionListener(this);
11561746 if (Globals.ADVANCED)
....@@ -1166,6 +1756,9 @@
11661756 animationItem.addItemListener(this);
11671757 animationItem.setState(Globals.ANIMATION);
11681758
1759
+ menu.add(archiveItem = new MenuItem("Archive3D..."));
1760
+ archiveItem.addActionListener(this);
1761
+
11691762 menu.add("-");
11701763 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
11711764 parseverticesItem.addActionListener(this);
....@@ -1178,6 +1771,8 @@
11781771 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
11791772 reduce34MorphItem.addActionListener(this);
11801773 menu.add("-");
1774
+ menu.add(memoryItem = new MenuItem("Memory Usage"));
1775
+ memoryItem.addActionListener(this);
11811776 menu.add(computeAOItem = new MenuItem("Compute AO"));
11821777 computeAOItem.addActionListener(this);
11831778
....@@ -1186,11 +1781,9 @@
11861781 mirrorItem = menu.add(new MenuItem("Mirror Poses"));
11871782 mirrorItem.addActionListener(this);
11881783 menu.add("-");
1189
- menu.add(memoryItem = new MenuItem("Memory Usage"));
1190
- memoryItem.addActionListener(this);
11911784 menu.add(analyzeItem = new MenuItem("Analyze"));
11921785 analyzeItem.addActionListener(this);
1193
- menu.add(dumpItem = new MenuItem("Dump"));
1786
+ menu.add(dumpItem = new MenuItem("Print"));
11941787 dumpItem.addActionListener(this);
11951788 // menu.add(pathItem = new MenuItem("From-to path"));
11961789 // pathItem.addActionListener(this);
....@@ -1331,9 +1924,34 @@
13311924 shadow.material = new cMaterial(obj.material);
13321925 shadow.material.diffuse = 0.0001f;
13331926 shadow.material.specular = 0.0001f;
1927
+ //shadow.projectedVertices[1].x = 300;
13341928
13351929 makeSomething(shadow);
13361930 }
1931
+
1932
+ private void ClearUnpinned()
1933
+ {
1934
+ //for (Object3D obj : listUI)
1935
+ for (int i=listUI.size(); --i>=0;)
1936
+ {
1937
+ Object3D obj = listUI.elementAt(i);
1938
+ if (!obj.pinned)
1939
+ {
1940
+ obj.CloseUI();
1941
+ listUI.remove(i);
1942
+ }
1943
+ }
1944
+ }
1945
+
1946
+ private void EditElement(Object3D elem, boolean newWindow)
1947
+ {
1948
+ // if (!(elem instanceof Composite))
1949
+ // newWindow = false;
1950
+ listUI.add(elem);
1951
+ elem.openEditWindow(this, newWindow); //, false);
1952
+ System.out.println("edit : " + elem);
1953
+ elem.editWindow.refreshContents(true); // ? new
1954
+ }
13371955
13381956 /**
13391957 * applyExample
....@@ -1537,9 +2155,9 @@
15372155
15382156 void Overwrite(int mask)
15392157 {
1540
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2158
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
15412159 {
1542
- Object3D content = GrafreeD.clipboard.get(0);
2160
+ Object3D content = Grafreed.clipboard.get(0);
15432161
15442162 if (content instanceof cGroup && ((cGroup)content).transientlink )
15452163 content = ((cGroup)content).get(0);
....@@ -1578,7 +2196,7 @@
15782196 {
15792197 ScreenFit();
15802198 } else
1581
- if (source == switchItem)
2199
+ if (source == switchViewItem)
15822200 {
15832201 cVector v1 = new cVector();
15842202 cVector v2 = new cVector();
....@@ -1587,11 +2205,11 @@
15872205 objEditor.cameraView.renderCamera.setAim(v2, v1);
15882206 objEditor.cameraView.repaint();
15892207 } else
1590
- if (source == rectoidItem)
2208
+ if (source == rectoidItem || source == boxButton)
15912209 {
15922210 makeSomething(new Box());
15932211 } else
1594
- if (source == particleItem)
2212
+ if (source == particleItem || source == particlesButton)
15952213 {
15962214 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15972215 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1670,27 +2288,27 @@
16702288
16712289 makeSomething(obj);
16722290 } else
1673
- if (source == gridItem)
2291
+ if (source == gridItem || source == gridButton)
16742292 {
16752293 makeSomething(new Grid());
16762294 } else
1677
- if (source == ellipsoidItem)
2295
+ if (source == ellipsoidItem || source == sphereButton)
16782296 {
16792297 makeSomething(new Sphere());
16802298 } else
1681
- if (source == coneItem)
2299
+ if (source == coneItem || source == coneButton)
16822300 {
16832301 makeSomething(new Cone());
16842302 } else
1685
- if (source == torusItem)
2303
+ if (source == torusItem || source == torusButton)
16862304 {
16872305 makeSomething(new Torus());
16882306 } else
1689
- if (source == superItem)
2307
+ if (source == superItem || source == superButton)
16902308 {
16912309 makeSomething(new Superellipsoid());
16922310 } else
1693
- if (source == kleinItem)
2311
+ if (source == kleinItem || source == kleinButton)
16942312 {
16952313 makeSomething(new Klein());
16962314 } else
....@@ -1710,7 +2328,7 @@
17102328 {
17112329 makeSomething(new BezierSurface());
17122330 } else
1713
- if (source == overlayItem)
2331
+ if (source == overlayItem || source == overlayButton)
17142332 {
17152333 /*
17162334 Object3D obj = new BezierSurface(5,8);
....@@ -1758,10 +2376,27 @@
17582376 s.setup();
17592377 makeSomething(s);
17602378 } else
1761
- if (source == lightItem)
2379
+ if (source == lightItem || source == lightButton)
17622380 {
17632381 makeSomething(new Light());
17642382 } else
2383
+// if (source == skybox1Button ||
2384
+// source == skybox2Button ||
2385
+// source == skybox3Button ||
2386
+// source == skybox4Button ||
2387
+// source == skybox5Button ||
2388
+// source == skybox6Button ||
2389
+// source == skybox7Button ||
2390
+// source == skybox11Button ||
2391
+// source == skybox12Button ||
2392
+// source == skybox13Button ||
2393
+// source == skybox14Button ||
2394
+// source == skybox15Button ||
2395
+// source == skybox16Button ||
2396
+// source == skybox17Button)
2397
+// {
2398
+// ChangeSkybox(source);
2399
+// } else
17652400 if (source == csgItem)
17662401 {
17672402 group(new CSG());
....@@ -1808,30 +2443,30 @@
18082443
18092444 group(g);
18102445 } else
1811
- if (source == loopItem)
2446
+ if (source == loopItem || source == loopButton)
18122447 {
18132448 Composite csg = new GroupLeaf();
18142449 csg.count = 5;
18152450 group(csg);
1816
- Composite child = new cGroup();
2451
+ Composite child = new cGroup("Branch");
18172452 csg.addChild(child);
18182453 child.addChild(csg);
18192454 } else
18202455 if (source == doubleItem)
18212456 {
1822
- Composite csg = new GroupLeaf();
2457
+ Composite csg = new GroupLeaf("Fork");
18232458 csg.count = 5;
18242459 group(csg);
1825
- Composite child = new cGroup();
2460
+ Composite child = new cGroup("Branch A");
18262461 csg.addChild(child);
18272462 child.addChild(csg);
1828
- child = new cGroup();
2463
+ child = new cGroup("Branch B");
18292464 csg.addChild(child);
18302465 child.addChild(csg);
18312466 } else
18322467 if (source == tripleItem)
18332468 {
1834
- Composite csg = new GroupLeaf();
2469
+ Composite csg = new GroupLeaf("Trident");
18352470 csg.count = 4;
18362471 group(csg);
18372472 Composite child = new cGroup();
....@@ -1844,27 +2479,10 @@
18442479 csg.addChild(child);
18452480 child.addChild(csg);
18462481 } else
1847
-
1848
- if (source == importGFDItem)
1849
- {
1850
- ImportGFD();
1851
- } else
1852
- if (source == importVRMLX3DItem)
1853
- {
1854
- ImportVRMLX3D();
1855
- } else
1856
- if (source == import3DSItem)
1857
- {
1858
- objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
1859
- } else
1860
- if (source == importOBJItem)
1861
- {
1862
- objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1863
- } else
18642482 if (source == computeAOItem)
18652483 {
18662484 Globals.drawMode = CameraPane.OCCLUSION;
1867
- Globals.theRenderer.repaint();
2485
+ cameraView.repaint();
18682486 } else
18692487 if (source == recompileItem)
18702488 {
....@@ -1879,7 +2497,7 @@
18792497 if (source == invariantsItem)
18802498 {
18812499 System.out.println("Invariants:");
1882
- GrafreeD.grafreeD.universe.invariants();
2500
+ Grafreed.grafreeD.universe.invariants();
18832501 } else
18842502 if (source == memoryItem)
18852503 {
....@@ -1898,6 +2516,46 @@
18982516 {
18992517 DumpObject();
19002518 } else
2519
+ if (source == minButton)
2520
+ {
2521
+ Minimize();
2522
+ } else
2523
+ if (source == maxButton)
2524
+ {
2525
+ Maximize();
2526
+ } else
2527
+ if (source == fullButton)
2528
+ {
2529
+ ToggleFullScreen();
2530
+ } else
2531
+ if (source == undoButton)
2532
+ {
2533
+ // Go to previous version
2534
+ //if (!Undo())
2535
+ //java.awt.Toolkit.getDefaultToolkit().beep();
2536
+ Undo();
2537
+ } else
2538
+ if (source == restoreButton)
2539
+ {
2540
+ // Restore current version
2541
+ Restore();
2542
+ } else
2543
+ if (source == replaceButton)
2544
+ {
2545
+ // Overwrite current version
2546
+ Replace();
2547
+ } else
2548
+ if (source == redoButton)
2549
+ {
2550
+ // Go to next version
2551
+ Redo();
2552
+ } else
2553
+ if (source == saveButton)
2554
+ {
2555
+ // Save a new version
2556
+ if (!Save(true))
2557
+ java.awt.Toolkit.getDefaultToolkit().beep();
2558
+ } else
19012559 if (source == oneStepButton)
19022560 {
19032561 Globals.ONESTEP = true;
....@@ -1905,17 +2563,14 @@
19052563 } else
19062564 if (source == screenfitButton)
19072565 {
1908
- //Reload(lastConverter, lastFilename, true);
19092566 ScreenFit();
19102567 } else
19112568 if (source == screenfitpointButton)
19122569 {
1913
- //Reload(lastConverter, lastFilename, true);
19142570 ScreenFitPoint();
19152571 } else
19162572 if (source == snapobjectButton)
19172573 {
1918
- //Reload(lastConverter, lastFilename, true);
19192574 SnapObject();
19202575 } else
19212576 // if (event.getSource() == recompileButton)
....@@ -1952,12 +2607,20 @@
19522607 {
19532608 loadClipboard(true);
19542609 } else
2610
+ if (source == undoItem)
2611
+ {
2612
+ Undo();
2613
+ } else
2614
+ if (source == redoItem)
2615
+ {
2616
+ Redo();
2617
+ } else
19552618 if (source == duplicateItem)
19562619 {
1957
- Object3D keep = GrafreeD.clipboard;
2620
+ Object3D keep = Grafreed.clipboard;
19582621 loadClipboard(false);
19592622 paste(false);
1960
- GrafreeD.clipboard = keep;
2623
+ Grafreed.clipboard = keep;
19612624 } else
19622625 if (source == cloneItem)
19632626 {
....@@ -2177,9 +2840,9 @@
21772840 // group.selection.get(0).setMasterThis(content); // should be identity
21782841 // refreshContents();
21792842 // }
2180
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2843
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
21812844 {
2182
- Object3D content = GrafreeD.clipboard.get(0);
2845
+ Object3D content = Grafreed.clipboard.get(0);
21832846
21842847 if (content instanceof cGroup && ((cGroup)content).transientlink )
21852848 content = ((cGroup)content).get(0);
....@@ -2229,9 +2892,9 @@
22292892 } else
22302893 if (source == setMasterItem)
22312894 {
2232
- if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
2895
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
22332896 {
2234
- Object3D content = GrafreeD.clipboard.get(0);
2897
+ Object3D content = Grafreed.clipboard.get(0);
22352898
22362899 if (content instanceof cGroup && ((cGroup)content).transientlink )
22372900 content = ((cGroup)content).get(0);
....@@ -2244,9 +2907,9 @@
22442907 {
22452908 if (group.selection.size() == 1)
22462909 {
2247
- if (GrafreeD.clipboard.size() == 1)
2910
+ if (Grafreed.clipboard.size() == 1)
22482911 {
2249
- Object3D content = GrafreeD.clipboard.get(0);
2912
+ Object3D content = Grafreed.clipboard.get(0);
22502913
22512914 if (content instanceof cGroup && ((cGroup)content).transientlink )
22522915 content = ((cGroup)content).get(0);
....@@ -2263,7 +2926,7 @@
22632926 {
22642927 RevertMeshes();
22652928 } else
2266
- if (source == resetMeshItem)
2929
+ if (source == resetAllItem)
22672930 {
22682931 ResetAll();
22692932 } else
....@@ -2271,7 +2934,7 @@
22712934 {
22722935 StepAll();
22732936 } else
2274
- if (source == clearItem) // || event.getSource() == clearButton)
2937
+ if (source == deleteItem) // || event.getSource() == clearButton)
22752938 {
22762939 //int indices[] = jList.getSelectedIndices();
22772940 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2283,9 +2946,9 @@
22832946 {
22842947 ClearSelection(true);
22852948 } else
2286
- if (source == grabItem)
2949
+ if (source == grabItem || source == groupButton)
22872950 {
2288
- group(new cGroup(), true);
2951
+ group(new cGroup(), false); // true);
22892952 } else
22902953 if (source == hideItem)
22912954 {
....@@ -2303,11 +2966,11 @@
23032966 {
23042967 makeSomething(new Camera());
23052968 } else
2306
- if (source == compositeItem)
2969
+ if (source == compositeItem || source == compositeButton)
23072970 {
23082971 group(new Composite());
23092972 } else
2310
- if (source == randomItem)
2973
+ if (source == switchItem || source == switchButton)
23112974 {
23122975 RandomNode random = new RandomNode();
23132976 group(random);
....@@ -2409,7 +3072,7 @@
24093072 {
24103073 group(new cLinker());
24113074 } else
2412
- if (source == textureItem)
3075
+ if (source == textureItem || source == textureButton)
24133076 {
24143077 group(new TextureNode());
24153078 } else
....@@ -2429,17 +3092,30 @@
24293092 {
24303093 CastShadow(2);
24313094 } else
2432
- if (source == ungroupItem)
3095
+ if (source == ungroupItem || source == ungroupButton)
24333096 {
2434
- //ungroup();
3097
+ boolean hasRoot = false;
3098
+
24353099 for (int i=0; i<group.selection.size(); i++)
24363100 {
2437
- Ungroup(group.selection.get(i));
3101
+ if (group.selection.get(i) == group)
3102
+ {
3103
+ hasRoot = true;
3104
+ break;
3105
+ }
24383106 }
24393107
2440
- ClearSelection(false);
2441
-
2442
- refreshContents();
3108
+ if (!hasRoot)
3109
+ {
3110
+ for (int i=0; i<group.selection.size(); i++)
3111
+ {
3112
+ Ungroup(group.selection.get(i));
3113
+ }
3114
+
3115
+ ClearSelection(false);
3116
+
3117
+ refreshContents();
3118
+ }
24433119 } else
24443120 if (source == genUVItem)
24453121 {
....@@ -2451,7 +3127,7 @@
24513127 } else
24523128 if (source == genNormalsMESHItem)
24533129 {
2454
- GenNormals(true); // TODO
3130
+ GenNormalsMESH();
24553131 } else
24563132 if (source == genNormalsORGANItem)
24573133 {
....@@ -2516,6 +3192,22 @@
25163192 if (source == unmarkleavesItem)
25173193 {
25183194 MarkLeaves(false);
3195
+ } else
3196
+ if (source == rewindleavesItem)
3197
+ {
3198
+ RewindLeaves(true);
3199
+ } else
3200
+ if (source == unrewindleavesItem)
3201
+ {
3202
+ RewindLeaves(false);
3203
+ } else
3204
+ if (source == randomleavesItem)
3205
+ {
3206
+ RandomLeaves(true);
3207
+ } else
3208
+ if (source == unrandomleavesItem)
3209
+ {
3210
+ RandomLeaves(false);
25193211 } else
25203212 if (source == flipVItem)
25213213 {
....@@ -2601,9 +3293,13 @@
26013293 {
26023294 SmoothMesh();
26033295 } else
2604
- if (source == transformgeometryItem)
3296
+ if (source == transformGeometryItem)
26053297 {
26063298 TransformGeometry();
3299
+ } else
3300
+ if (source == transformChildrenItem)
3301
+ {
3302
+ TransformChildren();
26073303 } else
26083304 if (source == resetTransformItem)
26093305 {
....@@ -2611,7 +3307,11 @@
26113307 } else
26123308 if (source == resetCentroidItem)
26133309 {
2614
- ResetCentroid();
3310
+ ResetCentroid(true);
3311
+ } else
3312
+ if (source == resetCentroidXZItem)
3313
+ {
3314
+ ResetCentroid(false);
26153315 } else
26163316 if (source == resetParentItem)
26173317 {
....@@ -2716,7 +3416,7 @@
27163416 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
27173417 {
27183418 obj = (Object3D)e.nextElement();
2719
- obj.SetBumpTexture(null);
3419
+ obj.ResetBumpTexture();
27203420 }
27213421
27223422 refreshContents();
....@@ -2732,6 +3432,31 @@
27323432
27333433 refreshContents();
27343434 } else
3435
+ if (source == embedTexturesItem)
3436
+ {
3437
+ Object3D obj;
3438
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3439
+ {
3440
+ obj = (Object3D)e.nextElement();
3441
+ obj.EmbedTextures(true);
3442
+ }
3443
+
3444
+ refreshContents();
3445
+ } else
3446
+ if (source == deEmbedTexturesItem)
3447
+ {
3448
+ Object3D obj;
3449
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3450
+ {
3451
+ obj = (Object3D)e.nextElement();
3452
+ obj.EmbedTextures(false);
3453
+ }
3454
+
3455
+ CameraPane.texturepigment.clear();
3456
+ CameraPane.texturebump.clear();
3457
+
3458
+ refreshContents();
3459
+ } else
27353460 if (source == flashSelectionButton)
27363461 {
27373462 CameraPane.flash = true;
....@@ -2743,6 +3468,10 @@
27433468 if (source == twoButton)
27443469 {
27453470 radio.layout = twoButton;
3471
+
3472
+ if (CameraPane.FULLSCREEN)
3473
+ fullscreenLayout = radio.layout;
3474
+
27463475 // bug
27473476 //gridPanel.setDividerLocation(1.0);
27483477 //bigPanel.setDividerLocation(0.0);
....@@ -2775,10 +3504,31 @@
27753504 bigThree.ClearUI();
27763505 bigThree.add(centralPanel);
27773506 bigThree.FlushUI();
3507
+
3508
+ cameraView.requestFocusInWindow();
3509
+
3510
+// refreshContents(true);
3511
+//
3512
+// try
3513
+// {
3514
+// java.awt.Robot bot = new java.awt.Robot();
3515
+// int mask = InputEvent.BUTTON1_MASK;
3516
+// bot.mouseMove(100, 100);
3517
+// bot.mousePress(mask);
3518
+// bot.mouseRelease(mask);
3519
+// }
3520
+// catch (Exception e)
3521
+// {
3522
+//
3523
+// }
3524
+
27783525 } else
27793526 if (source == threeButton)
27803527 {
27813528 radio.layout = threeButton;
3529
+
3530
+ if (CameraPane.FULLSCREEN)
3531
+ fullscreenLayout = radio.layout;
27823532
27833533 // bigThree.remove(scenePanel);
27843534 // bigThree.remove(centralPanel);
....@@ -2808,13 +3558,18 @@
28083558 // centralPanel.setVisible(true);
28093559 // XYZPanel.setVisible(true);
28103560 bigThree.ClearUI();
3561
+ bigThree.add(scenePanel);
28113562 bigThree.add(centralPanel);
2812
- bigThree.add(XYZPanel);
28133563 bigThree.FlushUI();
3564
+
3565
+ cameraView.requestFocusInWindow();
28143566 } else
28153567 if (source == fourButton)
28163568 {
28173569 radio.layout = fourButton;
3570
+
3571
+ if (CameraPane.FULLSCREEN)
3572
+ fullscreenLayout = radio.layout;
28183573
28193574 // bigThree.remove(scenePanel);
28203575 // bigThree.remove(centralPanel);
....@@ -2846,10 +3601,15 @@
28463601 bigThree.ClearUI();
28473602 bigThree.add(scenePanel);
28483603 bigThree.FlushUI();
3604
+
3605
+ cameraView.requestFocusInWindow();
28493606 } else
28503607 if (source == sixButton)
28513608 {
28523609 radio.layout = sixButton;
3610
+
3611
+ if (CameraPane.FULLSCREEN)
3612
+ fullscreenLayout = radio.layout;
28533613
28543614 // bigThree.remove(scenePanel);
28553615 // bigThree.remove(centralPanel);
....@@ -2879,13 +3639,18 @@
28793639 // centralPanel.setVisible(true);
28803640 // XYZPanel.setVisible(false);
28813641 bigThree.ClearUI();
2882
- bigThree.add(scenePanel);
28833642 bigThree.add(centralPanel);
3643
+ bigThree.add(scenePanel);
28843644 bigThree.FlushUI();
3645
+
3646
+ cameraView.requestFocusInWindow();
28853647 } else
28863648 if (source == sevenButton)
28873649 {
28883650 radio.layout = sevenButton;
3651
+
3652
+ if (CameraPane.FULLSCREEN)
3653
+ fullscreenLayout = radio.layout;
28893654
28903655 // bigThree.remove(scenePanel);
28913656 // bigThree.remove(centralPanel);
....@@ -2919,6 +3684,8 @@
29193684 bigThree.add(centralPanel);
29203685 bigThree.add(XYZPanel);
29213686 bigThree.FlushUI();
3687
+
3688
+ cameraView.requestFocusInWindow();
29223689 } else
29233690 if (source == rootButton)
29243691 {
....@@ -2930,6 +3697,7 @@
29303697 EditObject(obj);
29313698 }
29323699
3700
+ cameraView.requestFocusInWindow();
29333701 refreshContents(true);
29343702 } else
29353703 if (source == closeButton)
....@@ -2939,22 +3707,37 @@
29393707 for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
29403708 {
29413709 ab = (cRadio)e.nextElement();
2942
- if(ab.getModel().isSelected() && ab.GetObject() != client)
3710
+ if (ab.getModel().isSelected() && ab.GetObject() != client)
29433711 {
3712
+ // Patch to avoid bug with transparency.
3713
+ if (!ab.hadMaterial)
3714
+ {
3715
+ ab.object.material = null;
3716
+ }
3717
+
29443718 buttonGroup.remove(ab);
29453719 radioPanel.remove(ab);
29463720
2947
- ab.GetObject().editWindow = null;
3721
+ //ab.GetObject().editWindow = null;
3722
+ ab.GetObject().manipWindow = null;
29483723 // ab.GetObject().objectUI = null; // ?????????
29493724
29503725 ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick();
29513726 break;
29523727 }
29533728 }
3729
+
3730
+ cameraView.requestFocusInWindow();
29543731 refreshContents(true);
29553732 } else
29563733 if (source == editItem || source == editButton)
29573734 {
3735
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3736
+ {
3737
+ Object3D child = (Object3D)e.nextElement();
3738
+ child.pinned = true;
3739
+ }
3740
+
29583741 EditSelection(false);
29593742 } else
29603743 if (source == uneditButton)
....@@ -2964,10 +3747,11 @@
29643747 Object3D child = (Object3D)e.nextElement();
29653748 if(child.editWindow != null)
29663749 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3750
+ child.pinned = false;
29673751 child.CloseUI();
29683752 listUI.remove(child);
29693753
2970
- child.editWindow = null; // ???????????
3754
+ //child.editWindow = null; // ???????????
29713755 }
29723756 objEditor.ctrlPanel.FlushUI();
29733757 //objEditor.jTree.clearSelection();
....@@ -2980,6 +3764,7 @@
29803764 //copy.ClearUI();
29813765 for (Object3D obj : listUI)
29823766 {
3767
+ obj.pinned = false;
29833768 obj.CloseUI();
29843769 }
29853770 listUI.clear();
....@@ -2989,7 +3774,7 @@
29893774 {
29903775 assert(copy == group);
29913776
2992
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3777
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
29933778
29943779 for (Object3D obj : listUI)
29953780 {
....@@ -3038,6 +3823,9 @@
30383823 }
30393824
30403825 copy = group;
3826
+
3827
+ SetUndoStates();
3828
+
30413829 //Globals.theRenderer.object = group;
30423830 if(!useclient)
30433831 {
....@@ -3053,20 +3841,46 @@
30533841 frontView.object = group;
30543842 sideView.object = group;
30553843 }
3056
- group.editWindow = this;
3844
+
3845
+// fix "+" issue
3846
+ //group.editWindow = this;
3847
+ group.manipWindow = this;
3848
+
30573849 /*
30583850 currentLayout = radio.layout;
30593851 if (currentLayout == null)
30603852 currentLayout = sevenButton;
30613853 */
30623854 radio.layout.doClick();
3855
+
3856
+ ClearUnpinned();
3857
+ //Grafreed.Assert(group != null);
3858
+ //Grafreed.Assert(group.selection != null);
3859
+ SetPinStates(group.selection == null || group.selection.size() > 0);
3860
+ if (group.selection == null || group.selection.size() == 1)
3861
+ EditSelection(false);
30633862 keepparent = group.parent;
30643863 // PARENT = NULL or not???
30653864 //group.parent = null; // ROOT
30663865 //group.attributes = -1;
30673866 ResetModel();
3867
+
3868
+ cameraView.requestFocusInWindow();
30683869 refreshContents(true);
3069
- }
3870
+ } else if (event.getSource() == editCameraItem)
3871
+ {
3872
+ cameraView.ProtectCamera();
3873
+ cameraView.repaint();
3874
+ return;
3875
+ } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton)
3876
+ {
3877
+ cameraView.RevertCamera();
3878
+ cameraView.repaint();
3879
+ return;
3880
+ // } else if (event.getSource() == textureButton)
3881
+ // {
3882
+ // return; // true;
3883
+ }
30703884 else
30713885 {
30723886 //return super.action(event, arg);
....@@ -3075,7 +3889,6 @@
30753889 }
30763890
30773891 boolean useclient = false;
3078
- cRadio radio;
30793892
30803893 void ToggleRoot()
30813894 {
....@@ -3127,6 +3940,28 @@
31273940 refreshContents();
31283941 }
31293942
3943
+ void TransformChildren()
3944
+ {
3945
+ Object3D obj;
3946
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3947
+ {
3948
+ obj = (Object3D)e.nextElement();
3949
+ obj.KeepTextureMatrices();
3950
+ obj.TransformChildren();
3951
+ obj.RestoreTextureMatrices();
3952
+
3953
+// if (obj.parent == null)
3954
+// {
3955
+// System.out.println("NULL PARENT!");
3956
+// new Exception().printStackTrace();
3957
+// }
3958
+// else
3959
+// TouchTransform(obj);
3960
+// //obj.parent.Touch();
3961
+ }
3962
+
3963
+ refreshContents();
3964
+ }
31303965
31313966 void ResetTransform()
31323967 {
....@@ -3239,7 +4074,7 @@
32394074 refreshContents();
32404075 }
32414076
3242
- void ResetCentroid()
4077
+ void ResetCentroid(boolean full)
32434078 {
32444079 Object3D obj;
32454080 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3254,12 +4089,16 @@
32544089 LA.matIdentity(Object3D.mat);
32554090 obj.getBounds(minima, maxima, false);
32564091 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3257
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
4092
+ if (full)
4093
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
32584094 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
32594095 obj.TransformMesh(Object3D.mat);
4096
+
32604097 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3261
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
4098
+ if (full)
4099
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
32624100 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
4101
+
32634102 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
32644103 //Object3D.mat[3][0] = -Object3D.mat[3][0];
32654104 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3288,7 +4127,8 @@
32884127
32894128 int size = obj.MemorySize();
32904129
3291
- System.err.println((size/1024) + " KB is the size of " + obj);
4130
+ //System.err.println((size/1024) + " KB is the size of " + obj);
4131
+ System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)");
32924132 }
32934133 }
32944134 catch (Exception e)
....@@ -3325,9 +4165,9 @@
33254165 obj = (Object3D)e.nextElement();
33264166
33274167 System.out.println("Object is: " + obj);
3328
- GrafreeD.AnalyzeObject(obj);
4168
+ Grafreed.AnalyzeObject(obj);
33294169 System.out.println("Boundary rep: " + obj.bRep);
3330
- GrafreeD.AnalyzeObject(obj.bRep);
4170
+ Grafreed.AnalyzeObject(obj.bRep);
33314171
33324172 // System.err.println((size/1024) + " KB is the size of " + obj);
33334173 }
....@@ -3369,6 +4209,13 @@
33694209 void GenNormals(boolean crease)
33704210 {
33714211 group.GenNormalsS(crease);
4212
+
4213
+ refreshContents();
4214
+ }
4215
+
4216
+ void GenNormalsMESH()
4217
+ {
4218
+ group.GenNormalsMeshS();
33724219
33734220 refreshContents();
33744221 }
....@@ -3541,8 +4388,8 @@
35414388
35424389 void ParseVertices()
35434390 {
3544
- boolean epsequal = GrafreeD.epsequal;
3545
- GrafreeD.epsequal = true;
4391
+ boolean epsequal = Grafreed.epsequal;
4392
+ Grafreed.epsequal = true;
35464393
35474394 for (int i=0; i<group.selection.size(); i++)
35484395 {
....@@ -3567,7 +4414,7 @@
35674414 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
35684415 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
35694416
3570
- g.add(GrafreeD.clipboard);
4417
+ g.add(Grafreed.clipboard);
35714418
35724419 buffer.add(g);
35734420 }
....@@ -3582,7 +4429,7 @@
35824429 makeSomething(buffer, i==group.selection.size()-1);
35834430 }
35844431
3585
- GrafreeD.epsequal = epsequal;
4432
+ Grafreed.epsequal = epsequal;
35864433
35874434 refreshContents();
35884435 }
....@@ -3600,7 +4447,16 @@
36004447 String pigment = Object3D.GetPigment(tex);
36014448 //String bump = Object3D.GetBump(tex);
36024449
3603
- com.sun.opengl.util.texture.TextureData texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
4450
+ com.sun.opengl.util.texture.TextureData texturedata = null;
4451
+
4452
+ try
4453
+ {
4454
+ texturedata = Globals.theRenderer.GetTextureData(tex, false, node.texres);
4455
+ }
4456
+ catch (Exception e)
4457
+ {
4458
+ System.err.println("FAIL: " + node);
4459
+ }
36044460
36054461 double s = v.s;
36064462
....@@ -3732,7 +4588,7 @@
37324588 return;
37334589
37344590 Object3D poses = group.selection.get(0);
3735
- Object3D ref = GrafreeD.clipboard.get(0);
4591
+ Object3D ref = Grafreed.clipboard.get(0);
37364592
37374593 Object3D newgroup = new Object3D("Po:" + poses.name);
37384594
....@@ -3926,9 +4782,9 @@
39264782
39274783 void ClipMesh()
39284784 {
3929
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
4785
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
39304786 {
3931
- Object3D content = GrafreeD.clipboard.get(0);
4787
+ Object3D content = Grafreed.clipboard.get(0);
39324788
39334789 if (content instanceof cGroup && ((cGroup)content).transientlink )
39344790 content = ((cGroup)content).get(0);
....@@ -3937,7 +4793,7 @@
39374793 // {
39384794 // group.selection.get(i).ClipMesh(GrafreeD.clipboard);
39394795 // }
3940
- group.selection.ClipMesh(GrafreeD.clipboard);
4796
+ group.selection.ClipMesh(Grafreed.clipboard);
39414797 }
39424798 // group.selection.ClipMesh(GrafreeD.clipboard);
39434799 System.out.println("DONE.");
....@@ -3984,6 +4840,18 @@
39844840 void MarkLeaves(boolean hide)
39854841 {
39864842 group.selection.MarkLeaves(hide);
4843
+ refreshContents();
4844
+ }
4845
+
4846
+ void RewindLeaves(boolean hide)
4847
+ {
4848
+ group.selection.RewindLeaves(hide);
4849
+ refreshContents();
4850
+ }
4851
+
4852
+ void RandomLeaves(boolean hide)
4853
+ {
4854
+ group.selection.RandomLeaves(hide);
39874855 refreshContents();
39884856 }
39894857
....@@ -4058,28 +4926,25 @@
40584926 // }
40594927 // }
40604928
4061
- static boolean allparams = true;
4062
-
4063
- static Vector<Object3D> listUI = new Vector<Object3D>();
4064
-
40654929 void EditSelection(boolean newWindow)
40664930 {
4931
+ if (group.selection == null)
4932
+ {
4933
+ EditElement(group, newWindow); // ? new
4934
+ return;
4935
+ }
4936
+
40674937 // aConstraints.gridy = 0;
40684938 for (int i=0; i<group.selection.size(); i++)
40694939 {
40704940 //System.out.println("edit : " + objectPanel.indexOfTab("Material"));
40714941 //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false);
4072
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
4942
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
40734943
40744944 Object3D elem = (Object3D)group.selection.elementAt(i);
4075
- if(elem != group)
4945
+ if(elem != group || !newWindow)
40764946 {
4077
- // if (!(elem instanceof Composite))
4078
- // newWindow = false;
4079
- listUI.add(elem);
4080
- elem.openEditWindow(this, newWindow); //, false);
4081
- System.out.println("edit : " + elem);
4082
- elem.editWindow.refreshContents(true); // ? new
4947
+ EditElement(elem, newWindow); // ? new
40834948 }
40844949 }
40854950 }
....@@ -4154,7 +5019,8 @@
41545019 //new Exception().printStackTrace();
41555020
41565021 freezemodel = true;
4157
-
5022
+ ClearUnpinned();
5023
+
41585024 /**/
41595025 //switch (event.id)
41605026 {
....@@ -4162,7 +5028,6 @@
41625028 //case 702: // Event.LIST_DESELECT
41635029 group.deselectAll();
41645030 TreePath tps[] = objEditor.jTree.getSelectionPaths();
4165
- objEditor.ClearInfo(); // .GetMaterial());
41665031 if (tps != null)
41675032 {
41685033 for (int i=0; i < tps.length; i++)
....@@ -4171,10 +5036,8 @@
41715036
41725037 //if (child.parent != null)
41735038 //child.parent.addSelectee(child);
5039
+ objEditor.SetMaterial(child);
41745040 group.addSelectee(child);
4175
- objEditor.SetMaterial(child); // .GetMaterial());
4176
- objEditor.AddInfo(child, this, true); // .GetMaterial());
4177
- System.err.println("info : " + child.GetPath());
41785041 }
41795042 }
41805043 // else
....@@ -4184,20 +5047,28 @@
41845047 // System.err.println("info : " + group.GetPath());
41855048 // }
41865049
4187
- objEditor.SetText(); // jan 2014
4188
-
4189
- if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
5050
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera))
41905051 CameraPane.flash = true;
41915052
4192
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
5053
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
41935054 // a camera
41945055 {
4195
- CameraPane.camerachangeframe = 0; // don't refuse it
4196
- Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
5056
+ if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crash the camera because of invalid lightspace
5057
+ {
5058
+ CameraPane.camerachangeframe = 0; // don't refuse it
5059
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
5060
+ }
41975061 // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
41985062 // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
41995063 }
42005064
5065
+ if (tps != null && tps.length == 1)
5066
+ {
5067
+ EditSelection(false);
5068
+ }
5069
+
5070
+ SetPinStates(tps != null && tps.length > 0);
5071
+
42015072 refreshContents();
42025073 //return true;
42035074 }
....@@ -4206,6 +5077,35 @@
42065077
42075078 freezemodel = false;
42085079 }
5080
+
5081
+ void SetPinStates(boolean enabled)
5082
+ {
5083
+ editButton.setEnabled(enabled);
5084
+ uneditButton.setEnabled(enabled);
5085
+ unselectButton.setEnabled(enabled);
5086
+ flashSelectionButton.setEnabled(enabled);
5087
+ }
5088
+
5089
+ void refreshContents(boolean cp)
5090
+ {
5091
+ if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info"))
5092
+ if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING)
5093
+ {
5094
+ objEditor.ClearInfo(); // .GetMaterial());
5095
+
5096
+ for (int i=0; i < group.selection.Size(); i++)
5097
+ {
5098
+ Object3D child = (Object3D) group.selection.get(i);
5099
+
5100
+ objEditor.AddInfo(child, this, true);
5101
+ System.err.println("info : " + child.GetPath());
5102
+ }
5103
+
5104
+ objEditor.SetText(); // jan 2014
5105
+ }
5106
+
5107
+ super.refreshContents(cp);
5108
+ }
42095109
42105110 void linkSomething(Object3D thing)
42115111 {
....@@ -4277,16 +5177,19 @@
42775177 {
42785178 if (group.selection.isEmpty())
42795179 return;
4280
- GrafreeD.clipboardIsTempGroup = false;
5180
+
5181
+ Grafreed.clipboardIsTempGroup = false;
42815182 Composite tGroup = null;
42825183 if (group.selection.size() > 0) // 1)
42835184 {
42845185 tGroup = new cGroup();
4285
- GrafreeD.clipboardIsTempGroup = true;
5186
+ Grafreed.clipboardIsTempGroup = true;
42865187 }
42875188
42885189 if (cut)
42895190 {
5191
+// if (Globals.SAVEONMAKE) // Moved to the clipboard, no need to save.
5192
+// Save();
42905193 //int indices[] = jList.getSelectedIndices();
42915194 //for (int i = indices.length - 1; i >= 0; i--)
42925195 //jList.remove(indices[i]);
....@@ -4322,16 +5225,16 @@
43225225 //System.out.println("cut " + child);
43235226 //System.out.println("parent = " + child.parent);
43245227 // tmp.addChild(child);
4325
- if (GrafreeD.clipboardIsTempGroup)
5228
+ if (Grafreed.clipboardIsTempGroup)
43265229 tGroup.add/*Child*/(tmp);
43275230 else
4328
- GrafreeD.clipboard = tmp;
5231
+ Grafreed.clipboard = tmp;
43295232 }
43305233 else
4331
- if (GrafreeD.clipboardIsTempGroup)
5234
+ if (Grafreed.clipboardIsTempGroup)
43325235 tGroup.add/*Child*/(child);
43335236 else
4334
- GrafreeD.clipboard = child;
5237
+ Grafreed.clipboard = child;
43355238 }
43365239
43375240 //ResetModel();
....@@ -4363,21 +5266,23 @@
43635266 //System.out.println("cut " + elem);
43645267 //System.out.println("parent = " + elem.parent);
43655268 // tmp.addChild(elem);
4366
- if (GrafreeD.clipboardIsTempGroup)
5269
+ if (Grafreed.clipboardIsTempGroup)
43675270 tGroup.add/*Child*/(tmp);
43685271 else
4369
- GrafreeD.clipboard = tmp;
5272
+ Grafreed.clipboard = tmp;
43705273 }
43715274 else
4372
- if (GrafreeD.clipboardIsTempGroup)
5275
+ if (Grafreed.clipboardIsTempGroup)
43735276 tGroup.add/*Child*/(child);
43745277 else
4375
- GrafreeD.clipboard = child;
5278
+ Grafreed.clipboard = child;
43765279 }
43775280
43785281 }
4379
- if (GrafreeD.clipboardIsTempGroup)
4380
- GrafreeD.clipboard = tGroup;
5282
+
5283
+ if (Grafreed.clipboardIsTempGroup)
5284
+ Grafreed.clipboard = tGroup;
5285
+
43815286 if (cut)
43825287 {
43835288 ResetModel();
....@@ -4387,11 +5292,15 @@
43875292
43885293 void paste(boolean expand)
43895294 {
5295
+ if (Globals.REPLACEONMAKE)
5296
+ Save();
5297
+ boolean keep = Globals.REPLACEONMAKE;
5298
+ Globals.REPLACEONMAKE = false;
43905299 // if (GrafreeD.clipboard == null)
43915300 // return;
43925301 boolean first = true;
43935302
4394
- if (GrafreeD.clipboardIsTempGroup)
5303
+ if (Grafreed.clipboardIsTempGroup)
43955304 {
43965305 Composite temp;
43975306
....@@ -4402,7 +5311,7 @@
44025311 temp = (Composite)Applet3D.clipboard.deepCopy();
44035312 */
44045313 Object3D elem;
4405
- for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
5314
+ for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
44065315 {
44075316 Object3D child = (Object3D)e.nextElement();
44085317
....@@ -4436,16 +5345,17 @@
44365345 //Object3D cb = Applet3D.clipboard;
44375346 //temp.addChild(cb);
44385347 //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0));
4439
- assert(GrafreeD.clipboard.parent == null);
4440
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
4441
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
4442
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
4443
- makeSomething(expand?GrafreeD.clipboard.get(0).copyExpand():GrafreeD.clipboard.get(0).deepCopy());
5348
+ assert(Grafreed.clipboard.parent == null);
5349
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
5350
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
5351
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
5352
+ makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy());
44445353 else
4445
- makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4446
- GrafreeD.clipboard.get(0).parent = keepparent;
5354
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
5355
+ Grafreed.clipboard.get(0).parent = keepparent;
44475356 }
44485357
5358
+ Globals.REPLACEONMAKE = keep;
44495359 ResetModel();
44505360 refreshContents();
44515361 }
....@@ -4492,9 +5402,9 @@
44925402 {
44935403 boolean first = true;
44945404
4495
- if (GrafreeD.clipboardIsTempGroup)
5405
+ if (Grafreed.clipboardIsTempGroup)
44965406 {
4497
- Composite temp = (Composite)GrafreeD.clipboard;
5407
+ Composite temp = (Composite)Grafreed.clipboard;
44985408 Object3D copy;
44995409 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
45005410 {
....@@ -4504,7 +5414,7 @@
45045414 }
45055415 } else
45065416 {
4507
- linkSomething(GrafreeD.clipboard); //.get(0));
5417
+ linkSomething(Grafreed.clipboard); //.get(0));
45085418 }
45095419 }
45105420 }
....@@ -4581,6 +5491,10 @@
45815491
45825492 void group(Object3D csg, boolean grab)
45835493 {
5494
+ if (Globals.REPLACEONMAKE)
5495
+ Save();
5496
+ boolean keep = Globals.REPLACEONMAKE;
5497
+ Globals.REPLACEONMAKE = false;
45845498 if (//false) // why??
45855499 !group.selection.isEmpty())
45865500 {
....@@ -4694,10 +5608,15 @@
46945608 //node.add(csg);
46955609 //makeSomething(node);
46965610 makeSomething(csg);
5611
+ Globals.REPLACEONMAKE = keep;
46975612 }
46985613
46995614 void Ungroup(Object3D g)
47005615 {
5616
+ if (Globals.REPLACEONMAKE)
5617
+ Save();
5618
+ boolean keep = Globals.REPLACEONMAKE;
5619
+ Globals.REPLACEONMAKE = false;
47015620 if (g instanceof HiddenObject)
47025621 {
47035622 HiddenObject h = (HiddenObject) g;
....@@ -4714,6 +5633,7 @@
47145633 objEditor.makeSomething(g.get(i), false);
47155634 }
47165635 }
5636
+ Globals.REPLACEONMAKE = keep;
47175637 }
47185638
47195639 void ungroup()
....@@ -4909,21 +5829,6 @@
49095829 }
49105830 */
49115831
4912
- void ImportGFD()
4913
- {
4914
- FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD);
4915
- browser.show();
4916
- String filename = browser.getFile();
4917
- if (filename != null && filename.length() > 0)
4918
- {
4919
- String fullname = browser.getDirectory() + filename;
4920
-
4921
- //Object3D readobj =
4922
- objEditor.ReadGFD(fullname, objEditor);
4923
- //makeSomething(readobj);
4924
- }
4925
- }
4926
-
49275832 /*
49285833 public void Callback(Object obj)
49295834 {
....@@ -4947,26 +5852,9 @@
49475852 }
49485853 */
49495854
4950
- void ImportVRMLX3D()
4951
- {
4952
- if (GrafreeD.standAlone)
4953
- {
4954
- /**/
4955
- FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
4956
- browser.show();
4957
- String filename = browser.getFile();
4958
- if (filename != null && filename.length() > 0)
4959
- {
4960
- String fullname = browser.getDirectory() + filename;
4961
- LoadVRMLX3D(fullname);
4962
- }
4963
- /**/
4964
- }
4965
- }
4966
-
49675855 String GetFile(String dialogName)
49685856 {
4969
- if (GrafreeD.standAlone)
5857
+ if (Grafreed.standAlone)
49705858 {
49715859 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
49725860 browser.show();
....@@ -5034,7 +5922,44 @@
50345922 cButton clearpanelButton;
50355923 cButton unselectButton;
50365924
5925
+ cButton restoreCameraButton;
5926
+
5927
+ cButton saveButton;
50375928 cButton oneStepButton;
5929
+
5930
+ cButton groupButton;
5931
+ cButton ungroupButton;
5932
+ cButton compositeButton;
5933
+ cButton switchButton;
5934
+ cButton loopButton;
5935
+ cButton textureButton;
5936
+
5937
+ cButton skybox1Button;
5938
+ cButton skybox2Button;
5939
+ cButton skybox3Button;
5940
+ cButton skybox4Button;
5941
+ cButton skybox5Button;
5942
+ cButton skybox6Button;
5943
+ cButton skybox7Button;
5944
+
5945
+ cButton skybox11Button;
5946
+ cButton skybox12Button;
5947
+ cButton skybox13Button;
5948
+ cButton skybox14Button;
5949
+ cButton skybox15Button;
5950
+ cButton skybox16Button;
5951
+ cButton skybox17Button;
5952
+
5953
+ cButton gridButton;
5954
+ cButton boxButton;
5955
+ cButton sphereButton;
5956
+ cButton coneButton;
5957
+ cButton torusButton;
5958
+ cButton superButton;
5959
+ cButton kleinButton;
5960
+ cButton particlesButton;
5961
+ cButton overlayButton;
5962
+ cButton lightButton;
50385963
50395964 cButton screenfitButton;
50405965 cButton screenfitpointButton;
....@@ -5047,14 +5972,6 @@
50475972
50485973 cButton setsupportButton;
50495974
5050
- cButton twoButton;
5051
- cButton sixButton;
5052
- cButton threeButton;
5053
- cButton sevenButton;
5054
- cButton fourButton; // full panel
5055
- cButton oneButton; // full XYZ
5056
- //cButton currentLayout;
5057
-
50585975 //
50595976 //Composite
50605977 Object3D // to do !!
....@@ -5064,9 +5981,11 @@
50645981 //JTree jTree;
50655982 private MenuItem lookAtItem;
50665983 private MenuItem lookFromItem;
5067
- private MenuItem switchItem;
5984
+ private MenuItem switchViewItem;
50685985 private MenuItem cutItem;
5069
- private MenuItem duplicateItem;
5986
+ private MenuItem undoItem;
5987
+ private MenuItem redoItem;
5988
+ private JMenuItem duplicateItem;
50705989 private MenuItem cloneItem;
50715990 private MenuItem cloneSupportItem;
50725991 private MenuItem overwriteGeoItem;
....@@ -5079,7 +5998,7 @@
50795998 private MenuItem linkverticesItem;
50805999 private MenuItem relinkverticesItem;
50816000 private MenuItem setMasterItem;
5082
- private MenuItem resetMeshItem;
6001
+ private MenuItem resetAllItem;
50836002 private MenuItem stepAllItem;
50846003 private MenuItem revertMeshItem;
50856004 private MenuItem poseMeshItem;
....@@ -5094,7 +6013,7 @@
50946013 private MenuItem pasteLinkItem;
50956014 private MenuItem pasteCloneItem;
50966015 private MenuItem pasteExpandItem;
5097
- private MenuItem clearItem;
6016
+ private MenuItem deleteItem;
50986017 private MenuItem clearAllItem;
50996018 private MenuItem genUVItem;
51006019 private MenuItem genNormalsMESHItem;
....@@ -5129,6 +6048,10 @@
51296048 private MenuItem showleavesItem;
51306049 private MenuItem markleavesItem;
51316050 private MenuItem unmarkleavesItem;
6051
+ private MenuItem rewindleavesItem;
6052
+ private MenuItem unrewindleavesItem;
6053
+ private MenuItem randomleavesItem;
6054
+ private MenuItem unrandomleavesItem;
51326055
51336056 private MenuItem flipVItem;
51346057 private MenuItem unflipVItem;
....@@ -5140,15 +6063,17 @@
51406063 private MenuItem panoTexturesItem;
51416064
51426065 private MenuItem resetCentroidItem;
5143
- private MenuItem transformgeometryItem;
6066
+ private MenuItem resetCentroidXZItem;
51446067 private MenuItem resetTransformItem;
6068
+ private MenuItem transformGeometryItem;
6069
+ private MenuItem transformChildrenItem;
51456070 private MenuItem hideItem;
51466071 private MenuItem grabItem;
51476072 private MenuItem backItem;
51486073 private MenuItem frontItem;
51496074 private MenuItem cameraItem;
51506075 private MenuItem compositeItem;
5151
- private MenuItem randomItem;
6076
+ private MenuItem switchItem;
51526077 private MenuItem physicsItem;
51536078 private MenuItem frameselectorItem;
51546079 private MenuItem scriptNodeItem;
....@@ -5172,6 +6097,8 @@
51726097 private MenuItem attachBumpItem;
51736098 private MenuItem detachBumpItem;
51746099 private MenuItem pigmentBumpItem;
6100
+ private MenuItem embedTexturesItem;
6101
+ private MenuItem deEmbedTexturesItem;
51756102
51766103 private MenuItem particleItem;
51776104 private MenuItem ragdollItem;
....@@ -5210,11 +6137,6 @@
52106137 private MenuItem doubleItem;
52116138 private MenuItem tripleItem;
52126139
5213
- private MenuItem importGFDItem;
5214
- private MenuItem importVRMLX3DItem;
5215
- private MenuItem import3DSItem;
5216
- private MenuItem importOBJItem;
5217
-
52186140 private MenuItem computeAOItem;
52196141 private MenuItem recompileItem;
52206142 private MenuItem editScriptItem;
....@@ -5224,4 +6146,8 @@
52246146 private MenuItem analyzeItem;
52256147 private MenuItem dumpItem;
52266148 //boolean freezemodel = false;
6149
+
6150
+ Menu cameraMenu;
6151
+ MenuItem editCameraItem;
6152
+ MenuItem restoreCameraItem;
52276153 }