Normand Briere
2019-05-13 f924d3e00db476c06f55f3d5aaef307e17575340
Object3D.java
....@@ -5,6 +5,7 @@
55 import java.util.Vector;
66
77 import javax.media.j3d.Transform3D;
8
+import javax.media.opengl.GL;
89 import javax.vecmath.Vector3d;
910
1011 import javax.imageio.ImageIO;
....@@ -796,7 +797,7 @@
796797
797798 if (marked && Globals.isLIVE() && live &&
798799 //TEMP21aug2018
799
- Globals.DrawMode() == iCameraPane.SHADOW &&
800
+ (Globals.DrawMode() == iCameraPane.SHADOW || !Globals.RENDERSHADOW) &&
800801 currentframe != Globals.framecount)
801802 {
802803 currentframe = Globals.framecount;
....@@ -911,6 +912,11 @@
911912 fromParent = null; // LA.newMatrix();
912913 bRep = null; // new BoundaryRep();
913914
915
+ if (oname != null && oname.equals("LeftHand"))
916
+ {
917
+ name = oname;
918
+ }
919
+
914920 /*
915921 float hue = (float)Math.random();
916922 Color col;
....@@ -953,7 +959,7 @@
953959
954960 public Object clone()
955961 {
956
- return GrafreeD.clone(this);
962
+ return Grafreed.clone(this);
957963 }
958964
959965 Object3D copyExpand()
....@@ -1469,7 +1475,7 @@
14691475 BoundaryRep.SEUIL = other.material.cameralight;
14701476
14711477 // Set default to 0.1
1472
- BoundaryRep.SEUIL /= 2;
1478
+ BoundaryRep.SEUIL /= 4; // 2;
14731479 System.out.println("SEUIL = " + BoundaryRep.SEUIL);
14741480 }
14751481
....@@ -1728,7 +1734,7 @@
17281734 Object3D o = new Object3D((clone?"Ge:":"Li:") + this.name);
17291735 o.bRep = transientrep;
17301736 if (clone)
1731
- o.bRep = (BoundaryRep) GrafreeD.clone(transientrep);
1737
+ o.bRep = (BoundaryRep) Grafreed.clone(transientrep);
17321738 o.CreateMaterial();
17331739 o.SetAttributes(this, -1);
17341740 //parent
....@@ -1741,7 +1747,7 @@
17411747 Object3D o = new Object3D((clone?"Ge:":"Li:") + this.name);
17421748 o.bRep = bRep;
17431749 if (clone)
1744
- o.bRep = (BoundaryRep) GrafreeD.clone(bRep);
1750
+ o.bRep = (BoundaryRep) Grafreed.clone(bRep);
17451751 o.CreateMaterial();
17461752 //o.overwriteThis(this, -1);
17471753 o.SetAttributes(this, -1);
....@@ -2299,6 +2305,7 @@
22992305 {
23002306 if (newWindow)
23012307 {
2308
+ new Exception().printStackTrace();
23022309 System.exit(0);
23032310 if (parent != null)
23042311 {
....@@ -2475,13 +2482,13 @@
24752482 return retval;
24762483 }
24772484
2478
- void doEditDrag(ClickInfo info)
2485
+ void doEditDrag(ClickInfo info, boolean opposite)
24792486 {
24802487 switch (doSomething)
24812488 {
24822489 case 1: // '\001'
24832490 //super.
2484
- doEditDrag0(info);
2491
+ doEditDrag0(info, opposite);
24852492 break;
24862493
24872494 case 2: // '\002'
....@@ -2494,11 +2501,11 @@
24942501 {
24952502 //sel.hitSomething = childToDrag.hitSomething;
24962503 //childToDrag.doEditDrag(info);
2497
- sel.doEditDrag(info);
2504
+ sel.doEditDrag(info, opposite);
24982505 } else
24992506 {
25002507 //super.
2501
- doEditDrag0(info);
2508
+ doEditDrag0(info, opposite);
25022509 }
25032510 }
25042511 break;
....@@ -2905,7 +2912,8 @@
29052912 {
29062913 if (bRep != null)
29072914 {
2908
- bRep.GenUV();
2915
+ bRep.GenUV(); //1);
2916
+ //bRep.UnfoldUV();
29092917 Touch();
29102918 }
29112919 }
....@@ -2980,6 +2988,31 @@
29802988 blockloop = false;
29812989 }
29822990
2991
+ void TransformChildren()
2992
+ {
2993
+ if (toParent != null)
2994
+ {
2995
+ for (int i=Size(); --i>=0;)
2996
+ {
2997
+ Object3D v = get(i);
2998
+
2999
+ if (v.toParent == null)
3000
+ {
3001
+ v.toParent = LA.newMatrix();
3002
+ v.fromParent = LA.newMatrix();
3003
+ }
3004
+
3005
+ LA.matConcat(v.toParent, toParent, v.toParent);
3006
+ LA.matConcat(fromParent, v.fromParent, v.fromParent);
3007
+ }
3008
+
3009
+ toParent = null; // LA.matIdentity(toParent);
3010
+ fromParent = null; // LA.matIdentity(fromParent);
3011
+
3012
+ Touch();
3013
+ }
3014
+ }
3015
+
29833016 void TransformGeometry()
29843017 {
29853018 Object3D obj = this;
....@@ -3201,7 +3234,7 @@
32013234
32023235 BoundaryRep sup = bRep.support;
32033236 bRep.support = null;
3204
- BoundaryRep temprep = (BoundaryRep) GrafreeD.clone(bRep);
3237
+ BoundaryRep temprep = (BoundaryRep) Grafreed.clone(bRep);
32053238 // bRep.SplitInTwo(onlyone); // thread...
32063239 temprep.SplitInTwo(reduction34, onlyone);
32073240 bRep = temprep;
....@@ -3725,7 +3758,7 @@
37253758 if (child == null)
37263759 continue;
37273760
3728
- if (GrafreeD.RENDERME > 0)
3761
+ if (Grafreed.RENDERME > 0)
37293762 {
37303763 if (child instanceof Merge)
37313764 ((Merge)child).renderme();
....@@ -3876,7 +3909,7 @@
38763909 if (child == null)
38773910 continue;
38783911
3879
- if (GrafreeD.RENDERME > 0)
3912
+ if (Grafreed.RENDERME > 0)
38803913 {
38813914 if (child instanceof Merge)
38823915 ((Merge)child).renderme();
....@@ -4071,7 +4104,7 @@
40714104 if (child == null)
40724105 continue;
40734106
4074
- if (GrafreeD.RENDERME > 0)
4107
+ if (Grafreed.RENDERME > 0)
40754108 {
40764109 if (child instanceof Merge)
40774110 ((Merge)child).renderme();
....@@ -5156,10 +5189,34 @@
51565189
51575190 // System.out.println("Fullname = " + fullname);
51585191
5159
- if (fullname.name.indexOf(":") == -1)
5160
- return fullname.name;
5192
+ // Does not work on Windows due to C:
5193
+// if (fullname.name.indexOf(":") == -1)
5194
+// return fullname.name;
5195
+//
5196
+// return fullname.name.substring(0,fullname.name.indexOf(":"));
51615197
5162
- return fullname.name.substring(0,fullname.name.indexOf(":"));
5198
+ String[] split = fullname.name.split(":");
5199
+
5200
+ if (split.length == 0)
5201
+ {
5202
+ return "";
5203
+ }
5204
+
5205
+ if (split.length <= 2)
5206
+ {
5207
+ if (fullname.name.endsWith(":"))
5208
+ {
5209
+ // Windows
5210
+ return fullname.name.substring(0, fullname.name.length()-1);
5211
+ }
5212
+
5213
+ return split[0];
5214
+ }
5215
+
5216
+ // Windows
5217
+ assert(split.length == 4);
5218
+
5219
+ return split[0] + ":" + split[1];
51635220 }
51645221
51655222 static String GetBump(cTexture fullname)
....@@ -5168,10 +5225,38 @@
51685225 return "";
51695226
51705227 // System.out.println("Fullname = " + fullname);
5171
- if (fullname.name.indexOf(":") == -1)
5172
- return "";
5173
-
5174
- return fullname.name.substring(fullname.name.indexOf(":")+1,fullname.name.length());
5228
+ // Does not work on Windows due to C:
5229
+// if (fullname.name.indexOf(":") == -1)
5230
+// return "";
5231
+//
5232
+// return fullname.name.substring(fullname.name.indexOf(":")+1,fullname.name.length());
5233
+ String[] split = fullname.name.split(":");
5234
+
5235
+ if (split.length == 0)
5236
+ {
5237
+ return "";
5238
+ }
5239
+
5240
+ if (split.length == 1)
5241
+ {
5242
+ return "";
5243
+ }
5244
+
5245
+ if (split.length == 2)
5246
+ {
5247
+ if (fullname.name.endsWith(":"))
5248
+ {
5249
+ // Windows
5250
+ return "";
5251
+ }
5252
+
5253
+ return split[1];
5254
+ }
5255
+
5256
+ // Windows
5257
+ assert(split.length == 4);
5258
+
5259
+ return split[2] + ":" + split[3];
51755260 }
51765261
51775262 String GetPigmentTexture()
....@@ -5245,7 +5330,7 @@
52455330 System.out.print("; textures = " + textures);
52465331 System.out.println("; usedtextures = " + usedtextures);
52475332
5248
- if (GetTextures() == null)
5333
+ if (GetTextures() == null) // What is that??
52495334 GetTextures().name = ":";
52505335
52515336 String texname = tex;
....@@ -5324,7 +5409,7 @@
53245409 return
53255410 CameraPane.SUPPORT && !CameraPane.movingcamera && link2master && /*live &&*/ support != null
53265411 // PROBLEM with CROWD!!
5327
- && (Globals.DrawMode() == iCameraPane.SHADOW || Globals.CROWD);
5412
+ && (Globals.DrawMode() == iCameraPane.SHADOW || !Globals.RENDERSHADOW || Globals.CROWD);
53285413 }
53295414
53305415 static boolean DEBUG_SELECTION = false;
....@@ -5371,7 +5456,7 @@
53715456 return;
53725457 }
53735458
5374
- javax.media.opengl.GL gl = display.GetGL();
5459
+ //javax.media.opengl.GL gl = display.GetGL();
53755460
53765461 /*
53775462 if (touched)
....@@ -5423,7 +5508,7 @@
54235508 //if (displaylist == -1 && usecalllists)
54245509 if ((bRep != null && bRep.displaylist <= 0) && usecalllists) // june 2013
54255510 {
5426
- bRep.displaylist = gl.glGenLists(1);
5511
+ bRep.displaylist = display.GenList();
54275512 assert(bRep.displaylist != 0);
54285513 // System.err.println("glGenLists: " + bRep.displaylist + " for " + this);
54295514 //System.out.println("\tgen list " + list);
....@@ -5435,14 +5520,16 @@
54355520 if (usecalllists)
54365521 {
54375522 // System.err.println("new list " + bRep.displaylist + " for " + this);
5438
- gl.glNewList(bRep.displaylist, gl.GL_COMPILE); //_AND_EXECUTE);
5523
+ display.NewList(bRep.displaylist);
54395524 }
5525
+
54405526 CallList(display, root, selected, blocked);
5527
+
54415528 // compiled = true;
54425529 if (usecalllists)
54435530 {
54445531 // System.err.println("end list " + bRep.displaylist + " for " + this);
5445
- gl.glEndList();
5532
+ display.EndList();
54465533 }
54475534 //gl.glDrawBuffer(gl.GL_BACK);
54485535 // XXX touched = false;
....@@ -5490,7 +5577,7 @@
54905577 if (display.DrawMode() == iCameraPane.SHADOW)
54915578 {
54925579 if (!link2master // tricky to cull in shadow mode.
5493
- && GetBRep().FrustumCull(this, gl, display.LightCamera(), true))
5580
+ && GetBRep().FrustumCull(this, null, display.LightCamera(), true))
54945581 {
54955582 //System.out.print("CULLED");
54965583 culled = true;
....@@ -5498,7 +5585,7 @@
54985585 }
54995586 else
55005587 //GetBRep().getBounds(v0, v1, this);
5501
- if (GetBRep().FrustumCull(this, gl, display.RenderCamera(), false))
5588
+ if (GetBRep().FrustumCull(this, null, display.RenderCamera(), false))
55025589 culled = true;
55035590
55045591 // LA.xformPos(v0, display.renderCamera.toScreen, v0);
....@@ -5538,7 +5625,7 @@
55385625 {
55395626 if (GetBRep() != null)
55405627 {
5541
- CameraPane.NextIndex(this, gl);
5628
+ display.NextIndex();
55425629 // vertex color conflict : gl.glCallList(list);
55435630 DrawNode(display, root, selected);
55445631 if (this instanceof BezierPatch)
....@@ -5595,7 +5682,7 @@
55955682
55965683 // System.err.println("glCallList: " + bRep.displaylist + " for " + this);
55975684 assert(bRep.displaylist != 0);
5598
- gl.glCallList(bRep.displaylist);
5685
+ display.CallList(bRep.displaylist);
55995686 // june 2013 drawSelf(display, root, selected);
56005687 }
56015688 }
....@@ -5895,9 +5982,10 @@
58955982 return;
58965983 }
58975984
5985
+ //bRep.GenUV(1/material.diffuseness);
58985986 // bRep.lock = true;
58995987
5900
- javax.media.opengl.GL gl = display.GetGL();
5988
+ //javax.media.opengl.GL gl = display.GetGL();
59015989
59025990 if (CameraPane.BOXMODE && !selected) // || CameraPane.movingcamera)
59035991 {
....@@ -5914,23 +6002,7 @@
59146002
59156003 bRep.getMinMax(min, max, 100);
59166004
5917
- gl.glBegin(gl.GL_LINES);
5918
-
5919
- gl.glVertex3d(min.x, min.y, min.z);
5920
- gl.glVertex3d(min.x, min.y, max.z);
5921
- gl.glVertex3d(min.x, min.y, min.z);
5922
- gl.glVertex3d(min.x, max.y, min.z);
5923
- gl.glVertex3d(min.x, min.y, min.z);
5924
- gl.glVertex3d(max.x, min.y, min.z);
5925
-
5926
- gl.glVertex3d(max.x, max.y, max.z);
5927
- gl.glVertex3d(min.x, max.y, max.z);
5928
- gl.glVertex3d(max.x, max.y, max.z);
5929
- gl.glVertex3d(max.x, min.y, max.z);
5930
- gl.glVertex3d(max.x, max.y, max.z);
5931
- gl.glVertex3d(max.x, max.y, min.z);
5932
-
5933
- gl.glEnd();
6005
+ display.DrawBox(min, max);
59346006
59356007 return;
59366008 }
....@@ -5984,178 +6056,14 @@
59846056 new Exception().printStackTrace();
59856057 return;
59866058 }
5987
-
5988
- // TRIANGLE STRIP ARRAY
5989
- if (bRep.trimmed)
5990
- {
5991
- float[] v = bRep.getRawVertices();
5992
- float[] n = bRep.getRawNormals();
5993
- float[] c = bRep.getRawColors();
5994
- float[] uv = bRep.getRawUVMap();
5995
-
5996
- int count2 = 0;
5997
- int count3 = 0;
5998
-
5999
- if (n.length > 0)
6000
- {
6001
- for (int i = 0; i < strips.length; i++)
6002
- {
6003
- gl.glBegin(gl.GL_TRIANGLE_STRIP);
6004
-
6005
- /*
6006
- boolean locked = false;
6007
- float eps = 0.1f;
6008
- boolean wrap = CameraPane.UVWRAP; // true; // UV WRAP TEXTURE ISSUE: true = artifacts, false = nice
6009
-
6010
- int dot = 0;
6011
-
6012
- if ((dot&1) == 0)
6013
- dot |= (Math.abs(qv.s - pv.s) < eps && Math.abs(qv.t - pv.t) < eps) ? 3 : 1;
6014
-
6015
- if (wrap || (dot&2) != 0) // Math.abs(qv.s - pv.s) < eps && Math.abs(qv.t - pv.t) < eps)
6016
- gl.glTexCoord2f((float) qv.s, (float) qv.t);
6017
- else
6018
- {
6019
- locked = true;
6020
- gl.glTexCoord2f((float) pv.s, (float) pv.t);
6021
- }
6022
- //System.out.println("vertexq = " + qv.x + ", " + qv.y + ", " + qv.z);
6023
- gl.glVertex3f((float) qv.x, (float) qv.y, (float) qv.z);
6024
- if (hasnorm)
6025
- {
6026
- //System.out.println("normalr = " + rv.norm.x + ", " + rv.norm.y + ", " + rv.norm.z);
6027
- gl.glNormal3f((float) rv.norm.x, (float) rv.norm.y, (float) rv.norm.z);
6028
- }
6029
-
6030
- if ((dot&4) == 0)
6031
- dot |= (Math.abs(rv.s - pv.s) < eps && Math.abs(rv.t - pv.t) < eps) ? 12 : 4;
6032
-
6033
- if (wrap || !locked && (dot&8) != 0)
6034
- gl.glTexCoord2f((float) rv.s, (float) rv.t);
6035
- else
6036
- gl.glTexCoord2f((float) pv.s, (float) pv.t);
6037
-
6038
- f.dot = dot;
6039
- */
6040
-
6041
- if (!selectmode)
6042
- {
6043
- if (n[count3] != 0 || n[count3 + 1] != 0 || n[count3 + 2] != 0)
6044
- {
6045
- gl.glNormal3f(n[count3], n[count3 + 1], n[count3 + 2]);
6046
- } else
6047
- {
6048
- gl.glNormal3f(0, 0, 1);
6049
- }
6050
-
6051
- if (c != null)
6052
- //System.out.println("glcolor = " + c[count3] + ", " + c[count3+1] + ", " + c[count3+2]);
6053
- {
6054
- gl.glColor4f(c[count3/3], c[count3/3 /* + 1*/], c[count3/3 /* + 2*/], 1);
6055
- }
6056
- }
6057
- if (flipV)
6058
- gl.glTexCoord2f(uv[count2], 1-uv[count2 + 1]);
6059
- else
6060
- gl.glTexCoord2f(uv[count2], uv[count2 + 1]);
6061
- //System.out.println("vertex1 = " + v[count3] + ", " + v[count3+1] + ", " + v[count3+2]);
6062
- gl.glVertex3f(v[count3], v[count3 + 1], v[count3 + 2]);
6063
-
6064
- count2 += 2;
6065
- count3 += 3;
6066
- if (!selectmode)
6067
- {
6068
- if (n[count3] != 0 || n[count3 + 1] != 0 || n[count3 + 2] != 0)
6069
- {
6070
- gl.glNormal3f(n[count3], n[count3 + 1], n[count3 + 2]);
6071
- } else
6072
- {
6073
- gl.glNormal3f(0, 0, 1);
6074
- }
6075
- if (c != null)
6076
- {
6077
- gl.glColor4f(c[count3/3], c[count3/3 /* + 1*/], c[count3/3 /* + 2*/], 1);
6078
- }
6079
- }
6080
- if (flipV)
6081
- gl.glTexCoord2f(uv[count2], 1-uv[count2 + 1]);
6082
- else
6083
- gl.glTexCoord2f(uv[count2], uv[count2 + 1]);
6084
- //System.out.println("vertex2 = " + v[count3] + ", " + v[count3+1] + ", " + v[count3+2]);
6085
- gl.glVertex3f(v[count3], v[count3 + 1], v[count3 + 2]);
6086
-
6087
- count2 += 2;
6088
- count3 += 3;
6089
- for (int j = 0; j < strips[i] - 2; j++)
6090
- {
6091
- //gl.glTexCoord2d(...);
6092
- if (!selectmode)
6093
- {
6094
- if (n[count3] != 0 || n[count3 + 1] != 0 || n[count3 + 2] != 0)
6095
- {
6096
- gl.glNormal3f(n[count3], n[count3 + 1], n[count3 + 2]);
6097
- } else
6098
- {
6099
- gl.glNormal3f(0, 0, 1);
6100
- }
6101
- if (c != null)
6102
- {
6103
- gl.glColor4f(c[count3/3], c[count3/3 /* + 1*/], c[count3/3 /* + 2*/], 1);
6104
- }
6105
- }
6106
-
6107
- if (flipV)
6108
- gl.glTexCoord2f(uv[count2], 1-uv[count2 + 1]);
6109
- else
6110
- gl.glTexCoord2f(uv[count2], uv[count2 + 1]);
6111
- //System.out.println("coord3 = " + uv[count2] + ", " + uv[count2+1]);
6112
- gl.glVertex3f(v[count3], v[count3 + 1], v[count3 + 2]);
6113
- count2 += 2;
6114
- count3 += 3;
6115
- }
6116
-
6117
- gl.glEnd();
6118
- }
6119
- }
6120
-
6121
- assert count3 == v.length;
6122
- }
6123
- else // !trimmed
6124
- {
6125
- int count = 0;
6126
- for (int i = 0; i < strips.length; i++)
6127
- {
6128
- gl.glBegin(gl.GL_TRIANGLE_STRIP);
6129
-
6130
- Vertex p = bRep.GetVertex(bRep.indices[count++]);
6131
- Vertex q = bRep.GetVertex(bRep.indices[count++]);
6132
-
6133
- drawVertex(gl, p, selectmode);
6134
- drawVertex(gl, q, selectmode);
6135
-
6136
- for (int j = 0; j < strips[i] - 2; j++)
6137
- {
6138
- Vertex r = bRep.GetVertex(bRep.indices[count++]);
6139
-
6140
-// if (j%2 == 0)
6141
-// drawFace(p, q, r, display, null);
6142
-// else
6143
-// drawFace(p, r, q, display, null);
6144
-
6145
-// p = q;
6146
-// q = r;
6147
- drawVertex(gl, r, selectmode);
6148
- }
6149
-
6150
- gl.glEnd();
6151
- }
6152
- }
6059
+
6060
+ display.DrawGeometry(bRep, flipV, selectmode);
61536061 } else // catch (Error e)
61546062 {
61556063 // TRIANGLE ARRAY
61566064 if (IsOpaque()) // Static())
61576065 {
6158
- gl.glBegin(gl.GL_TRIANGLES);
6066
+ display.StartTriangles();
61596067 int facecount = bRep.FaceCount();
61606068 for (int i = 0; i < facecount; i++)
61616069 {
....@@ -6220,7 +6128,7 @@
62206128
62216129 display.DrawFace(this, p, q, r, face);
62226130 }
6223
- gl.glEnd();
6131
+ display.EndTriangles();
62246132 }
62256133 else
62266134 {
....@@ -6249,8 +6157,8 @@
62496157 //System.out.println("SORT");
62506158
62516159 java.util.Arrays.sort(facescompare);
6252
-
6253
- gl.glBegin(gl.GL_TRIANGLES);
6160
+
6161
+ display.StartTriangles();
62546162 for (int i = 0; i < facecount; i++)
62556163 {
62566164 Face face = bRep.GetFace(facescompare[i].index);
....@@ -6264,11 +6172,12 @@
62646172
62656173 display.DrawFace(this, p, q, r, face);
62666174 }
6267
- gl.glEnd();
6175
+ display.EndTriangles();
62686176 }
62696177
62706178 if (false) // live && support != null && support.bRep != null) // debug weights
62716179 {
6180
+ /*
62726181 gl.glDisable(gl.GL_LIGHTING);
62736182 float[] colorV = new float[3];
62746183
....@@ -6347,6 +6256,7 @@
63476256 // gl.glEnd();
63486257 }
63496258 }
6259
+ */
63506260 }
63516261 }
63526262
....@@ -6405,22 +6315,6 @@
64056315 void Print(Vertex v)
64066316 {
64076317 //System.err.println("(" + v.x + ", " + v.y + ", " + v.z + ")");
6408
- }
6409
-
6410
- void drawVertex(javax.media.opengl.GL gl, Vertex pv, boolean selectmode)
6411
- {
6412
- if (!selectmode)
6413
- {
6414
- gl.glNormal3f((float) pv.norm.x, (float) pv.norm.y, (float) pv.norm.z);
6415
- gl.glColor4f(pv.AO, pv.AO, pv.AO, 1);
6416
-
6417
- if (flipV)
6418
- gl.glTexCoord2f((float) pv.s, 1-(float) pv.t);
6419
- else
6420
- gl.glTexCoord2f((float) pv.s, (float) pv.t);
6421
- }
6422
-
6423
- gl.glVertex3f((float) pv.x, (float) pv.y, (float) pv.z);
64246318 }
64256319
64266320 void drawSelf(ClickInfo info, int level, boolean select)
....@@ -7120,7 +7014,7 @@
71207014 }
71217015
71227016 //System.out.println("info.modifiers = " + info.modifiers);
7123
- modified = (info.modifiers & CameraPane.META) != 0;
7017
+ modified = (info.modifiers & CameraPane.SHIFT) != 0; // Was META
71247018 //System.out.println("modified = " + modified);
71257019 //new Exception().printStackTrace();
71267020 //viewCode = info.pane.renderCamera.viewCode;
....@@ -7148,7 +7042,7 @@
71487042 return true;
71497043 }
71507044
7151
- void doEditDrag0(ClickInfo info)
7045
+ void doEditDrag0(ClickInfo info, boolean opposite)
71527046 {
71537047 if (hitSomething == 0)
71547048 {
....@@ -7175,7 +7069,7 @@
71757069
71767070 scale *= 0.05f * Globals.theRenderer.RenderCamera().Distance();
71777071
7178
- if (modified)
7072
+ if (modified || opposite)
71797073 {
71807074 //assert(false);
71817075 /*
....@@ -7269,6 +7163,7 @@
72697163
72707164 if (modified)
72717165 {
7166
+ // Rotate 90 degrees
72727167 angle /= (Math.PI / 4);
72737168 angle = Math.floor(angle + 0.5);
72747169 angle *= (Math.PI / 4);
....@@ -7503,14 +7398,22 @@
75037398 //return super.toString() + " (id=" + list + ")" + " (brep=" + bRep + ")";
75047399 //return name + " (id=" + list + ")" + " (brep=" + bRep + ") " + super.toString();
75057400 //return name + " (#tri = " + (bRep==null?0:bRep.VertexCount()) + ") " + super.toString();
7401
+
7402
+ String objname;
7403
+
75067404 if (false) //parent != null)
75077405 {
7508
- return name + " " + System.identityHashCode(this) + " (" + parent.name + " " + System.identityHashCode(parent) + ")";
7406
+ objname = name + " " + System.identityHashCode(this) + " (" + parent.name + " " + System.identityHashCode(parent) + ")";
75097407 } else
75107408 {
7511
- return GetName() + (Math.abs(count) == 1000 ? (count == 1000 ? " " : " * ") : (" (" + (count /*- 1*/) + ") ")) + /*(IsSelected()?"(selected) ":"") + (touched?"(touched) ":"") */ +System.identityHashCode(this);
7409
+ objname = GetName() + (Math.abs(count) == 1000 ? (count == 1000 ? " " : " * ") : (" (" + (count /*- 1*/) + ")")) + /*(IsSelected()?"(selected) ":"") + (touched?"(touched) ":"") */ "";
75127410 } // + super.toString();
75137411 //return name + " (" + (SizeOf.deepSizeOf(this)/1024) + "K) " + this.getClass().getName();
7412
+
7413
+ if (!Globals.ADVANCED)
7414
+ return objname;
7415
+
7416
+ return objname + " " + System.identityHashCode(this);
75147417 }
75157418
75167419 public int hashCode()
....@@ -7566,6 +7469,7 @@
75667469 objectUI.closeUI();
75677470 if (editWindow != null)
75687471 {
7472
+ editWindow.ctrlPanel.FlushUI();
75697473 editWindow.refreshContents();
75707474 } // ? new
75717475 objectUI = null;
....@@ -7701,7 +7605,7 @@
77017605 {
77027606 assert(bRep != null);
77037607 if (!(support instanceof GenericJoint)) // support.bRep != null)
7704
- GrafreeD.Assert(support.bRep == bRep.support);
7608
+ Grafreed.Assert(support.bRep == bRep.support);
77057609 }
77067610 else
77077611 {