Normand Briere
2018-07-03 02e145cb923d601395acc7f15ae9e13f85ef2fbb
Object3D.java
....@@ -355,7 +355,7 @@
355355
356356 int MemorySize()
357357 {
358
- if (memorysize == 0)
358
+ if (true) // memorysize == 0)
359359 {
360360 try
361361 {
....@@ -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()
....@@ -1446,7 +1446,16 @@
14461446 // if (other == null)
14471447 // return;
14481448
1449
- System.out.println("Link support this = " + this + "; other = " + other);
1449
+ if (other != null)
1450
+ {
1451
+ BoundaryRep.SEUIL = other.material.cameralight;
1452
+
1453
+ // Set default to 0.1
1454
+ BoundaryRep.SEUIL /= 2;
1455
+ System.out.println("SEUIL = " + BoundaryRep.SEUIL);
1456
+ }
1457
+
1458
+ System.out.println("Link this = " + this + "; support = " + other);
14501459
14511460 //if (bRep != null)
14521461 // bRep.linkVerticesThis(other.bRep);
....@@ -1701,7 +1710,7 @@
17011710 Object3D o = new Object3D((clone?"Ge:":"Li:") + this.name);
17021711 o.bRep = transientrep;
17031712 if (clone)
1704
- o.bRep = (BoundaryRep) GraphreeD.clone(transientrep);
1713
+ o.bRep = (BoundaryRep) GrafreeD.clone(transientrep);
17051714 o.CreateMaterial();
17061715 o.SetAttributes(this, -1);
17071716 //parent
....@@ -1714,7 +1723,7 @@
17141723 Object3D o = new Object3D((clone?"Ge:":"Li:") + this.name);
17151724 o.bRep = bRep;
17161725 if (clone)
1717
- o.bRep = (BoundaryRep) GraphreeD.clone(bRep);
1726
+ o.bRep = (BoundaryRep) GrafreeD.clone(bRep);
17181727 o.CreateMaterial();
17191728 //o.overwriteThis(this, -1);
17201729 o.SetAttributes(this, -1);
....@@ -1756,7 +1765,7 @@
17561765 // {
17571766 // assert(bRep == null);
17581767 // Object3D o = new Object3D("Geometry:" + this.name);
1759
-// o.bRep = (BoundaryRep) GraphreeD.clone(transientrep);
1768
+// o.bRep = (BoundaryRep) GrafreeD.clone(transientrep);
17601769 // o.CreateMaterial();
17611770 // parent.addChild(o);
17621771 // }
....@@ -1765,7 +1774,7 @@
17651774 // {
17661775 // assert(transientrep == null);
17671776 // Object3D o = new Object3D("Geometry:" + this.name);
1768
-// o.bRep = (BoundaryRep) GraphreeD.clone(bRep);
1777
+// o.bRep = (BoundaryRep) GrafreeD.clone(bRep);
17691778 // o.CreateMaterial();
17701779 // parent.addChild(o);
17711780 // }
....@@ -1816,8 +1825,9 @@
18161825 if (obj.name == null)
18171826 continue; // can't be a null one
18181827
1819
- //if (n.contains(obj.name)) // dec 2013 name.split(":")[0])) // Poser generates a count
1820
- if (n.startsWith(obj.name))
1828
+ String name = obj.name.split(":")[0]; // Poser generates a count
1829
+ //if (n.startsWith(obj.name))
1830
+ if (n.contains(name))
18211831 {
18221832 theobj = obj;
18231833 count++;
....@@ -2732,6 +2742,24 @@
27322742 blockloop = false;
27332743 }
27342744
2745
+ void GenNormalsMINE()
2746
+ {
2747
+ if (blockloop)
2748
+ return;
2749
+
2750
+ blockloop = true;
2751
+ GenNormalsMINE0();
2752
+ for (int i = 0; i < Children().Size(); i++)
2753
+ {
2754
+ Object3D child = (Object3D) Children().get(i); // reserve(i);
2755
+ if (child == null)
2756
+ continue;
2757
+ child.GenNormalsMINE();
2758
+// Children().release(i);
2759
+ }
2760
+ blockloop = false;
2761
+ }
2762
+
27352763 void ClearColors()
27362764 {
27372765 if (blockloop)
....@@ -2876,6 +2904,15 @@
28762904 if (bRep != null)
28772905 {
28782906 bRep.GenerateNormals(crease);
2907
+ Touch();
2908
+ }
2909
+ }
2910
+
2911
+ void GenNormalsMINE0()
2912
+ {
2913
+ if (bRep != null)
2914
+ {
2915
+ bRep.GenerateNormalsMINE();
28792916 Touch();
28802917 }
28812918 }
....@@ -3153,7 +3190,7 @@
31533190
31543191 BoundaryRep sup = bRep.support;
31553192 bRep.support = null;
3156
- BoundaryRep temprep = (BoundaryRep) GraphreeD.clone(bRep);
3193
+ BoundaryRep temprep = (BoundaryRep) GrafreeD.clone(bRep);
31573194 // bRep.SplitInTwo(onlyone); // thread...
31583195 temprep.SplitInTwo(reduction34, onlyone);
31593196 bRep = temprep;
....@@ -3677,7 +3714,7 @@
36773714 if (child == null)
36783715 continue;
36793716
3680
- if (GraphreeD.RENDERME > 0)
3717
+ if (GrafreeD.RENDERME > 0)
36813718 {
36823719 if (child instanceof Merge)
36833720 ((Merge)child).renderme();
....@@ -3717,7 +3754,7 @@
37173754
37183755 boolean getCentroid(cVector centroid, boolean xform)
37193756 {
3720
- assert(false);
3757
+// for speaker assert(false);
37213758 if (blockloop)
37223759 return false;
37233760
....@@ -3828,7 +3865,7 @@
38283865 if (child == null)
38293866 continue;
38303867
3831
- if (GraphreeD.RENDERME > 0)
3868
+ if (GrafreeD.RENDERME > 0)
38323869 {
38333870 if (child instanceof Merge)
38343871 ((Merge)child).renderme();
....@@ -4023,7 +4060,7 @@
40234060 if (child == null)
40244061 continue;
40254062
4026
- if (GraphreeD.RENDERME > 0)
4063
+ if (GrafreeD.RENDERME > 0)
40274064 {
40284065 if (child instanceof Merge)
40294066 ((Merge)child).renderme();
....@@ -4111,7 +4148,7 @@
41114148 if (blockloop)
41124149 return;
41134150
4114
- for (int i=0; i<size(); i++)
4151
+ for (int i=0; i<Size(); i++)
41154152 {
41164153 if (get(i).parent != this)
41174154 {
....@@ -4515,16 +4552,28 @@
45154552
45164553 Object3D GetFileRoot()
45174554 {
4555
+ if (overflow)
4556
+ return null;
4557
+
4558
+ overflow = true;
4559
+
4560
+ Object3D pfr = null;
4561
+
45184562 if (parent == null && fileparent == null)
4519
- return this;
4563
+ pfr = this;
45204564
45214565 if (parent == null && fileparent != null) // V4.gfd???
4522
- return fileparent;
4566
+ pfr = fileparent;
45234567
4524
- if (parent == null)
4525
- return this;
4568
+ if (pfr == null && parent == null)
4569
+ pfr = this;
45264570
4527
- return parent.GetFileRoot();
4571
+ if (pfr == null)
4572
+ pfr = parent.GetFileRoot();
4573
+
4574
+ overflow = false;
4575
+
4576
+ return pfr;
45284577 }
45294578
45304579 cTreePath GetPath()
....@@ -5280,7 +5329,7 @@
52805329 if (name != null && name.contains("sclera"))
52815330 name = name;
52825331
5283
- if (this instanceof CheckerIG)
5332
+ if (this instanceof Checker)
52845333 return;
52855334
52865335 if (display.drawMode == display.SHADOW && PASSTEST)
....@@ -5507,7 +5556,9 @@
55075556 display.options2[2] = material.factor;
55085557
55095558 cColor.HSBtoRGB(material.color, material.modulation, 1, display.options3);
5510
- display.options3[3] = material.cameralight/0.2f;
5559
+ display.options4[0] = material.cameralight/0.2f;
5560
+ display.options4[1] = material.subsurface;
5561
+ display.options4[2] = material.sheen;
55115562
55125563 // if (display.CURRENTANTIALIAS > 0)
55135564 // display.options3[3] /= 4;
....@@ -5807,12 +5858,12 @@
58075858 if (!child.HasTransparency())
58085859 {
58095860 sel = root != null && root.selection != null && root.selection.indexOf(child) != -1;
5810
- // GraphreeD.tracein("draw ", child);
5861
+ // GrafreeD.tracein("draw ", child);
58115862 boolean wasblocked = blockdraw;
58125863 blockdraw = true;
58135864 child.draw(display, root, selected || sel, wasblocked || blocked); // || child.IsSelected());
58145865 blockdraw = false;
5815
- // GraphreeD.traceout("draw ", child);
5866
+ // GrafreeD.traceout("draw ", child);
58165867 }
58175868
58185869 release(i);
....@@ -7719,7 +7770,7 @@
77197770 if (parent == null)
77207771 {
77217772 System.out.println("NULL PARENT");
7722
- new Exception().printStackTrace();
7773
+ //new Exception().printStackTrace();
77237774 } else
77247775 {
77257776 if (parent instanceof BezierPatch)
....@@ -7735,8 +7786,15 @@
77357786 info.pane.repaint();
77367787 }
77377788
7789
+ boolean overflow = false;
7790
+
77387791 void TransformToWorld(cVector out) // , cVector out)
77397792 {
7793
+ if (overflow)
7794
+ return;
7795
+
7796
+ overflow = true;
7797
+
77407798 // june 2013 ??? assert (in == out);
77417799 cVector in = out;
77427800 if (toParent != null && !(this instanceof Texture || this instanceof TextureNode))
....@@ -7753,6 +7811,8 @@
77537811 {
77547812 (parent!=null?parent:fileparent).TransformToWorld(out); //, out);
77557813 }
7814
+
7815
+ overflow = false;
77567816 }
77577817
77587818 void TransformToLocal(cVector out) //, cVector out)
....@@ -7995,19 +8055,22 @@
79958055 max = new cVector();
79968056 }
79978057
7998
- Object3D sourcenode = GetFileRoot();
7999
-
8000
- if (!sourcenode.name.contains("rclab"))
8058
+ if (false) // Can crawl!!
80018059 {
8002
- getBounds(min, max, true);
8060
+ Object3D sourcenode = GetFileRoot();
80038061
8004
- if (min.y != Double.POSITIVE_INFINITY && min.y > 2)
8062
+ if (sourcenode != null && !sourcenode.name.contains("rclab"))
80058063 {
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();
8064
+ getBounds(min, max, true);
8065
+
8066
+ if (min.y != Double.POSITIVE_INFINITY && min.y > 2)
8067
+ {
8068
+ // sourcenode.getBounds(min, max, true);
8069
+ sourcenode.getBounds(v0, v1, true);
8070
+ // sourcenode.toParent = sourcenode.toParent;
8071
+ // get(0).toParent = get(0).toParent;
8072
+ // sourcenode.GlobalTransform();
8073
+ }
80118074 }
80128075 }
80138076
....@@ -8016,7 +8079,8 @@
80168079 if (support != null)
80178080 {
80188081 assert(bRep != null);
8019
- GraphreeD.Assert(support.bRep == bRep.support);
8082
+ if (!(support instanceof GenericJoint)) // support.bRep != null)
8083
+ GrafreeD.Assert(support.bRep == bRep.support);
80208084 }
80218085 else
80228086 {