Normand Briere
2019-07-28 a434119e65146fe53d612c28e1ee7af532d1b70a
GroupEditor.java
....@@ -12,6 +12,7 @@
1212 import com.jme.math.Vector3f;
1313 import com.jme.renderer.ColorRGBA;
1414
15
+import grafeme.ui.*;
1516 //import buoy.widget.BFileChooser;
1617
1718 class GroupEditor extends ObjEditor implements //iParse, //iCallBack,
....@@ -22,6 +23,31 @@
2223 DragGestureListener, DragSourceListener, DropTargetListener,
2324 ItemListener // ListSelectionListener
2425 {
26
+
27
+ public void AddSkyboxButton(String f, String s, cGridBag row3)
28
+ {
29
+ cButton skyboxButton;
30
+ final String path = "cubemaps/" + f + "-skyboxes/" + s;
31
+ row3.add(skyboxButton = GetButton(path + "/" + s + ".jpg", !Grafreed.NIMBUSLAF));
32
+ skyboxButton.setToolTipText(s);
33
+ skyboxButton.addActionListener(new ActionListener()
34
+ {
35
+ @Override
36
+ public void actionPerformed(ActionEvent e)
37
+ {
38
+ ChangeSkybox(path);
39
+ }
40
+ });
41
+ }
42
+
43
+ public void ChangeSkybox(String name)
44
+ {
45
+ cameraView.envyoff = false;
46
+ cameraView.skyboxname = name;
47
+ cameraView.skyboxext = "jpg";
48
+ cameraView.repaint();
49
+ }
50
+
2551 //ObjEditor objEditor;
2652 public void closeUI2()
2753 {
....@@ -59,6 +85,12 @@
5985 this.copy = this.group = group;
6086 //selectees = this.group.selectees;
6187
88
+ if (copy.versions == null)
89
+ {
90
+ copy.versions = new byte[100][];
91
+ copy.versionindex = -1;
92
+ }
93
+
6294 if(ui)
6395 SetupUI(objEditor);
6496 }
....@@ -73,16 +105,28 @@
73105 this.copy = this.group = copy;
74106 //selectees = this.group.selectees;
75107
76
- SetupMenu2(objEditor);
108
+ SetupMenu2(this); //objEditor);
77109 SetupUI2(objEditor);
78110 objEditor.SetupUI(true);
79111 SetupViews(objEditor);
80112
81113 ((cRadio)radioPanel.getComponent(0)).SetCamera(cameraView.renderCamera, true);
114
+
115
+ if (copy.versions == null)
116
+ {
117
+ copy.versions = new byte[100][];
118
+ copy.versionindex = -1;
119
+
120
+ Save(true);
121
+ }
82122 }
83123
84124 void CloneSelection(boolean supports)
85125 {
126
+ if (Globals.REPLACEONMAKE)
127
+ Save();
128
+ boolean keep = Globals.REPLACEONMAKE;
129
+ Globals.REPLACEONMAKE = false;
86130 // Object3D keep = GrafreeD.clipboard;
87131 //Object3D obj;
88132 for (int i=0; i<group.selection.size(); i++)// Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -93,18 +137,19 @@
93137
94138 makeSomething(clone, i==group.selection.size()-1);
95139 }
140
+ Globals.REPLACEONMAKE = keep;
96141 }
97142
98143 void CloneClipboard(boolean supports)
99144 {
100
- assert(GrafreeD.clipboard.parent == null);
101
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
102
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
103
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
104
- makeSomething(CloneObject(GrafreeD.clipboard.get(0), false));
145
+ assert(Grafreed.clipboard.parent == null);
146
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
147
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
148
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
149
+ makeSomething(CloneObject(Grafreed.clipboard.get(0), false));
105150 else
106
- makeSomething(CloneObject(GrafreeD.clipboard, false));
107
- GrafreeD.clipboard.get(0).parent = keepparent;
151
+ makeSomething(CloneObject(Grafreed.clipboard, false));
152
+ Grafreed.clipboard.get(0).parent = keepparent;
108153 }
109154
110155 static Object3D CloneObject(Object3D obj, boolean supports)
....@@ -118,7 +163,7 @@
118163 // obj.support = null;
119164 if (!supports)
120165 obj.SaveSupports();
121
- Object3D clone = (Object3D)GrafreeD.clone(obj);
166
+ Object3D clone = (Object3D)Grafreed.clone(obj);
122167 obj.parent = parent;
123168 // obj.support = support;
124169 // clone.support = support; // aout 2013
....@@ -147,30 +192,29 @@
147192
148193 //JTextField nameField;
149194
150
- void SetupMenu2(ObjEditor oe)
195
+ void SetupMenu2(GroupEditor oe)
151196 {
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);
197
+ oe.jTree = new cTree();
198
+
163199 Menu menu;
164200 oe.menuBar.add(menu = new Menu("Edit"));
165201 //editItem = menu.add(new MenuItem("Edit"));
166202 //editItem.addActionListener(this);
167
- duplicateItem = menu.add(new MenuItem("Duplicate"));
203
+
204
+// undoItem = menu.add(new MenuItem("Undo"));
205
+// undoItem.addActionListener(this);
206
+// redoItem = menu.add(new MenuItem("Redo"));
207
+// redoItem.addActionListener(this);
208
+// menu.add("-");
209
+ duplicateItem = oe.jTree.popup.add(new JMenuItem("Duplicate"));
168210 duplicateItem.addActionListener(this);
169
- menu.add("-");
170211 cloneItem = menu.add(new MenuItem("Clone"));
171212 cloneItem.addActionListener(this);
213
+ if (Globals.ADVANCED)
214
+ {
172215 cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
173216 cloneSupportItem.addActionListener(this);
217
+ }
174218 menu.add("-");
175219 cutItem = menu.add(new MenuItem("Cut"));
176220 cutItem.addActionListener(this);
....@@ -178,27 +222,123 @@
178222 copyItem.addActionListener(this);
179223 pasteItem = menu.add(new MenuItem("Paste"));
180224 pasteItem.addActionListener(this);
225
+
226
+ menu.add("-");
227
+ pasteIntoItem = menu.add(new MenuItem("Paste into"));
228
+ pasteIntoItem.addActionListener(this);
181229 pasteLinkItem = menu.add(new MenuItem("Paste link"));
182230 pasteLinkItem.addActionListener(this);
183231 pasteCloneItem = menu.add(new MenuItem("Paste clone"));
184232 pasteCloneItem.addActionListener(this);
185233 // pasteExpandItem = menu.add(new MenuItem("Paste expand"));
186234 // pasteExpandItem.addActionListener(this);
187
- clearItem = menu.add(new MenuItem("Clear"));
188
- clearItem.addActionListener(this);
235
+ menu.add("-");
236
+ deleteItem = menu.add(new MenuItem("Delete"));
237
+ deleteItem.addActionListener(this);
238
+
239
+ if (Globals.ADVANCED)
240
+ {
241
+ // Deletes the cameras...
189242 clearAllItem = menu.add(new MenuItem("Clear All"));
190243 clearAllItem.addActionListener(this);
244
+ }
245
+
246
+ menuBar.add(cameraMenu = new Menu("View"));
247
+ //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer"));
248
+ //zBufferItem.addActionListener(this);
249
+ //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens"));
250
+ //normalLensItem.addActionListener(this);
251
+ cameraMenu.add(restoreCameraItem = new MenuItem("Restore Viewpoint"));
252
+ restoreCameraItem.addActionListener(this);
253
+
254
+// cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen"));
255
+// toggleFullScreenItem.addItemListener(this);
256
+// toggleFullScreenItem.setState(CameraPane.FULLSCREEN);
257
+// cameraMenu.add("-");
258
+//
259
+// cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture"));
260
+// toggleTextureItem.addItemListener(this);
261
+// toggleTextureItem.setState(CameraPane.textureon);
262
+//
263
+// cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch"));
264
+// toggleSwitchItem.addItemListener(this);
265
+// toggleSwitchItem.setState(CameraPane.SWITCH);
266
+
267
+ cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Show Handles"));
268
+ toggleHandleItem.addItemListener(this);
269
+ toggleHandleItem.setState(CameraPane.HANDLES);
270
+
271
+ cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode"));
272
+ togglePaintItem.addItemListener(this);
273
+ togglePaintItem.setState(CameraPane.PAINTMODE);
274
+
275
+ if (Globals.ADVANCED)
276
+ {
277
+ cameraMenu.add("-");
278
+ cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live"));
279
+ toggleLiveItem.addItemListener(this);
280
+ toggleLiveItem.setState(Globals.isLIVE());
191281
282
+ cameraMenu.add(stepItem = new MenuItem("Step"));
283
+ stepItem.addActionListener(this);
284
+ // cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List"));
285
+ // toggleDLItem.addItemListener(this);
286
+ // toggleDLItem.setState(false);
287
+
288
+ cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render"));
289
+ toggleRenderItem.addItemListener(this);
290
+ toggleRenderItem.setState(!CameraPane.frozen);
291
+
292
+ cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug"));
293
+ toggleDebugItem.addItemListener(this);
294
+ toggleDebugItem.setState(Globals.DEBUG);
295
+
296
+ cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum"));
297
+ toggleFrustumItem.addItemListener(this);
298
+ toggleFrustumItem.setState(CameraPane.FRUSTUM);
299
+
300
+ cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact"));
301
+ toggleFootContactItem.addItemListener(this);
302
+ toggleFootContactItem.setState(CameraPane.FOOTCONTACT);
303
+
304
+ cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline"));
305
+ toggleTimelineItem.addItemListener(this);
306
+ }
307
+
308
+// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root"));
309
+// toggleRootItem.addItemListener(this);
310
+// toggleRootItem.setState(false);
311
+// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation"));
312
+// animationItem.addItemListener(this);
313
+// animationItem.setState(CameraPane.ANIMATION);
314
+ cameraMenu.add("-");
315
+ cameraMenu.add(editCameraItem = new MenuItem("Save Viewpoint"));
316
+ editCameraItem.addActionListener(this);
317
+
318
+ if (Globals.ADVANCED)
319
+ {
320
+ oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
321
+ //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
322
+ //cameraMenu.add(switchViewItem = new MenuItem("Reverse View"));
323
+ editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf"));
324
+ oe.cameraMenu.add("-");
325
+ openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy..."));
326
+ openWindowItem.addActionListener(this);
327
+ editLeafItem.addActionListener(this);
328
+ lookAtItem.addActionListener(this);
329
+ //lookFromItem.addActinoListener(this);
330
+ //switchViewItem.addActionListener(this);
331
+ }
332
+
192333 oe.menuBar.add(menu = new Menu("Setting"));
193
- resetMeshItem = menu.add(new MenuItem("Reset All"));
194
- resetMeshItem.addActionListener(this);
195
- stepAllItem = menu.add(new MenuItem("Step All"));
196
- stepAllItem.addActionListener(this);
334
+ if (Globals.ADVANCED)
335
+ {
197336 revertMeshItem = menu.add(new MenuItem("Revert Meshes"));
198337 revertMeshItem.addActionListener(this);
199338 resetreferencesItem = menu.add(new MenuItem("Reset Mesh References"));
200339 resetreferencesItem.addActionListener(this);
201340 menu.add("-");
341
+ }
202342 overwriteGeoItem = menu.add(new MenuItem("Overwrite Geometry"));
203343 overwriteGeoItem.addActionListener(this);
204344 overwriteMatItem = menu.add(new MenuItem("Overwrite Material"));
....@@ -210,79 +350,104 @@
210350 overwriteUVItem = menu.add(new MenuItem("Overwrite UV"));
211351 overwriteUVItem.addActionListener(this);
212352 menu.add("-");
353
+ if (Globals.ADVANCED)
354
+ {
213355 generateMeshItem = menu.add(new MenuItem("Generate Meshes"));
214356 generateMeshItem.addActionListener(this);
215357 poseMeshItem = menu.add(new MenuItem("Set Pose Meshes"));
216358 poseMeshItem.addActionListener(this);
217359 menu.add("-");
360
+ }
218361 resetsupportItem = menu.add(new MenuItem("Reset support"));
219362 resetsupportItem.addActionListener(this);
220363 linkverticesItem = menu.add(new MenuItem("Link to Support"));
221364 linkverticesItem.addActionListener(this);
222365 relinkverticesItem = menu.add(new MenuItem("Re-link to Support"));
223366 relinkverticesItem.addActionListener(this);
367
+
368
+ if (Globals.ADVANCED)
369
+ {
224370 setMasterItem = menu.add(new MenuItem("Set Master Mesh"));
225371 setMasterItem.addActionListener(this);
372
+ }
226373
227374 oe.menuBar.add(menu = new Menu("Group"));
228
- grabItem = menu.add(new MenuItem("Grab"));
229
- grabItem.addActionListener(this);
375
+// grabItem = menu.add(new MenuItem("Grab"));
376
+// grabItem.addActionListener(this);
230377 backItem = menu.add(new MenuItem("Back"));
231378 backItem.addActionListener(this);
232379 frontItem = menu.add(new MenuItem("Front"));
233380 frontItem.addActionListener(this);
234
- compositeItem = menu.add(new MenuItem("Composite"));
235
- compositeItem.addActionListener(this);
236
- hideItem = menu.add(new MenuItem("Hide"));
381
+// compositeItem = menu.add(new MenuItem("Composite"));
382
+// compositeItem.addActionListener(this);
383
+
384
+ if (Globals.ADVANCED)
385
+ {
386
+ hideItem = menu.add(new MenuItem("Hidden Group"));
237387 hideItem.addActionListener(this);
388
+ }
238389 ungroupItem = menu.add(new MenuItem("Ungroup"));
239390 ungroupItem.addActionListener(this);
240
- menu.add("-");
241
- randomItem = menu.add(new MenuItem("Random"));
242
- randomItem.addActionListener(this);
243
- physicsItem = menu.add(new MenuItem("Physics"));
244
- physicsItem.addActionListener(this);
245
- frameselectorItem = menu.add(new MenuItem("Frame Selector"));
246
- frameselectorItem.addActionListener(this);
391
+
392
+// menu.add("-");
393
+//
394
+// switchItem = menu.add(new MenuItem("Switch node"));
395
+// switchItem.addActionListener(this);
396
+ if (Globals.ADVANCED)
397
+ {
247398 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
248399 switchGeoItem.addActionListener(this);
249400 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
250401 switchTransfoItem.addActionListener(this);
251
- morphItem = menu.add(new MenuItem("Morph"));
402
+ morphItem = menu.add(new MenuItem("Morph Group"));
252403 morphItem.addActionListener(this);
404
+
405
+ menu.add("-");
406
+ physicsItem = menu.add(new MenuItem("Physics"));
407
+ physicsItem.addActionListener(this);
408
+ frameselectorItem = menu.add(new MenuItem("Frame Selector"));
409
+ frameselectorItem.addActionListener(this);
253410 scriptNodeItem = menu.add(new MenuItem("Script Node"));
254411 scriptNodeItem.addActionListener(this);
255
- cameraItem = menu.add(new MenuItem("Camera"));
256
- cameraItem.addActionListener(this);
412
+ }
257413
258414 oe.menuBar.add(menu = new Menu("Object"));
259
- textureItem = menu.add(new MenuItem("Texture"));
260
- textureItem.addActionListener(this);
415
+// textureItem = menu.add(new MenuItem("Texture"));
416
+// textureItem.addActionListener(this);
261417 billboardItem = menu.add(new MenuItem("Billboard"));
262418 billboardItem.addActionListener(this);
263419 csgItem = menu.add(new MenuItem("CSG"));
264420 csgItem.addActionListener(this);
265
- shadowXItem = menu.add(new MenuItem("Shadow X"));
421
+ shadowXItem = menu.add(new MenuItem("Shadow Red"));
266422 shadowXItem.addActionListener(this);
267
- shadowYItem = menu.add(new MenuItem("Shadow Y"));
423
+ shadowYItem = menu.add(new MenuItem("Shadow Green"));
268424 shadowYItem.addActionListener(this);
269
- shadowZItem = menu.add(new MenuItem("Shadow Z"));
425
+ shadowZItem = menu.add(new MenuItem("Shadow Blue"));
270426 shadowZItem.addActionListener(this);
427
+ attributeItem = menu.add(new MenuItem("Attribute"));
428
+ attributeItem.addActionListener(this);
429
+
430
+ if (Globals.ADVANCED)
431
+ {
432
+ menu.add("-");
271433 linkerItem = menu.add(new MenuItem("Linker"));
272434 linkerItem.addActionListener(this);
273435 templateItem = menu.add(new MenuItem("Template"));
274436 templateItem.addActionListener(this);
275
- attributeItem = menu.add(new MenuItem("Attribute"));
276
- attributeItem.addActionListener(this);
277437 pointflowItem = menu.add(new MenuItem("Point Flow"));
278438 pointflowItem.addActionListener(this);
439
+ }
279440 menu.add("-");
280441 resetTransformItem = menu.add(new MenuItem("Reset Transform"));
281442 resetTransformItem.addActionListener(this);
282443 resetCentroidItem = menu.add(new MenuItem("Reset Centroid"));
283444 resetCentroidItem.addActionListener(this);
284
- transformgeometryItem = menu.add(new MenuItem("Transform Geometry"));
285
- transformgeometryItem.addActionListener(this);
445
+ resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY"));
446
+ resetCentroidXZItem.addActionListener(this);
447
+ transformGeometryItem = menu.add(new MenuItem("Transform Geometry"));
448
+ transformGeometryItem.addActionListener(this);
449
+ transformChildrenItem = menu.add(new MenuItem("Transform Children"));
450
+ transformChildrenItem.addActionListener(this);
286451
287452 oe.menuBar.add(menu = new Menu("Geometry"));
288453 genUVItem = menu.add(new MenuItem("Generate UV"));
....@@ -293,8 +458,11 @@
293458 genNormalsCADItem.addActionListener(this);
294459 genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals"));
295460 genNormalsMESHItem.addActionListener(this);
296
- genNormalsMINEItem = menu.add(new MenuItem("My Normals"));
461
+ if (Globals.ADVANCED)
462
+ {
463
+ genNormalsMINEItem = menu.add(new MenuItem("Stitch Normals"));
297464 genNormalsMINEItem.addActionListener(this);
465
+ }
298466 stripifyItem = menu.add(new MenuItem("Stripify"));
299467 stripifyItem.addActionListener(this);
300468 unstripifyItem = menu.add(new MenuItem("Unstripify"));
....@@ -316,23 +484,34 @@
316484 reduce34MeshItem.addActionListener(this);
317485 increaseMeshItem = menu.add(new MenuItem("Increase mesh"));
318486 increaseMeshItem.addActionListener(this);
319
- smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
320
- smoothMeshItem.addActionListener(this);
321487 clipMeshItem = menu.add(new MenuItem("Clip mesh"));
322488 clipMeshItem.addActionListener(this);
489
+
490
+ if (Globals.ADVANCED)
491
+ {
492
+ smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
493
+ smoothMeshItem.addActionListener(this);
494
+ }
323495
324496 oe.menuBar.add(menu = new Menu("Attributes"));
325497 clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
326498 clearMaterialsItem.addActionListener(this);
499
+ resetAllItem = menu.add(new MenuItem("Reset All"));
500
+ resetAllItem.addActionListener(this);
501
+ stepAllItem = menu.add(new MenuItem("Step All"));
502
+ stepAllItem.addActionListener(this);
327503 menu.add("-");
328504 liveleavesItem = menu.add(new MenuItem("Live Leaves"));
329505 liveleavesItem.addActionListener(this);
330506 unliveleavesItem = menu.add(new MenuItem("Unlive Leaves"));
331507 unliveleavesItem.addActionListener(this);
508
+ if (Globals.ADVANCED)
509
+ {
332510 supportleavesItem = menu.add(new MenuItem("Support Leaves"));
333511 supportleavesItem.addActionListener(this);
334512 unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves"));
335513 unsupportleavesItem.addActionListener(this);
514
+ }
336515 hideleavesItem = menu.add(new MenuItem("Hide Leaves"));
337516 hideleavesItem.addActionListener(this);
338517 showleavesItem = menu.add(new MenuItem("Show Leaves"));
....@@ -341,6 +520,14 @@
341520 markleavesItem.addActionListener(this);
342521 unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves"));
343522 unmarkleavesItem.addActionListener(this);
523
+ rewindleavesItem = menu.add(new MenuItem("Rewind Leaves"));
524
+ rewindleavesItem.addActionListener(this);
525
+ unrewindleavesItem = menu.add(new MenuItem("Unrewind Leaves"));
526
+ unrewindleavesItem.addActionListener(this);
527
+ randomleavesItem = menu.add(new MenuItem("Random Leaves"));
528
+ randomleavesItem.addActionListener(this);
529
+ unrandomleavesItem = menu.add(new MenuItem("Unrandom Leaves"));
530
+ unrandomleavesItem.addActionListener(this);
344531 menu.add("-");
345532 flipVItem = menu.add(new MenuItem("Flip V"));
346533 flipVItem.addActionListener(this);
....@@ -366,45 +553,56 @@
366553 attachBumpItem.addActionListener(this);
367554 pigmentBumpItem = menu.add(new MenuItem("Pigment -> Bump"));
368555 pigmentBumpItem.addActionListener(this);
556
+ //embedTexturesItem
369557 detachPigmentItem = menu.add(new MenuItem("Detach Pigment"));
370558 detachPigmentItem.addActionListener(this);
371559 detachBumpItem = menu.add(new MenuItem("Detach Bump"));
372560 detachBumpItem.addActionListener(this);
561
+ embedTexturesItem = menu.add(new MenuItem("Embed Textures"));
562
+ embedTexturesItem.addActionListener(this);
563
+ deEmbedTexturesItem = menu.add(new MenuItem("De-embed Textures"));
564
+ deEmbedTexturesItem.addActionListener(this);
373565 menu.add("-");
374566 sortbysizeItem = menu.add(new MenuItem("Sort by size"));
375567 sortbysizeItem.addActionListener(this);
376568 sortbynameItem = menu.add(new MenuItem("Sort by name"));
377569 sortbynameItem.addActionListener(this);
378570 menu.add("-");
571
+ shareGeometriesItem = menu.add(new MenuItem("Share Geometries"));
572
+ shareGeometriesItem.addActionListener(this);
573
+ mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries"));
574
+ mergeGeometriesItem.addActionListener(this);
575
+ if (Globals.ADVANCED)
576
+ {
577
+ // Pretty much the same as duplicate and clone.
379578 extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
380579 extractGeometriesItem.addActionListener(this);
381580 cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry"));
382581 cloneGeometriesItem.addActionListener(this);
383
- shareGeometriesItem = menu.add(new MenuItem("Share Geometry"));
384
- shareGeometriesItem.addActionListener(this);
385
- mergeGeometriesItem = menu.add(new MenuItem("Merge Geometry"));
386
- mergeGeometriesItem.addActionListener(this);
582
+ }
387583
388584 oe.menuBar.add(menu = new Menu("Insert"));
389585 buildCreateMenu(menu);
390586
391
-
392
- oe.menuBar.add(menu = new Menu("Include"));
393
- importGFDItem = menu.add(new MenuItem("GrafreeD Object..."));
394
- importGFDItem.addActionListener(this);
395
- importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D Object..."));
396
- importVRMLX3DItem.addActionListener(this);
397
- importOBJItem = menu.add(new MenuItem("OBJ Object..."));
398
- importOBJItem.addActionListener(this);
399
- import3DSItem = menu.add(new MenuItem("3DS Object..."));
400
- import3DSItem.addActionListener(this);
401
-
402587 oe.menuBar.add(menu = new Menu("Tools"));
403588 buildToolsMenu(menu);
404589 }
405590
591
+
406592 void SetupUI2(ObjEditor oe)
407593 {
594
+ // June 2019
595
+ if (oe == null)
596
+ {
597
+ //super.SetupUI2(this);
598
+ //return;
599
+ }
600
+
601
+ if (copy != group)
602
+ {
603
+ //super.SetupUI2(this);
604
+ }
605
+
408606 //new Exception().printStackTrace();
409607
410608 oe.radioPanel = new JPanel(new GridBagLayout());
....@@ -433,150 +631,327 @@
433631 oe.radioPanel.add(dummyButton);
434632 oe.buttonGroup.add(dummyButton);
435633 */
436
- aConstraints.gridy += 1;
437
- oe.aConstraints.gridwidth = 1;
438
- oe.aConstraints.gridx = 0;
634
+ cGridBag copyOptionsPanel = new cGridBag();
635
+
636
+ copyOptionsPanel.preferredHeight = 2;
439637
440
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", CameraPane.isLIVE()), oe.aConstraints);
638
+ //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
639
+
640
+ //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
641
+ //minButton.setToolTipText("Minimize window");
642
+ //minButton.addActionListener(this);
643
+
644
+ if (Globals.ADVANCED)
645
+ {
646
+ oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
647
+ maxButton.setToolTipText("Maximize window");
648
+ maxButton.addActionListener(this);
649
+ }
650
+
651
+ oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
652
+ fullButton.setToolTipText("Full-screen window");
653
+ fullButton.addActionListener(this);
654
+
655
+ oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
656
+ screenfitButton.setToolTipText("Screen fit");
657
+ screenfitButton.addActionListener(this);
658
+
659
+ oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
660
+ restoreCameraButton.setToolTipText("Restore viewpoint");
661
+ restoreCameraButton.addActionListener(this);
662
+
663
+ copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
664
+ saveButton.setToolTipText("New version");
665
+ saveButton.addActionListener(this);
666
+
667
+ copyOptionsPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
668
+ undoButton.setToolTipText("Previous version");
669
+ undoButton.addActionListener(this);
670
+ undoButton.setEnabled(false);
671
+
672
+ cGridBag updown = new cGridBag().setVertical(true);
673
+ updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
674
+ restoreButton.setToolTipText("Restore current");
675
+ restoreButton.addActionListener(this);
676
+ restoreButton.setEnabled(false);
677
+
678
+ updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
679
+ replaceButton.setToolTipText("Replace current");
680
+ replaceButton.addActionListener(this);
681
+ replaceButton.setEnabled(false);
682
+
683
+ copyOptionsPanel.add(updown);
684
+
685
+ copyOptionsPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
686
+ redoButton.setToolTipText("Next version");
687
+ redoButton.addActionListener(this);
688
+ redoButton.setEnabled(false);
689
+
690
+ oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints);
691
+ liveCB.setToolTipText("Enable animation");
441692 liveCB.addItemListener(this);
442693
443
- oe.aConstraints.gridx += 1;
444
- oe.toolbarPanel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT), oe.aConstraints);
445
- supportCB.addItemListener(this);
446
-
447
- // oe.aConstraints.gridx += 1;
448
- // oe.toolbarPanel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), oe.aConstraints);
449
- // localCB.addItemListener(this);
450
-
451
- oe.aConstraints.gridx += 1;
452
- oe.toolbarPanel.add(crowdCB = new cCheckBox("Crowd", CameraPane.CROWD), oe.aConstraints);
453
- crowdCB.addItemListener(this);
454
-
455
- oe.aConstraints.gridx += 1;
456
- oe.toolbarPanel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA), oe.aConstraints);
457
- smoothCB.addItemListener(this);
458
-
459
- oe.aConstraints.gridx += 1;
460
- oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST), oe.aConstraints);
694
+ oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
695
+ oneStepButton.setToolTipText("Animate one step forward");
696
+ oneStepButton.addActionListener(this);
697
+
698
+ oe.toolbarPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints);
699
+ fastCB.setToolTipText("Fast mode");
461700 fastCB.addItemListener(this);
462
- oe.aConstraints.gridx += 1;
463
- oe.toolbarPanel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE), oe.aConstraints);
464
- slowCB.addItemListener(this);
465
- oe.aConstraints.gridx += 1;
466
- oe.toolbarPanel.add(boxCB = new cCheckBox("Box", CameraPane.FAST), oe.aConstraints);
467
- boxCB.addItemListener(this);
701
+
702
+ //oe.toolboxPanel.Return();
703
+
704
+// copyOptionsPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints);
705
+// trackCB.setToolTipText("Enable tracking");
706
+// trackCB.addItemListener(this);
468707
469
-// oe.aConstraints.gridx += 1;
470
-// oe.toolbarPanel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), oe.aConstraints);
471
-// speakerMocapCB.addItemListener(this);
472
-
473
- if (false)
474
- {
475
- // handled in scripts
476
- oe.aConstraints.gridx += 1;
477
- oe.toolbarPanel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA), oe.aConstraints);
478
- speakerCameraCB.addItemListener(this);
479
-
480
- oe.aConstraints.gridx += 1;
481
- oe.toolbarPanel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS), oe.aConstraints);
482
- speakerFocusCB.addItemListener(this);
483
-
484
- oe.aConstraints.gridx += 1;
485
- oe.toolbarPanel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS), oe.aConstraints);
486
- smoothfocusCB.addItemListener(this);
487
- }
488
-
489
-//oe.aConstraints.gridx += 1;
490
-//oe.toolbarPanel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), oe.aConstraints);
491
-// debugCB.addItemListener(this);
492
-
493
- oe.aConstraints.gridx += 1;
494
- oe.toolbarPanel.add(oeilCB = new cCheckBox("O", CameraPane.OEIL), oe.aConstraints);
495
- oeilCB.addItemListener(this);
496
-
497
- oe.aConstraints.gridx += 1;
498
- oe.toolbarPanel.add(lookAtCB = new cCheckBox("T", CameraPane.LOOKAT), oe.aConstraints);
499
- lookAtCB.addItemListener(this);
500
-
501
- oe.aConstraints.gridx += 1;
502
- oe.toolbarPanel.add(trackCB = new cCheckBox(":", CameraPane.TRACK), oe.aConstraints);
503
- trackCB.addItemListener(this);
504
-
505
- oe.aConstraints.gridx += 1;
506
- oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
507
- screenfitButton.addActionListener(this);
508
- oe.aConstraints.gridx += 1;
509708 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
510709 // screenfitpointButton.addActionListener(this);
511
-// oe.aConstraints.gridx += 1;
512
- oe.toolbarPanel.add(snapobjectButton = new cButton(" O+ ")); //, oe.aConstraints);
513
- snapobjectButton.addActionListener(this);
514
- oe.aConstraints.gridx += 1;
515710
516
- //aConstraints.gridx = 0;
517
- //aConstraints.gridy += 1;
518
- oe.aConstraints.weighty = 0;
519
- oe.aConstraints.gridwidth = 1;
520
-
521
- oe.toolbarPanel.add(flashSelectionButton = new cButton(" ? ")); //, oe.aConstraints);
522
- flashSelectionButton.addActionListener(this);
523
- oe.aConstraints.gridx += 1;
524
- oe.aConstraints.weighty = 0;
525
- oe.aConstraints.gridwidth = 1;
526
-
527
- //
528
- oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints);
529
- twoButton.addActionListener(this);
530
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
711
+ if (Globals.ADVANCED)
712
+ {
713
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
714
+ snapobjectButton.addActionListener(this);
715
+ snapobjectButton.setToolTipText("Snap Object");
716
+
717
+ oe.toolbarPanel.add(fourButton = GetButton("icons/controls-horizontal.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
531718 fourButton.addActionListener(this);
532
- oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
533
- sixButton.addActionListener(this);
534
- oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
719
+ fourButton.setToolTipText("Show control panel only");
720
+ }
721
+
722
+ //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
723
+
724
+ oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
725
+ twoButton.setToolTipText("Show 3D view only");
726
+ twoButton.addActionListener(this);
727
+ this.fullscreenLayout = twoButton;
728
+
729
+ oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
730
+ threeButton.setToolTipText("Show controls and 3D view");
535731 threeButton.addActionListener(this);
536
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
537
- sevenButton.addActionListener(this);
732
+ oe.toolbarPanel.add(sixButton = GetButton("icons/viewcontrols.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
733
+ sixButton.setToolTipText("Show 3D view and controls");
734
+ sixButton.addActionListener(this);
735
+// oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
736
+// sevenButton.setToolTipText("3-column layout");
737
+// sevenButton.addActionListener(this);
538738 //
539739
540
- oe.toolbarPanel.add(rootButton = new cButton(" o o o E ")); //, oe.aConstraints);
740
+ oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
741
+ rootButton.setToolTipText("Open selection in new tab");
541742 rootButton.addActionListener(this);
542
- oe.aConstraints.gridx += 1;
543
- oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
743
+
744
+ oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
745
+ closeButton.setToolTipText("Close tab");
544746 closeButton.addActionListener(this);
545747 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
546748 //clearButton.addActionListener(this);
547
- oe.aConstraints.gridx += 1;
548
-
549
- oe.aConstraints.gridx = 1; //
550
- oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints);
551
- editButton.addActionListener(this);
552
- oe.aConstraints.gridx += 1;
553
- oe.aConstraints.weighty = 0;
554
- oe.aConstraints.gridwidth = 1;
555749
556
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
750
+ cGridBag row1 = new cGridBag();
751
+
752
+ // INSERT
753
+ row1.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
754
+ gridButton.setToolTipText("Create grid");
755
+ gridButton.addActionListener(this);
756
+
757
+ row1.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
758
+ boxButton.setToolTipText("Create box");
759
+ boxButton.addActionListener(this);
760
+
761
+ row1.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
762
+ sphereButton.setToolTipText("Create sphere");
763
+ sphereButton.addActionListener(this);
764
+
765
+ row1.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
766
+ coneButton.setToolTipText("Create cone");
767
+ coneButton.addActionListener(this);
768
+
769
+ row1.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
770
+ torusButton.setToolTipText("Create torus");
771
+ torusButton.addActionListener(this);
772
+
773
+ row1.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
774
+ superButton.setToolTipText("Create superellipsoid");
775
+ superButton.addActionListener(this);
776
+
777
+ if (Globals.ADVANCED)
778
+ {
779
+ oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
780
+ kleinButton.setToolTipText("Create Klein bottle");
781
+ kleinButton.addActionListener(this);
782
+ }
783
+
784
+ row1.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
785
+ particlesButton.setToolTipText("Create particle system");
786
+ particlesButton.addActionListener(this);
787
+
788
+ oe.toolboxPanel.add(row1);
789
+
790
+ cGridBag row2 = new cGridBag();
791
+
792
+ row2.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
793
+ groupButton.setToolTipText("Create group");
794
+ groupButton.addActionListener(this);
795
+
796
+ row2.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
797
+ compositeButton.setToolTipText("Create composite");
798
+ compositeButton.addActionListener(this);
799
+
800
+ row2.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
801
+ switchButton.setToolTipText("Create item switcher");
802
+ switchButton.addActionListener(this);
803
+
804
+ row2.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
805
+ loopButton.setToolTipText("Create loop");
806
+ loopButton.addActionListener(this);
807
+
808
+ row2.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
809
+ textureButton.setToolTipText("Create texture");
810
+ textureButton.addActionListener(this);
811
+
812
+ row2.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
813
+ overlayButton.setToolTipText("Create overlay");
814
+ overlayButton.addActionListener(this);
815
+
816
+ row2.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
817
+ lightButton.setToolTipText("Create light");
818
+ lightButton.addActionListener(this);
819
+
820
+ oe.toolboxPanel.add(row2);
821
+
822
+ // ENVYMAPS
823
+ cGridBag row3 = new cGridBag();
824
+ row3.preferredHeight = 20;
825
+
826
+ AddSkyboxButton("default", "rgb", row3);
827
+ AddSkyboxButton("default", "cornell", row3);
828
+ AddSkyboxButton("default", "uffizi", row3);
829
+ AddSkyboxButton("default", "CloudyHills", row3);
830
+ AddSkyboxButton("default", "skycube", row3);
831
+
832
+ oe.toolboxPanel.add(row3);
833
+
834
+ cGridBag row4 = new cGridBag();
835
+ row4.preferredHeight = 20;
836
+
837
+ AddSkyboxButton("bridge", "Bridge2", row4);
838
+ AddSkyboxButton("urban", "GamlaStan2", row4);
839
+ AddSkyboxButton("urban", "Parliament", row4);
840
+ AddSkyboxButton("urban", "Roundabout", row4);
841
+
842
+ oe.toolboxPanel.add(row4);
843
+
844
+ cGridBag row5 = new cGridBag();
845
+ row5.preferredHeight = 20;
846
+
847
+ AddSkyboxButton("urban", "SaintLazarusChurch", row5);
848
+ AddSkyboxButton("urban", "SaintLazarusChurch2", row5);
849
+ AddSkyboxButton("urban", "SaintLazarusChurch3", row5);
850
+ AddSkyboxButton("urban", "UnionSquare", row5);
851
+
852
+ oe.toolboxPanel.add(row5);
853
+
854
+ cGridBag row6 = new cGridBag();
855
+ row6.preferredHeight = 20;
856
+
857
+ AddSkyboxButton("park", "BerzeliiPark", row6);
858
+ AddSkyboxButton("park", "Buddha", row6);
859
+ AddSkyboxButton("park", "CNTower2", row6);
860
+ //AddSkyboxButton("park", "Fatbursparken", row6);
861
+ AddSkyboxButton("park", "NiagaraFalls1", row6);
862
+
863
+ oe.toolboxPanel.add(row6);
864
+
865
+ cGridBag row7 = new cGridBag();
866
+ row7.preferredHeight = 20;
867
+
868
+ AddSkyboxButton("park", "NiagaraFalls3", row7);
869
+ AddSkyboxButton("park", "Park", row7);
870
+ //AddSkyboxButton("park", "Park2", row6);
871
+ //AddSkyboxButton("park", "Path", row6);
872
+ AddSkyboxButton("park", "Pond", row7);
873
+ AddSkyboxButton("park", "Skansen", row7);
874
+
875
+ oe.toolboxPanel.add(row7);
876
+
877
+ cGridBag row8 = new cGridBag();
878
+ row8.preferredHeight = 20;
879
+
880
+ AddSkyboxButton("park", "Skansen2", row8);
881
+ AddSkyboxButton("park", "Skansen3", row8);
882
+ AddSkyboxButton("park", "Skansen4", row8);
883
+ AddSkyboxButton("park", "Skansen5", row8);
884
+
885
+ oe.toolboxPanel.add(row8);
886
+
887
+ cGridBag row9 = new cGridBag();
888
+ row9.preferredHeight = 20;
889
+
890
+ AddSkyboxButton("park", "Stairs", row9);
891
+ //AddSkyboxButton("park", "Tantolunden", row6);
892
+ //AddSkyboxButton("park", "Tantolunden3", row6);
893
+ AddSkyboxButton("park", "Tantolunden4", row9);
894
+
895
+ oe.toolboxPanel.add(row9);
896
+/*
897
+BerzeliiPark
898
+Buddha
899
+CNTower2
900
+Fatbursparken
901
+NiagaraFalls1
902
+NiagaraFalls3
903
+Park
904
+Park2
905
+Path
906
+Pond
907
+Skansen
908
+Skansen2
909
+Skansen3
910
+Skansen4
911
+Skansen5
912
+Stairs
913
+Tantolunden
914
+Tantolunden3
915
+Tantolunden4
916
+ */
917
+
918
+ for (int i=1; --i>=0;)
919
+ {
920
+ //oe.toolboxPanel.Return();
921
+ oe.toolboxPanel.add(new cGridBag());
922
+ }
923
+
924
+ // EDIT panel
925
+ editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
926
+ editButton.setToolTipText("Pin selection controls");
927
+ editButton.addActionListener(this);
928
+
929
+ editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
930
+ uneditButton.setToolTipText("Remove selection controls");
557931 uneditButton.addActionListener(this);
558932
559
- oe.aConstraints.gridx += 1;
560
- oe.aConstraints.weighty = 0;
561
- oe.aConstraints.gridwidth = 1;
562
-
563
- oe.treePanel.add(clearPanelButton = new cButton("C"), oe.aConstraints);
564
- clearPanelButton.addActionListener(this);
565
-
566
- oe.aConstraints.gridx += 1;
567
- oe.aConstraints.weighty = 0;
568
- oe.aConstraints.gridwidth = 1;
569
-
570
- oe.treePanel.add(allParamsButton = new cButton("A"), oe.aConstraints);
933
+ editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
934
+ allParamsButton.setToolTipText("Show all controle");
571935 allParamsButton.addActionListener(this);
572936
573
- oe.aConstraints.gridx += 1;
574
- oe.aConstraints.weighty = 0;
575
- oe.aConstraints.gridwidth = 1;
576
-
577
- oe.treePanel.add(unselectButton = new cButton("U"), oe.aConstraints);
937
+ editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
938
+ clearPanelButton.setToolTipText("Clear edit panel");
939
+ clearPanelButton.addActionListener(this);
940
+
941
+ editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
942
+ unselectButton.setToolTipText("Unselect");
578943 unselectButton.addActionListener(this);
579944
945
+ editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
946
+ flashSelectionButton.setToolTipText("Highlight selection");
947
+ flashSelectionButton.addActionListener(this);
948
+
949
+ editCommandsPanel.preferredHeight = 1;
950
+
951
+ SetPinStates(false);
952
+// oe.treePanel.add(commandsPanel);
953
+// oe.treePanel.Return();
954
+
580955 // oe.aConstraints.gridx += 1;
581956 // oe.aConstraints.weighty = 0;
582957 // oe.aConstraints.gridwidth = 1;
....@@ -588,47 +963,32 @@
588963 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
589964 // gcButton.addActionListener(this);
590965
591
- oe.aConstraints.gridx = 0;
592
- oe.aConstraints.gridy += 1;
593
-
594
- //ctrlPanel.add(objList = new List(5, true));
595
- oe.aConstraints.gridwidth = 100;
596
- // oe.aConstraints.gridheight = 100;
597
- oe.aConstraints.fill = GridBagConstraints.BOTH; // HORIZONTAL;
598
- oe.aConstraints.gridheight = 1;
599
- oe.aConstraints.weighty = 0.5;
600
- oe.aConstraints.gridx = 0;
601
- JScrollPane jSP;
966
+ cGridBag jSPPanel = new cGridBag();
967
+
968
+ JScrollPane jSP;
602969 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
603
- oe.treePanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null)), oe.aConstraints);
970
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints);
604971 ResetModel();
605
- oe.aConstraints.weighty = 0.5;
606
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
607
- oe.aConstraints.gridy += 1;
608
- oe.aConstraints.gridwidth = 1;
609
-
610
- oe.aConstraints.weighty = 0;
611
- oe.aConstraints.gridwidth = 2;
612
-
613
- oe.treePanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0), oe.aConstraints);
614
- colorCB.addItemListener(this);
615
- oe.aConstraints.gridx += 2;
616
- oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints);
617
- materialCB.addItemListener(this);
618
- oe.aConstraints.gridx += 2;
619
- oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints);
620
- textureCB.addItemListener(this);
621
-
622
- oe.aConstraints.gridx = 0;
623
- oe.aConstraints.gridy += 1;
624972
973
+ oe.treePanel.add(jSPPanel);
974
+ oe.treePanel.Return();
975
+
976
+ oe.treePanel.add(copyOptionsPanel);
977
+ oe.treePanel.Return();
978
+ cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0);
979
+ versionSlider = (cNumberSlider)sliderPane.getComponent(1);
980
+ sliderPane.preferredHeight = 1;
981
+
982
+// mainPanel.setDividerLocation(0.1); //1.0);
983
+ mainPanel.setResizeWeight(0.4);
984
+
625985 //jList.addListSelectionListener(this);
626986 oe.jTree.addTreeSelectionListener(this);
627987 //jTree.setRootVisible(false);
628988 //jTree.setEditable(true);
629989 oe.jTree.setDragEnabled(true);
630990 //jTree.setPreferredSize(new Dimension(10,10));
631
- jSP.setPreferredSize(new Dimension(100,200));
991
+ //jSP.setPreferredSize(new Dimension(100,200));
632992
633993 oe.jTree.setCellRenderer(new cTreeModel.Renderer());
634994
....@@ -640,23 +1000,160 @@
6401000 dgr.addDragGestureListener(this);
6411001 }catch(Exception e) {}
6421002 */
643
- radio.layout = sevenButton;
1003
+ radio.layout = sixButton; // sevenButton;
6441004 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
6451005 }
1006
+
1007
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
1008
+ {
1009
+ panel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
1010
+ colorCB.setToolTipText("Copy color when dropped");
1011
+ colorCB.addItemListener(this);
1012
+
1013
+ panel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
1014
+ materialCB.setToolTipText("Copy material when dropped");
1015
+ materialCB.addItemListener(this);
1016
+
1017
+ panel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
1018
+ textureCB.setToolTipText("Copy texture when dropped");
1019
+ textureCB.addItemListener(this);
1020
+
1021
+ panel.Return();
1022
+
1023
+ panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
1024
+ boxCB.setToolTipText("Display bounding boxes");
1025
+ boxCB.addItemListener(this);
1026
+
1027
+ panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
1028
+ zoomBoxCB.setToolTipText("Display only for wheel");
1029
+ zoomBoxCB.addItemListener(this);
1030
+
1031
+ if (true) // Globals.ADVANCED)
1032
+ {
1033
+// panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
1034
+// supportCB.setToolTipText("Enable rigging");
1035
+// supportCB.addItemListener(this);
1036
+
1037
+ panel.add(freezeCB = new cCheckBox("Freeze", Globals.FREEZEONMOVE)); //, constraints);
1038
+ freezeCB.setToolTipText("Fast moving camera");
1039
+ freezeCB.addItemListener(this);
1040
+
1041
+ // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
1042
+ // localCB.addItemListener(this);
1043
+
1044
+ panel.Return();
1045
+
1046
+ panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
1047
+ crowdCB.setToolTipText("Used for crowds");
1048
+ crowdCB.addItemListener(this);
1049
+
1050
+ panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
1051
+ smoothCB.setToolTipText("Snapping delay");
1052
+ smoothCB.addItemListener(this);
1053
+
1054
+ panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
1055
+ slowCB.setToolTipText("Smooth interpolation");
1056
+ slowCB.addItemListener(this);
1057
+
1058
+// constraints.gridy += 1;
1059
+// panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
1060
+// speakerMocapCB.addItemListener(this);
1061
+
1062
+ panel.Return();
1063
+
1064
+ if (false)
1065
+ {
1066
+ // handled in scripts
1067
+ //constraints.gridy += 1;
1068
+ panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints);
1069
+ speakerCameraCB.addItemListener(this);
1070
+
1071
+ //constraints.gridy += 1;
1072
+ panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints);
1073
+ speakerFocusCB.addItemListener(this);
1074
+
1075
+ //constraints.gridy += 1;
1076
+ panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
1077
+ smoothfocusCB.addItemListener(this);
1078
+ panel.Return();
1079
+ }
1080
+
1081
+//constraints.gridx += 1;
1082
+//panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
1083
+// debugCB.addItemListener(this);
1084
+
1085
+ panel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
1086
+ trackCB.setToolTipText("Enable tracking target");
1087
+ trackCB.addItemListener(this);
1088
+
1089
+ panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
1090
+ oeilCB.setToolTipText("Move camera when tracking");
1091
+ oeilCB.addItemListener(this);
1092
+
1093
+ panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints);
1094
+ shadowCB.setToolTipText("When live compute shadows");
1095
+ shadowCB.addItemListener(this);
1096
+
1097
+ panel.Return();
1098
+ panel.add(toggleTextureCB = new cCheckBox("Textures", CameraPane.textureon)); //, constraints);
1099
+ toggleTextureCB.setToolTipText("Load textures");
1100
+ toggleTextureCB.addItemListener(this);
1101
+
1102
+ panel.add(toggleSwitchCB = new cCheckBox("Switch", CameraPane.SWITCH)); //, constraints);
1103
+ toggleSwitchCB.setToolTipText("Choose a single item");
1104
+ toggleSwitchCB.addItemListener(this);
1105
+
1106
+ panel.add(autokeepCB = new cCheckBox("Auto-replace", Globals.REPLACEONMAKE)); //, constraints);
1107
+ autokeepCB.setToolTipText("On structure change");
1108
+ autokeepCB.addItemListener(this);
1109
+
1110
+ panel.Return();
1111
+ if (Globals.ADVANCED)
1112
+ {
1113
+ panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
1114
+ lookAtCB.setToolTipText("Look-at target");
1115
+ lookAtCB.addItemListener(this);
1116
+ }
1117
+
1118
+ }
1119
+
1120
+ cGridBag fill = new cGridBag();
1121
+ fill.preferredHeight = 200;
1122
+ cGridBag fill2 = new cGridBag();
1123
+ fill2.preferredHeight = 200;
1124
+ cGridBag fill3 = new cGridBag();
1125
+ fill3.preferredHeight = 200;
1126
+
1127
+ panel.add(fill);
1128
+ panel.add(fill2);
1129
+ panel.add(fill3);
1130
+
1131
+ }
6461132
6471133 void EditObject(Object3D obj)
6481134 {
649
- cRadio dummyButton = new cRadio(obj.name);
650
- dummyButton.SetObject(obj);
651
- dummyButton.layout = sevenButton;
652
- dummyButton.SetCamera(cameraView.renderCamera, false);
653
- dummyButton.addActionListener(this);
654
- radioPanel.add(dummyButton);
655
- buttonGroup.add(dummyButton);
656
- dummyButton.doClick();
1135
+ cRadio radioButton = new cRadio(obj.name);
1136
+
1137
+ // June 2019. Patch to avoid bug with transparency.
1138
+ radioButton.hadMaterial = obj.material != null;
1139
+ if (!radioButton.hadMaterial)
1140
+ {
1141
+ obj.material = new cMaterial();
1142
+ }
1143
+
1144
+ radioButton.SetObject(obj);
1145
+ radioButton.layout = sixButton; // sevenButton;
1146
+ radioButton.SetCamera(cameraView.renderCamera, false);
1147
+ radioButton.addActionListener(this);
1148
+ radioPanel.add(radioButton);
1149
+ buttonGroup.add(radioButton);
1150
+ radioButton.doClick();
6571151 }
1152
+
6581153 void SetupViews(ObjEditor oe)
6591154 {
1155
+ theFrame = this;
1156
+
6601157 oe.SetupViews();
6611158
6621159 System.out.println("SetupViews");
....@@ -665,22 +1162,28 @@
6651162 /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this);
6661163 }
6671164
668
- JCheckBox liveCB;
669
- JCheckBox supportCB;
670
- JCheckBox localCB;
671
- JCheckBox crowdCB;
672
- JCheckBox smoothCB;
673
- JCheckBox fastCB;
674
- JCheckBox slowCB;
675
- JCheckBox boxCB;
676
- JCheckBox trackCB;
677
- JCheckBox smoothfocusCB;
1165
+ cToggleButton liveCB;
1166
+ cCheckBox supportCB;
1167
+ cCheckBox localCB;
1168
+ cCheckBox crowdCB;
1169
+ cCheckBox smoothCB;
1170
+ cToggleButton fastCB;
1171
+ cCheckBox slowCB;
1172
+ cCheckBox boxCB;
1173
+ cCheckBox zoomBoxCB;
1174
+ cCheckBox freezeCB;
1175
+ //cToggleButton trackCB;
1176
+ cCheckBox trackCB;
1177
+ cCheckBox smoothfocusCB;
6781178 // JCheckBox speakerMocapCB;
679
- JCheckBox speakerCameraCB;
680
- JCheckBox speakerFocusCB;
681
- JCheckBox debugCB;
682
- JCheckBox oeilCB;
683
- JCheckBox lookAtCB;
1179
+ cCheckBox speakerCameraCB;
1180
+ cCheckBox speakerFocusCB;
1181
+ cCheckBox debugCB;
1182
+
1183
+ cCheckBox oeilCB;
1184
+ cCheckBox shadowCB;
1185
+ cCheckBox autokeepCB;
1186
+ cCheckBox lookAtCB;
6841187
6851188 // static int COLOR = 1;
6861189 // static int MATERIAL = 2;
....@@ -688,9 +1191,9 @@
6881191
6891192 int dropAttributes = Object3D.COLOR | Object3D.MATERIAL;
6901193
691
- JCheckBox colorCB;
692
- JCheckBox materialCB;
693
- JCheckBox textureCB;
1194
+ cCheckBox colorCB;
1195
+ cCheckBox materialCB;
1196
+ cCheckBox textureCB;
6941197
6951198 public void itemStateChanged(ItemEvent e)
6961199 {
....@@ -715,10 +1218,10 @@
7151218 dropAttributes |= Object3D.TEXTURE;
7161219 else
7171220 dropAttributes &= ~Object3D.TEXTURE;
718
- }
719
- else if(e.getSource() == liveCB)
1221
+ } else if(e.getSource() == liveCB)
7201222 {
7211223 cameraView.ToggleLive();
1224
+ refreshContents(false);
7221225 }
7231226 else if(e.getSource() == supportCB)
7241227 {
....@@ -754,6 +1257,10 @@
7541257 cameraView.repaint();
7551258 // refreshContents();
7561259 }
1260
+ else if(e.getSource() == zoomBoxCB)
1261
+ {
1262
+ cameraView.ToggleZoomBoxMode();
1263
+ }
7571264 else if(e.getSource() == smoothfocusCB)
7581265 {
7591266 cameraView.ToggleSmoothFocus();
....@@ -779,6 +1286,18 @@
7791286 {
7801287 cameraView.ToggleOeil();
7811288 }
1289
+ else if(e.getSource() == shadowCB)
1290
+ {
1291
+ Globals.COMPUTESHADOWWHENLIVE ^= true;
1292
+ }
1293
+ else if(e.getSource() == freezeCB)
1294
+ {
1295
+ Globals.FREEZEONMOVE ^= true;
1296
+ }
1297
+ else if(e.getSource() == autokeepCB)
1298
+ {
1299
+ Globals.REPLACEONMAKE ^= true;
1300
+ }
7821301 else if(e.getSource() == lookAtCB)
7831302 {
7841303 cameraView.ToggleLookAt();
....@@ -795,7 +1314,8 @@
7951314
7961315 /**/
7971316 //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this);
798
- TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1317
+ //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1318
+ TreePath path = objEditor.jTree.getSelectionPath();
7991319 if ((path == null) || (path.getPathCount() <= 1)) {
8001320 // We can't move the root node or an empty selection
8011321 return;
....@@ -858,8 +1378,6 @@
8581378 }
8591379 }
8601380
861
- String string = (String) object;
862
-
8631381 System.out.println("Transfer = " + object + "; drop : " + target);
8641382 // if( object instanceof java.io.File[])
8651383 // {
....@@ -867,7 +1385,11 @@
8671385 // objEditor.DropFile((java.io.File[]) object, true);
8681386 // return;
8691387 // }
870
- if (string.charAt(0) == '/')
1388
+
1389
+ String string = object.toString();
1390
+
1391
+ // File path for Mac and Windows
1392
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
8711393 {
8721394 // file(s)
8731395 String[] names = string.split("\n");
....@@ -894,7 +1416,7 @@
8941416
8951417 flashIt = false;
8961418 CameraPane pane = (CameraPane) target;
897
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1419
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
8981420 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
8991421
9001422 if (group.selection.size() == 1)
....@@ -910,23 +1432,33 @@
9101432
9111433 assert target == objEditor.jTree;
9121434 TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y);
1435
+ Object3D destinationLeaf;
9131436 try {
914
- Object3D dummy = (Composite) destinationPath.getLastPathComponent();
1437
+ destinationLeaf = (Composite) destinationPath.getLastPathComponent();
9151438 } catch (Exception e) {
9161439 System.out.println("destinationPath : " + destinationPath);
9171440 return;
9181441 }
9191442
920
- if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1443
+ for (int i=group.selection.size(); --i>=0;)
9211444 {
1445
+ Object3D child = (Object3D)group.selection.elementAt(i);
1446
+
1447
+ // Cannot move into itself
1448
+ if (child == destinationLeaf)
1449
+ return;
1450
+ }
1451
+
1452
+// june 2019 if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1453
+// {
9221454 loadClipboard(true);
9231455 objEditor.jTree.setSelectionPath(destinationPath);
924
- pasteInto(false);
925
- } else {
926
- loadClipboard(false);
927
- objEditor.jTree.setSelectionPath(destinationPath);
928
- pasteInto(false); // true); // ???
929
- }
1456
+ pasteInto(false, false);
1457
+// } else {
1458
+// loadClipboard(false);
1459
+// objEditor.jTree.setSelectionPath(destinationPath);
1460
+// pasteInto(false, false); // true); // ???
1461
+// }
9301462 }
9311463 public void dropActionChanged(DropTargetDragEvent dtde)
9321464 // Called if the user has modified the current drop gesture
....@@ -1031,85 +1563,107 @@
10311563 {
10321564 //heightFieldItem = menu.add(new MenuItem("Height Field"));
10331565 //heightFieldItem.addActionListener(this);
1034
- gridItem = menu.add(new MenuItem("Grid"));
1035
- gridItem.addActionListener(this);
1036
- rectoidItem = menu.add(new MenuItem("Box"));
1037
- rectoidItem.addActionListener(this);
1038
- ellipsoidItem = menu.add(new MenuItem("Sphere"));
1039
- ellipsoidItem.addActionListener(this);
1040
- coneItem = menu.add(new MenuItem("Cone"));
1041
- coneItem.addActionListener(this);
1042
- torusItem = menu.add(new MenuItem("Torus"));
1043
- torusItem.addActionListener(this);
1044
- superItem = menu.add(new MenuItem("Superellipsoid"));
1045
- superItem.addActionListener(this);
1566
+// gridItem = menu.add(new MenuItem("Grid"));
1567
+// gridItem.addActionListener(this);
1568
+// rectoidItem = menu.add(new MenuItem("Box"));
1569
+// rectoidItem.addActionListener(this);
1570
+// ellipsoidItem = menu.add(new MenuItem("Sphere"));
1571
+// ellipsoidItem.addActionListener(this);
1572
+// coneItem = menu.add(new MenuItem("Cone"));
1573
+// coneItem.addActionListener(this);
1574
+// torusItem = menu.add(new MenuItem("Torus"));
1575
+// torusItem.addActionListener(this);
1576
+// superItem = menu.add(new MenuItem("Superellipsoid"));
1577
+// superItem.addActionListener(this);
1578
+
1579
+ cameraItem = menu.add(new MenuItem("Camera"));
1580
+ cameraItem.addActionListener(this);
1581
+
1582
+ if (!Globals.ADVANCED)
1583
+ {
10461584 kleinItem = menu.add(new MenuItem("Klein Bottle"));
10471585 kleinItem.addActionListener(this);
1048
- particleItem = menu.add(new MenuItem("Particle system"));
1049
- particleItem.addActionListener(this);
1586
+ }
1587
+
1588
+// particleItem = menu.add(new MenuItem("Particle system"));
1589
+// particleItem.addActionListener(this);
1590
+ if (Globals.ADVANCED)
1591
+ {
10501592 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10511593 ragdollItem.addActionListener(this);
10521594 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10531595 ragdoll2Item.addActionListener(this);
1596
+ }
10541597 menu.add("-");
1055
- meshItem = menu.add(new MenuItem("Mesh"));
1598
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10561599 meshItem.addActionListener(this);
10571600 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10581601 // meshGroupItem.addActionListener(this);
1602
+ if (Globals.ADVANCED)
1603
+ {
10591604 springItem = menu.add(new MenuItem("Spring"));
10601605 springItem.addActionListener(this);
10611606 flagItem = menu.add(new MenuItem("Flag"));
10621607 flagItem.addActionListener(this);
1063
- bezierItem = menu.add(new MenuItem("Patch"));
1064
- bezierItem.addActionListener(this);
1065
- checkerItem = menu.add(new MenuItem("Checker"));
1066
- checkerItem.addActionListener(this);
10671608 blobItem = menu.add(new MenuItem("Blob"));
10681609 blobItem.addActionListener(this);
10691610 latheItem = menu.add(new MenuItem("Lathe"));
10701611 latheItem.addActionListener(this);
1071
- lightItem = menu.add(new MenuItem("Light"));
1072
- lightItem.addActionListener(this);
1612
+ }
1613
+ bezierItem = menu.add(new MenuItem("Bezier Patch"));
1614
+ bezierItem.addActionListener(this);
1615
+// overlayItem = menu.add(new MenuItem("Overlay"));
1616
+// overlayItem.addActionListener(this);
1617
+// lightItem = menu.add(new MenuItem("Light"));
1618
+// lightItem.addActionListener(this);
10731619 menu.add("-");
10741620 //superLoopItem = menu.add(new MenuItem("Super Loop"));
10751621 //superLoopItem.addActionListener(this);
1076
- loopItem = menu.add(new MenuItem("Loop"));
1077
- loopItem.addActionListener(this);
1622
+// loopItem = menu.add(new MenuItem("Loop"));
1623
+// loopItem.addActionListener(this);
10781624 doubleItem = menu.add(new MenuItem("Fork"));
10791625 doubleItem.addActionListener(this);
1626
+ if (Globals.ADVANCED)
1627
+ {
10801628 tripleItem = menu.add(new MenuItem("Trident"));
10811629 tripleItem.addActionListener(this);
1630
+ }
10821631 }
10831632
10841633 void buildToolsMenu(Menu menu)
10851634 {
10861635 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
10871636 animationItem.addItemListener(this);
1088
- animationItem.setState(CameraPane.ANIMATION);
1637
+ animationItem.setState(Globals.ANIMATION);
1638
+
1639
+ menu.add(archiveItem = new MenuItem("Archive3D..."));
1640
+ archiveItem.addActionListener(this);
10891641
10901642 menu.add("-");
10911643 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
10921644 parseverticesItem.addActionListener(this);
10931645 textureFieldItem = menu.add(new MenuItem("Texture Field"));
10941646 textureFieldItem.addActionListener(this);
1095
- alignItem = menu.add(new MenuItem("Align"));
1647
+ alignItem = menu.add(new MenuItem("Align Objects"));
10961648 alignItem.addActionListener(this);
1097
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1098
- mirrorItem.addActionListener(this);
10991649 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
11001650 reduceMorphItem.addActionListener(this);
11011651 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
11021652 reduce34MorphItem.addActionListener(this);
1103
-
1104
- menu.add(computeAOItem = new MenuItem("Compute AO"));
1105
- computeAOItem.addActionListener(this);
11061653 menu.add("-");
1107
-
11081654 menu.add(memoryItem = new MenuItem("Memory Usage"));
11091655 memoryItem.addActionListener(this);
1656
+ menu.add(computeAOItem = new MenuItem("Compute AO"));
1657
+ computeAOItem.addActionListener(this);
1658
+
1659
+ if (Globals.ADVANCED)
1660
+ {
1661
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1662
+ mirrorItem.addActionListener(this);
1663
+ menu.add("-");
11101664 menu.add(analyzeItem = new MenuItem("Analyze"));
11111665 analyzeItem.addActionListener(this);
1112
- menu.add(dumpItem = new MenuItem("Dump"));
1666
+ menu.add(dumpItem = new MenuItem("Print"));
11131667 dumpItem.addActionListener(this);
11141668 // menu.add(pathItem = new MenuItem("From-to path"));
11151669 // pathItem.addActionListener(this);
....@@ -1118,6 +1672,8 @@
11181672 resetParentItem.addActionListener(this);
11191673 repairParentItem = menu.add(new MenuItem("Repair Parent"));
11201674 repairParentItem.addActionListener(this);
1675
+ repairShadowItem = menu.add(new MenuItem("Repair Shadow"));
1676
+ repairShadowItem.addActionListener(this);
11211677 menu.add(invariantsItem = new MenuItem("Invariants"));
11221678 invariantsItem.addActionListener(this);
11231679 menu.add(recompileItem = new MenuItem("Recompile"));
....@@ -1125,6 +1681,7 @@
11251681 menu.add("-");
11261682 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11271683 editScriptItem.addActionListener(this);
1684
+ }
11281685 }
11291686
11301687 void ScreenFit()
....@@ -1247,9 +1804,34 @@
12471804 shadow.material = new cMaterial(obj.material);
12481805 shadow.material.diffuse = 0.0001f;
12491806 shadow.material.specular = 0.0001f;
1807
+ //shadow.projectedVertices[1].x = 300;
12501808
12511809 makeSomething(shadow);
12521810 }
1811
+
1812
+ private void ClearUnpinned()
1813
+ {
1814
+ //for (Object3D obj : listUI)
1815
+ for (int i=listUI.size(); --i>=0;)
1816
+ {
1817
+ Object3D obj = listUI.elementAt(i);
1818
+ if (!obj.pinned)
1819
+ {
1820
+ obj.CloseUI();
1821
+ listUI.remove(i);
1822
+ }
1823
+ }
1824
+ }
1825
+
1826
+ private void EditElement(Object3D elem, boolean newWindow)
1827
+ {
1828
+ // if (!(elem instanceof Composite))
1829
+ // newWindow = false;
1830
+ listUI.add(elem);
1831
+ elem.openEditWindow(this, newWindow); //, false);
1832
+ System.out.println("edit : " + elem);
1833
+ elem.editWindow.refreshContents(true); // ? new
1834
+ }
12531835
12541836 /**
12551837 * applyExample
....@@ -1453,9 +2035,9 @@
14532035
14542036 void Overwrite(int mask)
14552037 {
1456
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2038
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14572039 {
1458
- Object3D content = GrafreeD.clipboard.get(0);
2040
+ Object3D content = Grafreed.clipboard.get(0);
14592041
14602042 if (content instanceof cGroup && ((cGroup)content).transientlink )
14612043 content = ((cGroup)content).get(0);
....@@ -1478,6 +2060,7 @@
14782060 //
14792061 public void actionPerformed(ActionEvent event) // , Object arg)
14802062 {
2063
+ Object source = event.getSource();
14812064 /*
14822065 if (event.getSource() == nameField)
14832066 {
....@@ -1489,11 +2072,11 @@
14892072 }
14902073 else
14912074 */
1492
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
2075
+ if (source == lookAtItem || source == lookFromItem)
14932076 {
14942077 ScreenFit();
14952078 } else
1496
- if (event.getSource() == switchItem)
2079
+ if (source == switchViewItem)
14972080 {
14982081 cVector v1 = new cVector();
14992082 cVector v2 = new cVector();
....@@ -1502,11 +2085,11 @@
15022085 objEditor.cameraView.renderCamera.setAim(v2, v1);
15032086 objEditor.cameraView.repaint();
15042087 } else
1505
- if (event.getSource() == rectoidItem)
2088
+ if (source == rectoidItem || source == boxButton)
15062089 {
15072090 makeSomething(new Box());
15082091 } else
1509
- if (event.getSource() == particleItem)
2092
+ if (source == particleItem || source == particlesButton)
15102093 {
15112094 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15122095 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1527,9 +2110,9 @@
15272110 applyExample(particleGeom, "SMOKE");
15282111 makeSomething(particleGeom);
15292112 } else
1530
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
2113
+ if (source == ragdollItem || source == ragdoll2Item)
15312114 {
1532
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
2115
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15332116
15342117 ragdoll.toParent = LA.newMatrix();
15352118 ragdoll.fromParent = LA.newMatrix();
....@@ -1547,7 +2130,7 @@
15472130 } else
15482131 /*
15492132 */
1550
- if (event.getSource() == heightFieldItem)
2133
+ if (source == heightFieldItem)
15512134 {
15522135 Object3D obj = new Object3D();
15532136
....@@ -1585,31 +2168,31 @@
15852168
15862169 makeSomething(obj);
15872170 } else
1588
- if (event.getSource() == gridItem)
2171
+ if (source == gridItem || source == gridButton)
15892172 {
15902173 makeSomething(new Grid());
15912174 } else
1592
- if (event.getSource() == ellipsoidItem)
2175
+ if (source == ellipsoidItem || source == sphereButton)
15932176 {
15942177 makeSomething(new Sphere());
15952178 } else
1596
- if (event.getSource() == coneItem)
2179
+ if (source == coneItem || source == coneButton)
15972180 {
15982181 makeSomething(new Cone());
15992182 } else
1600
- if (event.getSource() == torusItem)
2183
+ if (source == torusItem || source == torusButton)
16012184 {
16022185 makeSomething(new Torus());
16032186 } else
1604
- if (event.getSource() == superItem)
2187
+ if (source == superItem || source == superButton)
16052188 {
16062189 makeSomething(new Superellipsoid());
16072190 } else
1608
- if (event.getSource() == kleinItem)
2191
+ if (source == kleinItem || source == kleinButton)
16092192 {
16102193 makeSomething(new Klein());
16112194 } else
1612
- if (event.getSource() == blobItem)
2195
+ if (source == blobItem)
16132196 {
16142197 Blob blob = new Blob();
16152198 BlobComponent comp = new BlobComponent();
....@@ -1617,15 +2200,15 @@
16172200 //blob.retile();
16182201 makeSomething(blob);
16192202 } else
1620
- if (event.getSource() == latheItem)
2203
+ if (source == latheItem)
16212204 {
16222205 makeSomething(new Lathe());
16232206 } else
1624
- if (event.getSource() == bezierItem)
2207
+ if (source == bezierItem)
16252208 {
16262209 makeSomething(new BezierSurface());
16272210 } else
1628
- if (event.getSource() == checkerItem)
2211
+ if (source == overlayItem || source == overlayButton)
16292212 {
16302213 /*
16312214 Object3D obj = new BezierSurface(5,8);
....@@ -1640,7 +2223,7 @@
16402223 */
16412224 makeSomething(new Checker());
16422225 } else
1643
- if (event.getSource() == meshItem)
2226
+ if (source == meshItem)
16442227 {
16452228 Object3D itemtomake = new Object3D();
16462229 Object3D child;
....@@ -1661,35 +2244,52 @@
16612244 makeSomething(child);
16622245 }
16632246 } else
1664
- if (event.getSource() == springItem)
2247
+ if (source == springItem)
16652248 {
16662249 cSpring s = new cSpring();
16672250 s.setup();
16682251 makeSomething(s);
16692252 } else
1670
- if (event.getSource() == flagItem)
2253
+ if (source == flagItem)
16712254 {
16722255 cSpring s = new cFlag();
16732256 s.setup();
16742257 makeSomething(s);
16752258 } else
1676
- if (event.getSource() == lightItem)
2259
+ if (source == lightItem || source == lightButton)
16772260 {
16782261 makeSomething(new Light());
16792262 } else
1680
- if (event.getSource() == csgItem)
2263
+// if (source == skybox1Button ||
2264
+// source == skybox2Button ||
2265
+// source == skybox3Button ||
2266
+// source == skybox4Button ||
2267
+// source == skybox5Button ||
2268
+// source == skybox6Button ||
2269
+// source == skybox7Button ||
2270
+// source == skybox11Button ||
2271
+// source == skybox12Button ||
2272
+// source == skybox13Button ||
2273
+// source == skybox14Button ||
2274
+// source == skybox15Button ||
2275
+// source == skybox16Button ||
2276
+// source == skybox17Button)
2277
+// {
2278
+// ChangeSkybox(source);
2279
+// } else
2280
+ if (source == csgItem)
16812281 {
16822282 group(new CSG());
16832283 } else
1684
- if (event.getSource() == templateItem)
2284
+ if (source == templateItem)
16852285 {
16862286 group(new cTemplate());
16872287 } else
1688
- if (event.getSource() == attributeItem)
2288
+ if (source == attributeItem)
16892289 {
16902290 makeSomething(new Attribute());
16912291 } else
1692
- if (event.getSource() == pointflowItem)
2292
+ if (source == pointflowItem)
16932293 {
16942294 makeSomething(new PointFlow());
16952295 } else
....@@ -1701,7 +2301,7 @@
17012301 } else
17022302 */
17032303
1704
- if (event.getSource() == superLoopItem)
2304
+ if (source == superLoopItem)
17052305 {
17062306 Composite g = new cGroup();
17072307 for (int i=0; i<15; i++)
....@@ -1723,30 +2323,30 @@
17232323
17242324 group(g);
17252325 } else
1726
- if (event.getSource() == loopItem)
2326
+ if (source == loopItem || source == loopButton)
17272327 {
17282328 Composite csg = new GroupLeaf();
17292329 csg.count = 5;
17302330 group(csg);
1731
- Composite child = new cGroup();
2331
+ Composite child = new cGroup("Branch");
17322332 csg.addChild(child);
17332333 child.addChild(csg);
17342334 } else
1735
- if (event.getSource() == doubleItem)
2335
+ if (source == doubleItem)
17362336 {
1737
- Composite csg = new GroupLeaf();
2337
+ Composite csg = new GroupLeaf("Fork");
17382338 csg.count = 5;
17392339 group(csg);
1740
- Composite child = new cGroup();
2340
+ Composite child = new cGroup("Branch A");
17412341 csg.addChild(child);
17422342 child.addChild(csg);
1743
- child = new cGroup();
2343
+ child = new cGroup("Branch B");
17442344 csg.addChild(child);
17452345 child.addChild(csg);
17462346 } else
1747
- if (event.getSource() == tripleItem)
2347
+ if (source == tripleItem)
17482348 {
1749
- Composite csg = new GroupLeaf();
2349
+ Composite csg = new GroupLeaf("Trident");
17502350 csg.count = 4;
17512351 group(csg);
17522352 Composite child = new cGroup();
....@@ -1759,73 +2359,98 @@
17592359 csg.addChild(child);
17602360 child.addChild(csg);
17612361 } else
1762
-
1763
- if (event.getSource() == importGFDItem)
2362
+ if (source == computeAOItem)
17642363 {
1765
- ImportGFD();
2364
+ Globals.drawMode = CameraPane.OCCLUSION;
2365
+ cameraView.repaint();
17662366 } else
1767
- if (event.getSource() == importVRMLX3DItem)
1768
- {
1769
- ImportVRMLX3D();
1770
- } else
1771
- if (event.getSource() == import3DSItem)
1772
- {
1773
- objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
1774
- } else
1775
- if (event.getSource() == importOBJItem)
1776
- {
1777
- objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1778
- } else
1779
- if (event.getSource() == computeAOItem)
1780
- {
1781
- CameraPane.drawMode = CameraPane.OCCLUSION;
1782
- CameraPane.theRenderer.repaint();
1783
- } else
1784
- if (event.getSource() == recompileItem)
2367
+ if (source == recompileItem)
17852368 {
17862369 Recompile();
17872370 refreshContents();
17882371 } else
1789
- if (event.getSource() == editScriptItem)
2372
+ if (source == editScriptItem)
17902373 {
17912374 OpenDialog();
17922375 refreshContents();
17932376 } else
1794
- if (event.getSource() == invariantsItem)
2377
+ if (source == invariantsItem)
17952378 {
17962379 System.out.println("Invariants:");
1797
- GrafreeD.grafreeD.universe.invariants();
2380
+ Grafreed.grafreeD.universe.invariants();
17982381 } else
1799
- if (event.getSource() == memoryItem)
2382
+ if (source == memoryItem)
18002383 {
18012384 //System.out.println("Invariants:");
18022385 PrintMemory();
18032386 } else
1804
- if (event.getSource() == pathItem)
2387
+ if (source == pathItem)
18052388 {
18062389 PrintPath();
18072390 } else
1808
- if (event.getSource() == analyzeItem)
2391
+ if (source == analyzeItem)
18092392 {
18102393 AnalyzeObject();
18112394 } else
1812
- if (event.getSource() == dumpItem)
2395
+ if (source == dumpItem)
18132396 {
18142397 DumpObject();
18152398 } else
1816
- if (event.getSource() == screenfitButton)
2399
+ if (source == minButton)
18172400 {
1818
- //Reload(lastConverter, lastFilename, true);
2401
+ Minimize();
2402
+ } else
2403
+ if (source == maxButton)
2404
+ {
2405
+ Maximize();
2406
+ } else
2407
+ if (source == fullButton)
2408
+ {
2409
+ ToggleFullScreen();
2410
+ } else
2411
+ if (source == undoButton)
2412
+ {
2413
+ // Go to previous version
2414
+ //if (!Undo())
2415
+ //java.awt.Toolkit.getDefaultToolkit().beep();
2416
+ Undo();
2417
+ } else
2418
+ if (source == restoreButton)
2419
+ {
2420
+ // Restore current version
2421
+ Restore();
2422
+ } else
2423
+ if (source == replaceButton)
2424
+ {
2425
+ // Overwrite current version
2426
+ Replace();
2427
+ } else
2428
+ if (source == redoButton)
2429
+ {
2430
+ // Go to next version
2431
+ Redo();
2432
+ } else
2433
+ if (source == saveButton)
2434
+ {
2435
+ // Save a new version
2436
+ if (!Save(true))
2437
+ java.awt.Toolkit.getDefaultToolkit().beep();
2438
+ } else
2439
+ if (source == oneStepButton)
2440
+ {
2441
+ Globals.ONESTEP = true;
2442
+ cameraView.repaint();
2443
+ } else
2444
+ if (source == screenfitButton)
2445
+ {
18192446 ScreenFit();
18202447 } else
1821
- if (event.getSource() == screenfitpointButton)
2448
+ if (source == screenfitpointButton)
18222449 {
1823
- //Reload(lastConverter, lastFilename, true);
18242450 ScreenFitPoint();
18252451 } else
1826
- if (event.getSource() == snapobjectButton)
2452
+ if (source == snapobjectButton)
18272453 {
1828
- //Reload(lastConverter, lastFilename, true);
18292454 SnapObject();
18302455 } else
18312456 // if (event.getSource() == recompileButton)
....@@ -1834,13 +2459,13 @@
18342459 // Recompile();
18352460 // refreshContents();
18362461 // } else
1837
- if (event.getSource() == gcButton)
2462
+ if (source == gcButton)
18382463 {
18392464 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18402465 System.gc();
18412466 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18422467 } else
1843
- if (event.getSource() == editLeafItem)
2468
+ if (source == editLeafItem)
18442469 {
18452470 Object3D obj;
18462471 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1854,62 +2479,74 @@
18542479 }
18552480 refreshContents(true);
18562481 } else
1857
- if (event.getSource() == openWindowItem)
2482
+ if (source == openWindowItem)
18582483 {
18592484 EditSelection(true);
18602485 } else
1861
- if (event.getSource() == cutItem || event.getSource() == clearButton)
2486
+ if (source == cutItem || source == clearButton)
18622487 {
18632488 loadClipboard(true);
18642489 } else
1865
- if (event.getSource() == duplicateItem)
2490
+ if (source == undoItem)
18662491 {
1867
- Object3D keep = GrafreeD.clipboard;
2492
+ Undo();
2493
+ } else
2494
+ if (source == redoItem)
2495
+ {
2496
+ Redo();
2497
+ } else
2498
+ if (source == duplicateItem)
2499
+ {
2500
+ Object3D keep = Grafreed.clipboard;
18682501 loadClipboard(false);
18692502 paste(false);
1870
- GrafreeD.clipboard = keep;
2503
+ Grafreed.clipboard = keep;
18712504 } else
1872
- if (event.getSource() == cloneItem)
2505
+ if (source == cloneItem)
18732506 {
18742507 CloneSelection(false);
18752508 } else
1876
- if (event.getSource() == cloneSupportItem)
2509
+ if (source == cloneSupportItem)
18772510 {
18782511 CloneSelection(true);
18792512 } else
1880
- if (event.getSource() == copyItem)
2513
+ if (source == copyItem)
18812514 {
18822515 loadClipboard(false);
18832516 } else
1884
- if (event.getSource() == pasteItem)
2517
+ if (source == pasteItem)
18852518 {
18862519 paste(false);
18872520 } else
1888
- if (event.getSource() == pasteLinkItem)
2521
+ if (source == pasteIntoItem)
18892522 {
1890
- pasteInto(false);
2523
+ pasteInto(true, false);
18912524 } else
1892
- if (event.getSource() == pasteCloneItem)
2525
+ if (source == pasteLinkItem)
18932526 {
1894
- pasteInto(true);
2527
+ pasteInto(false, false);
18952528 } else
1896
- if (event.getSource() == pasteExpandItem)
2529
+ if (source == pasteCloneItem)
2530
+ {
2531
+ pasteInto(true, true);
2532
+ } else
2533
+ if (source == pasteExpandItem)
18972534 {
18982535 paste(true);
18992536 } else
1900
- if (event.getSource() == synchronizeItem)
2537
+ if (source == synchronizeItem)
19012538 {
19022539 Overwrite(Object3D.TRANSFORM);
19032540 } else
1904
- if (event.getSource() == overwriteNameItem)
2541
+ if (source == overwriteNameItem)
19052542 {
19062543 Overwrite(Object3D.NAME);
19072544 } else
1908
- if (event.getSource() == overwriteUVItem)
2545
+ if (source == overwriteUVItem)
19092546 {
19102547 Overwrite(Object3D.UV);
19112548 } else
1912
- if (event.getSource() == overwriteMatItem)
2549
+ if (source == overwriteMatItem)
19132550 {
19142551 /* july 2015
19152552 if ((dropAttributes & Object3D.TEXTURE) == 0)
....@@ -1929,7 +2566,7 @@
19292566
19302567 Overwrite(dropAttributes);
19312568 }
1932
- if (event.getSource() == overwriteGeoItem)
2569
+ if (source == overwriteGeoItem)
19332570 {
19342571 Overwrite(Object3D.GEOMETRY);
19352572 // if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
....@@ -1946,7 +2583,7 @@
19462583 // refreshContents();
19472584 // }
19482585 } else
1949
- if (event.getSource() == generateMeshItem)
2586
+ if (source == generateMeshItem)
19502587 {
19512588 //if (group.selection.size() == 1)
19522589 // for (int i=0; i<group.selection.size(); i++)
....@@ -1957,7 +2594,7 @@
19572594 ResetModel();
19582595 refreshContents();
19592596 } else
1960
- if (event.getSource() == extractGeometriesItem)
2597
+ if (source == extractGeometriesItem)
19612598 {
19622599 boolean one = false;
19632600
....@@ -1984,7 +2621,7 @@
19842621 ResetModel();
19852622 refreshContents();
19862623 } else
1987
- if (event.getSource() == cloneGeometriesItem)
2624
+ if (source == cloneGeometriesItem)
19882625 {
19892626 boolean one = false;
19902627
....@@ -2010,7 +2647,7 @@
20102647 ResetModel();
20112648 refreshContents();
20122649 } else
2013
- if (event.getSource() == shareGeometriesItem)
2650
+ if (source == shareGeometriesItem)
20142651 {
20152652 boolean one = false;
20162653
....@@ -2040,7 +2677,7 @@
20402677 refreshContents();
20412678 }
20422679 } else
2043
- if (event.getSource() == mergeGeometriesItem)
2680
+ if (source == mergeGeometriesItem)
20442681 {
20452682 boolean one = false;
20462683
....@@ -2070,7 +2707,7 @@
20702707 ResetModel();
20712708 refreshContents();
20722709 } else
2073
- if (event.getSource() == linkverticesItem)
2710
+ if (source == linkverticesItem)
20742711 {
20752712 // if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
20762713 // {
....@@ -2083,48 +2720,48 @@
20832720 // group.selection.get(0).setMasterThis(content); // should be identity
20842721 // refreshContents();
20852722 // }
2086
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2723
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
20872724 {
2088
- Object3D content = GrafreeD.clipboard.get(0);
2725
+ Object3D content = Grafreed.clipboard.get(0);
20892726
20902727 if (content instanceof cGroup && ((cGroup)content).transientlink )
20912728 content = ((cGroup)content).get(0);
20922729
2093
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
2730
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
20942731 for (int i=0; i<group.selection.size(); i++)
20952732 {
2096
- boolean random = CameraPane.RANDOM;
2097
- CameraPane.RANDOM = false; // parse all random nodes
2733
+ boolean random = CameraPane.SWITCH;
2734
+ CameraPane.SWITCH = false; // parse all random nodes
20982735 group.selection.get(i).linkVerticesThis(content);
20992736 // group.selection.get(i).setMasterThis(content); // should be identity
2100
- CameraPane.RANDOM = random;
2737
+ CameraPane.SWITCH = random;
21012738 }
2102
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
2739
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
21032740 refreshContents();
21042741 }
21052742 } else
2106
- if (event.getSource() == resetsupportItem)
2743
+ if (source == resetsupportItem)
21072744 {
21082745 for (int i=0; i<group.selection.size(); i++)
21092746 {
2110
- boolean random = CameraPane.RANDOM;
2111
- CameraPane.RANDOM = false; // parse all random nodes
2747
+ boolean random = CameraPane.SWITCH;
2748
+ CameraPane.SWITCH = false; // parse all random nodes
21122749 group.selection.get(i).linkVerticesThis(null);
2113
- CameraPane.RANDOM = random;
2750
+ CameraPane.SWITCH = random;
21142751 }
21152752
21162753 refreshContents();
21172754 } else
2118
- if (event.getSource() == relinkverticesItem)
2755
+ if (source == relinkverticesItem)
21192756 {
2120
- boolean random = CameraPane.RANDOM;
2121
- CameraPane.RANDOM = false; // parse all random nodes
2757
+ boolean random = CameraPane.SWITCH;
2758
+ CameraPane.SWITCH = false; // parse all random nodes
21222759 group.selection.RelinkToSupport();
2123
- CameraPane.RANDOM = random;
2760
+ CameraPane.SWITCH = random;
21242761
21252762 refreshContents();
21262763 } else
2127
- if (event.getSource() == resetreferencesItem)
2764
+ if (source == resetreferencesItem)
21282765 {
21292766 for (int i=0; i<group.selection.size(); i++)
21302767 {
....@@ -2133,11 +2770,11 @@
21332770
21342771 refreshContents();
21352772 } else
2136
- if (event.getSource() == setMasterItem)
2773
+ if (source == setMasterItem)
21372774 {
2138
- if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
2775
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
21392776 {
2140
- Object3D content = GrafreeD.clipboard.get(0);
2777
+ Object3D content = Grafreed.clipboard.get(0);
21412778
21422779 if (content instanceof cGroup && ((cGroup)content).transientlink )
21432780 content = ((cGroup)content).get(0);
....@@ -2146,13 +2783,13 @@
21462783 refreshContents();
21472784 }
21482785 } else
2149
- if (event.getSource() == poseMeshItem)
2786
+ if (source == poseMeshItem)
21502787 {
21512788 if (group.selection.size() == 1)
21522789 {
2153
- if (GrafreeD.clipboard.size() == 1)
2790
+ if (Grafreed.clipboard.size() == 1)
21542791 {
2155
- Object3D content = GrafreeD.clipboard.get(0);
2792
+ Object3D content = Grafreed.clipboard.get(0);
21562793
21572794 if (content instanceof cGroup && ((cGroup)content).transientlink )
21582795 content = ((cGroup)content).get(0);
....@@ -2165,19 +2802,19 @@
21652802 }
21662803
21672804 } else
2168
- if (event.getSource() == revertMeshItem)
2805
+ if (source == revertMeshItem)
21692806 {
21702807 RevertMeshes();
21712808 } else
2172
- if (event.getSource() == resetMeshItem)
2809
+ if (source == resetAllItem)
21732810 {
21742811 ResetAll();
21752812 } else
2176
- if (event.getSource() == stepAllItem)
2813
+ if (source == stepAllItem)
21772814 {
21782815 StepAll();
21792816 } else
2180
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2817
+ if (source == deleteItem) // || event.getSource() == clearButton)
21812818 {
21822819 //int indices[] = jList.getSelectedIndices();
21832820 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2185,46 +2822,46 @@
21852822
21862823 ClearSelection(false);
21872824 } else
2188
- if (event.getSource() == clearAllItem)
2825
+ if (source == clearAllItem)
21892826 {
21902827 ClearSelection(true);
21912828 } else
2192
- if (event.getSource() == grabItem)
2829
+ if (source == grabItem || source == groupButton)
21932830 {
2194
- group(new cGroup(), true);
2831
+ group(new cGroup(), false); // true);
21952832 } else
2196
- if (event.getSource() == hideItem)
2833
+ if (source == hideItem)
21972834 {
21982835 group(new HiddenObject());
21992836 } else
2200
- if (event.getSource() == frontItem)
2837
+ if (source == frontItem)
22012838 {
22022839 front();
22032840 } else
2204
- if (event.getSource() == backItem)
2841
+ if (source == backItem)
22052842 {
22062843 back();
22072844 } else
2208
- if (event.getSource() == cameraItem)
2845
+ if (source == cameraItem)
22092846 {
22102847 makeSomething(new Camera());
22112848 } else
2212
- if (event.getSource() == compositeItem)
2849
+ if (source == compositeItem || source == compositeButton)
22132850 {
22142851 group(new Composite());
22152852 } else
2216
- if (event.getSource() == randomItem)
2853
+ if (source == switchItem || source == switchButton)
22172854 {
22182855 RandomNode random = new RandomNode();
22192856 group(random);
22202857 if (random.size() > 0)
2221
- random.name = random.get(0).name + "Rnd";
2858
+ random.name = random.get(0).name + "Switch";
22222859 } else
2223
- if (event.getSource() == physicsItem)
2860
+ if (source == physicsItem)
22242861 {
22252862 group(new PhysicsNode());
22262863 } else
2227
- if (event.getSource() == frameselectorItem)
2864
+ if (source == frameselectorItem)
22282865 {
22292866 for (int i=0; i<group.selection.size(); i++)
22302867 {
....@@ -2236,7 +2873,7 @@
22362873 ResetModel();
22372874 refreshContents();
22382875 } else
2239
- if (event.getSource() == switchGeoItem)
2876
+ if (source == switchGeoItem)
22402877 {
22412878 for (int i=0; i<group.selection.size(); i++)
22422879 {
....@@ -2248,7 +2885,7 @@
22482885 ResetModel();
22492886 refreshContents();
22502887 } else
2251
- if (event.getSource() == switchTransfoItem)
2888
+ if (source == switchTransfoItem)
22522889 {
22532890 for (int i=0; i<group.selection.size(); i++)
22542891 {
....@@ -2260,7 +2897,7 @@
22602897 ResetModel();
22612898 refreshContents();
22622899 } else
2263
- if (event.getSource() == morphItem)
2900
+ if (source == morphItem)
22642901 {
22652902 for (int i=0; i<group.selection.size(); i++)
22662903 {
....@@ -2272,7 +2909,7 @@
22722909 ResetModel();
22732910 refreshContents();
22742911 } else
2275
- if (event.getSource() == scriptNodeItem)
2912
+ if (source == scriptNodeItem)
22762913 {
22772914 boolean atleastone = false;
22782915
....@@ -2311,215 +2948,252 @@
23112948 }
23122949 }
23132950 } else
2314
- if (event.getSource() == linkerItem)
2951
+ if (source == linkerItem)
23152952 {
23162953 group(new cLinker());
23172954 } else
2318
- if (event.getSource() == textureItem)
2955
+ if (source == textureItem || source == textureButton)
23192956 {
23202957 group(new TextureNode());
23212958 } else
2322
- if (event.getSource() == billboardItem)
2959
+ if (source == billboardItem)
23232960 {
23242961 group(new BillboardNode());
23252962 } else
2326
- if (event.getSource() == shadowXItem)
2963
+ if (source == shadowXItem)
23272964 {
23282965 CastShadow(0);
23292966 } else
2330
- if (event.getSource() == shadowYItem)
2967
+ if (source == shadowYItem)
23312968 {
23322969 CastShadow(1);
23332970 } else
2334
- if (event.getSource() == shadowZItem)
2971
+ if (source == shadowZItem)
23352972 {
23362973 CastShadow(2);
23372974 } else
2338
- if (event.getSource() == ungroupItem)
2975
+ if (source == ungroupItem || source == ungroupButton)
23392976 {
2340
- //ungroup();
2977
+ boolean hasRoot = false;
2978
+
23412979 for (int i=0; i<group.selection.size(); i++)
23422980 {
2343
- Ungroup(group.selection.get(i));
2981
+ if (group.selection.get(i) == group)
2982
+ {
2983
+ hasRoot = true;
2984
+ break;
2985
+ }
23442986 }
23452987
2346
- ClearSelection(false);
2347
-
2348
- refreshContents();
2988
+ if (!hasRoot)
2989
+ {
2990
+ for (int i=0; i<group.selection.size(); i++)
2991
+ {
2992
+ Ungroup(group.selection.get(i));
2993
+ }
2994
+
2995
+ ClearSelection(false);
2996
+
2997
+ refreshContents();
2998
+ }
23492999 } else
2350
- if (event.getSource() == genUVItem)
3000
+ if (source == genUVItem)
23513001 {
23523002 GenUV();
23533003 } else
2354
- if (event.getSource() == genNormalsCADItem)
3004
+ if (source == genNormalsCADItem)
23553005 {
23563006 GenNormals(true);
23573007 } else
2358
- if (event.getSource() == genNormalsMESHItem)
3008
+ if (source == genNormalsMESHItem)
23593009 {
2360
- GenNormals(true); // TODO
3010
+ GenNormalsMESH();
23613011 } else
2362
- if (event.getSource() == genNormalsORGANItem)
3012
+ if (source == genNormalsORGANItem)
23633013 {
23643014 GenNormals(false);
23653015 } else
2366
- if (event.getSource() == genNormalsMINEItem)
3016
+ if (source == genNormalsMINEItem)
23673017 {
23683018 GenNormalsMINE();
23693019 } else
2370
- if (event.getSource() == stripifyItem)
3020
+ if (source == stripifyItem)
23713021 {
23723022 Stripify();
23733023 } else
2374
- if (event.getSource() == unstripifyItem)
3024
+ if (source == unstripifyItem)
23753025 {
23763026 Unstripify();
23773027 } else
2378
- if (event.getSource() == trimItem)
3028
+ if (source == trimItem)
23793029 {
23803030 Trim();
23813031 } else
2382
- if (event.getSource() == untrimItem)
3032
+ if (source == untrimItem)
23833033 {
23843034 Untrim();
23853035 } else
2386
- if (event.getSource() == clearColorsItem)
3036
+ if (source == clearColorsItem)
23873037 {
23883038 ClearColors();
23893039 } else
2390
- if (event.getSource() == clearMaterialsItem)
3040
+ if (source == clearMaterialsItem)
23913041 {
23923042 ClearMaterials();
23933043 } else
2394
- if (event.getSource() == liveleavesItem)
3044
+ if (source == liveleavesItem)
23953045 {
23963046 LiveLeaves(true);
23973047 } else
2398
- if (event.getSource() == unliveleavesItem)
3048
+ if (source == unliveleavesItem)
23993049 {
24003050 LiveLeaves(false);
24013051 } else
2402
- if (event.getSource() == supportleavesItem)
3052
+ if (source == supportleavesItem)
24033053 {
24043054 SupportLeaves(true);
24053055 } else
2406
- if (event.getSource() == unsupportleavesItem)
3056
+ if (source == unsupportleavesItem)
24073057 {
24083058 SupportLeaves(false);
24093059 } else
2410
- if (event.getSource() == hideleavesItem)
3060
+ if (source == hideleavesItem)
24113061 {
24123062 HideLeaves(true);
24133063 } else
2414
- if (event.getSource() == showleavesItem)
3064
+ if (source == showleavesItem)
24153065 {
24163066 HideLeaves(false);
24173067 } else
2418
- if (event.getSource() == markleavesItem)
3068
+ if (source == markleavesItem)
24193069 {
24203070 MarkLeaves(true);
24213071 } else
2422
- if (event.getSource() == unmarkleavesItem)
3072
+ if (source == unmarkleavesItem)
24233073 {
24243074 MarkLeaves(false);
24253075 } else
2426
- if (event.getSource() == flipVItem)
3076
+ if (source == rewindleavesItem)
3077
+ {
3078
+ RewindLeaves(true);
3079
+ } else
3080
+ if (source == unrewindleavesItem)
3081
+ {
3082
+ RewindLeaves(false);
3083
+ } else
3084
+ if (source == randomleavesItem)
3085
+ {
3086
+ RandomLeaves(true);
3087
+ } else
3088
+ if (source == unrandomleavesItem)
3089
+ {
3090
+ RandomLeaves(false);
3091
+ } else
3092
+ if (source == flipVItem)
24273093 {
24283094 FlipV(true);
24293095 } else
2430
- if (event.getSource() == unflipVItem)
3096
+ if (source == unflipVItem)
24313097 {
24323098 FlipV(false);
24333099 } else
2434
- if (event.getSource() == lowTexturesItem)
3100
+ if (source == lowTexturesItem)
24353101 {
24363102 SetTexRes(0);
24373103 } else
2438
- if (event.getSource() == normalTexturesItem)
3104
+ if (source == normalTexturesItem)
24393105 {
24403106 SetTexRes(1);
24413107 } else
2442
- if (event.getSource() == highTexturesItem)
3108
+ if (source == highTexturesItem)
24433109 {
24443110 SetTexRes(2);
24453111 } else
2446
- if (event.getSource() == veryhighTexturesItem)
3112
+ if (source == veryhighTexturesItem)
24473113 {
24483114 SetTexRes(3);
24493115 } else
2450
- if (event.getSource() == maxTexturesItem)
3116
+ if (source == maxTexturesItem)
24513117 {
24523118 SetTexRes(4);
24533119 } else
2454
- if (event.getSource() == panoTexturesItem)
3120
+ if (source == panoTexturesItem)
24553121 {
24563122 SetTexRes(5);
24573123 } else
2458
- if (event.getSource() == reverseNormalsItem)
3124
+ if (source == reverseNormalsItem)
24593125 {
24603126 ReverseNormals();
24613127 } else
2462
- if (event.getSource() == parseverticesItem)
3128
+ if (source == parseverticesItem)
24633129 {
24643130 ParseVertices();
24653131 } else
2466
- if (event.getSource() == textureFieldItem)
3132
+ if (source == textureFieldItem)
24673133 {
24683134 TextureVertices();
24693135 } else
2470
- if (event.getSource() == alignItem)
3136
+ if (source == alignItem)
24713137 {
24723138 Align();
24733139 } else
2474
- if (event.getSource() == mirrorItem)
3140
+ if (source == mirrorItem)
24753141 {
24763142 MirrorPoses();
24773143 } else
2478
- if (event.getSource() == reduceMorphItem)
3144
+ if (source == reduceMorphItem)
24793145 {
24803146 MeshReduction(false);
24813147 } else
2482
- if (event.getSource() == reduce34MorphItem)
3148
+ if (source == reduce34MorphItem)
24833149 {
24843150 MeshReduction(true);
24853151 } else
2486
- if (event.getSource() == reverseTrianglesItem)
3152
+ if (source == reverseTrianglesItem)
24873153 {
24883154 ReverseTriangles();
24893155 } else
2490
- if (event.getSource() == reduceMeshItem)
3156
+ if (source == reduceMeshItem)
24913157 {
24923158 ReduceMesh(false);
24933159 } else
2494
- if (event.getSource() == reduce34MeshItem)
3160
+ if (source == reduce34MeshItem)
24953161 {
24963162 ReduceMesh(true);
24973163 } else
2498
- if (event.getSource() == increaseMeshItem)
3164
+ if (source == increaseMeshItem)
24993165 {
25003166 IncreaseMesh();
25013167 } else
2502
- if (event.getSource() == clipMeshItem)
3168
+ if (source == clipMeshItem)
25033169 {
25043170 ClipMesh();
25053171 } else
2506
- if (event.getSource() == smoothMeshItem)
3172
+ if (source == smoothMeshItem)
25073173 {
25083174 SmoothMesh();
25093175 } else
2510
- if (event.getSource() == transformgeometryItem)
3176
+ if (source == transformGeometryItem)
25113177 {
25123178 TransformGeometry();
25133179 } else
2514
- if (event.getSource() == resetTransformItem)
3180
+ if (source == transformChildrenItem)
3181
+ {
3182
+ TransformChildren();
3183
+ } else
3184
+ if (source == resetTransformItem)
25153185 {
25163186 ResetTransform();
25173187 } else
2518
- if (event.getSource() == resetCentroidItem)
3188
+ if (source == resetCentroidItem)
25193189 {
2520
- ResetCentroid();
3190
+ ResetCentroid(true);
25213191 } else
2522
- if (event.getSource() == resetParentItem)
3192
+ if (source == resetCentroidXZItem)
3193
+ {
3194
+ ResetCentroid(false);
3195
+ } else
3196
+ if (source == resetParentItem)
25233197 {
25243198 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25253199 {
....@@ -2529,7 +3203,7 @@
25293203
25303204 refreshContents();
25313205 } else
2532
- if (event.getSource() == repairParentItem)
3206
+ if (source == repairParentItem)
25333207 {
25343208 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25353209 {
....@@ -2543,7 +3217,21 @@
25433217
25443218 refreshContents();
25453219 } else
2546
- if (event.getSource() == sortbysizeItem)
3220
+ if (source == repairShadowItem)
3221
+ {
3222
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3223
+ {
3224
+ Object3D obj = (Object3D)e.nextElement();
3225
+ obj.RepairShadow();
3226
+// for (int i=0; i<obj.size(); i++)
3227
+// {
3228
+// obj.get(i).parent = obj;
3229
+// }
3230
+ }
3231
+
3232
+ refreshContents();
3233
+ } else
3234
+ if (source == sortbysizeItem)
25473235 {
25483236 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25493237 {
....@@ -2555,7 +3243,7 @@
25553243 ResetModel();
25563244 refreshContents();
25573245 } else
2558
- if (event.getSource() == sortbynameItem)
3246
+ if (source == sortbynameItem)
25593247 {
25603248 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25613249 {
....@@ -2567,7 +3255,7 @@
25673255 ResetModel();
25683256 refreshContents();
25693257 } else
2570
- if (event.getSource() == attachPigmentItem)
3258
+ if (source == attachPigmentItem)
25713259 {
25723260 String texture = GetFile("Attach pigment");
25733261 Object3D obj;
....@@ -2579,7 +3267,7 @@
25793267
25803268 refreshContents();
25813269 } else
2582
- if (event.getSource() == detachPigmentItem)
3270
+ if (source == detachPigmentItem)
25833271 {
25843272 Object3D obj;
25853273 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2590,7 +3278,7 @@
25903278
25913279 refreshContents();
25923280 } else
2593
- if (event.getSource() == attachBumpItem)
3281
+ if (source == attachBumpItem)
25943282 {
25953283 String texture = GetFile("Attach bump");
25963284 Object3D obj;
....@@ -2602,18 +3290,18 @@
26023290
26033291 refreshContents();
26043292 } else
2605
- if (event.getSource() == detachBumpItem)
3293
+ if (source == detachBumpItem)
26063294 {
26073295 Object3D obj;
26083296 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
26093297 {
26103298 obj = (Object3D)e.nextElement();
2611
- obj.SetBumpTexture(null);
3299
+ obj.ResetBumpTexture();
26123300 }
26133301
26143302 refreshContents();
26153303 } else
2616
- if (event.getSource() == pigmentBumpItem)
3304
+ if (source == pigmentBumpItem)
26173305 {
26183306 Object3D obj;
26193307 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2624,158 +3312,262 @@
26243312
26253313 refreshContents();
26263314 } else
2627
- if (event.getSource() == flashSelectionButton)
3315
+ if (source == embedTexturesItem)
3316
+ {
3317
+ Object3D obj;
3318
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3319
+ {
3320
+ obj = (Object3D)e.nextElement();
3321
+ obj.EmbedTextures(true);
3322
+ }
3323
+
3324
+ refreshContents();
3325
+ } else
3326
+ if (source == deEmbedTexturesItem)
3327
+ {
3328
+ Object3D obj;
3329
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3330
+ {
3331
+ obj = (Object3D)e.nextElement();
3332
+ obj.EmbedTextures(false);
3333
+ }
3334
+
3335
+ CameraPane.texturepigment.clear();
3336
+ CameraPane.texturebump.clear();
3337
+
3338
+ refreshContents();
3339
+ } else
3340
+ if (source == flashSelectionButton)
26283341 {
26293342 CameraPane.flash = true;
26303343 refreshContents();
26313344 } else
2632
- if (event.getSource() == oneButton)
3345
+ if (source == oneButton)
26333346 {
26343347 } else
2635
- if (event.getSource() == twoButton)
3348
+ if (source == twoButton)
26363349 {
26373350 radio.layout = twoButton;
3351
+
3352
+ if (CameraPane.FULLSCREEN)
3353
+ fullscreenLayout = radio.layout;
3354
+
26383355 // bug
26393356 //gridPanel.setDividerLocation(1.0);
26403357 //bigPanel.setDividerLocation(0.0);
2641
- bigThree.remove(scenePanel);
2642
- bigThree.remove(cameraPanel);
2643
- bigThree.remove(XYZPanel);
2644
- aWindowConstraints.gridx = 0;
2645
- aWindowConstraints.gridy = 0;
2646
- aWindowConstraints.gridwidth = 1;
2647
- // aConstraints.gridheight = 3;
2648
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2649
- aWindowConstraints.weightx = 0;
2650
- aWindowConstraints.weighty = 1;
2651
- //bigThree.add(jtp, aWindowConstraints);
2652
- aWindowConstraints.weightx = 1;
2653
- aWindowConstraints.gridwidth = 3;
2654
- // aConstraints.gridheight = 3;
2655
- aWindowConstraints.gridx = 1;
2656
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2657
- bigThree.add(cameraPanel, aWindowConstraints);
2658
- aWindowConstraints.weightx = 0;
2659
- aWindowConstraints.gridx = 4;
2660
- aWindowConstraints.gridwidth = 1;
2661
- // aConstraints.gridheight = 3;
2662
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2663
- //bigThree.add(XYZPanel, aWindowConstraints);
2664
- bigThree.revalidate();
3358
+// bigThree.remove(scenePanel);
3359
+// bigThree.remove(centralPanel);
3360
+// bigThree.remove(XYZPanel);
3361
+// aWindowConstraints.gridx = 0;
3362
+// aWindowConstraints.gridy = 0;
3363
+// aWindowConstraints.gridwidth = 1;
3364
+// // aConstraints.gridheight = 3;
3365
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3366
+// aWindowConstraints.weightx = 0;
3367
+// aWindowConstraints.weighty = 1;
3368
+// //bigThree.add(jtp, aWindowConstraints);
3369
+// aWindowConstraints.weightx = 1;
3370
+// aWindowConstraints.gridwidth = 3;
3371
+// // aConstraints.gridheight = 3;
3372
+// aWindowConstraints.gridx = 1;
3373
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3374
+// bigThree.add(centralPanel, aWindowConstraints);
3375
+// aWindowConstraints.weightx = 0;
3376
+// aWindowConstraints.gridx = 4;
3377
+// aWindowConstraints.gridwidth = 1;
3378
+// // aConstraints.gridheight = 3;
3379
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3380
+// //bigThree.add(XYZPanel, aWindowConstraints);
3381
+// scenePanel.setVisible(false);
3382
+// centralPanel.setVisible(true);
3383
+// XYZPanel.setVisible(false);
3384
+ bigThree.ClearUI();
3385
+ bigThree.add(centralPanel);
3386
+ bigThree.FlushUI();
3387
+
3388
+ cameraView.requestFocusInWindow();
3389
+
3390
+// refreshContents(true);
3391
+//
3392
+// try
3393
+// {
3394
+// java.awt.Robot bot = new java.awt.Robot();
3395
+// int mask = InputEvent.BUTTON1_MASK;
3396
+// bot.mouseMove(100, 100);
3397
+// bot.mousePress(mask);
3398
+// bot.mouseRelease(mask);
3399
+// }
3400
+// catch (Exception e)
3401
+// {
3402
+//
3403
+// }
3404
+
26653405 } else
2666
- if (event.getSource() == threeButton)
3406
+ if (source == threeButton)
26673407 {
26683408 radio.layout = threeButton;
2669
- bigThree.remove(scenePanel);
2670
- bigThree.remove(cameraPanel);
2671
- bigThree.remove(XYZPanel);
2672
- aWindowConstraints.gridx = 0;
2673
- aWindowConstraints.gridy = 0;
2674
- aWindowConstraints.gridwidth = 1;
2675
- // aConstraints.gridheight = 3;
2676
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2677
- aWindowConstraints.weightx = 0;
2678
- aWindowConstraints.weighty = 1;
2679
- //bigThree.add(jtp, aWindowConstraints);
2680
- aWindowConstraints.weightx = 1;
2681
- aWindowConstraints.gridwidth = 3;
2682
- // aConstraints.gridheight = 3;
2683
- aWindowConstraints.gridx = 1;
2684
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2685
- bigThree.add(cameraPanel, aWindowConstraints);
2686
- aWindowConstraints.weightx = 0;
2687
- aWindowConstraints.gridx = 4;
2688
- aWindowConstraints.gridwidth = 1;
2689
- // aConstraints.gridheight = 3;
2690
- aConstraints.fill = GridBagConstraints.VERTICAL;
2691
- bigThree.add(XYZPanel, aWindowConstraints);
2692
- bigThree.revalidate();
3409
+
3410
+ if (CameraPane.FULLSCREEN)
3411
+ fullscreenLayout = radio.layout;
3412
+
3413
+// bigThree.remove(scenePanel);
3414
+// bigThree.remove(centralPanel);
3415
+// bigThree.remove(XYZPanel);
3416
+// aWindowConstraints.gridx = 0;
3417
+// aWindowConstraints.gridy = 0;
3418
+// aWindowConstraints.gridwidth = 1;
3419
+// // aConstraints.gridheight = 3;
3420
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3421
+// aWindowConstraints.weightx = 0;
3422
+// aWindowConstraints.weighty = 1;
3423
+// //bigThree.add(jtp, aWindowConstraints);
3424
+// aWindowConstraints.weightx = 1;
3425
+// aWindowConstraints.gridwidth = 3;
3426
+// // aConstraints.gridheight = 3;
3427
+// aWindowConstraints.gridx = 1;
3428
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3429
+// bigThree.add(centralPanel, aWindowConstraints);
3430
+// aWindowConstraints.weightx = 0;
3431
+// aWindowConstraints.gridx = 4;
3432
+// aWindowConstraints.gridwidth = 1;
3433
+// // aConstraints.gridheight = 3;
3434
+// aConstraints.fill = GridBagConstraints.VERTICAL;
3435
+// bigThree.add(XYZPanel, aWindowConstraints);
3436
+// bigThree.validate();
3437
+// scenePanel.setVisible(false);
3438
+// centralPanel.setVisible(true);
3439
+// XYZPanel.setVisible(true);
3440
+ bigThree.ClearUI();
3441
+ bigThree.add(scenePanel);
3442
+ bigThree.add(centralPanel);
3443
+ bigThree.FlushUI();
3444
+
3445
+ cameraView.requestFocusInWindow();
26933446 } else
2694
- if (event.getSource() == fourButton)
3447
+ if (source == fourButton)
26953448 {
26963449 radio.layout = fourButton;
2697
- bigThree.remove(scenePanel);
2698
- bigThree.remove(cameraPanel);
2699
- bigThree.remove(XYZPanel);
2700
- aWindowConstraints.gridx = 0;
2701
- aWindowConstraints.gridy = 0;
2702
- aWindowConstraints.gridwidth = 1;
2703
- // aWindowConstraints.gridheight = 3;
2704
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2705
- aWindowConstraints.weightx = 1;
2706
- aWindowConstraints.weighty = 1;
2707
- bigThree.add(scenePanel, aWindowConstraints);
2708
- aWindowConstraints.weightx = 1;
2709
- aWindowConstraints.gridwidth = 3;
2710
- // aConstraints.gridheight = 3;
2711
- aWindowConstraints.gridx = 1;
2712
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2713
- //bigThree.add(cameraPanel, aWindowConstraints);
2714
- aWindowConstraints.weightx = 0;
2715
- aWindowConstraints.gridx = 4;
2716
- aWindowConstraints.gridwidth = 1;
2717
- // aWindowConstraints.gridheight = 3;
2718
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2719
- //bigThree.add(XYZPanel, aWindowConstraints);
2720
- bigThree.revalidate();
3450
+
3451
+ if (CameraPane.FULLSCREEN)
3452
+ fullscreenLayout = radio.layout;
3453
+
3454
+// bigThree.remove(scenePanel);
3455
+// bigThree.remove(centralPanel);
3456
+// bigThree.remove(XYZPanel);
3457
+// aWindowConstraints.gridx = 0;
3458
+// aWindowConstraints.gridy = 0;
3459
+// aWindowConstraints.gridwidth = 1;
3460
+// // aWindowConstraints.gridheight = 3;
3461
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3462
+// aWindowConstraints.weightx = 1;
3463
+// aWindowConstraints.weighty = 1;
3464
+// bigThree.add(scenePanel, aWindowConstraints);
3465
+// aWindowConstraints.weightx = 1;
3466
+// aWindowConstraints.gridwidth = 3;
3467
+// // aConstraints.gridheight = 3;
3468
+// aWindowConstraints.gridx = 1;
3469
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3470
+// //bigThree.add(cameraPanel, aWindowConstraints);
3471
+// aWindowConstraints.weightx = 0;
3472
+// aWindowConstraints.gridx = 4;
3473
+// aWindowConstraints.gridwidth = 1;
3474
+// // aWindowConstraints.gridheight = 3;
3475
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3476
+// //bigThree.add(XYZPanel, aWindowConstraints);
3477
+// bigThree.validate();
3478
+// scenePanel.setVisible(true);
3479
+// centralPanel.setVisible(false);
3480
+// XYZPanel.setVisible(false);
3481
+ bigThree.ClearUI();
3482
+ bigThree.add(scenePanel);
3483
+ bigThree.FlushUI();
3484
+
3485
+ cameraView.requestFocusInWindow();
27213486 } else
2722
- if (event.getSource() == sixButton)
3487
+ if (source == sixButton)
27233488 {
27243489 radio.layout = sixButton;
2725
- bigThree.remove(scenePanel);
2726
- bigThree.remove(cameraPanel);
2727
- bigThree.remove(XYZPanel);
2728
- aWindowConstraints.gridx = 0;
2729
- aWindowConstraints.gridy = 0;
2730
- aWindowConstraints.gridwidth = 1;
2731
- // aConstraints.gridheight = 3;
2732
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2733
- aWindowConstraints.weightx = 0;
2734
- aWindowConstraints.weighty = 1;
2735
- bigThree.add(scenePanel, aWindowConstraints);
2736
- aWindowConstraints.weightx = 1;
2737
- aWindowConstraints.gridwidth = 3;
2738
- // aWindowConstraints.gridheight = 3;
2739
- aWindowConstraints.gridx = 1;
2740
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2741
- bigThree.add(cameraPanel, aWindowConstraints);
2742
- aWindowConstraints.weightx = 0;
2743
- aWindowConstraints.gridx = 4;
2744
- aWindowConstraints.gridwidth = 1;
2745
- // aWindowConstraints.gridheight = 3;
2746
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2747
- //bigThree.add(XYZPanel, aConstraints);
2748
- bigThree.revalidate();
3490
+
3491
+ if (CameraPane.FULLSCREEN)
3492
+ fullscreenLayout = radio.layout;
3493
+
3494
+// bigThree.remove(scenePanel);
3495
+// bigThree.remove(centralPanel);
3496
+// bigThree.remove(XYZPanel);
3497
+// aWindowConstraints.gridx = 0;
3498
+// aWindowConstraints.gridy = 0;
3499
+// aWindowConstraints.gridwidth = 1;
3500
+// // aConstraints.gridheight = 3;
3501
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3502
+// aWindowConstraints.weightx = 0;
3503
+// aWindowConstraints.weighty = 1;
3504
+// bigThree.add(scenePanel, aWindowConstraints);
3505
+// aWindowConstraints.weightx = 1;
3506
+// aWindowConstraints.gridwidth = 3;
3507
+// // aWindowConstraints.gridheight = 3;
3508
+// aWindowConstraints.gridx = 1;
3509
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3510
+// bigThree.add(centralPanel, aWindowConstraints);
3511
+// aWindowConstraints.weightx = 0;
3512
+// aWindowConstraints.gridx = 4;
3513
+// aWindowConstraints.gridwidth = 1;
3514
+// // aWindowConstraints.gridheight = 3;
3515
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3516
+// //bigThree.add(XYZPanel, aConstraints);
3517
+// bigThree.validate();
3518
+// scenePanel.setVisible(true);
3519
+// centralPanel.setVisible(true);
3520
+// XYZPanel.setVisible(false);
3521
+ bigThree.ClearUI();
3522
+ bigThree.add(centralPanel);
3523
+ bigThree.add(scenePanel);
3524
+ bigThree.FlushUI();
3525
+
3526
+ cameraView.requestFocusInWindow();
27493527 } else
2750
- if (event.getSource() == sevenButton)
3528
+ if (source == sevenButton)
27513529 {
27523530 radio.layout = sevenButton;
2753
- bigThree.remove(scenePanel);
2754
- bigThree.remove(cameraPanel);
2755
- bigThree.remove(XYZPanel);
2756
- aWindowConstraints.gridx = 0;
2757
- aWindowConstraints.gridy = 0;
2758
- aWindowConstraints.gridwidth = 1;
2759
- // aWindowConstraints.gridheight = 3;
2760
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2761
- aWindowConstraints.weightx = 0;
2762
- aWindowConstraints.weighty = 1;
2763
- bigThree.add(scenePanel, aWindowConstraints);
2764
- aWindowConstraints.weightx = 1;
2765
- aWindowConstraints.gridwidth = 3;
2766
- // aWindowConstraints.gridheight = 3;
2767
- aWindowConstraints.gridx = 1;
2768
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2769
- bigThree.add(cameraPanel, aWindowConstraints);
2770
- aWindowConstraints.weightx = 0;
2771
- aWindowConstraints.gridx = 4;
2772
- aWindowConstraints.gridwidth = 1;
2773
- // aConstraints.gridheight = 3;
2774
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2775
- bigThree.add(XYZPanel, aWindowConstraints);
2776
- bigThree.revalidate();
3531
+
3532
+ if (CameraPane.FULLSCREEN)
3533
+ fullscreenLayout = radio.layout;
3534
+
3535
+// bigThree.remove(scenePanel);
3536
+// bigThree.remove(centralPanel);
3537
+// bigThree.remove(XYZPanel);
3538
+// aWindowConstraints.gridx = 0;
3539
+// aWindowConstraints.gridy = 0;
3540
+// aWindowConstraints.gridwidth = 1;
3541
+// // aWindowConstraints.gridheight = 3;
3542
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3543
+// aWindowConstraints.weightx = 0;
3544
+// aWindowConstraints.weighty = 1;
3545
+// bigThree.add(scenePanel, aWindowConstraints);
3546
+// aWindowConstraints.weightx = 1;
3547
+// aWindowConstraints.gridwidth = 3;
3548
+// // aWindowConstraints.gridheight = 3;
3549
+// aWindowConstraints.gridx = 1;
3550
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3551
+// bigThree.add(centralPanel, aWindowConstraints);
3552
+// aWindowConstraints.weightx = 0;
3553
+// aWindowConstraints.gridx = 4;
3554
+// aWindowConstraints.gridwidth = 1;
3555
+// // aConstraints.gridheight = 3;
3556
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3557
+// bigThree.add(XYZPanel, aWindowConstraints);
3558
+// bigThree.validate();
3559
+// scenePanel.setVisible(true);
3560
+// centralPanel.setVisible(true);
3561
+// XYZPanel.setVisible(true);
3562
+ bigThree.ClearUI();
3563
+ bigThree.add(scenePanel);
3564
+ bigThree.add(centralPanel);
3565
+ bigThree.add(XYZPanel);
3566
+ bigThree.FlushUI();
3567
+
3568
+ cameraView.requestFocusInWindow();
27773569 } else
2778
- if (event.getSource() == rootButton)
3570
+ if (source == rootButton)
27793571 {
27803572 Object3D obj;
27813573 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2785,66 +3577,84 @@
27853577 EditObject(obj);
27863578 }
27873579
3580
+ cameraView.requestFocusInWindow();
27883581 refreshContents(true);
27893582 } else
2790
- if (event.getSource() == closeButton)
3583
+ if (source == closeButton)
27913584 {
27923585 //System.out.println("CLOSE: " + buttonGroup.getSelection());
27933586 cRadio ab;
27943587 for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
27953588 {
27963589 ab = (cRadio)e.nextElement();
2797
- if(ab.getModel().isSelected() && ab.GetObject() != client)
3590
+ if (ab.getModel().isSelected() && ab.GetObject() != client)
27983591 {
3592
+ // Patch to avoid bug with transparency.
3593
+ if (!ab.hadMaterial)
3594
+ {
3595
+ ab.object.material = null;
3596
+ }
3597
+
27993598 buttonGroup.remove(ab);
28003599 radioPanel.remove(ab);
28013600
2802
- ab.GetObject().editWindow = null;
3601
+ //ab.GetObject().editWindow = null;
3602
+ ab.GetObject().manipWindow = null;
28033603 // ab.GetObject().objectUI = null; // ?????????
28043604
28053605 ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick();
28063606 break;
28073607 }
28083608 }
3609
+
3610
+ cameraView.requestFocusInWindow();
28093611 refreshContents(true);
28103612 } else
2811
- if (event.getSource() == editItem || event.getSource() == editButton)
3613
+ if (source == editItem || source == editButton)
28123614 {
3615
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3616
+ {
3617
+ Object3D child = (Object3D)e.nextElement();
3618
+ child.pinned = true;
3619
+ }
3620
+
28133621 EditSelection(false);
28143622 } else
2815
- if (event.getSource() == uneditButton)
3623
+ if (source == uneditButton)
28163624 {
28173625 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
28183626 {
28193627 Object3D child = (Object3D)e.nextElement();
28203628 if(child.editWindow != null)
28213629 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3630
+ child.pinned = false;
28223631 child.CloseUI();
28233632 listUI.remove(child);
28243633
2825
- child.editWindow = null; // ???????????
3634
+ //child.editWindow = null; // ???????????
28263635 }
2827
- objEditor.ctrlPanel.revalidate();
3636
+ objEditor.ctrlPanel.FlushUI();
28283637 //objEditor.jTree.clearSelection();
28293638 //objEditor.ResetSliders();
28303639 refreshContents(true);
28313640 } else
2832
- if (event.getSource() == clearPanelButton)
3641
+ if (source == clearPanelButton)
28333642 {
28343643 assert(copy == group);
28353644 //copy.ClearUI();
28363645 for (Object3D obj : listUI)
28373646 {
3647
+ obj.pinned = false;
28383648 obj.CloseUI();
28393649 }
28403650 listUI.clear();
28413651 refreshContents(true);
28423652 } else
2843
- if (event.getSource() == allParamsButton)
3653
+ if (source == allParamsButton)
28443654 {
28453655 assert(copy == group);
28463656
2847
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3657
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
28483658
28493659 for (Object3D obj : listUI)
28503660 {
....@@ -2861,19 +3671,19 @@
28613671
28623672 refreshContents(true);
28633673 } else
2864
- if (event.getSource() == unselectButton)
3674
+ if (source == unselectButton)
28653675 {
28663676 objEditor.jTree.clearSelection();
28673677 // ?? oct 2012 GrafreeD.clipboard.clear();
28683678 objEditor.ResetSliders();
28693679 refreshContents(true);
28703680 } else
2871
- if(event.getSource() instanceof cRadio)
3681
+ if(source instanceof cRadio)
28723682 {
28733683 group.parent = keepparent;
28743684 group.attributes = 0;
28753685 //group.editWindow = null;
2876
- /*cRadio*/ radio = (cRadio)event.getSource();
3686
+ /*cRadio*/ radio = (cRadio)source;
28773687 Object3D obj = radio.GetObject();
28783688 System.out.println("Edit " + obj);
28793689 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -2893,7 +3703,10 @@
28933703 }
28943704
28953705 copy = group;
2896
- //CameraPane.theRenderer.object = group;
3706
+
3707
+ SetUndoStates();
3708
+
3709
+ //Globals.theRenderer.object = group;
28973710 if(!useclient)
28983711 {
28993712 cameraView.renderCamera = radio.camera;
....@@ -2902,25 +3715,52 @@
29023715 cameraView.cameras[cameraView.cameracount] = radio.camera;
29033716 cameraView.targetLookAt.set(radio.camera.lookAt);
29043717 cameraView.object = group;
2905
- cameraView.lighttouched = true;
3718
+ //cameraView.lighttouched = true;
3719
+ Globals.lighttouched = true;
29063720 topView.object = group;
29073721 frontView.object = group;
29083722 sideView.object = group;
29093723 }
2910
- group.editWindow = this;
3724
+
3725
+// fix "+" issue
3726
+ //group.editWindow = this;
3727
+ group.manipWindow = this;
3728
+
29113729 /*
29123730 currentLayout = radio.layout;
29133731 if (currentLayout == null)
29143732 currentLayout = sevenButton;
29153733 */
29163734 radio.layout.doClick();
3735
+
3736
+ ClearUnpinned();
3737
+ //Grafreed.Assert(group != null);
3738
+ //Grafreed.Assert(group.selection != null);
3739
+ SetPinStates(group.selection == null || group.selection.size() > 0);
3740
+ if (group.selection == null || group.selection.size() == 1)
3741
+ EditSelection(false);
29173742 keepparent = group.parent;
29183743 // PARENT = NULL or not???
29193744 //group.parent = null; // ROOT
29203745 //group.attributes = -1;
29213746 ResetModel();
3747
+
3748
+ cameraView.requestFocusInWindow();
29223749 refreshContents(true);
2923
- }
3750
+ } else if (event.getSource() == editCameraItem)
3751
+ {
3752
+ cameraView.ProtectCamera();
3753
+ cameraView.repaint();
3754
+ return;
3755
+ } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton)
3756
+ {
3757
+ cameraView.RevertCamera();
3758
+ cameraView.repaint();
3759
+ return;
3760
+ // } else if (event.getSource() == textureButton)
3761
+ // {
3762
+ // return; // true;
3763
+ }
29243764 else
29253765 {
29263766 //return super.action(event, arg);
....@@ -2929,7 +3769,6 @@
29293769 }
29303770
29313771 boolean useclient = false;
2932
- cRadio radio;
29333772
29343773 void ToggleRoot()
29353774 {
....@@ -2938,7 +3777,7 @@
29383777 if (useclient)
29393778 {
29403779 cameraView.object = client;
2941
- cameraView.lighttouched = true;
3780
+ Globals.lighttouched = true;
29423781 //topView.object = client;
29433782 //frontView.object = client;
29443783 //sideView.object = client;
....@@ -2946,7 +3785,7 @@
29463785 else
29473786 {
29483787 cameraView.object = group;
2949
- cameraView.lighttouched = true;
3788
+ Globals.lighttouched = true;
29503789 //topView.object = group;
29513790 //frontView.object = group;
29523791 //sideView.object = group;
....@@ -2981,6 +3820,28 @@
29813820 refreshContents();
29823821 }
29833822
3823
+ void TransformChildren()
3824
+ {
3825
+ Object3D obj;
3826
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3827
+ {
3828
+ obj = (Object3D)e.nextElement();
3829
+ obj.KeepTextureMatrices();
3830
+ obj.TransformChildren();
3831
+ obj.RestoreTextureMatrices();
3832
+
3833
+// if (obj.parent == null)
3834
+// {
3835
+// System.out.println("NULL PARENT!");
3836
+// new Exception().printStackTrace();
3837
+// }
3838
+// else
3839
+// TouchTransform(obj);
3840
+// //obj.parent.Touch();
3841
+ }
3842
+
3843
+ refreshContents();
3844
+ }
29843845
29853846 void ResetTransform()
29863847 {
....@@ -3093,7 +3954,7 @@
30933954 refreshContents();
30943955 }
30953956
3096
- void ResetCentroid()
3957
+ void ResetCentroid(boolean full)
30973958 {
30983959 Object3D obj;
30993960 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3108,12 +3969,16 @@
31083969 LA.matIdentity(Object3D.mat);
31093970 obj.getBounds(minima, maxima, false);
31103971 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3111
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3972
+ if (full)
3973
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
31123974 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
31133975 obj.TransformMesh(Object3D.mat);
3976
+
31143977 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3115
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3978
+ if (full)
3979
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
31163980 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3981
+
31173982 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
31183983 //Object3D.mat[3][0] = -Object3D.mat[3][0];
31193984 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3142,7 +4007,8 @@
31424007
31434008 int size = obj.MemorySize();
31444009
3145
- System.err.println((size/1024) + " KB is the size of " + obj);
4010
+ //System.err.println((size/1024) + " KB is the size of " + obj);
4011
+ System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)");
31464012 }
31474013 }
31484014 catch (Exception e)
....@@ -3179,9 +4045,9 @@
31794045 obj = (Object3D)e.nextElement();
31804046
31814047 System.out.println("Object is: " + obj);
3182
- GrafreeD.AnalyzeObject(obj);
4048
+ Grafreed.AnalyzeObject(obj);
31834049 System.out.println("Boundary rep: " + obj.bRep);
3184
- GrafreeD.AnalyzeObject(obj.bRep);
4050
+ Grafreed.AnalyzeObject(obj.bRep);
31854051
31864052 // System.err.println((size/1024) + " KB is the size of " + obj);
31874053 }
....@@ -3223,6 +4089,13 @@
32234089 void GenNormals(boolean crease)
32244090 {
32254091 group.GenNormalsS(crease);
4092
+
4093
+ refreshContents();
4094
+ }
4095
+
4096
+ void GenNormalsMESH()
4097
+ {
4098
+ group.GenNormalsMeshS();
32264099
32274100 refreshContents();
32284101 }
....@@ -3395,8 +4268,8 @@
33954268
33964269 void ParseVertices()
33974270 {
3398
- boolean epsequal = GrafreeD.epsequal;
3399
- GrafreeD.epsequal = true;
4271
+ boolean epsequal = Grafreed.epsequal;
4272
+ Grafreed.epsequal = true;
34004273
34014274 for (int i=0; i<group.selection.size(); i++)
34024275 {
....@@ -3421,7 +4294,7 @@
34214294 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
34224295 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
34234296
3424
- g.add(GrafreeD.clipboard);
4297
+ g.add(Grafreed.clipboard);
34254298
34264299 buffer.add(g);
34274300 }
....@@ -3436,7 +4309,7 @@
34364309 makeSomething(buffer, i==group.selection.size()-1);
34374310 }
34384311
3439
- GrafreeD.epsequal = epsequal;
4312
+ Grafreed.epsequal = epsequal;
34404313
34414314 refreshContents();
34424315 }
....@@ -3454,7 +4327,16 @@
34544327 String pigment = Object3D.GetPigment(tex);
34554328 //String bump = Object3D.GetBump(tex);
34564329
3457
- com.sun.opengl.util.texture.TextureData texturedata = CameraPane.theRenderer.GetTextureData(pigment, false, node.texres);
4330
+ com.sun.opengl.util.texture.TextureData texturedata = null;
4331
+
4332
+ try
4333
+ {
4334
+ texturedata = Globals.theRenderer.GetTextureData(tex, false, node.texres);
4335
+ }
4336
+ catch (Exception e)
4337
+ {
4338
+ System.err.println("FAIL: " + node);
4339
+ }
34584340
34594341 double s = v.s;
34604342
....@@ -3542,11 +4424,11 @@
35424424
35434425 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
35444426
3545
- boolean random = CameraPane.RANDOM;
3546
- CameraPane.RANDOM = false; // parse all random nodes
4427
+ boolean random = CameraPane.SWITCH;
4428
+ CameraPane.SWITCH = false; // parse all random nodes
35474429 lowres.linkVerticesThis(null);
35484430 lowres.linkVerticesThis(sn);
3549
- CameraPane.RANDOM = random;
4431
+ CameraPane.SWITCH = random;
35504432
35514433 System.err.flush();
35524434
....@@ -3586,7 +4468,7 @@
35864468 return;
35874469
35884470 Object3D poses = group.selection.get(0);
3589
- Object3D ref = GrafreeD.clipboard.get(0);
4471
+ Object3D ref = Grafreed.clipboard.get(0);
35904472
35914473 Object3D newgroup = new Object3D("Po:" + poses.name);
35924474
....@@ -3755,7 +4637,7 @@
37554637 group.selection.RelinkToSupport(); // july 2014
37564638 System.out.println("DONE.");
37574639 refreshContents();
3758
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
4640
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
37594641 }
37604642
37614643 void ReduceMesh(boolean reduction34)
....@@ -3780,9 +4662,9 @@
37804662
37814663 void ClipMesh()
37824664 {
3783
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
4665
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
37844666 {
3785
- Object3D content = GrafreeD.clipboard.get(0);
4667
+ Object3D content = Grafreed.clipboard.get(0);
37864668
37874669 if (content instanceof cGroup && ((cGroup)content).transientlink )
37884670 content = ((cGroup)content).get(0);
....@@ -3791,7 +4673,7 @@
37914673 // {
37924674 // group.selection.get(i).ClipMesh(GrafreeD.clipboard);
37934675 // }
3794
- group.selection.ClipMesh(GrafreeD.clipboard);
4676
+ group.selection.ClipMesh(Grafreed.clipboard);
37954677 }
37964678 // group.selection.ClipMesh(GrafreeD.clipboard);
37974679 System.out.println("DONE.");
....@@ -3838,6 +4720,18 @@
38384720 void MarkLeaves(boolean hide)
38394721 {
38404722 group.selection.MarkLeaves(hide);
4723
+ refreshContents();
4724
+ }
4725
+
4726
+ void RewindLeaves(boolean hide)
4727
+ {
4728
+ group.selection.RewindLeaves(hide);
4729
+ refreshContents();
4730
+ }
4731
+
4732
+ void RandomLeaves(boolean hide)
4733
+ {
4734
+ group.selection.RandomLeaves(hide);
38414735 refreshContents();
38424736 }
38434737
....@@ -3912,28 +4806,25 @@
39124806 // }
39134807 // }
39144808
3915
- static boolean allparams = true;
3916
-
3917
- static Vector<Object3D> listUI = new Vector<Object3D>();
3918
-
39194809 void EditSelection(boolean newWindow)
39204810 {
4811
+ if (group.selection == null)
4812
+ {
4813
+ EditElement(group, newWindow); // ? new
4814
+ return;
4815
+ }
4816
+
39214817 // aConstraints.gridy = 0;
39224818 for (int i=0; i<group.selection.size(); i++)
39234819 {
39244820 //System.out.println("edit : " + objectPanel.indexOfTab("Material"));
39254821 //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false);
3926
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
4822
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
39274823
39284824 Object3D elem = (Object3D)group.selection.elementAt(i);
3929
- if(elem != group)
4825
+ if(elem != group || !newWindow)
39304826 {
3931
- // if (!(elem instanceof Composite))
3932
- // newWindow = false;
3933
- listUI.add(elem);
3934
- elem.openEditWindow(this, newWindow); //, false);
3935
- System.out.println("edit : " + elem);
3936
- elem.editWindow.refreshContents(true); // ? new
4827
+ EditElement(elem, newWindow); // ? new
39374828 }
39384829 }
39394830 }
....@@ -4008,7 +4899,8 @@
40084899 //new Exception().printStackTrace();
40094900
40104901 freezemodel = true;
4011
-
4902
+ ClearUnpinned();
4903
+
40124904 /**/
40134905 //switch (event.id)
40144906 {
....@@ -4016,7 +4908,6 @@
40164908 //case 702: // Event.LIST_DESELECT
40174909 group.deselectAll();
40184910 TreePath tps[] = objEditor.jTree.getSelectionPaths();
4019
- objEditor.ClearInfo(); // .GetMaterial());
40204911 if (tps != null)
40214912 {
40224913 for (int i=0; i < tps.length; i++)
....@@ -4025,33 +4916,39 @@
40254916
40264917 //if (child.parent != null)
40274918 //child.parent.addSelectee(child);
4919
+ objEditor.SetMaterial(child);
40284920 group.addSelectee(child);
4029
- objEditor.SetMaterial(child); // .GetMaterial());
4030
- objEditor.AddInfo(child, this, true); // .GetMaterial());
4031
- System.err.println("info : " + child.GetPath());
40324921 }
40334922 }
4034
- else
4035
- {
4036
- objEditor.SetMaterial(group); // .GetMaterial());
4037
- objEditor.AddInfo(group, this, true); // .GetMaterial());
4038
- System.err.println("info : " + group.GetPath());
4039
- }
4923
+// else
4924
+// {
4925
+// objEditor.SetMaterial(group); // .GetMaterial());
4926
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4927
+// System.err.println("info : " + group.GetPath());
4928
+// }
40404929
4041
- objEditor.SetText(); // jan 2014
4042
-
4043
- if (flashIt && !CameraPane.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
4930
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera))
40444931 CameraPane.flash = true;
40454932
4046
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
4933
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
40474934 // a camera
40484935 {
4049
- CameraPane.camerachangeframe = 0; // don't refuse it
4050
- CameraPane.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4051
- // CameraPane.theRenderer.renderCamera = CameraPane.theRenderer.manipCamera;
4052
- // CameraPane.theRenderer.eyeCamera = CameraPane.theRenderer.manipCamera;
4936
+ if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crash the camera because of invalid lightspace
4937
+ {
4938
+ CameraPane.camerachangeframe = 0; // don't refuse it
4939
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4940
+ }
4941
+ // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
4942
+ // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
40534943 }
40544944
4945
+ if (tps != null && tps.length == 1)
4946
+ {
4947
+ EditSelection(false);
4948
+ }
4949
+
4950
+ SetPinStates(tps != null && tps.length > 0);
4951
+
40554952 refreshContents();
40564953 //return true;
40574954 }
....@@ -4060,6 +4957,35 @@
40604957
40614958 freezemodel = false;
40624959 }
4960
+
4961
+ void SetPinStates(boolean enabled)
4962
+ {
4963
+ editButton.setEnabled(enabled);
4964
+ uneditButton.setEnabled(enabled);
4965
+ unselectButton.setEnabled(enabled);
4966
+ flashSelectionButton.setEnabled(enabled);
4967
+ }
4968
+
4969
+ void refreshContents(boolean cp)
4970
+ {
4971
+ if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info"))
4972
+ if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING)
4973
+ {
4974
+ objEditor.ClearInfo(); // .GetMaterial());
4975
+
4976
+ for (int i=0; i < group.selection.Size(); i++)
4977
+ {
4978
+ Object3D child = (Object3D) group.selection.get(i);
4979
+
4980
+ objEditor.AddInfo(child, this, true);
4981
+ System.err.println("info : " + child.GetPath());
4982
+ }
4983
+
4984
+ objEditor.SetText(); // jan 2014
4985
+ }
4986
+
4987
+ super.refreshContents(cp);
4988
+ }
40634989
40644990 void linkSomething(Object3D thing)
40654991 {
....@@ -4131,16 +5057,19 @@
41315057 {
41325058 if (group.selection.isEmpty())
41335059 return;
4134
- GrafreeD.clipboardIsTempGroup = false;
5060
+
5061
+ Grafreed.clipboardIsTempGroup = false;
41355062 Composite tGroup = null;
41365063 if (group.selection.size() > 0) // 1)
41375064 {
41385065 tGroup = new cGroup();
4139
- GrafreeD.clipboardIsTempGroup = true;
5066
+ Grafreed.clipboardIsTempGroup = true;
41405067 }
41415068
41425069 if (cut)
41435070 {
5071
+// if (Globals.SAVEONMAKE) // Moved to the clipboard, no need to save.
5072
+// Save();
41445073 //int indices[] = jList.getSelectedIndices();
41455074 //for (int i = indices.length - 1; i >= 0; i--)
41465075 //jList.remove(indices[i]);
....@@ -4176,16 +5105,16 @@
41765105 //System.out.println("cut " + child);
41775106 //System.out.println("parent = " + child.parent);
41785107 // tmp.addChild(child);
4179
- if (GrafreeD.clipboardIsTempGroup)
5108
+ if (Grafreed.clipboardIsTempGroup)
41805109 tGroup.add/*Child*/(tmp);
41815110 else
4182
- GrafreeD.clipboard = tmp;
5111
+ Grafreed.clipboard = tmp;
41835112 }
41845113 else
4185
- if (GrafreeD.clipboardIsTempGroup)
5114
+ if (Grafreed.clipboardIsTempGroup)
41865115 tGroup.add/*Child*/(child);
41875116 else
4188
- GrafreeD.clipboard = child;
5117
+ Grafreed.clipboard = child;
41895118 }
41905119
41915120 //ResetModel();
....@@ -4217,21 +5146,23 @@
42175146 //System.out.println("cut " + elem);
42185147 //System.out.println("parent = " + elem.parent);
42195148 // tmp.addChild(elem);
4220
- if (GrafreeD.clipboardIsTempGroup)
5149
+ if (Grafreed.clipboardIsTempGroup)
42215150 tGroup.add/*Child*/(tmp);
42225151 else
4223
- GrafreeD.clipboard = tmp;
5152
+ Grafreed.clipboard = tmp;
42245153 }
42255154 else
4226
- if (GrafreeD.clipboardIsTempGroup)
5155
+ if (Grafreed.clipboardIsTempGroup)
42275156 tGroup.add/*Child*/(child);
42285157 else
4229
- GrafreeD.clipboard = child;
5158
+ Grafreed.clipboard = child;
42305159 }
42315160
42325161 }
4233
- if (GrafreeD.clipboardIsTempGroup)
4234
- GrafreeD.clipboard = tGroup;
5162
+
5163
+ if (Grafreed.clipboardIsTempGroup)
5164
+ Grafreed.clipboard = tGroup;
5165
+
42355166 if (cut)
42365167 {
42375168 ResetModel();
....@@ -4241,11 +5172,15 @@
42415172
42425173 void paste(boolean expand)
42435174 {
5175
+ if (Globals.REPLACEONMAKE)
5176
+ Save();
5177
+ boolean keep = Globals.REPLACEONMAKE;
5178
+ Globals.REPLACEONMAKE = false;
42445179 // if (GrafreeD.clipboard == null)
42455180 // return;
42465181 boolean first = true;
42475182
4248
- if (GrafreeD.clipboardIsTempGroup)
5183
+ if (Grafreed.clipboardIsTempGroup)
42495184 {
42505185 Composite temp;
42515186
....@@ -4256,7 +5191,7 @@
42565191 temp = (Composite)Applet3D.clipboard.deepCopy();
42575192 */
42585193 Object3D elem;
4259
- for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
5194
+ for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
42605195 {
42615196 Object3D child = (Object3D)e.nextElement();
42625197
....@@ -4290,21 +5225,22 @@
42905225 //Object3D cb = Applet3D.clipboard;
42915226 //temp.addChild(cb);
42925227 //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0));
4293
- assert(GrafreeD.clipboard.parent == null);
4294
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
4295
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
4296
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
4297
- makeSomething(expand?GrafreeD.clipboard.get(0).copyExpand():GrafreeD.clipboard.get(0).deepCopy());
5228
+ assert(Grafreed.clipboard.parent == null);
5229
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
5230
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
5231
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
5232
+ makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy());
42985233 else
4299
- makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4300
- GrafreeD.clipboard.get(0).parent = keepparent;
5234
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
5235
+ Grafreed.clipboard.get(0).parent = keepparent;
43015236 }
43025237
5238
+ Globals.REPLACEONMAKE = keep;
43035239 ResetModel();
43045240 refreshContents();
43055241 }
43065242
4307
- void pasteInto(boolean copyit)
5243
+ void pasteInto(boolean copyit, boolean clone)
43085244 {
43095245 // if (GrafreeD.clipboard == null)
43105246 // return;
....@@ -4333,15 +5269,22 @@
43335269 if (copyit)
43345270 {
43355271 // paste(false);
4336
- CloneClipboard(false); // sept 2014
5272
+ if (clone)
5273
+ {
5274
+ CloneClipboard(false); // sept 2014
5275
+ }
5276
+ else
5277
+ {
5278
+ paste(false);
5279
+ }
43375280 }
43385281 else
43395282 {
43405283 boolean first = true;
43415284
4342
- if (GrafreeD.clipboardIsTempGroup)
5285
+ if (Grafreed.clipboardIsTempGroup)
43435286 {
4344
- Composite temp = (Composite)GrafreeD.clipboard;
5287
+ Composite temp = (Composite)Grafreed.clipboard;
43455288 Object3D copy;
43465289 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
43475290 {
....@@ -4351,7 +5294,7 @@
43515294 }
43525295 } else
43535296 {
4354
- linkSomething(GrafreeD.clipboard); //.get(0));
5297
+ linkSomething(Grafreed.clipboard); //.get(0));
43555298 }
43565299 }
43575300 }
....@@ -4428,6 +5371,10 @@
44285371
44295372 void group(Object3D csg, boolean grab)
44305373 {
5374
+ if (Globals.REPLACEONMAKE)
5375
+ Save();
5376
+ boolean keep = Globals.REPLACEONMAKE;
5377
+ Globals.REPLACEONMAKE = false;
44315378 if (//false) // why??
44325379 !group.selection.isEmpty())
44335380 {
....@@ -4541,10 +5488,15 @@
45415488 //node.add(csg);
45425489 //makeSomething(node);
45435490 makeSomething(csg);
5491
+ Globals.REPLACEONMAKE = keep;
45445492 }
45455493
45465494 void Ungroup(Object3D g)
45475495 {
5496
+ if (Globals.REPLACEONMAKE)
5497
+ Save();
5498
+ boolean keep = Globals.REPLACEONMAKE;
5499
+ Globals.REPLACEONMAKE = false;
45485500 if (g instanceof HiddenObject)
45495501 {
45505502 HiddenObject h = (HiddenObject) g;
....@@ -4561,6 +5513,7 @@
45615513 objEditor.makeSomething(g.get(i), false);
45625514 }
45635515 }
5516
+ Globals.REPLACEONMAKE = keep;
45645517 }
45655518
45665519 void ungroup()
....@@ -4756,21 +5709,6 @@
47565709 }
47575710 */
47585711
4759
- void ImportGFD()
4760
- {
4761
- FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD);
4762
- browser.show();
4763
- String filename = browser.getFile();
4764
- if (filename != null && filename.length() > 0)
4765
- {
4766
- String fullname = browser.getDirectory() + filename;
4767
-
4768
- //Object3D readobj =
4769
- objEditor.ReadGFD(fullname, objEditor);
4770
- //makeSomething(readobj);
4771
- }
4772
- }
4773
-
47745712 /*
47755713 public void Callback(Object obj)
47765714 {
....@@ -4794,26 +5732,9 @@
47945732 }
47955733 */
47965734
4797
- void ImportVRMLX3D()
4798
- {
4799
- if (GrafreeD.standAlone)
4800
- {
4801
- /**/
4802
- FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
4803
- browser.show();
4804
- String filename = browser.getFile();
4805
- if (filename != null && filename.length() > 0)
4806
- {
4807
- String fullname = browser.getDirectory() + filename;
4808
- LoadVRMLX3D(fullname);
4809
- }
4810
- /**/
4811
- }
4812
- }
4813
-
48145735 String GetFile(String dialogName)
48155736 {
4816
- if (GrafreeD.standAlone)
5737
+ if (Grafreed.standAlone)
48175738 {
48185739 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
48195740 browser.show();
....@@ -4877,10 +5798,49 @@
48775798 cButton flashSelectionButton;
48785799 cButton editButton;
48795800 cButton uneditButton;
5801
+ JCheckBox allParamsButton;
48805802 cButton clearpanelButton;
4881
- cButton allParamsButton;
48825803 cButton unselectButton;
48835804
5805
+ cButton restoreCameraButton;
5806
+
5807
+ cButton saveButton;
5808
+ cButton oneStepButton;
5809
+
5810
+ cButton groupButton;
5811
+ cButton ungroupButton;
5812
+ cButton compositeButton;
5813
+ cButton switchButton;
5814
+ cButton loopButton;
5815
+ cButton textureButton;
5816
+
5817
+ cButton skybox1Button;
5818
+ cButton skybox2Button;
5819
+ cButton skybox3Button;
5820
+ cButton skybox4Button;
5821
+ cButton skybox5Button;
5822
+ cButton skybox6Button;
5823
+ cButton skybox7Button;
5824
+
5825
+ cButton skybox11Button;
5826
+ cButton skybox12Button;
5827
+ cButton skybox13Button;
5828
+ cButton skybox14Button;
5829
+ cButton skybox15Button;
5830
+ cButton skybox16Button;
5831
+ cButton skybox17Button;
5832
+
5833
+ cButton gridButton;
5834
+ cButton boxButton;
5835
+ cButton sphereButton;
5836
+ cButton coneButton;
5837
+ cButton torusButton;
5838
+ cButton superButton;
5839
+ cButton kleinButton;
5840
+ cButton particlesButton;
5841
+ cButton overlayButton;
5842
+ cButton lightButton;
5843
+
48845844 cButton screenfitButton;
48855845 cButton screenfitpointButton;
48865846 cButton snapobjectButton;
....@@ -4892,14 +5852,6 @@
48925852
48935853 cButton setsupportButton;
48945854
4895
- cButton twoButton;
4896
- cButton sixButton;
4897
- cButton threeButton;
4898
- cButton sevenButton;
4899
- cButton fourButton; // full panel
4900
- cButton oneButton; // full XYZ
4901
- //cButton currentLayout;
4902
-
49035855 //
49045856 //Composite
49055857 Object3D // to do !!
....@@ -4909,9 +5861,11 @@
49095861 //JTree jTree;
49105862 private MenuItem lookAtItem;
49115863 private MenuItem lookFromItem;
4912
- private MenuItem switchItem;
5864
+ private MenuItem switchViewItem;
49135865 private MenuItem cutItem;
4914
- private MenuItem duplicateItem;
5866
+ private MenuItem undoItem;
5867
+ private MenuItem redoItem;
5868
+ private JMenuItem duplicateItem;
49155869 private MenuItem cloneItem;
49165870 private MenuItem cloneSupportItem;
49175871 private MenuItem overwriteGeoItem;
....@@ -4924,7 +5878,7 @@
49245878 private MenuItem linkverticesItem;
49255879 private MenuItem relinkverticesItem;
49265880 private MenuItem setMasterItem;
4927
- private MenuItem resetMeshItem;
5881
+ private MenuItem resetAllItem;
49285882 private MenuItem stepAllItem;
49295883 private MenuItem revertMeshItem;
49305884 private MenuItem poseMeshItem;
....@@ -4935,10 +5889,11 @@
49355889 private MenuItem mergeGeometriesItem;
49365890 private MenuItem copyItem;
49375891 private MenuItem pasteItem;
5892
+ private MenuItem pasteIntoItem;
49385893 private MenuItem pasteLinkItem;
49395894 private MenuItem pasteCloneItem;
49405895 private MenuItem pasteExpandItem;
4941
- private MenuItem clearItem;
5896
+ private MenuItem deleteItem;
49425897 private MenuItem clearAllItem;
49435898 private MenuItem genUVItem;
49445899 private MenuItem genNormalsMESHItem;
....@@ -4973,6 +5928,10 @@
49735928 private MenuItem showleavesItem;
49745929 private MenuItem markleavesItem;
49755930 private MenuItem unmarkleavesItem;
5931
+ private MenuItem rewindleavesItem;
5932
+ private MenuItem unrewindleavesItem;
5933
+ private MenuItem randomleavesItem;
5934
+ private MenuItem unrandomleavesItem;
49765935
49775936 private MenuItem flipVItem;
49785937 private MenuItem unflipVItem;
....@@ -4984,15 +5943,17 @@
49845943 private MenuItem panoTexturesItem;
49855944
49865945 private MenuItem resetCentroidItem;
4987
- private MenuItem transformgeometryItem;
5946
+ private MenuItem resetCentroidXZItem;
49885947 private MenuItem resetTransformItem;
5948
+ private MenuItem transformGeometryItem;
5949
+ private MenuItem transformChildrenItem;
49895950 private MenuItem hideItem;
49905951 private MenuItem grabItem;
49915952 private MenuItem backItem;
49925953 private MenuItem frontItem;
49935954 private MenuItem cameraItem;
49945955 private MenuItem compositeItem;
4995
- private MenuItem randomItem;
5956
+ private MenuItem switchItem;
49965957 private MenuItem physicsItem;
49975958 private MenuItem frameselectorItem;
49985959 private MenuItem scriptNodeItem;
....@@ -5007,6 +5968,7 @@
50075968
50085969 private MenuItem resetParentItem;
50095970 private MenuItem repairParentItem;
5971
+ private MenuItem repairShadowItem;
50105972 private MenuItem sortbysizeItem;
50115973 private MenuItem sortbynameItem;
50125974
....@@ -5015,6 +5977,8 @@
50155977 private MenuItem attachBumpItem;
50165978 private MenuItem detachBumpItem;
50175979 private MenuItem pigmentBumpItem;
5980
+ private MenuItem embedTexturesItem;
5981
+ private MenuItem deEmbedTexturesItem;
50185982
50195983 private MenuItem particleItem;
50205984 private MenuItem ragdollItem;
....@@ -5031,7 +5995,7 @@
50315995 private MenuItem blobItem;
50325996 private MenuItem latheItem;
50335997 private MenuItem bezierItem;
5034
- private MenuItem checkerItem;
5998
+ private MenuItem overlayItem;
50355999 private MenuItem meshItem;
50366000 // private MenuItem meshGroupItem;
50376001 private MenuItem springItem;
....@@ -5053,11 +6017,6 @@
50536017 private MenuItem doubleItem;
50546018 private MenuItem tripleItem;
50556019
5056
- private MenuItem importGFDItem;
5057
- private MenuItem importVRMLX3DItem;
5058
- private MenuItem import3DSItem;
5059
- private MenuItem importOBJItem;
5060
-
50616020 private MenuItem computeAOItem;
50626021 private MenuItem recompileItem;
50636022 private MenuItem editScriptItem;
....@@ -5067,4 +6026,8 @@
50676026 private MenuItem analyzeItem;
50686027 private MenuItem dumpItem;
50696028 //boolean freezemodel = false;
6029
+
6030
+ Menu cameraMenu;
6031
+ MenuItem editCameraItem;
6032
+ MenuItem restoreCameraItem;
50706033 }