BoundaryRep.java
.. .. @@ -172,16 +172,16 @@ 172 172 bufV = other.bufV; 173 173 bufF = other.bufF; 174 174 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);180 180 181 - indices = (int[]) GraphreeD.clone(other.indices);181 + indices = (int[]) GrafreeD.clone(other.indices);182 182 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);185 185 } 186 186 else 187 187 { .. .. @@ -1492,7 +1492,7 @@ 1492 1492 InitFaceIndices(); 1493 1493 } 1494 1494 1495 - BoundaryRep rep = (BoundaryRep) GraphreeD.clone(this);1495 + BoundaryRep rep = (BoundaryRep) GrafreeD.clone(this);1496 1496 //float[] v = new float[100]; 1497 1497 1498 1498 for (int loops=1; --loops>=0;) .. .. @@ -1522,7 +1522,7 @@ 1522 1522 InitFaceIndices(); 1523 1523 } 1524 1524 1525 - BoundaryRep rep = (BoundaryRep) GraphreeD.clone(this);1525 + BoundaryRep rep = (BoundaryRep) GrafreeD.clone(this);1526 1526 //float[] v = new float[100]; 1527 1527 1528 1528 for (int loops=10; --loops>=0;) .. .. @@ -2600,7 +2600,7 @@ 2600 2600 // if (stepout && !playedonce) 2601 2601 // { 2602 2602 // // sound 2603 -// GraphreeD.wav.play();2603 +// GrafreeD.wav.play();2604 2604 // playedonce = true; 2605 2605 // } 2606 2606 // .. .. @@ -2644,7 +2644,7 @@ 2644 2644 2645 2645 if (CameraPane.framecount - lastsoundtime > 30) // 0.25 secs 2646 2646 { 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);2648 2648 2649 2649 lastsoundtime = CameraPane.framecount; 2650 2650 } .. .. @@ -3229,7 +3229,7 @@ 3229 3229 k /= x*x + y*y; 3230 3230 } 3231 3231 else 3232 - GraphreeD.Assert(z == 1);3232 + GrafreeD.Assert(z == 1);3233 3233 3234 3234 if (k < 0) 3235 3235 k = 0; .. .. @@ -7391,7 +7391,7 @@ 7391 7391 Trim(); 7392 7392 Untrim(); 7393 7393 7394 - BoundaryRep tmp = new BoundaryRep(); // (BoundaryRep) GraphreeD.clone(this);7394 + BoundaryRep tmp = new BoundaryRep(); // (BoundaryRep) GrafreeD.clone(this);7395 7395 7396 7396 double minx = Float.POSITIVE_INFINITY; 7397 7397 double maxx = Float.NEGATIVE_INFINITY; .. .. @@ -8067,7 +8067,7 @@ 8067 8067 if (!trimmed) 8068 8068 return; 8069 8069 8070 - GraphreeD.linkUV = false;8070 + GrafreeD.linkUV = false;8071 8071 8072 8072 try 8073 8073 { CameraPane.java
.. .. @@ -228,7 +228,7 @@ 228 228 void PushMatrix(double[][] matrix, int count) 229 229 { 230 230 matrixdepth++; 231 - // GraphreeD.tracein(matrix);231 + // GrafreeD.tracein(matrix);232 232 if (matrix == null) 233 233 return; // Identity 234 234 .. .. @@ -253,13 +253,13 @@ 253 253 254 254 void PushMatrix(double[][] matrix) 255 255 { 256 - // GraphreeD.tracein(matrix);256 + // GrafreeD.tracein(matrix);257 257 PushMatrix(matrix,1); 258 258 } 259 259 260 260 void PushMatrix() 261 261 { 262 - // GraphreeD.tracein(null);262 + // GrafreeD.tracein(null);263 263 if (matrixdepth++ < MAXSTACK - 1) 264 264 { 265 265 currentGL.glPushMatrix(); .. .. @@ -274,7 +274,7 @@ 274 274 { 275 275 --matrixdepth; 276 276 277 - // GraphreeD.traceout(inverse);277 + // GrafreeD.traceout(inverse);278 278 if (inverse == null) 279 279 return; // Identity 280 280 .. .. @@ -292,7 +292,7 @@ 292 292 293 293 void PopMatrix() 294 294 { 295 - // GraphreeD.traceout(null);295 + // GrafreeD.traceout(null);296 296 // inverse == null?? 297 297 if (--matrixdepth < MAXSTACK - 1) 298 298 { .. .. @@ -491,7 +491,7 @@ 491 491 System.err.println("LIVE = " + isLIVE()); 492 492 493 493 if (!isLIVE()) // save sound 494 - GraphreeD.savesound = true; // wav.save();494 + GrafreeD.savesound = true; // wav.save();495 495 // else 496 496 repaint(); // start loop // may 2013 497 497 } .. .. @@ -6333,7 +6333,7 @@ 6333 6333 { 6334 6334 bumpdepth--; 6335 6335 6336 - // GraphreeD.trace("POP " + tex + "(" + pigmentdepth + ")" + " : " + pigmentstack[pigmentdepth] + " vs " + texture);6336 + // GrafreeD.trace("POP " + tex + "(" + pigmentdepth + ")" + " : " + pigmentstack[pigmentdepth] + " vs " + texture);6337 6337 if (bumpstack[bumpdepth] != (texture!=null?texture.texture:null)) 6338 6338 { 6339 6339 // assert (bumpstack[bumpdepth] == texture); .. .. @@ -6363,7 +6363,7 @@ 6363 6363 { 6364 6364 pigmentdepth--; 6365 6365 6366 - // GraphreeD.trace("POP " + tex + "(" + pigmentdepth + ")" + " : " + pigmentstack[pigmentdepth] + " vs " + texture);6366 + // GrafreeD.trace("POP " + tex + "(" + pigmentdepth + ")" + " : " + pigmentstack[pigmentdepth] + " vs " + texture);6367 6367 if (pigmentstack[pigmentdepth] != (texture!=null?texture.texture:null)) 6368 6368 { 6369 6369 // assert (pigmentstack[pigmentdepth] == texture); .. .. @@ -6694,12 +6694,12 @@ 6694 6694 6695 6695 if (bump) 6696 6696 { 6697 - // GraphreeD.trace("PUSH BUMP " + tex + "(" + bumpdepth + ")" + " : " + texture);6697 + // GrafreeD.trace("PUSH BUMP " + tex + "(" + bumpdepth + ")" + " : " + texture);6698 6698 bumpstack[bumpdepth++] = texture!=null?texture.texture:null; 6699 6699 } 6700 6700 else 6701 6701 { 6702 - // GraphreeD.trace("PUSH PIGMENT " + tex + "(" + pigmentdepth + ")" + " : " + texture);6702 + // GrafreeD.trace("PUSH PIGMENT " + tex + "(" + pigmentdepth + ")" + " : " + texture);6703 6703 pigmentstack[pigmentdepth++] = texture!=null?texture.texture:null; 6704 6704 } 6705 6705 .. .. @@ -7628,14 +7628,14 @@ 7628 7628 7629 7629 //System.out.println("start frame"); 7630 7630 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)7632 7632 { 7633 7633 framecount++; 7634 7634 7635 7635 if (CameraPane.tickcount > 0) 7636 7636 CameraPane.tickcount--; 7637 7637 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)7639 7639 // restartframe = true; 7640 7640 if (options1[2] > 100 && (jitter%2==0)) 7641 7641 { .. .. @@ -7923,7 +7923,7 @@ 7923 7923 7924 7924 if (!BOXMODE) 7925 7925 { 7926 - System.out.println("image: " + fullname + " (" + (GraphreeD.wav.cursor / 735 / 4) + ")");7926 + System.out.println("image: " + fullname + " (" + (GrafreeD.wav.cursor / 735 / 4) + ")");7927 7927 } 7928 7928 7929 7929 if (!BOXMODE) .. .. @@ -7951,7 +7951,7 @@ 7951 7951 { 7952 7952 if (ACSIZE > 1) 7953 7953 { 7954 - // System.err.println("image #" + (GraphreeD.wav.cursor / 735 / 4));7954 + // System.err.println("image #" + (GrafreeD.wav.cursor / 735 / 4));7955 7955 } 7956 7956 } 7957 7957 .. .. @@ -7961,7 +7961,7 @@ 7961 7961 ABORTED = false; 7962 7962 } 7963 7963 else 7964 - GraphreeD.wav.cursor += 735 * ACSIZE;7964 + GrafreeD.wav.cursor += 735 * ACSIZE;7965 7965 7966 7966 if (false) 7967 7967 { .. .. @@ -8631,11 +8631,11 @@ 8631 8631 8632 8632 public void display(GLAutoDrawable drawable) 8633 8633 { 8634 - if (GraphreeD.savesound && GraphreeD.hassound)8634 + if (GrafreeD.savesound && GrafreeD.hassound)8635 8635 { 8636 - GraphreeD.wav.save();8637 - GraphreeD.savesound = false;8638 - GraphreeD.hassound = false;8636 + GrafreeD.wav.save();8637 + GrafreeD.savesound = false;8638 + GrafreeD.hassound = false;8639 8639 } 8640 8640 // if (DEBUG_SELECTION) 8641 8641 // { .. .. @@ -8765,7 +8765,7 @@ 8765 8765 Object3D theobject = object; 8766 8766 Object3D theparent = object.parent; 8767 8767 object.parent = null; 8768 - object = (Object3D)GraphreeD.clone(object);8768 + object = (Object3D)GrafreeD.clone(object);8769 8769 object.Stripify(); 8770 8770 if (theobject.selection == null || theobject.selection.Size() == 0) 8771 8771 theobject.PreprocessOcclusion(this); .. .. @@ -9660,8 +9660,8 @@ 9660 9660 e.printStackTrace(); 9661 9661 } 9662 9662 9663 - if (GraphreeD.RENDERME > 0)9664 - GraphreeD.RENDERME--; // mechante magouille9663 + if (GrafreeD.RENDERME > 0)9664 + GrafreeD.RENDERME--; // mechante magouille9665 9665 9666 9666 ONESTEP = false; 9667 9667 } .. .. @@ -9734,7 +9734,7 @@ 9734 9734 BindTextures(DEFAULT_TEXTURES, 2); 9735 9735 } 9736 9736 //System.out.println("--> " + stackdepth); 9737 -// GraphreeD.traceon();9737 +// GrafreeD.traceon();9738 9738 9739 9739 // DRAW 9740 9740 object.draw(this, /*(Composite)*/ object, false, false); .. .. @@ -9765,17 +9765,31 @@ 9765 9765 debugpoint2.material.color = 0.75f; 9766 9766 debugpoint2.material.modulation = 0.75f; 9767 9767 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 +9768 9780 InitPoints(radius); 9769 9781 } 9770 9782 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);9774 9788 } 9775 9789 9776 9790 // debugstuff.draw(this, /*(Composite)*/ null, false); 9777 9791 } 9778 -// GraphreeD.traceoff();9792 +// GrafreeD.traceoff();9779 9793 //System.out.println(stackdepth); 9780 9794 if (drawMode == 0) 9781 9795 { .. .. @@ -11092,10 +11106,17 @@ 11092 11106 "MOV final.z, zero.x;" + 11093 11107 "MOV final.a, one.w;":"" 11094 11108 ) + 11109 + /*11095 11110 (NORMALdebug?"MOV final.x, normal.x;" + 11096 11111 "MOV final.y, normal.y;" + 11097 11112 "MOV final.z, normal.z;" + 11098 11113 "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;":""11099 11120 ) + 11100 11121 // "MOV final, bumpmap;" + 11101 11122 "MOV result.color, final;" + .. .. @@ -14700,16 +14721,16 @@ 14700 14721 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])); 14701 14722 } 14702 14723 14703 - previousselectedpoint = (Sphere) GraphreeD.clone(selectedpoint);14724 + previousselectedpoint = (Sphere) GrafreeD.clone(selectedpoint);14704 14725 } 14705 14726 } 14706 14727 14707 14728 if (!movingcamera && !PAINTMODE) 14708 14729 object.editWindow.ScreenFitPoint(); // fev 2014 14709 14730 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)14711 14732 { 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);14713 14734 14714 14735 Object3D group = new Object3D("inst" + paintcount++); 14715 14736 .. .. @@ -15283,6 +15304,8 @@ 15283 15304 static Sphere previousselectedpoint = null; 15284 15305 static Sphere debugpoint = new Sphere(); 15285 15306 static Sphere debugpoint2 = new Sphere(); 15307 + static Sphere debugpoint3 = new Sphere();15308 + static Sphere debugpoint4 = new Sphere();15286 15309 15287 15310 static Sphere debugpoints[] = new Sphere[8]; 15288 15311 GenericJoint.java
.. .. @@ -379,7 +379,7 @@ 379 379 try 380 380 { 381 381 //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"));383 383 } catch (java.io.IOException e) 384 384 { 385 385 e.printStackTrace(); GraphreeD.javasimilarity index 96%rename from GraphreeD.javarename to GrafreeD.java
.. .. @@ -13,7 +13,7 @@ 13 13 import javax.sound.sampled.*; 14 14 15 15 //import com.jamonapi.*; 16 -public class GraphreeD extends Applet implements ActionListener16 +public class GrafreeD extends Applet implements ActionListener17 17 { 18 18 static int RENDERME = 0; 19 19 .. .. @@ -25,7 +25,7 @@ 25 25 static boolean hassound = false; 26 26 static boolean savesound = false; 27 27 28 - public GraphreeD()28 + public GrafreeD()29 29 { 30 30 javax.swing.Timer timer = new javax.swing.Timer(1000, this); 31 31 .. .. @@ -44,7 +44,7 @@ 44 44 45 45 public void init() 46 46 { 47 - add(openEditorButton = new Button("GraphreeD"));47 + add(openEditorButton = new Button("GrafreeD"));48 48 //Composite god = new Composite(); 49 49 universe = new Composite(); 50 50 universe.material = new cMaterial(); .. .. @@ -595,6 +595,39 @@ 595 595 596 596 public static void main(String argv[]) 597 597 { 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/lib615 +616 + String command = "" + javaPath + " -Xmx1024m -Djava.library.path=" + jarpath + "lib -jar " + jarfile + " dummyarg";617 +618 + try619 + {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 +598 631 // InitDictionary(); 599 632 600 633 // Spell("is over".toUpperCase()); .. .. @@ -717,7 +750,7 @@ 717 750 718 751 //Monitor mon=MonitorFactory.start("myFirstMonitor"); 719 752 standAlone = true; 720 - theApplet3D = new GraphreeD();753 + theApplet3D = new GrafreeD();721 754 theApplet3D.universe = new Composite(); 722 755 theApplet3D.universe.name = "Scene"; 723 756 theApplet3D.universe.material = new cMaterial(); .. .. @@ -951,7 +984,7 @@ 951 984 } while (avail > 0 && numRead >= 0); 952 985 return new String(data, 0, pos, "US-ASCII"); 953 986 } 954 - public static GraphreeD theApplet3D;987 + public static GrafreeD theApplet3D;955 988 public static boolean standAlone = true; 956 989 public Composite universe; 957 990 public static Object3D clipboard = new Object3D(); GroupEditor.java
.. .. @@ -83,7 +83,7 @@ 83 83 84 84 void CloneSelection(boolean supports) 85 85 { 86 - // Object3D keep = GraphreeD.clipboard;86 + // Object3D keep = GrafreeD.clipboard;87 87 //Object3D obj; 88 88 for (int i=0; i<group.selection.size(); i++)// Enumeration e = group.selection.elements(); e.hasMoreElements();) 89 89 { .. .. @@ -97,14 +97,14 @@ 97 97 98 98 void CloneClipboard(boolean supports) 99 99 { 100 - assert(GraphreeD.clipboard.parent == null);101 - Object3D /*Composite*/ keepparent = GraphreeD.clipboard.get(0).parent;102 - GraphreeD.clipboard.get(0).parent = null; // Avoid copy?103 - if (LA.isIdentity(GraphreeD.clipboard.toParent))104 - makeSomething(CloneObject(GraphreeD.clipboard.get(0), false));100 + assert(GrafreeD.clipboard.parent == null);101 + Object3D /*Composite*/ keepparent = GrafreeD.clipboard.get(0).parent;102 + GrafreeD.clipboard.get(0).parent = null; // Avoid copy?103 + if (LA.isIdentity(GrafreeD.clipboard.toParent))104 + makeSomething(CloneObject(GrafreeD.clipboard.get(0), false));105 105 else 106 - makeSomething(CloneObject(GraphreeD.clipboard, false));107 - GraphreeD.clipboard.get(0).parent = keepparent;106 + makeSomething(CloneObject(GrafreeD.clipboard, false));107 + GrafreeD.clipboard.get(0).parent = keepparent;108 108 } 109 109 110 110 static Object3D CloneObject(Object3D obj, boolean supports) .. .. @@ -118,7 +118,7 @@ 118 118 // obj.support = null; 119 119 if (!supports) 120 120 obj.SaveSupports(); 121 - Object3D clone = (Object3D)GraphreeD.clone(obj);121 + Object3D clone = (Object3D)GrafreeD.clone(obj);122 122 obj.parent = parent; 123 123 // obj.support = support; 124 124 // clone.support = support; // aout 2013 .. .. @@ -225,10 +225,10 @@ 225 225 oe.menuBar.add(menu = new Menu("Group")); 226 226 grabItem = menu.add(new MenuItem("Grab")); 227 227 grabItem.addActionListener(this); 228 - frontItem = menu.add(new MenuItem("Front"));229 - frontItem.addActionListener(this);230 228 backItem = menu.add(new MenuItem("Back")); 231 229 backItem.addActionListener(this); 230 + frontItem = menu.add(new MenuItem("Front"));231 + frontItem.addActionListener(this);232 232 compositeItem = menu.add(new MenuItem("Composite")); 233 233 compositeItem.addActionListener(this); 234 234 menu.add("-"); .. .. @@ -380,7 +380,7 @@ 380 380 381 381 382 382 oe.menuBar.add(menu = new Menu("Include")); 383 - importGFDItem = menu.add(new MenuItem("GraphreeD Object..."));383 + importGFDItem = menu.add(new MenuItem("GrafreeD Object..."));384 384 importGFDItem.addActionListener(this); 385 385 importVRMLX3DItem = menu.add(new MenuItem("VRML/X3D Object...")); 386 386 importVRMLX3DItem.addActionListener(this); .. .. @@ -1441,9 +1441,9 @@ 1441 1441 1442 1442 void Overwrite(int mask) 1443 1443 { 1444 - if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)1444 + if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)1445 1445 { 1446 - Object3D content = GraphreeD.clipboard.get(0);1446 + Object3D content = GrafreeD.clipboard.get(0);1447 1447 1448 1448 if (content instanceof cGroup && ((cGroup)content).transientlink ) 1449 1449 content = ((cGroup)content).get(0); .. .. @@ -1778,7 +1778,7 @@ 1778 1778 if (event.getSource() == invariantsItem) 1779 1779 { 1780 1780 System.out.println("Invariants:"); 1781 - GraphreeD.theApplet3D.universe.invariants();1781 + GrafreeD.theApplet3D.universe.invariants();1782 1782 } else 1783 1783 if (event.getSource() == memoryItem) 1784 1784 { .. .. @@ -1848,10 +1848,10 @@ 1848 1848 } else 1849 1849 if (event.getSource() == duplicateItem) 1850 1850 { 1851 - Object3D keep = GraphreeD.clipboard;1851 + Object3D keep = GrafreeD.clipboard;1852 1852 loadClipboard(false); 1853 1853 paste(false); 1854 - GraphreeD.clipboard = keep;1854 + GrafreeD.clipboard = keep;1855 1855 } else 1856 1856 if (event.getSource() == cloneItem) 1857 1857 { .. .. @@ -1895,8 +1895,9 @@ 1895 1895 } else 1896 1896 if (event.getSource() == overwriteMatItem) 1897 1897 { 1898 + /* july 20151898 1899 if ((dropAttributes & Object3D.TEXTURE) == 0) 1899 - Overwrite(Object3D.MATERIAL);1900 + Overwrite(Object3D.MATERIAL | Object3D.COLOR);1900 1901 else 1901 1902 { 1902 1903 if ((dropAttributes & Object3D.COLOR) == 0 && (dropAttributes & Object3D.MATERIAL) == 0) .. .. @@ -1908,13 +1909,16 @@ 1908 1909 Overwrite(Object3D.MATERIAL | Object3D.TEXTURE); 1909 1910 } 1910 1911 } 1912 + */1913 +1914 + Overwrite(dropAttributes);1911 1915 } 1912 1916 if (event.getSource() == overwriteGeoItem) 1913 1917 { 1914 1918 Overwrite(Object3D.GEOMETRY); 1915 -// if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)1919 +// if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)1916 1920 // { 1917 -// Object3D content = GraphreeD.clipboard.get(0);1921 +// Object3D content = GrafreeD.clipboard.get(0);1918 1922 // 1919 1923 // if (content instanceof cGroup && ((cGroup)content).transientlink ) 1920 1924 // content = ((cGroup)content).get(0); .. .. @@ -2047,9 +2051,9 @@ 2047 2051 } else 2048 2052 if (event.getSource() == linkverticesItem) 2049 2053 { 2050 -// if (group.selection.size() == 1 && GraphreeD.clipboard.size() == 1)2054 +// if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)2051 2055 // { 2052 -// Object3D content = GraphreeD.clipboard.get(0);2056 +// Object3D content = GrafreeD.clipboard.get(0);2053 2057 // 2054 2058 // if (content instanceof cGroup && ((cGroup)content).transientlink ) 2055 2059 // content = ((cGroup)content).get(0); .. .. @@ -2058,9 +2062,9 @@ 2058 2062 // group.selection.get(0).setMasterThis(content); // should be identity 2059 2063 // refreshContents(); 2060 2064 // } 2061 - if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)2065 + if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)2062 2066 { 2063 - Object3D content = GraphreeD.clipboard.get(0);2067 + Object3D content = GrafreeD.clipboard.get(0);2064 2068 2065 2069 if (content instanceof cGroup && ((cGroup)content).transientlink ) 2066 2070 content = ((cGroup)content).get(0); .. .. @@ -2101,9 +2105,9 @@ 2101 2105 } else 2102 2106 if (event.getSource() == setMasterItem) 2103 2107 { 2104 - if (group.selection.size() == 1 && GraphreeD.clipboard.size() == 1)2108 + if (group.selection.size() == 1 && GrafreeD.clipboard.size() == 1)2105 2109 { 2106 - Object3D content = GraphreeD.clipboard.get(0);2110 + Object3D content = GrafreeD.clipboard.get(0);2107 2111 2108 2112 if (content instanceof cGroup && ((cGroup)content).transientlink ) 2109 2113 content = ((cGroup)content).get(0); .. .. @@ -2116,9 +2120,9 @@ 2116 2120 { 2117 2121 if (group.selection.size() == 1) 2118 2122 { 2119 - if (GraphreeD.clipboard.size() == 1)2123 + if (GrafreeD.clipboard.size() == 1)2120 2124 { 2121 - Object3D content = GraphreeD.clipboard.get(0);2125 + Object3D content = GrafreeD.clipboard.get(0);2122 2126 2123 2127 if (content instanceof cGroup && ((cGroup)content).transientlink ) 2124 2128 content = ((cGroup)content).get(0); .. .. @@ -2806,7 +2810,7 @@ 2806 2810 if (event.getSource() == unselectButton) 2807 2811 { 2808 2812 objEditor.jTree.clearSelection(); 2809 - // ?? oct 2012 GraphreeD.clipboard.clear();2813 + // ?? oct 2012 GrafreeD.clipboard.clear();2810 2814 objEditor.ResetSliders(); 2811 2815 refreshContents(true); 2812 2816 } else .. .. @@ -3121,9 +3125,9 @@ 3121 3125 obj = (Object3D)e.nextElement(); 3122 3126 3123 3127 System.out.println("Object is: " + obj); 3124 - GraphreeD.AnalyzeObject(obj);3128 + GrafreeD.AnalyzeObject(obj);3125 3129 System.out.println("Boundary rep: " + obj.bRep); 3126 - GraphreeD.AnalyzeObject(obj.bRep);3130 + GrafreeD.AnalyzeObject(obj.bRep);3127 3131 3128 3132 // System.err.println((size/1024) + " KB is the size of " + obj); 3129 3133 } .. .. @@ -3250,7 +3254,7 @@ 3250 3254 // LA.matTranslate(g.toParent, temp.x, temp.y, temp.z); 3251 3255 // LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z); 3252 3256 // 3253 -// g.add(GraphreeD.clipboard);3257 +// g.add(GrafreeD.clipboard);3254 3258 // 3255 3259 // buffer.add(g); 3256 3260 // } .. .. @@ -3269,8 +3273,8 @@ 3269 3273 // nodes = new Object3D(); 3270 3274 // vertices = new Vector<Vertex>(); 3271 3275 // 3272 -// boolean epsequal = GraphreeD.epsequal;3273 -// GraphreeD.epsequal = true;3276 +// boolean epsequal = GrafreeD.epsequal;3277 +// GrafreeD.epsequal = true;3274 3278 // 3275 3279 // for (int i=0; i<group.selection.size(); i++) 3276 3280 // { .. .. @@ -3311,7 +3315,7 @@ 3311 3315 // LA.matTranslate(g.toParent, temp.x, temp.y, temp.z); 3312 3316 // LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z); 3313 3317 // 3314 -// g.add(GraphreeD.clipboard);3318 +// g.add(GrafreeD.clipboard);3315 3319 // 3316 3320 // buffer.add(g); 3317 3321 // } .. .. @@ -3319,7 +3323,7 @@ 3319 3323 // makeSomething(buffer, i==group.selection.size()-1); 3320 3324 // } 3321 3325 // 3322 -// GraphreeD.epsequal = epsequal;3326 +// GrafreeD.epsequal = epsequal;3323 3327 // 3324 3328 // //buffer = null; 3325 3329 // temprep = null; .. .. @@ -3330,8 +3334,8 @@ 3330 3334 3331 3335 void ParseVertices() 3332 3336 { 3333 - boolean epsequal = GraphreeD.epsequal;3334 - GraphreeD.epsequal = true;3337 + boolean epsequal = GrafreeD.epsequal;3338 + GrafreeD.epsequal = true;3335 3339 3336 3340 for (int i=0; i<group.selection.size(); i++) 3337 3341 { .. .. @@ -3356,7 +3360,7 @@ 3356 3360 LA.matTranslate(g.toParent, temp.x, temp.y, temp.z); 3357 3361 LA.matTranslate(g.fromParent, -temp.x, -temp.y, -temp.z); 3358 3362 3359 - g.add(GraphreeD.clipboard);3363 + g.add(GrafreeD.clipboard);3360 3364 3361 3365 buffer.add(g); 3362 3366 } .. .. @@ -3371,7 +3375,7 @@ 3371 3375 makeSomething(buffer, i==group.selection.size()-1); 3372 3376 } 3373 3377 3374 - GraphreeD.epsequal = epsequal;3378 + GrafreeD.epsequal = epsequal;3375 3379 3376 3380 refreshContents(); 3377 3381 } .. .. @@ -3416,7 +3420,7 @@ 3416 3420 scale /= 3; 3417 3421 3418 3422 scale /= 0xFF; 3419 - scale /= 4;3423 + // c'est quoi ca? scale /= 4;3420 3424 3421 3425 //v.AO = scale; 3422 3426 .. .. @@ -3455,7 +3459,7 @@ 3455 3459 // ref.SaveSupports(); 3456 3460 // Object3D par = ref.parent; 3457 3461 // ref.parent = null; 3458 -// Object3D lowres = (Object3D) GraphreeD.clone(ref);3462 +// Object3D lowres = (Object3D) GrafreeD.clone(ref);3459 3463 // ref.parent = par; 3460 3464 // ref.RestoreSupports(); 3461 3465 .. .. @@ -3485,7 +3489,7 @@ 3485 3489 // lowres.SaveSupports(); 3486 3490 // par = lowres.parent; 3487 3491 // lowres.parent = null; 3488 -// Object3D newlow = (Object3D) GraphreeD.clone(lowres);3492 +// Object3D newlow = (Object3D) GrafreeD.clone(lowres);3489 3493 Object3D newlow = CloneObject(lowres, false); 3490 3494 newlow.name = sn.switchobject.get(i).name; 3491 3495 System.out.println(" pose#" + i + " = " + newlow); .. .. @@ -3507,7 +3511,7 @@ 3507 3511 return; 3508 3512 3509 3513 Object3D poses = group.selection.get(0); 3510 - Object3D ref = GraphreeD.clipboard.get(0);3514 + Object3D ref = GrafreeD.clipboard.get(0);3511 3515 3512 3516 Object3D newgroup = new Object3D("Po:" + poses.name); 3513 3517 .. .. @@ -3701,20 +3705,20 @@ 3701 3705 3702 3706 void ClipMesh() 3703 3707 { 3704 - if (/*group.selection.size() == 1 &&*/ GraphreeD.clipboard.size() == 1)3708 + if (/*group.selection.size() == 1 &&*/ GrafreeD.clipboard.size() == 1)3705 3709 { 3706 - Object3D content = GraphreeD.clipboard.get(0);3710 + Object3D content = GrafreeD.clipboard.get(0);3707 3711 3708 3712 if (content instanceof cGroup && ((cGroup)content).transientlink ) 3709 3713 content = ((cGroup)content).get(0); 3710 3714 3711 3715 // for (int i=0; i<group.selection.size(); i++) 3712 3716 // { 3713 -// group.selection.get(i).ClipMesh(GraphreeD.clipboard);3717 +// group.selection.get(i).ClipMesh(GrafreeD.clipboard);3714 3718 // } 3715 - group.selection.ClipMesh(GraphreeD.clipboard);3719 + group.selection.ClipMesh(GrafreeD.clipboard);3716 3720 } 3717 -// group.selection.ClipMesh(GraphreeD.clipboard);3721 +// group.selection.ClipMesh(GrafreeD.clipboard);3718 3722 System.out.println("DONE."); 3719 3723 refreshContents(); 3720 3724 } .. .. @@ -4052,12 +4056,12 @@ 4052 4056 { 4053 4057 if (group.selection.isEmpty()) 4054 4058 return; 4055 - GraphreeD.clipboardIsTempGroup = false;4059 + GrafreeD.clipboardIsTempGroup = false;4056 4060 Composite tGroup = null; 4057 4061 if (group.selection.size() > 0) // 1) 4058 4062 { 4059 4063 tGroup = new cGroup(); 4060 - GraphreeD.clipboardIsTempGroup = true;4064 + GrafreeD.clipboardIsTempGroup = true;4061 4065 } 4062 4066 4063 4067 if (cut) .. .. @@ -4097,16 +4101,16 @@ 4097 4101 //System.out.println("cut " + child); 4098 4102 //System.out.println("parent = " + child.parent); 4099 4103 // tmp.addChild(child); 4100 - if (GraphreeD.clipboardIsTempGroup)4104 + if (GrafreeD.clipboardIsTempGroup)4101 4105 tGroup.add/*Child*/(tmp); 4102 4106 else 4103 - GraphreeD.clipboard = tmp;4107 + GrafreeD.clipboard = tmp;4104 4108 } 4105 4109 else 4106 - if (GraphreeD.clipboardIsTempGroup)4110 + if (GrafreeD.clipboardIsTempGroup)4107 4111 tGroup.add/*Child*/(child); 4108 4112 else 4109 - GraphreeD.clipboard = child;4113 + GrafreeD.clipboard = child;4110 4114 } 4111 4115 4112 4116 //ResetModel(); .. .. @@ -4138,21 +4142,21 @@ 4138 4142 //System.out.println("cut " + elem); 4139 4143 //System.out.println("parent = " + elem.parent); 4140 4144 // tmp.addChild(elem); 4141 - if (GraphreeD.clipboardIsTempGroup)4145 + if (GrafreeD.clipboardIsTempGroup)4142 4146 tGroup.add/*Child*/(tmp); 4143 4147 else 4144 - GraphreeD.clipboard = tmp;4148 + GrafreeD.clipboard = tmp;4145 4149 } 4146 4150 else 4147 - if (GraphreeD.clipboardIsTempGroup)4151 + if (GrafreeD.clipboardIsTempGroup)4148 4152 tGroup.add/*Child*/(child); 4149 4153 else 4150 - GraphreeD.clipboard = child;4154 + GrafreeD.clipboard = child;4151 4155 } 4152 4156 4153 4157 } 4154 - if (GraphreeD.clipboardIsTempGroup)4155 - GraphreeD.clipboard = tGroup;4158 + if (GrafreeD.clipboardIsTempGroup)4159 + GrafreeD.clipboard = tGroup;4156 4160 if (cut) 4157 4161 { 4158 4162 ResetModel(); .. .. @@ -4162,11 +4166,11 @@ 4162 4166 4163 4167 void paste(boolean expand) 4164 4168 { 4165 - // if (GraphreeD.clipboard == null)4169 + // if (GrafreeD.clipboard == null)4166 4170 // return; 4167 4171 boolean first = true; 4168 4172 4169 - if (GraphreeD.clipboardIsTempGroup)4173 + if (GrafreeD.clipboardIsTempGroup)4170 4174 { 4171 4175 Composite temp; 4172 4176 .. .. @@ -4177,7 +4181,7 @@ 4177 4181 temp = (Composite)Applet3D.clipboard.deepCopy(); 4178 4182 */ 4179 4183 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))4181 4185 { 4182 4186 Object3D child = (Object3D)e.nextElement(); 4183 4187 .. .. @@ -4191,7 +4195,7 @@ 4191 4195 else 4192 4196 elem = child.deepCopy(); // ? 4193 4197 child.parent = keepparent; 4194 - //if (GraphreeD.clipboardIsTempGroup && LA.isIdentity(elem.fromParent))4198 + //if (GrafreeD.clipboardIsTempGroup && LA.isIdentity(elem.fromParent))4195 4199 // elem = elem.get(0); 4196 4200 makeSomething(elem, true); // ?? first); 4197 4201 //group.addChild(elem); .. .. @@ -4211,14 +4215,14 @@ 4211 4215 //Object3D cb = Applet3D.clipboard; 4212 4216 //temp.addChild(cb); 4213 4217 //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());4219 4223 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;4222 4226 } 4223 4227 4224 4228 ResetModel(); .. .. @@ -4227,7 +4231,7 @@ 4227 4231 4228 4232 void pasteInto(boolean copyit) 4229 4233 { 4230 -// if (GraphreeD.clipboard == null)4234 +// if (GrafreeD.clipboard == null)4231 4235 // return; 4232 4236 4233 4237 if (group.selection.size() != 1) .. .. @@ -4260,9 +4264,9 @@ 4260 4264 { 4261 4265 boolean first = true; 4262 4266 4263 - if (GraphreeD.clipboardIsTempGroup)4267 + if (GrafreeD.clipboardIsTempGroup)4264 4268 { 4265 - Composite temp = (Composite)GraphreeD.clipboard;4269 + Composite temp = (Composite)GrafreeD.clipboard;4266 4270 Object3D copy; 4267 4271 for (Enumeration e = temp.children.elements(); e.hasMoreElements();) 4268 4272 { .. .. @@ -4272,7 +4276,7 @@ 4272 4276 } 4273 4277 } else 4274 4278 { 4275 - linkSomething(GraphreeD.clipboard); //.get(0));4279 + linkSomething(GrafreeD.clipboard); //.get(0));4276 4280 } 4277 4281 } 4278 4282 } .. .. @@ -4659,7 +4663,7 @@ 4659 4663 4660 4664 void ImportGFD() 4661 4665 { 4662 - FileDialog browser = new FileDialog(objEditor.frame, "Import GraphreeD", FileDialog.LOAD);4666 + FileDialog browser = new FileDialog(objEditor.frame, "Import GrafreeD", FileDialog.LOAD);4663 4667 browser.show(); 4664 4668 String filename = browser.getFile(); 4665 4669 if (filename != null && filename.length() > 0) .. .. @@ -4697,7 +4701,7 @@ 4697 4701 4698 4702 void ImportVRMLX3D() 4699 4703 { 4700 - if (GraphreeD.standAlone)4704 + if (GrafreeD.standAlone)4701 4705 { 4702 4706 /**/ 4703 4707 FileDialog browser = new FileDialog(objEditor.frame, "Import VRML/X3D", FileDialog.LOAD); .. .. @@ -4714,7 +4718,7 @@ 4714 4718 4715 4719 String GetFile(String dialogName) 4716 4720 { 4717 - if (GraphreeD.standAlone)4721 + if (GrafreeD.standAlone)4718 4722 { 4719 4723 FileDialog browser = new FileDialog(objEditor.frame, dialogName, FileDialog.LOAD); 4720 4724 browser.show(); ImplicitTiler.java
.. .. @@ -194,8 +194,8 @@ 194 194 { 195 195 // Merge normals: tolerance == 0 means use analytic, 196 196 // 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);199 199 200 200 analytic.Trim(trim, false, false, stripify, true); 201 201 generated.Trim(trim, true, false, stripify, true); LA.java
.. .. @@ -615,7 +615,7 @@ 615 615 private static int indxc[] = new int[4]; 616 616 617 617 618 - static int SIZE = 65536*64;618 + static int SIZE = 0; // 65536*64;619 619 620 620 static double[] costable = new double[SIZE]; 621 621 static double[] sintable = new double[SIZE]; Merge.java
.. .. @@ -192,7 +192,7 @@ 192 192 try 193 193 { 194 194 //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"));196 196 } catch (java.io.IOException e) 197 197 { 198 198 e.printStackTrace(); Mocap.java
.. .. @@ -359,7 +359,7 @@ 359 359 // //GetFileRoot(); 360 360 361 361 // sept 2014: // 362 - GraphreeD.RENDERME = 3; // patch for Merge objects362 + GrafreeD.RENDERME = 3; // patch for Merge objects363 363 float[] thedata = bvh.animation.getBoneData(0); 364 364 365 365 os.x = (float) (path.get(i).toParent[3][0]); // - thedata[frame*6]); .. .. @@ -938,6 +938,7 @@ 938 938 939 939 groundid = floorid; 940 940 941 + // green941 942 CameraPane.debugpoint.toParent[3][0] = groundx; 942 943 CameraPane.debugpoint.toParent[3][1] = floor.y; 943 944 CameraPane.debugpoint.toParent[3][2] = groundz; .. .. @@ -998,7 +999,7 @@ 998 999 999 1000 lastsoundtime = CameraPane.framecount; 1000 1001 1001 - GraphreeD.hassound = true;1002 + GrafreeD.hassound = true;1002 1003 } 1003 1004 // else 1004 1005 // System.out.println("skipped"); .. .. @@ -1016,6 +1017,7 @@ 1016 1017 // floor.z += posz; 1017 1018 1018 1019 // System.out.println("Allo " + sourcenode); 1020 + // purple1019 1021 CameraPane.debugpoint2.toParent[3][0] = floor.x;// + posx; 1020 1022 CameraPane.debugpoint2.toParent[3][1] = ground; // floor.y;// + sourcenode.parent.toParent[3][1]; 1021 1023 CameraPane.debugpoint2.toParent[3][2] = floor.z;// + posz; .. .. @@ -1052,7 +1054,7 @@ 1052 1054 v0.z = groundz - floor.z; 1053 1055 1054 1056 double distance = Math.sqrt(v0.dot(v0)); 1055 - double maxdist = 0.004;1057 + double maxdist = 0.04;1056 1058 1057 1059 if (distance > maxdist) 1058 1060 { .. .. @@ -1078,8 +1080,27 @@ 1078 1080 sourcenode.toParent = LA.newMatrix(); 1079 1081 sourcenode.fromParent = LA.newMatrix(); 1080 1082 } 1083 +1084 + v0.x = v0.z = 0;1085 +1086 + this.get(0).TransformToWorld(v0);1087 +1088 + // cyan1089 + CameraPane.debugpoint3.toParent[3][0] = v0.x;1090 + CameraPane.debugpoint3.toParent[3][1] = ground;1091 + CameraPane.debugpoint3.toParent[3][2] = v0.z;1092 +1081 1093 LA.matConcat(sourcenode.toParent, transformnode.toParent, sourcenode.toParent); 1082 1094 LA.matInvert(sourcenode.toParent, sourcenode.fromParent); 1095 +1096 + v0.x = v0.z = 0;1097 +1098 + this.get(0).TransformToWorld(v0);1099 +1100 + // red1101 + CameraPane.debugpoint4.toParent[3][0] = v0.x;1102 + CameraPane.debugpoint4.toParent[3][1] = ground;1103 + CameraPane.debugpoint4.toParent[3][2] = v0.z;1083 1104 } 1084 1105 } 1085 1106 .. .. @@ -1835,7 +1856,7 @@ 1835 1856 { 1836 1857 SetRotation(sourcenode, new cVector(floor), new cVector(centroid)); 1837 1858 } 1838 -1859 +1839 1860 if (setposition) 1840 1861 { 1841 1862 if (floorobject != null) MorphNode.java
.. .. @@ -19,7 +19,7 @@ 19 19 { 20 20 CreateMaterial(); 21 21 morphobject.get(0).bRep.SaveSupports(); 22 - bRep = (BoundaryRep) GraphreeD.clone(morphobject.get(0).bRep);22 + bRep = (BoundaryRep) GrafreeD.clone(morphobject.get(0).bRep);23 23 morphobject.get(0).bRep.RestoreSupports(); 24 24 } 25 25 .. .. @@ -30,7 +30,7 @@ 30 30 duplicate.parent = null; 31 31 Object3D sup = duplicate.support; 32 32 duplicate.support = null; 33 - addChild((Object3D)GraphreeD.clone(duplicate));33 + addChild((Object3D)GrafreeD.clone(duplicate));34 34 duplicate.parent = par; 35 35 duplicate.support = sup; 36 36 } .. .. @@ -56,7 +56,7 @@ 56 56 57 57 // if (bRep == null) 58 58 // { 59 -// bRep = (BoundaryRep) GraphreeD.clone(morphobject.get(0).bRep);59 +// bRep = (BoundaryRep) GrafreeD.clone(morphobject.get(0).bRep);60 60 // } 61 61 62 62 if (CameraPane.SUPPORT && display.drawMode == display.SHADOW) .. .. @@ -112,7 +112,7 @@ 112 112 super.deepCopySelf(other); 113 113 MorphNode bp = (MorphNode)other; 114 114 115 - bp.morphweights = (double[]) GraphreeD.clone(morphweights);115 + bp.morphweights = (double[]) GrafreeD.clone(morphweights);116 116 } 117 117 118 118 void createEditWindow(GroupEditor callee, boolean newWindow) ObjEditor.java
.. .. @@ -692,7 +692,7 @@ 692 692 protected static ImageIcon createImageIcon(String path, 693 693 String description) 694 694 { 695 - java.net.URL imgURL = GraphreeD.class.getResource(path);695 + java.net.URL imgURL = GrafreeD.class.getResource(path);696 696 if (imgURL != null) 697 697 { 698 698 return new ImageIcon(imgURL, description); .. .. @@ -1107,7 +1107,7 @@ 1107 1107 //frontScroll.setLabel("------------------------------ XZ (front) ---------------------------------------------------"); 1108 1108 //sideScroll.setLabel("------------------------------- YZ (side) ---------------------------------------------------"); 1109 1109 1110 -// GridBagConstraints gbc = (GridBagConstraints) GraphreeD.clone(aConstraints);1110 +// GridBagConstraints gbc = (GridBagConstraints) GrafreeD.clone(aConstraints);1111 1111 Camera cam = GetCamera(copy, 0); 1112 1112 1113 1113 Composite cams = null; .. .. @@ -1334,7 +1334,7 @@ 1334 1334 frame.getContentPane().add(/*"Center",*/framePanel); 1335 1335 //frame.getContentPane().add(/*"Center",*/ worldPane); 1336 1336 1337 -// aConstraints = gbc; // (GridBagConstraints) GraphreeD.clone(gbc);1337 +// aConstraints = gbc; // (GridBagConstraints) GrafreeD.clone(gbc);1338 1338 1339 1339 frame.setSize(1024, 768); 1340 1340 frame.show(); .. .. @@ -2345,7 +2345,7 @@ 2345 2345 2346 2346 void ImportJME(com.jmex.model.converters.FormatConverter converter, String ext, String dialogName) 2347 2347 { 2348 - if (GraphreeD.standAlone)2348 + if (GrafreeD.standAlone)2349 2349 { 2350 2350 /**/ 2351 2351 FileDialog browser = new FileDialog(frame, dialogName, FileDialog.LOAD); .. .. @@ -3183,8 +3183,8 @@ 3183 3183 3184 3184 CameraPane.ANIMATION ^= true; 3185 3185 3186 - GraphreeD.wav.cursor = 0;3187 - GraphreeD.wav.loop = 0;3186 + GrafreeD.wav.cursor = 0;3187 + GrafreeD.wav.loop = 0;3188 3188 } 3189 3189 } else 3190 3190 { .. .. @@ -4085,7 +4085,7 @@ 4085 4085 4086 4086 void load() // throws ClassNotFoundException 4087 4087 { 4088 - if (GraphreeD.standAlone)4088 + if (GrafreeD.standAlone)4089 4089 { 4090 4090 FileDialog browser = new FileDialog(frame, "Load", FileDialog.LOAD); 4091 4091 browser.show(); .. .. @@ -4190,7 +4190,7 @@ 4190 4190 4191 4191 void saveAs() 4192 4192 { 4193 - if (GraphreeD.standAlone)4193 + if (GrafreeD.standAlone)4194 4194 { 4195 4195 FileDialog browser = new FileDialog(frame, "Save As", FileDialog.SAVE); 4196 4196 browser.setVisible(true); .. .. @@ -4213,10 +4213,20 @@ 4213 4213 4214 4214 Object3D object = copy.selection.get(0); 4215 4215 4216 + FileObject fileobj = null;4217 +4218 + if (object instanceof FileObject)4219 + fileobj = (FileObject)object;4220 +4216 4221 if (object.fileparent != null) 4217 4222 { 4218 - FileObject fileobj = (FileObject) object.fileparent;4223 + assert(fileobj == null);4219 4224 4225 + fileobj = (FileObject) object.fileparent;4226 + }4227 +4228 + if (fileobj != null)4229 + {4220 4230 System.out.println("WriteObject " + object + " : " + fileobj.name); 4221 4231 WriteObject(object, fileobj.name); 4222 4232 } .. .. @@ -4259,7 +4269,7 @@ 4259 4269 } 4260 4270 } 4261 4271 else 4262 - //if (GraphreeD.standAlone)4272 + //if (GrafreeD.standAlone)4263 4273 { 4264 4274 FileDialog browser = new FileDialog(frame, "Export", FileDialog.SAVE); 4265 4275 browser.setVisible(true); .. .. @@ -4291,7 +4301,7 @@ 4291 4301 Object3D objectparent = obj.parent; 4292 4302 obj.parent = null; 4293 4303 4294 - Object3D object = (Object3D) GraphreeD.clone(obj);4304 + Object3D object = (Object3D) GrafreeD.clone(obj);4295 4305 4296 4306 obj.parent = objectparent; 4297 4307 .. .. @@ -4325,7 +4335,7 @@ 4325 4335 buffer.append("background { color rgb <0.8,0.8,0.8> }\n\n"); 4326 4336 cameraView.renderCamera.generatePOV(buffer, bnds.width, bnds.height); 4327 4337 copy.generatePOV(buffer); 4328 - if (GraphreeD.standAlone)4338 + if (GrafreeD.standAlone)4329 4339 { 4330 4340 FileDialog browser = new FileDialog(frame, "Export POV", 1); 4331 4341 browser.show(); Object3D.java
.. .. @@ -935,7 +935,7 @@ 935 935 936 936 public Object clone() 937 937 { 938 - return GraphreeD.clone(this);938 + return GrafreeD.clone(this);939 939 } 940 940 941 941 Object3D copyExpand() .. .. @@ -1701,7 +1701,7 @@ 1701 1701 Object3D o = new Object3D((clone?"Ge:":"Li:") + this.name); 1702 1702 o.bRep = transientrep; 1703 1703 if (clone) 1704 - o.bRep = (BoundaryRep) GraphreeD.clone(transientrep);1704 + o.bRep = (BoundaryRep) GrafreeD.clone(transientrep);1705 1705 o.CreateMaterial(); 1706 1706 o.SetAttributes(this, -1); 1707 1707 //parent .. .. @@ -1714,7 +1714,7 @@ 1714 1714 Object3D o = new Object3D((clone?"Ge:":"Li:") + this.name); 1715 1715 o.bRep = bRep; 1716 1716 if (clone) 1717 - o.bRep = (BoundaryRep) GraphreeD.clone(bRep);1717 + o.bRep = (BoundaryRep) GrafreeD.clone(bRep);1718 1718 o.CreateMaterial(); 1719 1719 //o.overwriteThis(this, -1); 1720 1720 o.SetAttributes(this, -1); .. .. @@ -1756,7 +1756,7 @@ 1756 1756 // { 1757 1757 // assert(bRep == null); 1758 1758 // Object3D o = new Object3D("Geometry:" + this.name); 1759 -// o.bRep = (BoundaryRep) GraphreeD.clone(transientrep);1759 +// o.bRep = (BoundaryRep) GrafreeD.clone(transientrep);1760 1760 // o.CreateMaterial(); 1761 1761 // parent.addChild(o); 1762 1762 // } .. .. @@ -1765,7 +1765,7 @@ 1765 1765 // { 1766 1766 // assert(transientrep == null); 1767 1767 // Object3D o = new Object3D("Geometry:" + this.name); 1768 -// o.bRep = (BoundaryRep) GraphreeD.clone(bRep);1768 +// o.bRep = (BoundaryRep) GrafreeD.clone(bRep);1769 1769 // o.CreateMaterial(); 1770 1770 // parent.addChild(o); 1771 1771 // } .. .. @@ -3153,7 +3153,7 @@ 3153 3153 3154 3154 BoundaryRep sup = bRep.support; 3155 3155 bRep.support = null; 3156 - BoundaryRep temprep = (BoundaryRep) GraphreeD.clone(bRep);3156 + BoundaryRep temprep = (BoundaryRep) GrafreeD.clone(bRep);3157 3157 // bRep.SplitInTwo(onlyone); // thread... 3158 3158 temprep.SplitInTwo(reduction34, onlyone); 3159 3159 bRep = temprep; .. .. @@ -3677,7 +3677,7 @@ 3677 3677 if (child == null) 3678 3678 continue; 3679 3679 3680 - if (GraphreeD.RENDERME > 0)3680 + if (GrafreeD.RENDERME > 0)3681 3681 { 3682 3682 if (child instanceof Merge) 3683 3683 ((Merge)child).renderme(); .. .. @@ -3828,7 +3828,7 @@ 3828 3828 if (child == null) 3829 3829 continue; 3830 3830 3831 - if (GraphreeD.RENDERME > 0)3831 + if (GrafreeD.RENDERME > 0)3832 3832 { 3833 3833 if (child instanceof Merge) 3834 3834 ((Merge)child).renderme(); .. .. @@ -4023,7 +4023,7 @@ 4023 4023 if (child == null) 4024 4024 continue; 4025 4025 4026 - if (GraphreeD.RENDERME > 0)4026 + if (GrafreeD.RENDERME > 0)4027 4027 { 4028 4028 if (child instanceof Merge) 4029 4029 ((Merge)child).renderme(); .. .. @@ -5819,12 +5819,12 @@ 5819 5819 if (!child.HasTransparency()) 5820 5820 { 5821 5821 sel = root != null && root.selection != null && root.selection.indexOf(child) != -1; 5822 - // GraphreeD.tracein("draw ", child);5822 + // GrafreeD.tracein("draw ", child);5823 5823 boolean wasblocked = blockdraw; 5824 5824 blockdraw = true; 5825 5825 child.draw(display, root, selected || sel, wasblocked || blocked); // || child.IsSelected()); 5826 5826 blockdraw = false; 5827 - // GraphreeD.traceout("draw ", child);5827 + // GrafreeD.traceout("draw ", child);5828 5828 } 5829 5829 5830 5830 release(i); .. .. @@ -8041,7 +8041,7 @@ 8041 8041 { 8042 8042 assert(bRep != null); 8043 8043 if (!(support instanceof GenericJoint)) // support.bRep != null) 8044 - GraphreeD.Assert(support.bRep == bRep.support);8044 + GrafreeD.Assert(support.bRep == bRep.support);8045 8045 } 8046 8046 else 8047 8047 { RandomNode.java
.. .. @@ -95,7 +95,7 @@ 95 95 96 96 //(int)(Math.random()*super.size()); 97 97 //globalcount++; 98 - gcount += GraphreeD.mix3(rnd+12345,firstchoice*12345,gcount);98 + gcount += GrafreeD.mix3(rnd+12345,firstchoice*12345,gcount);99 99 100 100 gcount &= 0x7fffffff; 101 101 SwitchNode.java
.. .. @@ -20,7 +20,7 @@ 20 20 { 21 21 CreateMaterial(); 22 22 switchobject.get(0).bRep.SaveSupports(); 23 - bRep = (BoundaryRep) GraphreeD.clone(switchobject.get(0).bRep);23 + bRep = (BoundaryRep) GrafreeD.clone(switchobject.get(0).bRep);24 24 switchobject.get(0).bRep.RestoreSupports(); 25 25 } 26 26 .. .. @@ -30,7 +30,7 @@ 30 30 Object3D par = duplicate.parent; 31 31 duplicate.parent = null; 32 32 duplicate.SaveSupports(); 33 - addChild((Object3D)GraphreeD.clone(duplicate));33 + addChild((Object3D)GrafreeD.clone(duplicate));34 34 duplicate.parent = par; 35 35 duplicate.RestoreSupports(); 36 36 } .. .. @@ -97,7 +97,7 @@ 97 97 98 98 if (bRep == null) 99 99 { 100 - bRep = (BoundaryRep) GraphreeD.clone(switchobject.get(0).bRep);100 + bRep = (BoundaryRep) GrafreeD.clone(switchobject.get(0).bRep);101 101 } 102 102 103 103 if (CameraPane.SUPPORT && display.drawMode == display.SHADOW) Texture.java
.. .. @@ -10,8 +10,8 @@ 10 10 public class Texture extends Composite implements java.io.Serializable 11 11 { 12 12 // deprecated due to serial problems 13 - static final long serialVersionUID = -5280151442948961597L; // new java14 - // 7695543694999681408L; // old java !!!13 + static final long serialVersionUID = // -5280151442948961597L; // new java14 + 7695543694999681408L; // old java !!!15 15 16 16 // default = -8076744133104150348L 17 17 Vertex.java
.. .. @@ -132,9 +132,9 @@ 132 132 133 133 return Math.abs(/*pos.*/x - vert./*pos.*/x) + 134 134 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 issues136 - (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 issues136 + (GrafreeD.linkUV || Math.abs(s - vert.s) + Math.abs(t - vert.t) < 0.00001)137 + ; // GrafreeD.epsvertex2;138 138 } 139 139 /* 140 140 public boolean isSame(Object o) cMaterial.java
.. .. @@ -144,7 +144,7 @@ 144 144 145 145 cColor.HSBtoRGB(display.color, display.saturation, 1, display.modelParams0); 146 146 147 - float[] colorV = GraphreeD.colorV;147 + float[] colorV = GrafreeD.colorV;148 148 149 149 /**/ 150 150 if (display.drawMode == display.DEFAULT) // && display.RENDERPROGRAM == 0) cMesh.java
.. .. @@ -402,8 +402,8 @@ 402 402 if (ref == null) 403 403 return; 404 404 405 - GraphreeD.epsequal = IsEpsEqual();406 - GraphreeD.linkUV = IsLinkUV();405 + GrafreeD.epsequal = IsEpsEqual();406 + GrafreeD.linkUV = IsLinkUV();407 407 408 408 // BoundaryRep oldrep = transientrep; 409 409 .. .. @@ -417,7 +417,7 @@ 417 417 Object3D obj = ref.GetObject(); 418 418 419 419 // may 2014: side-effect with UVs!! 420 - obj = (Object3D) GraphreeD.clone(obj);420 + obj = (Object3D) GrafreeD.clone(obj);421 421 422 422 merge(obj); 423 423 .. .. @@ -427,7 +427,7 @@ 427 427 bRep.Trim(false, false,false,false,false); 428 428 System.out.println("------> TRIM " + ref + "; #vertices = " + bRep.VertexCount() + "; #faces = " + bRep.FaceCount()); 429 429 430 - GraphreeD.epsequal = false;430 + GrafreeD.epsequal = false;431 431 432 432 if (transientrep != null && bRep.VertexCount() == transientrep.VertexCount()) 433 433 { .. .. @@ -468,7 +468,7 @@ 468 468 } 469 469 else 470 470 // geometry is merged... 471 - refcopy = (BoundaryRep) GraphreeD.clone(transientrep);471 + refcopy = (BoundaryRep) GrafreeD.clone(transientrep);472 472 } 473 473 474 474 transient cVector minima = new cVector(); cRadio.java
.. .. @@ -32,7 +32,7 @@ 32 32 if (link) 33 33 camera = c; 34 34 else 35 - camera = (Camera)GraphreeD.clone(c);35 + camera = (Camera)GrafreeD.clone(c);36 36 } 37 37 38 38 Object3D object; cVector.java
.. .. @@ -266,7 +266,7 @@ 266 266 long ly = Double.doubleToRawLongBits(y); 267 267 long lz = Double.doubleToRawLongBits(z); 268 268 269 - if (GraphreeD.epsequal)269 + if (GrafreeD.epsequal)270 270 { 271 271 return 0; 272 272 } else