Normand Briere
2019-08-01 c99d954f5e2bffa601c599142371cfeb45630f40
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,302 @@
2223 DragGestureListener, DragSourceListener, DropTargetListener,
2324 ItemListener // ListSelectionListener
2425 {
26
+
27
+ public void AddSkyboxButton(String f, String s, cGridBag row)
28
+ {
29
+ cButton skyboxButton;
30
+ final String path = "cubemaps/" + f + "-skyboxes/" + s;
31
+ row.add(skyboxButton = GetButton(path + "/preview.jpg", !Grafreed.NIMBUSLAF));
32
+ //row.add(skyboxButton = GetButton(path + "/negx.jpg", !Grafreed.NIMBUSLAF));
33
+ skyboxButton.setToolTipText(s);
34
+ skyboxButton.addActionListener(new ActionListener()
35
+ {
36
+ @Override
37
+ public void actionPerformed(ActionEvent e)
38
+ {
39
+ ChangeSkybox(path);
40
+ }
41
+ });
42
+ }
43
+
44
+ public void AddSkyboxTab0(JTabbedPane skyboxpanel)
45
+ {
46
+ cGridBag tab0 = new cGridBag().setVertical(true);
47
+
48
+ tab0.setName("Urban");
49
+ skyboxpanel.add(tab0);
50
+
51
+ cGridBag row0 = new cGridBag();
52
+ cGridBag row1 = new cGridBag();
53
+ cGridBag row2 = new cGridBag();
54
+ cGridBag row3 = new cGridBag();
55
+ cGridBag row4 = new cGridBag();
56
+ cGridBag row5 = new cGridBag();
57
+ cGridBag row6 = new cGridBag();
58
+
59
+ AddSkyboxButton("default", "rgb", row0);
60
+ //AddSkyboxButton("default", "cornell", row0);
61
+ AddSkyboxButton("penguins", "dust", row0);
62
+ AddSkyboxButton("penguins", "tropic", row0);
63
+ AddSkyboxButton("penguins", "yonder", row0);
64
+
65
+ AddSkyboxButton("default", "uffizi", row1);
66
+ AddSkyboxButton("bridge", "Bridge", row1);
67
+ AddSkyboxButton("bridge", "Bridge2", row1);
68
+ AddSkyboxButton("urban", "GamlaStan2", row1);
69
+
70
+ AddSkyboxButton("urban", "Parliament", row2);
71
+ AddSkyboxButton("urban", "Roundabout", row2);
72
+ AddSkyboxButton("urban", "SaintLazarusChurch", row2);
73
+ AddSkyboxButton("urban", "SaintLazarusChurch2", row2);
74
+
75
+ AddSkyboxButton("urban", "SaintLazarusChurch3", row3);
76
+ AddSkyboxButton("urban", "UnionSquare", row3);
77
+ AddSkyboxButton("urban", "Medborgarplatsen", row3);
78
+ AddSkyboxButton("park", "BerzeliiPark", row3);
79
+
80
+ AddSkyboxButton("park", "Buddha", row4);
81
+ AddSkyboxButton("park", "CNTower2", row4);
82
+ AddSkyboxButton("park", "NiagaraFalls1", row4);
83
+ AddSkyboxButton("park", "NiagaraFalls3", row4);
84
+
85
+ AddSkyboxButton("park", "Park", row5);
86
+ AddSkyboxButton("park", "Pond", row5);
87
+ AddSkyboxButton("park", "Skansen", row5);
88
+ AddSkyboxButton("park", "Skansen2", row5);
89
+
90
+ AddSkyboxButton("park", "Skansen3", row6);
91
+ AddSkyboxButton("park", "Skansen4", row6);
92
+ AddSkyboxButton("park", "Skansen5", row6);
93
+ AddSkyboxButton("persson", "VancouverConventionCentre", row6);
94
+
95
+ tab0.add(row0);
96
+ tab0.add(row1);
97
+ tab0.add(row2);
98
+ tab0.add(row3);
99
+ tab0.add(row4);
100
+ tab0.add(row5);
101
+ tab0.add(row6);
102
+
103
+ for (int i=5; --i>=0;)
104
+ {
105
+ //oe.toolboxPanel.Return();
106
+ //tab0.add(new cGridBag());
107
+ }
108
+ }
109
+
110
+ public void AddSkyboxTab1(JTabbedPane skyboxpanel)
111
+ {
112
+ cGridBag tab0 = new cGridBag().setVertical(true);
113
+
114
+ tab0.setName("Nature");
115
+ skyboxpanel.add(tab0);
116
+
117
+ cGridBag row0 = new cGridBag();
118
+ cGridBag row1 = new cGridBag();
119
+ cGridBag row2 = new cGridBag();
120
+ cGridBag row3 = new cGridBag();
121
+ cGridBag row4 = new cGridBag();
122
+ cGridBag row5 = new cGridBag();
123
+ cGridBag row6 = new cGridBag();
124
+
125
+ AddSkyboxButton("beach", "HeartInTheSand", row0);
126
+ AddSkyboxButton("beach", "LarnacaBeach", row0);
127
+ AddSkyboxButton("beach", "PalmTrees", row0);
128
+ AddSkyboxButton("beach", "Tenerife", row0);
129
+
130
+ AddSkyboxButton("beach", "Tenerife2", row1);
131
+ AddSkyboxButton("beach", "Tenerife3", row1);
132
+ AddSkyboxButton("field", "FishPond", row1);
133
+ AddSkyboxButton("field", "Footballfield", row1);
134
+
135
+ AddSkyboxButton("field", "Meadow", row2);
136
+ AddSkyboxButton("field", "Sorsele", row2);
137
+ AddSkyboxButton("field", "Sorsele2", row2);
138
+ AddSkyboxButton("field", "Sorsele3", row2);
139
+
140
+ AddSkyboxButton("forest", "Brudslojan", row3);
141
+ AddSkyboxButton("forest", "Langholmen2", row3);
142
+ AddSkyboxButton("forest", "Plants", row3);
143
+ AddSkyboxButton("mountain", "Maskonaive", row3);
144
+
145
+ AddSkyboxButton("mountain", "Maskonaive2", row4);
146
+ AddSkyboxButton("mountain", "Maskonaive3", row4);
147
+ AddSkyboxButton("mountain", "Teide", row4);
148
+ AddSkyboxButton("park", "Tantolunden4", row4);
149
+
150
+ AddSkyboxButton("park", "Stairs", row5);
151
+ AddSkyboxButton("default", "skycube", row6);
152
+ AddSkyboxButton("rocky", "Langholmen", row5);
153
+ AddSkyboxButton("rocky", "Skinnarviksberget", row5);
154
+
155
+ AddSkyboxButton("rocky", "Tantolunden6", row5);
156
+ AddSkyboxButton("default", "CloudyHills", row6);
157
+ AddSkyboxButton("daz", "Autumn", row6);
158
+ AddSkyboxButton("daz", "MountainTrail", row6);
159
+ /*
160
+Autumn
161
+Greenlands
162
+MountainTrail
163
+Oasis
164
+TheRock
165
+TopOfTheWorld
166
+Winter
167
+ */
168
+
169
+ tab0.add(row0);
170
+ tab0.add(row1);
171
+ tab0.add(row2);
172
+ tab0.add(row3);
173
+ tab0.add(row4);
174
+ tab0.add(row5);
175
+ tab0.add(row6);
176
+
177
+ for (int i=5; --i>=0;)
178
+ {
179
+ //oe.toolboxPanel.Return();
180
+ //tab0.add(new cGridBag());
181
+ }
182
+ }
183
+
184
+ public void AddSkyboxTab2(JTabbedPane skyboxpanel)
185
+ {
186
+ cGridBag tab0 = new cGridBag().setVertical(true);
187
+
188
+ tab0.setName("Night");
189
+ skyboxpanel.add(tab0);
190
+
191
+ cGridBag row0 = new cGridBag();
192
+ cGridBag row1 = new cGridBag();
193
+ cGridBag row2 = new cGridBag();
194
+ cGridBag row3 = new cGridBag();
195
+ cGridBag row4 = new cGridBag();
196
+ cGridBag row5 = new cGridBag();
197
+ cGridBag row6 = new cGridBag();
198
+
199
+ AddSkyboxButton("night", "NightPath", row0);
200
+ AddSkyboxButton("night", "PondNight", row0);
201
+ AddSkyboxButton("night", "Powerlines", row0);
202
+ AddSkyboxButton("night", "SwedishRoyalCastle", row0);
203
+
204
+ AddSkyboxButton("urban", "CNTower", row1);
205
+ AddSkyboxButton("bridge", "ArstaBridge", row1);
206
+ AddSkyboxButton("rocky", "Riddarfjarden", row1);
207
+ AddSkyboxButton("penguins", "sleepyhollow", row1);
208
+
209
+ AddSkyboxButton("penguins", "kenon_star", row2);
210
+ AddSkyboxButton("persson", "corona", row2);
211
+ AddSkyboxButton("persson", "spaceskybox", row2);
212
+ AddSkyboxButton("indoors", "Vasa", row2);
213
+
214
+ AddSkyboxButton("winter", "Backyard", row3);
215
+ AddSkyboxButton("winter", "Creek", row3);
216
+ AddSkyboxButton("winter", "FootballField3", row3);
217
+ AddSkyboxButton("winter", "Forest", row3);
218
+
219
+ AddSkyboxButton("winter", "HornstullsStrand2", row4);
220
+ AddSkyboxButton("winter", "House", row4);
221
+ AddSkyboxButton("winter", "IceLake", row4);
222
+ AddSkyboxButton("winter", "IceRiver", row4);
223
+
224
+ AddSkyboxButton("winter", "Park3", row5);
225
+ AddSkyboxButton("winter", "PondWinter", row5);
226
+ AddSkyboxButton("winter", "Tantolunden5", row5);
227
+ AddSkyboxButton("winter", "Vindelalven", row5);
228
+
229
+ AddSkyboxButton("daz", "TheRock", row6);
230
+ AddSkyboxButton("daz", "TopOfTheWorld", row6);
231
+ AddSkyboxButton("daz", "Winter", row6);
232
+ AddSkyboxButton("mountain", "Ryfjallet", row6);
233
+
234
+ tab0.add(row0);
235
+ tab0.add(row1);
236
+ tab0.add(row2);
237
+ tab0.add(row3);
238
+ tab0.add(row4);
239
+ tab0.add(row5);
240
+ tab0.add(row6);
241
+
242
+ for (int i=5; --i>=0;)
243
+ {
244
+ //oe.toolboxPanel.Return();
245
+ //tab0.add(new cGridBag());
246
+ }
247
+ }
248
+
249
+ public void AddSkyboxTab3(JTabbedPane skyboxpanel)
250
+ {
251
+ cGridBag tab0 = new cGridBag().setVertical(true);
252
+
253
+ tab0.setName("Others");
254
+ skyboxpanel.add(tab0);
255
+
256
+ cGridBag row0 = new cGridBag();
257
+ cGridBag row1 = new cGridBag();
258
+ cGridBag row2 = new cGridBag();
259
+ cGridBag row3 = new cGridBag();
260
+ cGridBag row4 = new cGridBag();
261
+ cGridBag row5 = new cGridBag();
262
+ cGridBag row6 = new cGridBag();
263
+
264
+ AddSkyboxButton("mayhem", "afterrain", row0);
265
+ AddSkyboxButton("mayhem", "aqua4", row0);
266
+ AddSkyboxButton("mayhem", "aqua9", row0);
267
+ AddSkyboxButton("mayhem", "flame", row0);
268
+
269
+ AddSkyboxButton("mayhem", "h2s", row1);
270
+ AddSkyboxButton("mayhem", "prehistoric", row1);
271
+ AddSkyboxButton("mayhem", "scorched", row1);
272
+ AddSkyboxButton("penguins", "desertdawn", row1);
273
+
274
+ AddSkyboxButton("persson", "Citadella", row2);
275
+ AddSkyboxButton("persson", "Citadella2", row2);
276
+ AddSkyboxButton("persson", "clouds1", row2);
277
+ AddSkyboxButton("penguins", "wrath", row2);
278
+
279
+ AddSkyboxButton("persson", "FishermansBastion", row3);
280
+ AddSkyboxButton("persson", "HeroesSquare", row3);
281
+ AddSkyboxButton("indoors", "DallasW", row3);
282
+ AddSkyboxButton("indoors", "MarriottMadisonWest", row3);
283
+
284
+ AddSkyboxButton("persson", "LancellottiChapel", row4);
285
+ AddSkyboxButton("persson", "PereaBeach1", row4);
286
+ AddSkyboxButton("persson", "PereaBeach2", row4);
287
+ AddSkyboxButton("persson", "redeclipse", row4);
288
+
289
+ AddSkyboxButton("daz", "Greenlands", row5);
290
+ AddSkyboxButton("daz", "Oasis", row5);
291
+ AddSkyboxButton("elyvisions", "arch3", row5);
292
+ AddSkyboxButton("elyvisions", "calm_sea", row5);
293
+
294
+ AddSkyboxButton("elyvisions", "rainbow", row6);
295
+ AddSkyboxButton("elyvisions", "distant_sunset", row6);
296
+ AddSkyboxButton("elyvisions", "heaven", row6);
297
+ AddSkyboxButton("elyvisions", "hot", row6);
298
+
299
+ tab0.add(row0);
300
+ tab0.add(row1);
301
+ tab0.add(row2);
302
+ tab0.add(row3);
303
+ tab0.add(row4);
304
+ tab0.add(row5);
305
+ tab0.add(row6);
306
+
307
+ for (int i=5; --i>=0;)
308
+ {
309
+ //oe.toolboxPanel.Return();
310
+ //tab0.add(new cGridBag());
311
+ }
312
+ }
313
+
314
+ public void ChangeSkybox(String name)
315
+ {
316
+ //cameraView.envyoff = false;
317
+ group.skyboxname = name;
318
+ group.skyboxext = "jpg";
319
+ cameraView.repaint();
320
+ }
321
+
25322 //ObjEditor objEditor;
26323 public void closeUI2()
27324 {
....@@ -59,6 +356,12 @@
59356 this.copy = this.group = group;
60357 //selectees = this.group.selectees;
61358
359
+ if (copy.versions == null)
360
+ {
361
+ copy.versions = new byte[100][];
362
+ copy.versionindex = -1;
363
+ }
364
+
62365 if(ui)
63366 SetupUI(objEditor);
64367 }
....@@ -73,17 +376,29 @@
73376 this.copy = this.group = copy;
74377 //selectees = this.group.selectees;
75378
76
- SetupMenu2(objEditor);
379
+ SetupMenu2(this); //objEditor);
77380 SetupUI2(objEditor);
78381 objEditor.SetupUI(true);
79382 SetupViews(objEditor);
80383
81384 ((cRadio)radioPanel.getComponent(0)).SetCamera(cameraView.renderCamera, true);
385
+
386
+ if (copy.versions == null)
387
+ {
388
+ copy.versions = new byte[100][];
389
+ copy.versionindex = -1;
390
+
391
+ Save(true);
392
+ }
82393 }
83394
84395 void CloneSelection(boolean supports)
85396 {
86
- // Object3D keep = GraphreeD.clipboard;
397
+ if (Globals.REPLACEONMAKE)
398
+ Save();
399
+ boolean keep = Globals.REPLACEONMAKE;
400
+ Globals.REPLACEONMAKE = false;
401
+ // Object3D keep = GrafreeD.clipboard;
87402 //Object3D obj;
88403 for (int i=0; i<group.selection.size(); i++)// Enumeration e = group.selection.elements(); e.hasMoreElements();)
89404 {
....@@ -93,18 +408,19 @@
93408
94409 makeSomething(clone, i==group.selection.size()-1);
95410 }
411
+ Globals.REPLACEONMAKE = keep;
96412 }
97413
98414 void CloneClipboard(boolean supports)
99415 {
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));
416
+ assert(Grafreed.clipboard.parent == null);
417
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
418
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
419
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
420
+ makeSomething(CloneObject(Grafreed.clipboard.get(0), false));
105421 else
106
- makeSomething(CloneObject(GraphreeD.clipboard, false));
107
- GraphreeD.clipboard.get(0).parent = keepparent;
422
+ makeSomething(CloneObject(Grafreed.clipboard, false));
423
+ Grafreed.clipboard.get(0).parent = keepparent;
108424 }
109425
110426 static Object3D CloneObject(Object3D obj, boolean supports)
....@@ -118,7 +434,7 @@
118434 // obj.support = null;
119435 if (!supports)
120436 obj.SaveSupports();
121
- Object3D clone = (Object3D)GraphreeD.clone(obj);
437
+ Object3D clone = (Object3D)Grafreed.clone(obj);
122438 obj.parent = parent;
123439 // obj.support = support;
124440 // clone.support = support; // aout 2013
....@@ -147,30 +463,29 @@
147463
148464 //JTextField nameField;
149465
150
- void SetupMenu2(ObjEditor oe)
466
+ void SetupMenu2(GroupEditor oe)
151467 {
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);
468
+ oe.jTree = new cTree();
469
+
163470 Menu menu;
164471 oe.menuBar.add(menu = new Menu("Edit"));
165472 //editItem = menu.add(new MenuItem("Edit"));
166473 //editItem.addActionListener(this);
167
- duplicateItem = menu.add(new MenuItem("Duplicate"));
474
+
475
+// undoItem = menu.add(new MenuItem("Undo"));
476
+// undoItem.addActionListener(this);
477
+// redoItem = menu.add(new MenuItem("Redo"));
478
+// redoItem.addActionListener(this);
479
+// menu.add("-");
480
+ duplicateItem = oe.jTree.popup.add(new JMenuItem("Duplicate"));
168481 duplicateItem.addActionListener(this);
169
- menu.add("-");
170482 cloneItem = menu.add(new MenuItem("Clone"));
171483 cloneItem.addActionListener(this);
484
+ if (Globals.ADVANCED)
485
+ {
172486 cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
173487 cloneSupportItem.addActionListener(this);
488
+ }
174489 menu.add("-");
175490 cutItem = menu.add(new MenuItem("Cut"));
176491 cutItem.addActionListener(this);
....@@ -178,26 +493,123 @@
178493 copyItem.addActionListener(this);
179494 pasteItem = menu.add(new MenuItem("Paste"));
180495 pasteItem.addActionListener(this);
496
+
497
+ menu.add("-");
498
+ pasteIntoItem = menu.add(new MenuItem("Paste into"));
499
+ pasteIntoItem.addActionListener(this);
181500 pasteLinkItem = menu.add(new MenuItem("Paste link"));
182501 pasteLinkItem.addActionListener(this);
183502 pasteCloneItem = menu.add(new MenuItem("Paste clone"));
184503 pasteCloneItem.addActionListener(this);
185504 // pasteExpandItem = menu.add(new MenuItem("Paste expand"));
186505 // pasteExpandItem.addActionListener(this);
187
- clearItem = menu.add(new MenuItem("Clear"));
188
- clearItem.addActionListener(this);
506
+ menu.add("-");
507
+ deleteItem = menu.add(new MenuItem("Delete"));
508
+ deleteItem.addActionListener(this);
509
+
510
+ if (Globals.ADVANCED)
511
+ {
512
+ // Deletes the cameras...
189513 clearAllItem = menu.add(new MenuItem("Clear All"));
190514 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);
515
+ }
516
+
517
+ menuBar.add(cameraMenu = new Menu("View"));
518
+ //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer"));
519
+ //zBufferItem.addActionListener(this);
520
+ //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens"));
521
+ //normalLensItem.addActionListener(this);
522
+ cameraMenu.add(restoreCameraItem = new MenuItem("Restore Viewpoint"));
523
+ restoreCameraItem.addActionListener(this);
524
+
525
+// cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen"));
526
+// toggleFullScreenItem.addItemListener(this);
527
+// toggleFullScreenItem.setState(CameraPane.FULLSCREEN);
528
+// cameraMenu.add("-");
529
+//
530
+// cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture"));
531
+// toggleTextureItem.addItemListener(this);
532
+// toggleTextureItem.setState(CameraPane.textureon);
533
+//
534
+// cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch"));
535
+// toggleSwitchItem.addItemListener(this);
536
+// toggleSwitchItem.setState(CameraPane.SWITCH);
537
+
538
+ cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Show Handles"));
539
+ toggleHandleItem.addItemListener(this);
540
+ toggleHandleItem.setState(CameraPane.HANDLES);
541
+
542
+ cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode"));
543
+ togglePaintItem.addItemListener(this);
544
+ togglePaintItem.setState(CameraPane.PAINTMODE);
545
+
546
+ if (Globals.ADVANCED)
547
+ {
548
+ cameraMenu.add("-");
549
+ cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live"));
550
+ toggleLiveItem.addItemListener(this);
551
+ toggleLiveItem.setState(Globals.isLIVE());
552
+
553
+ cameraMenu.add(stepItem = new MenuItem("Step"));
554
+ stepItem.addActionListener(this);
555
+ // cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List"));
556
+ // toggleDLItem.addItemListener(this);
557
+ // toggleDLItem.setState(false);
558
+
559
+ cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render"));
560
+ toggleRenderItem.addItemListener(this);
561
+ toggleRenderItem.setState(!CameraPane.frozen);
562
+
563
+ cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug"));
564
+ toggleDebugItem.addItemListener(this);
565
+ toggleDebugItem.setState(Globals.DEBUG);
566
+
567
+ cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum"));
568
+ toggleFrustumItem.addItemListener(this);
569
+ toggleFrustumItem.setState(CameraPane.FRUSTUM);
570
+
571
+ cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact"));
572
+ toggleFootContactItem.addItemListener(this);
573
+ toggleFootContactItem.setState(CameraPane.FOOTCONTACT);
574
+
575
+ cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline"));
576
+ toggleTimelineItem.addItemListener(this);
577
+ }
578
+
579
+// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root"));
580
+// toggleRootItem.addItemListener(this);
581
+// toggleRootItem.setState(false);
582
+// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation"));
583
+// animationItem.addItemListener(this);
584
+// animationItem.setState(CameraPane.ANIMATION);
585
+ cameraMenu.add("-");
586
+ cameraMenu.add(editCameraItem = new MenuItem("Save Viewpoint"));
587
+ editCameraItem.addActionListener(this);
588
+
589
+ if (Globals.ADVANCED)
590
+ {
591
+ oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
592
+ //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
593
+ //cameraMenu.add(switchViewItem = new MenuItem("Reverse View"));
594
+ editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf"));
595
+ oe.cameraMenu.add("-");
596
+ openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy..."));
597
+ openWindowItem.addActionListener(this);
598
+ editLeafItem.addActionListener(this);
599
+ lookAtItem.addActionListener(this);
600
+ //lookFromItem.addActinoListener(this);
601
+ //switchViewItem.addActionListener(this);
602
+ }
603
+
604
+ oe.menuBar.add(menu = new Menu("Setting"));
605
+ if (Globals.ADVANCED)
606
+ {
196607 revertMeshItem = menu.add(new MenuItem("Revert Meshes"));
197608 revertMeshItem.addActionListener(this);
198609 resetreferencesItem = menu.add(new MenuItem("Reset Mesh References"));
199610 resetreferencesItem.addActionListener(this);
200611 menu.add("-");
612
+ }
201613 overwriteGeoItem = menu.add(new MenuItem("Overwrite Geometry"));
202614 overwriteGeoItem.addActionListener(this);
203615 overwriteMatItem = menu.add(new MenuItem("Overwrite Material"));
....@@ -209,72 +621,104 @@
209621 overwriteUVItem = menu.add(new MenuItem("Overwrite UV"));
210622 overwriteUVItem.addActionListener(this);
211623 menu.add("-");
624
+ if (Globals.ADVANCED)
625
+ {
212626 generateMeshItem = menu.add(new MenuItem("Generate Meshes"));
213627 generateMeshItem.addActionListener(this);
214628 poseMeshItem = menu.add(new MenuItem("Set Pose Meshes"));
215629 poseMeshItem.addActionListener(this);
216630 menu.add("-");
631
+ }
217632 resetsupportItem = menu.add(new MenuItem("Reset support"));
218633 resetsupportItem.addActionListener(this);
219634 linkverticesItem = menu.add(new MenuItem("Link to Support"));
220635 linkverticesItem.addActionListener(this);
636
+ relinkverticesItem = menu.add(new MenuItem("Re-link to Support"));
637
+ relinkverticesItem.addActionListener(this);
638
+
639
+ if (Globals.ADVANCED)
640
+ {
221641 setMasterItem = menu.add(new MenuItem("Set Master Mesh"));
222642 setMasterItem.addActionListener(this);
643
+ }
223644
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);
645
+ oe.menuBar.add(menu = new Menu("Group"));
646
+// grabItem = menu.add(new MenuItem("Grab"));
647
+// grabItem.addActionListener(this);
229648 backItem = menu.add(new MenuItem("Back"));
230649 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);
650
+ frontItem = menu.add(new MenuItem("Front"));
651
+ frontItem.addActionListener(this);
652
+// compositeItem = menu.add(new MenuItem("Composite"));
653
+// compositeItem.addActionListener(this);
654
+
655
+ if (Globals.ADVANCED)
656
+ {
657
+ hideItem = menu.add(new MenuItem("Hidden Group"));
658
+ hideItem.addActionListener(this);
659
+ }
660
+ ungroupItem = menu.add(new MenuItem("Ungroup"));
661
+ ungroupItem.addActionListener(this);
662
+
663
+// menu.add("-");
664
+//
665
+// switchItem = menu.add(new MenuItem("Switch node"));
666
+// switchItem.addActionListener(this);
667
+ if (Globals.ADVANCED)
668
+ {
240669 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
241670 switchGeoItem.addActionListener(this);
242671 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
243672 switchTransfoItem.addActionListener(this);
244
- morphItem = menu.add(new MenuItem("Morph"));
673
+ morphItem = menu.add(new MenuItem("Morph Group"));
245674 morphItem.addActionListener(this);
675
+
676
+ menu.add("-");
677
+ physicsItem = menu.add(new MenuItem("Physics"));
678
+ physicsItem.addActionListener(this);
679
+ frameselectorItem = menu.add(new MenuItem("Frame Selector"));
680
+ frameselectorItem.addActionListener(this);
246681 scriptNodeItem = menu.add(new MenuItem("Script Node"));
247682 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);
683
+ }
684
+
685
+ oe.menuBar.add(menu = new Menu("Object"));
686
+// textureItem = menu.add(new MenuItem("Texture"));
687
+// textureItem.addActionListener(this);
688
+ billboardItem = menu.add(new MenuItem("Billboard"));
689
+ billboardItem.addActionListener(this);
253690 csgItem = menu.add(new MenuItem("CSG"));
254691 csgItem.addActionListener(this);
255
- shadowXItem = menu.add(new MenuItem("Shadow X"));
692
+ shadowXItem = menu.add(new MenuItem("Shadow Red"));
256693 shadowXItem.addActionListener(this);
257
- shadowYItem = menu.add(new MenuItem("Shadow Y"));
694
+ shadowYItem = menu.add(new MenuItem("Shadow Green"));
258695 shadowYItem.addActionListener(this);
259
- shadowZItem = menu.add(new MenuItem("Shadow Z"));
696
+ shadowZItem = menu.add(new MenuItem("Shadow Blue"));
260697 shadowZItem.addActionListener(this);
698
+ attributeItem = menu.add(new MenuItem("Attribute"));
699
+ attributeItem.addActionListener(this);
700
+
701
+ if (Globals.ADVANCED)
702
+ {
703
+ menu.add("-");
261704 linkerItem = menu.add(new MenuItem("Linker"));
262705 linkerItem.addActionListener(this);
263706 templateItem = menu.add(new MenuItem("Template"));
264707 templateItem.addActionListener(this);
265
- attributeItem = menu.add(new MenuItem("Attribute"));
266
- attributeItem.addActionListener(this);
267708 pointflowItem = menu.add(new MenuItem("Point Flow"));
268709 pointflowItem.addActionListener(this);
710
+ }
269711 menu.add("-");
270
- transformgeometryItem = menu.add(new MenuItem("Transform Geometry"));
271
- transformgeometryItem.addActionListener(this);
272712 resetTransformItem = menu.add(new MenuItem("Reset Transform"));
273713 resetTransformItem.addActionListener(this);
274714 resetCentroidItem = menu.add(new MenuItem("Reset Centroid"));
275715 resetCentroidItem.addActionListener(this);
276
- ungroupItem = menu.add(new MenuItem("Ungroup"));
277
- ungroupItem.addActionListener(this);
716
+ resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY"));
717
+ resetCentroidXZItem.addActionListener(this);
718
+ transformGeometryItem = menu.add(new MenuItem("Transform Geometry"));
719
+ transformGeometryItem.addActionListener(this);
720
+ transformChildrenItem = menu.add(new MenuItem("Transform Children"));
721
+ transformChildrenItem.addActionListener(this);
278722
279723 oe.menuBar.add(menu = new Menu("Geometry"));
280724 genUVItem = menu.add(new MenuItem("Generate UV"));
....@@ -283,6 +727,13 @@
283727 genNormalsORGANItem.addActionListener(this);
284728 genNormalsCADItem = menu.add(new MenuItem("CAD Normals"));
285729 genNormalsCADItem.addActionListener(this);
730
+ genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals"));
731
+ genNormalsMESHItem.addActionListener(this);
732
+ if (Globals.ADVANCED)
733
+ {
734
+ genNormalsMINEItem = menu.add(new MenuItem("Stitch Normals"));
735
+ genNormalsMINEItem.addActionListener(this);
736
+ }
286737 stripifyItem = menu.add(new MenuItem("Stripify"));
287738 stripifyItem.addActionListener(this);
288739 unstripifyItem = menu.add(new MenuItem("Unstripify"));
....@@ -292,8 +743,6 @@
292743 untrimItem = menu.add(new MenuItem("Untrim"));
293744 untrimItem.addActionListener(this);
294745 menu.add("-");
295
- clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
296
- clearMaterialsItem.addActionListener(this);
297746 clearColorsItem = menu.add(new MenuItem("Clear AO"));
298747 clearColorsItem.addActionListener(this);
299748 reverseNormalsItem = menu.add(new MenuItem("Reverse Normals"));
....@@ -306,19 +755,34 @@
306755 reduce34MeshItem.addActionListener(this);
307756 increaseMeshItem = menu.add(new MenuItem("Increase mesh"));
308757 increaseMeshItem.addActionListener(this);
309
- smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
310
- smoothMeshItem.addActionListener(this);
311758 clipMeshItem = menu.add(new MenuItem("Clip mesh"));
312759 clipMeshItem.addActionListener(this);
760
+
761
+ if (Globals.ADVANCED)
762
+ {
763
+ smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
764
+ smoothMeshItem.addActionListener(this);
765
+ }
766
+
767
+ oe.menuBar.add(menu = new Menu("Attributes"));
768
+ clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
769
+ clearMaterialsItem.addActionListener(this);
770
+ resetAllItem = menu.add(new MenuItem("Reset All"));
771
+ resetAllItem.addActionListener(this);
772
+ stepAllItem = menu.add(new MenuItem("Step All"));
773
+ stepAllItem.addActionListener(this);
313774 menu.add("-");
314775 liveleavesItem = menu.add(new MenuItem("Live Leaves"));
315776 liveleavesItem.addActionListener(this);
316777 unliveleavesItem = menu.add(new MenuItem("Unlive Leaves"));
317778 unliveleavesItem.addActionListener(this);
779
+ if (Globals.ADVANCED)
780
+ {
318781 supportleavesItem = menu.add(new MenuItem("Support Leaves"));
319782 supportleavesItem.addActionListener(this);
320783 unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves"));
321784 unsupportleavesItem.addActionListener(this);
785
+ }
322786 hideleavesItem = menu.add(new MenuItem("Hide Leaves"));
323787 hideleavesItem.addActionListener(this);
324788 showleavesItem = menu.add(new MenuItem("Show Leaves"));
....@@ -327,32 +791,31 @@
327791 markleavesItem.addActionListener(this);
328792 unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves"));
329793 unmarkleavesItem.addActionListener(this);
794
+ rewindleavesItem = menu.add(new MenuItem("Rewind Leaves"));
795
+ rewindleavesItem.addActionListener(this);
796
+ unrewindleavesItem = menu.add(new MenuItem("Unrewind Leaves"));
797
+ unrewindleavesItem.addActionListener(this);
798
+ randomleavesItem = menu.add(new MenuItem("Random Leaves"));
799
+ randomleavesItem.addActionListener(this);
800
+ unrandomleavesItem = menu.add(new MenuItem("Unrandom Leaves"));
801
+ unrandomleavesItem.addActionListener(this);
330802 menu.add("-");
331803 flipVItem = menu.add(new MenuItem("Flip V"));
332804 flipVItem.addActionListener(this);
333805 unflipVItem = menu.add(new MenuItem("Unflip V"));
334806 unflipVItem.addActionListener(this);
335
- lowTexturesItem = menu.add(new MenuItem("Low Texture"));
807
+ lowTexturesItem = menu.add(new MenuItem("Low Texture (256)"));
336808 lowTexturesItem.addActionListener(this);
337
- normalTexturesItem = menu.add(new MenuItem("Normal Texture"));
809
+ normalTexturesItem = menu.add(new MenuItem("Normal Texture (512)"));
338810 normalTexturesItem.addActionListener(this);
339
- highTexturesItem = menu.add(new MenuItem("High Texture"));
811
+ highTexturesItem = menu.add(new MenuItem("High Texture (1024)"));
340812 highTexturesItem.addActionListener(this);
341
- veryhighTexturesItem = menu.add(new MenuItem("Very high Texture"));
813
+ veryhighTexturesItem = menu.add(new MenuItem("Very high Texture (2048)"));
342814 veryhighTexturesItem.addActionListener(this);
343
- maxTexturesItem = menu.add(new MenuItem("Max Texture"));
815
+ maxTexturesItem = menu.add(new MenuItem("Max Texture (4096)"));
344816 maxTexturesItem.addActionListener(this);
345
- panoTexturesItem = menu.add(new MenuItem("Panoramic Texture"));
817
+ panoTexturesItem = menu.add(new MenuItem("Panoramic Texture (8192)"));
346818 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);
356819
357820 oe.menuBar.add(menu = new Menu("Selection"));
358821 attachPigmentItem = menu.add(new MenuItem("Attach Pigment..."));
....@@ -361,23 +824,56 @@
361824 attachBumpItem.addActionListener(this);
362825 pigmentBumpItem = menu.add(new MenuItem("Pigment -> Bump"));
363826 pigmentBumpItem.addActionListener(this);
827
+ //embedTexturesItem
364828 detachPigmentItem = menu.add(new MenuItem("Detach Pigment"));
365829 detachPigmentItem.addActionListener(this);
366830 detachBumpItem = menu.add(new MenuItem("Detach Bump"));
367831 detachBumpItem.addActionListener(this);
832
+ embedTexturesItem = menu.add(new MenuItem("Embed Textures"));
833
+ embedTexturesItem.addActionListener(this);
834
+ deEmbedTexturesItem = menu.add(new MenuItem("De-embed Textures"));
835
+ deEmbedTexturesItem.addActionListener(this);
368836 menu.add("-");
369837 sortbysizeItem = menu.add(new MenuItem("Sort by size"));
370838 sortbysizeItem.addActionListener(this);
371839 sortbynameItem = menu.add(new MenuItem("Sort by name"));
372840 sortbynameItem.addActionListener(this);
841
+ menu.add("-");
842
+ shareGeometriesItem = menu.add(new MenuItem("Share Geometries"));
843
+ shareGeometriesItem.addActionListener(this);
844
+ mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries"));
845
+ mergeGeometriesItem.addActionListener(this);
846
+ if (Globals.ADVANCED)
847
+ {
848
+ // Pretty much the same as duplicate and clone.
849
+ extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
850
+ extractGeometriesItem.addActionListener(this);
851
+ cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry"));
852
+ cloneGeometriesItem.addActionListener(this);
853
+ }
854
+
373855 oe.menuBar.add(menu = new Menu("Insert"));
374856 buildCreateMenu(menu);
375
- oe.menuBar.add(menu = new Menu("Tools"));
857
+
858
+ oe.menuBar.add(menu = new Menu("Tools"));
376859 buildToolsMenu(menu);
377860 }
378861
862
+
379863 void SetupUI2(ObjEditor oe)
380864 {
865
+ // June 2019
866
+ if (oe == null)
867
+ {
868
+ //super.SetupUI2(this);
869
+ //return;
870
+ }
871
+
872
+ if (copy != group)
873
+ {
874
+ //super.SetupUI2(this);
875
+ }
876
+
381877 //new Exception().printStackTrace();
382878
383879 oe.radioPanel = new JPanel(new GridBagLayout());
....@@ -406,150 +902,239 @@
406902 oe.radioPanel.add(dummyButton);
407903 oe.buttonGroup.add(dummyButton);
408904 */
409
- aConstraints.gridy += 1;
410
- oe.aConstraints.gridwidth = 1;
411
- oe.aConstraints.gridx = 0;
905
+ cGridBag copyOptionsPanel = new cGridBag();
906
+
907
+ copyOptionsPanel.preferredHeight = 2;
412908
413
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", CameraPane.isLIVE()), oe.aConstraints);
909
+ //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
910
+
911
+ //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
912
+ //minButton.setToolTipText("Minimize window");
913
+ //minButton.addActionListener(this);
914
+
915
+ if (Globals.ADVANCED)
916
+ {
917
+ oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
918
+ maxButton.setToolTipText("Maximize window");
919
+ maxButton.addActionListener(this);
920
+ }
921
+
922
+ oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
923
+ fullButton.setToolTipText("Full-screen window");
924
+ fullButton.addActionListener(this);
925
+
926
+ oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
927
+ screenfitButton.setToolTipText("Screen fit");
928
+ screenfitButton.addActionListener(this);
929
+
930
+ oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
931
+ restoreCameraButton.setToolTipText("Restore viewpoint");
932
+ restoreCameraButton.addActionListener(this);
933
+
934
+ copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
935
+ saveButton.setToolTipText("New version");
936
+ saveButton.addActionListener(this);
937
+
938
+ copyOptionsPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
939
+ undoButton.setToolTipText("Previous version");
940
+ undoButton.addActionListener(this);
941
+ undoButton.setEnabled(false);
942
+
943
+ cGridBag updown = new cGridBag().setVertical(true);
944
+ updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
945
+ restoreButton.setToolTipText("Restore current");
946
+ restoreButton.addActionListener(this);
947
+ restoreButton.setEnabled(false);
948
+
949
+ updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
950
+ replaceButton.setToolTipText("Replace current");
951
+ replaceButton.addActionListener(this);
952
+ replaceButton.setEnabled(false);
953
+
954
+ copyOptionsPanel.add(updown);
955
+
956
+ copyOptionsPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
957
+ redoButton.setToolTipText("Next version");
958
+ redoButton.addActionListener(this);
959
+ redoButton.setEnabled(false);
960
+
961
+ oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints);
962
+ liveCB.setToolTipText("Enable animation");
414963 liveCB.addItemListener(this);
415964
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);
965
+ oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
966
+ oneStepButton.setToolTipText("Animate one step forward");
967
+ oneStepButton.addActionListener(this);
968
+
969
+ oe.toolbarPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints);
970
+ fastCB.setToolTipText("Fast mode");
434971 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);
972
+
973
+ //oe.toolboxPanel.Return();
974
+
975
+// copyOptionsPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints);
976
+// trackCB.setToolTipText("Enable tracking");
977
+// trackCB.addItemListener(this);
441978
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;
482979 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
483980 // 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;
488981
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);
982
+ if (Globals.ADVANCED)
983
+ {
984
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
985
+ snapobjectButton.addActionListener(this);
986
+ snapobjectButton.setToolTipText("Snap Object");
987
+
988
+ oe.toolbarPanel.add(fourButton = GetButton("icons/controls-horizontal.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
504989 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);
990
+ fourButton.setToolTipText("Show control panel only");
991
+ }
992
+
993
+ //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
994
+
995
+ oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
996
+ twoButton.setToolTipText("Show 3D view only");
997
+ twoButton.addActionListener(this);
998
+ this.fullscreenLayout = twoButton;
999
+
1000
+ oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1001
+ threeButton.setToolTipText("Show controls and 3D view");
5081002 threeButton.addActionListener(this);
509
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
510
- sevenButton.addActionListener(this);
1003
+ oe.toolbarPanel.add(sixButton = GetButton("icons/viewcontrols.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1004
+ sixButton.setToolTipText("Show 3D view and controls");
1005
+ sixButton.addActionListener(this);
1006
+// oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1007
+// sevenButton.setToolTipText("3-column layout");
1008
+// sevenButton.addActionListener(this);
5111009 //
5121010
513
- oe.toolbarPanel.add(rootButton = new cButton(" o o o E ")); //, oe.aConstraints);
1011
+ oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1012
+ rootButton.setToolTipText("Open selection in new tab");
5141013 rootButton.addActionListener(this);
515
- oe.aConstraints.gridx += 1;
516
- oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
1014
+
1015
+ oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1016
+ closeButton.setToolTipText("Close tab");
5171017 closeButton.addActionListener(this);
5181018 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
5191019 //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;
5281020
529
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
1021
+ cGridBag row1 = new cGridBag();
1022
+
1023
+ // INSERT
1024
+ row1.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1025
+ gridButton.setToolTipText("Create grid");
1026
+ gridButton.addActionListener(this);
1027
+
1028
+ row1.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1029
+ boxButton.setToolTipText("Create box");
1030
+ boxButton.addActionListener(this);
1031
+
1032
+ row1.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1033
+ sphereButton.setToolTipText("Create sphere");
1034
+ sphereButton.addActionListener(this);
1035
+
1036
+ row1.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1037
+ coneButton.setToolTipText("Create cone");
1038
+ coneButton.addActionListener(this);
1039
+
1040
+ row1.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1041
+ torusButton.setToolTipText("Create torus");
1042
+ torusButton.addActionListener(this);
1043
+
1044
+ row1.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1045
+ superButton.setToolTipText("Create superellipsoid");
1046
+ superButton.addActionListener(this);
1047
+
1048
+ if (Globals.ADVANCED)
1049
+ {
1050
+ oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1051
+ kleinButton.setToolTipText("Create Klein bottle");
1052
+ kleinButton.addActionListener(this);
1053
+ }
1054
+
1055
+ row1.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1056
+ particlesButton.setToolTipText("Create particle system");
1057
+ particlesButton.addActionListener(this);
1058
+
1059
+ oe.toolboxPanel.add(row1);
1060
+
1061
+ cGridBag row2 = new cGridBag();
1062
+
1063
+ row2.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1064
+ groupButton.setToolTipText("Create group");
1065
+ groupButton.addActionListener(this);
1066
+
1067
+ row2.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1068
+ compositeButton.setToolTipText("Create composite");
1069
+ compositeButton.addActionListener(this);
1070
+
1071
+ row2.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1072
+ switchButton.setToolTipText("Create item switcher");
1073
+ switchButton.addActionListener(this);
1074
+
1075
+ row2.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1076
+ loopButton.setToolTipText("Create loop");
1077
+ loopButton.addActionListener(this);
1078
+
1079
+ row2.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1080
+ textureButton.setToolTipText("Create texture");
1081
+ textureButton.addActionListener(this);
1082
+
1083
+ row2.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1084
+ overlayButton.setToolTipText("Create overlay");
1085
+ overlayButton.addActionListener(this);
1086
+
1087
+ row2.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1088
+ lightButton.setToolTipText("Create light");
1089
+ lightButton.addActionListener(this);
1090
+
1091
+ oe.toolboxPanel.add(row2);
1092
+
1093
+ // ENVYMAPS
1094
+ cGridBag skyboxpane = new cGridBag();
1095
+ skyboxpane.preferredHeight = 100;
1096
+
1097
+ oe.toolboxPanel.add(skyboxpane);
1098
+
1099
+ JTabbedPane skyboxpanel = new JTabbedPane();
1100
+ skyboxpane.add(skyboxpanel);
1101
+
1102
+ AddSkyboxTab0(skyboxpanel);
1103
+ AddSkyboxTab1(skyboxpanel);
1104
+ AddSkyboxTab2(skyboxpanel);
1105
+ AddSkyboxTab3(skyboxpanel);
1106
+
1107
+ // EDIT panel
1108
+ editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1109
+ editButton.setToolTipText("Pin selection controls");
1110
+ editButton.addActionListener(this);
1111
+
1112
+ editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1113
+ uneditButton.setToolTipText("Remove selection controls");
5301114 uneditButton.addActionListener(this);
5311115
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);
1116
+ editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
1117
+ allParamsButton.setToolTipText("Show all controle");
5441118 allParamsButton.addActionListener(this);
5451119
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);
1120
+ editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1121
+ clearPanelButton.setToolTipText("Clear edit panel");
1122
+ clearPanelButton.addActionListener(this);
1123
+
1124
+ editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1125
+ unselectButton.setToolTipText("Unselect");
5511126 unselectButton.addActionListener(this);
5521127
1128
+ editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1129
+ flashSelectionButton.setToolTipText("Highlight selection");
1130
+ flashSelectionButton.addActionListener(this);
1131
+
1132
+ editCommandsPanel.preferredHeight = 1;
1133
+
1134
+ SetPinStates(false);
1135
+// oe.treePanel.add(commandsPanel);
1136
+// oe.treePanel.Return();
1137
+
5531138 // oe.aConstraints.gridx += 1;
5541139 // oe.aConstraints.weighty = 0;
5551140 // oe.aConstraints.gridwidth = 1;
....@@ -561,47 +1146,32 @@
5611146 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
5621147 // gcButton.addActionListener(this);
5631148
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;
1149
+ cGridBag jSPPanel = new cGridBag();
1150
+
1151
+ JScrollPane jSP;
5751152 //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);
1153
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints);
5771154 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;
5971155
1156
+ oe.treePanel.add(jSPPanel);
1157
+ oe.treePanel.Return();
1158
+
1159
+ oe.treePanel.add(copyOptionsPanel);
1160
+ oe.treePanel.Return();
1161
+ cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0);
1162
+ versionSlider = (cNumberSlider)sliderPane.getComponent(1);
1163
+ sliderPane.preferredHeight = 1;
1164
+
1165
+// mainPanel.setDividerLocation(0.1); //1.0);
1166
+ mainPanel.setResizeWeight(0.4);
1167
+
5981168 //jList.addListSelectionListener(this);
5991169 oe.jTree.addTreeSelectionListener(this);
6001170 //jTree.setRootVisible(false);
6011171 //jTree.setEditable(true);
6021172 oe.jTree.setDragEnabled(true);
6031173 //jTree.setPreferredSize(new Dimension(10,10));
604
- jSP.setPreferredSize(new Dimension(100,200));
1174
+ //jSP.setPreferredSize(new Dimension(100,200));
6051175
6061176 oe.jTree.setCellRenderer(new cTreeModel.Renderer());
6071177
....@@ -613,23 +1183,160 @@
6131183 dgr.addDragGestureListener(this);
6141184 }catch(Exception e) {}
6151185 */
616
- radio.layout = sevenButton;
1186
+ radio.layout = sixButton; // sevenButton;
6171187 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
6181188 }
1189
+
1190
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
1191
+ {
1192
+ panel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
1193
+ colorCB.setToolTipText("Copy color when dropped");
1194
+ colorCB.addItemListener(this);
1195
+
1196
+ panel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
1197
+ materialCB.setToolTipText("Copy material when dropped");
1198
+ materialCB.addItemListener(this);
1199
+
1200
+ panel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
1201
+ textureCB.setToolTipText("Copy texture when dropped");
1202
+ textureCB.addItemListener(this);
1203
+
1204
+ panel.Return();
1205
+
1206
+ panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
1207
+ boxCB.setToolTipText("Display bounding boxes");
1208
+ boxCB.addItemListener(this);
1209
+
1210
+ panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
1211
+ zoomBoxCB.setToolTipText("Display only for wheel");
1212
+ zoomBoxCB.addItemListener(this);
1213
+
1214
+ if (true) // Globals.ADVANCED)
1215
+ {
1216
+// panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
1217
+// supportCB.setToolTipText("Enable rigging");
1218
+// supportCB.addItemListener(this);
1219
+
1220
+ panel.add(freezeCB = new cCheckBox("Freeze", Globals.FREEZEONMOVE)); //, constraints);
1221
+ freezeCB.setToolTipText("Fast moving camera");
1222
+ freezeCB.addItemListener(this);
1223
+
1224
+ // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
1225
+ // localCB.addItemListener(this);
1226
+
1227
+ panel.Return();
1228
+
1229
+ panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
1230
+ crowdCB.setToolTipText("Used for crowds");
1231
+ crowdCB.addItemListener(this);
1232
+
1233
+ panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
1234
+ smoothCB.setToolTipText("Snapping delay");
1235
+ smoothCB.addItemListener(this);
1236
+
1237
+ panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
1238
+ slowCB.setToolTipText("Smooth interpolation");
1239
+ slowCB.addItemListener(this);
1240
+
1241
+// constraints.gridy += 1;
1242
+// panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
1243
+// speakerMocapCB.addItemListener(this);
1244
+
1245
+ panel.Return();
1246
+
1247
+ if (false)
1248
+ {
1249
+ // handled in scripts
1250
+ //constraints.gridy += 1;
1251
+ panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints);
1252
+ speakerCameraCB.addItemListener(this);
1253
+
1254
+ //constraints.gridy += 1;
1255
+ panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints);
1256
+ speakerFocusCB.addItemListener(this);
1257
+
1258
+ //constraints.gridy += 1;
1259
+ panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
1260
+ smoothfocusCB.addItemListener(this);
1261
+ panel.Return();
1262
+ }
1263
+
1264
+//constraints.gridx += 1;
1265
+//panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
1266
+// debugCB.addItemListener(this);
1267
+
1268
+ panel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
1269
+ trackCB.setToolTipText("Enable tracking target");
1270
+ trackCB.addItemListener(this);
1271
+
1272
+ panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
1273
+ oeilCB.setToolTipText("Move camera when tracking");
1274
+ oeilCB.addItemListener(this);
1275
+
1276
+ panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints);
1277
+ shadowCB.setToolTipText("When live compute shadows");
1278
+ shadowCB.addItemListener(this);
1279
+
1280
+ panel.Return();
1281
+ panel.add(toggleTextureCB = new cCheckBox("Textures", CameraPane.textureon)); //, constraints);
1282
+ toggleTextureCB.setToolTipText("Load textures");
1283
+ toggleTextureCB.addItemListener(this);
1284
+
1285
+ panel.add(toggleSwitchCB = new cCheckBox("Switch", CameraPane.SWITCH)); //, constraints);
1286
+ toggleSwitchCB.setToolTipText("Choose a single item");
1287
+ toggleSwitchCB.addItemListener(this);
1288
+
1289
+ panel.add(autokeepCB = new cCheckBox("Auto-replace", Globals.REPLACEONMAKE)); //, constraints);
1290
+ autokeepCB.setToolTipText("On structure change");
1291
+ autokeepCB.addItemListener(this);
1292
+
1293
+ panel.Return();
1294
+ if (Globals.ADVANCED)
1295
+ {
1296
+ panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
1297
+ lookAtCB.setToolTipText("Look-at target");
1298
+ lookAtCB.addItemListener(this);
1299
+ }
1300
+
1301
+ }
1302
+
1303
+ cGridBag fill = new cGridBag();
1304
+ fill.preferredHeight = 200;
1305
+ cGridBag fill2 = new cGridBag();
1306
+ fill2.preferredHeight = 200;
1307
+ cGridBag fill3 = new cGridBag();
1308
+ fill3.preferredHeight = 200;
1309
+
1310
+ panel.add(fill);
1311
+ panel.add(fill2);
1312
+ panel.add(fill3);
1313
+
1314
+ }
6191315
6201316 void EditObject(Object3D obj)
6211317 {
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();
1318
+ cRadio radioButton = new cRadio(obj.name);
1319
+
1320
+ // June 2019. Patch to avoid bug with transparency.
1321
+ radioButton.hadMaterial = obj.material != null;
1322
+ if (!radioButton.hadMaterial)
1323
+ {
1324
+ obj.material = new cMaterial();
1325
+ }
1326
+
1327
+ radioButton.SetObject(obj);
1328
+ radioButton.layout = sixButton; // sevenButton;
1329
+ radioButton.SetCamera(cameraView.renderCamera, false);
1330
+ radioButton.addActionListener(this);
1331
+ radioPanel.add(radioButton);
1332
+ buttonGroup.add(radioButton);
1333
+ radioButton.doClick();
6301334 }
1335
+
6311336 void SetupViews(ObjEditor oe)
6321337 {
1338
+ theFrame = this;
1339
+
6331340 oe.SetupViews();
6341341
6351342 System.out.println("SetupViews");
....@@ -638,22 +1345,28 @@
6381345 /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this);
6391346 }
6401347
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;
1348
+ cToggleButton liveCB;
1349
+ cCheckBox supportCB;
1350
+ cCheckBox localCB;
1351
+ cCheckBox crowdCB;
1352
+ cCheckBox smoothCB;
1353
+ cToggleButton fastCB;
1354
+ cCheckBox slowCB;
1355
+ cCheckBox boxCB;
1356
+ cCheckBox zoomBoxCB;
1357
+ cCheckBox freezeCB;
1358
+ //cToggleButton trackCB;
1359
+ cCheckBox trackCB;
1360
+ cCheckBox smoothfocusCB;
6511361 // JCheckBox speakerMocapCB;
652
- JCheckBox speakerCameraCB;
653
- JCheckBox speakerFocusCB;
654
- JCheckBox debugCB;
655
- JCheckBox oeilCB;
656
- JCheckBox lookAtCB;
1362
+ cCheckBox speakerCameraCB;
1363
+ cCheckBox speakerFocusCB;
1364
+ cCheckBox debugCB;
1365
+
1366
+ cCheckBox oeilCB;
1367
+ cCheckBox shadowCB;
1368
+ cCheckBox autokeepCB;
1369
+ cCheckBox lookAtCB;
6571370
6581371 // static int COLOR = 1;
6591372 // static int MATERIAL = 2;
....@@ -661,9 +1374,9 @@
6611374
6621375 int dropAttributes = Object3D.COLOR | Object3D.MATERIAL;
6631376
664
- JCheckBox colorCB;
665
- JCheckBox materialCB;
666
- JCheckBox textureCB;
1377
+ cCheckBox colorCB;
1378
+ cCheckBox materialCB;
1379
+ cCheckBox textureCB;
6671380
6681381 public void itemStateChanged(ItemEvent e)
6691382 {
....@@ -688,10 +1401,10 @@
6881401 dropAttributes |= Object3D.TEXTURE;
6891402 else
6901403 dropAttributes &= ~Object3D.TEXTURE;
691
- }
692
- else if(e.getSource() == liveCB)
1404
+ } else if(e.getSource() == liveCB)
6931405 {
6941406 cameraView.ToggleLive();
1407
+ refreshContents(false);
6951408 }
6961409 else if(e.getSource() == supportCB)
6971410 {
....@@ -727,6 +1440,10 @@
7271440 cameraView.repaint();
7281441 // refreshContents();
7291442 }
1443
+ else if(e.getSource() == zoomBoxCB)
1444
+ {
1445
+ cameraView.ToggleZoomBoxMode();
1446
+ }
7301447 else if(e.getSource() == smoothfocusCB)
7311448 {
7321449 cameraView.ToggleSmoothFocus();
....@@ -752,6 +1469,18 @@
7521469 {
7531470 cameraView.ToggleOeil();
7541471 }
1472
+ else if(e.getSource() == shadowCB)
1473
+ {
1474
+ Globals.COMPUTESHADOWWHENLIVE ^= true;
1475
+ }
1476
+ else if(e.getSource() == freezeCB)
1477
+ {
1478
+ Globals.FREEZEONMOVE ^= true;
1479
+ }
1480
+ else if(e.getSource() == autokeepCB)
1481
+ {
1482
+ Globals.REPLACEONMAKE ^= true;
1483
+ }
7551484 else if(e.getSource() == lookAtCB)
7561485 {
7571486 cameraView.ToggleLookAt();
....@@ -768,7 +1497,8 @@
7681497
7691498 /**/
7701499 //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this);
771
- TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1500
+ //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1501
+ TreePath path = objEditor.jTree.getSelectionPath();
7721502 if ((path == null) || (path.getPathCount() <= 1)) {
7731503 // We can't move the root node or an empty selection
7741504 return;
....@@ -831,8 +1561,6 @@
8311561 }
8321562 }
8331563
834
- String string = (String) object;
835
-
8361564 System.out.println("Transfer = " + object + "; drop : " + target);
8371565 // if( object instanceof java.io.File[])
8381566 // {
....@@ -840,7 +1568,11 @@
8401568 // objEditor.DropFile((java.io.File[]) object, true);
8411569 // return;
8421570 // }
843
- if (string.charAt(0) == '/')
1571
+
1572
+ String string = object.toString();
1573
+
1574
+ // File path for Mac and Windows
1575
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
8441576 {
8451577 // file(s)
8461578 String[] names = string.split("\n");
....@@ -867,7 +1599,7 @@
8671599
8681600 flashIt = false;
8691601 CameraPane pane = (CameraPane) target;
870
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1602
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
8711603 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
8721604
8731605 if (group.selection.size() == 1)
....@@ -883,23 +1615,33 @@
8831615
8841616 assert target == objEditor.jTree;
8851617 TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y);
1618
+ Object3D destinationLeaf;
8861619 try {
887
- Object3D dummy = (Composite) destinationPath.getLastPathComponent();
1620
+ destinationLeaf = (Composite) destinationPath.getLastPathComponent();
8881621 } catch (Exception e) {
8891622 System.out.println("destinationPath : " + destinationPath);
8901623 return;
8911624 }
8921625
893
- if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1626
+ for (int i=group.selection.size(); --i>=0;)
8941627 {
1628
+ Object3D child = (Object3D)group.selection.elementAt(i);
1629
+
1630
+ // Cannot move into itself
1631
+ if (child == destinationLeaf)
1632
+ return;
1633
+ }
1634
+
1635
+// june 2019 if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1636
+// {
8951637 loadClipboard(true);
8961638 objEditor.jTree.setSelectionPath(destinationPath);
897
- pasteInto(false);
898
- } else {
899
- loadClipboard(false);
900
- objEditor.jTree.setSelectionPath(destinationPath);
901
- pasteInto(false); // true); // ???
902
- }
1639
+ pasteInto(false, false);
1640
+// } else {
1641
+// loadClipboard(false);
1642
+// objEditor.jTree.setSelectionPath(destinationPath);
1643
+// pasteInto(false, false); // true); // ???
1644
+// }
9031645 }
9041646 public void dropActionChanged(DropTargetDragEvent dtde)
9051647 // Called if the user has modified the current drop gesture
....@@ -1002,90 +1744,109 @@
10021744
10031745 void buildCreateMenu(Menu menu)
10041746 {
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);
1747
+ //heightFieldItem = menu.add(new MenuItem("Height Field"));
1748
+ //heightFieldItem.addActionListener(this);
1749
+// gridItem = menu.add(new MenuItem("Grid"));
1750
+// gridItem.addActionListener(this);
1751
+// rectoidItem = menu.add(new MenuItem("Box"));
1752
+// rectoidItem.addActionListener(this);
1753
+// ellipsoidItem = menu.add(new MenuItem("Sphere"));
1754
+// ellipsoidItem.addActionListener(this);
1755
+// coneItem = menu.add(new MenuItem("Cone"));
1756
+// coneItem.addActionListener(this);
1757
+// torusItem = menu.add(new MenuItem("Torus"));
1758
+// torusItem.addActionListener(this);
1759
+// superItem = menu.add(new MenuItem("Superellipsoid"));
1760
+// superItem.addActionListener(this);
1761
+
1762
+ cameraItem = menu.add(new MenuItem("Camera"));
1763
+ cameraItem.addActionListener(this);
1764
+
1765
+ if (!Globals.ADVANCED)
1766
+ {
1767
+ kleinItem = menu.add(new MenuItem("Klein Bottle"));
1768
+ kleinItem.addActionListener(this);
1769
+ }
1770
+
1771
+// particleItem = menu.add(new MenuItem("Particle system"));
1772
+// particleItem.addActionListener(this);
1773
+ if (Globals.ADVANCED)
1774
+ {
10191775 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10201776 ragdollItem.addActionListener(this);
10211777 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10221778 ragdoll2Item.addActionListener(this);
1779
+ }
10231780 menu.add("-");
1024
- meshItem = menu.add(new MenuItem("Mesh"));
1781
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10251782 meshItem.addActionListener(this);
10261783 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10271784 // meshGroupItem.addActionListener(this);
1785
+ if (Globals.ADVANCED)
1786
+ {
10281787 springItem = menu.add(new MenuItem("Spring"));
10291788 springItem.addActionListener(this);
10301789 flagItem = menu.add(new MenuItem("Flag"));
10311790 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);
10361791 blobItem = menu.add(new MenuItem("Blob"));
10371792 blobItem.addActionListener(this);
10381793 latheItem = menu.add(new MenuItem("Lathe"));
10391794 latheItem.addActionListener(this);
1040
- lightItem = menu.add(new MenuItem("Light"));
1041
- lightItem.addActionListener(this);
1795
+ }
1796
+ bezierItem = menu.add(new MenuItem("Bezier Patch"));
1797
+ bezierItem.addActionListener(this);
1798
+// overlayItem = menu.add(new MenuItem("Overlay"));
1799
+// overlayItem.addActionListener(this);
1800
+// lightItem = menu.add(new MenuItem("Light"));
1801
+// lightItem.addActionListener(this);
10421802 menu.add("-");
10431803 //superLoopItem = menu.add(new MenuItem("Super Loop"));
10441804 //superLoopItem.addActionListener(this);
1045
- loopItem = menu.add(new MenuItem("Loop"));
1046
- loopItem.addActionListener(this);
1805
+// loopItem = menu.add(new MenuItem("Loop"));
1806
+// loopItem.addActionListener(this);
10471807 doubleItem = menu.add(new MenuItem("Fork"));
10481808 doubleItem.addActionListener(this);
1809
+ if (Globals.ADVANCED)
1810
+ {
10491811 tripleItem = menu.add(new MenuItem("Trident"));
10501812 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);
1813
+ }
10601814 }
10611815
10621816 void buildToolsMenu(Menu menu)
10631817 {
10641818 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
10651819 animationItem.addItemListener(this);
1066
- animationItem.setState(CameraPane.ANIMATION);
1820
+ animationItem.setState(Globals.ANIMATION);
1821
+
1822
+ menu.add(archiveItem = new MenuItem("Archive3D..."));
1823
+ archiveItem.addActionListener(this);
10671824
10681825 menu.add("-");
10691826 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
10701827 parseverticesItem.addActionListener(this);
1071
- alignItem = menu.add(new MenuItem("Align"));
1828
+ textureFieldItem = menu.add(new MenuItem("Texture Field"));
1829
+ textureFieldItem.addActionListener(this);
1830
+ alignItem = menu.add(new MenuItem("Align Objects"));
10721831 alignItem.addActionListener(this);
1073
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1074
- mirrorItem.addActionListener(this);
10751832 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
10761833 reduceMorphItem.addActionListener(this);
10771834 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
10781835 reduce34MorphItem.addActionListener(this);
1079
-
1080
- menu.add(computeAOItem = new MenuItem("Compute AO"));
1081
- computeAOItem.addActionListener(this);
10821836 menu.add("-");
1083
-
10841837 menu.add(memoryItem = new MenuItem("Memory Usage"));
10851838 memoryItem.addActionListener(this);
1839
+ menu.add(computeAOItem = new MenuItem("Compute AO"));
1840
+ computeAOItem.addActionListener(this);
1841
+
1842
+ if (Globals.ADVANCED)
1843
+ {
1844
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1845
+ mirrorItem.addActionListener(this);
1846
+ menu.add("-");
10861847 menu.add(analyzeItem = new MenuItem("Analyze"));
10871848 analyzeItem.addActionListener(this);
1088
- menu.add(dumpItem = new MenuItem("Dump"));
1849
+ menu.add(dumpItem = new MenuItem("Print"));
10891850 dumpItem.addActionListener(this);
10901851 // menu.add(pathItem = new MenuItem("From-to path"));
10911852 // pathItem.addActionListener(this);
....@@ -1094,6 +1855,8 @@
10941855 resetParentItem.addActionListener(this);
10951856 repairParentItem = menu.add(new MenuItem("Repair Parent"));
10961857 repairParentItem.addActionListener(this);
1858
+ repairShadowItem = menu.add(new MenuItem("Repair Shadow"));
1859
+ repairShadowItem.addActionListener(this);
10971860 menu.add(invariantsItem = new MenuItem("Invariants"));
10981861 invariantsItem.addActionListener(this);
10991862 menu.add(recompileItem = new MenuItem("Recompile"));
....@@ -1101,6 +1864,7 @@
11011864 menu.add("-");
11021865 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11031866 editScriptItem.addActionListener(this);
1867
+ }
11041868 }
11051869
11061870 void ScreenFit()
....@@ -1223,9 +1987,34 @@
12231987 shadow.material = new cMaterial(obj.material);
12241988 shadow.material.diffuse = 0.0001f;
12251989 shadow.material.specular = 0.0001f;
1990
+ //shadow.projectedVertices[1].x = 300;
12261991
12271992 makeSomething(shadow);
12281993 }
1994
+
1995
+ private void ClearUnpinned()
1996
+ {
1997
+ //for (Object3D obj : listUI)
1998
+ for (int i=listUI.size(); --i>=0;)
1999
+ {
2000
+ Object3D obj = listUI.elementAt(i);
2001
+ if (!obj.pinned)
2002
+ {
2003
+ obj.CloseUI();
2004
+ listUI.remove(i);
2005
+ }
2006
+ }
2007
+ }
2008
+
2009
+ private void EditElement(Object3D elem, boolean newWindow)
2010
+ {
2011
+ // if (!(elem instanceof Composite))
2012
+ // newWindow = false;
2013
+ listUI.add(elem);
2014
+ elem.openEditWindow(this, newWindow); //, false);
2015
+ System.out.println("edit : " + elem);
2016
+ elem.editWindow.refreshContents(true); // ? new
2017
+ }
12292018
12302019 /**
12312020 * applyExample
....@@ -1429,9 +2218,9 @@
14292218
14302219 void Overwrite(int mask)
14312220 {
1432
- if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
2221
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14332222 {
1434
- Object3D content = GraphreeD.clipboard.get(0);
2223
+ Object3D content = Grafreed.clipboard.get(0);
14352224
14362225 if (content instanceof cGroup && ((cGroup)content).transientlink )
14372226 content = ((cGroup)content).get(0);
....@@ -1454,6 +2243,7 @@
14542243 //
14552244 public void actionPerformed(ActionEvent event) // , Object arg)
14562245 {
2246
+ Object source = event.getSource();
14572247 /*
14582248 if (event.getSource() == nameField)
14592249 {
....@@ -1465,11 +2255,11 @@
14652255 }
14662256 else
14672257 */
1468
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
2258
+ if (source == lookAtItem || source == lookFromItem)
14692259 {
14702260 ScreenFit();
14712261 } else
1472
- if (event.getSource() == switchItem)
2262
+ if (source == switchViewItem)
14732263 {
14742264 cVector v1 = new cVector();
14752265 cVector v2 = new cVector();
....@@ -1478,11 +2268,11 @@
14782268 objEditor.cameraView.renderCamera.setAim(v2, v1);
14792269 objEditor.cameraView.repaint();
14802270 } else
1481
- if (event.getSource() == rectoidItem)
2271
+ if (source == rectoidItem || source == boxButton)
14822272 {
14832273 makeSomething(new Box());
14842274 } else
1485
- if (event.getSource() == particleItem)
2275
+ if (source == particleItem || source == particlesButton)
14862276 {
14872277 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
14882278 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1503,9 +2293,9 @@
15032293 applyExample(particleGeom, "SMOKE");
15042294 makeSomething(particleGeom);
15052295 } else
1506
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
2296
+ if (source == ragdollItem || source == ragdoll2Item)
15072297 {
1508
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
2298
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15092299
15102300 ragdoll.toParent = LA.newMatrix();
15112301 ragdoll.fromParent = LA.newMatrix();
....@@ -1521,27 +2311,71 @@
15212311 makeSomething(ragdoll);
15222312 //makeSomething(new VehicleDemo());
15232313 } else
1524
- if (event.getSource() == gridItem)
2314
+ /*
2315
+ */
2316
+ if (source == heightFieldItem)
2317
+ {
2318
+ Object3D obj = new Object3D();
2319
+
2320
+ obj.CreateMaterial();
2321
+ obj.bRep = new BoundaryRep();
2322
+
2323
+ obj.bRep.CreateMesh(new iHeightField()
2324
+ {
2325
+ public double f(double x, double y)
2326
+ {
2327
+ // The Mandelbrot set is represented by coloring
2328
+ // each point (x,y) according to the number of
2329
+ // iterations it takes before the while loop in
2330
+ // this method ends. For points that are actually
2331
+ // in the Mandelbrot set, or very close to it, the
2332
+ // count will reach the maximum value, 80. These
2333
+ // points will be colored purple. All other colors
2334
+ // represent points that are definitely NOT in the set.
2335
+ x -= 600;
2336
+ y -= 500;
2337
+ x /= 200;
2338
+ y /= 200;
2339
+ int count = 0;
2340
+ double zx = x;
2341
+ double zy = y;
2342
+ while (count < 80 && Math.abs(x) < 100 && Math.abs(zy) < 100) {
2343
+ double new_zx = zx*zx - zy*zy + x;
2344
+ zy = 2*zx*zy + y;
2345
+ zx = new_zx;
2346
+ count++;
2347
+ }
2348
+ return count; // Math.sqrt(count);
2349
+ }
2350
+ }, 1000,1000);
2351
+
2352
+ makeSomething(obj);
2353
+ } else
2354
+ if (source == gridItem || source == gridButton)
15252355 {
15262356 makeSomething(new Grid());
15272357 } else
1528
- if (event.getSource() == ellipsoidItem)
2358
+ if (source == ellipsoidItem || source == sphereButton)
15292359 {
15302360 makeSomething(new Sphere());
15312361 } else
1532
- if (event.getSource() == coneItem)
2362
+ if (source == coneItem || source == coneButton)
15332363 {
15342364 makeSomething(new Cone());
15352365 } else
1536
- if (event.getSource() == torusItem)
2366
+ if (source == torusItem || source == torusButton)
15372367 {
15382368 makeSomething(new Torus());
15392369 } else
1540
- if (event.getSource() == superItem)
2370
+ if (source == superItem || source == superButton)
15412371 {
15422372 makeSomething(new Superellipsoid());
15432373 } else
1544
- if (event.getSource() == blobItem)
2374
+ if (source == kleinItem || source == kleinButton)
2375
+ {
2376
+ makeSomething(new Klein());
2377
+ } else
2378
+ if (source == blobItem)
15452379 {
15462380 Blob blob = new Blob();
15472381 BlobComponent comp = new BlobComponent();
....@@ -1549,15 +2383,15 @@
15492383 //blob.retile();
15502384 makeSomething(blob);
15512385 } else
1552
- if (event.getSource() == latheItem)
2386
+ if (source == latheItem)
15532387 {
15542388 makeSomething(new Lathe());
15552389 } else
1556
- if (event.getSource() == bezierItem)
2390
+ if (source == bezierItem)
15572391 {
15582392 makeSomething(new BezierSurface());
15592393 } else
1560
- if (event.getSource() == checkerItem)
2394
+ if (source == overlayItem || source == overlayButton)
15612395 {
15622396 /*
15632397 Object3D obj = new BezierSurface(5,8);
....@@ -1570,9 +2404,9 @@
15702404 LA.matConcat(obj.toParent, cameraView.renderCamera.fromParent, obj.toParent);
15712405 LA.matInvert(obj.toParent, obj.fromParent);
15722406 */
1573
- makeSomething(new CheckerIG());
2407
+ makeSomething(new Checker());
15742408 } else
1575
- if (event.getSource() == meshItem)
2409
+ if (source == meshItem)
15762410 {
15772411 Object3D itemtomake = new Object3D();
15782412 Object3D child;
....@@ -1593,35 +2427,52 @@
15932427 makeSomething(child);
15942428 }
15952429 } else
1596
- if (event.getSource() == springItem)
2430
+ if (source == springItem)
15972431 {
15982432 cSpring s = new cSpring();
15992433 s.setup();
16002434 makeSomething(s);
16012435 } else
1602
- if (event.getSource() == flagItem)
2436
+ if (source == flagItem)
16032437 {
16042438 cSpring s = new cFlag();
16052439 s.setup();
16062440 makeSomething(s);
16072441 } else
1608
- if (event.getSource() == lightItem)
2442
+ if (source == lightItem || source == lightButton)
16092443 {
16102444 makeSomething(new Light());
16112445 } else
1612
- if (event.getSource() == csgItem)
2446
+// if (source == skybox1Button ||
2447
+// source == skybox2Button ||
2448
+// source == skybox3Button ||
2449
+// source == skybox4Button ||
2450
+// source == skybox5Button ||
2451
+// source == skybox6Button ||
2452
+// source == skybox7Button ||
2453
+// source == skybox11Button ||
2454
+// source == skybox12Button ||
2455
+// source == skybox13Button ||
2456
+// source == skybox14Button ||
2457
+// source == skybox15Button ||
2458
+// source == skybox16Button ||
2459
+// source == skybox17Button)
2460
+// {
2461
+// ChangeSkybox(source);
2462
+// } else
2463
+ if (source == csgItem)
16132464 {
16142465 group(new CSG());
16152466 } else
1616
- if (event.getSource() == templateItem)
2467
+ if (source == templateItem)
16172468 {
16182469 group(new cTemplate());
16192470 } else
1620
- if (event.getSource() == attributeItem)
2471
+ if (source == attributeItem)
16212472 {
16222473 makeSomething(new Attribute());
16232474 } else
1624
- if (event.getSource() == pointflowItem)
2475
+ if (source == pointflowItem)
16252476 {
16262477 makeSomething(new PointFlow());
16272478 } else
....@@ -1633,7 +2484,7 @@
16332484 } else
16342485 */
16352486
1636
- if (event.getSource() == superLoopItem)
2487
+ if (source == superLoopItem)
16372488 {
16382489 Composite g = new cGroup();
16392490 for (int i=0; i<15; i++)
....@@ -1655,30 +2506,30 @@
16552506
16562507 group(g);
16572508 } else
1658
- if (event.getSource() == loopItem)
2509
+ if (source == loopItem || source == loopButton)
16592510 {
16602511 Composite csg = new GroupLeaf();
16612512 csg.count = 5;
16622513 group(csg);
1663
- Composite child = new cGroup();
2514
+ Composite child = new cGroup("Branch");
16642515 csg.addChild(child);
16652516 child.addChild(csg);
16662517 } else
1667
- if (event.getSource() == doubleItem)
2518
+ if (source == doubleItem)
16682519 {
1669
- Composite csg = new GroupLeaf();
2520
+ Composite csg = new GroupLeaf("Fork");
16702521 csg.count = 5;
16712522 group(csg);
1672
- Composite child = new cGroup();
2523
+ Composite child = new cGroup("Branch A");
16732524 csg.addChild(child);
16742525 child.addChild(csg);
1675
- child = new cGroup();
2526
+ child = new cGroup("Branch B");
16762527 csg.addChild(child);
16772528 child.addChild(csg);
16782529 } else
1679
- if (event.getSource() == tripleItem)
2530
+ if (source == tripleItem)
16802531 {
1681
- Composite csg = new GroupLeaf();
2532
+ Composite csg = new GroupLeaf("Trident");
16822533 csg.count = 4;
16832534 group(csg);
16842535 Composite child = new cGroup();
....@@ -1691,73 +2542,98 @@
16912542 csg.addChild(child);
16922543 child.addChild(csg);
16932544 } else
1694
-
1695
- if (event.getSource() == importGFDItem)
2545
+ if (source == computeAOItem)
16962546 {
1697
- ImportGFD();
2547
+ Globals.drawMode = CameraPane.OCCLUSION;
2548
+ cameraView.repaint();
16982549 } 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)
2550
+ if (source == recompileItem)
17172551 {
17182552 Recompile();
17192553 refreshContents();
17202554 } else
1721
- if (event.getSource() == editScriptItem)
2555
+ if (source == editScriptItem)
17222556 {
17232557 OpenDialog();
17242558 refreshContents();
17252559 } else
1726
- if (event.getSource() == invariantsItem)
2560
+ if (source == invariantsItem)
17272561 {
17282562 System.out.println("Invariants:");
1729
- GraphreeD.theApplet3D.universe.invariants();
2563
+ Grafreed.grafreeD.universe.invariants();
17302564 } else
1731
- if (event.getSource() == memoryItem)
2565
+ if (source == memoryItem)
17322566 {
17332567 //System.out.println("Invariants:");
17342568 PrintMemory();
17352569 } else
1736
- if (event.getSource() == pathItem)
2570
+ if (source == pathItem)
17372571 {
17382572 PrintPath();
17392573 } else
1740
- if (event.getSource() == analyzeItem)
2574
+ if (source == analyzeItem)
17412575 {
17422576 AnalyzeObject();
17432577 } else
1744
- if (event.getSource() == dumpItem)
2578
+ if (source == dumpItem)
17452579 {
17462580 DumpObject();
17472581 } else
1748
- if (event.getSource() == screenfitButton)
2582
+ if (source == minButton)
17492583 {
1750
- //Reload(lastConverter, lastFilename, true);
2584
+ Minimize();
2585
+ } else
2586
+ if (source == maxButton)
2587
+ {
2588
+ Maximize();
2589
+ } else
2590
+ if (source == fullButton)
2591
+ {
2592
+ ToggleFullScreen();
2593
+ } else
2594
+ if (source == undoButton)
2595
+ {
2596
+ // Go to previous version
2597
+ //if (!Undo())
2598
+ //java.awt.Toolkit.getDefaultToolkit().beep();
2599
+ Undo();
2600
+ } else
2601
+ if (source == restoreButton)
2602
+ {
2603
+ // Restore current version
2604
+ Restore();
2605
+ } else
2606
+ if (source == replaceButton)
2607
+ {
2608
+ // Overwrite current version
2609
+ Replace();
2610
+ } else
2611
+ if (source == redoButton)
2612
+ {
2613
+ // Go to next version
2614
+ Redo();
2615
+ } else
2616
+ if (source == saveButton)
2617
+ {
2618
+ // Save a new version
2619
+ if (!Save(true))
2620
+ java.awt.Toolkit.getDefaultToolkit().beep();
2621
+ } else
2622
+ if (source == oneStepButton)
2623
+ {
2624
+ Globals.ONESTEP = true;
2625
+ cameraView.repaint();
2626
+ } else
2627
+ if (source == screenfitButton)
2628
+ {
17512629 ScreenFit();
17522630 } else
1753
- if (event.getSource() == screenfitpointButton)
2631
+ if (source == screenfitpointButton)
17542632 {
1755
- //Reload(lastConverter, lastFilename, true);
17562633 ScreenFitPoint();
17572634 } else
1758
- if (event.getSource() == snapobjectButton)
2635
+ if (source == snapobjectButton)
17592636 {
1760
- //Reload(lastConverter, lastFilename, true);
17612637 SnapObject();
17622638 } else
17632639 // if (event.getSource() == recompileButton)
....@@ -1766,13 +2642,13 @@
17662642 // Recompile();
17672643 // refreshContents();
17682644 // } else
1769
- if (event.getSource() == gcButton)
2645
+ if (source == gcButton)
17702646 {
17712647 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
17722648 System.gc();
17732649 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
17742650 } else
1775
- if (event.getSource() == editLeafItem)
2651
+ if (source == editLeafItem)
17762652 {
17772653 Object3D obj;
17782654 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1786,65 +2662,78 @@
17862662 }
17872663 refreshContents(true);
17882664 } else
1789
- if (event.getSource() == openWindowItem)
2665
+ if (source == openWindowItem)
17902666 {
17912667 EditSelection(true);
17922668 } else
1793
- if (event.getSource() == cutItem || event.getSource() == clearButton)
2669
+ if (source == cutItem || source == clearButton)
17942670 {
17952671 loadClipboard(true);
17962672 } else
1797
- if (event.getSource() == duplicateItem)
2673
+ if (source == undoItem)
17982674 {
1799
- Object3D keep = GraphreeD.clipboard;
2675
+ Undo();
2676
+ } else
2677
+ if (source == redoItem)
2678
+ {
2679
+ Redo();
2680
+ } else
2681
+ if (source == duplicateItem)
2682
+ {
2683
+ Object3D keep = Grafreed.clipboard;
18002684 loadClipboard(false);
18012685 paste(false);
1802
- GraphreeD.clipboard = keep;
2686
+ Grafreed.clipboard = keep;
18032687 } else
1804
- if (event.getSource() == cloneItem)
2688
+ if (source == cloneItem)
18052689 {
18062690 CloneSelection(false);
18072691 } else
1808
- if (event.getSource() == cloneSupportItem)
2692
+ if (source == cloneSupportItem)
18092693 {
18102694 CloneSelection(true);
18112695 } else
1812
- if (event.getSource() == copyItem)
2696
+ if (source == copyItem)
18132697 {
18142698 loadClipboard(false);
18152699 } else
1816
- if (event.getSource() == pasteItem)
2700
+ if (source == pasteItem)
18172701 {
18182702 paste(false);
18192703 } else
1820
- if (event.getSource() == pasteLinkItem)
2704
+ if (source == pasteIntoItem)
18212705 {
1822
- pasteInto(false);
2706
+ pasteInto(true, false);
18232707 } else
1824
- if (event.getSource() == pasteCloneItem)
2708
+ if (source == pasteLinkItem)
18252709 {
1826
- pasteInto(true);
2710
+ pasteInto(false, false);
18272711 } else
1828
- if (event.getSource() == pasteExpandItem)
2712
+ if (source == pasteCloneItem)
2713
+ {
2714
+ pasteInto(true, true);
2715
+ } else
2716
+ if (source == pasteExpandItem)
18292717 {
18302718 paste(true);
18312719 } else
1832
- if (event.getSource() == synchronizeItem)
2720
+ if (source == synchronizeItem)
18332721 {
18342722 Overwrite(Object3D.TRANSFORM);
18352723 } else
1836
- if (event.getSource() == overwriteNameItem)
2724
+ if (source == overwriteNameItem)
18372725 {
18382726 Overwrite(Object3D.NAME);
18392727 } else
1840
- if (event.getSource() == overwriteUVItem)
2728
+ if (source == overwriteUVItem)
18412729 {
18422730 Overwrite(Object3D.UV);
18432731 } else
1844
- if (event.getSource() == overwriteMatItem)
2732
+ if (source == overwriteMatItem)
18452733 {
2734
+ /* july 2015
18462735 if ((dropAttributes & Object3D.TEXTURE) == 0)
1847
- Overwrite(Object3D.MATERIAL);
2736
+ Overwrite(Object3D.MATERIAL | Object3D.COLOR);
18482737 else
18492738 {
18502739 if ((dropAttributes & Object3D.COLOR) == 0 && (dropAttributes & Object3D.MATERIAL) == 0)
....@@ -1856,13 +2745,16 @@
18562745 Overwrite(Object3D.MATERIAL | Object3D.TEXTURE);
18572746 }
18582747 }
2748
+ */
2749
+
2750
+ Overwrite(dropAttributes);
18592751 }
1860
- if (event.getSource() == overwriteGeoItem)
2752
+ if (source == overwriteGeoItem)
18612753 {
18622754 Overwrite(Object3D.GEOMETRY);
1863
-// if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
2755
+// if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
18642756 // {
1865
-// Object3D content = GraphreeD.clipboard.get(0);
2757
+// Object3D content = GrafreeD.clipboard.get(0);
18662758 //
18672759 // if (content instanceof cGroup && ((cGroup)content).transientlink )
18682760 // content = ((cGroup)content).get(0);
....@@ -1874,7 +2766,7 @@
18742766 // refreshContents();
18752767 // }
18762768 } else
1877
- if (event.getSource() == generateMeshItem)
2769
+ if (source == generateMeshItem)
18782770 {
18792771 //if (group.selection.size() == 1)
18802772 // for (int i=0; i<group.selection.size(); i++)
....@@ -1885,7 +2777,7 @@
18852777 ResetModel();
18862778 refreshContents();
18872779 } else
1888
- if (event.getSource() == extractGeometriesItem)
2780
+ if (source == extractGeometriesItem)
18892781 {
18902782 boolean one = false;
18912783
....@@ -1912,7 +2804,7 @@
19122804 ResetModel();
19132805 refreshContents();
19142806 } else
1915
- if (event.getSource() == cloneGeometriesItem)
2807
+ if (source == cloneGeometriesItem)
19162808 {
19172809 boolean one = false;
19182810
....@@ -1938,32 +2830,37 @@
19382830 ResetModel();
19392831 refreshContents();
19402832 } else
1941
- if (event.getSource() == shareGeometriesItem)
2833
+ if (source == shareGeometriesItem)
19422834 {
19432835 boolean one = false;
19442836
19452837 if (group.selection.size() == 1)
19462838 one = true;
19472839
2840
+ Object3D merge = null;
2841
+
19482842 Object3D content = new cGroup();
19492843
19502844 for (int i=0; i<group.selection.size(); i++)
19512845 {
1952
- Object3D sel = new Merge(group.selection.get(i));
2846
+ merge = new Merge(group.selection.get(i));
19532847
19542848 if (one)
1955
- makeSomething(sel, false);
2849
+ makeSomething(merge, false);
19562850 else
1957
- content.addChild(sel);
2851
+ content.addChild(merge);
19582852 }
19592853
19602854 if (!one)
1961
- makeSomething(content, false);
1962
-
1963
- ResetModel();
1964
- refreshContents();
2855
+ makeSomething(content, true);
2856
+ else
2857
+ {
2858
+ ResetModel();
2859
+ Select(merge.GetTreePath(), true, false); // unselect... false);
2860
+ refreshContents();
2861
+ }
19652862 } else
1966
- if (event.getSource() == mergeGeometriesItem)
2863
+ if (source == mergeGeometriesItem)
19672864 {
19682865 boolean one = false;
19692866
....@@ -1993,11 +2890,11 @@
19932890 ResetModel();
19942891 refreshContents();
19952892 } else
1996
- if (event.getSource() == linkverticesItem)
2893
+ if (source == linkverticesItem)
19972894 {
1998
-// if (group.selection.size() == 1 && GraphreeD.clipboard.size() == 1)
2895
+// if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
19992896 // {
2000
-// Object3D content = GraphreeD.clipboard.get(0);
2897
+// Object3D content = GrafreeD.clipboard.get(0);
20012898 //
20022899 // if (content instanceof cGroup && ((cGroup)content).transientlink )
20032900 // content = ((cGroup)content).get(0);
....@@ -2006,39 +2903,48 @@
20062903 // group.selection.get(0).setMasterThis(content); // should be identity
20072904 // refreshContents();
20082905 // }
2009
- if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
2906
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
20102907 {
2011
- Object3D content = GraphreeD.clipboard.get(0);
2908
+ Object3D content = Grafreed.clipboard.get(0);
20122909
20132910 if (content instanceof cGroup && ((cGroup)content).transientlink )
20142911 content = ((cGroup)content).get(0);
20152912
2016
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
2913
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
20172914 for (int i=0; i<group.selection.size(); i++)
20182915 {
2019
- boolean random = CameraPane.RANDOM;
2020
- CameraPane.RANDOM = false; // parse all random nodes
2916
+ boolean random = CameraPane.SWITCH;
2917
+ CameraPane.SWITCH = false; // parse all random nodes
20212918 group.selection.get(i).linkVerticesThis(content);
20222919 // group.selection.get(i).setMasterThis(content); // should be identity
2023
- CameraPane.RANDOM = random;
2920
+ CameraPane.SWITCH = random;
20242921 }
2025
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
2922
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
20262923 refreshContents();
20272924 }
20282925 } else
2029
- if (event.getSource() == resetsupportItem)
2926
+ if (source == resetsupportItem)
20302927 {
20312928 for (int i=0; i<group.selection.size(); i++)
20322929 {
2033
- boolean random = CameraPane.RANDOM;
2034
- CameraPane.RANDOM = false; // parse all random nodes
2930
+ boolean random = CameraPane.SWITCH;
2931
+ CameraPane.SWITCH = false; // parse all random nodes
20352932 group.selection.get(i).linkVerticesThis(null);
2036
- CameraPane.RANDOM = random;
2933
+ CameraPane.SWITCH = random;
20372934 }
20382935
20392936 refreshContents();
20402937 } else
2041
- if (event.getSource() == resetreferencesItem)
2938
+ if (source == relinkverticesItem)
2939
+ {
2940
+ boolean random = CameraPane.SWITCH;
2941
+ CameraPane.SWITCH = false; // parse all random nodes
2942
+ group.selection.RelinkToSupport();
2943
+ CameraPane.SWITCH = random;
2944
+
2945
+ refreshContents();
2946
+ } else
2947
+ if (source == resetreferencesItem)
20422948 {
20432949 for (int i=0; i<group.selection.size(); i++)
20442950 {
....@@ -2047,11 +2953,11 @@
20472953
20482954 refreshContents();
20492955 } else
2050
- if (event.getSource() == setMasterItem)
2956
+ if (source == setMasterItem)
20512957 {
2052
- if (group.selection.size() == 1 && GraphreeD.clipboard.size() == 1)
2958
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
20532959 {
2054
- Object3D content = GraphreeD.clipboard.get(0);
2960
+ Object3D content = Grafreed.clipboard.get(0);
20552961
20562962 if (content instanceof cGroup && ((cGroup)content).transientlink )
20572963 content = ((cGroup)content).get(0);
....@@ -2060,13 +2966,13 @@
20602966 refreshContents();
20612967 }
20622968 } else
2063
- if (event.getSource() == poseMeshItem)
2969
+ if (source == poseMeshItem)
20642970 {
20652971 if (group.selection.size() == 1)
20662972 {
2067
- if (GraphreeD.clipboard.size() == 1)
2973
+ if (Grafreed.clipboard.size() == 1)
20682974 {
2069
- Object3D content = GraphreeD.clipboard.get(0);
2975
+ Object3D content = Grafreed.clipboard.get(0);
20702976
20712977 if (content instanceof cGroup && ((cGroup)content).transientlink )
20722978 content = ((cGroup)content).get(0);
....@@ -2079,19 +2985,19 @@
20792985 }
20802986
20812987 } else
2082
- if (event.getSource() == revertMeshItem)
2988
+ if (source == revertMeshItem)
20832989 {
20842990 RevertMeshes();
20852991 } else
2086
- if (event.getSource() == resetMeshItem)
2992
+ if (source == resetAllItem)
20872993 {
20882994 ResetAll();
20892995 } else
2090
- if (event.getSource() == stepAllItem)
2996
+ if (source == stepAllItem)
20912997 {
20922998 StepAll();
20932999 } else
2094
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
3000
+ if (source == deleteItem) // || event.getSource() == clearButton)
20953001 {
20963002 //int indices[] = jList.getSelectedIndices();
20973003 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2099,42 +3005,46 @@
20993005
21003006 ClearSelection(false);
21013007 } else
2102
- if (event.getSource() == clearAllItem)
3008
+ if (source == clearAllItem)
21033009 {
21043010 ClearSelection(true);
21053011 } else
2106
- if (event.getSource() == grabItem)
3012
+ if (source == grabItem || source == groupButton)
21073013 {
2108
- group(new cGroup(), true);
3014
+ group(new cGroup(), false); // true);
21093015 } else
2110
- if (event.getSource() == frontItem)
3016
+ if (source == hideItem)
3017
+ {
3018
+ group(new HiddenObject());
3019
+ } else
3020
+ if (source == frontItem)
21113021 {
21123022 front();
21133023 } else
2114
- if (event.getSource() == backItem)
3024
+ if (source == backItem)
21153025 {
21163026 back();
21173027 } else
2118
- if (event.getSource() == cameraItem)
3028
+ if (source == cameraItem)
21193029 {
21203030 makeSomething(new Camera());
21213031 } else
2122
- if (event.getSource() == compositeItem)
3032
+ if (source == compositeItem || source == compositeButton)
21233033 {
21243034 group(new Composite());
21253035 } else
2126
- if (event.getSource() == randomItem)
3036
+ if (source == switchItem || source == switchButton)
21273037 {
21283038 RandomNode random = new RandomNode();
21293039 group(random);
21303040 if (random.size() > 0)
2131
- random.name = random.get(0).name + "Rnd";
3041
+ random.name = random.get(0).name + "Switch";
21323042 } else
2133
- if (event.getSource() == physicsItem)
3043
+ if (source == physicsItem)
21343044 {
21353045 group(new PhysicsNode());
21363046 } else
2137
- if (event.getSource() == frameselectorItem)
3047
+ if (source == frameselectorItem)
21383048 {
21393049 for (int i=0; i<group.selection.size(); i++)
21403050 {
....@@ -2146,7 +3056,7 @@
21463056 ResetModel();
21473057 refreshContents();
21483058 } else
2149
- if (event.getSource() == switchGeoItem)
3059
+ if (source == switchGeoItem)
21503060 {
21513061 for (int i=0; i<group.selection.size(); i++)
21523062 {
....@@ -2158,7 +3068,7 @@
21583068 ResetModel();
21593069 refreshContents();
21603070 } else
2161
- if (event.getSource() == switchTransfoItem)
3071
+ if (source == switchTransfoItem)
21623072 {
21633073 for (int i=0; i<group.selection.size(); i++)
21643074 {
....@@ -2170,7 +3080,7 @@
21703080 ResetModel();
21713081 refreshContents();
21723082 } else
2173
- if (event.getSource() == morphItem)
3083
+ if (source == morphItem)
21743084 {
21753085 for (int i=0; i<group.selection.size(); i++)
21763086 {
....@@ -2182,7 +3092,7 @@
21823092 ResetModel();
21833093 refreshContents();
21843094 } else
2185
- if (event.getSource() == scriptNodeItem)
3095
+ if (source == scriptNodeItem)
21863096 {
21873097 boolean atleastone = false;
21883098
....@@ -2221,191 +3131,252 @@
22213131 }
22223132 }
22233133 } else
2224
- if (event.getSource() == linkerItem)
3134
+ if (source == linkerItem)
22253135 {
22263136 group(new cLinker());
22273137 } else
2228
- if (event.getSource() == textureItem)
3138
+ if (source == textureItem || source == textureButton)
22293139 {
22303140 group(new TextureNode());
22313141 } else
2232
- if (event.getSource() == shadowXItem)
3142
+ if (source == billboardItem)
3143
+ {
3144
+ group(new BillboardNode());
3145
+ } else
3146
+ if (source == shadowXItem)
22333147 {
22343148 CastShadow(0);
22353149 } else
2236
- if (event.getSource() == shadowYItem)
3150
+ if (source == shadowYItem)
22373151 {
22383152 CastShadow(1);
22393153 } else
2240
- if (event.getSource() == shadowZItem)
3154
+ if (source == shadowZItem)
22413155 {
22423156 CastShadow(2);
22433157 } else
2244
- if (event.getSource() == ungroupItem)
3158
+ if (source == ungroupItem || source == ungroupButton)
22453159 {
2246
- ungroup();
3160
+ boolean hasRoot = false;
3161
+
3162
+ for (int i=0; i<group.selection.size(); i++)
3163
+ {
3164
+ if (group.selection.get(i) == group)
3165
+ {
3166
+ hasRoot = true;
3167
+ break;
3168
+ }
3169
+ }
3170
+
3171
+ if (!hasRoot)
3172
+ {
3173
+ for (int i=0; i<group.selection.size(); i++)
3174
+ {
3175
+ Ungroup(group.selection.get(i));
3176
+ }
3177
+
3178
+ ClearSelection(false);
3179
+
3180
+ refreshContents();
3181
+ }
22473182 } else
2248
- if (event.getSource() == genUVItem)
3183
+ if (source == genUVItem)
22493184 {
22503185 GenUV();
22513186 } else
2252
- if (event.getSource() == genNormalsCADItem)
3187
+ if (source == genNormalsCADItem)
22533188 {
22543189 GenNormals(true);
22553190 } else
2256
- if (event.getSource() == genNormalsORGANItem)
3191
+ if (source == genNormalsMESHItem)
3192
+ {
3193
+ GenNormalsMESH();
3194
+ } else
3195
+ if (source == genNormalsORGANItem)
22573196 {
22583197 GenNormals(false);
22593198 } else
2260
- if (event.getSource() == stripifyItem)
3199
+ if (source == genNormalsMINEItem)
3200
+ {
3201
+ GenNormalsMINE();
3202
+ } else
3203
+ if (source == stripifyItem)
22613204 {
22623205 Stripify();
22633206 } else
2264
- if (event.getSource() == unstripifyItem)
3207
+ if (source == unstripifyItem)
22653208 {
22663209 Unstripify();
22673210 } else
2268
- if (event.getSource() == trimItem)
3211
+ if (source == trimItem)
22693212 {
22703213 Trim();
22713214 } else
2272
- if (event.getSource() == untrimItem)
3215
+ if (source == untrimItem)
22733216 {
22743217 Untrim();
22753218 } else
2276
- if (event.getSource() == clearColorsItem)
3219
+ if (source == clearColorsItem)
22773220 {
22783221 ClearColors();
22793222 } else
2280
- if (event.getSource() == clearMaterialsItem)
3223
+ if (source == clearMaterialsItem)
22813224 {
22823225 ClearMaterials();
22833226 } else
2284
- if (event.getSource() == liveleavesItem)
3227
+ if (source == liveleavesItem)
22853228 {
22863229 LiveLeaves(true);
22873230 } else
2288
- if (event.getSource() == unliveleavesItem)
3231
+ if (source == unliveleavesItem)
22893232 {
22903233 LiveLeaves(false);
22913234 } else
2292
- if (event.getSource() == supportleavesItem)
3235
+ if (source == supportleavesItem)
22933236 {
22943237 SupportLeaves(true);
22953238 } else
2296
- if (event.getSource() == unsupportleavesItem)
3239
+ if (source == unsupportleavesItem)
22973240 {
22983241 SupportLeaves(false);
22993242 } else
2300
- if (event.getSource() == hideleavesItem)
3243
+ if (source == hideleavesItem)
23013244 {
23023245 HideLeaves(true);
23033246 } else
2304
- if (event.getSource() == showleavesItem)
3247
+ if (source == showleavesItem)
23053248 {
23063249 HideLeaves(false);
23073250 } else
2308
- if (event.getSource() == markleavesItem)
3251
+ if (source == markleavesItem)
23093252 {
23103253 MarkLeaves(true);
23113254 } else
2312
- if (event.getSource() == unmarkleavesItem)
3255
+ if (source == unmarkleavesItem)
23133256 {
23143257 MarkLeaves(false);
23153258 } else
2316
- if (event.getSource() == flipVItem)
3259
+ if (source == rewindleavesItem)
3260
+ {
3261
+ RewindLeaves(true);
3262
+ } else
3263
+ if (source == unrewindleavesItem)
3264
+ {
3265
+ RewindLeaves(false);
3266
+ } else
3267
+ if (source == randomleavesItem)
3268
+ {
3269
+ RandomLeaves(true);
3270
+ } else
3271
+ if (source == unrandomleavesItem)
3272
+ {
3273
+ RandomLeaves(false);
3274
+ } else
3275
+ if (source == flipVItem)
23173276 {
23183277 FlipV(true);
23193278 } else
2320
- if (event.getSource() == unflipVItem)
3279
+ if (source == unflipVItem)
23213280 {
23223281 FlipV(false);
23233282 } else
2324
- if (event.getSource() == lowTexturesItem)
3283
+ if (source == lowTexturesItem)
23253284 {
23263285 SetTexRes(0);
23273286 } else
2328
- if (event.getSource() == normalTexturesItem)
3287
+ if (source == normalTexturesItem)
23293288 {
23303289 SetTexRes(1);
23313290 } else
2332
- if (event.getSource() == highTexturesItem)
3291
+ if (source == highTexturesItem)
23333292 {
23343293 SetTexRes(2);
23353294 } else
2336
- if (event.getSource() == veryhighTexturesItem)
3295
+ if (source == veryhighTexturesItem)
23373296 {
23383297 SetTexRes(3);
23393298 } else
2340
- if (event.getSource() == maxTexturesItem)
3299
+ if (source == maxTexturesItem)
23413300 {
23423301 SetTexRes(4);
23433302 } else
2344
- if (event.getSource() == panoTexturesItem)
3303
+ if (source == panoTexturesItem)
23453304 {
23463305 SetTexRes(5);
23473306 } else
2348
- if (event.getSource() == reverseNormalsItem)
3307
+ if (source == reverseNormalsItem)
23493308 {
23503309 ReverseNormals();
23513310 } else
2352
- if (event.getSource() == parseverticesItem)
3311
+ if (source == parseverticesItem)
23533312 {
23543313 ParseVertices();
23553314 } else
2356
- if (event.getSource() == alignItem)
3315
+ if (source == textureFieldItem)
3316
+ {
3317
+ TextureVertices();
3318
+ } else
3319
+ if (source == alignItem)
23573320 {
23583321 Align();
23593322 } else
2360
- if (event.getSource() == mirrorItem)
3323
+ if (source == mirrorItem)
23613324 {
23623325 MirrorPoses();
23633326 } else
2364
- if (event.getSource() == reduceMorphItem)
3327
+ if (source == reduceMorphItem)
23653328 {
23663329 MeshReduction(false);
23673330 } else
2368
- if (event.getSource() == reduce34MorphItem)
3331
+ if (source == reduce34MorphItem)
23693332 {
23703333 MeshReduction(true);
23713334 } else
2372
- if (event.getSource() == reverseTrianglesItem)
3335
+ if (source == reverseTrianglesItem)
23733336 {
23743337 ReverseTriangles();
23753338 } else
2376
- if (event.getSource() == reduceMeshItem)
3339
+ if (source == reduceMeshItem)
23773340 {
23783341 ReduceMesh(false);
23793342 } else
2380
- if (event.getSource() == reduce34MeshItem)
3343
+ if (source == reduce34MeshItem)
23813344 {
23823345 ReduceMesh(true);
23833346 } else
2384
- if (event.getSource() == increaseMeshItem)
3347
+ if (source == increaseMeshItem)
23853348 {
23863349 IncreaseMesh();
23873350 } else
2388
- if (event.getSource() == clipMeshItem)
3351
+ if (source == clipMeshItem)
23893352 {
23903353 ClipMesh();
23913354 } else
2392
- if (event.getSource() == smoothMeshItem)
3355
+ if (source == smoothMeshItem)
23933356 {
23943357 SmoothMesh();
23953358 } else
2396
- if (event.getSource() == transformgeometryItem)
3359
+ if (source == transformGeometryItem)
23973360 {
23983361 TransformGeometry();
23993362 } else
2400
- if (event.getSource() == resetTransformItem)
3363
+ if (source == transformChildrenItem)
3364
+ {
3365
+ TransformChildren();
3366
+ } else
3367
+ if (source == resetTransformItem)
24013368 {
24023369 ResetTransform();
24033370 } else
2404
- if (event.getSource() == resetCentroidItem)
3371
+ if (source == resetCentroidItem)
24053372 {
2406
- ResetCentroid();
3373
+ ResetCentroid(true);
24073374 } else
2408
- if (event.getSource() == resetParentItem)
3375
+ if (source == resetCentroidXZItem)
3376
+ {
3377
+ ResetCentroid(false);
3378
+ } else
3379
+ if (source == resetParentItem)
24093380 {
24103381 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24113382 {
....@@ -2415,7 +3386,7 @@
24153386
24163387 refreshContents();
24173388 } else
2418
- if (event.getSource() == repairParentItem)
3389
+ if (source == repairParentItem)
24193390 {
24203391 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24213392 {
....@@ -2429,7 +3400,21 @@
24293400
24303401 refreshContents();
24313402 } else
2432
- if (event.getSource() == sortbysizeItem)
3403
+ if (source == repairShadowItem)
3404
+ {
3405
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3406
+ {
3407
+ Object3D obj = (Object3D)e.nextElement();
3408
+ obj.RepairShadow();
3409
+// for (int i=0; i<obj.size(); i++)
3410
+// {
3411
+// obj.get(i).parent = obj;
3412
+// }
3413
+ }
3414
+
3415
+ refreshContents();
3416
+ } else
3417
+ if (source == sortbysizeItem)
24333418 {
24343419 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24353420 {
....@@ -2441,7 +3426,7 @@
24413426 ResetModel();
24423427 refreshContents();
24433428 } else
2444
- if (event.getSource() == sortbynameItem)
3429
+ if (source == sortbynameItem)
24453430 {
24463431 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24473432 {
....@@ -2453,7 +3438,7 @@
24533438 ResetModel();
24543439 refreshContents();
24553440 } else
2456
- if (event.getSource() == attachPigmentItem)
3441
+ if (source == attachPigmentItem)
24573442 {
24583443 String texture = GetFile("Attach pigment");
24593444 Object3D obj;
....@@ -2465,7 +3450,7 @@
24653450
24663451 refreshContents();
24673452 } else
2468
- if (event.getSource() == detachPigmentItem)
3453
+ if (source == detachPigmentItem)
24693454 {
24703455 Object3D obj;
24713456 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2476,7 +3461,7 @@
24763461
24773462 refreshContents();
24783463 } else
2479
- if (event.getSource() == attachBumpItem)
3464
+ if (source == attachBumpItem)
24803465 {
24813466 String texture = GetFile("Attach bump");
24823467 Object3D obj;
....@@ -2488,18 +3473,18 @@
24883473
24893474 refreshContents();
24903475 } else
2491
- if (event.getSource() == detachBumpItem)
3476
+ if (source == detachBumpItem)
24923477 {
24933478 Object3D obj;
24943479 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24953480 {
24963481 obj = (Object3D)e.nextElement();
2497
- obj.SetBumpTexture(null);
3482
+ obj.ResetBumpTexture();
24983483 }
24993484
25003485 refreshContents();
25013486 } else
2502
- if (event.getSource() == pigmentBumpItem)
3487
+ if (source == pigmentBumpItem)
25033488 {
25043489 Object3D obj;
25053490 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2510,158 +3495,262 @@
25103495
25113496 refreshContents();
25123497 } else
2513
- if (event.getSource() == flashSelectionButton)
3498
+ if (source == embedTexturesItem)
3499
+ {
3500
+ Object3D obj;
3501
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3502
+ {
3503
+ obj = (Object3D)e.nextElement();
3504
+ obj.EmbedTextures(true);
3505
+ }
3506
+
3507
+ refreshContents();
3508
+ } else
3509
+ if (source == deEmbedTexturesItem)
3510
+ {
3511
+ Object3D obj;
3512
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3513
+ {
3514
+ obj = (Object3D)e.nextElement();
3515
+ obj.EmbedTextures(false);
3516
+ }
3517
+
3518
+ CameraPane.texturepigment.clear();
3519
+ CameraPane.texturebump.clear();
3520
+
3521
+ refreshContents();
3522
+ } else
3523
+ if (source == flashSelectionButton)
25143524 {
25153525 CameraPane.flash = true;
25163526 refreshContents();
25173527 } else
2518
- if (event.getSource() == oneButton)
3528
+ if (source == oneButton)
25193529 {
25203530 } else
2521
- if (event.getSource() == twoButton)
3531
+ if (source == twoButton)
25223532 {
25233533 radio.layout = twoButton;
3534
+
3535
+ if (CameraPane.FULLSCREEN)
3536
+ fullscreenLayout = radio.layout;
3537
+
25243538 // bug
25253539 //gridPanel.setDividerLocation(1.0);
25263540 //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();
3541
+// bigThree.remove(scenePanel);
3542
+// bigThree.remove(centralPanel);
3543
+// bigThree.remove(XYZPanel);
3544
+// aWindowConstraints.gridx = 0;
3545
+// aWindowConstraints.gridy = 0;
3546
+// aWindowConstraints.gridwidth = 1;
3547
+// // aConstraints.gridheight = 3;
3548
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3549
+// aWindowConstraints.weightx = 0;
3550
+// aWindowConstraints.weighty = 1;
3551
+// //bigThree.add(jtp, aWindowConstraints);
3552
+// aWindowConstraints.weightx = 1;
3553
+// aWindowConstraints.gridwidth = 3;
3554
+// // aConstraints.gridheight = 3;
3555
+// aWindowConstraints.gridx = 1;
3556
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3557
+// bigThree.add(centralPanel, aWindowConstraints);
3558
+// aWindowConstraints.weightx = 0;
3559
+// aWindowConstraints.gridx = 4;
3560
+// aWindowConstraints.gridwidth = 1;
3561
+// // aConstraints.gridheight = 3;
3562
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3563
+// //bigThree.add(XYZPanel, aWindowConstraints);
3564
+// scenePanel.setVisible(false);
3565
+// centralPanel.setVisible(true);
3566
+// XYZPanel.setVisible(false);
3567
+ bigThree.ClearUI();
3568
+ bigThree.add(centralPanel);
3569
+ bigThree.FlushUI();
3570
+
3571
+ cameraView.requestFocusInWindow();
3572
+
3573
+// refreshContents(true);
3574
+//
3575
+// try
3576
+// {
3577
+// java.awt.Robot bot = new java.awt.Robot();
3578
+// int mask = InputEvent.BUTTON1_MASK;
3579
+// bot.mouseMove(100, 100);
3580
+// bot.mousePress(mask);
3581
+// bot.mouseRelease(mask);
3582
+// }
3583
+// catch (Exception e)
3584
+// {
3585
+//
3586
+// }
3587
+
25513588 } else
2552
- if (event.getSource() == threeButton)
3589
+ if (source == threeButton)
25533590 {
25543591 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();
3592
+
3593
+ if (CameraPane.FULLSCREEN)
3594
+ fullscreenLayout = radio.layout;
3595
+
3596
+// bigThree.remove(scenePanel);
3597
+// bigThree.remove(centralPanel);
3598
+// bigThree.remove(XYZPanel);
3599
+// aWindowConstraints.gridx = 0;
3600
+// aWindowConstraints.gridy = 0;
3601
+// aWindowConstraints.gridwidth = 1;
3602
+// // aConstraints.gridheight = 3;
3603
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3604
+// aWindowConstraints.weightx = 0;
3605
+// aWindowConstraints.weighty = 1;
3606
+// //bigThree.add(jtp, aWindowConstraints);
3607
+// aWindowConstraints.weightx = 1;
3608
+// aWindowConstraints.gridwidth = 3;
3609
+// // aConstraints.gridheight = 3;
3610
+// aWindowConstraints.gridx = 1;
3611
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3612
+// bigThree.add(centralPanel, aWindowConstraints);
3613
+// aWindowConstraints.weightx = 0;
3614
+// aWindowConstraints.gridx = 4;
3615
+// aWindowConstraints.gridwidth = 1;
3616
+// // aConstraints.gridheight = 3;
3617
+// aConstraints.fill = GridBagConstraints.VERTICAL;
3618
+// bigThree.add(XYZPanel, aWindowConstraints);
3619
+// bigThree.validate();
3620
+// scenePanel.setVisible(false);
3621
+// centralPanel.setVisible(true);
3622
+// XYZPanel.setVisible(true);
3623
+ bigThree.ClearUI();
3624
+ bigThree.add(scenePanel);
3625
+ bigThree.add(centralPanel);
3626
+ bigThree.FlushUI();
3627
+
3628
+ cameraView.requestFocusInWindow();
25793629 } else
2580
- if (event.getSource() == fourButton)
3630
+ if (source == fourButton)
25813631 {
25823632 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();
3633
+
3634
+ if (CameraPane.FULLSCREEN)
3635
+ fullscreenLayout = radio.layout;
3636
+
3637
+// bigThree.remove(scenePanel);
3638
+// bigThree.remove(centralPanel);
3639
+// bigThree.remove(XYZPanel);
3640
+// aWindowConstraints.gridx = 0;
3641
+// aWindowConstraints.gridy = 0;
3642
+// aWindowConstraints.gridwidth = 1;
3643
+// // aWindowConstraints.gridheight = 3;
3644
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3645
+// aWindowConstraints.weightx = 1;
3646
+// aWindowConstraints.weighty = 1;
3647
+// bigThree.add(scenePanel, aWindowConstraints);
3648
+// aWindowConstraints.weightx = 1;
3649
+// aWindowConstraints.gridwidth = 3;
3650
+// // aConstraints.gridheight = 3;
3651
+// aWindowConstraints.gridx = 1;
3652
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3653
+// //bigThree.add(cameraPanel, aWindowConstraints);
3654
+// aWindowConstraints.weightx = 0;
3655
+// aWindowConstraints.gridx = 4;
3656
+// aWindowConstraints.gridwidth = 1;
3657
+// // aWindowConstraints.gridheight = 3;
3658
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3659
+// //bigThree.add(XYZPanel, aWindowConstraints);
3660
+// bigThree.validate();
3661
+// scenePanel.setVisible(true);
3662
+// centralPanel.setVisible(false);
3663
+// XYZPanel.setVisible(false);
3664
+ bigThree.ClearUI();
3665
+ bigThree.add(scenePanel);
3666
+ bigThree.FlushUI();
3667
+
3668
+ cameraView.requestFocusInWindow();
26073669 } else
2608
- if (event.getSource() == sixButton)
3670
+ if (source == sixButton)
26093671 {
26103672 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();
3673
+
3674
+ if (CameraPane.FULLSCREEN)
3675
+ fullscreenLayout = radio.layout;
3676
+
3677
+// bigThree.remove(scenePanel);
3678
+// bigThree.remove(centralPanel);
3679
+// bigThree.remove(XYZPanel);
3680
+// aWindowConstraints.gridx = 0;
3681
+// aWindowConstraints.gridy = 0;
3682
+// aWindowConstraints.gridwidth = 1;
3683
+// // aConstraints.gridheight = 3;
3684
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3685
+// aWindowConstraints.weightx = 0;
3686
+// aWindowConstraints.weighty = 1;
3687
+// bigThree.add(scenePanel, aWindowConstraints);
3688
+// aWindowConstraints.weightx = 1;
3689
+// aWindowConstraints.gridwidth = 3;
3690
+// // aWindowConstraints.gridheight = 3;
3691
+// aWindowConstraints.gridx = 1;
3692
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3693
+// bigThree.add(centralPanel, aWindowConstraints);
3694
+// aWindowConstraints.weightx = 0;
3695
+// aWindowConstraints.gridx = 4;
3696
+// aWindowConstraints.gridwidth = 1;
3697
+// // aWindowConstraints.gridheight = 3;
3698
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3699
+// //bigThree.add(XYZPanel, aConstraints);
3700
+// bigThree.validate();
3701
+// scenePanel.setVisible(true);
3702
+// centralPanel.setVisible(true);
3703
+// XYZPanel.setVisible(false);
3704
+ bigThree.ClearUI();
3705
+ bigThree.add(centralPanel);
3706
+ bigThree.add(scenePanel);
3707
+ bigThree.FlushUI();
3708
+
3709
+ cameraView.requestFocusInWindow();
26353710 } else
2636
- if (event.getSource() == sevenButton)
3711
+ if (source == sevenButton)
26373712 {
26383713 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();
3714
+
3715
+ if (CameraPane.FULLSCREEN)
3716
+ fullscreenLayout = radio.layout;
3717
+
3718
+// bigThree.remove(scenePanel);
3719
+// bigThree.remove(centralPanel);
3720
+// bigThree.remove(XYZPanel);
3721
+// aWindowConstraints.gridx = 0;
3722
+// aWindowConstraints.gridy = 0;
3723
+// aWindowConstraints.gridwidth = 1;
3724
+// // aWindowConstraints.gridheight = 3;
3725
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3726
+// aWindowConstraints.weightx = 0;
3727
+// aWindowConstraints.weighty = 1;
3728
+// bigThree.add(scenePanel, aWindowConstraints);
3729
+// aWindowConstraints.weightx = 1;
3730
+// aWindowConstraints.gridwidth = 3;
3731
+// // aWindowConstraints.gridheight = 3;
3732
+// aWindowConstraints.gridx = 1;
3733
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3734
+// bigThree.add(centralPanel, aWindowConstraints);
3735
+// aWindowConstraints.weightx = 0;
3736
+// aWindowConstraints.gridx = 4;
3737
+// aWindowConstraints.gridwidth = 1;
3738
+// // aConstraints.gridheight = 3;
3739
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3740
+// bigThree.add(XYZPanel, aWindowConstraints);
3741
+// bigThree.validate();
3742
+// scenePanel.setVisible(true);
3743
+// centralPanel.setVisible(true);
3744
+// XYZPanel.setVisible(true);
3745
+ bigThree.ClearUI();
3746
+ bigThree.add(scenePanel);
3747
+ bigThree.add(centralPanel);
3748
+ bigThree.add(XYZPanel);
3749
+ bigThree.FlushUI();
3750
+
3751
+ cameraView.requestFocusInWindow();
26633752 } else
2664
- if (event.getSource() == rootButton)
3753
+ if (source == rootButton)
26653754 {
26663755 Object3D obj;
26673756 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2671,66 +3760,84 @@
26713760 EditObject(obj);
26723761 }
26733762
3763
+ cameraView.requestFocusInWindow();
26743764 refreshContents(true);
26753765 } else
2676
- if (event.getSource() == closeButton)
3766
+ if (source == closeButton)
26773767 {
26783768 //System.out.println("CLOSE: " + buttonGroup.getSelection());
26793769 cRadio ab;
26803770 for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
26813771 {
26823772 ab = (cRadio)e.nextElement();
2683
- if(ab.getModel().isSelected() && ab.GetObject() != client)
3773
+ if (ab.getModel().isSelected() && ab.GetObject() != client)
26843774 {
3775
+ // Patch to avoid bug with transparency.
3776
+ if (!ab.hadMaterial)
3777
+ {
3778
+ ab.object.material = null;
3779
+ }
3780
+
26853781 buttonGroup.remove(ab);
26863782 radioPanel.remove(ab);
26873783
2688
- ab.GetObject().editWindow = null;
3784
+ //ab.GetObject().editWindow = null;
3785
+ ab.GetObject().manipWindow = null;
26893786 // ab.GetObject().objectUI = null; // ?????????
26903787
26913788 ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick();
26923789 break;
26933790 }
26943791 }
3792
+
3793
+ cameraView.requestFocusInWindow();
26953794 refreshContents(true);
26963795 } else
2697
- if (event.getSource() == editItem || event.getSource() == editButton)
3796
+ if (source == editItem || source == editButton)
26983797 {
3798
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3799
+ {
3800
+ Object3D child = (Object3D)e.nextElement();
3801
+ child.pinned = true;
3802
+ }
3803
+
26993804 EditSelection(false);
27003805 } else
2701
- if (event.getSource() == uneditButton)
3806
+ if (source == uneditButton)
27023807 {
27033808 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
27043809 {
27053810 Object3D child = (Object3D)e.nextElement();
27063811 if(child.editWindow != null)
27073812 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3813
+ child.pinned = false;
27083814 child.CloseUI();
27093815 listUI.remove(child);
27103816
2711
- child.editWindow = null; // ???????????
3817
+ //child.editWindow = null; // ???????????
27123818 }
2713
- objEditor.ctrlPanel.revalidate();
3819
+ objEditor.ctrlPanel.FlushUI();
27143820 //objEditor.jTree.clearSelection();
27153821 //objEditor.ResetSliders();
27163822 refreshContents(true);
27173823 } else
2718
- if (event.getSource() == clearPanelButton)
3824
+ if (source == clearPanelButton)
27193825 {
27203826 assert(copy == group);
27213827 //copy.ClearUI();
27223828 for (Object3D obj : listUI)
27233829 {
3830
+ obj.pinned = false;
27243831 obj.CloseUI();
27253832 }
27263833 listUI.clear();
27273834 refreshContents(true);
27283835 } else
2729
- if (event.getSource() == allParamsButton)
3836
+ if (source == allParamsButton)
27303837 {
27313838 assert(copy == group);
27323839
2733
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3840
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
27343841
27353842 for (Object3D obj : listUI)
27363843 {
....@@ -2747,19 +3854,19 @@
27473854
27483855 refreshContents(true);
27493856 } else
2750
- if (event.getSource() == unselectButton)
3857
+ if (source == unselectButton)
27513858 {
27523859 objEditor.jTree.clearSelection();
2753
- // ?? oct 2012 GraphreeD.clipboard.clear();
3860
+ // ?? oct 2012 GrafreeD.clipboard.clear();
27543861 objEditor.ResetSliders();
27553862 refreshContents(true);
27563863 } else
2757
- if(event.getSource() instanceof cRadio)
3864
+ if(source instanceof cRadio)
27583865 {
27593866 group.parent = keepparent;
27603867 group.attributes = 0;
27613868 //group.editWindow = null;
2762
- /*cRadio*/ radio = (cRadio)event.getSource();
3869
+ /*cRadio*/ radio = (cRadio)source;
27633870 Object3D obj = radio.GetObject();
27643871 System.out.println("Edit " + obj);
27653872 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -2779,7 +3886,10 @@
27793886 }
27803887
27813888 copy = group;
2782
- //CameraPane.theRenderer.object = group;
3889
+
3890
+ SetUndoStates();
3891
+
3892
+ //Globals.theRenderer.object = group;
27833893 if(!useclient)
27843894 {
27853895 cameraView.renderCamera = radio.camera;
....@@ -2788,25 +3898,52 @@
27883898 cameraView.cameras[cameraView.cameracount] = radio.camera;
27893899 cameraView.targetLookAt.set(radio.camera.lookAt);
27903900 cameraView.object = group;
2791
- cameraView.lighttouched = true;
3901
+ //cameraView.lighttouched = true;
3902
+ Globals.lighttouched = true;
27923903 topView.object = group;
27933904 frontView.object = group;
27943905 sideView.object = group;
27953906 }
2796
- group.editWindow = this;
3907
+
3908
+// fix "+" issue
3909
+ //group.editWindow = this;
3910
+ group.manipWindow = this;
3911
+
27973912 /*
27983913 currentLayout = radio.layout;
27993914 if (currentLayout == null)
28003915 currentLayout = sevenButton;
28013916 */
28023917 radio.layout.doClick();
3918
+
3919
+ ClearUnpinned();
3920
+ //Grafreed.Assert(group != null);
3921
+ //Grafreed.Assert(group.selection != null);
3922
+ SetPinStates(group.selection == null || group.selection.size() > 0);
3923
+ if (group.selection == null || group.selection.size() == 1)
3924
+ EditSelection(false);
28033925 keepparent = group.parent;
28043926 // PARENT = NULL or not???
28053927 //group.parent = null; // ROOT
28063928 //group.attributes = -1;
28073929 ResetModel();
3930
+
3931
+ cameraView.requestFocusInWindow();
28083932 refreshContents(true);
2809
- }
3933
+ } else if (event.getSource() == editCameraItem)
3934
+ {
3935
+ cameraView.ProtectCamera();
3936
+ cameraView.repaint();
3937
+ return;
3938
+ } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton)
3939
+ {
3940
+ cameraView.RevertCamera();
3941
+ cameraView.repaint();
3942
+ return;
3943
+ // } else if (event.getSource() == textureButton)
3944
+ // {
3945
+ // return; // true;
3946
+ }
28103947 else
28113948 {
28123949 //return super.action(event, arg);
....@@ -2815,7 +3952,6 @@
28153952 }
28163953
28173954 boolean useclient = false;
2818
- cRadio radio;
28193955
28203956 void ToggleRoot()
28213957 {
....@@ -2824,7 +3960,7 @@
28243960 if (useclient)
28253961 {
28263962 cameraView.object = client;
2827
- cameraView.lighttouched = true;
3963
+ Globals.lighttouched = true;
28283964 //topView.object = client;
28293965 //frontView.object = client;
28303966 //sideView.object = client;
....@@ -2832,7 +3968,7 @@
28323968 else
28333969 {
28343970 cameraView.object = group;
2835
- cameraView.lighttouched = true;
3971
+ Globals.lighttouched = true;
28363972 //topView.object = group;
28373973 //frontView.object = group;
28383974 //sideView.object = group;
....@@ -2867,6 +4003,28 @@
28674003 refreshContents();
28684004 }
28694005
4006
+ void TransformChildren()
4007
+ {
4008
+ Object3D obj;
4009
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
4010
+ {
4011
+ obj = (Object3D)e.nextElement();
4012
+ obj.KeepTextureMatrices();
4013
+ obj.TransformChildren();
4014
+ obj.RestoreTextureMatrices();
4015
+
4016
+// if (obj.parent == null)
4017
+// {
4018
+// System.out.println("NULL PARENT!");
4019
+// new Exception().printStackTrace();
4020
+// }
4021
+// else
4022
+// TouchTransform(obj);
4023
+// //obj.parent.Touch();
4024
+ }
4025
+
4026
+ refreshContents();
4027
+ }
28704028
28714029 void ResetTransform()
28724030 {
....@@ -2979,7 +4137,7 @@
29794137 refreshContents();
29804138 }
29814139
2982
- void ResetCentroid()
4140
+ void ResetCentroid(boolean full)
29834141 {
29844142 Object3D obj;
29854143 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2994,12 +4152,16 @@
29944152 LA.matIdentity(Object3D.mat);
29954153 obj.getBounds(minima, maxima, false);
29964154 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
2997
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
4155
+ if (full)
4156
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
29984157 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
29994158 obj.TransformMesh(Object3D.mat);
4159
+
30004160 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3001
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
4161
+ if (full)
4162
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
30024163 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
4164
+
30034165 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
30044166 //Object3D.mat[3][0] = -Object3D.mat[3][0];
30054167 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3028,7 +4190,8 @@
30284190
30294191 int size = obj.MemorySize();
30304192
3031
- System.err.println((size/1024) + " KB is the size of " + obj);
4193
+ //System.err.println((size/1024) + " KB is the size of " + obj);
4194
+ System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)");
30324195 }
30334196 }
30344197 catch (Exception e)
....@@ -3065,9 +4228,9 @@
30654228 obj = (Object3D)e.nextElement();
30664229
30674230 System.out.println("Object is: " + obj);
3068
- GraphreeD.AnalyzeObject(obj);
4231
+ Grafreed.AnalyzeObject(obj);
30694232 System.out.println("Boundary rep: " + obj.bRep);
3070
- GraphreeD.AnalyzeObject(obj.bRep);
4233
+ Grafreed.AnalyzeObject(obj.bRep);
30714234
30724235 // System.err.println((size/1024) + " KB is the size of " + obj);
30734236 }
....@@ -3109,6 +4272,20 @@
31094272 void GenNormals(boolean crease)
31104273 {
31114274 group.GenNormalsS(crease);
4275
+
4276
+ refreshContents();
4277
+ }
4278
+
4279
+ void GenNormalsMESH()
4280
+ {
4281
+ group.GenNormalsMeshS();
4282
+
4283
+ refreshContents();
4284
+ }
4285
+
4286
+ void GenNormalsMINE()
4287
+ {
4288
+ group.selection.GenNormalsMINE();
31124289
31134290 refreshContents();
31144291 }
....@@ -3157,104 +4334,259 @@
31574334
31584335 //Object3D buffer;
31594336 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
-
4337
+// BoundaryRep temprep;
4338
+// Object3D nodes;
4339
+// Vector<Vertex> vertices;
4340
+//
4341
+// cGroup buffer;
4342
+//
4343
+// public void Vertex(Object3D node, Vertex v)
4344
+// {
4345
+//// vertices.add(v);
4346
+//// nodes.addElement(node);
4347
+////
4348
+//// if (temprep.GetCache(v) != null)
4349
+//// {
4350
+//// temprep.Remove(v);
4351
+//// } else
4352
+//// {
4353
+//// temprep.Remember(v);
4354
+//// }
4355
+//
4356
+// //Object3D node = nodes.get(index);
4357
+// temp.set(v); // vertices.get(index)); // temprep.GetVertex(k));
4358
+// // System.out.println("temp = " + temp.x + ", " + temp.y + ", " + temp.z);
4359
+//
4360
+// LA.xformPos(temp, node.GlobalTransformInv(), temp);
4361
+//
4362
+// // System.out.println("tem+ = " + temp.x + ", " + temp.y + ", " + temp.z);
4363
+//
4364
+// cGroup g = new cGroup();
4365
+//
4366
+// if (g.toParent == null)
4367
+// {
4368
+// g.toParent = LA.newMatrix();
4369
+// g.fromParent = LA.newMatrix();
4370
+// }
4371
+// LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
4372
+// LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
4373
+//
4374
+// g.add(GrafreeD.clipboard);
4375
+//
4376
+// buffer.add(g);
4377
+// }
4378
+//
4379
+// public void Face(Object3D node, Face f)
4380
+// {
4381
+//
4382
+// }
4383
+//
4384
+// void ParseVerticesOld() // ??
4385
+// {
4386
+// //if (group.selection.size() != 1)
4387
+// // return;
4388
+//
4389
+// temprep = new BoundaryRep();
4390
+// nodes = new Object3D();
4391
+// vertices = new Vector<Vertex>();
4392
+//
4393
+// boolean epsequal = GrafreeD.epsequal;
4394
+// GrafreeD.epsequal = true;
4395
+//
4396
+// for (int i=0; i<group.selection.size(); i++)
4397
+// {
4398
+// Object3D buffer = new cGroup(group.selection.get(i).name + "+");
4399
+//
4400
+// group.selection.get(i).Parse(
4401
+//this );
4402
+//
4403
+// int repsize = temprep.VertexCount();
4404
+// int tablesize = temprep.vertextable.size();
4405
+// int nodesize = nodes.size();
4406
+//
4407
+// assert(vertices.size() == nodes.size());
4408
+//
4409
+// temprep.vertextable.elements();
4410
+//
4411
+// java.util.Set<java.util.Map.Entry<Vertex,Vertex>> set = temprep.vertextable.entrySet();
4412
+//
4413
+// for (java.util.Map.Entry<Vertex,Vertex> entry : set)
4414
+// {
4415
+// cGroup g = new cGroup();
4416
+//
4417
+// int index = vertices.indexOf(entry.getValue()); // temprep.vertextable.(k));
4418
+//
4419
+// Object3D node = nodes.get(index);
4420
+// temp.set(vertices.get(index)); // temprep.GetVertex(k));
4421
+// // System.out.println("temp = " + temp.x + ", " + temp.y + ", " + temp.z);
4422
+//
4423
+// LA.xformPos(temp, node.GlobalTransformInv(), temp);
4424
+//
4425
+// // System.out.println("tem+ = " + temp.x + ", " + temp.y + ", " + temp.z);
4426
+//
4427
+// if (g.toParent == null)
4428
+// {
4429
+// g.toParent = LA.newMatrix();
4430
+// g.fromParent = LA.newMatrix();
4431
+// }
4432
+// LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
4433
+// LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
4434
+//
4435
+// g.add(GrafreeD.clipboard);
4436
+//
4437
+// buffer.add(g);
4438
+// }
4439
+//
4440
+// makeSomething(buffer, i==group.selection.size()-1);
4441
+// }
4442
+//
4443
+// GrafreeD.epsequal = epsequal;
4444
+//
4445
+// //buffer = null;
4446
+// temprep = null;
4447
+// nodes = null;
4448
+//
4449
+// refreshContents();
4450
+// }
4451
+
31844452 void ParseVertices()
31854453 {
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;
4454
+ boolean epsequal = Grafreed.epsequal;
4455
+ Grafreed.epsequal = true;
31954456
31964457 for (int i=0; i<group.selection.size(); i++)
31974458 {
3198
- Object3D buffer = new cGroup(group.selection.get(i).name + "+");
4459
+ final cGroup buffer = new cGroup(group.selection.get(i).name + "+");
31994460
3200
- group.selection.get(i).Parse(this);
3201
-
3202
- int repsize = temprep.VertexCount();
3203
- int tablesize = temprep.vertextable.size();
3204
- int nodesize = nodes.size();
4461
+ group.selection.get(i).Parse(
4462
+
4463
+ new iParse()
4464
+ {
4465
+ public void Vertex(Object3D node, Vertex v)
4466
+ {
4467
+ temp.set(v);
4468
+ LA.xformPos(temp, node.GlobalTransformInv(), temp);
32054469
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();
4470
+ cGroup g = new cGroup();
32114471
3212
- for (java.util.Map.Entry<Vertex,Vertex> entry : set)
3213
- {
3214
- cGroup g = new cGroup();
4472
+ if (g.toParent == null)
4473
+ {
4474
+ g.toParent = LA.newMatrix();
4475
+ g.fromParent = LA.newMatrix();
4476
+ }
4477
+ LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
4478
+ LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
32154479
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);
4480
+ g.add(Grafreed.clipboard);
32204481
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);
4482
+ buffer.add(g);
4483
+ }
32324484
3233
- g.add(GraphreeD.clipboard);
4485
+ public void Face(Object3D node, Face f)
4486
+ {
32344487
3235
- buffer.add(g);
3236
- }
4488
+ }
4489
+ }
4490
+ );
32374491
32384492 makeSomething(buffer, i==group.selection.size()-1);
32394493 }
32404494
3241
- GraphreeD.epsequal = epsequal;
3242
-
3243
- //buffer = null;
3244
- temprep = null;
3245
- nodes = null;
4495
+ Grafreed.epsequal = epsequal;
32464496
32474497 refreshContents();
32484498 }
3249
-
4499
+
4500
+ void TextureVertices()
4501
+ {
4502
+ for (int i=0; i<group.selection.size(); i++)
4503
+ {
4504
+ group.selection.get(i).Parse(
4505
+ new iParse()
4506
+ {
4507
+ public void Vertex(Object3D node, Vertex v)
4508
+ {
4509
+ cTexture tex = node.GetTextures();
4510
+ String pigment = Object3D.GetPigment(tex);
4511
+ //String bump = Object3D.GetBump(tex);
4512
+
4513
+ com.sun.opengl.util.texture.TextureData texturedata = null;
4514
+
4515
+ try
4516
+ {
4517
+ texturedata = Globals.theRenderer.GetTextureData(tex, false, node.texres);
4518
+ }
4519
+ catch (Exception e)
4520
+ {
4521
+ System.err.println("FAIL: " + node);
4522
+ }
4523
+
4524
+ double s = v.s;
4525
+
4526
+ if (s == 1)
4527
+ s = 0;
4528
+
4529
+ double t = v.t;
4530
+
4531
+ if (t == 1)
4532
+ t = 0;
4533
+
4534
+ int indexs = (int) (texturedata.getWidth() * s);
4535
+ int indext = (int) (texturedata.getHeight() * t);
4536
+
4537
+ int index = indext * texturedata.getWidth() + indexs;
4538
+
4539
+ java.nio.ByteBuffer bytebuf = (java.nio.ByteBuffer)texturedata.getBuffer();
4540
+
4541
+ int slide = bytebuf.capacity() / texturedata.getWidth() / texturedata.getHeight();
4542
+
4543
+ float scale = bytebuf.get(index*slide) & 0xFF;
4544
+ scale += bytebuf.get(index*slide+1) & 0xFF;
4545
+ scale += bytebuf.get(index*slide+2) & 0xFF;
4546
+ scale /= 3;
4547
+
4548
+ scale /= 0xFF;
4549
+ // c'est quoi ca? scale /= 4;
4550
+
4551
+ //v.AO = scale;
4552
+
4553
+ v.x += v.norm.x * scale;
4554
+ v.y += v.norm.y * scale;
4555
+ v.z += v.norm.z * scale;
4556
+ }
4557
+
4558
+ public void Face(Object3D node, Face f)
4559
+ {
4560
+ }
4561
+ }
4562
+ );
4563
+ }
4564
+
4565
+ refreshContents();
4566
+ }
4567
+
32504568 void Align()
32514569 {
4570
+ if (group.selection.size() == 0)
4571
+ return;
4572
+
4573
+ cVector bbmin = new cVector();
4574
+ cVector bbmax = new cVector();
4575
+
4576
+ group.selection.get(0).getBounds(bbmin, bbmax, true);
4577
+
4578
+ double dx = bbmax.x - bbmin.x;
4579
+ double dy = bbmax.y - bbmin.y;
4580
+ double dz = bbmax.z - bbmin.z;
4581
+
4582
+ double scale = Math.sqrt(dx*dx + dy*dy + dz*dz);
4583
+
32524584 for (int i=0; i<group.selection.size(); i++)
32534585 {
32544586 Object3D obj = group.selection.get(i);
32554587
3256
- LA.matTranslate(obj.toParent, i/2f, 0, 0);
3257
- LA.matTranslateInv(obj.fromParent, -i/2f, 0, 0);
4588
+ LA.matTranslate(obj.toParent, i * scale, 0, 0);
4589
+ LA.matTranslateInv(obj.fromParent, -i * scale, 0, 0);
32584590 }
32594591
32604592 refreshContents();
....@@ -3267,7 +4599,7 @@
32674599 // ref.SaveSupports();
32684600 // Object3D par = ref.parent;
32694601 // ref.parent = null;
3270
-// Object3D lowres = (Object3D) GraphreeD.clone(ref);
4602
+// Object3D lowres = (Object3D) GrafreeD.clone(ref);
32714603 // ref.parent = par;
32724604 // ref.RestoreSupports();
32734605
....@@ -3275,11 +4607,11 @@
32754607
32764608 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
32774609
3278
- boolean random = CameraPane.RANDOM;
3279
- CameraPane.RANDOM = false; // parse all random nodes
4610
+ boolean random = CameraPane.SWITCH;
4611
+ CameraPane.SWITCH = false; // parse all random nodes
32804612 lowres.linkVerticesThis(null);
32814613 lowres.linkVerticesThis(sn);
3282
- CameraPane.RANDOM = random;
4614
+ CameraPane.SWITCH = random;
32834615
32844616 System.err.flush();
32854617
....@@ -3297,7 +4629,7 @@
32974629 // lowres.SaveSupports();
32984630 // par = lowres.parent;
32994631 // lowres.parent = null;
3300
-// Object3D newlow = (Object3D) GraphreeD.clone(lowres);
4632
+// Object3D newlow = (Object3D) GrafreeD.clone(lowres);
33014633 Object3D newlow = CloneObject(lowres, false);
33024634 newlow.name = sn.switchobject.get(i).name;
33034635 System.out.println(" pose#" + i + " = " + newlow);
....@@ -3319,7 +4651,7 @@
33194651 return;
33204652
33214653 Object3D poses = group.selection.get(0);
3322
- Object3D ref = GraphreeD.clipboard.get(0);
4654
+ Object3D ref = Grafreed.clipboard.get(0);
33234655
33244656 Object3D newgroup = new Object3D("Po:" + poses.name);
33254657
....@@ -3488,7 +4820,7 @@
34884820 group.selection.RelinkToSupport(); // july 2014
34894821 System.out.println("DONE.");
34904822 refreshContents();
3491
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
4823
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
34924824 }
34934825
34944826 void ReduceMesh(boolean reduction34)
....@@ -3513,20 +4845,20 @@
35134845
35144846 void ClipMesh()
35154847 {
3516
- if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
4848
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
35174849 {
3518
- Object3D content = GraphreeD.clipboard.get(0);
4850
+ Object3D content = Grafreed.clipboard.get(0);
35194851
35204852 if (content instanceof cGroup && ((cGroup)content).transientlink )
35214853 content = ((cGroup)content).get(0);
35224854
35234855 // for (int i=0; i<group.selection.size(); i++)
35244856 // {
3525
-// group.selection.get(i).ClipMesh(GraphreeD.clipboard);
4857
+// group.selection.get(i).ClipMesh(GrafreeD.clipboard);
35264858 // }
3527
- group.selection.ClipMesh(GraphreeD.clipboard);
4859
+ group.selection.ClipMesh(Grafreed.clipboard);
35284860 }
3529
-// group.selection.ClipMesh(GraphreeD.clipboard);
4861
+// group.selection.ClipMesh(GrafreeD.clipboard);
35304862 System.out.println("DONE.");
35314863 refreshContents();
35324864 }
....@@ -3571,6 +4903,18 @@
35714903 void MarkLeaves(boolean hide)
35724904 {
35734905 group.selection.MarkLeaves(hide);
4906
+ refreshContents();
4907
+ }
4908
+
4909
+ void RewindLeaves(boolean hide)
4910
+ {
4911
+ group.selection.RewindLeaves(hide);
4912
+ refreshContents();
4913
+ }
4914
+
4915
+ void RandomLeaves(boolean hide)
4916
+ {
4917
+ group.selection.RandomLeaves(hide);
35744918 refreshContents();
35754919 }
35764920
....@@ -3645,28 +4989,25 @@
36454989 // }
36464990 // }
36474991
3648
- static boolean allparams = true;
3649
-
3650
- static Vector<Object3D> listUI = new Vector<Object3D>();
3651
-
36524992 void EditSelection(boolean newWindow)
36534993 {
4994
+ if (group.selection == null)
4995
+ {
4996
+ EditElement(group, newWindow); // ? new
4997
+ return;
4998
+ }
4999
+
36545000 // aConstraints.gridy = 0;
36555001 for (int i=0; i<group.selection.size(); i++)
36565002 {
36575003 //System.out.println("edit : " + objectPanel.indexOfTab("Material"));
36585004 //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false);
3659
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
5005
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
36605006
36615007 Object3D elem = (Object3D)group.selection.elementAt(i);
3662
- if(elem != group)
5008
+ if(elem != group || !newWindow)
36635009 {
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
5010
+ EditElement(elem, newWindow); // ? new
36705011 }
36715012 }
36725013 }
....@@ -3741,7 +5082,8 @@
37415082 //new Exception().printStackTrace();
37425083
37435084 freezemodel = true;
3744
-
5085
+ ClearUnpinned();
5086
+
37455087 /**/
37465088 //switch (event.id)
37475089 {
....@@ -3749,7 +5091,6 @@
37495091 //case 702: // Event.LIST_DESELECT
37505092 group.deselectAll();
37515093 TreePath tps[] = objEditor.jTree.getSelectionPaths();
3752
- objEditor.ClearInfo(); // .GetMaterial());
37535094 if (tps != null)
37545095 {
37555096 for (int i=0; i < tps.length; i++)
....@@ -3758,33 +5099,39 @@
37585099
37595100 //if (child.parent != null)
37605101 //child.parent.addSelectee(child);
5102
+ objEditor.SetMaterial(child);
37615103 group.addSelectee(child);
3762
- objEditor.SetMaterial(child); // .GetMaterial());
3763
- objEditor.AddInfo(child, this, true); // .GetMaterial());
3764
- System.err.println("info : " + child.GetPath());
37655104 }
37665105 }
3767
- else
3768
- {
3769
- objEditor.SetMaterial(group); // .GetMaterial());
3770
- objEditor.AddInfo(group, this, true); // .GetMaterial());
3771
- System.err.println("info : " + group.GetPath());
3772
- }
5106
+// else
5107
+// {
5108
+// objEditor.SetMaterial(group); // .GetMaterial());
5109
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
5110
+// System.err.println("info : " + group.GetPath());
5111
+// }
37735112
3774
- objEditor.SetText(); // jan 2014
3775
-
3776
- if (flashIt && !CameraPane.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
5113
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera))
37775114 CameraPane.flash = true;
37785115
3779
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
5116
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
37805117 // a camera
37815118 {
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;
5119
+ if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crash the camera because of invalid lightspace
5120
+ {
5121
+ CameraPane.camerachangeframe = 0; // don't refuse it
5122
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
5123
+ }
5124
+ // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
5125
+ // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
37865126 }
37875127
5128
+ if (tps != null && tps.length == 1)
5129
+ {
5130
+ EditSelection(false);
5131
+ }
5132
+
5133
+ SetPinStates(tps != null && tps.length > 0);
5134
+
37885135 refreshContents();
37895136 //return true;
37905137 }
....@@ -3793,6 +5140,35 @@
37935140
37945141 freezemodel = false;
37955142 }
5143
+
5144
+ void SetPinStates(boolean enabled)
5145
+ {
5146
+ editButton.setEnabled(enabled);
5147
+ uneditButton.setEnabled(enabled);
5148
+ unselectButton.setEnabled(enabled);
5149
+ flashSelectionButton.setEnabled(enabled);
5150
+ }
5151
+
5152
+ void refreshContents(boolean cp)
5153
+ {
5154
+ if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info"))
5155
+ if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING)
5156
+ {
5157
+ objEditor.ClearInfo(); // .GetMaterial());
5158
+
5159
+ for (int i=0; i < group.selection.Size(); i++)
5160
+ {
5161
+ Object3D child = (Object3D) group.selection.get(i);
5162
+
5163
+ objEditor.AddInfo(child, this, true);
5164
+ System.err.println("info : " + child.GetPath());
5165
+ }
5166
+
5167
+ objEditor.SetText(); // jan 2014
5168
+ }
5169
+
5170
+ super.refreshContents(cp);
5171
+ }
37965172
37975173 void linkSomething(Object3D thing)
37985174 {
....@@ -3864,16 +5240,19 @@
38645240 {
38655241 if (group.selection.isEmpty())
38665242 return;
3867
- GraphreeD.clipboardIsTempGroup = false;
5243
+
5244
+ Grafreed.clipboardIsTempGroup = false;
38685245 Composite tGroup = null;
38695246 if (group.selection.size() > 0) // 1)
38705247 {
38715248 tGroup = new cGroup();
3872
- GraphreeD.clipboardIsTempGroup = true;
5249
+ Grafreed.clipboardIsTempGroup = true;
38735250 }
38745251
38755252 if (cut)
38765253 {
5254
+// if (Globals.SAVEONMAKE) // Moved to the clipboard, no need to save.
5255
+// Save();
38775256 //int indices[] = jList.getSelectedIndices();
38785257 //for (int i = indices.length - 1; i >= 0; i--)
38795258 //jList.remove(indices[i]);
....@@ -3909,16 +5288,16 @@
39095288 //System.out.println("cut " + child);
39105289 //System.out.println("parent = " + child.parent);
39115290 // tmp.addChild(child);
3912
- if (GraphreeD.clipboardIsTempGroup)
5291
+ if (Grafreed.clipboardIsTempGroup)
39135292 tGroup.add/*Child*/(tmp);
39145293 else
3915
- GraphreeD.clipboard = tmp;
5294
+ Grafreed.clipboard = tmp;
39165295 }
39175296 else
3918
- if (GraphreeD.clipboardIsTempGroup)
5297
+ if (Grafreed.clipboardIsTempGroup)
39195298 tGroup.add/*Child*/(child);
39205299 else
3921
- GraphreeD.clipboard = child;
5300
+ Grafreed.clipboard = child;
39225301 }
39235302
39245303 //ResetModel();
....@@ -3950,21 +5329,23 @@
39505329 //System.out.println("cut " + elem);
39515330 //System.out.println("parent = " + elem.parent);
39525331 // tmp.addChild(elem);
3953
- if (GraphreeD.clipboardIsTempGroup)
5332
+ if (Grafreed.clipboardIsTempGroup)
39545333 tGroup.add/*Child*/(tmp);
39555334 else
3956
- GraphreeD.clipboard = tmp;
5335
+ Grafreed.clipboard = tmp;
39575336 }
39585337 else
3959
- if (GraphreeD.clipboardIsTempGroup)
5338
+ if (Grafreed.clipboardIsTempGroup)
39605339 tGroup.add/*Child*/(child);
39615340 else
3962
- GraphreeD.clipboard = child;
5341
+ Grafreed.clipboard = child;
39635342 }
39645343
39655344 }
3966
- if (GraphreeD.clipboardIsTempGroup)
3967
- GraphreeD.clipboard = tGroup;
5345
+
5346
+ if (Grafreed.clipboardIsTempGroup)
5347
+ Grafreed.clipboard = tGroup;
5348
+
39685349 if (cut)
39695350 {
39705351 ResetModel();
....@@ -3974,11 +5355,15 @@
39745355
39755356 void paste(boolean expand)
39765357 {
3977
- // if (GraphreeD.clipboard == null)
5358
+ if (Globals.REPLACEONMAKE)
5359
+ Save();
5360
+ boolean keep = Globals.REPLACEONMAKE;
5361
+ Globals.REPLACEONMAKE = false;
5362
+ // if (GrafreeD.clipboard == null)
39785363 // return;
39795364 boolean first = true;
39805365
3981
- if (GraphreeD.clipboardIsTempGroup)
5366
+ if (Grafreed.clipboardIsTempGroup)
39825367 {
39835368 Composite temp;
39845369
....@@ -3989,7 +5374,7 @@
39895374 temp = (Composite)Applet3D.clipboard.deepCopy();
39905375 */
39915376 Object3D elem;
3992
- for (Enumeration e = /*temp.children*/GraphreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
5377
+ for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
39935378 {
39945379 Object3D child = (Object3D)e.nextElement();
39955380
....@@ -4003,7 +5388,7 @@
40035388 else
40045389 elem = child.deepCopy(); // ?
40055390 child.parent = keepparent;
4006
- //if (GraphreeD.clipboardIsTempGroup && LA.isIdentity(elem.fromParent))
5391
+ //if (GrafreeD.clipboardIsTempGroup && LA.isIdentity(elem.fromParent))
40075392 // elem = elem.get(0);
40085393 makeSomething(elem, true); // ?? first);
40095394 //group.addChild(elem);
....@@ -4023,23 +5408,24 @@
40235408 //Object3D cb = Applet3D.clipboard;
40245409 //temp.addChild(cb);
40255410 //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());
5411
+ assert(Grafreed.clipboard.parent == null);
5412
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
5413
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
5414
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
5415
+ makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy());
40315416 else
4032
- makeSomething(expand?GraphreeD.clipboard.copyExpand():GraphreeD.clipboard.deepCopy());
4033
- GraphreeD.clipboard.get(0).parent = keepparent;
5417
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
5418
+ Grafreed.clipboard.get(0).parent = keepparent;
40345419 }
40355420
5421
+ Globals.REPLACEONMAKE = keep;
40365422 ResetModel();
40375423 refreshContents();
40385424 }
40395425
4040
- void pasteInto(boolean copyit)
5426
+ void pasteInto(boolean copyit, boolean clone)
40415427 {
4042
-// if (GraphreeD.clipboard == null)
5428
+// if (GrafreeD.clipboard == null)
40435429 // return;
40445430
40455431 if (group.selection.size() != 1)
....@@ -4066,15 +5452,22 @@
40665452 if (copyit)
40675453 {
40685454 // paste(false);
4069
- CloneClipboard(false); // sept 2014
5455
+ if (clone)
5456
+ {
5457
+ CloneClipboard(false); // sept 2014
5458
+ }
5459
+ else
5460
+ {
5461
+ paste(false);
5462
+ }
40705463 }
40715464 else
40725465 {
40735466 boolean first = true;
40745467
4075
- if (GraphreeD.clipboardIsTempGroup)
5468
+ if (Grafreed.clipboardIsTempGroup)
40765469 {
4077
- Composite temp = (Composite)GraphreeD.clipboard;
5470
+ Composite temp = (Composite)Grafreed.clipboard;
40785471 Object3D copy;
40795472 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
40805473 {
....@@ -4084,7 +5477,7 @@
40845477 }
40855478 } else
40865479 {
4087
- linkSomething(GraphreeD.clipboard); //.get(0));
5480
+ linkSomething(Grafreed.clipboard); //.get(0));
40885481 }
40895482 }
40905483 }
....@@ -4161,6 +5554,10 @@
41615554
41625555 void group(Object3D csg, boolean grab)
41635556 {
5557
+ if (Globals.REPLACEONMAKE)
5558
+ Save();
5559
+ boolean keep = Globals.REPLACEONMAKE;
5560
+ Globals.REPLACEONMAKE = false;
41645561 if (//false) // why??
41655562 !group.selection.isEmpty())
41665563 {
....@@ -4274,8 +5671,34 @@
42745671 //node.add(csg);
42755672 //makeSomething(node);
42765673 makeSomething(csg);
5674
+ Globals.REPLACEONMAKE = keep;
42775675 }
42785676
5677
+ void Ungroup(Object3D g)
5678
+ {
5679
+ if (Globals.REPLACEONMAKE)
5680
+ Save();
5681
+ boolean keep = Globals.REPLACEONMAKE;
5682
+ Globals.REPLACEONMAKE = false;
5683
+ if (g instanceof HiddenObject)
5684
+ {
5685
+ HiddenObject h = (HiddenObject) g;
5686
+
5687
+ for (int i=0; i<h.ActualSize(); i++)
5688
+ {
5689
+ objEditor.makeSomething(h.get(i), false);
5690
+ }
5691
+ }
5692
+ else
5693
+ {
5694
+ for (int i=0; i<g.Size(); i++)
5695
+ {
5696
+ objEditor.makeSomething(g.get(i), false);
5697
+ }
5698
+ }
5699
+ Globals.REPLACEONMAKE = keep;
5700
+ }
5701
+
42795702 void ungroup()
42805703 {
42815704 /*
....@@ -4469,21 +5892,6 @@
44695892 }
44705893 */
44715894
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
-
44875895 /*
44885896 public void Callback(Object obj)
44895897 {
....@@ -4507,26 +5915,9 @@
45075915 }
45085916 */
45095917
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
-
45275918 String GetFile(String dialogName)
45285919 {
4529
- if (GraphreeD.standAlone)
5920
+ if (Grafreed.standAlone)
45305921 {
45315922 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
45325923 browser.show();
....@@ -4590,10 +5981,49 @@
45905981 cButton flashSelectionButton;
45915982 cButton editButton;
45925983 cButton uneditButton;
5984
+ JCheckBox allParamsButton;
45935985 cButton clearpanelButton;
4594
- cButton allParamsButton;
45955986 cButton unselectButton;
45965987
5988
+ cButton restoreCameraButton;
5989
+
5990
+ cButton saveButton;
5991
+ cButton oneStepButton;
5992
+
5993
+ cButton groupButton;
5994
+ cButton ungroupButton;
5995
+ cButton compositeButton;
5996
+ cButton switchButton;
5997
+ cButton loopButton;
5998
+ cButton textureButton;
5999
+
6000
+ cButton skybox1Button;
6001
+ cButton skybox2Button;
6002
+ cButton skybox3Button;
6003
+ cButton skybox4Button;
6004
+ cButton skybox5Button;
6005
+ cButton skybox6Button;
6006
+ cButton skybox7Button;
6007
+
6008
+ cButton skybox11Button;
6009
+ cButton skybox12Button;
6010
+ cButton skybox13Button;
6011
+ cButton skybox14Button;
6012
+ cButton skybox15Button;
6013
+ cButton skybox16Button;
6014
+ cButton skybox17Button;
6015
+
6016
+ cButton gridButton;
6017
+ cButton boxButton;
6018
+ cButton sphereButton;
6019
+ cButton coneButton;
6020
+ cButton torusButton;
6021
+ cButton superButton;
6022
+ cButton kleinButton;
6023
+ cButton particlesButton;
6024
+ cButton overlayButton;
6025
+ cButton lightButton;
6026
+
45976027 cButton screenfitButton;
45986028 cButton screenfitpointButton;
45996029 cButton snapobjectButton;
....@@ -4605,14 +6035,6 @@
46056035
46066036 cButton setsupportButton;
46076037
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
-
46166038 //
46176039 //Composite
46186040 Object3D // to do !!
....@@ -4622,9 +6044,11 @@
46226044 //JTree jTree;
46236045 private MenuItem lookAtItem;
46246046 private MenuItem lookFromItem;
4625
- private MenuItem switchItem;
6047
+ private MenuItem switchViewItem;
46266048 private MenuItem cutItem;
4627
- private MenuItem duplicateItem;
6049
+ private MenuItem undoItem;
6050
+ private MenuItem redoItem;
6051
+ private JMenuItem duplicateItem;
46286052 private MenuItem cloneItem;
46296053 private MenuItem cloneSupportItem;
46306054 private MenuItem overwriteGeoItem;
....@@ -4635,8 +6059,9 @@
46356059 private MenuItem resetsupportItem;
46366060 private MenuItem resetreferencesItem;
46376061 private MenuItem linkverticesItem;
6062
+ private MenuItem relinkverticesItem;
46386063 private MenuItem setMasterItem;
4639
- private MenuItem resetMeshItem;
6064
+ private MenuItem resetAllItem;
46406065 private MenuItem stepAllItem;
46416066 private MenuItem revertMeshItem;
46426067 private MenuItem poseMeshItem;
....@@ -4647,14 +6072,17 @@
46476072 private MenuItem mergeGeometriesItem;
46486073 private MenuItem copyItem;
46496074 private MenuItem pasteItem;
6075
+ private MenuItem pasteIntoItem;
46506076 private MenuItem pasteLinkItem;
46516077 private MenuItem pasteCloneItem;
46526078 private MenuItem pasteExpandItem;
4653
- private MenuItem clearItem;
6079
+ private MenuItem deleteItem;
46546080 private MenuItem clearAllItem;
46556081 private MenuItem genUVItem;
6082
+ private MenuItem genNormalsMESHItem;
46566083 private MenuItem genNormalsCADItem;
46576084 private MenuItem genNormalsORGANItem;
6085
+ private MenuItem genNormalsMINEItem;
46586086 private MenuItem stripifyItem;
46596087 private MenuItem unstripifyItem;
46606088 private MenuItem trimItem;
....@@ -4683,6 +6111,10 @@
46836111 private MenuItem showleavesItem;
46846112 private MenuItem markleavesItem;
46856113 private MenuItem unmarkleavesItem;
6114
+ private MenuItem rewindleavesItem;
6115
+ private MenuItem unrewindleavesItem;
6116
+ private MenuItem randomleavesItem;
6117
+ private MenuItem unrandomleavesItem;
46866118
46876119 private MenuItem flipVItem;
46886120 private MenuItem unflipVItem;
....@@ -4694,14 +6126,17 @@
46946126 private MenuItem panoTexturesItem;
46956127
46966128 private MenuItem resetCentroidItem;
4697
- private MenuItem transformgeometryItem;
6129
+ private MenuItem resetCentroidXZItem;
46986130 private MenuItem resetTransformItem;
6131
+ private MenuItem transformGeometryItem;
6132
+ private MenuItem transformChildrenItem;
6133
+ private MenuItem hideItem;
46996134 private MenuItem grabItem;
47006135 private MenuItem backItem;
47016136 private MenuItem frontItem;
47026137 private MenuItem cameraItem;
47036138 private MenuItem compositeItem;
4704
- private MenuItem randomItem;
6139
+ private MenuItem switchItem;
47056140 private MenuItem physicsItem;
47066141 private MenuItem frameselectorItem;
47076142 private MenuItem scriptNodeItem;
....@@ -4716,6 +6151,7 @@
47166151
47176152 private MenuItem resetParentItem;
47186153 private MenuItem repairParentItem;
6154
+ private MenuItem repairShadowItem;
47196155 private MenuItem sortbysizeItem;
47206156 private MenuItem sortbynameItem;
47216157
....@@ -4724,20 +6160,25 @@
47246160 private MenuItem attachBumpItem;
47256161 private MenuItem detachBumpItem;
47266162 private MenuItem pigmentBumpItem;
6163
+ private MenuItem embedTexturesItem;
6164
+ private MenuItem deEmbedTexturesItem;
47276165
47286166 private MenuItem particleItem;
47296167 private MenuItem ragdollItem;
47306168 private MenuItem ragdoll2Item;
6169
+ private MenuItem heightFieldItem;
6170
+ private MenuItem textureFieldItem;
47316171 private MenuItem gridItem;
47326172 private MenuItem rectoidItem;
47336173 private MenuItem ellipsoidItem;
47346174 private MenuItem coneItem;
47356175 private MenuItem torusItem;
47366176 private MenuItem superItem;
6177
+ private MenuItem kleinItem;
47376178 private MenuItem blobItem;
47386179 private MenuItem latheItem;
47396180 private MenuItem bezierItem;
4740
- private MenuItem checkerItem;
6181
+ private MenuItem overlayItem;
47416182 private MenuItem meshItem;
47426183 // private MenuItem meshGroupItem;
47436184 private MenuItem springItem;
....@@ -4746,6 +6187,7 @@
47466187 private MenuItem csgItem;
47476188 private MenuItem templateItem;
47486189 private MenuItem textureItem;
6190
+ private MenuItem billboardItem;
47496191 private MenuItem shadowXItem;
47506192 private MenuItem shadowYItem;
47516193 private MenuItem shadowZItem;
....@@ -4758,11 +6200,6 @@
47586200 private MenuItem doubleItem;
47596201 private MenuItem tripleItem;
47606202
4761
- private MenuItem importGFDItem;
4762
- private MenuItem importVRMLX3DItem;
4763
- private MenuItem import3DSItem;
4764
- private MenuItem importOBJItem;
4765
-
47666203 private MenuItem computeAOItem;
47676204 private MenuItem recompileItem;
47686205 private MenuItem editScriptItem;
....@@ -4772,4 +6209,8 @@
47726209 private MenuItem analyzeItem;
47736210 private MenuItem dumpItem;
47746211 //boolean freezemodel = false;
6212
+
6213
+ Menu cameraMenu;
6214
+ MenuItem editCameraItem;
6215
+ MenuItem restoreCameraItem;
47756216 }