Normand Briere
2019-05-05 623dc0fa8cbd9473830a1786f6d49fa808a09439
Object3D.java
....@@ -954,7 +954,7 @@
954954
955955 public Object clone()
956956 {
957
- return GrafreeD.clone(this);
957
+ return Grafreed.clone(this);
958958 }
959959
960960 Object3D copyExpand()
....@@ -1729,7 +1729,7 @@
17291729 Object3D o = new Object3D((clone?"Ge:":"Li:") + this.name);
17301730 o.bRep = transientrep;
17311731 if (clone)
1732
- o.bRep = (BoundaryRep) GrafreeD.clone(transientrep);
1732
+ o.bRep = (BoundaryRep) Grafreed.clone(transientrep);
17331733 o.CreateMaterial();
17341734 o.SetAttributes(this, -1);
17351735 //parent
....@@ -1742,7 +1742,7 @@
17421742 Object3D o = new Object3D((clone?"Ge:":"Li:") + this.name);
17431743 o.bRep = bRep;
17441744 if (clone)
1745
- o.bRep = (BoundaryRep) GrafreeD.clone(bRep);
1745
+ o.bRep = (BoundaryRep) Grafreed.clone(bRep);
17461746 o.CreateMaterial();
17471747 //o.overwriteThis(this, -1);
17481748 o.SetAttributes(this, -1);
....@@ -2300,6 +2300,7 @@
23002300 {
23012301 if (newWindow)
23022302 {
2303
+ new Exception().printStackTrace();
23032304 System.exit(0);
23042305 if (parent != null)
23052306 {
....@@ -2476,13 +2477,13 @@
24762477 return retval;
24772478 }
24782479
2479
- void doEditDrag(ClickInfo info)
2480
+ void doEditDrag(ClickInfo info, boolean opposite)
24802481 {
24812482 switch (doSomething)
24822483 {
24832484 case 1: // '\001'
24842485 //super.
2485
- doEditDrag0(info);
2486
+ doEditDrag0(info, opposite);
24862487 break;
24872488
24882489 case 2: // '\002'
....@@ -2495,11 +2496,11 @@
24952496 {
24962497 //sel.hitSomething = childToDrag.hitSomething;
24972498 //childToDrag.doEditDrag(info);
2498
- sel.doEditDrag(info);
2499
+ sel.doEditDrag(info, opposite);
24992500 } else
25002501 {
25012502 //super.
2502
- doEditDrag0(info);
2503
+ doEditDrag0(info, opposite);
25032504 }
25042505 }
25052506 break;
....@@ -2906,7 +2907,8 @@
29062907 {
29072908 if (bRep != null)
29082909 {
2909
- bRep.GenUV();
2910
+ bRep.GenUV(); //1);
2911
+ //bRep.UnfoldUV();
29102912 Touch();
29112913 }
29122914 }
....@@ -3202,7 +3204,7 @@
32023204
32033205 BoundaryRep sup = bRep.support;
32043206 bRep.support = null;
3205
- BoundaryRep temprep = (BoundaryRep) GrafreeD.clone(bRep);
3207
+ BoundaryRep temprep = (BoundaryRep) Grafreed.clone(bRep);
32063208 // bRep.SplitInTwo(onlyone); // thread...
32073209 temprep.SplitInTwo(reduction34, onlyone);
32083210 bRep = temprep;
....@@ -3726,7 +3728,7 @@
37263728 if (child == null)
37273729 continue;
37283730
3729
- if (GrafreeD.RENDERME > 0)
3731
+ if (Grafreed.RENDERME > 0)
37303732 {
37313733 if (child instanceof Merge)
37323734 ((Merge)child).renderme();
....@@ -3877,7 +3879,7 @@
38773879 if (child == null)
38783880 continue;
38793881
3880
- if (GrafreeD.RENDERME > 0)
3882
+ if (Grafreed.RENDERME > 0)
38813883 {
38823884 if (child instanceof Merge)
38833885 ((Merge)child).renderme();
....@@ -4072,7 +4074,7 @@
40724074 if (child == null)
40734075 continue;
40744076
4075
- if (GrafreeD.RENDERME > 0)
4077
+ if (Grafreed.RENDERME > 0)
40764078 {
40774079 if (child instanceof Merge)
40784080 ((Merge)child).renderme();
....@@ -5157,10 +5159,34 @@
51575159
51585160 // System.out.println("Fullname = " + fullname);
51595161
5160
- if (fullname.name.indexOf(":") == -1)
5161
- return fullname.name;
5162
+ // Does not work on Windows due to C:
5163
+// if (fullname.name.indexOf(":") == -1)
5164
+// return fullname.name;
5165
+//
5166
+// return fullname.name.substring(0,fullname.name.indexOf(":"));
51625167
5163
- return fullname.name.substring(0,fullname.name.indexOf(":"));
5168
+ String[] split = fullname.name.split(":");
5169
+
5170
+ if (split.length == 0)
5171
+ {
5172
+ return "";
5173
+ }
5174
+
5175
+ if (split.length <= 2)
5176
+ {
5177
+ if (fullname.name.endsWith(":"))
5178
+ {
5179
+ // Windows
5180
+ return fullname.name.substring(0, fullname.name.length()-1);
5181
+ }
5182
+
5183
+ return split[0];
5184
+ }
5185
+
5186
+ // Windows
5187
+ assert(split.length == 4);
5188
+
5189
+ return split[0] + ":" + split[1];
51645190 }
51655191
51665192 static String GetBump(cTexture fullname)
....@@ -5169,10 +5195,38 @@
51695195 return "";
51705196
51715197 // System.out.println("Fullname = " + fullname);
5172
- if (fullname.name.indexOf(":") == -1)
5173
- return "";
5174
-
5175
- return fullname.name.substring(fullname.name.indexOf(":")+1,fullname.name.length());
5198
+ // Does not work on Windows due to C:
5199
+// if (fullname.name.indexOf(":") == -1)
5200
+// return "";
5201
+//
5202
+// return fullname.name.substring(fullname.name.indexOf(":")+1,fullname.name.length());
5203
+ String[] split = fullname.name.split(":");
5204
+
5205
+ if (split.length == 0)
5206
+ {
5207
+ return "";
5208
+ }
5209
+
5210
+ if (split.length == 1)
5211
+ {
5212
+ return "";
5213
+ }
5214
+
5215
+ if (split.length == 2)
5216
+ {
5217
+ if (fullname.name.endsWith(":"))
5218
+ {
5219
+ // Windows
5220
+ return "";
5221
+ }
5222
+
5223
+ return split[1];
5224
+ }
5225
+
5226
+ // Windows
5227
+ assert(split.length == 4);
5228
+
5229
+ return split[2] + ":" + split[3];
51765230 }
51775231
51785232 String GetPigmentTexture()
....@@ -5246,7 +5300,7 @@
52465300 System.out.print("; textures = " + textures);
52475301 System.out.println("; usedtextures = " + usedtextures);
52485302
5249
- if (GetTextures() == null)
5303
+ if (GetTextures() == null) // What is that??
52505304 GetTextures().name = ":";
52515305
52525306 String texname = tex;
....@@ -5898,6 +5952,7 @@
58985952 return;
58995953 }
59005954
5955
+ //bRep.GenUV(1/material.diffuseness);
59015956 // bRep.lock = true;
59025957
59035958 //javax.media.opengl.GL gl = display.GetGL();
....@@ -6929,7 +6984,7 @@
69296984 }
69306985
69316986 //System.out.println("info.modifiers = " + info.modifiers);
6932
- modified = (info.modifiers & CameraPane.META) != 0;
6987
+ modified = (info.modifiers & CameraPane.SHIFT) != 0; // Was META
69336988 //System.out.println("modified = " + modified);
69346989 //new Exception().printStackTrace();
69356990 //viewCode = info.pane.renderCamera.viewCode;
....@@ -6957,7 +7012,7 @@
69577012 return true;
69587013 }
69597014
6960
- void doEditDrag0(ClickInfo info)
7015
+ void doEditDrag0(ClickInfo info, boolean opposite)
69617016 {
69627017 if (hitSomething == 0)
69637018 {
....@@ -6984,7 +7039,7 @@
69847039
69857040 scale *= 0.05f * Globals.theRenderer.RenderCamera().Distance();
69867041
6987
- if (modified)
7042
+ if (modified || opposite)
69887043 {
69897044 //assert(false);
69907045 /*
....@@ -7078,6 +7133,7 @@
70787133
70797134 if (modified)
70807135 {
7136
+ // Rotate 90 degrees
70817137 angle /= (Math.PI / 4);
70827138 angle = Math.floor(angle + 0.5);
70837139 angle *= (Math.PI / 4);
....@@ -7375,6 +7431,7 @@
73757431 objectUI.closeUI();
73767432 if (editWindow != null)
73777433 {
7434
+ editWindow.ctrlPanel.FlushUI();
73787435 editWindow.refreshContents();
73797436 } // ? new
73807437 objectUI = null;
....@@ -7510,7 +7567,7 @@
75107567 {
75117568 assert(bRep != null);
75127569 if (!(support instanceof GenericJoint)) // support.bRep != null)
7513
- GrafreeD.Assert(support.bRep == bRep.support);
7570
+ Grafreed.Assert(support.bRep == bRep.support);
75147571 }
75157572 else
75167573 {