Normand Briere
2019-07-30 475f8cbdbd96fdbf8f5b216ffebb31a51f25c2f9
GroupEditor.java
....@@ -23,6 +23,240 @@
2323 DragGestureListener, DragSourceListener, DropTargetListener,
2424 ItemListener // ListSelectionListener
2525 {
26
+
27
+ public void AddSkyboxButton(String f, String s, cGridBag row)
28
+ {
29
+ cButton skyboxButton;
30
+ final String path = "cubemaps/" + f + "-skyboxes/" + s;
31
+ row.add(skyboxButton = GetButton(path + "/preview.jpg", !Grafreed.NIMBUSLAF));
32
+ //row.add(skyboxButton = GetButton(path + "/negx.jpg", !Grafreed.NIMBUSLAF));
33
+ skyboxButton.setToolTipText(s);
34
+ skyboxButton.addActionListener(new ActionListener()
35
+ {
36
+ @Override
37
+ public void actionPerformed(ActionEvent e)
38
+ {
39
+ ChangeSkybox(path);
40
+ }
41
+ });
42
+ }
43
+
44
+ public void AddSkyboxTab0(JTabbedPane skyboxpanel)
45
+ {
46
+ cGridBag tab0 = new cGridBag().setVertical(true);
47
+
48
+ tab0.setName("Urban");
49
+ skyboxpanel.add(tab0);
50
+
51
+ cGridBag row0 = new cGridBag();
52
+ cGridBag row1 = new cGridBag();
53
+ cGridBag row2 = new cGridBag();
54
+ cGridBag row3 = new cGridBag();
55
+ cGridBag row4 = new cGridBag();
56
+ cGridBag row5 = new cGridBag();
57
+ cGridBag row6 = new cGridBag();
58
+
59
+ AddSkyboxButton("default", "rgb", row0);
60
+ //AddSkyboxButton("default", "cornell", row0);
61
+ AddSkyboxButton("penguins", "dust", row0);
62
+ AddSkyboxButton("penguins", "tropic", row0);
63
+ AddSkyboxButton("default", "skycube", row0);
64
+
65
+ AddSkyboxButton("default", "uffizi", row1);
66
+ AddSkyboxButton("bridge", "Bridge", row1);
67
+ AddSkyboxButton("bridge", "Bridge2", row1);
68
+ AddSkyboxButton("urban", "GamlaStan2", row1);
69
+
70
+ AddSkyboxButton("urban", "Parliament", row2);
71
+ AddSkyboxButton("urban", "Roundabout", row2);
72
+ AddSkyboxButton("urban", "SaintLazarusChurch", row2);
73
+ AddSkyboxButton("urban", "SaintLazarusChurch2", row2);
74
+
75
+ AddSkyboxButton("urban", "SaintLazarusChurch3", row3);
76
+ AddSkyboxButton("urban", "UnionSquare", row3);
77
+ AddSkyboxButton("urban", "Medborgarplatsen", row3);
78
+ AddSkyboxButton("park", "BerzeliiPark", row3);
79
+
80
+ AddSkyboxButton("park", "Buddha", row4);
81
+ AddSkyboxButton("park", "CNTower2", row4);
82
+ AddSkyboxButton("park", "NiagaraFalls1", row4);
83
+ AddSkyboxButton("park", "NiagaraFalls3", row4);
84
+
85
+ AddSkyboxButton("park", "Park", row5);
86
+ AddSkyboxButton("park", "Pond", row5);
87
+ AddSkyboxButton("park", "Skansen", row5);
88
+ AddSkyboxButton("park", "Skansen2", row5);
89
+
90
+ AddSkyboxButton("park", "Skansen3", row6);
91
+ AddSkyboxButton("park", "Skansen4", row6);
92
+ AddSkyboxButton("park", "Skansen5", row6);
93
+ AddSkyboxButton("park", "Stairs", row6);
94
+
95
+ tab0.add(row0);
96
+ tab0.add(row1);
97
+ tab0.add(row2);
98
+ tab0.add(row3);
99
+ tab0.add(row4);
100
+ tab0.add(row5);
101
+ tab0.add(row6);
102
+
103
+ for (int i=5; --i>=0;)
104
+ {
105
+ //oe.toolboxPanel.Return();
106
+ //tab0.add(new cGridBag());
107
+ }
108
+ }
109
+
110
+ public void AddSkyboxTab1(JTabbedPane skyboxpanel)
111
+ {
112
+ cGridBag tab0 = new cGridBag().setVertical(true);
113
+
114
+ tab0.setName("Nature");
115
+ skyboxpanel.add(tab0);
116
+
117
+ cGridBag row0 = new cGridBag();
118
+ cGridBag row1 = new cGridBag();
119
+ cGridBag row2 = new cGridBag();
120
+ cGridBag row3 = new cGridBag();
121
+ cGridBag row4 = new cGridBag();
122
+ cGridBag row5 = new cGridBag();
123
+ cGridBag row6 = new cGridBag();
124
+
125
+ AddSkyboxButton("beach", "HeartInTheSand", row0);
126
+ AddSkyboxButton("beach", "LarnacaBeach", row0);
127
+ AddSkyboxButton("beach", "PalmTrees", row0);
128
+ AddSkyboxButton("beach", "Tenerife", row0);
129
+
130
+ AddSkyboxButton("beach", "Tenerife2", row1);
131
+ AddSkyboxButton("beach", "Tenerife3", row1);
132
+ AddSkyboxButton("field", "FishPond", row1);
133
+ AddSkyboxButton("field", "Footballfield", row1);
134
+
135
+ AddSkyboxButton("field", "Meadow", row2);
136
+ AddSkyboxButton("field", "Sorsele", row2);
137
+ AddSkyboxButton("field", "Sorsele2", row2);
138
+ AddSkyboxButton("field", "Sorsele3", row2);
139
+
140
+ AddSkyboxButton("forest", "Brudslojan", row3);
141
+ AddSkyboxButton("forest", "Langholmen2", row3);
142
+ AddSkyboxButton("forest", "Plants", row3);
143
+ AddSkyboxButton("mountain", "Maskonaive", row3);
144
+
145
+ AddSkyboxButton("mountain", "Maskonaive2", row4);
146
+ AddSkyboxButton("mountain", "Maskonaive3", row4);
147
+ AddSkyboxButton("mountain", "Ryfjallet", row4);
148
+ AddSkyboxButton("mountain", "Teide", row4);
149
+ AddSkyboxButton("park", "Tantolunden4", row4);
150
+
151
+ AddSkyboxButton("penguins", "wrath", row5);
152
+ AddSkyboxButton("penguins", "yonder", row5);
153
+ AddSkyboxButton("rocky", "Langholmen", row5);
154
+ AddSkyboxButton("rocky", "Skinnarviksberget", row5);
155
+ AddSkyboxButton("rocky", "Tantolunden6", row5);
156
+
157
+ AddSkyboxButton("default", "CloudyHills", row6);
158
+ AddSkyboxButton("daz", "Autumn", row6);
159
+ AddSkyboxButton("daz", "Greenlands", row6);
160
+ AddSkyboxButton("daz", "MountainTrail", row6);
161
+ AddSkyboxButton("daz", "Oasis", row6);
162
+ /*
163
+Autumn
164
+Greenlands
165
+MountainTrail
166
+Oasis
167
+TheRock
168
+TopOfTheWorld
169
+Winter
170
+ */
171
+
172
+ tab0.add(row0);
173
+ tab0.add(row1);
174
+ tab0.add(row2);
175
+ tab0.add(row3);
176
+ tab0.add(row4);
177
+ tab0.add(row5);
178
+ tab0.add(row6);
179
+
180
+ for (int i=5; --i>=0;)
181
+ {
182
+ //oe.toolboxPanel.Return();
183
+ //tab0.add(new cGridBag());
184
+ }
185
+ }
186
+
187
+ public void AddSkyboxTab2(JTabbedPane skyboxpanel)
188
+ {
189
+ cGridBag tab0 = new cGridBag().setVertical(true);
190
+
191
+ tab0.setName("Night");
192
+ skyboxpanel.add(tab0);
193
+
194
+ cGridBag row0 = new cGridBag();
195
+ cGridBag row1 = new cGridBag();
196
+ cGridBag row2 = new cGridBag();
197
+ cGridBag row3 = new cGridBag();
198
+ cGridBag row4 = new cGridBag();
199
+ cGridBag row5 = new cGridBag();
200
+ cGridBag row6 = new cGridBag();
201
+
202
+ AddSkyboxButton("night", "NightPath", row0);
203
+ AddSkyboxButton("night", "PondNight", row0);
204
+ AddSkyboxButton("night", "Powerlines", row0);
205
+ AddSkyboxButton("night", "SwedishRoyalCastle", row0);
206
+
207
+ AddSkyboxButton("urban", "CNTower", row1);
208
+ AddSkyboxButton("bridge", "ArstaBridge", row1);
209
+ AddSkyboxButton("rocky", "Riddarfjarden", row1);
210
+ AddSkyboxButton("penguins", "sleepyhollow", row1);
211
+
212
+ AddSkyboxButton("penguins", "kenon_star", row2);
213
+ AddSkyboxButton("indoors", "DallasW", row2);
214
+ AddSkyboxButton("indoors", "MarriottMadisonWest", row2);
215
+ AddSkyboxButton("indoors", "Vasa", row2);
216
+
217
+ AddSkyboxButton("winter", "Backyard", row3);
218
+ AddSkyboxButton("winter", "Creek", row3);
219
+ AddSkyboxButton("winter", "FootballField3", row3);
220
+ AddSkyboxButton("winter", "Forest", row3);
221
+
222
+ AddSkyboxButton("winter", "HornstullsStrand2", row4);
223
+ AddSkyboxButton("winter", "House", row4);
224
+ AddSkyboxButton("winter", "IceLake", row4);
225
+ AddSkyboxButton("winter", "IceRiver", row4);
226
+
227
+ AddSkyboxButton("winter", "Park3", row5);
228
+ AddSkyboxButton("winter", "PondWinter", row5);
229
+ AddSkyboxButton("winter", "Tantolunden5", row5);
230
+ AddSkyboxButton("winter", "Vindelalven", row5);
231
+
232
+ AddSkyboxButton("daz", "TheRock", row6);
233
+ AddSkyboxButton("daz", "TopOfTheWorld", row6);
234
+ AddSkyboxButton("daz", "Winter", row6);
235
+ AddSkyboxButton("penguins", "desertdawn", row6);
236
+
237
+ tab0.add(row0);
238
+ tab0.add(row1);
239
+ tab0.add(row2);
240
+ tab0.add(row3);
241
+ tab0.add(row4);
242
+ tab0.add(row5);
243
+ tab0.add(row6);
244
+
245
+ for (int i=5; --i>=0;)
246
+ {
247
+ //oe.toolboxPanel.Return();
248
+ //tab0.add(new cGridBag());
249
+ }
250
+ }
251
+
252
+ public void ChangeSkybox(String name)
253
+ {
254
+ //cameraView.envyoff = false;
255
+ group.skyboxname = name;
256
+ group.skyboxext = "jpg";
257
+ cameraView.repaint();
258
+ }
259
+
26260 //ObjEditor objEditor;
27261 public void closeUI2()
28262 {
....@@ -60,6 +294,12 @@
60294 this.copy = this.group = group;
61295 //selectees = this.group.selectees;
62296
297
+ if (copy.versions == null)
298
+ {
299
+ copy.versions = new byte[100][];
300
+ copy.versionindex = -1;
301
+ }
302
+
63303 if(ui)
64304 SetupUI(objEditor);
65305 }
....@@ -74,16 +314,28 @@
74314 this.copy = this.group = copy;
75315 //selectees = this.group.selectees;
76316
77
- SetupMenu2(objEditor);
317
+ SetupMenu2(this); //objEditor);
78318 SetupUI2(objEditor);
79319 objEditor.SetupUI(true);
80320 SetupViews(objEditor);
81321
82322 ((cRadio)radioPanel.getComponent(0)).SetCamera(cameraView.renderCamera, true);
323
+
324
+ if (copy.versions == null)
325
+ {
326
+ copy.versions = new byte[100][];
327
+ copy.versionindex = -1;
328
+
329
+ Save(true);
330
+ }
83331 }
84332
85333 void CloneSelection(boolean supports)
86334 {
335
+ if (Globals.REPLACEONMAKE)
336
+ Save();
337
+ boolean keep = Globals.REPLACEONMAKE;
338
+ Globals.REPLACEONMAKE = false;
87339 // Object3D keep = GrafreeD.clipboard;
88340 //Object3D obj;
89341 for (int i=0; i<group.selection.size(); i++)// Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -94,6 +346,7 @@
94346
95347 makeSomething(clone, i==group.selection.size()-1);
96348 }
349
+ Globals.REPLACEONMAKE = keep;
97350 }
98351
99352 void CloneClipboard(boolean supports)
....@@ -148,28 +401,21 @@
148401
149402 //JTextField nameField;
150403
151
- void SetupMenu2(ObjEditor oe)
404
+ void SetupMenu2(GroupEditor oe)
152405 {
153
- if (Globals.ADVANCED)
154
- {
155
- oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
156
- //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
157
- //cameraMenu.add(switchItem = new MenuItem("Reverse View"));
158
- editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf"));
159
- oe.cameraMenu.add("-");
160
- openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy..."));
161
- openWindowItem.addActionListener(this);
162
- editLeafItem.addActionListener(this);
163
- lookAtItem.addActionListener(this);
164
- //lookFromItem.addActinoListener(this);
165
- //switchItem.addActionListener(this);
166
- }
167
-
406
+ oe.jTree = new cTree();
407
+
168408 Menu menu;
169409 oe.menuBar.add(menu = new Menu("Edit"));
170410 //editItem = menu.add(new MenuItem("Edit"));
171411 //editItem.addActionListener(this);
172
- duplicateItem = menu.add(new MenuItem("Duplicate"));
412
+
413
+// undoItem = menu.add(new MenuItem("Undo"));
414
+// undoItem.addActionListener(this);
415
+// redoItem = menu.add(new MenuItem("Redo"));
416
+// redoItem.addActionListener(this);
417
+// menu.add("-");
418
+ duplicateItem = oe.jTree.popup.add(new JMenuItem("Duplicate"));
173419 duplicateItem.addActionListener(this);
174420 cloneItem = menu.add(new MenuItem("Clone"));
175421 cloneItem.addActionListener(this);
....@@ -185,7 +431,6 @@
185431 copyItem.addActionListener(this);
186432 pasteItem = menu.add(new MenuItem("Paste"));
187433 pasteItem.addActionListener(this);
188
- menu.add("-");
189434
190435 menu.add("-");
191436 pasteIntoItem = menu.add(new MenuItem("Paste into"));
....@@ -197,8 +442,8 @@
197442 // pasteExpandItem = menu.add(new MenuItem("Paste expand"));
198443 // pasteExpandItem.addActionListener(this);
199444 menu.add("-");
200
- clearItem = menu.add(new MenuItem("Clear"));
201
- clearItem.addActionListener(this);
445
+ deleteItem = menu.add(new MenuItem("Delete"));
446
+ deleteItem.addActionListener(this);
202447
203448 if (Globals.ADVANCED)
204449 {
....@@ -206,14 +451,97 @@
206451 clearAllItem = menu.add(new MenuItem("Clear All"));
207452 clearAllItem.addActionListener(this);
208453 }
454
+
455
+ menuBar.add(cameraMenu = new Menu("View"));
456
+ //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer"));
457
+ //zBufferItem.addActionListener(this);
458
+ //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens"));
459
+ //normalLensItem.addActionListener(this);
460
+ cameraMenu.add(restoreCameraItem = new MenuItem("Restore Viewpoint"));
461
+ restoreCameraItem.addActionListener(this);
462
+
463
+// cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen"));
464
+// toggleFullScreenItem.addItemListener(this);
465
+// toggleFullScreenItem.setState(CameraPane.FULLSCREEN);
466
+// cameraMenu.add("-");
467
+//
468
+// cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture"));
469
+// toggleTextureItem.addItemListener(this);
470
+// toggleTextureItem.setState(CameraPane.textureon);
471
+//
472
+// cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch"));
473
+// toggleSwitchItem.addItemListener(this);
474
+// toggleSwitchItem.setState(CameraPane.SWITCH);
475
+
476
+ cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Show Handles"));
477
+ toggleHandleItem.addItemListener(this);
478
+ toggleHandleItem.setState(CameraPane.HANDLES);
479
+
480
+ cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode"));
481
+ togglePaintItem.addItemListener(this);
482
+ togglePaintItem.setState(CameraPane.PAINTMODE);
483
+
484
+ if (Globals.ADVANCED)
485
+ {
486
+ cameraMenu.add("-");
487
+ cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live"));
488
+ toggleLiveItem.addItemListener(this);
489
+ toggleLiveItem.setState(Globals.isLIVE());
209490
491
+ cameraMenu.add(stepItem = new MenuItem("Step"));
492
+ stepItem.addActionListener(this);
493
+ // cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List"));
494
+ // toggleDLItem.addItemListener(this);
495
+ // toggleDLItem.setState(false);
496
+
497
+ cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render"));
498
+ toggleRenderItem.addItemListener(this);
499
+ toggleRenderItem.setState(!CameraPane.frozen);
500
+
501
+ cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug"));
502
+ toggleDebugItem.addItemListener(this);
503
+ toggleDebugItem.setState(Globals.DEBUG);
504
+
505
+ cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum"));
506
+ toggleFrustumItem.addItemListener(this);
507
+ toggleFrustumItem.setState(CameraPane.FRUSTUM);
508
+
509
+ cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact"));
510
+ toggleFootContactItem.addItemListener(this);
511
+ toggleFootContactItem.setState(CameraPane.FOOTCONTACT);
512
+
513
+ cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline"));
514
+ toggleTimelineItem.addItemListener(this);
515
+ }
516
+
517
+// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root"));
518
+// toggleRootItem.addItemListener(this);
519
+// toggleRootItem.setState(false);
520
+// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation"));
521
+// animationItem.addItemListener(this);
522
+// animationItem.setState(CameraPane.ANIMATION);
523
+ cameraMenu.add("-");
524
+ cameraMenu.add(editCameraItem = new MenuItem("Save Viewpoint"));
525
+ editCameraItem.addActionListener(this);
526
+
527
+ if (Globals.ADVANCED)
528
+ {
529
+ oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
530
+ //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
531
+ //cameraMenu.add(switchViewItem = new MenuItem("Reverse View"));
532
+ editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf"));
533
+ oe.cameraMenu.add("-");
534
+ openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy..."));
535
+ openWindowItem.addActionListener(this);
536
+ editLeafItem.addActionListener(this);
537
+ lookAtItem.addActionListener(this);
538
+ //lookFromItem.addActinoListener(this);
539
+ //switchViewItem.addActionListener(this);
540
+ }
541
+
210542 oe.menuBar.add(menu = new Menu("Setting"));
211543 if (Globals.ADVANCED)
212544 {
213
- resetMeshItem = menu.add(new MenuItem("Reset All"));
214
- resetMeshItem.addActionListener(this);
215
- stepAllItem = menu.add(new MenuItem("Step All"));
216
- stepAllItem.addActionListener(this);
217545 revertMeshItem = menu.add(new MenuItem("Revert Meshes"));
218546 revertMeshItem.addActionListener(this);
219547 resetreferencesItem = menu.add(new MenuItem("Reset Mesh References"));
....@@ -253,21 +581,29 @@
253581 }
254582
255583 oe.menuBar.add(menu = new Menu("Group"));
256
- grabItem = menu.add(new MenuItem("Grab"));
257
- grabItem.addActionListener(this);
584
+// grabItem = menu.add(new MenuItem("Grab"));
585
+// grabItem.addActionListener(this);
258586 backItem = menu.add(new MenuItem("Back"));
259587 backItem.addActionListener(this);
260588 frontItem = menu.add(new MenuItem("Front"));
261589 frontItem.addActionListener(this);
262
- compositeItem = menu.add(new MenuItem("Composite"));
263
- compositeItem.addActionListener(this);
590
+// compositeItem = menu.add(new MenuItem("Composite"));
591
+// compositeItem.addActionListener(this);
592
+
593
+ if (Globals.ADVANCED)
594
+ {
264595 hideItem = menu.add(new MenuItem("Hidden Group"));
265596 hideItem.addActionListener(this);
597
+ }
266598 ungroupItem = menu.add(new MenuItem("Ungroup"));
267599 ungroupItem.addActionListener(this);
268
- menu.add("-");
269
- randomItem = menu.add(new MenuItem("Switch node"));
270
- randomItem.addActionListener(this);
600
+
601
+// menu.add("-");
602
+//
603
+// switchItem = menu.add(new MenuItem("Switch node"));
604
+// switchItem.addActionListener(this);
605
+ if (Globals.ADVANCED)
606
+ {
271607 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
272608 switchGeoItem.addActionListener(this);
273609 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
....@@ -275,8 +611,6 @@
275611 morphItem = menu.add(new MenuItem("Morph Group"));
276612 morphItem.addActionListener(this);
277613
278
- if (Globals.ADVANCED)
279
- {
280614 menu.add("-");
281615 physicsItem = menu.add(new MenuItem("Physics"));
282616 physicsItem.addActionListener(this);
....@@ -284,30 +618,29 @@
284618 frameselectorItem.addActionListener(this);
285619 scriptNodeItem = menu.add(new MenuItem("Script Node"));
286620 scriptNodeItem.addActionListener(this);
287
- cameraItem = menu.add(new MenuItem("Camera"));
288
- cameraItem.addActionListener(this);
289621 }
290622
291623 oe.menuBar.add(menu = new Menu("Object"));
292
- textureItem = menu.add(new MenuItem("Texture"));
293
- textureItem.addActionListener(this);
624
+// textureItem = menu.add(new MenuItem("Texture"));
625
+// textureItem.addActionListener(this);
294626 billboardItem = menu.add(new MenuItem("Billboard"));
295627 billboardItem.addActionListener(this);
296628 csgItem = menu.add(new MenuItem("CSG"));
297629 csgItem.addActionListener(this);
298
- shadowXItem = menu.add(new MenuItem("Shadow X"));
630
+ shadowXItem = menu.add(new MenuItem("Shadow Red"));
299631 shadowXItem.addActionListener(this);
300
- shadowYItem = menu.add(new MenuItem("Shadow Y"));
632
+ shadowYItem = menu.add(new MenuItem("Shadow Green"));
301633 shadowYItem.addActionListener(this);
302
- shadowZItem = menu.add(new MenuItem("Shadow Z"));
634
+ shadowZItem = menu.add(new MenuItem("Shadow Blue"));
303635 shadowZItem.addActionListener(this);
636
+ attributeItem = menu.add(new MenuItem("Attribute"));
637
+ attributeItem.addActionListener(this);
638
+
304639 if (Globals.ADVANCED)
305640 {
306641 menu.add("-");
307642 linkerItem = menu.add(new MenuItem("Linker"));
308643 linkerItem.addActionListener(this);
309
- attributeItem = menu.add(new MenuItem("Attribute"));
310
- attributeItem.addActionListener(this);
311644 templateItem = menu.add(new MenuItem("Template"));
312645 templateItem.addActionListener(this);
313646 pointflowItem = menu.add(new MenuItem("Point Flow"));
....@@ -336,7 +669,7 @@
336669 genNormalsMESHItem.addActionListener(this);
337670 if (Globals.ADVANCED)
338671 {
339
- genNormalsMINEItem = menu.add(new MenuItem("My Normals"));
672
+ genNormalsMINEItem = menu.add(new MenuItem("Stitch Normals"));
340673 genNormalsMINEItem.addActionListener(this);
341674 }
342675 stripifyItem = menu.add(new MenuItem("Stripify"));
....@@ -372,6 +705,10 @@
372705 oe.menuBar.add(menu = new Menu("Attributes"));
373706 clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
374707 clearMaterialsItem.addActionListener(this);
708
+ resetAllItem = menu.add(new MenuItem("Reset All"));
709
+ resetAllItem.addActionListener(this);
710
+ stepAllItem = menu.add(new MenuItem("Step All"));
711
+ stepAllItem.addActionListener(this);
375712 menu.add("-");
376713 liveleavesItem = menu.add(new MenuItem("Live Leaves"));
377714 liveleavesItem.addActionListener(this);
....@@ -392,6 +729,14 @@
392729 markleavesItem.addActionListener(this);
393730 unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves"));
394731 unmarkleavesItem.addActionListener(this);
732
+ rewindleavesItem = menu.add(new MenuItem("Rewind Leaves"));
733
+ rewindleavesItem.addActionListener(this);
734
+ unrewindleavesItem = menu.add(new MenuItem("Unrewind Leaves"));
735
+ unrewindleavesItem.addActionListener(this);
736
+ randomleavesItem = menu.add(new MenuItem("Random Leaves"));
737
+ randomleavesItem.addActionListener(this);
738
+ unrandomleavesItem = menu.add(new MenuItem("Unrandom Leaves"));
739
+ unrandomleavesItem.addActionListener(this);
395740 menu.add("-");
396741 flipVItem = menu.add(new MenuItem("Flip V"));
397742 flipVItem.addActionListener(this);
....@@ -417,10 +762,15 @@
417762 attachBumpItem.addActionListener(this);
418763 pigmentBumpItem = menu.add(new MenuItem("Pigment -> Bump"));
419764 pigmentBumpItem.addActionListener(this);
765
+ //embedTexturesItem
420766 detachPigmentItem = menu.add(new MenuItem("Detach Pigment"));
421767 detachPigmentItem.addActionListener(this);
422768 detachBumpItem = menu.add(new MenuItem("Detach Bump"));
423769 detachBumpItem.addActionListener(this);
770
+ embedTexturesItem = menu.add(new MenuItem("Embed Textures"));
771
+ embedTexturesItem.addActionListener(this);
772
+ deEmbedTexturesItem = menu.add(new MenuItem("De-embed Textures"));
773
+ deEmbedTexturesItem.addActionListener(this);
424774 menu.add("-");
425775 sortbysizeItem = menu.add(new MenuItem("Sort by size"));
426776 sortbysizeItem.addActionListener(this);
....@@ -443,25 +793,25 @@
443793 oe.menuBar.add(menu = new Menu("Insert"));
444794 buildCreateMenu(menu);
445795
446
- oe.menuBar.add(menu = new Menu("Include"));
447
- importOBJItem = menu.add(new MenuItem("OBJ file..."));
448
- importOBJItem.addActionListener(this);
449
- menu.add("-");
450
- import3DSItem = menu.add(new MenuItem("3DS file..."));
451
- import3DSItem.addActionListener(this);
452
- menu.add("-");
453
- importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D file..."));
454
- importVRMLX3DItem.addActionListener(this);
455
- menu.add("-");
456
- importGFDItem = menu.add(new MenuItem("GrafreeD file..."));
457
- importGFDItem.addActionListener(this);
458
-
459796 oe.menuBar.add(menu = new Menu("Tools"));
460797 buildToolsMenu(menu);
461798 }
462799
800
+
463801 void SetupUI2(ObjEditor oe)
464802 {
803
+ // June 2019
804
+ if (oe == null)
805
+ {
806
+ //super.SetupUI2(this);
807
+ //return;
808
+ }
809
+
810
+ if (copy != group)
811
+ {
812
+ //super.SetupUI2(this);
813
+ }
814
+
465815 //new Exception().printStackTrace();
466816
467817 oe.radioPanel = new JPanel(new GridBagLayout());
....@@ -490,27 +840,79 @@
490840 oe.radioPanel.add(dummyButton);
491841 oe.buttonGroup.add(dummyButton);
492842 */
843
+ cGridBag copyOptionsPanel = new cGridBag();
844
+
845
+ copyOptionsPanel.preferredHeight = 2;
846
+
493847 //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
494848
495
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints);
496
- liveCB.setToolTipText("Enabled animation");
849
+ //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
850
+ //minButton.setToolTipText("Minimize window");
851
+ //minButton.addActionListener(this);
852
+
853
+ if (Globals.ADVANCED)
854
+ {
855
+ oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
856
+ maxButton.setToolTipText("Maximize window");
857
+ maxButton.addActionListener(this);
858
+ }
859
+
860
+ oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
861
+ fullButton.setToolTipText("Full-screen window");
862
+ fullButton.addActionListener(this);
863
+
864
+ oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
865
+ screenfitButton.setToolTipText("Screen fit");
866
+ screenfitButton.addActionListener(this);
867
+
868
+ oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
869
+ restoreCameraButton.setToolTipText("Restore viewpoint");
870
+ restoreCameraButton.addActionListener(this);
871
+
872
+ copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
873
+ saveButton.setToolTipText("New version");
874
+ saveButton.addActionListener(this);
875
+
876
+ copyOptionsPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
877
+ undoButton.setToolTipText("Previous version");
878
+ undoButton.addActionListener(this);
879
+ undoButton.setEnabled(false);
880
+
881
+ cGridBag updown = new cGridBag().setVertical(true);
882
+ updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
883
+ restoreButton.setToolTipText("Restore current");
884
+ restoreButton.addActionListener(this);
885
+ restoreButton.setEnabled(false);
886
+
887
+ updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
888
+ replaceButton.setToolTipText("Replace current");
889
+ replaceButton.addActionListener(this);
890
+ replaceButton.setEnabled(false);
891
+
892
+ copyOptionsPanel.add(updown);
893
+
894
+ copyOptionsPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
895
+ redoButton.setToolTipText("Next version");
896
+ redoButton.addActionListener(this);
897
+ redoButton.setEnabled(false);
898
+
899
+ oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints);
900
+ liveCB.setToolTipText("Enable animation");
497901 liveCB.addItemListener(this);
498902
499
- oe.toolbarPanel.add(oneStepButton = new cButton("Step", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
903
+ oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
500904 oneStepButton.setToolTipText("Animate one step forward");
501905 oneStepButton.addActionListener(this);
502906
503
- oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints);
907
+ oe.toolbarPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints);
504908 fastCB.setToolTipText("Fast mode");
505909 fastCB.addItemListener(this);
506910
507
- oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
508
- trackCB.setToolTipText("Enable tracking");
509
- trackCB.addItemListener(this);
510
-
511
- oe.toolbarPanel.add(screenfitButton = new cButton("@", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
512
- screenfitButton.setToolTipText("Screen fit");
513
- screenfitButton.addActionListener(this);
911
+ //oe.toolboxPanel.Return();
912
+
913
+// copyOptionsPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints);
914
+// trackCB.setToolTipText("Enable tracking");
915
+// trackCB.addItemListener(this);
514916
515917 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
516918 // screenfitpointButton.addActionListener(this);
....@@ -520,67 +922,155 @@
520922 oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
521923 snapobjectButton.addActionListener(this);
522924 snapobjectButton.setToolTipText("Snap Object");
925
+
926
+ oe.toolbarPanel.add(fourButton = GetButton("icons/controls-horizontal.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
927
+ fourButton.addActionListener(this);
928
+ fourButton.setToolTipText("Show control panel only");
523929 }
524930
525
- oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
526
- flashSelectionButton.setToolTipText("Show selection");
527
- flashSelectionButton.addActionListener(this);
931
+ //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
528932
529
- oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
530
-
531
- oe.toolbarPanel.add(twoButton = new cButton("|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
532
- twoButton.setToolTipText("Show center view only");
933
+ oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
934
+ twoButton.setToolTipText("Show 3D view only");
533935 twoButton.addActionListener(this);
534
- oe.toolbarPanel.add(fourButton = new cButton("+||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
535
- fourButton.addActionListener(this);
536
- fourButton.setToolTipText("Show left panel only");
537
- oe.toolbarPanel.add(sixButton = new cButton("+|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
538
- sixButton.setToolTipText("2-column layout left");
539
- sixButton.addActionListener(this);
540
- oe.toolbarPanel.add(threeButton = new cButton("|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
541
- threeButton.setToolTipText("2-column layout right");
936
+ this.fullscreenLayout = twoButton;
937
+
938
+ oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
939
+ threeButton.setToolTipText("Show controls and 3D view");
542940 threeButton.addActionListener(this);
543
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
544
- sevenButton.setToolTipText("3-column layout");
545
- sevenButton.addActionListener(this);
941
+ oe.toolbarPanel.add(sixButton = GetButton("icons/viewcontrols.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
942
+ sixButton.setToolTipText("Show 3D view and controls");
943
+ sixButton.addActionListener(this);
944
+// oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
945
+// sevenButton.setToolTipText("3-column layout");
946
+// sevenButton.addActionListener(this);
546947 //
547948
548
- oe.toolbarPanel.add(rootButton = new cButton("o o o", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
549
- rootButton.setToolTipText("Edit selection in new tab");
949
+ oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
950
+ rootButton.setToolTipText("Open selection in new tab");
550951 rootButton.addActionListener(this);
551952
552
- oe.toolbarPanel.add(closeButton = new cButton("X", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
953
+ oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
553954 closeButton.setToolTipText("Close tab");
554955 closeButton.addActionListener(this);
555956 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
556957 //clearButton.addActionListener(this);
557
-
558
- cGridBag commandsPanel = new cGridBag();
958
+
959
+ cGridBag row1 = new cGridBag();
559960
560
- commandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
561
- editButton.setToolTipText("Edit selection");
961
+ // INSERT
962
+ row1.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
963
+ gridButton.setToolTipText("Create grid");
964
+ gridButton.addActionListener(this);
965
+
966
+ row1.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
967
+ boxButton.setToolTipText("Create box");
968
+ boxButton.addActionListener(this);
969
+
970
+ row1.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
971
+ sphereButton.setToolTipText("Create sphere");
972
+ sphereButton.addActionListener(this);
973
+
974
+ row1.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
975
+ coneButton.setToolTipText("Create cone");
976
+ coneButton.addActionListener(this);
977
+
978
+ row1.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
979
+ torusButton.setToolTipText("Create torus");
980
+ torusButton.addActionListener(this);
981
+
982
+ row1.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
983
+ superButton.setToolTipText("Create superellipsoid");
984
+ superButton.addActionListener(this);
985
+
986
+ if (Globals.ADVANCED)
987
+ {
988
+ oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
989
+ kleinButton.setToolTipText("Create Klein bottle");
990
+ kleinButton.addActionListener(this);
991
+ }
992
+
993
+ row1.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
994
+ particlesButton.setToolTipText("Create particle system");
995
+ particlesButton.addActionListener(this);
996
+
997
+ oe.toolboxPanel.add(row1);
998
+
999
+ cGridBag row2 = new cGridBag();
1000
+
1001
+ row2.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1002
+ groupButton.setToolTipText("Create group");
1003
+ groupButton.addActionListener(this);
1004
+
1005
+ row2.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1006
+ compositeButton.setToolTipText("Create composite");
1007
+ compositeButton.addActionListener(this);
1008
+
1009
+ row2.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1010
+ switchButton.setToolTipText("Create item switcher");
1011
+ switchButton.addActionListener(this);
1012
+
1013
+ row2.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1014
+ loopButton.setToolTipText("Create loop");
1015
+ loopButton.addActionListener(this);
1016
+
1017
+ row2.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1018
+ textureButton.setToolTipText("Create texture");
1019
+ textureButton.addActionListener(this);
1020
+
1021
+ row2.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1022
+ overlayButton.setToolTipText("Create overlay");
1023
+ overlayButton.addActionListener(this);
1024
+
1025
+ row2.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1026
+ lightButton.setToolTipText("Create light");
1027
+ lightButton.addActionListener(this);
1028
+
1029
+ oe.toolboxPanel.add(row2);
1030
+
1031
+ // ENVYMAPS
1032
+ cGridBag skyboxpane = new cGridBag();
1033
+ skyboxpane.preferredHeight = 100;
1034
+
1035
+ oe.toolboxPanel.add(skyboxpane);
1036
+
1037
+ JTabbedPane skyboxpanel = new JTabbedPane();
1038
+ skyboxpane.add(skyboxpanel);
1039
+
1040
+ AddSkyboxTab0(skyboxpanel);
1041
+ AddSkyboxTab1(skyboxpanel);
1042
+ AddSkyboxTab2(skyboxpanel);
1043
+
1044
+ // EDIT panel
1045
+ editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1046
+ editButton.setToolTipText("Pin selection controls");
5621047 editButton.addActionListener(this);
5631048
564
- commandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
565
- uneditButton.setToolTipText("Unedit selection");
1049
+ editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1050
+ uneditButton.setToolTipText("Remove selection controls");
5661051 uneditButton.addActionListener(this);
5671052
568
- commandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
569
- allParamsButton.setToolTipText("Edit all params");
1053
+ editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
1054
+ allParamsButton.setToolTipText("Show all controle");
5701055 allParamsButton.addActionListener(this);
5711056
572
- commandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1057
+ editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
5731058 clearPanelButton.setToolTipText("Clear edit panel");
5741059 clearPanelButton.addActionListener(this);
5751060
576
- commandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1061
+ editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
5771062 unselectButton.setToolTipText("Unselect");
5781063 unselectButton.addActionListener(this);
5791064
580
- commandsPanel.preferredHeight = 1;
1065
+ editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
1066
+ flashSelectionButton.setToolTipText("Highlight selection");
1067
+ flashSelectionButton.addActionListener(this);
5811068
582
- oe.treePanel.add(commandsPanel);
583
- oe.treePanel.Return();
1069
+ editCommandsPanel.preferredHeight = 1;
1070
+
1071
+ SetPinStates(false);
1072
+// oe.treePanel.add(commandsPanel);
1073
+// oe.treePanel.Return();
5841074
5851075 // oe.aConstraints.gridx += 1;
5861076 // oe.aConstraints.weighty = 0;
....@@ -597,32 +1087,20 @@
5971087
5981088 JScrollPane jSP;
5991089 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
600
- jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints);
1090
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints);
6011091 ResetModel();
6021092
6031093 oe.treePanel.add(jSPPanel);
6041094 oe.treePanel.Return();
6051095
606
- cGridBag copyOptionsPanel = new cGridBag();
607
-
608
- copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
609
- colorCB.setToolTipText("Copy color when dropped");
610
- colorCB.addItemListener(this);
611
-
612
- copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
613
- materialCB.setToolTipText("Copy material when dropped");
614
- materialCB.addItemListener(this);
615
-
616
- copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
617
- textureCB.setToolTipText("Copy texture when dropped");
618
- textureCB.addItemListener(this);
619
-
620
- copyOptionsPanel.preferredHeight = 1;
6211096 oe.treePanel.add(copyOptionsPanel);
6221097 oe.treePanel.Return();
1098
+ cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0);
1099
+ versionSlider = (cNumberSlider)sliderPane.getComponent(1);
1100
+ sliderPane.preferredHeight = 1;
6231101
624
-// mainPanel.setDividerLocation(0.5); //1.0);
625
-// mainPanel.setResizeWeight(0.5);
1102
+// mainPanel.setDividerLocation(0.1); //1.0);
1103
+ mainPanel.setResizeWeight(0.4);
6261104
6271105 //jList.addListSelectionListener(this);
6281106 oe.jTree.addTreeSelectionListener(this);
....@@ -630,7 +1108,7 @@
6301108 //jTree.setEditable(true);
6311109 oe.jTree.setDragEnabled(true);
6321110 //jTree.setPreferredSize(new Dimension(10,10));
633
- jSP.setPreferredSize(new Dimension(100,200));
1111
+ //jSP.setPreferredSize(new Dimension(100,200));
6341112
6351113 oe.jTree.setCellRenderer(new cTreeModel.Renderer());
6361114
....@@ -642,29 +1120,49 @@
6421120 dgr.addDragGestureListener(this);
6431121 }catch(Exception e) {}
6441122 */
645
- radio.layout = sevenButton;
1123
+ radio.layout = sixButton; // sevenButton;
6461124 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
6471125 }
6481126
6491127 void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
6501128 {
1129
+ panel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
1130
+ colorCB.setToolTipText("Copy color when dropped");
1131
+ colorCB.addItemListener(this);
1132
+
1133
+ panel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
1134
+ materialCB.setToolTipText("Copy material when dropped");
1135
+ materialCB.addItemListener(this);
1136
+
1137
+ panel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
1138
+ textureCB.setToolTipText("Copy texture when dropped");
1139
+ textureCB.addItemListener(this);
1140
+
1141
+ panel.Return();
1142
+
6511143 panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
6521144 boxCB.setToolTipText("Display bounding boxes");
6531145 boxCB.addItemListener(this);
6541146
6551147 panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
656
- zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
1148
+ zoomBoxCB.setToolTipText("Display only for wheel");
6571149 zoomBoxCB.addItemListener(this);
6581150
6591151 if (true) // Globals.ADVANCED)
6601152 {
661
- panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
662
- supportCB.setToolTipText("Enable rigging");
663
- supportCB.addItemListener(this);
1153
+// panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
1154
+// supportCB.setToolTipText("Enable rigging");
1155
+// supportCB.addItemListener(this);
1156
+
1157
+ panel.add(freezeCB = new cCheckBox("Freeze", Globals.FREEZEONMOVE)); //, constraints);
1158
+ freezeCB.setToolTipText("Fast moving camera");
1159
+ freezeCB.addItemListener(this);
6641160
6651161 // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
6661162 // localCB.addItemListener(this);
6671163
1164
+ panel.Return();
1165
+
6681166 panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
6691167 crowdCB.setToolTipText("Used for crowds");
6701168 crowdCB.addItemListener(this);
....@@ -681,6 +1179,8 @@
6811179 // panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
6821180 // speakerMocapCB.addItemListener(this);
6831181
1182
+ panel.Return();
1183
+
6841184 if (false)
6851185 {
6861186 // handled in scripts
....@@ -695,42 +1195,85 @@
6951195 //constraints.gridy += 1;
6961196 panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
6971197 smoothfocusCB.addItemListener(this);
1198
+ panel.Return();
6981199 }
6991200
7001201 //constraints.gridx += 1;
7011202 //panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
7021203 // debugCB.addItemListener(this);
7031204
1205
+ panel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
1206
+ trackCB.setToolTipText("Enable tracking target");
1207
+ trackCB.addItemListener(this);
1208
+
7041209 panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
1210
+ oeilCB.setToolTipText("Move camera when tracking");
7051211 oeilCB.addItemListener(this);
7061212
1213
+ panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints);
1214
+ shadowCB.setToolTipText("When live compute shadows");
1215
+ shadowCB.addItemListener(this);
1216
+
1217
+ panel.Return();
1218
+ panel.add(toggleTextureCB = new cCheckBox("Textures", CameraPane.textureon)); //, constraints);
1219
+ toggleTextureCB.setToolTipText("Load textures");
1220
+ toggleTextureCB.addItemListener(this);
1221
+
1222
+ panel.add(toggleSwitchCB = new cCheckBox("Switch", CameraPane.SWITCH)); //, constraints);
1223
+ toggleSwitchCB.setToolTipText("Choose a single item");
1224
+ toggleSwitchCB.addItemListener(this);
1225
+
1226
+ panel.add(autokeepCB = new cCheckBox("Auto-replace", Globals.REPLACEONMAKE)); //, constraints);
1227
+ autokeepCB.setToolTipText("On structure change");
1228
+ autokeepCB.addItemListener(this);
1229
+
1230
+ panel.Return();
1231
+ if (Globals.ADVANCED)
1232
+ {
7071233 panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
7081234 lookAtCB.setToolTipText("Look-at target");
7091235 lookAtCB.addItemListener(this);
1236
+ }
7101237
7111238 }
7121239
7131240 cGridBag fill = new cGridBag();
714
-
7151241 fill.preferredHeight = 200;
1242
+ cGridBag fill2 = new cGridBag();
1243
+ fill2.preferredHeight = 200;
1244
+ cGridBag fill3 = new cGridBag();
1245
+ fill3.preferredHeight = 200;
7161246
7171247 panel.add(fill);
1248
+ panel.add(fill2);
1249
+ panel.add(fill3);
7181250
7191251 }
7201252
7211253 void EditObject(Object3D obj)
7221254 {
7231255 cRadio radioButton = new cRadio(obj.name);
1256
+
1257
+ // June 2019. Patch to avoid bug with transparency.
1258
+ radioButton.hadMaterial = obj.material != null;
1259
+ if (!radioButton.hadMaterial)
1260
+ {
1261
+ obj.material = new cMaterial();
1262
+ }
1263
+
7241264 radioButton.SetObject(obj);
725
- radioButton.layout = sevenButton;
1265
+ radioButton.layout = sixButton; // sevenButton;
7261266 radioButton.SetCamera(cameraView.renderCamera, false);
7271267 radioButton.addActionListener(this);
7281268 radioPanel.add(radioButton);
7291269 buttonGroup.add(radioButton);
7301270 radioButton.doClick();
7311271 }
1272
+
7321273 void SetupViews(ObjEditor oe)
7331274 {
1275
+ theFrame = this;
1276
+
7341277 oe.SetupViews();
7351278
7361279 System.out.println("SetupViews");
....@@ -739,23 +1282,28 @@
7391282 /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this);
7401283 }
7411284
742
- JCheckBox liveCB;
743
- JCheckBox supportCB;
744
- JCheckBox localCB;
745
- JCheckBox crowdCB;
746
- JCheckBox smoothCB;
747
- JCheckBox fastCB;
748
- JCheckBox slowCB;
749
- JCheckBox boxCB;
750
- JCheckBox zoomBoxCB;
751
- JCheckBox trackCB;
752
- JCheckBox smoothfocusCB;
1285
+ cToggleButton liveCB;
1286
+ cCheckBox supportCB;
1287
+ cCheckBox localCB;
1288
+ cCheckBox crowdCB;
1289
+ cCheckBox smoothCB;
1290
+ cToggleButton fastCB;
1291
+ cCheckBox slowCB;
1292
+ cCheckBox boxCB;
1293
+ cCheckBox zoomBoxCB;
1294
+ cCheckBox freezeCB;
1295
+ //cToggleButton trackCB;
1296
+ cCheckBox trackCB;
1297
+ cCheckBox smoothfocusCB;
7531298 // JCheckBox speakerMocapCB;
754
- JCheckBox speakerCameraCB;
755
- JCheckBox speakerFocusCB;
756
- JCheckBox debugCB;
757
- JCheckBox oeilCB;
758
- JCheckBox lookAtCB;
1299
+ cCheckBox speakerCameraCB;
1300
+ cCheckBox speakerFocusCB;
1301
+ cCheckBox debugCB;
1302
+
1303
+ cCheckBox oeilCB;
1304
+ cCheckBox shadowCB;
1305
+ cCheckBox autokeepCB;
1306
+ cCheckBox lookAtCB;
7591307
7601308 // static int COLOR = 1;
7611309 // static int MATERIAL = 2;
....@@ -763,9 +1311,9 @@
7631311
7641312 int dropAttributes = Object3D.COLOR | Object3D.MATERIAL;
7651313
766
- JCheckBox colorCB;
767
- JCheckBox materialCB;
768
- JCheckBox textureCB;
1314
+ cCheckBox colorCB;
1315
+ cCheckBox materialCB;
1316
+ cCheckBox textureCB;
7691317
7701318 public void itemStateChanged(ItemEvent e)
7711319 {
....@@ -793,6 +1341,7 @@
7931341 } else if(e.getSource() == liveCB)
7941342 {
7951343 cameraView.ToggleLive();
1344
+ refreshContents(false);
7961345 }
7971346 else if(e.getSource() == supportCB)
7981347 {
....@@ -857,6 +1406,18 @@
8571406 {
8581407 cameraView.ToggleOeil();
8591408 }
1409
+ else if(e.getSource() == shadowCB)
1410
+ {
1411
+ Globals.COMPUTESHADOWWHENLIVE ^= true;
1412
+ }
1413
+ else if(e.getSource() == freezeCB)
1414
+ {
1415
+ Globals.FREEZEONMOVE ^= true;
1416
+ }
1417
+ else if(e.getSource() == autokeepCB)
1418
+ {
1419
+ Globals.REPLACEONMAKE ^= true;
1420
+ }
8601421 else if(e.getSource() == lookAtCB)
8611422 {
8621423 cameraView.ToggleLookAt();
....@@ -873,7 +1434,8 @@
8731434
8741435 /**/
8751436 //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this);
876
- TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1437
+ //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1438
+ TreePath path = objEditor.jTree.getSelectionPath();
8771439 if ((path == null) || (path.getPathCount() <= 1)) {
8781440 // We can't move the root node or an empty selection
8791441 return;
....@@ -936,8 +1498,6 @@
9361498 }
9371499 }
9381500
939
- String string = (String) object;
940
-
9411501 System.out.println("Transfer = " + object + "; drop : " + target);
9421502 // if( object instanceof java.io.File[])
9431503 // {
....@@ -945,6 +1505,8 @@
9451505 // objEditor.DropFile((java.io.File[]) object, true);
9461506 // return;
9471507 // }
1508
+
1509
+ String string = object.toString();
9481510
9491511 // File path for Mac and Windows
9501512 if (string.charAt(0) == '/' || string.charAt(1) == ':')
....@@ -990,23 +1552,33 @@
9901552
9911553 assert target == objEditor.jTree;
9921554 TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y);
1555
+ Object3D destinationLeaf;
9931556 try {
994
- Object3D dummy = (Composite) destinationPath.getLastPathComponent();
1557
+ destinationLeaf = (Composite) destinationPath.getLastPathComponent();
9951558 } catch (Exception e) {
9961559 System.out.println("destinationPath : " + destinationPath);
9971560 return;
9981561 }
9991562
1000
- if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1563
+ for (int i=group.selection.size(); --i>=0;)
10011564 {
1565
+ Object3D child = (Object3D)group.selection.elementAt(i);
1566
+
1567
+ // Cannot move into itself
1568
+ if (child == destinationLeaf)
1569
+ return;
1570
+ }
1571
+
1572
+// june 2019 if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1573
+// {
10021574 loadClipboard(true);
10031575 objEditor.jTree.setSelectionPath(destinationPath);
10041576 pasteInto(false, false);
1005
- } else {
1006
- loadClipboard(false);
1007
- objEditor.jTree.setSelectionPath(destinationPath);
1008
- pasteInto(false, false); // true); // ???
1009
- }
1577
+// } else {
1578
+// loadClipboard(false);
1579
+// objEditor.jTree.setSelectionPath(destinationPath);
1580
+// pasteInto(false, false); // true); // ???
1581
+// }
10101582 }
10111583 public void dropActionChanged(DropTargetDragEvent dtde)
10121584 // Called if the user has modified the current drop gesture
....@@ -1111,22 +1683,30 @@
11111683 {
11121684 //heightFieldItem = menu.add(new MenuItem("Height Field"));
11131685 //heightFieldItem.addActionListener(this);
1114
- gridItem = menu.add(new MenuItem("Grid"));
1115
- gridItem.addActionListener(this);
1116
- rectoidItem = menu.add(new MenuItem("Box"));
1117
- rectoidItem.addActionListener(this);
1118
- ellipsoidItem = menu.add(new MenuItem("Sphere"));
1119
- ellipsoidItem.addActionListener(this);
1120
- coneItem = menu.add(new MenuItem("Cone"));
1121
- coneItem.addActionListener(this);
1122
- torusItem = menu.add(new MenuItem("Torus"));
1123
- torusItem.addActionListener(this);
1124
- superItem = menu.add(new MenuItem("Superellipsoid"));
1125
- superItem.addActionListener(this);
1686
+// gridItem = menu.add(new MenuItem("Grid"));
1687
+// gridItem.addActionListener(this);
1688
+// rectoidItem = menu.add(new MenuItem("Box"));
1689
+// rectoidItem.addActionListener(this);
1690
+// ellipsoidItem = menu.add(new MenuItem("Sphere"));
1691
+// ellipsoidItem.addActionListener(this);
1692
+// coneItem = menu.add(new MenuItem("Cone"));
1693
+// coneItem.addActionListener(this);
1694
+// torusItem = menu.add(new MenuItem("Torus"));
1695
+// torusItem.addActionListener(this);
1696
+// superItem = menu.add(new MenuItem("Superellipsoid"));
1697
+// superItem.addActionListener(this);
1698
+
1699
+ cameraItem = menu.add(new MenuItem("Camera"));
1700
+ cameraItem.addActionListener(this);
1701
+
1702
+ if (!Globals.ADVANCED)
1703
+ {
11261704 kleinItem = menu.add(new MenuItem("Klein Bottle"));
11271705 kleinItem.addActionListener(this);
1128
- particleItem = menu.add(new MenuItem("Particle system"));
1129
- particleItem.addActionListener(this);
1706
+ }
1707
+
1708
+// particleItem = menu.add(new MenuItem("Particle system"));
1709
+// particleItem.addActionListener(this);
11301710 if (Globals.ADVANCED)
11311711 {
11321712 ragdollItem = menu.add(new MenuItem("Rag Walk"));
....@@ -1152,15 +1732,15 @@
11521732 }
11531733 bezierItem = menu.add(new MenuItem("Bezier Patch"));
11541734 bezierItem.addActionListener(this);
1155
- overlayItem = menu.add(new MenuItem("Overlay"));
1156
- overlayItem.addActionListener(this);
1157
- lightItem = menu.add(new MenuItem("Light"));
1158
- lightItem.addActionListener(this);
1735
+// overlayItem = menu.add(new MenuItem("Overlay"));
1736
+// overlayItem.addActionListener(this);
1737
+// lightItem = menu.add(new MenuItem("Light"));
1738
+// lightItem.addActionListener(this);
11591739 menu.add("-");
11601740 //superLoopItem = menu.add(new MenuItem("Super Loop"));
11611741 //superLoopItem.addActionListener(this);
1162
- loopItem = menu.add(new MenuItem("Loop"));
1163
- loopItem.addActionListener(this);
1742
+// loopItem = menu.add(new MenuItem("Loop"));
1743
+// loopItem.addActionListener(this);
11641744 doubleItem = menu.add(new MenuItem("Fork"));
11651745 doubleItem.addActionListener(this);
11661746 if (Globals.ADVANCED)
....@@ -1176,6 +1756,9 @@
11761756 animationItem.addItemListener(this);
11771757 animationItem.setState(Globals.ANIMATION);
11781758
1759
+ menu.add(archiveItem = new MenuItem("Archive3D..."));
1760
+ archiveItem.addActionListener(this);
1761
+
11791762 menu.add("-");
11801763 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
11811764 parseverticesItem.addActionListener(this);
....@@ -1188,6 +1771,8 @@
11881771 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
11891772 reduce34MorphItem.addActionListener(this);
11901773 menu.add("-");
1774
+ menu.add(memoryItem = new MenuItem("Memory Usage"));
1775
+ memoryItem.addActionListener(this);
11911776 menu.add(computeAOItem = new MenuItem("Compute AO"));
11921777 computeAOItem.addActionListener(this);
11931778
....@@ -1196,11 +1781,9 @@
11961781 mirrorItem = menu.add(new MenuItem("Mirror Poses"));
11971782 mirrorItem.addActionListener(this);
11981783 menu.add("-");
1199
- menu.add(memoryItem = new MenuItem("Memory Usage"));
1200
- memoryItem.addActionListener(this);
12011784 menu.add(analyzeItem = new MenuItem("Analyze"));
12021785 analyzeItem.addActionListener(this);
1203
- menu.add(dumpItem = new MenuItem("Dump"));
1786
+ menu.add(dumpItem = new MenuItem("Print"));
12041787 dumpItem.addActionListener(this);
12051788 // menu.add(pathItem = new MenuItem("From-to path"));
12061789 // pathItem.addActionListener(this);
....@@ -1341,9 +1924,34 @@
13411924 shadow.material = new cMaterial(obj.material);
13421925 shadow.material.diffuse = 0.0001f;
13431926 shadow.material.specular = 0.0001f;
1927
+ //shadow.projectedVertices[1].x = 300;
13441928
13451929 makeSomething(shadow);
13461930 }
1931
+
1932
+ private void ClearUnpinned()
1933
+ {
1934
+ //for (Object3D obj : listUI)
1935
+ for (int i=listUI.size(); --i>=0;)
1936
+ {
1937
+ Object3D obj = listUI.elementAt(i);
1938
+ if (!obj.pinned)
1939
+ {
1940
+ obj.CloseUI();
1941
+ listUI.remove(i);
1942
+ }
1943
+ }
1944
+ }
1945
+
1946
+ private void EditElement(Object3D elem, boolean newWindow)
1947
+ {
1948
+ // if (!(elem instanceof Composite))
1949
+ // newWindow = false;
1950
+ listUI.add(elem);
1951
+ elem.openEditWindow(this, newWindow); //, false);
1952
+ System.out.println("edit : " + elem);
1953
+ elem.editWindow.refreshContents(true); // ? new
1954
+ }
13471955
13481956 /**
13491957 * applyExample
....@@ -1588,7 +2196,7 @@
15882196 {
15892197 ScreenFit();
15902198 } else
1591
- if (source == switchItem)
2199
+ if (source == switchViewItem)
15922200 {
15932201 cVector v1 = new cVector();
15942202 cVector v2 = new cVector();
....@@ -1597,11 +2205,11 @@
15972205 objEditor.cameraView.renderCamera.setAim(v2, v1);
15982206 objEditor.cameraView.repaint();
15992207 } else
1600
- if (source == rectoidItem)
2208
+ if (source == rectoidItem || source == boxButton)
16012209 {
16022210 makeSomething(new Box());
16032211 } else
1604
- if (source == particleItem)
2212
+ if (source == particleItem || source == particlesButton)
16052213 {
16062214 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
16072215 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1680,27 +2288,27 @@
16802288
16812289 makeSomething(obj);
16822290 } else
1683
- if (source == gridItem)
2291
+ if (source == gridItem || source == gridButton)
16842292 {
16852293 makeSomething(new Grid());
16862294 } else
1687
- if (source == ellipsoidItem)
2295
+ if (source == ellipsoidItem || source == sphereButton)
16882296 {
16892297 makeSomething(new Sphere());
16902298 } else
1691
- if (source == coneItem)
2299
+ if (source == coneItem || source == coneButton)
16922300 {
16932301 makeSomething(new Cone());
16942302 } else
1695
- if (source == torusItem)
2303
+ if (source == torusItem || source == torusButton)
16962304 {
16972305 makeSomething(new Torus());
16982306 } else
1699
- if (source == superItem)
2307
+ if (source == superItem || source == superButton)
17002308 {
17012309 makeSomething(new Superellipsoid());
17022310 } else
1703
- if (source == kleinItem)
2311
+ if (source == kleinItem || source == kleinButton)
17042312 {
17052313 makeSomething(new Klein());
17062314 } else
....@@ -1720,7 +2328,7 @@
17202328 {
17212329 makeSomething(new BezierSurface());
17222330 } else
1723
- if (source == overlayItem)
2331
+ if (source == overlayItem || source == overlayButton)
17242332 {
17252333 /*
17262334 Object3D obj = new BezierSurface(5,8);
....@@ -1768,10 +2376,27 @@
17682376 s.setup();
17692377 makeSomething(s);
17702378 } else
1771
- if (source == lightItem)
2379
+ if (source == lightItem || source == lightButton)
17722380 {
17732381 makeSomething(new Light());
17742382 } else
2383
+// if (source == skybox1Button ||
2384
+// source == skybox2Button ||
2385
+// source == skybox3Button ||
2386
+// source == skybox4Button ||
2387
+// source == skybox5Button ||
2388
+// source == skybox6Button ||
2389
+// source == skybox7Button ||
2390
+// source == skybox11Button ||
2391
+// source == skybox12Button ||
2392
+// source == skybox13Button ||
2393
+// source == skybox14Button ||
2394
+// source == skybox15Button ||
2395
+// source == skybox16Button ||
2396
+// source == skybox17Button)
2397
+// {
2398
+// ChangeSkybox(source);
2399
+// } else
17752400 if (source == csgItem)
17762401 {
17772402 group(new CSG());
....@@ -1818,30 +2443,30 @@
18182443
18192444 group(g);
18202445 } else
1821
- if (source == loopItem)
2446
+ if (source == loopItem || source == loopButton)
18222447 {
18232448 Composite csg = new GroupLeaf();
18242449 csg.count = 5;
18252450 group(csg);
1826
- Composite child = new cGroup();
2451
+ Composite child = new cGroup("Branch");
18272452 csg.addChild(child);
18282453 child.addChild(csg);
18292454 } else
18302455 if (source == doubleItem)
18312456 {
1832
- Composite csg = new GroupLeaf();
2457
+ Composite csg = new GroupLeaf("Fork");
18332458 csg.count = 5;
18342459 group(csg);
1835
- Composite child = new cGroup();
2460
+ Composite child = new cGroup("Branch A");
18362461 csg.addChild(child);
18372462 child.addChild(csg);
1838
- child = new cGroup();
2463
+ child = new cGroup("Branch B");
18392464 csg.addChild(child);
18402465 child.addChild(csg);
18412466 } else
18422467 if (source == tripleItem)
18432468 {
1844
- Composite csg = new GroupLeaf();
2469
+ Composite csg = new GroupLeaf("Trident");
18452470 csg.count = 4;
18462471 group(csg);
18472472 Composite child = new cGroup();
....@@ -1854,35 +2479,10 @@
18542479 csg.addChild(child);
18552480 child.addChild(csg);
18562481 } else
1857
-
1858
- if (source == importGFDItem)
1859
- {
1860
- ImportGFD();
1861
- } else
1862
- if (source == importVRMLX3DItem)
1863
- {
1864
- ImportVRMLX3D();
1865
- } else
1866
- if (source == import3DSItem)
1867
- {
1868
- objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
1869
- } else
1870
- if (source == importOBJItem)
1871
- {
1872
- //objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1873
- FileDialog browser = new FileDialog(frame, "Import OBJ", FileDialog.LOAD);
1874
- browser.setVisible(true);
1875
- String filename = browser.getFile();
1876
- if (filename != null && filename.length() > 0)
1877
- {
1878
- String fullname = browser.getDirectory() + filename;
1879
- makeSomething(ReadOBJ(fullname), true);
1880
- }
1881
- } else
18822482 if (source == computeAOItem)
18832483 {
18842484 Globals.drawMode = CameraPane.OCCLUSION;
1885
- Globals.theRenderer.repaint();
2485
+ cameraView.repaint();
18862486 } else
18872487 if (source == recompileItem)
18882488 {
....@@ -1916,6 +2516,46 @@
19162516 {
19172517 DumpObject();
19182518 } else
2519
+ if (source == minButton)
2520
+ {
2521
+ Minimize();
2522
+ } else
2523
+ if (source == maxButton)
2524
+ {
2525
+ Maximize();
2526
+ } else
2527
+ if (source == fullButton)
2528
+ {
2529
+ ToggleFullScreen();
2530
+ } else
2531
+ if (source == undoButton)
2532
+ {
2533
+ // Go to previous version
2534
+ //if (!Undo())
2535
+ //java.awt.Toolkit.getDefaultToolkit().beep();
2536
+ Undo();
2537
+ } else
2538
+ if (source == restoreButton)
2539
+ {
2540
+ // Restore current version
2541
+ Restore();
2542
+ } else
2543
+ if (source == replaceButton)
2544
+ {
2545
+ // Overwrite current version
2546
+ Replace();
2547
+ } else
2548
+ if (source == redoButton)
2549
+ {
2550
+ // Go to next version
2551
+ Redo();
2552
+ } else
2553
+ if (source == saveButton)
2554
+ {
2555
+ // Save a new version
2556
+ if (!Save(true))
2557
+ java.awt.Toolkit.getDefaultToolkit().beep();
2558
+ } else
19192559 if (source == oneStepButton)
19202560 {
19212561 Globals.ONESTEP = true;
....@@ -1923,17 +2563,14 @@
19232563 } else
19242564 if (source == screenfitButton)
19252565 {
1926
- //Reload(lastConverter, lastFilename, true);
19272566 ScreenFit();
19282567 } else
19292568 if (source == screenfitpointButton)
19302569 {
1931
- //Reload(lastConverter, lastFilename, true);
19322570 ScreenFitPoint();
19332571 } else
19342572 if (source == snapobjectButton)
19352573 {
1936
- //Reload(lastConverter, lastFilename, true);
19372574 SnapObject();
19382575 } else
19392576 // if (event.getSource() == recompileButton)
....@@ -1969,6 +2606,14 @@
19692606 if (source == cutItem || source == clearButton)
19702607 {
19712608 loadClipboard(true);
2609
+ } else
2610
+ if (source == undoItem)
2611
+ {
2612
+ Undo();
2613
+ } else
2614
+ if (source == redoItem)
2615
+ {
2616
+ Redo();
19722617 } else
19732618 if (source == duplicateItem)
19742619 {
....@@ -2281,7 +2926,7 @@
22812926 {
22822927 RevertMeshes();
22832928 } else
2284
- if (source == resetMeshItem)
2929
+ if (source == resetAllItem)
22852930 {
22862931 ResetAll();
22872932 } else
....@@ -2289,7 +2934,7 @@
22892934 {
22902935 StepAll();
22912936 } else
2292
- if (source == clearItem) // || event.getSource() == clearButton)
2937
+ if (source == deleteItem) // || event.getSource() == clearButton)
22932938 {
22942939 //int indices[] = jList.getSelectedIndices();
22952940 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2301,9 +2946,9 @@
23012946 {
23022947 ClearSelection(true);
23032948 } else
2304
- if (source == grabItem)
2949
+ if (source == grabItem || source == groupButton)
23052950 {
2306
- group(new cGroup(), true);
2951
+ group(new cGroup(), false); // true);
23072952 } else
23082953 if (source == hideItem)
23092954 {
....@@ -2321,11 +2966,11 @@
23212966 {
23222967 makeSomething(new Camera());
23232968 } else
2324
- if (source == compositeItem)
2969
+ if (source == compositeItem || source == compositeButton)
23252970 {
23262971 group(new Composite());
23272972 } else
2328
- if (source == randomItem)
2973
+ if (source == switchItem || source == switchButton)
23292974 {
23302975 RandomNode random = new RandomNode();
23312976 group(random);
....@@ -2427,7 +3072,7 @@
24273072 {
24283073 group(new cLinker());
24293074 } else
2430
- if (source == textureItem)
3075
+ if (source == textureItem || source == textureButton)
24313076 {
24323077 group(new TextureNode());
24333078 } else
....@@ -2447,17 +3092,30 @@
24473092 {
24483093 CastShadow(2);
24493094 } else
2450
- if (source == ungroupItem)
3095
+ if (source == ungroupItem || source == ungroupButton)
24513096 {
2452
- //ungroup();
3097
+ boolean hasRoot = false;
3098
+
24533099 for (int i=0; i<group.selection.size(); i++)
24543100 {
2455
- Ungroup(group.selection.get(i));
3101
+ if (group.selection.get(i) == group)
3102
+ {
3103
+ hasRoot = true;
3104
+ break;
3105
+ }
24563106 }
24573107
2458
- ClearSelection(false);
2459
-
2460
- refreshContents();
3108
+ if (!hasRoot)
3109
+ {
3110
+ for (int i=0; i<group.selection.size(); i++)
3111
+ {
3112
+ Ungroup(group.selection.get(i));
3113
+ }
3114
+
3115
+ ClearSelection(false);
3116
+
3117
+ refreshContents();
3118
+ }
24613119 } else
24623120 if (source == genUVItem)
24633121 {
....@@ -2469,7 +3127,7 @@
24693127 } else
24703128 if (source == genNormalsMESHItem)
24713129 {
2472
- GenNormals(true); // TODO
3130
+ GenNormalsMESH();
24733131 } else
24743132 if (source == genNormalsORGANItem)
24753133 {
....@@ -2534,6 +3192,22 @@
25343192 if (source == unmarkleavesItem)
25353193 {
25363194 MarkLeaves(false);
3195
+ } else
3196
+ if (source == rewindleavesItem)
3197
+ {
3198
+ RewindLeaves(true);
3199
+ } else
3200
+ if (source == unrewindleavesItem)
3201
+ {
3202
+ RewindLeaves(false);
3203
+ } else
3204
+ if (source == randomleavesItem)
3205
+ {
3206
+ RandomLeaves(true);
3207
+ } else
3208
+ if (source == unrandomleavesItem)
3209
+ {
3210
+ RandomLeaves(false);
25373211 } else
25383212 if (source == flipVItem)
25393213 {
....@@ -2742,7 +3416,7 @@
27423416 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
27433417 {
27443418 obj = (Object3D)e.nextElement();
2745
- obj.SetBumpTexture(null);
3419
+ obj.ResetBumpTexture();
27463420 }
27473421
27483422 refreshContents();
....@@ -2758,6 +3432,31 @@
27583432
27593433 refreshContents();
27603434 } else
3435
+ if (source == embedTexturesItem)
3436
+ {
3437
+ Object3D obj;
3438
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3439
+ {
3440
+ obj = (Object3D)e.nextElement();
3441
+ obj.EmbedTextures(true);
3442
+ }
3443
+
3444
+ refreshContents();
3445
+ } else
3446
+ if (source == deEmbedTexturesItem)
3447
+ {
3448
+ Object3D obj;
3449
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3450
+ {
3451
+ obj = (Object3D)e.nextElement();
3452
+ obj.EmbedTextures(false);
3453
+ }
3454
+
3455
+ CameraPane.texturepigment.clear();
3456
+ CameraPane.texturebump.clear();
3457
+
3458
+ refreshContents();
3459
+ } else
27613460 if (source == flashSelectionButton)
27623461 {
27633462 CameraPane.flash = true;
....@@ -2769,6 +3468,10 @@
27693468 if (source == twoButton)
27703469 {
27713470 radio.layout = twoButton;
3471
+
3472
+ if (CameraPane.FULLSCREEN)
3473
+ fullscreenLayout = radio.layout;
3474
+
27723475 // bug
27733476 //gridPanel.setDividerLocation(1.0);
27743477 //bigPanel.setDividerLocation(0.0);
....@@ -2801,10 +3504,31 @@
28013504 bigThree.ClearUI();
28023505 bigThree.add(centralPanel);
28033506 bigThree.FlushUI();
3507
+
3508
+ cameraView.requestFocusInWindow();
3509
+
3510
+// refreshContents(true);
3511
+//
3512
+// try
3513
+// {
3514
+// java.awt.Robot bot = new java.awt.Robot();
3515
+// int mask = InputEvent.BUTTON1_MASK;
3516
+// bot.mouseMove(100, 100);
3517
+// bot.mousePress(mask);
3518
+// bot.mouseRelease(mask);
3519
+// }
3520
+// catch (Exception e)
3521
+// {
3522
+//
3523
+// }
3524
+
28043525 } else
28053526 if (source == threeButton)
28063527 {
28073528 radio.layout = threeButton;
3529
+
3530
+ if (CameraPane.FULLSCREEN)
3531
+ fullscreenLayout = radio.layout;
28083532
28093533 // bigThree.remove(scenePanel);
28103534 // bigThree.remove(centralPanel);
....@@ -2834,13 +3558,18 @@
28343558 // centralPanel.setVisible(true);
28353559 // XYZPanel.setVisible(true);
28363560 bigThree.ClearUI();
3561
+ bigThree.add(scenePanel);
28373562 bigThree.add(centralPanel);
2838
- bigThree.add(XYZPanel);
28393563 bigThree.FlushUI();
3564
+
3565
+ cameraView.requestFocusInWindow();
28403566 } else
28413567 if (source == fourButton)
28423568 {
28433569 radio.layout = fourButton;
3570
+
3571
+ if (CameraPane.FULLSCREEN)
3572
+ fullscreenLayout = radio.layout;
28443573
28453574 // bigThree.remove(scenePanel);
28463575 // bigThree.remove(centralPanel);
....@@ -2872,10 +3601,15 @@
28723601 bigThree.ClearUI();
28733602 bigThree.add(scenePanel);
28743603 bigThree.FlushUI();
3604
+
3605
+ cameraView.requestFocusInWindow();
28753606 } else
28763607 if (source == sixButton)
28773608 {
28783609 radio.layout = sixButton;
3610
+
3611
+ if (CameraPane.FULLSCREEN)
3612
+ fullscreenLayout = radio.layout;
28793613
28803614 // bigThree.remove(scenePanel);
28813615 // bigThree.remove(centralPanel);
....@@ -2905,13 +3639,18 @@
29053639 // centralPanel.setVisible(true);
29063640 // XYZPanel.setVisible(false);
29073641 bigThree.ClearUI();
2908
- bigThree.add(scenePanel);
29093642 bigThree.add(centralPanel);
3643
+ bigThree.add(scenePanel);
29103644 bigThree.FlushUI();
3645
+
3646
+ cameraView.requestFocusInWindow();
29113647 } else
29123648 if (source == sevenButton)
29133649 {
29143650 radio.layout = sevenButton;
3651
+
3652
+ if (CameraPane.FULLSCREEN)
3653
+ fullscreenLayout = radio.layout;
29153654
29163655 // bigThree.remove(scenePanel);
29173656 // bigThree.remove(centralPanel);
....@@ -2945,6 +3684,8 @@
29453684 bigThree.add(centralPanel);
29463685 bigThree.add(XYZPanel);
29473686 bigThree.FlushUI();
3687
+
3688
+ cameraView.requestFocusInWindow();
29483689 } else
29493690 if (source == rootButton)
29503691 {
....@@ -2956,6 +3697,7 @@
29563697 EditObject(obj);
29573698 }
29583699
3700
+ cameraView.requestFocusInWindow();
29593701 refreshContents(true);
29603702 } else
29613703 if (source == closeButton)
....@@ -2965,22 +3707,37 @@
29653707 for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
29663708 {
29673709 ab = (cRadio)e.nextElement();
2968
- if(ab.getModel().isSelected() && ab.GetObject() != client)
3710
+ if (ab.getModel().isSelected() && ab.GetObject() != client)
29693711 {
3712
+ // Patch to avoid bug with transparency.
3713
+ if (!ab.hadMaterial)
3714
+ {
3715
+ ab.object.material = null;
3716
+ }
3717
+
29703718 buttonGroup.remove(ab);
29713719 radioPanel.remove(ab);
29723720
2973
- ab.GetObject().editWindow = null;
3721
+ //ab.GetObject().editWindow = null;
3722
+ ab.GetObject().manipWindow = null;
29743723 // ab.GetObject().objectUI = null; // ?????????
29753724
29763725 ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick();
29773726 break;
29783727 }
29793728 }
3729
+
3730
+ cameraView.requestFocusInWindow();
29803731 refreshContents(true);
29813732 } else
29823733 if (source == editItem || source == editButton)
29833734 {
3735
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3736
+ {
3737
+ Object3D child = (Object3D)e.nextElement();
3738
+ child.pinned = true;
3739
+ }
3740
+
29843741 EditSelection(false);
29853742 } else
29863743 if (source == uneditButton)
....@@ -2990,10 +3747,11 @@
29903747 Object3D child = (Object3D)e.nextElement();
29913748 if(child.editWindow != null)
29923749 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3750
+ child.pinned = false;
29933751 child.CloseUI();
29943752 listUI.remove(child);
29953753
2996
- child.editWindow = null; // ???????????
3754
+ //child.editWindow = null; // ???????????
29973755 }
29983756 objEditor.ctrlPanel.FlushUI();
29993757 //objEditor.jTree.clearSelection();
....@@ -3006,6 +3764,7 @@
30063764 //copy.ClearUI();
30073765 for (Object3D obj : listUI)
30083766 {
3767
+ obj.pinned = false;
30093768 obj.CloseUI();
30103769 }
30113770 listUI.clear();
....@@ -3015,7 +3774,7 @@
30153774 {
30163775 assert(copy == group);
30173776
3018
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3777
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
30193778
30203779 for (Object3D obj : listUI)
30213780 {
....@@ -3064,6 +3823,9 @@
30643823 }
30653824
30663825 copy = group;
3826
+
3827
+ SetUndoStates();
3828
+
30673829 //Globals.theRenderer.object = group;
30683830 if(!useclient)
30693831 {
....@@ -3079,20 +3841,46 @@
30793841 frontView.object = group;
30803842 sideView.object = group;
30813843 }
3082
- group.editWindow = this;
3844
+
3845
+// fix "+" issue
3846
+ //group.editWindow = this;
3847
+ group.manipWindow = this;
3848
+
30833849 /*
30843850 currentLayout = radio.layout;
30853851 if (currentLayout == null)
30863852 currentLayout = sevenButton;
30873853 */
30883854 radio.layout.doClick();
3855
+
3856
+ ClearUnpinned();
3857
+ //Grafreed.Assert(group != null);
3858
+ //Grafreed.Assert(group.selection != null);
3859
+ SetPinStates(group.selection == null || group.selection.size() > 0);
3860
+ if (group.selection == null || group.selection.size() == 1)
3861
+ EditSelection(false);
30893862 keepparent = group.parent;
30903863 // PARENT = NULL or not???
30913864 //group.parent = null; // ROOT
30923865 //group.attributes = -1;
30933866 ResetModel();
3867
+
3868
+ cameraView.requestFocusInWindow();
30943869 refreshContents(true);
3095
- }
3870
+ } else if (event.getSource() == editCameraItem)
3871
+ {
3872
+ cameraView.ProtectCamera();
3873
+ cameraView.repaint();
3874
+ return;
3875
+ } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton)
3876
+ {
3877
+ cameraView.RevertCamera();
3878
+ cameraView.repaint();
3879
+ return;
3880
+ // } else if (event.getSource() == textureButton)
3881
+ // {
3882
+ // return; // true;
3883
+ }
30963884 else
30973885 {
30983886 //return super.action(event, arg);
....@@ -3101,7 +3889,6 @@
31013889 }
31023890
31033891 boolean useclient = false;
3104
- cRadio radio;
31053892
31063893 void ToggleRoot()
31073894 {
....@@ -3340,7 +4127,8 @@
33404127
33414128 int size = obj.MemorySize();
33424129
3343
- System.err.println((size/1024) + " KB is the size of " + obj);
4130
+ //System.err.println((size/1024) + " KB is the size of " + obj);
4131
+ System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)");
33444132 }
33454133 }
33464134 catch (Exception e)
....@@ -3421,6 +4209,13 @@
34214209 void GenNormals(boolean crease)
34224210 {
34234211 group.GenNormalsS(crease);
4212
+
4213
+ refreshContents();
4214
+ }
4215
+
4216
+ void GenNormalsMESH()
4217
+ {
4218
+ group.GenNormalsMeshS();
34244219
34254220 refreshContents();
34264221 }
....@@ -3652,7 +4447,16 @@
36524447 String pigment = Object3D.GetPigment(tex);
36534448 //String bump = Object3D.GetBump(tex);
36544449
3655
- com.sun.opengl.util.texture.TextureData texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
4450
+ com.sun.opengl.util.texture.TextureData texturedata = null;
4451
+
4452
+ try
4453
+ {
4454
+ texturedata = Globals.theRenderer.GetTextureData(tex, false, node.texres);
4455
+ }
4456
+ catch (Exception e)
4457
+ {
4458
+ System.err.println("FAIL: " + node);
4459
+ }
36564460
36574461 double s = v.s;
36584462
....@@ -4039,6 +4843,18 @@
40394843 refreshContents();
40404844 }
40414845
4846
+ void RewindLeaves(boolean hide)
4847
+ {
4848
+ group.selection.RewindLeaves(hide);
4849
+ refreshContents();
4850
+ }
4851
+
4852
+ void RandomLeaves(boolean hide)
4853
+ {
4854
+ group.selection.RandomLeaves(hide);
4855
+ refreshContents();
4856
+ }
4857
+
40424858 void SetTexRes(int tr)
40434859 {
40444860 group.selection.SetTexRes(tr);
....@@ -4110,28 +4926,25 @@
41104926 // }
41114927 // }
41124928
4113
- static boolean allparams = true;
4114
-
4115
- static Vector<Object3D> listUI = new Vector<Object3D>();
4116
-
41174929 void EditSelection(boolean newWindow)
41184930 {
4931
+ if (group.selection == null)
4932
+ {
4933
+ EditElement(group, newWindow); // ? new
4934
+ return;
4935
+ }
4936
+
41194937 // aConstraints.gridy = 0;
41204938 for (int i=0; i<group.selection.size(); i++)
41214939 {
41224940 //System.out.println("edit : " + objectPanel.indexOfTab("Material"));
41234941 //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false);
4124
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
4942
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
41254943
41264944 Object3D elem = (Object3D)group.selection.elementAt(i);
4127
- if(elem != group)
4945
+ if(elem != group || !newWindow)
41284946 {
4129
- // if (!(elem instanceof Composite))
4130
- // newWindow = false;
4131
- listUI.add(elem);
4132
- elem.openEditWindow(this, newWindow); //, false);
4133
- System.out.println("edit : " + elem);
4134
- elem.editWindow.refreshContents(true); // ? new
4947
+ EditElement(elem, newWindow); // ? new
41354948 }
41364949 }
41374950 }
....@@ -4206,7 +5019,8 @@
42065019 //new Exception().printStackTrace();
42075020
42085021 freezemodel = true;
4209
-
5022
+ ClearUnpinned();
5023
+
42105024 /**/
42115025 //switch (event.id)
42125026 {
....@@ -4214,7 +5028,6 @@
42145028 //case 702: // Event.LIST_DESELECT
42155029 group.deselectAll();
42165030 TreePath tps[] = objEditor.jTree.getSelectionPaths();
4217
- objEditor.ClearInfo(); // .GetMaterial());
42185031 if (tps != null)
42195032 {
42205033 for (int i=0; i < tps.length; i++)
....@@ -4223,10 +5036,8 @@
42235036
42245037 //if (child.parent != null)
42255038 //child.parent.addSelectee(child);
5039
+ objEditor.SetMaterial(child);
42265040 group.addSelectee(child);
4227
- objEditor.SetMaterial(child); // .GetMaterial());
4228
- objEditor.AddInfo(child, this, true); // .GetMaterial());
4229
- System.err.println("info : " + child.GetPath());
42305041 }
42315042 }
42325043 // else
....@@ -4236,20 +5047,28 @@
42365047 // System.err.println("info : " + group.GetPath());
42375048 // }
42385049
4239
- objEditor.SetText(); // jan 2014
4240
-
4241
- if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
5050
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera))
42425051 CameraPane.flash = true;
42435052
4244
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
5053
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
42455054 // a camera
42465055 {
4247
- CameraPane.camerachangeframe = 0; // don't refuse it
4248
- Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
5056
+ if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crash the camera because of invalid lightspace
5057
+ {
5058
+ CameraPane.camerachangeframe = 0; // don't refuse it
5059
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
5060
+ }
42495061 // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
42505062 // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
42515063 }
42525064
5065
+ if (tps != null && tps.length == 1)
5066
+ {
5067
+ EditSelection(false);
5068
+ }
5069
+
5070
+ SetPinStates(tps != null && tps.length > 0);
5071
+
42535072 refreshContents();
42545073 //return true;
42555074 }
....@@ -4258,6 +5077,35 @@
42585077
42595078 freezemodel = false;
42605079 }
5080
+
5081
+ void SetPinStates(boolean enabled)
5082
+ {
5083
+ editButton.setEnabled(enabled);
5084
+ uneditButton.setEnabled(enabled);
5085
+ unselectButton.setEnabled(enabled);
5086
+ flashSelectionButton.setEnabled(enabled);
5087
+ }
5088
+
5089
+ void refreshContents(boolean cp)
5090
+ {
5091
+ if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info"))
5092
+ if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING)
5093
+ {
5094
+ objEditor.ClearInfo(); // .GetMaterial());
5095
+
5096
+ for (int i=0; i < group.selection.Size(); i++)
5097
+ {
5098
+ Object3D child = (Object3D) group.selection.get(i);
5099
+
5100
+ objEditor.AddInfo(child, this, true);
5101
+ System.err.println("info : " + child.GetPath());
5102
+ }
5103
+
5104
+ objEditor.SetText(); // jan 2014
5105
+ }
5106
+
5107
+ super.refreshContents(cp);
5108
+ }
42615109
42625110 void linkSomething(Object3D thing)
42635111 {
....@@ -4329,6 +5177,7 @@
43295177 {
43305178 if (group.selection.isEmpty())
43315179 return;
5180
+
43325181 Grafreed.clipboardIsTempGroup = false;
43335182 Composite tGroup = null;
43345183 if (group.selection.size() > 0) // 1)
....@@ -4339,6 +5188,8 @@
43395188
43405189 if (cut)
43415190 {
5191
+// if (Globals.SAVEONMAKE) // Moved to the clipboard, no need to save.
5192
+// Save();
43425193 //int indices[] = jList.getSelectedIndices();
43435194 //for (int i = indices.length - 1; i >= 0; i--)
43445195 //jList.remove(indices[i]);
....@@ -4428,8 +5279,10 @@
44285279 }
44295280
44305281 }
5282
+
44315283 if (Grafreed.clipboardIsTempGroup)
44325284 Grafreed.clipboard = tGroup;
5285
+
44335286 if (cut)
44345287 {
44355288 ResetModel();
....@@ -4439,6 +5292,10 @@
44395292
44405293 void paste(boolean expand)
44415294 {
5295
+ if (Globals.REPLACEONMAKE)
5296
+ Save();
5297
+ boolean keep = Globals.REPLACEONMAKE;
5298
+ Globals.REPLACEONMAKE = false;
44425299 // if (GrafreeD.clipboard == null)
44435300 // return;
44445301 boolean first = true;
....@@ -4498,6 +5355,7 @@
44985355 Grafreed.clipboard.get(0).parent = keepparent;
44995356 }
45005357
5358
+ Globals.REPLACEONMAKE = keep;
45015359 ResetModel();
45025360 refreshContents();
45035361 }
....@@ -4633,6 +5491,10 @@
46335491
46345492 void group(Object3D csg, boolean grab)
46355493 {
5494
+ if (Globals.REPLACEONMAKE)
5495
+ Save();
5496
+ boolean keep = Globals.REPLACEONMAKE;
5497
+ Globals.REPLACEONMAKE = false;
46365498 if (//false) // why??
46375499 !group.selection.isEmpty())
46385500 {
....@@ -4746,10 +5608,15 @@
47465608 //node.add(csg);
47475609 //makeSomething(node);
47485610 makeSomething(csg);
5611
+ Globals.REPLACEONMAKE = keep;
47495612 }
47505613
47515614 void Ungroup(Object3D g)
47525615 {
5616
+ if (Globals.REPLACEONMAKE)
5617
+ Save();
5618
+ boolean keep = Globals.REPLACEONMAKE;
5619
+ Globals.REPLACEONMAKE = false;
47535620 if (g instanceof HiddenObject)
47545621 {
47555622 HiddenObject h = (HiddenObject) g;
....@@ -4766,6 +5633,7 @@
47665633 objEditor.makeSomething(g.get(i), false);
47675634 }
47685635 }
5636
+ Globals.REPLACEONMAKE = keep;
47695637 }
47705638
47715639 void ungroup()
....@@ -4961,21 +5829,6 @@
49615829 }
49625830 */
49635831
4964
- void ImportGFD()
4965
- {
4966
- FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD);
4967
- browser.show();
4968
- String filename = browser.getFile();
4969
- if (filename != null && filename.length() > 0)
4970
- {
4971
- String fullname = browser.getDirectory() + filename;
4972
-
4973
- //Object3D readobj =
4974
- objEditor.ReadGFD(fullname, objEditor);
4975
- //makeSomething(readobj);
4976
- }
4977
- }
4978
-
49795832 /*
49805833 public void Callback(Object obj)
49815834 {
....@@ -4999,23 +5852,6 @@
49995852 }
50005853 */
50015854
5002
- void ImportVRMLX3D()
5003
- {
5004
- if (Grafreed.standAlone)
5005
- {
5006
- /**/
5007
- FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
5008
- browser.show();
5009
- String filename = browser.getFile();
5010
- if (filename != null && filename.length() > 0)
5011
- {
5012
- String fullname = browser.getDirectory() + filename;
5013
- LoadVRMLX3D(fullname);
5014
- }
5015
- /**/
5016
- }
5017
- }
5018
-
50195855 String GetFile(String dialogName)
50205856 {
50215857 if (Grafreed.standAlone)
....@@ -5086,7 +5922,44 @@
50865922 cButton clearpanelButton;
50875923 cButton unselectButton;
50885924
5925
+ cButton restoreCameraButton;
5926
+
5927
+ cButton saveButton;
50895928 cButton oneStepButton;
5929
+
5930
+ cButton groupButton;
5931
+ cButton ungroupButton;
5932
+ cButton compositeButton;
5933
+ cButton switchButton;
5934
+ cButton loopButton;
5935
+ cButton textureButton;
5936
+
5937
+ cButton skybox1Button;
5938
+ cButton skybox2Button;
5939
+ cButton skybox3Button;
5940
+ cButton skybox4Button;
5941
+ cButton skybox5Button;
5942
+ cButton skybox6Button;
5943
+ cButton skybox7Button;
5944
+
5945
+ cButton skybox11Button;
5946
+ cButton skybox12Button;
5947
+ cButton skybox13Button;
5948
+ cButton skybox14Button;
5949
+ cButton skybox15Button;
5950
+ cButton skybox16Button;
5951
+ cButton skybox17Button;
5952
+
5953
+ cButton gridButton;
5954
+ cButton boxButton;
5955
+ cButton sphereButton;
5956
+ cButton coneButton;
5957
+ cButton torusButton;
5958
+ cButton superButton;
5959
+ cButton kleinButton;
5960
+ cButton particlesButton;
5961
+ cButton overlayButton;
5962
+ cButton lightButton;
50905963
50915964 cButton screenfitButton;
50925965 cButton screenfitpointButton;
....@@ -5099,14 +5972,6 @@
50995972
51005973 cButton setsupportButton;
51015974
5102
- cButton twoButton;
5103
- cButton sixButton;
5104
- cButton threeButton;
5105
- cButton sevenButton;
5106
- cButton fourButton; // full panel
5107
- cButton oneButton; // full XYZ
5108
- //cButton currentLayout;
5109
-
51105975 //
51115976 //Composite
51125977 Object3D // to do !!
....@@ -5116,9 +5981,11 @@
51165981 //JTree jTree;
51175982 private MenuItem lookAtItem;
51185983 private MenuItem lookFromItem;
5119
- private MenuItem switchItem;
5984
+ private MenuItem switchViewItem;
51205985 private MenuItem cutItem;
5121
- private MenuItem duplicateItem;
5986
+ private MenuItem undoItem;
5987
+ private MenuItem redoItem;
5988
+ private JMenuItem duplicateItem;
51225989 private MenuItem cloneItem;
51235990 private MenuItem cloneSupportItem;
51245991 private MenuItem overwriteGeoItem;
....@@ -5131,7 +5998,7 @@
51315998 private MenuItem linkverticesItem;
51325999 private MenuItem relinkverticesItem;
51336000 private MenuItem setMasterItem;
5134
- private MenuItem resetMeshItem;
6001
+ private MenuItem resetAllItem;
51356002 private MenuItem stepAllItem;
51366003 private MenuItem revertMeshItem;
51376004 private MenuItem poseMeshItem;
....@@ -5146,7 +6013,7 @@
51466013 private MenuItem pasteLinkItem;
51476014 private MenuItem pasteCloneItem;
51486015 private MenuItem pasteExpandItem;
5149
- private MenuItem clearItem;
6016
+ private MenuItem deleteItem;
51506017 private MenuItem clearAllItem;
51516018 private MenuItem genUVItem;
51526019 private MenuItem genNormalsMESHItem;
....@@ -5181,6 +6048,10 @@
51816048 private MenuItem showleavesItem;
51826049 private MenuItem markleavesItem;
51836050 private MenuItem unmarkleavesItem;
6051
+ private MenuItem rewindleavesItem;
6052
+ private MenuItem unrewindleavesItem;
6053
+ private MenuItem randomleavesItem;
6054
+ private MenuItem unrandomleavesItem;
51846055
51856056 private MenuItem flipVItem;
51866057 private MenuItem unflipVItem;
....@@ -5202,7 +6073,7 @@
52026073 private MenuItem frontItem;
52036074 private MenuItem cameraItem;
52046075 private MenuItem compositeItem;
5205
- private MenuItem randomItem;
6076
+ private MenuItem switchItem;
52066077 private MenuItem physicsItem;
52076078 private MenuItem frameselectorItem;
52086079 private MenuItem scriptNodeItem;
....@@ -5226,6 +6097,8 @@
52266097 private MenuItem attachBumpItem;
52276098 private MenuItem detachBumpItem;
52286099 private MenuItem pigmentBumpItem;
6100
+ private MenuItem embedTexturesItem;
6101
+ private MenuItem deEmbedTexturesItem;
52296102
52306103 private MenuItem particleItem;
52316104 private MenuItem ragdollItem;
....@@ -5264,11 +6137,6 @@
52646137 private MenuItem doubleItem;
52656138 private MenuItem tripleItem;
52666139
5267
- private MenuItem importGFDItem;
5268
- private MenuItem importVRMLX3DItem;
5269
- private MenuItem import3DSItem;
5270
- private MenuItem importOBJItem;
5271
-
52726140 private MenuItem computeAOItem;
52736141 private MenuItem recompileItem;
52746142 private MenuItem editScriptItem;
....@@ -5278,4 +6146,8 @@
52786146 private MenuItem analyzeItem;
52796147 private MenuItem dumpItem;
52806148 //boolean freezemodel = false;
6149
+
6150
+ Menu cameraMenu;
6151
+ MenuItem editCameraItem;
6152
+ MenuItem restoreCameraItem;
52816153 }