Normand Briere
2019-06-23 f1382bc839a74ef1d1534c61ea94e53cf54716df
GroupEditor.java
....@@ -12,6 +12,7 @@
1212 import com.jme.math.Vector3f;
1313 import com.jme.renderer.ColorRGBA;
1414
15
+import grafeme.ui.*;
1516 //import buoy.widget.BFileChooser;
1617
1718 class GroupEditor extends ObjEditor implements //iParse, //iCallBack,
....@@ -73,7 +74,7 @@
7374 this.copy = this.group = copy;
7475 //selectees = this.group.selectees;
7576
76
- SetupMenu2(objEditor);
77
+ SetupMenu2(this); //objEditor);
7778 SetupUI2(objEditor);
7879 objEditor.SetupUI(true);
7980 SetupViews(objEditor);
....@@ -97,14 +98,14 @@
9798
9899 void CloneClipboard(boolean supports)
99100 {
100
- assert(GrafreeD.clipboard.parent == null);
101
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
102
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
103
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
104
- makeSomething(CloneObject(GrafreeD.clipboard.get(0), false));
101
+ assert(Grafreed.clipboard.parent == null);
102
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
103
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
104
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
105
+ makeSomething(CloneObject(Grafreed.clipboard.get(0), false));
105106 else
106
- makeSomething(CloneObject(GrafreeD.clipboard, false));
107
- GrafreeD.clipboard.get(0).parent = keepparent;
107
+ makeSomething(CloneObject(Grafreed.clipboard, false));
108
+ Grafreed.clipboard.get(0).parent = keepparent;
108109 }
109110
110111 static Object3D CloneObject(Object3D obj, boolean supports)
....@@ -118,7 +119,7 @@
118119 // obj.support = null;
119120 if (!supports)
120121 obj.SaveSupports();
121
- Object3D clone = (Object3D)GrafreeD.clone(obj);
122
+ Object3D clone = (Object3D)Grafreed.clone(obj);
122123 obj.parent = parent;
123124 // obj.support = support;
124125 // clone.support = support; // aout 2013
....@@ -147,8 +148,129 @@
147148
148149 //JTextField nameField;
149150
150
- void SetupMenu2(ObjEditor oe)
151
+ void SetupMenu2(GroupEditor oe)
151152 {
153
+ Menu menu;
154
+ oe.menuBar.add(menu = new Menu("Edit"));
155
+ //editItem = menu.add(new MenuItem("Edit"));
156
+ //editItem.addActionListener(this);
157
+
158
+// undoItem = menu.add(new MenuItem("Undo"));
159
+// undoItem.addActionListener(this);
160
+// redoItem = menu.add(new MenuItem("Redo"));
161
+// redoItem.addActionListener(this);
162
+// menu.add("-");
163
+ duplicateItem = menu.add(new MenuItem("Duplicate"));
164
+ duplicateItem.addActionListener(this);
165
+ cloneItem = menu.add(new MenuItem("Clone"));
166
+ cloneItem.addActionListener(this);
167
+ if (Globals.ADVANCED)
168
+ {
169
+ cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
170
+ cloneSupportItem.addActionListener(this);
171
+ }
172
+ menu.add("-");
173
+ cutItem = menu.add(new MenuItem("Cut"));
174
+ cutItem.addActionListener(this);
175
+ copyItem = menu.add(new MenuItem("Copy"));
176
+ copyItem.addActionListener(this);
177
+ pasteItem = menu.add(new MenuItem("Paste"));
178
+ pasteItem.addActionListener(this);
179
+
180
+ menu.add("-");
181
+ pasteIntoItem = menu.add(new MenuItem("Paste into"));
182
+ pasteIntoItem.addActionListener(this);
183
+ pasteLinkItem = menu.add(new MenuItem("Paste link"));
184
+ pasteLinkItem.addActionListener(this);
185
+ pasteCloneItem = menu.add(new MenuItem("Paste clone"));
186
+ pasteCloneItem.addActionListener(this);
187
+// pasteExpandItem = menu.add(new MenuItem("Paste expand"));
188
+// pasteExpandItem.addActionListener(this);
189
+ menu.add("-");
190
+ clearItem = menu.add(new MenuItem("Clear"));
191
+ clearItem.addActionListener(this);
192
+
193
+ if (Globals.ADVANCED)
194
+ {
195
+ // Deletes the cameras...
196
+ clearAllItem = menu.add(new MenuItem("Clear All"));
197
+ clearAllItem.addActionListener(this);
198
+ }
199
+
200
+ menuBar.add(cameraMenu = new Menu("View"));
201
+ //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer"));
202
+ //zBufferItem.addActionListener(this);
203
+ //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens"));
204
+ //normalLensItem.addActionListener(this);
205
+ cameraMenu.add(revertCameraItem = new MenuItem("Restore Viewpoint"));
206
+ revertCameraItem.addActionListener(this);
207
+
208
+ cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen"));
209
+ toggleFullScreenItem.addItemListener(this);
210
+ toggleFullScreenItem.setState(CameraPane.FULLSCREEN);
211
+ cameraMenu.add("-");
212
+
213
+ cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture"));
214
+ toggleTextureItem.addItemListener(this);
215
+ toggleTextureItem.setState(CameraPane.textureon);
216
+
217
+ cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch"));
218
+ toggleSwitchItem.addItemListener(this);
219
+ toggleSwitchItem.setState(CameraPane.SWITCH);
220
+
221
+ cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles"));
222
+ toggleHandleItem.addItemListener(this);
223
+ toggleHandleItem.setState(CameraPane.HANDLES);
224
+
225
+ cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode"));
226
+ togglePaintItem.addItemListener(this);
227
+ togglePaintItem.setState(CameraPane.PAINTMODE);
228
+
229
+ if (Globals.ADVANCED)
230
+ {
231
+ cameraMenu.add("-");
232
+ cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live"));
233
+ toggleLiveItem.addItemListener(this);
234
+ toggleLiveItem.setState(Globals.isLIVE());
235
+
236
+ cameraMenu.add(stepItem = new MenuItem("Step"));
237
+ stepItem.addActionListener(this);
238
+ // cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List"));
239
+ // toggleDLItem.addItemListener(this);
240
+ // toggleDLItem.setState(false);
241
+
242
+ cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render"));
243
+ toggleRenderItem.addItemListener(this);
244
+ toggleRenderItem.setState(!CameraPane.frozen);
245
+
246
+ cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug"));
247
+ toggleDebugItem.addItemListener(this);
248
+ toggleDebugItem.setState(Globals.DEBUG);
249
+
250
+ cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum"));
251
+ toggleFrustumItem.addItemListener(this);
252
+ toggleFrustumItem.setState(CameraPane.FRUSTUM);
253
+
254
+ cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact"));
255
+ toggleFootContactItem.addItemListener(this);
256
+ toggleFootContactItem.setState(CameraPane.FOOTCONTACT);
257
+
258
+ cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline"));
259
+ toggleTimelineItem.addItemListener(this);
260
+ }
261
+
262
+// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root"));
263
+// toggleRootItem.addItemListener(this);
264
+// toggleRootItem.setState(false);
265
+// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation"));
266
+// animationItem.addItemListener(this);
267
+// animationItem.setState(CameraPane.ANIMATION);
268
+ cameraMenu.add("-");
269
+ cameraMenu.add(editCameraItem = new MenuItem("Save Viewpoint"));
270
+ editCameraItem.addActionListener(this);
271
+
272
+ if (Globals.ADVANCED)
273
+ {
152274 oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
153275 //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
154276 //cameraMenu.add(switchItem = new MenuItem("Reverse View"));
....@@ -160,45 +282,17 @@
160282 lookAtItem.addActionListener(this);
161283 //lookFromItem.addActinoListener(this);
162284 //switchItem.addActionListener(this);
163
- Menu menu;
164
- oe.menuBar.add(menu = new Menu("Edit"));
165
- //editItem = menu.add(new MenuItem("Edit"));
166
- //editItem.addActionListener(this);
167
- duplicateItem = menu.add(new MenuItem("Duplicate"));
168
- duplicateItem.addActionListener(this);
169
- menu.add("-");
170
- cloneItem = menu.add(new MenuItem("Clone"));
171
- cloneItem.addActionListener(this);
172
- cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
173
- cloneSupportItem.addActionListener(this);
174
- menu.add("-");
175
- cutItem = menu.add(new MenuItem("Cut"));
176
- cutItem.addActionListener(this);
177
- copyItem = menu.add(new MenuItem("Copy"));
178
- copyItem.addActionListener(this);
179
- pasteItem = menu.add(new MenuItem("Paste"));
180
- pasteItem.addActionListener(this);
181
- pasteLinkItem = menu.add(new MenuItem("Paste link"));
182
- pasteLinkItem.addActionListener(this);
183
- pasteCloneItem = menu.add(new MenuItem("Paste clone"));
184
- pasteCloneItem.addActionListener(this);
185
-// pasteExpandItem = menu.add(new MenuItem("Paste expand"));
186
-// pasteExpandItem.addActionListener(this);
187
- clearItem = menu.add(new MenuItem("Clear"));
188
- clearItem.addActionListener(this);
189
- clearAllItem = menu.add(new MenuItem("Clear All"));
190
- clearAllItem.addActionListener(this);
191
-
285
+ }
286
+
192287 oe.menuBar.add(menu = new Menu("Setting"));
193
- resetMeshItem = menu.add(new MenuItem("Reset All"));
194
- resetMeshItem.addActionListener(this);
195
- stepAllItem = menu.add(new MenuItem("Step All"));
196
- stepAllItem.addActionListener(this);
288
+ if (Globals.ADVANCED)
289
+ {
197290 revertMeshItem = menu.add(new MenuItem("Revert Meshes"));
198291 revertMeshItem.addActionListener(this);
199292 resetreferencesItem = menu.add(new MenuItem("Reset Mesh References"));
200293 resetreferencesItem.addActionListener(this);
201294 menu.add("-");
295
+ }
202296 overwriteGeoItem = menu.add(new MenuItem("Overwrite Geometry"));
203297 overwriteGeoItem.addActionListener(this);
204298 overwriteMatItem = menu.add(new MenuItem("Overwrite Material"));
....@@ -210,19 +304,26 @@
210304 overwriteUVItem = menu.add(new MenuItem("Overwrite UV"));
211305 overwriteUVItem.addActionListener(this);
212306 menu.add("-");
307
+ if (Globals.ADVANCED)
308
+ {
213309 generateMeshItem = menu.add(new MenuItem("Generate Meshes"));
214310 generateMeshItem.addActionListener(this);
215311 poseMeshItem = menu.add(new MenuItem("Set Pose Meshes"));
216312 poseMeshItem.addActionListener(this);
217313 menu.add("-");
314
+ }
218315 resetsupportItem = menu.add(new MenuItem("Reset support"));
219316 resetsupportItem.addActionListener(this);
220317 linkverticesItem = menu.add(new MenuItem("Link to Support"));
221318 linkverticesItem.addActionListener(this);
222319 relinkverticesItem = menu.add(new MenuItem("Re-link to Support"));
223320 relinkverticesItem.addActionListener(this);
321
+
322
+ if (Globals.ADVANCED)
323
+ {
224324 setMasterItem = menu.add(new MenuItem("Set Master Mesh"));
225325 setMasterItem.addActionListener(this);
326
+ }
226327
227328 oe.menuBar.add(menu = new Menu("Group"));
228329 grabItem = menu.add(new MenuItem("Grab"));
....@@ -233,27 +334,32 @@
233334 frontItem.addActionListener(this);
234335 compositeItem = menu.add(new MenuItem("Composite"));
235336 compositeItem.addActionListener(this);
236
- hideItem = menu.add(new MenuItem("Hide"));
337
+ hideItem = menu.add(new MenuItem("Hidden Group"));
237338 hideItem.addActionListener(this);
238339 ungroupItem = menu.add(new MenuItem("Ungroup"));
239340 ungroupItem.addActionListener(this);
240341 menu.add("-");
241
- randomItem = menu.add(new MenuItem("Random"));
342
+ randomItem = menu.add(new MenuItem("Switch node"));
242343 randomItem.addActionListener(this);
243
- physicsItem = menu.add(new MenuItem("Physics"));
244
- physicsItem.addActionListener(this);
245
- frameselectorItem = menu.add(new MenuItem("Frame Selector"));
246
- frameselectorItem.addActionListener(this);
247344 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
248345 switchGeoItem.addActionListener(this);
249346 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
250347 switchTransfoItem.addActionListener(this);
251
- morphItem = menu.add(new MenuItem("Morph"));
348
+ morphItem = menu.add(new MenuItem("Morph Group"));
252349 morphItem.addActionListener(this);
350
+
351
+ if (Globals.ADVANCED)
352
+ {
353
+ menu.add("-");
354
+ physicsItem = menu.add(new MenuItem("Physics"));
355
+ physicsItem.addActionListener(this);
356
+ frameselectorItem = menu.add(new MenuItem("Frame Selector"));
357
+ frameselectorItem.addActionListener(this);
253358 scriptNodeItem = menu.add(new MenuItem("Script Node"));
254359 scriptNodeItem.addActionListener(this);
255360 cameraItem = menu.add(new MenuItem("Camera"));
256361 cameraItem.addActionListener(this);
362
+ }
257363
258364 oe.menuBar.add(menu = new Menu("Object"));
259365 textureItem = menu.add(new MenuItem("Texture"));
....@@ -262,27 +368,35 @@
262368 billboardItem.addActionListener(this);
263369 csgItem = menu.add(new MenuItem("CSG"));
264370 csgItem.addActionListener(this);
265
- shadowXItem = menu.add(new MenuItem("Shadow X"));
371
+ shadowXItem = menu.add(new MenuItem("Shadow Red"));
266372 shadowXItem.addActionListener(this);
267
- shadowYItem = menu.add(new MenuItem("Shadow Y"));
373
+ shadowYItem = menu.add(new MenuItem("Shadow Green"));
268374 shadowYItem.addActionListener(this);
269
- shadowZItem = menu.add(new MenuItem("Shadow Z"));
375
+ shadowZItem = menu.add(new MenuItem("Shadow Blue"));
270376 shadowZItem.addActionListener(this);
377
+ if (Globals.ADVANCED)
378
+ {
379
+ menu.add("-");
271380 linkerItem = menu.add(new MenuItem("Linker"));
272381 linkerItem.addActionListener(this);
273
- templateItem = menu.add(new MenuItem("Template"));
274
- templateItem.addActionListener(this);
275382 attributeItem = menu.add(new MenuItem("Attribute"));
276383 attributeItem.addActionListener(this);
384
+ templateItem = menu.add(new MenuItem("Template"));
385
+ templateItem.addActionListener(this);
277386 pointflowItem = menu.add(new MenuItem("Point Flow"));
278387 pointflowItem.addActionListener(this);
388
+ }
279389 menu.add("-");
280390 resetTransformItem = menu.add(new MenuItem("Reset Transform"));
281391 resetTransformItem.addActionListener(this);
282392 resetCentroidItem = menu.add(new MenuItem("Reset Centroid"));
283393 resetCentroidItem.addActionListener(this);
284
- transformgeometryItem = menu.add(new MenuItem("Transform Geometry"));
285
- transformgeometryItem.addActionListener(this);
394
+ resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY"));
395
+ resetCentroidXZItem.addActionListener(this);
396
+ transformGeometryItem = menu.add(new MenuItem("Transform Geometry"));
397
+ transformGeometryItem.addActionListener(this);
398
+ transformChildrenItem = menu.add(new MenuItem("Transform Children"));
399
+ transformChildrenItem.addActionListener(this);
286400
287401 oe.menuBar.add(menu = new Menu("Geometry"));
288402 genUVItem = menu.add(new MenuItem("Generate UV"));
....@@ -293,8 +407,11 @@
293407 genNormalsCADItem.addActionListener(this);
294408 genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals"));
295409 genNormalsMESHItem.addActionListener(this);
410
+ if (Globals.ADVANCED)
411
+ {
296412 genNormalsMINEItem = menu.add(new MenuItem("My Normals"));
297413 genNormalsMINEItem.addActionListener(this);
414
+ }
298415 stripifyItem = menu.add(new MenuItem("Stripify"));
299416 stripifyItem.addActionListener(this);
300417 unstripifyItem = menu.add(new MenuItem("Unstripify"));
....@@ -316,23 +433,34 @@
316433 reduce34MeshItem.addActionListener(this);
317434 increaseMeshItem = menu.add(new MenuItem("Increase mesh"));
318435 increaseMeshItem.addActionListener(this);
319
- smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
320
- smoothMeshItem.addActionListener(this);
321436 clipMeshItem = menu.add(new MenuItem("Clip mesh"));
322437 clipMeshItem.addActionListener(this);
438
+
439
+ if (Globals.ADVANCED)
440
+ {
441
+ smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
442
+ smoothMeshItem.addActionListener(this);
443
+ }
323444
324445 oe.menuBar.add(menu = new Menu("Attributes"));
325446 clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
326447 clearMaterialsItem.addActionListener(this);
448
+ resetAllItem = menu.add(new MenuItem("Reset All"));
449
+ resetAllItem.addActionListener(this);
450
+ stepAllItem = menu.add(new MenuItem("Step All"));
451
+ stepAllItem.addActionListener(this);
327452 menu.add("-");
328453 liveleavesItem = menu.add(new MenuItem("Live Leaves"));
329454 liveleavesItem.addActionListener(this);
330455 unliveleavesItem = menu.add(new MenuItem("Unlive Leaves"));
331456 unliveleavesItem.addActionListener(this);
457
+ if (Globals.ADVANCED)
458
+ {
332459 supportleavesItem = menu.add(new MenuItem("Support Leaves"));
333460 supportleavesItem.addActionListener(this);
334461 unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves"));
335462 unsupportleavesItem.addActionListener(this);
463
+ }
336464 hideleavesItem = menu.add(new MenuItem("Hide Leaves"));
337465 hideleavesItem.addActionListener(this);
338466 showleavesItem = menu.add(new MenuItem("Show Leaves"));
....@@ -341,6 +469,14 @@
341469 markleavesItem.addActionListener(this);
342470 unmarkleavesItem = menu.add(new MenuItem("Unmark Leaves"));
343471 unmarkleavesItem.addActionListener(this);
472
+ rewindleavesItem = menu.add(new MenuItem("Rewind Leaves"));
473
+ rewindleavesItem.addActionListener(this);
474
+ unrewindleavesItem = menu.add(new MenuItem("Unrewind Leaves"));
475
+ unrewindleavesItem.addActionListener(this);
476
+ randomleavesItem = menu.add(new MenuItem("Random Leaves"));
477
+ randomleavesItem.addActionListener(this);
478
+ unrandomleavesItem = menu.add(new MenuItem("Unrandom Leaves"));
479
+ unrandomleavesItem.addActionListener(this);
344480 menu.add("-");
345481 flipVItem = menu.add(new MenuItem("Flip V"));
346482 flipVItem.addActionListener(this);
....@@ -376,35 +512,40 @@
376512 sortbynameItem = menu.add(new MenuItem("Sort by name"));
377513 sortbynameItem.addActionListener(this);
378514 menu.add("-");
515
+ shareGeometriesItem = menu.add(new MenuItem("Share Geometries"));
516
+ shareGeometriesItem.addActionListener(this);
517
+ mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries"));
518
+ mergeGeometriesItem.addActionListener(this);
519
+ if (Globals.ADVANCED)
520
+ {
521
+ // Pretty much the same as duplicate and clone.
379522 extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
380523 extractGeometriesItem.addActionListener(this);
381524 cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry"));
382525 cloneGeometriesItem.addActionListener(this);
383
- shareGeometriesItem = menu.add(new MenuItem("Share Geometry"));
384
- shareGeometriesItem.addActionListener(this);
385
- mergeGeometriesItem = menu.add(new MenuItem("Merge Geometry"));
386
- mergeGeometriesItem.addActionListener(this);
526
+ }
387527
388528 oe.menuBar.add(menu = new Menu("Insert"));
389529 buildCreateMenu(menu);
390530
391
-
392
- oe.menuBar.add(menu = new Menu("Include"));
393
- importGFDItem = menu.add(new MenuItem("GrafreeD Object..."));
394
- importGFDItem.addActionListener(this);
395
- importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D Object..."));
396
- importVRMLX3DItem.addActionListener(this);
397
- importOBJItem = menu.add(new MenuItem("OBJ Object..."));
398
- importOBJItem.addActionListener(this);
399
- import3DSItem = menu.add(new MenuItem("3DS Object..."));
400
- import3DSItem.addActionListener(this);
401
-
402531 oe.menuBar.add(menu = new Menu("Tools"));
403532 buildToolsMenu(menu);
404533 }
405534
406535 void SetupUI2(ObjEditor oe)
407536 {
537
+ // June 2019
538
+ if (oe == null)
539
+ {
540
+ //super.SetupUI2(this);
541
+ //return;
542
+ }
543
+
544
+ if (copy != group)
545
+ {
546
+ //super.SetupUI2(this);
547
+ }
548
+
408549 //new Exception().printStackTrace();
409550
410551 oe.radioPanel = new JPanel(new GridBagLayout());
....@@ -433,153 +574,120 @@
433574 oe.radioPanel.add(dummyButton);
434575 oe.buttonGroup.add(dummyButton);
435576 */
436
- aConstraints.gridy += 1;
437
- oe.aConstraints.gridwidth = 1;
438
- oe.aConstraints.gridx = 0;
577
+ //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
439578
440
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", CameraPane.isLIVE()), oe.aConstraints);
579
+ //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
580
+ //minButton.setToolTipText("Minimize window");
581
+ //minButton.addActionListener(this);
582
+
583
+ oe.toolbarPanel.add(maxButton = new cButton("\u271A", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
584
+ maxButton.setToolTipText("Maximize window");
585
+ maxButton.addActionListener(this);
586
+
587
+ oe.toolbarPanel.add(fullButton = new cButton("\u2b1c", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
588
+ fullButton.setToolTipText("Full-screen window");
589
+ fullButton.addActionListener(this);
590
+
591
+ oe.toolbarPanel.add(undoButton = new cButton("\u21a9", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
592
+ undoButton.setToolTipText("Undo changes");
593
+ undoButton.addActionListener(this);
594
+
595
+ oe.toolbarPanel.add(redoButton = new cButton("\u21aa", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
596
+ redoButton.setToolTipText("Redo changes");
597
+ redoButton.addActionListener(this);
598
+
599
+ oe.toolbarPanel.add(saveButton = new cButton("\u21e3", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
600
+ saveButton.setToolTipText("Save changes");
601
+ saveButton.addActionListener(this);
602
+
603
+ oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints);
604
+ liveCB.setToolTipText("Enable animation");
441605 liveCB.addItemListener(this);
442606
443
- oe.aConstraints.gridx += 1;
444
- oe.toolbarPanel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT), oe.aConstraints);
445
- supportCB.addItemListener(this);
446
-
447
- // oe.aConstraints.gridx += 1;
448
- // oe.toolbarPanel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), oe.aConstraints);
449
- // localCB.addItemListener(this);
450
-
451
- oe.aConstraints.gridx += 1;
452
- oe.toolbarPanel.add(crowdCB = new cCheckBox("Crowd", CameraPane.CROWD), oe.aConstraints);
453
- crowdCB.addItemListener(this);
454
-
455
- oe.aConstraints.gridx += 1;
456
- oe.toolbarPanel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA), oe.aConstraints);
457
- smoothCB.addItemListener(this);
458
-
459
- oe.aConstraints.gridx += 1;
460
- oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST), oe.aConstraints);
607
+ oe.toolbarPanel.add(oneStepButton = new cButton("\u29f4", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
608
+ oneStepButton.setToolTipText("Animate one step forward");
609
+ oneStepButton.addActionListener(this);
610
+
611
+ oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints);
612
+ fastCB.setToolTipText("Fast mode");
461613 fastCB.addItemListener(this);
462
- oe.aConstraints.gridx += 1;
463
- oe.toolbarPanel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE), oe.aConstraints);
464
- slowCB.addItemListener(this);
465
- oe.aConstraints.gridx += 1;
466
- oe.toolbarPanel.add(boxCB = new cCheckBox("Box", CameraPane.FAST), oe.aConstraints);
467
- boxCB.addItemListener(this);
468
-
469
-// oe.aConstraints.gridx += 1;
470
-// oe.toolbarPanel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), oe.aConstraints);
471
-// speakerMocapCB.addItemListener(this);
472
-
473
- if (false)
474
- {
475
- // handled in scripts
476
- oe.aConstraints.gridx += 1;
477
- oe.toolbarPanel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA), oe.aConstraints);
478
- speakerCameraCB.addItemListener(this);
479
-
480
- oe.aConstraints.gridx += 1;
481
- oe.toolbarPanel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS), oe.aConstraints);
482
- speakerFocusCB.addItemListener(this);
483
-
484
- oe.aConstraints.gridx += 1;
485
- oe.toolbarPanel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS), oe.aConstraints);
486
- smoothfocusCB.addItemListener(this);
487
- }
488
-
489
-//oe.aConstraints.gridx += 1;
490
-//oe.toolbarPanel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), oe.aConstraints);
491
-// debugCB.addItemListener(this);
492
-
493
- oe.aConstraints.gridx += 1;
494
- oe.toolbarPanel.add(oeilCB = new cCheckBox("O", CameraPane.OEIL), oe.aConstraints);
495
- oeilCB.addItemListener(this);
496
-
497
- oe.aConstraints.gridx += 1;
498
- oe.toolbarPanel.add(lookAtCB = new cCheckBox("T", CameraPane.LOOKAT), oe.aConstraints);
499
- lookAtCB.addItemListener(this);
500
-
501
- oe.aConstraints.gridx += 1;
502
- oe.toolbarPanel.add(trackCB = new cCheckBox(":", CameraPane.TRACK), oe.aConstraints);
614
+
615
+ oe.toolbarPanel.add(trackCB = new cCheckBox(":", CameraPane.TRACK)); //, oe.aConstraints);
616
+ trackCB.setToolTipText("Enable tracking");
503617 trackCB.addItemListener(this);
504618
505
- oe.aConstraints.gridx += 1;
506
- oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
619
+ oe.toolbarPanel.add(screenfitButton = new cButton("@", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
620
+ screenfitButton.setToolTipText("Screen fit");
507621 screenfitButton.addActionListener(this);
508
- oe.aConstraints.gridx += 1;
622
+
509623 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
510624 // screenfitpointButton.addActionListener(this);
511
-// oe.aConstraints.gridx += 1;
512
- oe.toolbarPanel.add(snapobjectButton = new cButton(" O+ ")); //, oe.aConstraints);
513
- snapobjectButton.addActionListener(this);
514
- oe.aConstraints.gridx += 1;
515625
516
- //aConstraints.gridx = 0;
517
- //aConstraints.gridy += 1;
518
- oe.aConstraints.weighty = 0;
519
- oe.aConstraints.gridwidth = 1;
520
-
521
- oe.toolbarPanel.add(flashSelectionButton = new cButton(" ? ")); //, oe.aConstraints);
626
+ if (Globals.ADVANCED)
627
+ {
628
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
629
+ snapobjectButton.addActionListener(this);
630
+ snapobjectButton.setToolTipText("Snap Object");
631
+ }
632
+
633
+ oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
634
+ flashSelectionButton.setToolTipText("Show selection");
522635 flashSelectionButton.addActionListener(this);
523636
524
- oe.toolbarPanel.add(new cButton(" ", false));
637
+ oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
525638
526
- oe.aConstraints.gridx += 1;
527
- oe.aConstraints.weighty = 0;
528
- oe.aConstraints.gridwidth = 1;
529
-
530
- //
531
- oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints);
639
+ oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
640
+ twoButton.setToolTipText("Show center view only");
532641 twoButton.addActionListener(this);
533
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
642
+ oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
534643 fourButton.addActionListener(this);
535
- oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
644
+ fourButton.setToolTipText("Show left panel only");
645
+ oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
646
+ sixButton.setToolTipText("2-column layout left");
536647 sixButton.addActionListener(this);
537
- oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
648
+ oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
649
+ threeButton.setToolTipText("2-column layout right");
538650 threeButton.addActionListener(this);
539
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
651
+ oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
652
+ sevenButton.setToolTipText("3-column layout");
540653 sevenButton.addActionListener(this);
541654 //
542655
543
- oe.toolbarPanel.add(rootButton = new cButton(" o o o E ")); //, oe.aConstraints);
656
+ oe.toolbarPanel.add(rootButton = new cButton("o o o", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
657
+ rootButton.setToolTipText("Edit selection in new tab");
544658 rootButton.addActionListener(this);
545
- oe.aConstraints.gridx += 1;
546
- oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
659
+
660
+ oe.toolbarPanel.add(closeButton = new cButton("X", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
661
+ closeButton.setToolTipText("Close tab");
547662 closeButton.addActionListener(this);
548663 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
549664 //clearButton.addActionListener(this);
550
- oe.aConstraints.gridx += 1;
551665
552
- oe.aConstraints.gridx = 1; //
553
- oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints);
666
+ editCommandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
667
+ editButton.setToolTipText("Edit selection");
554668 editButton.addActionListener(this);
555
- oe.aConstraints.gridx += 1;
556
- oe.aConstraints.weighty = 0;
557
- oe.aConstraints.gridwidth = 1;
558669
559
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
670
+ editCommandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
671
+ uneditButton.setToolTipText("Unedit selection");
560672 uneditButton.addActionListener(this);
561673
562
- oe.aConstraints.gridx += 1;
563
- oe.aConstraints.weighty = 0;
564
- oe.aConstraints.gridwidth = 1;
565
-
566
- oe.treePanel.add(clearPanelButton = new cButton("C"), oe.aConstraints);
567
- clearPanelButton.addActionListener(this);
568
-
569
- oe.aConstraints.gridx += 1;
570
- oe.aConstraints.weighty = 0;
571
- oe.aConstraints.gridwidth = 1;
572
-
573
- oe.treePanel.add(allParamsButton = new cButton("A"), oe.aConstraints);
674
+ editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
675
+ allParamsButton.setToolTipText("Edit all params");
574676 allParamsButton.addActionListener(this);
575677
576
- oe.aConstraints.gridx += 1;
577
- oe.aConstraints.weighty = 0;
578
- oe.aConstraints.gridwidth = 1;
579
-
580
- oe.treePanel.add(unselectButton = new cButton("U"), oe.aConstraints);
678
+ editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
679
+ clearPanelButton.setToolTipText("Clear edit panel");
680
+ clearPanelButton.addActionListener(this);
681
+
682
+ editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
683
+ unselectButton.setToolTipText("Unselect");
581684 unselectButton.addActionListener(this);
582685
686
+ editCommandsPanel.preferredHeight = 1;
687
+
688
+// oe.treePanel.add(commandsPanel);
689
+// oe.treePanel.Return();
690
+
583691 // oe.aConstraints.gridx += 1;
584692 // oe.aConstraints.weighty = 0;
585693 // oe.aConstraints.gridwidth = 1;
....@@ -591,40 +699,37 @@
591699 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
592700 // gcButton.addActionListener(this);
593701
594
- oe.aConstraints.gridx = 0;
595
- oe.aConstraints.gridy += 1;
596
-
597
- //ctrlPanel.add(objList = new List(5, true));
598
- oe.aConstraints.gridwidth = 100;
599
- // oe.aConstraints.gridheight = 100;
600
- oe.aConstraints.fill = GridBagConstraints.BOTH; // HORIZONTAL;
601
- oe.aConstraints.gridheight = 1;
602
- oe.aConstraints.weighty = 0.5;
603
- oe.aConstraints.gridx = 0;
604
- JScrollPane jSP;
702
+ cGridBag jSPPanel = new cGridBag();
703
+
704
+ JScrollPane jSP;
605705 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
606
- oe.treePanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null)), oe.aConstraints);
706
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints);
607707 ResetModel();
608
- oe.aConstraints.weighty = 0.5;
609
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
610
- oe.aConstraints.gridy += 1;
611
- oe.aConstraints.gridwidth = 1;
708
+
709
+ oe.treePanel.add(jSPPanel);
710
+ oe.treePanel.Return();
612711
613
- oe.aConstraints.weighty = 0;
614
- oe.aConstraints.gridwidth = 2;
615
-
616
- oe.treePanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0), oe.aConstraints);
712
+ cGridBag copyOptionsPanel = new cGridBag();
713
+
714
+ copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
715
+ colorCB.setToolTipText("Copy color when dropped");
617716 colorCB.addItemListener(this);
618
- oe.aConstraints.gridx += 2;
619
- oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints);
717
+
718
+ copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
719
+ materialCB.setToolTipText("Copy material when dropped");
620720 materialCB.addItemListener(this);
621
- oe.aConstraints.gridx += 2;
622
- oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints);
721
+
722
+ copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
723
+ textureCB.setToolTipText("Copy texture when dropped");
623724 textureCB.addItemListener(this);
624725
625
- oe.aConstraints.gridx = 0;
626
- oe.aConstraints.gridy += 1;
726
+ copyOptionsPanel.preferredHeight = 1;
727
+ oe.treePanel.add(copyOptionsPanel);
728
+ oe.treePanel.Return();
627729
730
+// mainPanel.setDividerLocation(0.5); //1.0);
731
+// mainPanel.setResizeWeight(0.5);
732
+
628733 //jList.addListSelectionListener(this);
629734 oe.jTree.addTreeSelectionListener(this);
630735 //jTree.setRootVisible(false);
....@@ -646,20 +751,95 @@
646751 radio.layout = sevenButton;
647752 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
648753 }
754
+
755
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
756
+ {
757
+ panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
758
+ boxCB.setToolTipText("Display bounding boxes");
759
+ boxCB.addItemListener(this);
760
+
761
+ panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
762
+ zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
763
+ zoomBoxCB.addItemListener(this);
764
+
765
+ if (true) // Globals.ADVANCED)
766
+ {
767
+ panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
768
+ supportCB.setToolTipText("Enable rigging");
769
+ supportCB.addItemListener(this);
770
+
771
+ // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
772
+ // localCB.addItemListener(this);
773
+
774
+ panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
775
+ crowdCB.setToolTipText("Used for crowds");
776
+ crowdCB.addItemListener(this);
777
+
778
+ panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
779
+ smoothCB.setToolTipText("Snapping delay");
780
+ smoothCB.addItemListener(this);
781
+
782
+ panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
783
+ slowCB.setToolTipText("Smooth interpolation");
784
+ slowCB.addItemListener(this);
785
+
786
+// constraints.gridy += 1;
787
+// panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
788
+// speakerMocapCB.addItemListener(this);
789
+
790
+ if (false)
791
+ {
792
+ // handled in scripts
793
+ //constraints.gridy += 1;
794
+ panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints);
795
+ speakerCameraCB.addItemListener(this);
796
+
797
+ //constraints.gridy += 1;
798
+ panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints);
799
+ speakerFocusCB.addItemListener(this);
800
+
801
+ //constraints.gridy += 1;
802
+ panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
803
+ smoothfocusCB.addItemListener(this);
804
+ }
805
+
806
+//constraints.gridx += 1;
807
+//panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
808
+// debugCB.addItemListener(this);
809
+
810
+ panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
811
+ oeilCB.addItemListener(this);
812
+
813
+ panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
814
+ lookAtCB.setToolTipText("Look-at target");
815
+ lookAtCB.addItemListener(this);
816
+
817
+ }
818
+
819
+ cGridBag fill = new cGridBag();
820
+
821
+ fill.preferredHeight = 200;
822
+
823
+ panel.add(fill);
824
+
825
+ }
649826
650827 void EditObject(Object3D obj)
651828 {
652
- cRadio dummyButton = new cRadio(obj.name);
653
- dummyButton.SetObject(obj);
654
- dummyButton.layout = sevenButton;
655
- dummyButton.SetCamera(cameraView.renderCamera, false);
656
- dummyButton.addActionListener(this);
657
- radioPanel.add(dummyButton);
658
- buttonGroup.add(dummyButton);
659
- dummyButton.doClick();
829
+ cRadio radioButton = new cRadio(obj.name);
830
+ radioButton.SetObject(obj);
831
+ radioButton.layout = sevenButton;
832
+ radioButton.SetCamera(cameraView.renderCamera, false);
833
+ radioButton.addActionListener(this);
834
+ radioPanel.add(radioButton);
835
+ buttonGroup.add(radioButton);
836
+ radioButton.doClick();
660837 }
838
+
661839 void SetupViews(ObjEditor oe)
662840 {
841
+ theFrame = this;
842
+
663843 oe.SetupViews();
664844
665845 System.out.println("SetupViews");
....@@ -676,6 +856,7 @@
676856 JCheckBox fastCB;
677857 JCheckBox slowCB;
678858 JCheckBox boxCB;
859
+ JCheckBox zoomBoxCB;
679860 JCheckBox trackCB;
680861 JCheckBox smoothfocusCB;
681862 // JCheckBox speakerMocapCB;
....@@ -721,6 +902,7 @@
721902 } else if(e.getSource() == liveCB)
722903 {
723904 cameraView.ToggleLive();
905
+ refreshContents(false);
724906 }
725907 else if(e.getSource() == supportCB)
726908 {
....@@ -755,6 +937,10 @@
755937 Recompile();
756938 cameraView.repaint();
757939 // refreshContents();
940
+ }
941
+ else if(e.getSource() == zoomBoxCB)
942
+ {
943
+ cameraView.ToggleZoomBoxMode();
758944 }
759945 else if(e.getSource() == smoothfocusCB)
760946 {
....@@ -869,7 +1055,9 @@
8691055 // objEditor.DropFile((java.io.File[]) object, true);
8701056 // return;
8711057 // }
872
- if (string.charAt(0) == '/')
1058
+
1059
+ // File path for Mac and Windows
1060
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
8731061 {
8741062 // file(s)
8751063 String[] names = string.split("\n");
....@@ -896,7 +1084,7 @@
8961084
8971085 flashIt = false;
8981086 CameraPane pane = (CameraPane) target;
899
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1087
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
9001088 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
9011089
9021090 if (group.selection.size() == 1)
....@@ -923,11 +1111,11 @@
9231111 {
9241112 loadClipboard(true);
9251113 objEditor.jTree.setSelectionPath(destinationPath);
926
- pasteInto(false);
1114
+ pasteInto(false, false);
9271115 } else {
9281116 loadClipboard(false);
9291117 objEditor.jTree.setSelectionPath(destinationPath);
930
- pasteInto(false); // true); // ???
1118
+ pasteInto(false, false); // true); // ???
9311119 }
9321120 }
9331121 public void dropActionChanged(DropTargetDragEvent dtde)
....@@ -1049,27 +1237,33 @@
10491237 kleinItem.addActionListener(this);
10501238 particleItem = menu.add(new MenuItem("Particle system"));
10511239 particleItem.addActionListener(this);
1240
+ if (Globals.ADVANCED)
1241
+ {
10521242 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10531243 ragdollItem.addActionListener(this);
10541244 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10551245 ragdoll2Item.addActionListener(this);
1246
+ }
10561247 menu.add("-");
1057
- meshItem = menu.add(new MenuItem("Mesh"));
1248
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10581249 meshItem.addActionListener(this);
10591250 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10601251 // meshGroupItem.addActionListener(this);
1252
+ if (Globals.ADVANCED)
1253
+ {
10611254 springItem = menu.add(new MenuItem("Spring"));
10621255 springItem.addActionListener(this);
10631256 flagItem = menu.add(new MenuItem("Flag"));
10641257 flagItem.addActionListener(this);
1065
- bezierItem = menu.add(new MenuItem("Patch"));
1066
- bezierItem.addActionListener(this);
1067
- checkerItem = menu.add(new MenuItem("Checker"));
1068
- checkerItem.addActionListener(this);
10691258 blobItem = menu.add(new MenuItem("Blob"));
10701259 blobItem.addActionListener(this);
10711260 latheItem = menu.add(new MenuItem("Lathe"));
10721261 latheItem.addActionListener(this);
1262
+ }
1263
+ bezierItem = menu.add(new MenuItem("Bezier Patch"));
1264
+ bezierItem.addActionListener(this);
1265
+ overlayItem = menu.add(new MenuItem("Overlay"));
1266
+ overlayItem.addActionListener(this);
10731267 lightItem = menu.add(new MenuItem("Light"));
10741268 lightItem.addActionListener(this);
10751269 menu.add("-");
....@@ -1079,39 +1273,44 @@
10791273 loopItem.addActionListener(this);
10801274 doubleItem = menu.add(new MenuItem("Fork"));
10811275 doubleItem.addActionListener(this);
1276
+ if (Globals.ADVANCED)
1277
+ {
10821278 tripleItem = menu.add(new MenuItem("Trident"));
10831279 tripleItem.addActionListener(this);
1280
+ }
10841281 }
10851282
10861283 void buildToolsMenu(Menu menu)
10871284 {
10881285 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
10891286 animationItem.addItemListener(this);
1090
- animationItem.setState(CameraPane.ANIMATION);
1287
+ animationItem.setState(Globals.ANIMATION);
10911288
10921289 menu.add("-");
10931290 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
10941291 parseverticesItem.addActionListener(this);
10951292 textureFieldItem = menu.add(new MenuItem("Texture Field"));
10961293 textureFieldItem.addActionListener(this);
1097
- alignItem = menu.add(new MenuItem("Align"));
1294
+ alignItem = menu.add(new MenuItem("Align Objects"));
10981295 alignItem.addActionListener(this);
1099
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1100
- mirrorItem.addActionListener(this);
11011296 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
11021297 reduceMorphItem.addActionListener(this);
11031298 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
11041299 reduce34MorphItem.addActionListener(this);
1105
-
1300
+ menu.add("-");
11061301 menu.add(computeAOItem = new MenuItem("Compute AO"));
11071302 computeAOItem.addActionListener(this);
1108
- menu.add("-");
11091303
1304
+ if (Globals.ADVANCED)
1305
+ {
1306
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1307
+ mirrorItem.addActionListener(this);
1308
+ menu.add("-");
11101309 menu.add(memoryItem = new MenuItem("Memory Usage"));
11111310 memoryItem.addActionListener(this);
11121311 menu.add(analyzeItem = new MenuItem("Analyze"));
11131312 analyzeItem.addActionListener(this);
1114
- menu.add(dumpItem = new MenuItem("Dump"));
1313
+ menu.add(dumpItem = new MenuItem("Print"));
11151314 dumpItem.addActionListener(this);
11161315 // menu.add(pathItem = new MenuItem("From-to path"));
11171316 // pathItem.addActionListener(this);
....@@ -1120,6 +1319,8 @@
11201319 resetParentItem.addActionListener(this);
11211320 repairParentItem = menu.add(new MenuItem("Repair Parent"));
11221321 repairParentItem.addActionListener(this);
1322
+ repairShadowItem = menu.add(new MenuItem("Repair Shadow"));
1323
+ repairShadowItem.addActionListener(this);
11231324 menu.add(invariantsItem = new MenuItem("Invariants"));
11241325 invariantsItem.addActionListener(this);
11251326 menu.add(recompileItem = new MenuItem("Recompile"));
....@@ -1127,6 +1328,7 @@
11271328 menu.add("-");
11281329 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11291330 editScriptItem.addActionListener(this);
1331
+ }
11301332 }
11311333
11321334 void ScreenFit()
....@@ -1249,6 +1451,7 @@
12491451 shadow.material = new cMaterial(obj.material);
12501452 shadow.material.diffuse = 0.0001f;
12511453 shadow.material.specular = 0.0001f;
1454
+ //shadow.projectedVertices[1].x = 300;
12521455
12531456 makeSomething(shadow);
12541457 }
....@@ -1455,9 +1658,9 @@
14551658
14561659 void Overwrite(int mask)
14571660 {
1458
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
1661
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14591662 {
1460
- Object3D content = GrafreeD.clipboard.get(0);
1663
+ Object3D content = Grafreed.clipboard.get(0);
14611664
14621665 if (content instanceof cGroup && ((cGroup)content).transientlink )
14631666 content = ((cGroup)content).get(0);
....@@ -1480,6 +1683,7 @@
14801683 //
14811684 public void actionPerformed(ActionEvent event) // , Object arg)
14821685 {
1686
+ Object source = event.getSource();
14831687 /*
14841688 if (event.getSource() == nameField)
14851689 {
....@@ -1491,11 +1695,11 @@
14911695 }
14921696 else
14931697 */
1494
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1698
+ if (source == lookAtItem || source == lookFromItem)
14951699 {
14961700 ScreenFit();
14971701 } else
1498
- if (event.getSource() == switchItem)
1702
+ if (source == switchItem)
14991703 {
15001704 cVector v1 = new cVector();
15011705 cVector v2 = new cVector();
....@@ -1504,11 +1708,11 @@
15041708 objEditor.cameraView.renderCamera.setAim(v2, v1);
15051709 objEditor.cameraView.repaint();
15061710 } else
1507
- if (event.getSource() == rectoidItem)
1711
+ if (source == rectoidItem)
15081712 {
15091713 makeSomething(new Box());
15101714 } else
1511
- if (event.getSource() == particleItem)
1715
+ if (source == particleItem)
15121716 {
15131717 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15141718 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1529,9 +1733,9 @@
15291733 applyExample(particleGeom, "SMOKE");
15301734 makeSomething(particleGeom);
15311735 } else
1532
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1736
+ if (source == ragdollItem || source == ragdoll2Item)
15331737 {
1534
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1738
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15351739
15361740 ragdoll.toParent = LA.newMatrix();
15371741 ragdoll.fromParent = LA.newMatrix();
....@@ -1549,7 +1753,7 @@
15491753 } else
15501754 /*
15511755 */
1552
- if (event.getSource() == heightFieldItem)
1756
+ if (source == heightFieldItem)
15531757 {
15541758 Object3D obj = new Object3D();
15551759
....@@ -1587,31 +1791,31 @@
15871791
15881792 makeSomething(obj);
15891793 } else
1590
- if (event.getSource() == gridItem)
1794
+ if (source == gridItem)
15911795 {
15921796 makeSomething(new Grid());
15931797 } else
1594
- if (event.getSource() == ellipsoidItem)
1798
+ if (source == ellipsoidItem)
15951799 {
15961800 makeSomething(new Sphere());
15971801 } else
1598
- if (event.getSource() == coneItem)
1802
+ if (source == coneItem)
15991803 {
16001804 makeSomething(new Cone());
16011805 } else
1602
- if (event.getSource() == torusItem)
1806
+ if (source == torusItem)
16031807 {
16041808 makeSomething(new Torus());
16051809 } else
1606
- if (event.getSource() == superItem)
1810
+ if (source == superItem)
16071811 {
16081812 makeSomething(new Superellipsoid());
16091813 } else
1610
- if (event.getSource() == kleinItem)
1814
+ if (source == kleinItem)
16111815 {
16121816 makeSomething(new Klein());
16131817 } else
1614
- if (event.getSource() == blobItem)
1818
+ if (source == blobItem)
16151819 {
16161820 Blob blob = new Blob();
16171821 BlobComponent comp = new BlobComponent();
....@@ -1619,15 +1823,15 @@
16191823 //blob.retile();
16201824 makeSomething(blob);
16211825 } else
1622
- if (event.getSource() == latheItem)
1826
+ if (source == latheItem)
16231827 {
16241828 makeSomething(new Lathe());
16251829 } else
1626
- if (event.getSource() == bezierItem)
1830
+ if (source == bezierItem)
16271831 {
16281832 makeSomething(new BezierSurface());
16291833 } else
1630
- if (event.getSource() == checkerItem)
1834
+ if (source == overlayItem)
16311835 {
16321836 /*
16331837 Object3D obj = new BezierSurface(5,8);
....@@ -1642,7 +1846,7 @@
16421846 */
16431847 makeSomething(new Checker());
16441848 } else
1645
- if (event.getSource() == meshItem)
1849
+ if (source == meshItem)
16461850 {
16471851 Object3D itemtomake = new Object3D();
16481852 Object3D child;
....@@ -1663,35 +1867,35 @@
16631867 makeSomething(child);
16641868 }
16651869 } else
1666
- if (event.getSource() == springItem)
1870
+ if (source == springItem)
16671871 {
16681872 cSpring s = new cSpring();
16691873 s.setup();
16701874 makeSomething(s);
16711875 } else
1672
- if (event.getSource() == flagItem)
1876
+ if (source == flagItem)
16731877 {
16741878 cSpring s = new cFlag();
16751879 s.setup();
16761880 makeSomething(s);
16771881 } else
1678
- if (event.getSource() == lightItem)
1882
+ if (source == lightItem)
16791883 {
16801884 makeSomething(new Light());
16811885 } else
1682
- if (event.getSource() == csgItem)
1886
+ if (source == csgItem)
16831887 {
16841888 group(new CSG());
16851889 } else
1686
- if (event.getSource() == templateItem)
1890
+ if (source == templateItem)
16871891 {
16881892 group(new cTemplate());
16891893 } else
1690
- if (event.getSource() == attributeItem)
1894
+ if (source == attributeItem)
16911895 {
16921896 makeSomething(new Attribute());
16931897 } else
1694
- if (event.getSource() == pointflowItem)
1898
+ if (source == pointflowItem)
16951899 {
16961900 makeSomething(new PointFlow());
16971901 } else
....@@ -1703,7 +1907,7 @@
17031907 } else
17041908 */
17051909
1706
- if (event.getSource() == superLoopItem)
1910
+ if (source == superLoopItem)
17071911 {
17081912 Composite g = new cGroup();
17091913 for (int i=0; i<15; i++)
....@@ -1725,7 +1929,7 @@
17251929
17261930 group(g);
17271931 } else
1728
- if (event.getSource() == loopItem)
1932
+ if (source == loopItem)
17291933 {
17301934 Composite csg = new GroupLeaf();
17311935 csg.count = 5;
....@@ -1734,7 +1938,7 @@
17341938 csg.addChild(child);
17351939 child.addChild(csg);
17361940 } else
1737
- if (event.getSource() == doubleItem)
1941
+ if (source == doubleItem)
17381942 {
17391943 Composite csg = new GroupLeaf();
17401944 csg.count = 5;
....@@ -1746,7 +1950,7 @@
17461950 csg.addChild(child);
17471951 child.addChild(csg);
17481952 } else
1749
- if (event.getSource() == tripleItem)
1953
+ if (source == tripleItem)
17501954 {
17511955 Composite csg = new GroupLeaf();
17521956 csg.count = 4;
....@@ -1761,71 +1965,83 @@
17611965 csg.addChild(child);
17621966 child.addChild(csg);
17631967 } else
1764
-
1765
- if (event.getSource() == importGFDItem)
1968
+ if (source == computeAOItem)
17661969 {
1767
- ImportGFD();
1970
+ Globals.drawMode = CameraPane.OCCLUSION;
1971
+ Globals.theRenderer.repaint();
17681972 } else
1769
- if (event.getSource() == importVRMLX3DItem)
1770
- {
1771
- ImportVRMLX3D();
1772
- } else
1773
- if (event.getSource() == import3DSItem)
1774
- {
1775
- objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
1776
- } else
1777
- if (event.getSource() == importOBJItem)
1778
- {
1779
- objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1780
- } else
1781
- if (event.getSource() == computeAOItem)
1782
- {
1783
- CameraPane.drawMode = CameraPane.OCCLUSION;
1784
- CameraPane.theRenderer.repaint();
1785
- } else
1786
- if (event.getSource() == recompileItem)
1973
+ if (source == recompileItem)
17871974 {
17881975 Recompile();
17891976 refreshContents();
17901977 } else
1791
- if (event.getSource() == editScriptItem)
1978
+ if (source == editScriptItem)
17921979 {
17931980 OpenDialog();
17941981 refreshContents();
17951982 } else
1796
- if (event.getSource() == invariantsItem)
1983
+ if (source == invariantsItem)
17971984 {
17981985 System.out.println("Invariants:");
1799
- GrafreeD.grafreeD.universe.invariants();
1986
+ Grafreed.grafreeD.universe.invariants();
18001987 } else
1801
- if (event.getSource() == memoryItem)
1988
+ if (source == memoryItem)
18021989 {
18031990 //System.out.println("Invariants:");
18041991 PrintMemory();
18051992 } else
1806
- if (event.getSource() == pathItem)
1993
+ if (source == pathItem)
18071994 {
18081995 PrintPath();
18091996 } else
1810
- if (event.getSource() == analyzeItem)
1997
+ if (source == analyzeItem)
18111998 {
18121999 AnalyzeObject();
18132000 } else
1814
- if (event.getSource() == dumpItem)
2001
+ if (source == dumpItem)
18152002 {
18162003 DumpObject();
18172004 } else
1818
- if (event.getSource() == screenfitButton)
2005
+ if (source == minButton)
2006
+ {
2007
+ Minimize();
2008
+ } else
2009
+ if (source == maxButton)
2010
+ {
2011
+ Maximize();
2012
+ } else
2013
+ if (source == fullButton)
2014
+ {
2015
+ ToggleFullScreen();
2016
+ } else
2017
+ if (source == undoButton)
2018
+ {
2019
+ Undo();
2020
+ } else
2021
+ if (source == redoButton)
2022
+ {
2023
+ Redo();
2024
+ } else
2025
+ if (source == saveButton)
2026
+ {
2027
+ Save();
2028
+ } else
2029
+ if (source == oneStepButton)
2030
+ {
2031
+ Globals.ONESTEP = true;
2032
+ cameraView.repaint();
2033
+ } else
2034
+ if (source == screenfitButton)
18192035 {
18202036 //Reload(lastConverter, lastFilename, true);
18212037 ScreenFit();
18222038 } else
1823
- if (event.getSource() == screenfitpointButton)
2039
+ if (source == screenfitpointButton)
18242040 {
18252041 //Reload(lastConverter, lastFilename, true);
18262042 ScreenFitPoint();
18272043 } else
1828
- if (event.getSource() == snapobjectButton)
2044
+ if (source == snapobjectButton)
18292045 {
18302046 //Reload(lastConverter, lastFilename, true);
18312047 SnapObject();
....@@ -1836,13 +2052,13 @@
18362052 // Recompile();
18372053 // refreshContents();
18382054 // } else
1839
- if (event.getSource() == gcButton)
2055
+ if (source == gcButton)
18402056 {
18412057 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18422058 System.gc();
18432059 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18442060 } else
1845
- if (event.getSource() == editLeafItem)
2061
+ if (source == editLeafItem)
18462062 {
18472063 Object3D obj;
18482064 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1856,62 +2072,74 @@
18562072 }
18572073 refreshContents(true);
18582074 } else
1859
- if (event.getSource() == openWindowItem)
2075
+ if (source == openWindowItem)
18602076 {
18612077 EditSelection(true);
18622078 } else
1863
- if (event.getSource() == cutItem || event.getSource() == clearButton)
2079
+ if (source == cutItem || source == clearButton)
18642080 {
18652081 loadClipboard(true);
18662082 } else
1867
- if (event.getSource() == duplicateItem)
2083
+ if (source == undoItem)
18682084 {
1869
- Object3D keep = GrafreeD.clipboard;
2085
+ Undo();
2086
+ } else
2087
+ if (source == redoItem)
2088
+ {
2089
+ Redo();
2090
+ } else
2091
+ if (source == duplicateItem)
2092
+ {
2093
+ Object3D keep = Grafreed.clipboard;
18702094 loadClipboard(false);
18712095 paste(false);
1872
- GrafreeD.clipboard = keep;
2096
+ Grafreed.clipboard = keep;
18732097 } else
1874
- if (event.getSource() == cloneItem)
2098
+ if (source == cloneItem)
18752099 {
18762100 CloneSelection(false);
18772101 } else
1878
- if (event.getSource() == cloneSupportItem)
2102
+ if (source == cloneSupportItem)
18792103 {
18802104 CloneSelection(true);
18812105 } else
1882
- if (event.getSource() == copyItem)
2106
+ if (source == copyItem)
18832107 {
18842108 loadClipboard(false);
18852109 } else
1886
- if (event.getSource() == pasteItem)
2110
+ if (source == pasteItem)
18872111 {
18882112 paste(false);
18892113 } else
1890
- if (event.getSource() == pasteLinkItem)
2114
+ if (source == pasteIntoItem)
18912115 {
1892
- pasteInto(false);
2116
+ pasteInto(true, false);
18932117 } else
1894
- if (event.getSource() == pasteCloneItem)
2118
+ if (source == pasteLinkItem)
18952119 {
1896
- pasteInto(true);
2120
+ pasteInto(false, false);
18972121 } else
1898
- if (event.getSource() == pasteExpandItem)
2122
+ if (source == pasteCloneItem)
2123
+ {
2124
+ pasteInto(true, true);
2125
+ } else
2126
+ if (source == pasteExpandItem)
18992127 {
19002128 paste(true);
19012129 } else
1902
- if (event.getSource() == synchronizeItem)
2130
+ if (source == synchronizeItem)
19032131 {
19042132 Overwrite(Object3D.TRANSFORM);
19052133 } else
1906
- if (event.getSource() == overwriteNameItem)
2134
+ if (source == overwriteNameItem)
19072135 {
19082136 Overwrite(Object3D.NAME);
19092137 } else
1910
- if (event.getSource() == overwriteUVItem)
2138
+ if (source == overwriteUVItem)
19112139 {
19122140 Overwrite(Object3D.UV);
19132141 } else
1914
- if (event.getSource() == overwriteMatItem)
2142
+ if (source == overwriteMatItem)
19152143 {
19162144 /* july 2015
19172145 if ((dropAttributes & Object3D.TEXTURE) == 0)
....@@ -1931,7 +2159,7 @@
19312159
19322160 Overwrite(dropAttributes);
19332161 }
1934
- if (event.getSource() == overwriteGeoItem)
2162
+ if (source == overwriteGeoItem)
19352163 {
19362164 Overwrite(Object3D.GEOMETRY);
19372165 // if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
....@@ -1948,7 +2176,7 @@
19482176 // refreshContents();
19492177 // }
19502178 } else
1951
- if (event.getSource() == generateMeshItem)
2179
+ if (source == generateMeshItem)
19522180 {
19532181 //if (group.selection.size() == 1)
19542182 // for (int i=0; i<group.selection.size(); i++)
....@@ -1959,7 +2187,7 @@
19592187 ResetModel();
19602188 refreshContents();
19612189 } else
1962
- if (event.getSource() == extractGeometriesItem)
2190
+ if (source == extractGeometriesItem)
19632191 {
19642192 boolean one = false;
19652193
....@@ -1986,7 +2214,7 @@
19862214 ResetModel();
19872215 refreshContents();
19882216 } else
1989
- if (event.getSource() == cloneGeometriesItem)
2217
+ if (source == cloneGeometriesItem)
19902218 {
19912219 boolean one = false;
19922220
....@@ -2012,7 +2240,7 @@
20122240 ResetModel();
20132241 refreshContents();
20142242 } else
2015
- if (event.getSource() == shareGeometriesItem)
2243
+ if (source == shareGeometriesItem)
20162244 {
20172245 boolean one = false;
20182246
....@@ -2042,7 +2270,7 @@
20422270 refreshContents();
20432271 }
20442272 } else
2045
- if (event.getSource() == mergeGeometriesItem)
2273
+ if (source == mergeGeometriesItem)
20462274 {
20472275 boolean one = false;
20482276
....@@ -2072,7 +2300,7 @@
20722300 ResetModel();
20732301 refreshContents();
20742302 } else
2075
- if (event.getSource() == linkverticesItem)
2303
+ if (source == linkverticesItem)
20762304 {
20772305 // if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
20782306 // {
....@@ -2085,48 +2313,48 @@
20852313 // group.selection.get(0).setMasterThis(content); // should be identity
20862314 // refreshContents();
20872315 // }
2088
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2316
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
20892317 {
2090
- Object3D content = GrafreeD.clipboard.get(0);
2318
+ Object3D content = Grafreed.clipboard.get(0);
20912319
20922320 if (content instanceof cGroup && ((cGroup)content).transientlink )
20932321 content = ((cGroup)content).get(0);
20942322
2095
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
2323
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
20962324 for (int i=0; i<group.selection.size(); i++)
20972325 {
2098
- boolean random = CameraPane.RANDOM;
2099
- CameraPane.RANDOM = false; // parse all random nodes
2326
+ boolean random = CameraPane.SWITCH;
2327
+ CameraPane.SWITCH = false; // parse all random nodes
21002328 group.selection.get(i).linkVerticesThis(content);
21012329 // group.selection.get(i).setMasterThis(content); // should be identity
2102
- CameraPane.RANDOM = random;
2330
+ CameraPane.SWITCH = random;
21032331 }
2104
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
2332
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
21052333 refreshContents();
21062334 }
21072335 } else
2108
- if (event.getSource() == resetsupportItem)
2336
+ if (source == resetsupportItem)
21092337 {
21102338 for (int i=0; i<group.selection.size(); i++)
21112339 {
2112
- boolean random = CameraPane.RANDOM;
2113
- CameraPane.RANDOM = false; // parse all random nodes
2340
+ boolean random = CameraPane.SWITCH;
2341
+ CameraPane.SWITCH = false; // parse all random nodes
21142342 group.selection.get(i).linkVerticesThis(null);
2115
- CameraPane.RANDOM = random;
2343
+ CameraPane.SWITCH = random;
21162344 }
21172345
21182346 refreshContents();
21192347 } else
2120
- if (event.getSource() == relinkverticesItem)
2348
+ if (source == relinkverticesItem)
21212349 {
2122
- boolean random = CameraPane.RANDOM;
2123
- CameraPane.RANDOM = false; // parse all random nodes
2350
+ boolean random = CameraPane.SWITCH;
2351
+ CameraPane.SWITCH = false; // parse all random nodes
21242352 group.selection.RelinkToSupport();
2125
- CameraPane.RANDOM = random;
2353
+ CameraPane.SWITCH = random;
21262354
21272355 refreshContents();
21282356 } else
2129
- if (event.getSource() == resetreferencesItem)
2357
+ if (source == resetreferencesItem)
21302358 {
21312359 for (int i=0; i<group.selection.size(); i++)
21322360 {
....@@ -2135,11 +2363,11 @@
21352363
21362364 refreshContents();
21372365 } else
2138
- if (event.getSource() == setMasterItem)
2366
+ if (source == setMasterItem)
21392367 {
2140
- if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
2368
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
21412369 {
2142
- Object3D content = GrafreeD.clipboard.get(0);
2370
+ Object3D content = Grafreed.clipboard.get(0);
21432371
21442372 if (content instanceof cGroup && ((cGroup)content).transientlink )
21452373 content = ((cGroup)content).get(0);
....@@ -2148,13 +2376,13 @@
21482376 refreshContents();
21492377 }
21502378 } else
2151
- if (event.getSource() == poseMeshItem)
2379
+ if (source == poseMeshItem)
21522380 {
21532381 if (group.selection.size() == 1)
21542382 {
2155
- if (GrafreeD.clipboard.size() == 1)
2383
+ if (Grafreed.clipboard.size() == 1)
21562384 {
2157
- Object3D content = GrafreeD.clipboard.get(0);
2385
+ Object3D content = Grafreed.clipboard.get(0);
21582386
21592387 if (content instanceof cGroup && ((cGroup)content).transientlink )
21602388 content = ((cGroup)content).get(0);
....@@ -2167,19 +2395,19 @@
21672395 }
21682396
21692397 } else
2170
- if (event.getSource() == revertMeshItem)
2398
+ if (source == revertMeshItem)
21712399 {
21722400 RevertMeshes();
21732401 } else
2174
- if (event.getSource() == resetMeshItem)
2402
+ if (source == resetAllItem)
21752403 {
21762404 ResetAll();
21772405 } else
2178
- if (event.getSource() == stepAllItem)
2406
+ if (source == stepAllItem)
21792407 {
21802408 StepAll();
21812409 } else
2182
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2410
+ if (source == clearItem) // || event.getSource() == clearButton)
21832411 {
21842412 //int indices[] = jList.getSelectedIndices();
21852413 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2187,46 +2415,46 @@
21872415
21882416 ClearSelection(false);
21892417 } else
2190
- if (event.getSource() == clearAllItem)
2418
+ if (source == clearAllItem)
21912419 {
21922420 ClearSelection(true);
21932421 } else
2194
- if (event.getSource() == grabItem)
2422
+ if (source == grabItem)
21952423 {
21962424 group(new cGroup(), true);
21972425 } else
2198
- if (event.getSource() == hideItem)
2426
+ if (source == hideItem)
21992427 {
22002428 group(new HiddenObject());
22012429 } else
2202
- if (event.getSource() == frontItem)
2430
+ if (source == frontItem)
22032431 {
22042432 front();
22052433 } else
2206
- if (event.getSource() == backItem)
2434
+ if (source == backItem)
22072435 {
22082436 back();
22092437 } else
2210
- if (event.getSource() == cameraItem)
2438
+ if (source == cameraItem)
22112439 {
22122440 makeSomething(new Camera());
22132441 } else
2214
- if (event.getSource() == compositeItem)
2442
+ if (source == compositeItem)
22152443 {
22162444 group(new Composite());
22172445 } else
2218
- if (event.getSource() == randomItem)
2446
+ if (source == randomItem)
22192447 {
22202448 RandomNode random = new RandomNode();
22212449 group(random);
22222450 if (random.size() > 0)
2223
- random.name = random.get(0).name + "Rnd";
2451
+ random.name = random.get(0).name + "Switch";
22242452 } else
2225
- if (event.getSource() == physicsItem)
2453
+ if (source == physicsItem)
22262454 {
22272455 group(new PhysicsNode());
22282456 } else
2229
- if (event.getSource() == frameselectorItem)
2457
+ if (source == frameselectorItem)
22302458 {
22312459 for (int i=0; i<group.selection.size(); i++)
22322460 {
....@@ -2238,7 +2466,7 @@
22382466 ResetModel();
22392467 refreshContents();
22402468 } else
2241
- if (event.getSource() == switchGeoItem)
2469
+ if (source == switchGeoItem)
22422470 {
22432471 for (int i=0; i<group.selection.size(); i++)
22442472 {
....@@ -2250,7 +2478,7 @@
22502478 ResetModel();
22512479 refreshContents();
22522480 } else
2253
- if (event.getSource() == switchTransfoItem)
2481
+ if (source == switchTransfoItem)
22542482 {
22552483 for (int i=0; i<group.selection.size(); i++)
22562484 {
....@@ -2262,7 +2490,7 @@
22622490 ResetModel();
22632491 refreshContents();
22642492 } else
2265
- if (event.getSource() == morphItem)
2493
+ if (source == morphItem)
22662494 {
22672495 for (int i=0; i<group.selection.size(); i++)
22682496 {
....@@ -2274,7 +2502,7 @@
22742502 ResetModel();
22752503 refreshContents();
22762504 } else
2277
- if (event.getSource() == scriptNodeItem)
2505
+ if (source == scriptNodeItem)
22782506 {
22792507 boolean atleastone = false;
22802508
....@@ -2313,31 +2541,31 @@
23132541 }
23142542 }
23152543 } else
2316
- if (event.getSource() == linkerItem)
2544
+ if (source == linkerItem)
23172545 {
23182546 group(new cLinker());
23192547 } else
2320
- if (event.getSource() == textureItem)
2548
+ if (source == textureItem)
23212549 {
23222550 group(new TextureNode());
23232551 } else
2324
- if (event.getSource() == billboardItem)
2552
+ if (source == billboardItem)
23252553 {
23262554 group(new BillboardNode());
23272555 } else
2328
- if (event.getSource() == shadowXItem)
2556
+ if (source == shadowXItem)
23292557 {
23302558 CastShadow(0);
23312559 } else
2332
- if (event.getSource() == shadowYItem)
2560
+ if (source == shadowYItem)
23332561 {
23342562 CastShadow(1);
23352563 } else
2336
- if (event.getSource() == shadowZItem)
2564
+ if (source == shadowZItem)
23372565 {
23382566 CastShadow(2);
23392567 } else
2340
- if (event.getSource() == ungroupItem)
2568
+ if (source == ungroupItem)
23412569 {
23422570 //ungroup();
23432571 for (int i=0; i<group.selection.size(); i++)
....@@ -2349,179 +2577,203 @@
23492577
23502578 refreshContents();
23512579 } else
2352
- if (event.getSource() == genUVItem)
2580
+ if (source == genUVItem)
23532581 {
23542582 GenUV();
23552583 } else
2356
- if (event.getSource() == genNormalsCADItem)
2584
+ if (source == genNormalsCADItem)
23572585 {
23582586 GenNormals(true);
23592587 } else
2360
- if (event.getSource() == genNormalsMESHItem)
2588
+ if (source == genNormalsMESHItem)
23612589 {
2362
- GenNormals(true); // TODO
2590
+ GenNormalsMESH();
23632591 } else
2364
- if (event.getSource() == genNormalsORGANItem)
2592
+ if (source == genNormalsORGANItem)
23652593 {
23662594 GenNormals(false);
23672595 } else
2368
- if (event.getSource() == genNormalsMINEItem)
2596
+ if (source == genNormalsMINEItem)
23692597 {
23702598 GenNormalsMINE();
23712599 } else
2372
- if (event.getSource() == stripifyItem)
2600
+ if (source == stripifyItem)
23732601 {
23742602 Stripify();
23752603 } else
2376
- if (event.getSource() == unstripifyItem)
2604
+ if (source == unstripifyItem)
23772605 {
23782606 Unstripify();
23792607 } else
2380
- if (event.getSource() == trimItem)
2608
+ if (source == trimItem)
23812609 {
23822610 Trim();
23832611 } else
2384
- if (event.getSource() == untrimItem)
2612
+ if (source == untrimItem)
23852613 {
23862614 Untrim();
23872615 } else
2388
- if (event.getSource() == clearColorsItem)
2616
+ if (source == clearColorsItem)
23892617 {
23902618 ClearColors();
23912619 } else
2392
- if (event.getSource() == clearMaterialsItem)
2620
+ if (source == clearMaterialsItem)
23932621 {
23942622 ClearMaterials();
23952623 } else
2396
- if (event.getSource() == liveleavesItem)
2624
+ if (source == liveleavesItem)
23972625 {
23982626 LiveLeaves(true);
23992627 } else
2400
- if (event.getSource() == unliveleavesItem)
2628
+ if (source == unliveleavesItem)
24012629 {
24022630 LiveLeaves(false);
24032631 } else
2404
- if (event.getSource() == supportleavesItem)
2632
+ if (source == supportleavesItem)
24052633 {
24062634 SupportLeaves(true);
24072635 } else
2408
- if (event.getSource() == unsupportleavesItem)
2636
+ if (source == unsupportleavesItem)
24092637 {
24102638 SupportLeaves(false);
24112639 } else
2412
- if (event.getSource() == hideleavesItem)
2640
+ if (source == hideleavesItem)
24132641 {
24142642 HideLeaves(true);
24152643 } else
2416
- if (event.getSource() == showleavesItem)
2644
+ if (source == showleavesItem)
24172645 {
24182646 HideLeaves(false);
24192647 } else
2420
- if (event.getSource() == markleavesItem)
2648
+ if (source == markleavesItem)
24212649 {
24222650 MarkLeaves(true);
24232651 } else
2424
- if (event.getSource() == unmarkleavesItem)
2652
+ if (source == unmarkleavesItem)
24252653 {
24262654 MarkLeaves(false);
24272655 } else
2428
- if (event.getSource() == flipVItem)
2656
+ if (source == rewindleavesItem)
2657
+ {
2658
+ RewindLeaves(true);
2659
+ } else
2660
+ if (source == unrewindleavesItem)
2661
+ {
2662
+ RewindLeaves(false);
2663
+ } else
2664
+ if (source == randomleavesItem)
2665
+ {
2666
+ RandomLeaves(true);
2667
+ } else
2668
+ if (source == unrandomleavesItem)
2669
+ {
2670
+ RandomLeaves(false);
2671
+ } else
2672
+ if (source == flipVItem)
24292673 {
24302674 FlipV(true);
24312675 } else
2432
- if (event.getSource() == unflipVItem)
2676
+ if (source == unflipVItem)
24332677 {
24342678 FlipV(false);
24352679 } else
2436
- if (event.getSource() == lowTexturesItem)
2680
+ if (source == lowTexturesItem)
24372681 {
24382682 SetTexRes(0);
24392683 } else
2440
- if (event.getSource() == normalTexturesItem)
2684
+ if (source == normalTexturesItem)
24412685 {
24422686 SetTexRes(1);
24432687 } else
2444
- if (event.getSource() == highTexturesItem)
2688
+ if (source == highTexturesItem)
24452689 {
24462690 SetTexRes(2);
24472691 } else
2448
- if (event.getSource() == veryhighTexturesItem)
2692
+ if (source == veryhighTexturesItem)
24492693 {
24502694 SetTexRes(3);
24512695 } else
2452
- if (event.getSource() == maxTexturesItem)
2696
+ if (source == maxTexturesItem)
24532697 {
24542698 SetTexRes(4);
24552699 } else
2456
- if (event.getSource() == panoTexturesItem)
2700
+ if (source == panoTexturesItem)
24572701 {
24582702 SetTexRes(5);
24592703 } else
2460
- if (event.getSource() == reverseNormalsItem)
2704
+ if (source == reverseNormalsItem)
24612705 {
24622706 ReverseNormals();
24632707 } else
2464
- if (event.getSource() == parseverticesItem)
2708
+ if (source == parseverticesItem)
24652709 {
24662710 ParseVertices();
24672711 } else
2468
- if (event.getSource() == textureFieldItem)
2712
+ if (source == textureFieldItem)
24692713 {
24702714 TextureVertices();
24712715 } else
2472
- if (event.getSource() == alignItem)
2716
+ if (source == alignItem)
24732717 {
24742718 Align();
24752719 } else
2476
- if (event.getSource() == mirrorItem)
2720
+ if (source == mirrorItem)
24772721 {
24782722 MirrorPoses();
24792723 } else
2480
- if (event.getSource() == reduceMorphItem)
2724
+ if (source == reduceMorphItem)
24812725 {
24822726 MeshReduction(false);
24832727 } else
2484
- if (event.getSource() == reduce34MorphItem)
2728
+ if (source == reduce34MorphItem)
24852729 {
24862730 MeshReduction(true);
24872731 } else
2488
- if (event.getSource() == reverseTrianglesItem)
2732
+ if (source == reverseTrianglesItem)
24892733 {
24902734 ReverseTriangles();
24912735 } else
2492
- if (event.getSource() == reduceMeshItem)
2736
+ if (source == reduceMeshItem)
24932737 {
24942738 ReduceMesh(false);
24952739 } else
2496
- if (event.getSource() == reduce34MeshItem)
2740
+ if (source == reduce34MeshItem)
24972741 {
24982742 ReduceMesh(true);
24992743 } else
2500
- if (event.getSource() == increaseMeshItem)
2744
+ if (source == increaseMeshItem)
25012745 {
25022746 IncreaseMesh();
25032747 } else
2504
- if (event.getSource() == clipMeshItem)
2748
+ if (source == clipMeshItem)
25052749 {
25062750 ClipMesh();
25072751 } else
2508
- if (event.getSource() == smoothMeshItem)
2752
+ if (source == smoothMeshItem)
25092753 {
25102754 SmoothMesh();
25112755 } else
2512
- if (event.getSource() == transformgeometryItem)
2756
+ if (source == transformGeometryItem)
25132757 {
25142758 TransformGeometry();
25152759 } else
2516
- if (event.getSource() == resetTransformItem)
2760
+ if (source == transformChildrenItem)
2761
+ {
2762
+ TransformChildren();
2763
+ } else
2764
+ if (source == resetTransformItem)
25172765 {
25182766 ResetTransform();
25192767 } else
2520
- if (event.getSource() == resetCentroidItem)
2768
+ if (source == resetCentroidItem)
25212769 {
2522
- ResetCentroid();
2770
+ ResetCentroid(true);
25232771 } else
2524
- if (event.getSource() == resetParentItem)
2772
+ if (source == resetCentroidXZItem)
2773
+ {
2774
+ ResetCentroid(false);
2775
+ } else
2776
+ if (source == resetParentItem)
25252777 {
25262778 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25272779 {
....@@ -2531,7 +2783,7 @@
25312783
25322784 refreshContents();
25332785 } else
2534
- if (event.getSource() == repairParentItem)
2786
+ if (source == repairParentItem)
25352787 {
25362788 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25372789 {
....@@ -2545,7 +2797,21 @@
25452797
25462798 refreshContents();
25472799 } else
2548
- if (event.getSource() == sortbysizeItem)
2800
+ if (source == repairShadowItem)
2801
+ {
2802
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
2803
+ {
2804
+ Object3D obj = (Object3D)e.nextElement();
2805
+ obj.RepairShadow();
2806
+// for (int i=0; i<obj.size(); i++)
2807
+// {
2808
+// obj.get(i).parent = obj;
2809
+// }
2810
+ }
2811
+
2812
+ refreshContents();
2813
+ } else
2814
+ if (source == sortbysizeItem)
25492815 {
25502816 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25512817 {
....@@ -2557,7 +2823,7 @@
25572823 ResetModel();
25582824 refreshContents();
25592825 } else
2560
- if (event.getSource() == sortbynameItem)
2826
+ if (source == sortbynameItem)
25612827 {
25622828 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25632829 {
....@@ -2569,7 +2835,7 @@
25692835 ResetModel();
25702836 refreshContents();
25712837 } else
2572
- if (event.getSource() == attachPigmentItem)
2838
+ if (source == attachPigmentItem)
25732839 {
25742840 String texture = GetFile("Attach pigment");
25752841 Object3D obj;
....@@ -2581,7 +2847,7 @@
25812847
25822848 refreshContents();
25832849 } else
2584
- if (event.getSource() == detachPigmentItem)
2850
+ if (source == detachPigmentItem)
25852851 {
25862852 Object3D obj;
25872853 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2592,7 +2858,7 @@
25922858
25932859 refreshContents();
25942860 } else
2595
- if (event.getSource() == attachBumpItem)
2861
+ if (source == attachBumpItem)
25962862 {
25972863 String texture = GetFile("Attach bump");
25982864 Object3D obj;
....@@ -2604,7 +2870,7 @@
26042870
26052871 refreshContents();
26062872 } else
2607
- if (event.getSource() == detachBumpItem)
2873
+ if (source == detachBumpItem)
26082874 {
26092875 Object3D obj;
26102876 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2615,7 +2881,7 @@
26152881
26162882 refreshContents();
26172883 } else
2618
- if (event.getSource() == pigmentBumpItem)
2884
+ if (source == pigmentBumpItem)
26192885 {
26202886 Object3D obj;
26212887 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2626,158 +2892,221 @@
26262892
26272893 refreshContents();
26282894 } else
2629
- if (event.getSource() == flashSelectionButton)
2895
+ if (source == flashSelectionButton)
26302896 {
26312897 CameraPane.flash = true;
26322898 refreshContents();
26332899 } else
2634
- if (event.getSource() == oneButton)
2900
+ if (source == oneButton)
26352901 {
26362902 } else
2637
- if (event.getSource() == twoButton)
2903
+ if (source == twoButton)
26382904 {
26392905 radio.layout = twoButton;
26402906 // bug
26412907 //gridPanel.setDividerLocation(1.0);
26422908 //bigPanel.setDividerLocation(0.0);
2643
- bigThree.remove(scenePanel);
2644
- bigThree.remove(centralPanel);
2645
- bigThree.remove(XYZPanel);
2646
- aWindowConstraints.gridx = 0;
2647
- aWindowConstraints.gridy = 0;
2648
- aWindowConstraints.gridwidth = 1;
2649
- // aConstraints.gridheight = 3;
2650
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2651
- aWindowConstraints.weightx = 0;
2652
- aWindowConstraints.weighty = 1;
2653
- //bigThree.add(jtp, aWindowConstraints);
2654
- aWindowConstraints.weightx = 1;
2655
- aWindowConstraints.gridwidth = 3;
2656
- // aConstraints.gridheight = 3;
2657
- aWindowConstraints.gridx = 1;
2658
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2659
- bigThree.add(centralPanel, aWindowConstraints);
2660
- aWindowConstraints.weightx = 0;
2661
- aWindowConstraints.gridx = 4;
2662
- aWindowConstraints.gridwidth = 1;
2663
- // aConstraints.gridheight = 3;
2664
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2665
- //bigThree.add(XYZPanel, aWindowConstraints);
2666
- bigThree.revalidate();
2909
+// bigThree.remove(scenePanel);
2910
+// bigThree.remove(centralPanel);
2911
+// bigThree.remove(XYZPanel);
2912
+// aWindowConstraints.gridx = 0;
2913
+// aWindowConstraints.gridy = 0;
2914
+// aWindowConstraints.gridwidth = 1;
2915
+// // aConstraints.gridheight = 3;
2916
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2917
+// aWindowConstraints.weightx = 0;
2918
+// aWindowConstraints.weighty = 1;
2919
+// //bigThree.add(jtp, aWindowConstraints);
2920
+// aWindowConstraints.weightx = 1;
2921
+// aWindowConstraints.gridwidth = 3;
2922
+// // aConstraints.gridheight = 3;
2923
+// aWindowConstraints.gridx = 1;
2924
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2925
+// bigThree.add(centralPanel, aWindowConstraints);
2926
+// aWindowConstraints.weightx = 0;
2927
+// aWindowConstraints.gridx = 4;
2928
+// aWindowConstraints.gridwidth = 1;
2929
+// // aConstraints.gridheight = 3;
2930
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2931
+// //bigThree.add(XYZPanel, aWindowConstraints);
2932
+// scenePanel.setVisible(false);
2933
+// centralPanel.setVisible(true);
2934
+// XYZPanel.setVisible(false);
2935
+ bigThree.ClearUI();
2936
+ bigThree.add(centralPanel);
2937
+ bigThree.FlushUI();
2938
+
2939
+ cameraView.requestFocusInWindow();
2940
+
2941
+// refreshContents(true);
2942
+//
2943
+// try
2944
+// {
2945
+// java.awt.Robot bot = new java.awt.Robot();
2946
+// int mask = InputEvent.BUTTON1_MASK;
2947
+// bot.mouseMove(100, 100);
2948
+// bot.mousePress(mask);
2949
+// bot.mouseRelease(mask);
2950
+// }
2951
+// catch (Exception e)
2952
+// {
2953
+//
2954
+// }
2955
+
26672956 } else
2668
- if (event.getSource() == threeButton)
2957
+ if (source == threeButton)
26692958 {
26702959 radio.layout = threeButton;
2671
- bigThree.remove(scenePanel);
2672
- bigThree.remove(centralPanel);
2673
- bigThree.remove(XYZPanel);
2674
- aWindowConstraints.gridx = 0;
2675
- aWindowConstraints.gridy = 0;
2676
- aWindowConstraints.gridwidth = 1;
2677
- // aConstraints.gridheight = 3;
2678
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2679
- aWindowConstraints.weightx = 0;
2680
- aWindowConstraints.weighty = 1;
2681
- //bigThree.add(jtp, aWindowConstraints);
2682
- aWindowConstraints.weightx = 1;
2683
- aWindowConstraints.gridwidth = 3;
2684
- // aConstraints.gridheight = 3;
2685
- aWindowConstraints.gridx = 1;
2686
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2687
- bigThree.add(centralPanel, aWindowConstraints);
2688
- aWindowConstraints.weightx = 0;
2689
- aWindowConstraints.gridx = 4;
2690
- aWindowConstraints.gridwidth = 1;
2691
- // aConstraints.gridheight = 3;
2692
- aConstraints.fill = GridBagConstraints.VERTICAL;
2693
- bigThree.add(XYZPanel, aWindowConstraints);
2694
- bigThree.revalidate();
2960
+
2961
+// bigThree.remove(scenePanel);
2962
+// bigThree.remove(centralPanel);
2963
+// bigThree.remove(XYZPanel);
2964
+// aWindowConstraints.gridx = 0;
2965
+// aWindowConstraints.gridy = 0;
2966
+// aWindowConstraints.gridwidth = 1;
2967
+// // aConstraints.gridheight = 3;
2968
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2969
+// aWindowConstraints.weightx = 0;
2970
+// aWindowConstraints.weighty = 1;
2971
+// //bigThree.add(jtp, aWindowConstraints);
2972
+// aWindowConstraints.weightx = 1;
2973
+// aWindowConstraints.gridwidth = 3;
2974
+// // aConstraints.gridheight = 3;
2975
+// aWindowConstraints.gridx = 1;
2976
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2977
+// bigThree.add(centralPanel, aWindowConstraints);
2978
+// aWindowConstraints.weightx = 0;
2979
+// aWindowConstraints.gridx = 4;
2980
+// aWindowConstraints.gridwidth = 1;
2981
+// // aConstraints.gridheight = 3;
2982
+// aConstraints.fill = GridBagConstraints.VERTICAL;
2983
+// bigThree.add(XYZPanel, aWindowConstraints);
2984
+// bigThree.validate();
2985
+// scenePanel.setVisible(false);
2986
+// centralPanel.setVisible(true);
2987
+// XYZPanel.setVisible(true);
2988
+ bigThree.ClearUI();
2989
+ bigThree.add(centralPanel);
2990
+ bigThree.add(XYZPanel);
2991
+ bigThree.FlushUI();
2992
+
2993
+ cameraView.requestFocusInWindow();
26952994 } else
2696
- if (event.getSource() == fourButton)
2995
+ if (source == fourButton)
26972996 {
26982997 radio.layout = fourButton;
2699
- bigThree.remove(scenePanel);
2700
- bigThree.remove(centralPanel);
2701
- bigThree.remove(XYZPanel);
2702
- aWindowConstraints.gridx = 0;
2703
- aWindowConstraints.gridy = 0;
2704
- aWindowConstraints.gridwidth = 1;
2705
- // aWindowConstraints.gridheight = 3;
2706
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2707
- aWindowConstraints.weightx = 1;
2708
- aWindowConstraints.weighty = 1;
2709
- bigThree.add(scenePanel, aWindowConstraints);
2710
- aWindowConstraints.weightx = 1;
2711
- aWindowConstraints.gridwidth = 3;
2712
- // aConstraints.gridheight = 3;
2713
- aWindowConstraints.gridx = 1;
2714
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2715
- //bigThree.add(cameraPanel, aWindowConstraints);
2716
- aWindowConstraints.weightx = 0;
2717
- aWindowConstraints.gridx = 4;
2718
- aWindowConstraints.gridwidth = 1;
2719
- // aWindowConstraints.gridheight = 3;
2720
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2721
- //bigThree.add(XYZPanel, aWindowConstraints);
2722
- bigThree.revalidate();
2998
+
2999
+// bigThree.remove(scenePanel);
3000
+// bigThree.remove(centralPanel);
3001
+// bigThree.remove(XYZPanel);
3002
+// aWindowConstraints.gridx = 0;
3003
+// aWindowConstraints.gridy = 0;
3004
+// aWindowConstraints.gridwidth = 1;
3005
+// // aWindowConstraints.gridheight = 3;
3006
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3007
+// aWindowConstraints.weightx = 1;
3008
+// aWindowConstraints.weighty = 1;
3009
+// bigThree.add(scenePanel, aWindowConstraints);
3010
+// aWindowConstraints.weightx = 1;
3011
+// aWindowConstraints.gridwidth = 3;
3012
+// // aConstraints.gridheight = 3;
3013
+// aWindowConstraints.gridx = 1;
3014
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3015
+// //bigThree.add(cameraPanel, aWindowConstraints);
3016
+// aWindowConstraints.weightx = 0;
3017
+// aWindowConstraints.gridx = 4;
3018
+// aWindowConstraints.gridwidth = 1;
3019
+// // aWindowConstraints.gridheight = 3;
3020
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3021
+// //bigThree.add(XYZPanel, aWindowConstraints);
3022
+// bigThree.validate();
3023
+// scenePanel.setVisible(true);
3024
+// centralPanel.setVisible(false);
3025
+// XYZPanel.setVisible(false);
3026
+ bigThree.ClearUI();
3027
+ bigThree.add(scenePanel);
3028
+ bigThree.FlushUI();
3029
+
3030
+ cameraView.requestFocusInWindow();
27233031 } else
2724
- if (event.getSource() == sixButton)
3032
+ if (source == sixButton)
27253033 {
27263034 radio.layout = sixButton;
2727
- bigThree.remove(scenePanel);
2728
- bigThree.remove(centralPanel);
2729
- bigThree.remove(XYZPanel);
2730
- aWindowConstraints.gridx = 0;
2731
- aWindowConstraints.gridy = 0;
2732
- aWindowConstraints.gridwidth = 1;
2733
- // aConstraints.gridheight = 3;
2734
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2735
- aWindowConstraints.weightx = 0;
2736
- aWindowConstraints.weighty = 1;
2737
- bigThree.add(scenePanel, aWindowConstraints);
2738
- aWindowConstraints.weightx = 1;
2739
- aWindowConstraints.gridwidth = 3;
2740
- // aWindowConstraints.gridheight = 3;
2741
- aWindowConstraints.gridx = 1;
2742
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2743
- bigThree.add(centralPanel, aWindowConstraints);
2744
- aWindowConstraints.weightx = 0;
2745
- aWindowConstraints.gridx = 4;
2746
- aWindowConstraints.gridwidth = 1;
2747
- // aWindowConstraints.gridheight = 3;
2748
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2749
- //bigThree.add(XYZPanel, aConstraints);
2750
- bigThree.revalidate();
3035
+
3036
+// bigThree.remove(scenePanel);
3037
+// bigThree.remove(centralPanel);
3038
+// bigThree.remove(XYZPanel);
3039
+// aWindowConstraints.gridx = 0;
3040
+// aWindowConstraints.gridy = 0;
3041
+// aWindowConstraints.gridwidth = 1;
3042
+// // aConstraints.gridheight = 3;
3043
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3044
+// aWindowConstraints.weightx = 0;
3045
+// aWindowConstraints.weighty = 1;
3046
+// bigThree.add(scenePanel, aWindowConstraints);
3047
+// aWindowConstraints.weightx = 1;
3048
+// aWindowConstraints.gridwidth = 3;
3049
+// // aWindowConstraints.gridheight = 3;
3050
+// aWindowConstraints.gridx = 1;
3051
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3052
+// bigThree.add(centralPanel, aWindowConstraints);
3053
+// aWindowConstraints.weightx = 0;
3054
+// aWindowConstraints.gridx = 4;
3055
+// aWindowConstraints.gridwidth = 1;
3056
+// // aWindowConstraints.gridheight = 3;
3057
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3058
+// //bigThree.add(XYZPanel, aConstraints);
3059
+// bigThree.validate();
3060
+// scenePanel.setVisible(true);
3061
+// centralPanel.setVisible(true);
3062
+// XYZPanel.setVisible(false);
3063
+ bigThree.ClearUI();
3064
+ bigThree.add(scenePanel);
3065
+ bigThree.add(centralPanel);
3066
+ bigThree.FlushUI();
3067
+
3068
+ cameraView.requestFocusInWindow();
27513069 } else
2752
- if (event.getSource() == sevenButton)
3070
+ if (source == sevenButton)
27533071 {
27543072 radio.layout = sevenButton;
2755
- bigThree.remove(scenePanel);
2756
- bigThree.remove(centralPanel);
2757
- bigThree.remove(XYZPanel);
2758
- aWindowConstraints.gridx = 0;
2759
- aWindowConstraints.gridy = 0;
2760
- aWindowConstraints.gridwidth = 1;
2761
- // aWindowConstraints.gridheight = 3;
2762
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2763
- aWindowConstraints.weightx = 0;
2764
- aWindowConstraints.weighty = 1;
2765
- bigThree.add(scenePanel, aWindowConstraints);
2766
- aWindowConstraints.weightx = 1;
2767
- aWindowConstraints.gridwidth = 3;
2768
- // aWindowConstraints.gridheight = 3;
2769
- aWindowConstraints.gridx = 1;
2770
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2771
- bigThree.add(centralPanel, aWindowConstraints);
2772
- aWindowConstraints.weightx = 0;
2773
- aWindowConstraints.gridx = 4;
2774
- aWindowConstraints.gridwidth = 1;
2775
- // aConstraints.gridheight = 3;
2776
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2777
- bigThree.add(XYZPanel, aWindowConstraints);
2778
- bigThree.revalidate();
3073
+
3074
+// bigThree.remove(scenePanel);
3075
+// bigThree.remove(centralPanel);
3076
+// bigThree.remove(XYZPanel);
3077
+// aWindowConstraints.gridx = 0;
3078
+// aWindowConstraints.gridy = 0;
3079
+// aWindowConstraints.gridwidth = 1;
3080
+// // aWindowConstraints.gridheight = 3;
3081
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3082
+// aWindowConstraints.weightx = 0;
3083
+// aWindowConstraints.weighty = 1;
3084
+// bigThree.add(scenePanel, aWindowConstraints);
3085
+// aWindowConstraints.weightx = 1;
3086
+// aWindowConstraints.gridwidth = 3;
3087
+// // aWindowConstraints.gridheight = 3;
3088
+// aWindowConstraints.gridx = 1;
3089
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
3090
+// bigThree.add(centralPanel, aWindowConstraints);
3091
+// aWindowConstraints.weightx = 0;
3092
+// aWindowConstraints.gridx = 4;
3093
+// aWindowConstraints.gridwidth = 1;
3094
+// // aConstraints.gridheight = 3;
3095
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
3096
+// bigThree.add(XYZPanel, aWindowConstraints);
3097
+// bigThree.validate();
3098
+// scenePanel.setVisible(true);
3099
+// centralPanel.setVisible(true);
3100
+// XYZPanel.setVisible(true);
3101
+ bigThree.ClearUI();
3102
+ bigThree.add(scenePanel);
3103
+ bigThree.add(centralPanel);
3104
+ bigThree.add(XYZPanel);
3105
+ bigThree.FlushUI();
3106
+
3107
+ cameraView.requestFocusInWindow();
27793108 } else
2780
- if (event.getSource() == rootButton)
3109
+ if (source == rootButton)
27813110 {
27823111 Object3D obj;
27833112 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2787,9 +3116,10 @@
27873116 EditObject(obj);
27883117 }
27893118
3119
+ cameraView.requestFocusInWindow();
27903120 refreshContents(true);
27913121 } else
2792
- if (event.getSource() == closeButton)
3122
+ if (source == closeButton)
27933123 {
27943124 //System.out.println("CLOSE: " + buttonGroup.getSelection());
27953125 cRadio ab;
....@@ -2808,13 +3138,15 @@
28083138 break;
28093139 }
28103140 }
3141
+
3142
+ cameraView.requestFocusInWindow();
28113143 refreshContents(true);
28123144 } else
2813
- if (event.getSource() == editItem || event.getSource() == editButton)
3145
+ if (source == editItem || source == editButton)
28143146 {
28153147 EditSelection(false);
28163148 } else
2817
- if (event.getSource() == uneditButton)
3149
+ if (source == uneditButton)
28183150 {
28193151 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
28203152 {
....@@ -2824,14 +3156,14 @@
28243156 child.CloseUI();
28253157 listUI.remove(child);
28263158
2827
- child.editWindow = null; // ???????????
3159
+ //child.editWindow = null; // ???????????
28283160 }
2829
- objEditor.ctrlPanel.revalidate();
3161
+ objEditor.ctrlPanel.FlushUI();
28303162 //objEditor.jTree.clearSelection();
28313163 //objEditor.ResetSliders();
28323164 refreshContents(true);
28333165 } else
2834
- if (event.getSource() == clearPanelButton)
3166
+ if (source == clearPanelButton)
28353167 {
28363168 assert(copy == group);
28373169 //copy.ClearUI();
....@@ -2842,7 +3174,7 @@
28423174 listUI.clear();
28433175 refreshContents(true);
28443176 } else
2845
- if (event.getSource() == allParamsButton)
3177
+ if (source == allParamsButton)
28463178 {
28473179 assert(copy == group);
28483180
....@@ -2863,19 +3195,19 @@
28633195
28643196 refreshContents(true);
28653197 } else
2866
- if (event.getSource() == unselectButton)
3198
+ if (source == unselectButton)
28673199 {
28683200 objEditor.jTree.clearSelection();
28693201 // ?? oct 2012 GrafreeD.clipboard.clear();
28703202 objEditor.ResetSliders();
28713203 refreshContents(true);
28723204 } else
2873
- if(event.getSource() instanceof cRadio)
3205
+ if(source instanceof cRadio)
28743206 {
28753207 group.parent = keepparent;
28763208 group.attributes = 0;
28773209 //group.editWindow = null;
2878
- /*cRadio*/ radio = (cRadio)event.getSource();
3210
+ /*cRadio*/ radio = (cRadio)source;
28793211 Object3D obj = radio.GetObject();
28803212 System.out.println("Edit " + obj);
28813213 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -2895,7 +3227,7 @@
28953227 }
28963228
28973229 copy = group;
2898
- //CameraPane.theRenderer.object = group;
3230
+ //Globals.theRenderer.object = group;
28993231 if(!useclient)
29003232 {
29013233 cameraView.renderCamera = radio.camera;
....@@ -2904,12 +3236,16 @@
29043236 cameraView.cameras[cameraView.cameracount] = radio.camera;
29053237 cameraView.targetLookAt.set(radio.camera.lookAt);
29063238 cameraView.object = group;
2907
- cameraView.lighttouched = true;
3239
+ //cameraView.lighttouched = true;
3240
+ Globals.lighttouched = true;
29083241 topView.object = group;
29093242 frontView.object = group;
29103243 sideView.object = group;
29113244 }
2912
- group.editWindow = this;
3245
+
3246
+// fix "+" issue
3247
+ //group.editWindow = this;
3248
+
29133249 /*
29143250 currentLayout = radio.layout;
29153251 if (currentLayout == null)
....@@ -2921,8 +3257,23 @@
29213257 //group.parent = null; // ROOT
29223258 //group.attributes = -1;
29233259 ResetModel();
3260
+
3261
+ cameraView.requestFocusInWindow();
29243262 refreshContents(true);
2925
- }
3263
+ } else if (event.getSource() == editCameraItem)
3264
+ {
3265
+ cameraView.ProtectCamera();
3266
+ cameraView.repaint();
3267
+ return;
3268
+ } else if (event.getSource() == revertCameraItem)
3269
+ {
3270
+ cameraView.RevertCamera();
3271
+ cameraView.repaint();
3272
+ return;
3273
+ // } else if (event.getSource() == textureButton)
3274
+ // {
3275
+ // return; // true;
3276
+ }
29263277 else
29273278 {
29283279 //return super.action(event, arg);
....@@ -2931,7 +3282,6 @@
29313282 }
29323283
29333284 boolean useclient = false;
2934
- cRadio radio;
29353285
29363286 void ToggleRoot()
29373287 {
....@@ -2940,7 +3290,7 @@
29403290 if (useclient)
29413291 {
29423292 cameraView.object = client;
2943
- cameraView.lighttouched = true;
3293
+ Globals.lighttouched = true;
29443294 //topView.object = client;
29453295 //frontView.object = client;
29463296 //sideView.object = client;
....@@ -2948,7 +3298,7 @@
29483298 else
29493299 {
29503300 cameraView.object = group;
2951
- cameraView.lighttouched = true;
3301
+ Globals.lighttouched = true;
29523302 //topView.object = group;
29533303 //frontView.object = group;
29543304 //sideView.object = group;
....@@ -2983,6 +3333,28 @@
29833333 refreshContents();
29843334 }
29853335
3336
+ void TransformChildren()
3337
+ {
3338
+ Object3D obj;
3339
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3340
+ {
3341
+ obj = (Object3D)e.nextElement();
3342
+ obj.KeepTextureMatrices();
3343
+ obj.TransformChildren();
3344
+ obj.RestoreTextureMatrices();
3345
+
3346
+// if (obj.parent == null)
3347
+// {
3348
+// System.out.println("NULL PARENT!");
3349
+// new Exception().printStackTrace();
3350
+// }
3351
+// else
3352
+// TouchTransform(obj);
3353
+// //obj.parent.Touch();
3354
+ }
3355
+
3356
+ refreshContents();
3357
+ }
29863358
29873359 void ResetTransform()
29883360 {
....@@ -3095,7 +3467,7 @@
30953467 refreshContents();
30963468 }
30973469
3098
- void ResetCentroid()
3470
+ void ResetCentroid(boolean full)
30993471 {
31003472 Object3D obj;
31013473 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3110,12 +3482,16 @@
31103482 LA.matIdentity(Object3D.mat);
31113483 obj.getBounds(minima, maxima, false);
31123484 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3113
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3485
+ if (full)
3486
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
31143487 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
31153488 obj.TransformMesh(Object3D.mat);
3489
+
31163490 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3117
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3491
+ if (full)
3492
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
31183493 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3494
+
31193495 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
31203496 //Object3D.mat[3][0] = -Object3D.mat[3][0];
31213497 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3144,7 +3520,8 @@
31443520
31453521 int size = obj.MemorySize();
31463522
3147
- System.err.println((size/1024) + " KB is the size of " + obj);
3523
+ //System.err.println((size/1024) + " KB is the size of " + obj);
3524
+ System.err.println("the size of " + obj + " is " + size + " (" + (size/1024) + "KB)");
31483525 }
31493526 }
31503527 catch (Exception e)
....@@ -3181,9 +3558,9 @@
31813558 obj = (Object3D)e.nextElement();
31823559
31833560 System.out.println("Object is: " + obj);
3184
- GrafreeD.AnalyzeObject(obj);
3561
+ Grafreed.AnalyzeObject(obj);
31853562 System.out.println("Boundary rep: " + obj.bRep);
3186
- GrafreeD.AnalyzeObject(obj.bRep);
3563
+ Grafreed.AnalyzeObject(obj.bRep);
31873564
31883565 // System.err.println((size/1024) + " KB is the size of " + obj);
31893566 }
....@@ -3225,6 +3602,13 @@
32253602 void GenNormals(boolean crease)
32263603 {
32273604 group.GenNormalsS(crease);
3605
+
3606
+ refreshContents();
3607
+ }
3608
+
3609
+ void GenNormalsMESH()
3610
+ {
3611
+ group.GenNormalsMeshS();
32283612
32293613 refreshContents();
32303614 }
....@@ -3397,8 +3781,8 @@
33973781
33983782 void ParseVertices()
33993783 {
3400
- boolean epsequal = GrafreeD.epsequal;
3401
- GrafreeD.epsequal = true;
3784
+ boolean epsequal = Grafreed.epsequal;
3785
+ Grafreed.epsequal = true;
34023786
34033787 for (int i=0; i<group.selection.size(); i++)
34043788 {
....@@ -3423,7 +3807,7 @@
34233807 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
34243808 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
34253809
3426
- g.add(GrafreeD.clipboard);
3810
+ g.add(Grafreed.clipboard);
34273811
34283812 buffer.add(g);
34293813 }
....@@ -3438,7 +3822,7 @@
34383822 makeSomething(buffer, i==group.selection.size()-1);
34393823 }
34403824
3441
- GrafreeD.epsequal = epsequal;
3825
+ Grafreed.epsequal = epsequal;
34423826
34433827 refreshContents();
34443828 }
....@@ -3456,7 +3840,16 @@
34563840 String pigment = Object3D.GetPigment(tex);
34573841 //String bump = Object3D.GetBump(tex);
34583842
3459
- com.sun.opengl.util.texture.TextureData texturedata = CameraPane.theRenderer.GetTextureData(pigment, false, node.texres);
3843
+ com.sun.opengl.util.texture.TextureData texturedata = null;
3844
+
3845
+ try
3846
+ {
3847
+ texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
3848
+ }
3849
+ catch (Exception e)
3850
+ {
3851
+ System.err.println("FAIL: " + node);
3852
+ }
34603853
34613854 double s = v.s;
34623855
....@@ -3544,11 +3937,11 @@
35443937
35453938 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
35463939
3547
- boolean random = CameraPane.RANDOM;
3548
- CameraPane.RANDOM = false; // parse all random nodes
3940
+ boolean random = CameraPane.SWITCH;
3941
+ CameraPane.SWITCH = false; // parse all random nodes
35493942 lowres.linkVerticesThis(null);
35503943 lowres.linkVerticesThis(sn);
3551
- CameraPane.RANDOM = random;
3944
+ CameraPane.SWITCH = random;
35523945
35533946 System.err.flush();
35543947
....@@ -3588,7 +3981,7 @@
35883981 return;
35893982
35903983 Object3D poses = group.selection.get(0);
3591
- Object3D ref = GrafreeD.clipboard.get(0);
3984
+ Object3D ref = Grafreed.clipboard.get(0);
35923985
35933986 Object3D newgroup = new Object3D("Po:" + poses.name);
35943987
....@@ -3757,7 +4150,7 @@
37574150 group.selection.RelinkToSupport(); // july 2014
37584151 System.out.println("DONE.");
37594152 refreshContents();
3760
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
4153
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
37614154 }
37624155
37634156 void ReduceMesh(boolean reduction34)
....@@ -3782,9 +4175,9 @@
37824175
37834176 void ClipMesh()
37844177 {
3785
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
4178
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
37864179 {
3787
- Object3D content = GrafreeD.clipboard.get(0);
4180
+ Object3D content = Grafreed.clipboard.get(0);
37884181
37894182 if (content instanceof cGroup && ((cGroup)content).transientlink )
37904183 content = ((cGroup)content).get(0);
....@@ -3793,7 +4186,7 @@
37934186 // {
37944187 // group.selection.get(i).ClipMesh(GrafreeD.clipboard);
37954188 // }
3796
- group.selection.ClipMesh(GrafreeD.clipboard);
4189
+ group.selection.ClipMesh(Grafreed.clipboard);
37974190 }
37984191 // group.selection.ClipMesh(GrafreeD.clipboard);
37994192 System.out.println("DONE.");
....@@ -3840,6 +4233,18 @@
38404233 void MarkLeaves(boolean hide)
38414234 {
38424235 group.selection.MarkLeaves(hide);
4236
+ refreshContents();
4237
+ }
4238
+
4239
+ void RewindLeaves(boolean hide)
4240
+ {
4241
+ group.selection.RewindLeaves(hide);
4242
+ refreshContents();
4243
+ }
4244
+
4245
+ void RandomLeaves(boolean hide)
4246
+ {
4247
+ group.selection.RandomLeaves(hide);
38434248 refreshContents();
38444249 }
38454250
....@@ -3928,7 +4333,7 @@
39284333 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
39294334
39304335 Object3D elem = (Object3D)group.selection.elementAt(i);
3931
- if(elem != group)
4336
+ if(elem != group || !newWindow)
39324337 {
39334338 // if (!(elem instanceof Composite))
39344339 // newWindow = false;
....@@ -4018,7 +4423,6 @@
40184423 //case 702: // Event.LIST_DESELECT
40194424 group.deselectAll();
40204425 TreePath tps[] = objEditor.jTree.getSelectionPaths();
4021
- objEditor.ClearInfo(); // .GetMaterial());
40224426 if (tps != null)
40234427 {
40244428 for (int i=0; i < tps.length; i++)
....@@ -4027,31 +4431,30 @@
40274431
40284432 //if (child.parent != null)
40294433 //child.parent.addSelectee(child);
4434
+ objEditor.SetMaterial(child);
40304435 group.addSelectee(child);
4031
- objEditor.SetMaterial(child); // .GetMaterial());
4032
- objEditor.AddInfo(child, this, true); // .GetMaterial());
4033
- System.err.println("info : " + child.GetPath());
40344436 }
40354437 }
4036
- else
4037
- {
4038
- objEditor.SetMaterial(group); // .GetMaterial());
4039
- objEditor.AddInfo(group, this, true); // .GetMaterial());
4040
- System.err.println("info : " + group.GetPath());
4041
- }
4438
+// else
4439
+// {
4440
+// objEditor.SetMaterial(group); // .GetMaterial());
4441
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4442
+// System.err.println("info : " + group.GetPath());
4443
+// }
40424444
4043
- objEditor.SetText(); // jan 2014
4044
-
4045
- if (flashIt && !CameraPane.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
4445
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(tps[0].getLastPathComponent() instanceof Camera))
40464446 CameraPane.flash = true;
40474447
4048
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
4448
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
40494449 // a camera
40504450 {
4051
- CameraPane.camerachangeframe = 0; // don't refuse it
4052
- CameraPane.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4053
- // CameraPane.theRenderer.renderCamera = CameraPane.theRenderer.manipCamera;
4054
- // CameraPane.theRenderer.eyeCamera = CameraPane.theRenderer.manipCamera;
4451
+ if (tps[0].getLastPathComponent() != Globals.theRenderer.LightCamera())
4452
+ {
4453
+ CameraPane.camerachangeframe = 0; // don't refuse it
4454
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4455
+ }
4456
+ // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
4457
+ // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
40554458 }
40564459
40574460 refreshContents();
....@@ -4062,6 +4465,26 @@
40624465
40634466 freezemodel = false;
40644467 }
4468
+
4469
+ void refreshContents(boolean cp)
4470
+ {
4471
+ if (!Globals.MOUSEDRAGGED)
4472
+ {
4473
+ objEditor.ClearInfo(); // .GetMaterial());
4474
+
4475
+ for (int i=0; i < group.selection.Size(); i++)
4476
+ {
4477
+ Object3D child = (Object3D) group.selection.get(i);
4478
+
4479
+ objEditor.AddInfo(child, this, true);
4480
+ System.err.println("info : " + child.GetPath());
4481
+ }
4482
+
4483
+ objEditor.SetText(); // jan 2014
4484
+ }
4485
+
4486
+ super.refreshContents(cp);
4487
+ }
40654488
40664489 void linkSomething(Object3D thing)
40674490 {
....@@ -4133,16 +4556,18 @@
41334556 {
41344557 if (group.selection.isEmpty())
41354558 return;
4136
- GrafreeD.clipboardIsTempGroup = false;
4559
+
4560
+ Grafreed.clipboardIsTempGroup = false;
41374561 Composite tGroup = null;
41384562 if (group.selection.size() > 0) // 1)
41394563 {
41404564 tGroup = new cGroup();
4141
- GrafreeD.clipboardIsTempGroup = true;
4565
+ Grafreed.clipboardIsTempGroup = true;
41424566 }
41434567
41444568 if (cut)
41454569 {
4570
+ Save();
41464571 //int indices[] = jList.getSelectedIndices();
41474572 //for (int i = indices.length - 1; i >= 0; i--)
41484573 //jList.remove(indices[i]);
....@@ -4178,16 +4603,16 @@
41784603 //System.out.println("cut " + child);
41794604 //System.out.println("parent = " + child.parent);
41804605 // tmp.addChild(child);
4181
- if (GrafreeD.clipboardIsTempGroup)
4606
+ if (Grafreed.clipboardIsTempGroup)
41824607 tGroup.add/*Child*/(tmp);
41834608 else
4184
- GrafreeD.clipboard = tmp;
4609
+ Grafreed.clipboard = tmp;
41854610 }
41864611 else
4187
- if (GrafreeD.clipboardIsTempGroup)
4612
+ if (Grafreed.clipboardIsTempGroup)
41884613 tGroup.add/*Child*/(child);
41894614 else
4190
- GrafreeD.clipboard = child;
4615
+ Grafreed.clipboard = child;
41914616 }
41924617
41934618 //ResetModel();
....@@ -4219,21 +4644,23 @@
42194644 //System.out.println("cut " + elem);
42204645 //System.out.println("parent = " + elem.parent);
42214646 // tmp.addChild(elem);
4222
- if (GrafreeD.clipboardIsTempGroup)
4647
+ if (Grafreed.clipboardIsTempGroup)
42234648 tGroup.add/*Child*/(tmp);
42244649 else
4225
- GrafreeD.clipboard = tmp;
4650
+ Grafreed.clipboard = tmp;
42264651 }
42274652 else
4228
- if (GrafreeD.clipboardIsTempGroup)
4653
+ if (Grafreed.clipboardIsTempGroup)
42294654 tGroup.add/*Child*/(child);
42304655 else
4231
- GrafreeD.clipboard = child;
4656
+ Grafreed.clipboard = child;
42324657 }
42334658
42344659 }
4235
- if (GrafreeD.clipboardIsTempGroup)
4236
- GrafreeD.clipboard = tGroup;
4660
+
4661
+ if (Grafreed.clipboardIsTempGroup)
4662
+ Grafreed.clipboard = tGroup;
4663
+
42374664 if (cut)
42384665 {
42394666 ResetModel();
....@@ -4247,7 +4674,7 @@
42474674 // return;
42484675 boolean first = true;
42494676
4250
- if (GrafreeD.clipboardIsTempGroup)
4677
+ if (Grafreed.clipboardIsTempGroup)
42514678 {
42524679 Composite temp;
42534680
....@@ -4258,7 +4685,7 @@
42584685 temp = (Composite)Applet3D.clipboard.deepCopy();
42594686 */
42604687 Object3D elem;
4261
- for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
4688
+ for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
42624689 {
42634690 Object3D child = (Object3D)e.nextElement();
42644691
....@@ -4292,21 +4719,21 @@
42924719 //Object3D cb = Applet3D.clipboard;
42934720 //temp.addChild(cb);
42944721 //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0));
4295
- assert(GrafreeD.clipboard.parent == null);
4296
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
4297
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
4298
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
4299
- makeSomething(expand?GrafreeD.clipboard.get(0).copyExpand():GrafreeD.clipboard.get(0).deepCopy());
4722
+ assert(Grafreed.clipboard.parent == null);
4723
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
4724
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
4725
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
4726
+ makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy());
43004727 else
4301
- makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4302
- GrafreeD.clipboard.get(0).parent = keepparent;
4728
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
4729
+ Grafreed.clipboard.get(0).parent = keepparent;
43034730 }
43044731
43054732 ResetModel();
43064733 refreshContents();
43074734 }
43084735
4309
- void pasteInto(boolean copyit)
4736
+ void pasteInto(boolean copyit, boolean clone)
43104737 {
43114738 // if (GrafreeD.clipboard == null)
43124739 // return;
....@@ -4335,15 +4762,22 @@
43354762 if (copyit)
43364763 {
43374764 // paste(false);
4338
- CloneClipboard(false); // sept 2014
4765
+ if (clone)
4766
+ {
4767
+ CloneClipboard(false); // sept 2014
4768
+ }
4769
+ else
4770
+ {
4771
+ paste(false);
4772
+ }
43394773 }
43404774 else
43414775 {
43424776 boolean first = true;
43434777
4344
- if (GrafreeD.clipboardIsTempGroup)
4778
+ if (Grafreed.clipboardIsTempGroup)
43454779 {
4346
- Composite temp = (Composite)GrafreeD.clipboard;
4780
+ Composite temp = (Composite)Grafreed.clipboard;
43474781 Object3D copy;
43484782 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
43494783 {
....@@ -4353,7 +4787,7 @@
43534787 }
43544788 } else
43554789 {
4356
- linkSomething(GrafreeD.clipboard); //.get(0));
4790
+ linkSomething(Grafreed.clipboard); //.get(0));
43574791 }
43584792 }
43594793 }
....@@ -4758,21 +5192,6 @@
47585192 }
47595193 */
47605194
4761
- void ImportGFD()
4762
- {
4763
- FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD);
4764
- browser.show();
4765
- String filename = browser.getFile();
4766
- if (filename != null && filename.length() > 0)
4767
- {
4768
- String fullname = browser.getDirectory() + filename;
4769
-
4770
- //Object3D readobj =
4771
- objEditor.ReadGFD(fullname, objEditor);
4772
- //makeSomething(readobj);
4773
- }
4774
- }
4775
-
47765195 /*
47775196 public void Callback(Object obj)
47785197 {
....@@ -4796,26 +5215,9 @@
47965215 }
47975216 */
47985217
4799
- void ImportVRMLX3D()
4800
- {
4801
- if (GrafreeD.standAlone)
4802
- {
4803
- /**/
4804
- FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
4805
- browser.show();
4806
- String filename = browser.getFile();
4807
- if (filename != null && filename.length() > 0)
4808
- {
4809
- String fullname = browser.getDirectory() + filename;
4810
- LoadVRMLX3D(fullname);
4811
- }
4812
- /**/
4813
- }
4814
- }
4815
-
48165218 String GetFile(String dialogName)
48175219 {
4818
- if (GrafreeD.standAlone)
5220
+ if (Grafreed.standAlone)
48195221 {
48205222 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
48215223 browser.show();
....@@ -4879,10 +5281,18 @@
48795281 cButton flashSelectionButton;
48805282 cButton editButton;
48815283 cButton uneditButton;
5284
+ JCheckBox allParamsButton;
48825285 cButton clearpanelButton;
4883
- cButton allParamsButton;
48845286 cButton unselectButton;
48855287
5288
+ cButton minButton;
5289
+ cButton maxButton;
5290
+ cButton fullButton;
5291
+ cButton undoButton;
5292
+ cButton redoButton;
5293
+ cButton saveButton;
5294
+ cButton oneStepButton;
5295
+
48865296 cButton screenfitButton;
48875297 cButton screenfitpointButton;
48885298 cButton snapobjectButton;
....@@ -4893,14 +5303,6 @@
48935303 cButton closeButton;
48945304
48955305 cButton setsupportButton;
4896
-
4897
- cButton twoButton;
4898
- cButton sixButton;
4899
- cButton threeButton;
4900
- cButton sevenButton;
4901
- cButton fourButton; // full panel
4902
- cButton oneButton; // full XYZ
4903
- //cButton currentLayout;
49045306
49055307 //
49065308 //Composite
....@@ -4913,6 +5315,8 @@
49135315 private MenuItem lookFromItem;
49145316 private MenuItem switchItem;
49155317 private MenuItem cutItem;
5318
+ private MenuItem undoItem;
5319
+ private MenuItem redoItem;
49165320 private MenuItem duplicateItem;
49175321 private MenuItem cloneItem;
49185322 private MenuItem cloneSupportItem;
....@@ -4926,7 +5330,7 @@
49265330 private MenuItem linkverticesItem;
49275331 private MenuItem relinkverticesItem;
49285332 private MenuItem setMasterItem;
4929
- private MenuItem resetMeshItem;
5333
+ private MenuItem resetAllItem;
49305334 private MenuItem stepAllItem;
49315335 private MenuItem revertMeshItem;
49325336 private MenuItem poseMeshItem;
....@@ -4937,6 +5341,7 @@
49375341 private MenuItem mergeGeometriesItem;
49385342 private MenuItem copyItem;
49395343 private MenuItem pasteItem;
5344
+ private MenuItem pasteIntoItem;
49405345 private MenuItem pasteLinkItem;
49415346 private MenuItem pasteCloneItem;
49425347 private MenuItem pasteExpandItem;
....@@ -4975,6 +5380,10 @@
49755380 private MenuItem showleavesItem;
49765381 private MenuItem markleavesItem;
49775382 private MenuItem unmarkleavesItem;
5383
+ private MenuItem rewindleavesItem;
5384
+ private MenuItem unrewindleavesItem;
5385
+ private MenuItem randomleavesItem;
5386
+ private MenuItem unrandomleavesItem;
49785387
49795388 private MenuItem flipVItem;
49805389 private MenuItem unflipVItem;
....@@ -4986,8 +5395,10 @@
49865395 private MenuItem panoTexturesItem;
49875396
49885397 private MenuItem resetCentroidItem;
4989
- private MenuItem transformgeometryItem;
5398
+ private MenuItem resetCentroidXZItem;
49905399 private MenuItem resetTransformItem;
5400
+ private MenuItem transformGeometryItem;
5401
+ private MenuItem transformChildrenItem;
49915402 private MenuItem hideItem;
49925403 private MenuItem grabItem;
49935404 private MenuItem backItem;
....@@ -5009,6 +5420,7 @@
50095420
50105421 private MenuItem resetParentItem;
50115422 private MenuItem repairParentItem;
5423
+ private MenuItem repairShadowItem;
50125424 private MenuItem sortbysizeItem;
50135425 private MenuItem sortbynameItem;
50145426
....@@ -5033,7 +5445,7 @@
50335445 private MenuItem blobItem;
50345446 private MenuItem latheItem;
50355447 private MenuItem bezierItem;
5036
- private MenuItem checkerItem;
5448
+ private MenuItem overlayItem;
50375449 private MenuItem meshItem;
50385450 // private MenuItem meshGroupItem;
50395451 private MenuItem springItem;
....@@ -5055,11 +5467,6 @@
50555467 private MenuItem doubleItem;
50565468 private MenuItem tripleItem;
50575469
5058
- private MenuItem importGFDItem;
5059
- private MenuItem importVRMLX3DItem;
5060
- private MenuItem import3DSItem;
5061
- private MenuItem importOBJItem;
5062
-
50635470 private MenuItem computeAOItem;
50645471 private MenuItem recompileItem;
50655472 private MenuItem editScriptItem;
....@@ -5069,4 +5476,8 @@
50695476 private MenuItem analyzeItem;
50705477 private MenuItem dumpItem;
50715478 //boolean freezemodel = false;
5479
+
5480
+ Menu cameraMenu;
5481
+ MenuItem editCameraItem;
5482
+ MenuItem revertCameraItem;
50725483 }