Normand Briere
2019-06-09 c5b599b48b333b34e554b464aefbca0b9bc66275
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,124 @@
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
+ duplicateItem = menu.add(new MenuItem("Duplicate"));
158
+ duplicateItem.addActionListener(this);
159
+ cloneItem = menu.add(new MenuItem("Clone"));
160
+ cloneItem.addActionListener(this);
161
+ if (Globals.ADVANCED)
162
+ {
163
+ cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
164
+ cloneSupportItem.addActionListener(this);
165
+ }
166
+ menu.add("-");
167
+ cutItem = menu.add(new MenuItem("Cut"));
168
+ cutItem.addActionListener(this);
169
+ copyItem = menu.add(new MenuItem("Copy"));
170
+ copyItem.addActionListener(this);
171
+ pasteItem = menu.add(new MenuItem("Paste"));
172
+ pasteItem.addActionListener(this);
173
+ menu.add("-");
174
+
175
+ menu.add("-");
176
+ pasteIntoItem = menu.add(new MenuItem("Paste into"));
177
+ pasteIntoItem.addActionListener(this);
178
+ pasteLinkItem = menu.add(new MenuItem("Paste link"));
179
+ pasteLinkItem.addActionListener(this);
180
+ pasteCloneItem = menu.add(new MenuItem("Paste clone"));
181
+ pasteCloneItem.addActionListener(this);
182
+// pasteExpandItem = menu.add(new MenuItem("Paste expand"));
183
+// pasteExpandItem.addActionListener(this);
184
+ menu.add("-");
185
+ clearItem = menu.add(new MenuItem("Clear"));
186
+ clearItem.addActionListener(this);
187
+
188
+ if (Globals.ADVANCED)
189
+ {
190
+ // Deletes the cameras...
191
+ clearAllItem = menu.add(new MenuItem("Clear All"));
192
+ clearAllItem.addActionListener(this);
193
+ }
194
+
195
+ menuBar.add(cameraMenu = new Menu("View"));
196
+ //cameraMenu.add(zBufferItem = new CheckboxMenuItem("Z Buffer"));
197
+ //zBufferItem.addActionListener(this);
198
+ //cameraMenu.add(normalLensItem = new MenuItem("Normal Lens"));
199
+ //normalLensItem.addActionListener(this);
200
+ cameraMenu.add(revertCameraItem = new MenuItem("Revert Camera"));
201
+ revertCameraItem.addActionListener(this);
202
+
203
+ cameraMenu.add(toggleFullScreenItem = new CheckboxMenuItem("Full Screen"));
204
+ toggleFullScreenItem.addItemListener(this);
205
+ toggleFullScreenItem.setState(CameraPane.FULLSCREEN);
206
+ cameraMenu.add("-");
207
+
208
+ cameraMenu.add(toggleTextureItem = new CheckboxMenuItem("Texture"));
209
+ toggleTextureItem.addItemListener(this);
210
+ toggleTextureItem.setState(CameraPane.textureon);
211
+
212
+ cameraMenu.add(toggleSwitchItem = new CheckboxMenuItem("Switch"));
213
+ toggleSwitchItem.addItemListener(this);
214
+ toggleSwitchItem.setState(CameraPane.SWITCH);
215
+
216
+ cameraMenu.add(toggleHandleItem = new CheckboxMenuItem("Handles"));
217
+ toggleHandleItem.addItemListener(this);
218
+ toggleHandleItem.setState(CameraPane.HANDLES);
219
+
220
+ cameraMenu.add(togglePaintItem = new CheckboxMenuItem("Paint mode"));
221
+ togglePaintItem.addItemListener(this);
222
+ togglePaintItem.setState(CameraPane.PAINTMODE);
223
+
224
+ if (Globals.ADVANCED)
225
+ {
226
+ cameraMenu.add("-");
227
+ cameraMenu.add(toggleLiveItem = new CheckboxMenuItem("Live"));
228
+ toggleLiveItem.addItemListener(this);
229
+ toggleLiveItem.setState(Globals.isLIVE());
230
+
231
+ cameraMenu.add(stepItem = new MenuItem("Step"));
232
+ stepItem.addActionListener(this);
233
+ // cameraMenu.add(toggleDLItem = new CheckboxMenuItem("Display List"));
234
+ // toggleDLItem.addItemListener(this);
235
+ // toggleDLItem.setState(false);
236
+
237
+ cameraMenu.add(toggleRenderItem = new CheckboxMenuItem("Render"));
238
+ toggleRenderItem.addItemListener(this);
239
+ toggleRenderItem.setState(!CameraPane.frozen);
240
+
241
+ cameraMenu.add(toggleDebugItem = new CheckboxMenuItem("Debug"));
242
+ toggleDebugItem.addItemListener(this);
243
+ toggleDebugItem.setState(CameraPane.DEBUG);
244
+
245
+ cameraMenu.add(toggleFrustumItem = new CheckboxMenuItem("Frustum"));
246
+ toggleFrustumItem.addItemListener(this);
247
+ toggleFrustumItem.setState(CameraPane.FRUSTUM);
248
+
249
+ cameraMenu.add(toggleFootContactItem = new CheckboxMenuItem("Foot contact"));
250
+ toggleFootContactItem.addItemListener(this);
251
+ toggleFootContactItem.setState(CameraPane.FOOTCONTACT);
252
+
253
+ cameraMenu.add(toggleTimelineItem = new CheckboxMenuItem("Timeline"));
254
+ toggleTimelineItem.addItemListener(this);
255
+ }
256
+
257
+// cameraMenu.add(toggleRootItem = new CheckboxMenuItem("Alternate Root"));
258
+// toggleRootItem.addItemListener(this);
259
+// toggleRootItem.setState(false);
260
+// cameraMenu.add(animationItem = new CheckboxMenuItem("Animation"));
261
+// animationItem.addItemListener(this);
262
+// animationItem.setState(CameraPane.ANIMATION);
263
+ cameraMenu.add("-");
264
+ cameraMenu.add(editCameraItem = new MenuItem("Freeze Camera"));
265
+ editCameraItem.addActionListener(this);
266
+
267
+ if (Globals.ADVANCED)
268
+ {
152269 oe.cameraMenu.add(lookAtItem = new MenuItem("Set Interest"));
153270 //cameraMenu.add(lookFromItem = new MenuItem("Look From Selection"));
154271 //cameraMenu.add(switchItem = new MenuItem("Reverse View"));
....@@ -160,45 +277,17 @@
160277 lookAtItem.addActionListener(this);
161278 //lookFromItem.addActinoListener(this);
162279 //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
-
280
+ }
281
+
192282 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);
283
+ if (Globals.ADVANCED)
284
+ {
197285 revertMeshItem = menu.add(new MenuItem("Revert Meshes"));
198286 revertMeshItem.addActionListener(this);
199287 resetreferencesItem = menu.add(new MenuItem("Reset Mesh References"));
200288 resetreferencesItem.addActionListener(this);
201289 menu.add("-");
290
+ }
202291 overwriteGeoItem = menu.add(new MenuItem("Overwrite Geometry"));
203292 overwriteGeoItem.addActionListener(this);
204293 overwriteMatItem = menu.add(new MenuItem("Overwrite Material"));
....@@ -210,17 +299,26 @@
210299 overwriteUVItem = menu.add(new MenuItem("Overwrite UV"));
211300 overwriteUVItem.addActionListener(this);
212301 menu.add("-");
302
+ if (Globals.ADVANCED)
303
+ {
213304 generateMeshItem = menu.add(new MenuItem("Generate Meshes"));
214305 generateMeshItem.addActionListener(this);
215306 poseMeshItem = menu.add(new MenuItem("Set Pose Meshes"));
216307 poseMeshItem.addActionListener(this);
217308 menu.add("-");
309
+ }
218310 resetsupportItem = menu.add(new MenuItem("Reset support"));
219311 resetsupportItem.addActionListener(this);
220312 linkverticesItem = menu.add(new MenuItem("Link to Support"));
221313 linkverticesItem.addActionListener(this);
314
+ relinkverticesItem = menu.add(new MenuItem("Re-link to Support"));
315
+ relinkverticesItem.addActionListener(this);
316
+
317
+ if (Globals.ADVANCED)
318
+ {
222319 setMasterItem = menu.add(new MenuItem("Set Master Mesh"));
223320 setMasterItem.addActionListener(this);
321
+ }
224322
225323 oe.menuBar.add(menu = new Menu("Group"));
226324 grabItem = menu.add(new MenuItem("Grab"));
....@@ -231,27 +329,38 @@
231329 frontItem.addActionListener(this);
232330 compositeItem = menu.add(new MenuItem("Composite"));
233331 compositeItem.addActionListener(this);
332
+ hideItem = menu.add(new MenuItem("Hidden Group"));
333
+ hideItem.addActionListener(this);
334
+ ungroupItem = menu.add(new MenuItem("Ungroup"));
335
+ ungroupItem.addActionListener(this);
234336 menu.add("-");
235
- randomItem = menu.add(new MenuItem("Random"));
337
+ randomItem = menu.add(new MenuItem("Switch node"));
236338 randomItem.addActionListener(this);
237
- physicsItem = menu.add(new MenuItem("Physics"));
238
- physicsItem.addActionListener(this);
239
- frameselectorItem = menu.add(new MenuItem("Frame Selector"));
240
- frameselectorItem.addActionListener(this);
241339 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
242340 switchGeoItem.addActionListener(this);
243341 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
244342 switchTransfoItem.addActionListener(this);
245
- morphItem = menu.add(new MenuItem("Morph"));
343
+ morphItem = menu.add(new MenuItem("Morph Group"));
246344 morphItem.addActionListener(this);
345
+
346
+ if (Globals.ADVANCED)
347
+ {
348
+ menu.add("-");
349
+ physicsItem = menu.add(new MenuItem("Physics"));
350
+ physicsItem.addActionListener(this);
351
+ frameselectorItem = menu.add(new MenuItem("Frame Selector"));
352
+ frameselectorItem.addActionListener(this);
247353 scriptNodeItem = menu.add(new MenuItem("Script Node"));
248354 scriptNodeItem.addActionListener(this);
249355 cameraItem = menu.add(new MenuItem("Camera"));
250356 cameraItem.addActionListener(this);
357
+ }
251358
252359 oe.menuBar.add(menu = new Menu("Object"));
253360 textureItem = menu.add(new MenuItem("Texture"));
254361 textureItem.addActionListener(this);
362
+ billboardItem = menu.add(new MenuItem("Billboard"));
363
+ billboardItem.addActionListener(this);
255364 csgItem = menu.add(new MenuItem("CSG"));
256365 csgItem.addActionListener(this);
257366 shadowXItem = menu.add(new MenuItem("Shadow X"));
....@@ -260,23 +369,29 @@
260369 shadowYItem.addActionListener(this);
261370 shadowZItem = menu.add(new MenuItem("Shadow Z"));
262371 shadowZItem.addActionListener(this);
372
+ if (Globals.ADVANCED)
373
+ {
374
+ menu.add("-");
263375 linkerItem = menu.add(new MenuItem("Linker"));
264376 linkerItem.addActionListener(this);
265
- templateItem = menu.add(new MenuItem("Template"));
266
- templateItem.addActionListener(this);
267377 attributeItem = menu.add(new MenuItem("Attribute"));
268378 attributeItem.addActionListener(this);
379
+ templateItem = menu.add(new MenuItem("Template"));
380
+ templateItem.addActionListener(this);
269381 pointflowItem = menu.add(new MenuItem("Point Flow"));
270382 pointflowItem.addActionListener(this);
383
+ }
271384 menu.add("-");
272
- transformgeometryItem = menu.add(new MenuItem("Transform Geometry"));
273
- transformgeometryItem.addActionListener(this);
274385 resetTransformItem = menu.add(new MenuItem("Reset Transform"));
275386 resetTransformItem.addActionListener(this);
276387 resetCentroidItem = menu.add(new MenuItem("Reset Centroid"));
277388 resetCentroidItem.addActionListener(this);
278
- ungroupItem = menu.add(new MenuItem("Ungroup"));
279
- ungroupItem.addActionListener(this);
389
+ resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY"));
390
+ resetCentroidXZItem.addActionListener(this);
391
+ transformGeometryItem = menu.add(new MenuItem("Transform Geometry"));
392
+ transformGeometryItem.addActionListener(this);
393
+ transformChildrenItem = menu.add(new MenuItem("Transform Children"));
394
+ transformChildrenItem.addActionListener(this);
280395
281396 oe.menuBar.add(menu = new Menu("Geometry"));
282397 genUVItem = menu.add(new MenuItem("Generate UV"));
....@@ -287,6 +402,11 @@
287402 genNormalsCADItem.addActionListener(this);
288403 genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals"));
289404 genNormalsMESHItem.addActionListener(this);
405
+ if (Globals.ADVANCED)
406
+ {
407
+ genNormalsMINEItem = menu.add(new MenuItem("My Normals"));
408
+ genNormalsMINEItem.addActionListener(this);
409
+ }
290410 stripifyItem = menu.add(new MenuItem("Stripify"));
291411 stripifyItem.addActionListener(this);
292412 unstripifyItem = menu.add(new MenuItem("Unstripify"));
....@@ -308,23 +428,34 @@
308428 reduce34MeshItem.addActionListener(this);
309429 increaseMeshItem = menu.add(new MenuItem("Increase mesh"));
310430 increaseMeshItem.addActionListener(this);
311
- smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
312
- smoothMeshItem.addActionListener(this);
313431 clipMeshItem = menu.add(new MenuItem("Clip mesh"));
314432 clipMeshItem.addActionListener(this);
433
+
434
+ if (Globals.ADVANCED)
435
+ {
436
+ smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
437
+ smoothMeshItem.addActionListener(this);
438
+ }
315439
316440 oe.menuBar.add(menu = new Menu("Attributes"));
317441 clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
318442 clearMaterialsItem.addActionListener(this);
443
+ resetAllItem = menu.add(new MenuItem("Reset All"));
444
+ resetAllItem.addActionListener(this);
445
+ stepAllItem = menu.add(new MenuItem("Step All"));
446
+ stepAllItem.addActionListener(this);
319447 menu.add("-");
320448 liveleavesItem = menu.add(new MenuItem("Live Leaves"));
321449 liveleavesItem.addActionListener(this);
322450 unliveleavesItem = menu.add(new MenuItem("Unlive Leaves"));
323451 unliveleavesItem.addActionListener(this);
452
+ if (Globals.ADVANCED)
453
+ {
324454 supportleavesItem = menu.add(new MenuItem("Support Leaves"));
325455 supportleavesItem.addActionListener(this);
326456 unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves"));
327457 unsupportleavesItem.addActionListener(this);
458
+ }
328459 hideleavesItem = menu.add(new MenuItem("Hide Leaves"));
329460 hideleavesItem.addActionListener(this);
330461 showleavesItem = menu.add(new MenuItem("Show Leaves"));
....@@ -368,29 +499,22 @@
368499 sortbynameItem = menu.add(new MenuItem("Sort by name"));
369500 sortbynameItem.addActionListener(this);
370501 menu.add("-");
502
+ shareGeometriesItem = menu.add(new MenuItem("Share Geometries"));
503
+ shareGeometriesItem.addActionListener(this);
504
+ mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries"));
505
+ mergeGeometriesItem.addActionListener(this);
506
+ if (Globals.ADVANCED)
507
+ {
508
+ // Pretty much the same as duplicate and clone.
371509 extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
372510 extractGeometriesItem.addActionListener(this);
373511 cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry"));
374512 cloneGeometriesItem.addActionListener(this);
375
- shareGeometriesItem = menu.add(new MenuItem("Share Geometry"));
376
- shareGeometriesItem.addActionListener(this);
377
- mergeGeometriesItem = menu.add(new MenuItem("Merge Geometry"));
378
- mergeGeometriesItem.addActionListener(this);
513
+ }
379514
380515 oe.menuBar.add(menu = new Menu("Insert"));
381516 buildCreateMenu(menu);
382517
383
-
384
- oe.menuBar.add(menu = new Menu("Include"));
385
- importGFDItem = menu.add(new MenuItem("GrafreeD Object..."));
386
- importGFDItem.addActionListener(this);
387
- importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D Object..."));
388
- importVRMLX3DItem.addActionListener(this);
389
- importOBJItem = menu.add(new MenuItem("OBJ Object..."));
390
- importOBJItem.addActionListener(this);
391
- import3DSItem = menu.add(new MenuItem("3DS Object..."));
392
- import3DSItem.addActionListener(this);
393
-
394518 oe.menuBar.add(menu = new Menu("Tools"));
395519 buildToolsMenu(menu);
396520 }
....@@ -425,150 +549,98 @@
425549 oe.radioPanel.add(dummyButton);
426550 oe.buttonGroup.add(dummyButton);
427551 */
428
- aConstraints.gridy += 1;
429
- oe.aConstraints.gridwidth = 1;
430
- oe.aConstraints.gridx = 0;
552
+ //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
431553
432
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", CameraPane.isLIVE()), oe.aConstraints);
554
+ oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints);
555
+ liveCB.setToolTipText("Enable animation");
433556 liveCB.addItemListener(this);
434557
435
- oe.aConstraints.gridx += 1;
436
- oe.toolbarPanel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT), oe.aConstraints);
437
- supportCB.addItemListener(this);
438
-
439
- // oe.aConstraints.gridx += 1;
440
- // oe.toolbarPanel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), oe.aConstraints);
441
- // localCB.addItemListener(this);
442
-
443
- oe.aConstraints.gridx += 1;
444
- oe.toolbarPanel.add(crowdCB = new cCheckBox("Crowd", CameraPane.CROWD), oe.aConstraints);
445
- crowdCB.addItemListener(this);
446
-
447
- oe.aConstraints.gridx += 1;
448
- oe.toolbarPanel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA), oe.aConstraints);
449
- smoothCB.addItemListener(this);
450
-
451
- oe.aConstraints.gridx += 1;
452
- oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST), oe.aConstraints);
558
+ oe.toolbarPanel.add(oneStepButton = new cButton("Step", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
559
+ oneStepButton.setToolTipText("Animate one step forward");
560
+ oneStepButton.addActionListener(this);
561
+
562
+ oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints);
563
+ fastCB.setToolTipText("Fast mode");
453564 fastCB.addItemListener(this);
454
- oe.aConstraints.gridx += 1;
455
- oe.toolbarPanel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE), oe.aConstraints);
456
- slowCB.addItemListener(this);
457
- oe.aConstraints.gridx += 1;
458
- oe.toolbarPanel.add(boxCB = new cCheckBox("Box", CameraPane.FAST), oe.aConstraints);
459
- boxCB.addItemListener(this);
460
-
461
-// oe.aConstraints.gridx += 1;
462
-// oe.toolbarPanel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), oe.aConstraints);
463
-// speakerMocapCB.addItemListener(this);
464
-
465
- if (false)
466
- {
467
- // handled in scripts
468
- oe.aConstraints.gridx += 1;
469
- oe.toolbarPanel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA), oe.aConstraints);
470
- speakerCameraCB.addItemListener(this);
471
-
472
- oe.aConstraints.gridx += 1;
473
- oe.toolbarPanel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS), oe.aConstraints);
474
- speakerFocusCB.addItemListener(this);
475
-
476
- oe.aConstraints.gridx += 1;
477
- oe.toolbarPanel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS), oe.aConstraints);
478
- smoothfocusCB.addItemListener(this);
479
- }
480
-
481
-//oe.aConstraints.gridx += 1;
482
-//oe.toolbarPanel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), oe.aConstraints);
483
-// debugCB.addItemListener(this);
484
-
485
- oe.aConstraints.gridx += 1;
486
- oe.toolbarPanel.add(oeilCB = new cCheckBox("O", CameraPane.OEIL), oe.aConstraints);
487
- oeilCB.addItemListener(this);
488
-
489
- oe.aConstraints.gridx += 1;
490
- oe.toolbarPanel.add(lookAtCB = new cCheckBox("T", CameraPane.LOOKAT), oe.aConstraints);
491
- lookAtCB.addItemListener(this);
492
-
493
- oe.aConstraints.gridx += 1;
494
- oe.toolbarPanel.add(trackCB = new cCheckBox(":", CameraPane.TRACK), oe.aConstraints);
565
+
566
+ oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
567
+ trackCB.setToolTipText("Enable tracking");
495568 trackCB.addItemListener(this);
496569
497
- oe.aConstraints.gridx += 1;
498
- oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
570
+ oe.toolbarPanel.add(screenfitButton = new cButton("@", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
571
+ screenfitButton.setToolTipText("Screen fit");
499572 screenfitButton.addActionListener(this);
500
- oe.aConstraints.gridx += 1;
573
+
501574 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
502575 // screenfitpointButton.addActionListener(this);
503
-// oe.aConstraints.gridx += 1;
504
- oe.toolbarPanel.add(snapobjectButton = new cButton(" O+ ")); //, oe.aConstraints);
505
- snapobjectButton.addActionListener(this);
506
- oe.aConstraints.gridx += 1;
507576
508
- //aConstraints.gridx = 0;
509
- //aConstraints.gridy += 1;
510
- oe.aConstraints.weighty = 0;
511
- oe.aConstraints.gridwidth = 1;
512
-
513
- oe.toolbarPanel.add(flashSelectionButton = new cButton(" ? ")); //, oe.aConstraints);
577
+ if (Globals.ADVANCED)
578
+ {
579
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
580
+ snapobjectButton.addActionListener(this);
581
+ snapobjectButton.setToolTipText("Snap Object");
582
+ }
583
+
584
+ oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
585
+ flashSelectionButton.setToolTipText("Show selection");
514586 flashSelectionButton.addActionListener(this);
515
- oe.aConstraints.gridx += 1;
516
- oe.aConstraints.weighty = 0;
517
- oe.aConstraints.gridwidth = 1;
518587
519
- //
520
- oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints);
588
+ oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
589
+
590
+ oe.toolbarPanel.add(twoButton = new cButton("|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
591
+ twoButton.setToolTipText("Show center view only");
521592 twoButton.addActionListener(this);
522
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
593
+ oe.toolbarPanel.add(fourButton = new cButton("+||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
523594 fourButton.addActionListener(this);
524
- oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
595
+ fourButton.setToolTipText("Show left panel only");
596
+ oe.toolbarPanel.add(sixButton = new cButton("+|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
597
+ sixButton.setToolTipText("2-column layout left");
525598 sixButton.addActionListener(this);
526
- oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
599
+ oe.toolbarPanel.add(threeButton = new cButton("|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
600
+ threeButton.setToolTipText("2-column layout right");
527601 threeButton.addActionListener(this);
528
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
602
+ oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
603
+ sevenButton.setToolTipText("3-column layout");
529604 sevenButton.addActionListener(this);
530605 //
531606
532
- oe.toolbarPanel.add(rootButton = new cButton(" o o o E ")); //, oe.aConstraints);
607
+ oe.toolbarPanel.add(rootButton = new cButton("o o o", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
608
+ rootButton.setToolTipText("Edit selection in new tab");
533609 rootButton.addActionListener(this);
534
- oe.aConstraints.gridx += 1;
535
- oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
610
+
611
+ oe.toolbarPanel.add(closeButton = new cButton("X", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
612
+ closeButton.setToolTipText("Close tab");
536613 closeButton.addActionListener(this);
537614 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
538615 //clearButton.addActionListener(this);
539
- oe.aConstraints.gridx += 1;
540616
541
- oe.aConstraints.gridx = 1; //
542
- oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints);
617
+ cGridBag commandsPanel = new cGridBag();
618
+
619
+ commandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
620
+ editButton.setToolTipText("Edit selection");
543621 editButton.addActionListener(this);
544
- oe.aConstraints.gridx += 1;
545
- oe.aConstraints.weighty = 0;
546
- oe.aConstraints.gridwidth = 1;
547622
548
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
623
+ commandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
624
+ uneditButton.setToolTipText("Unedit selection");
549625 uneditButton.addActionListener(this);
550626
551
- oe.aConstraints.gridx += 1;
552
- oe.aConstraints.weighty = 0;
553
- oe.aConstraints.gridwidth = 1;
554
-
555
- oe.treePanel.add(clearPanelButton = new cButton("C"), oe.aConstraints);
556
- clearPanelButton.addActionListener(this);
557
-
558
- oe.aConstraints.gridx += 1;
559
- oe.aConstraints.weighty = 0;
560
- oe.aConstraints.gridwidth = 1;
561
-
562
- oe.treePanel.add(allParamsButton = new cButton("A"), oe.aConstraints);
627
+ commandsPanel.add(allParamsButton = new JCheckBox("All", allparams)); //, oe.aConstraints);
628
+ allParamsButton.setToolTipText("Edit all params");
563629 allParamsButton.addActionListener(this);
564630
565
- oe.aConstraints.gridx += 1;
566
- oe.aConstraints.weighty = 0;
567
- oe.aConstraints.gridwidth = 1;
568
-
569
- oe.treePanel.add(unselectButton = new cButton("U"), oe.aConstraints);
631
+ commandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
632
+ clearPanelButton.setToolTipText("Clear edit panel");
633
+ clearPanelButton.addActionListener(this);
634
+
635
+ commandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
636
+ unselectButton.setToolTipText("Unselect");
570637 unselectButton.addActionListener(this);
571638
639
+ commandsPanel.preferredHeight = 1;
640
+
641
+ oe.treePanel.add(commandsPanel);
642
+ oe.treePanel.Return();
643
+
572644 // oe.aConstraints.gridx += 1;
573645 // oe.aConstraints.weighty = 0;
574646 // oe.aConstraints.gridwidth = 1;
....@@ -580,40 +652,37 @@
580652 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
581653 // gcButton.addActionListener(this);
582654
583
- oe.aConstraints.gridx = 0;
584
- oe.aConstraints.gridy += 1;
585
-
586
- //ctrlPanel.add(objList = new List(5, true));
587
- oe.aConstraints.gridwidth = 100;
588
- // oe.aConstraints.gridheight = 100;
589
- oe.aConstraints.fill = GridBagConstraints.BOTH; // HORIZONTAL;
590
- oe.aConstraints.gridheight = 1;
591
- oe.aConstraints.weighty = 0.5;
592
- oe.aConstraints.gridx = 0;
593
- JScrollPane jSP;
655
+ cGridBag jSPPanel = new cGridBag();
656
+
657
+ JScrollPane jSP;
594658 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
595
- oe.treePanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null)), oe.aConstraints);
659
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints);
596660 ResetModel();
597
- oe.aConstraints.weighty = 0.5;
598
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
599
- oe.aConstraints.gridy += 1;
600
- oe.aConstraints.gridwidth = 1;
661
+
662
+ oe.treePanel.add(jSPPanel);
663
+ oe.treePanel.Return();
601664
602
- oe.aConstraints.weighty = 0;
603
- oe.aConstraints.gridwidth = 2;
604
-
605
- oe.treePanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0), oe.aConstraints);
665
+ cGridBag copyOptionsPanel = new cGridBag();
666
+
667
+ copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
668
+ colorCB.setToolTipText("Copy color when dropped");
606669 colorCB.addItemListener(this);
607
- oe.aConstraints.gridx += 2;
608
- oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints);
670
+
671
+ copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
672
+ materialCB.setToolTipText("Copy material when dropped");
609673 materialCB.addItemListener(this);
610
- oe.aConstraints.gridx += 2;
611
- oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints);
674
+
675
+ copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
676
+ textureCB.setToolTipText("Copy texture when dropped");
612677 textureCB.addItemListener(this);
613678
614
- oe.aConstraints.gridx = 0;
615
- oe.aConstraints.gridy += 1;
679
+ copyOptionsPanel.preferredHeight = 1;
680
+ oe.treePanel.add(copyOptionsPanel);
681
+ oe.treePanel.Return();
616682
683
+// mainPanel.setDividerLocation(0.5); //1.0);
684
+// mainPanel.setResizeWeight(0.5);
685
+
617686 //jList.addListSelectionListener(this);
618687 oe.jTree.addTreeSelectionListener(this);
619688 //jTree.setRootVisible(false);
....@@ -635,18 +704,91 @@
635704 radio.layout = sevenButton;
636705 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
637706 }
707
+
708
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
709
+ {
710
+ panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
711
+ boxCB.setToolTipText("Display bounding boxes");
712
+ boxCB.addItemListener(this);
713
+
714
+ panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
715
+ zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
716
+ zoomBoxCB.addItemListener(this);
717
+
718
+ if (true) // Globals.ADVANCED)
719
+ {
720
+ panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
721
+ supportCB.setToolTipText("Enable rigging");
722
+ supportCB.addItemListener(this);
723
+
724
+ // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
725
+ // localCB.addItemListener(this);
726
+
727
+ panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
728
+ crowdCB.setToolTipText("Used for crowds");
729
+ crowdCB.addItemListener(this);
730
+
731
+ panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
732
+ smoothCB.setToolTipText("Snapping delay");
733
+ smoothCB.addItemListener(this);
734
+
735
+ panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
736
+ slowCB.setToolTipText("Smooth interpolation");
737
+ slowCB.addItemListener(this);
738
+
739
+// constraints.gridy += 1;
740
+// panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
741
+// speakerMocapCB.addItemListener(this);
742
+
743
+ if (false)
744
+ {
745
+ // handled in scripts
746
+ //constraints.gridy += 1;
747
+ panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints);
748
+ speakerCameraCB.addItemListener(this);
749
+
750
+ //constraints.gridy += 1;
751
+ panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints);
752
+ speakerFocusCB.addItemListener(this);
753
+
754
+ //constraints.gridy += 1;
755
+ panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
756
+ smoothfocusCB.addItemListener(this);
757
+ }
758
+
759
+//constraints.gridx += 1;
760
+//panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
761
+// debugCB.addItemListener(this);
762
+
763
+ panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
764
+ oeilCB.addItemListener(this);
765
+
766
+ panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
767
+ lookAtCB.setToolTipText("Look-at target");
768
+ lookAtCB.addItemListener(this);
769
+
770
+ }
771
+
772
+ cGridBag fill = new cGridBag();
773
+
774
+ fill.preferredHeight = 200;
775
+
776
+ panel.add(fill);
777
+
778
+ }
638779
639780 void EditObject(Object3D obj)
640781 {
641
- cRadio dummyButton = new cRadio(obj.name);
642
- dummyButton.SetObject(obj);
643
- dummyButton.layout = sevenButton;
644
- dummyButton.SetCamera(cameraView.renderCamera, false);
645
- dummyButton.addActionListener(this);
646
- radioPanel.add(dummyButton);
647
- buttonGroup.add(dummyButton);
648
- dummyButton.doClick();
782
+ cRadio radioButton = new cRadio(obj.name);
783
+ radioButton.SetObject(obj);
784
+ radioButton.layout = sevenButton;
785
+ radioButton.SetCamera(cameraView.renderCamera, false);
786
+ radioButton.addActionListener(this);
787
+ radioPanel.add(radioButton);
788
+ buttonGroup.add(radioButton);
789
+ radioButton.doClick();
649790 }
791
+
650792 void SetupViews(ObjEditor oe)
651793 {
652794 oe.SetupViews();
....@@ -665,6 +807,7 @@
665807 JCheckBox fastCB;
666808 JCheckBox slowCB;
667809 JCheckBox boxCB;
810
+ JCheckBox zoomBoxCB;
668811 JCheckBox trackCB;
669812 JCheckBox smoothfocusCB;
670813 // JCheckBox speakerMocapCB;
....@@ -707,8 +850,7 @@
707850 dropAttributes |= Object3D.TEXTURE;
708851 else
709852 dropAttributes &= ~Object3D.TEXTURE;
710
- }
711
- else if(e.getSource() == liveCB)
853
+ } else if(e.getSource() == liveCB)
712854 {
713855 cameraView.ToggleLive();
714856 }
....@@ -745,6 +887,10 @@
745887 Recompile();
746888 cameraView.repaint();
747889 // refreshContents();
890
+ }
891
+ else if(e.getSource() == zoomBoxCB)
892
+ {
893
+ cameraView.ToggleZoomBoxMode();
748894 }
749895 else if(e.getSource() == smoothfocusCB)
750896 {
....@@ -859,7 +1005,9 @@
8591005 // objEditor.DropFile((java.io.File[]) object, true);
8601006 // return;
8611007 // }
862
- if (string.charAt(0) == '/')
1008
+
1009
+ // File path for Mac and Windows
1010
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
8631011 {
8641012 // file(s)
8651013 String[] names = string.split("\n");
....@@ -886,7 +1034,7 @@
8861034
8871035 flashIt = false;
8881036 CameraPane pane = (CameraPane) target;
889
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1037
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
8901038 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
8911039
8921040 if (group.selection.size() == 1)
....@@ -913,11 +1061,11 @@
9131061 {
9141062 loadClipboard(true);
9151063 objEditor.jTree.setSelectionPath(destinationPath);
916
- pasteInto(false);
1064
+ pasteInto(false, false);
9171065 } else {
9181066 loadClipboard(false);
9191067 objEditor.jTree.setSelectionPath(destinationPath);
920
- pasteInto(false); // true); // ???
1068
+ pasteInto(false, false); // true); // ???
9211069 }
9221070 }
9231071 public void dropActionChanged(DropTargetDragEvent dtde)
....@@ -1035,29 +1183,37 @@
10351183 torusItem.addActionListener(this);
10361184 superItem = menu.add(new MenuItem("Superellipsoid"));
10371185 superItem.addActionListener(this);
1186
+ kleinItem = menu.add(new MenuItem("Klein Bottle"));
1187
+ kleinItem.addActionListener(this);
10381188 particleItem = menu.add(new MenuItem("Particle system"));
10391189 particleItem.addActionListener(this);
1190
+ if (Globals.ADVANCED)
1191
+ {
10401192 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10411193 ragdollItem.addActionListener(this);
10421194 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10431195 ragdoll2Item.addActionListener(this);
1196
+ }
10441197 menu.add("-");
1045
- meshItem = menu.add(new MenuItem("Mesh"));
1198
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10461199 meshItem.addActionListener(this);
10471200 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10481201 // meshGroupItem.addActionListener(this);
1202
+ if (Globals.ADVANCED)
1203
+ {
10491204 springItem = menu.add(new MenuItem("Spring"));
10501205 springItem.addActionListener(this);
10511206 flagItem = menu.add(new MenuItem("Flag"));
10521207 flagItem.addActionListener(this);
1053
- bezierItem = menu.add(new MenuItem("Patch"));
1054
- bezierItem.addActionListener(this);
1055
- checkerItem = menu.add(new MenuItem("Checker"));
1056
- checkerItem.addActionListener(this);
10571208 blobItem = menu.add(new MenuItem("Blob"));
10581209 blobItem.addActionListener(this);
10591210 latheItem = menu.add(new MenuItem("Lathe"));
10601211 latheItem.addActionListener(this);
1212
+ }
1213
+ bezierItem = menu.add(new MenuItem("Bezier Patch"));
1214
+ bezierItem.addActionListener(this);
1215
+ overlayItem = menu.add(new MenuItem("Overlay"));
1216
+ overlayItem.addActionListener(this);
10611217 lightItem = menu.add(new MenuItem("Light"));
10621218 lightItem.addActionListener(this);
10631219 menu.add("-");
....@@ -1067,34 +1223,39 @@
10671223 loopItem.addActionListener(this);
10681224 doubleItem = menu.add(new MenuItem("Fork"));
10691225 doubleItem.addActionListener(this);
1226
+ if (Globals.ADVANCED)
1227
+ {
10701228 tripleItem = menu.add(new MenuItem("Trident"));
10711229 tripleItem.addActionListener(this);
1230
+ }
10721231 }
10731232
10741233 void buildToolsMenu(Menu menu)
10751234 {
10761235 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
10771236 animationItem.addItemListener(this);
1078
- animationItem.setState(CameraPane.ANIMATION);
1237
+ animationItem.setState(Globals.ANIMATION);
10791238
10801239 menu.add("-");
10811240 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
10821241 parseverticesItem.addActionListener(this);
10831242 textureFieldItem = menu.add(new MenuItem("Texture Field"));
10841243 textureFieldItem.addActionListener(this);
1085
- alignItem = menu.add(new MenuItem("Align"));
1244
+ alignItem = menu.add(new MenuItem("Align Objects"));
10861245 alignItem.addActionListener(this);
1087
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1088
- mirrorItem.addActionListener(this);
10891246 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
10901247 reduceMorphItem.addActionListener(this);
10911248 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
10921249 reduce34MorphItem.addActionListener(this);
1093
-
1250
+ menu.add("-");
10941251 menu.add(computeAOItem = new MenuItem("Compute AO"));
10951252 computeAOItem.addActionListener(this);
1096
- menu.add("-");
10971253
1254
+ if (Globals.ADVANCED)
1255
+ {
1256
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1257
+ mirrorItem.addActionListener(this);
1258
+ menu.add("-");
10981259 menu.add(memoryItem = new MenuItem("Memory Usage"));
10991260 memoryItem.addActionListener(this);
11001261 menu.add(analyzeItem = new MenuItem("Analyze"));
....@@ -1108,6 +1269,8 @@
11081269 resetParentItem.addActionListener(this);
11091270 repairParentItem = menu.add(new MenuItem("Repair Parent"));
11101271 repairParentItem.addActionListener(this);
1272
+ repairShadowItem = menu.add(new MenuItem("Repair Shadow"));
1273
+ repairShadowItem.addActionListener(this);
11111274 menu.add(invariantsItem = new MenuItem("Invariants"));
11121275 invariantsItem.addActionListener(this);
11131276 menu.add(recompileItem = new MenuItem("Recompile"));
....@@ -1115,6 +1278,7 @@
11151278 menu.add("-");
11161279 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11171280 editScriptItem.addActionListener(this);
1281
+ }
11181282 }
11191283
11201284 void ScreenFit()
....@@ -1443,9 +1607,9 @@
14431607
14441608 void Overwrite(int mask)
14451609 {
1446
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
1610
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14471611 {
1448
- Object3D content = GrafreeD.clipboard.get(0);
1612
+ Object3D content = Grafreed.clipboard.get(0);
14491613
14501614 if (content instanceof cGroup && ((cGroup)content).transientlink )
14511615 content = ((cGroup)content).get(0);
....@@ -1468,6 +1632,7 @@
14681632 //
14691633 public void actionPerformed(ActionEvent event) // , Object arg)
14701634 {
1635
+ Object source = event.getSource();
14711636 /*
14721637 if (event.getSource() == nameField)
14731638 {
....@@ -1479,11 +1644,11 @@
14791644 }
14801645 else
14811646 */
1482
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1647
+ if (source == lookAtItem || source == lookFromItem)
14831648 {
14841649 ScreenFit();
14851650 } else
1486
- if (event.getSource() == switchItem)
1651
+ if (source == switchItem)
14871652 {
14881653 cVector v1 = new cVector();
14891654 cVector v2 = new cVector();
....@@ -1492,11 +1657,11 @@
14921657 objEditor.cameraView.renderCamera.setAim(v2, v1);
14931658 objEditor.cameraView.repaint();
14941659 } else
1495
- if (event.getSource() == rectoidItem)
1660
+ if (source == rectoidItem)
14961661 {
14971662 makeSomething(new Box());
14981663 } else
1499
- if (event.getSource() == particleItem)
1664
+ if (source == particleItem)
15001665 {
15011666 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15021667 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1517,9 +1682,9 @@
15171682 applyExample(particleGeom, "SMOKE");
15181683 makeSomething(particleGeom);
15191684 } else
1520
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1685
+ if (source == ragdollItem || source == ragdoll2Item)
15211686 {
1522
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1687
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15231688
15241689 ragdoll.toParent = LA.newMatrix();
15251690 ragdoll.fromParent = LA.newMatrix();
....@@ -1537,7 +1702,7 @@
15371702 } else
15381703 /*
15391704 */
1540
- if (event.getSource() == heightFieldItem)
1705
+ if (source == heightFieldItem)
15411706 {
15421707 Object3D obj = new Object3D();
15431708
....@@ -1575,27 +1740,31 @@
15751740
15761741 makeSomething(obj);
15771742 } else
1578
- if (event.getSource() == gridItem)
1743
+ if (source == gridItem)
15791744 {
15801745 makeSomething(new Grid());
15811746 } else
1582
- if (event.getSource() == ellipsoidItem)
1747
+ if (source == ellipsoidItem)
15831748 {
15841749 makeSomething(new Sphere());
15851750 } else
1586
- if (event.getSource() == coneItem)
1751
+ if (source == coneItem)
15871752 {
15881753 makeSomething(new Cone());
15891754 } else
1590
- if (event.getSource() == torusItem)
1755
+ if (source == torusItem)
15911756 {
15921757 makeSomething(new Torus());
15931758 } else
1594
- if (event.getSource() == superItem)
1759
+ if (source == superItem)
15951760 {
15961761 makeSomething(new Superellipsoid());
15971762 } else
1598
- if (event.getSource() == blobItem)
1763
+ if (source == kleinItem)
1764
+ {
1765
+ makeSomething(new Klein());
1766
+ } else
1767
+ if (source == blobItem)
15991768 {
16001769 Blob blob = new Blob();
16011770 BlobComponent comp = new BlobComponent();
....@@ -1603,15 +1772,15 @@
16031772 //blob.retile();
16041773 makeSomething(blob);
16051774 } else
1606
- if (event.getSource() == latheItem)
1775
+ if (source == latheItem)
16071776 {
16081777 makeSomething(new Lathe());
16091778 } else
1610
- if (event.getSource() == bezierItem)
1779
+ if (source == bezierItem)
16111780 {
16121781 makeSomething(new BezierSurface());
16131782 } else
1614
- if (event.getSource() == checkerItem)
1783
+ if (source == overlayItem)
16151784 {
16161785 /*
16171786 Object3D obj = new BezierSurface(5,8);
....@@ -1626,7 +1795,7 @@
16261795 */
16271796 makeSomething(new Checker());
16281797 } else
1629
- if (event.getSource() == meshItem)
1798
+ if (source == meshItem)
16301799 {
16311800 Object3D itemtomake = new Object3D();
16321801 Object3D child;
....@@ -1647,35 +1816,35 @@
16471816 makeSomething(child);
16481817 }
16491818 } else
1650
- if (event.getSource() == springItem)
1819
+ if (source == springItem)
16511820 {
16521821 cSpring s = new cSpring();
16531822 s.setup();
16541823 makeSomething(s);
16551824 } else
1656
- if (event.getSource() == flagItem)
1825
+ if (source == flagItem)
16571826 {
16581827 cSpring s = new cFlag();
16591828 s.setup();
16601829 makeSomething(s);
16611830 } else
1662
- if (event.getSource() == lightItem)
1831
+ if (source == lightItem)
16631832 {
16641833 makeSomething(new Light());
16651834 } else
1666
- if (event.getSource() == csgItem)
1835
+ if (source == csgItem)
16671836 {
16681837 group(new CSG());
16691838 } else
1670
- if (event.getSource() == templateItem)
1839
+ if (source == templateItem)
16711840 {
16721841 group(new cTemplate());
16731842 } else
1674
- if (event.getSource() == attributeItem)
1843
+ if (source == attributeItem)
16751844 {
16761845 makeSomething(new Attribute());
16771846 } else
1678
- if (event.getSource() == pointflowItem)
1847
+ if (source == pointflowItem)
16791848 {
16801849 makeSomething(new PointFlow());
16811850 } else
....@@ -1687,7 +1856,7 @@
16871856 } else
16881857 */
16891858
1690
- if (event.getSource() == superLoopItem)
1859
+ if (source == superLoopItem)
16911860 {
16921861 Composite g = new cGroup();
16931862 for (int i=0; i<15; i++)
....@@ -1709,7 +1878,7 @@
17091878
17101879 group(g);
17111880 } else
1712
- if (event.getSource() == loopItem)
1881
+ if (source == loopItem)
17131882 {
17141883 Composite csg = new GroupLeaf();
17151884 csg.count = 5;
....@@ -1718,7 +1887,7 @@
17181887 csg.addChild(child);
17191888 child.addChild(csg);
17201889 } else
1721
- if (event.getSource() == doubleItem)
1890
+ if (source == doubleItem)
17221891 {
17231892 Composite csg = new GroupLeaf();
17241893 csg.count = 5;
....@@ -1730,7 +1899,7 @@
17301899 csg.addChild(child);
17311900 child.addChild(csg);
17321901 } else
1733
- if (event.getSource() == tripleItem)
1902
+ if (source == tripleItem)
17341903 {
17351904 Composite csg = new GroupLeaf();
17361905 csg.count = 4;
....@@ -1745,71 +1914,59 @@
17451914 csg.addChild(child);
17461915 child.addChild(csg);
17471916 } else
1748
-
1749
- if (event.getSource() == importGFDItem)
1917
+ if (source == computeAOItem)
17501918 {
1751
- ImportGFD();
1919
+ Globals.drawMode = CameraPane.OCCLUSION;
1920
+ Globals.theRenderer.repaint();
17521921 } else
1753
- if (event.getSource() == importVRMLX3DItem)
1754
- {
1755
- ImportVRMLX3D();
1756
- } else
1757
- if (event.getSource() == import3DSItem)
1758
- {
1759
- objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
1760
- } else
1761
- if (event.getSource() == importOBJItem)
1762
- {
1763
- objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1764
- } else
1765
- if (event.getSource() == computeAOItem)
1766
- {
1767
- CameraPane.drawMode = CameraPane.OCCLUSION;
1768
- CameraPane.theRenderer.repaint();
1769
- } else
1770
- if (event.getSource() == recompileItem)
1922
+ if (source == recompileItem)
17711923 {
17721924 Recompile();
17731925 refreshContents();
17741926 } else
1775
- if (event.getSource() == editScriptItem)
1927
+ if (source == editScriptItem)
17761928 {
17771929 OpenDialog();
17781930 refreshContents();
17791931 } else
1780
- if (event.getSource() == invariantsItem)
1932
+ if (source == invariantsItem)
17811933 {
17821934 System.out.println("Invariants:");
1783
- GrafreeD.theApplet3D.universe.invariants();
1935
+ Grafreed.grafreeD.universe.invariants();
17841936 } else
1785
- if (event.getSource() == memoryItem)
1937
+ if (source == memoryItem)
17861938 {
17871939 //System.out.println("Invariants:");
17881940 PrintMemory();
17891941 } else
1790
- if (event.getSource() == pathItem)
1942
+ if (source == pathItem)
17911943 {
17921944 PrintPath();
17931945 } else
1794
- if (event.getSource() == analyzeItem)
1946
+ if (source == analyzeItem)
17951947 {
17961948 AnalyzeObject();
17971949 } else
1798
- if (event.getSource() == dumpItem)
1950
+ if (source == dumpItem)
17991951 {
18001952 DumpObject();
18011953 } else
1802
- if (event.getSource() == screenfitButton)
1954
+ if (source == oneStepButton)
1955
+ {
1956
+ Globals.ONESTEP = true;
1957
+ cameraView.repaint();
1958
+ } else
1959
+ if (source == screenfitButton)
18031960 {
18041961 //Reload(lastConverter, lastFilename, true);
18051962 ScreenFit();
18061963 } else
1807
- if (event.getSource() == screenfitpointButton)
1964
+ if (source == screenfitpointButton)
18081965 {
18091966 //Reload(lastConverter, lastFilename, true);
18101967 ScreenFitPoint();
18111968 } else
1812
- if (event.getSource() == snapobjectButton)
1969
+ if (source == snapobjectButton)
18131970 {
18141971 //Reload(lastConverter, lastFilename, true);
18151972 SnapObject();
....@@ -1820,13 +1977,13 @@
18201977 // Recompile();
18211978 // refreshContents();
18221979 // } else
1823
- if (event.getSource() == gcButton)
1980
+ if (source == gcButton)
18241981 {
18251982 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18261983 System.gc();
18271984 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18281985 } else
1829
- if (event.getSource() == editLeafItem)
1986
+ if (source == editLeafItem)
18301987 {
18311988 Object3D obj;
18321989 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1840,62 +1997,66 @@
18401997 }
18411998 refreshContents(true);
18421999 } else
1843
- if (event.getSource() == openWindowItem)
2000
+ if (source == openWindowItem)
18442001 {
18452002 EditSelection(true);
18462003 } else
1847
- if (event.getSource() == cutItem || event.getSource() == clearButton)
2004
+ if (source == cutItem || source == clearButton)
18482005 {
18492006 loadClipboard(true);
18502007 } else
1851
- if (event.getSource() == duplicateItem)
2008
+ if (source == duplicateItem)
18522009 {
1853
- Object3D keep = GrafreeD.clipboard;
2010
+ Object3D keep = Grafreed.clipboard;
18542011 loadClipboard(false);
18552012 paste(false);
1856
- GrafreeD.clipboard = keep;
2013
+ Grafreed.clipboard = keep;
18572014 } else
1858
- if (event.getSource() == cloneItem)
2015
+ if (source == cloneItem)
18592016 {
18602017 CloneSelection(false);
18612018 } else
1862
- if (event.getSource() == cloneSupportItem)
2019
+ if (source == cloneSupportItem)
18632020 {
18642021 CloneSelection(true);
18652022 } else
1866
- if (event.getSource() == copyItem)
2023
+ if (source == copyItem)
18672024 {
18682025 loadClipboard(false);
18692026 } else
1870
- if (event.getSource() == pasteItem)
2027
+ if (source == pasteItem)
18712028 {
18722029 paste(false);
18732030 } else
1874
- if (event.getSource() == pasteLinkItem)
2031
+ if (source == pasteIntoItem)
18752032 {
1876
- pasteInto(false);
2033
+ pasteInto(true, false);
18772034 } else
1878
- if (event.getSource() == pasteCloneItem)
2035
+ if (source == pasteLinkItem)
18792036 {
1880
- pasteInto(true);
2037
+ pasteInto(false, false);
18812038 } else
1882
- if (event.getSource() == pasteExpandItem)
2039
+ if (source == pasteCloneItem)
2040
+ {
2041
+ pasteInto(true, true);
2042
+ } else
2043
+ if (source == pasteExpandItem)
18832044 {
18842045 paste(true);
18852046 } else
1886
- if (event.getSource() == synchronizeItem)
2047
+ if (source == synchronizeItem)
18872048 {
18882049 Overwrite(Object3D.TRANSFORM);
18892050 } else
1890
- if (event.getSource() == overwriteNameItem)
2051
+ if (source == overwriteNameItem)
18912052 {
18922053 Overwrite(Object3D.NAME);
18932054 } else
1894
- if (event.getSource() == overwriteUVItem)
2055
+ if (source == overwriteUVItem)
18952056 {
18962057 Overwrite(Object3D.UV);
18972058 } else
1898
- if (event.getSource() == overwriteMatItem)
2059
+ if (source == overwriteMatItem)
18992060 {
19002061 /* july 2015
19012062 if ((dropAttributes & Object3D.TEXTURE) == 0)
....@@ -1915,7 +2076,7 @@
19152076
19162077 Overwrite(dropAttributes);
19172078 }
1918
- if (event.getSource() == overwriteGeoItem)
2079
+ if (source == overwriteGeoItem)
19192080 {
19202081 Overwrite(Object3D.GEOMETRY);
19212082 // if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
....@@ -1932,7 +2093,7 @@
19322093 // refreshContents();
19332094 // }
19342095 } else
1935
- if (event.getSource() == generateMeshItem)
2096
+ if (source == generateMeshItem)
19362097 {
19372098 //if (group.selection.size() == 1)
19382099 // for (int i=0; i<group.selection.size(); i++)
....@@ -1943,7 +2104,7 @@
19432104 ResetModel();
19442105 refreshContents();
19452106 } else
1946
- if (event.getSource() == extractGeometriesItem)
2107
+ if (source == extractGeometriesItem)
19472108 {
19482109 boolean one = false;
19492110
....@@ -1970,7 +2131,7 @@
19702131 ResetModel();
19712132 refreshContents();
19722133 } else
1973
- if (event.getSource() == cloneGeometriesItem)
2134
+ if (source == cloneGeometriesItem)
19742135 {
19752136 boolean one = false;
19762137
....@@ -1996,32 +2157,37 @@
19962157 ResetModel();
19972158 refreshContents();
19982159 } else
1999
- if (event.getSource() == shareGeometriesItem)
2160
+ if (source == shareGeometriesItem)
20002161 {
20012162 boolean one = false;
20022163
20032164 if (group.selection.size() == 1)
20042165 one = true;
20052166
2167
+ Object3D merge = null;
2168
+
20062169 Object3D content = new cGroup();
20072170
20082171 for (int i=0; i<group.selection.size(); i++)
20092172 {
2010
- Object3D sel = new Merge(group.selection.get(i));
2173
+ merge = new Merge(group.selection.get(i));
20112174
20122175 if (one)
2013
- makeSomething(sel, false);
2176
+ makeSomething(merge, false);
20142177 else
2015
- content.addChild(sel);
2178
+ content.addChild(merge);
20162179 }
20172180
20182181 if (!one)
2019
- makeSomething(content, false);
2020
-
2021
- ResetModel();
2022
- refreshContents();
2182
+ makeSomething(content, true);
2183
+ else
2184
+ {
2185
+ ResetModel();
2186
+ Select(merge.GetTreePath(), true, false); // unselect... false);
2187
+ refreshContents();
2188
+ }
20232189 } else
2024
- if (event.getSource() == mergeGeometriesItem)
2190
+ if (source == mergeGeometriesItem)
20252191 {
20262192 boolean one = false;
20272193
....@@ -2051,7 +2217,7 @@
20512217 ResetModel();
20522218 refreshContents();
20532219 } else
2054
- if (event.getSource() == linkverticesItem)
2220
+ if (source == linkverticesItem)
20552221 {
20562222 // if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
20572223 // {
....@@ -2064,39 +2230,48 @@
20642230 // group.selection.get(0).setMasterThis(content); // should be identity
20652231 // refreshContents();
20662232 // }
2067
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2233
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
20682234 {
2069
- Object3D content = GrafreeD.clipboard.get(0);
2235
+ Object3D content = Grafreed.clipboard.get(0);
20702236
20712237 if (content instanceof cGroup && ((cGroup)content).transientlink )
20722238 content = ((cGroup)content).get(0);
20732239
2074
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
2240
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
20752241 for (int i=0; i<group.selection.size(); i++)
20762242 {
2077
- boolean random = CameraPane.RANDOM;
2078
- CameraPane.RANDOM = false; // parse all random nodes
2243
+ boolean random = CameraPane.SWITCH;
2244
+ CameraPane.SWITCH = false; // parse all random nodes
20792245 group.selection.get(i).linkVerticesThis(content);
20802246 // group.selection.get(i).setMasterThis(content); // should be identity
2081
- CameraPane.RANDOM = random;
2247
+ CameraPane.SWITCH = random;
20822248 }
2083
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
2249
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
20842250 refreshContents();
20852251 }
20862252 } else
2087
- if (event.getSource() == resetsupportItem)
2253
+ if (source == resetsupportItem)
20882254 {
20892255 for (int i=0; i<group.selection.size(); i++)
20902256 {
2091
- boolean random = CameraPane.RANDOM;
2092
- CameraPane.RANDOM = false; // parse all random nodes
2257
+ boolean random = CameraPane.SWITCH;
2258
+ CameraPane.SWITCH = false; // parse all random nodes
20932259 group.selection.get(i).linkVerticesThis(null);
2094
- CameraPane.RANDOM = random;
2260
+ CameraPane.SWITCH = random;
20952261 }
20962262
20972263 refreshContents();
20982264 } else
2099
- if (event.getSource() == resetreferencesItem)
2265
+ if (source == relinkverticesItem)
2266
+ {
2267
+ boolean random = CameraPane.SWITCH;
2268
+ CameraPane.SWITCH = false; // parse all random nodes
2269
+ group.selection.RelinkToSupport();
2270
+ CameraPane.SWITCH = random;
2271
+
2272
+ refreshContents();
2273
+ } else
2274
+ if (source == resetreferencesItem)
21002275 {
21012276 for (int i=0; i<group.selection.size(); i++)
21022277 {
....@@ -2105,11 +2280,11 @@
21052280
21062281 refreshContents();
21072282 } else
2108
- if (event.getSource() == setMasterItem)
2283
+ if (source == setMasterItem)
21092284 {
2110
- if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
2285
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
21112286 {
2112
- Object3D content = GrafreeD.clipboard.get(0);
2287
+ Object3D content = Grafreed.clipboard.get(0);
21132288
21142289 if (content instanceof cGroup && ((cGroup)content).transientlink )
21152290 content = ((cGroup)content).get(0);
....@@ -2118,13 +2293,13 @@
21182293 refreshContents();
21192294 }
21202295 } else
2121
- if (event.getSource() == poseMeshItem)
2296
+ if (source == poseMeshItem)
21222297 {
21232298 if (group.selection.size() == 1)
21242299 {
2125
- if (GrafreeD.clipboard.size() == 1)
2300
+ if (Grafreed.clipboard.size() == 1)
21262301 {
2127
- Object3D content = GrafreeD.clipboard.get(0);
2302
+ Object3D content = Grafreed.clipboard.get(0);
21282303
21292304 if (content instanceof cGroup && ((cGroup)content).transientlink )
21302305 content = ((cGroup)content).get(0);
....@@ -2137,19 +2312,19 @@
21372312 }
21382313
21392314 } else
2140
- if (event.getSource() == revertMeshItem)
2315
+ if (source == revertMeshItem)
21412316 {
21422317 RevertMeshes();
21432318 } else
2144
- if (event.getSource() == resetMeshItem)
2319
+ if (source == resetAllItem)
21452320 {
21462321 ResetAll();
21472322 } else
2148
- if (event.getSource() == stepAllItem)
2323
+ if (source == stepAllItem)
21492324 {
21502325 StepAll();
21512326 } else
2152
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2327
+ if (source == clearItem) // || event.getSource() == clearButton)
21532328 {
21542329 //int indices[] = jList.getSelectedIndices();
21552330 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2157,42 +2332,46 @@
21572332
21582333 ClearSelection(false);
21592334 } else
2160
- if (event.getSource() == clearAllItem)
2335
+ if (source == clearAllItem)
21612336 {
21622337 ClearSelection(true);
21632338 } else
2164
- if (event.getSource() == grabItem)
2339
+ if (source == grabItem)
21652340 {
21662341 group(new cGroup(), true);
21672342 } else
2168
- if (event.getSource() == frontItem)
2343
+ if (source == hideItem)
2344
+ {
2345
+ group(new HiddenObject());
2346
+ } else
2347
+ if (source == frontItem)
21692348 {
21702349 front();
21712350 } else
2172
- if (event.getSource() == backItem)
2351
+ if (source == backItem)
21732352 {
21742353 back();
21752354 } else
2176
- if (event.getSource() == cameraItem)
2355
+ if (source == cameraItem)
21772356 {
21782357 makeSomething(new Camera());
21792358 } else
2180
- if (event.getSource() == compositeItem)
2359
+ if (source == compositeItem)
21812360 {
21822361 group(new Composite());
21832362 } else
2184
- if (event.getSource() == randomItem)
2363
+ if (source == randomItem)
21852364 {
21862365 RandomNode random = new RandomNode();
21872366 group(random);
21882367 if (random.size() > 0)
2189
- random.name = random.get(0).name + "Rnd";
2368
+ random.name = random.get(0).name + "Switch";
21902369 } else
2191
- if (event.getSource() == physicsItem)
2370
+ if (source == physicsItem)
21922371 {
21932372 group(new PhysicsNode());
21942373 } else
2195
- if (event.getSource() == frameselectorItem)
2374
+ if (source == frameselectorItem)
21962375 {
21972376 for (int i=0; i<group.selection.size(); i++)
21982377 {
....@@ -2204,7 +2383,7 @@
22042383 ResetModel();
22052384 refreshContents();
22062385 } else
2207
- if (event.getSource() == switchGeoItem)
2386
+ if (source == switchGeoItem)
22082387 {
22092388 for (int i=0; i<group.selection.size(); i++)
22102389 {
....@@ -2216,7 +2395,7 @@
22162395 ResetModel();
22172396 refreshContents();
22182397 } else
2219
- if (event.getSource() == switchTransfoItem)
2398
+ if (source == switchTransfoItem)
22202399 {
22212400 for (int i=0; i<group.selection.size(); i++)
22222401 {
....@@ -2228,7 +2407,7 @@
22282407 ResetModel();
22292408 refreshContents();
22302409 } else
2231
- if (event.getSource() == morphItem)
2410
+ if (source == morphItem)
22322411 {
22332412 for (int i=0; i<group.selection.size(); i++)
22342413 {
....@@ -2240,7 +2419,7 @@
22402419 ResetModel();
22412420 refreshContents();
22422421 } else
2243
- if (event.getSource() == scriptNodeItem)
2422
+ if (source == scriptNodeItem)
22442423 {
22452424 boolean atleastone = false;
22462425
....@@ -2279,199 +2458,223 @@
22792458 }
22802459 }
22812460 } else
2282
- if (event.getSource() == linkerItem)
2461
+ if (source == linkerItem)
22832462 {
22842463 group(new cLinker());
22852464 } else
2286
- if (event.getSource() == textureItem)
2465
+ if (source == textureItem)
22872466 {
22882467 group(new TextureNode());
22892468 } else
2290
- if (event.getSource() == shadowXItem)
2469
+ if (source == billboardItem)
2470
+ {
2471
+ group(new BillboardNode());
2472
+ } else
2473
+ if (source == shadowXItem)
22912474 {
22922475 CastShadow(0);
22932476 } else
2294
- if (event.getSource() == shadowYItem)
2477
+ if (source == shadowYItem)
22952478 {
22962479 CastShadow(1);
22972480 } else
2298
- if (event.getSource() == shadowZItem)
2481
+ if (source == shadowZItem)
22992482 {
23002483 CastShadow(2);
23012484 } else
2302
- if (event.getSource() == ungroupItem)
2485
+ if (source == ungroupItem)
23032486 {
2304
- ungroup();
2487
+ //ungroup();
2488
+ for (int i=0; i<group.selection.size(); i++)
2489
+ {
2490
+ Ungroup(group.selection.get(i));
2491
+ }
2492
+
2493
+ ClearSelection(false);
2494
+
2495
+ refreshContents();
23052496 } else
2306
- if (event.getSource() == genUVItem)
2497
+ if (source == genUVItem)
23072498 {
23082499 GenUV();
23092500 } else
2310
- if (event.getSource() == genNormalsCADItem)
2501
+ if (source == genNormalsCADItem)
23112502 {
23122503 GenNormals(true);
23132504 } else
2314
- if (event.getSource() == genNormalsMESHItem)
2505
+ if (source == genNormalsMESHItem)
23152506 {
23162507 GenNormals(true); // TODO
23172508 } else
2318
- if (event.getSource() == genNormalsORGANItem)
2509
+ if (source == genNormalsORGANItem)
23192510 {
23202511 GenNormals(false);
23212512 } else
2322
- if (event.getSource() == stripifyItem)
2513
+ if (source == genNormalsMINEItem)
2514
+ {
2515
+ GenNormalsMINE();
2516
+ } else
2517
+ if (source == stripifyItem)
23232518 {
23242519 Stripify();
23252520 } else
2326
- if (event.getSource() == unstripifyItem)
2521
+ if (source == unstripifyItem)
23272522 {
23282523 Unstripify();
23292524 } else
2330
- if (event.getSource() == trimItem)
2525
+ if (source == trimItem)
23312526 {
23322527 Trim();
23332528 } else
2334
- if (event.getSource() == untrimItem)
2529
+ if (source == untrimItem)
23352530 {
23362531 Untrim();
23372532 } else
2338
- if (event.getSource() == clearColorsItem)
2533
+ if (source == clearColorsItem)
23392534 {
23402535 ClearColors();
23412536 } else
2342
- if (event.getSource() == clearMaterialsItem)
2537
+ if (source == clearMaterialsItem)
23432538 {
23442539 ClearMaterials();
23452540 } else
2346
- if (event.getSource() == liveleavesItem)
2541
+ if (source == liveleavesItem)
23472542 {
23482543 LiveLeaves(true);
23492544 } else
2350
- if (event.getSource() == unliveleavesItem)
2545
+ if (source == unliveleavesItem)
23512546 {
23522547 LiveLeaves(false);
23532548 } else
2354
- if (event.getSource() == supportleavesItem)
2549
+ if (source == supportleavesItem)
23552550 {
23562551 SupportLeaves(true);
23572552 } else
2358
- if (event.getSource() == unsupportleavesItem)
2553
+ if (source == unsupportleavesItem)
23592554 {
23602555 SupportLeaves(false);
23612556 } else
2362
- if (event.getSource() == hideleavesItem)
2557
+ if (source == hideleavesItem)
23632558 {
23642559 HideLeaves(true);
23652560 } else
2366
- if (event.getSource() == showleavesItem)
2561
+ if (source == showleavesItem)
23672562 {
23682563 HideLeaves(false);
23692564 } else
2370
- if (event.getSource() == markleavesItem)
2565
+ if (source == markleavesItem)
23712566 {
23722567 MarkLeaves(true);
23732568 } else
2374
- if (event.getSource() == unmarkleavesItem)
2569
+ if (source == unmarkleavesItem)
23752570 {
23762571 MarkLeaves(false);
23772572 } else
2378
- if (event.getSource() == flipVItem)
2573
+ if (source == flipVItem)
23792574 {
23802575 FlipV(true);
23812576 } else
2382
- if (event.getSource() == unflipVItem)
2577
+ if (source == unflipVItem)
23832578 {
23842579 FlipV(false);
23852580 } else
2386
- if (event.getSource() == lowTexturesItem)
2581
+ if (source == lowTexturesItem)
23872582 {
23882583 SetTexRes(0);
23892584 } else
2390
- if (event.getSource() == normalTexturesItem)
2585
+ if (source == normalTexturesItem)
23912586 {
23922587 SetTexRes(1);
23932588 } else
2394
- if (event.getSource() == highTexturesItem)
2589
+ if (source == highTexturesItem)
23952590 {
23962591 SetTexRes(2);
23972592 } else
2398
- if (event.getSource() == veryhighTexturesItem)
2593
+ if (source == veryhighTexturesItem)
23992594 {
24002595 SetTexRes(3);
24012596 } else
2402
- if (event.getSource() == maxTexturesItem)
2597
+ if (source == maxTexturesItem)
24032598 {
24042599 SetTexRes(4);
24052600 } else
2406
- if (event.getSource() == panoTexturesItem)
2601
+ if (source == panoTexturesItem)
24072602 {
24082603 SetTexRes(5);
24092604 } else
2410
- if (event.getSource() == reverseNormalsItem)
2605
+ if (source == reverseNormalsItem)
24112606 {
24122607 ReverseNormals();
24132608 } else
2414
- if (event.getSource() == parseverticesItem)
2609
+ if (source == parseverticesItem)
24152610 {
24162611 ParseVertices();
24172612 } else
2418
- if (event.getSource() == textureFieldItem)
2613
+ if (source == textureFieldItem)
24192614 {
24202615 TextureVertices();
24212616 } else
2422
- if (event.getSource() == alignItem)
2617
+ if (source == alignItem)
24232618 {
24242619 Align();
24252620 } else
2426
- if (event.getSource() == mirrorItem)
2621
+ if (source == mirrorItem)
24272622 {
24282623 MirrorPoses();
24292624 } else
2430
- if (event.getSource() == reduceMorphItem)
2625
+ if (source == reduceMorphItem)
24312626 {
24322627 MeshReduction(false);
24332628 } else
2434
- if (event.getSource() == reduce34MorphItem)
2629
+ if (source == reduce34MorphItem)
24352630 {
24362631 MeshReduction(true);
24372632 } else
2438
- if (event.getSource() == reverseTrianglesItem)
2633
+ if (source == reverseTrianglesItem)
24392634 {
24402635 ReverseTriangles();
24412636 } else
2442
- if (event.getSource() == reduceMeshItem)
2637
+ if (source == reduceMeshItem)
24432638 {
24442639 ReduceMesh(false);
24452640 } else
2446
- if (event.getSource() == reduce34MeshItem)
2641
+ if (source == reduce34MeshItem)
24472642 {
24482643 ReduceMesh(true);
24492644 } else
2450
- if (event.getSource() == increaseMeshItem)
2645
+ if (source == increaseMeshItem)
24512646 {
24522647 IncreaseMesh();
24532648 } else
2454
- if (event.getSource() == clipMeshItem)
2649
+ if (source == clipMeshItem)
24552650 {
24562651 ClipMesh();
24572652 } else
2458
- if (event.getSource() == smoothMeshItem)
2653
+ if (source == smoothMeshItem)
24592654 {
24602655 SmoothMesh();
24612656 } else
2462
- if (event.getSource() == transformgeometryItem)
2657
+ if (source == transformGeometryItem)
24632658 {
24642659 TransformGeometry();
24652660 } else
2466
- if (event.getSource() == resetTransformItem)
2661
+ if (source == transformChildrenItem)
2662
+ {
2663
+ TransformChildren();
2664
+ } else
2665
+ if (source == resetTransformItem)
24672666 {
24682667 ResetTransform();
24692668 } else
2470
- if (event.getSource() == resetCentroidItem)
2669
+ if (source == resetCentroidItem)
24712670 {
2472
- ResetCentroid();
2671
+ ResetCentroid(true);
24732672 } else
2474
- if (event.getSource() == resetParentItem)
2673
+ if (source == resetCentroidXZItem)
2674
+ {
2675
+ ResetCentroid(false);
2676
+ } else
2677
+ if (source == resetParentItem)
24752678 {
24762679 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24772680 {
....@@ -2481,7 +2684,7 @@
24812684
24822685 refreshContents();
24832686 } else
2484
- if (event.getSource() == repairParentItem)
2687
+ if (source == repairParentItem)
24852688 {
24862689 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24872690 {
....@@ -2495,7 +2698,21 @@
24952698
24962699 refreshContents();
24972700 } else
2498
- if (event.getSource() == sortbysizeItem)
2701
+ if (source == repairShadowItem)
2702
+ {
2703
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
2704
+ {
2705
+ Object3D obj = (Object3D)e.nextElement();
2706
+ obj.RepairShadow();
2707
+// for (int i=0; i<obj.size(); i++)
2708
+// {
2709
+// obj.get(i).parent = obj;
2710
+// }
2711
+ }
2712
+
2713
+ refreshContents();
2714
+ } else
2715
+ if (source == sortbysizeItem)
24992716 {
25002717 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25012718 {
....@@ -2507,7 +2724,7 @@
25072724 ResetModel();
25082725 refreshContents();
25092726 } else
2510
- if (event.getSource() == sortbynameItem)
2727
+ if (source == sortbynameItem)
25112728 {
25122729 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25132730 {
....@@ -2519,7 +2736,7 @@
25192736 ResetModel();
25202737 refreshContents();
25212738 } else
2522
- if (event.getSource() == attachPigmentItem)
2739
+ if (source == attachPigmentItem)
25232740 {
25242741 String texture = GetFile("Attach pigment");
25252742 Object3D obj;
....@@ -2531,7 +2748,7 @@
25312748
25322749 refreshContents();
25332750 } else
2534
- if (event.getSource() == detachPigmentItem)
2751
+ if (source == detachPigmentItem)
25352752 {
25362753 Object3D obj;
25372754 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2542,7 +2759,7 @@
25422759
25432760 refreshContents();
25442761 } else
2545
- if (event.getSource() == attachBumpItem)
2762
+ if (source == attachBumpItem)
25462763 {
25472764 String texture = GetFile("Attach bump");
25482765 Object3D obj;
....@@ -2554,7 +2771,7 @@
25542771
25552772 refreshContents();
25562773 } else
2557
- if (event.getSource() == detachBumpItem)
2774
+ if (source == detachBumpItem)
25582775 {
25592776 Object3D obj;
25602777 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2565,7 +2782,7 @@
25652782
25662783 refreshContents();
25672784 } else
2568
- if (event.getSource() == pigmentBumpItem)
2785
+ if (source == pigmentBumpItem)
25692786 {
25702787 Object3D obj;
25712788 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2576,158 +2793,195 @@
25762793
25772794 refreshContents();
25782795 } else
2579
- if (event.getSource() == flashSelectionButton)
2796
+ if (source == flashSelectionButton)
25802797 {
25812798 CameraPane.flash = true;
25822799 refreshContents();
25832800 } else
2584
- if (event.getSource() == oneButton)
2801
+ if (source == oneButton)
25852802 {
25862803 } else
2587
- if (event.getSource() == twoButton)
2804
+ if (source == twoButton)
25882805 {
25892806 radio.layout = twoButton;
25902807 // bug
25912808 //gridPanel.setDividerLocation(1.0);
25922809 //bigPanel.setDividerLocation(0.0);
2593
- bigThree.remove(jtp);
2594
- bigThree.remove(cameraPanel);
2595
- bigThree.remove(XYZPanel);
2596
- aWindowConstraints.gridx = 0;
2597
- aWindowConstraints.gridy = 0;
2598
- aWindowConstraints.gridwidth = 1;
2599
- // aConstraints.gridheight = 3;
2600
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2601
- aWindowConstraints.weightx = 0;
2602
- aWindowConstraints.weighty = 1;
2603
- //bigThree.add(jtp, aWindowConstraints);
2604
- aWindowConstraints.weightx = 1;
2605
- aWindowConstraints.gridwidth = 3;
2606
- // aConstraints.gridheight = 3;
2607
- aWindowConstraints.gridx = 1;
2608
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2609
- bigThree.add(cameraPanel, aWindowConstraints);
2610
- aWindowConstraints.weightx = 0;
2611
- aWindowConstraints.gridx = 4;
2612
- aWindowConstraints.gridwidth = 1;
2613
- // aConstraints.gridheight = 3;
2614
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2615
- //bigThree.add(XYZPanel, aWindowConstraints);
2616
- bigThree.revalidate();
2810
+// bigThree.remove(scenePanel);
2811
+// bigThree.remove(centralPanel);
2812
+// bigThree.remove(XYZPanel);
2813
+// aWindowConstraints.gridx = 0;
2814
+// aWindowConstraints.gridy = 0;
2815
+// aWindowConstraints.gridwidth = 1;
2816
+// // aConstraints.gridheight = 3;
2817
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2818
+// aWindowConstraints.weightx = 0;
2819
+// aWindowConstraints.weighty = 1;
2820
+// //bigThree.add(jtp, aWindowConstraints);
2821
+// aWindowConstraints.weightx = 1;
2822
+// aWindowConstraints.gridwidth = 3;
2823
+// // aConstraints.gridheight = 3;
2824
+// aWindowConstraints.gridx = 1;
2825
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2826
+// bigThree.add(centralPanel, aWindowConstraints);
2827
+// aWindowConstraints.weightx = 0;
2828
+// aWindowConstraints.gridx = 4;
2829
+// aWindowConstraints.gridwidth = 1;
2830
+// // aConstraints.gridheight = 3;
2831
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2832
+// //bigThree.add(XYZPanel, aWindowConstraints);
2833
+// scenePanel.setVisible(false);
2834
+// centralPanel.setVisible(true);
2835
+// XYZPanel.setVisible(false);
2836
+ bigThree.ClearUI();
2837
+ bigThree.add(centralPanel);
2838
+ bigThree.FlushUI();
26172839 } else
2618
- if (event.getSource() == threeButton)
2840
+ if (source == threeButton)
26192841 {
26202842 radio.layout = threeButton;
2621
- bigThree.remove(jtp);
2622
- bigThree.remove(cameraPanel);
2623
- bigThree.remove(XYZPanel);
2624
- aWindowConstraints.gridx = 0;
2625
- aWindowConstraints.gridy = 0;
2626
- aWindowConstraints.gridwidth = 1;
2627
- // aConstraints.gridheight = 3;
2628
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2629
- aWindowConstraints.weightx = 0;
2630
- aWindowConstraints.weighty = 1;
2631
- //bigThree.add(jtp, aWindowConstraints);
2632
- aWindowConstraints.weightx = 1;
2633
- aWindowConstraints.gridwidth = 3;
2634
- // aConstraints.gridheight = 3;
2635
- aWindowConstraints.gridx = 1;
2636
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2637
- bigThree.add(cameraPanel, aWindowConstraints);
2638
- aWindowConstraints.weightx = 0;
2639
- aWindowConstraints.gridx = 4;
2640
- aWindowConstraints.gridwidth = 1;
2641
- // aConstraints.gridheight = 3;
2642
- aConstraints.fill = GridBagConstraints.VERTICAL;
2643
- bigThree.add(XYZPanel, aWindowConstraints);
2644
- bigThree.revalidate();
2843
+
2844
+// bigThree.remove(scenePanel);
2845
+// bigThree.remove(centralPanel);
2846
+// bigThree.remove(XYZPanel);
2847
+// aWindowConstraints.gridx = 0;
2848
+// aWindowConstraints.gridy = 0;
2849
+// aWindowConstraints.gridwidth = 1;
2850
+// // aConstraints.gridheight = 3;
2851
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2852
+// aWindowConstraints.weightx = 0;
2853
+// aWindowConstraints.weighty = 1;
2854
+// //bigThree.add(jtp, aWindowConstraints);
2855
+// aWindowConstraints.weightx = 1;
2856
+// aWindowConstraints.gridwidth = 3;
2857
+// // aConstraints.gridheight = 3;
2858
+// aWindowConstraints.gridx = 1;
2859
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2860
+// bigThree.add(centralPanel, aWindowConstraints);
2861
+// aWindowConstraints.weightx = 0;
2862
+// aWindowConstraints.gridx = 4;
2863
+// aWindowConstraints.gridwidth = 1;
2864
+// // aConstraints.gridheight = 3;
2865
+// aConstraints.fill = GridBagConstraints.VERTICAL;
2866
+// bigThree.add(XYZPanel, aWindowConstraints);
2867
+// bigThree.validate();
2868
+// scenePanel.setVisible(false);
2869
+// centralPanel.setVisible(true);
2870
+// XYZPanel.setVisible(true);
2871
+ bigThree.ClearUI();
2872
+ bigThree.add(centralPanel);
2873
+ bigThree.add(XYZPanel);
2874
+ bigThree.FlushUI();
26452875 } else
2646
- if (event.getSource() == fourButton)
2876
+ if (source == fourButton)
26472877 {
26482878 radio.layout = fourButton;
2649
- bigThree.remove(jtp);
2650
- bigThree.remove(cameraPanel);
2651
- bigThree.remove(XYZPanel);
2652
- aWindowConstraints.gridx = 0;
2653
- aWindowConstraints.gridy = 0;
2654
- aWindowConstraints.gridwidth = 1;
2655
- // aWindowConstraints.gridheight = 3;
2656
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2657
- aWindowConstraints.weightx = 1;
2658
- aWindowConstraints.weighty = 1;
2659
- bigThree.add(jtp, aWindowConstraints);
2660
- aWindowConstraints.weightx = 1;
2661
- aWindowConstraints.gridwidth = 3;
2662
- // aConstraints.gridheight = 3;
2663
- aWindowConstraints.gridx = 1;
2664
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2665
- //bigThree.add(cameraPanel, aWindowConstraints);
2666
- aWindowConstraints.weightx = 0;
2667
- aWindowConstraints.gridx = 4;
2668
- aWindowConstraints.gridwidth = 1;
2669
- // aWindowConstraints.gridheight = 3;
2670
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2671
- //bigThree.add(XYZPanel, aWindowConstraints);
2672
- bigThree.revalidate();
2879
+
2880
+// bigThree.remove(scenePanel);
2881
+// bigThree.remove(centralPanel);
2882
+// bigThree.remove(XYZPanel);
2883
+// aWindowConstraints.gridx = 0;
2884
+// aWindowConstraints.gridy = 0;
2885
+// aWindowConstraints.gridwidth = 1;
2886
+// // aWindowConstraints.gridheight = 3;
2887
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2888
+// aWindowConstraints.weightx = 1;
2889
+// aWindowConstraints.weighty = 1;
2890
+// bigThree.add(scenePanel, aWindowConstraints);
2891
+// aWindowConstraints.weightx = 1;
2892
+// aWindowConstraints.gridwidth = 3;
2893
+// // aConstraints.gridheight = 3;
2894
+// aWindowConstraints.gridx = 1;
2895
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2896
+// //bigThree.add(cameraPanel, aWindowConstraints);
2897
+// aWindowConstraints.weightx = 0;
2898
+// aWindowConstraints.gridx = 4;
2899
+// aWindowConstraints.gridwidth = 1;
2900
+// // aWindowConstraints.gridheight = 3;
2901
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2902
+// //bigThree.add(XYZPanel, aWindowConstraints);
2903
+// bigThree.validate();
2904
+// scenePanel.setVisible(true);
2905
+// centralPanel.setVisible(false);
2906
+// XYZPanel.setVisible(false);
2907
+ bigThree.ClearUI();
2908
+ bigThree.add(scenePanel);
2909
+ bigThree.FlushUI();
26732910 } else
2674
- if (event.getSource() == sixButton)
2911
+ if (source == sixButton)
26752912 {
26762913 radio.layout = sixButton;
2677
- bigThree.remove(jtp);
2678
- bigThree.remove(cameraPanel);
2679
- bigThree.remove(XYZPanel);
2680
- aWindowConstraints.gridx = 0;
2681
- aWindowConstraints.gridy = 0;
2682
- aWindowConstraints.gridwidth = 1;
2683
- // aConstraints.gridheight = 3;
2684
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2685
- aWindowConstraints.weightx = 0;
2686
- aWindowConstraints.weighty = 1;
2687
- bigThree.add(jtp, aWindowConstraints);
2688
- aWindowConstraints.weightx = 1;
2689
- aWindowConstraints.gridwidth = 3;
2690
- // aWindowConstraints.gridheight = 3;
2691
- aWindowConstraints.gridx = 1;
2692
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2693
- bigThree.add(cameraPanel, aWindowConstraints);
2694
- aWindowConstraints.weightx = 0;
2695
- aWindowConstraints.gridx = 4;
2696
- aWindowConstraints.gridwidth = 1;
2697
- // aWindowConstraints.gridheight = 3;
2698
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2699
- //bigThree.add(XYZPanel, aConstraints);
2700
- bigThree.revalidate();
2914
+
2915
+// bigThree.remove(scenePanel);
2916
+// bigThree.remove(centralPanel);
2917
+// bigThree.remove(XYZPanel);
2918
+// aWindowConstraints.gridx = 0;
2919
+// aWindowConstraints.gridy = 0;
2920
+// aWindowConstraints.gridwidth = 1;
2921
+// // aConstraints.gridheight = 3;
2922
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2923
+// aWindowConstraints.weightx = 0;
2924
+// aWindowConstraints.weighty = 1;
2925
+// bigThree.add(scenePanel, aWindowConstraints);
2926
+// aWindowConstraints.weightx = 1;
2927
+// aWindowConstraints.gridwidth = 3;
2928
+// // aWindowConstraints.gridheight = 3;
2929
+// aWindowConstraints.gridx = 1;
2930
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2931
+// bigThree.add(centralPanel, aWindowConstraints);
2932
+// aWindowConstraints.weightx = 0;
2933
+// aWindowConstraints.gridx = 4;
2934
+// aWindowConstraints.gridwidth = 1;
2935
+// // aWindowConstraints.gridheight = 3;
2936
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2937
+// //bigThree.add(XYZPanel, aConstraints);
2938
+// bigThree.validate();
2939
+// scenePanel.setVisible(true);
2940
+// centralPanel.setVisible(true);
2941
+// XYZPanel.setVisible(false);
2942
+ bigThree.ClearUI();
2943
+ bigThree.add(scenePanel);
2944
+ bigThree.add(centralPanel);
2945
+ bigThree.FlushUI();
27012946 } else
2702
- if (event.getSource() == sevenButton)
2947
+ if (source == sevenButton)
27032948 {
27042949 radio.layout = sevenButton;
2705
- bigThree.remove(jtp);
2706
- bigThree.remove(cameraPanel);
2707
- bigThree.remove(XYZPanel);
2708
- aWindowConstraints.gridx = 0;
2709
- aWindowConstraints.gridy = 0;
2710
- aWindowConstraints.gridwidth = 1;
2711
- // aWindowConstraints.gridheight = 3;
2712
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2713
- aWindowConstraints.weightx = 0;
2714
- aWindowConstraints.weighty = 1;
2715
- bigThree.add(jtp, aWindowConstraints);
2716
- aWindowConstraints.weightx = 1;
2717
- aWindowConstraints.gridwidth = 3;
2718
- // aWindowConstraints.gridheight = 3;
2719
- aWindowConstraints.gridx = 1;
2720
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2721
- bigThree.add(cameraPanel, aWindowConstraints);
2722
- aWindowConstraints.weightx = 0;
2723
- aWindowConstraints.gridx = 4;
2724
- aWindowConstraints.gridwidth = 1;
2725
- // aConstraints.gridheight = 3;
2726
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2727
- bigThree.add(XYZPanel, aWindowConstraints);
2728
- bigThree.revalidate();
2950
+
2951
+// bigThree.remove(scenePanel);
2952
+// bigThree.remove(centralPanel);
2953
+// bigThree.remove(XYZPanel);
2954
+// aWindowConstraints.gridx = 0;
2955
+// aWindowConstraints.gridy = 0;
2956
+// aWindowConstraints.gridwidth = 1;
2957
+// // aWindowConstraints.gridheight = 3;
2958
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2959
+// aWindowConstraints.weightx = 0;
2960
+// aWindowConstraints.weighty = 1;
2961
+// bigThree.add(scenePanel, aWindowConstraints);
2962
+// aWindowConstraints.weightx = 1;
2963
+// aWindowConstraints.gridwidth = 3;
2964
+// // aWindowConstraints.gridheight = 3;
2965
+// aWindowConstraints.gridx = 1;
2966
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2967
+// bigThree.add(centralPanel, aWindowConstraints);
2968
+// aWindowConstraints.weightx = 0;
2969
+// aWindowConstraints.gridx = 4;
2970
+// aWindowConstraints.gridwidth = 1;
2971
+// // aConstraints.gridheight = 3;
2972
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2973
+// bigThree.add(XYZPanel, aWindowConstraints);
2974
+// bigThree.validate();
2975
+// scenePanel.setVisible(true);
2976
+// centralPanel.setVisible(true);
2977
+// XYZPanel.setVisible(true);
2978
+ bigThree.ClearUI();
2979
+ bigThree.add(scenePanel);
2980
+ bigThree.add(centralPanel);
2981
+ bigThree.add(XYZPanel);
2982
+ bigThree.FlushUI();
27292983 } else
2730
- if (event.getSource() == rootButton)
2984
+ if (source == rootButton)
27312985 {
27322986 Object3D obj;
27332987 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2739,7 +2993,7 @@
27392993
27402994 refreshContents(true);
27412995 } else
2742
- if (event.getSource() == closeButton)
2996
+ if (source == closeButton)
27432997 {
27442998 //System.out.println("CLOSE: " + buttonGroup.getSelection());
27452999 cRadio ab;
....@@ -2760,11 +3014,11 @@
27603014 }
27613015 refreshContents(true);
27623016 } else
2763
- if (event.getSource() == editItem || event.getSource() == editButton)
3017
+ if (source == editItem || source == editButton)
27643018 {
27653019 EditSelection(false);
27663020 } else
2767
- if (event.getSource() == uneditButton)
3021
+ if (source == uneditButton)
27683022 {
27693023 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
27703024 {
....@@ -2776,12 +3030,12 @@
27763030
27773031 child.editWindow = null; // ???????????
27783032 }
2779
- objEditor.ctrlPanel.revalidate();
3033
+ objEditor.ctrlPanel.FlushUI();
27803034 //objEditor.jTree.clearSelection();
27813035 //objEditor.ResetSliders();
27823036 refreshContents(true);
27833037 } else
2784
- if (event.getSource() == clearPanelButton)
3038
+ if (source == clearPanelButton)
27853039 {
27863040 assert(copy == group);
27873041 //copy.ClearUI();
....@@ -2792,7 +3046,7 @@
27923046 listUI.clear();
27933047 refreshContents(true);
27943048 } else
2795
- if (event.getSource() == allParamsButton)
3049
+ if (source == allParamsButton)
27963050 {
27973051 assert(copy == group);
27983052
....@@ -2813,19 +3067,19 @@
28133067
28143068 refreshContents(true);
28153069 } else
2816
- if (event.getSource() == unselectButton)
3070
+ if (source == unselectButton)
28173071 {
28183072 objEditor.jTree.clearSelection();
28193073 // ?? oct 2012 GrafreeD.clipboard.clear();
28203074 objEditor.ResetSliders();
28213075 refreshContents(true);
28223076 } else
2823
- if(event.getSource() instanceof cRadio)
3077
+ if(source instanceof cRadio)
28243078 {
28253079 group.parent = keepparent;
28263080 group.attributes = 0;
28273081 //group.editWindow = null;
2828
- /*cRadio*/ radio = (cRadio)event.getSource();
3082
+ /*cRadio*/ radio = (cRadio)source;
28293083 Object3D obj = radio.GetObject();
28303084 System.out.println("Edit " + obj);
28313085 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -2845,7 +3099,7 @@
28453099 }
28463100
28473101 copy = group;
2848
- //CameraPane.theRenderer.object = group;
3102
+ //Globals.theRenderer.object = group;
28493103 if(!useclient)
28503104 {
28513105 cameraView.renderCamera = radio.camera;
....@@ -2854,12 +3108,15 @@
28543108 cameraView.cameras[cameraView.cameracount] = radio.camera;
28553109 cameraView.targetLookAt.set(radio.camera.lookAt);
28563110 cameraView.object = group;
2857
- cameraView.lighttouched = true;
3111
+ //cameraView.lighttouched = true;
3112
+ Globals.lighttouched = true;
28583113 topView.object = group;
28593114 frontView.object = group;
28603115 sideView.object = group;
28613116 }
2862
- group.editWindow = this;
3117
+
3118
+// fix "+" issue group.editWindow = this;
3119
+
28633120 /*
28643121 currentLayout = radio.layout;
28653122 if (currentLayout == null)
....@@ -2872,7 +3129,20 @@
28723129 //group.attributes = -1;
28733130 ResetModel();
28743131 refreshContents(true);
2875
- }
3132
+ } else if (event.getSource() == editCameraItem)
3133
+ {
3134
+ cameraView.ProtectCamera();
3135
+ cameraView.repaint();
3136
+ return;
3137
+ } else if (event.getSource() == revertCameraItem)
3138
+ {
3139
+ cameraView.RevertCamera();
3140
+ cameraView.repaint();
3141
+ return;
3142
+ // } else if (event.getSource() == textureButton)
3143
+ // {
3144
+ // return; // true;
3145
+ }
28763146 else
28773147 {
28783148 //return super.action(event, arg);
....@@ -2890,7 +3160,7 @@
28903160 if (useclient)
28913161 {
28923162 cameraView.object = client;
2893
- cameraView.lighttouched = true;
3163
+ Globals.lighttouched = true;
28943164 //topView.object = client;
28953165 //frontView.object = client;
28963166 //sideView.object = client;
....@@ -2898,7 +3168,7 @@
28983168 else
28993169 {
29003170 cameraView.object = group;
2901
- cameraView.lighttouched = true;
3171
+ Globals.lighttouched = true;
29023172 //topView.object = group;
29033173 //frontView.object = group;
29043174 //sideView.object = group;
....@@ -2933,6 +3203,28 @@
29333203 refreshContents();
29343204 }
29353205
3206
+ void TransformChildren()
3207
+ {
3208
+ Object3D obj;
3209
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3210
+ {
3211
+ obj = (Object3D)e.nextElement();
3212
+ obj.KeepTextureMatrices();
3213
+ obj.TransformChildren();
3214
+ obj.RestoreTextureMatrices();
3215
+
3216
+// if (obj.parent == null)
3217
+// {
3218
+// System.out.println("NULL PARENT!");
3219
+// new Exception().printStackTrace();
3220
+// }
3221
+// else
3222
+// TouchTransform(obj);
3223
+// //obj.parent.Touch();
3224
+ }
3225
+
3226
+ refreshContents();
3227
+ }
29363228
29373229 void ResetTransform()
29383230 {
....@@ -3045,7 +3337,7 @@
30453337 refreshContents();
30463338 }
30473339
3048
- void ResetCentroid()
3340
+ void ResetCentroid(boolean full)
30493341 {
30503342 Object3D obj;
30513343 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3060,12 +3352,16 @@
30603352 LA.matIdentity(Object3D.mat);
30613353 obj.getBounds(minima, maxima, false);
30623354 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3063
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3355
+ if (full)
3356
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
30643357 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
30653358 obj.TransformMesh(Object3D.mat);
3359
+
30663360 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3067
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3361
+ if (full)
3362
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
30683363 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3364
+
30693365 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
30703366 //Object3D.mat[3][0] = -Object3D.mat[3][0];
30713367 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3131,9 +3427,9 @@
31313427 obj = (Object3D)e.nextElement();
31323428
31333429 System.out.println("Object is: " + obj);
3134
- GrafreeD.AnalyzeObject(obj);
3430
+ Grafreed.AnalyzeObject(obj);
31353431 System.out.println("Boundary rep: " + obj.bRep);
3136
- GrafreeD.AnalyzeObject(obj.bRep);
3432
+ Grafreed.AnalyzeObject(obj.bRep);
31373433
31383434 // System.err.println((size/1024) + " KB is the size of " + obj);
31393435 }
....@@ -3175,6 +3471,13 @@
31753471 void GenNormals(boolean crease)
31763472 {
31773473 group.GenNormalsS(crease);
3474
+
3475
+ refreshContents();
3476
+ }
3477
+
3478
+ void GenNormalsMINE()
3479
+ {
3480
+ group.selection.GenNormalsMINE();
31783481
31793482 refreshContents();
31803483 }
....@@ -3340,8 +3643,8 @@
33403643
33413644 void ParseVertices()
33423645 {
3343
- boolean epsequal = GrafreeD.epsequal;
3344
- GrafreeD.epsequal = true;
3646
+ boolean epsequal = Grafreed.epsequal;
3647
+ Grafreed.epsequal = true;
33453648
33463649 for (int i=0; i<group.selection.size(); i++)
33473650 {
....@@ -3366,7 +3669,7 @@
33663669 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
33673670 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
33683671
3369
- g.add(GrafreeD.clipboard);
3672
+ g.add(Grafreed.clipboard);
33703673
33713674 buffer.add(g);
33723675 }
....@@ -3381,7 +3684,7 @@
33813684 makeSomething(buffer, i==group.selection.size()-1);
33823685 }
33833686
3384
- GrafreeD.epsequal = epsequal;
3687
+ Grafreed.epsequal = epsequal;
33853688
33863689 refreshContents();
33873690 }
....@@ -3399,7 +3702,16 @@
33993702 String pigment = Object3D.GetPigment(tex);
34003703 //String bump = Object3D.GetBump(tex);
34013704
3402
- com.sun.opengl.util.texture.TextureData texturedata = CameraPane.theRenderer.GetTextureData(pigment, false, node.texres);
3705
+ com.sun.opengl.util.texture.TextureData texturedata = null;
3706
+
3707
+ try
3708
+ {
3709
+ texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
3710
+ }
3711
+ catch (Exception e)
3712
+ {
3713
+ System.err.println("FAIL: " + node);
3714
+ }
34033715
34043716 double s = v.s;
34053717
....@@ -3447,12 +3759,26 @@
34473759
34483760 void Align()
34493761 {
3762
+ if (group.selection.size() == 0)
3763
+ return;
3764
+
3765
+ cVector bbmin = new cVector();
3766
+ cVector bbmax = new cVector();
3767
+
3768
+ group.selection.get(0).getBounds(bbmin, bbmax, true);
3769
+
3770
+ double dx = bbmax.x - bbmin.x;
3771
+ double dy = bbmax.y - bbmin.y;
3772
+ double dz = bbmax.z - bbmin.z;
3773
+
3774
+ double scale = Math.sqrt(dx*dx + dy*dy + dz*dz);
3775
+
34503776 for (int i=0; i<group.selection.size(); i++)
34513777 {
34523778 Object3D obj = group.selection.get(i);
34533779
3454
- LA.matTranslate(obj.toParent, i/2f, 0, 0);
3455
- LA.matTranslateInv(obj.fromParent, -i/2f, 0, 0);
3780
+ LA.matTranslate(obj.toParent, i * scale, 0, 0);
3781
+ LA.matTranslateInv(obj.fromParent, -i * scale, 0, 0);
34563782 }
34573783
34583784 refreshContents();
....@@ -3473,11 +3799,11 @@
34733799
34743800 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
34753801
3476
- boolean random = CameraPane.RANDOM;
3477
- CameraPane.RANDOM = false; // parse all random nodes
3802
+ boolean random = CameraPane.SWITCH;
3803
+ CameraPane.SWITCH = false; // parse all random nodes
34783804 lowres.linkVerticesThis(null);
34793805 lowres.linkVerticesThis(sn);
3480
- CameraPane.RANDOM = random;
3806
+ CameraPane.SWITCH = random;
34813807
34823808 System.err.flush();
34833809
....@@ -3517,7 +3843,7 @@
35173843 return;
35183844
35193845 Object3D poses = group.selection.get(0);
3520
- Object3D ref = GrafreeD.clipboard.get(0);
3846
+ Object3D ref = Grafreed.clipboard.get(0);
35213847
35223848 Object3D newgroup = new Object3D("Po:" + poses.name);
35233849
....@@ -3686,7 +4012,7 @@
36864012 group.selection.RelinkToSupport(); // july 2014
36874013 System.out.println("DONE.");
36884014 refreshContents();
3689
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
4015
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
36904016 }
36914017
36924018 void ReduceMesh(boolean reduction34)
....@@ -3711,9 +4037,9 @@
37114037
37124038 void ClipMesh()
37134039 {
3714
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
4040
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
37154041 {
3716
- Object3D content = GrafreeD.clipboard.get(0);
4042
+ Object3D content = Grafreed.clipboard.get(0);
37174043
37184044 if (content instanceof cGroup && ((cGroup)content).transientlink )
37194045 content = ((cGroup)content).get(0);
....@@ -3722,7 +4048,7 @@
37224048 // {
37234049 // group.selection.get(i).ClipMesh(GrafreeD.clipboard);
37244050 // }
3725
- group.selection.ClipMesh(GrafreeD.clipboard);
4051
+ group.selection.ClipMesh(Grafreed.clipboard);
37264052 }
37274053 // group.selection.ClipMesh(GrafreeD.clipboard);
37284054 System.out.println("DONE.");
....@@ -3857,7 +4183,7 @@
38574183 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
38584184
38594185 Object3D elem = (Object3D)group.selection.elementAt(i);
3860
- if(elem != group)
4186
+ if(elem != group || !newWindow)
38614187 {
38624188 // if (!(elem instanceof Composite))
38634189 // newWindow = false;
....@@ -3962,25 +4288,25 @@
39624288 System.err.println("info : " + child.GetPath());
39634289 }
39644290 }
3965
- else
3966
- {
3967
- objEditor.SetMaterial(group); // .GetMaterial());
3968
- objEditor.AddInfo(group, this, true); // .GetMaterial());
3969
- System.err.println("info : " + group.GetPath());
3970
- }
4291
+// else
4292
+// {
4293
+// objEditor.SetMaterial(group); // .GetMaterial());
4294
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4295
+// System.err.println("info : " + group.GetPath());
4296
+// }
39714297
39724298 objEditor.SetText(); // jan 2014
39734299
3974
- if (flashIt && !CameraPane.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
4300
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
39754301 CameraPane.flash = true;
39764302
39774303 if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
39784304 // a camera
39794305 {
39804306 CameraPane.camerachangeframe = 0; // don't refuse it
3981
- CameraPane.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
3982
- // CameraPane.theRenderer.renderCamera = CameraPane.theRenderer.manipCamera;
3983
- // CameraPane.theRenderer.eyeCamera = CameraPane.theRenderer.manipCamera;
4307
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4308
+ // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
4309
+ // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
39844310 }
39854311
39864312 refreshContents();
....@@ -4062,12 +4388,12 @@
40624388 {
40634389 if (group.selection.isEmpty())
40644390 return;
4065
- GrafreeD.clipboardIsTempGroup = false;
4391
+ Grafreed.clipboardIsTempGroup = false;
40664392 Composite tGroup = null;
40674393 if (group.selection.size() > 0) // 1)
40684394 {
40694395 tGroup = new cGroup();
4070
- GrafreeD.clipboardIsTempGroup = true;
4396
+ Grafreed.clipboardIsTempGroup = true;
40714397 }
40724398
40734399 if (cut)
....@@ -4107,16 +4433,16 @@
41074433 //System.out.println("cut " + child);
41084434 //System.out.println("parent = " + child.parent);
41094435 // tmp.addChild(child);
4110
- if (GrafreeD.clipboardIsTempGroup)
4436
+ if (Grafreed.clipboardIsTempGroup)
41114437 tGroup.add/*Child*/(tmp);
41124438 else
4113
- GrafreeD.clipboard = tmp;
4439
+ Grafreed.clipboard = tmp;
41144440 }
41154441 else
4116
- if (GrafreeD.clipboardIsTempGroup)
4442
+ if (Grafreed.clipboardIsTempGroup)
41174443 tGroup.add/*Child*/(child);
41184444 else
4119
- GrafreeD.clipboard = child;
4445
+ Grafreed.clipboard = child;
41204446 }
41214447
41224448 //ResetModel();
....@@ -4148,21 +4474,21 @@
41484474 //System.out.println("cut " + elem);
41494475 //System.out.println("parent = " + elem.parent);
41504476 // tmp.addChild(elem);
4151
- if (GrafreeD.clipboardIsTempGroup)
4477
+ if (Grafreed.clipboardIsTempGroup)
41524478 tGroup.add/*Child*/(tmp);
41534479 else
4154
- GrafreeD.clipboard = tmp;
4480
+ Grafreed.clipboard = tmp;
41554481 }
41564482 else
4157
- if (GrafreeD.clipboardIsTempGroup)
4483
+ if (Grafreed.clipboardIsTempGroup)
41584484 tGroup.add/*Child*/(child);
41594485 else
4160
- GrafreeD.clipboard = child;
4486
+ Grafreed.clipboard = child;
41614487 }
41624488
41634489 }
4164
- if (GrafreeD.clipboardIsTempGroup)
4165
- GrafreeD.clipboard = tGroup;
4490
+ if (Grafreed.clipboardIsTempGroup)
4491
+ Grafreed.clipboard = tGroup;
41664492 if (cut)
41674493 {
41684494 ResetModel();
....@@ -4176,7 +4502,7 @@
41764502 // return;
41774503 boolean first = true;
41784504
4179
- if (GrafreeD.clipboardIsTempGroup)
4505
+ if (Grafreed.clipboardIsTempGroup)
41804506 {
41814507 Composite temp;
41824508
....@@ -4187,7 +4513,7 @@
41874513 temp = (Composite)Applet3D.clipboard.deepCopy();
41884514 */
41894515 Object3D elem;
4190
- for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
4516
+ for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
41914517 {
41924518 Object3D child = (Object3D)e.nextElement();
41934519
....@@ -4221,21 +4547,21 @@
42214547 //Object3D cb = Applet3D.clipboard;
42224548 //temp.addChild(cb);
42234549 //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0));
4224
- assert(GrafreeD.clipboard.parent == null);
4225
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
4226
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
4227
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
4228
- makeSomething(expand?GrafreeD.clipboard.get(0).copyExpand():GrafreeD.clipboard.get(0).deepCopy());
4550
+ assert(Grafreed.clipboard.parent == null);
4551
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
4552
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
4553
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
4554
+ makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy());
42294555 else
4230
- makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4231
- GrafreeD.clipboard.get(0).parent = keepparent;
4556
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
4557
+ Grafreed.clipboard.get(0).parent = keepparent;
42324558 }
42334559
42344560 ResetModel();
42354561 refreshContents();
42364562 }
42374563
4238
- void pasteInto(boolean copyit)
4564
+ void pasteInto(boolean copyit, boolean clone)
42394565 {
42404566 // if (GrafreeD.clipboard == null)
42414567 // return;
....@@ -4264,15 +4590,22 @@
42644590 if (copyit)
42654591 {
42664592 // paste(false);
4267
- CloneClipboard(false); // sept 2014
4593
+ if (clone)
4594
+ {
4595
+ CloneClipboard(false); // sept 2014
4596
+ }
4597
+ else
4598
+ {
4599
+ paste(false);
4600
+ }
42684601 }
42694602 else
42704603 {
42714604 boolean first = true;
42724605
4273
- if (GrafreeD.clipboardIsTempGroup)
4606
+ if (Grafreed.clipboardIsTempGroup)
42744607 {
4275
- Composite temp = (Composite)GrafreeD.clipboard;
4608
+ Composite temp = (Composite)Grafreed.clipboard;
42764609 Object3D copy;
42774610 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
42784611 {
....@@ -4282,7 +4615,7 @@
42824615 }
42834616 } else
42844617 {
4285
- linkSomething(GrafreeD.clipboard); //.get(0));
4618
+ linkSomething(Grafreed.clipboard); //.get(0));
42864619 }
42874620 }
42884621 }
....@@ -4474,6 +4807,26 @@
44744807 makeSomething(csg);
44754808 }
44764809
4810
+ void Ungroup(Object3D g)
4811
+ {
4812
+ if (g instanceof HiddenObject)
4813
+ {
4814
+ HiddenObject h = (HiddenObject) g;
4815
+
4816
+ for (int i=0; i<h.ActualSize(); i++)
4817
+ {
4818
+ objEditor.makeSomething(h.get(i), false);
4819
+ }
4820
+ }
4821
+ else
4822
+ {
4823
+ for (int i=0; i<g.Size(); i++)
4824
+ {
4825
+ objEditor.makeSomething(g.get(i), false);
4826
+ }
4827
+ }
4828
+ }
4829
+
44774830 void ungroup()
44784831 {
44794832 /*
....@@ -4667,21 +5020,6 @@
46675020 }
46685021 */
46695022
4670
- void ImportGFD()
4671
- {
4672
- FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD);
4673
- browser.show();
4674
- String filename = browser.getFile();
4675
- if (filename != null && filename.length() > 0)
4676
- {
4677
- String fullname = browser.getDirectory() + filename;
4678
-
4679
- //Object3D readobj =
4680
- objEditor.ReadGFD(fullname, objEditor);
4681
- //makeSomething(readobj);
4682
- }
4683
- }
4684
-
46855023 /*
46865024 public void Callback(Object obj)
46875025 {
....@@ -4705,26 +5043,9 @@
47055043 }
47065044 */
47075045
4708
- void ImportVRMLX3D()
4709
- {
4710
- if (GrafreeD.standAlone)
4711
- {
4712
- /**/
4713
- FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
4714
- browser.show();
4715
- String filename = browser.getFile();
4716
- if (filename != null && filename.length() > 0)
4717
- {
4718
- String fullname = browser.getDirectory() + filename;
4719
- LoadVRMLX3D(fullname);
4720
- }
4721
- /**/
4722
- }
4723
- }
4724
-
47255046 String GetFile(String dialogName)
47265047 {
4727
- if (GrafreeD.standAlone)
5048
+ if (Grafreed.standAlone)
47285049 {
47295050 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
47305051 browser.show();
....@@ -4788,10 +5109,12 @@
47885109 cButton flashSelectionButton;
47895110 cButton editButton;
47905111 cButton uneditButton;
5112
+ JCheckBox allParamsButton;
47915113 cButton clearpanelButton;
4792
- cButton allParamsButton;
47935114 cButton unselectButton;
47945115
5116
+ cButton oneStepButton;
5117
+
47955118 cButton screenfitButton;
47965119 cButton screenfitpointButton;
47975120 cButton snapobjectButton;
....@@ -4833,8 +5156,9 @@
48335156 private MenuItem resetsupportItem;
48345157 private MenuItem resetreferencesItem;
48355158 private MenuItem linkverticesItem;
5159
+ private MenuItem relinkverticesItem;
48365160 private MenuItem setMasterItem;
4837
- private MenuItem resetMeshItem;
5161
+ private MenuItem resetAllItem;
48385162 private MenuItem stepAllItem;
48395163 private MenuItem revertMeshItem;
48405164 private MenuItem poseMeshItem;
....@@ -4845,6 +5169,7 @@
48455169 private MenuItem mergeGeometriesItem;
48465170 private MenuItem copyItem;
48475171 private MenuItem pasteItem;
5172
+ private MenuItem pasteIntoItem;
48485173 private MenuItem pasteLinkItem;
48495174 private MenuItem pasteCloneItem;
48505175 private MenuItem pasteExpandItem;
....@@ -4854,6 +5179,7 @@
48545179 private MenuItem genNormalsMESHItem;
48555180 private MenuItem genNormalsCADItem;
48565181 private MenuItem genNormalsORGANItem;
5182
+ private MenuItem genNormalsMINEItem;
48575183 private MenuItem stripifyItem;
48585184 private MenuItem unstripifyItem;
48595185 private MenuItem trimItem;
....@@ -4893,8 +5219,11 @@
48935219 private MenuItem panoTexturesItem;
48945220
48955221 private MenuItem resetCentroidItem;
4896
- private MenuItem transformgeometryItem;
5222
+ private MenuItem resetCentroidXZItem;
48975223 private MenuItem resetTransformItem;
5224
+ private MenuItem transformGeometryItem;
5225
+ private MenuItem transformChildrenItem;
5226
+ private MenuItem hideItem;
48985227 private MenuItem grabItem;
48995228 private MenuItem backItem;
49005229 private MenuItem frontItem;
....@@ -4915,6 +5244,7 @@
49155244
49165245 private MenuItem resetParentItem;
49175246 private MenuItem repairParentItem;
5247
+ private MenuItem repairShadowItem;
49185248 private MenuItem sortbysizeItem;
49195249 private MenuItem sortbynameItem;
49205250
....@@ -4935,10 +5265,11 @@
49355265 private MenuItem coneItem;
49365266 private MenuItem torusItem;
49375267 private MenuItem superItem;
5268
+ private MenuItem kleinItem;
49385269 private MenuItem blobItem;
49395270 private MenuItem latheItem;
49405271 private MenuItem bezierItem;
4941
- private MenuItem checkerItem;
5272
+ private MenuItem overlayItem;
49425273 private MenuItem meshItem;
49435274 // private MenuItem meshGroupItem;
49445275 private MenuItem springItem;
....@@ -4947,6 +5278,7 @@
49475278 private MenuItem csgItem;
49485279 private MenuItem templateItem;
49495280 private MenuItem textureItem;
5281
+ private MenuItem billboardItem;
49505282 private MenuItem shadowXItem;
49515283 private MenuItem shadowYItem;
49525284 private MenuItem shadowZItem;
....@@ -4959,11 +5291,6 @@
49595291 private MenuItem doubleItem;
49605292 private MenuItem tripleItem;
49615293
4962
- private MenuItem importGFDItem;
4963
- private MenuItem importVRMLX3DItem;
4964
- private MenuItem import3DSItem;
4965
- private MenuItem importOBJItem;
4966
-
49675294 private MenuItem computeAOItem;
49685295 private MenuItem recompileItem;
49695296 private MenuItem editScriptItem;
....@@ -4973,4 +5300,8 @@
49735300 private MenuItem analyzeItem;
49745301 private MenuItem dumpItem;
49755302 //boolean freezemodel = false;
5303
+
5304
+ Menu cameraMenu;
5305
+ MenuItem editCameraItem;
5306
+ MenuItem revertCameraItem;
49765307 }