Normand Briere
2019-04-28 f1c718cce66e5651a0dae91375db6ebfaded1a92
GroupEditor.java
....@@ -83,7 +83,7 @@
8383
8484 void CloneSelection(boolean supports)
8585 {
86
- // Object3D keep = GraphreeD.clipboard;
86
+ // Object3D keep = GrafreeD.clipboard;
8787 //Object3D obj;
8888 for (int i=0; i<group.selection.size(); i++)// Enumeration e = group.selection.elements(); e.hasMoreElements();)
8989 {
....@@ -97,14 +97,14 @@
9797
9898 void CloneClipboard(boolean supports)
9999 {
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));
100
+ assert(GrafreeD.clipboard.parent == null);
101
+ Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
102
+ GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
103
+ if (LA.isIdentity(GrafreeD.clipboard.toParent))
104
+ makeSomething(CloneObject(GrafreeD.clipboard.get(0), false));
105105 else
106
- makeSomething(CloneObject(GraphreeD.clipboard, false));
107
- GraphreeD.clipboard.get(0).parent = keepparent;
106
+ makeSomething(CloneObject(GrafreeD.clipboard, false));
107
+ GrafreeD.clipboard.get(0).parent = keepparent;
108108 }
109109
110110 static Object3D CloneObject(Object3D obj, boolean supports)
....@@ -118,7 +118,7 @@
118118 // obj.support = null;
119119 if (!supports)
120120 obj.SaveSupports();
121
- Object3D clone = (Object3D)GraphreeD.clone(obj);
121
+ Object3D clone = (Object3D)GrafreeD.clone(obj);
122122 obj.parent = parent;
123123 // obj.support = support;
124124 // clone.support = support; // aout 2013
....@@ -219,18 +219,24 @@
219219 resetsupportItem.addActionListener(this);
220220 linkverticesItem = menu.add(new MenuItem("Link to Support"));
221221 linkverticesItem.addActionListener(this);
222
+ relinkverticesItem = menu.add(new MenuItem("Re-link to Support"));
223
+ relinkverticesItem.addActionListener(this);
222224 setMasterItem = menu.add(new MenuItem("Set Master Mesh"));
223225 setMasterItem.addActionListener(this);
224226
225227 oe.menuBar.add(menu = new Menu("Group"));
226228 grabItem = menu.add(new MenuItem("Grab"));
227229 grabItem.addActionListener(this);
228
- frontItem = menu.add(new MenuItem("Front"));
229
- frontItem.addActionListener(this);
230230 backItem = menu.add(new MenuItem("Back"));
231231 backItem.addActionListener(this);
232
+ frontItem = menu.add(new MenuItem("Front"));
233
+ frontItem.addActionListener(this);
232234 compositeItem = menu.add(new MenuItem("Composite"));
233235 compositeItem.addActionListener(this);
236
+ hideItem = menu.add(new MenuItem("Hide"));
237
+ hideItem.addActionListener(this);
238
+ ungroupItem = menu.add(new MenuItem("Ungroup"));
239
+ ungroupItem.addActionListener(this);
234240 menu.add("-");
235241 randomItem = menu.add(new MenuItem("Random"));
236242 randomItem.addActionListener(this);
....@@ -252,6 +258,8 @@
252258 oe.menuBar.add(menu = new Menu("Object"));
253259 textureItem = menu.add(new MenuItem("Texture"));
254260 textureItem.addActionListener(this);
261
+ billboardItem = menu.add(new MenuItem("Billboard"));
262
+ billboardItem.addActionListener(this);
255263 csgItem = menu.add(new MenuItem("CSG"));
256264 csgItem.addActionListener(this);
257265 shadowXItem = menu.add(new MenuItem("Shadow X"));
....@@ -269,14 +277,12 @@
269277 pointflowItem = menu.add(new MenuItem("Point Flow"));
270278 pointflowItem.addActionListener(this);
271279 menu.add("-");
272
- transformgeometryItem = menu.add(new MenuItem("Transform Geometry"));
273
- transformgeometryItem.addActionListener(this);
274280 resetTransformItem = menu.add(new MenuItem("Reset Transform"));
275281 resetTransformItem.addActionListener(this);
276282 resetCentroidItem = menu.add(new MenuItem("Reset Centroid"));
277283 resetCentroidItem.addActionListener(this);
278
- ungroupItem = menu.add(new MenuItem("Ungroup"));
279
- ungroupItem.addActionListener(this);
284
+ transformgeometryItem = menu.add(new MenuItem("Transform Geometry"));
285
+ transformgeometryItem.addActionListener(this);
280286
281287 oe.menuBar.add(menu = new Menu("Geometry"));
282288 genUVItem = menu.add(new MenuItem("Generate UV"));
....@@ -285,6 +291,10 @@
285291 genNormalsORGANItem.addActionListener(this);
286292 genNormalsCADItem = menu.add(new MenuItem("CAD Normals"));
287293 genNormalsCADItem.addActionListener(this);
294
+ genNormalsMESHItem = menu.add(new MenuItem("Mesh Normals"));
295
+ genNormalsMESHItem.addActionListener(this);
296
+ genNormalsMINEItem = menu.add(new MenuItem("My Normals"));
297
+ genNormalsMINEItem.addActionListener(this);
288298 stripifyItem = menu.add(new MenuItem("Stripify"));
289299 stripifyItem.addActionListener(this);
290300 unstripifyItem = menu.add(new MenuItem("Unstripify"));
....@@ -380,7 +390,7 @@
380390
381391
382392 oe.menuBar.add(menu = new Menu("Include"));
383
- importGFDItem = menu.add(new MenuItem("GraphreeD Object..."));
393
+ importGFDItem = menu.add(new MenuItem("GrafreeD Object..."));
384394 importGFDItem.addActionListener(this);
385395 importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D Object..."));
386396 importVRMLX3DItem.addActionListener(this);
....@@ -427,11 +437,17 @@
427437 oe.aConstraints.gridwidth = 1;
428438 oe.aConstraints.gridx = 0;
429439
430
- oe.toolbarPanel.add(liveCB = new cCheckBox("Live", CameraPane.isLIVE()), oe.aConstraints);
440
+ oe.toolbarPanel.add(liveCB = new cCheckBox("Live", Globals.isLIVE()), oe.aConstraints);
441
+ liveCB.setToolTipText("Enabled animation");
431442 liveCB.addItemListener(this);
432443
433444 oe.aConstraints.gridx += 1;
445
+ oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST), oe.aConstraints);
446
+ fastCB.setToolTipText("Fast mode");
447
+ fastCB.addItemListener(this);
448
+ oe.aConstraints.gridx += 1;
434449 oe.toolbarPanel.add(supportCB = new cCheckBox("Support", CameraPane.SUPPORT), oe.aConstraints);
450
+ supportCB.setToolTipText("Enabled rigging");
435451 supportCB.addItemListener(this);
436452
437453 // oe.aConstraints.gridx += 1;
....@@ -439,22 +455,27 @@
439455 // localCB.addItemListener(this);
440456
441457 oe.aConstraints.gridx += 1;
442
- oe.toolbarPanel.add(crowdCB = new cCheckBox("Crowd", CameraPane.CROWD), oe.aConstraints);
458
+ oe.toolbarPanel.add(crowdCB = new cCheckBox("Crowd", Globals.CROWD), oe.aConstraints);
459
+ crowdCB.setToolTipText("Used for crowds");
443460 crowdCB.addItemListener(this);
444461
445462 oe.aConstraints.gridx += 1;
446463 oe.toolbarPanel.add(smoothCB = new cCheckBox("Inertia", CameraPane.INERTIA), oe.aConstraints);
464
+ smoothCB.setToolTipText("Snapping delay");
447465 smoothCB.addItemListener(this);
448466
449467 oe.aConstraints.gridx += 1;
450
- oe.toolbarPanel.add(fastCB = new cCheckBox("Fast", CameraPane.FAST), oe.aConstraints);
451
- fastCB.addItemListener(this);
452
- oe.aConstraints.gridx += 1;
453468 oe.toolbarPanel.add(slowCB = new cCheckBox("Slow", CameraPane.SLOWPOSE), oe.aConstraints);
469
+ slowCB.setToolTipText("Smooth interpolation");
454470 slowCB.addItemListener(this);
455471 oe.aConstraints.gridx += 1;
456
- oe.toolbarPanel.add(boxCB = new cCheckBox("Box", CameraPane.FAST), oe.aConstraints);
472
+ oe.toolbarPanel.add(boxCB = new cCheckBox("Box", CameraPane.BOXMODE), oe.aConstraints);
473
+ boxCB.setToolTipText("Display bounding boxes");
457474 boxCB.addItemListener(this);
475
+ oe.aConstraints.gridx += 1;
476
+ oe.toolbarPanel.add(zoomBoxCB = new cCheckBox("Zoom", CameraPane.ZOOMBOXMODE), oe.aConstraints);
477
+ zoomBoxCB.setToolTipText("Display bounding boxes when moving the wheel");
478
+ zoomBoxCB.addItemListener(this);
458479
459480 // oe.aConstraints.gridx += 1;
460481 // oe.toolbarPanel.add(speakerMocapCB = new cCheckBox("Mocap", CameraPane.SPEAKERMOCAP), oe.aConstraints);
....@@ -481,19 +502,22 @@
481502 // debugCB.addItemListener(this);
482503
483504 oe.aConstraints.gridx += 1;
484
- oe.toolbarPanel.add(oeilCB = new cCheckBox("O", CameraPane.OEIL), oe.aConstraints);
505
+ oe.toolbarPanel.add(oeilCB = new cCheckBox("Eye", CameraPane.OEIL), oe.aConstraints);
485506 oeilCB.addItemListener(this);
486507
487508 oe.aConstraints.gridx += 1;
488
- oe.toolbarPanel.add(lookAtCB = new cCheckBox("T", CameraPane.LOOKAT), oe.aConstraints);
509
+ oe.toolbarPanel.add(lookAtCB = new cCheckBox("Target", CameraPane.LOOKAT), oe.aConstraints);
510
+ lookAtCB.setToolTipText("Look-at target");
489511 lookAtCB.addItemListener(this);
490512
491513 oe.aConstraints.gridx += 1;
492514 oe.toolbarPanel.add(trackCB = new cCheckBox(":", CameraPane.TRACK), oe.aConstraints);
515
+ trackCB.setToolTipText("Enable tracking");
493516 trackCB.addItemListener(this);
494517
495518 oe.aConstraints.gridx += 1;
496519 oe.toolbarPanel.add(screenfitButton = new cButton("@ ")); //, oe.aConstraints);
520
+ screenfitButton.setToolTipText("Screen fit");
497521 screenfitButton.addActionListener(this);
498522 oe.aConstraints.gridx += 1;
499523 // oe.toolbarPanel.add(screenfitpointButton = new cButton(" @+ ")); //, oe.aConstraints);
....@@ -501,6 +525,7 @@
501525 // oe.aConstraints.gridx += 1;
502526 oe.toolbarPanel.add(snapobjectButton = new cButton(" O+ ")); //, oe.aConstraints);
503527 snapobjectButton.addActionListener(this);
528
+ snapobjectButton.setToolTipText("Snap Object");
504529 oe.aConstraints.gridx += 1;
505530
506531 //aConstraints.gridx = 0;
....@@ -509,28 +534,39 @@
509534 oe.aConstraints.gridwidth = 1;
510535
511536 oe.toolbarPanel.add(flashSelectionButton = new cButton(" ? ")); //, oe.aConstraints);
537
+ flashSelectionButton.setToolTipText("Show selection");
512538 flashSelectionButton.addActionListener(this);
539
+
540
+ oe.toolbarPanel.add(new cButton(" ", false));
541
+
513542 oe.aConstraints.gridx += 1;
514543 oe.aConstraints.weighty = 0;
515544 oe.aConstraints.gridwidth = 1;
516545
517546 //
518547 oe.toolbarPanel.add(twoButton = new cButton(" |+| ")); //, oe.aConstraints);
548
+ twoButton.setToolTipText("Show center view only");
519549 twoButton.addActionListener(this);
520550 oe.toolbarPanel.add(fourButton = new cButton("+|| ")); //, oe.aConstraints);
521551 fourButton.addActionListener(this);
552
+ fourButton.setToolTipText("Show left panel only");
522553 oe.toolbarPanel.add(sixButton = new cButton("+|+| ")); //, oe.aConstraints);
554
+ sixButton.setToolTipText("2-column layout left");
523555 sixButton.addActionListener(this);
524556 oe.toolbarPanel.add(threeButton = new cButton(" |+|+")); //, oe.aConstraints);
557
+ threeButton.setToolTipText("2-column layout right");
525558 threeButton.addActionListener(this);
526559 oe.toolbarPanel.add(sevenButton = new cButton("+|+|+")); //, oe.aConstraints);
560
+ sevenButton.setToolTipText("3-column layout");
527561 sevenButton.addActionListener(this);
528562 //
529563
530
- oe.toolbarPanel.add(rootButton = new cButton(" o o o E ")); //, oe.aConstraints);
564
+ oe.toolbarPanel.add(rootButton = new cButton(" o o o ")); //, oe.aConstraints);
565
+ rootButton.setToolTipText("Edit object in new tab");
531566 rootButton.addActionListener(this);
532567 oe.aConstraints.gridx += 1;
533568 oe.toolbarPanel.add(closeButton = new cButton(" X ")); //, oe.aConstraints);
569
+ closeButton.setToolTipText("Close tab");
534570 closeButton.addActionListener(this);
535571 //oe.treePanel.add(clearButton = new cButton("X"), oe.aConstraints);
536572 //clearButton.addActionListener(this);
....@@ -636,14 +672,14 @@
636672
637673 void EditObject(Object3D obj)
638674 {
639
- cRadio dummyButton = new cRadio(obj.name);
640
- dummyButton.SetObject(obj);
641
- dummyButton.layout = sevenButton;
642
- dummyButton.SetCamera(cameraView.renderCamera, false);
643
- dummyButton.addActionListener(this);
644
- radioPanel.add(dummyButton);
645
- buttonGroup.add(dummyButton);
646
- dummyButton.doClick();
675
+ cRadio radioButton = new cRadio(obj.name);
676
+ radioButton.SetObject(obj);
677
+ radioButton.layout = sevenButton;
678
+ radioButton.SetCamera(cameraView.renderCamera, false);
679
+ radioButton.addActionListener(this);
680
+ radioPanel.add(radioButton);
681
+ buttonGroup.add(radioButton);
682
+ radioButton.doClick();
647683 }
648684 void SetupViews(ObjEditor oe)
649685 {
....@@ -663,6 +699,7 @@
663699 JCheckBox fastCB;
664700 JCheckBox slowCB;
665701 JCheckBox boxCB;
702
+ JCheckBox zoomBoxCB;
666703 JCheckBox trackCB;
667704 JCheckBox smoothfocusCB;
668705 // JCheckBox speakerMocapCB;
....@@ -705,8 +742,7 @@
705742 dropAttributes |= Object3D.TEXTURE;
706743 else
707744 dropAttributes &= ~Object3D.TEXTURE;
708
- }
709
- else if(e.getSource() == liveCB)
745
+ } else if(e.getSource() == liveCB)
710746 {
711747 cameraView.ToggleLive();
712748 }
....@@ -743,6 +779,10 @@
743779 Recompile();
744780 cameraView.repaint();
745781 // refreshContents();
782
+ }
783
+ else if(e.getSource() == zoomBoxCB)
784
+ {
785
+ cameraView.ToggleZoomBoxMode();
746786 }
747787 else if(e.getSource() == smoothfocusCB)
748788 {
....@@ -1033,6 +1073,8 @@
10331073 torusItem.addActionListener(this);
10341074 superItem = menu.add(new MenuItem("Superellipsoid"));
10351075 superItem.addActionListener(this);
1076
+ kleinItem = menu.add(new MenuItem("Klein Bottle"));
1077
+ kleinItem.addActionListener(this);
10361078 particleItem = menu.add(new MenuItem("Particle system"));
10371079 particleItem.addActionListener(this);
10381080 ragdollItem = menu.add(new MenuItem("Rag Walk"));
....@@ -1106,6 +1148,8 @@
11061148 resetParentItem.addActionListener(this);
11071149 repairParentItem = menu.add(new MenuItem("Repair Parent"));
11081150 repairParentItem.addActionListener(this);
1151
+ repairShadowItem = menu.add(new MenuItem("Repair Shadow"));
1152
+ repairShadowItem.addActionListener(this);
11091153 menu.add(invariantsItem = new MenuItem("Invariants"));
11101154 invariantsItem.addActionListener(this);
11111155 menu.add(recompileItem = new MenuItem("Recompile"));
....@@ -1441,9 +1485,9 @@
14411485
14421486 void Overwrite(int mask)
14431487 {
1444
- if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
1488
+ if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
14451489 {
1446
- Object3D content = GraphreeD.clipboard.get(0);
1490
+ Object3D content = GrafreeD.clipboard.get(0);
14471491
14481492 if (content instanceof cGroup && ((cGroup)content).transientlink )
14491493 content = ((cGroup)content).get(0);
....@@ -1592,6 +1636,10 @@
15921636 if (event.getSource() == superItem)
15931637 {
15941638 makeSomething(new Superellipsoid());
1639
+ } else
1640
+ if (event.getSource() == kleinItem)
1641
+ {
1642
+ makeSomething(new Klein());
15951643 } else
15961644 if (event.getSource() == blobItem)
15971645 {
....@@ -1762,8 +1810,8 @@
17621810 } else
17631811 if (event.getSource() == computeAOItem)
17641812 {
1765
- CameraPane.drawMode = CameraPane.OCCLUSION;
1766
- CameraPane.theRenderer.repaint();
1813
+ Globals.drawMode = CameraPane.OCCLUSION;
1814
+ Globals.theRenderer.repaint();
17671815 } else
17681816 if (event.getSource() == recompileItem)
17691817 {
....@@ -1778,7 +1826,7 @@
17781826 if (event.getSource() == invariantsItem)
17791827 {
17801828 System.out.println("Invariants:");
1781
- GraphreeD.theApplet3D.universe.invariants();
1829
+ GrafreeD.grafreeD.universe.invariants();
17821830 } else
17831831 if (event.getSource() == memoryItem)
17841832 {
....@@ -1848,10 +1896,10 @@
18481896 } else
18491897 if (event.getSource() == duplicateItem)
18501898 {
1851
- Object3D keep = GraphreeD.clipboard;
1899
+ Object3D keep = GrafreeD.clipboard;
18521900 loadClipboard(false);
18531901 paste(false);
1854
- GraphreeD.clipboard = keep;
1902
+ GrafreeD.clipboard = keep;
18551903 } else
18561904 if (event.getSource() == cloneItem)
18571905 {
....@@ -1895,8 +1943,9 @@
18951943 } else
18961944 if (event.getSource() == overwriteMatItem)
18971945 {
1946
+ /* july 2015
18981947 if ((dropAttributes & Object3D.TEXTURE) == 0)
1899
- Overwrite(Object3D.MATERIAL);
1948
+ Overwrite(Object3D.MATERIAL | Object3D.COLOR);
19001949 else
19011950 {
19021951 if ((dropAttributes & Object3D.COLOR) == 0 && (dropAttributes & Object3D.MATERIAL) == 0)
....@@ -1908,13 +1957,16 @@
19081957 Overwrite(Object3D.MATERIAL | Object3D.TEXTURE);
19091958 }
19101959 }
1960
+ */
1961
+
1962
+ Overwrite(dropAttributes);
19111963 }
19121964 if (event.getSource() == overwriteGeoItem)
19131965 {
19141966 Overwrite(Object3D.GEOMETRY);
1915
-// if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
1967
+// if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
19161968 // {
1917
-// Object3D content = GraphreeD.clipboard.get(0);
1969
+// Object3D content = GrafreeD.clipboard.get(0);
19181970 //
19191971 // if (content instanceof cGroup && ((cGroup)content).transientlink )
19201972 // content = ((cGroup)content).get(0);
....@@ -1997,23 +2049,28 @@
19972049 if (group.selection.size() == 1)
19982050 one = true;
19992051
2052
+ Object3D merge = null;
2053
+
20002054 Object3D content = new cGroup();
20012055
20022056 for (int i=0; i<group.selection.size(); i++)
20032057 {
2004
- Object3D sel = new Merge(group.selection.get(i));
2058
+ merge = new Merge(group.selection.get(i));
20052059
20062060 if (one)
2007
- makeSomething(sel, false);
2061
+ makeSomething(merge, false);
20082062 else
2009
- content.addChild(sel);
2063
+ content.addChild(merge);
20102064 }
20112065
20122066 if (!one)
2013
- makeSomething(content, false);
2014
-
2015
- ResetModel();
2016
- refreshContents();
2067
+ makeSomething(content, true);
2068
+ else
2069
+ {
2070
+ ResetModel();
2071
+ Select(merge.GetTreePath(), true, false); // unselect... false);
2072
+ refreshContents();
2073
+ }
20172074 } else
20182075 if (event.getSource() == mergeGeometriesItem)
20192076 {
....@@ -2047,9 +2104,9 @@
20472104 } else
20482105 if (event.getSource() == linkverticesItem)
20492106 {
2050
-// if (group.selection.size() == 1 && GraphreeD.clipboard.size() == 1)
2107
+// if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
20512108 // {
2052
-// Object3D content = GraphreeD.clipboard.get(0);
2109
+// Object3D content = GrafreeD.clipboard.get(0);
20532110 //
20542111 // if (content instanceof cGroup && ((cGroup)content).transientlink )
20552112 // content = ((cGroup)content).get(0);
....@@ -2058,14 +2115,14 @@
20582115 // group.selection.get(0).setMasterThis(content); // should be identity
20592116 // refreshContents();
20602117 // }
2061
- if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
2118
+ if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
20622119 {
2063
- Object3D content = GraphreeD.clipboard.get(0);
2120
+ Object3D content = GrafreeD.clipboard.get(0);
20642121
20652122 if (content instanceof cGroup && ((cGroup)content).transientlink )
20662123 content = ((cGroup)content).get(0);
20672124
2068
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
2125
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
20692126 for (int i=0; i<group.selection.size(); i++)
20702127 {
20712128 boolean random = CameraPane.RANDOM;
....@@ -2074,7 +2131,7 @@
20742131 // group.selection.get(i).setMasterThis(content); // should be identity
20752132 CameraPane.RANDOM = random;
20762133 }
2077
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
2134
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
20782135 refreshContents();
20792136 }
20802137 } else
....@@ -2090,6 +2147,15 @@
20902147
20912148 refreshContents();
20922149 } else
2150
+ if (event.getSource() == relinkverticesItem)
2151
+ {
2152
+ boolean random = CameraPane.RANDOM;
2153
+ CameraPane.RANDOM = false; // parse all random nodes
2154
+ group.selection.RelinkToSupport();
2155
+ CameraPane.RANDOM = random;
2156
+
2157
+ refreshContents();
2158
+ } else
20932159 if (event.getSource() == resetreferencesItem)
20942160 {
20952161 for (int i=0; i<group.selection.size(); i++)
....@@ -2101,9 +2167,9 @@
21012167 } else
21022168 if (event.getSource() == setMasterItem)
21032169 {
2104
- if (group.selection.size() == 1 && GraphreeD.clipboard.size() == 1)
2170
+ if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
21052171 {
2106
- Object3D content = GraphreeD.clipboard.get(0);
2172
+ Object3D content = GrafreeD.clipboard.get(0);
21072173
21082174 if (content instanceof cGroup && ((cGroup)content).transientlink )
21092175 content = ((cGroup)content).get(0);
....@@ -2116,9 +2182,9 @@
21162182 {
21172183 if (group.selection.size() == 1)
21182184 {
2119
- if (GraphreeD.clipboard.size() == 1)
2185
+ if (GrafreeD.clipboard.size() == 1)
21202186 {
2121
- Object3D content = GraphreeD.clipboard.get(0);
2187
+ Object3D content = GrafreeD.clipboard.get(0);
21222188
21232189 if (content instanceof cGroup && ((cGroup)content).transientlink )
21242190 content = ((cGroup)content).get(0);
....@@ -2158,6 +2224,10 @@
21582224 if (event.getSource() == grabItem)
21592225 {
21602226 group(new cGroup(), true);
2227
+ } else
2228
+ if (event.getSource() == hideItem)
2229
+ {
2230
+ group(new HiddenObject());
21612231 } else
21622232 if (event.getSource() == frontItem)
21632233 {
....@@ -2281,6 +2351,10 @@
22812351 {
22822352 group(new TextureNode());
22832353 } else
2354
+ if (event.getSource() == billboardItem)
2355
+ {
2356
+ group(new BillboardNode());
2357
+ } else
22842358 if (event.getSource() == shadowXItem)
22852359 {
22862360 CastShadow(0);
....@@ -2295,7 +2369,15 @@
22952369 } else
22962370 if (event.getSource() == ungroupItem)
22972371 {
2298
- ungroup();
2372
+ //ungroup();
2373
+ for (int i=0; i<group.selection.size(); i++)
2374
+ {
2375
+ Ungroup(group.selection.get(i));
2376
+ }
2377
+
2378
+ ClearSelection(false);
2379
+
2380
+ refreshContents();
22992381 } else
23002382 if (event.getSource() == genUVItem)
23012383 {
....@@ -2305,9 +2387,17 @@
23052387 {
23062388 GenNormals(true);
23072389 } else
2390
+ if (event.getSource() == genNormalsMESHItem)
2391
+ {
2392
+ GenNormals(true); // TODO
2393
+ } else
23082394 if (event.getSource() == genNormalsORGANItem)
23092395 {
23102396 GenNormals(false);
2397
+ } else
2398
+ if (event.getSource() == genNormalsMINEItem)
2399
+ {
2400
+ GenNormalsMINE();
23112401 } else
23122402 if (event.getSource() == stripifyItem)
23132403 {
....@@ -2485,6 +2575,20 @@
24852575
24862576 refreshContents();
24872577 } else
2578
+ if (event.getSource() == repairShadowItem)
2579
+ {
2580
+ for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
2581
+ {
2582
+ Object3D obj = (Object3D)e.nextElement();
2583
+ obj.RepairShadow();
2584
+// for (int i=0; i<obj.size(); i++)
2585
+// {
2586
+// obj.get(i).parent = obj;
2587
+// }
2588
+ }
2589
+
2590
+ refreshContents();
2591
+ } else
24882592 if (event.getSource() == sortbysizeItem)
24892593 {
24902594 for (Enumeration e = group.selection.elements(); e.hasMoreElements();)
....@@ -2580,8 +2684,8 @@
25802684 // bug
25812685 //gridPanel.setDividerLocation(1.0);
25822686 //bigPanel.setDividerLocation(0.0);
2583
- bigThree.remove(jtp);
2584
- bigThree.remove(cameraPanel);
2687
+ bigThree.remove(scenePanel);
2688
+ bigThree.remove(centralPanel);
25852689 bigThree.remove(XYZPanel);
25862690 aWindowConstraints.gridx = 0;
25872691 aWindowConstraints.gridy = 0;
....@@ -2596,7 +2700,7 @@
25962700 // aConstraints.gridheight = 3;
25972701 aWindowConstraints.gridx = 1;
25982702 aWindowConstraints.fill = GridBagConstraints.BOTH;
2599
- bigThree.add(cameraPanel, aWindowConstraints);
2703
+ bigThree.add(centralPanel, aWindowConstraints);
26002704 aWindowConstraints.weightx = 0;
26012705 aWindowConstraints.gridx = 4;
26022706 aWindowConstraints.gridwidth = 1;
....@@ -2608,8 +2712,8 @@
26082712 if (event.getSource() == threeButton)
26092713 {
26102714 radio.layout = threeButton;
2611
- bigThree.remove(jtp);
2612
- bigThree.remove(cameraPanel);
2715
+ bigThree.remove(scenePanel);
2716
+ bigThree.remove(centralPanel);
26132717 bigThree.remove(XYZPanel);
26142718 aWindowConstraints.gridx = 0;
26152719 aWindowConstraints.gridy = 0;
....@@ -2624,7 +2728,7 @@
26242728 // aConstraints.gridheight = 3;
26252729 aWindowConstraints.gridx = 1;
26262730 aWindowConstraints.fill = GridBagConstraints.BOTH;
2627
- bigThree.add(cameraPanel, aWindowConstraints);
2731
+ bigThree.add(centralPanel, aWindowConstraints);
26282732 aWindowConstraints.weightx = 0;
26292733 aWindowConstraints.gridx = 4;
26302734 aWindowConstraints.gridwidth = 1;
....@@ -2636,8 +2740,8 @@
26362740 if (event.getSource() == fourButton)
26372741 {
26382742 radio.layout = fourButton;
2639
- bigThree.remove(jtp);
2640
- bigThree.remove(cameraPanel);
2743
+ bigThree.remove(scenePanel);
2744
+ bigThree.remove(centralPanel);
26412745 bigThree.remove(XYZPanel);
26422746 aWindowConstraints.gridx = 0;
26432747 aWindowConstraints.gridy = 0;
....@@ -2646,7 +2750,7 @@
26462750 aWindowConstraints.fill = GridBagConstraints.BOTH;
26472751 aWindowConstraints.weightx = 1;
26482752 aWindowConstraints.weighty = 1;
2649
- bigThree.add(jtp, aWindowConstraints);
2753
+ bigThree.add(scenePanel, aWindowConstraints);
26502754 aWindowConstraints.weightx = 1;
26512755 aWindowConstraints.gridwidth = 3;
26522756 // aConstraints.gridheight = 3;
....@@ -2664,8 +2768,8 @@
26642768 if (event.getSource() == sixButton)
26652769 {
26662770 radio.layout = sixButton;
2667
- bigThree.remove(jtp);
2668
- bigThree.remove(cameraPanel);
2771
+ bigThree.remove(scenePanel);
2772
+ bigThree.remove(centralPanel);
26692773 bigThree.remove(XYZPanel);
26702774 aWindowConstraints.gridx = 0;
26712775 aWindowConstraints.gridy = 0;
....@@ -2674,13 +2778,13 @@
26742778 aWindowConstraints.fill = GridBagConstraints.VERTICAL;
26752779 aWindowConstraints.weightx = 0;
26762780 aWindowConstraints.weighty = 1;
2677
- bigThree.add(jtp, aWindowConstraints);
2781
+ bigThree.add(scenePanel, aWindowConstraints);
26782782 aWindowConstraints.weightx = 1;
26792783 aWindowConstraints.gridwidth = 3;
26802784 // aWindowConstraints.gridheight = 3;
26812785 aWindowConstraints.gridx = 1;
26822786 aWindowConstraints.fill = GridBagConstraints.BOTH;
2683
- bigThree.add(cameraPanel, aWindowConstraints);
2787
+ bigThree.add(centralPanel, aWindowConstraints);
26842788 aWindowConstraints.weightx = 0;
26852789 aWindowConstraints.gridx = 4;
26862790 aWindowConstraints.gridwidth = 1;
....@@ -2692,8 +2796,8 @@
26922796 if (event.getSource() == sevenButton)
26932797 {
26942798 radio.layout = sevenButton;
2695
- bigThree.remove(jtp);
2696
- bigThree.remove(cameraPanel);
2799
+ bigThree.remove(scenePanel);
2800
+ bigThree.remove(centralPanel);
26972801 bigThree.remove(XYZPanel);
26982802 aWindowConstraints.gridx = 0;
26992803 aWindowConstraints.gridy = 0;
....@@ -2702,13 +2806,13 @@
27022806 aWindowConstraints.fill = GridBagConstraints.VERTICAL;
27032807 aWindowConstraints.weightx = 0;
27042808 aWindowConstraints.weighty = 1;
2705
- bigThree.add(jtp, aWindowConstraints);
2809
+ bigThree.add(scenePanel, aWindowConstraints);
27062810 aWindowConstraints.weightx = 1;
27072811 aWindowConstraints.gridwidth = 3;
27082812 // aWindowConstraints.gridheight = 3;
27092813 aWindowConstraints.gridx = 1;
27102814 aWindowConstraints.fill = GridBagConstraints.BOTH;
2711
- bigThree.add(cameraPanel, aWindowConstraints);
2815
+ bigThree.add(centralPanel, aWindowConstraints);
27122816 aWindowConstraints.weightx = 0;
27132817 aWindowConstraints.gridx = 4;
27142818 aWindowConstraints.gridwidth = 1;
....@@ -2806,7 +2910,7 @@
28062910 if (event.getSource() == unselectButton)
28072911 {
28082912 objEditor.jTree.clearSelection();
2809
- // ?? oct 2012 GraphreeD.clipboard.clear();
2913
+ // ?? oct 2012 GrafreeD.clipboard.clear();
28102914 objEditor.ResetSliders();
28112915 refreshContents(true);
28122916 } else
....@@ -2835,7 +2939,7 @@
28352939 }
28362940
28372941 copy = group;
2838
- //CameraPane.theRenderer.object = group;
2942
+ //Globals.theRenderer.object = group;
28392943 if(!useclient)
28402944 {
28412945 cameraView.renderCamera = radio.camera;
....@@ -2844,7 +2948,8 @@
28442948 cameraView.cameras[cameraView.cameracount] = radio.camera;
28452949 cameraView.targetLookAt.set(radio.camera.lookAt);
28462950 cameraView.object = group;
2847
- cameraView.lighttouched = true;
2951
+ //cameraView.lighttouched = true;
2952
+ Globals.lighttouched = true;
28482953 topView.object = group;
28492954 frontView.object = group;
28502955 sideView.object = group;
....@@ -2880,7 +2985,7 @@
28802985 if (useclient)
28812986 {
28822987 cameraView.object = client;
2883
- cameraView.lighttouched = true;
2988
+ Globals.lighttouched = true;
28842989 //topView.object = client;
28852990 //frontView.object = client;
28862991 //sideView.object = client;
....@@ -2888,7 +2993,7 @@
28882993 else
28892994 {
28902995 cameraView.object = group;
2891
- cameraView.lighttouched = true;
2996
+ Globals.lighttouched = true;
28922997 //topView.object = group;
28932998 //frontView.object = group;
28942999 //sideView.object = group;
....@@ -3121,9 +3226,9 @@
31213226 obj = (Object3D)e.nextElement();
31223227
31233228 System.out.println("Object is: " + obj);
3124
- GraphreeD.AnalyzeObject(obj);
3229
+ GrafreeD.AnalyzeObject(obj);
31253230 System.out.println("Boundary rep: " + obj.bRep);
3126
- GraphreeD.AnalyzeObject(obj.bRep);
3231
+ GrafreeD.AnalyzeObject(obj.bRep);
31273232
31283233 // System.err.println((size/1024) + " KB is the size of " + obj);
31293234 }
....@@ -3165,6 +3270,13 @@
31653270 void GenNormals(boolean crease)
31663271 {
31673272 group.GenNormalsS(crease);
3273
+
3274
+ refreshContents();
3275
+ }
3276
+
3277
+ void GenNormalsMINE()
3278
+ {
3279
+ group.selection.GenNormalsMINE();
31683280
31693281 refreshContents();
31703282 }
....@@ -3250,7 +3362,7 @@
32503362 // LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
32513363 // LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
32523364 //
3253
-// g.add(GraphreeD.clipboard);
3365
+// g.add(GrafreeD.clipboard);
32543366 //
32553367 // buffer.add(g);
32563368 // }
....@@ -3269,8 +3381,8 @@
32693381 // nodes = new Object3D();
32703382 // vertices = new Vector<Vertex>();
32713383 //
3272
-// boolean epsequal = GraphreeD.epsequal;
3273
-// GraphreeD.epsequal = true;
3384
+// boolean epsequal = GrafreeD.epsequal;
3385
+// GrafreeD.epsequal = true;
32743386 //
32753387 // for (int i=0; i<group.selection.size(); i++)
32763388 // {
....@@ -3311,7 +3423,7 @@
33113423 // LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
33123424 // LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
33133425 //
3314
-// g.add(GraphreeD.clipboard);
3426
+// g.add(GrafreeD.clipboard);
33153427 //
33163428 // buffer.add(g);
33173429 // }
....@@ -3319,7 +3431,7 @@
33193431 // makeSomething(buffer, i==group.selection.size()-1);
33203432 // }
33213433 //
3322
-// GraphreeD.epsequal = epsequal;
3434
+// GrafreeD.epsequal = epsequal;
33233435 //
33243436 // //buffer = null;
33253437 // temprep = null;
....@@ -3330,8 +3442,8 @@
33303442
33313443 void ParseVertices()
33323444 {
3333
- boolean epsequal = GraphreeD.epsequal;
3334
- GraphreeD.epsequal = true;
3445
+ boolean epsequal = GrafreeD.epsequal;
3446
+ GrafreeD.epsequal = true;
33353447
33363448 for (int i=0; i<group.selection.size(); i++)
33373449 {
....@@ -3356,7 +3468,7 @@
33563468 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
33573469 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
33583470
3359
- g.add(GraphreeD.clipboard);
3471
+ g.add(GrafreeD.clipboard);
33603472
33613473 buffer.add(g);
33623474 }
....@@ -3371,7 +3483,7 @@
33713483 makeSomething(buffer, i==group.selection.size()-1);
33723484 }
33733485
3374
- GraphreeD.epsequal = epsequal;
3486
+ GrafreeD.epsequal = epsequal;
33753487
33763488 refreshContents();
33773489 }
....@@ -3389,7 +3501,7 @@
33893501 String pigment = Object3D.GetPigment(tex);
33903502 //String bump = Object3D.GetBump(tex);
33913503
3392
- com.sun.opengl.util.texture.TextureData texturedata = CameraPane.theRenderer.GetTextureData(pigment, false, node.texres);
3504
+ com.sun.opengl.util.texture.TextureData texturedata = Globals.theRenderer.GetTextureData(pigment, false, node.texres);
33933505
33943506 double s = v.s;
33953507
....@@ -3416,7 +3528,7 @@
34163528 scale /= 3;
34173529
34183530 scale /= 0xFF;
3419
- scale /= 4;
3531
+ // c'est quoi ca? scale /= 4;
34203532
34213533 //v.AO = scale;
34223534
....@@ -3437,12 +3549,26 @@
34373549
34383550 void Align()
34393551 {
3552
+ if (group.selection.size() == 0)
3553
+ return;
3554
+
3555
+ cVector bbmin = new cVector();
3556
+ cVector bbmax = new cVector();
3557
+
3558
+ group.selection.get(0).getBounds(bbmin, bbmax, true);
3559
+
3560
+ double dx = bbmax.x - bbmin.x;
3561
+ double dy = bbmax.y - bbmin.y;
3562
+ double dz = bbmax.z - bbmin.z;
3563
+
3564
+ double scale = Math.sqrt(dx*dx + dy*dy + dz*dz);
3565
+
34403566 for (int i=0; i<group.selection.size(); i++)
34413567 {
34423568 Object3D obj = group.selection.get(i);
34433569
3444
- LA.matTranslate(obj.toParent, i/2f, 0, 0);
3445
- LA.matTranslateInv(obj.fromParent, -i/2f, 0, 0);
3570
+ LA.matTranslate(obj.toParent, i * scale, 0, 0);
3571
+ LA.matTranslateInv(obj.fromParent, -i * scale, 0, 0);
34463572 }
34473573
34483574 refreshContents();
....@@ -3455,7 +3581,7 @@
34553581 // ref.SaveSupports();
34563582 // Object3D par = ref.parent;
34573583 // ref.parent = null;
3458
-// Object3D lowres = (Object3D) GraphreeD.clone(ref);
3584
+// Object3D lowres = (Object3D) GrafreeD.clone(ref);
34593585 // ref.parent = par;
34603586 // ref.RestoreSupports();
34613587
....@@ -3485,7 +3611,7 @@
34853611 // lowres.SaveSupports();
34863612 // par = lowres.parent;
34873613 // lowres.parent = null;
3488
-// Object3D newlow = (Object3D) GraphreeD.clone(lowres);
3614
+// Object3D newlow = (Object3D) GrafreeD.clone(lowres);
34893615 Object3D newlow = CloneObject(lowres, false);
34903616 newlow.name = sn.switchobject.get(i).name;
34913617 System.out.println(" pose#" + i + " = " + newlow);
....@@ -3507,7 +3633,7 @@
35073633 return;
35083634
35093635 Object3D poses = group.selection.get(0);
3510
- Object3D ref = GraphreeD.clipboard.get(0);
3636
+ Object3D ref = GrafreeD.clipboard.get(0);
35113637
35123638 Object3D newgroup = new Object3D("Po:" + poses.name);
35133639
....@@ -3676,7 +3802,7 @@
36763802 group.selection.RelinkToSupport(); // july 2014
36773803 System.out.println("DONE.");
36783804 refreshContents();
3679
- CameraPane.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
3805
+ Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
36803806 }
36813807
36823808 void ReduceMesh(boolean reduction34)
....@@ -3701,20 +3827,20 @@
37013827
37023828 void ClipMesh()
37033829 {
3704
- if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
3830
+ if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
37053831 {
3706
- Object3D content = GraphreeD.clipboard.get(0);
3832
+ Object3D content = GrafreeD.clipboard.get(0);
37073833
37083834 if (content instanceof cGroup && ((cGroup)content).transientlink )
37093835 content = ((cGroup)content).get(0);
37103836
37113837 // for (int i=0; i<group.selection.size(); i++)
37123838 // {
3713
-// group.selection.get(i).ClipMesh(GraphreeD.clipboard);
3839
+// group.selection.get(i).ClipMesh(GrafreeD.clipboard);
37143840 // }
3715
- group.selection.ClipMesh(GraphreeD.clipboard);
3841
+ group.selection.ClipMesh(GrafreeD.clipboard);
37163842 }
3717
-// group.selection.ClipMesh(GraphreeD.clipboard);
3843
+// group.selection.ClipMesh(GrafreeD.clipboard);
37183844 System.out.println("DONE.");
37193845 refreshContents();
37203846 }
....@@ -3961,16 +4087,16 @@
39614087
39624088 objEditor.SetText(); // jan 2014
39634089
3964
- if (flashIt && !CameraPane.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
4090
+ if (flashIt && !Globals.isLIVE() && tps != null && tps.length > 0 && !(((Object3D) tps[0].getLastPathComponent()) instanceof Camera))
39654091 CameraPane.flash = true;
39664092
39674093 if (tps != null && tps.length > 0 && ((Object3D) tps[0].getLastPathComponent()) instanceof Camera)
39684094 // a camera
39694095 {
39704096 CameraPane.camerachangeframe = 0; // don't refuse it
3971
- CameraPane.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
3972
- // CameraPane.theRenderer.renderCamera = CameraPane.theRenderer.manipCamera;
3973
- // CameraPane.theRenderer.eyeCamera = CameraPane.theRenderer.manipCamera;
4097
+ Globals.theRenderer.SetCamera((Camera) tps[0].getLastPathComponent());
4098
+ // Globals.theRenderer.renderCamera = Globals.theRenderer.manipCamera;
4099
+ // Globals.theRenderer.eyeCamera = Globals.theRenderer.manipCamera;
39744100 }
39754101
39764102 refreshContents();
....@@ -4052,12 +4178,12 @@
40524178 {
40534179 if (group.selection.isEmpty())
40544180 return;
4055
- GraphreeD.clipboardIsTempGroup = false;
4181
+ GrafreeD.clipboardIsTempGroup = false;
40564182 Composite tGroup = null;
40574183 if (group.selection.size() > 0) // 1)
40584184 {
40594185 tGroup = new cGroup();
4060
- GraphreeD.clipboardIsTempGroup = true;
4186
+ GrafreeD.clipboardIsTempGroup = true;
40614187 }
40624188
40634189 if (cut)
....@@ -4097,16 +4223,16 @@
40974223 //System.out.println("cut " + child);
40984224 //System.out.println("parent = " + child.parent);
40994225 // tmp.addChild(child);
4100
- if (GraphreeD.clipboardIsTempGroup)
4226
+ if (GrafreeD.clipboardIsTempGroup)
41014227 tGroup.add/*Child*/(tmp);
41024228 else
4103
- GraphreeD.clipboard = tmp;
4229
+ GrafreeD.clipboard = tmp;
41044230 }
41054231 else
4106
- if (GraphreeD.clipboardIsTempGroup)
4232
+ if (GrafreeD.clipboardIsTempGroup)
41074233 tGroup.add/*Child*/(child);
41084234 else
4109
- GraphreeD.clipboard = child;
4235
+ GrafreeD.clipboard = child;
41104236 }
41114237
41124238 //ResetModel();
....@@ -4138,21 +4264,21 @@
41384264 //System.out.println("cut " + elem);
41394265 //System.out.println("parent = " + elem.parent);
41404266 // tmp.addChild(elem);
4141
- if (GraphreeD.clipboardIsTempGroup)
4267
+ if (GrafreeD.clipboardIsTempGroup)
41424268 tGroup.add/*Child*/(tmp);
41434269 else
4144
- GraphreeD.clipboard = tmp;
4270
+ GrafreeD.clipboard = tmp;
41454271 }
41464272 else
4147
- if (GraphreeD.clipboardIsTempGroup)
4273
+ if (GrafreeD.clipboardIsTempGroup)
41484274 tGroup.add/*Child*/(child);
41494275 else
4150
- GraphreeD.clipboard = child;
4276
+ GrafreeD.clipboard = child;
41514277 }
41524278
41534279 }
4154
- if (GraphreeD.clipboardIsTempGroup)
4155
- GraphreeD.clipboard = tGroup;
4280
+ if (GrafreeD.clipboardIsTempGroup)
4281
+ GrafreeD.clipboard = tGroup;
41564282 if (cut)
41574283 {
41584284 ResetModel();
....@@ -4162,11 +4288,11 @@
41624288
41634289 void paste(boolean expand)
41644290 {
4165
- // if (GraphreeD.clipboard == null)
4291
+ // if (GrafreeD.clipboard == null)
41664292 // return;
41674293 boolean first = true;
41684294
4169
- if (GraphreeD.clipboardIsTempGroup)
4295
+ if (GrafreeD.clipboardIsTempGroup)
41704296 {
41714297 Composite temp;
41724298
....@@ -4177,7 +4303,7 @@
41774303 temp = (Composite)Applet3D.clipboard.deepCopy();
41784304 */
41794305 Object3D elem;
4180
- for (Enumeration e = /*temp.children*/GraphreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
4306
+ for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
41814307 {
41824308 Object3D child = (Object3D)e.nextElement();
41834309
....@@ -4191,7 +4317,7 @@
41914317 else
41924318 elem = child.deepCopy(); // ?
41934319 child.parent = keepparent;
4194
- //if (GraphreeD.clipboardIsTempGroup && LA.isIdentity(elem.fromParent))
4320
+ //if (GrafreeD.clipboardIsTempGroup && LA.isIdentity(elem.fromParent))
41954321 // elem = elem.get(0);
41964322 makeSomething(elem, true); // ?? first);
41974323 //group.addChild(elem);
....@@ -4211,14 +4337,14 @@
42114337 //Object3D cb = Applet3D.clipboard;
42124338 //temp.addChild(cb);
42134339 //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0));
4214
- assert(GraphreeD.clipboard.parent == null);
4215
- Object3D /*Composite*/ keepparent = GraphreeD.clipboard.get(0).parent;
4216
- GraphreeD.clipboard.get(0).parent = null; // Avoid copy?
4217
- if (LA.isIdentity(GraphreeD.clipboard.toParent))
4218
- makeSomething(expand?GraphreeD.clipboard.get(0).copyExpand():GraphreeD.clipboard.get(0).deepCopy());
4340
+ assert(GrafreeD.clipboard.parent == null);
4341
+ Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
4342
+ GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
4343
+ if (LA.isIdentity(GrafreeD.clipboard.toParent))
4344
+ makeSomething(expand?GrafreeD.clipboard.get(0).copyExpand():GrafreeD.clipboard.get(0).deepCopy());
42194345 else
4220
- makeSomething(expand?GraphreeD.clipboard.copyExpand():GraphreeD.clipboard.deepCopy());
4221
- GraphreeD.clipboard.get(0).parent = keepparent;
4346
+ makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4347
+ GrafreeD.clipboard.get(0).parent = keepparent;
42224348 }
42234349
42244350 ResetModel();
....@@ -4227,7 +4353,7 @@
42274353
42284354 void pasteInto(boolean copyit)
42294355 {
4230
-// if (GraphreeD.clipboard == null)
4356
+// if (GrafreeD.clipboard == null)
42314357 // return;
42324358
42334359 if (group.selection.size() != 1)
....@@ -4260,9 +4386,9 @@
42604386 {
42614387 boolean first = true;
42624388
4263
- if (GraphreeD.clipboardIsTempGroup)
4389
+ if (GrafreeD.clipboardIsTempGroup)
42644390 {
4265
- Composite temp = (Composite)GraphreeD.clipboard;
4391
+ Composite temp = (Composite)GrafreeD.clipboard;
42664392 Object3D copy;
42674393 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
42684394 {
....@@ -4272,7 +4398,7 @@
42724398 }
42734399 } else
42744400 {
4275
- linkSomething(GraphreeD.clipboard); //.get(0));
4401
+ linkSomething(GrafreeD.clipboard); //.get(0));
42764402 }
42774403 }
42784404 }
....@@ -4464,6 +4590,26 @@
44644590 makeSomething(csg);
44654591 }
44664592
4593
+ void Ungroup(Object3D g)
4594
+ {
4595
+ if (g instanceof HiddenObject)
4596
+ {
4597
+ HiddenObject h = (HiddenObject) g;
4598
+
4599
+ for (int i=0; i<h.ActualSize(); i++)
4600
+ {
4601
+ objEditor.makeSomething(h.get(i), false);
4602
+ }
4603
+ }
4604
+ else
4605
+ {
4606
+ for (int i=0; i<g.Size(); i++)
4607
+ {
4608
+ objEditor.makeSomething(g.get(i), false);
4609
+ }
4610
+ }
4611
+ }
4612
+
44674613 void ungroup()
44684614 {
44694615 /*
....@@ -4659,7 +4805,7 @@
46594805
46604806 void ImportGFD()
46614807 {
4662
- FileDialog browser = new FileDialog(objEditor.frame, "Import GraphreeD", FileDialog.LOAD);
4808
+ FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD);
46634809 browser.show();
46644810 String filename = browser.getFile();
46654811 if (filename != null && filename.length() > 0)
....@@ -4697,7 +4843,7 @@
46974843
46984844 void ImportVRMLX3D()
46994845 {
4700
- if (GraphreeD.standAlone)
4846
+ if (GrafreeD.standAlone)
47014847 {
47024848 /**/
47034849 FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
....@@ -4714,7 +4860,7 @@
47144860
47154861 String GetFile(String dialogName)
47164862 {
4717
- if (GraphreeD.standAlone)
4863
+ if (GrafreeD.standAlone)
47184864 {
47194865 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
47204866 browser.show();
....@@ -4823,6 +4969,7 @@
48234969 private MenuItem resetsupportItem;
48244970 private MenuItem resetreferencesItem;
48254971 private MenuItem linkverticesItem;
4972
+ private MenuItem relinkverticesItem;
48264973 private MenuItem setMasterItem;
48274974 private MenuItem resetMeshItem;
48284975 private MenuItem stepAllItem;
....@@ -4841,8 +4988,10 @@
48414988 private MenuItem clearItem;
48424989 private MenuItem clearAllItem;
48434990 private MenuItem genUVItem;
4991
+ private MenuItem genNormalsMESHItem;
48444992 private MenuItem genNormalsCADItem;
48454993 private MenuItem genNormalsORGANItem;
4994
+ private MenuItem genNormalsMINEItem;
48464995 private MenuItem stripifyItem;
48474996 private MenuItem unstripifyItem;
48484997 private MenuItem trimItem;
....@@ -4884,6 +5033,7 @@
48845033 private MenuItem resetCentroidItem;
48855034 private MenuItem transformgeometryItem;
48865035 private MenuItem resetTransformItem;
5036
+ private MenuItem hideItem;
48875037 private MenuItem grabItem;
48885038 private MenuItem backItem;
48895039 private MenuItem frontItem;
....@@ -4904,6 +5054,7 @@
49045054
49055055 private MenuItem resetParentItem;
49065056 private MenuItem repairParentItem;
5057
+ private MenuItem repairShadowItem;
49075058 private MenuItem sortbysizeItem;
49085059 private MenuItem sortbynameItem;
49095060
....@@ -4924,6 +5075,7 @@
49245075 private MenuItem coneItem;
49255076 private MenuItem torusItem;
49265077 private MenuItem superItem;
5078
+ private MenuItem kleinItem;
49275079 private MenuItem blobItem;
49285080 private MenuItem latheItem;
49295081 private MenuItem bezierItem;
....@@ -4936,6 +5088,7 @@
49365088 private MenuItem csgItem;
49375089 private MenuItem templateItem;
49385090 private MenuItem textureItem;
5091
+ private MenuItem billboardItem;
49395092 private MenuItem shadowXItem;
49405093 private MenuItem shadowYItem;
49415094 private MenuItem shadowZItem;