.. | .. |
---|
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(); |
---|
| 120 | + if (blockloop) |
---|
| 121 | + return; |
---|
| 122 | + |
---|
| 123 | + transientsupport = support; |
---|
| 124 | + transientlink2master = link2master; |
---|
| 125 | + |
---|
| 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 | + } |
---|
123 | 143 | } |
---|
124 | | - |
---|
125 | | - for (int i = 0; i < Size(); i++) |
---|
| 144 | + |
---|
| 145 | + void RestoreSupports() |
---|
126 | 146 | { |
---|
127 | | - Object3D child = (Object3D) get(i); |
---|
128 | | - if (child == null) |
---|
129 | | - continue; |
---|
| 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 | + } |
---|
| 169 | + } |
---|
| 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("copy of " + this.name); |
---|
| 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 | + if (blockloop) |
---|
| 223 | + return; |
---|
| 224 | + |
---|
130 | 225 | blockloop = true; |
---|
131 | | - child.SaveSupports(); |
---|
| 226 | + |
---|
| 227 | + Object3D o = hashtable.get(GetUUID()); |
---|
| 228 | + |
---|
| 229 | + RestoreBigData(o); |
---|
| 230 | + |
---|
| 231 | + //hashtable.remove(GetUUID()); |
---|
| 232 | + |
---|
| 233 | + for (int i=0; i<Size(); i++) |
---|
| 234 | + { |
---|
| 235 | + get(i).RestoreBigData(hashtable); |
---|
| 236 | + } |
---|
| 237 | + |
---|
132 | 238 | blockloop = false; |
---|
133 | 239 | } |
---|
134 | | -} |
---|
135 | 240 | |
---|
136 | | -void RestoreSupports() |
---|
137 | | -{ |
---|
138 | | - if (blockloop) |
---|
139 | | - return; |
---|
140 | | - |
---|
141 | | - support = transientsupport; |
---|
142 | | - link2master = transientlink2master; |
---|
143 | | - transientsupport = null; |
---|
144 | | - transientlink2master = false; |
---|
145 | | - |
---|
146 | | - if (bRep != null) |
---|
| 241 | + void RestoreBigData(Object3D o) |
---|
147 | 242 | { |
---|
148 | | - bRep.RestoreSupports(); |
---|
| 243 | + this.bRep = o.bRep; |
---|
| 244 | + if (this.bRep != null) |
---|
| 245 | + this.bRep.support = o.transientrep; |
---|
| 246 | + // this.support = o.support; |
---|
| 247 | + // this.fileparent = o.fileparent; |
---|
149 | 248 | } |
---|
150 | | - |
---|
151 | | - for (int i = 0; i < Size(); i++) |
---|
152 | | - { |
---|
153 | | - Object3D child = (Object3D) get(i); |
---|
154 | | - if (child == null) |
---|
155 | | - continue; |
---|
156 | | - blockloop = true; |
---|
157 | | - child.RestoreSupports(); |
---|
158 | | - blockloop = false; |
---|
159 | | - } |
---|
160 | | -} |
---|
161 | 249 | |
---|
162 | 250 | // MOCAP SUPPORT |
---|
163 | 251 | double tx,ty,tz,rx,ry,rz; |
---|
.. | .. |
---|
300 | 388 | } |
---|
301 | 389 | |
---|
302 | 390 | boolean live = false; |
---|
| 391 | + boolean dontselect = false; |
---|
303 | 392 | boolean hide = false; |
---|
304 | 393 | boolean link2master = false; // performs reset support/master at each frame |
---|
305 | 394 | boolean marked = false; // animation node |
---|
.. | .. |
---|
481 | 570 | toParent = LA.newMatrix(); |
---|
482 | 571 | fromParent = LA.newMatrix(); |
---|
483 | 572 | } |
---|
| 573 | + |
---|
484 | 574 | if (toParentMarked == null) |
---|
485 | 575 | { |
---|
486 | 576 | if (maxcount != 1) |
---|
487 | 577 | { |
---|
488 | 578 | new Exception().printStackTrace(); |
---|
489 | 579 | } |
---|
| 580 | + |
---|
490 | 581 | toParentMarked = LA.newMatrix(); |
---|
491 | 582 | fromParentMarked = LA.newMatrix(); |
---|
492 | 583 | } |
---|
.. | .. |
---|
774 | 865 | if (step == 0) |
---|
775 | 866 | step = 1; |
---|
776 | 867 | if (maxcount == 0) |
---|
777 | | - maxcount = 2048; // 4; |
---|
| 868 | + maxcount = 128; // 2048; // 4; |
---|
778 | 869 | // if (acceleration == 0) |
---|
779 | 870 | // acceleration = 10; |
---|
780 | 871 | if (delay == 0) // serial |
---|
.. | .. |
---|
797 | 888 | |
---|
798 | 889 | if (marked && Globals.isLIVE() && live && |
---|
799 | 890 | //TEMP21aug2018 |
---|
800 | | - Globals.DrawMode() == iCameraPane.SHADOW && |
---|
| 891 | + (Globals.DrawMode() == iCameraPane.SHADOW || !Globals.RENDERSHADOW || !Globals.COMPUTESHADOWWHENLIVE) && |
---|
801 | 892 | currentframe != Globals.framecount) |
---|
802 | 893 | { |
---|
803 | 894 | currentframe = Globals.framecount; |
---|
.. | .. |
---|
809 | 900 | |
---|
810 | 901 | boolean changedir = random && Math.random() < 0.01; // && !link2master; |
---|
811 | 902 | |
---|
812 | | - if (transformcount*factor > maxcount || (step == 1 && changedir)) |
---|
| 903 | + if (transformcount*factor >= maxcount && (rewind || random) || |
---|
| 904 | + (step == 1 && changedir)) |
---|
813 | 905 | { |
---|
814 | 906 | countdown = 1; |
---|
815 | 907 | delay = speedup?8:1; |
---|
.. | .. |
---|
881 | 973 | if (material == null || material.multiply) |
---|
882 | 974 | return true; |
---|
883 | 975 | |
---|
| 976 | + // Transparent objects are dynamic because we have to sort the triangles. |
---|
884 | 977 | return material.opacity > 0.99; |
---|
885 | 978 | } |
---|
886 | 979 | |
---|
.. | .. |
---|
912 | 1005 | fromParent = null; // LA.newMatrix(); |
---|
913 | 1006 | bRep = null; // new BoundaryRep(); |
---|
914 | 1007 | |
---|
| 1008 | + if (oname != null && oname.equals("LeftHand")) |
---|
| 1009 | + { |
---|
| 1010 | + name = oname; |
---|
| 1011 | + } |
---|
| 1012 | + |
---|
915 | 1013 | /* |
---|
916 | 1014 | float hue = (float)Math.random(); |
---|
917 | 1015 | Color col; |
---|
.. | .. |
---|
954 | 1052 | |
---|
955 | 1053 | public Object clone() |
---|
956 | 1054 | { |
---|
957 | | - return GrafreeD.clone(this); |
---|
| 1055 | + return Grafreed.clone(this); |
---|
958 | 1056 | } |
---|
959 | 1057 | |
---|
960 | 1058 | Object3D copyExpand() |
---|
.. | .. |
---|
1470 | 1568 | BoundaryRep.SEUIL = other.material.cameralight; |
---|
1471 | 1569 | |
---|
1472 | 1570 | // Set default to 0.1 |
---|
1473 | | - BoundaryRep.SEUIL /= 2; |
---|
| 1571 | + BoundaryRep.SEUIL /= 4; // 2; |
---|
1474 | 1572 | System.out.println("SEUIL = " + BoundaryRep.SEUIL); |
---|
1475 | 1573 | } |
---|
1476 | 1574 | |
---|
.. | .. |
---|
1729 | 1827 | Object3D o = new Object3D((clone?"Ge:":"Li:") + this.name); |
---|
1730 | 1828 | o.bRep = transientrep; |
---|
1731 | 1829 | if (clone) |
---|
1732 | | - o.bRep = (BoundaryRep) GrafreeD.clone(transientrep); |
---|
| 1830 | + o.bRep = (BoundaryRep) Grafreed.clone(transientrep); |
---|
1733 | 1831 | o.CreateMaterial(); |
---|
1734 | 1832 | o.SetAttributes(this, -1); |
---|
1735 | 1833 | //parent |
---|
.. | .. |
---|
1742 | 1840 | Object3D o = new Object3D((clone?"Ge:":"Li:") + this.name); |
---|
1743 | 1841 | o.bRep = bRep; |
---|
1744 | 1842 | if (clone) |
---|
1745 | | - o.bRep = (BoundaryRep) GrafreeD.clone(bRep); |
---|
| 1843 | + o.bRep = (BoundaryRep) Grafreed.clone(bRep); |
---|
1746 | 1844 | o.CreateMaterial(); |
---|
1747 | 1845 | //o.overwriteThis(this, -1); |
---|
1748 | 1846 | o.SetAttributes(this, -1); |
---|
.. | .. |
---|
1829 | 1927 | if (obj.name == null) |
---|
1830 | 1928 | continue; // can't be a null one |
---|
1831 | 1929 | |
---|
| 1930 | + // Try perfect match first. |
---|
1832 | 1931 | if (n.equals(obj.name)) |
---|
1833 | 1932 | { |
---|
1834 | 1933 | theobj = obj; |
---|
1835 | 1934 | count++; |
---|
1836 | 1935 | } |
---|
1837 | 1936 | } |
---|
| 1937 | + |
---|
| 1938 | + // not needed: n = n.split(":")[0]; // Poser generates a count |
---|
1838 | 1939 | |
---|
1839 | 1940 | if (count != 1) |
---|
1840 | 1941 | for (int i=Size(); --i>=0;) |
---|
.. | .. |
---|
2294 | 2395 | } |
---|
2295 | 2396 | */ |
---|
2296 | 2397 | } |
---|
| 2398 | + else |
---|
| 2399 | + { |
---|
| 2400 | + //((ObjEditor)editWindow).SetupUI2(null); |
---|
| 2401 | + } |
---|
2297 | 2402 | } |
---|
2298 | 2403 | |
---|
2299 | 2404 | void createEditWindow(GroupEditor callee, boolean newWindow) //, boolean root) |
---|
.. | .. |
---|
2335 | 2440 | { |
---|
2336 | 2441 | editWindow.refreshContents(); |
---|
2337 | 2442 | } |
---|
| 2443 | + else |
---|
| 2444 | + { |
---|
| 2445 | + if (manipWindow != null) |
---|
| 2446 | + { |
---|
| 2447 | + manipWindow.refreshContents(); |
---|
| 2448 | + } |
---|
| 2449 | + } |
---|
| 2450 | + |
---|
2338 | 2451 | //if (parent != null) |
---|
2339 | 2452 | //parent.refreshEditWindow(); |
---|
2340 | 2453 | } |
---|
.. | .. |
---|
2619 | 2732 | //Touch(); |
---|
2620 | 2733 | } |
---|
2621 | 2734 | |
---|
| 2735 | + void GenNormalsMeshS() |
---|
| 2736 | + { |
---|
| 2737 | + selection.GenNormalsMesh(); |
---|
| 2738 | +// for (int i=0; i<selection.size(); i++) |
---|
| 2739 | +// { |
---|
| 2740 | +// Object3D selectee = (Object3D) selection.elementAt(i); |
---|
| 2741 | +// selectee.GenNormals(crease); |
---|
| 2742 | +// } |
---|
| 2743 | + |
---|
| 2744 | + //Touch(); |
---|
| 2745 | + } |
---|
| 2746 | + |
---|
2622 | 2747 | void ClearColorsS() |
---|
2623 | 2748 | { |
---|
2624 | 2749 | selection.ClearColors(); |
---|
.. | .. |
---|
2750 | 2875 | if (child == null) |
---|
2751 | 2876 | continue; |
---|
2752 | 2877 | child.GenNormals(crease); |
---|
| 2878 | +// Children().release(i); |
---|
| 2879 | + } |
---|
| 2880 | + blockloop = false; |
---|
| 2881 | + } |
---|
| 2882 | + |
---|
| 2883 | + void GenNormalsMesh() |
---|
| 2884 | + { |
---|
| 2885 | + if (blockloop) |
---|
| 2886 | + return; |
---|
| 2887 | + |
---|
| 2888 | + blockloop = true; |
---|
| 2889 | + GenNormalsMesh0(); |
---|
| 2890 | + for (int i = 0; i < Children().Size(); i++) |
---|
| 2891 | + { |
---|
| 2892 | + Object3D child = (Object3D) Children().get(i); // reserve(i); |
---|
| 2893 | + if (child == null) |
---|
| 2894 | + continue; |
---|
| 2895 | + child.GenNormalsMesh(); |
---|
2753 | 2896 | // Children().release(i); |
---|
2754 | 2897 | } |
---|
2755 | 2898 | blockloop = false; |
---|
.. | .. |
---|
2922 | 3065 | } |
---|
2923 | 3066 | } |
---|
2924 | 3067 | |
---|
| 3068 | + void GenNormalsMesh0() |
---|
| 3069 | + { |
---|
| 3070 | + if (bRep != null) |
---|
| 3071 | + { |
---|
| 3072 | + bRep.GenerateNormalsMesh(); |
---|
| 3073 | + Touch(); |
---|
| 3074 | + } |
---|
| 3075 | + } |
---|
| 3076 | + |
---|
2925 | 3077 | void GenNormalsMINE0() |
---|
2926 | 3078 | { |
---|
2927 | 3079 | if (bRep != null) |
---|
.. | .. |
---|
2983 | 3135 | blockloop = false; |
---|
2984 | 3136 | } |
---|
2985 | 3137 | |
---|
| 3138 | + void TransformChildren() |
---|
| 3139 | + { |
---|
| 3140 | + if (toParent != null) |
---|
| 3141 | + { |
---|
| 3142 | + for (int i=Size(); --i>=0;) |
---|
| 3143 | + { |
---|
| 3144 | + Object3D v = get(i); |
---|
| 3145 | + |
---|
| 3146 | + if (v.toParent == null) |
---|
| 3147 | + { |
---|
| 3148 | + v.toParent = LA.newMatrix(); |
---|
| 3149 | + v.fromParent = LA.newMatrix(); |
---|
| 3150 | + } |
---|
| 3151 | + |
---|
| 3152 | +// LA.matConcat(v.toParent, toParent, v.toParent); |
---|
| 3153 | +// LA.matConcat(fromParent, v.fromParent, v.fromParent); |
---|
| 3154 | + LA.matConcat(toParent, v.toParent, v.toParent); |
---|
| 3155 | + LA.matConcat(v.fromParent, fromParent, v.fromParent); |
---|
| 3156 | + } |
---|
| 3157 | + |
---|
| 3158 | + toParent = null; // LA.matIdentity(toParent); |
---|
| 3159 | + fromParent = null; // LA.matIdentity(fromParent); |
---|
| 3160 | + |
---|
| 3161 | + Touch(); |
---|
| 3162 | + } |
---|
| 3163 | + } |
---|
| 3164 | + |
---|
2986 | 3165 | void TransformGeometry() |
---|
2987 | 3166 | { |
---|
2988 | 3167 | Object3D obj = this; |
---|
.. | .. |
---|
3204 | 3383 | |
---|
3205 | 3384 | BoundaryRep sup = bRep.support; |
---|
3206 | 3385 | bRep.support = null; |
---|
3207 | | - BoundaryRep temprep = (BoundaryRep) GrafreeD.clone(bRep); |
---|
| 3386 | + BoundaryRep temprep = (BoundaryRep) Grafreed.clone(bRep); |
---|
3208 | 3387 | // bRep.SplitInTwo(onlyone); // thread... |
---|
3209 | | - temprep.SplitInTwo(reduction34, onlyone); |
---|
| 3388 | + |
---|
| 3389 | + while(temprep.SplitInTwo(reduction34, onlyone)); |
---|
| 3390 | + |
---|
3210 | 3391 | bRep = temprep; |
---|
3211 | 3392 | bRep.support = sup; |
---|
3212 | 3393 | Touch(); |
---|
.. | .. |
---|
3343 | 3524 | if (blockloop) |
---|
3344 | 3525 | return; |
---|
3345 | 3526 | |
---|
3346 | | - if (marked || (bRep != null && material != null)) // borderline... |
---|
| 3527 | + if (//marked || // does not make sense |
---|
| 3528 | + (bRep != null || material != null)) // borderline... |
---|
3347 | 3529 | live = h; |
---|
3348 | 3530 | |
---|
3349 | 3531 | for (int i = 0; i < Size(); i++) |
---|
.. | .. |
---|
3364 | 3546 | return; |
---|
3365 | 3547 | |
---|
3366 | 3548 | //if (bRep != null) |
---|
3367 | | - if (marked || (bRep != null && material != null)) // borderline... |
---|
| 3549 | + if (//marked || // does not make sense |
---|
| 3550 | + (bRep != null || material != null)) // borderline... |
---|
3368 | 3551 | link2master = h; |
---|
3369 | 3552 | |
---|
3370 | 3553 | for (int i = 0; i < Size(); i++) |
---|
.. | .. |
---|
3384 | 3567 | if (blockloop) |
---|
3385 | 3568 | return; |
---|
3386 | 3569 | |
---|
3387 | | - if (marked || (bRep != null && material != null)) // borderline... |
---|
| 3570 | + if (//marked || // does not make sense |
---|
| 3571 | + (bRep != null || material != null)) // borderline... |
---|
3388 | 3572 | hide = h; |
---|
3389 | 3573 | |
---|
3390 | 3574 | for (int i = 0; i < Size(); i++) |
---|
.. | .. |
---|
3404 | 3588 | if (blockloop) |
---|
3405 | 3589 | return; |
---|
3406 | 3590 | |
---|
3407 | | - if (bRep != null && material != null) // borderline... |
---|
| 3591 | + if (bRep != null || material != null) // borderline... |
---|
3408 | 3592 | marked = h; |
---|
3409 | 3593 | |
---|
3410 | 3594 | for (int i = 0; i < Size(); i++) |
---|
.. | .. |
---|
3414 | 3598 | continue; |
---|
3415 | 3599 | blockloop = true; |
---|
3416 | 3600 | child.MarkLeaves(h); |
---|
| 3601 | + blockloop = false; |
---|
| 3602 | + // release(i); |
---|
| 3603 | + } |
---|
| 3604 | + } |
---|
| 3605 | + |
---|
| 3606 | + void RewindLeaves(boolean h) |
---|
| 3607 | + { |
---|
| 3608 | + if (blockloop) |
---|
| 3609 | + return; |
---|
| 3610 | + |
---|
| 3611 | + if (bRep != null || material != null) // borderline... |
---|
| 3612 | + rewind = h; |
---|
| 3613 | + |
---|
| 3614 | + for (int i = 0; i < Size(); i++) |
---|
| 3615 | + { |
---|
| 3616 | + Object3D child = (Object3D) get(i); // reserve(i); |
---|
| 3617 | + if (child == null) |
---|
| 3618 | + continue; |
---|
| 3619 | + blockloop = true; |
---|
| 3620 | + child.RewindLeaves(h); |
---|
| 3621 | + blockloop = false; |
---|
| 3622 | + // release(i); |
---|
| 3623 | + } |
---|
| 3624 | + } |
---|
| 3625 | + |
---|
| 3626 | + void RandomLeaves(boolean h) |
---|
| 3627 | + { |
---|
| 3628 | + if (blockloop) |
---|
| 3629 | + return; |
---|
| 3630 | + |
---|
| 3631 | + if (bRep != null || material != null) // borderline... |
---|
| 3632 | + random = h; |
---|
| 3633 | + |
---|
| 3634 | + for (int i = 0; i < Size(); i++) |
---|
| 3635 | + { |
---|
| 3636 | + Object3D child = (Object3D) get(i); // reserve(i); |
---|
| 3637 | + if (child == null) |
---|
| 3638 | + continue; |
---|
| 3639 | + blockloop = true; |
---|
| 3640 | + child.RandomLeaves(h); |
---|
3417 | 3641 | blockloop = false; |
---|
3418 | 3642 | // release(i); |
---|
3419 | 3643 | } |
---|
.. | .. |
---|
3728 | 3952 | if (child == null) |
---|
3729 | 3953 | continue; |
---|
3730 | 3954 | |
---|
3731 | | - if (GrafreeD.RENDERME > 0) |
---|
| 3955 | + if (Grafreed.RENDERME > 0) |
---|
3732 | 3956 | { |
---|
3733 | 3957 | if (child instanceof Merge) |
---|
3734 | 3958 | ((Merge)child).renderme(); |
---|
.. | .. |
---|
3879 | 4103 | if (child == null) |
---|
3880 | 4104 | continue; |
---|
3881 | 4105 | |
---|
3882 | | - if (GrafreeD.RENDERME > 0) |
---|
| 4106 | + if (Grafreed.RENDERME > 0) |
---|
3883 | 4107 | { |
---|
3884 | 4108 | if (child instanceof Merge) |
---|
3885 | 4109 | ((Merge)child).renderme(); |
---|
.. | .. |
---|
4074 | 4298 | if (child == null) |
---|
4075 | 4299 | continue; |
---|
4076 | 4300 | |
---|
4077 | | - if (GrafreeD.RENDERME > 0) |
---|
| 4301 | + if (Grafreed.RENDERME > 0) |
---|
4078 | 4302 | { |
---|
4079 | 4303 | if (child instanceof Merge) |
---|
4080 | 4304 | ((Merge)child).renderme(); |
---|
.. | .. |
---|
4187 | 4411 | { |
---|
4188 | 4412 | blockloop = true; |
---|
4189 | 4413 | get(i).RepairShadow(); |
---|
| 4414 | + blockloop = false; |
---|
| 4415 | + } |
---|
| 4416 | + } |
---|
| 4417 | + |
---|
| 4418 | + void RepairSOV() |
---|
| 4419 | + { |
---|
| 4420 | + if (blockloop) |
---|
| 4421 | + return; |
---|
| 4422 | + |
---|
| 4423 | + String texname = this.GetPigmentTexture(); |
---|
| 4424 | + |
---|
| 4425 | + if (texname.startsWith("sov")) |
---|
| 4426 | + { |
---|
| 4427 | + String[] s = texname.split("/"); |
---|
| 4428 | + |
---|
| 4429 | + String[] sname = s[1].split("Color.pn"); |
---|
| 4430 | + |
---|
| 4431 | + texname = sname[0]; |
---|
| 4432 | + |
---|
| 4433 | + if (sname.length > 1) |
---|
| 4434 | + { |
---|
| 4435 | + texname += "Color.jpg"; |
---|
| 4436 | + } |
---|
| 4437 | + |
---|
| 4438 | + this.SetPigmentTexture("sov/" + texname); |
---|
| 4439 | + } |
---|
| 4440 | + |
---|
| 4441 | + texname = this.GetBumpTexture(); |
---|
| 4442 | + |
---|
| 4443 | + if (texname.startsWith("sov")) |
---|
| 4444 | + { |
---|
| 4445 | + String[] s = texname.split("/"); |
---|
| 4446 | + |
---|
| 4447 | + String[] sname = s[1].split("Bump.pn"); |
---|
| 4448 | + |
---|
| 4449 | + texname = sname[0]; |
---|
| 4450 | + |
---|
| 4451 | + if (sname.length > 1) |
---|
| 4452 | + { |
---|
| 4453 | + texname += "Bump.jpg"; |
---|
| 4454 | + } |
---|
| 4455 | + |
---|
| 4456 | + this.SetBumpTexture("sov/" + texname); |
---|
| 4457 | + } |
---|
| 4458 | + |
---|
| 4459 | + for (int i=0; i<Size(); i++) |
---|
| 4460 | + { |
---|
| 4461 | + blockloop = true; |
---|
| 4462 | + get(i).RepairSOV(); |
---|
4190 | 4463 | blockloop = false; |
---|
4191 | 4464 | } |
---|
4192 | 4465 | } |
---|
.. | .. |
---|
4681 | 4954 | |
---|
4682 | 4955 | cTreePath SelectLeaf(int indexcount, boolean deselect) |
---|
4683 | 4956 | { |
---|
4684 | | - if (hide) |
---|
| 4957 | + if (hide || dontselect) |
---|
4685 | 4958 | return null; |
---|
4686 | 4959 | |
---|
4687 | 4960 | if (count <= 0) |
---|
.. | .. |
---|
4705 | 4978 | } |
---|
4706 | 4979 | } |
---|
4707 | 4980 | |
---|
| 4981 | + ObjEditor GetWindow() |
---|
| 4982 | + { |
---|
| 4983 | + if (editWindow != null) |
---|
| 4984 | + return editWindow; |
---|
| 4985 | + |
---|
| 4986 | + return manipWindow; |
---|
| 4987 | + } |
---|
| 4988 | + |
---|
4708 | 4989 | cTreePath Select(int indexcount, boolean deselect) |
---|
4709 | 4990 | { |
---|
4710 | | - if (hide) |
---|
| 4991 | + if (hide || dontselect) |
---|
4711 | 4992 | return null; |
---|
4712 | 4993 | |
---|
4713 | 4994 | if (count <= 0) |
---|
.. | .. |
---|
4741 | 5022 | if (leaf != null) |
---|
4742 | 5023 | { |
---|
4743 | 5024 | cTreePath tp = new cTreePath(this, leaf); |
---|
4744 | | - if (editWindow != null) |
---|
| 5025 | + ObjEditor window = GetWindow(); |
---|
| 5026 | + if (window != null) |
---|
4745 | 5027 | { |
---|
4746 | 5028 | //System.out.println("editWindow = " + editWindow + " vs " + this); |
---|
4747 | | - editWindow.Select(tp, deselect, true); |
---|
| 5029 | + window.Select(tp, deselect, true); |
---|
4748 | 5030 | } |
---|
4749 | 5031 | |
---|
4750 | 5032 | return tp; |
---|
.. | .. |
---|
4770 | 5052 | if (leaf != null) |
---|
4771 | 5053 | { |
---|
4772 | 5054 | cTreePath tp = new cTreePath(this, leaf); |
---|
4773 | | - if (editWindow != null) |
---|
| 5055 | + ObjEditor window = GetWindow(); |
---|
| 5056 | + if (window != null) |
---|
4774 | 5057 | { |
---|
4775 | | - editWindow.Select(tp, deselect, true); |
---|
| 5058 | + window.Select(tp, deselect, true); |
---|
4776 | 5059 | } |
---|
4777 | 5060 | |
---|
4778 | 5061 | return tp; |
---|
.. | .. |
---|
5333 | 5616 | } |
---|
5334 | 5617 | } |
---|
5335 | 5618 | |
---|
| 5619 | + UUID GetUUID() |
---|
| 5620 | + { |
---|
| 5621 | + if (uuid == null) |
---|
| 5622 | + { |
---|
| 5623 | + // Serial |
---|
| 5624 | + uuid = UUID.randomUUID(); |
---|
| 5625 | + } |
---|
| 5626 | + |
---|
| 5627 | + return uuid; |
---|
| 5628 | + } |
---|
| 5629 | + |
---|
| 5630 | + Object3D GetObject(UUID uid) |
---|
| 5631 | + { |
---|
| 5632 | + if (blockloop) |
---|
| 5633 | + return null; |
---|
| 5634 | + |
---|
| 5635 | + if (GetUUID().equals(uid)) |
---|
| 5636 | + return this; |
---|
| 5637 | + |
---|
| 5638 | + int nb = Size(); |
---|
| 5639 | + for (int i = 0; i < nb; i++) |
---|
| 5640 | + { |
---|
| 5641 | + Object3D child = (Object3D) get(i); |
---|
| 5642 | + |
---|
| 5643 | + if (child == null) |
---|
| 5644 | + continue; |
---|
| 5645 | + |
---|
| 5646 | + blockloop = true; |
---|
| 5647 | + Object3D obj = child.GetObject(uid); |
---|
| 5648 | + blockloop = false; |
---|
| 5649 | + if (obj != null) |
---|
| 5650 | + return obj; |
---|
| 5651 | + } |
---|
| 5652 | + |
---|
| 5653 | + return null; |
---|
| 5654 | + } |
---|
| 5655 | + |
---|
5336 | 5656 | void SetBumpTexture(String tex) |
---|
5337 | 5657 | { |
---|
5338 | 5658 | if (GetTextures() == null) |
---|
.. | .. |
---|
5377 | 5697 | boolean NeedSupport() |
---|
5378 | 5698 | { |
---|
5379 | 5699 | return |
---|
5380 | | - CameraPane.SUPPORT && !CameraPane.movingcamera && link2master && /*live &&*/ support != null |
---|
| 5700 | + CameraPane.SUPPORT && (!CameraPane.movingcamera || (!Globals.FREEZEONMOVE && Globals.isLIVE())) && link2master && /*live &&*/ support != null |
---|
5381 | 5701 | // PROBLEM with CROWD!! |
---|
5382 | | - && (Globals.DrawMode() == iCameraPane.SHADOW || Globals.CROWD); |
---|
| 5702 | + && (Globals.DrawMode() == iCameraPane.SHADOW || !Globals.RENDERSHADOW || Globals.CROWD); |
---|
5383 | 5703 | } |
---|
5384 | 5704 | |
---|
5385 | 5705 | static boolean DEBUG_SELECTION = false; |
---|
| 5706 | + |
---|
| 5707 | + boolean IsLive() |
---|
| 5708 | + { |
---|
| 5709 | + if (live) |
---|
| 5710 | + return true; |
---|
| 5711 | + |
---|
| 5712 | + if (parent == null) |
---|
| 5713 | + return false; |
---|
| 5714 | + |
---|
| 5715 | + return parent.IsLive(); |
---|
| 5716 | + } |
---|
5386 | 5717 | |
---|
5387 | 5718 | void Draw(iCameraPane display, Object3D /*Composite*/ root, boolean selected, boolean blocked) |
---|
5388 | 5719 | { |
---|
.. | .. |
---|
5394 | 5725 | } |
---|
5395 | 5726 | |
---|
5396 | 5727 | if (display.DrawMode() == iCameraPane.SELECTION && |
---|
5397 | | - hide) |
---|
| 5728 | + (hide || dontselect)) |
---|
5398 | 5729 | return; |
---|
5399 | 5730 | |
---|
5400 | 5731 | if (name != null && name.contains("sclera")) |
---|
.. | .. |
---|
5445 | 5776 | support = support; |
---|
5446 | 5777 | |
---|
5447 | 5778 | //boolean usecalllists = IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null || !link2master); // !(this instanceof cSpring) && !(this instanceof BezierPatch); |
---|
5448 | | - boolean usecalllists = false; // IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null) && !link2master; // !(this instanceof cSpring) && !(this instanceof BezierPatch); |
---|
| 5779 | + boolean usecalllists = !IsLive(); // IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null) && !link2master; // !(this instanceof cSpring) && !(this instanceof BezierPatch); |
---|
5449 | 5780 | |
---|
5450 | 5781 | if (!usecalllists && bRep != null && bRep.displaylist > 0) |
---|
5451 | 5782 | { |
---|
.. | .. |
---|
5465 | 5796 | boolean selectmode = display.DrawMode() == display.SELECTION || display.IsDebugSelection(); |
---|
5466 | 5797 | |
---|
5467 | 5798 | if (!selectmode && //display.DrawMode() != display.SELECTION && |
---|
5468 | | - (touched || (bRep != null && bRep.displaylist <= 0))) |
---|
| 5799 | + //(touched || (bRep != null && bRep.displaylist <= 0))) |
---|
| 5800 | + (Globals.isLIVE() && Globals.COMPUTESHADOWWHENLIVE || touched || (bRep != null && bRep.displaylist <= 0))) |
---|
5469 | 5801 | { |
---|
5470 | 5802 | Globals.lighttouched = true; |
---|
5471 | 5803 | } // all panes... |
---|
| 5804 | + |
---|
5472 | 5805 | //if (usecalllists && display.DrawMode() != display.SELECTION && display.DrawMode() != display.SHADOW && |
---|
5473 | 5806 | if (bRep != null && usecalllists && !selectmode && // june 2013 display.DrawMode() != display.SHADOW && |
---|
5474 | 5807 | (touched || (bRep != null && bRep.displaylist <= 0))) |
---|
.. | .. |
---|
5636 | 5969 | tex = GetTextures(); |
---|
5637 | 5970 | } |
---|
5638 | 5971 | |
---|
5639 | | - display.BindTextures(tex, texres); |
---|
| 5972 | + boolean failedPigment = false; |
---|
| 5973 | + boolean failedBump = false; |
---|
| 5974 | + |
---|
| 5975 | + try |
---|
| 5976 | + { |
---|
| 5977 | + display.BindPigmentTexture(tex, texres); |
---|
| 5978 | + } |
---|
| 5979 | + catch (Exception e) |
---|
| 5980 | + { |
---|
| 5981 | + System.err.println("FAILED: " + this); |
---|
| 5982 | + failedPigment = true; |
---|
| 5983 | + } |
---|
| 5984 | + |
---|
| 5985 | + try |
---|
| 5986 | + { |
---|
| 5987 | + display.BindBumpTexture(tex, texres); |
---|
| 5988 | + } |
---|
| 5989 | + catch (Exception e) |
---|
| 5990 | + { |
---|
| 5991 | + //System.err.println("FAILED: " + this); |
---|
| 5992 | + failedBump = true; |
---|
| 5993 | + } |
---|
5640 | 5994 | |
---|
5641 | 5995 | if (!compiled) |
---|
5642 | 5996 | { |
---|
.. | .. |
---|
5658 | 6012 | } |
---|
5659 | 6013 | } |
---|
5660 | 6014 | |
---|
5661 | | - display.ReleaseTextures(tex); |
---|
| 6015 | + if (!failedBump) |
---|
| 6016 | + display.ReleaseBumpTexture(tex); |
---|
| 6017 | + |
---|
| 6018 | + if (!failedPigment) |
---|
| 6019 | + display.ReleasePigmentTexture(tex); |
---|
5662 | 6020 | |
---|
5663 | 6021 | display.PopMaterial(this, selected); |
---|
5664 | 6022 | } |
---|
.. | .. |
---|
5787 | 6145 | |
---|
5788 | 6146 | void drawSelf(iCameraPane display, Object3D /*Composite*/ root, boolean selected, boolean blocked) |
---|
5789 | 6147 | { |
---|
| 6148 | + if (display.DrawMode() == iCameraPane.SELECTION && dontselect) |
---|
| 6149 | + return; |
---|
| 6150 | + |
---|
5790 | 6151 | if (hide) |
---|
5791 | 6152 | return; |
---|
5792 | 6153 | // shadow optimisation |
---|
.. | .. |
---|
5912 | 6273 | if (display.DrawMode() == display.SHADOW && projectedVertices != null && projectedVertices.length > 2 && projectedVertices[2].y >= 10000) |
---|
5913 | 6274 | return; // no shadow for transparent objects |
---|
5914 | 6275 | |
---|
| 6276 | + if (display.DrawMode() == iCameraPane.SELECTION && dontselect) |
---|
| 6277 | + return; |
---|
| 6278 | + |
---|
5915 | 6279 | if (hide) |
---|
5916 | 6280 | return; |
---|
5917 | 6281 | |
---|
.. | .. |
---|
6025 | 6389 | // dec 2012 |
---|
6026 | 6390 | new Exception().printStackTrace(); |
---|
6027 | 6391 | return; |
---|
| 6392 | + } |
---|
| 6393 | + |
---|
| 6394 | + if (dontselect) |
---|
| 6395 | + { |
---|
| 6396 | + //bRep.GenerateNormalsMINE(); |
---|
6028 | 6397 | } |
---|
6029 | 6398 | |
---|
6030 | 6399 | display.DrawGeometry(bRep, flipV, selectmode); |
---|
.. | .. |
---|
6877 | 7246 | spot.translate(32, 32); |
---|
6878 | 7247 | spotw = spot.x + spot.width; |
---|
6879 | 7248 | spoth = spot.y + spot.height; |
---|
6880 | | - info.g.setColor(Color.blue); |
---|
| 7249 | + info.g.setColor(Color.cyan); |
---|
6881 | 7250 | info.g.fillRect(spot.x, spot.y, spot.width, spot.height); |
---|
6882 | 7251 | // if (CameraPane.Xmin > spot.x) |
---|
6883 | 7252 | // { |
---|
.. | .. |
---|
6895 | 7264 | // { |
---|
6896 | 7265 | // CameraPane.Ymax = spoth; |
---|
6897 | 7266 | // } |
---|
6898 | | - info.g.drawLine(spotw, spoth, spotw, spoth - 15); |
---|
6899 | | - info.g.drawLine(spotw, spoth, spotw - 15, spoth); |
---|
| 7267 | + // bonhommes info.g.drawLine(spotw, spoth, spotw, spoth - boundary.height/2); // 15 |
---|
| 7268 | + //info.g.drawLine(spotw, spoth, spotw - boundary.width/2, spoth); // 15 |
---|
6900 | 7269 | spot.translate(0, -32); |
---|
6901 | | - info.g.setColor(Color.green); |
---|
| 7270 | + info.g.setColor(Color.yellow); |
---|
6902 | 7271 | info.g.fillRect(spot.x, spot.y, spot.width, spot.height); |
---|
| 7272 | + info.g.setColor(Color.green); |
---|
6903 | 7273 | // if (CameraPane.Xmin > spot.x) |
---|
6904 | 7274 | // { |
---|
6905 | 7275 | // CameraPane.Xmin = spot.x; |
---|
.. | .. |
---|
6951 | 7321 | startX = info.x; |
---|
6952 | 7322 | startY = info.y; |
---|
6953 | 7323 | |
---|
6954 | | - hitSomething = 0; |
---|
| 7324 | + hitSomething = -1; |
---|
6955 | 7325 | cVector origin = new cVector(); |
---|
6956 | 7326 | //LA.xformPos(origin, toParent, origin); |
---|
6957 | 7327 | Rectangle spot = new Rectangle(); |
---|
.. | .. |
---|
7027 | 7397 | //System.out.println("hitSomething = " + hitSomething); |
---|
7028 | 7398 | |
---|
7029 | 7399 | double scale = 0.005f * info.camera.Distance(); |
---|
| 7400 | + |
---|
7030 | 7401 | cVector xlate = new cVector(); |
---|
7031 | 7402 | //cVector xlate2 = new cVector(); |
---|
7032 | 7403 | switch (hitSomething) |
---|
.. | .. |
---|
7175 | 7546 | |
---|
7176 | 7547 | case hitScale: // scale |
---|
7177 | 7548 | double hScale = (double) (info.x - centerPt.x) / 32; |
---|
| 7549 | + double sign = 1; |
---|
| 7550 | + if (hScale < 0) |
---|
| 7551 | + { |
---|
| 7552 | + sign = -1; |
---|
| 7553 | + } |
---|
| 7554 | + hScale = sign*Math.pow(sign*hScale, scale * 50); |
---|
7178 | 7555 | if (hScale < 0.01) |
---|
7179 | 7556 | { |
---|
7180 | | - hScale = 0.01; |
---|
| 7557 | + //hScale = 0.01; |
---|
7181 | 7558 | } |
---|
7182 | | - hScale = Math.pow(hScale, scale * 50); |
---|
7183 | | - if (hScale < 0.01) |
---|
7184 | | - { |
---|
7185 | | - hScale = 0.01; |
---|
7186 | | - } |
---|
| 7559 | + |
---|
7187 | 7560 | double vScale = (double) (info.y - centerPt.y) / 32; |
---|
7188 | | - if (vScale < 0.01) |
---|
| 7561 | + sign = 1; |
---|
| 7562 | + if (vScale < 0) |
---|
7189 | 7563 | { |
---|
7190 | | - vScale = 0.01; |
---|
| 7564 | + sign = -1; |
---|
7191 | 7565 | } |
---|
7192 | | - vScale = Math.pow(vScale, scale * 50); |
---|
| 7566 | + vScale = sign*Math.pow(sign*vScale, scale * 50); |
---|
7193 | 7567 | if (vScale < 0.01) |
---|
7194 | 7568 | { |
---|
7195 | | - vScale = 0.01; |
---|
| 7569 | + //vScale = 0.01; |
---|
7196 | 7570 | } |
---|
7197 | 7571 | LA.matCopy(startMat, toParent); |
---|
7198 | 7572 | /**/ |
---|
.. | .. |
---|
7203 | 7577 | } |
---|
7204 | 7578 | /**/ |
---|
7205 | 7579 | |
---|
| 7580 | + double totalScale = Math.sqrt(hScale*hScale + vScale*vScale) / Math.sqrt(2); |
---|
| 7581 | + |
---|
| 7582 | + if (totalScale < 0.01) |
---|
| 7583 | + { |
---|
| 7584 | + totalScale = 0.01; |
---|
| 7585 | + } |
---|
| 7586 | + |
---|
7206 | 7587 | switch (info.pane.RenderCamera().viewCode) |
---|
7207 | 7588 | { |
---|
7208 | 7589 | case 3: // '\001' |
---|
7209 | | - if (modified) |
---|
| 7590 | + if (modified || opposite) |
---|
7210 | 7591 | { |
---|
7211 | 7592 | //LA.matScale(toParent, 1, hScale, vScale); |
---|
7212 | | - LA.matScale(toParent, vScale, 1, 1); |
---|
| 7593 | + LA.matScale(toParent, totalScale, 1, 1); |
---|
7213 | 7594 | } // vScale, 1); |
---|
7214 | 7595 | else |
---|
7215 | 7596 | { |
---|
7216 | | - LA.matScale(toParent, vScale, vScale, vScale); |
---|
| 7597 | + // EXCEPTION! |
---|
| 7598 | + LA.matScale(toParent, totalScale, totalScale, totalScale); |
---|
7217 | 7599 | } // vScale, 1); |
---|
7218 | 7600 | break; |
---|
7219 | 7601 | |
---|
7220 | 7602 | case 2: // '\002' |
---|
7221 | | - if (modified) |
---|
| 7603 | + if (modified || opposite) |
---|
7222 | 7604 | { |
---|
7223 | 7605 | //LA.matScale(toParent, hScale, 1, vScale); |
---|
7224 | | - LA.matScale(toParent, 1, vScale, 1); |
---|
| 7606 | + LA.matScale(toParent, 1, totalScale, 1); |
---|
7225 | 7607 | } else |
---|
7226 | 7608 | { |
---|
7227 | | - LA.matScale(toParent, vScale, 1, vScale); |
---|
| 7609 | + LA.matScale(toParent, totalScale, 1, totalScale); |
---|
7228 | 7610 | } |
---|
7229 | 7611 | break; |
---|
7230 | 7612 | |
---|
7231 | 7613 | case 1: // '\003' |
---|
7232 | | - if (modified) |
---|
| 7614 | + if (modified || opposite) |
---|
7233 | 7615 | { |
---|
7234 | 7616 | //LA.matScale(toParent, hScale, vScale, 1); |
---|
7235 | | - LA.matScale(toParent, 1, 1, vScale); |
---|
| 7617 | + LA.matScale(toParent, 1, 1, totalScale); |
---|
7236 | 7618 | } else |
---|
7237 | 7619 | { |
---|
7238 | | - LA.matScale(toParent, vScale, vScale, 1); |
---|
| 7620 | + LA.matScale(toParent, totalScale, totalScale, 1); |
---|
7239 | 7621 | } |
---|
7240 | 7622 | break; |
---|
7241 | 7623 | } |
---|
.. | .. |
---|
7368 | 7750 | //return super.toString() + " (id=" + list + ")" + " (brep=" + bRep + ")"; |
---|
7369 | 7751 | //return name + " (id=" + list + ")" + " (brep=" + bRep + ") " + super.toString(); |
---|
7370 | 7752 | //return name + " (#tri = " + (bRep==null?0:bRep.VertexCount()) + ") " + super.toString(); |
---|
| 7753 | + |
---|
| 7754 | + String objname; |
---|
| 7755 | + |
---|
7371 | 7756 | if (false) //parent != null) |
---|
7372 | 7757 | { |
---|
7373 | | - return name + " " + System.identityHashCode(this) + " (" + parent.name + " " + System.identityHashCode(parent) + ")"; |
---|
| 7758 | + objname = name + " " + System.identityHashCode(this) + " (" + parent.name + " " + System.identityHashCode(parent) + ")"; |
---|
7374 | 7759 | } else |
---|
7375 | 7760 | { |
---|
7376 | | - return GetName() + (Math.abs(count) == 1000 ? (count == 1000 ? " " : " * ") : (" (" + (count /*- 1*/) + ") ")) + /*(IsSelected()?"(selected) ":"") + (touched?"(touched) ":"") */ +System.identityHashCode(this); |
---|
| 7761 | + objname = GetName() + (Math.abs(count) == 1000 ? (count == 1000 ? " " : " * ") : (" (" + (count - 1) + ")")) + /*(IsSelected()?"(selected) ":"") + (touched?"(touched) ":"") */ ""; |
---|
7377 | 7762 | } // + super.toString(); |
---|
7378 | 7763 | //return name + " (" + (SizeOf.deepSizeOf(this)/1024) + "K) " + this.getClass().getName(); |
---|
| 7764 | + |
---|
| 7765 | + if (!Globals.ADVANCED) |
---|
| 7766 | + return objname; |
---|
| 7767 | + |
---|
| 7768 | + return objname + " " + System.identityHashCode(this); |
---|
7379 | 7769 | } |
---|
7380 | 7770 | |
---|
7381 | 7771 | public int hashCode() |
---|
.. | .. |
---|
7441 | 7831 | editWindow = null; |
---|
7442 | 7832 | } // ? |
---|
7443 | 7833 | } |
---|
| 7834 | + else |
---|
| 7835 | + { |
---|
| 7836 | + //editWindow.closeUI(); |
---|
| 7837 | + } |
---|
7444 | 7838 | } |
---|
7445 | 7839 | |
---|
7446 | 7840 | boolean root; // patch for edit windows |
---|
.. | .. |
---|
7452 | 7846 | /*transient*/ cVector2[] projectedVertices = new cVector2[0]; |
---|
7453 | 7847 | |
---|
7454 | 7848 | Object3D /*Composite*/ parent; |
---|
7455 | | - Object3D /*Composite*/ fileparent; |
---|
| 7849 | + Object3D /*Composite*/ fileparent; // In the case of FileObject |
---|
7456 | 7850 | |
---|
7457 | 7851 | double[][] toParent; // dynamic matrix |
---|
7458 | 7852 | double[][] fromParent; |
---|
.. | .. |
---|
7567 | 7961 | { |
---|
7568 | 7962 | assert(bRep != null); |
---|
7569 | 7963 | if (!(support instanceof GenericJoint)) // support.bRep != null) |
---|
7570 | | - GrafreeD.Assert(support.bRep == bRep.support); |
---|
| 7964 | + Grafreed.Assert(support.bRep == bRep.support); |
---|
7571 | 7965 | } |
---|
7572 | 7966 | else |
---|
7573 | 7967 | { |
---|
.. | .. |
---|
7598 | 7992 | } |
---|
7599 | 7993 | |
---|
7600 | 7994 | transient ObjEditor editWindow; |
---|
| 7995 | + transient ObjEditor manipWindow; |
---|
| 7996 | + |
---|
| 7997 | + transient boolean pinned; |
---|
| 7998 | + |
---|
7601 | 7999 | transient ObjectUI objectUI; |
---|
7602 | 8000 | public static int povDepth = 0; |
---|
7603 | 8001 | private static cVector tbMin = new cVector(); |
---|
.. | .. |
---|
7616 | 8014 | private static cVector edge2 = new cVector(); |
---|
7617 | 8015 | //private static cVector norm = new cVector(); |
---|
7618 | 8016 | /*transient private*/ int hitSomething; |
---|
7619 | | - private static final int hitCenter = 1; |
---|
7620 | | - private static final int hitScale = 2; |
---|
7621 | | - private static final int hitRotate = 3; |
---|
| 8017 | + static final int hitCenter = 1; |
---|
| 8018 | + static final int hitScale = 2; |
---|
| 8019 | + static final int hitRotate = 3; |
---|
7622 | 8020 | /*transient*/ /*private*/ int viewCode; // Now used for transparency cache flag |
---|
7623 | 8021 | /*transient*/ private Point centerPt; |
---|
7624 | 8022 | /*transient*/ private int startX; |
---|