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"));
....@@ -285,6 +400,13 @@
285400 genNormalsORGANItem.addActionListener(this);
286401 genNormalsCADItem = menu.add(new MenuItem("CAD Normals"));
287402 genNormalsCADItem.addActionListener(this);
403
+ genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals"));
404
+ genNormalsMESHItem.addActionListener(this);
405
+ if (Globals.ADVANCED)
406
+ {
407
+ genNormalsMINEItem = menu.add(new MenuItem("My Normals"));
408
+ genNormalsMINEItem.addActionListener(this);
409
+ }
288410 stripifyItem = menu.add(new MenuItem("Stripify"));
289411 stripifyItem.addActionListener(this);
290412 unstripifyItem = menu.add(new MenuItem("Unstripify"));
....@@ -306,23 +428,34 @@
306428 reduce34MeshItem.addActionListener(this);
307429 increaseMeshItem = menu.add(new MenuItem("Increase mesh"));
308430 increaseMeshItem.addActionListener(this);
309
- smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
310
- smoothMeshItem.addActionListener(this);
311431 clipMeshItem = menu.add(new MenuItem("Clip mesh"));
312432 clipMeshItem.addActionListener(this);
433
+
434
+ if (Globals.ADVANCED)
435
+ {
436
+ smoothMeshItem = menu.add(new MenuItem("Smooth mesh"));
437
+ smoothMeshItem.addActionListener(this);
438
+ }
313439
314440 oe.menuBar.add(menu = new Menu("Attributes"));
315441 clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
316442 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);
317447 menu.add("-");
318448 liveleavesItem = menu.add(new MenuItem("Live Leaves"));
319449 liveleavesItem.addActionListener(this);
320450 unliveleavesItem = menu.add(new MenuItem("Unlive Leaves"));
321451 unliveleavesItem.addActionListener(this);
452
+ if (Globals.ADVANCED)
453
+ {
322454 supportleavesItem = menu.add(new MenuItem("Support Leaves"));
323455 supportleavesItem.addActionListener(this);
324456 unsupportleavesItem = menu.add(new MenuItem("Unsupport Leaves"));
325457 unsupportleavesItem.addActionListener(this);
458
+ }
326459 hideleavesItem = menu.add(new MenuItem("Hide Leaves"));
327460 hideleavesItem.addActionListener(this);
328461 showleavesItem = menu.add(new MenuItem("Show Leaves"));
....@@ -366,29 +499,22 @@
366499 sortbynameItem = menu.add(new MenuItem("Sort by name"));
367500 sortbynameItem.addActionListener(this);
368501 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.
369509 extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
370510 extractGeometriesItem.addActionListener(this);
371511 cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry"));
372512 cloneGeometriesItem.addActionListener(this);
373
- shareGeometriesItem = menu.add(new MenuItem("Share Geometry"));
374
- shareGeometriesItem.addActionListener(this);
375
- mergeGeometriesItem = menu.add(new MenuItem("Merge Geometry"));
376
- mergeGeometriesItem.addActionListener(this);
513
+ }
377514
378515 oe.menuBar.add(menu = new Menu("Insert"));
379516 buildCreateMenu(menu);
380517
381
-
382
- oe.menuBar.add(menu = new Menu("Include"));
383
- importGFDItem = menu.add(new MenuItem("GrafreeD Object..."));
384
- importGFDItem.addActionListener(this);
385
- importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D Object..."));
386
- importVRMLX3DItem.addActionListener(this);
387
- importOBJItem = menu.add(new MenuItem("OBJ Object..."));
388
- importOBJItem.addActionListener(this);
389
- import3DSItem = menu.add(new MenuItem("3DS Object..."));
390
- import3DSItem.addActionListener(this);
391
-
392518 oe.menuBar.add(menu = new Menu("Tools"));
393519 buildToolsMenu(menu);
394520 }
....@@ -423,150 +549,98 @@
423549 oe.radioPanel.add(dummyButton);
424550 oe.buttonGroup.add(dummyButton);
425551 */
426
- aConstraints.gridy += 1;
427
- oe.aConstraints.gridwidth = 1;
428
- oe.aConstraints.gridx = 0;
552
+ //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
429553
430
- 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");
431556 liveCB.addItemListener(this);
432557
433
- oe.aConstraints.gridx += 1;
434
- oe.toolbarPanel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT), oe.aConstraints);
435
- supportCB.addItemListener(this);
436
-
437
- // oe.aConstraints.gridx += 1;
438
- // oe.toolbarPanel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), oe.aConstraints);
439
- // localCB.addItemListener(this);
440
-
441
- oe.aConstraints.gridx += 1;
442
- oe.toolbarPanel.add(crowdCB = new cCheckBox("Crowd", CameraPane.CROWD), oe.aConstraints);
443
- crowdCB.addItemListener(this);
444
-
445
- oe.aConstraints.gridx += 1;
446
- oe.toolbarPanel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA), oe.aConstraints);
447
- smoothCB.addItemListener(this);
448
-
449
- oe.aConstraints.gridx += 1;
450
- 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");
451564 fastCB.addItemListener(this);
452
- oe.aConstraints.gridx += 1;
453
- oe.toolbarPanel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE), oe.aConstraints);
454
- slowCB.addItemListener(this);
455
- oe.aConstraints.gridx += 1;
456
- oe.toolbarPanel.add(boxCB = new cCheckBox("Box", CameraPane.FAST), oe.aConstraints);
457
- boxCB.addItemListener(this);
458
-
459
-// oe.aConstraints.gridx += 1;
460
-// oe.toolbarPanel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), oe.aConstraints);
461
-// speakerMocapCB.addItemListener(this);
462
-
463
- if (false)
464
- {
465
- // handled in scripts
466
- oe.aConstraints.gridx += 1;
467
- oe.toolbarPanel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA), oe.aConstraints);
468
- speakerCameraCB.addItemListener(this);
469
-
470
- oe.aConstraints.gridx += 1;
471
- oe.toolbarPanel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS), oe.aConstraints);
472
- speakerFocusCB.addItemListener(this);
473
-
474
- oe.aConstraints.gridx += 1;
475
- oe.toolbarPanel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS), oe.aConstraints);
476
- smoothfocusCB.addItemListener(this);
477
- }
478
-
479
-//oe.aConstraints.gridx += 1;
480
-//oe.toolbarPanel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), oe.aConstraints);
481
-// debugCB.addItemListener(this);
482
-
483
- oe.aConstraints.gridx += 1;
484
- oe.toolbarPanel.add(oeilCB = new cCheckBox("O", CameraPane.OEIL), oe.aConstraints);
485
- oeilCB.addItemListener(this);
486
-
487
- oe.aConstraints.gridx += 1;
488
- oe.toolbarPanel.add(lookAtCB = new cCheckBox("T", CameraPane.LOOKAT), oe.aConstraints);
489
- lookAtCB.addItemListener(this);
490
-
491
- oe.aConstraints.gridx += 1;
492
- 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");
493568 trackCB.addItemListener(this);
494569
495
- oe.aConstraints.gridx += 1;
496
- oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
570
+ oe.toolbarPanel.add(screenfitButton = new cButton("@", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
571
+ screenfitButton.setToolTipText("Screen fit");
497572 screenfitButton.addActionListener(this);
498
- oe.aConstraints.gridx += 1;
573
+
499574 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
500575 // screenfitpointButton.addActionListener(this);
501
-// oe.aConstraints.gridx += 1;
502
- oe.toolbarPanel.add(snapobjectButton = new cButton(" O+ ")); //, oe.aConstraints);
503
- snapobjectButton.addActionListener(this);
504
- oe.aConstraints.gridx += 1;
505576
506
- //aConstraints.gridx = 0;
507
- //aConstraints.gridy += 1;
508
- oe.aConstraints.weighty = 0;
509
- oe.aConstraints.gridwidth = 1;
510
-
511
- 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");
512586 flashSelectionButton.addActionListener(this);
513
- oe.aConstraints.gridx += 1;
514
- oe.aConstraints.weighty = 0;
515
- oe.aConstraints.gridwidth = 1;
516587
517
- //
518
- 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");
519592 twoButton.addActionListener(this);
520
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
593
+ oe.toolbarPanel.add(fourButton = new cButton("+||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
521594 fourButton.addActionListener(this);
522
- 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");
523598 sixButton.addActionListener(this);
524
- 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");
525601 threeButton.addActionListener(this);
526
- 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");
527604 sevenButton.addActionListener(this);
528605 //
529606
530
- 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");
531609 rootButton.addActionListener(this);
532
- oe.aConstraints.gridx += 1;
533
- 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");
534613 closeButton.addActionListener(this);
535614 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
536615 //clearButton.addActionListener(this);
537
- oe.aConstraints.gridx += 1;
538616
539
- oe.aConstraints.gridx = 1; //
540
- 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");
541621 editButton.addActionListener(this);
542
- oe.aConstraints.gridx += 1;
543
- oe.aConstraints.weighty = 0;
544
- oe.aConstraints.gridwidth = 1;
545622
546
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
623
+ commandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
624
+ uneditButton.setToolTipText("Unedit selection");
547625 uneditButton.addActionListener(this);
548626
549
- oe.aConstraints.gridx += 1;
550
- oe.aConstraints.weighty = 0;
551
- oe.aConstraints.gridwidth = 1;
552
-
553
- oe.treePanel.add(clearPanelButton = new cButton("C"), oe.aConstraints);
554
- clearPanelButton.addActionListener(this);
555
-
556
- oe.aConstraints.gridx += 1;
557
- oe.aConstraints.weighty = 0;
558
- oe.aConstraints.gridwidth = 1;
559
-
560
- 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");
561629 allParamsButton.addActionListener(this);
562630
563
- oe.aConstraints.gridx += 1;
564
- oe.aConstraints.weighty = 0;
565
- oe.aConstraints.gridwidth = 1;
566
-
567
- 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");
568637 unselectButton.addActionListener(this);
569638
639
+ commandsPanel.preferredHeight = 1;
640
+
641
+ oe.treePanel.add(commandsPanel);
642
+ oe.treePanel.Return();
643
+
570644 // oe.aConstraints.gridx += 1;
571645 // oe.aConstraints.weighty = 0;
572646 // oe.aConstraints.gridwidth = 1;
....@@ -578,40 +652,37 @@
578652 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
579653 // gcButton.addActionListener(this);
580654
581
- oe.aConstraints.gridx = 0;
582
- oe.aConstraints.gridy += 1;
583
-
584
- //ctrlPanel.add(objList = new List(5, true));
585
- oe.aConstraints.gridwidth = 100;
586
- // oe.aConstraints.gridheight = 100;
587
- oe.aConstraints.fill = GridBagConstraints.BOTH; // HORIZONTAL;
588
- oe.aConstraints.gridheight = 1;
589
- oe.aConstraints.weighty = 0.5;
590
- oe.aConstraints.gridx = 0;
591
- JScrollPane jSP;
655
+ cGridBag jSPPanel = new cGridBag();
656
+
657
+ JScrollPane jSP;
592658 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
593
- 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);
594660 ResetModel();
595
- oe.aConstraints.weighty = 0.5;
596
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
597
- oe.aConstraints.gridy += 1;
598
- oe.aConstraints.gridwidth = 1;
661
+
662
+ oe.treePanel.add(jSPPanel);
663
+ oe.treePanel.Return();
599664
600
- oe.aConstraints.weighty = 0;
601
- oe.aConstraints.gridwidth = 2;
602
-
603
- 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");
604669 colorCB.addItemListener(this);
605
- oe.aConstraints.gridx += 2;
606
- 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");
607673 materialCB.addItemListener(this);
608
- oe.aConstraints.gridx += 2;
609
- 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");
610677 textureCB.addItemListener(this);
611678
612
- oe.aConstraints.gridx = 0;
613
- oe.aConstraints.gridy += 1;
679
+ copyOptionsPanel.preferredHeight = 1;
680
+ oe.treePanel.add(copyOptionsPanel);
681
+ oe.treePanel.Return();
614682
683
+// mainPanel.setDividerLocation(0.5); //1.0);
684
+// mainPanel.setResizeWeight(0.5);
685
+
615686 //jList.addListSelectionListener(this);
616687 oe.jTree.addTreeSelectionListener(this);
617688 //jTree.setRootVisible(false);
....@@ -633,18 +704,91 @@
633704 radio.layout = sevenButton;
634705 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
635706 }
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
+ }
636779
637780 void EditObject(Object3D obj)
638781 {
639
- cRadio dummyButton = new cRadio(obj.name);
640
- dummyButton.SetObject(obj);
641
- dummyButton.layout = sevenButton;
642
- dummyButton.SetCamera(cameraView.renderCamera, false);
643
- dummyButton.addActionListener(this);
644
- radioPanel.add(dummyButton);
645
- buttonGroup.add(dummyButton);
646
- 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();
647790 }
791
+
648792 void SetupViews(ObjEditor oe)
649793 {
650794 oe.SetupViews();
....@@ -663,6 +807,7 @@
663807 JCheckBox fastCB;
664808 JCheckBox slowCB;
665809 JCheckBox boxCB;
810
+ JCheckBox zoomBoxCB;
666811 JCheckBox trackCB;
667812 JCheckBox smoothfocusCB;
668813 // JCheckBox speakerMocapCB;
....@@ -705,8 +850,7 @@
705850 dropAttributes |= Object3D.TEXTURE;
706851 else
707852 dropAttributes &= ~Object3D.TEXTURE;
708
- }
709
- else if(e.getSource() == liveCB)
853
+ } else if(e.getSource() == liveCB)
710854 {
711855 cameraView.ToggleLive();
712856 }
....@@ -743,6 +887,10 @@
743887 Recompile();
744888 cameraView.repaint();
745889 // refreshContents();
890
+ }
891
+ else if(e.getSource() == zoomBoxCB)
892
+ {
893
+ cameraView.ToggleZoomBoxMode();
746894 }
747895 else if(e.getSource() == smoothfocusCB)
748896 {
....@@ -857,7 +1005,9 @@
8571005 // objEditor.DropFile((java.io.File[]) object, true);
8581006 // return;
8591007 // }
860
- if (string.charAt(0) == '/')
1008
+
1009
+ // File path for Mac and Windows
1010
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
8611011 {
8621012 // file(s)
8631013 String[] names = string.split("\n");
....@@ -884,7 +1034,7 @@
8841034
8851035 flashIt = false;
8861036 CameraPane pane = (CameraPane) target;
887
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
1037
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
8881038 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
8891039
8901040 if (group.selection.size() == 1)
....@@ -911,11 +1061,11 @@
9111061 {
9121062 loadClipboard(true);
9131063 objEditor.jTree.setSelectionPath(destinationPath);
914
- pasteInto(false);
1064
+ pasteInto(false, false);
9151065 } else {
9161066 loadClipboard(false);
9171067 objEditor.jTree.setSelectionPath(destinationPath);
918
- pasteInto(false); // true); // ???
1068
+ pasteInto(false, false); // true); // ???
9191069 }
9201070 }
9211071 public void dropActionChanged(DropTargetDragEvent dtde)
....@@ -1033,29 +1183,37 @@
10331183 torusItem.addActionListener(this);
10341184 superItem = menu.add(new MenuItem("Superellipsoid"));
10351185 superItem.addActionListener(this);
1186
+ kleinItem = menu.add(new MenuItem("Klein Bottle"));
1187
+ kleinItem.addActionListener(this);
10361188 particleItem = menu.add(new MenuItem("Particle system"));
10371189 particleItem.addActionListener(this);
1190
+ if (Globals.ADVANCED)
1191
+ {
10381192 ragdollItem = menu.add(new MenuItem("Rag Walk"));
10391193 ragdollItem.addActionListener(this);
10401194 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
10411195 ragdoll2Item.addActionListener(this);
1196
+ }
10421197 menu.add("-");
1043
- meshItem = menu.add(new MenuItem("Mesh"));
1198
+ meshItem = menu.add(new MenuItem("Dynamic Mesh"));
10441199 meshItem.addActionListener(this);
10451200 // meshGroupItem = menu.add(new MenuItem("Mesh Group"));
10461201 // meshGroupItem.addActionListener(this);
1202
+ if (Globals.ADVANCED)
1203
+ {
10471204 springItem = menu.add(new MenuItem("Spring"));
10481205 springItem.addActionListener(this);
10491206 flagItem = menu.add(new MenuItem("Flag"));
10501207 flagItem.addActionListener(this);
1051
- bezierItem = menu.add(new MenuItem("Patch"));
1052
- bezierItem.addActionListener(this);
1053
- checkerItem = menu.add(new MenuItem("Checker"));
1054
- checkerItem.addActionListener(this);
10551208 blobItem = menu.add(new MenuItem("Blob"));
10561209 blobItem.addActionListener(this);
10571210 latheItem = menu.add(new MenuItem("Lathe"));
10581211 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);
10591217 lightItem = menu.add(new MenuItem("Light"));
10601218 lightItem.addActionListener(this);
10611219 menu.add("-");
....@@ -1065,34 +1223,39 @@
10651223 loopItem.addActionListener(this);
10661224 doubleItem = menu.add(new MenuItem("Fork"));
10671225 doubleItem.addActionListener(this);
1226
+ if (Globals.ADVANCED)
1227
+ {
10681228 tripleItem = menu.add(new MenuItem("Trident"));
10691229 tripleItem.addActionListener(this);
1230
+ }
10701231 }
10711232
10721233 void buildToolsMenu(Menu menu)
10731234 {
10741235 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
10751236 animationItem.addItemListener(this);
1076
- animationItem.setState(CameraPane.ANIMATION);
1237
+ animationItem.setState(Globals.ANIMATION);
10771238
10781239 menu.add("-");
10791240 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
10801241 parseverticesItem.addActionListener(this);
10811242 textureFieldItem = menu.add(new MenuItem("Texture Field"));
10821243 textureFieldItem.addActionListener(this);
1083
- alignItem = menu.add(new MenuItem("Align"));
1244
+ alignItem = menu.add(new MenuItem("Align Objects"));
10841245 alignItem.addActionListener(this);
1085
- mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1086
- mirrorItem.addActionListener(this);
10871246 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
10881247 reduceMorphItem.addActionListener(this);
10891248 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
10901249 reduce34MorphItem.addActionListener(this);
1091
-
1250
+ menu.add("-");
10921251 menu.add(computeAOItem = new MenuItem("Compute AO"));
10931252 computeAOItem.addActionListener(this);
1094
- menu.add("-");
10951253
1254
+ if (Globals.ADVANCED)
1255
+ {
1256
+ mirrorItem = menu.add(new MenuItem("Mirror Poses"));
1257
+ mirrorItem.addActionListener(this);
1258
+ menu.add("-");
10961259 menu.add(memoryItem = new MenuItem("Memory Usage"));
10971260 memoryItem.addActionListener(this);
10981261 menu.add(analyzeItem = new MenuItem("Analyze"));
....@@ -1106,6 +1269,8 @@
11061269 resetParentItem.addActionListener(this);
11071270 repairParentItem = menu.add(new MenuItem("Repair Parent"));
11081271 repairParentItem.addActionListener(this);
1272
+ repairShadowItem = menu.add(new MenuItem("Repair Shadow"));
1273
+ repairShadowItem.addActionListener(this);
11091274 menu.add(invariantsItem = new MenuItem("Invariants"));
11101275 invariantsItem.addActionListener(this);
11111276 menu.add(recompileItem = new MenuItem("Recompile"));
....@@ -1113,6 +1278,7 @@
11131278 menu.add("-");
11141279 menu.add(editScriptItem = new MenuItem("Edit Script..."));
11151280 editScriptItem.addActionListener(this);
1281
+ }
11161282 }
11171283
11181284 void ScreenFit()
....@@ -1441,9 +1607,9 @@
14411607
14421608 void Overwrite(int mask)
14431609 {
1444
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
1610
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
14451611 {
1446
- Object3D content = GrafreeD.clipboard.get(0);
1612
+ Object3D content = Grafreed.clipboard.get(0);
14471613
14481614 if (content instanceof cGroup && ((cGroup)content).transientlink )
14491615 content = ((cGroup)content).get(0);
....@@ -1466,6 +1632,7 @@
14661632 //
14671633 public void actionPerformed(ActionEvent event) // , Object arg)
14681634 {
1635
+ Object source = event.getSource();
14691636 /*
14701637 if (event.getSource() == nameField)
14711638 {
....@@ -1477,11 +1644,11 @@
14771644 }
14781645 else
14791646 */
1480
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1647
+ if (source == lookAtItem || source == lookFromItem)
14811648 {
14821649 ScreenFit();
14831650 } else
1484
- if (event.getSource() == switchItem)
1651
+ if (source == switchItem)
14851652 {
14861653 cVector v1 = new cVector();
14871654 cVector v2 = new cVector();
....@@ -1490,11 +1657,11 @@
14901657 objEditor.cameraView.renderCamera.setAim(v2, v1);
14911658 objEditor.cameraView.repaint();
14921659 } else
1493
- if (event.getSource() == rectoidItem)
1660
+ if (source == rectoidItem)
14941661 {
14951662 makeSomething(new Box());
14961663 } else
1497
- if (event.getSource() == particleItem)
1664
+ if (source == particleItem)
14981665 {
14991666 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
15001667 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1515,9 +1682,9 @@
15151682 applyExample(particleGeom, "SMOKE");
15161683 makeSomething(particleGeom);
15171684 } else
1518
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1685
+ if (source == ragdollItem || source == ragdoll2Item)
15191686 {
1520
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1687
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15211688
15221689 ragdoll.toParent = LA.newMatrix();
15231690 ragdoll.fromParent = LA.newMatrix();
....@@ -1535,7 +1702,7 @@
15351702 } else
15361703 /*
15371704 */
1538
- if (event.getSource() == heightFieldItem)
1705
+ if (source == heightFieldItem)
15391706 {
15401707 Object3D obj = new Object3D();
15411708
....@@ -1573,27 +1740,31 @@
15731740
15741741 makeSomething(obj);
15751742 } else
1576
- if (event.getSource() == gridItem)
1743
+ if (source == gridItem)
15771744 {
15781745 makeSomething(new Grid());
15791746 } else
1580
- if (event.getSource() == ellipsoidItem)
1747
+ if (source == ellipsoidItem)
15811748 {
15821749 makeSomething(new Sphere());
15831750 } else
1584
- if (event.getSource() == coneItem)
1751
+ if (source == coneItem)
15851752 {
15861753 makeSomething(new Cone());
15871754 } else
1588
- if (event.getSource() == torusItem)
1755
+ if (source == torusItem)
15891756 {
15901757 makeSomething(new Torus());
15911758 } else
1592
- if (event.getSource() == superItem)
1759
+ if (source == superItem)
15931760 {
15941761 makeSomething(new Superellipsoid());
15951762 } else
1596
- if (event.getSource() == blobItem)
1763
+ if (source == kleinItem)
1764
+ {
1765
+ makeSomething(new Klein());
1766
+ } else
1767
+ if (source == blobItem)
15971768 {
15981769 Blob blob = new Blob();
15991770 BlobComponent comp = new BlobComponent();
....@@ -1601,15 +1772,15 @@
16011772 //blob.retile();
16021773 makeSomething(blob);
16031774 } else
1604
- if (event.getSource() == latheItem)
1775
+ if (source == latheItem)
16051776 {
16061777 makeSomething(new Lathe());
16071778 } else
1608
- if (event.getSource() == bezierItem)
1779
+ if (source == bezierItem)
16091780 {
16101781 makeSomething(new BezierSurface());
16111782 } else
1612
- if (event.getSource() == checkerItem)
1783
+ if (source == overlayItem)
16131784 {
16141785 /*
16151786 Object3D obj = new BezierSurface(5,8);
....@@ -1624,7 +1795,7 @@
16241795 */
16251796 makeSomething(new Checker());
16261797 } else
1627
- if (event.getSource() == meshItem)
1798
+ if (source == meshItem)
16281799 {
16291800 Object3D itemtomake = new Object3D();
16301801 Object3D child;
....@@ -1645,35 +1816,35 @@
16451816 makeSomething(child);
16461817 }
16471818 } else
1648
- if (event.getSource() == springItem)
1819
+ if (source == springItem)
16491820 {
16501821 cSpring s = new cSpring();
16511822 s.setup();
16521823 makeSomething(s);
16531824 } else
1654
- if (event.getSource() == flagItem)
1825
+ if (source == flagItem)
16551826 {
16561827 cSpring s = new cFlag();
16571828 s.setup();
16581829 makeSomething(s);
16591830 } else
1660
- if (event.getSource() == lightItem)
1831
+ if (source == lightItem)
16611832 {
16621833 makeSomething(new Light());
16631834 } else
1664
- if (event.getSource() == csgItem)
1835
+ if (source == csgItem)
16651836 {
16661837 group(new CSG());
16671838 } else
1668
- if (event.getSource() == templateItem)
1839
+ if (source == templateItem)
16691840 {
16701841 group(new cTemplate());
16711842 } else
1672
- if (event.getSource() == attributeItem)
1843
+ if (source == attributeItem)
16731844 {
16741845 makeSomething(new Attribute());
16751846 } else
1676
- if (event.getSource() == pointflowItem)
1847
+ if (source == pointflowItem)
16771848 {
16781849 makeSomething(new PointFlow());
16791850 } else
....@@ -1685,7 +1856,7 @@
16851856 } else
16861857 */
16871858
1688
- if (event.getSource() == superLoopItem)
1859
+ if (source == superLoopItem)
16891860 {
16901861 Composite g = new cGroup();
16911862 for (int i=0; i<15; i++)
....@@ -1707,7 +1878,7 @@
17071878
17081879 group(g);
17091880 } else
1710
- if (event.getSource() == loopItem)
1881
+ if (source == loopItem)
17111882 {
17121883 Composite csg = new GroupLeaf();
17131884 csg.count = 5;
....@@ -1716,7 +1887,7 @@
17161887 csg.addChild(child);
17171888 child.addChild(csg);
17181889 } else
1719
- if (event.getSource() == doubleItem)
1890
+ if (source == doubleItem)
17201891 {
17211892 Composite csg = new GroupLeaf();
17221893 csg.count = 5;
....@@ -1728,7 +1899,7 @@
17281899 csg.addChild(child);
17291900 child.addChild(csg);
17301901 } else
1731
- if (event.getSource() == tripleItem)
1902
+ if (source == tripleItem)
17321903 {
17331904 Composite csg = new GroupLeaf();
17341905 csg.count = 4;
....@@ -1743,71 +1914,59 @@
17431914 csg.addChild(child);
17441915 child.addChild(csg);
17451916 } else
1746
-
1747
- if (event.getSource() == importGFDItem)
1917
+ if (source == computeAOItem)
17481918 {
1749
- ImportGFD();
1919
+ Globals.drawMode = CameraPane.OCCLUSION;
1920
+ Globals.theRenderer.repaint();
17501921 } else
1751
- if (event.getSource() == importVRMLX3DItem)
1752
- {
1753
- ImportVRMLX3D();
1754
- } else
1755
- if (event.getSource() == import3DSItem)
1756
- {
1757
- objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
1758
- } else
1759
- if (event.getSource() == importOBJItem)
1760
- {
1761
- objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1762
- } else
1763
- if (event.getSource() == computeAOItem)
1764
- {
1765
- CameraPane.drawMode = CameraPane.OCCLUSION;
1766
- CameraPane.theRenderer.repaint();
1767
- } else
1768
- if (event.getSource() == recompileItem)
1922
+ if (source == recompileItem)
17691923 {
17701924 Recompile();
17711925 refreshContents();
17721926 } else
1773
- if (event.getSource() == editScriptItem)
1927
+ if (source == editScriptItem)
17741928 {
17751929 OpenDialog();
17761930 refreshContents();
17771931 } else
1778
- if (event.getSource() == invariantsItem)
1932
+ if (source == invariantsItem)
17791933 {
17801934 System.out.println("Invariants:");
1781
- GrafreeD.theApplet3D.universe.invariants();
1935
+ Grafreed.grafreeD.universe.invariants();
17821936 } else
1783
- if (event.getSource() == memoryItem)
1937
+ if (source == memoryItem)
17841938 {
17851939 //System.out.println("Invariants:");
17861940 PrintMemory();
17871941 } else
1788
- if (event.getSource() == pathItem)
1942
+ if (source == pathItem)
17891943 {
17901944 PrintPath();
17911945 } else
1792
- if (event.getSource() == analyzeItem)
1946
+ if (source == analyzeItem)
17931947 {
17941948 AnalyzeObject();
17951949 } else
1796
- if (event.getSource() == dumpItem)
1950
+ if (source == dumpItem)
17971951 {
17981952 DumpObject();
17991953 } else
1800
- if (event.getSource() == screenfitButton)
1954
+ if (source == oneStepButton)
1955
+ {
1956
+ Globals.ONESTEP = true;
1957
+ cameraView.repaint();
1958
+ } else
1959
+ if (source == screenfitButton)
18011960 {
18021961 //Reload(lastConverter, lastFilename, true);
18031962 ScreenFit();
18041963 } else
1805
- if (event.getSource() == screenfitpointButton)
1964
+ if (source == screenfitpointButton)
18061965 {
18071966 //Reload(lastConverter, lastFilename, true);
18081967 ScreenFitPoint();
18091968 } else
1810
- if (event.getSource() == snapobjectButton)
1969
+ if (source == snapobjectButton)
18111970 {
18121971 //Reload(lastConverter, lastFilename, true);
18131972 SnapObject();
....@@ -1818,13 +1977,13 @@
18181977 // Recompile();
18191978 // refreshContents();
18201979 // } else
1821
- if (event.getSource() == gcButton)
1980
+ if (source == gcButton)
18221981 {
18231982 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18241983 System.gc();
18251984 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
18261985 } else
1827
- if (event.getSource() == editLeafItem)
1986
+ if (source == editLeafItem)
18281987 {
18291988 Object3D obj;
18301989 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1838,62 +1997,66 @@
18381997 }
18391998 refreshContents(true);
18401999 } else
1841
- if (event.getSource() == openWindowItem)
2000
+ if (source == openWindowItem)
18422001 {
18432002 EditSelection(true);
18442003 } else
1845
- if (event.getSource() == cutItem || event.getSource() == clearButton)
2004
+ if (source == cutItem || source == clearButton)
18462005 {
18472006 loadClipboard(true);
18482007 } else
1849
- if (event.getSource() == duplicateItem)
2008
+ if (source == duplicateItem)
18502009 {
1851
- Object3D keep = GrafreeD.clipboard;
2010
+ Object3D keep = Grafreed.clipboard;
18522011 loadClipboard(false);
18532012 paste(false);
1854
- GrafreeD.clipboard = keep;
2013
+ Grafreed.clipboard = keep;
18552014 } else
1856
- if (event.getSource() == cloneItem)
2015
+ if (source == cloneItem)
18572016 {
18582017 CloneSelection(false);
18592018 } else
1860
- if (event.getSource() == cloneSupportItem)
2019
+ if (source == cloneSupportItem)
18612020 {
18622021 CloneSelection(true);
18632022 } else
1864
- if (event.getSource() == copyItem)
2023
+ if (source == copyItem)
18652024 {
18662025 loadClipboard(false);
18672026 } else
1868
- if (event.getSource() == pasteItem)
2027
+ if (source == pasteItem)
18692028 {
18702029 paste(false);
18712030 } else
1872
- if (event.getSource() == pasteLinkItem)
2031
+ if (source == pasteIntoItem)
18732032 {
1874
- pasteInto(false);
2033
+ pasteInto(true, false);
18752034 } else
1876
- if (event.getSource() == pasteCloneItem)
2035
+ if (source == pasteLinkItem)
18772036 {
1878
- pasteInto(true);
2037
+ pasteInto(false, false);
18792038 } else
1880
- if (event.getSource() == pasteExpandItem)
2039
+ if (source == pasteCloneItem)
2040
+ {
2041
+ pasteInto(true, true);
2042
+ } else
2043
+ if (source == pasteExpandItem)
18812044 {
18822045 paste(true);
18832046 } else
1884
- if (event.getSource() == synchronizeItem)
2047
+ if (source == synchronizeItem)
18852048 {
18862049 Overwrite(Object3D.TRANSFORM);
18872050 } else
1888
- if (event.getSource() == overwriteNameItem)
2051
+ if (source == overwriteNameItem)
18892052 {
18902053 Overwrite(Object3D.NAME);
18912054 } else
1892
- if (event.getSource() == overwriteUVItem)
2055
+ if (source == overwriteUVItem)
18932056 {
18942057 Overwrite(Object3D.UV);
18952058 } else
1896
- if (event.getSource() == overwriteMatItem)
2059
+ if (source == overwriteMatItem)
18972060 {
18982061 /* july 2015
18992062 if ((dropAttributes & Object3D.TEXTURE) == 0)
....@@ -1913,7 +2076,7 @@
19132076
19142077 Overwrite(dropAttributes);
19152078 }
1916
- if (event.getSource() == overwriteGeoItem)
2079
+ if (source == overwriteGeoItem)
19172080 {
19182081 Overwrite(Object3D.GEOMETRY);
19192082 // if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
....@@ -1930,7 +2093,7 @@
19302093 // refreshContents();
19312094 // }
19322095 } else
1933
- if (event.getSource() == generateMeshItem)
2096
+ if (source == generateMeshItem)
19342097 {
19352098 //if (group.selection.size() == 1)
19362099 // for (int i=0; i<group.selection.size(); i++)
....@@ -1941,7 +2104,7 @@
19412104 ResetModel();
19422105 refreshContents();
19432106 } else
1944
- if (event.getSource() == extractGeometriesItem)
2107
+ if (source == extractGeometriesItem)
19452108 {
19462109 boolean one = false;
19472110
....@@ -1968,7 +2131,7 @@
19682131 ResetModel();
19692132 refreshContents();
19702133 } else
1971
- if (event.getSource() == cloneGeometriesItem)
2134
+ if (source == cloneGeometriesItem)
19722135 {
19732136 boolean one = false;
19742137
....@@ -1994,32 +2157,37 @@
19942157 ResetModel();
19952158 refreshContents();
19962159 } else
1997
- if (event.getSource() == shareGeometriesItem)
2160
+ if (source == shareGeometriesItem)
19982161 {
19992162 boolean one = false;
20002163
20012164 if (group.selection.size() == 1)
20022165 one = true;
20032166
2167
+ Object3D merge = null;
2168
+
20042169 Object3D content = new cGroup();
20052170
20062171 for (int i=0; i<group.selection.size(); i++)
20072172 {
2008
- Object3D sel = new Merge(group.selection.get(i));
2173
+ merge = new Merge(group.selection.get(i));
20092174
20102175 if (one)
2011
- makeSomething(sel, false);
2176
+ makeSomething(merge, false);
20122177 else
2013
- content.addChild(sel);
2178
+ content.addChild(merge);
20142179 }
20152180
20162181 if (!one)
2017
- makeSomething(content, false);
2018
-
2019
- ResetModel();
2020
- refreshContents();
2182
+ makeSomething(content, true);
2183
+ else
2184
+ {
2185
+ ResetModel();
2186
+ Select(merge.GetTreePath(), true, false); // unselect... false);
2187
+ refreshContents();
2188
+ }
20212189 } else
2022
- if (event.getSource() == mergeGeometriesItem)
2190
+ if (source == mergeGeometriesItem)
20232191 {
20242192 boolean one = false;
20252193
....@@ -2049,7 +2217,7 @@
20492217 ResetModel();
20502218 refreshContents();
20512219 } else
2052
- if (event.getSource() == linkverticesItem)
2220
+ if (source == linkverticesItem)
20532221 {
20542222 // if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
20552223 // {
....@@ -2062,39 +2230,48 @@
20622230 // group.selection.get(0).setMasterThis(content); // should be identity
20632231 // refreshContents();
20642232 // }
2065
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2233
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
20662234 {
2067
- Object3D content = GrafreeD.clipboard.get(0);
2235
+ Object3D content = Grafreed.clipboard.get(0);
20682236
20692237 if (content instanceof cGroup && ((cGroup)content).transientlink )
20702238 content = ((cGroup)content).get(0);
20712239
2072
- 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));
20732241 for (int i=0; i<group.selection.size(); i++)
20742242 {
2075
- boolean random = CameraPane.RANDOM;
2076
- CameraPane.RANDOM = false; // parse all random nodes
2243
+ boolean random = CameraPane.SWITCH;
2244
+ CameraPane.SWITCH = false; // parse all random nodes
20772245 group.selection.get(i).linkVerticesThis(content);
20782246 // group.selection.get(i).setMasterThis(content); // should be identity
2079
- CameraPane.RANDOM = random;
2247
+ CameraPane.SWITCH = random;
20802248 }
2081
- 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));
20822250 refreshContents();
20832251 }
20842252 } else
2085
- if (event.getSource() == resetsupportItem)
2253
+ if (source == resetsupportItem)
20862254 {
20872255 for (int i=0; i<group.selection.size(); i++)
20882256 {
2089
- boolean random = CameraPane.RANDOM;
2090
- CameraPane.RANDOM = false; // parse all random nodes
2257
+ boolean random = CameraPane.SWITCH;
2258
+ CameraPane.SWITCH = false; // parse all random nodes
20912259 group.selection.get(i).linkVerticesThis(null);
2092
- CameraPane.RANDOM = random;
2260
+ CameraPane.SWITCH = random;
20932261 }
20942262
20952263 refreshContents();
20962264 } else
2097
- 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)
20982275 {
20992276 for (int i=0; i<group.selection.size(); i++)
21002277 {
....@@ -2103,11 +2280,11 @@
21032280
21042281 refreshContents();
21052282 } else
2106
- if (event.getSource() == setMasterItem)
2283
+ if (source == setMasterItem)
21072284 {
2108
- if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
2285
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
21092286 {
2110
- Object3D content = GrafreeD.clipboard.get(0);
2287
+ Object3D content = Grafreed.clipboard.get(0);
21112288
21122289 if (content instanceof cGroup && ((cGroup)content).transientlink )
21132290 content = ((cGroup)content).get(0);
....@@ -2116,13 +2293,13 @@
21162293 refreshContents();
21172294 }
21182295 } else
2119
- if (event.getSource() == poseMeshItem)
2296
+ if (source == poseMeshItem)
21202297 {
21212298 if (group.selection.size() == 1)
21222299 {
2123
- if (GrafreeD.clipboard.size() == 1)
2300
+ if (Grafreed.clipboard.size() == 1)
21242301 {
2125
- Object3D content = GrafreeD.clipboard.get(0);
2302
+ Object3D content = Grafreed.clipboard.get(0);
21262303
21272304 if (content instanceof cGroup && ((cGroup)content).transientlink )
21282305 content = ((cGroup)content).get(0);
....@@ -2135,19 +2312,19 @@
21352312 }
21362313
21372314 } else
2138
- if (event.getSource() == revertMeshItem)
2315
+ if (source == revertMeshItem)
21392316 {
21402317 RevertMeshes();
21412318 } else
2142
- if (event.getSource() == resetMeshItem)
2319
+ if (source == resetAllItem)
21432320 {
21442321 ResetAll();
21452322 } else
2146
- if (event.getSource() == stepAllItem)
2323
+ if (source == stepAllItem)
21472324 {
21482325 StepAll();
21492326 } else
2150
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2327
+ if (source == clearItem) // || event.getSource() == clearButton)
21512328 {
21522329 //int indices[] = jList.getSelectedIndices();
21532330 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2155,42 +2332,46 @@
21552332
21562333 ClearSelection(false);
21572334 } else
2158
- if (event.getSource() == clearAllItem)
2335
+ if (source == clearAllItem)
21592336 {
21602337 ClearSelection(true);
21612338 } else
2162
- if (event.getSource() == grabItem)
2339
+ if (source == grabItem)
21632340 {
21642341 group(new cGroup(), true);
21652342 } else
2166
- if (event.getSource() == frontItem)
2343
+ if (source == hideItem)
2344
+ {
2345
+ group(new HiddenObject());
2346
+ } else
2347
+ if (source == frontItem)
21672348 {
21682349 front();
21692350 } else
2170
- if (event.getSource() == backItem)
2351
+ if (source == backItem)
21712352 {
21722353 back();
21732354 } else
2174
- if (event.getSource() == cameraItem)
2355
+ if (source == cameraItem)
21752356 {
21762357 makeSomething(new Camera());
21772358 } else
2178
- if (event.getSource() == compositeItem)
2359
+ if (source == compositeItem)
21792360 {
21802361 group(new Composite());
21812362 } else
2182
- if (event.getSource() == randomItem)
2363
+ if (source == randomItem)
21832364 {
21842365 RandomNode random = new RandomNode();
21852366 group(random);
21862367 if (random.size() > 0)
2187
- random.name = random.get(0).name + "Rnd";
2368
+ random.name = random.get(0).name + "Switch";
21882369 } else
2189
- if (event.getSource() == physicsItem)
2370
+ if (source == physicsItem)
21902371 {
21912372 group(new PhysicsNode());
21922373 } else
2193
- if (event.getSource() == frameselectorItem)
2374
+ if (source == frameselectorItem)
21942375 {
21952376 for (int i=0; i<group.selection.size(); i++)
21962377 {
....@@ -2202,7 +2383,7 @@
22022383 ResetModel();
22032384 refreshContents();
22042385 } else
2205
- if (event.getSource() == switchGeoItem)
2386
+ if (source == switchGeoItem)
22062387 {
22072388 for (int i=0; i<group.selection.size(); i++)
22082389 {
....@@ -2214,7 +2395,7 @@
22142395 ResetModel();
22152396 refreshContents();
22162397 } else
2217
- if (event.getSource() == switchTransfoItem)
2398
+ if (source == switchTransfoItem)
22182399 {
22192400 for (int i=0; i<group.selection.size(); i++)
22202401 {
....@@ -2226,7 +2407,7 @@
22262407 ResetModel();
22272408 refreshContents();
22282409 } else
2229
- if (event.getSource() == morphItem)
2410
+ if (source == morphItem)
22302411 {
22312412 for (int i=0; i<group.selection.size(); i++)
22322413 {
....@@ -2238,7 +2419,7 @@
22382419 ResetModel();
22392420 refreshContents();
22402421 } else
2241
- if (event.getSource() == scriptNodeItem)
2422
+ if (source == scriptNodeItem)
22422423 {
22432424 boolean atleastone = false;
22442425
....@@ -2277,195 +2458,223 @@
22772458 }
22782459 }
22792460 } else
2280
- if (event.getSource() == linkerItem)
2461
+ if (source == linkerItem)
22812462 {
22822463 group(new cLinker());
22832464 } else
2284
- if (event.getSource() == textureItem)
2465
+ if (source == textureItem)
22852466 {
22862467 group(new TextureNode());
22872468 } else
2288
- if (event.getSource() == shadowXItem)
2469
+ if (source == billboardItem)
2470
+ {
2471
+ group(new BillboardNode());
2472
+ } else
2473
+ if (source == shadowXItem)
22892474 {
22902475 CastShadow(0);
22912476 } else
2292
- if (event.getSource() == shadowYItem)
2477
+ if (source == shadowYItem)
22932478 {
22942479 CastShadow(1);
22952480 } else
2296
- if (event.getSource() == shadowZItem)
2481
+ if (source == shadowZItem)
22972482 {
22982483 CastShadow(2);
22992484 } else
2300
- if (event.getSource() == ungroupItem)
2485
+ if (source == ungroupItem)
23012486 {
2302
- 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();
23032496 } else
2304
- if (event.getSource() == genUVItem)
2497
+ if (source == genUVItem)
23052498 {
23062499 GenUV();
23072500 } else
2308
- if (event.getSource() == genNormalsCADItem)
2501
+ if (source == genNormalsCADItem)
23092502 {
23102503 GenNormals(true);
23112504 } else
2312
- if (event.getSource() == genNormalsORGANItem)
2505
+ if (source == genNormalsMESHItem)
2506
+ {
2507
+ GenNormals(true); // TODO
2508
+ } else
2509
+ if (source == genNormalsORGANItem)
23132510 {
23142511 GenNormals(false);
23152512 } else
2316
- if (event.getSource() == stripifyItem)
2513
+ if (source == genNormalsMINEItem)
2514
+ {
2515
+ GenNormalsMINE();
2516
+ } else
2517
+ if (source == stripifyItem)
23172518 {
23182519 Stripify();
23192520 } else
2320
- if (event.getSource() == unstripifyItem)
2521
+ if (source == unstripifyItem)
23212522 {
23222523 Unstripify();
23232524 } else
2324
- if (event.getSource() == trimItem)
2525
+ if (source == trimItem)
23252526 {
23262527 Trim();
23272528 } else
2328
- if (event.getSource() == untrimItem)
2529
+ if (source == untrimItem)
23292530 {
23302531 Untrim();
23312532 } else
2332
- if (event.getSource() == clearColorsItem)
2533
+ if (source == clearColorsItem)
23332534 {
23342535 ClearColors();
23352536 } else
2336
- if (event.getSource() == clearMaterialsItem)
2537
+ if (source == clearMaterialsItem)
23372538 {
23382539 ClearMaterials();
23392540 } else
2340
- if (event.getSource() == liveleavesItem)
2541
+ if (source == liveleavesItem)
23412542 {
23422543 LiveLeaves(true);
23432544 } else
2344
- if (event.getSource() == unliveleavesItem)
2545
+ if (source == unliveleavesItem)
23452546 {
23462547 LiveLeaves(false);
23472548 } else
2348
- if (event.getSource() == supportleavesItem)
2549
+ if (source == supportleavesItem)
23492550 {
23502551 SupportLeaves(true);
23512552 } else
2352
- if (event.getSource() == unsupportleavesItem)
2553
+ if (source == unsupportleavesItem)
23532554 {
23542555 SupportLeaves(false);
23552556 } else
2356
- if (event.getSource() == hideleavesItem)
2557
+ if (source == hideleavesItem)
23572558 {
23582559 HideLeaves(true);
23592560 } else
2360
- if (event.getSource() == showleavesItem)
2561
+ if (source == showleavesItem)
23612562 {
23622563 HideLeaves(false);
23632564 } else
2364
- if (event.getSource() == markleavesItem)
2565
+ if (source == markleavesItem)
23652566 {
23662567 MarkLeaves(true);
23672568 } else
2368
- if (event.getSource() == unmarkleavesItem)
2569
+ if (source == unmarkleavesItem)
23692570 {
23702571 MarkLeaves(false);
23712572 } else
2372
- if (event.getSource() == flipVItem)
2573
+ if (source == flipVItem)
23732574 {
23742575 FlipV(true);
23752576 } else
2376
- if (event.getSource() == unflipVItem)
2577
+ if (source == unflipVItem)
23772578 {
23782579 FlipV(false);
23792580 } else
2380
- if (event.getSource() == lowTexturesItem)
2581
+ if (source == lowTexturesItem)
23812582 {
23822583 SetTexRes(0);
23832584 } else
2384
- if (event.getSource() == normalTexturesItem)
2585
+ if (source == normalTexturesItem)
23852586 {
23862587 SetTexRes(1);
23872588 } else
2388
- if (event.getSource() == highTexturesItem)
2589
+ if (source == highTexturesItem)
23892590 {
23902591 SetTexRes(2);
23912592 } else
2392
- if (event.getSource() == veryhighTexturesItem)
2593
+ if (source == veryhighTexturesItem)
23932594 {
23942595 SetTexRes(3);
23952596 } else
2396
- if (event.getSource() == maxTexturesItem)
2597
+ if (source == maxTexturesItem)
23972598 {
23982599 SetTexRes(4);
23992600 } else
2400
- if (event.getSource() == panoTexturesItem)
2601
+ if (source == panoTexturesItem)
24012602 {
24022603 SetTexRes(5);
24032604 } else
2404
- if (event.getSource() == reverseNormalsItem)
2605
+ if (source == reverseNormalsItem)
24052606 {
24062607 ReverseNormals();
24072608 } else
2408
- if (event.getSource() == parseverticesItem)
2609
+ if (source == parseverticesItem)
24092610 {
24102611 ParseVertices();
24112612 } else
2412
- if (event.getSource() == textureFieldItem)
2613
+ if (source == textureFieldItem)
24132614 {
24142615 TextureVertices();
24152616 } else
2416
- if (event.getSource() == alignItem)
2617
+ if (source == alignItem)
24172618 {
24182619 Align();
24192620 } else
2420
- if (event.getSource() == mirrorItem)
2621
+ if (source == mirrorItem)
24212622 {
24222623 MirrorPoses();
24232624 } else
2424
- if (event.getSource() == reduceMorphItem)
2625
+ if (source == reduceMorphItem)
24252626 {
24262627 MeshReduction(false);
24272628 } else
2428
- if (event.getSource() == reduce34MorphItem)
2629
+ if (source == reduce34MorphItem)
24292630 {
24302631 MeshReduction(true);
24312632 } else
2432
- if (event.getSource() == reverseTrianglesItem)
2633
+ if (source == reverseTrianglesItem)
24332634 {
24342635 ReverseTriangles();
24352636 } else
2436
- if (event.getSource() == reduceMeshItem)
2637
+ if (source == reduceMeshItem)
24372638 {
24382639 ReduceMesh(false);
24392640 } else
2440
- if (event.getSource() == reduce34MeshItem)
2641
+ if (source == reduce34MeshItem)
24412642 {
24422643 ReduceMesh(true);
24432644 } else
2444
- if (event.getSource() == increaseMeshItem)
2645
+ if (source == increaseMeshItem)
24452646 {
24462647 IncreaseMesh();
24472648 } else
2448
- if (event.getSource() == clipMeshItem)
2649
+ if (source == clipMeshItem)
24492650 {
24502651 ClipMesh();
24512652 } else
2452
- if (event.getSource() == smoothMeshItem)
2653
+ if (source == smoothMeshItem)
24532654 {
24542655 SmoothMesh();
24552656 } else
2456
- if (event.getSource() == transformgeometryItem)
2657
+ if (source == transformGeometryItem)
24572658 {
24582659 TransformGeometry();
24592660 } else
2460
- if (event.getSource() == resetTransformItem)
2661
+ if (source == transformChildrenItem)
2662
+ {
2663
+ TransformChildren();
2664
+ } else
2665
+ if (source == resetTransformItem)
24612666 {
24622667 ResetTransform();
24632668 } else
2464
- if (event.getSource() == resetCentroidItem)
2669
+ if (source == resetCentroidItem)
24652670 {
2466
- ResetCentroid();
2671
+ ResetCentroid(true);
24672672 } else
2468
- if (event.getSource() == resetParentItem)
2673
+ if (source == resetCentroidXZItem)
2674
+ {
2675
+ ResetCentroid(false);
2676
+ } else
2677
+ if (source == resetParentItem)
24692678 {
24702679 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24712680 {
....@@ -2475,7 +2684,7 @@
24752684
24762685 refreshContents();
24772686 } else
2478
- if (event.getSource() == repairParentItem)
2687
+ if (source == repairParentItem)
24792688 {
24802689 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24812690 {
....@@ -2489,7 +2698,21 @@
24892698
24902699 refreshContents();
24912700 } else
2492
- 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)
24932716 {
24942717 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24952718 {
....@@ -2501,7 +2724,7 @@
25012724 ResetModel();
25022725 refreshContents();
25032726 } else
2504
- if (event.getSource() == sortbynameItem)
2727
+ if (source == sortbynameItem)
25052728 {
25062729 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
25072730 {
....@@ -2513,7 +2736,7 @@
25132736 ResetModel();
25142737 refreshContents();
25152738 } else
2516
- if (event.getSource() == attachPigmentItem)
2739
+ if (source == attachPigmentItem)
25172740 {
25182741 String texture = GetFile("Attach pigment");
25192742 Object3D obj;
....@@ -2525,7 +2748,7 @@
25252748
25262749 refreshContents();
25272750 } else
2528
- if (event.getSource() == detachPigmentItem)
2751
+ if (source == detachPigmentItem)
25292752 {
25302753 Object3D obj;
25312754 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2536,7 +2759,7 @@
25362759
25372760 refreshContents();
25382761 } else
2539
- if (event.getSource() == attachBumpItem)
2762
+ if (source == attachBumpItem)
25402763 {
25412764 String texture = GetFile("Attach bump");
25422765 Object3D obj;
....@@ -2548,7 +2771,7 @@
25482771
25492772 refreshContents();
25502773 } else
2551
- if (event.getSource() == detachBumpItem)
2774
+ if (source == detachBumpItem)
25522775 {
25532776 Object3D obj;
25542777 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2559,7 +2782,7 @@
25592782
25602783 refreshContents();
25612784 } else
2562
- if (event.getSource() == pigmentBumpItem)
2785
+ if (source == pigmentBumpItem)
25632786 {
25642787 Object3D obj;
25652788 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2570,158 +2793,195 @@
25702793
25712794 refreshContents();
25722795 } else
2573
- if (event.getSource() == flashSelectionButton)
2796
+ if (source == flashSelectionButton)
25742797 {
25752798 CameraPane.flash = true;
25762799 refreshContents();
25772800 } else
2578
- if (event.getSource() == oneButton)
2801
+ if (source == oneButton)
25792802 {
25802803 } else
2581
- if (event.getSource() == twoButton)
2804
+ if (source == twoButton)
25822805 {
25832806 radio.layout = twoButton;
25842807 // bug
25852808 //gridPanel.setDividerLocation(1.0);
25862809 //bigPanel.setDividerLocation(0.0);
2587
- bigThree.remove(jtp);
2588
- bigThree.remove(cameraPanel);
2589
- bigThree.remove(XYZPanel);
2590
- aWindowConstraints.gridx = 0;
2591
- aWindowConstraints.gridy = 0;
2592
- aWindowConstraints.gridwidth = 1;
2593
- // aConstraints.gridheight = 3;
2594
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2595
- aWindowConstraints.weightx = 0;
2596
- aWindowConstraints.weighty = 1;
2597
- //bigThree.add(jtp, aWindowConstraints);
2598
- aWindowConstraints.weightx = 1;
2599
- aWindowConstraints.gridwidth = 3;
2600
- // aConstraints.gridheight = 3;
2601
- aWindowConstraints.gridx = 1;
2602
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2603
- bigThree.add(cameraPanel, aWindowConstraints);
2604
- aWindowConstraints.weightx = 0;
2605
- aWindowConstraints.gridx = 4;
2606
- aWindowConstraints.gridwidth = 1;
2607
- // aConstraints.gridheight = 3;
2608
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2609
- //bigThree.add(XYZPanel, aWindowConstraints);
2610
- 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();
26112839 } else
2612
- if (event.getSource() == threeButton)
2840
+ if (source == threeButton)
26132841 {
26142842 radio.layout = threeButton;
2615
- bigThree.remove(jtp);
2616
- bigThree.remove(cameraPanel);
2617
- bigThree.remove(XYZPanel);
2618
- aWindowConstraints.gridx = 0;
2619
- aWindowConstraints.gridy = 0;
2620
- aWindowConstraints.gridwidth = 1;
2621
- // aConstraints.gridheight = 3;
2622
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2623
- aWindowConstraints.weightx = 0;
2624
- aWindowConstraints.weighty = 1;
2625
- //bigThree.add(jtp, aWindowConstraints);
2626
- aWindowConstraints.weightx = 1;
2627
- aWindowConstraints.gridwidth = 3;
2628
- // aConstraints.gridheight = 3;
2629
- aWindowConstraints.gridx = 1;
2630
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2631
- bigThree.add(cameraPanel, aWindowConstraints);
2632
- aWindowConstraints.weightx = 0;
2633
- aWindowConstraints.gridx = 4;
2634
- aWindowConstraints.gridwidth = 1;
2635
- // aConstraints.gridheight = 3;
2636
- aConstraints.fill = GridBagConstraints.VERTICAL;
2637
- bigThree.add(XYZPanel, aWindowConstraints);
2638
- 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();
26392875 } else
2640
- if (event.getSource() == fourButton)
2876
+ if (source == fourButton)
26412877 {
26422878 radio.layout = fourButton;
2643
- bigThree.remove(jtp);
2644
- bigThree.remove(cameraPanel);
2645
- bigThree.remove(XYZPanel);
2646
- aWindowConstraints.gridx = 0;
2647
- aWindowConstraints.gridy = 0;
2648
- aWindowConstraints.gridwidth = 1;
2649
- // aWindowConstraints.gridheight = 3;
2650
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2651
- aWindowConstraints.weightx = 1;
2652
- aWindowConstraints.weighty = 1;
2653
- bigThree.add(jtp, aWindowConstraints);
2654
- aWindowConstraints.weightx = 1;
2655
- aWindowConstraints.gridwidth = 3;
2656
- // aConstraints.gridheight = 3;
2657
- aWindowConstraints.gridx = 1;
2658
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2659
- //bigThree.add(cameraPanel, aWindowConstraints);
2660
- aWindowConstraints.weightx = 0;
2661
- aWindowConstraints.gridx = 4;
2662
- aWindowConstraints.gridwidth = 1;
2663
- // aWindowConstraints.gridheight = 3;
2664
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2665
- //bigThree.add(XYZPanel, aWindowConstraints);
2666
- 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();
26672910 } else
2668
- if (event.getSource() == sixButton)
2911
+ if (source == sixButton)
26692912 {
26702913 radio.layout = sixButton;
2671
- bigThree.remove(jtp);
2672
- bigThree.remove(cameraPanel);
2673
- bigThree.remove(XYZPanel);
2674
- aWindowConstraints.gridx = 0;
2675
- aWindowConstraints.gridy = 0;
2676
- aWindowConstraints.gridwidth = 1;
2677
- // aConstraints.gridheight = 3;
2678
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2679
- aWindowConstraints.weightx = 0;
2680
- aWindowConstraints.weighty = 1;
2681
- bigThree.add(jtp, aWindowConstraints);
2682
- aWindowConstraints.weightx = 1;
2683
- aWindowConstraints.gridwidth = 3;
2684
- // aWindowConstraints.gridheight = 3;
2685
- aWindowConstraints.gridx = 1;
2686
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2687
- bigThree.add(cameraPanel, aWindowConstraints);
2688
- aWindowConstraints.weightx = 0;
2689
- aWindowConstraints.gridx = 4;
2690
- aWindowConstraints.gridwidth = 1;
2691
- // aWindowConstraints.gridheight = 3;
2692
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2693
- //bigThree.add(XYZPanel, aConstraints);
2694
- 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();
26952946 } else
2696
- if (event.getSource() == sevenButton)
2947
+ if (source == sevenButton)
26972948 {
26982949 radio.layout = sevenButton;
2699
- bigThree.remove(jtp);
2700
- bigThree.remove(cameraPanel);
2701
- bigThree.remove(XYZPanel);
2702
- aWindowConstraints.gridx = 0;
2703
- aWindowConstraints.gridy = 0;
2704
- aWindowConstraints.gridwidth = 1;
2705
- // aWindowConstraints.gridheight = 3;
2706
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2707
- aWindowConstraints.weightx = 0;
2708
- aWindowConstraints.weighty = 1;
2709
- bigThree.add(jtp, aWindowConstraints);
2710
- aWindowConstraints.weightx = 1;
2711
- aWindowConstraints.gridwidth = 3;
2712
- // aWindowConstraints.gridheight = 3;
2713
- aWindowConstraints.gridx = 1;
2714
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2715
- bigThree.add(cameraPanel, aWindowConstraints);
2716
- aWindowConstraints.weightx = 0;
2717
- aWindowConstraints.gridx = 4;
2718
- aWindowConstraints.gridwidth = 1;
2719
- // aConstraints.gridheight = 3;
2720
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2721
- bigThree.add(XYZPanel, aWindowConstraints);
2722
- 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();
27232983 } else
2724
- if (event.getSource() == rootButton)
2984
+ if (source == rootButton)
27252985 {
27262986 Object3D obj;
27272987 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2733,7 +2993,7 @@
27332993
27342994 refreshContents(true);
27352995 } else
2736
- if (event.getSource() == closeButton)
2996
+ if (source == closeButton)
27372997 {
27382998 //System.out.println("CLOSE: " + buttonGroup.getSelection());
27392999 cRadio ab;
....@@ -2754,11 +3014,11 @@
27543014 }
27553015 refreshContents(true);
27563016 } else
2757
- if (event.getSource() == editItem || event.getSource() == editButton)
3017
+ if (source == editItem || source == editButton)
27583018 {
27593019 EditSelection(false);
27603020 } else
2761
- if (event.getSource() == uneditButton)
3021
+ if (source == uneditButton)
27623022 {
27633023 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
27643024 {
....@@ -2770,12 +3030,12 @@
27703030
27713031 child.editWindow = null; // ???????????
27723032 }
2773
- objEditor.ctrlPanel.revalidate();
3033
+ objEditor.ctrlPanel.FlushUI();
27743034 //objEditor.jTree.clearSelection();
27753035 //objEditor.ResetSliders();
27763036 refreshContents(true);
27773037 } else
2778
- if (event.getSource() == clearPanelButton)
3038
+ if (source == clearPanelButton)
27793039 {
27803040 assert(copy == group);
27813041 //copy.ClearUI();
....@@ -2786,7 +3046,7 @@
27863046 listUI.clear();
27873047 refreshContents(true);
27883048 } else
2789
- if (event.getSource() == allParamsButton)
3049
+ if (source == allParamsButton)
27903050 {
27913051 assert(copy == group);
27923052
....@@ -2807,19 +3067,19 @@
28073067
28083068 refreshContents(true);
28093069 } else
2810
- if (event.getSource() == unselectButton)
3070
+ if (source == unselectButton)
28113071 {
28123072 objEditor.jTree.clearSelection();
28133073 // ?? oct 2012 GrafreeD.clipboard.clear();
28143074 objEditor.ResetSliders();
28153075 refreshContents(true);
28163076 } else
2817
- if(event.getSource() instanceof cRadio)
3077
+ if(source instanceof cRadio)
28183078 {
28193079 group.parent = keepparent;
28203080 group.attributes = 0;
28213081 //group.editWindow = null;
2822
- /*cRadio*/ radio = (cRadio)event.getSource();
3082
+ /*cRadio*/ radio = (cRadio)source;
28233083 Object3D obj = radio.GetObject();
28243084 System.out.println("Edit " + obj);
28253085 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -2839,7 +3099,7 @@
28393099 }
28403100
28413101 copy = group;
2842
- //CameraPane.theRenderer.object = group;
3102
+ //Globals.theRenderer.object = group;
28433103 if(!useclient)
28443104 {
28453105 cameraView.renderCamera = radio.camera;
....@@ -2848,12 +3108,15 @@
28483108 cameraView.cameras[cameraView.cameracount] = radio.camera;
28493109 cameraView.targetLookAt.set(radio.camera.lookAt);
28503110 cameraView.object = group;
2851
- cameraView.lighttouched = true;
3111
+ //cameraView.lighttouched = true;
3112
+ Globals.lighttouched = true;
28523113 topView.object = group;
28533114 frontView.object = group;
28543115 sideView.object = group;
28553116 }
2856
- group.editWindow = this;
3117
+
3118
+// fix "+" issue group.editWindow = this;
3119
+
28573120 /*
28583121 currentLayout = radio.layout;
28593122 if (currentLayout == null)
....@@ -2866,7 +3129,20 @@
28663129 //group.attributes = -1;
28673130 ResetModel();
28683131 refreshContents(true);
2869
- }
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
+ }
28703146 else
28713147 {
28723148 //return super.action(event, arg);
....@@ -2884,7 +3160,7 @@
28843160 if (useclient)
28853161 {
28863162 cameraView.object = client;
2887
- cameraView.lighttouched = true;
3163
+ Globals.lighttouched = true;
28883164 //topView.object = client;
28893165 //frontView.object = client;
28903166 //sideView.object = client;
....@@ -2892,7 +3168,7 @@
28923168 else
28933169 {
28943170 cameraView.object = group;
2895
- cameraView.lighttouched = true;
3171
+ Globals.lighttouched = true;
28963172 //topView.object = group;
28973173 //frontView.object = group;
28983174 //sideView.object = group;
....@@ -2927,6 +3203,28 @@
29273203 refreshContents();
29283204 }
29293205
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
+ }
29303228
29313229 void ResetTransform()
29323230 {
....@@ -3039,7 +3337,7 @@
30393337 refreshContents();
30403338 }
30413339
3042
- void ResetCentroid()
3340
+ void ResetCentroid(boolean full)
30433341 {
30443342 Object3D obj;
30453343 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3054,12 +3352,16 @@
30543352 LA.matIdentity(Object3D.mat);
30553353 obj.getBounds(minima, maxima, false);
30563354 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3057
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3355
+ if (full)
3356
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
30583357 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
30593358 obj.TransformMesh(Object3D.mat);
3359
+
30603360 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3061
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3361
+ if (full)
3362
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
30623363 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3364
+
30633365 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
30643366 //Object3D.mat[3][0] = -Object3D.mat[3][0];
30653367 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3125,9 +3427,9 @@
31253427 obj = (Object3D)e.nextElement();
31263428
31273429 System.out.println("Object is: " + obj);
3128
- GrafreeD.AnalyzeObject(obj);
3430
+ Grafreed.AnalyzeObject(obj);
31293431 System.out.println("Boundary rep: " + obj.bRep);
3130
- GrafreeD.AnalyzeObject(obj.bRep);
3432
+ Grafreed.AnalyzeObject(obj.bRep);
31313433
31323434 // System.err.println((size/1024) + " KB is the size of " + obj);
31333435 }
....@@ -3169,6 +3471,13 @@
31693471 void GenNormals(boolean crease)
31703472 {
31713473 group.GenNormalsS(crease);
3474
+
3475
+ refreshContents();
3476
+ }
3477
+
3478
+ void GenNormalsMINE()
3479
+ {
3480
+ group.selection.GenNormalsMINE();
31723481
31733482 refreshContents();
31743483 }
....@@ -3334,8 +3643,8 @@
33343643
33353644 void ParseVertices()
33363645 {
3337
- boolean epsequal = GrafreeD.epsequal;
3338
- GrafreeD.epsequal = true;
3646
+ boolean epsequal = Grafreed.epsequal;
3647
+ Grafreed.epsequal = true;
33393648
33403649 for (int i=0; i<group.selection.size(); i++)
33413650 {
....@@ -3360,7 +3669,7 @@
33603669 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
33613670 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
33623671
3363
- g.add(GrafreeD.clipboard);
3672
+ g.add(Grafreed.clipboard);
33643673
33653674 buffer.add(g);
33663675 }
....@@ -3375,7 +3684,7 @@
33753684 makeSomething(buffer, i==group.selection.size()-1);
33763685 }
33773686
3378
- GrafreeD.epsequal = epsequal;
3687
+ Grafreed.epsequal = epsequal;
33793688
33803689 refreshContents();
33813690 }
....@@ -3393,7 +3702,16 @@
33933702 String pigment = Object3D.GetPigment(tex);
33943703 //String bump = Object3D.GetBump(tex);
33953704
3396
- 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
+ }
33973715
33983716 double s = v.s;
33993717
....@@ -3441,12 +3759,26 @@
34413759
34423760 void Align()
34433761 {
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
+
34443776 for (int i=0; i<group.selection.size(); i++)
34453777 {
34463778 Object3D obj = group.selection.get(i);
34473779
3448
- LA.matTranslate(obj.toParent, i/2f, 0, 0);
3449
- 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);
34503782 }
34513783
34523784 refreshContents();
....@@ -3467,11 +3799,11 @@
34673799
34683800 SwitchNode sn = new SwitchNode(poses, Object3D.GEOMETRY);
34693801
3470
- boolean random = CameraPane.RANDOM;
3471
- CameraPane.RANDOM = false; // parse all random nodes
3802
+ boolean random = CameraPane.SWITCH;
3803
+ CameraPane.SWITCH = false; // parse all random nodes
34723804 lowres.linkVerticesThis(null);
34733805 lowres.linkVerticesThis(sn);
3474
- CameraPane.RANDOM = random;
3806
+ CameraPane.SWITCH = random;
34753807
34763808 System.err.flush();
34773809
....@@ -3511,7 +3843,7 @@
35113843 return;
35123844
35133845 Object3D poses = group.selection.get(0);
3514
- Object3D ref = GrafreeD.clipboard.get(0);
3846
+ Object3D ref = Grafreed.clipboard.get(0);
35153847
35163848 Object3D newgroup = new Object3D("Po:" + poses.name);
35173849
....@@ -3680,7 +4012,7 @@
36804012 group.selection.RelinkToSupport(); // july 2014
36814013 System.out.println("DONE.");
36824014 refreshContents();
3683
- 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));
36844016 }
36854017
36864018 void ReduceMesh(boolean reduction34)
....@@ -3705,9 +4037,9 @@
37054037
37064038 void ClipMesh()
37074039 {
3708
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
4040
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
37094041 {
3710
- Object3D content = GrafreeD.clipboard.get(0);
4042
+ Object3D content = Grafreed.clipboard.get(0);
37114043
37124044 if (content instanceof cGroup && ((cGroup)content).transientlink )
37134045 content = ((cGroup)content).get(0);
....@@ -3716,7 +4048,7 @@
37164048 // {
37174049 // group.selection.get(i).ClipMesh(GrafreeD.clipboard);
37184050 // }
3719
- group.selection.ClipMesh(GrafreeD.clipboard);
4051
+ group.selection.ClipMesh(Grafreed.clipboard);
37204052 }
37214053 // group.selection.ClipMesh(GrafreeD.clipboard);
37224054 System.out.println("DONE.");
....@@ -3851,7 +4183,7 @@
38514183 objectPanel.setSelectedIndex(objectPanel.indexOfTab("Edit"));
38524184
38534185 Object3D elem = (Object3D)group.selection.elementAt(i);
3854
- if(elem != group)
4186
+ if(elem != group || !newWindow)
38554187 {
38564188 // if (!(elem instanceof Composite))
38574189 // newWindow = false;
....@@ -3956,25 +4288,25 @@
39564288 System.err.println("info : " + child.GetPath());
39574289 }
39584290 }
3959
- else
3960
- {
3961
- objEditor.SetMaterial(group); // .GetMaterial());
3962
- objEditor.AddInfo(group, this, true); // .GetMaterial());
3963
- System.err.println("info : " + group.GetPath());
3964
- }
4291
+// else
4292
+// {
4293
+// objEditor.SetMaterial(group); // .GetMaterial());
4294
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4295
+// System.err.println("info : " + group.GetPath());
4296
+// }
39654297
39664298 objEditor.SetText(); // jan 2014
39674299
3968
- 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))
39694301 CameraPane.flash = true;
39704302
39714303 if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
39724304 // a camera
39734305 {
39744306 CameraPane.camerachangeframe = 0; // don't refuse it
3975
- CameraPane.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
3976
- // CameraPane.theRenderer.renderCamera = CameraPane.theRenderer.manipCamera;
3977
- // 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;
39784310 }
39794311
39804312 refreshContents();
....@@ -4056,12 +4388,12 @@
40564388 {
40574389 if (group.selection.isEmpty())
40584390 return;
4059
- GrafreeD.clipboardIsTempGroup = false;
4391
+ Grafreed.clipboardIsTempGroup = false;
40604392 Composite tGroup = null;
40614393 if (group.selection.size() > 0) // 1)
40624394 {
40634395 tGroup = new cGroup();
4064
- GrafreeD.clipboardIsTempGroup = true;
4396
+ Grafreed.clipboardIsTempGroup = true;
40654397 }
40664398
40674399 if (cut)
....@@ -4101,16 +4433,16 @@
41014433 //System.out.println("cut " + child);
41024434 //System.out.println("parent = " + child.parent);
41034435 // tmp.addChild(child);
4104
- if (GrafreeD.clipboardIsTempGroup)
4436
+ if (Grafreed.clipboardIsTempGroup)
41054437 tGroup.add/*Child*/(tmp);
41064438 else
4107
- GrafreeD.clipboard = tmp;
4439
+ Grafreed.clipboard = tmp;
41084440 }
41094441 else
4110
- if (GrafreeD.clipboardIsTempGroup)
4442
+ if (Grafreed.clipboardIsTempGroup)
41114443 tGroup.add/*Child*/(child);
41124444 else
4113
- GrafreeD.clipboard = child;
4445
+ Grafreed.clipboard = child;
41144446 }
41154447
41164448 //ResetModel();
....@@ -4142,21 +4474,21 @@
41424474 //System.out.println("cut " + elem);
41434475 //System.out.println("parent = " + elem.parent);
41444476 // tmp.addChild(elem);
4145
- if (GrafreeD.clipboardIsTempGroup)
4477
+ if (Grafreed.clipboardIsTempGroup)
41464478 tGroup.add/*Child*/(tmp);
41474479 else
4148
- GrafreeD.clipboard = tmp;
4480
+ Grafreed.clipboard = tmp;
41494481 }
41504482 else
4151
- if (GrafreeD.clipboardIsTempGroup)
4483
+ if (Grafreed.clipboardIsTempGroup)
41524484 tGroup.add/*Child*/(child);
41534485 else
4154
- GrafreeD.clipboard = child;
4486
+ Grafreed.clipboard = child;
41554487 }
41564488
41574489 }
4158
- if (GrafreeD.clipboardIsTempGroup)
4159
- GrafreeD.clipboard = tGroup;
4490
+ if (Grafreed.clipboardIsTempGroup)
4491
+ Grafreed.clipboard = tGroup;
41604492 if (cut)
41614493 {
41624494 ResetModel();
....@@ -4170,7 +4502,7 @@
41704502 // return;
41714503 boolean first = true;
41724504
4173
- if (GrafreeD.clipboardIsTempGroup)
4505
+ if (Grafreed.clipboardIsTempGroup)
41744506 {
41754507 Composite temp;
41764508
....@@ -4181,7 +4513,7 @@
41814513 temp = (Composite)Applet3D.clipboard.deepCopy();
41824514 */
41834515 Object3D elem;
4184
- 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))
41854517 {
41864518 Object3D child = (Object3D)e.nextElement();
41874519
....@@ -4215,21 +4547,21 @@
42154547 //Object3D cb = Applet3D.clipboard;
42164548 //temp.addChild(cb);
42174549 //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0));
4218
- assert(GrafreeD.clipboard.parent == null);
4219
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
4220
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
4221
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
4222
- 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());
42234555 else
4224
- makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4225
- GrafreeD.clipboard.get(0).parent = keepparent;
4556
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
4557
+ Grafreed.clipboard.get(0).parent = keepparent;
42264558 }
42274559
42284560 ResetModel();
42294561 refreshContents();
42304562 }
42314563
4232
- void pasteInto(boolean copyit)
4564
+ void pasteInto(boolean copyit, boolean clone)
42334565 {
42344566 // if (GrafreeD.clipboard == null)
42354567 // return;
....@@ -4258,15 +4590,22 @@
42584590 if (copyit)
42594591 {
42604592 // paste(false);
4261
- CloneClipboard(false); // sept 2014
4593
+ if (clone)
4594
+ {
4595
+ CloneClipboard(false); // sept 2014
4596
+ }
4597
+ else
4598
+ {
4599
+ paste(false);
4600
+ }
42624601 }
42634602 else
42644603 {
42654604 boolean first = true;
42664605
4267
- if (GrafreeD.clipboardIsTempGroup)
4606
+ if (Grafreed.clipboardIsTempGroup)
42684607 {
4269
- Composite temp = (Composite)GrafreeD.clipboard;
4608
+ Composite temp = (Composite)Grafreed.clipboard;
42704609 Object3D copy;
42714610 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
42724611 {
....@@ -4276,7 +4615,7 @@
42764615 }
42774616 } else
42784617 {
4279
- linkSomething(GrafreeD.clipboard); //.get(0));
4618
+ linkSomething(Grafreed.clipboard); //.get(0));
42804619 }
42814620 }
42824621 }
....@@ -4468,6 +4807,26 @@
44684807 makeSomething(csg);
44694808 }
44704809
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
+
44714830 void ungroup()
44724831 {
44734832 /*
....@@ -4661,21 +5020,6 @@
46615020 }
46625021 */
46635022
4664
- void ImportGFD()
4665
- {
4666
- FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD);
4667
- browser.show();
4668
- String filename = browser.getFile();
4669
- if (filename != null && filename.length() > 0)
4670
- {
4671
- String fullname = browser.getDirectory() + filename;
4672
-
4673
- //Object3D readobj =
4674
- objEditor.ReadGFD(fullname, objEditor);
4675
- //makeSomething(readobj);
4676
- }
4677
- }
4678
-
46795023 /*
46805024 public void Callback(Object obj)
46815025 {
....@@ -4699,26 +5043,9 @@
46995043 }
47005044 */
47015045
4702
- void ImportVRMLX3D()
4703
- {
4704
- if (GrafreeD.standAlone)
4705
- {
4706
- /**/
4707
- FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
4708
- browser.show();
4709
- String filename = browser.getFile();
4710
- if (filename != null && filename.length() > 0)
4711
- {
4712
- String fullname = browser.getDirectory() + filename;
4713
- LoadVRMLX3D(fullname);
4714
- }
4715
- /**/
4716
- }
4717
- }
4718
-
47195046 String GetFile(String dialogName)
47205047 {
4721
- if (GrafreeD.standAlone)
5048
+ if (Grafreed.standAlone)
47225049 {
47235050 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
47245051 browser.show();
....@@ -4782,10 +5109,12 @@
47825109 cButton flashSelectionButton;
47835110 cButton editButton;
47845111 cButton uneditButton;
5112
+ JCheckBox allParamsButton;
47855113 cButton clearpanelButton;
4786
- cButton allParamsButton;
47875114 cButton unselectButton;
47885115
5116
+ cButton oneStepButton;
5117
+
47895118 cButton screenfitButton;
47905119 cButton screenfitpointButton;
47915120 cButton snapobjectButton;
....@@ -4827,8 +5156,9 @@
48275156 private MenuItem resetsupportItem;
48285157 private MenuItem resetreferencesItem;
48295158 private MenuItem linkverticesItem;
5159
+ private MenuItem relinkverticesItem;
48305160 private MenuItem setMasterItem;
4831
- private MenuItem resetMeshItem;
5161
+ private MenuItem resetAllItem;
48325162 private MenuItem stepAllItem;
48335163 private MenuItem revertMeshItem;
48345164 private MenuItem poseMeshItem;
....@@ -4839,14 +5169,17 @@
48395169 private MenuItem mergeGeometriesItem;
48405170 private MenuItem copyItem;
48415171 private MenuItem pasteItem;
5172
+ private MenuItem pasteIntoItem;
48425173 private MenuItem pasteLinkItem;
48435174 private MenuItem pasteCloneItem;
48445175 private MenuItem pasteExpandItem;
48455176 private MenuItem clearItem;
48465177 private MenuItem clearAllItem;
48475178 private MenuItem genUVItem;
5179
+ private MenuItem genNormalsMESHItem;
48485180 private MenuItem genNormalsCADItem;
48495181 private MenuItem genNormalsORGANItem;
5182
+ private MenuItem genNormalsMINEItem;
48505183 private MenuItem stripifyItem;
48515184 private MenuItem unstripifyItem;
48525185 private MenuItem trimItem;
....@@ -4886,8 +5219,11 @@
48865219 private MenuItem panoTexturesItem;
48875220
48885221 private MenuItem resetCentroidItem;
4889
- private MenuItem transformgeometryItem;
5222
+ private MenuItem resetCentroidXZItem;
48905223 private MenuItem resetTransformItem;
5224
+ private MenuItem transformGeometryItem;
5225
+ private MenuItem transformChildrenItem;
5226
+ private MenuItem hideItem;
48915227 private MenuItem grabItem;
48925228 private MenuItem backItem;
48935229 private MenuItem frontItem;
....@@ -4908,6 +5244,7 @@
49085244
49095245 private MenuItem resetParentItem;
49105246 private MenuItem repairParentItem;
5247
+ private MenuItem repairShadowItem;
49115248 private MenuItem sortbysizeItem;
49125249 private MenuItem sortbynameItem;
49135250
....@@ -4928,10 +5265,11 @@
49285265 private MenuItem coneItem;
49295266 private MenuItem torusItem;
49305267 private MenuItem superItem;
5268
+ private MenuItem kleinItem;
49315269 private MenuItem blobItem;
49325270 private MenuItem latheItem;
49335271 private MenuItem bezierItem;
4934
- private MenuItem checkerItem;
5272
+ private MenuItem overlayItem;
49355273 private MenuItem meshItem;
49365274 // private MenuItem meshGroupItem;
49375275 private MenuItem springItem;
....@@ -4940,6 +5278,7 @@
49405278 private MenuItem csgItem;
49415279 private MenuItem templateItem;
49425280 private MenuItem textureItem;
5281
+ private MenuItem billboardItem;
49435282 private MenuItem shadowXItem;
49445283 private MenuItem shadowYItem;
49455284 private MenuItem shadowZItem;
....@@ -4952,11 +5291,6 @@
49525291 private MenuItem doubleItem;
49535292 private MenuItem tripleItem;
49545293
4955
- private MenuItem importGFDItem;
4956
- private MenuItem importVRMLX3DItem;
4957
- private MenuItem import3DSItem;
4958
- private MenuItem importOBJItem;
4959
-
49605294 private MenuItem computeAOItem;
49615295 private MenuItem recompileItem;
49625296 private MenuItem editScriptItem;
....@@ -4966,4 +5300,8 @@
49665300 private MenuItem analyzeItem;
49675301 private MenuItem dumpItem;
49685302 //boolean freezemodel = false;
5303
+
5304
+ Menu cameraMenu;
5305
+ MenuItem editCameraItem;
5306
+ MenuItem revertCameraItem;
49695307 }