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
....@@ -171,6 +171,14 @@
171171 //editItem.addActionListener(this);
172172 duplicateItem = menu.add(new MenuItem("Duplicate"));
173173 duplicateItem.addActionListener(this);
174
+ cloneItem = menu.add(new MenuItem("Clone"));
175
+ cloneItem.addActionListener(this);
176
+ if (Globals.ADVANCED)
177
+ {
178
+ cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
179
+ cloneSupportItem.addActionListener(this);
180
+ }
181
+ menu.add("-");
174182 cutItem = menu.add(new MenuItem("Cut"));
175183 cutItem.addActionListener(this);
176184 copyItem = menu.add(new MenuItem("Copy"));
....@@ -178,10 +186,7 @@
178186 pasteItem = menu.add(new MenuItem("Paste"));
179187 pasteItem.addActionListener(this);
180188 menu.add("-");
181
- cloneItem = menu.add(new MenuItem("Clone"));
182
- cloneItem.addActionListener(this);
183
- cloneSupportItem = menu.add(new MenuItem("Clone (+supports)"));
184
- cloneSupportItem.addActionListener(this);
189
+
185190 menu.add("-");
186191 pasteIntoItem = menu.add(new MenuItem("Paste into"));
187192 pasteIntoItem.addActionListener(this);
....@@ -272,6 +277,7 @@
272277
273278 if (Globals.ADVANCED)
274279 {
280
+ menu.add("-");
275281 physicsItem = menu.add(new MenuItem("Physics"));
276282 physicsItem.addActionListener(this);
277283 frameselectorItem = menu.add(new MenuItem("Frame Selector"));
....@@ -297,6 +303,7 @@
297303 shadowZItem.addActionListener(this);
298304 if (Globals.ADVANCED)
299305 {
306
+ menu.add("-");
300307 linkerItem = menu.add(new MenuItem("Linker"));
301308 linkerItem.addActionListener(this);
302309 attributeItem = menu.add(new MenuItem("Attribute"));
....@@ -305,14 +312,18 @@
305312 templateItem.addActionListener(this);
306313 pointflowItem = menu.add(new MenuItem("Point Flow"));
307314 pointflowItem.addActionListener(this);
308
- menu.add("-");
309315 }
316
+ menu.add("-");
310317 resetTransformItem = menu.add(new MenuItem("Reset Transform"));
311318 resetTransformItem.addActionListener(this);
312319 resetCentroidItem = menu.add(new MenuItem("Reset Centroid"));
313320 resetCentroidItem.addActionListener(this);
314
- transformgeometryItem = menu.add(new MenuItem("Transform Geometry"));
315
- 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);
316327
317328 oe.menuBar.add(menu = new Menu("Geometry"));
318329 genUVItem = menu.add(new MenuItem("Generate UV"));
....@@ -415,31 +426,35 @@
415426 sortbysizeItem.addActionListener(this);
416427 sortbynameItem = menu.add(new MenuItem("Sort by name"));
417428 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);
418434 if (Globals.ADVANCED)
419435 {
420
- menu.add("-");
436
+ // Pretty much the same as duplicate and clone.
421437 extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
422438 extractGeometriesItem.addActionListener(this);
423439 cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry"));
424440 cloneGeometriesItem.addActionListener(this);
425
- shareGeometriesItem = menu.add(new MenuItem("Share Geometry"));
426
- shareGeometriesItem.addActionListener(this);
427
- mergeGeometriesItem = menu.add(new MenuItem("Merge Geometry"));
428
- mergeGeometriesItem.addActionListener(this);
429441 }
430442
431443 oe.menuBar.add(menu = new Menu("Insert"));
432444 buildCreateMenu(menu);
433445
434446 oe.menuBar.add(menu = new Menu("Include"));
435
- importGFDItem = menu.add(new MenuItem("GrafreeD Object..."));
436
- importGFDItem.addActionListener(this);
437
- importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D Object..."));
438
- importVRMLX3DItem.addActionListener(this);
439
- importOBJItem = menu.add(new MenuItem("OBJ Object..."));
447
+ importOBJItem = menu.add(new MenuItem("OBJ file..."));
440448 importOBJItem.addActionListener(this);
441
- import3DSItem = menu.add(new MenuItem("3DS Object..."));
449
+ menu.add("-");
450
+ import3DSItem = menu.add(new MenuItem("3DS file..."));
442451 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);
443458
444459 oe.menuBar.add(menu = new Menu("Tools"));
445460 buildToolsMenu(menu);
....@@ -481,7 +496,7 @@
481496 liveCB.setToolTipText("Enabled animation");
482497 liveCB.addItemListener(this);
483498
484
- oe.toolbarPanel.add(oneStepButton = new cButton("Step", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
499
+ oe.toolbarPanel.add(oneStepButton = new cButton("Step", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
485500 oneStepButton.setToolTipText("Animate one step forward");
486501 oneStepButton.addActionListener(this);
487502
....@@ -493,7 +508,7 @@
493508 trackCB.setToolTipText("Enable tracking");
494509 trackCB.addItemListener(this);
495510
496
- oe.toolbarPanel.add(screenfitButton = new cButton("@", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
511
+ oe.toolbarPanel.add(screenfitButton = new cButton("@", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
497512 screenfitButton.setToolTipText("Screen fit");
498513 screenfitButton.addActionListener(this);
499514
....@@ -502,39 +517,39 @@
502517
503518 if (Globals.ADVANCED)
504519 {
505
- oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
520
+ oe.toolbarPanel.add(snapobjectButton = new cButton("O+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
506521 snapobjectButton.addActionListener(this);
507522 snapobjectButton.setToolTipText("Snap Object");
508523 }
509524
510
- oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
525
+ oe.toolbarPanel.add(flashSelectionButton = new cButton("?", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
511526 flashSelectionButton.setToolTipText("Show selection");
512527 flashSelectionButton.addActionListener(this);
513528
514529 oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
515530
516
- oe.toolbarPanel.add(twoButton = new cButton("|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
531
+ oe.toolbarPanel.add(twoButton = new cButton("|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
517532 twoButton.setToolTipText("Show center view only");
518533 twoButton.addActionListener(this);
519
- oe.toolbarPanel.add(fourButton = new cButton("+||", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
534
+ oe.toolbarPanel.add(fourButton = new cButton("+||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
520535 fourButton.addActionListener(this);
521536 fourButton.setToolTipText("Show left panel only");
522
- oe.toolbarPanel.add(sixButton = new cButton("+|+|", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
537
+ oe.toolbarPanel.add(sixButton = new cButton("+|+|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
523538 sixButton.setToolTipText("2-column layout left");
524539 sixButton.addActionListener(this);
525
- oe.toolbarPanel.add(threeButton = new cButton("|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
540
+ oe.toolbarPanel.add(threeButton = new cButton("|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
526541 threeButton.setToolTipText("2-column layout right");
527542 threeButton.addActionListener(this);
528
- oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
543
+ oe.toolbarPanel.add(sevenButton = new cButton("+|+|+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
529544 sevenButton.setToolTipText("3-column layout");
530545 sevenButton.addActionListener(this);
531546 //
532547
533
- 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);
534549 rootButton.setToolTipText("Edit selection in new tab");
535550 rootButton.addActionListener(this);
536551
537
- oe.toolbarPanel.add(closeButton = new cButton("X", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
552
+ oe.toolbarPanel.add(closeButton = new cButton("X", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
538553 closeButton.setToolTipText("Close tab");
539554 closeButton.addActionListener(this);
540555 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
....@@ -542,11 +557,11 @@
542557
543558 cGridBag commandsPanel = new cGridBag();
544559
545
- commandsPanel.add(editButton = new cButton("+", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
560
+ commandsPanel.add(editButton = new cButton("+", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
546561 editButton.setToolTipText("Edit selection");
547562 editButton.addActionListener(this);
548563
549
- commandsPanel.add(uneditButton = new cButton("-", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
564
+ commandsPanel.add(uneditButton = new cButton("-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
550565 uneditButton.setToolTipText("Unedit selection");
551566 uneditButton.addActionListener(this);
552567
....@@ -554,11 +569,11 @@
554569 allParamsButton.setToolTipText("Edit all params");
555570 allParamsButton.addActionListener(this);
556571
557
- commandsPanel.add(clearPanelButton = new cButton("C", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
572
+ commandsPanel.add(clearPanelButton = new cButton("C", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
558573 clearPanelButton.setToolTipText("Clear edit panel");
559574 clearPanelButton.addActionListener(this);
560575
561
- commandsPanel.add(unselectButton = new cButton("U", !GrafreeD.NIMBUSLAF)); //, oe.aConstraints);
576
+ commandsPanel.add(unselectButton = new cButton("U", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
562577 unselectButton.setToolTipText("Unselect");
563578 unselectButton.addActionListener(this);
564579
....@@ -641,7 +656,7 @@
641656 zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
642657 zoomBoxCB.addItemListener(this);
643658
644
- if (Globals.ADVANCED)
659
+ if (true) // Globals.ADVANCED)
645660 {
646661 panel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT)); //, constraints);
647662 supportCB.setToolTipText("Enable rigging");
....@@ -930,7 +945,9 @@
930945 // objEditor.DropFile((java.io.File[]) object, true);
931946 // return;
932947 // }
933
- if (string.charAt(0) == '/')
948
+
949
+ // File path for Mac and Windows
950
+ if (string.charAt(0) == '/' || string.charAt(1) == ':')
934951 {
935952 // file(s)
936953 String[] names = string.split("\n");
....@@ -957,7 +974,7 @@
957974
958975 flashIt = false;
959976 CameraPane pane = (CameraPane) target;
960
- pane.clickStart(objEditor.location.x, objEditor.location.y, 0);
977
+ pane.clickStart(objEditor.location.x, objEditor.location.y, 0, 0);
961978 pane.clickEnd(objEditor.location.x, objEditor.location.y, 0, true);
962979
963980 if (group.selection.size() == 1)
....@@ -1164,13 +1181,13 @@
11641181 parseverticesItem.addActionListener(this);
11651182 textureFieldItem = menu.add(new MenuItem("Texture Field"));
11661183 textureFieldItem.addActionListener(this);
1167
- alignItem = menu.add(new MenuItem("Align Object"));
1184
+ alignItem = menu.add(new MenuItem("Align Objects"));
11681185 alignItem.addActionListener(this);
11691186 reduceMorphItem = menu.add(new MenuItem("Reduce Morphs"));
11701187 reduceMorphItem.addActionListener(this);
11711188 reduce34MorphItem = menu.add(new MenuItem("Reduce Morphs (34)"));
11721189 reduce34MorphItem.addActionListener(this);
1173
-
1190
+ menu.add("-");
11741191 menu.add(computeAOItem = new MenuItem("Compute AO"));
11751192 computeAOItem.addActionListener(this);
11761193
....@@ -1530,9 +1547,9 @@
15301547
15311548 void Overwrite(int mask)
15321549 {
1533
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
1550
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
15341551 {
1535
- Object3D content = GrafreeD.clipboard.get(0);
1552
+ Object3D content = Grafreed.clipboard.get(0);
15361553
15371554 if (content instanceof cGroup && ((cGroup)content).transientlink )
15381555 content = ((cGroup)content).get(0);
....@@ -1852,7 +1869,15 @@
18521869 } else
18531870 if (source == importOBJItem)
18541871 {
1855
- 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
+ }
18561881 } else
18571882 if (source == computeAOItem)
18581883 {
....@@ -1872,7 +1897,7 @@
18721897 if (source == invariantsItem)
18731898 {
18741899 System.out.println("Invariants:");
1875
- GrafreeD.grafreeD.universe.invariants();
1900
+ Grafreed.grafreeD.universe.invariants();
18761901 } else
18771902 if (source == memoryItem)
18781903 {
....@@ -1947,10 +1972,10 @@
19471972 } else
19481973 if (source == duplicateItem)
19491974 {
1950
- Object3D keep = GrafreeD.clipboard;
1975
+ Object3D keep = Grafreed.clipboard;
19511976 loadClipboard(false);
19521977 paste(false);
1953
- GrafreeD.clipboard = keep;
1978
+ Grafreed.clipboard = keep;
19541979 } else
19551980 if (source == cloneItem)
19561981 {
....@@ -2170,9 +2195,9 @@
21702195 // group.selection.get(0).setMasterThis(content); // should be identity
21712196 // refreshContents();
21722197 // }
2173
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
2198
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
21742199 {
2175
- Object3D content = GrafreeD.clipboard.get(0);
2200
+ Object3D content = Grafreed.clipboard.get(0);
21762201
21772202 if (content instanceof cGroup && ((cGroup)content).transientlink )
21782203 content = ((cGroup)content).get(0);
....@@ -2222,9 +2247,9 @@
22222247 } else
22232248 if (source == setMasterItem)
22242249 {
2225
- if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
2250
+ if (group.selection.size() == 1 && Grafreed.clipboard.size() == 1)
22262251 {
2227
- Object3D content = GrafreeD.clipboard.get(0);
2252
+ Object3D content = Grafreed.clipboard.get(0);
22282253
22292254 if (content instanceof cGroup && ((cGroup)content).transientlink )
22302255 content = ((cGroup)content).get(0);
....@@ -2237,9 +2262,9 @@
22372262 {
22382263 if (group.selection.size() == 1)
22392264 {
2240
- if (GrafreeD.clipboard.size() == 1)
2265
+ if (Grafreed.clipboard.size() == 1)
22412266 {
2242
- Object3D content = GrafreeD.clipboard.get(0);
2267
+ Object3D content = Grafreed.clipboard.get(0);
22432268
22442269 if (content instanceof cGroup && ((cGroup)content).transientlink )
22452270 content = ((cGroup)content).get(0);
....@@ -2594,9 +2619,13 @@
25942619 {
25952620 SmoothMesh();
25962621 } else
2597
- if (source == transformgeometryItem)
2622
+ if (source == transformGeometryItem)
25982623 {
25992624 TransformGeometry();
2625
+ } else
2626
+ if (source == transformChildrenItem)
2627
+ {
2628
+ TransformChildren();
26002629 } else
26012630 if (source == resetTransformItem)
26022631 {
....@@ -2604,7 +2633,11 @@
26042633 } else
26052634 if (source == resetCentroidItem)
26062635 {
2607
- ResetCentroid();
2636
+ ResetCentroid(true);
2637
+ } else
2638
+ if (source == resetCentroidXZItem)
2639
+ {
2640
+ ResetCentroid(false);
26082641 } else
26092642 if (source == resetParentItem)
26102643 {
....@@ -3120,6 +3153,28 @@
31203153 refreshContents();
31213154 }
31223155
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
+ }
31233178
31243179 void ResetTransform()
31253180 {
....@@ -3232,7 +3287,7 @@
32323287 refreshContents();
32333288 }
32343289
3235
- void ResetCentroid()
3290
+ void ResetCentroid(boolean full)
32363291 {
32373292 Object3D obj;
32383293 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -3247,12 +3302,16 @@
32473302 LA.matIdentity(Object3D.mat);
32483303 obj.getBounds(minima, maxima, false);
32493304 Object3D.mat[3][0] = -(minima.x + maxima.x)/2;
3250
- Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
3305
+ if (full)
3306
+ Object3D.mat[3][1] = -(minima.y + maxima.y)/2;
32513307 Object3D.mat[3][2] = -(minima.z + maxima.z)/2;
32523308 obj.TransformMesh(Object3D.mat);
3309
+
32533310 Object3D.mat[3][0] = (minima.x + maxima.x)/2;
3254
- Object3D.mat[3][1] = (minima.y + maxima.y)/2;
3311
+ if (full)
3312
+ Object3D.mat[3][1] = (minima.y + maxima.y)/2;
32553313 Object3D.mat[3][2] = (minima.z + maxima.z)/2;
3314
+
32563315 LA.matConcat(Object3D.mat, obj.toParent, obj.toParent);
32573316 //Object3D.mat[3][0] = -Object3D.mat[3][0];
32583317 //Object3D.mat[3][1] = -Object3D.mat[3][1];
....@@ -3318,9 +3377,9 @@
33183377 obj = (Object3D)e.nextElement();
33193378
33203379 System.out.println("Object is: " + obj);
3321
- GrafreeD.AnalyzeObject(obj);
3380
+ Grafreed.AnalyzeObject(obj);
33223381 System.out.println("Boundary rep: " + obj.bRep);
3323
- GrafreeD.AnalyzeObject(obj.bRep);
3382
+ Grafreed.AnalyzeObject(obj.bRep);
33243383
33253384 // System.err.println((size/1024) + " KB is the size of " + obj);
33263385 }
....@@ -3534,8 +3593,8 @@
35343593
35353594 void ParseVertices()
35363595 {
3537
- boolean epsequal = GrafreeD.epsequal;
3538
- GrafreeD.epsequal = true;
3596
+ boolean epsequal = Grafreed.epsequal;
3597
+ Grafreed.epsequal = true;
35393598
35403599 for (int i=0; i<group.selection.size(); i++)
35413600 {
....@@ -3560,7 +3619,7 @@
35603619 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
35613620 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
35623621
3563
- g.add(GrafreeD.clipboard);
3622
+ g.add(Grafreed.clipboard);
35643623
35653624 buffer.add(g);
35663625 }
....@@ -3575,7 +3634,7 @@
35753634 makeSomething(buffer, i==group.selection.size()-1);
35763635 }
35773636
3578
- GrafreeD.epsequal = epsequal;
3637
+ Grafreed.epsequal = epsequal;
35793638
35803639 refreshContents();
35813640 }
....@@ -3725,7 +3784,7 @@
37253784 return;
37263785
37273786 Object3D poses = group.selection.get(0);
3728
- Object3D ref = GrafreeD.clipboard.get(0);
3787
+ Object3D ref = Grafreed.clipboard.get(0);
37293788
37303789 Object3D newgroup = new Object3D("Po:" + poses.name);
37313790
....@@ -3919,9 +3978,9 @@
39193978
39203979 void ClipMesh()
39213980 {
3922
- if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
3981
+ if (/*group.selection.size() == 1 &&*/ Grafreed.clipboard.size() == 1)
39233982 {
3924
- Object3D content = GrafreeD.clipboard.get(0);
3983
+ Object3D content = Grafreed.clipboard.get(0);
39253984
39263985 if (content instanceof cGroup && ((cGroup)content).transientlink )
39273986 content = ((cGroup)content).get(0);
....@@ -3930,7 +3989,7 @@
39303989 // {
39313990 // group.selection.get(i).ClipMesh(GrafreeD.clipboard);
39323991 // }
3933
- group.selection.ClipMesh(GrafreeD.clipboard);
3992
+ group.selection.ClipMesh(Grafreed.clipboard);
39343993 }
39353994 // group.selection.ClipMesh(GrafreeD.clipboard);
39363995 System.out.println("DONE.");
....@@ -4270,12 +4329,12 @@
42704329 {
42714330 if (group.selection.isEmpty())
42724331 return;
4273
- GrafreeD.clipboardIsTempGroup = false;
4332
+ Grafreed.clipboardIsTempGroup = false;
42744333 Composite tGroup = null;
42754334 if (group.selection.size() > 0) // 1)
42764335 {
42774336 tGroup = new cGroup();
4278
- GrafreeD.clipboardIsTempGroup = true;
4337
+ Grafreed.clipboardIsTempGroup = true;
42794338 }
42804339
42814340 if (cut)
....@@ -4315,16 +4374,16 @@
43154374 //System.out.println("cut " + child);
43164375 //System.out.println("parent = " + child.parent);
43174376 // tmp.addChild(child);
4318
- if (GrafreeD.clipboardIsTempGroup)
4377
+ if (Grafreed.clipboardIsTempGroup)
43194378 tGroup.add/*Child*/(tmp);
43204379 else
4321
- GrafreeD.clipboard = tmp;
4380
+ Grafreed.clipboard = tmp;
43224381 }
43234382 else
4324
- if (GrafreeD.clipboardIsTempGroup)
4383
+ if (Grafreed.clipboardIsTempGroup)
43254384 tGroup.add/*Child*/(child);
43264385 else
4327
- GrafreeD.clipboard = child;
4386
+ Grafreed.clipboard = child;
43284387 }
43294388
43304389 //ResetModel();
....@@ -4356,21 +4415,21 @@
43564415 //System.out.println("cut " + elem);
43574416 //System.out.println("parent = " + elem.parent);
43584417 // tmp.addChild(elem);
4359
- if (GrafreeD.clipboardIsTempGroup)
4418
+ if (Grafreed.clipboardIsTempGroup)
43604419 tGroup.add/*Child*/(tmp);
43614420 else
4362
- GrafreeD.clipboard = tmp;
4421
+ Grafreed.clipboard = tmp;
43634422 }
43644423 else
4365
- if (GrafreeD.clipboardIsTempGroup)
4424
+ if (Grafreed.clipboardIsTempGroup)
43664425 tGroup.add/*Child*/(child);
43674426 else
4368
- GrafreeD.clipboard = child;
4427
+ Grafreed.clipboard = child;
43694428 }
43704429
43714430 }
4372
- if (GrafreeD.clipboardIsTempGroup)
4373
- GrafreeD.clipboard = tGroup;
4431
+ if (Grafreed.clipboardIsTempGroup)
4432
+ Grafreed.clipboard = tGroup;
43744433 if (cut)
43754434 {
43764435 ResetModel();
....@@ -4384,7 +4443,7 @@
43844443 // return;
43854444 boolean first = true;
43864445
4387
- if (GrafreeD.clipboardIsTempGroup)
4446
+ if (Grafreed.clipboardIsTempGroup)
43884447 {
43894448 Composite temp;
43904449
....@@ -4395,7 +4454,7 @@
43954454 temp = (Composite)Applet3D.clipboard.deepCopy();
43964455 */
43974456 Object3D elem;
4398
- 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))
43994458 {
44004459 Object3D child = (Object3D)e.nextElement();
44014460
....@@ -4429,14 +4488,14 @@
44294488 //Object3D cb = Applet3D.clipboard;
44304489 //temp.addChild(cb);
44314490 //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0));
4432
- assert(GrafreeD.clipboard.parent == null);
4433
- Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
4434
- GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
4435
- if (LA.isIdentity(GrafreeD.clipboard.toParent))
4436
- 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());
44374496 else
4438
- makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4439
- GrafreeD.clipboard.get(0).parent = keepparent;
4497
+ makeSomething(expand?Grafreed.clipboard.copyExpand():Grafreed.clipboard.deepCopy());
4498
+ Grafreed.clipboard.get(0).parent = keepparent;
44404499 }
44414500
44424501 ResetModel();
....@@ -4485,9 +4544,9 @@
44854544 {
44864545 boolean first = true;
44874546
4488
- if (GrafreeD.clipboardIsTempGroup)
4547
+ if (Grafreed.clipboardIsTempGroup)
44894548 {
4490
- Composite temp = (Composite)GrafreeD.clipboard;
4549
+ Composite temp = (Composite)Grafreed.clipboard;
44914550 Object3D copy;
44924551 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
44934552 {
....@@ -4497,7 +4556,7 @@
44974556 }
44984557 } else
44994558 {
4500
- linkSomething(GrafreeD.clipboard); //.get(0));
4559
+ linkSomething(Grafreed.clipboard); //.get(0));
45014560 }
45024561 }
45034562 }
....@@ -4942,7 +5001,7 @@
49425001
49435002 void ImportVRMLX3D()
49445003 {
4945
- if (GrafreeD.standAlone)
5004
+ if (Grafreed.standAlone)
49465005 {
49475006 /**/
49485007 FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
....@@ -4959,7 +5018,7 @@
49595018
49605019 String GetFile(String dialogName)
49615020 {
4962
- if (GrafreeD.standAlone)
5021
+ if (Grafreed.standAlone)
49635022 {
49645023 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
49655024 browser.show();
....@@ -5133,8 +5192,10 @@
51335192 private MenuItem panoTexturesItem;
51345193
51355194 private MenuItem resetCentroidItem;
5136
- private MenuItem transformgeometryItem;
5195
+ private MenuItem resetCentroidXZItem;
51375196 private MenuItem resetTransformItem;
5197
+ private MenuItem transformGeometryItem;
5198
+ private MenuItem transformChildrenItem;
51385199 private MenuItem hideItem;
51395200 private MenuItem grabItem;
51405201 private MenuItem backItem;