.. | .. |
---|
14 | 14 | import //weka.core. |
---|
15 | 15 | matrix.Matrix; |
---|
16 | 16 | |
---|
| 17 | +import java.util.UUID; |
---|
| 18 | + |
---|
17 | 19 | //import net.sourceforge.sizeof.SizeOf; |
---|
18 | 20 | public class Object3D extends Vector<Object3D> implements java.io.Serializable, iSendInfo //, aurelienribon.tweenengine.TweenAccessor<Object3D> |
---|
19 | 21 | { |
---|
20 | 22 | //static final long serialVersionUID = -607422624994562685L; |
---|
21 | 23 | static final long serialVersionUID = 5022536242724664900L; |
---|
| 24 | + |
---|
| 25 | + private UUID uuid = UUID.randomUUID(); |
---|
| 26 | + |
---|
| 27 | + // TEMPORARY for mocap undo |
---|
| 28 | + mocap.reader.BVHReader.BVHResult bvh; |
---|
| 29 | + Object3D skeleton; |
---|
| 30 | + // |
---|
22 | 31 | |
---|
23 | 32 | ScriptNode scriptnode; |
---|
24 | 33 | |
---|
.. | .. |
---|
100 | 109 | |
---|
101 | 110 | // transient boolean reduced; // for morph reduction |
---|
102 | 111 | |
---|
103 | | -transient com.bulletphysics.linearmath.Transform cache; // for fast merge |
---|
104 | | -transient com.bulletphysics.linearmath.Transform cache_1; // for fast merge |
---|
| 112 | + transient com.bulletphysics.linearmath.Transform cache; // for fast merge |
---|
| 113 | + transient com.bulletphysics.linearmath.Transform cache_1; // for fast merge |
---|
105 | 114 | |
---|
106 | | -transient Object3D transientsupport; // for cloning |
---|
107 | | -transient boolean transientlink2master; |
---|
| 115 | + transient Object3D transientsupport; // for cloning |
---|
| 116 | + transient boolean transientlink2master; |
---|
108 | 117 | |
---|
109 | | -void SaveSupports() |
---|
110 | | -{ |
---|
111 | | - if (blockloop) |
---|
112 | | - return; |
---|
113 | | - |
---|
114 | | - transientsupport = support; |
---|
115 | | - transientlink2master = link2master; |
---|
116 | | - |
---|
117 | | - support = null; |
---|
118 | | - link2master = false; |
---|
119 | | - |
---|
120 | | - if (bRep != null) |
---|
| 118 | + void SaveSupports() |
---|
121 | 119 | { |
---|
122 | | - bRep.SaveSupports(); |
---|
123 | | - } |
---|
124 | | - |
---|
125 | | - for (int i = 0; i < Size(); i++) |
---|
126 | | - { |
---|
127 | | - Object3D child = (Object3D) get(i); |
---|
128 | | - if (child == null) |
---|
129 | | - continue; |
---|
130 | | - blockloop = true; |
---|
131 | | - child.SaveSupports(); |
---|
132 | | - blockloop = false; |
---|
133 | | - } |
---|
134 | | -} |
---|
| 120 | + if (blockloop) |
---|
| 121 | + return; |
---|
135 | 122 | |
---|
136 | | -void RestoreSupports() |
---|
137 | | -{ |
---|
138 | | - if (blockloop) |
---|
139 | | - return; |
---|
| 123 | + transientsupport = support; |
---|
| 124 | + transientlink2master = link2master; |
---|
140 | 125 | |
---|
141 | | - support = transientsupport; |
---|
142 | | - link2master = transientlink2master; |
---|
143 | | - transientsupport = null; |
---|
144 | | - transientlink2master = false; |
---|
145 | | - |
---|
146 | | - if (bRep != null) |
---|
147 | | - { |
---|
148 | | - bRep.RestoreSupports(); |
---|
| 126 | + support = null; |
---|
| 127 | + link2master = false; |
---|
| 128 | + |
---|
| 129 | + if (bRep != null) |
---|
| 130 | + { |
---|
| 131 | + bRep.SaveSupports(); |
---|
| 132 | + } |
---|
| 133 | + |
---|
| 134 | + for (int i = 0; i < Size(); i++) |
---|
| 135 | + { |
---|
| 136 | + Object3D child = (Object3D) get(i); |
---|
| 137 | + if (child == null) |
---|
| 138 | + continue; |
---|
| 139 | + blockloop = true; |
---|
| 140 | + child.SaveSupports(); |
---|
| 141 | + blockloop = false; |
---|
| 142 | + } |
---|
149 | 143 | } |
---|
150 | | - |
---|
151 | | - for (int i = 0; i < Size(); i++) |
---|
| 144 | + |
---|
| 145 | + void RestoreSupports() |
---|
152 | 146 | { |
---|
153 | | - Object3D child = (Object3D) get(i); |
---|
154 | | - if (child == null) |
---|
155 | | - continue; |
---|
156 | | - blockloop = true; |
---|
157 | | - child.RestoreSupports(); |
---|
158 | | - blockloop = false; |
---|
| 147 | + if (blockloop) |
---|
| 148 | + return; |
---|
| 149 | + |
---|
| 150 | + support = transientsupport; |
---|
| 151 | + link2master = transientlink2master; |
---|
| 152 | + transientsupport = null; |
---|
| 153 | + transientlink2master = false; |
---|
| 154 | + |
---|
| 155 | + if (bRep != null) |
---|
| 156 | + { |
---|
| 157 | + bRep.RestoreSupports(); |
---|
| 158 | + } |
---|
| 159 | + |
---|
| 160 | + for (int i = 0; i < Size(); i++) |
---|
| 161 | + { |
---|
| 162 | + Object3D child = (Object3D) get(i); |
---|
| 163 | + if (child == null) |
---|
| 164 | + continue; |
---|
| 165 | + blockloop = true; |
---|
| 166 | + child.RestoreSupports(); |
---|
| 167 | + blockloop = false; |
---|
| 168 | + } |
---|
159 | 169 | } |
---|
160 | | -} |
---|
| 170 | + |
---|
| 171 | + void ExtractBigData(java.util.Hashtable<java.util.UUID, Object3D> hashtable) |
---|
| 172 | + { |
---|
| 173 | + if (hashtable.containsKey(GetUUID())) |
---|
| 174 | + { |
---|
| 175 | + Object3D o = hashtable.get(GetUUID()); |
---|
| 176 | + |
---|
| 177 | + Grafreed.Assert(this.bRep == o.bRep); |
---|
| 178 | + if (this.bRep != null) |
---|
| 179 | + assert(this.bRep.support == o.transientrep); |
---|
| 180 | + |
---|
| 181 | + return; |
---|
| 182 | + } |
---|
| 183 | + |
---|
| 184 | + Object3D o = new Object3D(); |
---|
| 185 | + |
---|
| 186 | + hashtable.put(GetUUID(), o); |
---|
| 187 | + |
---|
| 188 | + for (int i=0; i<Size(); i++) |
---|
| 189 | + { |
---|
| 190 | + get(i).ExtractBigData(hashtable); |
---|
| 191 | + } |
---|
| 192 | + |
---|
| 193 | + ExtractBigData(o); |
---|
| 194 | + } |
---|
| 195 | + |
---|
| 196 | + void ExtractBigData(Object3D o) |
---|
| 197 | + { |
---|
| 198 | + o.bRep = this.bRep; |
---|
| 199 | + if (this.bRep != null) |
---|
| 200 | + { |
---|
| 201 | + o.transientrep = this.bRep.support; |
---|
| 202 | + o.bRep.support = null; |
---|
| 203 | + } |
---|
| 204 | + |
---|
| 205 | + // o.support = this.support; |
---|
| 206 | + // o.fileparent = this.fileparent; |
---|
| 207 | + // if (this.bRep != null) |
---|
| 208 | + // o.bRep = this.bRep.support; |
---|
| 209 | + |
---|
| 210 | + this.bRep = null; |
---|
| 211 | + // if (this.bRep != null) |
---|
| 212 | + // this.bRep.support = null; |
---|
| 213 | + // this.support = null; |
---|
| 214 | + // this.fileparent = null; |
---|
| 215 | + } |
---|
| 216 | + |
---|
| 217 | + void RestoreBigData(java.util.Hashtable<java.util.UUID, Object3D> hashtable) |
---|
| 218 | + { |
---|
| 219 | + if (!hashtable.containsKey(GetUUID())) |
---|
| 220 | + return; |
---|
| 221 | + |
---|
| 222 | + Object3D o = hashtable.get(GetUUID()); |
---|
| 223 | + |
---|
| 224 | + RestoreBigData(o); |
---|
| 225 | + |
---|
| 226 | + hashtable.remove(GetUUID()); |
---|
| 227 | + |
---|
| 228 | + for (int i=0; i<Size(); i++) |
---|
| 229 | + { |
---|
| 230 | + get(i).RestoreBigData(hashtable); |
---|
| 231 | + } |
---|
| 232 | + } |
---|
| 233 | + |
---|
| 234 | + void RestoreBigData(Object3D o) |
---|
| 235 | + { |
---|
| 236 | + this.bRep = o.bRep; |
---|
| 237 | + if (this.bRep != null) |
---|
| 238 | + this.bRep.support = o.transientrep; |
---|
| 239 | + // this.support = o.support; |
---|
| 240 | + // this.fileparent = o.fileparent; |
---|
| 241 | + } |
---|
161 | 242 | |
---|
162 | 243 | // MOCAP SUPPORT |
---|
163 | 244 | double tx,ty,tz,rx,ry,rz; |
---|
.. | .. |
---|
300 | 381 | } |
---|
301 | 382 | |
---|
302 | 383 | boolean live = false; |
---|
| 384 | + boolean dontselect = false; |
---|
303 | 385 | boolean hide = false; |
---|
304 | 386 | boolean link2master = false; // performs reset support/master at each frame |
---|
305 | 387 | boolean marked = false; // animation node |
---|
.. | .. |
---|
481 | 563 | toParent = LA.newMatrix(); |
---|
482 | 564 | fromParent = LA.newMatrix(); |
---|
483 | 565 | } |
---|
| 566 | + |
---|
484 | 567 | if (toParentMarked == null) |
---|
485 | 568 | { |
---|
486 | 569 | if (maxcount != 1) |
---|
487 | 570 | { |
---|
488 | 571 | new Exception().printStackTrace(); |
---|
489 | 572 | } |
---|
| 573 | + |
---|
490 | 574 | toParentMarked = LA.newMatrix(); |
---|
491 | 575 | fromParentMarked = LA.newMatrix(); |
---|
492 | 576 | } |
---|
.. | .. |
---|
774 | 858 | if (step == 0) |
---|
775 | 859 | step = 1; |
---|
776 | 860 | if (maxcount == 0) |
---|
777 | | - maxcount = 2048; // 4; |
---|
| 861 | + maxcount = 128; // 2048; // 4; |
---|
778 | 862 | // if (acceleration == 0) |
---|
779 | 863 | // acceleration = 10; |
---|
780 | 864 | if (delay == 0) // serial |
---|
.. | .. |
---|
797 | 881 | |
---|
798 | 882 | if (marked && Globals.isLIVE() && live && |
---|
799 | 883 | //TEMP21aug2018 |
---|
800 | | - Globals.DrawMode() == iCameraPane.SHADOW && |
---|
| 884 | + (Globals.DrawMode() == iCameraPane.SHADOW || !Globals.RENDERSHADOW) && |
---|
801 | 885 | currentframe != Globals.framecount) |
---|
802 | 886 | { |
---|
803 | 887 | currentframe = Globals.framecount; |
---|
.. | .. |
---|
912 | 996 | fromParent = null; // LA.newMatrix(); |
---|
913 | 997 | bRep = null; // new BoundaryRep(); |
---|
914 | 998 | |
---|
| 999 | + if (oname != null && oname.equals("LeftHand")) |
---|
| 1000 | + { |
---|
| 1001 | + name = oname; |
---|
| 1002 | + } |
---|
| 1003 | + |
---|
915 | 1004 | /* |
---|
916 | 1005 | float hue = (float)Math.random(); |
---|
917 | 1006 | Color col; |
---|
.. | .. |
---|
954 | 1043 | |
---|
955 | 1044 | public Object clone() |
---|
956 | 1045 | { |
---|
957 | | - return GrafreeD.clone(this); |
---|
| 1046 | + return Grafreed.clone(this); |
---|
958 | 1047 | } |
---|
959 | 1048 | |
---|
960 | 1049 | Object3D copyExpand() |
---|
.. | .. |
---|
1470 | 1559 | BoundaryRep.SEUIL = other.material.cameralight; |
---|
1471 | 1560 | |
---|
1472 | 1561 | // Set default to 0.1 |
---|
1473 | | - BoundaryRep.SEUIL /= 2; |
---|
| 1562 | + BoundaryRep.SEUIL /= 4; // 2; |
---|
1474 | 1563 | System.out.println("SEUIL = " + BoundaryRep.SEUIL); |
---|
1475 | 1564 | } |
---|
1476 | 1565 | |
---|
.. | .. |
---|
1729 | 1818 | Object3D o = new Object3D((clone?"Ge:":"Li:") + this.name); |
---|
1730 | 1819 | o.bRep = transientrep; |
---|
1731 | 1820 | if (clone) |
---|
1732 | | - o.bRep = (BoundaryRep) GrafreeD.clone(transientrep); |
---|
| 1821 | + o.bRep = (BoundaryRep) Grafreed.clone(transientrep); |
---|
1733 | 1822 | o.CreateMaterial(); |
---|
1734 | 1823 | o.SetAttributes(this, -1); |
---|
1735 | 1824 | //parent |
---|
.. | .. |
---|
1742 | 1831 | Object3D o = new Object3D((clone?"Ge:":"Li:") + this.name); |
---|
1743 | 1832 | o.bRep = bRep; |
---|
1744 | 1833 | if (clone) |
---|
1745 | | - o.bRep = (BoundaryRep) GrafreeD.clone(bRep); |
---|
| 1834 | + o.bRep = (BoundaryRep) Grafreed.clone(bRep); |
---|
1746 | 1835 | o.CreateMaterial(); |
---|
1747 | 1836 | //o.overwriteThis(this, -1); |
---|
1748 | 1837 | o.SetAttributes(this, -1); |
---|
.. | .. |
---|
1829 | 1918 | if (obj.name == null) |
---|
1830 | 1919 | continue; // can't be a null one |
---|
1831 | 1920 | |
---|
| 1921 | + // Try perfect match first. |
---|
1832 | 1922 | if (n.equals(obj.name)) |
---|
1833 | 1923 | { |
---|
1834 | 1924 | theobj = obj; |
---|
1835 | 1925 | count++; |
---|
1836 | 1926 | } |
---|
1837 | 1927 | } |
---|
| 1928 | + |
---|
| 1929 | + // not needed: n = n.split(":")[0]; // Poser generates a count |
---|
1838 | 1930 | |
---|
1839 | 1931 | if (count != 1) |
---|
1840 | 1932 | for (int i=Size(); --i>=0;) |
---|
.. | .. |
---|
2300 | 2392 | { |
---|
2301 | 2393 | if (newWindow) |
---|
2302 | 2394 | { |
---|
| 2395 | + new Exception().printStackTrace(); |
---|
2303 | 2396 | System.exit(0); |
---|
2304 | 2397 | if (parent != null) |
---|
2305 | 2398 | { |
---|
.. | .. |
---|
2476 | 2569 | return retval; |
---|
2477 | 2570 | } |
---|
2478 | 2571 | |
---|
2479 | | - void doEditDrag(ClickInfo info) |
---|
| 2572 | + void doEditDrag(ClickInfo info, boolean opposite) |
---|
2480 | 2573 | { |
---|
2481 | 2574 | switch (doSomething) |
---|
2482 | 2575 | { |
---|
2483 | 2576 | case 1: // '\001' |
---|
2484 | 2577 | //super. |
---|
2485 | | - doEditDrag0(info); |
---|
| 2578 | + doEditDrag0(info, opposite); |
---|
2486 | 2579 | break; |
---|
2487 | 2580 | |
---|
2488 | 2581 | case 2: // '\002' |
---|
.. | .. |
---|
2495 | 2588 | { |
---|
2496 | 2589 | //sel.hitSomething = childToDrag.hitSomething; |
---|
2497 | 2590 | //childToDrag.doEditDrag(info); |
---|
2498 | | - sel.doEditDrag(info); |
---|
| 2591 | + sel.doEditDrag(info, opposite); |
---|
2499 | 2592 | } else |
---|
2500 | 2593 | { |
---|
2501 | 2594 | //super. |
---|
2502 | | - doEditDrag0(info); |
---|
| 2595 | + doEditDrag0(info, opposite); |
---|
2503 | 2596 | } |
---|
2504 | 2597 | } |
---|
2505 | 2598 | break; |
---|
.. | .. |
---|
2609 | 2702 | void GenNormalsS(boolean crease) |
---|
2610 | 2703 | { |
---|
2611 | 2704 | selection.GenNormals(crease); |
---|
| 2705 | +// for (int i=0; i<selection.size(); i++) |
---|
| 2706 | +// { |
---|
| 2707 | +// Object3D selectee = (Object3D) selection.elementAt(i); |
---|
| 2708 | +// selectee.GenNormals(crease); |
---|
| 2709 | +// } |
---|
| 2710 | + |
---|
| 2711 | + //Touch(); |
---|
| 2712 | + } |
---|
| 2713 | + |
---|
| 2714 | + void GenNormalsMeshS() |
---|
| 2715 | + { |
---|
| 2716 | + selection.GenNormalsMesh(); |
---|
2612 | 2717 | // for (int i=0; i<selection.size(); i++) |
---|
2613 | 2718 | // { |
---|
2614 | 2719 | // Object3D selectee = (Object3D) selection.elementAt(i); |
---|
.. | .. |
---|
2749 | 2854 | if (child == null) |
---|
2750 | 2855 | continue; |
---|
2751 | 2856 | child.GenNormals(crease); |
---|
| 2857 | +// Children().release(i); |
---|
| 2858 | + } |
---|
| 2859 | + blockloop = false; |
---|
| 2860 | + } |
---|
| 2861 | + |
---|
| 2862 | + void GenNormalsMesh() |
---|
| 2863 | + { |
---|
| 2864 | + if (blockloop) |
---|
| 2865 | + return; |
---|
| 2866 | + |
---|
| 2867 | + blockloop = true; |
---|
| 2868 | + GenNormalsMesh0(); |
---|
| 2869 | + for (int i = 0; i < Children().Size(); i++) |
---|
| 2870 | + { |
---|
| 2871 | + Object3D child = (Object3D) Children().get(i); // reserve(i); |
---|
| 2872 | + if (child == null) |
---|
| 2873 | + continue; |
---|
| 2874 | + child.GenNormalsMesh(); |
---|
2752 | 2875 | // Children().release(i); |
---|
2753 | 2876 | } |
---|
2754 | 2877 | blockloop = false; |
---|
.. | .. |
---|
2906 | 3029 | { |
---|
2907 | 3030 | if (bRep != null) |
---|
2908 | 3031 | { |
---|
2909 | | - bRep.GenUV(); |
---|
| 3032 | + bRep.GenUV(); //1); |
---|
| 3033 | + //bRep.UnfoldUV(); |
---|
2910 | 3034 | Touch(); |
---|
2911 | 3035 | } |
---|
2912 | 3036 | } |
---|
.. | .. |
---|
2916 | 3040 | if (bRep != null) |
---|
2917 | 3041 | { |
---|
2918 | 3042 | bRep.GenerateNormals(crease); |
---|
| 3043 | + Touch(); |
---|
| 3044 | + } |
---|
| 3045 | + } |
---|
| 3046 | + |
---|
| 3047 | + void GenNormalsMesh0() |
---|
| 3048 | + { |
---|
| 3049 | + if (bRep != null) |
---|
| 3050 | + { |
---|
| 3051 | + bRep.GenerateNormalsMesh(); |
---|
2919 | 3052 | Touch(); |
---|
2920 | 3053 | } |
---|
2921 | 3054 | } |
---|
.. | .. |
---|
2981 | 3114 | blockloop = false; |
---|
2982 | 3115 | } |
---|
2983 | 3116 | |
---|
| 3117 | + void TransformChildren() |
---|
| 3118 | + { |
---|
| 3119 | + if (toParent != null) |
---|
| 3120 | + { |
---|
| 3121 | + for (int i=Size(); --i>=0;) |
---|
| 3122 | + { |
---|
| 3123 | + Object3D v = get(i); |
---|
| 3124 | + |
---|
| 3125 | + if (v.toParent == null) |
---|
| 3126 | + { |
---|
| 3127 | + v.toParent = LA.newMatrix(); |
---|
| 3128 | + v.fromParent = LA.newMatrix(); |
---|
| 3129 | + } |
---|
| 3130 | + |
---|
| 3131 | +// LA.matConcat(v.toParent, toParent, v.toParent); |
---|
| 3132 | +// LA.matConcat(fromParent, v.fromParent, v.fromParent); |
---|
| 3133 | + LA.matConcat(toParent, v.toParent, v.toParent); |
---|
| 3134 | + LA.matConcat(v.fromParent, fromParent, v.fromParent); |
---|
| 3135 | + } |
---|
| 3136 | + |
---|
| 3137 | + toParent = null; // LA.matIdentity(toParent); |
---|
| 3138 | + fromParent = null; // LA.matIdentity(fromParent); |
---|
| 3139 | + |
---|
| 3140 | + Touch(); |
---|
| 3141 | + } |
---|
| 3142 | + } |
---|
| 3143 | + |
---|
2984 | 3144 | void TransformGeometry() |
---|
2985 | 3145 | { |
---|
2986 | 3146 | Object3D obj = this; |
---|
.. | .. |
---|
3202 | 3362 | |
---|
3203 | 3363 | BoundaryRep sup = bRep.support; |
---|
3204 | 3364 | bRep.support = null; |
---|
3205 | | - BoundaryRep temprep = (BoundaryRep) GrafreeD.clone(bRep); |
---|
| 3365 | + BoundaryRep temprep = (BoundaryRep) Grafreed.clone(bRep); |
---|
3206 | 3366 | // bRep.SplitInTwo(onlyone); // thread... |
---|
3207 | | - temprep.SplitInTwo(reduction34, onlyone); |
---|
| 3367 | + |
---|
| 3368 | + while(temprep.SplitInTwo(reduction34, onlyone)); |
---|
| 3369 | + |
---|
3208 | 3370 | bRep = temprep; |
---|
3209 | 3371 | bRep.support = sup; |
---|
3210 | 3372 | Touch(); |
---|
.. | .. |
---|
3726 | 3888 | if (child == null) |
---|
3727 | 3889 | continue; |
---|
3728 | 3890 | |
---|
3729 | | - if (GrafreeD.RENDERME > 0) |
---|
| 3891 | + if (Grafreed.RENDERME > 0) |
---|
3730 | 3892 | { |
---|
3731 | 3893 | if (child instanceof Merge) |
---|
3732 | 3894 | ((Merge)child).renderme(); |
---|
.. | .. |
---|
3877 | 4039 | if (child == null) |
---|
3878 | 4040 | continue; |
---|
3879 | 4041 | |
---|
3880 | | - if (GrafreeD.RENDERME > 0) |
---|
| 4042 | + if (Grafreed.RENDERME > 0) |
---|
3881 | 4043 | { |
---|
3882 | 4044 | if (child instanceof Merge) |
---|
3883 | 4045 | ((Merge)child).renderme(); |
---|
.. | .. |
---|
4072 | 4234 | if (child == null) |
---|
4073 | 4235 | continue; |
---|
4074 | 4236 | |
---|
4075 | | - if (GrafreeD.RENDERME > 0) |
---|
| 4237 | + if (Grafreed.RENDERME > 0) |
---|
4076 | 4238 | { |
---|
4077 | 4239 | if (child instanceof Merge) |
---|
4078 | 4240 | ((Merge)child).renderme(); |
---|
.. | .. |
---|
4185 | 4347 | { |
---|
4186 | 4348 | blockloop = true; |
---|
4187 | 4349 | get(i).RepairShadow(); |
---|
| 4350 | + blockloop = false; |
---|
| 4351 | + } |
---|
| 4352 | + } |
---|
| 4353 | + |
---|
| 4354 | + void RepairSOV() |
---|
| 4355 | + { |
---|
| 4356 | + if (blockloop) |
---|
| 4357 | + return; |
---|
| 4358 | + |
---|
| 4359 | + String texname = this.GetPigmentTexture(); |
---|
| 4360 | + |
---|
| 4361 | + if (texname.startsWith("sov")) |
---|
| 4362 | + { |
---|
| 4363 | + String[] s = texname.split("/"); |
---|
| 4364 | + |
---|
| 4365 | + String[] sname = s[1].split("Color.pn"); |
---|
| 4366 | + |
---|
| 4367 | + texname = sname[0]; |
---|
| 4368 | + |
---|
| 4369 | + if (sname.length > 1) |
---|
| 4370 | + { |
---|
| 4371 | + texname += "Color.jpg"; |
---|
| 4372 | + } |
---|
| 4373 | + |
---|
| 4374 | + this.SetPigmentTexture("sov/" + texname); |
---|
| 4375 | + } |
---|
| 4376 | + |
---|
| 4377 | + texname = this.GetBumpTexture(); |
---|
| 4378 | + |
---|
| 4379 | + if (texname.startsWith("sov")) |
---|
| 4380 | + { |
---|
| 4381 | + String[] s = texname.split("/"); |
---|
| 4382 | + |
---|
| 4383 | + String[] sname = s[1].split("Bump.pn"); |
---|
| 4384 | + |
---|
| 4385 | + texname = sname[0]; |
---|
| 4386 | + |
---|
| 4387 | + if (sname.length > 1) |
---|
| 4388 | + { |
---|
| 4389 | + texname += "Bump.jpg"; |
---|
| 4390 | + } |
---|
| 4391 | + |
---|
| 4392 | + this.SetBumpTexture("sov/" + texname); |
---|
| 4393 | + } |
---|
| 4394 | + |
---|
| 4395 | + for (int i=0; i<Size(); i++) |
---|
| 4396 | + { |
---|
| 4397 | + blockloop = true; |
---|
| 4398 | + get(i).RepairSOV(); |
---|
4188 | 4399 | blockloop = false; |
---|
4189 | 4400 | } |
---|
4190 | 4401 | } |
---|
.. | .. |
---|
4679 | 4890 | |
---|
4680 | 4891 | cTreePath SelectLeaf(int indexcount, boolean deselect) |
---|
4681 | 4892 | { |
---|
4682 | | - if (hide) |
---|
| 4893 | + if (hide || dontselect) |
---|
4683 | 4894 | return null; |
---|
4684 | 4895 | |
---|
4685 | 4896 | if (count <= 0) |
---|
.. | .. |
---|
4705 | 4916 | |
---|
4706 | 4917 | cTreePath Select(int indexcount, boolean deselect) |
---|
4707 | 4918 | { |
---|
4708 | | - if (hide) |
---|
| 4919 | + if (hide || dontselect) |
---|
4709 | 4920 | return null; |
---|
4710 | 4921 | |
---|
4711 | 4922 | if (count <= 0) |
---|
.. | .. |
---|
5157 | 5368 | |
---|
5158 | 5369 | // System.out.println("Fullname = " + fullname); |
---|
5159 | 5370 | |
---|
5160 | | - if (fullname.name.indexOf(":") == -1) |
---|
5161 | | - return fullname.name; |
---|
| 5371 | + // Does not work on Windows due to C: |
---|
| 5372 | +// if (fullname.name.indexOf(":") == -1) |
---|
| 5373 | +// return fullname.name; |
---|
| 5374 | +// |
---|
| 5375 | +// return fullname.name.substring(0,fullname.name.indexOf(":")); |
---|
5162 | 5376 | |
---|
5163 | | - return fullname.name.substring(0,fullname.name.indexOf(":")); |
---|
| 5377 | + String[] split = fullname.name.split(":"); |
---|
| 5378 | + |
---|
| 5379 | + if (split.length == 0) |
---|
| 5380 | + { |
---|
| 5381 | + return ""; |
---|
| 5382 | + } |
---|
| 5383 | + |
---|
| 5384 | + if (split.length <= 2) |
---|
| 5385 | + { |
---|
| 5386 | + if (fullname.name.endsWith(":")) |
---|
| 5387 | + { |
---|
| 5388 | + // Windows |
---|
| 5389 | + return fullname.name.substring(0, fullname.name.length()-1); |
---|
| 5390 | + } |
---|
| 5391 | + |
---|
| 5392 | + return split[0]; |
---|
| 5393 | + } |
---|
| 5394 | + |
---|
| 5395 | + // Windows |
---|
| 5396 | + assert(split.length == 4); |
---|
| 5397 | + |
---|
| 5398 | + return split[0] + ":" + split[1]; |
---|
5164 | 5399 | } |
---|
5165 | 5400 | |
---|
5166 | 5401 | static String GetBump(cTexture fullname) |
---|
.. | .. |
---|
5169 | 5404 | return ""; |
---|
5170 | 5405 | |
---|
5171 | 5406 | // System.out.println("Fullname = " + fullname); |
---|
5172 | | - if (fullname.name.indexOf(":") == -1) |
---|
5173 | | - return ""; |
---|
5174 | | - |
---|
5175 | | - return fullname.name.substring(fullname.name.indexOf(":")+1,fullname.name.length()); |
---|
| 5407 | + // Does not work on Windows due to C: |
---|
| 5408 | +// if (fullname.name.indexOf(":") == -1) |
---|
| 5409 | +// return ""; |
---|
| 5410 | +// |
---|
| 5411 | +// return fullname.name.substring(fullname.name.indexOf(":")+1,fullname.name.length()); |
---|
| 5412 | + String[] split = fullname.name.split(":"); |
---|
| 5413 | + |
---|
| 5414 | + if (split.length == 0) |
---|
| 5415 | + { |
---|
| 5416 | + return ""; |
---|
| 5417 | + } |
---|
| 5418 | + |
---|
| 5419 | + if (split.length == 1) |
---|
| 5420 | + { |
---|
| 5421 | + return ""; |
---|
| 5422 | + } |
---|
| 5423 | + |
---|
| 5424 | + if (split.length == 2) |
---|
| 5425 | + { |
---|
| 5426 | + if (fullname.name.endsWith(":")) |
---|
| 5427 | + { |
---|
| 5428 | + // Windows |
---|
| 5429 | + return ""; |
---|
| 5430 | + } |
---|
| 5431 | + |
---|
| 5432 | + return split[1]; |
---|
| 5433 | + } |
---|
| 5434 | + |
---|
| 5435 | + // Windows |
---|
| 5436 | + assert(split.length == 4); |
---|
| 5437 | + |
---|
| 5438 | + return split[2] + ":" + split[3]; |
---|
5176 | 5439 | } |
---|
5177 | 5440 | |
---|
5178 | 5441 | String GetPigmentTexture() |
---|
.. | .. |
---|
5246 | 5509 | System.out.print("; textures = " + textures); |
---|
5247 | 5510 | System.out.println("; usedtextures = " + usedtextures); |
---|
5248 | 5511 | |
---|
5249 | | - if (GetTextures() == null) |
---|
| 5512 | + if (GetTextures() == null) // What is that?? |
---|
5250 | 5513 | GetTextures().name = ":"; |
---|
5251 | 5514 | |
---|
5252 | 5515 | String texname = tex; |
---|
.. | .. |
---|
5277 | 5540 | child.ResetPigmentTexture(); |
---|
5278 | 5541 | blockloop = false; |
---|
5279 | 5542 | } |
---|
| 5543 | + } |
---|
| 5544 | + |
---|
| 5545 | + UUID GetUUID() |
---|
| 5546 | + { |
---|
| 5547 | + if (uuid == null) |
---|
| 5548 | + { |
---|
| 5549 | + // Serial |
---|
| 5550 | + uuid = UUID.randomUUID(); |
---|
| 5551 | + } |
---|
| 5552 | + |
---|
| 5553 | + return uuid; |
---|
| 5554 | + } |
---|
| 5555 | + |
---|
| 5556 | + Object3D GetObject(UUID uid) |
---|
| 5557 | + { |
---|
| 5558 | + if (blockloop) |
---|
| 5559 | + return null; |
---|
| 5560 | + |
---|
| 5561 | + if (GetUUID().equals(uid)) |
---|
| 5562 | + return this; |
---|
| 5563 | + |
---|
| 5564 | + int nb = Size(); |
---|
| 5565 | + for (int i = 0; i < nb; i++) |
---|
| 5566 | + { |
---|
| 5567 | + Object3D child = (Object3D) get(i); |
---|
| 5568 | + |
---|
| 5569 | + if (child == null) |
---|
| 5570 | + continue; |
---|
| 5571 | + |
---|
| 5572 | + blockloop = true; |
---|
| 5573 | + Object3D obj = child.GetObject(uid); |
---|
| 5574 | + blockloop = false; |
---|
| 5575 | + if (obj != null) |
---|
| 5576 | + return obj; |
---|
| 5577 | + } |
---|
| 5578 | + |
---|
| 5579 | + return null; |
---|
5280 | 5580 | } |
---|
5281 | 5581 | |
---|
5282 | 5582 | void SetBumpTexture(String tex) |
---|
.. | .. |
---|
5323 | 5623 | boolean NeedSupport() |
---|
5324 | 5624 | { |
---|
5325 | 5625 | return |
---|
5326 | | - CameraPane.SUPPORT && !CameraPane.movingcamera && link2master && /*live &&*/ support != null |
---|
| 5626 | + CameraPane.SUPPORT && (!CameraPane.movingcamera || (!Globals.FREEZEONMOVE && Globals.isLIVE())) && link2master && /*live &&*/ support != null |
---|
5327 | 5627 | // PROBLEM with CROWD!! |
---|
5328 | | - && (Globals.DrawMode() == iCameraPane.SHADOW || Globals.CROWD); |
---|
| 5628 | + && (Globals.DrawMode() == iCameraPane.SHADOW || !Globals.RENDERSHADOW || Globals.CROWD); |
---|
5329 | 5629 | } |
---|
5330 | 5630 | |
---|
5331 | 5631 | static boolean DEBUG_SELECTION = false; |
---|
| 5632 | + |
---|
| 5633 | + boolean IsLive() |
---|
| 5634 | + { |
---|
| 5635 | + if (live) |
---|
| 5636 | + return true; |
---|
| 5637 | + |
---|
| 5638 | + if (parent == null) |
---|
| 5639 | + return false; |
---|
| 5640 | + |
---|
| 5641 | + return parent.IsLive(); |
---|
| 5642 | + } |
---|
5332 | 5643 | |
---|
5333 | 5644 | void Draw(iCameraPane display, Object3D /*Composite*/ root, boolean selected, boolean blocked) |
---|
5334 | 5645 | { |
---|
.. | .. |
---|
5340 | 5651 | } |
---|
5341 | 5652 | |
---|
5342 | 5653 | if (display.DrawMode() == iCameraPane.SELECTION && |
---|
5343 | | - hide) |
---|
| 5654 | + (hide || dontselect)) |
---|
5344 | 5655 | return; |
---|
5345 | 5656 | |
---|
5346 | 5657 | if (name != null && name.contains("sclera")) |
---|
.. | .. |
---|
5391 | 5702 | support = support; |
---|
5392 | 5703 | |
---|
5393 | 5704 | //boolean usecalllists = IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null || !link2master); // !(this instanceof cSpring) && !(this instanceof BezierPatch); |
---|
5394 | | - boolean usecalllists = false; // IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null) && !link2master; // !(this instanceof cSpring) && !(this instanceof BezierPatch); |
---|
| 5705 | + boolean usecalllists = IsLive(); // IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null) && !link2master; // !(this instanceof cSpring) && !(this instanceof BezierPatch); |
---|
5395 | 5706 | |
---|
5396 | 5707 | if (!usecalllists && bRep != null && bRep.displaylist > 0) |
---|
5397 | 5708 | { |
---|
.. | .. |
---|
5411 | 5722 | boolean selectmode = display.DrawMode() == display.SELECTION || display.IsDebugSelection(); |
---|
5412 | 5723 | |
---|
5413 | 5724 | if (!selectmode && //display.DrawMode() != display.SELECTION && |
---|
5414 | | - (touched || (bRep != null && bRep.displaylist <= 0))) |
---|
| 5725 | + //(touched || (bRep != null && bRep.displaylist <= 0))) |
---|
| 5726 | + (Globals.isLIVE() || touched && (bRep != null && bRep.displaylist <= 0))) |
---|
5415 | 5727 | { |
---|
5416 | 5728 | Globals.lighttouched = true; |
---|
5417 | 5729 | } // all panes... |
---|
| 5730 | + |
---|
5418 | 5731 | //if (usecalllists && display.DrawMode() != display.SELECTION && display.DrawMode() != display.SHADOW && |
---|
5419 | 5732 | if (bRep != null && usecalllists && !selectmode && // june 2013 display.DrawMode() != display.SHADOW && |
---|
5420 | 5733 | (touched || (bRep != null && bRep.displaylist <= 0))) |
---|
.. | .. |
---|
5582 | 5895 | tex = GetTextures(); |
---|
5583 | 5896 | } |
---|
5584 | 5897 | |
---|
5585 | | - display.BindTextures(tex, texres); |
---|
| 5898 | + boolean failedPigment = false; |
---|
| 5899 | + boolean failedBump = false; |
---|
| 5900 | + |
---|
| 5901 | + try |
---|
| 5902 | + { |
---|
| 5903 | + display.BindPigmentTexture(tex, texres); |
---|
| 5904 | + } |
---|
| 5905 | + catch (Exception e) |
---|
| 5906 | + { |
---|
| 5907 | + System.err.println("FAILED: " + this); |
---|
| 5908 | + failedPigment = true; |
---|
| 5909 | + } |
---|
| 5910 | + |
---|
| 5911 | + try |
---|
| 5912 | + { |
---|
| 5913 | + display.BindBumpTexture(tex, texres); |
---|
| 5914 | + } |
---|
| 5915 | + catch (Exception e) |
---|
| 5916 | + { |
---|
| 5917 | + //System.err.println("FAILED: " + this); |
---|
| 5918 | + failedBump = true; |
---|
| 5919 | + } |
---|
5586 | 5920 | |
---|
5587 | 5921 | if (!compiled) |
---|
5588 | 5922 | { |
---|
.. | .. |
---|
5604 | 5938 | } |
---|
5605 | 5939 | } |
---|
5606 | 5940 | |
---|
5607 | | - display.ReleaseTextures(tex); |
---|
| 5941 | + if (!failedBump) |
---|
| 5942 | + display.ReleaseBumpTexture(tex); |
---|
| 5943 | + |
---|
| 5944 | + if (!failedPigment) |
---|
| 5945 | + display.ReleasePigmentTexture(tex); |
---|
5608 | 5946 | |
---|
5609 | 5947 | display.PopMaterial(this, selected); |
---|
5610 | 5948 | } |
---|
.. | .. |
---|
5733 | 6071 | |
---|
5734 | 6072 | void drawSelf(iCameraPane display, Object3D /*Composite*/ root, boolean selected, boolean blocked) |
---|
5735 | 6073 | { |
---|
| 6074 | + if (display.DrawMode() == iCameraPane.SELECTION && dontselect) |
---|
| 6075 | + return; |
---|
| 6076 | + |
---|
5736 | 6077 | if (hide) |
---|
5737 | 6078 | return; |
---|
5738 | 6079 | // shadow optimisation |
---|
.. | .. |
---|
5858 | 6199 | if (display.DrawMode() == display.SHADOW && projectedVertices != null && projectedVertices.length > 2 && projectedVertices[2].y >= 10000) |
---|
5859 | 6200 | return; // no shadow for transparent objects |
---|
5860 | 6201 | |
---|
| 6202 | + if (display.DrawMode() == iCameraPane.SELECTION && dontselect) |
---|
| 6203 | + return; |
---|
| 6204 | + |
---|
5861 | 6205 | if (hide) |
---|
5862 | 6206 | return; |
---|
5863 | 6207 | |
---|
.. | .. |
---|
5898 | 6242 | return; |
---|
5899 | 6243 | } |
---|
5900 | 6244 | |
---|
| 6245 | + //bRep.GenUV(1/material.diffuseness); |
---|
5901 | 6246 | // bRep.lock = true; |
---|
5902 | 6247 | |
---|
5903 | 6248 | //javax.media.opengl.GL gl = display.GetGL(); |
---|
.. | .. |
---|
6822 | 7167 | spot.translate(32, 32); |
---|
6823 | 7168 | spotw = spot.x + spot.width; |
---|
6824 | 7169 | spoth = spot.y + spot.height; |
---|
6825 | | - info.g.setColor(Color.blue); |
---|
| 7170 | + info.g.setColor(Color.cyan); |
---|
6826 | 7171 | info.g.fillRect(spot.x, spot.y, spot.width, spot.height); |
---|
6827 | 7172 | // if (CameraPane.Xmin > spot.x) |
---|
6828 | 7173 | // { |
---|
.. | .. |
---|
6840 | 7185 | // { |
---|
6841 | 7186 | // CameraPane.Ymax = spoth; |
---|
6842 | 7187 | // } |
---|
6843 | | - info.g.drawLine(spotw, spoth, spotw, spoth - 15); |
---|
6844 | | - info.g.drawLine(spotw, spoth, spotw - 15, spoth); |
---|
| 7188 | + // bonhommes info.g.drawLine(spotw, spoth, spotw, spoth - boundary.height/2); // 15 |
---|
| 7189 | + //info.g.drawLine(spotw, spoth, spotw - boundary.width/2, spoth); // 15 |
---|
6845 | 7190 | spot.translate(0, -32); |
---|
6846 | | - info.g.setColor(Color.green); |
---|
| 7191 | + info.g.setColor(Color.yellow); |
---|
6847 | 7192 | info.g.fillRect(spot.x, spot.y, spot.width, spot.height); |
---|
| 7193 | + info.g.setColor(Color.green); |
---|
6848 | 7194 | // if (CameraPane.Xmin > spot.x) |
---|
6849 | 7195 | // { |
---|
6850 | 7196 | // CameraPane.Xmin = spot.x; |
---|
.. | .. |
---|
6896 | 7242 | startX = info.x; |
---|
6897 | 7243 | startY = info.y; |
---|
6898 | 7244 | |
---|
6899 | | - hitSomething = 0; |
---|
| 7245 | + hitSomething = -1; |
---|
6900 | 7246 | cVector origin = new cVector(); |
---|
6901 | 7247 | //LA.xformPos(origin, toParent, origin); |
---|
6902 | 7248 | Rectangle spot = new Rectangle(); |
---|
.. | .. |
---|
6929 | 7275 | } |
---|
6930 | 7276 | |
---|
6931 | 7277 | //System.out.println("info.modifiers = " + info.modifiers); |
---|
6932 | | - modified = (info.modifiers & CameraPane.META) != 0; |
---|
| 7278 | + modified = (info.modifiers & CameraPane.SHIFT) != 0; // Was META |
---|
6933 | 7279 | //System.out.println("modified = " + modified); |
---|
6934 | 7280 | //new Exception().printStackTrace(); |
---|
6935 | 7281 | //viewCode = info.pane.renderCamera.viewCode; |
---|
.. | .. |
---|
6957 | 7303 | return true; |
---|
6958 | 7304 | } |
---|
6959 | 7305 | |
---|
6960 | | - void doEditDrag0(ClickInfo info) |
---|
| 7306 | + void doEditDrag0(ClickInfo info, boolean opposite) |
---|
6961 | 7307 | { |
---|
6962 | 7308 | if (hitSomething == 0) |
---|
6963 | 7309 | { |
---|
.. | .. |
---|
6972 | 7318 | //System.out.println("hitSomething = " + hitSomething); |
---|
6973 | 7319 | |
---|
6974 | 7320 | double scale = 0.005f * info.camera.Distance(); |
---|
| 7321 | + |
---|
6975 | 7322 | cVector xlate = new cVector(); |
---|
6976 | 7323 | //cVector xlate2 = new cVector(); |
---|
6977 | 7324 | switch (hitSomething) |
---|
.. | .. |
---|
6984 | 7331 | |
---|
6985 | 7332 | scale *= 0.05f * Globals.theRenderer.RenderCamera().Distance(); |
---|
6986 | 7333 | |
---|
6987 | | - if (modified) |
---|
| 7334 | + if (modified || opposite) |
---|
6988 | 7335 | { |
---|
6989 | 7336 | //assert(false); |
---|
6990 | 7337 | /* |
---|
.. | .. |
---|
7078 | 7425 | |
---|
7079 | 7426 | if (modified) |
---|
7080 | 7427 | { |
---|
| 7428 | + // Rotate 90 degrees |
---|
7081 | 7429 | angle /= (Math.PI / 4); |
---|
7082 | 7430 | angle = Math.floor(angle + 0.5); |
---|
7083 | 7431 | angle *= (Math.PI / 4); |
---|
.. | .. |
---|
7119 | 7467 | |
---|
7120 | 7468 | case hitScale: // scale |
---|
7121 | 7469 | double hScale = (double) (info.x - centerPt.x) / 32; |
---|
| 7470 | + double sign = 1; |
---|
| 7471 | + if (hScale < 0) |
---|
| 7472 | + { |
---|
| 7473 | + sign = -1; |
---|
| 7474 | + } |
---|
| 7475 | + hScale = sign*Math.pow(sign*hScale, scale * 50); |
---|
7122 | 7476 | if (hScale < 0.01) |
---|
7123 | 7477 | { |
---|
7124 | | - hScale = 0.01; |
---|
| 7478 | + //hScale = 0.01; |
---|
7125 | 7479 | } |
---|
7126 | | - hScale = Math.pow(hScale, scale * 50); |
---|
7127 | | - if (hScale < 0.01) |
---|
7128 | | - { |
---|
7129 | | - hScale = 0.01; |
---|
7130 | | - } |
---|
| 7480 | + |
---|
7131 | 7481 | double vScale = (double) (info.y - centerPt.y) / 32; |
---|
7132 | | - if (vScale < 0.01) |
---|
| 7482 | + sign = 1; |
---|
| 7483 | + if (vScale < 0) |
---|
7133 | 7484 | { |
---|
7134 | | - vScale = 0.01; |
---|
| 7485 | + sign = -1; |
---|
7135 | 7486 | } |
---|
7136 | | - vScale = Math.pow(vScale, scale * 50); |
---|
| 7487 | + vScale = sign*Math.pow(sign*vScale, scale * 50); |
---|
7137 | 7488 | if (vScale < 0.01) |
---|
7138 | 7489 | { |
---|
7139 | | - vScale = 0.01; |
---|
| 7490 | + //vScale = 0.01; |
---|
7140 | 7491 | } |
---|
7141 | 7492 | LA.matCopy(startMat, toParent); |
---|
7142 | 7493 | /**/ |
---|
.. | .. |
---|
7147 | 7498 | } |
---|
7148 | 7499 | /**/ |
---|
7149 | 7500 | |
---|
| 7501 | + double totalScale = Math.sqrt(hScale*hScale + vScale*vScale) / Math.sqrt(2); |
---|
| 7502 | + |
---|
| 7503 | + if (totalScale < 0.01) |
---|
| 7504 | + { |
---|
| 7505 | + totalScale = 0.01; |
---|
| 7506 | + } |
---|
| 7507 | + |
---|
7150 | 7508 | switch (info.pane.RenderCamera().viewCode) |
---|
7151 | 7509 | { |
---|
7152 | 7510 | case 3: // '\001' |
---|
7153 | | - if (modified) |
---|
| 7511 | + if (modified || opposite) |
---|
7154 | 7512 | { |
---|
7155 | 7513 | //LA.matScale(toParent, 1, hScale, vScale); |
---|
7156 | | - LA.matScale(toParent, vScale, 1, 1); |
---|
| 7514 | + LA.matScale(toParent, totalScale, 1, 1); |
---|
7157 | 7515 | } // vScale, 1); |
---|
7158 | 7516 | else |
---|
7159 | 7517 | { |
---|
7160 | | - LA.matScale(toParent, vScale, vScale, vScale); |
---|
| 7518 | + // EXCEPTION! |
---|
| 7519 | + LA.matScale(toParent, totalScale, totalScale, totalScale); |
---|
7161 | 7520 | } // vScale, 1); |
---|
7162 | 7521 | break; |
---|
7163 | 7522 | |
---|
7164 | 7523 | case 2: // '\002' |
---|
7165 | | - if (modified) |
---|
| 7524 | + if (modified || opposite) |
---|
7166 | 7525 | { |
---|
7167 | 7526 | //LA.matScale(toParent, hScale, 1, vScale); |
---|
7168 | | - LA.matScale(toParent, 1, vScale, 1); |
---|
| 7527 | + LA.matScale(toParent, 1, totalScale, 1); |
---|
7169 | 7528 | } else |
---|
7170 | 7529 | { |
---|
7171 | | - LA.matScale(toParent, vScale, 1, vScale); |
---|
| 7530 | + LA.matScale(toParent, totalScale, 1, totalScale); |
---|
7172 | 7531 | } |
---|
7173 | 7532 | break; |
---|
7174 | 7533 | |
---|
7175 | 7534 | case 1: // '\003' |
---|
7176 | | - if (modified) |
---|
| 7535 | + if (modified || opposite) |
---|
7177 | 7536 | { |
---|
7178 | 7537 | //LA.matScale(toParent, hScale, vScale, 1); |
---|
7179 | | - LA.matScale(toParent, 1, 1, vScale); |
---|
| 7538 | + LA.matScale(toParent, 1, 1, totalScale); |
---|
7180 | 7539 | } else |
---|
7181 | 7540 | { |
---|
7182 | | - LA.matScale(toParent, vScale, vScale, 1); |
---|
| 7541 | + LA.matScale(toParent, totalScale, totalScale, 1); |
---|
7183 | 7542 | } |
---|
7184 | 7543 | break; |
---|
7185 | 7544 | } |
---|
.. | .. |
---|
7312 | 7671 | //return super.toString() + " (id=" + list + ")" + " (brep=" + bRep + ")"; |
---|
7313 | 7672 | //return name + " (id=" + list + ")" + " (brep=" + bRep + ") " + super.toString(); |
---|
7314 | 7673 | //return name + " (#tri = " + (bRep==null?0:bRep.VertexCount()) + ") " + super.toString(); |
---|
| 7674 | + |
---|
| 7675 | + String objname; |
---|
| 7676 | + |
---|
7315 | 7677 | if (false) //parent != null) |
---|
7316 | 7678 | { |
---|
7317 | | - return name + " " + System.identityHashCode(this) + " (" + parent.name + " " + System.identityHashCode(parent) + ")"; |
---|
| 7679 | + objname = name + " " + System.identityHashCode(this) + " (" + parent.name + " " + System.identityHashCode(parent) + ")"; |
---|
7318 | 7680 | } else |
---|
7319 | 7681 | { |
---|
7320 | | - return GetName() + (Math.abs(count) == 1000 ? (count == 1000 ? " " : " * ") : (" (" + (count /*- 1*/) + ") ")) + /*(IsSelected()?"(selected) ":"") + (touched?"(touched) ":"") */ +System.identityHashCode(this); |
---|
| 7682 | + objname = GetName() + (Math.abs(count) == 1000 ? (count == 1000 ? " " : " * ") : (" (" + (count - 1) + ")")) + /*(IsSelected()?"(selected) ":"") + (touched?"(touched) ":"") */ ""; |
---|
7321 | 7683 | } // + super.toString(); |
---|
7322 | 7684 | //return name + " (" + (SizeOf.deepSizeOf(this)/1024) + "K) " + this.getClass().getName(); |
---|
| 7685 | + |
---|
| 7686 | + if (!Globals.ADVANCED) |
---|
| 7687 | + return objname; |
---|
| 7688 | + |
---|
| 7689 | + return objname + " " + System.identityHashCode(this); |
---|
7323 | 7690 | } |
---|
7324 | 7691 | |
---|
7325 | 7692 | public int hashCode() |
---|
.. | .. |
---|
7375 | 7742 | objectUI.closeUI(); |
---|
7376 | 7743 | if (editWindow != null) |
---|
7377 | 7744 | { |
---|
| 7745 | + editWindow.ctrlPanel.FlushUI(); |
---|
7378 | 7746 | editWindow.refreshContents(); |
---|
7379 | 7747 | } // ? new |
---|
7380 | 7748 | objectUI = null; |
---|
.. | .. |
---|
7395 | 7763 | /*transient*/ cVector2[] projectedVertices = new cVector2[0]; |
---|
7396 | 7764 | |
---|
7397 | 7765 | Object3D /*Composite*/ parent; |
---|
7398 | | - Object3D /*Composite*/ fileparent; |
---|
| 7766 | + Object3D /*Composite*/ fileparent; // In the case of FileObject |
---|
7399 | 7767 | |
---|
7400 | 7768 | double[][] toParent; // dynamic matrix |
---|
7401 | 7769 | double[][] fromParent; |
---|
.. | .. |
---|
7510 | 7878 | { |
---|
7511 | 7879 | assert(bRep != null); |
---|
7512 | 7880 | if (!(support instanceof GenericJoint)) // support.bRep != null) |
---|
7513 | | - GrafreeD.Assert(support.bRep == bRep.support); |
---|
| 7881 | + Grafreed.Assert(support.bRep == bRep.support); |
---|
7514 | 7882 | } |
---|
7515 | 7883 | else |
---|
7516 | 7884 | { |
---|
.. | .. |
---|
7559 | 7927 | private static cVector edge2 = new cVector(); |
---|
7560 | 7928 | //private static cVector norm = new cVector(); |
---|
7561 | 7929 | /*transient private*/ int hitSomething; |
---|
7562 | | - private static final int hitCenter = 1; |
---|
7563 | | - private static final int hitScale = 2; |
---|
7564 | | - private static final int hitRotate = 3; |
---|
| 7930 | + static final int hitCenter = 1; |
---|
| 7931 | + static final int hitScale = 2; |
---|
| 7932 | + static final int hitRotate = 3; |
---|
7565 | 7933 | /*transient*/ /*private*/ int viewCode; // Now used for transparency cache flag |
---|
7566 | 7934 | /*transient*/ private Point centerPt; |
---|
7567 | 7935 | /*transient*/ private int startX; |
---|