Normand Briere
2019-06-11 4113164b3be1e50251ac40d6fd65660f0a6c2e63
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;
....@@ -13,11 +14,15 @@
1314 import //weka.core.
1415 matrix.Matrix;
1516
17
+import java.util.UUID;
18
+
1619 //import net.sourceforge.sizeof.SizeOf;
1720 public class Object3D extends Vector<Object3D> implements java.io.Serializable, iSendInfo //, aurelienribon.tweenengine.TweenAccessor<Object3D>
1821 {
1922 //static final long serialVersionUID = -607422624994562685L;
2023 static final long serialVersionUID = 5022536242724664900L;
24
+
25
+ private UUID uuid = UUID.randomUUID();
2126
2227 ScriptNode scriptnode;
2328
....@@ -155,6 +160,67 @@
155160 blockloop = true;
156161 child.RestoreSupports();
157162 blockloop = false;
163
+ }
164
+}
165
+
166
+void ExtractBigData(java.util.Hashtable<java.util.UUID, Object3D> hashtable)
167
+{
168
+ if (hashtable.containsKey(GetUUID()))
169
+ {
170
+ Object3D o = hashtable.get(GetUUID());
171
+
172
+ assert(this.bRep == o.bRep);
173
+ if (this.bRep != null)
174
+ assert(this.bRep.support == o.transientrep);
175
+
176
+ return;
177
+ }
178
+
179
+ Object3D o = new Object3D();
180
+ o.bRep = this.bRep;
181
+ if (this.bRep != null)
182
+ {
183
+ o.transientrep = this.bRep.support;
184
+ o.bRep.support = null;
185
+ }
186
+
187
+// o.support = this.support;
188
+// o.fileparent = this.fileparent;
189
+// if (this.bRep != null)
190
+// o.bRep = this.bRep.support;
191
+
192
+ hashtable.put(GetUUID(), o);
193
+
194
+ this.bRep = null;
195
+// if (this.bRep != null)
196
+// this.bRep.support = null;
197
+// this.support = null;
198
+// this.fileparent = null;
199
+
200
+ for (int i=0; i<Size(); i++)
201
+ {
202
+ get(i).ExtractBigData(hashtable);
203
+ }
204
+}
205
+
206
+void RestoreBigData(java.util.Hashtable<java.util.UUID, Object3D> hashtable)
207
+{
208
+ if (!hashtable.containsKey(GetUUID()))
209
+ return;
210
+
211
+ Object3D o = hashtable.get(GetUUID());
212
+
213
+ this.bRep = o.bRep;
214
+ if (this.bRep != null)
215
+ this.bRep.support = o.transientrep;
216
+// this.support = o.support;
217
+// this.fileparent = o.fileparent;
218
+
219
+ hashtable.remove(GetUUID());
220
+
221
+ for (int i=0; i<Size(); i++)
222
+ {
223
+ get(i).RestoreBigData(hashtable);
158224 }
159225 }
160226
....@@ -299,6 +365,7 @@
299365 }
300366
301367 boolean live = false;
368
+ boolean dontselect = false;
302369 boolean hide = false;
303370 boolean link2master = false; // performs reset support/master at each frame
304371 boolean marked = false; // animation node
....@@ -430,16 +497,16 @@
430497 {
431498 Object3D copy = this;
432499
433
- Camera parentcam = CameraPane.theRenderer.manipCamera;
500
+ Camera parentcam = Globals.theRenderer.ManipCamera();
434501
435
- if (CameraPane.theRenderer.manipCamera == CameraPane.theRenderer.cameras[0])
502
+ if (Globals.theRenderer.ManipCamera() == Globals.theRenderer.Cameras()[0])
436503 {
437
- parentcam = CameraPane.theRenderer.cameras[1];
504
+ parentcam = Globals.theRenderer.Cameras()[1];
438505 }
439506
440
- if (CameraPane.theRenderer.manipCamera == CameraPane.theRenderer.cameras[1])
507
+ if (Globals.theRenderer.ManipCamera() == Globals.theRenderer.Cameras()[1])
441508 {
442
- parentcam = CameraPane.theRenderer.cameras[0];
509
+ parentcam = Globals.theRenderer.Cameras()[0];
443510 }
444511
445512 if (this == parentcam)
....@@ -447,7 +514,7 @@
447514 //assert(this instanceof Camera);
448515
449516 for (int count = parentcam.GetTransformCount(); --count>=0;)
450
- LA.xformPos(CameraPane.theRenderer.targetLookAt, parentcam.toParent, CameraPane.theRenderer.targetLookAt);
517
+ LA.xformPos(Globals.theRenderer.TargetLookAt(), parentcam.toParent, Globals.theRenderer.TargetLookAt());
451518 }
452519
453520 copy.marked ^= true;
....@@ -467,7 +534,7 @@
467534 //assert(this instanceof Camera);
468535
469536 for (int count = parentcam.GetTransformCount(); --count>=0;)
470
- LA.xformPos(CameraPane.theRenderer.targetLookAt, parentcam.fromParent, CameraPane.theRenderer.targetLookAt);
537
+ LA.xformPos(Globals.theRenderer.TargetLookAt(), parentcam.fromParent, Globals.theRenderer.TargetLookAt());
471538 }
472539
473540 copy.Touch(); // display list issue
....@@ -602,7 +669,7 @@
602669 return;
603670 }
604671
605
- if (CameraPane.fromscript)
672
+ if (Globals.fromscript)
606673 {
607674 transformcount = 0;
608675 return;
....@@ -773,7 +840,7 @@
773840 if (step == 0)
774841 step = 1;
775842 if (maxcount == 0)
776
- maxcount = 2048; // 4;
843
+ maxcount = 128; // 2048; // 4;
777844 // if (acceleration == 0)
778845 // acceleration = 10;
779846 if (delay == 0) // serial
....@@ -796,7 +863,7 @@
796863
797864 if (marked && Globals.isLIVE() && live &&
798865 //TEMP21aug2018
799
- Globals.DrawMode() == iCameraPane.SHADOW &&
866
+ (Globals.DrawMode() == iCameraPane.SHADOW || !Globals.RENDERSHADOW) &&
800867 currentframe != Globals.framecount)
801868 {
802869 currentframe = Globals.framecount;
....@@ -911,6 +978,11 @@
911978 fromParent = null; // LA.newMatrix();
912979 bRep = null; // new BoundaryRep();
913980
981
+ if (oname != null && oname.equals("LeftHand"))
982
+ {
983
+ name = oname;
984
+ }
985
+
914986 /*
915987 float hue = (float)Math.random();
916988 Color col;
....@@ -953,7 +1025,7 @@
9531025
9541026 public Object clone()
9551027 {
956
- return GrafreeD.clone(this);
1028
+ return Grafreed.clone(this);
9571029 }
9581030
9591031 Object3D copyExpand()
....@@ -1469,7 +1541,7 @@
14691541 BoundaryRep.SEUIL = other.material.cameralight;
14701542
14711543 // Set default to 0.1
1472
- BoundaryRep.SEUIL /= 2;
1544
+ BoundaryRep.SEUIL /= 4; // 2;
14731545 System.out.println("SEUIL = " + BoundaryRep.SEUIL);
14741546 }
14751547
....@@ -1728,7 +1800,7 @@
17281800 Object3D o = new Object3D((clone?"Ge:":"Li:") + this.name);
17291801 o.bRep = transientrep;
17301802 if (clone)
1731
- o.bRep = (BoundaryRep) GrafreeD.clone(transientrep);
1803
+ o.bRep = (BoundaryRep) Grafreed.clone(transientrep);
17321804 o.CreateMaterial();
17331805 o.SetAttributes(this, -1);
17341806 //parent
....@@ -1741,7 +1813,7 @@
17411813 Object3D o = new Object3D((clone?"Ge:":"Li:") + this.name);
17421814 o.bRep = bRep;
17431815 if (clone)
1744
- o.bRep = (BoundaryRep) GrafreeD.clone(bRep);
1816
+ o.bRep = (BoundaryRep) Grafreed.clone(bRep);
17451817 o.CreateMaterial();
17461818 //o.overwriteThis(this, -1);
17471819 o.SetAttributes(this, -1);
....@@ -1828,12 +1900,15 @@
18281900 if (obj.name == null)
18291901 continue; // can't be a null one
18301902
1903
+ // Try perfect match first.
18311904 if (n.equals(obj.name))
18321905 {
18331906 theobj = obj;
18341907 count++;
18351908 }
18361909 }
1910
+
1911
+ // not needed: n = n.split(":")[0]; // Poser generates a count
18371912
18381913 if (count != 1)
18391914 for (int i=Size(); --i>=0;)
....@@ -2299,6 +2374,7 @@
22992374 {
23002375 if (newWindow)
23012376 {
2377
+ new Exception().printStackTrace();
23022378 System.exit(0);
23032379 if (parent != null)
23042380 {
....@@ -2475,13 +2551,13 @@
24752551 return retval;
24762552 }
24772553
2478
- void doEditDrag(ClickInfo info)
2554
+ void doEditDrag(ClickInfo info, boolean opposite)
24792555 {
24802556 switch (doSomething)
24812557 {
24822558 case 1: // '\001'
24832559 //super.
2484
- doEditDrag0(info);
2560
+ doEditDrag0(info, opposite);
24852561 break;
24862562
24872563 case 2: // '\002'
....@@ -2494,11 +2570,11 @@
24942570 {
24952571 //sel.hitSomething = childToDrag.hitSomething;
24962572 //childToDrag.doEditDrag(info);
2497
- sel.doEditDrag(info);
2573
+ sel.doEditDrag(info, opposite);
24982574 } else
24992575 {
25002576 //super.
2501
- doEditDrag0(info);
2577
+ doEditDrag0(info, opposite);
25022578 }
25032579 }
25042580 break;
....@@ -2905,7 +2981,8 @@
29052981 {
29062982 if (bRep != null)
29072983 {
2908
- bRep.GenUV();
2984
+ bRep.GenUV(); //1);
2985
+ //bRep.UnfoldUV();
29092986 Touch();
29102987 }
29112988 }
....@@ -2980,6 +3057,33 @@
29803057 blockloop = false;
29813058 }
29823059
3060
+ void TransformChildren()
3061
+ {
3062
+ if (toParent != null)
3063
+ {
3064
+ for (int i=Size(); --i>=0;)
3065
+ {
3066
+ Object3D v = get(i);
3067
+
3068
+ if (v.toParent == null)
3069
+ {
3070
+ v.toParent = LA.newMatrix();
3071
+ v.fromParent = LA.newMatrix();
3072
+ }
3073
+
3074
+// LA.matConcat(v.toParent, toParent, v.toParent);
3075
+// LA.matConcat(fromParent, v.fromParent, v.fromParent);
3076
+ LA.matConcat(toParent, v.toParent, v.toParent);
3077
+ LA.matConcat(v.fromParent, fromParent, v.fromParent);
3078
+ }
3079
+
3080
+ toParent = null; // LA.matIdentity(toParent);
3081
+ fromParent = null; // LA.matIdentity(fromParent);
3082
+
3083
+ Touch();
3084
+ }
3085
+ }
3086
+
29833087 void TransformGeometry()
29843088 {
29853089 Object3D obj = this;
....@@ -3201,9 +3305,11 @@
32013305
32023306 BoundaryRep sup = bRep.support;
32033307 bRep.support = null;
3204
- BoundaryRep temprep = (BoundaryRep) GrafreeD.clone(bRep);
3308
+ BoundaryRep temprep = (BoundaryRep) Grafreed.clone(bRep);
32053309 // bRep.SplitInTwo(onlyone); // thread...
3206
- temprep.SplitInTwo(reduction34, onlyone);
3310
+
3311
+ while(temprep.SplitInTwo(reduction34, onlyone));
3312
+
32073313 bRep = temprep;
32083314 bRep.support = sup;
32093315 Touch();
....@@ -3725,7 +3831,7 @@
37253831 if (child == null)
37263832 continue;
37273833
3728
- if (GrafreeD.RENDERME > 0)
3834
+ if (Grafreed.RENDERME > 0)
37293835 {
37303836 if (child instanceof Merge)
37313837 ((Merge)child).renderme();
....@@ -3876,7 +3982,7 @@
38763982 if (child == null)
38773983 continue;
38783984
3879
- if (GrafreeD.RENDERME > 0)
3985
+ if (Grafreed.RENDERME > 0)
38803986 {
38813987 if (child instanceof Merge)
38823988 ((Merge)child).renderme();
....@@ -4071,7 +4177,7 @@
40714177 if (child == null)
40724178 continue;
40734179
4074
- if (GrafreeD.RENDERME > 0)
4180
+ if (Grafreed.RENDERME > 0)
40754181 {
40764182 if (child instanceof Merge)
40774183 ((Merge)child).renderme();
....@@ -4678,7 +4784,7 @@
46784784
46794785 cTreePath SelectLeaf(int indexcount, boolean deselect)
46804786 {
4681
- if (hide)
4787
+ if (hide || dontselect)
46824788 return null;
46834789
46844790 if (count <= 0)
....@@ -4704,7 +4810,7 @@
47044810
47054811 cTreePath Select(int indexcount, boolean deselect)
47064812 {
4707
- if (hide)
4813
+ if (hide || dontselect)
47084814 return null;
47094815
47104816 if (count <= 0)
....@@ -4854,7 +4960,7 @@
48544960 return globalTransform;
48554961 }
48564962
4857
- void PreprocessOcclusion(CameraPane cp)
4963
+ void PreprocessOcclusion(iCameraPane cp)
48584964 {
48594965 /*
48604966 if (AOdone)
....@@ -5156,10 +5262,34 @@
51565262
51575263 // System.out.println("Fullname = " + fullname);
51585264
5159
- if (fullname.name.indexOf(":") == -1)
5160
- return fullname.name;
5265
+ // Does not work on Windows due to C:
5266
+// if (fullname.name.indexOf(":") == -1)
5267
+// return fullname.name;
5268
+//
5269
+// return fullname.name.substring(0,fullname.name.indexOf(":"));
51615270
5162
- return fullname.name.substring(0,fullname.name.indexOf(":"));
5271
+ String[] split = fullname.name.split(":");
5272
+
5273
+ if (split.length == 0)
5274
+ {
5275
+ return "";
5276
+ }
5277
+
5278
+ if (split.length <= 2)
5279
+ {
5280
+ if (fullname.name.endsWith(":"))
5281
+ {
5282
+ // Windows
5283
+ return fullname.name.substring(0, fullname.name.length()-1);
5284
+ }
5285
+
5286
+ return split[0];
5287
+ }
5288
+
5289
+ // Windows
5290
+ assert(split.length == 4);
5291
+
5292
+ return split[0] + ":" + split[1];
51635293 }
51645294
51655295 static String GetBump(cTexture fullname)
....@@ -5168,10 +5298,38 @@
51685298 return "";
51695299
51705300 // 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());
5301
+ // Does not work on Windows due to C:
5302
+// if (fullname.name.indexOf(":") == -1)
5303
+// return "";
5304
+//
5305
+// return fullname.name.substring(fullname.name.indexOf(":")+1,fullname.name.length());
5306
+ String[] split = fullname.name.split(":");
5307
+
5308
+ if (split.length == 0)
5309
+ {
5310
+ return "";
5311
+ }
5312
+
5313
+ if (split.length == 1)
5314
+ {
5315
+ return "";
5316
+ }
5317
+
5318
+ if (split.length == 2)
5319
+ {
5320
+ if (fullname.name.endsWith(":"))
5321
+ {
5322
+ // Windows
5323
+ return "";
5324
+ }
5325
+
5326
+ return split[1];
5327
+ }
5328
+
5329
+ // Windows
5330
+ assert(split.length == 4);
5331
+
5332
+ return split[2] + ":" + split[3];
51755333 }
51765334
51775335 String GetPigmentTexture()
....@@ -5245,7 +5403,7 @@
52455403 System.out.print("; textures = " + textures);
52465404 System.out.println("; usedtextures = " + usedtextures);
52475405
5248
- if (GetTextures() == null)
5406
+ if (GetTextures() == null) // What is that??
52495407 GetTextures().name = ":";
52505408
52515409 String texname = tex;
....@@ -5276,6 +5434,43 @@
52765434 child.ResetPigmentTexture();
52775435 blockloop = false;
52785436 }
5437
+ }
5438
+
5439
+ UUID GetUUID()
5440
+ {
5441
+ if (uuid == null)
5442
+ {
5443
+ // Serial
5444
+ uuid = UUID.randomUUID();
5445
+ }
5446
+
5447
+ return uuid;
5448
+ }
5449
+
5450
+ Object3D GetObject(UUID uid)
5451
+ {
5452
+ if (blockloop)
5453
+ return null;
5454
+
5455
+ if (GetUUID().equals(uid))
5456
+ return this;
5457
+
5458
+ int nb = Size();
5459
+ for (int i = 0; i < nb; i++)
5460
+ {
5461
+ Object3D child = (Object3D) get(i);
5462
+
5463
+ if (child == null)
5464
+ continue;
5465
+
5466
+ blockloop = true;
5467
+ Object3D obj = child.GetObject(uid);
5468
+ blockloop = false;
5469
+ if (obj != null)
5470
+ return obj;
5471
+ }
5472
+
5473
+ return null;
52795474 }
52805475
52815476 void SetBumpTexture(String tex)
....@@ -5322,11 +5517,12 @@
53225517 boolean NeedSupport()
53235518 {
53245519 return
5325
- CameraPane.SUPPORT && !CameraPane.movingcamera && link2master && /*live &&*/ support != null
5520
+ CameraPane.SUPPORT && (!CameraPane.movingcamera || !Globals.FREEZEONMOVE) && link2master && /*live &&*/ support != null
53265521 // PROBLEM with CROWD!!
5327
- && (Globals.DrawMode() == iCameraPane.SHADOW || Globals.CROWD);
5522
+ && (Globals.DrawMode() == iCameraPane.SHADOW || !Globals.RENDERSHADOW || Globals.CROWD);
53285523 }
53295524
5525
+ static boolean DEBUG_SELECTION = false;
53305526
53315527 void Draw(iCameraPane display, Object3D /*Composite*/ root, boolean selected, boolean blocked)
53325528 {
....@@ -5338,7 +5534,7 @@
53385534 }
53395535
53405536 if (display.DrawMode() == iCameraPane.SELECTION &&
5341
- hide)
5537
+ (hide || dontselect))
53425538 return;
53435539
53445540 if (name != null && name.contains("sclera"))
....@@ -5365,12 +5561,12 @@
53655561 }
53665562
53675563 if ((//display.DrawMode() == CameraPane.SHADOW ||
5368
- display.DrawMode() == CameraPane.SELECTION || CameraPane.DEBUG_SELECTION) && HasTransparency())
5564
+ display.DrawMode() == iCameraPane.SELECTION || display.IsDebugSelection()) && HasTransparency())
53695565 {
53705566 return;
53715567 }
53725568
5373
- javax.media.opengl.GL gl = display.GetGL();
5569
+ //javax.media.opengl.GL gl = display.GetGL();
53745570
53755571 /*
53765572 if (touched)
....@@ -5406,7 +5602,7 @@
54065602
54075603 boolean compiled = false;
54085604
5409
- boolean selectmode = display.DrawMode() == display.SELECTION || CameraPane.DEBUG_SELECTION;
5605
+ boolean selectmode = display.DrawMode() == display.SELECTION || display.IsDebugSelection();
54105606
54115607 if (!selectmode && //display.DrawMode() != display.SELECTION &&
54125608 (touched || (bRep != null && bRep.displaylist <= 0)))
....@@ -5422,7 +5618,7 @@
54225618 //if (displaylist == -1 && usecalllists)
54235619 if ((bRep != null && bRep.displaylist <= 0) && usecalllists) // june 2013
54245620 {
5425
- bRep.displaylist = gl.glGenLists(1);
5621
+ bRep.displaylist = display.GenList();
54265622 assert(bRep.displaylist != 0);
54275623 // System.err.println("glGenLists: " + bRep.displaylist + " for " + this);
54285624 //System.out.println("\tgen list " + list);
....@@ -5434,14 +5630,16 @@
54345630 if (usecalllists)
54355631 {
54365632 // System.err.println("new list " + bRep.displaylist + " for " + this);
5437
- gl.glNewList(bRep.displaylist, gl.GL_COMPILE); //_AND_EXECUTE);
5633
+ display.NewList(bRep.displaylist);
54385634 }
5635
+
54395636 CallList(display, root, selected, blocked);
5637
+
54405638 // compiled = true;
54415639 if (usecalllists)
54425640 {
54435641 // System.err.println("end list " + bRep.displaylist + " for " + this);
5444
- gl.glEndList();
5642
+ display.EndList();
54455643 }
54465644 //gl.glDrawBuffer(gl.GL_BACK);
54475645 // XXX touched = false;
....@@ -5484,12 +5682,12 @@
54845682
54855683 // frustum culling
54865684 if (CameraPane.FRUSTUM && !blocked && !IsInfinite() && GetBRep() != null // && GetBRep().VertexCount() != 1260 // default grid
5487
- && display.DrawMode() != CameraPane.SELECTION)
5685
+ && display.DrawMode() != iCameraPane.SELECTION)
54885686 {
5489
- if (display.DrawMode() == CameraPane.SHADOW)
5687
+ if (display.DrawMode() == iCameraPane.SHADOW)
54905688 {
54915689 if (!link2master // tricky to cull in shadow mode.
5492
- && GetBRep().FrustumCull(this, gl, display.LightCamera(), true))
5690
+ && GetBRep().FrustumCull(this, null, display.LightCamera(), true))
54935691 {
54945692 //System.out.print("CULLED");
54955693 culled = true;
....@@ -5497,7 +5695,7 @@
54975695 }
54985696 else
54995697 //GetBRep().getBounds(v0, v1, this);
5500
- if (GetBRep().FrustumCull(this, gl, display.RenderCamera(), false))
5698
+ if (GetBRep().FrustumCull(this, null, display.RenderCamera(), false))
55015699 culled = true;
55025700
55035701 // LA.xformPos(v0, display.renderCamera.toScreen, v0);
....@@ -5533,11 +5731,11 @@
55335731
55345732
55355733 if (!culled)
5536
- if (display.DrawMode() == display.SELECTION || CameraPane.DEBUG_SELECTION)
5734
+ if (display.DrawMode() == display.SELECTION || display.IsDebugSelection())
55375735 {
55385736 if (GetBRep() != null)
55395737 {
5540
- CameraPane.NextIndex(this, gl);
5738
+ display.NextIndex();
55415739 // vertex color conflict : gl.glCallList(list);
55425740 DrawNode(display, root, selected);
55435741 if (this instanceof BezierPatch)
....@@ -5578,7 +5776,17 @@
55785776 tex = GetTextures();
55795777 }
55805778
5581
- display.BindTextures(tex, texres);
5779
+ boolean failed = false;
5780
+
5781
+ try
5782
+ {
5783
+ display.BindTextures(tex, texres);
5784
+ }
5785
+ catch (Exception e)
5786
+ {
5787
+ System.err.println("FAILED: " + this);
5788
+ failed = true;
5789
+ }
55825790
55835791 if (!compiled)
55845792 {
....@@ -5594,13 +5802,14 @@
55945802
55955803 // System.err.println("glCallList: " + bRep.displaylist + " for " + this);
55965804 assert(bRep.displaylist != 0);
5597
- gl.glCallList(bRep.displaylist);
5805
+ display.CallList(bRep.displaylist);
55985806 // june 2013 drawSelf(display, root, selected);
55995807 }
56005808 }
56015809 }
56025810
5603
- display.ReleaseTextures(tex);
5811
+ if (!failed)
5812
+ display.ReleaseTextures(tex);
56045813
56055814 display.PopMaterial(this, selected);
56065815 }
....@@ -5729,6 +5938,9 @@
57295938
57305939 void drawSelf(iCameraPane display, Object3D /*Composite*/ root, boolean selected, boolean blocked)
57315940 {
5941
+ if (display.DrawMode() == iCameraPane.SELECTION && dontselect)
5942
+ return;
5943
+
57325944 if (hide)
57335945 return;
57345946 // shadow optimisation
....@@ -5854,6 +6066,9 @@
58546066 if (display.DrawMode() == display.SHADOW && projectedVertices != null && projectedVertices.length > 2 && projectedVertices[2].y >= 10000)
58556067 return; // no shadow for transparent objects
58566068
6069
+ if (display.DrawMode() == iCameraPane.SELECTION && dontselect)
6070
+ return;
6071
+
58576072 if (hide)
58586073 return;
58596074
....@@ -5894,9 +6109,10 @@
58946109 return;
58956110 }
58966111
6112
+ //bRep.GenUV(1/material.diffuseness);
58976113 // bRep.lock = true;
58986114
5899
- javax.media.opengl.GL gl = display.GetGL();
6115
+ //javax.media.opengl.GL gl = display.GetGL();
59006116
59016117 if (CameraPane.BOXMODE && !selected) // || CameraPane.movingcamera)
59026118 {
....@@ -5913,23 +6129,7 @@
59136129
59146130 bRep.getMinMax(min, max, 100);
59156131
5916
- gl.glBegin(gl.GL_LINES);
5917
-
5918
- gl.glVertex3d(min.x, min.y, min.z);
5919
- gl.glVertex3d(min.x, min.y, max.z);
5920
- gl.glVertex3d(min.x, min.y, min.z);
5921
- gl.glVertex3d(min.x, max.y, min.z);
5922
- gl.glVertex3d(min.x, min.y, min.z);
5923
- gl.glVertex3d(max.x, min.y, min.z);
5924
-
5925
- gl.glVertex3d(max.x, max.y, max.z);
5926
- gl.glVertex3d(min.x, max.y, max.z);
5927
- gl.glVertex3d(max.x, max.y, max.z);
5928
- gl.glVertex3d(max.x, min.y, max.z);
5929
- gl.glVertex3d(max.x, max.y, max.z);
5930
- gl.glVertex3d(max.x, max.y, min.z);
5931
-
5932
- gl.glEnd();
6132
+ display.DrawBox(min, max);
59336133
59346134 return;
59356135 }
....@@ -5973,7 +6173,7 @@
59736173 {
59746174 //throw new Error();
59756175
5976
- boolean selectmode = display.DrawMode() == display.SELECTION || CameraPane.DEBUG_SELECTION;
6176
+ boolean selectmode = display.DrawMode() == display.SELECTION || display.IsDebugSelection();
59776177
59786178 int[] strips = bRep.getRawIndices();
59796179
....@@ -5983,178 +6183,14 @@
59836183 new Exception().printStackTrace();
59846184 return;
59856185 }
5986
-
5987
- // TRIANGLE STRIP ARRAY
5988
- if (bRep.trimmed)
5989
- {
5990
- float[] v = bRep.getRawVertices();
5991
- float[] n = bRep.getRawNormals();
5992
- float[] c = bRep.getRawColors();
5993
- float[] uv = bRep.getRawUVMap();
5994
-
5995
- int count2 = 0;
5996
- int count3 = 0;
5997
-
5998
- if (n.length > 0)
5999
- {
6000
- for (int i = 0; i < strips.length; i++)
6001
- {
6002
- gl.glBegin(gl.GL_TRIANGLE_STRIP);
6003
-
6004
- /*
6005
- boolean locked = false;
6006
- float eps = 0.1f;
6007
- boolean wrap = CameraPane.UVWRAP; // true; // UV WRAP TEXTURE ISSUE: true = artifacts, false = nice
6008
-
6009
- int dot = 0;
6010
-
6011
- if ((dot&1) == 0)
6012
- dot |= (Math.abs(qv.s - pv.s) < eps && Math.abs(qv.t - pv.t) < eps) ? 3 : 1;
6013
-
6014
- if (wrap || (dot&2) != 0) // Math.abs(qv.s - pv.s) < eps && Math.abs(qv.t - pv.t) < eps)
6015
- gl.glTexCoord2f((float) qv.s, (float) qv.t);
6016
- else
6017
- {
6018
- locked = true;
6019
- gl.glTexCoord2f((float) pv.s, (float) pv.t);
6020
- }
6021
- //System.out.println("vertexq = " + qv.x + ", " + qv.y + ", " + qv.z);
6022
- gl.glVertex3f((float) qv.x, (float) qv.y, (float) qv.z);
6023
- if (hasnorm)
6024
- {
6025
- //System.out.println("normalr = " + rv.norm.x + ", " + rv.norm.y + ", " + rv.norm.z);
6026
- gl.glNormal3f((float) rv.norm.x, (float) rv.norm.y, (float) rv.norm.z);
6027
- }
6028
-
6029
- if ((dot&4) == 0)
6030
- dot |= (Math.abs(rv.s - pv.s) < eps && Math.abs(rv.t - pv.t) < eps) ? 12 : 4;
6031
-
6032
- if (wrap || !locked && (dot&8) != 0)
6033
- gl.glTexCoord2f((float) rv.s, (float) rv.t);
6034
- else
6035
- gl.glTexCoord2f((float) pv.s, (float) pv.t);
6036
-
6037
- f.dot = dot;
6038
- */
6039
-
6040
- if (!selectmode)
6041
- {
6042
- if (n[count3] != 0 || n[count3 + 1] != 0 || n[count3 + 2] != 0)
6043
- {
6044
- gl.glNormal3f(n[count3], n[count3 + 1], n[count3 + 2]);
6045
- } else
6046
- {
6047
- gl.glNormal3f(0, 0, 1);
6048
- }
6049
-
6050
- if (c != null)
6051
- //System.out.println("glcolor = " + c[count3] + ", " + c[count3+1] + ", " + c[count3+2]);
6052
- {
6053
- gl.glColor4f(c[count3/3], c[count3/3 /* + 1*/], c[count3/3 /* + 2*/], 1);
6054
- }
6055
- }
6056
- if (flipV)
6057
- gl.glTexCoord2f(uv[count2], 1-uv[count2 + 1]);
6058
- else
6059
- gl.glTexCoord2f(uv[count2], uv[count2 + 1]);
6060
- //System.out.println("vertex1 = " + v[count3] + ", " + v[count3+1] + ", " + v[count3+2]);
6061
- gl.glVertex3f(v[count3], v[count3 + 1], v[count3 + 2]);
6062
-
6063
- count2 += 2;
6064
- count3 += 3;
6065
- if (!selectmode)
6066
- {
6067
- if (n[count3] != 0 || n[count3 + 1] != 0 || n[count3 + 2] != 0)
6068
- {
6069
- gl.glNormal3f(n[count3], n[count3 + 1], n[count3 + 2]);
6070
- } else
6071
- {
6072
- gl.glNormal3f(0, 0, 1);
6073
- }
6074
- if (c != null)
6075
- {
6076
- gl.glColor4f(c[count3/3], c[count3/3 /* + 1*/], c[count3/3 /* + 2*/], 1);
6077
- }
6078
- }
6079
- if (flipV)
6080
- gl.glTexCoord2f(uv[count2], 1-uv[count2 + 1]);
6081
- else
6082
- gl.glTexCoord2f(uv[count2], uv[count2 + 1]);
6083
- //System.out.println("vertex2 = " + v[count3] + ", " + v[count3+1] + ", " + v[count3+2]);
6084
- gl.glVertex3f(v[count3], v[count3 + 1], v[count3 + 2]);
6085
-
6086
- count2 += 2;
6087
- count3 += 3;
6088
- for (int j = 0; j < strips[i] - 2; j++)
6089
- {
6090
- //gl.glTexCoord2d(...);
6091
- if (!selectmode)
6092
- {
6093
- if (n[count3] != 0 || n[count3 + 1] != 0 || n[count3 + 2] != 0)
6094
- {
6095
- gl.glNormal3f(n[count3], n[count3 + 1], n[count3 + 2]);
6096
- } else
6097
- {
6098
- gl.glNormal3f(0, 0, 1);
6099
- }
6100
- if (c != null)
6101
- {
6102
- gl.glColor4f(c[count3/3], c[count3/3 /* + 1*/], c[count3/3 /* + 2*/], 1);
6103
- }
6104
- }
6105
-
6106
- if (flipV)
6107
- gl.glTexCoord2f(uv[count2], 1-uv[count2 + 1]);
6108
- else
6109
- gl.glTexCoord2f(uv[count2], uv[count2 + 1]);
6110
- //System.out.println("coord3 = " + uv[count2] + ", " + uv[count2+1]);
6111
- gl.glVertex3f(v[count3], v[count3 + 1], v[count3 + 2]);
6112
- count2 += 2;
6113
- count3 += 3;
6114
- }
6115
-
6116
- gl.glEnd();
6117
- }
6118
- }
6119
-
6120
- assert count3 == v.length;
6121
- }
6122
- else // !trimmed
6123
- {
6124
- int count = 0;
6125
- for (int i = 0; i < strips.length; i++)
6126
- {
6127
- gl.glBegin(gl.GL_TRIANGLE_STRIP);
6128
-
6129
- Vertex p = bRep.GetVertex(bRep.indices[count++]);
6130
- Vertex q = bRep.GetVertex(bRep.indices[count++]);
6131
-
6132
- drawVertex(gl, p, selectmode);
6133
- drawVertex(gl, q, selectmode);
6134
-
6135
- for (int j = 0; j < strips[i] - 2; j++)
6136
- {
6137
- Vertex r = bRep.GetVertex(bRep.indices[count++]);
6138
-
6139
-// if (j%2 == 0)
6140
-// drawFace(p, q, r, display, null);
6141
-// else
6142
-// drawFace(p, r, q, display, null);
6143
-
6144
-// p = q;
6145
-// q = r;
6146
- drawVertex(gl, r, selectmode);
6147
- }
6148
-
6149
- gl.glEnd();
6150
- }
6151
- }
6186
+
6187
+ display.DrawGeometry(bRep, flipV, selectmode);
61526188 } else // catch (Error e)
61536189 {
61546190 // TRIANGLE ARRAY
61556191 if (IsOpaque()) // Static())
61566192 {
6157
- gl.glBegin(gl.GL_TRIANGLES);
6193
+ display.StartTriangles();
61586194 int facecount = bRep.FaceCount();
61596195 for (int i = 0; i < facecount; i++)
61606196 {
....@@ -6219,7 +6255,7 @@
62196255
62206256 display.DrawFace(this, p, q, r, face);
62216257 }
6222
- gl.glEnd();
6258
+ display.EndTriangles();
62236259 }
62246260 else
62256261 {
....@@ -6248,8 +6284,8 @@
62486284 //System.out.println("SORT");
62496285
62506286 java.util.Arrays.sort(facescompare);
6251
-
6252
- gl.glBegin(gl.GL_TRIANGLES);
6287
+
6288
+ display.StartTriangles();
62536289 for (int i = 0; i < facecount; i++)
62546290 {
62556291 Face face = bRep.GetFace(facescompare[i].index);
....@@ -6263,11 +6299,12 @@
62636299
62646300 display.DrawFace(this, p, q, r, face);
62656301 }
6266
- gl.glEnd();
6302
+ display.EndTriangles();
62676303 }
62686304
62696305 if (false) // live && support != null && support.bRep != null) // debug weights
62706306 {
6307
+ /*
62716308 gl.glDisable(gl.GL_LIGHTING);
62726309 float[] colorV = new float[3];
62736310
....@@ -6346,6 +6383,7 @@
63466383 // gl.glEnd();
63476384 }
63486385 }
6386
+ */
63496387 }
63506388 }
63516389
....@@ -6390,7 +6428,7 @@
63906428 center.add(r);
63916429 center.mul(1.0/3);
63926430
6393
- center.sub(CameraPane.theRenderer.eyeCamera.location);
6431
+ center.sub(Globals.theRenderer.EyeCamera().location);
63946432
63956433 distance = center.dot(center);
63966434 }
....@@ -6404,22 +6442,6 @@
64046442 void Print(Vertex v)
64056443 {
64066444 //System.err.println("(" + v.x + ", " + v.y + ", " + v.z + ")");
6407
- }
6408
-
6409
- void drawVertex(javax.media.opengl.GL gl, Vertex pv, boolean selectmode)
6410
- {
6411
- if (!selectmode)
6412
- {
6413
- gl.glNormal3f((float) pv.norm.x, (float) pv.norm.y, (float) pv.norm.z);
6414
- gl.glColor4f(pv.AO, pv.AO, pv.AO, 1);
6415
-
6416
- if (flipV)
6417
- gl.glTexCoord2f((float) pv.s, 1-(float) pv.t);
6418
- else
6419
- gl.glTexCoord2f((float) pv.s, (float) pv.t);
6420
- }
6421
-
6422
- gl.glVertex3f((float) pv.x, (float) pv.y, (float) pv.z);
64236445 }
64246446
64256447 void drawSelf(ClickInfo info, int level, boolean select)
....@@ -6993,83 +7015,83 @@
69937015 int spotw = spot.x + spot.width;
69947016 int spoth = spot.y + spot.height;
69957017 info.g.fillRect(spot.x, spot.y, spot.width, spot.height);
6996
- if (CameraPane.Xmin > spot.x)
6997
- {
6998
- CameraPane.Xmin = spot.x;
6999
- }
7000
- if (CameraPane.Xmax < spotw)
7001
- {
7002
- CameraPane.Xmax = spotw;
7003
- }
7004
- if (CameraPane.Ymin > spot.y)
7005
- {
7006
- CameraPane.Ymin = spot.y;
7007
- }
7008
- if (CameraPane.Ymax < spoth)
7009
- {
7010
- CameraPane.Ymax = spoth;
7011
- }
7018
+// if (CameraPane.Xmin > spot.x)
7019
+// {
7020
+// CameraPane.Xmin = spot.x;
7021
+// }
7022
+// if (CameraPane.Xmax < spotw)
7023
+// {
7024
+// CameraPane.Xmax = spotw;
7025
+// }
7026
+// if (CameraPane.Ymin > spot.y)
7027
+// {
7028
+// CameraPane.Ymin = spot.y;
7029
+// }
7030
+// if (CameraPane.Ymax < spoth)
7031
+// {
7032
+// CameraPane.Ymax = spoth;
7033
+// }
70127034 spot.translate(32, 32);
70137035 spotw = spot.x + spot.width;
70147036 spoth = spot.y + spot.height;
70157037 info.g.setColor(Color.blue);
70167038 info.g.fillRect(spot.x, spot.y, spot.width, spot.height);
7017
- if (CameraPane.Xmin > spot.x)
7018
- {
7019
- CameraPane.Xmin = spot.x;
7020
- }
7021
- if (CameraPane.Xmax < spotw)
7022
- {
7023
- CameraPane.Xmax = spotw;
7024
- }
7025
- if (CameraPane.Ymin > spot.y)
7026
- {
7027
- CameraPane.Ymin = spot.y;
7028
- }
7029
- if (CameraPane.Ymax < spoth)
7030
- {
7031
- CameraPane.Ymax = spoth;
7032
- }
7033
- info.g.drawLine(spotw, spoth, spotw, spoth - 15);
7034
- info.g.drawLine(spotw, spoth, spotw - 15, spoth);
7039
+// if (CameraPane.Xmin > spot.x)
7040
+// {
7041
+// CameraPane.Xmin = spot.x;
7042
+// }
7043
+// if (CameraPane.Xmax < spotw)
7044
+// {
7045
+// CameraPane.Xmax = spotw;
7046
+// }
7047
+// if (CameraPane.Ymin > spot.y)
7048
+// {
7049
+// CameraPane.Ymin = spot.y;
7050
+// }
7051
+// if (CameraPane.Ymax < spoth)
7052
+// {
7053
+// CameraPane.Ymax = spoth;
7054
+// }
7055
+ // bonhommes info.g.drawLine(spotw, spoth, spotw, spoth - 15);
7056
+ //info.g.drawLine(spotw, spoth, spotw - 15, spoth);
70357057 spot.translate(0, -32);
70367058 info.g.setColor(Color.green);
70377059 info.g.fillRect(spot.x, spot.y, spot.width, spot.height);
7038
- if (CameraPane.Xmin > spot.x)
7039
- {
7040
- CameraPane.Xmin = spot.x;
7041
- }
7042
- if (CameraPane.Xmax < spotw)
7043
- {
7044
- CameraPane.Xmax = spotw;
7045
- }
7046
- if (CameraPane.Ymin > spot.y)
7047
- {
7048
- CameraPane.Ymin = spot.y;
7049
- }
7050
- if (CameraPane.Ymax < spoth)
7051
- {
7052
- CameraPane.Ymax = spoth;
7053
- }
7060
+// if (CameraPane.Xmin > spot.x)
7061
+// {
7062
+// CameraPane.Xmin = spot.x;
7063
+// }
7064
+// if (CameraPane.Xmax < spotw)
7065
+// {
7066
+// CameraPane.Xmax = spotw;
7067
+// }
7068
+// if (CameraPane.Ymin > spot.y)
7069
+// {
7070
+// CameraPane.Ymin = spot.y;
7071
+// }
7072
+// if (CameraPane.Ymax < spoth)
7073
+// {
7074
+// CameraPane.Ymax = spoth;
7075
+// }
70547076 info.g.drawArc(boundary.x, boundary.y,
70557077 boundary.width, boundary.height, 0, 360);
70567078 //info.g.drawArc(spot.x, spotw, spot.width/2, boundary.height/2, 0, 360);
7057
- if (CameraPane.Xmin > boundary.x)
7058
- {
7059
- CameraPane.Xmin = boundary.x;
7060
- }
7061
- if (CameraPane.Xmax < boundary.x + boundary.width)
7062
- {
7063
- CameraPane.Xmax = boundary.x + boundary.width;
7064
- }
7065
- if (CameraPane.Ymin > boundary.y)
7066
- {
7067
- CameraPane.Ymin = boundary.y;
7068
- }
7069
- if (CameraPane.Ymax < boundary.y + boundary.height)
7070
- {
7071
- CameraPane.Ymax = boundary.y + boundary.height;
7072
- }
7079
+// if (CameraPane.Xmin > boundary.x)
7080
+// {
7081
+// CameraPane.Xmin = boundary.x;
7082
+// }
7083
+// if (CameraPane.Xmax < boundary.x + boundary.width)
7084
+// {
7085
+// CameraPane.Xmax = boundary.x + boundary.width;
7086
+// }
7087
+// if (CameraPane.Ymin > boundary.y)
7088
+// {
7089
+// CameraPane.Ymin = boundary.y;
7090
+// }
7091
+// if (CameraPane.Ymax < boundary.y + boundary.height)
7092
+// {
7093
+// CameraPane.Ymax = boundary.y + boundary.height;
7094
+// }
70737095 return;
70747096 }
70757097 }
....@@ -7086,7 +7108,7 @@
70867108 startX = info.x;
70877109 startY = info.y;
70887110
7089
- hitSomething = 0;
7111
+ hitSomething = -1;
70907112 cVector origin = new cVector();
70917113 //LA.xformPos(origin, toParent, origin);
70927114 Rectangle spot = new Rectangle();
....@@ -7119,7 +7141,7 @@
71197141 }
71207142
71217143 //System.out.println("info.modifiers = " + info.modifiers);
7122
- modified = (info.modifiers & CameraPane.META) != 0;
7144
+ modified = (info.modifiers & CameraPane.SHIFT) != 0; // Was META
71237145 //System.out.println("modified = " + modified);
71247146 //new Exception().printStackTrace();
71257147 //viewCode = info.pane.renderCamera.viewCode;
....@@ -7147,7 +7169,7 @@
71477169 return true;
71487170 }
71497171
7150
- void doEditDrag0(ClickInfo info)
7172
+ void doEditDrag0(ClickInfo info, boolean opposite)
71517173 {
71527174 if (hitSomething == 0)
71537175 {
....@@ -7162,6 +7184,7 @@
71627184 //System.out.println("hitSomething = " + hitSomething);
71637185
71647186 double scale = 0.005f * info.camera.Distance();
7187
+
71657188 cVector xlate = new cVector();
71667189 //cVector xlate2 = new cVector();
71677190 switch (hitSomething)
....@@ -7172,9 +7195,9 @@
71727195
71737196 case hitCenter: // Translate
71747197
7175
- scale *= 0.05f * info.pane.theRenderer.renderCamera.Distance();
7198
+ scale *= 0.05f * Globals.theRenderer.RenderCamera().Distance();
71767199
7177
- if (modified)
7200
+ if (modified || opposite)
71787201 {
71797202 //assert(false);
71807203 /*
....@@ -7220,10 +7243,10 @@
72207243 }
72217244 LA.xformDir(up, ClickInfo.matbuffer, up);
72227245 // if (!CameraPane.LOCALTRANSFORM)
7223
- LA.xformDir(up, info.pane.theRenderer.renderCamera.toScreen, up);
7246
+ LA.xformDir(up, Globals.theRenderer.RenderCamera().toScreen, up);
72247247 LA.xformDir(info.camera.away, ClickInfo.matbuffer, away);
72257248 // if (!CameraPane.LOCALTRANSFORM)
7226
- LA.xformDir(away, info.pane.theRenderer.renderCamera.toScreen, away);
7249
+ LA.xformDir(away, Globals.theRenderer.RenderCamera().toScreen, away);
72277250 //LA.vecCross(up, cVector.Z, right2);
72287251
72297252 cVector delta = LA.newVector(info.x - startX, startY - info.y, 0);
....@@ -7268,6 +7291,7 @@
72687291
72697292 if (modified)
72707293 {
7294
+ // Rotate 90 degrees
72717295 angle /= (Math.PI / 4);
72727296 angle = Math.floor(angle + 0.5);
72737297 angle *= (Math.PI / 4);
....@@ -7281,7 +7305,7 @@
72817305 }
72827306 /**/
72837307
7284
- switch (info.pane.renderCamera.viewCode)
7308
+ switch (info.pane.RenderCamera().viewCode)
72857309 {
72867310 case 1: // '\001'
72877311 LA.matZRotate(toParent, angle);
....@@ -7309,24 +7333,27 @@
73097333
73107334 case hitScale: // scale
73117335 double hScale = (double) (info.x - centerPt.x) / 32;
7336
+ double sign = 1;
7337
+ if (hScale < 0)
7338
+ {
7339
+ sign = -1;
7340
+ }
7341
+ hScale = sign*Math.pow(sign*hScale, scale * 50);
73127342 if (hScale < 0.01)
73137343 {
7314
- hScale = 0.01;
7344
+ //hScale = 0.01;
73157345 }
7316
- hScale = Math.pow(hScale, scale * 50);
7317
- if (hScale < 0.01)
7318
- {
7319
- hScale = 0.01;
7320
- }
7346
+
73217347 double vScale = (double) (info.y - centerPt.y) / 32;
7322
- if (vScale < 0.01)
7348
+ sign = 1;
7349
+ if (vScale < 0)
73237350 {
7324
- vScale = 0.01;
7351
+ sign = -1;
73257352 }
7326
- vScale = Math.pow(vScale, scale * 50);
7353
+ vScale = sign*Math.pow(sign*vScale, scale * 50);
73277354 if (vScale < 0.01)
73287355 {
7329
- vScale = 0.01;
7356
+ //vScale = 0.01;
73307357 }
73317358 LA.matCopy(startMat, toParent);
73327359 /**/
....@@ -7337,17 +7364,24 @@
73377364 }
73387365 /**/
73397366
7340
- switch (info.pane.renderCamera.viewCode)
7367
+ double totalScale = Math.sqrt(hScale*hScale + vScale*vScale) / Math.sqrt(2);
7368
+
7369
+ if (totalScale < 0.01)
7370
+ {
7371
+ totalScale = 0.01;
7372
+ }
7373
+
7374
+ switch (info.pane.RenderCamera().viewCode)
73417375 {
73427376 case 3: // '\001'
73437377 if (modified)
73447378 {
73457379 //LA.matScale(toParent, 1, hScale, vScale);
7346
- LA.matScale(toParent, vScale, 1, 1);
7380
+ LA.matScale(toParent, totalScale, 1, 1);
73477381 } // vScale, 1);
73487382 else
73497383 {
7350
- LA.matScale(toParent, vScale, vScale, vScale);
7384
+ LA.matScale(toParent, totalScale, totalScale, totalScale);
73517385 } // vScale, 1);
73527386 break;
73537387
....@@ -7355,10 +7389,10 @@
73557389 if (modified)
73567390 {
73577391 //LA.matScale(toParent, hScale, 1, vScale);
7358
- LA.matScale(toParent, 1, vScale, 1);
7392
+ LA.matScale(toParent, 1, totalScale, 1);
73597393 } else
73607394 {
7361
- LA.matScale(toParent, vScale, 1, vScale);
7395
+ LA.matScale(toParent, totalScale, 1, totalScale);
73627396 }
73637397 break;
73647398
....@@ -7366,10 +7400,10 @@
73667400 if (modified)
73677401 {
73687402 //LA.matScale(toParent, hScale, vScale, 1);
7369
- LA.matScale(toParent, 1, 1, vScale);
7403
+ LA.matScale(toParent, 1, 1, totalScale);
73707404 } else
73717405 {
7372
- LA.matScale(toParent, vScale, vScale, 1);
7406
+ LA.matScale(toParent, totalScale, totalScale, 1);
73737407 }
73747408 break;
73757409 }
....@@ -7502,14 +7536,22 @@
75027536 //return super.toString() + " (id=" + list + ")" + " (brep=" + bRep + ")";
75037537 //return name + " (id=" + list + ")" + " (brep=" + bRep + ") " + super.toString();
75047538 //return name + " (#tri = " + (bRep==null?0:bRep.VertexCount()) + ") " + super.toString();
7539
+
7540
+ String objname;
7541
+
75057542 if (false) //parent != null)
75067543 {
7507
- return name + " " + System.identityHashCode(this) + " (" + parent.name + " " + System.identityHashCode(parent) + ")";
7544
+ objname = name + " " + System.identityHashCode(this) + " (" + parent.name + " " + System.identityHashCode(parent) + ")";
75087545 } else
75097546 {
7510
- return GetName() + (Math.abs(count) == 1000 ? (count == 1000 ? " " : " * ") : (" (" + (count /*- 1*/) + ") ")) + /*(IsSelected()?"(selected) ":"") + (touched?"(touched) ":"") */ +System.identityHashCode(this);
7547
+ objname = GetName() + (Math.abs(count) == 1000 ? (count == 1000 ? " " : " * ") : (" (" + (count - 1) + ")")) + /*(IsSelected()?"(selected) ":"") + (touched?"(touched) ":"") */ "";
75117548 } // + super.toString();
75127549 //return name + " (" + (SizeOf.deepSizeOf(this)/1024) + "K) " + this.getClass().getName();
7550
+
7551
+ if (!Globals.ADVANCED)
7552
+ return objname;
7553
+
7554
+ return objname + " " + System.identityHashCode(this);
75137555 }
75147556
75157557 public int hashCode()
....@@ -7565,6 +7607,7 @@
75657607 objectUI.closeUI();
75667608 if (editWindow != null)
75677609 {
7610
+ editWindow.ctrlPanel.FlushUI();
75687611 editWindow.refreshContents();
75697612 } // ? new
75707613 objectUI = null;
....@@ -7585,7 +7628,7 @@
75857628 /*transient*/ cVector2[] projectedVertices = new cVector2[0];
75867629
75877630 Object3D /*Composite*/ parent;
7588
- Object3D /*Composite*/ fileparent;
7631
+ Object3D /*Composite*/ fileparent; // In the case of FileObject
75897632
75907633 double[][] toParent; // dynamic matrix
75917634 double[][] fromParent;
....@@ -7700,7 +7743,7 @@
77007743 {
77017744 assert(bRep != null);
77027745 if (!(support instanceof GenericJoint)) // support.bRep != null)
7703
- GrafreeD.Assert(support.bRep == bRep.support);
7746
+ Grafreed.Assert(support.bRep == bRep.support);
77047747 }
77057748 else
77067749 {
....@@ -7749,9 +7792,9 @@
77497792 private static cVector edge2 = new cVector();
77507793 //private static cVector norm = new cVector();
77517794 /*transient private*/ int hitSomething;
7752
- private static final int hitCenter = 1;
7753
- private static final int hitScale = 2;
7754
- private static final int hitRotate = 3;
7795
+ static final int hitCenter = 1;
7796
+ static final int hitScale = 2;
7797
+ static final int hitRotate = 3;
77557798 /*transient*/ /*private*/ int viewCode; // Now used for transparency cache flag
77567799 /*transient*/ private Point centerPt;
77577800 /*transient*/ private int startX;