Normand Briere
2019-07-21 d32f24f147068e6cbecb31c7f98047f68bc8b58a
Object3D.java
....@@ -24,6 +24,14 @@
2424
2525 private UUID uuid = UUID.randomUUID();
2626
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
+
2735 ScriptNode scriptnode;
2836
2937 void InitOthers()
....@@ -104,64 +112,178 @@
104112
105113 // transient boolean reduced; // for morph reduction
106114
107
-transient com.bulletphysics.linearmath.Transform cache; // for fast merge
108
-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
109117
110
-transient Object3D transientsupport; // for cloning
111
-transient boolean transientlink2master;
118
+ transient Object3D transientsupport; // for cloning
119
+ transient boolean transientlink2master;
112120
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)
121
+ void SaveSupports()
125122 {
126
- 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
+ }
127146 }
128
-
129
- for (int i = 0; i < Size(); i++)
147
+
148
+ void RestoreSupports()
130149 {
131
- Object3D child = (Object3D) get(i);
132
- if (child == null)
133
- 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
+
134258 blockloop = true;
135
- child.SaveSupports();
259
+
260
+ //hashtable.remove(GetUUID());
261
+
262
+ for (int i=0; i<Size(); i++)
263
+ {
264
+ get(i).RestoreBigData(hashtable);
265
+ }
266
+
136267 blockloop = false;
137268 }
138
-}
139269
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)
270
+ void RestoreBigData(Object3D o)
151271 {
152
- 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;
153286 }
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
-}
165287
166288 // MOCAP SUPPORT
167289 double tx,ty,tz,rx,ry,rz;
....@@ -304,6 +426,7 @@
304426 }
305427
306428 boolean live = false;
429
+ transient boolean keepdontselect;
307430 boolean dontselect = false;
308431 boolean hide = false;
309432 boolean link2master = false; // performs reset support/master at each frame
....@@ -486,12 +609,14 @@
486609 toParent = LA.newMatrix();
487610 fromParent = LA.newMatrix();
488611 }
612
+
489613 if (toParentMarked == null)
490614 {
491615 if (maxcount != 1)
492616 {
493617 new Exception().printStackTrace();
494618 }
619
+
495620 toParentMarked = LA.newMatrix();
496621 fromParentMarked = LA.newMatrix();
497622 }
....@@ -802,7 +927,7 @@
802927
803928 if (marked && Globals.isLIVE() && live &&
804929 //TEMP21aug2018
805
- (Globals.DrawMode() == iCameraPane.SHADOW || !Globals.RENDERSHADOW) &&
930
+ (Globals.DrawMode() == iCameraPane.SHADOW || !Globals.RENDERSHADOW || !Globals.COMPUTESHADOWWHENLIVE) &&
806931 currentframe != Globals.framecount)
807932 {
808933 currentframe = Globals.framecount;
....@@ -814,7 +939,8 @@
814939
815940 boolean changedir = random && Math.random() < 0.01; // && !link2master;
816941
817
- if (transformcount*factor > maxcount || (step == 1 && changedir))
942
+ if (transformcount*factor >= maxcount && (rewind || random) ||
943
+ (step == 1 && changedir))
818944 {
819945 countdown = 1;
820946 delay = speedup?8:1;
....@@ -886,6 +1012,7 @@
8861012 if (material == null || material.multiply)
8871013 return true;
8881014
1015
+ // Transparent objects are dynamic because we have to sort the triangles.
8891016 return material.opacity > 0.99;
8901017 }
8911018
....@@ -1286,6 +1413,7 @@
12861413 toParent = LA.newMatrix();
12871414 fromParent = LA.newMatrix();
12881415 }
1416
+
12891417 LA.matCopy(other.toParent, toParent);
12901418 LA.matCopy(other.fromParent, fromParent);
12911419
....@@ -2307,6 +2435,10 @@
23072435 }
23082436 */
23092437 }
2438
+ else
2439
+ {
2440
+ //((ObjEditor)editWindow).SetupUI2(null);
2441
+ }
23102442 }
23112443
23122444 void createEditWindow(GroupEditor callee, boolean newWindow) //, boolean root)
....@@ -2348,6 +2480,14 @@
23482480 {
23492481 editWindow.refreshContents();
23502482 }
2483
+ else
2484
+ {
2485
+ if (manipWindow != null)
2486
+ {
2487
+ manipWindow.refreshContents();
2488
+ }
2489
+ }
2490
+
23512491 //if (parent != null)
23522492 //parent.refreshEditWindow();
23532493 }
....@@ -2632,6 +2772,18 @@
26322772 //Touch();
26332773 }
26342774
2775
+ void GenNormalsMeshS()
2776
+ {
2777
+ selection.GenNormalsMesh();
2778
+// for (int i=0; i<selection.size(); i++)
2779
+// {
2780
+// Object3D selectee = (Object3D) selection.elementAt(i);
2781
+// selectee.GenNormals(crease);
2782
+// }
2783
+
2784
+ //Touch();
2785
+ }
2786
+
26352787 void ClearColorsS()
26362788 {
26372789 selection.ClearColors();
....@@ -2763,6 +2915,24 @@
27632915 if (child == null)
27642916 continue;
27652917 child.GenNormals(crease);
2918
+// Children().release(i);
2919
+ }
2920
+ blockloop = false;
2921
+ }
2922
+
2923
+ void GenNormalsMesh()
2924
+ {
2925
+ if (blockloop)
2926
+ return;
2927
+
2928
+ blockloop = true;
2929
+ GenNormalsMesh0();
2930
+ for (int i = 0; i < Children().Size(); i++)
2931
+ {
2932
+ Object3D child = (Object3D) Children().get(i); // reserve(i);
2933
+ if (child == null)
2934
+ continue;
2935
+ child.GenNormalsMesh();
27662936 // Children().release(i);
27672937 }
27682938 blockloop = false;
....@@ -2935,11 +3105,20 @@
29353105 }
29363106 }
29373107
3108
+ void GenNormalsMesh0()
3109
+ {
3110
+ if (bRep != null)
3111
+ {
3112
+ bRep.GenerateNormalsMesh();
3113
+ Touch();
3114
+ }
3115
+ }
3116
+
29383117 void GenNormalsMINE0()
29393118 {
29403119 if (bRep != null)
29413120 {
2942
- bRep.GenerateNormalsMINE();
3121
+ bRep.MergeNormals(); //.GenerateNormalsMINE();
29433122 Touch();
29443123 }
29453124 }
....@@ -3385,7 +3564,8 @@
33853564 if (blockloop)
33863565 return;
33873566
3388
- if (marked || (bRep != null && material != null)) // borderline...
3567
+ if (//marked || // does not make sense
3568
+ (bRep != null || material != null)) // borderline...
33893569 live = h;
33903570
33913571 for (int i = 0; i < Size(); i++)
....@@ -3406,7 +3586,8 @@
34063586 return;
34073587
34083588 //if (bRep != null)
3409
- if (marked || (bRep != null && material != null)) // borderline...
3589
+ if (//marked || // does not make sense
3590
+ (bRep != null || material != null)) // borderline...
34103591 link2master = h;
34113592
34123593 for (int i = 0; i < Size(); i++)
....@@ -3426,7 +3607,8 @@
34263607 if (blockloop)
34273608 return;
34283609
3429
- if (marked || (bRep != null && material != null)) // borderline...
3610
+ if (//marked || // does not make sense
3611
+ (bRep != null || material != null)) // borderline...
34303612 hide = h;
34313613
34323614 for (int i = 0; i < Size(); i++)
....@@ -3446,7 +3628,7 @@
34463628 if (blockloop)
34473629 return;
34483630
3449
- if (bRep != null && material != null) // borderline...
3631
+ if (bRep != null || material != null) // borderline...
34503632 marked = h;
34513633
34523634 for (int i = 0; i < Size(); i++)
....@@ -3456,6 +3638,46 @@
34563638 continue;
34573639 blockloop = true;
34583640 child.MarkLeaves(h);
3641
+ blockloop = false;
3642
+ // release(i);
3643
+ }
3644
+ }
3645
+
3646
+ void RewindLeaves(boolean h)
3647
+ {
3648
+ if (blockloop)
3649
+ return;
3650
+
3651
+ if (bRep != null || material != null) // borderline...
3652
+ rewind = h;
3653
+
3654
+ for (int i = 0; i < Size(); i++)
3655
+ {
3656
+ Object3D child = (Object3D) get(i); // reserve(i);
3657
+ if (child == null)
3658
+ continue;
3659
+ blockloop = true;
3660
+ child.RewindLeaves(h);
3661
+ blockloop = false;
3662
+ // release(i);
3663
+ }
3664
+ }
3665
+
3666
+ void RandomLeaves(boolean h)
3667
+ {
3668
+ if (blockloop)
3669
+ return;
3670
+
3671
+ if (bRep != null || material != null) // borderline...
3672
+ random = h;
3673
+
3674
+ for (int i = 0; i < Size(); i++)
3675
+ {
3676
+ Object3D child = (Object3D) get(i); // reserve(i);
3677
+ if (child == null)
3678
+ continue;
3679
+ blockloop = true;
3680
+ child.RandomLeaves(h);
34593681 blockloop = false;
34603682 // release(i);
34613683 }
....@@ -4233,6 +4455,55 @@
42334455 }
42344456 }
42354457
4458
+ void RepairSOV()
4459
+ {
4460
+ if (blockloop)
4461
+ return;
4462
+
4463
+ String texname = this.GetPigmentTexture();
4464
+
4465
+ if (texname.startsWith("sov"))
4466
+ {
4467
+ String[] s = texname.split("/");
4468
+
4469
+ String[] sname = s[1].split("Color.pn");
4470
+
4471
+ texname = sname[0];
4472
+
4473
+ if (sname.length > 1)
4474
+ {
4475
+ texname += "Color.jpg";
4476
+ }
4477
+
4478
+ this.SetPigmentTexture("sov/" + texname);
4479
+ }
4480
+
4481
+ texname = this.GetBumpTexture();
4482
+
4483
+ if (texname.startsWith("sov"))
4484
+ {
4485
+ String[] s = texname.split("/");
4486
+
4487
+ String[] sname = s[1].split("Bump.pn");
4488
+
4489
+ texname = sname[0];
4490
+
4491
+ if (sname.length > 1)
4492
+ {
4493
+ texname += "Bump.jpg";
4494
+ }
4495
+
4496
+ this.SetBumpTexture("sov/" + texname);
4497
+ }
4498
+
4499
+ for (int i=0; i<Size(); i++)
4500
+ {
4501
+ blockloop = true;
4502
+ get(i).RepairSOV();
4503
+ blockloop = false;
4504
+ }
4505
+ }
4506
+
42364507 void RepairTexture()
42374508 {
42384509 if (this instanceof FileObject || blockloop)
....@@ -4747,6 +5018,14 @@
47475018 }
47485019 }
47495020
5021
+ ObjEditor GetWindow()
5022
+ {
5023
+ if (editWindow != null)
5024
+ return editWindow;
5025
+
5026
+ return manipWindow;
5027
+ }
5028
+
47505029 cTreePath Select(int indexcount, boolean deselect)
47515030 {
47525031 if (hide || dontselect)
....@@ -4783,10 +5062,11 @@
47835062 if (leaf != null)
47845063 {
47855064 cTreePath tp = new cTreePath(this, leaf);
4786
- if (editWindow != null)
5065
+ ObjEditor window = GetWindow();
5066
+ if (window != null)
47875067 {
47885068 //System.out.println("editWindow = " + editWindow + " vs " + this);
4789
- editWindow.Select(tp, deselect, true);
5069
+ window.Select(tp, deselect, true);
47905070 }
47915071
47925072 return tp;
....@@ -4803,6 +5083,7 @@
48035083
48045084 if (child == null)
48055085 continue;
5086
+
48065087 if (child.HasTransparency() && child.size() != 0)
48075088 {
48085089 cTreePath leaf = child.Select(indexcount, deselect);
....@@ -4812,9 +5093,10 @@
48125093 if (leaf != null)
48135094 {
48145095 cTreePath tp = new cTreePath(this, leaf);
4815
- if (editWindow != null)
5096
+ ObjEditor window = GetWindow();
5097
+ if (window != null)
48165098 {
4817
- editWindow.Select(tp, deselect, true);
5099
+ window.Select(tp, deselect, true);
48185100 }
48195101
48205102 return tp;
....@@ -5139,6 +5421,51 @@
51395421 blockloop = false;
51405422 }
51415423
5424
+ void ResetSelectable()
5425
+ {
5426
+ if (blockloop)
5427
+ return;
5428
+
5429
+ blockloop = true;
5430
+
5431
+ keepdontselect = dontselect;
5432
+ dontselect = true;
5433
+
5434
+ Object3D child;
5435
+ int nb = Size();
5436
+ for (int i = 0; i < nb; i++)
5437
+ {
5438
+ child = (Object3D) get(i);
5439
+ if (child == null)
5440
+ continue;
5441
+ child.ResetSelectable();
5442
+ }
5443
+
5444
+ blockloop = false;
5445
+ }
5446
+
5447
+ void RestoreSelectable()
5448
+ {
5449
+ if (blockloop)
5450
+ return;
5451
+
5452
+ blockloop = true;
5453
+
5454
+ dontselect = keepdontselect;
5455
+
5456
+ Object3D child;
5457
+ int nb = Size();
5458
+ for (int i = 0; i < nb; i++)
5459
+ {
5460
+ child = (Object3D) get(i);
5461
+ if (child == null)
5462
+ continue;
5463
+ child.RestoreSelectable();
5464
+ }
5465
+
5466
+ blockloop = false;
5467
+ }
5468
+
51425469 boolean IsSelected()
51435470 {
51445471 if (parent == null)
....@@ -5448,6 +5775,27 @@
54485775 }
54495776 }
54505777
5778
+ void EmbedTextures()
5779
+ {
5780
+ if (blockloop)
5781
+ return;
5782
+
5783
+ CameraPane.EmbedTextures(texture);
5784
+
5785
+ int nb = Size();
5786
+ for (int i = 0; i < nb; i++)
5787
+ {
5788
+ Object3D child = (Object3D) get(i);
5789
+
5790
+ if (child == null)
5791
+ continue;
5792
+
5793
+ blockloop = true;
5794
+ child.EmbedTextures();
5795
+ blockloop = false;
5796
+ }
5797
+ }
5798
+
54515799 void draw(iCameraPane display, Object3D /*Composite*/ root, boolean selected, boolean blocked)
54525800 {
54535801 Draw(display, root, selected, blocked);
....@@ -5456,12 +5804,23 @@
54565804 boolean NeedSupport()
54575805 {
54585806 return
5459
- CameraPane.SUPPORT && (!CameraPane.movingcamera || !Globals.FREEZEONMOVE) && link2master && /*live &&*/ support != null
5807
+ CameraPane.SUPPORT && (!CameraPane.movingcamera || (!Globals.FREEZEONMOVE && Globals.isLIVE())) && link2master && /*live &&*/ support != null
54605808 // PROBLEM with CROWD!!
54615809 && (Globals.DrawMode() == iCameraPane.SHADOW || !Globals.RENDERSHADOW || Globals.CROWD);
54625810 }
54635811
54645812 static boolean DEBUG_SELECTION = false;
5813
+
5814
+ boolean IsLive()
5815
+ {
5816
+ if (live)
5817
+ return true;
5818
+
5819
+ if (parent == null)
5820
+ return false;
5821
+
5822
+ return parent.IsLive();
5823
+ }
54655824
54665825 void Draw(iCameraPane display, Object3D /*Composite*/ root, boolean selected, boolean blocked)
54675826 {
....@@ -5524,7 +5883,7 @@
55245883 support = support;
55255884
55265885 //boolean usecalllists = IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null || !link2master); // !(this instanceof cSpring) && !(this instanceof BezierPatch);
5527
- boolean usecalllists = false; // IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null) && !link2master; // !(this instanceof cSpring) && !(this instanceof BezierPatch);
5886
+ boolean usecalllists = !IsLive(); // IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null) && !link2master; // !(this instanceof cSpring) && !(this instanceof BezierPatch);
55285887
55295888 if (!usecalllists && bRep != null && bRep.displaylist > 0)
55305889 {
....@@ -5544,10 +5903,12 @@
55445903 boolean selectmode = display.DrawMode() == display.SELECTION || display.IsDebugSelection();
55455904
55465905 if (!selectmode && //display.DrawMode() != display.SELECTION &&
5547
- (touched || (bRep != null && bRep.displaylist <= 0)))
5906
+ //(touched || (bRep != null && bRep.displaylist <= 0)))
5907
+ (Globals.isLIVE() && Globals.COMPUTESHADOWWHENLIVE || touched && Globals.COMPUTESHADOWWHENLIVE)) // || (bRep != null && bRep.displaylist <= 0)))
55485908 {
55495909 Globals.lighttouched = true;
55505910 } // all panes...
5911
+
55515912 //if (usecalllists && display.DrawMode() != display.SELECTION && display.DrawMode() != display.SHADOW &&
55525913 if (bRep != null && usecalllists && !selectmode && // june 2013 display.DrawMode() != display.SHADOW &&
55535914 (touched || (bRep != null && bRep.displaylist <= 0)))
....@@ -5675,6 +6036,7 @@
56756036 if (GetBRep() != null)
56766037 {
56776038 display.NextIndex();
6039
+
56786040 // vertex color conflict : gl.glCallList(list);
56796041 DrawNode(display, root, selected);
56806042 if (this instanceof BezierPatch)
....@@ -5715,16 +6077,27 @@
57156077 tex = GetTextures();
57166078 }
57176079
5718
- boolean failed = false;
6080
+ boolean failedPigment = false;
6081
+ boolean failedBump = false;
57196082
57206083 try
57216084 {
5722
- display.BindTextures(tex, texres);
6085
+ display.BindPigmentTexture(tex, texres);
57236086 }
57246087 catch (Exception e)
57256088 {
57266089 System.err.println("FAILED: " + this);
5727
- failed = true;
6090
+ failedPigment = true;
6091
+ }
6092
+
6093
+ try
6094
+ {
6095
+ display.BindBumpTexture(tex, texres);
6096
+ }
6097
+ catch (Exception e)
6098
+ {
6099
+ //System.err.println("FAILED: " + this);
6100
+ failedBump = true;
57286101 }
57296102
57306103 if (!compiled)
....@@ -5747,8 +6120,11 @@
57476120 }
57486121 }
57496122
5750
- if (!failed)
5751
- display.ReleaseTextures(tex);
6123
+ if (!failedBump)
6124
+ display.ReleaseBumpTexture(tex);
6125
+
6126
+ if (!failedPigment)
6127
+ display.ReleasePigmentTexture(tex);
57526128
57536129 display.PopMaterial(this, selected);
57546130 }
....@@ -6121,6 +6497,11 @@
61216497 // dec 2012
61226498 new Exception().printStackTrace();
61236499 return;
6500
+ }
6501
+
6502
+ if (dontselect)
6503
+ {
6504
+ //bRep.GenerateNormalsMINE();
61246505 }
61256506
61266507 display.DrawGeometry(bRep, flipV, selectmode);
....@@ -6973,7 +7354,7 @@
69737354 spot.translate(32, 32);
69747355 spotw = spot.x + spot.width;
69757356 spoth = spot.y + spot.height;
6976
- info.g.setColor(Color.blue);
7357
+ info.g.setColor(Color.cyan);
69777358 info.g.fillRect(spot.x, spot.y, spot.width, spot.height);
69787359 // if (CameraPane.Xmin > spot.x)
69797360 // {
....@@ -6991,11 +7372,12 @@
69917372 // {
69927373 // CameraPane.Ymax = spoth;
69937374 // }
6994
- // bonhommes info.g.drawLine(spotw, spoth, spotw, spoth - 15);
6995
- //info.g.drawLine(spotw, spoth, spotw - 15, spoth);
7375
+ // bonhommes info.g.drawLine(spotw, spoth, spotw, spoth - boundary.height/2); // 15
7376
+ //info.g.drawLine(spotw, spoth, spotw - boundary.width/2, spoth); // 15
69967377 spot.translate(0, -32);
6997
- info.g.setColor(Color.green);
7378
+ info.g.setColor(Color.yellow);
69987379 info.g.fillRect(spot.x, spot.y, spot.width, spot.height);
7380
+ info.g.setColor(Color.green);
69997381 // if (CameraPane.Xmin > spot.x)
70007382 // {
70017383 // CameraPane.Xmin = spot.x;
....@@ -7012,8 +7394,8 @@
70127394 // {
70137395 // CameraPane.Ymax = spoth;
70147396 // }
7015
- info.g.drawArc(boundary.x, boundary.y,
7016
- boundary.width, boundary.height, 0, 360);
7397
+ info.g.drawArc(boundary.x + info.DX, boundary.y + info.DY,
7398
+ (int)(boundary.width * info.W), (int)(boundary.height * info.W), 0, 360);
70177399 //info.g.drawArc(spot.x, spotw, spot.width/2, boundary.height/2, 0, 360);
70187400 // if (CameraPane.Xmin > boundary.x)
70197401 // {
....@@ -7313,19 +7695,20 @@
73137695 switch (info.pane.RenderCamera().viewCode)
73147696 {
73157697 case 3: // '\001'
7316
- if (modified)
7698
+ if (modified || opposite)
73177699 {
73187700 //LA.matScale(toParent, 1, hScale, vScale);
73197701 LA.matScale(toParent, totalScale, 1, 1);
73207702 } // vScale, 1);
73217703 else
73227704 {
7705
+ // EXCEPTION!
73237706 LA.matScale(toParent, totalScale, totalScale, totalScale);
73247707 } // vScale, 1);
73257708 break;
73267709
73277710 case 2: // '\002'
7328
- if (modified)
7711
+ if (modified || opposite)
73297712 {
73307713 //LA.matScale(toParent, hScale, 1, vScale);
73317714 LA.matScale(toParent, 1, totalScale, 1);
....@@ -7336,7 +7719,7 @@
73367719 break;
73377720
73387721 case 1: // '\003'
7339
- if (modified)
7722
+ if (modified || opposite)
73407723 {
73417724 //LA.matScale(toParent, hScale, vScale, 1);
73427725 LA.matScale(toParent, 1, 1, totalScale);
....@@ -7556,6 +7939,10 @@
75567939 editWindow = null;
75577940 } // ?
75587941 }
7942
+ else
7943
+ {
7944
+ //editWindow.closeUI();
7945
+ }
75597946 }
75607947
75617948 boolean root; // patch for edit windows
....@@ -7567,7 +7954,7 @@
75677954 /*transient*/ cVector2[] projectedVertices = new cVector2[0];
75687955
75697956 Object3D /*Composite*/ parent;
7570
- Object3D /*Composite*/ fileparent;
7957
+ Object3D /*Composite*/ fileparent; // In the case of FileObject
75717958
75727959 double[][] toParent; // dynamic matrix
75737960 double[][] fromParent;
....@@ -7713,6 +8100,10 @@
77138100 }
77148101
77158102 transient ObjEditor editWindow;
8103
+ transient ObjEditor manipWindow;
8104
+
8105
+ transient boolean pinned;
8106
+
77168107 transient ObjectUI objectUI;
77178108 public static int povDepth = 0;
77188109 private static cVector tbMin = new cVector();