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,150 +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);
523
- oe.aConstraints.gridx += 1;
524
- oe.aConstraints.weighty = 0;
525
- oe.aConstraints.gridwidth = 1;
526636
527
- //
528
- oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints);
637
+ oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
638
+
639
+ oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
640
+ twoButton.setToolTipText("Show center view only");
529641 twoButton.addActionListener(this);
530
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
642
+ oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
531643 fourButton.addActionListener(this);
532
- 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");
533647 sixButton.addActionListener(this);
534
- 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");
535650 threeButton.addActionListener(this);
536
- 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");
537653 sevenButton.addActionListener(this);
538654 //
539655
540
- 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");
541658 rootButton.addActionListener(this);
542
- oe.aConstraints.gridx += 1;
543
- 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");
544662 closeButton.addActionListener(this);
545663 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
546664 //clearButton.addActionListener(this);
547
- oe.aConstraints.gridx += 1;
548665
549
- oe.aConstraints.gridx = 1; //
550
- oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints);
666
+ editCommandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
667
+ editButton.setToolTipText("Edit selection");
551668 editButton.addActionListener(this);
552
- oe.aConstraints.gridx += 1;
553
- oe.aConstraints.weighty = 0;
554
- oe.aConstraints.gridwidth = 1;
555669
556
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
670
+ editCommandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
671
+ uneditButton.setToolTipText("Unedit selection");
557672 uneditButton.addActionListener(this);
558673
559
- oe.aConstraints.gridx += 1;
560
- oe.aConstraints.weighty = 0;
561
- oe.aConstraints.gridwidth = 1;
562
-
563
- oe.treePanel.add(clearPanelButton = new cButton("C"), oe.aConstraints);
564
- clearPanelButton.addActionListener(this);
565
-
566
- oe.aConstraints.gridx += 1;
567
- oe.aConstraints.weighty = 0;
568
- oe.aConstraints.gridwidth = 1;
569
-
570
- oe.treePanel.add(allParamsButton = new cButton("A"), oe.aConstraints);
674
+ editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
675
+ allParamsButton.setToolTipText("Edit all params");
571676 allParamsButton.addActionListener(this);
572677
573
- oe.aConstraints.gridx += 1;
574
- oe.aConstraints.weighty = 0;
575
- oe.aConstraints.gridwidth = 1;
576
-
577
- oe.treePanel.add(unselectButton = new cButton("U"), oe.aConstraints);
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");
578684 unselectButton.addActionListener(this);
579685
686
+ editCommandsPanel.preferredHeight = 1;
687
+
688
+// oe.treePanel.add(commandsPanel);
689
+// oe.treePanel.Return();
690
+
580691 // oe.aConstraints.gridx += 1;
581692 // oe.aConstraints.weighty = 0;
582693 // oe.aConstraints.gridwidth = 1;
....@@ -588,40 +699,37 @@
588699 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
589700 // gcButton.addActionListener(this);
590701
591
- oe.aConstraints.gridx = 0;
592
- oe.aConstraints.gridy += 1;
593
-
594
- //ctrlPanel.add(objList = new List(5, true));
595
- oe.aConstraints.gridwidth = 100;
596
- // oe.aConstraints.gridheight = 100;
597
- oe.aConstraints.fill = GridBagConstraints.BOTH; // HORIZONTAL;
598
- oe.aConstraints.gridheight = 1;
599
- oe.aConstraints.weighty = 0.5;
600
- oe.aConstraints.gridx = 0;
601
- JScrollPane jSP;
702
+ cGridBag jSPPanel = new cGridBag();
703
+
704
+ JScrollPane jSP;
602705 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
603
- oe.treePanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null)), oe.aConstraints);
706
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints);
604707 ResetModel();
605
- oe.aConstraints.weighty = 0.5;
606
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
607
- oe.aConstraints.gridy += 1;
608
- oe.aConstraints.gridwidth = 1;
708
+
709
+ oe.treePanel.add(jSPPanel);
710
+ oe.treePanel.Return();
609711
610
- oe.aConstraints.weighty = 0;
611
- oe.aConstraints.gridwidth = 2;
612
-
613
- oe.treePanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0), oe.aConstraints);
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");
614716 colorCB.addItemListener(this);
615
- oe.aConstraints.gridx += 2;
616
- 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");
617720 materialCB.addItemListener(this);
618
- oe.aConstraints.gridx += 2;
619
- 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");
620724 textureCB.addItemListener(this);
621725
622
- oe.aConstraints.gridx = 0;
623
- oe.aConstraints.gridy += 1;
726
+ copyOptionsPanel.preferredHeight = 1;
727
+ oe.treePanel.add(copyOptionsPanel);
728
+ oe.treePanel.Return();
624729
730
+// mainPanel.setDividerLocation(0.5); //1.0);
731
+// mainPanel.setResizeWeight(0.5);
732
+
625733 //jList.addListSelectionListener(this);
626734 oe.jTree.addTreeSelectionListener(this);
627735 //jTree.setRootVisible(false);
....@@ -643,20 +751,111 @@
643751 radio.layout = sevenButton;
644752 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
645753 }
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
+ }
646834
647835 void EditObject(Object3D obj)
648836 {
649
- cRadio dummyButton = new cRadio(obj.name);
650
- dummyButton.SetObject(obj);
651
- dummyButton.layout = sevenButton;
652
- dummyButton.SetCamera(cameraView.renderCamera, false);
653
- dummyButton.addActionListener(this);
654
- radioPanel.add(dummyButton);
655
- buttonGroup.add(dummyButton);
656
- dummyButton.doClick();
837
+ 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
+
846
+ radioButton.SetObject(obj);
847
+ radioButton.layout = sevenButton;
848
+ radioButton.SetCamera(cameraView.renderCamera, false);
849
+ radioButton.addActionListener(this);
850
+ radioPanel.add(radioButton);
851
+ buttonGroup.add(radioButton);
852
+ radioButton.doClick();
657853 }
854
+
658855 void SetupViews(ObjEditor oe)
659856 {
857
+ theFrame = this;
858
+
660859 oe.SetupViews();
661860
662861 System.out.println("SetupViews");
....@@ -673,13 +872,16 @@
673872 JCheckBox fastCB;
674873 JCheckBox slowCB;
675874 JCheckBox boxCB;
875
+ JCheckBox zoomBoxCB;
676876 JCheckBox trackCB;
677877 JCheckBox smoothfocusCB;
678878 // JCheckBox speakerMocapCB;
679879 JCheckBox speakerCameraCB;
680880 JCheckBox speakerFocusCB;
681881 JCheckBox debugCB;
882
+
682883 JCheckBox oeilCB;
884
+ JCheckBox shadowCB;
683885 JCheckBox lookAtCB;
684886
685887 // static int COLOR = 1;
....@@ -715,10 +917,10 @@
715917 dropAttributes |= Object3D.TEXTURE;
716918 else
717919 dropAttributes &= ~Object3D.TEXTURE;
718
- }
719
- else if(e.getSource() == liveCB)
920
+ } else if(e.getSource() == liveCB)
720921 {
721922 cameraView.ToggleLive();
923
+ refreshContents(false);
722924 }
723925 else if(e.getSource() == supportCB)
724926 {
....@@ -754,6 +956,10 @@
754956 cameraView.repaint();
755957 // refreshContents();
756958 }
959
+ else if(e.getSource() == zoomBoxCB)
960
+ {
961
+ cameraView.ToggleZoomBoxMode();
962
+ }
757963 else if(e.getSource() == smoothfocusCB)
758964 {
759965 cameraView.ToggleSmoothFocus();
....@@ -778,6 +984,10 @@
778984 else if(e.getSource() == oeilCB)
779985 {
780986 cameraView.ToggleOeil();
987
+ }
988
+ else if(e.getSource() == shadowCB)
989
+ {
990
+ Globals.COMPUTESHADOWWHENLIVE ^= true;
781991 }
782992 else if(e.getSource() == lookAtCB)
783993 {
....@@ -867,7 +1077,9 @@
8671077 // objEditor.DropFile((java.io.File[]) object, true);
8681078 // return;
8691079 // }
870
- if (string.charAt(0) == '/')
1080
+
1081
+ // File path for Mac and Windows
1082
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
8711083 {
8721084 // file(s)
8731085 String[] names = string.split("\n");
....@@ -894,7 +1106,7 @@
8941106
8951107 flashIt = false;
8961108 CameraPane pane = (CameraPane) target;
897
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1109
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
8981110 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
8991111
9001112 if (group.selection.size() == 1)
....@@ -921,11 +1133,11 @@
9211133 {
9221134 loadClipboard(true);
9231135 objEditor.jTree.setSelectionPath(destinationPath);
924
- pasteInto(false);
1136
+ pasteInto(false, false);
9251137 } else {
9261138 loadClipboard(false);
9271139 objEditor.jTree.setSelectionPath(destinationPath);
928
- pasteInto(false); // true); // ???
1140
+ pasteInto(false, false); // true); // ???
9291141 }
9301142 }
9311143 public void dropActionChanged(DropTargetDragEvent dtde)
....@@ -1047,27 +1259,33 @@
10471259 kleinItem.addActionListener(this);
10481260 particleItem = menu.add(new MenuItem("Particle system"));
10491261 particleItem.addActionListener(this);
1262
+ if (Globals.ADVANCED)
1263
+ {
10501264 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10511265 ragdollItem.addActionListener(this);
10521266 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10531267 ragdoll2Item.addActionListener(this);
1268
+ }
10541269 menu.add("-");
1055
- meshItem = menu.add(new MenuItem("Mesh"));
1270
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10561271 meshItem.addActionListener(this);
10571272 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10581273 // meshGroupItem.addActionListener(this);
1274
+ if (Globals.ADVANCED)
1275
+ {
10591276 springItem = menu.add(new MenuItem("Spring"));
10601277 springItem.addActionListener(this);
10611278 flagItem = menu.add(new MenuItem("Flag"));
10621279 flagItem.addActionListener(this);
1063
- bezierItem = menu.add(new MenuItem("Patch"));
1064
- bezierItem.addActionListener(this);
1065
- checkerItem = menu.add(new MenuItem("Checker"));
1066
- checkerItem.addActionListener(this);
10671280 blobItem = menu.add(new MenuItem("Blob"));
10681281 blobItem.addActionListener(this);
10691282 latheItem = menu.add(new MenuItem("Lathe"));
10701283 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);
10711289 lightItem = menu.add(new MenuItem("Light"));
10721290 lightItem.addActionListener(this);
10731291 menu.add("-");
....@@ -1077,39 +1295,44 @@
10771295 loopItem.addActionListener(this);
10781296 doubleItem = menu.add(new MenuItem("Fork"));
10791297 doubleItem.addActionListener(this);
1298
+ if (Globals.ADVANCED)
1299
+ {
10801300 tripleItem = menu.add(new MenuItem("Trident"));
10811301 tripleItem.addActionListener(this);
1302
+ }
10821303 }
10831304
10841305 void buildToolsMenu(Menu menu)
10851306 {
10861307 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
10871308 animationItem.addItemListener(this);
1088
- animationItem.setState(CameraPane.ANIMATION);
1309
+ animationItem.setState(Globals.ANIMATION);
10891310
10901311 menu.add("-");
10911312 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
10921313 parseverticesItem.addActionListener(this);
10931314 textureFieldItem = menu.add(new MenuItem("Texture Field"));
10941315 textureFieldItem.addActionListener(this);
1095
- alignItem = menu.add(new MenuItem("Align"));
1316
+ alignItem = menu.add(new MenuItem("Align Objects"));
10961317 alignItem.addActionListener(this);
1097
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1098
- mirrorItem.addActionListener(this);
10991318 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
11001319 reduceMorphItem.addActionListener(this);
11011320 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
11021321 reduce34MorphItem.addActionListener(this);
1103
-
1322
+ menu.add("-");
11041323 menu.add(computeAOItem = new MenuItem("Compute AO"));
11051324 computeAOItem.addActionListener(this);
1106
- menu.add("-");
11071325
1326
+ if (Globals.ADVANCED)
1327
+ {
1328
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1329
+ mirrorItem.addActionListener(this);
1330
+ menu.add("-");
11081331 menu.add(memoryItem = new MenuItem("Memory Usage"));
11091332 memoryItem.addActionListener(this);
11101333 menu.add(analyzeItem = new MenuItem("Analyze"));
11111334 analyzeItem.addActionListener(this);
1112
- menu.add(dumpItem = new MenuItem("Dump"));
1335
+ menu.add(dumpItem = new MenuItem("Print"));
11131336 dumpItem.addActionListener(this);
11141337 // menu.add(pathItem = new MenuItem("From-to path"));
11151338 // pathItem.addActionListener(this);
....@@ -1118,6 +1341,8 @@
11181341 resetParentItem.addActionListener(this);
11191342 repairParentItem = menu.add(new MenuItem("Repair Parent"));
11201343 repairParentItem.addActionListener(this);
1344
+ repairShadowItem = menu.add(new MenuItem("Repair Shadow"));
1345
+ repairShadowItem.addActionListener(this);
11211346 menu.add(invariantsItem = new MenuItem("Invariants"));
11221347 invariantsItem.addActionListener(this);
11231348 menu.add(recompileItem = new MenuItem("Recompile"));
....@@ -1125,6 +1350,7 @@
11251350 menu.add("-");
11261351 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11271352 editScriptItem.addActionListener(this);
1353
+ }
11281354 }
11291355
11301356 void ScreenFit()
....@@ -1247,6 +1473,7 @@
12471473 shadow.material = new cMaterial(obj.material);
12481474 shadow.material.diffuse = 0.0001f;
12491475 shadow.material.specular = 0.0001f;
1476
+ //shadow.projectedVertices[1].x = 300;
12501477
12511478 makeSomething(shadow);
12521479 }
....@@ -1453,9 +1680,9 @@
14531680
14541681 void Overwrite(int mask)
14551682 {
1456
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
1683
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14571684 {
1458
- Object3D content = GrafreeD.clipboard.get(0);
1685
+ Object3D content = Grafreed.clipboard.get(0);
14591686
14601687 if (content instanceof cGroup && ((cGroup)content).transientlink )
14611688 content = ((cGroup)content).get(0);
....@@ -1478,6 +1705,7 @@
14781705 //
14791706 public void actionPerformed(ActionEvent event) // , Object arg)
14801707 {
1708
+ Object source = event.getSource();
14811709 /*
14821710 if (event.getSource() == nameField)
14831711 {
....@@ -1489,11 +1717,11 @@
14891717 }
14901718 else
14911719 */
1492
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1720
+ if (source == lookAtItem || source == lookFromItem)
14931721 {
14941722 ScreenFit();
14951723 } else
1496
- if (event.getSource() == switchItem)
1724
+ if (source == switchItem)
14971725 {
14981726 cVector v1 = new cVector();
14991727 cVector v2 = new cVector();
....@@ -1502,11 +1730,11 @@
15021730 objEditor.cameraView.renderCamera.setAim(v2, v1);
15031731 objEditor.cameraView.repaint();
15041732 } else
1505
- if (event.getSource() == rectoidItem)
1733
+ if (source == rectoidItem)
15061734 {
15071735 makeSomething(new Box());
15081736 } else
1509
- if (event.getSource() == particleItem)
1737
+ if (source == particleItem)
15101738 {
15111739 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15121740 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1527,9 +1755,9 @@
15271755 applyExample(particleGeom, "SMOKE");
15281756 makeSomething(particleGeom);
15291757 } else
1530
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1758
+ if (source == ragdollItem || source == ragdoll2Item)
15311759 {
1532
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1760
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15331761
15341762 ragdoll.toParent = LA.newMatrix();
15351763 ragdoll.fromParent = LA.newMatrix();
....@@ -1547,7 +1775,7 @@
15471775 } else
15481776 /*
15491777 */
1550
- if (event.getSource() == heightFieldItem)
1778
+ if (source == heightFieldItem)
15511779 {
15521780 Object3D obj = new Object3D();
15531781
....@@ -1585,31 +1813,31 @@
15851813
15861814 makeSomething(obj);
15871815 } else
1588
- if (event.getSource() == gridItem)
1816
+ if (source == gridItem)
15891817 {
15901818 makeSomething(new Grid());
15911819 } else
1592
- if (event.getSource() == ellipsoidItem)
1820
+ if (source == ellipsoidItem)
15931821 {
15941822 makeSomething(new Sphere());
15951823 } else
1596
- if (event.getSource() == coneItem)
1824
+ if (source == coneItem)
15971825 {
15981826 makeSomething(new Cone());
15991827 } else
1600
- if (event.getSource() == torusItem)
1828
+ if (source == torusItem)
16011829 {
16021830 makeSomething(new Torus());
16031831 } else
1604
- if (event.getSource() == superItem)
1832
+ if (source == superItem)
16051833 {
16061834 makeSomething(new Superellipsoid());
16071835 } else
1608
- if (event.getSource() == kleinItem)
1836
+ if (source == kleinItem)
16091837 {
16101838 makeSomething(new Klein());
16111839 } else
1612
- if (event.getSource() == blobItem)
1840
+ if (source == blobItem)
16131841 {
16141842 Blob blob = new Blob();
16151843 BlobComponent comp = new BlobComponent();
....@@ -1617,15 +1845,15 @@
16171845 //blob.retile();
16181846 makeSomething(blob);
16191847 } else
1620
- if (event.getSource() == latheItem)
1848
+ if (source == latheItem)
16211849 {
16221850 makeSomething(new Lathe());
16231851 } else
1624
- if (event.getSource() == bezierItem)
1852
+ if (source == bezierItem)
16251853 {
16261854 makeSomething(new BezierSurface());
16271855 } else
1628
- if (event.getSource() == checkerItem)
1856
+ if (source == overlayItem)
16291857 {
16301858 /*
16311859 Object3D obj = new BezierSurface(5,8);
....@@ -1640,7 +1868,7 @@
16401868 */
16411869 makeSomething(new Checker());
16421870 } else
1643
- if (event.getSource() == meshItem)
1871
+ if (source == meshItem)
16441872 {
16451873 Object3D itemtomake = new Object3D();
16461874 Object3D child;
....@@ -1661,35 +1889,35 @@
16611889 makeSomething(child);
16621890 }
16631891 } else
1664
- if (event.getSource() == springItem)
1892
+ if (source == springItem)
16651893 {
16661894 cSpring s = new cSpring();
16671895 s.setup();
16681896 makeSomething(s);
16691897 } else
1670
- if (event.getSource() == flagItem)
1898
+ if (source == flagItem)
16711899 {
16721900 cSpring s = new cFlag();
16731901 s.setup();
16741902 makeSomething(s);
16751903 } else
1676
- if (event.getSource() == lightItem)
1904
+ if (source == lightItem)
16771905 {
16781906 makeSomething(new Light());
16791907 } else
1680
- if (event.getSource() == csgItem)
1908
+ if (source == csgItem)
16811909 {
16821910 group(new CSG());
16831911 } else
1684
- if (event.getSource() == templateItem)
1912
+ if (source == templateItem)
16851913 {
16861914 group(new cTemplate());
16871915 } else
1688
- if (event.getSource() == attributeItem)
1916
+ if (source == attributeItem)
16891917 {
16901918 makeSomething(new Attribute());
16911919 } else
1692
- if (event.getSource() == pointflowItem)
1920
+ if (source == pointflowItem)
16931921 {
16941922 makeSomething(new PointFlow());
16951923 } else
....@@ -1701,7 +1929,7 @@
17011929 } else
17021930 */
17031931
1704
- if (event.getSource() == superLoopItem)
1932
+ if (source == superLoopItem)
17051933 {
17061934 Composite g = new cGroup();
17071935 for (int i=0; i<15; i++)
....@@ -1723,7 +1951,7 @@
17231951
17241952 group(g);
17251953 } else
1726
- if (event.getSource() == loopItem)
1954
+ if (source == loopItem)
17271955 {
17281956 Composite csg = new GroupLeaf();
17291957 csg.count = 5;
....@@ -1732,7 +1960,7 @@
17321960 csg.addChild(child);
17331961 child.addChild(csg);
17341962 } else
1735
- if (event.getSource() == doubleItem)
1963
+ if (source == doubleItem)
17361964 {
17371965 Composite csg = new GroupLeaf();
17381966 csg.count = 5;
....@@ -1744,7 +1972,7 @@
17441972 csg.addChild(child);
17451973 child.addChild(csg);
17461974 } else
1747
- if (event.getSource() == tripleItem)
1975
+ if (source == tripleItem)
17481976 {
17491977 Composite csg = new GroupLeaf();
17501978 csg.count = 4;
....@@ -1759,71 +1987,83 @@
17591987 csg.addChild(child);
17601988 child.addChild(csg);
17611989 } else
1762
-
1763
- if (event.getSource() == importGFDItem)
1990
+ if (source == computeAOItem)
17641991 {
1765
- ImportGFD();
1992
+ Globals.drawMode = CameraPane.OCCLUSION;
1993
+ Globals.theRenderer.repaint();
17661994 } else
1767
- if (event.getSource() == importVRMLX3DItem)
1768
- {
1769
- ImportVRMLX3D();
1770
- } else
1771
- if (event.getSource() == import3DSItem)
1772
- {
1773
- objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
1774
- } else
1775
- if (event.getSource() == importOBJItem)
1776
- {
1777
- objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1778
- } else
1779
- if (event.getSource() == computeAOItem)
1780
- {
1781
- CameraPane.drawMode = CameraPane.OCCLUSION;
1782
- CameraPane.theRenderer.repaint();
1783
- } else
1784
- if (event.getSource() == recompileItem)
1995
+ if (source == recompileItem)
17851996 {
17861997 Recompile();
17871998 refreshContents();
17881999 } else
1789
- if (event.getSource() == editScriptItem)
2000
+ if (source == editScriptItem)
17902001 {
17912002 OpenDialog();
17922003 refreshContents();
17932004 } else
1794
- if (event.getSource() == invariantsItem)
2005
+ if (source == invariantsItem)
17952006 {
17962007 System.out.println("Invariants:");
1797
- GrafreeD.grafreeD.universe.invariants();
2008
+ Grafreed.grafreeD.universe.invariants();
17982009 } else
1799
- if (event.getSource() == memoryItem)
2010
+ if (source == memoryItem)
18002011 {
18012012 //System.out.println("Invariants:");
18022013 PrintMemory();
18032014 } else
1804
- if (event.getSource() == pathItem)
2015
+ if (source == pathItem)
18052016 {
18062017 PrintPath();
18072018 } else
1808
- if (event.getSource() == analyzeItem)
2019
+ if (source == analyzeItem)
18092020 {
18102021 AnalyzeObject();
18112022 } else
1812
- if (event.getSource() == dumpItem)
2023
+ if (source == dumpItem)
18132024 {
18142025 DumpObject();
18152026 } else
1816
- 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)
18172057 {
18182058 //Reload(lastConverter, lastFilename, true);
18192059 ScreenFit();
18202060 } else
1821
- if (event.getSource() == screenfitpointButton)
2061
+ if (source == screenfitpointButton)
18222062 {
18232063 //Reload(lastConverter, lastFilename, true);
18242064 ScreenFitPoint();
18252065 } else
1826
- if (event.getSource() == snapobjectButton)
2066
+ if (source == snapobjectButton)
18272067 {
18282068 //Reload(lastConverter, lastFilename, true);
18292069 SnapObject();
....@@ -1834,13 +2074,13 @@
18342074 // Recompile();
18352075 // refreshContents();
18362076 // } else
1837
- if (event.getSource() == gcButton)
2077
+ if (source == gcButton)
18382078 {
18392079 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18402080 System.gc();
18412081 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18422082 } else
1843
- if (event.getSource() == editLeafItem)
2083
+ if (source == editLeafItem)
18442084 {
18452085 Object3D obj;
18462086 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1854,62 +2094,74 @@
18542094 }
18552095 refreshContents(true);
18562096 } else
1857
- if (event.getSource() == openWindowItem)
2097
+ if (source == openWindowItem)
18582098 {
18592099 EditSelection(true);
18602100 } else
1861
- if (event.getSource() == cutItem || event.getSource() == clearButton)
2101
+ if (source == cutItem || source == clearButton)
18622102 {
18632103 loadClipboard(true);
18642104 } else
1865
- if (event.getSource() == duplicateItem)
2105
+ if (source == undoItem)
18662106 {
1867
- 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;
18682116 loadClipboard(false);
18692117 paste(false);
1870
- GrafreeD.clipboard = keep;
2118
+ Grafreed.clipboard = keep;
18712119 } else
1872
- if (event.getSource() == cloneItem)
2120
+ if (source == cloneItem)
18732121 {
18742122 CloneSelection(false);
18752123 } else
1876
- if (event.getSource() == cloneSupportItem)
2124
+ if (source == cloneSupportItem)
18772125 {
18782126 CloneSelection(true);
18792127 } else
1880
- if (event.getSource() == copyItem)
2128
+ if (source == copyItem)
18812129 {
18822130 loadClipboard(false);
18832131 } else
1884
- if (event.getSource() == pasteItem)
2132
+ if (source == pasteItem)
18852133 {
18862134 paste(false);
18872135 } else
1888
- if (event.getSource() == pasteLinkItem)
2136
+ if (source == pasteIntoItem)
18892137 {
1890
- pasteInto(false);
2138
+ pasteInto(true, false);
18912139 } else
1892
- if (event.getSource() == pasteCloneItem)
2140
+ if (source == pasteLinkItem)
18932141 {
1894
- pasteInto(true);
2142
+ pasteInto(false, false);
18952143 } else
1896
- if (event.getSource() == pasteExpandItem)
2144
+ if (source == pasteCloneItem)
2145
+ {
2146
+ pasteInto(true, true);
2147
+ } else
2148
+ if (source == pasteExpandItem)
18972149 {
18982150 paste(true);
18992151 } else
1900
- if (event.getSource() == synchronizeItem)
2152
+ if (source == synchronizeItem)
19012153 {
19022154 Overwrite(Object3D.TRANSFORM);
19032155 } else
1904
- if (event.getSource() == overwriteNameItem)
2156
+ if (source == overwriteNameItem)
19052157 {
19062158 Overwrite(Object3D.NAME);
19072159 } else
1908
- if (event.getSource() == overwriteUVItem)
2160
+ if (source == overwriteUVItem)
19092161 {
19102162 Overwrite(Object3D.UV);
19112163 } else
1912
- if (event.getSource() == overwriteMatItem)
2164
+ if (source == overwriteMatItem)
19132165 {
19142166 /* july 2015
19152167 if ((dropAttributes & Object3D.TEXTURE) == 0)
....@@ -1929,7 +2181,7 @@
19292181
19302182 Overwrite(dropAttributes);
19312183 }
1932
- if (event.getSource() == overwriteGeoItem)
2184
+ if (source == overwriteGeoItem)
19332185 {
19342186 Overwrite(Object3D.GEOMETRY);
19352187 // if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
....@@ -1946,7 +2198,7 @@
19462198 // refreshContents();
19472199 // }
19482200 } else
1949
- if (event.getSource() == generateMeshItem)
2201
+ if (source == generateMeshItem)
19502202 {
19512203 //if (group.selection.size() == 1)
19522204 // for (int i=0; i<group.selection.size(); i++)
....@@ -1957,7 +2209,7 @@
19572209 ResetModel();
19582210 refreshContents();
19592211 } else
1960
- if (event.getSource() == extractGeometriesItem)
2212
+ if (source == extractGeometriesItem)
19612213 {
19622214 boolean one = false;
19632215
....@@ -1984,7 +2236,7 @@
19842236 ResetModel();
19852237 refreshContents();
19862238 } else
1987
- if (event.getSource() == cloneGeometriesItem)
2239
+ if (source == cloneGeometriesItem)
19882240 {
19892241 boolean one = false;
19902242
....@@ -2010,7 +2262,7 @@
20102262 ResetModel();
20112263 refreshContents();
20122264 } else
2013
- if (event.getSource() == shareGeometriesItem)
2265
+ if (source == shareGeometriesItem)
20142266 {
20152267 boolean one = false;
20162268
....@@ -2040,7 +2292,7 @@
20402292 refreshContents();
20412293 }
20422294 } else
2043
- if (event.getSource() == mergeGeometriesItem)
2295
+ if (source == mergeGeometriesItem)
20442296 {
20452297 boolean one = false;
20462298
....@@ -2070,7 +2322,7 @@
20702322 ResetModel();
20712323 refreshContents();
20722324 } else
2073
- if (event.getSource() == linkverticesItem)
2325
+ if (source == linkverticesItem)
20742326 {
20752327 // if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
20762328 // {
....@@ -2083,48 +2335,48 @@
20832335 // group.selection.get(0).setMasterThis(content); // should be identity
20842336 // refreshContents();
20852337 // }
2086
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2338
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
20872339 {
2088
- Object3D content = GrafreeD.clipboard.get(0);
2340
+ Object3D content = Grafreed.clipboard.get(0);
20892341
20902342 if (content instanceof cGroup && ((cGroup)content).transientlink )
20912343 content = ((cGroup)content).get(0);
20922344
2093
- 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));
20942346 for (int i=0; i<group.selection.size(); i++)
20952347 {
2096
- boolean random = CameraPane.RANDOM;
2097
- CameraPane.RANDOM = false; // parse all random nodes
2348
+ boolean random = CameraPane.SWITCH;
2349
+ CameraPane.SWITCH = false; // parse all random nodes
20982350 group.selection.get(i).linkVerticesThis(content);
20992351 // group.selection.get(i).setMasterThis(content); // should be identity
2100
- CameraPane.RANDOM = random;
2352
+ CameraPane.SWITCH = random;
21012353 }
2102
- 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));
21032355 refreshContents();
21042356 }
21052357 } else
2106
- if (event.getSource() == resetsupportItem)
2358
+ if (source == resetsupportItem)
21072359 {
21082360 for (int i=0; i<group.selection.size(); i++)
21092361 {
2110
- boolean random = CameraPane.RANDOM;
2111
- CameraPane.RANDOM = false; // parse all random nodes
2362
+ boolean random = CameraPane.SWITCH;
2363
+ CameraPane.SWITCH = false; // parse all random nodes
21122364 group.selection.get(i).linkVerticesThis(null);
2113
- CameraPane.RANDOM = random;
2365
+ CameraPane.SWITCH = random;
21142366 }
21152367
21162368 refreshContents();
21172369 } else
2118
- if (event.getSource() == relinkverticesItem)
2370
+ if (source == relinkverticesItem)
21192371 {
2120
- boolean random = CameraPane.RANDOM;
2121
- CameraPane.RANDOM = false; // parse all random nodes
2372
+ boolean random = CameraPane.SWITCH;
2373
+ CameraPane.SWITCH = false; // parse all random nodes
21222374 group.selection.RelinkToSupport();
2123
- CameraPane.RANDOM = random;
2375
+ CameraPane.SWITCH = random;
21242376
21252377 refreshContents();
21262378 } else
2127
- if (event.getSource() == resetreferencesItem)
2379
+ if (source == resetreferencesItem)
21282380 {
21292381 for (int i=0; i<group.selection.size(); i++)
21302382 {
....@@ -2133,11 +2385,11 @@
21332385
21342386 refreshContents();
21352387 } else
2136
- if (event.getSource() == setMasterItem)
2388
+ if (source == setMasterItem)
21372389 {
2138
- if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
2390
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
21392391 {
2140
- Object3D content = GrafreeD.clipboard.get(0);
2392
+ Object3D content = Grafreed.clipboard.get(0);
21412393
21422394 if (content instanceof cGroup && ((cGroup)content).transientlink )
21432395 content = ((cGroup)content).get(0);
....@@ -2146,13 +2398,13 @@
21462398 refreshContents();
21472399 }
21482400 } else
2149
- if (event.getSource() == poseMeshItem)
2401
+ if (source == poseMeshItem)
21502402 {
21512403 if (group.selection.size() == 1)
21522404 {
2153
- if (GrafreeD.clipboard.size() == 1)
2405
+ if (Grafreed.clipboard.size() == 1)
21542406 {
2155
- Object3D content = GrafreeD.clipboard.get(0);
2407
+ Object3D content = Grafreed.clipboard.get(0);
21562408
21572409 if (content instanceof cGroup && ((cGroup)content).transientlink )
21582410 content = ((cGroup)content).get(0);
....@@ -2165,19 +2417,19 @@
21652417 }
21662418
21672419 } else
2168
- if (event.getSource() == revertMeshItem)
2420
+ if (source == revertMeshItem)
21692421 {
21702422 RevertMeshes();
21712423 } else
2172
- if (event.getSource() == resetMeshItem)
2424
+ if (source == resetAllItem)
21732425 {
21742426 ResetAll();
21752427 } else
2176
- if (event.getSource() == stepAllItem)
2428
+ if (source == stepAllItem)
21772429 {
21782430 StepAll();
21792431 } else
2180
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2432
+ if (source == clearItem) // || event.getSource() == clearButton)
21812433 {
21822434 //int indices[] = jList.getSelectedIndices();
21832435 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2185,46 +2437,46 @@
21852437
21862438 ClearSelection(false);
21872439 } else
2188
- if (event.getSource() == clearAllItem)
2440
+ if (source == clearAllItem)
21892441 {
21902442 ClearSelection(true);
21912443 } else
2192
- if (event.getSource() == grabItem)
2444
+ if (source == grabItem)
21932445 {
21942446 group(new cGroup(), true);
21952447 } else
2196
- if (event.getSource() == hideItem)
2448
+ if (source == hideItem)
21972449 {
21982450 group(new HiddenObject());
21992451 } else
2200
- if (event.getSource() == frontItem)
2452
+ if (source == frontItem)
22012453 {
22022454 front();
22032455 } else
2204
- if (event.getSource() == backItem)
2456
+ if (source == backItem)
22052457 {
22062458 back();
22072459 } else
2208
- if (event.getSource() == cameraItem)
2460
+ if (source == cameraItem)
22092461 {
22102462 makeSomething(new Camera());
22112463 } else
2212
- if (event.getSource() == compositeItem)
2464
+ if (source == compositeItem)
22132465 {
22142466 group(new Composite());
22152467 } else
2216
- if (event.getSource() == randomItem)
2468
+ if (source == randomItem)
22172469 {
22182470 RandomNode random = new RandomNode();
22192471 group(random);
22202472 if (random.size() > 0)
2221
- random.name = random.get(0).name + "Rnd";
2473
+ random.name = random.get(0).name + "Switch";
22222474 } else
2223
- if (event.getSource() == physicsItem)
2475
+ if (source == physicsItem)
22242476 {
22252477 group(new PhysicsNode());
22262478 } else
2227
- if (event.getSource() == frameselectorItem)
2479
+ if (source == frameselectorItem)
22282480 {
22292481 for (int i=0; i<group.selection.size(); i++)
22302482 {
....@@ -2236,7 +2488,7 @@
22362488 ResetModel();
22372489 refreshContents();
22382490 } else
2239
- if (event.getSource() == switchGeoItem)
2491
+ if (source == switchGeoItem)
22402492 {
22412493 for (int i=0; i<group.selection.size(); i++)
22422494 {
....@@ -2248,7 +2500,7 @@
22482500 ResetModel();
22492501 refreshContents();
22502502 } else
2251
- if (event.getSource() == switchTransfoItem)
2503
+ if (source == switchTransfoItem)
22522504 {
22532505 for (int i=0; i<group.selection.size(); i++)
22542506 {
....@@ -2260,7 +2512,7 @@
22602512 ResetModel();
22612513 refreshContents();
22622514 } else
2263
- if (event.getSource() == morphItem)
2515
+ if (source == morphItem)
22642516 {
22652517 for (int i=0; i<group.selection.size(); i++)
22662518 {
....@@ -2272,7 +2524,7 @@
22722524 ResetModel();
22732525 refreshContents();
22742526 } else
2275
- if (event.getSource() == scriptNodeItem)
2527
+ if (source == scriptNodeItem)
22762528 {
22772529 boolean atleastone = false;
22782530
....@@ -2311,31 +2563,31 @@
23112563 }
23122564 }
23132565 } else
2314
- if (event.getSource() == linkerItem)
2566
+ if (source == linkerItem)
23152567 {
23162568 group(new cLinker());
23172569 } else
2318
- if (event.getSource() == textureItem)
2570
+ if (source == textureItem)
23192571 {
23202572 group(new TextureNode());
23212573 } else
2322
- if (event.getSource() == billboardItem)
2574
+ if (source == billboardItem)
23232575 {
23242576 group(new BillboardNode());
23252577 } else
2326
- if (event.getSource() == shadowXItem)
2578
+ if (source == shadowXItem)
23272579 {
23282580 CastShadow(0);
23292581 } else
2330
- if (event.getSource() == shadowYItem)
2582
+ if (source == shadowYItem)
23312583 {
23322584 CastShadow(1);
23332585 } else
2334
- if (event.getSource() == shadowZItem)
2586
+ if (source == shadowZItem)
23352587 {
23362588 CastShadow(2);
23372589 } else
2338
- if (event.getSource() == ungroupItem)
2590
+ if (source == ungroupItem)
23392591 {
23402592 //ungroup();
23412593 for (int i=0; i<group.selection.size(); i++)
....@@ -2347,179 +2599,203 @@
23472599
23482600 refreshContents();
23492601 } else
2350
- if (event.getSource() == genUVItem)
2602
+ if (source == genUVItem)
23512603 {
23522604 GenUV();
23532605 } else
2354
- if (event.getSource() == genNormalsCADItem)
2606
+ if (source == genNormalsCADItem)
23552607 {
23562608 GenNormals(true);
23572609 } else
2358
- if (event.getSource() == genNormalsMESHItem)
2610
+ if (source == genNormalsMESHItem)
23592611 {
2360
- GenNormals(true); // TODO
2612
+ GenNormalsMESH();
23612613 } else
2362
- if (event.getSource() == genNormalsORGANItem)
2614
+ if (source == genNormalsORGANItem)
23632615 {
23642616 GenNormals(false);
23652617 } else
2366
- if (event.getSource() == genNormalsMINEItem)
2618
+ if (source == genNormalsMINEItem)
23672619 {
23682620 GenNormalsMINE();
23692621 } else
2370
- if (event.getSource() == stripifyItem)
2622
+ if (source == stripifyItem)
23712623 {
23722624 Stripify();
23732625 } else
2374
- if (event.getSource() == unstripifyItem)
2626
+ if (source == unstripifyItem)
23752627 {
23762628 Unstripify();
23772629 } else
2378
- if (event.getSource() == trimItem)
2630
+ if (source == trimItem)
23792631 {
23802632 Trim();
23812633 } else
2382
- if (event.getSource() == untrimItem)
2634
+ if (source == untrimItem)
23832635 {
23842636 Untrim();
23852637 } else
2386
- if (event.getSource() == clearColorsItem)
2638
+ if (source == clearColorsItem)
23872639 {
23882640 ClearColors();
23892641 } else
2390
- if (event.getSource() == clearMaterialsItem)
2642
+ if (source == clearMaterialsItem)
23912643 {
23922644 ClearMaterials();
23932645 } else
2394
- if (event.getSource() == liveleavesItem)
2646
+ if (source == liveleavesItem)
23952647 {
23962648 LiveLeaves(true);
23972649 } else
2398
- if (event.getSource() == unliveleavesItem)
2650
+ if (source == unliveleavesItem)
23992651 {
24002652 LiveLeaves(false);
24012653 } else
2402
- if (event.getSource() == supportleavesItem)
2654
+ if (source == supportleavesItem)
24032655 {
24042656 SupportLeaves(true);
24052657 } else
2406
- if (event.getSource() == unsupportleavesItem)
2658
+ if (source == unsupportleavesItem)
24072659 {
24082660 SupportLeaves(false);
24092661 } else
2410
- if (event.getSource() == hideleavesItem)
2662
+ if (source == hideleavesItem)
24112663 {
24122664 HideLeaves(true);
24132665 } else
2414
- if (event.getSource() == showleavesItem)
2666
+ if (source == showleavesItem)
24152667 {
24162668 HideLeaves(false);
24172669 } else
2418
- if (event.getSource() == markleavesItem)
2670
+ if (source == markleavesItem)
24192671 {
24202672 MarkLeaves(true);
24212673 } else
2422
- if (event.getSource() == unmarkleavesItem)
2674
+ if (source == unmarkleavesItem)
24232675 {
24242676 MarkLeaves(false);
24252677 } else
2426
- 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)
24272695 {
24282696 FlipV(true);
24292697 } else
2430
- if (event.getSource() == unflipVItem)
2698
+ if (source == unflipVItem)
24312699 {
24322700 FlipV(false);
24332701 } else
2434
- if (event.getSource() == lowTexturesItem)
2702
+ if (source == lowTexturesItem)
24352703 {
24362704 SetTexRes(0);
24372705 } else
2438
- if (event.getSource() == normalTexturesItem)
2706
+ if (source == normalTexturesItem)
24392707 {
24402708 SetTexRes(1);
24412709 } else
2442
- if (event.getSource() == highTexturesItem)
2710
+ if (source == highTexturesItem)
24432711 {
24442712 SetTexRes(2);
24452713 } else
2446
- if (event.getSource() == veryhighTexturesItem)
2714
+ if (source == veryhighTexturesItem)
24472715 {
24482716 SetTexRes(3);
24492717 } else
2450
- if (event.getSource() == maxTexturesItem)
2718
+ if (source == maxTexturesItem)
24512719 {
24522720 SetTexRes(4);
24532721 } else
2454
- if (event.getSource() == panoTexturesItem)
2722
+ if (source == panoTexturesItem)
24552723 {
24562724 SetTexRes(5);
24572725 } else
2458
- if (event.getSource() == reverseNormalsItem)
2726
+ if (source == reverseNormalsItem)
24592727 {
24602728 ReverseNormals();
24612729 } else
2462
- if (event.getSource() == parseverticesItem)
2730
+ if (source == parseverticesItem)
24632731 {
24642732 ParseVertices();
24652733 } else
2466
- if (event.getSource() == textureFieldItem)
2734
+ if (source == textureFieldItem)
24672735 {
24682736 TextureVertices();
24692737 } else
2470
- if (event.getSource() == alignItem)
2738
+ if (source == alignItem)
24712739 {
24722740 Align();
24732741 } else
2474
- if (event.getSource() == mirrorItem)
2742
+ if (source == mirrorItem)
24752743 {
24762744 MirrorPoses();
24772745 } else
2478
- if (event.getSource() == reduceMorphItem)
2746
+ if (source == reduceMorphItem)
24792747 {
24802748 MeshReduction(false);
24812749 } else
2482
- if (event.getSource() == reduce34MorphItem)
2750
+ if (source == reduce34MorphItem)
24832751 {
24842752 MeshReduction(true);
24852753 } else
2486
- if (event.getSource() == reverseTrianglesItem)
2754
+ if (source == reverseTrianglesItem)
24872755 {
24882756 ReverseTriangles();
24892757 } else
2490
- if (event.getSource() == reduceMeshItem)
2758
+ if (source == reduceMeshItem)
24912759 {
24922760 ReduceMesh(false);
24932761 } else
2494
- if (event.getSource() == reduce34MeshItem)
2762
+ if (source == reduce34MeshItem)
24952763 {
24962764 ReduceMesh(true);
24972765 } else
2498
- if (event.getSource() == increaseMeshItem)
2766
+ if (source == increaseMeshItem)
24992767 {
25002768 IncreaseMesh();
25012769 } else
2502
- if (event.getSource() == clipMeshItem)
2770
+ if (source == clipMeshItem)
25032771 {
25042772 ClipMesh();
25052773 } else
2506
- if (event.getSource() == smoothMeshItem)
2774
+ if (source == smoothMeshItem)
25072775 {
25082776 SmoothMesh();
25092777 } else
2510
- if (event.getSource() == transformgeometryItem)
2778
+ if (source == transformGeometryItem)
25112779 {
25122780 TransformGeometry();
25132781 } else
2514
- if (event.getSource() == resetTransformItem)
2782
+ if (source == transformChildrenItem)
2783
+ {
2784
+ TransformChildren();
2785
+ } else
2786
+ if (source == resetTransformItem)
25152787 {
25162788 ResetTransform();
25172789 } else
2518
- if (event.getSource() == resetCentroidItem)
2790
+ if (source == resetCentroidItem)
25192791 {
2520
- ResetCentroid();
2792
+ ResetCentroid(true);
25212793 } else
2522
- if (event.getSource() == resetParentItem)
2794
+ if (source == resetCentroidXZItem)
2795
+ {
2796
+ ResetCentroid(false);
2797
+ } else
2798
+ if (source == resetParentItem)
25232799 {
25242800 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25252801 {
....@@ -2529,7 +2805,7 @@
25292805
25302806 refreshContents();
25312807 } else
2532
- if (event.getSource() == repairParentItem)
2808
+ if (source == repairParentItem)
25332809 {
25342810 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25352811 {
....@@ -2543,7 +2819,21 @@
25432819
25442820 refreshContents();
25452821 } else
2546
- 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)
25472837 {
25482838 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25492839 {
....@@ -2555,7 +2845,7 @@
25552845 ResetModel();
25562846 refreshContents();
25572847 } else
2558
- if (event.getSource() == sortbynameItem)
2848
+ if (source == sortbynameItem)
25592849 {
25602850 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25612851 {
....@@ -2567,7 +2857,7 @@
25672857 ResetModel();
25682858 refreshContents();
25692859 } else
2570
- if (event.getSource() == attachPigmentItem)
2860
+ if (source == attachPigmentItem)
25712861 {
25722862 String texture = GetFile("Attach pigment");
25732863 Object3D obj;
....@@ -2579,7 +2869,7 @@
25792869
25802870 refreshContents();
25812871 } else
2582
- if (event.getSource() == detachPigmentItem)
2872
+ if (source == detachPigmentItem)
25832873 {
25842874 Object3D obj;
25852875 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2590,7 +2880,7 @@
25902880
25912881 refreshContents();
25922882 } else
2593
- if (event.getSource() == attachBumpItem)
2883
+ if (source == attachBumpItem)
25942884 {
25952885 String texture = GetFile("Attach bump");
25962886 Object3D obj;
....@@ -2602,7 +2892,7 @@
26022892
26032893 refreshContents();
26042894 } else
2605
- if (event.getSource() == detachBumpItem)
2895
+ if (source == detachBumpItem)
26062896 {
26072897 Object3D obj;
26082898 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2613,7 +2903,7 @@
26132903
26142904 refreshContents();
26152905 } else
2616
- if (event.getSource() == pigmentBumpItem)
2906
+ if (source == pigmentBumpItem)
26172907 {
26182908 Object3D obj;
26192909 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2624,158 +2914,221 @@
26242914
26252915 refreshContents();
26262916 } else
2627
- if (event.getSource() == flashSelectionButton)
2917
+ if (source == flashSelectionButton)
26282918 {
26292919 CameraPane.flash = true;
26302920 refreshContents();
26312921 } else
2632
- if (event.getSource() == oneButton)
2922
+ if (source == oneButton)
26332923 {
26342924 } else
2635
- if (event.getSource() == twoButton)
2925
+ if (source == twoButton)
26362926 {
26372927 radio.layout = twoButton;
26382928 // bug
26392929 //gridPanel.setDividerLocation(1.0);
26402930 //bigPanel.setDividerLocation(0.0);
2641
- bigThree.remove(scenePanel);
2642
- bigThree.remove(cameraPanel);
2643
- bigThree.remove(XYZPanel);
2644
- aWindowConstraints.gridx = 0;
2645
- aWindowConstraints.gridy = 0;
2646
- aWindowConstraints.gridwidth = 1;
2647
- // aConstraints.gridheight = 3;
2648
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2649
- aWindowConstraints.weightx = 0;
2650
- aWindowConstraints.weighty = 1;
2651
- //bigThree.add(jtp, aWindowConstraints);
2652
- aWindowConstraints.weightx = 1;
2653
- aWindowConstraints.gridwidth = 3;
2654
- // aConstraints.gridheight = 3;
2655
- aWindowConstraints.gridx = 1;
2656
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2657
- bigThree.add(cameraPanel, aWindowConstraints);
2658
- aWindowConstraints.weightx = 0;
2659
- aWindowConstraints.gridx = 4;
2660
- aWindowConstraints.gridwidth = 1;
2661
- // aConstraints.gridheight = 3;
2662
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2663
- //bigThree.add(XYZPanel, aWindowConstraints);
2664
- bigThree.revalidate();
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
+
26652978 } else
2666
- if (event.getSource() == threeButton)
2979
+ if (source == threeButton)
26672980 {
26682981 radio.layout = threeButton;
2669
- bigThree.remove(scenePanel);
2670
- bigThree.remove(cameraPanel);
2671
- bigThree.remove(XYZPanel);
2672
- aWindowConstraints.gridx = 0;
2673
- aWindowConstraints.gridy = 0;
2674
- aWindowConstraints.gridwidth = 1;
2675
- // aConstraints.gridheight = 3;
2676
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2677
- aWindowConstraints.weightx = 0;
2678
- aWindowConstraints.weighty = 1;
2679
- //bigThree.add(jtp, aWindowConstraints);
2680
- aWindowConstraints.weightx = 1;
2681
- aWindowConstraints.gridwidth = 3;
2682
- // aConstraints.gridheight = 3;
2683
- aWindowConstraints.gridx = 1;
2684
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2685
- bigThree.add(cameraPanel, aWindowConstraints);
2686
- aWindowConstraints.weightx = 0;
2687
- aWindowConstraints.gridx = 4;
2688
- aWindowConstraints.gridwidth = 1;
2689
- // aConstraints.gridheight = 3;
2690
- aConstraints.fill = GridBagConstraints.VERTICAL;
2691
- bigThree.add(XYZPanel, aWindowConstraints);
2692
- bigThree.revalidate();
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();
26933016 } else
2694
- if (event.getSource() == fourButton)
3017
+ if (source == fourButton)
26953018 {
26963019 radio.layout = fourButton;
2697
- bigThree.remove(scenePanel);
2698
- bigThree.remove(cameraPanel);
2699
- bigThree.remove(XYZPanel);
2700
- aWindowConstraints.gridx = 0;
2701
- aWindowConstraints.gridy = 0;
2702
- aWindowConstraints.gridwidth = 1;
2703
- // aWindowConstraints.gridheight = 3;
2704
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2705
- aWindowConstraints.weightx = 1;
2706
- aWindowConstraints.weighty = 1;
2707
- bigThree.add(scenePanel, aWindowConstraints);
2708
- aWindowConstraints.weightx = 1;
2709
- aWindowConstraints.gridwidth = 3;
2710
- // aConstraints.gridheight = 3;
2711
- aWindowConstraints.gridx = 1;
2712
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2713
- //bigThree.add(cameraPanel, aWindowConstraints);
2714
- aWindowConstraints.weightx = 0;
2715
- aWindowConstraints.gridx = 4;
2716
- aWindowConstraints.gridwidth = 1;
2717
- // aWindowConstraints.gridheight = 3;
2718
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2719
- //bigThree.add(XYZPanel, aWindowConstraints);
2720
- bigThree.revalidate();
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();
27213053 } else
2722
- if (event.getSource() == sixButton)
3054
+ if (source == sixButton)
27233055 {
27243056 radio.layout = sixButton;
2725
- bigThree.remove(scenePanel);
2726
- bigThree.remove(cameraPanel);
2727
- bigThree.remove(XYZPanel);
2728
- aWindowConstraints.gridx = 0;
2729
- aWindowConstraints.gridy = 0;
2730
- aWindowConstraints.gridwidth = 1;
2731
- // aConstraints.gridheight = 3;
2732
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2733
- aWindowConstraints.weightx = 0;
2734
- aWindowConstraints.weighty = 1;
2735
- bigThree.add(scenePanel, aWindowConstraints);
2736
- aWindowConstraints.weightx = 1;
2737
- aWindowConstraints.gridwidth = 3;
2738
- // aWindowConstraints.gridheight = 3;
2739
- aWindowConstraints.gridx = 1;
2740
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2741
- bigThree.add(cameraPanel, aWindowConstraints);
2742
- aWindowConstraints.weightx = 0;
2743
- aWindowConstraints.gridx = 4;
2744
- aWindowConstraints.gridwidth = 1;
2745
- // aWindowConstraints.gridheight = 3;
2746
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2747
- //bigThree.add(XYZPanel, aConstraints);
2748
- bigThree.revalidate();
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();
27493091 } else
2750
- if (event.getSource() == sevenButton)
3092
+ if (source == sevenButton)
27513093 {
27523094 radio.layout = sevenButton;
2753
- bigThree.remove(scenePanel);
2754
- bigThree.remove(cameraPanel);
2755
- bigThree.remove(XYZPanel);
2756
- aWindowConstraints.gridx = 0;
2757
- aWindowConstraints.gridy = 0;
2758
- aWindowConstraints.gridwidth = 1;
2759
- // aWindowConstraints.gridheight = 3;
2760
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2761
- aWindowConstraints.weightx = 0;
2762
- aWindowConstraints.weighty = 1;
2763
- bigThree.add(scenePanel, aWindowConstraints);
2764
- aWindowConstraints.weightx = 1;
2765
- aWindowConstraints.gridwidth = 3;
2766
- // aWindowConstraints.gridheight = 3;
2767
- aWindowConstraints.gridx = 1;
2768
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2769
- bigThree.add(cameraPanel, aWindowConstraints);
2770
- aWindowConstraints.weightx = 0;
2771
- aWindowConstraints.gridx = 4;
2772
- aWindowConstraints.gridwidth = 1;
2773
- // aConstraints.gridheight = 3;
2774
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2775
- bigThree.add(XYZPanel, aWindowConstraints);
2776
- bigThree.revalidate();
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();
27773130 } else
2778
- if (event.getSource() == rootButton)
3131
+ if (source == rootButton)
27793132 {
27803133 Object3D obj;
27813134 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2785,17 +3138,24 @@
27853138 EditObject(obj);
27863139 }
27873140
3141
+ cameraView.requestFocusInWindow();
27883142 refreshContents(true);
27893143 } else
2790
- if (event.getSource() == closeButton)
3144
+ if (source == closeButton)
27913145 {
27923146 //System.out.println("CLOSE: " + buttonGroup.getSelection());
27933147 cRadio ab;
27943148 for (Enumeration e = buttonGroup.getElements(); e.hasMoreElements();)
27953149 {
27963150 ab = (cRadio)e.nextElement();
2797
- if(ab.getModel().isSelected() && ab.GetObject() != client)
3151
+ if (ab.getModel().isSelected() && ab.GetObject() != client)
27983152 {
3153
+ // Patch to avoid bug with transparency.
3154
+ if (!ab.hadMaterial)
3155
+ {
3156
+ ab.object.material = null;
3157
+ }
3158
+
27993159 buttonGroup.remove(ab);
28003160 radioPanel.remove(ab);
28013161
....@@ -2806,13 +3166,15 @@
28063166 break;
28073167 }
28083168 }
3169
+
3170
+ cameraView.requestFocusInWindow();
28093171 refreshContents(true);
28103172 } else
2811
- if (event.getSource() == editItem || event.getSource() == editButton)
3173
+ if (source == editItem || source == editButton)
28123174 {
28133175 EditSelection(false);
28143176 } else
2815
- if (event.getSource() == uneditButton)
3177
+ if (source == uneditButton)
28163178 {
28173179 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
28183180 {
....@@ -2822,14 +3184,14 @@
28223184 child.CloseUI();
28233185 listUI.remove(child);
28243186
2825
- child.editWindow = null; // ???????????
3187
+ //child.editWindow = null; // ???????????
28263188 }
2827
- objEditor.ctrlPanel.revalidate();
3189
+ objEditor.ctrlPanel.FlushUI();
28283190 //objEditor.jTree.clearSelection();
28293191 //objEditor.ResetSliders();
28303192 refreshContents(true);
28313193 } else
2832
- if (event.getSource() == clearPanelButton)
3194
+ if (source == clearPanelButton)
28333195 {
28343196 assert(copy == group);
28353197 //copy.ClearUI();
....@@ -2840,7 +3202,7 @@
28403202 listUI.clear();
28413203 refreshContents(true);
28423204 } else
2843
- if (event.getSource() == allParamsButton)
3205
+ if (source == allParamsButton)
28443206 {
28453207 assert(copy == group);
28463208
....@@ -2861,19 +3223,19 @@
28613223
28623224 refreshContents(true);
28633225 } else
2864
- if (event.getSource() == unselectButton)
3226
+ if (source == unselectButton)
28653227 {
28663228 objEditor.jTree.clearSelection();
28673229 // ?? oct 2012 GrafreeD.clipboard.clear();
28683230 objEditor.ResetSliders();
28693231 refreshContents(true);
28703232 } else
2871
- if(event.getSource() instanceof cRadio)
3233
+ if(source instanceof cRadio)
28723234 {
28733235 group.parent = keepparent;
28743236 group.attributes = 0;
28753237 //group.editWindow = null;
2876
- /*cRadio*/ radio = (cRadio)event.getSource();
3238
+ /*cRadio*/ radio = (cRadio)source;
28773239 Object3D obj = radio.GetObject();
28783240 System.out.println("Edit " + obj);
28793241 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -2893,7 +3255,7 @@
28933255 }
28943256
28953257 copy = group;
2896
- //CameraPane.theRenderer.object = group;
3258
+ //Globals.theRenderer.object = group;
28973259 if(!useclient)
28983260 {
28993261 cameraView.renderCamera = radio.camera;
....@@ -2902,12 +3264,16 @@
29023264 cameraView.cameras[cameraView.cameracount] = radio.camera;
29033265 cameraView.targetLookAt.set(radio.camera.lookAt);
29043266 cameraView.object = group;
2905
- cameraView.lighttouched = true;
3267
+ //cameraView.lighttouched = true;
3268
+ Globals.lighttouched = true;
29063269 topView.object = group;
29073270 frontView.object = group;
29083271 sideView.object = group;
29093272 }
2910
- group.editWindow = this;
3273
+
3274
+// fix "+" issue
3275
+ //group.editWindow = this;
3276
+
29113277 /*
29123278 currentLayout = radio.layout;
29133279 if (currentLayout == null)
....@@ -2919,8 +3285,23 @@
29193285 //group.parent = null; // ROOT
29203286 //group.attributes = -1;
29213287 ResetModel();
3288
+
3289
+ cameraView.requestFocusInWindow();
29223290 refreshContents(true);
2923
- }
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
+ }
29243305 else
29253306 {
29263307 //return super.action(event, arg);
....@@ -2929,7 +3310,6 @@
29293310 }
29303311
29313312 boolean useclient = false;
2932
- cRadio radio;
29333313
29343314 void ToggleRoot()
29353315 {
....@@ -2938,7 +3318,7 @@
29383318 if (useclient)
29393319 {
29403320 cameraView.object = client;
2941
- cameraView.lighttouched = true;
3321
+ Globals.lighttouched = true;
29423322 //topView.object = client;
29433323 //frontView.object = client;
29443324 //sideView.object = client;
....@@ -2946,7 +3326,7 @@
29463326 else
29473327 {
29483328 cameraView.object = group;
2949
- cameraView.lighttouched = true;
3329
+ Globals.lighttouched = true;
29503330 //topView.object = group;
29513331 //frontView.object = group;
29523332 //sideView.object = group;
....@@ -2981,6 +3361,28 @@
29813361 refreshContents();
29823362 }
29833363
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
+ }
29843386
29853387 void ResetTransform()
29863388 {
....@@ -3093,7 +3495,7 @@
30933495 refreshContents();
30943496 }
30953497
3096
- void ResetCentroid()
3498
+ void ResetCentroid(boolean full)
30973499 {
30983500 Object3D obj;
30993501 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3108,12 +3510,16 @@
31083510 LA.matIdentity(Object3D.mat);
31093511 obj.getBounds(minima, maxima, false);
31103512 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3111
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3513
+ if (full)
3514
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
31123515 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
31133516 obj.TransformMesh(Object3D.mat);
3517
+
31143518 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3115
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3519
+ if (full)
3520
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
31163521 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3522
+
31173523 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
31183524 //Object3D.mat[3][0] = -Object3D.mat[3][0];
31193525 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3142,7 +3548,8 @@
31423548
31433549 int size = obj.MemorySize();
31443550
3145
- 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)");
31463553 }
31473554 }
31483555 catch (Exception e)
....@@ -3179,9 +3586,9 @@
31793586 obj = (Object3D)e.nextElement();
31803587
31813588 System.out.println("Object is: " + obj);
3182
- GrafreeD.AnalyzeObject(obj);
3589
+ Grafreed.AnalyzeObject(obj);
31833590 System.out.println("Boundary rep: " + obj.bRep);
3184
- GrafreeD.AnalyzeObject(obj.bRep);
3591
+ Grafreed.AnalyzeObject(obj.bRep);
31853592
31863593 // System.err.println((size/1024) + " KB is the size of " + obj);
31873594 }
....@@ -3223,6 +3630,13 @@
32233630 void GenNormals(boolean crease)
32243631 {
32253632 group.GenNormalsS(crease);
3633
+
3634
+ refreshContents();
3635
+ }
3636
+
3637
+ void GenNormalsMESH()
3638
+ {
3639
+ group.GenNormalsMeshS();
32263640
32273641 refreshContents();
32283642 }
....@@ -3395,8 +3809,8 @@
33953809
33963810 void ParseVertices()
33973811 {
3398
- boolean epsequal = GrafreeD.epsequal;
3399
- GrafreeD.epsequal = true;
3812
+ boolean epsequal = Grafreed.epsequal;
3813
+ Grafreed.epsequal = true;
34003814
34013815 for (int i=0; i<group.selection.size(); i++)
34023816 {
....@@ -3421,7 +3835,7 @@
34213835 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
34223836 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
34233837
3424
- g.add(GrafreeD.clipboard);
3838
+ g.add(Grafreed.clipboard);
34253839
34263840 buffer.add(g);
34273841 }
....@@ -3436,7 +3850,7 @@
34363850 makeSomething(buffer, i==group.selection.size()-1);
34373851 }
34383852
3439
- GrafreeD.epsequal = epsequal;
3853
+ Grafreed.epsequal = epsequal;
34403854
34413855 refreshContents();
34423856 }
....@@ -3454,7 +3868,16 @@
34543868 String pigment = Object3D.GetPigment(tex);
34553869 //String bump = Object3D.GetBump(tex);
34563870
3457
- 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
+ }
34583881
34593882 double s = v.s;
34603883
....@@ -3542,11 +3965,11 @@
35423965
35433966 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
35443967
3545
- boolean random = CameraPane.RANDOM;
3546
- CameraPane.RANDOM = false; // parse all random nodes
3968
+ boolean random = CameraPane.SWITCH;
3969
+ CameraPane.SWITCH = false; // parse all random nodes
35473970 lowres.linkVerticesThis(null);
35483971 lowres.linkVerticesThis(sn);
3549
- CameraPane.RANDOM = random;
3972
+ CameraPane.SWITCH = random;
35503973
35513974 System.err.flush();
35523975
....@@ -3586,7 +4009,7 @@
35864009 return;
35874010
35884011 Object3D poses = group.selection.get(0);
3589
- Object3D ref = GrafreeD.clipboard.get(0);
4012
+ Object3D ref = Grafreed.clipboard.get(0);
35904013
35914014 Object3D newgroup = new Object3D("Po:" + poses.name);
35924015
....@@ -3755,7 +4178,7 @@
37554178 group.selection.RelinkToSupport(); // july 2014
37564179 System.out.println("DONE.");
37574180 refreshContents();
3758
- 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));
37594182 }
37604183
37614184 void ReduceMesh(boolean reduction34)
....@@ -3780,9 +4203,9 @@
37804203
37814204 void ClipMesh()
37824205 {
3783
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
4206
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
37844207 {
3785
- Object3D content = GrafreeD.clipboard.get(0);
4208
+ Object3D content = Grafreed.clipboard.get(0);
37864209
37874210 if (content instanceof cGroup && ((cGroup)content).transientlink )
37884211 content = ((cGroup)content).get(0);
....@@ -3791,7 +4214,7 @@
37914214 // {
37924215 // group.selection.get(i).ClipMesh(GrafreeD.clipboard);
37934216 // }
3794
- group.selection.ClipMesh(GrafreeD.clipboard);
4217
+ group.selection.ClipMesh(Grafreed.clipboard);
37954218 }
37964219 // group.selection.ClipMesh(GrafreeD.clipboard);
37974220 System.out.println("DONE.");
....@@ -3838,6 +4261,18 @@
38384261 void MarkLeaves(boolean hide)
38394262 {
38404263 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);
38414276 refreshContents();
38424277 }
38434278
....@@ -3926,7 +4361,7 @@
39264361 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
39274362
39284363 Object3D elem = (Object3D)group.selection.elementAt(i);
3929
- if(elem != group)
4364
+ if(elem != group || !newWindow)
39304365 {
39314366 // if (!(elem instanceof Composite))
39324367 // newWindow = false;
....@@ -4016,7 +4451,6 @@
40164451 //case 702: // Event.LIST_DESELECT
40174452 group.deselectAll();
40184453 TreePath tps[] = objEditor.jTree.getSelectionPaths();
4019
- objEditor.ClearInfo(); // .GetMaterial());
40204454 if (tps != null)
40214455 {
40224456 for (int i=0; i < tps.length; i++)
....@@ -4025,31 +4459,30 @@
40254459
40264460 //if (child.parent != null)
40274461 //child.parent.addSelectee(child);
4462
+ objEditor.SetMaterial(child);
40284463 group.addSelectee(child);
4029
- objEditor.SetMaterial(child); // .GetMaterial());
4030
- objEditor.AddInfo(child, this, true); // .GetMaterial());
4031
- System.err.println("info : " + child.GetPath());
40324464 }
40334465 }
4034
- else
4035
- {
4036
- objEditor.SetMaterial(group); // .GetMaterial());
4037
- objEditor.AddInfo(group, this, true); // .GetMaterial());
4038
- System.err.println("info : " + group.GetPath());
4039
- }
4466
+// else
4467
+// {
4468
+// objEditor.SetMaterial(group); // .GetMaterial());
4469
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4470
+// System.err.println("info : " + group.GetPath());
4471
+// }
40404472
4041
- objEditor.SetText(); // jan 2014
4042
-
4043
- 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))
40444474 CameraPane.flash = true;
40454475
4046
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
4476
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
40474477 // a camera
40484478 {
4049
- CameraPane.camerachangeframe = 0; // don't refuse it
4050
- CameraPane.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4051
- // CameraPane.theRenderer.renderCamera = CameraPane.theRenderer.manipCamera;
4052
- // CameraPane.theRenderer.eyeCamera = CameraPane.theRenderer.manipCamera;
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;
40534486 }
40544487
40554488 refreshContents();
....@@ -4060,6 +4493,26 @@
40604493
40614494 freezemodel = false;
40624495 }
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
+ }
40634516
40644517 void linkSomething(Object3D thing)
40654518 {
....@@ -4131,16 +4584,18 @@
41314584 {
41324585 if (group.selection.isEmpty())
41334586 return;
4134
- GrafreeD.clipboardIsTempGroup = false;
4587
+
4588
+ Grafreed.clipboardIsTempGroup = false;
41354589 Composite tGroup = null;
41364590 if (group.selection.size() > 0) // 1)
41374591 {
41384592 tGroup = new cGroup();
4139
- GrafreeD.clipboardIsTempGroup = true;
4593
+ Grafreed.clipboardIsTempGroup = true;
41404594 }
41414595
41424596 if (cut)
41434597 {
4598
+ Save();
41444599 //int indices[] = jList.getSelectedIndices();
41454600 //for (int i = indices.length - 1; i >= 0; i--)
41464601 //jList.remove(indices[i]);
....@@ -4176,16 +4631,16 @@
41764631 //System.out.println("cut " + child);
41774632 //System.out.println("parent = " + child.parent);
41784633 // tmp.addChild(child);
4179
- if (GrafreeD.clipboardIsTempGroup)
4634
+ if (Grafreed.clipboardIsTempGroup)
41804635 tGroup.add/*Child*/(tmp);
41814636 else
4182
- GrafreeD.clipboard = tmp;
4637
+ Grafreed.clipboard = tmp;
41834638 }
41844639 else
4185
- if (GrafreeD.clipboardIsTempGroup)
4640
+ if (Grafreed.clipboardIsTempGroup)
41864641 tGroup.add/*Child*/(child);
41874642 else
4188
- GrafreeD.clipboard = child;
4643
+ Grafreed.clipboard = child;
41894644 }
41904645
41914646 //ResetModel();
....@@ -4217,21 +4672,23 @@
42174672 //System.out.println("cut " + elem);
42184673 //System.out.println("parent = " + elem.parent);
42194674 // tmp.addChild(elem);
4220
- if (GrafreeD.clipboardIsTempGroup)
4675
+ if (Grafreed.clipboardIsTempGroup)
42214676 tGroup.add/*Child*/(tmp);
42224677 else
4223
- GrafreeD.clipboard = tmp;
4678
+ Grafreed.clipboard = tmp;
42244679 }
42254680 else
4226
- if (GrafreeD.clipboardIsTempGroup)
4681
+ if (Grafreed.clipboardIsTempGroup)
42274682 tGroup.add/*Child*/(child);
42284683 else
4229
- GrafreeD.clipboard = child;
4684
+ Grafreed.clipboard = child;
42304685 }
42314686
42324687 }
4233
- if (GrafreeD.clipboardIsTempGroup)
4234
- GrafreeD.clipboard = tGroup;
4688
+
4689
+ if (Grafreed.clipboardIsTempGroup)
4690
+ Grafreed.clipboard = tGroup;
4691
+
42354692 if (cut)
42364693 {
42374694 ResetModel();
....@@ -4245,7 +4702,7 @@
42454702 // return;
42464703 boolean first = true;
42474704
4248
- if (GrafreeD.clipboardIsTempGroup)
4705
+ if (Grafreed.clipboardIsTempGroup)
42494706 {
42504707 Composite temp;
42514708
....@@ -4256,7 +4713,7 @@
42564713 temp = (Composite)Applet3D.clipboard.deepCopy();
42574714 */
42584715 Object3D elem;
4259
- 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))
42604717 {
42614718 Object3D child = (Object3D)e.nextElement();
42624719
....@@ -4290,21 +4747,21 @@
42904747 //Object3D cb = Applet3D.clipboard;
42914748 //temp.addChild(cb);
42924749 //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0));
4293
- assert(GrafreeD.clipboard.parent == null);
4294
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
4295
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
4296
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
4297
- makeSomething(expand?GrafreeD.clipboard.get(0).copyExpand():GrafreeD.clipboard.get(0).deepCopy());
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());
42984755 else
4299
- makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4300
- GrafreeD.clipboard.get(0).parent = keepparent;
4756
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
4757
+ Grafreed.clipboard.get(0).parent = keepparent;
43014758 }
43024759
43034760 ResetModel();
43044761 refreshContents();
43054762 }
43064763
4307
- void pasteInto(boolean copyit)
4764
+ void pasteInto(boolean copyit, boolean clone)
43084765 {
43094766 // if (GrafreeD.clipboard == null)
43104767 // return;
....@@ -4333,15 +4790,22 @@
43334790 if (copyit)
43344791 {
43354792 // paste(false);
4336
- CloneClipboard(false); // sept 2014
4793
+ if (clone)
4794
+ {
4795
+ CloneClipboard(false); // sept 2014
4796
+ }
4797
+ else
4798
+ {
4799
+ paste(false);
4800
+ }
43374801 }
43384802 else
43394803 {
43404804 boolean first = true;
43414805
4342
- if (GrafreeD.clipboardIsTempGroup)
4806
+ if (Grafreed.clipboardIsTempGroup)
43434807 {
4344
- Composite temp = (Composite)GrafreeD.clipboard;
4808
+ Composite temp = (Composite)Grafreed.clipboard;
43454809 Object3D copy;
43464810 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
43474811 {
....@@ -4351,7 +4815,7 @@
43514815 }
43524816 } else
43534817 {
4354
- linkSomething(GrafreeD.clipboard); //.get(0));
4818
+ linkSomething(Grafreed.clipboard); //.get(0));
43554819 }
43564820 }
43574821 }
....@@ -4756,21 +5220,6 @@
47565220 }
47575221 */
47585222
4759
- void ImportGFD()
4760
- {
4761
- FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD);
4762
- browser.show();
4763
- String filename = browser.getFile();
4764
- if (filename != null && filename.length() > 0)
4765
- {
4766
- String fullname = browser.getDirectory() + filename;
4767
-
4768
- //Object3D readobj =
4769
- objEditor.ReadGFD(fullname, objEditor);
4770
- //makeSomething(readobj);
4771
- }
4772
- }
4773
-
47745223 /*
47755224 public void Callback(Object obj)
47765225 {
....@@ -4794,26 +5243,9 @@
47945243 }
47955244 */
47965245
4797
- void ImportVRMLX3D()
4798
- {
4799
- if (GrafreeD.standAlone)
4800
- {
4801
- /**/
4802
- FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
4803
- browser.show();
4804
- String filename = browser.getFile();
4805
- if (filename != null && filename.length() > 0)
4806
- {
4807
- String fullname = browser.getDirectory() + filename;
4808
- LoadVRMLX3D(fullname);
4809
- }
4810
- /**/
4811
- }
4812
- }
4813
-
48145246 String GetFile(String dialogName)
48155247 {
4816
- if (GrafreeD.standAlone)
5248
+ if (Grafreed.standAlone)
48175249 {
48185250 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
48195251 browser.show();
....@@ -4877,10 +5309,18 @@
48775309 cButton flashSelectionButton;
48785310 cButton editButton;
48795311 cButton uneditButton;
5312
+ JCheckBox allParamsButton;
48805313 cButton clearpanelButton;
4881
- cButton allParamsButton;
48825314 cButton unselectButton;
48835315
5316
+ cButton minButton;
5317
+ cButton maxButton;
5318
+ cButton fullButton;
5319
+ cButton undoButton;
5320
+ cButton redoButton;
5321
+ cButton saveButton;
5322
+ cButton oneStepButton;
5323
+
48845324 cButton screenfitButton;
48855325 cButton screenfitpointButton;
48865326 cButton snapobjectButton;
....@@ -4891,14 +5331,6 @@
48915331 cButton closeButton;
48925332
48935333 cButton setsupportButton;
4894
-
4895
- cButton twoButton;
4896
- cButton sixButton;
4897
- cButton threeButton;
4898
- cButton sevenButton;
4899
- cButton fourButton; // full panel
4900
- cButton oneButton; // full XYZ
4901
- //cButton currentLayout;
49025334
49035335 //
49045336 //Composite
....@@ -4911,6 +5343,8 @@
49115343 private MenuItem lookFromItem;
49125344 private MenuItem switchItem;
49135345 private MenuItem cutItem;
5346
+ private MenuItem undoItem;
5347
+ private MenuItem redoItem;
49145348 private MenuItem duplicateItem;
49155349 private MenuItem cloneItem;
49165350 private MenuItem cloneSupportItem;
....@@ -4924,7 +5358,7 @@
49245358 private MenuItem linkverticesItem;
49255359 private MenuItem relinkverticesItem;
49265360 private MenuItem setMasterItem;
4927
- private MenuItem resetMeshItem;
5361
+ private MenuItem resetAllItem;
49285362 private MenuItem stepAllItem;
49295363 private MenuItem revertMeshItem;
49305364 private MenuItem poseMeshItem;
....@@ -4935,6 +5369,7 @@
49355369 private MenuItem mergeGeometriesItem;
49365370 private MenuItem copyItem;
49375371 private MenuItem pasteItem;
5372
+ private MenuItem pasteIntoItem;
49385373 private MenuItem pasteLinkItem;
49395374 private MenuItem pasteCloneItem;
49405375 private MenuItem pasteExpandItem;
....@@ -4973,6 +5408,10 @@
49735408 private MenuItem showleavesItem;
49745409 private MenuItem markleavesItem;
49755410 private MenuItem unmarkleavesItem;
5411
+ private MenuItem rewindleavesItem;
5412
+ private MenuItem unrewindleavesItem;
5413
+ private MenuItem randomleavesItem;
5414
+ private MenuItem unrandomleavesItem;
49765415
49775416 private MenuItem flipVItem;
49785417 private MenuItem unflipVItem;
....@@ -4984,8 +5423,10 @@
49845423 private MenuItem panoTexturesItem;
49855424
49865425 private MenuItem resetCentroidItem;
4987
- private MenuItem transformgeometryItem;
5426
+ private MenuItem resetCentroidXZItem;
49885427 private MenuItem resetTransformItem;
5428
+ private MenuItem transformGeometryItem;
5429
+ private MenuItem transformChildrenItem;
49895430 private MenuItem hideItem;
49905431 private MenuItem grabItem;
49915432 private MenuItem backItem;
....@@ -5007,6 +5448,7 @@
50075448
50085449 private MenuItem resetParentItem;
50095450 private MenuItem repairParentItem;
5451
+ private MenuItem repairShadowItem;
50105452 private MenuItem sortbysizeItem;
50115453 private MenuItem sortbynameItem;
50125454
....@@ -5031,7 +5473,7 @@
50315473 private MenuItem blobItem;
50325474 private MenuItem latheItem;
50335475 private MenuItem bezierItem;
5034
- private MenuItem checkerItem;
5476
+ private MenuItem overlayItem;
50355477 private MenuItem meshItem;
50365478 // private MenuItem meshGroupItem;
50375479 private MenuItem springItem;
....@@ -5053,11 +5495,6 @@
50535495 private MenuItem doubleItem;
50545496 private MenuItem tripleItem;
50555497
5056
- private MenuItem importGFDItem;
5057
- private MenuItem importVRMLX3DItem;
5058
- private MenuItem import3DSItem;
5059
- private MenuItem importOBJItem;
5060
-
50615498 private MenuItem computeAOItem;
50625499 private MenuItem recompileItem;
50635500 private MenuItem editScriptItem;
....@@ -5067,4 +5504,8 @@
50675504 private MenuItem analyzeItem;
50685505 private MenuItem dumpItem;
50695506 //boolean freezemodel = false;
5507
+
5508
+ Menu cameraMenu;
5509
+ MenuItem editCameraItem;
5510
+ MenuItem revertCameraItem;
50705511 }