Normand Briere
2019-08-01 650ecb410e75381cf73a4139325741b36d84d94e
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("Duplicate current 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 version (undo latest change)");
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 version (save latest change)");
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,163 @@
6131183 dgr.addDragGestureListener(this);
6141184 }catch(Exception e) {}
6151185 */
616
- radio.layout = sevenButton;
1186
+ radio.layout = threeButton; // sixButton;
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
+ panel.add(minshaderCB = new cCheckBox("Min shader", Globals.MINSHADER)); //, constraints);
1241
+ minshaderCB.setToolTipText("Minimal fast shader");
1242
+ minshaderCB.addItemListener(this);
1243
+
1244
+// constraints.gridy += 1;
1245
+// panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
1246
+// speakerMocapCB.addItemListener(this);
1247
+
1248
+ panel.Return();
1249
+
1250
+ if (false)
1251
+ {
1252
+ // handled in scripts
1253
+ //constraints.gridy += 1;
1254
+ panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints);
1255
+ speakerCameraCB.addItemListener(this);
1256
+
1257
+ //constraints.gridy += 1;
1258
+ panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints);
1259
+ speakerFocusCB.addItemListener(this);
1260
+
1261
+ //constraints.gridy += 1;
1262
+ panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
1263
+ smoothfocusCB.addItemListener(this);
1264
+ panel.Return();
1265
+ }
1266
+
1267
+//constraints.gridx += 1;
1268
+//panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
1269
+// debugCB.addItemListener(this);
1270
+
1271
+ panel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
1272
+ trackCB.setToolTipText("Enable tracking target");
1273
+ trackCB.addItemListener(this);
1274
+
1275
+ panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
1276
+ oeilCB.setToolTipText("Move camera when tracking");
1277
+ oeilCB.addItemListener(this);
1278
+
1279
+ panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints);
1280
+ shadowCB.setToolTipText("When live compute shadows");
1281
+ shadowCB.addItemListener(this);
1282
+
1283
+ panel.Return();
1284
+ panel.add(toggleTextureCB = new cCheckBox("Textures", CameraPane.textureon)); //, constraints);
1285
+ toggleTextureCB.setToolTipText("Load textures");
1286
+ toggleTextureCB.addItemListener(this);
1287
+
1288
+ panel.add(toggleSwitchCB = new cCheckBox("Switch", CameraPane.SWITCH)); //, constraints);
1289
+ toggleSwitchCB.setToolTipText("Choose a single item");
1290
+ toggleSwitchCB.addItemListener(this);
1291
+
1292
+ panel.add(autokeepCB = new cCheckBox("Auto-replace", Globals.REPLACEONMAKE)); //, constraints);
1293
+ autokeepCB.setToolTipText("On structure change");
1294
+ autokeepCB.addItemListener(this);
1295
+
1296
+ panel.Return();
1297
+ if (Globals.ADVANCED)
1298
+ {
1299
+ panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
1300
+ lookAtCB.setToolTipText("Look-at target");
1301
+ lookAtCB.addItemListener(this);
1302
+ }
1303
+
1304
+ }
1305
+
1306
+ cGridBag fill = new cGridBag();
1307
+ fill.preferredHeight = 200;
1308
+ cGridBag fill2 = new cGridBag();
1309
+ fill2.preferredHeight = 200;
1310
+ cGridBag fill3 = new cGridBag();
1311
+ fill3.preferredHeight = 200;
1312
+
1313
+ panel.add(fill);
1314
+ panel.add(fill2);
1315
+ panel.add(fill3);
1316
+
1317
+ }
6191318
6201319 void EditObject(Object3D obj)
6211320 {
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();
1321
+ cRadio radioButton = new cRadio(obj.name);
1322
+
1323
+ // June 2019. Patch to avoid bug with transparency.
1324
+ radioButton.hadMaterial = obj.material != null;
1325
+ if (!radioButton.hadMaterial)
1326
+ {
1327
+ obj.material = new cMaterial();
1328
+ }
1329
+
1330
+ radioButton.SetObject(obj);
1331
+ radioButton.layout = threeButton; // sixButton;
1332
+ radioButton.SetCamera(cameraView.renderCamera, false);
1333
+ radioButton.addActionListener(this);
1334
+ radioPanel.add(radioButton);
1335
+ buttonGroup.add(radioButton);
1336
+ radioButton.doClick();
6301337 }
1338
+
6311339 void SetupViews(ObjEditor oe)
6321340 {
1341
+ theFrame = this;
1342
+
6331343 oe.SetupViews();
6341344
6351345 System.out.println("SetupViews");
....@@ -638,22 +1348,30 @@
6381348 /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this);
6391349 }
6401350
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;
1351
+ cToggleButton liveCB;
1352
+ cCheckBox supportCB;
1353
+ cCheckBox localCB;
1354
+ cCheckBox crowdCB;
1355
+ cCheckBox smoothCB;
1356
+ cCheckBox minshaderCB;
1357
+
1358
+ cToggleButton fastCB;
1359
+ cCheckBox slowCB;
1360
+ cCheckBox boxCB;
1361
+ cCheckBox zoomBoxCB;
1362
+ cCheckBox freezeCB;
1363
+ //cToggleButton trackCB;
1364
+ cCheckBox trackCB;
1365
+ cCheckBox smoothfocusCB;
6511366 // JCheckBox speakerMocapCB;
652
- JCheckBox speakerCameraCB;
653
- JCheckBox speakerFocusCB;
654
- JCheckBox debugCB;
655
- JCheckBox oeilCB;
656
- JCheckBox lookAtCB;
1367
+ cCheckBox speakerCameraCB;
1368
+ cCheckBox speakerFocusCB;
1369
+ cCheckBox debugCB;
1370
+
1371
+ cCheckBox oeilCB;
1372
+ cCheckBox shadowCB;
1373
+ cCheckBox autokeepCB;
1374
+ cCheckBox lookAtCB;
6571375
6581376 // static int COLOR = 1;
6591377 // static int MATERIAL = 2;
....@@ -661,9 +1379,9 @@
6611379
6621380 int dropAttributes = Object3D.COLOR | Object3D.MATERIAL;
6631381
664
- JCheckBox colorCB;
665
- JCheckBox materialCB;
666
- JCheckBox textureCB;
1382
+ cCheckBox colorCB;
1383
+ cCheckBox materialCB;
1384
+ cCheckBox textureCB;
6671385
6681386 public void itemStateChanged(ItemEvent e)
6691387 {
....@@ -688,10 +1406,10 @@
6881406 dropAttributes |= Object3D.TEXTURE;
6891407 else
6901408 dropAttributes &= ~Object3D.TEXTURE;
691
- }
692
- else if(e.getSource() == liveCB)
1409
+ } else if(e.getSource() == liveCB)
6931410 {
6941411 cameraView.ToggleLive();
1412
+ refreshContents(false);
6951413 }
6961414 else if(e.getSource() == supportCB)
6971415 {
....@@ -707,6 +1425,12 @@
7071425 {
7081426 cameraView.ToggleInertia();
7091427 cameraView.repaint();
1428
+ }
1429
+ else if(e.getSource() == minshaderCB)
1430
+ {
1431
+ Globals.MINSHADER ^= true;
1432
+ cameraView.programInitialized = false;
1433
+ cameraView.repaint();
7101434 }
7111435 else if(e.getSource() == localCB)
7121436 {
....@@ -726,6 +1450,10 @@
7261450 Recompile();
7271451 cameraView.repaint();
7281452 // refreshContents();
1453
+ }
1454
+ else if(e.getSource() == zoomBoxCB)
1455
+ {
1456
+ cameraView.ToggleZoomBoxMode();
7291457 }
7301458 else if(e.getSource() == smoothfocusCB)
7311459 {
....@@ -752,6 +1480,18 @@
7521480 {
7531481 cameraView.ToggleOeil();
7541482 }
1483
+ else if(e.getSource() == shadowCB)
1484
+ {
1485
+ Globals.COMPUTESHADOWWHENLIVE ^= true;
1486
+ }
1487
+ else if(e.getSource() == freezeCB)
1488
+ {
1489
+ Globals.FREEZEONMOVE ^= true;
1490
+ }
1491
+ else if(e.getSource() == autokeepCB)
1492
+ {
1493
+ Globals.REPLACEONMAKE ^= true;
1494
+ }
7551495 else if(e.getSource() == lookAtCB)
7561496 {
7571497 cameraView.ToggleLookAt();
....@@ -768,7 +1508,8 @@
7681508
7691509 /**/
7701510 //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this);
771
- TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1511
+ //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1512
+ TreePath path = objEditor.jTree.getSelectionPath();
7721513 if ((path == null) || (path.getPathCount() <= 1)) {
7731514 // We can't move the root node or an empty selection
7741515 return;
....@@ -831,8 +1572,6 @@
8311572 }
8321573 }
8331574
834
- String string = (String) object;
835
-
8361575 System.out.println("Transfer = " + object + "; drop : " + target);
8371576 // if( object instanceof java.io.File[])
8381577 // {
....@@ -840,7 +1579,11 @@
8401579 // objEditor.DropFile((java.io.File[]) object, true);
8411580 // return;
8421581 // }
843
- if (string.charAt(0) == '/')
1582
+
1583
+ String string = object.toString();
1584
+
1585
+ // File path for Mac and Windows
1586
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
8441587 {
8451588 // file(s)
8461589 String[] names = string.split("\n");
....@@ -867,7 +1610,7 @@
8671610
8681611 flashIt = false;
8691612 CameraPane pane = (CameraPane) target;
870
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1613
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
8711614 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
8721615
8731616 if (group.selection.size() == 1)
....@@ -883,23 +1626,33 @@
8831626
8841627 assert target == objEditor.jTree;
8851628 TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y);
1629
+ Object3D destinationLeaf;
8861630 try {
887
- Object3D dummy = (Composite) destinationPath.getLastPathComponent();
1631
+ destinationLeaf = (Composite) destinationPath.getLastPathComponent();
8881632 } catch (Exception e) {
8891633 System.out.println("destinationPath : " + destinationPath);
8901634 return;
8911635 }
8921636
893
- if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1637
+ for (int i=group.selection.size(); --i>=0;)
8941638 {
1639
+ Object3D child = (Object3D)group.selection.elementAt(i);
1640
+
1641
+ // Cannot move into itself
1642
+ if (child == destinationLeaf)
1643
+ return;
1644
+ }
1645
+
1646
+// june 2019 if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1647
+// {
8951648 loadClipboard(true);
8961649 objEditor.jTree.setSelectionPath(destinationPath);
897
- pasteInto(false);
898
- } else {
899
- loadClipboard(false);
900
- objEditor.jTree.setSelectionPath(destinationPath);
901
- pasteInto(false); // true); // ???
902
- }
1650
+ pasteInto(false, false);
1651
+// } else {
1652
+// loadClipboard(false);
1653
+// objEditor.jTree.setSelectionPath(destinationPath);
1654
+// pasteInto(false, false); // true); // ???
1655
+// }
9031656 }
9041657 public void dropActionChanged(DropTargetDragEvent dtde)
9051658 // Called if the user has modified the current drop gesture
....@@ -1002,90 +1755,109 @@
10021755
10031756 void buildCreateMenu(Menu menu)
10041757 {
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);
1758
+ //heightFieldItem = menu.add(new MenuItem("Height Field"));
1759
+ //heightFieldItem.addActionListener(this);
1760
+// gridItem = menu.add(new MenuItem("Grid"));
1761
+// gridItem.addActionListener(this);
1762
+// rectoidItem = menu.add(new MenuItem("Box"));
1763
+// rectoidItem.addActionListener(this);
1764
+// ellipsoidItem = menu.add(new MenuItem("Sphere"));
1765
+// ellipsoidItem.addActionListener(this);
1766
+// coneItem = menu.add(new MenuItem("Cone"));
1767
+// coneItem.addActionListener(this);
1768
+// torusItem = menu.add(new MenuItem("Torus"));
1769
+// torusItem.addActionListener(this);
1770
+// superItem = menu.add(new MenuItem("Superellipsoid"));
1771
+// superItem.addActionListener(this);
1772
+
1773
+ cameraItem = menu.add(new MenuItem("Camera"));
1774
+ cameraItem.addActionListener(this);
1775
+
1776
+ if (!Globals.ADVANCED)
1777
+ {
1778
+ kleinItem = menu.add(new MenuItem("Klein Bottle"));
1779
+ kleinItem.addActionListener(this);
1780
+ }
1781
+
1782
+// particleItem = menu.add(new MenuItem("Particle system"));
1783
+// particleItem.addActionListener(this);
1784
+ if (Globals.ADVANCED)
1785
+ {
10191786 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10201787 ragdollItem.addActionListener(this);
10211788 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10221789 ragdoll2Item.addActionListener(this);
1790
+ }
10231791 menu.add("-");
1024
- meshItem = menu.add(new MenuItem("Mesh"));
1792
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10251793 meshItem.addActionListener(this);
10261794 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10271795 // meshGroupItem.addActionListener(this);
1796
+ if (Globals.ADVANCED)
1797
+ {
10281798 springItem = menu.add(new MenuItem("Spring"));
10291799 springItem.addActionListener(this);
10301800 flagItem = menu.add(new MenuItem("Flag"));
10311801 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);
10361802 blobItem = menu.add(new MenuItem("Blob"));
10371803 blobItem.addActionListener(this);
10381804 latheItem = menu.add(new MenuItem("Lathe"));
10391805 latheItem.addActionListener(this);
1040
- lightItem = menu.add(new MenuItem("Light"));
1041
- lightItem.addActionListener(this);
1806
+ }
1807
+ bezierItem = menu.add(new MenuItem("Bezier Patch"));
1808
+ bezierItem.addActionListener(this);
1809
+// overlayItem = menu.add(new MenuItem("Overlay"));
1810
+// overlayItem.addActionListener(this);
1811
+// lightItem = menu.add(new MenuItem("Light"));
1812
+// lightItem.addActionListener(this);
10421813 menu.add("-");
10431814 //superLoopItem = menu.add(new MenuItem("Super Loop"));
10441815 //superLoopItem.addActionListener(this);
1045
- loopItem = menu.add(new MenuItem("Loop"));
1046
- loopItem.addActionListener(this);
1816
+// loopItem = menu.add(new MenuItem("Loop"));
1817
+// loopItem.addActionListener(this);
10471818 doubleItem = menu.add(new MenuItem("Fork"));
10481819 doubleItem.addActionListener(this);
1820
+ if (Globals.ADVANCED)
1821
+ {
10491822 tripleItem = menu.add(new MenuItem("Trident"));
10501823 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);
1824
+ }
10601825 }
10611826
10621827 void buildToolsMenu(Menu menu)
10631828 {
10641829 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
10651830 animationItem.addItemListener(this);
1066
- animationItem.setState(CameraPane.ANIMATION);
1831
+ animationItem.setState(Globals.ANIMATION);
1832
+
1833
+ menu.add(archiveItem = new MenuItem("Archive3D..."));
1834
+ archiveItem.addActionListener(this);
10671835
10681836 menu.add("-");
10691837 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
10701838 parseverticesItem.addActionListener(this);
1071
- alignItem = menu.add(new MenuItem("Align"));
1839
+ textureFieldItem = menu.add(new MenuItem("Texture Field"));
1840
+ textureFieldItem.addActionListener(this);
1841
+ alignItem = menu.add(new MenuItem("Align Objects"));
10721842 alignItem.addActionListener(this);
1073
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1074
- mirrorItem.addActionListener(this);
10751843 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
10761844 reduceMorphItem.addActionListener(this);
10771845 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
10781846 reduce34MorphItem.addActionListener(this);
1079
-
1080
- menu.add(computeAOItem = new MenuItem("Compute AO"));
1081
- computeAOItem.addActionListener(this);
10821847 menu.add("-");
1083
-
10841848 menu.add(memoryItem = new MenuItem("Memory Usage"));
10851849 memoryItem.addActionListener(this);
1850
+ menu.add(computeAOItem = new MenuItem("Compute AO"));
1851
+ computeAOItem.addActionListener(this);
1852
+
1853
+ if (Globals.ADVANCED)
1854
+ {
1855
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1856
+ mirrorItem.addActionListener(this);
1857
+ menu.add("-");
10861858 menu.add(analyzeItem = new MenuItem("Analyze"));
10871859 analyzeItem.addActionListener(this);
1088
- menu.add(dumpItem = new MenuItem("Dump"));
1860
+ menu.add(dumpItem = new MenuItem("Print"));
10891861 dumpItem.addActionListener(this);
10901862 // menu.add(pathItem = new MenuItem("From-to path"));
10911863 // pathItem.addActionListener(this);
....@@ -1094,6 +1866,8 @@
10941866 resetParentItem.addActionListener(this);
10951867 repairParentItem = menu.add(new MenuItem("Repair Parent"));
10961868 repairParentItem.addActionListener(this);
1869
+ repairShadowItem = menu.add(new MenuItem("Repair Shadow"));
1870
+ repairShadowItem.addActionListener(this);
10971871 menu.add(invariantsItem = new MenuItem("Invariants"));
10981872 invariantsItem.addActionListener(this);
10991873 menu.add(recompileItem = new MenuItem("Recompile"));
....@@ -1101,6 +1875,7 @@
11011875 menu.add("-");
11021876 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11031877 editScriptItem.addActionListener(this);
1878
+ }
11041879 }
11051880
11061881 void ScreenFit()
....@@ -1223,9 +1998,34 @@
12231998 shadow.material = new cMaterial(obj.material);
12241999 shadow.material.diffuse = 0.0001f;
12252000 shadow.material.specular = 0.0001f;
2001
+ //shadow.projectedVertices[1].x = 300;
12262002
12272003 makeSomething(shadow);
12282004 }
2005
+
2006
+ private void ClearUnpinned()
2007
+ {
2008
+ //for (Object3D obj : listUI)
2009
+ for (int i=listUI.size(); --i>=0;)
2010
+ {
2011
+ Object3D obj = listUI.elementAt(i);
2012
+ if (!obj.pinned)
2013
+ {
2014
+ obj.CloseUI();
2015
+ listUI.remove(i);
2016
+ }
2017
+ }
2018
+ }
2019
+
2020
+ private void EditElement(Object3D elem, boolean newWindow)
2021
+ {
2022
+ // if (!(elem instanceof Composite))
2023
+ // newWindow = false;
2024
+ listUI.add(elem);
2025
+ elem.openEditWindow(this, newWindow); //, false);
2026
+ System.out.println("edit : " + elem);
2027
+ elem.editWindow.refreshContents(true); // ? new
2028
+ }
12292029
12302030 /**
12312031 * applyExample
....@@ -1429,9 +2229,9 @@
14292229
14302230 void Overwrite(int mask)
14312231 {
1432
- if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
2232
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14332233 {
1434
- Object3D content = GraphreeD.clipboard.get(0);
2234
+ Object3D content = Grafreed.clipboard.get(0);
14352235
14362236 if (content instanceof cGroup && ((cGroup)content).transientlink )
14372237 content = ((cGroup)content).get(0);
....@@ -1454,6 +2254,7 @@
14542254 //
14552255 public void actionPerformed(ActionEvent event) // , Object arg)
14562256 {
2257
+ Object source = event.getSource();
14572258 /*
14582259 if (event.getSource() == nameField)
14592260 {
....@@ -1465,11 +2266,11 @@
14652266 }
14662267 else
14672268 */
1468
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
2269
+ if (source == lookAtItem || source == lookFromItem)
14692270 {
14702271 ScreenFit();
14712272 } else
1472
- if (event.getSource() == switchItem)
2273
+ if (source == switchViewItem)
14732274 {
14742275 cVector v1 = new cVector();
14752276 cVector v2 = new cVector();
....@@ -1478,11 +2279,11 @@
14782279 objEditor.cameraView.renderCamera.setAim(v2, v1);
14792280 objEditor.cameraView.repaint();
14802281 } else
1481
- if (event.getSource() == rectoidItem)
2282
+ if (source == rectoidItem || source == boxButton)
14822283 {
14832284 makeSomething(new Box());
14842285 } else
1485
- if (event.getSource() == particleItem)
2286
+ if (source == particleItem || source == particlesButton)
14862287 {
14872288 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
14882289 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1503,9 +2304,9 @@
15032304 applyExample(particleGeom, "SMOKE");
15042305 makeSomething(particleGeom);
15052306 } else
1506
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
2307
+ if (source == ragdollItem || source == ragdoll2Item)
15072308 {
1508
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
2309
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15092310
15102311 ragdoll.toParent = LA.newMatrix();
15112312 ragdoll.fromParent = LA.newMatrix();
....@@ -1521,27 +2322,71 @@
15212322 makeSomething(ragdoll);
15222323 //makeSomething(new VehicleDemo());
15232324 } else
1524
- if (event.getSource() == gridItem)
2325
+ /*
2326
+ */
2327
+ if (source == heightFieldItem)
2328
+ {
2329
+ Object3D obj = new Object3D();
2330
+
2331
+ obj.CreateMaterial();
2332
+ obj.bRep = new BoundaryRep();
2333
+
2334
+ obj.bRep.CreateMesh(new iHeightField()
2335
+ {
2336
+ public double f(double x, double y)
2337
+ {
2338
+ // The Mandelbrot set is represented by coloring
2339
+ // each point (x,y) according to the number of
2340
+ // iterations it takes before the while loop in
2341
+ // this method ends. For points that are actually
2342
+ // in the Mandelbrot set, or very close to it, the
2343
+ // count will reach the maximum value, 80. These
2344
+ // points will be colored purple. All other colors
2345
+ // represent points that are definitely NOT in the set.
2346
+ x -= 600;
2347
+ y -= 500;
2348
+ x /= 200;
2349
+ y /= 200;
2350
+ int count = 0;
2351
+ double zx = x;
2352
+ double zy = y;
2353
+ while (count < 80 && Math.abs(x) < 100 && Math.abs(zy) < 100) {
2354
+ double new_zx = zx*zx - zy*zy + x;
2355
+ zy = 2*zx*zy + y;
2356
+ zx = new_zx;
2357
+ count++;
2358
+ }
2359
+ return count; // Math.sqrt(count);
2360
+ }
2361
+ }, 1000,1000);
2362
+
2363
+ makeSomething(obj);
2364
+ } else
2365
+ if (source == gridItem || source == gridButton)
15252366 {
15262367 makeSomething(new Grid());
15272368 } else
1528
- if (event.getSource() == ellipsoidItem)
2369
+ if (source == ellipsoidItem || source == sphereButton)
15292370 {
15302371 makeSomething(new Sphere());
15312372 } else
1532
- if (event.getSource() == coneItem)
2373
+ if (source == coneItem || source == coneButton)
15332374 {
15342375 makeSomething(new Cone());
15352376 } else
1536
- if (event.getSource() == torusItem)
2377
+ if (source == torusItem || source == torusButton)
15372378 {
15382379 makeSomething(new Torus());
15392380 } else
1540
- if (event.getSource() == superItem)
2381
+ if (source == superItem || source == superButton)
15412382 {
15422383 makeSomething(new Superellipsoid());
15432384 } else
1544
- if (event.getSource() == blobItem)
2385
+ if (source == kleinItem || source == kleinButton)
2386
+ {
2387
+ makeSomething(new Klein());
2388
+ } else
2389
+ if (source == blobItem)
15452390 {
15462391 Blob blob = new Blob();
15472392 BlobComponent comp = new BlobComponent();
....@@ -1549,15 +2394,15 @@
15492394 //blob.retile();
15502395 makeSomething(blob);
15512396 } else
1552
- if (event.getSource() == latheItem)
2397
+ if (source == latheItem)
15532398 {
15542399 makeSomething(new Lathe());
15552400 } else
1556
- if (event.getSource() == bezierItem)
2401
+ if (source == bezierItem)
15572402 {
15582403 makeSomething(new BezierSurface());
15592404 } else
1560
- if (event.getSource() == checkerItem)
2405
+ if (source == overlayItem || source == overlayButton)
15612406 {
15622407 /*
15632408 Object3D obj = new BezierSurface(5,8);
....@@ -1570,9 +2415,9 @@
15702415 LA.matConcat(obj.toParent, cameraView.renderCamera.fromParent, obj.toParent);
15712416 LA.matInvert(obj.toParent, obj.fromParent);
15722417 */
1573
- makeSomething(new CheckerIG());
2418
+ makeSomething(new Checker());
15742419 } else
1575
- if (event.getSource() == meshItem)
2420
+ if (source == meshItem)
15762421 {
15772422 Object3D itemtomake = new Object3D();
15782423 Object3D child;
....@@ -1593,35 +2438,52 @@
15932438 makeSomething(child);
15942439 }
15952440 } else
1596
- if (event.getSource() == springItem)
2441
+ if (source == springItem)
15972442 {
15982443 cSpring s = new cSpring();
15992444 s.setup();
16002445 makeSomething(s);
16012446 } else
1602
- if (event.getSource() == flagItem)
2447
+ if (source == flagItem)
16032448 {
16042449 cSpring s = new cFlag();
16052450 s.setup();
16062451 makeSomething(s);
16072452 } else
1608
- if (event.getSource() == lightItem)
2453
+ if (source == lightItem || source == lightButton)
16092454 {
16102455 makeSomething(new Light());
16112456 } else
1612
- if (event.getSource() == csgItem)
2457
+// if (source == skybox1Button ||
2458
+// source == skybox2Button ||
2459
+// source == skybox3Button ||
2460
+// source == skybox4Button ||
2461
+// source == skybox5Button ||
2462
+// source == skybox6Button ||
2463
+// source == skybox7Button ||
2464
+// source == skybox11Button ||
2465
+// source == skybox12Button ||
2466
+// source == skybox13Button ||
2467
+// source == skybox14Button ||
2468
+// source == skybox15Button ||
2469
+// source == skybox16Button ||
2470
+// source == skybox17Button)
2471
+// {
2472
+// ChangeSkybox(source);
2473
+// } else
2474
+ if (source == csgItem)
16132475 {
16142476 group(new CSG());
16152477 } else
1616
- if (event.getSource() == templateItem)
2478
+ if (source == templateItem)
16172479 {
16182480 group(new cTemplate());
16192481 } else
1620
- if (event.getSource() == attributeItem)
2482
+ if (source == attributeItem)
16212483 {
16222484 makeSomething(new Attribute());
16232485 } else
1624
- if (event.getSource() == pointflowItem)
2486
+ if (source == pointflowItem)
16252487 {
16262488 makeSomething(new PointFlow());
16272489 } else
....@@ -1633,7 +2495,7 @@
16332495 } else
16342496 */
16352497
1636
- if (event.getSource() == superLoopItem)
2498
+ if (source == superLoopItem)
16372499 {
16382500 Composite g = new cGroup();
16392501 for (int i=0; i<15; i++)
....@@ -1655,30 +2517,30 @@
16552517
16562518 group(g);
16572519 } else
1658
- if (event.getSource() == loopItem)
2520
+ if (source == loopItem || source == loopButton)
16592521 {
16602522 Composite csg = new GroupLeaf();
16612523 csg.count = 5;
16622524 group(csg);
1663
- Composite child = new cGroup();
2525
+ Composite child = new cGroup("Branch");
16642526 csg.addChild(child);
16652527 child.addChild(csg);
16662528 } else
1667
- if (event.getSource() == doubleItem)
2529
+ if (source == doubleItem)
16682530 {
1669
- Composite csg = new GroupLeaf();
2531
+ Composite csg = new GroupLeaf("Fork");
16702532 csg.count = 5;
16712533 group(csg);
1672
- Composite child = new cGroup();
2534
+ Composite child = new cGroup("Branch A");
16732535 csg.addChild(child);
16742536 child.addChild(csg);
1675
- child = new cGroup();
2537
+ child = new cGroup("Branch B");
16762538 csg.addChild(child);
16772539 child.addChild(csg);
16782540 } else
1679
- if (event.getSource() == tripleItem)
2541
+ if (source == tripleItem)
16802542 {
1681
- Composite csg = new GroupLeaf();
2543
+ Composite csg = new GroupLeaf("Trident");
16822544 csg.count = 4;
16832545 group(csg);
16842546 Composite child = new cGroup();
....@@ -1691,73 +2553,98 @@
16912553 csg.addChild(child);
16922554 child.addChild(csg);
16932555 } else
1694
-
1695
- if (event.getSource() == importGFDItem)
2556
+ if (source == computeAOItem)
16962557 {
1697
- ImportGFD();
2558
+ Globals.drawMode = CameraPane.OCCLUSION;
2559
+ cameraView.repaint();
16982560 } 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)
2561
+ if (source == recompileItem)
17172562 {
17182563 Recompile();
17192564 refreshContents();
17202565 } else
1721
- if (event.getSource() == editScriptItem)
2566
+ if (source == editScriptItem)
17222567 {
17232568 OpenDialog();
17242569 refreshContents();
17252570 } else
1726
- if (event.getSource() == invariantsItem)
2571
+ if (source == invariantsItem)
17272572 {
17282573 System.out.println("Invariants:");
1729
- GraphreeD.theApplet3D.universe.invariants();
2574
+ Grafreed.grafreeD.universe.invariants();
17302575 } else
1731
- if (event.getSource() == memoryItem)
2576
+ if (source == memoryItem)
17322577 {
17332578 //System.out.println("Invariants:");
17342579 PrintMemory();
17352580 } else
1736
- if (event.getSource() == pathItem)
2581
+ if (source == pathItem)
17372582 {
17382583 PrintPath();
17392584 } else
1740
- if (event.getSource() == analyzeItem)
2585
+ if (source == analyzeItem)
17412586 {
17422587 AnalyzeObject();
17432588 } else
1744
- if (event.getSource() == dumpItem)
2589
+ if (source == dumpItem)
17452590 {
17462591 DumpObject();
17472592 } else
1748
- if (event.getSource() == screenfitButton)
2593
+ if (source == minButton)
17492594 {
1750
- //Reload(lastConverter, lastFilename, true);
2595
+ Minimize();
2596
+ } else
2597
+ if (source == maxButton)
2598
+ {
2599
+ Maximize();
2600
+ } else
2601
+ if (source == fullButton)
2602
+ {
2603
+ ToggleFullScreen();
2604
+ } else
2605
+ if (source == undoButton)
2606
+ {
2607
+ // Go to previous version
2608
+ //if (!Undo())
2609
+ //java.awt.Toolkit.getDefaultToolkit().beep();
2610
+ Undo();
2611
+ } else
2612
+ if (source == restoreButton)
2613
+ {
2614
+ // Restore current version
2615
+ Restore();
2616
+ } else
2617
+ if (source == replaceButton)
2618
+ {
2619
+ // Overwrite current version
2620
+ Replace();
2621
+ } else
2622
+ if (source == redoButton)
2623
+ {
2624
+ // Go to next version
2625
+ Redo();
2626
+ } else
2627
+ if (source == saveButton)
2628
+ {
2629
+ // Save a new version
2630
+ if (!Save(true))
2631
+ java.awt.Toolkit.getDefaultToolkit().beep();
2632
+ } else
2633
+ if (source == oneStepButton)
2634
+ {
2635
+ Globals.ONESTEP = true;
2636
+ cameraView.repaint();
2637
+ } else
2638
+ if (source == screenfitButton)
2639
+ {
17512640 ScreenFit();
17522641 } else
1753
- if (event.getSource() == screenfitpointButton)
2642
+ if (source == screenfitpointButton)
17542643 {
1755
- //Reload(lastConverter, lastFilename, true);
17562644 ScreenFitPoint();
17572645 } else
1758
- if (event.getSource() == snapobjectButton)
2646
+ if (source == snapobjectButton)
17592647 {
1760
- //Reload(lastConverter, lastFilename, true);
17612648 SnapObject();
17622649 } else
17632650 // if (event.getSource() == recompileButton)
....@@ -1766,13 +2653,13 @@
17662653 // Recompile();
17672654 // refreshContents();
17682655 // } else
1769
- if (event.getSource() == gcButton)
2656
+ if (source == gcButton)
17702657 {
17712658 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
17722659 System.gc();
17732660 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
17742661 } else
1775
- if (event.getSource() == editLeafItem)
2662
+ if (source == editLeafItem)
17762663 {
17772664 Object3D obj;
17782665 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1786,65 +2673,78 @@
17862673 }
17872674 refreshContents(true);
17882675 } else
1789
- if (event.getSource() == openWindowItem)
2676
+ if (source == openWindowItem)
17902677 {
17912678 EditSelection(true);
17922679 } else
1793
- if (event.getSource() == cutItem || event.getSource() == clearButton)
2680
+ if (source == cutItem || source == clearButton)
17942681 {
17952682 loadClipboard(true);
17962683 } else
1797
- if (event.getSource() == duplicateItem)
2684
+ if (source == undoItem)
17982685 {
1799
- Object3D keep = GraphreeD.clipboard;
2686
+ Undo();
2687
+ } else
2688
+ if (source == redoItem)
2689
+ {
2690
+ Redo();
2691
+ } else
2692
+ if (source == duplicateItem)
2693
+ {
2694
+ Object3D keep = Grafreed.clipboard;
18002695 loadClipboard(false);
18012696 paste(false);
1802
- GraphreeD.clipboard = keep;
2697
+ Grafreed.clipboard = keep;
18032698 } else
1804
- if (event.getSource() == cloneItem)
2699
+ if (source == cloneItem)
18052700 {
18062701 CloneSelection(false);
18072702 } else
1808
- if (event.getSource() == cloneSupportItem)
2703
+ if (source == cloneSupportItem)
18092704 {
18102705 CloneSelection(true);
18112706 } else
1812
- if (event.getSource() == copyItem)
2707
+ if (source == copyItem)
18132708 {
18142709 loadClipboard(false);
18152710 } else
1816
- if (event.getSource() == pasteItem)
2711
+ if (source == pasteItem)
18172712 {
18182713 paste(false);
18192714 } else
1820
- if (event.getSource() == pasteLinkItem)
2715
+ if (source == pasteIntoItem)
18212716 {
1822
- pasteInto(false);
2717
+ pasteInto(true, false);
18232718 } else
1824
- if (event.getSource() == pasteCloneItem)
2719
+ if (source == pasteLinkItem)
18252720 {
1826
- pasteInto(true);
2721
+ pasteInto(false, false);
18272722 } else
1828
- if (event.getSource() == pasteExpandItem)
2723
+ if (source == pasteCloneItem)
2724
+ {
2725
+ pasteInto(true, true);
2726
+ } else
2727
+ if (source == pasteExpandItem)
18292728 {
18302729 paste(true);
18312730 } else
1832
- if (event.getSource() == synchronizeItem)
2731
+ if (source == synchronizeItem)
18332732 {
18342733 Overwrite(Object3D.TRANSFORM);
18352734 } else
1836
- if (event.getSource() == overwriteNameItem)
2735
+ if (source == overwriteNameItem)
18372736 {
18382737 Overwrite(Object3D.NAME);
18392738 } else
1840
- if (event.getSource() == overwriteUVItem)
2739
+ if (source == overwriteUVItem)
18412740 {
18422741 Overwrite(Object3D.UV);
18432742 } else
1844
- if (event.getSource() == overwriteMatItem)
2743
+ if (source == overwriteMatItem)
18452744 {
2745
+ /* july 2015
18462746 if ((dropAttributes & Object3D.TEXTURE) == 0)
1847
- Overwrite(Object3D.MATERIAL);
2747
+ Overwrite(Object3D.MATERIAL | Object3D.COLOR);
18482748 else
18492749 {
18502750 if ((dropAttributes & Object3D.COLOR) == 0 && (dropAttributes & Object3D.MATERIAL) == 0)
....@@ -1856,13 +2756,16 @@
18562756 Overwrite(Object3D.MATERIAL | Object3D.TEXTURE);
18572757 }
18582758 }
2759
+ */
2760
+
2761
+ Overwrite(dropAttributes);
18592762 }
1860
- if (event.getSource() == overwriteGeoItem)
2763
+ if (source == overwriteGeoItem)
18612764 {
18622765 Overwrite(Object3D.GEOMETRY);
1863
-// if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
2766
+// if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
18642767 // {
1865
-// Object3D content = GraphreeD.clipboard.get(0);
2768
+// Object3D content = GrafreeD.clipboard.get(0);
18662769 //
18672770 // if (content instanceof cGroup && ((cGroup)content).transientlink )
18682771 // content = ((cGroup)content).get(0);
....@@ -1874,7 +2777,7 @@
18742777 // refreshContents();
18752778 // }
18762779 } else
1877
- if (event.getSource() == generateMeshItem)
2780
+ if (source == generateMeshItem)
18782781 {
18792782 //if (group.selection.size() == 1)
18802783 // for (int i=0; i<group.selection.size(); i++)
....@@ -1885,7 +2788,7 @@
18852788 ResetModel();
18862789 refreshContents();
18872790 } else
1888
- if (event.getSource() == extractGeometriesItem)
2791
+ if (source == extractGeometriesItem)
18892792 {
18902793 boolean one = false;
18912794
....@@ -1912,7 +2815,7 @@
19122815 ResetModel();
19132816 refreshContents();
19142817 } else
1915
- if (event.getSource() == cloneGeometriesItem)
2818
+ if (source == cloneGeometriesItem)
19162819 {
19172820 boolean one = false;
19182821
....@@ -1938,32 +2841,37 @@
19382841 ResetModel();
19392842 refreshContents();
19402843 } else
1941
- if (event.getSource() == shareGeometriesItem)
2844
+ if (source == shareGeometriesItem)
19422845 {
19432846 boolean one = false;
19442847
19452848 if (group.selection.size() == 1)
19462849 one = true;
19472850
2851
+ Object3D merge = null;
2852
+
19482853 Object3D content = new cGroup();
19492854
19502855 for (int i=0; i<group.selection.size(); i++)
19512856 {
1952
- Object3D sel = new Merge(group.selection.get(i));
2857
+ merge = new Merge(group.selection.get(i));
19532858
19542859 if (one)
1955
- makeSomething(sel, false);
2860
+ makeSomething(merge, false);
19562861 else
1957
- content.addChild(sel);
2862
+ content.addChild(merge);
19582863 }
19592864
19602865 if (!one)
1961
- makeSomething(content, false);
1962
-
1963
- ResetModel();
1964
- refreshContents();
2866
+ makeSomething(content, true);
2867
+ else
2868
+ {
2869
+ ResetModel();
2870
+ Select(merge.GetTreePath(), true, false); // unselect... false);
2871
+ refreshContents();
2872
+ }
19652873 } else
1966
- if (event.getSource() == mergeGeometriesItem)
2874
+ if (source == mergeGeometriesItem)
19672875 {
19682876 boolean one = false;
19692877
....@@ -1993,11 +2901,11 @@
19932901 ResetModel();
19942902 refreshContents();
19952903 } else
1996
- if (event.getSource() == linkverticesItem)
2904
+ if (source == linkverticesItem)
19972905 {
1998
-// if (group.selection.size() == 1 && GraphreeD.clipboard.size() == 1)
2906
+// if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
19992907 // {
2000
-// Object3D content = GraphreeD.clipboard.get(0);
2908
+// Object3D content = GrafreeD.clipboard.get(0);
20012909 //
20022910 // if (content instanceof cGroup && ((cGroup)content).transientlink )
20032911 // content = ((cGroup)content).get(0);
....@@ -2006,39 +2914,48 @@
20062914 // group.selection.get(0).setMasterThis(content); // should be identity
20072915 // refreshContents();
20082916 // }
2009
- if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
2917
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
20102918 {
2011
- Object3D content = GraphreeD.clipboard.get(0);
2919
+ Object3D content = Grafreed.clipboard.get(0);
20122920
20132921 if (content instanceof cGroup && ((cGroup)content).transientlink )
20142922 content = ((cGroup)content).get(0);
20152923
2016
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
2924
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
20172925 for (int i=0; i<group.selection.size(); i++)
20182926 {
2019
- boolean random = CameraPane.RANDOM;
2020
- CameraPane.RANDOM = false; // parse all random nodes
2927
+ boolean random = CameraPane.SWITCH;
2928
+ CameraPane.SWITCH = false; // parse all random nodes
20212929 group.selection.get(i).linkVerticesThis(content);
20222930 // group.selection.get(i).setMasterThis(content); // should be identity
2023
- CameraPane.RANDOM = random;
2931
+ CameraPane.SWITCH = random;
20242932 }
2025
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
2933
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
20262934 refreshContents();
20272935 }
20282936 } else
2029
- if (event.getSource() == resetsupportItem)
2937
+ if (source == resetsupportItem)
20302938 {
20312939 for (int i=0; i<group.selection.size(); i++)
20322940 {
2033
- boolean random = CameraPane.RANDOM;
2034
- CameraPane.RANDOM = false; // parse all random nodes
2941
+ boolean random = CameraPane.SWITCH;
2942
+ CameraPane.SWITCH = false; // parse all random nodes
20352943 group.selection.get(i).linkVerticesThis(null);
2036
- CameraPane.RANDOM = random;
2944
+ CameraPane.SWITCH = random;
20372945 }
20382946
20392947 refreshContents();
20402948 } else
2041
- if (event.getSource() == resetreferencesItem)
2949
+ if (source == relinkverticesItem)
2950
+ {
2951
+ boolean random = CameraPane.SWITCH;
2952
+ CameraPane.SWITCH = false; // parse all random nodes
2953
+ group.selection.RelinkToSupport();
2954
+ CameraPane.SWITCH = random;
2955
+
2956
+ refreshContents();
2957
+ } else
2958
+ if (source == resetreferencesItem)
20422959 {
20432960 for (int i=0; i<group.selection.size(); i++)
20442961 {
....@@ -2047,11 +2964,11 @@
20472964
20482965 refreshContents();
20492966 } else
2050
- if (event.getSource() == setMasterItem)
2967
+ if (source == setMasterItem)
20512968 {
2052
- if (group.selection.size() == 1 && GraphreeD.clipboard.size() == 1)
2969
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
20532970 {
2054
- Object3D content = GraphreeD.clipboard.get(0);
2971
+ Object3D content = Grafreed.clipboard.get(0);
20552972
20562973 if (content instanceof cGroup && ((cGroup)content).transientlink )
20572974 content = ((cGroup)content).get(0);
....@@ -2060,13 +2977,13 @@
20602977 refreshContents();
20612978 }
20622979 } else
2063
- if (event.getSource() == poseMeshItem)
2980
+ if (source == poseMeshItem)
20642981 {
20652982 if (group.selection.size() == 1)
20662983 {
2067
- if (GraphreeD.clipboard.size() == 1)
2984
+ if (Grafreed.clipboard.size() == 1)
20682985 {
2069
- Object3D content = GraphreeD.clipboard.get(0);
2986
+ Object3D content = Grafreed.clipboard.get(0);
20702987
20712988 if (content instanceof cGroup && ((cGroup)content).transientlink )
20722989 content = ((cGroup)content).get(0);
....@@ -2079,19 +2996,19 @@
20792996 }
20802997
20812998 } else
2082
- if (event.getSource() == revertMeshItem)
2999
+ if (source == revertMeshItem)
20833000 {
20843001 RevertMeshes();
20853002 } else
2086
- if (event.getSource() == resetMeshItem)
3003
+ if (source == resetAllItem)
20873004 {
20883005 ResetAll();
20893006 } else
2090
- if (event.getSource() == stepAllItem)
3007
+ if (source == stepAllItem)
20913008 {
20923009 StepAll();
20933010 } else
2094
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
3011
+ if (source == deleteItem) // || event.getSource() == clearButton)
20953012 {
20963013 //int indices[] = jList.getSelectedIndices();
20973014 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2099,42 +3016,46 @@
20993016
21003017 ClearSelection(false);
21013018 } else
2102
- if (event.getSource() == clearAllItem)
3019
+ if (source == clearAllItem)
21033020 {
21043021 ClearSelection(true);
21053022 } else
2106
- if (event.getSource() == grabItem)
3023
+ if (source == grabItem || source == groupButton)
21073024 {
2108
- group(new cGroup(), true);
3025
+ group(new cGroup(), false); // true);
21093026 } else
2110
- if (event.getSource() == frontItem)
3027
+ if (source == hideItem)
3028
+ {
3029
+ group(new HiddenObject());
3030
+ } else
3031
+ if (source == frontItem)
21113032 {
21123033 front();
21133034 } else
2114
- if (event.getSource() == backItem)
3035
+ if (source == backItem)
21153036 {
21163037 back();
21173038 } else
2118
- if (event.getSource() == cameraItem)
3039
+ if (source == cameraItem)
21193040 {
21203041 makeSomething(new Camera());
21213042 } else
2122
- if (event.getSource() == compositeItem)
3043
+ if (source == compositeItem || source == compositeButton)
21233044 {
21243045 group(new Composite());
21253046 } else
2126
- if (event.getSource() == randomItem)
3047
+ if (source == switchItem || source == switchButton)
21273048 {
21283049 RandomNode random = new RandomNode();
21293050 group(random);
21303051 if (random.size() > 0)
2131
- random.name = random.get(0).name + "Rnd";
3052
+ random.name = random.get(0).name + "Switch";
21323053 } else
2133
- if (event.getSource() == physicsItem)
3054
+ if (source == physicsItem)
21343055 {
21353056 group(new PhysicsNode());
21363057 } else
2137
- if (event.getSource() == frameselectorItem)
3058
+ if (source == frameselectorItem)
21383059 {
21393060 for (int i=0; i<group.selection.size(); i++)
21403061 {
....@@ -2146,7 +3067,7 @@
21463067 ResetModel();
21473068 refreshContents();
21483069 } else
2149
- if (event.getSource() == switchGeoItem)
3070
+ if (source == switchGeoItem)
21503071 {
21513072 for (int i=0; i<group.selection.size(); i++)
21523073 {
....@@ -2158,7 +3079,7 @@
21583079 ResetModel();
21593080 refreshContents();
21603081 } else
2161
- if (event.getSource() == switchTransfoItem)
3082
+ if (source == switchTransfoItem)
21623083 {
21633084 for (int i=0; i<group.selection.size(); i++)
21643085 {
....@@ -2170,7 +3091,7 @@
21703091 ResetModel();
21713092 refreshContents();
21723093 } else
2173
- if (event.getSource() == morphItem)
3094
+ if (source == morphItem)
21743095 {
21753096 for (int i=0; i<group.selection.size(); i++)
21763097 {
....@@ -2182,7 +3103,7 @@
21823103 ResetModel();
21833104 refreshContents();
21843105 } else
2185
- if (event.getSource() == scriptNodeItem)
3106
+ if (source == scriptNodeItem)
21863107 {
21873108 boolean atleastone = false;
21883109
....@@ -2221,191 +3142,252 @@
22213142 }
22223143 }
22233144 } else
2224
- if (event.getSource() == linkerItem)
3145
+ if (source == linkerItem)
22253146 {
22263147 group(new cLinker());
22273148 } else
2228
- if (event.getSource() == textureItem)
3149
+ if (source == textureItem || source == textureButton)
22293150 {
22303151 group(new TextureNode());
22313152 } else
2232
- if (event.getSource() == shadowXItem)
3153
+ if (source == billboardItem)
3154
+ {
3155
+ group(new BillboardNode());
3156
+ } else
3157
+ if (source == shadowXItem)
22333158 {
22343159 CastShadow(0);
22353160 } else
2236
- if (event.getSource() == shadowYItem)
3161
+ if (source == shadowYItem)
22373162 {
22383163 CastShadow(1);
22393164 } else
2240
- if (event.getSource() == shadowZItem)
3165
+ if (source == shadowZItem)
22413166 {
22423167 CastShadow(2);
22433168 } else
2244
- if (event.getSource() == ungroupItem)
3169
+ if (source == ungroupItem || source == ungroupButton)
22453170 {
2246
- ungroup();
3171
+ boolean hasRoot = false;
3172
+
3173
+ for (int i=0; i<group.selection.size(); i++)
3174
+ {
3175
+ if (group.selection.get(i) == group)
3176
+ {
3177
+ hasRoot = true;
3178
+ break;
3179
+ }
3180
+ }
3181
+
3182
+ if (!hasRoot)
3183
+ {
3184
+ for (int i=0; i<group.selection.size(); i++)
3185
+ {
3186
+ Ungroup(group.selection.get(i));
3187
+ }
3188
+
3189
+ ClearSelection(false);
3190
+
3191
+ refreshContents();
3192
+ }
22473193 } else
2248
- if (event.getSource() == genUVItem)
3194
+ if (source == genUVItem)
22493195 {
22503196 GenUV();
22513197 } else
2252
- if (event.getSource() == genNormalsCADItem)
3198
+ if (source == genNormalsCADItem)
22533199 {
22543200 GenNormals(true);
22553201 } else
2256
- if (event.getSource() == genNormalsORGANItem)
3202
+ if (source == genNormalsMESHItem)
3203
+ {
3204
+ GenNormalsMESH();
3205
+ } else
3206
+ if (source == genNormalsORGANItem)
22573207 {
22583208 GenNormals(false);
22593209 } else
2260
- if (event.getSource() == stripifyItem)
3210
+ if (source == genNormalsMINEItem)
3211
+ {
3212
+ GenNormalsMINE();
3213
+ } else
3214
+ if (source == stripifyItem)
22613215 {
22623216 Stripify();
22633217 } else
2264
- if (event.getSource() == unstripifyItem)
3218
+ if (source == unstripifyItem)
22653219 {
22663220 Unstripify();
22673221 } else
2268
- if (event.getSource() == trimItem)
3222
+ if (source == trimItem)
22693223 {
22703224 Trim();
22713225 } else
2272
- if (event.getSource() == untrimItem)
3226
+ if (source == untrimItem)
22733227 {
22743228 Untrim();
22753229 } else
2276
- if (event.getSource() == clearColorsItem)
3230
+ if (source == clearColorsItem)
22773231 {
22783232 ClearColors();
22793233 } else
2280
- if (event.getSource() == clearMaterialsItem)
3234
+ if (source == clearMaterialsItem)
22813235 {
22823236 ClearMaterials();
22833237 } else
2284
- if (event.getSource() == liveleavesItem)
3238
+ if (source == liveleavesItem)
22853239 {
22863240 LiveLeaves(true);
22873241 } else
2288
- if (event.getSource() == unliveleavesItem)
3242
+ if (source == unliveleavesItem)
22893243 {
22903244 LiveLeaves(false);
22913245 } else
2292
- if (event.getSource() == supportleavesItem)
3246
+ if (source == supportleavesItem)
22933247 {
22943248 SupportLeaves(true);
22953249 } else
2296
- if (event.getSource() == unsupportleavesItem)
3250
+ if (source == unsupportleavesItem)
22973251 {
22983252 SupportLeaves(false);
22993253 } else
2300
- if (event.getSource() == hideleavesItem)
3254
+ if (source == hideleavesItem)
23013255 {
23023256 HideLeaves(true);
23033257 } else
2304
- if (event.getSource() == showleavesItem)
3258
+ if (source == showleavesItem)
23053259 {
23063260 HideLeaves(false);
23073261 } else
2308
- if (event.getSource() == markleavesItem)
3262
+ if (source == markleavesItem)
23093263 {
23103264 MarkLeaves(true);
23113265 } else
2312
- if (event.getSource() == unmarkleavesItem)
3266
+ if (source == unmarkleavesItem)
23133267 {
23143268 MarkLeaves(false);
23153269 } else
2316
- if (event.getSource() == flipVItem)
3270
+ if (source == rewindleavesItem)
3271
+ {
3272
+ RewindLeaves(true);
3273
+ } else
3274
+ if (source == unrewindleavesItem)
3275
+ {
3276
+ RewindLeaves(false);
3277
+ } else
3278
+ if (source == randomleavesItem)
3279
+ {
3280
+ RandomLeaves(true);
3281
+ } else
3282
+ if (source == unrandomleavesItem)
3283
+ {
3284
+ RandomLeaves(false);
3285
+ } else
3286
+ if (source == flipVItem)
23173287 {
23183288 FlipV(true);
23193289 } else
2320
- if (event.getSource() == unflipVItem)
3290
+ if (source == unflipVItem)
23213291 {
23223292 FlipV(false);
23233293 } else
2324
- if (event.getSource() == lowTexturesItem)
3294
+ if (source == lowTexturesItem)
23253295 {
23263296 SetTexRes(0);
23273297 } else
2328
- if (event.getSource() == normalTexturesItem)
3298
+ if (source == normalTexturesItem)
23293299 {
23303300 SetTexRes(1);
23313301 } else
2332
- if (event.getSource() == highTexturesItem)
3302
+ if (source == highTexturesItem)
23333303 {
23343304 SetTexRes(2);
23353305 } else
2336
- if (event.getSource() == veryhighTexturesItem)
3306
+ if (source == veryhighTexturesItem)
23373307 {
23383308 SetTexRes(3);
23393309 } else
2340
- if (event.getSource() == maxTexturesItem)
3310
+ if (source == maxTexturesItem)
23413311 {
23423312 SetTexRes(4);
23433313 } else
2344
- if (event.getSource() == panoTexturesItem)
3314
+ if (source == panoTexturesItem)
23453315 {
23463316 SetTexRes(5);
23473317 } else
2348
- if (event.getSource() == reverseNormalsItem)
3318
+ if (source == reverseNormalsItem)
23493319 {
23503320 ReverseNormals();
23513321 } else
2352
- if (event.getSource() == parseverticesItem)
3322
+ if (source == parseverticesItem)
23533323 {
23543324 ParseVertices();
23553325 } else
2356
- if (event.getSource() == alignItem)
3326
+ if (source == textureFieldItem)
3327
+ {
3328
+ TextureVertices();
3329
+ } else
3330
+ if (source == alignItem)
23573331 {
23583332 Align();
23593333 } else
2360
- if (event.getSource() == mirrorItem)
3334
+ if (source == mirrorItem)
23613335 {
23623336 MirrorPoses();
23633337 } else
2364
- if (event.getSource() == reduceMorphItem)
3338
+ if (source == reduceMorphItem)
23653339 {
23663340 MeshReduction(false);
23673341 } else
2368
- if (event.getSource() == reduce34MorphItem)
3342
+ if (source == reduce34MorphItem)
23693343 {
23703344 MeshReduction(true);
23713345 } else
2372
- if (event.getSource() == reverseTrianglesItem)
3346
+ if (source == reverseTrianglesItem)
23733347 {
23743348 ReverseTriangles();
23753349 } else
2376
- if (event.getSource() == reduceMeshItem)
3350
+ if (source == reduceMeshItem)
23773351 {
23783352 ReduceMesh(false);
23793353 } else
2380
- if (event.getSource() == reduce34MeshItem)
3354
+ if (source == reduce34MeshItem)
23813355 {
23823356 ReduceMesh(true);
23833357 } else
2384
- if (event.getSource() == increaseMeshItem)
3358
+ if (source == increaseMeshItem)
23853359 {
23863360 IncreaseMesh();
23873361 } else
2388
- if (event.getSource() == clipMeshItem)
3362
+ if (source == clipMeshItem)
23893363 {
23903364 ClipMesh();
23913365 } else
2392
- if (event.getSource() == smoothMeshItem)
3366
+ if (source == smoothMeshItem)
23933367 {
23943368 SmoothMesh();
23953369 } else
2396
- if (event.getSource() == transformgeometryItem)
3370
+ if (source == transformGeometryItem)
23973371 {
23983372 TransformGeometry();
23993373 } else
2400
- if (event.getSource() == resetTransformItem)
3374
+ if (source == transformChildrenItem)
3375
+ {
3376
+ TransformChildren();
3377
+ } else
3378
+ if (source == resetTransformItem)
24013379 {
24023380 ResetTransform();
24033381 } else
2404
- if (event.getSource() == resetCentroidItem)
3382
+ if (source == resetCentroidItem)
24053383 {
2406
- ResetCentroid();
3384
+ ResetCentroid(true);
24073385 } else
2408
- if (event.getSource() == resetParentItem)
3386
+ if (source == resetCentroidXZItem)
3387
+ {
3388
+ ResetCentroid(false);
3389
+ } else
3390
+ if (source == resetParentItem)
24093391 {
24103392 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24113393 {
....@@ -2415,7 +3397,7 @@
24153397
24163398 refreshContents();
24173399 } else
2418
- if (event.getSource() == repairParentItem)
3400
+ if (source == repairParentItem)
24193401 {
24203402 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24213403 {
....@@ -2429,7 +3411,21 @@
24293411
24303412 refreshContents();
24313413 } else
2432
- if (event.getSource() == sortbysizeItem)
3414
+ if (source == repairShadowItem)
3415
+ {
3416
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3417
+ {
3418
+ Object3D obj = (Object3D)e.nextElement();
3419
+ obj.RepairShadow();
3420
+// for (int i=0; i<obj.size(); i++)
3421
+// {
3422
+// obj.get(i).parent = obj;
3423
+// }
3424
+ }
3425
+
3426
+ refreshContents();
3427
+ } else
3428
+ if (source == sortbysizeItem)
24333429 {
24343430 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24353431 {
....@@ -2441,7 +3437,7 @@
24413437 ResetModel();
24423438 refreshContents();
24433439 } else
2444
- if (event.getSource() == sortbynameItem)
3440
+ if (source == sortbynameItem)
24453441 {
24463442 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24473443 {
....@@ -2453,7 +3449,7 @@
24533449 ResetModel();
24543450 refreshContents();
24553451 } else
2456
- if (event.getSource() == attachPigmentItem)
3452
+ if (source == attachPigmentItem)
24573453 {
24583454 String texture = GetFile("Attach pigment");
24593455 Object3D obj;
....@@ -2465,7 +3461,7 @@
24653461
24663462 refreshContents();
24673463 } else
2468
- if (event.getSource() == detachPigmentItem)
3464
+ if (source == detachPigmentItem)
24693465 {
24703466 Object3D obj;
24713467 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2476,7 +3472,7 @@
24763472
24773473 refreshContents();
24783474 } else
2479
- if (event.getSource() == attachBumpItem)
3475
+ if (source == attachBumpItem)
24803476 {
24813477 String texture = GetFile("Attach bump");
24823478 Object3D obj;
....@@ -2488,18 +3484,18 @@
24883484
24893485 refreshContents();
24903486 } else
2491
- if (event.getSource() == detachBumpItem)
3487
+ if (source == detachBumpItem)
24923488 {
24933489 Object3D obj;
24943490 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24953491 {
24963492 obj = (Object3D)e.nextElement();
2497
- obj.SetBumpTexture(null);
3493
+ obj.ResetBumpTexture();
24983494 }
24993495
25003496 refreshContents();
25013497 } else
2502
- if (event.getSource() == pigmentBumpItem)
3498
+ if (source == pigmentBumpItem)
25033499 {
25043500 Object3D obj;
25053501 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2510,158 +3506,262 @@
25103506
25113507 refreshContents();
25123508 } else
2513
- if (event.getSource() == flashSelectionButton)
3509
+ if (source == embedTexturesItem)
3510
+ {
3511
+ Object3D obj;
3512
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3513
+ {
3514
+ obj = (Object3D)e.nextElement();
3515
+ obj.EmbedTextures(true);
3516
+ }
3517
+
3518
+ refreshContents();
3519
+ } else
3520
+ if (source == deEmbedTexturesItem)
3521
+ {
3522
+ Object3D obj;
3523
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3524
+ {
3525
+ obj = (Object3D)e.nextElement();
3526
+ obj.EmbedTextures(false);
3527
+ }
3528
+
3529
+ CameraPane.texturepigment.clear();
3530
+ CameraPane.texturebump.clear();
3531
+
3532
+ refreshContents();
3533
+ } else
3534
+ if (source == flashSelectionButton)
25143535 {
25153536 CameraPane.flash = true;
25163537 refreshContents();
25173538 } else
2518
- if (event.getSource() == oneButton)
3539
+ if (source == oneButton)
25193540 {
25203541 } else
2521
- if (event.getSource() == twoButton)
3542
+ if (source == twoButton)
25223543 {
25233544 radio.layout = twoButton;
3545
+
3546
+ if (CameraPane.FULLSCREEN)
3547
+ fullscreenLayout = radio.layout;
3548
+
25243549 // bug
25253550 //gridPanel.setDividerLocation(1.0);
25263551 //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();
3552
+// bigThree.remove(scenePanel);
3553
+// bigThree.remove(centralPanel);
3554
+// bigThree.remove(XYZPanel);
3555
+// aWindowConstraints.gridx = 0;
3556
+// aWindowConstraints.gridy = 0;
3557
+// aWindowConstraints.gridwidth = 1;
3558
+// // aConstraints.gridheight = 3;
3559
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3560
+// aWindowConstraints.weightx = 0;
3561
+// aWindowConstraints.weighty = 1;
3562
+// //bigThree.add(jtp, aWindowConstraints);
3563
+// aWindowConstraints.weightx = 1;
3564
+// aWindowConstraints.gridwidth = 3;
3565
+// // aConstraints.gridheight = 3;
3566
+// aWindowConstraints.gridx = 1;
3567
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3568
+// bigThree.add(centralPanel, aWindowConstraints);
3569
+// aWindowConstraints.weightx = 0;
3570
+// aWindowConstraints.gridx = 4;
3571
+// aWindowConstraints.gridwidth = 1;
3572
+// // aConstraints.gridheight = 3;
3573
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3574
+// //bigThree.add(XYZPanel, aWindowConstraints);
3575
+// scenePanel.setVisible(false);
3576
+// centralPanel.setVisible(true);
3577
+// XYZPanel.setVisible(false);
3578
+ bigThree.ClearUI();
3579
+ bigThree.add(centralPanel);
3580
+ bigThree.FlushUI();
3581
+
3582
+ cameraView.requestFocusInWindow();
3583
+
3584
+// refreshContents(true);
3585
+//
3586
+// try
3587
+// {
3588
+// java.awt.Robot bot = new java.awt.Robot();
3589
+// int mask = InputEvent.BUTTON1_MASK;
3590
+// bot.mouseMove(100, 100);
3591
+// bot.mousePress(mask);
3592
+// bot.mouseRelease(mask);
3593
+// }
3594
+// catch (Exception e)
3595
+// {
3596
+//
3597
+// }
3598
+
25513599 } else
2552
- if (event.getSource() == threeButton)
3600
+ if (source == threeButton)
25533601 {
25543602 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();
3603
+
3604
+ if (CameraPane.FULLSCREEN)
3605
+ fullscreenLayout = radio.layout;
3606
+
3607
+// bigThree.remove(scenePanel);
3608
+// bigThree.remove(centralPanel);
3609
+// bigThree.remove(XYZPanel);
3610
+// aWindowConstraints.gridx = 0;
3611
+// aWindowConstraints.gridy = 0;
3612
+// aWindowConstraints.gridwidth = 1;
3613
+// // aConstraints.gridheight = 3;
3614
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3615
+// aWindowConstraints.weightx = 0;
3616
+// aWindowConstraints.weighty = 1;
3617
+// //bigThree.add(jtp, aWindowConstraints);
3618
+// aWindowConstraints.weightx = 1;
3619
+// aWindowConstraints.gridwidth = 3;
3620
+// // aConstraints.gridheight = 3;
3621
+// aWindowConstraints.gridx = 1;
3622
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3623
+// bigThree.add(centralPanel, aWindowConstraints);
3624
+// aWindowConstraints.weightx = 0;
3625
+// aWindowConstraints.gridx = 4;
3626
+// aWindowConstraints.gridwidth = 1;
3627
+// // aConstraints.gridheight = 3;
3628
+// aConstraints.fill = GridBagConstraints.VERTICAL;
3629
+// bigThree.add(XYZPanel, aWindowConstraints);
3630
+// bigThree.validate();
3631
+// scenePanel.setVisible(false);
3632
+// centralPanel.setVisible(true);
3633
+// XYZPanel.setVisible(true);
3634
+ bigThree.ClearUI();
3635
+ bigThree.add(scenePanel);
3636
+ bigThree.add(centralPanel);
3637
+ bigThree.FlushUI();
3638
+
3639
+ cameraView.requestFocusInWindow();
25793640 } else
2580
- if (event.getSource() == fourButton)
3641
+ if (source == fourButton)
25813642 {
25823643 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();
3644
+
3645
+ if (CameraPane.FULLSCREEN)
3646
+ fullscreenLayout = radio.layout;
3647
+
3648
+// bigThree.remove(scenePanel);
3649
+// bigThree.remove(centralPanel);
3650
+// bigThree.remove(XYZPanel);
3651
+// aWindowConstraints.gridx = 0;
3652
+// aWindowConstraints.gridy = 0;
3653
+// aWindowConstraints.gridwidth = 1;
3654
+// // aWindowConstraints.gridheight = 3;
3655
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3656
+// aWindowConstraints.weightx = 1;
3657
+// aWindowConstraints.weighty = 1;
3658
+// bigThree.add(scenePanel, aWindowConstraints);
3659
+// aWindowConstraints.weightx = 1;
3660
+// aWindowConstraints.gridwidth = 3;
3661
+// // aConstraints.gridheight = 3;
3662
+// aWindowConstraints.gridx = 1;
3663
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3664
+// //bigThree.add(cameraPanel, aWindowConstraints);
3665
+// aWindowConstraints.weightx = 0;
3666
+// aWindowConstraints.gridx = 4;
3667
+// aWindowConstraints.gridwidth = 1;
3668
+// // aWindowConstraints.gridheight = 3;
3669
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3670
+// //bigThree.add(XYZPanel, aWindowConstraints);
3671
+// bigThree.validate();
3672
+// scenePanel.setVisible(true);
3673
+// centralPanel.setVisible(false);
3674
+// XYZPanel.setVisible(false);
3675
+ bigThree.ClearUI();
3676
+ bigThree.add(scenePanel);
3677
+ bigThree.FlushUI();
3678
+
3679
+ cameraView.requestFocusInWindow();
26073680 } else
2608
- if (event.getSource() == sixButton)
3681
+ if (source == sixButton)
26093682 {
26103683 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();
3684
+
3685
+ if (CameraPane.FULLSCREEN)
3686
+ fullscreenLayout = radio.layout;
3687
+
3688
+// bigThree.remove(scenePanel);
3689
+// bigThree.remove(centralPanel);
3690
+// bigThree.remove(XYZPanel);
3691
+// aWindowConstraints.gridx = 0;
3692
+// aWindowConstraints.gridy = 0;
3693
+// aWindowConstraints.gridwidth = 1;
3694
+// // aConstraints.gridheight = 3;
3695
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3696
+// aWindowConstraints.weightx = 0;
3697
+// aWindowConstraints.weighty = 1;
3698
+// bigThree.add(scenePanel, aWindowConstraints);
3699
+// aWindowConstraints.weightx = 1;
3700
+// aWindowConstraints.gridwidth = 3;
3701
+// // aWindowConstraints.gridheight = 3;
3702
+// aWindowConstraints.gridx = 1;
3703
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3704
+// bigThree.add(centralPanel, aWindowConstraints);
3705
+// aWindowConstraints.weightx = 0;
3706
+// aWindowConstraints.gridx = 4;
3707
+// aWindowConstraints.gridwidth = 1;
3708
+// // aWindowConstraints.gridheight = 3;
3709
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3710
+// //bigThree.add(XYZPanel, aConstraints);
3711
+// bigThree.validate();
3712
+// scenePanel.setVisible(true);
3713
+// centralPanel.setVisible(true);
3714
+// XYZPanel.setVisible(false);
3715
+ bigThree.ClearUI();
3716
+ bigThree.add(centralPanel);
3717
+ bigThree.add(scenePanel);
3718
+ bigThree.FlushUI();
3719
+
3720
+ cameraView.requestFocusInWindow();
26353721 } else
2636
- if (event.getSource() == sevenButton)
3722
+ if (source == sevenButton)
26373723 {
26383724 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();
3725
+
3726
+ if (CameraPane.FULLSCREEN)
3727
+ fullscreenLayout = radio.layout;
3728
+
3729
+// bigThree.remove(scenePanel);
3730
+// bigThree.remove(centralPanel);
3731
+// bigThree.remove(XYZPanel);
3732
+// aWindowConstraints.gridx = 0;
3733
+// aWindowConstraints.gridy = 0;
3734
+// aWindowConstraints.gridwidth = 1;
3735
+// // aWindowConstraints.gridheight = 3;
3736
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3737
+// aWindowConstraints.weightx = 0;
3738
+// aWindowConstraints.weighty = 1;
3739
+// bigThree.add(scenePanel, aWindowConstraints);
3740
+// aWindowConstraints.weightx = 1;
3741
+// aWindowConstraints.gridwidth = 3;
3742
+// // aWindowConstraints.gridheight = 3;
3743
+// aWindowConstraints.gridx = 1;
3744
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3745
+// bigThree.add(centralPanel, aWindowConstraints);
3746
+// aWindowConstraints.weightx = 0;
3747
+// aWindowConstraints.gridx = 4;
3748
+// aWindowConstraints.gridwidth = 1;
3749
+// // aConstraints.gridheight = 3;
3750
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3751
+// bigThree.add(XYZPanel, aWindowConstraints);
3752
+// bigThree.validate();
3753
+// scenePanel.setVisible(true);
3754
+// centralPanel.setVisible(true);
3755
+// XYZPanel.setVisible(true);
3756
+ bigThree.ClearUI();
3757
+ bigThree.add(scenePanel);
3758
+ bigThree.add(centralPanel);
3759
+ bigThree.add(XYZPanel);
3760
+ bigThree.FlushUI();
3761
+
3762
+ cameraView.requestFocusInWindow();
26633763 } else
2664
- if (event.getSource() == rootButton)
3764
+ if (source == rootButton)
26653765 {
26663766 Object3D obj;
26673767 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2671,66 +3771,84 @@
26713771 EditObject(obj);
26723772 }
26733773
3774
+ cameraView.requestFocusInWindow();
26743775 refreshContents(true);
26753776 } else
2676
- if (event.getSource() == closeButton)
3777
+ if (source == closeButton)
26773778 {
26783779 //System.out.println("CLOSE: " + buttonGroup.getSelection());
26793780 cRadio ab;
26803781 for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
26813782 {
26823783 ab = (cRadio)e.nextElement();
2683
- if(ab.getModel().isSelected() && ab.GetObject() != client)
3784
+ if (ab.getModel().isSelected() && ab.GetObject() != client)
26843785 {
3786
+ // Patch to avoid bug with transparency.
3787
+ if (!ab.hadMaterial)
3788
+ {
3789
+ ab.object.material = null;
3790
+ }
3791
+
26853792 buttonGroup.remove(ab);
26863793 radioPanel.remove(ab);
26873794
2688
- ab.GetObject().editWindow = null;
3795
+ //ab.GetObject().editWindow = null;
3796
+ ab.GetObject().manipWindow = null;
26893797 // ab.GetObject().objectUI = null; // ?????????
26903798
26913799 ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick();
26923800 break;
26933801 }
26943802 }
3803
+
3804
+ cameraView.requestFocusInWindow();
26953805 refreshContents(true);
26963806 } else
2697
- if (event.getSource() == editItem || event.getSource() == editButton)
3807
+ if (source == editItem || source == editButton)
26983808 {
3809
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3810
+ {
3811
+ Object3D child = (Object3D)e.nextElement();
3812
+ child.pinned = true;
3813
+ }
3814
+
26993815 EditSelection(false);
27003816 } else
2701
- if (event.getSource() == uneditButton)
3817
+ if (source == uneditButton)
27023818 {
27033819 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
27043820 {
27053821 Object3D child = (Object3D)e.nextElement();
27063822 if(child.editWindow != null)
27073823 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3824
+ child.pinned = false;
27083825 child.CloseUI();
27093826 listUI.remove(child);
27103827
2711
- child.editWindow = null; // ???????????
3828
+ //child.editWindow = null; // ???????????
27123829 }
2713
- objEditor.ctrlPanel.revalidate();
3830
+ objEditor.ctrlPanel.FlushUI();
27143831 //objEditor.jTree.clearSelection();
27153832 //objEditor.ResetSliders();
27163833 refreshContents(true);
27173834 } else
2718
- if (event.getSource() == clearPanelButton)
3835
+ if (source == clearPanelButton)
27193836 {
27203837 assert(copy == group);
27213838 //copy.ClearUI();
27223839 for (Object3D obj : listUI)
27233840 {
3841
+ obj.pinned = false;
27243842 obj.CloseUI();
27253843 }
27263844 listUI.clear();
27273845 refreshContents(true);
27283846 } else
2729
- if (event.getSource() == allParamsButton)
3847
+ if (source == allParamsButton)
27303848 {
27313849 assert(copy == group);
27323850
2733
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3851
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
27343852
27353853 for (Object3D obj : listUI)
27363854 {
....@@ -2747,19 +3865,19 @@
27473865
27483866 refreshContents(true);
27493867 } else
2750
- if (event.getSource() == unselectButton)
3868
+ if (source == unselectButton)
27513869 {
27523870 objEditor.jTree.clearSelection();
2753
- // ?? oct 2012 GraphreeD.clipboard.clear();
3871
+ // ?? oct 2012 GrafreeD.clipboard.clear();
27543872 objEditor.ResetSliders();
27553873 refreshContents(true);
27563874 } else
2757
- if(event.getSource() instanceof cRadio)
3875
+ if(source instanceof cRadio)
27583876 {
27593877 group.parent = keepparent;
27603878 group.attributes = 0;
27613879 //group.editWindow = null;
2762
- /*cRadio*/ radio = (cRadio)event.getSource();
3880
+ /*cRadio*/ radio = (cRadio)source;
27633881 Object3D obj = radio.GetObject();
27643882 System.out.println("Edit " + obj);
27653883 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -2779,7 +3897,10 @@
27793897 }
27803898
27813899 copy = group;
2782
- //CameraPane.theRenderer.object = group;
3900
+
3901
+ SetUndoStates();
3902
+
3903
+ //Globals.theRenderer.object = group;
27833904 if(!useclient)
27843905 {
27853906 cameraView.renderCamera = radio.camera;
....@@ -2788,25 +3909,54 @@
27883909 cameraView.cameras[cameraView.cameracount] = radio.camera;
27893910 cameraView.targetLookAt.set(radio.camera.lookAt);
27903911 cameraView.object = group;
2791
- cameraView.lighttouched = true;
3912
+ //cameraView.lighttouched = true;
3913
+ Globals.lighttouched = true;
27923914 topView.object = group;
27933915 frontView.object = group;
27943916 sideView.object = group;
27953917 }
2796
- group.editWindow = this;
3918
+
3919
+// fix "+" issue
3920
+ //group.editWindow = this;
3921
+ group.manipWindow = this;
3922
+
27973923 /*
27983924 currentLayout = radio.layout;
27993925 if (currentLayout == null)
28003926 currentLayout = sevenButton;
28013927 */
28023928 radio.layout.doClick();
3929
+
3930
+ ClearUnpinned();
3931
+ //Grafreed.Assert(group != null);
3932
+ //Grafreed.Assert(group.selection != null);
3933
+ SetPinStates(group.selection == null || group.selection.size() > 0);
3934
+ if (group.selection == null || group.selection.size() == 1)
3935
+ EditSelection(false);
28033936 keepparent = group.parent;
28043937 // PARENT = NULL or not???
28053938 //group.parent = null; // ROOT
28063939 //group.attributes = -1;
28073940 ResetModel();
3941
+
3942
+ cameraView.requestFocusInWindow();
28083943 refreshContents(true);
2809
- }
3944
+ } else if (event.getSource() == editCameraItem)
3945
+ {
3946
+ cameraView.ProtectCamera();
3947
+ cameraView.requestFocusInWindow();
3948
+ cameraView.repaint();
3949
+ return;
3950
+ } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton)
3951
+ {
3952
+ cameraView.RevertCamera();
3953
+ cameraView.requestFocusInWindow();
3954
+ cameraView.repaint();
3955
+ return;
3956
+ // } else if (event.getSource() == textureButton)
3957
+ // {
3958
+ // return; // true;
3959
+ }
28103960 else
28113961 {
28123962 //return super.action(event, arg);
....@@ -2815,7 +3965,6 @@
28153965 }
28163966
28173967 boolean useclient = false;
2818
- cRadio radio;
28193968
28203969 void ToggleRoot()
28213970 {
....@@ -2824,7 +3973,7 @@
28243973 if (useclient)
28253974 {
28263975 cameraView.object = client;
2827
- cameraView.lighttouched = true;
3976
+ Globals.lighttouched = true;
28283977 //topView.object = client;
28293978 //frontView.object = client;
28303979 //sideView.object = client;
....@@ -2832,7 +3981,7 @@
28323981 else
28333982 {
28343983 cameraView.object = group;
2835
- cameraView.lighttouched = true;
3984
+ Globals.lighttouched = true;
28363985 //topView.object = group;
28373986 //frontView.object = group;
28383987 //sideView.object = group;
....@@ -2867,6 +4016,28 @@
28674016 refreshContents();
28684017 }
28694018
4019
+ void TransformChildren()
4020
+ {
4021
+ Object3D obj;
4022
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
4023
+ {
4024
+ obj = (Object3D)e.nextElement();
4025
+ obj.KeepTextureMatrices();
4026
+ obj.TransformChildren();
4027
+ obj.RestoreTextureMatrices();
4028
+
4029
+// if (obj.parent == null)
4030
+// {
4031
+// System.out.println("NULL PARENT!");
4032
+// new Exception().printStackTrace();
4033
+// }
4034
+// else
4035
+// TouchTransform(obj);
4036
+// //obj.parent.Touch();
4037
+ }
4038
+
4039
+ refreshContents();
4040
+ }
28704041
28714042 void ResetTransform()
28724043 {
....@@ -2979,7 +4150,7 @@
29794150 refreshContents();
29804151 }
29814152
2982
- void ResetCentroid()
4153
+ void ResetCentroid(boolean full)
29834154 {
29844155 Object3D obj;
29854156 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2994,12 +4165,16 @@
29944165 LA.matIdentity(Object3D.mat);
29954166 obj.getBounds(minima, maxima, false);
29964167 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
2997
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
4168
+ if (full)
4169
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
29984170 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
29994171 obj.TransformMesh(Object3D.mat);
4172
+
30004173 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3001
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
4174
+ if (full)
4175
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
30024176 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
4177
+
30034178 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
30044179 //Object3D.mat[3][0] = -Object3D.mat[3][0];
30054180 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3028,7 +4203,8 @@
30284203
30294204 int size = obj.MemorySize();
30304205
3031
- System.err.println((size/1024) + " KB is the size of " + obj);
4206
+ //System.err.println((size/1024) + " KB is the size of " + obj);
4207
+ System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)");
30324208 }
30334209 }
30344210 catch (Exception e)
....@@ -3065,9 +4241,9 @@
30654241 obj = (Object3D)e.nextElement();
30664242
30674243 System.out.println("Object is: " + obj);
3068
- GraphreeD.AnalyzeObject(obj);
4244
+ Grafreed.AnalyzeObject(obj);
30694245 System.out.println("Boundary rep: " + obj.bRep);
3070
- GraphreeD.AnalyzeObject(obj.bRep);
4246
+ Grafreed.AnalyzeObject(obj.bRep);
30714247
30724248 // System.err.println((size/1024) + " KB is the size of " + obj);
30734249 }
....@@ -3109,6 +4285,20 @@
31094285 void GenNormals(boolean crease)
31104286 {
31114287 group.GenNormalsS(crease);
4288
+
4289
+ refreshContents();
4290
+ }
4291
+
4292
+ void GenNormalsMESH()
4293
+ {
4294
+ group.GenNormalsMeshS();
4295
+
4296
+ refreshContents();
4297
+ }
4298
+
4299
+ void GenNormalsMINE()
4300
+ {
4301
+ group.selection.GenNormalsMINE();
31124302
31134303 refreshContents();
31144304 }
....@@ -3157,104 +4347,259 @@
31574347
31584348 //Object3D buffer;
31594349 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
-
4350
+// BoundaryRep temprep;
4351
+// Object3D nodes;
4352
+// Vector<Vertex> vertices;
4353
+//
4354
+// cGroup buffer;
4355
+//
4356
+// public void Vertex(Object3D node, Vertex v)
4357
+// {
4358
+//// vertices.add(v);
4359
+//// nodes.addElement(node);
4360
+////
4361
+//// if (temprep.GetCache(v) != null)
4362
+//// {
4363
+//// temprep.Remove(v);
4364
+//// } else
4365
+//// {
4366
+//// temprep.Remember(v);
4367
+//// }
4368
+//
4369
+// //Object3D node = nodes.get(index);
4370
+// temp.set(v); // vertices.get(index)); // temprep.GetVertex(k));
4371
+// // System.out.println("temp = " + temp.x + ", " + temp.y + ", " + temp.z);
4372
+//
4373
+// LA.xformPos(temp, node.GlobalTransformInv(), temp);
4374
+//
4375
+// // System.out.println("tem+ = " + temp.x + ", " + temp.y + ", " + temp.z);
4376
+//
4377
+// cGroup g = new cGroup();
4378
+//
4379
+// if (g.toParent == null)
4380
+// {
4381
+// g.toParent = LA.newMatrix();
4382
+// g.fromParent = LA.newMatrix();
4383
+// }
4384
+// LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
4385
+// LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
4386
+//
4387
+// g.add(GrafreeD.clipboard);
4388
+//
4389
+// buffer.add(g);
4390
+// }
4391
+//
4392
+// public void Face(Object3D node, Face f)
4393
+// {
4394
+//
4395
+// }
4396
+//
4397
+// void ParseVerticesOld() // ??
4398
+// {
4399
+// //if (group.selection.size() != 1)
4400
+// // return;
4401
+//
4402
+// temprep = new BoundaryRep();
4403
+// nodes = new Object3D();
4404
+// vertices = new Vector<Vertex>();
4405
+//
4406
+// boolean epsequal = GrafreeD.epsequal;
4407
+// GrafreeD.epsequal = true;
4408
+//
4409
+// for (int i=0; i<group.selection.size(); i++)
4410
+// {
4411
+// Object3D buffer = new cGroup(group.selection.get(i).name + "+");
4412
+//
4413
+// group.selection.get(i).Parse(
4414
+//this );
4415
+//
4416
+// int repsize = temprep.VertexCount();
4417
+// int tablesize = temprep.vertextable.size();
4418
+// int nodesize = nodes.size();
4419
+//
4420
+// assert(vertices.size() == nodes.size());
4421
+//
4422
+// temprep.vertextable.elements();
4423
+//
4424
+// java.util.Set<java.util.Map.Entry<Vertex,Vertex>> set = temprep.vertextable.entrySet();
4425
+//
4426
+// for (java.util.Map.Entry<Vertex,Vertex> entry : set)
4427
+// {
4428
+// cGroup g = new cGroup();
4429
+//
4430
+// int index = vertices.indexOf(entry.getValue()); // temprep.vertextable.(k));
4431
+//
4432
+// Object3D node = nodes.get(index);
4433
+// temp.set(vertices.get(index)); // temprep.GetVertex(k));
4434
+// // System.out.println("temp = " + temp.x + ", " + temp.y + ", " + temp.z);
4435
+//
4436
+// LA.xformPos(temp, node.GlobalTransformInv(), temp);
4437
+//
4438
+// // System.out.println("tem+ = " + temp.x + ", " + temp.y + ", " + temp.z);
4439
+//
4440
+// if (g.toParent == null)
4441
+// {
4442
+// g.toParent = LA.newMatrix();
4443
+// g.fromParent = LA.newMatrix();
4444
+// }
4445
+// LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
4446
+// LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
4447
+//
4448
+// g.add(GrafreeD.clipboard);
4449
+//
4450
+// buffer.add(g);
4451
+// }
4452
+//
4453
+// makeSomething(buffer, i==group.selection.size()-1);
4454
+// }
4455
+//
4456
+// GrafreeD.epsequal = epsequal;
4457
+//
4458
+// //buffer = null;
4459
+// temprep = null;
4460
+// nodes = null;
4461
+//
4462
+// refreshContents();
4463
+// }
4464
+
31844465 void ParseVertices()
31854466 {
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;
4467
+ boolean epsequal = Grafreed.epsequal;
4468
+ Grafreed.epsequal = true;
31954469
31964470 for (int i=0; i<group.selection.size(); i++)
31974471 {
3198
- Object3D buffer = new cGroup(group.selection.get(i).name + "+");
4472
+ final cGroup buffer = new cGroup(group.selection.get(i).name + "+");
31994473
3200
- group.selection.get(i).Parse(this);
3201
-
3202
- int repsize = temprep.VertexCount();
3203
- int tablesize = temprep.vertextable.size();
3204
- int nodesize = nodes.size();
4474
+ group.selection.get(i).Parse(
4475
+
4476
+ new iParse()
4477
+ {
4478
+ public void Vertex(Object3D node, Vertex v)
4479
+ {
4480
+ temp.set(v);
4481
+ LA.xformPos(temp, node.GlobalTransformInv(), temp);
32054482
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();
4483
+ cGroup g = new cGroup();
32114484
3212
- for (java.util.Map.Entry<Vertex,Vertex> entry : set)
3213
- {
3214
- cGroup g = new cGroup();
4485
+ if (g.toParent == null)
4486
+ {
4487
+ g.toParent = LA.newMatrix();
4488
+ g.fromParent = LA.newMatrix();
4489
+ }
4490
+ LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
4491
+ LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
32154492
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);
4493
+ g.add(Grafreed.clipboard);
32204494
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);
4495
+ buffer.add(g);
4496
+ }
32324497
3233
- g.add(GraphreeD.clipboard);
4498
+ public void Face(Object3D node, Face f)
4499
+ {
32344500
3235
- buffer.add(g);
3236
- }
4501
+ }
4502
+ }
4503
+ );
32374504
32384505 makeSomething(buffer, i==group.selection.size()-1);
32394506 }
32404507
3241
- GraphreeD.epsequal = epsequal;
3242
-
3243
- //buffer = null;
3244
- temprep = null;
3245
- nodes = null;
4508
+ Grafreed.epsequal = epsequal;
32464509
32474510 refreshContents();
32484511 }
3249
-
4512
+
4513
+ void TextureVertices()
4514
+ {
4515
+ for (int i=0; i<group.selection.size(); i++)
4516
+ {
4517
+ group.selection.get(i).Parse(
4518
+ new iParse()
4519
+ {
4520
+ public void Vertex(Object3D node, Vertex v)
4521
+ {
4522
+ cTexture tex = node.GetTextures();
4523
+ String pigment = Object3D.GetPigment(tex);
4524
+ //String bump = Object3D.GetBump(tex);
4525
+
4526
+ com.sun.opengl.util.texture.TextureData texturedata = null;
4527
+
4528
+ try
4529
+ {
4530
+ texturedata = Globals.theRenderer.GetTextureData(tex, false, node.texres);
4531
+ }
4532
+ catch (Exception e)
4533
+ {
4534
+ System.err.println("FAIL: " + node);
4535
+ }
4536
+
4537
+ double s = v.s;
4538
+
4539
+ if (s == 1)
4540
+ s = 0;
4541
+
4542
+ double t = v.t;
4543
+
4544
+ if (t == 1)
4545
+ t = 0;
4546
+
4547
+ int indexs = (int) (texturedata.getWidth() * s);
4548
+ int indext = (int) (texturedata.getHeight() * t);
4549
+
4550
+ int index = indext * texturedata.getWidth() + indexs;
4551
+
4552
+ java.nio.ByteBuffer bytebuf = (java.nio.ByteBuffer)texturedata.getBuffer();
4553
+
4554
+ int slide = bytebuf.capacity() / texturedata.getWidth() / texturedata.getHeight();
4555
+
4556
+ float scale = bytebuf.get(index*slide) & 0xFF;
4557
+ scale += bytebuf.get(index*slide+1) & 0xFF;
4558
+ scale += bytebuf.get(index*slide+2) & 0xFF;
4559
+ scale /= 3;
4560
+
4561
+ scale /= 0xFF;
4562
+ // c'est quoi ca? scale /= 4;
4563
+
4564
+ //v.AO = scale;
4565
+
4566
+ v.x += v.norm.x * scale;
4567
+ v.y += v.norm.y * scale;
4568
+ v.z += v.norm.z * scale;
4569
+ }
4570
+
4571
+ public void Face(Object3D node, Face f)
4572
+ {
4573
+ }
4574
+ }
4575
+ );
4576
+ }
4577
+
4578
+ refreshContents();
4579
+ }
4580
+
32504581 void Align()
32514582 {
4583
+ if (group.selection.size() == 0)
4584
+ return;
4585
+
4586
+ cVector bbmin = new cVector();
4587
+ cVector bbmax = new cVector();
4588
+
4589
+ group.selection.get(0).getBounds(bbmin, bbmax, true);
4590
+
4591
+ double dx = bbmax.x - bbmin.x;
4592
+ double dy = bbmax.y - bbmin.y;
4593
+ double dz = bbmax.z - bbmin.z;
4594
+
4595
+ double scale = Math.sqrt(dx*dx + dy*dy + dz*dz);
4596
+
32524597 for (int i=0; i<group.selection.size(); i++)
32534598 {
32544599 Object3D obj = group.selection.get(i);
32554600
3256
- LA.matTranslate(obj.toParent, i/2f, 0, 0);
3257
- LA.matTranslateInv(obj.fromParent, -i/2f, 0, 0);
4601
+ LA.matTranslate(obj.toParent, i * scale, 0, 0);
4602
+ LA.matTranslateInv(obj.fromParent, -i * scale, 0, 0);
32584603 }
32594604
32604605 refreshContents();
....@@ -3267,7 +4612,7 @@
32674612 // ref.SaveSupports();
32684613 // Object3D par = ref.parent;
32694614 // ref.parent = null;
3270
-// Object3D lowres = (Object3D) GraphreeD.clone(ref);
4615
+// Object3D lowres = (Object3D) GrafreeD.clone(ref);
32714616 // ref.parent = par;
32724617 // ref.RestoreSupports();
32734618
....@@ -3275,11 +4620,11 @@
32754620
32764621 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
32774622
3278
- boolean random = CameraPane.RANDOM;
3279
- CameraPane.RANDOM = false; // parse all random nodes
4623
+ boolean random = CameraPane.SWITCH;
4624
+ CameraPane.SWITCH = false; // parse all random nodes
32804625 lowres.linkVerticesThis(null);
32814626 lowres.linkVerticesThis(sn);
3282
- CameraPane.RANDOM = random;
4627
+ CameraPane.SWITCH = random;
32834628
32844629 System.err.flush();
32854630
....@@ -3297,7 +4642,7 @@
32974642 // lowres.SaveSupports();
32984643 // par = lowres.parent;
32994644 // lowres.parent = null;
3300
-// Object3D newlow = (Object3D) GraphreeD.clone(lowres);
4645
+// Object3D newlow = (Object3D) GrafreeD.clone(lowres);
33014646 Object3D newlow = CloneObject(lowres, false);
33024647 newlow.name = sn.switchobject.get(i).name;
33034648 System.out.println(" pose#" + i + " = " + newlow);
....@@ -3319,7 +4664,7 @@
33194664 return;
33204665
33214666 Object3D poses = group.selection.get(0);
3322
- Object3D ref = GraphreeD.clipboard.get(0);
4667
+ Object3D ref = Grafreed.clipboard.get(0);
33234668
33244669 Object3D newgroup = new Object3D("Po:" + poses.name);
33254670
....@@ -3488,7 +4833,7 @@
34884833 group.selection.RelinkToSupport(); // july 2014
34894834 System.out.println("DONE.");
34904835 refreshContents();
3491
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
4836
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
34924837 }
34934838
34944839 void ReduceMesh(boolean reduction34)
....@@ -3513,20 +4858,20 @@
35134858
35144859 void ClipMesh()
35154860 {
3516
- if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
4861
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
35174862 {
3518
- Object3D content = GraphreeD.clipboard.get(0);
4863
+ Object3D content = Grafreed.clipboard.get(0);
35194864
35204865 if (content instanceof cGroup && ((cGroup)content).transientlink )
35214866 content = ((cGroup)content).get(0);
35224867
35234868 // for (int i=0; i<group.selection.size(); i++)
35244869 // {
3525
-// group.selection.get(i).ClipMesh(GraphreeD.clipboard);
4870
+// group.selection.get(i).ClipMesh(GrafreeD.clipboard);
35264871 // }
3527
- group.selection.ClipMesh(GraphreeD.clipboard);
4872
+ group.selection.ClipMesh(Grafreed.clipboard);
35284873 }
3529
-// group.selection.ClipMesh(GraphreeD.clipboard);
4874
+// group.selection.ClipMesh(GrafreeD.clipboard);
35304875 System.out.println("DONE.");
35314876 refreshContents();
35324877 }
....@@ -3571,6 +4916,18 @@
35714916 void MarkLeaves(boolean hide)
35724917 {
35734918 group.selection.MarkLeaves(hide);
4919
+ refreshContents();
4920
+ }
4921
+
4922
+ void RewindLeaves(boolean hide)
4923
+ {
4924
+ group.selection.RewindLeaves(hide);
4925
+ refreshContents();
4926
+ }
4927
+
4928
+ void RandomLeaves(boolean hide)
4929
+ {
4930
+ group.selection.RandomLeaves(hide);
35744931 refreshContents();
35754932 }
35764933
....@@ -3645,28 +5002,25 @@
36455002 // }
36465003 // }
36475004
3648
- static boolean allparams = true;
3649
-
3650
- static Vector<Object3D> listUI = new Vector<Object3D>();
3651
-
36525005 void EditSelection(boolean newWindow)
36535006 {
5007
+ if (group.selection == null)
5008
+ {
5009
+ EditElement(group, newWindow); // ? new
5010
+ return;
5011
+ }
5012
+
36545013 // aConstraints.gridy = 0;
36555014 for (int i=0; i<group.selection.size(); i++)
36565015 {
36575016 //System.out.println("edit : " + objectPanel.indexOfTab("Material"));
36585017 //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false);
3659
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
5018
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
36605019
36615020 Object3D elem = (Object3D)group.selection.elementAt(i);
3662
- if(elem != group)
5021
+ if(elem != group || !newWindow)
36635022 {
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
5023
+ EditElement(elem, newWindow); // ? new
36705024 }
36715025 }
36725026 }
....@@ -3741,7 +5095,8 @@
37415095 //new Exception().printStackTrace();
37425096
37435097 freezemodel = true;
3744
-
5098
+ ClearUnpinned();
5099
+
37455100 /**/
37465101 //switch (event.id)
37475102 {
....@@ -3749,7 +5104,6 @@
37495104 //case 702: // Event.LIST_DESELECT
37505105 group.deselectAll();
37515106 TreePath tps[] = objEditor.jTree.getSelectionPaths();
3752
- objEditor.ClearInfo(); // .GetMaterial());
37535107 if (tps != null)
37545108 {
37555109 for (int i=0; i < tps.length; i++)
....@@ -3758,33 +5112,39 @@
37585112
37595113 //if (child.parent != null)
37605114 //child.parent.addSelectee(child);
5115
+ objEditor.SetMaterial(child);
37615116 group.addSelectee(child);
3762
- objEditor.SetMaterial(child); // .GetMaterial());
3763
- objEditor.AddInfo(child, this, true); // .GetMaterial());
3764
- System.err.println("info : " + child.GetPath());
37655117 }
37665118 }
3767
- else
3768
- {
3769
- objEditor.SetMaterial(group); // .GetMaterial());
3770
- objEditor.AddInfo(group, this, true); // .GetMaterial());
3771
- System.err.println("info : " + group.GetPath());
3772
- }
5119
+// else
5120
+// {
5121
+// objEditor.SetMaterial(group); // .GetMaterial());
5122
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
5123
+// System.err.println("info : " + group.GetPath());
5124
+// }
37735125
3774
- objEditor.SetText(); // jan 2014
3775
-
3776
- if (flashIt && !CameraPane.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
5126
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera))
37775127 CameraPane.flash = true;
37785128
3779
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
5129
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
37805130 // a camera
37815131 {
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;
5132
+ if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crash the camera because of invalid lightspace
5133
+ {
5134
+ CameraPane.camerachangeframe = 0; // don't refuse it
5135
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
5136
+ }
5137
+ // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
5138
+ // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
37865139 }
37875140
5141
+ if (tps != null && tps.length == 1)
5142
+ {
5143
+ EditSelection(false);
5144
+ }
5145
+
5146
+ SetPinStates(tps != null && tps.length > 0);
5147
+
37885148 refreshContents();
37895149 //return true;
37905150 }
....@@ -3793,6 +5153,35 @@
37935153
37945154 freezemodel = false;
37955155 }
5156
+
5157
+ void SetPinStates(boolean enabled)
5158
+ {
5159
+ editButton.setEnabled(enabled);
5160
+ uneditButton.setEnabled(enabled);
5161
+ unselectButton.setEnabled(enabled);
5162
+ flashSelectionButton.setEnabled(enabled);
5163
+ }
5164
+
5165
+ void refreshContents(boolean cp)
5166
+ {
5167
+ if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info"))
5168
+ if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING)
5169
+ {
5170
+ objEditor.ClearInfo(); // .GetMaterial());
5171
+
5172
+ for (int i=0; i < group.selection.Size(); i++)
5173
+ {
5174
+ Object3D child = (Object3D) group.selection.get(i);
5175
+
5176
+ objEditor.AddInfo(child, this, true);
5177
+ System.err.println("info : " + child.GetPath());
5178
+ }
5179
+
5180
+ objEditor.SetText(); // jan 2014
5181
+ }
5182
+
5183
+ super.refreshContents(cp);
5184
+ }
37965185
37975186 void linkSomething(Object3D thing)
37985187 {
....@@ -3864,16 +5253,19 @@
38645253 {
38655254 if (group.selection.isEmpty())
38665255 return;
3867
- GraphreeD.clipboardIsTempGroup = false;
5256
+
5257
+ Grafreed.clipboardIsTempGroup = false;
38685258 Composite tGroup = null;
38695259 if (group.selection.size() > 0) // 1)
38705260 {
38715261 tGroup = new cGroup();
3872
- GraphreeD.clipboardIsTempGroup = true;
5262
+ Grafreed.clipboardIsTempGroup = true;
38735263 }
38745264
38755265 if (cut)
38765266 {
5267
+// if (Globals.SAVEONMAKE) // Moved to the clipboard, no need to save.
5268
+// Save();
38775269 //int indices[] = jList.getSelectedIndices();
38785270 //for (int i = indices.length - 1; i >= 0; i--)
38795271 //jList.remove(indices[i]);
....@@ -3909,16 +5301,16 @@
39095301 //System.out.println("cut " + child);
39105302 //System.out.println("parent = " + child.parent);
39115303 // tmp.addChild(child);
3912
- if (GraphreeD.clipboardIsTempGroup)
5304
+ if (Grafreed.clipboardIsTempGroup)
39135305 tGroup.add/*Child*/(tmp);
39145306 else
3915
- GraphreeD.clipboard = tmp;
5307
+ Grafreed.clipboard = tmp;
39165308 }
39175309 else
3918
- if (GraphreeD.clipboardIsTempGroup)
5310
+ if (Grafreed.clipboardIsTempGroup)
39195311 tGroup.add/*Child*/(child);
39205312 else
3921
- GraphreeD.clipboard = child;
5313
+ Grafreed.clipboard = child;
39225314 }
39235315
39245316 //ResetModel();
....@@ -3950,21 +5342,23 @@
39505342 //System.out.println("cut " + elem);
39515343 //System.out.println("parent = " + elem.parent);
39525344 // tmp.addChild(elem);
3953
- if (GraphreeD.clipboardIsTempGroup)
5345
+ if (Grafreed.clipboardIsTempGroup)
39545346 tGroup.add/*Child*/(tmp);
39555347 else
3956
- GraphreeD.clipboard = tmp;
5348
+ Grafreed.clipboard = tmp;
39575349 }
39585350 else
3959
- if (GraphreeD.clipboardIsTempGroup)
5351
+ if (Grafreed.clipboardIsTempGroup)
39605352 tGroup.add/*Child*/(child);
39615353 else
3962
- GraphreeD.clipboard = child;
5354
+ Grafreed.clipboard = child;
39635355 }
39645356
39655357 }
3966
- if (GraphreeD.clipboardIsTempGroup)
3967
- GraphreeD.clipboard = tGroup;
5358
+
5359
+ if (Grafreed.clipboardIsTempGroup)
5360
+ Grafreed.clipboard = tGroup;
5361
+
39685362 if (cut)
39695363 {
39705364 ResetModel();
....@@ -3974,11 +5368,15 @@
39745368
39755369 void paste(boolean expand)
39765370 {
3977
- // if (GraphreeD.clipboard == null)
5371
+ if (Globals.REPLACEONMAKE)
5372
+ Save();
5373
+ boolean keep = Globals.REPLACEONMAKE;
5374
+ Globals.REPLACEONMAKE = false;
5375
+ // if (GrafreeD.clipboard == null)
39785376 // return;
39795377 boolean first = true;
39805378
3981
- if (GraphreeD.clipboardIsTempGroup)
5379
+ if (Grafreed.clipboardIsTempGroup)
39825380 {
39835381 Composite temp;
39845382
....@@ -3989,7 +5387,7 @@
39895387 temp = (Composite)Applet3D.clipboard.deepCopy();
39905388 */
39915389 Object3D elem;
3992
- for (Enumeration e = /*temp.children*/GraphreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
5390
+ for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
39935391 {
39945392 Object3D child = (Object3D)e.nextElement();
39955393
....@@ -4003,7 +5401,7 @@
40035401 else
40045402 elem = child.deepCopy(); // ?
40055403 child.parent = keepparent;
4006
- //if (GraphreeD.clipboardIsTempGroup && LA.isIdentity(elem.fromParent))
5404
+ //if (GrafreeD.clipboardIsTempGroup && LA.isIdentity(elem.fromParent))
40075405 // elem = elem.get(0);
40085406 makeSomething(elem, true); // ?? first);
40095407 //group.addChild(elem);
....@@ -4023,23 +5421,24 @@
40235421 //Object3D cb = Applet3D.clipboard;
40245422 //temp.addChild(cb);
40255423 //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());
5424
+ assert(Grafreed.clipboard.parent == null);
5425
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
5426
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
5427
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
5428
+ makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy());
40315429 else
4032
- makeSomething(expand?GraphreeD.clipboard.copyExpand():GraphreeD.clipboard.deepCopy());
4033
- GraphreeD.clipboard.get(0).parent = keepparent;
5430
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
5431
+ Grafreed.clipboard.get(0).parent = keepparent;
40345432 }
40355433
5434
+ Globals.REPLACEONMAKE = keep;
40365435 ResetModel();
40375436 refreshContents();
40385437 }
40395438
4040
- void pasteInto(boolean copyit)
5439
+ void pasteInto(boolean copyit, boolean clone)
40415440 {
4042
-// if (GraphreeD.clipboard == null)
5441
+// if (GrafreeD.clipboard == null)
40435442 // return;
40445443
40455444 if (group.selection.size() != 1)
....@@ -4066,15 +5465,22 @@
40665465 if (copyit)
40675466 {
40685467 // paste(false);
4069
- CloneClipboard(false); // sept 2014
5468
+ if (clone)
5469
+ {
5470
+ CloneClipboard(false); // sept 2014
5471
+ }
5472
+ else
5473
+ {
5474
+ paste(false);
5475
+ }
40705476 }
40715477 else
40725478 {
40735479 boolean first = true;
40745480
4075
- if (GraphreeD.clipboardIsTempGroup)
5481
+ if (Grafreed.clipboardIsTempGroup)
40765482 {
4077
- Composite temp = (Composite)GraphreeD.clipboard;
5483
+ Composite temp = (Composite)Grafreed.clipboard;
40785484 Object3D copy;
40795485 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
40805486 {
....@@ -4084,7 +5490,7 @@
40845490 }
40855491 } else
40865492 {
4087
- linkSomething(GraphreeD.clipboard); //.get(0));
5493
+ linkSomething(Grafreed.clipboard); //.get(0));
40885494 }
40895495 }
40905496 }
....@@ -4161,6 +5567,10 @@
41615567
41625568 void group(Object3D csg, boolean grab)
41635569 {
5570
+ if (Globals.REPLACEONMAKE)
5571
+ Save();
5572
+ boolean keep = Globals.REPLACEONMAKE;
5573
+ Globals.REPLACEONMAKE = false;
41645574 if (//false) // why??
41655575 !group.selection.isEmpty())
41665576 {
....@@ -4274,8 +5684,34 @@
42745684 //node.add(csg);
42755685 //makeSomething(node);
42765686 makeSomething(csg);
5687
+ Globals.REPLACEONMAKE = keep;
42775688 }
42785689
5690
+ void Ungroup(Object3D g)
5691
+ {
5692
+ if (Globals.REPLACEONMAKE)
5693
+ Save();
5694
+ boolean keep = Globals.REPLACEONMAKE;
5695
+ Globals.REPLACEONMAKE = false;
5696
+ if (g instanceof HiddenObject)
5697
+ {
5698
+ HiddenObject h = (HiddenObject) g;
5699
+
5700
+ for (int i=0; i<h.ActualSize(); i++)
5701
+ {
5702
+ objEditor.makeSomething(h.get(i), false);
5703
+ }
5704
+ }
5705
+ else
5706
+ {
5707
+ for (int i=0; i<g.Size(); i++)
5708
+ {
5709
+ objEditor.makeSomething(g.get(i), false);
5710
+ }
5711
+ }
5712
+ Globals.REPLACEONMAKE = keep;
5713
+ }
5714
+
42795715 void ungroup()
42805716 {
42815717 /*
....@@ -4469,21 +5905,6 @@
44695905 }
44705906 */
44715907
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
-
44875908 /*
44885909 public void Callback(Object obj)
44895910 {
....@@ -4507,26 +5928,9 @@
45075928 }
45085929 */
45095930
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
-
45275931 String GetFile(String dialogName)
45285932 {
4529
- if (GraphreeD.standAlone)
5933
+ if (Grafreed.standAlone)
45305934 {
45315935 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
45325936 browser.show();
....@@ -4590,10 +5994,49 @@
45905994 cButton flashSelectionButton;
45915995 cButton editButton;
45925996 cButton uneditButton;
5997
+ JCheckBox allParamsButton;
45935998 cButton clearpanelButton;
4594
- cButton allParamsButton;
45955999 cButton unselectButton;
45966000
6001
+ cButton restoreCameraButton;
6002
+
6003
+ cButton saveButton;
6004
+ cButton oneStepButton;
6005
+
6006
+ cButton groupButton;
6007
+ cButton ungroupButton;
6008
+ cButton compositeButton;
6009
+ cButton switchButton;
6010
+ cButton loopButton;
6011
+ cButton textureButton;
6012
+
6013
+ cButton skybox1Button;
6014
+ cButton skybox2Button;
6015
+ cButton skybox3Button;
6016
+ cButton skybox4Button;
6017
+ cButton skybox5Button;
6018
+ cButton skybox6Button;
6019
+ cButton skybox7Button;
6020
+
6021
+ cButton skybox11Button;
6022
+ cButton skybox12Button;
6023
+ cButton skybox13Button;
6024
+ cButton skybox14Button;
6025
+ cButton skybox15Button;
6026
+ cButton skybox16Button;
6027
+ cButton skybox17Button;
6028
+
6029
+ cButton gridButton;
6030
+ cButton boxButton;
6031
+ cButton sphereButton;
6032
+ cButton coneButton;
6033
+ cButton torusButton;
6034
+ cButton superButton;
6035
+ cButton kleinButton;
6036
+ cButton particlesButton;
6037
+ cButton overlayButton;
6038
+ cButton lightButton;
6039
+
45976040 cButton screenfitButton;
45986041 cButton screenfitpointButton;
45996042 cButton snapobjectButton;
....@@ -4605,14 +6048,6 @@
46056048
46066049 cButton setsupportButton;
46076050
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
-
46166051 //
46176052 //Composite
46186053 Object3D // to do !!
....@@ -4622,9 +6057,11 @@
46226057 //JTree jTree;
46236058 private MenuItem lookAtItem;
46246059 private MenuItem lookFromItem;
4625
- private MenuItem switchItem;
6060
+ private MenuItem switchViewItem;
46266061 private MenuItem cutItem;
4627
- private MenuItem duplicateItem;
6062
+ private MenuItem undoItem;
6063
+ private MenuItem redoItem;
6064
+ private JMenuItem duplicateItem;
46286065 private MenuItem cloneItem;
46296066 private MenuItem cloneSupportItem;
46306067 private MenuItem overwriteGeoItem;
....@@ -4635,8 +6072,9 @@
46356072 private MenuItem resetsupportItem;
46366073 private MenuItem resetreferencesItem;
46376074 private MenuItem linkverticesItem;
6075
+ private MenuItem relinkverticesItem;
46386076 private MenuItem setMasterItem;
4639
- private MenuItem resetMeshItem;
6077
+ private MenuItem resetAllItem;
46406078 private MenuItem stepAllItem;
46416079 private MenuItem revertMeshItem;
46426080 private MenuItem poseMeshItem;
....@@ -4647,14 +6085,17 @@
46476085 private MenuItem mergeGeometriesItem;
46486086 private MenuItem copyItem;
46496087 private MenuItem pasteItem;
6088
+ private MenuItem pasteIntoItem;
46506089 private MenuItem pasteLinkItem;
46516090 private MenuItem pasteCloneItem;
46526091 private MenuItem pasteExpandItem;
4653
- private MenuItem clearItem;
6092
+ private MenuItem deleteItem;
46546093 private MenuItem clearAllItem;
46556094 private MenuItem genUVItem;
6095
+ private MenuItem genNormalsMESHItem;
46566096 private MenuItem genNormalsCADItem;
46576097 private MenuItem genNormalsORGANItem;
6098
+ private MenuItem genNormalsMINEItem;
46586099 private MenuItem stripifyItem;
46596100 private MenuItem unstripifyItem;
46606101 private MenuItem trimItem;
....@@ -4683,6 +6124,10 @@
46836124 private MenuItem showleavesItem;
46846125 private MenuItem markleavesItem;
46856126 private MenuItem unmarkleavesItem;
6127
+ private MenuItem rewindleavesItem;
6128
+ private MenuItem unrewindleavesItem;
6129
+ private MenuItem randomleavesItem;
6130
+ private MenuItem unrandomleavesItem;
46866131
46876132 private MenuItem flipVItem;
46886133 private MenuItem unflipVItem;
....@@ -4694,14 +6139,17 @@
46946139 private MenuItem panoTexturesItem;
46956140
46966141 private MenuItem resetCentroidItem;
4697
- private MenuItem transformgeometryItem;
6142
+ private MenuItem resetCentroidXZItem;
46986143 private MenuItem resetTransformItem;
6144
+ private MenuItem transformGeometryItem;
6145
+ private MenuItem transformChildrenItem;
6146
+ private MenuItem hideItem;
46996147 private MenuItem grabItem;
47006148 private MenuItem backItem;
47016149 private MenuItem frontItem;
47026150 private MenuItem cameraItem;
47036151 private MenuItem compositeItem;
4704
- private MenuItem randomItem;
6152
+ private MenuItem switchItem;
47056153 private MenuItem physicsItem;
47066154 private MenuItem frameselectorItem;
47076155 private MenuItem scriptNodeItem;
....@@ -4716,6 +6164,7 @@
47166164
47176165 private MenuItem resetParentItem;
47186166 private MenuItem repairParentItem;
6167
+ private MenuItem repairShadowItem;
47196168 private MenuItem sortbysizeItem;
47206169 private MenuItem sortbynameItem;
47216170
....@@ -4724,20 +6173,25 @@
47246173 private MenuItem attachBumpItem;
47256174 private MenuItem detachBumpItem;
47266175 private MenuItem pigmentBumpItem;
6176
+ private MenuItem embedTexturesItem;
6177
+ private MenuItem deEmbedTexturesItem;
47276178
47286179 private MenuItem particleItem;
47296180 private MenuItem ragdollItem;
47306181 private MenuItem ragdoll2Item;
6182
+ private MenuItem heightFieldItem;
6183
+ private MenuItem textureFieldItem;
47316184 private MenuItem gridItem;
47326185 private MenuItem rectoidItem;
47336186 private MenuItem ellipsoidItem;
47346187 private MenuItem coneItem;
47356188 private MenuItem torusItem;
47366189 private MenuItem superItem;
6190
+ private MenuItem kleinItem;
47376191 private MenuItem blobItem;
47386192 private MenuItem latheItem;
47396193 private MenuItem bezierItem;
4740
- private MenuItem checkerItem;
6194
+ private MenuItem overlayItem;
47416195 private MenuItem meshItem;
47426196 // private MenuItem meshGroupItem;
47436197 private MenuItem springItem;
....@@ -4746,6 +6200,7 @@
47466200 private MenuItem csgItem;
47476201 private MenuItem templateItem;
47486202 private MenuItem textureItem;
6203
+ private MenuItem billboardItem;
47496204 private MenuItem shadowXItem;
47506205 private MenuItem shadowYItem;
47516206 private MenuItem shadowZItem;
....@@ -4758,11 +6213,6 @@
47586213 private MenuItem doubleItem;
47596214 private MenuItem tripleItem;
47606215
4761
- private MenuItem importGFDItem;
4762
- private MenuItem importVRMLX3DItem;
4763
- private MenuItem import3DSItem;
4764
- private MenuItem importOBJItem;
4765
-
47666216 private MenuItem computeAOItem;
47676217 private MenuItem recompileItem;
47686218 private MenuItem editScriptItem;
....@@ -4772,4 +6222,8 @@
47726222 private MenuItem analyzeItem;
47736223 private MenuItem dumpItem;
47746224 //boolean freezemodel = false;
6225
+
6226
+ Menu cameraMenu;
6227
+ MenuItem editCameraItem;
6228
+ MenuItem restoreCameraItem;
47756229 }