.. | .. |
---|
5 | 5 | import java.util.Vector; |
---|
6 | 6 | |
---|
7 | 7 | import javax.media.j3d.Transform3D; |
---|
| 8 | +import javax.media.opengl.GL; |
---|
8 | 9 | import javax.vecmath.Vector3d; |
---|
9 | 10 | |
---|
10 | 11 | import javax.imageio.ImageIO; |
---|
.. | .. |
---|
13 | 14 | import //weka.core. |
---|
14 | 15 | matrix.Matrix; |
---|
15 | 16 | |
---|
| 17 | +import java.util.UUID; |
---|
| 18 | + |
---|
16 | 19 | //import net.sourceforge.sizeof.SizeOf; |
---|
17 | 20 | public class Object3D extends Vector<Object3D> implements java.io.Serializable, iSendInfo //, aurelienribon.tweenengine.TweenAccessor<Object3D> |
---|
18 | 21 | { |
---|
19 | 22 | //static final long serialVersionUID = -607422624994562685L; |
---|
20 | 23 | static final long serialVersionUID = 5022536242724664900L; |
---|
21 | 24 | |
---|
| 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 | + |
---|
22 | 35 | ScriptNode scriptnode; |
---|
23 | 36 | |
---|
24 | 37 | void InitOthers() |
---|
.. | .. |
---|
99 | 112 | |
---|
100 | 113 | // transient boolean reduced; // for morph reduction |
---|
101 | 114 | |
---|
102 | | -transient com.bulletphysics.linearmath.Transform cache; // for fast merge |
---|
103 | | -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 |
---|
104 | 117 | |
---|
105 | | -transient Object3D transientsupport; // for cloning |
---|
106 | | -transient boolean transientlink2master; |
---|
| 118 | + transient Object3D transientsupport; // for cloning |
---|
| 119 | + transient boolean transientlink2master; |
---|
107 | 120 | |
---|
108 | | -void SaveSupports() |
---|
109 | | -{ |
---|
110 | | - if (blockloop) |
---|
111 | | - return; |
---|
112 | | - |
---|
113 | | - transientsupport = support; |
---|
114 | | - transientlink2master = link2master; |
---|
115 | | - |
---|
116 | | - support = null; |
---|
117 | | - link2master = false; |
---|
118 | | - |
---|
119 | | - if (bRep != null) |
---|
| 121 | + void SaveSupports() |
---|
120 | 122 | { |
---|
121 | | - 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 | + } |
---|
122 | 146 | } |
---|
123 | | - |
---|
124 | | - for (int i = 0; i < Size(); i++) |
---|
| 147 | + |
---|
| 148 | + void RestoreSupports() |
---|
125 | 149 | { |
---|
126 | | - Object3D child = (Object3D) get(i); |
---|
127 | | - if (child == null) |
---|
128 | | - 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 | + |
---|
| 223 | + if (this.support != null) |
---|
| 224 | + { |
---|
| 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; |
---|
| 230 | + } |
---|
| 231 | + |
---|
| 232 | + // o.support = this.support; |
---|
| 233 | + // o.fileparent = this.fileparent; |
---|
| 234 | + // if (this.bRep != null) |
---|
| 235 | + // o.bRep = this.bRep.support; |
---|
| 236 | + |
---|
| 237 | + this.bRep = null; |
---|
| 238 | + // if (this.bRep != null) |
---|
| 239 | + // this.bRep.support = null; |
---|
| 240 | + // this.support = null; |
---|
| 241 | + // this.fileparent = null; |
---|
| 242 | + } |
---|
| 243 | + |
---|
| 244 | + void RestoreBigData(java.util.Hashtable<java.util.UUID, Object3D> hashtable) |
---|
| 245 | + { |
---|
| 246 | + if (!hashtable.containsKey(GetUUID())) |
---|
| 247 | + return; |
---|
| 248 | + |
---|
| 249 | + Object3D o = hashtable.get(GetUUID()); |
---|
| 250 | + |
---|
| 251 | + RestoreBigData(o); |
---|
| 252 | + |
---|
| 253 | + if (blockloop) |
---|
| 254 | + return; |
---|
| 255 | + |
---|
129 | 256 | blockloop = true; |
---|
130 | | - child.SaveSupports(); |
---|
| 257 | + |
---|
| 258 | + //hashtable.remove(GetUUID()); |
---|
| 259 | + |
---|
| 260 | + for (int i=0; i<Size(); i++) |
---|
| 261 | + { |
---|
| 262 | + get(i).RestoreBigData(hashtable); |
---|
| 263 | + } |
---|
| 264 | + |
---|
131 | 265 | blockloop = false; |
---|
132 | 266 | } |
---|
133 | | -} |
---|
134 | 267 | |
---|
135 | | -void RestoreSupports() |
---|
136 | | -{ |
---|
137 | | - if (blockloop) |
---|
138 | | - return; |
---|
139 | | - |
---|
140 | | - support = transientsupport; |
---|
141 | | - link2master = transientlink2master; |
---|
142 | | - transientsupport = null; |
---|
143 | | - transientlink2master = false; |
---|
144 | | - |
---|
145 | | - if (bRep != null) |
---|
| 268 | + void RestoreBigData(Object3D o) |
---|
146 | 269 | { |
---|
147 | | - bRep.RestoreSupports(); |
---|
| 270 | + this.bRep = o.bRep; |
---|
| 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; |
---|
| 279 | + // this.support = o.support; |
---|
| 280 | + // this.fileparent = o.fileparent; |
---|
148 | 281 | } |
---|
149 | | - |
---|
150 | | - for (int i = 0; i < Size(); i++) |
---|
151 | | - { |
---|
152 | | - Object3D child = (Object3D) get(i); |
---|
153 | | - if (child == null) |
---|
154 | | - continue; |
---|
155 | | - blockloop = true; |
---|
156 | | - child.RestoreSupports(); |
---|
157 | | - blockloop = false; |
---|
158 | | - } |
---|
159 | | -} |
---|
160 | 282 | |
---|
161 | 283 | // MOCAP SUPPORT |
---|
162 | 284 | double tx,ty,tz,rx,ry,rz; |
---|
.. | .. |
---|
299 | 421 | } |
---|
300 | 422 | |
---|
301 | 423 | boolean live = false; |
---|
| 424 | + boolean dontselect = false; |
---|
302 | 425 | boolean hide = false; |
---|
303 | 426 | boolean link2master = false; // performs reset support/master at each frame |
---|
304 | 427 | boolean marked = false; // animation node |
---|
.. | .. |
---|
430 | 553 | { |
---|
431 | 554 | Object3D copy = this; |
---|
432 | 555 | |
---|
433 | | - Camera parentcam = CameraPane.theRenderer.manipCamera; |
---|
| 556 | + Camera parentcam = Globals.theRenderer.ManipCamera(); |
---|
434 | 557 | |
---|
435 | | - if (CameraPane.theRenderer.manipCamera == CameraPane.theRenderer.cameras[0]) |
---|
| 558 | + if (Globals.theRenderer.ManipCamera() == Globals.theRenderer.Cameras()[0]) |
---|
436 | 559 | { |
---|
437 | | - parentcam = CameraPane.theRenderer.cameras[1]; |
---|
| 560 | + parentcam = Globals.theRenderer.Cameras()[1]; |
---|
438 | 561 | } |
---|
439 | 562 | |
---|
440 | | - if (CameraPane.theRenderer.manipCamera == CameraPane.theRenderer.cameras[1]) |
---|
| 563 | + if (Globals.theRenderer.ManipCamera() == Globals.theRenderer.Cameras()[1]) |
---|
441 | 564 | { |
---|
442 | | - parentcam = CameraPane.theRenderer.cameras[0]; |
---|
| 565 | + parentcam = Globals.theRenderer.Cameras()[0]; |
---|
443 | 566 | } |
---|
444 | 567 | |
---|
445 | 568 | if (this == parentcam) |
---|
.. | .. |
---|
447 | 570 | //assert(this instanceof Camera); |
---|
448 | 571 | |
---|
449 | 572 | for (int count = parentcam.GetTransformCount(); --count>=0;) |
---|
450 | | - LA.xformPos(CameraPane.theRenderer.targetLookAt, parentcam.toParent, CameraPane.theRenderer.targetLookAt); |
---|
| 573 | + LA.xformPos(Globals.theRenderer.TargetLookAt(), parentcam.toParent, Globals.theRenderer.TargetLookAt()); |
---|
451 | 574 | } |
---|
452 | 575 | |
---|
453 | 576 | copy.marked ^= true; |
---|
.. | .. |
---|
467 | 590 | //assert(this instanceof Camera); |
---|
468 | 591 | |
---|
469 | 592 | for (int count = parentcam.GetTransformCount(); --count>=0;) |
---|
470 | | - LA.xformPos(CameraPane.theRenderer.targetLookAt, parentcam.fromParent, CameraPane.theRenderer.targetLookAt); |
---|
| 593 | + LA.xformPos(Globals.theRenderer.TargetLookAt(), parentcam.fromParent, Globals.theRenderer.TargetLookAt()); |
---|
471 | 594 | } |
---|
472 | 595 | |
---|
473 | 596 | copy.Touch(); // display list issue |
---|
.. | .. |
---|
480 | 603 | toParent = LA.newMatrix(); |
---|
481 | 604 | fromParent = LA.newMatrix(); |
---|
482 | 605 | } |
---|
| 606 | + |
---|
483 | 607 | if (toParentMarked == null) |
---|
484 | 608 | { |
---|
485 | 609 | if (maxcount != 1) |
---|
486 | 610 | { |
---|
487 | 611 | new Exception().printStackTrace(); |
---|
488 | 612 | } |
---|
| 613 | + |
---|
489 | 614 | toParentMarked = LA.newMatrix(); |
---|
490 | 615 | fromParentMarked = LA.newMatrix(); |
---|
491 | 616 | } |
---|
.. | .. |
---|
602 | 727 | return; |
---|
603 | 728 | } |
---|
604 | 729 | |
---|
605 | | - if (CameraPane.fromscript) |
---|
| 730 | + if (Globals.fromscript) |
---|
606 | 731 | { |
---|
607 | 732 | transformcount = 0; |
---|
608 | 733 | return; |
---|
.. | .. |
---|
773 | 898 | if (step == 0) |
---|
774 | 899 | step = 1; |
---|
775 | 900 | if (maxcount == 0) |
---|
776 | | - maxcount = 2048; // 4; |
---|
| 901 | + maxcount = 128; // 2048; // 4; |
---|
777 | 902 | // if (acceleration == 0) |
---|
778 | 903 | // acceleration = 10; |
---|
779 | 904 | if (delay == 0) // serial |
---|
.. | .. |
---|
796 | 921 | |
---|
797 | 922 | if (marked && Globals.isLIVE() && live && |
---|
798 | 923 | //TEMP21aug2018 |
---|
799 | | - Globals.DrawMode() == iCameraPane.SHADOW && |
---|
| 924 | + (Globals.DrawMode() == iCameraPane.SHADOW || !Globals.RENDERSHADOW || !Globals.COMPUTESHADOWWHENLIVE) && |
---|
800 | 925 | currentframe != Globals.framecount) |
---|
801 | 926 | { |
---|
802 | 927 | currentframe = Globals.framecount; |
---|
.. | .. |
---|
808 | 933 | |
---|
809 | 934 | boolean changedir = random && Math.random() < 0.01; // && !link2master; |
---|
810 | 935 | |
---|
811 | | - if (transformcount*factor > maxcount || (step == 1 && changedir)) |
---|
| 936 | + if (transformcount*factor >= maxcount && (rewind || random) || |
---|
| 937 | + (step == 1 && changedir)) |
---|
812 | 938 | { |
---|
813 | 939 | countdown = 1; |
---|
814 | 940 | delay = speedup?8:1; |
---|
.. | .. |
---|
880 | 1006 | if (material == null || material.multiply) |
---|
881 | 1007 | return true; |
---|
882 | 1008 | |
---|
| 1009 | + // Transparent objects are dynamic because we have to sort the triangles. |
---|
883 | 1010 | return material.opacity > 0.99; |
---|
884 | 1011 | } |
---|
885 | 1012 | |
---|
.. | .. |
---|
911 | 1038 | fromParent = null; // LA.newMatrix(); |
---|
912 | 1039 | bRep = null; // new BoundaryRep(); |
---|
913 | 1040 | |
---|
| 1041 | + if (oname != null && oname.equals("LeftHand")) |
---|
| 1042 | + { |
---|
| 1043 | + name = oname; |
---|
| 1044 | + } |
---|
| 1045 | + |
---|
914 | 1046 | /* |
---|
915 | 1047 | float hue = (float)Math.random(); |
---|
916 | 1048 | Color col; |
---|
.. | .. |
---|
953 | 1085 | |
---|
954 | 1086 | public Object clone() |
---|
955 | 1087 | { |
---|
956 | | - return GrafreeD.clone(this); |
---|
| 1088 | + return Grafreed.clone(this); |
---|
957 | 1089 | } |
---|
958 | 1090 | |
---|
959 | 1091 | Object3D copyExpand() |
---|
.. | .. |
---|
1275 | 1407 | toParent = LA.newMatrix(); |
---|
1276 | 1408 | fromParent = LA.newMatrix(); |
---|
1277 | 1409 | } |
---|
| 1410 | + |
---|
1278 | 1411 | LA.matCopy(other.toParent, toParent); |
---|
1279 | 1412 | LA.matCopy(other.fromParent, fromParent); |
---|
1280 | 1413 | |
---|
.. | .. |
---|
1469 | 1602 | BoundaryRep.SEUIL = other.material.cameralight; |
---|
1470 | 1603 | |
---|
1471 | 1604 | // Set default to 0.1 |
---|
1472 | | - BoundaryRep.SEUIL /= 2; |
---|
| 1605 | + BoundaryRep.SEUIL /= 4; // 2; |
---|
1473 | 1606 | System.out.println("SEUIL = " + BoundaryRep.SEUIL); |
---|
1474 | 1607 | } |
---|
1475 | 1608 | |
---|
.. | .. |
---|
1728 | 1861 | Object3D o = new Object3D((clone?"Ge:":"Li:") + this.name); |
---|
1729 | 1862 | o.bRep = transientrep; |
---|
1730 | 1863 | if (clone) |
---|
1731 | | - o.bRep = (BoundaryRep) GrafreeD.clone(transientrep); |
---|
| 1864 | + o.bRep = (BoundaryRep) Grafreed.clone(transientrep); |
---|
1732 | 1865 | o.CreateMaterial(); |
---|
1733 | 1866 | o.SetAttributes(this, -1); |
---|
1734 | 1867 | //parent |
---|
.. | .. |
---|
1741 | 1874 | Object3D o = new Object3D((clone?"Ge:":"Li:") + this.name); |
---|
1742 | 1875 | o.bRep = bRep; |
---|
1743 | 1876 | if (clone) |
---|
1744 | | - o.bRep = (BoundaryRep) GrafreeD.clone(bRep); |
---|
| 1877 | + o.bRep = (BoundaryRep) Grafreed.clone(bRep); |
---|
1745 | 1878 | o.CreateMaterial(); |
---|
1746 | 1879 | //o.overwriteThis(this, -1); |
---|
1747 | 1880 | o.SetAttributes(this, -1); |
---|
.. | .. |
---|
1828 | 1961 | if (obj.name == null) |
---|
1829 | 1962 | continue; // can't be a null one |
---|
1830 | 1963 | |
---|
| 1964 | + // Try perfect match first. |
---|
1831 | 1965 | if (n.equals(obj.name)) |
---|
1832 | 1966 | { |
---|
1833 | 1967 | theobj = obj; |
---|
1834 | 1968 | count++; |
---|
1835 | 1969 | } |
---|
1836 | 1970 | } |
---|
| 1971 | + |
---|
| 1972 | + // not needed: n = n.split(":")[0]; // Poser generates a count |
---|
1837 | 1973 | |
---|
1838 | 1974 | if (count != 1) |
---|
1839 | 1975 | for (int i=Size(); --i>=0;) |
---|
.. | .. |
---|
2293 | 2429 | } |
---|
2294 | 2430 | */ |
---|
2295 | 2431 | } |
---|
| 2432 | + else |
---|
| 2433 | + { |
---|
| 2434 | + //((ObjEditor)editWindow).SetupUI2(null); |
---|
| 2435 | + } |
---|
2296 | 2436 | } |
---|
2297 | 2437 | |
---|
2298 | 2438 | void createEditWindow(GroupEditor callee, boolean newWindow) //, boolean root) |
---|
2299 | 2439 | { |
---|
2300 | 2440 | if (newWindow) |
---|
2301 | 2441 | { |
---|
| 2442 | + new Exception().printStackTrace(); |
---|
2302 | 2443 | System.exit(0); |
---|
2303 | 2444 | if (parent != null) |
---|
2304 | 2445 | { |
---|
.. | .. |
---|
2333 | 2474 | { |
---|
2334 | 2475 | editWindow.refreshContents(); |
---|
2335 | 2476 | } |
---|
| 2477 | + else |
---|
| 2478 | + { |
---|
| 2479 | + if (manipWindow != null) |
---|
| 2480 | + { |
---|
| 2481 | + manipWindow.refreshContents(); |
---|
| 2482 | + } |
---|
| 2483 | + } |
---|
| 2484 | + |
---|
2336 | 2485 | //if (parent != null) |
---|
2337 | 2486 | //parent.refreshEditWindow(); |
---|
2338 | 2487 | } |
---|
.. | .. |
---|
2475 | 2624 | return retval; |
---|
2476 | 2625 | } |
---|
2477 | 2626 | |
---|
2478 | | - void doEditDrag(ClickInfo info) |
---|
| 2627 | + void doEditDrag(ClickInfo info, boolean opposite) |
---|
2479 | 2628 | { |
---|
2480 | 2629 | switch (doSomething) |
---|
2481 | 2630 | { |
---|
2482 | 2631 | case 1: // '\001' |
---|
2483 | 2632 | //super. |
---|
2484 | | - doEditDrag0(info); |
---|
| 2633 | + doEditDrag0(info, opposite); |
---|
2485 | 2634 | break; |
---|
2486 | 2635 | |
---|
2487 | 2636 | case 2: // '\002' |
---|
.. | .. |
---|
2494 | 2643 | { |
---|
2495 | 2644 | //sel.hitSomething = childToDrag.hitSomething; |
---|
2496 | 2645 | //childToDrag.doEditDrag(info); |
---|
2497 | | - sel.doEditDrag(info); |
---|
| 2646 | + sel.doEditDrag(info, opposite); |
---|
2498 | 2647 | } else |
---|
2499 | 2648 | { |
---|
2500 | 2649 | //super. |
---|
2501 | | - doEditDrag0(info); |
---|
| 2650 | + doEditDrag0(info, opposite); |
---|
2502 | 2651 | } |
---|
2503 | 2652 | } |
---|
2504 | 2653 | break; |
---|
.. | .. |
---|
2608 | 2757 | void GenNormalsS(boolean crease) |
---|
2609 | 2758 | { |
---|
2610 | 2759 | selection.GenNormals(crease); |
---|
| 2760 | +// for (int i=0; i<selection.size(); i++) |
---|
| 2761 | +// { |
---|
| 2762 | +// Object3D selectee = (Object3D) selection.elementAt(i); |
---|
| 2763 | +// selectee.GenNormals(crease); |
---|
| 2764 | +// } |
---|
| 2765 | + |
---|
| 2766 | + //Touch(); |
---|
| 2767 | + } |
---|
| 2768 | + |
---|
| 2769 | + void GenNormalsMeshS() |
---|
| 2770 | + { |
---|
| 2771 | + selection.GenNormalsMesh(); |
---|
2611 | 2772 | // for (int i=0; i<selection.size(); i++) |
---|
2612 | 2773 | // { |
---|
2613 | 2774 | // Object3D selectee = (Object3D) selection.elementAt(i); |
---|
.. | .. |
---|
2748 | 2909 | if (child == null) |
---|
2749 | 2910 | continue; |
---|
2750 | 2911 | child.GenNormals(crease); |
---|
| 2912 | +// Children().release(i); |
---|
| 2913 | + } |
---|
| 2914 | + blockloop = false; |
---|
| 2915 | + } |
---|
| 2916 | + |
---|
| 2917 | + void GenNormalsMesh() |
---|
| 2918 | + { |
---|
| 2919 | + if (blockloop) |
---|
| 2920 | + return; |
---|
| 2921 | + |
---|
| 2922 | + blockloop = true; |
---|
| 2923 | + GenNormalsMesh0(); |
---|
| 2924 | + for (int i = 0; i < Children().Size(); i++) |
---|
| 2925 | + { |
---|
| 2926 | + Object3D child = (Object3D) Children().get(i); // reserve(i); |
---|
| 2927 | + if (child == null) |
---|
| 2928 | + continue; |
---|
| 2929 | + child.GenNormalsMesh(); |
---|
2751 | 2930 | // Children().release(i); |
---|
2752 | 2931 | } |
---|
2753 | 2932 | blockloop = false; |
---|
.. | .. |
---|
2905 | 3084 | { |
---|
2906 | 3085 | if (bRep != null) |
---|
2907 | 3086 | { |
---|
2908 | | - bRep.GenUV(); |
---|
| 3087 | + bRep.GenUV(); //1); |
---|
| 3088 | + //bRep.UnfoldUV(); |
---|
2909 | 3089 | Touch(); |
---|
2910 | 3090 | } |
---|
2911 | 3091 | } |
---|
.. | .. |
---|
2915 | 3095 | if (bRep != null) |
---|
2916 | 3096 | { |
---|
2917 | 3097 | bRep.GenerateNormals(crease); |
---|
| 3098 | + Touch(); |
---|
| 3099 | + } |
---|
| 3100 | + } |
---|
| 3101 | + |
---|
| 3102 | + void GenNormalsMesh0() |
---|
| 3103 | + { |
---|
| 3104 | + if (bRep != null) |
---|
| 3105 | + { |
---|
| 3106 | + bRep.GenerateNormalsMesh(); |
---|
2918 | 3107 | Touch(); |
---|
2919 | 3108 | } |
---|
2920 | 3109 | } |
---|
.. | .. |
---|
2980 | 3169 | blockloop = false; |
---|
2981 | 3170 | } |
---|
2982 | 3171 | |
---|
| 3172 | + void TransformChildren() |
---|
| 3173 | + { |
---|
| 3174 | + if (toParent != null) |
---|
| 3175 | + { |
---|
| 3176 | + for (int i=Size(); --i>=0;) |
---|
| 3177 | + { |
---|
| 3178 | + Object3D v = get(i); |
---|
| 3179 | + |
---|
| 3180 | + if (v.toParent == null) |
---|
| 3181 | + { |
---|
| 3182 | + v.toParent = LA.newMatrix(); |
---|
| 3183 | + v.fromParent = LA.newMatrix(); |
---|
| 3184 | + } |
---|
| 3185 | + |
---|
| 3186 | +// LA.matConcat(v.toParent, toParent, v.toParent); |
---|
| 3187 | +// LA.matConcat(fromParent, v.fromParent, v.fromParent); |
---|
| 3188 | + LA.matConcat(toParent, v.toParent, v.toParent); |
---|
| 3189 | + LA.matConcat(v.fromParent, fromParent, v.fromParent); |
---|
| 3190 | + } |
---|
| 3191 | + |
---|
| 3192 | + toParent = null; // LA.matIdentity(toParent); |
---|
| 3193 | + fromParent = null; // LA.matIdentity(fromParent); |
---|
| 3194 | + |
---|
| 3195 | + Touch(); |
---|
| 3196 | + } |
---|
| 3197 | + } |
---|
| 3198 | + |
---|
2983 | 3199 | void TransformGeometry() |
---|
2984 | 3200 | { |
---|
2985 | 3201 | Object3D obj = this; |
---|
.. | .. |
---|
3201 | 3417 | |
---|
3202 | 3418 | BoundaryRep sup = bRep.support; |
---|
3203 | 3419 | bRep.support = null; |
---|
3204 | | - BoundaryRep temprep = (BoundaryRep) GrafreeD.clone(bRep); |
---|
| 3420 | + BoundaryRep temprep = (BoundaryRep) Grafreed.clone(bRep); |
---|
3205 | 3421 | // bRep.SplitInTwo(onlyone); // thread... |
---|
3206 | | - temprep.SplitInTwo(reduction34, onlyone); |
---|
| 3422 | + |
---|
| 3423 | + while(temprep.SplitInTwo(reduction34, onlyone)); |
---|
| 3424 | + |
---|
3207 | 3425 | bRep = temprep; |
---|
3208 | 3426 | bRep.support = sup; |
---|
3209 | 3427 | Touch(); |
---|
.. | .. |
---|
3340 | 3558 | if (blockloop) |
---|
3341 | 3559 | return; |
---|
3342 | 3560 | |
---|
3343 | | - if (marked || (bRep != null && material != null)) // borderline... |
---|
| 3561 | + if (//marked || // does not make sense |
---|
| 3562 | + (bRep != null || material != null)) // borderline... |
---|
3344 | 3563 | live = h; |
---|
3345 | 3564 | |
---|
3346 | 3565 | for (int i = 0; i < Size(); i++) |
---|
.. | .. |
---|
3361 | 3580 | return; |
---|
3362 | 3581 | |
---|
3363 | 3582 | //if (bRep != null) |
---|
3364 | | - if (marked || (bRep != null && material != null)) // borderline... |
---|
| 3583 | + if (//marked || // does not make sense |
---|
| 3584 | + (bRep != null || material != null)) // borderline... |
---|
3365 | 3585 | link2master = h; |
---|
3366 | 3586 | |
---|
3367 | 3587 | for (int i = 0; i < Size(); i++) |
---|
.. | .. |
---|
3381 | 3601 | if (blockloop) |
---|
3382 | 3602 | return; |
---|
3383 | 3603 | |
---|
3384 | | - if (marked || (bRep != null && material != null)) // borderline... |
---|
| 3604 | + if (//marked || // does not make sense |
---|
| 3605 | + (bRep != null || material != null)) // borderline... |
---|
3385 | 3606 | hide = h; |
---|
3386 | 3607 | |
---|
3387 | 3608 | for (int i = 0; i < Size(); i++) |
---|
.. | .. |
---|
3401 | 3622 | if (blockloop) |
---|
3402 | 3623 | return; |
---|
3403 | 3624 | |
---|
3404 | | - if (bRep != null && material != null) // borderline... |
---|
| 3625 | + if (bRep != null || material != null) // borderline... |
---|
3405 | 3626 | marked = h; |
---|
3406 | 3627 | |
---|
3407 | 3628 | for (int i = 0; i < Size(); i++) |
---|
.. | .. |
---|
3411 | 3632 | continue; |
---|
3412 | 3633 | blockloop = true; |
---|
3413 | 3634 | child.MarkLeaves(h); |
---|
| 3635 | + blockloop = false; |
---|
| 3636 | + // release(i); |
---|
| 3637 | + } |
---|
| 3638 | + } |
---|
| 3639 | + |
---|
| 3640 | + void RewindLeaves(boolean h) |
---|
| 3641 | + { |
---|
| 3642 | + if (blockloop) |
---|
| 3643 | + return; |
---|
| 3644 | + |
---|
| 3645 | + if (bRep != null || material != null) // borderline... |
---|
| 3646 | + rewind = h; |
---|
| 3647 | + |
---|
| 3648 | + for (int i = 0; i < Size(); i++) |
---|
| 3649 | + { |
---|
| 3650 | + Object3D child = (Object3D) get(i); // reserve(i); |
---|
| 3651 | + if (child == null) |
---|
| 3652 | + continue; |
---|
| 3653 | + blockloop = true; |
---|
| 3654 | + child.RewindLeaves(h); |
---|
| 3655 | + blockloop = false; |
---|
| 3656 | + // release(i); |
---|
| 3657 | + } |
---|
| 3658 | + } |
---|
| 3659 | + |
---|
| 3660 | + void RandomLeaves(boolean h) |
---|
| 3661 | + { |
---|
| 3662 | + if (blockloop) |
---|
| 3663 | + return; |
---|
| 3664 | + |
---|
| 3665 | + if (bRep != null || material != null) // borderline... |
---|
| 3666 | + random = h; |
---|
| 3667 | + |
---|
| 3668 | + for (int i = 0; i < Size(); i++) |
---|
| 3669 | + { |
---|
| 3670 | + Object3D child = (Object3D) get(i); // reserve(i); |
---|
| 3671 | + if (child == null) |
---|
| 3672 | + continue; |
---|
| 3673 | + blockloop = true; |
---|
| 3674 | + child.RandomLeaves(h); |
---|
3414 | 3675 | blockloop = false; |
---|
3415 | 3676 | // release(i); |
---|
3416 | 3677 | } |
---|
.. | .. |
---|
3725 | 3986 | if (child == null) |
---|
3726 | 3987 | continue; |
---|
3727 | 3988 | |
---|
3728 | | - if (GrafreeD.RENDERME > 0) |
---|
| 3989 | + if (Grafreed.RENDERME > 0) |
---|
3729 | 3990 | { |
---|
3730 | 3991 | if (child instanceof Merge) |
---|
3731 | 3992 | ((Merge)child).renderme(); |
---|
.. | .. |
---|
3876 | 4137 | if (child == null) |
---|
3877 | 4138 | continue; |
---|
3878 | 4139 | |
---|
3879 | | - if (GrafreeD.RENDERME > 0) |
---|
| 4140 | + if (Grafreed.RENDERME > 0) |
---|
3880 | 4141 | { |
---|
3881 | 4142 | if (child instanceof Merge) |
---|
3882 | 4143 | ((Merge)child).renderme(); |
---|
.. | .. |
---|
4071 | 4332 | if (child == null) |
---|
4072 | 4333 | continue; |
---|
4073 | 4334 | |
---|
4074 | | - if (GrafreeD.RENDERME > 0) |
---|
| 4335 | + if (Grafreed.RENDERME > 0) |
---|
4075 | 4336 | { |
---|
4076 | 4337 | if (child instanceof Merge) |
---|
4077 | 4338 | ((Merge)child).renderme(); |
---|
.. | .. |
---|
4184 | 4445 | { |
---|
4185 | 4446 | blockloop = true; |
---|
4186 | 4447 | get(i).RepairShadow(); |
---|
| 4448 | + blockloop = false; |
---|
| 4449 | + } |
---|
| 4450 | + } |
---|
| 4451 | + |
---|
| 4452 | + void RepairSOV() |
---|
| 4453 | + { |
---|
| 4454 | + if (blockloop) |
---|
| 4455 | + return; |
---|
| 4456 | + |
---|
| 4457 | + String texname = this.GetPigmentTexture(); |
---|
| 4458 | + |
---|
| 4459 | + if (texname.startsWith("sov")) |
---|
| 4460 | + { |
---|
| 4461 | + String[] s = texname.split("/"); |
---|
| 4462 | + |
---|
| 4463 | + String[] sname = s[1].split("Color.pn"); |
---|
| 4464 | + |
---|
| 4465 | + texname = sname[0]; |
---|
| 4466 | + |
---|
| 4467 | + if (sname.length > 1) |
---|
| 4468 | + { |
---|
| 4469 | + texname += "Color.jpg"; |
---|
| 4470 | + } |
---|
| 4471 | + |
---|
| 4472 | + this.SetPigmentTexture("sov/" + texname); |
---|
| 4473 | + } |
---|
| 4474 | + |
---|
| 4475 | + texname = this.GetBumpTexture(); |
---|
| 4476 | + |
---|
| 4477 | + if (texname.startsWith("sov")) |
---|
| 4478 | + { |
---|
| 4479 | + String[] s = texname.split("/"); |
---|
| 4480 | + |
---|
| 4481 | + String[] sname = s[1].split("Bump.pn"); |
---|
| 4482 | + |
---|
| 4483 | + texname = sname[0]; |
---|
| 4484 | + |
---|
| 4485 | + if (sname.length > 1) |
---|
| 4486 | + { |
---|
| 4487 | + texname += "Bump.jpg"; |
---|
| 4488 | + } |
---|
| 4489 | + |
---|
| 4490 | + this.SetBumpTexture("sov/" + texname); |
---|
| 4491 | + } |
---|
| 4492 | + |
---|
| 4493 | + for (int i=0; i<Size(); i++) |
---|
| 4494 | + { |
---|
| 4495 | + blockloop = true; |
---|
| 4496 | + get(i).RepairSOV(); |
---|
4187 | 4497 | blockloop = false; |
---|
4188 | 4498 | } |
---|
4189 | 4499 | } |
---|
.. | .. |
---|
4678 | 4988 | |
---|
4679 | 4989 | cTreePath SelectLeaf(int indexcount, boolean deselect) |
---|
4680 | 4990 | { |
---|
4681 | | - if (hide) |
---|
| 4991 | + if (hide || dontselect) |
---|
4682 | 4992 | return null; |
---|
4683 | 4993 | |
---|
4684 | 4994 | if (count <= 0) |
---|
.. | .. |
---|
4702 | 5012 | } |
---|
4703 | 5013 | } |
---|
4704 | 5014 | |
---|
| 5015 | + ObjEditor GetWindow() |
---|
| 5016 | + { |
---|
| 5017 | + if (editWindow != null) |
---|
| 5018 | + return editWindow; |
---|
| 5019 | + |
---|
| 5020 | + return manipWindow; |
---|
| 5021 | + } |
---|
| 5022 | + |
---|
4705 | 5023 | cTreePath Select(int indexcount, boolean deselect) |
---|
4706 | 5024 | { |
---|
4707 | | - if (hide) |
---|
| 5025 | + if (hide || dontselect) |
---|
4708 | 5026 | return null; |
---|
4709 | 5027 | |
---|
4710 | 5028 | if (count <= 0) |
---|
.. | .. |
---|
4738 | 5056 | if (leaf != null) |
---|
4739 | 5057 | { |
---|
4740 | 5058 | cTreePath tp = new cTreePath(this, leaf); |
---|
4741 | | - if (editWindow != null) |
---|
| 5059 | + ObjEditor window = GetWindow(); |
---|
| 5060 | + if (window != null) |
---|
4742 | 5061 | { |
---|
4743 | 5062 | //System.out.println("editWindow = " + editWindow + " vs " + this); |
---|
4744 | | - editWindow.Select(tp, deselect, true); |
---|
| 5063 | + window.Select(tp, deselect, true); |
---|
4745 | 5064 | } |
---|
4746 | 5065 | |
---|
4747 | 5066 | return tp; |
---|
.. | .. |
---|
4758 | 5077 | |
---|
4759 | 5078 | if (child == null) |
---|
4760 | 5079 | continue; |
---|
| 5080 | + |
---|
4761 | 5081 | if (child.HasTransparency() && child.size() != 0) |
---|
4762 | 5082 | { |
---|
4763 | 5083 | cTreePath leaf = child.Select(indexcount, deselect); |
---|
.. | .. |
---|
4767 | 5087 | if (leaf != null) |
---|
4768 | 5088 | { |
---|
4769 | 5089 | cTreePath tp = new cTreePath(this, leaf); |
---|
4770 | | - if (editWindow != null) |
---|
| 5090 | + ObjEditor window = GetWindow(); |
---|
| 5091 | + if (window != null) |
---|
4771 | 5092 | { |
---|
4772 | | - editWindow.Select(tp, deselect, true); |
---|
| 5093 | + window.Select(tp, deselect, true); |
---|
4773 | 5094 | } |
---|
4774 | 5095 | |
---|
4775 | 5096 | return tp; |
---|
.. | .. |
---|
4854 | 5175 | return globalTransform; |
---|
4855 | 5176 | } |
---|
4856 | 5177 | |
---|
4857 | | - void PreprocessOcclusion(CameraPane cp) |
---|
| 5178 | + void PreprocessOcclusion(iCameraPane cp) |
---|
4858 | 5179 | { |
---|
4859 | 5180 | /* |
---|
4860 | 5181 | if (AOdone) |
---|
.. | .. |
---|
5156 | 5477 | |
---|
5157 | 5478 | // System.out.println("Fullname = " + fullname); |
---|
5158 | 5479 | |
---|
5159 | | - if (fullname.name.indexOf(":") == -1) |
---|
5160 | | - return fullname.name; |
---|
| 5480 | + // Does not work on Windows due to C: |
---|
| 5481 | +// if (fullname.name.indexOf(":") == -1) |
---|
| 5482 | +// return fullname.name; |
---|
| 5483 | +// |
---|
| 5484 | +// return fullname.name.substring(0,fullname.name.indexOf(":")); |
---|
5161 | 5485 | |
---|
5162 | | - return fullname.name.substring(0,fullname.name.indexOf(":")); |
---|
| 5486 | + String[] split = fullname.name.split(":"); |
---|
| 5487 | + |
---|
| 5488 | + if (split.length == 0) |
---|
| 5489 | + { |
---|
| 5490 | + return ""; |
---|
| 5491 | + } |
---|
| 5492 | + |
---|
| 5493 | + if (split.length <= 2) |
---|
| 5494 | + { |
---|
| 5495 | + if (fullname.name.endsWith(":")) |
---|
| 5496 | + { |
---|
| 5497 | + // Windows |
---|
| 5498 | + return fullname.name.substring(0, fullname.name.length()-1); |
---|
| 5499 | + } |
---|
| 5500 | + |
---|
| 5501 | + return split[0]; |
---|
| 5502 | + } |
---|
| 5503 | + |
---|
| 5504 | + // Windows |
---|
| 5505 | + assert(split.length == 4); |
---|
| 5506 | + |
---|
| 5507 | + return split[0] + ":" + split[1]; |
---|
5163 | 5508 | } |
---|
5164 | 5509 | |
---|
5165 | 5510 | static String GetBump(cTexture fullname) |
---|
.. | .. |
---|
5168 | 5513 | return ""; |
---|
5169 | 5514 | |
---|
5170 | 5515 | // System.out.println("Fullname = " + fullname); |
---|
5171 | | - if (fullname.name.indexOf(":") == -1) |
---|
5172 | | - return ""; |
---|
5173 | | - |
---|
5174 | | - return fullname.name.substring(fullname.name.indexOf(":")+1,fullname.name.length()); |
---|
| 5516 | + // Does not work on Windows due to C: |
---|
| 5517 | +// if (fullname.name.indexOf(":") == -1) |
---|
| 5518 | +// return ""; |
---|
| 5519 | +// |
---|
| 5520 | +// return fullname.name.substring(fullname.name.indexOf(":")+1,fullname.name.length()); |
---|
| 5521 | + String[] split = fullname.name.split(":"); |
---|
| 5522 | + |
---|
| 5523 | + if (split.length == 0) |
---|
| 5524 | + { |
---|
| 5525 | + return ""; |
---|
| 5526 | + } |
---|
| 5527 | + |
---|
| 5528 | + if (split.length == 1) |
---|
| 5529 | + { |
---|
| 5530 | + return ""; |
---|
| 5531 | + } |
---|
| 5532 | + |
---|
| 5533 | + if (split.length == 2) |
---|
| 5534 | + { |
---|
| 5535 | + if (fullname.name.endsWith(":")) |
---|
| 5536 | + { |
---|
| 5537 | + // Windows |
---|
| 5538 | + return ""; |
---|
| 5539 | + } |
---|
| 5540 | + |
---|
| 5541 | + return split[1]; |
---|
| 5542 | + } |
---|
| 5543 | + |
---|
| 5544 | + // Windows |
---|
| 5545 | + assert(split.length == 4); |
---|
| 5546 | + |
---|
| 5547 | + return split[2] + ":" + split[3]; |
---|
5175 | 5548 | } |
---|
5176 | 5549 | |
---|
5177 | 5550 | String GetPigmentTexture() |
---|
.. | .. |
---|
5245 | 5618 | System.out.print("; textures = " + textures); |
---|
5246 | 5619 | System.out.println("; usedtextures = " + usedtextures); |
---|
5247 | 5620 | |
---|
5248 | | - if (GetTextures() == null) |
---|
| 5621 | + if (GetTextures() == null) // What is that?? |
---|
5249 | 5622 | GetTextures().name = ":"; |
---|
5250 | 5623 | |
---|
5251 | 5624 | String texname = tex; |
---|
.. | .. |
---|
5276 | 5649 | child.ResetPigmentTexture(); |
---|
5277 | 5650 | blockloop = false; |
---|
5278 | 5651 | } |
---|
| 5652 | + } |
---|
| 5653 | + |
---|
| 5654 | + UUID GetUUID() |
---|
| 5655 | + { |
---|
| 5656 | + if (uuid == null) |
---|
| 5657 | + { |
---|
| 5658 | + // Serial |
---|
| 5659 | + uuid = UUID.randomUUID(); |
---|
| 5660 | + } |
---|
| 5661 | + |
---|
| 5662 | + return uuid; |
---|
| 5663 | + } |
---|
| 5664 | + |
---|
| 5665 | + Object3D GetObject(UUID uid) |
---|
| 5666 | + { |
---|
| 5667 | + if (blockloop) |
---|
| 5668 | + return null; |
---|
| 5669 | + |
---|
| 5670 | + if (GetUUID().equals(uid)) |
---|
| 5671 | + return this; |
---|
| 5672 | + |
---|
| 5673 | + int nb = Size(); |
---|
| 5674 | + for (int i = 0; i < nb; i++) |
---|
| 5675 | + { |
---|
| 5676 | + Object3D child = (Object3D) get(i); |
---|
| 5677 | + |
---|
| 5678 | + if (child == null) |
---|
| 5679 | + continue; |
---|
| 5680 | + |
---|
| 5681 | + blockloop = true; |
---|
| 5682 | + Object3D obj = child.GetObject(uid); |
---|
| 5683 | + blockloop = false; |
---|
| 5684 | + if (obj != null) |
---|
| 5685 | + return obj; |
---|
| 5686 | + } |
---|
| 5687 | + |
---|
| 5688 | + return null; |
---|
5279 | 5689 | } |
---|
5280 | 5690 | |
---|
5281 | 5691 | void SetBumpTexture(String tex) |
---|
.. | .. |
---|
5322 | 5732 | boolean NeedSupport() |
---|
5323 | 5733 | { |
---|
5324 | 5734 | return |
---|
5325 | | - CameraPane.SUPPORT && !CameraPane.movingcamera && link2master && /*live &&*/ support != null |
---|
| 5735 | + CameraPane.SUPPORT && (!CameraPane.movingcamera || (!Globals.FREEZEONMOVE && Globals.isLIVE())) && link2master && /*live &&*/ support != null |
---|
5326 | 5736 | // PROBLEM with CROWD!! |
---|
5327 | | - && (Globals.DrawMode() == iCameraPane.SHADOW || Globals.CROWD); |
---|
| 5737 | + && (Globals.DrawMode() == iCameraPane.SHADOW || !Globals.RENDERSHADOW || Globals.CROWD); |
---|
5328 | 5738 | } |
---|
5329 | 5739 | |
---|
| 5740 | + static boolean DEBUG_SELECTION = false; |
---|
| 5741 | + |
---|
| 5742 | + boolean IsLive() |
---|
| 5743 | + { |
---|
| 5744 | + if (live) |
---|
| 5745 | + return true; |
---|
| 5746 | + |
---|
| 5747 | + if (parent == null) |
---|
| 5748 | + return false; |
---|
| 5749 | + |
---|
| 5750 | + return parent.IsLive(); |
---|
| 5751 | + } |
---|
5330 | 5752 | |
---|
5331 | 5753 | void Draw(iCameraPane display, Object3D /*Composite*/ root, boolean selected, boolean blocked) |
---|
5332 | 5754 | { |
---|
.. | .. |
---|
5338 | 5760 | } |
---|
5339 | 5761 | |
---|
5340 | 5762 | if (display.DrawMode() == iCameraPane.SELECTION && |
---|
5341 | | - hide) |
---|
| 5763 | + (hide || dontselect)) |
---|
5342 | 5764 | return; |
---|
5343 | 5765 | |
---|
5344 | 5766 | if (name != null && name.contains("sclera")) |
---|
.. | .. |
---|
5365 | 5787 | } |
---|
5366 | 5788 | |
---|
5367 | 5789 | if ((//display.DrawMode() == CameraPane.SHADOW || |
---|
5368 | | - display.DrawMode() == CameraPane.SELECTION || CameraPane.DEBUG_SELECTION) && HasTransparency()) |
---|
| 5790 | + display.DrawMode() == iCameraPane.SELECTION || display.IsDebugSelection()) && HasTransparency()) |
---|
5369 | 5791 | { |
---|
5370 | 5792 | return; |
---|
5371 | 5793 | } |
---|
5372 | 5794 | |
---|
5373 | | - javax.media.opengl.GL gl = display.GetGL(); |
---|
| 5795 | + //javax.media.opengl.GL gl = display.GetGL(); |
---|
5374 | 5796 | |
---|
5375 | 5797 | /* |
---|
5376 | 5798 | if (touched) |
---|
.. | .. |
---|
5389 | 5811 | support = support; |
---|
5390 | 5812 | |
---|
5391 | 5813 | //boolean usecalllists = IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null || !link2master); // !(this instanceof cSpring) && !(this instanceof BezierPatch); |
---|
5392 | | - boolean usecalllists = false; // IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null) && !link2master; // !(this instanceof cSpring) && !(this instanceof BezierPatch); |
---|
| 5814 | + boolean usecalllists = !IsLive(); // IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null) && !link2master; // !(this instanceof cSpring) && !(this instanceof BezierPatch); |
---|
5393 | 5815 | |
---|
5394 | 5816 | if (!usecalllists && bRep != null && bRep.displaylist > 0) |
---|
5395 | 5817 | { |
---|
.. | .. |
---|
5406 | 5828 | |
---|
5407 | 5829 | boolean compiled = false; |
---|
5408 | 5830 | |
---|
5409 | | - boolean selectmode = display.DrawMode() == display.SELECTION || CameraPane.DEBUG_SELECTION; |
---|
| 5831 | + boolean selectmode = display.DrawMode() == display.SELECTION || display.IsDebugSelection(); |
---|
5410 | 5832 | |
---|
5411 | 5833 | if (!selectmode && //display.DrawMode() != display.SELECTION && |
---|
5412 | | - (touched || (bRep != null && bRep.displaylist <= 0))) |
---|
| 5834 | + //(touched || (bRep != null && bRep.displaylist <= 0))) |
---|
| 5835 | + (Globals.isLIVE() && Globals.COMPUTESHADOWWHENLIVE || touched && Globals.COMPUTESHADOWWHENLIVE)) // || (bRep != null && bRep.displaylist <= 0))) |
---|
5413 | 5836 | { |
---|
5414 | 5837 | Globals.lighttouched = true; |
---|
5415 | 5838 | } // all panes... |
---|
| 5839 | + |
---|
5416 | 5840 | //if (usecalllists && display.DrawMode() != display.SELECTION && display.DrawMode() != display.SHADOW && |
---|
5417 | 5841 | if (bRep != null && usecalllists && !selectmode && // june 2013 display.DrawMode() != display.SHADOW && |
---|
5418 | 5842 | (touched || (bRep != null && bRep.displaylist <= 0))) |
---|
.. | .. |
---|
5422 | 5846 | //if (displaylist == -1 && usecalllists) |
---|
5423 | 5847 | if ((bRep != null && bRep.displaylist <= 0) && usecalllists) // june 2013 |
---|
5424 | 5848 | { |
---|
5425 | | - bRep.displaylist = gl.glGenLists(1); |
---|
| 5849 | + bRep.displaylist = display.GenList(); |
---|
5426 | 5850 | assert(bRep.displaylist != 0); |
---|
5427 | 5851 | // System.err.println("glGenLists: " + bRep.displaylist + " for " + this); |
---|
5428 | 5852 | //System.out.println("\tgen list " + list); |
---|
.. | .. |
---|
5434 | 5858 | if (usecalllists) |
---|
5435 | 5859 | { |
---|
5436 | 5860 | // System.err.println("new list " + bRep.displaylist + " for " + this); |
---|
5437 | | - gl.glNewList(bRep.displaylist, gl.GL_COMPILE); //_AND_EXECUTE); |
---|
| 5861 | + display.NewList(bRep.displaylist); |
---|
5438 | 5862 | } |
---|
| 5863 | + |
---|
5439 | 5864 | CallList(display, root, selected, blocked); |
---|
| 5865 | + |
---|
5440 | 5866 | // compiled = true; |
---|
5441 | 5867 | if (usecalllists) |
---|
5442 | 5868 | { |
---|
5443 | 5869 | // System.err.println("end list " + bRep.displaylist + " for " + this); |
---|
5444 | | - gl.glEndList(); |
---|
| 5870 | + display.EndList(); |
---|
5445 | 5871 | } |
---|
5446 | 5872 | //gl.glDrawBuffer(gl.GL_BACK); |
---|
5447 | 5873 | // XXX touched = false; |
---|
.. | .. |
---|
5484 | 5910 | |
---|
5485 | 5911 | // frustum culling |
---|
5486 | 5912 | if (CameraPane.FRUSTUM && !blocked && !IsInfinite() && GetBRep() != null // && GetBRep().VertexCount() != 1260 // default grid |
---|
5487 | | - && display.DrawMode() != CameraPane.SELECTION) |
---|
| 5913 | + && display.DrawMode() != iCameraPane.SELECTION) |
---|
5488 | 5914 | { |
---|
5489 | | - if (display.DrawMode() == CameraPane.SHADOW) |
---|
| 5915 | + if (display.DrawMode() == iCameraPane.SHADOW) |
---|
5490 | 5916 | { |
---|
5491 | 5917 | if (!link2master // tricky to cull in shadow mode. |
---|
5492 | | - && GetBRep().FrustumCull(this, gl, display.LightCamera(), true)) |
---|
| 5918 | + && GetBRep().FrustumCull(this, null, display.LightCamera(), true)) |
---|
5493 | 5919 | { |
---|
5494 | 5920 | //System.out.print("CULLED"); |
---|
5495 | 5921 | culled = true; |
---|
.. | .. |
---|
5497 | 5923 | } |
---|
5498 | 5924 | else |
---|
5499 | 5925 | //GetBRep().getBounds(v0, v1, this); |
---|
5500 | | - if (GetBRep().FrustumCull(this, gl, display.RenderCamera(), false)) |
---|
| 5926 | + if (GetBRep().FrustumCull(this, null, display.RenderCamera(), false)) |
---|
5501 | 5927 | culled = true; |
---|
5502 | 5928 | |
---|
5503 | 5929 | // LA.xformPos(v0, display.renderCamera.toScreen, v0); |
---|
.. | .. |
---|
5533 | 5959 | |
---|
5534 | 5960 | |
---|
5535 | 5961 | if (!culled) |
---|
5536 | | - if (display.DrawMode() == display.SELECTION || CameraPane.DEBUG_SELECTION) |
---|
| 5962 | + if (display.DrawMode() == display.SELECTION || display.IsDebugSelection()) |
---|
5537 | 5963 | { |
---|
5538 | 5964 | if (GetBRep() != null) |
---|
5539 | 5965 | { |
---|
5540 | | - CameraPane.NextIndex(this, gl); |
---|
| 5966 | + display.NextIndex(); |
---|
| 5967 | + |
---|
5541 | 5968 | // vertex color conflict : gl.glCallList(list); |
---|
5542 | 5969 | DrawNode(display, root, selected); |
---|
5543 | 5970 | if (this instanceof BezierPatch) |
---|
.. | .. |
---|
5578 | 6005 | tex = GetTextures(); |
---|
5579 | 6006 | } |
---|
5580 | 6007 | |
---|
5581 | | - display.BindTextures(tex, texres); |
---|
| 6008 | + boolean failedPigment = false; |
---|
| 6009 | + boolean failedBump = false; |
---|
| 6010 | + |
---|
| 6011 | + try |
---|
| 6012 | + { |
---|
| 6013 | + display.BindPigmentTexture(tex, texres); |
---|
| 6014 | + } |
---|
| 6015 | + catch (Exception e) |
---|
| 6016 | + { |
---|
| 6017 | + System.err.println("FAILED: " + this); |
---|
| 6018 | + failedPigment = true; |
---|
| 6019 | + } |
---|
| 6020 | + |
---|
| 6021 | + try |
---|
| 6022 | + { |
---|
| 6023 | + display.BindBumpTexture(tex, texres); |
---|
| 6024 | + } |
---|
| 6025 | + catch (Exception e) |
---|
| 6026 | + { |
---|
| 6027 | + //System.err.println("FAILED: " + this); |
---|
| 6028 | + failedBump = true; |
---|
| 6029 | + } |
---|
5582 | 6030 | |
---|
5583 | 6031 | if (!compiled) |
---|
5584 | 6032 | { |
---|
.. | .. |
---|
5594 | 6042 | |
---|
5595 | 6043 | // System.err.println("glCallList: " + bRep.displaylist + " for " + this); |
---|
5596 | 6044 | assert(bRep.displaylist != 0); |
---|
5597 | | - gl.glCallList(bRep.displaylist); |
---|
| 6045 | + display.CallList(bRep.displaylist); |
---|
5598 | 6046 | // june 2013 drawSelf(display, root, selected); |
---|
5599 | 6047 | } |
---|
5600 | 6048 | } |
---|
5601 | 6049 | } |
---|
5602 | 6050 | |
---|
5603 | | - display.ReleaseTextures(tex); |
---|
| 6051 | + if (!failedBump) |
---|
| 6052 | + display.ReleaseBumpTexture(tex); |
---|
| 6053 | + |
---|
| 6054 | + if (!failedPigment) |
---|
| 6055 | + display.ReleasePigmentTexture(tex); |
---|
5604 | 6056 | |
---|
5605 | 6057 | display.PopMaterial(this, selected); |
---|
5606 | 6058 | } |
---|
.. | .. |
---|
5729 | 6181 | |
---|
5730 | 6182 | void drawSelf(iCameraPane display, Object3D /*Composite*/ root, boolean selected, boolean blocked) |
---|
5731 | 6183 | { |
---|
| 6184 | + if (display.DrawMode() == iCameraPane.SELECTION && dontselect) |
---|
| 6185 | + return; |
---|
| 6186 | + |
---|
5732 | 6187 | if (hide) |
---|
5733 | 6188 | return; |
---|
5734 | 6189 | // shadow optimisation |
---|
.. | .. |
---|
5854 | 6309 | if (display.DrawMode() == display.SHADOW && projectedVertices != null && projectedVertices.length > 2 && projectedVertices[2].y >= 10000) |
---|
5855 | 6310 | return; // no shadow for transparent objects |
---|
5856 | 6311 | |
---|
| 6312 | + if (display.DrawMode() == iCameraPane.SELECTION && dontselect) |
---|
| 6313 | + return; |
---|
| 6314 | + |
---|
5857 | 6315 | if (hide) |
---|
5858 | 6316 | return; |
---|
5859 | 6317 | |
---|
.. | .. |
---|
5894 | 6352 | return; |
---|
5895 | 6353 | } |
---|
5896 | 6354 | |
---|
| 6355 | + //bRep.GenUV(1/material.diffuseness); |
---|
5897 | 6356 | // bRep.lock = true; |
---|
5898 | 6357 | |
---|
5899 | | - javax.media.opengl.GL gl = display.GetGL(); |
---|
| 6358 | + //javax.media.opengl.GL gl = display.GetGL(); |
---|
5900 | 6359 | |
---|
5901 | 6360 | if (CameraPane.BOXMODE && !selected) // || CameraPane.movingcamera) |
---|
5902 | 6361 | { |
---|
.. | .. |
---|
5913 | 6372 | |
---|
5914 | 6373 | bRep.getMinMax(min, max, 100); |
---|
5915 | 6374 | |
---|
5916 | | - gl.glBegin(gl.GL_LINES); |
---|
5917 | | - |
---|
5918 | | - gl.glVertex3d(min.x, min.y, min.z); |
---|
5919 | | - gl.glVertex3d(min.x, min.y, max.z); |
---|
5920 | | - gl.glVertex3d(min.x, min.y, min.z); |
---|
5921 | | - gl.glVertex3d(min.x, max.y, min.z); |
---|
5922 | | - gl.glVertex3d(min.x, min.y, min.z); |
---|
5923 | | - gl.glVertex3d(max.x, min.y, min.z); |
---|
5924 | | - |
---|
5925 | | - gl.glVertex3d(max.x, max.y, max.z); |
---|
5926 | | - gl.glVertex3d(min.x, max.y, max.z); |
---|
5927 | | - gl.glVertex3d(max.x, max.y, max.z); |
---|
5928 | | - gl.glVertex3d(max.x, min.y, max.z); |
---|
5929 | | - gl.glVertex3d(max.x, max.y, max.z); |
---|
5930 | | - gl.glVertex3d(max.x, max.y, min.z); |
---|
5931 | | - |
---|
5932 | | - gl.glEnd(); |
---|
| 6375 | + display.DrawBox(min, max); |
---|
5933 | 6376 | |
---|
5934 | 6377 | return; |
---|
5935 | 6378 | } |
---|
.. | .. |
---|
5973 | 6416 | { |
---|
5974 | 6417 | //throw new Error(); |
---|
5975 | 6418 | |
---|
5976 | | - boolean selectmode = display.DrawMode() == display.SELECTION || CameraPane.DEBUG_SELECTION; |
---|
| 6419 | + boolean selectmode = display.DrawMode() == display.SELECTION || display.IsDebugSelection(); |
---|
5977 | 6420 | |
---|
5978 | 6421 | int[] strips = bRep.getRawIndices(); |
---|
5979 | 6422 | |
---|
.. | .. |
---|
5983 | 6426 | new Exception().printStackTrace(); |
---|
5984 | 6427 | return; |
---|
5985 | 6428 | } |
---|
5986 | | - |
---|
5987 | | - // TRIANGLE STRIP ARRAY |
---|
5988 | | - if (bRep.trimmed) |
---|
| 6429 | + |
---|
| 6430 | + if (dontselect) |
---|
5989 | 6431 | { |
---|
5990 | | - float[] v = bRep.getRawVertices(); |
---|
5991 | | - float[] n = bRep.getRawNormals(); |
---|
5992 | | - float[] c = bRep.getRawColors(); |
---|
5993 | | - float[] uv = bRep.getRawUVMap(); |
---|
5994 | | - |
---|
5995 | | - int count2 = 0; |
---|
5996 | | - int count3 = 0; |
---|
5997 | | - |
---|
5998 | | - if (n.length > 0) |
---|
5999 | | - { |
---|
6000 | | - for (int i = 0; i < strips.length; i++) |
---|
6001 | | - { |
---|
6002 | | - gl.glBegin(gl.GL_TRIANGLE_STRIP); |
---|
6003 | | - |
---|
6004 | | - /* |
---|
6005 | | - boolean locked = false; |
---|
6006 | | - float eps = 0.1f; |
---|
6007 | | - boolean wrap = CameraPane.UVWRAP; // true; // UV WRAP TEXTURE ISSUE: true = artifacts, false = nice |
---|
6008 | | - |
---|
6009 | | - int dot = 0; |
---|
6010 | | - |
---|
6011 | | - if ((dot&1) == 0) |
---|
6012 | | - dot |= (Math.abs(qv.s - pv.s) < eps && Math.abs(qv.t - pv.t) < eps) ? 3 : 1; |
---|
6013 | | - |
---|
6014 | | - if (wrap || (dot&2) != 0) // Math.abs(qv.s - pv.s) < eps && Math.abs(qv.t - pv.t) < eps) |
---|
6015 | | - gl.glTexCoord2f((float) qv.s, (float) qv.t); |
---|
6016 | | - else |
---|
6017 | | - { |
---|
6018 | | - locked = true; |
---|
6019 | | - gl.glTexCoord2f((float) pv.s, (float) pv.t); |
---|
6020 | | - } |
---|
6021 | | - //System.out.println("vertexq = " + qv.x + ", " + qv.y + ", " + qv.z); |
---|
6022 | | - gl.glVertex3f((float) qv.x, (float) qv.y, (float) qv.z); |
---|
6023 | | - if (hasnorm) |
---|
6024 | | - { |
---|
6025 | | - //System.out.println("normalr = " + rv.norm.x + ", " + rv.norm.y + ", " + rv.norm.z); |
---|
6026 | | - gl.glNormal3f((float) rv.norm.x, (float) rv.norm.y, (float) rv.norm.z); |
---|
6027 | | - } |
---|
6028 | | - |
---|
6029 | | - if ((dot&4) == 0) |
---|
6030 | | - dot |= (Math.abs(rv.s - pv.s) < eps && Math.abs(rv.t - pv.t) < eps) ? 12 : 4; |
---|
6031 | | - |
---|
6032 | | - if (wrap || !locked && (dot&8) != 0) |
---|
6033 | | - gl.glTexCoord2f((float) rv.s, (float) rv.t); |
---|
6034 | | - else |
---|
6035 | | - gl.glTexCoord2f((float) pv.s, (float) pv.t); |
---|
6036 | | - |
---|
6037 | | - f.dot = dot; |
---|
6038 | | - */ |
---|
6039 | | - |
---|
6040 | | - if (!selectmode) |
---|
6041 | | - { |
---|
6042 | | - if (n[count3] != 0 || n[count3 + 1] != 0 || n[count3 + 2] != 0) |
---|
6043 | | - { |
---|
6044 | | - gl.glNormal3f(n[count3], n[count3 + 1], n[count3 + 2]); |
---|
6045 | | - } else |
---|
6046 | | - { |
---|
6047 | | - gl.glNormal3f(0, 0, 1); |
---|
6048 | | - } |
---|
6049 | | - |
---|
6050 | | - if (c != null) |
---|
6051 | | - //System.out.println("glcolor = " + c[count3] + ", " + c[count3+1] + ", " + c[count3+2]); |
---|
6052 | | - { |
---|
6053 | | - gl.glColor4f(c[count3/3], c[count3/3 /* + 1*/], c[count3/3 /* + 2*/], 1); |
---|
6054 | | - } |
---|
6055 | | - } |
---|
6056 | | - if (flipV) |
---|
6057 | | - gl.glTexCoord2f(uv[count2], 1-uv[count2 + 1]); |
---|
6058 | | - else |
---|
6059 | | - gl.glTexCoord2f(uv[count2], uv[count2 + 1]); |
---|
6060 | | - //System.out.println("vertex1 = " + v[count3] + ", " + v[count3+1] + ", " + v[count3+2]); |
---|
6061 | | - gl.glVertex3f(v[count3], v[count3 + 1], v[count3 + 2]); |
---|
6062 | | - |
---|
6063 | | - count2 += 2; |
---|
6064 | | - count3 += 3; |
---|
6065 | | - if (!selectmode) |
---|
6066 | | - { |
---|
6067 | | - if (n[count3] != 0 || n[count3 + 1] != 0 || n[count3 + 2] != 0) |
---|
6068 | | - { |
---|
6069 | | - gl.glNormal3f(n[count3], n[count3 + 1], n[count3 + 2]); |
---|
6070 | | - } else |
---|
6071 | | - { |
---|
6072 | | - gl.glNormal3f(0, 0, 1); |
---|
6073 | | - } |
---|
6074 | | - if (c != null) |
---|
6075 | | - { |
---|
6076 | | - gl.glColor4f(c[count3/3], c[count3/3 /* + 1*/], c[count3/3 /* + 2*/], 1); |
---|
6077 | | - } |
---|
6078 | | - } |
---|
6079 | | - if (flipV) |
---|
6080 | | - gl.glTexCoord2f(uv[count2], 1-uv[count2 + 1]); |
---|
6081 | | - else |
---|
6082 | | - gl.glTexCoord2f(uv[count2], uv[count2 + 1]); |
---|
6083 | | - //System.out.println("vertex2 = " + v[count3] + ", " + v[count3+1] + ", " + v[count3+2]); |
---|
6084 | | - gl.glVertex3f(v[count3], v[count3 + 1], v[count3 + 2]); |
---|
6085 | | - |
---|
6086 | | - count2 += 2; |
---|
6087 | | - count3 += 3; |
---|
6088 | | - for (int j = 0; j < strips[i] - 2; j++) |
---|
6089 | | - { |
---|
6090 | | - //gl.glTexCoord2d(...); |
---|
6091 | | - if (!selectmode) |
---|
6092 | | - { |
---|
6093 | | - if (n[count3] != 0 || n[count3 + 1] != 0 || n[count3 + 2] != 0) |
---|
6094 | | - { |
---|
6095 | | - gl.glNormal3f(n[count3], n[count3 + 1], n[count3 + 2]); |
---|
6096 | | - } else |
---|
6097 | | - { |
---|
6098 | | - gl.glNormal3f(0, 0, 1); |
---|
6099 | | - } |
---|
6100 | | - if (c != null) |
---|
6101 | | - { |
---|
6102 | | - gl.glColor4f(c[count3/3], c[count3/3 /* + 1*/], c[count3/3 /* + 2*/], 1); |
---|
6103 | | - } |
---|
6104 | | - } |
---|
6105 | | - |
---|
6106 | | - if (flipV) |
---|
6107 | | - gl.glTexCoord2f(uv[count2], 1-uv[count2 + 1]); |
---|
6108 | | - else |
---|
6109 | | - gl.glTexCoord2f(uv[count2], uv[count2 + 1]); |
---|
6110 | | - //System.out.println("coord3 = " + uv[count2] + ", " + uv[count2+1]); |
---|
6111 | | - gl.glVertex3f(v[count3], v[count3 + 1], v[count3 + 2]); |
---|
6112 | | - count2 += 2; |
---|
6113 | | - count3 += 3; |
---|
6114 | | - } |
---|
6115 | | - |
---|
6116 | | - gl.glEnd(); |
---|
6117 | | - } |
---|
6118 | | - } |
---|
6119 | | - |
---|
6120 | | - assert count3 == v.length; |
---|
| 6432 | + //bRep.GenerateNormalsMINE(); |
---|
6121 | 6433 | } |
---|
6122 | | - else // !trimmed |
---|
6123 | | - { |
---|
6124 | | - int count = 0; |
---|
6125 | | - for (int i = 0; i < strips.length; i++) |
---|
6126 | | - { |
---|
6127 | | - gl.glBegin(gl.GL_TRIANGLE_STRIP); |
---|
6128 | | - |
---|
6129 | | - Vertex p = bRep.GetVertex(bRep.indices[count++]); |
---|
6130 | | - Vertex q = bRep.GetVertex(bRep.indices[count++]); |
---|
6131 | | - |
---|
6132 | | - drawVertex(gl, p, selectmode); |
---|
6133 | | - drawVertex(gl, q, selectmode); |
---|
6134 | | - |
---|
6135 | | - for (int j = 0; j < strips[i] - 2; j++) |
---|
6136 | | - { |
---|
6137 | | - Vertex r = bRep.GetVertex(bRep.indices[count++]); |
---|
6138 | | - |
---|
6139 | | -// if (j%2 == 0) |
---|
6140 | | -// drawFace(p, q, r, display, null); |
---|
6141 | | -// else |
---|
6142 | | -// drawFace(p, r, q, display, null); |
---|
6143 | | - |
---|
6144 | | -// p = q; |
---|
6145 | | -// q = r; |
---|
6146 | | - drawVertex(gl, r, selectmode); |
---|
6147 | | - } |
---|
6148 | | - |
---|
6149 | | - gl.glEnd(); |
---|
6150 | | - } |
---|
6151 | | - } |
---|
| 6434 | + |
---|
| 6435 | + display.DrawGeometry(bRep, flipV, selectmode); |
---|
6152 | 6436 | } else // catch (Error e) |
---|
6153 | 6437 | { |
---|
6154 | 6438 | // TRIANGLE ARRAY |
---|
6155 | 6439 | if (IsOpaque()) // Static()) |
---|
6156 | 6440 | { |
---|
6157 | | - gl.glBegin(gl.GL_TRIANGLES); |
---|
| 6441 | + display.StartTriangles(); |
---|
6158 | 6442 | int facecount = bRep.FaceCount(); |
---|
6159 | 6443 | for (int i = 0; i < facecount; i++) |
---|
6160 | 6444 | { |
---|
.. | .. |
---|
6219 | 6503 | |
---|
6220 | 6504 | display.DrawFace(this, p, q, r, face); |
---|
6221 | 6505 | } |
---|
6222 | | - gl.glEnd(); |
---|
| 6506 | + display.EndTriangles(); |
---|
6223 | 6507 | } |
---|
6224 | 6508 | else |
---|
6225 | 6509 | { |
---|
.. | .. |
---|
6248 | 6532 | //System.out.println("SORT"); |
---|
6249 | 6533 | |
---|
6250 | 6534 | java.util.Arrays.sort(facescompare); |
---|
6251 | | - |
---|
6252 | | - gl.glBegin(gl.GL_TRIANGLES); |
---|
| 6535 | + |
---|
| 6536 | + display.StartTriangles(); |
---|
6253 | 6537 | for (int i = 0; i < facecount; i++) |
---|
6254 | 6538 | { |
---|
6255 | 6539 | Face face = bRep.GetFace(facescompare[i].index); |
---|
.. | .. |
---|
6263 | 6547 | |
---|
6264 | 6548 | display.DrawFace(this, p, q, r, face); |
---|
6265 | 6549 | } |
---|
6266 | | - gl.glEnd(); |
---|
| 6550 | + display.EndTriangles(); |
---|
6267 | 6551 | } |
---|
6268 | 6552 | |
---|
6269 | 6553 | if (false) // live && support != null && support.bRep != null) // debug weights |
---|
6270 | 6554 | { |
---|
| 6555 | + /* |
---|
6271 | 6556 | gl.glDisable(gl.GL_LIGHTING); |
---|
6272 | 6557 | float[] colorV = new float[3]; |
---|
6273 | 6558 | |
---|
.. | .. |
---|
6346 | 6631 | // gl.glEnd(); |
---|
6347 | 6632 | } |
---|
6348 | 6633 | } |
---|
| 6634 | + */ |
---|
6349 | 6635 | } |
---|
6350 | 6636 | } |
---|
6351 | 6637 | |
---|
.. | .. |
---|
6390 | 6676 | center.add(r); |
---|
6391 | 6677 | center.mul(1.0/3); |
---|
6392 | 6678 | |
---|
6393 | | - center.sub(CameraPane.theRenderer.eyeCamera.location); |
---|
| 6679 | + center.sub(Globals.theRenderer.EyeCamera().location); |
---|
6394 | 6680 | |
---|
6395 | 6681 | distance = center.dot(center); |
---|
6396 | 6682 | } |
---|
.. | .. |
---|
6404 | 6690 | void Print(Vertex v) |
---|
6405 | 6691 | { |
---|
6406 | 6692 | //System.err.println("(" + v.x + ", " + v.y + ", " + v.z + ")"); |
---|
6407 | | - } |
---|
6408 | | - |
---|
6409 | | - void drawVertex(javax.media.opengl.GL gl, Vertex pv, boolean selectmode) |
---|
6410 | | - { |
---|
6411 | | - if (!selectmode) |
---|
6412 | | - { |
---|
6413 | | - gl.glNormal3f((float) pv.norm.x, (float) pv.norm.y, (float) pv.norm.z); |
---|
6414 | | - gl.glColor4f(pv.AO, pv.AO, pv.AO, 1); |
---|
6415 | | - |
---|
6416 | | - if (flipV) |
---|
6417 | | - gl.glTexCoord2f((float) pv.s, 1-(float) pv.t); |
---|
6418 | | - else |
---|
6419 | | - gl.glTexCoord2f((float) pv.s, (float) pv.t); |
---|
6420 | | - } |
---|
6421 | | - |
---|
6422 | | - gl.glVertex3f((float) pv.x, (float) pv.y, (float) pv.z); |
---|
6423 | 6693 | } |
---|
6424 | 6694 | |
---|
6425 | 6695 | void drawSelf(ClickInfo info, int level, boolean select) |
---|
.. | .. |
---|
6993 | 7263 | int spotw = spot.x + spot.width; |
---|
6994 | 7264 | int spoth = spot.y + spot.height; |
---|
6995 | 7265 | info.g.fillRect(spot.x, spot.y, spot.width, spot.height); |
---|
6996 | | - if (CameraPane.Xmin > spot.x) |
---|
6997 | | - { |
---|
6998 | | - CameraPane.Xmin = spot.x; |
---|
6999 | | - } |
---|
7000 | | - if (CameraPane.Xmax < spotw) |
---|
7001 | | - { |
---|
7002 | | - CameraPane.Xmax = spotw; |
---|
7003 | | - } |
---|
7004 | | - if (CameraPane.Ymin > spot.y) |
---|
7005 | | - { |
---|
7006 | | - CameraPane.Ymin = spot.y; |
---|
7007 | | - } |
---|
7008 | | - if (CameraPane.Ymax < spoth) |
---|
7009 | | - { |
---|
7010 | | - CameraPane.Ymax = spoth; |
---|
7011 | | - } |
---|
| 7266 | +// if (CameraPane.Xmin > spot.x) |
---|
| 7267 | +// { |
---|
| 7268 | +// CameraPane.Xmin = spot.x; |
---|
| 7269 | +// } |
---|
| 7270 | +// if (CameraPane.Xmax < spotw) |
---|
| 7271 | +// { |
---|
| 7272 | +// CameraPane.Xmax = spotw; |
---|
| 7273 | +// } |
---|
| 7274 | +// if (CameraPane.Ymin > spot.y) |
---|
| 7275 | +// { |
---|
| 7276 | +// CameraPane.Ymin = spot.y; |
---|
| 7277 | +// } |
---|
| 7278 | +// if (CameraPane.Ymax < spoth) |
---|
| 7279 | +// { |
---|
| 7280 | +// CameraPane.Ymax = spoth; |
---|
| 7281 | +// } |
---|
7012 | 7282 | spot.translate(32, 32); |
---|
7013 | 7283 | spotw = spot.x + spot.width; |
---|
7014 | 7284 | spoth = spot.y + spot.height; |
---|
7015 | | - info.g.setColor(Color.blue); |
---|
| 7285 | + info.g.setColor(Color.cyan); |
---|
7016 | 7286 | info.g.fillRect(spot.x, spot.y, spot.width, spot.height); |
---|
7017 | | - if (CameraPane.Xmin > spot.x) |
---|
7018 | | - { |
---|
7019 | | - CameraPane.Xmin = spot.x; |
---|
7020 | | - } |
---|
7021 | | - if (CameraPane.Xmax < spotw) |
---|
7022 | | - { |
---|
7023 | | - CameraPane.Xmax = spotw; |
---|
7024 | | - } |
---|
7025 | | - if (CameraPane.Ymin > spot.y) |
---|
7026 | | - { |
---|
7027 | | - CameraPane.Ymin = spot.y; |
---|
7028 | | - } |
---|
7029 | | - if (CameraPane.Ymax < spoth) |
---|
7030 | | - { |
---|
7031 | | - CameraPane.Ymax = spoth; |
---|
7032 | | - } |
---|
7033 | | - info.g.drawLine(spotw, spoth, spotw, spoth - 15); |
---|
7034 | | - info.g.drawLine(spotw, spoth, spotw - 15, spoth); |
---|
| 7287 | +// if (CameraPane.Xmin > spot.x) |
---|
| 7288 | +// { |
---|
| 7289 | +// CameraPane.Xmin = spot.x; |
---|
| 7290 | +// } |
---|
| 7291 | +// if (CameraPane.Xmax < spotw) |
---|
| 7292 | +// { |
---|
| 7293 | +// CameraPane.Xmax = spotw; |
---|
| 7294 | +// } |
---|
| 7295 | +// if (CameraPane.Ymin > spot.y) |
---|
| 7296 | +// { |
---|
| 7297 | +// CameraPane.Ymin = spot.y; |
---|
| 7298 | +// } |
---|
| 7299 | +// if (CameraPane.Ymax < spoth) |
---|
| 7300 | +// { |
---|
| 7301 | +// CameraPane.Ymax = spoth; |
---|
| 7302 | +// } |
---|
| 7303 | + // bonhommes info.g.drawLine(spotw, spoth, spotw, spoth - boundary.height/2); // 15 |
---|
| 7304 | + //info.g.drawLine(spotw, spoth, spotw - boundary.width/2, spoth); // 15 |
---|
7035 | 7305 | spot.translate(0, -32); |
---|
7036 | | - info.g.setColor(Color.green); |
---|
| 7306 | + info.g.setColor(Color.yellow); |
---|
7037 | 7307 | info.g.fillRect(spot.x, spot.y, spot.width, spot.height); |
---|
7038 | | - if (CameraPane.Xmin > spot.x) |
---|
7039 | | - { |
---|
7040 | | - CameraPane.Xmin = spot.x; |
---|
7041 | | - } |
---|
7042 | | - if (CameraPane.Xmax < spotw) |
---|
7043 | | - { |
---|
7044 | | - CameraPane.Xmax = spotw; |
---|
7045 | | - } |
---|
7046 | | - if (CameraPane.Ymin > spot.y) |
---|
7047 | | - { |
---|
7048 | | - CameraPane.Ymin = spot.y; |
---|
7049 | | - } |
---|
7050 | | - if (CameraPane.Ymax < spoth) |
---|
7051 | | - { |
---|
7052 | | - CameraPane.Ymax = spoth; |
---|
7053 | | - } |
---|
7054 | | - info.g.drawArc(boundary.x, boundary.y, |
---|
7055 | | - boundary.width, boundary.height, 0, 360); |
---|
| 7308 | + info.g.setColor(Color.green); |
---|
| 7309 | +// if (CameraPane.Xmin > spot.x) |
---|
| 7310 | +// { |
---|
| 7311 | +// CameraPane.Xmin = spot.x; |
---|
| 7312 | +// } |
---|
| 7313 | +// if (CameraPane.Xmax < spotw) |
---|
| 7314 | +// { |
---|
| 7315 | +// CameraPane.Xmax = spotw; |
---|
| 7316 | +// } |
---|
| 7317 | +// if (CameraPane.Ymin > spot.y) |
---|
| 7318 | +// { |
---|
| 7319 | +// CameraPane.Ymin = spot.y; |
---|
| 7320 | +// } |
---|
| 7321 | +// if (CameraPane.Ymax < spoth) |
---|
| 7322 | +// { |
---|
| 7323 | +// CameraPane.Ymax = spoth; |
---|
| 7324 | +// } |
---|
| 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); |
---|
7056 | 7327 | //info.g.drawArc(spot.x, spotw, spot.width/2, boundary.height/2, 0, 360); |
---|
7057 | | - if (CameraPane.Xmin > boundary.x) |
---|
7058 | | - { |
---|
7059 | | - CameraPane.Xmin = boundary.x; |
---|
7060 | | - } |
---|
7061 | | - if (CameraPane.Xmax < boundary.x + boundary.width) |
---|
7062 | | - { |
---|
7063 | | - CameraPane.Xmax = boundary.x + boundary.width; |
---|
7064 | | - } |
---|
7065 | | - if (CameraPane.Ymin > boundary.y) |
---|
7066 | | - { |
---|
7067 | | - CameraPane.Ymin = boundary.y; |
---|
7068 | | - } |
---|
7069 | | - if (CameraPane.Ymax < boundary.y + boundary.height) |
---|
7070 | | - { |
---|
7071 | | - CameraPane.Ymax = boundary.y + boundary.height; |
---|
7072 | | - } |
---|
| 7328 | +// if (CameraPane.Xmin > boundary.x) |
---|
| 7329 | +// { |
---|
| 7330 | +// CameraPane.Xmin = boundary.x; |
---|
| 7331 | +// } |
---|
| 7332 | +// if (CameraPane.Xmax < boundary.x + boundary.width) |
---|
| 7333 | +// { |
---|
| 7334 | +// CameraPane.Xmax = boundary.x + boundary.width; |
---|
| 7335 | +// } |
---|
| 7336 | +// if (CameraPane.Ymin > boundary.y) |
---|
| 7337 | +// { |
---|
| 7338 | +// CameraPane.Ymin = boundary.y; |
---|
| 7339 | +// } |
---|
| 7340 | +// if (CameraPane.Ymax < boundary.y + boundary.height) |
---|
| 7341 | +// { |
---|
| 7342 | +// CameraPane.Ymax = boundary.y + boundary.height; |
---|
| 7343 | +// } |
---|
7073 | 7344 | return; |
---|
7074 | 7345 | } |
---|
7075 | 7346 | } |
---|
.. | .. |
---|
7086 | 7357 | startX = info.x; |
---|
7087 | 7358 | startY = info.y; |
---|
7088 | 7359 | |
---|
7089 | | - hitSomething = 0; |
---|
| 7360 | + hitSomething = -1; |
---|
7090 | 7361 | cVector origin = new cVector(); |
---|
7091 | 7362 | //LA.xformPos(origin, toParent, origin); |
---|
7092 | 7363 | Rectangle spot = new Rectangle(); |
---|
.. | .. |
---|
7119 | 7390 | } |
---|
7120 | 7391 | |
---|
7121 | 7392 | //System.out.println("info.modifiers = " + info.modifiers); |
---|
7122 | | - modified = (info.modifiers & CameraPane.META) != 0; |
---|
| 7393 | + modified = (info.modifiers & CameraPane.SHIFT) != 0; // Was META |
---|
7123 | 7394 | //System.out.println("modified = " + modified); |
---|
7124 | 7395 | //new Exception().printStackTrace(); |
---|
7125 | 7396 | //viewCode = info.pane.renderCamera.viewCode; |
---|
.. | .. |
---|
7147 | 7418 | return true; |
---|
7148 | 7419 | } |
---|
7149 | 7420 | |
---|
7150 | | - void doEditDrag0(ClickInfo info) |
---|
| 7421 | + void doEditDrag0(ClickInfo info, boolean opposite) |
---|
7151 | 7422 | { |
---|
7152 | 7423 | if (hitSomething == 0) |
---|
7153 | 7424 | { |
---|
.. | .. |
---|
7162 | 7433 | //System.out.println("hitSomething = " + hitSomething); |
---|
7163 | 7434 | |
---|
7164 | 7435 | double scale = 0.005f * info.camera.Distance(); |
---|
| 7436 | + |
---|
7165 | 7437 | cVector xlate = new cVector(); |
---|
7166 | 7438 | //cVector xlate2 = new cVector(); |
---|
7167 | 7439 | switch (hitSomething) |
---|
.. | .. |
---|
7172 | 7444 | |
---|
7173 | 7445 | case hitCenter: // Translate |
---|
7174 | 7446 | |
---|
7175 | | - scale *= 0.05f * info.pane.theRenderer.renderCamera.Distance(); |
---|
| 7447 | + scale *= 0.05f * Globals.theRenderer.RenderCamera().Distance(); |
---|
7176 | 7448 | |
---|
7177 | | - if (modified) |
---|
| 7449 | + if (modified || opposite) |
---|
7178 | 7450 | { |
---|
7179 | 7451 | //assert(false); |
---|
7180 | 7452 | /* |
---|
.. | .. |
---|
7220 | 7492 | } |
---|
7221 | 7493 | LA.xformDir(up, ClickInfo.matbuffer, up); |
---|
7222 | 7494 | // if (!CameraPane.LOCALTRANSFORM) |
---|
7223 | | - LA.xformDir(up, info.pane.theRenderer.renderCamera.toScreen, up); |
---|
| 7495 | + LA.xformDir(up, Globals.theRenderer.RenderCamera().toScreen, up); |
---|
7224 | 7496 | LA.xformDir(info.camera.away, ClickInfo.matbuffer, away); |
---|
7225 | 7497 | // if (!CameraPane.LOCALTRANSFORM) |
---|
7226 | | - LA.xformDir(away, info.pane.theRenderer.renderCamera.toScreen, away); |
---|
| 7498 | + LA.xformDir(away, Globals.theRenderer.RenderCamera().toScreen, away); |
---|
7227 | 7499 | //LA.vecCross(up, cVector.Z, right2); |
---|
7228 | 7500 | |
---|
7229 | 7501 | cVector delta = LA.newVector(info.x - startX, startY - info.y, 0); |
---|
.. | .. |
---|
7268 | 7540 | |
---|
7269 | 7541 | if (modified) |
---|
7270 | 7542 | { |
---|
| 7543 | + // Rotate 90 degrees |
---|
7271 | 7544 | angle /= (Math.PI / 4); |
---|
7272 | 7545 | angle = Math.floor(angle + 0.5); |
---|
7273 | 7546 | angle *= (Math.PI / 4); |
---|
.. | .. |
---|
7281 | 7554 | } |
---|
7282 | 7555 | /**/ |
---|
7283 | 7556 | |
---|
7284 | | - switch (info.pane.renderCamera.viewCode) |
---|
| 7557 | + switch (info.pane.RenderCamera().viewCode) |
---|
7285 | 7558 | { |
---|
7286 | 7559 | case 1: // '\001' |
---|
7287 | 7560 | LA.matZRotate(toParent, angle); |
---|
.. | .. |
---|
7309 | 7582 | |
---|
7310 | 7583 | case hitScale: // scale |
---|
7311 | 7584 | double hScale = (double) (info.x - centerPt.x) / 32; |
---|
| 7585 | + double sign = 1; |
---|
| 7586 | + if (hScale < 0) |
---|
| 7587 | + { |
---|
| 7588 | + sign = -1; |
---|
| 7589 | + } |
---|
| 7590 | + hScale = sign*Math.pow(sign*hScale, scale * 50); |
---|
7312 | 7591 | if (hScale < 0.01) |
---|
7313 | 7592 | { |
---|
7314 | | - hScale = 0.01; |
---|
| 7593 | + //hScale = 0.01; |
---|
7315 | 7594 | } |
---|
7316 | | - hScale = Math.pow(hScale, scale * 50); |
---|
7317 | | - if (hScale < 0.01) |
---|
7318 | | - { |
---|
7319 | | - hScale = 0.01; |
---|
7320 | | - } |
---|
| 7595 | + |
---|
7321 | 7596 | double vScale = (double) (info.y - centerPt.y) / 32; |
---|
7322 | | - if (vScale < 0.01) |
---|
| 7597 | + sign = 1; |
---|
| 7598 | + if (vScale < 0) |
---|
7323 | 7599 | { |
---|
7324 | | - vScale = 0.01; |
---|
| 7600 | + sign = -1; |
---|
7325 | 7601 | } |
---|
7326 | | - vScale = Math.pow(vScale, scale * 50); |
---|
| 7602 | + vScale = sign*Math.pow(sign*vScale, scale * 50); |
---|
7327 | 7603 | if (vScale < 0.01) |
---|
7328 | 7604 | { |
---|
7329 | | - vScale = 0.01; |
---|
| 7605 | + //vScale = 0.01; |
---|
7330 | 7606 | } |
---|
7331 | 7607 | LA.matCopy(startMat, toParent); |
---|
7332 | 7608 | /**/ |
---|
.. | .. |
---|
7337 | 7613 | } |
---|
7338 | 7614 | /**/ |
---|
7339 | 7615 | |
---|
7340 | | - switch (info.pane.renderCamera.viewCode) |
---|
| 7616 | + double totalScale = Math.sqrt(hScale*hScale + vScale*vScale) / Math.sqrt(2); |
---|
| 7617 | + |
---|
| 7618 | + if (totalScale < 0.01) |
---|
| 7619 | + { |
---|
| 7620 | + totalScale = 0.01; |
---|
| 7621 | + } |
---|
| 7622 | + |
---|
| 7623 | + switch (info.pane.RenderCamera().viewCode) |
---|
7341 | 7624 | { |
---|
7342 | 7625 | case 3: // '\001' |
---|
7343 | | - if (modified) |
---|
| 7626 | + if (modified || opposite) |
---|
7344 | 7627 | { |
---|
7345 | 7628 | //LA.matScale(toParent, 1, hScale, vScale); |
---|
7346 | | - LA.matScale(toParent, vScale, 1, 1); |
---|
| 7629 | + LA.matScale(toParent, totalScale, 1, 1); |
---|
7347 | 7630 | } // vScale, 1); |
---|
7348 | 7631 | else |
---|
7349 | 7632 | { |
---|
7350 | | - LA.matScale(toParent, vScale, vScale, vScale); |
---|
| 7633 | + // EXCEPTION! |
---|
| 7634 | + LA.matScale(toParent, totalScale, totalScale, totalScale); |
---|
7351 | 7635 | } // vScale, 1); |
---|
7352 | 7636 | break; |
---|
7353 | 7637 | |
---|
7354 | 7638 | case 2: // '\002' |
---|
7355 | | - if (modified) |
---|
| 7639 | + if (modified || opposite) |
---|
7356 | 7640 | { |
---|
7357 | 7641 | //LA.matScale(toParent, hScale, 1, vScale); |
---|
7358 | | - LA.matScale(toParent, 1, vScale, 1); |
---|
| 7642 | + LA.matScale(toParent, 1, totalScale, 1); |
---|
7359 | 7643 | } else |
---|
7360 | 7644 | { |
---|
7361 | | - LA.matScale(toParent, vScale, 1, vScale); |
---|
| 7645 | + LA.matScale(toParent, totalScale, 1, totalScale); |
---|
7362 | 7646 | } |
---|
7363 | 7647 | break; |
---|
7364 | 7648 | |
---|
7365 | 7649 | case 1: // '\003' |
---|
7366 | | - if (modified) |
---|
| 7650 | + if (modified || opposite) |
---|
7367 | 7651 | { |
---|
7368 | 7652 | //LA.matScale(toParent, hScale, vScale, 1); |
---|
7369 | | - LA.matScale(toParent, 1, 1, vScale); |
---|
| 7653 | + LA.matScale(toParent, 1, 1, totalScale); |
---|
7370 | 7654 | } else |
---|
7371 | 7655 | { |
---|
7372 | | - LA.matScale(toParent, vScale, vScale, 1); |
---|
| 7656 | + LA.matScale(toParent, totalScale, totalScale, 1); |
---|
7373 | 7657 | } |
---|
7374 | 7658 | break; |
---|
7375 | 7659 | } |
---|
.. | .. |
---|
7502 | 7786 | //return super.toString() + " (id=" + list + ")" + " (brep=" + bRep + ")"; |
---|
7503 | 7787 | //return name + " (id=" + list + ")" + " (brep=" + bRep + ") " + super.toString(); |
---|
7504 | 7788 | //return name + " (#tri = " + (bRep==null?0:bRep.VertexCount()) + ") " + super.toString(); |
---|
| 7789 | + |
---|
| 7790 | + String objname; |
---|
| 7791 | + |
---|
7505 | 7792 | if (false) //parent != null) |
---|
7506 | 7793 | { |
---|
7507 | | - return name + " " + System.identityHashCode(this) + " (" + parent.name + " " + System.identityHashCode(parent) + ")"; |
---|
| 7794 | + objname = name + " " + System.identityHashCode(this) + " (" + parent.name + " " + System.identityHashCode(parent) + ")"; |
---|
7508 | 7795 | } else |
---|
7509 | 7796 | { |
---|
7510 | | - return GetName() + (Math.abs(count) == 1000 ? (count == 1000 ? " " : " * ") : (" (" + (count /*- 1*/) + ") ")) + /*(IsSelected()?"(selected) ":"") + (touched?"(touched) ":"") */ +System.identityHashCode(this); |
---|
| 7797 | + objname = GetName() + (Math.abs(count) == 1000 ? (count == 1000 ? " " : " * ") : (" (" + (count - 1) + ")")) + /*(IsSelected()?"(selected) ":"") + (touched?"(touched) ":"") */ ""; |
---|
7511 | 7798 | } // + super.toString(); |
---|
7512 | 7799 | //return name + " (" + (SizeOf.deepSizeOf(this)/1024) + "K) " + this.getClass().getName(); |
---|
| 7800 | + |
---|
| 7801 | + if (!Globals.ADVANCED) |
---|
| 7802 | + return objname; |
---|
| 7803 | + |
---|
| 7804 | + return objname + " " + System.identityHashCode(this); |
---|
7513 | 7805 | } |
---|
7514 | 7806 | |
---|
7515 | 7807 | public int hashCode() |
---|
.. | .. |
---|
7565 | 7857 | objectUI.closeUI(); |
---|
7566 | 7858 | if (editWindow != null) |
---|
7567 | 7859 | { |
---|
| 7860 | + editWindow.ctrlPanel.FlushUI(); |
---|
7568 | 7861 | editWindow.refreshContents(); |
---|
7569 | 7862 | } // ? new |
---|
7570 | 7863 | objectUI = null; |
---|
.. | .. |
---|
7573 | 7866 | { |
---|
7574 | 7867 | editWindow = null; |
---|
7575 | 7868 | } // ? |
---|
| 7869 | + } |
---|
| 7870 | + else |
---|
| 7871 | + { |
---|
| 7872 | + //editWindow.closeUI(); |
---|
7576 | 7873 | } |
---|
7577 | 7874 | } |
---|
7578 | 7875 | |
---|
.. | .. |
---|
7585 | 7882 | /*transient*/ cVector2[] projectedVertices = new cVector2[0]; |
---|
7586 | 7883 | |
---|
7587 | 7884 | Object3D /*Composite*/ parent; |
---|
7588 | | - Object3D /*Composite*/ fileparent; |
---|
| 7885 | + Object3D /*Composite*/ fileparent; // In the case of FileObject |
---|
7589 | 7886 | |
---|
7590 | 7887 | double[][] toParent; // dynamic matrix |
---|
7591 | 7888 | double[][] fromParent; |
---|
.. | .. |
---|
7700 | 7997 | { |
---|
7701 | 7998 | assert(bRep != null); |
---|
7702 | 7999 | if (!(support instanceof GenericJoint)) // support.bRep != null) |
---|
7703 | | - GrafreeD.Assert(support.bRep == bRep.support); |
---|
| 8000 | + Grafreed.Assert(support.bRep == bRep.support); |
---|
7704 | 8001 | } |
---|
7705 | 8002 | else |
---|
7706 | 8003 | { |
---|
.. | .. |
---|
7731 | 8028 | } |
---|
7732 | 8029 | |
---|
7733 | 8030 | transient ObjEditor editWindow; |
---|
| 8031 | + transient ObjEditor manipWindow; |
---|
| 8032 | + |
---|
| 8033 | + transient boolean pinned; |
---|
| 8034 | + |
---|
7734 | 8035 | transient ObjectUI objectUI; |
---|
7735 | 8036 | public static int povDepth = 0; |
---|
7736 | 8037 | private static cVector tbMin = new cVector(); |
---|
.. | .. |
---|
7749 | 8050 | private static cVector edge2 = new cVector(); |
---|
7750 | 8051 | //private static cVector norm = new cVector(); |
---|
7751 | 8052 | /*transient private*/ int hitSomething; |
---|
7752 | | - private static final int hitCenter = 1; |
---|
7753 | | - private static final int hitScale = 2; |
---|
7754 | | - private static final int hitRotate = 3; |
---|
| 8053 | + static final int hitCenter = 1; |
---|
| 8054 | + static final int hitScale = 2; |
---|
| 8055 | + static final int hitRotate = 3; |
---|
7755 | 8056 | /*transient*/ /*private*/ int viewCode; // Now used for transparency cache flag |
---|
7756 | 8057 | /*transient*/ private Point centerPt; |
---|
7757 | 8058 | /*transient*/ private int startX; |
---|