Normand Briere
2019-05-13 f924d3e00db476c06f55f3d5aaef307e17575340
GroupEditor.java
....@@ -98,14 +98,14 @@
9898
9999 void CloneClipboard(boolean supports)
100100 {
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));
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));
106106 else
107
- makeSomething(CloneObject(GrafreeD.clipboard, false));
108
- GrafreeD.clipboard.get(0).parent = keepparent;
107
+ makeSomething(CloneObject(Grafreed.clipboard, false));
108
+ Grafreed.clipboard.get(0).parent = keepparent;
109109 }
110110
111111 static Object3D CloneObject(Object3D obj, boolean supports)
....@@ -119,7 +119,7 @@
119119 // obj.support = null;
120120 if (!supports)
121121 obj.SaveSupports();
122
- Object3D clone = (Object3D)GrafreeD.clone(obj);
122
+ Object3D clone = (Object3D)Grafreed.clone(obj);
123123 obj.parent = parent;
124124 // obj.support = support;
125125 // clone.support = support; // aout 2013
....@@ -318,8 +318,12 @@
318318 resetTransformItem.addActionListener(this);
319319 resetCentroidItem = menu.add(new MenuItem("Reset Centroid"));
320320 resetCentroidItem.addActionListener(this);
321
- transformgeometryItem = menu.add(new MenuItem("Transform Geometry"));
322
- transformgeometryItem.addActionListener(this);
321
+ resetCentroidXZItem = menu.add(new MenuItem("Reset Centroid XY"));
322
+ resetCentroidXZItem.addActionListener(this);
323
+ transformGeometryItem = menu.add(new MenuItem("Transform Geometry"));
324
+ transformGeometryItem.addActionListener(this);
325
+ transformChildrenItem = menu.add(new MenuItem("Transform Children"));
326
+ transformChildrenItem.addActionListener(this);
323327
324328 oe.menuBar.add(menu = new Menu("Geometry"));
325329 genUVItem = menu.add(new MenuItem("Generate UV"));
....@@ -422,31 +426,35 @@
422426 sortbysizeItem.addActionListener(this);
423427 sortbynameItem = menu.add(new MenuItem("Sort by name"));
424428 sortbynameItem.addActionListener(this);
429
+ menu.add("-");
430
+ shareGeometriesItem = menu.add(new MenuItem("Share Geometries"));
431
+ shareGeometriesItem.addActionListener(this);
432
+ mergeGeometriesItem = menu.add(new MenuItem("Merge Geometries"));
433
+ mergeGeometriesItem.addActionListener(this);
425434 if (Globals.ADVANCED)
426435 {
427
- menu.add("-");
436
+ // Pretty much the same as duplicate and clone.
428437 extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
429438 extractGeometriesItem.addActionListener(this);
430439 cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry"));
431440 cloneGeometriesItem.addActionListener(this);
432
- shareGeometriesItem = menu.add(new MenuItem("Share Geometry"));
433
- shareGeometriesItem.addActionListener(this);
434
- mergeGeometriesItem = menu.add(new MenuItem("Merge Geometry"));
435
- mergeGeometriesItem.addActionListener(this);
436441 }
437442
438443 oe.menuBar.add(menu = new Menu("Insert"));
439444 buildCreateMenu(menu);
440445
441446 oe.menuBar.add(menu = new Menu("Include"));
442
- importGFDItem = menu.add(new MenuItem("GrafreeD Object..."));
443
- importGFDItem.addActionListener(this);
444
- importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D Object..."));
445
- importVRMLX3DItem.addActionListener(this);
446
- importOBJItem = menu.add(new MenuItem("OBJ Object..."));
447
+ importOBJItem = menu.add(new MenuItem("OBJ file..."));
447448 importOBJItem.addActionListener(this);
448
- import3DSItem = menu.add(new MenuItem("3DS Object..."));
449
+ menu.add("-");
450
+ import3DSItem = menu.add(new MenuItem("3DS file..."));
449451 import3DSItem.addActionListener(this);
452
+ menu.add("-");
453
+ importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D file..."));
454
+ importVRMLX3DItem.addActionListener(this);
455
+ menu.add("-");
456
+ importGFDItem = menu.add(new MenuItem("GrafreeD file..."));
457
+ importGFDItem.addActionListener(this);
450458
451459 oe.menuBar.add(menu = new Menu("Tools"));
452460 buildToolsMenu(menu);
....@@ -488,7 +496,7 @@
488496 liveCB.setToolTipText("Enabled animation");
489497 liveCB.addItemListener(this);
490498
491
- oe.toolbarPanel.add(oneStepButton = new cButton("Step", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
499
+ oe.toolbarPanel.add(oneStepButton = new cButton("Step", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
492500 oneStepButton.setToolTipText("Animate one step forward");
493501 oneStepButton.addActionListener(this);
494502
....@@ -500,7 +508,7 @@
500508 trackCB.setToolTipText("Enable tracking");
501509 trackCB.addItemListener(this);
502510
503
- oe.toolbarPanel.add(screenfitButton = new cButton("@", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
511
+ oe.toolbarPanel.add(screenfitButton = new cButton("@", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
504512 screenfitButton.setToolTipText("Screen fit");
505513 screenfitButton.addActionListener(this);
506514
....@@ -509,39 +517,39 @@
509517
510518 if (Globals.ADVANCED)
511519 {
512
- oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
520
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
513521 snapobjectButton.addActionListener(this);
514522 snapobjectButton.setToolTipText("Snap Object");
515523 }
516524
517
- oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
525
+ oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
518526 flashSelectionButton.setToolTipText("Show selection");
519527 flashSelectionButton.addActionListener(this);
520528
521529 oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
522530
523
- oe.toolbarPanel.add(twoButton = new cButton("|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
531
+ oe.toolbarPanel.add(twoButton = new cButton("|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
524532 twoButton.setToolTipText("Show center view only");
525533 twoButton.addActionListener(this);
526
- oe.toolbarPanel.add(fourButton = new cButton("+||", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
534
+ oe.toolbarPanel.add(fourButton = new cButton("+||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
527535 fourButton.addActionListener(this);
528536 fourButton.setToolTipText("Show left panel only");
529
- oe.toolbarPanel.add(sixButton = new cButton("+|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
537
+ oe.toolbarPanel.add(sixButton = new cButton("+|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
530538 sixButton.setToolTipText("2-column layout left");
531539 sixButton.addActionListener(this);
532
- oe.toolbarPanel.add(threeButton = new cButton("|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
540
+ oe.toolbarPanel.add(threeButton = new cButton("|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
533541 threeButton.setToolTipText("2-column layout right");
534542 threeButton.addActionListener(this);
535
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
543
+ oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
536544 sevenButton.setToolTipText("3-column layout");
537545 sevenButton.addActionListener(this);
538546 //
539547
540
- oe.toolbarPanel.add(rootButton = new cButton("o o o", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
548
+ oe.toolbarPanel.add(rootButton = new cButton("o o o", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
541549 rootButton.setToolTipText("Edit selection in new tab");
542550 rootButton.addActionListener(this);
543551
544
- oe.toolbarPanel.add(closeButton = new cButton("X", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
552
+ oe.toolbarPanel.add(closeButton = new cButton("X", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
545553 closeButton.setToolTipText("Close tab");
546554 closeButton.addActionListener(this);
547555 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
....@@ -549,11 +557,11 @@
549557
550558 cGridBag commandsPanel = new cGridBag();
551559
552
- commandsPanel.add(editButton = new cButton("+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
560
+ commandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
553561 editButton.setToolTipText("Edit selection");
554562 editButton.addActionListener(this);
555563
556
- commandsPanel.add(uneditButton = new cButton("-", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
564
+ commandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
557565 uneditButton.setToolTipText("Unedit selection");
558566 uneditButton.addActionListener(this);
559567
....@@ -561,11 +569,11 @@
561569 allParamsButton.setToolTipText("Edit all params");
562570 allParamsButton.addActionListener(this);
563571
564
- commandsPanel.add(clearPanelButton = new cButton("C", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
572
+ commandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
565573 clearPanelButton.setToolTipText("Clear edit panel");
566574 clearPanelButton.addActionListener(this);
567575
568
- commandsPanel.add(unselectButton = new cButton("U", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
576
+ commandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
569577 unselectButton.setToolTipText("Unselect");
570578 unselectButton.addActionListener(this);
571579
....@@ -648,7 +656,7 @@
648656 zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
649657 zoomBoxCB.addItemListener(this);
650658
651
- if (Globals.ADVANCED)
659
+ if (true) // Globals.ADVANCED)
652660 {
653661 panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
654662 supportCB.setToolTipText("Enable rigging");
....@@ -937,7 +945,9 @@
937945 // objEditor.DropFile((java.io.File[]) object, true);
938946 // return;
939947 // }
940
- if (string.charAt(0) == '/')
948
+
949
+ // File path for Mac and Windows
950
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
941951 {
942952 // file(s)
943953 String[] names = string.split("\n");
....@@ -964,7 +974,7 @@
964974
965975 flashIt = false;
966976 CameraPane pane = (CameraPane) target;
967
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
977
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
968978 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
969979
970980 if (group.selection.size() == 1)
....@@ -1537,9 +1547,9 @@
15371547
15381548 void Overwrite(int mask)
15391549 {
1540
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
1550
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
15411551 {
1542
- Object3D content = GrafreeD.clipboard.get(0);
1552
+ Object3D content = Grafreed.clipboard.get(0);
15431553
15441554 if (content instanceof cGroup && ((cGroup)content).transientlink )
15451555 content = ((cGroup)content).get(0);
....@@ -1859,7 +1869,15 @@
18591869 } else
18601870 if (source == importOBJItem)
18611871 {
1862
- objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1872
+ //objEditor.ImportJME(new com.jmex.model.converters.ObjToJme(), "obj", "Import OBJ");
1873
+ FileDialog browser = new FileDialog(frame, "Import OBJ", FileDialog.LOAD);
1874
+ browser.setVisible(true);
1875
+ String filename = browser.getFile();
1876
+ if (filename != null && filename.length() > 0)
1877
+ {
1878
+ String fullname = browser.getDirectory() + filename;
1879
+ makeSomething(ReadOBJ(fullname), true);
1880
+ }
18631881 } else
18641882 if (source == computeAOItem)
18651883 {
....@@ -1879,7 +1897,7 @@
18791897 if (source == invariantsItem)
18801898 {
18811899 System.out.println("Invariants:");
1882
- GrafreeD.grafreeD.universe.invariants();
1900
+ Grafreed.grafreeD.universe.invariants();
18831901 } else
18841902 if (source == memoryItem)
18851903 {
....@@ -1954,10 +1972,10 @@
19541972 } else
19551973 if (source == duplicateItem)
19561974 {
1957
- Object3D keep = GrafreeD.clipboard;
1975
+ Object3D keep = Grafreed.clipboard;
19581976 loadClipboard(false);
19591977 paste(false);
1960
- GrafreeD.clipboard = keep;
1978
+ Grafreed.clipboard = keep;
19611979 } else
19621980 if (source == cloneItem)
19631981 {
....@@ -2177,9 +2195,9 @@
21772195 // group.selection.get(0).setMasterThis(content); // should be identity
21782196 // refreshContents();
21792197 // }
2180
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2198
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
21812199 {
2182
- Object3D content = GrafreeD.clipboard.get(0);
2200
+ Object3D content = Grafreed.clipboard.get(0);
21832201
21842202 if (content instanceof cGroup && ((cGroup)content).transientlink )
21852203 content = ((cGroup)content).get(0);
....@@ -2229,9 +2247,9 @@
22292247 } else
22302248 if (source == setMasterItem)
22312249 {
2232
- if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
2250
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
22332251 {
2234
- Object3D content = GrafreeD.clipboard.get(0);
2252
+ Object3D content = Grafreed.clipboard.get(0);
22352253
22362254 if (content instanceof cGroup && ((cGroup)content).transientlink )
22372255 content = ((cGroup)content).get(0);
....@@ -2244,9 +2262,9 @@
22442262 {
22452263 if (group.selection.size() == 1)
22462264 {
2247
- if (GrafreeD.clipboard.size() == 1)
2265
+ if (Grafreed.clipboard.size() == 1)
22482266 {
2249
- Object3D content = GrafreeD.clipboard.get(0);
2267
+ Object3D content = Grafreed.clipboard.get(0);
22502268
22512269 if (content instanceof cGroup && ((cGroup)content).transientlink )
22522270 content = ((cGroup)content).get(0);
....@@ -2601,9 +2619,13 @@
26012619 {
26022620 SmoothMesh();
26032621 } else
2604
- if (source == transformgeometryItem)
2622
+ if (source == transformGeometryItem)
26052623 {
26062624 TransformGeometry();
2625
+ } else
2626
+ if (source == transformChildrenItem)
2627
+ {
2628
+ TransformChildren();
26072629 } else
26082630 if (source == resetTransformItem)
26092631 {
....@@ -2611,7 +2633,11 @@
26112633 } else
26122634 if (source == resetCentroidItem)
26132635 {
2614
- ResetCentroid();
2636
+ ResetCentroid(true);
2637
+ } else
2638
+ if (source == resetCentroidXZItem)
2639
+ {
2640
+ ResetCentroid(false);
26152641 } else
26162642 if (source == resetParentItem)
26172643 {
....@@ -3127,6 +3153,28 @@
31273153 refreshContents();
31283154 }
31293155
3156
+ void TransformChildren()
3157
+ {
3158
+ Object3D obj;
3159
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
3160
+ {
3161
+ obj = (Object3D)e.nextElement();
3162
+ obj.KeepTextureMatrices();
3163
+ obj.TransformChildren();
3164
+ obj.RestoreTextureMatrices();
3165
+
3166
+// if (obj.parent == null)
3167
+// {
3168
+// System.out.println("NULL PARENT!");
3169
+// new Exception().printStackTrace();
3170
+// }
3171
+// else
3172
+// TouchTransform(obj);
3173
+// //obj.parent.Touch();
3174
+ }
3175
+
3176
+ refreshContents();
3177
+ }
31303178
31313179 void ResetTransform()
31323180 {
....@@ -3239,7 +3287,7 @@
32393287 refreshContents();
32403288 }
32413289
3242
- void ResetCentroid()
3290
+ void ResetCentroid(boolean full)
32433291 {
32443292 Object3D obj;
32453293 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3254,12 +3302,16 @@
32543302 LA.matIdentity(Object3D.mat);
32553303 obj.getBounds(minima, maxima, false);
32563304 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3257
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3305
+ if (full)
3306
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
32583307 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
32593308 obj.TransformMesh(Object3D.mat);
3309
+
32603310 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3261
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3311
+ if (full)
3312
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
32623313 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3314
+
32633315 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
32643316 //Object3D.mat[3][0] = -Object3D.mat[3][0];
32653317 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3325,9 +3377,9 @@
33253377 obj = (Object3D)e.nextElement();
33263378
33273379 System.out.println("Object is: " + obj);
3328
- GrafreeD.AnalyzeObject(obj);
3380
+ Grafreed.AnalyzeObject(obj);
33293381 System.out.println("Boundary rep: " + obj.bRep);
3330
- GrafreeD.AnalyzeObject(obj.bRep);
3382
+ Grafreed.AnalyzeObject(obj.bRep);
33313383
33323384 // System.err.println((size/1024) + " KB is the size of " + obj);
33333385 }
....@@ -3541,8 +3593,8 @@
35413593
35423594 void ParseVertices()
35433595 {
3544
- boolean epsequal = GrafreeD.epsequal;
3545
- GrafreeD.epsequal = true;
3596
+ boolean epsequal = Grafreed.epsequal;
3597
+ Grafreed.epsequal = true;
35463598
35473599 for (int i=0; i<group.selection.size(); i++)
35483600 {
....@@ -3567,7 +3619,7 @@
35673619 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
35683620 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
35693621
3570
- g.add(GrafreeD.clipboard);
3622
+ g.add(Grafreed.clipboard);
35713623
35723624 buffer.add(g);
35733625 }
....@@ -3582,7 +3634,7 @@
35823634 makeSomething(buffer, i==group.selection.size()-1);
35833635 }
35843636
3585
- GrafreeD.epsequal = epsequal;
3637
+ Grafreed.epsequal = epsequal;
35863638
35873639 refreshContents();
35883640 }
....@@ -3732,7 +3784,7 @@
37323784 return;
37333785
37343786 Object3D poses = group.selection.get(0);
3735
- Object3D ref = GrafreeD.clipboard.get(0);
3787
+ Object3D ref = Grafreed.clipboard.get(0);
37363788
37373789 Object3D newgroup = new Object3D("Po:" + poses.name);
37383790
....@@ -3926,9 +3978,9 @@
39263978
39273979 void ClipMesh()
39283980 {
3929
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
3981
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
39303982 {
3931
- Object3D content = GrafreeD.clipboard.get(0);
3983
+ Object3D content = Grafreed.clipboard.get(0);
39323984
39333985 if (content instanceof cGroup && ((cGroup)content).transientlink )
39343986 content = ((cGroup)content).get(0);
....@@ -3937,7 +3989,7 @@
39373989 // {
39383990 // group.selection.get(i).ClipMesh(GrafreeD.clipboard);
39393991 // }
3940
- group.selection.ClipMesh(GrafreeD.clipboard);
3992
+ group.selection.ClipMesh(Grafreed.clipboard);
39413993 }
39423994 // group.selection.ClipMesh(GrafreeD.clipboard);
39433995 System.out.println("DONE.");
....@@ -4277,12 +4329,12 @@
42774329 {
42784330 if (group.selection.isEmpty())
42794331 return;
4280
- GrafreeD.clipboardIsTempGroup = false;
4332
+ Grafreed.clipboardIsTempGroup = false;
42814333 Composite tGroup = null;
42824334 if (group.selection.size() > 0) // 1)
42834335 {
42844336 tGroup = new cGroup();
4285
- GrafreeD.clipboardIsTempGroup = true;
4337
+ Grafreed.clipboardIsTempGroup = true;
42864338 }
42874339
42884340 if (cut)
....@@ -4322,16 +4374,16 @@
43224374 //System.out.println("cut " + child);
43234375 //System.out.println("parent = " + child.parent);
43244376 // tmp.addChild(child);
4325
- if (GrafreeD.clipboardIsTempGroup)
4377
+ if (Grafreed.clipboardIsTempGroup)
43264378 tGroup.add/*Child*/(tmp);
43274379 else
4328
- GrafreeD.clipboard = tmp;
4380
+ Grafreed.clipboard = tmp;
43294381 }
43304382 else
4331
- if (GrafreeD.clipboardIsTempGroup)
4383
+ if (Grafreed.clipboardIsTempGroup)
43324384 tGroup.add/*Child*/(child);
43334385 else
4334
- GrafreeD.clipboard = child;
4386
+ Grafreed.clipboard = child;
43354387 }
43364388
43374389 //ResetModel();
....@@ -4363,21 +4415,21 @@
43634415 //System.out.println("cut " + elem);
43644416 //System.out.println("parent = " + elem.parent);
43654417 // tmp.addChild(elem);
4366
- if (GrafreeD.clipboardIsTempGroup)
4418
+ if (Grafreed.clipboardIsTempGroup)
43674419 tGroup.add/*Child*/(tmp);
43684420 else
4369
- GrafreeD.clipboard = tmp;
4421
+ Grafreed.clipboard = tmp;
43704422 }
43714423 else
4372
- if (GrafreeD.clipboardIsTempGroup)
4424
+ if (Grafreed.clipboardIsTempGroup)
43734425 tGroup.add/*Child*/(child);
43744426 else
4375
- GrafreeD.clipboard = child;
4427
+ Grafreed.clipboard = child;
43764428 }
43774429
43784430 }
4379
- if (GrafreeD.clipboardIsTempGroup)
4380
- GrafreeD.clipboard = tGroup;
4431
+ if (Grafreed.clipboardIsTempGroup)
4432
+ Grafreed.clipboard = tGroup;
43814433 if (cut)
43824434 {
43834435 ResetModel();
....@@ -4391,7 +4443,7 @@
43914443 // return;
43924444 boolean first = true;
43934445
4394
- if (GrafreeD.clipboardIsTempGroup)
4446
+ if (Grafreed.clipboardIsTempGroup)
43954447 {
43964448 Composite temp;
43974449
....@@ -4402,7 +4454,7 @@
44024454 temp = (Composite)Applet3D.clipboard.deepCopy();
44034455 */
44044456 Object3D elem;
4405
- for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
4457
+ for (Enumeration e = /*temp.children*/Grafreed.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
44064458 {
44074459 Object3D child = (Object3D)e.nextElement();
44084460
....@@ -4436,14 +4488,14 @@
44364488 //Object3D cb = Applet3D.clipboard;
44374489 //temp.addChild(cb);
44384490 //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0));
4439
- assert(GrafreeD.clipboard.parent == null);
4440
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
4441
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
4442
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
4443
- makeSomething(expand?GrafreeD.clipboard.get(0).copyExpand():GrafreeD.clipboard.get(0).deepCopy());
4491
+ assert(Grafreed.clipboard.parent == null);
4492
+ Object3D /*Composite*/ keepparent = Grafreed.clipboard.get(0).parent;
4493
+ Grafreed.clipboard.get(0).parent = null; // Avoid copy?
4494
+ if (LA.isIdentity(Grafreed.clipboard.toParent))
4495
+ makeSomething(expand?Grafreed.clipboard.get(0).copyExpand():Grafreed.clipboard.get(0).deepCopy());
44444496 else
4445
- makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4446
- GrafreeD.clipboard.get(0).parent = keepparent;
4497
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
4498
+ Grafreed.clipboard.get(0).parent = keepparent;
44474499 }
44484500
44494501 ResetModel();
....@@ -4492,9 +4544,9 @@
44924544 {
44934545 boolean first = true;
44944546
4495
- if (GrafreeD.clipboardIsTempGroup)
4547
+ if (Grafreed.clipboardIsTempGroup)
44964548 {
4497
- Composite temp = (Composite)GrafreeD.clipboard;
4549
+ Composite temp = (Composite)Grafreed.clipboard;
44984550 Object3D copy;
44994551 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
45004552 {
....@@ -4504,7 +4556,7 @@
45044556 }
45054557 } else
45064558 {
4507
- linkSomething(GrafreeD.clipboard); //.get(0));
4559
+ linkSomething(Grafreed.clipboard); //.get(0));
45084560 }
45094561 }
45104562 }
....@@ -4949,7 +5001,7 @@
49495001
49505002 void ImportVRMLX3D()
49515003 {
4952
- if (GrafreeD.standAlone)
5004
+ if (Grafreed.standAlone)
49535005 {
49545006 /**/
49555007 FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
....@@ -4966,7 +5018,7 @@
49665018
49675019 String GetFile(String dialogName)
49685020 {
4969
- if (GrafreeD.standAlone)
5021
+ if (Grafreed.standAlone)
49705022 {
49715023 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
49725024 browser.show();
....@@ -5140,8 +5192,10 @@
51405192 private MenuItem panoTexturesItem;
51415193
51425194 private MenuItem resetCentroidItem;
5143
- private MenuItem transformgeometryItem;
5195
+ private MenuItem resetCentroidXZItem;
51445196 private MenuItem resetTransformItem;
5197
+ private MenuItem transformGeometryItem;
5198
+ private MenuItem transformChildrenItem;
51455199 private MenuItem hideItem;
51465200 private MenuItem grabItem;
51475201 private MenuItem backItem;