Normand Briere
2019-06-16 372b7fd481a476cd659713a4a01bf28bf6760cbe
Object3D.java
....@@ -14,11 +14,20 @@
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;
24
+
25
+ private UUID uuid = UUID.randomUUID();
26
+
27
+ // TEMPORARY for mocap undo
28
+ mocap.reader.BVHReader.BVHResult bvh;
29
+ Object3D skeleton;
30
+ //
2231
2332 ScriptNode scriptnode;
2433
....@@ -100,64 +109,136 @@
100109
101110 // transient boolean reduced; // for morph reduction
102111
103
-transient com.bulletphysics.linearmath.Transform cache; // for fast merge
104
-transient com.bulletphysics.linearmath.Transform cache_1; // for fast merge
112
+ transient com.bulletphysics.linearmath.Transform cache; // for fast merge
113
+ transient com.bulletphysics.linearmath.Transform cache_1; // for fast merge
105114
106
-transient Object3D transientsupport; // for cloning
107
-transient boolean transientlink2master;
115
+ transient Object3D transientsupport; // for cloning
116
+ transient boolean transientlink2master;
108117
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)
118
+ void SaveSupports()
121119 {
122
- bRep.SaveSupports();
123
- }
124
-
125
- for (int i = 0; i < Size(); i++)
126
- {
127
- Object3D child = (Object3D) get(i);
128
- if (child == null)
129
- continue;
130
- blockloop = true;
131
- child.SaveSupports();
132
- blockloop = false;
133
- }
134
-}
120
+ if (blockloop)
121
+ return;
135122
136
-void RestoreSupports()
137
-{
138
- if (blockloop)
139
- return;
123
+ transientsupport = support;
124
+ transientlink2master = link2master;
140125
141
- support = transientsupport;
142
- link2master = transientlink2master;
143
- transientsupport = null;
144
- transientlink2master = false;
145
-
146
- if (bRep != null)
147
- {
148
- bRep.RestoreSupports();
126
+ support = null;
127
+ link2master = false;
128
+
129
+ if (bRep != null)
130
+ {
131
+ bRep.SaveSupports();
132
+ }
133
+
134
+ for (int i = 0; i < Size(); i++)
135
+ {
136
+ Object3D child = (Object3D) get(i);
137
+ if (child == null)
138
+ continue;
139
+ blockloop = true;
140
+ child.SaveSupports();
141
+ blockloop = false;
142
+ }
149143 }
150
-
151
- for (int i = 0; i < Size(); i++)
144
+
145
+ void RestoreSupports()
152146 {
153
- Object3D child = (Object3D) get(i);
154
- if (child == null)
155
- continue;
156
- blockloop = true;
157
- child.RestoreSupports();
158
- blockloop = false;
147
+ if (blockloop)
148
+ return;
149
+
150
+ support = transientsupport;
151
+ link2master = transientlink2master;
152
+ transientsupport = null;
153
+ transientlink2master = false;
154
+
155
+ if (bRep != null)
156
+ {
157
+ bRep.RestoreSupports();
158
+ }
159
+
160
+ for (int i = 0; i < Size(); i++)
161
+ {
162
+ Object3D child = (Object3D) get(i);
163
+ if (child == null)
164
+ continue;
165
+ blockloop = true;
166
+ child.RestoreSupports();
167
+ blockloop = false;
168
+ }
159169 }
160
-}
170
+
171
+ void ExtractBigData(java.util.Hashtable<java.util.UUID, Object3D> hashtable)
172
+ {
173
+ if (hashtable.containsKey(GetUUID()))
174
+ {
175
+ Object3D o = hashtable.get(GetUUID());
176
+
177
+ Grafreed.Assert(this.bRep == o.bRep);
178
+ if (this.bRep != null)
179
+ assert(this.bRep.support == o.transientrep);
180
+
181
+ return;
182
+ }
183
+
184
+ Object3D o = new Object3D();
185
+
186
+ hashtable.put(GetUUID(), o);
187
+
188
+ for (int i=0; i<Size(); i++)
189
+ {
190
+ get(i).ExtractBigData(hashtable);
191
+ }
192
+
193
+ ExtractBigData(o);
194
+ }
195
+
196
+ void ExtractBigData(Object3D o)
197
+ {
198
+ o.bRep = this.bRep;
199
+ if (this.bRep != null)
200
+ {
201
+ o.transientrep = this.bRep.support;
202
+ o.bRep.support = null;
203
+ }
204
+
205
+ // o.support = this.support;
206
+ // o.fileparent = this.fileparent;
207
+ // if (this.bRep != null)
208
+ // o.bRep = this.bRep.support;
209
+
210
+ this.bRep = null;
211
+ // if (this.bRep != null)
212
+ // this.bRep.support = null;
213
+ // this.support = null;
214
+ // this.fileparent = null;
215
+ }
216
+
217
+ void RestoreBigData(java.util.Hashtable<java.util.UUID, Object3D> hashtable)
218
+ {
219
+ if (!hashtable.containsKey(GetUUID()))
220
+ return;
221
+
222
+ Object3D o = hashtable.get(GetUUID());
223
+
224
+ RestoreBigData(o);
225
+
226
+ hashtable.remove(GetUUID());
227
+
228
+ for (int i=0; i<Size(); i++)
229
+ {
230
+ get(i).RestoreBigData(hashtable);
231
+ }
232
+ }
233
+
234
+ void RestoreBigData(Object3D o)
235
+ {
236
+ this.bRep = o.bRep;
237
+ if (this.bRep != null)
238
+ this.bRep.support = o.transientrep;
239
+ // this.support = o.support;
240
+ // this.fileparent = o.fileparent;
241
+ }
161242
162243 // MOCAP SUPPORT
163244 double tx,ty,tz,rx,ry,rz;
....@@ -300,6 +381,7 @@
300381 }
301382
302383 boolean live = false;
384
+ boolean dontselect = false;
303385 boolean hide = false;
304386 boolean link2master = false; // performs reset support/master at each frame
305387 boolean marked = false; // animation node
....@@ -481,12 +563,14 @@
481563 toParent = LA.newMatrix();
482564 fromParent = LA.newMatrix();
483565 }
566
+
484567 if (toParentMarked == null)
485568 {
486569 if (maxcount != 1)
487570 {
488571 new Exception().printStackTrace();
489572 }
573
+
490574 toParentMarked = LA.newMatrix();
491575 fromParentMarked = LA.newMatrix();
492576 }
....@@ -774,7 +858,7 @@
774858 if (step == 0)
775859 step = 1;
776860 if (maxcount == 0)
777
- maxcount = 2048; // 4;
861
+ maxcount = 128; // 2048; // 4;
778862 // if (acceleration == 0)
779863 // acceleration = 10;
780864 if (delay == 0) // serial
....@@ -797,7 +881,7 @@
797881
798882 if (marked && Globals.isLIVE() && live &&
799883 //TEMP21aug2018
800
- Globals.DrawMode() == iCameraPane.SHADOW &&
884
+ (Globals.DrawMode() == iCameraPane.SHADOW || !Globals.RENDERSHADOW) &&
801885 currentframe != Globals.framecount)
802886 {
803887 currentframe = Globals.framecount;
....@@ -912,6 +996,11 @@
912996 fromParent = null; // LA.newMatrix();
913997 bRep = null; // new BoundaryRep();
914998
999
+ if (oname != null && oname.equals("LeftHand"))
1000
+ {
1001
+ name = oname;
1002
+ }
1003
+
9151004 /*
9161005 float hue = (float)Math.random();
9171006 Color col;
....@@ -954,7 +1043,7 @@
9541043
9551044 public Object clone()
9561045 {
957
- return GrafreeD.clone(this);
1046
+ return Grafreed.clone(this);
9581047 }
9591048
9601049 Object3D copyExpand()
....@@ -1470,7 +1559,7 @@
14701559 BoundaryRep.SEUIL = other.material.cameralight;
14711560
14721561 // Set default to 0.1
1473
- BoundaryRep.SEUIL /= 2;
1562
+ BoundaryRep.SEUIL /= 4; // 2;
14741563 System.out.println("SEUIL = " + BoundaryRep.SEUIL);
14751564 }
14761565
....@@ -1729,7 +1818,7 @@
17291818 Object3D o = new Object3D((clone?"Ge:":"Li:") + this.name);
17301819 o.bRep = transientrep;
17311820 if (clone)
1732
- o.bRep = (BoundaryRep) GrafreeD.clone(transientrep);
1821
+ o.bRep = (BoundaryRep) Grafreed.clone(transientrep);
17331822 o.CreateMaterial();
17341823 o.SetAttributes(this, -1);
17351824 //parent
....@@ -1742,7 +1831,7 @@
17421831 Object3D o = new Object3D((clone?"Ge:":"Li:") + this.name);
17431832 o.bRep = bRep;
17441833 if (clone)
1745
- o.bRep = (BoundaryRep) GrafreeD.clone(bRep);
1834
+ o.bRep = (BoundaryRep) Grafreed.clone(bRep);
17461835 o.CreateMaterial();
17471836 //o.overwriteThis(this, -1);
17481837 o.SetAttributes(this, -1);
....@@ -1829,12 +1918,15 @@
18291918 if (obj.name == null)
18301919 continue; // can't be a null one
18311920
1921
+ // Try perfect match first.
18321922 if (n.equals(obj.name))
18331923 {
18341924 theobj = obj;
18351925 count++;
18361926 }
18371927 }
1928
+
1929
+ // not needed: n = n.split(":")[0]; // Poser generates a count
18381930
18391931 if (count != 1)
18401932 for (int i=Size(); --i>=0;)
....@@ -2619,6 +2711,18 @@
26192711 //Touch();
26202712 }
26212713
2714
+ void GenNormalsMeshS()
2715
+ {
2716
+ selection.GenNormalsMesh();
2717
+// for (int i=0; i<selection.size(); i++)
2718
+// {
2719
+// Object3D selectee = (Object3D) selection.elementAt(i);
2720
+// selectee.GenNormals(crease);
2721
+// }
2722
+
2723
+ //Touch();
2724
+ }
2725
+
26222726 void ClearColorsS()
26232727 {
26242728 selection.ClearColors();
....@@ -2750,6 +2854,24 @@
27502854 if (child == null)
27512855 continue;
27522856 child.GenNormals(crease);
2857
+// Children().release(i);
2858
+ }
2859
+ blockloop = false;
2860
+ }
2861
+
2862
+ void GenNormalsMesh()
2863
+ {
2864
+ if (blockloop)
2865
+ return;
2866
+
2867
+ blockloop = true;
2868
+ GenNormalsMesh0();
2869
+ for (int i = 0; i < Children().Size(); i++)
2870
+ {
2871
+ Object3D child = (Object3D) Children().get(i); // reserve(i);
2872
+ if (child == null)
2873
+ continue;
2874
+ child.GenNormalsMesh();
27532875 // Children().release(i);
27542876 }
27552877 blockloop = false;
....@@ -2922,6 +3044,15 @@
29223044 }
29233045 }
29243046
3047
+ void GenNormalsMesh0()
3048
+ {
3049
+ if (bRep != null)
3050
+ {
3051
+ bRep.GenerateNormalsMesh();
3052
+ Touch();
3053
+ }
3054
+ }
3055
+
29253056 void GenNormalsMINE0()
29263057 {
29273058 if (bRep != null)
....@@ -2983,6 +3114,33 @@
29833114 blockloop = false;
29843115 }
29853116
3117
+ void TransformChildren()
3118
+ {
3119
+ if (toParent != null)
3120
+ {
3121
+ for (int i=Size(); --i>=0;)
3122
+ {
3123
+ Object3D v = get(i);
3124
+
3125
+ if (v.toParent == null)
3126
+ {
3127
+ v.toParent = LA.newMatrix();
3128
+ v.fromParent = LA.newMatrix();
3129
+ }
3130
+
3131
+// LA.matConcat(v.toParent, toParent, v.toParent);
3132
+// LA.matConcat(fromParent, v.fromParent, v.fromParent);
3133
+ LA.matConcat(toParent, v.toParent, v.toParent);
3134
+ LA.matConcat(v.fromParent, fromParent, v.fromParent);
3135
+ }
3136
+
3137
+ toParent = null; // LA.matIdentity(toParent);
3138
+ fromParent = null; // LA.matIdentity(fromParent);
3139
+
3140
+ Touch();
3141
+ }
3142
+ }
3143
+
29863144 void TransformGeometry()
29873145 {
29883146 Object3D obj = this;
....@@ -3204,9 +3362,11 @@
32043362
32053363 BoundaryRep sup = bRep.support;
32063364 bRep.support = null;
3207
- BoundaryRep temprep = (BoundaryRep) GrafreeD.clone(bRep);
3365
+ BoundaryRep temprep = (BoundaryRep) Grafreed.clone(bRep);
32083366 // bRep.SplitInTwo(onlyone); // thread...
3209
- temprep.SplitInTwo(reduction34, onlyone);
3367
+
3368
+ while(temprep.SplitInTwo(reduction34, onlyone));
3369
+
32103370 bRep = temprep;
32113371 bRep.support = sup;
32123372 Touch();
....@@ -3728,7 +3888,7 @@
37283888 if (child == null)
37293889 continue;
37303890
3731
- if (GrafreeD.RENDERME > 0)
3891
+ if (Grafreed.RENDERME > 0)
37323892 {
37333893 if (child instanceof Merge)
37343894 ((Merge)child).renderme();
....@@ -3879,7 +4039,7 @@
38794039 if (child == null)
38804040 continue;
38814041
3882
- if (GrafreeD.RENDERME > 0)
4042
+ if (Grafreed.RENDERME > 0)
38834043 {
38844044 if (child instanceof Merge)
38854045 ((Merge)child).renderme();
....@@ -4074,7 +4234,7 @@
40744234 if (child == null)
40754235 continue;
40764236
4077
- if (GrafreeD.RENDERME > 0)
4237
+ if (Grafreed.RENDERME > 0)
40784238 {
40794239 if (child instanceof Merge)
40804240 ((Merge)child).renderme();
....@@ -4681,7 +4841,7 @@
46814841
46824842 cTreePath SelectLeaf(int indexcount, boolean deselect)
46834843 {
4684
- if (hide)
4844
+ if (hide || dontselect)
46854845 return null;
46864846
46874847 if (count <= 0)
....@@ -4707,7 +4867,7 @@
47074867
47084868 cTreePath Select(int indexcount, boolean deselect)
47094869 {
4710
- if (hide)
4870
+ if (hide || dontselect)
47114871 return null;
47124872
47134873 if (count <= 0)
....@@ -5333,6 +5493,43 @@
53335493 }
53345494 }
53355495
5496
+ UUID GetUUID()
5497
+ {
5498
+ if (uuid == null)
5499
+ {
5500
+ // Serial
5501
+ uuid = UUID.randomUUID();
5502
+ }
5503
+
5504
+ return uuid;
5505
+ }
5506
+
5507
+ Object3D GetObject(UUID uid)
5508
+ {
5509
+ if (blockloop)
5510
+ return null;
5511
+
5512
+ if (GetUUID().equals(uid))
5513
+ return this;
5514
+
5515
+ int nb = Size();
5516
+ for (int i = 0; i < nb; i++)
5517
+ {
5518
+ Object3D child = (Object3D) get(i);
5519
+
5520
+ if (child == null)
5521
+ continue;
5522
+
5523
+ blockloop = true;
5524
+ Object3D obj = child.GetObject(uid);
5525
+ blockloop = false;
5526
+ if (obj != null)
5527
+ return obj;
5528
+ }
5529
+
5530
+ return null;
5531
+ }
5532
+
53365533 void SetBumpTexture(String tex)
53375534 {
53385535 if (GetTextures() == null)
....@@ -5377,12 +5574,23 @@
53775574 boolean NeedSupport()
53785575 {
53795576 return
5380
- CameraPane.SUPPORT && !CameraPane.movingcamera && link2master && /*live &&*/ support != null
5577
+ CameraPane.SUPPORT && (!CameraPane.movingcamera || (!Globals.FREEZEONMOVE && Globals.isLIVE())) && link2master && /*live &&*/ support != null
53815578 // PROBLEM with CROWD!!
5382
- && (Globals.DrawMode() == iCameraPane.SHADOW || Globals.CROWD);
5579
+ && (Globals.DrawMode() == iCameraPane.SHADOW || !Globals.RENDERSHADOW || Globals.CROWD);
53835580 }
53845581
53855582 static boolean DEBUG_SELECTION = false;
5583
+
5584
+ boolean IsLive()
5585
+ {
5586
+ if (live)
5587
+ return true;
5588
+
5589
+ if (parent == null)
5590
+ return false;
5591
+
5592
+ return parent.IsLive();
5593
+ }
53865594
53875595 void Draw(iCameraPane display, Object3D /*Composite*/ root, boolean selected, boolean blocked)
53885596 {
....@@ -5394,7 +5602,7 @@
53945602 }
53955603
53965604 if (display.DrawMode() == iCameraPane.SELECTION &&
5397
- hide)
5605
+ (hide || dontselect))
53985606 return;
53995607
54005608 if (name != null && name.contains("sclera"))
....@@ -5445,7 +5653,7 @@
54455653 support = support;
54465654
54475655 //boolean usecalllists = IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null || !link2master); // !(this instanceof cSpring) && !(this instanceof BezierPatch);
5448
- boolean usecalllists = false; // IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null) && !link2master; // !(this instanceof cSpring) && !(this instanceof BezierPatch);
5656
+ boolean usecalllists = IsLive(); // IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null) && !link2master; // !(this instanceof cSpring) && !(this instanceof BezierPatch);
54495657
54505658 if (!usecalllists && bRep != null && bRep.displaylist > 0)
54515659 {
....@@ -5636,7 +5844,17 @@
56365844 tex = GetTextures();
56375845 }
56385846
5639
- display.BindTextures(tex, texres);
5847
+ boolean failed = false;
5848
+
5849
+ try
5850
+ {
5851
+ display.BindTextures(tex, texres);
5852
+ }
5853
+ catch (Exception e)
5854
+ {
5855
+ System.err.println("FAILED: " + this);
5856
+ failed = true;
5857
+ }
56405858
56415859 if (!compiled)
56425860 {
....@@ -5658,7 +5876,8 @@
56585876 }
56595877 }
56605878
5661
- display.ReleaseTextures(tex);
5879
+ if (!failed)
5880
+ display.ReleaseTextures(tex);
56625881
56635882 display.PopMaterial(this, selected);
56645883 }
....@@ -5787,6 +6006,9 @@
57876006
57886007 void drawSelf(iCameraPane display, Object3D /*Composite*/ root, boolean selected, boolean blocked)
57896008 {
6009
+ if (display.DrawMode() == iCameraPane.SELECTION && dontselect)
6010
+ return;
6011
+
57906012 if (hide)
57916013 return;
57926014 // shadow optimisation
....@@ -5911,6 +6133,9 @@
59116133 {
59126134 if (display.DrawMode() == display.SHADOW && projectedVertices != null && projectedVertices.length > 2 && projectedVertices[2].y >= 10000)
59136135 return; // no shadow for transparent objects
6136
+
6137
+ if (display.DrawMode() == iCameraPane.SELECTION && dontselect)
6138
+ return;
59146139
59156140 if (hide)
59166141 return;
....@@ -6877,7 +7102,7 @@
68777102 spot.translate(32, 32);
68787103 spotw = spot.x + spot.width;
68797104 spoth = spot.y + spot.height;
6880
- info.g.setColor(Color.blue);
7105
+ info.g.setColor(Color.cyan);
68817106 info.g.fillRect(spot.x, spot.y, spot.width, spot.height);
68827107 // if (CameraPane.Xmin > spot.x)
68837108 // {
....@@ -6895,11 +7120,12 @@
68957120 // {
68967121 // CameraPane.Ymax = spoth;
68977122 // }
6898
- info.g.drawLine(spotw, spoth, spotw, spoth - 15);
6899
- info.g.drawLine(spotw, spoth, spotw - 15, spoth);
7123
+ // bonhommes info.g.drawLine(spotw, spoth, spotw, spoth - boundary.height/2); // 15
7124
+ //info.g.drawLine(spotw, spoth, spotw - boundary.width/2, spoth); // 15
69007125 spot.translate(0, -32);
6901
- info.g.setColor(Color.green);
7126
+ info.g.setColor(Color.yellow);
69027127 info.g.fillRect(spot.x, spot.y, spot.width, spot.height);
7128
+ info.g.setColor(Color.green);
69037129 // if (CameraPane.Xmin > spot.x)
69047130 // {
69057131 // CameraPane.Xmin = spot.x;
....@@ -6951,7 +7177,7 @@
69517177 startX = info.x;
69527178 startY = info.y;
69537179
6954
- hitSomething = 0;
7180
+ hitSomething = -1;
69557181 cVector origin = new cVector();
69567182 //LA.xformPos(origin, toParent, origin);
69577183 Rectangle spot = new Rectangle();
....@@ -7027,6 +7253,7 @@
70277253 //System.out.println("hitSomething = " + hitSomething);
70287254
70297255 double scale = 0.005f * info.camera.Distance();
7256
+
70307257 cVector xlate = new cVector();
70317258 //cVector xlate2 = new cVector();
70327259 switch (hitSomething)
....@@ -7175,24 +7402,27 @@
71757402
71767403 case hitScale: // scale
71777404 double hScale = (double) (info.x - centerPt.x) / 32;
7405
+ double sign = 1;
7406
+ if (hScale < 0)
7407
+ {
7408
+ sign = -1;
7409
+ }
7410
+ hScale = sign*Math.pow(sign*hScale, scale * 50);
71787411 if (hScale < 0.01)
71797412 {
7180
- hScale = 0.01;
7413
+ //hScale = 0.01;
71817414 }
7182
- hScale = Math.pow(hScale, scale * 50);
7183
- if (hScale < 0.01)
7184
- {
7185
- hScale = 0.01;
7186
- }
7415
+
71877416 double vScale = (double) (info.y - centerPt.y) / 32;
7188
- if (vScale < 0.01)
7417
+ sign = 1;
7418
+ if (vScale < 0)
71897419 {
7190
- vScale = 0.01;
7420
+ sign = -1;
71917421 }
7192
- vScale = Math.pow(vScale, scale * 50);
7422
+ vScale = sign*Math.pow(sign*vScale, scale * 50);
71937423 if (vScale < 0.01)
71947424 {
7195
- vScale = 0.01;
7425
+ //vScale = 0.01;
71967426 }
71977427 LA.matCopy(startMat, toParent);
71987428 /**/
....@@ -7203,39 +7433,46 @@
72037433 }
72047434 /**/
72057435
7436
+ double totalScale = Math.sqrt(hScale*hScale + vScale*vScale) / Math.sqrt(2);
7437
+
7438
+ if (totalScale < 0.01)
7439
+ {
7440
+ totalScale = 0.01;
7441
+ }
7442
+
72067443 switch (info.pane.RenderCamera().viewCode)
72077444 {
72087445 case 3: // '\001'
7209
- if (modified)
7446
+ if (modified || opposite)
72107447 {
72117448 //LA.matScale(toParent, 1, hScale, vScale);
7212
- LA.matScale(toParent, vScale, 1, 1);
7449
+ LA.matScale(toParent, totalScale, 1, 1);
72137450 } // vScale, 1);
72147451 else
72157452 {
7216
- LA.matScale(toParent, vScale, vScale, vScale);
7453
+ LA.matScale(toParent, 1, totalScale, totalScale);
72177454 } // vScale, 1);
72187455 break;
72197456
72207457 case 2: // '\002'
7221
- if (modified)
7458
+ if (modified || opposite)
72227459 {
72237460 //LA.matScale(toParent, hScale, 1, vScale);
7224
- LA.matScale(toParent, 1, vScale, 1);
7461
+ LA.matScale(toParent, 1, totalScale, 1);
72257462 } else
72267463 {
7227
- LA.matScale(toParent, vScale, 1, vScale);
7464
+ LA.matScale(toParent, totalScale, 1, totalScale);
72287465 }
72297466 break;
72307467
72317468 case 1: // '\003'
7232
- if (modified)
7469
+ if (modified || opposite)
72337470 {
72347471 //LA.matScale(toParent, hScale, vScale, 1);
7235
- LA.matScale(toParent, 1, 1, vScale);
7472
+ LA.matScale(toParent, 1, 1, totalScale);
72367473 } else
72377474 {
7238
- LA.matScale(toParent, vScale, vScale, 1);
7475
+ LA.matScale(toParent, totalScale, totalScale, 1);
72397476 }
72407477 break;
72417478 }
....@@ -7368,14 +7605,22 @@
73687605 //return super.toString() + " (id=" + list + ")" + " (brep=" + bRep + ")";
73697606 //return name + " (id=" + list + ")" + " (brep=" + bRep + ") " + super.toString();
73707607 //return name + " (#tri = " + (bRep==null?0:bRep.VertexCount()) + ") " + super.toString();
7608
+
7609
+ String objname;
7610
+
73717611 if (false) //parent != null)
73727612 {
7373
- return name + " " + System.identityHashCode(this) + " (" + parent.name + " " + System.identityHashCode(parent) + ")";
7613
+ objname = name + " " + System.identityHashCode(this) + " (" + parent.name + " " + System.identityHashCode(parent) + ")";
73747614 } else
73757615 {
7376
- return GetName() + (Math.abs(count) == 1000 ? (count == 1000 ? " " : " * ") : (" (" + (count /*- 1*/) + ") ")) + /*(IsSelected()?"(selected) ":"") + (touched?"(touched) ":"") */ +System.identityHashCode(this);
7616
+ objname = GetName() + (Math.abs(count) == 1000 ? (count == 1000 ? " " : " * ") : (" (" + (count - 1) + ")")) + /*(IsSelected()?"(selected) ":"") + (touched?"(touched) ":"") */ "";
73777617 } // + super.toString();
73787618 //return name + " (" + (SizeOf.deepSizeOf(this)/1024) + "K) " + this.getClass().getName();
7619
+
7620
+ if (!Globals.ADVANCED)
7621
+ return objname;
7622
+
7623
+ return objname + " " + System.identityHashCode(this);
73797624 }
73807625
73817626 public int hashCode()
....@@ -7452,7 +7697,7 @@
74527697 /*transient*/ cVector2[] projectedVertices = new cVector2[0];
74537698
74547699 Object3D /*Composite*/ parent;
7455
- Object3D /*Composite*/ fileparent;
7700
+ Object3D /*Composite*/ fileparent; // In the case of FileObject
74567701
74577702 double[][] toParent; // dynamic matrix
74587703 double[][] fromParent;
....@@ -7567,7 +7812,7 @@
75677812 {
75687813 assert(bRep != null);
75697814 if (!(support instanceof GenericJoint)) // support.bRep != null)
7570
- GrafreeD.Assert(support.bRep == bRep.support);
7815
+ Grafreed.Assert(support.bRep == bRep.support);
75717816 }
75727817 else
75737818 {
....@@ -7616,9 +7861,9 @@
76167861 private static cVector edge2 = new cVector();
76177862 //private static cVector norm = new cVector();
76187863 /*transient private*/ int hitSomething;
7619
- private static final int hitCenter = 1;
7620
- private static final int hitScale = 2;
7621
- private static final int hitRotate = 3;
7864
+ static final int hitCenter = 1;
7865
+ static final int hitScale = 2;
7866
+ static final int hitRotate = 3;
76227867 /*transient*/ /*private*/ int viewCode; // Now used for transparency cache flag
76237868 /*transient*/ private Point centerPt;
76247869 /*transient*/ private int startX;