Normand Briere
2019-06-11 d0dc7ff35d71919d503ae35592478b173cf3cfd3
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,59 @@
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
+ return;
170
+
171
+ Object3D o = new Object3D();
172
+ o.bRep = this.bRep;
173
+ if (this.bRep != null)
174
+ {
175
+ o.transientrep = this.bRep.support;
176
+ o.bRep.support = null;
177
+ }
178
+
179
+// o.support = this.support;
180
+// o.fileparent = this.fileparent;
181
+// if (this.bRep != null)
182
+// o.bRep = this.bRep.support;
183
+
184
+ hashtable.put(GetUUID(), o);
185
+
186
+ this.bRep = null;
187
+// if (this.bRep != null)
188
+// this.bRep.support = null;
189
+// this.support = null;
190
+// this.fileparent = null;
191
+
192
+ for (int i=0; i<Size(); i++)
193
+ {
194
+ get(i).ExtractBigData(hashtable);
195
+ }
196
+}
197
+
198
+void RestoreBigData(java.util.Hashtable<java.util.UUID, Object3D> hashtable)
199
+{
200
+ if (!hashtable.containsKey(GetUUID()))
201
+ return;
202
+
203
+ Object3D o = hashtable.get(GetUUID());
204
+
205
+ this.bRep = o.bRep;
206
+ if (this.bRep != null)
207
+ this.bRep.support = o.transientrep;
208
+// this.support = o.support;
209
+// this.fileparent = o.fileparent;
210
+
211
+ hashtable.remove(GetUUID());
212
+
213
+ for (int i=0; i<Size(); i++)
214
+ {
215
+ get(i).RestoreBigData(hashtable);
158216 }
159217 }
160218
....@@ -299,6 +357,7 @@
299357 }
300358
301359 boolean live = false;
360
+ boolean dontselect = false;
302361 boolean hide = false;
303362 boolean link2master = false; // performs reset support/master at each frame
304363 boolean marked = false; // animation node
....@@ -430,16 +489,16 @@
430489 {
431490 Object3D copy = this;
432491
433
- Camera parentcam = CameraPane.theRenderer.manipCamera;
492
+ Camera parentcam = Globals.theRenderer.ManipCamera();
434493
435
- if (CameraPane.theRenderer.manipCamera == CameraPane.theRenderer.cameras[0])
494
+ if (Globals.theRenderer.ManipCamera() == Globals.theRenderer.Cameras()[0])
436495 {
437
- parentcam = CameraPane.theRenderer.cameras[1];
496
+ parentcam = Globals.theRenderer.Cameras()[1];
438497 }
439498
440
- if (CameraPane.theRenderer.manipCamera == CameraPane.theRenderer.cameras[1])
499
+ if (Globals.theRenderer.ManipCamera() == Globals.theRenderer.Cameras()[1])
441500 {
442
- parentcam = CameraPane.theRenderer.cameras[0];
501
+ parentcam = Globals.theRenderer.Cameras()[0];
443502 }
444503
445504 if (this == parentcam)
....@@ -447,7 +506,7 @@
447506 //assert(this instanceof Camera);
448507
449508 for (int count = parentcam.GetTransformCount(); --count>=0;)
450
- LA.xformPos(CameraPane.theRenderer.targetLookAt, parentcam.toParent, CameraPane.theRenderer.targetLookAt);
509
+ LA.xformPos(Globals.theRenderer.TargetLookAt(), parentcam.toParent, Globals.theRenderer.TargetLookAt());
451510 }
452511
453512 copy.marked ^= true;
....@@ -467,7 +526,7 @@
467526 //assert(this instanceof Camera);
468527
469528 for (int count = parentcam.GetTransformCount(); --count>=0;)
470
- LA.xformPos(CameraPane.theRenderer.targetLookAt, parentcam.fromParent, CameraPane.theRenderer.targetLookAt);
529
+ LA.xformPos(Globals.theRenderer.TargetLookAt(), parentcam.fromParent, Globals.theRenderer.TargetLookAt());
471530 }
472531
473532 copy.Touch(); // display list issue
....@@ -602,7 +661,7 @@
602661 return;
603662 }
604663
605
- if (CameraPane.fromscript)
664
+ if (Globals.fromscript)
606665 {
607666 transformcount = 0;
608667 return;
....@@ -773,7 +832,7 @@
773832 if (step == 0)
774833 step = 1;
775834 if (maxcount == 0)
776
- maxcount = 2048; // 4;
835
+ maxcount = 128; // 2048; // 4;
777836 // if (acceleration == 0)
778837 // acceleration = 10;
779838 if (delay == 0) // serial
....@@ -796,7 +855,7 @@
796855
797856 if (marked && Globals.isLIVE() && live &&
798857 //TEMP21aug2018
799
- Globals.DrawMode() == iCameraPane.SHADOW &&
858
+ (Globals.DrawMode() == iCameraPane.SHADOW || !Globals.RENDERSHADOW) &&
800859 currentframe != Globals.framecount)
801860 {
802861 currentframe = Globals.framecount;
....@@ -911,6 +970,11 @@
911970 fromParent = null; // LA.newMatrix();
912971 bRep = null; // new BoundaryRep();
913972
973
+ if (oname != null && oname.equals("LeftHand"))
974
+ {
975
+ name = oname;
976
+ }
977
+
914978 /*
915979 float hue = (float)Math.random();
916980 Color col;
....@@ -953,7 +1017,7 @@
9531017
9541018 public Object clone()
9551019 {
956
- return GrafreeD.clone(this);
1020
+ return Grafreed.clone(this);
9571021 }
9581022
9591023 Object3D copyExpand()
....@@ -1469,7 +1533,7 @@
14691533 BoundaryRep.SEUIL = other.material.cameralight;
14701534
14711535 // Set default to 0.1
1472
- BoundaryRep.SEUIL /= 2;
1536
+ BoundaryRep.SEUIL /= 4; // 2;
14731537 System.out.println("SEUIL = " + BoundaryRep.SEUIL);
14741538 }
14751539
....@@ -1728,7 +1792,7 @@
17281792 Object3D o = new Object3D((clone?"Ge:":"Li:") + this.name);
17291793 o.bRep = transientrep;
17301794 if (clone)
1731
- o.bRep = (BoundaryRep) GrafreeD.clone(transientrep);
1795
+ o.bRep = (BoundaryRep) Grafreed.clone(transientrep);
17321796 o.CreateMaterial();
17331797 o.SetAttributes(this, -1);
17341798 //parent
....@@ -1741,7 +1805,7 @@
17411805 Object3D o = new Object3D((clone?"Ge:":"Li:") + this.name);
17421806 o.bRep = bRep;
17431807 if (clone)
1744
- o.bRep = (BoundaryRep) GrafreeD.clone(bRep);
1808
+ o.bRep = (BoundaryRep) Grafreed.clone(bRep);
17451809 o.CreateMaterial();
17461810 //o.overwriteThis(this, -1);
17471811 o.SetAttributes(this, -1);
....@@ -1828,12 +1892,15 @@
18281892 if (obj.name == null)
18291893 continue; // can't be a null one
18301894
1895
+ // Try perfect match first.
18311896 if (n.equals(obj.name))
18321897 {
18331898 theobj = obj;
18341899 count++;
18351900 }
18361901 }
1902
+
1903
+ // not needed: n = n.split(":")[0]; // Poser generates a count
18371904
18381905 if (count != 1)
18391906 for (int i=Size(); --i>=0;)
....@@ -2299,6 +2366,7 @@
22992366 {
23002367 if (newWindow)
23012368 {
2369
+ new Exception().printStackTrace();
23022370 System.exit(0);
23032371 if (parent != null)
23042372 {
....@@ -2475,13 +2543,13 @@
24752543 return retval;
24762544 }
24772545
2478
- void doEditDrag(ClickInfo info)
2546
+ void doEditDrag(ClickInfo info, boolean opposite)
24792547 {
24802548 switch (doSomething)
24812549 {
24822550 case 1: // '\001'
24832551 //super.
2484
- doEditDrag0(info);
2552
+ doEditDrag0(info, opposite);
24852553 break;
24862554
24872555 case 2: // '\002'
....@@ -2494,11 +2562,11 @@
24942562 {
24952563 //sel.hitSomething = childToDrag.hitSomething;
24962564 //childToDrag.doEditDrag(info);
2497
- sel.doEditDrag(info);
2565
+ sel.doEditDrag(info, opposite);
24982566 } else
24992567 {
25002568 //super.
2501
- doEditDrag0(info);
2569
+ doEditDrag0(info, opposite);
25022570 }
25032571 }
25042572 break;
....@@ -2905,7 +2973,8 @@
29052973 {
29062974 if (bRep != null)
29072975 {
2908
- bRep.GenUV();
2976
+ bRep.GenUV(); //1);
2977
+ //bRep.UnfoldUV();
29092978 Touch();
29102979 }
29112980 }
....@@ -2980,6 +3049,33 @@
29803049 blockloop = false;
29813050 }
29823051
3052
+ void TransformChildren()
3053
+ {
3054
+ if (toParent != null)
3055
+ {
3056
+ for (int i=Size(); --i>=0;)
3057
+ {
3058
+ Object3D v = get(i);
3059
+
3060
+ if (v.toParent == null)
3061
+ {
3062
+ v.toParent = LA.newMatrix();
3063
+ v.fromParent = LA.newMatrix();
3064
+ }
3065
+
3066
+// LA.matConcat(v.toParent, toParent, v.toParent);
3067
+// LA.matConcat(fromParent, v.fromParent, v.fromParent);
3068
+ LA.matConcat(toParent, v.toParent, v.toParent);
3069
+ LA.matConcat(v.fromParent, fromParent, v.fromParent);
3070
+ }
3071
+
3072
+ toParent = null; // LA.matIdentity(toParent);
3073
+ fromParent = null; // LA.matIdentity(fromParent);
3074
+
3075
+ Touch();
3076
+ }
3077
+ }
3078
+
29833079 void TransformGeometry()
29843080 {
29853081 Object3D obj = this;
....@@ -3201,9 +3297,11 @@
32013297
32023298 BoundaryRep sup = bRep.support;
32033299 bRep.support = null;
3204
- BoundaryRep temprep = (BoundaryRep) GrafreeD.clone(bRep);
3300
+ BoundaryRep temprep = (BoundaryRep) Grafreed.clone(bRep);
32053301 // bRep.SplitInTwo(onlyone); // thread...
3206
- temprep.SplitInTwo(reduction34, onlyone);
3302
+
3303
+ while(temprep.SplitInTwo(reduction34, onlyone));
3304
+
32073305 bRep = temprep;
32083306 bRep.support = sup;
32093307 Touch();
....@@ -3725,7 +3823,7 @@
37253823 if (child == null)
37263824 continue;
37273825
3728
- if (GrafreeD.RENDERME > 0)
3826
+ if (Grafreed.RENDERME > 0)
37293827 {
37303828 if (child instanceof Merge)
37313829 ((Merge)child).renderme();
....@@ -3876,7 +3974,7 @@
38763974 if (child == null)
38773975 continue;
38783976
3879
- if (GrafreeD.RENDERME > 0)
3977
+ if (Grafreed.RENDERME > 0)
38803978 {
38813979 if (child instanceof Merge)
38823980 ((Merge)child).renderme();
....@@ -4071,7 +4169,7 @@
40714169 if (child == null)
40724170 continue;
40734171
4074
- if (GrafreeD.RENDERME > 0)
4172
+ if (Grafreed.RENDERME > 0)
40754173 {
40764174 if (child instanceof Merge)
40774175 ((Merge)child).renderme();
....@@ -4678,7 +4776,7 @@
46784776
46794777 cTreePath SelectLeaf(int indexcount, boolean deselect)
46804778 {
4681
- if (hide)
4779
+ if (hide || dontselect)
46824780 return null;
46834781
46844782 if (count <= 0)
....@@ -4704,7 +4802,7 @@
47044802
47054803 cTreePath Select(int indexcount, boolean deselect)
47064804 {
4707
- if (hide)
4805
+ if (hide || dontselect)
47084806 return null;
47094807
47104808 if (count <= 0)
....@@ -4854,7 +4952,7 @@
48544952 return globalTransform;
48554953 }
48564954
4857
- void PreprocessOcclusion(CameraPane cp)
4955
+ void PreprocessOcclusion(iCameraPane cp)
48584956 {
48594957 /*
48604958 if (AOdone)
....@@ -5156,10 +5254,34 @@
51565254
51575255 // System.out.println("Fullname = " + fullname);
51585256
5159
- if (fullname.name.indexOf(":") == -1)
5160
- return fullname.name;
5257
+ // Does not work on Windows due to C:
5258
+// if (fullname.name.indexOf(":") == -1)
5259
+// return fullname.name;
5260
+//
5261
+// return fullname.name.substring(0,fullname.name.indexOf(":"));
51615262
5162
- return fullname.name.substring(0,fullname.name.indexOf(":"));
5263
+ String[] split = fullname.name.split(":");
5264
+
5265
+ if (split.length == 0)
5266
+ {
5267
+ return "";
5268
+ }
5269
+
5270
+ if (split.length <= 2)
5271
+ {
5272
+ if (fullname.name.endsWith(":"))
5273
+ {
5274
+ // Windows
5275
+ return fullname.name.substring(0, fullname.name.length()-1);
5276
+ }
5277
+
5278
+ return split[0];
5279
+ }
5280
+
5281
+ // Windows
5282
+ assert(split.length == 4);
5283
+
5284
+ return split[0] + ":" + split[1];
51635285 }
51645286
51655287 static String GetBump(cTexture fullname)
....@@ -5168,10 +5290,38 @@
51685290 return "";
51695291
51705292 // 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());
5293
+ // Does not work on Windows due to C:
5294
+// if (fullname.name.indexOf(":") == -1)
5295
+// return "";
5296
+//
5297
+// return fullname.name.substring(fullname.name.indexOf(":")+1,fullname.name.length());
5298
+ String[] split = fullname.name.split(":");
5299
+
5300
+ if (split.length == 0)
5301
+ {
5302
+ return "";
5303
+ }
5304
+
5305
+ if (split.length == 1)
5306
+ {
5307
+ return "";
5308
+ }
5309
+
5310
+ if (split.length == 2)
5311
+ {
5312
+ if (fullname.name.endsWith(":"))
5313
+ {
5314
+ // Windows
5315
+ return "";
5316
+ }
5317
+
5318
+ return split[1];
5319
+ }
5320
+
5321
+ // Windows
5322
+ assert(split.length == 4);
5323
+
5324
+ return split[2] + ":" + split[3];
51755325 }
51765326
51775327 String GetPigmentTexture()
....@@ -5245,7 +5395,7 @@
52455395 System.out.print("; textures = " + textures);
52465396 System.out.println("; usedtextures = " + usedtextures);
52475397
5248
- if (GetTextures() == null)
5398
+ if (GetTextures() == null) // What is that??
52495399 GetTextures().name = ":";
52505400
52515401 String texname = tex;
....@@ -5276,6 +5426,43 @@
52765426 child.ResetPigmentTexture();
52775427 blockloop = false;
52785428 }
5429
+ }
5430
+
5431
+ UUID GetUUID()
5432
+ {
5433
+ if (uuid == null)
5434
+ {
5435
+ // Serial
5436
+ uuid = UUID.randomUUID();
5437
+ }
5438
+
5439
+ return uuid;
5440
+ }
5441
+
5442
+ Object3D GetObject(UUID uid)
5443
+ {
5444
+ if (blockloop)
5445
+ return null;
5446
+
5447
+ if (GetUUID().equals(uid))
5448
+ return this;
5449
+
5450
+ int nb = Size();
5451
+ for (int i = 0; i < nb; i++)
5452
+ {
5453
+ Object3D child = (Object3D) get(i);
5454
+
5455
+ if (child == null)
5456
+ continue;
5457
+
5458
+ blockloop = true;
5459
+ Object3D obj = child.GetObject(uid);
5460
+ blockloop = false;
5461
+ if (obj != null)
5462
+ return obj;
5463
+ }
5464
+
5465
+ return null;
52795466 }
52805467
52815468 void SetBumpTexture(String tex)
....@@ -5322,11 +5509,12 @@
53225509 boolean NeedSupport()
53235510 {
53245511 return
5325
- CameraPane.SUPPORT && !CameraPane.movingcamera && link2master && /*live &&*/ support != null
5512
+ CameraPane.SUPPORT && (!CameraPane.movingcamera || !Globals.FREEZEONMOVE) && link2master && /*live &&*/ support != null
53265513 // PROBLEM with CROWD!!
5327
- && (Globals.DrawMode() == iCameraPane.SHADOW || Globals.CROWD);
5514
+ && (Globals.DrawMode() == iCameraPane.SHADOW || !Globals.RENDERSHADOW || Globals.CROWD);
53285515 }
53295516
5517
+ static boolean DEBUG_SELECTION = false;
53305518
53315519 void Draw(iCameraPane display, Object3D /*Composite*/ root, boolean selected, boolean blocked)
53325520 {
....@@ -5338,7 +5526,7 @@
53385526 }
53395527
53405528 if (display.DrawMode() == iCameraPane.SELECTION &&
5341
- hide)
5529
+ (hide || dontselect))
53425530 return;
53435531
53445532 if (name != null && name.contains("sclera"))
....@@ -5365,12 +5553,12 @@
53655553 }
53665554
53675555 if ((//display.DrawMode() == CameraPane.SHADOW ||
5368
- display.DrawMode() == CameraPane.SELECTION || CameraPane.DEBUG_SELECTION) && HasTransparency())
5556
+ display.DrawMode() == iCameraPane.SELECTION || display.IsDebugSelection()) && HasTransparency())
53695557 {
53705558 return;
53715559 }
53725560
5373
- javax.media.opengl.GL gl = display.GetGL();
5561
+ //javax.media.opengl.GL gl = display.GetGL();
53745562
53755563 /*
53765564 if (touched)
....@@ -5406,7 +5594,7 @@
54065594
54075595 boolean compiled = false;
54085596
5409
- boolean selectmode = display.DrawMode() == display.SELECTION || CameraPane.DEBUG_SELECTION;
5597
+ boolean selectmode = display.DrawMode() == display.SELECTION || display.IsDebugSelection();
54105598
54115599 if (!selectmode && //display.DrawMode() != display.SELECTION &&
54125600 (touched || (bRep != null && bRep.displaylist <= 0)))
....@@ -5422,7 +5610,7 @@
54225610 //if (displaylist == -1 && usecalllists)
54235611 if ((bRep != null && bRep.displaylist <= 0) && usecalllists) // june 2013
54245612 {
5425
- bRep.displaylist = gl.glGenLists(1);
5613
+ bRep.displaylist = display.GenList();
54265614 assert(bRep.displaylist != 0);
54275615 // System.err.println("glGenLists: " + bRep.displaylist + " for " + this);
54285616 //System.out.println("\tgen list " + list);
....@@ -5434,14 +5622,16 @@
54345622 if (usecalllists)
54355623 {
54365624 // System.err.println("new list " + bRep.displaylist + " for " + this);
5437
- gl.glNewList(bRep.displaylist, gl.GL_COMPILE); //_AND_EXECUTE);
5625
+ display.NewList(bRep.displaylist);
54385626 }
5627
+
54395628 CallList(display, root, selected, blocked);
5629
+
54405630 // compiled = true;
54415631 if (usecalllists)
54425632 {
54435633 // System.err.println("end list " + bRep.displaylist + " for " + this);
5444
- gl.glEndList();
5634
+ display.EndList();
54455635 }
54465636 //gl.glDrawBuffer(gl.GL_BACK);
54475637 // XXX touched = false;
....@@ -5484,12 +5674,12 @@
54845674
54855675 // frustum culling
54865676 if (CameraPane.FRUSTUM && !blocked && !IsInfinite() && GetBRep() != null // && GetBRep().VertexCount() != 1260 // default grid
5487
- && display.DrawMode() != CameraPane.SELECTION)
5677
+ && display.DrawMode() != iCameraPane.SELECTION)
54885678 {
5489
- if (display.DrawMode() == CameraPane.SHADOW)
5679
+ if (display.DrawMode() == iCameraPane.SHADOW)
54905680 {
54915681 if (!link2master // tricky to cull in shadow mode.
5492
- && GetBRep().FrustumCull(this, gl, display.LightCamera(), true))
5682
+ && GetBRep().FrustumCull(this, null, display.LightCamera(), true))
54935683 {
54945684 //System.out.print("CULLED");
54955685 culled = true;
....@@ -5497,7 +5687,7 @@
54975687 }
54985688 else
54995689 //GetBRep().getBounds(v0, v1, this);
5500
- if (GetBRep().FrustumCull(this, gl, display.RenderCamera(), false))
5690
+ if (GetBRep().FrustumCull(this, null, display.RenderCamera(), false))
55015691 culled = true;
55025692
55035693 // LA.xformPos(v0, display.renderCamera.toScreen, v0);
....@@ -5533,11 +5723,11 @@
55335723
55345724
55355725 if (!culled)
5536
- if (display.DrawMode() == display.SELECTION || CameraPane.DEBUG_SELECTION)
5726
+ if (display.DrawMode() == display.SELECTION || display.IsDebugSelection())
55375727 {
55385728 if (GetBRep() != null)
55395729 {
5540
- CameraPane.NextIndex(this, gl);
5730
+ display.NextIndex();
55415731 // vertex color conflict : gl.glCallList(list);
55425732 DrawNode(display, root, selected);
55435733 if (this instanceof BezierPatch)
....@@ -5578,7 +5768,17 @@
55785768 tex = GetTextures();
55795769 }
55805770
5581
- display.BindTextures(tex, texres);
5771
+ boolean failed = false;
5772
+
5773
+ try
5774
+ {
5775
+ display.BindTextures(tex, texres);
5776
+ }
5777
+ catch (Exception e)
5778
+ {
5779
+ System.err.println("FAILED: " + this);
5780
+ failed = true;
5781
+ }
55825782
55835783 if (!compiled)
55845784 {
....@@ -5594,13 +5794,14 @@
55945794
55955795 // System.err.println("glCallList: " + bRep.displaylist + " for " + this);
55965796 assert(bRep.displaylist != 0);
5597
- gl.glCallList(bRep.displaylist);
5797
+ display.CallList(bRep.displaylist);
55985798 // june 2013 drawSelf(display, root, selected);
55995799 }
56005800 }
56015801 }
56025802
5603
- display.ReleaseTextures(tex);
5803
+ if (!failed)
5804
+ display.ReleaseTextures(tex);
56045805
56055806 display.PopMaterial(this, selected);
56065807 }
....@@ -5729,6 +5930,9 @@
57295930
57305931 void drawSelf(iCameraPane display, Object3D /*Composite*/ root, boolean selected, boolean blocked)
57315932 {
5933
+ if (display.DrawMode() == iCameraPane.SELECTION && dontselect)
5934
+ return;
5935
+
57325936 if (hide)
57335937 return;
57345938 // shadow optimisation
....@@ -5854,6 +6058,9 @@
58546058 if (display.DrawMode() == display.SHADOW && projectedVertices != null && projectedVertices.length > 2 && projectedVertices[2].y >= 10000)
58556059 return; // no shadow for transparent objects
58566060
6061
+ if (display.DrawMode() == iCameraPane.SELECTION && dontselect)
6062
+ return;
6063
+
58576064 if (hide)
58586065 return;
58596066
....@@ -5894,9 +6101,10 @@
58946101 return;
58956102 }
58966103
6104
+ //bRep.GenUV(1/material.diffuseness);
58976105 // bRep.lock = true;
58986106
5899
- javax.media.opengl.GL gl = display.GetGL();
6107
+ //javax.media.opengl.GL gl = display.GetGL();
59006108
59016109 if (CameraPane.BOXMODE && !selected) // || CameraPane.movingcamera)
59026110 {
....@@ -5913,23 +6121,7 @@
59136121
59146122 bRep.getMinMax(min, max, 100);
59156123
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();
6124
+ display.DrawBox(min, max);
59336125
59346126 return;
59356127 }
....@@ -5973,7 +6165,7 @@
59736165 {
59746166 //throw new Error();
59756167
5976
- boolean selectmode = display.DrawMode() == display.SELECTION || CameraPane.DEBUG_SELECTION;
6168
+ boolean selectmode = display.DrawMode() == display.SELECTION || display.IsDebugSelection();
59776169
59786170 int[] strips = bRep.getRawIndices();
59796171
....@@ -5983,178 +6175,14 @@
59836175 new Exception().printStackTrace();
59846176 return;
59856177 }
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
- }
6178
+
6179
+ display.DrawGeometry(bRep, flipV, selectmode);
61526180 } else // catch (Error e)
61536181 {
61546182 // TRIANGLE ARRAY
61556183 if (IsOpaque()) // Static())
61566184 {
6157
- gl.glBegin(gl.GL_TRIANGLES);
6185
+ display.StartTriangles();
61586186 int facecount = bRep.FaceCount();
61596187 for (int i = 0; i < facecount; i++)
61606188 {
....@@ -6219,7 +6247,7 @@
62196247
62206248 display.DrawFace(this, p, q, r, face);
62216249 }
6222
- gl.glEnd();
6250
+ display.EndTriangles();
62236251 }
62246252 else
62256253 {
....@@ -6248,8 +6276,8 @@
62486276 //System.out.println("SORT");
62496277
62506278 java.util.Arrays.sort(facescompare);
6251
-
6252
- gl.glBegin(gl.GL_TRIANGLES);
6279
+
6280
+ display.StartTriangles();
62536281 for (int i = 0; i < facecount; i++)
62546282 {
62556283 Face face = bRep.GetFace(facescompare[i].index);
....@@ -6263,11 +6291,12 @@
62636291
62646292 display.DrawFace(this, p, q, r, face);
62656293 }
6266
- gl.glEnd();
6294
+ display.EndTriangles();
62676295 }
62686296
62696297 if (false) // live && support != null && support.bRep != null) // debug weights
62706298 {
6299
+ /*
62716300 gl.glDisable(gl.GL_LIGHTING);
62726301 float[] colorV = new float[3];
62736302
....@@ -6346,6 +6375,7 @@
63466375 // gl.glEnd();
63476376 }
63486377 }
6378
+ */
63496379 }
63506380 }
63516381
....@@ -6390,7 +6420,7 @@
63906420 center.add(r);
63916421 center.mul(1.0/3);
63926422
6393
- center.sub(CameraPane.theRenderer.eyeCamera.location);
6423
+ center.sub(Globals.theRenderer.EyeCamera().location);
63946424
63956425 distance = center.dot(center);
63966426 }
....@@ -6404,22 +6434,6 @@
64046434 void Print(Vertex v)
64056435 {
64066436 //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);
64236437 }
64246438
64256439 void drawSelf(ClickInfo info, int level, boolean select)
....@@ -6993,83 +7007,83 @@
69937007 int spotw = spot.x + spot.width;
69947008 int spoth = spot.y + spot.height;
69957009 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
- }
7010
+// if (CameraPane.Xmin > spot.x)
7011
+// {
7012
+// CameraPane.Xmin = spot.x;
7013
+// }
7014
+// if (CameraPane.Xmax < spotw)
7015
+// {
7016
+// CameraPane.Xmax = spotw;
7017
+// }
7018
+// if (CameraPane.Ymin > spot.y)
7019
+// {
7020
+// CameraPane.Ymin = spot.y;
7021
+// }
7022
+// if (CameraPane.Ymax < spoth)
7023
+// {
7024
+// CameraPane.Ymax = spoth;
7025
+// }
70127026 spot.translate(32, 32);
70137027 spotw = spot.x + spot.width;
70147028 spoth = spot.y + spot.height;
70157029 info.g.setColor(Color.blue);
70167030 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);
7031
+// if (CameraPane.Xmin > spot.x)
7032
+// {
7033
+// CameraPane.Xmin = spot.x;
7034
+// }
7035
+// if (CameraPane.Xmax < spotw)
7036
+// {
7037
+// CameraPane.Xmax = spotw;
7038
+// }
7039
+// if (CameraPane.Ymin > spot.y)
7040
+// {
7041
+// CameraPane.Ymin = spot.y;
7042
+// }
7043
+// if (CameraPane.Ymax < spoth)
7044
+// {
7045
+// CameraPane.Ymax = spoth;
7046
+// }
7047
+ // bonhommes info.g.drawLine(spotw, spoth, spotw, spoth - 15);
7048
+ //info.g.drawLine(spotw, spoth, spotw - 15, spoth);
70357049 spot.translate(0, -32);
70367050 info.g.setColor(Color.green);
70377051 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
- }
7052
+// if (CameraPane.Xmin > spot.x)
7053
+// {
7054
+// CameraPane.Xmin = spot.x;
7055
+// }
7056
+// if (CameraPane.Xmax < spotw)
7057
+// {
7058
+// CameraPane.Xmax = spotw;
7059
+// }
7060
+// if (CameraPane.Ymin > spot.y)
7061
+// {
7062
+// CameraPane.Ymin = spot.y;
7063
+// }
7064
+// if (CameraPane.Ymax < spoth)
7065
+// {
7066
+// CameraPane.Ymax = spoth;
7067
+// }
70547068 info.g.drawArc(boundary.x, boundary.y,
70557069 boundary.width, boundary.height, 0, 360);
70567070 //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
- }
7071
+// if (CameraPane.Xmin > boundary.x)
7072
+// {
7073
+// CameraPane.Xmin = boundary.x;
7074
+// }
7075
+// if (CameraPane.Xmax < boundary.x + boundary.width)
7076
+// {
7077
+// CameraPane.Xmax = boundary.x + boundary.width;
7078
+// }
7079
+// if (CameraPane.Ymin > boundary.y)
7080
+// {
7081
+// CameraPane.Ymin = boundary.y;
7082
+// }
7083
+// if (CameraPane.Ymax < boundary.y + boundary.height)
7084
+// {
7085
+// CameraPane.Ymax = boundary.y + boundary.height;
7086
+// }
70737087 return;
70747088 }
70757089 }
....@@ -7086,7 +7100,7 @@
70867100 startX = info.x;
70877101 startY = info.y;
70887102
7089
- hitSomething = 0;
7103
+ hitSomething = -1;
70907104 cVector origin = new cVector();
70917105 //LA.xformPos(origin, toParent, origin);
70927106 Rectangle spot = new Rectangle();
....@@ -7119,7 +7133,7 @@
71197133 }
71207134
71217135 //System.out.println("info.modifiers = " + info.modifiers);
7122
- modified = (info.modifiers & CameraPane.META) != 0;
7136
+ modified = (info.modifiers & CameraPane.SHIFT) != 0; // Was META
71237137 //System.out.println("modified = " + modified);
71247138 //new Exception().printStackTrace();
71257139 //viewCode = info.pane.renderCamera.viewCode;
....@@ -7147,7 +7161,7 @@
71477161 return true;
71487162 }
71497163
7150
- void doEditDrag0(ClickInfo info)
7164
+ void doEditDrag0(ClickInfo info, boolean opposite)
71517165 {
71527166 if (hitSomething == 0)
71537167 {
....@@ -7162,6 +7176,7 @@
71627176 //System.out.println("hitSomething = " + hitSomething);
71637177
71647178 double scale = 0.005f * info.camera.Distance();
7179
+
71657180 cVector xlate = new cVector();
71667181 //cVector xlate2 = new cVector();
71677182 switch (hitSomething)
....@@ -7172,9 +7187,9 @@
71727187
71737188 case hitCenter: // Translate
71747189
7175
- scale *= 0.05f * info.pane.theRenderer.renderCamera.Distance();
7190
+ scale *= 0.05f * Globals.theRenderer.RenderCamera().Distance();
71767191
7177
- if (modified)
7192
+ if (modified || opposite)
71787193 {
71797194 //assert(false);
71807195 /*
....@@ -7220,10 +7235,10 @@
72207235 }
72217236 LA.xformDir(up, ClickInfo.matbuffer, up);
72227237 // if (!CameraPane.LOCALTRANSFORM)
7223
- LA.xformDir(up, info.pane.theRenderer.renderCamera.toScreen, up);
7238
+ LA.xformDir(up, Globals.theRenderer.RenderCamera().toScreen, up);
72247239 LA.xformDir(info.camera.away, ClickInfo.matbuffer, away);
72257240 // if (!CameraPane.LOCALTRANSFORM)
7226
- LA.xformDir(away, info.pane.theRenderer.renderCamera.toScreen, away);
7241
+ LA.xformDir(away, Globals.theRenderer.RenderCamera().toScreen, away);
72277242 //LA.vecCross(up, cVector.Z, right2);
72287243
72297244 cVector delta = LA.newVector(info.x - startX, startY - info.y, 0);
....@@ -7268,6 +7283,7 @@
72687283
72697284 if (modified)
72707285 {
7286
+ // Rotate 90 degrees
72717287 angle /= (Math.PI / 4);
72727288 angle = Math.floor(angle + 0.5);
72737289 angle *= (Math.PI / 4);
....@@ -7281,7 +7297,7 @@
72817297 }
72827298 /**/
72837299
7284
- switch (info.pane.renderCamera.viewCode)
7300
+ switch (info.pane.RenderCamera().viewCode)
72857301 {
72867302 case 1: // '\001'
72877303 LA.matZRotate(toParent, angle);
....@@ -7309,24 +7325,27 @@
73097325
73107326 case hitScale: // scale
73117327 double hScale = (double) (info.x - centerPt.x) / 32;
7328
+ double sign = 1;
7329
+ if (hScale < 0)
7330
+ {
7331
+ sign = -1;
7332
+ }
7333
+ hScale = sign*Math.pow(sign*hScale, scale * 50);
73127334 if (hScale < 0.01)
73137335 {
7314
- hScale = 0.01;
7336
+ //hScale = 0.01;
73157337 }
7316
- hScale = Math.pow(hScale, scale * 50);
7317
- if (hScale < 0.01)
7318
- {
7319
- hScale = 0.01;
7320
- }
7338
+
73217339 double vScale = (double) (info.y - centerPt.y) / 32;
7322
- if (vScale < 0.01)
7340
+ sign = 1;
7341
+ if (vScale < 0)
73237342 {
7324
- vScale = 0.01;
7343
+ sign = -1;
73257344 }
7326
- vScale = Math.pow(vScale, scale * 50);
7345
+ vScale = sign*Math.pow(sign*vScale, scale * 50);
73277346 if (vScale < 0.01)
73287347 {
7329
- vScale = 0.01;
7348
+ //vScale = 0.01;
73307349 }
73317350 LA.matCopy(startMat, toParent);
73327351 /**/
....@@ -7337,17 +7356,24 @@
73377356 }
73387357 /**/
73397358
7340
- switch (info.pane.renderCamera.viewCode)
7359
+ double totalScale = Math.sqrt(hScale*hScale + vScale*vScale) / Math.sqrt(2);
7360
+
7361
+ if (totalScale < 0.01)
7362
+ {
7363
+ totalScale = 0.01;
7364
+ }
7365
+
7366
+ switch (info.pane.RenderCamera().viewCode)
73417367 {
73427368 case 3: // '\001'
73437369 if (modified)
73447370 {
73457371 //LA.matScale(toParent, 1, hScale, vScale);
7346
- LA.matScale(toParent, vScale, 1, 1);
7372
+ LA.matScale(toParent, totalScale, 1, 1);
73477373 } // vScale, 1);
73487374 else
73497375 {
7350
- LA.matScale(toParent, vScale, vScale, vScale);
7376
+ LA.matScale(toParent, totalScale, totalScale, totalScale);
73517377 } // vScale, 1);
73527378 break;
73537379
....@@ -7355,10 +7381,10 @@
73557381 if (modified)
73567382 {
73577383 //LA.matScale(toParent, hScale, 1, vScale);
7358
- LA.matScale(toParent, 1, vScale, 1);
7384
+ LA.matScale(toParent, 1, totalScale, 1);
73597385 } else
73607386 {
7361
- LA.matScale(toParent, vScale, 1, vScale);
7387
+ LA.matScale(toParent, totalScale, 1, totalScale);
73627388 }
73637389 break;
73647390
....@@ -7366,10 +7392,10 @@
73667392 if (modified)
73677393 {
73687394 //LA.matScale(toParent, hScale, vScale, 1);
7369
- LA.matScale(toParent, 1, 1, vScale);
7395
+ LA.matScale(toParent, 1, 1, totalScale);
73707396 } else
73717397 {
7372
- LA.matScale(toParent, vScale, vScale, 1);
7398
+ LA.matScale(toParent, totalScale, totalScale, 1);
73737399 }
73747400 break;
73757401 }
....@@ -7502,14 +7528,22 @@
75027528 //return super.toString() + " (id=" + list + ")" + " (brep=" + bRep + ")";
75037529 //return name + " (id=" + list + ")" + " (brep=" + bRep + ") " + super.toString();
75047530 //return name + " (#tri = " + (bRep==null?0:bRep.VertexCount()) + ") " + super.toString();
7531
+
7532
+ String objname;
7533
+
75057534 if (false) //parent != null)
75067535 {
7507
- return name + " " + System.identityHashCode(this) + " (" + parent.name + " " + System.identityHashCode(parent) + ")";
7536
+ objname = name + " " + System.identityHashCode(this) + " (" + parent.name + " " + System.identityHashCode(parent) + ")";
75087537 } else
75097538 {
7510
- return GetName() + (Math.abs(count) == 1000 ? (count == 1000 ? " " : " * ") : (" (" + (count /*- 1*/) + ") ")) + /*(IsSelected()?"(selected) ":"") + (touched?"(touched) ":"") */ +System.identityHashCode(this);
7539
+ objname = GetName() + (Math.abs(count) == 1000 ? (count == 1000 ? " " : " * ") : (" (" + (count - 1) + ")")) + /*(IsSelected()?"(selected) ":"") + (touched?"(touched) ":"") */ "";
75117540 } // + super.toString();
75127541 //return name + " (" + (SizeOf.deepSizeOf(this)/1024) + "K) " + this.getClass().getName();
7542
+
7543
+ if (!Globals.ADVANCED)
7544
+ return objname;
7545
+
7546
+ return objname + " " + System.identityHashCode(this);
75137547 }
75147548
75157549 public int hashCode()
....@@ -7565,6 +7599,7 @@
75657599 objectUI.closeUI();
75667600 if (editWindow != null)
75677601 {
7602
+ editWindow.ctrlPanel.FlushUI();
75687603 editWindow.refreshContents();
75697604 } // ? new
75707605 objectUI = null;
....@@ -7585,7 +7620,7 @@
75857620 /*transient*/ cVector2[] projectedVertices = new cVector2[0];
75867621
75877622 Object3D /*Composite*/ parent;
7588
- Object3D /*Composite*/ fileparent;
7623
+ Object3D /*Composite*/ fileparent; // In the case of FileObject
75897624
75907625 double[][] toParent; // dynamic matrix
75917626 double[][] fromParent;
....@@ -7700,7 +7735,7 @@
77007735 {
77017736 assert(bRep != null);
77027737 if (!(support instanceof GenericJoint)) // support.bRep != null)
7703
- GrafreeD.Assert(support.bRep == bRep.support);
7738
+ Grafreed.Assert(support.bRep == bRep.support);
77047739 }
77057740 else
77067741 {
....@@ -7749,9 +7784,9 @@
77497784 private static cVector edge2 = new cVector();
77507785 //private static cVector norm = new cVector();
77517786 /*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;
7787
+ static final int hitCenter = 1;
7788
+ static final int hitScale = 2;
7789
+ static final int hitRotate = 3;
77557790 /*transient*/ /*private*/ int viewCode; // Now used for transparency cache flag
77567791 /*transient*/ private Point centerPt;
77577792 /*transient*/ private int startX;