Normand Briere
2019-07-28 d7fd07756f4095cb87dc25d89fcffcbda092e2cf
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,237 @@
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 + "/" + s + ".jpg", !Grafreed.NIMBUSLAF));
32
+ row.add(skyboxButton = GetButton(path + "/negx.jpg", !Grafreed.NIMBUSLAF));
33
+ skyboxButton.setToolTipText(s);
34
+ skyboxButton.addActionListener(new ActionListener()
35
+ {
36
+ @Override
37
+ public void actionPerformed(ActionEvent e)
38
+ {
39
+ ChangeSkybox(path);
40
+ }
41
+ });
42
+ }
43
+
44
+ public void AddSkyboxTab0(JTabbedPane skyboxpanel)
45
+ {
46
+ cGridBag tab0 = new cGridBag().setVertical(true);
47
+
48
+ tab0.setName("Urban");
49
+ skyboxpanel.add(tab0);
50
+
51
+ cGridBag row0 = new cGridBag();
52
+ cGridBag row1 = new cGridBag();
53
+ cGridBag row2 = new cGridBag();
54
+ cGridBag row3 = new cGridBag();
55
+ cGridBag row4 = new cGridBag();
56
+ cGridBag row5 = new cGridBag();
57
+ cGridBag row6 = new cGridBag();
58
+
59
+ AddSkyboxButton("default", "rgb", row0);
60
+ AddSkyboxButton("default", "cornell", row0);
61
+ AddSkyboxButton("default", "uffizi", row0);
62
+ AddSkyboxButton("default", "CloudyHills", row0);
63
+
64
+ AddSkyboxButton("default", "skycube", row1);
65
+ AddSkyboxButton("bridge", "Bridge", row1);
66
+ AddSkyboxButton("bridge", "Bridge2", row1);
67
+ AddSkyboxButton("urban", "GamlaStan2", row1);
68
+
69
+ AddSkyboxButton("urban", "Parliament", row2);
70
+ AddSkyboxButton("urban", "Roundabout", row2);
71
+ AddSkyboxButton("urban", "SaintLazarusChurch", row2);
72
+ AddSkyboxButton("urban", "SaintLazarusChurch2", row2);
73
+
74
+ AddSkyboxButton("urban", "SaintLazarusChurch3", row3);
75
+ AddSkyboxButton("urban", "UnionSquare", row3);
76
+ AddSkyboxButton("park", "BerzeliiPark", row3);
77
+ AddSkyboxButton("park", "Buddha", row3);
78
+
79
+ AddSkyboxButton("park", "CNTower2", row4);
80
+ AddSkyboxButton("park", "NiagaraFalls1", row4);
81
+ AddSkyboxButton("park", "NiagaraFalls3", row4);
82
+ AddSkyboxButton("park", "Park", row4);
83
+
84
+ AddSkyboxButton("park", "Pond", row5);
85
+ AddSkyboxButton("park", "Skansen", row5);
86
+ AddSkyboxButton("park", "Skansen2", row5);
87
+ AddSkyboxButton("park", "Skansen3", row5);
88
+
89
+ AddSkyboxButton("park", "Skansen4", row6);
90
+ AddSkyboxButton("park", "Skansen5", row6);
91
+ AddSkyboxButton("park", "Stairs", row6);
92
+ AddSkyboxButton("park", "Tantolunden4", row6);
93
+
94
+ tab0.add(row0);
95
+ tab0.add(row1);
96
+ tab0.add(row2);
97
+ tab0.add(row3);
98
+ tab0.add(row4);
99
+ tab0.add(row5);
100
+ tab0.add(row6);
101
+
102
+ for (int i=5; --i>=0;)
103
+ {
104
+ //oe.toolboxPanel.Return();
105
+ //tab0.add(new cGridBag());
106
+ }
107
+ }
108
+
109
+ public void AddSkyboxTab1(JTabbedPane skyboxpanel)
110
+ {
111
+ cGridBag tab0 = new cGridBag().setVertical(true);
112
+
113
+ tab0.setName("Nature");
114
+ skyboxpanel.add(tab0);
115
+
116
+ cGridBag row0 = new cGridBag();
117
+ cGridBag row1 = new cGridBag();
118
+ cGridBag row2 = new cGridBag();
119
+ cGridBag row3 = new cGridBag();
120
+ cGridBag row4 = new cGridBag();
121
+ cGridBag row5 = new cGridBag();
122
+ cGridBag row6 = new cGridBag();
123
+
124
+ AddSkyboxButton("beach", "HeartInTheSand", row0);
125
+ AddSkyboxButton("beach", "LarnacaBeach", row0);
126
+ AddSkyboxButton("beach", "PalmTrees", row0);
127
+ AddSkyboxButton("beach", "Tenerife", row0);
128
+
129
+ AddSkyboxButton("beach", "Tenerife2", row1);
130
+ AddSkyboxButton("beach", "Tenerife3", row1);
131
+ AddSkyboxButton("field", "FishPond", row1);
132
+ AddSkyboxButton("field", "Footballfield", row1);
133
+
134
+ AddSkyboxButton("field", "Meadow", row2);
135
+ AddSkyboxButton("field", "Sorsele", row2);
136
+ AddSkyboxButton("field", "Sorsele2", row2);
137
+ AddSkyboxButton("field", "Sorsele3", row2);
138
+
139
+ AddSkyboxButton("forest", "Brudslojan", row3);
140
+ AddSkyboxButton("forest", "Langholmen2", row3);
141
+ AddSkyboxButton("forest", "Plants", row3);
142
+ AddSkyboxButton("mountain", "Maskonaive", row3);
143
+ AddSkyboxButton("mountain", "Maskonaive2", row4);
144
+
145
+ AddSkyboxButton("mountain", "Maskonaive3", row4);
146
+ AddSkyboxButton("mountain", "Ryfjallet", row4);
147
+ AddSkyboxButton("mountain", "Teide", row4);
148
+
149
+ AddSkyboxButton("rocky", "Langholmen", row5);
150
+ AddSkyboxButton("rocky", "Riddarfjarden", row5);
151
+ AddSkyboxButton("rocky", "Skinnarviksberget", row5);
152
+ AddSkyboxButton("rocky", "Tantolunden6", row5);
153
+ /*
154
+Kastellholmen
155
+Langholmen
156
+Riddarfjarden
157
+Skinnarviksberget
158
+Tanto
159
+Tantolunden2
160
+Tantolunden6
161
+ */
162
+
163
+ tab0.add(row0);
164
+ tab0.add(row1);
165
+ tab0.add(row2);
166
+ tab0.add(row3);
167
+ tab0.add(row4);
168
+ tab0.add(row5);
169
+ tab0.add(row6);
170
+
171
+ for (int i=5; --i>=0;)
172
+ {
173
+ //oe.toolboxPanel.Return();
174
+ //tab0.add(new cGridBag());
175
+ }
176
+ }
177
+
178
+ public void AddSkyboxTab2(JTabbedPane skyboxpanel)
179
+ {
180
+ cGridBag tab0 = new cGridBag().setVertical(true);
181
+
182
+ tab0.setName("Night");
183
+ skyboxpanel.add(tab0);
184
+
185
+ cGridBag row0 = new cGridBag();
186
+ cGridBag row1 = new cGridBag();
187
+ cGridBag row2 = new cGridBag();
188
+ cGridBag row3 = new cGridBag();
189
+ cGridBag row4 = new cGridBag();
190
+ cGridBag row5 = new cGridBag();
191
+ cGridBag row6 = new cGridBag();
192
+
193
+ AddSkyboxButton("night", "NightPath", row0);
194
+ AddSkyboxButton("night", "PondNight", row0);
195
+ AddSkyboxButton("night", "Powerlines", row0);
196
+ AddSkyboxButton("night", "SwedishRoyalCastle", row0);
197
+
198
+ AddSkyboxButton("urban", "CNTower", row1);
199
+ AddSkyboxButton("bridge", "ArstaBridge", row1);
200
+ AddSkyboxButton("indoors", "DallasW", row1);
201
+ AddSkyboxButton("indoors", "MarriottMadisonWest", row1);
202
+
203
+ AddSkyboxButton("indoors", "Vasa", row2);
204
+ AddSkyboxButton("winter", "Backyard", row2);
205
+ AddSkyboxButton("winter", "Creek", row2);
206
+ AddSkyboxButton("winter", "FootballField3", row2);
207
+
208
+ AddSkyboxButton("winter", "Forest", row3);
209
+ AddSkyboxButton("winter", "HornstullsStrand2", row3);
210
+ AddSkyboxButton("winter", "House", row3);
211
+ AddSkyboxButton("winter", "IceLake", row3);
212
+
213
+ AddSkyboxButton("winter", "IceRiver", row4);
214
+ AddSkyboxButton("winter", "Park3", row4);
215
+ AddSkyboxButton("winter", "PondWinter", row4);
216
+
217
+ AddSkyboxButton("winter", "Tantolunden5", row5);
218
+ AddSkyboxButton("winter", "Vindelalven", row5);
219
+ /*
220
+Backyard
221
+Creek
222
+FootballField3
223
+Forest
224
+HornstullsStrand2
225
+House
226
+IceLake
227
+IceRiver
228
+Park3
229
+PondWinter
230
+Tantolunden5
231
+Vindelalven *
232
+ */
233
+
234
+ tab0.add(row0);
235
+ tab0.add(row1);
236
+ tab0.add(row2);
237
+ tab0.add(row3);
238
+ tab0.add(row4);
239
+ tab0.add(row5);
240
+ tab0.add(row6);
241
+
242
+ for (int i=5; --i>=0;)
243
+ {
244
+ //oe.toolboxPanel.Return();
245
+ //tab0.add(new cGridBag());
246
+ }
247
+ }
248
+
249
+ public void ChangeSkybox(String name)
250
+ {
251
+ cameraView.envyoff = false;
252
+ cameraView.skyboxname = name;
253
+ cameraView.skyboxext = "jpg";
254
+ cameraView.repaint();
255
+ }
256
+
25257 //ObjEditor objEditor;
26258 public void closeUI2()
27259 {
....@@ -59,6 +291,12 @@
59291 this.copy = this.group = group;
60292 //selectees = this.group.selectees;
61293
294
+ if (copy.versions == null)
295
+ {
296
+ copy.versions = new byte[100][];
297
+ copy.versionindex = -1;
298
+ }
299
+
62300 if(ui)
63301 SetupUI(objEditor);
64302 }
....@@ -73,17 +311,29 @@
73311 this.copy = this.group = copy;
74312 //selectees = this.group.selectees;
75313
76
- SetupMenu2(objEditor);
314
+ SetupMenu2(this); //objEditor);
77315 SetupUI2(objEditor);
78316 objEditor.SetupUI(true);
79317 SetupViews(objEditor);
80318
81319 ((cRadio)radioPanel.getComponent(0)).SetCamera(cameraView.renderCamera, true);
320
+
321
+ if (copy.versions == null)
322
+ {
323
+ copy.versions = new byte[100][];
324
+ copy.versionindex = -1;
325
+
326
+ Save(true);
327
+ }
82328 }
83329
84330 void CloneSelection(boolean supports)
85331 {
86
- // Object3D keep = GraphreeD.clipboard;
332
+ if (Globals.REPLACEONMAKE)
333
+ Save();
334
+ boolean keep = Globals.REPLACEONMAKE;
335
+ Globals.REPLACEONMAKE = false;
336
+ // Object3D keep = GrafreeD.clipboard;
87337 //Object3D obj;
88338 for (int i=0; i<group.selection.size(); i++)// Enumeration e = group.selection.elements(); e.hasMoreElements();)
89339 {
....@@ -93,18 +343,19 @@
93343
94344 makeSomething(clone, i==group.selection.size()-1);
95345 }
346
+ Globals.REPLACEONMAKE = keep;
96347 }
97348
98349 void CloneClipboard(boolean supports)
99350 {
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));
351
+ assert(Grafreed.clipboard.parent == null);
352
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
353
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
354
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
355
+ makeSomething(CloneObject(Grafreed.clipboard.get(0), false));
105356 else
106
- makeSomething(CloneObject(GraphreeD.clipboard, false));
107
- GraphreeD.clipboard.get(0).parent = keepparent;
357
+ makeSomething(CloneObject(Grafreed.clipboard, false));
358
+ Grafreed.clipboard.get(0).parent = keepparent;
108359 }
109360
110361 static Object3D CloneObject(Object3D obj, boolean supports)
....@@ -118,7 +369,7 @@
118369 // obj.support = null;
119370 if (!supports)
120371 obj.SaveSupports();
121
- Object3D clone = (Object3D)GraphreeD.clone(obj);
372
+ Object3D clone = (Object3D)Grafreed.clone(obj);
122373 obj.parent = parent;
123374 // obj.support = support;
124375 // clone.support = support; // aout 2013
....@@ -147,30 +398,29 @@
147398
148399 //JTextField nameField;
149400
150
- void SetupMenu2(ObjEditor oe)
401
+ void SetupMenu2(GroupEditor oe)
151402 {
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);
403
+ oe.jTree = new cTree();
404
+
163405 Menu menu;
164406 oe.menuBar.add(menu = new Menu("Edit"));
165407 //editItem = menu.add(new MenuItem("Edit"));
166408 //editItem.addActionListener(this);
167
- duplicateItem = menu.add(new MenuItem("Duplicate"));
409
+
410
+// undoItem = menu.add(new MenuItem("Undo"));
411
+// undoItem.addActionListener(this);
412
+// redoItem = menu.add(new MenuItem("Redo"));
413
+// redoItem.addActionListener(this);
414
+// menu.add("-");
415
+ duplicateItem = oe.jTree.popup.add(new JMenuItem("Duplicate"));
168416 duplicateItem.addActionListener(this);
169
- menu.add("-");
170417 cloneItem = menu.add(new MenuItem("Clone"));
171418 cloneItem.addActionListener(this);
419
+ if (Globals.ADVANCED)
420
+ {
172421 cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
173422 cloneSupportItem.addActionListener(this);
423
+ }
174424 menu.add("-");
175425 cutItem = menu.add(new MenuItem("Cut"));
176426 cutItem.addActionListener(this);
....@@ -178,26 +428,123 @@
178428 copyItem.addActionListener(this);
179429 pasteItem = menu.add(new MenuItem("Paste"));
180430 pasteItem.addActionListener(this);
431
+
432
+ menu.add("-");
433
+ pasteIntoItem = menu.add(new MenuItem("Paste into"));
434
+ pasteIntoItem.addActionListener(this);
181435 pasteLinkItem = menu.add(new MenuItem("Paste link"));
182436 pasteLinkItem.addActionListener(this);
183437 pasteCloneItem = menu.add(new MenuItem("Paste clone"));
184438 pasteCloneItem.addActionListener(this);
185439 // pasteExpandItem = menu.add(new MenuItem("Paste expand"));
186440 // pasteExpandItem.addActionListener(this);
187
- clearItem = menu.add(new MenuItem("Clear"));
188
- clearItem.addActionListener(this);
441
+ menu.add("-");
442
+ deleteItem = menu.add(new MenuItem("Delete"));
443
+ deleteItem.addActionListener(this);
444
+
445
+ if (Globals.ADVANCED)
446
+ {
447
+ // Deletes the cameras...
189448 clearAllItem = menu.add(new MenuItem("Clear All"));
190449 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);
450
+ }
451
+
452
+ menuBar.add(cameraMenu = new Menu("View"));
453
+ //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer"));
454
+ //zBufferItem.addActionListener(this);
455
+ //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens"));
456
+ //normalLensItem.addActionListener(this);
457
+ cameraMenu.add(restoreCameraItem = new MenuItem("Restore Viewpoint"));
458
+ restoreCameraItem.addActionListener(this);
459
+
460
+// cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen"));
461
+// toggleFullScreenItem.addItemListener(this);
462
+// toggleFullScreenItem.setState(CameraPane.FULLSCREEN);
463
+// cameraMenu.add("-");
464
+//
465
+// cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture"));
466
+// toggleTextureItem.addItemListener(this);
467
+// toggleTextureItem.setState(CameraPane.textureon);
468
+//
469
+// cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch"));
470
+// toggleSwitchItem.addItemListener(this);
471
+// toggleSwitchItem.setState(CameraPane.SWITCH);
472
+
473
+ cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Show Handles"));
474
+ toggleHandleItem.addItemListener(this);
475
+ toggleHandleItem.setState(CameraPane.HANDLES);
476
+
477
+ cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode"));
478
+ togglePaintItem.addItemListener(this);
479
+ togglePaintItem.setState(CameraPane.PAINTMODE);
480
+
481
+ if (Globals.ADVANCED)
482
+ {
483
+ cameraMenu.add("-");
484
+ cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live"));
485
+ toggleLiveItem.addItemListener(this);
486
+ toggleLiveItem.setState(Globals.isLIVE());
487
+
488
+ cameraMenu.add(stepItem = new MenuItem("Step"));
489
+ stepItem.addActionListener(this);
490
+ // cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List"));
491
+ // toggleDLItem.addItemListener(this);
492
+ // toggleDLItem.setState(false);
493
+
494
+ cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render"));
495
+ toggleRenderItem.addItemListener(this);
496
+ toggleRenderItem.setState(!CameraPane.frozen);
497
+
498
+ cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug"));
499
+ toggleDebugItem.addItemListener(this);
500
+ toggleDebugItem.setState(Globals.DEBUG);
501
+
502
+ cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum"));
503
+ toggleFrustumItem.addItemListener(this);
504
+ toggleFrustumItem.setState(CameraPane.FRUSTUM);
505
+
506
+ cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact"));
507
+ toggleFootContactItem.addItemListener(this);
508
+ toggleFootContactItem.setState(CameraPane.FOOTCONTACT);
509
+
510
+ cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline"));
511
+ toggleTimelineItem.addItemListener(this);
512
+ }
513
+
514
+// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root"));
515
+// toggleRootItem.addItemListener(this);
516
+// toggleRootItem.setState(false);
517
+// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation"));
518
+// animationItem.addItemListener(this);
519
+// animationItem.setState(CameraPane.ANIMATION);
520
+ cameraMenu.add("-");
521
+ cameraMenu.add(editCameraItem = new MenuItem("Save Viewpoint"));
522
+ editCameraItem.addActionListener(this);
523
+
524
+ if (Globals.ADVANCED)
525
+ {
526
+ oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
527
+ //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
528
+ //cameraMenu.add(switchViewItem = new MenuItem("Reverse View"));
529
+ editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf"));
530
+ oe.cameraMenu.add("-");
531
+ openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy..."));
532
+ openWindowItem.addActionListener(this);
533
+ editLeafItem.addActionListener(this);
534
+ lookAtItem.addActionListener(this);
535
+ //lookFromItem.addActinoListener(this);
536
+ //switchViewItem.addActionListener(this);
537
+ }
538
+
539
+ oe.menuBar.add(menu = new Menu("Setting"));
540
+ if (Globals.ADVANCED)
541
+ {
196542 revertMeshItem = menu.add(new MenuItem("Revert Meshes"));
197543 revertMeshItem.addActionListener(this);
198544 resetreferencesItem = menu.add(new MenuItem("Reset Mesh References"));
199545 resetreferencesItem.addActionListener(this);
200546 menu.add("-");
547
+ }
201548 overwriteGeoItem = menu.add(new MenuItem("Overwrite Geometry"));
202549 overwriteGeoItem.addActionListener(this);
203550 overwriteMatItem = menu.add(new MenuItem("Overwrite Material"));
....@@ -209,72 +556,104 @@
209556 overwriteUVItem = menu.add(new MenuItem("Overwrite UV"));
210557 overwriteUVItem.addActionListener(this);
211558 menu.add("-");
559
+ if (Globals.ADVANCED)
560
+ {
212561 generateMeshItem = menu.add(new MenuItem("Generate Meshes"));
213562 generateMeshItem.addActionListener(this);
214563 poseMeshItem = menu.add(new MenuItem("Set Pose Meshes"));
215564 poseMeshItem.addActionListener(this);
216565 menu.add("-");
566
+ }
217567 resetsupportItem = menu.add(new MenuItem("Reset support"));
218568 resetsupportItem.addActionListener(this);
219569 linkverticesItem = menu.add(new MenuItem("Link to Support"));
220570 linkverticesItem.addActionListener(this);
571
+ relinkverticesItem = menu.add(new MenuItem("Re-link to Support"));
572
+ relinkverticesItem.addActionListener(this);
573
+
574
+ if (Globals.ADVANCED)
575
+ {
221576 setMasterItem = menu.add(new MenuItem("Set Master Mesh"));
222577 setMasterItem.addActionListener(this);
578
+ }
223579
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);
580
+ oe.menuBar.add(menu = new Menu("Group"));
581
+// grabItem = menu.add(new MenuItem("Grab"));
582
+// grabItem.addActionListener(this);
229583 backItem = menu.add(new MenuItem("Back"));
230584 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);
585
+ frontItem = menu.add(new MenuItem("Front"));
586
+ frontItem.addActionListener(this);
587
+// compositeItem = menu.add(new MenuItem("Composite"));
588
+// compositeItem.addActionListener(this);
589
+
590
+ if (Globals.ADVANCED)
591
+ {
592
+ hideItem = menu.add(new MenuItem("Hidden Group"));
593
+ hideItem.addActionListener(this);
594
+ }
595
+ ungroupItem = menu.add(new MenuItem("Ungroup"));
596
+ ungroupItem.addActionListener(this);
597
+
598
+// menu.add("-");
599
+//
600
+// switchItem = menu.add(new MenuItem("Switch node"));
601
+// switchItem.addActionListener(this);
602
+ if (Globals.ADVANCED)
603
+ {
240604 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
241605 switchGeoItem.addActionListener(this);
242606 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
243607 switchTransfoItem.addActionListener(this);
244
- morphItem = menu.add(new MenuItem("Morph"));
608
+ morphItem = menu.add(new MenuItem("Morph Group"));
245609 morphItem.addActionListener(this);
610
+
611
+ menu.add("-");
612
+ physicsItem = menu.add(new MenuItem("Physics"));
613
+ physicsItem.addActionListener(this);
614
+ frameselectorItem = menu.add(new MenuItem("Frame Selector"));
615
+ frameselectorItem.addActionListener(this);
246616 scriptNodeItem = menu.add(new MenuItem("Script Node"));
247617 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);
618
+ }
619
+
620
+ oe.menuBar.add(menu = new Menu("Object"));
621
+// textureItem = menu.add(new MenuItem("Texture"));
622
+// textureItem.addActionListener(this);
623
+ billboardItem = menu.add(new MenuItem("Billboard"));
624
+ billboardItem.addActionListener(this);
253625 csgItem = menu.add(new MenuItem("CSG"));
254626 csgItem.addActionListener(this);
255
- shadowXItem = menu.add(new MenuItem("Shadow X"));
627
+ shadowXItem = menu.add(new MenuItem("Shadow Red"));
256628 shadowXItem.addActionListener(this);
257
- shadowYItem = menu.add(new MenuItem("Shadow Y"));
629
+ shadowYItem = menu.add(new MenuItem("Shadow Green"));
258630 shadowYItem.addActionListener(this);
259
- shadowZItem = menu.add(new MenuItem("Shadow Z"));
631
+ shadowZItem = menu.add(new MenuItem("Shadow Blue"));
260632 shadowZItem.addActionListener(this);
633
+ attributeItem = menu.add(new MenuItem("Attribute"));
634
+ attributeItem.addActionListener(this);
635
+
636
+ if (Globals.ADVANCED)
637
+ {
638
+ menu.add("-");
261639 linkerItem = menu.add(new MenuItem("Linker"));
262640 linkerItem.addActionListener(this);
263641 templateItem = menu.add(new MenuItem("Template"));
264642 templateItem.addActionListener(this);
265
- attributeItem = menu.add(new MenuItem("Attribute"));
266
- attributeItem.addActionListener(this);
267643 pointflowItem = menu.add(new MenuItem("Point Flow"));
268644 pointflowItem.addActionListener(this);
645
+ }
269646 menu.add("-");
270
- transformgeometryItem = menu.add(new MenuItem("Transform Geometry"));
271
- transformgeometryItem.addActionListener(this);
272647 resetTransformItem = menu.add(new MenuItem("Reset Transform"));
273648 resetTransformItem.addActionListener(this);
274649 resetCentroidItem = menu.add(new MenuItem("Reset Centroid"));
275650 resetCentroidItem.addActionListener(this);
276
- ungroupItem = menu.add(new MenuItem("Ungroup"));
277
- ungroupItem.addActionListener(this);
651
+ resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY"));
652
+ resetCentroidXZItem.addActionListener(this);
653
+ transformGeometryItem = menu.add(new MenuItem("Transform Geometry"));
654
+ transformGeometryItem.addActionListener(this);
655
+ transformChildrenItem = menu.add(new MenuItem("Transform Children"));
656
+ transformChildrenItem.addActionListener(this);
278657
279658 oe.menuBar.add(menu = new Menu("Geometry"));
280659 genUVItem = menu.add(new MenuItem("Generate UV"));
....@@ -283,6 +662,13 @@
283662 genNormalsORGANItem.addActionListener(this);
284663 genNormalsCADItem = menu.add(new MenuItem("CAD Normals"));
285664 genNormalsCADItem.addActionListener(this);
665
+ genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals"));
666
+ genNormalsMESHItem.addActionListener(this);
667
+ if (Globals.ADVANCED)
668
+ {
669
+ genNormalsMINEItem = menu.add(new MenuItem("Stitch Normals"));
670
+ genNormalsMINEItem.addActionListener(this);
671
+ }
286672 stripifyItem = menu.add(new MenuItem("Stripify"));
287673 stripifyItem.addActionListener(this);
288674 unstripifyItem = menu.add(new MenuItem("Unstripify"));
....@@ -292,8 +678,6 @@
292678 untrimItem = menu.add(new MenuItem("Untrim"));
293679 untrimItem.addActionListener(this);
294680 menu.add("-");
295
- clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
296
- clearMaterialsItem.addActionListener(this);
297681 clearColorsItem = menu.add(new MenuItem("Clear AO"));
298682 clearColorsItem.addActionListener(this);
299683 reverseNormalsItem = menu.add(new MenuItem("Reverse Normals"));
....@@ -306,19 +690,34 @@
306690 reduce34MeshItem.addActionListener(this);
307691 increaseMeshItem = menu.add(new MenuItem("Increase mesh"));
308692 increaseMeshItem.addActionListener(this);
309
- smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
310
- smoothMeshItem.addActionListener(this);
311693 clipMeshItem = menu.add(new MenuItem("Clip mesh"));
312694 clipMeshItem.addActionListener(this);
695
+
696
+ if (Globals.ADVANCED)
697
+ {
698
+ smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
699
+ smoothMeshItem.addActionListener(this);
700
+ }
701
+
702
+ oe.menuBar.add(menu = new Menu("Attributes"));
703
+ clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
704
+ clearMaterialsItem.addActionListener(this);
705
+ resetAllItem = menu.add(new MenuItem("Reset All"));
706
+ resetAllItem.addActionListener(this);
707
+ stepAllItem = menu.add(new MenuItem("Step All"));
708
+ stepAllItem.addActionListener(this);
313709 menu.add("-");
314710 liveleavesItem = menu.add(new MenuItem("Live Leaves"));
315711 liveleavesItem.addActionListener(this);
316712 unliveleavesItem = menu.add(new MenuItem("Unlive Leaves"));
317713 unliveleavesItem.addActionListener(this);
714
+ if (Globals.ADVANCED)
715
+ {
318716 supportleavesItem = menu.add(new MenuItem("Support Leaves"));
319717 supportleavesItem.addActionListener(this);
320718 unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves"));
321719 unsupportleavesItem.addActionListener(this);
720
+ }
322721 hideleavesItem = menu.add(new MenuItem("Hide Leaves"));
323722 hideleavesItem.addActionListener(this);
324723 showleavesItem = menu.add(new MenuItem("Show Leaves"));
....@@ -327,32 +726,31 @@
327726 markleavesItem.addActionListener(this);
328727 unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves"));
329728 unmarkleavesItem.addActionListener(this);
729
+ rewindleavesItem = menu.add(new MenuItem("Rewind Leaves"));
730
+ rewindleavesItem.addActionListener(this);
731
+ unrewindleavesItem = menu.add(new MenuItem("Unrewind Leaves"));
732
+ unrewindleavesItem.addActionListener(this);
733
+ randomleavesItem = menu.add(new MenuItem("Random Leaves"));
734
+ randomleavesItem.addActionListener(this);
735
+ unrandomleavesItem = menu.add(new MenuItem("Unrandom Leaves"));
736
+ unrandomleavesItem.addActionListener(this);
330737 menu.add("-");
331738 flipVItem = menu.add(new MenuItem("Flip V"));
332739 flipVItem.addActionListener(this);
333740 unflipVItem = menu.add(new MenuItem("Unflip V"));
334741 unflipVItem.addActionListener(this);
335
- lowTexturesItem = menu.add(new MenuItem("Low Texture"));
742
+ lowTexturesItem = menu.add(new MenuItem("Low Texture (256)"));
336743 lowTexturesItem.addActionListener(this);
337
- normalTexturesItem = menu.add(new MenuItem("Normal Texture"));
744
+ normalTexturesItem = menu.add(new MenuItem("Normal Texture (512)"));
338745 normalTexturesItem.addActionListener(this);
339
- highTexturesItem = menu.add(new MenuItem("High Texture"));
746
+ highTexturesItem = menu.add(new MenuItem("High Texture (1024)"));
340747 highTexturesItem.addActionListener(this);
341
- veryhighTexturesItem = menu.add(new MenuItem("Very high Texture"));
748
+ veryhighTexturesItem = menu.add(new MenuItem("Very high Texture (2048)"));
342749 veryhighTexturesItem.addActionListener(this);
343
- maxTexturesItem = menu.add(new MenuItem("Max Texture"));
750
+ maxTexturesItem = menu.add(new MenuItem("Max Texture (4096)"));
344751 maxTexturesItem.addActionListener(this);
345
- panoTexturesItem = menu.add(new MenuItem("Panoramic Texture"));
752
+ panoTexturesItem = menu.add(new MenuItem("Panoramic Texture (8192)"));
346753 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);
356754
357755 oe.menuBar.add(menu = new Menu("Selection"));
358756 attachPigmentItem = menu.add(new MenuItem("Attach Pigment..."));
....@@ -361,23 +759,56 @@
361759 attachBumpItem.addActionListener(this);
362760 pigmentBumpItem = menu.add(new MenuItem("Pigment -> Bump"));
363761 pigmentBumpItem.addActionListener(this);
762
+ //embedTexturesItem
364763 detachPigmentItem = menu.add(new MenuItem("Detach Pigment"));
365764 detachPigmentItem.addActionListener(this);
366765 detachBumpItem = menu.add(new MenuItem("Detach Bump"));
367766 detachBumpItem.addActionListener(this);
767
+ embedTexturesItem = menu.add(new MenuItem("Embed Textures"));
768
+ embedTexturesItem.addActionListener(this);
769
+ deEmbedTexturesItem = menu.add(new MenuItem("De-embed Textures"));
770
+ deEmbedTexturesItem.addActionListener(this);
368771 menu.add("-");
369772 sortbysizeItem = menu.add(new MenuItem("Sort by size"));
370773 sortbysizeItem.addActionListener(this);
371774 sortbynameItem = menu.add(new MenuItem("Sort by name"));
372775 sortbynameItem.addActionListener(this);
776
+ menu.add("-");
777
+ shareGeometriesItem = menu.add(new MenuItem("Share Geometries"));
778
+ shareGeometriesItem.addActionListener(this);
779
+ mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries"));
780
+ mergeGeometriesItem.addActionListener(this);
781
+ if (Globals.ADVANCED)
782
+ {
783
+ // Pretty much the same as duplicate and clone.
784
+ extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
785
+ extractGeometriesItem.addActionListener(this);
786
+ cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry"));
787
+ cloneGeometriesItem.addActionListener(this);
788
+ }
789
+
373790 oe.menuBar.add(menu = new Menu("Insert"));
374791 buildCreateMenu(menu);
375
- oe.menuBar.add(menu = new Menu("Tools"));
792
+
793
+ oe.menuBar.add(menu = new Menu("Tools"));
376794 buildToolsMenu(menu);
377795 }
378796
797
+
379798 void SetupUI2(ObjEditor oe)
380799 {
800
+ // June 2019
801
+ if (oe == null)
802
+ {
803
+ //super.SetupUI2(this);
804
+ //return;
805
+ }
806
+
807
+ if (copy != group)
808
+ {
809
+ //super.SetupUI2(this);
810
+ }
811
+
381812 //new Exception().printStackTrace();
382813
383814 oe.radioPanel = new JPanel(new GridBagLayout());
....@@ -406,150 +837,238 @@
406837 oe.radioPanel.add(dummyButton);
407838 oe.buttonGroup.add(dummyButton);
408839 */
409
- aConstraints.gridy += 1;
410
- oe.aConstraints.gridwidth = 1;
411
- oe.aConstraints.gridx = 0;
840
+ cGridBag copyOptionsPanel = new cGridBag();
841
+
842
+ copyOptionsPanel.preferredHeight = 2;
412843
413
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", CameraPane.isLIVE()), oe.aConstraints);
844
+ //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
845
+
846
+ //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
847
+ //minButton.setToolTipText("Minimize window");
848
+ //minButton.addActionListener(this);
849
+
850
+ if (Globals.ADVANCED)
851
+ {
852
+ oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
853
+ maxButton.setToolTipText("Maximize window");
854
+ maxButton.addActionListener(this);
855
+ }
856
+
857
+ oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
858
+ fullButton.setToolTipText("Full-screen window");
859
+ fullButton.addActionListener(this);
860
+
861
+ oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
862
+ screenfitButton.setToolTipText("Screen fit");
863
+ screenfitButton.addActionListener(this);
864
+
865
+ oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
866
+ restoreCameraButton.setToolTipText("Restore viewpoint");
867
+ restoreCameraButton.addActionListener(this);
868
+
869
+ copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
870
+ saveButton.setToolTipText("New version");
871
+ saveButton.addActionListener(this);
872
+
873
+ copyOptionsPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
874
+ undoButton.setToolTipText("Previous version");
875
+ undoButton.addActionListener(this);
876
+ undoButton.setEnabled(false);
877
+
878
+ cGridBag updown = new cGridBag().setVertical(true);
879
+ updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
880
+ restoreButton.setToolTipText("Restore current");
881
+ restoreButton.addActionListener(this);
882
+ restoreButton.setEnabled(false);
883
+
884
+ updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
885
+ replaceButton.setToolTipText("Replace current");
886
+ replaceButton.addActionListener(this);
887
+ replaceButton.setEnabled(false);
888
+
889
+ copyOptionsPanel.add(updown);
890
+
891
+ copyOptionsPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
892
+ redoButton.setToolTipText("Next version");
893
+ redoButton.addActionListener(this);
894
+ redoButton.setEnabled(false);
895
+
896
+ oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints);
897
+ liveCB.setToolTipText("Enable animation");
414898 liveCB.addItemListener(this);
415899
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);
900
+ oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
901
+ oneStepButton.setToolTipText("Animate one step forward");
902
+ oneStepButton.addActionListener(this);
903
+
904
+ oe.toolbarPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints);
905
+ fastCB.setToolTipText("Fast mode");
434906 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);
907
+
908
+ //oe.toolboxPanel.Return();
909
+
910
+// copyOptionsPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints);
911
+// trackCB.setToolTipText("Enable tracking");
912
+// trackCB.addItemListener(this);
441913
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;
482914 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
483915 // 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;
488916
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);
917
+ if (Globals.ADVANCED)
918
+ {
919
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
920
+ snapobjectButton.addActionListener(this);
921
+ snapobjectButton.setToolTipText("Snap Object");
922
+
923
+ oe.toolbarPanel.add(fourButton = GetButton("icons/controls-horizontal.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
504924 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);
925
+ fourButton.setToolTipText("Show control panel only");
926
+ }
927
+
928
+ //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
929
+
930
+ oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
931
+ twoButton.setToolTipText("Show 3D view only");
932
+ twoButton.addActionListener(this);
933
+ this.fullscreenLayout = twoButton;
934
+
935
+ oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
936
+ threeButton.setToolTipText("Show controls and 3D view");
508937 threeButton.addActionListener(this);
509
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
510
- sevenButton.addActionListener(this);
938
+ oe.toolbarPanel.add(sixButton = GetButton("icons/viewcontrols.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
939
+ sixButton.setToolTipText("Show 3D view and controls");
940
+ sixButton.addActionListener(this);
941
+// oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
942
+// sevenButton.setToolTipText("3-column layout");
943
+// sevenButton.addActionListener(this);
511944 //
512945
513
- oe.toolbarPanel.add(rootButton = new cButton(" o o o E ")); //, oe.aConstraints);
946
+ oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
947
+ rootButton.setToolTipText("Open selection in new tab");
514948 rootButton.addActionListener(this);
515
- oe.aConstraints.gridx += 1;
516
- oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
949
+
950
+ oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
951
+ closeButton.setToolTipText("Close tab");
517952 closeButton.addActionListener(this);
518953 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
519954 //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;
528955
529
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
956
+ cGridBag row1 = new cGridBag();
957
+
958
+ // INSERT
959
+ row1.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
960
+ gridButton.setToolTipText("Create grid");
961
+ gridButton.addActionListener(this);
962
+
963
+ row1.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
964
+ boxButton.setToolTipText("Create box");
965
+ boxButton.addActionListener(this);
966
+
967
+ row1.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
968
+ sphereButton.setToolTipText("Create sphere");
969
+ sphereButton.addActionListener(this);
970
+
971
+ row1.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
972
+ coneButton.setToolTipText("Create cone");
973
+ coneButton.addActionListener(this);
974
+
975
+ row1.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
976
+ torusButton.setToolTipText("Create torus");
977
+ torusButton.addActionListener(this);
978
+
979
+ row1.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
980
+ superButton.setToolTipText("Create superellipsoid");
981
+ superButton.addActionListener(this);
982
+
983
+ if (Globals.ADVANCED)
984
+ {
985
+ oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
986
+ kleinButton.setToolTipText("Create Klein bottle");
987
+ kleinButton.addActionListener(this);
988
+ }
989
+
990
+ row1.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
991
+ particlesButton.setToolTipText("Create particle system");
992
+ particlesButton.addActionListener(this);
993
+
994
+ oe.toolboxPanel.add(row1);
995
+
996
+ cGridBag row2 = new cGridBag();
997
+
998
+ row2.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
999
+ groupButton.setToolTipText("Create group");
1000
+ groupButton.addActionListener(this);
1001
+
1002
+ row2.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1003
+ compositeButton.setToolTipText("Create composite");
1004
+ compositeButton.addActionListener(this);
1005
+
1006
+ row2.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1007
+ switchButton.setToolTipText("Create item switcher");
1008
+ switchButton.addActionListener(this);
1009
+
1010
+ row2.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1011
+ loopButton.setToolTipText("Create loop");
1012
+ loopButton.addActionListener(this);
1013
+
1014
+ row2.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1015
+ textureButton.setToolTipText("Create texture");
1016
+ textureButton.addActionListener(this);
1017
+
1018
+ row2.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1019
+ overlayButton.setToolTipText("Create overlay");
1020
+ overlayButton.addActionListener(this);
1021
+
1022
+ row2.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1023
+ lightButton.setToolTipText("Create light");
1024
+ lightButton.addActionListener(this);
1025
+
1026
+ oe.toolboxPanel.add(row2);
1027
+
1028
+ // ENVYMAPS
1029
+ cGridBag skyboxpane = new cGridBag();
1030
+ skyboxpane.preferredHeight = 100;
1031
+
1032
+ oe.toolboxPanel.add(skyboxpane);
1033
+
1034
+ JTabbedPane skyboxpanel = new JTabbedPane();
1035
+ skyboxpane.add(skyboxpanel);
1036
+
1037
+ AddSkyboxTab0(skyboxpanel);
1038
+ AddSkyboxTab1(skyboxpanel);
1039
+ AddSkyboxTab2(skyboxpanel);
1040
+
1041
+ // EDIT panel
1042
+ editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1043
+ editButton.setToolTipText("Pin selection controls");
1044
+ editButton.addActionListener(this);
1045
+
1046
+ editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1047
+ uneditButton.setToolTipText("Remove selection controls");
5301048 uneditButton.addActionListener(this);
5311049
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);
1050
+ editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
1051
+ allParamsButton.setToolTipText("Show all controle");
5441052 allParamsButton.addActionListener(this);
5451053
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);
1054
+ editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1055
+ clearPanelButton.setToolTipText("Clear edit panel");
1056
+ clearPanelButton.addActionListener(this);
1057
+
1058
+ editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1059
+ unselectButton.setToolTipText("Unselect");
5511060 unselectButton.addActionListener(this);
5521061
1062
+ editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1063
+ flashSelectionButton.setToolTipText("Highlight selection");
1064
+ flashSelectionButton.addActionListener(this);
1065
+
1066
+ editCommandsPanel.preferredHeight = 1;
1067
+
1068
+ SetPinStates(false);
1069
+// oe.treePanel.add(commandsPanel);
1070
+// oe.treePanel.Return();
1071
+
5531072 // oe.aConstraints.gridx += 1;
5541073 // oe.aConstraints.weighty = 0;
5551074 // oe.aConstraints.gridwidth = 1;
....@@ -561,47 +1080,32 @@
5611080 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
5621081 // gcButton.addActionListener(this);
5631082
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;
1083
+ cGridBag jSPPanel = new cGridBag();
1084
+
1085
+ JScrollPane jSP;
5751086 //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);
1087
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints);
5771088 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;
5971089
1090
+ oe.treePanel.add(jSPPanel);
1091
+ oe.treePanel.Return();
1092
+
1093
+ oe.treePanel.add(copyOptionsPanel);
1094
+ oe.treePanel.Return();
1095
+ cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0);
1096
+ versionSlider = (cNumberSlider)sliderPane.getComponent(1);
1097
+ sliderPane.preferredHeight = 1;
1098
+
1099
+// mainPanel.setDividerLocation(0.1); //1.0);
1100
+ mainPanel.setResizeWeight(0.4);
1101
+
5981102 //jList.addListSelectionListener(this);
5991103 oe.jTree.addTreeSelectionListener(this);
6001104 //jTree.setRootVisible(false);
6011105 //jTree.setEditable(true);
6021106 oe.jTree.setDragEnabled(true);
6031107 //jTree.setPreferredSize(new Dimension(10,10));
604
- jSP.setPreferredSize(new Dimension(100,200));
1108
+ //jSP.setPreferredSize(new Dimension(100,200));
6051109
6061110 oe.jTree.setCellRenderer(new cTreeModel.Renderer());
6071111
....@@ -613,23 +1117,160 @@
6131117 dgr.addDragGestureListener(this);
6141118 }catch(Exception e) {}
6151119 */
616
- radio.layout = sevenButton;
1120
+ radio.layout = sixButton; // sevenButton;
6171121 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
6181122 }
1123
+
1124
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
1125
+ {
1126
+ panel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
1127
+ colorCB.setToolTipText("Copy color when dropped");
1128
+ colorCB.addItemListener(this);
1129
+
1130
+ panel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
1131
+ materialCB.setToolTipText("Copy material when dropped");
1132
+ materialCB.addItemListener(this);
1133
+
1134
+ panel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
1135
+ textureCB.setToolTipText("Copy texture when dropped");
1136
+ textureCB.addItemListener(this);
1137
+
1138
+ panel.Return();
1139
+
1140
+ panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
1141
+ boxCB.setToolTipText("Display bounding boxes");
1142
+ boxCB.addItemListener(this);
1143
+
1144
+ panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
1145
+ zoomBoxCB.setToolTipText("Display only for wheel");
1146
+ zoomBoxCB.addItemListener(this);
1147
+
1148
+ if (true) // Globals.ADVANCED)
1149
+ {
1150
+// panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
1151
+// supportCB.setToolTipText("Enable rigging");
1152
+// supportCB.addItemListener(this);
1153
+
1154
+ panel.add(freezeCB = new cCheckBox("Freeze", Globals.FREEZEONMOVE)); //, constraints);
1155
+ freezeCB.setToolTipText("Fast moving camera");
1156
+ freezeCB.addItemListener(this);
1157
+
1158
+ // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
1159
+ // localCB.addItemListener(this);
1160
+
1161
+ panel.Return();
1162
+
1163
+ panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
1164
+ crowdCB.setToolTipText("Used for crowds");
1165
+ crowdCB.addItemListener(this);
1166
+
1167
+ panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
1168
+ smoothCB.setToolTipText("Snapping delay");
1169
+ smoothCB.addItemListener(this);
1170
+
1171
+ panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
1172
+ slowCB.setToolTipText("Smooth interpolation");
1173
+ slowCB.addItemListener(this);
1174
+
1175
+// constraints.gridy += 1;
1176
+// panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
1177
+// speakerMocapCB.addItemListener(this);
1178
+
1179
+ panel.Return();
1180
+
1181
+ if (false)
1182
+ {
1183
+ // handled in scripts
1184
+ //constraints.gridy += 1;
1185
+ panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints);
1186
+ speakerCameraCB.addItemListener(this);
1187
+
1188
+ //constraints.gridy += 1;
1189
+ panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints);
1190
+ speakerFocusCB.addItemListener(this);
1191
+
1192
+ //constraints.gridy += 1;
1193
+ panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
1194
+ smoothfocusCB.addItemListener(this);
1195
+ panel.Return();
1196
+ }
1197
+
1198
+//constraints.gridx += 1;
1199
+//panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
1200
+// debugCB.addItemListener(this);
1201
+
1202
+ panel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
1203
+ trackCB.setToolTipText("Enable tracking target");
1204
+ trackCB.addItemListener(this);
1205
+
1206
+ panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
1207
+ oeilCB.setToolTipText("Move camera when tracking");
1208
+ oeilCB.addItemListener(this);
1209
+
1210
+ panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints);
1211
+ shadowCB.setToolTipText("When live compute shadows");
1212
+ shadowCB.addItemListener(this);
1213
+
1214
+ panel.Return();
1215
+ panel.add(toggleTextureCB = new cCheckBox("Textures", CameraPane.textureon)); //, constraints);
1216
+ toggleTextureCB.setToolTipText("Load textures");
1217
+ toggleTextureCB.addItemListener(this);
1218
+
1219
+ panel.add(toggleSwitchCB = new cCheckBox("Switch", CameraPane.SWITCH)); //, constraints);
1220
+ toggleSwitchCB.setToolTipText("Choose a single item");
1221
+ toggleSwitchCB.addItemListener(this);
1222
+
1223
+ panel.add(autokeepCB = new cCheckBox("Auto-replace", Globals.REPLACEONMAKE)); //, constraints);
1224
+ autokeepCB.setToolTipText("On structure change");
1225
+ autokeepCB.addItemListener(this);
1226
+
1227
+ panel.Return();
1228
+ if (Globals.ADVANCED)
1229
+ {
1230
+ panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
1231
+ lookAtCB.setToolTipText("Look-at target");
1232
+ lookAtCB.addItemListener(this);
1233
+ }
1234
+
1235
+ }
1236
+
1237
+ cGridBag fill = new cGridBag();
1238
+ fill.preferredHeight = 200;
1239
+ cGridBag fill2 = new cGridBag();
1240
+ fill2.preferredHeight = 200;
1241
+ cGridBag fill3 = new cGridBag();
1242
+ fill3.preferredHeight = 200;
1243
+
1244
+ panel.add(fill);
1245
+ panel.add(fill2);
1246
+ panel.add(fill3);
1247
+
1248
+ }
6191249
6201250 void EditObject(Object3D obj)
6211251 {
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();
1252
+ cRadio radioButton = new cRadio(obj.name);
1253
+
1254
+ // June 2019. Patch to avoid bug with transparency.
1255
+ radioButton.hadMaterial = obj.material != null;
1256
+ if (!radioButton.hadMaterial)
1257
+ {
1258
+ obj.material = new cMaterial();
1259
+ }
1260
+
1261
+ radioButton.SetObject(obj);
1262
+ radioButton.layout = sixButton; // sevenButton;
1263
+ radioButton.SetCamera(cameraView.renderCamera, false);
1264
+ radioButton.addActionListener(this);
1265
+ radioPanel.add(radioButton);
1266
+ buttonGroup.add(radioButton);
1267
+ radioButton.doClick();
6301268 }
1269
+
6311270 void SetupViews(ObjEditor oe)
6321271 {
1272
+ theFrame = this;
1273
+
6331274 oe.SetupViews();
6341275
6351276 System.out.println("SetupViews");
....@@ -638,22 +1279,28 @@
6381279 /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this);
6391280 }
6401281
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;
1282
+ cToggleButton liveCB;
1283
+ cCheckBox supportCB;
1284
+ cCheckBox localCB;
1285
+ cCheckBox crowdCB;
1286
+ cCheckBox smoothCB;
1287
+ cToggleButton fastCB;
1288
+ cCheckBox slowCB;
1289
+ cCheckBox boxCB;
1290
+ cCheckBox zoomBoxCB;
1291
+ cCheckBox freezeCB;
1292
+ //cToggleButton trackCB;
1293
+ cCheckBox trackCB;
1294
+ cCheckBox smoothfocusCB;
6511295 // JCheckBox speakerMocapCB;
652
- JCheckBox speakerCameraCB;
653
- JCheckBox speakerFocusCB;
654
- JCheckBox debugCB;
655
- JCheckBox oeilCB;
656
- JCheckBox lookAtCB;
1296
+ cCheckBox speakerCameraCB;
1297
+ cCheckBox speakerFocusCB;
1298
+ cCheckBox debugCB;
1299
+
1300
+ cCheckBox oeilCB;
1301
+ cCheckBox shadowCB;
1302
+ cCheckBox autokeepCB;
1303
+ cCheckBox lookAtCB;
6571304
6581305 // static int COLOR = 1;
6591306 // static int MATERIAL = 2;
....@@ -661,9 +1308,9 @@
6611308
6621309 int dropAttributes = Object3D.COLOR | Object3D.MATERIAL;
6631310
664
- JCheckBox colorCB;
665
- JCheckBox materialCB;
666
- JCheckBox textureCB;
1311
+ cCheckBox colorCB;
1312
+ cCheckBox materialCB;
1313
+ cCheckBox textureCB;
6671314
6681315 public void itemStateChanged(ItemEvent e)
6691316 {
....@@ -688,10 +1335,10 @@
6881335 dropAttributes |= Object3D.TEXTURE;
6891336 else
6901337 dropAttributes &= ~Object3D.TEXTURE;
691
- }
692
- else if(e.getSource() == liveCB)
1338
+ } else if(e.getSource() == liveCB)
6931339 {
6941340 cameraView.ToggleLive();
1341
+ refreshContents(false);
6951342 }
6961343 else if(e.getSource() == supportCB)
6971344 {
....@@ -727,6 +1374,10 @@
7271374 cameraView.repaint();
7281375 // refreshContents();
7291376 }
1377
+ else if(e.getSource() == zoomBoxCB)
1378
+ {
1379
+ cameraView.ToggleZoomBoxMode();
1380
+ }
7301381 else if(e.getSource() == smoothfocusCB)
7311382 {
7321383 cameraView.ToggleSmoothFocus();
....@@ -752,6 +1403,18 @@
7521403 {
7531404 cameraView.ToggleOeil();
7541405 }
1406
+ else if(e.getSource() == shadowCB)
1407
+ {
1408
+ Globals.COMPUTESHADOWWHENLIVE ^= true;
1409
+ }
1410
+ else if(e.getSource() == freezeCB)
1411
+ {
1412
+ Globals.FREEZEONMOVE ^= true;
1413
+ }
1414
+ else if(e.getSource() == autokeepCB)
1415
+ {
1416
+ Globals.REPLACEONMAKE ^= true;
1417
+ }
7551418 else if(e.getSource() == lookAtCB)
7561419 {
7571420 cameraView.ToggleLookAt();
....@@ -768,7 +1431,8 @@
7681431
7691432 /**/
7701433 //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this);
771
- TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1434
+ //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1435
+ TreePath path = objEditor.jTree.getSelectionPath();
7721436 if ((path == null) || (path.getPathCount() <= 1)) {
7731437 // We can't move the root node or an empty selection
7741438 return;
....@@ -831,8 +1495,6 @@
8311495 }
8321496 }
8331497
834
- String string = (String) object;
835
-
8361498 System.out.println("Transfer = " + object + "; drop : " + target);
8371499 // if( object instanceof java.io.File[])
8381500 // {
....@@ -840,7 +1502,11 @@
8401502 // objEditor.DropFile((java.io.File[]) object, true);
8411503 // return;
8421504 // }
843
- if (string.charAt(0) == '/')
1505
+
1506
+ String string = object.toString();
1507
+
1508
+ // File path for Mac and Windows
1509
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
8441510 {
8451511 // file(s)
8461512 String[] names = string.split("\n");
....@@ -867,7 +1533,7 @@
8671533
8681534 flashIt = false;
8691535 CameraPane pane = (CameraPane) target;
870
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1536
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
8711537 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
8721538
8731539 if (group.selection.size() == 1)
....@@ -883,23 +1549,33 @@
8831549
8841550 assert target == objEditor.jTree;
8851551 TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y);
1552
+ Object3D destinationLeaf;
8861553 try {
887
- Object3D dummy = (Composite) destinationPath.getLastPathComponent();
1554
+ destinationLeaf = (Composite) destinationPath.getLastPathComponent();
8881555 } catch (Exception e) {
8891556 System.out.println("destinationPath : " + destinationPath);
8901557 return;
8911558 }
8921559
893
- if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1560
+ for (int i=group.selection.size(); --i>=0;)
8941561 {
1562
+ Object3D child = (Object3D)group.selection.elementAt(i);
1563
+
1564
+ // Cannot move into itself
1565
+ if (child == destinationLeaf)
1566
+ return;
1567
+ }
1568
+
1569
+// june 2019 if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1570
+// {
8951571 loadClipboard(true);
8961572 objEditor.jTree.setSelectionPath(destinationPath);
897
- pasteInto(false);
898
- } else {
899
- loadClipboard(false);
900
- objEditor.jTree.setSelectionPath(destinationPath);
901
- pasteInto(false); // true); // ???
902
- }
1573
+ pasteInto(false, false);
1574
+// } else {
1575
+// loadClipboard(false);
1576
+// objEditor.jTree.setSelectionPath(destinationPath);
1577
+// pasteInto(false, false); // true); // ???
1578
+// }
9031579 }
9041580 public void dropActionChanged(DropTargetDragEvent dtde)
9051581 // Called if the user has modified the current drop gesture
....@@ -1002,90 +1678,109 @@
10021678
10031679 void buildCreateMenu(Menu menu)
10041680 {
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);
1681
+ //heightFieldItem = menu.add(new MenuItem("Height Field"));
1682
+ //heightFieldItem.addActionListener(this);
1683
+// gridItem = menu.add(new MenuItem("Grid"));
1684
+// gridItem.addActionListener(this);
1685
+// rectoidItem = menu.add(new MenuItem("Box"));
1686
+// rectoidItem.addActionListener(this);
1687
+// ellipsoidItem = menu.add(new MenuItem("Sphere"));
1688
+// ellipsoidItem.addActionListener(this);
1689
+// coneItem = menu.add(new MenuItem("Cone"));
1690
+// coneItem.addActionListener(this);
1691
+// torusItem = menu.add(new MenuItem("Torus"));
1692
+// torusItem.addActionListener(this);
1693
+// superItem = menu.add(new MenuItem("Superellipsoid"));
1694
+// superItem.addActionListener(this);
1695
+
1696
+ cameraItem = menu.add(new MenuItem("Camera"));
1697
+ cameraItem.addActionListener(this);
1698
+
1699
+ if (!Globals.ADVANCED)
1700
+ {
1701
+ kleinItem = menu.add(new MenuItem("Klein Bottle"));
1702
+ kleinItem.addActionListener(this);
1703
+ }
1704
+
1705
+// particleItem = menu.add(new MenuItem("Particle system"));
1706
+// particleItem.addActionListener(this);
1707
+ if (Globals.ADVANCED)
1708
+ {
10191709 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10201710 ragdollItem.addActionListener(this);
10211711 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10221712 ragdoll2Item.addActionListener(this);
1713
+ }
10231714 menu.add("-");
1024
- meshItem = menu.add(new MenuItem("Mesh"));
1715
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10251716 meshItem.addActionListener(this);
10261717 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10271718 // meshGroupItem.addActionListener(this);
1719
+ if (Globals.ADVANCED)
1720
+ {
10281721 springItem = menu.add(new MenuItem("Spring"));
10291722 springItem.addActionListener(this);
10301723 flagItem = menu.add(new MenuItem("Flag"));
10311724 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);
10361725 blobItem = menu.add(new MenuItem("Blob"));
10371726 blobItem.addActionListener(this);
10381727 latheItem = menu.add(new MenuItem("Lathe"));
10391728 latheItem.addActionListener(this);
1040
- lightItem = menu.add(new MenuItem("Light"));
1041
- lightItem.addActionListener(this);
1729
+ }
1730
+ bezierItem = menu.add(new MenuItem("Bezier Patch"));
1731
+ bezierItem.addActionListener(this);
1732
+// overlayItem = menu.add(new MenuItem("Overlay"));
1733
+// overlayItem.addActionListener(this);
1734
+// lightItem = menu.add(new MenuItem("Light"));
1735
+// lightItem.addActionListener(this);
10421736 menu.add("-");
10431737 //superLoopItem = menu.add(new MenuItem("Super Loop"));
10441738 //superLoopItem.addActionListener(this);
1045
- loopItem = menu.add(new MenuItem("Loop"));
1046
- loopItem.addActionListener(this);
1739
+// loopItem = menu.add(new MenuItem("Loop"));
1740
+// loopItem.addActionListener(this);
10471741 doubleItem = menu.add(new MenuItem("Fork"));
10481742 doubleItem.addActionListener(this);
1743
+ if (Globals.ADVANCED)
1744
+ {
10491745 tripleItem = menu.add(new MenuItem("Trident"));
10501746 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);
1747
+ }
10601748 }
10611749
10621750 void buildToolsMenu(Menu menu)
10631751 {
10641752 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
10651753 animationItem.addItemListener(this);
1066
- animationItem.setState(CameraPane.ANIMATION);
1754
+ animationItem.setState(Globals.ANIMATION);
1755
+
1756
+ menu.add(archiveItem = new MenuItem("Archive3D..."));
1757
+ archiveItem.addActionListener(this);
10671758
10681759 menu.add("-");
10691760 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
10701761 parseverticesItem.addActionListener(this);
1071
- alignItem = menu.add(new MenuItem("Align"));
1762
+ textureFieldItem = menu.add(new MenuItem("Texture Field"));
1763
+ textureFieldItem.addActionListener(this);
1764
+ alignItem = menu.add(new MenuItem("Align Objects"));
10721765 alignItem.addActionListener(this);
1073
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1074
- mirrorItem.addActionListener(this);
10751766 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
10761767 reduceMorphItem.addActionListener(this);
10771768 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
10781769 reduce34MorphItem.addActionListener(this);
1079
-
1080
- menu.add(computeAOItem = new MenuItem("Compute AO"));
1081
- computeAOItem.addActionListener(this);
10821770 menu.add("-");
1083
-
10841771 menu.add(memoryItem = new MenuItem("Memory Usage"));
10851772 memoryItem.addActionListener(this);
1773
+ menu.add(computeAOItem = new MenuItem("Compute AO"));
1774
+ computeAOItem.addActionListener(this);
1775
+
1776
+ if (Globals.ADVANCED)
1777
+ {
1778
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1779
+ mirrorItem.addActionListener(this);
1780
+ menu.add("-");
10861781 menu.add(analyzeItem = new MenuItem("Analyze"));
10871782 analyzeItem.addActionListener(this);
1088
- menu.add(dumpItem = new MenuItem("Dump"));
1783
+ menu.add(dumpItem = new MenuItem("Print"));
10891784 dumpItem.addActionListener(this);
10901785 // menu.add(pathItem = new MenuItem("From-to path"));
10911786 // pathItem.addActionListener(this);
....@@ -1094,6 +1789,8 @@
10941789 resetParentItem.addActionListener(this);
10951790 repairParentItem = menu.add(new MenuItem("Repair Parent"));
10961791 repairParentItem.addActionListener(this);
1792
+ repairShadowItem = menu.add(new MenuItem("Repair Shadow"));
1793
+ repairShadowItem.addActionListener(this);
10971794 menu.add(invariantsItem = new MenuItem("Invariants"));
10981795 invariantsItem.addActionListener(this);
10991796 menu.add(recompileItem = new MenuItem("Recompile"));
....@@ -1101,6 +1798,7 @@
11011798 menu.add("-");
11021799 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11031800 editScriptItem.addActionListener(this);
1801
+ }
11041802 }
11051803
11061804 void ScreenFit()
....@@ -1223,9 +1921,34 @@
12231921 shadow.material = new cMaterial(obj.material);
12241922 shadow.material.diffuse = 0.0001f;
12251923 shadow.material.specular = 0.0001f;
1924
+ //shadow.projectedVertices[1].x = 300;
12261925
12271926 makeSomething(shadow);
12281927 }
1928
+
1929
+ private void ClearUnpinned()
1930
+ {
1931
+ //for (Object3D obj : listUI)
1932
+ for (int i=listUI.size(); --i>=0;)
1933
+ {
1934
+ Object3D obj = listUI.elementAt(i);
1935
+ if (!obj.pinned)
1936
+ {
1937
+ obj.CloseUI();
1938
+ listUI.remove(i);
1939
+ }
1940
+ }
1941
+ }
1942
+
1943
+ private void EditElement(Object3D elem, boolean newWindow)
1944
+ {
1945
+ // if (!(elem instanceof Composite))
1946
+ // newWindow = false;
1947
+ listUI.add(elem);
1948
+ elem.openEditWindow(this, newWindow); //, false);
1949
+ System.out.println("edit : " + elem);
1950
+ elem.editWindow.refreshContents(true); // ? new
1951
+ }
12291952
12301953 /**
12311954 * applyExample
....@@ -1429,9 +2152,9 @@
14292152
14302153 void Overwrite(int mask)
14312154 {
1432
- if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
2155
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14332156 {
1434
- Object3D content = GraphreeD.clipboard.get(0);
2157
+ Object3D content = Grafreed.clipboard.get(0);
14352158
14362159 if (content instanceof cGroup && ((cGroup)content).transientlink )
14372160 content = ((cGroup)content).get(0);
....@@ -1454,6 +2177,7 @@
14542177 //
14552178 public void actionPerformed(ActionEvent event) // , Object arg)
14562179 {
2180
+ Object source = event.getSource();
14572181 /*
14582182 if (event.getSource() == nameField)
14592183 {
....@@ -1465,11 +2189,11 @@
14652189 }
14662190 else
14672191 */
1468
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
2192
+ if (source == lookAtItem || source == lookFromItem)
14692193 {
14702194 ScreenFit();
14712195 } else
1472
- if (event.getSource() == switchItem)
2196
+ if (source == switchViewItem)
14732197 {
14742198 cVector v1 = new cVector();
14752199 cVector v2 = new cVector();
....@@ -1478,11 +2202,11 @@
14782202 objEditor.cameraView.renderCamera.setAim(v2, v1);
14792203 objEditor.cameraView.repaint();
14802204 } else
1481
- if (event.getSource() == rectoidItem)
2205
+ if (source == rectoidItem || source == boxButton)
14822206 {
14832207 makeSomething(new Box());
14842208 } else
1485
- if (event.getSource() == particleItem)
2209
+ if (source == particleItem || source == particlesButton)
14862210 {
14872211 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
14882212 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1503,9 +2227,9 @@
15032227 applyExample(particleGeom, "SMOKE");
15042228 makeSomething(particleGeom);
15052229 } else
1506
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
2230
+ if (source == ragdollItem || source == ragdoll2Item)
15072231 {
1508
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
2232
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15092233
15102234 ragdoll.toParent = LA.newMatrix();
15112235 ragdoll.fromParent = LA.newMatrix();
....@@ -1521,27 +2245,71 @@
15212245 makeSomething(ragdoll);
15222246 //makeSomething(new VehicleDemo());
15232247 } else
1524
- if (event.getSource() == gridItem)
2248
+ /*
2249
+ */
2250
+ if (source == heightFieldItem)
2251
+ {
2252
+ Object3D obj = new Object3D();
2253
+
2254
+ obj.CreateMaterial();
2255
+ obj.bRep = new BoundaryRep();
2256
+
2257
+ obj.bRep.CreateMesh(new iHeightField()
2258
+ {
2259
+ public double f(double x, double y)
2260
+ {
2261
+ // The Mandelbrot set is represented by coloring
2262
+ // each point (x,y) according to the number of
2263
+ // iterations it takes before the while loop in
2264
+ // this method ends. For points that are actually
2265
+ // in the Mandelbrot set, or very close to it, the
2266
+ // count will reach the maximum value, 80. These
2267
+ // points will be colored purple. All other colors
2268
+ // represent points that are definitely NOT in the set.
2269
+ x -= 600;
2270
+ y -= 500;
2271
+ x /= 200;
2272
+ y /= 200;
2273
+ int count = 0;
2274
+ double zx = x;
2275
+ double zy = y;
2276
+ while (count < 80 && Math.abs(x) < 100 && Math.abs(zy) < 100) {
2277
+ double new_zx = zx*zx - zy*zy + x;
2278
+ zy = 2*zx*zy + y;
2279
+ zx = new_zx;
2280
+ count++;
2281
+ }
2282
+ return count; // Math.sqrt(count);
2283
+ }
2284
+ }, 1000,1000);
2285
+
2286
+ makeSomething(obj);
2287
+ } else
2288
+ if (source == gridItem || source == gridButton)
15252289 {
15262290 makeSomething(new Grid());
15272291 } else
1528
- if (event.getSource() == ellipsoidItem)
2292
+ if (source == ellipsoidItem || source == sphereButton)
15292293 {
15302294 makeSomething(new Sphere());
15312295 } else
1532
- if (event.getSource() == coneItem)
2296
+ if (source == coneItem || source == coneButton)
15332297 {
15342298 makeSomething(new Cone());
15352299 } else
1536
- if (event.getSource() == torusItem)
2300
+ if (source == torusItem || source == torusButton)
15372301 {
15382302 makeSomething(new Torus());
15392303 } else
1540
- if (event.getSource() == superItem)
2304
+ if (source == superItem || source == superButton)
15412305 {
15422306 makeSomething(new Superellipsoid());
15432307 } else
1544
- if (event.getSource() == blobItem)
2308
+ if (source == kleinItem || source == kleinButton)
2309
+ {
2310
+ makeSomething(new Klein());
2311
+ } else
2312
+ if (source == blobItem)
15452313 {
15462314 Blob blob = new Blob();
15472315 BlobComponent comp = new BlobComponent();
....@@ -1549,15 +2317,15 @@
15492317 //blob.retile();
15502318 makeSomething(blob);
15512319 } else
1552
- if (event.getSource() == latheItem)
2320
+ if (source == latheItem)
15532321 {
15542322 makeSomething(new Lathe());
15552323 } else
1556
- if (event.getSource() == bezierItem)
2324
+ if (source == bezierItem)
15572325 {
15582326 makeSomething(new BezierSurface());
15592327 } else
1560
- if (event.getSource() == checkerItem)
2328
+ if (source == overlayItem || source == overlayButton)
15612329 {
15622330 /*
15632331 Object3D obj = new BezierSurface(5,8);
....@@ -1570,9 +2338,9 @@
15702338 LA.matConcat(obj.toParent, cameraView.renderCamera.fromParent, obj.toParent);
15712339 LA.matInvert(obj.toParent, obj.fromParent);
15722340 */
1573
- makeSomething(new CheckerIG());
2341
+ makeSomething(new Checker());
15742342 } else
1575
- if (event.getSource() == meshItem)
2343
+ if (source == meshItem)
15762344 {
15772345 Object3D itemtomake = new Object3D();
15782346 Object3D child;
....@@ -1593,35 +2361,52 @@
15932361 makeSomething(child);
15942362 }
15952363 } else
1596
- if (event.getSource() == springItem)
2364
+ if (source == springItem)
15972365 {
15982366 cSpring s = new cSpring();
15992367 s.setup();
16002368 makeSomething(s);
16012369 } else
1602
- if (event.getSource() == flagItem)
2370
+ if (source == flagItem)
16032371 {
16042372 cSpring s = new cFlag();
16052373 s.setup();
16062374 makeSomething(s);
16072375 } else
1608
- if (event.getSource() == lightItem)
2376
+ if (source == lightItem || source == lightButton)
16092377 {
16102378 makeSomething(new Light());
16112379 } else
1612
- if (event.getSource() == csgItem)
2380
+// if (source == skybox1Button ||
2381
+// source == skybox2Button ||
2382
+// source == skybox3Button ||
2383
+// source == skybox4Button ||
2384
+// source == skybox5Button ||
2385
+// source == skybox6Button ||
2386
+// source == skybox7Button ||
2387
+// source == skybox11Button ||
2388
+// source == skybox12Button ||
2389
+// source == skybox13Button ||
2390
+// source == skybox14Button ||
2391
+// source == skybox15Button ||
2392
+// source == skybox16Button ||
2393
+// source == skybox17Button)
2394
+// {
2395
+// ChangeSkybox(source);
2396
+// } else
2397
+ if (source == csgItem)
16132398 {
16142399 group(new CSG());
16152400 } else
1616
- if (event.getSource() == templateItem)
2401
+ if (source == templateItem)
16172402 {
16182403 group(new cTemplate());
16192404 } else
1620
- if (event.getSource() == attributeItem)
2405
+ if (source == attributeItem)
16212406 {
16222407 makeSomething(new Attribute());
16232408 } else
1624
- if (event.getSource() == pointflowItem)
2409
+ if (source == pointflowItem)
16252410 {
16262411 makeSomething(new PointFlow());
16272412 } else
....@@ -1633,7 +2418,7 @@
16332418 } else
16342419 */
16352420
1636
- if (event.getSource() == superLoopItem)
2421
+ if (source == superLoopItem)
16372422 {
16382423 Composite g = new cGroup();
16392424 for (int i=0; i<15; i++)
....@@ -1655,30 +2440,30 @@
16552440
16562441 group(g);
16572442 } else
1658
- if (event.getSource() == loopItem)
2443
+ if (source == loopItem || source == loopButton)
16592444 {
16602445 Composite csg = new GroupLeaf();
16612446 csg.count = 5;
16622447 group(csg);
1663
- Composite child = new cGroup();
2448
+ Composite child = new cGroup("Branch");
16642449 csg.addChild(child);
16652450 child.addChild(csg);
16662451 } else
1667
- if (event.getSource() == doubleItem)
2452
+ if (source == doubleItem)
16682453 {
1669
- Composite csg = new GroupLeaf();
2454
+ Composite csg = new GroupLeaf("Fork");
16702455 csg.count = 5;
16712456 group(csg);
1672
- Composite child = new cGroup();
2457
+ Composite child = new cGroup("Branch A");
16732458 csg.addChild(child);
16742459 child.addChild(csg);
1675
- child = new cGroup();
2460
+ child = new cGroup("Branch B");
16762461 csg.addChild(child);
16772462 child.addChild(csg);
16782463 } else
1679
- if (event.getSource() == tripleItem)
2464
+ if (source == tripleItem)
16802465 {
1681
- Composite csg = new GroupLeaf();
2466
+ Composite csg = new GroupLeaf("Trident");
16822467 csg.count = 4;
16832468 group(csg);
16842469 Composite child = new cGroup();
....@@ -1691,73 +2476,98 @@
16912476 csg.addChild(child);
16922477 child.addChild(csg);
16932478 } else
1694
-
1695
- if (event.getSource() == importGFDItem)
2479
+ if (source == computeAOItem)
16962480 {
1697
- ImportGFD();
2481
+ Globals.drawMode = CameraPane.OCCLUSION;
2482
+ cameraView.repaint();
16982483 } 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)
2484
+ if (source == recompileItem)
17172485 {
17182486 Recompile();
17192487 refreshContents();
17202488 } else
1721
- if (event.getSource() == editScriptItem)
2489
+ if (source == editScriptItem)
17222490 {
17232491 OpenDialog();
17242492 refreshContents();
17252493 } else
1726
- if (event.getSource() == invariantsItem)
2494
+ if (source == invariantsItem)
17272495 {
17282496 System.out.println("Invariants:");
1729
- GraphreeD.theApplet3D.universe.invariants();
2497
+ Grafreed.grafreeD.universe.invariants();
17302498 } else
1731
- if (event.getSource() == memoryItem)
2499
+ if (source == memoryItem)
17322500 {
17332501 //System.out.println("Invariants:");
17342502 PrintMemory();
17352503 } else
1736
- if (event.getSource() == pathItem)
2504
+ if (source == pathItem)
17372505 {
17382506 PrintPath();
17392507 } else
1740
- if (event.getSource() == analyzeItem)
2508
+ if (source == analyzeItem)
17412509 {
17422510 AnalyzeObject();
17432511 } else
1744
- if (event.getSource() == dumpItem)
2512
+ if (source == dumpItem)
17452513 {
17462514 DumpObject();
17472515 } else
1748
- if (event.getSource() == screenfitButton)
2516
+ if (source == minButton)
17492517 {
1750
- //Reload(lastConverter, lastFilename, true);
2518
+ Minimize();
2519
+ } else
2520
+ if (source == maxButton)
2521
+ {
2522
+ Maximize();
2523
+ } else
2524
+ if (source == fullButton)
2525
+ {
2526
+ ToggleFullScreen();
2527
+ } else
2528
+ if (source == undoButton)
2529
+ {
2530
+ // Go to previous version
2531
+ //if (!Undo())
2532
+ //java.awt.Toolkit.getDefaultToolkit().beep();
2533
+ Undo();
2534
+ } else
2535
+ if (source == restoreButton)
2536
+ {
2537
+ // Restore current version
2538
+ Restore();
2539
+ } else
2540
+ if (source == replaceButton)
2541
+ {
2542
+ // Overwrite current version
2543
+ Replace();
2544
+ } else
2545
+ if (source == redoButton)
2546
+ {
2547
+ // Go to next version
2548
+ Redo();
2549
+ } else
2550
+ if (source == saveButton)
2551
+ {
2552
+ // Save a new version
2553
+ if (!Save(true))
2554
+ java.awt.Toolkit.getDefaultToolkit().beep();
2555
+ } else
2556
+ if (source == oneStepButton)
2557
+ {
2558
+ Globals.ONESTEP = true;
2559
+ cameraView.repaint();
2560
+ } else
2561
+ if (source == screenfitButton)
2562
+ {
17512563 ScreenFit();
17522564 } else
1753
- if (event.getSource() == screenfitpointButton)
2565
+ if (source == screenfitpointButton)
17542566 {
1755
- //Reload(lastConverter, lastFilename, true);
17562567 ScreenFitPoint();
17572568 } else
1758
- if (event.getSource() == snapobjectButton)
2569
+ if (source == snapobjectButton)
17592570 {
1760
- //Reload(lastConverter, lastFilename, true);
17612571 SnapObject();
17622572 } else
17632573 // if (event.getSource() == recompileButton)
....@@ -1766,13 +2576,13 @@
17662576 // Recompile();
17672577 // refreshContents();
17682578 // } else
1769
- if (event.getSource() == gcButton)
2579
+ if (source == gcButton)
17702580 {
17712581 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
17722582 System.gc();
17732583 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
17742584 } else
1775
- if (event.getSource() == editLeafItem)
2585
+ if (source == editLeafItem)
17762586 {
17772587 Object3D obj;
17782588 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1786,65 +2596,78 @@
17862596 }
17872597 refreshContents(true);
17882598 } else
1789
- if (event.getSource() == openWindowItem)
2599
+ if (source == openWindowItem)
17902600 {
17912601 EditSelection(true);
17922602 } else
1793
- if (event.getSource() == cutItem || event.getSource() == clearButton)
2603
+ if (source == cutItem || source == clearButton)
17942604 {
17952605 loadClipboard(true);
17962606 } else
1797
- if (event.getSource() == duplicateItem)
2607
+ if (source == undoItem)
17982608 {
1799
- Object3D keep = GraphreeD.clipboard;
2609
+ Undo();
2610
+ } else
2611
+ if (source == redoItem)
2612
+ {
2613
+ Redo();
2614
+ } else
2615
+ if (source == duplicateItem)
2616
+ {
2617
+ Object3D keep = Grafreed.clipboard;
18002618 loadClipboard(false);
18012619 paste(false);
1802
- GraphreeD.clipboard = keep;
2620
+ Grafreed.clipboard = keep;
18032621 } else
1804
- if (event.getSource() == cloneItem)
2622
+ if (source == cloneItem)
18052623 {
18062624 CloneSelection(false);
18072625 } else
1808
- if (event.getSource() == cloneSupportItem)
2626
+ if (source == cloneSupportItem)
18092627 {
18102628 CloneSelection(true);
18112629 } else
1812
- if (event.getSource() == copyItem)
2630
+ if (source == copyItem)
18132631 {
18142632 loadClipboard(false);
18152633 } else
1816
- if (event.getSource() == pasteItem)
2634
+ if (source == pasteItem)
18172635 {
18182636 paste(false);
18192637 } else
1820
- if (event.getSource() == pasteLinkItem)
2638
+ if (source == pasteIntoItem)
18212639 {
1822
- pasteInto(false);
2640
+ pasteInto(true, false);
18232641 } else
1824
- if (event.getSource() == pasteCloneItem)
2642
+ if (source == pasteLinkItem)
18252643 {
1826
- pasteInto(true);
2644
+ pasteInto(false, false);
18272645 } else
1828
- if (event.getSource() == pasteExpandItem)
2646
+ if (source == pasteCloneItem)
2647
+ {
2648
+ pasteInto(true, true);
2649
+ } else
2650
+ if (source == pasteExpandItem)
18292651 {
18302652 paste(true);
18312653 } else
1832
- if (event.getSource() == synchronizeItem)
2654
+ if (source == synchronizeItem)
18332655 {
18342656 Overwrite(Object3D.TRANSFORM);
18352657 } else
1836
- if (event.getSource() == overwriteNameItem)
2658
+ if (source == overwriteNameItem)
18372659 {
18382660 Overwrite(Object3D.NAME);
18392661 } else
1840
- if (event.getSource() == overwriteUVItem)
2662
+ if (source == overwriteUVItem)
18412663 {
18422664 Overwrite(Object3D.UV);
18432665 } else
1844
- if (event.getSource() == overwriteMatItem)
2666
+ if (source == overwriteMatItem)
18452667 {
2668
+ /* july 2015
18462669 if ((dropAttributes & Object3D.TEXTURE) == 0)
1847
- Overwrite(Object3D.MATERIAL);
2670
+ Overwrite(Object3D.MATERIAL | Object3D.COLOR);
18482671 else
18492672 {
18502673 if ((dropAttributes & Object3D.COLOR) == 0 && (dropAttributes & Object3D.MATERIAL) == 0)
....@@ -1856,13 +2679,16 @@
18562679 Overwrite(Object3D.MATERIAL | Object3D.TEXTURE);
18572680 }
18582681 }
2682
+ */
2683
+
2684
+ Overwrite(dropAttributes);
18592685 }
1860
- if (event.getSource() == overwriteGeoItem)
2686
+ if (source == overwriteGeoItem)
18612687 {
18622688 Overwrite(Object3D.GEOMETRY);
1863
-// if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
2689
+// if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
18642690 // {
1865
-// Object3D content = GraphreeD.clipboard.get(0);
2691
+// Object3D content = GrafreeD.clipboard.get(0);
18662692 //
18672693 // if (content instanceof cGroup && ((cGroup)content).transientlink )
18682694 // content = ((cGroup)content).get(0);
....@@ -1874,7 +2700,7 @@
18742700 // refreshContents();
18752701 // }
18762702 } else
1877
- if (event.getSource() == generateMeshItem)
2703
+ if (source == generateMeshItem)
18782704 {
18792705 //if (group.selection.size() == 1)
18802706 // for (int i=0; i<group.selection.size(); i++)
....@@ -1885,7 +2711,7 @@
18852711 ResetModel();
18862712 refreshContents();
18872713 } else
1888
- if (event.getSource() == extractGeometriesItem)
2714
+ if (source == extractGeometriesItem)
18892715 {
18902716 boolean one = false;
18912717
....@@ -1912,7 +2738,7 @@
19122738 ResetModel();
19132739 refreshContents();
19142740 } else
1915
- if (event.getSource() == cloneGeometriesItem)
2741
+ if (source == cloneGeometriesItem)
19162742 {
19172743 boolean one = false;
19182744
....@@ -1938,32 +2764,37 @@
19382764 ResetModel();
19392765 refreshContents();
19402766 } else
1941
- if (event.getSource() == shareGeometriesItem)
2767
+ if (source == shareGeometriesItem)
19422768 {
19432769 boolean one = false;
19442770
19452771 if (group.selection.size() == 1)
19462772 one = true;
19472773
2774
+ Object3D merge = null;
2775
+
19482776 Object3D content = new cGroup();
19492777
19502778 for (int i=0; i<group.selection.size(); i++)
19512779 {
1952
- Object3D sel = new Merge(group.selection.get(i));
2780
+ merge = new Merge(group.selection.get(i));
19532781
19542782 if (one)
1955
- makeSomething(sel, false);
2783
+ makeSomething(merge, false);
19562784 else
1957
- content.addChild(sel);
2785
+ content.addChild(merge);
19582786 }
19592787
19602788 if (!one)
1961
- makeSomething(content, false);
1962
-
1963
- ResetModel();
1964
- refreshContents();
2789
+ makeSomething(content, true);
2790
+ else
2791
+ {
2792
+ ResetModel();
2793
+ Select(merge.GetTreePath(), true, false); // unselect... false);
2794
+ refreshContents();
2795
+ }
19652796 } else
1966
- if (event.getSource() == mergeGeometriesItem)
2797
+ if (source == mergeGeometriesItem)
19672798 {
19682799 boolean one = false;
19692800
....@@ -1993,11 +2824,11 @@
19932824 ResetModel();
19942825 refreshContents();
19952826 } else
1996
- if (event.getSource() == linkverticesItem)
2827
+ if (source == linkverticesItem)
19972828 {
1998
-// if (group.selection.size() == 1 && GraphreeD.clipboard.size() == 1)
2829
+// if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
19992830 // {
2000
-// Object3D content = GraphreeD.clipboard.get(0);
2831
+// Object3D content = GrafreeD.clipboard.get(0);
20012832 //
20022833 // if (content instanceof cGroup && ((cGroup)content).transientlink )
20032834 // content = ((cGroup)content).get(0);
....@@ -2006,39 +2837,48 @@
20062837 // group.selection.get(0).setMasterThis(content); // should be identity
20072838 // refreshContents();
20082839 // }
2009
- if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
2840
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
20102841 {
2011
- Object3D content = GraphreeD.clipboard.get(0);
2842
+ Object3D content = Grafreed.clipboard.get(0);
20122843
20132844 if (content instanceof cGroup && ((cGroup)content).transientlink )
20142845 content = ((cGroup)content).get(0);
20152846
2016
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
2847
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
20172848 for (int i=0; i<group.selection.size(); i++)
20182849 {
2019
- boolean random = CameraPane.RANDOM;
2020
- CameraPane.RANDOM = false; // parse all random nodes
2850
+ boolean random = CameraPane.SWITCH;
2851
+ CameraPane.SWITCH = false; // parse all random nodes
20212852 group.selection.get(i).linkVerticesThis(content);
20222853 // group.selection.get(i).setMasterThis(content); // should be identity
2023
- CameraPane.RANDOM = random;
2854
+ CameraPane.SWITCH = random;
20242855 }
2025
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
2856
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
20262857 refreshContents();
20272858 }
20282859 } else
2029
- if (event.getSource() == resetsupportItem)
2860
+ if (source == resetsupportItem)
20302861 {
20312862 for (int i=0; i<group.selection.size(); i++)
20322863 {
2033
- boolean random = CameraPane.RANDOM;
2034
- CameraPane.RANDOM = false; // parse all random nodes
2864
+ boolean random = CameraPane.SWITCH;
2865
+ CameraPane.SWITCH = false; // parse all random nodes
20352866 group.selection.get(i).linkVerticesThis(null);
2036
- CameraPane.RANDOM = random;
2867
+ CameraPane.SWITCH = random;
20372868 }
20382869
20392870 refreshContents();
20402871 } else
2041
- if (event.getSource() == resetreferencesItem)
2872
+ if (source == relinkverticesItem)
2873
+ {
2874
+ boolean random = CameraPane.SWITCH;
2875
+ CameraPane.SWITCH = false; // parse all random nodes
2876
+ group.selection.RelinkToSupport();
2877
+ CameraPane.SWITCH = random;
2878
+
2879
+ refreshContents();
2880
+ } else
2881
+ if (source == resetreferencesItem)
20422882 {
20432883 for (int i=0; i<group.selection.size(); i++)
20442884 {
....@@ -2047,11 +2887,11 @@
20472887
20482888 refreshContents();
20492889 } else
2050
- if (event.getSource() == setMasterItem)
2890
+ if (source == setMasterItem)
20512891 {
2052
- if (group.selection.size() == 1 && GraphreeD.clipboard.size() == 1)
2892
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
20532893 {
2054
- Object3D content = GraphreeD.clipboard.get(0);
2894
+ Object3D content = Grafreed.clipboard.get(0);
20552895
20562896 if (content instanceof cGroup && ((cGroup)content).transientlink )
20572897 content = ((cGroup)content).get(0);
....@@ -2060,13 +2900,13 @@
20602900 refreshContents();
20612901 }
20622902 } else
2063
- if (event.getSource() == poseMeshItem)
2903
+ if (source == poseMeshItem)
20642904 {
20652905 if (group.selection.size() == 1)
20662906 {
2067
- if (GraphreeD.clipboard.size() == 1)
2907
+ if (Grafreed.clipboard.size() == 1)
20682908 {
2069
- Object3D content = GraphreeD.clipboard.get(0);
2909
+ Object3D content = Grafreed.clipboard.get(0);
20702910
20712911 if (content instanceof cGroup && ((cGroup)content).transientlink )
20722912 content = ((cGroup)content).get(0);
....@@ -2079,19 +2919,19 @@
20792919 }
20802920
20812921 } else
2082
- if (event.getSource() == revertMeshItem)
2922
+ if (source == revertMeshItem)
20832923 {
20842924 RevertMeshes();
20852925 } else
2086
- if (event.getSource() == resetMeshItem)
2926
+ if (source == resetAllItem)
20872927 {
20882928 ResetAll();
20892929 } else
2090
- if (event.getSource() == stepAllItem)
2930
+ if (source == stepAllItem)
20912931 {
20922932 StepAll();
20932933 } else
2094
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2934
+ if (source == deleteItem) // || event.getSource() == clearButton)
20952935 {
20962936 //int indices[] = jList.getSelectedIndices();
20972937 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2099,42 +2939,46 @@
20992939
21002940 ClearSelection(false);
21012941 } else
2102
- if (event.getSource() == clearAllItem)
2942
+ if (source == clearAllItem)
21032943 {
21042944 ClearSelection(true);
21052945 } else
2106
- if (event.getSource() == grabItem)
2946
+ if (source == grabItem || source == groupButton)
21072947 {
2108
- group(new cGroup(), true);
2948
+ group(new cGroup(), false); // true);
21092949 } else
2110
- if (event.getSource() == frontItem)
2950
+ if (source == hideItem)
2951
+ {
2952
+ group(new HiddenObject());
2953
+ } else
2954
+ if (source == frontItem)
21112955 {
21122956 front();
21132957 } else
2114
- if (event.getSource() == backItem)
2958
+ if (source == backItem)
21152959 {
21162960 back();
21172961 } else
2118
- if (event.getSource() == cameraItem)
2962
+ if (source == cameraItem)
21192963 {
21202964 makeSomething(new Camera());
21212965 } else
2122
- if (event.getSource() == compositeItem)
2966
+ if (source == compositeItem || source == compositeButton)
21232967 {
21242968 group(new Composite());
21252969 } else
2126
- if (event.getSource() == randomItem)
2970
+ if (source == switchItem || source == switchButton)
21272971 {
21282972 RandomNode random = new RandomNode();
21292973 group(random);
21302974 if (random.size() > 0)
2131
- random.name = random.get(0).name + "Rnd";
2975
+ random.name = random.get(0).name + "Switch";
21322976 } else
2133
- if (event.getSource() == physicsItem)
2977
+ if (source == physicsItem)
21342978 {
21352979 group(new PhysicsNode());
21362980 } else
2137
- if (event.getSource() == frameselectorItem)
2981
+ if (source == frameselectorItem)
21382982 {
21392983 for (int i=0; i<group.selection.size(); i++)
21402984 {
....@@ -2146,7 +2990,7 @@
21462990 ResetModel();
21472991 refreshContents();
21482992 } else
2149
- if (event.getSource() == switchGeoItem)
2993
+ if (source == switchGeoItem)
21502994 {
21512995 for (int i=0; i<group.selection.size(); i++)
21522996 {
....@@ -2158,7 +3002,7 @@
21583002 ResetModel();
21593003 refreshContents();
21603004 } else
2161
- if (event.getSource() == switchTransfoItem)
3005
+ if (source == switchTransfoItem)
21623006 {
21633007 for (int i=0; i<group.selection.size(); i++)
21643008 {
....@@ -2170,7 +3014,7 @@
21703014 ResetModel();
21713015 refreshContents();
21723016 } else
2173
- if (event.getSource() == morphItem)
3017
+ if (source == morphItem)
21743018 {
21753019 for (int i=0; i<group.selection.size(); i++)
21763020 {
....@@ -2182,7 +3026,7 @@
21823026 ResetModel();
21833027 refreshContents();
21843028 } else
2185
- if (event.getSource() == scriptNodeItem)
3029
+ if (source == scriptNodeItem)
21863030 {
21873031 boolean atleastone = false;
21883032
....@@ -2221,191 +3065,252 @@
22213065 }
22223066 }
22233067 } else
2224
- if (event.getSource() == linkerItem)
3068
+ if (source == linkerItem)
22253069 {
22263070 group(new cLinker());
22273071 } else
2228
- if (event.getSource() == textureItem)
3072
+ if (source == textureItem || source == textureButton)
22293073 {
22303074 group(new TextureNode());
22313075 } else
2232
- if (event.getSource() == shadowXItem)
3076
+ if (source == billboardItem)
3077
+ {
3078
+ group(new BillboardNode());
3079
+ } else
3080
+ if (source == shadowXItem)
22333081 {
22343082 CastShadow(0);
22353083 } else
2236
- if (event.getSource() == shadowYItem)
3084
+ if (source == shadowYItem)
22373085 {
22383086 CastShadow(1);
22393087 } else
2240
- if (event.getSource() == shadowZItem)
3088
+ if (source == shadowZItem)
22413089 {
22423090 CastShadow(2);
22433091 } else
2244
- if (event.getSource() == ungroupItem)
3092
+ if (source == ungroupItem || source == ungroupButton)
22453093 {
2246
- ungroup();
3094
+ boolean hasRoot = false;
3095
+
3096
+ for (int i=0; i<group.selection.size(); i++)
3097
+ {
3098
+ if (group.selection.get(i) == group)
3099
+ {
3100
+ hasRoot = true;
3101
+ break;
3102
+ }
3103
+ }
3104
+
3105
+ if (!hasRoot)
3106
+ {
3107
+ for (int i=0; i<group.selection.size(); i++)
3108
+ {
3109
+ Ungroup(group.selection.get(i));
3110
+ }
3111
+
3112
+ ClearSelection(false);
3113
+
3114
+ refreshContents();
3115
+ }
22473116 } else
2248
- if (event.getSource() == genUVItem)
3117
+ if (source == genUVItem)
22493118 {
22503119 GenUV();
22513120 } else
2252
- if (event.getSource() == genNormalsCADItem)
3121
+ if (source == genNormalsCADItem)
22533122 {
22543123 GenNormals(true);
22553124 } else
2256
- if (event.getSource() == genNormalsORGANItem)
3125
+ if (source == genNormalsMESHItem)
3126
+ {
3127
+ GenNormalsMESH();
3128
+ } else
3129
+ if (source == genNormalsORGANItem)
22573130 {
22583131 GenNormals(false);
22593132 } else
2260
- if (event.getSource() == stripifyItem)
3133
+ if (source == genNormalsMINEItem)
3134
+ {
3135
+ GenNormalsMINE();
3136
+ } else
3137
+ if (source == stripifyItem)
22613138 {
22623139 Stripify();
22633140 } else
2264
- if (event.getSource() == unstripifyItem)
3141
+ if (source == unstripifyItem)
22653142 {
22663143 Unstripify();
22673144 } else
2268
- if (event.getSource() == trimItem)
3145
+ if (source == trimItem)
22693146 {
22703147 Trim();
22713148 } else
2272
- if (event.getSource() == untrimItem)
3149
+ if (source == untrimItem)
22733150 {
22743151 Untrim();
22753152 } else
2276
- if (event.getSource() == clearColorsItem)
3153
+ if (source == clearColorsItem)
22773154 {
22783155 ClearColors();
22793156 } else
2280
- if (event.getSource() == clearMaterialsItem)
3157
+ if (source == clearMaterialsItem)
22813158 {
22823159 ClearMaterials();
22833160 } else
2284
- if (event.getSource() == liveleavesItem)
3161
+ if (source == liveleavesItem)
22853162 {
22863163 LiveLeaves(true);
22873164 } else
2288
- if (event.getSource() == unliveleavesItem)
3165
+ if (source == unliveleavesItem)
22893166 {
22903167 LiveLeaves(false);
22913168 } else
2292
- if (event.getSource() == supportleavesItem)
3169
+ if (source == supportleavesItem)
22933170 {
22943171 SupportLeaves(true);
22953172 } else
2296
- if (event.getSource() == unsupportleavesItem)
3173
+ if (source == unsupportleavesItem)
22973174 {
22983175 SupportLeaves(false);
22993176 } else
2300
- if (event.getSource() == hideleavesItem)
3177
+ if (source == hideleavesItem)
23013178 {
23023179 HideLeaves(true);
23033180 } else
2304
- if (event.getSource() == showleavesItem)
3181
+ if (source == showleavesItem)
23053182 {
23063183 HideLeaves(false);
23073184 } else
2308
- if (event.getSource() == markleavesItem)
3185
+ if (source == markleavesItem)
23093186 {
23103187 MarkLeaves(true);
23113188 } else
2312
- if (event.getSource() == unmarkleavesItem)
3189
+ if (source == unmarkleavesItem)
23133190 {
23143191 MarkLeaves(false);
23153192 } else
2316
- if (event.getSource() == flipVItem)
3193
+ if (source == rewindleavesItem)
3194
+ {
3195
+ RewindLeaves(true);
3196
+ } else
3197
+ if (source == unrewindleavesItem)
3198
+ {
3199
+ RewindLeaves(false);
3200
+ } else
3201
+ if (source == randomleavesItem)
3202
+ {
3203
+ RandomLeaves(true);
3204
+ } else
3205
+ if (source == unrandomleavesItem)
3206
+ {
3207
+ RandomLeaves(false);
3208
+ } else
3209
+ if (source == flipVItem)
23173210 {
23183211 FlipV(true);
23193212 } else
2320
- if (event.getSource() == unflipVItem)
3213
+ if (source == unflipVItem)
23213214 {
23223215 FlipV(false);
23233216 } else
2324
- if (event.getSource() == lowTexturesItem)
3217
+ if (source == lowTexturesItem)
23253218 {
23263219 SetTexRes(0);
23273220 } else
2328
- if (event.getSource() == normalTexturesItem)
3221
+ if (source == normalTexturesItem)
23293222 {
23303223 SetTexRes(1);
23313224 } else
2332
- if (event.getSource() == highTexturesItem)
3225
+ if (source == highTexturesItem)
23333226 {
23343227 SetTexRes(2);
23353228 } else
2336
- if (event.getSource() == veryhighTexturesItem)
3229
+ if (source == veryhighTexturesItem)
23373230 {
23383231 SetTexRes(3);
23393232 } else
2340
- if (event.getSource() == maxTexturesItem)
3233
+ if (source == maxTexturesItem)
23413234 {
23423235 SetTexRes(4);
23433236 } else
2344
- if (event.getSource() == panoTexturesItem)
3237
+ if (source == panoTexturesItem)
23453238 {
23463239 SetTexRes(5);
23473240 } else
2348
- if (event.getSource() == reverseNormalsItem)
3241
+ if (source == reverseNormalsItem)
23493242 {
23503243 ReverseNormals();
23513244 } else
2352
- if (event.getSource() == parseverticesItem)
3245
+ if (source == parseverticesItem)
23533246 {
23543247 ParseVertices();
23553248 } else
2356
- if (event.getSource() == alignItem)
3249
+ if (source == textureFieldItem)
3250
+ {
3251
+ TextureVertices();
3252
+ } else
3253
+ if (source == alignItem)
23573254 {
23583255 Align();
23593256 } else
2360
- if (event.getSource() == mirrorItem)
3257
+ if (source == mirrorItem)
23613258 {
23623259 MirrorPoses();
23633260 } else
2364
- if (event.getSource() == reduceMorphItem)
3261
+ if (source == reduceMorphItem)
23653262 {
23663263 MeshReduction(false);
23673264 } else
2368
- if (event.getSource() == reduce34MorphItem)
3265
+ if (source == reduce34MorphItem)
23693266 {
23703267 MeshReduction(true);
23713268 } else
2372
- if (event.getSource() == reverseTrianglesItem)
3269
+ if (source == reverseTrianglesItem)
23733270 {
23743271 ReverseTriangles();
23753272 } else
2376
- if (event.getSource() == reduceMeshItem)
3273
+ if (source == reduceMeshItem)
23773274 {
23783275 ReduceMesh(false);
23793276 } else
2380
- if (event.getSource() == reduce34MeshItem)
3277
+ if (source == reduce34MeshItem)
23813278 {
23823279 ReduceMesh(true);
23833280 } else
2384
- if (event.getSource() == increaseMeshItem)
3281
+ if (source == increaseMeshItem)
23853282 {
23863283 IncreaseMesh();
23873284 } else
2388
- if (event.getSource() == clipMeshItem)
3285
+ if (source == clipMeshItem)
23893286 {
23903287 ClipMesh();
23913288 } else
2392
- if (event.getSource() == smoothMeshItem)
3289
+ if (source == smoothMeshItem)
23933290 {
23943291 SmoothMesh();
23953292 } else
2396
- if (event.getSource() == transformgeometryItem)
3293
+ if (source == transformGeometryItem)
23973294 {
23983295 TransformGeometry();
23993296 } else
2400
- if (event.getSource() == resetTransformItem)
3297
+ if (source == transformChildrenItem)
3298
+ {
3299
+ TransformChildren();
3300
+ } else
3301
+ if (source == resetTransformItem)
24013302 {
24023303 ResetTransform();
24033304 } else
2404
- if (event.getSource() == resetCentroidItem)
3305
+ if (source == resetCentroidItem)
24053306 {
2406
- ResetCentroid();
3307
+ ResetCentroid(true);
24073308 } else
2408
- if (event.getSource() == resetParentItem)
3309
+ if (source == resetCentroidXZItem)
3310
+ {
3311
+ ResetCentroid(false);
3312
+ } else
3313
+ if (source == resetParentItem)
24093314 {
24103315 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24113316 {
....@@ -2415,7 +3320,7 @@
24153320
24163321 refreshContents();
24173322 } else
2418
- if (event.getSource() == repairParentItem)
3323
+ if (source == repairParentItem)
24193324 {
24203325 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24213326 {
....@@ -2429,7 +3334,21 @@
24293334
24303335 refreshContents();
24313336 } else
2432
- if (event.getSource() == sortbysizeItem)
3337
+ if (source == repairShadowItem)
3338
+ {
3339
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3340
+ {
3341
+ Object3D obj = (Object3D)e.nextElement();
3342
+ obj.RepairShadow();
3343
+// for (int i=0; i<obj.size(); i++)
3344
+// {
3345
+// obj.get(i).parent = obj;
3346
+// }
3347
+ }
3348
+
3349
+ refreshContents();
3350
+ } else
3351
+ if (source == sortbysizeItem)
24333352 {
24343353 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24353354 {
....@@ -2441,7 +3360,7 @@
24413360 ResetModel();
24423361 refreshContents();
24433362 } else
2444
- if (event.getSource() == sortbynameItem)
3363
+ if (source == sortbynameItem)
24453364 {
24463365 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24473366 {
....@@ -2453,7 +3372,7 @@
24533372 ResetModel();
24543373 refreshContents();
24553374 } else
2456
- if (event.getSource() == attachPigmentItem)
3375
+ if (source == attachPigmentItem)
24573376 {
24583377 String texture = GetFile("Attach pigment");
24593378 Object3D obj;
....@@ -2465,7 +3384,7 @@
24653384
24663385 refreshContents();
24673386 } else
2468
- if (event.getSource() == detachPigmentItem)
3387
+ if (source == detachPigmentItem)
24693388 {
24703389 Object3D obj;
24713390 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2476,7 +3395,7 @@
24763395
24773396 refreshContents();
24783397 } else
2479
- if (event.getSource() == attachBumpItem)
3398
+ if (source == attachBumpItem)
24803399 {
24813400 String texture = GetFile("Attach bump");
24823401 Object3D obj;
....@@ -2488,18 +3407,18 @@
24883407
24893408 refreshContents();
24903409 } else
2491
- if (event.getSource() == detachBumpItem)
3410
+ if (source == detachBumpItem)
24923411 {
24933412 Object3D obj;
24943413 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24953414 {
24963415 obj = (Object3D)e.nextElement();
2497
- obj.SetBumpTexture(null);
3416
+ obj.ResetBumpTexture();
24983417 }
24993418
25003419 refreshContents();
25013420 } else
2502
- if (event.getSource() == pigmentBumpItem)
3421
+ if (source == pigmentBumpItem)
25033422 {
25043423 Object3D obj;
25053424 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2510,158 +3429,262 @@
25103429
25113430 refreshContents();
25123431 } else
2513
- if (event.getSource() == flashSelectionButton)
3432
+ if (source == embedTexturesItem)
3433
+ {
3434
+ Object3D obj;
3435
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3436
+ {
3437
+ obj = (Object3D)e.nextElement();
3438
+ obj.EmbedTextures(true);
3439
+ }
3440
+
3441
+ refreshContents();
3442
+ } else
3443
+ if (source == deEmbedTexturesItem)
3444
+ {
3445
+ Object3D obj;
3446
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3447
+ {
3448
+ obj = (Object3D)e.nextElement();
3449
+ obj.EmbedTextures(false);
3450
+ }
3451
+
3452
+ CameraPane.texturepigment.clear();
3453
+ CameraPane.texturebump.clear();
3454
+
3455
+ refreshContents();
3456
+ } else
3457
+ if (source == flashSelectionButton)
25143458 {
25153459 CameraPane.flash = true;
25163460 refreshContents();
25173461 } else
2518
- if (event.getSource() == oneButton)
3462
+ if (source == oneButton)
25193463 {
25203464 } else
2521
- if (event.getSource() == twoButton)
3465
+ if (source == twoButton)
25223466 {
25233467 radio.layout = twoButton;
3468
+
3469
+ if (CameraPane.FULLSCREEN)
3470
+ fullscreenLayout = radio.layout;
3471
+
25243472 // bug
25253473 //gridPanel.setDividerLocation(1.0);
25263474 //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();
3475
+// bigThree.remove(scenePanel);
3476
+// bigThree.remove(centralPanel);
3477
+// bigThree.remove(XYZPanel);
3478
+// aWindowConstraints.gridx = 0;
3479
+// aWindowConstraints.gridy = 0;
3480
+// aWindowConstraints.gridwidth = 1;
3481
+// // aConstraints.gridheight = 3;
3482
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3483
+// aWindowConstraints.weightx = 0;
3484
+// aWindowConstraints.weighty = 1;
3485
+// //bigThree.add(jtp, aWindowConstraints);
3486
+// aWindowConstraints.weightx = 1;
3487
+// aWindowConstraints.gridwidth = 3;
3488
+// // aConstraints.gridheight = 3;
3489
+// aWindowConstraints.gridx = 1;
3490
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3491
+// bigThree.add(centralPanel, aWindowConstraints);
3492
+// aWindowConstraints.weightx = 0;
3493
+// aWindowConstraints.gridx = 4;
3494
+// aWindowConstraints.gridwidth = 1;
3495
+// // aConstraints.gridheight = 3;
3496
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3497
+// //bigThree.add(XYZPanel, aWindowConstraints);
3498
+// scenePanel.setVisible(false);
3499
+// centralPanel.setVisible(true);
3500
+// XYZPanel.setVisible(false);
3501
+ bigThree.ClearUI();
3502
+ bigThree.add(centralPanel);
3503
+ bigThree.FlushUI();
3504
+
3505
+ cameraView.requestFocusInWindow();
3506
+
3507
+// refreshContents(true);
3508
+//
3509
+// try
3510
+// {
3511
+// java.awt.Robot bot = new java.awt.Robot();
3512
+// int mask = InputEvent.BUTTON1_MASK;
3513
+// bot.mouseMove(100, 100);
3514
+// bot.mousePress(mask);
3515
+// bot.mouseRelease(mask);
3516
+// }
3517
+// catch (Exception e)
3518
+// {
3519
+//
3520
+// }
3521
+
25513522 } else
2552
- if (event.getSource() == threeButton)
3523
+ if (source == threeButton)
25533524 {
25543525 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();
3526
+
3527
+ if (CameraPane.FULLSCREEN)
3528
+ fullscreenLayout = radio.layout;
3529
+
3530
+// bigThree.remove(scenePanel);
3531
+// bigThree.remove(centralPanel);
3532
+// bigThree.remove(XYZPanel);
3533
+// aWindowConstraints.gridx = 0;
3534
+// aWindowConstraints.gridy = 0;
3535
+// aWindowConstraints.gridwidth = 1;
3536
+// // aConstraints.gridheight = 3;
3537
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3538
+// aWindowConstraints.weightx = 0;
3539
+// aWindowConstraints.weighty = 1;
3540
+// //bigThree.add(jtp, aWindowConstraints);
3541
+// aWindowConstraints.weightx = 1;
3542
+// aWindowConstraints.gridwidth = 3;
3543
+// // aConstraints.gridheight = 3;
3544
+// aWindowConstraints.gridx = 1;
3545
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3546
+// bigThree.add(centralPanel, aWindowConstraints);
3547
+// aWindowConstraints.weightx = 0;
3548
+// aWindowConstraints.gridx = 4;
3549
+// aWindowConstraints.gridwidth = 1;
3550
+// // aConstraints.gridheight = 3;
3551
+// aConstraints.fill = GridBagConstraints.VERTICAL;
3552
+// bigThree.add(XYZPanel, aWindowConstraints);
3553
+// bigThree.validate();
3554
+// scenePanel.setVisible(false);
3555
+// centralPanel.setVisible(true);
3556
+// XYZPanel.setVisible(true);
3557
+ bigThree.ClearUI();
3558
+ bigThree.add(scenePanel);
3559
+ bigThree.add(centralPanel);
3560
+ bigThree.FlushUI();
3561
+
3562
+ cameraView.requestFocusInWindow();
25793563 } else
2580
- if (event.getSource() == fourButton)
3564
+ if (source == fourButton)
25813565 {
25823566 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();
3567
+
3568
+ if (CameraPane.FULLSCREEN)
3569
+ fullscreenLayout = radio.layout;
3570
+
3571
+// bigThree.remove(scenePanel);
3572
+// bigThree.remove(centralPanel);
3573
+// bigThree.remove(XYZPanel);
3574
+// aWindowConstraints.gridx = 0;
3575
+// aWindowConstraints.gridy = 0;
3576
+// aWindowConstraints.gridwidth = 1;
3577
+// // aWindowConstraints.gridheight = 3;
3578
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3579
+// aWindowConstraints.weightx = 1;
3580
+// aWindowConstraints.weighty = 1;
3581
+// bigThree.add(scenePanel, aWindowConstraints);
3582
+// aWindowConstraints.weightx = 1;
3583
+// aWindowConstraints.gridwidth = 3;
3584
+// // aConstraints.gridheight = 3;
3585
+// aWindowConstraints.gridx = 1;
3586
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3587
+// //bigThree.add(cameraPanel, aWindowConstraints);
3588
+// aWindowConstraints.weightx = 0;
3589
+// aWindowConstraints.gridx = 4;
3590
+// aWindowConstraints.gridwidth = 1;
3591
+// // aWindowConstraints.gridheight = 3;
3592
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3593
+// //bigThree.add(XYZPanel, aWindowConstraints);
3594
+// bigThree.validate();
3595
+// scenePanel.setVisible(true);
3596
+// centralPanel.setVisible(false);
3597
+// XYZPanel.setVisible(false);
3598
+ bigThree.ClearUI();
3599
+ bigThree.add(scenePanel);
3600
+ bigThree.FlushUI();
3601
+
3602
+ cameraView.requestFocusInWindow();
26073603 } else
2608
- if (event.getSource() == sixButton)
3604
+ if (source == sixButton)
26093605 {
26103606 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();
3607
+
3608
+ if (CameraPane.FULLSCREEN)
3609
+ fullscreenLayout = radio.layout;
3610
+
3611
+// bigThree.remove(scenePanel);
3612
+// bigThree.remove(centralPanel);
3613
+// bigThree.remove(XYZPanel);
3614
+// aWindowConstraints.gridx = 0;
3615
+// aWindowConstraints.gridy = 0;
3616
+// aWindowConstraints.gridwidth = 1;
3617
+// // aConstraints.gridheight = 3;
3618
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3619
+// aWindowConstraints.weightx = 0;
3620
+// aWindowConstraints.weighty = 1;
3621
+// bigThree.add(scenePanel, aWindowConstraints);
3622
+// aWindowConstraints.weightx = 1;
3623
+// aWindowConstraints.gridwidth = 3;
3624
+// // aWindowConstraints.gridheight = 3;
3625
+// aWindowConstraints.gridx = 1;
3626
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3627
+// bigThree.add(centralPanel, aWindowConstraints);
3628
+// aWindowConstraints.weightx = 0;
3629
+// aWindowConstraints.gridx = 4;
3630
+// aWindowConstraints.gridwidth = 1;
3631
+// // aWindowConstraints.gridheight = 3;
3632
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3633
+// //bigThree.add(XYZPanel, aConstraints);
3634
+// bigThree.validate();
3635
+// scenePanel.setVisible(true);
3636
+// centralPanel.setVisible(true);
3637
+// XYZPanel.setVisible(false);
3638
+ bigThree.ClearUI();
3639
+ bigThree.add(centralPanel);
3640
+ bigThree.add(scenePanel);
3641
+ bigThree.FlushUI();
3642
+
3643
+ cameraView.requestFocusInWindow();
26353644 } else
2636
- if (event.getSource() == sevenButton)
3645
+ if (source == sevenButton)
26373646 {
26383647 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();
3648
+
3649
+ if (CameraPane.FULLSCREEN)
3650
+ fullscreenLayout = radio.layout;
3651
+
3652
+// bigThree.remove(scenePanel);
3653
+// bigThree.remove(centralPanel);
3654
+// bigThree.remove(XYZPanel);
3655
+// aWindowConstraints.gridx = 0;
3656
+// aWindowConstraints.gridy = 0;
3657
+// aWindowConstraints.gridwidth = 1;
3658
+// // aWindowConstraints.gridheight = 3;
3659
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3660
+// aWindowConstraints.weightx = 0;
3661
+// aWindowConstraints.weighty = 1;
3662
+// bigThree.add(scenePanel, aWindowConstraints);
3663
+// aWindowConstraints.weightx = 1;
3664
+// aWindowConstraints.gridwidth = 3;
3665
+// // aWindowConstraints.gridheight = 3;
3666
+// aWindowConstraints.gridx = 1;
3667
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3668
+// bigThree.add(centralPanel, aWindowConstraints);
3669
+// aWindowConstraints.weightx = 0;
3670
+// aWindowConstraints.gridx = 4;
3671
+// aWindowConstraints.gridwidth = 1;
3672
+// // aConstraints.gridheight = 3;
3673
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3674
+// bigThree.add(XYZPanel, aWindowConstraints);
3675
+// bigThree.validate();
3676
+// scenePanel.setVisible(true);
3677
+// centralPanel.setVisible(true);
3678
+// XYZPanel.setVisible(true);
3679
+ bigThree.ClearUI();
3680
+ bigThree.add(scenePanel);
3681
+ bigThree.add(centralPanel);
3682
+ bigThree.add(XYZPanel);
3683
+ bigThree.FlushUI();
3684
+
3685
+ cameraView.requestFocusInWindow();
26633686 } else
2664
- if (event.getSource() == rootButton)
3687
+ if (source == rootButton)
26653688 {
26663689 Object3D obj;
26673690 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2671,66 +3694,84 @@
26713694 EditObject(obj);
26723695 }
26733696
3697
+ cameraView.requestFocusInWindow();
26743698 refreshContents(true);
26753699 } else
2676
- if (event.getSource() == closeButton)
3700
+ if (source == closeButton)
26773701 {
26783702 //System.out.println("CLOSE: " + buttonGroup.getSelection());
26793703 cRadio ab;
26803704 for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
26813705 {
26823706 ab = (cRadio)e.nextElement();
2683
- if(ab.getModel().isSelected() && ab.GetObject() != client)
3707
+ if (ab.getModel().isSelected() && ab.GetObject() != client)
26843708 {
3709
+ // Patch to avoid bug with transparency.
3710
+ if (!ab.hadMaterial)
3711
+ {
3712
+ ab.object.material = null;
3713
+ }
3714
+
26853715 buttonGroup.remove(ab);
26863716 radioPanel.remove(ab);
26873717
2688
- ab.GetObject().editWindow = null;
3718
+ //ab.GetObject().editWindow = null;
3719
+ ab.GetObject().manipWindow = null;
26893720 // ab.GetObject().objectUI = null; // ?????????
26903721
26913722 ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick();
26923723 break;
26933724 }
26943725 }
3726
+
3727
+ cameraView.requestFocusInWindow();
26953728 refreshContents(true);
26963729 } else
2697
- if (event.getSource() == editItem || event.getSource() == editButton)
3730
+ if (source == editItem || source == editButton)
26983731 {
3732
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3733
+ {
3734
+ Object3D child = (Object3D)e.nextElement();
3735
+ child.pinned = true;
3736
+ }
3737
+
26993738 EditSelection(false);
27003739 } else
2701
- if (event.getSource() == uneditButton)
3740
+ if (source == uneditButton)
27023741 {
27033742 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
27043743 {
27053744 Object3D child = (Object3D)e.nextElement();
27063745 if(child.editWindow != null)
27073746 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3747
+ child.pinned = false;
27083748 child.CloseUI();
27093749 listUI.remove(child);
27103750
2711
- child.editWindow = null; // ???????????
3751
+ //child.editWindow = null; // ???????????
27123752 }
2713
- objEditor.ctrlPanel.revalidate();
3753
+ objEditor.ctrlPanel.FlushUI();
27143754 //objEditor.jTree.clearSelection();
27153755 //objEditor.ResetSliders();
27163756 refreshContents(true);
27173757 } else
2718
- if (event.getSource() == clearPanelButton)
3758
+ if (source == clearPanelButton)
27193759 {
27203760 assert(copy == group);
27213761 //copy.ClearUI();
27223762 for (Object3D obj : listUI)
27233763 {
3764
+ obj.pinned = false;
27243765 obj.CloseUI();
27253766 }
27263767 listUI.clear();
27273768 refreshContents(true);
27283769 } else
2729
- if (event.getSource() == allParamsButton)
3770
+ if (source == allParamsButton)
27303771 {
27313772 assert(copy == group);
27323773
2733
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3774
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
27343775
27353776 for (Object3D obj : listUI)
27363777 {
....@@ -2747,19 +3788,19 @@
27473788
27483789 refreshContents(true);
27493790 } else
2750
- if (event.getSource() == unselectButton)
3791
+ if (source == unselectButton)
27513792 {
27523793 objEditor.jTree.clearSelection();
2753
- // ?? oct 2012 GraphreeD.clipboard.clear();
3794
+ // ?? oct 2012 GrafreeD.clipboard.clear();
27543795 objEditor.ResetSliders();
27553796 refreshContents(true);
27563797 } else
2757
- if(event.getSource() instanceof cRadio)
3798
+ if(source instanceof cRadio)
27583799 {
27593800 group.parent = keepparent;
27603801 group.attributes = 0;
27613802 //group.editWindow = null;
2762
- /*cRadio*/ radio = (cRadio)event.getSource();
3803
+ /*cRadio*/ radio = (cRadio)source;
27633804 Object3D obj = radio.GetObject();
27643805 System.out.println("Edit " + obj);
27653806 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -2779,7 +3820,10 @@
27793820 }
27803821
27813822 copy = group;
2782
- //CameraPane.theRenderer.object = group;
3823
+
3824
+ SetUndoStates();
3825
+
3826
+ //Globals.theRenderer.object = group;
27833827 if(!useclient)
27843828 {
27853829 cameraView.renderCamera = radio.camera;
....@@ -2788,25 +3832,52 @@
27883832 cameraView.cameras[cameraView.cameracount] = radio.camera;
27893833 cameraView.targetLookAt.set(radio.camera.lookAt);
27903834 cameraView.object = group;
2791
- cameraView.lighttouched = true;
3835
+ //cameraView.lighttouched = true;
3836
+ Globals.lighttouched = true;
27923837 topView.object = group;
27933838 frontView.object = group;
27943839 sideView.object = group;
27953840 }
2796
- group.editWindow = this;
3841
+
3842
+// fix "+" issue
3843
+ //group.editWindow = this;
3844
+ group.manipWindow = this;
3845
+
27973846 /*
27983847 currentLayout = radio.layout;
27993848 if (currentLayout == null)
28003849 currentLayout = sevenButton;
28013850 */
28023851 radio.layout.doClick();
3852
+
3853
+ ClearUnpinned();
3854
+ //Grafreed.Assert(group != null);
3855
+ //Grafreed.Assert(group.selection != null);
3856
+ SetPinStates(group.selection == null || group.selection.size() > 0);
3857
+ if (group.selection == null || group.selection.size() == 1)
3858
+ EditSelection(false);
28033859 keepparent = group.parent;
28043860 // PARENT = NULL or not???
28053861 //group.parent = null; // ROOT
28063862 //group.attributes = -1;
28073863 ResetModel();
3864
+
3865
+ cameraView.requestFocusInWindow();
28083866 refreshContents(true);
2809
- }
3867
+ } else if (event.getSource() == editCameraItem)
3868
+ {
3869
+ cameraView.ProtectCamera();
3870
+ cameraView.repaint();
3871
+ return;
3872
+ } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton)
3873
+ {
3874
+ cameraView.RevertCamera();
3875
+ cameraView.repaint();
3876
+ return;
3877
+ // } else if (event.getSource() == textureButton)
3878
+ // {
3879
+ // return; // true;
3880
+ }
28103881 else
28113882 {
28123883 //return super.action(event, arg);
....@@ -2815,7 +3886,6 @@
28153886 }
28163887
28173888 boolean useclient = false;
2818
- cRadio radio;
28193889
28203890 void ToggleRoot()
28213891 {
....@@ -2824,7 +3894,7 @@
28243894 if (useclient)
28253895 {
28263896 cameraView.object = client;
2827
- cameraView.lighttouched = true;
3897
+ Globals.lighttouched = true;
28283898 //topView.object = client;
28293899 //frontView.object = client;
28303900 //sideView.object = client;
....@@ -2832,7 +3902,7 @@
28323902 else
28333903 {
28343904 cameraView.object = group;
2835
- cameraView.lighttouched = true;
3905
+ Globals.lighttouched = true;
28363906 //topView.object = group;
28373907 //frontView.object = group;
28383908 //sideView.object = group;
....@@ -2867,6 +3937,28 @@
28673937 refreshContents();
28683938 }
28693939
3940
+ void TransformChildren()
3941
+ {
3942
+ Object3D obj;
3943
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3944
+ {
3945
+ obj = (Object3D)e.nextElement();
3946
+ obj.KeepTextureMatrices();
3947
+ obj.TransformChildren();
3948
+ obj.RestoreTextureMatrices();
3949
+
3950
+// if (obj.parent == null)
3951
+// {
3952
+// System.out.println("NULL PARENT!");
3953
+// new Exception().printStackTrace();
3954
+// }
3955
+// else
3956
+// TouchTransform(obj);
3957
+// //obj.parent.Touch();
3958
+ }
3959
+
3960
+ refreshContents();
3961
+ }
28703962
28713963 void ResetTransform()
28723964 {
....@@ -2979,7 +4071,7 @@
29794071 refreshContents();
29804072 }
29814073
2982
- void ResetCentroid()
4074
+ void ResetCentroid(boolean full)
29834075 {
29844076 Object3D obj;
29854077 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2994,12 +4086,16 @@
29944086 LA.matIdentity(Object3D.mat);
29954087 obj.getBounds(minima, maxima, false);
29964088 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
2997
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
4089
+ if (full)
4090
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
29984091 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
29994092 obj.TransformMesh(Object3D.mat);
4093
+
30004094 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3001
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
4095
+ if (full)
4096
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
30024097 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
4098
+
30034099 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
30044100 //Object3D.mat[3][0] = -Object3D.mat[3][0];
30054101 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3028,7 +4124,8 @@
30284124
30294125 int size = obj.MemorySize();
30304126
3031
- System.err.println((size/1024) + " KB is the size of " + obj);
4127
+ //System.err.println((size/1024) + " KB is the size of " + obj);
4128
+ System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)");
30324129 }
30334130 }
30344131 catch (Exception e)
....@@ -3065,9 +4162,9 @@
30654162 obj = (Object3D)e.nextElement();
30664163
30674164 System.out.println("Object is: " + obj);
3068
- GraphreeD.AnalyzeObject(obj);
4165
+ Grafreed.AnalyzeObject(obj);
30694166 System.out.println("Boundary rep: " + obj.bRep);
3070
- GraphreeD.AnalyzeObject(obj.bRep);
4167
+ Grafreed.AnalyzeObject(obj.bRep);
30714168
30724169 // System.err.println((size/1024) + " KB is the size of " + obj);
30734170 }
....@@ -3109,6 +4206,20 @@
31094206 void GenNormals(boolean crease)
31104207 {
31114208 group.GenNormalsS(crease);
4209
+
4210
+ refreshContents();
4211
+ }
4212
+
4213
+ void GenNormalsMESH()
4214
+ {
4215
+ group.GenNormalsMeshS();
4216
+
4217
+ refreshContents();
4218
+ }
4219
+
4220
+ void GenNormalsMINE()
4221
+ {
4222
+ group.selection.GenNormalsMINE();
31124223
31134224 refreshContents();
31144225 }
....@@ -3157,104 +4268,259 @@
31574268
31584269 //Object3D buffer;
31594270 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
-
4271
+// BoundaryRep temprep;
4272
+// Object3D nodes;
4273
+// Vector<Vertex> vertices;
4274
+//
4275
+// cGroup buffer;
4276
+//
4277
+// public void Vertex(Object3D node, Vertex v)
4278
+// {
4279
+//// vertices.add(v);
4280
+//// nodes.addElement(node);
4281
+////
4282
+//// if (temprep.GetCache(v) != null)
4283
+//// {
4284
+//// temprep.Remove(v);
4285
+//// } else
4286
+//// {
4287
+//// temprep.Remember(v);
4288
+//// }
4289
+//
4290
+// //Object3D node = nodes.get(index);
4291
+// temp.set(v); // vertices.get(index)); // temprep.GetVertex(k));
4292
+// // System.out.println("temp = " + temp.x + ", " + temp.y + ", " + temp.z);
4293
+//
4294
+// LA.xformPos(temp, node.GlobalTransformInv(), temp);
4295
+//
4296
+// // System.out.println("tem+ = " + temp.x + ", " + temp.y + ", " + temp.z);
4297
+//
4298
+// cGroup g = new cGroup();
4299
+//
4300
+// if (g.toParent == null)
4301
+// {
4302
+// g.toParent = LA.newMatrix();
4303
+// g.fromParent = LA.newMatrix();
4304
+// }
4305
+// LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
4306
+// LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
4307
+//
4308
+// g.add(GrafreeD.clipboard);
4309
+//
4310
+// buffer.add(g);
4311
+// }
4312
+//
4313
+// public void Face(Object3D node, Face f)
4314
+// {
4315
+//
4316
+// }
4317
+//
4318
+// void ParseVerticesOld() // ??
4319
+// {
4320
+// //if (group.selection.size() != 1)
4321
+// // return;
4322
+//
4323
+// temprep = new BoundaryRep();
4324
+// nodes = new Object3D();
4325
+// vertices = new Vector<Vertex>();
4326
+//
4327
+// boolean epsequal = GrafreeD.epsequal;
4328
+// GrafreeD.epsequal = true;
4329
+//
4330
+// for (int i=0; i<group.selection.size(); i++)
4331
+// {
4332
+// Object3D buffer = new cGroup(group.selection.get(i).name + "+");
4333
+//
4334
+// group.selection.get(i).Parse(
4335
+//this );
4336
+//
4337
+// int repsize = temprep.VertexCount();
4338
+// int tablesize = temprep.vertextable.size();
4339
+// int nodesize = nodes.size();
4340
+//
4341
+// assert(vertices.size() == nodes.size());
4342
+//
4343
+// temprep.vertextable.elements();
4344
+//
4345
+// java.util.Set<java.util.Map.Entry<Vertex,Vertex>> set = temprep.vertextable.entrySet();
4346
+//
4347
+// for (java.util.Map.Entry<Vertex,Vertex> entry : set)
4348
+// {
4349
+// cGroup g = new cGroup();
4350
+//
4351
+// int index = vertices.indexOf(entry.getValue()); // temprep.vertextable.(k));
4352
+//
4353
+// Object3D node = nodes.get(index);
4354
+// temp.set(vertices.get(index)); // temprep.GetVertex(k));
4355
+// // System.out.println("temp = " + temp.x + ", " + temp.y + ", " + temp.z);
4356
+//
4357
+// LA.xformPos(temp, node.GlobalTransformInv(), temp);
4358
+//
4359
+// // System.out.println("tem+ = " + temp.x + ", " + temp.y + ", " + temp.z);
4360
+//
4361
+// if (g.toParent == null)
4362
+// {
4363
+// g.toParent = LA.newMatrix();
4364
+// g.fromParent = LA.newMatrix();
4365
+// }
4366
+// LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
4367
+// LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
4368
+//
4369
+// g.add(GrafreeD.clipboard);
4370
+//
4371
+// buffer.add(g);
4372
+// }
4373
+//
4374
+// makeSomething(buffer, i==group.selection.size()-1);
4375
+// }
4376
+//
4377
+// GrafreeD.epsequal = epsequal;
4378
+//
4379
+// //buffer = null;
4380
+// temprep = null;
4381
+// nodes = null;
4382
+//
4383
+// refreshContents();
4384
+// }
4385
+
31844386 void ParseVertices()
31854387 {
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;
4388
+ boolean epsequal = Grafreed.epsequal;
4389
+ Grafreed.epsequal = true;
31954390
31964391 for (int i=0; i<group.selection.size(); i++)
31974392 {
3198
- Object3D buffer = new cGroup(group.selection.get(i).name + "+");
4393
+ final cGroup buffer = new cGroup(group.selection.get(i).name + "+");
31994394
3200
- group.selection.get(i).Parse(this);
3201
-
3202
- int repsize = temprep.VertexCount();
3203
- int tablesize = temprep.vertextable.size();
3204
- int nodesize = nodes.size();
4395
+ group.selection.get(i).Parse(
4396
+
4397
+ new iParse()
4398
+ {
4399
+ public void Vertex(Object3D node, Vertex v)
4400
+ {
4401
+ temp.set(v);
4402
+ LA.xformPos(temp, node.GlobalTransformInv(), temp);
32054403
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();
4404
+ cGroup g = new cGroup();
32114405
3212
- for (java.util.Map.Entry<Vertex,Vertex> entry : set)
3213
- {
3214
- cGroup g = new cGroup();
4406
+ if (g.toParent == null)
4407
+ {
4408
+ g.toParent = LA.newMatrix();
4409
+ g.fromParent = LA.newMatrix();
4410
+ }
4411
+ LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
4412
+ LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
32154413
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);
4414
+ g.add(Grafreed.clipboard);
32204415
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);
4416
+ buffer.add(g);
4417
+ }
32324418
3233
- g.add(GraphreeD.clipboard);
4419
+ public void Face(Object3D node, Face f)
4420
+ {
32344421
3235
- buffer.add(g);
3236
- }
4422
+ }
4423
+ }
4424
+ );
32374425
32384426 makeSomething(buffer, i==group.selection.size()-1);
32394427 }
32404428
3241
- GraphreeD.epsequal = epsequal;
3242
-
3243
- //buffer = null;
3244
- temprep = null;
3245
- nodes = null;
4429
+ Grafreed.epsequal = epsequal;
32464430
32474431 refreshContents();
32484432 }
3249
-
4433
+
4434
+ void TextureVertices()
4435
+ {
4436
+ for (int i=0; i<group.selection.size(); i++)
4437
+ {
4438
+ group.selection.get(i).Parse(
4439
+ new iParse()
4440
+ {
4441
+ public void Vertex(Object3D node, Vertex v)
4442
+ {
4443
+ cTexture tex = node.GetTextures();
4444
+ String pigment = Object3D.GetPigment(tex);
4445
+ //String bump = Object3D.GetBump(tex);
4446
+
4447
+ com.sun.opengl.util.texture.TextureData texturedata = null;
4448
+
4449
+ try
4450
+ {
4451
+ texturedata = Globals.theRenderer.GetTextureData(tex, false, node.texres);
4452
+ }
4453
+ catch (Exception e)
4454
+ {
4455
+ System.err.println("FAIL: " + node);
4456
+ }
4457
+
4458
+ double s = v.s;
4459
+
4460
+ if (s == 1)
4461
+ s = 0;
4462
+
4463
+ double t = v.t;
4464
+
4465
+ if (t == 1)
4466
+ t = 0;
4467
+
4468
+ int indexs = (int) (texturedata.getWidth() * s);
4469
+ int indext = (int) (texturedata.getHeight() * t);
4470
+
4471
+ int index = indext * texturedata.getWidth() + indexs;
4472
+
4473
+ java.nio.ByteBuffer bytebuf = (java.nio.ByteBuffer)texturedata.getBuffer();
4474
+
4475
+ int slide = bytebuf.capacity() / texturedata.getWidth() / texturedata.getHeight();
4476
+
4477
+ float scale = bytebuf.get(index*slide) & 0xFF;
4478
+ scale += bytebuf.get(index*slide+1) & 0xFF;
4479
+ scale += bytebuf.get(index*slide+2) & 0xFF;
4480
+ scale /= 3;
4481
+
4482
+ scale /= 0xFF;
4483
+ // c'est quoi ca? scale /= 4;
4484
+
4485
+ //v.AO = scale;
4486
+
4487
+ v.x += v.norm.x * scale;
4488
+ v.y += v.norm.y * scale;
4489
+ v.z += v.norm.z * scale;
4490
+ }
4491
+
4492
+ public void Face(Object3D node, Face f)
4493
+ {
4494
+ }
4495
+ }
4496
+ );
4497
+ }
4498
+
4499
+ refreshContents();
4500
+ }
4501
+
32504502 void Align()
32514503 {
4504
+ if (group.selection.size() == 0)
4505
+ return;
4506
+
4507
+ cVector bbmin = new cVector();
4508
+ cVector bbmax = new cVector();
4509
+
4510
+ group.selection.get(0).getBounds(bbmin, bbmax, true);
4511
+
4512
+ double dx = bbmax.x - bbmin.x;
4513
+ double dy = bbmax.y - bbmin.y;
4514
+ double dz = bbmax.z - bbmin.z;
4515
+
4516
+ double scale = Math.sqrt(dx*dx + dy*dy + dz*dz);
4517
+
32524518 for (int i=0; i<group.selection.size(); i++)
32534519 {
32544520 Object3D obj = group.selection.get(i);
32554521
3256
- LA.matTranslate(obj.toParent, i/2f, 0, 0);
3257
- LA.matTranslateInv(obj.fromParent, -i/2f, 0, 0);
4522
+ LA.matTranslate(obj.toParent, i * scale, 0, 0);
4523
+ LA.matTranslateInv(obj.fromParent, -i * scale, 0, 0);
32584524 }
32594525
32604526 refreshContents();
....@@ -3267,7 +4533,7 @@
32674533 // ref.SaveSupports();
32684534 // Object3D par = ref.parent;
32694535 // ref.parent = null;
3270
-// Object3D lowres = (Object3D) GraphreeD.clone(ref);
4536
+// Object3D lowres = (Object3D) GrafreeD.clone(ref);
32714537 // ref.parent = par;
32724538 // ref.RestoreSupports();
32734539
....@@ -3275,11 +4541,11 @@
32754541
32764542 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
32774543
3278
- boolean random = CameraPane.RANDOM;
3279
- CameraPane.RANDOM = false; // parse all random nodes
4544
+ boolean random = CameraPane.SWITCH;
4545
+ CameraPane.SWITCH = false; // parse all random nodes
32804546 lowres.linkVerticesThis(null);
32814547 lowres.linkVerticesThis(sn);
3282
- CameraPane.RANDOM = random;
4548
+ CameraPane.SWITCH = random;
32834549
32844550 System.err.flush();
32854551
....@@ -3297,7 +4563,7 @@
32974563 // lowres.SaveSupports();
32984564 // par = lowres.parent;
32994565 // lowres.parent = null;
3300
-// Object3D newlow = (Object3D) GraphreeD.clone(lowres);
4566
+// Object3D newlow = (Object3D) GrafreeD.clone(lowres);
33014567 Object3D newlow = CloneObject(lowres, false);
33024568 newlow.name = sn.switchobject.get(i).name;
33034569 System.out.println(" pose#" + i + " = " + newlow);
....@@ -3319,7 +4585,7 @@
33194585 return;
33204586
33214587 Object3D poses = group.selection.get(0);
3322
- Object3D ref = GraphreeD.clipboard.get(0);
4588
+ Object3D ref = Grafreed.clipboard.get(0);
33234589
33244590 Object3D newgroup = new Object3D("Po:" + poses.name);
33254591
....@@ -3488,7 +4754,7 @@
34884754 group.selection.RelinkToSupport(); // july 2014
34894755 System.out.println("DONE.");
34904756 refreshContents();
3491
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
4757
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
34924758 }
34934759
34944760 void ReduceMesh(boolean reduction34)
....@@ -3513,20 +4779,20 @@
35134779
35144780 void ClipMesh()
35154781 {
3516
- if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
4782
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
35174783 {
3518
- Object3D content = GraphreeD.clipboard.get(0);
4784
+ Object3D content = Grafreed.clipboard.get(0);
35194785
35204786 if (content instanceof cGroup && ((cGroup)content).transientlink )
35214787 content = ((cGroup)content).get(0);
35224788
35234789 // for (int i=0; i<group.selection.size(); i++)
35244790 // {
3525
-// group.selection.get(i).ClipMesh(GraphreeD.clipboard);
4791
+// group.selection.get(i).ClipMesh(GrafreeD.clipboard);
35264792 // }
3527
- group.selection.ClipMesh(GraphreeD.clipboard);
4793
+ group.selection.ClipMesh(Grafreed.clipboard);
35284794 }
3529
-// group.selection.ClipMesh(GraphreeD.clipboard);
4795
+// group.selection.ClipMesh(GrafreeD.clipboard);
35304796 System.out.println("DONE.");
35314797 refreshContents();
35324798 }
....@@ -3571,6 +4837,18 @@
35714837 void MarkLeaves(boolean hide)
35724838 {
35734839 group.selection.MarkLeaves(hide);
4840
+ refreshContents();
4841
+ }
4842
+
4843
+ void RewindLeaves(boolean hide)
4844
+ {
4845
+ group.selection.RewindLeaves(hide);
4846
+ refreshContents();
4847
+ }
4848
+
4849
+ void RandomLeaves(boolean hide)
4850
+ {
4851
+ group.selection.RandomLeaves(hide);
35744852 refreshContents();
35754853 }
35764854
....@@ -3645,28 +4923,25 @@
36454923 // }
36464924 // }
36474925
3648
- static boolean allparams = true;
3649
-
3650
- static Vector<Object3D> listUI = new Vector<Object3D>();
3651
-
36524926 void EditSelection(boolean newWindow)
36534927 {
4928
+ if (group.selection == null)
4929
+ {
4930
+ EditElement(group, newWindow); // ? new
4931
+ return;
4932
+ }
4933
+
36544934 // aConstraints.gridy = 0;
36554935 for (int i=0; i<group.selection.size(); i++)
36564936 {
36574937 //System.out.println("edit : " + objectPanel.indexOfTab("Material"));
36584938 //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false);
3659
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
4939
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
36604940
36614941 Object3D elem = (Object3D)group.selection.elementAt(i);
3662
- if(elem != group)
4942
+ if(elem != group || !newWindow)
36634943 {
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
4944
+ EditElement(elem, newWindow); // ? new
36704945 }
36714946 }
36724947 }
....@@ -3741,7 +5016,8 @@
37415016 //new Exception().printStackTrace();
37425017
37435018 freezemodel = true;
3744
-
5019
+ ClearUnpinned();
5020
+
37455021 /**/
37465022 //switch (event.id)
37475023 {
....@@ -3749,7 +5025,6 @@
37495025 //case 702: // Event.LIST_DESELECT
37505026 group.deselectAll();
37515027 TreePath tps[] = objEditor.jTree.getSelectionPaths();
3752
- objEditor.ClearInfo(); // .GetMaterial());
37535028 if (tps != null)
37545029 {
37555030 for (int i=0; i < tps.length; i++)
....@@ -3758,33 +5033,39 @@
37585033
37595034 //if (child.parent != null)
37605035 //child.parent.addSelectee(child);
5036
+ objEditor.SetMaterial(child);
37615037 group.addSelectee(child);
3762
- objEditor.SetMaterial(child); // .GetMaterial());
3763
- objEditor.AddInfo(child, this, true); // .GetMaterial());
3764
- System.err.println("info : " + child.GetPath());
37655038 }
37665039 }
3767
- else
3768
- {
3769
- objEditor.SetMaterial(group); // .GetMaterial());
3770
- objEditor.AddInfo(group, this, true); // .GetMaterial());
3771
- System.err.println("info : " + group.GetPath());
3772
- }
5040
+// else
5041
+// {
5042
+// objEditor.SetMaterial(group); // .GetMaterial());
5043
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
5044
+// System.err.println("info : " + group.GetPath());
5045
+// }
37735046
3774
- objEditor.SetText(); // jan 2014
3775
-
3776
- if (flashIt && !CameraPane.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
5047
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera))
37775048 CameraPane.flash = true;
37785049
3779
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
5050
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
37805051 // a camera
37815052 {
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;
5053
+ if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crash the camera because of invalid lightspace
5054
+ {
5055
+ CameraPane.camerachangeframe = 0; // don't refuse it
5056
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
5057
+ }
5058
+ // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
5059
+ // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
37865060 }
37875061
5062
+ if (tps != null && tps.length == 1)
5063
+ {
5064
+ EditSelection(false);
5065
+ }
5066
+
5067
+ SetPinStates(tps != null && tps.length > 0);
5068
+
37885069 refreshContents();
37895070 //return true;
37905071 }
....@@ -3793,6 +5074,35 @@
37935074
37945075 freezemodel = false;
37955076 }
5077
+
5078
+ void SetPinStates(boolean enabled)
5079
+ {
5080
+ editButton.setEnabled(enabled);
5081
+ uneditButton.setEnabled(enabled);
5082
+ unselectButton.setEnabled(enabled);
5083
+ flashSelectionButton.setEnabled(enabled);
5084
+ }
5085
+
5086
+ void refreshContents(boolean cp)
5087
+ {
5088
+ if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info"))
5089
+ if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING)
5090
+ {
5091
+ objEditor.ClearInfo(); // .GetMaterial());
5092
+
5093
+ for (int i=0; i < group.selection.Size(); i++)
5094
+ {
5095
+ Object3D child = (Object3D) group.selection.get(i);
5096
+
5097
+ objEditor.AddInfo(child, this, true);
5098
+ System.err.println("info : " + child.GetPath());
5099
+ }
5100
+
5101
+ objEditor.SetText(); // jan 2014
5102
+ }
5103
+
5104
+ super.refreshContents(cp);
5105
+ }
37965106
37975107 void linkSomething(Object3D thing)
37985108 {
....@@ -3864,16 +5174,19 @@
38645174 {
38655175 if (group.selection.isEmpty())
38665176 return;
3867
- GraphreeD.clipboardIsTempGroup = false;
5177
+
5178
+ Grafreed.clipboardIsTempGroup = false;
38685179 Composite tGroup = null;
38695180 if (group.selection.size() > 0) // 1)
38705181 {
38715182 tGroup = new cGroup();
3872
- GraphreeD.clipboardIsTempGroup = true;
5183
+ Grafreed.clipboardIsTempGroup = true;
38735184 }
38745185
38755186 if (cut)
38765187 {
5188
+// if (Globals.SAVEONMAKE) // Moved to the clipboard, no need to save.
5189
+// Save();
38775190 //int indices[] = jList.getSelectedIndices();
38785191 //for (int i = indices.length - 1; i >= 0; i--)
38795192 //jList.remove(indices[i]);
....@@ -3909,16 +5222,16 @@
39095222 //System.out.println("cut " + child);
39105223 //System.out.println("parent = " + child.parent);
39115224 // tmp.addChild(child);
3912
- if (GraphreeD.clipboardIsTempGroup)
5225
+ if (Grafreed.clipboardIsTempGroup)
39135226 tGroup.add/*Child*/(tmp);
39145227 else
3915
- GraphreeD.clipboard = tmp;
5228
+ Grafreed.clipboard = tmp;
39165229 }
39175230 else
3918
- if (GraphreeD.clipboardIsTempGroup)
5231
+ if (Grafreed.clipboardIsTempGroup)
39195232 tGroup.add/*Child*/(child);
39205233 else
3921
- GraphreeD.clipboard = child;
5234
+ Grafreed.clipboard = child;
39225235 }
39235236
39245237 //ResetModel();
....@@ -3950,21 +5263,23 @@
39505263 //System.out.println("cut " + elem);
39515264 //System.out.println("parent = " + elem.parent);
39525265 // tmp.addChild(elem);
3953
- if (GraphreeD.clipboardIsTempGroup)
5266
+ if (Grafreed.clipboardIsTempGroup)
39545267 tGroup.add/*Child*/(tmp);
39555268 else
3956
- GraphreeD.clipboard = tmp;
5269
+ Grafreed.clipboard = tmp;
39575270 }
39585271 else
3959
- if (GraphreeD.clipboardIsTempGroup)
5272
+ if (Grafreed.clipboardIsTempGroup)
39605273 tGroup.add/*Child*/(child);
39615274 else
3962
- GraphreeD.clipboard = child;
5275
+ Grafreed.clipboard = child;
39635276 }
39645277
39655278 }
3966
- if (GraphreeD.clipboardIsTempGroup)
3967
- GraphreeD.clipboard = tGroup;
5279
+
5280
+ if (Grafreed.clipboardIsTempGroup)
5281
+ Grafreed.clipboard = tGroup;
5282
+
39685283 if (cut)
39695284 {
39705285 ResetModel();
....@@ -3974,11 +5289,15 @@
39745289
39755290 void paste(boolean expand)
39765291 {
3977
- // if (GraphreeD.clipboard == null)
5292
+ if (Globals.REPLACEONMAKE)
5293
+ Save();
5294
+ boolean keep = Globals.REPLACEONMAKE;
5295
+ Globals.REPLACEONMAKE = false;
5296
+ // if (GrafreeD.clipboard == null)
39785297 // return;
39795298 boolean first = true;
39805299
3981
- if (GraphreeD.clipboardIsTempGroup)
5300
+ if (Grafreed.clipboardIsTempGroup)
39825301 {
39835302 Composite temp;
39845303
....@@ -3989,7 +5308,7 @@
39895308 temp = (Composite)Applet3D.clipboard.deepCopy();
39905309 */
39915310 Object3D elem;
3992
- for (Enumeration e = /*temp.children*/GraphreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
5311
+ for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
39935312 {
39945313 Object3D child = (Object3D)e.nextElement();
39955314
....@@ -4003,7 +5322,7 @@
40035322 else
40045323 elem = child.deepCopy(); // ?
40055324 child.parent = keepparent;
4006
- //if (GraphreeD.clipboardIsTempGroup && LA.isIdentity(elem.fromParent))
5325
+ //if (GrafreeD.clipboardIsTempGroup && LA.isIdentity(elem.fromParent))
40075326 // elem = elem.get(0);
40085327 makeSomething(elem, true); // ?? first);
40095328 //group.addChild(elem);
....@@ -4023,23 +5342,24 @@
40235342 //Object3D cb = Applet3D.clipboard;
40245343 //temp.addChild(cb);
40255344 //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());
5345
+ assert(Grafreed.clipboard.parent == null);
5346
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
5347
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
5348
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
5349
+ makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy());
40315350 else
4032
- makeSomething(expand?GraphreeD.clipboard.copyExpand():GraphreeD.clipboard.deepCopy());
4033
- GraphreeD.clipboard.get(0).parent = keepparent;
5351
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
5352
+ Grafreed.clipboard.get(0).parent = keepparent;
40345353 }
40355354
5355
+ Globals.REPLACEONMAKE = keep;
40365356 ResetModel();
40375357 refreshContents();
40385358 }
40395359
4040
- void pasteInto(boolean copyit)
5360
+ void pasteInto(boolean copyit, boolean clone)
40415361 {
4042
-// if (GraphreeD.clipboard == null)
5362
+// if (GrafreeD.clipboard == null)
40435363 // return;
40445364
40455365 if (group.selection.size() != 1)
....@@ -4066,15 +5386,22 @@
40665386 if (copyit)
40675387 {
40685388 // paste(false);
4069
- CloneClipboard(false); // sept 2014
5389
+ if (clone)
5390
+ {
5391
+ CloneClipboard(false); // sept 2014
5392
+ }
5393
+ else
5394
+ {
5395
+ paste(false);
5396
+ }
40705397 }
40715398 else
40725399 {
40735400 boolean first = true;
40745401
4075
- if (GraphreeD.clipboardIsTempGroup)
5402
+ if (Grafreed.clipboardIsTempGroup)
40765403 {
4077
- Composite temp = (Composite)GraphreeD.clipboard;
5404
+ Composite temp = (Composite)Grafreed.clipboard;
40785405 Object3D copy;
40795406 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
40805407 {
....@@ -4084,7 +5411,7 @@
40845411 }
40855412 } else
40865413 {
4087
- linkSomething(GraphreeD.clipboard); //.get(0));
5414
+ linkSomething(Grafreed.clipboard); //.get(0));
40885415 }
40895416 }
40905417 }
....@@ -4161,6 +5488,10 @@
41615488
41625489 void group(Object3D csg, boolean grab)
41635490 {
5491
+ if (Globals.REPLACEONMAKE)
5492
+ Save();
5493
+ boolean keep = Globals.REPLACEONMAKE;
5494
+ Globals.REPLACEONMAKE = false;
41645495 if (//false) // why??
41655496 !group.selection.isEmpty())
41665497 {
....@@ -4274,8 +5605,34 @@
42745605 //node.add(csg);
42755606 //makeSomething(node);
42765607 makeSomething(csg);
5608
+ Globals.REPLACEONMAKE = keep;
42775609 }
42785610
5611
+ void Ungroup(Object3D g)
5612
+ {
5613
+ if (Globals.REPLACEONMAKE)
5614
+ Save();
5615
+ boolean keep = Globals.REPLACEONMAKE;
5616
+ Globals.REPLACEONMAKE = false;
5617
+ if (g instanceof HiddenObject)
5618
+ {
5619
+ HiddenObject h = (HiddenObject) g;
5620
+
5621
+ for (int i=0; i<h.ActualSize(); i++)
5622
+ {
5623
+ objEditor.makeSomething(h.get(i), false);
5624
+ }
5625
+ }
5626
+ else
5627
+ {
5628
+ for (int i=0; i<g.Size(); i++)
5629
+ {
5630
+ objEditor.makeSomething(g.get(i), false);
5631
+ }
5632
+ }
5633
+ Globals.REPLACEONMAKE = keep;
5634
+ }
5635
+
42795636 void ungroup()
42805637 {
42815638 /*
....@@ -4469,21 +5826,6 @@
44695826 }
44705827 */
44715828
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
-
44875829 /*
44885830 public void Callback(Object obj)
44895831 {
....@@ -4507,26 +5849,9 @@
45075849 }
45085850 */
45095851
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
-
45275852 String GetFile(String dialogName)
45285853 {
4529
- if (GraphreeD.standAlone)
5854
+ if (Grafreed.standAlone)
45305855 {
45315856 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
45325857 browser.show();
....@@ -4590,10 +5915,49 @@
45905915 cButton flashSelectionButton;
45915916 cButton editButton;
45925917 cButton uneditButton;
5918
+ JCheckBox allParamsButton;
45935919 cButton clearpanelButton;
4594
- cButton allParamsButton;
45955920 cButton unselectButton;
45965921
5922
+ cButton restoreCameraButton;
5923
+
5924
+ cButton saveButton;
5925
+ cButton oneStepButton;
5926
+
5927
+ cButton groupButton;
5928
+ cButton ungroupButton;
5929
+ cButton compositeButton;
5930
+ cButton switchButton;
5931
+ cButton loopButton;
5932
+ cButton textureButton;
5933
+
5934
+ cButton skybox1Button;
5935
+ cButton skybox2Button;
5936
+ cButton skybox3Button;
5937
+ cButton skybox4Button;
5938
+ cButton skybox5Button;
5939
+ cButton skybox6Button;
5940
+ cButton skybox7Button;
5941
+
5942
+ cButton skybox11Button;
5943
+ cButton skybox12Button;
5944
+ cButton skybox13Button;
5945
+ cButton skybox14Button;
5946
+ cButton skybox15Button;
5947
+ cButton skybox16Button;
5948
+ cButton skybox17Button;
5949
+
5950
+ cButton gridButton;
5951
+ cButton boxButton;
5952
+ cButton sphereButton;
5953
+ cButton coneButton;
5954
+ cButton torusButton;
5955
+ cButton superButton;
5956
+ cButton kleinButton;
5957
+ cButton particlesButton;
5958
+ cButton overlayButton;
5959
+ cButton lightButton;
5960
+
45975961 cButton screenfitButton;
45985962 cButton screenfitpointButton;
45995963 cButton snapobjectButton;
....@@ -4605,14 +5969,6 @@
46055969
46065970 cButton setsupportButton;
46075971
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
-
46165972 //
46175973 //Composite
46185974 Object3D // to do !!
....@@ -4622,9 +5978,11 @@
46225978 //JTree jTree;
46235979 private MenuItem lookAtItem;
46245980 private MenuItem lookFromItem;
4625
- private MenuItem switchItem;
5981
+ private MenuItem switchViewItem;
46265982 private MenuItem cutItem;
4627
- private MenuItem duplicateItem;
5983
+ private MenuItem undoItem;
5984
+ private MenuItem redoItem;
5985
+ private JMenuItem duplicateItem;
46285986 private MenuItem cloneItem;
46295987 private MenuItem cloneSupportItem;
46305988 private MenuItem overwriteGeoItem;
....@@ -4635,8 +5993,9 @@
46355993 private MenuItem resetsupportItem;
46365994 private MenuItem resetreferencesItem;
46375995 private MenuItem linkverticesItem;
5996
+ private MenuItem relinkverticesItem;
46385997 private MenuItem setMasterItem;
4639
- private MenuItem resetMeshItem;
5998
+ private MenuItem resetAllItem;
46405999 private MenuItem stepAllItem;
46416000 private MenuItem revertMeshItem;
46426001 private MenuItem poseMeshItem;
....@@ -4647,14 +6006,17 @@
46476006 private MenuItem mergeGeometriesItem;
46486007 private MenuItem copyItem;
46496008 private MenuItem pasteItem;
6009
+ private MenuItem pasteIntoItem;
46506010 private MenuItem pasteLinkItem;
46516011 private MenuItem pasteCloneItem;
46526012 private MenuItem pasteExpandItem;
4653
- private MenuItem clearItem;
6013
+ private MenuItem deleteItem;
46546014 private MenuItem clearAllItem;
46556015 private MenuItem genUVItem;
6016
+ private MenuItem genNormalsMESHItem;
46566017 private MenuItem genNormalsCADItem;
46576018 private MenuItem genNormalsORGANItem;
6019
+ private MenuItem genNormalsMINEItem;
46586020 private MenuItem stripifyItem;
46596021 private MenuItem unstripifyItem;
46606022 private MenuItem trimItem;
....@@ -4683,6 +6045,10 @@
46836045 private MenuItem showleavesItem;
46846046 private MenuItem markleavesItem;
46856047 private MenuItem unmarkleavesItem;
6048
+ private MenuItem rewindleavesItem;
6049
+ private MenuItem unrewindleavesItem;
6050
+ private MenuItem randomleavesItem;
6051
+ private MenuItem unrandomleavesItem;
46866052
46876053 private MenuItem flipVItem;
46886054 private MenuItem unflipVItem;
....@@ -4694,14 +6060,17 @@
46946060 private MenuItem panoTexturesItem;
46956061
46966062 private MenuItem resetCentroidItem;
4697
- private MenuItem transformgeometryItem;
6063
+ private MenuItem resetCentroidXZItem;
46986064 private MenuItem resetTransformItem;
6065
+ private MenuItem transformGeometryItem;
6066
+ private MenuItem transformChildrenItem;
6067
+ private MenuItem hideItem;
46996068 private MenuItem grabItem;
47006069 private MenuItem backItem;
47016070 private MenuItem frontItem;
47026071 private MenuItem cameraItem;
47036072 private MenuItem compositeItem;
4704
- private MenuItem randomItem;
6073
+ private MenuItem switchItem;
47056074 private MenuItem physicsItem;
47066075 private MenuItem frameselectorItem;
47076076 private MenuItem scriptNodeItem;
....@@ -4716,6 +6085,7 @@
47166085
47176086 private MenuItem resetParentItem;
47186087 private MenuItem repairParentItem;
6088
+ private MenuItem repairShadowItem;
47196089 private MenuItem sortbysizeItem;
47206090 private MenuItem sortbynameItem;
47216091
....@@ -4724,20 +6094,25 @@
47246094 private MenuItem attachBumpItem;
47256095 private MenuItem detachBumpItem;
47266096 private MenuItem pigmentBumpItem;
6097
+ private MenuItem embedTexturesItem;
6098
+ private MenuItem deEmbedTexturesItem;
47276099
47286100 private MenuItem particleItem;
47296101 private MenuItem ragdollItem;
47306102 private MenuItem ragdoll2Item;
6103
+ private MenuItem heightFieldItem;
6104
+ private MenuItem textureFieldItem;
47316105 private MenuItem gridItem;
47326106 private MenuItem rectoidItem;
47336107 private MenuItem ellipsoidItem;
47346108 private MenuItem coneItem;
47356109 private MenuItem torusItem;
47366110 private MenuItem superItem;
6111
+ private MenuItem kleinItem;
47376112 private MenuItem blobItem;
47386113 private MenuItem latheItem;
47396114 private MenuItem bezierItem;
4740
- private MenuItem checkerItem;
6115
+ private MenuItem overlayItem;
47416116 private MenuItem meshItem;
47426117 // private MenuItem meshGroupItem;
47436118 private MenuItem springItem;
....@@ -4746,6 +6121,7 @@
47466121 private MenuItem csgItem;
47476122 private MenuItem templateItem;
47486123 private MenuItem textureItem;
6124
+ private MenuItem billboardItem;
47496125 private MenuItem shadowXItem;
47506126 private MenuItem shadowYItem;
47516127 private MenuItem shadowZItem;
....@@ -4758,11 +6134,6 @@
47586134 private MenuItem doubleItem;
47596135 private MenuItem tripleItem;
47606136
4761
- private MenuItem importGFDItem;
4762
- private MenuItem importVRMLX3DItem;
4763
- private MenuItem import3DSItem;
4764
- private MenuItem importOBJItem;
4765
-
47666137 private MenuItem computeAOItem;
47676138 private MenuItem recompileItem;
47686139 private MenuItem editScriptItem;
....@@ -4772,4 +6143,8 @@
47726143 private MenuItem analyzeItem;
47736144 private MenuItem dumpItem;
47746145 //boolean freezemodel = false;
6146
+
6147
+ Menu cameraMenu;
6148
+ MenuItem editCameraItem;
6149
+ MenuItem restoreCameraItem;
47756150 }