Normand Briere
2019-07-18 d7a17c35c443e2cb6c09eaa3cfeaf590a571faa1
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[] = new byte[100][];
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;
....@@ -482,12 +608,14 @@
482608 toParent = LA.newMatrix();
483609 fromParent = LA.newMatrix();
484610 }
611
+
485612 if (toParentMarked == null)
486613 {
487614 if (maxcount != 1)
488615 {
489616 new Exception().printStackTrace();
490617 }
618
+
491619 toParentMarked = LA.newMatrix();
492620 fromParentMarked = LA.newMatrix();
493621 }
....@@ -798,7 +926,7 @@
798926
799927 if (marked && Globals.isLIVE() && live &&
800928 //TEMP21aug2018
801
- (Globals.DrawMode() == iCameraPane.SHADOW || !Globals.RENDERSHADOW) &&
929
+ (Globals.DrawMode() == iCameraPane.SHADOW || !Globals.RENDERSHADOW || !Globals.COMPUTESHADOWWHENLIVE) &&
802930 currentframe != Globals.framecount)
803931 {
804932 currentframe = Globals.framecount;
....@@ -810,7 +938,8 @@
810938
811939 boolean changedir = random && Math.random() < 0.01; // && !link2master;
812940
813
- if (transformcount*factor > maxcount || (step == 1 && changedir))
941
+ if (transformcount*factor >= maxcount && (rewind || random) ||
942
+ (step == 1 && changedir))
814943 {
815944 countdown = 1;
816945 delay = speedup?8:1;
....@@ -882,6 +1011,7 @@
8821011 if (material == null || material.multiply)
8831012 return true;
8841013
1014
+ // Transparent objects are dynamic because we have to sort the triangles.
8851015 return material.opacity > 0.99;
8861016 }
8871017
....@@ -1282,6 +1412,7 @@
12821412 toParent = LA.newMatrix();
12831413 fromParent = LA.newMatrix();
12841414 }
1415
+
12851416 LA.matCopy(other.toParent, toParent);
12861417 LA.matCopy(other.fromParent, fromParent);
12871418
....@@ -2303,6 +2434,10 @@
23032434 }
23042435 */
23052436 }
2437
+ else
2438
+ {
2439
+ //((ObjEditor)editWindow).SetupUI2(null);
2440
+ }
23062441 }
23072442
23082443 void createEditWindow(GroupEditor callee, boolean newWindow) //, boolean root)
....@@ -2344,6 +2479,14 @@
23442479 {
23452480 editWindow.refreshContents();
23462481 }
2482
+ else
2483
+ {
2484
+ if (manipWindow != null)
2485
+ {
2486
+ manipWindow.refreshContents();
2487
+ }
2488
+ }
2489
+
23472490 //if (parent != null)
23482491 //parent.refreshEditWindow();
23492492 }
....@@ -2628,6 +2771,18 @@
26282771 //Touch();
26292772 }
26302773
2774
+ void GenNormalsMeshS()
2775
+ {
2776
+ selection.GenNormalsMesh();
2777
+// for (int i=0; i<selection.size(); i++)
2778
+// {
2779
+// Object3D selectee = (Object3D) selection.elementAt(i);
2780
+// selectee.GenNormals(crease);
2781
+// }
2782
+
2783
+ //Touch();
2784
+ }
2785
+
26312786 void ClearColorsS()
26322787 {
26332788 selection.ClearColors();
....@@ -2759,6 +2914,24 @@
27592914 if (child == null)
27602915 continue;
27612916 child.GenNormals(crease);
2917
+// Children().release(i);
2918
+ }
2919
+ blockloop = false;
2920
+ }
2921
+
2922
+ void GenNormalsMesh()
2923
+ {
2924
+ if (blockloop)
2925
+ return;
2926
+
2927
+ blockloop = true;
2928
+ GenNormalsMesh0();
2929
+ for (int i = 0; i < Children().Size(); i++)
2930
+ {
2931
+ Object3D child = (Object3D) Children().get(i); // reserve(i);
2932
+ if (child == null)
2933
+ continue;
2934
+ child.GenNormalsMesh();
27622935 // Children().release(i);
27632936 }
27642937 blockloop = false;
....@@ -2927,6 +3100,15 @@
29273100 if (bRep != null)
29283101 {
29293102 bRep.GenerateNormals(crease);
3103
+ Touch();
3104
+ }
3105
+ }
3106
+
3107
+ void GenNormalsMesh0()
3108
+ {
3109
+ if (bRep != null)
3110
+ {
3111
+ bRep.GenerateNormalsMesh();
29303112 Touch();
29313113 }
29323114 }
....@@ -3381,7 +3563,8 @@
33813563 if (blockloop)
33823564 return;
33833565
3384
- if (marked || (bRep != null && material != null)) // borderline...
3566
+ if (//marked || // does not make sense
3567
+ (bRep != null || material != null)) // borderline...
33853568 live = h;
33863569
33873570 for (int i = 0; i < Size(); i++)
....@@ -3402,7 +3585,8 @@
34023585 return;
34033586
34043587 //if (bRep != null)
3405
- if (marked || (bRep != null && material != null)) // borderline...
3588
+ if (//marked || // does not make sense
3589
+ (bRep != null || material != null)) // borderline...
34063590 link2master = h;
34073591
34083592 for (int i = 0; i < Size(); i++)
....@@ -3422,7 +3606,8 @@
34223606 if (blockloop)
34233607 return;
34243608
3425
- if (marked || (bRep != null && material != null)) // borderline...
3609
+ if (//marked || // does not make sense
3610
+ (bRep != null || material != null)) // borderline...
34263611 hide = h;
34273612
34283613 for (int i = 0; i < Size(); i++)
....@@ -3442,7 +3627,7 @@
34423627 if (blockloop)
34433628 return;
34443629
3445
- if (bRep != null && material != null) // borderline...
3630
+ if (bRep != null || material != null) // borderline...
34463631 marked = h;
34473632
34483633 for (int i = 0; i < Size(); i++)
....@@ -3452,6 +3637,46 @@
34523637 continue;
34533638 blockloop = true;
34543639 child.MarkLeaves(h);
3640
+ blockloop = false;
3641
+ // release(i);
3642
+ }
3643
+ }
3644
+
3645
+ void RewindLeaves(boolean h)
3646
+ {
3647
+ if (blockloop)
3648
+ return;
3649
+
3650
+ if (bRep != null || material != null) // borderline...
3651
+ rewind = h;
3652
+
3653
+ for (int i = 0; i < Size(); i++)
3654
+ {
3655
+ Object3D child = (Object3D) get(i); // reserve(i);
3656
+ if (child == null)
3657
+ continue;
3658
+ blockloop = true;
3659
+ child.RewindLeaves(h);
3660
+ blockloop = false;
3661
+ // release(i);
3662
+ }
3663
+ }
3664
+
3665
+ void RandomLeaves(boolean h)
3666
+ {
3667
+ if (blockloop)
3668
+ return;
3669
+
3670
+ if (bRep != null || material != null) // borderline...
3671
+ random = h;
3672
+
3673
+ for (int i = 0; i < Size(); i++)
3674
+ {
3675
+ Object3D child = (Object3D) get(i); // reserve(i);
3676
+ if (child == null)
3677
+ continue;
3678
+ blockloop = true;
3679
+ child.RandomLeaves(h);
34553680 blockloop = false;
34563681 // release(i);
34573682 }
....@@ -4229,6 +4454,55 @@
42294454 }
42304455 }
42314456
4457
+ void RepairSOV()
4458
+ {
4459
+ if (blockloop)
4460
+ return;
4461
+
4462
+ String texname = this.GetPigmentTexture();
4463
+
4464
+ if (texname.startsWith("sov"))
4465
+ {
4466
+ String[] s = texname.split("/");
4467
+
4468
+ String[] sname = s[1].split("Color.pn");
4469
+
4470
+ texname = sname[0];
4471
+
4472
+ if (sname.length > 1)
4473
+ {
4474
+ texname += "Color.jpg";
4475
+ }
4476
+
4477
+ this.SetPigmentTexture("sov/" + texname);
4478
+ }
4479
+
4480
+ texname = this.GetBumpTexture();
4481
+
4482
+ if (texname.startsWith("sov"))
4483
+ {
4484
+ String[] s = texname.split("/");
4485
+
4486
+ String[] sname = s[1].split("Bump.pn");
4487
+
4488
+ texname = sname[0];
4489
+
4490
+ if (sname.length > 1)
4491
+ {
4492
+ texname += "Bump.jpg";
4493
+ }
4494
+
4495
+ this.SetBumpTexture("sov/" + texname);
4496
+ }
4497
+
4498
+ for (int i=0; i<Size(); i++)
4499
+ {
4500
+ blockloop = true;
4501
+ get(i).RepairSOV();
4502
+ blockloop = false;
4503
+ }
4504
+ }
4505
+
42324506 void RepairTexture()
42334507 {
42344508 if (this instanceof FileObject || blockloop)
....@@ -4743,6 +5017,14 @@
47435017 }
47445018 }
47455019
5020
+ ObjEditor GetWindow()
5021
+ {
5022
+ if (editWindow != null)
5023
+ return editWindow;
5024
+
5025
+ return manipWindow;
5026
+ }
5027
+
47465028 cTreePath Select(int indexcount, boolean deselect)
47475029 {
47485030 if (hide || dontselect)
....@@ -4779,10 +5061,11 @@
47795061 if (leaf != null)
47805062 {
47815063 cTreePath tp = new cTreePath(this, leaf);
4782
- if (editWindow != null)
5064
+ ObjEditor window = GetWindow();
5065
+ if (window != null)
47835066 {
47845067 //System.out.println("editWindow = " + editWindow + " vs " + this);
4785
- editWindow.Select(tp, deselect, true);
5068
+ window.Select(tp, deselect, true);
47865069 }
47875070
47885071 return tp;
....@@ -4799,6 +5082,7 @@
47995082
48005083 if (child == null)
48015084 continue;
5085
+
48025086 if (child.HasTransparency() && child.size() != 0)
48035087 {
48045088 cTreePath leaf = child.Select(indexcount, deselect);
....@@ -4808,9 +5092,10 @@
48085092 if (leaf != null)
48095093 {
48105094 cTreePath tp = new cTreePath(this, leaf);
4811
- if (editWindow != null)
5095
+ ObjEditor window = GetWindow();
5096
+ if (window != null)
48125097 {
4813
- editWindow.Select(tp, deselect, true);
5098
+ window.Select(tp, deselect, true);
48145099 }
48155100
48165101 return tp;
....@@ -5371,6 +5656,43 @@
53715656 }
53725657 }
53735658
5659
+ UUID GetUUID()
5660
+ {
5661
+ if (uuid == null)
5662
+ {
5663
+ // Serial
5664
+ uuid = UUID.randomUUID();
5665
+ }
5666
+
5667
+ return uuid;
5668
+ }
5669
+
5670
+ Object3D GetObject(UUID uid)
5671
+ {
5672
+ if (blockloop)
5673
+ return null;
5674
+
5675
+ if (GetUUID().equals(uid))
5676
+ return this;
5677
+
5678
+ int nb = Size();
5679
+ for (int i = 0; i < nb; i++)
5680
+ {
5681
+ Object3D child = (Object3D) get(i);
5682
+
5683
+ if (child == null)
5684
+ continue;
5685
+
5686
+ blockloop = true;
5687
+ Object3D obj = child.GetObject(uid);
5688
+ blockloop = false;
5689
+ if (obj != null)
5690
+ return obj;
5691
+ }
5692
+
5693
+ return null;
5694
+ }
5695
+
53745696 void SetBumpTexture(String tex)
53755697 {
53765698 if (GetTextures() == null)
....@@ -5415,12 +5737,23 @@
54155737 boolean NeedSupport()
54165738 {
54175739 return
5418
- CameraPane.SUPPORT && (!CameraPane.movingcamera || !Globals.FREEZEONMOVE) && link2master && /*live &&*/ support != null
5740
+ CameraPane.SUPPORT && (!CameraPane.movingcamera || (!Globals.FREEZEONMOVE && Globals.isLIVE())) && link2master && /*live &&*/ support != null
54195741 // PROBLEM with CROWD!!
54205742 && (Globals.DrawMode() == iCameraPane.SHADOW || !Globals.RENDERSHADOW || Globals.CROWD);
54215743 }
54225744
54235745 static boolean DEBUG_SELECTION = false;
5746
+
5747
+ boolean IsLive()
5748
+ {
5749
+ if (live)
5750
+ return true;
5751
+
5752
+ if (parent == null)
5753
+ return false;
5754
+
5755
+ return parent.IsLive();
5756
+ }
54245757
54255758 void Draw(iCameraPane display, Object3D /*Composite*/ root, boolean selected, boolean blocked)
54265759 {
....@@ -5483,7 +5816,7 @@
54835816 support = support;
54845817
54855818 //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);
5819
+ boolean usecalllists = !IsLive(); // IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null) && !link2master; // !(this instanceof cSpring) && !(this instanceof BezierPatch);
54875820
54885821 if (!usecalllists && bRep != null && bRep.displaylist > 0)
54895822 {
....@@ -5503,10 +5836,12 @@
55035836 boolean selectmode = display.DrawMode() == display.SELECTION || display.IsDebugSelection();
55045837
55055838 if (!selectmode && //display.DrawMode() != display.SELECTION &&
5506
- (touched || (bRep != null && bRep.displaylist <= 0)))
5839
+ //(touched || (bRep != null && bRep.displaylist <= 0)))
5840
+ (Globals.isLIVE() && Globals.COMPUTESHADOWWHENLIVE || touched && Globals.COMPUTESHADOWWHENLIVE)) // || (bRep != null && bRep.displaylist <= 0)))
55075841 {
55085842 Globals.lighttouched = true;
55095843 } // all panes...
5844
+
55105845 //if (usecalllists && display.DrawMode() != display.SELECTION && display.DrawMode() != display.SHADOW &&
55115846 if (bRep != null && usecalllists && !selectmode && // june 2013 display.DrawMode() != display.SHADOW &&
55125847 (touched || (bRep != null && bRep.displaylist <= 0)))
....@@ -5634,6 +5969,7 @@
56345969 if (GetBRep() != null)
56355970 {
56365971 display.NextIndex();
5972
+
56375973 // vertex color conflict : gl.glCallList(list);
56385974 DrawNode(display, root, selected);
56395975 if (this instanceof BezierPatch)
....@@ -5674,16 +6010,27 @@
56746010 tex = GetTextures();
56756011 }
56766012
5677
- boolean failed = false;
6013
+ boolean failedPigment = false;
6014
+ boolean failedBump = false;
56786015
56796016 try
56806017 {
5681
- display.BindTextures(tex, texres);
6018
+ display.BindPigmentTexture(tex, texres);
56826019 }
56836020 catch (Exception e)
56846021 {
56856022 System.err.println("FAILED: " + this);
5686
- failed = true;
6023
+ failedPigment = true;
6024
+ }
6025
+
6026
+ try
6027
+ {
6028
+ display.BindBumpTexture(tex, texres);
6029
+ }
6030
+ catch (Exception e)
6031
+ {
6032
+ //System.err.println("FAILED: " + this);
6033
+ failedBump = true;
56876034 }
56886035
56896036 if (!compiled)
....@@ -5706,8 +6053,11 @@
57066053 }
57076054 }
57086055
5709
- if (!failed)
5710
- display.ReleaseTextures(tex);
6056
+ if (!failedBump)
6057
+ display.ReleaseBumpTexture(tex);
6058
+
6059
+ if (!failedPigment)
6060
+ display.ReleasePigmentTexture(tex);
57116061
57126062 display.PopMaterial(this, selected);
57136063 }
....@@ -6080,6 +6430,11 @@
60806430 // dec 2012
60816431 new Exception().printStackTrace();
60826432 return;
6433
+ }
6434
+
6435
+ if (dontselect)
6436
+ {
6437
+ //bRep.GenerateNormalsMINE();
60836438 }
60846439
60856440 display.DrawGeometry(bRep, flipV, selectmode);
....@@ -6932,7 +7287,7 @@
69327287 spot.translate(32, 32);
69337288 spotw = spot.x + spot.width;
69347289 spoth = spot.y + spot.height;
6935
- info.g.setColor(Color.blue);
7290
+ info.g.setColor(Color.cyan);
69367291 info.g.fillRect(spot.x, spot.y, spot.width, spot.height);
69377292 // if (CameraPane.Xmin > spot.x)
69387293 // {
....@@ -6950,11 +7305,12 @@
69507305 // {
69517306 // CameraPane.Ymax = spoth;
69527307 // }
6953
- // bonhommes info.g.drawLine(spotw, spoth, spotw, spoth - 15);
6954
- //info.g.drawLine(spotw, spoth, spotw - 15, spoth);
7308
+ // bonhommes info.g.drawLine(spotw, spoth, spotw, spoth - boundary.height/2); // 15
7309
+ //info.g.drawLine(spotw, spoth, spotw - boundary.width/2, spoth); // 15
69557310 spot.translate(0, -32);
6956
- info.g.setColor(Color.green);
7311
+ info.g.setColor(Color.yellow);
69577312 info.g.fillRect(spot.x, spot.y, spot.width, spot.height);
7313
+ info.g.setColor(Color.green);
69587314 // if (CameraPane.Xmin > spot.x)
69597315 // {
69607316 // CameraPane.Xmin = spot.x;
....@@ -6971,8 +7327,8 @@
69717327 // {
69727328 // CameraPane.Ymax = spoth;
69737329 // }
6974
- info.g.drawArc(boundary.x, boundary.y,
6975
- boundary.width, boundary.height, 0, 360);
7330
+ info.g.drawArc(boundary.x + info.DX, boundary.y + info.DY,
7331
+ (int)(boundary.width * info.W), (int)(boundary.height * info.W), 0, 360);
69767332 //info.g.drawArc(spot.x, spotw, spot.width/2, boundary.height/2, 0, 360);
69777333 // if (CameraPane.Xmin > boundary.x)
69787334 // {
....@@ -7272,19 +7628,20 @@
72727628 switch (info.pane.RenderCamera().viewCode)
72737629 {
72747630 case 3: // '\001'
7275
- if (modified)
7631
+ if (modified || opposite)
72767632 {
72777633 //LA.matScale(toParent, 1, hScale, vScale);
72787634 LA.matScale(toParent, totalScale, 1, 1);
72797635 } // vScale, 1);
72807636 else
72817637 {
7638
+ // EXCEPTION!
72827639 LA.matScale(toParent, totalScale, totalScale, totalScale);
72837640 } // vScale, 1);
72847641 break;
72857642
72867643 case 2: // '\002'
7287
- if (modified)
7644
+ if (modified || opposite)
72887645 {
72897646 //LA.matScale(toParent, hScale, 1, vScale);
72907647 LA.matScale(toParent, 1, totalScale, 1);
....@@ -7295,7 +7652,7 @@
72957652 break;
72967653
72977654 case 1: // '\003'
7298
- if (modified)
7655
+ if (modified || opposite)
72997656 {
73007657 //LA.matScale(toParent, hScale, vScale, 1);
73017658 LA.matScale(toParent, 1, 1, totalScale);
....@@ -7515,6 +7872,10 @@
75157872 editWindow = null;
75167873 } // ?
75177874 }
7875
+ else
7876
+ {
7877
+ //editWindow.closeUI();
7878
+ }
75187879 }
75197880
75207881 boolean root; // patch for edit windows
....@@ -7526,7 +7887,7 @@
75267887 /*transient*/ cVector2[] projectedVertices = new cVector2[0];
75277888
75287889 Object3D /*Composite*/ parent;
7529
- Object3D /*Composite*/ fileparent;
7890
+ Object3D /*Composite*/ fileparent; // In the case of FileObject
75307891
75317892 double[][] toParent; // dynamic matrix
75327893 double[][] fromParent;
....@@ -7672,6 +8033,10 @@
76728033 }
76738034
76748035 transient ObjEditor editWindow;
8036
+ transient ObjEditor manipWindow;
8037
+
8038
+ transient boolean pinned;
8039
+
76758040 transient ObjectUI objectUI;
76768041 public static int povDepth = 0;
76778042 private static cVector tbMin = new cVector();