Normand Briere
2018-07-08 f4160780a4d8278920b99ada1050f320d6e30a73
Object3D.java
....@@ -285,6 +285,7 @@
285285 return parent.GetName() + "#";
286286 }
287287
288
+ boolean timeline = false;
288289 boolean live = false;
289290 boolean hide = false;
290291 boolean link2master = false; // performs reset support/master at each frame
....@@ -355,7 +356,7 @@
355356
356357 int MemorySize()
357358 {
358
- if (memorysize == 0)
359
+ if (true) // memorysize == 0)
359360 {
360361 try
361362 {
....@@ -935,7 +936,7 @@
935936
936937 public Object clone()
937938 {
938
- return GraphreeD.clone(this);
939
+ return GrafreeD.clone(this);
939940 }
940941
941942 Object3D copyExpand()
....@@ -1446,7 +1447,16 @@
14461447 // if (other == null)
14471448 // return;
14481449
1449
- System.out.println("Link support this = " + this + "; other = " + other);
1450
+ if (other != null)
1451
+ {
1452
+ BoundaryRep.SEUIL = other.material.cameralight;
1453
+
1454
+ // Set default to 0.1
1455
+ BoundaryRep.SEUIL /= 2;
1456
+ System.out.println("SEUIL = " + BoundaryRep.SEUIL);
1457
+ }
1458
+
1459
+ System.out.println("Link this = " + this + "; support = " + other);
14501460
14511461 //if (bRep != null)
14521462 // bRep.linkVerticesThis(other.bRep);
....@@ -1701,7 +1711,7 @@
17011711 Object3D o = new Object3D((clone?"Ge:":"Li:") + this.name);
17021712 o.bRep = transientrep;
17031713 if (clone)
1704
- o.bRep = (BoundaryRep) GraphreeD.clone(transientrep);
1714
+ o.bRep = (BoundaryRep) GrafreeD.clone(transientrep);
17051715 o.CreateMaterial();
17061716 o.SetAttributes(this, -1);
17071717 //parent
....@@ -1714,7 +1724,7 @@
17141724 Object3D o = new Object3D((clone?"Ge:":"Li:") + this.name);
17151725 o.bRep = bRep;
17161726 if (clone)
1717
- o.bRep = (BoundaryRep) GraphreeD.clone(bRep);
1727
+ o.bRep = (BoundaryRep) GrafreeD.clone(bRep);
17181728 o.CreateMaterial();
17191729 //o.overwriteThis(this, -1);
17201730 o.SetAttributes(this, -1);
....@@ -1756,7 +1766,7 @@
17561766 // {
17571767 // assert(bRep == null);
17581768 // Object3D o = new Object3D("Geometry:" + this.name);
1759
-// o.bRep = (BoundaryRep) GraphreeD.clone(transientrep);
1769
+// o.bRep = (BoundaryRep) GrafreeD.clone(transientrep);
17601770 // o.CreateMaterial();
17611771 // parent.addChild(o);
17621772 // }
....@@ -1765,7 +1775,7 @@
17651775 // {
17661776 // assert(transientrep == null);
17671777 // Object3D o = new Object3D("Geometry:" + this.name);
1768
-// o.bRep = (BoundaryRep) GraphreeD.clone(bRep);
1778
+// o.bRep = (BoundaryRep) GrafreeD.clone(bRep);
17691779 // o.CreateMaterial();
17701780 // parent.addChild(o);
17711781 // }
....@@ -1816,8 +1826,9 @@
18161826 if (obj.name == null)
18171827 continue; // can't be a null one
18181828
1819
- //if (n.contains(obj.name)) // dec 2013 name.split(":")[0])) // Poser generates a count
1820
- if (n.startsWith(obj.name))
1829
+ String name = obj.name.split(":")[0]; // Poser generates a count
1830
+ //if (n.startsWith(obj.name))
1831
+ if (n.contains(name))
18211832 {
18221833 theobj = obj;
18231834 count++;
....@@ -2732,6 +2743,24 @@
27322743 blockloop = false;
27332744 }
27342745
2746
+ void GenNormalsMINE()
2747
+ {
2748
+ if (blockloop)
2749
+ return;
2750
+
2751
+ blockloop = true;
2752
+ GenNormalsMINE0();
2753
+ for (int i = 0; i < Children().Size(); i++)
2754
+ {
2755
+ Object3D child = (Object3D) Children().get(i); // reserve(i);
2756
+ if (child == null)
2757
+ continue;
2758
+ child.GenNormalsMINE();
2759
+// Children().release(i);
2760
+ }
2761
+ blockloop = false;
2762
+ }
2763
+
27352764 void ClearColors()
27362765 {
27372766 if (blockloop)
....@@ -2876,6 +2905,15 @@
28762905 if (bRep != null)
28772906 {
28782907 bRep.GenerateNormals(crease);
2908
+ Touch();
2909
+ }
2910
+ }
2911
+
2912
+ void GenNormalsMINE0()
2913
+ {
2914
+ if (bRep != null)
2915
+ {
2916
+ bRep.GenerateNormalsMINE();
28792917 Touch();
28802918 }
28812919 }
....@@ -3153,7 +3191,7 @@
31533191
31543192 BoundaryRep sup = bRep.support;
31553193 bRep.support = null;
3156
- BoundaryRep temprep = (BoundaryRep) GraphreeD.clone(bRep);
3194
+ BoundaryRep temprep = (BoundaryRep) GrafreeD.clone(bRep);
31573195 // bRep.SplitInTwo(onlyone); // thread...
31583196 temprep.SplitInTwo(reduction34, onlyone);
31593197 bRep = temprep;
....@@ -3677,7 +3715,7 @@
36773715 if (child == null)
36783716 continue;
36793717
3680
- if (GraphreeD.RENDERME > 0)
3718
+ if (GrafreeD.RENDERME > 0)
36813719 {
36823720 if (child instanceof Merge)
36833721 ((Merge)child).renderme();
....@@ -3717,7 +3755,7 @@
37173755
37183756 boolean getCentroid(cVector centroid, boolean xform)
37193757 {
3720
- assert(false);
3758
+// for speaker assert(false);
37213759 if (blockloop)
37223760 return false;
37233761
....@@ -3828,7 +3866,7 @@
38283866 if (child == null)
38293867 continue;
38303868
3831
- if (GraphreeD.RENDERME > 0)
3869
+ if (GrafreeD.RENDERME > 0)
38323870 {
38333871 if (child instanceof Merge)
38343872 ((Merge)child).renderme();
....@@ -4023,7 +4061,7 @@
40234061 if (child == null)
40244062 continue;
40254063
4026
- if (GraphreeD.RENDERME > 0)
4064
+ if (GrafreeD.RENDERME > 0)
40274065 {
40284066 if (child instanceof Merge)
40294067 ((Merge)child).renderme();
....@@ -4111,7 +4149,7 @@
41114149 if (blockloop)
41124150 return;
41134151
4114
- for (int i=0; i<size(); i++)
4152
+ for (int i=0; i<Size(); i++)
41154153 {
41164154 if (get(i).parent != this)
41174155 {
....@@ -4515,16 +4553,28 @@
45154553
45164554 Object3D GetFileRoot()
45174555 {
4556
+ if (overflow)
4557
+ return null;
4558
+
4559
+ overflow = true;
4560
+
4561
+ Object3D pfr = null;
4562
+
45184563 if (parent == null && fileparent == null)
4519
- return this;
4564
+ pfr = this;
45204565
45214566 if (parent == null && fileparent != null) // V4.gfd???
4522
- return fileparent;
4567
+ pfr = fileparent;
45234568
4524
- if (parent == null)
4525
- return this;
4569
+ if (pfr == null && parent == null)
4570
+ pfr = this;
45264571
4527
- return parent.GetFileRoot();
4572
+ if (pfr == null)
4573
+ pfr = parent.GetFileRoot();
4574
+
4575
+ overflow = false;
4576
+
4577
+ return pfr;
45284578 }
45294579
45304580 cTreePath GetPath()
....@@ -5280,7 +5330,7 @@
52805330 if (name != null && name.contains("sclera"))
52815331 name = name;
52825332
5283
- if (this instanceof CheckerIG)
5333
+ if (this instanceof Checker)
52845334 return;
52855335
52865336 if (display.drawMode == display.SHADOW && PASSTEST)
....@@ -5507,7 +5557,9 @@
55075557 display.options2[2] = material.factor;
55085558
55095559 cColor.HSBtoRGB(material.color, material.modulation, 1, display.options3);
5510
- display.options3[3] = material.cameralight/0.2f;
5560
+ display.options4[0] = material.cameralight/0.2f;
5561
+ display.options4[1] = material.subsurface;
5562
+ display.options4[2] = material.sheen;
55115563
55125564 // if (display.CURRENTANTIALIAS > 0)
55135565 // display.options3[3] /= 4;
....@@ -5807,12 +5859,12 @@
58075859 if (!child.HasTransparency())
58085860 {
58095861 sel = root != null && root.selection != null && root.selection.indexOf(child) != -1;
5810
- // GraphreeD.tracein("draw ", child);
5862
+ // GrafreeD.tracein("draw ", child);
58115863 boolean wasblocked = blockdraw;
58125864 blockdraw = true;
58135865 child.draw(display, root, selected || sel, wasblocked || blocked); // || child.IsSelected());
58145866 blockdraw = false;
5815
- // GraphreeD.traceout("draw ", child);
5867
+ // GrafreeD.traceout("draw ", child);
58165868 }
58175869
58185870 release(i);
....@@ -7719,7 +7771,7 @@
77197771 if (parent == null)
77207772 {
77217773 System.out.println("NULL PARENT");
7722
- new Exception().printStackTrace();
7774
+ //new Exception().printStackTrace();
77237775 } else
77247776 {
77257777 if (parent instanceof BezierPatch)
....@@ -7735,8 +7787,15 @@
77357787 info.pane.repaint();
77367788 }
77377789
7790
+ boolean overflow = false;
7791
+
77387792 void TransformToWorld(cVector out) // , cVector out)
77397793 {
7794
+ if (overflow)
7795
+ return;
7796
+
7797
+ overflow = true;
7798
+
77407799 // june 2013 ??? assert (in == out);
77417800 cVector in = out;
77427801 if (toParent != null && !(this instanceof Texture || this instanceof TextureNode))
....@@ -7753,6 +7812,8 @@
77537812 {
77547813 (parent!=null?parent:fileparent).TransformToWorld(out); //, out);
77557814 }
7815
+
7816
+ overflow = false;
77567817 }
77577818
77587819 void TransformToLocal(cVector out) //, cVector out)
....@@ -7995,19 +8056,22 @@
79958056 max = new cVector();
79968057 }
79978058
7998
- Object3D sourcenode = GetFileRoot();
7999
-
8000
- if (!sourcenode.name.contains("rclab"))
8059
+ if (false) // Can crawl!!
80018060 {
8002
- getBounds(min, max, true);
8061
+ Object3D sourcenode = GetFileRoot();
80038062
8004
- if (min.y != Double.POSITIVE_INFINITY && min.y > 2)
8063
+ if (sourcenode != null && !sourcenode.name.contains("rclab"))
80058064 {
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();
8065
+ getBounds(min, max, true);
8066
+
8067
+ if (min.y != Double.POSITIVE_INFINITY && min.y > 2)
8068
+ {
8069
+ // sourcenode.getBounds(min, max, true);
8070
+ sourcenode.getBounds(v0, v1, true);
8071
+ // sourcenode.toParent = sourcenode.toParent;
8072
+ // get(0).toParent = get(0).toParent;
8073
+ // sourcenode.GlobalTransform();
8074
+ }
80118075 }
80128076 }
80138077
....@@ -8016,7 +8080,8 @@
80168080 if (support != null)
80178081 {
80188082 assert(bRep != null);
8019
- GraphreeD.Assert(support.bRep == bRep.support);
8083
+ if (!(support instanceof GenericJoint)) // support.bRep != null)
8084
+ GrafreeD.Assert(support.bRep == bRep.support);
80208085 }
80218086 else
80228087 {