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,150 +574,120 @@
433574 oe.radioPanel.add(dummyButton);
434575 oe.buttonGroup.add(dummyButton);
435576 */
436
- aConstraints.gridy += 1;
437
- oe.aConstraints.gridwidth = 1;
438
- oe.aConstraints.gridx = 0;
577
+ //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
439578
440
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", CameraPane.isLIVE()), oe.aConstraints);
579
+ //oe.toolbarPanel.add(minButton = new cButton("Min", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
580
+ //minButton.setToolTipText("Minimize window");
581
+ //minButton.addActionListener(this);
582
+
583
+ oe.toolbarPanel.add(maxButton = new cButton("\u271A", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
584
+ maxButton.setToolTipText("Maximize window");
585
+ maxButton.addActionListener(this);
586
+
587
+ oe.toolbarPanel.add(fullButton = new cButton("\u2b1c", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
588
+ fullButton.setToolTipText("Full-screen window");
589
+ fullButton.addActionListener(this);
590
+
591
+ oe.toolbarPanel.add(undoButton = new cButton("\u21a9", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
592
+ undoButton.setToolTipText("Undo changes");
593
+ undoButton.addActionListener(this);
594
+
595
+ oe.toolbarPanel.add(redoButton = new cButton("\u21aa", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
596
+ redoButton.setToolTipText("Redo changes");
597
+ redoButton.addActionListener(this);
598
+
599
+ oe.toolbarPanel.add(saveButton = new cButton("\u21e3", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
600
+ saveButton.setToolTipText("Save changes");
601
+ saveButton.addActionListener(this);
602
+
603
+ oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints);
604
+ liveCB.setToolTipText("Enable animation");
441605 liveCB.addItemListener(this);
442606
443
- oe.aConstraints.gridx += 1;
444
- oe.toolbarPanel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT), oe.aConstraints);
445
- supportCB.addItemListener(this);
446
-
447
- // oe.aConstraints.gridx += 1;
448
- // oe.toolbarPanel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), oe.aConstraints);
449
- // localCB.addItemListener(this);
450
-
451
- oe.aConstraints.gridx += 1;
452
- oe.toolbarPanel.add(crowdCB = new cCheckBox("Crowd", CameraPane.CROWD), oe.aConstraints);
453
- crowdCB.addItemListener(this);
454
-
455
- oe.aConstraints.gridx += 1;
456
- oe.toolbarPanel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA), oe.aConstraints);
457
- smoothCB.addItemListener(this);
458
-
459
- oe.aConstraints.gridx += 1;
460
- oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST), oe.aConstraints);
607
+ oe.toolbarPanel.add(oneStepButton = new cButton("\u29f4", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
608
+ oneStepButton.setToolTipText("Animate one step forward");
609
+ oneStepButton.addActionListener(this);
610
+
611
+ oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints);
612
+ fastCB.setToolTipText("Fast mode");
461613 fastCB.addItemListener(this);
462
- oe.aConstraints.gridx += 1;
463
- oe.toolbarPanel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE), oe.aConstraints);
464
- slowCB.addItemListener(this);
465
- oe.aConstraints.gridx += 1;
466
- oe.toolbarPanel.add(boxCB = new cCheckBox("Box", CameraPane.FAST), oe.aConstraints);
467
- boxCB.addItemListener(this);
468
-
469
-// oe.aConstraints.gridx += 1;
470
-// oe.toolbarPanel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), oe.aConstraints);
471
-// speakerMocapCB.addItemListener(this);
472
-
473
- if (false)
474
- {
475
- // handled in scripts
476
- oe.aConstraints.gridx += 1;
477
- oe.toolbarPanel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA), oe.aConstraints);
478
- speakerCameraCB.addItemListener(this);
479
-
480
- oe.aConstraints.gridx += 1;
481
- oe.toolbarPanel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS), oe.aConstraints);
482
- speakerFocusCB.addItemListener(this);
483
-
484
- oe.aConstraints.gridx += 1;
485
- oe.toolbarPanel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS), oe.aConstraints);
486
- smoothfocusCB.addItemListener(this);
487
- }
488
-
489
-//oe.aConstraints.gridx += 1;
490
-//oe.toolbarPanel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), oe.aConstraints);
491
-// debugCB.addItemListener(this);
492
-
493
- oe.aConstraints.gridx += 1;
494
- oe.toolbarPanel.add(oeilCB = new cCheckBox("O", CameraPane.OEIL), oe.aConstraints);
495
- oeilCB.addItemListener(this);
496
-
497
- oe.aConstraints.gridx += 1;
498
- oe.toolbarPanel.add(lookAtCB = new cCheckBox("T", CameraPane.LOOKAT), oe.aConstraints);
499
- lookAtCB.addItemListener(this);
500
-
501
- oe.aConstraints.gridx += 1;
502
- oe.toolbarPanel.add(trackCB = new cCheckBox(":", CameraPane.TRACK), oe.aConstraints);
614
+
615
+ oe.toolbarPanel.add(trackCB = new cCheckBox(":", CameraPane.TRACK)); //, oe.aConstraints);
616
+ trackCB.setToolTipText("Enable tracking");
503617 trackCB.addItemListener(this);
504618
505
- oe.aConstraints.gridx += 1;
506
- oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
619
+ oe.toolbarPanel.add(screenfitButton = new cButton("@", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
620
+ screenfitButton.setToolTipText("Screen fit");
507621 screenfitButton.addActionListener(this);
508
- oe.aConstraints.gridx += 1;
622
+
509623 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
510624 // screenfitpointButton.addActionListener(this);
511
-// oe.aConstraints.gridx += 1;
512
- oe.toolbarPanel.add(snapobjectButton = new cButton(" O+ ")); //, oe.aConstraints);
513
- snapobjectButton.addActionListener(this);
514
- oe.aConstraints.gridx += 1;
515625
516
- //aConstraints.gridx = 0;
517
- //aConstraints.gridy += 1;
518
- oe.aConstraints.weighty = 0;
519
- oe.aConstraints.gridwidth = 1;
520
-
521
- oe.toolbarPanel.add(flashSelectionButton = new cButton(" ? ")); //, oe.aConstraints);
626
+ if (Globals.ADVANCED)
627
+ {
628
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
629
+ snapobjectButton.addActionListener(this);
630
+ snapobjectButton.setToolTipText("Snap Object");
631
+ }
632
+
633
+ oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
634
+ flashSelectionButton.setToolTipText("Show selection");
522635 flashSelectionButton.addActionListener(this);
523
- oe.aConstraints.gridx += 1;
524
- oe.aConstraints.weighty = 0;
525
- oe.aConstraints.gridwidth = 1;
526636
527
- //
528
- oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints);
637
+ oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
638
+
639
+ oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
640
+ twoButton.setToolTipText("Show center view only");
529641 twoButton.addActionListener(this);
530
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
642
+ oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
531643 fourButton.addActionListener(this);
532
- oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
644
+ fourButton.setToolTipText("Show left panel only");
645
+ oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
646
+ sixButton.setToolTipText("2-column layout left");
533647 sixButton.addActionListener(this);
534
- oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
648
+ oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
649
+ threeButton.setToolTipText("2-column layout right");
535650 threeButton.addActionListener(this);
536
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
651
+ oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
652
+ sevenButton.setToolTipText("3-column layout");
537653 sevenButton.addActionListener(this);
538654 //
539655
540
- oe.toolbarPanel.add(rootButton = new cButton(" o o o E ")); //, oe.aConstraints);
656
+ oe.toolbarPanel.add(rootButton = new cButton("o o o", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
657
+ rootButton.setToolTipText("Edit selection in new tab");
541658 rootButton.addActionListener(this);
542
- oe.aConstraints.gridx += 1;
543
- oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
659
+
660
+ oe.toolbarPanel.add(closeButton = new cButton("X", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
661
+ closeButton.setToolTipText("Close tab");
544662 closeButton.addActionListener(this);
545663 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
546664 //clearButton.addActionListener(this);
547
- oe.aConstraints.gridx += 1;
548665
549
- oe.aConstraints.gridx = 1; //
550
- oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints);
666
+ editCommandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
667
+ editButton.setToolTipText("Edit selection");
551668 editButton.addActionListener(this);
552
- oe.aConstraints.gridx += 1;
553
- oe.aConstraints.weighty = 0;
554
- oe.aConstraints.gridwidth = 1;
555669
556
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
670
+ editCommandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
671
+ uneditButton.setToolTipText("Unedit selection");
557672 uneditButton.addActionListener(this);
558673
559
- oe.aConstraints.gridx += 1;
560
- oe.aConstraints.weighty = 0;
561
- oe.aConstraints.gridwidth = 1;
562
-
563
- oe.treePanel.add(clearPanelButton = new cButton("C"), oe.aConstraints);
564
- clearPanelButton.addActionListener(this);
565
-
566
- oe.aConstraints.gridx += 1;
567
- oe.aConstraints.weighty = 0;
568
- oe.aConstraints.gridwidth = 1;
569
-
570
- oe.treePanel.add(allParamsButton = new cButton("A"), oe.aConstraints);
674
+ editCommandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
675
+ allParamsButton.setToolTipText("Edit all params");
571676 allParamsButton.addActionListener(this);
572677
573
- oe.aConstraints.gridx += 1;
574
- oe.aConstraints.weighty = 0;
575
- oe.aConstraints.gridwidth = 1;
576
-
577
- oe.treePanel.add(unselectButton = new cButton("U"), oe.aConstraints);
678
+ editCommandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
679
+ clearPanelButton.setToolTipText("Clear edit panel");
680
+ clearPanelButton.addActionListener(this);
681
+
682
+ editCommandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
683
+ unselectButton.setToolTipText("Unselect");
578684 unselectButton.addActionListener(this);
579685
686
+ editCommandsPanel.preferredHeight = 1;
687
+
688
+// oe.treePanel.add(commandsPanel);
689
+// oe.treePanel.Return();
690
+
580691 // oe.aConstraints.gridx += 1;
581692 // oe.aConstraints.weighty = 0;
582693 // oe.aConstraints.gridwidth = 1;
....@@ -588,40 +699,37 @@
588699 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
589700 // gcButton.addActionListener(this);
590701
591
- oe.aConstraints.gridx = 0;
592
- oe.aConstraints.gridy += 1;
593
-
594
- //ctrlPanel.add(objList = new List(5, true));
595
- oe.aConstraints.gridwidth = 100;
596
- // oe.aConstraints.gridheight = 100;
597
- oe.aConstraints.fill = GridBagConstraints.BOTH; // HORIZONTAL;
598
- oe.aConstraints.gridheight = 1;
599
- oe.aConstraints.weighty = 0.5;
600
- oe.aConstraints.gridx = 0;
601
- JScrollPane jSP;
702
+ cGridBag jSPPanel = new cGridBag();
703
+
704
+ JScrollPane jSP;
602705 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
603
- oe.treePanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null)), oe.aConstraints);
706
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints);
604707 ResetModel();
605
- oe.aConstraints.weighty = 0.5;
606
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
607
- oe.aConstraints.gridy += 1;
608
- oe.aConstraints.gridwidth = 1;
708
+
709
+ oe.treePanel.add(jSPPanel);
710
+ oe.treePanel.Return();
609711
610
- oe.aConstraints.weighty = 0;
611
- oe.aConstraints.gridwidth = 2;
612
-
613
- oe.treePanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0), oe.aConstraints);
712
+ cGridBag copyOptionsPanel = new cGridBag();
713
+
714
+ copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
715
+ colorCB.setToolTipText("Copy color when dropped");
614716 colorCB.addItemListener(this);
615
- oe.aConstraints.gridx += 2;
616
- oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints);
717
+
718
+ copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
719
+ materialCB.setToolTipText("Copy material when dropped");
617720 materialCB.addItemListener(this);
618
- oe.aConstraints.gridx += 2;
619
- oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints);
721
+
722
+ copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
723
+ textureCB.setToolTipText("Copy texture when dropped");
620724 textureCB.addItemListener(this);
621725
622
- oe.aConstraints.gridx = 0;
623
- oe.aConstraints.gridy += 1;
726
+ copyOptionsPanel.preferredHeight = 1;
727
+ oe.treePanel.add(copyOptionsPanel);
728
+ oe.treePanel.Return();
624729
730
+// mainPanel.setDividerLocation(0.5); //1.0);
731
+// mainPanel.setResizeWeight(0.5);
732
+
625733 //jList.addListSelectionListener(this);
626734 oe.jTree.addTreeSelectionListener(this);
627735 //jTree.setRootVisible(false);
....@@ -643,20 +751,95 @@
643751 radio.layout = sevenButton;
644752 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
645753 }
754
+
755
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
756
+ {
757
+ panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
758
+ boxCB.setToolTipText("Display bounding boxes");
759
+ boxCB.addItemListener(this);
760
+
761
+ panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
762
+ zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
763
+ zoomBoxCB.addItemListener(this);
764
+
765
+ if (true) // Globals.ADVANCED)
766
+ {
767
+ panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
768
+ supportCB.setToolTipText("Enable rigging");
769
+ supportCB.addItemListener(this);
770
+
771
+ // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
772
+ // localCB.addItemListener(this);
773
+
774
+ panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
775
+ crowdCB.setToolTipText("Used for crowds");
776
+ crowdCB.addItemListener(this);
777
+
778
+ panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
779
+ smoothCB.setToolTipText("Snapping delay");
780
+ smoothCB.addItemListener(this);
781
+
782
+ panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
783
+ slowCB.setToolTipText("Smooth interpolation");
784
+ slowCB.addItemListener(this);
785
+
786
+// constraints.gridy += 1;
787
+// panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
788
+// speakerMocapCB.addItemListener(this);
789
+
790
+ if (false)
791
+ {
792
+ // handled in scripts
793
+ //constraints.gridy += 1;
794
+ panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints);
795
+ speakerCameraCB.addItemListener(this);
796
+
797
+ //constraints.gridy += 1;
798
+ panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints);
799
+ speakerFocusCB.addItemListener(this);
800
+
801
+ //constraints.gridy += 1;
802
+ panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
803
+ smoothfocusCB.addItemListener(this);
804
+ }
805
+
806
+//constraints.gridx += 1;
807
+//panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
808
+// debugCB.addItemListener(this);
809
+
810
+ panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
811
+ oeilCB.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
+ }
646826
647827 void EditObject(Object3D obj)
648828 {
649
- cRadio dummyButton = new cRadio(obj.name);
650
- dummyButton.SetObject(obj);
651
- dummyButton.layout = sevenButton;
652
- dummyButton.SetCamera(cameraView.renderCamera, false);
653
- dummyButton.addActionListener(this);
654
- radioPanel.add(dummyButton);
655
- buttonGroup.add(dummyButton);
656
- dummyButton.doClick();
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();
657837 }
838
+
658839 void SetupViews(ObjEditor oe)
659840 {
841
+ theFrame = this;
842
+
660843 oe.SetupViews();
661844
662845 System.out.println("SetupViews");
....@@ -673,6 +856,7 @@
673856 JCheckBox fastCB;
674857 JCheckBox slowCB;
675858 JCheckBox boxCB;
859
+ JCheckBox zoomBoxCB;
676860 JCheckBox trackCB;
677861 JCheckBox smoothfocusCB;
678862 // JCheckBox speakerMocapCB;
....@@ -715,10 +899,10 @@
715899 dropAttributes |= Object3D.TEXTURE;
716900 else
717901 dropAttributes &= ~Object3D.TEXTURE;
718
- }
719
- else if(e.getSource() == liveCB)
902
+ } else if(e.getSource() == liveCB)
720903 {
721904 cameraView.ToggleLive();
905
+ refreshContents(false);
722906 }
723907 else if(e.getSource() == supportCB)
724908 {
....@@ -753,6 +937,10 @@
753937 Recompile();
754938 cameraView.repaint();
755939 // refreshContents();
940
+ }
941
+ else if(e.getSource() == zoomBoxCB)
942
+ {
943
+ cameraView.ToggleZoomBoxMode();
756944 }
757945 else if(e.getSource() == smoothfocusCB)
758946 {
....@@ -867,7 +1055,9 @@
8671055 // objEditor.DropFile((java.io.File[]) object, true);
8681056 // return;
8691057 // }
870
- if (string.charAt(0) == '/')
1058
+
1059
+ // File path for Mac and Windows
1060
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
8711061 {
8721062 // file(s)
8731063 String[] names = string.split("\n");
....@@ -894,7 +1084,7 @@
8941084
8951085 flashIt = false;
8961086 CameraPane pane = (CameraPane) target;
897
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1087
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
8981088 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
8991089
9001090 if (group.selection.size() == 1)
....@@ -921,11 +1111,11 @@
9211111 {
9221112 loadClipboard(true);
9231113 objEditor.jTree.setSelectionPath(destinationPath);
924
- pasteInto(false);
1114
+ pasteInto(false, false);
9251115 } else {
9261116 loadClipboard(false);
9271117 objEditor.jTree.setSelectionPath(destinationPath);
928
- pasteInto(false); // true); // ???
1118
+ pasteInto(false, false); // true); // ???
9291119 }
9301120 }
9311121 public void dropActionChanged(DropTargetDragEvent dtde)
....@@ -1047,27 +1237,33 @@
10471237 kleinItem.addActionListener(this);
10481238 particleItem = menu.add(new MenuItem("Particle system"));
10491239 particleItem.addActionListener(this);
1240
+ if (Globals.ADVANCED)
1241
+ {
10501242 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10511243 ragdollItem.addActionListener(this);
10521244 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10531245 ragdoll2Item.addActionListener(this);
1246
+ }
10541247 menu.add("-");
1055
- meshItem = menu.add(new MenuItem("Mesh"));
1248
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10561249 meshItem.addActionListener(this);
10571250 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10581251 // meshGroupItem.addActionListener(this);
1252
+ if (Globals.ADVANCED)
1253
+ {
10591254 springItem = menu.add(new MenuItem("Spring"));
10601255 springItem.addActionListener(this);
10611256 flagItem = menu.add(new MenuItem("Flag"));
10621257 flagItem.addActionListener(this);
1063
- bezierItem = menu.add(new MenuItem("Patch"));
1064
- bezierItem.addActionListener(this);
1065
- checkerItem = menu.add(new MenuItem("Checker"));
1066
- checkerItem.addActionListener(this);
10671258 blobItem = menu.add(new MenuItem("Blob"));
10681259 blobItem.addActionListener(this);
10691260 latheItem = menu.add(new MenuItem("Lathe"));
10701261 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);
10711267 lightItem = menu.add(new MenuItem("Light"));
10721268 lightItem.addActionListener(this);
10731269 menu.add("-");
....@@ -1077,39 +1273,44 @@
10771273 loopItem.addActionListener(this);
10781274 doubleItem = menu.add(new MenuItem("Fork"));
10791275 doubleItem.addActionListener(this);
1276
+ if (Globals.ADVANCED)
1277
+ {
10801278 tripleItem = menu.add(new MenuItem("Trident"));
10811279 tripleItem.addActionListener(this);
1280
+ }
10821281 }
10831282
10841283 void buildToolsMenu(Menu menu)
10851284 {
10861285 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
10871286 animationItem.addItemListener(this);
1088
- animationItem.setState(CameraPane.ANIMATION);
1287
+ animationItem.setState(Globals.ANIMATION);
10891288
10901289 menu.add("-");
10911290 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
10921291 parseverticesItem.addActionListener(this);
10931292 textureFieldItem = menu.add(new MenuItem("Texture Field"));
10941293 textureFieldItem.addActionListener(this);
1095
- alignItem = menu.add(new MenuItem("Align"));
1294
+ alignItem = menu.add(new MenuItem("Align Objects"));
10961295 alignItem.addActionListener(this);
1097
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1098
- mirrorItem.addActionListener(this);
10991296 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
11001297 reduceMorphItem.addActionListener(this);
11011298 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
11021299 reduce34MorphItem.addActionListener(this);
1103
-
1300
+ menu.add("-");
11041301 menu.add(computeAOItem = new MenuItem("Compute AO"));
11051302 computeAOItem.addActionListener(this);
1106
- menu.add("-");
11071303
1304
+ if (Globals.ADVANCED)
1305
+ {
1306
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1307
+ mirrorItem.addActionListener(this);
1308
+ menu.add("-");
11081309 menu.add(memoryItem = new MenuItem("Memory Usage"));
11091310 memoryItem.addActionListener(this);
11101311 menu.add(analyzeItem = new MenuItem("Analyze"));
11111312 analyzeItem.addActionListener(this);
1112
- menu.add(dumpItem = new MenuItem("Dump"));
1313
+ menu.add(dumpItem = new MenuItem("Print"));
11131314 dumpItem.addActionListener(this);
11141315 // menu.add(pathItem = new MenuItem("From-to path"));
11151316 // pathItem.addActionListener(this);
....@@ -1118,6 +1319,8 @@
11181319 resetParentItem.addActionListener(this);
11191320 repairParentItem = menu.add(new MenuItem("Repair Parent"));
11201321 repairParentItem.addActionListener(this);
1322
+ repairShadowItem = menu.add(new MenuItem("Repair Shadow"));
1323
+ repairShadowItem.addActionListener(this);
11211324 menu.add(invariantsItem = new MenuItem("Invariants"));
11221325 invariantsItem.addActionListener(this);
11231326 menu.add(recompileItem = new MenuItem("Recompile"));
....@@ -1125,6 +1328,7 @@
11251328 menu.add("-");
11261329 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11271330 editScriptItem.addActionListener(this);
1331
+ }
11281332 }
11291333
11301334 void ScreenFit()
....@@ -1247,6 +1451,7 @@
12471451 shadow.material = new cMaterial(obj.material);
12481452 shadow.material.diffuse = 0.0001f;
12491453 shadow.material.specular = 0.0001f;
1454
+ //shadow.projectedVertices[1].x = 300;
12501455
12511456 makeSomething(shadow);
12521457 }
....@@ -1453,9 +1658,9 @@
14531658
14541659 void Overwrite(int mask)
14551660 {
1456
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
1661
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14571662 {
1458
- Object3D content = GrafreeD.clipboard.get(0);
1663
+ Object3D content = Grafreed.clipboard.get(0);
14591664
14601665 if (content instanceof cGroup && ((cGroup)content).transientlink )
14611666 content = ((cGroup)content).get(0);
....@@ -1478,6 +1683,7 @@
14781683 //
14791684 public void actionPerformed(ActionEvent event) // , Object arg)
14801685 {
1686
+ Object source = event.getSource();
14811687 /*
14821688 if (event.getSource() == nameField)
14831689 {
....@@ -1489,11 +1695,11 @@
14891695 }
14901696 else
14911697 */
1492
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1698
+ if (source == lookAtItem || source == lookFromItem)
14931699 {
14941700 ScreenFit();
14951701 } else
1496
- if (event.getSource() == switchItem)
1702
+ if (source == switchItem)
14971703 {
14981704 cVector v1 = new cVector();
14991705 cVector v2 = new cVector();
....@@ -1502,11 +1708,11 @@
15021708 objEditor.cameraView.renderCamera.setAim(v2, v1);
15031709 objEditor.cameraView.repaint();
15041710 } else
1505
- if (event.getSource() == rectoidItem)
1711
+ if (source == rectoidItem)
15061712 {
15071713 makeSomething(new Box());
15081714 } else
1509
- if (event.getSource() == particleItem)
1715
+ if (source == particleItem)
15101716 {
15111717 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15121718 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1527,9 +1733,9 @@
15271733 applyExample(particleGeom, "SMOKE");
15281734 makeSomething(particleGeom);
15291735 } else
1530
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1736
+ if (source == ragdollItem || source == ragdoll2Item)
15311737 {
1532
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1738
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15331739
15341740 ragdoll.toParent = LA.newMatrix();
15351741 ragdoll.fromParent = LA.newMatrix();
....@@ -1547,7 +1753,7 @@
15471753 } else
15481754 /*
15491755 */
1550
- if (event.getSource() == heightFieldItem)
1756
+ if (source == heightFieldItem)
15511757 {
15521758 Object3D obj = new Object3D();
15531759
....@@ -1585,31 +1791,31 @@
15851791
15861792 makeSomething(obj);
15871793 } else
1588
- if (event.getSource() == gridItem)
1794
+ if (source == gridItem)
15891795 {
15901796 makeSomething(new Grid());
15911797 } else
1592
- if (event.getSource() == ellipsoidItem)
1798
+ if (source == ellipsoidItem)
15931799 {
15941800 makeSomething(new Sphere());
15951801 } else
1596
- if (event.getSource() == coneItem)
1802
+ if (source == coneItem)
15971803 {
15981804 makeSomething(new Cone());
15991805 } else
1600
- if (event.getSource() == torusItem)
1806
+ if (source == torusItem)
16011807 {
16021808 makeSomething(new Torus());
16031809 } else
1604
- if (event.getSource() == superItem)
1810
+ if (source == superItem)
16051811 {
16061812 makeSomething(new Superellipsoid());
16071813 } else
1608
- if (event.getSource() == kleinItem)
1814
+ if (source == kleinItem)
16091815 {
16101816 makeSomething(new Klein());
16111817 } else
1612
- if (event.getSource() == blobItem)
1818
+ if (source == blobItem)
16131819 {
16141820 Blob blob = new Blob();
16151821 BlobComponent comp = new BlobComponent();
....@@ -1617,15 +1823,15 @@
16171823 //blob.retile();
16181824 makeSomething(blob);
16191825 } else
1620
- if (event.getSource() == latheItem)
1826
+ if (source == latheItem)
16211827 {
16221828 makeSomething(new Lathe());
16231829 } else
1624
- if (event.getSource() == bezierItem)
1830
+ if (source == bezierItem)
16251831 {
16261832 makeSomething(new BezierSurface());
16271833 } else
1628
- if (event.getSource() == checkerItem)
1834
+ if (source == overlayItem)
16291835 {
16301836 /*
16311837 Object3D obj = new BezierSurface(5,8);
....@@ -1640,7 +1846,7 @@
16401846 */
16411847 makeSomething(new Checker());
16421848 } else
1643
- if (event.getSource() == meshItem)
1849
+ if (source == meshItem)
16441850 {
16451851 Object3D itemtomake = new Object3D();
16461852 Object3D child;
....@@ -1661,35 +1867,35 @@
16611867 makeSomething(child);
16621868 }
16631869 } else
1664
- if (event.getSource() == springItem)
1870
+ if (source == springItem)
16651871 {
16661872 cSpring s = new cSpring();
16671873 s.setup();
16681874 makeSomething(s);
16691875 } else
1670
- if (event.getSource() == flagItem)
1876
+ if (source == flagItem)
16711877 {
16721878 cSpring s = new cFlag();
16731879 s.setup();
16741880 makeSomething(s);
16751881 } else
1676
- if (event.getSource() == lightItem)
1882
+ if (source == lightItem)
16771883 {
16781884 makeSomething(new Light());
16791885 } else
1680
- if (event.getSource() == csgItem)
1886
+ if (source == csgItem)
16811887 {
16821888 group(new CSG());
16831889 } else
1684
- if (event.getSource() == templateItem)
1890
+ if (source == templateItem)
16851891 {
16861892 group(new cTemplate());
16871893 } else
1688
- if (event.getSource() == attributeItem)
1894
+ if (source == attributeItem)
16891895 {
16901896 makeSomething(new Attribute());
16911897 } else
1692
- if (event.getSource() == pointflowItem)
1898
+ if (source == pointflowItem)
16931899 {
16941900 makeSomething(new PointFlow());
16951901 } else
....@@ -1701,7 +1907,7 @@
17011907 } else
17021908 */
17031909
1704
- if (event.getSource() == superLoopItem)
1910
+ if (source == superLoopItem)
17051911 {
17061912 Composite g = new cGroup();
17071913 for (int i=0; i<15; i++)
....@@ -1723,7 +1929,7 @@
17231929
17241930 group(g);
17251931 } else
1726
- if (event.getSource() == loopItem)
1932
+ if (source == loopItem)
17271933 {
17281934 Composite csg = new GroupLeaf();
17291935 csg.count = 5;
....@@ -1732,7 +1938,7 @@
17321938 csg.addChild(child);
17331939 child.addChild(csg);
17341940 } else
1735
- if (event.getSource() == doubleItem)
1941
+ if (source == doubleItem)
17361942 {
17371943 Composite csg = new GroupLeaf();
17381944 csg.count = 5;
....@@ -1744,7 +1950,7 @@
17441950 csg.addChild(child);
17451951 child.addChild(csg);
17461952 } else
1747
- if (event.getSource() == tripleItem)
1953
+ if (source == tripleItem)
17481954 {
17491955 Composite csg = new GroupLeaf();
17501956 csg.count = 4;
....@@ -1759,71 +1965,83 @@
17591965 csg.addChild(child);
17601966 child.addChild(csg);
17611967 } else
1762
-
1763
- if (event.getSource() == importGFDItem)
1968
+ if (source == computeAOItem)
17641969 {
1765
- ImportGFD();
1970
+ Globals.drawMode = CameraPane.OCCLUSION;
1971
+ Globals.theRenderer.repaint();
17661972 } else
1767
- if (event.getSource() == importVRMLX3DItem)
1768
- {
1769
- ImportVRMLX3D();
1770
- } else
1771
- if (event.getSource() == import3DSItem)
1772
- {
1773
- objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
1774
- } else
1775
- if (event.getSource() == importOBJItem)
1776
- {
1777
- objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1778
- } else
1779
- if (event.getSource() == computeAOItem)
1780
- {
1781
- CameraPane.drawMode = CameraPane.OCCLUSION;
1782
- CameraPane.theRenderer.repaint();
1783
- } else
1784
- if (event.getSource() == recompileItem)
1973
+ if (source == recompileItem)
17851974 {
17861975 Recompile();
17871976 refreshContents();
17881977 } else
1789
- if (event.getSource() == editScriptItem)
1978
+ if (source == editScriptItem)
17901979 {
17911980 OpenDialog();
17921981 refreshContents();
17931982 } else
1794
- if (event.getSource() == invariantsItem)
1983
+ if (source == invariantsItem)
17951984 {
17961985 System.out.println("Invariants:");
1797
- GrafreeD.grafreeD.universe.invariants();
1986
+ Grafreed.grafreeD.universe.invariants();
17981987 } else
1799
- if (event.getSource() == memoryItem)
1988
+ if (source == memoryItem)
18001989 {
18011990 //System.out.println("Invariants:");
18021991 PrintMemory();
18031992 } else
1804
- if (event.getSource() == pathItem)
1993
+ if (source == pathItem)
18051994 {
18061995 PrintPath();
18071996 } else
1808
- if (event.getSource() == analyzeItem)
1997
+ if (source == analyzeItem)
18091998 {
18101999 AnalyzeObject();
18112000 } else
1812
- if (event.getSource() == dumpItem)
2001
+ if (source == dumpItem)
18132002 {
18142003 DumpObject();
18152004 } else
1816
- 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)
18172035 {
18182036 //Reload(lastConverter, lastFilename, true);
18192037 ScreenFit();
18202038 } else
1821
- if (event.getSource() == screenfitpointButton)
2039
+ if (source == screenfitpointButton)
18222040 {
18232041 //Reload(lastConverter, lastFilename, true);
18242042 ScreenFitPoint();
18252043 } else
1826
- if (event.getSource() == snapobjectButton)
2044
+ if (source == snapobjectButton)
18272045 {
18282046 //Reload(lastConverter, lastFilename, true);
18292047 SnapObject();
....@@ -1834,13 +2052,13 @@
18342052 // Recompile();
18352053 // refreshContents();
18362054 // } else
1837
- if (event.getSource() == gcButton)
2055
+ if (source == gcButton)
18382056 {
18392057 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18402058 System.gc();
18412059 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18422060 } else
1843
- if (event.getSource() == editLeafItem)
2061
+ if (source == editLeafItem)
18442062 {
18452063 Object3D obj;
18462064 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1854,62 +2072,74 @@
18542072 }
18552073 refreshContents(true);
18562074 } else
1857
- if (event.getSource() == openWindowItem)
2075
+ if (source == openWindowItem)
18582076 {
18592077 EditSelection(true);
18602078 } else
1861
- if (event.getSource() == cutItem || event.getSource() == clearButton)
2079
+ if (source == cutItem || source == clearButton)
18622080 {
18632081 loadClipboard(true);
18642082 } else
1865
- if (event.getSource() == duplicateItem)
2083
+ if (source == undoItem)
18662084 {
1867
- 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;
18682094 loadClipboard(false);
18692095 paste(false);
1870
- GrafreeD.clipboard = keep;
2096
+ Grafreed.clipboard = keep;
18712097 } else
1872
- if (event.getSource() == cloneItem)
2098
+ if (source == cloneItem)
18732099 {
18742100 CloneSelection(false);
18752101 } else
1876
- if (event.getSource() == cloneSupportItem)
2102
+ if (source == cloneSupportItem)
18772103 {
18782104 CloneSelection(true);
18792105 } else
1880
- if (event.getSource() == copyItem)
2106
+ if (source == copyItem)
18812107 {
18822108 loadClipboard(false);
18832109 } else
1884
- if (event.getSource() == pasteItem)
2110
+ if (source == pasteItem)
18852111 {
18862112 paste(false);
18872113 } else
1888
- if (event.getSource() == pasteLinkItem)
2114
+ if (source == pasteIntoItem)
18892115 {
1890
- pasteInto(false);
2116
+ pasteInto(true, false);
18912117 } else
1892
- if (event.getSource() == pasteCloneItem)
2118
+ if (source == pasteLinkItem)
18932119 {
1894
- pasteInto(true);
2120
+ pasteInto(false, false);
18952121 } else
1896
- if (event.getSource() == pasteExpandItem)
2122
+ if (source == pasteCloneItem)
2123
+ {
2124
+ pasteInto(true, true);
2125
+ } else
2126
+ if (source == pasteExpandItem)
18972127 {
18982128 paste(true);
18992129 } else
1900
- if (event.getSource() == synchronizeItem)
2130
+ if (source == synchronizeItem)
19012131 {
19022132 Overwrite(Object3D.TRANSFORM);
19032133 } else
1904
- if (event.getSource() == overwriteNameItem)
2134
+ if (source == overwriteNameItem)
19052135 {
19062136 Overwrite(Object3D.NAME);
19072137 } else
1908
- if (event.getSource() == overwriteUVItem)
2138
+ if (source == overwriteUVItem)
19092139 {
19102140 Overwrite(Object3D.UV);
19112141 } else
1912
- if (event.getSource() == overwriteMatItem)
2142
+ if (source == overwriteMatItem)
19132143 {
19142144 /* july 2015
19152145 if ((dropAttributes & Object3D.TEXTURE) == 0)
....@@ -1929,7 +2159,7 @@
19292159
19302160 Overwrite(dropAttributes);
19312161 }
1932
- if (event.getSource() == overwriteGeoItem)
2162
+ if (source == overwriteGeoItem)
19332163 {
19342164 Overwrite(Object3D.GEOMETRY);
19352165 // if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
....@@ -1946,7 +2176,7 @@
19462176 // refreshContents();
19472177 // }
19482178 } else
1949
- if (event.getSource() == generateMeshItem)
2179
+ if (source == generateMeshItem)
19502180 {
19512181 //if (group.selection.size() == 1)
19522182 // for (int i=0; i<group.selection.size(); i++)
....@@ -1957,7 +2187,7 @@
19572187 ResetModel();
19582188 refreshContents();
19592189 } else
1960
- if (event.getSource() == extractGeometriesItem)
2190
+ if (source == extractGeometriesItem)
19612191 {
19622192 boolean one = false;
19632193
....@@ -1984,7 +2214,7 @@
19842214 ResetModel();
19852215 refreshContents();
19862216 } else
1987
- if (event.getSource() == cloneGeometriesItem)
2217
+ if (source == cloneGeometriesItem)
19882218 {
19892219 boolean one = false;
19902220
....@@ -2010,7 +2240,7 @@
20102240 ResetModel();
20112241 refreshContents();
20122242 } else
2013
- if (event.getSource() == shareGeometriesItem)
2243
+ if (source == shareGeometriesItem)
20142244 {
20152245 boolean one = false;
20162246
....@@ -2040,7 +2270,7 @@
20402270 refreshContents();
20412271 }
20422272 } else
2043
- if (event.getSource() == mergeGeometriesItem)
2273
+ if (source == mergeGeometriesItem)
20442274 {
20452275 boolean one = false;
20462276
....@@ -2070,7 +2300,7 @@
20702300 ResetModel();
20712301 refreshContents();
20722302 } else
2073
- if (event.getSource() == linkverticesItem)
2303
+ if (source == linkverticesItem)
20742304 {
20752305 // if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
20762306 // {
....@@ -2083,48 +2313,48 @@
20832313 // group.selection.get(0).setMasterThis(content); // should be identity
20842314 // refreshContents();
20852315 // }
2086
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2316
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
20872317 {
2088
- Object3D content = GrafreeD.clipboard.get(0);
2318
+ Object3D content = Grafreed.clipboard.get(0);
20892319
20902320 if (content instanceof cGroup && ((cGroup)content).transientlink )
20912321 content = ((cGroup)content).get(0);
20922322
2093
- 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));
20942324 for (int i=0; i<group.selection.size(); i++)
20952325 {
2096
- boolean random = CameraPane.RANDOM;
2097
- CameraPane.RANDOM = false; // parse all random nodes
2326
+ boolean random = CameraPane.SWITCH;
2327
+ CameraPane.SWITCH = false; // parse all random nodes
20982328 group.selection.get(i).linkVerticesThis(content);
20992329 // group.selection.get(i).setMasterThis(content); // should be identity
2100
- CameraPane.RANDOM = random;
2330
+ CameraPane.SWITCH = random;
21012331 }
2102
- 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));
21032333 refreshContents();
21042334 }
21052335 } else
2106
- if (event.getSource() == resetsupportItem)
2336
+ if (source == resetsupportItem)
21072337 {
21082338 for (int i=0; i<group.selection.size(); i++)
21092339 {
2110
- boolean random = CameraPane.RANDOM;
2111
- CameraPane.RANDOM = false; // parse all random nodes
2340
+ boolean random = CameraPane.SWITCH;
2341
+ CameraPane.SWITCH = false; // parse all random nodes
21122342 group.selection.get(i).linkVerticesThis(null);
2113
- CameraPane.RANDOM = random;
2343
+ CameraPane.SWITCH = random;
21142344 }
21152345
21162346 refreshContents();
21172347 } else
2118
- if (event.getSource() == relinkverticesItem)
2348
+ if (source == relinkverticesItem)
21192349 {
2120
- boolean random = CameraPane.RANDOM;
2121
- CameraPane.RANDOM = false; // parse all random nodes
2350
+ boolean random = CameraPane.SWITCH;
2351
+ CameraPane.SWITCH = false; // parse all random nodes
21222352 group.selection.RelinkToSupport();
2123
- CameraPane.RANDOM = random;
2353
+ CameraPane.SWITCH = random;
21242354
21252355 refreshContents();
21262356 } else
2127
- if (event.getSource() == resetreferencesItem)
2357
+ if (source == resetreferencesItem)
21282358 {
21292359 for (int i=0; i<group.selection.size(); i++)
21302360 {
....@@ -2133,11 +2363,11 @@
21332363
21342364 refreshContents();
21352365 } else
2136
- if (event.getSource() == setMasterItem)
2366
+ if (source == setMasterItem)
21372367 {
2138
- if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
2368
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
21392369 {
2140
- Object3D content = GrafreeD.clipboard.get(0);
2370
+ Object3D content = Grafreed.clipboard.get(0);
21412371
21422372 if (content instanceof cGroup && ((cGroup)content).transientlink )
21432373 content = ((cGroup)content).get(0);
....@@ -2146,13 +2376,13 @@
21462376 refreshContents();
21472377 }
21482378 } else
2149
- if (event.getSource() == poseMeshItem)
2379
+ if (source == poseMeshItem)
21502380 {
21512381 if (group.selection.size() == 1)
21522382 {
2153
- if (GrafreeD.clipboard.size() == 1)
2383
+ if (Grafreed.clipboard.size() == 1)
21542384 {
2155
- Object3D content = GrafreeD.clipboard.get(0);
2385
+ Object3D content = Grafreed.clipboard.get(0);
21562386
21572387 if (content instanceof cGroup && ((cGroup)content).transientlink )
21582388 content = ((cGroup)content).get(0);
....@@ -2165,19 +2395,19 @@
21652395 }
21662396
21672397 } else
2168
- if (event.getSource() == revertMeshItem)
2398
+ if (source == revertMeshItem)
21692399 {
21702400 RevertMeshes();
21712401 } else
2172
- if (event.getSource() == resetMeshItem)
2402
+ if (source == resetAllItem)
21732403 {
21742404 ResetAll();
21752405 } else
2176
- if (event.getSource() == stepAllItem)
2406
+ if (source == stepAllItem)
21772407 {
21782408 StepAll();
21792409 } else
2180
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2410
+ if (source == clearItem) // || event.getSource() == clearButton)
21812411 {
21822412 //int indices[] = jList.getSelectedIndices();
21832413 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2185,46 +2415,46 @@
21852415
21862416 ClearSelection(false);
21872417 } else
2188
- if (event.getSource() == clearAllItem)
2418
+ if (source == clearAllItem)
21892419 {
21902420 ClearSelection(true);
21912421 } else
2192
- if (event.getSource() == grabItem)
2422
+ if (source == grabItem)
21932423 {
21942424 group(new cGroup(), true);
21952425 } else
2196
- if (event.getSource() == hideItem)
2426
+ if (source == hideItem)
21972427 {
21982428 group(new HiddenObject());
21992429 } else
2200
- if (event.getSource() == frontItem)
2430
+ if (source == frontItem)
22012431 {
22022432 front();
22032433 } else
2204
- if (event.getSource() == backItem)
2434
+ if (source == backItem)
22052435 {
22062436 back();
22072437 } else
2208
- if (event.getSource() == cameraItem)
2438
+ if (source == cameraItem)
22092439 {
22102440 makeSomething(new Camera());
22112441 } else
2212
- if (event.getSource() == compositeItem)
2442
+ if (source == compositeItem)
22132443 {
22142444 group(new Composite());
22152445 } else
2216
- if (event.getSource() == randomItem)
2446
+ if (source == randomItem)
22172447 {
22182448 RandomNode random = new RandomNode();
22192449 group(random);
22202450 if (random.size() > 0)
2221
- random.name = random.get(0).name + "Rnd";
2451
+ random.name = random.get(0).name + "Switch";
22222452 } else
2223
- if (event.getSource() == physicsItem)
2453
+ if (source == physicsItem)
22242454 {
22252455 group(new PhysicsNode());
22262456 } else
2227
- if (event.getSource() == frameselectorItem)
2457
+ if (source == frameselectorItem)
22282458 {
22292459 for (int i=0; i<group.selection.size(); i++)
22302460 {
....@@ -2236,7 +2466,7 @@
22362466 ResetModel();
22372467 refreshContents();
22382468 } else
2239
- if (event.getSource() == switchGeoItem)
2469
+ if (source == switchGeoItem)
22402470 {
22412471 for (int i=0; i<group.selection.size(); i++)
22422472 {
....@@ -2248,7 +2478,7 @@
22482478 ResetModel();
22492479 refreshContents();
22502480 } else
2251
- if (event.getSource() == switchTransfoItem)
2481
+ if (source == switchTransfoItem)
22522482 {
22532483 for (int i=0; i<group.selection.size(); i++)
22542484 {
....@@ -2260,7 +2490,7 @@
22602490 ResetModel();
22612491 refreshContents();
22622492 } else
2263
- if (event.getSource() == morphItem)
2493
+ if (source == morphItem)
22642494 {
22652495 for (int i=0; i<group.selection.size(); i++)
22662496 {
....@@ -2272,7 +2502,7 @@
22722502 ResetModel();
22732503 refreshContents();
22742504 } else
2275
- if (event.getSource() == scriptNodeItem)
2505
+ if (source == scriptNodeItem)
22762506 {
22772507 boolean atleastone = false;
22782508
....@@ -2311,31 +2541,31 @@
23112541 }
23122542 }
23132543 } else
2314
- if (event.getSource() == linkerItem)
2544
+ if (source == linkerItem)
23152545 {
23162546 group(new cLinker());
23172547 } else
2318
- if (event.getSource() == textureItem)
2548
+ if (source == textureItem)
23192549 {
23202550 group(new TextureNode());
23212551 } else
2322
- if (event.getSource() == billboardItem)
2552
+ if (source == billboardItem)
23232553 {
23242554 group(new BillboardNode());
23252555 } else
2326
- if (event.getSource() == shadowXItem)
2556
+ if (source == shadowXItem)
23272557 {
23282558 CastShadow(0);
23292559 } else
2330
- if (event.getSource() == shadowYItem)
2560
+ if (source == shadowYItem)
23312561 {
23322562 CastShadow(1);
23332563 } else
2334
- if (event.getSource() == shadowZItem)
2564
+ if (source == shadowZItem)
23352565 {
23362566 CastShadow(2);
23372567 } else
2338
- if (event.getSource() == ungroupItem)
2568
+ if (source == ungroupItem)
23392569 {
23402570 //ungroup();
23412571 for (int i=0; i<group.selection.size(); i++)
....@@ -2347,179 +2577,203 @@
23472577
23482578 refreshContents();
23492579 } else
2350
- if (event.getSource() == genUVItem)
2580
+ if (source == genUVItem)
23512581 {
23522582 GenUV();
23532583 } else
2354
- if (event.getSource() == genNormalsCADItem)
2584
+ if (source == genNormalsCADItem)
23552585 {
23562586 GenNormals(true);
23572587 } else
2358
- if (event.getSource() == genNormalsMESHItem)
2588
+ if (source == genNormalsMESHItem)
23592589 {
2360
- GenNormals(true); // TODO
2590
+ GenNormalsMESH();
23612591 } else
2362
- if (event.getSource() == genNormalsORGANItem)
2592
+ if (source == genNormalsORGANItem)
23632593 {
23642594 GenNormals(false);
23652595 } else
2366
- if (event.getSource() == genNormalsMINEItem)
2596
+ if (source == genNormalsMINEItem)
23672597 {
23682598 GenNormalsMINE();
23692599 } else
2370
- if (event.getSource() == stripifyItem)
2600
+ if (source == stripifyItem)
23712601 {
23722602 Stripify();
23732603 } else
2374
- if (event.getSource() == unstripifyItem)
2604
+ if (source == unstripifyItem)
23752605 {
23762606 Unstripify();
23772607 } else
2378
- if (event.getSource() == trimItem)
2608
+ if (source == trimItem)
23792609 {
23802610 Trim();
23812611 } else
2382
- if (event.getSource() == untrimItem)
2612
+ if (source == untrimItem)
23832613 {
23842614 Untrim();
23852615 } else
2386
- if (event.getSource() == clearColorsItem)
2616
+ if (source == clearColorsItem)
23872617 {
23882618 ClearColors();
23892619 } else
2390
- if (event.getSource() == clearMaterialsItem)
2620
+ if (source == clearMaterialsItem)
23912621 {
23922622 ClearMaterials();
23932623 } else
2394
- if (event.getSource() == liveleavesItem)
2624
+ if (source == liveleavesItem)
23952625 {
23962626 LiveLeaves(true);
23972627 } else
2398
- if (event.getSource() == unliveleavesItem)
2628
+ if (source == unliveleavesItem)
23992629 {
24002630 LiveLeaves(false);
24012631 } else
2402
- if (event.getSource() == supportleavesItem)
2632
+ if (source == supportleavesItem)
24032633 {
24042634 SupportLeaves(true);
24052635 } else
2406
- if (event.getSource() == unsupportleavesItem)
2636
+ if (source == unsupportleavesItem)
24072637 {
24082638 SupportLeaves(false);
24092639 } else
2410
- if (event.getSource() == hideleavesItem)
2640
+ if (source == hideleavesItem)
24112641 {
24122642 HideLeaves(true);
24132643 } else
2414
- if (event.getSource() == showleavesItem)
2644
+ if (source == showleavesItem)
24152645 {
24162646 HideLeaves(false);
24172647 } else
2418
- if (event.getSource() == markleavesItem)
2648
+ if (source == markleavesItem)
24192649 {
24202650 MarkLeaves(true);
24212651 } else
2422
- if (event.getSource() == unmarkleavesItem)
2652
+ if (source == unmarkleavesItem)
24232653 {
24242654 MarkLeaves(false);
24252655 } else
2426
- 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)
24272673 {
24282674 FlipV(true);
24292675 } else
2430
- if (event.getSource() == unflipVItem)
2676
+ if (source == unflipVItem)
24312677 {
24322678 FlipV(false);
24332679 } else
2434
- if (event.getSource() == lowTexturesItem)
2680
+ if (source == lowTexturesItem)
24352681 {
24362682 SetTexRes(0);
24372683 } else
2438
- if (event.getSource() == normalTexturesItem)
2684
+ if (source == normalTexturesItem)
24392685 {
24402686 SetTexRes(1);
24412687 } else
2442
- if (event.getSource() == highTexturesItem)
2688
+ if (source == highTexturesItem)
24432689 {
24442690 SetTexRes(2);
24452691 } else
2446
- if (event.getSource() == veryhighTexturesItem)
2692
+ if (source == veryhighTexturesItem)
24472693 {
24482694 SetTexRes(3);
24492695 } else
2450
- if (event.getSource() == maxTexturesItem)
2696
+ if (source == maxTexturesItem)
24512697 {
24522698 SetTexRes(4);
24532699 } else
2454
- if (event.getSource() == panoTexturesItem)
2700
+ if (source == panoTexturesItem)
24552701 {
24562702 SetTexRes(5);
24572703 } else
2458
- if (event.getSource() == reverseNormalsItem)
2704
+ if (source == reverseNormalsItem)
24592705 {
24602706 ReverseNormals();
24612707 } else
2462
- if (event.getSource() == parseverticesItem)
2708
+ if (source == parseverticesItem)
24632709 {
24642710 ParseVertices();
24652711 } else
2466
- if (event.getSource() == textureFieldItem)
2712
+ if (source == textureFieldItem)
24672713 {
24682714 TextureVertices();
24692715 } else
2470
- if (event.getSource() == alignItem)
2716
+ if (source == alignItem)
24712717 {
24722718 Align();
24732719 } else
2474
- if (event.getSource() == mirrorItem)
2720
+ if (source == mirrorItem)
24752721 {
24762722 MirrorPoses();
24772723 } else
2478
- if (event.getSource() == reduceMorphItem)
2724
+ if (source == reduceMorphItem)
24792725 {
24802726 MeshReduction(false);
24812727 } else
2482
- if (event.getSource() == reduce34MorphItem)
2728
+ if (source == reduce34MorphItem)
24832729 {
24842730 MeshReduction(true);
24852731 } else
2486
- if (event.getSource() == reverseTrianglesItem)
2732
+ if (source == reverseTrianglesItem)
24872733 {
24882734 ReverseTriangles();
24892735 } else
2490
- if (event.getSource() == reduceMeshItem)
2736
+ if (source == reduceMeshItem)
24912737 {
24922738 ReduceMesh(false);
24932739 } else
2494
- if (event.getSource() == reduce34MeshItem)
2740
+ if (source == reduce34MeshItem)
24952741 {
24962742 ReduceMesh(true);
24972743 } else
2498
- if (event.getSource() == increaseMeshItem)
2744
+ if (source == increaseMeshItem)
24992745 {
25002746 IncreaseMesh();
25012747 } else
2502
- if (event.getSource() == clipMeshItem)
2748
+ if (source == clipMeshItem)
25032749 {
25042750 ClipMesh();
25052751 } else
2506
- if (event.getSource() == smoothMeshItem)
2752
+ if (source == smoothMeshItem)
25072753 {
25082754 SmoothMesh();
25092755 } else
2510
- if (event.getSource() == transformgeometryItem)
2756
+ if (source == transformGeometryItem)
25112757 {
25122758 TransformGeometry();
25132759 } else
2514
- if (event.getSource() == resetTransformItem)
2760
+ if (source == transformChildrenItem)
2761
+ {
2762
+ TransformChildren();
2763
+ } else
2764
+ if (source == resetTransformItem)
25152765 {
25162766 ResetTransform();
25172767 } else
2518
- if (event.getSource() == resetCentroidItem)
2768
+ if (source == resetCentroidItem)
25192769 {
2520
- ResetCentroid();
2770
+ ResetCentroid(true);
25212771 } else
2522
- if (event.getSource() == resetParentItem)
2772
+ if (source == resetCentroidXZItem)
2773
+ {
2774
+ ResetCentroid(false);
2775
+ } else
2776
+ if (source == resetParentItem)
25232777 {
25242778 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25252779 {
....@@ -2529,7 +2783,7 @@
25292783
25302784 refreshContents();
25312785 } else
2532
- if (event.getSource() == repairParentItem)
2786
+ if (source == repairParentItem)
25332787 {
25342788 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25352789 {
....@@ -2543,7 +2797,21 @@
25432797
25442798 refreshContents();
25452799 } else
2546
- 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)
25472815 {
25482816 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25492817 {
....@@ -2555,7 +2823,7 @@
25552823 ResetModel();
25562824 refreshContents();
25572825 } else
2558
- if (event.getSource() == sortbynameItem)
2826
+ if (source == sortbynameItem)
25592827 {
25602828 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25612829 {
....@@ -2567,7 +2835,7 @@
25672835 ResetModel();
25682836 refreshContents();
25692837 } else
2570
- if (event.getSource() == attachPigmentItem)
2838
+ if (source == attachPigmentItem)
25712839 {
25722840 String texture = GetFile("Attach pigment");
25732841 Object3D obj;
....@@ -2579,7 +2847,7 @@
25792847
25802848 refreshContents();
25812849 } else
2582
- if (event.getSource() == detachPigmentItem)
2850
+ if (source == detachPigmentItem)
25832851 {
25842852 Object3D obj;
25852853 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2590,7 +2858,7 @@
25902858
25912859 refreshContents();
25922860 } else
2593
- if (event.getSource() == attachBumpItem)
2861
+ if (source == attachBumpItem)
25942862 {
25952863 String texture = GetFile("Attach bump");
25962864 Object3D obj;
....@@ -2602,7 +2870,7 @@
26022870
26032871 refreshContents();
26042872 } else
2605
- if (event.getSource() == detachBumpItem)
2873
+ if (source == detachBumpItem)
26062874 {
26072875 Object3D obj;
26082876 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2613,7 +2881,7 @@
26132881
26142882 refreshContents();
26152883 } else
2616
- if (event.getSource() == pigmentBumpItem)
2884
+ if (source == pigmentBumpItem)
26172885 {
26182886 Object3D obj;
26192887 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2624,158 +2892,221 @@
26242892
26252893 refreshContents();
26262894 } else
2627
- if (event.getSource() == flashSelectionButton)
2895
+ if (source == flashSelectionButton)
26282896 {
26292897 CameraPane.flash = true;
26302898 refreshContents();
26312899 } else
2632
- if (event.getSource() == oneButton)
2900
+ if (source == oneButton)
26332901 {
26342902 } else
2635
- if (event.getSource() == twoButton)
2903
+ if (source == twoButton)
26362904 {
26372905 radio.layout = twoButton;
26382906 // bug
26392907 //gridPanel.setDividerLocation(1.0);
26402908 //bigPanel.setDividerLocation(0.0);
2641
- bigThree.remove(scenePanel);
2642
- bigThree.remove(cameraPanel);
2643
- bigThree.remove(XYZPanel);
2644
- aWindowConstraints.gridx = 0;
2645
- aWindowConstraints.gridy = 0;
2646
- aWindowConstraints.gridwidth = 1;
2647
- // aConstraints.gridheight = 3;
2648
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2649
- aWindowConstraints.weightx = 0;
2650
- aWindowConstraints.weighty = 1;
2651
- //bigThree.add(jtp, aWindowConstraints);
2652
- aWindowConstraints.weightx = 1;
2653
- aWindowConstraints.gridwidth = 3;
2654
- // aConstraints.gridheight = 3;
2655
- aWindowConstraints.gridx = 1;
2656
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2657
- bigThree.add(cameraPanel, aWindowConstraints);
2658
- aWindowConstraints.weightx = 0;
2659
- aWindowConstraints.gridx = 4;
2660
- aWindowConstraints.gridwidth = 1;
2661
- // aConstraints.gridheight = 3;
2662
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2663
- //bigThree.add(XYZPanel, aWindowConstraints);
2664
- bigThree.revalidate();
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
+
26652956 } else
2666
- if (event.getSource() == threeButton)
2957
+ if (source == threeButton)
26672958 {
26682959 radio.layout = threeButton;
2669
- bigThree.remove(scenePanel);
2670
- bigThree.remove(cameraPanel);
2671
- bigThree.remove(XYZPanel);
2672
- aWindowConstraints.gridx = 0;
2673
- aWindowConstraints.gridy = 0;
2674
- aWindowConstraints.gridwidth = 1;
2675
- // aConstraints.gridheight = 3;
2676
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2677
- aWindowConstraints.weightx = 0;
2678
- aWindowConstraints.weighty = 1;
2679
- //bigThree.add(jtp, aWindowConstraints);
2680
- aWindowConstraints.weightx = 1;
2681
- aWindowConstraints.gridwidth = 3;
2682
- // aConstraints.gridheight = 3;
2683
- aWindowConstraints.gridx = 1;
2684
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2685
- bigThree.add(cameraPanel, aWindowConstraints);
2686
- aWindowConstraints.weightx = 0;
2687
- aWindowConstraints.gridx = 4;
2688
- aWindowConstraints.gridwidth = 1;
2689
- // aConstraints.gridheight = 3;
2690
- aConstraints.fill = GridBagConstraints.VERTICAL;
2691
- bigThree.add(XYZPanel, aWindowConstraints);
2692
- bigThree.revalidate();
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();
26932994 } else
2694
- if (event.getSource() == fourButton)
2995
+ if (source == fourButton)
26952996 {
26962997 radio.layout = fourButton;
2697
- bigThree.remove(scenePanel);
2698
- bigThree.remove(cameraPanel);
2699
- bigThree.remove(XYZPanel);
2700
- aWindowConstraints.gridx = 0;
2701
- aWindowConstraints.gridy = 0;
2702
- aWindowConstraints.gridwidth = 1;
2703
- // aWindowConstraints.gridheight = 3;
2704
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2705
- aWindowConstraints.weightx = 1;
2706
- aWindowConstraints.weighty = 1;
2707
- bigThree.add(scenePanel, aWindowConstraints);
2708
- aWindowConstraints.weightx = 1;
2709
- aWindowConstraints.gridwidth = 3;
2710
- // aConstraints.gridheight = 3;
2711
- aWindowConstraints.gridx = 1;
2712
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2713
- //bigThree.add(cameraPanel, aWindowConstraints);
2714
- aWindowConstraints.weightx = 0;
2715
- aWindowConstraints.gridx = 4;
2716
- aWindowConstraints.gridwidth = 1;
2717
- // aWindowConstraints.gridheight = 3;
2718
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2719
- //bigThree.add(XYZPanel, aWindowConstraints);
2720
- bigThree.revalidate();
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();
27213031 } else
2722
- if (event.getSource() == sixButton)
3032
+ if (source == sixButton)
27233033 {
27243034 radio.layout = sixButton;
2725
- bigThree.remove(scenePanel);
2726
- bigThree.remove(cameraPanel);
2727
- bigThree.remove(XYZPanel);
2728
- aWindowConstraints.gridx = 0;
2729
- aWindowConstraints.gridy = 0;
2730
- aWindowConstraints.gridwidth = 1;
2731
- // aConstraints.gridheight = 3;
2732
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2733
- aWindowConstraints.weightx = 0;
2734
- aWindowConstraints.weighty = 1;
2735
- bigThree.add(scenePanel, aWindowConstraints);
2736
- aWindowConstraints.weightx = 1;
2737
- aWindowConstraints.gridwidth = 3;
2738
- // aWindowConstraints.gridheight = 3;
2739
- aWindowConstraints.gridx = 1;
2740
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2741
- bigThree.add(cameraPanel, aWindowConstraints);
2742
- aWindowConstraints.weightx = 0;
2743
- aWindowConstraints.gridx = 4;
2744
- aWindowConstraints.gridwidth = 1;
2745
- // aWindowConstraints.gridheight = 3;
2746
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2747
- //bigThree.add(XYZPanel, aConstraints);
2748
- bigThree.revalidate();
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();
27493069 } else
2750
- if (event.getSource() == sevenButton)
3070
+ if (source == sevenButton)
27513071 {
27523072 radio.layout = sevenButton;
2753
- bigThree.remove(scenePanel);
2754
- bigThree.remove(cameraPanel);
2755
- bigThree.remove(XYZPanel);
2756
- aWindowConstraints.gridx = 0;
2757
- aWindowConstraints.gridy = 0;
2758
- aWindowConstraints.gridwidth = 1;
2759
- // aWindowConstraints.gridheight = 3;
2760
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2761
- aWindowConstraints.weightx = 0;
2762
- aWindowConstraints.weighty = 1;
2763
- bigThree.add(scenePanel, aWindowConstraints);
2764
- aWindowConstraints.weightx = 1;
2765
- aWindowConstraints.gridwidth = 3;
2766
- // aWindowConstraints.gridheight = 3;
2767
- aWindowConstraints.gridx = 1;
2768
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2769
- bigThree.add(cameraPanel, aWindowConstraints);
2770
- aWindowConstraints.weightx = 0;
2771
- aWindowConstraints.gridx = 4;
2772
- aWindowConstraints.gridwidth = 1;
2773
- // aConstraints.gridheight = 3;
2774
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2775
- bigThree.add(XYZPanel, aWindowConstraints);
2776
- bigThree.revalidate();
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();
27773108 } else
2778
- if (event.getSource() == rootButton)
3109
+ if (source == rootButton)
27793110 {
27803111 Object3D obj;
27813112 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2785,9 +3116,10 @@
27853116 EditObject(obj);
27863117 }
27873118
3119
+ cameraView.requestFocusInWindow();
27883120 refreshContents(true);
27893121 } else
2790
- if (event.getSource() == closeButton)
3122
+ if (source == closeButton)
27913123 {
27923124 //System.out.println("CLOSE: " + buttonGroup.getSelection());
27933125 cRadio ab;
....@@ -2806,13 +3138,15 @@
28063138 break;
28073139 }
28083140 }
3141
+
3142
+ cameraView.requestFocusInWindow();
28093143 refreshContents(true);
28103144 } else
2811
- if (event.getSource() == editItem || event.getSource() == editButton)
3145
+ if (source == editItem || source == editButton)
28123146 {
28133147 EditSelection(false);
28143148 } else
2815
- if (event.getSource() == uneditButton)
3149
+ if (source == uneditButton)
28163150 {
28173151 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
28183152 {
....@@ -2822,14 +3156,14 @@
28223156 child.CloseUI();
28233157 listUI.remove(child);
28243158
2825
- child.editWindow = null; // ???????????
3159
+ //child.editWindow = null; // ???????????
28263160 }
2827
- objEditor.ctrlPanel.revalidate();
3161
+ objEditor.ctrlPanel.FlushUI();
28283162 //objEditor.jTree.clearSelection();
28293163 //objEditor.ResetSliders();
28303164 refreshContents(true);
28313165 } else
2832
- if (event.getSource() == clearPanelButton)
3166
+ if (source == clearPanelButton)
28333167 {
28343168 assert(copy == group);
28353169 //copy.ClearUI();
....@@ -2840,7 +3174,7 @@
28403174 listUI.clear();
28413175 refreshContents(true);
28423176 } else
2843
- if (event.getSource() == allParamsButton)
3177
+ if (source == allParamsButton)
28443178 {
28453179 assert(copy == group);
28463180
....@@ -2861,19 +3195,19 @@
28613195
28623196 refreshContents(true);
28633197 } else
2864
- if (event.getSource() == unselectButton)
3198
+ if (source == unselectButton)
28653199 {
28663200 objEditor.jTree.clearSelection();
28673201 // ?? oct 2012 GrafreeD.clipboard.clear();
28683202 objEditor.ResetSliders();
28693203 refreshContents(true);
28703204 } else
2871
- if(event.getSource() instanceof cRadio)
3205
+ if(source instanceof cRadio)
28723206 {
28733207 group.parent = keepparent;
28743208 group.attributes = 0;
28753209 //group.editWindow = null;
2876
- /*cRadio*/ radio = (cRadio)event.getSource();
3210
+ /*cRadio*/ radio = (cRadio)source;
28773211 Object3D obj = radio.GetObject();
28783212 System.out.println("Edit " + obj);
28793213 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -2893,7 +3227,7 @@
28933227 }
28943228
28953229 copy = group;
2896
- //CameraPane.theRenderer.object = group;
3230
+ //Globals.theRenderer.object = group;
28973231 if(!useclient)
28983232 {
28993233 cameraView.renderCamera = radio.camera;
....@@ -2902,12 +3236,16 @@
29023236 cameraView.cameras[cameraView.cameracount] = radio.camera;
29033237 cameraView.targetLookAt.set(radio.camera.lookAt);
29043238 cameraView.object = group;
2905
- cameraView.lighttouched = true;
3239
+ //cameraView.lighttouched = true;
3240
+ Globals.lighttouched = true;
29063241 topView.object = group;
29073242 frontView.object = group;
29083243 sideView.object = group;
29093244 }
2910
- group.editWindow = this;
3245
+
3246
+// fix "+" issue
3247
+ //group.editWindow = this;
3248
+
29113249 /*
29123250 currentLayout = radio.layout;
29133251 if (currentLayout == null)
....@@ -2919,8 +3257,23 @@
29193257 //group.parent = null; // ROOT
29203258 //group.attributes = -1;
29213259 ResetModel();
3260
+
3261
+ cameraView.requestFocusInWindow();
29223262 refreshContents(true);
2923
- }
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
+ }
29243277 else
29253278 {
29263279 //return super.action(event, arg);
....@@ -2929,7 +3282,6 @@
29293282 }
29303283
29313284 boolean useclient = false;
2932
- cRadio radio;
29333285
29343286 void ToggleRoot()
29353287 {
....@@ -2938,7 +3290,7 @@
29383290 if (useclient)
29393291 {
29403292 cameraView.object = client;
2941
- cameraView.lighttouched = true;
3293
+ Globals.lighttouched = true;
29423294 //topView.object = client;
29433295 //frontView.object = client;
29443296 //sideView.object = client;
....@@ -2946,7 +3298,7 @@
29463298 else
29473299 {
29483300 cameraView.object = group;
2949
- cameraView.lighttouched = true;
3301
+ Globals.lighttouched = true;
29503302 //topView.object = group;
29513303 //frontView.object = group;
29523304 //sideView.object = group;
....@@ -2981,6 +3333,28 @@
29813333 refreshContents();
29823334 }
29833335
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
+ }
29843358
29853359 void ResetTransform()
29863360 {
....@@ -3093,7 +3467,7 @@
30933467 refreshContents();
30943468 }
30953469
3096
- void ResetCentroid()
3470
+ void ResetCentroid(boolean full)
30973471 {
30983472 Object3D obj;
30993473 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3108,12 +3482,16 @@
31083482 LA.matIdentity(Object3D.mat);
31093483 obj.getBounds(minima, maxima, false);
31103484 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3111
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3485
+ if (full)
3486
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
31123487 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
31133488 obj.TransformMesh(Object3D.mat);
3489
+
31143490 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3115
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3491
+ if (full)
3492
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
31163493 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3494
+
31173495 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
31183496 //Object3D.mat[3][0] = -Object3D.mat[3][0];
31193497 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3142,7 +3520,8 @@
31423520
31433521 int size = obj.MemorySize();
31443522
3145
- 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)");
31463525 }
31473526 }
31483527 catch (Exception e)
....@@ -3179,9 +3558,9 @@
31793558 obj = (Object3D)e.nextElement();
31803559
31813560 System.out.println("Object is: " + obj);
3182
- GrafreeD.AnalyzeObject(obj);
3561
+ Grafreed.AnalyzeObject(obj);
31833562 System.out.println("Boundary rep: " + obj.bRep);
3184
- GrafreeD.AnalyzeObject(obj.bRep);
3563
+ Grafreed.AnalyzeObject(obj.bRep);
31853564
31863565 // System.err.println((size/1024) + " KB is the size of " + obj);
31873566 }
....@@ -3223,6 +3602,13 @@
32233602 void GenNormals(boolean crease)
32243603 {
32253604 group.GenNormalsS(crease);
3605
+
3606
+ refreshContents();
3607
+ }
3608
+
3609
+ void GenNormalsMESH()
3610
+ {
3611
+ group.GenNormalsMeshS();
32263612
32273613 refreshContents();
32283614 }
....@@ -3395,8 +3781,8 @@
33953781
33963782 void ParseVertices()
33973783 {
3398
- boolean epsequal = GrafreeD.epsequal;
3399
- GrafreeD.epsequal = true;
3784
+ boolean epsequal = Grafreed.epsequal;
3785
+ Grafreed.epsequal = true;
34003786
34013787 for (int i=0; i<group.selection.size(); i++)
34023788 {
....@@ -3421,7 +3807,7 @@
34213807 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
34223808 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
34233809
3424
- g.add(GrafreeD.clipboard);
3810
+ g.add(Grafreed.clipboard);
34253811
34263812 buffer.add(g);
34273813 }
....@@ -3436,7 +3822,7 @@
34363822 makeSomething(buffer, i==group.selection.size()-1);
34373823 }
34383824
3439
- GrafreeD.epsequal = epsequal;
3825
+ Grafreed.epsequal = epsequal;
34403826
34413827 refreshContents();
34423828 }
....@@ -3454,7 +3840,16 @@
34543840 String pigment = Object3D.GetPigment(tex);
34553841 //String bump = Object3D.GetBump(tex);
34563842
3457
- 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
+ }
34583853
34593854 double s = v.s;
34603855
....@@ -3542,11 +3937,11 @@
35423937
35433938 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
35443939
3545
- boolean random = CameraPane.RANDOM;
3546
- CameraPane.RANDOM = false; // parse all random nodes
3940
+ boolean random = CameraPane.SWITCH;
3941
+ CameraPane.SWITCH = false; // parse all random nodes
35473942 lowres.linkVerticesThis(null);
35483943 lowres.linkVerticesThis(sn);
3549
- CameraPane.RANDOM = random;
3944
+ CameraPane.SWITCH = random;
35503945
35513946 System.err.flush();
35523947
....@@ -3586,7 +3981,7 @@
35863981 return;
35873982
35883983 Object3D poses = group.selection.get(0);
3589
- Object3D ref = GrafreeD.clipboard.get(0);
3984
+ Object3D ref = Grafreed.clipboard.get(0);
35903985
35913986 Object3D newgroup = new Object3D("Po:" + poses.name);
35923987
....@@ -3755,7 +4150,7 @@
37554150 group.selection.RelinkToSupport(); // july 2014
37564151 System.out.println("DONE.");
37574152 refreshContents();
3758
- 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));
37594154 }
37604155
37614156 void ReduceMesh(boolean reduction34)
....@@ -3780,9 +4175,9 @@
37804175
37814176 void ClipMesh()
37824177 {
3783
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
4178
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
37844179 {
3785
- Object3D content = GrafreeD.clipboard.get(0);
4180
+ Object3D content = Grafreed.clipboard.get(0);
37864181
37874182 if (content instanceof cGroup && ((cGroup)content).transientlink )
37884183 content = ((cGroup)content).get(0);
....@@ -3791,7 +4186,7 @@
37914186 // {
37924187 // group.selection.get(i).ClipMesh(GrafreeD.clipboard);
37934188 // }
3794
- group.selection.ClipMesh(GrafreeD.clipboard);
4189
+ group.selection.ClipMesh(Grafreed.clipboard);
37954190 }
37964191 // group.selection.ClipMesh(GrafreeD.clipboard);
37974192 System.out.println("DONE.");
....@@ -3838,6 +4233,18 @@
38384233 void MarkLeaves(boolean hide)
38394234 {
38404235 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);
38414248 refreshContents();
38424249 }
38434250
....@@ -3926,7 +4333,7 @@
39264333 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
39274334
39284335 Object3D elem = (Object3D)group.selection.elementAt(i);
3929
- if(elem != group)
4336
+ if(elem != group || !newWindow)
39304337 {
39314338 // if (!(elem instanceof Composite))
39324339 // newWindow = false;
....@@ -4016,7 +4423,6 @@
40164423 //case 702: // Event.LIST_DESELECT
40174424 group.deselectAll();
40184425 TreePath tps[] = objEditor.jTree.getSelectionPaths();
4019
- objEditor.ClearInfo(); // .GetMaterial());
40204426 if (tps != null)
40214427 {
40224428 for (int i=0; i < tps.length; i++)
....@@ -4025,31 +4431,30 @@
40254431
40264432 //if (child.parent != null)
40274433 //child.parent.addSelectee(child);
4434
+ objEditor.SetMaterial(child);
40284435 group.addSelectee(child);
4029
- objEditor.SetMaterial(child); // .GetMaterial());
4030
- objEditor.AddInfo(child, this, true); // .GetMaterial());
4031
- System.err.println("info : " + child.GetPath());
40324436 }
40334437 }
4034
- else
4035
- {
4036
- objEditor.SetMaterial(group); // .GetMaterial());
4037
- objEditor.AddInfo(group, this, true); // .GetMaterial());
4038
- System.err.println("info : " + group.GetPath());
4039
- }
4438
+// else
4439
+// {
4440
+// objEditor.SetMaterial(group); // .GetMaterial());
4441
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4442
+// System.err.println("info : " + group.GetPath());
4443
+// }
40404444
4041
- objEditor.SetText(); // jan 2014
4042
-
4043
- 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))
40444446 CameraPane.flash = true;
40454447
4046
- if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
4448
+ if (tps != null && tps.length > 0 && tps[0].getLastPathComponent() instanceof Camera)
40474449 // a camera
40484450 {
4049
- CameraPane.camerachangeframe = 0; // don't refuse it
4050
- CameraPane.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4051
- // CameraPane.theRenderer.renderCamera = CameraPane.theRenderer.manipCamera;
4052
- // CameraPane.theRenderer.eyeCamera = CameraPane.theRenderer.manipCamera;
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;
40534458 }
40544459
40554460 refreshContents();
....@@ -4060,6 +4465,26 @@
40604465
40614466 freezemodel = false;
40624467 }
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
+ }
40634488
40644489 void linkSomething(Object3D thing)
40654490 {
....@@ -4131,16 +4556,18 @@
41314556 {
41324557 if (group.selection.isEmpty())
41334558 return;
4134
- GrafreeD.clipboardIsTempGroup = false;
4559
+
4560
+ Grafreed.clipboardIsTempGroup = false;
41354561 Composite tGroup = null;
41364562 if (group.selection.size() > 0) // 1)
41374563 {
41384564 tGroup = new cGroup();
4139
- GrafreeD.clipboardIsTempGroup = true;
4565
+ Grafreed.clipboardIsTempGroup = true;
41404566 }
41414567
41424568 if (cut)
41434569 {
4570
+ Save();
41444571 //int indices[] = jList.getSelectedIndices();
41454572 //for (int i = indices.length - 1; i >= 0; i--)
41464573 //jList.remove(indices[i]);
....@@ -4176,16 +4603,16 @@
41764603 //System.out.println("cut " + child);
41774604 //System.out.println("parent = " + child.parent);
41784605 // tmp.addChild(child);
4179
- if (GrafreeD.clipboardIsTempGroup)
4606
+ if (Grafreed.clipboardIsTempGroup)
41804607 tGroup.add/*Child*/(tmp);
41814608 else
4182
- GrafreeD.clipboard = tmp;
4609
+ Grafreed.clipboard = tmp;
41834610 }
41844611 else
4185
- if (GrafreeD.clipboardIsTempGroup)
4612
+ if (Grafreed.clipboardIsTempGroup)
41864613 tGroup.add/*Child*/(child);
41874614 else
4188
- GrafreeD.clipboard = child;
4615
+ Grafreed.clipboard = child;
41894616 }
41904617
41914618 //ResetModel();
....@@ -4217,21 +4644,23 @@
42174644 //System.out.println("cut " + elem);
42184645 //System.out.println("parent = " + elem.parent);
42194646 // tmp.addChild(elem);
4220
- if (GrafreeD.clipboardIsTempGroup)
4647
+ if (Grafreed.clipboardIsTempGroup)
42214648 tGroup.add/*Child*/(tmp);
42224649 else
4223
- GrafreeD.clipboard = tmp;
4650
+ Grafreed.clipboard = tmp;
42244651 }
42254652 else
4226
- if (GrafreeD.clipboardIsTempGroup)
4653
+ if (Grafreed.clipboardIsTempGroup)
42274654 tGroup.add/*Child*/(child);
42284655 else
4229
- GrafreeD.clipboard = child;
4656
+ Grafreed.clipboard = child;
42304657 }
42314658
42324659 }
4233
- if (GrafreeD.clipboardIsTempGroup)
4234
- GrafreeD.clipboard = tGroup;
4660
+
4661
+ if (Grafreed.clipboardIsTempGroup)
4662
+ Grafreed.clipboard = tGroup;
4663
+
42354664 if (cut)
42364665 {
42374666 ResetModel();
....@@ -4245,7 +4674,7 @@
42454674 // return;
42464675 boolean first = true;
42474676
4248
- if (GrafreeD.clipboardIsTempGroup)
4677
+ if (Grafreed.clipboardIsTempGroup)
42494678 {
42504679 Composite temp;
42514680
....@@ -4256,7 +4685,7 @@
42564685 temp = (Composite)Applet3D.clipboard.deepCopy();
42574686 */
42584687 Object3D elem;
4259
- 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))
42604689 {
42614690 Object3D child = (Object3D)e.nextElement();
42624691
....@@ -4290,21 +4719,21 @@
42904719 //Object3D cb = Applet3D.clipboard;
42914720 //temp.addChild(cb);
42924721 //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0));
4293
- assert(GrafreeD.clipboard.parent == null);
4294
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
4295
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
4296
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
4297
- makeSomething(expand?GrafreeD.clipboard.get(0).copyExpand():GrafreeD.clipboard.get(0).deepCopy());
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());
42984727 else
4299
- makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4300
- GrafreeD.clipboard.get(0).parent = keepparent;
4728
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
4729
+ Grafreed.clipboard.get(0).parent = keepparent;
43014730 }
43024731
43034732 ResetModel();
43044733 refreshContents();
43054734 }
43064735
4307
- void pasteInto(boolean copyit)
4736
+ void pasteInto(boolean copyit, boolean clone)
43084737 {
43094738 // if (GrafreeD.clipboard == null)
43104739 // return;
....@@ -4333,15 +4762,22 @@
43334762 if (copyit)
43344763 {
43354764 // paste(false);
4336
- CloneClipboard(false); // sept 2014
4765
+ if (clone)
4766
+ {
4767
+ CloneClipboard(false); // sept 2014
4768
+ }
4769
+ else
4770
+ {
4771
+ paste(false);
4772
+ }
43374773 }
43384774 else
43394775 {
43404776 boolean first = true;
43414777
4342
- if (GrafreeD.clipboardIsTempGroup)
4778
+ if (Grafreed.clipboardIsTempGroup)
43434779 {
4344
- Composite temp = (Composite)GrafreeD.clipboard;
4780
+ Composite temp = (Composite)Grafreed.clipboard;
43454781 Object3D copy;
43464782 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
43474783 {
....@@ -4351,7 +4787,7 @@
43514787 }
43524788 } else
43534789 {
4354
- linkSomething(GrafreeD.clipboard); //.get(0));
4790
+ linkSomething(Grafreed.clipboard); //.get(0));
43554791 }
43564792 }
43574793 }
....@@ -4756,21 +5192,6 @@
47565192 }
47575193 */
47585194
4759
- void ImportGFD()
4760
- {
4761
- FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD);
4762
- browser.show();
4763
- String filename = browser.getFile();
4764
- if (filename != null && filename.length() > 0)
4765
- {
4766
- String fullname = browser.getDirectory() + filename;
4767
-
4768
- //Object3D readobj =
4769
- objEditor.ReadGFD(fullname, objEditor);
4770
- //makeSomething(readobj);
4771
- }
4772
- }
4773
-
47745195 /*
47755196 public void Callback(Object obj)
47765197 {
....@@ -4794,26 +5215,9 @@
47945215 }
47955216 */
47965217
4797
- void ImportVRMLX3D()
4798
- {
4799
- if (GrafreeD.standAlone)
4800
- {
4801
- /**/
4802
- FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
4803
- browser.show();
4804
- String filename = browser.getFile();
4805
- if (filename != null && filename.length() > 0)
4806
- {
4807
- String fullname = browser.getDirectory() + filename;
4808
- LoadVRMLX3D(fullname);
4809
- }
4810
- /**/
4811
- }
4812
- }
4813
-
48145218 String GetFile(String dialogName)
48155219 {
4816
- if (GrafreeD.standAlone)
5220
+ if (Grafreed.standAlone)
48175221 {
48185222 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
48195223 browser.show();
....@@ -4877,10 +5281,18 @@
48775281 cButton flashSelectionButton;
48785282 cButton editButton;
48795283 cButton uneditButton;
5284
+ JCheckBox allParamsButton;
48805285 cButton clearpanelButton;
4881
- cButton allParamsButton;
48825286 cButton unselectButton;
48835287
5288
+ cButton minButton;
5289
+ cButton maxButton;
5290
+ cButton fullButton;
5291
+ cButton undoButton;
5292
+ cButton redoButton;
5293
+ cButton saveButton;
5294
+ cButton oneStepButton;
5295
+
48845296 cButton screenfitButton;
48855297 cButton screenfitpointButton;
48865298 cButton snapobjectButton;
....@@ -4891,14 +5303,6 @@
48915303 cButton closeButton;
48925304
48935305 cButton setsupportButton;
4894
-
4895
- cButton twoButton;
4896
- cButton sixButton;
4897
- cButton threeButton;
4898
- cButton sevenButton;
4899
- cButton fourButton; // full panel
4900
- cButton oneButton; // full XYZ
4901
- //cButton currentLayout;
49025306
49035307 //
49045308 //Composite
....@@ -4911,6 +5315,8 @@
49115315 private MenuItem lookFromItem;
49125316 private MenuItem switchItem;
49135317 private MenuItem cutItem;
5318
+ private MenuItem undoItem;
5319
+ private MenuItem redoItem;
49145320 private MenuItem duplicateItem;
49155321 private MenuItem cloneItem;
49165322 private MenuItem cloneSupportItem;
....@@ -4924,7 +5330,7 @@
49245330 private MenuItem linkverticesItem;
49255331 private MenuItem relinkverticesItem;
49265332 private MenuItem setMasterItem;
4927
- private MenuItem resetMeshItem;
5333
+ private MenuItem resetAllItem;
49285334 private MenuItem stepAllItem;
49295335 private MenuItem revertMeshItem;
49305336 private MenuItem poseMeshItem;
....@@ -4935,6 +5341,7 @@
49355341 private MenuItem mergeGeometriesItem;
49365342 private MenuItem copyItem;
49375343 private MenuItem pasteItem;
5344
+ private MenuItem pasteIntoItem;
49385345 private MenuItem pasteLinkItem;
49395346 private MenuItem pasteCloneItem;
49405347 private MenuItem pasteExpandItem;
....@@ -4973,6 +5380,10 @@
49735380 private MenuItem showleavesItem;
49745381 private MenuItem markleavesItem;
49755382 private MenuItem unmarkleavesItem;
5383
+ private MenuItem rewindleavesItem;
5384
+ private MenuItem unrewindleavesItem;
5385
+ private MenuItem randomleavesItem;
5386
+ private MenuItem unrandomleavesItem;
49765387
49775388 private MenuItem flipVItem;
49785389 private MenuItem unflipVItem;
....@@ -4984,8 +5395,10 @@
49845395 private MenuItem panoTexturesItem;
49855396
49865397 private MenuItem resetCentroidItem;
4987
- private MenuItem transformgeometryItem;
5398
+ private MenuItem resetCentroidXZItem;
49885399 private MenuItem resetTransformItem;
5400
+ private MenuItem transformGeometryItem;
5401
+ private MenuItem transformChildrenItem;
49895402 private MenuItem hideItem;
49905403 private MenuItem grabItem;
49915404 private MenuItem backItem;
....@@ -5007,6 +5420,7 @@
50075420
50085421 private MenuItem resetParentItem;
50095422 private MenuItem repairParentItem;
5423
+ private MenuItem repairShadowItem;
50105424 private MenuItem sortbysizeItem;
50115425 private MenuItem sortbynameItem;
50125426
....@@ -5031,7 +5445,7 @@
50315445 private MenuItem blobItem;
50325446 private MenuItem latheItem;
50335447 private MenuItem bezierItem;
5034
- private MenuItem checkerItem;
5448
+ private MenuItem overlayItem;
50355449 private MenuItem meshItem;
50365450 // private MenuItem meshGroupItem;
50375451 private MenuItem springItem;
....@@ -5053,11 +5467,6 @@
50535467 private MenuItem doubleItem;
50545468 private MenuItem tripleItem;
50555469
5056
- private MenuItem importGFDItem;
5057
- private MenuItem importVRMLX3DItem;
5058
- private MenuItem import3DSItem;
5059
- private MenuItem importOBJItem;
5060
-
50615470 private MenuItem computeAOItem;
50625471 private MenuItem recompileItem;
50635472 private MenuItem editScriptItem;
....@@ -5067,4 +5476,8 @@
50675476 private MenuItem analyzeItem;
50685477 private MenuItem dumpItem;
50695478 //boolean freezemodel = false;
5479
+
5480
+ Menu cameraMenu;
5481
+ MenuItem editCameraItem;
5482
+ MenuItem revertCameraItem;
50705483 }