Normand Briere
2019-07-17 a5580a47d246c1272b10adba68070f6e13da5e41
Object3D.java
....@@ -24,11 +24,14 @@
2424
2525 private UUID uuid = UUID.randomUUID();
2626
27
- // TEMPORARY for mocap undo
28
- mocap.reader.BVHReader.BVHResult bvh;
29
- Object3D skeleton;
27
+ // TEMPORARY for mocap undo. No need to be transient.
28
+ mocap.reader.BVHReader.BVHResult savebvh;
29
+ Object3D saveskeleton;
3030 //
3131
32
+ byte[] versions[] = new byte[100][];
33
+ int versionindex = -1;
34
+
3235 ScriptNode scriptnode;
3336
3437 void InitOthers()
....@@ -170,24 +173,35 @@
170173
171174 void ExtractBigData(java.util.Hashtable<java.util.UUID, Object3D> hashtable)
172175 {
176
+ Object3D o;
177
+
173178 if (hashtable.containsKey(GetUUID()))
174179 {
175
- Object3D o = hashtable.get(GetUUID());
180
+ o = hashtable.get(GetUUID());
176181
177182 Grafreed.Assert(this.bRep == o.bRep);
178
- if (this.bRep != null)
179
- assert(this.bRep.support == o.transientrep);
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);
180191
181
- return;
192
+ hashtable.put(GetUUID(), o);
182193 }
183194
184
- Object3D o = new Object3D();
185
-
186
- hashtable.put(GetUUID(), o);
187
-
188
- for (int i=0; i<Size(); i++)
195
+ if (!blockloop)
189196 {
190
- get(i).ExtractBigData(hashtable);
197
+ blockloop = true;
198
+
199
+ for (int i=0; i<Size(); i++)
200
+ {
201
+ get(i).ExtractBigData(hashtable);
202
+ }
203
+
204
+ blockloop = false;
191205 }
192206
193207 ExtractBigData(o);
....@@ -195,11 +209,24 @@
195209
196210 void ExtractBigData(Object3D o)
197211 {
212
+ if (o.bRep != null)
213
+ Grafreed.Assert(o.bRep == this.bRep);
214
+
198215 o.bRep = this.bRep;
199
- if (this.bRep != null)
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
+
223
+ if (this.support != null)
200224 {
201
- o.transientrep = this.bRep.support;
202
- o.bRep.support = null;
225
+ if (o.transientrep != null)
226
+ Grafreed.Assert(o.transientrep == this.support.bRep);
227
+
228
+ o.transientrep = this.support.bRep;
229
+ this.support.bRep = null;
203230 }
204231
205232 // o.support = this.support;
....@@ -223,19 +250,32 @@
223250
224251 RestoreBigData(o);
225252
226
- hashtable.remove(GetUUID());
253
+ if (blockloop)
254
+ return;
255
+
256
+ blockloop = true;
257
+
258
+ //hashtable.remove(GetUUID());
227259
228260 for (int i=0; i<Size(); i++)
229261 {
230262 get(i).RestoreBigData(hashtable);
231263 }
264
+
265
+ blockloop = false;
232266 }
233267
234268 void RestoreBigData(Object3D o)
235269 {
236270 this.bRep = o.bRep;
237
- if (this.bRep != null)
238
- this.bRep.support = o.transientrep;
271
+ if (this.support != null && o.transientrep != null)
272
+ {
273
+ this.support.bRep = o.transientrep;
274
+ }
275
+
276
+ this.selection = o.selection;
277
+// July 2019 if (this.bRep != null)
278
+// this.bRep.support = o.transientrep;
239279 // this.support = o.support;
240280 // this.fileparent = o.fileparent;
241281 }
....@@ -1367,6 +1407,7 @@
13671407 toParent = LA.newMatrix();
13681408 fromParent = LA.newMatrix();
13691409 }
1410
+
13701411 LA.matCopy(other.toParent, toParent);
13711412 LA.matCopy(other.fromParent, fromParent);
13721413
....@@ -2433,6 +2474,14 @@
24332474 {
24342475 editWindow.refreshContents();
24352476 }
2477
+ else
2478
+ {
2479
+ if (manipWindow != null)
2480
+ {
2481
+ manipWindow.refreshContents();
2482
+ }
2483
+ }
2484
+
24362485 //if (parent != null)
24372486 //parent.refreshEditWindow();
24382487 }
....@@ -4963,6 +5012,14 @@
49635012 }
49645013 }
49655014
5015
+ ObjEditor GetWindow()
5016
+ {
5017
+ if (editWindow != null)
5018
+ return editWindow;
5019
+
5020
+ return manipWindow;
5021
+ }
5022
+
49665023 cTreePath Select(int indexcount, boolean deselect)
49675024 {
49685025 if (hide || dontselect)
....@@ -4999,10 +5056,11 @@
49995056 if (leaf != null)
50005057 {
50015058 cTreePath tp = new cTreePath(this, leaf);
5002
- if (editWindow != null)
5059
+ ObjEditor window = GetWindow();
5060
+ if (window != null)
50035061 {
50045062 //System.out.println("editWindow = " + editWindow + " vs " + this);
5005
- editWindow.Select(tp, deselect, true);
5063
+ window.Select(tp, deselect, true);
50065064 }
50075065
50085066 return tp;
....@@ -5019,6 +5077,7 @@
50195077
50205078 if (child == null)
50215079 continue;
5080
+
50225081 if (child.HasTransparency() && child.size() != 0)
50235082 {
50245083 cTreePath leaf = child.Select(indexcount, deselect);
....@@ -5028,9 +5087,10 @@
50285087 if (leaf != null)
50295088 {
50305089 cTreePath tp = new cTreePath(this, leaf);
5031
- if (editWindow != null)
5090
+ ObjEditor window = GetWindow();
5091
+ if (window != null)
50325092 {
5033
- editWindow.Select(tp, deselect, true);
5093
+ window.Select(tp, deselect, true);
50345094 }
50355095
50365096 return tp;
....@@ -5772,7 +5832,7 @@
57725832
57735833 if (!selectmode && //display.DrawMode() != display.SELECTION &&
57745834 //(touched || (bRep != null && bRep.displaylist <= 0)))
5775
- (Globals.isLIVE() && Globals.COMPUTESHADOWWHENLIVE || touched && (bRep != null && bRep.displaylist <= 0)))
5835
+ (Globals.isLIVE() && Globals.COMPUTESHADOWWHENLIVE || touched && Globals.COMPUTESHADOWWHENLIVE)) // || (bRep != null && bRep.displaylist <= 0)))
57765836 {
57775837 Globals.lighttouched = true;
57785838 } // all panes...
....@@ -5904,6 +5964,7 @@
59045964 if (GetBRep() != null)
59055965 {
59065966 display.NextIndex();
5967
+
59075968 // vertex color conflict : gl.glCallList(list);
59085969 DrawNode(display, root, selected);
59095970 if (this instanceof BezierPatch)
....@@ -7261,8 +7322,8 @@
72617322 // {
72627323 // CameraPane.Ymax = spoth;
72637324 // }
7264
- info.g.drawArc(boundary.x, boundary.y,
7265
- boundary.width, boundary.height, 0, 360);
7325
+ info.g.drawArc(boundary.x + info.DX, boundary.y + info.DY,
7326
+ (int)(boundary.width * info.W), (int)(boundary.height * info.W), 0, 360);
72667327 //info.g.drawArc(spot.x, spotw, spot.width/2, boundary.height/2, 0, 360);
72677328 // if (CameraPane.Xmin > boundary.x)
72687329 // {
....@@ -7967,6 +8028,10 @@
79678028 }
79688029
79698030 transient ObjEditor editWindow;
8031
+ transient ObjEditor manipWindow;
8032
+
8033
+ transient boolean pinned;
8034
+
79708035 transient ObjectUI objectUI;
79718036 public static int povDepth = 0;
79728037 private static cVector tbMin = new cVector();