Normand Briere
2019-07-27 1af7d3700724834e40ad8636bc9a56cdc3b19b15
Object3D.java
....@@ -14,12 +14,24 @@
1414 import //weka.core.
1515 matrix.Matrix;
1616
17
+import java.util.UUID;
18
+
1719 //import net.sourceforge.sizeof.SizeOf;
1820 public class Object3D extends Vector<Object3D> implements java.io.Serializable, iSendInfo //, aurelienribon.tweenengine.TweenAccessor<Object3D>
1921 {
2022 //static final long serialVersionUID = -607422624994562685L;
2123 static final long serialVersionUID = 5022536242724664900L;
2224
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
+
2335 ScriptNode scriptnode;
2436
2537 void InitOthers()
....@@ -100,64 +112,178 @@
100112
101113 // transient boolean reduced; // for morph reduction
102114
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
105117
106
-transient Object3D transientsupport; // for cloning
107
-transient boolean transientlink2master;
118
+ transient Object3D transientsupport; // for cloning
119
+ transient boolean transientlink2master;
108120
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()
121122 {
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
+ }
123146 }
124
-
125
- for (int i = 0; i < Size(); i++)
147
+
148
+ void RestoreSupports()
126149 {
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
+
130258 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
+
132267 blockloop = false;
133268 }
134
-}
135269
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)
147271 {
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;
149286 }
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
-}
161287
162288 // MOCAP SUPPORT
163289 double tx,ty,tz,rx,ry,rz;
....@@ -300,6 +426,7 @@
300426 }
301427
302428 boolean live = false;
429
+ transient boolean keepdontselect;
303430 boolean dontselect = false;
304431 boolean hide = false;
305432 boolean link2master = false; // performs reset support/master at each frame
....@@ -482,12 +609,14 @@
482609 toParent = LA.newMatrix();
483610 fromParent = LA.newMatrix();
484611 }
612
+
485613 if (toParentMarked == null)
486614 {
487615 if (maxcount != 1)
488616 {
489617 new Exception().printStackTrace();
490618 }
619
+
491620 toParentMarked = LA.newMatrix();
492621 fromParentMarked = LA.newMatrix();
493622 }
....@@ -775,7 +904,7 @@
775904 if (step == 0)
776905 step = 1;
777906 if (maxcount == 0)
778
- maxcount = 2048; // 4;
907
+ maxcount = 128; // 2048; // 4;
779908 // if (acceleration == 0)
780909 // acceleration = 10;
781910 if (delay == 0) // serial
....@@ -798,7 +927,7 @@
798927
799928 if (marked && Globals.isLIVE() && live &&
800929 //TEMP21aug2018
801
- (Globals.DrawMode() == iCameraPane.SHADOW || !Globals.RENDERSHADOW) &&
930
+ (Globals.DrawMode() == iCameraPane.SHADOW || !Globals.RENDERSHADOW || !Globals.COMPUTESHADOWWHENLIVE) &&
802931 currentframe != Globals.framecount)
803932 {
804933 currentframe = Globals.framecount;
....@@ -810,7 +939,8 @@
810939
811940 boolean changedir = random && Math.random() < 0.01; // && !link2master;
812941
813
- if (transformcount*factor > maxcount || (step == 1 && changedir))
942
+ if (transformcount*factor >= maxcount && (rewind || random) ||
943
+ (step == 1 && changedir))
814944 {
815945 countdown = 1;
816946 delay = speedup?8:1;
....@@ -882,6 +1012,7 @@
8821012 if (material == null || material.multiply)
8831013 return true;
8841014
1015
+ // Transparent objects are dynamic because we have to sort the triangles.
8851016 return material.opacity > 0.99;
8861017 }
8871018
....@@ -1282,6 +1413,7 @@
12821413 toParent = LA.newMatrix();
12831414 fromParent = LA.newMatrix();
12841415 }
1416
+
12851417 LA.matCopy(other.toParent, toParent);
12861418 LA.matCopy(other.fromParent, fromParent);
12871419
....@@ -2303,6 +2435,10 @@
23032435 }
23042436 */
23052437 }
2438
+ else
2439
+ {
2440
+ //((ObjEditor)editWindow).SetupUI2(null);
2441
+ }
23062442 }
23072443
23082444 void createEditWindow(GroupEditor callee, boolean newWindow) //, boolean root)
....@@ -2344,6 +2480,14 @@
23442480 {
23452481 editWindow.refreshContents();
23462482 }
2483
+ else
2484
+ {
2485
+ if (manipWindow != null)
2486
+ {
2487
+ manipWindow.refreshContents();
2488
+ }
2489
+ }
2490
+
23472491 //if (parent != null)
23482492 //parent.refreshEditWindow();
23492493 }
....@@ -2423,7 +2567,8 @@
24232567 private static final int editSelf = 1;
24242568 private static final int editChild = 2;
24252569
2426
- void drawEditHandles(ClickInfo info, int level)
2570
+ void drawEditHandles(//ClickInfo info,
2571
+ int level)
24272572 {
24282573 if (level == 0)
24292574 {
....@@ -2431,7 +2576,8 @@
24312576 return;
24322577
24332578 Object3D selectee;
2434
- for (java.util.Enumeration e = selection.elements(); e.hasMoreElements(); selectee.drawEditHandles(info, level + 1))
2579
+ for (java.util.Enumeration e = selection.elements(); e.hasMoreElements(); selectee.drawEditHandles(//info,
2580
+ level + 1))
24352581 {
24362582 selectee = (Object3D) e.nextElement();
24372583 }
....@@ -2439,19 +2585,22 @@
24392585 } else
24402586 {
24412587 //super.
2442
- drawEditHandles0(info, level + 1);
2588
+ drawEditHandles0(//info,
2589
+ level + 1);
24432590 }
24442591 }
24452592
2446
- boolean doEditClick(ClickInfo info, int level)
2593
+ boolean doEditClick(//ClickInfo info,
2594
+ int level)
24472595 {
24482596 doSomething = 0;
24492597 if (level == 0)
24502598 {
2451
- return doParentClick(info);
2599
+ return doParentClick(); //info);
24522600 }
24532601 if (//super.
2454
- doEditClick0(info, level))
2602
+ doEditClick0(//info,
2603
+ level))
24552604 {
24562605 doSomething = 1;
24572606 return true;
....@@ -2461,7 +2610,7 @@
24612610 }
24622611 }
24632612
2464
- boolean doParentClick(ClickInfo info)
2613
+ boolean doParentClick() //ClickInfo info)
24652614 {
24662615 if (selection == null)
24672616 {
....@@ -2474,7 +2623,8 @@
24742623 for (java.util.Enumeration e = selection.elements(); e.hasMoreElements();)
24752624 {
24762625 Object3D selectee = (Object3D) e.nextElement();
2477
- if (selectee.doEditClick(info, 1))
2626
+ if (selectee.doEditClick(//info,
2627
+ 1))
24782628 {
24792629 childToDrag = selectee;
24802630 doSomething = 2;
....@@ -2486,13 +2636,15 @@
24862636 return retval;
24872637 }
24882638
2489
- void doEditDrag(ClickInfo info, boolean opposite)
2639
+ void doEditDrag(//ClickInfo clickInfo,
2640
+ boolean opposite)
24902641 {
24912642 switch (doSomething)
24922643 {
24932644 case 1: // '\001'
24942645 //super.
2495
- doEditDrag0(info, opposite);
2646
+ doEditDrag0(//clickInfo,
2647
+ opposite);
24962648 break;
24972649
24982650 case 2: // '\002'
....@@ -2505,11 +2657,13 @@
25052657 {
25062658 //sel.hitSomething = childToDrag.hitSomething;
25072659 //childToDrag.doEditDrag(info);
2508
- sel.doEditDrag(info, opposite);
2660
+ sel.doEditDrag(//clickInfo,
2661
+ opposite);
25092662 } else
25102663 {
25112664 //super.
2512
- doEditDrag0(info, opposite);
2665
+ doEditDrag0(//clickInfo,
2666
+ opposite);
25132667 }
25142668 }
25152669 break;
....@@ -2527,6 +2681,9 @@
25272681 {
25282682 deselectAll();
25292683 }
2684
+
2685
+ new Exception().printStackTrace();
2686
+
25302687 ClickInfo newInfo = new ClickInfo();
25312688 newInfo.flags = info.flags;
25322689 newInfo.bounds = info.bounds;
....@@ -2619,6 +2776,18 @@
26192776 void GenNormalsS(boolean crease)
26202777 {
26212778 selection.GenNormals(crease);
2779
+// for (int i=0; i<selection.size(); i++)
2780
+// {
2781
+// Object3D selectee = (Object3D) selection.elementAt(i);
2782
+// selectee.GenNormals(crease);
2783
+// }
2784
+
2785
+ //Touch();
2786
+ }
2787
+
2788
+ void GenNormalsMeshS()
2789
+ {
2790
+ selection.GenNormalsMesh();
26222791 // for (int i=0; i<selection.size(); i++)
26232792 // {
26242793 // Object3D selectee = (Object3D) selection.elementAt(i);
....@@ -2759,6 +2928,24 @@
27592928 if (child == null)
27602929 continue;
27612930 child.GenNormals(crease);
2931
+// Children().release(i);
2932
+ }
2933
+ blockloop = false;
2934
+ }
2935
+
2936
+ void GenNormalsMesh()
2937
+ {
2938
+ if (blockloop)
2939
+ return;
2940
+
2941
+ blockloop = true;
2942
+ GenNormalsMesh0();
2943
+ for (int i = 0; i < Children().Size(); i++)
2944
+ {
2945
+ Object3D child = (Object3D) Children().get(i); // reserve(i);
2946
+ if (child == null)
2947
+ continue;
2948
+ child.GenNormalsMesh();
27622949 // Children().release(i);
27632950 }
27642951 blockloop = false;
....@@ -2931,11 +3118,20 @@
29313118 }
29323119 }
29333120
3121
+ void GenNormalsMesh0()
3122
+ {
3123
+ if (bRep != null)
3124
+ {
3125
+ bRep.GenerateNormalsMesh();
3126
+ Touch();
3127
+ }
3128
+ }
3129
+
29343130 void GenNormalsMINE0()
29353131 {
29363132 if (bRep != null)
29373133 {
2938
- bRep.GenerateNormalsMINE();
3134
+ bRep.MergeNormals(); //.GenerateNormalsMINE();
29393135 Touch();
29403136 }
29413137 }
....@@ -3381,7 +3577,8 @@
33813577 if (blockloop)
33823578 return;
33833579
3384
- if (marked || (bRep != null && material != null)) // borderline...
3580
+ if (//marked || // does not make sense
3581
+ (bRep != null || material != null)) // borderline...
33853582 live = h;
33863583
33873584 for (int i = 0; i < Size(); i++)
....@@ -3402,7 +3599,8 @@
34023599 return;
34033600
34043601 //if (bRep != null)
3405
- if (marked || (bRep != null && material != null)) // borderline...
3602
+ if (//marked || // does not make sense
3603
+ (bRep != null || material != null)) // borderline...
34063604 link2master = h;
34073605
34083606 for (int i = 0; i < Size(); i++)
....@@ -3422,7 +3620,8 @@
34223620 if (blockloop)
34233621 return;
34243622
3425
- if (marked || (bRep != null && material != null)) // borderline...
3623
+ if (//marked || // does not make sense
3624
+ (bRep != null || material != null)) // borderline...
34263625 hide = h;
34273626
34283627 for (int i = 0; i < Size(); i++)
....@@ -3442,7 +3641,7 @@
34423641 if (blockloop)
34433642 return;
34443643
3445
- if (bRep != null && material != null) // borderline...
3644
+ if (bRep != null || material != null) // borderline...
34463645 marked = h;
34473646
34483647 for (int i = 0; i < Size(); i++)
....@@ -3452,6 +3651,46 @@
34523651 continue;
34533652 blockloop = true;
34543653 child.MarkLeaves(h);
3654
+ blockloop = false;
3655
+ // release(i);
3656
+ }
3657
+ }
3658
+
3659
+ void RewindLeaves(boolean h)
3660
+ {
3661
+ if (blockloop)
3662
+ return;
3663
+
3664
+ if (bRep != null || material != null) // borderline...
3665
+ rewind = h;
3666
+
3667
+ for (int i = 0; i < Size(); i++)
3668
+ {
3669
+ Object3D child = (Object3D) get(i); // reserve(i);
3670
+ if (child == null)
3671
+ continue;
3672
+ blockloop = true;
3673
+ child.RewindLeaves(h);
3674
+ blockloop = false;
3675
+ // release(i);
3676
+ }
3677
+ }
3678
+
3679
+ void RandomLeaves(boolean h)
3680
+ {
3681
+ if (blockloop)
3682
+ return;
3683
+
3684
+ if (bRep != null || material != null) // borderline...
3685
+ random = h;
3686
+
3687
+ for (int i = 0; i < Size(); i++)
3688
+ {
3689
+ Object3D child = (Object3D) get(i); // reserve(i);
3690
+ if (child == null)
3691
+ continue;
3692
+ blockloop = true;
3693
+ child.RandomLeaves(h);
34553694 blockloop = false;
34563695 // release(i);
34573696 }
....@@ -4229,6 +4468,55 @@
42294468 }
42304469 }
42314470
4471
+ void RepairSOV()
4472
+ {
4473
+ if (blockloop)
4474
+ return;
4475
+
4476
+ String texname = this.GetPigmentTexture();
4477
+
4478
+ if (texname.startsWith("sov"))
4479
+ {
4480
+ String[] s = texname.split("/");
4481
+
4482
+ String[] sname = s[1].split("Color.pn");
4483
+
4484
+ texname = sname[0];
4485
+
4486
+ if (sname.length > 1)
4487
+ {
4488
+ texname += "Color.jpg";
4489
+ }
4490
+
4491
+ this.SetPigmentTexture("sov/" + texname);
4492
+ }
4493
+
4494
+ texname = this.GetBumpTexture();
4495
+
4496
+ if (texname.startsWith("sov"))
4497
+ {
4498
+ String[] s = texname.split("/");
4499
+
4500
+ String[] sname = s[1].split("Bump.pn");
4501
+
4502
+ texname = sname[0];
4503
+
4504
+ if (sname.length > 1)
4505
+ {
4506
+ texname += "Bump.jpg";
4507
+ }
4508
+
4509
+ this.SetBumpTexture("sov/" + texname);
4510
+ }
4511
+
4512
+ for (int i=0; i<Size(); i++)
4513
+ {
4514
+ blockloop = true;
4515
+ get(i).RepairSOV();
4516
+ blockloop = false;
4517
+ }
4518
+ }
4519
+
42324520 void RepairTexture()
42334521 {
42344522 if (this instanceof FileObject || blockloop)
....@@ -4743,6 +5031,14 @@
47435031 }
47445032 }
47455033
5034
+ ObjEditor GetWindow()
5035
+ {
5036
+ if (editWindow != null)
5037
+ return editWindow;
5038
+
5039
+ return manipWindow;
5040
+ }
5041
+
47465042 cTreePath Select(int indexcount, boolean deselect)
47475043 {
47485044 if (hide || dontselect)
....@@ -4779,10 +5075,11 @@
47795075 if (leaf != null)
47805076 {
47815077 cTreePath tp = new cTreePath(this, leaf);
4782
- if (editWindow != null)
5078
+ ObjEditor window = GetWindow();
5079
+ if (window != null)
47835080 {
47845081 //System.out.println("editWindow = " + editWindow + " vs " + this);
4785
- editWindow.Select(tp, deselect, true);
5082
+ window.Select(tp, deselect, true);
47865083 }
47875084
47885085 return tp;
....@@ -4799,6 +5096,7 @@
47995096
48005097 if (child == null)
48015098 continue;
5099
+
48025100 if (child.HasTransparency() && child.size() != 0)
48035101 {
48045102 cTreePath leaf = child.Select(indexcount, deselect);
....@@ -4808,9 +5106,10 @@
48085106 if (leaf != null)
48095107 {
48105108 cTreePath tp = new cTreePath(this, leaf);
4811
- if (editWindow != null)
5109
+ ObjEditor window = GetWindow();
5110
+ if (window != null)
48125111 {
4813
- editWindow.Select(tp, deselect, true);
5112
+ window.Select(tp, deselect, true);
48145113 }
48155114
48165115 return tp;
....@@ -5135,6 +5434,51 @@
51355434 blockloop = false;
51365435 }
51375436
5437
+ void ResetSelectable()
5438
+ {
5439
+ if (blockloop)
5440
+ return;
5441
+
5442
+ blockloop = true;
5443
+
5444
+ keepdontselect = dontselect;
5445
+ dontselect = true;
5446
+
5447
+ Object3D child;
5448
+ int nb = Size();
5449
+ for (int i = 0; i < nb; i++)
5450
+ {
5451
+ child = (Object3D) get(i);
5452
+ if (child == null)
5453
+ continue;
5454
+ child.ResetSelectable();
5455
+ }
5456
+
5457
+ blockloop = false;
5458
+ }
5459
+
5460
+ void RestoreSelectable()
5461
+ {
5462
+ if (blockloop)
5463
+ return;
5464
+
5465
+ blockloop = true;
5466
+
5467
+ dontselect = keepdontselect;
5468
+
5469
+ Object3D child;
5470
+ int nb = Size();
5471
+ for (int i = 0; i < nb; i++)
5472
+ {
5473
+ child = (Object3D) get(i);
5474
+ if (child == null)
5475
+ continue;
5476
+ child.RestoreSelectable();
5477
+ }
5478
+
5479
+ blockloop = false;
5480
+ }
5481
+
51385482 boolean IsSelected()
51395483 {
51405484 if (parent == null)
....@@ -5371,6 +5715,43 @@
53715715 }
53725716 }
53735717
5718
+ UUID GetUUID()
5719
+ {
5720
+ if (uuid == null)
5721
+ {
5722
+ // Serial
5723
+ uuid = UUID.randomUUID();
5724
+ }
5725
+
5726
+ return uuid;
5727
+ }
5728
+
5729
+ Object3D GetObject(UUID uid)
5730
+ {
5731
+ if (blockloop)
5732
+ return null;
5733
+
5734
+ if (GetUUID().equals(uid))
5735
+ return this;
5736
+
5737
+ int nb = Size();
5738
+ for (int i = 0; i < nb; i++)
5739
+ {
5740
+ Object3D child = (Object3D) get(i);
5741
+
5742
+ if (child == null)
5743
+ continue;
5744
+
5745
+ blockloop = true;
5746
+ Object3D obj = child.GetObject(uid);
5747
+ blockloop = false;
5748
+ if (obj != null)
5749
+ return obj;
5750
+ }
5751
+
5752
+ return null;
5753
+ }
5754
+
53745755 void SetBumpTexture(String tex)
53755756 {
53765757 if (GetTextures() == null)
....@@ -5407,6 +5788,38 @@
54075788 }
54085789 }
54095790
5791
+ void EmbedTextures(boolean embed)
5792
+ {
5793
+ if (blockloop)
5794
+ return;
5795
+
5796
+ //if (GetTextures() != null)
5797
+ if (embed)
5798
+ CameraPane.EmbedTextures(GetTextures());
5799
+ else
5800
+ {
5801
+ GetTextures().pigmentdata = null;
5802
+ GetTextures().bumpdata = null;
5803
+ GetTextures().pw = 0;
5804
+ GetTextures().ph = 0;
5805
+ GetTextures().bw = 0;
5806
+ GetTextures().bh = 0;
5807
+ }
5808
+
5809
+ int nb = Size();
5810
+ for (int i = 0; i < nb; i++)
5811
+ {
5812
+ Object3D child = (Object3D) get(i);
5813
+
5814
+ if (child == null)
5815
+ continue;
5816
+
5817
+ blockloop = true;
5818
+ child.EmbedTextures(embed);
5819
+ blockloop = false;
5820
+ }
5821
+ }
5822
+
54105823 void draw(iCameraPane display, Object3D /*Composite*/ root, boolean selected, boolean blocked)
54115824 {
54125825 Draw(display, root, selected, blocked);
....@@ -5415,12 +5828,23 @@
54155828 boolean NeedSupport()
54165829 {
54175830 return
5418
- CameraPane.SUPPORT && (!CameraPane.movingcamera || !Globals.FREEZEONMOVE) && link2master && /*live &&*/ support != null
5831
+ CameraPane.SUPPORT && (!CameraPane.movingcamera || (!Globals.FREEZEONMOVE && Globals.isLIVE())) && link2master && /*live &&*/ support != null
54195832 // PROBLEM with CROWD!!
54205833 && (Globals.DrawMode() == iCameraPane.SHADOW || !Globals.RENDERSHADOW || Globals.CROWD);
54215834 }
54225835
54235836 static boolean DEBUG_SELECTION = false;
5837
+
5838
+ boolean IsLive()
5839
+ {
5840
+ if (live)
5841
+ return true;
5842
+
5843
+ if (parent == null)
5844
+ return false;
5845
+
5846
+ return parent.IsLive();
5847
+ }
54245848
54255849 void Draw(iCameraPane display, Object3D /*Composite*/ root, boolean selected, boolean blocked)
54265850 {
....@@ -5483,7 +5907,7 @@
54835907 support = support;
54845908
54855909 //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);
5910
+ boolean usecalllists = false; //!IsLive(); // IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null) && !link2master; // !(this instanceof cSpring) && !(this instanceof BezierPatch);
54875911
54885912 if (!usecalllists && bRep != null && bRep.displaylist > 0)
54895913 {
....@@ -5503,10 +5927,12 @@
55035927 boolean selectmode = display.DrawMode() == display.SELECTION || display.IsDebugSelection();
55045928
55055929 if (!selectmode && //display.DrawMode() != display.SELECTION &&
5506
- (touched || (bRep != null && bRep.displaylist <= 0)))
5930
+ //(touched || (bRep != null && bRep.displaylist <= 0)))
5931
+ (Globals.isLIVE() && Globals.COMPUTESHADOWWHENLIVE || touched && Globals.COMPUTESHADOWWHENLIVE)) // || (bRep != null && bRep.displaylist <= 0)))
55075932 {
55085933 Globals.lighttouched = true;
55095934 } // all panes...
5935
+
55105936 //if (usecalllists && display.DrawMode() != display.SELECTION && display.DrawMode() != display.SHADOW &&
55115937 if (bRep != null && usecalllists && !selectmode && // june 2013 display.DrawMode() != display.SHADOW &&
55125938 (touched || (bRep != null && bRep.displaylist <= 0)))
....@@ -5634,6 +6060,7 @@
56346060 if (GetBRep() != null)
56356061 {
56366062 display.NextIndex();
6063
+
56376064 // vertex color conflict : gl.glCallList(list);
56386065 DrawNode(display, root, selected);
56396066 if (this instanceof BezierPatch)
....@@ -5674,16 +6101,27 @@
56746101 tex = GetTextures();
56756102 }
56766103
5677
- boolean failed = false;
6104
+ boolean failedPigment = false;
6105
+ boolean failedBump = false;
56786106
56796107 try
56806108 {
5681
- display.BindTextures(tex, texres);
6109
+ display.BindPigmentTexture(tex, texres);
56826110 }
56836111 catch (Exception e)
56846112 {
56856113 System.err.println("FAILED: " + this);
5686
- failed = true;
6114
+ failedPigment = true;
6115
+ }
6116
+
6117
+ try
6118
+ {
6119
+ display.BindBumpTexture(tex, texres);
6120
+ }
6121
+ catch (Exception e)
6122
+ {
6123
+ //System.err.println("FAILED: " + this);
6124
+ failedBump = true;
56876125 }
56886126
56896127 if (!compiled)
....@@ -5706,8 +6144,11 @@
57066144 }
57076145 }
57086146
5709
- if (!failed)
5710
- display.ReleaseTextures(tex);
6147
+ if (!failedBump)
6148
+ display.ReleaseBumpTexture(tex);
6149
+
6150
+ if (!failedPigment)
6151
+ display.ReleasePigmentTexture(tex);
57116152
57126153 display.PopMaterial(this, selected);
57136154 }
....@@ -6080,6 +6521,11 @@
60806521 // dec 2012
60816522 new Exception().printStackTrace();
60826523 return;
6524
+ }
6525
+
6526
+ if (dontselect)
6527
+ {
6528
+ //bRep.GenerateNormalsMINE();
60836529 }
60846530
60856531 display.DrawGeometry(bRep, flipV, selectmode);
....@@ -6865,20 +7311,23 @@
68657311 }
68667312 }
68677313
6868
- protected void calcHotSpot(cVector in, ClickInfo info, Point outPt, Rectangle outRec)
7314
+ static ClickInfo clickInfo = new ClickInfo();
7315
+
7316
+ protected void calcHotSpot(cVector in, //ClickInfo clickInfo,
7317
+ Point outPt, Rectangle outRec)
68697318 {
6870
- int hc = info.bounds.x + info.bounds.width / 2;
6871
- int vc = info.bounds.y + info.bounds.height / 2;
6872
- double[][] toscreen = info.toScreen;
7319
+ int hc = clickInfo.bounds.x + clickInfo.bounds.width / 2;
7320
+ int vc = clickInfo.bounds.y + clickInfo.bounds.height / 2;
7321
+ double[][] toscreen = clickInfo.toScreen;
68737322 if (toscreen == null)
68747323 {
6875
- toscreen = new Camera(info.camera.viewCode).toScreen;
7324
+ toscreen = new Camera(clickInfo.camera.viewCode).toScreen;
68767325 }
68777326 cVector vec = in;
68787327 LA.xformPos(in, toscreen, in);
68797328 //System.out.println("Distance = " + info.camera.Distance());
6880
- vec.x *= 100 * info.camera.SCALE / info.camera.Distance();
6881
- vec.y *= 100 * info.camera.SCALE / info.camera.Distance();
7329
+ vec.x *= 100 * clickInfo.camera.SCALE / clickInfo.camera.Distance();
7330
+ vec.y *= 100 * clickInfo.camera.SCALE / clickInfo.camera.Distance();
68827331 outPt.x = hc + (int) vec.x;
68837332 outPt.y = vc - (int) vec.y;
68847333 outRec.x = outPt.x - 3;
....@@ -6886,15 +7335,18 @@
68867335 outRec.width = outRec.height = 6;
68877336 }
68887337
6889
- protected Rectangle calcHotSpot(cVector in, ClickInfo info)
7338
+ protected Rectangle calcHotSpot(cVector in//, ClickInfo clickInfo
7339
+ )
68907340 {
68917341 Point pt = new Point(0, 0);
68927342 Rectangle rec = new Rectangle();
6893
- calcHotSpot(in, info, pt, rec);
7343
+ calcHotSpot(in, //clickInfo,
7344
+ pt, rec);
68947345 return rec;
68957346 }
68967347
6897
- void drawEditHandles0(ClickInfo info, int level)
7348
+ void drawEditHandles0(//ClickInfo clickInfo,
7349
+ int level)
68987350 {
68997351 if (level == 0)
69007352 {
....@@ -6903,16 +7355,19 @@
69037355 {
69047356 cVector origin = new cVector();
69057357 //LA.xformPos(origin, toParent, origin);
6906
- Rectangle spot = calcHotSpot(origin, info);
7358
+ if (this.clickInfo == null)
7359
+ this.clickInfo = new ClickInfo();
7360
+
7361
+ Rectangle spot = calcHotSpot(origin); //, clickInfo);
69077362 Rectangle boundary = new Rectangle();
69087363 boundary.x = spot.x - 30;
69097364 boundary.y = spot.y - 30;
69107365 boundary.width = spot.width + 60;
69117366 boundary.height = spot.height + 60;
6912
- info.g.setColor(Color.red);
7367
+ clickInfo.g.setColor(Color.red);
69137368 int spotw = spot.x + spot.width;
69147369 int spoth = spot.y + spot.height;
6915
- info.g.fillRect(spot.x, spot.y, spot.width, spot.height);
7370
+ clickInfo.g.fillRect(spot.x, spot.y, spot.width, spot.height);
69167371 // if (CameraPane.Xmin > spot.x)
69177372 // {
69187373 // CameraPane.Xmin = spot.x;
....@@ -6932,8 +7387,8 @@
69327387 spot.translate(32, 32);
69337388 spotw = spot.x + spot.width;
69347389 spoth = spot.y + spot.height;
6935
- info.g.setColor(Color.blue);
6936
- info.g.fillRect(spot.x, spot.y, spot.width, spot.height);
7390
+ clickInfo.g.setColor(Color.cyan);
7391
+ clickInfo.g.fillRect(spot.x, spot.y, spot.width, spot.height);
69377392 // if (CameraPane.Xmin > spot.x)
69387393 // {
69397394 // CameraPane.Xmin = spot.x;
....@@ -6950,11 +7405,12 @@
69507405 // {
69517406 // CameraPane.Ymax = spoth;
69527407 // }
6953
- info.g.drawLine(spotw, spoth, spotw, spoth - 15);
6954
- info.g.drawLine(spotw, spoth, spotw - 15, spoth);
7408
+ // bonhommes info.g.drawLine(spotw, spoth, spotw, spoth - boundary.height/2); // 15
7409
+ //info.g.drawLine(spotw, spoth, spotw - boundary.width/2, spoth); // 15
69557410 spot.translate(0, -32);
6956
- info.g.setColor(Color.green);
6957
- info.g.fillRect(spot.x, spot.y, spot.width, spot.height);
7411
+ clickInfo.g.setColor(Color.yellow);
7412
+ clickInfo.g.fillRect(spot.x, spot.y, spot.width, spot.height);
7413
+ clickInfo.g.setColor(Color.green);
69587414 // if (CameraPane.Xmin > spot.x)
69597415 // {
69607416 // CameraPane.Xmin = spot.x;
....@@ -6971,8 +7427,8 @@
69717427 // {
69727428 // CameraPane.Ymax = spoth;
69737429 // }
6974
- info.g.drawArc(boundary.x, boundary.y,
6975
- boundary.width, boundary.height, 0, 360);
7430
+ clickInfo.g.drawArc(boundary.x + clickInfo.DX, boundary.y + clickInfo.DY,
7431
+ (int)(boundary.width * clickInfo.W), (int)(boundary.height * clickInfo.W), 0, 360);
69767432 //info.g.drawArc(spot.x, spotw, spot.width/2, boundary.height/2, 0, 360);
69777433 // if (CameraPane.Xmin > boundary.x)
69787434 // {
....@@ -6994,7 +7450,8 @@
69947450 }
69957451 }
69967452
6997
- boolean doEditClick0(ClickInfo info, int level)
7453
+ boolean doEditClick0(//ClickInfo clickInfo,
7454
+ int level)
69987455 {
69997456 if (level == 0)
70007457 {
....@@ -7003,10 +7460,10 @@
70037460
70047461 boolean retval = false;
70057462
7006
- startX = info.x;
7007
- startY = info.y;
7463
+ startX = clickInfo.x;
7464
+ startY = clickInfo.y;
70087465
7009
- hitSomething = 0;
7466
+ hitSomething = -1;
70107467 cVector origin = new cVector();
70117468 //LA.xformPos(origin, toParent, origin);
70127469 Rectangle spot = new Rectangle();
....@@ -7014,22 +7471,51 @@
70147471 {
70157472 centerPt = new Point(0, 0);
70167473 }
7017
- calcHotSpot(origin, info, centerPt, spot);
7018
- if (spot.contains(info.x, info.y))
7474
+ calcHotSpot(origin, //info,
7475
+ centerPt, spot);
7476
+ if (spot.contains(clickInfo.x, clickInfo.y))
70197477 {
70207478 hitSomething = hitCenter;
70217479 retval = true;
70227480 }
70237481 spot.translate(32, 0);
7024
- if (spot.contains(info.x, info.y))
7482
+ if (spot.contains(clickInfo.x, clickInfo.y))
70257483 {
70267484 hitSomething = hitRotate;
70277485 retval = true;
70287486 }
70297487 spot.translate(0, 32);
7030
- if (spot.contains(info.x, info.y))
7488
+ if (spot.contains(clickInfo.x, clickInfo.y))
70317489 {
70327490 hitSomething = hitScale;
7491
+
7492
+ double scale = 0.005f * clickInfo.camera.Distance();
7493
+ double hScale = (double) (clickInfo.x /*- centerPt.x*/) / 32;
7494
+ double sign = 1;
7495
+ if (hScale < 0)
7496
+ {
7497
+ sign = -1;
7498
+ }
7499
+ hScale = sign*Math.pow(sign*hScale, scale * 50);
7500
+ if (hScale < 0.01)
7501
+ {
7502
+ //hScale = 0.01;
7503
+ }
7504
+
7505
+ double vScale = (double) (clickInfo.y /*- centerPt.y*/) / 32;
7506
+ sign = 1;
7507
+ if (vScale < 0)
7508
+ {
7509
+ sign = -1;
7510
+ }
7511
+ vScale = sign*Math.pow(sign*vScale, scale * 50);
7512
+ if (vScale < 0.01)
7513
+ {
7514
+ //vScale = 0.01;
7515
+ }
7516
+
7517
+ clickInfo.scale = Math.sqrt(hScale*hScale + vScale*vScale);
7518
+
70337519 retval = true;
70347520 }
70357521
....@@ -7039,7 +7525,7 @@
70397525 }
70407526
70417527 //System.out.println("info.modifiers = " + info.modifiers);
7042
- modified = (info.modifiers & CameraPane.SHIFT) != 0; // Was META
7528
+ modified = (clickInfo.modifiers & CameraPane.SHIFT) != 0; // Was META
70437529 //System.out.println("modified = " + modified);
70447530 //new Exception().printStackTrace();
70457531 //viewCode = info.pane.renderCamera.viewCode;
....@@ -7067,7 +7553,8 @@
70677553 return true;
70687554 }
70697555
7070
- void doEditDrag0(ClickInfo info, boolean opposite)
7556
+ void doEditDrag0(//ClickInfo info,
7557
+ boolean opposite)
70717558 {
70727559 if (hitSomething == 0)
70737560 {
....@@ -7081,7 +7568,8 @@
70817568
70827569 //System.out.println("hitSomething = " + hitSomething);
70837570
7084
- double scale = 0.005f * info.camera.Distance();
7571
+ double scale = 0.005f * clickInfo.camera.Distance();
7572
+
70857573 cVector xlate = new cVector();
70867574 //cVector xlate2 = new cVector();
70877575 switch (hitSomething)
....@@ -7114,8 +7602,8 @@
71147602 toParent[3][i] = xlate.get(i);
71157603 LA.matInvert(toParent, fromParent);
71167604 */
7117
- cVector delta = LA.newVector(0, 0, startY - info.y);
7118
- LA.xformDir(delta, new Camera(info.camera.viewCode).fromScreen, delta);
7605
+ cVector delta = LA.newVector(0, 0, startY - clickInfo.y);
7606
+ LA.xformDir(delta, new Camera(clickInfo.camera.viewCode).fromScreen, delta);
71197607
71207608 LA.matCopy(startMat, toParent);
71217609 LA.matTranslate(toParent, delta.x * scale, delta.y * scale, delta.z * scale);
....@@ -7124,7 +7612,7 @@
71247612 } else
71257613 {
71267614 //LA.xformDir(delta, info.camera.fromScreen, delta);
7127
- cVector up = new cVector(info.camera.up);
7615
+ cVector up = new cVector(clickInfo.camera.up);
71287616 cVector away = new cVector();
71297617 //cVector right2 = new cVector();
71307618 //LA.vecCross(up, cVector.Z, right);
....@@ -7141,19 +7629,19 @@
71417629 LA.xformDir(up, ClickInfo.matbuffer, up);
71427630 // if (!CameraPane.LOCALTRANSFORM)
71437631 LA.xformDir(up, Globals.theRenderer.RenderCamera().toScreen, up);
7144
- LA.xformDir(info.camera.away, ClickInfo.matbuffer, away);
7632
+ LA.xformDir(clickInfo.camera.away, ClickInfo.matbuffer, away);
71457633 // if (!CameraPane.LOCALTRANSFORM)
71467634 LA.xformDir(away, Globals.theRenderer.RenderCamera().toScreen, away);
71477635 //LA.vecCross(up, cVector.Z, right2);
71487636
7149
- cVector delta = LA.newVector(info.x - startX, startY - info.y, 0);
7637
+ cVector delta = LA.newVector(clickInfo.x - startX, startY - clickInfo.y, 0);
71507638
71517639 //System.out.println("DELTA0 = " + delta);
71527640 //System.out.println("AWAY = " + info.camera.away);
71537641 //System.out.println("UP = " + info.camera.up);
71547642 if (away.z > 0)
71557643 {
7156
- if (info.camera.up.x == 0) // LA.vecDot(right, right2)<0)
7644
+ if (clickInfo.camera.up.x == 0) // LA.vecDot(right, right2)<0)
71577645 {
71587646 delta.x = -delta.x;
71597647 } else
....@@ -7168,7 +7656,7 @@
71687656 //System.out.println("DELTA1 = " + delta);
71697657 LA.xformDir(delta, ClickInfo.matbuffer, delta);
71707658 //System.out.println("DELTA2 = " + delta);
7171
- LA.xformDir(delta, new Camera(info.camera.viewCode).fromScreen, delta);
7659
+ LA.xformDir(delta, new Camera(clickInfo.camera.viewCode).fromScreen, delta);
71727660 LA.matCopy(startMat, toParent);
71737661 //System.out.println("DELTA3 = " + delta);
71747662 LA.matTranslate(toParent, delta.x * scale, delta.y * scale, delta.z * scale);
....@@ -7178,8 +7666,8 @@
71787666 break;
71797667
71807668 case hitRotate: // rotate
7181
- int dx = info.x - centerPt.x;
7182
- int dy = -(info.y - centerPt.y);
7669
+ int dx = clickInfo.x - centerPt.x;
7670
+ int dy = -(clickInfo.y - centerPt.y);
71837671 double angle = (double) Math.atan2(dx, dy);
71847672 angle = -(1.570796 - angle);
71857673
....@@ -7202,7 +7690,7 @@
72027690 }
72037691 /**/
72047692
7205
- switch (info.pane.RenderCamera().viewCode)
7693
+ switch (clickInfo.pane.RenderCamera().viewCode)
72067694 {
72077695 case 1: // '\001'
72087696 LA.matZRotate(toParent, angle);
....@@ -7229,26 +7717,30 @@
72297717 break;
72307718
72317719 case hitScale: // scale
7232
- double hScale = (double) (info.x - centerPt.x) / 32;
7720
+ double hScale = (double) (clickInfo.x /*- centerPt.x*/) / 32;
7721
+ double sign = 1;
7722
+ if (hScale < 0)
7723
+ {
7724
+ sign = -1;
7725
+ }
7726
+ hScale = sign*Math.pow(sign*hScale, scale * 50);
72337727 if (hScale < 0.01)
72347728 {
7235
- hScale = 0.01;
7729
+ //hScale = 0.01;
72367730 }
7237
- hScale = Math.pow(hScale, scale * 50);
7238
- if (hScale < 0.01)
7731
+
7732
+ double vScale = (double) (clickInfo.y /*- centerPt.y*/) / 32;
7733
+ sign = 1;
7734
+ if (vScale < 0)
72397735 {
7240
- hScale = 0.01;
7736
+ sign = -1;
72417737 }
7242
- double vScale = (double) (info.y - centerPt.y) / 32;
7738
+ vScale = sign*Math.pow(sign*vScale, scale * 50);
72437739 if (vScale < 0.01)
72447740 {
7245
- vScale = 0.01;
7741
+ //vScale = 0.01;
72467742 }
7247
- vScale = Math.pow(vScale, scale * 50);
7248
- if (vScale < 0.01)
7249
- {
7250
- vScale = 0.01;
7251
- }
7743
+
72527744 LA.matCopy(startMat, toParent);
72537745 /**/
72547746 for (int i = 0; i < 3; i++)
....@@ -7258,39 +7750,47 @@
72587750 }
72597751 /**/
72607752
7261
- switch (info.pane.RenderCamera().viewCode)
7753
+ double totalScale = Math.sqrt(hScale*hScale + vScale*vScale) / clickInfo.scale;
7754
+
7755
+ if (totalScale < 0.01)
7756
+ {
7757
+ totalScale = 0.01;
7758
+ }
7759
+
7760
+ switch (clickInfo.pane.RenderCamera().viewCode)
72627761 {
72637762 case 3: // '\001'
7264
- if (modified)
7763
+ if (modified || opposite)
72657764 {
72667765 //LA.matScale(toParent, 1, hScale, vScale);
7267
- LA.matScale(toParent, vScale, 1, 1);
7766
+ LA.matScale(toParent, totalScale, 1, 1);
72687767 } // vScale, 1);
72697768 else
72707769 {
7271
- LA.matScale(toParent, vScale, vScale, vScale);
7770
+ // EXCEPTION!
7771
+ LA.matScale(toParent, totalScale, totalScale, totalScale);
72727772 } // vScale, 1);
72737773 break;
72747774
72757775 case 2: // '\002'
7276
- if (modified)
7776
+ if (modified || opposite)
72777777 {
72787778 //LA.matScale(toParent, hScale, 1, vScale);
7279
- LA.matScale(toParent, 1, vScale, 1);
7779
+ LA.matScale(toParent, 1, totalScale, 1);
72807780 } else
72817781 {
7282
- LA.matScale(toParent, vScale, 1, vScale);
7782
+ LA.matScale(toParent, totalScale, 1, totalScale);
72837783 }
72847784 break;
72857785
72867786 case 1: // '\003'
7287
- if (modified)
7787
+ if (modified || opposite)
72887788 {
72897789 //LA.matScale(toParent, hScale, vScale, 1);
7290
- LA.matScale(toParent, 1, 1, vScale);
7790
+ LA.matScale(toParent, 1, 1, totalScale);
72917791 } else
72927792 {
7293
- LA.matScale(toParent, vScale, vScale, 1);
7793
+ LA.matScale(toParent, totalScale, totalScale, 1);
72947794 }
72957795 break;
72967796 }
....@@ -7324,7 +7824,7 @@
73247824 } // NEW ...
73257825
73267826
7327
- info.pane.repaint();
7827
+ clickInfo.pane.repaint();
73287828 }
73297829
73307830 boolean overflow = false;
....@@ -7431,7 +7931,7 @@
74317931 objname = name + " " + System.identityHashCode(this) + " (" + parent.name + " " + System.identityHashCode(parent) + ")";
74327932 } else
74337933 {
7434
- objname = GetName() + (Math.abs(count) == 1000 ? (count == 1000 ? " " : " * ") : (" (" + (count /*- 1*/) + ")")) + /*(IsSelected()?"(selected) ":"") + (touched?"(touched) ":"") */ "";
7934
+ objname = GetName() + (Math.abs(count) == 1000 ? (count == 1000 ? " " : " * ") : (" (" + (count - 1) + ")")) + /*(IsSelected()?"(selected) ":"") + (touched?"(touched) ":"") */ "";
74357935 } // + super.toString();
74367936 //return name + " (" + (SizeOf.deepSizeOf(this)/1024) + "K) " + this.getClass().getName();
74377937
....@@ -7504,6 +8004,10 @@
75048004 editWindow = null;
75058005 } // ?
75068006 }
8007
+ else
8008
+ {
8009
+ //editWindow.closeUI();
8010
+ }
75078011 }
75088012
75098013 boolean root; // patch for edit windows
....@@ -7515,7 +8019,7 @@
75158019 /*transient*/ cVector2[] projectedVertices = new cVector2[0];
75168020
75178021 Object3D /*Composite*/ parent;
7518
- Object3D /*Composite*/ fileparent;
8022
+ Object3D /*Composite*/ fileparent; // In the case of FileObject
75198023
75208024 double[][] toParent; // dynamic matrix
75218025 double[][] fromParent;
....@@ -7661,6 +8165,10 @@
76618165 }
76628166
76638167 transient ObjEditor editWindow;
8168
+ transient ObjEditor manipWindow;
8169
+
8170
+ transient boolean pinned;
8171
+
76648172 transient ObjectUI objectUI;
76658173 public static int povDepth = 0;
76668174 private static cVector tbMin = new cVector();
....@@ -7679,9 +8187,9 @@
76798187 private static cVector edge2 = new cVector();
76808188 //private static cVector norm = new cVector();
76818189 /*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;
8190
+ static final int hitCenter = 1;
8191
+ static final int hitScale = 2;
8192
+ static final int hitRotate = 3;
76858193 /*transient*/ /*private*/ int viewCode; // Now used for transparency cache flag
76868194 /*transient*/ private Point centerPt;
76878195 /*transient*/ private int startX;