Normand Briere
2018-07-01 89c1ad67bc65d24ceadfa9e95f8c5515283f1e97
GroupEditor.java
....@@ -14,7 +14,7 @@
1414
1515 //import buoy.widget.BFileChooser;
1616
17
-class GroupEditor extends ObjEditor implements iParse, //iCallBack,
17
+class GroupEditor extends ObjEditor implements //iParse, //iCallBack,
1818 ObjectUI,
1919 Runnable,
2020 ActionListener,
....@@ -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
....@@ -188,8 +188,9 @@
188188 clearItem.addActionListener(this);
189189 clearAllItem = menu.add(new MenuItem("Clear All"));
190190 clearAllItem.addActionListener(this);
191
- menu.add("-");
192
- resetMeshItem = menu.add(new MenuItem("Reset All"));
191
+
192
+ oe.menuBar.add(menu = new Menu("Setting"));
193
+ resetMeshItem = menu.add(new MenuItem("Reset All"));
193194 resetMeshItem.addActionListener(this);
194195 stepAllItem = menu.add(new MenuItem("Step All"));
195196 stepAllItem.addActionListener(this);
....@@ -218,18 +219,24 @@
218219 resetsupportItem.addActionListener(this);
219220 linkverticesItem = menu.add(new MenuItem("Link to Support"));
220221 linkverticesItem.addActionListener(this);
222
+ relinkverticesItem = menu.add(new MenuItem("Re-link to Support"));
223
+ relinkverticesItem.addActionListener(this);
221224 setMasterItem = menu.add(new MenuItem("Set Master Mesh"));
222225 setMasterItem.addActionListener(this);
223226
224
- oe.menuBar.add(menu = new Menu("Object"));
227
+ oe.menuBar.add(menu = new Menu("Group"));
225228 grabItem = menu.add(new MenuItem("Grab"));
226229 grabItem.addActionListener(this);
227
- frontItem = menu.add(new MenuItem("Front"));
228
- frontItem.addActionListener(this);
229230 backItem = menu.add(new MenuItem("Back"));
230231 backItem.addActionListener(this);
232
+ frontItem = menu.add(new MenuItem("Front"));
233
+ frontItem.addActionListener(this);
231234 compositeItem = menu.add(new MenuItem("Composite"));
232235 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);
233240 menu.add("-");
234241 randomItem = menu.add(new MenuItem("Random"));
235242 randomItem.addActionListener(this);
....@@ -247,9 +254,12 @@
247254 scriptNodeItem.addActionListener(this);
248255 cameraItem = menu.add(new MenuItem("Camera"));
249256 cameraItem.addActionListener(this);
250
- menu.add("-");
257
+
258
+ oe.menuBar.add(menu = new Menu("Object"));
251259 textureItem = menu.add(new MenuItem("Texture"));
252260 textureItem.addActionListener(this);
261
+ billboardItem = menu.add(new MenuItem("Billboard"));
262
+ billboardItem.addActionListener(this);
253263 csgItem = menu.add(new MenuItem("CSG"));
254264 csgItem.addActionListener(this);
255265 shadowXItem = menu.add(new MenuItem("Shadow X"));
....@@ -267,14 +277,12 @@
267277 pointflowItem = menu.add(new MenuItem("Point Flow"));
268278 pointflowItem.addActionListener(this);
269279 menu.add("-");
270
- transformgeometryItem = menu.add(new MenuItem("Transform Geometry"));
271
- transformgeometryItem.addActionListener(this);
272280 resetTransformItem = menu.add(new MenuItem("Reset Transform"));
273281 resetTransformItem.addActionListener(this);
274282 resetCentroidItem = menu.add(new MenuItem("Reset Centroid"));
275283 resetCentroidItem.addActionListener(this);
276
- ungroupItem = menu.add(new MenuItem("Ungroup"));
277
- ungroupItem.addActionListener(this);
284
+ transformgeometryItem = menu.add(new MenuItem("Transform Geometry"));
285
+ transformgeometryItem.addActionListener(this);
278286
279287 oe.menuBar.add(menu = new Menu("Geometry"));
280288 genUVItem = menu.add(new MenuItem("Generate UV"));
....@@ -283,6 +291,10 @@
283291 genNormalsORGANItem.addActionListener(this);
284292 genNormalsCADItem = menu.add(new MenuItem("CAD Normals"));
285293 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);
286298 stripifyItem = menu.add(new MenuItem("Stripify"));
287299 stripifyItem.addActionListener(this);
288300 unstripifyItem = menu.add(new MenuItem("Unstripify"));
....@@ -292,8 +304,6 @@
292304 untrimItem = menu.add(new MenuItem("Untrim"));
293305 untrimItem.addActionListener(this);
294306 menu.add("-");
295
- clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
296
- clearMaterialsItem.addActionListener(this);
297307 clearColorsItem = menu.add(new MenuItem("Clear AO"));
298308 clearColorsItem.addActionListener(this);
299309 reverseNormalsItem = menu.add(new MenuItem("Reverse Normals"));
....@@ -310,6 +320,10 @@
310320 smoothMeshItem.addActionListener(this);
311321 clipMeshItem = menu.add(new MenuItem("Clip mesh"));
312322 clipMeshItem.addActionListener(this);
323
+
324
+ oe.menuBar.add(menu = new Menu("Attributes"));
325
+ clearMaterialsItem = menu.add(new MenuItem("Clear Materials"));
326
+ clearMaterialsItem.addActionListener(this);
313327 menu.add("-");
314328 liveleavesItem = menu.add(new MenuItem("Live Leaves"));
315329 liveleavesItem.addActionListener(this);
....@@ -332,27 +346,18 @@
332346 flipVItem.addActionListener(this);
333347 unflipVItem = menu.add(new MenuItem("Unflip V"));
334348 unflipVItem.addActionListener(this);
335
- lowTexturesItem = menu.add(new MenuItem("Low Texture"));
349
+ lowTexturesItem = menu.add(new MenuItem("Low Texture (256)"));
336350 lowTexturesItem.addActionListener(this);
337
- normalTexturesItem = menu.add(new MenuItem("Normal Texture"));
351
+ normalTexturesItem = menu.add(new MenuItem("Normal Texture (512)"));
338352 normalTexturesItem.addActionListener(this);
339
- highTexturesItem = menu.add(new MenuItem("High Texture"));
353
+ highTexturesItem = menu.add(new MenuItem("High Texture (1024)"));
340354 highTexturesItem.addActionListener(this);
341
- veryhighTexturesItem = menu.add(new MenuItem("Very high Texture"));
355
+ veryhighTexturesItem = menu.add(new MenuItem("Very high Texture (2048)"));
342356 veryhighTexturesItem.addActionListener(this);
343
- maxTexturesItem = menu.add(new MenuItem("Max Texture"));
357
+ maxTexturesItem = menu.add(new MenuItem("Max Texture (4096)"));
344358 maxTexturesItem.addActionListener(this);
345
- panoTexturesItem = menu.add(new MenuItem("Panoramic Texture"));
359
+ panoTexturesItem = menu.add(new MenuItem("Panoramic Texture (8192)"));
346360 panoTexturesItem.addActionListener(this);
347
- menu.add("-");
348
- extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
349
- extractGeometriesItem.addActionListener(this);
350
- cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry"));
351
- cloneGeometriesItem.addActionListener(this);
352
- shareGeometriesItem = menu.add(new MenuItem("Share Geometry"));
353
- shareGeometriesItem.addActionListener(this);
354
- mergeGeometriesItem = menu.add(new MenuItem("Merge Geometry"));
355
- mergeGeometriesItem.addActionListener(this);
356361
357362 oe.menuBar.add(menu = new Menu("Selection"));
358363 attachPigmentItem = menu.add(new MenuItem("Attach Pigment..."));
....@@ -370,9 +375,31 @@
370375 sortbysizeItem.addActionListener(this);
371376 sortbynameItem = menu.add(new MenuItem("Sort by name"));
372377 sortbynameItem.addActionListener(this);
378
+ menu.add("-");
379
+ extractGeometriesItem = menu.add(new MenuItem("Link Geometry"));
380
+ extractGeometriesItem.addActionListener(this);
381
+ cloneGeometriesItem = menu.add(new MenuItem("Clone Geometry"));
382
+ cloneGeometriesItem.addActionListener(this);
383
+ shareGeometriesItem = menu.add(new MenuItem("Share Geometry"));
384
+ shareGeometriesItem.addActionListener(this);
385
+ mergeGeometriesItem = menu.add(new MenuItem("Merge Geometry"));
386
+ mergeGeometriesItem.addActionListener(this);
387
+
373388 oe.menuBar.add(menu = new Menu("Insert"));
374389 buildCreateMenu(menu);
375
- oe.menuBar.add(menu = new Menu("Tools"));
390
+
391
+
392
+ oe.menuBar.add(menu = new Menu("Include"));
393
+ importGFDItem = menu.add(new MenuItem("GrafreeD Object..."));
394
+ importGFDItem.addActionListener(this);
395
+ importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D Object..."));
396
+ importVRMLX3DItem.addActionListener(this);
397
+ importOBJItem = menu.add(new MenuItem("OBJ Object..."));
398
+ importOBJItem.addActionListener(this);
399
+ import3DSItem = menu.add(new MenuItem("3DS Object..."));
400
+ import3DSItem.addActionListener(this);
401
+
402
+ oe.menuBar.add(menu = new Menu("Tools"));
376403 buildToolsMenu(menu);
377404 }
378405
....@@ -1002,6 +1029,8 @@
10021029
10031030 void buildCreateMenu(Menu menu)
10041031 {
1032
+ //heightFieldItem = menu.add(new MenuItem("Height Field"));
1033
+ //heightFieldItem.addActionListener(this);
10051034 gridItem = menu.add(new MenuItem("Grid"));
10061035 gridItem.addActionListener(this);
10071036 rectoidItem = menu.add(new MenuItem("Box"));
....@@ -1014,6 +1043,8 @@
10141043 torusItem.addActionListener(this);
10151044 superItem = menu.add(new MenuItem("Superellipsoid"));
10161045 superItem.addActionListener(this);
1046
+ kleinItem = menu.add(new MenuItem("Klein Bottle"));
1047
+ kleinItem.addActionListener(this);
10171048 particleItem = menu.add(new MenuItem("Particle system"));
10181049 particleItem.addActionListener(this);
10191050 ragdollItem = menu.add(new MenuItem("Rag Walk"));
....@@ -1048,15 +1079,6 @@
10481079 doubleItem.addActionListener(this);
10491080 tripleItem = menu.add(new MenuItem("Trident"));
10501081 tripleItem.addActionListener(this);
1051
- menu.add("-");
1052
- importGFDItem = menu.add(new MenuItem("GraphreeD Object..."));
1053
- importGFDItem.addActionListener(this);
1054
- importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D Object..."));
1055
- importVRMLX3DItem.addActionListener(this);
1056
- importOBJItem = menu.add(new MenuItem("OBJ Object..."));
1057
- importOBJItem.addActionListener(this);
1058
- import3DSItem = menu.add(new MenuItem("3DS Object..."));
1059
- import3DSItem.addActionListener(this);
10601082 }
10611083
10621084 void buildToolsMenu(Menu menu)
....@@ -1068,6 +1090,8 @@
10681090 menu.add("-");
10691091 parseverticesItem = menu.add(new MenuItem("Multiplicity"));
10701092 parseverticesItem.addActionListener(this);
1093
+ textureFieldItem = menu.add(new MenuItem("Texture Field"));
1094
+ textureFieldItem.addActionListener(this);
10711095 alignItem = menu.add(new MenuItem("Align"));
10721096 alignItem.addActionListener(this);
10731097 mirrorItem = menu.add(new MenuItem("Mirror Poses"));
....@@ -1429,9 +1453,9 @@
14291453
14301454 void Overwrite(int mask)
14311455 {
1432
- if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
1456
+ if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
14331457 {
1434
- Object3D content = GraphreeD.clipboard.get(0);
1458
+ Object3D content = GrafreeD.clipboard.get(0);
14351459
14361460 if (content instanceof cGroup && ((cGroup)content).transientlink )
14371461 content = ((cGroup)content).get(0);
....@@ -1521,6 +1545,46 @@
15211545 makeSomething(ragdoll);
15221546 //makeSomething(new VehicleDemo());
15231547 } else
1548
+ /*
1549
+ */
1550
+ if (event.getSource() == heightFieldItem)
1551
+ {
1552
+ Object3D obj = new Object3D();
1553
+
1554
+ obj.CreateMaterial();
1555
+ obj.bRep = new BoundaryRep();
1556
+
1557
+ obj.bRep.CreateMesh(new iHeightField()
1558
+ {
1559
+ public double f(double x, double y)
1560
+ {
1561
+ // The Mandelbrot set is represented by coloring
1562
+ // each point (x,y) according to the number of
1563
+ // iterations it takes before the while loop in
1564
+ // this method ends. For points that are actually
1565
+ // in the Mandelbrot set, or very close to it, the
1566
+ // count will reach the maximum value, 80. These
1567
+ // points will be colored purple. All other colors
1568
+ // represent points that are definitely NOT in the set.
1569
+ x -= 600;
1570
+ y -= 500;
1571
+ x /= 200;
1572
+ y /= 200;
1573
+ int count = 0;
1574
+ double zx = x;
1575
+ double zy = y;
1576
+ while (count < 80 && Math.abs(x) < 100 && Math.abs(zy) < 100) {
1577
+ double new_zx = zx*zx - zy*zy + x;
1578
+ zy = 2*zx*zy + y;
1579
+ zx = new_zx;
1580
+ count++;
1581
+ }
1582
+ return count; // Math.sqrt(count);
1583
+ }
1584
+ }, 1000,1000);
1585
+
1586
+ makeSomething(obj);
1587
+ } else
15241588 if (event.getSource() == gridItem)
15251589 {
15261590 makeSomething(new Grid());
....@@ -1540,6 +1604,10 @@
15401604 if (event.getSource() == superItem)
15411605 {
15421606 makeSomething(new Superellipsoid());
1607
+ } else
1608
+ if (event.getSource() == kleinItem)
1609
+ {
1610
+ makeSomething(new Klein());
15431611 } else
15441612 if (event.getSource() == blobItem)
15451613 {
....@@ -1570,7 +1638,7 @@
15701638 LA.matConcat(obj.toParent, cameraView.renderCamera.fromParent, obj.toParent);
15711639 LA.matInvert(obj.toParent, obj.fromParent);
15721640 */
1573
- makeSomething(new CheckerIG());
1641
+ makeSomething(new Checker());
15741642 } else
15751643 if (event.getSource() == meshItem)
15761644 {
....@@ -1726,7 +1794,7 @@
17261794 if (event.getSource() == invariantsItem)
17271795 {
17281796 System.out.println("Invariants:");
1729
- GraphreeD.theApplet3D.universe.invariants();
1797
+ GrafreeD.theApplet3D.universe.invariants();
17301798 } else
17311799 if (event.getSource() == memoryItem)
17321800 {
....@@ -1796,10 +1864,10 @@
17961864 } else
17971865 if (event.getSource() == duplicateItem)
17981866 {
1799
- Object3D keep = GraphreeD.clipboard;
1867
+ Object3D keep = GrafreeD.clipboard;
18001868 loadClipboard(false);
18011869 paste(false);
1802
- GraphreeD.clipboard = keep;
1870
+ GrafreeD.clipboard = keep;
18031871 } else
18041872 if (event.getSource() == cloneItem)
18051873 {
....@@ -1843,8 +1911,9 @@
18431911 } else
18441912 if (event.getSource() == overwriteMatItem)
18451913 {
1914
+ /* july 2015
18461915 if ((dropAttributes & Object3D.TEXTURE) == 0)
1847
- Overwrite(Object3D.MATERIAL);
1916
+ Overwrite(Object3D.MATERIAL | Object3D.COLOR);
18481917 else
18491918 {
18501919 if ((dropAttributes & Object3D.COLOR) == 0 && (dropAttributes & Object3D.MATERIAL) == 0)
....@@ -1856,13 +1925,16 @@
18561925 Overwrite(Object3D.MATERIAL | Object3D.TEXTURE);
18571926 }
18581927 }
1928
+ */
1929
+
1930
+ Overwrite(dropAttributes);
18591931 }
18601932 if (event.getSource() == overwriteGeoItem)
18611933 {
18621934 Overwrite(Object3D.GEOMETRY);
1863
-// if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
1935
+// if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
18641936 // {
1865
-// Object3D content = GraphreeD.clipboard.get(0);
1937
+// Object3D content = GrafreeD.clipboard.get(0);
18661938 //
18671939 // if (content instanceof cGroup && ((cGroup)content).transientlink )
18681940 // content = ((cGroup)content).get(0);
....@@ -1945,23 +2017,28 @@
19452017 if (group.selection.size() == 1)
19462018 one = true;
19472019
2020
+ Object3D merge = null;
2021
+
19482022 Object3D content = new cGroup();
19492023
19502024 for (int i=0; i<group.selection.size(); i++)
19512025 {
1952
- Object3D sel = new Merge(group.selection.get(i));
2026
+ merge = new Merge(group.selection.get(i));
19532027
19542028 if (one)
1955
- makeSomething(sel, false);
2029
+ makeSomething(merge, false);
19562030 else
1957
- content.addChild(sel);
2031
+ content.addChild(merge);
19582032 }
19592033
19602034 if (!one)
1961
- makeSomething(content, false);
1962
-
1963
- ResetModel();
1964
- refreshContents();
2035
+ makeSomething(content, true);
2036
+ else
2037
+ {
2038
+ ResetModel();
2039
+ Select(merge.GetTreePath(), true, false); // unselect... false);
2040
+ refreshContents();
2041
+ }
19652042 } else
19662043 if (event.getSource() == mergeGeometriesItem)
19672044 {
....@@ -1995,9 +2072,9 @@
19952072 } else
19962073 if (event.getSource() == linkverticesItem)
19972074 {
1998
-// if (group.selection.size() == 1 && GraphreeD.clipboard.size() == 1)
2075
+// if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
19992076 // {
2000
-// Object3D content = GraphreeD.clipboard.get(0);
2077
+// Object3D content = GrafreeD.clipboard.get(0);
20012078 //
20022079 // if (content instanceof cGroup && ((cGroup)content).transientlink )
20032080 // content = ((cGroup)content).get(0);
....@@ -2006,9 +2083,9 @@
20062083 // group.selection.get(0).setMasterThis(content); // should be identity
20072084 // refreshContents();
20082085 // }
2009
- if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
2086
+ if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
20102087 {
2011
- Object3D content = GraphreeD.clipboard.get(0);
2088
+ Object3D content = GrafreeD.clipboard.get(0);
20122089
20132090 if (content instanceof cGroup && ((cGroup)content).transientlink )
20142091 content = ((cGroup)content).get(0);
....@@ -2038,6 +2115,15 @@
20382115
20392116 refreshContents();
20402117 } else
2118
+ if (event.getSource() == relinkverticesItem)
2119
+ {
2120
+ boolean random = CameraPane.RANDOM;
2121
+ CameraPane.RANDOM = false; // parse all random nodes
2122
+ group.selection.RelinkToSupport();
2123
+ CameraPane.RANDOM = random;
2124
+
2125
+ refreshContents();
2126
+ } else
20412127 if (event.getSource() == resetreferencesItem)
20422128 {
20432129 for (int i=0; i<group.selection.size(); i++)
....@@ -2049,9 +2135,9 @@
20492135 } else
20502136 if (event.getSource() == setMasterItem)
20512137 {
2052
- if (group.selection.size() == 1 && GraphreeD.clipboard.size() == 1)
2138
+ if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
20532139 {
2054
- Object3D content = GraphreeD.clipboard.get(0);
2140
+ Object3D content = GrafreeD.clipboard.get(0);
20552141
20562142 if (content instanceof cGroup && ((cGroup)content).transientlink )
20572143 content = ((cGroup)content).get(0);
....@@ -2064,9 +2150,9 @@
20642150 {
20652151 if (group.selection.size() == 1)
20662152 {
2067
- if (GraphreeD.clipboard.size() == 1)
2153
+ if (GrafreeD.clipboard.size() == 1)
20682154 {
2069
- Object3D content = GraphreeD.clipboard.get(0);
2155
+ Object3D content = GrafreeD.clipboard.get(0);
20702156
20712157 if (content instanceof cGroup && ((cGroup)content).transientlink )
20722158 content = ((cGroup)content).get(0);
....@@ -2106,6 +2192,10 @@
21062192 if (event.getSource() == grabItem)
21072193 {
21082194 group(new cGroup(), true);
2195
+ } else
2196
+ if (event.getSource() == hideItem)
2197
+ {
2198
+ group(new HiddenObject());
21092199 } else
21102200 if (event.getSource() == frontItem)
21112201 {
....@@ -2229,6 +2319,10 @@
22292319 {
22302320 group(new TextureNode());
22312321 } else
2322
+ if (event.getSource() == billboardItem)
2323
+ {
2324
+ group(new BillboardNode());
2325
+ } else
22322326 if (event.getSource() == shadowXItem)
22332327 {
22342328 CastShadow(0);
....@@ -2243,7 +2337,15 @@
22432337 } else
22442338 if (event.getSource() == ungroupItem)
22452339 {
2246
- ungroup();
2340
+ //ungroup();
2341
+ for (int i=0; i<group.selection.size(); i++)
2342
+ {
2343
+ Ungroup(group.selection.get(i));
2344
+ }
2345
+
2346
+ ClearSelection(false);
2347
+
2348
+ refreshContents();
22472349 } else
22482350 if (event.getSource() == genUVItem)
22492351 {
....@@ -2253,9 +2355,17 @@
22532355 {
22542356 GenNormals(true);
22552357 } else
2358
+ if (event.getSource() == genNormalsMESHItem)
2359
+ {
2360
+ GenNormals(true); // TODO
2361
+ } else
22562362 if (event.getSource() == genNormalsORGANItem)
22572363 {
22582364 GenNormals(false);
2365
+ } else
2366
+ if (event.getSource() == genNormalsMINEItem)
2367
+ {
2368
+ GenNormalsMINE();
22592369 } else
22602370 if (event.getSource() == stripifyItem)
22612371 {
....@@ -2352,6 +2462,10 @@
23522462 if (event.getSource() == parseverticesItem)
23532463 {
23542464 ParseVertices();
2465
+ } else
2466
+ if (event.getSource() == textureFieldItem)
2467
+ {
2468
+ TextureVertices();
23552469 } else
23562470 if (event.getSource() == alignItem)
23572471 {
....@@ -2750,7 +2864,7 @@
27502864 if (event.getSource() == unselectButton)
27512865 {
27522866 objEditor.jTree.clearSelection();
2753
- // ?? oct 2012 GraphreeD.clipboard.clear();
2867
+ // ?? oct 2012 GrafreeD.clipboard.clear();
27542868 objEditor.ResetSliders();
27552869 refreshContents(true);
27562870 } else
....@@ -3065,9 +3179,9 @@
30653179 obj = (Object3D)e.nextElement();
30663180
30673181 System.out.println("Object is: " + obj);
3068
- GraphreeD.AnalyzeObject(obj);
3182
+ GrafreeD.AnalyzeObject(obj);
30693183 System.out.println("Boundary rep: " + obj.bRep);
3070
- GraphreeD.AnalyzeObject(obj.bRep);
3184
+ GrafreeD.AnalyzeObject(obj.bRep);
30713185
30723186 // System.err.println((size/1024) + " KB is the size of " + obj);
30733187 }
....@@ -3109,6 +3223,13 @@
31093223 void GenNormals(boolean crease)
31103224 {
31113225 group.GenNormalsS(crease);
3226
+
3227
+ refreshContents();
3228
+ }
3229
+
3230
+ void GenNormalsMINE()
3231
+ {
3232
+ group.selection.GenNormalsMINE();
31123233
31133234 refreshContents();
31143235 }
....@@ -3157,104 +3278,250 @@
31573278
31583279 //Object3D buffer;
31593280 cVector temp = new cVector();
3160
- BoundaryRep temprep;
3161
- Object3D nodes;
3162
- Vector<Vertex> vertices;
3163
-
3164
- public void Vertex(Object3D node, Vertex v)
3165
- {
3166
- vertices.add(v);
3167
- nodes.addElement(node);
3168
-
3169
- if (temprep.GetCache(v) != null)
3170
- {
3171
- temprep.Remove(v);
3172
- }
3173
- else
3174
- {
3175
- temprep.Remember(v);
3176
- }
3177
- }
3178
-
3179
- public void Face(Object3D node, Face f)
3180
- {
3181
-
3182
- }
3183
-
3281
+// BoundaryRep temprep;
3282
+// Object3D nodes;
3283
+// Vector<Vertex> vertices;
3284
+//
3285
+// cGroup buffer;
3286
+//
3287
+// public void Vertex(Object3D node, Vertex v)
3288
+// {
3289
+//// vertices.add(v);
3290
+//// nodes.addElement(node);
3291
+////
3292
+//// if (temprep.GetCache(v) != null)
3293
+//// {
3294
+//// temprep.Remove(v);
3295
+//// } else
3296
+//// {
3297
+//// temprep.Remember(v);
3298
+//// }
3299
+//
3300
+// //Object3D node = nodes.get(index);
3301
+// temp.set(v); // vertices.get(index)); // temprep.GetVertex(k));
3302
+// // System.out.println("temp = " + temp.x + ", " + temp.y + ", " + temp.z);
3303
+//
3304
+// LA.xformPos(temp, node.GlobalTransformInv(), temp);
3305
+//
3306
+// // System.out.println("tem+ = " + temp.x + ", " + temp.y + ", " + temp.z);
3307
+//
3308
+// cGroup g = new cGroup();
3309
+//
3310
+// if (g.toParent == null)
3311
+// {
3312
+// g.toParent = LA.newMatrix();
3313
+// g.fromParent = LA.newMatrix();
3314
+// }
3315
+// LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
3316
+// LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
3317
+//
3318
+// g.add(GrafreeD.clipboard);
3319
+//
3320
+// buffer.add(g);
3321
+// }
3322
+//
3323
+// public void Face(Object3D node, Face f)
3324
+// {
3325
+//
3326
+// }
3327
+//
3328
+// void ParseVerticesOld() // ??
3329
+// {
3330
+// //if (group.selection.size() != 1)
3331
+// // return;
3332
+//
3333
+// temprep = new BoundaryRep();
3334
+// nodes = new Object3D();
3335
+// vertices = new Vector<Vertex>();
3336
+//
3337
+// boolean epsequal = GrafreeD.epsequal;
3338
+// GrafreeD.epsequal = true;
3339
+//
3340
+// for (int i=0; i<group.selection.size(); i++)
3341
+// {
3342
+// Object3D buffer = new cGroup(group.selection.get(i).name + "+");
3343
+//
3344
+// group.selection.get(i).Parse(
3345
+//this );
3346
+//
3347
+// int repsize = temprep.VertexCount();
3348
+// int tablesize = temprep.vertextable.size();
3349
+// int nodesize = nodes.size();
3350
+//
3351
+// assert(vertices.size() == nodes.size());
3352
+//
3353
+// temprep.vertextable.elements();
3354
+//
3355
+// java.util.Set<java.util.Map.Entry<Vertex,Vertex>> set = temprep.vertextable.entrySet();
3356
+//
3357
+// for (java.util.Map.Entry<Vertex,Vertex> entry : set)
3358
+// {
3359
+// cGroup g = new cGroup();
3360
+//
3361
+// int index = vertices.indexOf(entry.getValue()); // temprep.vertextable.(k));
3362
+//
3363
+// Object3D node = nodes.get(index);
3364
+// temp.set(vertices.get(index)); // temprep.GetVertex(k));
3365
+// // System.out.println("temp = " + temp.x + ", " + temp.y + ", " + temp.z);
3366
+//
3367
+// LA.xformPos(temp, node.GlobalTransformInv(), temp);
3368
+//
3369
+// // System.out.println("tem+ = " + temp.x + ", " + temp.y + ", " + temp.z);
3370
+//
3371
+// if (g.toParent == null)
3372
+// {
3373
+// g.toParent = LA.newMatrix();
3374
+// g.fromParent = LA.newMatrix();
3375
+// }
3376
+// LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
3377
+// LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
3378
+//
3379
+// g.add(GrafreeD.clipboard);
3380
+//
3381
+// buffer.add(g);
3382
+// }
3383
+//
3384
+// makeSomething(buffer, i==group.selection.size()-1);
3385
+// }
3386
+//
3387
+// GrafreeD.epsequal = epsequal;
3388
+//
3389
+// //buffer = null;
3390
+// temprep = null;
3391
+// nodes = null;
3392
+//
3393
+// refreshContents();
3394
+// }
3395
+
31843396 void ParseVertices()
31853397 {
3186
- //if (group.selection.size() != 1)
3187
- // return;
3188
-
3189
- temprep = new BoundaryRep();
3190
- nodes = new Object3D();
3191
- vertices = new Vector<Vertex>();
3192
-
3193
- boolean epsequal = GraphreeD.epsequal;
3194
- GraphreeD.epsequal = true;
3398
+ boolean epsequal = GrafreeD.epsequal;
3399
+ GrafreeD.epsequal = true;
31953400
31963401 for (int i=0; i<group.selection.size(); i++)
31973402 {
3198
- Object3D buffer = new cGroup(group.selection.get(i).name + "+");
3403
+ final cGroup buffer = new cGroup(group.selection.get(i).name + "+");
31993404
3200
- group.selection.get(i).Parse(this);
3201
-
3202
- int repsize = temprep.VertexCount();
3203
- int tablesize = temprep.vertextable.size();
3204
- int nodesize = nodes.size();
3405
+ group.selection.get(i).Parse(
3406
+
3407
+ new iParse()
3408
+ {
3409
+ public void Vertex(Object3D node, Vertex v)
3410
+ {
3411
+ temp.set(v);
3412
+ LA.xformPos(temp, node.GlobalTransformInv(), temp);
32053413
3206
- assert(vertices.size() == nodes.size());
3207
-
3208
- temprep.vertextable.elements();
3209
-
3210
- java.util.Set<java.util.Map.Entry<Vertex,Vertex>> set = temprep.vertextable.entrySet();
3414
+ cGroup g = new cGroup();
32113415
3212
- for (java.util.Map.Entry<Vertex,Vertex> entry : set)
3213
- {
3214
- cGroup g = new cGroup();
3416
+ if (g.toParent == null)
3417
+ {
3418
+ g.toParent = LA.newMatrix();
3419
+ g.fromParent = LA.newMatrix();
3420
+ }
3421
+ LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
3422
+ LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
32153423
3216
- int index = vertices.indexOf(entry.getValue()); // temprep.vertextable.(k));
3217
- Object3D node = nodes.get(index);
3218
- temp.set(vertices.get(index)); // temprep.GetVertex(k));
3219
- // System.out.println("temp = " + temp.x + ", " + temp.y + ", " + temp.z);
3424
+ g.add(GrafreeD.clipboard);
32203425
3221
- LA.xformPos(temp, node.GlobalTransformInv(), temp);
3222
-
3223
- // System.out.println("tem+ = " + temp.x + ", " + temp.y + ", " + temp.z);
3224
-
3225
- if (g.toParent == null)
3226
- {
3227
- g.toParent = LA.newMatrix();
3228
- g.fromParent = LA.newMatrix();
3229
- }
3230
- LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
3231
- LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
3426
+ buffer.add(g);
3427
+ }
32323428
3233
- g.add(GraphreeD.clipboard);
3429
+ public void Face(Object3D node, Face f)
3430
+ {
32343431
3235
- buffer.add(g);
3236
- }
3432
+ }
3433
+ }
3434
+ );
32373435
32383436 makeSomething(buffer, i==group.selection.size()-1);
32393437 }
32403438
3241
- GraphreeD.epsequal = epsequal;
3242
-
3243
- //buffer = null;
3244
- temprep = null;
3245
- nodes = null;
3439
+ GrafreeD.epsequal = epsequal;
32463440
32473441 refreshContents();
32483442 }
3249
-
3443
+
3444
+ void TextureVertices()
3445
+ {
3446
+ for (int i=0; i<group.selection.size(); i++)
3447
+ {
3448
+ group.selection.get(i).Parse(
3449
+ new iParse()
3450
+ {
3451
+ public void Vertex(Object3D node, Vertex v)
3452
+ {
3453
+ cTexture tex = node.GetTextures();
3454
+ String pigment = Object3D.GetPigment(tex);
3455
+ //String bump = Object3D.GetBump(tex);
3456
+
3457
+ com.sun.opengl.util.texture.TextureData texturedata = CameraPane.theRenderer.GetTextureData(pigment, false, node.texres);
3458
+
3459
+ double s = v.s;
3460
+
3461
+ if (s == 1)
3462
+ s = 0;
3463
+
3464
+ double t = v.t;
3465
+
3466
+ if (t == 1)
3467
+ t = 0;
3468
+
3469
+ int indexs = (int) (texturedata.getWidth() * s);
3470
+ int indext = (int) (texturedata.getHeight() * t);
3471
+
3472
+ int index = indext * texturedata.getWidth() + indexs;
3473
+
3474
+ java.nio.ByteBuffer bytebuf = (java.nio.ByteBuffer)texturedata.getBuffer();
3475
+
3476
+ int slide = bytebuf.capacity() / texturedata.getWidth() / texturedata.getHeight();
3477
+
3478
+ float scale = bytebuf.get(index*slide) & 0xFF;
3479
+ scale += bytebuf.get(index*slide+1) & 0xFF;
3480
+ scale += bytebuf.get(index*slide+2) & 0xFF;
3481
+ scale /= 3;
3482
+
3483
+ scale /= 0xFF;
3484
+ // c'est quoi ca? scale /= 4;
3485
+
3486
+ //v.AO = scale;
3487
+
3488
+ v.x += v.norm.x * scale;
3489
+ v.y += v.norm.y * scale;
3490
+ v.z += v.norm.z * scale;
3491
+ }
3492
+
3493
+ public void Face(Object3D node, Face f)
3494
+ {
3495
+ }
3496
+ }
3497
+ );
3498
+ }
3499
+
3500
+ refreshContents();
3501
+ }
3502
+
32503503 void Align()
32513504 {
3505
+ if (group.selection.size() == 0)
3506
+ return;
3507
+
3508
+ cVector bbmin = new cVector();
3509
+ cVector bbmax = new cVector();
3510
+
3511
+ group.selection.get(0).getBounds(bbmin, bbmax, true);
3512
+
3513
+ double dx = bbmax.x - bbmin.x;
3514
+ double dy = bbmax.y - bbmin.y;
3515
+ double dz = bbmax.z - bbmin.z;
3516
+
3517
+ double scale = Math.sqrt(dx*dx + dy*dy + dz*dz);
3518
+
32523519 for (int i=0; i<group.selection.size(); i++)
32533520 {
32543521 Object3D obj = group.selection.get(i);
32553522
3256
- LA.matTranslate(obj.toParent, i/2f, 0, 0);
3257
- LA.matTranslateInv(obj.fromParent, -i/2f, 0, 0);
3523
+ LA.matTranslate(obj.toParent, i * scale, 0, 0);
3524
+ LA.matTranslateInv(obj.fromParent, -i * scale, 0, 0);
32583525 }
32593526
32603527 refreshContents();
....@@ -3267,7 +3534,7 @@
32673534 // ref.SaveSupports();
32683535 // Object3D par = ref.parent;
32693536 // ref.parent = null;
3270
-// Object3D lowres = (Object3D) GraphreeD.clone(ref);
3537
+// Object3D lowres = (Object3D) GrafreeD.clone(ref);
32713538 // ref.parent = par;
32723539 // ref.RestoreSupports();
32733540
....@@ -3297,7 +3564,7 @@
32973564 // lowres.SaveSupports();
32983565 // par = lowres.parent;
32993566 // lowres.parent = null;
3300
-// Object3D newlow = (Object3D) GraphreeD.clone(lowres);
3567
+// Object3D newlow = (Object3D) GrafreeD.clone(lowres);
33013568 Object3D newlow = CloneObject(lowres, false);
33023569 newlow.name = sn.switchobject.get(i).name;
33033570 System.out.println(" pose#" + i + " = " + newlow);
....@@ -3319,7 +3586,7 @@
33193586 return;
33203587
33213588 Object3D poses = group.selection.get(0);
3322
- Object3D ref = GraphreeD.clipboard.get(0);
3589
+ Object3D ref = GrafreeD.clipboard.get(0);
33233590
33243591 Object3D newgroup = new Object3D("Po:" + poses.name);
33253592
....@@ -3513,20 +3780,20 @@
35133780
35143781 void ClipMesh()
35153782 {
3516
- if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
3783
+ if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
35173784 {
3518
- Object3D content = GraphreeD.clipboard.get(0);
3785
+ Object3D content = GrafreeD.clipboard.get(0);
35193786
35203787 if (content instanceof cGroup && ((cGroup)content).transientlink )
35213788 content = ((cGroup)content).get(0);
35223789
35233790 // for (int i=0; i<group.selection.size(); i++)
35243791 // {
3525
-// group.selection.get(i).ClipMesh(GraphreeD.clipboard);
3792
+// group.selection.get(i).ClipMesh(GrafreeD.clipboard);
35263793 // }
3527
- group.selection.ClipMesh(GraphreeD.clipboard);
3794
+ group.selection.ClipMesh(GrafreeD.clipboard);
35283795 }
3529
-// group.selection.ClipMesh(GraphreeD.clipboard);
3796
+// group.selection.ClipMesh(GrafreeD.clipboard);
35303797 System.out.println("DONE.");
35313798 refreshContents();
35323799 }
....@@ -3864,12 +4131,12 @@
38644131 {
38654132 if (group.selection.isEmpty())
38664133 return;
3867
- GraphreeD.clipboardIsTempGroup = false;
4134
+ GrafreeD.clipboardIsTempGroup = false;
38684135 Composite tGroup = null;
38694136 if (group.selection.size() > 0) // 1)
38704137 {
38714138 tGroup = new cGroup();
3872
- GraphreeD.clipboardIsTempGroup = true;
4139
+ GrafreeD.clipboardIsTempGroup = true;
38734140 }
38744141
38754142 if (cut)
....@@ -3909,16 +4176,16 @@
39094176 //System.out.println("cut " + child);
39104177 //System.out.println("parent = " + child.parent);
39114178 // tmp.addChild(child);
3912
- if (GraphreeD.clipboardIsTempGroup)
4179
+ if (GrafreeD.clipboardIsTempGroup)
39134180 tGroup.add/*Child*/(tmp);
39144181 else
3915
- GraphreeD.clipboard = tmp;
4182
+ GrafreeD.clipboard = tmp;
39164183 }
39174184 else
3918
- if (GraphreeD.clipboardIsTempGroup)
4185
+ if (GrafreeD.clipboardIsTempGroup)
39194186 tGroup.add/*Child*/(child);
39204187 else
3921
- GraphreeD.clipboard = child;
4188
+ GrafreeD.clipboard = child;
39224189 }
39234190
39244191 //ResetModel();
....@@ -3950,21 +4217,21 @@
39504217 //System.out.println("cut " + elem);
39514218 //System.out.println("parent = " + elem.parent);
39524219 // tmp.addChild(elem);
3953
- if (GraphreeD.clipboardIsTempGroup)
4220
+ if (GrafreeD.clipboardIsTempGroup)
39544221 tGroup.add/*Child*/(tmp);
39554222 else
3956
- GraphreeD.clipboard = tmp;
4223
+ GrafreeD.clipboard = tmp;
39574224 }
39584225 else
3959
- if (GraphreeD.clipboardIsTempGroup)
4226
+ if (GrafreeD.clipboardIsTempGroup)
39604227 tGroup.add/*Child*/(child);
39614228 else
3962
- GraphreeD.clipboard = child;
4229
+ GrafreeD.clipboard = child;
39634230 }
39644231
39654232 }
3966
- if (GraphreeD.clipboardIsTempGroup)
3967
- GraphreeD.clipboard = tGroup;
4233
+ if (GrafreeD.clipboardIsTempGroup)
4234
+ GrafreeD.clipboard = tGroup;
39684235 if (cut)
39694236 {
39704237 ResetModel();
....@@ -3974,11 +4241,11 @@
39744241
39754242 void paste(boolean expand)
39764243 {
3977
- // if (GraphreeD.clipboard == null)
4244
+ // if (GrafreeD.clipboard == null)
39784245 // return;
39794246 boolean first = true;
39804247
3981
- if (GraphreeD.clipboardIsTempGroup)
4248
+ if (GrafreeD.clipboardIsTempGroup)
39824249 {
39834250 Composite temp;
39844251
....@@ -3989,7 +4256,7 @@
39894256 temp = (Composite)Applet3D.clipboard.deepCopy();
39904257 */
39914258 Object3D elem;
3992
- for (Enumeration e = /*temp.children*/GraphreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
4259
+ for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
39934260 {
39944261 Object3D child = (Object3D)e.nextElement();
39954262
....@@ -4003,7 +4270,7 @@
40034270 else
40044271 elem = child.deepCopy(); // ?
40054272 child.parent = keepparent;
4006
- //if (GraphreeD.clipboardIsTempGroup && LA.isIdentity(elem.fromParent))
4273
+ //if (GrafreeD.clipboardIsTempGroup && LA.isIdentity(elem.fromParent))
40074274 // elem = elem.get(0);
40084275 makeSomething(elem, true); // ?? first);
40094276 //group.addChild(elem);
....@@ -4023,14 +4290,14 @@
40234290 //Object3D cb = Applet3D.clipboard;
40244291 //temp.addChild(cb);
40254292 //makeSomething((expand?temp.copyExpand():temp.deepCopy()).get(0));
4026
- assert(GraphreeD.clipboard.parent == null);
4027
- Object3D /*Composite*/ keepparent = GraphreeD.clipboard.get(0).parent;
4028
- GraphreeD.clipboard.get(0).parent = null; // Avoid copy?
4029
- if (LA.isIdentity(GraphreeD.clipboard.toParent))
4030
- makeSomething(expand?GraphreeD.clipboard.get(0).copyExpand():GraphreeD.clipboard.get(0).deepCopy());
4293
+ assert(GrafreeD.clipboard.parent == null);
4294
+ Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
4295
+ GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
4296
+ if (LA.isIdentity(GrafreeD.clipboard.toParent))
4297
+ makeSomething(expand?GrafreeD.clipboard.get(0).copyExpand():GrafreeD.clipboard.get(0).deepCopy());
40314298 else
4032
- makeSomething(expand?GraphreeD.clipboard.copyExpand():GraphreeD.clipboard.deepCopy());
4033
- GraphreeD.clipboard.get(0).parent = keepparent;
4299
+ makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4300
+ GrafreeD.clipboard.get(0).parent = keepparent;
40344301 }
40354302
40364303 ResetModel();
....@@ -4039,7 +4306,7 @@
40394306
40404307 void pasteInto(boolean copyit)
40414308 {
4042
-// if (GraphreeD.clipboard == null)
4309
+// if (GrafreeD.clipboard == null)
40434310 // return;
40444311
40454312 if (group.selection.size() != 1)
....@@ -4072,9 +4339,9 @@
40724339 {
40734340 boolean first = true;
40744341
4075
- if (GraphreeD.clipboardIsTempGroup)
4342
+ if (GrafreeD.clipboardIsTempGroup)
40764343 {
4077
- Composite temp = (Composite)GraphreeD.clipboard;
4344
+ Composite temp = (Composite)GrafreeD.clipboard;
40784345 Object3D copy;
40794346 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
40804347 {
....@@ -4084,7 +4351,7 @@
40844351 }
40854352 } else
40864353 {
4087
- linkSomething(GraphreeD.clipboard); //.get(0));
4354
+ linkSomething(GrafreeD.clipboard); //.get(0));
40884355 }
40894356 }
40904357 }
....@@ -4276,6 +4543,26 @@
42764543 makeSomething(csg);
42774544 }
42784545
4546
+ void Ungroup(Object3D g)
4547
+ {
4548
+ if (g instanceof HiddenObject)
4549
+ {
4550
+ HiddenObject h = (HiddenObject) g;
4551
+
4552
+ for (int i=0; i<h.ActualSize(); i++)
4553
+ {
4554
+ objEditor.makeSomething(h.get(i), false);
4555
+ }
4556
+ }
4557
+ else
4558
+ {
4559
+ for (int i=0; i<g.Size(); i++)
4560
+ {
4561
+ objEditor.makeSomething(g.get(i), false);
4562
+ }
4563
+ }
4564
+ }
4565
+
42794566 void ungroup()
42804567 {
42814568 /*
....@@ -4471,7 +4758,7 @@
44714758
44724759 void ImportGFD()
44734760 {
4474
- FileDialog browser = new FileDialog(objEditor.frame, "Import GraphreeD", FileDialog.LOAD);
4761
+ FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD);
44754762 browser.show();
44764763 String filename = browser.getFile();
44774764 if (filename != null && filename.length() > 0)
....@@ -4509,7 +4796,7 @@
45094796
45104797 void ImportVRMLX3D()
45114798 {
4512
- if (GraphreeD.standAlone)
4799
+ if (GrafreeD.standAlone)
45134800 {
45144801 /**/
45154802 FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
....@@ -4526,7 +4813,7 @@
45264813
45274814 String GetFile(String dialogName)
45284815 {
4529
- if (GraphreeD.standAlone)
4816
+ if (GrafreeD.standAlone)
45304817 {
45314818 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
45324819 browser.show();
....@@ -4635,6 +4922,7 @@
46354922 private MenuItem resetsupportItem;
46364923 private MenuItem resetreferencesItem;
46374924 private MenuItem linkverticesItem;
4925
+ private MenuItem relinkverticesItem;
46384926 private MenuItem setMasterItem;
46394927 private MenuItem resetMeshItem;
46404928 private MenuItem stepAllItem;
....@@ -4653,8 +4941,10 @@
46534941 private MenuItem clearItem;
46544942 private MenuItem clearAllItem;
46554943 private MenuItem genUVItem;
4944
+ private MenuItem genNormalsMESHItem;
46564945 private MenuItem genNormalsCADItem;
46574946 private MenuItem genNormalsORGANItem;
4947
+ private MenuItem genNormalsMINEItem;
46584948 private MenuItem stripifyItem;
46594949 private MenuItem unstripifyItem;
46604950 private MenuItem trimItem;
....@@ -4696,6 +4986,7 @@
46964986 private MenuItem resetCentroidItem;
46974987 private MenuItem transformgeometryItem;
46984988 private MenuItem resetTransformItem;
4989
+ private MenuItem hideItem;
46994990 private MenuItem grabItem;
47004991 private MenuItem backItem;
47014992 private MenuItem frontItem;
....@@ -4728,12 +5019,15 @@
47285019 private MenuItem particleItem;
47295020 private MenuItem ragdollItem;
47305021 private MenuItem ragdoll2Item;
5022
+ private MenuItem heightFieldItem;
5023
+ private MenuItem textureFieldItem;
47315024 private MenuItem gridItem;
47325025 private MenuItem rectoidItem;
47335026 private MenuItem ellipsoidItem;
47345027 private MenuItem coneItem;
47355028 private MenuItem torusItem;
47365029 private MenuItem superItem;
5030
+ private MenuItem kleinItem;
47375031 private MenuItem blobItem;
47385032 private MenuItem latheItem;
47395033 private MenuItem bezierItem;
....@@ -4746,6 +5040,7 @@
47465040 private MenuItem csgItem;
47475041 private MenuItem templateItem;
47485042 private MenuItem textureItem;
5043
+ private MenuItem billboardItem;
47495044 private MenuItem shadowXItem;
47505045 private MenuItem shadowYItem;
47515046 private MenuItem shadowZItem;