.. | .. |
---|
285 | 285 | return parent.GetName() + "#"; |
---|
286 | 286 | } |
---|
287 | 287 | |
---|
| 288 | + boolean timeline = false; |
---|
288 | 289 | boolean live = false; |
---|
289 | 290 | boolean hide = false; |
---|
290 | 291 | boolean link2master = false; // performs reset support/master at each frame |
---|
.. | .. |
---|
355 | 356 | |
---|
356 | 357 | int MemorySize() |
---|
357 | 358 | { |
---|
358 | | - if (memorysize == 0) |
---|
| 359 | + if (true) // memorysize == 0) |
---|
359 | 360 | { |
---|
360 | 361 | try |
---|
361 | 362 | { |
---|
.. | .. |
---|
935 | 936 | |
---|
936 | 937 | public Object clone() |
---|
937 | 938 | { |
---|
938 | | - return GraphreeD.clone(this); |
---|
| 939 | + return GrafreeD.clone(this); |
---|
939 | 940 | } |
---|
940 | 941 | |
---|
941 | 942 | Object3D copyExpand() |
---|
.. | .. |
---|
1446 | 1447 | // if (other == null) |
---|
1447 | 1448 | // return; |
---|
1448 | 1449 | |
---|
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); |
---|
1450 | 1460 | |
---|
1451 | 1461 | //if (bRep != null) |
---|
1452 | 1462 | // bRep.linkVerticesThis(other.bRep); |
---|
.. | .. |
---|
1701 | 1711 | Object3D o = new Object3D((clone?"Ge:":"Li:") + this.name); |
---|
1702 | 1712 | o.bRep = transientrep; |
---|
1703 | 1713 | if (clone) |
---|
1704 | | - o.bRep = (BoundaryRep) GraphreeD.clone(transientrep); |
---|
| 1714 | + o.bRep = (BoundaryRep) GrafreeD.clone(transientrep); |
---|
1705 | 1715 | o.CreateMaterial(); |
---|
1706 | 1716 | o.SetAttributes(this, -1); |
---|
1707 | 1717 | //parent |
---|
.. | .. |
---|
1714 | 1724 | Object3D o = new Object3D((clone?"Ge:":"Li:") + this.name); |
---|
1715 | 1725 | o.bRep = bRep; |
---|
1716 | 1726 | if (clone) |
---|
1717 | | - o.bRep = (BoundaryRep) GraphreeD.clone(bRep); |
---|
| 1727 | + o.bRep = (BoundaryRep) GrafreeD.clone(bRep); |
---|
1718 | 1728 | o.CreateMaterial(); |
---|
1719 | 1729 | //o.overwriteThis(this, -1); |
---|
1720 | 1730 | o.SetAttributes(this, -1); |
---|
.. | .. |
---|
1756 | 1766 | // { |
---|
1757 | 1767 | // assert(bRep == null); |
---|
1758 | 1768 | // Object3D o = new Object3D("Geometry:" + this.name); |
---|
1759 | | -// o.bRep = (BoundaryRep) GraphreeD.clone(transientrep); |
---|
| 1769 | +// o.bRep = (BoundaryRep) GrafreeD.clone(transientrep); |
---|
1760 | 1770 | // o.CreateMaterial(); |
---|
1761 | 1771 | // parent.addChild(o); |
---|
1762 | 1772 | // } |
---|
.. | .. |
---|
1765 | 1775 | // { |
---|
1766 | 1776 | // assert(transientrep == null); |
---|
1767 | 1777 | // Object3D o = new Object3D("Geometry:" + this.name); |
---|
1768 | | -// o.bRep = (BoundaryRep) GraphreeD.clone(bRep); |
---|
| 1778 | +// o.bRep = (BoundaryRep) GrafreeD.clone(bRep); |
---|
1769 | 1779 | // o.CreateMaterial(); |
---|
1770 | 1780 | // parent.addChild(o); |
---|
1771 | 1781 | // } |
---|
.. | .. |
---|
1816 | 1826 | if (obj.name == null) |
---|
1817 | 1827 | continue; // can't be a null one |
---|
1818 | 1828 | |
---|
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)) |
---|
1821 | 1832 | { |
---|
1822 | 1833 | theobj = obj; |
---|
1823 | 1834 | count++; |
---|
.. | .. |
---|
2732 | 2743 | blockloop = false; |
---|
2733 | 2744 | } |
---|
2734 | 2745 | |
---|
| 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 | + |
---|
2735 | 2764 | void ClearColors() |
---|
2736 | 2765 | { |
---|
2737 | 2766 | if (blockloop) |
---|
.. | .. |
---|
2876 | 2905 | if (bRep != null) |
---|
2877 | 2906 | { |
---|
2878 | 2907 | bRep.GenerateNormals(crease); |
---|
| 2908 | + Touch(); |
---|
| 2909 | + } |
---|
| 2910 | + } |
---|
| 2911 | + |
---|
| 2912 | + void GenNormalsMINE0() |
---|
| 2913 | + { |
---|
| 2914 | + if (bRep != null) |
---|
| 2915 | + { |
---|
| 2916 | + bRep.GenerateNormalsMINE(); |
---|
2879 | 2917 | Touch(); |
---|
2880 | 2918 | } |
---|
2881 | 2919 | } |
---|
.. | .. |
---|
3153 | 3191 | |
---|
3154 | 3192 | BoundaryRep sup = bRep.support; |
---|
3155 | 3193 | bRep.support = null; |
---|
3156 | | - BoundaryRep temprep = (BoundaryRep) GraphreeD.clone(bRep); |
---|
| 3194 | + BoundaryRep temprep = (BoundaryRep) GrafreeD.clone(bRep); |
---|
3157 | 3195 | // bRep.SplitInTwo(onlyone); // thread... |
---|
3158 | 3196 | temprep.SplitInTwo(reduction34, onlyone); |
---|
3159 | 3197 | bRep = temprep; |
---|
.. | .. |
---|
3677 | 3715 | if (child == null) |
---|
3678 | 3716 | continue; |
---|
3679 | 3717 | |
---|
3680 | | - if (GraphreeD.RENDERME > 0) |
---|
| 3718 | + if (GrafreeD.RENDERME > 0) |
---|
3681 | 3719 | { |
---|
3682 | 3720 | if (child instanceof Merge) |
---|
3683 | 3721 | ((Merge)child).renderme(); |
---|
.. | .. |
---|
3717 | 3755 | |
---|
3718 | 3756 | boolean getCentroid(cVector centroid, boolean xform) |
---|
3719 | 3757 | { |
---|
3720 | | - assert(false); |
---|
| 3758 | +// for speaker assert(false); |
---|
3721 | 3759 | if (blockloop) |
---|
3722 | 3760 | return false; |
---|
3723 | 3761 | |
---|
.. | .. |
---|
3828 | 3866 | if (child == null) |
---|
3829 | 3867 | continue; |
---|
3830 | 3868 | |
---|
3831 | | - if (GraphreeD.RENDERME > 0) |
---|
| 3869 | + if (GrafreeD.RENDERME > 0) |
---|
3832 | 3870 | { |
---|
3833 | 3871 | if (child instanceof Merge) |
---|
3834 | 3872 | ((Merge)child).renderme(); |
---|
.. | .. |
---|
4023 | 4061 | if (child == null) |
---|
4024 | 4062 | continue; |
---|
4025 | 4063 | |
---|
4026 | | - if (GraphreeD.RENDERME > 0) |
---|
| 4064 | + if (GrafreeD.RENDERME > 0) |
---|
4027 | 4065 | { |
---|
4028 | 4066 | if (child instanceof Merge) |
---|
4029 | 4067 | ((Merge)child).renderme(); |
---|
.. | .. |
---|
4111 | 4149 | if (blockloop) |
---|
4112 | 4150 | return; |
---|
4113 | 4151 | |
---|
4114 | | - for (int i=0; i<size(); i++) |
---|
| 4152 | + for (int i=0; i<Size(); i++) |
---|
4115 | 4153 | { |
---|
4116 | 4154 | if (get(i).parent != this) |
---|
4117 | 4155 | { |
---|
.. | .. |
---|
4515 | 4553 | |
---|
4516 | 4554 | Object3D GetFileRoot() |
---|
4517 | 4555 | { |
---|
| 4556 | + if (overflow) |
---|
| 4557 | + return null; |
---|
| 4558 | + |
---|
| 4559 | + overflow = true; |
---|
| 4560 | + |
---|
| 4561 | + Object3D pfr = null; |
---|
| 4562 | + |
---|
4518 | 4563 | if (parent == null && fileparent == null) |
---|
4519 | | - return this; |
---|
| 4564 | + pfr = this; |
---|
4520 | 4565 | |
---|
4521 | 4566 | if (parent == null && fileparent != null) // V4.gfd??? |
---|
4522 | | - return fileparent; |
---|
| 4567 | + pfr = fileparent; |
---|
4523 | 4568 | |
---|
4524 | | - if (parent == null) |
---|
4525 | | - return this; |
---|
| 4569 | + if (pfr == null && parent == null) |
---|
| 4570 | + pfr = this; |
---|
4526 | 4571 | |
---|
4527 | | - return parent.GetFileRoot(); |
---|
| 4572 | + if (pfr == null) |
---|
| 4573 | + pfr = parent.GetFileRoot(); |
---|
| 4574 | + |
---|
| 4575 | + overflow = false; |
---|
| 4576 | + |
---|
| 4577 | + return pfr; |
---|
4528 | 4578 | } |
---|
4529 | 4579 | |
---|
4530 | 4580 | cTreePath GetPath() |
---|
.. | .. |
---|
5280 | 5330 | if (name != null && name.contains("sclera")) |
---|
5281 | 5331 | name = name; |
---|
5282 | 5332 | |
---|
5283 | | - if (this instanceof CheckerIG) |
---|
| 5333 | + if (this instanceof Checker) |
---|
5284 | 5334 | return; |
---|
5285 | 5335 | |
---|
5286 | 5336 | if (display.drawMode == display.SHADOW && PASSTEST) |
---|
.. | .. |
---|
5507 | 5557 | display.options2[2] = material.factor; |
---|
5508 | 5558 | |
---|
5509 | 5559 | 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; |
---|
5511 | 5563 | |
---|
5512 | 5564 | // if (display.CURRENTANTIALIAS > 0) |
---|
5513 | 5565 | // display.options3[3] /= 4; |
---|
.. | .. |
---|
5807 | 5859 | if (!child.HasTransparency()) |
---|
5808 | 5860 | { |
---|
5809 | 5861 | sel = root != null && root.selection != null && root.selection.indexOf(child) != -1; |
---|
5810 | | - // GraphreeD.tracein("draw ", child); |
---|
| 5862 | + // GrafreeD.tracein("draw ", child); |
---|
5811 | 5863 | boolean wasblocked = blockdraw; |
---|
5812 | 5864 | blockdraw = true; |
---|
5813 | 5865 | child.draw(display, root, selected || sel, wasblocked || blocked); // || child.IsSelected()); |
---|
5814 | 5866 | blockdraw = false; |
---|
5815 | | - // GraphreeD.traceout("draw ", child); |
---|
| 5867 | + // GrafreeD.traceout("draw ", child); |
---|
5816 | 5868 | } |
---|
5817 | 5869 | |
---|
5818 | 5870 | release(i); |
---|
.. | .. |
---|
7719 | 7771 | if (parent == null) |
---|
7720 | 7772 | { |
---|
7721 | 7773 | System.out.println("NULL PARENT"); |
---|
7722 | | - new Exception().printStackTrace(); |
---|
| 7774 | + //new Exception().printStackTrace(); |
---|
7723 | 7775 | } else |
---|
7724 | 7776 | { |
---|
7725 | 7777 | if (parent instanceof BezierPatch) |
---|
.. | .. |
---|
7735 | 7787 | info.pane.repaint(); |
---|
7736 | 7788 | } |
---|
7737 | 7789 | |
---|
| 7790 | + boolean overflow = false; |
---|
| 7791 | + |
---|
7738 | 7792 | void TransformToWorld(cVector out) // , cVector out) |
---|
7739 | 7793 | { |
---|
| 7794 | + if (overflow) |
---|
| 7795 | + return; |
---|
| 7796 | + |
---|
| 7797 | + overflow = true; |
---|
| 7798 | + |
---|
7740 | 7799 | // june 2013 ??? assert (in == out); |
---|
7741 | 7800 | cVector in = out; |
---|
7742 | 7801 | if (toParent != null && !(this instanceof Texture || this instanceof TextureNode)) |
---|
.. | .. |
---|
7753 | 7812 | { |
---|
7754 | 7813 | (parent!=null?parent:fileparent).TransformToWorld(out); //, out); |
---|
7755 | 7814 | } |
---|
| 7815 | + |
---|
| 7816 | + overflow = false; |
---|
7756 | 7817 | } |
---|
7757 | 7818 | |
---|
7758 | 7819 | void TransformToLocal(cVector out) //, cVector out) |
---|
.. | .. |
---|
7995 | 8056 | max = new cVector(); |
---|
7996 | 8057 | } |
---|
7997 | 8058 | |
---|
7998 | | - Object3D sourcenode = GetFileRoot(); |
---|
7999 | | - |
---|
8000 | | - if (!sourcenode.name.contains("rclab")) |
---|
| 8059 | + if (false) // Can crawl!! |
---|
8001 | 8060 | { |
---|
8002 | | - getBounds(min, max, true); |
---|
| 8061 | + Object3D sourcenode = GetFileRoot(); |
---|
8003 | 8062 | |
---|
8004 | | - if (min.y != Double.POSITIVE_INFINITY && min.y > 2) |
---|
| 8063 | + if (sourcenode != null && !sourcenode.name.contains("rclab")) |
---|
8005 | 8064 | { |
---|
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 | + } |
---|
8011 | 8075 | } |
---|
8012 | 8076 | } |
---|
8013 | 8077 | |
---|
.. | .. |
---|
8016 | 8080 | if (support != null) |
---|
8017 | 8081 | { |
---|
8018 | 8082 | 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); |
---|
8020 | 8085 | } |
---|
8021 | 8086 | else |
---|
8022 | 8087 | { |
---|