Normand Briere
2019-07-27 1af7d3700724834e40ad8636bc9a56cdc3b19b15
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,
....@@ -59,6 +60,12 @@
5960 this.copy = this.group = group;
6061 //selectees = this.group.selectees;
6162
63
+ if (copy.versions == null)
64
+ {
65
+ copy.versions = new byte[100][];
66
+ copy.versionindex = -1;
67
+ }
68
+
6269 if(ui)
6370 SetupUI(objEditor);
6471 }
....@@ -73,16 +80,28 @@
7380 this.copy = this.group = copy;
7481 //selectees = this.group.selectees;
7582
76
- SetupMenu2(objEditor);
83
+ SetupMenu2(this); //objEditor);
7784 SetupUI2(objEditor);
7885 objEditor.SetupUI(true);
7986 SetupViews(objEditor);
8087
8188 ((cRadio)radioPanel.getComponent(0)).SetCamera(cameraView.renderCamera, true);
89
+
90
+ if (copy.versions == null)
91
+ {
92
+ copy.versions = new byte[100][];
93
+ copy.versionindex = -1;
94
+
95
+ Save(true);
96
+ }
8297 }
8398
8499 void CloneSelection(boolean supports)
85100 {
101
+ if (Globals.REPLACEONMAKE)
102
+ Save();
103
+ boolean keep = Globals.REPLACEONMAKE;
104
+ Globals.REPLACEONMAKE = false;
86105 // Object3D keep = GrafreeD.clipboard;
87106 //Object3D obj;
88107 for (int i=0; i<group.selection.size(); i++)// Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -93,18 +112,19 @@
93112
94113 makeSomething(clone, i==group.selection.size()-1);
95114 }
115
+ Globals.REPLACEONMAKE = keep;
96116 }
97117
98118 void CloneClipboard(boolean supports)
99119 {
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));
120
+ assert(Grafreed.clipboard.parent == null);
121
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
122
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
123
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
124
+ makeSomething(CloneObject(Grafreed.clipboard.get(0), false));
105125 else
106
- makeSomething(CloneObject(GrafreeD.clipboard, false));
107
- GrafreeD.clipboard.get(0).parent = keepparent;
126
+ makeSomething(CloneObject(Grafreed.clipboard, false));
127
+ Grafreed.clipboard.get(0).parent = keepparent;
108128 }
109129
110130 static Object3D CloneObject(Object3D obj, boolean supports)
....@@ -118,7 +138,7 @@
118138 // obj.support = null;
119139 if (!supports)
120140 obj.SaveSupports();
121
- Object3D clone = (Object3D)GrafreeD.clone(obj);
141
+ Object3D clone = (Object3D)Grafreed.clone(obj);
122142 obj.parent = parent;
123143 // obj.support = support;
124144 // clone.support = support; // aout 2013
....@@ -147,30 +167,29 @@
147167
148168 //JTextField nameField;
149169
150
- void SetupMenu2(ObjEditor oe)
170
+ void SetupMenu2(GroupEditor oe)
151171 {
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);
172
+ oe.jTree = new cTree();
173
+
163174 Menu menu;
164175 oe.menuBar.add(menu = new Menu("Edit"));
165176 //editItem = menu.add(new MenuItem("Edit"));
166177 //editItem.addActionListener(this);
167
- duplicateItem = menu.add(new MenuItem("Duplicate"));
178
+
179
+// undoItem = menu.add(new MenuItem("Undo"));
180
+// undoItem.addActionListener(this);
181
+// redoItem = menu.add(new MenuItem("Redo"));
182
+// redoItem.addActionListener(this);
183
+// menu.add("-");
184
+ duplicateItem = oe.jTree.popup.add(new JMenuItem("Duplicate"));
168185 duplicateItem.addActionListener(this);
169
- menu.add("-");
170186 cloneItem = menu.add(new MenuItem("Clone"));
171187 cloneItem.addActionListener(this);
188
+ if (Globals.ADVANCED)
189
+ {
172190 cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
173191 cloneSupportItem.addActionListener(this);
192
+ }
174193 menu.add("-");
175194 cutItem = menu.add(new MenuItem("Cut"));
176195 cutItem.addActionListener(this);
....@@ -178,27 +197,123 @@
178197 copyItem.addActionListener(this);
179198 pasteItem = menu.add(new MenuItem("Paste"));
180199 pasteItem.addActionListener(this);
200
+
201
+ menu.add("-");
202
+ pasteIntoItem = menu.add(new MenuItem("Paste into"));
203
+ pasteIntoItem.addActionListener(this);
181204 pasteLinkItem = menu.add(new MenuItem("Paste link"));
182205 pasteLinkItem.addActionListener(this);
183206 pasteCloneItem = menu.add(new MenuItem("Paste clone"));
184207 pasteCloneItem.addActionListener(this);
185208 // pasteExpandItem = menu.add(new MenuItem("Paste expand"));
186209 // pasteExpandItem.addActionListener(this);
187
- clearItem = menu.add(new MenuItem("Clear"));
188
- clearItem.addActionListener(this);
210
+ menu.add("-");
211
+ deleteItem = menu.add(new MenuItem("Delete"));
212
+ deleteItem.addActionListener(this);
213
+
214
+ if (Globals.ADVANCED)
215
+ {
216
+ // Deletes the cameras...
189217 clearAllItem = menu.add(new MenuItem("Clear All"));
190218 clearAllItem.addActionListener(this);
219
+ }
220
+
221
+ menuBar.add(cameraMenu = new Menu("View"));
222
+ //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer"));
223
+ //zBufferItem.addActionListener(this);
224
+ //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens"));
225
+ //normalLensItem.addActionListener(this);
226
+ cameraMenu.add(restoreCameraItem = new MenuItem("Restore Viewpoint"));
227
+ restoreCameraItem.addActionListener(this);
228
+
229
+// cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen"));
230
+// toggleFullScreenItem.addItemListener(this);
231
+// toggleFullScreenItem.setState(CameraPane.FULLSCREEN);
232
+// cameraMenu.add("-");
233
+//
234
+// cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture"));
235
+// toggleTextureItem.addItemListener(this);
236
+// toggleTextureItem.setState(CameraPane.textureon);
237
+//
238
+// cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch"));
239
+// toggleSwitchItem.addItemListener(this);
240
+// toggleSwitchItem.setState(CameraPane.SWITCH);
241
+
242
+ cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Show Handles"));
243
+ toggleHandleItem.addItemListener(this);
244
+ toggleHandleItem.setState(CameraPane.HANDLES);
245
+
246
+ cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode"));
247
+ togglePaintItem.addItemListener(this);
248
+ togglePaintItem.setState(CameraPane.PAINTMODE);
249
+
250
+ if (Globals.ADVANCED)
251
+ {
252
+ cameraMenu.add("-");
253
+ cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live"));
254
+ toggleLiveItem.addItemListener(this);
255
+ toggleLiveItem.setState(Globals.isLIVE());
191256
257
+ cameraMenu.add(stepItem = new MenuItem("Step"));
258
+ stepItem.addActionListener(this);
259
+ // cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List"));
260
+ // toggleDLItem.addItemListener(this);
261
+ // toggleDLItem.setState(false);
262
+
263
+ cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render"));
264
+ toggleRenderItem.addItemListener(this);
265
+ toggleRenderItem.setState(!CameraPane.frozen);
266
+
267
+ cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug"));
268
+ toggleDebugItem.addItemListener(this);
269
+ toggleDebugItem.setState(Globals.DEBUG);
270
+
271
+ cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum"));
272
+ toggleFrustumItem.addItemListener(this);
273
+ toggleFrustumItem.setState(CameraPane.FRUSTUM);
274
+
275
+ cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact"));
276
+ toggleFootContactItem.addItemListener(this);
277
+ toggleFootContactItem.setState(CameraPane.FOOTCONTACT);
278
+
279
+ cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline"));
280
+ toggleTimelineItem.addItemListener(this);
281
+ }
282
+
283
+// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root"));
284
+// toggleRootItem.addItemListener(this);
285
+// toggleRootItem.setState(false);
286
+// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation"));
287
+// animationItem.addItemListener(this);
288
+// animationItem.setState(CameraPane.ANIMATION);
289
+ cameraMenu.add("-");
290
+ cameraMenu.add(editCameraItem = new MenuItem("Save Viewpoint"));
291
+ editCameraItem.addActionListener(this);
292
+
293
+ if (Globals.ADVANCED)
294
+ {
295
+ oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
296
+ //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
297
+ //cameraMenu.add(switchViewItem = new MenuItem("Reverse View"));
298
+ editLeafItem = oe.cameraMenu.add(new MenuItem("Edit Leaf"));
299
+ oe.cameraMenu.add("-");
300
+ openWindowItem = oe.cameraMenu.add(new MenuItem("Edit copy..."));
301
+ openWindowItem.addActionListener(this);
302
+ editLeafItem.addActionListener(this);
303
+ lookAtItem.addActionListener(this);
304
+ //lookFromItem.addActinoListener(this);
305
+ //switchViewItem.addActionListener(this);
306
+ }
307
+
192308 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);
309
+ if (Globals.ADVANCED)
310
+ {
197311 revertMeshItem = menu.add(new MenuItem("Revert Meshes"));
198312 revertMeshItem.addActionListener(this);
199313 resetreferencesItem = menu.add(new MenuItem("Reset Mesh References"));
200314 resetreferencesItem.addActionListener(this);
201315 menu.add("-");
316
+ }
202317 overwriteGeoItem = menu.add(new MenuItem("Overwrite Geometry"));
203318 overwriteGeoItem.addActionListener(this);
204319 overwriteMatItem = menu.add(new MenuItem("Overwrite Material"));
....@@ -210,79 +325,104 @@
210325 overwriteUVItem = menu.add(new MenuItem("Overwrite UV"));
211326 overwriteUVItem.addActionListener(this);
212327 menu.add("-");
328
+ if (Globals.ADVANCED)
329
+ {
213330 generateMeshItem = menu.add(new MenuItem("Generate Meshes"));
214331 generateMeshItem.addActionListener(this);
215332 poseMeshItem = menu.add(new MenuItem("Set Pose Meshes"));
216333 poseMeshItem.addActionListener(this);
217334 menu.add("-");
335
+ }
218336 resetsupportItem = menu.add(new MenuItem("Reset support"));
219337 resetsupportItem.addActionListener(this);
220338 linkverticesItem = menu.add(new MenuItem("Link to Support"));
221339 linkverticesItem.addActionListener(this);
222340 relinkverticesItem = menu.add(new MenuItem("Re-link to Support"));
223341 relinkverticesItem.addActionListener(this);
342
+
343
+ if (Globals.ADVANCED)
344
+ {
224345 setMasterItem = menu.add(new MenuItem("Set Master Mesh"));
225346 setMasterItem.addActionListener(this);
347
+ }
226348
227349 oe.menuBar.add(menu = new Menu("Group"));
228
- grabItem = menu.add(new MenuItem("Grab"));
229
- grabItem.addActionListener(this);
350
+// grabItem = menu.add(new MenuItem("Grab"));
351
+// grabItem.addActionListener(this);
230352 backItem = menu.add(new MenuItem("Back"));
231353 backItem.addActionListener(this);
232354 frontItem = menu.add(new MenuItem("Front"));
233355 frontItem.addActionListener(this);
234
- compositeItem = menu.add(new MenuItem("Composite"));
235
- compositeItem.addActionListener(this);
236
- hideItem = menu.add(new MenuItem("Hide"));
356
+// compositeItem = menu.add(new MenuItem("Composite"));
357
+// compositeItem.addActionListener(this);
358
+
359
+ if (Globals.ADVANCED)
360
+ {
361
+ hideItem = menu.add(new MenuItem("Hidden Group"));
237362 hideItem.addActionListener(this);
363
+ }
238364 ungroupItem = menu.add(new MenuItem("Ungroup"));
239365 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);
366
+
367
+// menu.add("-");
368
+//
369
+// switchItem = menu.add(new MenuItem("Switch node"));
370
+// switchItem.addActionListener(this);
371
+ if (Globals.ADVANCED)
372
+ {
247373 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
248374 switchGeoItem.addActionListener(this);
249375 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
250376 switchTransfoItem.addActionListener(this);
251
- morphItem = menu.add(new MenuItem("Morph"));
377
+ morphItem = menu.add(new MenuItem("Morph Group"));
252378 morphItem.addActionListener(this);
379
+
380
+ menu.add("-");
381
+ physicsItem = menu.add(new MenuItem("Physics"));
382
+ physicsItem.addActionListener(this);
383
+ frameselectorItem = menu.add(new MenuItem("Frame Selector"));
384
+ frameselectorItem.addActionListener(this);
253385 scriptNodeItem = menu.add(new MenuItem("Script Node"));
254386 scriptNodeItem.addActionListener(this);
255
- cameraItem = menu.add(new MenuItem("Camera"));
256
- cameraItem.addActionListener(this);
387
+ }
257388
258389 oe.menuBar.add(menu = new Menu("Object"));
259
- textureItem = menu.add(new MenuItem("Texture"));
260
- textureItem.addActionListener(this);
390
+// textureItem = menu.add(new MenuItem("Texture"));
391
+// textureItem.addActionListener(this);
261392 billboardItem = menu.add(new MenuItem("Billboard"));
262393 billboardItem.addActionListener(this);
263394 csgItem = menu.add(new MenuItem("CSG"));
264395 csgItem.addActionListener(this);
265
- shadowXItem = menu.add(new MenuItem("Shadow X"));
396
+ shadowXItem = menu.add(new MenuItem("Shadow Red"));
266397 shadowXItem.addActionListener(this);
267
- shadowYItem = menu.add(new MenuItem("Shadow Y"));
398
+ shadowYItem = menu.add(new MenuItem("Shadow Green"));
268399 shadowYItem.addActionListener(this);
269
- shadowZItem = menu.add(new MenuItem("Shadow Z"));
400
+ shadowZItem = menu.add(new MenuItem("Shadow Blue"));
270401 shadowZItem.addActionListener(this);
402
+ attributeItem = menu.add(new MenuItem("Attribute"));
403
+ attributeItem.addActionListener(this);
404
+
405
+ if (Globals.ADVANCED)
406
+ {
407
+ menu.add("-");
271408 linkerItem = menu.add(new MenuItem("Linker"));
272409 linkerItem.addActionListener(this);
273410 templateItem = menu.add(new MenuItem("Template"));
274411 templateItem.addActionListener(this);
275
- attributeItem = menu.add(new MenuItem("Attribute"));
276
- attributeItem.addActionListener(this);
277412 pointflowItem = menu.add(new MenuItem("Point Flow"));
278413 pointflowItem.addActionListener(this);
414
+ }
279415 menu.add("-");
280416 resetTransformItem = menu.add(new MenuItem("Reset Transform"));
281417 resetTransformItem.addActionListener(this);
282418 resetCentroidItem = menu.add(new MenuItem("Reset Centroid"));
283419 resetCentroidItem.addActionListener(this);
284
- transformgeometryItem = menu.add(new MenuItem("Transform Geometry"));
285
- transformgeometryItem.addActionListener(this);
420
+ resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY"));
421
+ resetCentroidXZItem.addActionListener(this);
422
+ transformGeometryItem = menu.add(new MenuItem("Transform Geometry"));
423
+ transformGeometryItem.addActionListener(this);
424
+ transformChildrenItem = menu.add(new MenuItem("Transform Children"));
425
+ transformChildrenItem.addActionListener(this);
286426
287427 oe.menuBar.add(menu = new Menu("Geometry"));
288428 genUVItem = menu.add(new MenuItem("Generate UV"));
....@@ -293,8 +433,11 @@
293433 genNormalsCADItem.addActionListener(this);
294434 genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals"));
295435 genNormalsMESHItem.addActionListener(this);
296
- genNormalsMINEItem = menu.add(new MenuItem("My Normals"));
436
+ if (Globals.ADVANCED)
437
+ {
438
+ genNormalsMINEItem = menu.add(new MenuItem("Stitch Normals"));
297439 genNormalsMINEItem.addActionListener(this);
440
+ }
298441 stripifyItem = menu.add(new MenuItem("Stripify"));
299442 stripifyItem.addActionListener(this);
300443 unstripifyItem = menu.add(new MenuItem("Unstripify"));
....@@ -316,23 +459,34 @@
316459 reduce34MeshItem.addActionListener(this);
317460 increaseMeshItem = menu.add(new MenuItem("Increase mesh"));
318461 increaseMeshItem.addActionListener(this);
319
- smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
320
- smoothMeshItem.addActionListener(this);
321462 clipMeshItem = menu.add(new MenuItem("Clip mesh"));
322463 clipMeshItem.addActionListener(this);
464
+
465
+ if (Globals.ADVANCED)
466
+ {
467
+ smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
468
+ smoothMeshItem.addActionListener(this);
469
+ }
323470
324471 oe.menuBar.add(menu = new Menu("Attributes"));
325472 clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
326473 clearMaterialsItem.addActionListener(this);
474
+ resetAllItem = menu.add(new MenuItem("Reset All"));
475
+ resetAllItem.addActionListener(this);
476
+ stepAllItem = menu.add(new MenuItem("Step All"));
477
+ stepAllItem.addActionListener(this);
327478 menu.add("-");
328479 liveleavesItem = menu.add(new MenuItem("Live Leaves"));
329480 liveleavesItem.addActionListener(this);
330481 unliveleavesItem = menu.add(new MenuItem("Unlive Leaves"));
331482 unliveleavesItem.addActionListener(this);
483
+ if (Globals.ADVANCED)
484
+ {
332485 supportleavesItem = menu.add(new MenuItem("Support Leaves"));
333486 supportleavesItem.addActionListener(this);
334487 unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves"));
335488 unsupportleavesItem.addActionListener(this);
489
+ }
336490 hideleavesItem = menu.add(new MenuItem("Hide Leaves"));
337491 hideleavesItem.addActionListener(this);
338492 showleavesItem = menu.add(new MenuItem("Show Leaves"));
....@@ -341,6 +495,14 @@
341495 markleavesItem.addActionListener(this);
342496 unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves"));
343497 unmarkleavesItem.addActionListener(this);
498
+ rewindleavesItem = menu.add(new MenuItem("Rewind Leaves"));
499
+ rewindleavesItem.addActionListener(this);
500
+ unrewindleavesItem = menu.add(new MenuItem("Unrewind Leaves"));
501
+ unrewindleavesItem.addActionListener(this);
502
+ randomleavesItem = menu.add(new MenuItem("Random Leaves"));
503
+ randomleavesItem.addActionListener(this);
504
+ unrandomleavesItem = menu.add(new MenuItem("Unrandom Leaves"));
505
+ unrandomleavesItem.addActionListener(this);
344506 menu.add("-");
345507 flipVItem = menu.add(new MenuItem("Flip V"));
346508 flipVItem.addActionListener(this);
....@@ -366,45 +528,56 @@
366528 attachBumpItem.addActionListener(this);
367529 pigmentBumpItem = menu.add(new MenuItem("Pigment -> Bump"));
368530 pigmentBumpItem.addActionListener(this);
531
+ //embedTexturesItem
369532 detachPigmentItem = menu.add(new MenuItem("Detach Pigment"));
370533 detachPigmentItem.addActionListener(this);
371534 detachBumpItem = menu.add(new MenuItem("Detach Bump"));
372535 detachBumpItem.addActionListener(this);
536
+ embedTexturesItem = menu.add(new MenuItem("Embed Textures"));
537
+ embedTexturesItem.addActionListener(this);
538
+ deEmbedTexturesItem = menu.add(new MenuItem("De-embed Textures"));
539
+ deEmbedTexturesItem.addActionListener(this);
373540 menu.add("-");
374541 sortbysizeItem = menu.add(new MenuItem("Sort by size"));
375542 sortbysizeItem.addActionListener(this);
376543 sortbynameItem = menu.add(new MenuItem("Sort by name"));
377544 sortbynameItem.addActionListener(this);
378545 menu.add("-");
546
+ shareGeometriesItem = menu.add(new MenuItem("Share Geometries"));
547
+ shareGeometriesItem.addActionListener(this);
548
+ mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries"));
549
+ mergeGeometriesItem.addActionListener(this);
550
+ if (Globals.ADVANCED)
551
+ {
552
+ // Pretty much the same as duplicate and clone.
379553 extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
380554 extractGeometriesItem.addActionListener(this);
381555 cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry"));
382556 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);
557
+ }
387558
388559 oe.menuBar.add(menu = new Menu("Insert"));
389560 buildCreateMenu(menu);
390561
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
-
402562 oe.menuBar.add(menu = new Menu("Tools"));
403563 buildToolsMenu(menu);
404564 }
405565
566
+
406567 void SetupUI2(ObjEditor oe)
407568 {
569
+ // June 2019
570
+ if (oe == null)
571
+ {
572
+ //super.SetupUI2(this);
573
+ //return;
574
+ }
575
+
576
+ if (copy != group)
577
+ {
578
+ //super.SetupUI2(this);
579
+ }
580
+
408581 //new Exception().printStackTrace();
409582
410583 oe.radioPanel = new JPanel(new GridBagLayout());
....@@ -433,153 +606,231 @@
433606 oe.radioPanel.add(dummyButton);
434607 oe.buttonGroup.add(dummyButton);
435608 */
436
- aConstraints.gridy += 1;
437
- oe.aConstraints.gridwidth = 1;
438
- oe.aConstraints.gridx = 0;
609
+ cGridBag copyOptionsPanel = new cGridBag();
610
+
611
+ copyOptionsPanel.preferredHeight = 1;
439612
440
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", CameraPane.isLIVE()), oe.aConstraints);
613
+ //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
614
+
615
+ //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
616
+ //minButton.setToolTipText("Minimize window");
617
+ //minButton.addActionListener(this);
618
+
619
+ if (Globals.ADVANCED)
620
+ {
621
+ oe.toolbarPanel.add(maxButton = GetButton("icons/add-128.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
622
+ maxButton.setToolTipText("Maximize window");
623
+ maxButton.addActionListener(this);
624
+ }
625
+
626
+ oe.toolbarPanel.add(fullButton = GetButton("icons/fullscreen.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
627
+ fullButton.setToolTipText("Full-screen window");
628
+ fullButton.addActionListener(this);
629
+
630
+ oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
631
+ screenfitButton.setToolTipText("Screen fit");
632
+ screenfitButton.addActionListener(this);
633
+
634
+ oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
635
+ restoreCameraButton.setToolTipText("Restore viewpoint");
636
+ restoreCameraButton.addActionListener(this);
637
+
638
+ copyOptionsPanel.add(saveButton = GetButton("icons/down_arrow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
639
+ saveButton.setToolTipText("New version");
640
+ saveButton.addActionListener(this);
641
+
642
+ copyOptionsPanel.add(undoButton = GetButton("icons/undo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
643
+ undoButton.setToolTipText("Previous version");
644
+ undoButton.addActionListener(this);
645
+ undoButton.setEnabled(false);
646
+
647
+ cGridBag updown = new cGridBag().setVertical(true);
648
+ updown.add(restoreButton = GetButton("icons/restore.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
649
+ restoreButton.setToolTipText("Restore current");
650
+ restoreButton.addActionListener(this);
651
+ restoreButton.setEnabled(false);
652
+
653
+ updown.add(replaceButton = GetButton("icons/replace.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
654
+ replaceButton.setToolTipText("Replace current");
655
+ replaceButton.addActionListener(this);
656
+ replaceButton.setEnabled(false);
657
+
658
+ copyOptionsPanel.add(updown);
659
+
660
+ copyOptionsPanel.add(redoButton = GetButton("icons/redo.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
661
+ redoButton.setToolTipText("Next version");
662
+ redoButton.addActionListener(this);
663
+ redoButton.setEnabled(false);
664
+
665
+ oe.toolbarPanel.add(liveCB = GetToggleButton("icons/run.png", Globals.isLIVE())); //, oe.aConstraints);
666
+ liveCB.setToolTipText("Enable animation");
441667 liveCB.addItemListener(this);
442668
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);
669
+ oe.toolbarPanel.add(oneStepButton = GetButton("icons/step.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
670
+ oneStepButton.setToolTipText("Animate one step forward");
671
+ oneStepButton.addActionListener(this);
672
+
673
+ oe.toolbarPanel.add(fastCB = GetToggleButton("icons/runfast.png", CameraPane.FAST)); //, constraints);
674
+ fastCB.setToolTipText("Fast mode");
461675 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);
676
+
677
+ //oe.toolboxPanel.Return();
678
+
679
+// copyOptionsPanel.add(trackCB = GetToggleButton("icons/track.png", CameraPane.TRACK)); //, oe.aConstraints);
680
+// trackCB.setToolTipText("Enable tracking");
681
+// trackCB.addItemListener(this);
468682
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;
509683 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
510684 // 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;
515685
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
-
524
- oe.toolbarPanel.add(new cButton(" ", false));
525
-
526
- oe.aConstraints.gridx += 1;
527
- oe.aConstraints.weighty = 0;
528
- oe.aConstraints.gridwidth = 1;
529
-
530
- //
531
- oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints);
532
- twoButton.addActionListener(this);
533
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
686
+ if (Globals.ADVANCED)
687
+ {
688
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
689
+ snapobjectButton.addActionListener(this);
690
+ snapobjectButton.setToolTipText("Snap Object");
691
+
692
+ oe.toolbarPanel.add(fourButton = GetButton("icons/controls-horizontal.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
534693 fourButton.addActionListener(this);
535
- oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
536
- sixButton.addActionListener(this);
537
- oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
694
+ fourButton.setToolTipText("Show control panel only");
695
+ }
696
+
697
+ //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
698
+
699
+ oe.toolbarPanel.add(twoButton = GetButton("icons/cube.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
700
+ twoButton.setToolTipText("Show 3D view only");
701
+ twoButton.addActionListener(this);
702
+ this.fullscreenLayout = twoButton;
703
+
704
+ oe.toolbarPanel.add(threeButton = GetButton("icons/controlsview.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
705
+ threeButton.setToolTipText("Show controls and 3D view");
538706 threeButton.addActionListener(this);
539
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
540
- sevenButton.addActionListener(this);
707
+ oe.toolbarPanel.add(sixButton = GetButton("icons/viewcontrols.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
708
+ sixButton.setToolTipText("Show 3D view and controls");
709
+ sixButton.addActionListener(this);
710
+// oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
711
+// sevenButton.setToolTipText("3-column layout");
712
+// sevenButton.addActionListener(this);
541713 //
542714
543
- oe.toolbarPanel.add(rootButton = new cButton(" o o o E ")); //, oe.aConstraints);
715
+ oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
716
+ rootButton.setToolTipText("Open selection in new tab");
544717 rootButton.addActionListener(this);
545
- oe.aConstraints.gridx += 1;
546
- oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
718
+
719
+ oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
720
+ closeButton.setToolTipText("Close tab");
547721 closeButton.addActionListener(this);
548722 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
549723 //clearButton.addActionListener(this);
550
- oe.aConstraints.gridx += 1;
551
-
552
- oe.aConstraints.gridx = 1; //
553
- oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints);
554
- editButton.addActionListener(this);
555
- oe.aConstraints.gridx += 1;
556
- oe.aConstraints.weighty = 0;
557
- oe.aConstraints.gridwidth = 1;
558724
559
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
725
+ // INSERT
726
+ oe.toolboxPanel.add(gridButton = GetButton("icons/grid.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
727
+ gridButton.setToolTipText("Create grid");
728
+ gridButton.addActionListener(this);
729
+
730
+ oe.toolboxPanel.add(boxButton = GetButton("icons/box.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
731
+ boxButton.setToolTipText("Create box");
732
+ boxButton.addActionListener(this);
733
+
734
+ oe.toolboxPanel.add(sphereButton = GetButton("icons/sphere.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
735
+ sphereButton.setToolTipText("Create sphere");
736
+ sphereButton.addActionListener(this);
737
+
738
+ oe.toolboxPanel.add(coneButton = GetButton("icons/cone.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
739
+ coneButton.setToolTipText("Create cone");
740
+ coneButton.addActionListener(this);
741
+
742
+ oe.toolboxPanel.add(torusButton = GetButton("icons/torus.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
743
+ torusButton.setToolTipText("Create torus");
744
+ torusButton.addActionListener(this);
745
+
746
+ oe.toolboxPanel.add(superButton = GetButton("icons/super.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
747
+ superButton.setToolTipText("Create superellipsoid");
748
+ superButton.addActionListener(this);
749
+
750
+ if (Globals.ADVANCED)
751
+ {
752
+ oe.toolboxPanel.add(kleinButton = GetButton("icons/klein.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
753
+ kleinButton.setToolTipText("Create Klein bottle");
754
+ kleinButton.addActionListener(this);
755
+ }
756
+
757
+ oe.toolboxPanel.add(particlesButton = GetButton("icons/particles.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
758
+ particlesButton.setToolTipText("Create particle system");
759
+ particlesButton.addActionListener(this);
760
+
761
+ oe.toolboxPanel.Return();
762
+
763
+ oe.toolboxPanel.add(groupButton = GetButton("icons/group.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
764
+ groupButton.setToolTipText("Create group");
765
+ groupButton.addActionListener(this);
766
+
767
+ oe.toolboxPanel.add(compositeButton = GetButton("icons/composite.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
768
+ compositeButton.setToolTipText("Create composite");
769
+ compositeButton.addActionListener(this);
770
+
771
+ oe.toolboxPanel.add(switchButton = GetButton("icons/switch.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
772
+ switchButton.setToolTipText("Create item switcher");
773
+ switchButton.addActionListener(this);
774
+
775
+ oe.toolboxPanel.add(loopButton = GetButton("icons/loop.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
776
+ loopButton.setToolTipText("Create loop");
777
+ loopButton.addActionListener(this);
778
+
779
+ oe.toolboxPanel.add(textureButton = GetButton("icons/texture.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
780
+ textureButton.setToolTipText("Create texture");
781
+ textureButton.addActionListener(this);
782
+
783
+ oe.toolboxPanel.add(overlayButton = GetButton("icons/overlay.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
784
+ overlayButton.setToolTipText("Create overlay");
785
+ overlayButton.addActionListener(this);
786
+
787
+ oe.toolboxPanel.add(lightButton = GetButton("icons/light-bulb.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
788
+ lightButton.setToolTipText("Create light");
789
+ lightButton.addActionListener(this);
790
+
791
+ for (int i=6; --i>=0;)
792
+ {
793
+ oe.toolboxPanel.Return();
794
+ oe.toolboxPanel.add(new cGridBag());
795
+ oe.toolboxPanel.add(new cGridBag());
796
+ oe.toolboxPanel.add(new cGridBag());
797
+ oe.toolboxPanel.add(new cGridBag());
798
+ oe.toolboxPanel.add(new cGridBag());
799
+ oe.toolboxPanel.add(new cGridBag());
800
+ oe.toolboxPanel.add(new cGridBag());
801
+ }
802
+
803
+ // EDIT panel
804
+ editCommandsPanel.add(editButton = GetButton("icons/controls.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
805
+ editButton.setToolTipText("Pin selection controls");
806
+ editButton.addActionListener(this);
807
+
808
+ editCommandsPanel.add(uneditButton = GetButton("icons/remove.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
809
+ uneditButton.setToolTipText("Remove selection controls");
560810 uneditButton.addActionListener(this);
561811
562
- oe.aConstraints.gridx += 1;
563
- oe.aConstraints.weighty = 0;
564
- oe.aConstraints.gridwidth = 1;
565
-
566
- oe.treePanel.add(clearPanelButton = new cButton("C"), oe.aConstraints);
567
- clearPanelButton.addActionListener(this);
568
-
569
- oe.aConstraints.gridx += 1;
570
- oe.aConstraints.weighty = 0;
571
- oe.aConstraints.gridwidth = 1;
572
-
573
- oe.treePanel.add(allParamsButton = new cButton("A"), oe.aConstraints);
812
+ editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
813
+ allParamsButton.setToolTipText("Show all controle");
574814 allParamsButton.addActionListener(this);
575815
576
- oe.aConstraints.gridx += 1;
577
- oe.aConstraints.weighty = 0;
578
- oe.aConstraints.gridwidth = 1;
579
-
580
- oe.treePanel.add(unselectButton = new cButton("U"), oe.aConstraints);
816
+ editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
817
+ clearPanelButton.setToolTipText("Clear edit panel");
818
+ clearPanelButton.addActionListener(this);
819
+
820
+ editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
821
+ unselectButton.setToolTipText("Unselect");
581822 unselectButton.addActionListener(this);
582823
824
+ editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
825
+ flashSelectionButton.setToolTipText("Highlight selection");
826
+ flashSelectionButton.addActionListener(this);
827
+
828
+ editCommandsPanel.preferredHeight = 1;
829
+
830
+ SetPinStates(false);
831
+// oe.treePanel.add(commandsPanel);
832
+// oe.treePanel.Return();
833
+
583834 // oe.aConstraints.gridx += 1;
584835 // oe.aConstraints.weighty = 0;
585836 // oe.aConstraints.gridwidth = 1;
....@@ -591,40 +842,25 @@
591842 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
592843 // gcButton.addActionListener(this);
593844
594
- oe.aConstraints.gridx = 0;
595
- oe.aConstraints.gridy += 1;
596
-
597
- //ctrlPanel.add(objList = new List(5, true));
598
- oe.aConstraints.gridwidth = 100;
599
- // oe.aConstraints.gridheight = 100;
600
- oe.aConstraints.fill = GridBagConstraints.BOTH; // HORIZONTAL;
601
- oe.aConstraints.gridheight = 1;
602
- oe.aConstraints.weighty = 0.5;
603
- oe.aConstraints.gridx = 0;
604
- JScrollPane jSP;
845
+ cGridBag jSPPanel = new cGridBag();
846
+
847
+ JScrollPane jSP;
605848 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
606
- oe.treePanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null)), oe.aConstraints);
849
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree)); //, oe.aConstraints);
607850 ResetModel();
608
- oe.aConstraints.weighty = 0.5;
609
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
610
- oe.aConstraints.gridy += 1;
611
- oe.aConstraints.gridwidth = 1;
612
-
613
- oe.aConstraints.weighty = 0;
614
- oe.aConstraints.gridwidth = 2;
615
-
616
- oe.treePanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0), oe.aConstraints);
617
- colorCB.addItemListener(this);
618
- oe.aConstraints.gridx += 2;
619
- oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints);
620
- materialCB.addItemListener(this);
621
- oe.aConstraints.gridx += 2;
622
- oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints);
623
- textureCB.addItemListener(this);
624
-
625
- oe.aConstraints.gridx = 0;
626
- oe.aConstraints.gridy += 1;
627851
852
+ oe.treePanel.add(jSPPanel);
853
+ oe.treePanel.Return();
854
+
855
+ oe.treePanel.add(copyOptionsPanel);
856
+ oe.treePanel.Return();
857
+ cGridBag sliderPane = AddSlider(oe.treePanel, "Version", 0, 0, 0);
858
+ versionSlider = (cNumberSlider)sliderPane.getComponent(1);
859
+ sliderPane.preferredHeight = 1;
860
+
861
+// mainPanel.setDividerLocation(0.5); //1.0);
862
+// mainPanel.setResizeWeight(0.5);
863
+
628864 //jList.addListSelectionListener(this);
629865 oe.jTree.addTreeSelectionListener(this);
630866 //jTree.setRootVisible(false);
....@@ -643,23 +879,160 @@
643879 dgr.addDragGestureListener(this);
644880 }catch(Exception e) {}
645881 */
646
- radio.layout = sevenButton;
882
+ radio.layout = sixButton; // sevenButton;
647883 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
648884 }
885
+
886
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
887
+ {
888
+ panel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
889
+ colorCB.setToolTipText("Copy color when dropped");
890
+ colorCB.addItemListener(this);
891
+
892
+ panel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
893
+ materialCB.setToolTipText("Copy material when dropped");
894
+ materialCB.addItemListener(this);
895
+
896
+ panel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
897
+ textureCB.setToolTipText("Copy texture when dropped");
898
+ textureCB.addItemListener(this);
899
+
900
+ panel.Return();
901
+
902
+ panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
903
+ boxCB.setToolTipText("Display bounding boxes");
904
+ boxCB.addItemListener(this);
905
+
906
+ panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
907
+ zoomBoxCB.setToolTipText("Display only for wheel");
908
+ zoomBoxCB.addItemListener(this);
909
+
910
+ if (true) // Globals.ADVANCED)
911
+ {
912
+// panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
913
+// supportCB.setToolTipText("Enable rigging");
914
+// supportCB.addItemListener(this);
915
+
916
+ panel.add(freezeCB = new cCheckBox("Freeze", Globals.FREEZEONMOVE)); //, constraints);
917
+ freezeCB.setToolTipText("Fast moving camera");
918
+ freezeCB.addItemListener(this);
919
+
920
+ // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
921
+ // localCB.addItemListener(this);
922
+
923
+ panel.Return();
924
+
925
+ panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
926
+ crowdCB.setToolTipText("Used for crowds");
927
+ crowdCB.addItemListener(this);
928
+
929
+ panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
930
+ smoothCB.setToolTipText("Snapping delay");
931
+ smoothCB.addItemListener(this);
932
+
933
+ panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
934
+ slowCB.setToolTipText("Smooth interpolation");
935
+ slowCB.addItemListener(this);
936
+
937
+// constraints.gridy += 1;
938
+// panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
939
+// speakerMocapCB.addItemListener(this);
940
+
941
+ panel.Return();
942
+
943
+ if (false)
944
+ {
945
+ // handled in scripts
946
+ //constraints.gridy += 1;
947
+ panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints);
948
+ speakerCameraCB.addItemListener(this);
949
+
950
+ //constraints.gridy += 1;
951
+ panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints);
952
+ speakerFocusCB.addItemListener(this);
953
+
954
+ //constraints.gridy += 1;
955
+ panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
956
+ smoothfocusCB.addItemListener(this);
957
+ panel.Return();
958
+ }
959
+
960
+//constraints.gridx += 1;
961
+//panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
962
+// debugCB.addItemListener(this);
963
+
964
+ panel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
965
+ trackCB.setToolTipText("Enable tracking target");
966
+ trackCB.addItemListener(this);
967
+
968
+ panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
969
+ oeilCB.setToolTipText("Move camera when tracking");
970
+ oeilCB.addItemListener(this);
971
+
972
+ panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints);
973
+ shadowCB.setToolTipText("When live compute shadows");
974
+ shadowCB.addItemListener(this);
975
+
976
+ panel.Return();
977
+ panel.add(toggleTextureCB = new cCheckBox("Textures", CameraPane.textureon)); //, constraints);
978
+ toggleTextureCB.setToolTipText("Load textures");
979
+ toggleTextureCB.addItemListener(this);
980
+
981
+ panel.add(toggleSwitchCB = new cCheckBox("Switch", CameraPane.SWITCH)); //, constraints);
982
+ toggleSwitchCB.setToolTipText("Choose a single item");
983
+ toggleSwitchCB.addItemListener(this);
984
+
985
+ panel.add(autokeepCB = new cCheckBox("Auto-replace", Globals.REPLACEONMAKE)); //, constraints);
986
+ autokeepCB.setToolTipText("On structure change");
987
+ autokeepCB.addItemListener(this);
988
+
989
+ panel.Return();
990
+ if (Globals.ADVANCED)
991
+ {
992
+ panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
993
+ lookAtCB.setToolTipText("Look-at target");
994
+ lookAtCB.addItemListener(this);
995
+ }
996
+
997
+ }
998
+
999
+ cGridBag fill = new cGridBag();
1000
+ fill.preferredHeight = 200;
1001
+ cGridBag fill2 = new cGridBag();
1002
+ fill2.preferredHeight = 200;
1003
+ cGridBag fill3 = new cGridBag();
1004
+ fill3.preferredHeight = 200;
1005
+
1006
+ panel.add(fill);
1007
+ panel.add(fill2);
1008
+ panel.add(fill3);
1009
+
1010
+ }
6491011
6501012 void EditObject(Object3D obj)
6511013 {
652
- cRadio dummyButton = new cRadio(obj.name);
653
- dummyButton.SetObject(obj);
654
- dummyButton.layout = sevenButton;
655
- dummyButton.SetCamera(cameraView.renderCamera, false);
656
- dummyButton.addActionListener(this);
657
- radioPanel.add(dummyButton);
658
- buttonGroup.add(dummyButton);
659
- dummyButton.doClick();
1014
+ cRadio radioButton = new cRadio(obj.name);
1015
+
1016
+ // June 2019. Patch to avoid bug with transparency.
1017
+ radioButton.hadMaterial = obj.material != null;
1018
+ if (!radioButton.hadMaterial)
1019
+ {
1020
+ obj.material = new cMaterial();
1021
+ }
1022
+
1023
+ radioButton.SetObject(obj);
1024
+ radioButton.layout = sixButton; // sevenButton;
1025
+ radioButton.SetCamera(cameraView.renderCamera, false);
1026
+ radioButton.addActionListener(this);
1027
+ radioPanel.add(radioButton);
1028
+ buttonGroup.add(radioButton);
1029
+ radioButton.doClick();
6601030 }
1031
+
6611032 void SetupViews(ObjEditor oe)
6621033 {
1034
+ theFrame = this;
1035
+
6631036 oe.SetupViews();
6641037
6651038 System.out.println("SetupViews");
....@@ -668,22 +1041,28 @@
6681041 /*DropTarget dropTarget =*/ new DropTarget(oe.cameraView, this);
6691042 }
6701043
671
- JCheckBox liveCB;
672
- JCheckBox supportCB;
673
- JCheckBox localCB;
674
- JCheckBox crowdCB;
675
- JCheckBox smoothCB;
676
- JCheckBox fastCB;
677
- JCheckBox slowCB;
678
- JCheckBox boxCB;
679
- JCheckBox trackCB;
680
- JCheckBox smoothfocusCB;
1044
+ cToggleButton liveCB;
1045
+ cCheckBox supportCB;
1046
+ cCheckBox localCB;
1047
+ cCheckBox crowdCB;
1048
+ cCheckBox smoothCB;
1049
+ cToggleButton fastCB;
1050
+ cCheckBox slowCB;
1051
+ cCheckBox boxCB;
1052
+ cCheckBox zoomBoxCB;
1053
+ cCheckBox freezeCB;
1054
+ //cToggleButton trackCB;
1055
+ cCheckBox trackCB;
1056
+ cCheckBox smoothfocusCB;
6811057 // JCheckBox speakerMocapCB;
682
- JCheckBox speakerCameraCB;
683
- JCheckBox speakerFocusCB;
684
- JCheckBox debugCB;
685
- JCheckBox oeilCB;
686
- JCheckBox lookAtCB;
1058
+ cCheckBox speakerCameraCB;
1059
+ cCheckBox speakerFocusCB;
1060
+ cCheckBox debugCB;
1061
+
1062
+ cCheckBox oeilCB;
1063
+ cCheckBox shadowCB;
1064
+ cCheckBox autokeepCB;
1065
+ cCheckBox lookAtCB;
6871066
6881067 // static int COLOR = 1;
6891068 // static int MATERIAL = 2;
....@@ -691,9 +1070,9 @@
6911070
6921071 int dropAttributes = Object3D.COLOR | Object3D.MATERIAL;
6931072
694
- JCheckBox colorCB;
695
- JCheckBox materialCB;
696
- JCheckBox textureCB;
1073
+ cCheckBox colorCB;
1074
+ cCheckBox materialCB;
1075
+ cCheckBox textureCB;
6971076
6981077 public void itemStateChanged(ItemEvent e)
6991078 {
....@@ -721,6 +1100,7 @@
7211100 } else if(e.getSource() == liveCB)
7221101 {
7231102 cameraView.ToggleLive();
1103
+ refreshContents(false);
7241104 }
7251105 else if(e.getSource() == supportCB)
7261106 {
....@@ -756,6 +1136,10 @@
7561136 cameraView.repaint();
7571137 // refreshContents();
7581138 }
1139
+ else if(e.getSource() == zoomBoxCB)
1140
+ {
1141
+ cameraView.ToggleZoomBoxMode();
1142
+ }
7591143 else if(e.getSource() == smoothfocusCB)
7601144 {
7611145 cameraView.ToggleSmoothFocus();
....@@ -781,6 +1165,18 @@
7811165 {
7821166 cameraView.ToggleOeil();
7831167 }
1168
+ else if(e.getSource() == shadowCB)
1169
+ {
1170
+ Globals.COMPUTESHADOWWHENLIVE ^= true;
1171
+ }
1172
+ else if(e.getSource() == freezeCB)
1173
+ {
1174
+ Globals.FREEZEONMOVE ^= true;
1175
+ }
1176
+ else if(e.getSource() == autokeepCB)
1177
+ {
1178
+ Globals.REPLACEONMAKE ^= true;
1179
+ }
7841180 else if(e.getSource() == lookAtCB)
7851181 {
7861182 cameraView.ToggleLookAt();
....@@ -797,7 +1193,8 @@
7971193
7981194 /**/
7991195 //DragSource.getDefaultDragSource().startDrag(dge, DragSource.DefaultMoveNoDrop, new StringSelection("Allo"), this);
800
- TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1196
+ //TreePath path = new TreePath(objEditor.jTree.getSelectionPath().getLastPathComponent());
1197
+ TreePath path = objEditor.jTree.getSelectionPath();
8011198 if ((path == null) || (path.getPathCount() <= 1)) {
8021199 // We can't move the root node or an empty selection
8031200 return;
....@@ -860,8 +1257,6 @@
8601257 }
8611258 }
8621259
863
- String string = (String) object;
864
-
8651260 System.out.println("Transfer = " + object + "; drop : " + target);
8661261 // if( object instanceof java.io.File[])
8671262 // {
....@@ -869,7 +1264,11 @@
8691264 // objEditor.DropFile((java.io.File[]) object, true);
8701265 // return;
8711266 // }
872
- if (string.charAt(0) == '/')
1267
+
1268
+ String string = object.toString();
1269
+
1270
+ // File path for Mac and Windows
1271
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
8731272 {
8741273 // file(s)
8751274 String[] names = string.split("\n");
....@@ -896,7 +1295,7 @@
8961295
8971296 flashIt = false;
8981297 CameraPane pane = (CameraPane) target;
899
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1298
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
9001299 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
9011300
9021301 if (group.selection.size() == 1)
....@@ -912,23 +1311,33 @@
9121311
9131312 assert target == objEditor.jTree;
9141313 TreePath destinationPath = objEditor.jTree.getPathForLocation(objEditor.location.x, objEditor.location.y);
1314
+ Object3D destinationLeaf;
9151315 try {
916
- Object3D dummy = (Composite) destinationPath.getLastPathComponent();
1316
+ destinationLeaf = (Composite) destinationPath.getLastPathComponent();
9171317 } catch (Exception e) {
9181318 System.out.println("destinationPath : " + destinationPath);
9191319 return;
9201320 }
9211321
922
- if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1322
+ for (int i=group.selection.size(); --i>=0;)
9231323 {
1324
+ Object3D child = (Object3D)group.selection.elementAt(i);
1325
+
1326
+ // Cannot move into itself
1327
+ if (child == destinationLeaf)
1328
+ return;
1329
+ }
1330
+
1331
+// june 2019 if (dtde.getDropAction() == DnDConstants.ACTION_MOVE) // ?? LINK)
1332
+// {
9241333 loadClipboard(true);
9251334 objEditor.jTree.setSelectionPath(destinationPath);
926
- pasteInto(false);
927
- } else {
928
- loadClipboard(false);
929
- objEditor.jTree.setSelectionPath(destinationPath);
930
- pasteInto(false); // true); // ???
931
- }
1335
+ pasteInto(false, false);
1336
+// } else {
1337
+// loadClipboard(false);
1338
+// objEditor.jTree.setSelectionPath(destinationPath);
1339
+// pasteInto(false, false); // true); // ???
1340
+// }
9321341 }
9331342 public void dropActionChanged(DropTargetDragEvent dtde)
9341343 // Called if the user has modified the current drop gesture
....@@ -1033,85 +1442,107 @@
10331442 {
10341443 //heightFieldItem = menu.add(new MenuItem("Height Field"));
10351444 //heightFieldItem.addActionListener(this);
1036
- gridItem = menu.add(new MenuItem("Grid"));
1037
- gridItem.addActionListener(this);
1038
- rectoidItem = menu.add(new MenuItem("Box"));
1039
- rectoidItem.addActionListener(this);
1040
- ellipsoidItem = menu.add(new MenuItem("Sphere"));
1041
- ellipsoidItem.addActionListener(this);
1042
- coneItem = menu.add(new MenuItem("Cone"));
1043
- coneItem.addActionListener(this);
1044
- torusItem = menu.add(new MenuItem("Torus"));
1045
- torusItem.addActionListener(this);
1046
- superItem = menu.add(new MenuItem("Superellipsoid"));
1047
- superItem.addActionListener(this);
1445
+// gridItem = menu.add(new MenuItem("Grid"));
1446
+// gridItem.addActionListener(this);
1447
+// rectoidItem = menu.add(new MenuItem("Box"));
1448
+// rectoidItem.addActionListener(this);
1449
+// ellipsoidItem = menu.add(new MenuItem("Sphere"));
1450
+// ellipsoidItem.addActionListener(this);
1451
+// coneItem = menu.add(new MenuItem("Cone"));
1452
+// coneItem.addActionListener(this);
1453
+// torusItem = menu.add(new MenuItem("Torus"));
1454
+// torusItem.addActionListener(this);
1455
+// superItem = menu.add(new MenuItem("Superellipsoid"));
1456
+// superItem.addActionListener(this);
1457
+
1458
+ cameraItem = menu.add(new MenuItem("Camera"));
1459
+ cameraItem.addActionListener(this);
1460
+
1461
+ if (!Globals.ADVANCED)
1462
+ {
10481463 kleinItem = menu.add(new MenuItem("Klein Bottle"));
10491464 kleinItem.addActionListener(this);
1050
- particleItem = menu.add(new MenuItem("Particle system"));
1051
- particleItem.addActionListener(this);
1465
+ }
1466
+
1467
+// particleItem = menu.add(new MenuItem("Particle system"));
1468
+// particleItem.addActionListener(this);
1469
+ if (Globals.ADVANCED)
1470
+ {
10521471 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10531472 ragdollItem.addActionListener(this);
10541473 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10551474 ragdoll2Item.addActionListener(this);
1475
+ }
10561476 menu.add("-");
1057
- meshItem = menu.add(new MenuItem("Mesh"));
1477
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10581478 meshItem.addActionListener(this);
10591479 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10601480 // meshGroupItem.addActionListener(this);
1481
+ if (Globals.ADVANCED)
1482
+ {
10611483 springItem = menu.add(new MenuItem("Spring"));
10621484 springItem.addActionListener(this);
10631485 flagItem = menu.add(new MenuItem("Flag"));
10641486 flagItem.addActionListener(this);
1065
- bezierItem = menu.add(new MenuItem("Patch"));
1066
- bezierItem.addActionListener(this);
1067
- checkerItem = menu.add(new MenuItem("Checker"));
1068
- checkerItem.addActionListener(this);
10691487 blobItem = menu.add(new MenuItem("Blob"));
10701488 blobItem.addActionListener(this);
10711489 latheItem = menu.add(new MenuItem("Lathe"));
10721490 latheItem.addActionListener(this);
1073
- lightItem = menu.add(new MenuItem("Light"));
1074
- lightItem.addActionListener(this);
1491
+ }
1492
+ bezierItem = menu.add(new MenuItem("Bezier Patch"));
1493
+ bezierItem.addActionListener(this);
1494
+// overlayItem = menu.add(new MenuItem("Overlay"));
1495
+// overlayItem.addActionListener(this);
1496
+// lightItem = menu.add(new MenuItem("Light"));
1497
+// lightItem.addActionListener(this);
10751498 menu.add("-");
10761499 //superLoopItem = menu.add(new MenuItem("Super Loop"));
10771500 //superLoopItem.addActionListener(this);
1078
- loopItem = menu.add(new MenuItem("Loop"));
1079
- loopItem.addActionListener(this);
1501
+// loopItem = menu.add(new MenuItem("Loop"));
1502
+// loopItem.addActionListener(this);
10801503 doubleItem = menu.add(new MenuItem("Fork"));
10811504 doubleItem.addActionListener(this);
1505
+ if (Globals.ADVANCED)
1506
+ {
10821507 tripleItem = menu.add(new MenuItem("Trident"));
10831508 tripleItem.addActionListener(this);
1509
+ }
10841510 }
10851511
10861512 void buildToolsMenu(Menu menu)
10871513 {
10881514 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
10891515 animationItem.addItemListener(this);
1090
- animationItem.setState(CameraPane.ANIMATION);
1516
+ animationItem.setState(Globals.ANIMATION);
1517
+
1518
+ menu.add(archiveItem = new MenuItem("Archive3D..."));
1519
+ archiveItem.addActionListener(this);
10911520
10921521 menu.add("-");
10931522 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
10941523 parseverticesItem.addActionListener(this);
10951524 textureFieldItem = menu.add(new MenuItem("Texture Field"));
10961525 textureFieldItem.addActionListener(this);
1097
- alignItem = menu.add(new MenuItem("Align"));
1526
+ alignItem = menu.add(new MenuItem("Align Objects"));
10981527 alignItem.addActionListener(this);
1099
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1100
- mirrorItem.addActionListener(this);
11011528 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
11021529 reduceMorphItem.addActionListener(this);
11031530 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
11041531 reduce34MorphItem.addActionListener(this);
1105
-
1106
- menu.add(computeAOItem = new MenuItem("Compute AO"));
1107
- computeAOItem.addActionListener(this);
11081532 menu.add("-");
1109
-
11101533 menu.add(memoryItem = new MenuItem("Memory Usage"));
11111534 memoryItem.addActionListener(this);
1535
+ menu.add(computeAOItem = new MenuItem("Compute AO"));
1536
+ computeAOItem.addActionListener(this);
1537
+
1538
+ if (Globals.ADVANCED)
1539
+ {
1540
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1541
+ mirrorItem.addActionListener(this);
1542
+ menu.add("-");
11121543 menu.add(analyzeItem = new MenuItem("Analyze"));
11131544 analyzeItem.addActionListener(this);
1114
- menu.add(dumpItem = new MenuItem("Dump"));
1545
+ menu.add(dumpItem = new MenuItem("Print"));
11151546 dumpItem.addActionListener(this);
11161547 // menu.add(pathItem = new MenuItem("From-to path"));
11171548 // pathItem.addActionListener(this);
....@@ -1120,6 +1551,8 @@
11201551 resetParentItem.addActionListener(this);
11211552 repairParentItem = menu.add(new MenuItem("Repair Parent"));
11221553 repairParentItem.addActionListener(this);
1554
+ repairShadowItem = menu.add(new MenuItem("Repair Shadow"));
1555
+ repairShadowItem.addActionListener(this);
11231556 menu.add(invariantsItem = new MenuItem("Invariants"));
11241557 invariantsItem.addActionListener(this);
11251558 menu.add(recompileItem = new MenuItem("Recompile"));
....@@ -1127,6 +1560,7 @@
11271560 menu.add("-");
11281561 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11291562 editScriptItem.addActionListener(this);
1563
+ }
11301564 }
11311565
11321566 void ScreenFit()
....@@ -1249,9 +1683,34 @@
12491683 shadow.material = new cMaterial(obj.material);
12501684 shadow.material.diffuse = 0.0001f;
12511685 shadow.material.specular = 0.0001f;
1686
+ //shadow.projectedVertices[1].x = 300;
12521687
12531688 makeSomething(shadow);
12541689 }
1690
+
1691
+ private void ClearUnpinned()
1692
+ {
1693
+ //for (Object3D obj : listUI)
1694
+ for (int i=listUI.size(); --i>=0;)
1695
+ {
1696
+ Object3D obj = listUI.elementAt(i);
1697
+ if (!obj.pinned)
1698
+ {
1699
+ obj.CloseUI();
1700
+ listUI.remove(i);
1701
+ }
1702
+ }
1703
+ }
1704
+
1705
+ private void EditElement(Object3D elem, boolean newWindow)
1706
+ {
1707
+ // if (!(elem instanceof Composite))
1708
+ // newWindow = false;
1709
+ listUI.add(elem);
1710
+ elem.openEditWindow(this, newWindow); //, false);
1711
+ System.out.println("edit : " + elem);
1712
+ elem.editWindow.refreshContents(true); // ? new
1713
+ }
12551714
12561715 /**
12571716 * applyExample
....@@ -1455,9 +1914,9 @@
14551914
14561915 void Overwrite(int mask)
14571916 {
1458
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
1917
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14591918 {
1460
- Object3D content = GrafreeD.clipboard.get(0);
1919
+ Object3D content = Grafreed.clipboard.get(0);
14611920
14621921 if (content instanceof cGroup && ((cGroup)content).transientlink )
14631922 content = ((cGroup)content).get(0);
....@@ -1480,6 +1939,7 @@
14801939 //
14811940 public void actionPerformed(ActionEvent event) // , Object arg)
14821941 {
1942
+ Object source = event.getSource();
14831943 /*
14841944 if (event.getSource() == nameField)
14851945 {
....@@ -1491,11 +1951,11 @@
14911951 }
14921952 else
14931953 */
1494
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1954
+ if (source == lookAtItem || source == lookFromItem)
14951955 {
14961956 ScreenFit();
14971957 } else
1498
- if (event.getSource() == switchItem)
1958
+ if (source == switchViewItem)
14991959 {
15001960 cVector v1 = new cVector();
15011961 cVector v2 = new cVector();
....@@ -1504,11 +1964,11 @@
15041964 objEditor.cameraView.renderCamera.setAim(v2, v1);
15051965 objEditor.cameraView.repaint();
15061966 } else
1507
- if (event.getSource() == rectoidItem)
1967
+ if (source == rectoidItem || source == boxButton)
15081968 {
15091969 makeSomething(new Box());
15101970 } else
1511
- if (event.getSource() == particleItem)
1971
+ if (source == particleItem || source == particlesButton)
15121972 {
15131973 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15141974 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1529,9 +1989,9 @@
15291989 applyExample(particleGeom, "SMOKE");
15301990 makeSomething(particleGeom);
15311991 } else
1532
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1992
+ if (source == ragdollItem || source == ragdoll2Item)
15331993 {
1534
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1994
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15351995
15361996 ragdoll.toParent = LA.newMatrix();
15371997 ragdoll.fromParent = LA.newMatrix();
....@@ -1549,7 +2009,7 @@
15492009 } else
15502010 /*
15512011 */
1552
- if (event.getSource() == heightFieldItem)
2012
+ if (source == heightFieldItem)
15532013 {
15542014 Object3D obj = new Object3D();
15552015
....@@ -1587,31 +2047,31 @@
15872047
15882048 makeSomething(obj);
15892049 } else
1590
- if (event.getSource() == gridItem)
2050
+ if (source == gridItem || source == gridButton)
15912051 {
15922052 makeSomething(new Grid());
15932053 } else
1594
- if (event.getSource() == ellipsoidItem)
2054
+ if (source == ellipsoidItem || source == sphereButton)
15952055 {
15962056 makeSomething(new Sphere());
15972057 } else
1598
- if (event.getSource() == coneItem)
2058
+ if (source == coneItem || source == coneButton)
15992059 {
16002060 makeSomething(new Cone());
16012061 } else
1602
- if (event.getSource() == torusItem)
2062
+ if (source == torusItem || source == torusButton)
16032063 {
16042064 makeSomething(new Torus());
16052065 } else
1606
- if (event.getSource() == superItem)
2066
+ if (source == superItem || source == superButton)
16072067 {
16082068 makeSomething(new Superellipsoid());
16092069 } else
1610
- if (event.getSource() == kleinItem)
2070
+ if (source == kleinItem || source == kleinButton)
16112071 {
16122072 makeSomething(new Klein());
16132073 } else
1614
- if (event.getSource() == blobItem)
2074
+ if (source == blobItem)
16152075 {
16162076 Blob blob = new Blob();
16172077 BlobComponent comp = new BlobComponent();
....@@ -1619,15 +2079,15 @@
16192079 //blob.retile();
16202080 makeSomething(blob);
16212081 } else
1622
- if (event.getSource() == latheItem)
2082
+ if (source == latheItem)
16232083 {
16242084 makeSomething(new Lathe());
16252085 } else
1626
- if (event.getSource() == bezierItem)
2086
+ if (source == bezierItem)
16272087 {
16282088 makeSomething(new BezierSurface());
16292089 } else
1630
- if (event.getSource() == checkerItem)
2090
+ if (source == overlayItem || source == overlayButton)
16312091 {
16322092 /*
16332093 Object3D obj = new BezierSurface(5,8);
....@@ -1642,7 +2102,7 @@
16422102 */
16432103 makeSomething(new Checker());
16442104 } else
1645
- if (event.getSource() == meshItem)
2105
+ if (source == meshItem)
16462106 {
16472107 Object3D itemtomake = new Object3D();
16482108 Object3D child;
....@@ -1663,35 +2123,35 @@
16632123 makeSomething(child);
16642124 }
16652125 } else
1666
- if (event.getSource() == springItem)
2126
+ if (source == springItem)
16672127 {
16682128 cSpring s = new cSpring();
16692129 s.setup();
16702130 makeSomething(s);
16712131 } else
1672
- if (event.getSource() == flagItem)
2132
+ if (source == flagItem)
16732133 {
16742134 cSpring s = new cFlag();
16752135 s.setup();
16762136 makeSomething(s);
16772137 } else
1678
- if (event.getSource() == lightItem)
2138
+ if (source == lightItem || source == lightButton)
16792139 {
16802140 makeSomething(new Light());
16812141 } else
1682
- if (event.getSource() == csgItem)
2142
+ if (source == csgItem)
16832143 {
16842144 group(new CSG());
16852145 } else
1686
- if (event.getSource() == templateItem)
2146
+ if (source == templateItem)
16872147 {
16882148 group(new cTemplate());
16892149 } else
1690
- if (event.getSource() == attributeItem)
2150
+ if (source == attributeItem)
16912151 {
16922152 makeSomething(new Attribute());
16932153 } else
1694
- if (event.getSource() == pointflowItem)
2154
+ if (source == pointflowItem)
16952155 {
16962156 makeSomething(new PointFlow());
16972157 } else
....@@ -1703,7 +2163,7 @@
17032163 } else
17042164 */
17052165
1706
- if (event.getSource() == superLoopItem)
2166
+ if (source == superLoopItem)
17072167 {
17082168 Composite g = new cGroup();
17092169 for (int i=0; i<15; i++)
....@@ -1725,30 +2185,30 @@
17252185
17262186 group(g);
17272187 } else
1728
- if (event.getSource() == loopItem)
2188
+ if (source == loopItem || source == loopButton)
17292189 {
17302190 Composite csg = new GroupLeaf();
17312191 csg.count = 5;
17322192 group(csg);
1733
- Composite child = new cGroup();
2193
+ Composite child = new cGroup("Branch");
17342194 csg.addChild(child);
17352195 child.addChild(csg);
17362196 } else
1737
- if (event.getSource() == doubleItem)
2197
+ if (source == doubleItem)
17382198 {
1739
- Composite csg = new GroupLeaf();
2199
+ Composite csg = new GroupLeaf("Fork");
17402200 csg.count = 5;
17412201 group(csg);
1742
- Composite child = new cGroup();
2202
+ Composite child = new cGroup("Branch A");
17432203 csg.addChild(child);
17442204 child.addChild(csg);
1745
- child = new cGroup();
2205
+ child = new cGroup("Branch B");
17462206 csg.addChild(child);
17472207 child.addChild(csg);
17482208 } else
1749
- if (event.getSource() == tripleItem)
2209
+ if (source == tripleItem)
17502210 {
1751
- Composite csg = new GroupLeaf();
2211
+ Composite csg = new GroupLeaf("Trident");
17522212 csg.count = 4;
17532213 group(csg);
17542214 Composite child = new cGroup();
....@@ -1761,73 +2221,98 @@
17612221 csg.addChild(child);
17622222 child.addChild(csg);
17632223 } else
1764
-
1765
- if (event.getSource() == importGFDItem)
2224
+ if (source == computeAOItem)
17662225 {
1767
- ImportGFD();
2226
+ Globals.drawMode = CameraPane.OCCLUSION;
2227
+ Globals.theRenderer.repaint();
17682228 } else
1769
- if (event.getSource() == importVRMLX3DItem)
1770
- {
1771
- ImportVRMLX3D();
1772
- } else
1773
- if (event.getSource() == import3DSItem)
1774
- {
1775
- objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
1776
- } else
1777
- if (event.getSource() == importOBJItem)
1778
- {
1779
- objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1780
- } else
1781
- if (event.getSource() == computeAOItem)
1782
- {
1783
- CameraPane.drawMode = CameraPane.OCCLUSION;
1784
- CameraPane.theRenderer.repaint();
1785
- } else
1786
- if (event.getSource() == recompileItem)
2229
+ if (source == recompileItem)
17872230 {
17882231 Recompile();
17892232 refreshContents();
17902233 } else
1791
- if (event.getSource() == editScriptItem)
2234
+ if (source == editScriptItem)
17922235 {
17932236 OpenDialog();
17942237 refreshContents();
17952238 } else
1796
- if (event.getSource() == invariantsItem)
2239
+ if (source == invariantsItem)
17972240 {
17982241 System.out.println("Invariants:");
1799
- GrafreeD.grafreeD.universe.invariants();
2242
+ Grafreed.grafreeD.universe.invariants();
18002243 } else
1801
- if (event.getSource() == memoryItem)
2244
+ if (source == memoryItem)
18022245 {
18032246 //System.out.println("Invariants:");
18042247 PrintMemory();
18052248 } else
1806
- if (event.getSource() == pathItem)
2249
+ if (source == pathItem)
18072250 {
18082251 PrintPath();
18092252 } else
1810
- if (event.getSource() == analyzeItem)
2253
+ if (source == analyzeItem)
18112254 {
18122255 AnalyzeObject();
18132256 } else
1814
- if (event.getSource() == dumpItem)
2257
+ if (source == dumpItem)
18152258 {
18162259 DumpObject();
18172260 } else
1818
- if (event.getSource() == screenfitButton)
2261
+ if (source == minButton)
18192262 {
1820
- //Reload(lastConverter, lastFilename, true);
2263
+ Minimize();
2264
+ } else
2265
+ if (source == maxButton)
2266
+ {
2267
+ Maximize();
2268
+ } else
2269
+ if (source == fullButton)
2270
+ {
2271
+ ToggleFullScreen();
2272
+ } else
2273
+ if (source == undoButton)
2274
+ {
2275
+ // Go to previous version
2276
+ //if (!Undo())
2277
+ //java.awt.Toolkit.getDefaultToolkit().beep();
2278
+ Undo();
2279
+ } else
2280
+ if (source == restoreButton)
2281
+ {
2282
+ // Restore current version
2283
+ Restore();
2284
+ } else
2285
+ if (source == replaceButton)
2286
+ {
2287
+ // Overwrite current version
2288
+ Replace();
2289
+ } else
2290
+ if (source == redoButton)
2291
+ {
2292
+ // Go to next version
2293
+ Redo();
2294
+ } else
2295
+ if (source == saveButton)
2296
+ {
2297
+ // Save a new version
2298
+ if (!Save(true))
2299
+ java.awt.Toolkit.getDefaultToolkit().beep();
2300
+ } else
2301
+ if (source == oneStepButton)
2302
+ {
2303
+ Globals.ONESTEP = true;
2304
+ cameraView.repaint();
2305
+ } else
2306
+ if (source == screenfitButton)
2307
+ {
18212308 ScreenFit();
18222309 } else
1823
- if (event.getSource() == screenfitpointButton)
2310
+ if (source == screenfitpointButton)
18242311 {
1825
- //Reload(lastConverter, lastFilename, true);
18262312 ScreenFitPoint();
18272313 } else
1828
- if (event.getSource() == snapobjectButton)
2314
+ if (source == snapobjectButton)
18292315 {
1830
- //Reload(lastConverter, lastFilename, true);
18312316 SnapObject();
18322317 } else
18332318 // if (event.getSource() == recompileButton)
....@@ -1836,13 +2321,13 @@
18362321 // Recompile();
18372322 // refreshContents();
18382323 // } else
1839
- if (event.getSource() == gcButton)
2324
+ if (source == gcButton)
18402325 {
18412326 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18422327 System.gc();
18432328 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18442329 } else
1845
- if (event.getSource() == editLeafItem)
2330
+ if (source == editLeafItem)
18462331 {
18472332 Object3D obj;
18482333 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1856,62 +2341,74 @@
18562341 }
18572342 refreshContents(true);
18582343 } else
1859
- if (event.getSource() == openWindowItem)
2344
+ if (source == openWindowItem)
18602345 {
18612346 EditSelection(true);
18622347 } else
1863
- if (event.getSource() == cutItem || event.getSource() == clearButton)
2348
+ if (source == cutItem || source == clearButton)
18642349 {
18652350 loadClipboard(true);
18662351 } else
1867
- if (event.getSource() == duplicateItem)
2352
+ if (source == undoItem)
18682353 {
1869
- Object3D keep = GrafreeD.clipboard;
2354
+ Undo();
2355
+ } else
2356
+ if (source == redoItem)
2357
+ {
2358
+ Redo();
2359
+ } else
2360
+ if (source == duplicateItem)
2361
+ {
2362
+ Object3D keep = Grafreed.clipboard;
18702363 loadClipboard(false);
18712364 paste(false);
1872
- GrafreeD.clipboard = keep;
2365
+ Grafreed.clipboard = keep;
18732366 } else
1874
- if (event.getSource() == cloneItem)
2367
+ if (source == cloneItem)
18752368 {
18762369 CloneSelection(false);
18772370 } else
1878
- if (event.getSource() == cloneSupportItem)
2371
+ if (source == cloneSupportItem)
18792372 {
18802373 CloneSelection(true);
18812374 } else
1882
- if (event.getSource() == copyItem)
2375
+ if (source == copyItem)
18832376 {
18842377 loadClipboard(false);
18852378 } else
1886
- if (event.getSource() == pasteItem)
2379
+ if (source == pasteItem)
18872380 {
18882381 paste(false);
18892382 } else
1890
- if (event.getSource() == pasteLinkItem)
2383
+ if (source == pasteIntoItem)
18912384 {
1892
- pasteInto(false);
2385
+ pasteInto(true, false);
18932386 } else
1894
- if (event.getSource() == pasteCloneItem)
2387
+ if (source == pasteLinkItem)
18952388 {
1896
- pasteInto(true);
2389
+ pasteInto(false, false);
18972390 } else
1898
- if (event.getSource() == pasteExpandItem)
2391
+ if (source == pasteCloneItem)
2392
+ {
2393
+ pasteInto(true, true);
2394
+ } else
2395
+ if (source == pasteExpandItem)
18992396 {
19002397 paste(true);
19012398 } else
1902
- if (event.getSource() == synchronizeItem)
2399
+ if (source == synchronizeItem)
19032400 {
19042401 Overwrite(Object3D.TRANSFORM);
19052402 } else
1906
- if (event.getSource() == overwriteNameItem)
2403
+ if (source == overwriteNameItem)
19072404 {
19082405 Overwrite(Object3D.NAME);
19092406 } else
1910
- if (event.getSource() == overwriteUVItem)
2407
+ if (source == overwriteUVItem)
19112408 {
19122409 Overwrite(Object3D.UV);
19132410 } else
1914
- if (event.getSource() == overwriteMatItem)
2411
+ if (source == overwriteMatItem)
19152412 {
19162413 /* july 2015
19172414 if ((dropAttributes & Object3D.TEXTURE) == 0)
....@@ -1931,7 +2428,7 @@
19312428
19322429 Overwrite(dropAttributes);
19332430 }
1934
- if (event.getSource() == overwriteGeoItem)
2431
+ if (source == overwriteGeoItem)
19352432 {
19362433 Overwrite(Object3D.GEOMETRY);
19372434 // if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
....@@ -1948,7 +2445,7 @@
19482445 // refreshContents();
19492446 // }
19502447 } else
1951
- if (event.getSource() == generateMeshItem)
2448
+ if (source == generateMeshItem)
19522449 {
19532450 //if (group.selection.size() == 1)
19542451 // for (int i=0; i<group.selection.size(); i++)
....@@ -1959,7 +2456,7 @@
19592456 ResetModel();
19602457 refreshContents();
19612458 } else
1962
- if (event.getSource() == extractGeometriesItem)
2459
+ if (source == extractGeometriesItem)
19632460 {
19642461 boolean one = false;
19652462
....@@ -1986,7 +2483,7 @@
19862483 ResetModel();
19872484 refreshContents();
19882485 } else
1989
- if (event.getSource() == cloneGeometriesItem)
2486
+ if (source == cloneGeometriesItem)
19902487 {
19912488 boolean one = false;
19922489
....@@ -2012,7 +2509,7 @@
20122509 ResetModel();
20132510 refreshContents();
20142511 } else
2015
- if (event.getSource() == shareGeometriesItem)
2512
+ if (source == shareGeometriesItem)
20162513 {
20172514 boolean one = false;
20182515
....@@ -2042,7 +2539,7 @@
20422539 refreshContents();
20432540 }
20442541 } else
2045
- if (event.getSource() == mergeGeometriesItem)
2542
+ if (source == mergeGeometriesItem)
20462543 {
20472544 boolean one = false;
20482545
....@@ -2072,7 +2569,7 @@
20722569 ResetModel();
20732570 refreshContents();
20742571 } else
2075
- if (event.getSource() == linkverticesItem)
2572
+ if (source == linkverticesItem)
20762573 {
20772574 // if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
20782575 // {
....@@ -2085,48 +2582,48 @@
20852582 // group.selection.get(0).setMasterThis(content); // should be identity
20862583 // refreshContents();
20872584 // }
2088
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2585
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
20892586 {
2090
- Object3D content = GrafreeD.clipboard.get(0);
2587
+ Object3D content = Grafreed.clipboard.get(0);
20912588
20922589 if (content instanceof cGroup && ((cGroup)content).transientlink )
20932590 content = ((cGroup)content).get(0);
20942591
2095
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
2592
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
20962593 for (int i=0; i<group.selection.size(); i++)
20972594 {
2098
- boolean random = CameraPane.RANDOM;
2099
- CameraPane.RANDOM = false; // parse all random nodes
2595
+ boolean random = CameraPane.SWITCH;
2596
+ CameraPane.SWITCH = false; // parse all random nodes
21002597 group.selection.get(i).linkVerticesThis(content);
21012598 // group.selection.get(i).setMasterThis(content); // should be identity
2102
- CameraPane.RANDOM = random;
2599
+ CameraPane.SWITCH = random;
21032600 }
2104
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
2601
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
21052602 refreshContents();
21062603 }
21072604 } else
2108
- if (event.getSource() == resetsupportItem)
2605
+ if (source == resetsupportItem)
21092606 {
21102607 for (int i=0; i<group.selection.size(); i++)
21112608 {
2112
- boolean random = CameraPane.RANDOM;
2113
- CameraPane.RANDOM = false; // parse all random nodes
2609
+ boolean random = CameraPane.SWITCH;
2610
+ CameraPane.SWITCH = false; // parse all random nodes
21142611 group.selection.get(i).linkVerticesThis(null);
2115
- CameraPane.RANDOM = random;
2612
+ CameraPane.SWITCH = random;
21162613 }
21172614
21182615 refreshContents();
21192616 } else
2120
- if (event.getSource() == relinkverticesItem)
2617
+ if (source == relinkverticesItem)
21212618 {
2122
- boolean random = CameraPane.RANDOM;
2123
- CameraPane.RANDOM = false; // parse all random nodes
2619
+ boolean random = CameraPane.SWITCH;
2620
+ CameraPane.SWITCH = false; // parse all random nodes
21242621 group.selection.RelinkToSupport();
2125
- CameraPane.RANDOM = random;
2622
+ CameraPane.SWITCH = random;
21262623
21272624 refreshContents();
21282625 } else
2129
- if (event.getSource() == resetreferencesItem)
2626
+ if (source == resetreferencesItem)
21302627 {
21312628 for (int i=0; i<group.selection.size(); i++)
21322629 {
....@@ -2135,11 +2632,11 @@
21352632
21362633 refreshContents();
21372634 } else
2138
- if (event.getSource() == setMasterItem)
2635
+ if (source == setMasterItem)
21392636 {
2140
- if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
2637
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
21412638 {
2142
- Object3D content = GrafreeD.clipboard.get(0);
2639
+ Object3D content = Grafreed.clipboard.get(0);
21432640
21442641 if (content instanceof cGroup && ((cGroup)content).transientlink )
21452642 content = ((cGroup)content).get(0);
....@@ -2148,13 +2645,13 @@
21482645 refreshContents();
21492646 }
21502647 } else
2151
- if (event.getSource() == poseMeshItem)
2648
+ if (source == poseMeshItem)
21522649 {
21532650 if (group.selection.size() == 1)
21542651 {
2155
- if (GrafreeD.clipboard.size() == 1)
2652
+ if (Grafreed.clipboard.size() == 1)
21562653 {
2157
- Object3D content = GrafreeD.clipboard.get(0);
2654
+ Object3D content = Grafreed.clipboard.get(0);
21582655
21592656 if (content instanceof cGroup && ((cGroup)content).transientlink )
21602657 content = ((cGroup)content).get(0);
....@@ -2167,19 +2664,19 @@
21672664 }
21682665
21692666 } else
2170
- if (event.getSource() == revertMeshItem)
2667
+ if (source == revertMeshItem)
21712668 {
21722669 RevertMeshes();
21732670 } else
2174
- if (event.getSource() == resetMeshItem)
2671
+ if (source == resetAllItem)
21752672 {
21762673 ResetAll();
21772674 } else
2178
- if (event.getSource() == stepAllItem)
2675
+ if (source == stepAllItem)
21792676 {
21802677 StepAll();
21812678 } else
2182
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2679
+ if (source == deleteItem) // || event.getSource() == clearButton)
21832680 {
21842681 //int indices[] = jList.getSelectedIndices();
21852682 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2187,46 +2684,46 @@
21872684
21882685 ClearSelection(false);
21892686 } else
2190
- if (event.getSource() == clearAllItem)
2687
+ if (source == clearAllItem)
21912688 {
21922689 ClearSelection(true);
21932690 } else
2194
- if (event.getSource() == grabItem)
2691
+ if (source == grabItem || source == groupButton)
21952692 {
2196
- group(new cGroup(), true);
2693
+ group(new cGroup(), false); // true);
21972694 } else
2198
- if (event.getSource() == hideItem)
2695
+ if (source == hideItem)
21992696 {
22002697 group(new HiddenObject());
22012698 } else
2202
- if (event.getSource() == frontItem)
2699
+ if (source == frontItem)
22032700 {
22042701 front();
22052702 } else
2206
- if (event.getSource() == backItem)
2703
+ if (source == backItem)
22072704 {
22082705 back();
22092706 } else
2210
- if (event.getSource() == cameraItem)
2707
+ if (source == cameraItem)
22112708 {
22122709 makeSomething(new Camera());
22132710 } else
2214
- if (event.getSource() == compositeItem)
2711
+ if (source == compositeItem || source == compositeButton)
22152712 {
22162713 group(new Composite());
22172714 } else
2218
- if (event.getSource() == randomItem)
2715
+ if (source == switchItem || source == switchButton)
22192716 {
22202717 RandomNode random = new RandomNode();
22212718 group(random);
22222719 if (random.size() > 0)
2223
- random.name = random.get(0).name + "Rnd";
2720
+ random.name = random.get(0).name + "Switch";
22242721 } else
2225
- if (event.getSource() == physicsItem)
2722
+ if (source == physicsItem)
22262723 {
22272724 group(new PhysicsNode());
22282725 } else
2229
- if (event.getSource() == frameselectorItem)
2726
+ if (source == frameselectorItem)
22302727 {
22312728 for (int i=0; i<group.selection.size(); i++)
22322729 {
....@@ -2238,7 +2735,7 @@
22382735 ResetModel();
22392736 refreshContents();
22402737 } else
2241
- if (event.getSource() == switchGeoItem)
2738
+ if (source == switchGeoItem)
22422739 {
22432740 for (int i=0; i<group.selection.size(); i++)
22442741 {
....@@ -2250,7 +2747,7 @@
22502747 ResetModel();
22512748 refreshContents();
22522749 } else
2253
- if (event.getSource() == switchTransfoItem)
2750
+ if (source == switchTransfoItem)
22542751 {
22552752 for (int i=0; i<group.selection.size(); i++)
22562753 {
....@@ -2262,7 +2759,7 @@
22622759 ResetModel();
22632760 refreshContents();
22642761 } else
2265
- if (event.getSource() == morphItem)
2762
+ if (source == morphItem)
22662763 {
22672764 for (int i=0; i<group.selection.size(); i++)
22682765 {
....@@ -2274,7 +2771,7 @@
22742771 ResetModel();
22752772 refreshContents();
22762773 } else
2277
- if (event.getSource() == scriptNodeItem)
2774
+ if (source == scriptNodeItem)
22782775 {
22792776 boolean atleastone = false;
22802777
....@@ -2313,215 +2810,252 @@
23132810 }
23142811 }
23152812 } else
2316
- if (event.getSource() == linkerItem)
2813
+ if (source == linkerItem)
23172814 {
23182815 group(new cLinker());
23192816 } else
2320
- if (event.getSource() == textureItem)
2817
+ if (source == textureItem || source == textureButton)
23212818 {
23222819 group(new TextureNode());
23232820 } else
2324
- if (event.getSource() == billboardItem)
2821
+ if (source == billboardItem)
23252822 {
23262823 group(new BillboardNode());
23272824 } else
2328
- if (event.getSource() == shadowXItem)
2825
+ if (source == shadowXItem)
23292826 {
23302827 CastShadow(0);
23312828 } else
2332
- if (event.getSource() == shadowYItem)
2829
+ if (source == shadowYItem)
23332830 {
23342831 CastShadow(1);
23352832 } else
2336
- if (event.getSource() == shadowZItem)
2833
+ if (source == shadowZItem)
23372834 {
23382835 CastShadow(2);
23392836 } else
2340
- if (event.getSource() == ungroupItem)
2837
+ if (source == ungroupItem || source == ungroupButton)
23412838 {
2342
- //ungroup();
2839
+ boolean hasRoot = false;
2840
+
23432841 for (int i=0; i<group.selection.size(); i++)
23442842 {
2345
- Ungroup(group.selection.get(i));
2843
+ if (group.selection.get(i) == group)
2844
+ {
2845
+ hasRoot = true;
2846
+ break;
2847
+ }
23462848 }
23472849
2348
- ClearSelection(false);
2349
-
2350
- refreshContents();
2850
+ if (!hasRoot)
2851
+ {
2852
+ for (int i=0; i<group.selection.size(); i++)
2853
+ {
2854
+ Ungroup(group.selection.get(i));
2855
+ }
2856
+
2857
+ ClearSelection(false);
2858
+
2859
+ refreshContents();
2860
+ }
23512861 } else
2352
- if (event.getSource() == genUVItem)
2862
+ if (source == genUVItem)
23532863 {
23542864 GenUV();
23552865 } else
2356
- if (event.getSource() == genNormalsCADItem)
2866
+ if (source == genNormalsCADItem)
23572867 {
23582868 GenNormals(true);
23592869 } else
2360
- if (event.getSource() == genNormalsMESHItem)
2870
+ if (source == genNormalsMESHItem)
23612871 {
2362
- GenNormals(true); // TODO
2872
+ GenNormalsMESH();
23632873 } else
2364
- if (event.getSource() == genNormalsORGANItem)
2874
+ if (source == genNormalsORGANItem)
23652875 {
23662876 GenNormals(false);
23672877 } else
2368
- if (event.getSource() == genNormalsMINEItem)
2878
+ if (source == genNormalsMINEItem)
23692879 {
23702880 GenNormalsMINE();
23712881 } else
2372
- if (event.getSource() == stripifyItem)
2882
+ if (source == stripifyItem)
23732883 {
23742884 Stripify();
23752885 } else
2376
- if (event.getSource() == unstripifyItem)
2886
+ if (source == unstripifyItem)
23772887 {
23782888 Unstripify();
23792889 } else
2380
- if (event.getSource() == trimItem)
2890
+ if (source == trimItem)
23812891 {
23822892 Trim();
23832893 } else
2384
- if (event.getSource() == untrimItem)
2894
+ if (source == untrimItem)
23852895 {
23862896 Untrim();
23872897 } else
2388
- if (event.getSource() == clearColorsItem)
2898
+ if (source == clearColorsItem)
23892899 {
23902900 ClearColors();
23912901 } else
2392
- if (event.getSource() == clearMaterialsItem)
2902
+ if (source == clearMaterialsItem)
23932903 {
23942904 ClearMaterials();
23952905 } else
2396
- if (event.getSource() == liveleavesItem)
2906
+ if (source == liveleavesItem)
23972907 {
23982908 LiveLeaves(true);
23992909 } else
2400
- if (event.getSource() == unliveleavesItem)
2910
+ if (source == unliveleavesItem)
24012911 {
24022912 LiveLeaves(false);
24032913 } else
2404
- if (event.getSource() == supportleavesItem)
2914
+ if (source == supportleavesItem)
24052915 {
24062916 SupportLeaves(true);
24072917 } else
2408
- if (event.getSource() == unsupportleavesItem)
2918
+ if (source == unsupportleavesItem)
24092919 {
24102920 SupportLeaves(false);
24112921 } else
2412
- if (event.getSource() == hideleavesItem)
2922
+ if (source == hideleavesItem)
24132923 {
24142924 HideLeaves(true);
24152925 } else
2416
- if (event.getSource() == showleavesItem)
2926
+ if (source == showleavesItem)
24172927 {
24182928 HideLeaves(false);
24192929 } else
2420
- if (event.getSource() == markleavesItem)
2930
+ if (source == markleavesItem)
24212931 {
24222932 MarkLeaves(true);
24232933 } else
2424
- if (event.getSource() == unmarkleavesItem)
2934
+ if (source == unmarkleavesItem)
24252935 {
24262936 MarkLeaves(false);
24272937 } else
2428
- if (event.getSource() == flipVItem)
2938
+ if (source == rewindleavesItem)
2939
+ {
2940
+ RewindLeaves(true);
2941
+ } else
2942
+ if (source == unrewindleavesItem)
2943
+ {
2944
+ RewindLeaves(false);
2945
+ } else
2946
+ if (source == randomleavesItem)
2947
+ {
2948
+ RandomLeaves(true);
2949
+ } else
2950
+ if (source == unrandomleavesItem)
2951
+ {
2952
+ RandomLeaves(false);
2953
+ } else
2954
+ if (source == flipVItem)
24292955 {
24302956 FlipV(true);
24312957 } else
2432
- if (event.getSource() == unflipVItem)
2958
+ if (source == unflipVItem)
24332959 {
24342960 FlipV(false);
24352961 } else
2436
- if (event.getSource() == lowTexturesItem)
2962
+ if (source == lowTexturesItem)
24372963 {
24382964 SetTexRes(0);
24392965 } else
2440
- if (event.getSource() == normalTexturesItem)
2966
+ if (source == normalTexturesItem)
24412967 {
24422968 SetTexRes(1);
24432969 } else
2444
- if (event.getSource() == highTexturesItem)
2970
+ if (source == highTexturesItem)
24452971 {
24462972 SetTexRes(2);
24472973 } else
2448
- if (event.getSource() == veryhighTexturesItem)
2974
+ if (source == veryhighTexturesItem)
24492975 {
24502976 SetTexRes(3);
24512977 } else
2452
- if (event.getSource() == maxTexturesItem)
2978
+ if (source == maxTexturesItem)
24532979 {
24542980 SetTexRes(4);
24552981 } else
2456
- if (event.getSource() == panoTexturesItem)
2982
+ if (source == panoTexturesItem)
24572983 {
24582984 SetTexRes(5);
24592985 } else
2460
- if (event.getSource() == reverseNormalsItem)
2986
+ if (source == reverseNormalsItem)
24612987 {
24622988 ReverseNormals();
24632989 } else
2464
- if (event.getSource() == parseverticesItem)
2990
+ if (source == parseverticesItem)
24652991 {
24662992 ParseVertices();
24672993 } else
2468
- if (event.getSource() == textureFieldItem)
2994
+ if (source == textureFieldItem)
24692995 {
24702996 TextureVertices();
24712997 } else
2472
- if (event.getSource() == alignItem)
2998
+ if (source == alignItem)
24732999 {
24743000 Align();
24753001 } else
2476
- if (event.getSource() == mirrorItem)
3002
+ if (source == mirrorItem)
24773003 {
24783004 MirrorPoses();
24793005 } else
2480
- if (event.getSource() == reduceMorphItem)
3006
+ if (source == reduceMorphItem)
24813007 {
24823008 MeshReduction(false);
24833009 } else
2484
- if (event.getSource() == reduce34MorphItem)
3010
+ if (source == reduce34MorphItem)
24853011 {
24863012 MeshReduction(true);
24873013 } else
2488
- if (event.getSource() == reverseTrianglesItem)
3014
+ if (source == reverseTrianglesItem)
24893015 {
24903016 ReverseTriangles();
24913017 } else
2492
- if (event.getSource() == reduceMeshItem)
3018
+ if (source == reduceMeshItem)
24933019 {
24943020 ReduceMesh(false);
24953021 } else
2496
- if (event.getSource() == reduce34MeshItem)
3022
+ if (source == reduce34MeshItem)
24973023 {
24983024 ReduceMesh(true);
24993025 } else
2500
- if (event.getSource() == increaseMeshItem)
3026
+ if (source == increaseMeshItem)
25013027 {
25023028 IncreaseMesh();
25033029 } else
2504
- if (event.getSource() == clipMeshItem)
3030
+ if (source == clipMeshItem)
25053031 {
25063032 ClipMesh();
25073033 } else
2508
- if (event.getSource() == smoothMeshItem)
3034
+ if (source == smoothMeshItem)
25093035 {
25103036 SmoothMesh();
25113037 } else
2512
- if (event.getSource() == transformgeometryItem)
3038
+ if (source == transformGeometryItem)
25133039 {
25143040 TransformGeometry();
25153041 } else
2516
- if (event.getSource() == resetTransformItem)
3042
+ if (source == transformChildrenItem)
3043
+ {
3044
+ TransformChildren();
3045
+ } else
3046
+ if (source == resetTransformItem)
25173047 {
25183048 ResetTransform();
25193049 } else
2520
- if (event.getSource() == resetCentroidItem)
3050
+ if (source == resetCentroidItem)
25213051 {
2522
- ResetCentroid();
3052
+ ResetCentroid(true);
25233053 } else
2524
- if (event.getSource() == resetParentItem)
3054
+ if (source == resetCentroidXZItem)
3055
+ {
3056
+ ResetCentroid(false);
3057
+ } else
3058
+ if (source == resetParentItem)
25253059 {
25263060 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25273061 {
....@@ -2531,7 +3065,7 @@
25313065
25323066 refreshContents();
25333067 } else
2534
- if (event.getSource() == repairParentItem)
3068
+ if (source == repairParentItem)
25353069 {
25363070 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25373071 {
....@@ -2545,7 +3079,21 @@
25453079
25463080 refreshContents();
25473081 } else
2548
- if (event.getSource() == sortbysizeItem)
3082
+ if (source == repairShadowItem)
3083
+ {
3084
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3085
+ {
3086
+ Object3D obj = (Object3D)e.nextElement();
3087
+ obj.RepairShadow();
3088
+// for (int i=0; i<obj.size(); i++)
3089
+// {
3090
+// obj.get(i).parent = obj;
3091
+// }
3092
+ }
3093
+
3094
+ refreshContents();
3095
+ } else
3096
+ if (source == sortbysizeItem)
25493097 {
25503098 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25513099 {
....@@ -2557,7 +3105,7 @@
25573105 ResetModel();
25583106 refreshContents();
25593107 } else
2560
- if (event.getSource() == sortbynameItem)
3108
+ if (source == sortbynameItem)
25613109 {
25623110 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25633111 {
....@@ -2569,7 +3117,7 @@
25693117 ResetModel();
25703118 refreshContents();
25713119 } else
2572
- if (event.getSource() == attachPigmentItem)
3120
+ if (source == attachPigmentItem)
25733121 {
25743122 String texture = GetFile("Attach pigment");
25753123 Object3D obj;
....@@ -2581,7 +3129,7 @@
25813129
25823130 refreshContents();
25833131 } else
2584
- if (event.getSource() == detachPigmentItem)
3132
+ if (source == detachPigmentItem)
25853133 {
25863134 Object3D obj;
25873135 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2592,7 +3140,7 @@
25923140
25933141 refreshContents();
25943142 } else
2595
- if (event.getSource() == attachBumpItem)
3143
+ if (source == attachBumpItem)
25963144 {
25973145 String texture = GetFile("Attach bump");
25983146 Object3D obj;
....@@ -2604,18 +3152,18 @@
26043152
26053153 refreshContents();
26063154 } else
2607
- if (event.getSource() == detachBumpItem)
3155
+ if (source == detachBumpItem)
26083156 {
26093157 Object3D obj;
26103158 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
26113159 {
26123160 obj = (Object3D)e.nextElement();
2613
- obj.SetBumpTexture(null);
3161
+ obj.ResetBumpTexture();
26143162 }
26153163
26163164 refreshContents();
26173165 } else
2618
- if (event.getSource() == pigmentBumpItem)
3166
+ if (source == pigmentBumpItem)
26193167 {
26203168 Object3D obj;
26213169 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2626,158 +3174,262 @@
26263174
26273175 refreshContents();
26283176 } else
2629
- if (event.getSource() == flashSelectionButton)
3177
+ if (source == embedTexturesItem)
3178
+ {
3179
+ Object3D obj;
3180
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3181
+ {
3182
+ obj = (Object3D)e.nextElement();
3183
+ obj.EmbedTextures(true);
3184
+ }
3185
+
3186
+ refreshContents();
3187
+ } else
3188
+ if (source == deEmbedTexturesItem)
3189
+ {
3190
+ Object3D obj;
3191
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3192
+ {
3193
+ obj = (Object3D)e.nextElement();
3194
+ obj.EmbedTextures(false);
3195
+ }
3196
+
3197
+ CameraPane.texturepigment.clear();
3198
+ CameraPane.texturebump.clear();
3199
+
3200
+ refreshContents();
3201
+ } else
3202
+ if (source == flashSelectionButton)
26303203 {
26313204 CameraPane.flash = true;
26323205 refreshContents();
26333206 } else
2634
- if (event.getSource() == oneButton)
3207
+ if (source == oneButton)
26353208 {
26363209 } else
2637
- if (event.getSource() == twoButton)
3210
+ if (source == twoButton)
26383211 {
26393212 radio.layout = twoButton;
3213
+
3214
+ if (CameraPane.FULLSCREEN)
3215
+ fullscreenLayout = radio.layout;
3216
+
26403217 // bug
26413218 //gridPanel.setDividerLocation(1.0);
26423219 //bigPanel.setDividerLocation(0.0);
2643
- bigThree.remove(scenePanel);
2644
- bigThree.remove(centralPanel);
2645
- bigThree.remove(XYZPanel);
2646
- aWindowConstraints.gridx = 0;
2647
- aWindowConstraints.gridy = 0;
2648
- aWindowConstraints.gridwidth = 1;
2649
- // aConstraints.gridheight = 3;
2650
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2651
- aWindowConstraints.weightx = 0;
2652
- aWindowConstraints.weighty = 1;
2653
- //bigThree.add(jtp, aWindowConstraints);
2654
- aWindowConstraints.weightx = 1;
2655
- aWindowConstraints.gridwidth = 3;
2656
- // aConstraints.gridheight = 3;
2657
- aWindowConstraints.gridx = 1;
2658
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2659
- bigThree.add(centralPanel, aWindowConstraints);
2660
- aWindowConstraints.weightx = 0;
2661
- aWindowConstraints.gridx = 4;
2662
- aWindowConstraints.gridwidth = 1;
2663
- // aConstraints.gridheight = 3;
2664
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2665
- //bigThree.add(XYZPanel, aWindowConstraints);
2666
- bigThree.revalidate();
3220
+// bigThree.remove(scenePanel);
3221
+// bigThree.remove(centralPanel);
3222
+// bigThree.remove(XYZPanel);
3223
+// aWindowConstraints.gridx = 0;
3224
+// aWindowConstraints.gridy = 0;
3225
+// aWindowConstraints.gridwidth = 1;
3226
+// // aConstraints.gridheight = 3;
3227
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3228
+// aWindowConstraints.weightx = 0;
3229
+// aWindowConstraints.weighty = 1;
3230
+// //bigThree.add(jtp, aWindowConstraints);
3231
+// aWindowConstraints.weightx = 1;
3232
+// aWindowConstraints.gridwidth = 3;
3233
+// // aConstraints.gridheight = 3;
3234
+// aWindowConstraints.gridx = 1;
3235
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3236
+// bigThree.add(centralPanel, aWindowConstraints);
3237
+// aWindowConstraints.weightx = 0;
3238
+// aWindowConstraints.gridx = 4;
3239
+// aWindowConstraints.gridwidth = 1;
3240
+// // aConstraints.gridheight = 3;
3241
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3242
+// //bigThree.add(XYZPanel, aWindowConstraints);
3243
+// scenePanel.setVisible(false);
3244
+// centralPanel.setVisible(true);
3245
+// XYZPanel.setVisible(false);
3246
+ bigThree.ClearUI();
3247
+ bigThree.add(centralPanel);
3248
+ bigThree.FlushUI();
3249
+
3250
+ cameraView.requestFocusInWindow();
3251
+
3252
+// refreshContents(true);
3253
+//
3254
+// try
3255
+// {
3256
+// java.awt.Robot bot = new java.awt.Robot();
3257
+// int mask = InputEvent.BUTTON1_MASK;
3258
+// bot.mouseMove(100, 100);
3259
+// bot.mousePress(mask);
3260
+// bot.mouseRelease(mask);
3261
+// }
3262
+// catch (Exception e)
3263
+// {
3264
+//
3265
+// }
3266
+
26673267 } else
2668
- if (event.getSource() == threeButton)
3268
+ if (source == threeButton)
26693269 {
26703270 radio.layout = threeButton;
2671
- bigThree.remove(scenePanel);
2672
- bigThree.remove(centralPanel);
2673
- bigThree.remove(XYZPanel);
2674
- aWindowConstraints.gridx = 0;
2675
- aWindowConstraints.gridy = 0;
2676
- aWindowConstraints.gridwidth = 1;
2677
- // aConstraints.gridheight = 3;
2678
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2679
- aWindowConstraints.weightx = 0;
2680
- aWindowConstraints.weighty = 1;
2681
- //bigThree.add(jtp, aWindowConstraints);
2682
- aWindowConstraints.weightx = 1;
2683
- aWindowConstraints.gridwidth = 3;
2684
- // aConstraints.gridheight = 3;
2685
- aWindowConstraints.gridx = 1;
2686
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2687
- bigThree.add(centralPanel, aWindowConstraints);
2688
- aWindowConstraints.weightx = 0;
2689
- aWindowConstraints.gridx = 4;
2690
- aWindowConstraints.gridwidth = 1;
2691
- // aConstraints.gridheight = 3;
2692
- aConstraints.fill = GridBagConstraints.VERTICAL;
2693
- bigThree.add(XYZPanel, aWindowConstraints);
2694
- bigThree.revalidate();
3271
+
3272
+ if (CameraPane.FULLSCREEN)
3273
+ fullscreenLayout = radio.layout;
3274
+
3275
+// bigThree.remove(scenePanel);
3276
+// bigThree.remove(centralPanel);
3277
+// bigThree.remove(XYZPanel);
3278
+// aWindowConstraints.gridx = 0;
3279
+// aWindowConstraints.gridy = 0;
3280
+// aWindowConstraints.gridwidth = 1;
3281
+// // aConstraints.gridheight = 3;
3282
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3283
+// aWindowConstraints.weightx = 0;
3284
+// aWindowConstraints.weighty = 1;
3285
+// //bigThree.add(jtp, aWindowConstraints);
3286
+// aWindowConstraints.weightx = 1;
3287
+// aWindowConstraints.gridwidth = 3;
3288
+// // aConstraints.gridheight = 3;
3289
+// aWindowConstraints.gridx = 1;
3290
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3291
+// bigThree.add(centralPanel, aWindowConstraints);
3292
+// aWindowConstraints.weightx = 0;
3293
+// aWindowConstraints.gridx = 4;
3294
+// aWindowConstraints.gridwidth = 1;
3295
+// // aConstraints.gridheight = 3;
3296
+// aConstraints.fill = GridBagConstraints.VERTICAL;
3297
+// bigThree.add(XYZPanel, aWindowConstraints);
3298
+// bigThree.validate();
3299
+// scenePanel.setVisible(false);
3300
+// centralPanel.setVisible(true);
3301
+// XYZPanel.setVisible(true);
3302
+ bigThree.ClearUI();
3303
+ bigThree.add(scenePanel);
3304
+ bigThree.add(centralPanel);
3305
+ bigThree.FlushUI();
3306
+
3307
+ cameraView.requestFocusInWindow();
26953308 } else
2696
- if (event.getSource() == fourButton)
3309
+ if (source == fourButton)
26973310 {
26983311 radio.layout = fourButton;
2699
- bigThree.remove(scenePanel);
2700
- bigThree.remove(centralPanel);
2701
- bigThree.remove(XYZPanel);
2702
- aWindowConstraints.gridx = 0;
2703
- aWindowConstraints.gridy = 0;
2704
- aWindowConstraints.gridwidth = 1;
2705
- // aWindowConstraints.gridheight = 3;
2706
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2707
- aWindowConstraints.weightx = 1;
2708
- aWindowConstraints.weighty = 1;
2709
- bigThree.add(scenePanel, aWindowConstraints);
2710
- aWindowConstraints.weightx = 1;
2711
- aWindowConstraints.gridwidth = 3;
2712
- // aConstraints.gridheight = 3;
2713
- aWindowConstraints.gridx = 1;
2714
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2715
- //bigThree.add(cameraPanel, aWindowConstraints);
2716
- aWindowConstraints.weightx = 0;
2717
- aWindowConstraints.gridx = 4;
2718
- aWindowConstraints.gridwidth = 1;
2719
- // aWindowConstraints.gridheight = 3;
2720
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2721
- //bigThree.add(XYZPanel, aWindowConstraints);
2722
- bigThree.revalidate();
3312
+
3313
+ if (CameraPane.FULLSCREEN)
3314
+ fullscreenLayout = radio.layout;
3315
+
3316
+// bigThree.remove(scenePanel);
3317
+// bigThree.remove(centralPanel);
3318
+// bigThree.remove(XYZPanel);
3319
+// aWindowConstraints.gridx = 0;
3320
+// aWindowConstraints.gridy = 0;
3321
+// aWindowConstraints.gridwidth = 1;
3322
+// // aWindowConstraints.gridheight = 3;
3323
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3324
+// aWindowConstraints.weightx = 1;
3325
+// aWindowConstraints.weighty = 1;
3326
+// bigThree.add(scenePanel, aWindowConstraints);
3327
+// aWindowConstraints.weightx = 1;
3328
+// aWindowConstraints.gridwidth = 3;
3329
+// // aConstraints.gridheight = 3;
3330
+// aWindowConstraints.gridx = 1;
3331
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3332
+// //bigThree.add(cameraPanel, aWindowConstraints);
3333
+// aWindowConstraints.weightx = 0;
3334
+// aWindowConstraints.gridx = 4;
3335
+// aWindowConstraints.gridwidth = 1;
3336
+// // aWindowConstraints.gridheight = 3;
3337
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3338
+// //bigThree.add(XYZPanel, aWindowConstraints);
3339
+// bigThree.validate();
3340
+// scenePanel.setVisible(true);
3341
+// centralPanel.setVisible(false);
3342
+// XYZPanel.setVisible(false);
3343
+ bigThree.ClearUI();
3344
+ bigThree.add(scenePanel);
3345
+ bigThree.FlushUI();
3346
+
3347
+ cameraView.requestFocusInWindow();
27233348 } else
2724
- if (event.getSource() == sixButton)
3349
+ if (source == sixButton)
27253350 {
27263351 radio.layout = sixButton;
2727
- bigThree.remove(scenePanel);
2728
- bigThree.remove(centralPanel);
2729
- bigThree.remove(XYZPanel);
2730
- aWindowConstraints.gridx = 0;
2731
- aWindowConstraints.gridy = 0;
2732
- aWindowConstraints.gridwidth = 1;
2733
- // aConstraints.gridheight = 3;
2734
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2735
- aWindowConstraints.weightx = 0;
2736
- aWindowConstraints.weighty = 1;
2737
- bigThree.add(scenePanel, aWindowConstraints);
2738
- aWindowConstraints.weightx = 1;
2739
- aWindowConstraints.gridwidth = 3;
2740
- // aWindowConstraints.gridheight = 3;
2741
- aWindowConstraints.gridx = 1;
2742
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2743
- bigThree.add(centralPanel, aWindowConstraints);
2744
- aWindowConstraints.weightx = 0;
2745
- aWindowConstraints.gridx = 4;
2746
- aWindowConstraints.gridwidth = 1;
2747
- // aWindowConstraints.gridheight = 3;
2748
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2749
- //bigThree.add(XYZPanel, aConstraints);
2750
- bigThree.revalidate();
3352
+
3353
+ if (CameraPane.FULLSCREEN)
3354
+ fullscreenLayout = radio.layout;
3355
+
3356
+// bigThree.remove(scenePanel);
3357
+// bigThree.remove(centralPanel);
3358
+// bigThree.remove(XYZPanel);
3359
+// aWindowConstraints.gridx = 0;
3360
+// aWindowConstraints.gridy = 0;
3361
+// aWindowConstraints.gridwidth = 1;
3362
+// // aConstraints.gridheight = 3;
3363
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3364
+// aWindowConstraints.weightx = 0;
3365
+// aWindowConstraints.weighty = 1;
3366
+// bigThree.add(scenePanel, aWindowConstraints);
3367
+// aWindowConstraints.weightx = 1;
3368
+// aWindowConstraints.gridwidth = 3;
3369
+// // aWindowConstraints.gridheight = 3;
3370
+// aWindowConstraints.gridx = 1;
3371
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3372
+// bigThree.add(centralPanel, aWindowConstraints);
3373
+// aWindowConstraints.weightx = 0;
3374
+// aWindowConstraints.gridx = 4;
3375
+// aWindowConstraints.gridwidth = 1;
3376
+// // aWindowConstraints.gridheight = 3;
3377
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3378
+// //bigThree.add(XYZPanel, aConstraints);
3379
+// bigThree.validate();
3380
+// scenePanel.setVisible(true);
3381
+// centralPanel.setVisible(true);
3382
+// XYZPanel.setVisible(false);
3383
+ bigThree.ClearUI();
3384
+ bigThree.add(centralPanel);
3385
+ bigThree.add(scenePanel);
3386
+ bigThree.FlushUI();
3387
+
3388
+ cameraView.requestFocusInWindow();
27513389 } else
2752
- if (event.getSource() == sevenButton)
3390
+ if (source == sevenButton)
27533391 {
27543392 radio.layout = sevenButton;
2755
- bigThree.remove(scenePanel);
2756
- bigThree.remove(centralPanel);
2757
- bigThree.remove(XYZPanel);
2758
- aWindowConstraints.gridx = 0;
2759
- aWindowConstraints.gridy = 0;
2760
- aWindowConstraints.gridwidth = 1;
2761
- // aWindowConstraints.gridheight = 3;
2762
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2763
- aWindowConstraints.weightx = 0;
2764
- aWindowConstraints.weighty = 1;
2765
- bigThree.add(scenePanel, aWindowConstraints);
2766
- aWindowConstraints.weightx = 1;
2767
- aWindowConstraints.gridwidth = 3;
2768
- // aWindowConstraints.gridheight = 3;
2769
- aWindowConstraints.gridx = 1;
2770
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2771
- bigThree.add(centralPanel, aWindowConstraints);
2772
- aWindowConstraints.weightx = 0;
2773
- aWindowConstraints.gridx = 4;
2774
- aWindowConstraints.gridwidth = 1;
2775
- // aConstraints.gridheight = 3;
2776
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2777
- bigThree.add(XYZPanel, aWindowConstraints);
2778
- bigThree.revalidate();
3393
+
3394
+ if (CameraPane.FULLSCREEN)
3395
+ fullscreenLayout = radio.layout;
3396
+
3397
+// bigThree.remove(scenePanel);
3398
+// bigThree.remove(centralPanel);
3399
+// bigThree.remove(XYZPanel);
3400
+// aWindowConstraints.gridx = 0;
3401
+// aWindowConstraints.gridy = 0;
3402
+// aWindowConstraints.gridwidth = 1;
3403
+// // aWindowConstraints.gridheight = 3;
3404
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3405
+// aWindowConstraints.weightx = 0;
3406
+// aWindowConstraints.weighty = 1;
3407
+// bigThree.add(scenePanel, aWindowConstraints);
3408
+// aWindowConstraints.weightx = 1;
3409
+// aWindowConstraints.gridwidth = 3;
3410
+// // aWindowConstraints.gridheight = 3;
3411
+// aWindowConstraints.gridx = 1;
3412
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3413
+// bigThree.add(centralPanel, aWindowConstraints);
3414
+// aWindowConstraints.weightx = 0;
3415
+// aWindowConstraints.gridx = 4;
3416
+// aWindowConstraints.gridwidth = 1;
3417
+// // aConstraints.gridheight = 3;
3418
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3419
+// bigThree.add(XYZPanel, aWindowConstraints);
3420
+// bigThree.validate();
3421
+// scenePanel.setVisible(true);
3422
+// centralPanel.setVisible(true);
3423
+// XYZPanel.setVisible(true);
3424
+ bigThree.ClearUI();
3425
+ bigThree.add(scenePanel);
3426
+ bigThree.add(centralPanel);
3427
+ bigThree.add(XYZPanel);
3428
+ bigThree.FlushUI();
3429
+
3430
+ cameraView.requestFocusInWindow();
27793431 } else
2780
- if (event.getSource() == rootButton)
3432
+ if (source == rootButton)
27813433 {
27823434 Object3D obj;
27833435 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2787,66 +3439,84 @@
27873439 EditObject(obj);
27883440 }
27893441
3442
+ cameraView.requestFocusInWindow();
27903443 refreshContents(true);
27913444 } else
2792
- if (event.getSource() == closeButton)
3445
+ if (source == closeButton)
27933446 {
27943447 //System.out.println("CLOSE: " + buttonGroup.getSelection());
27953448 cRadio ab;
27963449 for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
27973450 {
27983451 ab = (cRadio)e.nextElement();
2799
- if(ab.getModel().isSelected() && ab.GetObject() != client)
3452
+ if (ab.getModel().isSelected() && ab.GetObject() != client)
28003453 {
3454
+ // Patch to avoid bug with transparency.
3455
+ if (!ab.hadMaterial)
3456
+ {
3457
+ ab.object.material = null;
3458
+ }
3459
+
28013460 buttonGroup.remove(ab);
28023461 radioPanel.remove(ab);
28033462
2804
- ab.GetObject().editWindow = null;
3463
+ //ab.GetObject().editWindow = null;
3464
+ ab.GetObject().manipWindow = null;
28053465 // ab.GetObject().objectUI = null; // ?????????
28063466
28073467 ((cRadio)radioPanel.getComponent(radioPanel.getComponentCount() - 1)).doClick();
28083468 break;
28093469 }
28103470 }
3471
+
3472
+ cameraView.requestFocusInWindow();
28113473 refreshContents(true);
28123474 } else
2813
- if (event.getSource() == editItem || event.getSource() == editButton)
3475
+ if (source == editItem || source == editButton)
28143476 {
3477
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3478
+ {
3479
+ Object3D child = (Object3D)e.nextElement();
3480
+ child.pinned = true;
3481
+ }
3482
+
28153483 EditSelection(false);
28163484 } else
2817
- if (event.getSource() == uneditButton)
3485
+ if (source == uneditButton)
28183486 {
28193487 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
28203488 {
28213489 Object3D child = (Object3D)e.nextElement();
28223490 if(child.editWindow != null)
28233491 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3492
+ child.pinned = false;
28243493 child.CloseUI();
28253494 listUI.remove(child);
28263495
2827
- child.editWindow = null; // ???????????
3496
+ //child.editWindow = null; // ???????????
28283497 }
2829
- objEditor.ctrlPanel.revalidate();
3498
+ objEditor.ctrlPanel.FlushUI();
28303499 //objEditor.jTree.clearSelection();
28313500 //objEditor.ResetSliders();
28323501 refreshContents(true);
28333502 } else
2834
- if (event.getSource() == clearPanelButton)
3503
+ if (source == clearPanelButton)
28353504 {
28363505 assert(copy == group);
28373506 //copy.ClearUI();
28383507 for (Object3D obj : listUI)
28393508 {
3509
+ obj.pinned = false;
28403510 obj.CloseUI();
28413511 }
28423512 listUI.clear();
28433513 refreshContents(true);
28443514 } else
2845
- if (event.getSource() == allParamsButton)
3515
+ if (source == allParamsButton)
28463516 {
28473517 assert(copy == group);
28483518
2849
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
3519
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
28503520
28513521 for (Object3D obj : listUI)
28523522 {
....@@ -2863,19 +3533,19 @@
28633533
28643534 refreshContents(true);
28653535 } else
2866
- if (event.getSource() == unselectButton)
3536
+ if (source == unselectButton)
28673537 {
28683538 objEditor.jTree.clearSelection();
28693539 // ?? oct 2012 GrafreeD.clipboard.clear();
28703540 objEditor.ResetSliders();
28713541 refreshContents(true);
28723542 } else
2873
- if(event.getSource() instanceof cRadio)
3543
+ if(source instanceof cRadio)
28743544 {
28753545 group.parent = keepparent;
28763546 group.attributes = 0;
28773547 //group.editWindow = null;
2878
- /*cRadio*/ radio = (cRadio)event.getSource();
3548
+ /*cRadio*/ radio = (cRadio)source;
28793549 Object3D obj = radio.GetObject();
28803550 System.out.println("Edit " + obj);
28813551 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -2895,7 +3565,10 @@
28953565 }
28963566
28973567 copy = group;
2898
- //CameraPane.theRenderer.object = group;
3568
+
3569
+ SetUndoStates();
3570
+
3571
+ //Globals.theRenderer.object = group;
28993572 if(!useclient)
29003573 {
29013574 cameraView.renderCamera = radio.camera;
....@@ -2904,25 +3577,52 @@
29043577 cameraView.cameras[cameraView.cameracount] = radio.camera;
29053578 cameraView.targetLookAt.set(radio.camera.lookAt);
29063579 cameraView.object = group;
2907
- cameraView.lighttouched = true;
3580
+ //cameraView.lighttouched = true;
3581
+ Globals.lighttouched = true;
29083582 topView.object = group;
29093583 frontView.object = group;
29103584 sideView.object = group;
29113585 }
2912
- group.editWindow = this;
3586
+
3587
+// fix "+" issue
3588
+ //group.editWindow = this;
3589
+ group.manipWindow = this;
3590
+
29133591 /*
29143592 currentLayout = radio.layout;
29153593 if (currentLayout == null)
29163594 currentLayout = sevenButton;
29173595 */
29183596 radio.layout.doClick();
3597
+
3598
+ ClearUnpinned();
3599
+ //Grafreed.Assert(group != null);
3600
+ //Grafreed.Assert(group.selection != null);
3601
+ SetPinStates(group.selection == null || group.selection.size() > 0);
3602
+ if (group.selection == null || group.selection.size() == 1)
3603
+ EditSelection(false);
29193604 keepparent = group.parent;
29203605 // PARENT = NULL or not???
29213606 //group.parent = null; // ROOT
29223607 //group.attributes = -1;
29233608 ResetModel();
3609
+
3610
+ cameraView.requestFocusInWindow();
29243611 refreshContents(true);
2925
- }
3612
+ } else if (event.getSource() == editCameraItem)
3613
+ {
3614
+ cameraView.ProtectCamera();
3615
+ cameraView.repaint();
3616
+ return;
3617
+ } else if (event.getSource() == restoreCameraItem || event.getSource() == restoreCameraButton)
3618
+ {
3619
+ cameraView.RevertCamera();
3620
+ cameraView.repaint();
3621
+ return;
3622
+ // } else if (event.getSource() == textureButton)
3623
+ // {
3624
+ // return; // true;
3625
+ }
29263626 else
29273627 {
29283628 //return super.action(event, arg);
....@@ -2931,7 +3631,6 @@
29313631 }
29323632
29333633 boolean useclient = false;
2934
- cRadio radio;
29353634
29363635 void ToggleRoot()
29373636 {
....@@ -2940,7 +3639,7 @@
29403639 if (useclient)
29413640 {
29423641 cameraView.object = client;
2943
- cameraView.lighttouched = true;
3642
+ Globals.lighttouched = true;
29443643 //topView.object = client;
29453644 //frontView.object = client;
29463645 //sideView.object = client;
....@@ -2948,7 +3647,7 @@
29483647 else
29493648 {
29503649 cameraView.object = group;
2951
- cameraView.lighttouched = true;
3650
+ Globals.lighttouched = true;
29523651 //topView.object = group;
29533652 //frontView.object = group;
29543653 //sideView.object = group;
....@@ -2983,6 +3682,28 @@
29833682 refreshContents();
29843683 }
29853684
3685
+ void TransformChildren()
3686
+ {
3687
+ Object3D obj;
3688
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3689
+ {
3690
+ obj = (Object3D)e.nextElement();
3691
+ obj.KeepTextureMatrices();
3692
+ obj.TransformChildren();
3693
+ obj.RestoreTextureMatrices();
3694
+
3695
+// if (obj.parent == null)
3696
+// {
3697
+// System.out.println("NULL PARENT!");
3698
+// new Exception().printStackTrace();
3699
+// }
3700
+// else
3701
+// TouchTransform(obj);
3702
+// //obj.parent.Touch();
3703
+ }
3704
+
3705
+ refreshContents();
3706
+ }
29863707
29873708 void ResetTransform()
29883709 {
....@@ -3095,7 +3816,7 @@
30953816 refreshContents();
30963817 }
30973818
3098
- void ResetCentroid()
3819
+ void ResetCentroid(boolean full)
30993820 {
31003821 Object3D obj;
31013822 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3110,12 +3831,16 @@
31103831 LA.matIdentity(Object3D.mat);
31113832 obj.getBounds(minima, maxima, false);
31123833 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3113
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3834
+ if (full)
3835
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
31143836 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
31153837 obj.TransformMesh(Object3D.mat);
3838
+
31163839 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3117
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3840
+ if (full)
3841
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
31183842 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3843
+
31193844 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
31203845 //Object3D.mat[3][0] = -Object3D.mat[3][0];
31213846 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3144,7 +3869,8 @@
31443869
31453870 int size = obj.MemorySize();
31463871
3147
- System.err.println((size/1024) + " KB is the size of " + obj);
3872
+ //System.err.println((size/1024) + " KB is the size of " + obj);
3873
+ System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)");
31483874 }
31493875 }
31503876 catch (Exception e)
....@@ -3181,9 +3907,9 @@
31813907 obj = (Object3D)e.nextElement();
31823908
31833909 System.out.println("Object is: " + obj);
3184
- GrafreeD.AnalyzeObject(obj);
3910
+ Grafreed.AnalyzeObject(obj);
31853911 System.out.println("Boundary rep: " + obj.bRep);
3186
- GrafreeD.AnalyzeObject(obj.bRep);
3912
+ Grafreed.AnalyzeObject(obj.bRep);
31873913
31883914 // System.err.println((size/1024) + " KB is the size of " + obj);
31893915 }
....@@ -3225,6 +3951,13 @@
32253951 void GenNormals(boolean crease)
32263952 {
32273953 group.GenNormalsS(crease);
3954
+
3955
+ refreshContents();
3956
+ }
3957
+
3958
+ void GenNormalsMESH()
3959
+ {
3960
+ group.GenNormalsMeshS();
32283961
32293962 refreshContents();
32303963 }
....@@ -3397,8 +4130,8 @@
33974130
33984131 void ParseVertices()
33994132 {
3400
- boolean epsequal = GrafreeD.epsequal;
3401
- GrafreeD.epsequal = true;
4133
+ boolean epsequal = Grafreed.epsequal;
4134
+ Grafreed.epsequal = true;
34024135
34034136 for (int i=0; i<group.selection.size(); i++)
34044137 {
....@@ -3423,7 +4156,7 @@
34234156 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
34244157 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
34254158
3426
- g.add(GrafreeD.clipboard);
4159
+ g.add(Grafreed.clipboard);
34274160
34284161 buffer.add(g);
34294162 }
....@@ -3438,7 +4171,7 @@
34384171 makeSomething(buffer, i==group.selection.size()-1);
34394172 }
34404173
3441
- GrafreeD.epsequal = epsequal;
4174
+ Grafreed.epsequal = epsequal;
34424175
34434176 refreshContents();
34444177 }
....@@ -3456,7 +4189,16 @@
34564189 String pigment = Object3D.GetPigment(tex);
34574190 //String bump = Object3D.GetBump(tex);
34584191
3459
- com.sun.opengl.util.texture.TextureData texturedata = CameraPane.theRenderer.GetTextureData(pigment, false, node.texres);
4192
+ com.sun.opengl.util.texture.TextureData texturedata = null;
4193
+
4194
+ try
4195
+ {
4196
+ texturedata = Globals.theRenderer.GetTextureData(tex, false, node.texres);
4197
+ }
4198
+ catch (Exception e)
4199
+ {
4200
+ System.err.println("FAIL: " + node);
4201
+ }
34604202
34614203 double s = v.s;
34624204
....@@ -3544,11 +4286,11 @@
35444286
35454287 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
35464288
3547
- boolean random = CameraPane.RANDOM;
3548
- CameraPane.RANDOM = false; // parse all random nodes
4289
+ boolean random = CameraPane.SWITCH;
4290
+ CameraPane.SWITCH = false; // parse all random nodes
35494291 lowres.linkVerticesThis(null);
35504292 lowres.linkVerticesThis(sn);
3551
- CameraPane.RANDOM = random;
4293
+ CameraPane.SWITCH = random;
35524294
35534295 System.err.flush();
35544296
....@@ -3588,7 +4330,7 @@
35884330 return;
35894331
35904332 Object3D poses = group.selection.get(0);
3591
- Object3D ref = GrafreeD.clipboard.get(0);
4333
+ Object3D ref = Grafreed.clipboard.get(0);
35924334
35934335 Object3D newgroup = new Object3D("Po:" + poses.name);
35944336
....@@ -3757,7 +4499,7 @@
37574499 group.selection.RelinkToSupport(); // july 2014
37584500 System.out.println("DONE.");
37594501 refreshContents();
3760
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
4502
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
37614503 }
37624504
37634505 void ReduceMesh(boolean reduction34)
....@@ -3782,9 +4524,9 @@
37824524
37834525 void ClipMesh()
37844526 {
3785
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
4527
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
37864528 {
3787
- Object3D content = GrafreeD.clipboard.get(0);
4529
+ Object3D content = Grafreed.clipboard.get(0);
37884530
37894531 if (content instanceof cGroup && ((cGroup)content).transientlink )
37904532 content = ((cGroup)content).get(0);
....@@ -3793,7 +4535,7 @@
37934535 // {
37944536 // group.selection.get(i).ClipMesh(GrafreeD.clipboard);
37954537 // }
3796
- group.selection.ClipMesh(GrafreeD.clipboard);
4538
+ group.selection.ClipMesh(Grafreed.clipboard);
37974539 }
37984540 // group.selection.ClipMesh(GrafreeD.clipboard);
37994541 System.out.println("DONE.");
....@@ -3840,6 +4582,18 @@
38404582 void MarkLeaves(boolean hide)
38414583 {
38424584 group.selection.MarkLeaves(hide);
4585
+ refreshContents();
4586
+ }
4587
+
4588
+ void RewindLeaves(boolean hide)
4589
+ {
4590
+ group.selection.RewindLeaves(hide);
4591
+ refreshContents();
4592
+ }
4593
+
4594
+ void RandomLeaves(boolean hide)
4595
+ {
4596
+ group.selection.RandomLeaves(hide);
38434597 refreshContents();
38444598 }
38454599
....@@ -3914,28 +4668,25 @@
39144668 // }
39154669 // }
39164670
3917
- static boolean allparams = true;
3918
-
3919
- static Vector<Object3D> listUI = new Vector<Object3D>();
3920
-
39214671 void EditSelection(boolean newWindow)
39224672 {
4673
+ if (group.selection == null)
4674
+ {
4675
+ EditElement(group, newWindow); // ? new
4676
+ return;
4677
+ }
4678
+
39234679 // aConstraints.gridy = 0;
39244680 for (int i=0; i<group.selection.size(); i++)
39254681 {
39264682 //System.out.println("edit : " + objectPanel.indexOfTab("Material"));
39274683 //objectPanel.setEnabledAt(objectPanel.indexOfTab("Material"), false);
3928
- objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
4684
+ //objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
39294685
39304686 Object3D elem = (Object3D)group.selection.elementAt(i);
3931
- if(elem != group)
4687
+ if(elem != group || !newWindow)
39324688 {
3933
- // if (!(elem instanceof Composite))
3934
- // newWindow = false;
3935
- listUI.add(elem);
3936
- elem.openEditWindow(this, newWindow); //, false);
3937
- System.out.println("edit : " + elem);
3938
- elem.editWindow.refreshContents(true); // ? new
4689
+ EditElement(elem, newWindow); // ? new
39394690 }
39404691 }
39414692 }
....@@ -4010,7 +4761,8 @@
40104761 //new Exception().printStackTrace();
40114762
40124763 freezemodel = true;
4013
-
4764
+ ClearUnpinned();
4765
+
40144766 /**/
40154767 //switch (event.id)
40164768 {
....@@ -4018,7 +4770,6 @@
40184770 //case 702: // Event.LIST_DESELECT
40194771 group.deselectAll();
40204772 TreePath tps[] = objEditor.jTree.getSelectionPaths();
4021
- objEditor.ClearInfo(); // .GetMaterial());
40224773 if (tps != null)
40234774 {
40244775 for (int i=0; i < tps.length; i++)
....@@ -4027,33 +4778,39 @@
40274778
40284779 //if (child.parent != null)
40294780 //child.parent.addSelectee(child);
4781
+ objEditor.SetMaterial(child);
40304782 group.addSelectee(child);
4031
- objEditor.SetMaterial(child); // .GetMaterial());
4032
- objEditor.AddInfo(child, this, true); // .GetMaterial());
4033
- System.err.println("info : " + child.GetPath());
40344783 }
40354784 }
4036
- else
4037
- {
4038
- objEditor.SetMaterial(group); // .GetMaterial());
4039
- objEditor.AddInfo(group, this, true); // .GetMaterial());
4040
- System.err.println("info : " + group.GetPath());
4041
- }
4785
+// else
4786
+// {
4787
+// objEditor.SetMaterial(group); // .GetMaterial());
4788
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4789
+// System.err.println("info : " + group.GetPath());
4790
+// }
40424791
4043
- objEditor.SetText(); // jan 2014
4044
-
4045
- if (flashIt && !CameraPane.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
4792
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera))
40464793 CameraPane.flash = true;
40474794
4048
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
4795
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
40494796 // a camera
40504797 {
4051
- CameraPane.camerachangeframe = 0; // don't refuse it
4052
- CameraPane.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4053
- // CameraPane.theRenderer.renderCamera = CameraPane.theRenderer.manipCamera;
4054
- // CameraPane.theRenderer.eyeCamera = CameraPane.theRenderer.manipCamera;
4798
+ if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera()) // Crash the camera because of invalid lightspace
4799
+ {
4800
+ CameraPane.camerachangeframe = 0; // don't refuse it
4801
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4802
+ }
4803
+ // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
4804
+ // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
40554805 }
40564806
4807
+ if (tps != null && tps.length == 1)
4808
+ {
4809
+ EditSelection(false);
4810
+ }
4811
+
4812
+ SetPinStates(tps != null && tps.length > 0);
4813
+
40574814 refreshContents();
40584815 //return true;
40594816 }
....@@ -4062,6 +4819,35 @@
40624819
40634820 freezemodel = false;
40644821 }
4822
+
4823
+ void SetPinStates(boolean enabled)
4824
+ {
4825
+ editButton.setEnabled(enabled);
4826
+ uneditButton.setEnabled(enabled);
4827
+ unselectButton.setEnabled(enabled);
4828
+ flashSelectionButton.setEnabled(enabled);
4829
+ }
4830
+
4831
+ void refreshContents(boolean cp)
4832
+ {
4833
+ if (objectPanel.getSelectedIndex() == 2) // objectPanel.indexOfTab("Info"))
4834
+ if (!Globals.MOUSEDRAGGED && group.selection != null) // && !Globals.TIMERRUNNING)
4835
+ {
4836
+ objEditor.ClearInfo(); // .GetMaterial());
4837
+
4838
+ for (int i=0; i < group.selection.Size(); i++)
4839
+ {
4840
+ Object3D child = (Object3D) group.selection.get(i);
4841
+
4842
+ objEditor.AddInfo(child, this, true);
4843
+ System.err.println("info : " + child.GetPath());
4844
+ }
4845
+
4846
+ objEditor.SetText(); // jan 2014
4847
+ }
4848
+
4849
+ super.refreshContents(cp);
4850
+ }
40654851
40664852 void linkSomething(Object3D thing)
40674853 {
....@@ -4133,16 +4919,19 @@
41334919 {
41344920 if (group.selection.isEmpty())
41354921 return;
4136
- GrafreeD.clipboardIsTempGroup = false;
4922
+
4923
+ Grafreed.clipboardIsTempGroup = false;
41374924 Composite tGroup = null;
41384925 if (group.selection.size() > 0) // 1)
41394926 {
41404927 tGroup = new cGroup();
4141
- GrafreeD.clipboardIsTempGroup = true;
4928
+ Grafreed.clipboardIsTempGroup = true;
41424929 }
41434930
41444931 if (cut)
41454932 {
4933
+// if (Globals.SAVEONMAKE) // Moved to the clipboard, no need to save.
4934
+// Save();
41464935 //int indices[] = jList.getSelectedIndices();
41474936 //for (int i = indices.length - 1; i >= 0; i--)
41484937 //jList.remove(indices[i]);
....@@ -4178,16 +4967,16 @@
41784967 //System.out.println("cut " + child);
41794968 //System.out.println("parent = " + child.parent);
41804969 // tmp.addChild(child);
4181
- if (GrafreeD.clipboardIsTempGroup)
4970
+ if (Grafreed.clipboardIsTempGroup)
41824971 tGroup.add/*Child*/(tmp);
41834972 else
4184
- GrafreeD.clipboard = tmp;
4973
+ Grafreed.clipboard = tmp;
41854974 }
41864975 else
4187
- if (GrafreeD.clipboardIsTempGroup)
4976
+ if (Grafreed.clipboardIsTempGroup)
41884977 tGroup.add/*Child*/(child);
41894978 else
4190
- GrafreeD.clipboard = child;
4979
+ Grafreed.clipboard = child;
41914980 }
41924981
41934982 //ResetModel();
....@@ -4219,21 +5008,23 @@
42195008 //System.out.println("cut " + elem);
42205009 //System.out.println("parent = " + elem.parent);
42215010 // tmp.addChild(elem);
4222
- if (GrafreeD.clipboardIsTempGroup)
5011
+ if (Grafreed.clipboardIsTempGroup)
42235012 tGroup.add/*Child*/(tmp);
42245013 else
4225
- GrafreeD.clipboard = tmp;
5014
+ Grafreed.clipboard = tmp;
42265015 }
42275016 else
4228
- if (GrafreeD.clipboardIsTempGroup)
5017
+ if (Grafreed.clipboardIsTempGroup)
42295018 tGroup.add/*Child*/(child);
42305019 else
4231
- GrafreeD.clipboard = child;
5020
+ Grafreed.clipboard = child;
42325021 }
42335022
42345023 }
4235
- if (GrafreeD.clipboardIsTempGroup)
4236
- GrafreeD.clipboard = tGroup;
5024
+
5025
+ if (Grafreed.clipboardIsTempGroup)
5026
+ Grafreed.clipboard = tGroup;
5027
+
42375028 if (cut)
42385029 {
42395030 ResetModel();
....@@ -4243,11 +5034,15 @@
42435034
42445035 void paste(boolean expand)
42455036 {
5037
+ if (Globals.REPLACEONMAKE)
5038
+ Save();
5039
+ boolean keep = Globals.REPLACEONMAKE;
5040
+ Globals.REPLACEONMAKE = false;
42465041 // if (GrafreeD.clipboard == null)
42475042 // return;
42485043 boolean first = true;
42495044
4250
- if (GrafreeD.clipboardIsTempGroup)
5045
+ if (Grafreed.clipboardIsTempGroup)
42515046 {
42525047 Composite temp;
42535048
....@@ -4258,7 +5053,7 @@
42585053 temp = (Composite)Applet3D.clipboard.deepCopy();
42595054 */
42605055 Object3D elem;
4261
- for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
5056
+ for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
42625057 {
42635058 Object3D child = (Object3D)e.nextElement();
42645059
....@@ -4292,21 +5087,22 @@
42925087 //Object3D cb = Applet3D.clipboard;
42935088 //temp.addChild(cb);
42945089 //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0));
4295
- assert(GrafreeD.clipboard.parent == null);
4296
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
4297
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
4298
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
4299
- makeSomething(expand?GrafreeD.clipboard.get(0).copyExpand():GrafreeD.clipboard.get(0).deepCopy());
5090
+ assert(Grafreed.clipboard.parent == null);
5091
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
5092
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
5093
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
5094
+ makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy());
43005095 else
4301
- makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4302
- GrafreeD.clipboard.get(0).parent = keepparent;
5096
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
5097
+ Grafreed.clipboard.get(0).parent = keepparent;
43035098 }
43045099
5100
+ Globals.REPLACEONMAKE = keep;
43055101 ResetModel();
43065102 refreshContents();
43075103 }
43085104
4309
- void pasteInto(boolean copyit)
5105
+ void pasteInto(boolean copyit, boolean clone)
43105106 {
43115107 // if (GrafreeD.clipboard == null)
43125108 // return;
....@@ -4335,15 +5131,22 @@
43355131 if (copyit)
43365132 {
43375133 // paste(false);
4338
- CloneClipboard(false); // sept 2014
5134
+ if (clone)
5135
+ {
5136
+ CloneClipboard(false); // sept 2014
5137
+ }
5138
+ else
5139
+ {
5140
+ paste(false);
5141
+ }
43395142 }
43405143 else
43415144 {
43425145 boolean first = true;
43435146
4344
- if (GrafreeD.clipboardIsTempGroup)
5147
+ if (Grafreed.clipboardIsTempGroup)
43455148 {
4346
- Composite temp = (Composite)GrafreeD.clipboard;
5149
+ Composite temp = (Composite)Grafreed.clipboard;
43475150 Object3D copy;
43485151 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
43495152 {
....@@ -4353,7 +5156,7 @@
43535156 }
43545157 } else
43555158 {
4356
- linkSomething(GrafreeD.clipboard); //.get(0));
5159
+ linkSomething(Grafreed.clipboard); //.get(0));
43575160 }
43585161 }
43595162 }
....@@ -4430,6 +5233,10 @@
44305233
44315234 void group(Object3D csg, boolean grab)
44325235 {
5236
+ if (Globals.REPLACEONMAKE)
5237
+ Save();
5238
+ boolean keep = Globals.REPLACEONMAKE;
5239
+ Globals.REPLACEONMAKE = false;
44335240 if (//false) // why??
44345241 !group.selection.isEmpty())
44355242 {
....@@ -4543,10 +5350,15 @@
45435350 //node.add(csg);
45445351 //makeSomething(node);
45455352 makeSomething(csg);
5353
+ Globals.REPLACEONMAKE = keep;
45465354 }
45475355
45485356 void Ungroup(Object3D g)
45495357 {
5358
+ if (Globals.REPLACEONMAKE)
5359
+ Save();
5360
+ boolean keep = Globals.REPLACEONMAKE;
5361
+ Globals.REPLACEONMAKE = false;
45505362 if (g instanceof HiddenObject)
45515363 {
45525364 HiddenObject h = (HiddenObject) g;
....@@ -4563,6 +5375,7 @@
45635375 objEditor.makeSomething(g.get(i), false);
45645376 }
45655377 }
5378
+ Globals.REPLACEONMAKE = keep;
45665379 }
45675380
45685381 void ungroup()
....@@ -4758,21 +5571,6 @@
47585571 }
47595572 */
47605573
4761
- void ImportGFD()
4762
- {
4763
- FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD);
4764
- browser.show();
4765
- String filename = browser.getFile();
4766
- if (filename != null && filename.length() > 0)
4767
- {
4768
- String fullname = browser.getDirectory() + filename;
4769
-
4770
- //Object3D readobj =
4771
- objEditor.ReadGFD(fullname, objEditor);
4772
- //makeSomething(readobj);
4773
- }
4774
- }
4775
-
47765574 /*
47775575 public void Callback(Object obj)
47785576 {
....@@ -4796,26 +5594,9 @@
47965594 }
47975595 */
47985596
4799
- void ImportVRMLX3D()
4800
- {
4801
- if (GrafreeD.standAlone)
4802
- {
4803
- /**/
4804
- FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
4805
- browser.show();
4806
- String filename = browser.getFile();
4807
- if (filename != null && filename.length() > 0)
4808
- {
4809
- String fullname = browser.getDirectory() + filename;
4810
- LoadVRMLX3D(fullname);
4811
- }
4812
- /**/
4813
- }
4814
- }
4815
-
48165597 String GetFile(String dialogName)
48175598 {
4818
- if (GrafreeD.standAlone)
5599
+ if (Grafreed.standAlone)
48195600 {
48205601 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
48215602 browser.show();
....@@ -4879,10 +5660,33 @@
48795660 cButton flashSelectionButton;
48805661 cButton editButton;
48815662 cButton uneditButton;
5663
+ JCheckBox allParamsButton;
48825664 cButton clearpanelButton;
4883
- cButton allParamsButton;
48845665 cButton unselectButton;
48855666
5667
+ cButton restoreCameraButton;
5668
+
5669
+ cButton saveButton;
5670
+ cButton oneStepButton;
5671
+
5672
+ cButton groupButton;
5673
+ cButton ungroupButton;
5674
+ cButton compositeButton;
5675
+ cButton switchButton;
5676
+ cButton loopButton;
5677
+ cButton textureButton;
5678
+
5679
+ cButton gridButton;
5680
+ cButton boxButton;
5681
+ cButton sphereButton;
5682
+ cButton coneButton;
5683
+ cButton torusButton;
5684
+ cButton superButton;
5685
+ cButton kleinButton;
5686
+ cButton particlesButton;
5687
+ cButton overlayButton;
5688
+ cButton lightButton;
5689
+
48865690 cButton screenfitButton;
48875691 cButton screenfitpointButton;
48885692 cButton snapobjectButton;
....@@ -4894,14 +5698,6 @@
48945698
48955699 cButton setsupportButton;
48965700
4897
- cButton twoButton;
4898
- cButton sixButton;
4899
- cButton threeButton;
4900
- cButton sevenButton;
4901
- cButton fourButton; // full panel
4902
- cButton oneButton; // full XYZ
4903
- //cButton currentLayout;
4904
-
49055701 //
49065702 //Composite
49075703 Object3D // to do !!
....@@ -4911,9 +5707,11 @@
49115707 //JTree jTree;
49125708 private MenuItem lookAtItem;
49135709 private MenuItem lookFromItem;
4914
- private MenuItem switchItem;
5710
+ private MenuItem switchViewItem;
49155711 private MenuItem cutItem;
4916
- private MenuItem duplicateItem;
5712
+ private MenuItem undoItem;
5713
+ private MenuItem redoItem;
5714
+ private JMenuItem duplicateItem;
49175715 private MenuItem cloneItem;
49185716 private MenuItem cloneSupportItem;
49195717 private MenuItem overwriteGeoItem;
....@@ -4926,7 +5724,7 @@
49265724 private MenuItem linkverticesItem;
49275725 private MenuItem relinkverticesItem;
49285726 private MenuItem setMasterItem;
4929
- private MenuItem resetMeshItem;
5727
+ private MenuItem resetAllItem;
49305728 private MenuItem stepAllItem;
49315729 private MenuItem revertMeshItem;
49325730 private MenuItem poseMeshItem;
....@@ -4937,10 +5735,11 @@
49375735 private MenuItem mergeGeometriesItem;
49385736 private MenuItem copyItem;
49395737 private MenuItem pasteItem;
5738
+ private MenuItem pasteIntoItem;
49405739 private MenuItem pasteLinkItem;
49415740 private MenuItem pasteCloneItem;
49425741 private MenuItem pasteExpandItem;
4943
- private MenuItem clearItem;
5742
+ private MenuItem deleteItem;
49445743 private MenuItem clearAllItem;
49455744 private MenuItem genUVItem;
49465745 private MenuItem genNormalsMESHItem;
....@@ -4975,6 +5774,10 @@
49755774 private MenuItem showleavesItem;
49765775 private MenuItem markleavesItem;
49775776 private MenuItem unmarkleavesItem;
5777
+ private MenuItem rewindleavesItem;
5778
+ private MenuItem unrewindleavesItem;
5779
+ private MenuItem randomleavesItem;
5780
+ private MenuItem unrandomleavesItem;
49785781
49795782 private MenuItem flipVItem;
49805783 private MenuItem unflipVItem;
....@@ -4986,15 +5789,17 @@
49865789 private MenuItem panoTexturesItem;
49875790
49885791 private MenuItem resetCentroidItem;
4989
- private MenuItem transformgeometryItem;
5792
+ private MenuItem resetCentroidXZItem;
49905793 private MenuItem resetTransformItem;
5794
+ private MenuItem transformGeometryItem;
5795
+ private MenuItem transformChildrenItem;
49915796 private MenuItem hideItem;
49925797 private MenuItem grabItem;
49935798 private MenuItem backItem;
49945799 private MenuItem frontItem;
49955800 private MenuItem cameraItem;
49965801 private MenuItem compositeItem;
4997
- private MenuItem randomItem;
5802
+ private MenuItem switchItem;
49985803 private MenuItem physicsItem;
49995804 private MenuItem frameselectorItem;
50005805 private MenuItem scriptNodeItem;
....@@ -5009,6 +5814,7 @@
50095814
50105815 private MenuItem resetParentItem;
50115816 private MenuItem repairParentItem;
5817
+ private MenuItem repairShadowItem;
50125818 private MenuItem sortbysizeItem;
50135819 private MenuItem sortbynameItem;
50145820
....@@ -5017,6 +5823,8 @@
50175823 private MenuItem attachBumpItem;
50185824 private MenuItem detachBumpItem;
50195825 private MenuItem pigmentBumpItem;
5826
+ private MenuItem embedTexturesItem;
5827
+ private MenuItem deEmbedTexturesItem;
50205828
50215829 private MenuItem particleItem;
50225830 private MenuItem ragdollItem;
....@@ -5033,7 +5841,7 @@
50335841 private MenuItem blobItem;
50345842 private MenuItem latheItem;
50355843 private MenuItem bezierItem;
5036
- private MenuItem checkerItem;
5844
+ private MenuItem overlayItem;
50375845 private MenuItem meshItem;
50385846 // private MenuItem meshGroupItem;
50395847 private MenuItem springItem;
....@@ -5055,11 +5863,6 @@
50555863 private MenuItem doubleItem;
50565864 private MenuItem tripleItem;
50575865
5058
- private MenuItem importGFDItem;
5059
- private MenuItem importVRMLX3DItem;
5060
- private MenuItem import3DSItem;
5061
- private MenuItem importOBJItem;
5062
-
50635866 private MenuItem computeAOItem;
50645867 private MenuItem recompileItem;
50655868 private MenuItem editScriptItem;
....@@ -5069,4 +5872,8 @@
50695872 private MenuItem analyzeItem;
50705873 private MenuItem dumpItem;
50715874 //boolean freezemodel = false;
5875
+
5876
+ Menu cameraMenu;
5877
+ MenuItem editCameraItem;
5878
+ MenuItem restoreCameraItem;
50725879 }