.. | .. |
---|
83 | 83 | |
---|
84 | 84 | void CloneSelection(boolean supports) |
---|
85 | 85 | { |
---|
86 | | - // Object3D keep = GraphreeD.clipboard; |
---|
| 86 | + // Object3D keep = GrafreeD.clipboard; |
---|
87 | 87 | //Object3D obj; |
---|
88 | 88 | for (int i=0; i<group.selection.size(); i++)// Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
89 | 89 | { |
---|
.. | .. |
---|
97 | 97 | |
---|
98 | 98 | void CloneClipboard(boolean supports) |
---|
99 | 99 | { |
---|
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)); |
---|
105 | 105 | 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; |
---|
108 | 108 | } |
---|
109 | 109 | |
---|
110 | 110 | static Object3D CloneObject(Object3D obj, boolean supports) |
---|
.. | .. |
---|
118 | 118 | // obj.support = null; |
---|
119 | 119 | if (!supports) |
---|
120 | 120 | obj.SaveSupports(); |
---|
121 | | - Object3D clone = (Object3D)GraphreeD.clone(obj); |
---|
| 121 | + Object3D clone = (Object3D)GrafreeD.clone(obj); |
---|
122 | 122 | obj.parent = parent; |
---|
123 | 123 | // obj.support = support; |
---|
124 | 124 | // clone.support = support; // aout 2013 |
---|
.. | .. |
---|
219 | 219 | resetsupportItem.addActionListener(this); |
---|
220 | 220 | linkverticesItem = menu.add(new MenuItem("Link to Support")); |
---|
221 | 221 | linkverticesItem.addActionListener(this); |
---|
| 222 | + relinkverticesItem = menu.add(new MenuItem("Re-link to Support")); |
---|
| 223 | + relinkverticesItem.addActionListener(this); |
---|
222 | 224 | setMasterItem = menu.add(new MenuItem("Set Master Mesh")); |
---|
223 | 225 | setMasterItem.addActionListener(this); |
---|
224 | 226 | |
---|
225 | 227 | oe.menuBar.add(menu = new Menu("Group")); |
---|
226 | 228 | grabItem = menu.add(new MenuItem("Grab")); |
---|
227 | 229 | grabItem.addActionListener(this); |
---|
228 | | - frontItem = menu.add(new MenuItem("Front")); |
---|
229 | | - frontItem.addActionListener(this); |
---|
230 | 230 | backItem = menu.add(new MenuItem("Back")); |
---|
231 | 231 | backItem.addActionListener(this); |
---|
| 232 | + frontItem = menu.add(new MenuItem("Front")); |
---|
| 233 | + frontItem.addActionListener(this); |
---|
232 | 234 | compositeItem = menu.add(new MenuItem("Composite")); |
---|
233 | 235 | 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); |
---|
234 | 240 | menu.add("-"); |
---|
235 | 241 | randomItem = menu.add(new MenuItem("Random")); |
---|
236 | 242 | randomItem.addActionListener(this); |
---|
.. | .. |
---|
252 | 258 | oe.menuBar.add(menu = new Menu("Object")); |
---|
253 | 259 | textureItem = menu.add(new MenuItem("Texture")); |
---|
254 | 260 | textureItem.addActionListener(this); |
---|
| 261 | + billboardItem = menu.add(new MenuItem("Billboard")); |
---|
| 262 | + billboardItem.addActionListener(this); |
---|
255 | 263 | csgItem = menu.add(new MenuItem("CSG")); |
---|
256 | 264 | csgItem.addActionListener(this); |
---|
257 | 265 | shadowXItem = menu.add(new MenuItem("Shadow X")); |
---|
.. | .. |
---|
269 | 277 | pointflowItem = menu.add(new MenuItem("Point Flow")); |
---|
270 | 278 | pointflowItem.addActionListener(this); |
---|
271 | 279 | menu.add("-"); |
---|
272 | | - transformgeometryItem = menu.add(new MenuItem("Transform Geometry")); |
---|
273 | | - transformgeometryItem.addActionListener(this); |
---|
274 | 280 | resetTransformItem = menu.add(new MenuItem("Reset Transform")); |
---|
275 | 281 | resetTransformItem.addActionListener(this); |
---|
276 | 282 | resetCentroidItem = menu.add(new MenuItem("Reset Centroid")); |
---|
277 | 283 | 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); |
---|
280 | 286 | |
---|
281 | 287 | oe.menuBar.add(menu = new Menu("Geometry")); |
---|
282 | 288 | genUVItem = menu.add(new MenuItem("Generate UV")); |
---|
.. | .. |
---|
285 | 291 | genNormalsORGANItem.addActionListener(this); |
---|
286 | 292 | genNormalsCADItem = menu.add(new MenuItem("CAD Normals")); |
---|
287 | 293 | 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); |
---|
288 | 298 | stripifyItem = menu.add(new MenuItem("Stripify")); |
---|
289 | 299 | stripifyItem.addActionListener(this); |
---|
290 | 300 | unstripifyItem = menu.add(new MenuItem("Unstripify")); |
---|
.. | .. |
---|
380 | 390 | |
---|
381 | 391 | |
---|
382 | 392 | oe.menuBar.add(menu = new Menu("Include")); |
---|
383 | | - importGFDItem = menu.add(new MenuItem("GraphreeD Object...")); |
---|
| 393 | + importGFDItem = menu.add(new MenuItem("GrafreeD Object...")); |
---|
384 | 394 | importGFDItem.addActionListener(this); |
---|
385 | 395 | importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D Object...")); |
---|
386 | 396 | importVRMLX3DItem.addActionListener(this); |
---|
.. | .. |
---|
510 | 520 | |
---|
511 | 521 | oe.toolbarPanel.add(flashSelectionButton = new cButton(" ? ")); //, oe.aConstraints); |
---|
512 | 522 | flashSelectionButton.addActionListener(this); |
---|
| 523 | + |
---|
| 524 | + oe.toolbarPanel.add(new cButton(" ", false)); |
---|
| 525 | + |
---|
513 | 526 | oe.aConstraints.gridx += 1; |
---|
514 | 527 | oe.aConstraints.weighty = 0; |
---|
515 | 528 | oe.aConstraints.gridwidth = 1; |
---|
.. | .. |
---|
636 | 649 | |
---|
637 | 650 | void EditObject(Object3D obj) |
---|
638 | 651 | { |
---|
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(); |
---|
| 652 | + cRadio radioButton = new cRadio(obj.name); |
---|
| 653 | + radioButton.SetObject(obj); |
---|
| 654 | + radioButton.layout = sevenButton; |
---|
| 655 | + radioButton.SetCamera(cameraView.renderCamera, false); |
---|
| 656 | + radioButton.addActionListener(this); |
---|
| 657 | + radioPanel.add(radioButton); |
---|
| 658 | + buttonGroup.add(radioButton); |
---|
| 659 | + radioButton.doClick(); |
---|
647 | 660 | } |
---|
648 | 661 | void SetupViews(ObjEditor oe) |
---|
649 | 662 | { |
---|
.. | .. |
---|
705 | 718 | dropAttributes |= Object3D.TEXTURE; |
---|
706 | 719 | else |
---|
707 | 720 | dropAttributes &= ~Object3D.TEXTURE; |
---|
708 | | - } |
---|
709 | | - else if(e.getSource() == liveCB) |
---|
| 721 | + } else if(e.getSource() == liveCB) |
---|
710 | 722 | { |
---|
711 | 723 | cameraView.ToggleLive(); |
---|
712 | 724 | } |
---|
.. | .. |
---|
1033 | 1045 | torusItem.addActionListener(this); |
---|
1034 | 1046 | superItem = menu.add(new MenuItem("Superellipsoid")); |
---|
1035 | 1047 | superItem.addActionListener(this); |
---|
| 1048 | + kleinItem = menu.add(new MenuItem("Klein Bottle")); |
---|
| 1049 | + kleinItem.addActionListener(this); |
---|
1036 | 1050 | particleItem = menu.add(new MenuItem("Particle system")); |
---|
1037 | 1051 | particleItem.addActionListener(this); |
---|
1038 | 1052 | ragdollItem = menu.add(new MenuItem("Rag Walk")); |
---|
.. | .. |
---|
1106 | 1120 | resetParentItem.addActionListener(this); |
---|
1107 | 1121 | repairParentItem = menu.add(new MenuItem("Repair Parent")); |
---|
1108 | 1122 | repairParentItem.addActionListener(this); |
---|
| 1123 | + repairShadowItem = menu.add(new MenuItem("Repair Shadow")); |
---|
| 1124 | + repairShadowItem.addActionListener(this); |
---|
1109 | 1125 | menu.add(invariantsItem = new MenuItem("Invariants")); |
---|
1110 | 1126 | invariantsItem.addActionListener(this); |
---|
1111 | 1127 | menu.add(recompileItem = new MenuItem("Recompile")); |
---|
.. | .. |
---|
1441 | 1457 | |
---|
1442 | 1458 | void Overwrite(int mask) |
---|
1443 | 1459 | { |
---|
1444 | | - if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1) |
---|
| 1460 | + if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
1445 | 1461 | { |
---|
1446 | | - Object3D content = GraphreeD.clipboard.get(0); |
---|
| 1462 | + Object3D content = GrafreeD.clipboard.get(0); |
---|
1447 | 1463 | |
---|
1448 | 1464 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
1449 | 1465 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
1592 | 1608 | if (event.getSource() == superItem) |
---|
1593 | 1609 | { |
---|
1594 | 1610 | makeSomething(new Superellipsoid()); |
---|
| 1611 | + } else |
---|
| 1612 | + if (event.getSource() == kleinItem) |
---|
| 1613 | + { |
---|
| 1614 | + makeSomething(new Klein()); |
---|
1595 | 1615 | } else |
---|
1596 | 1616 | if (event.getSource() == blobItem) |
---|
1597 | 1617 | { |
---|
.. | .. |
---|
1778 | 1798 | if (event.getSource() == invariantsItem) |
---|
1779 | 1799 | { |
---|
1780 | 1800 | System.out.println("Invariants:"); |
---|
1781 | | - GraphreeD.theApplet3D.universe.invariants(); |
---|
| 1801 | + GrafreeD.grafreeD.universe.invariants(); |
---|
1782 | 1802 | } else |
---|
1783 | 1803 | if (event.getSource() == memoryItem) |
---|
1784 | 1804 | { |
---|
.. | .. |
---|
1848 | 1868 | } else |
---|
1849 | 1869 | if (event.getSource() == duplicateItem) |
---|
1850 | 1870 | { |
---|
1851 | | - Object3D keep = GraphreeD.clipboard; |
---|
| 1871 | + Object3D keep = GrafreeD.clipboard; |
---|
1852 | 1872 | loadClipboard(false); |
---|
1853 | 1873 | paste(false); |
---|
1854 | | - GraphreeD.clipboard = keep; |
---|
| 1874 | + GrafreeD.clipboard = keep; |
---|
1855 | 1875 | } else |
---|
1856 | 1876 | if (event.getSource() == cloneItem) |
---|
1857 | 1877 | { |
---|
.. | .. |
---|
1895 | 1915 | } else |
---|
1896 | 1916 | if (event.getSource() == overwriteMatItem) |
---|
1897 | 1917 | { |
---|
| 1918 | + /* july 2015 |
---|
1898 | 1919 | if ((dropAttributes & Object3D.TEXTURE) == 0) |
---|
1899 | | - Overwrite(Object3D.MATERIAL); |
---|
| 1920 | + Overwrite(Object3D.MATERIAL | Object3D.COLOR); |
---|
1900 | 1921 | else |
---|
1901 | 1922 | { |
---|
1902 | 1923 | if ((dropAttributes & Object3D.COLOR) == 0 && (dropAttributes & Object3D.MATERIAL) == 0) |
---|
.. | .. |
---|
1908 | 1929 | Overwrite(Object3D.MATERIAL | Object3D.TEXTURE); |
---|
1909 | 1930 | } |
---|
1910 | 1931 | } |
---|
| 1932 | + */ |
---|
| 1933 | + |
---|
| 1934 | + Overwrite(dropAttributes); |
---|
1911 | 1935 | } |
---|
1912 | 1936 | if (event.getSource() == overwriteGeoItem) |
---|
1913 | 1937 | { |
---|
1914 | 1938 | Overwrite(Object3D.GEOMETRY); |
---|
1915 | | -// if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1) |
---|
| 1939 | +// if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
1916 | 1940 | // { |
---|
1917 | | -// Object3D content = GraphreeD.clipboard.get(0); |
---|
| 1941 | +// Object3D content = GrafreeD.clipboard.get(0); |
---|
1918 | 1942 | // |
---|
1919 | 1943 | // if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
1920 | 1944 | // content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
1997 | 2021 | if (group.selection.size() == 1) |
---|
1998 | 2022 | one = true; |
---|
1999 | 2023 | |
---|
| 2024 | + Object3D merge = null; |
---|
| 2025 | + |
---|
2000 | 2026 | Object3D content = new cGroup(); |
---|
2001 | 2027 | |
---|
2002 | 2028 | for (int i=0; i<group.selection.size(); i++) |
---|
2003 | 2029 | { |
---|
2004 | | - Object3D sel = new Merge(group.selection.get(i)); |
---|
| 2030 | + merge = new Merge(group.selection.get(i)); |
---|
2005 | 2031 | |
---|
2006 | 2032 | if (one) |
---|
2007 | | - makeSomething(sel, false); |
---|
| 2033 | + makeSomething(merge, false); |
---|
2008 | 2034 | else |
---|
2009 | | - content.addChild(sel); |
---|
| 2035 | + content.addChild(merge); |
---|
2010 | 2036 | } |
---|
2011 | 2037 | |
---|
2012 | 2038 | if (!one) |
---|
2013 | | - makeSomething(content, false); |
---|
2014 | | - |
---|
2015 | | - ResetModel(); |
---|
2016 | | - refreshContents(); |
---|
| 2039 | + makeSomething(content, true); |
---|
| 2040 | + else |
---|
| 2041 | + { |
---|
| 2042 | + ResetModel(); |
---|
| 2043 | + Select(merge.GetTreePath(), true, false); // unselect... false); |
---|
| 2044 | + refreshContents(); |
---|
| 2045 | + } |
---|
2017 | 2046 | } else |
---|
2018 | 2047 | if (event.getSource() == mergeGeometriesItem) |
---|
2019 | 2048 | { |
---|
.. | .. |
---|
2047 | 2076 | } else |
---|
2048 | 2077 | if (event.getSource() == linkverticesItem) |
---|
2049 | 2078 | { |
---|
2050 | | -// if (group.selection.size() == 1 && GraphreeD.clipboard.size() == 1) |
---|
| 2079 | +// if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1) |
---|
2051 | 2080 | // { |
---|
2052 | | -// Object3D content = GraphreeD.clipboard.get(0); |
---|
| 2081 | +// Object3D content = GrafreeD.clipboard.get(0); |
---|
2053 | 2082 | // |
---|
2054 | 2083 | // if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2055 | 2084 | // content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2058 | 2087 | // group.selection.get(0).setMasterThis(content); // should be identity |
---|
2059 | 2088 | // refreshContents(); |
---|
2060 | 2089 | // } |
---|
2061 | | - if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1) |
---|
| 2090 | + if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
2062 | 2091 | { |
---|
2063 | | - Object3D content = GraphreeD.clipboard.get(0); |
---|
| 2092 | + Object3D content = GrafreeD.clipboard.get(0); |
---|
2064 | 2093 | |
---|
2065 | 2094 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2066 | 2095 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2090 | 2119 | |
---|
2091 | 2120 | refreshContents(); |
---|
2092 | 2121 | } else |
---|
| 2122 | + if (event.getSource() == relinkverticesItem) |
---|
| 2123 | + { |
---|
| 2124 | + boolean random = CameraPane.RANDOM; |
---|
| 2125 | + CameraPane.RANDOM = false; // parse all random nodes |
---|
| 2126 | + group.selection.RelinkToSupport(); |
---|
| 2127 | + CameraPane.RANDOM = random; |
---|
| 2128 | + |
---|
| 2129 | + refreshContents(); |
---|
| 2130 | + } else |
---|
2093 | 2131 | if (event.getSource() == resetreferencesItem) |
---|
2094 | 2132 | { |
---|
2095 | 2133 | for (int i=0; i<group.selection.size(); i++) |
---|
.. | .. |
---|
2101 | 2139 | } else |
---|
2102 | 2140 | if (event.getSource() == setMasterItem) |
---|
2103 | 2141 | { |
---|
2104 | | - if (group.selection.size() == 1 && GraphreeD.clipboard.size() == 1) |
---|
| 2142 | + if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1) |
---|
2105 | 2143 | { |
---|
2106 | | - Object3D content = GraphreeD.clipboard.get(0); |
---|
| 2144 | + Object3D content = GrafreeD.clipboard.get(0); |
---|
2107 | 2145 | |
---|
2108 | 2146 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2109 | 2147 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2116 | 2154 | { |
---|
2117 | 2155 | if (group.selection.size() == 1) |
---|
2118 | 2156 | { |
---|
2119 | | - if (GraphreeD.clipboard.size() == 1) |
---|
| 2157 | + if (GrafreeD.clipboard.size() == 1) |
---|
2120 | 2158 | { |
---|
2121 | | - Object3D content = GraphreeD.clipboard.get(0); |
---|
| 2159 | + Object3D content = GrafreeD.clipboard.get(0); |
---|
2122 | 2160 | |
---|
2123 | 2161 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
2124 | 2162 | content = ((cGroup)content).get(0); |
---|
.. | .. |
---|
2158 | 2196 | if (event.getSource() == grabItem) |
---|
2159 | 2197 | { |
---|
2160 | 2198 | group(new cGroup(), true); |
---|
| 2199 | + } else |
---|
| 2200 | + if (event.getSource() == hideItem) |
---|
| 2201 | + { |
---|
| 2202 | + group(new HiddenObject()); |
---|
2161 | 2203 | } else |
---|
2162 | 2204 | if (event.getSource() == frontItem) |
---|
2163 | 2205 | { |
---|
.. | .. |
---|
2281 | 2323 | { |
---|
2282 | 2324 | group(new TextureNode()); |
---|
2283 | 2325 | } else |
---|
| 2326 | + if (event.getSource() == billboardItem) |
---|
| 2327 | + { |
---|
| 2328 | + group(new BillboardNode()); |
---|
| 2329 | + } else |
---|
2284 | 2330 | if (event.getSource() == shadowXItem) |
---|
2285 | 2331 | { |
---|
2286 | 2332 | CastShadow(0); |
---|
.. | .. |
---|
2295 | 2341 | } else |
---|
2296 | 2342 | if (event.getSource() == ungroupItem) |
---|
2297 | 2343 | { |
---|
2298 | | - ungroup(); |
---|
| 2344 | + //ungroup(); |
---|
| 2345 | + for (int i=0; i<group.selection.size(); i++) |
---|
| 2346 | + { |
---|
| 2347 | + Ungroup(group.selection.get(i)); |
---|
| 2348 | + } |
---|
| 2349 | + |
---|
| 2350 | + ClearSelection(false); |
---|
| 2351 | + |
---|
| 2352 | + refreshContents(); |
---|
2299 | 2353 | } else |
---|
2300 | 2354 | if (event.getSource() == genUVItem) |
---|
2301 | 2355 | { |
---|
.. | .. |
---|
2305 | 2359 | { |
---|
2306 | 2360 | GenNormals(true); |
---|
2307 | 2361 | } else |
---|
| 2362 | + if (event.getSource() == genNormalsMESHItem) |
---|
| 2363 | + { |
---|
| 2364 | + GenNormals(true); // TODO |
---|
| 2365 | + } else |
---|
2308 | 2366 | if (event.getSource() == genNormalsORGANItem) |
---|
2309 | 2367 | { |
---|
2310 | 2368 | GenNormals(false); |
---|
| 2369 | + } else |
---|
| 2370 | + if (event.getSource() == genNormalsMINEItem) |
---|
| 2371 | + { |
---|
| 2372 | + GenNormalsMINE(); |
---|
2311 | 2373 | } else |
---|
2312 | 2374 | if (event.getSource() == stripifyItem) |
---|
2313 | 2375 | { |
---|
.. | .. |
---|
2485 | 2547 | |
---|
2486 | 2548 | refreshContents(); |
---|
2487 | 2549 | } else |
---|
| 2550 | + if (event.getSource() == repairShadowItem) |
---|
| 2551 | + { |
---|
| 2552 | + for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
| 2553 | + { |
---|
| 2554 | + Object3D obj = (Object3D)e.nextElement(); |
---|
| 2555 | + obj.RepairShadow(); |
---|
| 2556 | +// for (int i=0; i<obj.size(); i++) |
---|
| 2557 | +// { |
---|
| 2558 | +// obj.get(i).parent = obj; |
---|
| 2559 | +// } |
---|
| 2560 | + } |
---|
| 2561 | + |
---|
| 2562 | + refreshContents(); |
---|
| 2563 | + } else |
---|
2488 | 2564 | if (event.getSource() == sortbysizeItem) |
---|
2489 | 2565 | { |
---|
2490 | 2566 | for (Enumeration e = group.selection.elements(); e.hasMoreElements();) |
---|
.. | .. |
---|
2580 | 2656 | // bug |
---|
2581 | 2657 | //gridPanel.setDividerLocation(1.0); |
---|
2582 | 2658 | //bigPanel.setDividerLocation(0.0); |
---|
2583 | | - bigThree.remove(jtp); |
---|
2584 | | - bigThree.remove(cameraPanel); |
---|
| 2659 | + bigThree.remove(scenePanel); |
---|
| 2660 | + bigThree.remove(centralPanel); |
---|
2585 | 2661 | bigThree.remove(XYZPanel); |
---|
2586 | 2662 | aWindowConstraints.gridx = 0; |
---|
2587 | 2663 | aWindowConstraints.gridy = 0; |
---|
.. | .. |
---|
2596 | 2672 | // aConstraints.gridheight = 3; |
---|
2597 | 2673 | aWindowConstraints.gridx = 1; |
---|
2598 | 2674 | aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
2599 | | - bigThree.add(cameraPanel, aWindowConstraints); |
---|
| 2675 | + bigThree.add(centralPanel, aWindowConstraints); |
---|
2600 | 2676 | aWindowConstraints.weightx = 0; |
---|
2601 | 2677 | aWindowConstraints.gridx = 4; |
---|
2602 | 2678 | aWindowConstraints.gridwidth = 1; |
---|
.. | .. |
---|
2608 | 2684 | if (event.getSource() == threeButton) |
---|
2609 | 2685 | { |
---|
2610 | 2686 | radio.layout = threeButton; |
---|
2611 | | - bigThree.remove(jtp); |
---|
2612 | | - bigThree.remove(cameraPanel); |
---|
| 2687 | + bigThree.remove(scenePanel); |
---|
| 2688 | + bigThree.remove(centralPanel); |
---|
2613 | 2689 | bigThree.remove(XYZPanel); |
---|
2614 | 2690 | aWindowConstraints.gridx = 0; |
---|
2615 | 2691 | aWindowConstraints.gridy = 0; |
---|
.. | .. |
---|
2624 | 2700 | // aConstraints.gridheight = 3; |
---|
2625 | 2701 | aWindowConstraints.gridx = 1; |
---|
2626 | 2702 | aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
2627 | | - bigThree.add(cameraPanel, aWindowConstraints); |
---|
| 2703 | + bigThree.add(centralPanel, aWindowConstraints); |
---|
2628 | 2704 | aWindowConstraints.weightx = 0; |
---|
2629 | 2705 | aWindowConstraints.gridx = 4; |
---|
2630 | 2706 | aWindowConstraints.gridwidth = 1; |
---|
.. | .. |
---|
2636 | 2712 | if (event.getSource() == fourButton) |
---|
2637 | 2713 | { |
---|
2638 | 2714 | radio.layout = fourButton; |
---|
2639 | | - bigThree.remove(jtp); |
---|
2640 | | - bigThree.remove(cameraPanel); |
---|
| 2715 | + bigThree.remove(scenePanel); |
---|
| 2716 | + bigThree.remove(centralPanel); |
---|
2641 | 2717 | bigThree.remove(XYZPanel); |
---|
2642 | 2718 | aWindowConstraints.gridx = 0; |
---|
2643 | 2719 | aWindowConstraints.gridy = 0; |
---|
.. | .. |
---|
2646 | 2722 | aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
2647 | 2723 | aWindowConstraints.weightx = 1; |
---|
2648 | 2724 | aWindowConstraints.weighty = 1; |
---|
2649 | | - bigThree.add(jtp, aWindowConstraints); |
---|
| 2725 | + bigThree.add(scenePanel, aWindowConstraints); |
---|
2650 | 2726 | aWindowConstraints.weightx = 1; |
---|
2651 | 2727 | aWindowConstraints.gridwidth = 3; |
---|
2652 | 2728 | // aConstraints.gridheight = 3; |
---|
.. | .. |
---|
2664 | 2740 | if (event.getSource() == sixButton) |
---|
2665 | 2741 | { |
---|
2666 | 2742 | radio.layout = sixButton; |
---|
2667 | | - bigThree.remove(jtp); |
---|
2668 | | - bigThree.remove(cameraPanel); |
---|
| 2743 | + bigThree.remove(scenePanel); |
---|
| 2744 | + bigThree.remove(centralPanel); |
---|
2669 | 2745 | bigThree.remove(XYZPanel); |
---|
2670 | 2746 | aWindowConstraints.gridx = 0; |
---|
2671 | 2747 | aWindowConstraints.gridy = 0; |
---|
.. | .. |
---|
2674 | 2750 | aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2675 | 2751 | aWindowConstraints.weightx = 0; |
---|
2676 | 2752 | aWindowConstraints.weighty = 1; |
---|
2677 | | - bigThree.add(jtp, aWindowConstraints); |
---|
| 2753 | + bigThree.add(scenePanel, aWindowConstraints); |
---|
2678 | 2754 | aWindowConstraints.weightx = 1; |
---|
2679 | 2755 | aWindowConstraints.gridwidth = 3; |
---|
2680 | 2756 | // aWindowConstraints.gridheight = 3; |
---|
2681 | 2757 | aWindowConstraints.gridx = 1; |
---|
2682 | 2758 | aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
2683 | | - bigThree.add(cameraPanel, aWindowConstraints); |
---|
| 2759 | + bigThree.add(centralPanel, aWindowConstraints); |
---|
2684 | 2760 | aWindowConstraints.weightx = 0; |
---|
2685 | 2761 | aWindowConstraints.gridx = 4; |
---|
2686 | 2762 | aWindowConstraints.gridwidth = 1; |
---|
.. | .. |
---|
2692 | 2768 | if (event.getSource() == sevenButton) |
---|
2693 | 2769 | { |
---|
2694 | 2770 | radio.layout = sevenButton; |
---|
2695 | | - bigThree.remove(jtp); |
---|
2696 | | - bigThree.remove(cameraPanel); |
---|
| 2771 | + bigThree.remove(scenePanel); |
---|
| 2772 | + bigThree.remove(centralPanel); |
---|
2697 | 2773 | bigThree.remove(XYZPanel); |
---|
2698 | 2774 | aWindowConstraints.gridx = 0; |
---|
2699 | 2775 | aWindowConstraints.gridy = 0; |
---|
.. | .. |
---|
2702 | 2778 | aWindowConstraints.fill = GridBagConstraints.VERTICAL; |
---|
2703 | 2779 | aWindowConstraints.weightx = 0; |
---|
2704 | 2780 | aWindowConstraints.weighty = 1; |
---|
2705 | | - bigThree.add(jtp, aWindowConstraints); |
---|
| 2781 | + bigThree.add(scenePanel, aWindowConstraints); |
---|
2706 | 2782 | aWindowConstraints.weightx = 1; |
---|
2707 | 2783 | aWindowConstraints.gridwidth = 3; |
---|
2708 | 2784 | // aWindowConstraints.gridheight = 3; |
---|
2709 | 2785 | aWindowConstraints.gridx = 1; |
---|
2710 | 2786 | aWindowConstraints.fill = GridBagConstraints.BOTH; |
---|
2711 | | - bigThree.add(cameraPanel, aWindowConstraints); |
---|
| 2787 | + bigThree.add(centralPanel, aWindowConstraints); |
---|
2712 | 2788 | aWindowConstraints.weightx = 0; |
---|
2713 | 2789 | aWindowConstraints.gridx = 4; |
---|
2714 | 2790 | aWindowConstraints.gridwidth = 1; |
---|
.. | .. |
---|
2806 | 2882 | if (event.getSource() == unselectButton) |
---|
2807 | 2883 | { |
---|
2808 | 2884 | objEditor.jTree.clearSelection(); |
---|
2809 | | - // ?? oct 2012 GraphreeD.clipboard.clear(); |
---|
| 2885 | + // ?? oct 2012 GrafreeD.clipboard.clear(); |
---|
2810 | 2886 | objEditor.ResetSliders(); |
---|
2811 | 2887 | refreshContents(true); |
---|
2812 | 2888 | } else |
---|
.. | .. |
---|
3121 | 3197 | obj = (Object3D)e.nextElement(); |
---|
3122 | 3198 | |
---|
3123 | 3199 | System.out.println("Object is: " + obj); |
---|
3124 | | - GraphreeD.AnalyzeObject(obj); |
---|
| 3200 | + GrafreeD.AnalyzeObject(obj); |
---|
3125 | 3201 | System.out.println("Boundary rep: " + obj.bRep); |
---|
3126 | | - GraphreeD.AnalyzeObject(obj.bRep); |
---|
| 3202 | + GrafreeD.AnalyzeObject(obj.bRep); |
---|
3127 | 3203 | |
---|
3128 | 3204 | // System.err.println((size/1024) + " KB is the size of " + obj); |
---|
3129 | 3205 | } |
---|
.. | .. |
---|
3165 | 3241 | void GenNormals(boolean crease) |
---|
3166 | 3242 | { |
---|
3167 | 3243 | group.GenNormalsS(crease); |
---|
| 3244 | + |
---|
| 3245 | + refreshContents(); |
---|
| 3246 | + } |
---|
| 3247 | + |
---|
| 3248 | + void GenNormalsMINE() |
---|
| 3249 | + { |
---|
| 3250 | + group.selection.GenNormalsMINE(); |
---|
3168 | 3251 | |
---|
3169 | 3252 | refreshContents(); |
---|
3170 | 3253 | } |
---|
.. | .. |
---|
3250 | 3333 | // LA.matTranslate(g.toParent, temp.x, temp.y, temp.z); |
---|
3251 | 3334 | // LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z); |
---|
3252 | 3335 | // |
---|
3253 | | -// g.add(GraphreeD.clipboard); |
---|
| 3336 | +// g.add(GrafreeD.clipboard); |
---|
3254 | 3337 | // |
---|
3255 | 3338 | // buffer.add(g); |
---|
3256 | 3339 | // } |
---|
.. | .. |
---|
3269 | 3352 | // nodes = new Object3D(); |
---|
3270 | 3353 | // vertices = new Vector<Vertex>(); |
---|
3271 | 3354 | // |
---|
3272 | | -// boolean epsequal = GraphreeD.epsequal; |
---|
3273 | | -// GraphreeD.epsequal = true; |
---|
| 3355 | +// boolean epsequal = GrafreeD.epsequal; |
---|
| 3356 | +// GrafreeD.epsequal = true; |
---|
3274 | 3357 | // |
---|
3275 | 3358 | // for (int i=0; i<group.selection.size(); i++) |
---|
3276 | 3359 | // { |
---|
.. | .. |
---|
3311 | 3394 | // LA.matTranslate(g.toParent, temp.x, temp.y, temp.z); |
---|
3312 | 3395 | // LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z); |
---|
3313 | 3396 | // |
---|
3314 | | -// g.add(GraphreeD.clipboard); |
---|
| 3397 | +// g.add(GrafreeD.clipboard); |
---|
3315 | 3398 | // |
---|
3316 | 3399 | // buffer.add(g); |
---|
3317 | 3400 | // } |
---|
.. | .. |
---|
3319 | 3402 | // makeSomething(buffer, i==group.selection.size()-1); |
---|
3320 | 3403 | // } |
---|
3321 | 3404 | // |
---|
3322 | | -// GraphreeD.epsequal = epsequal; |
---|
| 3405 | +// GrafreeD.epsequal = epsequal; |
---|
3323 | 3406 | // |
---|
3324 | 3407 | // //buffer = null; |
---|
3325 | 3408 | // temprep = null; |
---|
.. | .. |
---|
3330 | 3413 | |
---|
3331 | 3414 | void ParseVertices() |
---|
3332 | 3415 | { |
---|
3333 | | - boolean epsequal = GraphreeD.epsequal; |
---|
3334 | | - GraphreeD.epsequal = true; |
---|
| 3416 | + boolean epsequal = GrafreeD.epsequal; |
---|
| 3417 | + GrafreeD.epsequal = true; |
---|
3335 | 3418 | |
---|
3336 | 3419 | for (int i=0; i<group.selection.size(); i++) |
---|
3337 | 3420 | { |
---|
.. | .. |
---|
3356 | 3439 | LA.matTranslate(g.toParent, temp.x, temp.y, temp.z); |
---|
3357 | 3440 | LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z); |
---|
3358 | 3441 | |
---|
3359 | | - g.add(GraphreeD.clipboard); |
---|
| 3442 | + g.add(GrafreeD.clipboard); |
---|
3360 | 3443 | |
---|
3361 | 3444 | buffer.add(g); |
---|
3362 | 3445 | } |
---|
.. | .. |
---|
3371 | 3454 | makeSomething(buffer, i==group.selection.size()-1); |
---|
3372 | 3455 | } |
---|
3373 | 3456 | |
---|
3374 | | - GraphreeD.epsequal = epsequal; |
---|
| 3457 | + GrafreeD.epsequal = epsequal; |
---|
3375 | 3458 | |
---|
3376 | 3459 | refreshContents(); |
---|
3377 | 3460 | } |
---|
.. | .. |
---|
3416 | 3499 | scale /= 3; |
---|
3417 | 3500 | |
---|
3418 | 3501 | scale /= 0xFF; |
---|
3419 | | - scale /= 4; |
---|
| 3502 | + // c'est quoi ca? scale /= 4; |
---|
3420 | 3503 | |
---|
3421 | 3504 | //v.AO = scale; |
---|
3422 | 3505 | |
---|
.. | .. |
---|
3437 | 3520 | |
---|
3438 | 3521 | void Align() |
---|
3439 | 3522 | { |
---|
| 3523 | + if (group.selection.size() == 0) |
---|
| 3524 | + return; |
---|
| 3525 | + |
---|
| 3526 | + cVector bbmin = new cVector(); |
---|
| 3527 | + cVector bbmax = new cVector(); |
---|
| 3528 | + |
---|
| 3529 | + group.selection.get(0).getBounds(bbmin, bbmax, true); |
---|
| 3530 | + |
---|
| 3531 | + double dx = bbmax.x - bbmin.x; |
---|
| 3532 | + double dy = bbmax.y - bbmin.y; |
---|
| 3533 | + double dz = bbmax.z - bbmin.z; |
---|
| 3534 | + |
---|
| 3535 | + double scale = Math.sqrt(dx*dx + dy*dy + dz*dz); |
---|
| 3536 | + |
---|
3440 | 3537 | for (int i=0; i<group.selection.size(); i++) |
---|
3441 | 3538 | { |
---|
3442 | 3539 | Object3D obj = group.selection.get(i); |
---|
3443 | 3540 | |
---|
3444 | | - LA.matTranslate(obj.toParent, i/2f, 0, 0); |
---|
3445 | | - LA.matTranslateInv(obj.fromParent, -i/2f, 0, 0); |
---|
| 3541 | + LA.matTranslate(obj.toParent, i * scale, 0, 0); |
---|
| 3542 | + LA.matTranslateInv(obj.fromParent, -i * scale, 0, 0); |
---|
3446 | 3543 | } |
---|
3447 | 3544 | |
---|
3448 | 3545 | refreshContents(); |
---|
.. | .. |
---|
3455 | 3552 | // ref.SaveSupports(); |
---|
3456 | 3553 | // Object3D par = ref.parent; |
---|
3457 | 3554 | // ref.parent = null; |
---|
3458 | | -// Object3D lowres = (Object3D) GraphreeD.clone(ref); |
---|
| 3555 | +// Object3D lowres = (Object3D) GrafreeD.clone(ref); |
---|
3459 | 3556 | // ref.parent = par; |
---|
3460 | 3557 | // ref.RestoreSupports(); |
---|
3461 | 3558 | |
---|
.. | .. |
---|
3485 | 3582 | // lowres.SaveSupports(); |
---|
3486 | 3583 | // par = lowres.parent; |
---|
3487 | 3584 | // lowres.parent = null; |
---|
3488 | | -// Object3D newlow = (Object3D) GraphreeD.clone(lowres); |
---|
| 3585 | +// Object3D newlow = (Object3D) GrafreeD.clone(lowres); |
---|
3489 | 3586 | Object3D newlow = CloneObject(lowres, false); |
---|
3490 | 3587 | newlow.name = sn.switchobject.get(i).name; |
---|
3491 | 3588 | System.out.println(" pose#" + i + " = " + newlow); |
---|
.. | .. |
---|
3507 | 3604 | return; |
---|
3508 | 3605 | |
---|
3509 | 3606 | Object3D poses = group.selection.get(0); |
---|
3510 | | - Object3D ref = GraphreeD.clipboard.get(0); |
---|
| 3607 | + Object3D ref = GrafreeD.clipboard.get(0); |
---|
3511 | 3608 | |
---|
3512 | 3609 | Object3D newgroup = new Object3D("Po:" + poses.name); |
---|
3513 | 3610 | |
---|
.. | .. |
---|
3701 | 3798 | |
---|
3702 | 3799 | void ClipMesh() |
---|
3703 | 3800 | { |
---|
3704 | | - if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1) |
---|
| 3801 | + if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1) |
---|
3705 | 3802 | { |
---|
3706 | | - Object3D content = GraphreeD.clipboard.get(0); |
---|
| 3803 | + Object3D content = GrafreeD.clipboard.get(0); |
---|
3707 | 3804 | |
---|
3708 | 3805 | if (content instanceof cGroup && ((cGroup)content).transientlink ) |
---|
3709 | 3806 | content = ((cGroup)content).get(0); |
---|
3710 | 3807 | |
---|
3711 | 3808 | // for (int i=0; i<group.selection.size(); i++) |
---|
3712 | 3809 | // { |
---|
3713 | | -// group.selection.get(i).ClipMesh(GraphreeD.clipboard); |
---|
| 3810 | +// group.selection.get(i).ClipMesh(GrafreeD.clipboard); |
---|
3714 | 3811 | // } |
---|
3715 | | - group.selection.ClipMesh(GraphreeD.clipboard); |
---|
| 3812 | + group.selection.ClipMesh(GrafreeD.clipboard); |
---|
3716 | 3813 | } |
---|
3717 | | -// group.selection.ClipMesh(GraphreeD.clipboard); |
---|
| 3814 | +// group.selection.ClipMesh(GrafreeD.clipboard); |
---|
3718 | 3815 | System.out.println("DONE."); |
---|
3719 | 3816 | refreshContents(); |
---|
3720 | 3817 | } |
---|
.. | .. |
---|
4052 | 4149 | { |
---|
4053 | 4150 | if (group.selection.isEmpty()) |
---|
4054 | 4151 | return; |
---|
4055 | | - GraphreeD.clipboardIsTempGroup = false; |
---|
| 4152 | + GrafreeD.clipboardIsTempGroup = false; |
---|
4056 | 4153 | Composite tGroup = null; |
---|
4057 | 4154 | if (group.selection.size() > 0) // 1) |
---|
4058 | 4155 | { |
---|
4059 | 4156 | tGroup = new cGroup(); |
---|
4060 | | - GraphreeD.clipboardIsTempGroup = true; |
---|
| 4157 | + GrafreeD.clipboardIsTempGroup = true; |
---|
4061 | 4158 | } |
---|
4062 | 4159 | |
---|
4063 | 4160 | if (cut) |
---|
.. | .. |
---|
4097 | 4194 | //System.out.println("cut " + child); |
---|
4098 | 4195 | //System.out.println("parent = " + child.parent); |
---|
4099 | 4196 | // tmp.addChild(child); |
---|
4100 | | - if (GraphreeD.clipboardIsTempGroup) |
---|
| 4197 | + if (GrafreeD.clipboardIsTempGroup) |
---|
4101 | 4198 | tGroup.add/*Child*/(tmp); |
---|
4102 | 4199 | else |
---|
4103 | | - GraphreeD.clipboard = tmp; |
---|
| 4200 | + GrafreeD.clipboard = tmp; |
---|
4104 | 4201 | } |
---|
4105 | 4202 | else |
---|
4106 | | - if (GraphreeD.clipboardIsTempGroup) |
---|
| 4203 | + if (GrafreeD.clipboardIsTempGroup) |
---|
4107 | 4204 | tGroup.add/*Child*/(child); |
---|
4108 | 4205 | else |
---|
4109 | | - GraphreeD.clipboard = child; |
---|
| 4206 | + GrafreeD.clipboard = child; |
---|
4110 | 4207 | } |
---|
4111 | 4208 | |
---|
4112 | 4209 | //ResetModel(); |
---|
.. | .. |
---|
4138 | 4235 | //System.out.println("cut " + elem); |
---|
4139 | 4236 | //System.out.println("parent = " + elem.parent); |
---|
4140 | 4237 | // tmp.addChild(elem); |
---|
4141 | | - if (GraphreeD.clipboardIsTempGroup) |
---|
| 4238 | + if (GrafreeD.clipboardIsTempGroup) |
---|
4142 | 4239 | tGroup.add/*Child*/(tmp); |
---|
4143 | 4240 | else |
---|
4144 | | - GraphreeD.clipboard = tmp; |
---|
| 4241 | + GrafreeD.clipboard = tmp; |
---|
4145 | 4242 | } |
---|
4146 | 4243 | else |
---|
4147 | | - if (GraphreeD.clipboardIsTempGroup) |
---|
| 4244 | + if (GrafreeD.clipboardIsTempGroup) |
---|
4148 | 4245 | tGroup.add/*Child*/(child); |
---|
4149 | 4246 | else |
---|
4150 | | - GraphreeD.clipboard = child; |
---|
| 4247 | + GrafreeD.clipboard = child; |
---|
4151 | 4248 | } |
---|
4152 | 4249 | |
---|
4153 | 4250 | } |
---|
4154 | | - if (GraphreeD.clipboardIsTempGroup) |
---|
4155 | | - GraphreeD.clipboard = tGroup; |
---|
| 4251 | + if (GrafreeD.clipboardIsTempGroup) |
---|
| 4252 | + GrafreeD.clipboard = tGroup; |
---|
4156 | 4253 | if (cut) |
---|
4157 | 4254 | { |
---|
4158 | 4255 | ResetModel(); |
---|
.. | .. |
---|
4162 | 4259 | |
---|
4163 | 4260 | void paste(boolean expand) |
---|
4164 | 4261 | { |
---|
4165 | | - // if (GraphreeD.clipboard == null) |
---|
| 4262 | + // if (GrafreeD.clipboard == null) |
---|
4166 | 4263 | // return; |
---|
4167 | 4264 | boolean first = true; |
---|
4168 | 4265 | |
---|
4169 | | - if (GraphreeD.clipboardIsTempGroup) |
---|
| 4266 | + if (GrafreeD.clipboardIsTempGroup) |
---|
4170 | 4267 | { |
---|
4171 | 4268 | Composite temp; |
---|
4172 | 4269 | |
---|
.. | .. |
---|
4177 | 4274 | temp = (Composite)Applet3D.clipboard.deepCopy(); |
---|
4178 | 4275 | */ |
---|
4179 | 4276 | Object3D elem; |
---|
4180 | | - for (Enumeration e = /*temp.children*/GraphreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name)) |
---|
| 4277 | + for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name)) |
---|
4181 | 4278 | { |
---|
4182 | 4279 | Object3D child = (Object3D)e.nextElement(); |
---|
4183 | 4280 | |
---|
.. | .. |
---|
4191 | 4288 | else |
---|
4192 | 4289 | elem = child.deepCopy(); // ? |
---|
4193 | 4290 | child.parent = keepparent; |
---|
4194 | | - //if (GraphreeD.clipboardIsTempGroup && LA.isIdentity(elem.fromParent)) |
---|
| 4291 | + //if (GrafreeD.clipboardIsTempGroup && LA.isIdentity(elem.fromParent)) |
---|
4195 | 4292 | // elem = elem.get(0); |
---|
4196 | 4293 | makeSomething(elem, true); // ?? first); |
---|
4197 | 4294 | //group.addChild(elem); |
---|
.. | .. |
---|
4211 | 4308 | //Object3D cb = Applet3D.clipboard; |
---|
4212 | 4309 | //temp.addChild(cb); |
---|
4213 | 4310 | //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()); |
---|
| 4311 | + assert(GrafreeD.clipboard.parent == null); |
---|
| 4312 | + Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent; |
---|
| 4313 | + GrafreeD.clipboard.get(0).parent = null; // Avoid copy? |
---|
| 4314 | + if (LA.isIdentity(GrafreeD.clipboard.toParent)) |
---|
| 4315 | + makeSomething(expand?GrafreeD.clipboard.get(0).copyExpand():GrafreeD.clipboard.get(0).deepCopy()); |
---|
4219 | 4316 | else |
---|
4220 | | - makeSomething(expand?GraphreeD.clipboard.copyExpand():GraphreeD.clipboard.deepCopy()); |
---|
4221 | | - GraphreeD.clipboard.get(0).parent = keepparent; |
---|
| 4317 | + makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy()); |
---|
| 4318 | + GrafreeD.clipboard.get(0).parent = keepparent; |
---|
4222 | 4319 | } |
---|
4223 | 4320 | |
---|
4224 | 4321 | ResetModel(); |
---|
.. | .. |
---|
4227 | 4324 | |
---|
4228 | 4325 | void pasteInto(boolean copyit) |
---|
4229 | 4326 | { |
---|
4230 | | -// if (GraphreeD.clipboard == null) |
---|
| 4327 | +// if (GrafreeD.clipboard == null) |
---|
4231 | 4328 | // return; |
---|
4232 | 4329 | |
---|
4233 | 4330 | if (group.selection.size() != 1) |
---|
.. | .. |
---|
4260 | 4357 | { |
---|
4261 | 4358 | boolean first = true; |
---|
4262 | 4359 | |
---|
4263 | | - if (GraphreeD.clipboardIsTempGroup) |
---|
| 4360 | + if (GrafreeD.clipboardIsTempGroup) |
---|
4264 | 4361 | { |
---|
4265 | | - Composite temp = (Composite)GraphreeD.clipboard; |
---|
| 4362 | + Composite temp = (Composite)GrafreeD.clipboard; |
---|
4266 | 4363 | Object3D copy; |
---|
4267 | 4364 | for (Enumeration e = temp.children.elements(); e.hasMoreElements();) |
---|
4268 | 4365 | { |
---|
.. | .. |
---|
4272 | 4369 | } |
---|
4273 | 4370 | } else |
---|
4274 | 4371 | { |
---|
4275 | | - linkSomething(GraphreeD.clipboard); //.get(0)); |
---|
| 4372 | + linkSomething(GrafreeD.clipboard); //.get(0)); |
---|
4276 | 4373 | } |
---|
4277 | 4374 | } |
---|
4278 | 4375 | } |
---|
.. | .. |
---|
4464 | 4561 | makeSomething(csg); |
---|
4465 | 4562 | } |
---|
4466 | 4563 | |
---|
| 4564 | + void Ungroup(Object3D g) |
---|
| 4565 | + { |
---|
| 4566 | + if (g instanceof HiddenObject) |
---|
| 4567 | + { |
---|
| 4568 | + HiddenObject h = (HiddenObject) g; |
---|
| 4569 | + |
---|
| 4570 | + for (int i=0; i<h.ActualSize(); i++) |
---|
| 4571 | + { |
---|
| 4572 | + objEditor.makeSomething(h.get(i), false); |
---|
| 4573 | + } |
---|
| 4574 | + } |
---|
| 4575 | + else |
---|
| 4576 | + { |
---|
| 4577 | + for (int i=0; i<g.Size(); i++) |
---|
| 4578 | + { |
---|
| 4579 | + objEditor.makeSomething(g.get(i), false); |
---|
| 4580 | + } |
---|
| 4581 | + } |
---|
| 4582 | + } |
---|
| 4583 | + |
---|
4467 | 4584 | void ungroup() |
---|
4468 | 4585 | { |
---|
4469 | 4586 | /* |
---|
.. | .. |
---|
4659 | 4776 | |
---|
4660 | 4777 | void ImportGFD() |
---|
4661 | 4778 | { |
---|
4662 | | - FileDialog browser = new FileDialog(objEditor.frame, "Import GraphreeD", FileDialog.LOAD); |
---|
| 4779 | + FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD); |
---|
4663 | 4780 | browser.show(); |
---|
4664 | 4781 | String filename = browser.getFile(); |
---|
4665 | 4782 | if (filename != null && filename.length() > 0) |
---|
.. | .. |
---|
4697 | 4814 | |
---|
4698 | 4815 | void ImportVRMLX3D() |
---|
4699 | 4816 | { |
---|
4700 | | - if (GraphreeD.standAlone) |
---|
| 4817 | + if (GrafreeD.standAlone) |
---|
4701 | 4818 | { |
---|
4702 | 4819 | /**/ |
---|
4703 | 4820 | FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD); |
---|
.. | .. |
---|
4714 | 4831 | |
---|
4715 | 4832 | String GetFile(String dialogName) |
---|
4716 | 4833 | { |
---|
4717 | | - if (GraphreeD.standAlone) |
---|
| 4834 | + if (GrafreeD.standAlone) |
---|
4718 | 4835 | { |
---|
4719 | 4836 | FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD); |
---|
4720 | 4837 | browser.show(); |
---|
.. | .. |
---|
4823 | 4940 | private MenuItem resetsupportItem; |
---|
4824 | 4941 | private MenuItem resetreferencesItem; |
---|
4825 | 4942 | private MenuItem linkverticesItem; |
---|
| 4943 | + private MenuItem relinkverticesItem; |
---|
4826 | 4944 | private MenuItem setMasterItem; |
---|
4827 | 4945 | private MenuItem resetMeshItem; |
---|
4828 | 4946 | private MenuItem stepAllItem; |
---|
.. | .. |
---|
4841 | 4959 | private MenuItem clearItem; |
---|
4842 | 4960 | private MenuItem clearAllItem; |
---|
4843 | 4961 | private MenuItem genUVItem; |
---|
| 4962 | + private MenuItem genNormalsMESHItem; |
---|
4844 | 4963 | private MenuItem genNormalsCADItem; |
---|
4845 | 4964 | private MenuItem genNormalsORGANItem; |
---|
| 4965 | + private MenuItem genNormalsMINEItem; |
---|
4846 | 4966 | private MenuItem stripifyItem; |
---|
4847 | 4967 | private MenuItem unstripifyItem; |
---|
4848 | 4968 | private MenuItem trimItem; |
---|
.. | .. |
---|
4884 | 5004 | private MenuItem resetCentroidItem; |
---|
4885 | 5005 | private MenuItem transformgeometryItem; |
---|
4886 | 5006 | private MenuItem resetTransformItem; |
---|
| 5007 | + private MenuItem hideItem; |
---|
4887 | 5008 | private MenuItem grabItem; |
---|
4888 | 5009 | private MenuItem backItem; |
---|
4889 | 5010 | private MenuItem frontItem; |
---|
.. | .. |
---|
4904 | 5025 | |
---|
4905 | 5026 | private MenuItem resetParentItem; |
---|
4906 | 5027 | private MenuItem repairParentItem; |
---|
| 5028 | + private MenuItem repairShadowItem; |
---|
4907 | 5029 | private MenuItem sortbysizeItem; |
---|
4908 | 5030 | private MenuItem sortbynameItem; |
---|
4909 | 5031 | |
---|
.. | .. |
---|
4924 | 5046 | private MenuItem coneItem; |
---|
4925 | 5047 | private MenuItem torusItem; |
---|
4926 | 5048 | private MenuItem superItem; |
---|
| 5049 | + private MenuItem kleinItem; |
---|
4927 | 5050 | private MenuItem blobItem; |
---|
4928 | 5051 | private MenuItem latheItem; |
---|
4929 | 5052 | private MenuItem bezierItem; |
---|
.. | .. |
---|
4936 | 5059 | private MenuItem csgItem; |
---|
4937 | 5060 | private MenuItem templateItem; |
---|
4938 | 5061 | private MenuItem textureItem; |
---|
| 5062 | + private MenuItem billboardItem; |
---|
4939 | 5063 | private MenuItem shadowXItem; |
---|
4940 | 5064 | private MenuItem shadowYItem; |
---|
4941 | 5065 | private MenuItem shadowZItem; |
---|