Normand Briere
2017-05-07 314b34423070cf127464da79a53cddf6b1c38587
Object3D.java
....@@ -935,7 +935,7 @@
935935
936936 public Object clone()
937937 {
938
- return GraphreeD.clone(this);
938
+ return GrafreeD.clone(this);
939939 }
940940
941941 Object3D copyExpand()
....@@ -1701,7 +1701,7 @@
17011701 Object3D o = new Object3D((clone?"Ge:":"Li:") + this.name);
17021702 o.bRep = transientrep;
17031703 if (clone)
1704
- o.bRep = (BoundaryRep) GraphreeD.clone(transientrep);
1704
+ o.bRep = (BoundaryRep) GrafreeD.clone(transientrep);
17051705 o.CreateMaterial();
17061706 o.SetAttributes(this, -1);
17071707 //parent
....@@ -1714,7 +1714,7 @@
17141714 Object3D o = new Object3D((clone?"Ge:":"Li:") + this.name);
17151715 o.bRep = bRep;
17161716 if (clone)
1717
- o.bRep = (BoundaryRep) GraphreeD.clone(bRep);
1717
+ o.bRep = (BoundaryRep) GrafreeD.clone(bRep);
17181718 o.CreateMaterial();
17191719 //o.overwriteThis(this, -1);
17201720 o.SetAttributes(this, -1);
....@@ -1756,7 +1756,7 @@
17561756 // {
17571757 // assert(bRep == null);
17581758 // Object3D o = new Object3D("Geometry:" + this.name);
1759
-// o.bRep = (BoundaryRep) GraphreeD.clone(transientrep);
1759
+// o.bRep = (BoundaryRep) GrafreeD.clone(transientrep);
17601760 // o.CreateMaterial();
17611761 // parent.addChild(o);
17621762 // }
....@@ -1765,7 +1765,7 @@
17651765 // {
17661766 // assert(transientrep == null);
17671767 // Object3D o = new Object3D("Geometry:" + this.name);
1768
-// o.bRep = (BoundaryRep) GraphreeD.clone(bRep);
1768
+// o.bRep = (BoundaryRep) GrafreeD.clone(bRep);
17691769 // o.CreateMaterial();
17701770 // parent.addChild(o);
17711771 // }
....@@ -3153,7 +3153,7 @@
31533153
31543154 BoundaryRep sup = bRep.support;
31553155 bRep.support = null;
3156
- BoundaryRep temprep = (BoundaryRep) GraphreeD.clone(bRep);
3156
+ BoundaryRep temprep = (BoundaryRep) GrafreeD.clone(bRep);
31573157 // bRep.SplitInTwo(onlyone); // thread...
31583158 temprep.SplitInTwo(reduction34, onlyone);
31593159 bRep = temprep;
....@@ -3677,7 +3677,7 @@
36773677 if (child == null)
36783678 continue;
36793679
3680
- if (GraphreeD.RENDERME > 0)
3680
+ if (GrafreeD.RENDERME > 0)
36813681 {
36823682 if (child instanceof Merge)
36833683 ((Merge)child).renderme();
....@@ -3717,7 +3717,7 @@
37173717
37183718 boolean getCentroid(cVector centroid, boolean xform)
37193719 {
3720
- assert(false);
3720
+// for speaker assert(false);
37213721 if (blockloop)
37223722 return false;
37233723
....@@ -3828,7 +3828,7 @@
38283828 if (child == null)
38293829 continue;
38303830
3831
- if (GraphreeD.RENDERME > 0)
3831
+ if (GrafreeD.RENDERME > 0)
38323832 {
38333833 if (child instanceof Merge)
38343834 ((Merge)child).renderme();
....@@ -4023,7 +4023,7 @@
40234023 if (child == null)
40244024 continue;
40254025
4026
- if (GraphreeD.RENDERME > 0)
4026
+ if (GrafreeD.RENDERME > 0)
40274027 {
40284028 if (child instanceof Merge)
40294029 ((Merge)child).renderme();
....@@ -4515,16 +4515,28 @@
45154515
45164516 Object3D GetFileRoot()
45174517 {
4518
+ if (overflow)
4519
+ return null;
4520
+
4521
+ overflow = true;
4522
+
4523
+ Object3D pfr = null;
4524
+
45184525 if (parent == null && fileparent == null)
4519
- return this;
4526
+ pfr = this;
45204527
45214528 if (parent == null && fileparent != null) // V4.gfd???
4522
- return fileparent;
4529
+ pfr = fileparent;
45234530
4524
- if (parent == null)
4525
- return this;
4531
+ if (pfr == null && parent == null)
4532
+ pfr = this;
45264533
4527
- return parent.GetFileRoot();
4534
+ if (pfr == null)
4535
+ pfr = parent.GetFileRoot();
4536
+
4537
+ overflow = false;
4538
+
4539
+ return pfr;
45284540 }
45294541
45304542 cTreePath GetPath()
....@@ -5280,7 +5292,7 @@
52805292 if (name != null && name.contains("sclera"))
52815293 name = name;
52825294
5283
- if (this instanceof CheckerIG)
5295
+ if (this instanceof Checker)
52845296 return;
52855297
52865298 if (display.drawMode == display.SHADOW && PASSTEST)
....@@ -5507,7 +5519,9 @@
55075519 display.options2[2] = material.factor;
55085520
55095521 cColor.HSBtoRGB(material.color, material.modulation, 1, display.options3);
5510
- display.options3[3] = material.cameralight/0.2f;
5522
+ display.options4[0] = material.cameralight/0.2f;
5523
+ display.options4[1] = material.subsurface;
5524
+ display.options4[2] = material.sheen;
55115525
55125526 // if (display.CURRENTANTIALIAS > 0)
55135527 // display.options3[3] /= 4;
....@@ -5807,12 +5821,12 @@
58075821 if (!child.HasTransparency())
58085822 {
58095823 sel = root != null && root.selection != null && root.selection.indexOf(child) != -1;
5810
- // GraphreeD.tracein("draw ", child);
5824
+ // GrafreeD.tracein("draw ", child);
58115825 boolean wasblocked = blockdraw;
58125826 blockdraw = true;
58135827 child.draw(display, root, selected || sel, wasblocked || blocked); // || child.IsSelected());
58145828 blockdraw = false;
5815
- // GraphreeD.traceout("draw ", child);
5829
+ // GrafreeD.traceout("draw ", child);
58165830 }
58175831
58185832 release(i);
....@@ -7735,8 +7749,15 @@
77357749 info.pane.repaint();
77367750 }
77377751
7752
+ boolean overflow = false;
7753
+
77387754 void TransformToWorld(cVector out) // , cVector out)
77397755 {
7756
+ if (overflow)
7757
+ return;
7758
+
7759
+ overflow = true;
7760
+
77407761 // june 2013 ??? assert (in == out);
77417762 cVector in = out;
77427763 if (toParent != null && !(this instanceof Texture || this instanceof TextureNode))
....@@ -7753,6 +7774,8 @@
77537774 {
77547775 (parent!=null?parent:fileparent).TransformToWorld(out); //, out);
77557776 }
7777
+
7778
+ overflow = false;
77567779 }
77577780
77587781 void TransformToLocal(cVector out) //, cVector out)
....@@ -7995,19 +8018,22 @@
79958018 max = new cVector();
79968019 }
79978020
7998
- Object3D sourcenode = GetFileRoot();
7999
-
8000
- if (!sourcenode.name.contains("rclab"))
8021
+ if (false) // Can crawl!!
80018022 {
8002
- getBounds(min, max, true);
8023
+ Object3D sourcenode = GetFileRoot();
80038024
8004
- if (min.y != Double.POSITIVE_INFINITY && min.y > 2)
8025
+ if (sourcenode != null && !sourcenode.name.contains("rclab"))
80058026 {
8006
-// sourcenode.getBounds(min, max, true);
8007
- sourcenode.getBounds(v0, v1, true);
8008
-// sourcenode.toParent = sourcenode.toParent;
8009
-// get(0).toParent = get(0).toParent;
8010
-// sourcenode.GlobalTransform();
8027
+ getBounds(min, max, true);
8028
+
8029
+ if (min.y != Double.POSITIVE_INFINITY && min.y > 2)
8030
+ {
8031
+ // sourcenode.getBounds(min, max, true);
8032
+ sourcenode.getBounds(v0, v1, true);
8033
+ // sourcenode.toParent = sourcenode.toParent;
8034
+ // get(0).toParent = get(0).toParent;
8035
+ // sourcenode.GlobalTransform();
8036
+ }
80118037 }
80128038 }
80138039
....@@ -8016,7 +8042,8 @@
80168042 if (support != null)
80178043 {
80188044 assert(bRep != null);
8019
- GraphreeD.Assert(support.bRep == bRep.support);
8045
+ if (!(support instanceof GenericJoint)) // support.bRep != null)
8046
+ GrafreeD.Assert(support.bRep == bRep.support);
80208047 }
80218048 else
80228049 {