.. | .. |
---|
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[]; |
---|
| 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 | + o.versions = this.versions; |
---|
| 223 | + o.versionindex = this.versionindex; |
---|
| 224 | + |
---|
| 225 | + if (this.support != null) |
---|
| 226 | + { |
---|
| 227 | + if (o.transientrep != null) |
---|
| 228 | + Grafreed.Assert(o.transientrep == this.support.bRep); |
---|
| 229 | + |
---|
| 230 | + o.transientrep = this.support.bRep; |
---|
| 231 | + this.support.bRep = null; |
---|
| 232 | + } |
---|
| 233 | + |
---|
| 234 | + // o.support = this.support; |
---|
| 235 | + // o.fileparent = this.fileparent; |
---|
| 236 | + // if (this.bRep != null) |
---|
| 237 | + // o.bRep = this.bRep.support; |
---|
| 238 | + |
---|
| 239 | + this.bRep = null; |
---|
| 240 | + // if (this.bRep != null) |
---|
| 241 | + // this.bRep.support = null; |
---|
| 242 | + // this.support = null; |
---|
| 243 | + // this.fileparent = null; |
---|
| 244 | + } |
---|
| 245 | + |
---|
| 246 | + void RestoreBigData(java.util.Hashtable<java.util.UUID, Object3D> hashtable) |
---|
| 247 | + { |
---|
| 248 | + if (!hashtable.containsKey(GetUUID())) |
---|
| 249 | + return; |
---|
| 250 | + |
---|
| 251 | + Object3D o = hashtable.get(GetUUID()); |
---|
| 252 | + |
---|
| 253 | + RestoreBigData(o); |
---|
| 254 | + |
---|
| 255 | + if (blockloop) |
---|
| 256 | + return; |
---|
| 257 | + |
---|
130 | 258 | blockloop = true; |
---|
131 | | - child.SaveSupports(); |
---|
| 259 | + |
---|
| 260 | + //hashtable.remove(GetUUID()); |
---|
| 261 | + |
---|
| 262 | + for (int i=0; i<Size(); i++) |
---|
| 263 | + { |
---|
| 264 | + get(i).RestoreBigData(hashtable); |
---|
| 265 | + } |
---|
| 266 | + |
---|
132 | 267 | blockloop = false; |
---|
133 | 268 | } |
---|
134 | | -} |
---|
135 | 269 | |
---|
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) |
---|
| 270 | + void RestoreBigData(Object3D o) |
---|
147 | 271 | { |
---|
148 | | - bRep.RestoreSupports(); |
---|
| 272 | + this.bRep = o.bRep; |
---|
| 273 | + if (this.support != null && o.transientrep != null) |
---|
| 274 | + { |
---|
| 275 | + this.support.bRep = o.transientrep; |
---|
| 276 | + } |
---|
| 277 | + |
---|
| 278 | + this.selection = o.selection; |
---|
| 279 | + |
---|
| 280 | + this.versions = o.versions; |
---|
| 281 | + this.versionindex = o.versionindex; |
---|
| 282 | +// July 2019 if (this.bRep != null) |
---|
| 283 | +// this.bRep.support = o.transientrep; |
---|
| 284 | + // this.support = o.support; |
---|
| 285 | + // this.fileparent = o.fileparent; |
---|
149 | 286 | } |
---|
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 | 287 | |
---|
162 | 288 | // MOCAP SUPPORT |
---|
163 | 289 | double tx,ty,tz,rx,ry,rz; |
---|
.. | .. |
---|
300 | 426 | } |
---|
301 | 427 | |
---|
302 | 428 | boolean live = false; |
---|
| 429 | + transient boolean keepdontselect; |
---|
303 | 430 | boolean dontselect = false; |
---|
304 | 431 | boolean hide = false; |
---|
305 | 432 | boolean link2master = false; // performs reset support/master at each frame |
---|
.. | .. |
---|
482 | 609 | toParent = LA.newMatrix(); |
---|
483 | 610 | fromParent = LA.newMatrix(); |
---|
484 | 611 | } |
---|
| 612 | + |
---|
485 | 613 | if (toParentMarked == null) |
---|
486 | 614 | { |
---|
487 | 615 | if (maxcount != 1) |
---|
488 | 616 | { |
---|
489 | 617 | new Exception().printStackTrace(); |
---|
490 | 618 | } |
---|
| 619 | + |
---|
491 | 620 | toParentMarked = LA.newMatrix(); |
---|
492 | 621 | fromParentMarked = LA.newMatrix(); |
---|
493 | 622 | } |
---|
.. | .. |
---|
775 | 904 | if (step == 0) |
---|
776 | 905 | step = 1; |
---|
777 | 906 | if (maxcount == 0) |
---|
778 | | - maxcount = 2048; // 4; |
---|
| 907 | + maxcount = 128; // 2048; // 4; |
---|
779 | 908 | // if (acceleration == 0) |
---|
780 | 909 | // acceleration = 10; |
---|
781 | 910 | if (delay == 0) // serial |
---|
.. | .. |
---|
798 | 927 | |
---|
799 | 928 | if (marked && Globals.isLIVE() && live && |
---|
800 | 929 | //TEMP21aug2018 |
---|
801 | | - (Globals.DrawMode() == iCameraPane.SHADOW || !Globals.RENDERSHADOW) && |
---|
| 930 | + (Globals.DrawMode() == iCameraPane.SHADOW || !Globals.RENDERSHADOW || !Globals.COMPUTESHADOWWHENLIVE) && |
---|
802 | 931 | currentframe != Globals.framecount) |
---|
803 | 932 | { |
---|
804 | 933 | currentframe = Globals.framecount; |
---|
.. | .. |
---|
810 | 939 | |
---|
811 | 940 | boolean changedir = random && Math.random() < 0.01; // && !link2master; |
---|
812 | 941 | |
---|
813 | | - if (transformcount*factor > maxcount || (step == 1 && changedir)) |
---|
| 942 | + if (transformcount*factor >= maxcount && (rewind || random) || |
---|
| 943 | + (step == 1 && changedir)) |
---|
814 | 944 | { |
---|
815 | 945 | countdown = 1; |
---|
816 | 946 | delay = speedup?8:1; |
---|
.. | .. |
---|
882 | 1012 | if (material == null || material.multiply) |
---|
883 | 1013 | return true; |
---|
884 | 1014 | |
---|
| 1015 | + // Transparent objects are dynamic because we have to sort the triangles. |
---|
885 | 1016 | return material.opacity > 0.99; |
---|
886 | 1017 | } |
---|
887 | 1018 | |
---|
.. | .. |
---|
1282 | 1413 | toParent = LA.newMatrix(); |
---|
1283 | 1414 | fromParent = LA.newMatrix(); |
---|
1284 | 1415 | } |
---|
| 1416 | + |
---|
1285 | 1417 | LA.matCopy(other.toParent, toParent); |
---|
1286 | 1418 | LA.matCopy(other.fromParent, fromParent); |
---|
1287 | 1419 | |
---|
.. | .. |
---|
2303 | 2435 | } |
---|
2304 | 2436 | */ |
---|
2305 | 2437 | } |
---|
| 2438 | + else |
---|
| 2439 | + { |
---|
| 2440 | + //((ObjEditor)editWindow).SetupUI2(null); |
---|
| 2441 | + } |
---|
2306 | 2442 | } |
---|
2307 | 2443 | |
---|
2308 | 2444 | void createEditWindow(GroupEditor callee, boolean newWindow) //, boolean root) |
---|
.. | .. |
---|
2344 | 2480 | { |
---|
2345 | 2481 | editWindow.refreshContents(); |
---|
2346 | 2482 | } |
---|
| 2483 | + else |
---|
| 2484 | + { |
---|
| 2485 | + if (manipWindow != null) |
---|
| 2486 | + { |
---|
| 2487 | + manipWindow.refreshContents(); |
---|
| 2488 | + } |
---|
| 2489 | + } |
---|
| 2490 | + |
---|
2347 | 2491 | //if (parent != null) |
---|
2348 | 2492 | //parent.refreshEditWindow(); |
---|
2349 | 2493 | } |
---|
.. | .. |
---|
2628 | 2772 | //Touch(); |
---|
2629 | 2773 | } |
---|
2630 | 2774 | |
---|
| 2775 | + void GenNormalsMeshS() |
---|
| 2776 | + { |
---|
| 2777 | + selection.GenNormalsMesh(); |
---|
| 2778 | +// for (int i=0; i<selection.size(); i++) |
---|
| 2779 | +// { |
---|
| 2780 | +// Object3D selectee = (Object3D) selection.elementAt(i); |
---|
| 2781 | +// selectee.GenNormals(crease); |
---|
| 2782 | +// } |
---|
| 2783 | + |
---|
| 2784 | + //Touch(); |
---|
| 2785 | + } |
---|
| 2786 | + |
---|
2631 | 2787 | void ClearColorsS() |
---|
2632 | 2788 | { |
---|
2633 | 2789 | selection.ClearColors(); |
---|
.. | .. |
---|
2759 | 2915 | if (child == null) |
---|
2760 | 2916 | continue; |
---|
2761 | 2917 | child.GenNormals(crease); |
---|
| 2918 | +// Children().release(i); |
---|
| 2919 | + } |
---|
| 2920 | + blockloop = false; |
---|
| 2921 | + } |
---|
| 2922 | + |
---|
| 2923 | + void GenNormalsMesh() |
---|
| 2924 | + { |
---|
| 2925 | + if (blockloop) |
---|
| 2926 | + return; |
---|
| 2927 | + |
---|
| 2928 | + blockloop = true; |
---|
| 2929 | + GenNormalsMesh0(); |
---|
| 2930 | + for (int i = 0; i < Children().Size(); i++) |
---|
| 2931 | + { |
---|
| 2932 | + Object3D child = (Object3D) Children().get(i); // reserve(i); |
---|
| 2933 | + if (child == null) |
---|
| 2934 | + continue; |
---|
| 2935 | + child.GenNormalsMesh(); |
---|
2762 | 2936 | // Children().release(i); |
---|
2763 | 2937 | } |
---|
2764 | 2938 | blockloop = false; |
---|
.. | .. |
---|
2931 | 3105 | } |
---|
2932 | 3106 | } |
---|
2933 | 3107 | |
---|
| 3108 | + void GenNormalsMesh0() |
---|
| 3109 | + { |
---|
| 3110 | + if (bRep != null) |
---|
| 3111 | + { |
---|
| 3112 | + bRep.GenerateNormalsMesh(); |
---|
| 3113 | + Touch(); |
---|
| 3114 | + } |
---|
| 3115 | + } |
---|
| 3116 | + |
---|
2934 | 3117 | void GenNormalsMINE0() |
---|
2935 | 3118 | { |
---|
2936 | 3119 | if (bRep != null) |
---|
2937 | 3120 | { |
---|
2938 | | - bRep.GenerateNormalsMINE(); |
---|
| 3121 | + bRep.MergeNormals(); //.GenerateNormalsMINE(); |
---|
2939 | 3122 | Touch(); |
---|
2940 | 3123 | } |
---|
2941 | 3124 | } |
---|
.. | .. |
---|
3381 | 3564 | if (blockloop) |
---|
3382 | 3565 | return; |
---|
3383 | 3566 | |
---|
3384 | | - if (marked || (bRep != null && material != null)) // borderline... |
---|
| 3567 | + if (//marked || // does not make sense |
---|
| 3568 | + (bRep != null || material != null)) // borderline... |
---|
3385 | 3569 | live = h; |
---|
3386 | 3570 | |
---|
3387 | 3571 | for (int i = 0; i < Size(); i++) |
---|
.. | .. |
---|
3402 | 3586 | return; |
---|
3403 | 3587 | |
---|
3404 | 3588 | //if (bRep != null) |
---|
3405 | | - if (marked || (bRep != null && material != null)) // borderline... |
---|
| 3589 | + if (//marked || // does not make sense |
---|
| 3590 | + (bRep != null || material != null)) // borderline... |
---|
3406 | 3591 | link2master = h; |
---|
3407 | 3592 | |
---|
3408 | 3593 | for (int i = 0; i < Size(); i++) |
---|
.. | .. |
---|
3422 | 3607 | if (blockloop) |
---|
3423 | 3608 | return; |
---|
3424 | 3609 | |
---|
3425 | | - if (marked || (bRep != null && material != null)) // borderline... |
---|
| 3610 | + if (//marked || // does not make sense |
---|
| 3611 | + (bRep != null || material != null)) // borderline... |
---|
3426 | 3612 | hide = h; |
---|
3427 | 3613 | |
---|
3428 | 3614 | for (int i = 0; i < Size(); i++) |
---|
.. | .. |
---|
3442 | 3628 | if (blockloop) |
---|
3443 | 3629 | return; |
---|
3444 | 3630 | |
---|
3445 | | - if (bRep != null && material != null) // borderline... |
---|
| 3631 | + if (bRep != null || material != null) // borderline... |
---|
3446 | 3632 | marked = h; |
---|
3447 | 3633 | |
---|
3448 | 3634 | for (int i = 0; i < Size(); i++) |
---|
.. | .. |
---|
3452 | 3638 | continue; |
---|
3453 | 3639 | blockloop = true; |
---|
3454 | 3640 | child.MarkLeaves(h); |
---|
| 3641 | + blockloop = false; |
---|
| 3642 | + // release(i); |
---|
| 3643 | + } |
---|
| 3644 | + } |
---|
| 3645 | + |
---|
| 3646 | + void RewindLeaves(boolean h) |
---|
| 3647 | + { |
---|
| 3648 | + if (blockloop) |
---|
| 3649 | + return; |
---|
| 3650 | + |
---|
| 3651 | + if (bRep != null || material != null) // borderline... |
---|
| 3652 | + rewind = h; |
---|
| 3653 | + |
---|
| 3654 | + for (int i = 0; i < Size(); i++) |
---|
| 3655 | + { |
---|
| 3656 | + Object3D child = (Object3D) get(i); // reserve(i); |
---|
| 3657 | + if (child == null) |
---|
| 3658 | + continue; |
---|
| 3659 | + blockloop = true; |
---|
| 3660 | + child.RewindLeaves(h); |
---|
| 3661 | + blockloop = false; |
---|
| 3662 | + // release(i); |
---|
| 3663 | + } |
---|
| 3664 | + } |
---|
| 3665 | + |
---|
| 3666 | + void RandomLeaves(boolean h) |
---|
| 3667 | + { |
---|
| 3668 | + if (blockloop) |
---|
| 3669 | + return; |
---|
| 3670 | + |
---|
| 3671 | + if (bRep != null || material != null) // borderline... |
---|
| 3672 | + random = h; |
---|
| 3673 | + |
---|
| 3674 | + for (int i = 0; i < Size(); i++) |
---|
| 3675 | + { |
---|
| 3676 | + Object3D child = (Object3D) get(i); // reserve(i); |
---|
| 3677 | + if (child == null) |
---|
| 3678 | + continue; |
---|
| 3679 | + blockloop = true; |
---|
| 3680 | + child.RandomLeaves(h); |
---|
3455 | 3681 | blockloop = false; |
---|
3456 | 3682 | // release(i); |
---|
3457 | 3683 | } |
---|
.. | .. |
---|
4229 | 4455 | } |
---|
4230 | 4456 | } |
---|
4231 | 4457 | |
---|
| 4458 | + void RepairSOV() |
---|
| 4459 | + { |
---|
| 4460 | + if (blockloop) |
---|
| 4461 | + return; |
---|
| 4462 | + |
---|
| 4463 | + String texname = this.GetPigmentTexture(); |
---|
| 4464 | + |
---|
| 4465 | + if (texname.startsWith("sov")) |
---|
| 4466 | + { |
---|
| 4467 | + String[] s = texname.split("/"); |
---|
| 4468 | + |
---|
| 4469 | + String[] sname = s[1].split("Color.pn"); |
---|
| 4470 | + |
---|
| 4471 | + texname = sname[0]; |
---|
| 4472 | + |
---|
| 4473 | + if (sname.length > 1) |
---|
| 4474 | + { |
---|
| 4475 | + texname += "Color.jpg"; |
---|
| 4476 | + } |
---|
| 4477 | + |
---|
| 4478 | + this.SetPigmentTexture("sov/" + texname); |
---|
| 4479 | + } |
---|
| 4480 | + |
---|
| 4481 | + texname = this.GetBumpTexture(); |
---|
| 4482 | + |
---|
| 4483 | + if (texname.startsWith("sov")) |
---|
| 4484 | + { |
---|
| 4485 | + String[] s = texname.split("/"); |
---|
| 4486 | + |
---|
| 4487 | + String[] sname = s[1].split("Bump.pn"); |
---|
| 4488 | + |
---|
| 4489 | + texname = sname[0]; |
---|
| 4490 | + |
---|
| 4491 | + if (sname.length > 1) |
---|
| 4492 | + { |
---|
| 4493 | + texname += "Bump.jpg"; |
---|
| 4494 | + } |
---|
| 4495 | + |
---|
| 4496 | + this.SetBumpTexture("sov/" + texname); |
---|
| 4497 | + } |
---|
| 4498 | + |
---|
| 4499 | + for (int i=0; i<Size(); i++) |
---|
| 4500 | + { |
---|
| 4501 | + blockloop = true; |
---|
| 4502 | + get(i).RepairSOV(); |
---|
| 4503 | + blockloop = false; |
---|
| 4504 | + } |
---|
| 4505 | + } |
---|
| 4506 | + |
---|
4232 | 4507 | void RepairTexture() |
---|
4233 | 4508 | { |
---|
4234 | 4509 | if (this instanceof FileObject || blockloop) |
---|
.. | .. |
---|
4743 | 5018 | } |
---|
4744 | 5019 | } |
---|
4745 | 5020 | |
---|
| 5021 | + ObjEditor GetWindow() |
---|
| 5022 | + { |
---|
| 5023 | + if (editWindow != null) |
---|
| 5024 | + return editWindow; |
---|
| 5025 | + |
---|
| 5026 | + return manipWindow; |
---|
| 5027 | + } |
---|
| 5028 | + |
---|
4746 | 5029 | cTreePath Select(int indexcount, boolean deselect) |
---|
4747 | 5030 | { |
---|
4748 | 5031 | if (hide || dontselect) |
---|
.. | .. |
---|
4779 | 5062 | if (leaf != null) |
---|
4780 | 5063 | { |
---|
4781 | 5064 | cTreePath tp = new cTreePath(this, leaf); |
---|
4782 | | - if (editWindow != null) |
---|
| 5065 | + ObjEditor window = GetWindow(); |
---|
| 5066 | + if (window != null) |
---|
4783 | 5067 | { |
---|
4784 | 5068 | //System.out.println("editWindow = " + editWindow + " vs " + this); |
---|
4785 | | - editWindow.Select(tp, deselect, true); |
---|
| 5069 | + window.Select(tp, deselect, true); |
---|
4786 | 5070 | } |
---|
4787 | 5071 | |
---|
4788 | 5072 | return tp; |
---|
.. | .. |
---|
4799 | 5083 | |
---|
4800 | 5084 | if (child == null) |
---|
4801 | 5085 | continue; |
---|
| 5086 | + |
---|
4802 | 5087 | if (child.HasTransparency() && child.size() != 0) |
---|
4803 | 5088 | { |
---|
4804 | 5089 | cTreePath leaf = child.Select(indexcount, deselect); |
---|
.. | .. |
---|
4808 | 5093 | if (leaf != null) |
---|
4809 | 5094 | { |
---|
4810 | 5095 | cTreePath tp = new cTreePath(this, leaf); |
---|
4811 | | - if (editWindow != null) |
---|
| 5096 | + ObjEditor window = GetWindow(); |
---|
| 5097 | + if (window != null) |
---|
4812 | 5098 | { |
---|
4813 | | - editWindow.Select(tp, deselect, true); |
---|
| 5099 | + window.Select(tp, deselect, true); |
---|
4814 | 5100 | } |
---|
4815 | 5101 | |
---|
4816 | 5102 | return tp; |
---|
.. | .. |
---|
5135 | 5421 | blockloop = false; |
---|
5136 | 5422 | } |
---|
5137 | 5423 | |
---|
| 5424 | + void ResetSelectable() |
---|
| 5425 | + { |
---|
| 5426 | + if (blockloop) |
---|
| 5427 | + return; |
---|
| 5428 | + |
---|
| 5429 | + blockloop = true; |
---|
| 5430 | + |
---|
| 5431 | + keepdontselect = dontselect; |
---|
| 5432 | + dontselect = true; |
---|
| 5433 | + |
---|
| 5434 | + Object3D child; |
---|
| 5435 | + int nb = Size(); |
---|
| 5436 | + for (int i = 0; i < nb; i++) |
---|
| 5437 | + { |
---|
| 5438 | + child = (Object3D) get(i); |
---|
| 5439 | + if (child == null) |
---|
| 5440 | + continue; |
---|
| 5441 | + child.ResetSelectable(); |
---|
| 5442 | + } |
---|
| 5443 | + |
---|
| 5444 | + blockloop = false; |
---|
| 5445 | + } |
---|
| 5446 | + |
---|
| 5447 | + void RestoreSelectable() |
---|
| 5448 | + { |
---|
| 5449 | + if (blockloop) |
---|
| 5450 | + return; |
---|
| 5451 | + |
---|
| 5452 | + blockloop = true; |
---|
| 5453 | + |
---|
| 5454 | + dontselect = keepdontselect; |
---|
| 5455 | + |
---|
| 5456 | + Object3D child; |
---|
| 5457 | + int nb = Size(); |
---|
| 5458 | + for (int i = 0; i < nb; i++) |
---|
| 5459 | + { |
---|
| 5460 | + child = (Object3D) get(i); |
---|
| 5461 | + if (child == null) |
---|
| 5462 | + continue; |
---|
| 5463 | + child.RestoreSelectable(); |
---|
| 5464 | + } |
---|
| 5465 | + |
---|
| 5466 | + blockloop = false; |
---|
| 5467 | + } |
---|
| 5468 | + |
---|
5138 | 5469 | boolean IsSelected() |
---|
5139 | 5470 | { |
---|
5140 | 5471 | if (parent == null) |
---|
.. | .. |
---|
5371 | 5702 | } |
---|
5372 | 5703 | } |
---|
5373 | 5704 | |
---|
| 5705 | + UUID GetUUID() |
---|
| 5706 | + { |
---|
| 5707 | + if (uuid == null) |
---|
| 5708 | + { |
---|
| 5709 | + // Serial |
---|
| 5710 | + uuid = UUID.randomUUID(); |
---|
| 5711 | + } |
---|
| 5712 | + |
---|
| 5713 | + return uuid; |
---|
| 5714 | + } |
---|
| 5715 | + |
---|
| 5716 | + Object3D GetObject(UUID uid) |
---|
| 5717 | + { |
---|
| 5718 | + if (blockloop) |
---|
| 5719 | + return null; |
---|
| 5720 | + |
---|
| 5721 | + if (GetUUID().equals(uid)) |
---|
| 5722 | + return this; |
---|
| 5723 | + |
---|
| 5724 | + int nb = Size(); |
---|
| 5725 | + for (int i = 0; i < nb; i++) |
---|
| 5726 | + { |
---|
| 5727 | + Object3D child = (Object3D) get(i); |
---|
| 5728 | + |
---|
| 5729 | + if (child == null) |
---|
| 5730 | + continue; |
---|
| 5731 | + |
---|
| 5732 | + blockloop = true; |
---|
| 5733 | + Object3D obj = child.GetObject(uid); |
---|
| 5734 | + blockloop = false; |
---|
| 5735 | + if (obj != null) |
---|
| 5736 | + return obj; |
---|
| 5737 | + } |
---|
| 5738 | + |
---|
| 5739 | + return null; |
---|
| 5740 | + } |
---|
| 5741 | + |
---|
5374 | 5742 | void SetBumpTexture(String tex) |
---|
5375 | 5743 | { |
---|
5376 | 5744 | if (GetTextures() == null) |
---|
.. | .. |
---|
5407 | 5775 | } |
---|
5408 | 5776 | } |
---|
5409 | 5777 | |
---|
| 5778 | + void EmbedTextures(boolean embed) |
---|
| 5779 | + { |
---|
| 5780 | + if (blockloop) |
---|
| 5781 | + return; |
---|
| 5782 | + |
---|
| 5783 | + //if (GetTextures() != null) |
---|
| 5784 | + if (embed) |
---|
| 5785 | + CameraPane.EmbedTextures(GetTextures()); |
---|
| 5786 | + else |
---|
| 5787 | + { |
---|
| 5788 | + GetTextures().pigmentdata = null; |
---|
| 5789 | + GetTextures().bumpdata = null; |
---|
| 5790 | + GetTextures().pw = 0; |
---|
| 5791 | + GetTextures().ph = 0; |
---|
| 5792 | + GetTextures().bw = 0; |
---|
| 5793 | + GetTextures().bh = 0; |
---|
| 5794 | + } |
---|
| 5795 | + |
---|
| 5796 | + int nb = Size(); |
---|
| 5797 | + for (int i = 0; i < nb; i++) |
---|
| 5798 | + { |
---|
| 5799 | + Object3D child = (Object3D) get(i); |
---|
| 5800 | + |
---|
| 5801 | + if (child == null) |
---|
| 5802 | + continue; |
---|
| 5803 | + |
---|
| 5804 | + blockloop = true; |
---|
| 5805 | + child.EmbedTextures(embed); |
---|
| 5806 | + blockloop = false; |
---|
| 5807 | + } |
---|
| 5808 | + } |
---|
| 5809 | + |
---|
5410 | 5810 | void draw(iCameraPane display, Object3D /*Composite*/ root, boolean selected, boolean blocked) |
---|
5411 | 5811 | { |
---|
5412 | 5812 | Draw(display, root, selected, blocked); |
---|
.. | .. |
---|
5415 | 5815 | boolean NeedSupport() |
---|
5416 | 5816 | { |
---|
5417 | 5817 | return |
---|
5418 | | - CameraPane.SUPPORT && (!CameraPane.movingcamera || !Globals.FREEZEONMOVE) && link2master && /*live &&*/ support != null |
---|
| 5818 | + CameraPane.SUPPORT && (!CameraPane.movingcamera || (!Globals.FREEZEONMOVE && Globals.isLIVE())) && link2master && /*live &&*/ support != null |
---|
5419 | 5819 | // PROBLEM with CROWD!! |
---|
5420 | 5820 | && (Globals.DrawMode() == iCameraPane.SHADOW || !Globals.RENDERSHADOW || Globals.CROWD); |
---|
5421 | 5821 | } |
---|
5422 | 5822 | |
---|
5423 | 5823 | static boolean DEBUG_SELECTION = false; |
---|
| 5824 | + |
---|
| 5825 | + boolean IsLive() |
---|
| 5826 | + { |
---|
| 5827 | + if (live) |
---|
| 5828 | + return true; |
---|
| 5829 | + |
---|
| 5830 | + if (parent == null) |
---|
| 5831 | + return false; |
---|
| 5832 | + |
---|
| 5833 | + return parent.IsLive(); |
---|
| 5834 | + } |
---|
5424 | 5835 | |
---|
5425 | 5836 | void Draw(iCameraPane display, Object3D /*Composite*/ root, boolean selected, boolean blocked) |
---|
5426 | 5837 | { |
---|
.. | .. |
---|
5483 | 5894 | support = support; |
---|
5484 | 5895 | |
---|
5485 | 5896 | //boolean usecalllists = IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null || !link2master); // !(this instanceof cSpring) && !(this instanceof BezierPatch); |
---|
5486 | | - boolean usecalllists = false; // IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null) && !link2master; // !(this instanceof cSpring) && !(this instanceof BezierPatch); |
---|
| 5897 | + boolean usecalllists = !IsLive(); // IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null) && !link2master; // !(this instanceof cSpring) && !(this instanceof BezierPatch); |
---|
5487 | 5898 | |
---|
5488 | 5899 | if (!usecalllists && bRep != null && bRep.displaylist > 0) |
---|
5489 | 5900 | { |
---|
.. | .. |
---|
5503 | 5914 | boolean selectmode = display.DrawMode() == display.SELECTION || display.IsDebugSelection(); |
---|
5504 | 5915 | |
---|
5505 | 5916 | if (!selectmode && //display.DrawMode() != display.SELECTION && |
---|
5506 | | - (touched || (bRep != null && bRep.displaylist <= 0))) |
---|
| 5917 | + //(touched || (bRep != null && bRep.displaylist <= 0))) |
---|
| 5918 | + (Globals.isLIVE() && Globals.COMPUTESHADOWWHENLIVE || touched && Globals.COMPUTESHADOWWHENLIVE)) // || (bRep != null && bRep.displaylist <= 0))) |
---|
5507 | 5919 | { |
---|
5508 | 5920 | Globals.lighttouched = true; |
---|
5509 | 5921 | } // all panes... |
---|
| 5922 | + |
---|
5510 | 5923 | //if (usecalllists && display.DrawMode() != display.SELECTION && display.DrawMode() != display.SHADOW && |
---|
5511 | 5924 | if (bRep != null && usecalllists && !selectmode && // june 2013 display.DrawMode() != display.SHADOW && |
---|
5512 | 5925 | (touched || (bRep != null && bRep.displaylist <= 0))) |
---|
.. | .. |
---|
5634 | 6047 | if (GetBRep() != null) |
---|
5635 | 6048 | { |
---|
5636 | 6049 | display.NextIndex(); |
---|
| 6050 | + |
---|
5637 | 6051 | // vertex color conflict : gl.glCallList(list); |
---|
5638 | 6052 | DrawNode(display, root, selected); |
---|
5639 | 6053 | if (this instanceof BezierPatch) |
---|
.. | .. |
---|
5674 | 6088 | tex = GetTextures(); |
---|
5675 | 6089 | } |
---|
5676 | 6090 | |
---|
5677 | | - boolean failed = false; |
---|
| 6091 | + boolean failedPigment = false; |
---|
| 6092 | + boolean failedBump = false; |
---|
5678 | 6093 | |
---|
5679 | 6094 | try |
---|
5680 | 6095 | { |
---|
5681 | | - display.BindTextures(tex, texres); |
---|
| 6096 | + display.BindPigmentTexture(tex, texres); |
---|
5682 | 6097 | } |
---|
5683 | 6098 | catch (Exception e) |
---|
5684 | 6099 | { |
---|
5685 | 6100 | System.err.println("FAILED: " + this); |
---|
5686 | | - failed = true; |
---|
| 6101 | + failedPigment = true; |
---|
| 6102 | + } |
---|
| 6103 | + |
---|
| 6104 | + try |
---|
| 6105 | + { |
---|
| 6106 | + display.BindBumpTexture(tex, texres); |
---|
| 6107 | + } |
---|
| 6108 | + catch (Exception e) |
---|
| 6109 | + { |
---|
| 6110 | + //System.err.println("FAILED: " + this); |
---|
| 6111 | + failedBump = true; |
---|
5687 | 6112 | } |
---|
5688 | 6113 | |
---|
5689 | 6114 | if (!compiled) |
---|
.. | .. |
---|
5706 | 6131 | } |
---|
5707 | 6132 | } |
---|
5708 | 6133 | |
---|
5709 | | - if (!failed) |
---|
5710 | | - display.ReleaseTextures(tex); |
---|
| 6134 | + if (!failedBump) |
---|
| 6135 | + display.ReleaseBumpTexture(tex); |
---|
| 6136 | + |
---|
| 6137 | + if (!failedPigment) |
---|
| 6138 | + display.ReleasePigmentTexture(tex); |
---|
5711 | 6139 | |
---|
5712 | 6140 | display.PopMaterial(this, selected); |
---|
5713 | 6141 | } |
---|
.. | .. |
---|
6080 | 6508 | // dec 2012 |
---|
6081 | 6509 | new Exception().printStackTrace(); |
---|
6082 | 6510 | return; |
---|
| 6511 | + } |
---|
| 6512 | + |
---|
| 6513 | + if (dontselect) |
---|
| 6514 | + { |
---|
| 6515 | + //bRep.GenerateNormalsMINE(); |
---|
6083 | 6516 | } |
---|
6084 | 6517 | |
---|
6085 | 6518 | display.DrawGeometry(bRep, flipV, selectmode); |
---|
.. | .. |
---|
6932 | 7365 | spot.translate(32, 32); |
---|
6933 | 7366 | spotw = spot.x + spot.width; |
---|
6934 | 7367 | spoth = spot.y + spot.height; |
---|
6935 | | - info.g.setColor(Color.blue); |
---|
| 7368 | + info.g.setColor(Color.cyan); |
---|
6936 | 7369 | info.g.fillRect(spot.x, spot.y, spot.width, spot.height); |
---|
6937 | 7370 | // if (CameraPane.Xmin > spot.x) |
---|
6938 | 7371 | // { |
---|
.. | .. |
---|
6950 | 7383 | // { |
---|
6951 | 7384 | // CameraPane.Ymax = spoth; |
---|
6952 | 7385 | // } |
---|
6953 | | - info.g.drawLine(spotw, spoth, spotw, spoth - 15); |
---|
6954 | | - info.g.drawLine(spotw, spoth, spotw - 15, spoth); |
---|
| 7386 | + // bonhommes info.g.drawLine(spotw, spoth, spotw, spoth - boundary.height/2); // 15 |
---|
| 7387 | + //info.g.drawLine(spotw, spoth, spotw - boundary.width/2, spoth); // 15 |
---|
6955 | 7388 | spot.translate(0, -32); |
---|
6956 | | - info.g.setColor(Color.green); |
---|
| 7389 | + info.g.setColor(Color.yellow); |
---|
6957 | 7390 | info.g.fillRect(spot.x, spot.y, spot.width, spot.height); |
---|
| 7391 | + info.g.setColor(Color.green); |
---|
6958 | 7392 | // if (CameraPane.Xmin > spot.x) |
---|
6959 | 7393 | // { |
---|
6960 | 7394 | // CameraPane.Xmin = spot.x; |
---|
.. | .. |
---|
6971 | 7405 | // { |
---|
6972 | 7406 | // CameraPane.Ymax = spoth; |
---|
6973 | 7407 | // } |
---|
6974 | | - info.g.drawArc(boundary.x, boundary.y, |
---|
6975 | | - boundary.width, boundary.height, 0, 360); |
---|
| 7408 | + info.g.drawArc(boundary.x + info.DX, boundary.y + info.DY, |
---|
| 7409 | + (int)(boundary.width * info.W), (int)(boundary.height * info.W), 0, 360); |
---|
6976 | 7410 | //info.g.drawArc(spot.x, spotw, spot.width/2, boundary.height/2, 0, 360); |
---|
6977 | 7411 | // if (CameraPane.Xmin > boundary.x) |
---|
6978 | 7412 | // { |
---|
.. | .. |
---|
7006 | 7440 | startX = info.x; |
---|
7007 | 7441 | startY = info.y; |
---|
7008 | 7442 | |
---|
7009 | | - hitSomething = 0; |
---|
| 7443 | + hitSomething = -1; |
---|
7010 | 7444 | cVector origin = new cVector(); |
---|
7011 | 7445 | //LA.xformPos(origin, toParent, origin); |
---|
7012 | 7446 | Rectangle spot = new Rectangle(); |
---|
.. | .. |
---|
7082 | 7516 | //System.out.println("hitSomething = " + hitSomething); |
---|
7083 | 7517 | |
---|
7084 | 7518 | double scale = 0.005f * info.camera.Distance(); |
---|
| 7519 | + |
---|
7085 | 7520 | cVector xlate = new cVector(); |
---|
7086 | 7521 | //cVector xlate2 = new cVector(); |
---|
7087 | 7522 | switch (hitSomething) |
---|
.. | .. |
---|
7230 | 7665 | |
---|
7231 | 7666 | case hitScale: // scale |
---|
7232 | 7667 | double hScale = (double) (info.x - centerPt.x) / 32; |
---|
| 7668 | + double sign = 1; |
---|
| 7669 | + if (hScale < 0) |
---|
| 7670 | + { |
---|
| 7671 | + sign = -1; |
---|
| 7672 | + } |
---|
| 7673 | + hScale = sign*Math.pow(sign*hScale, scale * 50); |
---|
7233 | 7674 | if (hScale < 0.01) |
---|
7234 | 7675 | { |
---|
7235 | | - hScale = 0.01; |
---|
| 7676 | + //hScale = 0.01; |
---|
7236 | 7677 | } |
---|
7237 | | - hScale = Math.pow(hScale, scale * 50); |
---|
7238 | | - if (hScale < 0.01) |
---|
7239 | | - { |
---|
7240 | | - hScale = 0.01; |
---|
7241 | | - } |
---|
| 7678 | + |
---|
7242 | 7679 | double vScale = (double) (info.y - centerPt.y) / 32; |
---|
7243 | | - if (vScale < 0.01) |
---|
| 7680 | + sign = 1; |
---|
| 7681 | + if (vScale < 0) |
---|
7244 | 7682 | { |
---|
7245 | | - vScale = 0.01; |
---|
| 7683 | + sign = -1; |
---|
7246 | 7684 | } |
---|
7247 | | - vScale = Math.pow(vScale, scale * 50); |
---|
| 7685 | + vScale = sign*Math.pow(sign*vScale, scale * 50); |
---|
7248 | 7686 | if (vScale < 0.01) |
---|
7249 | 7687 | { |
---|
7250 | | - vScale = 0.01; |
---|
| 7688 | + //vScale = 0.01; |
---|
7251 | 7689 | } |
---|
7252 | 7690 | LA.matCopy(startMat, toParent); |
---|
7253 | 7691 | /**/ |
---|
.. | .. |
---|
7258 | 7696 | } |
---|
7259 | 7697 | /**/ |
---|
7260 | 7698 | |
---|
| 7699 | + double totalScale = Math.sqrt(hScale*hScale + vScale*vScale) / Math.sqrt(2); |
---|
| 7700 | + |
---|
| 7701 | + if (totalScale < 0.01) |
---|
| 7702 | + { |
---|
| 7703 | + totalScale = 0.01; |
---|
| 7704 | + } |
---|
| 7705 | + |
---|
7261 | 7706 | switch (info.pane.RenderCamera().viewCode) |
---|
7262 | 7707 | { |
---|
7263 | 7708 | case 3: // '\001' |
---|
7264 | | - if (modified) |
---|
| 7709 | + if (modified || opposite) |
---|
7265 | 7710 | { |
---|
7266 | 7711 | //LA.matScale(toParent, 1, hScale, vScale); |
---|
7267 | | - LA.matScale(toParent, vScale, 1, 1); |
---|
| 7712 | + LA.matScale(toParent, totalScale, 1, 1); |
---|
7268 | 7713 | } // vScale, 1); |
---|
7269 | 7714 | else |
---|
7270 | 7715 | { |
---|
7271 | | - LA.matScale(toParent, vScale, vScale, vScale); |
---|
| 7716 | + // EXCEPTION! |
---|
| 7717 | + LA.matScale(toParent, totalScale, totalScale, totalScale); |
---|
7272 | 7718 | } // vScale, 1); |
---|
7273 | 7719 | break; |
---|
7274 | 7720 | |
---|
7275 | 7721 | case 2: // '\002' |
---|
7276 | | - if (modified) |
---|
| 7722 | + if (modified || opposite) |
---|
7277 | 7723 | { |
---|
7278 | 7724 | //LA.matScale(toParent, hScale, 1, vScale); |
---|
7279 | | - LA.matScale(toParent, 1, vScale, 1); |
---|
| 7725 | + LA.matScale(toParent, 1, totalScale, 1); |
---|
7280 | 7726 | } else |
---|
7281 | 7727 | { |
---|
7282 | | - LA.matScale(toParent, vScale, 1, vScale); |
---|
| 7728 | + LA.matScale(toParent, totalScale, 1, totalScale); |
---|
7283 | 7729 | } |
---|
7284 | 7730 | break; |
---|
7285 | 7731 | |
---|
7286 | 7732 | case 1: // '\003' |
---|
7287 | | - if (modified) |
---|
| 7733 | + if (modified || opposite) |
---|
7288 | 7734 | { |
---|
7289 | 7735 | //LA.matScale(toParent, hScale, vScale, 1); |
---|
7290 | | - LA.matScale(toParent, 1, 1, vScale); |
---|
| 7736 | + LA.matScale(toParent, 1, 1, totalScale); |
---|
7291 | 7737 | } else |
---|
7292 | 7738 | { |
---|
7293 | | - LA.matScale(toParent, vScale, vScale, 1); |
---|
| 7739 | + LA.matScale(toParent, totalScale, totalScale, 1); |
---|
7294 | 7740 | } |
---|
7295 | 7741 | break; |
---|
7296 | 7742 | } |
---|
.. | .. |
---|
7431 | 7877 | objname = name + " " + System.identityHashCode(this) + " (" + parent.name + " " + System.identityHashCode(parent) + ")"; |
---|
7432 | 7878 | } else |
---|
7433 | 7879 | { |
---|
7434 | | - objname = GetName() + (Math.abs(count) == 1000 ? (count == 1000 ? " " : " * ") : (" (" + (count /*- 1*/) + ")")) + /*(IsSelected()?"(selected) ":"") + (touched?"(touched) ":"") */ ""; |
---|
| 7880 | + objname = GetName() + (Math.abs(count) == 1000 ? (count == 1000 ? " " : " * ") : (" (" + (count - 1) + ")")) + /*(IsSelected()?"(selected) ":"") + (touched?"(touched) ":"") */ ""; |
---|
7435 | 7881 | } // + super.toString(); |
---|
7436 | 7882 | //return name + " (" + (SizeOf.deepSizeOf(this)/1024) + "K) " + this.getClass().getName(); |
---|
7437 | 7883 | |
---|
.. | .. |
---|
7504 | 7950 | editWindow = null; |
---|
7505 | 7951 | } // ? |
---|
7506 | 7952 | } |
---|
| 7953 | + else |
---|
| 7954 | + { |
---|
| 7955 | + //editWindow.closeUI(); |
---|
| 7956 | + } |
---|
7507 | 7957 | } |
---|
7508 | 7958 | |
---|
7509 | 7959 | boolean root; // patch for edit windows |
---|
.. | .. |
---|
7515 | 7965 | /*transient*/ cVector2[] projectedVertices = new cVector2[0]; |
---|
7516 | 7966 | |
---|
7517 | 7967 | Object3D /*Composite*/ parent; |
---|
7518 | | - Object3D /*Composite*/ fileparent; |
---|
| 7968 | + Object3D /*Composite*/ fileparent; // In the case of FileObject |
---|
7519 | 7969 | |
---|
7520 | 7970 | double[][] toParent; // dynamic matrix |
---|
7521 | 7971 | double[][] fromParent; |
---|
.. | .. |
---|
7661 | 8111 | } |
---|
7662 | 8112 | |
---|
7663 | 8113 | transient ObjEditor editWindow; |
---|
| 8114 | + transient ObjEditor manipWindow; |
---|
| 8115 | + |
---|
| 8116 | + transient boolean pinned; |
---|
| 8117 | + |
---|
7664 | 8118 | transient ObjectUI objectUI; |
---|
7665 | 8119 | public static int povDepth = 0; |
---|
7666 | 8120 | private static cVector tbMin = new cVector(); |
---|
.. | .. |
---|
7679 | 8133 | private static cVector edge2 = new cVector(); |
---|
7680 | 8134 | //private static cVector norm = new cVector(); |
---|
7681 | 8135 | /*transient private*/ int hitSomething; |
---|
7682 | | - private static final int hitCenter = 1; |
---|
7683 | | - private static final int hitScale = 2; |
---|
7684 | | - private static final int hitRotate = 3; |
---|
| 8136 | + static final int hitCenter = 1; |
---|
| 8137 | + static final int hitScale = 2; |
---|
| 8138 | + static final int hitRotate = 3; |
---|
7685 | 8139 | /*transient*/ /*private*/ int viewCode; // Now used for transparency cache flag |
---|
7686 | 8140 | /*transient*/ private Point centerPt; |
---|
7687 | 8141 | /*transient*/ private int startX; |
---|