Normand Briere
2019-08-13 c67de8aca04d988179191ccb52461af00125920e
Object3D.java
....@@ -22,8 +22,20 @@
2222 //static final long serialVersionUID = -607422624994562685L;
2323 static final long serialVersionUID = 5022536242724664900L;
2424
25
+ // Use GetUUID for backward compatibility with null.
2526 private UUID uuid = UUID.randomUUID();
2627
28
+ // TEMPORARY for mocap undo. No need to be transient.
29
+ mocap.reader.BVHReader.BVHResult savebvh;
30
+ Object3D saveskeleton;
31
+ //
32
+
33
+ String skyboxname;
34
+ String skyboxext;
35
+
36
+ Object3D versionlist[];
37
+ int versionindex = -1;
38
+
2739 ScriptNode scriptnode;
2840
2941 void InitOthers()
....@@ -104,117 +116,201 @@
104116
105117 // transient boolean reduced; // for morph reduction
106118
107
-transient com.bulletphysics.linearmath.Transform cache; // for fast merge
108
-transient com.bulletphysics.linearmath.Transform cache_1; // for fast merge
119
+ transient com.bulletphysics.linearmath.Transform cache; // for fast merge
120
+ transient com.bulletphysics.linearmath.Transform cache_1; // for fast merge
109121
110
-transient Object3D transientsupport; // for cloning
111
-transient boolean transientlink2master;
122
+ transient Object3D transientsupport; // for cloning
123
+ transient boolean transientlink2master;
112124
113
-void SaveSupports()
114
-{
115
- if (blockloop)
116
- return;
117
-
118
- transientsupport = support;
119
- transientlink2master = link2master;
120
-
121
- support = null;
122
- link2master = false;
123
-
124
- if (bRep != null)
125
+ void SaveSupports()
125126 {
126
- bRep.SaveSupports();
127
+ if (blockloop)
128
+ return;
129
+
130
+ transientsupport = support;
131
+ transientlink2master = link2master;
132
+
133
+ support = null;
134
+ link2master = false;
135
+
136
+ if (bRep != null)
137
+ {
138
+ bRep.SaveSupports();
139
+ }
140
+
141
+ for (int i = 0; i < Size(); i++)
142
+ {
143
+ Object3D child = (Object3D) get(i);
144
+ if (child == null)
145
+ continue;
146
+ blockloop = true;
147
+ child.SaveSupports();
148
+ blockloop = false;
149
+ }
127150 }
128
-
129
- for (int i = 0; i < Size(); i++)
151
+
152
+ void RestoreSupports()
130153 {
131
- Object3D child = (Object3D) get(i);
132
- if (child == null)
133
- continue;
154
+ if (blockloop)
155
+ return;
156
+
157
+ support = transientsupport;
158
+ link2master = transientlink2master;
159
+ transientsupport = null;
160
+ transientlink2master = false;
161
+
162
+ if (bRep != null)
163
+ {
164
+ bRep.RestoreSupports();
165
+ }
166
+
167
+ for (int i = 0; i < Size(); i++)
168
+ {
169
+ Object3D child = (Object3D) get(i);
170
+ if (child == null)
171
+ continue;
172
+ blockloop = true;
173
+ child.RestoreSupports();
174
+ blockloop = false;
175
+ }
176
+ }
177
+
178
+ void ExtractBigData(java.util.Hashtable<java.util.UUID, Object3D> hashtable)
179
+ {
180
+ Object3D o;
181
+
182
+ if (hashtable.containsKey(GetUUID()))
183
+ {
184
+ o = hashtable.get(GetUUID());
185
+
186
+ Grafreed.Assert(this.bRep == o.bRep);
187
+ //if (this.bRep != null)
188
+ // assert(this.bRep.support == o.transientrep);
189
+ if (this.support != null)
190
+ assert(this.support.bRep == o.transientrep);
191
+ }
192
+ else
193
+ {
194
+ o = new Object3D("copy of " + this.name);
195
+
196
+ hashtable.put(GetUUID(), o);
197
+ }
198
+
199
+ if (!blockloop)
200
+ {
201
+ blockloop = true;
202
+
203
+ for (int i=0; i<Size(); i++)
204
+ {
205
+ get(i).ExtractBigData(hashtable);
206
+ }
207
+
208
+ blockloop = false;
209
+ }
210
+
211
+ ExtractBigData(o);
212
+ }
213
+
214
+ void ExtractBigData(Object3D o)
215
+ {
216
+ if (o.bRep != null)
217
+ Grafreed.Assert(o.bRep == this.bRep);
218
+
219
+ o.bRep = this.bRep;
220
+// July 2019 if (this.bRep != null)
221
+// {
222
+// o.transientrep = this.bRep.support;
223
+// o.bRep.support = null;
224
+// }
225
+ o.selection = this.selection;
226
+ o.versionlist = this.versionlist;
227
+ o.versionindex = this.versionindex;
228
+
229
+ if (this.support != null)
230
+ {
231
+ if (o.transientrep != null)
232
+ Grafreed.Assert(o.transientrep == this.support.bRep);
233
+
234
+ o.transientrep = this.support.bRep;
235
+ this.support.bRep = null;
236
+ }
237
+
238
+ // o.support = this.support;
239
+ // o.fileparent = this.fileparent;
240
+ // if (this.bRep != null)
241
+ // o.bRep = this.bRep.support;
242
+
243
+ this.bRep = null;
244
+ // if (this.bRep != null)
245
+ // this.bRep.support = null;
246
+ // this.support = null;
247
+ // this.fileparent = null;
248
+ }
249
+
250
+// Object3D GetObject(java.util.UUID uuid)
251
+// {
252
+// if (this.uuid.equals(uuid))
253
+// return this;
254
+//
255
+// if (blockloop)
256
+// return null;
257
+//
258
+// blockloop = true;
259
+//
260
+// for (int i=0; i<Size(); i++)
261
+// {
262
+// Object3D o = get(i).GetObject(uuid);
263
+//
264
+// if (o != null)
265
+// return o;
266
+// }
267
+//
268
+// blockloop = false;
269
+//
270
+// return null;
271
+// }
272
+
273
+ void RestoreBigData(java.util.Hashtable<java.util.UUID, Object3D> hashtable)
274
+ {
275
+ if (!hashtable.containsKey(GetUUID()))
276
+ return;
277
+
278
+ Object3D o = hashtable.get(GetUUID());
279
+
280
+ RestoreBigData(o);
281
+
282
+ if (blockloop)
283
+ return;
284
+
134285 blockloop = true;
135
- child.SaveSupports();
286
+
287
+ //hashtable.remove(GetUUID());
288
+
289
+ for (int i=0; i<Size(); i++)
290
+ {
291
+ get(i).RestoreBigData(hashtable);
292
+ }
293
+
136294 blockloop = false;
137295 }
138
-}
139296
140
-void RestoreSupports()
141
-{
142
- if (blockloop)
143
- return;
144
-
145
- support = transientsupport;
146
- link2master = transientlink2master;
147
- transientsupport = null;
148
- transientlink2master = false;
149
-
150
- if (bRep != null)
297
+ void RestoreBigData(Object3D o)
151298 {
152
- bRep.RestoreSupports();
299
+ this.bRep = o.bRep;
300
+ if (this.support != null && o.transientrep != null)
301
+ {
302
+ this.support.bRep = o.transientrep;
303
+ }
304
+
305
+ this.selection = o.selection;
306
+
307
+ this.versionlist = o.versionlist;
308
+ this.versionindex = o.versionindex;
309
+// July 2019 if (this.bRep != null)
310
+// this.bRep.support = o.transientrep;
311
+ // this.support = o.support;
312
+ // this.fileparent = o.fileparent;
153313 }
154
-
155
- for (int i = 0; i < Size(); i++)
156
- {
157
- Object3D child = (Object3D) get(i);
158
- if (child == null)
159
- continue;
160
- blockloop = true;
161
- child.RestoreSupports();
162
- blockloop = false;
163
- }
164
-}
165
-
166
-void ExtractBigData(java.util.Hashtable<java.util.UUID, Object3D> hashtable)
167
-{
168
- if (hashtable.containsKey(GetUUID()))
169
- return;
170
-
171
- Object3D o = new Object3D();
172
- o.bRep = this.bRep;
173
- if (this.bRep != null)
174
- {
175
- o.transientrep = this.bRep.support;
176
- o.bRep.support = null;
177
- }
178
-
179
-// o.support = this.support;
180
-// o.fileparent = this.fileparent;
181
-// if (this.bRep != null)
182
-// o.bRep = this.bRep.support;
183
-
184
- hashtable.put(GetUUID(), o);
185
-
186
- this.bRep = null;
187
-// if (this.bRep != null)
188
-// this.bRep.support = null;
189
-// this.support = null;
190
-// this.fileparent = null;
191
-
192
- for (int i=0; i<Size(); i++)
193
- {
194
- get(i).ExtractBigData(hashtable);
195
- }
196
-}
197
-
198
-void RestoreBigData(java.util.Hashtable<java.util.UUID, Object3D> hashtable)
199
-{
200
- if (!hashtable.containsKey(GetUUID()))
201
- return;
202
-
203
- Object3D o = hashtable.get(GetUUID());
204
-
205
- this.bRep = o.bRep;
206
- if (this.bRep != null)
207
- this.bRep.support = o.transientrep;
208
-// this.support = o.support;
209
-// this.fileparent = o.fileparent;
210
-
211
- hashtable.remove(GetUUID());
212
-
213
- for (int i=0; i<Size(); i++)
214
- {
215
- get(i).RestoreBigData(hashtable);
216
- }
217
-}
218314
219315 // MOCAP SUPPORT
220316 double tx,ty,tz,rx,ry,rz;
....@@ -357,6 +453,7 @@
357453 }
358454
359455 boolean live = false;
456
+ transient boolean keepdontselect;
360457 boolean dontselect = false;
361458 boolean hide = false;
362459 boolean link2master = false; // performs reset support/master at each frame
....@@ -539,12 +636,14 @@
539636 toParent = LA.newMatrix();
540637 fromParent = LA.newMatrix();
541638 }
639
+
542640 if (toParentMarked == null)
543641 {
544642 if (maxcount != 1)
545643 {
546644 new Exception().printStackTrace();
547645 }
646
+
548647 toParentMarked = LA.newMatrix();
549648 fromParentMarked = LA.newMatrix();
550649 }
....@@ -855,7 +954,7 @@
855954
856955 if (marked && Globals.isLIVE() && live &&
857956 //TEMP21aug2018
858
- (Globals.DrawMode() == iCameraPane.SHADOW || !Globals.RENDERSHADOW) &&
957
+ (Globals.DrawMode() == iCameraPane.SHADOW || !Globals.RENDERSHADOW || !Globals.COMPUTESHADOWWHENLIVE) &&
859958 currentframe != Globals.framecount)
860959 {
861960 currentframe = Globals.framecount;
....@@ -867,7 +966,8 @@
867966
868967 boolean changedir = random && Math.random() < 0.01; // && !link2master;
869968
870
- if (transformcount*factor > maxcount || (step == 1 && changedir))
969
+ if (transformcount*factor >= maxcount && (rewind || random) ||
970
+ (step == 1 && changedir))
871971 {
872972 countdown = 1;
873973 delay = speedup?8:1;
....@@ -939,6 +1039,10 @@
9391039 if (material == null || material.multiply)
9401040 return true;
9411041
1042
+ if (projectedVertices != null && projectedVertices.length > 2 && projectedVertices[2].y >= 10000)
1043
+ return false;
1044
+
1045
+ // Transparent objects are dynamic because we have to sort the triangles.
9421046 return material.opacity > 0.99;
9431047 }
9441048
....@@ -1339,6 +1443,7 @@
13391443 toParent = LA.newMatrix();
13401444 fromParent = LA.newMatrix();
13411445 }
1446
+
13421447 LA.matCopy(other.toParent, toParent);
13431448 LA.matCopy(other.fromParent, fromParent);
13441449
....@@ -2360,6 +2465,15 @@
23602465 }
23612466 */
23622467 }
2468
+ else
2469
+ {
2470
+ //((ObjEditor)editWindow).SetupUI2(null);
2471
+ if (objectUI != null)
2472
+ ((ObjEditor)objectUI).pinButton.setSelected(pinned);
2473
+ else
2474
+ //new Exception().printStackTrace();
2475
+ System.err.println("objectUI is null");
2476
+ }
23632477 }
23642478
23652479 void createEditWindow(GroupEditor callee, boolean newWindow) //, boolean root)
....@@ -2401,6 +2515,14 @@
24012515 {
24022516 editWindow.refreshContents();
24032517 }
2518
+ else
2519
+ {
2520
+ if (manipWindow != null)
2521
+ {
2522
+ manipWindow.refreshContents();
2523
+ }
2524
+ }
2525
+
24042526 //if (parent != null)
24052527 //parent.refreshEditWindow();
24062528 }
....@@ -2480,7 +2602,8 @@
24802602 private static final int editSelf = 1;
24812603 private static final int editChild = 2;
24822604
2483
- void drawEditHandles(ClickInfo info, int level)
2605
+ void drawEditHandles(//ClickInfo info,
2606
+ int level)
24842607 {
24852608 if (level == 0)
24862609 {
....@@ -2488,7 +2611,8 @@
24882611 return;
24892612
24902613 Object3D selectee;
2491
- for (java.util.Enumeration e = selection.elements(); e.hasMoreElements(); selectee.drawEditHandles(info, level + 1))
2614
+ for (java.util.Enumeration e = selection.elements(); e.hasMoreElements(); selectee.drawEditHandles(//info,
2615
+ level + 1))
24922616 {
24932617 selectee = (Object3D) e.nextElement();
24942618 }
....@@ -2496,19 +2620,22 @@
24962620 } else
24972621 {
24982622 //super.
2499
- drawEditHandles0(info, level + 1);
2623
+ drawEditHandles0(//info,
2624
+ level + 1);
25002625 }
25012626 }
25022627
2503
- boolean doEditClick(ClickInfo info, int level)
2628
+ boolean doEditClick(//ClickInfo info,
2629
+ int level)
25042630 {
25052631 doSomething = 0;
25062632 if (level == 0)
25072633 {
2508
- return doParentClick(info);
2634
+ return doParentClick(); //info);
25092635 }
25102636 if (//super.
2511
- doEditClick0(info, level))
2637
+ doEditClick0(//info,
2638
+ level))
25122639 {
25132640 doSomething = 1;
25142641 return true;
....@@ -2518,7 +2645,7 @@
25182645 }
25192646 }
25202647
2521
- boolean doParentClick(ClickInfo info)
2648
+ boolean doParentClick() //ClickInfo info)
25222649 {
25232650 if (selection == null)
25242651 {
....@@ -2531,7 +2658,8 @@
25312658 for (java.util.Enumeration e = selection.elements(); e.hasMoreElements();)
25322659 {
25332660 Object3D selectee = (Object3D) e.nextElement();
2534
- if (selectee.doEditClick(info, 1))
2661
+ if (selectee.doEditClick(//info,
2662
+ 1))
25352663 {
25362664 childToDrag = selectee;
25372665 doSomething = 2;
....@@ -2543,13 +2671,15 @@
25432671 return retval;
25442672 }
25452673
2546
- void doEditDrag(ClickInfo info, boolean opposite)
2674
+ void doEditDrag(//ClickInfo clickInfo,
2675
+ boolean opposite)
25472676 {
25482677 switch (doSomething)
25492678 {
25502679 case 1: // '\001'
25512680 //super.
2552
- doEditDrag0(info, opposite);
2681
+ doEditDrag0(//clickInfo,
2682
+ opposite);
25532683 break;
25542684
25552685 case 2: // '\002'
....@@ -2562,11 +2692,13 @@
25622692 {
25632693 //sel.hitSomething = childToDrag.hitSomething;
25642694 //childToDrag.doEditDrag(info);
2565
- sel.doEditDrag(info, opposite);
2695
+ sel.doEditDrag(//clickInfo,
2696
+ opposite);
25662697 } else
25672698 {
25682699 //super.
2569
- doEditDrag0(info, opposite);
2700
+ doEditDrag0(//clickInfo,
2701
+ opposite);
25702702 }
25712703 }
25722704 break;
....@@ -2584,6 +2716,9 @@
25842716 {
25852717 deselectAll();
25862718 }
2719
+
2720
+ new Exception().printStackTrace();
2721
+
25872722 ClickInfo newInfo = new ClickInfo();
25882723 newInfo.flags = info.flags;
25892724 newInfo.bounds = info.bounds;
....@@ -2676,6 +2811,18 @@
26762811 void GenNormalsS(boolean crease)
26772812 {
26782813 selection.GenNormals(crease);
2814
+// for (int i=0; i<selection.size(); i++)
2815
+// {
2816
+// Object3D selectee = (Object3D) selection.elementAt(i);
2817
+// selectee.GenNormals(crease);
2818
+// }
2819
+
2820
+ //Touch();
2821
+ }
2822
+
2823
+ void GenNormalsMeshS()
2824
+ {
2825
+ selection.GenNormalsMesh();
26792826 // for (int i=0; i<selection.size(); i++)
26802827 // {
26812828 // Object3D selectee = (Object3D) selection.elementAt(i);
....@@ -2816,6 +2963,24 @@
28162963 if (child == null)
28172964 continue;
28182965 child.GenNormals(crease);
2966
+// Children().release(i);
2967
+ }
2968
+ blockloop = false;
2969
+ }
2970
+
2971
+ void GenNormalsMesh()
2972
+ {
2973
+ if (blockloop)
2974
+ return;
2975
+
2976
+ blockloop = true;
2977
+ GenNormalsMesh0();
2978
+ for (int i = 0; i < Children().Size(); i++)
2979
+ {
2980
+ Object3D child = (Object3D) Children().get(i); // reserve(i);
2981
+ if (child == null)
2982
+ continue;
2983
+ child.GenNormalsMesh();
28192984 // Children().release(i);
28202985 }
28212986 blockloop = false;
....@@ -2988,11 +3153,20 @@
29883153 }
29893154 }
29903155
3156
+ void GenNormalsMesh0()
3157
+ {
3158
+ if (bRep != null)
3159
+ {
3160
+ bRep.GenerateNormalsMesh();
3161
+ Touch();
3162
+ }
3163
+ }
3164
+
29913165 void GenNormalsMINE0()
29923166 {
29933167 if (bRep != null)
29943168 {
2995
- bRep.GenerateNormalsMINE();
3169
+ bRep.MergeNormals(); //.GenerateNormalsMINE();
29963170 Touch();
29973171 }
29983172 }
....@@ -3438,7 +3612,8 @@
34383612 if (blockloop)
34393613 return;
34403614
3441
- if (marked || (bRep != null && material != null)) // borderline...
3615
+ if (//marked || // does not make sense
3616
+ (bRep != null || material != null)) // borderline...
34423617 live = h;
34433618
34443619 for (int i = 0; i < Size(); i++)
....@@ -3459,7 +3634,8 @@
34593634 return;
34603635
34613636 //if (bRep != null)
3462
- if (marked || (bRep != null && material != null)) // borderline...
3637
+ if (//marked || // does not make sense
3638
+ (bRep != null || material != null)) // borderline...
34633639 link2master = h;
34643640
34653641 for (int i = 0; i < Size(); i++)
....@@ -3479,7 +3655,8 @@
34793655 if (blockloop)
34803656 return;
34813657
3482
- if (marked || (bRep != null && material != null)) // borderline...
3658
+ if (//marked || // does not make sense
3659
+ (bRep != null || material != null)) // borderline...
34833660 hide = h;
34843661
34853662 for (int i = 0; i < Size(); i++)
....@@ -3499,7 +3676,7 @@
34993676 if (blockloop)
35003677 return;
35013678
3502
- if (bRep != null && material != null) // borderline...
3679
+ if (bRep != null || material != null) // borderline...
35033680 marked = h;
35043681
35053682 for (int i = 0; i < Size(); i++)
....@@ -3509,6 +3686,46 @@
35093686 continue;
35103687 blockloop = true;
35113688 child.MarkLeaves(h);
3689
+ blockloop = false;
3690
+ // release(i);
3691
+ }
3692
+ }
3693
+
3694
+ void RewindLeaves(boolean h)
3695
+ {
3696
+ if (blockloop)
3697
+ return;
3698
+
3699
+ if (bRep != null || material != null) // borderline...
3700
+ rewind = h;
3701
+
3702
+ for (int i = 0; i < Size(); i++)
3703
+ {
3704
+ Object3D child = (Object3D) get(i); // reserve(i);
3705
+ if (child == null)
3706
+ continue;
3707
+ blockloop = true;
3708
+ child.RewindLeaves(h);
3709
+ blockloop = false;
3710
+ // release(i);
3711
+ }
3712
+ }
3713
+
3714
+ void RandomLeaves(boolean h)
3715
+ {
3716
+ if (blockloop)
3717
+ return;
3718
+
3719
+ if (bRep != null || material != null) // borderline...
3720
+ random = h;
3721
+
3722
+ for (int i = 0; i < Size(); i++)
3723
+ {
3724
+ Object3D child = (Object3D) get(i); // reserve(i);
3725
+ if (child == null)
3726
+ continue;
3727
+ blockloop = true;
3728
+ child.RandomLeaves(h);
35123729 blockloop = false;
35133730 // release(i);
35143731 }
....@@ -4286,6 +4503,55 @@
42864503 }
42874504 }
42884505
4506
+ void RepairSOV()
4507
+ {
4508
+ if (blockloop)
4509
+ return;
4510
+
4511
+ String texname = this.GetPigmentTexture();
4512
+
4513
+ if (texname.startsWith("sov"))
4514
+ {
4515
+ String[] s = texname.split("/");
4516
+
4517
+ String[] sname = s[1].split("Color.pn");
4518
+
4519
+ texname = sname[0];
4520
+
4521
+ if (sname.length > 1)
4522
+ {
4523
+ texname += "Color.jpg";
4524
+ }
4525
+
4526
+ this.SetPigmentTexture("sov/" + texname);
4527
+ }
4528
+
4529
+ texname = this.GetBumpTexture();
4530
+
4531
+ if (texname.startsWith("sov"))
4532
+ {
4533
+ String[] s = texname.split("/");
4534
+
4535
+ String[] sname = s[1].split("Bump.pn");
4536
+
4537
+ texname = sname[0];
4538
+
4539
+ if (sname.length > 1)
4540
+ {
4541
+ texname += "Bump.jpg";
4542
+ }
4543
+
4544
+ this.SetBumpTexture("sov/" + texname);
4545
+ }
4546
+
4547
+ for (int i=0; i<Size(); i++)
4548
+ {
4549
+ blockloop = true;
4550
+ get(i).RepairSOV();
4551
+ blockloop = false;
4552
+ }
4553
+ }
4554
+
42894555 void RepairTexture()
42904556 {
42914557 if (this instanceof FileObject || blockloop)
....@@ -4800,6 +5066,14 @@
48005066 }
48015067 }
48025068
5069
+ ObjEditor GetWindow()
5070
+ {
5071
+ if (editWindow != null)
5072
+ return editWindow;
5073
+
5074
+ return manipWindow;
5075
+ }
5076
+
48035077 cTreePath Select(int indexcount, boolean deselect)
48045078 {
48055079 if (hide || dontselect)
....@@ -4836,10 +5110,11 @@
48365110 if (leaf != null)
48375111 {
48385112 cTreePath tp = new cTreePath(this, leaf);
4839
- if (editWindow != null)
5113
+ ObjEditor window = GetWindow();
5114
+ if (window != null)
48405115 {
48415116 //System.out.println("editWindow = " + editWindow + " vs " + this);
4842
- editWindow.Select(tp, deselect, true);
5117
+ window.Select(tp, deselect, true);
48435118 }
48445119
48455120 return tp;
....@@ -4856,6 +5131,7 @@
48565131
48575132 if (child == null)
48585133 continue;
5134
+
48595135 if (child.HasTransparency() && child.size() != 0)
48605136 {
48615137 cTreePath leaf = child.Select(indexcount, deselect);
....@@ -4865,9 +5141,10 @@
48655141 if (leaf != null)
48665142 {
48675143 cTreePath tp = new cTreePath(this, leaf);
4868
- if (editWindow != null)
5144
+ ObjEditor window = GetWindow();
5145
+ if (window != null)
48695146 {
4870
- editWindow.Select(tp, deselect, true);
5147
+ window.Select(tp, deselect, true);
48715148 }
48725149
48735150 return tp;
....@@ -5192,6 +5469,51 @@
51925469 blockloop = false;
51935470 }
51945471
5472
+ void ResetSelectable()
5473
+ {
5474
+ if (blockloop)
5475
+ return;
5476
+
5477
+ blockloop = true;
5478
+
5479
+ keepdontselect = dontselect;
5480
+ dontselect = true;
5481
+
5482
+ Object3D child;
5483
+ int nb = Size();
5484
+ for (int i = 0; i < nb; i++)
5485
+ {
5486
+ child = (Object3D) get(i);
5487
+ if (child == null)
5488
+ continue;
5489
+ child.ResetSelectable();
5490
+ }
5491
+
5492
+ blockloop = false;
5493
+ }
5494
+
5495
+ void RestoreSelectable()
5496
+ {
5497
+ if (blockloop)
5498
+ return;
5499
+
5500
+ blockloop = true;
5501
+
5502
+ dontselect = keepdontselect;
5503
+
5504
+ Object3D child;
5505
+ int nb = Size();
5506
+ for (int i = 0; i < nb; i++)
5507
+ {
5508
+ child = (Object3D) get(i);
5509
+ if (child == null)
5510
+ continue;
5511
+ child.RestoreSelectable();
5512
+ }
5513
+
5514
+ blockloop = false;
5515
+ }
5516
+
51955517 boolean IsSelected()
51965518 {
51975519 if (parent == null)
....@@ -5501,6 +5823,38 @@
55015823 }
55025824 }
55035825
5826
+ void EmbedTextures(boolean embed)
5827
+ {
5828
+ if (blockloop)
5829
+ return;
5830
+
5831
+ //if (GetTextures() != null)
5832
+ if (embed)
5833
+ CameraPane.EmbedTextures(GetTextures());
5834
+ else
5835
+ {
5836
+ GetTextures().pigmentdata = null;
5837
+ GetTextures().bumpdata = null;
5838
+ GetTextures().pw = 0;
5839
+ GetTextures().ph = 0;
5840
+ GetTextures().bw = 0;
5841
+ GetTextures().bh = 0;
5842
+ }
5843
+
5844
+ int nb = Size();
5845
+ for (int i = 0; i < nb; i++)
5846
+ {
5847
+ Object3D child = (Object3D) get(i);
5848
+
5849
+ if (child == null)
5850
+ continue;
5851
+
5852
+ blockloop = true;
5853
+ child.EmbedTextures(embed);
5854
+ blockloop = false;
5855
+ }
5856
+ }
5857
+
55045858 void draw(iCameraPane display, Object3D /*Composite*/ root, boolean selected, boolean blocked)
55055859 {
55065860 Draw(display, root, selected, blocked);
....@@ -5509,12 +5863,23 @@
55095863 boolean NeedSupport()
55105864 {
55115865 return
5512
- CameraPane.SUPPORT && (!CameraPane.movingcamera || !Globals.FREEZEONMOVE) && link2master && /*live &&*/ support != null
5866
+ CameraPane.SUPPORT && (!CameraPane.movingcamera || (!Globals.FREEZEONMOVE && Globals.isLIVE())) && link2master && /*live &&*/ support != null
55135867 // PROBLEM with CROWD!!
55145868 && (Globals.DrawMode() == iCameraPane.SHADOW || !Globals.RENDERSHADOW || Globals.CROWD);
55155869 }
55165870
55175871 static boolean DEBUG_SELECTION = false;
5872
+
5873
+ boolean IsLive()
5874
+ {
5875
+ if (live)
5876
+ return true;
5877
+
5878
+ if (parent == null)
5879
+ return false;
5880
+
5881
+ return parent.IsLive();
5882
+ }
55185883
55195884 void Draw(iCameraPane display, Object3D /*Composite*/ root, boolean selected, boolean blocked)
55205885 {
....@@ -5576,8 +5941,10 @@
55765941 if (support != null)
55775942 support = support;
55785943
5579
- //boolean usecalllists = IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null || !link2master); // !(this instanceof cSpring) && !(this instanceof BezierPatch);
5580
- boolean usecalllists = false; // IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null) && !link2master; // !(this instanceof cSpring) && !(this instanceof BezierPatch);
5944
+ boolean usecalllists = !IsLive() && IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null || !link2master); // !(this instanceof cSpring) && !(this instanceof BezierPatch);
5945
+ //boolean usecalllists = false; //!IsLive(); // IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null) && !link2master; // !(this instanceof cSpring) && !(this instanceof BezierPatch);
5946
+
5947
+ //usecalllists &= display.DrawMode() == display.DEFAULT; // Don't compute list in shadow pass.
55815948
55825949 if (!usecalllists && bRep != null && bRep.displaylist > 0)
55835950 {
....@@ -5587,8 +5954,9 @@
55875954 // usecalllists &= !(parent instanceof RandomNode);
55885955 // usecalllists = false;
55895956
5590
- if (GetBRep() != null)
5591
- usecalllists = usecalllists;
5957
+ if (display.DrawMode() == display.SHADOW)
5958
+ //GetBRep() != null)
5959
+ usecalllists = !!usecalllists;
55925960 //System.out.println("draw " + this);
55935961 //new Exception().printStackTrace();
55945962
....@@ -5597,10 +5965,12 @@
55975965 boolean selectmode = display.DrawMode() == display.SELECTION || display.IsDebugSelection();
55985966
55995967 if (!selectmode && //display.DrawMode() != display.SELECTION &&
5600
- (touched || (bRep != null && bRep.displaylist <= 0)))
5968
+ //(touched || (bRep != null && bRep.displaylist <= 0)))
5969
+ (Globals.isLIVE() && Globals.COMPUTESHADOWWHENLIVE || touched && Globals.COMPUTESHADOWWHENLIVE)) // || (bRep != null && bRep.displaylist <= 0)))
56015970 {
56025971 Globals.lighttouched = true;
56035972 } // all panes...
5973
+
56045974 //if (usecalllists && display.DrawMode() != display.SELECTION && display.DrawMode() != display.SHADOW &&
56055975 if (bRep != null && usecalllists && !selectmode && // june 2013 display.DrawMode() != display.SHADOW &&
56065976 (touched || (bRep != null && bRep.displaylist <= 0)))
....@@ -5608,7 +5978,7 @@
56085978 if (!(this instanceof Composite))
56095979 touched = false;
56105980 //if (displaylist == -1 && usecalllists)
5611
- if ((bRep != null && bRep.displaylist <= 0) && usecalllists) // june 2013
5981
+ if (bRep.displaylist <= 0 && usecalllists) // && display.DrawMode() == display.DEFAULT) // june 2013
56125982 {
56135983 bRep.displaylist = display.GenList();
56145984 assert(bRep.displaylist != 0);
....@@ -5619,7 +5989,7 @@
56195989
56205990 //System.out.println("\tnew list " + list);
56215991 //gl.glDrawBuffer(gl.GL_NONE);
5622
- if (usecalllists)
5992
+ if (usecalllists && bRep.displaylist > 0)
56235993 {
56245994 // System.err.println("new list " + bRep.displaylist + " for " + this);
56255995 display.NewList(bRep.displaylist);
....@@ -5628,7 +5998,7 @@
56285998 CallList(display, root, selected, blocked);
56295999
56306000 // compiled = true;
5631
- if (usecalllists)
6001
+ if (usecalllists && bRep.displaylist > 0)
56326002 {
56336003 // System.err.println("end list " + bRep.displaylist + " for " + this);
56346004 display.EndList();
....@@ -5728,6 +6098,7 @@
57286098 if (GetBRep() != null)
57296099 {
57306100 display.NextIndex();
6101
+
57316102 // vertex color conflict : gl.glCallList(list);
57326103 DrawNode(display, root, selected);
57336104 if (this instanceof BezierPatch)
....@@ -5768,16 +6139,27 @@
57686139 tex = GetTextures();
57696140 }
57706141
5771
- boolean failed = false;
6142
+ boolean failedPigment = false;
6143
+ boolean failedBump = false;
57726144
57736145 try
57746146 {
5775
- display.BindTextures(tex, texres);
6147
+ display.BindPigmentTexture(tex, texres);
57766148 }
57776149 catch (Exception e)
57786150 {
57796151 System.err.println("FAILED: " + this);
5780
- failed = true;
6152
+ failedPigment = true;
6153
+ }
6154
+
6155
+ try
6156
+ {
6157
+ display.BindBumpTexture(tex, texres);
6158
+ }
6159
+ catch (Exception e)
6160
+ {
6161
+ //System.err.println("FAILED: " + this);
6162
+ failedBump = true;
57816163 }
57826164
57836165 if (!compiled)
....@@ -5800,8 +6182,11 @@
58006182 }
58016183 }
58026184
5803
- if (!failed)
5804
- display.ReleaseTextures(tex);
6185
+ if (!failedBump)
6186
+ display.ReleaseBumpTexture(tex);
6187
+
6188
+ if (!failedPigment)
6189
+ display.ReleasePigmentTexture(tex);
58056190
58066191 display.PopMaterial(this, selected);
58076192 }
....@@ -6174,6 +6559,11 @@
61746559 // dec 2012
61756560 new Exception().printStackTrace();
61766561 return;
6562
+ }
6563
+
6564
+ if (dontselect)
6565
+ {
6566
+ //bRep.GenerateNormalsMINE();
61776567 }
61786568
61796569 display.DrawGeometry(bRep, flipV, selectmode);
....@@ -6959,20 +7349,23 @@
69597349 }
69607350 }
69617351
6962
- protected void calcHotSpot(cVector in, ClickInfo info, Point outPt, Rectangle outRec)
7352
+ static ClickInfo clickInfo = new ClickInfo();
7353
+
7354
+ protected void calcHotSpot(cVector in, //ClickInfo clickInfo,
7355
+ Point outPt, Rectangle outRec)
69637356 {
6964
- int hc = info.bounds.x + info.bounds.width / 2;
6965
- int vc = info.bounds.y + info.bounds.height / 2;
6966
- double[][] toscreen = info.toScreen;
7357
+ int hc = clickInfo.bounds.x + clickInfo.bounds.width / 2;
7358
+ int vc = clickInfo.bounds.y + clickInfo.bounds.height / 2;
7359
+ double[][] toscreen = clickInfo.toScreen;
69677360 if (toscreen == null)
69687361 {
6969
- toscreen = new Camera(info.camera.viewCode).toScreen;
7362
+ toscreen = new Camera(clickInfo.camera.viewCode).toScreen;
69707363 }
69717364 cVector vec = in;
69727365 LA.xformPos(in, toscreen, in);
69737366 //System.out.println("Distance = " + info.camera.Distance());
6974
- vec.x *= 100 * info.camera.SCALE / info.camera.Distance();
6975
- vec.y *= 100 * info.camera.SCALE / info.camera.Distance();
7367
+ vec.x *= 100 * clickInfo.camera.SCALE / clickInfo.camera.Distance();
7368
+ vec.y *= 100 * clickInfo.camera.SCALE / clickInfo.camera.Distance();
69767369 outPt.x = hc + (int) vec.x;
69777370 outPt.y = vc - (int) vec.y;
69787371 outRec.x = outPt.x - 3;
....@@ -6980,15 +7373,18 @@
69807373 outRec.width = outRec.height = 6;
69817374 }
69827375
6983
- protected Rectangle calcHotSpot(cVector in, ClickInfo info)
7376
+ protected Rectangle calcHotSpot(cVector in//, ClickInfo clickInfo
7377
+ )
69847378 {
69857379 Point pt = new Point(0, 0);
69867380 Rectangle rec = new Rectangle();
6987
- calcHotSpot(in, info, pt, rec);
7381
+ calcHotSpot(in, //clickInfo,
7382
+ pt, rec);
69887383 return rec;
69897384 }
69907385
6991
- void drawEditHandles0(ClickInfo info, int level)
7386
+ void drawEditHandles0(//ClickInfo clickInfo,
7387
+ int level)
69927388 {
69937389 if (level == 0)
69947390 {
....@@ -6997,16 +7393,19 @@
69977393 {
69987394 cVector origin = new cVector();
69997395 //LA.xformPos(origin, toParent, origin);
7000
- Rectangle spot = calcHotSpot(origin, info);
7396
+ if (this.clickInfo == null)
7397
+ this.clickInfo = new ClickInfo();
7398
+
7399
+ Rectangle spot = calcHotSpot(origin); //, clickInfo);
70017400 Rectangle boundary = new Rectangle();
70027401 boundary.x = spot.x - 30;
70037402 boundary.y = spot.y - 30;
70047403 boundary.width = spot.width + 60;
70057404 boundary.height = spot.height + 60;
7006
- info.g.setColor(Color.red);
7405
+ clickInfo.g.setColor(Color.red);
70077406 int spotw = spot.x + spot.width;
70087407 int spoth = spot.y + spot.height;
7009
- info.g.fillRect(spot.x, spot.y, spot.width, spot.height);
7408
+ clickInfo.g.fillRect(spot.x, spot.y, spot.width, spot.height);
70107409 // if (CameraPane.Xmin > spot.x)
70117410 // {
70127411 // CameraPane.Xmin = spot.x;
....@@ -7026,8 +7425,8 @@
70267425 spot.translate(32, 32);
70277426 spotw = spot.x + spot.width;
70287427 spoth = spot.y + spot.height;
7029
- info.g.setColor(Color.blue);
7030
- info.g.fillRect(spot.x, spot.y, spot.width, spot.height);
7428
+ clickInfo.g.setColor(Color.cyan);
7429
+ clickInfo.g.fillRect(spot.x, spot.y, spot.width, spot.height);
70317430 // if (CameraPane.Xmin > spot.x)
70327431 // {
70337432 // CameraPane.Xmin = spot.x;
....@@ -7044,11 +7443,12 @@
70447443 // {
70457444 // CameraPane.Ymax = spoth;
70467445 // }
7047
- // bonhommes info.g.drawLine(spotw, spoth, spotw, spoth - 15);
7048
- //info.g.drawLine(spotw, spoth, spotw - 15, spoth);
7446
+ // bonhommes info.g.drawLine(spotw, spoth, spotw, spoth - boundary.height/2); // 15
7447
+ //info.g.drawLine(spotw, spoth, spotw - boundary.width/2, spoth); // 15
70497448 spot.translate(0, -32);
7050
- info.g.setColor(Color.green);
7051
- info.g.fillRect(spot.x, spot.y, spot.width, spot.height);
7449
+ clickInfo.g.setColor(Color.yellow);
7450
+ clickInfo.g.fillRect(spot.x, spot.y, spot.width, spot.height);
7451
+ clickInfo.g.setColor(Color.green);
70527452 // if (CameraPane.Xmin > spot.x)
70537453 // {
70547454 // CameraPane.Xmin = spot.x;
....@@ -7065,8 +7465,8 @@
70657465 // {
70667466 // CameraPane.Ymax = spoth;
70677467 // }
7068
- info.g.drawArc(boundary.x, boundary.y,
7069
- boundary.width, boundary.height, 0, 360);
7468
+ clickInfo.g.drawArc(boundary.x + clickInfo.DX, boundary.y + clickInfo.DY,
7469
+ (int)(boundary.width * clickInfo.W), (int)(boundary.height * clickInfo.W), 0, 360);
70707470 //info.g.drawArc(spot.x, spotw, spot.width/2, boundary.height/2, 0, 360);
70717471 // if (CameraPane.Xmin > boundary.x)
70727472 // {
....@@ -7088,7 +7488,8 @@
70887488 }
70897489 }
70907490
7091
- boolean doEditClick0(ClickInfo info, int level)
7491
+ boolean doEditClick0(//ClickInfo clickInfo,
7492
+ int level)
70927493 {
70937494 if (level == 0)
70947495 {
....@@ -7097,8 +7498,8 @@
70977498
70987499 boolean retval = false;
70997500
7100
- startX = info.x;
7101
- startY = info.y;
7501
+ startX = clickInfo.x;
7502
+ startY = clickInfo.y;
71027503
71037504 hitSomething = -1;
71047505 cVector origin = new cVector();
....@@ -7108,22 +7509,51 @@
71087509 {
71097510 centerPt = new Point(0, 0);
71107511 }
7111
- calcHotSpot(origin, info, centerPt, spot);
7112
- if (spot.contains(info.x, info.y))
7512
+ calcHotSpot(origin, //info,
7513
+ centerPt, spot);
7514
+ if (spot.contains(clickInfo.x, clickInfo.y))
71137515 {
71147516 hitSomething = hitCenter;
71157517 retval = true;
71167518 }
71177519 spot.translate(32, 0);
7118
- if (spot.contains(info.x, info.y))
7520
+ if (spot.contains(clickInfo.x, clickInfo.y))
71197521 {
71207522 hitSomething = hitRotate;
71217523 retval = true;
71227524 }
71237525 spot.translate(0, 32);
7124
- if (spot.contains(info.x, info.y))
7526
+ if (spot.contains(clickInfo.x, clickInfo.y))
71257527 {
71267528 hitSomething = hitScale;
7529
+
7530
+ double scale = 0.005f * clickInfo.camera.Distance();
7531
+ double hScale = (double) (clickInfo.x - centerPt.x) / 32;
7532
+ double sign = 1;
7533
+ if (hScale < 0)
7534
+ {
7535
+ sign = -1;
7536
+ }
7537
+ hScale = sign*Math.pow(sign*hScale, scale * 50);
7538
+ if (hScale < 0.01)
7539
+ {
7540
+ //hScale = 0.01;
7541
+ }
7542
+
7543
+ double vScale = (double) (clickInfo.y - centerPt.y) / 32;
7544
+ sign = 1;
7545
+ if (vScale < 0)
7546
+ {
7547
+ sign = -1;
7548
+ }
7549
+ vScale = sign*Math.pow(sign*vScale, scale * 50);
7550
+ if (vScale < 0.01)
7551
+ {
7552
+ //vScale = 0.01;
7553
+ }
7554
+
7555
+ clickInfo.scale = Math.sqrt(hScale*hScale + vScale*vScale);
7556
+
71277557 retval = true;
71287558 }
71297559
....@@ -7133,7 +7563,7 @@
71337563 }
71347564
71357565 //System.out.println("info.modifiers = " + info.modifiers);
7136
- modified = (info.modifiers & CameraPane.SHIFT) != 0; // Was META
7566
+ modified = (clickInfo.modifiers & CameraPane.SHIFT) != 0; // Was META
71377567 //System.out.println("modified = " + modified);
71387568 //new Exception().printStackTrace();
71397569 //viewCode = info.pane.renderCamera.viewCode;
....@@ -7161,7 +7591,8 @@
71617591 return true;
71627592 }
71637593
7164
- void doEditDrag0(ClickInfo info, boolean opposite)
7594
+ void doEditDrag0(//ClickInfo info,
7595
+ boolean opposite)
71657596 {
71667597 if (hitSomething == 0)
71677598 {
....@@ -7175,7 +7606,7 @@
71757606
71767607 //System.out.println("hitSomething = " + hitSomething);
71777608
7178
- double scale = 0.005f * info.camera.Distance();
7609
+ double scale = 0.005f * clickInfo.camera.Distance();
71797610
71807611 cVector xlate = new cVector();
71817612 //cVector xlate2 = new cVector();
....@@ -7209,8 +7640,8 @@
72097640 toParent[3][i] = xlate.get(i);
72107641 LA.matInvert(toParent, fromParent);
72117642 */
7212
- cVector delta = LA.newVector(0, 0, startY - info.y);
7213
- LA.xformDir(delta, new Camera(info.camera.viewCode).fromScreen, delta);
7643
+ cVector delta = LA.newVector(0, 0, startY - clickInfo.y);
7644
+ LA.xformDir(delta, new Camera(clickInfo.camera.viewCode).fromScreen, delta);
72147645
72157646 LA.matCopy(startMat, toParent);
72167647 LA.matTranslate(toParent, delta.x * scale, delta.y * scale, delta.z * scale);
....@@ -7219,7 +7650,7 @@
72197650 } else
72207651 {
72217652 //LA.xformDir(delta, info.camera.fromScreen, delta);
7222
- cVector up = new cVector(info.camera.up);
7653
+ cVector up = new cVector(clickInfo.camera.up);
72237654 cVector away = new cVector();
72247655 //cVector right2 = new cVector();
72257656 //LA.vecCross(up, cVector.Z, right);
....@@ -7236,19 +7667,19 @@
72367667 LA.xformDir(up, ClickInfo.matbuffer, up);
72377668 // if (!CameraPane.LOCALTRANSFORM)
72387669 LA.xformDir(up, Globals.theRenderer.RenderCamera().toScreen, up);
7239
- LA.xformDir(info.camera.away, ClickInfo.matbuffer, away);
7670
+ LA.xformDir(clickInfo.camera.away, ClickInfo.matbuffer, away);
72407671 // if (!CameraPane.LOCALTRANSFORM)
72417672 LA.xformDir(away, Globals.theRenderer.RenderCamera().toScreen, away);
72427673 //LA.vecCross(up, cVector.Z, right2);
72437674
7244
- cVector delta = LA.newVector(info.x - startX, startY - info.y, 0);
7675
+ cVector delta = LA.newVector(clickInfo.x - startX, startY - clickInfo.y, 0);
72457676
72467677 //System.out.println("DELTA0 = " + delta);
72477678 //System.out.println("AWAY = " + info.camera.away);
72487679 //System.out.println("UP = " + info.camera.up);
72497680 if (away.z > 0)
72507681 {
7251
- if (info.camera.up.x == 0) // LA.vecDot(right, right2)<0)
7682
+ if (clickInfo.camera.up.x == 0) // LA.vecDot(right, right2)<0)
72527683 {
72537684 delta.x = -delta.x;
72547685 } else
....@@ -7263,7 +7694,7 @@
72637694 //System.out.println("DELTA1 = " + delta);
72647695 LA.xformDir(delta, ClickInfo.matbuffer, delta);
72657696 //System.out.println("DELTA2 = " + delta);
7266
- LA.xformDir(delta, new Camera(info.camera.viewCode).fromScreen, delta);
7697
+ LA.xformDir(delta, new Camera(clickInfo.camera.viewCode).fromScreen, delta);
72677698 LA.matCopy(startMat, toParent);
72687699 //System.out.println("DELTA3 = " + delta);
72697700 LA.matTranslate(toParent, delta.x * scale, delta.y * scale, delta.z * scale);
....@@ -7273,8 +7704,8 @@
72737704 break;
72747705
72757706 case hitRotate: // rotate
7276
- int dx = info.x - centerPt.x;
7277
- int dy = -(info.y - centerPt.y);
7707
+ int dx = clickInfo.x - centerPt.x;
7708
+ int dy = -(clickInfo.y - centerPt.y);
72787709 double angle = (double) Math.atan2(dx, dy);
72797710 angle = -(1.570796 - angle);
72807711
....@@ -7297,7 +7728,7 @@
72977728 }
72987729 /**/
72997730
7300
- switch (info.pane.RenderCamera().viewCode)
7731
+ switch (clickInfo.pane.RenderCamera().viewCode)
73017732 {
73027733 case 1: // '\001'
73037734 LA.matZRotate(toParent, angle);
....@@ -7324,7 +7755,7 @@
73247755 break;
73257756
73267757 case hitScale: // scale
7327
- double hScale = (double) (info.x - centerPt.x) / 32;
7758
+ double hScale = (double) (clickInfo.x - centerPt.x) / 32;
73287759 double sign = 1;
73297760 if (hScale < 0)
73307761 {
....@@ -7336,7 +7767,7 @@
73367767 //hScale = 0.01;
73377768 }
73387769
7339
- double vScale = (double) (info.y - centerPt.y) / 32;
7770
+ double vScale = (double) (clickInfo.y - centerPt.y) / 32;
73407771 sign = 1;
73417772 if (vScale < 0)
73427773 {
....@@ -7347,6 +7778,7 @@
73477778 {
73487779 //vScale = 0.01;
73497780 }
7781
+
73507782 LA.matCopy(startMat, toParent);
73517783 /**/
73527784 for (int i = 0; i < 3; i++)
....@@ -7356,29 +7788,30 @@
73567788 }
73577789 /**/
73587790
7359
- double totalScale = Math.sqrt(hScale*hScale + vScale*vScale) / Math.sqrt(2);
7791
+ double totalScale = Math.sqrt(hScale*hScale + vScale*vScale) / clickInfo.scale;
73607792
73617793 if (totalScale < 0.01)
73627794 {
73637795 totalScale = 0.01;
73647796 }
73657797
7366
- switch (info.pane.RenderCamera().viewCode)
7798
+ switch (clickInfo.pane.RenderCamera().viewCode)
73677799 {
73687800 case 3: // '\001'
7369
- if (modified)
7801
+ if (modified || opposite)
73707802 {
73717803 //LA.matScale(toParent, 1, hScale, vScale);
73727804 LA.matScale(toParent, totalScale, 1, 1);
73737805 } // vScale, 1);
73747806 else
73757807 {
7808
+ // EXCEPTION!
73767809 LA.matScale(toParent, totalScale, totalScale, totalScale);
73777810 } // vScale, 1);
73787811 break;
73797812
73807813 case 2: // '\002'
7381
- if (modified)
7814
+ if (modified || opposite)
73827815 {
73837816 //LA.matScale(toParent, hScale, 1, vScale);
73847817 LA.matScale(toParent, 1, totalScale, 1);
....@@ -7389,7 +7822,7 @@
73897822 break;
73907823
73917824 case 1: // '\003'
7392
- if (modified)
7825
+ if (modified || opposite)
73937826 {
73947827 //LA.matScale(toParent, hScale, vScale, 1);
73957828 LA.matScale(toParent, 1, 1, totalScale);
....@@ -7429,7 +7862,7 @@
74297862 } // NEW ...
74307863
74317864
7432
- info.pane.repaint();
7865
+ clickInfo.pane.repaint();
74337866 }
74347867
74357868 boolean overflow = false;
....@@ -7609,6 +8042,10 @@
76098042 editWindow = null;
76108043 } // ?
76118044 }
8045
+ else
8046
+ {
8047
+ //editWindow.closeUI();
8048
+ }
76128049 }
76138050
76148051 boolean root; // patch for edit windows
....@@ -7766,6 +8203,10 @@
77668203 }
77678204
77688205 transient ObjEditor editWindow;
8206
+ transient ObjEditor manipWindow;
8207
+
8208
+ transient boolean pinned;
8209
+
77698210 transient ObjectUI objectUI;
77708211 public static int povDepth = 0;
77718212 private static cVector tbMin = new cVector();