.. | .. |
---|
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; |
---|
22 | 24 | |
---|
| 25 | + private UUID uuid = UUID.randomUUID(); |
---|
| 26 | + |
---|
| 27 | + // TEMPORARY for mocap undo. No need to be transient. |
---|
| 28 | + mocap.reader.BVHReader.BVHResult savebvh; |
---|
| 29 | + Object3D saveskeleton; |
---|
| 30 | + // |
---|
| 31 | + |
---|
| 32 | + byte[] versions[] = new byte[100][]; |
---|
| 33 | + int versionindex = -1; |
---|
| 34 | + |
---|
23 | 35 | ScriptNode scriptnode; |
---|
24 | 36 | |
---|
25 | 37 | void InitOthers() |
---|
.. | .. |
---|
100 | 112 | |
---|
101 | 113 | // transient boolean reduced; // for morph reduction |
---|
102 | 114 | |
---|
103 | | -transient com.bulletphysics.linearmath.Transform cache; // for fast merge |
---|
104 | | -transient com.bulletphysics.linearmath.Transform cache_1; // for fast merge |
---|
| 115 | + transient com.bulletphysics.linearmath.Transform cache; // for fast merge |
---|
| 116 | + transient com.bulletphysics.linearmath.Transform cache_1; // for fast merge |
---|
105 | 117 | |
---|
106 | | -transient Object3D transientsupport; // for cloning |
---|
107 | | -transient boolean transientlink2master; |
---|
| 118 | + transient Object3D transientsupport; // for cloning |
---|
| 119 | + transient boolean transientlink2master; |
---|
108 | 120 | |
---|
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) |
---|
| 121 | + void SaveSupports() |
---|
121 | 122 | { |
---|
122 | | - bRep.SaveSupports(); |
---|
| 123 | + if (blockloop) |
---|
| 124 | + return; |
---|
| 125 | + |
---|
| 126 | + transientsupport = support; |
---|
| 127 | + transientlink2master = link2master; |
---|
| 128 | + |
---|
| 129 | + support = null; |
---|
| 130 | + link2master = false; |
---|
| 131 | + |
---|
| 132 | + if (bRep != null) |
---|
| 133 | + { |
---|
| 134 | + bRep.SaveSupports(); |
---|
| 135 | + } |
---|
| 136 | + |
---|
| 137 | + for (int i = 0; i < Size(); i++) |
---|
| 138 | + { |
---|
| 139 | + Object3D child = (Object3D) get(i); |
---|
| 140 | + if (child == null) |
---|
| 141 | + continue; |
---|
| 142 | + blockloop = true; |
---|
| 143 | + child.SaveSupports(); |
---|
| 144 | + blockloop = false; |
---|
| 145 | + } |
---|
123 | 146 | } |
---|
124 | | - |
---|
125 | | - for (int i = 0; i < Size(); i++) |
---|
| 147 | + |
---|
| 148 | + void RestoreSupports() |
---|
126 | 149 | { |
---|
127 | | - Object3D child = (Object3D) get(i); |
---|
128 | | - if (child == null) |
---|
129 | | - continue; |
---|
| 150 | + if (blockloop) |
---|
| 151 | + return; |
---|
| 152 | + |
---|
| 153 | + support = transientsupport; |
---|
| 154 | + link2master = transientlink2master; |
---|
| 155 | + transientsupport = null; |
---|
| 156 | + transientlink2master = false; |
---|
| 157 | + |
---|
| 158 | + if (bRep != null) |
---|
| 159 | + { |
---|
| 160 | + bRep.RestoreSupports(); |
---|
| 161 | + } |
---|
| 162 | + |
---|
| 163 | + for (int i = 0; i < Size(); i++) |
---|
| 164 | + { |
---|
| 165 | + Object3D child = (Object3D) get(i); |
---|
| 166 | + if (child == null) |
---|
| 167 | + continue; |
---|
| 168 | + blockloop = true; |
---|
| 169 | + child.RestoreSupports(); |
---|
| 170 | + blockloop = false; |
---|
| 171 | + } |
---|
| 172 | + } |
---|
| 173 | + |
---|
| 174 | + void ExtractBigData(java.util.Hashtable<java.util.UUID, Object3D> hashtable) |
---|
| 175 | + { |
---|
| 176 | + Object3D o; |
---|
| 177 | + |
---|
| 178 | + if (hashtable.containsKey(GetUUID())) |
---|
| 179 | + { |
---|
| 180 | + o = hashtable.get(GetUUID()); |
---|
| 181 | + |
---|
| 182 | + Grafreed.Assert(this.bRep == o.bRep); |
---|
| 183 | + //if (this.bRep != null) |
---|
| 184 | + // assert(this.bRep.support == o.transientrep); |
---|
| 185 | + if (this.support != null) |
---|
| 186 | + assert(this.support.bRep == o.transientrep); |
---|
| 187 | + } |
---|
| 188 | + else |
---|
| 189 | + { |
---|
| 190 | + o = new Object3D("copy of " + this.name); |
---|
| 191 | + |
---|
| 192 | + hashtable.put(GetUUID(), o); |
---|
| 193 | + } |
---|
| 194 | + |
---|
| 195 | + if (!blockloop) |
---|
| 196 | + { |
---|
| 197 | + blockloop = true; |
---|
| 198 | + |
---|
| 199 | + for (int i=0; i<Size(); i++) |
---|
| 200 | + { |
---|
| 201 | + get(i).ExtractBigData(hashtable); |
---|
| 202 | + } |
---|
| 203 | + |
---|
| 204 | + blockloop = false; |
---|
| 205 | + } |
---|
| 206 | + |
---|
| 207 | + ExtractBigData(o); |
---|
| 208 | + } |
---|
| 209 | + |
---|
| 210 | + void ExtractBigData(Object3D o) |
---|
| 211 | + { |
---|
| 212 | + if (o.bRep != null) |
---|
| 213 | + Grafreed.Assert(o.bRep == this.bRep); |
---|
| 214 | + |
---|
| 215 | + o.bRep = this.bRep; |
---|
| 216 | +// July 2019 if (this.bRep != null) |
---|
| 217 | +// { |
---|
| 218 | +// o.transientrep = this.bRep.support; |
---|
| 219 | +// o.bRep.support = null; |
---|
| 220 | +// } |
---|
| 221 | + o.selection = this.selection; |
---|
| 222 | + |
---|
| 223 | + if (this.support != null) |
---|
| 224 | + { |
---|
| 225 | + if (o.transientrep != null) |
---|
| 226 | + Grafreed.Assert(o.transientrep == this.support.bRep); |
---|
| 227 | + |
---|
| 228 | + o.transientrep = this.support.bRep; |
---|
| 229 | + this.support.bRep = null; |
---|
| 230 | + } |
---|
| 231 | + |
---|
| 232 | + // o.support = this.support; |
---|
| 233 | + // o.fileparent = this.fileparent; |
---|
| 234 | + // if (this.bRep != null) |
---|
| 235 | + // o.bRep = this.bRep.support; |
---|
| 236 | + |
---|
| 237 | + this.bRep = null; |
---|
| 238 | + // if (this.bRep != null) |
---|
| 239 | + // this.bRep.support = null; |
---|
| 240 | + // this.support = null; |
---|
| 241 | + // this.fileparent = null; |
---|
| 242 | + } |
---|
| 243 | + |
---|
| 244 | + void RestoreBigData(java.util.Hashtable<java.util.UUID, Object3D> hashtable) |
---|
| 245 | + { |
---|
| 246 | + if (!hashtable.containsKey(GetUUID())) |
---|
| 247 | + return; |
---|
| 248 | + |
---|
| 249 | + Object3D o = hashtable.get(GetUUID()); |
---|
| 250 | + |
---|
| 251 | + RestoreBigData(o); |
---|
| 252 | + |
---|
| 253 | + if (blockloop) |
---|
| 254 | + return; |
---|
| 255 | + |
---|
130 | 256 | blockloop = true; |
---|
131 | | - child.SaveSupports(); |
---|
| 257 | + |
---|
| 258 | + //hashtable.remove(GetUUID()); |
---|
| 259 | + |
---|
| 260 | + for (int i=0; i<Size(); i++) |
---|
| 261 | + { |
---|
| 262 | + get(i).RestoreBigData(hashtable); |
---|
| 263 | + } |
---|
| 264 | + |
---|
132 | 265 | blockloop = false; |
---|
133 | 266 | } |
---|
134 | | -} |
---|
135 | 267 | |
---|
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) |
---|
| 268 | + void RestoreBigData(Object3D o) |
---|
147 | 269 | { |
---|
148 | | - bRep.RestoreSupports(); |
---|
| 270 | + this.bRep = o.bRep; |
---|
| 271 | + if (this.support != null && o.transientrep != null) |
---|
| 272 | + { |
---|
| 273 | + this.support.bRep = o.transientrep; |
---|
| 274 | + } |
---|
| 275 | + |
---|
| 276 | + this.selection = o.selection; |
---|
| 277 | +// July 2019 if (this.bRep != null) |
---|
| 278 | +// this.bRep.support = o.transientrep; |
---|
| 279 | + // this.support = o.support; |
---|
| 280 | + // this.fileparent = o.fileparent; |
---|
149 | 281 | } |
---|
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 | 282 | |
---|
162 | 283 | // MOCAP SUPPORT |
---|
163 | 284 | double tx,ty,tz,rx,ry,rz; |
---|
.. | .. |
---|
300 | 421 | } |
---|
301 | 422 | |
---|
302 | 423 | boolean live = false; |
---|
| 424 | + boolean dontselect = false; |
---|
303 | 425 | boolean hide = false; |
---|
304 | 426 | boolean link2master = false; // performs reset support/master at each frame |
---|
305 | 427 | boolean marked = false; // animation node |
---|
.. | .. |
---|
481 | 603 | toParent = LA.newMatrix(); |
---|
482 | 604 | fromParent = LA.newMatrix(); |
---|
483 | 605 | } |
---|
| 606 | + |
---|
484 | 607 | if (toParentMarked == null) |
---|
485 | 608 | { |
---|
486 | 609 | if (maxcount != 1) |
---|
487 | 610 | { |
---|
488 | 611 | new Exception().printStackTrace(); |
---|
489 | 612 | } |
---|
| 613 | + |
---|
490 | 614 | toParentMarked = LA.newMatrix(); |
---|
491 | 615 | fromParentMarked = LA.newMatrix(); |
---|
492 | 616 | } |
---|
.. | .. |
---|
774 | 898 | if (step == 0) |
---|
775 | 899 | step = 1; |
---|
776 | 900 | if (maxcount == 0) |
---|
777 | | - maxcount = 2048; // 4; |
---|
| 901 | + maxcount = 128; // 2048; // 4; |
---|
778 | 902 | // if (acceleration == 0) |
---|
779 | 903 | // acceleration = 10; |
---|
780 | 904 | if (delay == 0) // serial |
---|
.. | .. |
---|
797 | 921 | |
---|
798 | 922 | if (marked && Globals.isLIVE() && live && |
---|
799 | 923 | //TEMP21aug2018 |
---|
800 | | - (Globals.DrawMode() == iCameraPane.SHADOW || !Globals.RENDERSHADOW) && |
---|
| 924 | + (Globals.DrawMode() == iCameraPane.SHADOW || !Globals.RENDERSHADOW || !Globals.COMPUTESHADOWWHENLIVE) && |
---|
801 | 925 | currentframe != Globals.framecount) |
---|
802 | 926 | { |
---|
803 | 927 | currentframe = Globals.framecount; |
---|
.. | .. |
---|
809 | 933 | |
---|
810 | 934 | boolean changedir = random && Math.random() < 0.01; // && !link2master; |
---|
811 | 935 | |
---|
812 | | - if (transformcount*factor > maxcount || (step == 1 && changedir)) |
---|
| 936 | + if (transformcount*factor >= maxcount && (rewind || random) || |
---|
| 937 | + (step == 1 && changedir)) |
---|
813 | 938 | { |
---|
814 | 939 | countdown = 1; |
---|
815 | 940 | delay = speedup?8:1; |
---|
.. | .. |
---|
881 | 1006 | if (material == null || material.multiply) |
---|
882 | 1007 | return true; |
---|
883 | 1008 | |
---|
| 1009 | + // Transparent objects are dynamic because we have to sort the triangles. |
---|
884 | 1010 | return material.opacity > 0.99; |
---|
885 | 1011 | } |
---|
886 | 1012 | |
---|
.. | .. |
---|
1281 | 1407 | toParent = LA.newMatrix(); |
---|
1282 | 1408 | fromParent = LA.newMatrix(); |
---|
1283 | 1409 | } |
---|
| 1410 | + |
---|
1284 | 1411 | LA.matCopy(other.toParent, toParent); |
---|
1285 | 1412 | LA.matCopy(other.fromParent, fromParent); |
---|
1286 | 1413 | |
---|
.. | .. |
---|
1834 | 1961 | if (obj.name == null) |
---|
1835 | 1962 | continue; // can't be a null one |
---|
1836 | 1963 | |
---|
| 1964 | + // Try perfect match first. |
---|
1837 | 1965 | if (n.equals(obj.name)) |
---|
1838 | 1966 | { |
---|
1839 | 1967 | theobj = obj; |
---|
1840 | 1968 | count++; |
---|
1841 | 1969 | } |
---|
1842 | 1970 | } |
---|
| 1971 | + |
---|
| 1972 | + // not needed: n = n.split(":")[0]; // Poser generates a count |
---|
1843 | 1973 | |
---|
1844 | 1974 | if (count != 1) |
---|
1845 | 1975 | for (int i=Size(); --i>=0;) |
---|
.. | .. |
---|
2299 | 2429 | } |
---|
2300 | 2430 | */ |
---|
2301 | 2431 | } |
---|
| 2432 | + else |
---|
| 2433 | + { |
---|
| 2434 | + //((ObjEditor)editWindow).SetupUI2(null); |
---|
| 2435 | + } |
---|
2302 | 2436 | } |
---|
2303 | 2437 | |
---|
2304 | 2438 | void createEditWindow(GroupEditor callee, boolean newWindow) //, boolean root) |
---|
.. | .. |
---|
2340 | 2474 | { |
---|
2341 | 2475 | editWindow.refreshContents(); |
---|
2342 | 2476 | } |
---|
| 2477 | + else |
---|
| 2478 | + { |
---|
| 2479 | + if (manipWindow != null) |
---|
| 2480 | + { |
---|
| 2481 | + manipWindow.refreshContents(); |
---|
| 2482 | + } |
---|
| 2483 | + } |
---|
| 2484 | + |
---|
2343 | 2485 | //if (parent != null) |
---|
2344 | 2486 | //parent.refreshEditWindow(); |
---|
2345 | 2487 | } |
---|
.. | .. |
---|
2624 | 2766 | //Touch(); |
---|
2625 | 2767 | } |
---|
2626 | 2768 | |
---|
| 2769 | + void GenNormalsMeshS() |
---|
| 2770 | + { |
---|
| 2771 | + selection.GenNormalsMesh(); |
---|
| 2772 | +// for (int i=0; i<selection.size(); i++) |
---|
| 2773 | +// { |
---|
| 2774 | +// Object3D selectee = (Object3D) selection.elementAt(i); |
---|
| 2775 | +// selectee.GenNormals(crease); |
---|
| 2776 | +// } |
---|
| 2777 | + |
---|
| 2778 | + //Touch(); |
---|
| 2779 | + } |
---|
| 2780 | + |
---|
2627 | 2781 | void ClearColorsS() |
---|
2628 | 2782 | { |
---|
2629 | 2783 | selection.ClearColors(); |
---|
.. | .. |
---|
2755 | 2909 | if (child == null) |
---|
2756 | 2910 | continue; |
---|
2757 | 2911 | child.GenNormals(crease); |
---|
| 2912 | +// Children().release(i); |
---|
| 2913 | + } |
---|
| 2914 | + blockloop = false; |
---|
| 2915 | + } |
---|
| 2916 | + |
---|
| 2917 | + void GenNormalsMesh() |
---|
| 2918 | + { |
---|
| 2919 | + if (blockloop) |
---|
| 2920 | + return; |
---|
| 2921 | + |
---|
| 2922 | + blockloop = true; |
---|
| 2923 | + GenNormalsMesh0(); |
---|
| 2924 | + for (int i = 0; i < Children().Size(); i++) |
---|
| 2925 | + { |
---|
| 2926 | + Object3D child = (Object3D) Children().get(i); // reserve(i); |
---|
| 2927 | + if (child == null) |
---|
| 2928 | + continue; |
---|
| 2929 | + child.GenNormalsMesh(); |
---|
2758 | 2930 | // Children().release(i); |
---|
2759 | 2931 | } |
---|
2760 | 2932 | blockloop = false; |
---|
.. | .. |
---|
2927 | 3099 | } |
---|
2928 | 3100 | } |
---|
2929 | 3101 | |
---|
| 3102 | + void GenNormalsMesh0() |
---|
| 3103 | + { |
---|
| 3104 | + if (bRep != null) |
---|
| 3105 | + { |
---|
| 3106 | + bRep.GenerateNormalsMesh(); |
---|
| 3107 | + Touch(); |
---|
| 3108 | + } |
---|
| 3109 | + } |
---|
| 3110 | + |
---|
2930 | 3111 | void GenNormalsMINE0() |
---|
2931 | 3112 | { |
---|
2932 | 3113 | if (bRep != null) |
---|
.. | .. |
---|
3002 | 3183 | v.fromParent = LA.newMatrix(); |
---|
3003 | 3184 | } |
---|
3004 | 3185 | |
---|
3005 | | - LA.matConcat(v.toParent, toParent, v.toParent); |
---|
3006 | | - LA.matConcat(fromParent, v.fromParent, v.fromParent); |
---|
| 3186 | +// LA.matConcat(v.toParent, toParent, v.toParent); |
---|
| 3187 | +// LA.matConcat(fromParent, v.fromParent, v.fromParent); |
---|
| 3188 | + LA.matConcat(toParent, v.toParent, v.toParent); |
---|
| 3189 | + LA.matConcat(v.fromParent, fromParent, v.fromParent); |
---|
3007 | 3190 | } |
---|
3008 | 3191 | |
---|
3009 | 3192 | toParent = null; // LA.matIdentity(toParent); |
---|
.. | .. |
---|
3236 | 3419 | bRep.support = null; |
---|
3237 | 3420 | BoundaryRep temprep = (BoundaryRep) Grafreed.clone(bRep); |
---|
3238 | 3421 | // bRep.SplitInTwo(onlyone); // thread... |
---|
3239 | | - temprep.SplitInTwo(reduction34, onlyone); |
---|
| 3422 | + |
---|
| 3423 | + while(temprep.SplitInTwo(reduction34, onlyone)); |
---|
| 3424 | + |
---|
3240 | 3425 | bRep = temprep; |
---|
3241 | 3426 | bRep.support = sup; |
---|
3242 | 3427 | Touch(); |
---|
.. | .. |
---|
3373 | 3558 | if (blockloop) |
---|
3374 | 3559 | return; |
---|
3375 | 3560 | |
---|
3376 | | - if (marked || (bRep != null && material != null)) // borderline... |
---|
| 3561 | + if (//marked || // does not make sense |
---|
| 3562 | + (bRep != null || material != null)) // borderline... |
---|
3377 | 3563 | live = h; |
---|
3378 | 3564 | |
---|
3379 | 3565 | for (int i = 0; i < Size(); i++) |
---|
.. | .. |
---|
3394 | 3580 | return; |
---|
3395 | 3581 | |
---|
3396 | 3582 | //if (bRep != null) |
---|
3397 | | - if (marked || (bRep != null && material != null)) // borderline... |
---|
| 3583 | + if (//marked || // does not make sense |
---|
| 3584 | + (bRep != null || material != null)) // borderline... |
---|
3398 | 3585 | link2master = h; |
---|
3399 | 3586 | |
---|
3400 | 3587 | for (int i = 0; i < Size(); i++) |
---|
.. | .. |
---|
3414 | 3601 | if (blockloop) |
---|
3415 | 3602 | return; |
---|
3416 | 3603 | |
---|
3417 | | - if (marked || (bRep != null && material != null)) // borderline... |
---|
| 3604 | + if (//marked || // does not make sense |
---|
| 3605 | + (bRep != null || material != null)) // borderline... |
---|
3418 | 3606 | hide = h; |
---|
3419 | 3607 | |
---|
3420 | 3608 | for (int i = 0; i < Size(); i++) |
---|
.. | .. |
---|
3434 | 3622 | if (blockloop) |
---|
3435 | 3623 | return; |
---|
3436 | 3624 | |
---|
3437 | | - if (bRep != null && material != null) // borderline... |
---|
| 3625 | + if (bRep != null || material != null) // borderline... |
---|
3438 | 3626 | marked = h; |
---|
3439 | 3627 | |
---|
3440 | 3628 | for (int i = 0; i < Size(); i++) |
---|
.. | .. |
---|
3444 | 3632 | continue; |
---|
3445 | 3633 | blockloop = true; |
---|
3446 | 3634 | child.MarkLeaves(h); |
---|
| 3635 | + blockloop = false; |
---|
| 3636 | + // release(i); |
---|
| 3637 | + } |
---|
| 3638 | + } |
---|
| 3639 | + |
---|
| 3640 | + void RewindLeaves(boolean h) |
---|
| 3641 | + { |
---|
| 3642 | + if (blockloop) |
---|
| 3643 | + return; |
---|
| 3644 | + |
---|
| 3645 | + if (bRep != null || material != null) // borderline... |
---|
| 3646 | + rewind = h; |
---|
| 3647 | + |
---|
| 3648 | + for (int i = 0; i < Size(); i++) |
---|
| 3649 | + { |
---|
| 3650 | + Object3D child = (Object3D) get(i); // reserve(i); |
---|
| 3651 | + if (child == null) |
---|
| 3652 | + continue; |
---|
| 3653 | + blockloop = true; |
---|
| 3654 | + child.RewindLeaves(h); |
---|
| 3655 | + blockloop = false; |
---|
| 3656 | + // release(i); |
---|
| 3657 | + } |
---|
| 3658 | + } |
---|
| 3659 | + |
---|
| 3660 | + void RandomLeaves(boolean h) |
---|
| 3661 | + { |
---|
| 3662 | + if (blockloop) |
---|
| 3663 | + return; |
---|
| 3664 | + |
---|
| 3665 | + if (bRep != null || material != null) // borderline... |
---|
| 3666 | + random = h; |
---|
| 3667 | + |
---|
| 3668 | + for (int i = 0; i < Size(); i++) |
---|
| 3669 | + { |
---|
| 3670 | + Object3D child = (Object3D) get(i); // reserve(i); |
---|
| 3671 | + if (child == null) |
---|
| 3672 | + continue; |
---|
| 3673 | + blockloop = true; |
---|
| 3674 | + child.RandomLeaves(h); |
---|
3447 | 3675 | blockloop = false; |
---|
3448 | 3676 | // release(i); |
---|
3449 | 3677 | } |
---|
.. | .. |
---|
4221 | 4449 | } |
---|
4222 | 4450 | } |
---|
4223 | 4451 | |
---|
| 4452 | + void RepairSOV() |
---|
| 4453 | + { |
---|
| 4454 | + if (blockloop) |
---|
| 4455 | + return; |
---|
| 4456 | + |
---|
| 4457 | + String texname = this.GetPigmentTexture(); |
---|
| 4458 | + |
---|
| 4459 | + if (texname.startsWith("sov")) |
---|
| 4460 | + { |
---|
| 4461 | + String[] s = texname.split("/"); |
---|
| 4462 | + |
---|
| 4463 | + String[] sname = s[1].split("Color.pn"); |
---|
| 4464 | + |
---|
| 4465 | + texname = sname[0]; |
---|
| 4466 | + |
---|
| 4467 | + if (sname.length > 1) |
---|
| 4468 | + { |
---|
| 4469 | + texname += "Color.jpg"; |
---|
| 4470 | + } |
---|
| 4471 | + |
---|
| 4472 | + this.SetPigmentTexture("sov/" + texname); |
---|
| 4473 | + } |
---|
| 4474 | + |
---|
| 4475 | + texname = this.GetBumpTexture(); |
---|
| 4476 | + |
---|
| 4477 | + if (texname.startsWith("sov")) |
---|
| 4478 | + { |
---|
| 4479 | + String[] s = texname.split("/"); |
---|
| 4480 | + |
---|
| 4481 | + String[] sname = s[1].split("Bump.pn"); |
---|
| 4482 | + |
---|
| 4483 | + texname = sname[0]; |
---|
| 4484 | + |
---|
| 4485 | + if (sname.length > 1) |
---|
| 4486 | + { |
---|
| 4487 | + texname += "Bump.jpg"; |
---|
| 4488 | + } |
---|
| 4489 | + |
---|
| 4490 | + this.SetBumpTexture("sov/" + texname); |
---|
| 4491 | + } |
---|
| 4492 | + |
---|
| 4493 | + for (int i=0; i<Size(); i++) |
---|
| 4494 | + { |
---|
| 4495 | + blockloop = true; |
---|
| 4496 | + get(i).RepairSOV(); |
---|
| 4497 | + blockloop = false; |
---|
| 4498 | + } |
---|
| 4499 | + } |
---|
| 4500 | + |
---|
4224 | 4501 | void RepairTexture() |
---|
4225 | 4502 | { |
---|
4226 | 4503 | if (this instanceof FileObject || blockloop) |
---|
.. | .. |
---|
4711 | 4988 | |
---|
4712 | 4989 | cTreePath SelectLeaf(int indexcount, boolean deselect) |
---|
4713 | 4990 | { |
---|
4714 | | - if (hide) |
---|
| 4991 | + if (hide || dontselect) |
---|
4715 | 4992 | return null; |
---|
4716 | 4993 | |
---|
4717 | 4994 | if (count <= 0) |
---|
.. | .. |
---|
4735 | 5012 | } |
---|
4736 | 5013 | } |
---|
4737 | 5014 | |
---|
| 5015 | + ObjEditor GetWindow() |
---|
| 5016 | + { |
---|
| 5017 | + if (editWindow != null) |
---|
| 5018 | + return editWindow; |
---|
| 5019 | + |
---|
| 5020 | + return manipWindow; |
---|
| 5021 | + } |
---|
| 5022 | + |
---|
4738 | 5023 | cTreePath Select(int indexcount, boolean deselect) |
---|
4739 | 5024 | { |
---|
4740 | | - if (hide) |
---|
| 5025 | + if (hide || dontselect) |
---|
4741 | 5026 | return null; |
---|
4742 | 5027 | |
---|
4743 | 5028 | if (count <= 0) |
---|
.. | .. |
---|
4771 | 5056 | if (leaf != null) |
---|
4772 | 5057 | { |
---|
4773 | 5058 | cTreePath tp = new cTreePath(this, leaf); |
---|
4774 | | - if (editWindow != null) |
---|
| 5059 | + ObjEditor window = GetWindow(); |
---|
| 5060 | + if (window != null) |
---|
4775 | 5061 | { |
---|
4776 | 5062 | //System.out.println("editWindow = " + editWindow + " vs " + this); |
---|
4777 | | - editWindow.Select(tp, deselect, true); |
---|
| 5063 | + window.Select(tp, deselect, true); |
---|
4778 | 5064 | } |
---|
4779 | 5065 | |
---|
4780 | 5066 | return tp; |
---|
.. | .. |
---|
4791 | 5077 | |
---|
4792 | 5078 | if (child == null) |
---|
4793 | 5079 | continue; |
---|
| 5080 | + |
---|
4794 | 5081 | if (child.HasTransparency() && child.size() != 0) |
---|
4795 | 5082 | { |
---|
4796 | 5083 | cTreePath leaf = child.Select(indexcount, deselect); |
---|
.. | .. |
---|
4800 | 5087 | if (leaf != null) |
---|
4801 | 5088 | { |
---|
4802 | 5089 | cTreePath tp = new cTreePath(this, leaf); |
---|
4803 | | - if (editWindow != null) |
---|
| 5090 | + ObjEditor window = GetWindow(); |
---|
| 5091 | + if (window != null) |
---|
4804 | 5092 | { |
---|
4805 | | - editWindow.Select(tp, deselect, true); |
---|
| 5093 | + window.Select(tp, deselect, true); |
---|
4806 | 5094 | } |
---|
4807 | 5095 | |
---|
4808 | 5096 | return tp; |
---|
.. | .. |
---|
5363 | 5651 | } |
---|
5364 | 5652 | } |
---|
5365 | 5653 | |
---|
| 5654 | + UUID GetUUID() |
---|
| 5655 | + { |
---|
| 5656 | + if (uuid == null) |
---|
| 5657 | + { |
---|
| 5658 | + // Serial |
---|
| 5659 | + uuid = UUID.randomUUID(); |
---|
| 5660 | + } |
---|
| 5661 | + |
---|
| 5662 | + return uuid; |
---|
| 5663 | + } |
---|
| 5664 | + |
---|
| 5665 | + Object3D GetObject(UUID uid) |
---|
| 5666 | + { |
---|
| 5667 | + if (blockloop) |
---|
| 5668 | + return null; |
---|
| 5669 | + |
---|
| 5670 | + if (GetUUID().equals(uid)) |
---|
| 5671 | + return this; |
---|
| 5672 | + |
---|
| 5673 | + int nb = Size(); |
---|
| 5674 | + for (int i = 0; i < nb; i++) |
---|
| 5675 | + { |
---|
| 5676 | + Object3D child = (Object3D) get(i); |
---|
| 5677 | + |
---|
| 5678 | + if (child == null) |
---|
| 5679 | + continue; |
---|
| 5680 | + |
---|
| 5681 | + blockloop = true; |
---|
| 5682 | + Object3D obj = child.GetObject(uid); |
---|
| 5683 | + blockloop = false; |
---|
| 5684 | + if (obj != null) |
---|
| 5685 | + return obj; |
---|
| 5686 | + } |
---|
| 5687 | + |
---|
| 5688 | + return null; |
---|
| 5689 | + } |
---|
| 5690 | + |
---|
5366 | 5691 | void SetBumpTexture(String tex) |
---|
5367 | 5692 | { |
---|
5368 | 5693 | if (GetTextures() == null) |
---|
.. | .. |
---|
5407 | 5732 | boolean NeedSupport() |
---|
5408 | 5733 | { |
---|
5409 | 5734 | return |
---|
5410 | | - CameraPane.SUPPORT && !CameraPane.movingcamera && link2master && /*live &&*/ support != null |
---|
| 5735 | + CameraPane.SUPPORT && (!CameraPane.movingcamera || (!Globals.FREEZEONMOVE && Globals.isLIVE())) && link2master && /*live &&*/ support != null |
---|
5411 | 5736 | // PROBLEM with CROWD!! |
---|
5412 | 5737 | && (Globals.DrawMode() == iCameraPane.SHADOW || !Globals.RENDERSHADOW || Globals.CROWD); |
---|
5413 | 5738 | } |
---|
5414 | 5739 | |
---|
5415 | 5740 | static boolean DEBUG_SELECTION = false; |
---|
| 5741 | + |
---|
| 5742 | + boolean IsLive() |
---|
| 5743 | + { |
---|
| 5744 | + if (live) |
---|
| 5745 | + return true; |
---|
| 5746 | + |
---|
| 5747 | + if (parent == null) |
---|
| 5748 | + return false; |
---|
| 5749 | + |
---|
| 5750 | + return parent.IsLive(); |
---|
| 5751 | + } |
---|
5416 | 5752 | |
---|
5417 | 5753 | void Draw(iCameraPane display, Object3D /*Composite*/ root, boolean selected, boolean blocked) |
---|
5418 | 5754 | { |
---|
.. | .. |
---|
5424 | 5760 | } |
---|
5425 | 5761 | |
---|
5426 | 5762 | if (display.DrawMode() == iCameraPane.SELECTION && |
---|
5427 | | - hide) |
---|
| 5763 | + (hide || dontselect)) |
---|
5428 | 5764 | return; |
---|
5429 | 5765 | |
---|
5430 | 5766 | if (name != null && name.contains("sclera")) |
---|
.. | .. |
---|
5475 | 5811 | support = support; |
---|
5476 | 5812 | |
---|
5477 | 5813 | //boolean usecalllists = IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null || !link2master); // !(this instanceof cSpring) && !(this instanceof BezierPatch); |
---|
5478 | | - boolean usecalllists = false; // IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null) && !link2master; // !(this instanceof cSpring) && !(this instanceof BezierPatch); |
---|
| 5814 | + boolean usecalllists = !IsLive(); // IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null) && !link2master; // !(this instanceof cSpring) && !(this instanceof BezierPatch); |
---|
5479 | 5815 | |
---|
5480 | 5816 | if (!usecalllists && bRep != null && bRep.displaylist > 0) |
---|
5481 | 5817 | { |
---|
.. | .. |
---|
5495 | 5831 | boolean selectmode = display.DrawMode() == display.SELECTION || display.IsDebugSelection(); |
---|
5496 | 5832 | |
---|
5497 | 5833 | if (!selectmode && //display.DrawMode() != display.SELECTION && |
---|
5498 | | - (touched || (bRep != null && bRep.displaylist <= 0))) |
---|
| 5834 | + //(touched || (bRep != null && bRep.displaylist <= 0))) |
---|
| 5835 | + (Globals.isLIVE() && Globals.COMPUTESHADOWWHENLIVE || touched && Globals.COMPUTESHADOWWHENLIVE)) // || (bRep != null && bRep.displaylist <= 0))) |
---|
5499 | 5836 | { |
---|
5500 | 5837 | Globals.lighttouched = true; |
---|
5501 | 5838 | } // all panes... |
---|
| 5839 | + |
---|
5502 | 5840 | //if (usecalllists && display.DrawMode() != display.SELECTION && display.DrawMode() != display.SHADOW && |
---|
5503 | 5841 | if (bRep != null && usecalllists && !selectmode && // june 2013 display.DrawMode() != display.SHADOW && |
---|
5504 | 5842 | (touched || (bRep != null && bRep.displaylist <= 0))) |
---|
.. | .. |
---|
5626 | 5964 | if (GetBRep() != null) |
---|
5627 | 5965 | { |
---|
5628 | 5966 | display.NextIndex(); |
---|
| 5967 | + |
---|
5629 | 5968 | // vertex color conflict : gl.glCallList(list); |
---|
5630 | 5969 | DrawNode(display, root, selected); |
---|
5631 | 5970 | if (this instanceof BezierPatch) |
---|
.. | .. |
---|
5666 | 6005 | tex = GetTextures(); |
---|
5667 | 6006 | } |
---|
5668 | 6007 | |
---|
5669 | | - display.BindTextures(tex, texres); |
---|
| 6008 | + boolean failedPigment = false; |
---|
| 6009 | + boolean failedBump = false; |
---|
| 6010 | + |
---|
| 6011 | + try |
---|
| 6012 | + { |
---|
| 6013 | + display.BindPigmentTexture(tex, texres); |
---|
| 6014 | + } |
---|
| 6015 | + catch (Exception e) |
---|
| 6016 | + { |
---|
| 6017 | + System.err.println("FAILED: " + this); |
---|
| 6018 | + failedPigment = true; |
---|
| 6019 | + } |
---|
| 6020 | + |
---|
| 6021 | + try |
---|
| 6022 | + { |
---|
| 6023 | + display.BindBumpTexture(tex, texres); |
---|
| 6024 | + } |
---|
| 6025 | + catch (Exception e) |
---|
| 6026 | + { |
---|
| 6027 | + //System.err.println("FAILED: " + this); |
---|
| 6028 | + failedBump = true; |
---|
| 6029 | + } |
---|
5670 | 6030 | |
---|
5671 | 6031 | if (!compiled) |
---|
5672 | 6032 | { |
---|
.. | .. |
---|
5688 | 6048 | } |
---|
5689 | 6049 | } |
---|
5690 | 6050 | |
---|
5691 | | - display.ReleaseTextures(tex); |
---|
| 6051 | + if (!failedBump) |
---|
| 6052 | + display.ReleaseBumpTexture(tex); |
---|
| 6053 | + |
---|
| 6054 | + if (!failedPigment) |
---|
| 6055 | + display.ReleasePigmentTexture(tex); |
---|
5692 | 6056 | |
---|
5693 | 6057 | display.PopMaterial(this, selected); |
---|
5694 | 6058 | } |
---|
.. | .. |
---|
5817 | 6181 | |
---|
5818 | 6182 | void drawSelf(iCameraPane display, Object3D /*Composite*/ root, boolean selected, boolean blocked) |
---|
5819 | 6183 | { |
---|
| 6184 | + if (display.DrawMode() == iCameraPane.SELECTION && dontselect) |
---|
| 6185 | + return; |
---|
| 6186 | + |
---|
5820 | 6187 | if (hide) |
---|
5821 | 6188 | return; |
---|
5822 | 6189 | // shadow optimisation |
---|
.. | .. |
---|
5942 | 6309 | if (display.DrawMode() == display.SHADOW && projectedVertices != null && projectedVertices.length > 2 && projectedVertices[2].y >= 10000) |
---|
5943 | 6310 | return; // no shadow for transparent objects |
---|
5944 | 6311 | |
---|
| 6312 | + if (display.DrawMode() == iCameraPane.SELECTION && dontselect) |
---|
| 6313 | + return; |
---|
| 6314 | + |
---|
5945 | 6315 | if (hide) |
---|
5946 | 6316 | return; |
---|
5947 | 6317 | |
---|
.. | .. |
---|
6055 | 6425 | // dec 2012 |
---|
6056 | 6426 | new Exception().printStackTrace(); |
---|
6057 | 6427 | return; |
---|
| 6428 | + } |
---|
| 6429 | + |
---|
| 6430 | + if (dontselect) |
---|
| 6431 | + { |
---|
| 6432 | + //bRep.GenerateNormalsMINE(); |
---|
6058 | 6433 | } |
---|
6059 | 6434 | |
---|
6060 | 6435 | display.DrawGeometry(bRep, flipV, selectmode); |
---|
.. | .. |
---|
6907 | 7282 | spot.translate(32, 32); |
---|
6908 | 7283 | spotw = spot.x + spot.width; |
---|
6909 | 7284 | spoth = spot.y + spot.height; |
---|
6910 | | - info.g.setColor(Color.blue); |
---|
| 7285 | + info.g.setColor(Color.cyan); |
---|
6911 | 7286 | info.g.fillRect(spot.x, spot.y, spot.width, spot.height); |
---|
6912 | 7287 | // if (CameraPane.Xmin > spot.x) |
---|
6913 | 7288 | // { |
---|
.. | .. |
---|
6925 | 7300 | // { |
---|
6926 | 7301 | // CameraPane.Ymax = spoth; |
---|
6927 | 7302 | // } |
---|
6928 | | - info.g.drawLine(spotw, spoth, spotw, spoth - 15); |
---|
6929 | | - info.g.drawLine(spotw, spoth, spotw - 15, spoth); |
---|
| 7303 | + // bonhommes info.g.drawLine(spotw, spoth, spotw, spoth - boundary.height/2); // 15 |
---|
| 7304 | + //info.g.drawLine(spotw, spoth, spotw - boundary.width/2, spoth); // 15 |
---|
6930 | 7305 | spot.translate(0, -32); |
---|
6931 | | - info.g.setColor(Color.green); |
---|
| 7306 | + info.g.setColor(Color.yellow); |
---|
6932 | 7307 | info.g.fillRect(spot.x, spot.y, spot.width, spot.height); |
---|
| 7308 | + info.g.setColor(Color.green); |
---|
6933 | 7309 | // if (CameraPane.Xmin > spot.x) |
---|
6934 | 7310 | // { |
---|
6935 | 7311 | // CameraPane.Xmin = spot.x; |
---|
.. | .. |
---|
6946 | 7322 | // { |
---|
6947 | 7323 | // CameraPane.Ymax = spoth; |
---|
6948 | 7324 | // } |
---|
6949 | | - info.g.drawArc(boundary.x, boundary.y, |
---|
6950 | | - boundary.width, boundary.height, 0, 360); |
---|
| 7325 | + info.g.drawArc(boundary.x + info.DX, boundary.y + info.DY, |
---|
| 7326 | + (int)(boundary.width * info.W), (int)(boundary.height * info.W), 0, 360); |
---|
6951 | 7327 | //info.g.drawArc(spot.x, spotw, spot.width/2, boundary.height/2, 0, 360); |
---|
6952 | 7328 | // if (CameraPane.Xmin > boundary.x) |
---|
6953 | 7329 | // { |
---|
.. | .. |
---|
6981 | 7357 | startX = info.x; |
---|
6982 | 7358 | startY = info.y; |
---|
6983 | 7359 | |
---|
6984 | | - hitSomething = 0; |
---|
| 7360 | + hitSomething = -1; |
---|
6985 | 7361 | cVector origin = new cVector(); |
---|
6986 | 7362 | //LA.xformPos(origin, toParent, origin); |
---|
6987 | 7363 | Rectangle spot = new Rectangle(); |
---|
.. | .. |
---|
7057 | 7433 | //System.out.println("hitSomething = " + hitSomething); |
---|
7058 | 7434 | |
---|
7059 | 7435 | double scale = 0.005f * info.camera.Distance(); |
---|
| 7436 | + |
---|
7060 | 7437 | cVector xlate = new cVector(); |
---|
7061 | 7438 | //cVector xlate2 = new cVector(); |
---|
7062 | 7439 | switch (hitSomething) |
---|
.. | .. |
---|
7205 | 7582 | |
---|
7206 | 7583 | case hitScale: // scale |
---|
7207 | 7584 | double hScale = (double) (info.x - centerPt.x) / 32; |
---|
| 7585 | + double sign = 1; |
---|
| 7586 | + if (hScale < 0) |
---|
| 7587 | + { |
---|
| 7588 | + sign = -1; |
---|
| 7589 | + } |
---|
| 7590 | + hScale = sign*Math.pow(sign*hScale, scale * 50); |
---|
7208 | 7591 | if (hScale < 0.01) |
---|
7209 | 7592 | { |
---|
7210 | | - hScale = 0.01; |
---|
| 7593 | + //hScale = 0.01; |
---|
7211 | 7594 | } |
---|
7212 | | - hScale = Math.pow(hScale, scale * 50); |
---|
7213 | | - if (hScale < 0.01) |
---|
7214 | | - { |
---|
7215 | | - hScale = 0.01; |
---|
7216 | | - } |
---|
| 7595 | + |
---|
7217 | 7596 | double vScale = (double) (info.y - centerPt.y) / 32; |
---|
7218 | | - if (vScale < 0.01) |
---|
| 7597 | + sign = 1; |
---|
| 7598 | + if (vScale < 0) |
---|
7219 | 7599 | { |
---|
7220 | | - vScale = 0.01; |
---|
| 7600 | + sign = -1; |
---|
7221 | 7601 | } |
---|
7222 | | - vScale = Math.pow(vScale, scale * 50); |
---|
| 7602 | + vScale = sign*Math.pow(sign*vScale, scale * 50); |
---|
7223 | 7603 | if (vScale < 0.01) |
---|
7224 | 7604 | { |
---|
7225 | | - vScale = 0.01; |
---|
| 7605 | + //vScale = 0.01; |
---|
7226 | 7606 | } |
---|
7227 | 7607 | LA.matCopy(startMat, toParent); |
---|
7228 | 7608 | /**/ |
---|
.. | .. |
---|
7233 | 7613 | } |
---|
7234 | 7614 | /**/ |
---|
7235 | 7615 | |
---|
| 7616 | + double totalScale = Math.sqrt(hScale*hScale + vScale*vScale) / Math.sqrt(2); |
---|
| 7617 | + |
---|
| 7618 | + if (totalScale < 0.01) |
---|
| 7619 | + { |
---|
| 7620 | + totalScale = 0.01; |
---|
| 7621 | + } |
---|
| 7622 | + |
---|
7236 | 7623 | switch (info.pane.RenderCamera().viewCode) |
---|
7237 | 7624 | { |
---|
7238 | 7625 | case 3: // '\001' |
---|
7239 | | - if (modified) |
---|
| 7626 | + if (modified || opposite) |
---|
7240 | 7627 | { |
---|
7241 | 7628 | //LA.matScale(toParent, 1, hScale, vScale); |
---|
7242 | | - LA.matScale(toParent, vScale, 1, 1); |
---|
| 7629 | + LA.matScale(toParent, totalScale, 1, 1); |
---|
7243 | 7630 | } // vScale, 1); |
---|
7244 | 7631 | else |
---|
7245 | 7632 | { |
---|
7246 | | - LA.matScale(toParent, vScale, vScale, vScale); |
---|
| 7633 | + // EXCEPTION! |
---|
| 7634 | + LA.matScale(toParent, totalScale, totalScale, totalScale); |
---|
7247 | 7635 | } // vScale, 1); |
---|
7248 | 7636 | break; |
---|
7249 | 7637 | |
---|
7250 | 7638 | case 2: // '\002' |
---|
7251 | | - if (modified) |
---|
| 7639 | + if (modified || opposite) |
---|
7252 | 7640 | { |
---|
7253 | 7641 | //LA.matScale(toParent, hScale, 1, vScale); |
---|
7254 | | - LA.matScale(toParent, 1, vScale, 1); |
---|
| 7642 | + LA.matScale(toParent, 1, totalScale, 1); |
---|
7255 | 7643 | } else |
---|
7256 | 7644 | { |
---|
7257 | | - LA.matScale(toParent, vScale, 1, vScale); |
---|
| 7645 | + LA.matScale(toParent, totalScale, 1, totalScale); |
---|
7258 | 7646 | } |
---|
7259 | 7647 | break; |
---|
7260 | 7648 | |
---|
7261 | 7649 | case 1: // '\003' |
---|
7262 | | - if (modified) |
---|
| 7650 | + if (modified || opposite) |
---|
7263 | 7651 | { |
---|
7264 | 7652 | //LA.matScale(toParent, hScale, vScale, 1); |
---|
7265 | | - LA.matScale(toParent, 1, 1, vScale); |
---|
| 7653 | + LA.matScale(toParent, 1, 1, totalScale); |
---|
7266 | 7654 | } else |
---|
7267 | 7655 | { |
---|
7268 | | - LA.matScale(toParent, vScale, vScale, 1); |
---|
| 7656 | + LA.matScale(toParent, totalScale, totalScale, 1); |
---|
7269 | 7657 | } |
---|
7270 | 7658 | break; |
---|
7271 | 7659 | } |
---|
.. | .. |
---|
7406 | 7794 | objname = name + " " + System.identityHashCode(this) + " (" + parent.name + " " + System.identityHashCode(parent) + ")"; |
---|
7407 | 7795 | } else |
---|
7408 | 7796 | { |
---|
7409 | | - objname = GetName() + (Math.abs(count) == 1000 ? (count == 1000 ? " " : " * ") : (" (" + (count /*- 1*/) + ")")) + /*(IsSelected()?"(selected) ":"") + (touched?"(touched) ":"") */ ""; |
---|
| 7797 | + objname = GetName() + (Math.abs(count) == 1000 ? (count == 1000 ? " " : " * ") : (" (" + (count - 1) + ")")) + /*(IsSelected()?"(selected) ":"") + (touched?"(touched) ":"") */ ""; |
---|
7410 | 7798 | } // + super.toString(); |
---|
7411 | 7799 | //return name + " (" + (SizeOf.deepSizeOf(this)/1024) + "K) " + this.getClass().getName(); |
---|
7412 | 7800 | |
---|
.. | .. |
---|
7479 | 7867 | editWindow = null; |
---|
7480 | 7868 | } // ? |
---|
7481 | 7869 | } |
---|
| 7870 | + else |
---|
| 7871 | + { |
---|
| 7872 | + //editWindow.closeUI(); |
---|
| 7873 | + } |
---|
7482 | 7874 | } |
---|
7483 | 7875 | |
---|
7484 | 7876 | boolean root; // patch for edit windows |
---|
.. | .. |
---|
7490 | 7882 | /*transient*/ cVector2[] projectedVertices = new cVector2[0]; |
---|
7491 | 7883 | |
---|
7492 | 7884 | Object3D /*Composite*/ parent; |
---|
7493 | | - Object3D /*Composite*/ fileparent; |
---|
| 7885 | + Object3D /*Composite*/ fileparent; // In the case of FileObject |
---|
7494 | 7886 | |
---|
7495 | 7887 | double[][] toParent; // dynamic matrix |
---|
7496 | 7888 | double[][] fromParent; |
---|
.. | .. |
---|
7636 | 8028 | } |
---|
7637 | 8029 | |
---|
7638 | 8030 | transient ObjEditor editWindow; |
---|
| 8031 | + transient ObjEditor manipWindow; |
---|
| 8032 | + |
---|
| 8033 | + transient boolean pinned; |
---|
| 8034 | + |
---|
7639 | 8035 | transient ObjectUI objectUI; |
---|
7640 | 8036 | public static int povDepth = 0; |
---|
7641 | 8037 | private static cVector tbMin = new cVector(); |
---|
.. | .. |
---|
7654 | 8050 | private static cVector edge2 = new cVector(); |
---|
7655 | 8051 | //private static cVector norm = new cVector(); |
---|
7656 | 8052 | /*transient private*/ int hitSomething; |
---|
7657 | | - private static final int hitCenter = 1; |
---|
7658 | | - private static final int hitScale = 2; |
---|
7659 | | - private static final int hitRotate = 3; |
---|
| 8053 | + static final int hitCenter = 1; |
---|
| 8054 | + static final int hitScale = 2; |
---|
| 8055 | + static final int hitRotate = 3; |
---|
7660 | 8056 | /*transient*/ /*private*/ int viewCode; // Now used for transparency cache flag |
---|
7661 | 8057 | /*transient*/ private Point centerPt; |
---|
7662 | 8058 | /*transient*/ private int startX; |
---|