.. | .. |
---|
181 | 181 | return; |
---|
182 | 182 | } |
---|
183 | 183 | |
---|
184 | | - Object3D o = new Object3D(); |
---|
| 184 | + Object3D o = new Object3D("copy of " + this.name); |
---|
185 | 185 | |
---|
186 | 186 | hashtable.put(GetUUID(), o); |
---|
187 | 187 | |
---|
.. | .. |
---|
219 | 219 | if (!hashtable.containsKey(GetUUID())) |
---|
220 | 220 | return; |
---|
221 | 221 | |
---|
| 222 | + if (blockloop) |
---|
| 223 | + return; |
---|
| 224 | + |
---|
| 225 | + blockloop = true; |
---|
| 226 | + |
---|
222 | 227 | Object3D o = hashtable.get(GetUUID()); |
---|
223 | 228 | |
---|
224 | 229 | RestoreBigData(o); |
---|
225 | 230 | |
---|
226 | | - hashtable.remove(GetUUID()); |
---|
| 231 | + //hashtable.remove(GetUUID()); |
---|
227 | 232 | |
---|
228 | 233 | for (int i=0; i<Size(); i++) |
---|
229 | 234 | { |
---|
230 | 235 | get(i).RestoreBigData(hashtable); |
---|
231 | 236 | } |
---|
| 237 | + |
---|
| 238 | + blockloop = false; |
---|
232 | 239 | } |
---|
233 | 240 | |
---|
234 | 241 | void RestoreBigData(Object3D o) |
---|
.. | .. |
---|
881 | 888 | |
---|
882 | 889 | if (marked && Globals.isLIVE() && live && |
---|
883 | 890 | //TEMP21aug2018 |
---|
884 | | - (Globals.DrawMode() == iCameraPane.SHADOW || !Globals.RENDERSHADOW) && |
---|
| 891 | + (Globals.DrawMode() == iCameraPane.SHADOW || !Globals.RENDERSHADOW || !Globals.COMPUTESHADOWWHENLIVE) && |
---|
885 | 892 | currentframe != Globals.framecount) |
---|
886 | 893 | { |
---|
887 | 894 | currentframe = Globals.framecount; |
---|
.. | .. |
---|
893 | 900 | |
---|
894 | 901 | boolean changedir = random && Math.random() < 0.01; // && !link2master; |
---|
895 | 902 | |
---|
896 | | - if (transformcount*factor > maxcount || (step == 1 && changedir)) |
---|
| 903 | + if (transformcount*factor >= maxcount && (rewind || random) || |
---|
| 904 | + (step == 1 && changedir)) |
---|
897 | 905 | { |
---|
898 | 906 | countdown = 1; |
---|
899 | 907 | delay = speedup?8:1; |
---|
.. | .. |
---|
965 | 973 | if (material == null || material.multiply) |
---|
966 | 974 | return true; |
---|
967 | 975 | |
---|
| 976 | + // Transparent objects are dynamic because we have to sort the triangles. |
---|
968 | 977 | return material.opacity > 0.99; |
---|
969 | 978 | } |
---|
970 | 979 | |
---|
.. | .. |
---|
2386 | 2395 | } |
---|
2387 | 2396 | */ |
---|
2388 | 2397 | } |
---|
| 2398 | + else |
---|
| 2399 | + { |
---|
| 2400 | + //((ObjEditor)editWindow).SetupUI2(null); |
---|
| 2401 | + } |
---|
2389 | 2402 | } |
---|
2390 | 2403 | |
---|
2391 | 2404 | void createEditWindow(GroupEditor callee, boolean newWindow) //, boolean root) |
---|
.. | .. |
---|
2427 | 2440 | { |
---|
2428 | 2441 | editWindow.refreshContents(); |
---|
2429 | 2442 | } |
---|
| 2443 | + else |
---|
| 2444 | + { |
---|
| 2445 | + if (manipWindow != null) |
---|
| 2446 | + { |
---|
| 2447 | + manipWindow.refreshContents(); |
---|
| 2448 | + } |
---|
| 2449 | + } |
---|
| 2450 | + |
---|
2430 | 2451 | //if (parent != null) |
---|
2431 | 2452 | //parent.refreshEditWindow(); |
---|
2432 | 2453 | } |
---|
.. | .. |
---|
3503 | 3524 | if (blockloop) |
---|
3504 | 3525 | return; |
---|
3505 | 3526 | |
---|
3506 | | - if (marked || (bRep != null && material != null)) // borderline... |
---|
| 3527 | + if (//marked || // does not make sense |
---|
| 3528 | + (bRep != null || material != null)) // borderline... |
---|
3507 | 3529 | live = h; |
---|
3508 | 3530 | |
---|
3509 | 3531 | for (int i = 0; i < Size(); i++) |
---|
.. | .. |
---|
3524 | 3546 | return; |
---|
3525 | 3547 | |
---|
3526 | 3548 | //if (bRep != null) |
---|
3527 | | - if (marked || (bRep != null && material != null)) // borderline... |
---|
| 3549 | + if (//marked || // does not make sense |
---|
| 3550 | + (bRep != null || material != null)) // borderline... |
---|
3528 | 3551 | link2master = h; |
---|
3529 | 3552 | |
---|
3530 | 3553 | for (int i = 0; i < Size(); i++) |
---|
.. | .. |
---|
3544 | 3567 | if (blockloop) |
---|
3545 | 3568 | return; |
---|
3546 | 3569 | |
---|
3547 | | - if (marked || (bRep != null && material != null)) // borderline... |
---|
| 3570 | + if (//marked || // does not make sense |
---|
| 3571 | + (bRep != null || material != null)) // borderline... |
---|
3548 | 3572 | hide = h; |
---|
3549 | 3573 | |
---|
3550 | 3574 | for (int i = 0; i < Size(); i++) |
---|
.. | .. |
---|
3564 | 3588 | if (blockloop) |
---|
3565 | 3589 | return; |
---|
3566 | 3590 | |
---|
3567 | | - if (bRep != null && material != null) // borderline... |
---|
| 3591 | + if (bRep != null || material != null) // borderline... |
---|
3568 | 3592 | marked = h; |
---|
3569 | 3593 | |
---|
3570 | 3594 | for (int i = 0; i < Size(); i++) |
---|
.. | .. |
---|
3574 | 3598 | continue; |
---|
3575 | 3599 | blockloop = true; |
---|
3576 | 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); |
---|
3577 | 3641 | blockloop = false; |
---|
3578 | 3642 | // release(i); |
---|
3579 | 3643 | } |
---|
.. | .. |
---|
4914 | 4978 | } |
---|
4915 | 4979 | } |
---|
4916 | 4980 | |
---|
| 4981 | + ObjEditor GetWindow() |
---|
| 4982 | + { |
---|
| 4983 | + if (editWindow != null) |
---|
| 4984 | + return editWindow; |
---|
| 4985 | + |
---|
| 4986 | + return manipWindow; |
---|
| 4987 | + } |
---|
| 4988 | + |
---|
4917 | 4989 | cTreePath Select(int indexcount, boolean deselect) |
---|
4918 | 4990 | { |
---|
4919 | 4991 | if (hide || dontselect) |
---|
.. | .. |
---|
4950 | 5022 | if (leaf != null) |
---|
4951 | 5023 | { |
---|
4952 | 5024 | cTreePath tp = new cTreePath(this, leaf); |
---|
4953 | | - if (editWindow != null) |
---|
| 5025 | + ObjEditor window = GetWindow(); |
---|
| 5026 | + if (window != null) |
---|
4954 | 5027 | { |
---|
4955 | 5028 | //System.out.println("editWindow = " + editWindow + " vs " + this); |
---|
4956 | | - editWindow.Select(tp, deselect, true); |
---|
| 5029 | + window.Select(tp, deselect, true); |
---|
4957 | 5030 | } |
---|
4958 | 5031 | |
---|
4959 | 5032 | return tp; |
---|
.. | .. |
---|
4970 | 5043 | |
---|
4971 | 5044 | if (child == null) |
---|
4972 | 5045 | continue; |
---|
| 5046 | + |
---|
4973 | 5047 | if (child.HasTransparency() && child.size() != 0) |
---|
4974 | 5048 | { |
---|
4975 | 5049 | cTreePath leaf = child.Select(indexcount, deselect); |
---|
.. | .. |
---|
4979 | 5053 | if (leaf != null) |
---|
4980 | 5054 | { |
---|
4981 | 5055 | cTreePath tp = new cTreePath(this, leaf); |
---|
4982 | | - if (editWindow != null) |
---|
| 5056 | + ObjEditor window = GetWindow(); |
---|
| 5057 | + if (window != null) |
---|
4983 | 5058 | { |
---|
4984 | | - editWindow.Select(tp, deselect, true); |
---|
| 5059 | + window.Select(tp, deselect, true); |
---|
4985 | 5060 | } |
---|
4986 | 5061 | |
---|
4987 | 5062 | return tp; |
---|
.. | .. |
---|
5702 | 5777 | support = support; |
---|
5703 | 5778 | |
---|
5704 | 5779 | //boolean usecalllists = IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null || !link2master); // !(this instanceof cSpring) && !(this instanceof BezierPatch); |
---|
5705 | | - boolean usecalllists = IsLive(); // IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null) && !link2master; // !(this instanceof cSpring) && !(this instanceof BezierPatch); |
---|
| 5780 | + boolean usecalllists = !IsLive(); // IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null) && !link2master; // !(this instanceof cSpring) && !(this instanceof BezierPatch); |
---|
5706 | 5781 | |
---|
5707 | 5782 | if (!usecalllists && bRep != null && bRep.displaylist > 0) |
---|
5708 | 5783 | { |
---|
.. | .. |
---|
5723 | 5798 | |
---|
5724 | 5799 | if (!selectmode && //display.DrawMode() != display.SELECTION && |
---|
5725 | 5800 | //(touched || (bRep != null && bRep.displaylist <= 0))) |
---|
5726 | | - (Globals.isLIVE() || touched && (bRep != null && bRep.displaylist <= 0))) |
---|
| 5801 | + (Globals.isLIVE() && Globals.COMPUTESHADOWWHENLIVE || touched && Globals.COMPUTESHADOWWHENLIVE)) // || (bRep != null && bRep.displaylist <= 0))) |
---|
5727 | 5802 | { |
---|
5728 | 5803 | Globals.lighttouched = true; |
---|
5729 | 5804 | } // all panes... |
---|
.. | .. |
---|
5855 | 5930 | if (GetBRep() != null) |
---|
5856 | 5931 | { |
---|
5857 | 5932 | display.NextIndex(); |
---|
| 5933 | + |
---|
5858 | 5934 | // vertex color conflict : gl.glCallList(list); |
---|
5859 | 5935 | DrawNode(display, root, selected); |
---|
5860 | 5936 | if (this instanceof BezierPatch) |
---|
.. | .. |
---|
6315 | 6391 | // dec 2012 |
---|
6316 | 6392 | new Exception().printStackTrace(); |
---|
6317 | 6393 | return; |
---|
| 6394 | + } |
---|
| 6395 | + |
---|
| 6396 | + if (dontselect) |
---|
| 6397 | + { |
---|
| 6398 | + //bRep.GenerateNormalsMINE(); |
---|
6318 | 6399 | } |
---|
6319 | 6400 | |
---|
6320 | 6401 | display.DrawGeometry(bRep, flipV, selectmode); |
---|
.. | .. |
---|
7752 | 7833 | editWindow = null; |
---|
7753 | 7834 | } // ? |
---|
7754 | 7835 | } |
---|
| 7836 | + else |
---|
| 7837 | + { |
---|
| 7838 | + //editWindow.closeUI(); |
---|
| 7839 | + } |
---|
7755 | 7840 | } |
---|
7756 | 7841 | |
---|
7757 | 7842 | boolean root; // patch for edit windows |
---|
.. | .. |
---|
7909 | 7994 | } |
---|
7910 | 7995 | |
---|
7911 | 7996 | transient ObjEditor editWindow; |
---|
| 7997 | + transient ObjEditor manipWindow; |
---|
| 7998 | + |
---|
| 7999 | + transient boolean pinned; |
---|
| 8000 | + |
---|
7912 | 8001 | transient ObjectUI objectUI; |
---|
7913 | 8002 | public static int povDepth = 0; |
---|
7914 | 8003 | private static cVector tbMin = new cVector(); |
---|