Normand Briere
2019-07-30 475f8cbdbd96fdbf8f5b216ffebb31a51f25c2f9
GroupEditor.java
....@@ -12,9 +12,10 @@
1212 import com.jme.math.Vector3f;
1313 import com.jme.renderer.ColorRGBA;
1414
15
+import grafeme.ui.*;
1516 //import buoy.widget.BFileChooser;
1617
17
-class GroupEditor extends ObjEditor implements iParse, //iCallBack,
18
+class GroupEditor extends ObjEditor implements //iParse, //iCallBack,
1819 ObjectUI,
1920 Runnable,
2021 ActionListener,
....@@ -22,6 +23,240 @@
2223 DragGestureListener, DragSourceListener, DropTargetListener,
2324 ItemListener // ListSelectionListener
2425 {
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
+ group.skyboxname = name;
256
+ group.skyboxext = "jpg";
257
+ cameraView.repaint();
258
+ }
259
+
25260 //ObjEditor objEditor;
26261 public void closeUI2()
27262 {
....@@ -59,6 +294,12 @@
59294 this.copy = this.group = group;
60295 //selectees = this.group.selectees;
61296
297
+ if (copy.versions == null)
298
+ {
299
+ copy.versions = new byte[100][];
300
+ copy.versionindex = -1;
301
+ }
302
+
62303 if(ui)
63304 SetupUI(objEditor);
64305 }
....@@ -73,17 +314,29 @@
73314 this.copy = this.group = copy;
74315 //selectees = this.group.selectees;
75316
76
- SetupMenu2(objEditor);
317
+ SetupMenu2(this); //objEditor);
77318 SetupUI2(objEditor);
78319 objEditor.SetupUI(true);
79320 SetupViews(objEditor);
80321
81322 ((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
+ }
82331 }
83332
84333 void CloneSelection(boolean supports)
85334 {
86
- // Object3D keep = GraphreeD.clipboard;
335
+ if (Globals.REPLACEONMAKE)
336
+ Save();
337
+ boolean keep = Globals.REPLACEONMAKE;
338
+ Globals.REPLACEONMAKE = false;
339
+ // Object3D keep = GrafreeD.clipboard;
87340 //Object3D obj;
88341 for (int i=0; i<group.selection.size(); i++)// Enumeration e = group.selection.elements(); e.hasMoreElements();)
89342 {
....@@ -93,18 +346,19 @@
93346
94347 makeSomething(clone, i==group.selection.size()-1);
95348 }
349
+ Globals.REPLACEONMAKE = keep;
96350 }
97351
98352 void CloneClipboard(boolean supports)
99353 {
100
- assert(GraphreeD.clipboard.parent == null);
101
- Object3D /*Composite*/ keepparent = GraphreeD.clipboard.get(0).parent;
102
- GraphreeD.clipboard.get(0).parent = null; // Avoid copy?
103
- if (LA.isIdentity(GraphreeD.clipboard.toParent))
104
- makeSomething(CloneObject(GraphreeD.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));
105359 else
106
- makeSomething(CloneObject(GraphreeD.clipboard, false));
107
- GraphreeD.clipboard.get(0).parent = keepparent;
360
+ makeSomething(CloneObject(Grafreed.clipboard, false));
361
+ Grafreed.clipboard.get(0).parent = keepparent;
108362 }
109363
110364 static Object3D CloneObject(Object3D obj, boolean supports)
....@@ -118,7 +372,7 @@
118372 // obj.support = null;
119373 if (!supports)
120374 obj.SaveSupports();
121
- Object3D clone = (Object3D)GraphreeD.clone(obj);
375
+ Object3D clone = (Object3D)Grafreed.clone(obj);
122376 obj.parent = parent;
123377 // obj.support = support;
124378 // clone.support = support; // aout 2013
....@@ -147,30 +401,29 @@
147401
148402 //JTextField nameField;
149403
150
- void SetupMenu2(ObjEditor oe)
404
+ void SetupMenu2(GroupEditor oe)
151405 {
152
- oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
153
- //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
154
- //cameraMenu.add(switchItem = new MenuItem("Reverse View"));
155
- editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf"));
156
- oe.cameraMenu.add("-");
157
- openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy..."));
158
- openWindowItem.addActionListener(this);
159
- editLeafItem.addActionListener(this);
160
- lookAtItem.addActionListener(this);
161
- //lookFromItem.addActinoListener(this);
162
- //switchItem.addActionListener(this);
406
+ oe.jTree = new cTree();
407
+
163408 Menu menu;
164409 oe.menuBar.add(menu = new Menu("Edit"));
165410 //editItem = menu.add(new MenuItem("Edit"));
166411 //editItem.addActionListener(this);
167
- 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"));
168419 duplicateItem.addActionListener(this);
169
- menu.add("-");
170420 cloneItem = menu.add(new MenuItem("Clone"));
171421 cloneItem.addActionListener(this);
422
+ if (Globals.ADVANCED)
423
+ {
172424 cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
173425 cloneSupportItem.addActionListener(this);
426
+ }
174427 menu.add("-");
175428 cutItem = menu.add(new MenuItem("Cut"));
176429 cutItem.addActionListener(this);
....@@ -178,26 +431,123 @@
178431 copyItem.addActionListener(this);
179432 pasteItem = menu.add(new MenuItem("Paste"));
180433 pasteItem.addActionListener(this);
434
+
435
+ menu.add("-");
436
+ pasteIntoItem = menu.add(new MenuItem("Paste into"));
437
+ pasteIntoItem.addActionListener(this);
181438 pasteLinkItem = menu.add(new MenuItem("Paste link"));
182439 pasteLinkItem.addActionListener(this);
183440 pasteCloneItem = menu.add(new MenuItem("Paste clone"));
184441 pasteCloneItem.addActionListener(this);
185442 // pasteExpandItem = menu.add(new MenuItem("Paste expand"));
186443 // pasteExpandItem.addActionListener(this);
187
- clearItem = menu.add(new MenuItem("Clear"));
188
- clearItem.addActionListener(this);
444
+ menu.add("-");
445
+ deleteItem = menu.add(new MenuItem("Delete"));
446
+ deleteItem.addActionListener(this);
447
+
448
+ if (Globals.ADVANCED)
449
+ {
450
+ // Deletes the cameras...
189451 clearAllItem = menu.add(new MenuItem("Clear All"));
190452 clearAllItem.addActionListener(this);
191
- menu.add("-");
192
- resetMeshItem = menu.add(new MenuItem("Reset All"));
193
- resetMeshItem.addActionListener(this);
194
- stepAllItem = menu.add(new MenuItem("Step All"));
195
- stepAllItem.addActionListener(this);
453
+ }
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());
490
+
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
+
542
+ oe.menuBar.add(menu = new Menu("Setting"));
543
+ if (Globals.ADVANCED)
544
+ {
196545 revertMeshItem = menu.add(new MenuItem("Revert Meshes"));
197546 revertMeshItem.addActionListener(this);
198547 resetreferencesItem = menu.add(new MenuItem("Reset Mesh References"));
199548 resetreferencesItem.addActionListener(this);
200549 menu.add("-");
550
+ }
201551 overwriteGeoItem = menu.add(new MenuItem("Overwrite Geometry"));
202552 overwriteGeoItem.addActionListener(this);
203553 overwriteMatItem = menu.add(new MenuItem("Overwrite Material"));
....@@ -209,72 +559,104 @@
209559 overwriteUVItem = menu.add(new MenuItem("Overwrite UV"));
210560 overwriteUVItem.addActionListener(this);
211561 menu.add("-");
562
+ if (Globals.ADVANCED)
563
+ {
212564 generateMeshItem = menu.add(new MenuItem("Generate Meshes"));
213565 generateMeshItem.addActionListener(this);
214566 poseMeshItem = menu.add(new MenuItem("Set Pose Meshes"));
215567 poseMeshItem.addActionListener(this);
216568 menu.add("-");
569
+ }
217570 resetsupportItem = menu.add(new MenuItem("Reset support"));
218571 resetsupportItem.addActionListener(this);
219572 linkverticesItem = menu.add(new MenuItem("Link to Support"));
220573 linkverticesItem.addActionListener(this);
574
+ relinkverticesItem = menu.add(new MenuItem("Re-link to Support"));
575
+ relinkverticesItem.addActionListener(this);
576
+
577
+ if (Globals.ADVANCED)
578
+ {
221579 setMasterItem = menu.add(new MenuItem("Set Master Mesh"));
222580 setMasterItem.addActionListener(this);
581
+ }
223582
224
- oe.menuBar.add(menu = new Menu("Object"));
225
- grabItem = menu.add(new MenuItem("Grab"));
226
- grabItem.addActionListener(this);
227
- frontItem = menu.add(new MenuItem("Front"));
228
- frontItem.addActionListener(this);
583
+ oe.menuBar.add(menu = new Menu("Group"));
584
+// grabItem = menu.add(new MenuItem("Grab"));
585
+// grabItem.addActionListener(this);
229586 backItem = menu.add(new MenuItem("Back"));
230587 backItem.addActionListener(this);
231
- compositeItem = menu.add(new MenuItem("Composite"));
232
- compositeItem.addActionListener(this);
233
- menu.add("-");
234
- randomItem = menu.add(new MenuItem("Random"));
235
- randomItem.addActionListener(this);
236
- physicsItem = menu.add(new MenuItem("Physics"));
237
- physicsItem.addActionListener(this);
238
- frameselectorItem = menu.add(new MenuItem("Frame Selector"));
239
- frameselectorItem.addActionListener(this);
588
+ frontItem = menu.add(new MenuItem("Front"));
589
+ frontItem.addActionListener(this);
590
+// compositeItem = menu.add(new MenuItem("Composite"));
591
+// compositeItem.addActionListener(this);
592
+
593
+ if (Globals.ADVANCED)
594
+ {
595
+ hideItem = menu.add(new MenuItem("Hidden Group"));
596
+ hideItem.addActionListener(this);
597
+ }
598
+ ungroupItem = menu.add(new MenuItem("Ungroup"));
599
+ ungroupItem.addActionListener(this);
600
+
601
+// menu.add("-");
602
+//
603
+// switchItem = menu.add(new MenuItem("Switch node"));
604
+// switchItem.addActionListener(this);
605
+ if (Globals.ADVANCED)
606
+ {
240607 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
241608 switchGeoItem.addActionListener(this);
242609 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
243610 switchTransfoItem.addActionListener(this);
244
- morphItem = menu.add(new MenuItem("Morph"));
611
+ morphItem = menu.add(new MenuItem("Morph Group"));
245612 morphItem.addActionListener(this);
613
+
614
+ menu.add("-");
615
+ physicsItem = menu.add(new MenuItem("Physics"));
616
+ physicsItem.addActionListener(this);
617
+ frameselectorItem = menu.add(new MenuItem("Frame Selector"));
618
+ frameselectorItem.addActionListener(this);
246619 scriptNodeItem = menu.add(new MenuItem("Script Node"));
247620 scriptNodeItem.addActionListener(this);
248
- cameraItem = menu.add(new MenuItem("Camera"));
249
- cameraItem.addActionListener(this);
250
- menu.add("-");
251
- textureItem = menu.add(new MenuItem("Texture"));
252
- textureItem.addActionListener(this);
621
+ }
622
+
623
+ oe.menuBar.add(menu = new Menu("Object"));
624
+// textureItem = menu.add(new MenuItem("Texture"));
625
+// textureItem.addActionListener(this);
626
+ billboardItem = menu.add(new MenuItem("Billboard"));
627
+ billboardItem.addActionListener(this);
253628 csgItem = menu.add(new MenuItem("CSG"));
254629 csgItem.addActionListener(this);
255
- shadowXItem = menu.add(new MenuItem("Shadow X"));
630
+ shadowXItem = menu.add(new MenuItem("Shadow Red"));
256631 shadowXItem.addActionListener(this);
257
- shadowYItem = menu.add(new MenuItem("Shadow Y"));
632
+ shadowYItem = menu.add(new MenuItem("Shadow Green"));
258633 shadowYItem.addActionListener(this);
259
- shadowZItem = menu.add(new MenuItem("Shadow Z"));
634
+ shadowZItem = menu.add(new MenuItem("Shadow Blue"));
260635 shadowZItem.addActionListener(this);
636
+ attributeItem = menu.add(new MenuItem("Attribute"));
637
+ attributeItem.addActionListener(this);
638
+
639
+ if (Globals.ADVANCED)
640
+ {
641
+ menu.add("-");
261642 linkerItem = menu.add(new MenuItem("Linker"));
262643 linkerItem.addActionListener(this);
263644 templateItem = menu.add(new MenuItem("Template"));
264645 templateItem.addActionListener(this);
265
- attributeItem = menu.add(new MenuItem("Attribute"));
266
- attributeItem.addActionListener(this);
267646 pointflowItem = menu.add(new MenuItem("Point Flow"));
268647 pointflowItem.addActionListener(this);
648
+ }
269649 menu.add("-");
270
- transformgeometryItem = menu.add(new MenuItem("Transform Geometry"));
271
- transformgeometryItem.addActionListener(this);
272650 resetTransformItem = menu.add(new MenuItem("Reset Transform"));
273651 resetTransformItem.addActionListener(this);
274652 resetCentroidItem = menu.add(new MenuItem("Reset Centroid"));
275653 resetCentroidItem.addActionListener(this);
276
- ungroupItem = menu.add(new MenuItem("Ungroup"));
277
- ungroupItem.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);
278660
279661 oe.menuBar.add(menu = new Menu("Geometry"));
280662 genUVItem = menu.add(new MenuItem("Generate UV"));
....@@ -283,6 +665,13 @@
283665 genNormalsORGANItem.addActionListener(this);
284666 genNormalsCADItem = menu.add(new MenuItem("CAD Normals"));
285667 genNormalsCADItem.addActionListener(this);
668
+ genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals"));
669
+ genNormalsMESHItem.addActionListener(this);
670
+ if (Globals.ADVANCED)
671
+ {
672
+ genNormalsMINEItem = menu.add(new MenuItem("Stitch Normals"));
673
+ genNormalsMINEItem.addActionListener(this);
674
+ }
286675 stripifyItem = menu.add(new MenuItem("Stripify"));
287676 stripifyItem.addActionListener(this);
288677 unstripifyItem = menu.add(new MenuItem("Unstripify"));
....@@ -292,8 +681,6 @@
292681 untrimItem = menu.add(new MenuItem("Untrim"));
293682 untrimItem.addActionListener(this);
294683 menu.add("-");
295
- clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
296
- clearMaterialsItem.addActionListener(this);
297684 clearColorsItem = menu.add(new MenuItem("Clear AO"));
298685 clearColorsItem.addActionListener(this);
299686 reverseNormalsItem = menu.add(new MenuItem("Reverse Normals"));
....@@ -306,19 +693,34 @@
306693 reduce34MeshItem.addActionListener(this);
307694 increaseMeshItem = menu.add(new MenuItem("Increase mesh"));
308695 increaseMeshItem.addActionListener(this);
309
- smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
310
- smoothMeshItem.addActionListener(this);
311696 clipMeshItem = menu.add(new MenuItem("Clip mesh"));
312697 clipMeshItem.addActionListener(this);
698
+
699
+ if (Globals.ADVANCED)
700
+ {
701
+ smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
702
+ smoothMeshItem.addActionListener(this);
703
+ }
704
+
705
+ oe.menuBar.add(menu = new Menu("Attributes"));
706
+ clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
707
+ 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);
313712 menu.add("-");
314713 liveleavesItem = menu.add(new MenuItem("Live Leaves"));
315714 liveleavesItem.addActionListener(this);
316715 unliveleavesItem = menu.add(new MenuItem("Unlive Leaves"));
317716 unliveleavesItem.addActionListener(this);
717
+ if (Globals.ADVANCED)
718
+ {
318719 supportleavesItem = menu.add(new MenuItem("Support Leaves"));
319720 supportleavesItem.addActionListener(this);
320721 unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves"));
321722 unsupportleavesItem.addActionListener(this);
723
+ }
322724 hideleavesItem = menu.add(new MenuItem("Hide Leaves"));
323725 hideleavesItem.addActionListener(this);
324726 showleavesItem = menu.add(new MenuItem("Show Leaves"));
....@@ -327,32 +729,31 @@
327729 markleavesItem.addActionListener(this);
328730 unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves"));
329731 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);
330740 menu.add("-");
331741 flipVItem = menu.add(new MenuItem("Flip V"));
332742 flipVItem.addActionListener(this);
333743 unflipVItem = menu.add(new MenuItem("Unflip V"));
334744 unflipVItem.addActionListener(this);
335
- lowTexturesItem = menu.add(new MenuItem("Low Texture"));
745
+ lowTexturesItem = menu.add(new MenuItem("Low Texture (256)"));
336746 lowTexturesItem.addActionListener(this);
337
- normalTexturesItem = menu.add(new MenuItem("Normal Texture"));
747
+ normalTexturesItem = menu.add(new MenuItem("Normal Texture (512)"));
338748 normalTexturesItem.addActionListener(this);
339
- highTexturesItem = menu.add(new MenuItem("High Texture"));
749
+ highTexturesItem = menu.add(new MenuItem("High Texture (1024)"));
340750 highTexturesItem.addActionListener(this);
341
- veryhighTexturesItem = menu.add(new MenuItem("Very high Texture"));
751
+ veryhighTexturesItem = menu.add(new MenuItem("Very high Texture (2048)"));
342752 veryhighTexturesItem.addActionListener(this);
343
- maxTexturesItem = menu.add(new MenuItem("Max Texture"));
753
+ maxTexturesItem = menu.add(new MenuItem("Max Texture (4096)"));
344754 maxTexturesItem.addActionListener(this);
345
- panoTexturesItem = menu.add(new MenuItem("Panoramic Texture"));
755
+ panoTexturesItem = menu.add(new MenuItem("Panoramic Texture (8192)"));
346756 panoTexturesItem.addActionListener(this);
347
- menu.add("-");
348
- extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
349
- extractGeometriesItem.addActionListener(this);
350
- cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry"));
351
- cloneGeometriesItem.addActionListener(this);
352
- shareGeometriesItem = menu.add(new MenuItem("Share Geometry"));
353
- shareGeometriesItem.addActionListener(this);
354
- mergeGeometriesItem = menu.add(new MenuItem("Merge Geometry"));
355
- mergeGeometriesItem.addActionListener(this);
356757
357758 oe.menuBar.add(menu = new Menu("Selection"));
358759 attachPigmentItem = menu.add(new MenuItem("Attach Pigment..."));
....@@ -361,23 +762,56 @@
361762 attachBumpItem.addActionListener(this);
362763 pigmentBumpItem = menu.add(new MenuItem("Pigment -> Bump"));
363764 pigmentBumpItem.addActionListener(this);
765
+ //embedTexturesItem
364766 detachPigmentItem = menu.add(new MenuItem("Detach Pigment"));
365767 detachPigmentItem.addActionListener(this);
366768 detachBumpItem = menu.add(new MenuItem("Detach Bump"));
367769 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);
368774 menu.add("-");
369775 sortbysizeItem = menu.add(new MenuItem("Sort by size"));
370776 sortbysizeItem.addActionListener(this);
371777 sortbynameItem = menu.add(new MenuItem("Sort by name"));
372778 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);
784
+ if (Globals.ADVANCED)
785
+ {
786
+ // Pretty much the same as duplicate and clone.
787
+ extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
788
+ extractGeometriesItem.addActionListener(this);
789
+ cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry"));
790
+ cloneGeometriesItem.addActionListener(this);
791
+ }
792
+
373793 oe.menuBar.add(menu = new Menu("Insert"));
374794 buildCreateMenu(menu);
375
- oe.menuBar.add(menu = new Menu("Tools"));
795
+
796
+ oe.menuBar.add(menu = new Menu("Tools"));
376797 buildToolsMenu(menu);
377798 }
378799
800
+
379801 void SetupUI2(ObjEditor oe)
380802 {
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
+
381815 //new Exception().printStackTrace();
382816
383817 oe.radioPanel = new JPanel(new GridBagLayout());
....@@ -406,150 +840,238 @@
406840 oe.radioPanel.add(dummyButton);
407841 oe.buttonGroup.add(dummyButton);
408842 */
409
- aConstraints.gridy += 1;
410
- oe.aConstraints.gridwidth = 1;
411
- oe.aConstraints.gridx = 0;
843
+ cGridBag copyOptionsPanel = new cGridBag();
844
+
845
+ copyOptionsPanel.preferredHeight = 2;
412846
413
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", CameraPane.isLIVE()), oe.aConstraints);
847
+ //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
848
+
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");
414901 liveCB.addItemListener(this);
415902
416
- oe.aConstraints.gridx += 1;
417
- oe.toolbarPanel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT), oe.aConstraints);
418
- supportCB.addItemListener(this);
419
-
420
- // oe.aConstraints.gridx += 1;
421
- // oe.toolbarPanel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), oe.aConstraints);
422
- // localCB.addItemListener(this);
423
-
424
- oe.aConstraints.gridx += 1;
425
- oe.toolbarPanel.add(crowdCB = new cCheckBox("Crowd", CameraPane.CROWD), oe.aConstraints);
426
- crowdCB.addItemListener(this);
427
-
428
- oe.aConstraints.gridx += 1;
429
- oe.toolbarPanel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA), oe.aConstraints);
430
- smoothCB.addItemListener(this);
431
-
432
- oe.aConstraints.gridx += 1;
433
- oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST), oe.aConstraints);
903
+ oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
904
+ oneStepButton.setToolTipText("Animate one step forward");
905
+ oneStepButton.addActionListener(this);
906
+
907
+ oe.toolbarPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints);
908
+ fastCB.setToolTipText("Fast mode");
434909 fastCB.addItemListener(this);
435
- oe.aConstraints.gridx += 1;
436
- oe.toolbarPanel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE), oe.aConstraints);
437
- slowCB.addItemListener(this);
438
- oe.aConstraints.gridx += 1;
439
- oe.toolbarPanel.add(boxCB = new cCheckBox("Box", CameraPane.FAST), oe.aConstraints);
440
- boxCB.addItemListener(this);
910
+
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);
441916
442
-// oe.aConstraints.gridx += 1;
443
-// oe.toolbarPanel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), oe.aConstraints);
444
-// speakerMocapCB.addItemListener(this);
445
-
446
- if (false)
447
- {
448
- // handled in scripts
449
- oe.aConstraints.gridx += 1;
450
- oe.toolbarPanel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA), oe.aConstraints);
451
- speakerCameraCB.addItemListener(this);
452
-
453
- oe.aConstraints.gridx += 1;
454
- oe.toolbarPanel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS), oe.aConstraints);
455
- speakerFocusCB.addItemListener(this);
456
-
457
- oe.aConstraints.gridx += 1;
458
- oe.toolbarPanel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS), oe.aConstraints);
459
- smoothfocusCB.addItemListener(this);
460
- }
461
-
462
-//oe.aConstraints.gridx += 1;
463
-//oe.toolbarPanel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), oe.aConstraints);
464
-// debugCB.addItemListener(this);
465
-
466
- oe.aConstraints.gridx += 1;
467
- oe.toolbarPanel.add(oeilCB = new cCheckBox("O", CameraPane.OEIL), oe.aConstraints);
468
- oeilCB.addItemListener(this);
469
-
470
- oe.aConstraints.gridx += 1;
471
- oe.toolbarPanel.add(lookAtCB = new cCheckBox("T", CameraPane.LOOKAT), oe.aConstraints);
472
- lookAtCB.addItemListener(this);
473
-
474
- oe.aConstraints.gridx += 1;
475
- oe.toolbarPanel.add(trackCB = new cCheckBox(":", CameraPane.TRACK), oe.aConstraints);
476
- trackCB.addItemListener(this);
477
-
478
- oe.aConstraints.gridx += 1;
479
- oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
480
- screenfitButton.addActionListener(this);
481
- oe.aConstraints.gridx += 1;
482917 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
483918 // screenfitpointButton.addActionListener(this);
484
-// oe.aConstraints.gridx += 1;
485
- oe.toolbarPanel.add(snapobjectButton = new cButton(" O+ ")); //, oe.aConstraints);
486
- snapobjectButton.addActionListener(this);
487
- oe.aConstraints.gridx += 1;
488919
489
- //aConstraints.gridx = 0;
490
- //aConstraints.gridy += 1;
491
- oe.aConstraints.weighty = 0;
492
- oe.aConstraints.gridwidth = 1;
493
-
494
- oe.toolbarPanel.add(flashSelectionButton = new cButton(" ? ")); //, oe.aConstraints);
495
- flashSelectionButton.addActionListener(this);
496
- oe.aConstraints.gridx += 1;
497
- oe.aConstraints.weighty = 0;
498
- oe.aConstraints.gridwidth = 1;
499
-
500
- //
501
- oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints);
502
- twoButton.addActionListener(this);
503
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
920
+ if (Globals.ADVANCED)
921
+ {
922
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
923
+ snapobjectButton.addActionListener(this);
924
+ snapobjectButton.setToolTipText("Snap Object");
925
+
926
+ oe.toolbarPanel.add(fourButton = GetButton("icons/controls-horizontal.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
504927 fourButton.addActionListener(this);
505
- oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
506
- sixButton.addActionListener(this);
507
- oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
928
+ fourButton.setToolTipText("Show control panel only");
929
+ }
930
+
931
+ //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
932
+
933
+ oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
934
+ twoButton.setToolTipText("Show 3D view only");
935
+ twoButton.addActionListener(this);
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");
508940 threeButton.addActionListener(this);
509
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
510
- 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);
511947 //
512948
513
- oe.toolbarPanel.add(rootButton = new cButton(" o o o E ")); //, oe.aConstraints);
949
+ oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
950
+ rootButton.setToolTipText("Open selection in new tab");
514951 rootButton.addActionListener(this);
515
- oe.aConstraints.gridx += 1;
516
- oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
952
+
953
+ oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
954
+ closeButton.setToolTipText("Close tab");
517955 closeButton.addActionListener(this);
518956 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
519957 //clearButton.addActionListener(this);
520
- oe.aConstraints.gridx += 1;
521
-
522
- oe.aConstraints.gridx = 1; //
523
- oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints);
524
- editButton.addActionListener(this);
525
- oe.aConstraints.gridx += 1;
526
- oe.aConstraints.weighty = 0;
527
- oe.aConstraints.gridwidth = 1;
528958
529
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
959
+ cGridBag row1 = new cGridBag();
960
+
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");
1047
+ editButton.addActionListener(this);
1048
+
1049
+ editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1050
+ uneditButton.setToolTipText("Remove selection controls");
5301051 uneditButton.addActionListener(this);
5311052
532
- oe.aConstraints.gridx += 1;
533
- oe.aConstraints.weighty = 0;
534
- oe.aConstraints.gridwidth = 1;
535
-
536
- oe.treePanel.add(clearPanelButton = new cButton("C"), oe.aConstraints);
537
- clearPanelButton.addActionListener(this);
538
-
539
- oe.aConstraints.gridx += 1;
540
- oe.aConstraints.weighty = 0;
541
- oe.aConstraints.gridwidth = 1;
542
-
543
- oe.treePanel.add(allParamsButton = new cButton("A"), oe.aConstraints);
1053
+ editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
1054
+ allParamsButton.setToolTipText("Show all controle");
5441055 allParamsButton.addActionListener(this);
5451056
546
- oe.aConstraints.gridx += 1;
547
- oe.aConstraints.weighty = 0;
548
- oe.aConstraints.gridwidth = 1;
549
-
550
- oe.treePanel.add(unselectButton = new cButton("U"), oe.aConstraints);
1057
+ editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1058
+ clearPanelButton.setToolTipText("Clear edit panel");
1059
+ clearPanelButton.addActionListener(this);
1060
+
1061
+ editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1062
+ unselectButton.setToolTipText("Unselect");
5511063 unselectButton.addActionListener(this);
5521064
1065
+ editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1066
+ flashSelectionButton.setToolTipText("Highlight selection");
1067
+ flashSelectionButton.addActionListener(this);
1068
+
1069
+ editCommandsPanel.preferredHeight = 1;
1070
+
1071
+ SetPinStates(false);
1072
+// oe.treePanel.add(commandsPanel);
1073
+// oe.treePanel.Return();
1074
+
5531075 // oe.aConstraints.gridx += 1;
5541076 // oe.aConstraints.weighty = 0;
5551077 // oe.aConstraints.gridwidth = 1;
....@@ -561,47 +1083,32 @@
5611083 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
5621084 // gcButton.addActionListener(this);
5631085
564
- oe.aConstraints.gridx = 0;
565
- oe.aConstraints.gridy += 1;
566
-
567
- //ctrlPanel.add(objList = new List(5, true));
568
- oe.aConstraints.gridwidth = 100;
569
- // oe.aConstraints.gridheight = 100;
570
- oe.aConstraints.fill = GridBagConstraints.BOTH; // HORIZONTAL;
571
- oe.aConstraints.gridheight = 1;
572
- oe.aConstraints.weighty = 0.5;
573
- oe.aConstraints.gridx = 0;
574
- JScrollPane jSP;
1086
+ cGridBag jSPPanel = new cGridBag();
1087
+
1088
+ JScrollPane jSP;
5751089 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
576
- oe.treePanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null)), oe.aConstraints);
1090
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints);
5771091 ResetModel();
578
- oe.aConstraints.weighty = 0.5;
579
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
580
- oe.aConstraints.gridy += 1;
581
- oe.aConstraints.gridwidth = 1;
582
-
583
- oe.aConstraints.weighty = 0;
584
- oe.aConstraints.gridwidth = 2;
585
-
586
- oe.treePanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0), oe.aConstraints);
587
- colorCB.addItemListener(this);
588
- oe.aConstraints.gridx += 2;
589
- oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints);
590
- materialCB.addItemListener(this);
591
- oe.aConstraints.gridx += 2;
592
- oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints);
593
- textureCB.addItemListener(this);
594
-
595
- oe.aConstraints.gridx = 0;
596
- oe.aConstraints.gridy += 1;
5971092
1093
+ oe.treePanel.add(jSPPanel);
1094
+ oe.treePanel.Return();
1095
+
1096
+ oe.treePanel.add(copyOptionsPanel);
1097
+ oe.treePanel.Return();
1098
+ cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0);
1099
+ versionSlider = (cNumberSlider)sliderPane.getComponent(1);
1100
+ sliderPane.preferredHeight = 1;
1101
+
1102
+// mainPanel.setDividerLocation(0.1); //1.0);
1103
+ mainPanel.setResizeWeight(0.4);
1104
+
5981105 //jList.addListSelectionListener(this);
5991106 oe.jTree.addTreeSelectionListener(this);
6001107 //jTree.setRootVisible(false);
6011108 //jTree.setEditable(true);
6021109 oe.jTree.setDragEnabled(true);
6031110 //jTree.setPreferredSize(new Dimension(10,10));
604
- jSP.setPreferredSize(new Dimension(100,200));
1111
+ //jSP.setPreferredSize(new Dimension(100,200));
6051112
6061113 oe.jTree.setCellRenderer(new cTreeModel.Renderer());
6071114
....@@ -613,23 +1120,160 @@
6131120 dgr.addDragGestureListener(this);
6141121 }catch(Exception e) {}
6151122 */
616
- radio.layout = sevenButton;
1123
+ radio.layout = sixButton; // sevenButton;
6171124 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
6181125 }
1126
+
1127
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
1128
+ {
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
+
1143
+ panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
1144
+ boxCB.setToolTipText("Display bounding boxes");
1145
+ boxCB.addItemListener(this);
1146
+
1147
+ panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
1148
+ zoomBoxCB.setToolTipText("Display only for wheel");
1149
+ zoomBoxCB.addItemListener(this);
1150
+
1151
+ if (true) // Globals.ADVANCED)
1152
+ {
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);
1160
+
1161
+ // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
1162
+ // localCB.addItemListener(this);
1163
+
1164
+ panel.Return();
1165
+
1166
+ panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
1167
+ crowdCB.setToolTipText("Used for crowds");
1168
+ crowdCB.addItemListener(this);
1169
+
1170
+ panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
1171
+ smoothCB.setToolTipText("Snapping delay");
1172
+ smoothCB.addItemListener(this);
1173
+
1174
+ panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
1175
+ slowCB.setToolTipText("Smooth interpolation");
1176
+ slowCB.addItemListener(this);
1177
+
1178
+// constraints.gridy += 1;
1179
+// panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
1180
+// speakerMocapCB.addItemListener(this);
1181
+
1182
+ panel.Return();
1183
+
1184
+ if (false)
1185
+ {
1186
+ // handled in scripts
1187
+ //constraints.gridy += 1;
1188
+ panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints);
1189
+ speakerCameraCB.addItemListener(this);
1190
+
1191
+ //constraints.gridy += 1;
1192
+ panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints);
1193
+ speakerFocusCB.addItemListener(this);
1194
+
1195
+ //constraints.gridy += 1;
1196
+ panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
1197
+ smoothfocusCB.addItemListener(this);
1198
+ panel.Return();
1199
+ }
1200
+
1201
+//constraints.gridx += 1;
1202
+//panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
1203
+// debugCB.addItemListener(this);
1204
+
1205
+ panel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
1206
+ trackCB.setToolTipText("Enable tracking target");
1207
+ trackCB.addItemListener(this);
1208
+
1209
+ panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
1210
+ oeilCB.setToolTipText("Move camera when tracking");
1211
+ oeilCB.addItemListener(this);
1212
+
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
+ {
1233
+ panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
1234
+ lookAtCB.setToolTipText("Look-at target");
1235
+ lookAtCB.addItemListener(this);
1236
+ }
1237
+
1238
+ }
1239
+
1240
+ cGridBag fill = new cGridBag();
1241
+ fill.preferredHeight = 200;
1242
+ cGridBag fill2 = new cGridBag();
1243
+ fill2.preferredHeight = 200;
1244
+ cGridBag fill3 = new cGridBag();
1245
+ fill3.preferredHeight = 200;
1246
+
1247
+ panel.add(fill);
1248
+ panel.add(fill2);
1249
+ panel.add(fill3);
1250
+
1251
+ }
6191252
6201253 void EditObject(Object3D obj)
6211254 {
622
- cRadio dummyButton = new cRadio(obj.name);
623
- dummyButton.SetObject(obj);
624
- dummyButton.layout = sevenButton;
625
- dummyButton.SetCamera(cameraView.renderCamera, false);
626
- dummyButton.addActionListener(this);
627
- radioPanel.add(dummyButton);
628
- buttonGroup.add(dummyButton);
629
- dummyButton.doClick();
1255
+ 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
+
1264
+ radioButton.SetObject(obj);
1265
+ radioButton.layout = sixButton; // sevenButton;
1266
+ radioButton.SetCamera(cameraView.renderCamera, false);
1267
+ radioButton.addActionListener(this);
1268
+ radioPanel.add(radioButton);
1269
+ buttonGroup.add(radioButton);
1270
+ radioButton.doClick();
6301271 }
1272
+
6311273 void SetupViews(ObjEditor oe)
6321274 {
1275
+ theFrame = this;
1276
+
6331277 oe.SetupViews();
6341278
6351279 System.out.println("SetupViews");
....@@ -638,22 +1282,28 @@
6381282 /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this);
6391283 }
6401284
641
- JCheckBox liveCB;
642
- JCheckBox supportCB;
643
- JCheckBox localCB;
644
- JCheckBox crowdCB;
645
- JCheckBox smoothCB;
646
- JCheckBox fastCB;
647
- JCheckBox slowCB;
648
- JCheckBox boxCB;
649
- JCheckBox trackCB;
650
- 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;
6511298 // JCheckBox speakerMocapCB;
652
- JCheckBox speakerCameraCB;
653
- JCheckBox speakerFocusCB;
654
- JCheckBox debugCB;
655
- JCheckBox oeilCB;
656
- JCheckBox lookAtCB;
1299
+ cCheckBox speakerCameraCB;
1300
+ cCheckBox speakerFocusCB;
1301
+ cCheckBox debugCB;
1302
+
1303
+ cCheckBox oeilCB;
1304
+ cCheckBox shadowCB;
1305
+ cCheckBox autokeepCB;
1306
+ cCheckBox lookAtCB;
6571307
6581308 // static int COLOR = 1;
6591309 // static int MATERIAL = 2;
....@@ -661,9 +1311,9 @@
6611311
6621312 int dropAttributes = Object3D.COLOR | Object3D.MATERIAL;
6631313
664
- JCheckBox colorCB;
665
- JCheckBox materialCB;
666
- JCheckBox textureCB;
1314
+ cCheckBox colorCB;
1315
+ cCheckBox materialCB;
1316
+ cCheckBox textureCB;
6671317
6681318 public void itemStateChanged(ItemEvent e)
6691319 {
....@@ -688,10 +1338,10 @@
6881338 dropAttributes |= Object3D.TEXTURE;
6891339 else
6901340 dropAttributes &= ~Object3D.TEXTURE;
691
- }
692
- else if(e.getSource() == liveCB)
1341
+ } else if(e.getSource() == liveCB)
6931342 {
6941343 cameraView.ToggleLive();
1344
+ refreshContents(false);
6951345 }
6961346 else if(e.getSource() == supportCB)
6971347 {
....@@ -727,6 +1377,10 @@
7271377 cameraView.repaint();
7281378 // refreshContents();
7291379 }
1380
+ else if(e.getSource() == zoomBoxCB)
1381
+ {
1382
+ cameraView.ToggleZoomBoxMode();
1383
+ }
7301384 else if(e.getSource() == smoothfocusCB)
7311385 {
7321386 cameraView.ToggleSmoothFocus();
....@@ -752,6 +1406,18 @@
7521406 {
7531407 cameraView.ToggleOeil();
7541408 }
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
+ }
7551421 else if(e.getSource() == lookAtCB)
7561422 {
7571423 cameraView.ToggleLookAt();
....@@ -768,7 +1434,8 @@
7681434
7691435 /**/
7701436 //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this);
771
- TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1437
+ //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1438
+ TreePath path = objEditor.jTree.getSelectionPath();
7721439 if ((path == null) || (path.getPathCount() <= 1)) {
7731440 // We can't move the root node or an empty selection
7741441 return;
....@@ -831,8 +1498,6 @@
8311498 }
8321499 }
8331500
834
- String string = (String) object;
835
-
8361501 System.out.println("Transfer = " + object + "; drop : " + target);
8371502 // if( object instanceof java.io.File[])
8381503 // {
....@@ -840,7 +1505,11 @@
8401505 // objEditor.DropFile((java.io.File[]) object, true);
8411506 // return;
8421507 // }
843
- 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) == ':')
8441513 {
8451514 // file(s)
8461515 String[] names = string.split("\n");
....@@ -867,7 +1536,7 @@
8671536
8681537 flashIt = false;
8691538 CameraPane pane = (CameraPane) target;
870
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1539
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
8711540 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
8721541
8731542 if (group.selection.size() == 1)
....@@ -883,23 +1552,33 @@
8831552
8841553 assert target == objEditor.jTree;
8851554 TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y);
1555
+ Object3D destinationLeaf;
8861556 try {
887
- Object3D dummy = (Composite) destinationPath.getLastPathComponent();
1557
+ destinationLeaf = (Composite) destinationPath.getLastPathComponent();
8881558 } catch (Exception e) {
8891559 System.out.println("destinationPath : " + destinationPath);
8901560 return;
8911561 }
8921562
893
- if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1563
+ for (int i=group.selection.size(); --i>=0;)
8941564 {
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
+// {
8951574 loadClipboard(true);
8961575 objEditor.jTree.setSelectionPath(destinationPath);
897
- pasteInto(false);
898
- } else {
899
- loadClipboard(false);
900
- objEditor.jTree.setSelectionPath(destinationPath);
901
- pasteInto(false); // true); // ???
902
- }
1576
+ pasteInto(false, false);
1577
+// } else {
1578
+// loadClipboard(false);
1579
+// objEditor.jTree.setSelectionPath(destinationPath);
1580
+// pasteInto(false, false); // true); // ???
1581
+// }
9031582 }
9041583 public void dropActionChanged(DropTargetDragEvent dtde)
9051584 // Called if the user has modified the current drop gesture
....@@ -1002,90 +1681,109 @@
10021681
10031682 void buildCreateMenu(Menu menu)
10041683 {
1005
- gridItem = menu.add(new MenuItem("Grid"));
1006
- gridItem.addActionListener(this);
1007
- rectoidItem = menu.add(new MenuItem("Box"));
1008
- rectoidItem.addActionListener(this);
1009
- ellipsoidItem = menu.add(new MenuItem("Sphere"));
1010
- ellipsoidItem.addActionListener(this);
1011
- coneItem = menu.add(new MenuItem("Cone"));
1012
- coneItem.addActionListener(this);
1013
- torusItem = menu.add(new MenuItem("Torus"));
1014
- torusItem.addActionListener(this);
1015
- superItem = menu.add(new MenuItem("Superellipsoid"));
1016
- superItem.addActionListener(this);
1017
- particleItem = menu.add(new MenuItem("Particle system"));
1018
- particleItem.addActionListener(this);
1684
+ //heightFieldItem = menu.add(new MenuItem("Height Field"));
1685
+ //heightFieldItem.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
+ {
1704
+ kleinItem = menu.add(new MenuItem("Klein Bottle"));
1705
+ kleinItem.addActionListener(this);
1706
+ }
1707
+
1708
+// particleItem = menu.add(new MenuItem("Particle system"));
1709
+// particleItem.addActionListener(this);
1710
+ if (Globals.ADVANCED)
1711
+ {
10191712 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10201713 ragdollItem.addActionListener(this);
10211714 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10221715 ragdoll2Item.addActionListener(this);
1716
+ }
10231717 menu.add("-");
1024
- meshItem = menu.add(new MenuItem("Mesh"));
1718
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10251719 meshItem.addActionListener(this);
10261720 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10271721 // meshGroupItem.addActionListener(this);
1722
+ if (Globals.ADVANCED)
1723
+ {
10281724 springItem = menu.add(new MenuItem("Spring"));
10291725 springItem.addActionListener(this);
10301726 flagItem = menu.add(new MenuItem("Flag"));
10311727 flagItem.addActionListener(this);
1032
- bezierItem = menu.add(new MenuItem("Patch"));
1033
- bezierItem.addActionListener(this);
1034
- checkerItem = menu.add(new MenuItem("Checker"));
1035
- checkerItem.addActionListener(this);
10361728 blobItem = menu.add(new MenuItem("Blob"));
10371729 blobItem.addActionListener(this);
10381730 latheItem = menu.add(new MenuItem("Lathe"));
10391731 latheItem.addActionListener(this);
1040
- lightItem = menu.add(new MenuItem("Light"));
1041
- lightItem.addActionListener(this);
1732
+ }
1733
+ bezierItem = menu.add(new MenuItem("Bezier Patch"));
1734
+ bezierItem.addActionListener(this);
1735
+// overlayItem = menu.add(new MenuItem("Overlay"));
1736
+// overlayItem.addActionListener(this);
1737
+// lightItem = menu.add(new MenuItem("Light"));
1738
+// lightItem.addActionListener(this);
10421739 menu.add("-");
10431740 //superLoopItem = menu.add(new MenuItem("Super Loop"));
10441741 //superLoopItem.addActionListener(this);
1045
- loopItem = menu.add(new MenuItem("Loop"));
1046
- loopItem.addActionListener(this);
1742
+// loopItem = menu.add(new MenuItem("Loop"));
1743
+// loopItem.addActionListener(this);
10471744 doubleItem = menu.add(new MenuItem("Fork"));
10481745 doubleItem.addActionListener(this);
1746
+ if (Globals.ADVANCED)
1747
+ {
10491748 tripleItem = menu.add(new MenuItem("Trident"));
10501749 tripleItem.addActionListener(this);
1051
- menu.add("-");
1052
- importGFDItem = menu.add(new MenuItem("GraphreeD Object..."));
1053
- importGFDItem.addActionListener(this);
1054
- importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D Object..."));
1055
- importVRMLX3DItem.addActionListener(this);
1056
- importOBJItem = menu.add(new MenuItem("OBJ Object..."));
1057
- importOBJItem.addActionListener(this);
1058
- import3DSItem = menu.add(new MenuItem("3DS Object..."));
1059
- import3DSItem.addActionListener(this);
1750
+ }
10601751 }
10611752
10621753 void buildToolsMenu(Menu menu)
10631754 {
10641755 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
10651756 animationItem.addItemListener(this);
1066
- animationItem.setState(CameraPane.ANIMATION);
1757
+ animationItem.setState(Globals.ANIMATION);
1758
+
1759
+ menu.add(archiveItem = new MenuItem("Archive3D..."));
1760
+ archiveItem.addActionListener(this);
10671761
10681762 menu.add("-");
10691763 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
10701764 parseverticesItem.addActionListener(this);
1071
- alignItem = menu.add(new MenuItem("Align"));
1765
+ textureFieldItem = menu.add(new MenuItem("Texture Field"));
1766
+ textureFieldItem.addActionListener(this);
1767
+ alignItem = menu.add(new MenuItem("Align Objects"));
10721768 alignItem.addActionListener(this);
1073
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1074
- mirrorItem.addActionListener(this);
10751769 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
10761770 reduceMorphItem.addActionListener(this);
10771771 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
10781772 reduce34MorphItem.addActionListener(this);
1079
-
1080
- menu.add(computeAOItem = new MenuItem("Compute AO"));
1081
- computeAOItem.addActionListener(this);
10821773 menu.add("-");
1083
-
10841774 menu.add(memoryItem = new MenuItem("Memory Usage"));
10851775 memoryItem.addActionListener(this);
1776
+ menu.add(computeAOItem = new MenuItem("Compute AO"));
1777
+ computeAOItem.addActionListener(this);
1778
+
1779
+ if (Globals.ADVANCED)
1780
+ {
1781
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1782
+ mirrorItem.addActionListener(this);
1783
+ menu.add("-");
10861784 menu.add(analyzeItem = new MenuItem("Analyze"));
10871785 analyzeItem.addActionListener(this);
1088
- menu.add(dumpItem = new MenuItem("Dump"));
1786
+ menu.add(dumpItem = new MenuItem("Print"));
10891787 dumpItem.addActionListener(this);
10901788 // menu.add(pathItem = new MenuItem("From-to path"));
10911789 // pathItem.addActionListener(this);
....@@ -1094,6 +1792,8 @@
10941792 resetParentItem.addActionListener(this);
10951793 repairParentItem = menu.add(new MenuItem("Repair Parent"));
10961794 repairParentItem.addActionListener(this);
1795
+ repairShadowItem = menu.add(new MenuItem("Repair Shadow"));
1796
+ repairShadowItem.addActionListener(this);
10971797 menu.add(invariantsItem = new MenuItem("Invariants"));
10981798 invariantsItem.addActionListener(this);
10991799 menu.add(recompileItem = new MenuItem("Recompile"));
....@@ -1101,6 +1801,7 @@
11011801 menu.add("-");
11021802 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11031803 editScriptItem.addActionListener(this);
1804
+ }
11041805 }
11051806
11061807 void ScreenFit()
....@@ -1223,9 +1924,34 @@
12231924 shadow.material = new cMaterial(obj.material);
12241925 shadow.material.diffuse = 0.0001f;
12251926 shadow.material.specular = 0.0001f;
1927
+ //shadow.projectedVertices[1].x = 300;
12261928
12271929 makeSomething(shadow);
12281930 }
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
+ }
12291955
12301956 /**
12311957 * applyExample
....@@ -1429,9 +2155,9 @@
14292155
14302156 void Overwrite(int mask)
14312157 {
1432
- if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
2158
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14332159 {
1434
- Object3D content = GraphreeD.clipboard.get(0);
2160
+ Object3D content = Grafreed.clipboard.get(0);
14352161
14362162 if (content instanceof cGroup && ((cGroup)content).transientlink )
14372163 content = ((cGroup)content).get(0);
....@@ -1454,6 +2180,7 @@
14542180 //
14552181 public void actionPerformed(ActionEvent event) // , Object arg)
14562182 {
2183
+ Object source = event.getSource();
14572184 /*
14582185 if (event.getSource() == nameField)
14592186 {
....@@ -1465,11 +2192,11 @@
14652192 }
14662193 else
14672194 */
1468
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
2195
+ if (source == lookAtItem || source == lookFromItem)
14692196 {
14702197 ScreenFit();
14712198 } else
1472
- if (event.getSource() == switchItem)
2199
+ if (source == switchViewItem)
14732200 {
14742201 cVector v1 = new cVector();
14752202 cVector v2 = new cVector();
....@@ -1478,11 +2205,11 @@
14782205 objEditor.cameraView.renderCamera.setAim(v2, v1);
14792206 objEditor.cameraView.repaint();
14802207 } else
1481
- if (event.getSource() == rectoidItem)
2208
+ if (source == rectoidItem || source == boxButton)
14822209 {
14832210 makeSomething(new Box());
14842211 } else
1485
- if (event.getSource() == particleItem)
2212
+ if (source == particleItem || source == particlesButton)
14862213 {
14872214 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
14882215 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1503,9 +2230,9 @@
15032230 applyExample(particleGeom, "SMOKE");
15042231 makeSomething(particleGeom);
15052232 } else
1506
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
2233
+ if (source == ragdollItem || source == ragdoll2Item)
15072234 {
1508
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
2235
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15092236
15102237 ragdoll.toParent = LA.newMatrix();
15112238 ragdoll.fromParent = LA.newMatrix();
....@@ -1521,27 +2248,71 @@
15212248 makeSomething(ragdoll);
15222249 //makeSomething(new VehicleDemo());
15232250 } else
1524
- if (event.getSource() == gridItem)
2251
+ /*
2252
+ */
2253
+ if (source == heightFieldItem)
2254
+ {
2255
+ Object3D obj = new Object3D();
2256
+
2257
+ obj.CreateMaterial();
2258
+ obj.bRep = new BoundaryRep();
2259
+
2260
+ obj.bRep.CreateMesh(new iHeightField()
2261
+ {
2262
+ public double f(double x, double y)
2263
+ {
2264
+ // The Mandelbrot set is represented by coloring
2265
+ // each point (x,y) according to the number of
2266
+ // iterations it takes before the while loop in
2267
+ // this method ends. For points that are actually
2268
+ // in the Mandelbrot set, or very close to it, the
2269
+ // count will reach the maximum value, 80. These
2270
+ // points will be colored purple. All other colors
2271
+ // represent points that are definitely NOT in the set.
2272
+ x -= 600;
2273
+ y -= 500;
2274
+ x /= 200;
2275
+ y /= 200;
2276
+ int count = 0;
2277
+ double zx = x;
2278
+ double zy = y;
2279
+ while (count < 80 && Math.abs(x) < 100 && Math.abs(zy) < 100) {
2280
+ double new_zx = zx*zx - zy*zy + x;
2281
+ zy = 2*zx*zy + y;
2282
+ zx = new_zx;
2283
+ count++;
2284
+ }
2285
+ return count; // Math.sqrt(count);
2286
+ }
2287
+ }, 1000,1000);
2288
+
2289
+ makeSomething(obj);
2290
+ } else
2291
+ if (source == gridItem || source == gridButton)
15252292 {
15262293 makeSomething(new Grid());
15272294 } else
1528
- if (event.getSource() == ellipsoidItem)
2295
+ if (source == ellipsoidItem || source == sphereButton)
15292296 {
15302297 makeSomething(new Sphere());
15312298 } else
1532
- if (event.getSource() == coneItem)
2299
+ if (source == coneItem || source == coneButton)
15332300 {
15342301 makeSomething(new Cone());
15352302 } else
1536
- if (event.getSource() == torusItem)
2303
+ if (source == torusItem || source == torusButton)
15372304 {
15382305 makeSomething(new Torus());
15392306 } else
1540
- if (event.getSource() == superItem)
2307
+ if (source == superItem || source == superButton)
15412308 {
15422309 makeSomething(new Superellipsoid());
15432310 } else
1544
- if (event.getSource() == blobItem)
2311
+ if (source == kleinItem || source == kleinButton)
2312
+ {
2313
+ makeSomething(new Klein());
2314
+ } else
2315
+ if (source == blobItem)
15452316 {
15462317 Blob blob = new Blob();
15472318 BlobComponent comp = new BlobComponent();
....@@ -1549,15 +2320,15 @@
15492320 //blob.retile();
15502321 makeSomething(blob);
15512322 } else
1552
- if (event.getSource() == latheItem)
2323
+ if (source == latheItem)
15532324 {
15542325 makeSomething(new Lathe());
15552326 } else
1556
- if (event.getSource() == bezierItem)
2327
+ if (source == bezierItem)
15572328 {
15582329 makeSomething(new BezierSurface());
15592330 } else
1560
- if (event.getSource() == checkerItem)
2331
+ if (source == overlayItem || source == overlayButton)
15612332 {
15622333 /*
15632334 Object3D obj = new BezierSurface(5,8);
....@@ -1570,9 +2341,9 @@
15702341 LA.matConcat(obj.toParent, cameraView.renderCamera.fromParent, obj.toParent);
15712342 LA.matInvert(obj.toParent, obj.fromParent);
15722343 */
1573
- makeSomething(new CheckerIG());
2344
+ makeSomething(new Checker());
15742345 } else
1575
- if (event.getSource() == meshItem)
2346
+ if (source == meshItem)
15762347 {
15772348 Object3D itemtomake = new Object3D();
15782349 Object3D child;
....@@ -1593,35 +2364,52 @@
15932364 makeSomething(child);
15942365 }
15952366 } else
1596
- if (event.getSource() == springItem)
2367
+ if (source == springItem)
15972368 {
15982369 cSpring s = new cSpring();
15992370 s.setup();
16002371 makeSomething(s);
16012372 } else
1602
- if (event.getSource() == flagItem)
2373
+ if (source == flagItem)
16032374 {
16042375 cSpring s = new cFlag();
16052376 s.setup();
16062377 makeSomething(s);
16072378 } else
1608
- if (event.getSource() == lightItem)
2379
+ if (source == lightItem || source == lightButton)
16092380 {
16102381 makeSomething(new Light());
16112382 } else
1612
- if (event.getSource() == csgItem)
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
2400
+ if (source == csgItem)
16132401 {
16142402 group(new CSG());
16152403 } else
1616
- if (event.getSource() == templateItem)
2404
+ if (source == templateItem)
16172405 {
16182406 group(new cTemplate());
16192407 } else
1620
- if (event.getSource() == attributeItem)
2408
+ if (source == attributeItem)
16212409 {
16222410 makeSomething(new Attribute());
16232411 } else
1624
- if (event.getSource() == pointflowItem)
2412
+ if (source == pointflowItem)
16252413 {
16262414 makeSomething(new PointFlow());
16272415 } else
....@@ -1633,7 +2421,7 @@
16332421 } else
16342422 */
16352423
1636
- if (event.getSource() == superLoopItem)
2424
+ if (source == superLoopItem)
16372425 {
16382426 Composite g = new cGroup();
16392427 for (int i=0; i<15; i++)
....@@ -1655,30 +2443,30 @@
16552443
16562444 group(g);
16572445 } else
1658
- if (event.getSource() == loopItem)
2446
+ if (source == loopItem || source == loopButton)
16592447 {
16602448 Composite csg = new GroupLeaf();
16612449 csg.count = 5;
16622450 group(csg);
1663
- Composite child = new cGroup();
2451
+ Composite child = new cGroup("Branch");
16642452 csg.addChild(child);
16652453 child.addChild(csg);
16662454 } else
1667
- if (event.getSource() == doubleItem)
2455
+ if (source == doubleItem)
16682456 {
1669
- Composite csg = new GroupLeaf();
2457
+ Composite csg = new GroupLeaf("Fork");
16702458 csg.count = 5;
16712459 group(csg);
1672
- Composite child = new cGroup();
2460
+ Composite child = new cGroup("Branch A");
16732461 csg.addChild(child);
16742462 child.addChild(csg);
1675
- child = new cGroup();
2463
+ child = new cGroup("Branch B");
16762464 csg.addChild(child);
16772465 child.addChild(csg);
16782466 } else
1679
- if (event.getSource() == tripleItem)
2467
+ if (source == tripleItem)
16802468 {
1681
- Composite csg = new GroupLeaf();
2469
+ Composite csg = new GroupLeaf("Trident");
16822470 csg.count = 4;
16832471 group(csg);
16842472 Composite child = new cGroup();
....@@ -1691,73 +2479,98 @@
16912479 csg.addChild(child);
16922480 child.addChild(csg);
16932481 } else
1694
-
1695
- if (event.getSource() == importGFDItem)
2482
+ if (source == computeAOItem)
16962483 {
1697
- ImportGFD();
2484
+ Globals.drawMode = CameraPane.OCCLUSION;
2485
+ cameraView.repaint();
16982486 } else
1699
- if (event.getSource() == importVRMLX3DItem)
1700
- {
1701
- ImportVRMLX3D();
1702
- } else
1703
- if (event.getSource() == import3DSItem)
1704
- {
1705
- objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
1706
- } else
1707
- if (event.getSource() == importOBJItem)
1708
- {
1709
- objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1710
- } else
1711
- if (event.getSource() == computeAOItem)
1712
- {
1713
- CameraPane.drawMode = CameraPane.OCCLUSION;
1714
- CameraPane.theRenderer.repaint();
1715
- } else
1716
- if (event.getSource() == recompileItem)
2487
+ if (source == recompileItem)
17172488 {
17182489 Recompile();
17192490 refreshContents();
17202491 } else
1721
- if (event.getSource() == editScriptItem)
2492
+ if (source == editScriptItem)
17222493 {
17232494 OpenDialog();
17242495 refreshContents();
17252496 } else
1726
- if (event.getSource() == invariantsItem)
2497
+ if (source == invariantsItem)
17272498 {
17282499 System.out.println("Invariants:");
1729
- GraphreeD.theApplet3D.universe.invariants();
2500
+ Grafreed.grafreeD.universe.invariants();
17302501 } else
1731
- if (event.getSource() == memoryItem)
2502
+ if (source == memoryItem)
17322503 {
17332504 //System.out.println("Invariants:");
17342505 PrintMemory();
17352506 } else
1736
- if (event.getSource() == pathItem)
2507
+ if (source == pathItem)
17372508 {
17382509 PrintPath();
17392510 } else
1740
- if (event.getSource() == analyzeItem)
2511
+ if (source == analyzeItem)
17412512 {
17422513 AnalyzeObject();
17432514 } else
1744
- if (event.getSource() == dumpItem)
2515
+ if (source == dumpItem)
17452516 {
17462517 DumpObject();
17472518 } else
1748
- if (event.getSource() == screenfitButton)
2519
+ if (source == minButton)
17492520 {
1750
- //Reload(lastConverter, lastFilename, true);
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
2559
+ if (source == oneStepButton)
2560
+ {
2561
+ Globals.ONESTEP = true;
2562
+ cameraView.repaint();
2563
+ } else
2564
+ if (source == screenfitButton)
2565
+ {
17512566 ScreenFit();
17522567 } else
1753
- if (event.getSource() == screenfitpointButton)
2568
+ if (source == screenfitpointButton)
17542569 {
1755
- //Reload(lastConverter, lastFilename, true);
17562570 ScreenFitPoint();
17572571 } else
1758
- if (event.getSource() == snapobjectButton)
2572
+ if (source == snapobjectButton)
17592573 {
1760
- //Reload(lastConverter, lastFilename, true);
17612574 SnapObject();
17622575 } else
17632576 // if (event.getSource() == recompileButton)
....@@ -1766,13 +2579,13 @@
17662579 // Recompile();
17672580 // refreshContents();
17682581 // } else
1769
- if (event.getSource() == gcButton)
2582
+ if (source == gcButton)
17702583 {
17712584 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
17722585 System.gc();
17732586 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
17742587 } else
1775
- if (event.getSource() == editLeafItem)
2588
+ if (source == editLeafItem)
17762589 {
17772590 Object3D obj;
17782591 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1786,65 +2599,78 @@
17862599 }
17872600 refreshContents(true);
17882601 } else
1789
- if (event.getSource() == openWindowItem)
2602
+ if (source == openWindowItem)
17902603 {
17912604 EditSelection(true);
17922605 } else
1793
- if (event.getSource() == cutItem || event.getSource() == clearButton)
2606
+ if (source == cutItem || source == clearButton)
17942607 {
17952608 loadClipboard(true);
17962609 } else
1797
- if (event.getSource() == duplicateItem)
2610
+ if (source == undoItem)
17982611 {
1799
- Object3D keep = GraphreeD.clipboard;
2612
+ Undo();
2613
+ } else
2614
+ if (source == redoItem)
2615
+ {
2616
+ Redo();
2617
+ } else
2618
+ if (source == duplicateItem)
2619
+ {
2620
+ Object3D keep = Grafreed.clipboard;
18002621 loadClipboard(false);
18012622 paste(false);
1802
- GraphreeD.clipboard = keep;
2623
+ Grafreed.clipboard = keep;
18032624 } else
1804
- if (event.getSource() == cloneItem)
2625
+ if (source == cloneItem)
18052626 {
18062627 CloneSelection(false);
18072628 } else
1808
- if (event.getSource() == cloneSupportItem)
2629
+ if (source == cloneSupportItem)
18092630 {
18102631 CloneSelection(true);
18112632 } else
1812
- if (event.getSource() == copyItem)
2633
+ if (source == copyItem)
18132634 {
18142635 loadClipboard(false);
18152636 } else
1816
- if (event.getSource() == pasteItem)
2637
+ if (source == pasteItem)
18172638 {
18182639 paste(false);
18192640 } else
1820
- if (event.getSource() == pasteLinkItem)
2641
+ if (source == pasteIntoItem)
18212642 {
1822
- pasteInto(false);
2643
+ pasteInto(true, false);
18232644 } else
1824
- if (event.getSource() == pasteCloneItem)
2645
+ if (source == pasteLinkItem)
18252646 {
1826
- pasteInto(true);
2647
+ pasteInto(false, false);
18272648 } else
1828
- if (event.getSource() == pasteExpandItem)
2649
+ if (source == pasteCloneItem)
2650
+ {
2651
+ pasteInto(true, true);
2652
+ } else
2653
+ if (source == pasteExpandItem)
18292654 {
18302655 paste(true);
18312656 } else
1832
- if (event.getSource() == synchronizeItem)
2657
+ if (source == synchronizeItem)
18332658 {
18342659 Overwrite(Object3D.TRANSFORM);
18352660 } else
1836
- if (event.getSource() == overwriteNameItem)
2661
+ if (source == overwriteNameItem)
18372662 {
18382663 Overwrite(Object3D.NAME);
18392664 } else
1840
- if (event.getSource() == overwriteUVItem)
2665
+ if (source == overwriteUVItem)
18412666 {
18422667 Overwrite(Object3D.UV);
18432668 } else
1844
- if (event.getSource() == overwriteMatItem)
2669
+ if (source == overwriteMatItem)
18452670 {
2671
+ /* july 2015
18462672 if ((dropAttributes & Object3D.TEXTURE) == 0)
1847
- Overwrite(Object3D.MATERIAL);
2673
+ Overwrite(Object3D.MATERIAL | Object3D.COLOR);
18482674 else
18492675 {
18502676 if ((dropAttributes & Object3D.COLOR) == 0 && (dropAttributes & Object3D.MATERIAL) == 0)
....@@ -1856,13 +2682,16 @@
18562682 Overwrite(Object3D.MATERIAL | Object3D.TEXTURE);
18572683 }
18582684 }
2685
+ */
2686
+
2687
+ Overwrite(dropAttributes);
18592688 }
1860
- if (event.getSource() == overwriteGeoItem)
2689
+ if (source == overwriteGeoItem)
18612690 {
18622691 Overwrite(Object3D.GEOMETRY);
1863
-// if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
2692
+// if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
18642693 // {
1865
-// Object3D content = GraphreeD.clipboard.get(0);
2694
+// Object3D content = GrafreeD.clipboard.get(0);
18662695 //
18672696 // if (content instanceof cGroup && ((cGroup)content).transientlink )
18682697 // content = ((cGroup)content).get(0);
....@@ -1874,7 +2703,7 @@
18742703 // refreshContents();
18752704 // }
18762705 } else
1877
- if (event.getSource() == generateMeshItem)
2706
+ if (source == generateMeshItem)
18782707 {
18792708 //if (group.selection.size() == 1)
18802709 // for (int i=0; i<group.selection.size(); i++)
....@@ -1885,7 +2714,7 @@
18852714 ResetModel();
18862715 refreshContents();
18872716 } else
1888
- if (event.getSource() == extractGeometriesItem)
2717
+ if (source == extractGeometriesItem)
18892718 {
18902719 boolean one = false;
18912720
....@@ -1912,7 +2741,7 @@
19122741 ResetModel();
19132742 refreshContents();
19142743 } else
1915
- if (event.getSource() == cloneGeometriesItem)
2744
+ if (source == cloneGeometriesItem)
19162745 {
19172746 boolean one = false;
19182747
....@@ -1938,32 +2767,37 @@
19382767 ResetModel();
19392768 refreshContents();
19402769 } else
1941
- if (event.getSource() == shareGeometriesItem)
2770
+ if (source == shareGeometriesItem)
19422771 {
19432772 boolean one = false;
19442773
19452774 if (group.selection.size() == 1)
19462775 one = true;
19472776
2777
+ Object3D merge = null;
2778
+
19482779 Object3D content = new cGroup();
19492780
19502781 for (int i=0; i<group.selection.size(); i++)
19512782 {
1952
- Object3D sel = new Merge(group.selection.get(i));
2783
+ merge = new Merge(group.selection.get(i));
19532784
19542785 if (one)
1955
- makeSomething(sel, false);
2786
+ makeSomething(merge, false);
19562787 else
1957
- content.addChild(sel);
2788
+ content.addChild(merge);
19582789 }
19592790
19602791 if (!one)
1961
- makeSomething(content, false);
1962
-
1963
- ResetModel();
1964
- refreshContents();
2792
+ makeSomething(content, true);
2793
+ else
2794
+ {
2795
+ ResetModel();
2796
+ Select(merge.GetTreePath(), true, false); // unselect... false);
2797
+ refreshContents();
2798
+ }
19652799 } else
1966
- if (event.getSource() == mergeGeometriesItem)
2800
+ if (source == mergeGeometriesItem)
19672801 {
19682802 boolean one = false;
19692803
....@@ -1993,11 +2827,11 @@
19932827 ResetModel();
19942828 refreshContents();
19952829 } else
1996
- if (event.getSource() == linkverticesItem)
2830
+ if (source == linkverticesItem)
19972831 {
1998
-// if (group.selection.size() == 1 && GraphreeD.clipboard.size() == 1)
2832
+// if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
19992833 // {
2000
-// Object3D content = GraphreeD.clipboard.get(0);
2834
+// Object3D content = GrafreeD.clipboard.get(0);
20012835 //
20022836 // if (content instanceof cGroup && ((cGroup)content).transientlink )
20032837 // content = ((cGroup)content).get(0);
....@@ -2006,39 +2840,48 @@
20062840 // group.selection.get(0).setMasterThis(content); // should be identity
20072841 // refreshContents();
20082842 // }
2009
- if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
2843
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
20102844 {
2011
- Object3D content = GraphreeD.clipboard.get(0);
2845
+ Object3D content = Grafreed.clipboard.get(0);
20122846
20132847 if (content instanceof cGroup && ((cGroup)content).transientlink )
20142848 content = ((cGroup)content).get(0);
20152849
2016
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
2850
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
20172851 for (int i=0; i<group.selection.size(); i++)
20182852 {
2019
- boolean random = CameraPane.RANDOM;
2020
- CameraPane.RANDOM = false; // parse all random nodes
2853
+ boolean random = CameraPane.SWITCH;
2854
+ CameraPane.SWITCH = false; // parse all random nodes
20212855 group.selection.get(i).linkVerticesThis(content);
20222856 // group.selection.get(i).setMasterThis(content); // should be identity
2023
- CameraPane.RANDOM = random;
2857
+ CameraPane.SWITCH = random;
20242858 }
2025
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
2859
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
20262860 refreshContents();
20272861 }
20282862 } else
2029
- if (event.getSource() == resetsupportItem)
2863
+ if (source == resetsupportItem)
20302864 {
20312865 for (int i=0; i<group.selection.size(); i++)
20322866 {
2033
- boolean random = CameraPane.RANDOM;
2034
- CameraPane.RANDOM = false; // parse all random nodes
2867
+ boolean random = CameraPane.SWITCH;
2868
+ CameraPane.SWITCH = false; // parse all random nodes
20352869 group.selection.get(i).linkVerticesThis(null);
2036
- CameraPane.RANDOM = random;
2870
+ CameraPane.SWITCH = random;
20372871 }
20382872
20392873 refreshContents();
20402874 } else
2041
- if (event.getSource() == resetreferencesItem)
2875
+ if (source == relinkverticesItem)
2876
+ {
2877
+ boolean random = CameraPane.SWITCH;
2878
+ CameraPane.SWITCH = false; // parse all random nodes
2879
+ group.selection.RelinkToSupport();
2880
+ CameraPane.SWITCH = random;
2881
+
2882
+ refreshContents();
2883
+ } else
2884
+ if (source == resetreferencesItem)
20422885 {
20432886 for (int i=0; i<group.selection.size(); i++)
20442887 {
....@@ -2047,11 +2890,11 @@
20472890
20482891 refreshContents();
20492892 } else
2050
- if (event.getSource() == setMasterItem)
2893
+ if (source == setMasterItem)
20512894 {
2052
- if (group.selection.size() == 1 && GraphreeD.clipboard.size() == 1)
2895
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
20532896 {
2054
- Object3D content = GraphreeD.clipboard.get(0);
2897
+ Object3D content = Grafreed.clipboard.get(0);
20552898
20562899 if (content instanceof cGroup && ((cGroup)content).transientlink )
20572900 content = ((cGroup)content).get(0);
....@@ -2060,13 +2903,13 @@
20602903 refreshContents();
20612904 }
20622905 } else
2063
- if (event.getSource() == poseMeshItem)
2906
+ if (source == poseMeshItem)
20642907 {
20652908 if (group.selection.size() == 1)
20662909 {
2067
- if (GraphreeD.clipboard.size() == 1)
2910
+ if (Grafreed.clipboard.size() == 1)
20682911 {
2069
- Object3D content = GraphreeD.clipboard.get(0);
2912
+ Object3D content = Grafreed.clipboard.get(0);
20702913
20712914 if (content instanceof cGroup && ((cGroup)content).transientlink )
20722915 content = ((cGroup)content).get(0);
....@@ -2079,19 +2922,19 @@
20792922 }
20802923
20812924 } else
2082
- if (event.getSource() == revertMeshItem)
2925
+ if (source == revertMeshItem)
20832926 {
20842927 RevertMeshes();
20852928 } else
2086
- if (event.getSource() == resetMeshItem)
2929
+ if (source == resetAllItem)
20872930 {
20882931 ResetAll();
20892932 } else
2090
- if (event.getSource() == stepAllItem)
2933
+ if (source == stepAllItem)
20912934 {
20922935 StepAll();
20932936 } else
2094
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2937
+ if (source == deleteItem) // || event.getSource() == clearButton)
20952938 {
20962939 //int indices[] = jList.getSelectedIndices();
20972940 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2099,42 +2942,46 @@
20992942
21002943 ClearSelection(false);
21012944 } else
2102
- if (event.getSource() == clearAllItem)
2945
+ if (source == clearAllItem)
21032946 {
21042947 ClearSelection(true);
21052948 } else
2106
- if (event.getSource() == grabItem)
2949
+ if (source == grabItem || source == groupButton)
21072950 {
2108
- group(new cGroup(), true);
2951
+ group(new cGroup(), false); // true);
21092952 } else
2110
- if (event.getSource() == frontItem)
2953
+ if (source == hideItem)
2954
+ {
2955
+ group(new HiddenObject());
2956
+ } else
2957
+ if (source == frontItem)
21112958 {
21122959 front();
21132960 } else
2114
- if (event.getSource() == backItem)
2961
+ if (source == backItem)
21152962 {
21162963 back();
21172964 } else
2118
- if (event.getSource() == cameraItem)
2965
+ if (source == cameraItem)
21192966 {
21202967 makeSomething(new Camera());
21212968 } else
2122
- if (event.getSource() == compositeItem)
2969
+ if (source == compositeItem || source == compositeButton)
21232970 {
21242971 group(new Composite());
21252972 } else
2126
- if (event.getSource() == randomItem)
2973
+ if (source == switchItem || source == switchButton)
21272974 {
21282975 RandomNode random = new RandomNode();
21292976 group(random);
21302977 if (random.size() > 0)
2131
- random.name = random.get(0).name + "Rnd";
2978
+ random.name = random.get(0).name + "Switch";
21322979 } else
2133
- if (event.getSource() == physicsItem)
2980
+ if (source == physicsItem)
21342981 {
21352982 group(new PhysicsNode());
21362983 } else
2137
- if (event.getSource() == frameselectorItem)
2984
+ if (source == frameselectorItem)
21382985 {
21392986 for (int i=0; i<group.selection.size(); i++)
21402987 {
....@@ -2146,7 +2993,7 @@
21462993 ResetModel();
21472994 refreshContents();
21482995 } else
2149
- if (event.getSource() == switchGeoItem)
2996
+ if (source == switchGeoItem)
21502997 {
21512998 for (int i=0; i<group.selection.size(); i++)
21522999 {
....@@ -2158,7 +3005,7 @@
21583005 ResetModel();
21593006 refreshContents();
21603007 } else
2161
- if (event.getSource() == switchTransfoItem)
3008
+ if (source == switchTransfoItem)
21623009 {
21633010 for (int i=0; i<group.selection.size(); i++)
21643011 {
....@@ -2170,7 +3017,7 @@
21703017 ResetModel();
21713018 refreshContents();
21723019 } else
2173
- if (event.getSource() == morphItem)
3020
+ if (source == morphItem)
21743021 {
21753022 for (int i=0; i<group.selection.size(); i++)
21763023 {
....@@ -2182,7 +3029,7 @@
21823029 ResetModel();
21833030 refreshContents();
21843031 } else
2185
- if (event.getSource() == scriptNodeItem)
3032
+ if (source == scriptNodeItem)
21863033 {
21873034 boolean atleastone = false;
21883035
....@@ -2221,191 +3068,252 @@
22213068 }
22223069 }
22233070 } else
2224
- if (event.getSource() == linkerItem)
3071
+ if (source == linkerItem)
22253072 {
22263073 group(new cLinker());
22273074 } else
2228
- if (event.getSource() == textureItem)
3075
+ if (source == textureItem || source == textureButton)
22293076 {
22303077 group(new TextureNode());
22313078 } else
2232
- if (event.getSource() == shadowXItem)
3079
+ if (source == billboardItem)
3080
+ {
3081
+ group(new BillboardNode());
3082
+ } else
3083
+ if (source == shadowXItem)
22333084 {
22343085 CastShadow(0);
22353086 } else
2236
- if (event.getSource() == shadowYItem)
3087
+ if (source == shadowYItem)
22373088 {
22383089 CastShadow(1);
22393090 } else
2240
- if (event.getSource() == shadowZItem)
3091
+ if (source == shadowZItem)
22413092 {
22423093 CastShadow(2);
22433094 } else
2244
- if (event.getSource() == ungroupItem)
3095
+ if (source == ungroupItem || source == ungroupButton)
22453096 {
2246
- ungroup();
3097
+ boolean hasRoot = false;
3098
+
3099
+ for (int i=0; i<group.selection.size(); i++)
3100
+ {
3101
+ if (group.selection.get(i) == group)
3102
+ {
3103
+ hasRoot = true;
3104
+ break;
3105
+ }
3106
+ }
3107
+
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
+ }
22473119 } else
2248
- if (event.getSource() == genUVItem)
3120
+ if (source == genUVItem)
22493121 {
22503122 GenUV();
22513123 } else
2252
- if (event.getSource() == genNormalsCADItem)
3124
+ if (source == genNormalsCADItem)
22533125 {
22543126 GenNormals(true);
22553127 } else
2256
- if (event.getSource() == genNormalsORGANItem)
3128
+ if (source == genNormalsMESHItem)
3129
+ {
3130
+ GenNormalsMESH();
3131
+ } else
3132
+ if (source == genNormalsORGANItem)
22573133 {
22583134 GenNormals(false);
22593135 } else
2260
- if (event.getSource() == stripifyItem)
3136
+ if (source == genNormalsMINEItem)
3137
+ {
3138
+ GenNormalsMINE();
3139
+ } else
3140
+ if (source == stripifyItem)
22613141 {
22623142 Stripify();
22633143 } else
2264
- if (event.getSource() == unstripifyItem)
3144
+ if (source == unstripifyItem)
22653145 {
22663146 Unstripify();
22673147 } else
2268
- if (event.getSource() == trimItem)
3148
+ if (source == trimItem)
22693149 {
22703150 Trim();
22713151 } else
2272
- if (event.getSource() == untrimItem)
3152
+ if (source == untrimItem)
22733153 {
22743154 Untrim();
22753155 } else
2276
- if (event.getSource() == clearColorsItem)
3156
+ if (source == clearColorsItem)
22773157 {
22783158 ClearColors();
22793159 } else
2280
- if (event.getSource() == clearMaterialsItem)
3160
+ if (source == clearMaterialsItem)
22813161 {
22823162 ClearMaterials();
22833163 } else
2284
- if (event.getSource() == liveleavesItem)
3164
+ if (source == liveleavesItem)
22853165 {
22863166 LiveLeaves(true);
22873167 } else
2288
- if (event.getSource() == unliveleavesItem)
3168
+ if (source == unliveleavesItem)
22893169 {
22903170 LiveLeaves(false);
22913171 } else
2292
- if (event.getSource() == supportleavesItem)
3172
+ if (source == supportleavesItem)
22933173 {
22943174 SupportLeaves(true);
22953175 } else
2296
- if (event.getSource() == unsupportleavesItem)
3176
+ if (source == unsupportleavesItem)
22973177 {
22983178 SupportLeaves(false);
22993179 } else
2300
- if (event.getSource() == hideleavesItem)
3180
+ if (source == hideleavesItem)
23013181 {
23023182 HideLeaves(true);
23033183 } else
2304
- if (event.getSource() == showleavesItem)
3184
+ if (source == showleavesItem)
23053185 {
23063186 HideLeaves(false);
23073187 } else
2308
- if (event.getSource() == markleavesItem)
3188
+ if (source == markleavesItem)
23093189 {
23103190 MarkLeaves(true);
23113191 } else
2312
- if (event.getSource() == unmarkleavesItem)
3192
+ if (source == unmarkleavesItem)
23133193 {
23143194 MarkLeaves(false);
23153195 } else
2316
- if (event.getSource() == flipVItem)
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);
3211
+ } else
3212
+ if (source == flipVItem)
23173213 {
23183214 FlipV(true);
23193215 } else
2320
- if (event.getSource() == unflipVItem)
3216
+ if (source == unflipVItem)
23213217 {
23223218 FlipV(false);
23233219 } else
2324
- if (event.getSource() == lowTexturesItem)
3220
+ if (source == lowTexturesItem)
23253221 {
23263222 SetTexRes(0);
23273223 } else
2328
- if (event.getSource() == normalTexturesItem)
3224
+ if (source == normalTexturesItem)
23293225 {
23303226 SetTexRes(1);
23313227 } else
2332
- if (event.getSource() == highTexturesItem)
3228
+ if (source == highTexturesItem)
23333229 {
23343230 SetTexRes(2);
23353231 } else
2336
- if (event.getSource() == veryhighTexturesItem)
3232
+ if (source == veryhighTexturesItem)
23373233 {
23383234 SetTexRes(3);
23393235 } else
2340
- if (event.getSource() == maxTexturesItem)
3236
+ if (source == maxTexturesItem)
23413237 {
23423238 SetTexRes(4);
23433239 } else
2344
- if (event.getSource() == panoTexturesItem)
3240
+ if (source == panoTexturesItem)
23453241 {
23463242 SetTexRes(5);
23473243 } else
2348
- if (event.getSource() == reverseNormalsItem)
3244
+ if (source == reverseNormalsItem)
23493245 {
23503246 ReverseNormals();
23513247 } else
2352
- if (event.getSource() == parseverticesItem)
3248
+ if (source == parseverticesItem)
23533249 {
23543250 ParseVertices();
23553251 } else
2356
- if (event.getSource() == alignItem)
3252
+ if (source == textureFieldItem)
3253
+ {
3254
+ TextureVertices();
3255
+ } else
3256
+ if (source == alignItem)
23573257 {
23583258 Align();
23593259 } else
2360
- if (event.getSource() == mirrorItem)
3260
+ if (source == mirrorItem)
23613261 {
23623262 MirrorPoses();
23633263 } else
2364
- if (event.getSource() == reduceMorphItem)
3264
+ if (source == reduceMorphItem)
23653265 {
23663266 MeshReduction(false);
23673267 } else
2368
- if (event.getSource() == reduce34MorphItem)
3268
+ if (source == reduce34MorphItem)
23693269 {
23703270 MeshReduction(true);
23713271 } else
2372
- if (event.getSource() == reverseTrianglesItem)
3272
+ if (source == reverseTrianglesItem)
23733273 {
23743274 ReverseTriangles();
23753275 } else
2376
- if (event.getSource() == reduceMeshItem)
3276
+ if (source == reduceMeshItem)
23773277 {
23783278 ReduceMesh(false);
23793279 } else
2380
- if (event.getSource() == reduce34MeshItem)
3280
+ if (source == reduce34MeshItem)
23813281 {
23823282 ReduceMesh(true);
23833283 } else
2384
- if (event.getSource() == increaseMeshItem)
3284
+ if (source == increaseMeshItem)
23853285 {
23863286 IncreaseMesh();
23873287 } else
2388
- if (event.getSource() == clipMeshItem)
3288
+ if (source == clipMeshItem)
23893289 {
23903290 ClipMesh();
23913291 } else
2392
- if (event.getSource() == smoothMeshItem)
3292
+ if (source == smoothMeshItem)
23933293 {
23943294 SmoothMesh();
23953295 } else
2396
- if (event.getSource() == transformgeometryItem)
3296
+ if (source == transformGeometryItem)
23973297 {
23983298 TransformGeometry();
23993299 } else
2400
- if (event.getSource() == resetTransformItem)
3300
+ if (source == transformChildrenItem)
3301
+ {
3302
+ TransformChildren();
3303
+ } else
3304
+ if (source == resetTransformItem)
24013305 {
24023306 ResetTransform();
24033307 } else
2404
- if (event.getSource() == resetCentroidItem)
3308
+ if (source == resetCentroidItem)
24053309 {
2406
- ResetCentroid();
3310
+ ResetCentroid(true);
24073311 } else
2408
- if (event.getSource() == resetParentItem)
3312
+ if (source == resetCentroidXZItem)
3313
+ {
3314
+ ResetCentroid(false);
3315
+ } else
3316
+ if (source == resetParentItem)
24093317 {
24103318 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24113319 {
....@@ -2415,7 +3323,7 @@
24153323
24163324 refreshContents();
24173325 } else
2418
- if (event.getSource() == repairParentItem)
3326
+ if (source == repairParentItem)
24193327 {
24203328 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24213329 {
....@@ -2429,7 +3337,21 @@
24293337
24303338 refreshContents();
24313339 } else
2432
- if (event.getSource() == sortbysizeItem)
3340
+ if (source == repairShadowItem)
3341
+ {
3342
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3343
+ {
3344
+ Object3D obj = (Object3D)e.nextElement();
3345
+ obj.RepairShadow();
3346
+// for (int i=0; i<obj.size(); i++)
3347
+// {
3348
+// obj.get(i).parent = obj;
3349
+// }
3350
+ }
3351
+
3352
+ refreshContents();
3353
+ } else
3354
+ if (source == sortbysizeItem)
24333355 {
24343356 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24353357 {
....@@ -2441,7 +3363,7 @@
24413363 ResetModel();
24423364 refreshContents();
24433365 } else
2444
- if (event.getSource() == sortbynameItem)
3366
+ if (source == sortbynameItem)
24453367 {
24463368 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24473369 {
....@@ -2453,7 +3375,7 @@
24533375 ResetModel();
24543376 refreshContents();
24553377 } else
2456
- if (event.getSource() == attachPigmentItem)
3378
+ if (source == attachPigmentItem)
24573379 {
24583380 String texture = GetFile("Attach pigment");
24593381 Object3D obj;
....@@ -2465,7 +3387,7 @@
24653387
24663388 refreshContents();
24673389 } else
2468
- if (event.getSource() == detachPigmentItem)
3390
+ if (source == detachPigmentItem)
24693391 {
24703392 Object3D obj;
24713393 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2476,7 +3398,7 @@
24763398
24773399 refreshContents();
24783400 } else
2479
- if (event.getSource() == attachBumpItem)
3401
+ if (source == attachBumpItem)
24803402 {
24813403 String texture = GetFile("Attach bump");
24823404 Object3D obj;
....@@ -2488,18 +3410,18 @@
24883410
24893411 refreshContents();
24903412 } else
2491
- if (event.getSource() == detachBumpItem)
3413
+ if (source == detachBumpItem)
24923414 {
24933415 Object3D obj;
24943416 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24953417 {
24963418 obj = (Object3D)e.nextElement();
2497
- obj.SetBumpTexture(null);
3419
+ obj.ResetBumpTexture();
24983420 }
24993421
25003422 refreshContents();
25013423 } else
2502
- if (event.getSource() == pigmentBumpItem)
3424
+ if (source == pigmentBumpItem)
25033425 {
25043426 Object3D obj;
25053427 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2510,158 +3432,262 @@
25103432
25113433 refreshContents();
25123434 } else
2513
- if (event.getSource() == flashSelectionButton)
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
3460
+ if (source == flashSelectionButton)
25143461 {
25153462 CameraPane.flash = true;
25163463 refreshContents();
25173464 } else
2518
- if (event.getSource() == oneButton)
3465
+ if (source == oneButton)
25193466 {
25203467 } else
2521
- if (event.getSource() == twoButton)
3468
+ if (source == twoButton)
25223469 {
25233470 radio.layout = twoButton;
3471
+
3472
+ if (CameraPane.FULLSCREEN)
3473
+ fullscreenLayout = radio.layout;
3474
+
25243475 // bug
25253476 //gridPanel.setDividerLocation(1.0);
25263477 //bigPanel.setDividerLocation(0.0);
2527
- bigThree.remove(jtp);
2528
- bigThree.remove(cameraPanel);
2529
- bigThree.remove(XYZPanel);
2530
- aWindowConstraints.gridx = 0;
2531
- aWindowConstraints.gridy = 0;
2532
- aWindowConstraints.gridwidth = 1;
2533
- // aConstraints.gridheight = 3;
2534
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2535
- aWindowConstraints.weightx = 0;
2536
- aWindowConstraints.weighty = 1;
2537
- //bigThree.add(jtp, aWindowConstraints);
2538
- aWindowConstraints.weightx = 1;
2539
- aWindowConstraints.gridwidth = 3;
2540
- // aConstraints.gridheight = 3;
2541
- aWindowConstraints.gridx = 1;
2542
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2543
- bigThree.add(cameraPanel, aWindowConstraints);
2544
- aWindowConstraints.weightx = 0;
2545
- aWindowConstraints.gridx = 4;
2546
- aWindowConstraints.gridwidth = 1;
2547
- // aConstraints.gridheight = 3;
2548
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2549
- //bigThree.add(XYZPanel, aWindowConstraints);
2550
- bigThree.revalidate();
3478
+// bigThree.remove(scenePanel);
3479
+// bigThree.remove(centralPanel);
3480
+// bigThree.remove(XYZPanel);
3481
+// aWindowConstraints.gridx = 0;
3482
+// aWindowConstraints.gridy = 0;
3483
+// aWindowConstraints.gridwidth = 1;
3484
+// // aConstraints.gridheight = 3;
3485
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3486
+// aWindowConstraints.weightx = 0;
3487
+// aWindowConstraints.weighty = 1;
3488
+// //bigThree.add(jtp, aWindowConstraints);
3489
+// aWindowConstraints.weightx = 1;
3490
+// aWindowConstraints.gridwidth = 3;
3491
+// // aConstraints.gridheight = 3;
3492
+// aWindowConstraints.gridx = 1;
3493
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3494
+// bigThree.add(centralPanel, aWindowConstraints);
3495
+// aWindowConstraints.weightx = 0;
3496
+// aWindowConstraints.gridx = 4;
3497
+// aWindowConstraints.gridwidth = 1;
3498
+// // aConstraints.gridheight = 3;
3499
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3500
+// //bigThree.add(XYZPanel, aWindowConstraints);
3501
+// scenePanel.setVisible(false);
3502
+// centralPanel.setVisible(true);
3503
+// XYZPanel.setVisible(false);
3504
+ bigThree.ClearUI();
3505
+ bigThree.add(centralPanel);
3506
+ 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
+
25513525 } else
2552
- if (event.getSource() == threeButton)
3526
+ if (source == threeButton)
25533527 {
25543528 radio.layout = threeButton;
2555
- bigThree.remove(jtp);
2556
- bigThree.remove(cameraPanel);
2557
- bigThree.remove(XYZPanel);
2558
- aWindowConstraints.gridx = 0;
2559
- aWindowConstraints.gridy = 0;
2560
- aWindowConstraints.gridwidth = 1;
2561
- // aConstraints.gridheight = 3;
2562
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2563
- aWindowConstraints.weightx = 0;
2564
- aWindowConstraints.weighty = 1;
2565
- //bigThree.add(jtp, aWindowConstraints);
2566
- aWindowConstraints.weightx = 1;
2567
- aWindowConstraints.gridwidth = 3;
2568
- // aConstraints.gridheight = 3;
2569
- aWindowConstraints.gridx = 1;
2570
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2571
- bigThree.add(cameraPanel, aWindowConstraints);
2572
- aWindowConstraints.weightx = 0;
2573
- aWindowConstraints.gridx = 4;
2574
- aWindowConstraints.gridwidth = 1;
2575
- // aConstraints.gridheight = 3;
2576
- aConstraints.fill = GridBagConstraints.VERTICAL;
2577
- bigThree.add(XYZPanel, aWindowConstraints);
2578
- bigThree.revalidate();
3529
+
3530
+ if (CameraPane.FULLSCREEN)
3531
+ fullscreenLayout = radio.layout;
3532
+
3533
+// bigThree.remove(scenePanel);
3534
+// bigThree.remove(centralPanel);
3535
+// bigThree.remove(XYZPanel);
3536
+// aWindowConstraints.gridx = 0;
3537
+// aWindowConstraints.gridy = 0;
3538
+// aWindowConstraints.gridwidth = 1;
3539
+// // aConstraints.gridheight = 3;
3540
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3541
+// aWindowConstraints.weightx = 0;
3542
+// aWindowConstraints.weighty = 1;
3543
+// //bigThree.add(jtp, aWindowConstraints);
3544
+// aWindowConstraints.weightx = 1;
3545
+// aWindowConstraints.gridwidth = 3;
3546
+// // aConstraints.gridheight = 3;
3547
+// aWindowConstraints.gridx = 1;
3548
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3549
+// bigThree.add(centralPanel, aWindowConstraints);
3550
+// aWindowConstraints.weightx = 0;
3551
+// aWindowConstraints.gridx = 4;
3552
+// aWindowConstraints.gridwidth = 1;
3553
+// // aConstraints.gridheight = 3;
3554
+// aConstraints.fill = GridBagConstraints.VERTICAL;
3555
+// bigThree.add(XYZPanel, aWindowConstraints);
3556
+// bigThree.validate();
3557
+// scenePanel.setVisible(false);
3558
+// centralPanel.setVisible(true);
3559
+// XYZPanel.setVisible(true);
3560
+ bigThree.ClearUI();
3561
+ bigThree.add(scenePanel);
3562
+ bigThree.add(centralPanel);
3563
+ bigThree.FlushUI();
3564
+
3565
+ cameraView.requestFocusInWindow();
25793566 } else
2580
- if (event.getSource() == fourButton)
3567
+ if (source == fourButton)
25813568 {
25823569 radio.layout = fourButton;
2583
- bigThree.remove(jtp);
2584
- bigThree.remove(cameraPanel);
2585
- bigThree.remove(XYZPanel);
2586
- aWindowConstraints.gridx = 0;
2587
- aWindowConstraints.gridy = 0;
2588
- aWindowConstraints.gridwidth = 1;
2589
- // aWindowConstraints.gridheight = 3;
2590
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2591
- aWindowConstraints.weightx = 1;
2592
- aWindowConstraints.weighty = 1;
2593
- bigThree.add(jtp, aWindowConstraints);
2594
- aWindowConstraints.weightx = 1;
2595
- aWindowConstraints.gridwidth = 3;
2596
- // aConstraints.gridheight = 3;
2597
- aWindowConstraints.gridx = 1;
2598
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2599
- //bigThree.add(cameraPanel, aWindowConstraints);
2600
- aWindowConstraints.weightx = 0;
2601
- aWindowConstraints.gridx = 4;
2602
- aWindowConstraints.gridwidth = 1;
2603
- // aWindowConstraints.gridheight = 3;
2604
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2605
- //bigThree.add(XYZPanel, aWindowConstraints);
2606
- bigThree.revalidate();
3570
+
3571
+ if (CameraPane.FULLSCREEN)
3572
+ fullscreenLayout = radio.layout;
3573
+
3574
+// bigThree.remove(scenePanel);
3575
+// bigThree.remove(centralPanel);
3576
+// bigThree.remove(XYZPanel);
3577
+// aWindowConstraints.gridx = 0;
3578
+// aWindowConstraints.gridy = 0;
3579
+// aWindowConstraints.gridwidth = 1;
3580
+// // aWindowConstraints.gridheight = 3;
3581
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3582
+// aWindowConstraints.weightx = 1;
3583
+// aWindowConstraints.weighty = 1;
3584
+// bigThree.add(scenePanel, aWindowConstraints);
3585
+// aWindowConstraints.weightx = 1;
3586
+// aWindowConstraints.gridwidth = 3;
3587
+// // aConstraints.gridheight = 3;
3588
+// aWindowConstraints.gridx = 1;
3589
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3590
+// //bigThree.add(cameraPanel, aWindowConstraints);
3591
+// aWindowConstraints.weightx = 0;
3592
+// aWindowConstraints.gridx = 4;
3593
+// aWindowConstraints.gridwidth = 1;
3594
+// // aWindowConstraints.gridheight = 3;
3595
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3596
+// //bigThree.add(XYZPanel, aWindowConstraints);
3597
+// bigThree.validate();
3598
+// scenePanel.setVisible(true);
3599
+// centralPanel.setVisible(false);
3600
+// XYZPanel.setVisible(false);
3601
+ bigThree.ClearUI();
3602
+ bigThree.add(scenePanel);
3603
+ bigThree.FlushUI();
3604
+
3605
+ cameraView.requestFocusInWindow();
26073606 } else
2608
- if (event.getSource() == sixButton)
3607
+ if (source == sixButton)
26093608 {
26103609 radio.layout = sixButton;
2611
- bigThree.remove(jtp);
2612
- bigThree.remove(cameraPanel);
2613
- bigThree.remove(XYZPanel);
2614
- aWindowConstraints.gridx = 0;
2615
- aWindowConstraints.gridy = 0;
2616
- aWindowConstraints.gridwidth = 1;
2617
- // aConstraints.gridheight = 3;
2618
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2619
- aWindowConstraints.weightx = 0;
2620
- aWindowConstraints.weighty = 1;
2621
- bigThree.add(jtp, aWindowConstraints);
2622
- aWindowConstraints.weightx = 1;
2623
- aWindowConstraints.gridwidth = 3;
2624
- // aWindowConstraints.gridheight = 3;
2625
- aWindowConstraints.gridx = 1;
2626
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2627
- bigThree.add(cameraPanel, aWindowConstraints);
2628
- aWindowConstraints.weightx = 0;
2629
- aWindowConstraints.gridx = 4;
2630
- aWindowConstraints.gridwidth = 1;
2631
- // aWindowConstraints.gridheight = 3;
2632
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2633
- //bigThree.add(XYZPanel, aConstraints);
2634
- bigThree.revalidate();
3610
+
3611
+ if (CameraPane.FULLSCREEN)
3612
+ fullscreenLayout = radio.layout;
3613
+
3614
+// bigThree.remove(scenePanel);
3615
+// bigThree.remove(centralPanel);
3616
+// bigThree.remove(XYZPanel);
3617
+// aWindowConstraints.gridx = 0;
3618
+// aWindowConstraints.gridy = 0;
3619
+// aWindowConstraints.gridwidth = 1;
3620
+// // aConstraints.gridheight = 3;
3621
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3622
+// aWindowConstraints.weightx = 0;
3623
+// aWindowConstraints.weighty = 1;
3624
+// bigThree.add(scenePanel, aWindowConstraints);
3625
+// aWindowConstraints.weightx = 1;
3626
+// aWindowConstraints.gridwidth = 3;
3627
+// // aWindowConstraints.gridheight = 3;
3628
+// aWindowConstraints.gridx = 1;
3629
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3630
+// bigThree.add(centralPanel, aWindowConstraints);
3631
+// aWindowConstraints.weightx = 0;
3632
+// aWindowConstraints.gridx = 4;
3633
+// aWindowConstraints.gridwidth = 1;
3634
+// // aWindowConstraints.gridheight = 3;
3635
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3636
+// //bigThree.add(XYZPanel, aConstraints);
3637
+// bigThree.validate();
3638
+// scenePanel.setVisible(true);
3639
+// centralPanel.setVisible(true);
3640
+// XYZPanel.setVisible(false);
3641
+ bigThree.ClearUI();
3642
+ bigThree.add(centralPanel);
3643
+ bigThree.add(scenePanel);
3644
+ bigThree.FlushUI();
3645
+
3646
+ cameraView.requestFocusInWindow();
26353647 } else
2636
- if (event.getSource() == sevenButton)
3648
+ if (source == sevenButton)
26373649 {
26383650 radio.layout = sevenButton;
2639
- bigThree.remove(jtp);
2640
- bigThree.remove(cameraPanel);
2641
- bigThree.remove(XYZPanel);
2642
- aWindowConstraints.gridx = 0;
2643
- aWindowConstraints.gridy = 0;
2644
- aWindowConstraints.gridwidth = 1;
2645
- // aWindowConstraints.gridheight = 3;
2646
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2647
- aWindowConstraints.weightx = 0;
2648
- aWindowConstraints.weighty = 1;
2649
- bigThree.add(jtp, aWindowConstraints);
2650
- aWindowConstraints.weightx = 1;
2651
- aWindowConstraints.gridwidth = 3;
2652
- // aWindowConstraints.gridheight = 3;
2653
- aWindowConstraints.gridx = 1;
2654
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2655
- bigThree.add(cameraPanel, aWindowConstraints);
2656
- aWindowConstraints.weightx = 0;
2657
- aWindowConstraints.gridx = 4;
2658
- aWindowConstraints.gridwidth = 1;
2659
- // aConstraints.gridheight = 3;
2660
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2661
- bigThree.add(XYZPanel, aWindowConstraints);
2662
- bigThree.revalidate();
3651
+
3652
+ if (CameraPane.FULLSCREEN)
3653
+ fullscreenLayout = radio.layout;
3654
+
3655
+// bigThree.remove(scenePanel);
3656
+// bigThree.remove(centralPanel);
3657
+// bigThree.remove(XYZPanel);
3658
+// aWindowConstraints.gridx = 0;
3659
+// aWindowConstraints.gridy = 0;
3660
+// aWindowConstraints.gridwidth = 1;
3661
+// // aWindowConstraints.gridheight = 3;
3662
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3663
+// aWindowConstraints.weightx = 0;
3664
+// aWindowConstraints.weighty = 1;
3665
+// bigThree.add(scenePanel, aWindowConstraints);
3666
+// aWindowConstraints.weightx = 1;
3667
+// aWindowConstraints.gridwidth = 3;
3668
+// // aWindowConstraints.gridheight = 3;
3669
+// aWindowConstraints.gridx = 1;
3670
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3671
+// bigThree.add(centralPanel, aWindowConstraints);
3672
+// aWindowConstraints.weightx = 0;
3673
+// aWindowConstraints.gridx = 4;
3674
+// aWindowConstraints.gridwidth = 1;
3675
+// // aConstraints.gridheight = 3;
3676
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3677
+// bigThree.add(XYZPanel, aWindowConstraints);
3678
+// bigThree.validate();
3679
+// scenePanel.setVisible(true);
3680
+// centralPanel.setVisible(true);
3681
+// XYZPanel.setVisible(true);
3682
+ bigThree.ClearUI();
3683
+ bigThree.add(scenePanel);
3684
+ bigThree.add(centralPanel);
3685
+ bigThree.add(XYZPanel);
3686
+ bigThree.FlushUI();
3687
+
3688
+ cameraView.requestFocusInWindow();
26633689 } else
2664
- if (event.getSource() == rootButton)
3690
+ if (source == rootButton)
26653691 {
26663692 Object3D obj;
26673693 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2671,66 +3697,84 @@
26713697 EditObject(obj);
26723698 }
26733699
3700
+ cameraView.requestFocusInWindow();
26743701 refreshContents(true);
26753702 } else
2676
- if (event.getSource() == closeButton)
3703
+ if (source == closeButton)
26773704 {
26783705 //System.out.println("CLOSE: " + buttonGroup.getSelection());
26793706 cRadio ab;
26803707 for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
26813708 {
26823709 ab = (cRadio)e.nextElement();
2683
- if(ab.getModel().isSelected() && ab.GetObject() != client)
3710
+ if (ab.getModel().isSelected() && ab.GetObject() != client)
26843711 {
3712
+ // Patch to avoid bug with transparency.
3713
+ if (!ab.hadMaterial)
3714
+ {
3715
+ ab.object.material = null;
3716
+ }
3717
+
26853718 buttonGroup.remove(ab);
26863719 radioPanel.remove(ab);
26873720
2688
- ab.GetObject().editWindow = null;
3721
+ //ab.GetObject().editWindow = null;
3722
+ ab.GetObject().manipWindow = null;
26893723 // ab.GetObject().objectUI = null; // ?????????
26903724
26913725 ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick();
26923726 break;
26933727 }
26943728 }
3729
+
3730
+ cameraView.requestFocusInWindow();
26953731 refreshContents(true);
26963732 } else
2697
- if (event.getSource() == editItem || event.getSource() == editButton)
3733
+ if (source == editItem || source == editButton)
26983734 {
3735
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3736
+ {
3737
+ Object3D child = (Object3D)e.nextElement();
3738
+ child.pinned = true;
3739
+ }
3740
+
26993741 EditSelection(false);
27003742 } else
2701
- if (event.getSource() == uneditButton)
3743
+ if (source == uneditButton)
27023744 {
27033745 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
27043746 {
27053747 Object3D child = (Object3D)e.nextElement();
27063748 if(child.editWindow != null)
27073749 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3750
+ child.pinned = false;
27083751 child.CloseUI();
27093752 listUI.remove(child);
27103753
2711
- child.editWindow = null; // ???????????
3754
+ //child.editWindow = null; // ???????????
27123755 }
2713
- objEditor.ctrlPanel.revalidate();
3756
+ objEditor.ctrlPanel.FlushUI();
27143757 //objEditor.jTree.clearSelection();
27153758 //objEditor.ResetSliders();
27163759 refreshContents(true);
27173760 } else
2718
- if (event.getSource() == clearPanelButton)
3761
+ if (source == clearPanelButton)
27193762 {
27203763 assert(copy == group);
27213764 //copy.ClearUI();
27223765 for (Object3D obj : listUI)
27233766 {
3767
+ obj.pinned = false;
27243768 obj.CloseUI();
27253769 }
27263770 listUI.clear();
27273771 refreshContents(true);
27283772 } else
2729
- if (event.getSource() == allParamsButton)
3773
+ if (source == allParamsButton)
27303774 {
27313775 assert(copy == group);
27323776
2733
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3777
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
27343778
27353779 for (Object3D obj : listUI)
27363780 {
....@@ -2747,19 +3791,19 @@
27473791
27483792 refreshContents(true);
27493793 } else
2750
- if (event.getSource() == unselectButton)
3794
+ if (source == unselectButton)
27513795 {
27523796 objEditor.jTree.clearSelection();
2753
- // ?? oct 2012 GraphreeD.clipboard.clear();
3797
+ // ?? oct 2012 GrafreeD.clipboard.clear();
27543798 objEditor.ResetSliders();
27553799 refreshContents(true);
27563800 } else
2757
- if(event.getSource() instanceof cRadio)
3801
+ if(source instanceof cRadio)
27583802 {
27593803 group.parent = keepparent;
27603804 group.attributes = 0;
27613805 //group.editWindow = null;
2762
- /*cRadio*/ radio = (cRadio)event.getSource();
3806
+ /*cRadio*/ radio = (cRadio)source;
27633807 Object3D obj = radio.GetObject();
27643808 System.out.println("Edit " + obj);
27653809 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -2779,7 +3823,10 @@
27793823 }
27803824
27813825 copy = group;
2782
- //CameraPane.theRenderer.object = group;
3826
+
3827
+ SetUndoStates();
3828
+
3829
+ //Globals.theRenderer.object = group;
27833830 if(!useclient)
27843831 {
27853832 cameraView.renderCamera = radio.camera;
....@@ -2788,25 +3835,52 @@
27883835 cameraView.cameras[cameraView.cameracount] = radio.camera;
27893836 cameraView.targetLookAt.set(radio.camera.lookAt);
27903837 cameraView.object = group;
2791
- cameraView.lighttouched = true;
3838
+ //cameraView.lighttouched = true;
3839
+ Globals.lighttouched = true;
27923840 topView.object = group;
27933841 frontView.object = group;
27943842 sideView.object = group;
27953843 }
2796
- group.editWindow = this;
3844
+
3845
+// fix "+" issue
3846
+ //group.editWindow = this;
3847
+ group.manipWindow = this;
3848
+
27973849 /*
27983850 currentLayout = radio.layout;
27993851 if (currentLayout == null)
28003852 currentLayout = sevenButton;
28013853 */
28023854 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);
28033862 keepparent = group.parent;
28043863 // PARENT = NULL or not???
28053864 //group.parent = null; // ROOT
28063865 //group.attributes = -1;
28073866 ResetModel();
3867
+
3868
+ cameraView.requestFocusInWindow();
28083869 refreshContents(true);
2809
- }
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
+ }
28103884 else
28113885 {
28123886 //return super.action(event, arg);
....@@ -2815,7 +3889,6 @@
28153889 }
28163890
28173891 boolean useclient = false;
2818
- cRadio radio;
28193892
28203893 void ToggleRoot()
28213894 {
....@@ -2824,7 +3897,7 @@
28243897 if (useclient)
28253898 {
28263899 cameraView.object = client;
2827
- cameraView.lighttouched = true;
3900
+ Globals.lighttouched = true;
28283901 //topView.object = client;
28293902 //frontView.object = client;
28303903 //sideView.object = client;
....@@ -2832,7 +3905,7 @@
28323905 else
28333906 {
28343907 cameraView.object = group;
2835
- cameraView.lighttouched = true;
3908
+ Globals.lighttouched = true;
28363909 //topView.object = group;
28373910 //frontView.object = group;
28383911 //sideView.object = group;
....@@ -2867,6 +3940,28 @@
28673940 refreshContents();
28683941 }
28693942
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
+ }
28703965
28713966 void ResetTransform()
28723967 {
....@@ -2979,7 +4074,7 @@
29794074 refreshContents();
29804075 }
29814076
2982
- void ResetCentroid()
4077
+ void ResetCentroid(boolean full)
29834078 {
29844079 Object3D obj;
29854080 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2994,12 +4089,16 @@
29944089 LA.matIdentity(Object3D.mat);
29954090 obj.getBounds(minima, maxima, false);
29964091 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
2997
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
4092
+ if (full)
4093
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
29984094 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
29994095 obj.TransformMesh(Object3D.mat);
4096
+
30004097 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3001
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
4098
+ if (full)
4099
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
30024100 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
4101
+
30034102 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
30044103 //Object3D.mat[3][0] = -Object3D.mat[3][0];
30054104 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3028,7 +4127,8 @@
30284127
30294128 int size = obj.MemorySize();
30304129
3031
- 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)");
30324132 }
30334133 }
30344134 catch (Exception e)
....@@ -3065,9 +4165,9 @@
30654165 obj = (Object3D)e.nextElement();
30664166
30674167 System.out.println("Object is: " + obj);
3068
- GraphreeD.AnalyzeObject(obj);
4168
+ Grafreed.AnalyzeObject(obj);
30694169 System.out.println("Boundary rep: " + obj.bRep);
3070
- GraphreeD.AnalyzeObject(obj.bRep);
4170
+ Grafreed.AnalyzeObject(obj.bRep);
30714171
30724172 // System.err.println((size/1024) + " KB is the size of " + obj);
30734173 }
....@@ -3109,6 +4209,20 @@
31094209 void GenNormals(boolean crease)
31104210 {
31114211 group.GenNormalsS(crease);
4212
+
4213
+ refreshContents();
4214
+ }
4215
+
4216
+ void GenNormalsMESH()
4217
+ {
4218
+ group.GenNormalsMeshS();
4219
+
4220
+ refreshContents();
4221
+ }
4222
+
4223
+ void GenNormalsMINE()
4224
+ {
4225
+ group.selection.GenNormalsMINE();
31124226
31134227 refreshContents();
31144228 }
....@@ -3157,104 +4271,259 @@
31574271
31584272 //Object3D buffer;
31594273 cVector temp = new cVector();
3160
- BoundaryRep temprep;
3161
- Object3D nodes;
3162
- Vector<Vertex> vertices;
3163
-
3164
- public void Vertex(Object3D node, Vertex v)
3165
- {
3166
- vertices.add(v);
3167
- nodes.addElement(node);
3168
-
3169
- if (temprep.GetCache(v) != null)
3170
- {
3171
- temprep.Remove(v);
3172
- }
3173
- else
3174
- {
3175
- temprep.Remember(v);
3176
- }
3177
- }
3178
-
3179
- public void Face(Object3D node, Face f)
3180
- {
3181
-
3182
- }
3183
-
4274
+// BoundaryRep temprep;
4275
+// Object3D nodes;
4276
+// Vector<Vertex> vertices;
4277
+//
4278
+// cGroup buffer;
4279
+//
4280
+// public void Vertex(Object3D node, Vertex v)
4281
+// {
4282
+//// vertices.add(v);
4283
+//// nodes.addElement(node);
4284
+////
4285
+//// if (temprep.GetCache(v) != null)
4286
+//// {
4287
+//// temprep.Remove(v);
4288
+//// } else
4289
+//// {
4290
+//// temprep.Remember(v);
4291
+//// }
4292
+//
4293
+// //Object3D node = nodes.get(index);
4294
+// temp.set(v); // vertices.get(index)); // temprep.GetVertex(k));
4295
+// // System.out.println("temp = " + temp.x + ", " + temp.y + ", " + temp.z);
4296
+//
4297
+// LA.xformPos(temp, node.GlobalTransformInv(), temp);
4298
+//
4299
+// // System.out.println("tem+ = " + temp.x + ", " + temp.y + ", " + temp.z);
4300
+//
4301
+// cGroup g = new cGroup();
4302
+//
4303
+// if (g.toParent == null)
4304
+// {
4305
+// g.toParent = LA.newMatrix();
4306
+// g.fromParent = LA.newMatrix();
4307
+// }
4308
+// LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
4309
+// LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
4310
+//
4311
+// g.add(GrafreeD.clipboard);
4312
+//
4313
+// buffer.add(g);
4314
+// }
4315
+//
4316
+// public void Face(Object3D node, Face f)
4317
+// {
4318
+//
4319
+// }
4320
+//
4321
+// void ParseVerticesOld() // ??
4322
+// {
4323
+// //if (group.selection.size() != 1)
4324
+// // return;
4325
+//
4326
+// temprep = new BoundaryRep();
4327
+// nodes = new Object3D();
4328
+// vertices = new Vector<Vertex>();
4329
+//
4330
+// boolean epsequal = GrafreeD.epsequal;
4331
+// GrafreeD.epsequal = true;
4332
+//
4333
+// for (int i=0; i<group.selection.size(); i++)
4334
+// {
4335
+// Object3D buffer = new cGroup(group.selection.get(i).name + "+");
4336
+//
4337
+// group.selection.get(i).Parse(
4338
+//this );
4339
+//
4340
+// int repsize = temprep.VertexCount();
4341
+// int tablesize = temprep.vertextable.size();
4342
+// int nodesize = nodes.size();
4343
+//
4344
+// assert(vertices.size() == nodes.size());
4345
+//
4346
+// temprep.vertextable.elements();
4347
+//
4348
+// java.util.Set<java.util.Map.Entry<Vertex,Vertex>> set = temprep.vertextable.entrySet();
4349
+//
4350
+// for (java.util.Map.Entry<Vertex,Vertex> entry : set)
4351
+// {
4352
+// cGroup g = new cGroup();
4353
+//
4354
+// int index = vertices.indexOf(entry.getValue()); // temprep.vertextable.(k));
4355
+//
4356
+// Object3D node = nodes.get(index);
4357
+// temp.set(vertices.get(index)); // temprep.GetVertex(k));
4358
+// // System.out.println("temp = " + temp.x + ", " + temp.y + ", " + temp.z);
4359
+//
4360
+// LA.xformPos(temp, node.GlobalTransformInv(), temp);
4361
+//
4362
+// // System.out.println("tem+ = " + temp.x + ", " + temp.y + ", " + temp.z);
4363
+//
4364
+// if (g.toParent == null)
4365
+// {
4366
+// g.toParent = LA.newMatrix();
4367
+// g.fromParent = LA.newMatrix();
4368
+// }
4369
+// LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
4370
+// LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
4371
+//
4372
+// g.add(GrafreeD.clipboard);
4373
+//
4374
+// buffer.add(g);
4375
+// }
4376
+//
4377
+// makeSomething(buffer, i==group.selection.size()-1);
4378
+// }
4379
+//
4380
+// GrafreeD.epsequal = epsequal;
4381
+//
4382
+// //buffer = null;
4383
+// temprep = null;
4384
+// nodes = null;
4385
+//
4386
+// refreshContents();
4387
+// }
4388
+
31844389 void ParseVertices()
31854390 {
3186
- //if (group.selection.size() != 1)
3187
- // return;
3188
-
3189
- temprep = new BoundaryRep();
3190
- nodes = new Object3D();
3191
- vertices = new Vector<Vertex>();
3192
-
3193
- boolean epsequal = GraphreeD.epsequal;
3194
- GraphreeD.epsequal = true;
4391
+ boolean epsequal = Grafreed.epsequal;
4392
+ Grafreed.epsequal = true;
31954393
31964394 for (int i=0; i<group.selection.size(); i++)
31974395 {
3198
- Object3D buffer = new cGroup(group.selection.get(i).name + "+");
4396
+ final cGroup buffer = new cGroup(group.selection.get(i).name + "+");
31994397
3200
- group.selection.get(i).Parse(this);
3201
-
3202
- int repsize = temprep.VertexCount();
3203
- int tablesize = temprep.vertextable.size();
3204
- int nodesize = nodes.size();
4398
+ group.selection.get(i).Parse(
4399
+
4400
+ new iParse()
4401
+ {
4402
+ public void Vertex(Object3D node, Vertex v)
4403
+ {
4404
+ temp.set(v);
4405
+ LA.xformPos(temp, node.GlobalTransformInv(), temp);
32054406
3206
- assert(vertices.size() == nodes.size());
3207
-
3208
- temprep.vertextable.elements();
3209
-
3210
- java.util.Set<java.util.Map.Entry<Vertex,Vertex>> set = temprep.vertextable.entrySet();
4407
+ cGroup g = new cGroup();
32114408
3212
- for (java.util.Map.Entry<Vertex,Vertex> entry : set)
3213
- {
3214
- cGroup g = new cGroup();
4409
+ if (g.toParent == null)
4410
+ {
4411
+ g.toParent = LA.newMatrix();
4412
+ g.fromParent = LA.newMatrix();
4413
+ }
4414
+ LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
4415
+ LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
32154416
3216
- int index = vertices.indexOf(entry.getValue()); // temprep.vertextable.(k));
3217
- Object3D node = nodes.get(index);
3218
- temp.set(vertices.get(index)); // temprep.GetVertex(k));
3219
- // System.out.println("temp = " + temp.x + ", " + temp.y + ", " + temp.z);
4417
+ g.add(Grafreed.clipboard);
32204418
3221
- LA.xformPos(temp, node.GlobalTransformInv(), temp);
3222
-
3223
- // System.out.println("tem+ = " + temp.x + ", " + temp.y + ", " + temp.z);
3224
-
3225
- if (g.toParent == null)
3226
- {
3227
- g.toParent = LA.newMatrix();
3228
- g.fromParent = LA.newMatrix();
3229
- }
3230
- LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
3231
- LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
4419
+ buffer.add(g);
4420
+ }
32324421
3233
- g.add(GraphreeD.clipboard);
4422
+ public void Face(Object3D node, Face f)
4423
+ {
32344424
3235
- buffer.add(g);
3236
- }
4425
+ }
4426
+ }
4427
+ );
32374428
32384429 makeSomething(buffer, i==group.selection.size()-1);
32394430 }
32404431
3241
- GraphreeD.epsequal = epsequal;
3242
-
3243
- //buffer = null;
3244
- temprep = null;
3245
- nodes = null;
4432
+ Grafreed.epsequal = epsequal;
32464433
32474434 refreshContents();
32484435 }
3249
-
4436
+
4437
+ void TextureVertices()
4438
+ {
4439
+ for (int i=0; i<group.selection.size(); i++)
4440
+ {
4441
+ group.selection.get(i).Parse(
4442
+ new iParse()
4443
+ {
4444
+ public void Vertex(Object3D node, Vertex v)
4445
+ {
4446
+ cTexture tex = node.GetTextures();
4447
+ String pigment = Object3D.GetPigment(tex);
4448
+ //String bump = Object3D.GetBump(tex);
4449
+
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
+ }
4460
+
4461
+ double s = v.s;
4462
+
4463
+ if (s == 1)
4464
+ s = 0;
4465
+
4466
+ double t = v.t;
4467
+
4468
+ if (t == 1)
4469
+ t = 0;
4470
+
4471
+ int indexs = (int) (texturedata.getWidth() * s);
4472
+ int indext = (int) (texturedata.getHeight() * t);
4473
+
4474
+ int index = indext * texturedata.getWidth() + indexs;
4475
+
4476
+ java.nio.ByteBuffer bytebuf = (java.nio.ByteBuffer)texturedata.getBuffer();
4477
+
4478
+ int slide = bytebuf.capacity() / texturedata.getWidth() / texturedata.getHeight();
4479
+
4480
+ float scale = bytebuf.get(index*slide) & 0xFF;
4481
+ scale += bytebuf.get(index*slide+1) & 0xFF;
4482
+ scale += bytebuf.get(index*slide+2) & 0xFF;
4483
+ scale /= 3;
4484
+
4485
+ scale /= 0xFF;
4486
+ // c'est quoi ca? scale /= 4;
4487
+
4488
+ //v.AO = scale;
4489
+
4490
+ v.x += v.norm.x * scale;
4491
+ v.y += v.norm.y * scale;
4492
+ v.z += v.norm.z * scale;
4493
+ }
4494
+
4495
+ public void Face(Object3D node, Face f)
4496
+ {
4497
+ }
4498
+ }
4499
+ );
4500
+ }
4501
+
4502
+ refreshContents();
4503
+ }
4504
+
32504505 void Align()
32514506 {
4507
+ if (group.selection.size() == 0)
4508
+ return;
4509
+
4510
+ cVector bbmin = new cVector();
4511
+ cVector bbmax = new cVector();
4512
+
4513
+ group.selection.get(0).getBounds(bbmin, bbmax, true);
4514
+
4515
+ double dx = bbmax.x - bbmin.x;
4516
+ double dy = bbmax.y - bbmin.y;
4517
+ double dz = bbmax.z - bbmin.z;
4518
+
4519
+ double scale = Math.sqrt(dx*dx + dy*dy + dz*dz);
4520
+
32524521 for (int i=0; i<group.selection.size(); i++)
32534522 {
32544523 Object3D obj = group.selection.get(i);
32554524
3256
- LA.matTranslate(obj.toParent, i/2f, 0, 0);
3257
- LA.matTranslateInv(obj.fromParent, -i/2f, 0, 0);
4525
+ LA.matTranslate(obj.toParent, i * scale, 0, 0);
4526
+ LA.matTranslateInv(obj.fromParent, -i * scale, 0, 0);
32584527 }
32594528
32604529 refreshContents();
....@@ -3267,7 +4536,7 @@
32674536 // ref.SaveSupports();
32684537 // Object3D par = ref.parent;
32694538 // ref.parent = null;
3270
-// Object3D lowres = (Object3D) GraphreeD.clone(ref);
4539
+// Object3D lowres = (Object3D) GrafreeD.clone(ref);
32714540 // ref.parent = par;
32724541 // ref.RestoreSupports();
32734542
....@@ -3275,11 +4544,11 @@
32754544
32764545 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
32774546
3278
- boolean random = CameraPane.RANDOM;
3279
- CameraPane.RANDOM = false; // parse all random nodes
4547
+ boolean random = CameraPane.SWITCH;
4548
+ CameraPane.SWITCH = false; // parse all random nodes
32804549 lowres.linkVerticesThis(null);
32814550 lowres.linkVerticesThis(sn);
3282
- CameraPane.RANDOM = random;
4551
+ CameraPane.SWITCH = random;
32834552
32844553 System.err.flush();
32854554
....@@ -3297,7 +4566,7 @@
32974566 // lowres.SaveSupports();
32984567 // par = lowres.parent;
32994568 // lowres.parent = null;
3300
-// Object3D newlow = (Object3D) GraphreeD.clone(lowres);
4569
+// Object3D newlow = (Object3D) GrafreeD.clone(lowres);
33014570 Object3D newlow = CloneObject(lowres, false);
33024571 newlow.name = sn.switchobject.get(i).name;
33034572 System.out.println(" pose#" + i + " = " + newlow);
....@@ -3319,7 +4588,7 @@
33194588 return;
33204589
33214590 Object3D poses = group.selection.get(0);
3322
- Object3D ref = GraphreeD.clipboard.get(0);
4591
+ Object3D ref = Grafreed.clipboard.get(0);
33234592
33244593 Object3D newgroup = new Object3D("Po:" + poses.name);
33254594
....@@ -3488,7 +4757,7 @@
34884757 group.selection.RelinkToSupport(); // july 2014
34894758 System.out.println("DONE.");
34904759 refreshContents();
3491
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
4760
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
34924761 }
34934762
34944763 void ReduceMesh(boolean reduction34)
....@@ -3513,20 +4782,20 @@
35134782
35144783 void ClipMesh()
35154784 {
3516
- if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
4785
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
35174786 {
3518
- Object3D content = GraphreeD.clipboard.get(0);
4787
+ Object3D content = Grafreed.clipboard.get(0);
35194788
35204789 if (content instanceof cGroup && ((cGroup)content).transientlink )
35214790 content = ((cGroup)content).get(0);
35224791
35234792 // for (int i=0; i<group.selection.size(); i++)
35244793 // {
3525
-// group.selection.get(i).ClipMesh(GraphreeD.clipboard);
4794
+// group.selection.get(i).ClipMesh(GrafreeD.clipboard);
35264795 // }
3527
- group.selection.ClipMesh(GraphreeD.clipboard);
4796
+ group.selection.ClipMesh(Grafreed.clipboard);
35284797 }
3529
-// group.selection.ClipMesh(GraphreeD.clipboard);
4798
+// group.selection.ClipMesh(GrafreeD.clipboard);
35304799 System.out.println("DONE.");
35314800 refreshContents();
35324801 }
....@@ -3571,6 +4840,18 @@
35714840 void MarkLeaves(boolean hide)
35724841 {
35734842 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);
35744855 refreshContents();
35754856 }
35764857
....@@ -3645,28 +4926,25 @@
36454926 // }
36464927 // }
36474928
3648
- static boolean allparams = true;
3649
-
3650
- static Vector<Object3D> listUI = new Vector<Object3D>();
3651
-
36524929 void EditSelection(boolean newWindow)
36534930 {
4931
+ if (group.selection == null)
4932
+ {
4933
+ EditElement(group, newWindow); // ? new
4934
+ return;
4935
+ }
4936
+
36544937 // aConstraints.gridy = 0;
36554938 for (int i=0; i<group.selection.size(); i++)
36564939 {
36574940 //System.out.println("edit : " + objectPanel.indexOfTab("Material"));
36584941 //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false);
3659
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
4942
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
36604943
36614944 Object3D elem = (Object3D)group.selection.elementAt(i);
3662
- if(elem != group)
4945
+ if(elem != group || !newWindow)
36634946 {
3664
- // if (!(elem instanceof Composite))
3665
- // newWindow = false;
3666
- listUI.add(elem);
3667
- elem.openEditWindow(this, newWindow); //, false);
3668
- System.out.println("edit : " + elem);
3669
- elem.editWindow.refreshContents(true); // ? new
4947
+ EditElement(elem, newWindow); // ? new
36704948 }
36714949 }
36724950 }
....@@ -3741,7 +5019,8 @@
37415019 //new Exception().printStackTrace();
37425020
37435021 freezemodel = true;
3744
-
5022
+ ClearUnpinned();
5023
+
37455024 /**/
37465025 //switch (event.id)
37475026 {
....@@ -3749,7 +5028,6 @@
37495028 //case 702: // Event.LIST_DESELECT
37505029 group.deselectAll();
37515030 TreePath tps[] = objEditor.jTree.getSelectionPaths();
3752
- objEditor.ClearInfo(); // .GetMaterial());
37535031 if (tps != null)
37545032 {
37555033 for (int i=0; i < tps.length; i++)
....@@ -3758,33 +5036,39 @@
37585036
37595037 //if (child.parent != null)
37605038 //child.parent.addSelectee(child);
5039
+ objEditor.SetMaterial(child);
37615040 group.addSelectee(child);
3762
- objEditor.SetMaterial(child); // .GetMaterial());
3763
- objEditor.AddInfo(child, this, true); // .GetMaterial());
3764
- System.err.println("info : " + child.GetPath());
37655041 }
37665042 }
3767
- else
3768
- {
3769
- objEditor.SetMaterial(group); // .GetMaterial());
3770
- objEditor.AddInfo(group, this, true); // .GetMaterial());
3771
- System.err.println("info : " + group.GetPath());
3772
- }
5043
+// else
5044
+// {
5045
+// objEditor.SetMaterial(group); // .GetMaterial());
5046
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
5047
+// System.err.println("info : " + group.GetPath());
5048
+// }
37735049
3774
- objEditor.SetText(); // jan 2014
3775
-
3776
- if (flashIt && !CameraPane.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))
37775051 CameraPane.flash = true;
37785052
3779
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
5053
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
37805054 // a camera
37815055 {
3782
- CameraPane.camerachangeframe = 0; // don't refuse it
3783
- CameraPane.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
3784
- // CameraPane.theRenderer.renderCamera = CameraPane.theRenderer.manipCamera;
3785
- // CameraPane.theRenderer.eyeCamera = CameraPane.theRenderer.manipCamera;
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
+ }
5061
+ // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
5062
+ // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
37865063 }
37875064
5065
+ if (tps != null && tps.length == 1)
5066
+ {
5067
+ EditSelection(false);
5068
+ }
5069
+
5070
+ SetPinStates(tps != null && tps.length > 0);
5071
+
37885072 refreshContents();
37895073 //return true;
37905074 }
....@@ -3793,6 +5077,35 @@
37935077
37945078 freezemodel = false;
37955079 }
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
+ }
37965109
37975110 void linkSomething(Object3D thing)
37985111 {
....@@ -3864,16 +5177,19 @@
38645177 {
38655178 if (group.selection.isEmpty())
38665179 return;
3867
- GraphreeD.clipboardIsTempGroup = false;
5180
+
5181
+ Grafreed.clipboardIsTempGroup = false;
38685182 Composite tGroup = null;
38695183 if (group.selection.size() > 0) // 1)
38705184 {
38715185 tGroup = new cGroup();
3872
- GraphreeD.clipboardIsTempGroup = true;
5186
+ Grafreed.clipboardIsTempGroup = true;
38735187 }
38745188
38755189 if (cut)
38765190 {
5191
+// if (Globals.SAVEONMAKE) // Moved to the clipboard, no need to save.
5192
+// Save();
38775193 //int indices[] = jList.getSelectedIndices();
38785194 //for (int i = indices.length - 1; i >= 0; i--)
38795195 //jList.remove(indices[i]);
....@@ -3909,16 +5225,16 @@
39095225 //System.out.println("cut " + child);
39105226 //System.out.println("parent = " + child.parent);
39115227 // tmp.addChild(child);
3912
- if (GraphreeD.clipboardIsTempGroup)
5228
+ if (Grafreed.clipboardIsTempGroup)
39135229 tGroup.add/*Child*/(tmp);
39145230 else
3915
- GraphreeD.clipboard = tmp;
5231
+ Grafreed.clipboard = tmp;
39165232 }
39175233 else
3918
- if (GraphreeD.clipboardIsTempGroup)
5234
+ if (Grafreed.clipboardIsTempGroup)
39195235 tGroup.add/*Child*/(child);
39205236 else
3921
- GraphreeD.clipboard = child;
5237
+ Grafreed.clipboard = child;
39225238 }
39235239
39245240 //ResetModel();
....@@ -3950,21 +5266,23 @@
39505266 //System.out.println("cut " + elem);
39515267 //System.out.println("parent = " + elem.parent);
39525268 // tmp.addChild(elem);
3953
- if (GraphreeD.clipboardIsTempGroup)
5269
+ if (Grafreed.clipboardIsTempGroup)
39545270 tGroup.add/*Child*/(tmp);
39555271 else
3956
- GraphreeD.clipboard = tmp;
5272
+ Grafreed.clipboard = tmp;
39575273 }
39585274 else
3959
- if (GraphreeD.clipboardIsTempGroup)
5275
+ if (Grafreed.clipboardIsTempGroup)
39605276 tGroup.add/*Child*/(child);
39615277 else
3962
- GraphreeD.clipboard = child;
5278
+ Grafreed.clipboard = child;
39635279 }
39645280
39655281 }
3966
- if (GraphreeD.clipboardIsTempGroup)
3967
- GraphreeD.clipboard = tGroup;
5282
+
5283
+ if (Grafreed.clipboardIsTempGroup)
5284
+ Grafreed.clipboard = tGroup;
5285
+
39685286 if (cut)
39695287 {
39705288 ResetModel();
....@@ -3974,11 +5292,15 @@
39745292
39755293 void paste(boolean expand)
39765294 {
3977
- // if (GraphreeD.clipboard == null)
5295
+ if (Globals.REPLACEONMAKE)
5296
+ Save();
5297
+ boolean keep = Globals.REPLACEONMAKE;
5298
+ Globals.REPLACEONMAKE = false;
5299
+ // if (GrafreeD.clipboard == null)
39785300 // return;
39795301 boolean first = true;
39805302
3981
- if (GraphreeD.clipboardIsTempGroup)
5303
+ if (Grafreed.clipboardIsTempGroup)
39825304 {
39835305 Composite temp;
39845306
....@@ -3989,7 +5311,7 @@
39895311 temp = (Composite)Applet3D.clipboard.deepCopy();
39905312 */
39915313 Object3D elem;
3992
- for (Enumeration e = /*temp.children*/GraphreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
5314
+ for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
39935315 {
39945316 Object3D child = (Object3D)e.nextElement();
39955317
....@@ -4003,7 +5325,7 @@
40035325 else
40045326 elem = child.deepCopy(); // ?
40055327 child.parent = keepparent;
4006
- //if (GraphreeD.clipboardIsTempGroup && LA.isIdentity(elem.fromParent))
5328
+ //if (GrafreeD.clipboardIsTempGroup && LA.isIdentity(elem.fromParent))
40075329 // elem = elem.get(0);
40085330 makeSomething(elem, true); // ?? first);
40095331 //group.addChild(elem);
....@@ -4023,23 +5345,24 @@
40235345 //Object3D cb = Applet3D.clipboard;
40245346 //temp.addChild(cb);
40255347 //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0));
4026
- assert(GraphreeD.clipboard.parent == null);
4027
- Object3D /*Composite*/ keepparent = GraphreeD.clipboard.get(0).parent;
4028
- GraphreeD.clipboard.get(0).parent = null; // Avoid copy?
4029
- if (LA.isIdentity(GraphreeD.clipboard.toParent))
4030
- makeSomething(expand?GraphreeD.clipboard.get(0).copyExpand():GraphreeD.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());
40315353 else
4032
- makeSomething(expand?GraphreeD.clipboard.copyExpand():GraphreeD.clipboard.deepCopy());
4033
- GraphreeD.clipboard.get(0).parent = keepparent;
5354
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
5355
+ Grafreed.clipboard.get(0).parent = keepparent;
40345356 }
40355357
5358
+ Globals.REPLACEONMAKE = keep;
40365359 ResetModel();
40375360 refreshContents();
40385361 }
40395362
4040
- void pasteInto(boolean copyit)
5363
+ void pasteInto(boolean copyit, boolean clone)
40415364 {
4042
-// if (GraphreeD.clipboard == null)
5365
+// if (GrafreeD.clipboard == null)
40435366 // return;
40445367
40455368 if (group.selection.size() != 1)
....@@ -4066,15 +5389,22 @@
40665389 if (copyit)
40675390 {
40685391 // paste(false);
4069
- CloneClipboard(false); // sept 2014
5392
+ if (clone)
5393
+ {
5394
+ CloneClipboard(false); // sept 2014
5395
+ }
5396
+ else
5397
+ {
5398
+ paste(false);
5399
+ }
40705400 }
40715401 else
40725402 {
40735403 boolean first = true;
40745404
4075
- if (GraphreeD.clipboardIsTempGroup)
5405
+ if (Grafreed.clipboardIsTempGroup)
40765406 {
4077
- Composite temp = (Composite)GraphreeD.clipboard;
5407
+ Composite temp = (Composite)Grafreed.clipboard;
40785408 Object3D copy;
40795409 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
40805410 {
....@@ -4084,7 +5414,7 @@
40845414 }
40855415 } else
40865416 {
4087
- linkSomething(GraphreeD.clipboard); //.get(0));
5417
+ linkSomething(Grafreed.clipboard); //.get(0));
40885418 }
40895419 }
40905420 }
....@@ -4161,6 +5491,10 @@
41615491
41625492 void group(Object3D csg, boolean grab)
41635493 {
5494
+ if (Globals.REPLACEONMAKE)
5495
+ Save();
5496
+ boolean keep = Globals.REPLACEONMAKE;
5497
+ Globals.REPLACEONMAKE = false;
41645498 if (//false) // why??
41655499 !group.selection.isEmpty())
41665500 {
....@@ -4274,8 +5608,34 @@
42745608 //node.add(csg);
42755609 //makeSomething(node);
42765610 makeSomething(csg);
5611
+ Globals.REPLACEONMAKE = keep;
42775612 }
42785613
5614
+ void Ungroup(Object3D g)
5615
+ {
5616
+ if (Globals.REPLACEONMAKE)
5617
+ Save();
5618
+ boolean keep = Globals.REPLACEONMAKE;
5619
+ Globals.REPLACEONMAKE = false;
5620
+ if (g instanceof HiddenObject)
5621
+ {
5622
+ HiddenObject h = (HiddenObject) g;
5623
+
5624
+ for (int i=0; i<h.ActualSize(); i++)
5625
+ {
5626
+ objEditor.makeSomething(h.get(i), false);
5627
+ }
5628
+ }
5629
+ else
5630
+ {
5631
+ for (int i=0; i<g.Size(); i++)
5632
+ {
5633
+ objEditor.makeSomething(g.get(i), false);
5634
+ }
5635
+ }
5636
+ Globals.REPLACEONMAKE = keep;
5637
+ }
5638
+
42795639 void ungroup()
42805640 {
42815641 /*
....@@ -4469,21 +5829,6 @@
44695829 }
44705830 */
44715831
4472
- void ImportGFD()
4473
- {
4474
- FileDialog browser = new FileDialog(objEditor.frame, "Import GraphreeD", FileDialog.LOAD);
4475
- browser.show();
4476
- String filename = browser.getFile();
4477
- if (filename != null && filename.length() > 0)
4478
- {
4479
- String fullname = browser.getDirectory() + filename;
4480
-
4481
- //Object3D readobj =
4482
- objEditor.ReadGFD(fullname, objEditor);
4483
- //makeSomething(readobj);
4484
- }
4485
- }
4486
-
44875832 /*
44885833 public void Callback(Object obj)
44895834 {
....@@ -4507,26 +5852,9 @@
45075852 }
45085853 */
45095854
4510
- void ImportVRMLX3D()
4511
- {
4512
- if (GraphreeD.standAlone)
4513
- {
4514
- /**/
4515
- FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
4516
- browser.show();
4517
- String filename = browser.getFile();
4518
- if (filename != null && filename.length() > 0)
4519
- {
4520
- String fullname = browser.getDirectory() + filename;
4521
- LoadVRMLX3D(fullname);
4522
- }
4523
- /**/
4524
- }
4525
- }
4526
-
45275855 String GetFile(String dialogName)
45285856 {
4529
- if (GraphreeD.standAlone)
5857
+ if (Grafreed.standAlone)
45305858 {
45315859 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
45325860 browser.show();
....@@ -4590,10 +5918,49 @@
45905918 cButton flashSelectionButton;
45915919 cButton editButton;
45925920 cButton uneditButton;
5921
+ JCheckBox allParamsButton;
45935922 cButton clearpanelButton;
4594
- cButton allParamsButton;
45955923 cButton unselectButton;
45965924
5925
+ cButton restoreCameraButton;
5926
+
5927
+ cButton saveButton;
5928
+ 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;
5963
+
45975964 cButton screenfitButton;
45985965 cButton screenfitpointButton;
45995966 cButton snapobjectButton;
....@@ -4605,14 +5972,6 @@
46055972
46065973 cButton setsupportButton;
46075974
4608
- cButton twoButton;
4609
- cButton sixButton;
4610
- cButton threeButton;
4611
- cButton sevenButton;
4612
- cButton fourButton; // full panel
4613
- cButton oneButton; // full XYZ
4614
- //cButton currentLayout;
4615
-
46165975 //
46175976 //Composite
46185977 Object3D // to do !!
....@@ -4622,9 +5981,11 @@
46225981 //JTree jTree;
46235982 private MenuItem lookAtItem;
46245983 private MenuItem lookFromItem;
4625
- private MenuItem switchItem;
5984
+ private MenuItem switchViewItem;
46265985 private MenuItem cutItem;
4627
- private MenuItem duplicateItem;
5986
+ private MenuItem undoItem;
5987
+ private MenuItem redoItem;
5988
+ private JMenuItem duplicateItem;
46285989 private MenuItem cloneItem;
46295990 private MenuItem cloneSupportItem;
46305991 private MenuItem overwriteGeoItem;
....@@ -4635,8 +5996,9 @@
46355996 private MenuItem resetsupportItem;
46365997 private MenuItem resetreferencesItem;
46375998 private MenuItem linkverticesItem;
5999
+ private MenuItem relinkverticesItem;
46386000 private MenuItem setMasterItem;
4639
- private MenuItem resetMeshItem;
6001
+ private MenuItem resetAllItem;
46406002 private MenuItem stepAllItem;
46416003 private MenuItem revertMeshItem;
46426004 private MenuItem poseMeshItem;
....@@ -4647,14 +6009,17 @@
46476009 private MenuItem mergeGeometriesItem;
46486010 private MenuItem copyItem;
46496011 private MenuItem pasteItem;
6012
+ private MenuItem pasteIntoItem;
46506013 private MenuItem pasteLinkItem;
46516014 private MenuItem pasteCloneItem;
46526015 private MenuItem pasteExpandItem;
4653
- private MenuItem clearItem;
6016
+ private MenuItem deleteItem;
46546017 private MenuItem clearAllItem;
46556018 private MenuItem genUVItem;
6019
+ private MenuItem genNormalsMESHItem;
46566020 private MenuItem genNormalsCADItem;
46576021 private MenuItem genNormalsORGANItem;
6022
+ private MenuItem genNormalsMINEItem;
46586023 private MenuItem stripifyItem;
46596024 private MenuItem unstripifyItem;
46606025 private MenuItem trimItem;
....@@ -4683,6 +6048,10 @@
46836048 private MenuItem showleavesItem;
46846049 private MenuItem markleavesItem;
46856050 private MenuItem unmarkleavesItem;
6051
+ private MenuItem rewindleavesItem;
6052
+ private MenuItem unrewindleavesItem;
6053
+ private MenuItem randomleavesItem;
6054
+ private MenuItem unrandomleavesItem;
46866055
46876056 private MenuItem flipVItem;
46886057 private MenuItem unflipVItem;
....@@ -4694,14 +6063,17 @@
46946063 private MenuItem panoTexturesItem;
46956064
46966065 private MenuItem resetCentroidItem;
4697
- private MenuItem transformgeometryItem;
6066
+ private MenuItem resetCentroidXZItem;
46986067 private MenuItem resetTransformItem;
6068
+ private MenuItem transformGeometryItem;
6069
+ private MenuItem transformChildrenItem;
6070
+ private MenuItem hideItem;
46996071 private MenuItem grabItem;
47006072 private MenuItem backItem;
47016073 private MenuItem frontItem;
47026074 private MenuItem cameraItem;
47036075 private MenuItem compositeItem;
4704
- private MenuItem randomItem;
6076
+ private MenuItem switchItem;
47056077 private MenuItem physicsItem;
47066078 private MenuItem frameselectorItem;
47076079 private MenuItem scriptNodeItem;
....@@ -4716,6 +6088,7 @@
47166088
47176089 private MenuItem resetParentItem;
47186090 private MenuItem repairParentItem;
6091
+ private MenuItem repairShadowItem;
47196092 private MenuItem sortbysizeItem;
47206093 private MenuItem sortbynameItem;
47216094
....@@ -4724,20 +6097,25 @@
47246097 private MenuItem attachBumpItem;
47256098 private MenuItem detachBumpItem;
47266099 private MenuItem pigmentBumpItem;
6100
+ private MenuItem embedTexturesItem;
6101
+ private MenuItem deEmbedTexturesItem;
47276102
47286103 private MenuItem particleItem;
47296104 private MenuItem ragdollItem;
47306105 private MenuItem ragdoll2Item;
6106
+ private MenuItem heightFieldItem;
6107
+ private MenuItem textureFieldItem;
47316108 private MenuItem gridItem;
47326109 private MenuItem rectoidItem;
47336110 private MenuItem ellipsoidItem;
47346111 private MenuItem coneItem;
47356112 private MenuItem torusItem;
47366113 private MenuItem superItem;
6114
+ private MenuItem kleinItem;
47376115 private MenuItem blobItem;
47386116 private MenuItem latheItem;
47396117 private MenuItem bezierItem;
4740
- private MenuItem checkerItem;
6118
+ private MenuItem overlayItem;
47416119 private MenuItem meshItem;
47426120 // private MenuItem meshGroupItem;
47436121 private MenuItem springItem;
....@@ -4746,6 +6124,7 @@
47466124 private MenuItem csgItem;
47476125 private MenuItem templateItem;
47486126 private MenuItem textureItem;
6127
+ private MenuItem billboardItem;
47496128 private MenuItem shadowXItem;
47506129 private MenuItem shadowYItem;
47516130 private MenuItem shadowZItem;
....@@ -4758,11 +6137,6 @@
47586137 private MenuItem doubleItem;
47596138 private MenuItem tripleItem;
47606139
4761
- private MenuItem importGFDItem;
4762
- private MenuItem importVRMLX3DItem;
4763
- private MenuItem import3DSItem;
4764
- private MenuItem importOBJItem;
4765
-
47666140 private MenuItem computeAOItem;
47676141 private MenuItem recompileItem;
47686142 private MenuItem editScriptItem;
....@@ -4772,4 +6146,8 @@
47726146 private MenuItem analyzeItem;
47736147 private MenuItem dumpItem;
47746148 //boolean freezemodel = false;
6149
+
6150
+ Menu cameraMenu;
6151
+ MenuItem editCameraItem;
6152
+ MenuItem restoreCameraItem;
47756153 }