Normand Briere
2019-05-01 a742f6cebf1d471217d836e07934e5c02c22b6db
GroupEditor.java
....@@ -12,9 +12,10 @@
1212 import com.jme.math.Vector3f;
1313 import com.jme.renderer.ColorRGBA;
1414
15
+import grafeme.ui.*;
1516 //import buoy.widget.BFileChooser;
1617
17
-class GroupEditor extends ObjEditor implements iParse, //iCallBack,
18
+class GroupEditor extends ObjEditor implements //iParse, //iCallBack,
1819 ObjectUI,
1920 Runnable,
2021 ActionListener,
....@@ -83,7 +84,7 @@
8384
8485 void CloneSelection(boolean supports)
8586 {
86
- // Object3D keep = GraphreeD.clipboard;
87
+ // Object3D keep = GrafreeD.clipboard;
8788 //Object3D obj;
8889 for (int i=0; i<group.selection.size(); i++)// Enumeration e = group.selection.elements(); e.hasMoreElements();)
8990 {
....@@ -97,14 +98,14 @@
9798
9899 void CloneClipboard(boolean supports)
99100 {
100
- assert(GraphreeD.clipboard.parent == null);
101
- Object3D /*Composite*/ keepparent = GraphreeD.clipboard.get(0).parent;
102
- GraphreeD.clipboard.get(0).parent = null; // Avoid copy?
103
- if (LA.isIdentity(GraphreeD.clipboard.toParent))
104
- makeSomething(CloneObject(GraphreeD.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(GraphreeD.clipboard, false));
107
- GraphreeD.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)GraphreeD.clone(obj);
122
+ Object3D clone = (Object3D)GrafreeD.clone(obj);
122123 obj.parent = parent;
123124 // obj.support = support;
124125 // clone.support = support; // aout 2013
....@@ -188,8 +189,9 @@
188189 clearItem.addActionListener(this);
189190 clearAllItem = menu.add(new MenuItem("Clear All"));
190191 clearAllItem.addActionListener(this);
191
- menu.add("-");
192
- resetMeshItem = menu.add(new MenuItem("Reset All"));
192
+
193
+ oe.menuBar.add(menu = new Menu("Setting"));
194
+ resetMeshItem = menu.add(new MenuItem("Reset All"));
193195 resetMeshItem.addActionListener(this);
194196 stepAllItem = menu.add(new MenuItem("Step All"));
195197 stepAllItem.addActionListener(this);
....@@ -218,38 +220,47 @@
218220 resetsupportItem.addActionListener(this);
219221 linkverticesItem = menu.add(new MenuItem("Link to Support"));
220222 linkverticesItem.addActionListener(this);
223
+ relinkverticesItem = menu.add(new MenuItem("Re-link to Support"));
224
+ relinkverticesItem.addActionListener(this);
221225 setMasterItem = menu.add(new MenuItem("Set Master Mesh"));
222226 setMasterItem.addActionListener(this);
223227
224
- oe.menuBar.add(menu = new Menu("Object"));
228
+ oe.menuBar.add(menu = new Menu("Group"));
225229 grabItem = menu.add(new MenuItem("Grab"));
226230 grabItem.addActionListener(this);
227
- frontItem = menu.add(new MenuItem("Front"));
228
- frontItem.addActionListener(this);
229231 backItem = menu.add(new MenuItem("Back"));
230232 backItem.addActionListener(this);
233
+ frontItem = menu.add(new MenuItem("Front"));
234
+ frontItem.addActionListener(this);
231235 compositeItem = menu.add(new MenuItem("Composite"));
232236 compositeItem.addActionListener(this);
237
+ hideItem = menu.add(new MenuItem("Hide"));
238
+ hideItem.addActionListener(this);
239
+ ungroupItem = menu.add(new MenuItem("Ungroup"));
240
+ ungroupItem.addActionListener(this);
233241 menu.add("-");
234
- randomItem = menu.add(new MenuItem("Random"));
242
+ randomItem = menu.add(new MenuItem("Switch node"));
235243 randomItem.addActionListener(this);
236
- physicsItem = menu.add(new MenuItem("Physics"));
237
- physicsItem.addActionListener(this);
238
- frameselectorItem = menu.add(new MenuItem("Frame Selector"));
239
- frameselectorItem.addActionListener(this);
240244 switchGeoItem = menu.add(new MenuItem("Switch Geometry"));
241245 switchGeoItem.addActionListener(this);
242246 switchTransfoItem = menu.add(new MenuItem("Switch Transform"));
243247 switchTransfoItem.addActionListener(this);
248
+ physicsItem = menu.add(new MenuItem("Physics"));
249
+ physicsItem.addActionListener(this);
250
+ frameselectorItem = menu.add(new MenuItem("Frame Selector"));
251
+ frameselectorItem.addActionListener(this);
244252 morphItem = menu.add(new MenuItem("Morph"));
245253 morphItem.addActionListener(this);
246254 scriptNodeItem = menu.add(new MenuItem("Script Node"));
247255 scriptNodeItem.addActionListener(this);
248256 cameraItem = menu.add(new MenuItem("Camera"));
249257 cameraItem.addActionListener(this);
250
- menu.add("-");
258
+
259
+ oe.menuBar.add(menu = new Menu("Object"));
251260 textureItem = menu.add(new MenuItem("Texture"));
252261 textureItem.addActionListener(this);
262
+ billboardItem = menu.add(new MenuItem("Billboard"));
263
+ billboardItem.addActionListener(this);
253264 csgItem = menu.add(new MenuItem("CSG"));
254265 csgItem.addActionListener(this);
255266 shadowXItem = menu.add(new MenuItem("Shadow X"));
....@@ -267,14 +278,12 @@
267278 pointflowItem = menu.add(new MenuItem("Point Flow"));
268279 pointflowItem.addActionListener(this);
269280 menu.add("-");
270
- transformgeometryItem = menu.add(new MenuItem("Transform Geometry"));
271
- transformgeometryItem.addActionListener(this);
272281 resetTransformItem = menu.add(new MenuItem("Reset Transform"));
273282 resetTransformItem.addActionListener(this);
274283 resetCentroidItem = menu.add(new MenuItem("Reset Centroid"));
275284 resetCentroidItem.addActionListener(this);
276
- ungroupItem = menu.add(new MenuItem("Ungroup"));
277
- ungroupItem.addActionListener(this);
285
+ transformgeometryItem = menu.add(new MenuItem("Transform Geometry"));
286
+ transformgeometryItem.addActionListener(this);
278287
279288 oe.menuBar.add(menu = new Menu("Geometry"));
280289 genUVItem = menu.add(new MenuItem("Generate UV"));
....@@ -283,6 +292,10 @@
283292 genNormalsORGANItem.addActionListener(this);
284293 genNormalsCADItem = menu.add(new MenuItem("CAD Normals"));
285294 genNormalsCADItem.addActionListener(this);
295
+ genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals"));
296
+ genNormalsMESHItem.addActionListener(this);
297
+ genNormalsMINEItem = menu.add(new MenuItem("My Normals"));
298
+ genNormalsMINEItem.addActionListener(this);
286299 stripifyItem = menu.add(new MenuItem("Stripify"));
287300 stripifyItem.addActionListener(this);
288301 unstripifyItem = menu.add(new MenuItem("Unstripify"));
....@@ -292,8 +305,6 @@
292305 untrimItem = menu.add(new MenuItem("Untrim"));
293306 untrimItem.addActionListener(this);
294307 menu.add("-");
295
- clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
296
- clearMaterialsItem.addActionListener(this);
297308 clearColorsItem = menu.add(new MenuItem("Clear AO"));
298309 clearColorsItem.addActionListener(this);
299310 reverseNormalsItem = menu.add(new MenuItem("Reverse Normals"));
....@@ -310,6 +321,10 @@
310321 smoothMeshItem.addActionListener(this);
311322 clipMeshItem = menu.add(new MenuItem("Clip mesh"));
312323 clipMeshItem.addActionListener(this);
324
+
325
+ oe.menuBar.add(menu = new Menu("Attributes"));
326
+ clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
327
+ clearMaterialsItem.addActionListener(this);
313328 menu.add("-");
314329 liveleavesItem = menu.add(new MenuItem("Live Leaves"));
315330 liveleavesItem.addActionListener(this);
....@@ -332,27 +347,18 @@
332347 flipVItem.addActionListener(this);
333348 unflipVItem = menu.add(new MenuItem("Unflip V"));
334349 unflipVItem.addActionListener(this);
335
- lowTexturesItem = menu.add(new MenuItem("Low Texture"));
350
+ lowTexturesItem = menu.add(new MenuItem("Low Texture (256)"));
336351 lowTexturesItem.addActionListener(this);
337
- normalTexturesItem = menu.add(new MenuItem("Normal Texture"));
352
+ normalTexturesItem = menu.add(new MenuItem("Normal Texture (512)"));
338353 normalTexturesItem.addActionListener(this);
339
- highTexturesItem = menu.add(new MenuItem("High Texture"));
354
+ highTexturesItem = menu.add(new MenuItem("High Texture (1024)"));
340355 highTexturesItem.addActionListener(this);
341
- veryhighTexturesItem = menu.add(new MenuItem("Very high Texture"));
356
+ veryhighTexturesItem = menu.add(new MenuItem("Very high Texture (2048)"));
342357 veryhighTexturesItem.addActionListener(this);
343
- maxTexturesItem = menu.add(new MenuItem("Max Texture"));
358
+ maxTexturesItem = menu.add(new MenuItem("Max Texture (4096)"));
344359 maxTexturesItem.addActionListener(this);
345
- panoTexturesItem = menu.add(new MenuItem("Panoramic Texture"));
360
+ panoTexturesItem = menu.add(new MenuItem("Panoramic Texture (8192)"));
346361 panoTexturesItem.addActionListener(this);
347
- menu.add("-");
348
- extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
349
- extractGeometriesItem.addActionListener(this);
350
- cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry"));
351
- cloneGeometriesItem.addActionListener(this);
352
- shareGeometriesItem = menu.add(new MenuItem("Share Geometry"));
353
- shareGeometriesItem.addActionListener(this);
354
- mergeGeometriesItem = menu.add(new MenuItem("Merge Geometry"));
355
- mergeGeometriesItem.addActionListener(this);
356362
357363 oe.menuBar.add(menu = new Menu("Selection"));
358364 attachPigmentItem = menu.add(new MenuItem("Attach Pigment..."));
....@@ -370,9 +376,31 @@
370376 sortbysizeItem.addActionListener(this);
371377 sortbynameItem = menu.add(new MenuItem("Sort by name"));
372378 sortbynameItem.addActionListener(this);
379
+ menu.add("-");
380
+ extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
381
+ extractGeometriesItem.addActionListener(this);
382
+ cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry"));
383
+ cloneGeometriesItem.addActionListener(this);
384
+ shareGeometriesItem = menu.add(new MenuItem("Share Geometry"));
385
+ shareGeometriesItem.addActionListener(this);
386
+ mergeGeometriesItem = menu.add(new MenuItem("Merge Geometry"));
387
+ mergeGeometriesItem.addActionListener(this);
388
+
373389 oe.menuBar.add(menu = new Menu("Insert"));
374390 buildCreateMenu(menu);
375
- oe.menuBar.add(menu = new Menu("Tools"));
391
+
392
+
393
+ oe.menuBar.add(menu = new Menu("Include"));
394
+ importGFDItem = menu.add(new MenuItem("GrafreeD Object..."));
395
+ importGFDItem.addActionListener(this);
396
+ importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D Object..."));
397
+ importVRMLX3DItem.addActionListener(this);
398
+ importOBJItem = menu.add(new MenuItem("OBJ Object..."));
399
+ importOBJItem.addActionListener(this);
400
+ import3DSItem = menu.add(new MenuItem("3DS Object..."));
401
+ import3DSItem.addActionListener(this);
402
+
403
+ oe.menuBar.add(menu = new Menu("Tools"));
376404 buildToolsMenu(menu);
377405 }
378406
....@@ -406,150 +434,94 @@
406434 oe.radioPanel.add(dummyButton);
407435 oe.buttonGroup.add(dummyButton);
408436 */
409
- aConstraints.gridy += 1;
410
- oe.aConstraints.gridwidth = 1;
411
- oe.aConstraints.gridx = 0;
437
+ //this.AddOptions(oe.toolbarPanel, oe.aConstraints);
412438
413
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", CameraPane.isLIVE()), oe.aConstraints);
439
+ oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE())); //, oe.aConstraints);
440
+ liveCB.setToolTipText("Enabled animation");
414441 liveCB.addItemListener(this);
415442
416
- oe.aConstraints.gridx += 1;
417
- oe.toolbarPanel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT), oe.aConstraints);
418
- supportCB.addItemListener(this);
419
-
420
- // oe.aConstraints.gridx += 1;
421
- // oe.toolbarPanel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), oe.aConstraints);
422
- // localCB.addItemListener(this);
423
-
424
- oe.aConstraints.gridx += 1;
425
- oe.toolbarPanel.add(crowdCB = new cCheckBox("Crowd", CameraPane.CROWD), oe.aConstraints);
426
- crowdCB.addItemListener(this);
427
-
428
- oe.aConstraints.gridx += 1;
429
- oe.toolbarPanel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA), oe.aConstraints);
430
- smoothCB.addItemListener(this);
431
-
432
- oe.aConstraints.gridx += 1;
433
- oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST), oe.aConstraints);
443
+ oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST)); //, constraints);
444
+ fastCB.setToolTipText("Fast mode");
434445 fastCB.addItemListener(this);
435
- oe.aConstraints.gridx += 1;
436
- oe.toolbarPanel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE), oe.aConstraints);
437
- slowCB.addItemListener(this);
438
- oe.aConstraints.gridx += 1;
439
- oe.toolbarPanel.add(boxCB = new cCheckBox("Box", CameraPane.FAST), oe.aConstraints);
440
- boxCB.addItemListener(this);
441
-
442
-// oe.aConstraints.gridx += 1;
443
-// oe.toolbarPanel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), oe.aConstraints);
444
-// speakerMocapCB.addItemListener(this);
445
-
446
- if (false)
447
- {
448
- // handled in scripts
449
- oe.aConstraints.gridx += 1;
450
- oe.toolbarPanel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA), oe.aConstraints);
451
- speakerCameraCB.addItemListener(this);
452
-
453
- oe.aConstraints.gridx += 1;
454
- oe.toolbarPanel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS), oe.aConstraints);
455
- speakerFocusCB.addItemListener(this);
456
-
457
- oe.aConstraints.gridx += 1;
458
- oe.toolbarPanel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS), oe.aConstraints);
459
- smoothfocusCB.addItemListener(this);
460
- }
461
-
462
-//oe.aConstraints.gridx += 1;
463
-//oe.toolbarPanel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), oe.aConstraints);
464
-// debugCB.addItemListener(this);
465
-
466
- oe.aConstraints.gridx += 1;
467
- oe.toolbarPanel.add(oeilCB = new cCheckBox("O", CameraPane.OEIL), oe.aConstraints);
468
- oeilCB.addItemListener(this);
469
-
470
- oe.aConstraints.gridx += 1;
471
- oe.toolbarPanel.add(lookAtCB = new cCheckBox("T", CameraPane.LOOKAT), oe.aConstraints);
472
- lookAtCB.addItemListener(this);
473
-
474
- oe.aConstraints.gridx += 1;
475
- oe.toolbarPanel.add(trackCB = new cCheckBox(":", CameraPane.TRACK), oe.aConstraints);
446
+
447
+ oe.toolbarPanel.add(trackCB = new cCheckBox("Track", CameraPane.TRACK)); //, oe.aConstraints);
448
+ trackCB.setToolTipText("Enable tracking");
476449 trackCB.addItemListener(this);
477450
478
- oe.aConstraints.gridx += 1;
479
- oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
451
+ oe.toolbarPanel.add(screenfitButton = new cButton("@", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
452
+ screenfitButton.setToolTipText("Screen fit");
480453 screenfitButton.addActionListener(this);
481
- oe.aConstraints.gridx += 1;
454
+
482455 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
483456 // screenfitpointButton.addActionListener(this);
484
-// oe.aConstraints.gridx += 1;
485
- oe.toolbarPanel.add(snapobjectButton = new cButton(" O+ ")); //, oe.aConstraints);
486
- snapobjectButton.addActionListener(this);
487
- oe.aConstraints.gridx += 1;
488457
489
- //aConstraints.gridx = 0;
490
- //aConstraints.gridy += 1;
491
- oe.aConstraints.weighty = 0;
492
- oe.aConstraints.gridwidth = 1;
493
-
494
- oe.toolbarPanel.add(flashSelectionButton = new cButton(" ? ")); //, oe.aConstraints);
458
+ if (Globals.ADVANCED)
459
+ {
460
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
461
+ snapobjectButton.addActionListener(this);
462
+ snapobjectButton.setToolTipText("Snap Object");
463
+ }
464
+
465
+ oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
466
+ flashSelectionButton.setToolTipText("Show selection");
495467 flashSelectionButton.addActionListener(this);
496
- oe.aConstraints.gridx += 1;
497
- oe.aConstraints.weighty = 0;
498
- oe.aConstraints.gridwidth = 1;
499468
500
- //
501
- oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints);
469
+ oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
470
+
471
+ oe.toolbarPanel.add(twoButton = new cButton("|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
472
+ twoButton.setToolTipText("Show center view only");
502473 twoButton.addActionListener(this);
503
- oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
474
+ oe.toolbarPanel.add(fourButton = new cButton("+||", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
504475 fourButton.addActionListener(this);
505
- oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
476
+ fourButton.setToolTipText("Show left panel only");
477
+ oe.toolbarPanel.add(sixButton = new cButton("+|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
478
+ sixButton.setToolTipText("2-column layout left");
506479 sixButton.addActionListener(this);
507
- oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
480
+ oe.toolbarPanel.add(threeButton = new cButton("|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
481
+ threeButton.setToolTipText("2-column layout right");
508482 threeButton.addActionListener(this);
509
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
483
+ oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
484
+ sevenButton.setToolTipText("3-column layout");
510485 sevenButton.addActionListener(this);
511486 //
512487
513
- oe.toolbarPanel.add(rootButton = new cButton(" o o o E ")); //, oe.aConstraints);
488
+ oe.toolbarPanel.add(rootButton = new cButton("o o o", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
489
+ rootButton.setToolTipText("Edit selection in new tab");
514490 rootButton.addActionListener(this);
515
- oe.aConstraints.gridx += 1;
516
- oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
491
+
492
+ oe.toolbarPanel.add(closeButton = new cButton("X", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
493
+ closeButton.setToolTipText("Close tab");
517494 closeButton.addActionListener(this);
518495 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
519496 //clearButton.addActionListener(this);
520
- oe.aConstraints.gridx += 1;
521497
522
- oe.aConstraints.gridx = 1; //
523
- oe.treePanel.add(editButton = new cButton("+"), oe.aConstraints);
498
+ cGridBag commandsPanel = new cGridBag();
499
+
500
+ commandsPanel.add(editButton = new cButton("+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
501
+ editButton.setToolTipText("Edit selection");
524502 editButton.addActionListener(this);
525
- oe.aConstraints.gridx += 1;
526
- oe.aConstraints.weighty = 0;
527
- oe.aConstraints.gridwidth = 1;
528503
529
- oe.treePanel.add(uneditButton = new cButton("-"), oe.aConstraints);
504
+ commandsPanel.add(uneditButton = new cButton("-", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
505
+ uneditButton.setToolTipText("Unedit selection");
530506 uneditButton.addActionListener(this);
531507
532
- oe.aConstraints.gridx += 1;
533
- oe.aConstraints.weighty = 0;
534
- oe.aConstraints.gridwidth = 1;
535
-
536
- oe.treePanel.add(clearPanelButton = new cButton("C"), oe.aConstraints);
508
+ commandsPanel.add(clearPanelButton = new cButton("C", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
509
+ clearPanelButton.setToolTipText("Clear edit panel");
537510 clearPanelButton.addActionListener(this);
538511
539
- oe.aConstraints.gridx += 1;
540
- oe.aConstraints.weighty = 0;
541
- oe.aConstraints.gridwidth = 1;
542
-
543
- oe.treePanel.add(allParamsButton = new cButton("A"), oe.aConstraints);
512
+ commandsPanel.add(allParamsButton = new cButton("A", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
513
+ allParamsButton.setToolTipText("All params??");
544514 allParamsButton.addActionListener(this);
545515
546
- oe.aConstraints.gridx += 1;
547
- oe.aConstraints.weighty = 0;
548
- oe.aConstraints.gridwidth = 1;
549
-
550
- oe.treePanel.add(unselectButton = new cButton("U"), oe.aConstraints);
516
+ commandsPanel.add(unselectButton = new cButton("U", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
517
+ unselectButton.setToolTipText("Unselect");
551518 unselectButton.addActionListener(this);
552519
520
+ commandsPanel.preferredHeight = 1;
521
+
522
+ oe.treePanel.add(commandsPanel);
523
+ oe.treePanel.Return();
524
+
553525 // oe.aConstraints.gridx += 1;
554526 // oe.aConstraints.weighty = 0;
555527 // oe.aConstraints.gridwidth = 1;
....@@ -561,40 +533,37 @@
561533 // oe.treePanel.add(gcButton = new cButton("GC"), oe.aConstraints);
562534 // gcButton.addActionListener(this);
563535
564
- oe.aConstraints.gridx = 0;
565
- oe.aConstraints.gridy += 1;
566
-
567
- //ctrlPanel.add(objList = new List(5, true));
568
- oe.aConstraints.gridwidth = 100;
569
- // oe.aConstraints.gridheight = 100;
570
- oe.aConstraints.fill = GridBagConstraints.BOTH; // HORIZONTAL;
571
- oe.aConstraints.gridheight = 1;
572
- oe.aConstraints.weighty = 0.5;
573
- oe.aConstraints.gridx = 0;
574
- JScrollPane jSP;
536
+ cGridBag jSPPanel = new cGridBag();
537
+
538
+ JScrollPane jSP;
575539 //ctrlPanel.add(new JScrollPane(jTree = new cTree(new cTreeModel(this))), aConstraints);
576
- oe.treePanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null)), oe.aConstraints);
540
+ jSPPanel.add(jSP = new JScrollPane(oe.jTree = new cTree(null))); //, oe.aConstraints);
577541 ResetModel();
578
- oe.aConstraints.weighty = 0.5;
579
- oe.aConstraints.fill = GridBagConstraints.HORIZONTAL;
580
- oe.aConstraints.gridy += 1;
581
- oe.aConstraints.gridwidth = 1;
542
+
543
+ oe.treePanel.add(jSPPanel);
544
+ oe.treePanel.Return();
582545
583
- oe.aConstraints.weighty = 0;
584
- oe.aConstraints.gridwidth = 2;
585
-
586
- oe.treePanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0), oe.aConstraints);
546
+ cGridBag copyOptionsPanel = new cGridBag();
547
+
548
+ copyOptionsPanel.add(colorCB = new cCheckBox("Color", (dropAttributes&Object3D.COLOR)!=0)); //, oe.aConstraints);
549
+ colorCB.setToolTipText("Copy color when dropped");
587550 colorCB.addItemListener(this);
588
- oe.aConstraints.gridx += 2;
589
- oe.treePanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0), oe.aConstraints);
551
+
552
+ copyOptionsPanel.add(materialCB = new cCheckBox("Material", (dropAttributes&Object3D.MATERIAL)!=0)); //, oe.aConstraints);
553
+ materialCB.setToolTipText("Copy material when dropped");
590554 materialCB.addItemListener(this);
591
- oe.aConstraints.gridx += 2;
592
- oe.treePanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0), oe.aConstraints);
555
+
556
+ copyOptionsPanel.add(textureCB = new cCheckBox("Texture", (dropAttributes&Object3D.TEXTURE)!=0)); //, oe.aConstraints);
557
+ textureCB.setToolTipText("Copy texture when dropped");
593558 textureCB.addItemListener(this);
594559
595
- oe.aConstraints.gridx = 0;
596
- oe.aConstraints.gridy += 1;
560
+ copyOptionsPanel.preferredHeight = 1;
561
+ oe.treePanel.add(copyOptionsPanel);
562
+ oe.treePanel.Return();
597563
564
+// mainPanel.setDividerLocation(0.5); //1.0);
565
+// mainPanel.setResizeWeight(0.5);
566
+
598567 //jList.addListSelectionListener(this);
599568 oe.jTree.addTreeSelectionListener(this);
600569 //jTree.setRootVisible(false);
....@@ -616,17 +585,85 @@
616585 radio.layout = sevenButton;
617586 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
618587 }
588
+
589
+ void AddOptions(cGridBag panel) //, GridBagConstraints constraints)
590
+ {
591
+ panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
592
+ supportCB.setToolTipText("Enabled rigging");
593
+ supportCB.addItemListener(this);
594
+
595
+ // panel.add(localCB = new cCheckBox("Local", CameraPane.LOCALTRANSFORM), constraints);
596
+ // localCB.addItemListener(this);
597
+
598
+ panel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD)); //, constraints);
599
+ crowdCB.setToolTipText("Used for crowds");
600
+ crowdCB.addItemListener(this);
601
+
602
+ panel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA)); //, constraints);
603
+ smoothCB.setToolTipText("Snapping delay");
604
+ smoothCB.addItemListener(this);
605
+
606
+ panel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE)); //, constraints);
607
+ slowCB.setToolTipText("Smooth interpolation");
608
+ slowCB.addItemListener(this);
609
+
610
+ panel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE)); //, constraints);
611
+ boxCB.setToolTipText("Display bounding boxes");
612
+ boxCB.addItemListener(this);
613
+
614
+ panel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE)); //, constraints);
615
+ zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
616
+ zoomBoxCB.addItemListener(this);
617
+
618
+// constraints.gridy += 1;
619
+// panel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), constraints);
620
+// speakerMocapCB.addItemListener(this);
621
+
622
+ if (false)
623
+ {
624
+ // handled in scripts
625
+ //constraints.gridy += 1;
626
+ panel.add(speakerCameraCB = new cCheckBox("Cam", CameraPane.SPEAKERCAMERA)); //, constraints);
627
+ speakerCameraCB.addItemListener(this);
628
+
629
+ //constraints.gridy += 1;
630
+ panel.add(speakerFocusCB = new cCheckBox("Focus", CameraPane.SPEAKERFOCUS)); //, constraints);
631
+ speakerFocusCB.addItemListener(this);
632
+
633
+ //constraints.gridy += 1;
634
+ panel.add(smoothfocusCB = new cCheckBox("Smooth", CameraPane.SMOOTHFOCUS)); //, constraints);
635
+ smoothfocusCB.addItemListener(this);
636
+ }
637
+
638
+//constraints.gridx += 1;
639
+//panel.add(debugCB = new cCheckBox("Debug", CameraPane.DEBUG), constraints);
640
+// debugCB.addItemListener(this);
641
+
642
+ panel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL)); //, constraints);
643
+ oeilCB.addItemListener(this);
644
+
645
+ panel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT)); //, constraints);
646
+ lookAtCB.setToolTipText("Look-at target");
647
+ lookAtCB.addItemListener(this);
648
+
649
+ cGridBag fill = new cGridBag();
650
+
651
+ fill.preferredHeight = 200;
652
+
653
+ panel.add(fill);
654
+
655
+ }
619656
620657 void EditObject(Object3D obj)
621658 {
622
- cRadio dummyButton = new cRadio(obj.name);
623
- dummyButton.SetObject(obj);
624
- dummyButton.layout = sevenButton;
625
- dummyButton.SetCamera(cameraView.renderCamera, false);
626
- dummyButton.addActionListener(this);
627
- radioPanel.add(dummyButton);
628
- buttonGroup.add(dummyButton);
629
- dummyButton.doClick();
659
+ cRadio radioButton = new cRadio(obj.name);
660
+ radioButton.SetObject(obj);
661
+ radioButton.layout = sevenButton;
662
+ radioButton.SetCamera(cameraView.renderCamera, false);
663
+ radioButton.addActionListener(this);
664
+ radioPanel.add(radioButton);
665
+ buttonGroup.add(radioButton);
666
+ radioButton.doClick();
630667 }
631668 void SetupViews(ObjEditor oe)
632669 {
....@@ -646,6 +683,7 @@
646683 JCheckBox fastCB;
647684 JCheckBox slowCB;
648685 JCheckBox boxCB;
686
+ JCheckBox zoomBoxCB;
649687 JCheckBox trackCB;
650688 JCheckBox smoothfocusCB;
651689 // JCheckBox speakerMocapCB;
....@@ -688,8 +726,7 @@
688726 dropAttributes |= Object3D.TEXTURE;
689727 else
690728 dropAttributes &= ~Object3D.TEXTURE;
691
- }
692
- else if(e.getSource() == liveCB)
729
+ } else if(e.getSource() == liveCB)
693730 {
694731 cameraView.ToggleLive();
695732 }
....@@ -726,6 +763,10 @@
726763 Recompile();
727764 cameraView.repaint();
728765 // refreshContents();
766
+ }
767
+ else if(e.getSource() == zoomBoxCB)
768
+ {
769
+ cameraView.ToggleZoomBoxMode();
729770 }
730771 else if(e.getSource() == smoothfocusCB)
731772 {
....@@ -1002,6 +1043,8 @@
10021043
10031044 void buildCreateMenu(Menu menu)
10041045 {
1046
+ //heightFieldItem = menu.add(new MenuItem("Height Field"));
1047
+ //heightFieldItem.addActionListener(this);
10051048 gridItem = menu.add(new MenuItem("Grid"));
10061049 gridItem.addActionListener(this);
10071050 rectoidItem = menu.add(new MenuItem("Box"));
....@@ -1014,6 +1057,8 @@
10141057 torusItem.addActionListener(this);
10151058 superItem = menu.add(new MenuItem("Superellipsoid"));
10161059 superItem.addActionListener(this);
1060
+ kleinItem = menu.add(new MenuItem("Klein Bottle"));
1061
+ kleinItem.addActionListener(this);
10171062 particleItem = menu.add(new MenuItem("Particle system"));
10181063 particleItem.addActionListener(this);
10191064 ragdollItem = menu.add(new MenuItem("Rag Walk"));
....@@ -1048,26 +1093,19 @@
10481093 doubleItem.addActionListener(this);
10491094 tripleItem = menu.add(new MenuItem("Trident"));
10501095 tripleItem.addActionListener(this);
1051
- menu.add("-");
1052
- importGFDItem = menu.add(new MenuItem("GraphreeD Object..."));
1053
- importGFDItem.addActionListener(this);
1054
- importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D Object..."));
1055
- importVRMLX3DItem.addActionListener(this);
1056
- importOBJItem = menu.add(new MenuItem("OBJ Object..."));
1057
- importOBJItem.addActionListener(this);
1058
- import3DSItem = menu.add(new MenuItem("3DS Object..."));
1059
- import3DSItem.addActionListener(this);
10601096 }
10611097
10621098 void buildToolsMenu(Menu menu)
10631099 {
10641100 menu.add(animationItem = new CheckboxMenuItem("Animation..."));
10651101 animationItem.addItemListener(this);
1066
- animationItem.setState(CameraPane.ANIMATION);
1102
+ animationItem.setState(Globals.ANIMATION);
10671103
10681104 menu.add("-");
10691105 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
10701106 parseverticesItem.addActionListener(this);
1107
+ textureFieldItem = menu.add(new MenuItem("Texture Field"));
1108
+ textureFieldItem.addActionListener(this);
10711109 alignItem = menu.add(new MenuItem("Align"));
10721110 alignItem.addActionListener(this);
10731111 mirrorItem = menu.add(new MenuItem("Mirror Poses"));
....@@ -1094,6 +1132,8 @@
10941132 resetParentItem.addActionListener(this);
10951133 repairParentItem = menu.add(new MenuItem("Repair Parent"));
10961134 repairParentItem.addActionListener(this);
1135
+ repairShadowItem = menu.add(new MenuItem("Repair Shadow"));
1136
+ repairShadowItem.addActionListener(this);
10971137 menu.add(invariantsItem = new MenuItem("Invariants"));
10981138 invariantsItem.addActionListener(this);
10991139 menu.add(recompileItem = new MenuItem("Recompile"));
....@@ -1429,9 +1469,9 @@
14291469
14301470 void Overwrite(int mask)
14311471 {
1432
- if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
1472
+ if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
14331473 {
1434
- Object3D content = GraphreeD.clipboard.get(0);
1474
+ Object3D content = GrafreeD.clipboard.get(0);
14351475
14361476 if (content instanceof cGroup && ((cGroup)content).transientlink )
14371477 content = ((cGroup)content).get(0);
....@@ -1454,6 +1494,7 @@
14541494 //
14551495 public void actionPerformed(ActionEvent event) // , Object arg)
14561496 {
1497
+ Object source = event.getSource();
14571498 /*
14581499 if (event.getSource() == nameField)
14591500 {
....@@ -1465,11 +1506,11 @@
14651506 }
14661507 else
14671508 */
1468
- if (event.getSource() == lookAtItem || event.getSource() == lookFromItem)
1509
+ if (source == lookAtItem || source == lookFromItem)
14691510 {
14701511 ScreenFit();
14711512 } else
1472
- if (event.getSource() == switchItem)
1513
+ if (source == switchItem)
14731514 {
14741515 cVector v1 = new cVector();
14751516 cVector v2 = new cVector();
....@@ -1478,11 +1519,11 @@
14781519 objEditor.cameraView.renderCamera.setAim(v2, v1);
14791520 objEditor.cameraView.repaint();
14801521 } else
1481
- if (event.getSource() == rectoidItem)
1522
+ if (source == rectoidItem)
14821523 {
14831524 makeSomething(new Box());
14841525 } else
1485
- if (event.getSource() == particleItem)
1526
+ if (source == particleItem)
14861527 {
14871528 ParticleNode particleGeom = new ParticleNode("Particles", 1000); //, particleType);
14881529 ParticleController particleController = new ParticleController(particleGeom);
....@@ -1503,9 +1544,9 @@
15031544 applyExample(particleGeom, "SMOKE");
15041545 makeSomething(particleGeom);
15051546 } else
1506
- if (event.getSource() == ragdollItem || event.getSource() == ragdoll2Item)
1547
+ if (source == ragdollItem || source == ragdoll2Item)
15071548 {
1508
- GenericJoint ragdoll = new GenericJoint(event.getSource() == ragdollItem);
1549
+ GenericJoint ragdoll = new GenericJoint(source == ragdollItem);
15091550
15101551 ragdoll.toParent = LA.newMatrix();
15111552 ragdoll.fromParent = LA.newMatrix();
....@@ -1521,27 +1562,71 @@
15211562 makeSomething(ragdoll);
15221563 //makeSomething(new VehicleDemo());
15231564 } else
1524
- if (event.getSource() == gridItem)
1565
+ /*
1566
+ */
1567
+ if (source == heightFieldItem)
1568
+ {
1569
+ Object3D obj = new Object3D();
1570
+
1571
+ obj.CreateMaterial();
1572
+ obj.bRep = new BoundaryRep();
1573
+
1574
+ obj.bRep.CreateMesh(new iHeightField()
1575
+ {
1576
+ public double f(double x, double y)
1577
+ {
1578
+ // The Mandelbrot set is represented by coloring
1579
+ // each point (x,y) according to the number of
1580
+ // iterations it takes before the while loop in
1581
+ // this method ends. For points that are actually
1582
+ // in the Mandelbrot set, or very close to it, the
1583
+ // count will reach the maximum value, 80. These
1584
+ // points will be colored purple. All other colors
1585
+ // represent points that are definitely NOT in the set.
1586
+ x -= 600;
1587
+ y -= 500;
1588
+ x /= 200;
1589
+ y /= 200;
1590
+ int count = 0;
1591
+ double zx = x;
1592
+ double zy = y;
1593
+ while (count < 80 && Math.abs(x) < 100 && Math.abs(zy) < 100) {
1594
+ double new_zx = zx*zx - zy*zy + x;
1595
+ zy = 2*zx*zy + y;
1596
+ zx = new_zx;
1597
+ count++;
1598
+ }
1599
+ return count; // Math.sqrt(count);
1600
+ }
1601
+ }, 1000,1000);
1602
+
1603
+ makeSomething(obj);
1604
+ } else
1605
+ if (source == gridItem)
15251606 {
15261607 makeSomething(new Grid());
15271608 } else
1528
- if (event.getSource() == ellipsoidItem)
1609
+ if (source == ellipsoidItem)
15291610 {
15301611 makeSomething(new Sphere());
15311612 } else
1532
- if (event.getSource() == coneItem)
1613
+ if (source == coneItem)
15331614 {
15341615 makeSomething(new Cone());
15351616 } else
1536
- if (event.getSource() == torusItem)
1617
+ if (source == torusItem)
15371618 {
15381619 makeSomething(new Torus());
15391620 } else
1540
- if (event.getSource() == superItem)
1621
+ if (source == superItem)
15411622 {
15421623 makeSomething(new Superellipsoid());
15431624 } else
1544
- if (event.getSource() == blobItem)
1625
+ if (source == kleinItem)
1626
+ {
1627
+ makeSomething(new Klein());
1628
+ } else
1629
+ if (source == blobItem)
15451630 {
15461631 Blob blob = new Blob();
15471632 BlobComponent comp = new BlobComponent();
....@@ -1549,15 +1634,15 @@
15491634 //blob.retile();
15501635 makeSomething(blob);
15511636 } else
1552
- if (event.getSource() == latheItem)
1637
+ if (source == latheItem)
15531638 {
15541639 makeSomething(new Lathe());
15551640 } else
1556
- if (event.getSource() == bezierItem)
1641
+ if (source == bezierItem)
15571642 {
15581643 makeSomething(new BezierSurface());
15591644 } else
1560
- if (event.getSource() == checkerItem)
1645
+ if (source == checkerItem)
15611646 {
15621647 /*
15631648 Object3D obj = new BezierSurface(5,8);
....@@ -1570,9 +1655,9 @@
15701655 LA.matConcat(obj.toParent, cameraView.renderCamera.fromParent, obj.toParent);
15711656 LA.matInvert(obj.toParent, obj.fromParent);
15721657 */
1573
- makeSomething(new CheckerIG());
1658
+ makeSomething(new Checker());
15741659 } else
1575
- if (event.getSource() == meshItem)
1660
+ if (source == meshItem)
15761661 {
15771662 Object3D itemtomake = new Object3D();
15781663 Object3D child;
....@@ -1593,35 +1678,35 @@
15931678 makeSomething(child);
15941679 }
15951680 } else
1596
- if (event.getSource() == springItem)
1681
+ if (source == springItem)
15971682 {
15981683 cSpring s = new cSpring();
15991684 s.setup();
16001685 makeSomething(s);
16011686 } else
1602
- if (event.getSource() == flagItem)
1687
+ if (source == flagItem)
16031688 {
16041689 cSpring s = new cFlag();
16051690 s.setup();
16061691 makeSomething(s);
16071692 } else
1608
- if (event.getSource() == lightItem)
1693
+ if (source == lightItem)
16091694 {
16101695 makeSomething(new Light());
16111696 } else
1612
- if (event.getSource() == csgItem)
1697
+ if (source == csgItem)
16131698 {
16141699 group(new CSG());
16151700 } else
1616
- if (event.getSource() == templateItem)
1701
+ if (source == templateItem)
16171702 {
16181703 group(new cTemplate());
16191704 } else
1620
- if (event.getSource() == attributeItem)
1705
+ if (source == attributeItem)
16211706 {
16221707 makeSomething(new Attribute());
16231708 } else
1624
- if (event.getSource() == pointflowItem)
1709
+ if (source == pointflowItem)
16251710 {
16261711 makeSomething(new PointFlow());
16271712 } else
....@@ -1633,7 +1718,7 @@
16331718 } else
16341719 */
16351720
1636
- if (event.getSource() == superLoopItem)
1721
+ if (source == superLoopItem)
16371722 {
16381723 Composite g = new cGroup();
16391724 for (int i=0; i<15; i++)
....@@ -1655,7 +1740,7 @@
16551740
16561741 group(g);
16571742 } else
1658
- if (event.getSource() == loopItem)
1743
+ if (source == loopItem)
16591744 {
16601745 Composite csg = new GroupLeaf();
16611746 csg.count = 5;
....@@ -1664,7 +1749,7 @@
16641749 csg.addChild(child);
16651750 child.addChild(csg);
16661751 } else
1667
- if (event.getSource() == doubleItem)
1752
+ if (source == doubleItem)
16681753 {
16691754 Composite csg = new GroupLeaf();
16701755 csg.count = 5;
....@@ -1676,7 +1761,7 @@
16761761 csg.addChild(child);
16771762 child.addChild(csg);
16781763 } else
1679
- if (event.getSource() == tripleItem)
1764
+ if (source == tripleItem)
16801765 {
16811766 Composite csg = new GroupLeaf();
16821767 csg.count = 4;
....@@ -1692,70 +1777,70 @@
16921777 child.addChild(csg);
16931778 } else
16941779
1695
- if (event.getSource() == importGFDItem)
1780
+ if (source == importGFDItem)
16961781 {
16971782 ImportGFD();
16981783 } else
1699
- if (event.getSource() == importVRMLX3DItem)
1784
+ if (source == importVRMLX3DItem)
17001785 {
17011786 ImportVRMLX3D();
17021787 } else
1703
- if (event.getSource() == import3DSItem)
1788
+ if (source == import3DSItem)
17041789 {
17051790 objEditor.ImportJME(new com.jmex.model.converters.MaxToJme(), "3ds", "Import 3DS");
17061791 } else
1707
- if (event.getSource() == importOBJItem)
1792
+ if (source == importOBJItem)
17081793 {
17091794 objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
17101795 } else
1711
- if (event.getSource() == computeAOItem)
1796
+ if (source == computeAOItem)
17121797 {
1713
- CameraPane.drawMode = CameraPane.OCCLUSION;
1714
- CameraPane.theRenderer.repaint();
1798
+ Globals.drawMode = CameraPane.OCCLUSION;
1799
+ Globals.theRenderer.repaint();
17151800 } else
1716
- if (event.getSource() == recompileItem)
1801
+ if (source == recompileItem)
17171802 {
17181803 Recompile();
17191804 refreshContents();
17201805 } else
1721
- if (event.getSource() == editScriptItem)
1806
+ if (source == editScriptItem)
17221807 {
17231808 OpenDialog();
17241809 refreshContents();
17251810 } else
1726
- if (event.getSource() == invariantsItem)
1811
+ if (source == invariantsItem)
17271812 {
17281813 System.out.println("Invariants:");
1729
- GraphreeD.theApplet3D.universe.invariants();
1814
+ GrafreeD.grafreeD.universe.invariants();
17301815 } else
1731
- if (event.getSource() == memoryItem)
1816
+ if (source == memoryItem)
17321817 {
17331818 //System.out.println("Invariants:");
17341819 PrintMemory();
17351820 } else
1736
- if (event.getSource() == pathItem)
1821
+ if (source == pathItem)
17371822 {
17381823 PrintPath();
17391824 } else
1740
- if (event.getSource() == analyzeItem)
1825
+ if (source == analyzeItem)
17411826 {
17421827 AnalyzeObject();
17431828 } else
1744
- if (event.getSource() == dumpItem)
1829
+ if (source == dumpItem)
17451830 {
17461831 DumpObject();
17471832 } else
1748
- if (event.getSource() == screenfitButton)
1833
+ if (source == screenfitButton)
17491834 {
17501835 //Reload(lastConverter, lastFilename, true);
17511836 ScreenFit();
17521837 } else
1753
- if (event.getSource() == screenfitpointButton)
1838
+ if (source == screenfitpointButton)
17541839 {
17551840 //Reload(lastConverter, lastFilename, true);
17561841 ScreenFitPoint();
17571842 } else
1758
- if (event.getSource() == snapobjectButton)
1843
+ if (source == snapobjectButton)
17591844 {
17601845 //Reload(lastConverter, lastFilename, true);
17611846 SnapObject();
....@@ -1766,13 +1851,13 @@
17661851 // Recompile();
17671852 // refreshContents();
17681853 // } else
1769
- if (event.getSource() == gcButton)
1854
+ if (source == gcButton)
17701855 {
17711856 System.out.println("Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
17721857 System.gc();
17731858 System.out.println("GC Memory (F/T/M) : " + Runtime.getRuntime().freeMemory() + "/" + Runtime.getRuntime().totalMemory() + "/" + Runtime.getRuntime().maxMemory());
17741859 } else
1775
- if (event.getSource() == editLeafItem)
1860
+ if (source == editLeafItem)
17761861 {
17771862 Object3D obj;
17781863 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -1786,65 +1871,66 @@
17861871 }
17871872 refreshContents(true);
17881873 } else
1789
- if (event.getSource() == openWindowItem)
1874
+ if (source == openWindowItem)
17901875 {
17911876 EditSelection(true);
17921877 } else
1793
- if (event.getSource() == cutItem || event.getSource() == clearButton)
1878
+ if (source == cutItem || source == clearButton)
17941879 {
17951880 loadClipboard(true);
17961881 } else
1797
- if (event.getSource() == duplicateItem)
1882
+ if (source == duplicateItem)
17981883 {
1799
- Object3D keep = GraphreeD.clipboard;
1884
+ Object3D keep = GrafreeD.clipboard;
18001885 loadClipboard(false);
18011886 paste(false);
1802
- GraphreeD.clipboard = keep;
1887
+ GrafreeD.clipboard = keep;
18031888 } else
1804
- if (event.getSource() == cloneItem)
1889
+ if (source == cloneItem)
18051890 {
18061891 CloneSelection(false);
18071892 } else
1808
- if (event.getSource() == cloneSupportItem)
1893
+ if (source == cloneSupportItem)
18091894 {
18101895 CloneSelection(true);
18111896 } else
1812
- if (event.getSource() == copyItem)
1897
+ if (source == copyItem)
18131898 {
18141899 loadClipboard(false);
18151900 } else
1816
- if (event.getSource() == pasteItem)
1901
+ if (source == pasteItem)
18171902 {
18181903 paste(false);
18191904 } else
1820
- if (event.getSource() == pasteLinkItem)
1905
+ if (source == pasteLinkItem)
18211906 {
18221907 pasteInto(false);
18231908 } else
1824
- if (event.getSource() == pasteCloneItem)
1909
+ if (source == pasteCloneItem)
18251910 {
18261911 pasteInto(true);
18271912 } else
1828
- if (event.getSource() == pasteExpandItem)
1913
+ if (source == pasteExpandItem)
18291914 {
18301915 paste(true);
18311916 } else
1832
- if (event.getSource() == synchronizeItem)
1917
+ if (source == synchronizeItem)
18331918 {
18341919 Overwrite(Object3D.TRANSFORM);
18351920 } else
1836
- if (event.getSource() == overwriteNameItem)
1921
+ if (source == overwriteNameItem)
18371922 {
18381923 Overwrite(Object3D.NAME);
18391924 } else
1840
- if (event.getSource() == overwriteUVItem)
1925
+ if (source == overwriteUVItem)
18411926 {
18421927 Overwrite(Object3D.UV);
18431928 } else
1844
- if (event.getSource() == overwriteMatItem)
1929
+ if (source == overwriteMatItem)
18451930 {
1931
+ /* july 2015
18461932 if ((dropAttributes & Object3D.TEXTURE) == 0)
1847
- Overwrite(Object3D.MATERIAL);
1933
+ Overwrite(Object3D.MATERIAL | Object3D.COLOR);
18481934 else
18491935 {
18501936 if ((dropAttributes & Object3D.COLOR) == 0 && (dropAttributes & Object3D.MATERIAL) == 0)
....@@ -1856,13 +1942,16 @@
18561942 Overwrite(Object3D.MATERIAL | Object3D.TEXTURE);
18571943 }
18581944 }
1945
+ */
1946
+
1947
+ Overwrite(dropAttributes);
18591948 }
1860
- if (event.getSource() == overwriteGeoItem)
1949
+ if (source == overwriteGeoItem)
18611950 {
18621951 Overwrite(Object3D.GEOMETRY);
1863
-// if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
1952
+// if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
18641953 // {
1865
-// Object3D content = GraphreeD.clipboard.get(0);
1954
+// Object3D content = GrafreeD.clipboard.get(0);
18661955 //
18671956 // if (content instanceof cGroup && ((cGroup)content).transientlink )
18681957 // content = ((cGroup)content).get(0);
....@@ -1874,7 +1963,7 @@
18741963 // refreshContents();
18751964 // }
18761965 } else
1877
- if (event.getSource() == generateMeshItem)
1966
+ if (source == generateMeshItem)
18781967 {
18791968 //if (group.selection.size() == 1)
18801969 // for (int i=0; i<group.selection.size(); i++)
....@@ -1885,7 +1974,7 @@
18851974 ResetModel();
18861975 refreshContents();
18871976 } else
1888
- if (event.getSource() == extractGeometriesItem)
1977
+ if (source == extractGeometriesItem)
18891978 {
18901979 boolean one = false;
18911980
....@@ -1912,7 +2001,7 @@
19122001 ResetModel();
19132002 refreshContents();
19142003 } else
1915
- if (event.getSource() == cloneGeometriesItem)
2004
+ if (source == cloneGeometriesItem)
19162005 {
19172006 boolean one = false;
19182007
....@@ -1938,32 +2027,37 @@
19382027 ResetModel();
19392028 refreshContents();
19402029 } else
1941
- if (event.getSource() == shareGeometriesItem)
2030
+ if (source == shareGeometriesItem)
19422031 {
19432032 boolean one = false;
19442033
19452034 if (group.selection.size() == 1)
19462035 one = true;
19472036
2037
+ Object3D merge = null;
2038
+
19482039 Object3D content = new cGroup();
19492040
19502041 for (int i=0; i<group.selection.size(); i++)
19512042 {
1952
- Object3D sel = new Merge(group.selection.get(i));
2043
+ merge = new Merge(group.selection.get(i));
19532044
19542045 if (one)
1955
- makeSomething(sel, false);
2046
+ makeSomething(merge, false);
19562047 else
1957
- content.addChild(sel);
2048
+ content.addChild(merge);
19582049 }
19592050
19602051 if (!one)
1961
- makeSomething(content, false);
1962
-
1963
- ResetModel();
1964
- refreshContents();
2052
+ makeSomething(content, true);
2053
+ else
2054
+ {
2055
+ ResetModel();
2056
+ Select(merge.GetTreePath(), true, false); // unselect... false);
2057
+ refreshContents();
2058
+ }
19652059 } else
1966
- if (event.getSource() == mergeGeometriesItem)
2060
+ if (source == mergeGeometriesItem)
19672061 {
19682062 boolean one = false;
19692063
....@@ -1993,11 +2087,11 @@
19932087 ResetModel();
19942088 refreshContents();
19952089 } else
1996
- if (event.getSource() == linkverticesItem)
2090
+ if (source == linkverticesItem)
19972091 {
1998
-// if (group.selection.size() == 1 && GraphreeD.clipboard.size() == 1)
2092
+// if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
19992093 // {
2000
-// Object3D content = GraphreeD.clipboard.get(0);
2094
+// Object3D content = GrafreeD.clipboard.get(0);
20012095 //
20022096 // if (content instanceof cGroup && ((cGroup)content).transientlink )
20032097 // content = ((cGroup)content).get(0);
....@@ -2006,14 +2100,14 @@
20062100 // group.selection.get(0).setMasterThis(content); // should be identity
20072101 // refreshContents();
20082102 // }
2009
- if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
2103
+ if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
20102104 {
2011
- Object3D content = GraphreeD.clipboard.get(0);
2105
+ Object3D content = GrafreeD.clipboard.get(0);
20122106
20132107 if (content instanceof cGroup && ((cGroup)content).transientlink )
20142108 content = ((cGroup)content).get(0);
20152109
2016
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
2110
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
20172111 for (int i=0; i<group.selection.size(); i++)
20182112 {
20192113 boolean random = CameraPane.RANDOM;
....@@ -2022,11 +2116,11 @@
20222116 // group.selection.get(i).setMasterThis(content); // should be identity
20232117 CameraPane.RANDOM = random;
20242118 }
2025
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
2119
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
20262120 refreshContents();
20272121 }
20282122 } else
2029
- if (event.getSource() == resetsupportItem)
2123
+ if (source == resetsupportItem)
20302124 {
20312125 for (int i=0; i<group.selection.size(); i++)
20322126 {
....@@ -2038,7 +2132,16 @@
20382132
20392133 refreshContents();
20402134 } else
2041
- if (event.getSource() == resetreferencesItem)
2135
+ if (source == relinkverticesItem)
2136
+ {
2137
+ boolean random = CameraPane.RANDOM;
2138
+ CameraPane.RANDOM = false; // parse all random nodes
2139
+ group.selection.RelinkToSupport();
2140
+ CameraPane.RANDOM = random;
2141
+
2142
+ refreshContents();
2143
+ } else
2144
+ if (source == resetreferencesItem)
20422145 {
20432146 for (int i=0; i<group.selection.size(); i++)
20442147 {
....@@ -2047,11 +2150,11 @@
20472150
20482151 refreshContents();
20492152 } else
2050
- if (event.getSource() == setMasterItem)
2153
+ if (source == setMasterItem)
20512154 {
2052
- if (group.selection.size() == 1 && GraphreeD.clipboard.size() == 1)
2155
+ if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
20532156 {
2054
- Object3D content = GraphreeD.clipboard.get(0);
2157
+ Object3D content = GrafreeD.clipboard.get(0);
20552158
20562159 if (content instanceof cGroup && ((cGroup)content).transientlink )
20572160 content = ((cGroup)content).get(0);
....@@ -2060,13 +2163,13 @@
20602163 refreshContents();
20612164 }
20622165 } else
2063
- if (event.getSource() == poseMeshItem)
2166
+ if (source == poseMeshItem)
20642167 {
20652168 if (group.selection.size() == 1)
20662169 {
2067
- if (GraphreeD.clipboard.size() == 1)
2170
+ if (GrafreeD.clipboard.size() == 1)
20682171 {
2069
- Object3D content = GraphreeD.clipboard.get(0);
2172
+ Object3D content = GrafreeD.clipboard.get(0);
20702173
20712174 if (content instanceof cGroup && ((cGroup)content).transientlink )
20722175 content = ((cGroup)content).get(0);
....@@ -2079,19 +2182,19 @@
20792182 }
20802183
20812184 } else
2082
- if (event.getSource() == revertMeshItem)
2185
+ if (source == revertMeshItem)
20832186 {
20842187 RevertMeshes();
20852188 } else
2086
- if (event.getSource() == resetMeshItem)
2189
+ if (source == resetMeshItem)
20872190 {
20882191 ResetAll();
20892192 } else
2090
- if (event.getSource() == stepAllItem)
2193
+ if (source == stepAllItem)
20912194 {
20922195 StepAll();
20932196 } else
2094
- if (event.getSource() == clearItem) // || event.getSource() == clearButton)
2197
+ if (source == clearItem) // || event.getSource() == clearButton)
20952198 {
20962199 //int indices[] = jList.getSelectedIndices();
20972200 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -2099,42 +2202,46 @@
20992202
21002203 ClearSelection(false);
21012204 } else
2102
- if (event.getSource() == clearAllItem)
2205
+ if (source == clearAllItem)
21032206 {
21042207 ClearSelection(true);
21052208 } else
2106
- if (event.getSource() == grabItem)
2209
+ if (source == grabItem)
21072210 {
21082211 group(new cGroup(), true);
21092212 } else
2110
- if (event.getSource() == frontItem)
2213
+ if (source == hideItem)
2214
+ {
2215
+ group(new HiddenObject());
2216
+ } else
2217
+ if (source == frontItem)
21112218 {
21122219 front();
21132220 } else
2114
- if (event.getSource() == backItem)
2221
+ if (source == backItem)
21152222 {
21162223 back();
21172224 } else
2118
- if (event.getSource() == cameraItem)
2225
+ if (source == cameraItem)
21192226 {
21202227 makeSomething(new Camera());
21212228 } else
2122
- if (event.getSource() == compositeItem)
2229
+ if (source == compositeItem)
21232230 {
21242231 group(new Composite());
21252232 } else
2126
- if (event.getSource() == randomItem)
2233
+ if (source == randomItem)
21272234 {
21282235 RandomNode random = new RandomNode();
21292236 group(random);
21302237 if (random.size() > 0)
2131
- random.name = random.get(0).name + "Rnd";
2238
+ random.name = random.get(0).name + "Switch";
21322239 } else
2133
- if (event.getSource() == physicsItem)
2240
+ if (source == physicsItem)
21342241 {
21352242 group(new PhysicsNode());
21362243 } else
2137
- if (event.getSource() == frameselectorItem)
2244
+ if (source == frameselectorItem)
21382245 {
21392246 for (int i=0; i<group.selection.size(); i++)
21402247 {
....@@ -2146,7 +2253,7 @@
21462253 ResetModel();
21472254 refreshContents();
21482255 } else
2149
- if (event.getSource() == switchGeoItem)
2256
+ if (source == switchGeoItem)
21502257 {
21512258 for (int i=0; i<group.selection.size(); i++)
21522259 {
....@@ -2158,7 +2265,7 @@
21582265 ResetModel();
21592266 refreshContents();
21602267 } else
2161
- if (event.getSource() == switchTransfoItem)
2268
+ if (source == switchTransfoItem)
21622269 {
21632270 for (int i=0; i<group.selection.size(); i++)
21642271 {
....@@ -2170,7 +2277,7 @@
21702277 ResetModel();
21712278 refreshContents();
21722279 } else
2173
- if (event.getSource() == morphItem)
2280
+ if (source == morphItem)
21742281 {
21752282 for (int i=0; i<group.selection.size(); i++)
21762283 {
....@@ -2182,7 +2289,7 @@
21822289 ResetModel();
21832290 refreshContents();
21842291 } else
2185
- if (event.getSource() == scriptNodeItem)
2292
+ if (source == scriptNodeItem)
21862293 {
21872294 boolean atleastone = false;
21882295
....@@ -2221,191 +2328,215 @@
22212328 }
22222329 }
22232330 } else
2224
- if (event.getSource() == linkerItem)
2331
+ if (source == linkerItem)
22252332 {
22262333 group(new cLinker());
22272334 } else
2228
- if (event.getSource() == textureItem)
2335
+ if (source == textureItem)
22292336 {
22302337 group(new TextureNode());
22312338 } else
2232
- if (event.getSource() == shadowXItem)
2339
+ if (source == billboardItem)
2340
+ {
2341
+ group(new BillboardNode());
2342
+ } else
2343
+ if (source == shadowXItem)
22332344 {
22342345 CastShadow(0);
22352346 } else
2236
- if (event.getSource() == shadowYItem)
2347
+ if (source == shadowYItem)
22372348 {
22382349 CastShadow(1);
22392350 } else
2240
- if (event.getSource() == shadowZItem)
2351
+ if (source == shadowZItem)
22412352 {
22422353 CastShadow(2);
22432354 } else
2244
- if (event.getSource() == ungroupItem)
2355
+ if (source == ungroupItem)
22452356 {
2246
- ungroup();
2357
+ //ungroup();
2358
+ for (int i=0; i<group.selection.size(); i++)
2359
+ {
2360
+ Ungroup(group.selection.get(i));
2361
+ }
2362
+
2363
+ ClearSelection(false);
2364
+
2365
+ refreshContents();
22472366 } else
2248
- if (event.getSource() == genUVItem)
2367
+ if (source == genUVItem)
22492368 {
22502369 GenUV();
22512370 } else
2252
- if (event.getSource() == genNormalsCADItem)
2371
+ if (source == genNormalsCADItem)
22532372 {
22542373 GenNormals(true);
22552374 } else
2256
- if (event.getSource() == genNormalsORGANItem)
2375
+ if (source == genNormalsMESHItem)
2376
+ {
2377
+ GenNormals(true); // TODO
2378
+ } else
2379
+ if (source == genNormalsORGANItem)
22572380 {
22582381 GenNormals(false);
22592382 } else
2260
- if (event.getSource() == stripifyItem)
2383
+ if (source == genNormalsMINEItem)
2384
+ {
2385
+ GenNormalsMINE();
2386
+ } else
2387
+ if (source == stripifyItem)
22612388 {
22622389 Stripify();
22632390 } else
2264
- if (event.getSource() == unstripifyItem)
2391
+ if (source == unstripifyItem)
22652392 {
22662393 Unstripify();
22672394 } else
2268
- if (event.getSource() == trimItem)
2395
+ if (source == trimItem)
22692396 {
22702397 Trim();
22712398 } else
2272
- if (event.getSource() == untrimItem)
2399
+ if (source == untrimItem)
22732400 {
22742401 Untrim();
22752402 } else
2276
- if (event.getSource() == clearColorsItem)
2403
+ if (source == clearColorsItem)
22772404 {
22782405 ClearColors();
22792406 } else
2280
- if (event.getSource() == clearMaterialsItem)
2407
+ if (source == clearMaterialsItem)
22812408 {
22822409 ClearMaterials();
22832410 } else
2284
- if (event.getSource() == liveleavesItem)
2411
+ if (source == liveleavesItem)
22852412 {
22862413 LiveLeaves(true);
22872414 } else
2288
- if (event.getSource() == unliveleavesItem)
2415
+ if (source == unliveleavesItem)
22892416 {
22902417 LiveLeaves(false);
22912418 } else
2292
- if (event.getSource() == supportleavesItem)
2419
+ if (source == supportleavesItem)
22932420 {
22942421 SupportLeaves(true);
22952422 } else
2296
- if (event.getSource() == unsupportleavesItem)
2423
+ if (source == unsupportleavesItem)
22972424 {
22982425 SupportLeaves(false);
22992426 } else
2300
- if (event.getSource() == hideleavesItem)
2427
+ if (source == hideleavesItem)
23012428 {
23022429 HideLeaves(true);
23032430 } else
2304
- if (event.getSource() == showleavesItem)
2431
+ if (source == showleavesItem)
23052432 {
23062433 HideLeaves(false);
23072434 } else
2308
- if (event.getSource() == markleavesItem)
2435
+ if (source == markleavesItem)
23092436 {
23102437 MarkLeaves(true);
23112438 } else
2312
- if (event.getSource() == unmarkleavesItem)
2439
+ if (source == unmarkleavesItem)
23132440 {
23142441 MarkLeaves(false);
23152442 } else
2316
- if (event.getSource() == flipVItem)
2443
+ if (source == flipVItem)
23172444 {
23182445 FlipV(true);
23192446 } else
2320
- if (event.getSource() == unflipVItem)
2447
+ if (source == unflipVItem)
23212448 {
23222449 FlipV(false);
23232450 } else
2324
- if (event.getSource() == lowTexturesItem)
2451
+ if (source == lowTexturesItem)
23252452 {
23262453 SetTexRes(0);
23272454 } else
2328
- if (event.getSource() == normalTexturesItem)
2455
+ if (source == normalTexturesItem)
23292456 {
23302457 SetTexRes(1);
23312458 } else
2332
- if (event.getSource() == highTexturesItem)
2459
+ if (source == highTexturesItem)
23332460 {
23342461 SetTexRes(2);
23352462 } else
2336
- if (event.getSource() == veryhighTexturesItem)
2463
+ if (source == veryhighTexturesItem)
23372464 {
23382465 SetTexRes(3);
23392466 } else
2340
- if (event.getSource() == maxTexturesItem)
2467
+ if (source == maxTexturesItem)
23412468 {
23422469 SetTexRes(4);
23432470 } else
2344
- if (event.getSource() == panoTexturesItem)
2471
+ if (source == panoTexturesItem)
23452472 {
23462473 SetTexRes(5);
23472474 } else
2348
- if (event.getSource() == reverseNormalsItem)
2475
+ if (source == reverseNormalsItem)
23492476 {
23502477 ReverseNormals();
23512478 } else
2352
- if (event.getSource() == parseverticesItem)
2479
+ if (source == parseverticesItem)
23532480 {
23542481 ParseVertices();
23552482 } else
2356
- if (event.getSource() == alignItem)
2483
+ if (source == textureFieldItem)
2484
+ {
2485
+ TextureVertices();
2486
+ } else
2487
+ if (source == alignItem)
23572488 {
23582489 Align();
23592490 } else
2360
- if (event.getSource() == mirrorItem)
2491
+ if (source == mirrorItem)
23612492 {
23622493 MirrorPoses();
23632494 } else
2364
- if (event.getSource() == reduceMorphItem)
2495
+ if (source == reduceMorphItem)
23652496 {
23662497 MeshReduction(false);
23672498 } else
2368
- if (event.getSource() == reduce34MorphItem)
2499
+ if (source == reduce34MorphItem)
23692500 {
23702501 MeshReduction(true);
23712502 } else
2372
- if (event.getSource() == reverseTrianglesItem)
2503
+ if (source == reverseTrianglesItem)
23732504 {
23742505 ReverseTriangles();
23752506 } else
2376
- if (event.getSource() == reduceMeshItem)
2507
+ if (source == reduceMeshItem)
23772508 {
23782509 ReduceMesh(false);
23792510 } else
2380
- if (event.getSource() == reduce34MeshItem)
2511
+ if (source == reduce34MeshItem)
23812512 {
23822513 ReduceMesh(true);
23832514 } else
2384
- if (event.getSource() == increaseMeshItem)
2515
+ if (source == increaseMeshItem)
23852516 {
23862517 IncreaseMesh();
23872518 } else
2388
- if (event.getSource() == clipMeshItem)
2519
+ if (source == clipMeshItem)
23892520 {
23902521 ClipMesh();
23912522 } else
2392
- if (event.getSource() == smoothMeshItem)
2523
+ if (source == smoothMeshItem)
23932524 {
23942525 SmoothMesh();
23952526 } else
2396
- if (event.getSource() == transformgeometryItem)
2527
+ if (source == transformgeometryItem)
23972528 {
23982529 TransformGeometry();
23992530 } else
2400
- if (event.getSource() == resetTransformItem)
2531
+ if (source == resetTransformItem)
24012532 {
24022533 ResetTransform();
24032534 } else
2404
- if (event.getSource() == resetCentroidItem)
2535
+ if (source == resetCentroidItem)
24052536 {
24062537 ResetCentroid();
24072538 } else
2408
- if (event.getSource() == resetParentItem)
2539
+ if (source == resetParentItem)
24092540 {
24102541 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24112542 {
....@@ -2415,7 +2546,7 @@
24152546
24162547 refreshContents();
24172548 } else
2418
- if (event.getSource() == repairParentItem)
2549
+ if (source == repairParentItem)
24192550 {
24202551 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24212552 {
....@@ -2429,7 +2560,21 @@
24292560
24302561 refreshContents();
24312562 } else
2432
- if (event.getSource() == sortbysizeItem)
2563
+ if (source == repairShadowItem)
2564
+ {
2565
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
2566
+ {
2567
+ Object3D obj = (Object3D)e.nextElement();
2568
+ obj.RepairShadow();
2569
+// for (int i=0; i<obj.size(); i++)
2570
+// {
2571
+// obj.get(i).parent = obj;
2572
+// }
2573
+ }
2574
+
2575
+ refreshContents();
2576
+ } else
2577
+ if (source == sortbysizeItem)
24332578 {
24342579 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24352580 {
....@@ -2441,7 +2586,7 @@
24412586 ResetModel();
24422587 refreshContents();
24432588 } else
2444
- if (event.getSource() == sortbynameItem)
2589
+ if (source == sortbynameItem)
24452590 {
24462591 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
24472592 {
....@@ -2453,7 +2598,7 @@
24532598 ResetModel();
24542599 refreshContents();
24552600 } else
2456
- if (event.getSource() == attachPigmentItem)
2601
+ if (source == attachPigmentItem)
24572602 {
24582603 String texture = GetFile("Attach pigment");
24592604 Object3D obj;
....@@ -2465,7 +2610,7 @@
24652610
24662611 refreshContents();
24672612 } else
2468
- if (event.getSource() == detachPigmentItem)
2613
+ if (source == detachPigmentItem)
24692614 {
24702615 Object3D obj;
24712616 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2476,7 +2621,7 @@
24762621
24772622 refreshContents();
24782623 } else
2479
- if (event.getSource() == attachBumpItem)
2624
+ if (source == attachBumpItem)
24802625 {
24812626 String texture = GetFile("Attach bump");
24822627 Object3D obj;
....@@ -2488,7 +2633,7 @@
24882633
24892634 refreshContents();
24902635 } else
2491
- if (event.getSource() == detachBumpItem)
2636
+ if (source == detachBumpItem)
24922637 {
24932638 Object3D obj;
24942639 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2499,7 +2644,7 @@
24992644
25002645 refreshContents();
25012646 } else
2502
- if (event.getSource() == pigmentBumpItem)
2647
+ if (source == pigmentBumpItem)
25032648 {
25042649 Object3D obj;
25052650 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2510,158 +2655,195 @@
25102655
25112656 refreshContents();
25122657 } else
2513
- if (event.getSource() == flashSelectionButton)
2658
+ if (source == flashSelectionButton)
25142659 {
25152660 CameraPane.flash = true;
25162661 refreshContents();
25172662 } else
2518
- if (event.getSource() == oneButton)
2663
+ if (source == oneButton)
25192664 {
25202665 } else
2521
- if (event.getSource() == twoButton)
2666
+ if (source == twoButton)
25222667 {
25232668 radio.layout = twoButton;
25242669 // bug
25252670 //gridPanel.setDividerLocation(1.0);
25262671 //bigPanel.setDividerLocation(0.0);
2527
- bigThree.remove(jtp);
2528
- bigThree.remove(cameraPanel);
2529
- bigThree.remove(XYZPanel);
2530
- aWindowConstraints.gridx = 0;
2531
- aWindowConstraints.gridy = 0;
2532
- aWindowConstraints.gridwidth = 1;
2533
- // aConstraints.gridheight = 3;
2534
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2535
- aWindowConstraints.weightx = 0;
2536
- aWindowConstraints.weighty = 1;
2537
- //bigThree.add(jtp, aWindowConstraints);
2538
- aWindowConstraints.weightx = 1;
2539
- aWindowConstraints.gridwidth = 3;
2540
- // aConstraints.gridheight = 3;
2541
- aWindowConstraints.gridx = 1;
2542
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2543
- bigThree.add(cameraPanel, aWindowConstraints);
2544
- aWindowConstraints.weightx = 0;
2545
- aWindowConstraints.gridx = 4;
2546
- aWindowConstraints.gridwidth = 1;
2547
- // aConstraints.gridheight = 3;
2548
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2549
- //bigThree.add(XYZPanel, aWindowConstraints);
2550
- bigThree.revalidate();
2672
+// bigThree.remove(scenePanel);
2673
+// bigThree.remove(centralPanel);
2674
+// bigThree.remove(XYZPanel);
2675
+// aWindowConstraints.gridx = 0;
2676
+// aWindowConstraints.gridy = 0;
2677
+// aWindowConstraints.gridwidth = 1;
2678
+// // aConstraints.gridheight = 3;
2679
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2680
+// aWindowConstraints.weightx = 0;
2681
+// aWindowConstraints.weighty = 1;
2682
+// //bigThree.add(jtp, aWindowConstraints);
2683
+// aWindowConstraints.weightx = 1;
2684
+// aWindowConstraints.gridwidth = 3;
2685
+// // aConstraints.gridheight = 3;
2686
+// aWindowConstraints.gridx = 1;
2687
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2688
+// bigThree.add(centralPanel, aWindowConstraints);
2689
+// aWindowConstraints.weightx = 0;
2690
+// aWindowConstraints.gridx = 4;
2691
+// aWindowConstraints.gridwidth = 1;
2692
+// // aConstraints.gridheight = 3;
2693
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2694
+// //bigThree.add(XYZPanel, aWindowConstraints);
2695
+// scenePanel.setVisible(false);
2696
+// centralPanel.setVisible(true);
2697
+// XYZPanel.setVisible(false);
2698
+ bigThree.ClearUI();
2699
+ bigThree.add(centralPanel);
2700
+ bigThree.FlushUI();
25512701 } else
2552
- if (event.getSource() == threeButton)
2702
+ if (source == threeButton)
25532703 {
25542704 radio.layout = threeButton;
2555
- bigThree.remove(jtp);
2556
- bigThree.remove(cameraPanel);
2557
- bigThree.remove(XYZPanel);
2558
- aWindowConstraints.gridx = 0;
2559
- aWindowConstraints.gridy = 0;
2560
- aWindowConstraints.gridwidth = 1;
2561
- // aConstraints.gridheight = 3;
2562
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2563
- aWindowConstraints.weightx = 0;
2564
- aWindowConstraints.weighty = 1;
2565
- //bigThree.add(jtp, aWindowConstraints);
2566
- aWindowConstraints.weightx = 1;
2567
- aWindowConstraints.gridwidth = 3;
2568
- // aConstraints.gridheight = 3;
2569
- aWindowConstraints.gridx = 1;
2570
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2571
- bigThree.add(cameraPanel, aWindowConstraints);
2572
- aWindowConstraints.weightx = 0;
2573
- aWindowConstraints.gridx = 4;
2574
- aWindowConstraints.gridwidth = 1;
2575
- // aConstraints.gridheight = 3;
2576
- aConstraints.fill = GridBagConstraints.VERTICAL;
2577
- bigThree.add(XYZPanel, aWindowConstraints);
2578
- bigThree.revalidate();
2705
+
2706
+// bigThree.remove(scenePanel);
2707
+// bigThree.remove(centralPanel);
2708
+// bigThree.remove(XYZPanel);
2709
+// aWindowConstraints.gridx = 0;
2710
+// aWindowConstraints.gridy = 0;
2711
+// aWindowConstraints.gridwidth = 1;
2712
+// // aConstraints.gridheight = 3;
2713
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2714
+// aWindowConstraints.weightx = 0;
2715
+// aWindowConstraints.weighty = 1;
2716
+// //bigThree.add(jtp, aWindowConstraints);
2717
+// aWindowConstraints.weightx = 1;
2718
+// aWindowConstraints.gridwidth = 3;
2719
+// // aConstraints.gridheight = 3;
2720
+// aWindowConstraints.gridx = 1;
2721
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2722
+// bigThree.add(centralPanel, aWindowConstraints);
2723
+// aWindowConstraints.weightx = 0;
2724
+// aWindowConstraints.gridx = 4;
2725
+// aWindowConstraints.gridwidth = 1;
2726
+// // aConstraints.gridheight = 3;
2727
+// aConstraints.fill = GridBagConstraints.VERTICAL;
2728
+// bigThree.add(XYZPanel, aWindowConstraints);
2729
+// bigThree.validate();
2730
+// scenePanel.setVisible(false);
2731
+// centralPanel.setVisible(true);
2732
+// XYZPanel.setVisible(true);
2733
+ bigThree.ClearUI();
2734
+ bigThree.add(centralPanel);
2735
+ bigThree.add(XYZPanel);
2736
+ bigThree.FlushUI();
25792737 } else
2580
- if (event.getSource() == fourButton)
2738
+ if (source == fourButton)
25812739 {
25822740 radio.layout = fourButton;
2583
- bigThree.remove(jtp);
2584
- bigThree.remove(cameraPanel);
2585
- bigThree.remove(XYZPanel);
2586
- aWindowConstraints.gridx = 0;
2587
- aWindowConstraints.gridy = 0;
2588
- aWindowConstraints.gridwidth = 1;
2589
- // aWindowConstraints.gridheight = 3;
2590
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2591
- aWindowConstraints.weightx = 1;
2592
- aWindowConstraints.weighty = 1;
2593
- bigThree.add(jtp, aWindowConstraints);
2594
- aWindowConstraints.weightx = 1;
2595
- aWindowConstraints.gridwidth = 3;
2596
- // aConstraints.gridheight = 3;
2597
- aWindowConstraints.gridx = 1;
2598
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2599
- //bigThree.add(cameraPanel, aWindowConstraints);
2600
- aWindowConstraints.weightx = 0;
2601
- aWindowConstraints.gridx = 4;
2602
- aWindowConstraints.gridwidth = 1;
2603
- // aWindowConstraints.gridheight = 3;
2604
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2605
- //bigThree.add(XYZPanel, aWindowConstraints);
2606
- bigThree.revalidate();
2741
+
2742
+// bigThree.remove(scenePanel);
2743
+// bigThree.remove(centralPanel);
2744
+// bigThree.remove(XYZPanel);
2745
+// aWindowConstraints.gridx = 0;
2746
+// aWindowConstraints.gridy = 0;
2747
+// aWindowConstraints.gridwidth = 1;
2748
+// // aWindowConstraints.gridheight = 3;
2749
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2750
+// aWindowConstraints.weightx = 1;
2751
+// aWindowConstraints.weighty = 1;
2752
+// bigThree.add(scenePanel, aWindowConstraints);
2753
+// aWindowConstraints.weightx = 1;
2754
+// aWindowConstraints.gridwidth = 3;
2755
+// // aConstraints.gridheight = 3;
2756
+// aWindowConstraints.gridx = 1;
2757
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2758
+// //bigThree.add(cameraPanel, aWindowConstraints);
2759
+// aWindowConstraints.weightx = 0;
2760
+// aWindowConstraints.gridx = 4;
2761
+// aWindowConstraints.gridwidth = 1;
2762
+// // aWindowConstraints.gridheight = 3;
2763
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2764
+// //bigThree.add(XYZPanel, aWindowConstraints);
2765
+// bigThree.validate();
2766
+// scenePanel.setVisible(true);
2767
+// centralPanel.setVisible(false);
2768
+// XYZPanel.setVisible(false);
2769
+ bigThree.ClearUI();
2770
+ bigThree.add(scenePanel);
2771
+ bigThree.FlushUI();
26072772 } else
2608
- if (event.getSource() == sixButton)
2773
+ if (source == sixButton)
26092774 {
26102775 radio.layout = sixButton;
2611
- bigThree.remove(jtp);
2612
- bigThree.remove(cameraPanel);
2613
- bigThree.remove(XYZPanel);
2614
- aWindowConstraints.gridx = 0;
2615
- aWindowConstraints.gridy = 0;
2616
- aWindowConstraints.gridwidth = 1;
2617
- // aConstraints.gridheight = 3;
2618
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2619
- aWindowConstraints.weightx = 0;
2620
- aWindowConstraints.weighty = 1;
2621
- bigThree.add(jtp, aWindowConstraints);
2622
- aWindowConstraints.weightx = 1;
2623
- aWindowConstraints.gridwidth = 3;
2624
- // aWindowConstraints.gridheight = 3;
2625
- aWindowConstraints.gridx = 1;
2626
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2627
- bigThree.add(cameraPanel, aWindowConstraints);
2628
- aWindowConstraints.weightx = 0;
2629
- aWindowConstraints.gridx = 4;
2630
- aWindowConstraints.gridwidth = 1;
2631
- // aWindowConstraints.gridheight = 3;
2632
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2633
- //bigThree.add(XYZPanel, aConstraints);
2634
- bigThree.revalidate();
2776
+
2777
+// bigThree.remove(scenePanel);
2778
+// bigThree.remove(centralPanel);
2779
+// bigThree.remove(XYZPanel);
2780
+// aWindowConstraints.gridx = 0;
2781
+// aWindowConstraints.gridy = 0;
2782
+// aWindowConstraints.gridwidth = 1;
2783
+// // aConstraints.gridheight = 3;
2784
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2785
+// aWindowConstraints.weightx = 0;
2786
+// aWindowConstraints.weighty = 1;
2787
+// bigThree.add(scenePanel, aWindowConstraints);
2788
+// aWindowConstraints.weightx = 1;
2789
+// aWindowConstraints.gridwidth = 3;
2790
+// // aWindowConstraints.gridheight = 3;
2791
+// aWindowConstraints.gridx = 1;
2792
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2793
+// bigThree.add(centralPanel, aWindowConstraints);
2794
+// aWindowConstraints.weightx = 0;
2795
+// aWindowConstraints.gridx = 4;
2796
+// aWindowConstraints.gridwidth = 1;
2797
+// // aWindowConstraints.gridheight = 3;
2798
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2799
+// //bigThree.add(XYZPanel, aConstraints);
2800
+// bigThree.validate();
2801
+// scenePanel.setVisible(true);
2802
+// centralPanel.setVisible(true);
2803
+// XYZPanel.setVisible(false);
2804
+ bigThree.ClearUI();
2805
+ bigThree.add(scenePanel);
2806
+ bigThree.add(centralPanel);
2807
+ bigThree.FlushUI();
26352808 } else
2636
- if (event.getSource() == sevenButton)
2809
+ if (source == sevenButton)
26372810 {
26382811 radio.layout = sevenButton;
2639
- bigThree.remove(jtp);
2640
- bigThree.remove(cameraPanel);
2641
- bigThree.remove(XYZPanel);
2642
- aWindowConstraints.gridx = 0;
2643
- aWindowConstraints.gridy = 0;
2644
- aWindowConstraints.gridwidth = 1;
2645
- // aWindowConstraints.gridheight = 3;
2646
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2647
- aWindowConstraints.weightx = 0;
2648
- aWindowConstraints.weighty = 1;
2649
- bigThree.add(jtp, aWindowConstraints);
2650
- aWindowConstraints.weightx = 1;
2651
- aWindowConstraints.gridwidth = 3;
2652
- // aWindowConstraints.gridheight = 3;
2653
- aWindowConstraints.gridx = 1;
2654
- aWindowConstraints.fill = GridBagConstraints.BOTH;
2655
- bigThree.add(cameraPanel, aWindowConstraints);
2656
- aWindowConstraints.weightx = 0;
2657
- aWindowConstraints.gridx = 4;
2658
- aWindowConstraints.gridwidth = 1;
2659
- // aConstraints.gridheight = 3;
2660
- aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2661
- bigThree.add(XYZPanel, aWindowConstraints);
2662
- bigThree.revalidate();
2812
+
2813
+// bigThree.remove(scenePanel);
2814
+// bigThree.remove(centralPanel);
2815
+// bigThree.remove(XYZPanel);
2816
+// aWindowConstraints.gridx = 0;
2817
+// aWindowConstraints.gridy = 0;
2818
+// aWindowConstraints.gridwidth = 1;
2819
+// // aWindowConstraints.gridheight = 3;
2820
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2821
+// aWindowConstraints.weightx = 0;
2822
+// aWindowConstraints.weighty = 1;
2823
+// bigThree.add(scenePanel, aWindowConstraints);
2824
+// aWindowConstraints.weightx = 1;
2825
+// aWindowConstraints.gridwidth = 3;
2826
+// // aWindowConstraints.gridheight = 3;
2827
+// aWindowConstraints.gridx = 1;
2828
+// aWindowConstraints.fill = GridBagConstraints.BOTH;
2829
+// bigThree.add(centralPanel, aWindowConstraints);
2830
+// aWindowConstraints.weightx = 0;
2831
+// aWindowConstraints.gridx = 4;
2832
+// aWindowConstraints.gridwidth = 1;
2833
+// // aConstraints.gridheight = 3;
2834
+// aWindowConstraints.fill = GridBagConstraints.VERTICAL;
2835
+// bigThree.add(XYZPanel, aWindowConstraints);
2836
+// bigThree.validate();
2837
+// scenePanel.setVisible(true);
2838
+// centralPanel.setVisible(true);
2839
+// XYZPanel.setVisible(true);
2840
+ bigThree.ClearUI();
2841
+ bigThree.add(scenePanel);
2842
+ bigThree.add(centralPanel);
2843
+ bigThree.add(XYZPanel);
2844
+ bigThree.FlushUI();
26632845 } else
2664
- if (event.getSource() == rootButton)
2846
+ if (source == rootButton)
26652847 {
26662848 Object3D obj;
26672849 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2673,7 +2855,7 @@
26732855
26742856 refreshContents(true);
26752857 } else
2676
- if (event.getSource() == closeButton)
2858
+ if (source == closeButton)
26772859 {
26782860 //System.out.println("CLOSE: " + buttonGroup.getSelection());
26792861 cRadio ab;
....@@ -2694,11 +2876,11 @@
26942876 }
26952877 refreshContents(true);
26962878 } else
2697
- if (event.getSource() == editItem || event.getSource() == editButton)
2879
+ if (source == editItem || source == editButton)
26982880 {
26992881 EditSelection(false);
27002882 } else
2701
- if (event.getSource() == uneditButton)
2883
+ if (source == uneditButton)
27022884 {
27032885 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
27042886 {
....@@ -2710,12 +2892,12 @@
27102892
27112893 child.editWindow = null; // ???????????
27122894 }
2713
- objEditor.ctrlPanel.revalidate();
2895
+ objEditor.ctrlPanel.validate();
27142896 //objEditor.jTree.clearSelection();
27152897 //objEditor.ResetSliders();
27162898 refreshContents(true);
27172899 } else
2718
- if (event.getSource() == clearPanelButton)
2900
+ if (source == clearPanelButton)
27192901 {
27202902 assert(copy == group);
27212903 //copy.ClearUI();
....@@ -2726,7 +2908,7 @@
27262908 listUI.clear();
27272909 refreshContents(true);
27282910 } else
2729
- if (event.getSource() == allParamsButton)
2911
+ if (source == allParamsButton)
27302912 {
27312913 assert(copy == group);
27322914
....@@ -2747,19 +2929,19 @@
27472929
27482930 refreshContents(true);
27492931 } else
2750
- if (event.getSource() == unselectButton)
2932
+ if (source == unselectButton)
27512933 {
27522934 objEditor.jTree.clearSelection();
2753
- // ?? oct 2012 GraphreeD.clipboard.clear();
2935
+ // ?? oct 2012 GrafreeD.clipboard.clear();
27542936 objEditor.ResetSliders();
27552937 refreshContents(true);
27562938 } else
2757
- if(event.getSource() instanceof cRadio)
2939
+ if(source instanceof cRadio)
27582940 {
27592941 group.parent = keepparent;
27602942 group.attributes = 0;
27612943 //group.editWindow = null;
2762
- /*cRadio*/ radio = (cRadio)event.getSource();
2944
+ /*cRadio*/ radio = (cRadio)source;
27632945 Object3D obj = radio.GetObject();
27642946 System.out.println("Edit " + obj);
27652947 if (true) // obj instanceof Composite) // obj.parent == null) // obj instanceof Composite)
....@@ -2779,7 +2961,7 @@
27792961 }
27802962
27812963 copy = group;
2782
- //CameraPane.theRenderer.object = group;
2964
+ //Globals.theRenderer.object = group;
27832965 if(!useclient)
27842966 {
27852967 cameraView.renderCamera = radio.camera;
....@@ -2788,7 +2970,8 @@
27882970 cameraView.cameras[cameraView.cameracount] = radio.camera;
27892971 cameraView.targetLookAt.set(radio.camera.lookAt);
27902972 cameraView.object = group;
2791
- cameraView.lighttouched = true;
2973
+ //cameraView.lighttouched = true;
2974
+ Globals.lighttouched = true;
27922975 topView.object = group;
27932976 frontView.object = group;
27942977 sideView.object = group;
....@@ -2824,7 +3007,7 @@
28243007 if (useclient)
28253008 {
28263009 cameraView.object = client;
2827
- cameraView.lighttouched = true;
3010
+ Globals.lighttouched = true;
28283011 //topView.object = client;
28293012 //frontView.object = client;
28303013 //sideView.object = client;
....@@ -2832,7 +3015,7 @@
28323015 else
28333016 {
28343017 cameraView.object = group;
2835
- cameraView.lighttouched = true;
3018
+ Globals.lighttouched = true;
28363019 //topView.object = group;
28373020 //frontView.object = group;
28383021 //sideView.object = group;
....@@ -3065,9 +3248,9 @@
30653248 obj = (Object3D)e.nextElement();
30663249
30673250 System.out.println("Object is: " + obj);
3068
- GraphreeD.AnalyzeObject(obj);
3251
+ GrafreeD.AnalyzeObject(obj);
30693252 System.out.println("Boundary rep: " + obj.bRep);
3070
- GraphreeD.AnalyzeObject(obj.bRep);
3253
+ GrafreeD.AnalyzeObject(obj.bRep);
30713254
30723255 // System.err.println((size/1024) + " KB is the size of " + obj);
30733256 }
....@@ -3109,6 +3292,13 @@
31093292 void GenNormals(boolean crease)
31103293 {
31113294 group.GenNormalsS(crease);
3295
+
3296
+ refreshContents();
3297
+ }
3298
+
3299
+ void GenNormalsMINE()
3300
+ {
3301
+ group.selection.GenNormalsMINE();
31123302
31133303 refreshContents();
31143304 }
....@@ -3157,104 +3347,250 @@
31573347
31583348 //Object3D buffer;
31593349 cVector temp = new cVector();
3160
- BoundaryRep temprep;
3161
- Object3D nodes;
3162
- Vector<Vertex> vertices;
3163
-
3164
- public void Vertex(Object3D node, Vertex v)
3165
- {
3166
- vertices.add(v);
3167
- nodes.addElement(node);
3168
-
3169
- if (temprep.GetCache(v) != null)
3170
- {
3171
- temprep.Remove(v);
3172
- }
3173
- else
3174
- {
3175
- temprep.Remember(v);
3176
- }
3177
- }
3178
-
3179
- public void Face(Object3D node, Face f)
3180
- {
3181
-
3182
- }
3183
-
3350
+// BoundaryRep temprep;
3351
+// Object3D nodes;
3352
+// Vector<Vertex> vertices;
3353
+//
3354
+// cGroup buffer;
3355
+//
3356
+// public void Vertex(Object3D node, Vertex v)
3357
+// {
3358
+//// vertices.add(v);
3359
+//// nodes.addElement(node);
3360
+////
3361
+//// if (temprep.GetCache(v) != null)
3362
+//// {
3363
+//// temprep.Remove(v);
3364
+//// } else
3365
+//// {
3366
+//// temprep.Remember(v);
3367
+//// }
3368
+//
3369
+// //Object3D node = nodes.get(index);
3370
+// temp.set(v); // vertices.get(index)); // temprep.GetVertex(k));
3371
+// // System.out.println("temp = " + temp.x + ", " + temp.y + ", " + temp.z);
3372
+//
3373
+// LA.xformPos(temp, node.GlobalTransformInv(), temp);
3374
+//
3375
+// // System.out.println("tem+ = " + temp.x + ", " + temp.y + ", " + temp.z);
3376
+//
3377
+// cGroup g = new cGroup();
3378
+//
3379
+// if (g.toParent == null)
3380
+// {
3381
+// g.toParent = LA.newMatrix();
3382
+// g.fromParent = LA.newMatrix();
3383
+// }
3384
+// LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
3385
+// LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
3386
+//
3387
+// g.add(GrafreeD.clipboard);
3388
+//
3389
+// buffer.add(g);
3390
+// }
3391
+//
3392
+// public void Face(Object3D node, Face f)
3393
+// {
3394
+//
3395
+// }
3396
+//
3397
+// void ParseVerticesOld() // ??
3398
+// {
3399
+// //if (group.selection.size() != 1)
3400
+// // return;
3401
+//
3402
+// temprep = new BoundaryRep();
3403
+// nodes = new Object3D();
3404
+// vertices = new Vector<Vertex>();
3405
+//
3406
+// boolean epsequal = GrafreeD.epsequal;
3407
+// GrafreeD.epsequal = true;
3408
+//
3409
+// for (int i=0; i<group.selection.size(); i++)
3410
+// {
3411
+// Object3D buffer = new cGroup(group.selection.get(i).name + "+");
3412
+//
3413
+// group.selection.get(i).Parse(
3414
+//this );
3415
+//
3416
+// int repsize = temprep.VertexCount();
3417
+// int tablesize = temprep.vertextable.size();
3418
+// int nodesize = nodes.size();
3419
+//
3420
+// assert(vertices.size() == nodes.size());
3421
+//
3422
+// temprep.vertextable.elements();
3423
+//
3424
+// java.util.Set<java.util.Map.Entry<Vertex,Vertex>> set = temprep.vertextable.entrySet();
3425
+//
3426
+// for (java.util.Map.Entry<Vertex,Vertex> entry : set)
3427
+// {
3428
+// cGroup g = new cGroup();
3429
+//
3430
+// int index = vertices.indexOf(entry.getValue()); // temprep.vertextable.(k));
3431
+//
3432
+// Object3D node = nodes.get(index);
3433
+// temp.set(vertices.get(index)); // temprep.GetVertex(k));
3434
+// // System.out.println("temp = " + temp.x + ", " + temp.y + ", " + temp.z);
3435
+//
3436
+// LA.xformPos(temp, node.GlobalTransformInv(), temp);
3437
+//
3438
+// // System.out.println("tem+ = " + temp.x + ", " + temp.y + ", " + temp.z);
3439
+//
3440
+// if (g.toParent == null)
3441
+// {
3442
+// g.toParent = LA.newMatrix();
3443
+// g.fromParent = LA.newMatrix();
3444
+// }
3445
+// LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
3446
+// LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
3447
+//
3448
+// g.add(GrafreeD.clipboard);
3449
+//
3450
+// buffer.add(g);
3451
+// }
3452
+//
3453
+// makeSomething(buffer, i==group.selection.size()-1);
3454
+// }
3455
+//
3456
+// GrafreeD.epsequal = epsequal;
3457
+//
3458
+// //buffer = null;
3459
+// temprep = null;
3460
+// nodes = null;
3461
+//
3462
+// refreshContents();
3463
+// }
3464
+
31843465 void ParseVertices()
31853466 {
3186
- //if (group.selection.size() != 1)
3187
- // return;
3188
-
3189
- temprep = new BoundaryRep();
3190
- nodes = new Object3D();
3191
- vertices = new Vector<Vertex>();
3192
-
3193
- boolean epsequal = GraphreeD.epsequal;
3194
- GraphreeD.epsequal = true;
3467
+ boolean epsequal = GrafreeD.epsequal;
3468
+ GrafreeD.epsequal = true;
31953469
31963470 for (int i=0; i<group.selection.size(); i++)
31973471 {
3198
- Object3D buffer = new cGroup(group.selection.get(i).name + "+");
3472
+ final cGroup buffer = new cGroup(group.selection.get(i).name + "+");
31993473
3200
- group.selection.get(i).Parse(this);
3201
-
3202
- int repsize = temprep.VertexCount();
3203
- int tablesize = temprep.vertextable.size();
3204
- int nodesize = nodes.size();
3474
+ group.selection.get(i).Parse(
3475
+
3476
+ new iParse()
3477
+ {
3478
+ public void Vertex(Object3D node, Vertex v)
3479
+ {
3480
+ temp.set(v);
3481
+ LA.xformPos(temp, node.GlobalTransformInv(), temp);
32053482
3206
- assert(vertices.size() == nodes.size());
3207
-
3208
- temprep.vertextable.elements();
3209
-
3210
- java.util.Set<java.util.Map.Entry<Vertex,Vertex>> set = temprep.vertextable.entrySet();
3483
+ cGroup g = new cGroup();
32113484
3212
- for (java.util.Map.Entry<Vertex,Vertex> entry : set)
3213
- {
3214
- cGroup g = new cGroup();
3485
+ if (g.toParent == null)
3486
+ {
3487
+ g.toParent = LA.newMatrix();
3488
+ g.fromParent = LA.newMatrix();
3489
+ }
3490
+ LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
3491
+ LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
32153492
3216
- int index = vertices.indexOf(entry.getValue()); // temprep.vertextable.(k));
3217
- Object3D node = nodes.get(index);
3218
- temp.set(vertices.get(index)); // temprep.GetVertex(k));
3219
- // System.out.println("temp = " + temp.x + ", " + temp.y + ", " + temp.z);
3493
+ g.add(GrafreeD.clipboard);
32203494
3221
- LA.xformPos(temp, node.GlobalTransformInv(), temp);
3222
-
3223
- // System.out.println("tem+ = " + temp.x + ", " + temp.y + ", " + temp.z);
3224
-
3225
- if (g.toParent == null)
3226
- {
3227
- g.toParent = LA.newMatrix();
3228
- g.fromParent = LA.newMatrix();
3229
- }
3230
- LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
3231
- LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
3495
+ buffer.add(g);
3496
+ }
32323497
3233
- g.add(GraphreeD.clipboard);
3498
+ public void Face(Object3D node, Face f)
3499
+ {
32343500
3235
- buffer.add(g);
3236
- }
3501
+ }
3502
+ }
3503
+ );
32373504
32383505 makeSomething(buffer, i==group.selection.size()-1);
32393506 }
32403507
3241
- GraphreeD.epsequal = epsequal;
3242
-
3243
- //buffer = null;
3244
- temprep = null;
3245
- nodes = null;
3508
+ GrafreeD.epsequal = epsequal;
32463509
32473510 refreshContents();
32483511 }
3249
-
3512
+
3513
+ void TextureVertices()
3514
+ {
3515
+ for (int i=0; i<group.selection.size(); i++)
3516
+ {
3517
+ group.selection.get(i).Parse(
3518
+ new iParse()
3519
+ {
3520
+ public void Vertex(Object3D node, Vertex v)
3521
+ {
3522
+ cTexture tex = node.GetTextures();
3523
+ String pigment = Object3D.GetPigment(tex);
3524
+ //String bump = Object3D.GetBump(tex);
3525
+
3526
+ com.sun.opengl.util.texture.TextureData texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
3527
+
3528
+ double s = v.s;
3529
+
3530
+ if (s == 1)
3531
+ s = 0;
3532
+
3533
+ double t = v.t;
3534
+
3535
+ if (t == 1)
3536
+ t = 0;
3537
+
3538
+ int indexs = (int) (texturedata.getWidth() * s);
3539
+ int indext = (int) (texturedata.getHeight() * t);
3540
+
3541
+ int index = indext * texturedata.getWidth() + indexs;
3542
+
3543
+ java.nio.ByteBuffer bytebuf = (java.nio.ByteBuffer)texturedata.getBuffer();
3544
+
3545
+ int slide = bytebuf.capacity() / texturedata.getWidth() / texturedata.getHeight();
3546
+
3547
+ float scale = bytebuf.get(index*slide) & 0xFF;
3548
+ scale += bytebuf.get(index*slide+1) & 0xFF;
3549
+ scale += bytebuf.get(index*slide+2) & 0xFF;
3550
+ scale /= 3;
3551
+
3552
+ scale /= 0xFF;
3553
+ // c'est quoi ca? scale /= 4;
3554
+
3555
+ //v.AO = scale;
3556
+
3557
+ v.x += v.norm.x * scale;
3558
+ v.y += v.norm.y * scale;
3559
+ v.z += v.norm.z * scale;
3560
+ }
3561
+
3562
+ public void Face(Object3D node, Face f)
3563
+ {
3564
+ }
3565
+ }
3566
+ );
3567
+ }
3568
+
3569
+ refreshContents();
3570
+ }
3571
+
32503572 void Align()
32513573 {
3574
+ if (group.selection.size() == 0)
3575
+ return;
3576
+
3577
+ cVector bbmin = new cVector();
3578
+ cVector bbmax = new cVector();
3579
+
3580
+ group.selection.get(0).getBounds(bbmin, bbmax, true);
3581
+
3582
+ double dx = bbmax.x - bbmin.x;
3583
+ double dy = bbmax.y - bbmin.y;
3584
+ double dz = bbmax.z - bbmin.z;
3585
+
3586
+ double scale = Math.sqrt(dx*dx + dy*dy + dz*dz);
3587
+
32523588 for (int i=0; i<group.selection.size(); i++)
32533589 {
32543590 Object3D obj = group.selection.get(i);
32553591
3256
- LA.matTranslate(obj.toParent, i/2f, 0, 0);
3257
- LA.matTranslateInv(obj.fromParent, -i/2f, 0, 0);
3592
+ LA.matTranslate(obj.toParent, i * scale, 0, 0);
3593
+ LA.matTranslateInv(obj.fromParent, -i * scale, 0, 0);
32583594 }
32593595
32603596 refreshContents();
....@@ -3267,7 +3603,7 @@
32673603 // ref.SaveSupports();
32683604 // Object3D par = ref.parent;
32693605 // ref.parent = null;
3270
-// Object3D lowres = (Object3D) GraphreeD.clone(ref);
3606
+// Object3D lowres = (Object3D) GrafreeD.clone(ref);
32713607 // ref.parent = par;
32723608 // ref.RestoreSupports();
32733609
....@@ -3297,7 +3633,7 @@
32973633 // lowres.SaveSupports();
32983634 // par = lowres.parent;
32993635 // lowres.parent = null;
3300
-// Object3D newlow = (Object3D) GraphreeD.clone(lowres);
3636
+// Object3D newlow = (Object3D) GrafreeD.clone(lowres);
33013637 Object3D newlow = CloneObject(lowres, false);
33023638 newlow.name = sn.switchobject.get(i).name;
33033639 System.out.println(" pose#" + i + " = " + newlow);
....@@ -3319,7 +3655,7 @@
33193655 return;
33203656
33213657 Object3D poses = group.selection.get(0);
3322
- Object3D ref = GraphreeD.clipboard.get(0);
3658
+ Object3D ref = GrafreeD.clipboard.get(0);
33233659
33243660 Object3D newgroup = new Object3D("Po:" + poses.name);
33253661
....@@ -3488,7 +3824,7 @@
34883824 group.selection.RelinkToSupport(); // july 2014
34893825 System.out.println("DONE.");
34903826 refreshContents();
3491
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
3827
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
34923828 }
34933829
34943830 void ReduceMesh(boolean reduction34)
....@@ -3513,20 +3849,20 @@
35133849
35143850 void ClipMesh()
35153851 {
3516
- if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
3852
+ if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
35173853 {
3518
- Object3D content = GraphreeD.clipboard.get(0);
3854
+ Object3D content = GrafreeD.clipboard.get(0);
35193855
35203856 if (content instanceof cGroup && ((cGroup)content).transientlink )
35213857 content = ((cGroup)content).get(0);
35223858
35233859 // for (int i=0; i<group.selection.size(); i++)
35243860 // {
3525
-// group.selection.get(i).ClipMesh(GraphreeD.clipboard);
3861
+// group.selection.get(i).ClipMesh(GrafreeD.clipboard);
35263862 // }
3527
- group.selection.ClipMesh(GraphreeD.clipboard);
3863
+ group.selection.ClipMesh(GrafreeD.clipboard);
35283864 }
3529
-// group.selection.ClipMesh(GraphreeD.clipboard);
3865
+// group.selection.ClipMesh(GrafreeD.clipboard);
35303866 System.out.println("DONE.");
35313867 refreshContents();
35323868 }
....@@ -3764,25 +4100,25 @@
37644100 System.err.println("info : " + child.GetPath());
37654101 }
37664102 }
3767
- else
3768
- {
3769
- objEditor.SetMaterial(group); // .GetMaterial());
3770
- objEditor.AddInfo(group, this, true); // .GetMaterial());
3771
- System.err.println("info : " + group.GetPath());
3772
- }
4103
+// else
4104
+// {
4105
+// objEditor.SetMaterial(group); // .GetMaterial());
4106
+// objEditor.AddInfo(group, this, true); // .GetMaterial());
4107
+// System.err.println("info : " + group.GetPath());
4108
+// }
37734109
37744110 objEditor.SetText(); // jan 2014
37754111
3776
- if (flashIt && !CameraPane.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
4112
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
37774113 CameraPane.flash = true;
37784114
37794115 if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
37804116 // a camera
37814117 {
37824118 CameraPane.camerachangeframe = 0; // don't refuse it
3783
- CameraPane.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
3784
- // CameraPane.theRenderer.renderCamera = CameraPane.theRenderer.manipCamera;
3785
- // CameraPane.theRenderer.eyeCamera = CameraPane.theRenderer.manipCamera;
4119
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4120
+ // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
4121
+ // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
37864122 }
37874123
37884124 refreshContents();
....@@ -3864,12 +4200,12 @@
38644200 {
38654201 if (group.selection.isEmpty())
38664202 return;
3867
- GraphreeD.clipboardIsTempGroup = false;
4203
+ GrafreeD.clipboardIsTempGroup = false;
38684204 Composite tGroup = null;
38694205 if (group.selection.size() > 0) // 1)
38704206 {
38714207 tGroup = new cGroup();
3872
- GraphreeD.clipboardIsTempGroup = true;
4208
+ GrafreeD.clipboardIsTempGroup = true;
38734209 }
38744210
38754211 if (cut)
....@@ -3909,16 +4245,16 @@
39094245 //System.out.println("cut " + child);
39104246 //System.out.println("parent = " + child.parent);
39114247 // tmp.addChild(child);
3912
- if (GraphreeD.clipboardIsTempGroup)
4248
+ if (GrafreeD.clipboardIsTempGroup)
39134249 tGroup.add/*Child*/(tmp);
39144250 else
3915
- GraphreeD.clipboard = tmp;
4251
+ GrafreeD.clipboard = tmp;
39164252 }
39174253 else
3918
- if (GraphreeD.clipboardIsTempGroup)
4254
+ if (GrafreeD.clipboardIsTempGroup)
39194255 tGroup.add/*Child*/(child);
39204256 else
3921
- GraphreeD.clipboard = child;
4257
+ GrafreeD.clipboard = child;
39224258 }
39234259
39244260 //ResetModel();
....@@ -3950,21 +4286,21 @@
39504286 //System.out.println("cut " + elem);
39514287 //System.out.println("parent = " + elem.parent);
39524288 // tmp.addChild(elem);
3953
- if (GraphreeD.clipboardIsTempGroup)
4289
+ if (GrafreeD.clipboardIsTempGroup)
39544290 tGroup.add/*Child*/(tmp);
39554291 else
3956
- GraphreeD.clipboard = tmp;
4292
+ GrafreeD.clipboard = tmp;
39574293 }
39584294 else
3959
- if (GraphreeD.clipboardIsTempGroup)
4295
+ if (GrafreeD.clipboardIsTempGroup)
39604296 tGroup.add/*Child*/(child);
39614297 else
3962
- GraphreeD.clipboard = child;
4298
+ GrafreeD.clipboard = child;
39634299 }
39644300
39654301 }
3966
- if (GraphreeD.clipboardIsTempGroup)
3967
- GraphreeD.clipboard = tGroup;
4302
+ if (GrafreeD.clipboardIsTempGroup)
4303
+ GrafreeD.clipboard = tGroup;
39684304 if (cut)
39694305 {
39704306 ResetModel();
....@@ -3974,11 +4310,11 @@
39744310
39754311 void paste(boolean expand)
39764312 {
3977
- // if (GraphreeD.clipboard == null)
4313
+ // if (GrafreeD.clipboard == null)
39784314 // return;
39794315 boolean first = true;
39804316
3981
- if (GraphreeD.clipboardIsTempGroup)
4317
+ if (GrafreeD.clipboardIsTempGroup)
39824318 {
39834319 Composite temp;
39844320
....@@ -3989,7 +4325,7 @@
39894325 temp = (Composite)Applet3D.clipboard.deepCopy();
39904326 */
39914327 Object3D elem;
3992
- for (Enumeration e = /*temp.children*/GraphreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
4328
+ for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
39934329 {
39944330 Object3D child = (Object3D)e.nextElement();
39954331
....@@ -4003,7 +4339,7 @@
40034339 else
40044340 elem = child.deepCopy(); // ?
40054341 child.parent = keepparent;
4006
- //if (GraphreeD.clipboardIsTempGroup && LA.isIdentity(elem.fromParent))
4342
+ //if (GrafreeD.clipboardIsTempGroup && LA.isIdentity(elem.fromParent))
40074343 // elem = elem.get(0);
40084344 makeSomething(elem, true); // ?? first);
40094345 //group.addChild(elem);
....@@ -4023,14 +4359,14 @@
40234359 //Object3D cb = Applet3D.clipboard;
40244360 //temp.addChild(cb);
40254361 //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0));
4026
- assert(GraphreeD.clipboard.parent == null);
4027
- Object3D /*Composite*/ keepparent = GraphreeD.clipboard.get(0).parent;
4028
- GraphreeD.clipboard.get(0).parent = null; // Avoid copy?
4029
- if (LA.isIdentity(GraphreeD.clipboard.toParent))
4030
- makeSomething(expand?GraphreeD.clipboard.get(0).copyExpand():GraphreeD.clipboard.get(0).deepCopy());
4362
+ assert(GrafreeD.clipboard.parent == null);
4363
+ Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
4364
+ GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
4365
+ if (LA.isIdentity(GrafreeD.clipboard.toParent))
4366
+ makeSomething(expand?GrafreeD.clipboard.get(0).copyExpand():GrafreeD.clipboard.get(0).deepCopy());
40314367 else
4032
- makeSomething(expand?GraphreeD.clipboard.copyExpand():GraphreeD.clipboard.deepCopy());
4033
- GraphreeD.clipboard.get(0).parent = keepparent;
4368
+ makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4369
+ GrafreeD.clipboard.get(0).parent = keepparent;
40344370 }
40354371
40364372 ResetModel();
....@@ -4039,7 +4375,7 @@
40394375
40404376 void pasteInto(boolean copyit)
40414377 {
4042
-// if (GraphreeD.clipboard == null)
4378
+// if (GrafreeD.clipboard == null)
40434379 // return;
40444380
40454381 if (group.selection.size() != 1)
....@@ -4072,9 +4408,9 @@
40724408 {
40734409 boolean first = true;
40744410
4075
- if (GraphreeD.clipboardIsTempGroup)
4411
+ if (GrafreeD.clipboardIsTempGroup)
40764412 {
4077
- Composite temp = (Composite)GraphreeD.clipboard;
4413
+ Composite temp = (Composite)GrafreeD.clipboard;
40784414 Object3D copy;
40794415 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
40804416 {
....@@ -4084,7 +4420,7 @@
40844420 }
40854421 } else
40864422 {
4087
- linkSomething(GraphreeD.clipboard); //.get(0));
4423
+ linkSomething(GrafreeD.clipboard); //.get(0));
40884424 }
40894425 }
40904426 }
....@@ -4276,6 +4612,26 @@
42764612 makeSomething(csg);
42774613 }
42784614
4615
+ void Ungroup(Object3D g)
4616
+ {
4617
+ if (g instanceof HiddenObject)
4618
+ {
4619
+ HiddenObject h = (HiddenObject) g;
4620
+
4621
+ for (int i=0; i<h.ActualSize(); i++)
4622
+ {
4623
+ objEditor.makeSomething(h.get(i), false);
4624
+ }
4625
+ }
4626
+ else
4627
+ {
4628
+ for (int i=0; i<g.Size(); i++)
4629
+ {
4630
+ objEditor.makeSomething(g.get(i), false);
4631
+ }
4632
+ }
4633
+ }
4634
+
42794635 void ungroup()
42804636 {
42814637 /*
....@@ -4471,7 +4827,7 @@
44714827
44724828 void ImportGFD()
44734829 {
4474
- FileDialog browser = new FileDialog(objEditor.frame, "Import GraphreeD", FileDialog.LOAD);
4830
+ FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD);
44754831 browser.show();
44764832 String filename = browser.getFile();
44774833 if (filename != null && filename.length() > 0)
....@@ -4509,7 +4865,7 @@
45094865
45104866 void ImportVRMLX3D()
45114867 {
4512
- if (GraphreeD.standAlone)
4868
+ if (GrafreeD.standAlone)
45134869 {
45144870 /**/
45154871 FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
....@@ -4526,7 +4882,7 @@
45264882
45274883 String GetFile(String dialogName)
45284884 {
4529
- if (GraphreeD.standAlone)
4885
+ if (GrafreeD.standAlone)
45304886 {
45314887 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
45324888 browser.show();
....@@ -4635,6 +4991,7 @@
46354991 private MenuItem resetsupportItem;
46364992 private MenuItem resetreferencesItem;
46374993 private MenuItem linkverticesItem;
4994
+ private MenuItem relinkverticesItem;
46384995 private MenuItem setMasterItem;
46394996 private MenuItem resetMeshItem;
46404997 private MenuItem stepAllItem;
....@@ -4653,8 +5010,10 @@
46535010 private MenuItem clearItem;
46545011 private MenuItem clearAllItem;
46555012 private MenuItem genUVItem;
5013
+ private MenuItem genNormalsMESHItem;
46565014 private MenuItem genNormalsCADItem;
46575015 private MenuItem genNormalsORGANItem;
5016
+ private MenuItem genNormalsMINEItem;
46585017 private MenuItem stripifyItem;
46595018 private MenuItem unstripifyItem;
46605019 private MenuItem trimItem;
....@@ -4696,6 +5055,7 @@
46965055 private MenuItem resetCentroidItem;
46975056 private MenuItem transformgeometryItem;
46985057 private MenuItem resetTransformItem;
5058
+ private MenuItem hideItem;
46995059 private MenuItem grabItem;
47005060 private MenuItem backItem;
47015061 private MenuItem frontItem;
....@@ -4716,6 +5076,7 @@
47165076
47175077 private MenuItem resetParentItem;
47185078 private MenuItem repairParentItem;
5079
+ private MenuItem repairShadowItem;
47195080 private MenuItem sortbysizeItem;
47205081 private MenuItem sortbynameItem;
47215082
....@@ -4728,12 +5089,15 @@
47285089 private MenuItem particleItem;
47295090 private MenuItem ragdollItem;
47305091 private MenuItem ragdoll2Item;
5092
+ private MenuItem heightFieldItem;
5093
+ private MenuItem textureFieldItem;
47315094 private MenuItem gridItem;
47325095 private MenuItem rectoidItem;
47335096 private MenuItem ellipsoidItem;
47345097 private MenuItem coneItem;
47355098 private MenuItem torusItem;
47365099 private MenuItem superItem;
5100
+ private MenuItem kleinItem;
47375101 private MenuItem blobItem;
47385102 private MenuItem latheItem;
47395103 private MenuItem bezierItem;
....@@ -4746,6 +5110,7 @@
47465110 private MenuItem csgItem;
47475111 private MenuItem templateItem;
47485112 private MenuItem textureItem;
5113
+ private MenuItem billboardItem;
47495114 private MenuItem shadowXItem;
47505115 private MenuItem shadowYItem;
47515116 private MenuItem shadowZItem;