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