Normand Briere
2015-11-03 b7dce2b3654df801a3904bc270dfcb641fcdb66e
Rename GrafreeD
1 files renamed
19 files modified
457 ■■■■■ changed files
BoundaryRep.java 30 ●●●● patch | view | raw | blame | history
CameraPane.java 83 ●●●●● patch | view | raw | blame | history
GenericJoint.java 2 ●●● patch | view | raw | blame | history
GrafreeD.java 43 ●●●● patch | view | raw | blame | history
GroupEditor.java 162 ●●●● patch | view | raw | blame | history
ImplicitTiler.java 4 ●●●● patch | view | raw | blame | history
LA.java 2 ●●● patch | view | raw | blame | history
Merge.java 2 ●●● patch | view | raw | blame | history
Mocap.java 29 ●●●● patch | view | raw | blame | history
MorphNode.java 8 ●●●● patch | view | raw | blame | history
ObjEditor.java 34 ●●●●● patch | view | raw | blame | history
Object3D.java 24 ●●●● patch | view | raw | blame | history
RandomNode.java 2 ●●● patch | view | raw | blame | history
SwitchNode.java 6 ●●●● patch | view | raw | blame | history
Texture.java 4 ●●●● patch | view | raw | blame | history
Vertex.java 6 ●●●● patch | view | raw | blame | history
cMaterial.java 2 ●●● patch | view | raw | blame | history
cMesh.java 10 ●●●● patch | view | raw | blame | history
cRadio.java 2 ●●● patch | view | raw | blame | history
cVector.java 2 ●●● patch | view | raw | blame | history
BoundaryRep.java
....@@ -172,16 +172,16 @@
172172 bufV = other.bufV;
173173 bufF = other.bufF;
174174
175
- positions = (float[]) GraphreeD.clone(other.positions);
176
- normals = (float[]) GraphreeD.clone(other.normals);
177
- colors = (float[]) GraphreeD.clone(other.colors);
178
- uvmap = (float[]) GraphreeD.clone(other.uvmap);
179
- triangles = (int[]) GraphreeD.clone(other.triangles);
175
+ positions = (float[]) GrafreeD.clone(other.positions);
176
+ normals = (float[]) GrafreeD.clone(other.normals);
177
+ colors = (float[]) GrafreeD.clone(other.colors);
178
+ uvmap = (float[]) GrafreeD.clone(other.uvmap);
179
+ triangles = (int[]) GrafreeD.clone(other.triangles);
180180
181
- indices = (int[]) GraphreeD.clone(other.indices);
181
+ indices = (int[]) GrafreeD.clone(other.indices);
182182
183
- vertices = (Vector<Vertex>) GraphreeD.clone(other.vertices);
184
- faces = (Vector<Face>) GraphreeD.clone(other.faces);
183
+ vertices = (Vector<Vertex>) GrafreeD.clone(other.vertices);
184
+ faces = (Vector<Face>) GrafreeD.clone(other.faces);
185185 }
186186 else
187187 {
....@@ -1492,7 +1492,7 @@
14921492 InitFaceIndices();
14931493 }
14941494
1495
- BoundaryRep rep = (BoundaryRep) GraphreeD.clone(this);
1495
+ BoundaryRep rep = (BoundaryRep) GrafreeD.clone(this);
14961496 //float[] v = new float[100];
14971497
14981498 for (int loops=1; --loops>=0;)
....@@ -1522,7 +1522,7 @@
15221522 InitFaceIndices();
15231523 }
15241524
1525
- BoundaryRep rep = (BoundaryRep) GraphreeD.clone(this);
1525
+ BoundaryRep rep = (BoundaryRep) GrafreeD.clone(this);
15261526 //float[] v = new float[100];
15271527
15281528 for (int loops=10; --loops>=0;)
....@@ -2600,7 +2600,7 @@
26002600 // if (stepout && !playedonce)
26012601 // {
26022602 // // sound
2603
-// GraphreeD.wav.play();
2603
+// GrafreeD.wav.play();
26042604 // playedonce = true;
26052605 // }
26062606 //
....@@ -2644,7 +2644,7 @@
26442644
26452645 if (CameraPane.framecount - lastsoundtime > 30) // 0.25 secs
26462646 {
2647
- GraphreeD.wav.play((Math.random()+0.5)/Math.max(tmp.length2(),0.2)); //, 1);
2647
+ GrafreeD.wav.play((Math.random()+0.5)/Math.max(tmp.length2(),0.2)); //, 1);
26482648
26492649 lastsoundtime = CameraPane.framecount;
26502650 }
....@@ -3229,7 +3229,7 @@
32293229 k /= x*x + y*y;
32303230 }
32313231 else
3232
- GraphreeD.Assert(z == 1);
3232
+ GrafreeD.Assert(z == 1);
32333233
32343234 if (k < 0)
32353235 k = 0;
....@@ -7391,7 +7391,7 @@
73917391 Trim();
73927392 Untrim();
73937393
7394
- BoundaryRep tmp = new BoundaryRep(); // (BoundaryRep) GraphreeD.clone(this);
7394
+ BoundaryRep tmp = new BoundaryRep(); // (BoundaryRep) GrafreeD.clone(this);
73957395
73967396 double minx = Float.POSITIVE_INFINITY;
73977397 double maxx = Float.NEGATIVE_INFINITY;
....@@ -8067,7 +8067,7 @@
80678067 if (!trimmed)
80688068 return;
80698069
8070
- GraphreeD.linkUV = false;
8070
+ GrafreeD.linkUV = false;
80718071
80728072 try
80738073 {
CameraPane.java
....@@ -228,7 +228,7 @@
228228 void PushMatrix(double[][] matrix, int count)
229229 {
230230 matrixdepth++;
231
- // GraphreeD.tracein(matrix);
231
+ // GrafreeD.tracein(matrix);
232232 if (matrix == null)
233233 return; // Identity
234234
....@@ -253,13 +253,13 @@
253253
254254 void PushMatrix(double[][] matrix)
255255 {
256
- // GraphreeD.tracein(matrix);
256
+ // GrafreeD.tracein(matrix);
257257 PushMatrix(matrix,1);
258258 }
259259
260260 void PushMatrix()
261261 {
262
- // GraphreeD.tracein(null);
262
+ // GrafreeD.tracein(null);
263263 if (matrixdepth++ < MAXSTACK - 1)
264264 {
265265 currentGL.glPushMatrix();
....@@ -274,7 +274,7 @@
274274 {
275275 --matrixdepth;
276276
277
- // GraphreeD.traceout(inverse);
277
+ // GrafreeD.traceout(inverse);
278278 if (inverse == null)
279279 return; // Identity
280280
....@@ -292,7 +292,7 @@
292292
293293 void PopMatrix()
294294 {
295
- // GraphreeD.traceout(null);
295
+ // GrafreeD.traceout(null);
296296 // inverse == null??
297297 if (--matrixdepth < MAXSTACK - 1)
298298 {
....@@ -491,7 +491,7 @@
491491 System.err.println("LIVE = " + isLIVE());
492492
493493 if (!isLIVE()) // save sound
494
- GraphreeD.savesound = true; // wav.save();
494
+ GrafreeD.savesound = true; // wav.save();
495495 // else
496496 repaint(); // start loop // may 2013
497497 }
....@@ -6333,7 +6333,7 @@
63336333 {
63346334 bumpdepth--;
63356335
6336
- // GraphreeD.trace("POP " + tex + "(" + pigmentdepth + ")" + " : " + pigmentstack[pigmentdepth] + " vs " + texture);
6336
+ // GrafreeD.trace("POP " + tex + "(" + pigmentdepth + ")" + " : " + pigmentstack[pigmentdepth] + " vs " + texture);
63376337 if (bumpstack[bumpdepth] != (texture!=null?texture.texture:null))
63386338 {
63396339 // assert (bumpstack[bumpdepth] == texture);
....@@ -6363,7 +6363,7 @@
63636363 {
63646364 pigmentdepth--;
63656365
6366
- // GraphreeD.trace("POP " + tex + "(" + pigmentdepth + ")" + " : " + pigmentstack[pigmentdepth] + " vs " + texture);
6366
+ // GrafreeD.trace("POP " + tex + "(" + pigmentdepth + ")" + " : " + pigmentstack[pigmentdepth] + " vs " + texture);
63676367 if (pigmentstack[pigmentdepth] != (texture!=null?texture.texture:null))
63686368 {
63696369 // assert (pigmentstack[pigmentdepth] == texture);
....@@ -6694,12 +6694,12 @@
66946694
66956695 if (bump)
66966696 {
6697
- // GraphreeD.trace("PUSH BUMP " + tex + "(" + bumpdepth + ")" + " : " + texture);
6697
+ // GrafreeD.trace("PUSH BUMP " + tex + "(" + bumpdepth + ")" + " : " + texture);
66986698 bumpstack[bumpdepth++] = texture!=null?texture.texture:null;
66996699 }
67006700 else
67016701 {
6702
- // GraphreeD.trace("PUSH PIGMENT " + tex + "(" + pigmentdepth + ")" + " : " + texture);
6702
+ // GrafreeD.trace("PUSH PIGMENT " + tex + "(" + pigmentdepth + ")" + " : " + texture);
67036703 pigmentstack[pigmentdepth++] = texture!=null?texture.texture:null;
67046704 }
67056705
....@@ -7628,14 +7628,14 @@
76287628
76297629 //System.out.println("start frame");
76307630 gl.glClear(gl.GL_ACCUM_BUFFER_BIT);
7631
- for (jitter = 0; jitter < ACSIZE; jitter++) //, GraphreeD.wav.cursor += LIVE ? 735 : 0)
7631
+ for (jitter = 0; jitter < ACSIZE; jitter++) //, GrafreeD.wav.cursor += LIVE ? 735 : 0)
76327632 {
76337633 framecount++;
76347634
76357635 if (CameraPane.tickcount > 0)
76367636 CameraPane.tickcount--;
76377637
7638
-// GraphreeD.wav.cursor += 735; // 44100 Hz / 120 Hz * 2 (for 16 bits)
7638
+// GrafreeD.wav.cursor += 735; // 44100 Hz / 120 Hz * 2 (for 16 bits)
76397639 // restartframe = true;
76407640 if (options1[2] > 100 && (jitter%2==0))
76417641 {
....@@ -7923,7 +7923,7 @@
79237923
79247924 if (!BOXMODE)
79257925 {
7926
- System.out.println("image: " + fullname + " (" + (GraphreeD.wav.cursor / 735 / 4) + ")");
7926
+ System.out.println("image: " + fullname + " (" + (GrafreeD.wav.cursor / 735 / 4) + ")");
79277927 }
79287928
79297929 if (!BOXMODE)
....@@ -7951,7 +7951,7 @@
79517951 {
79527952 if (ACSIZE > 1)
79537953 {
7954
- // System.err.println("image #" + (GraphreeD.wav.cursor / 735 / 4));
7954
+ // System.err.println("image #" + (GrafreeD.wav.cursor / 735 / 4));
79557955 }
79567956 }
79577957
....@@ -7961,7 +7961,7 @@
79617961 ABORTED = false;
79627962 }
79637963 else
7964
- GraphreeD.wav.cursor += 735 * ACSIZE;
7964
+ GrafreeD.wav.cursor += 735 * ACSIZE;
79657965
79667966 if (false)
79677967 {
....@@ -8631,11 +8631,11 @@
86318631
86328632 public void display(GLAutoDrawable drawable)
86338633 {
8634
- if (GraphreeD.savesound && GraphreeD.hassound)
8634
+ if (GrafreeD.savesound && GrafreeD.hassound)
86358635 {
8636
- GraphreeD.wav.save();
8637
- GraphreeD.savesound = false;
8638
- GraphreeD.hassound = false;
8636
+ GrafreeD.wav.save();
8637
+ GrafreeD.savesound = false;
8638
+ GrafreeD.hassound = false;
86398639 }
86408640 // if (DEBUG_SELECTION)
86418641 // {
....@@ -8765,7 +8765,7 @@
87658765 Object3D theobject = object;
87668766 Object3D theparent = object.parent;
87678767 object.parent = null;
8768
- object = (Object3D)GraphreeD.clone(object);
8768
+ object = (Object3D)GrafreeD.clone(object);
87698769 object.Stripify();
87708770 if (theobject.selection == null || theobject.selection.Size() == 0)
87718771 theobject.PreprocessOcclusion(this);
....@@ -9660,8 +9660,8 @@
96609660 e.printStackTrace();
96619661 }
96629662
9663
- if (GraphreeD.RENDERME > 0)
9664
- GraphreeD.RENDERME--; // mechante magouille
9663
+ if (GrafreeD.RENDERME > 0)
9664
+ GrafreeD.RENDERME--; // mechante magouille
96659665
96669666 ONESTEP = false;
96679667 }
....@@ -9734,7 +9734,7 @@
97349734 BindTextures(DEFAULT_TEXTURES, 2);
97359735 }
97369736 //System.out.println("--> " + stackdepth);
9737
-// GraphreeD.traceon();
9737
+// GrafreeD.traceon();
97389738
97399739 // DRAW
97409740 object.draw(this, /*(Composite)*/ object, false, false);
....@@ -9765,17 +9765,31 @@
97659765 debugpoint2.material.color = 0.75f;
97669766 debugpoint2.material.modulation = 0.75f;
97679767
9768
+ debugpoint3.radius = radius;
9769
+ debugpoint3.recalculate();
9770
+ debugpoint3.material = new cMaterial();
9771
+ debugpoint3.material.color = 0.5f;
9772
+ debugpoint3.material.modulation = 0.75f;
9773
+
9774
+ debugpoint4.radius = radius;
9775
+ debugpoint4.recalculate();
9776
+ debugpoint4.material = new cMaterial();
9777
+ debugpoint4.material.color = 0f;
9778
+ debugpoint4.material.modulation = 0.75f;
9779
+
97689780 InitPoints(radius);
97699781 }
97709782 selectedpoint.draw(this, /*(Composite)*/ null, false, false);
9771
- //debugpoint.draw(this, /*(Composite)*/ null, false);
9772
- //debugpoint2.draw(this, /*(Composite)*/ null, false);
9773
- DrawPoints(this);
9783
+ debugpoint.draw(this, /*(Composite)*/ null, false,false);
9784
+ debugpoint2.draw(this, /*(Composite)*/ null, false,false);
9785
+ debugpoint3.draw(this, /*(Composite)*/ null, false,false);
9786
+ debugpoint4.draw(this, /*(Composite)*/ null, false,false);
9787
+ // DrawPoints(this);
97749788 }
97759789
97769790 // debugstuff.draw(this, /*(Composite)*/ null, false);
97779791 }
9778
-// GraphreeD.traceoff();
9792
+// GrafreeD.traceoff();
97799793 //System.out.println(stackdepth);
97809794 if (drawMode == 0)
97819795 {
....@@ -11092,10 +11106,17 @@
1109211106 "MOV final.z, zero.x;" +
1109311107 "MOV final.a, one.w;":""
1109411108 ) +
11109
+ /*
1109511110 (NORMALdebug?"MOV final.x, normal.x;" +
1109611111 "MOV final.y, normal.y;" +
1109711112 "MOV final.z, normal.z;" +
1109811113 "MOV final.a, one.w;":""
11114
+ ) +
11115
+ */
11116
+ (NORMALdebug?"SUB final.x, one.x, final.x;" +
11117
+ "SUB final.y, one.x, final.y;" +
11118
+ "SUB final.z, one.x, final.z;" +
11119
+ "MOV final.a, final.a;":""
1109911120 ) +
1110011121 // "MOV final, bumpmap;" +
1110111122 "MOV result.color, final;" +
....@@ -14700,16 +14721,16 @@
1470014721 System.out.println("; fromto " + sel + " " + Trunk(previousselectedpoint.toParent[3][0]) + " " + Trunk(previousselectedpoint.toParent[3][2]) + " " + Trunk(selectedpoint.toParent[3][0]) + " " + Trunk(selectedpoint.toParent[3][2]));
1470114722 }
1470214723
14703
- previousselectedpoint = (Sphere) GraphreeD.clone(selectedpoint);
14724
+ previousselectedpoint = (Sphere) GrafreeD.clone(selectedpoint);
1470414725 }
1470514726 }
1470614727
1470714728 if (!movingcamera && !PAINTMODE)
1470814729 object.editWindow.ScreenFitPoint(); // fev 2014
1470914730
14710
- if (PAINTMODE && GraphreeD.clipboard.size() == 1) // object.editWindow.copy.selection.Size() > 0)
14731
+ if (PAINTMODE && GrafreeD.clipboard.size() == 1) // object.editWindow.copy.selection.Size() > 0)
1471114732 {
14712
- Object3D paintobj = GraphreeD.clipboard.get(0); // object.editWindow.copy.selection.elementAt(0);
14733
+ Object3D paintobj = GrafreeD.clipboard.get(0); // object.editWindow.copy.selection.elementAt(0);
1471314734
1471414735 Object3D group = new Object3D("inst" + paintcount++);
1471514736
....@@ -15283,6 +15304,8 @@
1528315304 static Sphere previousselectedpoint = null;
1528415305 static Sphere debugpoint = new Sphere();
1528515306 static Sphere debugpoint2 = new Sphere();
15307
+ static Sphere debugpoint3 = new Sphere();
15308
+ static Sphere debugpoint4 = new Sphere();
1528615309
1528715310 static Sphere debugpoints[] = new Sphere[8];
1528815311
GenericJoint.java
....@@ -379,7 +379,7 @@
379379 try
380380 {
381381 //font = FontRender.createFont("Dialog", 11, false, true);
382
- font = new FontRender.GLFont(gl, GraphreeD.class.getResourceAsStream("DejaVu_Sans_11.fnt"));
382
+ font = new FontRender.GLFont(gl, GrafreeD.class.getResourceAsStream("DejaVu_Sans_11.fnt"));
383383 } catch (java.io.IOException e)
384384 {
385385 e.printStackTrace();
GraphreeD.java
similarity index 96%rename from GraphreeD.javarename to GrafreeD.java
....@@ -13,7 +13,7 @@
1313 import javax.sound.sampled.*;
1414
1515 //import com.jamonapi.*;
16
-public class GraphreeD extends Applet implements ActionListener
16
+public class GrafreeD extends Applet implements ActionListener
1717 {
1818 static int RENDERME = 0;
1919
....@@ -25,7 +25,7 @@
2525 static boolean hassound = false;
2626 static boolean savesound = false;
2727
28
- public GraphreeD()
28
+ public GrafreeD()
2929 {
3030 javax.swing.Timer timer = new javax.swing.Timer(1000, this);
3131
....@@ -44,7 +44,7 @@
4444
4545 public void init()
4646 {
47
- add(openEditorButton = new Button("GraphreeD"));
47
+ add(openEditorButton = new Button("GrafreeD"));
4848 //Composite god = new Composite();
4949 universe = new Composite();
5050 universe.material = new cMaterial();
....@@ -595,6 +595,39 @@
595595
596596 public static void main(String argv[])
597597 {
598
+ if (argv.length == 0)
599
+ {
600
+ String javaPath = System.getProperty("java.home") + "/bin/java";
601
+ java.net.URL u = new GrafreeD().getClass().getResource("default.png");
602
+
603
+ System.out.println(u);
604
+
605
+ String jarfile = u.toString().split("file:")[1].split("default.png")[0];
606
+
607
+ String jarpath = u.toString().split("file:")[1].split("GrafreeD.jar")[0];
608
+
609
+ System.out.println(jarfile);
610
+ System.out.println(jarpath);
611
+
612
+ jarfile = jarfile.substring(0, jarfile.length() - 2);
613
+
614
+ // -Djava.library.path=/Users/nbriere/Projects/shared/lib
615
+
616
+ String command = "" + javaPath + " -Xmx1024m -Djava.library.path=" + jarpath + "lib -jar " + jarfile + " dummyarg";
617
+
618
+ try
619
+ {
620
+ System.out.println(command);
621
+ Runtime.getRuntime().exec(command);
622
+
623
+ return;
624
+ }
625
+ catch (Exception e)
626
+ {
627
+ e.printStackTrace();
628
+ }
629
+ }
630
+
598631 // InitDictionary();
599632
600633 // Spell("is over".toUpperCase());
....@@ -717,7 +750,7 @@
717750
718751 //Monitor mon=MonitorFactory.start("myFirstMonitor");
719752 standAlone = true;
720
- theApplet3D = new GraphreeD();
753
+ theApplet3D = new GrafreeD();
721754 theApplet3D.universe = new Composite();
722755 theApplet3D.universe.name = "Scene";
723756 theApplet3D.universe.material = new cMaterial();
....@@ -951,7 +984,7 @@
951984 } while (avail > 0 && numRead >= 0);
952985 return new String(data, 0, pos, "US-ASCII");
953986 }
954
- public static GraphreeD theApplet3D;
987
+ public static GrafreeD theApplet3D;
955988 public static boolean standAlone = true;
956989 public Composite universe;
957990 public static Object3D clipboard = new Object3D();
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
....@@ -225,10 +225,10 @@
225225 oe.menuBar.add(menu = new Menu("Group"));
226226 grabItem = menu.add(new MenuItem("Grab"));
227227 grabItem.addActionListener(this);
228
- frontItem = menu.add(new MenuItem("Front"));
229
- frontItem.addActionListener(this);
230228 backItem = menu.add(new MenuItem("Back"));
231229 backItem.addActionListener(this);
230
+ frontItem = menu.add(new MenuItem("Front"));
231
+ frontItem.addActionListener(this);
232232 compositeItem = menu.add(new MenuItem("Composite"));
233233 compositeItem.addActionListener(this);
234234 menu.add("-");
....@@ -380,7 +380,7 @@
380380
381381
382382 oe.menuBar.add(menu = new Menu("Include"));
383
- importGFDItem = menu.add(new MenuItem("GraphreeD Object..."));
383
+ importGFDItem = menu.add(new MenuItem("GrafreeD Object..."));
384384 importGFDItem.addActionListener(this);
385385 importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D Object..."));
386386 importVRMLX3DItem.addActionListener(this);
....@@ -1441,9 +1441,9 @@
14411441
14421442 void Overwrite(int mask)
14431443 {
1444
- if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
1444
+ if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
14451445 {
1446
- Object3D content = GraphreeD.clipboard.get(0);
1446
+ Object3D content = GrafreeD.clipboard.get(0);
14471447
14481448 if (content instanceof cGroup && ((cGroup)content).transientlink )
14491449 content = ((cGroup)content).get(0);
....@@ -1778,7 +1778,7 @@
17781778 if (event.getSource() == invariantsItem)
17791779 {
17801780 System.out.println("Invariants:");
1781
- GraphreeD.theApplet3D.universe.invariants();
1781
+ GrafreeD.theApplet3D.universe.invariants();
17821782 } else
17831783 if (event.getSource() == memoryItem)
17841784 {
....@@ -1848,10 +1848,10 @@
18481848 } else
18491849 if (event.getSource() == duplicateItem)
18501850 {
1851
- Object3D keep = GraphreeD.clipboard;
1851
+ Object3D keep = GrafreeD.clipboard;
18521852 loadClipboard(false);
18531853 paste(false);
1854
- GraphreeD.clipboard = keep;
1854
+ GrafreeD.clipboard = keep;
18551855 } else
18561856 if (event.getSource() == cloneItem)
18571857 {
....@@ -1895,8 +1895,9 @@
18951895 } else
18961896 if (event.getSource() == overwriteMatItem)
18971897 {
1898
+ /* july 2015
18981899 if ((dropAttributes & Object3D.TEXTURE) == 0)
1899
- Overwrite(Object3D.MATERIAL);
1900
+ Overwrite(Object3D.MATERIAL | Object3D.COLOR);
19001901 else
19011902 {
19021903 if ((dropAttributes & Object3D.COLOR) == 0 && (dropAttributes & Object3D.MATERIAL) == 0)
....@@ -1908,13 +1909,16 @@
19081909 Overwrite(Object3D.MATERIAL | Object3D.TEXTURE);
19091910 }
19101911 }
1912
+ */
1913
+
1914
+ Overwrite(dropAttributes);
19111915 }
19121916 if (event.getSource() == overwriteGeoItem)
19131917 {
19141918 Overwrite(Object3D.GEOMETRY);
1915
-// if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
1919
+// if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
19161920 // {
1917
-// Object3D content = GraphreeD.clipboard.get(0);
1921
+// Object3D content = GrafreeD.clipboard.get(0);
19181922 //
19191923 // if (content instanceof cGroup && ((cGroup)content).transientlink )
19201924 // content = ((cGroup)content).get(0);
....@@ -2047,9 +2051,9 @@
20472051 } else
20482052 if (event.getSource() == linkverticesItem)
20492053 {
2050
-// if (group.selection.size() == 1 && GraphreeD.clipboard.size() == 1)
2054
+// if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
20512055 // {
2052
-// Object3D content = GraphreeD.clipboard.get(0);
2056
+// Object3D content = GrafreeD.clipboard.get(0);
20532057 //
20542058 // if (content instanceof cGroup && ((cGroup)content).transientlink )
20552059 // content = ((cGroup)content).get(0);
....@@ -2058,9 +2062,9 @@
20582062 // group.selection.get(0).setMasterThis(content); // should be identity
20592063 // refreshContents();
20602064 // }
2061
- if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
2065
+ if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
20622066 {
2063
- Object3D content = GraphreeD.clipboard.get(0);
2067
+ Object3D content = GrafreeD.clipboard.get(0);
20642068
20652069 if (content instanceof cGroup && ((cGroup)content).transientlink )
20662070 content = ((cGroup)content).get(0);
....@@ -2101,9 +2105,9 @@
21012105 } else
21022106 if (event.getSource() == setMasterItem)
21032107 {
2104
- if (group.selection.size() == 1 && GraphreeD.clipboard.size() == 1)
2108
+ if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)
21052109 {
2106
- Object3D content = GraphreeD.clipboard.get(0);
2110
+ Object3D content = GrafreeD.clipboard.get(0);
21072111
21082112 if (content instanceof cGroup && ((cGroup)content).transientlink )
21092113 content = ((cGroup)content).get(0);
....@@ -2116,9 +2120,9 @@
21162120 {
21172121 if (group.selection.size() == 1)
21182122 {
2119
- if (GraphreeD.clipboard.size() == 1)
2123
+ if (GrafreeD.clipboard.size() == 1)
21202124 {
2121
- Object3D content = GraphreeD.clipboard.get(0);
2125
+ Object3D content = GrafreeD.clipboard.get(0);
21222126
21232127 if (content instanceof cGroup && ((cGroup)content).transientlink )
21242128 content = ((cGroup)content).get(0);
....@@ -2806,7 +2810,7 @@
28062810 if (event.getSource() == unselectButton)
28072811 {
28082812 objEditor.jTree.clearSelection();
2809
- // ?? oct 2012 GraphreeD.clipboard.clear();
2813
+ // ?? oct 2012 GrafreeD.clipboard.clear();
28102814 objEditor.ResetSliders();
28112815 refreshContents(true);
28122816 } else
....@@ -3121,9 +3125,9 @@
31213125 obj = (Object3D)e.nextElement();
31223126
31233127 System.out.println("Object is: " + obj);
3124
- GraphreeD.AnalyzeObject(obj);
3128
+ GrafreeD.AnalyzeObject(obj);
31253129 System.out.println("Boundary rep: " + obj.bRep);
3126
- GraphreeD.AnalyzeObject(obj.bRep);
3130
+ GrafreeD.AnalyzeObject(obj.bRep);
31273131
31283132 // System.err.println((size/1024) + " KB is the size of " + obj);
31293133 }
....@@ -3250,7 +3254,7 @@
32503254 // LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
32513255 // LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
32523256 //
3253
-// g.add(GraphreeD.clipboard);
3257
+// g.add(GrafreeD.clipboard);
32543258 //
32553259 // buffer.add(g);
32563260 // }
....@@ -3269,8 +3273,8 @@
32693273 // nodes = new Object3D();
32703274 // vertices = new Vector<Vertex>();
32713275 //
3272
-// boolean epsequal = GraphreeD.epsequal;
3273
-// GraphreeD.epsequal = true;
3276
+// boolean epsequal = GrafreeD.epsequal;
3277
+// GrafreeD.epsequal = true;
32743278 //
32753279 // for (int i=0; i<group.selection.size(); i++)
32763280 // {
....@@ -3311,7 +3315,7 @@
33113315 // LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
33123316 // LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
33133317 //
3314
-// g.add(GraphreeD.clipboard);
3318
+// g.add(GrafreeD.clipboard);
33153319 //
33163320 // buffer.add(g);
33173321 // }
....@@ -3319,7 +3323,7 @@
33193323 // makeSomething(buffer, i==group.selection.size()-1);
33203324 // }
33213325 //
3322
-// GraphreeD.epsequal = epsequal;
3326
+// GrafreeD.epsequal = epsequal;
33233327 //
33243328 // //buffer = null;
33253329 // temprep = null;
....@@ -3330,8 +3334,8 @@
33303334
33313335 void ParseVertices()
33323336 {
3333
- boolean epsequal = GraphreeD.epsequal;
3334
- GraphreeD.epsequal = true;
3337
+ boolean epsequal = GrafreeD.epsequal;
3338
+ GrafreeD.epsequal = true;
33353339
33363340 for (int i=0; i<group.selection.size(); i++)
33373341 {
....@@ -3356,7 +3360,7 @@
33563360 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z);
33573361 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z);
33583362
3359
- g.add(GraphreeD.clipboard);
3363
+ g.add(GrafreeD.clipboard);
33603364
33613365 buffer.add(g);
33623366 }
....@@ -3371,7 +3375,7 @@
33713375 makeSomething(buffer, i==group.selection.size()-1);
33723376 }
33733377
3374
- GraphreeD.epsequal = epsequal;
3378
+ GrafreeD.epsequal = epsequal;
33753379
33763380 refreshContents();
33773381 }
....@@ -3416,7 +3420,7 @@
34163420 scale /= 3;
34173421
34183422 scale /= 0xFF;
3419
- scale /= 4;
3423
+ // c'est quoi ca? scale /= 4;
34203424
34213425 //v.AO = scale;
34223426
....@@ -3455,7 +3459,7 @@
34553459 // ref.SaveSupports();
34563460 // Object3D par = ref.parent;
34573461 // ref.parent = null;
3458
-// Object3D lowres = (Object3D) GraphreeD.clone(ref);
3462
+// Object3D lowres = (Object3D) GrafreeD.clone(ref);
34593463 // ref.parent = par;
34603464 // ref.RestoreSupports();
34613465
....@@ -3485,7 +3489,7 @@
34853489 // lowres.SaveSupports();
34863490 // par = lowres.parent;
34873491 // lowres.parent = null;
3488
-// Object3D newlow = (Object3D) GraphreeD.clone(lowres);
3492
+// Object3D newlow = (Object3D) GrafreeD.clone(lowres);
34893493 Object3D newlow = CloneObject(lowres, false);
34903494 newlow.name = sn.switchobject.get(i).name;
34913495 System.out.println(" pose#" + i + " = " + newlow);
....@@ -3507,7 +3511,7 @@
35073511 return;
35083512
35093513 Object3D poses = group.selection.get(0);
3510
- Object3D ref = GraphreeD.clipboard.get(0);
3514
+ Object3D ref = GrafreeD.clipboard.get(0);
35113515
35123516 Object3D newgroup = new Object3D("Po:" + poses.name);
35133517
....@@ -3701,20 +3705,20 @@
37013705
37023706 void ClipMesh()
37033707 {
3704
- if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)
3708
+ if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)
37053709 {
3706
- Object3D content = GraphreeD.clipboard.get(0);
3710
+ Object3D content = GrafreeD.clipboard.get(0);
37073711
37083712 if (content instanceof cGroup && ((cGroup)content).transientlink )
37093713 content = ((cGroup)content).get(0);
37103714
37113715 // for (int i=0; i<group.selection.size(); i++)
37123716 // {
3713
-// group.selection.get(i).ClipMesh(GraphreeD.clipboard);
3717
+// group.selection.get(i).ClipMesh(GrafreeD.clipboard);
37143718 // }
3715
- group.selection.ClipMesh(GraphreeD.clipboard);
3719
+ group.selection.ClipMesh(GrafreeD.clipboard);
37163720 }
3717
-// group.selection.ClipMesh(GraphreeD.clipboard);
3721
+// group.selection.ClipMesh(GrafreeD.clipboard);
37183722 System.out.println("DONE.");
37193723 refreshContents();
37203724 }
....@@ -4052,12 +4056,12 @@
40524056 {
40534057 if (group.selection.isEmpty())
40544058 return;
4055
- GraphreeD.clipboardIsTempGroup = false;
4059
+ GrafreeD.clipboardIsTempGroup = false;
40564060 Composite tGroup = null;
40574061 if (group.selection.size() > 0) // 1)
40584062 {
40594063 tGroup = new cGroup();
4060
- GraphreeD.clipboardIsTempGroup = true;
4064
+ GrafreeD.clipboardIsTempGroup = true;
40614065 }
40624066
40634067 if (cut)
....@@ -4097,16 +4101,16 @@
40974101 //System.out.println("cut " + child);
40984102 //System.out.println("parent = " + child.parent);
40994103 // tmp.addChild(child);
4100
- if (GraphreeD.clipboardIsTempGroup)
4104
+ if (GrafreeD.clipboardIsTempGroup)
41014105 tGroup.add/*Child*/(tmp);
41024106 else
4103
- GraphreeD.clipboard = tmp;
4107
+ GrafreeD.clipboard = tmp;
41044108 }
41054109 else
4106
- if (GraphreeD.clipboardIsTempGroup)
4110
+ if (GrafreeD.clipboardIsTempGroup)
41074111 tGroup.add/*Child*/(child);
41084112 else
4109
- GraphreeD.clipboard = child;
4113
+ GrafreeD.clipboard = child;
41104114 }
41114115
41124116 //ResetModel();
....@@ -4138,21 +4142,21 @@
41384142 //System.out.println("cut " + elem);
41394143 //System.out.println("parent = " + elem.parent);
41404144 // tmp.addChild(elem);
4141
- if (GraphreeD.clipboardIsTempGroup)
4145
+ if (GrafreeD.clipboardIsTempGroup)
41424146 tGroup.add/*Child*/(tmp);
41434147 else
4144
- GraphreeD.clipboard = tmp;
4148
+ GrafreeD.clipboard = tmp;
41454149 }
41464150 else
4147
- if (GraphreeD.clipboardIsTempGroup)
4151
+ if (GrafreeD.clipboardIsTempGroup)
41484152 tGroup.add/*Child*/(child);
41494153 else
4150
- GraphreeD.clipboard = child;
4154
+ GrafreeD.clipboard = child;
41514155 }
41524156
41534157 }
4154
- if (GraphreeD.clipboardIsTempGroup)
4155
- GraphreeD.clipboard = tGroup;
4158
+ if (GrafreeD.clipboardIsTempGroup)
4159
+ GrafreeD.clipboard = tGroup;
41564160 if (cut)
41574161 {
41584162 ResetModel();
....@@ -4162,11 +4166,11 @@
41624166
41634167 void paste(boolean expand)
41644168 {
4165
- // if (GraphreeD.clipboard == null)
4169
+ // if (GrafreeD.clipboard == null)
41664170 // return;
41674171 boolean first = true;
41684172
4169
- if (GraphreeD.clipboardIsTempGroup)
4173
+ if (GrafreeD.clipboardIsTempGroup)
41704174 {
41714175 Composite temp;
41724176
....@@ -4177,7 +4181,7 @@
41774181 temp = (Composite)Applet3D.clipboard.deepCopy();
41784182 */
41794183 Object3D elem;
4180
- for (Enumeration e = /*temp.children*/GraphreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
4184
+ for (Enumeration e = /*temp.children*/GrafreeD.clipboard.elements(); e.hasMoreElements();) // objList.add(copy.name))
41814185 {
41824186 Object3D child = (Object3D)e.nextElement();
41834187
....@@ -4191,7 +4195,7 @@
41914195 else
41924196 elem = child.deepCopy(); // ?
41934197 child.parent = keepparent;
4194
- //if (GraphreeD.clipboardIsTempGroup && LA.isIdentity(elem.fromParent))
4198
+ //if (GrafreeD.clipboardIsTempGroup && LA.isIdentity(elem.fromParent))
41954199 // elem = elem.get(0);
41964200 makeSomething(elem, true); // ?? first);
41974201 //group.addChild(elem);
....@@ -4211,14 +4215,14 @@
42114215 //Object3D cb = Applet3D.clipboard;
42124216 //temp.addChild(cb);
42134217 //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());
4218
+ assert(GrafreeD.clipboard.parent == null);
4219
+ Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;
4220
+ GrafreeD.clipboard.get(0).parent = null; // Avoid copy?
4221
+ if (LA.isIdentity(GrafreeD.clipboard.toParent))
4222
+ makeSomething(expand?GrafreeD.clipboard.get(0).copyExpand():GrafreeD.clipboard.get(0).deepCopy());
42194223 else
4220
- makeSomething(expand?GraphreeD.clipboard.copyExpand():GraphreeD.clipboard.deepCopy());
4221
- GraphreeD.clipboard.get(0).parent = keepparent;
4224
+ makeSomething(expand?GrafreeD.clipboard.copyExpand():GrafreeD.clipboard.deepCopy());
4225
+ GrafreeD.clipboard.get(0).parent = keepparent;
42224226 }
42234227
42244228 ResetModel();
....@@ -4227,7 +4231,7 @@
42274231
42284232 void pasteInto(boolean copyit)
42294233 {
4230
-// if (GraphreeD.clipboard == null)
4234
+// if (GrafreeD.clipboard == null)
42314235 // return;
42324236
42334237 if (group.selection.size() != 1)
....@@ -4260,9 +4264,9 @@
42604264 {
42614265 boolean first = true;
42624266
4263
- if (GraphreeD.clipboardIsTempGroup)
4267
+ if (GrafreeD.clipboardIsTempGroup)
42644268 {
4265
- Composite temp = (Composite)GraphreeD.clipboard;
4269
+ Composite temp = (Composite)GrafreeD.clipboard;
42664270 Object3D copy;
42674271 for (Enumeration e = temp.children.elements(); e.hasMoreElements();)
42684272 {
....@@ -4272,7 +4276,7 @@
42724276 }
42734277 } else
42744278 {
4275
- linkSomething(GraphreeD.clipboard); //.get(0));
4279
+ linkSomething(GrafreeD.clipboard); //.get(0));
42764280 }
42774281 }
42784282 }
....@@ -4659,7 +4663,7 @@
46594663
46604664 void ImportGFD()
46614665 {
4662
- FileDialog browser = new FileDialog(objEditor.frame, "Import GraphreeD", FileDialog.LOAD);
4666
+ FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD);
46634667 browser.show();
46644668 String filename = browser.getFile();
46654669 if (filename != null && filename.length() > 0)
....@@ -4697,7 +4701,7 @@
46974701
46984702 void ImportVRMLX3D()
46994703 {
4700
- if (GraphreeD.standAlone)
4704
+ if (GrafreeD.standAlone)
47014705 {
47024706 /**/
47034707 FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD);
....@@ -4714,7 +4718,7 @@
47144718
47154719 String GetFile(String dialogName)
47164720 {
4717
- if (GraphreeD.standAlone)
4721
+ if (GrafreeD.standAlone)
47184722 {
47194723 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD);
47204724 browser.show();
ImplicitTiler.java
....@@ -194,8 +194,8 @@
194194 {
195195 // Merge normals: tolerance == 0 means use analytic,
196196 // tolerance == 10 means use generated normals
197
- BoundaryRep analytic = (BoundaryRep) GraphreeD.clone(bRep);
198
- BoundaryRep generated = (BoundaryRep) GraphreeD.clone(bRep);
197
+ BoundaryRep analytic = (BoundaryRep) GrafreeD.clone(bRep);
198
+ BoundaryRep generated = (BoundaryRep) GrafreeD.clone(bRep);
199199
200200 analytic.Trim(trim, false, false, stripify, true);
201201 generated.Trim(trim, true, false, stripify, true);
LA.java
....@@ -615,7 +615,7 @@
615615 private static int indxc[] = new int[4];
616616
617617
618
- static int SIZE = 65536*64;
618
+ static int SIZE = 0; // 65536*64;
619619
620620 static double[] costable = new double[SIZE];
621621 static double[] sintable = new double[SIZE];
Merge.java
....@@ -192,7 +192,7 @@
192192 try
193193 {
194194 //font = FontRender.createFont("Dialog", 11, false, true);
195
- font = new FontRender.GLFont(gl, GraphreeD.class.getResourceAsStream("DejaVu_Sans_11.fnt"));
195
+ font = new FontRender.GLFont(gl, GrafreeD.class.getResourceAsStream("DejaVu_Sans_11.fnt"));
196196 } catch (java.io.IOException e)
197197 {
198198 e.printStackTrace();
Mocap.java
....@@ -359,7 +359,7 @@
359359 // //GetFileRoot();
360360
361361 // sept 2014: //
362
- GraphreeD.RENDERME = 3; // patch for Merge objects
362
+ GrafreeD.RENDERME = 3; // patch for Merge objects
363363 float[] thedata = bvh.animation.getBoneData(0);
364364
365365 os.x = (float) (path.get(i).toParent[3][0]); // - thedata[frame*6]);
....@@ -938,6 +938,7 @@
938938
939939 groundid = floorid;
940940
941
+ // green
941942 CameraPane.debugpoint.toParent[3][0] = groundx;
942943 CameraPane.debugpoint.toParent[3][1] = floor.y;
943944 CameraPane.debugpoint.toParent[3][2] = groundz;
....@@ -998,7 +999,7 @@
998999
9991000 lastsoundtime = CameraPane.framecount;
10001001
1001
- GraphreeD.hassound = true;
1002
+ GrafreeD.hassound = true;
10021003 }
10031004 // else
10041005 // System.out.println("skipped");
....@@ -1016,6 +1017,7 @@
10161017 // floor.z += posz;
10171018
10181019 // System.out.println("Allo " + sourcenode);
1020
+ // purple
10191021 CameraPane.debugpoint2.toParent[3][0] = floor.x;// + posx;
10201022 CameraPane.debugpoint2.toParent[3][1] = ground; // floor.y;// + sourcenode.parent.toParent[3][1];
10211023 CameraPane.debugpoint2.toParent[3][2] = floor.z;// + posz;
....@@ -1052,7 +1054,7 @@
10521054 v0.z = groundz - floor.z;
10531055
10541056 double distance = Math.sqrt(v0.dot(v0));
1055
- double maxdist = 0.004;
1057
+ double maxdist = 0.04;
10561058
10571059 if (distance > maxdist)
10581060 {
....@@ -1078,8 +1080,27 @@
10781080 sourcenode.toParent = LA.newMatrix();
10791081 sourcenode.fromParent = LA.newMatrix();
10801082 }
1083
+
1084
+ v0.x = v0.z = 0;
1085
+
1086
+ this.get(0).TransformToWorld(v0);
1087
+
1088
+ // cyan
1089
+ CameraPane.debugpoint3.toParent[3][0] = v0.x;
1090
+ CameraPane.debugpoint3.toParent[3][1] = ground;
1091
+ CameraPane.debugpoint3.toParent[3][2] = v0.z;
1092
+
10811093 LA.matConcat(sourcenode.toParent, transformnode.toParent, sourcenode.toParent);
10821094 LA.matInvert(sourcenode.toParent, sourcenode.fromParent);
1095
+
1096
+ v0.x = v0.z = 0;
1097
+
1098
+ this.get(0).TransformToWorld(v0);
1099
+
1100
+ // red
1101
+ CameraPane.debugpoint4.toParent[3][0] = v0.x;
1102
+ CameraPane.debugpoint4.toParent[3][1] = ground;
1103
+ CameraPane.debugpoint4.toParent[3][2] = v0.z;
10831104 }
10841105 }
10851106
....@@ -1835,7 +1856,7 @@
18351856 {
18361857 SetRotation(sourcenode, new cVector(floor), new cVector(centroid));
18371858 }
1838
-
1859
+
18391860 if (setposition)
18401861 {
18411862 if (floorobject != null)
MorphNode.java
....@@ -19,7 +19,7 @@
1919 {
2020 CreateMaterial();
2121 morphobject.get(0).bRep.SaveSupports();
22
- bRep = (BoundaryRep) GraphreeD.clone(morphobject.get(0).bRep);
22
+ bRep = (BoundaryRep) GrafreeD.clone(morphobject.get(0).bRep);
2323 morphobject.get(0).bRep.RestoreSupports();
2424 }
2525
....@@ -30,7 +30,7 @@
3030 duplicate.parent = null;
3131 Object3D sup = duplicate.support;
3232 duplicate.support = null;
33
- addChild((Object3D)GraphreeD.clone(duplicate));
33
+ addChild((Object3D)GrafreeD.clone(duplicate));
3434 duplicate.parent = par;
3535 duplicate.support = sup;
3636 }
....@@ -56,7 +56,7 @@
5656
5757 // if (bRep == null)
5858 // {
59
-// bRep = (BoundaryRep) GraphreeD.clone(morphobject.get(0).bRep);
59
+// bRep = (BoundaryRep) GrafreeD.clone(morphobject.get(0).bRep);
6060 // }
6161
6262 if (CameraPane.SUPPORT && display.drawMode == display.SHADOW)
....@@ -112,7 +112,7 @@
112112 super.deepCopySelf(other);
113113 MorphNode bp = (MorphNode)other;
114114
115
- bp.morphweights = (double[]) GraphreeD.clone(morphweights);
115
+ bp.morphweights = (double[]) GrafreeD.clone(morphweights);
116116 }
117117
118118 void createEditWindow(GroupEditor callee, boolean newWindow)
ObjEditor.java
....@@ -692,7 +692,7 @@
692692 protected static ImageIcon createImageIcon(String path,
693693 String description)
694694 {
695
- java.net.URL imgURL = GraphreeD.class.getResource(path);
695
+ java.net.URL imgURL = GrafreeD.class.getResource(path);
696696 if (imgURL != null)
697697 {
698698 return new ImageIcon(imgURL, description);
....@@ -1107,7 +1107,7 @@
11071107 //frontScroll.setLabel("------------------------------ XZ (front) ---------------------------------------------------");
11081108 //sideScroll.setLabel("------------------------------- YZ (side) ---------------------------------------------------");
11091109
1110
-// GridBagConstraints gbc = (GridBagConstraints) GraphreeD.clone(aConstraints);
1110
+// GridBagConstraints gbc = (GridBagConstraints) GrafreeD.clone(aConstraints);
11111111 Camera cam = GetCamera(copy, 0);
11121112
11131113 Composite cams = null;
....@@ -1334,7 +1334,7 @@
13341334 frame.getContentPane().add(/*"Center",*/framePanel);
13351335 //frame.getContentPane().add(/*"Center",*/ worldPane);
13361336
1337
-// aConstraints = gbc; // (GridBagConstraints) GraphreeD.clone(gbc);
1337
+// aConstraints = gbc; // (GridBagConstraints) GrafreeD.clone(gbc);
13381338
13391339 frame.setSize(1024, 768);
13401340 frame.show();
....@@ -2345,7 +2345,7 @@
23452345
23462346 void ImportJME(com.jmex.model.converters.FormatConverter converter, String ext, String dialogName)
23472347 {
2348
- if (GraphreeD.standAlone)
2348
+ if (GrafreeD.standAlone)
23492349 {
23502350 /**/
23512351 FileDialog browser = new FileDialog(frame, dialogName, FileDialog.LOAD);
....@@ -3183,8 +3183,8 @@
31833183
31843184 CameraPane.ANIMATION ^= true;
31853185
3186
- GraphreeD.wav.cursor = 0;
3187
- GraphreeD.wav.loop = 0;
3186
+ GrafreeD.wav.cursor = 0;
3187
+ GrafreeD.wav.loop = 0;
31883188 }
31893189 } else
31903190 {
....@@ -4085,7 +4085,7 @@
40854085
40864086 void load() // throws ClassNotFoundException
40874087 {
4088
- if (GraphreeD.standAlone)
4088
+ if (GrafreeD.standAlone)
40894089 {
40904090 FileDialog browser = new FileDialog(frame, "Load", FileDialog.LOAD);
40914091 browser.show();
....@@ -4190,7 +4190,7 @@
41904190
41914191 void saveAs()
41924192 {
4193
- if (GraphreeD.standAlone)
4193
+ if (GrafreeD.standAlone)
41944194 {
41954195 FileDialog browser = new FileDialog(frame, "Save As", FileDialog.SAVE);
41964196 browser.setVisible(true);
....@@ -4213,10 +4213,20 @@
42134213
42144214 Object3D object = copy.selection.get(0);
42154215
4216
+ FileObject fileobj = null;
4217
+
4218
+ if (object instanceof FileObject)
4219
+ fileobj = (FileObject)object;
4220
+
42164221 if (object.fileparent != null)
42174222 {
4218
- FileObject fileobj = (FileObject) object.fileparent;
4223
+ assert(fileobj == null);
42194224
4225
+ fileobj = (FileObject) object.fileparent;
4226
+ }
4227
+
4228
+ if (fileobj != null)
4229
+ {
42204230 System.out.println("WriteObject " + object + " : " + fileobj.name);
42214231 WriteObject(object, fileobj.name);
42224232 }
....@@ -4259,7 +4269,7 @@
42594269 }
42604270 }
42614271 else
4262
- //if (GraphreeD.standAlone)
4272
+ //if (GrafreeD.standAlone)
42634273 {
42644274 FileDialog browser = new FileDialog(frame, "Export", FileDialog.SAVE);
42654275 browser.setVisible(true);
....@@ -4291,7 +4301,7 @@
42914301 Object3D objectparent = obj.parent;
42924302 obj.parent = null;
42934303
4294
- Object3D object = (Object3D) GraphreeD.clone(obj);
4304
+ Object3D object = (Object3D) GrafreeD.clone(obj);
42954305
42964306 obj.parent = objectparent;
42974307
....@@ -4325,7 +4335,7 @@
43254335 buffer.append("background { color rgb <0.8,0.8,0.8> }\n\n");
43264336 cameraView.renderCamera.generatePOV(buffer, bnds.width, bnds.height);
43274337 copy.generatePOV(buffer);
4328
- if (GraphreeD.standAlone)
4338
+ if (GrafreeD.standAlone)
43294339 {
43304340 FileDialog browser = new FileDialog(frame, "Export POV", 1);
43314341 browser.show();
Object3D.java
....@@ -935,7 +935,7 @@
935935
936936 public Object clone()
937937 {
938
- return GraphreeD.clone(this);
938
+ return GrafreeD.clone(this);
939939 }
940940
941941 Object3D copyExpand()
....@@ -1701,7 +1701,7 @@
17011701 Object3D o = new Object3D((clone?"Ge:":"Li:") + this.name);
17021702 o.bRep = transientrep;
17031703 if (clone)
1704
- o.bRep = (BoundaryRep) GraphreeD.clone(transientrep);
1704
+ o.bRep = (BoundaryRep) GrafreeD.clone(transientrep);
17051705 o.CreateMaterial();
17061706 o.SetAttributes(this, -1);
17071707 //parent
....@@ -1714,7 +1714,7 @@
17141714 Object3D o = new Object3D((clone?"Ge:":"Li:") + this.name);
17151715 o.bRep = bRep;
17161716 if (clone)
1717
- o.bRep = (BoundaryRep) GraphreeD.clone(bRep);
1717
+ o.bRep = (BoundaryRep) GrafreeD.clone(bRep);
17181718 o.CreateMaterial();
17191719 //o.overwriteThis(this, -1);
17201720 o.SetAttributes(this, -1);
....@@ -1756,7 +1756,7 @@
17561756 // {
17571757 // assert(bRep == null);
17581758 // Object3D o = new Object3D("Geometry:" + this.name);
1759
-// o.bRep = (BoundaryRep) GraphreeD.clone(transientrep);
1759
+// o.bRep = (BoundaryRep) GrafreeD.clone(transientrep);
17601760 // o.CreateMaterial();
17611761 // parent.addChild(o);
17621762 // }
....@@ -1765,7 +1765,7 @@
17651765 // {
17661766 // assert(transientrep == null);
17671767 // Object3D o = new Object3D("Geometry:" + this.name);
1768
-// o.bRep = (BoundaryRep) GraphreeD.clone(bRep);
1768
+// o.bRep = (BoundaryRep) GrafreeD.clone(bRep);
17691769 // o.CreateMaterial();
17701770 // parent.addChild(o);
17711771 // }
....@@ -3153,7 +3153,7 @@
31533153
31543154 BoundaryRep sup = bRep.support;
31553155 bRep.support = null;
3156
- BoundaryRep temprep = (BoundaryRep) GraphreeD.clone(bRep);
3156
+ BoundaryRep temprep = (BoundaryRep) GrafreeD.clone(bRep);
31573157 // bRep.SplitInTwo(onlyone); // thread...
31583158 temprep.SplitInTwo(reduction34, onlyone);
31593159 bRep = temprep;
....@@ -3677,7 +3677,7 @@
36773677 if (child == null)
36783678 continue;
36793679
3680
- if (GraphreeD.RENDERME > 0)
3680
+ if (GrafreeD.RENDERME > 0)
36813681 {
36823682 if (child instanceof Merge)
36833683 ((Merge)child).renderme();
....@@ -3828,7 +3828,7 @@
38283828 if (child == null)
38293829 continue;
38303830
3831
- if (GraphreeD.RENDERME > 0)
3831
+ if (GrafreeD.RENDERME > 0)
38323832 {
38333833 if (child instanceof Merge)
38343834 ((Merge)child).renderme();
....@@ -4023,7 +4023,7 @@
40234023 if (child == null)
40244024 continue;
40254025
4026
- if (GraphreeD.RENDERME > 0)
4026
+ if (GrafreeD.RENDERME > 0)
40274027 {
40284028 if (child instanceof Merge)
40294029 ((Merge)child).renderme();
....@@ -5819,12 +5819,12 @@
58195819 if (!child.HasTransparency())
58205820 {
58215821 sel = root != null && root.selection != null && root.selection.indexOf(child) != -1;
5822
- // GraphreeD.tracein("draw ", child);
5822
+ // GrafreeD.tracein("draw ", child);
58235823 boolean wasblocked = blockdraw;
58245824 blockdraw = true;
58255825 child.draw(display, root, selected || sel, wasblocked || blocked); // || child.IsSelected());
58265826 blockdraw = false;
5827
- // GraphreeD.traceout("draw ", child);
5827
+ // GrafreeD.traceout("draw ", child);
58285828 }
58295829
58305830 release(i);
....@@ -8041,7 +8041,7 @@
80418041 {
80428042 assert(bRep != null);
80438043 if (!(support instanceof GenericJoint)) // support.bRep != null)
8044
- GraphreeD.Assert(support.bRep == bRep.support);
8044
+ GrafreeD.Assert(support.bRep == bRep.support);
80458045 }
80468046 else
80478047 {
RandomNode.java
....@@ -95,7 +95,7 @@
9595
9696 //(int)(Math.random()*super.size());
9797 //globalcount++;
98
- gcount += GraphreeD.mix3(rnd+12345,firstchoice*12345,gcount);
98
+ gcount += GrafreeD.mix3(rnd+12345,firstchoice*12345,gcount);
9999
100100 gcount &= 0x7fffffff;
101101
SwitchNode.java
....@@ -20,7 +20,7 @@
2020 {
2121 CreateMaterial();
2222 switchobject.get(0).bRep.SaveSupports();
23
- bRep = (BoundaryRep) GraphreeD.clone(switchobject.get(0).bRep);
23
+ bRep = (BoundaryRep) GrafreeD.clone(switchobject.get(0).bRep);
2424 switchobject.get(0).bRep.RestoreSupports();
2525 }
2626
....@@ -30,7 +30,7 @@
3030 Object3D par = duplicate.parent;
3131 duplicate.parent = null;
3232 duplicate.SaveSupports();
33
- addChild((Object3D)GraphreeD.clone(duplicate));
33
+ addChild((Object3D)GrafreeD.clone(duplicate));
3434 duplicate.parent = par;
3535 duplicate.RestoreSupports();
3636 }
....@@ -97,7 +97,7 @@
9797
9898 if (bRep == null)
9999 {
100
- bRep = (BoundaryRep) GraphreeD.clone(switchobject.get(0).bRep);
100
+ bRep = (BoundaryRep) GrafreeD.clone(switchobject.get(0).bRep);
101101 }
102102
103103 if (CameraPane.SUPPORT && display.drawMode == display.SHADOW)
Texture.java
....@@ -10,8 +10,8 @@
1010 public class Texture extends Composite implements java.io.Serializable
1111 {
1212 // deprecated due to serial problems
13
- static final long serialVersionUID = -5280151442948961597L; // new java
14
- // 7695543694999681408L; // old java !!!
13
+ static final long serialVersionUID = // -5280151442948961597L; // new java
14
+ 7695543694999681408L; // old java !!!
1515
1616 // default = -8076744133104150348L
1717
Vertex.java
....@@ -132,9 +132,9 @@
132132
133133 return Math.abs(/*pos.*/x - vert./*pos.*/x) +
134134 Math.abs(/*pos.*/y - vert./*pos.*/y) +
135
- Math.abs(/*pos.*/z - vert./*pos.*/z) < 0.00001 && // GraphreeD.epsvertex2 && // WARNING: USE 0.0001 for serial issues
136
- (GraphreeD.linkUV || Math.abs(s - vert.s) + Math.abs(t - vert.t) < 0.00001)
137
- ; // GraphreeD.epsvertex2;
135
+ Math.abs(/*pos.*/z - vert./*pos.*/z) < 0.00001 && // GrafreeD.epsvertex2 && // WARNING: USE 0.0001 for serial issues
136
+ (GrafreeD.linkUV || Math.abs(s - vert.s) + Math.abs(t - vert.t) < 0.00001)
137
+ ; // GrafreeD.epsvertex2;
138138 }
139139 /*
140140 public boolean isSame(Object o)
cMaterial.java
....@@ -144,7 +144,7 @@
144144
145145 cColor.HSBtoRGB(display.color, display.saturation, 1, display.modelParams0);
146146
147
- float[] colorV = GraphreeD.colorV;
147
+ float[] colorV = GrafreeD.colorV;
148148
149149 /**/
150150 if (display.drawMode == display.DEFAULT) // && display.RENDERPROGRAM == 0)
cMesh.java
....@@ -402,8 +402,8 @@
402402 if (ref == null)
403403 return;
404404
405
- GraphreeD.epsequal = IsEpsEqual();
406
- GraphreeD.linkUV = IsLinkUV();
405
+ GrafreeD.epsequal = IsEpsEqual();
406
+ GrafreeD.linkUV = IsLinkUV();
407407
408408 // BoundaryRep oldrep = transientrep;
409409
....@@ -417,7 +417,7 @@
417417 Object3D obj = ref.GetObject();
418418
419419 // may 2014: side-effect with UVs!!
420
- obj = (Object3D) GraphreeD.clone(obj);
420
+ obj = (Object3D) GrafreeD.clone(obj);
421421
422422 merge(obj);
423423
....@@ -427,7 +427,7 @@
427427 bRep.Trim(false, false,false,false,false);
428428 System.out.println("------> TRIM " + ref + "; #vertices = " + bRep.VertexCount() + "; #faces = " + bRep.FaceCount());
429429
430
- GraphreeD.epsequal = false;
430
+ GrafreeD.epsequal = false;
431431
432432 if (transientrep != null && bRep.VertexCount() == transientrep.VertexCount())
433433 {
....@@ -468,7 +468,7 @@
468468 }
469469 else
470470 // geometry is merged...
471
- refcopy = (BoundaryRep) GraphreeD.clone(transientrep);
471
+ refcopy = (BoundaryRep) GrafreeD.clone(transientrep);
472472 }
473473
474474 transient cVector minima = new cVector();
cRadio.java
....@@ -32,7 +32,7 @@
3232 if (link)
3333 camera = c;
3434 else
35
- camera = (Camera)GraphreeD.clone(c);
35
+ camera = (Camera)GrafreeD.clone(c);
3636 }
3737
3838 Object3D object;
cVector.java
....@@ -266,7 +266,7 @@
266266 long ly = Double.doubleToRawLongBits(y);
267267 long lz = Double.doubleToRawLongBits(z);
268268
269
- if (GraphreeD.epsequal)
269
+ if (GrafreeD.epsequal)
270270 {
271271 return 0;
272272 } else