Normand Briere
2019-08-15 33504fc9a180903aace77613264550754fba5706
Object3D.java
....@@ -22,6 +22,7 @@
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
2728 // TEMPORARY for mocap undo. No need to be transient.
....@@ -32,7 +33,7 @@
3233 String skyboxname;
3334 String skyboxext;
3435
35
- Object3D versions[];
36
+ Object3D versionlist[];
3637 int versionindex = -1;
3738
3839 ScriptNode scriptnode;
....@@ -222,7 +223,7 @@
222223 // o.bRep.support = null;
223224 // }
224225 o.selection = this.selection;
225
- o.versions = this.versions;
226
+ o.versionlist = this.versionlist;
226227 o.versionindex = this.versionindex;
227228
228229 if (this.support != null)
....@@ -245,6 +246,29 @@
245246 // this.support = null;
246247 // this.fileparent = null;
247248 }
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
+// }
248272
249273 void RestoreBigData(java.util.Hashtable<java.util.UUID, Object3D> hashtable)
250274 {
....@@ -280,7 +304,7 @@
280304
281305 this.selection = o.selection;
282306
283
- this.versions = o.versions;
307
+ this.versionlist = o.versionlist;
284308 this.versionindex = o.versionindex;
285309 // July 2019 if (this.bRep != null)
286310 // this.bRep.support = o.transientrep;
....@@ -2444,6 +2468,11 @@
24442468 else
24452469 {
24462470 //((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");
24472476 }
24482477 }
24492478
....@@ -5545,6 +5574,11 @@
55455574 if (fullname == null)
55465575 return "";
55475576
5577
+ if (fullname.pigment != null)
5578
+ {
5579
+ return fullname.pigment;
5580
+ }
5581
+
55485582 // System.out.println("Fullname = " + fullname);
55495583
55505584 // Does not work on Windows due to C:
....@@ -5557,7 +5591,7 @@
55575591
55585592 if (split.length == 0)
55595593 {
5560
- return "";
5594
+ return fullname.pigment = "";
55615595 }
55625596
55635597 if (split.length <= 2)
....@@ -5565,22 +5599,27 @@
55655599 if (fullname.name.endsWith(":"))
55665600 {
55675601 // Windows
5568
- return fullname.name.substring(0, fullname.name.length()-1);
5602
+ return fullname.pigment = fullname.name.substring(0, fullname.name.length()-1);
55695603 }
55705604
5571
- return split[0];
5605
+ return fullname.pigment = split[0];
55725606 }
55735607
55745608 // Windows
55755609 assert(split.length == 4);
55765610
5577
- return split[0] + ":" + split[1];
5611
+ return fullname.pigment = split[0] + ":" + split[1];
55785612 }
55795613
55805614 static String GetBump(cTexture fullname)
55815615 {
55825616 if (fullname == null)
55835617 return "";
5618
+
5619
+ if (fullname.bump != null)
5620
+ {
5621
+ return fullname.bump;
5622
+ }
55845623
55855624 // System.out.println("Fullname = " + fullname);
55865625 // Does not work on Windows due to C:
....@@ -5592,12 +5631,12 @@
55925631
55935632 if (split.length == 0)
55945633 {
5595
- return "";
5634
+ return fullname.bump = "";
55965635 }
55975636
55985637 if (split.length == 1)
55995638 {
5600
- return "";
5639
+ return fullname.bump = "";
56015640 }
56025641
56035642 if (split.length == 2)
....@@ -5605,16 +5644,16 @@
56055644 if (fullname.name.endsWith(":"))
56065645 {
56075646 // Windows
5608
- return "";
5647
+ return fullname.bump = "";
56095648 }
56105649
5611
- return split[1];
5650
+ return fullname.bump = split[1];
56125651 }
56135652
56145653 // Windows
56155654 assert(split.length == 4);
56165655
5617
- return split[2] + ":" + split[3];
5656
+ return fullname.bump = split[2] + ":" + split[3];
56185657 }
56195658
56205659 String GetPigmentTexture()
....@@ -5697,6 +5736,9 @@
56975736 texname = "";
56985737
56995738 GetTextures().name = texname + ":" + GetBump(GetTextures());
5739
+
5740
+ GetTextures().pigment = null;
5741
+
57005742 Touch();
57015743 }
57025744
....@@ -5769,6 +5811,8 @@
57695811 texname = "";
57705812
57715813 GetTextures().name = Object3D.GetPigment(GetTextures()) + ":" + texname;
5814
+
5815
+ GetTextures().bump = null;
57725816
57735817 Touch();
57745818 }
....@@ -7393,7 +7437,29 @@
73937437 // {
73947438 // CameraPane.Ymax = spoth;
73957439 // }
7396
- spot.translate(32, 32);
7440
+// if (CameraPane.Xmin > spot.x)
7441
+// {
7442
+// CameraPane.Xmin = spot.x;
7443
+// }
7444
+// if (CameraPane.Xmax < spotw)
7445
+// {
7446
+// CameraPane.Xmax = spotw;
7447
+// }
7448
+// if (CameraPane.Ymin > spot.y)
7449
+// {
7450
+// CameraPane.Ymin = spot.y;
7451
+// }
7452
+// if (CameraPane.Ymax < spoth)
7453
+// {
7454
+// CameraPane.Ymax = spoth;
7455
+// }
7456
+ // bonhommes info.g.drawLine(spotw, spoth, spotw, spoth - boundary.height/2); // 15
7457
+ //info.g.drawLine(spotw, spoth, spotw - boundary.width/2, spoth); // 15
7458
+ spot.translate(32, 0);
7459
+ clickInfo.g.setColor(Color.yellow);
7460
+ clickInfo.g.fillRect(spot.x, spot.y, spot.width, spot.height);
7461
+
7462
+ spot.translate(32, 64);
73977463 spotw = spot.x + spot.width;
73987464 spoth = spot.y + spot.height;
73997465 clickInfo.g.setColor(Color.cyan);
....@@ -7414,28 +7480,7 @@
74147480 // {
74157481 // CameraPane.Ymax = spoth;
74167482 // }
7417
- // bonhommes info.g.drawLine(spotw, spoth, spotw, spoth - boundary.height/2); // 15
7418
- //info.g.drawLine(spotw, spoth, spotw - boundary.width/2, spoth); // 15
7419
- spot.translate(0, -32);
7420
- clickInfo.g.setColor(Color.yellow);
7421
- clickInfo.g.fillRect(spot.x, spot.y, spot.width, spot.height);
74227483 clickInfo.g.setColor(Color.green);
7423
-// if (CameraPane.Xmin > spot.x)
7424
-// {
7425
-// CameraPane.Xmin = spot.x;
7426
-// }
7427
-// if (CameraPane.Xmax < spotw)
7428
-// {
7429
-// CameraPane.Xmax = spotw;
7430
-// }
7431
-// if (CameraPane.Ymin > spot.y)
7432
-// {
7433
-// CameraPane.Ymin = spot.y;
7434
-// }
7435
-// if (CameraPane.Ymax < spoth)
7436
-// {
7437
-// CameraPane.Ymax = spoth;
7438
-// }
74397484 clickInfo.g.drawArc(boundary.x + clickInfo.DX, boundary.y + clickInfo.DY,
74407485 (int)(boundary.width * clickInfo.W), (int)(boundary.height * clickInfo.W), 0, 360);
74417486 //info.g.drawArc(spot.x, spotw, spot.width/2, boundary.height/2, 0, 360);
....@@ -7494,12 +7539,14 @@
74947539 retval = true;
74957540 }
74967541 spot.translate(0, 32);
7542
+ spot.translate(32, 0);
7543
+ spot.translate(0, 32);
74977544 if (spot.contains(clickInfo.x, clickInfo.y))
74987545 {
74997546 hitSomething = hitScale;
75007547
75017548 double scale = 0.005f * clickInfo.camera.Distance();
7502
- double hScale = (double) (clickInfo.x - centerPt.x) / 32;
7549
+ double hScale = (double) (clickInfo.x - centerPt.x) / 64;
75037550 double sign = 1;
75047551 if (hScale < 0)
75057552 {
....@@ -7511,7 +7558,7 @@
75117558 //hScale = 0.01;
75127559 }
75137560
7514
- double vScale = (double) (clickInfo.y - centerPt.y) / 32;
7561
+ double vScale = (double) (clickInfo.y - centerPt.y) / 64;
75157562 sign = 1;
75167563 if (vScale < 0)
75177564 {
....@@ -7726,7 +7773,7 @@
77267773 break;
77277774
77287775 case hitScale: // scale
7729
- double hScale = (double) (clickInfo.x - centerPt.x) / 32;
7776
+ double hScale = (double) (clickInfo.x - centerPt.x) / 64;
77307777 double sign = 1;
77317778 if (hScale < 0)
77327779 {
....@@ -7738,7 +7785,7 @@
77387785 //hScale = 0.01;
77397786 }
77407787
7741
- double vScale = (double) (clickInfo.y - centerPt.y) / 32;
7788
+ double vScale = (double) (clickInfo.y - centerPt.y) / 64;
77427789 sign = 1;
77437790 if (vScale < 0)
77447791 {