Normand Briere
2019-06-24 c67da2e5d8655704601d6d06e8bc60aabe212253
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,
....@@ -73,7 +74,7 @@
7374 this.copy = this.group = copy;
7475 //selectees = this.group.selectees;
7576
76
- SetupMenu2(objEditor);
77
+ SetupMenu2(this); //objEditor);
7778 SetupUI2(objEditor);
7879 objEditor.SetupUI(true);
7980 SetupViews(objEditor);
....@@ -97,14 +98,14 @@
9798
9899 void CloneClipboard(boolean supports)
99100 {
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));
101
+ assert(Grafreed.clipboard.parent == null);
102
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
103
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
104
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
105
+ makeSomething(CloneObject(Grafreed.clipboard.get(0), false));
105106 else
106
- makeSomething(CloneObject(GrafreeD.clipboard, false));
107
- GrafreeD.clipboard.get(0).parent = keepparent;
107
+ makeSomething(CloneObject(Grafreed.clipboard, false));
108
+ Grafreed.clipboard.get(0).parent = keepparent;
108109 }
109110
110111 static Object3D CloneObject(Object3D obj, boolean supports)
....@@ -118,7 +119,7 @@
118119 // obj.support = null;
119120 if (!supports)
120121 obj.SaveSupports();
121
- Object3D clone = (Object3D)GrafreeD.clone(obj);
122
+ Object3D clone = (Object3D)Grafreed.clone(obj);
122123 obj.parent = parent;
123124 // obj.support = support;
124125 // clone.support = support; // aout 2013
....@@ -147,8 +148,129 @@
147148
148149 //JTextField nameField;
149150
150
- void SetupMenu2(ObjEditor oe)
151
+ void SetupMenu2(GroupEditor oe)
151152 {
153
+ Menu menu;
154
+ oe.menuBar.add(menu = new Menu("Edit"));
155
+ //editItem = menu.add(new MenuItem("Edit"));
156
+ //editItem.addActionListener(this);
157
+
158
+// undoItem = menu.add(new MenuItem("Undo"));
159
+// undoItem.addActionListener(this);
160
+// redoItem = menu.add(new MenuItem("Redo"));
161
+// redoItem.addActionListener(this);
162
+// menu.add("-");
163
+ duplicateItem = menu.add(new MenuItem("Duplicate"));
164
+ duplicateItem.addActionListener(this);
165
+ cloneItem = menu.add(new MenuItem("Clone"));
166
+ cloneItem.addActionListener(this);
167
+ if (Globals.ADVANCED)
168
+ {
169
+ cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
170
+ cloneSupportItem.addActionListener(this);
171
+ }
172
+ menu.add("-");
173
+ cutItem = menu.add(new MenuItem("Cut"));
174
+ cutItem.addActionListener(this);
175
+ copyItem = menu.add(new MenuItem("Copy"));
176
+ copyItem.addActionListener(this);
177
+ pasteItem = menu.add(new MenuItem("Paste"));
178
+ pasteItem.addActionListener(this);
179
+
180
+ menu.add("-");
181
+ pasteIntoItem = menu.add(new MenuItem("Paste into"));
182
+ pasteIntoItem.addActionListener(this);
183
+ pasteLinkItem = menu.add(new MenuItem("Paste link"));
184
+ pasteLinkItem.addActionListener(this);
185
+ pasteCloneItem = menu.add(new MenuItem("Paste clone"));
186
+ pasteCloneItem.addActionListener(this);
187
+// pasteExpandItem = menu.add(new MenuItem("Paste expand"));
188
+// pasteExpandItem.addActionListener(this);
189
+ menu.add("-");
190
+ clearItem = menu.add(new MenuItem("Clear"));
191
+ clearItem.addActionListener(this);
192
+
193
+ if (Globals.ADVANCED)
194
+ {
195
+ // Deletes the cameras...
196
+ clearAllItem = menu.add(new MenuItem("Clear All"));
197
+ clearAllItem.addActionListener(this);
198
+ }
199
+
200
+ menuBar.add(cameraMenu = new Menu("View"));
201
+ //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer"));
202
+ //zBufferItem.addActionListener(this);
203
+ //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens"));
204
+ //normalLensItem.addActionListener(this);
205
+ cameraMenu.add(revertCameraItem = new MenuItem("Restore Viewpoint"));
206
+ revertCameraItem.addActionListener(this);
207
+
208
+ cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen"));
209
+ toggleFullScreenItem.addItemListener(this);
210
+ toggleFullScreenItem.setState(CameraPane.FULLSCREEN);
211
+ cameraMenu.add("-");
212
+
213
+ cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture"));
214
+ toggleTextureItem.addItemListener(this);
215
+ toggleTextureItem.setState(CameraPane.textureon);
216
+
217
+ cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch"));
218
+ toggleSwitchItem.addItemListener(this);
219
+ toggleSwitchItem.setState(CameraPane.SWITCH);
220
+
221
+ cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles"));
222
+ toggleHandleItem.addItemListener(this);
223
+ toggleHandleItem.setState(CameraPane.HANDLES);
224
+
225
+ cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode"));
226
+ togglePaintItem.addItemListener(this);
227
+ togglePaintItem.setState(CameraPane.PAINTMODE);
228
+
229
+ if (Globals.ADVANCED)
230
+ {
231
+ cameraMenu.add("-");
232
+ cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live"));
233
+ toggleLiveItem.addItemListener(this);
234
+ toggleLiveItem.setState(Globals.isLIVE());
235
+
236
+ cameraMenu.add(stepItem = new MenuItem("Step"));
237
+ stepItem.addActionListener(this);
238
+ // cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List"));
239
+ // toggleDLItem.addItemListener(this);
240
+ // toggleDLItem.setState(false);
241
+
242
+ cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render"));
243
+ toggleRenderItem.addItemListener(this);
244
+ toggleRenderItem.setState(!CameraPane.frozen);
245
+
246
+ cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug"));
247
+ toggleDebugItem.addItemListener(this);
248
+ toggleDebugItem.setState(Globals.DEBUG);
249
+
250
+ cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum"));
251
+ toggleFrustumItem.addItemListener(this);
252
+ toggleFrustumItem.setState(CameraPane.FRUSTUM);
253
+
254
+ cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact"));
255
+ toggleFootContactItem.addItemListener(this);
256
+ toggleFootContactItem.setState(CameraPane.FOOTCONTACT);
257
+
258
+ cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline"));
259
+ toggleTimelineItem.addItemListener(this);
260
+ }
261
+
262
+// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root"));
263
+// toggleRootItem.addItemListener(this);
264
+// toggleRootItem.setState(false);
265
+// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation"));
266
+// animationItem.addItemListener(this);
267
+// animationItem.setState(CameraPane.ANIMATION);
268
+ cameraMenu.add("-");
269
+ cameraMenu.add(editCameraItem = new MenuItem("Save Viewpoint"));
270
+ editCameraItem.addActionListener(this);
271
+
272
+ if (Globals.ADVANCED)
273
+ {
152274 oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
153275 //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
154276 //cameraMenu.add(switchItem = new MenuItem("Reverse View"));
....@@ -160,45 +282,17 @@
160282 lookAtItem.addActionListener(this);
161283 //lookFromItem.addActinoListener(this);
162284 //switchItem.addActionListener(this);
163
- Menu menu;
164
- oe.menuBar.add(menu = new Menu("Edit"));
165
- //editItem = menu.add(new MenuItem("Edit"));
166
- //editItem.addActionListener(this);
167
- duplicateItem = menu.add(new MenuItem("Duplicate"));
168
- duplicateItem.addActionListener(this);
169
- menu.add("-");
170
- cloneItem = menu.add(new MenuItem("Clone"));
171
- cloneItem.addActionListener(this);
172
- cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
173
- cloneSupportItem.addActionListener(this);
174
- menu.add("-");
175
- cutItem = menu.add(new MenuItem("Cut"));
176
- cutItem.addActionListener(this);
177
- copyItem = menu.add(new MenuItem("Copy"));
178
- copyItem.addActionListener(this);
179
- pasteItem = menu.add(new MenuItem("Paste"));
180
- pasteItem.addActionListener(this);
181
- pasteLinkItem = menu.add(new MenuItem("Paste link"));
182
- pasteLinkItem.addActionListener(this);
183
- pasteCloneItem = menu.add(new MenuItem("Paste clone"));
184
- pasteCloneItem.addActionListener(this);
185
-// pasteExpandItem = menu.add(new MenuItem("Paste expand"));
186
-// pasteExpandItem.addActionListener(this);
187
- clearItem = menu.add(new MenuItem("Clear"));
188
- clearItem.addActionListener(this);
189
- clearAllItem = menu.add(new MenuItem("Clear All"));
190
- clearAllItem.addActionListener(this);
191
-
285
+ }
286
+
192287 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);
288
+ if (Globals.ADVANCED)
289
+ {
197290 revertMeshItem = menu.add(new MenuItem("Revert Meshes"));
198291 revertMeshItem.addActionListener(this);
199292 resetreferencesItem = menu.add(new MenuItem("Reset Mesh References"));
200293 resetreferencesItem.addActionListener(this);
201294 menu.add("-");
295
+ }
202296 overwriteGeoItem = menu.add(new MenuItem("Overwrite Geometry"));
203297 overwriteGeoItem.addActionListener(this);
204298 overwriteMatItem = menu.add(new MenuItem("Overwrite Material"));
....@@ -210,19 +304,26 @@
210304 overwriteUVItem = menu.add(new MenuItem("Overwrite UV"));
211305 overwriteUVItem.addActionListener(this);
212306 menu.add("-");
307
+ if (Globals.ADVANCED)
308
+ {
213309 generateMeshItem = menu.add(new MenuItem("Generate Meshes"));
214310 generateMeshItem.addActionListener(this);
215311 poseMeshItem = menu.add(new MenuItem("Set Pose Meshes"));
216312 poseMeshItem.addActionListener(this);
217313 menu.add("-");
314
+ }
218315 resetsupportItem = menu.add(new MenuItem("Reset support"));
219316 resetsupportItem.addActionListener(this);
220317 linkverticesItem = menu.add(new MenuItem("Link to Support"));
221318 linkverticesItem.addActionListener(this);
222319 relinkverticesItem = menu.add(new MenuItem("Re-link to Support"));
223320 relinkverticesItem.addActionListener(this);
321
+
322
+ if (Globals.ADVANCED)
323
+ {
224324 setMasterItem = menu.add(new MenuItem("Set Master Mesh"));
225325 setMasterItem.addActionListener(this);
326
+ }
226327
227328 oe.menuBar.add(menu = new Menu("Group"));
228329 grabItem = menu.add(new MenuItem("Grab"));
....@@ -233,27 +334,32 @@
233334 frontItem.addActionListener(this);
234335 compositeItem = menu.add(new MenuItem("Composite"));
235336 compositeItem.addActionListener(this);
236
- hideItem = menu.add(new MenuItem("Hide"));
337
+ hideItem = menu.add(new MenuItem("Hidden Group"));
237338 hideItem.addActionListener(this);
238339 ungroupItem = menu.add(new MenuItem("Ungroup"));
239340 ungroupItem.addActionListener(this);
240341 menu.add("-");
241
- randomItem = menu.add(new MenuItem("Random"));
342
+ randomItem = menu.add(new MenuItem("Switch node"));
242343 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);
247344 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
248345 switchGeoItem.addActionListener(this);
249346 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
250347 switchTransfoItem.addActionListener(this);
251
- morphItem = menu.add(new MenuItem("Morph"));
348
+ morphItem = menu.add(new MenuItem("Morph Group"));
252349 morphItem.addActionListener(this);
350
+
351
+ if (Globals.ADVANCED)
352
+ {
353
+ menu.add("-");
354
+ physicsItem = menu.add(new MenuItem("Physics"));
355
+ physicsItem.addActionListener(this);
356
+ frameselectorItem = menu.add(new MenuItem("Frame Selector"));
357
+ frameselectorItem.addActionListener(this);
253358 scriptNodeItem = menu.add(new MenuItem("Script Node"));
254359 scriptNodeItem.addActionListener(this);
255360 cameraItem = menu.add(new MenuItem("Camera"));
256361 cameraItem.addActionListener(this);
362
+ }
257363
258364 oe.menuBar.add(menu = new Menu("Object"));
259365 textureItem = menu.add(new MenuItem("Texture"));
....@@ -262,27 +368,35 @@
262368 billboardItem.addActionListener(this);
263369 csgItem = menu.add(new MenuItem("CSG"));
264370 csgItem.addActionListener(this);
265
- shadowXItem = menu.add(new MenuItem("Shadow X"));
371
+ shadowXItem = menu.add(new MenuItem("Shadow Red"));
266372 shadowXItem.addActionListener(this);
267
- shadowYItem = menu.add(new MenuItem("Shadow Y"));
373
+ shadowYItem = menu.add(new MenuItem("Shadow Green"));
268374 shadowYItem.addActionListener(this);
269
- shadowZItem = menu.add(new MenuItem("Shadow Z"));
375
+ shadowZItem = menu.add(new MenuItem("Shadow Blue"));
270376 shadowZItem.addActionListener(this);
377
+ if (Globals.ADVANCED)
378
+ {
379
+ menu.add("-");
271380 linkerItem = menu.add(new MenuItem("Linker"));
272381 linkerItem.addActionListener(this);
273
- templateItem = menu.add(new MenuItem("Template"));
274
- templateItem.addActionListener(this);
275382 attributeItem = menu.add(new MenuItem("Attribute"));
276383 attributeItem.addActionListener(this);
384
+ templateItem = menu.add(new MenuItem("Template"));
385
+ templateItem.addActionListener(this);
277386 pointflowItem = menu.add(new MenuItem("Point Flow"));
278387 pointflowItem.addActionListener(this);
388
+ }
279389 menu.add("-");
280390 resetTransformItem = menu.add(new MenuItem("Reset Transform"));
281391 resetTransformItem.addActionListener(this);
282392 resetCentroidItem = menu.add(new MenuItem("Reset Centroid"));
283393 resetCentroidItem.addActionListener(this);
284
- transformgeometryItem = menu.add(new MenuItem("Transform Geometry"));
285
- transformgeometryItem.addActionListener(this);
394
+ resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY"));
395
+ resetCentroidXZItem.addActionListener(this);
396
+ transformGeometryItem = menu.add(new MenuItem("Transform Geometry"));
397
+ transformGeometryItem.addActionListener(this);
398
+ transformChildrenItem = menu.add(new MenuItem("Transform Children"));
399
+ transformChildrenItem.addActionListener(this);
286400
287401 oe.menuBar.add(menu = new Menu("Geometry"));
288402 genUVItem = menu.add(new MenuItem("Generate UV"));
....@@ -293,8 +407,11 @@
293407 genNormalsCADItem.addActionListener(this);
294408 genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals"));
295409 genNormalsMESHItem.addActionListener(this);
410
+ if (Globals.ADVANCED)
411
+ {
296412 genNormalsMINEItem = menu.add(new MenuItem("My Normals"));
297413 genNormalsMINEItem.addActionListener(this);
414
+ }
298415 stripifyItem = menu.add(new MenuItem("Stripify"));
299416 stripifyItem.addActionListener(this);
300417 unstripifyItem = menu.add(new MenuItem("Unstripify"));
....@@ -316,23 +433,34 @@
316433 reduce34MeshItem.addActionListener(this);
317434 increaseMeshItem = menu.add(new MenuItem("Increase mesh"));
318435 increaseMeshItem.addActionListener(this);
319
- smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
320
- smoothMeshItem.addActionListener(this);
321436 clipMeshItem = menu.add(new MenuItem("Clip mesh"));
322437 clipMeshItem.addActionListener(this);
438
+
439
+ if (Globals.ADVANCED)
440
+ {
441
+ smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
442
+ smoothMeshItem.addActionListener(this);
443
+ }
323444
324445 oe.menuBar.add(menu = new Menu("Attributes"));
325446 clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
326447 clearMaterialsItem.addActionListener(this);
448
+ resetAllItem = menu.add(new MenuItem("Reset All"));
449
+ resetAllItem.addActionListener(this);
450
+ stepAllItem = menu.add(new MenuItem("Step All"));
451
+ stepAllItem.addActionListener(this);
327452 menu.add("-");
328453 liveleavesItem = menu.add(new MenuItem("Live Leaves"));
329454 liveleavesItem.addActionListener(this);
330455 unliveleavesItem = menu.add(new MenuItem("Unlive Leaves"));
331456 unliveleavesItem.addActionListener(this);
457
+ if (Globals.ADVANCED)
458
+ {
332459 supportleavesItem = menu.add(new MenuItem("Support Leaves"));
333460 supportleavesItem.addActionListener(this);
334461 unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves"));
335462 unsupportleavesItem.addActionListener(this);
463
+ }
336464 hideleavesItem = menu.add(new MenuItem("Hide Leaves"));
337465 hideleavesItem.addActionListener(this);
338466 showleavesItem = menu.add(new MenuItem("Show Leaves"));
....@@ -341,6 +469,14 @@
341469 markleavesItem.addActionListener(this);
342470 unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves"));
343471 unmarkleavesItem.addActionListener(this);
472
+ rewindleavesItem = menu.add(new MenuItem("Rewind Leaves"));
473
+ rewindleavesItem.addActionListener(this);
474
+ unrewindleavesItem = menu.add(new MenuItem("Unrewind Leaves"));
475
+ unrewindleavesItem.addActionListener(this);
476
+ randomleavesItem = menu.add(new MenuItem("Random Leaves"));
477
+ randomleavesItem.addActionListener(this);
478
+ unrandomleavesItem = menu.add(new MenuItem("Unrandom Leaves"));
479
+ unrandomleavesItem.addActionListener(this);
344480 menu.add("-");
345481 flipVItem = menu.add(new MenuItem("Flip V"));
346482 flipVItem.addActionListener(this);
....@@ -376,35 +512,40 @@
376512 sortbynameItem = menu.add(new MenuItem("Sort by name"));
377513 sortbynameItem.addActionListener(this);
378514 menu.add("-");
515
+ shareGeometriesItem = menu.add(new MenuItem("Share Geometries"));
516
+ shareGeometriesItem.addActionListener(this);
517
+ mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries"));
518
+ mergeGeometriesItem.addActionListener(this);
519
+ if (Globals.ADVANCED)
520
+ {
521
+ // Pretty much the same as duplicate and clone.
379522 extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
380523 extractGeometriesItem.addActionListener(this);
381524 cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry"));
382525 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);
526
+ }
387527
388528 oe.menuBar.add(menu = new Menu("Insert"));
389529 buildCreateMenu(menu);
390530
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
-
402531 oe.menuBar.add(menu = new Menu("Tools"));
403532 buildToolsMenu(menu);
404533 }
405534
406535 void SetupUI2(ObjEditor oe)
407536 {
537
+ // June 2019
538
+ if (oe == null)
539
+ {
540
+ //super.SetupUI2(this);
541
+ //return;
542
+ }
543
+
544
+ if (copy != group)
545
+ {
546
+ //super.SetupUI2(this);
547
+ }
548
+
408549 //new Exception().printStackTrace();
409550
410551 oe.radioPanel = new JPanel(new GridBagLayout());
....@@ -433,153 +574,120 @@
433574 oe.radioPanel.add(dummyButton);
434575 oe.buttonGroup.add(dummyButton);
435576 */
436
- aConstraints.gridy += 1;
437
- oe.aConstraints.gridwidth = 1;
438
- oe.aConstraints.gridx = 0;
577
+ //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
439578
440
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", CameraPane.isLIVE()), oe.aConstraints);
579
+ //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
580
+ //minButton.setToolTipText("Minimize window");
581
+ //minButton.addActionListener(this);
582
+
583
+ oe.toolbarPanel.add(maxButton = new cButton("\u271A", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
584
+ maxButton.setToolTipText("Maximize window");
585
+ maxButton.addActionListener(this);
586
+
587
+ oe.toolbarPanel.add(fullButton = new cButton("\u2b1c", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
588
+ fullButton.setToolTipText("Full-screen window");
589
+ fullButton.addActionListener(this);
590
+
591
+ oe.toolbarPanel.add(undoButton = new cButton("\u21a9", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
592
+ undoButton.setToolTipText("Undo changes");
593
+ undoButton.addActionListener(this);
594
+
595
+ oe.toolbarPanel.add(redoButton = new cButton("\u21aa", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
596
+ redoButton.setToolTipText("Redo changes");
597
+ redoButton.addActionListener(this);
598
+
599
+ oe.toolbarPanel.add(saveButton = new cButton("\u21e3", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
600
+ saveButton.setToolTipText("Save changes");
601
+ saveButton.addActionListener(this);
602
+
603
+ oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints);
604
+ liveCB.setToolTipText("Enable animation");
441605 liveCB.addItemListener(this);
442606
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);
607
+ oe.toolbarPanel.add(oneStepButton = new cButton("\u29f4", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
608
+ oneStepButton.setToolTipText("Animate one step forward");
609
+ oneStepButton.addActionListener(this);
610
+
611
+ oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints);
612
+ fastCB.setToolTipText("Fast mode");
461613 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);
468
-
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);
614
+
615
+ oe.toolbarPanel.add(trackCB = new cCheckBox(":", CameraPane.TRACK)); //, oe.aConstraints);
616
+ trackCB.setToolTipText("Enable tracking");
503617 trackCB.addItemListener(this);
504618
505
- oe.aConstraints.gridx += 1;
506
- oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
619
+ oe.toolbarPanel.add(screenfitButton = new cButton("@", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
620
+ screenfitButton.setToolTipText("Screen fit");
507621 screenfitButton.addActionListener(this);
508
- oe.aConstraints.gridx += 1;
622
+
509623 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
510624 // 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;
515625
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);
626
+ if (Globals.ADVANCED)
627
+ {
628
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
629
+ snapobjectButton.addActionListener(this);
630
+ snapobjectButton.setToolTipText("Snap Object");
631
+ }
632
+
633
+ oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
634
+ flashSelectionButton.setToolTipText("Show selection");
522635 flashSelectionButton.addActionListener(this);
523636
524
- oe.toolbarPanel.add(new cButton(" ", false));
637
+ oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
525638
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);
639
+ oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
640
+ twoButton.setToolTipText("Show center view only");
532641 twoButton.addActionListener(this);
533
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
642
+ oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
534643 fourButton.addActionListener(this);
535
- oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
644
+ fourButton.setToolTipText("Show left panel only");
645
+ oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
646
+ sixButton.setToolTipText("2-column layout left");
536647 sixButton.addActionListener(this);
537
- oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
648
+ oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
649
+ threeButton.setToolTipText("2-column layout right");
538650 threeButton.addActionListener(this);
539
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
651
+ oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
652
+ sevenButton.setToolTipText("3-column layout");
540653 sevenButton.addActionListener(this);
541654 //
542655
543
- oe.toolbarPanel.add(rootButton = new cButton(" o o o E ")); //, oe.aConstraints);
656
+ oe.toolbarPanel.add(rootButton = new cButton("o o o", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
657
+ rootButton.setToolTipText("Edit selection in new tab");
544658 rootButton.addActionListener(this);
545
- oe.aConstraints.gridx += 1;
546
- oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
659
+
660
+ oe.toolbarPanel.add(closeButton = new cButton("X", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
661
+ closeButton.setToolTipText("Close tab");
547662 closeButton.addActionListener(this);
548663 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
549664 //clearButton.addActionListener(this);
550
- oe.aConstraints.gridx += 1;
551665
552
- oe.aConstraints.gridx = 1; //
553
- oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints);
666
+ editCommandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
667
+ editButton.setToolTipText("Edit selection");
554668 editButton.addActionListener(this);
555
- oe.aConstraints.gridx += 1;
556
- oe.aConstraints.weighty = 0;
557
- oe.aConstraints.gridwidth = 1;
558669
559
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
670
+ editCommandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
671
+ uneditButton.setToolTipText("Unedit selection");
560672 uneditButton.addActionListener(this);
561673
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);
674
+ editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
675
+ allParamsButton.setToolTipText("Edit all params");
574676 allParamsButton.addActionListener(this);
575677
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);
678
+ editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
679
+ clearPanelButton.setToolTipText("Clear edit panel");
680
+ clearPanelButton.addActionListener(this);
681
+
682
+ editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
683
+ unselectButton.setToolTipText("Unselect");
581684 unselectButton.addActionListener(this);
582685
686
+ editCommandsPanel.preferredHeight = 1;
687
+
688
+// oe.treePanel.add(commandsPanel);
689
+// oe.treePanel.Return();
690
+
583691 // oe.aConstraints.gridx += 1;
584692 // oe.aConstraints.weighty = 0;
585693 // oe.aConstraints.gridwidth = 1;
....@@ -591,40 +699,37 @@
591699 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
592700 // gcButton.addActionListener(this);
593701
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;
702
+ cGridBag jSPPanel = new cGridBag();
703
+
704
+ JScrollPane jSP;
605705 //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);
706
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints);
607707 ResetModel();
608
- oe.aConstraints.weighty = 0.5;
609
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
610
- oe.aConstraints.gridy += 1;
611
- oe.aConstraints.gridwidth = 1;
708
+
709
+ oe.treePanel.add(jSPPanel);
710
+ oe.treePanel.Return();
612711
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);
712
+ cGridBag copyOptionsPanel = new cGridBag();
713
+
714
+ copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
715
+ colorCB.setToolTipText("Copy color when dropped");
617716 colorCB.addItemListener(this);
618
- oe.aConstraints.gridx += 2;
619
- oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints);
717
+
718
+ copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
719
+ materialCB.setToolTipText("Copy material when dropped");
620720 materialCB.addItemListener(this);
621
- oe.aConstraints.gridx += 2;
622
- oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints);
721
+
722
+ copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
723
+ textureCB.setToolTipText("Copy texture when dropped");
623724 textureCB.addItemListener(this);
624725
625
- oe.aConstraints.gridx = 0;
626
- oe.aConstraints.gridy += 1;
726
+ copyOptionsPanel.preferredHeight = 1;
727
+ oe.treePanel.add(copyOptionsPanel);
728
+ oe.treePanel.Return();
627729
730
+// mainPanel.setDividerLocation(0.5); //1.0);
731
+// mainPanel.setResizeWeight(0.5);
732
+
628733 //jList.addListSelectionListener(this);
629734 oe.jTree.addTreeSelectionListener(this);
630735 //jTree.setRootVisible(false);
....@@ -646,10 +751,98 @@
646751 radio.layout = sevenButton;
647752 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
648753 }
754
+
755
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
756
+ {
757
+ panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
758
+ boxCB.setToolTipText("Display bounding boxes");
759
+ boxCB.addItemListener(this);
760
+
761
+ panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
762
+ zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
763
+ zoomBoxCB.addItemListener(this);
764
+
765
+ if (true) // Globals.ADVANCED)
766
+ {
767
+ panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
768
+ supportCB.setToolTipText("Enable rigging");
769
+ supportCB.addItemListener(this);
770
+
771
+ // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
772
+ // localCB.addItemListener(this);
773
+
774
+ panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
775
+ crowdCB.setToolTipText("Used for crowds");
776
+ crowdCB.addItemListener(this);
777
+
778
+ panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
779
+ smoothCB.setToolTipText("Snapping delay");
780
+ smoothCB.addItemListener(this);
781
+
782
+ panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
783
+ slowCB.setToolTipText("Smooth interpolation");
784
+ slowCB.addItemListener(this);
785
+
786
+// constraints.gridy += 1;
787
+// panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
788
+// speakerMocapCB.addItemListener(this);
789
+
790
+ if (false)
791
+ {
792
+ // handled in scripts
793
+ //constraints.gridy += 1;
794
+ panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints);
795
+ speakerCameraCB.addItemListener(this);
796
+
797
+ //constraints.gridy += 1;
798
+ panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints);
799
+ speakerFocusCB.addItemListener(this);
800
+
801
+ //constraints.gridy += 1;
802
+ panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
803
+ smoothfocusCB.addItemListener(this);
804
+ }
805
+
806
+//constraints.gridx += 1;
807
+//panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
808
+// debugCB.addItemListener(this);
809
+
810
+ panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
811
+ oeilCB.setToolTipText("Move camera when tracking target");
812
+ oeilCB.addItemListener(this);
813
+
814
+ panel.add(shadowCB = new cCheckBox("Shadow", Globals.COMPUTESHADOWWHENLIVE)); //, constraints);
815
+ shadowCB.setToolTipText("Compute shadows when live");
816
+ shadowCB.addItemListener(this);
817
+
818
+ if (Globals.ADVANCED)
819
+ {
820
+ panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
821
+ lookAtCB.setToolTipText("Look-at target");
822
+ lookAtCB.addItemListener(this);
823
+ }
824
+
825
+ }
826
+
827
+ cGridBag fill = new cGridBag();
828
+
829
+ fill.preferredHeight = 200;
830
+
831
+ panel.add(fill);
832
+
833
+ }
649834
650835 void EditObject(Object3D obj)
651836 {
652837 cRadio radioButton = new cRadio(obj.name);
838
+
839
+ // Patch to avoid bug with transparency.
840
+ radioButton.hadMaterial = obj.material != null;
841
+ if (!radioButton.hadMaterial)
842
+ {
843
+ obj.material = new cMaterial();
844
+ }
845
+
653846 radioButton.SetObject(obj);
654847 radioButton.layout = sevenButton;
655848 radioButton.SetCamera(cameraView.renderCamera, false);
....@@ -658,8 +851,11 @@
658851 buttonGroup.add(radioButton);
659852 radioButton.doClick();
660853 }
854
+
661855 void SetupViews(ObjEditor oe)
662856 {
857
+ theFrame = this;
858
+
663859 oe.SetupViews();
664860
665861 System.out.println("SetupViews");
....@@ -676,13 +872,16 @@
676872 JCheckBox fastCB;
677873 JCheckBox slowCB;
678874 JCheckBox boxCB;
875
+ JCheckBox zoomBoxCB;
679876 JCheckBox trackCB;
680877 JCheckBox smoothfocusCB;
681878 // JCheckBox speakerMocapCB;
682879 JCheckBox speakerCameraCB;
683880 JCheckBox speakerFocusCB;
684881 JCheckBox debugCB;
882
+
685883 JCheckBox oeilCB;
884
+ JCheckBox shadowCB;
686885 JCheckBox lookAtCB;
687886
688887 // static int COLOR = 1;
....@@ -721,6 +920,7 @@
721920 } else if(e.getSource() == liveCB)
722921 {
723922 cameraView.ToggleLive();
923
+ refreshContents(false);
724924 }
725925 else if(e.getSource() == supportCB)
726926 {
....@@ -756,6 +956,10 @@
756956 cameraView.repaint();
757957 // refreshContents();
758958 }
959
+ else if(e.getSource() == zoomBoxCB)
960
+ {
961
+ cameraView.ToggleZoomBoxMode();
962
+ }
759963 else if(e.getSource() == smoothfocusCB)
760964 {
761965 cameraView.ToggleSmoothFocus();
....@@ -780,6 +984,10 @@
780984 else if(e.getSource() == oeilCB)
781985 {
782986 cameraView.ToggleOeil();
987
+ }
988
+ else if(e.getSource() == shadowCB)
989
+ {
990
+ Globals.COMPUTESHADOWWHENLIVE ^= true;
783991 }
784992 else if(e.getSource() == lookAtCB)
785993 {
....@@ -869,7 +1077,9 @@
8691077 // objEditor.DropFile((java.io.File[]) object, true);
8701078 // return;
8711079 // }
872
- if (string.charAt(0) == '/')
1080
+
1081
+ // File path for Mac and Windows
1082
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
8731083 {
8741084 // file(s)
8751085 String[] names = string.split("\n");
....@@ -896,7 +1106,7 @@
8961106
8971107 flashIt = false;
8981108 CameraPane pane = (CameraPane) target;
899
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1109
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
9001110 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
9011111
9021112 if (group.selection.size() == 1)
....@@ -923,11 +1133,11 @@
9231133 {
9241134 loadClipboard(true);
9251135 objEditor.jTree.setSelectionPath(destinationPath);
926
- pasteInto(false);
1136
+ pasteInto(false, false);
9271137 } else {
9281138 loadClipboard(false);
9291139 objEditor.jTree.setSelectionPath(destinationPath);
930
- pasteInto(false); // true); // ???
1140
+ pasteInto(false, false); // true); // ???
9311141 }
9321142 }
9331143 public void dropActionChanged(DropTargetDragEvent dtde)
....@@ -1049,27 +1259,33 @@
10491259 kleinItem.addActionListener(this);
10501260 particleItem = menu.add(new MenuItem("Particle system"));
10511261 particleItem.addActionListener(this);
1262
+ if (Globals.ADVANCED)
1263
+ {
10521264 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10531265 ragdollItem.addActionListener(this);
10541266 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10551267 ragdoll2Item.addActionListener(this);
1268
+ }
10561269 menu.add("-");
1057
- meshItem = menu.add(new MenuItem("Mesh"));
1270
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10581271 meshItem.addActionListener(this);
10591272 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10601273 // meshGroupItem.addActionListener(this);
1274
+ if (Globals.ADVANCED)
1275
+ {
10611276 springItem = menu.add(new MenuItem("Spring"));
10621277 springItem.addActionListener(this);
10631278 flagItem = menu.add(new MenuItem("Flag"));
10641279 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);
10691280 blobItem = menu.add(new MenuItem("Blob"));
10701281 blobItem.addActionListener(this);
10711282 latheItem = menu.add(new MenuItem("Lathe"));
10721283 latheItem.addActionListener(this);
1284
+ }
1285
+ bezierItem = menu.add(new MenuItem("Bezier Patch"));
1286
+ bezierItem.addActionListener(this);
1287
+ overlayItem = menu.add(new MenuItem("Overlay"));
1288
+ overlayItem.addActionListener(this);
10731289 lightItem = menu.add(new MenuItem("Light"));
10741290 lightItem.addActionListener(this);
10751291 menu.add("-");
....@@ -1079,39 +1295,44 @@
10791295 loopItem.addActionListener(this);
10801296 doubleItem = menu.add(new MenuItem("Fork"));
10811297 doubleItem.addActionListener(this);
1298
+ if (Globals.ADVANCED)
1299
+ {
10821300 tripleItem = menu.add(new MenuItem("Trident"));
10831301 tripleItem.addActionListener(this);
1302
+ }
10841303 }
10851304
10861305 void buildToolsMenu(Menu menu)
10871306 {
10881307 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
10891308 animationItem.addItemListener(this);
1090
- animationItem.setState(CameraPane.ANIMATION);
1309
+ animationItem.setState(Globals.ANIMATION);
10911310
10921311 menu.add("-");
10931312 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
10941313 parseverticesItem.addActionListener(this);
10951314 textureFieldItem = menu.add(new MenuItem("Texture Field"));
10961315 textureFieldItem.addActionListener(this);
1097
- alignItem = menu.add(new MenuItem("Align"));
1316
+ alignItem = menu.add(new MenuItem("Align Objects"));
10981317 alignItem.addActionListener(this);
1099
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1100
- mirrorItem.addActionListener(this);
11011318 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
11021319 reduceMorphItem.addActionListener(this);
11031320 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
11041321 reduce34MorphItem.addActionListener(this);
1105
-
1322
+ menu.add("-");
11061323 menu.add(computeAOItem = new MenuItem("Compute AO"));
11071324 computeAOItem.addActionListener(this);
1108
- menu.add("-");
11091325
1326
+ if (Globals.ADVANCED)
1327
+ {
1328
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1329
+ mirrorItem.addActionListener(this);
1330
+ menu.add("-");
11101331 menu.add(memoryItem = new MenuItem("Memory Usage"));
11111332 memoryItem.addActionListener(this);
11121333 menu.add(analyzeItem = new MenuItem("Analyze"));
11131334 analyzeItem.addActionListener(this);
1114
- menu.add(dumpItem = new MenuItem("Dump"));
1335
+ menu.add(dumpItem = new MenuItem("Print"));
11151336 dumpItem.addActionListener(this);
11161337 // menu.add(pathItem = new MenuItem("From-to path"));
11171338 // pathItem.addActionListener(this);
....@@ -1120,6 +1341,8 @@
11201341 resetParentItem.addActionListener(this);
11211342 repairParentItem = menu.add(new MenuItem("Repair Parent"));
11221343 repairParentItem.addActionListener(this);
1344
+ repairShadowItem = menu.add(new MenuItem("Repair Shadow"));
1345
+ repairShadowItem.addActionListener(this);
11231346 menu.add(invariantsItem = new MenuItem("Invariants"));
11241347 invariantsItem.addActionListener(this);
11251348 menu.add(recompileItem = new MenuItem("Recompile"));
....@@ -1127,6 +1350,7 @@
11271350 menu.add("-");
11281351 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11291352 editScriptItem.addActionListener(this);
1353
+ }
11301354 }
11311355
11321356 void ScreenFit()
....@@ -1249,6 +1473,7 @@
12491473 shadow.material = new cMaterial(obj.material);
12501474 shadow.material.diffuse = 0.0001f;
12511475 shadow.material.specular = 0.0001f;
1476
+ //shadow.projectedVertices[1].x = 300;
12521477
12531478 makeSomething(shadow);
12541479 }
....@@ -1455,9 +1680,9 @@
14551680
14561681 void Overwrite(int mask)
14571682 {
1458
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
1683
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14591684 {
1460
- Object3D content = GrafreeD.clipboard.get(0);
1685
+ Object3D content = Grafreed.clipboard.get(0);
14611686
14621687 if (content instanceof cGroup && ((cGroup)content).transientlink )
14631688 content = ((cGroup)content).get(0);
....@@ -1480,6 +1705,7 @@
14801705 //
14811706 public void actionPerformed(ActionEvent event) // , Object arg)
14821707 {
1708
+ Object source = event.getSource();
14831709 /*
14841710 if (event.getSource() == nameField)
14851711 {
....@@ -1491,11 +1717,11 @@
14911717 }
14921718 else
14931719 */
1494
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1720
+ if (source == lookAtItem || source == lookFromItem)
14951721 {
14961722 ScreenFit();
14971723 } else
1498
- if (event.getSource() == switchItem)
1724
+ if (source == switchItem)
14991725 {
15001726 cVector v1 = new cVector();
15011727 cVector v2 = new cVector();
....@@ -1504,11 +1730,11 @@
15041730 objEditor.cameraView.renderCamera.setAim(v2, v1);
15051731 objEditor.cameraView.repaint();
15061732 } else
1507
- if (event.getSource() == rectoidItem)
1733
+ if (source == rectoidItem)
15081734 {
15091735 makeSomething(new Box());
15101736 } else
1511
- if (event.getSource() == particleItem)
1737
+ if (source == particleItem)
15121738 {
15131739 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15141740 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1529,9 +1755,9 @@
15291755 applyExample(particleGeom, "SMOKE");
15301756 makeSomething(particleGeom);
15311757 } else
1532
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1758
+ if (source == ragdollItem || source == ragdoll2Item)
15331759 {
1534
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1760
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15351761
15361762 ragdoll.toParent = LA.newMatrix();
15371763 ragdoll.fromParent = LA.newMatrix();
....@@ -1549,7 +1775,7 @@
15491775 } else
15501776 /*
15511777 */
1552
- if (event.getSource() == heightFieldItem)
1778
+ if (source == heightFieldItem)
15531779 {
15541780 Object3D obj = new Object3D();
15551781
....@@ -1587,31 +1813,31 @@
15871813
15881814 makeSomething(obj);
15891815 } else
1590
- if (event.getSource() == gridItem)
1816
+ if (source == gridItem)
15911817 {
15921818 makeSomething(new Grid());
15931819 } else
1594
- if (event.getSource() == ellipsoidItem)
1820
+ if (source == ellipsoidItem)
15951821 {
15961822 makeSomething(new Sphere());
15971823 } else
1598
- if (event.getSource() == coneItem)
1824
+ if (source == coneItem)
15991825 {
16001826 makeSomething(new Cone());
16011827 } else
1602
- if (event.getSource() == torusItem)
1828
+ if (source == torusItem)
16031829 {
16041830 makeSomething(new Torus());
16051831 } else
1606
- if (event.getSource() == superItem)
1832
+ if (source == superItem)
16071833 {
16081834 makeSomething(new Superellipsoid());
16091835 } else
1610
- if (event.getSource() == kleinItem)
1836
+ if (source == kleinItem)
16111837 {
16121838 makeSomething(new Klein());
16131839 } else
1614
- if (event.getSource() == blobItem)
1840
+ if (source == blobItem)
16151841 {
16161842 Blob blob = new Blob();
16171843 BlobComponent comp = new BlobComponent();
....@@ -1619,15 +1845,15 @@
16191845 //blob.retile();
16201846 makeSomething(blob);
16211847 } else
1622
- if (event.getSource() == latheItem)
1848
+ if (source == latheItem)
16231849 {
16241850 makeSomething(new Lathe());
16251851 } else
1626
- if (event.getSource() == bezierItem)
1852
+ if (source == bezierItem)
16271853 {
16281854 makeSomething(new BezierSurface());
16291855 } else
1630
- if (event.getSource() == checkerItem)
1856
+ if (source == overlayItem)
16311857 {
16321858 /*
16331859 Object3D obj = new BezierSurface(5,8);
....@@ -1642,7 +1868,7 @@
16421868 */
16431869 makeSomething(new Checker());
16441870 } else
1645
- if (event.getSource() == meshItem)
1871
+ if (source == meshItem)
16461872 {
16471873 Object3D itemtomake = new Object3D();
16481874 Object3D child;
....@@ -1663,35 +1889,35 @@
16631889 makeSomething(child);
16641890 }
16651891 } else
1666
- if (event.getSource() == springItem)
1892
+ if (source == springItem)
16671893 {
16681894 cSpring s = new cSpring();
16691895 s.setup();
16701896 makeSomething(s);
16711897 } else
1672
- if (event.getSource() == flagItem)
1898
+ if (source == flagItem)
16731899 {
16741900 cSpring s = new cFlag();
16751901 s.setup();
16761902 makeSomething(s);
16771903 } else
1678
- if (event.getSource() == lightItem)
1904
+ if (source == lightItem)
16791905 {
16801906 makeSomething(new Light());
16811907 } else
1682
- if (event.getSource() == csgItem)
1908
+ if (source == csgItem)
16831909 {
16841910 group(new CSG());
16851911 } else
1686
- if (event.getSource() == templateItem)
1912
+ if (source == templateItem)
16871913 {
16881914 group(new cTemplate());
16891915 } else
1690
- if (event.getSource() == attributeItem)
1916
+ if (source == attributeItem)
16911917 {
16921918 makeSomething(new Attribute());
16931919 } else
1694
- if (event.getSource() == pointflowItem)
1920
+ if (source == pointflowItem)
16951921 {
16961922 makeSomething(new PointFlow());
16971923 } else
....@@ -1703,7 +1929,7 @@
17031929 } else
17041930 */
17051931
1706
- if (event.getSource() == superLoopItem)
1932
+ if (source == superLoopItem)
17071933 {
17081934 Composite g = new cGroup();
17091935 for (int i=0; i<15; i++)
....@@ -1725,7 +1951,7 @@
17251951
17261952 group(g);
17271953 } else
1728
- if (event.getSource() == loopItem)
1954
+ if (source == loopItem)
17291955 {
17301956 Composite csg = new GroupLeaf();
17311957 csg.count = 5;
....@@ -1734,7 +1960,7 @@
17341960 csg.addChild(child);
17351961 child.addChild(csg);
17361962 } else
1737
- if (event.getSource() == doubleItem)
1963
+ if (source == doubleItem)
17381964 {
17391965 Composite csg = new GroupLeaf();
17401966 csg.count = 5;
....@@ -1746,7 +1972,7 @@
17461972 csg.addChild(child);
17471973 child.addChild(csg);
17481974 } else
1749
- if (event.getSource() == tripleItem)
1975
+ if (source == tripleItem)
17501976 {
17511977 Composite csg = new GroupLeaf();
17521978 csg.count = 4;
....@@ -1761,71 +1987,83 @@
17611987 csg.addChild(child);
17621988 child.addChild(csg);
17631989 } else
1764
-
1765
- if (event.getSource() == importGFDItem)
1990
+ if (source == computeAOItem)
17661991 {
1767
- ImportGFD();
1992
+ Globals.drawMode = CameraPane.OCCLUSION;
1993
+ Globals.theRenderer.repaint();
17681994 } 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)
1995
+ if (source == recompileItem)
17871996 {
17881997 Recompile();
17891998 refreshContents();
17901999 } else
1791
- if (event.getSource() == editScriptItem)
2000
+ if (source == editScriptItem)
17922001 {
17932002 OpenDialog();
17942003 refreshContents();
17952004 } else
1796
- if (event.getSource() == invariantsItem)
2005
+ if (source == invariantsItem)
17972006 {
17982007 System.out.println("Invariants:");
1799
- GrafreeD.grafreeD.universe.invariants();
2008
+ Grafreed.grafreeD.universe.invariants();
18002009 } else
1801
- if (event.getSource() == memoryItem)
2010
+ if (source == memoryItem)
18022011 {
18032012 //System.out.println("Invariants:");
18042013 PrintMemory();
18052014 } else
1806
- if (event.getSource() == pathItem)
2015
+ if (source == pathItem)
18072016 {
18082017 PrintPath();
18092018 } else
1810
- if (event.getSource() == analyzeItem)
2019
+ if (source == analyzeItem)
18112020 {
18122021 AnalyzeObject();
18132022 } else
1814
- if (event.getSource() == dumpItem)
2023
+ if (source == dumpItem)
18152024 {
18162025 DumpObject();
18172026 } else
1818
- if (event.getSource() == screenfitButton)
2027
+ if (source == minButton)
2028
+ {
2029
+ Minimize();
2030
+ } else
2031
+ if (source == maxButton)
2032
+ {
2033
+ Maximize();
2034
+ } else
2035
+ if (source == fullButton)
2036
+ {
2037
+ ToggleFullScreen();
2038
+ } else
2039
+ if (source == undoButton)
2040
+ {
2041
+ Undo();
2042
+ } else
2043
+ if (source == redoButton)
2044
+ {
2045
+ Redo();
2046
+ } else
2047
+ if (source == saveButton)
2048
+ {
2049
+ Save();
2050
+ } else
2051
+ if (source == oneStepButton)
2052
+ {
2053
+ Globals.ONESTEP = true;
2054
+ cameraView.repaint();
2055
+ } else
2056
+ if (source == screenfitButton)
18192057 {
18202058 //Reload(lastConverter, lastFilename, true);
18212059 ScreenFit();
18222060 } else
1823
- if (event.getSource() == screenfitpointButton)
2061
+ if (source == screenfitpointButton)
18242062 {
18252063 //Reload(lastConverter, lastFilename, true);
18262064 ScreenFitPoint();
18272065 } else
1828
- if (event.getSource() == snapobjectButton)
2066
+ if (source == snapobjectButton)
18292067 {
18302068 //Reload(lastConverter, lastFilename, true);
18312069 SnapObject();
....@@ -1836,13 +2074,13 @@
18362074 // Recompile();
18372075 // refreshContents();
18382076 // } else
1839
- if (event.getSource() == gcButton)
2077
+ if (source == gcButton)
18402078 {
18412079 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18422080 System.gc();
18432081 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18442082 } else
1845
- if (event.getSource() == editLeafItem)
2083
+ if (source == editLeafItem)
18462084 {
18472085 Object3D obj;
18482086 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1856,62 +2094,74 @@
18562094 }
18572095 refreshContents(true);
18582096 } else
1859
- if (event.getSource() == openWindowItem)
2097
+ if (source == openWindowItem)
18602098 {
18612099 EditSelection(true);
18622100 } else
1863
- if (event.getSource() == cutItem || event.getSource() == clearButton)
2101
+ if (source == cutItem || source == clearButton)
18642102 {
18652103 loadClipboard(true);
18662104 } else
1867
- if (event.getSource() == duplicateItem)
2105
+ if (source == undoItem)
18682106 {
1869
- Object3D keep = GrafreeD.clipboard;
2107
+ Undo();
2108
+ } else
2109
+ if (source == redoItem)
2110
+ {
2111
+ Redo();
2112
+ } else
2113
+ if (source == duplicateItem)
2114
+ {
2115
+ Object3D keep = Grafreed.clipboard;
18702116 loadClipboard(false);
18712117 paste(false);
1872
- GrafreeD.clipboard = keep;
2118
+ Grafreed.clipboard = keep;
18732119 } else
1874
- if (event.getSource() == cloneItem)
2120
+ if (source == cloneItem)
18752121 {
18762122 CloneSelection(false);
18772123 } else
1878
- if (event.getSource() == cloneSupportItem)
2124
+ if (source == cloneSupportItem)
18792125 {
18802126 CloneSelection(true);
18812127 } else
1882
- if (event.getSource() == copyItem)
2128
+ if (source == copyItem)
18832129 {
18842130 loadClipboard(false);
18852131 } else
1886
- if (event.getSource() == pasteItem)
2132
+ if (source == pasteItem)
18872133 {
18882134 paste(false);
18892135 } else
1890
- if (event.getSource() == pasteLinkItem)
2136
+ if (source == pasteIntoItem)
18912137 {
1892
- pasteInto(false);
2138
+ pasteInto(true, false);
18932139 } else
1894
- if (event.getSource() == pasteCloneItem)
2140
+ if (source == pasteLinkItem)
18952141 {
1896
- pasteInto(true);
2142
+ pasteInto(false, false);
18972143 } else
1898
- if (event.getSource() == pasteExpandItem)
2144
+ if (source == pasteCloneItem)
2145
+ {
2146
+ pasteInto(true, true);
2147
+ } else
2148
+ if (source == pasteExpandItem)
18992149 {
19002150 paste(true);
19012151 } else
1902
- if (event.getSource() == synchronizeItem)
2152
+ if (source == synchronizeItem)
19032153 {
19042154 Overwrite(Object3D.TRANSFORM);
19052155 } else
1906
- if (event.getSource() == overwriteNameItem)
2156
+ if (source == overwriteNameItem)
19072157 {
19082158 Overwrite(Object3D.NAME);
19092159 } else
1910
- if (event.getSource() == overwriteUVItem)
2160
+ if (source == overwriteUVItem)
19112161 {
19122162 Overwrite(Object3D.UV);
19132163 } else
1914
- if (event.getSource() == overwriteMatItem)
2164
+ if (source == overwriteMatItem)
19152165 {
19162166 /* july 2015
19172167 if ((dropAttributes & Object3D.TEXTURE) == 0)
....@@ -1931,7 +2181,7 @@
19312181
19322182 Overwrite(dropAttributes);
19332183 }
1934
- if (event.getSource() == overwriteGeoItem)
2184
+ if (source == overwriteGeoItem)
19352185 {
19362186 Overwrite(Object3D.GEOMETRY);
19372187 // if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
....@@ -1948,7 +2198,7 @@
19482198 // refreshContents();
19492199 // }
19502200 } else
1951
- if (event.getSource() == generateMeshItem)
2201
+ if (source == generateMeshItem)
19522202 {
19532203 //if (group.selection.size() == 1)
19542204 // for (int i=0; i<group.selection.size(); i++)
....@@ -1959,7 +2209,7 @@
19592209 ResetModel();
19602210 refreshContents();
19612211 } else
1962
- if (event.getSource() == extractGeometriesItem)
2212
+ if (source == extractGeometriesItem)
19632213 {
19642214 boolean one = false;
19652215
....@@ -1986,7 +2236,7 @@
19862236 ResetModel();
19872237 refreshContents();
19882238 } else
1989
- if (event.getSource() == cloneGeometriesItem)
2239
+ if (source == cloneGeometriesItem)
19902240 {
19912241 boolean one = false;
19922242
....@@ -2012,7 +2262,7 @@
20122262 ResetModel();
20132263 refreshContents();
20142264 } else
2015
- if (event.getSource() == shareGeometriesItem)
2265
+ if (source == shareGeometriesItem)
20162266 {
20172267 boolean one = false;
20182268
....@@ -2042,7 +2292,7 @@
20422292 refreshContents();
20432293 }
20442294 } else
2045
- if (event.getSource() == mergeGeometriesItem)
2295
+ if (source == mergeGeometriesItem)
20462296 {
20472297 boolean one = false;
20482298
....@@ -2072,7 +2322,7 @@
20722322 ResetModel();
20732323 refreshContents();
20742324 } else
2075
- if (event.getSource() == linkverticesItem)
2325
+ if (source == linkverticesItem)
20762326 {
20772327 // if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
20782328 // {
....@@ -2085,48 +2335,48 @@
20852335 // group.selection.get(0).setMasterThis(content); // should be identity
20862336 // refreshContents();
20872337 // }
2088
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2338
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
20892339 {
2090
- Object3D content = GrafreeD.clipboard.get(0);
2340
+ Object3D content = Grafreed.clipboard.get(0);
20912341
20922342 if (content instanceof cGroup && ((cGroup)content).transientlink )
20932343 content = ((cGroup)content).get(0);
20942344
2095
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
2345
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
20962346 for (int i=0; i<group.selection.size(); i++)
20972347 {
2098
- boolean random = CameraPane.RANDOM;
2099
- CameraPane.RANDOM = false; // parse all random nodes
2348
+ boolean random = CameraPane.SWITCH;
2349
+ CameraPane.SWITCH = false; // parse all random nodes
21002350 group.selection.get(i).linkVerticesThis(content);
21012351 // group.selection.get(i).setMasterThis(content); // should be identity
2102
- CameraPane.RANDOM = random;
2352
+ CameraPane.SWITCH = random;
21032353 }
2104
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
2354
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
21052355 refreshContents();
21062356 }
21072357 } else
2108
- if (event.getSource() == resetsupportItem)
2358
+ if (source == resetsupportItem)
21092359 {
21102360 for (int i=0; i<group.selection.size(); i++)
21112361 {
2112
- boolean random = CameraPane.RANDOM;
2113
- CameraPane.RANDOM = false; // parse all random nodes
2362
+ boolean random = CameraPane.SWITCH;
2363
+ CameraPane.SWITCH = false; // parse all random nodes
21142364 group.selection.get(i).linkVerticesThis(null);
2115
- CameraPane.RANDOM = random;
2365
+ CameraPane.SWITCH = random;
21162366 }
21172367
21182368 refreshContents();
21192369 } else
2120
- if (event.getSource() == relinkverticesItem)
2370
+ if (source == relinkverticesItem)
21212371 {
2122
- boolean random = CameraPane.RANDOM;
2123
- CameraPane.RANDOM = false; // parse all random nodes
2372
+ boolean random = CameraPane.SWITCH;
2373
+ CameraPane.SWITCH = false; // parse all random nodes
21242374 group.selection.RelinkToSupport();
2125
- CameraPane.RANDOM = random;
2375
+ CameraPane.SWITCH = random;
21262376
21272377 refreshContents();
21282378 } else
2129
- if (event.getSource() == resetreferencesItem)
2379
+ if (source == resetreferencesItem)
21302380 {
21312381 for (int i=0; i<group.selection.size(); i++)
21322382 {
....@@ -2135,11 +2385,11 @@
21352385
21362386 refreshContents();
21372387 } else
2138
- if (event.getSource() == setMasterItem)
2388
+ if (source == setMasterItem)
21392389 {
2140
- if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
2390
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
21412391 {
2142
- Object3D content = GrafreeD.clipboard.get(0);
2392
+ Object3D content = Grafreed.clipboard.get(0);
21432393
21442394 if (content instanceof cGroup && ((cGroup)content).transientlink )
21452395 content = ((cGroup)content).get(0);
....@@ -2148,13 +2398,13 @@
21482398 refreshContents();
21492399 }
21502400 } else
2151
- if (event.getSource() == poseMeshItem)
2401
+ if (source == poseMeshItem)
21522402 {
21532403 if (group.selection.size() == 1)
21542404 {
2155
- if (GrafreeD.clipboard.size() == 1)
2405
+ if (Grafreed.clipboard.size() == 1)
21562406 {
2157
- Object3D content = GrafreeD.clipboard.get(0);
2407
+ Object3D content = Grafreed.clipboard.get(0);
21582408
21592409 if (content instanceof cGroup && ((cGroup)content).transientlink )
21602410 content = ((cGroup)content).get(0);
....@@ -2167,19 +2417,19 @@
21672417 }
21682418
21692419 } else
2170
- if (event.getSource() == revertMeshItem)
2420
+ if (source == revertMeshItem)
21712421 {
21722422 RevertMeshes();
21732423 } else
2174
- if (event.getSource() == resetMeshItem)
2424
+ if (source == resetAllItem)
21752425 {
21762426 ResetAll();
21772427 } else
2178
- if (event.getSource() == stepAllItem)
2428
+ if (source == stepAllItem)
21792429 {
21802430 StepAll();
21812431 } else
2182
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2432
+ if (source == clearItem) // || event.getSource() == clearButton)
21832433 {
21842434 //int indices[] = jList.getSelectedIndices();
21852435 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2187,46 +2437,46 @@
21872437
21882438 ClearSelection(false);
21892439 } else
2190
- if (event.getSource() == clearAllItem)
2440
+ if (source == clearAllItem)
21912441 {
21922442 ClearSelection(true);
21932443 } else
2194
- if (event.getSource() == grabItem)
2444
+ if (source == grabItem)
21952445 {
21962446 group(new cGroup(), true);
21972447 } else
2198
- if (event.getSource() == hideItem)
2448
+ if (source == hideItem)
21992449 {
22002450 group(new HiddenObject());
22012451 } else
2202
- if (event.getSource() == frontItem)
2452
+ if (source == frontItem)
22032453 {
22042454 front();
22052455 } else
2206
- if (event.getSource() == backItem)
2456
+ if (source == backItem)
22072457 {
22082458 back();
22092459 } else
2210
- if (event.getSource() == cameraItem)
2460
+ if (source == cameraItem)
22112461 {
22122462 makeSomething(new Camera());
22132463 } else
2214
- if (event.getSource() == compositeItem)
2464
+ if (source == compositeItem)
22152465 {
22162466 group(new Composite());
22172467 } else
2218
- if (event.getSource() == randomItem)
2468
+ if (source == randomItem)
22192469 {
22202470 RandomNode random = new RandomNode();
22212471 group(random);
22222472 if (random.size() > 0)
2223
- random.name = random.get(0).name + "Rnd";
2473
+ random.name = random.get(0).name + "Switch";
22242474 } else
2225
- if (event.getSource() == physicsItem)
2475
+ if (source == physicsItem)
22262476 {
22272477 group(new PhysicsNode());
22282478 } else
2229
- if (event.getSource() == frameselectorItem)
2479
+ if (source == frameselectorItem)
22302480 {
22312481 for (int i=0; i<group.selection.size(); i++)
22322482 {
....@@ -2238,7 +2488,7 @@
22382488 ResetModel();
22392489 refreshContents();
22402490 } else
2241
- if (event.getSource() == switchGeoItem)
2491
+ if (source == switchGeoItem)
22422492 {
22432493 for (int i=0; i<group.selection.size(); i++)
22442494 {
....@@ -2250,7 +2500,7 @@
22502500 ResetModel();
22512501 refreshContents();
22522502 } else
2253
- if (event.getSource() == switchTransfoItem)
2503
+ if (source == switchTransfoItem)
22542504 {
22552505 for (int i=0; i<group.selection.size(); i++)
22562506 {
....@@ -2262,7 +2512,7 @@
22622512 ResetModel();
22632513 refreshContents();
22642514 } else
2265
- if (event.getSource() == morphItem)
2515
+ if (source == morphItem)
22662516 {
22672517 for (int i=0; i<group.selection.size(); i++)
22682518 {
....@@ -2274,7 +2524,7 @@
22742524 ResetModel();
22752525 refreshContents();
22762526 } else
2277
- if (event.getSource() == scriptNodeItem)
2527
+ if (source == scriptNodeItem)
22782528 {
22792529 boolean atleastone = false;
22802530
....@@ -2313,31 +2563,31 @@
23132563 }
23142564 }
23152565 } else
2316
- if (event.getSource() == linkerItem)
2566
+ if (source == linkerItem)
23172567 {
23182568 group(new cLinker());
23192569 } else
2320
- if (event.getSource() == textureItem)
2570
+ if (source == textureItem)
23212571 {
23222572 group(new TextureNode());
23232573 } else
2324
- if (event.getSource() == billboardItem)
2574
+ if (source == billboardItem)
23252575 {
23262576 group(new BillboardNode());
23272577 } else
2328
- if (event.getSource() == shadowXItem)
2578
+ if (source == shadowXItem)
23292579 {
23302580 CastShadow(0);
23312581 } else
2332
- if (event.getSource() == shadowYItem)
2582
+ if (source == shadowYItem)
23332583 {
23342584 CastShadow(1);
23352585 } else
2336
- if (event.getSource() == shadowZItem)
2586
+ if (source == shadowZItem)
23372587 {
23382588 CastShadow(2);
23392589 } else
2340
- if (event.getSource() == ungroupItem)
2590
+ if (source == ungroupItem)
23412591 {
23422592 //ungroup();
23432593 for (int i=0; i<group.selection.size(); i++)
....@@ -2349,179 +2599,203 @@
23492599
23502600 refreshContents();
23512601 } else
2352
- if (event.getSource() == genUVItem)
2602
+ if (source == genUVItem)
23532603 {
23542604 GenUV();
23552605 } else
2356
- if (event.getSource() == genNormalsCADItem)
2606
+ if (source == genNormalsCADItem)
23572607 {
23582608 GenNormals(true);
23592609 } else
2360
- if (event.getSource() == genNormalsMESHItem)
2610
+ if (source == genNormalsMESHItem)
23612611 {
2362
- GenNormals(true); // TODO
2612
+ GenNormalsMESH();
23632613 } else
2364
- if (event.getSource() == genNormalsORGANItem)
2614
+ if (source == genNormalsORGANItem)
23652615 {
23662616 GenNormals(false);
23672617 } else
2368
- if (event.getSource() == genNormalsMINEItem)
2618
+ if (source == genNormalsMINEItem)
23692619 {
23702620 GenNormalsMINE();
23712621 } else
2372
- if (event.getSource() == stripifyItem)
2622
+ if (source == stripifyItem)
23732623 {
23742624 Stripify();
23752625 } else
2376
- if (event.getSource() == unstripifyItem)
2626
+ if (source == unstripifyItem)
23772627 {
23782628 Unstripify();
23792629 } else
2380
- if (event.getSource() == trimItem)
2630
+ if (source == trimItem)
23812631 {
23822632 Trim();
23832633 } else
2384
- if (event.getSource() == untrimItem)
2634
+ if (source == untrimItem)
23852635 {
23862636 Untrim();
23872637 } else
2388
- if (event.getSource() == clearColorsItem)
2638
+ if (source == clearColorsItem)
23892639 {
23902640 ClearColors();
23912641 } else
2392
- if (event.getSource() == clearMaterialsItem)
2642
+ if (source == clearMaterialsItem)
23932643 {
23942644 ClearMaterials();
23952645 } else
2396
- if (event.getSource() == liveleavesItem)
2646
+ if (source == liveleavesItem)
23972647 {
23982648 LiveLeaves(true);
23992649 } else
2400
- if (event.getSource() == unliveleavesItem)
2650
+ if (source == unliveleavesItem)
24012651 {
24022652 LiveLeaves(false);
24032653 } else
2404
- if (event.getSource() == supportleavesItem)
2654
+ if (source == supportleavesItem)
24052655 {
24062656 SupportLeaves(true);
24072657 } else
2408
- if (event.getSource() == unsupportleavesItem)
2658
+ if (source == unsupportleavesItem)
24092659 {
24102660 SupportLeaves(false);
24112661 } else
2412
- if (event.getSource() == hideleavesItem)
2662
+ if (source == hideleavesItem)
24132663 {
24142664 HideLeaves(true);
24152665 } else
2416
- if (event.getSource() == showleavesItem)
2666
+ if (source == showleavesItem)
24172667 {
24182668 HideLeaves(false);
24192669 } else
2420
- if (event.getSource() == markleavesItem)
2670
+ if (source == markleavesItem)
24212671 {
24222672 MarkLeaves(true);
24232673 } else
2424
- if (event.getSource() == unmarkleavesItem)
2674
+ if (source == unmarkleavesItem)
24252675 {
24262676 MarkLeaves(false);
24272677 } else
2428
- if (event.getSource() == flipVItem)
2678
+ if (source == rewindleavesItem)
2679
+ {
2680
+ RewindLeaves(true);
2681
+ } else
2682
+ if (source == unrewindleavesItem)
2683
+ {
2684
+ RewindLeaves(false);
2685
+ } else
2686
+ if (source == randomleavesItem)
2687
+ {
2688
+ RandomLeaves(true);
2689
+ } else
2690
+ if (source == unrandomleavesItem)
2691
+ {
2692
+ RandomLeaves(false);
2693
+ } else
2694
+ if (source == flipVItem)
24292695 {
24302696 FlipV(true);
24312697 } else
2432
- if (event.getSource() == unflipVItem)
2698
+ if (source == unflipVItem)
24332699 {
24342700 FlipV(false);
24352701 } else
2436
- if (event.getSource() == lowTexturesItem)
2702
+ if (source == lowTexturesItem)
24372703 {
24382704 SetTexRes(0);
24392705 } else
2440
- if (event.getSource() == normalTexturesItem)
2706
+ if (source == normalTexturesItem)
24412707 {
24422708 SetTexRes(1);
24432709 } else
2444
- if (event.getSource() == highTexturesItem)
2710
+ if (source == highTexturesItem)
24452711 {
24462712 SetTexRes(2);
24472713 } else
2448
- if (event.getSource() == veryhighTexturesItem)
2714
+ if (source == veryhighTexturesItem)
24492715 {
24502716 SetTexRes(3);
24512717 } else
2452
- if (event.getSource() == maxTexturesItem)
2718
+ if (source == maxTexturesItem)
24532719 {
24542720 SetTexRes(4);
24552721 } else
2456
- if (event.getSource() == panoTexturesItem)
2722
+ if (source == panoTexturesItem)
24572723 {
24582724 SetTexRes(5);
24592725 } else
2460
- if (event.getSource() == reverseNormalsItem)
2726
+ if (source == reverseNormalsItem)
24612727 {
24622728 ReverseNormals();
24632729 } else
2464
- if (event.getSource() == parseverticesItem)
2730
+ if (source == parseverticesItem)
24652731 {
24662732 ParseVertices();
24672733 } else
2468
- if (event.getSource() == textureFieldItem)
2734
+ if (source == textureFieldItem)
24692735 {
24702736 TextureVertices();
24712737 } else
2472
- if (event.getSource() == alignItem)
2738
+ if (source == alignItem)
24732739 {
24742740 Align();
24752741 } else
2476
- if (event.getSource() == mirrorItem)
2742
+ if (source == mirrorItem)
24772743 {
24782744 MirrorPoses();
24792745 } else
2480
- if (event.getSource() == reduceMorphItem)
2746
+ if (source == reduceMorphItem)
24812747 {
24822748 MeshReduction(false);
24832749 } else
2484
- if (event.getSource() == reduce34MorphItem)
2750
+ if (source == reduce34MorphItem)
24852751 {
24862752 MeshReduction(true);
24872753 } else
2488
- if (event.getSource() == reverseTrianglesItem)
2754
+ if (source == reverseTrianglesItem)
24892755 {
24902756 ReverseTriangles();
24912757 } else
2492
- if (event.getSource() == reduceMeshItem)
2758
+ if (source == reduceMeshItem)
24932759 {
24942760 ReduceMesh(false);
24952761 } else
2496
- if (event.getSource() == reduce34MeshItem)
2762
+ if (source == reduce34MeshItem)
24972763 {
24982764 ReduceMesh(true);
24992765 } else
2500
- if (event.getSource() == increaseMeshItem)
2766
+ if (source == increaseMeshItem)
25012767 {
25022768 IncreaseMesh();
25032769 } else
2504
- if (event.getSource() == clipMeshItem)
2770
+ if (source == clipMeshItem)
25052771 {
25062772 ClipMesh();
25072773 } else
2508
- if (event.getSource() == smoothMeshItem)
2774
+ if (source == smoothMeshItem)
25092775 {
25102776 SmoothMesh();
25112777 } else
2512
- if (event.getSource() == transformgeometryItem)
2778
+ if (source == transformGeometryItem)
25132779 {
25142780 TransformGeometry();
25152781 } else
2516
- if (event.getSource() == resetTransformItem)
2782
+ if (source == transformChildrenItem)
2783
+ {
2784
+ TransformChildren();
2785
+ } else
2786
+ if (source == resetTransformItem)
25172787 {
25182788 ResetTransform();
25192789 } else
2520
- if (event.getSource() == resetCentroidItem)
2790
+ if (source == resetCentroidItem)
25212791 {
2522
- ResetCentroid();
2792
+ ResetCentroid(true);
25232793 } else
2524
- if (event.getSource() == resetParentItem)
2794
+ if (source == resetCentroidXZItem)
2795
+ {
2796
+ ResetCentroid(false);
2797
+ } else
2798
+ if (source == resetParentItem)
25252799 {
25262800 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25272801 {
....@@ -2531,7 +2805,7 @@
25312805
25322806 refreshContents();
25332807 } else
2534
- if (event.getSource() == repairParentItem)
2808
+ if (source == repairParentItem)
25352809 {
25362810 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25372811 {
....@@ -2545,7 +2819,21 @@
25452819
25462820 refreshContents();
25472821 } else
2548
- if (event.getSource() == sortbysizeItem)
2822
+ if (source == repairShadowItem)
2823
+ {
2824
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
2825
+ {
2826
+ Object3D obj = (Object3D)e.nextElement();
2827
+ obj.RepairShadow();
2828
+// for (int i=0; i<obj.size(); i++)
2829
+// {
2830
+// obj.get(i).parent = obj;
2831
+// }
2832
+ }
2833
+
2834
+ refreshContents();
2835
+ } else
2836
+ if (source == sortbysizeItem)
25492837 {
25502838 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25512839 {
....@@ -2557,7 +2845,7 @@
25572845 ResetModel();
25582846 refreshContents();
25592847 } else
2560
- if (event.getSource() == sortbynameItem)
2848
+ if (source == sortbynameItem)
25612849 {
25622850 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25632851 {
....@@ -2569,7 +2857,7 @@
25692857 ResetModel();
25702858 refreshContents();
25712859 } else
2572
- if (event.getSource() == attachPigmentItem)
2860
+ if (source == attachPigmentItem)
25732861 {
25742862 String texture = GetFile("Attach pigment");
25752863 Object3D obj;
....@@ -2581,7 +2869,7 @@
25812869
25822870 refreshContents();
25832871 } else
2584
- if (event.getSource() == detachPigmentItem)
2872
+ if (source == detachPigmentItem)
25852873 {
25862874 Object3D obj;
25872875 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2592,7 +2880,7 @@
25922880
25932881 refreshContents();
25942882 } else
2595
- if (event.getSource() == attachBumpItem)
2883
+ if (source == attachBumpItem)
25962884 {
25972885 String texture = GetFile("Attach bump");
25982886 Object3D obj;
....@@ -2604,7 +2892,7 @@
26042892
26052893 refreshContents();
26062894 } else
2607
- if (event.getSource() == detachBumpItem)
2895
+ if (source == detachBumpItem)
26082896 {
26092897 Object3D obj;
26102898 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2615,7 +2903,7 @@
26152903
26162904 refreshContents();
26172905 } else
2618
- if (event.getSource() == pigmentBumpItem)
2906
+ if (source == pigmentBumpItem)
26192907 {
26202908 Object3D obj;
26212909 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2626,158 +2914,221 @@
26262914
26272915 refreshContents();
26282916 } else
2629
- if (event.getSource() == flashSelectionButton)
2917
+ if (source == flashSelectionButton)
26302918 {
26312919 CameraPane.flash = true;
26322920 refreshContents();
26332921 } else
2634
- if (event.getSource() == oneButton)
2922
+ if (source == oneButton)
26352923 {
26362924 } else
2637
- if (event.getSource() == twoButton)
2925
+ if (source == twoButton)
26382926 {
26392927 radio.layout = twoButton;
26402928 // bug
26412929 //gridPanel.setDividerLocation(1.0);
26422930 //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();
2931
+// bigThree.remove(scenePanel);
2932
+// bigThree.remove(centralPanel);
2933
+// bigThree.remove(XYZPanel);
2934
+// aWindowConstraints.gridx = 0;
2935
+// aWindowConstraints.gridy = 0;
2936
+// aWindowConstraints.gridwidth = 1;
2937
+// // aConstraints.gridheight = 3;
2938
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2939
+// aWindowConstraints.weightx = 0;
2940
+// aWindowConstraints.weighty = 1;
2941
+// //bigThree.add(jtp, aWindowConstraints);
2942
+// aWindowConstraints.weightx = 1;
2943
+// aWindowConstraints.gridwidth = 3;
2944
+// // aConstraints.gridheight = 3;
2945
+// aWindowConstraints.gridx = 1;
2946
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2947
+// bigThree.add(centralPanel, aWindowConstraints);
2948
+// aWindowConstraints.weightx = 0;
2949
+// aWindowConstraints.gridx = 4;
2950
+// aWindowConstraints.gridwidth = 1;
2951
+// // aConstraints.gridheight = 3;
2952
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2953
+// //bigThree.add(XYZPanel, aWindowConstraints);
2954
+// scenePanel.setVisible(false);
2955
+// centralPanel.setVisible(true);
2956
+// XYZPanel.setVisible(false);
2957
+ bigThree.ClearUI();
2958
+ bigThree.add(centralPanel);
2959
+ bigThree.FlushUI();
2960
+
2961
+ cameraView.requestFocusInWindow();
2962
+
2963
+// refreshContents(true);
2964
+//
2965
+// try
2966
+// {
2967
+// java.awt.Robot bot = new java.awt.Robot();
2968
+// int mask = InputEvent.BUTTON1_MASK;
2969
+// bot.mouseMove(100, 100);
2970
+// bot.mousePress(mask);
2971
+// bot.mouseRelease(mask);
2972
+// }
2973
+// catch (Exception e)
2974
+// {
2975
+//
2976
+// }
2977
+
26672978 } else
2668
- if (event.getSource() == threeButton)
2979
+ if (source == threeButton)
26692980 {
26702981 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();
2982
+
2983
+// bigThree.remove(scenePanel);
2984
+// bigThree.remove(centralPanel);
2985
+// bigThree.remove(XYZPanel);
2986
+// aWindowConstraints.gridx = 0;
2987
+// aWindowConstraints.gridy = 0;
2988
+// aWindowConstraints.gridwidth = 1;
2989
+// // aConstraints.gridheight = 3;
2990
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2991
+// aWindowConstraints.weightx = 0;
2992
+// aWindowConstraints.weighty = 1;
2993
+// //bigThree.add(jtp, aWindowConstraints);
2994
+// aWindowConstraints.weightx = 1;
2995
+// aWindowConstraints.gridwidth = 3;
2996
+// // aConstraints.gridheight = 3;
2997
+// aWindowConstraints.gridx = 1;
2998
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2999
+// bigThree.add(centralPanel, aWindowConstraints);
3000
+// aWindowConstraints.weightx = 0;
3001
+// aWindowConstraints.gridx = 4;
3002
+// aWindowConstraints.gridwidth = 1;
3003
+// // aConstraints.gridheight = 3;
3004
+// aConstraints.fill = GridBagConstraints.VERTICAL;
3005
+// bigThree.add(XYZPanel, aWindowConstraints);
3006
+// bigThree.validate();
3007
+// scenePanel.setVisible(false);
3008
+// centralPanel.setVisible(true);
3009
+// XYZPanel.setVisible(true);
3010
+ bigThree.ClearUI();
3011
+ bigThree.add(centralPanel);
3012
+ bigThree.add(XYZPanel);
3013
+ bigThree.FlushUI();
3014
+
3015
+ cameraView.requestFocusInWindow();
26953016 } else
2696
- if (event.getSource() == fourButton)
3017
+ if (source == fourButton)
26973018 {
26983019 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();
3020
+
3021
+// bigThree.remove(scenePanel);
3022
+// bigThree.remove(centralPanel);
3023
+// bigThree.remove(XYZPanel);
3024
+// aWindowConstraints.gridx = 0;
3025
+// aWindowConstraints.gridy = 0;
3026
+// aWindowConstraints.gridwidth = 1;
3027
+// // aWindowConstraints.gridheight = 3;
3028
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3029
+// aWindowConstraints.weightx = 1;
3030
+// aWindowConstraints.weighty = 1;
3031
+// bigThree.add(scenePanel, aWindowConstraints);
3032
+// aWindowConstraints.weightx = 1;
3033
+// aWindowConstraints.gridwidth = 3;
3034
+// // aConstraints.gridheight = 3;
3035
+// aWindowConstraints.gridx = 1;
3036
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3037
+// //bigThree.add(cameraPanel, aWindowConstraints);
3038
+// aWindowConstraints.weightx = 0;
3039
+// aWindowConstraints.gridx = 4;
3040
+// aWindowConstraints.gridwidth = 1;
3041
+// // aWindowConstraints.gridheight = 3;
3042
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3043
+// //bigThree.add(XYZPanel, aWindowConstraints);
3044
+// bigThree.validate();
3045
+// scenePanel.setVisible(true);
3046
+// centralPanel.setVisible(false);
3047
+// XYZPanel.setVisible(false);
3048
+ bigThree.ClearUI();
3049
+ bigThree.add(scenePanel);
3050
+ bigThree.FlushUI();
3051
+
3052
+ cameraView.requestFocusInWindow();
27233053 } else
2724
- if (event.getSource() == sixButton)
3054
+ if (source == sixButton)
27253055 {
27263056 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();
3057
+
3058
+// bigThree.remove(scenePanel);
3059
+// bigThree.remove(centralPanel);
3060
+// bigThree.remove(XYZPanel);
3061
+// aWindowConstraints.gridx = 0;
3062
+// aWindowConstraints.gridy = 0;
3063
+// aWindowConstraints.gridwidth = 1;
3064
+// // aConstraints.gridheight = 3;
3065
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3066
+// aWindowConstraints.weightx = 0;
3067
+// aWindowConstraints.weighty = 1;
3068
+// bigThree.add(scenePanel, aWindowConstraints);
3069
+// aWindowConstraints.weightx = 1;
3070
+// aWindowConstraints.gridwidth = 3;
3071
+// // aWindowConstraints.gridheight = 3;
3072
+// aWindowConstraints.gridx = 1;
3073
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3074
+// bigThree.add(centralPanel, aWindowConstraints);
3075
+// aWindowConstraints.weightx = 0;
3076
+// aWindowConstraints.gridx = 4;
3077
+// aWindowConstraints.gridwidth = 1;
3078
+// // aWindowConstraints.gridheight = 3;
3079
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3080
+// //bigThree.add(XYZPanel, aConstraints);
3081
+// bigThree.validate();
3082
+// scenePanel.setVisible(true);
3083
+// centralPanel.setVisible(true);
3084
+// XYZPanel.setVisible(false);
3085
+ bigThree.ClearUI();
3086
+ bigThree.add(scenePanel);
3087
+ bigThree.add(centralPanel);
3088
+ bigThree.FlushUI();
3089
+
3090
+ cameraView.requestFocusInWindow();
27513091 } else
2752
- if (event.getSource() == sevenButton)
3092
+ if (source == sevenButton)
27533093 {
27543094 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();
3095
+
3096
+// bigThree.remove(scenePanel);
3097
+// bigThree.remove(centralPanel);
3098
+// bigThree.remove(XYZPanel);
3099
+// aWindowConstraints.gridx = 0;
3100
+// aWindowConstraints.gridy = 0;
3101
+// aWindowConstraints.gridwidth = 1;
3102
+// // aWindowConstraints.gridheight = 3;
3103
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3104
+// aWindowConstraints.weightx = 0;
3105
+// aWindowConstraints.weighty = 1;
3106
+// bigThree.add(scenePanel, aWindowConstraints);
3107
+// aWindowConstraints.weightx = 1;
3108
+// aWindowConstraints.gridwidth = 3;
3109
+// // aWindowConstraints.gridheight = 3;
3110
+// aWindowConstraints.gridx = 1;
3111
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3112
+// bigThree.add(centralPanel, aWindowConstraints);
3113
+// aWindowConstraints.weightx = 0;
3114
+// aWindowConstraints.gridx = 4;
3115
+// aWindowConstraints.gridwidth = 1;
3116
+// // aConstraints.gridheight = 3;
3117
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3118
+// bigThree.add(XYZPanel, aWindowConstraints);
3119
+// bigThree.validate();
3120
+// scenePanel.setVisible(true);
3121
+// centralPanel.setVisible(true);
3122
+// XYZPanel.setVisible(true);
3123
+ bigThree.ClearUI();
3124
+ bigThree.add(scenePanel);
3125
+ bigThree.add(centralPanel);
3126
+ bigThree.add(XYZPanel);
3127
+ bigThree.FlushUI();
3128
+
3129
+ cameraView.requestFocusInWindow();
27793130 } else
2780
- if (event.getSource() == rootButton)
3131
+ if (source == rootButton)
27813132 {
27823133 Object3D obj;
27833134 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2787,17 +3138,24 @@
27873138 EditObject(obj);
27883139 }
27893140
3141
+ cameraView.requestFocusInWindow();
27903142 refreshContents(true);
27913143 } else
2792
- if (event.getSource() == closeButton)
3144
+ if (source == closeButton)
27933145 {
27943146 //System.out.println("CLOSE: " + buttonGroup.getSelection());
27953147 cRadio ab;
27963148 for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
27973149 {
27983150 ab = (cRadio)e.nextElement();
2799
- if(ab.getModel().isSelected() && ab.GetObject() != client)
3151
+ if (ab.getModel().isSelected() && ab.GetObject() != client)
28003152 {
3153
+ // Patch to avoid bug with transparency.
3154
+ if (!ab.hadMaterial)
3155
+ {
3156
+ ab.object.material = null;
3157
+ }
3158
+
28013159 buttonGroup.remove(ab);
28023160 radioPanel.remove(ab);
28033161
....@@ -2808,13 +3166,15 @@
28083166 break;
28093167 }
28103168 }
3169
+
3170
+ cameraView.requestFocusInWindow();
28113171 refreshContents(true);
28123172 } else
2813
- if (event.getSource() == editItem || event.getSource() == editButton)
3173
+ if (source == editItem || source == editButton)
28143174 {
28153175 EditSelection(false);
28163176 } else
2817
- if (event.getSource() == uneditButton)
3177
+ if (source == uneditButton)
28183178 {
28193179 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
28203180 {
....@@ -2824,14 +3184,14 @@
28243184 child.CloseUI();
28253185 listUI.remove(child);
28263186
2827
- child.editWindow = null; // ???????????
3187
+ //child.editWindow = null; // ???????????
28283188 }
2829
- objEditor.ctrlPanel.revalidate();
3189
+ objEditor.ctrlPanel.FlushUI();
28303190 //objEditor.jTree.clearSelection();
28313191 //objEditor.ResetSliders();
28323192 refreshContents(true);
28333193 } else
2834
- if (event.getSource() == clearPanelButton)
3194
+ if (source == clearPanelButton)
28353195 {
28363196 assert(copy == group);
28373197 //copy.ClearUI();
....@@ -2842,7 +3202,7 @@
28423202 listUI.clear();
28433203 refreshContents(true);
28443204 } else
2845
- if (event.getSource() == allParamsButton)
3205
+ if (source == allParamsButton)
28463206 {
28473207 assert(copy == group);
28483208
....@@ -2863,19 +3223,19 @@
28633223
28643224 refreshContents(true);
28653225 } else
2866
- if (event.getSource() == unselectButton)
3226
+ if (source == unselectButton)
28673227 {
28683228 objEditor.jTree.clearSelection();
28693229 // ?? oct 2012 GrafreeD.clipboard.clear();
28703230 objEditor.ResetSliders();
28713231 refreshContents(true);
28723232 } else
2873
- if(event.getSource() instanceof cRadio)
3233
+ if(source instanceof cRadio)
28743234 {
28753235 group.parent = keepparent;
28763236 group.attributes = 0;
28773237 //group.editWindow = null;
2878
- /*cRadio*/ radio = (cRadio)event.getSource();
3238
+ /*cRadio*/ radio = (cRadio)source;
28793239 Object3D obj = radio.GetObject();
28803240 System.out.println("Edit " + obj);
28813241 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -2895,7 +3255,7 @@
28953255 }
28963256
28973257 copy = group;
2898
- //CameraPane.theRenderer.object = group;
3258
+ //Globals.theRenderer.object = group;
28993259 if(!useclient)
29003260 {
29013261 cameraView.renderCamera = radio.camera;
....@@ -2904,12 +3264,16 @@
29043264 cameraView.cameras[cameraView.cameracount] = radio.camera;
29053265 cameraView.targetLookAt.set(radio.camera.lookAt);
29063266 cameraView.object = group;
2907
- cameraView.lighttouched = true;
3267
+ //cameraView.lighttouched = true;
3268
+ Globals.lighttouched = true;
29083269 topView.object = group;
29093270 frontView.object = group;
29103271 sideView.object = group;
29113272 }
2912
- group.editWindow = this;
3273
+
3274
+// fix "+" issue
3275
+ //group.editWindow = this;
3276
+
29133277 /*
29143278 currentLayout = radio.layout;
29153279 if (currentLayout == null)
....@@ -2921,8 +3285,23 @@
29213285 //group.parent = null; // ROOT
29223286 //group.attributes = -1;
29233287 ResetModel();
3288
+
3289
+ cameraView.requestFocusInWindow();
29243290 refreshContents(true);
2925
- }
3291
+ } else if (event.getSource() == editCameraItem)
3292
+ {
3293
+ cameraView.ProtectCamera();
3294
+ cameraView.repaint();
3295
+ return;
3296
+ } else if (event.getSource() == revertCameraItem)
3297
+ {
3298
+ cameraView.RevertCamera();
3299
+ cameraView.repaint();
3300
+ return;
3301
+ // } else if (event.getSource() == textureButton)
3302
+ // {
3303
+ // return; // true;
3304
+ }
29263305 else
29273306 {
29283307 //return super.action(event, arg);
....@@ -2931,7 +3310,6 @@
29313310 }
29323311
29333312 boolean useclient = false;
2934
- cRadio radio;
29353313
29363314 void ToggleRoot()
29373315 {
....@@ -2940,7 +3318,7 @@
29403318 if (useclient)
29413319 {
29423320 cameraView.object = client;
2943
- cameraView.lighttouched = true;
3321
+ Globals.lighttouched = true;
29443322 //topView.object = client;
29453323 //frontView.object = client;
29463324 //sideView.object = client;
....@@ -2948,7 +3326,7 @@
29483326 else
29493327 {
29503328 cameraView.object = group;
2951
- cameraView.lighttouched = true;
3329
+ Globals.lighttouched = true;
29523330 //topView.object = group;
29533331 //frontView.object = group;
29543332 //sideView.object = group;
....@@ -2983,6 +3361,28 @@
29833361 refreshContents();
29843362 }
29853363
3364
+ void TransformChildren()
3365
+ {
3366
+ Object3D obj;
3367
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3368
+ {
3369
+ obj = (Object3D)e.nextElement();
3370
+ obj.KeepTextureMatrices();
3371
+ obj.TransformChildren();
3372
+ obj.RestoreTextureMatrices();
3373
+
3374
+// if (obj.parent == null)
3375
+// {
3376
+// System.out.println("NULL PARENT!");
3377
+// new Exception().printStackTrace();
3378
+// }
3379
+// else
3380
+// TouchTransform(obj);
3381
+// //obj.parent.Touch();
3382
+ }
3383
+
3384
+ refreshContents();
3385
+ }
29863386
29873387 void ResetTransform()
29883388 {
....@@ -3095,7 +3495,7 @@
30953495 refreshContents();
30963496 }
30973497
3098
- void ResetCentroid()
3498
+ void ResetCentroid(boolean full)
30993499 {
31003500 Object3D obj;
31013501 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3110,12 +3510,16 @@
31103510 LA.matIdentity(Object3D.mat);
31113511 obj.getBounds(minima, maxima, false);
31123512 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3113
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3513
+ if (full)
3514
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
31143515 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
31153516 obj.TransformMesh(Object3D.mat);
3517
+
31163518 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3117
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3519
+ if (full)
3520
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
31183521 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3522
+
31193523 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
31203524 //Object3D.mat[3][0] = -Object3D.mat[3][0];
31213525 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3144,7 +3548,8 @@
31443548
31453549 int size = obj.MemorySize();
31463550
3147
- System.err.println((size/1024) + " KB is the size of " + obj);
3551
+ //System.err.println((size/1024) + " KB is the size of " + obj);
3552
+ System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)");
31483553 }
31493554 }
31503555 catch (Exception e)
....@@ -3181,9 +3586,9 @@
31813586 obj = (Object3D)e.nextElement();
31823587
31833588 System.out.println("Object is: " + obj);
3184
- GrafreeD.AnalyzeObject(obj);
3589
+ Grafreed.AnalyzeObject(obj);
31853590 System.out.println("Boundary rep: " + obj.bRep);
3186
- GrafreeD.AnalyzeObject(obj.bRep);
3591
+ Grafreed.AnalyzeObject(obj.bRep);
31873592
31883593 // System.err.println((size/1024) + " KB is the size of " + obj);
31893594 }
....@@ -3225,6 +3630,13 @@
32253630 void GenNormals(boolean crease)
32263631 {
32273632 group.GenNormalsS(crease);
3633
+
3634
+ refreshContents();
3635
+ }
3636
+
3637
+ void GenNormalsMESH()
3638
+ {
3639
+ group.GenNormalsMeshS();
32283640
32293641 refreshContents();
32303642 }
....@@ -3397,8 +3809,8 @@
33973809
33983810 void ParseVertices()
33993811 {
3400
- boolean epsequal = GrafreeD.epsequal;
3401
- GrafreeD.epsequal = true;
3812
+ boolean epsequal = Grafreed.epsequal;
3813
+ Grafreed.epsequal = true;
34023814
34033815 for (int i=0; i<group.selection.size(); i++)
34043816 {
....@@ -3423,7 +3835,7 @@
34233835 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
34243836 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
34253837
3426
- g.add(GrafreeD.clipboard);
3838
+ g.add(Grafreed.clipboard);
34273839
34283840 buffer.add(g);
34293841 }
....@@ -3438,7 +3850,7 @@
34383850 makeSomething(buffer, i==group.selection.size()-1);
34393851 }
34403852
3441
- GrafreeD.epsequal = epsequal;
3853
+ Grafreed.epsequal = epsequal;
34423854
34433855 refreshContents();
34443856 }
....@@ -3456,7 +3868,16 @@
34563868 String pigment = Object3D.GetPigment(tex);
34573869 //String bump = Object3D.GetBump(tex);
34583870
3459
- com.sun.opengl.util.texture.TextureData texturedata = CameraPane.theRenderer.GetTextureData(pigment, false, node.texres);
3871
+ com.sun.opengl.util.texture.TextureData texturedata = null;
3872
+
3873
+ try
3874
+ {
3875
+ texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
3876
+ }
3877
+ catch (Exception e)
3878
+ {
3879
+ System.err.println("FAIL: " + node);
3880
+ }
34603881
34613882 double s = v.s;
34623883
....@@ -3544,11 +3965,11 @@
35443965
35453966 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
35463967
3547
- boolean random = CameraPane.RANDOM;
3548
- CameraPane.RANDOM = false; // parse all random nodes
3968
+ boolean random = CameraPane.SWITCH;
3969
+ CameraPane.SWITCH = false; // parse all random nodes
35493970 lowres.linkVerticesThis(null);
35503971 lowres.linkVerticesThis(sn);
3551
- CameraPane.RANDOM = random;
3972
+ CameraPane.SWITCH = random;
35523973
35533974 System.err.flush();
35543975
....@@ -3588,7 +4009,7 @@
35884009 return;
35894010
35904011 Object3D poses = group.selection.get(0);
3591
- Object3D ref = GrafreeD.clipboard.get(0);
4012
+ Object3D ref = Grafreed.clipboard.get(0);
35924013
35934014 Object3D newgroup = new Object3D("Po:" + poses.name);
35944015
....@@ -3757,7 +4178,7 @@
37574178 group.selection.RelinkToSupport(); // july 2014
37584179 System.out.println("DONE.");
37594180 refreshContents();
3760
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
4181
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
37614182 }
37624183
37634184 void ReduceMesh(boolean reduction34)
....@@ -3782,9 +4203,9 @@
37824203
37834204 void ClipMesh()
37844205 {
3785
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
4206
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
37864207 {
3787
- Object3D content = GrafreeD.clipboard.get(0);
4208
+ Object3D content = Grafreed.clipboard.get(0);
37884209
37894210 if (content instanceof cGroup && ((cGroup)content).transientlink )
37904211 content = ((cGroup)content).get(0);
....@@ -3793,7 +4214,7 @@
37934214 // {
37944215 // group.selection.get(i).ClipMesh(GrafreeD.clipboard);
37954216 // }
3796
- group.selection.ClipMesh(GrafreeD.clipboard);
4217
+ group.selection.ClipMesh(Grafreed.clipboard);
37974218 }
37984219 // group.selection.ClipMesh(GrafreeD.clipboard);
37994220 System.out.println("DONE.");
....@@ -3840,6 +4261,18 @@
38404261 void MarkLeaves(boolean hide)
38414262 {
38424263 group.selection.MarkLeaves(hide);
4264
+ refreshContents();
4265
+ }
4266
+
4267
+ void RewindLeaves(boolean hide)
4268
+ {
4269
+ group.selection.RewindLeaves(hide);
4270
+ refreshContents();
4271
+ }
4272
+
4273
+ void RandomLeaves(boolean hide)
4274
+ {
4275
+ group.selection.RandomLeaves(hide);
38434276 refreshContents();
38444277 }
38454278
....@@ -3928,7 +4361,7 @@
39284361 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
39294362
39304363 Object3D elem = (Object3D)group.selection.elementAt(i);
3931
- if(elem != group)
4364
+ if(elem != group || !newWindow)
39324365 {
39334366 // if (!(elem instanceof Composite))
39344367 // newWindow = false;
....@@ -4018,7 +4451,6 @@
40184451 //case 702: // Event.LIST_DESELECT
40194452 group.deselectAll();
40204453 TreePath tps[] = objEditor.jTree.getSelectionPaths();
4021
- objEditor.ClearInfo(); // .GetMaterial());
40224454 if (tps != null)
40234455 {
40244456 for (int i=0; i < tps.length; i++)
....@@ -4027,31 +4459,30 @@
40274459
40284460 //if (child.parent != null)
40294461 //child.parent.addSelectee(child);
4462
+ objEditor.SetMaterial(child);
40304463 group.addSelectee(child);
4031
- objEditor.SetMaterial(child); // .GetMaterial());
4032
- objEditor.AddInfo(child, this, true); // .GetMaterial());
4033
- System.err.println("info : " + child.GetPath());
40344464 }
40354465 }
4036
- else
4037
- {
4038
- objEditor.SetMaterial(group); // .GetMaterial());
4039
- objEditor.AddInfo(group, this, true); // .GetMaterial());
4040
- System.err.println("info : " + group.GetPath());
4041
- }
4466
+// else
4467
+// {
4468
+// objEditor.SetMaterial(group); // .GetMaterial());
4469
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4470
+// System.err.println("info : " + group.GetPath());
4471
+// }
40424472
4043
- objEditor.SetText(); // jan 2014
4044
-
4045
- if (flashIt && !CameraPane.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
4473
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera))
40464474 CameraPane.flash = true;
40474475
4048
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
4476
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
40494477 // a camera
40504478 {
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;
4479
+ if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera())
4480
+ {
4481
+ CameraPane.camerachangeframe = 0; // don't refuse it
4482
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4483
+ }
4484
+ // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
4485
+ // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
40554486 }
40564487
40574488 refreshContents();
....@@ -4062,6 +4493,26 @@
40624493
40634494 freezemodel = false;
40644495 }
4496
+
4497
+ void refreshContents(boolean cp)
4498
+ {
4499
+ if (!Globals.MOUSEDRAGGED)
4500
+ {
4501
+ objEditor.ClearInfo(); // .GetMaterial());
4502
+
4503
+ for (int i=0; i < group.selection.Size(); i++)
4504
+ {
4505
+ Object3D child = (Object3D) group.selection.get(i);
4506
+
4507
+ objEditor.AddInfo(child, this, true);
4508
+ System.err.println("info : " + child.GetPath());
4509
+ }
4510
+
4511
+ objEditor.SetText(); // jan 2014
4512
+ }
4513
+
4514
+ super.refreshContents(cp);
4515
+ }
40654516
40664517 void linkSomething(Object3D thing)
40674518 {
....@@ -4133,16 +4584,18 @@
41334584 {
41344585 if (group.selection.isEmpty())
41354586 return;
4136
- GrafreeD.clipboardIsTempGroup = false;
4587
+
4588
+ Grafreed.clipboardIsTempGroup = false;
41374589 Composite tGroup = null;
41384590 if (group.selection.size() > 0) // 1)
41394591 {
41404592 tGroup = new cGroup();
4141
- GrafreeD.clipboardIsTempGroup = true;
4593
+ Grafreed.clipboardIsTempGroup = true;
41424594 }
41434595
41444596 if (cut)
41454597 {
4598
+ Save();
41464599 //int indices[] = jList.getSelectedIndices();
41474600 //for (int i = indices.length - 1; i >= 0; i--)
41484601 //jList.remove(indices[i]);
....@@ -4178,16 +4631,16 @@
41784631 //System.out.println("cut " + child);
41794632 //System.out.println("parent = " + child.parent);
41804633 // tmp.addChild(child);
4181
- if (GrafreeD.clipboardIsTempGroup)
4634
+ if (Grafreed.clipboardIsTempGroup)
41824635 tGroup.add/*Child*/(tmp);
41834636 else
4184
- GrafreeD.clipboard = tmp;
4637
+ Grafreed.clipboard = tmp;
41854638 }
41864639 else
4187
- if (GrafreeD.clipboardIsTempGroup)
4640
+ if (Grafreed.clipboardIsTempGroup)
41884641 tGroup.add/*Child*/(child);
41894642 else
4190
- GrafreeD.clipboard = child;
4643
+ Grafreed.clipboard = child;
41914644 }
41924645
41934646 //ResetModel();
....@@ -4219,21 +4672,23 @@
42194672 //System.out.println("cut " + elem);
42204673 //System.out.println("parent = " + elem.parent);
42214674 // tmp.addChild(elem);
4222
- if (GrafreeD.clipboardIsTempGroup)
4675
+ if (Grafreed.clipboardIsTempGroup)
42234676 tGroup.add/*Child*/(tmp);
42244677 else
4225
- GrafreeD.clipboard = tmp;
4678
+ Grafreed.clipboard = tmp;
42264679 }
42274680 else
4228
- if (GrafreeD.clipboardIsTempGroup)
4681
+ if (Grafreed.clipboardIsTempGroup)
42294682 tGroup.add/*Child*/(child);
42304683 else
4231
- GrafreeD.clipboard = child;
4684
+ Grafreed.clipboard = child;
42324685 }
42334686
42344687 }
4235
- if (GrafreeD.clipboardIsTempGroup)
4236
- GrafreeD.clipboard = tGroup;
4688
+
4689
+ if (Grafreed.clipboardIsTempGroup)
4690
+ Grafreed.clipboard = tGroup;
4691
+
42374692 if (cut)
42384693 {
42394694 ResetModel();
....@@ -4247,7 +4702,7 @@
42474702 // return;
42484703 boolean first = true;
42494704
4250
- if (GrafreeD.clipboardIsTempGroup)
4705
+ if (Grafreed.clipboardIsTempGroup)
42514706 {
42524707 Composite temp;
42534708
....@@ -4258,7 +4713,7 @@
42584713 temp = (Composite)Applet3D.clipboard.deepCopy();
42594714 */
42604715 Object3D elem;
4261
- for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
4716
+ for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
42624717 {
42634718 Object3D child = (Object3D)e.nextElement();
42644719
....@@ -4292,21 +4747,21 @@
42924747 //Object3D cb = Applet3D.clipboard;
42934748 //temp.addChild(cb);
42944749 //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());
4750
+ assert(Grafreed.clipboard.parent == null);
4751
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
4752
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
4753
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
4754
+ makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy());
43004755 else
4301
- makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4302
- GrafreeD.clipboard.get(0).parent = keepparent;
4756
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
4757
+ Grafreed.clipboard.get(0).parent = keepparent;
43034758 }
43044759
43054760 ResetModel();
43064761 refreshContents();
43074762 }
43084763
4309
- void pasteInto(boolean copyit)
4764
+ void pasteInto(boolean copyit, boolean clone)
43104765 {
43114766 // if (GrafreeD.clipboard == null)
43124767 // return;
....@@ -4335,15 +4790,22 @@
43354790 if (copyit)
43364791 {
43374792 // paste(false);
4338
- CloneClipboard(false); // sept 2014
4793
+ if (clone)
4794
+ {
4795
+ CloneClipboard(false); // sept 2014
4796
+ }
4797
+ else
4798
+ {
4799
+ paste(false);
4800
+ }
43394801 }
43404802 else
43414803 {
43424804 boolean first = true;
43434805
4344
- if (GrafreeD.clipboardIsTempGroup)
4806
+ if (Grafreed.clipboardIsTempGroup)
43454807 {
4346
- Composite temp = (Composite)GrafreeD.clipboard;
4808
+ Composite temp = (Composite)Grafreed.clipboard;
43474809 Object3D copy;
43484810 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
43494811 {
....@@ -4353,7 +4815,7 @@
43534815 }
43544816 } else
43554817 {
4356
- linkSomething(GrafreeD.clipboard); //.get(0));
4818
+ linkSomething(Grafreed.clipboard); //.get(0));
43574819 }
43584820 }
43594821 }
....@@ -4758,21 +5220,6 @@
47585220 }
47595221 */
47605222
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
-
47765223 /*
47775224 public void Callback(Object obj)
47785225 {
....@@ -4796,26 +5243,9 @@
47965243 }
47975244 */
47985245
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
-
48165246 String GetFile(String dialogName)
48175247 {
4818
- if (GrafreeD.standAlone)
5248
+ if (Grafreed.standAlone)
48195249 {
48205250 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
48215251 browser.show();
....@@ -4879,10 +5309,18 @@
48795309 cButton flashSelectionButton;
48805310 cButton editButton;
48815311 cButton uneditButton;
5312
+ JCheckBox allParamsButton;
48825313 cButton clearpanelButton;
4883
- cButton allParamsButton;
48845314 cButton unselectButton;
48855315
5316
+ cButton minButton;
5317
+ cButton maxButton;
5318
+ cButton fullButton;
5319
+ cButton undoButton;
5320
+ cButton redoButton;
5321
+ cButton saveButton;
5322
+ cButton oneStepButton;
5323
+
48865324 cButton screenfitButton;
48875325 cButton screenfitpointButton;
48885326 cButton snapobjectButton;
....@@ -4893,14 +5331,6 @@
48935331 cButton closeButton;
48945332
48955333 cButton setsupportButton;
4896
-
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;
49045334
49055335 //
49065336 //Composite
....@@ -4913,6 +5343,8 @@
49135343 private MenuItem lookFromItem;
49145344 private MenuItem switchItem;
49155345 private MenuItem cutItem;
5346
+ private MenuItem undoItem;
5347
+ private MenuItem redoItem;
49165348 private MenuItem duplicateItem;
49175349 private MenuItem cloneItem;
49185350 private MenuItem cloneSupportItem;
....@@ -4926,7 +5358,7 @@
49265358 private MenuItem linkverticesItem;
49275359 private MenuItem relinkverticesItem;
49285360 private MenuItem setMasterItem;
4929
- private MenuItem resetMeshItem;
5361
+ private MenuItem resetAllItem;
49305362 private MenuItem stepAllItem;
49315363 private MenuItem revertMeshItem;
49325364 private MenuItem poseMeshItem;
....@@ -4937,6 +5369,7 @@
49375369 private MenuItem mergeGeometriesItem;
49385370 private MenuItem copyItem;
49395371 private MenuItem pasteItem;
5372
+ private MenuItem pasteIntoItem;
49405373 private MenuItem pasteLinkItem;
49415374 private MenuItem pasteCloneItem;
49425375 private MenuItem pasteExpandItem;
....@@ -4975,6 +5408,10 @@
49755408 private MenuItem showleavesItem;
49765409 private MenuItem markleavesItem;
49775410 private MenuItem unmarkleavesItem;
5411
+ private MenuItem rewindleavesItem;
5412
+ private MenuItem unrewindleavesItem;
5413
+ private MenuItem randomleavesItem;
5414
+ private MenuItem unrandomleavesItem;
49785415
49795416 private MenuItem flipVItem;
49805417 private MenuItem unflipVItem;
....@@ -4986,8 +5423,10 @@
49865423 private MenuItem panoTexturesItem;
49875424
49885425 private MenuItem resetCentroidItem;
4989
- private MenuItem transformgeometryItem;
5426
+ private MenuItem resetCentroidXZItem;
49905427 private MenuItem resetTransformItem;
5428
+ private MenuItem transformGeometryItem;
5429
+ private MenuItem transformChildrenItem;
49915430 private MenuItem hideItem;
49925431 private MenuItem grabItem;
49935432 private MenuItem backItem;
....@@ -5009,6 +5448,7 @@
50095448
50105449 private MenuItem resetParentItem;
50115450 private MenuItem repairParentItem;
5451
+ private MenuItem repairShadowItem;
50125452 private MenuItem sortbysizeItem;
50135453 private MenuItem sortbynameItem;
50145454
....@@ -5033,7 +5473,7 @@
50335473 private MenuItem blobItem;
50345474 private MenuItem latheItem;
50355475 private MenuItem bezierItem;
5036
- private MenuItem checkerItem;
5476
+ private MenuItem overlayItem;
50375477 private MenuItem meshItem;
50385478 // private MenuItem meshGroupItem;
50395479 private MenuItem springItem;
....@@ -5055,11 +5495,6 @@
50555495 private MenuItem doubleItem;
50565496 private MenuItem tripleItem;
50575497
5058
- private MenuItem importGFDItem;
5059
- private MenuItem importVRMLX3DItem;
5060
- private MenuItem import3DSItem;
5061
- private MenuItem importOBJItem;
5062
-
50635498 private MenuItem computeAOItem;
50645499 private MenuItem recompileItem;
50655500 private MenuItem editScriptItem;
....@@ -5069,4 +5504,8 @@
50695504 private MenuItem analyzeItem;
50705505 private MenuItem dumpItem;
50715506 //boolean freezemodel = false;
5507
+
5508
+ Menu cameraMenu;
5509
+ MenuItem editCameraItem;
5510
+ MenuItem revertCameraItem;
50725511 }